// Compiled by ClojureScript 1.9.562 {}
goog.provide('weathergen.ui');
goog.require('cljs.core');
goog.require('clojure.data');
goog.require('clojure.set');
goog.require('clojure.string');
goog.require('garden.core');
goog.require('javelin.core');
goog.require('hoplon.core');
goog.require('hoplon.svg');
goog.require('garden.selectors');
goog.require('goog.dom');
goog.require('goog.crypt.base64');
goog.require('goog.events');
goog.require('goog.events.MouseWheelHandler');
goog.require('goog.string');
goog.require('goog.string.format');
goog.require('goog.style');
goog.require('octet.core');
goog.require('weathergen.canvas');
goog.require('weathergen.coordinates');
goog.require('weathergen.database');
goog.require('weathergen.dtc');
goog.require('weathergen.encoding');
goog.require('weathergen.falcon.constants');
goog.require('weathergen.falcon.files.images');
goog.require('weathergen.falcon.files.mission');
goog.require('weathergen.falcon.install');
goog.require('weathergen.filesystem');
goog.require('weathergen.fmap');
goog.require('weathergen.help');
goog.require('weathergen.ipc');
goog.require('weathergen.math');
goog.require('weathergen.model');
goog.require('weathergen.progress');
goog.require('weathergen.settings');
goog.require('weathergen.time');
goog.require('weathergen.twx');
goog.require('weathergen.ui.buttons');
goog.require('weathergen.ui.common');
goog.require('weathergen.ui.grids');
goog.require('weathergen.ui.layers.flights');
goog.require('weathergen.ui.trees');
goog.require('weathergen.ui.tabs');
goog.require('weathergen.util');
goog.require('weathergen.wind');
goog.require('cljs.core.async');
goog.require('cljs.reader');
goog.require('taoensso.timbre');
weathergen.ui.revision = (7);
weathergen.ui.agents = (function (){var is_agent_QMARK_ = (function (agent){
return !((navigator.userAgent.indexOf(agent) < (0)));
});
var agent_props = new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"chrome","chrome",1718738387),"Chrome",new cljs.core.Keyword(null,"msie","msie",719469183),"MSIE",new cljs.core.Keyword(null,"trident","trident",1372708537),"Trident",new cljs.core.Keyword(null,"firefox","firefox",1283768880),"Firefox",new cljs.core.Keyword(null,"safari","safari",497115653),"Safari",new cljs.core.Keyword(null,"opera","opera",658572996),"op"], null);
return cljs.core.zipmap.call(null,cljs.core.keys.call(null,agent_props),cljs.core.map.call(null,is_agent_QMARK_,cljs.core.vals.call(null,agent_props)));
})();
weathergen.ui.safari_QMARK_ = (function (){var and__23326__auto__ = new cljs.core.Keyword(null,"safari","safari",497115653).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents);
if(cljs.core.truth_(and__23326__auto__)){
return cljs.core.not.call(null,new cljs.core.Keyword(null,"chrome","chrome",1718738387).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents));
} else {
return and__23326__auto__;
}
})();
weathergen.ui.ie_QMARK_ = (function (){var or__23338__auto__ = new cljs.core.Keyword(null,"msie","msie",719469183).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return new cljs.core.Keyword(null,"trident","trident",1372708537).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents);
}
})();
weathergen.ui.electron = require("electron");
weathergen.ui.ipcRenderer = weathergen.ui.electron.ipcRenderer;
weathergen.ui.zlib = require("zlib");
var window_45831 = jQuery(window);
weathergen.ui.window_size = javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [window_45831.width(),window_45831.height()], null));

window_45831.resize(((function (window_45831){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.window_size,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [window_45831.width(),window_45831.height()], null));
});})(window_45831))
);
weathergen.ui.default_weather_params = cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"temp-uniformity","temp-uniformity",836756864),new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"evolution","evolution",944820557),new cljs.core.Keyword(null,"seed","seed",68613327),new cljs.core.Keyword(null,"feature-size","feature-size",-878734864),new cljs.core.Keyword(null,"cell-count","cell-count",-441457582),new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"categories","categories",178386610),new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),new cljs.core.Keyword(null,"turbulence","turbulence",-915506410),new cljs.core.Keyword(null,"origin","origin",1037372088),new cljs.core.Keyword(null,"wind-uniformity","wind-uniformity",827531801),new cljs.core.Keyword(null,"crossfade","crossfade",-118506406),new cljs.core.Keyword(null,"prevailing-wind","prevailing-wind",-190580386)],[0.7,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"min","min",444991522),(29),new cljs.core.Keyword(null,"max","max",61366548),(31)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"offset","offset",296498311),(1234),new cljs.core.Keyword(null,"current","current",-1088038603),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),(1),new cljs.core.Keyword(null,"hour","hour",-555989214),(5),new cljs.core.Keyword(null,"minute","minute",-642875969),(0)], null),new cljs.core.Keyword(null,"max","max",61366548),null], null),(3600),(1234),(10),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(59),(59)], null),cljs.core.PersistentVector.EMPTY,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(5),new cljs.core.Keyword(null,"mean","mean",-1359234715),(10),new cljs.core.Keyword(null,"max","max",61366548),(30)], null),new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(20),new cljs.core.Keyword(null,"mean","mean",-1359234715),(22),new cljs.core.Keyword(null,"max","max",61366548),(24)], null)], null),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"pressure","pressure",505343747),(30),new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(0),new cljs.core.Keyword(null,"mean","mean",-1359234715),(7),new cljs.core.Keyword(null,"max","max",61366548),(20)], null),new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(18),new cljs.core.Keyword(null,"mean","mean",-1359234715),(21),new cljs.core.Keyword(null,"max","max",61366548),(23)], null)], null),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"pressure","pressure",505343747),29.85,new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(10),new cljs.core.Keyword(null,"mean","mean",-1359234715),(15),new cljs.core.Keyword(null,"max","max",61366548),(30)], null),new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(15),new cljs.core.Keyword(null,"mean","mean",-1359234715),(18),new cljs.core.Keyword(null,"max","max",61366548),(21)], null)], null),new cljs.core.Keyword(null,"inclement","inclement",-550669382),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"pressure","pressure",505343747),29.4,new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(15),new cljs.core.Keyword(null,"mean","mean",-1359234715),(25),new cljs.core.Keyword(null,"max","max",61366548),(60)], null),new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(12),new cljs.core.Keyword(null,"mean","mean",-1359234715),(14),new cljs.core.Keyword(null,"max","max",61366548),(16)], null)], null)], null),cljs.core.PersistentVector.EMPTY,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(1),new cljs.core.Keyword(null,"power","power",-937852079),(250)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1000),(1000)], null),0.7,0.1,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"heading","heading",-1312171873),(325)], null)]);
weathergen.ui.weather_params = javelin.core.cell.call(null,null);
weathergen.ui.default_cloud_params = new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"cumulus-density","cumulus-density",-212067170),(5),new cljs.core.Keyword(null,"cumulus-size","cumulus-size",-954219270),0.98,new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),(30),new cljs.core.Keyword(null,"fair","fair",1684139423),(20),new cljs.core.Keyword(null,"poor","poor",1462482211),(10),new cljs.core.Keyword(null,"inclement","inclement",-550669382),(5)], null),new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),(35000),new cljs.core.Keyword(null,"fair","fair",1684139423),(30000),new cljs.core.Keyword(null,"poor","poor",1462482211),(11300),new cljs.core.Keyword(null,"inclement","inclement",-550669382),(6300)], null),new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),(13300),new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),(0),new cljs.core.Keyword(null,"fair","fair",1684139423),(8000),new cljs.core.Keyword(null,"poor","poor",1462482211),(7500),new cljs.core.Keyword(null,"inclement","inclement",-550669382),(2000)], null),new cljs.core.Keyword(null,"contrails","contrails",1430581743),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),(34000),new cljs.core.Keyword(null,"fair","fair",1684139423),(28000),new cljs.core.Keyword(null,"poor","poor",1462482211),(25000),new cljs.core.Keyword(null,"inclement","inclement",-550669382),(20000)], null)], null);
weathergen.ui.random_int = (function weathergen$ui$random_int(var_args){
var args45832 = [];
var len__24559__auto___45835 = arguments.length;
var i__24560__auto___45836 = (0);
while(true){
if((i__24560__auto___45836 < len__24559__auto___45835)){
args45832.push((arguments[i__24560__auto___45836]));

var G__45837 = (i__24560__auto___45836 + (1));
i__24560__auto___45836 = G__45837;
continue;
} else {
}
break;
}

var G__45834 = args45832.length;
switch (G__45834) {
case 2:
return weathergen.ui.random_int.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return weathergen.ui.random_int.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args45832.length)].join('')));

}
});

weathergen.ui.random_int.cljs$core$IFn$_invoke$arity$2 = (function (from,to){
return weathergen.ui.random_int.call(null,from,to,(1));
});

weathergen.ui.random_int.cljs$core$IFn$_invoke$arity$3 = (function (from,to,step){
var range = (to - from);
var steps = (cljs.core.long$.call(null,(range / step)) + (1));
return ((cljs.core.long$.call(null,(cljs.core.rand.call(null) * steps)) * step) + from);
});

weathergen.ui.random_int.cljs$lang$maxFixedArity = 3;

/**
 * Returns a plausible but random set of global weather paramaters.
 */
weathergen.ui.random_cloud_params = (function weathergen$ui$random_cloud_params(){
var stratus_base = (function (){var vec__45851 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(4),(function (){
return weathergen.ui.random_int.call(null,(1500),(40000),(500));
})));
var i = cljs.core.nth.call(null,vec__45851,(0),null);
var p = cljs.core.nth.call(null,vec__45851,(1),null);
var f = cljs.core.nth.call(null,vec__45851,(2),null);
var s = cljs.core.nth.call(null,vec__45851,(3),null);
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),s,new cljs.core.Keyword(null,"fair","fair",1684139423),f,new cljs.core.Keyword(null,"poor","poor",1462482211),p,new cljs.core.Keyword(null,"inclement","inclement",-550669382),i], null);
})();
var stratus_top = ((function (){var x__23676__auto__ = new cljs.core.Keyword(null,"poor","poor",1462482211).cljs$core$IFn$_invoke$arity$1(stratus_base);
var y__23677__auto__ = new cljs.core.Keyword(null,"inclement","inclement",-550669382).cljs$core$IFn$_invoke$arity$1(stratus_base);
return ((x__23676__auto__ > y__23677__auto__) ? x__23676__auto__ : y__23677__auto__);
})() + weathergen.ui.random_int.call(null,(500),(10000),(500)));
return new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"cumulus-density","cumulus-density",-212067170),weathergen.ui.random_int.call(null,(5),(50)),new cljs.core.Keyword(null,"cumulus-size","cumulus-size",-954219270),(5.0 * cljs.core.rand.call(null)),new cljs.core.Keyword(null,"visibility","visibility",1338380893),(function (){var vec__45854 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(4),((function (stratus_base,stratus_top){
return (function (){
var r = weathergen.ui.random_int.call(null,(0),(30));
if((r < (2))){
return (weathergen.ui.random_int.call(null,(0),(20)) / 10.0);
} else {
return r;
}
});})(stratus_base,stratus_top))
));
var i = cljs.core.nth.call(null,vec__45854,(0),null);
var p = cljs.core.nth.call(null,vec__45854,(1),null);
var f = cljs.core.nth.call(null,vec__45854,(2),null);
var s = cljs.core.nth.call(null,vec__45854,(3),null);
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),s,new cljs.core.Keyword(null,"fair","fair",1684139423),f,new cljs.core.Keyword(null,"poor","poor",1462482211),p,new cljs.core.Keyword(null,"inclement","inclement",-550669382),i], null);
})(),new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),stratus_base,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),stratus_top,new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),(function (){var vec__45857 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(3),((function (stratus_base,stratus_top){
return (function (){
return weathergen.ui.random_int.call(null,(1000),(22000),(1000));
});})(stratus_base,stratus_top))
));
var i = cljs.core.nth.call(null,vec__45857,(0),null);
var p = cljs.core.nth.call(null,vec__45857,(1),null);
var f = cljs.core.nth.call(null,vec__45857,(2),null);
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),(0),new cljs.core.Keyword(null,"fair","fair",1684139423),(function (){var x__23683__auto__ = (new cljs.core.Keyword(null,"fair","fair",1684139423).cljs$core$IFn$_invoke$arity$1(stratus_base) - (1000));
var y__23684__auto__ = f;
return ((x__23683__auto__ < y__23684__auto__) ? x__23683__auto__ : y__23684__auto__);
})(),new cljs.core.Keyword(null,"poor","poor",1462482211),(function (){var x__23683__auto__ = (stratus_top - (1000));
var y__23684__auto__ = p;
return ((x__23683__auto__ < y__23684__auto__) ? x__23683__auto__ : y__23684__auto__);
})(),new cljs.core.Keyword(null,"inclement","inclement",-550669382),(function (){var x__23683__auto__ = (stratus_top - (1000));
var y__23684__auto__ = i;
return ((x__23683__auto__ < y__23684__auto__) ? x__23683__auto__ : y__23684__auto__);
})()], null);
})(),new cljs.core.Keyword(null,"contrails","contrails",1430581743),(function (){var vec__45860 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(4),((function (stratus_base,stratus_top){
return (function (){
return weathergen.ui.random_int.call(null,(20000),(40000),(1000));
});})(stratus_base,stratus_top))
));
var i = cljs.core.nth.call(null,vec__45860,(0),null);
var p = cljs.core.nth.call(null,vec__45860,(1),null);
var f = cljs.core.nth.call(null,vec__45860,(2),null);
var s = cljs.core.nth.call(null,vec__45860,(3),null);
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),s,new cljs.core.Keyword(null,"fair","fair",1684139423),f,new cljs.core.Keyword(null,"poor","poor",1462482211),p,new cljs.core.Keyword(null,"inclement","inclement",-550669382),i], null);
})()], null);
});
weathergen.ui.cloud_params = javelin.core.cell.call(null,weathergen.ui.default_cloud_params);
weathergen.ui.movement_params = javelin.core.cell.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"step","step",1288888124),(60),new cljs.core.Keyword(null,"direction","direction",-633359395),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"heading","heading",-1312171873),(135),new cljs.core.Keyword(null,"speed","speed",1257663751),(20)], null),new cljs.core.Keyword(null,"looping?","looping?",78344245),false], null));
weathergen.ui.map_size = javelin.core.formula.call(null,(function (window_size){
var vec__45863 = window_size;
var window_width = cljs.core.nth.call(null,vec__45863,(0),null);
var window_height = cljs.core.nth.call(null,vec__45863,(1),null);
var dim = (function (){var x__23676__auto__ = (250);
var y__23677__auto__ = (function (){var x__23683__auto__ = window_width;
var y__23684__auto__ = (window_height - (140));
return ((x__23683__auto__ < y__23684__auto__) ? x__23683__auto__ : y__23684__auto__);
})();
return ((x__23676__auto__ > y__23677__auto__) ? x__23676__auto__ : y__23677__auto__);
})();
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dim,dim], null);
})).call(null,weathergen.ui.window_size);
weathergen.ui.display_params = javelin.core.cell.call(null,new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"opacity","opacity",397153780),0.33,new cljs.core.Keyword(null,"display","display",242065432),new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"mouse-mode","mouse-mode",-1901710690),new cljs.core.Keyword(null,"select","select",1147833503),new cljs.core.Keyword(null,"overlay","overlay",-139131598),null,new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243),new cljs.core.Keyword(null,"inhg","inhg",-863180091),new cljs.core.Keyword(null,"flight-paths","flight-paths",159519268),null,new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"mission-name","mission-name",1479736582),null,new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),(1),new cljs.core.Keyword(null,"hour","hour",-555989214),(5),new cljs.core.Keyword(null,"minute","minute",-642875969),(0)], null),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),(1),new cljs.core.Keyword(null,"hour","hour",-555989214),(10),new cljs.core.Keyword(null,"minute","minute",-642875969),(0)], null),new cljs.core.Keyword(null,"step","step",1288888124),(15)], null)], null));
weathergen.ui.map_display = javelin.core.cell.call(null,cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"flight-path-size","flight-path-size",-1809746301),new cljs.core.Keyword(null,"icon-size","icon-size",414161352),new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003),new cljs.core.Keyword(null,"brightness","brightness",1067055820),new cljs.core.Keyword(null,"show-airbase-status?","show-airbase-status?",-2059784435),new cljs.core.Keyword(null,"airbase-label-style","airbase-label-style",-1349798514),new cljs.core.Keyword(null,"show-airbase-squadrons?","show-airbase-squadrons?",1245487954),new cljs.core.Keyword(null,"text-size","text-size",-945618309),new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124)],[(0),(0),true,0.5,true,new cljs.core.Keyword(null,"all","all",892129742),true,(0),true]));
weathergen.ui.map_text_scale = javelin.core.formula.call(null,(function (G__45866,G__45867){
return G__45866.call(null,4.0,new cljs.core.Keyword(null,"text-size","text-size",-945618309).cljs$core$IFn$_invoke$arity$1(G__45867));
})).call(null,Math.pow,weathergen.ui.map_display);
weathergen.ui.map_icon_scale = javelin.core.formula.call(null,(function (G__45868,G__45869){
return G__45868.call(null,4.0,new cljs.core.Keyword(null,"icon-size","icon-size",414161352).cljs$core$IFn$_invoke$arity$1(G__45869));
})).call(null,Math.pow,weathergen.ui.map_display);
weathergen.ui.map_show_text_background_QMARK_ = javelin.core.formula.call(null,(function (G__45870){
return new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124).cljs$core$IFn$_invoke$arity$1(G__45870);
})).call(null,weathergen.ui.map_display);
weathergen.ui.selected_cell = javelin.core.cell.call(null,null);
weathergen.ui.hover_cell = javelin.core.cell.call(null,null);
weathergen.ui.mouse_location = javelin.core.cell.call(null,null);
weathergen.ui.mouse_raw_offset = javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(0)], null));
weathergen.ui.prevent_recomputation_QMARK_ = javelin.core.cell.call(null,false);
/**
 * Holds the time that's in the 'jump/set to time' boxes because we
 *   need to retain a temporary value while people are making up their
 *   minds.
 */
weathergen.ui.time_params = javelin.core.cell.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"displayed","displayed",-436192586),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),(1),new cljs.core.Keyword(null,"hour","hour",-555989214),(5),new cljs.core.Keyword(null,"minute","minute",-642875969),(0)], null)], null));
weathergen.ui.weather_data = javelin.core.cell.call(null,null);
weathergen.ui.weather_data_params = javelin.core.cell.call(null,null);
weathergen.ui.computing = javelin.core.cell.call(null,true);
weathergen.ui.messages = javelin.core.cell.call(null,cljs.core.PersistentVector.EMPTY);
weathergen.ui.mission = javelin.core.cell.call(null,null);
weathergen.ui.hide_empty_airbases_QMARK_ = javelin.core.cell.call(null,true);
weathergen.ui.hide_inoperable_airbases_QMARK_ = javelin.core.cell.call(null,false);
weathergen.ui.included_squadron_types = javelin.core.cell.call(null,cljs.core.PersistentHashSet.EMPTY);
weathergen.ui.checked_airbases = javelin.core.cell.call(null,cljs.core.PersistentHashSet.EMPTY);
weathergen.ui.highlighted_airbase = javelin.core.cell.call(null,null);
cljs.core.add_watch.call(null,weathergen.ui.mission,new cljs.core.Keyword(null,"reset-object-data-on-mission-change","reset-object-data-on-mission-change",1100510422),(function (_,___$1,___$2,___$3){
return javelin.core.dosync_STAR_.call(null,(function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.highlighted_airbase,null);

return cljs.core.reset_BANG_.call(null,weathergen.ui.checked_airbases,cljs.core.PersistentHashSet.EMPTY);
}));
}));
weathergen.ui.settings = javelin.core.cell.call(null,weathergen.settings.load_settings.call(null));
weathergen.ui.zoom_speed = javelin.core.formula.call(null,(function (G__45871){
var or__23338__auto__ = new cljs.core.Keyword(null,"zoom-speed","zoom-speed",1787688902).cljs$core$IFn$_invoke$arity$1(G__45871);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return 0.95;
}
})).call(null,weathergen.ui.settings);
weathergen.ui.map_zoom = javelin.core.cell.call(null,(1));
weathergen.ui.map_pan = javelin.core.cell.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0)], null));
weathergen.ui.zoom_min = (1);
weathergen.ui.zoom_max = (200);
weathergen.ui.map_viewbox = javelin.core.formula.call(null,(function (weather_params,map_zoom,map_pan){
var vec__45872 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(weather_params);
var nx = cljs.core.nth.call(null,vec__45872,(0),null);
var ny = cljs.core.nth.call(null,vec__45872,(1),null);
var map__45875 = map_pan;
var map__45875__$1 = ((((!((map__45875 == null)))?((((map__45875.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45875.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45875):map__45875);
var x = cljs.core.get.call(null,map__45875__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__45875__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),(nx / map_zoom),new cljs.core.Keyword(null,"height","height",1025178622),(ny / map_zoom)], null);
})).call(null,weathergen.ui.weather_params,weathergen.ui.map_zoom,weathergen.ui.map_pan);
weathergen.ui.display_mode = javelin.core.cell.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166));
weathergen.ui.visible_sides = javelin.core.cell.call(null,null);
weathergen.ui.effective_visible_sides = javelin.core.formula.call(null,(function (mission,visible_sides,display_mode){
if(cljs.core.not.call(null,mission)){
return cljs.core.PersistentHashSet.EMPTY;
} else {
if(cljs.core.not.call(null,visible_sides)){
return cljs.core.set.call(null,weathergen.falcon.files.mission.sides.call(null,mission));
} else {
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166),display_mode)){
return cljs.core.set.call(null,weathergen.falcon.files.mission.sides.call(null,mission));
} else {
return visible_sides;

}
}
}
})).call(null,weathergen.ui.mission,weathergen.ui.visible_sides,weathergen.ui.display_mode);
weathergen.ui.visible_teams = javelin.core.formula.call(null,(function (mission,effective_visible_sides){
return cljs.core.set.call(null,(cljs.core.truth_((function (){var and__23326__auto__ = mission;
if(cljs.core.truth_(and__23326__auto__)){
return effective_visible_sides;
} else {
return and__23326__auto__;
}
})())?cljs.core.map.call(null,weathergen.falcon.files.mission.team_number,cljs.core.filter.call(null,(function (p1__45877_SHARP_){
return effective_visible_sides.call(null,weathergen.falcon.files.mission.side.call(null,mission,p1__45877_SHARP_));
}),weathergen.falcon.files.mission.teams.call(null,mission))):weathergen.falcon.files.mission.teams.call(null,mission)));
})).call(null,weathergen.ui.mission,weathergen.ui.effective_visible_sides);
weathergen.ui.briefing_notes = javelin.core.cell.call(null,"");
/**
 * Parses the contents of the build.txt file into a map.
 */
weathergen.ui.parse_build_info = (function weathergen$ui$parse_build_info(build_info){
return cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,cljs.core.map.call(null,(function (line){
var vec__45881 = clojure.string.split.call(null,line,/=/);
var name = cljs.core.nth.call(null,vec__45881,(0),null);
var value = cljs.core.nth.call(null,vec__45881,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var or__23338__auto__ = name;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "";
}
})(),(function (){var or__23338__auto__ = value;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "";
}
})()], null);
}),cljs.core.remove.call(null,clojure.string.blank_QMARK_,clojure.string.split_lines.call(null,build_info))));
});
weathergen.ui.build_info = javelin.core.cell.call(null,(function (){var path = weathergen.filesystem.path_combine.call(null,weathergen.ui.electron.remote.app.getAppPath(),"build.txt");
if(cljs.core.truth_(weathergen.filesystem.exists_QMARK_.call(null,path))){
return weathergen.ui.parse_build_info.call(null,weathergen.filesystem.file_text.call(null,path));
} else {
return null;
}
})());
weathergen.ui.flight_paths_layer = weathergen.ui.layers.flights.create.call(null,weathergen.ui.mission,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"map-zoom","map-zoom",1543291337),weathergen.ui.map_zoom,new cljs.core.Keyword(null,"map-text-scale","map-text-scale",1420206123),weathergen.ui.map_text_scale,new cljs.core.Keyword(null,"map-show-text-background?","map-show-text-background?",409410295),weathergen.ui.map_show_text_background_QMARK_,new cljs.core.Keyword(null,"visible-teams","visible-teams",-110455752),weathergen.ui.visible_teams], null));
weathergen.ui.selected_cell_weather = javelin.core.formula.call(null,(function (G__45884,G__45886,G__45885){
return G__45884.call(null,G__45885,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(G__45886));
})).call(null,cljs.core.get,weathergen.ui.selected_cell,weathergen.ui.weather_data);
weathergen.ui.cell_count = javelin.core.formula.call(null,(function (G__45887){
return new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(G__45887);
})).call(null,weathergen.ui.weather_params);
weathergen.ui.wind_stability_areas = javelin.core.formula.call(null,(function (G__45888){
return new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204).cljs$core$IFn$_invoke$arity$1(G__45888);
})).call(null,weathergen.ui.weather_params);
weathergen.ui.weather_overrides = javelin.core.formula.call(null,(function (G__45889){
return new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(G__45889);
})).call(null,weathergen.ui.weather_params);
weathergen.ui.forecast = javelin.core.formula.call(null,(function (selected_cell,weather_params,movement_params){
var timer_name__15521__auto__ = "computing forecast";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (cljs.core.truth_(selected_cell)?weathergen.model.forecast.call(null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(selected_cell),(function (){var temp__5276__auto__ = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(weather_params));
if(cljs.core.truth_(temp__5276__auto__)){
var max_time = temp__5276__auto__;
return weathergen.model.jump_to_time.call(null,weather_params,movement_params,max_time);
} else {
return weather_params;
}
})(),movement_params,(60),(6)):null);
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
})).call(null,weathergen.ui.selected_cell,weathergen.ui.weather_params,weathergen.ui.movement_params);
weathergen.ui.location_type = javelin.core.formula.call(null,(function (G__45891,G__45890){
if(cljs.core.truth_(G__45890.call(null,new cljs.core.Keyword(null,"location","location",1815599388).cljs$core$IFn$_invoke$arity$1(G__45891)))){
return new cljs.core.Keyword(null,"named","named",-422393479);
} else {
if(cljs.core.truth_(new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(G__45891))){
return new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668);
} else {
return new cljs.core.Keyword(null,"none","none",1333468478);

}
}
})).call(null,weathergen.ui.selected_cell,cljs.core.not_empty);
weathergen.ui.pressure_unit = javelin.core.formula.call(null,(function (G__45892){
return new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243).cljs$core$IFn$_invoke$arity$1(G__45892);
})).call(null,weathergen.ui.display_params);
weathergen.ui.all_squadrons = javelin.core.formula.call(null,(function (G__45895,G__45894,G__45893,G__45896){
return G__45893.call(null,cljs.core.PersistentHashSet.EMPTY,G__45894.call(null,new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110),new cljs.core.Keyword(null,"air","air",-104121788).cljs$core$IFn$_invoke$arity$1(G__45895.call(null,G__45896))));
})).call(null,weathergen.falcon.files.mission.order_of_battle,cljs.core.mapcat,cljs.core.into,weathergen.ui.mission);
weathergen.ui.all_squadron_types = javelin.core.formula.call(null,(function (G__45899,G__45898,G__45902,G__45901,G__45900){
return G__45898.call(null,cljs.core.PersistentHashSet.EMPTY,G__45899.call(null,(function (p1__45897_SHARP_){
return G__45900.call(null,G__45901,p1__45897_SHARP_);
}),G__45902));
})).call(null,cljs.core.map,cljs.core.into,weathergen.ui.all_squadrons,weathergen.ui.mission,weathergen.falcon.files.mission.squadron_type);
weathergen.ui.included_squadrons = javelin.core.formula.call(null,(function (G__45904,G__45909,G__45906,G__45908,G__45907,G__45905){
return G__45904.call(null,G__45905.call(null,(function (p1__45903_SHARP_){
return G__45906.call(null,G__45907.call(null,G__45908,p1__45903_SHARP_));
}),G__45909));
})).call(null,cljs.core.set,weathergen.ui.all_squadrons,weathergen.ui.included_squadron_types,weathergen.ui.mission,weathergen.falcon.files.mission.squadron_type,cljs.core.filter);
cljs.core.add_watch.call(null,weathergen.ui.all_squadron_types,new cljs.core.Keyword(null,"update-included-squadron-types","update-included-squadron-types",-1854825437),(function (_,___$1,___$2,n){
return cljs.core.reset_BANG_.call(null,weathergen.ui.included_squadron_types,n);
}));
/**
 * Return true if an airbase be shown in the list of airbases.
 */
weathergen.ui.list_airbase_QMARK_ = (function weathergen$ui$list_airbase_QMARK_(airbase,hide_empty_QMARK_,hide_inoperable_QMARK_,included_squadrons){
var is_empty_QMARK_ = (cljs.core.count.call(null,cljs.core.filter.call(null,included_squadrons,new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase))) === (0));
var is_inoperable_QMARK_ = (new cljs.core.Keyword("weathergen.falcon.files.mission","status","weathergen.falcon.files.mission/status",667063917).cljs$core$IFn$_invoke$arity$1(airbase) === (0));
var hide_QMARK_ = (function (){var or__23338__auto__ = (function (){var and__23326__auto__ = is_empty_QMARK_;
if(and__23326__auto__){
return hide_empty_QMARK_;
} else {
return and__23326__auto__;
}
})();
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
var and__23326__auto__ = is_inoperable_QMARK_;
if(and__23326__auto__){
return hide_inoperable_QMARK_;
} else {
return and__23326__auto__;
}
}
})();
return cljs.core.not.call(null,hide_QMARK_);
});
weathergen.ui.all_airbases = javelin.core.formula.call(null,(function (G__45912,G__45911){
var G__45910 = G__45911;
var G__45910__$1 = (cljs.core.truth_((G__45910 == null))?null:G__45912.call(null,G__45910));
if(cljs.core.truth_((G__45910__$1 == null))){
return null;
} else {
return new cljs.core.Keyword(null,"air","air",-104121788).cljs$core$IFn$_invoke$arity$1(G__45910__$1);
}
})).call(null,weathergen.falcon.files.mission.order_of_battle,weathergen.ui.mission);
weathergen.ui.listed_airbases = javelin.core.formula.call(null,(function (all_airbases,hide_empty_airbases_QMARK_,hide_inoperable_airbases_QMARK_,included_squadrons){
return cljs.core.set.call(null,cljs.core.filter.call(null,(function (p1__45913_SHARP_){
return weathergen.ui.list_airbase_QMARK_.call(null,p1__45913_SHARP_,hide_empty_airbases_QMARK_,hide_inoperable_airbases_QMARK_,included_squadrons);
}),all_airbases));
})).call(null,weathergen.ui.all_airbases,weathergen.ui.hide_empty_airbases_QMARK_,weathergen.ui.hide_inoperable_airbases_QMARK_,weathergen.ui.included_squadrons);
weathergen.ui.displayed_airbases = javelin.core.formula.call(null,(function (checked_airbases,listed_airbases){
return clojure.set.intersection.call(null,checked_airbases,listed_airbases);
})).call(null,weathergen.ui.checked_airbases,weathergen.ui.listed_airbases);
weathergen.ui.worker_count = (4);
weathergen.ui.workers = (function (){var all_cells = (function (){var iter__24200__auto__ = (function weathergen$ui$iter__45914(s__45915){
return (new cljs.core.LazySeq(null,(function (){
var s__45915__$1 = s__45915;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__45915__$1);
if(temp__5278__auto__){
var xs__5831__auto__ = temp__5278__auto__;
var x = cljs.core.first.call(null,xs__5831__auto__);
var iterys__24196__auto__ = ((function (s__45915__$1,x,xs__5831__auto__,temp__5278__auto__){
return (function weathergen$ui$iter__45914_$_iter__45916(s__45917){
return (new cljs.core.LazySeq(null,((function (s__45915__$1,x,xs__5831__auto__,temp__5278__auto__){
return (function (){
var s__45917__$1 = s__45917;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__45917__$1);
if(temp__5278__auto____$1){
var s__45917__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__45917__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__45917__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__45919 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__45918 = (0);
while(true){
if((i__45918 < size__24199__auto__)){
var y = cljs.core._nth.call(null,c__24198__auto__,i__45918);
cljs.core.chunk_append.call(null,b__45919,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));

var G__45920 = (i__45918 + (1));
i__45918 = G__45920;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__45919),weathergen$ui$iter__45914_$_iter__45916.call(null,cljs.core.chunk_rest.call(null,s__45917__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__45919),null);
}
} else {
var y = cljs.core.first.call(null,s__45917__$2);
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null),weathergen$ui$iter__45914_$_iter__45916.call(null,cljs.core.rest.call(null,s__45917__$2)));
}
} else {
return null;
}
break;
}
});})(s__45915__$1,x,xs__5831__auto__,temp__5278__auto__))
,null,null));
});})(s__45915__$1,x,xs__5831__auto__,temp__5278__auto__))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,cljs.core.range.call(null,(59))));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$iter__45914.call(null,cljs.core.rest.call(null,s__45915__$1)));
} else {
var G__45921 = cljs.core.rest.call(null,s__45915__$1);
s__45915__$1 = G__45921;
continue;
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24200__auto__.call(null,cljs.core.range.call(null,(59)));
})();
return cljs.core.map.call(null,((function (all_cells){
return (function (n,cells){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"worker","worker",938239996),(new Worker("worker.js")),new cljs.core.Keyword(null,"n","n",562130025),n,new cljs.core.Keyword(null,"ch","ch",-554717905),cljs.core.async.chan.call(null),new cljs.core.Keyword(null,"cells","cells",-985166822),cells], null);
});})(all_cells))
,cljs.core.range.call(null,weathergen.ui.worker_count),cljs.core.partition_all.call(null,(((59) * (59)) / weathergen.ui.worker_count),all_cells));
})();
weathergen.ui.command_ch = cljs.core.async.chan.call(null,cljs.core.async.dropping_buffer.call(null,(1)));
var seq__45922_45958 = cljs.core.seq.call(null,weathergen.ui.workers);
var chunk__45923_45959 = null;
var count__45924_45960 = (0);
var i__45925_45961 = (0);
while(true){
if((i__45925_45961 < count__45924_45960)){
var map__45926_45962 = cljs.core._nth.call(null,chunk__45923_45959,i__45925_45961);
var map__45926_45963__$1 = ((((!((map__45926_45962 == null)))?((((map__45926_45962.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45926_45962.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45926_45962):map__45926_45962);
var worker_45964 = cljs.core.get.call(null,map__45926_45963__$1,new cljs.core.Keyword(null,"worker","worker",938239996));
var ch_45965 = cljs.core.get.call(null,map__45926_45963__$1,new cljs.core.Keyword(null,"ch","ch",-554717905));
worker_45964.onmessage = ((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965){
return (function (e){
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965){
return (function (state_45933){
var state_val_45934 = (state_45933[(1)]);
if((state_val_45934 === (1))){
var inst_45928 = (e["data"]);
var inst_45929 = weathergen.encoding.decode.call(null,inst_45928);
var state_45933__$1 = state_45933;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_45933__$1,(2),ch_45965,inst_45929);
} else {
if((state_val_45934 === (2))){
var inst_45931 = (state_45933[(2)]);
var state_45933__$1 = state_45933;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_45933__$1,inst_45931);
} else {
return null;
}
}
});})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965))
;
return ((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,switch__40760__auto__,c__40874__auto__,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965){
return (function() {
var weathergen$ui$state_machine__40761__auto__ = null;
var weathergen$ui$state_machine__40761__auto____0 = (function (){
var statearr_45938 = [null,null,null,null,null,null,null];
(statearr_45938[(0)] = weathergen$ui$state_machine__40761__auto__);

(statearr_45938[(1)] = (1));

return statearr_45938;
});
var weathergen$ui$state_machine__40761__auto____1 = (function (state_45933){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_45933);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e45939){if((e45939 instanceof Object)){
var ex__40764__auto__ = e45939;
var statearr_45940_45966 = state_45933;
(statearr_45940_45966[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_45933);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e45939;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__45967 = state_45933;
state_45933 = G__45967;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$state_machine__40761__auto__ = function(state_45933){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__40761__auto____1.call(this,state_45933);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__40761__auto____0;
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__40761__auto____1;
return weathergen$ui$state_machine__40761__auto__;
})()
;})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,switch__40760__auto__,c__40874__auto__,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965))
})();
var state__40876__auto__ = (function (){var statearr_45941 = f__40875__auto__.call(null);
(statearr_45941[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_45941;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965))
);

return c__40874__auto__;
});})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965))
;

var G__45968 = seq__45922_45958;
var G__45969 = chunk__45923_45959;
var G__45970 = count__45924_45960;
var G__45971 = (i__45925_45961 + (1));
seq__45922_45958 = G__45968;
chunk__45923_45959 = G__45969;
count__45924_45960 = G__45970;
i__45925_45961 = G__45971;
continue;
} else {
var temp__5278__auto___45972 = cljs.core.seq.call(null,seq__45922_45958);
if(temp__5278__auto___45972){
var seq__45922_45973__$1 = temp__5278__auto___45972;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__45922_45973__$1)){
var c__24249__auto___45974 = cljs.core.chunk_first.call(null,seq__45922_45973__$1);
var G__45975 = cljs.core.chunk_rest.call(null,seq__45922_45973__$1);
var G__45976 = c__24249__auto___45974;
var G__45977 = cljs.core.count.call(null,c__24249__auto___45974);
var G__45978 = (0);
seq__45922_45958 = G__45975;
chunk__45923_45959 = G__45976;
count__45924_45960 = G__45977;
i__45925_45961 = G__45978;
continue;
} else {
var map__45942_45979 = cljs.core.first.call(null,seq__45922_45973__$1);
var map__45942_45980__$1 = ((((!((map__45942_45979 == null)))?((((map__45942_45979.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45942_45979.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45942_45979):map__45942_45979);
var worker_45981 = cljs.core.get.call(null,map__45942_45980__$1,new cljs.core.Keyword(null,"worker","worker",938239996));
var ch_45982 = cljs.core.get.call(null,map__45942_45980__$1,new cljs.core.Keyword(null,"ch","ch",-554717905));
worker_45981.onmessage = ((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972){
return (function (e){
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972){
return (function (state_45949){
var state_val_45950 = (state_45949[(1)]);
if((state_val_45950 === (1))){
var inst_45944 = (e["data"]);
var inst_45945 = weathergen.encoding.decode.call(null,inst_45944);
var state_45949__$1 = state_45949;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_45949__$1,(2),ch_45982,inst_45945);
} else {
if((state_val_45950 === (2))){
var inst_45947 = (state_45949[(2)]);
var state_45949__$1 = state_45949;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_45949__$1,inst_45947);
} else {
return null;
}
}
});})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972))
;
return ((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,switch__40760__auto__,c__40874__auto__,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972){
return (function() {
var weathergen$ui$state_machine__40761__auto__ = null;
var weathergen$ui$state_machine__40761__auto____0 = (function (){
var statearr_45954 = [null,null,null,null,null,null,null];
(statearr_45954[(0)] = weathergen$ui$state_machine__40761__auto__);

(statearr_45954[(1)] = (1));

return statearr_45954;
});
var weathergen$ui$state_machine__40761__auto____1 = (function (state_45949){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_45949);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e45955){if((e45955 instanceof Object)){
var ex__40764__auto__ = e45955;
var statearr_45956_45983 = state_45949;
(statearr_45956_45983[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_45949);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e45955;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__45984 = state_45949;
state_45949 = G__45984;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$state_machine__40761__auto__ = function(state_45949){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__40761__auto____1.call(this,state_45949);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__40761__auto____0;
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__40761__auto____1;
return weathergen$ui$state_machine__40761__auto__;
})()
;})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,switch__40760__auto__,c__40874__auto__,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972))
})();
var state__40876__auto__ = (function (){var statearr_45957 = f__40875__auto__.call(null);
(statearr_45957[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_45957;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972))
);

return c__40874__auto__;
});})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972))
;

var G__45985 = cljs.core.next.call(null,seq__45922_45973__$1);
var G__45986 = null;
var G__45987 = (0);
var G__45988 = (0);
seq__45922_45958 = G__45985;
chunk__45923_45959 = G__45986;
count__45924_45960 = G__45987;
i__45925_45961 = G__45988;
continue;
}
} else {
}
}
break;
}
/**
 * Helper function to post a message to a worker. Needed because the
 *   go-loop rewrites code so much I can't get type hints to work inside
 *   it.
 */
weathergen.ui.post_message = (function weathergen$ui$post_message(worker,message){
return worker.postMessage(message);
});
var c__40874__auto___46231 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto___46231){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto___46231){
return (function (state_46153){
var state_val_46154 = (state_46153[(1)]);
if((state_val_46154 === (7))){
var inst_46005 = (state_46153[(7)]);
var inst_46011 = (state_46153[(8)]);
var inst_46003 = (state_46153[(9)]);
var inst_46011__$1 = cljs.core._nth.call(null,inst_46003,inst_46005);
var inst_46013 = (inst_46011__$1 == null);
var inst_46014 = cljs.core.not.call(null,inst_46013);
var state_46153__$1 = (function (){var statearr_46155 = state_46153;
(statearr_46155[(8)] = inst_46011__$1);

return statearr_46155;
})();
if(inst_46014){
var statearr_46156_46232 = state_46153__$1;
(statearr_46156_46232[(1)] = (10));

} else {
var statearr_46157_46233 = state_46153__$1;
(statearr_46157_46233[(1)] = (11));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (20))){
var state_46153__$1 = state_46153;
var statearr_46158_46234 = state_46153__$1;
(statearr_46158_46234[(2)] = null);

(statearr_46158_46234[(1)] = (21));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (27))){
var inst_46067 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
if(cljs.core.truth_(inst_46067)){
var statearr_46159_46235 = state_46153__$1;
(statearr_46159_46235[(1)] = (31));

} else {
var statearr_46160_46236 = state_46153__$1;
(statearr_46160_46236[(1)] = (32));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (1))){
var state_46153__$1 = state_46153;
var statearr_46161_46237 = state_46153__$1;
(statearr_46161_46237[(2)] = null);

(statearr_46161_46237[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (24))){
var inst_46081 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46162_46238 = state_46153__$1;
(statearr_46162_46238[(2)] = inst_46081);

(statearr_46162_46238[(1)] = (21));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (39))){
var inst_46105 = cljs.core.async.timeout.call(null,(500));
var state_46153__$1 = state_46153;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46153__$1,(42),inst_46105);
} else {
if((state_val_46154 === (46))){
var inst_46095 = (state_46153[(10)]);
var inst_46096 = (state_46153[(11)]);
var inst_46137 = (state_46153[(2)]);
var inst_46138 = cljs.core.nth.call(null,inst_46137,(0),null);
var inst_46139 = cljs.core.nth.call(null,inst_46137,(1),null);
var inst_46140 = cljs.core.disj.call(null,inst_46095,inst_46139);
var inst_46141 = cljs.core.merge.call(null,inst_46096,inst_46138);
var inst_46095__$1 = inst_46140;
var inst_46096__$1 = inst_46141;
var state_46153__$1 = (function (){var statearr_46163 = state_46153;
(statearr_46163[(10)] = inst_46095__$1);

(statearr_46163[(11)] = inst_46096__$1);

return statearr_46163;
})();
var statearr_46164_46239 = state_46153__$1;
(statearr_46164_46239[(2)] = null);

(statearr_46164_46239[(1)] = (34));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (4))){
var inst_45994 = (state_46153[(12)]);
var inst_45994__$1 = (state_46153[(2)]);
var inst_45995 = cljs.core.nth.call(null,inst_45994__$1,(0),null);
var inst_45996 = cljs.core.nth.call(null,inst_45994__$1,(1),null);
var inst_46001 = cljs.core.seq.call(null,weathergen.ui.workers);
var inst_46002 = inst_46001;
var inst_46003 = null;
var inst_46004 = (0);
var inst_46005 = (0);
var state_46153__$1 = (function (){var statearr_46165 = state_46153;
(statearr_46165[(7)] = inst_46005);

(statearr_46165[(13)] = inst_46002);

(statearr_46165[(12)] = inst_45994__$1);

(statearr_46165[(14)] = inst_45995);

(statearr_46165[(15)] = inst_45996);

(statearr_46165[(16)] = inst_46004);

(statearr_46165[(9)] = inst_46003);

return statearr_46165;
})();
var statearr_46166_46240 = state_46153__$1;
(statearr_46166_46240[(2)] = null);

(statearr_46166_46240[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (15))){
var inst_46024 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46167_46241 = state_46153__$1;
(statearr_46167_46241[(2)] = inst_46024);

(statearr_46167_46241[(1)] = (12));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (21))){
var inst_46084 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46168_46242 = state_46153__$1;
(statearr_46168_46242[(2)] = inst_46084);

(statearr_46168_46242[(1)] = (9));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (31))){
var inst_46051 = (state_46153[(17)]);
var inst_46069 = cljs.core.apply.call(null,cljs.core.hash_map,inst_46051);
var state_46153__$1 = state_46153;
var statearr_46169_46243 = state_46153__$1;
(statearr_46169_46243[(2)] = inst_46069);

(statearr_46169_46243[(1)] = (33));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (32))){
var inst_46051 = (state_46153[(17)]);
var state_46153__$1 = state_46153;
var statearr_46170_46244 = state_46153__$1;
(statearr_46170_46244[(2)] = inst_46051);

(statearr_46170_46244[(1)] = (33));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (40))){
var state_46153__$1 = state_46153;
var statearr_46171_46245 = state_46153__$1;
(statearr_46171_46245[(2)] = null);

(statearr_46171_46245[(1)] = (41));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (33))){
var inst_46041 = (state_46153[(18)]);
var inst_45996 = (state_46153[(15)]);
var inst_46072 = (state_46153[(2)]);
var inst_46073 = cljs.core.get.call(null,inst_46072,new cljs.core.Keyword(null,"cells","cells",-985166822));
var inst_46074 = cljs.core.get.call(null,inst_46072,new cljs.core.Keyword(null,"worker","worker",938239996));
var inst_46075 = cljs.core.assoc.call(null,inst_45996,new cljs.core.Keyword(null,"cells","cells",-985166822),inst_46073);
var inst_46076 = weathergen.encoding.encode.call(null,inst_46075);
var inst_46077 = weathergen.ui.post_message.call(null,inst_46074,inst_46076);
var inst_46078 = cljs.core.next.call(null,inst_46041);
var inst_46002 = inst_46078;
var inst_46003 = null;
var inst_46004 = (0);
var inst_46005 = (0);
var state_46153__$1 = (function (){var statearr_46172 = state_46153;
(statearr_46172[(7)] = inst_46005);

(statearr_46172[(13)] = inst_46002);

(statearr_46172[(19)] = inst_46077);

(statearr_46172[(16)] = inst_46004);

(statearr_46172[(9)] = inst_46003);

return statearr_46172;
})();
var statearr_46173_46246 = state_46153__$1;
(statearr_46173_46246[(2)] = null);

(statearr_46173_46246[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (13))){
var state_46153__$1 = state_46153;
var statearr_46174_46247 = state_46153__$1;
(statearr_46174_46247[(2)] = true);

(statearr_46174_46247[(1)] = (15));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (22))){
var inst_46041 = (state_46153[(18)]);
var inst_46045 = cljs.core.chunk_first.call(null,inst_46041);
var inst_46046 = cljs.core.chunk_rest.call(null,inst_46041);
var inst_46047 = cljs.core.count.call(null,inst_46045);
var inst_46002 = inst_46046;
var inst_46003 = inst_46045;
var inst_46004 = inst_46047;
var inst_46005 = (0);
var state_46153__$1 = (function (){var statearr_46175 = state_46153;
(statearr_46175[(7)] = inst_46005);

(statearr_46175[(13)] = inst_46002);

(statearr_46175[(16)] = inst_46004);

(statearr_46175[(9)] = inst_46003);

return statearr_46175;
})();
var statearr_46176_46248 = state_46153__$1;
(statearr_46176_46248[(2)] = null);

(statearr_46176_46248[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (36))){
var inst_46095 = (state_46153[(10)]);
var inst_45994 = (state_46153[(12)]);
var inst_45995 = (state_46153[(14)]);
var inst_46096 = (state_46153[(11)]);
var inst_46091 = (state_46153[(20)]);
var inst_45996 = (state_46153[(15)]);
var inst_46100 = (function (){var vec__45990 = inst_45994;
var command = inst_45995;
var params = inst_45996;
var timer_name__15521__auto__ = "Receive weather results";
var ignore__15522__auto__ = inst_46091;
var chs = inst_46095;
var data = inst_46096;
return ((function (vec__45990,command,params,timer_name__15521__auto__,ignore__15522__auto__,chs,data,inst_46095,inst_45994,inst_45995,inst_46096,inst_46091,inst_45996,state_val_46154,c__40874__auto___46231){
return (function (){
console.timeEnd("compute-weather");

cljs.core.reset_BANG_.call(null,weathergen.ui.weather_data,data);

return cljs.core.reset_BANG_.call(null,weathergen.ui.weather_data_params,params);
});
;})(vec__45990,command,params,timer_name__15521__auto__,ignore__15522__auto__,chs,data,inst_46095,inst_45994,inst_45995,inst_46096,inst_46091,inst_45996,state_val_46154,c__40874__auto___46231))
})();
var inst_46101 = javelin.core.dosync_STAR_.call(null,inst_46100);
var inst_46102 = cljs.core.deref.call(null,weathergen.ui.movement_params);
var inst_46103 = new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(inst_46102);
var state_46153__$1 = (function (){var statearr_46177 = state_46153;
(statearr_46177[(21)] = inst_46101);

return statearr_46177;
})();
if(cljs.core.truth_(inst_46103)){
var statearr_46178_46249 = state_46153__$1;
(statearr_46178_46249[(1)] = (39));

} else {
var statearr_46179_46250 = state_46153__$1;
(statearr_46179_46250[(1)] = (40));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (41))){
var inst_46130 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46180_46251 = state_46153__$1;
(statearr_46180_46251[(2)] = inst_46130);

(statearr_46180_46251[(1)] = (38));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (43))){
var inst_46118 = ((-60) * (6));
var inst_46119 = cljs.core.deref.call(null,weathergen.ui.movement_params);
var inst_46120 = new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(inst_46119);
var inst_46121 = (inst_46118 / inst_46120);
var inst_46122 = Math.floor(inst_46121);
var inst_46123 = weathergen.ui.move.call(null,inst_46122);
var state_46153__$1 = state_46153;
var statearr_46181_46252 = state_46153__$1;
(statearr_46181_46252[(2)] = inst_46123);

(statearr_46181_46252[(1)] = (45));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (29))){
var state_46153__$1 = state_46153;
var statearr_46182_46253 = state_46153__$1;
(statearr_46182_46253[(2)] = false);

(statearr_46182_46253[(1)] = (30));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (44))){
var inst_46125 = weathergen.ui.move.call(null,(1));
var state_46153__$1 = state_46153;
var statearr_46183_46254 = state_46153__$1;
(statearr_46183_46254[(2)] = inst_46125);

(statearr_46183_46254[(1)] = (45));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (6))){
var inst_46088 = (state_46153[(2)]);
var inst_46089 = cljs.core.reset_BANG_.call(null,weathergen.ui.computing,true);
var inst_46090 = console.time("compute-weather");
var inst_46091 = console.time("Receive weather results");
var inst_46092 = cljs.core.map.call(null,new cljs.core.Keyword(null,"ch","ch",-554717905),weathergen.ui.workers);
var inst_46093 = cljs.core.set.call(null,inst_46092);
var inst_46094 = cljs.core.PersistentHashMap.EMPTY;
var inst_46095 = inst_46093;
var inst_46096 = inst_46094;
var state_46153__$1 = (function (){var statearr_46184 = state_46153;
(statearr_46184[(10)] = inst_46095);

(statearr_46184[(22)] = inst_46090);

(statearr_46184[(11)] = inst_46096);

(statearr_46184[(23)] = inst_46089);

(statearr_46184[(24)] = inst_46088);

(statearr_46184[(20)] = inst_46091);

return statearr_46184;
})();
var statearr_46185_46255 = state_46153__$1;
(statearr_46185_46255[(2)] = null);

(statearr_46185_46255[(1)] = (34));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (28))){
var state_46153__$1 = state_46153;
var statearr_46186_46256 = state_46153__$1;
(statearr_46186_46256[(2)] = true);

(statearr_46186_46256[(1)] = (30));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (25))){
var inst_46051 = (state_46153[(17)]);
var inst_46056 = inst_46051.cljs$lang$protocol_mask$partition0$;
var inst_46057 = (inst_46056 & (64));
var inst_46058 = inst_46051.cljs$core$ISeq$;
var inst_46059 = (cljs.core.PROTOCOL_SENTINEL === inst_46058);
var inst_46060 = (inst_46057) || (inst_46059);
var state_46153__$1 = state_46153;
if(cljs.core.truth_(inst_46060)){
var statearr_46187_46257 = state_46153__$1;
(statearr_46187_46257[(1)] = (28));

} else {
var statearr_46188_46258 = state_46153__$1;
(statearr_46188_46258[(1)] = (29));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (34))){
var inst_46095 = (state_46153[(10)]);
var inst_46098 = cljs.core.empty_QMARK_.call(null,inst_46095);
var state_46153__$1 = state_46153;
if(inst_46098){
var statearr_46189_46259 = state_46153__$1;
(statearr_46189_46259[(1)] = (36));

} else {
var statearr_46190_46260 = state_46153__$1;
(statearr_46190_46260[(1)] = (37));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (17))){
var inst_46011 = (state_46153[(8)]);
var state_46153__$1 = state_46153;
var statearr_46191_46261 = state_46153__$1;
(statearr_46191_46261[(2)] = inst_46011);

(statearr_46191_46261[(1)] = (18));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (3))){
var inst_46151 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46153__$1,inst_46151);
} else {
if((state_val_46154 === (12))){
var inst_46027 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
if(cljs.core.truth_(inst_46027)){
var statearr_46192_46262 = state_46153__$1;
(statearr_46192_46262[(1)] = (16));

} else {
var statearr_46193_46263 = state_46153__$1;
(statearr_46193_46263[(1)] = (17));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (2))){
var state_46153__$1 = state_46153;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46153__$1,(4),weathergen.ui.command_ch);
} else {
if((state_val_46154 === (23))){
var inst_46051 = (state_46153[(17)]);
var inst_46041 = (state_46153[(18)]);
var inst_46051__$1 = cljs.core.first.call(null,inst_46041);
var inst_46053 = (inst_46051__$1 == null);
var inst_46054 = cljs.core.not.call(null,inst_46053);
var state_46153__$1 = (function (){var statearr_46194 = state_46153;
(statearr_46194[(17)] = inst_46051__$1);

return statearr_46194;
})();
if(inst_46054){
var statearr_46195_46264 = state_46153__$1;
(statearr_46195_46264[(1)] = (25));

} else {
var statearr_46196_46265 = state_46153__$1;
(statearr_46196_46265[(1)] = (26));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (35))){
var inst_46146 = (state_46153[(2)]);
var inst_46147 = console.timeEnd("Receive weather results");
var inst_46148 = cljs.core.reset_BANG_.call(null,weathergen.ui.computing,false);
var state_46153__$1 = (function (){var statearr_46197 = state_46153;
(statearr_46197[(25)] = inst_46148);

(statearr_46197[(26)] = inst_46146);

(statearr_46197[(27)] = inst_46147);

return statearr_46197;
})();
var statearr_46198_46266 = state_46153__$1;
(statearr_46198_46266[(2)] = null);

(statearr_46198_46266[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (19))){
var inst_46041 = (state_46153[(18)]);
var inst_46043 = cljs.core.chunked_seq_QMARK_.call(null,inst_46041);
var state_46153__$1 = state_46153;
if(inst_46043){
var statearr_46199_46267 = state_46153__$1;
(statearr_46199_46267[(1)] = (22));

} else {
var statearr_46200_46268 = state_46153__$1;
(statearr_46200_46268[(1)] = (23));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (11))){
var state_46153__$1 = state_46153;
var statearr_46201_46269 = state_46153__$1;
(statearr_46201_46269[(2)] = false);

(statearr_46201_46269[(1)] = (12));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (9))){
var inst_46086 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46202_46270 = state_46153__$1;
(statearr_46202_46270[(2)] = inst_46086);

(statearr_46202_46270[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (5))){
var inst_46005 = (state_46153[(7)]);
var inst_46004 = (state_46153[(16)]);
var inst_46007 = (inst_46005 < inst_46004);
var inst_46008 = inst_46007;
var state_46153__$1 = state_46153;
if(cljs.core.truth_(inst_46008)){
var statearr_46203_46271 = state_46153__$1;
(statearr_46203_46271[(1)] = (7));

} else {
var statearr_46204_46272 = state_46153__$1;
(statearr_46204_46272[(1)] = (8));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (14))){
var state_46153__$1 = state_46153;
var statearr_46205_46273 = state_46153__$1;
(statearr_46205_46273[(2)] = false);

(statearr_46205_46273[(1)] = (15));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (45))){
var inst_46127 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46206_46274 = state_46153__$1;
(statearr_46206_46274[(2)] = inst_46127);

(statearr_46206_46274[(1)] = (41));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (26))){
var state_46153__$1 = state_46153;
var statearr_46207_46275 = state_46153__$1;
(statearr_46207_46275[(2)] = false);

(statearr_46207_46275[(1)] = (27));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (16))){
var inst_46011 = (state_46153[(8)]);
var inst_46029 = cljs.core.apply.call(null,cljs.core.hash_map,inst_46011);
var state_46153__$1 = state_46153;
var statearr_46208_46276 = state_46153__$1;
(statearr_46208_46276[(2)] = inst_46029);

(statearr_46208_46276[(1)] = (18));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (38))){
var inst_46144 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46209_46277 = state_46153__$1;
(statearr_46209_46277[(2)] = inst_46144);

(statearr_46209_46277[(1)] = (35));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (30))){
var inst_46064 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46213_46278 = state_46153__$1;
(statearr_46213_46278[(2)] = inst_46064);

(statearr_46213_46278[(1)] = (27));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (10))){
var inst_46011 = (state_46153[(8)]);
var inst_46016 = inst_46011.cljs$lang$protocol_mask$partition0$;
var inst_46017 = (inst_46016 & (64));
var inst_46018 = inst_46011.cljs$core$ISeq$;
var inst_46019 = (cljs.core.PROTOCOL_SENTINEL === inst_46018);
var inst_46020 = (inst_46017) || (inst_46019);
var state_46153__$1 = state_46153;
if(cljs.core.truth_(inst_46020)){
var statearr_46214_46279 = state_46153__$1;
(statearr_46214_46279[(1)] = (13));

} else {
var statearr_46215_46280 = state_46153__$1;
(statearr_46215_46280[(1)] = (14));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (18))){
var inst_46005 = (state_46153[(7)]);
var inst_46002 = (state_46153[(13)]);
var inst_45996 = (state_46153[(15)]);
var inst_46004 = (state_46153[(16)]);
var inst_46003 = (state_46153[(9)]);
var inst_46032 = (state_46153[(2)]);
var inst_46033 = cljs.core.get.call(null,inst_46032,new cljs.core.Keyword(null,"cells","cells",-985166822));
var inst_46034 = cljs.core.get.call(null,inst_46032,new cljs.core.Keyword(null,"worker","worker",938239996));
var inst_46035 = cljs.core.assoc.call(null,inst_45996,new cljs.core.Keyword(null,"cells","cells",-985166822),inst_46033);
var inst_46036 = weathergen.encoding.encode.call(null,inst_46035);
var inst_46037 = weathergen.ui.post_message.call(null,inst_46034,inst_46036);
var inst_46038 = (inst_46005 + (1));
var tmp46210 = inst_46002;
var tmp46211 = inst_46004;
var tmp46212 = inst_46003;
var inst_46002__$1 = tmp46210;
var inst_46003__$1 = tmp46212;
var inst_46004__$1 = tmp46211;
var inst_46005__$1 = inst_46038;
var state_46153__$1 = (function (){var statearr_46216 = state_46153;
(statearr_46216[(28)] = inst_46037);

(statearr_46216[(7)] = inst_46005__$1);

(statearr_46216[(13)] = inst_46002__$1);

(statearr_46216[(16)] = inst_46004__$1);

(statearr_46216[(9)] = inst_46003__$1);

return statearr_46216;
})();
var statearr_46217_46281 = state_46153__$1;
(statearr_46217_46281[(2)] = null);

(statearr_46217_46281[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (42))){
var inst_46107 = (state_46153[(2)]);
var inst_46108 = cljs.core.deref.call(null,weathergen.ui.weather_data_params);
var inst_46109 = new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(inst_46108);
var inst_46110 = new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(inst_46109);
var inst_46111 = weathergen.time.campaign_time__GT_minutes.call(null,inst_46110);
var inst_46112 = cljs.core.deref.call(null,weathergen.ui.weather_data_params);
var inst_46113 = new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(inst_46112);
var inst_46114 = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(inst_46113);
var inst_46115 = weathergen.time.campaign_time__GT_minutes.call(null,inst_46114);
var inst_46116 = cljs.core._EQ_.call(null,inst_46111,inst_46115);
var state_46153__$1 = (function (){var statearr_46218 = state_46153;
(statearr_46218[(29)] = inst_46107);

return statearr_46218;
})();
if(inst_46116){
var statearr_46219_46282 = state_46153__$1;
(statearr_46219_46282[(1)] = (43));

} else {
var statearr_46220_46283 = state_46153__$1;
(statearr_46220_46283[(1)] = (44));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (37))){
var inst_46095 = (state_46153[(10)]);
var inst_46135 = cljs.core.vec.call(null,inst_46095);
var state_46153__$1 = state_46153;
return cljs.core.async.ioc_alts_BANG_.call(null,state_46153__$1,(46),inst_46135);
} else {
if((state_val_46154 === (8))){
var inst_46002 = (state_46153[(13)]);
var inst_46041 = (state_46153[(18)]);
var inst_46041__$1 = cljs.core.seq.call(null,inst_46002);
var state_46153__$1 = (function (){var statearr_46221 = state_46153;
(statearr_46221[(18)] = inst_46041__$1);

return statearr_46221;
})();
if(inst_46041__$1){
var statearr_46222_46284 = state_46153__$1;
(statearr_46222_46284[(1)] = (19));

} else {
var statearr_46223_46285 = state_46153__$1;
(statearr_46223_46285[(1)] = (20));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__40874__auto___46231))
;
return ((function (switch__40760__auto__,c__40874__auto___46231){
return (function() {
var weathergen$ui$state_machine__40761__auto__ = null;
var weathergen$ui$state_machine__40761__auto____0 = (function (){
var statearr_46227 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_46227[(0)] = weathergen$ui$state_machine__40761__auto__);

(statearr_46227[(1)] = (1));

return statearr_46227;
});
var weathergen$ui$state_machine__40761__auto____1 = (function (state_46153){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46153);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46228){if((e46228 instanceof Object)){
var ex__40764__auto__ = e46228;
var statearr_46229_46286 = state_46153;
(statearr_46229_46286[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46153);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46228;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46287 = state_46153;
state_46153 = G__46287;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$state_machine__40761__auto__ = function(state_46153){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__40761__auto____1.call(this,state_46153);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__40761__auto____0;
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__40761__auto____1;
return weathergen$ui$state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto___46231))
})();
var state__40876__auto__ = (function (){var statearr_46230 = f__40875__auto__.call(null);
(statearr_46230[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto___46231);

return statearr_46230;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto___46231))
);

weathergen.ui.recompute = (function weathergen$ui$recompute(params){
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto__){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto__){
return (function (state_46309){
var state_val_46310 = (state_46309[(1)]);
if((state_val_46310 === (1))){
var inst_46303 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_46304 = [new cljs.core.Keyword(null,"compute-weather","compute-weather",-1681954694),params];
var inst_46305 = (new cljs.core.PersistentVector(null,2,(5),inst_46303,inst_46304,null));
var state_46309__$1 = state_46309;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_46309__$1,(2),weathergen.ui.command_ch,inst_46305);
} else {
if((state_val_46310 === (2))){
var inst_46307 = (state_46309[(2)]);
var state_46309__$1 = state_46309;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46309__$1,inst_46307);
} else {
return null;
}
}
});})(c__40874__auto__))
;
return ((function (switch__40760__auto__,c__40874__auto__){
return (function() {
var weathergen$ui$recompute_$_state_machine__40761__auto__ = null;
var weathergen$ui$recompute_$_state_machine__40761__auto____0 = (function (){
var statearr_46314 = [null,null,null,null,null,null,null];
(statearr_46314[(0)] = weathergen$ui$recompute_$_state_machine__40761__auto__);

(statearr_46314[(1)] = (1));

return statearr_46314;
});
var weathergen$ui$recompute_$_state_machine__40761__auto____1 = (function (state_46309){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46309);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46315){if((e46315 instanceof Object)){
var ex__40764__auto__ = e46315;
var statearr_46316_46318 = state_46309;
(statearr_46316_46318[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46309);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46315;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46319 = state_46309;
state_46309 = G__46319;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$recompute_$_state_machine__40761__auto__ = function(state_46309){
switch(arguments.length){
case 0:
return weathergen$ui$recompute_$_state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$recompute_$_state_machine__40761__auto____1.call(this,state_46309);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$recompute_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$recompute_$_state_machine__40761__auto____0;
weathergen$ui$recompute_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$recompute_$_state_machine__40761__auto____1;
return weathergen$ui$recompute_$_state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto__))
})();
var state__40876__auto__ = (function (){var statearr_46317 = f__40875__auto__.call(null);
(statearr_46317[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_46317;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto__))
);

return c__40874__auto__;
});
javelin.core.formula.call(null,(function (weather_params,prevent_recomputation_QMARK_){
if(cljs.core.truth_((function (){var and__23326__auto__ = cljs.core.not.call(null,prevent_recomputation_QMARK_);
if(and__23326__auto__){
return weather_params;
} else {
return and__23326__auto__;
}
})())){
return weathergen.ui.recompute.call(null,weather_params);
} else {
return null;
}
})).call(null,weathergen.ui.weather_params,weathergen.ui.prevent_recomputation_QMARK_);
/**
 * Advances the weather by `steps` steps, unless that would move past
 *   the max time.
 */
weathergen.ui.move = (function weathergen$ui$move(steps){
return javelin.core.dosync_STAR_.call(null,(function (){
var minutes = (steps * new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.movement_params)));
var current_time = weathergen.time.campaign_time__GT_minutes.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))));
var desired_time = (current_time + minutes);
var new_time = (function (){var temp__5276__auto__ = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)));
if(cljs.core.truth_(temp__5276__auto__)){
var max_time = temp__5276__auto__;
var x__23683__auto__ = weathergen.time.campaign_time__GT_minutes.call(null,max_time);
var y__23684__auto__ = desired_time;
return ((x__23683__auto__ < y__23684__auto__) ? x__23683__auto__ : y__23684__auto__);
} else {
return desired_time;
}
})();
var actual_steps = ((new_time - current_time) / new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.movement_params)));
var map__46322 = cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,weathergen.model.step,cljs.core.deref.call(null,weathergen.ui.movement_params),actual_steps);
var map__46322__$1 = ((((!((map__46322 == null)))?((((map__46322.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46322.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46322):map__46322);
var time = cljs.core.get.call(null,map__46322__$1,new cljs.core.Keyword(null,"time","time",1385887882));
return cljs.core.swap_BANG_.call(null,weathergen.ui.time_params,cljs.core.assoc,new cljs.core.Keyword(null,"displayed","displayed",-436192586),new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(time));
}));
});
weathergen.ui.jump_to_time_STAR_ = (function weathergen$ui$jump_to_time_STAR_(t){
return javelin.core.dosync_STAR_.call(null,(function (){
var map__46326 = cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,weathergen.model.jump_to_time,cljs.core.deref.call(null,weathergen.ui.movement_params),t);
var map__46326__$1 = ((((!((map__46326 == null)))?((((map__46326.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46326.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46326):map__46326);
var time = cljs.core.get.call(null,map__46326__$1,new cljs.core.Keyword(null,"time","time",1385887882));
return cljs.core.swap_BANG_.call(null,weathergen.ui.time_params,cljs.core.assoc,new cljs.core.Keyword(null,"displayed","displayed",-436192586),new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(time));
}));
});
/**
 * Adjust the time coordinate to match the displayed time.
 */
weathergen.ui.jump_to_time = (function weathergen$ui$jump_to_time(){
var desired = new cljs.core.Keyword(null,"displayed","displayed",-436192586).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.time_params));
var max_time = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)));
if((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166),cljs.core.deref.call(null,weathergen.ui.display_mode))) || (cljs.core.not.call(null,max_time)) || ((weathergen.time.campaign_time__GT_minutes.call(null,desired) <= weathergen.time.campaign_time__GT_minutes.call(null,max_time)))){
return weathergen.ui.jump_to_time_STAR_.call(null,new cljs.core.Keyword(null,"displayed","displayed",-436192586).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.time_params)));
} else {
return null;
}
});
/**
 * Adjust the time coordinate so that the current time is adjusted to
 *   match the displayed time without changing the location in weather
 *   space.
 */
weathergen.ui.set_time = (function weathergen$ui$set_time(){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,weathergen.model.set_time,new cljs.core.Keyword(null,"displayed","displayed",-436192586).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.time_params)));
});
weathergen.ui.change_location = (function weathergen$ui$change_location(mission,airbase){
if(cljs.core.empty_QMARK_.call(null,airbase)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.selected_cell,null);
} else {
return cljs.core.reset_BANG_.call(null,weathergen.ui.selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),airbase,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),cljs.core.mapv.call(null,cljs.core.long$,cljs.core.juxt.call(null,new cljs.core.Keyword(null,"x","x",2099068185),new cljs.core.Keyword(null,"y","y",-1757859776)).call(null,weathergen.coordinates.fgrid__GT_weather.call(null,mission,new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(airbase),new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(airbase))))], null));
}
});
/**
 * Compute the extensionless name of the mission file, or default to
 *   'vmt'.
 */
weathergen.ui.mission_name_base = (function weathergen$ui$mission_name_base(mission_name){
if(cljs.core.empty_QMARK_.call(null,mission_name)){
return "vmt";
} else {
var i = mission_name.lastIndexOf(".");
if((i < (0))){
return mission_name;
} else {
return cljs.core.subs.call(null,mission_name,(0),i);
}
}
});
weathergen.ui.safari_safe_binary = (function weathergen$ui$safari_safe_binary(blob){
if(cljs.core.truth_(weathergen.ui.safari_QMARK_)){
return (new Blob([blob],({"type": "application/octet-stream"})));
} else {
return blob;
}
});
/**
 * Returns the filename for an FMAP at time `t`.
 */
weathergen.ui.fmap_filename = (function weathergen$ui$fmap_filename(t){
return goog.string.format("%d%02d%02d.fmap",new cljs.core.Keyword(null,"day","day",-274800446).cljs$core$IFn$_invoke$arity$1(t),new cljs.core.Keyword(null,"hour","hour",-555989214).cljs$core$IFn$_invoke$arity$1(t),new cljs.core.Keyword(null,"minute","minute",-642875969).cljs$core$IFn$_invoke$arity$1(t));
});
weathergen.ui.twx_filename = (function weathergen$ui$twx_filename(mission_name){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.mission_name_base.call(null,mission_name)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(".twx")].join('');
});
/**
 * Prompts the user for a path and saves a file.
 * 
 *   `:title` - the title of the dialog that will be shown.
 *   `:data`  - a string, Blob, or Buffer of data to save.
 * 
 *   `:filters` - A seq of maps containing `:name` (string) and
 *   `:extension` - (vector of strings) to populate the dialog's filter
 *               dropdown with.
 *   `:filename` - The default filename - user can change this. Default
 *              directory is the campaign directory for the mission.
 */
weathergen.ui.save_data = (function weathergen$ui$save_data(p__46328){
var map__46331 = p__46328;
var map__46331__$1 = ((((!((map__46331 == null)))?((((map__46331.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46331.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46331):map__46331);
var data = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"data","data",-232669377));
var title = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"title","title",636505583));
var filters = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"filters","filters",974726919));
var filename = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"filename","filename",-1428840783));
var temp__5278__auto__ = weathergen.ui.electron.remote.dialog.showSaveDialog(cljs.core.clj__GT_js.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),title,new cljs.core.Keyword(null,"defaultPath","defaultPath",-582313676),weathergen.filesystem.path_combine.call(null,weathergen.falcon.files.mission.campaign_dir.call(null,cljs.core.deref.call(null,weathergen.ui.mission)),filename),new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [filters], null)], null)));
if(cljs.core.truth_(temp__5278__auto__)){
var path = temp__5278__auto__;
if((data instanceof Blob)){
return weathergen.ui.common.save_blob_async.call(null,data,path);
} else {
return weathergen.filesystem.save_data.call(null,path,data);
}
} else {
return null;
}
});
weathergen.ui.save_fmap = (function weathergen$ui$save_fmap(weather_params,weather_data){
var t = cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"current","current",-1088038603)], null));
var vec__46342 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(weather_params);
var x_cells = cljs.core.nth.call(null,vec__46342,(0),null);
var y_cells = cljs.core.nth.call(null,vec__46342,(1),null);
var data = ((cljs.core._EQ_.call(null,weather_params,weathergen.ui.weather_data_params))?weather_data:weathergen.model.weather_grid.call(null,cljs.core.assoc.call(null,weather_params,new cljs.core.Keyword(null,"cells","cells",-985166822),(function (){var iter__24200__auto__ = ((function (t,vec__46342,x_cells,y_cells){
return (function weathergen$ui$save_fmap_$_iter__46345(s__46346){
return (new cljs.core.LazySeq(null,((function (t,vec__46342,x_cells,y_cells){
return (function (){
var s__46346__$1 = s__46346;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__46346__$1);
if(temp__5278__auto__){
var xs__5831__auto__ = temp__5278__auto__;
var x = cljs.core.first.call(null,xs__5831__auto__);
var iterys__24196__auto__ = ((function (s__46346__$1,x,xs__5831__auto__,temp__5278__auto__,t,vec__46342,x_cells,y_cells){
return (function weathergen$ui$save_fmap_$_iter__46345_$_iter__46347(s__46348){
return (new cljs.core.LazySeq(null,((function (s__46346__$1,x,xs__5831__auto__,temp__5278__auto__,t,vec__46342,x_cells,y_cells){
return (function (){
var s__46348__$1 = s__46348;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__46348__$1);
if(temp__5278__auto____$1){
var s__46348__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__46348__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__46348__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__46350 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__46349 = (0);
while(true){
if((i__46349 < size__24199__auto__)){
var y = cljs.core._nth.call(null,c__24198__auto__,i__46349);
cljs.core.chunk_append.call(null,b__46350,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));

var G__46351 = (i__46349 + (1));
i__46349 = G__46351;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46350),weathergen$ui$save_fmap_$_iter__46345_$_iter__46347.call(null,cljs.core.chunk_rest.call(null,s__46348__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46350),null);
}
} else {
var y = cljs.core.first.call(null,s__46348__$2);
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null),weathergen$ui$save_fmap_$_iter__46345_$_iter__46347.call(null,cljs.core.rest.call(null,s__46348__$2)));
}
} else {
return null;
}
break;
}
});})(s__46346__$1,x,xs__5831__auto__,temp__5278__auto__,t,vec__46342,x_cells,y_cells))
,null,null));
});})(s__46346__$1,x,xs__5831__auto__,temp__5278__auto__,t,vec__46342,x_cells,y_cells))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,cljs.core.range.call(null,y_cells)));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$save_fmap_$_iter__46345.call(null,cljs.core.rest.call(null,s__46346__$1)));
} else {
var G__46352 = cljs.core.rest.call(null,s__46346__$1);
s__46346__$1 = G__46352;
continue;
}
} else {
return null;
}
break;
}
});})(t,vec__46342,x_cells,y_cells))
,null,null));
});})(t,vec__46342,x_cells,y_cells))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,x_cells));
})())));
var blob = weathergen.fmap.get_blob.call(null,data,x_cells,y_cells);
return weathergen.ui.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),weathergen.ui.safari_safe_binary.call(null,blob),new cljs.core.Keyword(null,"title","title",636505583),"Save FMAP",new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"FMAP Files",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["fmap"], null)], null),new cljs.core.Keyword(null,"filename","filename",-1428840783),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.mission_name_base.call(null,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)))),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.fmap_filename.call(null,t))].join('')], null));
});
weathergen.ui.settings_blob = (function weathergen$ui$settings_blob(){
return (new Blob([cljs.core.pr_str.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),cljs.core.deref.call(null,weathergen.ui.weather_params),new cljs.core.Keyword(null,"movement-params","movement-params",293385966),cljs.core.deref.call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"display-params","display-params",573405707),cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983),cljs.core.deref.call(null,weathergen.ui.cloud_params),new cljs.core.Keyword(null,"revision","revision",-1350113114),weathergen.ui.revision], null))],({"type": "text/plain"})));
});
weathergen.ui.settings_filename = (function weathergen$ui$settings_filename(mission_name){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.mission_name_base.call(null,mission_name)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(".vmtw")].join('');
});
weathergen.ui.save_weather_settings = (function weathergen$ui$save_weather_settings(_){
return weathergen.ui.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),cljs.core.pr_str.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),cljs.core.deref.call(null,weathergen.ui.weather_params),new cljs.core.Keyword(null,"movement-params","movement-params",293385966),cljs.core.deref.call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"display-params","display-params",573405707),cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983),cljs.core.deref.call(null,weathergen.ui.cloud_params),new cljs.core.Keyword(null,"revision","revision",-1350113114),weathergen.ui.revision], null)),new cljs.core.Keyword(null,"title","title",636505583),"Save weather settings",new cljs.core.Keyword(null,"filename","filename",-1428840783),weathergen.ui.settings_filename.call(null,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission))),new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"VMT Weather Settings",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["vmtw"], null)], null)], null)], null));
});
/**
 * Returns a JS blob containing TWX file data.
 */
weathergen.ui.twx_blob = (function weathergen$ui$twx_blob(cloud_params,direction){
return (new Blob([weathergen.twx.get_twx.call(null,cloud_params,direction)]));
});
/**
 * Initiates a download of a TWX file.
 */
weathergen.ui.save_twx = (function weathergen$ui$save_twx(cloud_params,direction,mission_name){
return weathergen.ui.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),weathergen.ui.safari_safe_binary.call(null,weathergen.ui.twx_blob.call(null,cloud_params,direction)),new cljs.core.Keyword(null,"title","title",636505583),"Save TWX",new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"TWX Files",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["twx"], null)], null)], null),new cljs.core.Keyword(null,"filename","filename",-1428840783),weathergen.ui.twx_filename.call(null,mission_name)], null));
});
weathergen.ui.load_weather_settings = (function weathergen$ui$load_weather_settings(_){
var vec__46356 = weathergen.ui.electron.remote.dialog.showOpenDialog(cljs.core.clj__GT_js.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"title","title",636505583),"Select a VMT or Weathergen Weather File",new cljs.core.Keyword(null,"properties","properties",685819552),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["openFile"], null),new cljs.core.Keyword(null,"defaultPath","defaultPath",-582313676),weathergen.falcon.files.mission.campaign_dir.call(null,cljs.core.deref.call(null,weathergen.ui.mission)),new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"VMT Weather Settings",new cljs.core.Keyword(null,"extensions","extensions",-1103629196),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["vmtw"], null)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"WeatherGen Settings",new cljs.core.Keyword(null,"extensions","extensions",-1103629196),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["edn"], null)], null)], null)], null)));
var path = cljs.core.nth.call(null,vec__46356,(0),null);
if(cljs.core.truth_(path)){
var data = weathergen.model.upgrade.call(null,cljs.reader.read_string.call(null,weathergen.filesystem.file_text.call(null,path)),weathergen.ui.revision);
var t = weathergen.falcon.files.mission.mission_time.call(null,cljs.core.deref.call(null,weathergen.ui.mission));
return javelin.core.dosync_STAR_.call(null,((function (data,t,vec__46356,path){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc_in.call(null,new cljs.core.Keyword(null,"weather-params","weather-params",-259271365).cljs$core$IFn$_invoke$arity$1(data),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"current","current",-1088038603)], null),t));

cljs.core.reset_BANG_.call(null,weathergen.ui.display_params,cljs.core.assoc.call(null,new cljs.core.Keyword(null,"display-params","display-params",573405707).cljs$core$IFn$_invoke$arity$1(data),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"mission-name","mission-name",1479736582),null,new cljs.core.Keyword(null,"from","from",1815293044),t,new cljs.core.Keyword(null,"to","to",192099007),weathergen.time.add_minutes.call(null,t,((6) * (60))),new cljs.core.Keyword(null,"step","step",1288888124),new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"movement-params","movement-params",293385966).cljs$core$IFn$_invoke$arity$1(data))], null)));

cljs.core.reset_BANG_.call(null,weathergen.ui.movement_params,new cljs.core.Keyword(null,"movement-params","movement-params",293385966).cljs$core$IFn$_invoke$arity$1(data));

cljs.core.reset_BANG_.call(null,weathergen.ui.cloud_params,new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983).cljs$core$IFn$_invoke$arity$1(data));

return cljs.core.swap_BANG_.call(null,weathergen.ui.time_params,cljs.core.assoc,new cljs.core.Keyword(null,"displayed","displayed",-436192586),t);
});})(data,t,vec__46356,path))
);
} else {
return null;
}
});
hoplon.core.do_watch.call(null,weathergen.ui.mission,(function (_,mission){
if(cljs.core.truth_(mission)){
var current = weathergen.falcon.files.mission.mission_time.call(null,mission);
cljs.core.swap_BANG_.call(null,weathergen.ui.display_params,cljs.core.update,new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),((function (current){
return (function (ms){
return cljs.core.assoc.call(null,ms,new cljs.core.Keyword(null,"from","from",1815293044),current,new cljs.core.Keyword(null,"to","to",192099007),weathergen.time.add_minutes.call(null,current,((60) * (6))));
});})(current))
);

cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,weathergen.model.jump_to_time,cljs.core.deref.call(null,weathergen.ui.movement_params),current);

return cljs.core.swap_BANG_.call(null,weathergen.ui.time_params,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"displayed","displayed",-436192586)], null),current);
} else {
return null;
}
}));
/**
 * Loads a mission (.cam/.tac) mission file.
 */
weathergen.ui.load_mission = (function weathergen$ui$load_mission(installs,path){
var timer_name__15521__auto__ = "load-mission";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){var mission_data = (function (){var timer_name__15521__auto____$1 = "read-mission";
var ignore__15522__auto____$1 = console.time(timer_name__15521__auto____$1);
var result__15523__auto__ = weathergen.falcon.files.mission.read_mission.call(null,installs,path);
console.timeEnd(timer_name__15521__auto____$1);

return result__15523__auto__;
})();
return weathergen.progress.with_step.call(null,"Preparing views",((function (mission_data,timer_name__15521__auto__,ignore__15522__auto__){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (mission_data,timer_name__15521__auto__,ignore__15522__auto__){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.mission,mission_data);

var current = weathergen.falcon.files.mission.mission_time.call(null,cljs.core.deref.call(null,weathergen.ui.mission));
return cljs.core.reset_BANG_.call(null,weathergen.ui.visible_sides,cljs.core.PersistentHashSet.createAsIfByAssoc([(function (){var G__46362 = weathergen.falcon.files.mission.side.call(null,mission_data,weathergen.falcon.files.mission.last_player_team.call(null,mission_data));
return G__46362;
})()]));
});})(mission_data,timer_name__15521__auto__,ignore__15522__auto__))
);
});})(mission_data,timer_name__15521__auto__,ignore__15522__auto__))
);
})();
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
/**
 * Compresses a buffer, returing a new buffer with the compressed
 *   data.
 */
weathergen.ui.compress = (function weathergen$ui$compress(buf){
return weathergen.ui.zlib.gzipSync(buf);
});
/**
 * Decompresses a buffer, returning a new buffer with the expanded
 *   data.
 */
weathergen.ui.decompress = (function weathergen$ui$decompress(buf){
return weathergen.ui.zlib.gunzipSync(buf);
});
weathergen.ui.StringDecoder = (require("string_decoder")["StringDecoder"]);
/**
 * Converts a buffer to a string.
 */
weathergen.ui.buf__GT_string = (function weathergen$ui$buf__GT_string(buf){
return (new weathergen.ui.StringDecoder()).write(buf);
});
/**
 * Converts a buffer to a string.
 */
weathergen.ui.string__GT_buf = (function weathergen$ui$string__GT_buf(s){
return Buffer.from(s);
});
/**
 * Loads a briefing (.vmtb) file given a path to a briefing and a map
 *   from installation names to their directories.
 */
weathergen.ui.load_briefing = (function weathergen$ui$load_briefing(installations,path){
return weathergen.progress.with_step.call(null,"Reading briefing file",(function (){
var map__46367 = weathergen.encoding.decode.call(null,weathergen.ui.decompress.call(null,weathergen.filesystem.file_buffer.call(null,path)));
var map__46367__$1 = ((((!((map__46367 == null)))?((((map__46367.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46367.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46367):map__46367);
var vmtb = map__46367__$1;
var revision = cljs.core.get.call(null,map__46367__$1,new cljs.core.Keyword(null,"revision","revision",-1350113114));
var install_id = cljs.core.get.call(null,map__46367__$1,new cljs.core.Keyword(null,"install-id","install-id",-1310868737));
var briefing = cljs.core.get.call(null,map__46367__$1,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.ui",null,951,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (){
return new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, ["load-briefing",new cljs.core.Keyword(null,"installations","installations",-2091217739),installations,new cljs.core.Keyword(null,"revision","revision",-1350113114),revision,new cljs.core.Keyword(null,"briefing?","briefing?",-568550789),!((briefing == null))], null);
});})(map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
,null)),null,1019832992);

var mission_data = weathergen.progress.with_step.call(null,[cljs.core.str.cljs$core$IFn$_invoke$arity$1("Loading briefing from "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(path)].join(''),((function (map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (){
var briefing_version_46369 = cljs.core.get_in.call(null,briefing,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"build-info","build-info",-622713066),"VERSION"], null));
var this_version_46370 = cljs.core.get.call(null,cljs.core.deref.call(null,weathergen.ui.build_info),"VERSION");
if(cljs.core._EQ_.call(null,briefing_version_46369,this_version_46370)){
} else {
weathergen.progress.step_warn.call(null,[cljs.core.str.cljs$core$IFn$_invoke$arity$1("The version used to save this briefing file was "),cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__23338__auto__ = briefing_version_46369;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "(no version present)";
}
})()),cljs.core.str.cljs$core$IFn$_invoke$arity$1(". The version of VMT you are running is "),cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__23338__auto__ = this_version_46370;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "(no version present)";
}
})()),cljs.core.str.cljs$core$IFn$_invoke$arity$1(". While different versions of VMT generally work just fine together, if anything doesn't work right you might want to make sure you and the mission creator are using the same version.")].join(''));
}

return weathergen.falcon.files.mission.briefing__GT_mission.call(null,installations,briefing);
});})(map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
);
var unedit = ((function (mission_data,map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (m){
return cljs.core.assoc.call(null,m,new cljs.core.Keyword(null,"editing?","editing?",1646440800),false);
});})(mission_data,map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
;
return weathergen.progress.with_step.call(null,"Preparing views",((function (mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.display_mode,new cljs.core.Keyword(null,"briefing","briefing",-176308969));

cljs.core.reset_BANG_.call(null,weathergen.ui.mission,mission_data);

cljs.core.reset_BANG_.call(null,weathergen.ui.visible_sides,new cljs.core.Keyword(null,"visible-sides","visible-sides",391079481).cljs$core$IFn$_invoke$arity$1(vmtb));

cljs.core.reset_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc_in.call(null,cljs.core.update.call(null,cljs.core.update.call(null,new cljs.core.Keyword(null,"weather-params","weather-params",-259271365).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"weather","weather",1320452344).cljs$core$IFn$_invoke$arity$1(vmtb)),new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),((function (mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (p1__46363_SHARP_){
return cljs.core.map.call(null,unedit,p1__46363_SHARP_);
});})(mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
),new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),((function (mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (p1__46364_SHARP_){
return cljs.core.map.call(null,unedit,p1__46364_SHARP_);
});})(mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"max","max",61366548)], null),weathergen.falcon.files.mission.mission_time.call(null,mission_data)));

cljs.core.reset_BANG_.call(null,weathergen.ui.cloud_params,new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"weather","weather",1320452344).cljs$core$IFn$_invoke$arity$1(vmtb)));

cljs.core.reset_BANG_.call(null,weathergen.ui.movement_params,new cljs.core.Keyword(null,"movement-params","movement-params",293385966).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"weather","weather",1320452344).cljs$core$IFn$_invoke$arity$1(vmtb)));

cljs.core.reset_BANG_.call(null,weathergen.ui.display_params,new cljs.core.Keyword(null,"display-params","display-params",573405707).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"weather","weather",1320452344).cljs$core$IFn$_invoke$arity$1(vmtb)));

return cljs.core.reset_BANG_.call(null,weathergen.ui.briefing_notes,(function (){var or__23338__auto__ = new cljs.core.Keyword(null,"briefing-notes","briefing-notes",-1524193117).cljs$core$IFn$_invoke$arity$1(vmtb);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "";
}
})());
});})(mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
);
});})(mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
);
}));
});
/**
 * Prompts the user for a path and saves a briefing file to it.
 */
weathergen.ui.save_briefing = (function weathergen$ui$save_briefing(install_id,visible_sides){
return weathergen.ui.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),weathergen.ui.compress.call(null,weathergen.encoding.encode.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"revision","revision",-1350113114),weathergen.ui.revision,new cljs.core.Keyword(null,"briefing","briefing",-176308969),weathergen.falcon.files.mission.mission__GT_briefing.call(null,cljs.core.deref.call(null,weathergen.ui.mission),install_id,cljs.core.deref.call(null,weathergen.ui.build_info)),new cljs.core.Keyword(null,"weather","weather",1320452344),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),cljs.core.deref.call(null,weathergen.ui.weather_params),new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983),cljs.core.deref.call(null,weathergen.ui.cloud_params),new cljs.core.Keyword(null,"movement-params","movement-params",293385966),cljs.core.deref.call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"display-params","display-params",573405707),cljs.core.deref.call(null,weathergen.ui.display_params)], null),new cljs.core.Keyword(null,"visible-sides","visible-sides",391079481),visible_sides,new cljs.core.Keyword(null,"briefing-notes","briefing-notes",-1524193117),cljs.core.deref.call(null,weathergen.ui.briefing_notes)], null))),new cljs.core.Keyword(null,"title","title",636505583),"Save a briefing file",new cljs.core.Keyword(null,"filename","filename",-1428840783),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.mission_name_base.call(null,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)))),cljs.core.str.cljs$core$IFn$_invoke$arity$1(".vmtb")].join(''),new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"VMT Briefing",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["vmtb"], null)], null)], null)], null));
});
weathergen.ui.weather_worker = (function (){var worker = (new Worker("worker.js"));
var command_ch = cljs.core.async.chan.call(null);
var result_ch = cljs.core.async.chan.call(null);
var output_ch = cljs.core.async.chan.call(null);
worker.onmessage = ((function (worker,command_ch,result_ch,output_ch){
return (function (e){
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto__,worker,command_ch,result_ch,output_ch){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto__,worker,command_ch,result_ch,output_ch){
return (function (state_46376){
var state_val_46377 = (state_46376[(1)]);
if((state_val_46377 === (1))){
var inst_46371 = e.data;
var inst_46372 = weathergen.encoding.decode.call(null,inst_46371);
var state_46376__$1 = state_46376;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_46376__$1,(2),result_ch,inst_46372);
} else {
if((state_val_46377 === (2))){
var inst_46374 = (state_46376[(2)]);
var state_46376__$1 = state_46376;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46376__$1,inst_46374);
} else {
return null;
}
}
});})(c__40874__auto__,worker,command_ch,result_ch,output_ch))
;
return ((function (switch__40760__auto__,c__40874__auto__,worker,command_ch,result_ch,output_ch){
return (function() {
var weathergen$ui$state_machine__40761__auto__ = null;
var weathergen$ui$state_machine__40761__auto____0 = (function (){
var statearr_46381 = [null,null,null,null,null,null,null];
(statearr_46381[(0)] = weathergen$ui$state_machine__40761__auto__);

(statearr_46381[(1)] = (1));

return statearr_46381;
});
var weathergen$ui$state_machine__40761__auto____1 = (function (state_46376){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46376);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46382){if((e46382 instanceof Object)){
var ex__40764__auto__ = e46382;
var statearr_46383_46411 = state_46376;
(statearr_46383_46411[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46376);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46382;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46412 = state_46376;
state_46376 = G__46412;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$state_machine__40761__auto__ = function(state_46376){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__40761__auto____1.call(this,state_46376);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__40761__auto____0;
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__40761__auto____1;
return weathergen$ui$state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto__,worker,command_ch,result_ch,output_ch))
})();
var state__40876__auto__ = (function (){var statearr_46384 = f__40875__auto__.call(null);
(statearr_46384[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_46384;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto__,worker,command_ch,result_ch,output_ch))
);

return c__40874__auto__;
});})(worker,command_ch,result_ch,output_ch))
;

return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"command-ch","command-ch",508874766),command_ch,new cljs.core.Keyword(null,"worker","worker",938239996),worker,new cljs.core.Keyword(null,"output-ch","output-ch",1069791231),output_ch,new cljs.core.Keyword(null,"loop","loop",-395552849),(function (){var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto__,worker,command_ch,result_ch,output_ch){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto__,worker,command_ch,result_ch,output_ch){
return (function (state_46398){
var state_val_46399 = (state_46398[(1)]);
if((state_val_46399 === (1))){
var state_46398__$1 = state_46398;
var statearr_46400_46413 = state_46398__$1;
(statearr_46400_46413[(2)] = null);

(statearr_46400_46413[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46399 === (2))){
var state_46398__$1 = state_46398;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46398__$1,(4),command_ch);
} else {
if((state_val_46399 === (3))){
var inst_46396 = (state_46398[(2)]);
var state_46398__$1 = state_46398;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46398__$1,inst_46396);
} else {
if((state_val_46399 === (4))){
var inst_46387 = (state_46398[(2)]);
var inst_46388 = weathergen.encoding.encode.call(null,inst_46387);
var inst_46389 = worker.postMessage(inst_46388);
var state_46398__$1 = (function (){var statearr_46401 = state_46398;
(statearr_46401[(7)] = inst_46389);

return statearr_46401;
})();
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46398__$1,(6),result_ch);
} else {
if((state_val_46399 === (5))){
var inst_46393 = (state_46398[(2)]);
var state_46398__$1 = (function (){var statearr_46402 = state_46398;
(statearr_46402[(8)] = inst_46393);

return statearr_46402;
})();
var statearr_46403_46414 = state_46398__$1;
(statearr_46403_46414[(2)] = null);

(statearr_46403_46414[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46399 === (6))){
var inst_46391 = (state_46398[(2)]);
var state_46398__$1 = state_46398;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_46398__$1,(5),output_ch,inst_46391);
} else {
return null;
}
}
}
}
}
}
});})(c__40874__auto__,worker,command_ch,result_ch,output_ch))
;
return ((function (switch__40760__auto__,c__40874__auto__,worker,command_ch,result_ch,output_ch){
return (function() {
var weathergen$ui$state_machine__40761__auto__ = null;
var weathergen$ui$state_machine__40761__auto____0 = (function (){
var statearr_46407 = [null,null,null,null,null,null,null,null,null];
(statearr_46407[(0)] = weathergen$ui$state_machine__40761__auto__);

(statearr_46407[(1)] = (1));

return statearr_46407;
});
var weathergen$ui$state_machine__40761__auto____1 = (function (state_46398){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46398);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46408){if((e46408 instanceof Object)){
var ex__40764__auto__ = e46408;
var statearr_46409_46415 = state_46398;
(statearr_46409_46415[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46398);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46408;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46416 = state_46398;
state_46398 = G__46416;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$state_machine__40761__auto__ = function(state_46398){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__40761__auto____1.call(this,state_46398);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__40761__auto____0;
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__40761__auto____1;
return weathergen$ui$state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto__,worker,command_ch,result_ch,output_ch))
})();
var state__40876__auto__ = (function (){var statearr_46410 = f__40875__auto__.call(null);
(statearr_46410[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_46410;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto__,worker,command_ch,result_ch,output_ch))
);

return c__40874__auto__;
})()], null);
})();
weathergen.ui.save_weather_files = (function weathergen$ui$save_weather_files(p__46417){
var map__46514 = p__46417;
var map__46514__$1 = ((((!((map__46514 == null)))?((((map__46514.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46514.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46514):map__46514);
var ny = cljs.core.get.call(null,map__46514__$1,new cljs.core.Keyword(null,"ny","ny",1701791641));
var progress = cljs.core.get.call(null,map__46514__$1,new cljs.core.Keyword(null,"progress","progress",244323547));
var weather_params = cljs.core.get.call(null,map__46514__$1,new cljs.core.Keyword(null,"weather-params","weather-params",-259271365));
var step = cljs.core.get.call(null,map__46514__$1,new cljs.core.Keyword(null,"step","step",1288888124));
var to = cljs.core.get.call(null,map__46514__$1,new cljs.core.Keyword(null,"to","to",192099007));
var mission_name = cljs.core.get.call(null,map__46514__$1,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582));
var cloud_params = cljs.core.get.call(null,map__46514__$1,new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983));
var save_file = cljs.core.get.call(null,map__46514__$1,new cljs.core.Keyword(null,"save-file","save-file",-250442926));
var nx = cljs.core.get.call(null,map__46514__$1,new cljs.core.Keyword(null,"nx","nx",-1996436366));
var from = cljs.core.get.call(null,map__46514__$1,new cljs.core.Keyword(null,"from","from",1815293044));
var campaign_dir = cljs.core.get.call(null,map__46514__$1,new cljs.core.Keyword(null,"campaign-dir","campaign-dir",-1278307883));
var weather_direction = cljs.core.get.call(null,map__46514__$1,new cljs.core.Keyword(null,"weather-direction","weather-direction",-1789808873));
var cancel = cljs.core.get.call(null,map__46514__$1,new cljs.core.Keyword(null,"cancel","cancel",-1964088360));
var cells = (function (){var iter__24200__auto__ = ((function (map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function weathergen$ui$save_weather_files_$_iter__46516(s__46517){
return (new cljs.core.LazySeq(null,((function (map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
var s__46517__$1 = s__46517;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__46517__$1);
if(temp__5278__auto__){
var xs__5831__auto__ = temp__5278__auto__;
var x = cljs.core.first.call(null,xs__5831__auto__);
var iterys__24196__auto__ = ((function (s__46517__$1,x,xs__5831__auto__,temp__5278__auto__,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function weathergen$ui$save_weather_files_$_iter__46516_$_iter__46518(s__46519){
return (new cljs.core.LazySeq(null,((function (s__46517__$1,x,xs__5831__auto__,temp__5278__auto__,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
var s__46519__$1 = s__46519;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__46519__$1);
if(temp__5278__auto____$1){
var s__46519__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__46519__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__46519__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__46521 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__46520 = (0);
while(true){
if((i__46520 < size__24199__auto__)){
var y = cljs.core._nth.call(null,c__24198__auto__,i__46520);
cljs.core.chunk_append.call(null,b__46521,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));

var G__46610 = (i__46520 + (1));
i__46520 = G__46610;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46521),weathergen$ui$save_weather_files_$_iter__46516_$_iter__46518.call(null,cljs.core.chunk_rest.call(null,s__46519__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46521),null);
}
} else {
var y = cljs.core.first.call(null,s__46519__$2);
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null),weathergen$ui$save_weather_files_$_iter__46516_$_iter__46518.call(null,cljs.core.rest.call(null,s__46519__$2)));
}
} else {
return null;
}
break;
}
});})(s__46517__$1,x,xs__5831__auto__,temp__5278__auto__,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
,null,null));
});})(s__46517__$1,x,xs__5831__auto__,temp__5278__auto__,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,cljs.core.range.call(null,ny)));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$save_weather_files_$_iter__46516.call(null,cljs.core.rest.call(null,s__46517__$1)));
} else {
var G__46611 = cljs.core.rest.call(null,s__46517__$1);
s__46517__$1 = G__46611;
continue;
}
} else {
return null;
}
break;
}
});})(map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
,null,null));
});})(map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,nx));
})();
var start = weathergen.time.campaign_time__GT_minutes.call(null,from);
var end = weathergen.time.campaign_time__GT_minutes.call(null,to);
var steps = (cljs.core.long$.call(null,((end - start) / step)) + (1));
var updates_dir = weathergen.filesystem.path_combine.call(null,campaign_dir,"WeatherMapsUpdates");
var save_blob = ((function (cells,start,end,steps,updates_dir,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (blob,path){
cljs.core.reset_BANG_.call(null,save_file,path);

return weathergen.ui.common.save_blob_async.call(null,blob,weathergen.filesystem.path_combine.call(null,campaign_dir,path));
});})(cells,start,end,steps,updates_dir,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (state_46580){
var state_val_46581 = (state_46580[(1)]);
if((state_val_46581 === (7))){
var inst_46551 = (state_46580[(2)]);
var inst_46552 = new cljs.core.Keyword(null,"output-ch","output-ch",1069791231).cljs$core$IFn$_invoke$arity$1(weathergen.ui.weather_worker);
var state_46580__$1 = (function (){var statearr_46582 = state_46580;
(statearr_46582[(7)] = inst_46551);

return statearr_46582;
})();
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46580__$1,(8),inst_46552);
} else {
if((state_val_46581 === (1))){
var inst_46522 = start;
var inst_46523 = false;
var state_46580__$1 = (function (){var statearr_46583 = state_46580;
(statearr_46583[(8)] = inst_46522);

(statearr_46583[(9)] = inst_46523);

return statearr_46583;
})();
var statearr_46584_46612 = state_46580__$1;
(statearr_46584_46612[(2)] = null);

(statearr_46584_46612[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46581 === (4))){
var inst_46535 = weathergen.ui.twx_blob.call(null,cloud_params,weather_direction);
var inst_46536 = weathergen.ui.twx_filename.call(null,mission_name);
var inst_46537 = save_blob.call(null,inst_46535,inst_46536);
var inst_46538 = weathergen.ui.settings_blob.call(null);
var inst_46539 = weathergen.ui.settings_filename.call(null,mission_name);
var inst_46540 = save_blob.call(null,inst_46538,inst_46539);
var inst_46541 = cljs.core.reset_BANG_.call(null,progress,null);
var state_46580__$1 = (function (){var statearr_46585 = state_46580;
(statearr_46585[(10)] = inst_46540);

(statearr_46585[(11)] = inst_46537);

return statearr_46585;
})();
var statearr_46586_46613 = state_46580__$1;
(statearr_46586_46613[(2)] = inst_46541);

(statearr_46586_46613[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46581 === (13))){
var inst_46522 = (state_46580[(8)]);
var inst_46571 = (inst_46522 + step);
var inst_46522__$1 = inst_46571;
var inst_46523 = true;
var state_46580__$1 = (function (){var statearr_46587 = state_46580;
(statearr_46587[(8)] = inst_46522__$1);

(statearr_46587[(9)] = inst_46523);

return statearr_46587;
})();
var statearr_46588_46614 = state_46580__$1;
(statearr_46588_46614[(2)] = null);

(statearr_46588_46614[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46581 === (6))){
var inst_46576 = (state_46580[(2)]);
var state_46580__$1 = state_46580;
var statearr_46589_46615 = state_46580__$1;
(statearr_46589_46615[(2)] = inst_46576);

(statearr_46589_46615[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46581 === (3))){
var inst_46578 = (state_46580[(2)]);
var state_46580__$1 = state_46580;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46580__$1,inst_46578);
} else {
if((state_val_46581 === (12))){
var inst_46569 = cljs.core.reset_BANG_.call(null,progress,null);
var state_46580__$1 = state_46580;
var statearr_46590_46616 = state_46580__$1;
(statearr_46590_46616[(2)] = inst_46569);

(statearr_46590_46616[(1)] = (14));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46581 === (2))){
var inst_46522 = (state_46580[(8)]);
var inst_46523 = (state_46580[(9)]);
var inst_46525 = (inst_46522 - start);
var inst_46526 = (end - start);
var inst_46527 = (inst_46525 / inst_46526);
var inst_46528 = ((inst_46527 < (1)) ? inst_46527 : (1));
var inst_46529 = (function (){var t = inst_46522;
var first_done_QMARK_ = inst_46523;
var p = inst_46528;
return ((function (t,first_done_QMARK_,p,inst_46522,inst_46523,inst_46525,inst_46526,inst_46527,inst_46528,state_val_46581,c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["progress",p], null);
});
;})(t,first_done_QMARK_,p,inst_46522,inst_46523,inst_46525,inst_46526,inst_46527,inst_46528,state_val_46581,c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
})();
var inst_46530 = (new cljs.core.Delay(inst_46529,null));
var inst_46531 = taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.ui",null,1044,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),inst_46530,null,770545663);
var inst_46532 = cljs.core.reset_BANG_.call(null,progress,inst_46528);
var inst_46533 = (end < inst_46522);
var state_46580__$1 = (function (){var statearr_46591 = state_46580;
(statearr_46591[(12)] = inst_46531);

(statearr_46591[(13)] = inst_46532);

return statearr_46591;
})();
if(cljs.core.truth_(inst_46533)){
var statearr_46592_46617 = state_46580__$1;
(statearr_46592_46617[(1)] = (4));

} else {
var statearr_46593_46618 = state_46580__$1;
(statearr_46593_46618[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46581 === (11))){
var inst_46522 = (state_46580[(8)]);
var inst_46555 = (state_46580[(14)]);
var inst_46562 = (state_46580[(2)]);
var inst_46563 = weathergen.time.minutes__GT_campaign_time.call(null,inst_46522);
var inst_46564 = weathergen.ui.fmap_filename.call(null,inst_46563);
var inst_46565 = weathergen.filesystem.path_combine.call(null,"WeatherMapsUpdates",inst_46564);
var inst_46566 = save_blob.call(null,inst_46555,inst_46565);
var inst_46567 = cljs.core.deref.call(null,cancel);
var state_46580__$1 = (function (){var statearr_46594 = state_46580;
(statearr_46594[(15)] = inst_46566);

(statearr_46594[(16)] = inst_46562);

return statearr_46594;
})();
if(cljs.core.truth_(inst_46567)){
var statearr_46595_46619 = state_46580__$1;
(statearr_46595_46619[(1)] = (12));

} else {
var statearr_46596_46620 = state_46580__$1;
(statearr_46596_46620[(1)] = (13));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46581 === (9))){
var state_46580__$1 = state_46580;
var statearr_46597_46621 = state_46580__$1;
(statearr_46597_46621[(2)] = null);

(statearr_46597_46621[(1)] = (11));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46581 === (5))){
var inst_46522 = (state_46580[(8)]);
var inst_46543 = new cljs.core.Keyword(null,"command-ch","command-ch",508874766).cljs$core$IFn$_invoke$arity$1(weathergen.ui.weather_worker);
var inst_46544 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_46545 = [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"current","current",-1088038603)];
var inst_46546 = (new cljs.core.PersistentVector(null,2,(5),inst_46544,inst_46545,null));
var inst_46547 = weathergen.time.minutes__GT_campaign_time.call(null,inst_46522);
var inst_46548 = cljs.core.assoc_in.call(null,weather_params,inst_46546,inst_46547);
var inst_46549 = cljs.core.assoc.call(null,inst_46548,new cljs.core.Keyword(null,"cells","cells",-985166822),cells);
var state_46580__$1 = state_46580;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_46580__$1,(7),inst_46543,inst_46549);
} else {
if((state_val_46581 === (14))){
var inst_46574 = (state_46580[(2)]);
var state_46580__$1 = state_46580;
var statearr_46598_46622 = state_46580__$1;
(statearr_46598_46622[(2)] = inst_46574);

(statearr_46598_46622[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46581 === (10))){
var inst_46555 = (state_46580[(14)]);
var inst_46558 = weathergen.ui.mission_name_base.call(null,mission_name);
var inst_46559 = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(inst_46558),cljs.core.str.cljs$core$IFn$_invoke$arity$1(".fmap")].join('');
var inst_46560 = save_blob.call(null,inst_46555,inst_46559);
var state_46580__$1 = state_46580;
var statearr_46599_46623 = state_46580__$1;
(statearr_46599_46623[(2)] = inst_46560);

(statearr_46599_46623[(1)] = (11));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46581 === (8))){
var inst_46523 = (state_46580[(9)]);
var inst_46554 = (state_46580[(2)]);
var inst_46555 = weathergen.fmap.get_blob.call(null,inst_46554,nx,ny);
var state_46580__$1 = (function (){var statearr_46600 = state_46580;
(statearr_46600[(14)] = inst_46555);

return statearr_46600;
})();
if(cljs.core.truth_(inst_46523)){
var statearr_46601_46624 = state_46580__$1;
(statearr_46601_46624[(1)] = (9));

} else {
var statearr_46602_46625 = state_46580__$1;
(statearr_46602_46625[(1)] = (10));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
return ((function (switch__40760__auto__,c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function() {
var weathergen$ui$save_weather_files_$_state_machine__40761__auto__ = null;
var weathergen$ui$save_weather_files_$_state_machine__40761__auto____0 = (function (){
var statearr_46606 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_46606[(0)] = weathergen$ui$save_weather_files_$_state_machine__40761__auto__);

(statearr_46606[(1)] = (1));

return statearr_46606;
});
var weathergen$ui$save_weather_files_$_state_machine__40761__auto____1 = (function (state_46580){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46580);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46607){if((e46607 instanceof Object)){
var ex__40764__auto__ = e46607;
var statearr_46608_46626 = state_46580;
(statearr_46608_46626[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46580);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46607;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46627 = state_46580;
state_46580 = G__46627;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$save_weather_files_$_state_machine__40761__auto__ = function(state_46580){
switch(arguments.length){
case 0:
return weathergen$ui$save_weather_files_$_state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$save_weather_files_$_state_machine__40761__auto____1.call(this,state_46580);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$save_weather_files_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$save_weather_files_$_state_machine__40761__auto____0;
weathergen$ui$save_weather_files_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$save_weather_files_$_state_machine__40761__auto____1;
return weathergen$ui$save_weather_files_$_state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
})();
var state__40876__auto__ = (function (){var statearr_46609 = f__40875__auto__.call(null);
(statearr_46609[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_46609;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46514,map__46514__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
);

return c__40874__auto__;
});
weathergen.ui.remove_nth = (function weathergen$ui$remove_nth(coll,n){
return cljs.core.vec.call(null,cljs.core.concat.call(null,cljs.core.take.call(null,n,coll),cljs.core.drop.call(null,(n + (1)),coll)));
});
weathergen.ui.invert_map = (function weathergen$ui$invert_map(m){
return cljs.core.zipmap.call(null,cljs.core.vals.call(null,m),cljs.core.keys.call(null,m));
});
weathergen.ui.map_name__GT_key = new cljs.core.PersistentArrayMap(null, 4, ["Israel",new cljs.core.Keyword(null,"israel","israel",893888780),"Balkans",new cljs.core.Keyword(null,"balkans","balkans",-514308101),"Korea",new cljs.core.Keyword(null,"korea","korea",-1788137114),"Kuriles",new cljs.core.Keyword(null,"kuriles","kuriles",1501726930)], null);
weathergen.ui.map_key__GT_name = weathergen.ui.invert_map.call(null,weathergen.ui.map_name__GT_key);
weathergen.ui.display_name__GT_key = new cljs.core.PersistentArrayMap(null, 3, ["Weather Type",new cljs.core.Keyword(null,"type","type",1174270348),"Pressure",new cljs.core.Keyword(null,"pressure","pressure",505343747),"Temperature",new cljs.core.Keyword(null,"temperature","temperature",899018429)], null);
weathergen.ui.display_key__GT_name = weathergen.ui.invert_map.call(null,weathergen.ui.display_name__GT_key);
weathergen.ui.overlay_name__GT_key = new cljs.core.PersistentArrayMap(null, 4, ["Wind",new cljs.core.Keyword(null,"wind","wind",-527553074),"Pressure",new cljs.core.Keyword(null,"pressure","pressure",505343747),"Temperature",new cljs.core.Keyword(null,"temperature","temperature",899018429),"Weather Type",new cljs.core.Keyword(null,"type","type",1174270348)], null);
weathergen.ui.overlay_key__GT_name = weathergen.ui.invert_map.call(null,weathergen.ui.overlay_name__GT_key);
weathergen.ui.type_name__GT_key = new cljs.core.PersistentArrayMap(null, 4, ["Sunny",new cljs.core.Keyword(null,"sunny","sunny",1448267778),"Fair",new cljs.core.Keyword(null,"fair","fair",1684139423),"Poor",new cljs.core.Keyword(null,"poor","poor",1462482211),"Inclement",new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null);
weathergen.ui.type_key__GT_name = weathergen.ui.invert_map.call(null,weathergen.ui.type_name__GT_key);
weathergen.ui.pressure_unit_name__GT_key = new cljs.core.PersistentArrayMap(null, 2, ["InHg",new cljs.core.Keyword(null,"inhg","inhg",-863180091),"Millibar",new cljs.core.Keyword(null,"mbar","mbar",-1396360988)], null);
weathergen.ui.pressure_unit_key__GT_name = weathergen.ui.invert_map.call(null,weathergen.ui.pressure_unit_name__GT_key);
weathergen.ui.mbar_per_inhg = 33.8637526;
weathergen.ui.mbar__GT_inhg = (function weathergen$ui$mbar__GT_inhg(mbar){
return (mbar / weathergen.ui.mbar_per_inhg);
});
weathergen.ui.inhg__GT_mbar = (function weathergen$ui$inhg__GT_mbar(inhg){
return (inhg * weathergen.ui.mbar_per_inhg);
});
/**
 * Returns a string describing a weather type.
 */
weathergen.ui.format_type = (function weathergen$ui$format_type(type){
var pred__46631 = cljs.core._EQ_;
var expr__46632 = type;
if(cljs.core.truth_(pred__46631.call(null,new cljs.core.Keyword(null,"sunny","sunny",1448267778),expr__46632))){
return "Sunny";
} else {
if(cljs.core.truth_(pred__46631.call(null,new cljs.core.Keyword(null,"fair","fair",1684139423),expr__46632))){
return "Fair";
} else {
if(cljs.core.truth_(pred__46631.call(null,new cljs.core.Keyword(null,"poor","poor",1462482211),expr__46632))){
return "Poor";
} else {
if(cljs.core.truth_(pred__46631.call(null,new cljs.core.Keyword(null,"inclement","inclement",-550669382),expr__46632))){
return "Incl.";
} else {
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("No matching clause: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(expr__46632)].join('')));
}
}
}
}
});
/**
 * Format a pressure in inches Mercury as appropriate for the unit.
 */
weathergen.ui.format_pressure = (function weathergen$ui$format_pressure(inhg,unit){
if(cljs.core.not.call(null,inhg)){
return "";
} else {
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"inhg","inhg",-863180091),unit)){
return inhg.toFixed((2));
} else {
return (function (){var G__46635 = weathergen.ui.inhg__GT_mbar.call(null,inhg);
return G__46635;
})().toFixed((0));
}
}
});
/**
 * Format a temperature string
 */
weathergen.ui.format_temperature = (function weathergen$ui$format_temperature(temp){
if(cljs.core.not.call(null,temp)){
return "";
} else {
return temp.toFixed((0));
}
});
/**
 * Format a wind string.
 */
weathergen.ui.format_wind = (function weathergen$ui$format_wind(wind){
if(cljs.core.not.call(null,wind)){
return "";
} else {
var map__46639 = wind;
var map__46639__$1 = ((((!((map__46639 == null)))?((((map__46639.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46639.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46639):map__46639);
var speed = cljs.core.get.call(null,map__46639__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading = cljs.core.get.call(null,map__46639__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.string.format("%03d",heading)),cljs.core.str.cljs$core$IFn$_invoke$arity$1("@"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.string.format("%02d",(function (){var G__46641 = speed;
return G__46641;
})().toFixed((0)))),cljs.core.str.cljs$core$IFn$_invoke$arity$1("kts")].join('');
}
});
/**
 * Format a visibility so that only numbers below 1 get decimal places.
 */
weathergen.ui.format_visibility = (function weathergen$ui$format_visibility(vis){
if(cljs.core.not.call(null,vis)){
return "";
} else {
if((vis < (2))){
return vis.toFixed((1));
} else {
return vis.toFixed((0));
}
}
});
weathergen.ui.format_coords = (function weathergen$ui$format_coords(x,y){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1(", "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join('');
});
weathergen.ui.cloud_descriptions = (function weathergen$ui$cloud_descriptions(cloud_params,type){
if(cljs.core._EQ_.call(null,type,new cljs.core.Keyword(null,"sunny","sunny",1448267778))){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["SKC"], null);
} else {
var stratus_base = cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),type], null));
var cumulus_base = cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),type], null));
var cumulus_density = new cljs.core.Keyword(null,"cumulus-density","cumulus-density",-212067170).cljs$core$IFn$_invoke$arity$1(cloud_params);
var density_str = ((((25) < cumulus_density))?"SCT":"FEW");
var cumulus_level = goog.string.format("%03d",cljs.core.long$.call(null,(cumulus_base / (100))));
var stratus_level = goog.string.format("%03d",cljs.core.long$.call(null,(stratus_base / (100))));
var G__46643 = cljs.core.PersistentVector.EMPTY;
var G__46643__$1 = ((((cumulus_base > (0))) && ((cumulus_base < stratus_base)))?cljs.core.conj.call(null,G__46643,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(density_str),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cumulus_level),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" ")].join('')):G__46643);
if(cljs.core.not_EQ_.call(null,type,new cljs.core.Keyword(null,"fair","fair",1684139423))){
return cljs.core.conj.call(null,G__46643__$1,[cljs.core.str.cljs$core$IFn$_invoke$arity$1("OVC"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(stratus_level)].join(''));
} else {
return G__46643__$1;
}
}
});
weathergen.ui.contrail_description = (function weathergen$ui$contrail_description(cloud_params,type){
return goog.string.format("COTRA%03d",cljs.core.long$.call(null,(cljs.core.get.call(null,new cljs.core.Keyword(null,"contrails","contrails",1430581743).cljs$core$IFn$_invoke$arity$1(cloud_params),type) / (100))));
});
/**
 * Returns a string describing the clouds for the given weather type.
 */
weathergen.ui.format_cloud = (function weathergen$ui$format_cloud(cloud_params,type){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.reduce.call(null,cljs.core.str,cljs.core.interpose.call(null," ",weathergen.ui.cloud_descriptions.call(null,cloud_params,type)))),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.contrail_description.call(null,cloud_params,type))].join('');
});
/**
 * Returns a string describing precipitation.
 */
weathergen.ui.format_precipitation = (function weathergen$ui$format_precipitation(temperature,type){
if(cljs.core._EQ_.call(null,type,new cljs.core.Keyword(null,"inclement","inclement",-550669382))){
if((temperature > (0))){
return "Rain";
} else {
return "Snow";
}
} else {
return "None";
}
});
/**
 * Returns bullseye (a map of `:heading` and `:distance`) given
 *   weatherspace coordinates (a map of `:x` and `:y`).
 */
weathergen.ui.bullseye = (function weathergen$ui$bullseye(mission,p__46644){
var map__46649 = p__46644;
var map__46649__$1 = ((((!((map__46649 == null)))?((((map__46649.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46649.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46649):map__46649);
var x = cljs.core.get.call(null,map__46649__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__46649__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var map__46651 = new cljs.core.Keyword(null,"campaign-info","campaign-info",1158908966).cljs$core$IFn$_invoke$arity$1(mission);
var map__46651__$1 = ((((!((map__46651 == null)))?((((map__46651.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46651.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46651):map__46651);
var bullseye_x = cljs.core.get.call(null,map__46651__$1,new cljs.core.Keyword(null,"bullseye-x","bullseye-x",-1698783852));
var bullseye_y = cljs.core.get.call(null,map__46651__$1,new cljs.core.Keyword(null,"bullseye-y","bullseye-y",904460818));
return goog.string.format("%f %f (%d %d)",x,y,bullseye_x,bullseye_y);
});
/**
 * Returns a bullseye string given bullseye coordinates.
 */
weathergen.ui.format_bullseye = (function weathergen$ui$format_bullseye(bullseye){
if(cljs.core.not.call(null,bullseye)){
return "";
} else {
var map__46655 = bullseye;
var map__46655__$1 = ((((!((map__46655 == null)))?((((map__46655.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46655.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46655):map__46655);
var heading = cljs.core.get.call(null,map__46655__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
var distance = cljs.core.get.call(null,map__46655__$1,new cljs.core.Keyword(null,"distance","distance",-1671893894));
return goog.string.format("%03d %d",(function (){var h = cljs.core.long$.call(null,cljs.core.mod.call(null,heading,(360)));
if((h === (0))){
return (360);
} else {
return h;
}
})(),cljs.core.long$.call(null,distance));
}
});
/**
 * Given a mouse event, determined where on the map it occurred, in weatherspace.
 *   Returns coordinates as an [x y] pair, where x and y can be
 *   fractional.
 */
weathergen.ui.mouse_weather_coords = (function weathergen$ui$mouse_weather_coords(var_args){
var args46657 = [];
var len__24559__auto___46669 = arguments.length;
var i__24560__auto___46670 = (0);
while(true){
if((i__24560__auto___46670 < len__24559__auto___46669)){
args46657.push((arguments[i__24560__auto___46670]));

var G__46671 = (i__24560__auto___46670 + (1));
i__24560__auto___46670 = G__46671;
continue;
} else {
}
break;
}

var G__46659 = args46657.length;
switch (G__46659) {
case 1:
return weathergen.ui.mouse_weather_coords.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 3:
return weathergen.ui.mouse_weather_coords.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args46657.length)].join('')));

}
});

weathergen.ui.mouse_weather_coords.cljs$core$IFn$_invoke$arity$1 = (function (e){
return weathergen.ui.mouse_weather_coords.call(null,e,cljs.core.deref.call(null,weathergen.ui.map_zoom),cljs.core.deref.call(null,weathergen.ui.map_pan));
});

weathergen.ui.mouse_weather_coords.cljs$core$IFn$_invoke$arity$3 = (function (e,zoom,pan){
try{var browser_zoom = window.devicePixelRatio;
var ox = ((e["offsetX"]) * browser_zoom);
var oy = ((e["offsetY"]) * browser_zoom);
var vec__46661 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params));
var nx = cljs.core.nth.call(null,vec__46661,(0),null);
var ny = cljs.core.nth.call(null,vec__46661,(1),null);
var map__46664 = pan;
var map__46664__$1 = ((((!((map__46664 == null)))?((((map__46664.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46664.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46664):map__46664);
var x = cljs.core.get.call(null,map__46664__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__46664__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var vec__46665 = cljs.core.deref.call(null,weathergen.ui.map_size);
var width = cljs.core.nth.call(null,vec__46665,(0),null);
var height = cljs.core.nth.call(null,vec__46665,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(((((ox * nx) / width) / zoom) / browser_zoom) + x),(((((oy * ny) / height) / zoom) / browser_zoom) + y)], null);
}catch (e46660){var err = e46660;
return taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"error","error",-978969032),"weathergen.ui",null,1284,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (err){
return (function (){
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [err,"mouse-weather-coords error",new cljs.core.Keyword(null,"e","e",1381269198),e], null);
});})(err))
,null)),null,308951488);
}});

weathergen.ui.mouse_weather_coords.cljs$lang$maxFixedArity = 3;

/**
 * Perform `f` asynchronously every `interval` milliseconds until it
 *   returns a logical true value.
 */
weathergen.ui.retry = (function weathergen$ui$retry(interval,f){
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto__){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto__){
return (function (state_46715){
var state_val_46716 = (state_46715[(1)]);
if((state_val_46716 === (1))){
var state_46715__$1 = state_46715;
var statearr_46717_46731 = state_46715__$1;
(statearr_46717_46731[(2)] = null);

(statearr_46717_46731[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46716 === (2))){
var inst_46703 = f.call(null);
var state_46715__$1 = state_46715;
if(cljs.core.truth_(inst_46703)){
var statearr_46718_46732 = state_46715__$1;
(statearr_46718_46732[(1)] = (4));

} else {
var statearr_46719_46733 = state_46715__$1;
(statearr_46719_46733[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46716 === (3))){
var inst_46713 = (state_46715[(2)]);
var state_46715__$1 = state_46715;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46715__$1,inst_46713);
} else {
if((state_val_46716 === (4))){
var state_46715__$1 = state_46715;
var statearr_46720_46734 = state_46715__$1;
(statearr_46720_46734[(2)] = null);

(statearr_46720_46734[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46716 === (5))){
var inst_46706 = cljs.core.async.timeout.call(null,interval);
var state_46715__$1 = state_46715;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46715__$1,(7),inst_46706);
} else {
if((state_val_46716 === (6))){
var inst_46711 = (state_46715[(2)]);
var state_46715__$1 = state_46715;
var statearr_46721_46735 = state_46715__$1;
(statearr_46721_46735[(2)] = inst_46711);

(statearr_46721_46735[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46716 === (7))){
var inst_46708 = (state_46715[(2)]);
var state_46715__$1 = (function (){var statearr_46722 = state_46715;
(statearr_46722[(7)] = inst_46708);

return statearr_46722;
})();
var statearr_46723_46736 = state_46715__$1;
(statearr_46723_46736[(2)] = null);

(statearr_46723_46736[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
});})(c__40874__auto__))
;
return ((function (switch__40760__auto__,c__40874__auto__){
return (function() {
var weathergen$ui$retry_$_state_machine__40761__auto__ = null;
var weathergen$ui$retry_$_state_machine__40761__auto____0 = (function (){
var statearr_46727 = [null,null,null,null,null,null,null,null];
(statearr_46727[(0)] = weathergen$ui$retry_$_state_machine__40761__auto__);

(statearr_46727[(1)] = (1));

return statearr_46727;
});
var weathergen$ui$retry_$_state_machine__40761__auto____1 = (function (state_46715){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46715);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46728){if((e46728 instanceof Object)){
var ex__40764__auto__ = e46728;
var statearr_46729_46737 = state_46715;
(statearr_46729_46737[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46715);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46728;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46738 = state_46715;
state_46715 = G__46738;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$retry_$_state_machine__40761__auto__ = function(state_46715){
switch(arguments.length){
case 0:
return weathergen$ui$retry_$_state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$retry_$_state_machine__40761__auto____1.call(this,state_46715);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$retry_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$retry_$_state_machine__40761__auto____0;
weathergen$ui$retry_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$retry_$_state_machine__40761__auto____1;
return weathergen$ui$retry_$_state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto__))
})();
var state__40876__auto__ = (function (){var statearr_46730 = f__40875__auto__.call(null);
(statearr_46730[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_46730;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto__))
);

return c__40874__auto__;
});
/**
 * Perform `f` asynchronously `interval` milliseconds from now.
 */
weathergen.ui.later = (function weathergen$ui$later(interval,f){
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto__){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto__){
return (function (state_46759){
var state_val_46760 = (state_46759[(1)]);
if((state_val_46760 === (1))){
var inst_46754 = cljs.core.async.timeout.call(null,interval);
var state_46759__$1 = state_46759;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46759__$1,(2),inst_46754);
} else {
if((state_val_46760 === (2))){
var inst_46756 = (state_46759[(2)]);
var inst_46757 = f.call(null);
var state_46759__$1 = (function (){var statearr_46761 = state_46759;
(statearr_46761[(7)] = inst_46756);

return statearr_46761;
})();
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46759__$1,inst_46757);
} else {
return null;
}
}
});})(c__40874__auto__))
;
return ((function (switch__40760__auto__,c__40874__auto__){
return (function() {
var weathergen$ui$later_$_state_machine__40761__auto__ = null;
var weathergen$ui$later_$_state_machine__40761__auto____0 = (function (){
var statearr_46765 = [null,null,null,null,null,null,null,null];
(statearr_46765[(0)] = weathergen$ui$later_$_state_machine__40761__auto__);

(statearr_46765[(1)] = (1));

return statearr_46765;
});
var weathergen$ui$later_$_state_machine__40761__auto____1 = (function (state_46759){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46759);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46766){if((e46766 instanceof Object)){
var ex__40764__auto__ = e46766;
var statearr_46767_46769 = state_46759;
(statearr_46767_46769[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46759);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46766;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46770 = state_46759;
state_46759 = G__46770;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$later_$_state_machine__40761__auto__ = function(state_46759){
switch(arguments.length){
case 0:
return weathergen$ui$later_$_state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$later_$_state_machine__40761__auto____1.call(this,state_46759);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$later_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$later_$_state_machine__40761__auto____0;
weathergen$ui$later_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$later_$_state_machine__40761__auto____1;
return weathergen$ui$later_$_state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto__))
})();
var state__40876__auto__ = (function (){var statearr_46768 = f__40875__auto__.call(null);
(statearr_46768[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_46768;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto__))
);

return c__40874__auto__;
});
weathergen.ui.resize_handle_size = 0.75;
weathergen.ui.triangle_style = (function weathergen$ui$triangle_style(){
return new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"width","width",-384071477),(0),new cljs.core.Keyword(null,"height","height",1025178622),(0),new cljs.core.Keyword(null,"border-left","border-left",-1150760178),"5px solid transparent",new cljs.core.Keyword(null,"border-right","border-right",-668932860),"5px solid transparent",new cljs.core.Keyword(null,"border-top","border-top",-158897573),"7px solid black",new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null);
});
/**
 * Creates a three-layer border with :inner and :outer colors.
 * @param {...*} var_args
 */
weathergen.ui.triple_border = (function() { 
var weathergen$ui$triple_border__delegate = function (args__29776__auto__){
var vec__46785 = hoplon.core.parse_args.call(null,args__29776__auto__);
var attrs = cljs.core.nth.call(null,vec__46785,(0),null);
var contents = cljs.core.nth.call(null,vec__46785,(1),null);
var map__46788 = attrs;
var map__46788__$1 = ((((!((map__46788 == null)))?((((map__46788.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46788.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46788):map__46788);
var inner = cljs.core.get.call(null,map__46788__$1,new cljs.core.Keyword(null,"inner","inner",-1383171215));
var outer = cljs.core.get.call(null,map__46788__$1,new cljs.core.Keyword(null,"outer","outer",-375185956));
var css = cljs.core.get.call(null,map__46788__$1,new cljs.core.Keyword(null,"css","css",1135045163));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"inner","inner",-1383171215),new cljs.core.Keyword(null,"outer","outer",-375185956),new cljs.core.Keyword(null,"css","css",1135045163));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (map__46788,map__46788__$1,inner,outer,css,attrs__$1,vec__46785,attrs,contents){
return (function (G__46791,G__46792,G__46790){
return G__46790.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"border-width","border-width",-1512605390),"1px",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),G__46791,new cljs.core.Keyword(null,"margin","margin",-995903681),(0),new cljs.core.Keyword(null,"padding","padding",1660304693),(0)], null),G__46792);
});})(map__46788,map__46788__$1,inner,outer,css,attrs__$1,vec__46785,attrs,contents))
).call(null,outer,css,cljs.core.merge),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (map__46788,map__46788__$1,inner,outer,css,attrs__$1,vec__46785,attrs,contents){
return (function (G__46795,G__46793,G__46794){
return G__46793.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"border-width","border-width",-1512605390),"2px",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),G__46794,new cljs.core.Keyword(null,"margin","margin",-995903681),(0),new cljs.core.Keyword(null,"padding","padding",1660304693),(0)], null),G__46795);
});})(map__46788,map__46788__$1,inner,outer,css,attrs__$1,vec__46785,attrs,contents))
).call(null,css,cljs.core.merge,inner),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (map__46788,map__46788__$1,inner,outer,css,attrs__$1,vec__46785,attrs,contents){
return (function (G__46797,G__46798,G__46796){
return G__46796.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"border-width","border-width",-1512605390),"1px",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),G__46797,new cljs.core.Keyword(null,"margin","margin",-995903681),(0)], null),G__46798);
});})(map__46788,map__46788__$1,inner,outer,css,attrs__$1,vec__46785,attrs,contents))
).call(null,outer,css,cljs.core.merge),contents)));
};
var weathergen$ui$triple_border = function (var_args){
var args__29776__auto__ = null;
if (arguments.length > 0) {
var G__46799__i = 0, G__46799__a = new Array(arguments.length -  0);
while (G__46799__i < G__46799__a.length) {G__46799__a[G__46799__i] = arguments[G__46799__i + 0]; ++G__46799__i;}
  args__29776__auto__ = new cljs.core.IndexedSeq(G__46799__a,0,null);
} 
return weathergen$ui$triple_border__delegate.call(this,args__29776__auto__);};
weathergen$ui$triple_border.cljs$lang$maxFixedArity = 0;
weathergen$ui$triple_border.cljs$lang$applyTo = (function (arglist__46800){
var args__29776__auto__ = cljs.core.seq(arglist__46800);
return weathergen$ui$triple_border__delegate(args__29776__auto__);
});
weathergen$ui$triple_border.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$triple_border__delegate;
return weathergen$ui$triple_border;
})()
;
/**
 * Renders a bordered box with a title bar.
 * @param {...*} var_args
 */
weathergen.ui.control_subsection = (function() { 
var weathergen$ui$control_subsection__delegate = function (args__29776__auto__){
var vec__46806 = hoplon.core.parse_args.call(null,args__29776__auto__);
var attributes = cljs.core.nth.call(null,vec__46806,(0),null);
var children = cljs.core.nth.call(null,vec__46806,(1),null);
var map__46809 = attributes;
var map__46809__$1 = ((((!((map__46809 == null)))?((((map__46809.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46809.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46809):map__46809);
var title = cljs.core.get.call(null,map__46809__$1,new cljs.core.Keyword(null,"title","title",636505583));
return hoplon.core.div.call(null,cljs.core.dissoc.call(null,attributes,new cljs.core.Keyword(null,"title","title",636505583)),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"border","border",1444987323),"solid 1px #444",new cljs.core.Keyword(null,"margin","margin",-995903681),"3px",new cljs.core.Keyword(null,"padding-bottom","padding-bottom",-1899795591),"2px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"background","background",-863952629),weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"header-background","header-background",1686840154)),new cljs.core.Keyword(null,"margin","margin",-995903681),"3px",new cljs.core.Keyword(null,"padding","padding",1660304693),"3px",new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),(0),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"90%",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),title),children);
};
var weathergen$ui$control_subsection = function (var_args){
var args__29776__auto__ = null;
if (arguments.length > 0) {
var G__46811__i = 0, G__46811__a = new Array(arguments.length -  0);
while (G__46811__i < G__46811__a.length) {G__46811__a[G__46811__i] = arguments[G__46811__i + 0]; ++G__46811__i;}
  args__29776__auto__ = new cljs.core.IndexedSeq(G__46811__a,0,null);
} 
return weathergen$ui$control_subsection__delegate.call(this,args__29776__auto__);};
weathergen$ui$control_subsection.cljs$lang$maxFixedArity = 0;
weathergen$ui$control_subsection.cljs$lang$applyTo = (function (arglist__46812){
var args__29776__auto__ = cljs.core.seq(arglist__46812);
return weathergen$ui$control_subsection__delegate(args__29776__auto__);
});
weathergen$ui$control_subsection.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$control_subsection__delegate;
return weathergen$ui$control_subsection;
})()
;
weathergen.ui.forecast_section = (function weathergen$ui$forecast_section(p__46815){
var map__46897 = p__46815;
var map__46897__$1 = ((((!((map__46897 == null)))?((((map__46897.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46897.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46897):map__46897);
var opts = map__46897__$1;
var limit_time_QMARK_ = cljs.core.get.call(null,map__46897__$1,new cljs.core.Keyword(null,"limit-time?","limit-time?",-602984376));
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Forecast"),new cljs.core.Keyword(null,"id","id",-1388402092),"forecast-section",hoplon.core.div.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"forecast",hoplon.core.div.call(null,hoplon.core.label.call(null,new cljs.core.Keyword(null,"for","for",-1323786319),"locations","Forecast for:"),(function (){var airbases = javelin.core.formula.call(null,((function (map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (G__46899,G__46902,G__46900,G__46901){
return G__46899.call(null,((function (map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (p1__46813_SHARP_){
return G__46900.call(null,G__46901,p1__46813_SHARP_);
});})(map__46897,map__46897__$1,opts,limit_time_QMARK_))
,G__46902.call(null,G__46901));
});})(map__46897,map__46897__$1,opts,limit_time_QMARK_))
).call(null,cljs.core.sort_by,weathergen.falcon.files.mission.oob_air,weathergen.falcon.files.mission.objective_name,weathergen.ui.mission);
var vec__46905 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (p__46908){
var map__46909 = p__46908;
var map__46909__$1 = ((((!((map__46909 == null)))?((((map__46909.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46909.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46909):map__46909);
var coordinates = cljs.core.get.call(null,map__46909__$1,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668));
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [coordinates], null);
});})(airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.selected_cell));
var coordinates = cljs.core.nth.call(null,vec__46905,(0),null);
var vec__46917 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (p__46920){
var vec__46921 = p__46920;
var x = cljs.core.nth.call(null,vec__46921,(0),null);
var y = cljs.core.nth.call(null,vec__46921,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null);
});})(vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_))
).call(null,coordinates));
var x = cljs.core.nth.call(null,vec__46917,(0),null);
var y = cljs.core.nth.call(null,vec__46917,(1),null);
return hoplon.core.select.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"locations",new cljs.core.Keyword(null,"change","change",-1163046502),((function (vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (p1__46814_SHARP_){
return weathergen.ui.change_location.call(null,cljs.core.deref.call(null,weathergen.ui.mission),cljs.core.nth.call(null,cljs.core.deref.call(null,airbases),weathergen.util.str__GT_long.call(null,cljs.core.deref.call(null,p1__46814_SHARP_))));
});})(vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_))
,hoplon.core.option.call(null,new cljs.core.Keyword(null,"selected","selected",574897764),javelin.core.formula.call(null,((function (vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (G__46925,G__46924){
return G__46924.call(null,new cljs.core.Keyword(null,"named","named",-422393479),G__46925);
});})(vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.location_type,cljs.core.not_EQ_),new cljs.core.Keyword(null,"value","value",305978217),"",javelin.core.formula.call(null,((function (vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (location_type,x__$1,y__$1){
var pred__46926 = cljs.core._EQ_;
var expr__46927 = location_type;
if(cljs.core.truth_(pred__46926.call(null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),expr__46927))){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("Location "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.format_coords.call(null,x__$1,y__$1))].join('');
} else {
if(cljs.core.truth_(pred__46926.call(null,new cljs.core.Keyword(null,"named","named",-422393479),expr__46927))){
return "";
} else {
if(cljs.core.truth_(pred__46926.call(null,new cljs.core.Keyword(null,"none","none",1333468478),expr__46927))){
return "None selected";
} else {
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("No matching clause: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(expr__46927)].join('')));
}
}
}
});})(vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.location_type,x,y)),hoplon.core.loop_tpl_STAR_.call(null,javelin.core.formula.call(null,((function (vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (G__46929,G__46931,G__46930){
return G__46929.call(null,G__46930,G__46931);
});})(vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_))
).call(null,cljs.core.map_indexed,airbases,cljs.core.vector),((function (vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (item__29820__auto__){
var vec__46932 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (indexed){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [indexed], null);
});})(vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_))
).call(null,item__29820__auto__));
var indexed = cljs.core.nth.call(null,vec__46932,(0),null);
var vec__46941 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__46932,indexed,vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (p__46944){
var vec__46945 = p__46944;
var index = cljs.core.nth.call(null,vec__46945,(0),null);
var ab = cljs.core.nth.call(null,vec__46945,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [ab,index], null);
});})(vec__46932,indexed,vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_))
).call(null,indexed));
var ab = cljs.core.nth.call(null,vec__46941,(0),null);
var index = cljs.core.nth.call(null,vec__46941,(1),null);
return hoplon.core.option.call(null,new cljs.core.Keyword(null,"value","value",305978217),index,new cljs.core.Keyword(null,"selected","selected",574897764),javelin.core.formula.call(null,((function (vec__46941,ab,index,vec__46932,indexed,vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (G__46949,G__46948,G__46950){
return G__46948.call(null,G__46949,new cljs.core.Keyword(null,"location","location",1815599388).cljs$core$IFn$_invoke$arity$1(G__46950));
});})(vec__46941,ab,index,vec__46932,indexed,vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_))
).call(null,ab,cljs.core._EQ_,weathergen.ui.selected_cell),javelin.core.formula.call(null,((function (vec__46941,ab,index,vec__46932,indexed,vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (G__46953,G__46951,G__46952){
return G__46951.call(null,G__46952,G__46953);
});})(vec__46941,ab,index,vec__46932,indexed,vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_))
).call(null,ab,weathergen.falcon.files.mission.objective_name,weathergen.ui.mission));
});})(vec__46917,x,y,vec__46905,coordinates,airbases,map__46897,map__46897__$1,opts,limit_time_QMARK_))
));
})(),javelin.core.formula.call(null,((function (map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (pressure_unit,forecast,cloud_params){
var td1 = ((function (map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function() { 
var G__46978__delegate = function (args){
return cljs.core.apply.call(null,hoplon.core.td,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),"3px",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px"], null),args);
};
var G__46978 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__46979__i = 0, G__46979__a = new Array(arguments.length -  0);
while (G__46979__i < G__46979__a.length) {G__46979__a[G__46979__i] = arguments[G__46979__i + 0]; ++G__46979__i;}
  args = new cljs.core.IndexedSeq(G__46979__a,0,null);
} 
return G__46978__delegate.call(this,args);};
G__46978.cljs$lang$maxFixedArity = 0;
G__46978.cljs$lang$applyTo = (function (arglist__46980){
var args = cljs.core.seq(arglist__46980);
return G__46978__delegate(args);
});
G__46978.cljs$core$IFn$_invoke$arity$variadic = G__46978__delegate;
return G__46978;
})()
;})(map__46897,map__46897__$1,opts,limit_time_QMARK_))
;
var td2 = ((function (td1,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function() { 
var G__46981__delegate = function (args){
return cljs.core.apply.call(null,hoplon.core.td,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),"3px",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),args);
};
var G__46981 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__46982__i = 0, G__46982__a = new Array(arguments.length -  0);
while (G__46982__i < G__46982__a.length) {G__46982__a[G__46982__i] = arguments[G__46982__i + 0]; ++G__46982__i;}
  args = new cljs.core.IndexedSeq(G__46982__a,0,null);
} 
return G__46981__delegate.call(this,args);};
G__46981.cljs$lang$maxFixedArity = 0;
G__46981.cljs$lang$applyTo = (function (arglist__46983){
var args = cljs.core.seq(arglist__46983);
return G__46981__delegate(args);
});
G__46981.cljs$core$IFn$_invoke$arity$variadic = G__46981__delegate;
return G__46981;
})()
;})(td1,map__46897,map__46897__$1,opts,limit_time_QMARK_))
;
return hoplon.core.table.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"info-grid",hoplon.core.thead.call(null,hoplon.core.tr.call(null,td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"time","time",1385887882)], null),"Weather Time")),td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"type","type",1174270348)], null),"Type")),td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),"Press")),td2.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"temperature","temperature",899018429)], null),"Temp")),td2.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"wind","wind",-527553074)], null),"Wind")),td2.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"visibility","visibility",1338380893)], null),"Vis")),td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"precipitation","precipitation",485418199)], null),"Precip")),td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"cloud","cloud",-1976521303)], null),"Cloud")))),hoplon.core.tbody.call(null,((cljs.core.not.call(null,forecast))?hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(8),"No location is selected. Choose a location from the list, or click on the weather map to select one.")):(function (){var iter__24200__auto__ = ((function (td1,td2,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function weathergen$ui$forecast_section_$_iter__46954(s__46955){
return (new cljs.core.LazySeq(null,((function (td1,td2,map__46897,map__46897__$1,opts,limit_time_QMARK_){
return (function (){
var s__46955__$1 = s__46955;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__46955__$1);
if(temp__5278__auto__){
var s__46955__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__46955__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__46955__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__46957 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__46956 = (0);
while(true){
if((i__46956 < size__24199__auto__)){
var vec__46968 = cljs.core._nth.call(null,c__24198__auto__,i__46956);
var time = cljs.core.nth.call(null,vec__46968,(0),null);
var weather = cljs.core.nth.call(null,vec__46968,(1),null);
var map__46971 = weather;
var map__46971__$1 = ((((!((map__46971 == null)))?((((map__46971.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46971.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46971):map__46971);
var pressure = cljs.core.get.call(null,map__46971__$1,new cljs.core.Keyword(null,"pressure","pressure",505343747));
var temperature = cljs.core.get.call(null,map__46971__$1,new cljs.core.Keyword(null,"temperature","temperature",899018429));
var wind = cljs.core.get.call(null,map__46971__$1,new cljs.core.Keyword(null,"wind","wind",-527553074));
var type = cljs.core.get.call(null,map__46971__$1,new cljs.core.Keyword(null,"type","type",1174270348));
cljs.core.chunk_append.call(null,b__46957,hoplon.core.tr.call(null,td1.call(null,weathergen.ui.common.format_time.call(null,time)),td1.call(null,weathergen.ui.format_type.call(null,type)),td1.call(null,weathergen.ui.format_pressure.call(null,pressure,pressure_unit)),td2.call(null,weathergen.ui.format_temperature.call(null,temperature)),td1.call(null,weathergen.ui.format_wind.call(null,wind)),td2.call(null,weathergen.ui.format_visibility.call(null,cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),type], null)))),td1.call(null,weathergen.ui.format_precipitation.call(null,temperature,type)),td1.call(null,weathergen.ui.format_cloud.call(null,cloud_params,type))));

var G__46984 = (i__46956 + (1));
i__46956 = G__46984;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46957),weathergen$ui$forecast_section_$_iter__46954.call(null,cljs.core.chunk_rest.call(null,s__46955__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46957),null);
}
} else {
var vec__46973 = cljs.core.first.call(null,s__46955__$2);
var time = cljs.core.nth.call(null,vec__46973,(0),null);
var weather = cljs.core.nth.call(null,vec__46973,(1),null);
var map__46976 = weather;
var map__46976__$1 = ((((!((map__46976 == null)))?((((map__46976.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46976.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46976):map__46976);
var pressure = cljs.core.get.call(null,map__46976__$1,new cljs.core.Keyword(null,"pressure","pressure",505343747));
var temperature = cljs.core.get.call(null,map__46976__$1,new cljs.core.Keyword(null,"temperature","temperature",899018429));
var wind = cljs.core.get.call(null,map__46976__$1,new cljs.core.Keyword(null,"wind","wind",-527553074));
var type = cljs.core.get.call(null,map__46976__$1,new cljs.core.Keyword(null,"type","type",1174270348));
return cljs.core.cons.call(null,hoplon.core.tr.call(null,td1.call(null,weathergen.ui.common.format_time.call(null,time)),td1.call(null,weathergen.ui.format_type.call(null,type)),td1.call(null,weathergen.ui.format_pressure.call(null,pressure,pressure_unit)),td2.call(null,weathergen.ui.format_temperature.call(null,temperature)),td1.call(null,weathergen.ui.format_wind.call(null,wind)),td2.call(null,weathergen.ui.format_visibility.call(null,cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),type], null)))),td1.call(null,weathergen.ui.format_precipitation.call(null,temperature,type)),td1.call(null,weathergen.ui.format_cloud.call(null,cloud_params,type))),weathergen$ui$forecast_section_$_iter__46954.call(null,cljs.core.rest.call(null,s__46955__$2)));
}
} else {
return null;
}
break;
}
});})(td1,td2,map__46897,map__46897__$1,opts,limit_time_QMARK_))
,null,null));
});})(td1,td2,map__46897,map__46897__$1,opts,limit_time_QMARK_))
;
return iter__24200__auto__.call(null,forecast);
})())));
});})(map__46897,map__46897__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.pressure_unit,weathergen.ui.forecast,weathergen.ui.cloud_params))));
});
weathergen.ui.weather_color = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(255),0.25], null),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(255),(0),(1)], null),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(0),(1)], null),new cljs.core.Keyword(null,"inclement","inclement",-550669382),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(192),(0),(0),(1)], null),null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(0),(0),(1)], null)], null);
weathergen.ui.pressure_map = new cljs.core.PersistentArrayMap(null, 7, [28.5,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(192),(0),(0),(1)], null),28.9,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(192),(0),(0),(1)], null),29.3,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(0),(1)], null),29.5,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(255),(0),(1)], null),29.9,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(128),(255),(1)], null),30.2,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(255),(1)], null),31.0,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(255),(1)], null)], null);
weathergen.ui.gradient_color = (function weathergen$ui$gradient_color(color_map,val){
var vec__47004 = cljs.core.first.call(null,cljs.core.filter.call(null,(function (p__47013){
var vec__47014 = p__47013;
var vec__47017 = cljs.core.nth.call(null,vec__47014,(0),null);
var low = cljs.core.nth.call(null,vec__47017,(0),null);
var l = cljs.core.nth.call(null,vec__47017,(1),null);
var vec__47020 = cljs.core.nth.call(null,vec__47014,(1),null);
var high = cljs.core.nth.call(null,vec__47020,(0),null);
var h = cljs.core.nth.call(null,vec__47020,(1),null);
return ((low <= val)) && ((val <= high));
}),cljs.core.partition.call(null,(2),(1),cljs.core.into.call(null,cljs.core.sorted_map.call(null),color_map))));
var vec__47007 = cljs.core.nth.call(null,vec__47004,(0),null);
var low = cljs.core.nth.call(null,vec__47007,(0),null);
var l = cljs.core.nth.call(null,vec__47007,(1),null);
var vec__47010 = cljs.core.nth.call(null,vec__47004,(1),null);
var high = cljs.core.nth.call(null,vec__47010,(0),null);
var h = cljs.core.nth.call(null,vec__47010,(1),null);
return weathergen.math.vector_interpolate.call(null,l,h,val,low,high);
});
weathergen.ui.pressure_color = (function weathergen$ui$pressure_color(pressure){
var vec__47026 = weathergen.ui.gradient_color.call(null,weathergen.ui.pressure_map,pressure);
var r = cljs.core.nth.call(null,vec__47026,(0),null);
var g = cljs.core.nth.call(null,vec__47026,(1),null);
var b = cljs.core.nth.call(null,vec__47026,(2),null);
var a = cljs.core.nth.call(null,vec__47026,(3),null);
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.long$.call(null,r),cljs.core.long$.call(null,g),cljs.core.long$.call(null,b),a], null);
});
weathergen.ui.temp_map = new cljs.core.PersistentArrayMap(null, 3, [(0),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(0),(255),(1)], null),(20),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(255),(0),(1)], null),(40),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(0),(0),(1)], null)], null);
weathergen.ui.temperature_color = (function weathergen$ui$temperature_color(temp){
var vec__47032 = weathergen.ui.gradient_color.call(null,weathergen.ui.temp_map,temp);
var r = cljs.core.nth.call(null,vec__47032,(0),null);
var g = cljs.core.nth.call(null,vec__47032,(1),null);
var b = cljs.core.nth.call(null,vec__47032,(2),null);
var a = cljs.core.nth.call(null,vec__47032,(3),null);
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.long$.call(null,r),cljs.core.long$.call(null,g),cljs.core.long$.call(null,b),a], null);
});
weathergen.ui.transparent = new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(0),(0),(1)], null);
weathergen.ui.fill_color = (function weathergen$ui$fill_color(display,w){
var pred__47038 = cljs.core._EQ_;
var expr__47039 = display;
if(cljs.core.truth_(pred__47038.call(null,new cljs.core.Keyword(null,"type","type",1174270348),expr__47039))){
return weathergen.ui.weather_color.call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(w));
} else {
if(cljs.core.truth_(pred__47038.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747),expr__47039))){
return weathergen.ui.pressure_color.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747).cljs$core$IFn$_invoke$arity$1(w));
} else {
if(cljs.core.truth_(pred__47038.call(null,new cljs.core.Keyword(null,"temperature","temperature",899018429),expr__47039))){
return weathergen.ui.temperature_color.call(null,new cljs.core.Keyword(null,"temperature","temperature",899018429).cljs$core$IFn$_invoke$arity$1(w));
} else {
return weathergen.ui.transparent;
}
}
}
});
/**
 * Return a pressure in inches Mercury given a value and a unit
 */
weathergen.ui.convert_pressure = (function weathergen$ui$convert_pressure(val,unit){
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"inhg","inhg",-863180091),unit)){
return val;
} else {
return weathergen.ui.mbar__GT_inhg.call(null,val);
}
});
weathergen.ui.max_wind_vector_speed = (150);
weathergen.ui.wind_vector_id = (function weathergen$ui$wind_vector_id(speed){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("wind-vector-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.math.clamp.call(null,(5),weathergen.ui.max_wind_vector_speed,weathergen.math.nearest.call(null,speed,(5))))].join('');
});
weathergen.ui.update_wind_layer = (function weathergen$ui$update_wind_layer(weather_data,display_params){
var timer_name__15521__auto__ = "update-wind-layer";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){var seq__47063 = cljs.core.seq.call(null,weather_data);
var chunk__47065 = null;
var count__47066 = (0);
var i__47067 = (0);
while(true){
if((i__47067 < count__47066)){
var vec__47069 = cljs.core._nth.call(null,chunk__47065,i__47067);
var vec__47072 = cljs.core.nth.call(null,vec__47069,(0),null);
var x = cljs.core.nth.call(null,vec__47072,(0),null);
var y = cljs.core.nth.call(null,vec__47072,(1),null);
var weather = cljs.core.nth.call(null,vec__47069,(1),null);
var map__47075_47085 = new cljs.core.Keyword(null,"wind","wind",-527553074).cljs$core$IFn$_invoke$arity$1(weather);
var map__47075_47086__$1 = ((((!((map__47075_47085 == null)))?((((map__47075_47085.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47075_47085.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47075_47085):map__47075_47085);
var speed_47087 = cljs.core.get.call(null,map__47075_47086__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading_47088 = cljs.core.get.call(null,map__47075_47086__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
var cell_47089 = goog.dom.getElement([cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_47089.setAttribute("transform",weathergen.ui.common.svg_rotate.call(null,heading_47088));

cell_47089.setAttributeNS("http://www.w3.org/1999/xlink","href",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("#"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.wind_vector_id.call(null,speed_47087))].join(''));

var G__47090 = seq__47063;
var G__47091 = chunk__47065;
var G__47092 = count__47066;
var G__47093 = (i__47067 + (1));
seq__47063 = G__47090;
chunk__47065 = G__47091;
count__47066 = G__47092;
i__47067 = G__47093;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__47063);
if(temp__5278__auto__){
var seq__47063__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47063__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__47063__$1);
var G__47094 = cljs.core.chunk_rest.call(null,seq__47063__$1);
var G__47095 = c__24249__auto__;
var G__47096 = cljs.core.count.call(null,c__24249__auto__);
var G__47097 = (0);
seq__47063 = G__47094;
chunk__47065 = G__47095;
count__47066 = G__47096;
i__47067 = G__47097;
continue;
} else {
var vec__47077 = cljs.core.first.call(null,seq__47063__$1);
var vec__47080 = cljs.core.nth.call(null,vec__47077,(0),null);
var x = cljs.core.nth.call(null,vec__47080,(0),null);
var y = cljs.core.nth.call(null,vec__47080,(1),null);
var weather = cljs.core.nth.call(null,vec__47077,(1),null);
var map__47083_47098 = new cljs.core.Keyword(null,"wind","wind",-527553074).cljs$core$IFn$_invoke$arity$1(weather);
var map__47083_47099__$1 = ((((!((map__47083_47098 == null)))?((((map__47083_47098.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47083_47098.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47083_47098):map__47083_47098);
var speed_47100 = cljs.core.get.call(null,map__47083_47099__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading_47101 = cljs.core.get.call(null,map__47083_47099__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
var cell_47102 = goog.dom.getElement([cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_47102.setAttribute("transform",weathergen.ui.common.svg_rotate.call(null,heading_47101));

cell_47102.setAttributeNS("http://www.w3.org/1999/xlink","href",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("#"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.wind_vector_id.call(null,speed_47100))].join(''));

var G__47103 = cljs.core.next.call(null,seq__47063__$1);
var G__47104 = null;
var G__47105 = (0);
var G__47106 = (0);
seq__47063 = G__47103;
chunk__47065 = G__47104;
count__47066 = G__47105;
i__47067 = G__47106;
continue;
}
} else {
return null;
}
}
break;
}
})();
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
if(typeof weathergen.ui.overlay_text !== 'undefined'){
} else {
weathergen.ui.overlay_text = (function (){var method_table__24369__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__24370__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__24371__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__24372__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__24373__auto__ = cljs.core.get.call(null,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"weathergen.ui","overlay-text"),((function (method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__){
return (function (weather,display_params){
return new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(display_params);
});})(method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__))
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__24373__auto__,method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__));
})();
}
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"default","default",-1987822328),(function (_,___$1){
return "";
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"pressure","pressure",505343747),(function (weather,display_params){
return weathergen.ui.format_pressure.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747).cljs$core$IFn$_invoke$arity$1(weather),new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243).cljs$core$IFn$_invoke$arity$1(display_params));
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"temperature","temperature",899018429),(function (weather,_){
return (function (){var G__47107 = new cljs.core.Keyword(null,"temperature","temperature",899018429).cljs$core$IFn$_invoke$arity$1(weather);
return G__47107;
})().toFixed((1));
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"type","type",1174270348),(function (weather,_){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),"S",new cljs.core.Keyword(null,"fair","fair",1684139423),"F",new cljs.core.Keyword(null,"poor","poor",1462482211),"P",new cljs.core.Keyword(null,"inclement","inclement",-550669382),"I"], null).call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(weather));
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"coords","coords",-599429112),(function (weather,overlay){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(weather)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(weather))].join('');
}));
weathergen.ui.update_text_layer = (function weathergen$ui$update_text_layer(weather_data,display_params){
var timer_name__15521__auto__ = "update-text-layer";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){var seq__47126 = cljs.core.seq.call(null,weather_data);
var chunk__47128 = null;
var count__47129 = (0);
var i__47130 = (0);
while(true){
if((i__47130 < count__47129)){
var vec__47132 = cljs.core._nth.call(null,chunk__47128,i__47130);
var vec__47135 = cljs.core.nth.call(null,vec__47132,(0),null);
var x = cljs.core.nth.call(null,vec__47135,(0),null);
var y = cljs.core.nth.call(null,vec__47135,(1),null);
var weather = cljs.core.nth.call(null,vec__47132,(1),null);
var text_47144 = weathergen.ui.overlay_text.call(null,weather,display_params);
var cell_47145 = goog.dom.getElement([cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-text-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_47145.innerHTML = text_47144;

var G__47146 = seq__47126;
var G__47147 = chunk__47128;
var G__47148 = count__47129;
var G__47149 = (i__47130 + (1));
seq__47126 = G__47146;
chunk__47128 = G__47147;
count__47129 = G__47148;
i__47130 = G__47149;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__47126);
if(temp__5278__auto__){
var seq__47126__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47126__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__47126__$1);
var G__47150 = cljs.core.chunk_rest.call(null,seq__47126__$1);
var G__47151 = c__24249__auto__;
var G__47152 = cljs.core.count.call(null,c__24249__auto__);
var G__47153 = (0);
seq__47126 = G__47150;
chunk__47128 = G__47151;
count__47129 = G__47152;
i__47130 = G__47153;
continue;
} else {
var vec__47138 = cljs.core.first.call(null,seq__47126__$1);
var vec__47141 = cljs.core.nth.call(null,vec__47138,(0),null);
var x = cljs.core.nth.call(null,vec__47141,(0),null);
var y = cljs.core.nth.call(null,vec__47141,(1),null);
var weather = cljs.core.nth.call(null,vec__47138,(1),null);
var text_47154 = weathergen.ui.overlay_text.call(null,weather,display_params);
var cell_47155 = goog.dom.getElement([cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-text-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_47155.innerHTML = text_47154;

var G__47156 = cljs.core.next.call(null,seq__47126__$1);
var G__47157 = null;
var G__47158 = (0);
var G__47159 = (0);
seq__47126 = G__47156;
chunk__47128 = G__47157;
count__47129 = G__47158;
i__47130 = G__47159;
continue;
}
} else {
return null;
}
}
break;
}
})();
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
weathergen.ui.update_overlay = (function weathergen$ui$update_overlay(weather_data,display_params){
var timer_name__15521__auto__ = "update-overlay";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){var pred__47163 = cljs.core.contains_QMARK_;
var expr__47164 = new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(display_params);
if(cljs.core.truth_(pred__47163.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"wind","wind",-527553074),null], null), null),expr__47164))){
return weathergen.ui.update_wind_layer.call(null,weather_data,display_params);
} else {
if(cljs.core.truth_(pred__47163.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"pressure","pressure",505343747),null,new cljs.core.Keyword(null,"type","type",1174270348),null,new cljs.core.Keyword(null,"temperature","temperature",899018429),null], null), null),expr__47164))){
return weathergen.ui.update_text_layer.call(null,weather_data,display_params);
} else {
return null;
}
}
})();
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
weathergen.ui.update_primary_layer = (function weathergen$ui$update_primary_layer(weather_data,display_params){
var timer_name__15521__auto__ = "update-primary-layer";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){var seq__47190 = cljs.core.seq.call(null,weather_data);
var chunk__47192 = null;
var count__47193 = (0);
var i__47194 = (0);
while(true){
if((i__47194 < count__47193)){
var vec__47196 = cljs.core._nth.call(null,chunk__47192,i__47194);
var vec__47199 = cljs.core.nth.call(null,vec__47196,(0),null);
var x = cljs.core.nth.call(null,vec__47199,(0),null);
var y = cljs.core.nth.call(null,vec__47199,(1),null);
var weather = cljs.core.nth.call(null,vec__47196,(1),null);
var vec__47202_47214 = weathergen.ui.fill_color.call(null,new cljs.core.Keyword(null,"display","display",242065432).cljs$core$IFn$_invoke$arity$1(display_params),weather);
var r_47215 = cljs.core.nth.call(null,vec__47202_47214,(0),null);
var g_47216 = cljs.core.nth.call(null,vec__47202_47214,(1),null);
var b_47217 = cljs.core.nth.call(null,vec__47202_47214,(2),null);
var a_47218 = cljs.core.nth.call(null,vec__47202_47214,(3),null);
var cell_47219 = goog.dom.getElement([cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
if(cljs.core.truth_(cell_47219)){
cell_47219.setAttribute("fill",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgba("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r_47215),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g_47216),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b_47217),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(a_47218),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join(''));
} else {
}

var G__47220 = seq__47190;
var G__47221 = chunk__47192;
var G__47222 = count__47193;
var G__47223 = (i__47194 + (1));
seq__47190 = G__47220;
chunk__47192 = G__47221;
count__47193 = G__47222;
i__47194 = G__47223;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__47190);
if(temp__5278__auto__){
var seq__47190__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47190__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__47190__$1);
var G__47224 = cljs.core.chunk_rest.call(null,seq__47190__$1);
var G__47225 = c__24249__auto__;
var G__47226 = cljs.core.count.call(null,c__24249__auto__);
var G__47227 = (0);
seq__47190 = G__47224;
chunk__47192 = G__47225;
count__47193 = G__47226;
i__47194 = G__47227;
continue;
} else {
var vec__47205 = cljs.core.first.call(null,seq__47190__$1);
var vec__47208 = cljs.core.nth.call(null,vec__47205,(0),null);
var x = cljs.core.nth.call(null,vec__47208,(0),null);
var y = cljs.core.nth.call(null,vec__47208,(1),null);
var weather = cljs.core.nth.call(null,vec__47205,(1),null);
var vec__47211_47228 = weathergen.ui.fill_color.call(null,new cljs.core.Keyword(null,"display","display",242065432).cljs$core$IFn$_invoke$arity$1(display_params),weather);
var r_47229 = cljs.core.nth.call(null,vec__47211_47228,(0),null);
var g_47230 = cljs.core.nth.call(null,vec__47211_47228,(1),null);
var b_47231 = cljs.core.nth.call(null,vec__47211_47228,(2),null);
var a_47232 = cljs.core.nth.call(null,vec__47211_47228,(3),null);
var cell_47233 = goog.dom.getElement([cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
if(cljs.core.truth_(cell_47233)){
cell_47233.setAttribute("fill",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgba("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r_47229),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g_47230),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b_47231),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(a_47232),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join(''));
} else {
}

var G__47234 = cljs.core.next.call(null,seq__47190__$1);
var G__47235 = null;
var G__47236 = (0);
var G__47237 = (0);
seq__47190 = G__47234;
chunk__47192 = G__47235;
count__47193 = G__47236;
i__47194 = G__47237;
continue;
}
} else {
return null;
}
}
break;
}
})();
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
weathergen.ui.update_grid_data = (function weathergen$ui$update_grid_data(weather_data,display_params){
var timer_name__15521__auto__ = "update-grid-data";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){
weathergen.ui.update_primary_layer.call(null,weather_data,display_params);

return weathergen.ui.update_overlay.call(null,weather_data,display_params);
})()
;
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
weathergen.ui.update_grid = (function weathergen$ui$update_grid(weather_data,display_params){
var timer_name__15521__auto__ = "update-grid";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = weathergen.ui.update_grid_data.call(null,weather_data,display_params);
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
weathergen.ui.wind_vector_defs = (function weathergen$ui$wind_vector_defs(){
return hoplon.svg.defs.call(null,(function (){var iter__24200__auto__ = (function weathergen$ui$wind_vector_defs_$_iter__47242(s__47243){
return (new cljs.core.LazySeq(null,(function (){
var s__47243__$1 = s__47243;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__47243__$1);
if(temp__5278__auto__){
var s__47243__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__47243__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__47243__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__47245 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__47244 = (0);
while(true){
if((i__47244 < size__24199__auto__)){
var speed = cljs.core._nth.call(null,c__24198__auto__,i__47244);
cljs.core.chunk_append.call(null,b__47245,hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),weathergen.ui.wind_vector_id.call(null,speed),weathergen.wind.barb.call(null,speed)));

var G__47246 = (i__47244 + (1));
i__47244 = G__47246;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47245),weathergen$ui$wind_vector_defs_$_iter__47242.call(null,cljs.core.chunk_rest.call(null,s__47243__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47245),null);
}
} else {
var speed = cljs.core.first.call(null,s__47243__$2);
return cljs.core.cons.call(null,hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),weathergen.ui.wind_vector_id.call(null,speed),weathergen.wind.barb.call(null,speed)),weathergen$ui$wind_vector_defs_$_iter__47242.call(null,cljs.core.rest.call(null,s__47243__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24200__auto__.call(null,cljs.core.range.call(null,(5),(weathergen.ui.max_wind_vector_speed + (1)),(5)));
})());
});
weathergen.ui.bullseye_info_box = (function weathergen$ui$bullseye_info_box(){
var watched = javelin.core.formula.call(null,(function (mouse_location,map_zoom){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [mouse_location,map_zoom], null);
})).call(null,weathergen.ui.mouse_location,weathergen.ui.map_zoom);
var x = javelin.core.cell.call(null,(0));
var y = javelin.core.cell.call(null,(0));
var w = javelin.core.cell.call(null,(0));
var h = javelin.core.cell.call(null,(0));
var t = hoplon.svg.text.call(null,new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"3.5%",new cljs.core.Keyword(null,"font-family","font-family",-667419874),"Source Code Pro",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),(100),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.03,new cljs.core.Keyword(null,"fill","fill",883462889),"black",hoplon.svg.tspan.call(null,javelin.core.formula.call(null,((function (x,y,w,h,watched){
return (function (G__47266,G__47267,G__47265,G__47268){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var G__47264 = G__47265;
var G__47264__$1 = (cljs.core.truth_((G__47264 == null))?null:G__47266.call(null,G__47267,G__47264));
if(cljs.core.truth_((G__47264__$1 == null))){
return null;
} else {
return G__47268.call(null,G__47264__$1);
}
})())].join('');
});})(x,y,w,h,watched))
).call(null,weathergen.coordinates.weather__GT_bullseye,weathergen.ui.mission,weathergen.ui.mouse_location,weathergen.ui.format_bullseye)));
var update_bbox__15569__auto__ = ((function (x,y,w,h,t,watched){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (x,y,w,h,t,watched){
return (function (){
var bb__15570__auto__ = t.getBBox();
if(cljs.core.truth_(bb__15570__auto__.x)){
cljs.core.reset_BANG_.call(null,x,bb__15570__auto__.x);

cljs.core.reset_BANG_.call(null,y,bb__15570__auto__.y);

cljs.core.reset_BANG_.call(null,w,bb__15570__auto__.width);

return cljs.core.reset_BANG_.call(null,h,bb__15570__auto__.height);
} else {
return null;
}
});})(x,y,w,h,t,watched))
);
});})(x,y,w,h,t,watched))
;
hoplon.core.when_dom.call(null,t,update_bbox__15569__auto__);

var temp__5278__auto___47281 = watched;
if(cljs.core.truth_(temp__5278__auto___47281)){
var w__15571__auto___47282 = temp__5278__auto___47281;
cljs.core.add_watch.call(null,w__15571__auto___47282,cljs.core.keyword.call(null,cljs.core.gensym.call(null)),((function (w__15571__auto___47282,temp__5278__auto___47281,x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (_,___$1,___$2,___$3){
return setTimeout(((function (w__15571__auto___47282,temp__5278__auto___47281,x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (){
return update_bbox__15569__auto__.call(null);
});})(w__15571__auto___47282,temp__5278__auto___47281,x,y,w,h,t,update_bbox__15569__auto__,watched))
,(0));
});})(w__15571__auto___47282,temp__5278__auto___47281,x,y,w,h,t,update_bbox__15569__auto__,watched))
);
} else {
}

return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"bullseye-info-box",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (G__47269){
return cljs.core.not.call(null,(G__47269 == null));
});})(x,y,w,h,t,update_bbox__15569__auto__,watched))
).call(null,weathergen.ui.mouse_location),new cljs.core.Keyword("svg","transform","svg/transform",1381351328),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (mouse_location,map_zoom,map_size){
var map__47270 = mouse_location;
var map__47270__$1 = ((((!((map__47270 == null)))?((((map__47270.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47270.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47270):map__47270);
var x__$1 = cljs.core.get.call(null,map__47270__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y__$1 = cljs.core.get.call(null,map__47270__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var vec__47271 = map_size;
var width = cljs.core.nth.call(null,vec__47271,(0),null);
var height = cljs.core.nth.call(null,vec__47271,(1),null);
return weathergen.ui.common.svg_translate.call(null,(x__$1 + ((1000.0 / width) / map_zoom)),(y__$1 + ((1250.0 / height) / map_zoom)));
});})(x,y,w,h,t,update_bbox__15569__auto__,watched))
).call(null,weathergen.ui.mouse_location,weathergen.ui.map_zoom,weathergen.ui.map_size),hoplon.svg.g.call(null,new cljs.core.Keyword("svg","transform","svg/transform",1381351328),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (G__47275,G__47277,G__47276){
return G__47275.call(null,(G__47276 / G__47277));
});})(x,y,w,h,t,update_bbox__15569__auto__,watched))
).call(null,weathergen.ui.common.svg_scale,weathergen.ui.map_zoom,weathergen.ui.map_text_scale),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (G__47278){
return (G__47278 * -0.05);
});})(x,y,w,h,t,update_bbox__15569__auto__,watched))
).call(null,w),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (G__47279){
return (- (0.8 * G__47279));
});})(x,y,w,h,t,update_bbox__15569__auto__,watched))
).call(null,h),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (G__47280){
return (G__47280 * 1.1);
});})(x,y,w,h,t,update_bbox__15569__auto__,watched))
).call(null,w),new cljs.core.Keyword(null,"height","height",1025178622),h,new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"opacity","opacity",397153780),0.8),t));
});
weathergen.ui.info_overlay = (function weathergen$ui$info_overlay(hover_cell,weather_data,pressure_unit,nx,ny,cloud_params){
var map__47318 = hover_cell;
var map__47318__$1 = ((((!((map__47318 == null)))?((((map__47318.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47318.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47318):map__47318);
var x = cljs.core.get.call(null,map__47318__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__47318__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
if(cljs.core.not.call(null,(function (){var and__23326__auto__ = x;
if(cljs.core.truth_(and__23326__auto__)){
var and__23326__auto____$1 = y;
if(cljs.core.truth_(and__23326__auto____$1)){
return ((((0) <= x)) && ((x <= (nx - (1))))) && ((((0) <= y)) && ((y <= (ny - (1)))));
} else {
return and__23326__auto____$1;
}
} else {
return and__23326__auto__;
}
})())){
return cljs.core.PersistentVector.EMPTY;
} else {
var width = (13);
var height = (8);
var map__47320 = cljs.core.get.call(null,weather_data,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));
var map__47320__$1 = ((((!((map__47320 == null)))?((((map__47320.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47320.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47320):map__47320);
var pressure = cljs.core.get.call(null,map__47320__$1,new cljs.core.Keyword(null,"pressure","pressure",505343747));
var temperature = cljs.core.get.call(null,map__47320__$1,new cljs.core.Keyword(null,"temperature","temperature",899018429));
var wind = cljs.core.get.call(null,map__47320__$1,new cljs.core.Keyword(null,"wind","wind",-527553074));
var type = cljs.core.get.call(null,map__47320__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var map__47321 = wind;
var map__47321__$1 = ((((!((map__47321 == null)))?((((map__47321.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47321.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47321):map__47321);
var speed = cljs.core.get.call(null,map__47321__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading = cljs.core.get.call(null,map__47321__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"fill","fill",883462889),"black",new cljs.core.Keyword(null,"opacity","opacity",397153780),"0.5",new cljs.core.Keyword(null,"pointer-events","pointer-events",-1053858853),"none"], null),new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),(1),new cljs.core.Keyword(null,"height","height",1025178622),(1)),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"info-overlay",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (width,height,map__47320,map__47320__$1,pressure,temperature,wind,type,map__47321,map__47321__$1,speed,heading,map__47318,map__47318__$1,x,y){
return (function (G__47324){
return cljs.core.not.call(null,(G__47324 == null));
});})(width,height,map__47320,map__47320__$1,pressure,temperature,wind,type,map__47321,map__47321__$1,speed,heading,map__47318,map__47318__$1,x,y))
).call(null,hover_cell),new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_translate.call(null,(((x < (nx - width)))?(x + (1)):(x - width)),(((y < (nx - height)))?(y + (1)):(y - height)))], null),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"opacity","opacity",397153780),"0.85",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1px"], null),new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"6%"], null),(function (){var cloud_descriptions = weathergen.ui.cloud_descriptions.call(null,cloud_params,type);
var iter__24200__auto__ = ((function (cloud_descriptions,width,height,map__47320,map__47320__$1,pressure,temperature,wind,type,map__47321,map__47321__$1,speed,heading,map__47318,map__47318__$1,x,y){
return (function weathergen$ui$info_overlay_$_iter__47325(s__47326){
return (new cljs.core.LazySeq(null,((function (cloud_descriptions,width,height,map__47320,map__47320__$1,pressure,temperature,wind,type,map__47321,map__47321__$1,speed,heading,map__47318,map__47318__$1,x,y){
return (function (){
var s__47326__$1 = s__47326;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__47326__$1);
if(temp__5278__auto__){
var s__47326__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__47326__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__47326__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__47328 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__47327 = (0);
while(true){
if((i__47327 < size__24199__auto__)){
var vec__47341 = cljs.core._nth.call(null,c__24198__auto__,i__47327);
var line = cljs.core.nth.call(null,vec__47341,(0),null);
var vec__47344 = cljs.core.nth.call(null,vec__47341,(1),null);
var label = cljs.core.nth.call(null,vec__47344,(0),null);
var value = cljs.core.nth.call(null,vec__47344,(1),null);
cljs.core.chunk_append.call(null,b__47328,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.svg.text.call(null,new cljs.core.Keyword(null,"x","x",2099068185),0.2,new cljs.core.Keyword(null,"y","y",-1757859776),(line + 1.2),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(label),cljs.core.str.cljs$core$IFn$_invoke$arity$1(":")].join('')),hoplon.svg.text.call(null,new cljs.core.Keyword(null,"x","x",2099068185),(4),new cljs.core.Keyword(null,"y","y",-1757859776),(line + 1.2),value)], null));

var G__47353 = (i__47327 + (1));
i__47327 = G__47353;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47328),weathergen$ui$info_overlay_$_iter__47325.call(null,cljs.core.chunk_rest.call(null,s__47326__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47328),null);
}
} else {
var vec__47347 = cljs.core.first.call(null,s__47326__$2);
var line = cljs.core.nth.call(null,vec__47347,(0),null);
var vec__47350 = cljs.core.nth.call(null,vec__47347,(1),null);
var label = cljs.core.nth.call(null,vec__47350,(0),null);
var value = cljs.core.nth.call(null,vec__47350,(1),null);
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.svg.text.call(null,new cljs.core.Keyword(null,"x","x",2099068185),0.2,new cljs.core.Keyword(null,"y","y",-1757859776),(line + 1.2),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(label),cljs.core.str.cljs$core$IFn$_invoke$arity$1(":")].join('')),hoplon.svg.text.call(null,new cljs.core.Keyword(null,"x","x",2099068185),(4),new cljs.core.Keyword(null,"y","y",-1757859776),(line + 1.2),value)], null),weathergen$ui$info_overlay_$_iter__47325.call(null,cljs.core.rest.call(null,s__47326__$2)));
}
} else {
return null;
}
break;
}
});})(cloud_descriptions,width,height,map__47320,map__47320__$1,pressure,temperature,wind,type,map__47321,map__47321__$1,speed,heading,map__47318,map__47318__$1,x,y))
,null,null));
});})(cloud_descriptions,width,height,map__47320,map__47320__$1,pressure,temperature,wind,type,map__47321,map__47321__$1,speed,heading,map__47318,map__47318__$1,x,y))
;
return iter__24200__auto__.call(null,cljs.core.map_indexed.call(null,cljs.core.vector,new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Location",weathergen.ui.format_coords.call(null,x,y)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Pressure",weathergen.ui.format_pressure.call(null,pressure,pressure_unit)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Temp",weathergen.ui.format_temperature.call(null,temperature)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Wind",weathergen.ui.format_wind.call(null,wind)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Vis",weathergen.ui.format_visibility.call(null,cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),type], null)))], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Precip",weathergen.ui.format_precipitation.call(null,temperature,type)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Cloud",weathergen.ui.format_cloud.call(null,cloud_params,type)], null)], null)));
})()))], null);
}
});
/**
 * Returns a `bounds` with its west edge adjusted by `dx` units from
 *   `starting-bounds`.
 */
weathergen.ui.adjust_west = (function weathergen$ui$adjust_west(bounds,starting_bounds,dx){
return cljs.core.assoc.call(null,cljs.core.assoc.call(null,bounds,new cljs.core.Keyword(null,"x","x",2099068185),(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dx)),new cljs.core.Keyword(null,"width","width",-384071477),(new cljs.core.Keyword(null,"width","width",-384071477).cljs$core$IFn$_invoke$arity$1(starting_bounds) - dx));
});
/**
 * Returns a `bounds` with its east edge adjusted by `dx` units from
 *   `starting-bounds`.
 */
weathergen.ui.adjust_east = (function weathergen$ui$adjust_east(bounds,starting_bounds,dx){
return cljs.core.assoc.call(null,bounds,new cljs.core.Keyword(null,"width","width",-384071477),(new cljs.core.Keyword(null,"width","width",-384071477).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dx));
});
/**
 * Returns a `bounds` with its north edge adjusted by `dy` units from
 *   `starting-bounds`.
 */
weathergen.ui.adjust_north = (function weathergen$ui$adjust_north(bounds,starting_bounds,dy){
return cljs.core.assoc.call(null,cljs.core.assoc.call(null,bounds,new cljs.core.Keyword(null,"y","y",-1757859776),(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dy)),new cljs.core.Keyword(null,"height","height",1025178622),(new cljs.core.Keyword(null,"height","height",1025178622).cljs$core$IFn$_invoke$arity$1(starting_bounds) - dy));
});
/**
 * Returns a `bounds` with its south edge adjusted by `dy` units from
 *   `starting-bounds`.
 */
weathergen.ui.adjust_south = (function weathergen$ui$adjust_south(bounds,starting_bounds,dy){
return cljs.core.assoc.call(null,bounds,new cljs.core.Keyword(null,"height","height",1025178622),(new cljs.core.Keyword(null,"height","height",1025178622).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dy));
});
/**
 * Given `proposed` bounds, limit it to falling completely within
 *   an `nx` by `ny` rectangle. Otherwise return nil.
 */
weathergen.ui.restrict = (function weathergen$ui$restrict(nx,ny,proposed){
var map__47356 = proposed;
var map__47356__$1 = ((((!((map__47356 == null)))?((((map__47356.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47356.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47356):map__47356);
var x = cljs.core.get.call(null,map__47356__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__47356__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__47356__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__47356__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var right = (x + width);
var bottom = (y + height);
if((((0) <= x)) && (((0) <= y)) && ((right <= nx)) && ((bottom <= ny)) && ((width > (0))) && ((height > (0)))){
return proposed;
} else {
return null;
}
});
weathergen.ui.wind_stability_overlay = (function weathergen$ui$wind_stability_overlay(weather_params,register_drag_handler){
var indexed = javelin.core.formula.call(null,(function (G__47753,G__47751,G__47752){
return G__47751.call(null,G__47752,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204).cljs$core$IFn$_invoke$arity$1(G__47753));
})).call(null,weather_params,cljs.core.map_indexed,cljs.core.vector);
var vec__47748 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weather_params));
var nx = cljs.core.nth.call(null,vec__47748,(0),null);
var ny = cljs.core.nth.call(null,vec__47748,(1),null);
return javelin.core.formula.call(null,((function (indexed,vec__47748,nx,ny){
return (function (indexed__$1){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"wind-stability-overlay",(function (){var iter__24200__auto__ = ((function (indexed,vec__47748,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__47754(s__47755){
return (new cljs.core.LazySeq(null,((function (indexed,vec__47748,nx,ny){
return (function (){
var s__47755__$1 = s__47755;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__47755__$1);
if(temp__5278__auto__){
var s__47755__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__47755__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__47755__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__47757 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__47756 = (0);
while(true){
if((i__47756 < size__24199__auto__)){
var vec__47948 = cljs.core._nth.call(null,c__24198__auto__,i__47756);
var index = cljs.core.nth.call(null,vec__47948,(0),null);
var area = cljs.core.nth.call(null,vec__47948,(1),null);
cljs.core.chunk_append.call(null,b__47757,(function (){var map__47951 = area;
var map__47951__$1 = ((((!((map__47951 == null)))?((((map__47951.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47951.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47951):map__47951);
var bounds = cljs.core.get.call(null,map__47951__$1,new cljs.core.Keyword(null,"bounds","bounds",1691609455));
var editing_QMARK_ = cljs.core.get.call(null,map__47951__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__47952 = bounds;
var map__47952__$1 = ((((!((map__47952 == null)))?((((map__47952.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47952.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47952):map__47952);
var x = cljs.core.get.call(null,map__47952__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__47952__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__47952__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__47952__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var mousedown = ((function (i__47756,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting_bounds = bounds;
return ((function (i__47756,starting_bounds,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (p__47955,final_QMARK_){
var vec__47956 = p__47955;
var dx = cljs.core.nth.call(null,vec__47956,(0),null);
var dy = cljs.core.nth.call(null,vec__47956,(1),null);
var dx__$1 = cljs.core.long$.call(null,dx);
var dy__$1 = cljs.core.long$.call(null,dy);
return javelin.core.dosync_STAR_.call(null,((function (i__47756,dx__$1,dy__$1,vec__47956,dx,dy,starting_bounds,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),index,new cljs.core.Keyword(null,"bounds","bounds",1691609455)], null),((function (i__47756,dx__$1,dy__$1,vec__47956,dx,dy,starting_bounds,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (bounds__$1){
return cljs.core.assoc.call(null,bounds__$1,new cljs.core.Keyword(null,"x","x",2099068185),weathergen.math.clamp.call(null,(0),(nx - new cljs.core.Keyword(null,"width","width",-384071477).cljs$core$IFn$_invoke$arity$1(bounds__$1)),(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dx__$1)),new cljs.core.Keyword(null,"y","y",-1757859776),weathergen.math.clamp.call(null,(0),(ny - new cljs.core.Keyword(null,"height","height",1025178622).cljs$core$IFn$_invoke$arity$1(bounds__$1)),(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dy__$1)));
});})(i__47756,dx__$1,dy__$1,vec__47956,dx,dy,starting_bounds,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__47756,dx__$1,dy__$1,vec__47956,dx,dy,starting_bounds,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
);
});
;})(i__47756,starting_bounds,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
})());
});})(i__47756,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
;
return (new cljs.core.PersistentVector(null,4,(5),cljs.core.PersistentVector.EMPTY_NODE,[hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"fill","fill",883462889),(cljs.core.truth_(editing_QMARK_)?weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166)):"none"),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),mousedown,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),(cljs.core.truth_(editing_QMARK_)?"move":null),new cljs.core.Keyword(null,"border-width","border-width",-1512605390),(0)], null),new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.2,new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.6 0.6",new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"white",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.2,new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.6 0.6",new cljs.core.Keyword(null,"stroke-dashoffset","stroke-dashoffset",-782320340),0.6,new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),((cljs.core.not.call(null,editing_QMARK_))?cljs.core.PersistentVector.EMPTY:(function (){var iter__24200__auto__ = ((function (i__47756,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__47754_$_iter__47959(s__47960){
return (new cljs.core.LazySeq(null,((function (i__47756,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (){
var s__47960__$1 = s__47960;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__47960__$1);
if(temp__5278__auto____$1){
var xs__5831__auto__ = temp__5278__auto____$1;
var vec__48004 = cljs.core.first.call(null,xs__5831__auto__);
var dx = cljs.core.nth.call(null,vec__48004,(0),null);
var dir_h = cljs.core.nth.call(null,vec__48004,(1),null);
var iterys__24196__auto__ = ((function (s__47960__$1,i__47756,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__47754_$_iter__47959_$_iter__47961(s__47962){
return (new cljs.core.LazySeq(null,((function (s__47960__$1,i__47756,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (){
var s__47962__$1 = s__47962;
while(true){
var temp__5278__auto____$2 = cljs.core.seq.call(null,s__47962__$1);
if(temp__5278__auto____$2){
var s__47962__$2 = temp__5278__auto____$2;
if(cljs.core.chunked_seq_QMARK_.call(null,s__47962__$2)){
var c__24198__auto____$1 = cljs.core.chunk_first.call(null,s__47962__$2);
var size__24199__auto____$1 = cljs.core.count.call(null,c__24198__auto____$1);
var b__47964 = cljs.core.chunk_buffer.call(null,size__24199__auto____$1);
if((function (){var i__47963 = (0);
while(true){
if((i__47963 < size__24199__auto____$1)){
var vec__48025 = cljs.core._nth.call(null,c__24198__auto____$1,i__47963);
var dy = cljs.core.nth.call(null,vec__48025,(0),null);
var dir_v = cljs.core.nth.call(null,vec__48025,(1),null);
if(cljs.core.not_EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dir_h,dir_v], null))){
cljs.core.chunk_append.call(null,b__47964,hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_v),cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_h),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(dx + (x - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"y","y",-1757859776),(dy + (y - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__47963,s__47962__$1,s__47960__$1,i__47756,vec__48025,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47964,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting_bounds = bounds;
return ((function (i__47963,s__47962__$1,s__47960__$1,i__47756,starting_bounds,vec__48025,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47964,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (p__48028,final_QMARK_){
var vec__48029 = p__48028;
var dx__$1 = cljs.core.nth.call(null,vec__48029,(0),null);
var dy__$1 = cljs.core.nth.call(null,vec__48029,(1),null);
return javelin.core.dosync_STAR_.call(null,((function (i__47963,s__47962__$1,s__47960__$1,i__47756,vec__48029,dx__$1,dy__$1,starting_bounds,vec__48025,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47964,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),index,new cljs.core.Keyword(null,"bounds","bounds",1691609455)], null),((function (i__47963,s__47962__$1,s__47960__$1,i__47756,vec__48029,dx__$1,dy__$1,starting_bounds,vec__48025,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47964,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (bounds__$1){
var dx__$2 = cljs.core.long$.call(null,dx__$1);
var dy__$2 = cljs.core.long$.call(null,dy__$1);
var or__23338__auto__ = weathergen.ui.restrict.call(null,nx,ny,(function (){var G__48033 = bounds__$1;
var G__48033__$1 = ((cljs.core._EQ_.call(null,dir_h,"w"))?weathergen.ui.adjust_west.call(null,G__48033,starting_bounds,dx__$2):G__48033);
var G__48033__$2 = ((cljs.core._EQ_.call(null,dir_h,"e"))?weathergen.ui.adjust_east.call(null,G__48033__$1,starting_bounds,dx__$2):G__48033__$1);
var G__48033__$3 = ((cljs.core._EQ_.call(null,dir_v,"n"))?weathergen.ui.adjust_north.call(null,G__48033__$2,starting_bounds,dy__$2):G__48033__$2);
if(cljs.core._EQ_.call(null,dir_v,"s")){
return weathergen.ui.adjust_south.call(null,G__48033__$3,starting_bounds,dy__$2);
} else {
return G__48033__$3;
}
})());
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return bounds__$1;
}
});})(i__47963,s__47962__$1,s__47960__$1,i__47756,vec__48029,dx__$1,dy__$1,starting_bounds,vec__48025,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47964,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__47963,s__47962__$1,s__47960__$1,i__47756,vec__48029,dx__$1,dy__$1,starting_bounds,vec__48025,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47964,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
);
});
;})(i__47963,s__47962__$1,s__47960__$1,i__47756,starting_bounds,vec__48025,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47964,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
})());
});})(i__47963,s__47962__$1,s__47960__$1,i__47756,vec__48025,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47964,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
));

var G__48138 = (i__47963 + (1));
i__47963 = G__48138;
continue;
} else {
var G__48139 = (i__47963 + (1));
i__47963 = G__48139;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47964),weathergen$ui$wind_stability_overlay_$_iter__47754_$_iter__47959_$_iter__47961.call(null,cljs.core.chunk_rest.call(null,s__47962__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47964),null);
}
} else {
var vec__48034 = cljs.core.first.call(null,s__47962__$2);
var dy = cljs.core.nth.call(null,vec__48034,(0),null);
var dir_v = cljs.core.nth.call(null,vec__48034,(1),null);
if(cljs.core.not_EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dir_h,dir_v], null))){
return cljs.core.cons.call(null,hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_v),cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_h),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(dx + (x - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"y","y",-1757859776),(dy + (y - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (s__47962__$1,s__47960__$1,i__47756,vec__48034,dy,dir_v,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting_bounds = bounds;
return ((function (s__47962__$1,s__47960__$1,i__47756,starting_bounds,vec__48034,dy,dir_v,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (p__48037,final_QMARK_){
var vec__48038 = p__48037;
var dx__$1 = cljs.core.nth.call(null,vec__48038,(0),null);
var dy__$1 = cljs.core.nth.call(null,vec__48038,(1),null);
return javelin.core.dosync_STAR_.call(null,((function (s__47962__$1,s__47960__$1,i__47756,vec__48038,dx__$1,dy__$1,starting_bounds,vec__48034,dy,dir_v,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),index,new cljs.core.Keyword(null,"bounds","bounds",1691609455)], null),((function (s__47962__$1,s__47960__$1,i__47756,vec__48038,dx__$1,dy__$1,starting_bounds,vec__48034,dy,dir_v,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (bounds__$1){
var dx__$2 = cljs.core.long$.call(null,dx__$1);
var dy__$2 = cljs.core.long$.call(null,dy__$1);
var or__23338__auto__ = weathergen.ui.restrict.call(null,nx,ny,(function (){var G__48042 = bounds__$1;
var G__48042__$1 = ((cljs.core._EQ_.call(null,dir_h,"w"))?weathergen.ui.adjust_west.call(null,G__48042,starting_bounds,dx__$2):G__48042);
var G__48042__$2 = ((cljs.core._EQ_.call(null,dir_h,"e"))?weathergen.ui.adjust_east.call(null,G__48042__$1,starting_bounds,dx__$2):G__48042__$1);
var G__48042__$3 = ((cljs.core._EQ_.call(null,dir_v,"n"))?weathergen.ui.adjust_north.call(null,G__48042__$2,starting_bounds,dy__$2):G__48042__$2);
if(cljs.core._EQ_.call(null,dir_v,"s")){
return weathergen.ui.adjust_south.call(null,G__48042__$3,starting_bounds,dy__$2);
} else {
return G__48042__$3;
}
})());
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return bounds__$1;
}
});})(s__47962__$1,s__47960__$1,i__47756,vec__48038,dx__$1,dy__$1,starting_bounds,vec__48034,dy,dir_v,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(s__47962__$1,s__47960__$1,i__47756,vec__48038,dx__$1,dy__$1,starting_bounds,vec__48034,dy,dir_v,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
);
});
;})(s__47962__$1,s__47960__$1,i__47756,starting_bounds,vec__48034,dy,dir_v,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
})());
});})(s__47962__$1,s__47960__$1,i__47756,vec__48034,dy,dir_v,s__47962__$2,temp__5278__auto____$2,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
),weathergen$ui$wind_stability_overlay_$_iter__47754_$_iter__47959_$_iter__47961.call(null,cljs.core.rest.call(null,s__47962__$2)));
} else {
var G__48140 = cljs.core.rest.call(null,s__47962__$2);
s__47962__$1 = G__48140;
continue;
}
}
} else {
return null;
}
break;
}
});})(s__47960__$1,i__47756,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
,null,null));
});})(s__47960__$1,i__47756,vec__48004,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),"n"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(height / (2)),null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [height,"s"], null)], null)));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$wind_stability_overlay_$_iter__47754_$_iter__47959.call(null,cljs.core.rest.call(null,s__47960__$1)));
} else {
var G__48141 = cljs.core.rest.call(null,s__47960__$1);
s__47960__$1 = G__48141;
continue;
}
} else {
return null;
}
break;
}
});})(i__47756,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
,null,null));
});})(i__47756,map__47951,map__47951__$1,bounds,editing_QMARK_,map__47952,map__47952__$1,x,y,width,height,mousedown,vec__47948,index,area,c__24198__auto__,size__24199__auto__,b__47757,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),"w"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(width / (2)),null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [width,"e"], null)], null));
})())],null));
})());

var G__48142 = (i__47756 + (1));
i__47756 = G__48142;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47757),weathergen$ui$wind_stability_overlay_$_iter__47754.call(null,cljs.core.chunk_rest.call(null,s__47755__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47757),null);
}
} else {
var vec__48043 = cljs.core.first.call(null,s__47755__$2);
var index = cljs.core.nth.call(null,vec__48043,(0),null);
var area = cljs.core.nth.call(null,vec__48043,(1),null);
return cljs.core.cons.call(null,(function (){var map__48046 = area;
var map__48046__$1 = ((((!((map__48046 == null)))?((((map__48046.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48046.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48046):map__48046);
var bounds = cljs.core.get.call(null,map__48046__$1,new cljs.core.Keyword(null,"bounds","bounds",1691609455));
var editing_QMARK_ = cljs.core.get.call(null,map__48046__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__48047 = bounds;
var map__48047__$1 = ((((!((map__48047 == null)))?((((map__48047.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48047.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48047):map__48047);
var x = cljs.core.get.call(null,map__48047__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__48047__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__48047__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__48047__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var mousedown = ((function (map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting_bounds = bounds;
return ((function (starting_bounds,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (p__48050,final_QMARK_){
var vec__48051 = p__48050;
var dx = cljs.core.nth.call(null,vec__48051,(0),null);
var dy = cljs.core.nth.call(null,vec__48051,(1),null);
var dx__$1 = cljs.core.long$.call(null,dx);
var dy__$1 = cljs.core.long$.call(null,dy);
return javelin.core.dosync_STAR_.call(null,((function (dx__$1,dy__$1,vec__48051,dx,dy,starting_bounds,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),index,new cljs.core.Keyword(null,"bounds","bounds",1691609455)], null),((function (dx__$1,dy__$1,vec__48051,dx,dy,starting_bounds,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (bounds__$1){
return cljs.core.assoc.call(null,bounds__$1,new cljs.core.Keyword(null,"x","x",2099068185),weathergen.math.clamp.call(null,(0),(nx - new cljs.core.Keyword(null,"width","width",-384071477).cljs$core$IFn$_invoke$arity$1(bounds__$1)),(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dx__$1)),new cljs.core.Keyword(null,"y","y",-1757859776),weathergen.math.clamp.call(null,(0),(ny - new cljs.core.Keyword(null,"height","height",1025178622).cljs$core$IFn$_invoke$arity$1(bounds__$1)),(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dy__$1)));
});})(dx__$1,dy__$1,vec__48051,dx,dy,starting_bounds,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(dx__$1,dy__$1,vec__48051,dx,dy,starting_bounds,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
);
});
;})(starting_bounds,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
})());
});})(map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
;
return (new cljs.core.PersistentVector(null,4,(5),cljs.core.PersistentVector.EMPTY_NODE,[hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"fill","fill",883462889),(cljs.core.truth_(editing_QMARK_)?weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166)):"none"),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),mousedown,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),(cljs.core.truth_(editing_QMARK_)?"move":null),new cljs.core.Keyword(null,"border-width","border-width",-1512605390),(0)], null),new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.2,new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.6 0.6",new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"white",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.2,new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.6 0.6",new cljs.core.Keyword(null,"stroke-dashoffset","stroke-dashoffset",-782320340),0.6,new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),((cljs.core.not.call(null,editing_QMARK_))?cljs.core.PersistentVector.EMPTY:(function (){var iter__24200__auto__ = ((function (map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__47754_$_iter__48054(s__48055){
return (new cljs.core.LazySeq(null,((function (map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (){
var s__48055__$1 = s__48055;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__48055__$1);
if(temp__5278__auto____$1){
var xs__5831__auto__ = temp__5278__auto____$1;
var vec__48099 = cljs.core.first.call(null,xs__5831__auto__);
var dx = cljs.core.nth.call(null,vec__48099,(0),null);
var dir_h = cljs.core.nth.call(null,vec__48099,(1),null);
var iterys__24196__auto__ = ((function (s__48055__$1,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__47754_$_iter__48054_$_iter__48056(s__48057){
return (new cljs.core.LazySeq(null,((function (s__48055__$1,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (){
var s__48057__$1 = s__48057;
while(true){
var temp__5278__auto____$2 = cljs.core.seq.call(null,s__48057__$1);
if(temp__5278__auto____$2){
var s__48057__$2 = temp__5278__auto____$2;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48057__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__48057__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__48059 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__48058 = (0);
while(true){
if((i__48058 < size__24199__auto__)){
var vec__48120 = cljs.core._nth.call(null,c__24198__auto__,i__48058);
var dy = cljs.core.nth.call(null,vec__48120,(0),null);
var dir_v = cljs.core.nth.call(null,vec__48120,(1),null);
if(cljs.core.not_EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dir_h,dir_v], null))){
cljs.core.chunk_append.call(null,b__48059,hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_v),cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_h),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(dx + (x - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"y","y",-1757859776),(dy + (y - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__48058,s__48057__$1,s__48055__$1,vec__48120,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48059,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting_bounds = bounds;
return ((function (i__48058,s__48057__$1,s__48055__$1,starting_bounds,vec__48120,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48059,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (p__48123,final_QMARK_){
var vec__48124 = p__48123;
var dx__$1 = cljs.core.nth.call(null,vec__48124,(0),null);
var dy__$1 = cljs.core.nth.call(null,vec__48124,(1),null);
return javelin.core.dosync_STAR_.call(null,((function (i__48058,s__48057__$1,s__48055__$1,vec__48124,dx__$1,dy__$1,starting_bounds,vec__48120,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48059,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),index,new cljs.core.Keyword(null,"bounds","bounds",1691609455)], null),((function (i__48058,s__48057__$1,s__48055__$1,vec__48124,dx__$1,dy__$1,starting_bounds,vec__48120,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48059,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (bounds__$1){
var dx__$2 = cljs.core.long$.call(null,dx__$1);
var dy__$2 = cljs.core.long$.call(null,dy__$1);
var or__23338__auto__ = weathergen.ui.restrict.call(null,nx,ny,(function (){var G__48128 = bounds__$1;
var G__48128__$1 = ((cljs.core._EQ_.call(null,dir_h,"w"))?weathergen.ui.adjust_west.call(null,G__48128,starting_bounds,dx__$2):G__48128);
var G__48128__$2 = ((cljs.core._EQ_.call(null,dir_h,"e"))?weathergen.ui.adjust_east.call(null,G__48128__$1,starting_bounds,dx__$2):G__48128__$1);
var G__48128__$3 = ((cljs.core._EQ_.call(null,dir_v,"n"))?weathergen.ui.adjust_north.call(null,G__48128__$2,starting_bounds,dy__$2):G__48128__$2);
if(cljs.core._EQ_.call(null,dir_v,"s")){
return weathergen.ui.adjust_south.call(null,G__48128__$3,starting_bounds,dy__$2);
} else {
return G__48128__$3;
}
})());
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return bounds__$1;
}
});})(i__48058,s__48057__$1,s__48055__$1,vec__48124,dx__$1,dy__$1,starting_bounds,vec__48120,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48059,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__48058,s__48057__$1,s__48055__$1,vec__48124,dx__$1,dy__$1,starting_bounds,vec__48120,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48059,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
);
});
;})(i__48058,s__48057__$1,s__48055__$1,starting_bounds,vec__48120,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48059,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
})());
});})(i__48058,s__48057__$1,s__48055__$1,vec__48120,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48059,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
));

var G__48143 = (i__48058 + (1));
i__48058 = G__48143;
continue;
} else {
var G__48144 = (i__48058 + (1));
i__48058 = G__48144;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48059),weathergen$ui$wind_stability_overlay_$_iter__47754_$_iter__48054_$_iter__48056.call(null,cljs.core.chunk_rest.call(null,s__48057__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48059),null);
}
} else {
var vec__48129 = cljs.core.first.call(null,s__48057__$2);
var dy = cljs.core.nth.call(null,vec__48129,(0),null);
var dir_v = cljs.core.nth.call(null,vec__48129,(1),null);
if(cljs.core.not_EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dir_h,dir_v], null))){
return cljs.core.cons.call(null,hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_v),cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_h),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(dx + (x - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"y","y",-1757859776),(dy + (y - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (s__48057__$1,s__48055__$1,vec__48129,dy,dir_v,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting_bounds = bounds;
return ((function (s__48057__$1,s__48055__$1,starting_bounds,vec__48129,dy,dir_v,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (p__48132,final_QMARK_){
var vec__48133 = p__48132;
var dx__$1 = cljs.core.nth.call(null,vec__48133,(0),null);
var dy__$1 = cljs.core.nth.call(null,vec__48133,(1),null);
return javelin.core.dosync_STAR_.call(null,((function (s__48057__$1,s__48055__$1,vec__48133,dx__$1,dy__$1,starting_bounds,vec__48129,dy,dir_v,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),index,new cljs.core.Keyword(null,"bounds","bounds",1691609455)], null),((function (s__48057__$1,s__48055__$1,vec__48133,dx__$1,dy__$1,starting_bounds,vec__48129,dy,dir_v,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny){
return (function (bounds__$1){
var dx__$2 = cljs.core.long$.call(null,dx__$1);
var dy__$2 = cljs.core.long$.call(null,dy__$1);
var or__23338__auto__ = weathergen.ui.restrict.call(null,nx,ny,(function (){var G__48137 = bounds__$1;
var G__48137__$1 = ((cljs.core._EQ_.call(null,dir_h,"w"))?weathergen.ui.adjust_west.call(null,G__48137,starting_bounds,dx__$2):G__48137);
var G__48137__$2 = ((cljs.core._EQ_.call(null,dir_h,"e"))?weathergen.ui.adjust_east.call(null,G__48137__$1,starting_bounds,dx__$2):G__48137__$1);
var G__48137__$3 = ((cljs.core._EQ_.call(null,dir_v,"n"))?weathergen.ui.adjust_north.call(null,G__48137__$2,starting_bounds,dy__$2):G__48137__$2);
if(cljs.core._EQ_.call(null,dir_v,"s")){
return weathergen.ui.adjust_south.call(null,G__48137__$3,starting_bounds,dy__$2);
} else {
return G__48137__$3;
}
})());
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return bounds__$1;
}
});})(s__48057__$1,s__48055__$1,vec__48133,dx__$1,dy__$1,starting_bounds,vec__48129,dy,dir_v,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(s__48057__$1,s__48055__$1,vec__48133,dx__$1,dy__$1,starting_bounds,vec__48129,dy,dir_v,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
);
});
;})(s__48057__$1,s__48055__$1,starting_bounds,vec__48129,dy,dir_v,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
})());
});})(s__48057__$1,s__48055__$1,vec__48129,dy,dir_v,s__48057__$2,temp__5278__auto____$2,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
),weathergen$ui$wind_stability_overlay_$_iter__47754_$_iter__48054_$_iter__48056.call(null,cljs.core.rest.call(null,s__48057__$2)));
} else {
var G__48145 = cljs.core.rest.call(null,s__48057__$2);
s__48057__$1 = G__48145;
continue;
}
}
} else {
return null;
}
break;
}
});})(s__48055__$1,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
,null,null));
});})(s__48055__$1,vec__48099,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),"n"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(height / (2)),null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [height,"s"], null)], null)));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$wind_stability_overlay_$_iter__47754_$_iter__48054.call(null,cljs.core.rest.call(null,s__48055__$1)));
} else {
var G__48146 = cljs.core.rest.call(null,s__48055__$1);
s__48055__$1 = G__48146;
continue;
}
} else {
return null;
}
break;
}
});})(map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
,null,null));
});})(map__48046,map__48046__$1,bounds,editing_QMARK_,map__48047,map__48047__$1,x,y,width,height,mousedown,vec__48043,index,area,s__47755__$2,temp__5278__auto__,indexed,vec__47748,nx,ny))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),"w"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(width / (2)),null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [width,"e"], null)], null));
})())],null));
})(),weathergen$ui$wind_stability_overlay_$_iter__47754.call(null,cljs.core.rest.call(null,s__47755__$2)));
}
} else {
return null;
}
break;
}
});})(indexed,vec__47748,nx,ny))
,null,null));
});})(indexed,vec__47748,nx,ny))
;
return iter__24200__auto__.call(null,indexed__$1);
})());
});})(indexed,vec__47748,nx,ny))
).call(null,indexed);
});
weathergen.ui.weather_overrides_overlay = (function weathergen$ui$weather_overrides_overlay(weather_params,register_drag_handler){
var indexed = javelin.core.formula.call(null,(function (G__48299,G__48297,G__48298){
return G__48297.call(null,G__48298,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(G__48299));
})).call(null,weather_params,cljs.core.map_indexed,cljs.core.vector);
var vec__48294 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weather_params));
var nx = cljs.core.nth.call(null,vec__48294,(0),null);
var ny = cljs.core.nth.call(null,vec__48294,(1),null);
return javelin.core.formula.call(null,((function (indexed,vec__48294,nx,ny){
return (function (indexed__$1){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"weather-overrides-overlay",(function (){var iter__24200__auto__ = ((function (indexed,vec__48294,nx,ny){
return (function weathergen$ui$weather_overrides_overlay_$_iter__48300(s__48301){
return (new cljs.core.LazySeq(null,((function (indexed,vec__48294,nx,ny){
return (function (){
var s__48301__$1 = s__48301;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__48301__$1);
if(temp__5278__auto__){
var s__48301__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48301__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__48301__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__48303 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__48302 = (0);
while(true){
if((i__48302 < size__24199__auto__)){
var vec__48372 = cljs.core._nth.call(null,c__24198__auto__,i__48302);
var index = cljs.core.nth.call(null,vec__48372,(0),null);
var override = cljs.core.nth.call(null,vec__48372,(1),null);
var map__48375 = override;
var map__48375__$1 = ((((!((map__48375 == null)))?((((map__48375.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48375.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48375):map__48375);
var location = cljs.core.get.call(null,map__48375__$1,new cljs.core.Keyword(null,"location","location",1815599388));
var radius = cljs.core.get.call(null,map__48375__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
var falloff = cljs.core.get.call(null,map__48375__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var show_outline_QMARK_ = cljs.core.get.call(null,map__48375__$1,new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348));
var editing_QMARK_ = cljs.core.get.call(null,map__48375__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__48376 = location;
var map__48376__$1 = ((((!((map__48376 == null)))?((((map__48376.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48376.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48376):map__48376);
var x = cljs.core.get.call(null,map__48376__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__48376__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
if(cljs.core.truth_((function (){var or__23338__auto__ = show_outline_QMARK_;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return editing_QMARK_;
}
})())){
cljs.core.chunk_append.call(null,b__48303,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"fill","fill",883462889),(cljs.core.truth_(editing_QMARK_)?weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166)):"none"),new cljs.core.Keyword(null,"cursor","cursor",1011937484),(cljs.core.truth_(editing_QMARK_)?"move":null),new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.2",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"fuchsia",new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.2 0.1"], null),new cljs.core.Keyword(null,"cx","cx",1272694324),(x + 0.5),new cljs.core.Keyword(null,"cy","cy",755331060),(y + 0.5),new cljs.core.Keyword(null,"r","r",-471384190),(radius - 0.5),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__48302,s__48301__$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting = location;
return ((function (i__48302,s__48301__$1,starting,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (p__48379,final_QMARK_){
var vec__48380 = p__48379;
var dx = cljs.core.nth.call(null,vec__48380,(0),null);
var dy = cljs.core.nth.call(null,vec__48380,(1),null);
var dx__$1 = cljs.core.long$.call(null,dx);
var dy__$1 = cljs.core.long$.call(null,dy);
return javelin.core.dosync_STAR_.call(null,((function (i__48302,s__48301__$1,dx__$1,dy__$1,vec__48380,dx,dy,starting,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"location","location",1815599388)], null),((function (i__48302,s__48301__$1,dx__$1,dy__$1,vec__48380,dx,dy,starting,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (location__$1){
return cljs.core.assoc.call(null,location__$1,new cljs.core.Keyword(null,"x","x",2099068185),weathergen.math.clamp.call(null,(0),(nx - (1)),(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(starting) + dx__$1)),new cljs.core.Keyword(null,"y","y",-1757859776),weathergen.math.clamp.call(null,(0),(ny - (1)),(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(starting) + dy__$1)));
});})(i__48302,s__48301__$1,dx__$1,dy__$1,vec__48380,dx,dy,starting,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__48302,s__48301__$1,dx__$1,dy__$1,vec__48380,dx,dy,starting,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});
;})(i__48302,s__48301__$1,starting,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
})());
});})(i__48302,s__48301__$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
),hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.2",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"fuchsia",new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.1 0.2"], null),new cljs.core.Keyword(null,"cx","cx",1272694324),(x + 0.5),new cljs.core.Keyword(null,"cy","cy",755331060),(y + 0.5),new cljs.core.Keyword(null,"r","r",-471384190),(falloff - 0.5)),(function (){var circle_edit = ((function (i__48302,s__48301__$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (rad,mutate){
var iter__24200__auto__ = ((function (i__48302,s__48301__$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function weathergen$ui$weather_overrides_overlay_$_iter__48300_$_iter__48383(s__48384){
return (new cljs.core.LazySeq(null,((function (i__48302,s__48301__$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (){
var s__48384__$1 = s__48384;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__48384__$1);
if(temp__5278__auto____$1){
var s__48384__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48384__$2)){
var c__24198__auto____$1 = cljs.core.chunk_first.call(null,s__48384__$2);
var size__24199__auto____$1 = cljs.core.count.call(null,c__24198__auto____$1);
var b__48386 = cljs.core.chunk_buffer.call(null,size__24199__auto____$1);
if((function (){var i__48385 = (0);
while(true){
if((i__48385 < size__24199__auto____$1)){
var theta = cljs.core._nth.call(null,c__24198__auto____$1,i__48385);
cljs.core.chunk_append.call(null,b__48386,(function (){var alpha = weathergen.math.deg__GT_rad.call(null,theta);
var r = (rad - 0.5);
var sin_a = Math.sin(alpha);
var cos_a = Math.cos(alpha);
var x_offset = (r * sin_a);
var y_offset = (r * cos_a);
var lx = (((0.1 < sin_a))?"e":(((sin_a < -0.1))?"w":""
));
var ly = (((0.1 < cos_a))?"s":(((cos_a < -0.1))?"n":""
));
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(ly),cljs.core.str.cljs$core$IFn$_invoke$arity$1(lx),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(((x + x_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"y","y",-1757859776),(((y + y_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__48385,i__48302,s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto____$1,size__24199__auto____$1,b__48386,s__48384__$2,temp__5278__auto____$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,((function (i__48385,i__48302,s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto____$1,size__24199__auto____$1,b__48386,s__48384__$2,temp__5278__auto____$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (p__48395,final_QMARK_){
var vec__48396 = p__48395;
var dx = cljs.core.nth.call(null,vec__48396,(0),null);
var dy = cljs.core.nth.call(null,vec__48396,(1),null);
var dx_SINGLEQUOTE_ = (x_offset + dx);
var dy_SINGLEQUOTE_ = (y_offset + dy);
var r_SINGLEQUOTE_ = (0.5 + Math.sqrt(((dx_SINGLEQUOTE_ * dx_SINGLEQUOTE_) + (dy_SINGLEQUOTE_ * dy_SINGLEQUOTE_))));
return javelin.core.dosync_STAR_.call(null,((function (i__48385,i__48302,s__48301__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48396,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto____$1,size__24199__auto____$1,b__48386,s__48384__$2,temp__5278__auto____$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (){
mutate.call(null,r_SINGLEQUOTE_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__48385,i__48302,s__48301__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48396,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto____$1,size__24199__auto____$1,b__48386,s__48384__$2,temp__5278__auto____$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});})(i__48385,i__48302,s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto____$1,size__24199__auto____$1,b__48386,s__48384__$2,temp__5278__auto____$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});})(i__48385,i__48302,s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto____$1,size__24199__auto____$1,b__48386,s__48384__$2,temp__5278__auto____$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
})());

var G__48440 = (i__48385 + (1));
i__48385 = G__48440;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48386),weathergen$ui$weather_overrides_overlay_$_iter__48300_$_iter__48383.call(null,cljs.core.chunk_rest.call(null,s__48384__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48386),null);
}
} else {
var theta = cljs.core.first.call(null,s__48384__$2);
return cljs.core.cons.call(null,(function (){var alpha = weathergen.math.deg__GT_rad.call(null,theta);
var r = (rad - 0.5);
var sin_a = Math.sin(alpha);
var cos_a = Math.cos(alpha);
var x_offset = (r * sin_a);
var y_offset = (r * cos_a);
var lx = (((0.1 < sin_a))?"e":(((sin_a < -0.1))?"w":""
));
var ly = (((0.1 < cos_a))?"s":(((cos_a < -0.1))?"n":""
));
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(ly),cljs.core.str.cljs$core$IFn$_invoke$arity$1(lx),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(((x + x_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"y","y",-1757859776),(((y + y_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__48302,s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48384__$2,temp__5278__auto____$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,((function (i__48302,s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48384__$2,temp__5278__auto____$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (p__48399,final_QMARK_){
var vec__48400 = p__48399;
var dx = cljs.core.nth.call(null,vec__48400,(0),null);
var dy = cljs.core.nth.call(null,vec__48400,(1),null);
var dx_SINGLEQUOTE_ = (x_offset + dx);
var dy_SINGLEQUOTE_ = (y_offset + dy);
var r_SINGLEQUOTE_ = (0.5 + Math.sqrt(((dx_SINGLEQUOTE_ * dx_SINGLEQUOTE_) + (dy_SINGLEQUOTE_ * dy_SINGLEQUOTE_))));
return javelin.core.dosync_STAR_.call(null,((function (i__48302,s__48301__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48400,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48384__$2,temp__5278__auto____$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (){
mutate.call(null,r_SINGLEQUOTE_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__48302,s__48301__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48400,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48384__$2,temp__5278__auto____$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});})(i__48302,s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48384__$2,temp__5278__auto____$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});})(i__48302,s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48384__$2,temp__5278__auto____$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
})(),weathergen$ui$weather_overrides_overlay_$_iter__48300_$_iter__48383.call(null,cljs.core.rest.call(null,s__48384__$2)));
}
} else {
return null;
}
break;
}
});})(i__48302,s__48301__$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
,null,null));
});})(i__48302,s__48301__$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,(0),(360),(45)));
});})(i__48302,s__48301__$1,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
;
if(cljs.core.not.call(null,editing_QMARK_)){
return cljs.core.PersistentVector.EMPTY;
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [circle_edit.call(null,falloff,((function (i__48302,s__48301__$1,circle_edit,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (r){
return cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index], null),((function (i__48302,s__48301__$1,circle_edit,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (p__48403){
var map__48404 = p__48403;
var map__48404__$1 = ((((!((map__48404 == null)))?((((map__48404.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48404.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48404):map__48404);
var override__$1 = map__48404__$1;
var falloff__$1 = cljs.core.get.call(null,map__48404__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var radius__$1 = cljs.core.get.call(null,map__48404__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
return cljs.core.assoc.call(null,override__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456),weathergen.math.clamp.call(null,(0),radius__$1,cljs.core.long$.call(null,r)));
});})(i__48302,s__48301__$1,circle_edit,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});})(i__48302,s__48301__$1,circle_edit,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
),circle_edit.call(null,radius,((function (i__48302,s__48301__$1,circle_edit,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (r){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"radius","radius",-2073122258)], null),(function (){var x__23676__auto__ = (1);
var y__23677__auto__ = cljs.core.long$.call(null,r);
return ((x__23676__auto__ > y__23677__auto__) ? x__23676__auto__ : y__23677__auto__);
})());

return cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"falloff","falloff",-1639069456)], null),((function (i__48302,s__48301__$1,circle_edit,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (p1__48147_SHARP_){
return weathergen.math.clamp.call(null,(0),cljs.core.long$.call(null,r),p1__48147_SHARP_);
});})(i__48302,s__48301__$1,circle_edit,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});})(i__48302,s__48301__$1,circle_edit,map__48375,map__48375__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48376,map__48376__$1,x,y,vec__48372,index,override,c__24198__auto__,size__24199__auto__,b__48303,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
)], null);
}
})()], null));

var G__48441 = (i__48302 + (1));
i__48302 = G__48441;
continue;
} else {
var G__48442 = (i__48302 + (1));
i__48302 = G__48442;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48303),weathergen$ui$weather_overrides_overlay_$_iter__48300.call(null,cljs.core.chunk_rest.call(null,s__48301__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48303),null);
}
} else {
var vec__48406 = cljs.core.first.call(null,s__48301__$2);
var index = cljs.core.nth.call(null,vec__48406,(0),null);
var override = cljs.core.nth.call(null,vec__48406,(1),null);
var map__48409 = override;
var map__48409__$1 = ((((!((map__48409 == null)))?((((map__48409.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48409.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48409):map__48409);
var location = cljs.core.get.call(null,map__48409__$1,new cljs.core.Keyword(null,"location","location",1815599388));
var radius = cljs.core.get.call(null,map__48409__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
var falloff = cljs.core.get.call(null,map__48409__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var show_outline_QMARK_ = cljs.core.get.call(null,map__48409__$1,new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348));
var editing_QMARK_ = cljs.core.get.call(null,map__48409__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__48410 = location;
var map__48410__$1 = ((((!((map__48410 == null)))?((((map__48410.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48410.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48410):map__48410);
var x = cljs.core.get.call(null,map__48410__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__48410__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
if(cljs.core.truth_((function (){var or__23338__auto__ = show_outline_QMARK_;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return editing_QMARK_;
}
})())){
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"fill","fill",883462889),(cljs.core.truth_(editing_QMARK_)?weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166)):"none"),new cljs.core.Keyword(null,"cursor","cursor",1011937484),(cljs.core.truth_(editing_QMARK_)?"move":null),new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.2",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"fuchsia",new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.2 0.1"], null),new cljs.core.Keyword(null,"cx","cx",1272694324),(x + 0.5),new cljs.core.Keyword(null,"cy","cy",755331060),(y + 0.5),new cljs.core.Keyword(null,"r","r",-471384190),(radius - 0.5),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (s__48301__$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting = location;
return ((function (s__48301__$1,starting,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (p__48413,final_QMARK_){
var vec__48414 = p__48413;
var dx = cljs.core.nth.call(null,vec__48414,(0),null);
var dy = cljs.core.nth.call(null,vec__48414,(1),null);
var dx__$1 = cljs.core.long$.call(null,dx);
var dy__$1 = cljs.core.long$.call(null,dy);
return javelin.core.dosync_STAR_.call(null,((function (s__48301__$1,dx__$1,dy__$1,vec__48414,dx,dy,starting,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"location","location",1815599388)], null),((function (s__48301__$1,dx__$1,dy__$1,vec__48414,dx,dy,starting,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (location__$1){
return cljs.core.assoc.call(null,location__$1,new cljs.core.Keyword(null,"x","x",2099068185),weathergen.math.clamp.call(null,(0),(nx - (1)),(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(starting) + dx__$1)),new cljs.core.Keyword(null,"y","y",-1757859776),weathergen.math.clamp.call(null,(0),(ny - (1)),(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(starting) + dy__$1)));
});})(s__48301__$1,dx__$1,dy__$1,vec__48414,dx,dy,starting,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(s__48301__$1,dx__$1,dy__$1,vec__48414,dx,dy,starting,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});
;})(s__48301__$1,starting,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
})());
});})(s__48301__$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
),hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.2",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"fuchsia",new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.1 0.2"], null),new cljs.core.Keyword(null,"cx","cx",1272694324),(x + 0.5),new cljs.core.Keyword(null,"cy","cy",755331060),(y + 0.5),new cljs.core.Keyword(null,"r","r",-471384190),(falloff - 0.5)),(function (){var circle_edit = ((function (s__48301__$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (rad,mutate){
var iter__24200__auto__ = ((function (s__48301__$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function weathergen$ui$weather_overrides_overlay_$_iter__48300_$_iter__48417(s__48418){
return (new cljs.core.LazySeq(null,((function (s__48301__$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (){
var s__48418__$1 = s__48418;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__48418__$1);
if(temp__5278__auto____$1){
var s__48418__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48418__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__48418__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__48420 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__48419 = (0);
while(true){
if((i__48419 < size__24199__auto__)){
var theta = cljs.core._nth.call(null,c__24198__auto__,i__48419);
cljs.core.chunk_append.call(null,b__48420,(function (){var alpha = weathergen.math.deg__GT_rad.call(null,theta);
var r = (rad - 0.5);
var sin_a = Math.sin(alpha);
var cos_a = Math.cos(alpha);
var x_offset = (r * sin_a);
var y_offset = (r * cos_a);
var lx = (((0.1 < sin_a))?"e":(((sin_a < -0.1))?"w":""
));
var ly = (((0.1 < cos_a))?"s":(((cos_a < -0.1))?"n":""
));
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(ly),cljs.core.str.cljs$core$IFn$_invoke$arity$1(lx),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(((x + x_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"y","y",-1757859776),(((y + y_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__48419,s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto__,size__24199__auto__,b__48420,s__48418__$2,temp__5278__auto____$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,((function (i__48419,s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto__,size__24199__auto__,b__48420,s__48418__$2,temp__5278__auto____$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (p__48429,final_QMARK_){
var vec__48430 = p__48429;
var dx = cljs.core.nth.call(null,vec__48430,(0),null);
var dy = cljs.core.nth.call(null,vec__48430,(1),null);
var dx_SINGLEQUOTE_ = (x_offset + dx);
var dy_SINGLEQUOTE_ = (y_offset + dy);
var r_SINGLEQUOTE_ = (0.5 + Math.sqrt(((dx_SINGLEQUOTE_ * dx_SINGLEQUOTE_) + (dy_SINGLEQUOTE_ * dy_SINGLEQUOTE_))));
return javelin.core.dosync_STAR_.call(null,((function (i__48419,s__48301__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48430,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto__,size__24199__auto__,b__48420,s__48418__$2,temp__5278__auto____$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (){
mutate.call(null,r_SINGLEQUOTE_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__48419,s__48301__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48430,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto__,size__24199__auto__,b__48420,s__48418__$2,temp__5278__auto____$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});})(i__48419,s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto__,size__24199__auto__,b__48420,s__48418__$2,temp__5278__auto____$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});})(i__48419,s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto__,size__24199__auto__,b__48420,s__48418__$2,temp__5278__auto____$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
})());

var G__48443 = (i__48419 + (1));
i__48419 = G__48443;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48420),weathergen$ui$weather_overrides_overlay_$_iter__48300_$_iter__48417.call(null,cljs.core.chunk_rest.call(null,s__48418__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48420),null);
}
} else {
var theta = cljs.core.first.call(null,s__48418__$2);
return cljs.core.cons.call(null,(function (){var alpha = weathergen.math.deg__GT_rad.call(null,theta);
var r = (rad - 0.5);
var sin_a = Math.sin(alpha);
var cos_a = Math.cos(alpha);
var x_offset = (r * sin_a);
var y_offset = (r * cos_a);
var lx = (((0.1 < sin_a))?"e":(((sin_a < -0.1))?"w":""
));
var ly = (((0.1 < cos_a))?"s":(((cos_a < -0.1))?"n":""
));
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(ly),cljs.core.str.cljs$core$IFn$_invoke$arity$1(lx),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(((x + x_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"y","y",-1757859776),(((y + y_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48418__$2,temp__5278__auto____$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,((function (s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48418__$2,temp__5278__auto____$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (p__48433,final_QMARK_){
var vec__48434 = p__48433;
var dx = cljs.core.nth.call(null,vec__48434,(0),null);
var dy = cljs.core.nth.call(null,vec__48434,(1),null);
var dx_SINGLEQUOTE_ = (x_offset + dx);
var dy_SINGLEQUOTE_ = (y_offset + dy);
var r_SINGLEQUOTE_ = (0.5 + Math.sqrt(((dx_SINGLEQUOTE_ * dx_SINGLEQUOTE_) + (dy_SINGLEQUOTE_ * dy_SINGLEQUOTE_))));
return javelin.core.dosync_STAR_.call(null,((function (s__48301__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48434,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48418__$2,temp__5278__auto____$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (){
mutate.call(null,r_SINGLEQUOTE_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(s__48301__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48434,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48418__$2,temp__5278__auto____$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});})(s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48418__$2,temp__5278__auto____$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});})(s__48301__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48418__$2,temp__5278__auto____$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
})(),weathergen$ui$weather_overrides_overlay_$_iter__48300_$_iter__48417.call(null,cljs.core.rest.call(null,s__48418__$2)));
}
} else {
return null;
}
break;
}
});})(s__48301__$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
,null,null));
});})(s__48301__$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,(0),(360),(45)));
});})(s__48301__$1,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
;
if(cljs.core.not.call(null,editing_QMARK_)){
return cljs.core.PersistentVector.EMPTY;
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [circle_edit.call(null,falloff,((function (s__48301__$1,circle_edit,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (r){
return cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index], null),((function (s__48301__$1,circle_edit,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (p__48437){
var map__48438 = p__48437;
var map__48438__$1 = ((((!((map__48438 == null)))?((((map__48438.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48438.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48438):map__48438);
var override__$1 = map__48438__$1;
var falloff__$1 = cljs.core.get.call(null,map__48438__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var radius__$1 = cljs.core.get.call(null,map__48438__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
return cljs.core.assoc.call(null,override__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456),weathergen.math.clamp.call(null,(0),radius__$1,cljs.core.long$.call(null,r)));
});})(s__48301__$1,circle_edit,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});})(s__48301__$1,circle_edit,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
),circle_edit.call(null,radius,((function (s__48301__$1,circle_edit,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (r){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"radius","radius",-2073122258)], null),(function (){var x__23676__auto__ = (1);
var y__23677__auto__ = cljs.core.long$.call(null,r);
return ((x__23676__auto__ > y__23677__auto__) ? x__23676__auto__ : y__23677__auto__);
})());

return cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"falloff","falloff",-1639069456)], null),((function (s__48301__$1,circle_edit,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny){
return (function (p1__48147_SHARP_){
return weathergen.math.clamp.call(null,(0),cljs.core.long$.call(null,r),p1__48147_SHARP_);
});})(s__48301__$1,circle_edit,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
);
});})(s__48301__$1,circle_edit,map__48409,map__48409__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48410,map__48410__$1,x,y,vec__48406,index,override,s__48301__$2,temp__5278__auto__,indexed,vec__48294,nx,ny))
)], null);
}
})()], null),weathergen$ui$weather_overrides_overlay_$_iter__48300.call(null,cljs.core.rest.call(null,s__48301__$2)));
} else {
var G__48444 = cljs.core.rest.call(null,s__48301__$2);
s__48301__$1 = G__48444;
continue;
}
}
} else {
return null;
}
break;
}
});})(indexed,vec__48294,nx,ny))
,null,null));
});})(indexed,vec__48294,nx,ny))
;
return iter__24200__auto__.call(null,indexed__$1);
})());
});})(indexed,vec__48294,nx,ny))
).call(null,indexed);
});
weathergen.ui.flight_path__GT_path = (function weathergen$ui$flight_path__GT_path(size,path){
var G__48465 = path;
var vec__48466 = G__48465;
var seq__48467 = cljs.core.seq.call(null,vec__48466);
var first__48468 = cljs.core.first.call(null,seq__48467);
var seq__48467__$1 = cljs.core.next.call(null,seq__48467);
var point = first__48468;
var more = seq__48467__$1;
var landed_QMARK_ = false;
var s = null;
var G__48465__$1 = G__48465;
var landed_QMARK___$1 = landed_QMARK_;
var s__$1 = s;
while(true){
var vec__48469 = G__48465__$1;
var seq__48470 = cljs.core.seq.call(null,vec__48469);
var first__48471 = cljs.core.first.call(null,seq__48470);
var seq__48470__$1 = cljs.core.next.call(null,seq__48470);
var point__$1 = first__48471;
var more__$1 = seq__48470__$1;
var landed_QMARK___$2 = landed_QMARK___$1;
var s__$2 = s__$1;
var temp__5276__auto__ = point__$1;
if(cljs.core.truth_(temp__5276__auto__)){
var map__48472 = temp__5276__auto__;
var map__48472__$1 = ((((!((map__48472 == null)))?((((map__48472.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48472.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48472):map__48472);
var coordinates = cljs.core.get.call(null,map__48472__$1,new cljs.core.Keyword("weathergen.dtc","coordinates","weathergen.dtc/coordinates",-1965136125));
var action = cljs.core.get.call(null,map__48472__$1,new cljs.core.Keyword("weathergen.dtc","action","weathergen.dtc/action",1537999145));
var map__48474 = coordinates;
var map__48474__$1 = ((((!((map__48474 == null)))?((((map__48474.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48474.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48474):map__48474);
var x = cljs.core.get.call(null,map__48474__$1,new cljs.core.Keyword("weathergen.dtc","x","weathergen.dtc/x",-384550566));
var y = cljs.core.get.call(null,map__48474__$1,new cljs.core.Keyword("weathergen.dtc","y","weathergen.dtc/y",-474567375));
var vec__48475 = weathergen.coordinates.ffeet__GT_weather.call(null,size,x,y);
var gx = cljs.core.nth.call(null,vec__48475,(0),null);
var gy = cljs.core.nth.call(null,vec__48475,(1),null);
if(landed_QMARK___$2){
return s__$2;
} else {
var G__48479 = more__$1;
var G__48480 = (landed_QMARK___$2) || (cljs.core._EQ_.call(null,action,new cljs.core.Keyword(null,"land","land",-1402569867)));
var G__48481 = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(s__$2),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(s__$2)?" ":null)),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(s__$2)?"L":"M")),cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.string.format("%f,%f",gx,gy))].join('');
G__48465__$1 = G__48479;
landed_QMARK___$1 = G__48480;
s__$1 = G__48481;
continue;
}
} else {
return s__$2;
}
break;
}
});
weathergen.ui.line__GT_path = (function weathergen$ui$line__GT_path(size,line){
var G__48502 = line;
var vec__48503 = G__48502;
var seq__48504 = cljs.core.seq.call(null,vec__48503);
var first__48505 = cljs.core.first.call(null,seq__48504);
var seq__48504__$1 = cljs.core.next.call(null,seq__48504);
var point = first__48505;
var more = seq__48504__$1;
var s = null;
var G__48502__$1 = G__48502;
var s__$1 = s;
while(true){
var vec__48506 = G__48502__$1;
var seq__48507 = cljs.core.seq.call(null,vec__48506);
var first__48508 = cljs.core.first.call(null,seq__48507);
var seq__48507__$1 = cljs.core.next.call(null,seq__48507);
var point__$1 = first__48508;
var more__$1 = seq__48507__$1;
var s__$2 = s__$1;
var temp__5276__auto__ = point__$1;
if(cljs.core.truth_(temp__5276__auto__)){
var map__48509 = temp__5276__auto__;
var map__48509__$1 = ((((!((map__48509 == null)))?((((map__48509.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48509.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48509):map__48509);
var coordinates = cljs.core.get.call(null,map__48509__$1,new cljs.core.Keyword("weathergen.dtc","coordinates","weathergen.dtc/coordinates",-1965136125));
var map__48511 = coordinates;
var map__48511__$1 = ((((!((map__48511 == null)))?((((map__48511.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48511.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48511):map__48511);
var x = cljs.core.get.call(null,map__48511__$1,new cljs.core.Keyword("weathergen.dtc","x","weathergen.dtc/x",-384550566));
var y = cljs.core.get.call(null,map__48511__$1,new cljs.core.Keyword("weathergen.dtc","y","weathergen.dtc/y",-474567375));
var vec__48512 = weathergen.coordinates.ffeet__GT_weather.call(null,size,x,y);
var wx = cljs.core.nth.call(null,vec__48512,(0),null);
var wy = cljs.core.nth.call(null,vec__48512,(1),null);
var G__48516 = more__$1;
var G__48517 = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(s__$2),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(s__$2)?" ":null)),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(s__$2)?"L":"M")),cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.string.format("%f,%f",wx,wy))].join('');
G__48502__$1 = G__48516;
s__$1 = G__48517;
continue;
} else {
return s__$2;
}
break;
}
});
weathergen.ui.airbase_info_id = (function weathergen$ui$airbase_info_id(airbase){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("airbase-info-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(airbase))].join('');
});
/**
 * Returns the color a status bar should be given the status of an
 *   airbase.
 */
weathergen.ui.airbase_status_color = (function weathergen$ui$airbase_status_color(status){
if(((75) < status)){
return "green";
} else {
if(((25) < status)){
return "orange";
} else {
return "red";

}
}
});
/**
 * Renders the airbase portion of the info overlay.
 */
weathergen.ui.airbase_info_overlay = (function weathergen$ui$airbase_info_overlay(mission,airbase){
var icon_scale = 0.05;
var coords = javelin.core.formula.call(null,((function (icon_scale){
return (function (mission__$1,airbase__$1){
return weathergen.coordinates.fgrid__GT_weather.call(null,mission__$1,new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(airbase__$1),new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(airbase__$1));
});})(icon_scale))
).call(null,mission,airbase);
var x = javelin.core.formula.call(null,((function (icon_scale,coords){
return (function (coords__$1){
return new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(coords__$1);
});})(icon_scale,coords))
).call(null,coords);
var y = javelin.core.formula.call(null,((function (icon_scale,coords,x){
return (function (coords__$1){
return new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(coords__$1);
});})(icon_scale,coords,x))
).call(null,coords);
var label = javelin.core.formula.call(null,((function (icon_scale,coords,x,y){
return (function (airbase__$1){
return new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975).cljs$core$IFn$_invoke$arity$1(airbase__$1);
});})(icon_scale,coords,x,y))
).call(null,airbase);
var camp_id = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label){
return (function (airbase__$1){
return new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(airbase__$1);
});})(icon_scale,coords,x,y,label))
).call(null,airbase);
var visible_QMARK_ = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id){
return (function (displayed_airbases,airbase__$1){
return displayed_airbases.call(null,airbase__$1);
});})(icon_scale,coords,x,y,label,camp_id))
).call(null,weathergen.ui.displayed_airbases,airbase);
var highlighted_QMARK_ = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_){
return (function (highlighted_airbase,airbase__$1){
return cljs.core._EQ_.call(null,highlighted_airbase,airbase__$1);
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_))
).call(null,weathergen.ui.highlighted_airbase,airbase);
var font_size = "3.5%";
var color = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size){
return (function (mission__$1,airbase__$1){
return weathergen.ui.common.team_color.call(null,weathergen.falcon.files.mission.side.call(null,mission__$1,new cljs.core.Keyword(null,"owner","owner",-392611939).cljs$core$IFn$_invoke$arity$1(airbase__$1)),new cljs.core.Keyword(null,"light-text","light-text",-274885440));
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size))
).call(null,mission,airbase);
var text_stroke_width = 0.03;
var contrasting_color = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width){
return (function (color__$1){
return weathergen.ui.common.contrasting.call(null,color__$1);
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width))
).call(null,color);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"airbase-info-overlay",(function (){var con__29830__auto__ = (new cljs.core.Delay(((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48614,G__48613){
return G__48613.call(null,G__48614);
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase,weathergen.ui.airbase_info_id),new cljs.core.Keyword(null,"airbase","airbase",-369690299),label,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (x__$1,y__$1,map_zoom){
if(cljs.core.truth_((function (){var and__23326__auto__ = x__$1;
if(cljs.core.truth_(and__23326__auto__)){
return y__$1;
} else {
return and__23326__auto__;
}
})())){
return weathergen.ui.common.svg_xform_combine.call(null,weathergen.ui.common.svg_translate.call(null,x__$1,y__$1),weathergen.ui.common.svg_scale.call(null,(1.0 / map_zoom)));
} else {
return null;
}
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,x,y,weathergen.ui.map_zoom),(function (){var label_style = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48615){
return new cljs.core.Keyword(null,"airbase-label-style","airbase-label-style",-1349798514).cljs$core$IFn$_invoke$arity$1(G__48615);
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.map_display);
var label_spacing = 0.2;
var line_height = 0.75;
var status = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48616){
return new cljs.core.Keyword("weathergen.falcon.files.mission","status","weathergen.falcon.files.mission/status",667063917).cljs$core$IFn$_invoke$arity$1(G__48616);
});})(label_style,label_spacing,line_height,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase);
var dims = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (airbase__$1){
var image = new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(airbase__$1);
var map__48617 = image;
var map__48617__$1 = ((((!((map__48617 == null)))?((((map__48617.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48617.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48617):map__48617);
var image_data = cljs.core.get.call(null,map__48617__$1,new cljs.core.Keyword(null,"image-data","image-data",-377483758));
var map__48618 = image_data;
var map__48618__$1 = ((((!((map__48618 == null)))?((((map__48618.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48618.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48618):map__48618);
var size = cljs.core.get.call(null,map__48618__$1,new cljs.core.Keyword(null,"size","size",1098693007));
var center = cljs.core.get.call(null,map__48618__$1,new cljs.core.Keyword(null,"center","center",-748944368));
var vec__48619 = size;
var w = cljs.core.nth.call(null,vec__48619,(0),null);
var h = cljs.core.nth.call(null,vec__48619,(1),null);
var vec__48622 = center;
var cx = cljs.core.nth.call(null,vec__48622,(0),null);
var cy = cljs.core.nth.call(null,vec__48622,(1),null);
return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"x","x",2099068185),((cx - w) * icon_scale),new cljs.core.Keyword(null,"y","y",-1757859776),((- (h - cy)) * icon_scale),new cljs.core.Keyword(null,"w","w",354169001),(w * icon_scale),new cljs.core.Keyword(null,"h","h",1109658740),(h * icon_scale),new cljs.core.Keyword(null,"d","d",1972142424),(cy * icon_scale)], null);
});})(label_style,label_spacing,line_height,status,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase);
var show_airbase_status_QMARK_ = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"show-airbase-status?","show-airbase-status?",-2059784435)], null));
var show_airbase_squadrons_QMARK_ = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"show-airbase-squadrons?","show-airbase-squadrons?",1245487954)], null));
var width = 1.0;
var height = 0.2;
var x__$1 = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48628,G__48627){
return (new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__48627) + ((new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__48627) - G__48628) / (2)));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,width,dims);
var y__$1 = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48630,G__48629){
return (new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__48629) - ((2) * G__48630));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,height,dims);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"airbase-and-highlighter",(function (){var con__29830__auto__ = (new cljs.core.Delay(((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"highlights",hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"moving highlight",new cljs.core.Keyword("svg","class","svg/class",-2030780416),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (highlighted_QMARK___$1){
if(cljs.core.truth_(highlighted_QMARK___$1)){
return weathergen.ui.common.collapse_class;
} else {
return null;
}
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,highlighted_QMARK_),new cljs.core.Keyword(null,"x","x",2099068185),x__$1,new cljs.core.Keyword(null,"y","y",-1757859776),y__$1,new cljs.core.Keyword(null,"r","r",-471384190),(60),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"yellow",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),(2),new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"5, 5",new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_scale.call(null,(0))),hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"static highlight",new cljs.core.Keyword("svg","class","svg/class",-2030780416),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (highlighted_QMARK___$1){
if(cljs.core.truth_(highlighted_QMARK___$1)){
return weathergen.ui.common.delayed_fade_out_class;
} else {
return null;
}
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,highlighted_QMARK_),new cljs.core.Keyword(null,"x","x",2099068185),x__$1,new cljs.core.Keyword(null,"y","y",-1757859776),y__$1,new cljs.core.Keyword(null,"r","r",-471384190),2.5,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"none",new cljs.core.Keyword(null,"fill","fill",883462889),"yellow",new cljs.core.Keyword(null,"opacity","opacity",397153780),(0)));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__29830__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,highlighted_QMARK_);
})(),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"icon-and-info",new cljs.core.Keyword("svg","class","svg/class",-2030780416),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (highlighted_QMARK___$1){
if(cljs.core.truth_(highlighted_QMARK___$1)){
return weathergen.ui.common.pulse_class;
} else {
return null;
}
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,highlighted_QMARK_),(function (){var con__29830__auto__ = (new cljs.core.Delay(((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"status",new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48631,G__48632){
return G__48631.call(null,G__48632);
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.common.svg_scale,weathergen.ui.map_icon_scale),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),x__$1,new cljs.core.Keyword(null,"y","y",-1757859776),y__$1,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.03,new cljs.core.Keyword(null,"fill","fill",883462889),"white"),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),x__$1,new cljs.core.Keyword(null,"y","y",-1757859776),y__$1,new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48633,G__48634){
return ((G__48633 * G__48634) / (100));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,width,status),new cljs.core.Keyword(null,"height","height",1025178622),height,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.03,new cljs.core.Keyword(null,"fill","fill",883462889),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48635,G__48636){
return G__48635.call(null,G__48636);
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.airbase_status_color,status)));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__29830__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,show_airbase_status_QMARK_);
})(),(function (){var text_y_offset = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48637,G__48638,G__48639){
return (G__48637 + (G__48638 * (new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__48639) + new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48639))));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,label_spacing,weathergen.ui.map_icon_scale,dims);
var bbox_trigger = javelin.core.formula.call(null,((function (text_y_offset,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48640,G__48641,G__48642){
return cljs.core.PersistentHashSet.createAsIfByAssoc([G__48640,G__48642,G__48641]);
});})(text_y_offset,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.included_squadrons,text_y_offset,label_style);
var G__48643 = javelin.core.cell.call(null,(0));
var ty = javelin.core.cell.call(null,(0));
var tw = javelin.core.cell.call(null,(0));
var th = javelin.core.cell.call(null,(0));
var t = hoplon.svg.text.call(null,new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"3.5%",new cljs.core.Keyword(null,"font-family","font-family",-667419874),"Source Code Pro",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),(100),new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48645,G__48644){
return (new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__48644) + ((new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__48644) - G__48645) / (2)));
});})(G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,tw,dims),new cljs.core.Keyword(null,"y","y",-1757859776),line_height,new cljs.core.Keyword(null,"stroke","stroke",1741823555),color,new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.03,new cljs.core.Keyword(null,"fill","fill",883462889),color,hoplon.svg.tspan.call(null,label),hoplon.core.loop_tpl_STAR_.call(null,javelin.core.formula.call(null,((function (G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (airbase__$1,included_squadrons,label_style__$1){
if(cljs.core._EQ_.call(null,label_style__$1,new cljs.core.Keyword(null,"all","all",892129742))){
return cljs.core.map_indexed.call(null,cljs.core.vector,cljs.core.filter.call(null,included_squadrons,new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase__$1)));
} else {
return null;
}
});})(G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase,weathergen.ui.included_squadrons,label_style),((function (G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (item__29820__auto__){
var vec__48646 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (indexed){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [indexed], null);
});})(G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,item__29820__auto__));
var indexed = cljs.core.nth.call(null,vec__48646,(0),null);
var vec__48655 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__48646,indexed,G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__48658){
var vec__48659 = p__48658;
var i = cljs.core.nth.call(null,vec__48659,(0),null);
var squadron = cljs.core.nth.call(null,vec__48659,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [i,squadron], null);
});})(vec__48646,indexed,G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,indexed));
var i = cljs.core.nth.call(null,vec__48655,(0),null);
var squadron = cljs.core.nth.call(null,vec__48655,(1),null);
return hoplon.svg.tspan.call(null,new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (vec__48655,i,squadron,vec__48646,indexed,G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48662,G__48663){
return ((G__48662 + (2)) * G__48663);
});})(vec__48655,i,squadron,vec__48646,indexed,G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,i,line_height),new cljs.core.Keyword(null,"text-anchor","text-anchor",585613696),"start",new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (vec__48655,i,squadron,vec__48646,indexed,G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48664){
return (- (G__48664 / (2)));
});})(vec__48655,i,squadron,vec__48646,indexed,G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,tw),new cljs.core.Keyword(null,"dx","dx",-381796732),"0.75em",javelin.core.formula.call(null,((function (vec__48655,i,squadron,vec__48646,indexed,G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48665,G__48666){
return G__48665.call(null,"%d %s",new cljs.core.Keyword(null,"quantity","quantity",-1929050694).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","aircraft","weathergen.falcon.files.mission/aircraft",774567258).cljs$core$IFn$_invoke$arity$1(G__48666)),new cljs.core.Keyword(null,"airframe","airframe",643222926).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","aircraft","weathergen.falcon.files.mission/aircraft",774567258).cljs$core$IFn$_invoke$arity$1(G__48666)));
});})(vec__48655,i,squadron,vec__48646,indexed,G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,goog.string.format,squadron));
});})(G__48643,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
));
var update_bbox__15569__auto__ = ((function (G__48643,ty,tw,th,t,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (G__48643,ty,tw,th,t,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
var bb__15570__auto__ = t.getBBox();
if(cljs.core.truth_(bb__15570__auto__.x)){
cljs.core.reset_BANG_.call(null,G__48643,bb__15570__auto__.x);

cljs.core.reset_BANG_.call(null,ty,bb__15570__auto__.y);

cljs.core.reset_BANG_.call(null,tw,bb__15570__auto__.width);

return cljs.core.reset_BANG_.call(null,th,bb__15570__auto__.height);
} else {
return null;
}
});})(G__48643,ty,tw,th,t,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
);
});})(G__48643,ty,tw,th,t,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
hoplon.core.when_dom.call(null,t,update_bbox__15569__auto__);

var temp__5278__auto___48708 = bbox_trigger;
if(cljs.core.truth_(temp__5278__auto___48708)){
var w__15571__auto___48709 = temp__5278__auto___48708;
cljs.core.add_watch.call(null,w__15571__auto___48709,cljs.core.keyword.call(null,cljs.core.gensym.call(null)),((function (w__15571__auto___48709,temp__5278__auto___48708,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (_,___$1,___$2,___$3){
return setTimeout(((function (w__15571__auto___48709,temp__5278__auto___48708,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return update_bbox__15569__auto__.call(null);
});})(w__15571__auto___48709,temp__5278__auto___48708,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,(0));
});})(w__15571__auto___48709,temp__5278__auto___48708,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
);
} else {
}

return hoplon.svg.g.call(null,(function (){var con__29830__auto__ = (new cljs.core.Delay(((function (G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"label",new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48667,G__48668){
return G__48667.call(null,(0),G__48668);
});})(G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.common.svg_translate,text_y_offset),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48669,G__48670){
return G__48669.call(null,G__48670);
});})(G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.common.svg_scale,weathergen.ui.map_text_scale),(function (){var con__29830__auto__ = (new cljs.core.Delay(((function (G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
var padding = 0.1;
var tx = javelin.core.formula.call(null,((function (padding,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (dims__$1,tw__$1){
return (new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(dims__$1) + ((new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(dims__$1) - tw__$1) / (2)));
});})(padding,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims,tw);
var rx = javelin.core.formula.call(null,((function (padding,tx,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (tx__$1){
return (tx__$1 - padding);
});})(padding,tx,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,tx);
var ry = javelin.core.formula.call(null,((function (padding,tx,rx,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (ty__$1){
return (ty__$1 - padding);
});})(padding,tx,rx,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,ty);
var rw = javelin.core.formula.call(null,((function (padding,tx,rx,ry,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (tw__$1){
return ((tw__$1 + padding) + padding);
});})(padding,tx,rx,ry,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,tw);
var rh = javelin.core.formula.call(null,((function (padding,tx,rx,ry,rw,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (th__$1){
return ((th__$1 + padding) + padding);
});})(padding,tx,rx,ry,rw,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,th);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"background",hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),rx,new cljs.core.Keyword(null,"y","y",-1757859776),ry,new cljs.core.Keyword(null,"width","width",-384071477),rw,new cljs.core.Keyword(null,"height","height",1025178622),rh,new cljs.core.Keyword(null,"opacity","opacity",397153780),0.4,new cljs.core.Keyword(null,"fill","fill",883462889),contrasting_color,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"none"));
});})(G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__29830__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,weathergen.ui.map_show_text_background_QMARK_);
})(),t));
});})(G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__29830__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,javelin.core.formula.call(null,((function (con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48671,G__48672){
return G__48671.call(null,G__48672,new cljs.core.Keyword(null,"nothing","nothing",-1022703296));
});})(con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,cljs.core.not_EQ_,label_style));
})(),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48673,G__48674){
return G__48673.call(null,G__48674);
});})(G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.common.svg_scale,weathergen.ui.map_icon_scale),(function (){var con__29830__auto__ = (new cljs.core.Delay(((function (G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"squadron icons",new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_translate.call(null,0.5,(0)),(function (){var squadron_icon_scale = 0.6;
var squadrons = javelin.core.formula.call(null,((function (squadron_icon_scale,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (airbase__$1,included_squadrons){
return cljs.core.first.call(null,cljs.core.reduce.call(null,((function (squadron_icon_scale,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__48675,squadron){
var vec__48676 = p__48675;
var squadrons = cljs.core.nth.call(null,vec__48676,(0),null);
var cum_width = cljs.core.nth.call(null,vec__48676,(1),null);
var width__$1 = cljs.core.first.call(null,new cljs.core.Keyword(null,"size","size",1098693007).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"image-data","image-data",-377483758).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(squadron))));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.conj.call(null,squadrons,cljs.core.assoc.call(null,squadron,new cljs.core.Keyword("weathergen.ui","x-offset","weathergen.ui/x-offset",666987585),cum_width)),((cum_width + ((width__$1 * icon_scale) * squadron_icon_scale)) + 0.1)], null);
});})(squadron_icon_scale,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.PersistentVector.EMPTY,(0)], null),cljs.core.filter.call(null,included_squadrons,new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase__$1))));
});})(squadron_icon_scale,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase,weathergen.ui.included_squadrons);
return hoplon.core.loop_tpl_STAR_.call(null,squadrons,((function (squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (item__29820__auto__){
var vec__48679 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (squadron){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [squadron], null);
});})(squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,item__29820__auto__));
var squadron = cljs.core.nth.call(null,vec__48679,(0),null);
var info = javelin.core.formula.call(null,((function (vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (squadron__$1){
var image = new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(squadron__$1);
var map__48682 = image;
var map__48682__$1 = ((((!((map__48682 == null)))?((((map__48682.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48682.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48682):map__48682);
var image_data = cljs.core.get.call(null,map__48682__$1,new cljs.core.Keyword(null,"image-data","image-data",-377483758));
var map__48683 = image_data;
var map__48683__$1 = ((((!((map__48683 == null)))?((((map__48683.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48683.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48683):map__48683);
var size = cljs.core.get.call(null,map__48683__$1,new cljs.core.Keyword(null,"size","size",1098693007));
var vec__48684 = size;
var w = cljs.core.nth.call(null,vec__48684,(0),null);
var h = cljs.core.nth.call(null,vec__48684,(1),null);
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"w","w",354169001),((icon_scale * squadron_icon_scale) * w),new cljs.core.Keyword(null,"h","h",1109658740),((icon_scale * squadron_icon_scale) * h),new cljs.core.Keyword(null,"src","src",-1651076051),weathergen.ui.common.get_image.call(null,mission,image)], null);
});})(vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,squadron);
return hoplon.svg.image.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),javelin.core.formula.call(null,((function (info,vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48689,G__48691,G__48690){
return G__48689.call(null,"ab/y: %f, ab/h: %f, sq/h: %f",new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__48690),new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48690),new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48691));
});})(info,vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,goog.string.format,info,dims),new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),javelin.core.formula.call(null,((function (info,vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48692){
return new cljs.core.Keyword(null,"src","src",-1651076051).cljs$core$IFn$_invoke$arity$1(G__48692);
});})(info,vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,info),new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (info,vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48694,G__48693){
return (new cljs.core.Keyword("weathergen.ui","x-offset","weathergen.ui/x-offset",666987585).cljs$core$IFn$_invoke$arity$1(G__48693) + (new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__48694) / (2)));
});})(info,vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims,squadron),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (info,vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48696,G__48695){
return (new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__48695) + (new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48695) - new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48696)));
});})(info,vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,info,dims),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (info,vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48697){
return new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__48697);
});})(info,vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,info),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (info,vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48698){
return new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48698);
});})(info,vec__48679,squadron,squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,info));
});})(squadron_icon_scale,squadrons,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
);
})());
});})(G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__29830__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__,G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,show_airbase_squadrons_QMARK_);
})(),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"airbase icon",hoplon.svg.image.call(null,new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),javelin.core.formula.call(null,((function (G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48701,G__48699,G__48700){
return G__48699.call(null,G__48700,new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(G__48701));
});})(G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase,weathergen.ui.common.get_image,mission),new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48702){
return new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__48702);
});})(G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48703){
return new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__48703);
});})(G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48704){
return new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__48704);
});})(G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48705){
return new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48705);
});})(G__48643,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims)))));
})()));
})());
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__29830__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,javelin.core.formula.call(null,((function (con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48706,G__48707){
var or__23338__auto__ = G__48706;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return G__48707;
}
});})(con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,visible_QMARK_,highlighted_QMARK_));
})());
});
weathergen.ui.airbases_info_overlay = hoplon.svg.g.call(null,new cljs.core.Keyword(null,"section","section",-300141526),"airbase-info",(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[hoplon.core.loop_tpl_STAR_.call(null,weathergen.ui.all_airbases,(function (item__29820__auto__){
var vec__48710 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,(function (airbase){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [airbase], null);
})).call(null,item__29820__auto__));
var airbase = cljs.core.nth.call(null,vec__48710,(0),null);
return weathergen.ui.airbase_info_overlay.call(null,weathergen.ui.mission,airbase);
})),hoplon.svg.use.call(null,new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),javelin.core.formula.call(null,(function (G__48713,G__48714){
return G__48713.call(null,G__48714);
})).call(null,weathergen.ui.airbase_info_id,weathergen.ui.highlighted_airbase))],null)));
/**
 * Return true if the specified coordinates fall within the wind
 *   stability area.
 */
weathergen.ui.within_area_QMARK_ = (function weathergen$ui$within_area_QMARK_(area,cell){
var map__48721 = area;
var map__48721__$1 = ((((!((map__48721 == null)))?((((map__48721.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48721.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48721):map__48721);
var bounds = cljs.core.get.call(null,map__48721__$1,new cljs.core.Keyword(null,"bounds","bounds",1691609455));
var map__48722 = bounds;
var map__48722__$1 = ((((!((map__48722 == null)))?((((map__48722.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48722.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48722):map__48722);
var x = cljs.core.get.call(null,map__48722__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__48722__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__48722__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__48722__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var left = x;
var top = y;
var right = (x + width);
var bottom = (y + height);
var map__48723 = cell;
var map__48723__$1 = ((((!((map__48723 == null)))?((((map__48723.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48723.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48723):map__48723);
var x__$1 = cljs.core.get.call(null,map__48723__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y__$1 = cljs.core.get.call(null,map__48723__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
return (((left <= x__$1)) && ((x__$1 <= right))) && (((top <= y__$1)) && ((y__$1 <= bottom)));
});
/**
 * Returns true if the specified coordinates fall within the weather
 *   override.
 */
weathergen.ui.within_override_QMARK_ = (function weathergen$ui$within_override_QMARK_(override,cell){
var map__48733 = override;
var map__48733__$1 = ((((!((map__48733 == null)))?((((map__48733.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48733.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48733):map__48733);
var location = cljs.core.get.call(null,map__48733__$1,new cljs.core.Keyword(null,"location","location",1815599388));
var radius = cljs.core.get.call(null,map__48733__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
var map__48734 = location;
var map__48734__$1 = ((((!((map__48734 == null)))?((((map__48734.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48734.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48734):map__48734);
var x = cljs.core.get.call(null,map__48734__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__48734__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var cx = x;
var cy = y;
var map__48735 = cell;
var map__48735__$1 = ((((!((map__48735 == null)))?((((map__48735.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48735.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48735):map__48735);
var x__$1 = cljs.core.get.call(null,map__48735__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y__$1 = cljs.core.get.call(null,map__48735__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var dx = (cx - x__$1);
var dy = (cy - y__$1);
return (((dx * dx) + (dy * dy)) < (radius * radius));
});
/**
 * Renders the UI for display of bullseye.
 */
weathergen.ui.bullseye_overlay = (function weathergen$ui$bullseye_overlay(mission){
var con__29830__auto__ = (new cljs.core.Delay((function (){
var stroke_width = 0.025;
var bw = javelin.core.formula.call(null,((function (stroke_width){
return (function (mission__$1){
var map__48785 = mission__$1;
var map__48785__$1 = ((((!((map__48785 == null)))?((((map__48785.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48785.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48785):map__48785);
var campaign_info = cljs.core.get.call(null,map__48785__$1,new cljs.core.Keyword(null,"campaign-info","campaign-info",1158908966));
var map__48786 = campaign_info;
var map__48786__$1 = ((((!((map__48786 == null)))?((((map__48786.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48786.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48786):map__48786);
var bx = cljs.core.get.call(null,map__48786__$1,new cljs.core.Keyword(null,"bullseye-x","bullseye-x",-1698783852));
var by = cljs.core.get.call(null,map__48786__$1,new cljs.core.Keyword(null,"bullseye-y","bullseye-y",904460818));
return weathergen.coordinates.fgrid__GT_weather.call(null,mission__$1,bx,by);
});})(stroke_width))
).call(null,mission);
var bx = javelin.core.formula.call(null,((function (stroke_width,bw){
return (function (G__48789){
return new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__48789);
});})(stroke_width,bw))
).call(null,bw);
var by = javelin.core.formula.call(null,((function (stroke_width,bw,bx){
return (function (G__48790){
return new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__48790);
});})(stroke_width,bw,bx))
).call(null,bw);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"debug","debug",-1608172596),"bullseye"], null),new cljs.core.Keyword("svg","transform","svg/transform",1381351328),javelin.core.formula.call(null,((function (stroke_width,bw,bx,by){
return (function (G__48791,G__48792,G__48793){
return G__48791.call(null,G__48792,G__48793);
});})(stroke_width,bw,bx,by))
).call(null,weathergen.ui.common.svg_translate,bx,by),(function (){var iter__24200__auto__ = ((function (stroke_width,bw,bx,by){
return (function weathergen$ui$bullseye_overlay_$_iter__48794(s__48795){
return (new cljs.core.LazySeq(null,((function (stroke_width,bw,bx,by){
return (function (){
var s__48795__$1 = s__48795;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__48795__$1);
if(temp__5278__auto__){
var s__48795__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48795__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__48795__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__48797 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__48796 = (0);
while(true){
if((i__48796 < size__24199__auto__)){
var r = cljs.core._nth.call(null,c__24198__auto__,i__48796);
cljs.core.chunk_append.call(null,b__48797,hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),stroke_width,new cljs.core.Keyword(null,"cx","cx",1272694324),(0),new cljs.core.Keyword(null,"cy","cy",755331060),(0),new cljs.core.Keyword(null,"r","r",-471384190),javelin.core.formula.call(null,((function (i__48796,r,c__24198__auto__,size__24199__auto__,b__48797,s__48795__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__48806,G__48804,G__48805){
return G__48804.call(null,G__48805,G__48806);
});})(i__48796,r,c__24198__auto__,size__24199__auto__,b__48797,s__48795__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,r,weathergen.coordinates.nm__GT_weather,mission)));

var G__48831 = (i__48796 + (1));
i__48796 = G__48831;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48797),weathergen$ui$bullseye_overlay_$_iter__48794.call(null,cljs.core.chunk_rest.call(null,s__48795__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48797),null);
}
} else {
var r = cljs.core.first.call(null,s__48795__$2);
return cljs.core.cons.call(null,hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),stroke_width,new cljs.core.Keyword(null,"cx","cx",1272694324),(0),new cljs.core.Keyword(null,"cy","cy",755331060),(0),new cljs.core.Keyword(null,"r","r",-471384190),javelin.core.formula.call(null,((function (r,s__48795__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__48809,G__48807,G__48808){
return G__48807.call(null,G__48808,G__48809);
});})(r,s__48795__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,r,weathergen.coordinates.nm__GT_weather,mission)),weathergen$ui$bullseye_overlay_$_iter__48794.call(null,cljs.core.rest.call(null,s__48795__$2)));
}
} else {
return null;
}
break;
}
});})(stroke_width,bw,bx,by))
,null,null));
});})(stroke_width,bw,bx,by))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,(30),(200),(30)));
})(),(function (){var iter__24200__auto__ = ((function (stroke_width,bw,bx,by){
return (function weathergen$ui$bullseye_overlay_$_iter__48810(s__48811){
return (new cljs.core.LazySeq(null,((function (stroke_width,bw,bx,by){
return (function (){
var s__48811__$1 = s__48811;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__48811__$1);
if(temp__5278__auto__){
var s__48811__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48811__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__48811__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__48813 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__48812 = (0);
while(true){
if((i__48812 < size__24199__auto__)){
var theta = cljs.core._nth.call(null,c__24198__auto__,i__48812);
cljs.core.chunk_append.call(null,b__48813,hoplon.svg.line.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_rotate.call(null,theta)], null),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),stroke_width,new cljs.core.Keyword(null,"x1","x1",-1863922247),(0),new cljs.core.Keyword(null,"y1","y1",589123466),javelin.core.formula.call(null,((function (i__48812,theta,c__24198__auto__,size__24199__auto__,b__48813,s__48811__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__48822,G__48823){
return G__48822.call(null,G__48823,(-200));
});})(i__48812,theta,c__24198__auto__,size__24199__auto__,b__48813,s__48811__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission),new cljs.core.Keyword(null,"x2","x2",-1362513475),(0),new cljs.core.Keyword(null,"y2","y2",-718691301),javelin.core.formula.call(null,((function (i__48812,theta,c__24198__auto__,size__24199__auto__,b__48813,s__48811__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__48824,G__48825){
return G__48824.call(null,G__48825,(200));
});})(i__48812,theta,c__24198__auto__,size__24199__auto__,b__48813,s__48811__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission)));

var G__48832 = (i__48812 + (1));
i__48812 = G__48832;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48813),weathergen$ui$bullseye_overlay_$_iter__48810.call(null,cljs.core.chunk_rest.call(null,s__48811__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48813),null);
}
} else {
var theta = cljs.core.first.call(null,s__48811__$2);
return cljs.core.cons.call(null,hoplon.svg.line.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_rotate.call(null,theta)], null),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),stroke_width,new cljs.core.Keyword(null,"x1","x1",-1863922247),(0),new cljs.core.Keyword(null,"y1","y1",589123466),javelin.core.formula.call(null,((function (theta,s__48811__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__48826,G__48827){
return G__48826.call(null,G__48827,(-200));
});})(theta,s__48811__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission),new cljs.core.Keyword(null,"x2","x2",-1362513475),(0),new cljs.core.Keyword(null,"y2","y2",-718691301),javelin.core.formula.call(null,((function (theta,s__48811__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__48828,G__48829){
return G__48828.call(null,G__48829,(200));
});})(theta,s__48811__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission)),weathergen$ui$bullseye_overlay_$_iter__48810.call(null,cljs.core.rest.call(null,s__48811__$2)));
}
} else {
return null;
}
break;
}
});})(stroke_width,bw,bx,by))
,null,null));
});})(stroke_width,bw,bx,by))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,(0),(180),(30)));
})());
}),null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__){
return (function (){
return null;
});})(con__29830__auto__))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,javelin.core.formula.call(null,((function (con__29830__auto__,alt__29831__auto__,tpl__29832__auto__){
return (function (G__48830){
return new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003).cljs$core$IFn$_invoke$arity$1(G__48830);
});})(con__29830__auto__,alt__29831__auto__,tpl__29832__auto__))
).call(null,weathergen.ui.map_display));
});
/**
 * Given a map pan as an x/y map, return a new map that doesn't permit showing areas outside the map.
 */
weathergen.ui.limit_pan = (function weathergen$ui$limit_pan(p__48833,zoom,p__48834){
var vec__48840 = p__48833;
var nx = cljs.core.nth.call(null,vec__48840,(0),null);
var ny = cljs.core.nth.call(null,vec__48840,(1),null);
var map__48843 = p__48834;
var map__48843__$1 = ((((!((map__48843 == null)))?((((map__48843.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48843.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48843):map__48843);
var x = cljs.core.get.call(null,map__48843__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__48843__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = (nx / zoom);
var height = (ny / zoom);
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),weathergen.math.clamp.call(null,(0),(nx - width),x),new cljs.core.Keyword(null,"y","y",-1757859776),weathergen.math.clamp.call(null,(0),(ny - height),y)], null);
});
/**
 * Converts an x/y offset in pixels to an x/y offset in weatherspace units.
 */
weathergen.ui.pixels__GT_weather = (function weathergen$ui$pixels__GT_weather(p__48845){
var vec__48855 = p__48845;
var dx = cljs.core.nth.call(null,vec__48855,(0),null);
var dy = cljs.core.nth.call(null,vec__48855,(1),null);
var zoom = cljs.core.deref.call(null,weathergen.ui.map_zoom);
var vec__48858 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params));
var nx = cljs.core.nth.call(null,vec__48858,(0),null);
var ny = cljs.core.nth.call(null,vec__48858,(1),null);
var vec__48861 = cljs.core.deref.call(null,weathergen.ui.map_size);
var width = cljs.core.nth.call(null,vec__48861,(0),null);
var height = cljs.core.nth.call(null,vec__48861,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(((dx * nx) / width) / zoom),(((dy * ny) / height) / zoom)], null);
});
/**
 * Changes the map zoom by a factor of `amount`, centered on `[cx cy]`
 *   coordinates in weather space, which has dimensions `[nx ny]`.
 */
weathergen.ui.zoom_map_BANG_ = (function weathergen$ui$zoom_map_BANG_(p__48864,amount){
var vec__48873 = p__48864;
var cx = cljs.core.nth.call(null,vec__48873,(0),null);
var cy = cljs.core.nth.call(null,vec__48873,(1),null);
var vec__48876 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params));
var nx = cljs.core.nth.call(null,vec__48876,(0),null);
var ny = cljs.core.nth.call(null,vec__48876,(1),null);
var map__48879 = cljs.core.deref.call(null,weathergen.ui.map_pan);
var map__48879__$1 = ((((!((map__48879 == null)))?((((map__48879.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48879.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48879):map__48879);
var px0 = cljs.core.get.call(null,map__48879__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var py0 = cljs.core.get.call(null,map__48879__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var z_SINGLEQUOTE_ = weathergen.math.clamp.call(null,weathergen.ui.zoom_min,weathergen.ui.zoom_max,(amount * cljs.core.deref.call(null,weathergen.ui.map_zoom)));
var dz = (z_SINGLEQUOTE_ / cljs.core.deref.call(null,weathergen.ui.map_zoom));
var px1 = (cx - ((cx - px0) / dz));
var py1 = (cy - ((cy - py0) / dz));
var px = ((px1 - px0) + px0);
var py = ((py1 - py0) + py0);
return javelin.core.dosync_STAR_.call(null,((function (vec__48876,nx,ny,map__48879,map__48879__$1,px0,py0,z_SINGLEQUOTE_,dz,px1,py1,px,py,vec__48873,cx,cy){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.map_zoom,z_SINGLEQUOTE_);

return cljs.core.reset_BANG_.call(null,weathergen.ui.map_pan,weathergen.ui.limit_pan.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [nx,ny], null),z_SINGLEQUOTE_,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),px,new cljs.core.Keyword(null,"y","y",-1757859776),py], null)));
});})(vec__48876,nx,ny,map__48879,map__48879__$1,px0,py0,z_SINGLEQUOTE_,dz,px1,py1,px,py,vec__48873,cx,cy))
);
});
/**
 * @param {...*} var_args
 */
weathergen.ui.grid = (function() { 
var weathergen$ui$grid__delegate = function (args__29776__auto__){
var vec__48988 = hoplon.core.parse_args.call(null,args__29776__auto__);
var map__48991 = cljs.core.nth.call(null,vec__48988,(0),null);
var map__48991__$1 = ((((!((map__48991 == null)))?((((map__48991.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48991.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48991):map__48991);
var attrs = map__48991__$1;
var display_params = cljs.core.get.call(null,map__48991__$1,new cljs.core.Keyword(null,"display-params","display-params",573405707));
var selected_cell = cljs.core.get.call(null,map__48991__$1,new cljs.core.Keyword(null,"selected-cell","selected-cell",1638390443));
var weather_data = cljs.core.get.call(null,map__48991__$1,new cljs.core.Keyword(null,"weather-data","weather-data",-664219401));
var wind_stability_areas = cljs.core.get.call(null,map__48991__$1,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204));
var weather_overrides = cljs.core.get.call(null,map__48991__$1,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710));
var pressure_unit = cljs.core.get.call(null,map__48991__$1,new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243));
var computing = cljs.core.get.call(null,map__48991__$1,new cljs.core.Keyword(null,"computing","computing",-1002386157));
var nx = cljs.core.get.call(null,map__48991__$1,new cljs.core.Keyword(null,"nx","nx",-1996436366));
var ny = cljs.core.get.call(null,map__48991__$1,new cljs.core.Keyword(null,"ny","ny",1701791641));
var drag_handler = cljs.core.atom.call(null,null);
var drag_start = cljs.core.atom.call(null,null);
var register_drag_handler = ((function (drag_handler,drag_start,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (h){
return cljs.core.swap_BANG_.call(null,drag_handler,((function (drag_handler,drag_start,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p1__48881_SHARP_){
var or__23338__auto__ = p1__48881_SHARP_;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return h;
}
});})(drag_handler,drag_start,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
);
});})(drag_handler,drag_start,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;
var doc_move = ((function (drag_handler,drag_start,register_drag_handler,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (e){
var temp__5276__auto__ = cljs.core.deref.call(null,drag_handler);
if(cljs.core.truth_(temp__5276__auto__)){
var h = temp__5276__auto__;
var x = (e["offsetX"]);
var y = (e["offsetY"]);
var vec__48993 = cljs.core.deref.call(null,drag_start);
var sx = cljs.core.nth.call(null,vec__48993,(0),null);
var sy = cljs.core.nth.call(null,vec__48993,(1),null);
var dx = (x - sx);
var dy = (y - sy);
h.call(null,weathergen.ui.pixels__GT_weather.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dx,dy], null)),false);

return e.preventDefault();
} else {
return null;
}
});})(drag_handler,drag_start,register_drag_handler,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;
var doc_up = ((function (drag_handler,drag_start,register_drag_handler,doc_move,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function weathergen$ui$grid_$_doc_up(e){
var temp__5278__auto___49093 = cljs.core.deref.call(null,drag_handler);
if(cljs.core.truth_(temp__5278__auto___49093)){
var h_49094 = temp__5278__auto___49093;
var x_49095 = (e["offsetX"]);
var y_49096 = (e["offsetY"]);
var vec__48999_49097 = cljs.core.deref.call(null,drag_start);
var sx_49098 = cljs.core.nth.call(null,vec__48999_49097,(0),null);
var sy_49099 = cljs.core.nth.call(null,vec__48999_49097,(1),null);
var dx_49100 = (x_49095 - sx_49098);
var dy_49101 = (y_49096 - sy_49099);
h_49094.call(null,weathergen.ui.pixels__GT_weather.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dx_49100,dy_49101], null)),true);
} else {
}

cljs.core.reset_BANG_.call(null,drag_start,null);

return cljs.core.reset_BANG_.call(null,drag_handler,null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;
var _ = document.addEventListener("mousemove",doc_move);
var ___$1 = document.addEventListener("mouseup",doc_up);
var brightness_layer = hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"brightness-layer",new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"width","width",-384071477),nx,new cljs.core.Keyword(null,"height","height",1025178622),ny,new cljs.core.Keyword(null,"fill","fill",883462889),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (map_display){
var brightness = new cljs.core.Keyword(null,"brightness","brightness",1067055820).cljs$core$IFn$_invoke$arity$1(map_display);
return cljs.core.apply.call(null,goog.string.format,"rgba(%d,%d,%d,%f)",(((0.5 <= brightness))?new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(255),((brightness - 0.5) / 0.5)], null):new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(0),(0),((brightness - 0.5) / -0.5)], null)));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.map_display));
var primary_layer = hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"primary-layer",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49002){
return cljs.core.not.call(null,(new cljs.core.Keyword(null,"display","display",242065432).cljs$core$IFn$_invoke$arity$1(G__49002) == null));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params),new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49003){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"opacity","opacity",397153780),new cljs.core.Keyword(null,"opacity","opacity",397153780).cljs$core$IFn$_invoke$arity$1(G__49003)], null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params));
var wind_overlay = hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"wind-overlay",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49004,G__49005){
return G__49004.call(null,new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(G__49005),new cljs.core.Keyword(null,"wind","wind",-527553074));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,cljs.core._EQ_,display_params));
var text_overlay = hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"text-overlay",new cljs.core.Keyword(null,"attr","attr",-604132353),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49008,G__49007){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("text-overlay "),cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var G__49006 = G__49007;
var G__49006__$1 = (cljs.core.truth_((G__49006 == null))?null:new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(G__49006));
if(cljs.core.truth_((G__49006__$1 == null))){
return null;
} else {
return G__49008.call(null,G__49006__$1);
}
})())].join('')], null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,cljs.core.name,display_params),new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49009){
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"pressure","pressure",505343747),null,new cljs.core.Keyword(null,"type","type",1174270348),null,new cljs.core.Keyword(null,"temperature","temperature",899018429),null], null), null).call(null,new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(G__49009));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params));
var selected_cell_overlay = (function (){var coords = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49010){
return new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(G__49010);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,selected_cell);
var vec__49017 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p__49020){
var vec__49021 = p__49020;
var x = cljs.core.nth.call(null,vec__49021,(0),null);
var y = cljs.core.nth.call(null,vec__49021,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null);
});})(coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,coords));
var x = cljs.core.nth.call(null,vec__49017,(0),null);
var y = cljs.core.nth.call(null,vec__49017,(1),null);
var con__29830__auto__ = (new cljs.core.Delay(((function (vec__49017,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"selected-cell-overlay",new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__49017,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,null);
});})(vec__49017,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),(1),new cljs.core.Keyword(null,"height","height",1025178622),(1));
});})(vec__49017,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__,vec__49017,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return null;
});})(con__29830__auto__,vec__49017,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__,vec__49017,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__,vec__49017,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,javelin.core.formula.call(null,((function (con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,vec__49017,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (x__$1,y__$1){
var and__23326__auto__ = x__$1;
if(cljs.core.truth_(and__23326__auto__)){
return y__$1;
} else {
return and__23326__auto__;
}
});})(con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,vec__49017,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,x,y));
})();
var wind_stability_areas__$1 = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (weather_params){
return new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204).cljs$core$IFn$_invoke$arity$1(weather_params);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.weather_params);
var weather_overrides__$1 = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (weather_params){
return new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(weather_params);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.weather_params);
var effective_hover_cell = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (hover_cell,wind_stability_areas__$2,weather_overrides__$2){
if(cljs.core.truth_((function (){var or__23338__auto__ = cljs.core.some.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (area){
var and__23326__auto__ = weathergen.ui.within_area_QMARK_.call(null,area,hover_cell);
if(cljs.core.truth_(and__23326__auto__)){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(area);
} else {
return and__23326__auto__;
}
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,wind_stability_areas__$2);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.some.call(null,((function (or__23338__auto__,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (override){
var and__23326__auto__ = weathergen.ui.within_override_QMARK_.call(null,override,hover_cell);
if(cljs.core.truth_(and__23326__auto__)){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(override);
} else {
return and__23326__auto__;
}
});})(or__23338__auto__,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,weather_overrides__$2);
}
})())){
return null;
} else {
return hover_cell;
}
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.hover_cell,wind_stability_areas__$1,weather_overrides__$1);
var elem = hoplon.svg.svg.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"grid",(function (){var dims = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (map_size){
return cljs.core.map.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p1__48882_SHARP_){
return (p1__48882_SHARP_ - (7));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,map_size);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.map_size);
return cljs.core.assoc.call(null,cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"display-params","display-params",573405707),new cljs.core.Keyword(null,"selected-cell","selected-cell",1638390443),new cljs.core.Keyword(null,"weather-data","weather-data",-664219401),new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710)),new cljs.core.Keyword(null,"viewBox","viewBox",-469489477),javelin.core.formula.call(null,((function (dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (map_viewbox){
var map__49024 = map_viewbox;
var map__49024__$1 = ((((!((map__49024 == null)))?((((map__49024.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49024.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49024):map__49024);
var x = cljs.core.get.call(null,map__49024__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__49024__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__49024__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__49024__$1,new cljs.core.Keyword(null,"height","height",1025178622));
return goog.string.format("%f %f %f %f",x,y,width,height);
});})(dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.map_viewbox),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49026,G__49027){
return G__49026.call(null,G__49027);
});})(dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,cljs.core.first,dims),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49028,G__49029){
return G__49028.call(null,G__49029);
});})(dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,cljs.core.second,dims),new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 2, ["xmlns:xlink","http://www.w3.org/1999/xlink","xmlns","http://www.w3.org/2000/svg"], null));
})(),new cljs.core.Keyword(null,"mousemove","mousemove",-1077794734),((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (e){
return javelin.core.dosync_STAR_.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.mouse_raw_offset,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(e["offsetX"]),(e["offsetY"])], null));

return cljs.core.reset_BANG_.call(null,weathergen.ui.mouse_location,(function (){var vec__49030 = weathergen.ui.mouse_weather_coords.call(null,e);
var x = cljs.core.nth.call(null,vec__49030,(0),null);
var y = cljs.core.nth.call(null,vec__49030,(1),null);
if(((((0) <= x)) && ((x <= nx))) && ((((0) <= y)) && ((y <= ny)))){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y], null);
} else {
return null;
}
})());
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,new cljs.core.Keyword(null,"mouseleave","mouseleave",531566580),((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (___$2){
return javelin.core.dosync_STAR_.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.hover_cell,null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (e){
console.log(e);

cljs.core.reset_BANG_.call(null,drag_start,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(e["offsetX"]),(e["offsetY"])], null));

if(cljs.core.truth_(cljs.core.deref.call(null,drag_handler))){
return null;
} else {
var map__49033 = cljs.core.deref.call(null,weathergen.ui.map_pan);
var map__49033__$1 = ((((!((map__49033 == null)))?((((map__49033.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49033.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49033):map__49033);
var px0 = cljs.core.get.call(null,map__49033__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var py0 = cljs.core.get.call(null,map__49033__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
return register_drag_handler.call(null,((function (map__49033,map__49033__$1,px0,py0,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p__49035,final_QMARK_){
var vec__49036 = p__49035;
var dx = cljs.core.nth.call(null,vec__49036,(0),null);
var dy = cljs.core.nth.call(null,vec__49036,(1),null);
var browser_zoom = window.devicePixelRatio;
return cljs.core.reset_BANG_.call(null,weathergen.ui.map_pan,weathergen.ui.limit_pan.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)),cljs.core.deref.call(null,weathergen.ui.map_zoom),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),(px0 - dx),new cljs.core.Keyword(null,"y","y",-1757859776),(py0 - dy)], null)));
});})(map__49033,map__49033__$1,px0,py0,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
);
}
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,new cljs.core.Keyword(null,"dragstart","dragstart",955864218),cljs.core.constantly.call(null,false),weathergen.ui.wind_vector_defs.call(null),hoplon.svg.image.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"map-image",new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49040,G__49039){
if(cljs.core.not.call(null,G__49039)){
return "images/kto.jpg";
} else {
return G__49040.call(null,G__49039,new cljs.core.Keyword(null,"map-image","map-image",-5560498).cljs$core$IFn$_invoke$arity$1(G__49039));
}
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.common.get_image,weathergen.ui.mission),new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"width","width",-384071477),nx,new cljs.core.Keyword(null,"height","height",1025178622),ny),brightness_layer,primary_layer,weathergen.ui.bullseye_overlay.call(null,weathergen.ui.mission),wind_overlay,text_overlay,weathergen.ui.wind_stability_overlay.call(null,weathergen.ui.weather_params,register_drag_handler),weathergen.ui.weather_overrides_overlay.call(null,weathergen.ui.weather_params,register_drag_handler),selected_cell_overlay,new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(weathergen.ui.flight_paths_layer),weathergen.ui.airbases_info_overlay,weathergen.ui.bullseye_info_box.call(null));
goog.events.listen((new goog.events.MouseWheelHandler(elem)),goog.events.MouseWheelHandler.EventType.MOUSEWHEEL,((function (elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (e){
e.preventDefault();

var amount = Math.pow(cljs.core.deref.call(null,weathergen.ui.zoom_speed),(e["deltaY"]));
return weathergen.ui.zoom_map_BANG_.call(null,weathergen.ui.mouse_weather_coords.call(null,e),amount);
});})(elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
);

hoplon.core.add_initfn_BANG_.call(null,((function (elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
var timer_name__15521__auto___49102 = "Initial create";
var ignore__15522__auto___49103 = console.time(timer_name__15521__auto___49102);
var result__15523__auto___49104 = (function (){
var frag_49105 = document.createDocumentFragment();
var seq__49041_49106 = cljs.core.seq.call(null,cljs.core.range.call(null,nx));
var chunk__49046_49107 = null;
var count__49047_49108 = (0);
var i__49048_49109 = (0);
while(true){
if((i__49048_49109 < count__49047_49108)){
var x_49110 = cljs.core._nth.call(null,chunk__49046_49107,i__49048_49109);
var seq__49049_49111 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__49050_49112 = null;
var count__49051_49113 = (0);
var i__49052_49114 = (0);
while(true){
if((i__49052_49114 < count__49051_49113)){
var y_49115 = cljs.core._nth.call(null,chunk__49050_49112,i__49052_49114);
var r_49116 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__49053_49117 = r_49116;
G__49053_49117.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49110),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49115)].join(''));

G__49053_49117.setAttribute("x",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49110)].join(''));

G__49053_49117.setAttribute("y",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49115)].join(''));

G__49053_49117.setAttribute("width","1");

G__49053_49117.setAttribute("height","1");

G__49053_49117.setAttribute("fill","none");

G__49053_49117.onclick = ((function (seq__49049_49111,chunk__49050_49112,count__49051_49113,i__49052_49114,seq__49041_49106,chunk__49046_49107,count__49047_49108,i__49048_49109,G__49053_49117,r_49116,y_49115,x_49110,frag_49105,timer_name__15521__auto___49102,ignore__15522__auto___49103,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x_49110,y_49115], null)], null));
});})(seq__49049_49111,chunk__49050_49112,count__49051_49113,i__49052_49114,seq__49041_49106,chunk__49046_49107,count__49047_49108,i__49048_49109,G__49053_49117,r_49116,y_49115,x_49110,frag_49105,timer_name__15521__auto___49102,ignore__15522__auto___49103,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_49105,r_49116);

var G__49118 = seq__49049_49111;
var G__49119 = chunk__49050_49112;
var G__49120 = count__49051_49113;
var G__49121 = (i__49052_49114 + (1));
seq__49049_49111 = G__49118;
chunk__49050_49112 = G__49119;
count__49051_49113 = G__49120;
i__49052_49114 = G__49121;
continue;
} else {
var temp__5278__auto___49122 = cljs.core.seq.call(null,seq__49049_49111);
if(temp__5278__auto___49122){
var seq__49049_49123__$1 = temp__5278__auto___49122;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49049_49123__$1)){
var c__24249__auto___49124 = cljs.core.chunk_first.call(null,seq__49049_49123__$1);
var G__49125 = cljs.core.chunk_rest.call(null,seq__49049_49123__$1);
var G__49126 = c__24249__auto___49124;
var G__49127 = cljs.core.count.call(null,c__24249__auto___49124);
var G__49128 = (0);
seq__49049_49111 = G__49125;
chunk__49050_49112 = G__49126;
count__49051_49113 = G__49127;
i__49052_49114 = G__49128;
continue;
} else {
var y_49129 = cljs.core.first.call(null,seq__49049_49123__$1);
var r_49130 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__49054_49131 = r_49130;
G__49054_49131.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49110),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49129)].join(''));

G__49054_49131.setAttribute("x",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49110)].join(''));

G__49054_49131.setAttribute("y",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49129)].join(''));

G__49054_49131.setAttribute("width","1");

G__49054_49131.setAttribute("height","1");

G__49054_49131.setAttribute("fill","none");

G__49054_49131.onclick = ((function (seq__49049_49111,chunk__49050_49112,count__49051_49113,i__49052_49114,seq__49041_49106,chunk__49046_49107,count__49047_49108,i__49048_49109,G__49054_49131,r_49130,y_49129,seq__49049_49123__$1,temp__5278__auto___49122,x_49110,frag_49105,timer_name__15521__auto___49102,ignore__15522__auto___49103,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x_49110,y_49129], null)], null));
});})(seq__49049_49111,chunk__49050_49112,count__49051_49113,i__49052_49114,seq__49041_49106,chunk__49046_49107,count__49047_49108,i__49048_49109,G__49054_49131,r_49130,y_49129,seq__49049_49123__$1,temp__5278__auto___49122,x_49110,frag_49105,timer_name__15521__auto___49102,ignore__15522__auto___49103,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_49105,r_49130);

var G__49132 = cljs.core.next.call(null,seq__49049_49123__$1);
var G__49133 = null;
var G__49134 = (0);
var G__49135 = (0);
seq__49049_49111 = G__49132;
chunk__49050_49112 = G__49133;
count__49051_49113 = G__49134;
i__49052_49114 = G__49135;
continue;
}
} else {
}
}
break;
}

var G__49136 = seq__49041_49106;
var G__49137 = chunk__49046_49107;
var G__49138 = count__49047_49108;
var G__49139 = (i__49048_49109 + (1));
seq__49041_49106 = G__49136;
chunk__49046_49107 = G__49137;
count__49047_49108 = G__49138;
i__49048_49109 = G__49139;
continue;
} else {
var temp__5278__auto___49140 = cljs.core.seq.call(null,seq__49041_49106);
if(temp__5278__auto___49140){
var seq__49041_49141__$1 = temp__5278__auto___49140;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49041_49141__$1)){
var c__24249__auto___49142 = cljs.core.chunk_first.call(null,seq__49041_49141__$1);
var G__49143 = cljs.core.chunk_rest.call(null,seq__49041_49141__$1);
var G__49144 = c__24249__auto___49142;
var G__49145 = cljs.core.count.call(null,c__24249__auto___49142);
var G__49146 = (0);
seq__49041_49106 = G__49143;
chunk__49046_49107 = G__49144;
count__49047_49108 = G__49145;
i__49048_49109 = G__49146;
continue;
} else {
var x_49147 = cljs.core.first.call(null,seq__49041_49141__$1);
var seq__49042_49148 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__49043_49149 = null;
var count__49044_49150 = (0);
var i__49045_49151 = (0);
while(true){
if((i__49045_49151 < count__49044_49150)){
var y_49152 = cljs.core._nth.call(null,chunk__49043_49149,i__49045_49151);
var r_49153 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__49055_49154 = r_49153;
G__49055_49154.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49147),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49152)].join(''));

G__49055_49154.setAttribute("x",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49147)].join(''));

G__49055_49154.setAttribute("y",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49152)].join(''));

G__49055_49154.setAttribute("width","1");

G__49055_49154.setAttribute("height","1");

G__49055_49154.setAttribute("fill","none");

G__49055_49154.onclick = ((function (seq__49042_49148,chunk__49043_49149,count__49044_49150,i__49045_49151,seq__49041_49106,chunk__49046_49107,count__49047_49108,i__49048_49109,G__49055_49154,r_49153,y_49152,x_49147,seq__49041_49141__$1,temp__5278__auto___49140,frag_49105,timer_name__15521__auto___49102,ignore__15522__auto___49103,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x_49147,y_49152], null)], null));
});})(seq__49042_49148,chunk__49043_49149,count__49044_49150,i__49045_49151,seq__49041_49106,chunk__49046_49107,count__49047_49108,i__49048_49109,G__49055_49154,r_49153,y_49152,x_49147,seq__49041_49141__$1,temp__5278__auto___49140,frag_49105,timer_name__15521__auto___49102,ignore__15522__auto___49103,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_49105,r_49153);

var G__49155 = seq__49042_49148;
var G__49156 = chunk__49043_49149;
var G__49157 = count__49044_49150;
var G__49158 = (i__49045_49151 + (1));
seq__49042_49148 = G__49155;
chunk__49043_49149 = G__49156;
count__49044_49150 = G__49157;
i__49045_49151 = G__49158;
continue;
} else {
var temp__5278__auto___49159__$1 = cljs.core.seq.call(null,seq__49042_49148);
if(temp__5278__auto___49159__$1){
var seq__49042_49160__$1 = temp__5278__auto___49159__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49042_49160__$1)){
var c__24249__auto___49161 = cljs.core.chunk_first.call(null,seq__49042_49160__$1);
var G__49162 = cljs.core.chunk_rest.call(null,seq__49042_49160__$1);
var G__49163 = c__24249__auto___49161;
var G__49164 = cljs.core.count.call(null,c__24249__auto___49161);
var G__49165 = (0);
seq__49042_49148 = G__49162;
chunk__49043_49149 = G__49163;
count__49044_49150 = G__49164;
i__49045_49151 = G__49165;
continue;
} else {
var y_49166 = cljs.core.first.call(null,seq__49042_49160__$1);
var r_49167 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__49056_49168 = r_49167;
G__49056_49168.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49147),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49166)].join(''));

G__49056_49168.setAttribute("x",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49147)].join(''));

G__49056_49168.setAttribute("y",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49166)].join(''));

G__49056_49168.setAttribute("width","1");

G__49056_49168.setAttribute("height","1");

G__49056_49168.setAttribute("fill","none");

G__49056_49168.onclick = ((function (seq__49042_49148,chunk__49043_49149,count__49044_49150,i__49045_49151,seq__49041_49106,chunk__49046_49107,count__49047_49108,i__49048_49109,G__49056_49168,r_49167,y_49166,seq__49042_49160__$1,temp__5278__auto___49159__$1,x_49147,seq__49041_49141__$1,temp__5278__auto___49140,frag_49105,timer_name__15521__auto___49102,ignore__15522__auto___49103,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x_49147,y_49166], null)], null));
});})(seq__49042_49148,chunk__49043_49149,count__49044_49150,i__49045_49151,seq__49041_49106,chunk__49046_49107,count__49047_49108,i__49048_49109,G__49056_49168,r_49167,y_49166,seq__49042_49160__$1,temp__5278__auto___49159__$1,x_49147,seq__49041_49141__$1,temp__5278__auto___49140,frag_49105,timer_name__15521__auto___49102,ignore__15522__auto___49103,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_49105,r_49167);

var G__49169 = cljs.core.next.call(null,seq__49042_49160__$1);
var G__49170 = null;
var G__49171 = (0);
var G__49172 = (0);
seq__49042_49148 = G__49169;
chunk__49043_49149 = G__49170;
count__49044_49150 = G__49171;
i__49045_49151 = G__49172;
continue;
}
} else {
}
}
break;
}

var G__49173 = cljs.core.next.call(null,seq__49041_49141__$1);
var G__49174 = null;
var G__49175 = (0);
var G__49176 = (0);
seq__49041_49106 = G__49173;
chunk__49046_49107 = G__49174;
count__49047_49108 = G__49175;
i__49048_49109 = G__49176;
continue;
}
} else {
}
}
break;
}

goog.dom.appendChild(primary_layer,frag_49105);

var frag_49177 = document.createDocumentFragment();
var seq__49057_49178 = cljs.core.seq.call(null,cljs.core.range.call(null,nx));
var chunk__49062_49179 = null;
var count__49063_49180 = (0);
var i__49064_49181 = (0);
while(true){
if((i__49064_49181 < count__49063_49180)){
var x_49182 = cljs.core._nth.call(null,chunk__49062_49179,i__49064_49181);
var seq__49065_49183 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__49066_49184 = null;
var count__49067_49185 = (0);
var i__49068_49186 = (0);
while(true){
if((i__49068_49186 < count__49067_49185)){
var y_49187 = cljs.core._nth.call(null,chunk__49066_49184,i__49068_49186);
var g_49188 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_49189 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__49069_49190 = g_49188;
G__49069_49190.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_49182 + 0.5),(y_49187 + 0.5)));


var G__49070_49191 = r_49189;
G__49070_49191.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49182),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49187)].join(''));


goog.dom.appendChild(g_49188,r_49189);

goog.dom.appendChild(frag_49177,g_49188);

var G__49192 = seq__49065_49183;
var G__49193 = chunk__49066_49184;
var G__49194 = count__49067_49185;
var G__49195 = (i__49068_49186 + (1));
seq__49065_49183 = G__49192;
chunk__49066_49184 = G__49193;
count__49067_49185 = G__49194;
i__49068_49186 = G__49195;
continue;
} else {
var temp__5278__auto___49196 = cljs.core.seq.call(null,seq__49065_49183);
if(temp__5278__auto___49196){
var seq__49065_49197__$1 = temp__5278__auto___49196;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49065_49197__$1)){
var c__24249__auto___49198 = cljs.core.chunk_first.call(null,seq__49065_49197__$1);
var G__49199 = cljs.core.chunk_rest.call(null,seq__49065_49197__$1);
var G__49200 = c__24249__auto___49198;
var G__49201 = cljs.core.count.call(null,c__24249__auto___49198);
var G__49202 = (0);
seq__49065_49183 = G__49199;
chunk__49066_49184 = G__49200;
count__49067_49185 = G__49201;
i__49068_49186 = G__49202;
continue;
} else {
var y_49203 = cljs.core.first.call(null,seq__49065_49197__$1);
var g_49204 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_49205 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__49071_49206 = g_49204;
G__49071_49206.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_49182 + 0.5),(y_49203 + 0.5)));


var G__49072_49207 = r_49205;
G__49072_49207.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49182),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49203)].join(''));


goog.dom.appendChild(g_49204,r_49205);

goog.dom.appendChild(frag_49177,g_49204);

var G__49208 = cljs.core.next.call(null,seq__49065_49197__$1);
var G__49209 = null;
var G__49210 = (0);
var G__49211 = (0);
seq__49065_49183 = G__49208;
chunk__49066_49184 = G__49209;
count__49067_49185 = G__49210;
i__49068_49186 = G__49211;
continue;
}
} else {
}
}
break;
}

var G__49212 = seq__49057_49178;
var G__49213 = chunk__49062_49179;
var G__49214 = count__49063_49180;
var G__49215 = (i__49064_49181 + (1));
seq__49057_49178 = G__49212;
chunk__49062_49179 = G__49213;
count__49063_49180 = G__49214;
i__49064_49181 = G__49215;
continue;
} else {
var temp__5278__auto___49216 = cljs.core.seq.call(null,seq__49057_49178);
if(temp__5278__auto___49216){
var seq__49057_49217__$1 = temp__5278__auto___49216;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49057_49217__$1)){
var c__24249__auto___49218 = cljs.core.chunk_first.call(null,seq__49057_49217__$1);
var G__49219 = cljs.core.chunk_rest.call(null,seq__49057_49217__$1);
var G__49220 = c__24249__auto___49218;
var G__49221 = cljs.core.count.call(null,c__24249__auto___49218);
var G__49222 = (0);
seq__49057_49178 = G__49219;
chunk__49062_49179 = G__49220;
count__49063_49180 = G__49221;
i__49064_49181 = G__49222;
continue;
} else {
var x_49223 = cljs.core.first.call(null,seq__49057_49217__$1);
var seq__49058_49224 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__49059_49225 = null;
var count__49060_49226 = (0);
var i__49061_49227 = (0);
while(true){
if((i__49061_49227 < count__49060_49226)){
var y_49228 = cljs.core._nth.call(null,chunk__49059_49225,i__49061_49227);
var g_49229 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_49230 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__49073_49231 = g_49229;
G__49073_49231.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_49223 + 0.5),(y_49228 + 0.5)));


var G__49074_49232 = r_49230;
G__49074_49232.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49223),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49228)].join(''));


goog.dom.appendChild(g_49229,r_49230);

goog.dom.appendChild(frag_49177,g_49229);

var G__49233 = seq__49058_49224;
var G__49234 = chunk__49059_49225;
var G__49235 = count__49060_49226;
var G__49236 = (i__49061_49227 + (1));
seq__49058_49224 = G__49233;
chunk__49059_49225 = G__49234;
count__49060_49226 = G__49235;
i__49061_49227 = G__49236;
continue;
} else {
var temp__5278__auto___49237__$1 = cljs.core.seq.call(null,seq__49058_49224);
if(temp__5278__auto___49237__$1){
var seq__49058_49238__$1 = temp__5278__auto___49237__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49058_49238__$1)){
var c__24249__auto___49239 = cljs.core.chunk_first.call(null,seq__49058_49238__$1);
var G__49240 = cljs.core.chunk_rest.call(null,seq__49058_49238__$1);
var G__49241 = c__24249__auto___49239;
var G__49242 = cljs.core.count.call(null,c__24249__auto___49239);
var G__49243 = (0);
seq__49058_49224 = G__49240;
chunk__49059_49225 = G__49241;
count__49060_49226 = G__49242;
i__49061_49227 = G__49243;
continue;
} else {
var y_49244 = cljs.core.first.call(null,seq__49058_49238__$1);
var g_49245 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_49246 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__49075_49247 = g_49245;
G__49075_49247.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_49223 + 0.5),(y_49244 + 0.5)));


var G__49076_49248 = r_49246;
G__49076_49248.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49223),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49244)].join(''));


goog.dom.appendChild(g_49245,r_49246);

goog.dom.appendChild(frag_49177,g_49245);

var G__49249 = cljs.core.next.call(null,seq__49058_49238__$1);
var G__49250 = null;
var G__49251 = (0);
var G__49252 = (0);
seq__49058_49224 = G__49249;
chunk__49059_49225 = G__49250;
count__49060_49226 = G__49251;
i__49061_49227 = G__49252;
continue;
}
} else {
}
}
break;
}

var G__49253 = cljs.core.next.call(null,seq__49057_49217__$1);
var G__49254 = null;
var G__49255 = (0);
var G__49256 = (0);
seq__49057_49178 = G__49253;
chunk__49062_49179 = G__49254;
count__49063_49180 = G__49255;
i__49064_49181 = G__49256;
continue;
}
} else {
}
}
break;
}

goog.dom.appendChild(wind_overlay,frag_49177);

var frag = document.createDocumentFragment();
var scale = 0.03;
var seq__49077_49257 = cljs.core.seq.call(null,cljs.core.range.call(null,nx));
var chunk__49082_49258 = null;
var count__49083_49259 = (0);
var i__49084_49260 = (0);
while(true){
if((i__49084_49260 < count__49083_49259)){
var x_49261 = cljs.core._nth.call(null,chunk__49082_49258,i__49084_49260);
var seq__49085_49262 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__49086_49263 = null;
var count__49087_49264 = (0);
var i__49088_49265 = (0);
while(true){
if((i__49088_49265 < count__49087_49264)){
var y_49266 = cljs.core._nth.call(null,chunk__49086_49263,i__49088_49265);
var t_49267 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__49089_49268 = t_49267;
G__49089_49268.setAttribute("transform",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_scale.call(null,scale)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_translate.call(null,((x_49261 + 0.5) / scale),((y_49266 + 0.9) / scale)))].join(''));

G__49089_49268.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-text-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49261),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49266)].join(''));

G__49089_49268.setAttribute("text-anchor","middle");


goog.dom.appendChild(frag,t_49267);

var G__49269 = seq__49085_49262;
var G__49270 = chunk__49086_49263;
var G__49271 = count__49087_49264;
var G__49272 = (i__49088_49265 + (1));
seq__49085_49262 = G__49269;
chunk__49086_49263 = G__49270;
count__49087_49264 = G__49271;
i__49088_49265 = G__49272;
continue;
} else {
var temp__5278__auto___49273 = cljs.core.seq.call(null,seq__49085_49262);
if(temp__5278__auto___49273){
var seq__49085_49274__$1 = temp__5278__auto___49273;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49085_49274__$1)){
var c__24249__auto___49275 = cljs.core.chunk_first.call(null,seq__49085_49274__$1);
var G__49276 = cljs.core.chunk_rest.call(null,seq__49085_49274__$1);
var G__49277 = c__24249__auto___49275;
var G__49278 = cljs.core.count.call(null,c__24249__auto___49275);
var G__49279 = (0);
seq__49085_49262 = G__49276;
chunk__49086_49263 = G__49277;
count__49087_49264 = G__49278;
i__49088_49265 = G__49279;
continue;
} else {
var y_49280 = cljs.core.first.call(null,seq__49085_49274__$1);
var t_49281 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__49090_49282 = t_49281;
G__49090_49282.setAttribute("transform",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_scale.call(null,scale)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_translate.call(null,((x_49261 + 0.5) / scale),((y_49280 + 0.9) / scale)))].join(''));

G__49090_49282.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-text-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49261),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49280)].join(''));

G__49090_49282.setAttribute("text-anchor","middle");


goog.dom.appendChild(frag,t_49281);

var G__49283 = cljs.core.next.call(null,seq__49085_49274__$1);
var G__49284 = null;
var G__49285 = (0);
var G__49286 = (0);
seq__49085_49262 = G__49283;
chunk__49086_49263 = G__49284;
count__49087_49264 = G__49285;
i__49088_49265 = G__49286;
continue;
}
} else {
}
}
break;
}

var G__49287 = seq__49077_49257;
var G__49288 = chunk__49082_49258;
var G__49289 = count__49083_49259;
var G__49290 = (i__49084_49260 + (1));
seq__49077_49257 = G__49287;
chunk__49082_49258 = G__49288;
count__49083_49259 = G__49289;
i__49084_49260 = G__49290;
continue;
} else {
var temp__5278__auto___49291 = cljs.core.seq.call(null,seq__49077_49257);
if(temp__5278__auto___49291){
var seq__49077_49292__$1 = temp__5278__auto___49291;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49077_49292__$1)){
var c__24249__auto___49293 = cljs.core.chunk_first.call(null,seq__49077_49292__$1);
var G__49294 = cljs.core.chunk_rest.call(null,seq__49077_49292__$1);
var G__49295 = c__24249__auto___49293;
var G__49296 = cljs.core.count.call(null,c__24249__auto___49293);
var G__49297 = (0);
seq__49077_49257 = G__49294;
chunk__49082_49258 = G__49295;
count__49083_49259 = G__49296;
i__49084_49260 = G__49297;
continue;
} else {
var x_49298 = cljs.core.first.call(null,seq__49077_49292__$1);
var seq__49078_49299 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__49079_49300 = null;
var count__49080_49301 = (0);
var i__49081_49302 = (0);
while(true){
if((i__49081_49302 < count__49080_49301)){
var y_49303 = cljs.core._nth.call(null,chunk__49079_49300,i__49081_49302);
var t_49304 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__49091_49305 = t_49304;
G__49091_49305.setAttribute("transform",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_scale.call(null,scale)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_translate.call(null,((x_49298 + 0.5) / scale),((y_49303 + 0.9) / scale)))].join(''));

G__49091_49305.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-text-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49298),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49303)].join(''));

G__49091_49305.setAttribute("text-anchor","middle");


goog.dom.appendChild(frag,t_49304);

var G__49306 = seq__49078_49299;
var G__49307 = chunk__49079_49300;
var G__49308 = count__49080_49301;
var G__49309 = (i__49081_49302 + (1));
seq__49078_49299 = G__49306;
chunk__49079_49300 = G__49307;
count__49080_49301 = G__49308;
i__49081_49302 = G__49309;
continue;
} else {
var temp__5278__auto___49310__$1 = cljs.core.seq.call(null,seq__49078_49299);
if(temp__5278__auto___49310__$1){
var seq__49078_49311__$1 = temp__5278__auto___49310__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49078_49311__$1)){
var c__24249__auto___49312 = cljs.core.chunk_first.call(null,seq__49078_49311__$1);
var G__49313 = cljs.core.chunk_rest.call(null,seq__49078_49311__$1);
var G__49314 = c__24249__auto___49312;
var G__49315 = cljs.core.count.call(null,c__24249__auto___49312);
var G__49316 = (0);
seq__49078_49299 = G__49313;
chunk__49079_49300 = G__49314;
count__49080_49301 = G__49315;
i__49081_49302 = G__49316;
continue;
} else {
var y_49317 = cljs.core.first.call(null,seq__49078_49311__$1);
var t_49318 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__49092_49319 = t_49318;
G__49092_49319.setAttribute("transform",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_scale.call(null,scale)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_translate.call(null,((x_49298 + 0.5) / scale),((y_49317 + 0.9) / scale)))].join(''));

G__49092_49319.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-text-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49298),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49317)].join(''));

G__49092_49319.setAttribute("text-anchor","middle");


goog.dom.appendChild(frag,t_49318);

var G__49320 = cljs.core.next.call(null,seq__49078_49311__$1);
var G__49321 = null;
var G__49322 = (0);
var G__49323 = (0);
seq__49078_49299 = G__49320;
chunk__49079_49300 = G__49321;
count__49080_49301 = G__49322;
i__49081_49302 = G__49323;
continue;
}
} else {
}
}
break;
}

var G__49324 = cljs.core.next.call(null,seq__49077_49292__$1);
var G__49325 = null;
var G__49326 = (0);
var G__49327 = (0);
seq__49077_49257 = G__49324;
chunk__49082_49258 = G__49325;
count__49083_49259 = G__49326;
i__49084_49260 = G__49327;
continue;
}
} else {
}
}
break;
}

return goog.dom.appendChild(text_overlay,frag);
})()
;
console.timeEnd(timer_name__15521__auto___49102);


var display_params_STAR_ = javelin.core.formula.call(null,((function (elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (display_params__$1){
return cljs.core.dissoc.call(null,display_params__$1,new cljs.core.Keyword(null,"opacity","opacity",397153780),new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Keyword(null,"flight-paths","flight-paths",159519268),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541));
});})(elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params);
return javelin.core.formula.call(null,((function (display_params_STAR_,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (weather_data__$1,display_params_STAR___$1){
return weathergen.ui.update_grid.call(null,weather_data__$1,display_params_STAR___$1);
});})(display_params_STAR_,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weather_data,display_params_STAR_);
});})(elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48988,map__48991,map__48991__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
);

return elem;
};
var weathergen$ui$grid = function (var_args){
var args__29776__auto__ = null;
if (arguments.length > 0) {
var G__49328__i = 0, G__49328__a = new Array(arguments.length -  0);
while (G__49328__i < G__49328__a.length) {G__49328__a[G__49328__i] = arguments[G__49328__i + 0]; ++G__49328__i;}
  args__29776__auto__ = new cljs.core.IndexedSeq(G__49328__a,0,null);
} 
return weathergen$ui$grid__delegate.call(this,args__29776__auto__);};
weathergen$ui$grid.cljs$lang$maxFixedArity = 0;
weathergen$ui$grid.cljs$lang$applyTo = (function (arglist__49329){
var args__29776__auto__ = cljs.core.seq(arglist__49329);
return weathergen$ui$grid__delegate(args__29776__auto__);
});
weathergen$ui$grid.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$grid__delegate;
return weathergen$ui$grid;
})()
;
weathergen.ui.ESCAPE_KEY = (27);
weathergen.ui.ENTER_KEY = (13);
weathergen.ui.two_column = (function weathergen$ui$two_column(left,right){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"two-column",hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"left-column",left),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"right-column",right));
});
/**
 * Parses an int from a string, returning the int, or nil if it cannot
 *   be parsed as an int.
 */
weathergen.ui.parse_int = (function weathergen$ui$parse_int(s){
var n = (new Number(s)).valueOf();
var l = cljs.core.long$.call(null,n);
if(cljs.core.int_QMARK_.call(null,n)){
return l;
} else {
return null;
}
});
weathergen.ui.conform_nonnegative_integer = (function weathergen$ui$conform_nonnegative_integer(s){
return javelin.core.formula.call(null,(function (s__$1){
var parsed = weathergen.ui.parse_int.call(null,s__$1);
var valid_QMARK_ = (function (){var and__23326__auto__ = parsed;
if(cljs.core.truth_(and__23326__auto__)){
return !((parsed < (0)));
} else {
return and__23326__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),valid_QMARK_,new cljs.core.Keyword(null,"message","message",-406056002),(cljs.core.truth_(valid_QMARK_)?null:"Must be whole number, greather than or equal to zero."),new cljs.core.Keyword(null,"value","value",305978217),parsed], null);
})).call(null,s);
});
weathergen.ui.conform_positive_integer = (function weathergen$ui$conform_positive_integer(s){
return javelin.core.formula.call(null,(function (s__$1){
var parsed = weathergen.ui.parse_int.call(null,s__$1);
var valid_QMARK_ = (function (){var and__23326__auto__ = parsed;
if(cljs.core.truth_(and__23326__auto__)){
return (parsed > (0));
} else {
return and__23326__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),valid_QMARK_,new cljs.core.Keyword(null,"message","message",-406056002),(cljs.core.truth_(valid_QMARK_)?null:"Must be an integer greater than zero."),new cljs.core.Keyword(null,"value","value",305978217),parsed], null);
})).call(null,s);
});
/**
 * Returns a conformer that will ensure a value parses to an int
 *   between `from` and `to`, inclusive.
 */
weathergen.ui.int_conformer = (function weathergen$ui$int_conformer(from,to){
var message = goog.string.format("Must be an integer between %d and %d.",from,to);
return ((function (message){
return (function (s){
return javelin.core.formula.call(null,((function (message){
return (function (s__$1){
var parsed = weathergen.ui.parse_int.call(null,s__$1);
var valid_QMARK_ = (function (){var and__23326__auto__ = parsed;
if(cljs.core.truth_(and__23326__auto__)){
return ((from <= parsed)) && ((parsed <= to));
} else {
return and__23326__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),valid_QMARK_,new cljs.core.Keyword(null,"message","message",-406056002),(cljs.core.truth_(valid_QMARK_)?null:message),new cljs.core.Keyword(null,"value","value",305978217),parsed], null);
});})(message))
).call(null,s);
});
;})(message))
});
/**
 * Returns a conformer that will ensure a value parses to a floating
 *   point number between `from` and `to`, inclusive.
 */
weathergen.ui.float_conformer = (function weathergen$ui$float_conformer(from,to){
var message = goog.string.format("Must be a number between %f and %f.",from,to);
return ((function (message){
return (function (s){
return javelin.core.formula.call(null,((function (message){
return (function (s__$1){
var n = (new Number(s__$1)).valueOf();
var valid_QMARK_ = ((from <= n)) && ((n <= to));
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),valid_QMARK_,new cljs.core.Keyword(null,"message","message",-406056002),((valid_QMARK_)?null:message),new cljs.core.Keyword(null,"value","value",305978217),(cljs.core.truth_(isNaN(n))?null:n)], null);
});})(message))
).call(null,s);
});
;})(message))
});
/**
 * Given two conformers, returns a conformer that will validate only
 *   if both of them do. Checks c1 first.
 */
weathergen.ui.compose_conformers = (function weathergen$ui$compose_conformers(c1,c2){
return (function (s){
var p1 = c1.call(null,s);
var p2 = c2.call(null,s);
return javelin.core.formula.call(null,((function (p1,p2){
return (function (p1__$1,p2__$1){
if(cljs.core.truth_(new cljs.core.Keyword(null,"valid?","valid?",-212412379).cljs$core$IFn$_invoke$arity$1(p1__$1))){
return p2__$1;
} else {
return p1__$1;
}
});})(p1,p2))
).call(null,p1,p2);
});
});
/**
 * Renders a control that will provide feedback as to whether the
 *   contents are valid.
 * 
 *   :conform : A function of one argument, a cell containing the current
 *   value of the control. Returns a call whose value is a map with keys
 *   `:valid?`, `:value`, and `:message`, expressing whether the value is
 *   valid, and if not, why not.
 *   :fmt : A function that turns the validated value into a displayable
 *   string
 *   :source: A cell containing the source data for the input control.
 *   :update: A function that will be called with the new, valid value.
 *   Defaults to setting the source cell.
 *   :width: Width in pixels of the input area.
 *   :placeholder: Placeholder when input is empty.
 *   :css: Styling applied to container div.
 *   :align: Specifies text alignment of the input box
 * @param {...*} var_args
 */
weathergen.ui.validating_edit = (function() { 
var weathergen$ui$validating_edit__delegate = function (args__29776__auto__){
var vec__49344 = hoplon.core.parse_args.call(null,args__29776__auto__);
var attrs = cljs.core.nth.call(null,vec__49344,(0),null);
var _ = cljs.core.nth.call(null,vec__49344,(1),null);
var map__49347 = attrs;
var map__49347__$1 = ((((!((map__49347 == null)))?((((map__49347.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49347.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49347):map__49347);
var align = cljs.core.get.call(null,map__49347__$1,new cljs.core.Keyword(null,"align","align",1964212802));
var fmt = cljs.core.get.call(null,map__49347__$1,new cljs.core.Keyword(null,"fmt","fmt",332300772));
var placeholder = cljs.core.get.call(null,map__49347__$1,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083));
var css = cljs.core.get.call(null,map__49347__$1,new cljs.core.Keyword(null,"css","css",1135045163));
var width = cljs.core.get.call(null,map__49347__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var update = cljs.core.get.call(null,map__49347__$1,new cljs.core.Keyword(null,"update","update",1045576396));
var conform = cljs.core.get.call(null,map__49347__$1,new cljs.core.Keyword(null,"conform","conform",1846236460));
var source = cljs.core.get.call(null,map__49347__$1,new cljs.core.Keyword(null,"source","source",-433931539));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"conform","conform",1846236460),new cljs.core.Keyword(null,"fmt","fmt",332300772),new cljs.core.Keyword(null,"source","source",-433931539),new cljs.core.Keyword(null,"update","update",1045576396),new cljs.core.Keyword(null,"width","width",-384071477),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.Keyword(null,"align","align",1964212802));
var interim = javelin.core.cell.call(null,null);
var fmt__$1 = (function (){var or__23338__auto__ = fmt;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.str;
}
})();
var value = javelin.core.formula.call(null,((function (interim,fmt__$1,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (interim__$1,source__$1){
if(cljs.core.truth_(interim__$1)){
return interim__$1;
} else {
return fmt__$1.call(null,source__$1);
}
});})(interim,fmt__$1,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
).call(null,interim,source);
var parsed = conform.call(null,value);
var update__$1 = (function (){var or__23338__auto__ = update;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return ((function (or__23338__auto__,interim,fmt__$1,value,parsed,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (p1__49330_SHARP_){
return cljs.core.swap_BANG_.call(null,source,cljs.core.constantly.call(null,p1__49330_SHARP_));
});
;})(or__23338__auto__,interim,fmt__$1,value,parsed,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
}
})();
var state = javelin.core.cell.call(null,new cljs.core.Keyword(null,"set","set",304602554));
var focused_QMARK_ = javelin.core.cell.call(null,false);
var align__$1 = javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (G__49349){
return G__49349;
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
).call(null,align);
var valid_QMARK_ = javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (parsed__$1){
return cljs.core.empty_QMARK_.call(null,new cljs.core.Keyword(null,"message","message",-406056002).cljs$core$IFn$_invoke$arity$1(parsed__$1));
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
).call(null,parsed);
return hoplon.core.div.call(null,attrs__$1,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"overflow","overflow",2058931880),"show",new cljs.core.Keyword(null,"white-space","white-space",-707351930),"nowrap",new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(function (){var or__23338__auto__ = width;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return (125);
}
})()),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(3))], null),css),(function (){var i = hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text",new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),placeholder,new cljs.core.Keyword(null,"input","input",556931961),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (p1__49331_SHARP_){
cljs.core.reset_BANG_.call(null,interim,cljs.core.deref.call(null,p1__49331_SHARP_));

return cljs.core.reset_BANG_.call(null,state,new cljs.core.Keyword(null,"editing","editing",1365491601));
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
,new cljs.core.Keyword(null,"change","change",-1163046502),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (){
var p = cljs.core.deref.call(null,parsed);
var temp__5278__auto__ = new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(p);
if(cljs.core.truth_(temp__5278__auto__)){
var v = temp__5278__auto__;
return javelin.core.dosync_STAR_.call(null,((function (v,temp__5278__auto__,p,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (){
update__$1.call(null,v);

cljs.core.reset_BANG_.call(null,interim,null);

return cljs.core.reset_BANG_.call(null,state,new cljs.core.Keyword(null,"set","set",304602554));
});})(v,temp__5278__auto__,p,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
);
} else {
return null;
}
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
,new cljs.core.Keyword(null,"keyup","keyup",-794526927),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (e){
if(cljs.core._EQ_.call(null,weathergen.ui.ESCAPE_KEY,e.keyCode)){
return javelin.core.dosync_STAR_.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (){
cljs.core.reset_BANG_.call(null,interim,null);

return cljs.core.reset_BANG_.call(null,state,new cljs.core.Keyword(null,"set","set",304602554));
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
);
} else {
return null;
}
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
,new cljs.core.Keyword(null,"focus","focus",234677911),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (){
return cljs.core.reset_BANG_.call(null,focused_QMARK_,true);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
,new cljs.core.Keyword(null,"blur","blur",-453500461),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (){
var p = cljs.core.deref.call(null,parsed);
return javelin.core.dosync_STAR_.call(null,((function (p,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (){
cljs.core.reset_BANG_.call(null,focused_QMARK_,false);

var temp__5278__auto__ = new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(p);
if(cljs.core.truth_(temp__5278__auto__)){
var v = temp__5278__auto__;
update__$1.call(null,v);

cljs.core.reset_BANG_.call(null,interim,null);

return cljs.core.reset_BANG_.call(null,state,new cljs.core.Keyword(null,"set","set",304602554));
} else {
return null;
}
});})(p,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (state__$1,valid_QMARK___$1,align__$2){
return new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"font-style","font-style",-773672352),((cljs.core._EQ_.call(null,state__$1,new cljs.core.Keyword(null,"editing","editing",1365491601)))?"italic":""),new cljs.core.Keyword(null,"color","color",1011675173),(cljs.core.truth_(valid_QMARK___$1)?"":weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"invalid","invalid",412869516))),new cljs.core.Keyword(null,"background","background",-863952629),(cljs.core.truth_(valid_QMARK___$1)?"":weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"invalid-background","invalid-background",-917496690))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,((function (){var or__23338__auto__ = width;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return (125);
}
})() - (cljs.core.truth_(valid_QMARK___$1)?(0):(20)))),new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),(cljs.core.truth_(valid_QMARK___$1)?null:weathergen.ui.common.px.call(null,(20))),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),(cljs.core.truth_(valid_QMARK___$1)?null:weathergen.ui.common.px.call(null,(-20))),new cljs.core.Keyword(null,"text-align","text-align",1786091845),(cljs.core.truth_(align__$2)?align__$2:null)], null);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
).call(null,state,valid_QMARK_,align__$1),new cljs.core.Keyword(null,"value","value",305978217),value);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [i,hoplon.core.img.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"images/error.png",new cljs.core.Keyword(null,"title","title",636505583),javelin.core.formula.call(null,((function (i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (G__49350){
return new cljs.core.Keyword(null,"message","message",-406056002).cljs$core$IFn$_invoke$arity$1(G__49350);
});})(i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
).call(null,parsed),new cljs.core.Keyword(null,"click","click",1912301393),((function (i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (){
return (function (){var G__49351 = i;
return G__49351;
})().focus();
});})(i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (valid_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"right","right",-452581833),(0),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(14)),new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(3)),new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),weathergen.ui.common.px.call(null,(2)),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle",new cljs.core.Keyword(null,"opacity","opacity",397153780),(cljs.core.truth_(valid_QMARK___$1)?"0":"1")], null);
});})(i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
).call(null,valid_QMARK_))], null);
})(),hoplon.core.div.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (G__49354,G__49353,G__49352){
var and__23326__auto__ = G__49352.call(null,G__49353);
if(cljs.core.truth_(and__23326__auto__)){
return G__49354;
} else {
return and__23326__auto__;
}
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
).call(null,focused_QMARK_,valid_QMARK_,cljs.core.not),new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"min-width","min-width",1926193728),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),new cljs.core.Keyword(null,"top","top",-1856271961),new cljs.core.Keyword(null,"background","background",-863952629),new cljs.core.Keyword(null,"max-width","max-width",-1939924051),new cljs.core.Keyword(null,"z-index","z-index",1892827090),new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),new cljs.core.Keyword(null,"position","position",-2011731912),new cljs.core.Keyword(null,"border","border",1444987323)],[weathergen.ui.common.pct.call(null,(100)),weathergen.ui.common.pct.call(null,(75)),weathergen.ui.common.px.call(null,(24)),"rgba(221,221,221,0.95)",weathergen.ui.common.px.call(null,(500)),(1),weathergen.ui.common.px.call(null,(2)),"absolute","1px solid #888"]),javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_){
return (function (G__49355){
return new cljs.core.Keyword(null,"message","message",-406056002).cljs$core$IFn$_invoke$arity$1(G__49355);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49347,map__49347__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49344,attrs,_))
).call(null,parsed)));
};
var weathergen$ui$validating_edit = function (var_args){
var args__29776__auto__ = null;
if (arguments.length > 0) {
var G__49356__i = 0, G__49356__a = new Array(arguments.length -  0);
while (G__49356__i < G__49356__a.length) {G__49356__a[G__49356__i] = arguments[G__49356__i + 0]; ++G__49356__i;}
  args__29776__auto__ = new cljs.core.IndexedSeq(G__49356__a,0,null);
} 
return weathergen$ui$validating_edit__delegate.call(this,args__29776__auto__);};
weathergen$ui$validating_edit.cljs$lang$maxFixedArity = 0;
weathergen$ui$validating_edit.cljs$lang$applyTo = (function (arglist__49357){
var args__29776__auto__ = cljs.core.seq(arglist__49357);
return weathergen$ui$validating_edit__delegate(args__29776__auto__);
});
weathergen$ui$validating_edit.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$validating_edit__delegate;
return weathergen$ui$validating_edit;
})()
;
/**
 * @param {...*} var_args
 */
weathergen.ui.time_edit = (function() { 
var weathergen$ui$time_edit__delegate = function (args__29776__auto__){
var vec__49366 = hoplon.core.parse_args.call(null,args__29776__auto__);
var map__49369 = cljs.core.nth.call(null,vec__49366,(0),null);
var map__49369__$1 = ((((!((map__49369 == null)))?((((map__49369.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49369.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49369):map__49369);
var attrs = map__49369__$1;
var source = cljs.core.get.call(null,map__49369__$1,new cljs.core.Keyword(null,"source","source",-433931539));
var update = cljs.core.get.call(null,map__49369__$1,new cljs.core.Keyword(null,"update","update",1045576396));
var _ = cljs.core.nth.call(null,vec__49366,(1),null);
return weathergen.ui.validating_edit.call(null,attrs,new cljs.core.Keyword(null,"width","width",-384071477),(65),new cljs.core.Keyword(null,"fmt","fmt",332300772),weathergen.ui.common.format_time,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"dd/hhmm",new cljs.core.Keyword(null,"conform","conform",1846236460),((function (vec__49366,map__49369,map__49369__$1,attrs,source,update,_){
return (function (val){
return javelin.core.formula.call(null,((function (vec__49366,map__49369,map__49369__$1,attrs,source,update,_){
return (function (val__$1){
var vec__49371 = cljs.core.re_matches.call(null,/(\d+)\/(\d\d):(\d\d)/,val__$1);
var all = cljs.core.nth.call(null,vec__49371,(0),null);
var dd = cljs.core.nth.call(null,vec__49371,(1),null);
var hh = cljs.core.nth.call(null,vec__49371,(2),null);
var mm = cljs.core.nth.call(null,vec__49371,(3),null);
var day = cljs.core.long$.call(null,(new Number(dd)));
var hour = cljs.core.long$.call(null,(new Number(hh)));
var min = cljs.core.long$.call(null,(new Number(mm)));
var valid_QMARK_ = (function (){var and__23326__auto__ = dd;
if(cljs.core.truth_(and__23326__auto__)){
var and__23326__auto____$1 = hh;
if(cljs.core.truth_(and__23326__auto____$1)){
var and__23326__auto____$2 = mm;
if(cljs.core.truth_(and__23326__auto____$2)){
return (cljs.core.int_QMARK_.call(null,day)) && (cljs.core.int_QMARK_.call(null,hour)) && (cljs.core.int_QMARK_.call(null,min)) && ((((0) <= hour)) && ((hour <= (23)))) && ((((0) <= min)) && ((min <= (59))));
} else {
return and__23326__auto____$2;
}
} else {
return and__23326__auto____$1;
}
} else {
return and__23326__auto__;
}
})();
var val__$2 = new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),day,new cljs.core.Keyword(null,"hour","hour",-555989214),hour,new cljs.core.Keyword(null,"minute","minute",-642875969),min], null);
var over_max_QMARK_ = (function (){var and__23326__auto__ = valid_QMARK_;
if(cljs.core.truth_(and__23326__auto__)){
var and__23326__auto____$1 = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)));
if(cljs.core.truth_(and__23326__auto____$1)){
return (weathergen.time.campaign_time__GT_minutes.call(null,new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)))) < weathergen.time.campaign_time__GT_minutes.call(null,val__$2));
} else {
return and__23326__auto____$1;
}
} else {
return and__23326__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),(function (){var and__23326__auto__ = valid_QMARK_;
if(cljs.core.truth_(and__23326__auto__)){
return cljs.core.not.call(null,over_max_QMARK_);
} else {
return and__23326__auto__;
}
})(),new cljs.core.Keyword(null,"message","message",-406056002),((cljs.core.not.call(null,valid_QMARK_))?"Time must be in the format 'dd/hh:mm'":(cljs.core.truth_(over_max_QMARK_)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1("Time cannot be set later than "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.format_time.call(null,new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)))))].join(''):null)),new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),day,new cljs.core.Keyword(null,"hour","hour",-555989214),hour,new cljs.core.Keyword(null,"minute","minute",-642875969),min], null)], null);
});})(vec__49366,map__49369,map__49369__$1,attrs,source,update,_))
).call(null,val);
});})(vec__49366,map__49369,map__49369__$1,attrs,source,update,_))
);
};
var weathergen$ui$time_edit = function (var_args){
var args__29776__auto__ = null;
if (arguments.length > 0) {
var G__49374__i = 0, G__49374__a = new Array(arguments.length -  0);
while (G__49374__i < G__49374__a.length) {G__49374__a[G__49374__i] = arguments[G__49374__i + 0]; ++G__49374__i;}
  args__29776__auto__ = new cljs.core.IndexedSeq(G__49374__a,0,null);
} 
return weathergen$ui$time_edit__delegate.call(this,args__29776__auto__);};
weathergen$ui$time_edit.cljs$lang$maxFixedArity = 0;
weathergen$ui$time_edit.cljs$lang$applyTo = (function (arglist__49375){
var args__29776__auto__ = cljs.core.seq(arglist__49375);
return weathergen$ui$time_edit__delegate(args__29776__auto__);
});
weathergen$ui$time_edit.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$time_edit__delegate;
return weathergen$ui$time_edit;
})()
;
weathergen.ui.edit_field = (function weathergen$ui$edit_field(var_args){
var args49378 = [];
var len__24559__auto___49386 = arguments.length;
var i__24560__auto___49387 = (0);
while(true){
if((i__24560__auto___49387 < len__24559__auto___49386)){
args49378.push((arguments[i__24560__auto___49387]));

var G__49388 = (i__24560__auto___49387 + (1));
i__24560__auto___49387 = G__49388;
continue;
} else {
}
break;
}

var G__49380 = args49378.length;
switch (G__49380) {
case 2:
return weathergen.ui.edit_field.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return weathergen.ui.edit_field.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args49378.length)].join('')));

}
});

weathergen.ui.edit_field.cljs$core$IFn$_invoke$arity$2 = (function (c,path){
return weathergen.ui.edit_field.call(null,c,path,cljs.core.PersistentArrayMap.EMPTY);
});

weathergen.ui.edit_field.cljs$core$IFn$_invoke$arity$3 = (function (c,path,opts){
var map__49381 = opts;
var map__49381__$1 = ((((!((map__49381 == null)))?((((map__49381.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49381.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49381):map__49381);
var change_fn = cljs.core.get.call(null,map__49381__$1,new cljs.core.Keyword(null,"change-fn","change-fn",1566440825));
var input_attrs = cljs.core.get.call(null,map__49381__$1,new cljs.core.Keyword(null,"input-attrs","input-attrs",-38113667),cljs.core.PersistentArrayMap.EMPTY);
return hoplon.core.input.call(null,input_attrs,new cljs.core.Keyword(null,"type","type",1174270348),"text",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (map__49381,map__49381__$1,change_fn,input_attrs){
return (function (G__49385,G__49384,G__49383){
return G__49383.call(null,G__49384,G__49385);
});})(map__49381,map__49381__$1,change_fn,input_attrs))
).call(null,path,c,cljs.core.get_in),new cljs.core.Keyword(null,"change","change",-1163046502),(cljs.core.truth_(change_fn)?((function (map__49381,map__49381__$1,change_fn,input_attrs){
return (function (p1__49376_SHARP_){
return change_fn.call(null,Number(cljs.core.deref.call(null,p1__49376_SHARP_)));
});})(map__49381,map__49381__$1,change_fn,input_attrs))
:((function (map__49381,map__49381__$1,change_fn,input_attrs){
return (function (p1__49377_SHARP_){
return cljs.core.swap_BANG_.call(null,c,cljs.core.assoc_in,path,Number(cljs.core.deref.call(null,p1__49377_SHARP_)));
});})(map__49381,map__49381__$1,change_fn,input_attrs))
));
});

weathergen.ui.edit_field.cljs$lang$maxFixedArity = 3;

/**
 * Renders an input that will edit a pressure value, in whatever units
 *   the cell `unit-c` indicates
 */
weathergen.ui.pressure_edit_field = (function weathergen$ui$pressure_edit_field(c,path,unit_c){
return hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,(function (c__$1,unit_c__$1){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,c__$1,path),unit_c__$1);
})).call(null,c,unit_c),new cljs.core.Keyword(null,"change","change",-1163046502),(function (p1__49390_SHARP_){
return cljs.core.swap_BANG_.call(null,c,cljs.core.assoc_in,path,weathergen.ui.convert_pressure.call(null,Number(cljs.core.deref.call(null,p1__49390_SHARP_)),cljs.core.deref.call(null,unit_c)));
}));
});
/**
 * Defines a time-edit box with against `path` into map cell `source`.
 * @param {...*} var_args
 */
weathergen.ui.time_entry = (function() { 
var weathergen$ui$time_entry__delegate = function (args__29776__auto__){
var vec__49397 = hoplon.core.parse_args.call(null,args__29776__auto__);
var attrs = cljs.core.nth.call(null,vec__49397,(0),null);
var _ = cljs.core.nth.call(null,vec__49397,(1),null);
var map__49400 = attrs;
var map__49400__$1 = ((((!((map__49400 == null)))?((((map__49400.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49400.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49400):map__49400);
var path = cljs.core.get.call(null,map__49400__$1,new cljs.core.Keyword(null,"path","path",-188191168));
var source = cljs.core.get.call(null,map__49400__$1,new cljs.core.Keyword(null,"source","source",-433931539));
return weathergen.ui.time_edit.call(null,cljs.core.assoc.call(null,cljs.core.assoc.call(null,cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"path","path",-188191168)),new cljs.core.Keyword(null,"source","source",-433931539),javelin.core.formula.call(null,((function (map__49400,map__49400__$1,path,source,vec__49397,attrs,_){
return (function (source__$1){
return cljs.core.get_in.call(null,source__$1,path);
});})(map__49400,map__49400__$1,path,source,vec__49397,attrs,_))
).call(null,source)),new cljs.core.Keyword(null,"update","update",1045576396),((function (map__49400,map__49400__$1,path,source,vec__49397,attrs,_){
return (function (p1__49391_SHARP_){
return cljs.core.swap_BANG_.call(null,source,cljs.core.assoc_in,path,p1__49391_SHARP_);
});})(map__49400,map__49400__$1,path,source,vec__49397,attrs,_))
));
};
var weathergen$ui$time_entry = function (var_args){
var args__29776__auto__ = null;
if (arguments.length > 0) {
var G__49402__i = 0, G__49402__a = new Array(arguments.length -  0);
while (G__49402__i < G__49402__a.length) {G__49402__a[G__49402__i] = arguments[G__49402__i + 0]; ++G__49402__i;}
  args__29776__auto__ = new cljs.core.IndexedSeq(G__49402__a,0,null);
} 
return weathergen$ui$time_entry__delegate.call(this,args__29776__auto__);};
weathergen$ui$time_entry.cljs$lang$maxFixedArity = 0;
weathergen$ui$time_entry.cljs$lang$applyTo = (function (arglist__49403){
var args__29776__auto__ = cljs.core.seq(arglist__49403);
return weathergen$ui$time_entry__delegate(args__29776__auto__);
});
weathergen$ui$time_entry.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$time_entry__delegate;
return weathergen$ui$time_entry;
})()
;
/**
 * Returns UI for the 'button bar' that goes across the top of the
 *   map.
 */
weathergen.ui.button_bar = (function weathergen$ui$button_bar(){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-bar",new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,(function (map_size){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,cljs.core.first.call(null,map_size)),new cljs.core.Keyword(null,"margin","margin",-995903681),"0 0 3px 0"], null);
})).call(null,weathergen.ui.map_size),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Keyword(null,"legend","legend",-1027192245)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(5))], null),hoplon.core.span.call(null,"Map Legend")),(function (){var button_size = (18);
var map_center = ((function (button_size){
return (function (){
var map__49406 = cljs.core.deref.call(null,weathergen.ui.map_viewbox);
var map__49406__$1 = ((((!((map__49406 == null)))?((((map__49406.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49406.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49406):map__49406);
var x = cljs.core.get.call(null,map__49406__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__49406__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__49406__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__49406__$1,new cljs.core.Keyword(null,"height","height",1025178622));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(x + (width / (2))),(y + (height / (2)))], null);
});})(button_size))
;
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(10))], null),weathergen.ui.common.inl.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (button_size,map_center){
return (function (){
return weathergen.ui.zoom_map_BANG_.call(null,map_center.call(null),1.1);
});})(button_size,map_center))
,hoplon.core.img.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"bottom"], null),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,button_size),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,button_size),new cljs.core.Keyword(null,"src","src",-1651076051),"images/zoomin.svg",new cljs.core.Keyword(null,"title","title",636505583),"Zoom Map In")),weathergen.ui.common.inl.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (button_size,map_center){
return (function (){
return weathergen.ui.zoom_map_BANG_.call(null,map_center.call(null),(1.0 / 1.1));
});})(button_size,map_center))
,hoplon.core.img.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"bottom"], null),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,button_size),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,button_size),new cljs.core.Keyword(null,"src","src",-1651076051),"images/zoomout.svg",new cljs.core.Keyword(null,"title","title",636505583),"Zoom Map Out")))));
})(),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"right","right",-452581833),weathergen.ui.common.px.call(null,(27)),new cljs.core.Keyword(null,"bottom","bottom",-1550509018),(0)], null),hoplon.core.span.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Keyword(null,"mission-time","mission-time",-1235574900)], null),"Mission Time:")," ",javelin.core.formula.call(null,(function (mission){
var t = weathergen.falcon.files.mission.mission_time.call(null,mission);
if(cljs.core.truth_(t)){
return weathergen.ui.common.format_time.call(null,t);
} else {
return "--/----";
}
})).call(null,weathergen.ui.mission)),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(7))], null),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Keyword(null,"weather-time","weather-time",-248525118)], null),"Weather Time:")," ",javelin.core.formula.call(null,(function (weather_data_params){
var t = new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(weather_data_params));
if(cljs.core.truth_(t)){
return weathergen.ui.common.format_time.call(null,t);
} else {
return "--/----";
}
})).call(null,weathergen.ui.weather_data_params))),javelin.core.formula.call(null,(function (computing){
if(cljs.core.not.call(null,computing)){
return cljs.core.PersistentVector.EMPTY;
} else {
return hoplon.core.img.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"images/spinner.gif",new cljs.core.Keyword(null,"width","width",-384071477),"24px",new cljs.core.Keyword(null,"height","height",1025178622),"24px",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"bottom",new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"right","right",-452581833),"3px",new cljs.core.Keyword(null,"bottom","bottom",-1550509018),"0"], null));
}
})).call(null,weathergen.ui.computing));
});
/**
 * Lays out controls for a control section. `controls` is a sequence
 *   of [label selector opts] tuples, where `opts` is a map with
 *   keys :extra, :type, :help-base, :help-paths, :cell, or :ui.
 */
weathergen.ui.control_layout = (function weathergen$ui$control_layout(controls){
var field = (function() { 
var G__49456__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field",kids);
};
var G__49456 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49457__i = 0, G__49457__a = new Array(arguments.length -  0);
while (G__49457__i < G__49457__a.length) {G__49457__a[G__49457__i] = arguments[G__49457__i + 0]; ++G__49457__i;}
  kids = new cljs.core.IndexedSeq(G__49457__a,0,null);
} 
return G__49456__delegate.call(this,kids);};
G__49456.cljs$lang$maxFixedArity = 0;
G__49456.cljs$lang$applyTo = (function (arglist__49458){
var kids = cljs.core.seq(arglist__49458);
return G__49456__delegate(kids);
});
G__49456.cljs$core$IFn$_invoke$arity$variadic = G__49456__delegate;
return G__49456;
})()
;
var field_help = ((function (field){
return (function() { 
var G__49459__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-help",kids);
};
var G__49459 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49460__i = 0, G__49460__a = new Array(arguments.length -  0);
while (G__49460__i < G__49460__a.length) {G__49460__a[G__49460__i] = arguments[G__49460__i + 0]; ++G__49460__i;}
  kids = new cljs.core.IndexedSeq(G__49460__a,0,null);
} 
return G__49459__delegate.call(this,kids);};
G__49459.cljs$lang$maxFixedArity = 0;
G__49459.cljs$lang$applyTo = (function (arglist__49461){
var kids = cljs.core.seq(arglist__49461);
return G__49459__delegate(kids);
});
G__49459.cljs$core$IFn$_invoke$arity$variadic = G__49459__delegate;
return G__49459;
})()
;})(field))
;
var field_input = ((function (field,field_help){
return (function() { 
var G__49462__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-input",kids);
};
var G__49462 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49463__i = 0, G__49463__a = new Array(arguments.length -  0);
while (G__49463__i < G__49463__a.length) {G__49463__a[G__49463__i] = arguments[G__49463__i + 0]; ++G__49463__i;}
  kids = new cljs.core.IndexedSeq(G__49463__a,0,null);
} 
return G__49462__delegate.call(this,kids);};
G__49462.cljs$lang$maxFixedArity = 0;
G__49462.cljs$lang$applyTo = (function (arglist__49464){
var kids = cljs.core.seq(arglist__49464);
return G__49462__delegate(kids);
});
G__49462.cljs$core$IFn$_invoke$arity$variadic = G__49462__delegate;
return G__49462;
})()
;})(field,field_help))
;
var field_label = ((function (field,field_help,field_input){
return (function() { 
var G__49465__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-label",kids);
};
var G__49465 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49466__i = 0, G__49466__a = new Array(arguments.length -  0);
while (G__49466__i < G__49466__a.length) {G__49466__a[G__49466__i] = arguments[G__49466__i + 0]; ++G__49466__i;}
  kids = new cljs.core.IndexedSeq(G__49466__a,0,null);
} 
return G__49465__delegate.call(this,kids);};
G__49465.cljs$lang$maxFixedArity = 0;
G__49465.cljs$lang$applyTo = (function (arglist__49467){
var kids = cljs.core.seq(arglist__49467);
return G__49465__delegate(kids);
});
G__49465.cljs$core$IFn$_invoke$arity$variadic = G__49465__delegate;
return G__49465;
})()
;})(field,field_help,field_input))
;
var iter__24200__auto__ = ((function (field,field_help,field_input,field_label){
return (function weathergen$ui$control_layout_$_iter__49432(s__49433){
return (new cljs.core.LazySeq(null,((function (field,field_help,field_input,field_label){
return (function (){
var s__49433__$1 = s__49433;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__49433__$1);
if(temp__5278__auto__){
var s__49433__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49433__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__49433__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__49435 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__49434 = (0);
while(true){
if((i__49434 < size__24199__auto__)){
var vec__49446 = cljs.core._nth.call(null,c__24198__auto__,i__49434);
var label = cljs.core.nth.call(null,vec__49446,(0),null);
var selector = cljs.core.nth.call(null,vec__49446,(1),null);
var map__49449 = cljs.core.nth.call(null,vec__49446,(2),null);
var map__49449__$1 = ((((!((map__49449 == null)))?((((map__49449.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49449.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49449):map__49449);
var opts = map__49449__$1;
var extra = cljs.core.get.call(null,map__49449__$1,new cljs.core.Keyword(null,"extra","extra",1612569067));
var type = cljs.core.get.call(null,map__49449__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var help_base = cljs.core.get.call(null,map__49449__$1,new cljs.core.Keyword(null,"help-base","help-base",-1618186240));
var help_path = cljs.core.get.call(null,map__49449__$1,new cljs.core.Keyword(null,"help-path","help-path",840478713));
var cell = cljs.core.get.call(null,map__49449__$1,new cljs.core.Keyword(null,"cell","cell",764245084));
var ui = cljs.core.get.call(null,map__49449__$1,new cljs.core.Keyword(null,"ui","ui",-469653645));
var cell__$1 = (function (){var or__23338__auto__ = cell;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return weathergen.ui.weather_params;
}
})();
cljs.core.chunk_append.call(null,b__49435,field.call(null,field_label.call(null,weathergen.help.with_help.call(null,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var or__23338__auto__ = help_base;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return new cljs.core.Keyword(null,"weather-params","weather-params",-259271365);
}
})()], null),(function (){var or__23338__auto__ = help_path;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return selector;
}
})()),label)),field_input.call(null,(function (){var or__23338__auto__ = ui;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747),type)){
return weathergen.ui.pressure_edit_field.call(null,cell__$1,selector,weathergen.ui.pressure_unit);
} else {
return weathergen.ui.edit_field.call(null,cell__$1,selector);
}
}
})(),(function (){var or__23338__auto__ = extra;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.PersistentVector.EMPTY;
}
})())));

var G__49468 = (i__49434 + (1));
i__49434 = G__49468;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49435),weathergen$ui$control_layout_$_iter__49432.call(null,cljs.core.chunk_rest.call(null,s__49433__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49435),null);
}
} else {
var vec__49451 = cljs.core.first.call(null,s__49433__$2);
var label = cljs.core.nth.call(null,vec__49451,(0),null);
var selector = cljs.core.nth.call(null,vec__49451,(1),null);
var map__49454 = cljs.core.nth.call(null,vec__49451,(2),null);
var map__49454__$1 = ((((!((map__49454 == null)))?((((map__49454.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49454.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49454):map__49454);
var opts = map__49454__$1;
var extra = cljs.core.get.call(null,map__49454__$1,new cljs.core.Keyword(null,"extra","extra",1612569067));
var type = cljs.core.get.call(null,map__49454__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var help_base = cljs.core.get.call(null,map__49454__$1,new cljs.core.Keyword(null,"help-base","help-base",-1618186240));
var help_path = cljs.core.get.call(null,map__49454__$1,new cljs.core.Keyword(null,"help-path","help-path",840478713));
var cell = cljs.core.get.call(null,map__49454__$1,new cljs.core.Keyword(null,"cell","cell",764245084));
var ui = cljs.core.get.call(null,map__49454__$1,new cljs.core.Keyword(null,"ui","ui",-469653645));
var cell__$1 = (function (){var or__23338__auto__ = cell;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return weathergen.ui.weather_params;
}
})();
return cljs.core.cons.call(null,field.call(null,field_label.call(null,weathergen.help.with_help.call(null,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var or__23338__auto__ = help_base;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return new cljs.core.Keyword(null,"weather-params","weather-params",-259271365);
}
})()], null),(function (){var or__23338__auto__ = help_path;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return selector;
}
})()),label)),field_input.call(null,(function (){var or__23338__auto__ = ui;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747),type)){
return weathergen.ui.pressure_edit_field.call(null,cell__$1,selector,weathergen.ui.pressure_unit);
} else {
return weathergen.ui.edit_field.call(null,cell__$1,selector);
}
}
})(),(function (){var or__23338__auto__ = extra;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.PersistentVector.EMPTY;
}
})())),weathergen$ui$control_layout_$_iter__49432.call(null,cljs.core.rest.call(null,s__49433__$2)));
}
} else {
return null;
}
break;
}
});})(field,field_help,field_input,field_label))
,null,null));
});})(field,field_help,field_input,field_label))
;
return iter__24200__auto__.call(null,controls);
});
weathergen.ui.weather_display_controls = (function weathergen$ui$weather_display_controls(p__49470){
var map__49475 = p__49470;
var map__49475__$1 = ((((!((map__49475 == null)))?((((map__49475.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49475.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49475):map__49475);
var prevent_map_change_QMARK_ = cljs.core.get.call(null,map__49475__$1,new cljs.core.Keyword(null,"prevent-map-change?","prevent-map-change?",1926330460));
var title = cljs.core.get.call(null,map__49475__$1,new cljs.core.Keyword(null,"title","title",636505583));
var field = ((function (map__49475,map__49475__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__49479__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field",kids);
};
var G__49479 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49480__i = 0, G__49480__a = new Array(arguments.length -  0);
while (G__49480__i < G__49480__a.length) {G__49480__a[G__49480__i] = arguments[G__49480__i + 0]; ++G__49480__i;}
  kids = new cljs.core.IndexedSeq(G__49480__a,0,null);
} 
return G__49479__delegate.call(this,kids);};
G__49479.cljs$lang$maxFixedArity = 0;
G__49479.cljs$lang$applyTo = (function (arglist__49481){
var kids = cljs.core.seq(arglist__49481);
return G__49479__delegate(kids);
});
G__49479.cljs$core$IFn$_invoke$arity$variadic = G__49479__delegate;
return G__49479;
})()
;})(map__49475,map__49475__$1,prevent_map_change_QMARK_,title))
;
var field_help = ((function (field,map__49475,map__49475__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__49482__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-help",kids);
};
var G__49482 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49483__i = 0, G__49483__a = new Array(arguments.length -  0);
while (G__49483__i < G__49483__a.length) {G__49483__a[G__49483__i] = arguments[G__49483__i + 0]; ++G__49483__i;}
  kids = new cljs.core.IndexedSeq(G__49483__a,0,null);
} 
return G__49482__delegate.call(this,kids);};
G__49482.cljs$lang$maxFixedArity = 0;
G__49482.cljs$lang$applyTo = (function (arglist__49484){
var kids = cljs.core.seq(arglist__49484);
return G__49482__delegate(kids);
});
G__49482.cljs$core$IFn$_invoke$arity$variadic = G__49482__delegate;
return G__49482;
})()
;})(field,map__49475,map__49475__$1,prevent_map_change_QMARK_,title))
;
var field_input = ((function (field,field_help,map__49475,map__49475__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__49485__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-input",kids);
};
var G__49485 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49486__i = 0, G__49486__a = new Array(arguments.length -  0);
while (G__49486__i < G__49486__a.length) {G__49486__a[G__49486__i] = arguments[G__49486__i + 0]; ++G__49486__i;}
  kids = new cljs.core.IndexedSeq(G__49486__a,0,null);
} 
return G__49485__delegate.call(this,kids);};
G__49485.cljs$lang$maxFixedArity = 0;
G__49485.cljs$lang$applyTo = (function (arglist__49487){
var kids = cljs.core.seq(arglist__49487);
return G__49485__delegate(kids);
});
G__49485.cljs$core$IFn$_invoke$arity$variadic = G__49485__delegate;
return G__49485;
})()
;})(field,field_help,map__49475,map__49475__$1,prevent_map_change_QMARK_,title))
;
var field_label = ((function (field,field_help,field_input,map__49475,map__49475__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__49488__delegate = function (help_path,kids){
return weathergen.help.with_help.call(null,help_path,cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-label",kids));
};
var G__49488 = function (help_path,var_args){
var kids = null;
if (arguments.length > 1) {
var G__49489__i = 0, G__49489__a = new Array(arguments.length -  1);
while (G__49489__i < G__49489__a.length) {G__49489__a[G__49489__i] = arguments[G__49489__i + 1]; ++G__49489__i;}
  kids = new cljs.core.IndexedSeq(G__49489__a,0,null);
} 
return G__49488__delegate.call(this,help_path,kids);};
G__49488.cljs$lang$maxFixedArity = 1;
G__49488.cljs$lang$applyTo = (function (arglist__49490){
var help_path = cljs.core.first(arglist__49490);
var kids = cljs.core.rest(arglist__49490);
return G__49488__delegate(help_path,kids);
});
G__49488.cljs$core$IFn$_invoke$arity$variadic = G__49488__delegate;
return G__49488;
})()
;})(field,field_help,field_input,map__49475,map__49475__$1,prevent_map_change_QMARK_,title))
;
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),(function (){var or__23338__auto__ = title;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "Display Options";
}
})(),new cljs.core.Keyword(null,"id","id",-1388402092),"weather-display-controls-section",weathergen.ui.control_layout.call(null,(function (){var opts = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cell","cell",764245084),weathergen.ui.display_params,new cljs.core.Keyword(null,"help-base","help-base",-1618186240),new cljs.core.Keyword(null,"weather-display-controls","weather-display-controls",941597221)], null);
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Display",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"display","display",242065432)], null),cljs.core.merge.call(null,opts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.display_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"display","display",242065432)], null)),new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1718410804),"None"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Weather Type",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"type","type",1174270348)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Pressure",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Temperature",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"temperature","temperature",899018429)], null)], null))], null))], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Overlay",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"overlay","overlay",-139131598)], null),cljs.core.merge.call(null,opts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.display_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"overlay","overlay",-139131598)], null)),new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1718410804),"None"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Wind",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"wind","wind",-527553074)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Pressure",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Temperature",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"temperature","temperature",899018429)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Weather Type",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"type","type",1174270348)], null)], null))], null))], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Pressure",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),cljs.core.merge.call(null,opts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.display_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243)], null)),new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"InHg",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"inhg","inhg",-863180091)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Millibar",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"mbar","mbar",-1396360988)], null)], null))], null))], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Opacity:",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"opacity","opacity",397153780)], null),cljs.core.merge.call(null,opts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.input.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"type","type",1174270348),"range",new cljs.core.Keyword(null,"min","min",444991522),(0),new cljs.core.Keyword(null,"max","max",61366548),(100),new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (opts,field,field_help,field_input,field_label,map__49475,map__49475__$1,prevent_map_change_QMARK_,title){
return (function (G__49477,G__49478){
return G__49477.call(null,(new cljs.core.Keyword(null,"opacity","opacity",397153780).cljs$core$IFn$_invoke$arity$1(G__49478) * (100)));
});})(opts,field,field_help,field_input,field_label,map__49475,map__49475__$1,prevent_map_change_QMARK_,title))
).call(null,cljs.core.long$,weathergen.ui.display_params),new cljs.core.Keyword(null,"input","input",556931961),((function (opts,field,field_help,field_input,field_label,map__49475,map__49475__$1,prevent_map_change_QMARK_,title){
return (function (p1__49469_SHARP_){
return cljs.core.swap_BANG_.call(null,weathergen.ui.display_params,cljs.core.assoc,new cljs.core.Keyword(null,"opacity","opacity",397153780),(cljs.core.deref.call(null,p1__49469_SHARP_) / 100.0));
});})(opts,field,field_help,field_input,field_label,map__49475,map__49475__$1,prevent_map_change_QMARK_,title))
], null))], null))], null)], null);
})()));
});
weathergen.ui.weather_parameters = (function weathergen$ui$weather_parameters(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Weather parameters",new cljs.core.Keyword(null,"id","id",-1388402092),"weather-params-section",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__49493,G__49494){
return G__49493.call(null,G__49494,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),weathergen.ui.control_layout.call(null,new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Seed",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"seed","seed",68613327)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"white-space","white-space",-707351930),"nowrap"], null),weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"seed","seed",68613327)], null)),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),"75px"], null),new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc,new cljs.core.Keyword(null,"seed","seed",68613327),(cljs.core.rand_int.call(null,(5000)) + (100)));
}),"Random"))], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Min pressure",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"min","min",444991522)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Max pressure",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"max","max",61366548)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Prevailing wind",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"prevailing-wind","prevailing-wind",-190580386),new cljs.core.Keyword(null,"heading","heading",-1312171873)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Weather heading",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"direction","direction",-633359395),new cljs.core.Keyword(null,"heading","heading",-1312171873)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cell","cell",764245084),weathergen.ui.movement_params,new cljs.core.Keyword(null,"help-base","help-base",-1618186240),new cljs.core.Keyword(null,"movement-params","movement-params",293385966)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Weather speed",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"direction","direction",-633359395),new cljs.core.Keyword(null,"speed","speed",1257663751)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cell","cell",764245084),weathergen.ui.movement_params,new cljs.core.Keyword(null,"help-base","help-base",-1618186240),new cljs.core.Keyword(null,"movement-params","movement-params",293385966)], null)], null)], null)));
});
weathergen.ui.wind_stability_parameters = (function weathergen$ui$wind_stability_parameters(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204)], null),"Wind stability regions"),new cljs.core.Keyword(null,"id","id",-1388402092),"wind-stability-params-section",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__49514,G__49515){
return G__49514.call(null,G__49515,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),(function (){var indexed_wind_stability_areas = javelin.core.formula.call(null,(function (G__49518,G__49516,G__49517){
return G__49516.call(null,G__49517,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204).cljs$core$IFn$_invoke$arity$1(G__49518));
})).call(null,weathergen.ui.weather_params,cljs.core.map_indexed,cljs.core.vector);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"wind-stability-boxes",hoplon.core.loop_tpl_STAR_.call(null,indexed_wind_stability_areas,((function (indexed_wind_stability_areas){
return (function (item__29804__auto__){
var vec__49525 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (indexed_wind_stability_areas){
return (function (p__49528){
var vec__49529 = p__49528;
var index = cljs.core.nth.call(null,vec__49529,(0),null);
var area = cljs.core.nth.call(null,vec__49529,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [index,area], null);
});})(indexed_wind_stability_areas))
).call(null,item__29804__auto__));
var index = cljs.core.nth.call(null,vec__49525,(0),null);
var area = cljs.core.nth.call(null,vec__49525,(1),null);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"wind-stability-params",hoplon.core.table.call(null,hoplon.core.tbody.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,"NW corner"),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"bounds","bounds",1691609455),new cljs.core.Keyword(null,"x","x",2099068185)], null))),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"bounds","bounds",1691609455),new cljs.core.Keyword(null,"y","y",-1757859776)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,"Width/height"),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"bounds","bounds",1691609455),new cljs.core.Keyword(null,"width","width",-384071477)], null))),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"bounds","bounds",1691609455),new cljs.core.Keyword(null,"height","height",1025178622)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,"Wind spd/hdg"),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"speed","speed",1257663751)], null))),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"heading","heading",-1312171873)], null)))))),weathergen.ui.buttons.image_button.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"images/trash.png",new cljs.core.Keyword(null,"width","width",-384071477),"16px",new cljs.core.Keyword(null,"title","title",636505583),"Remove",new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__49525,index,area,indexed_wind_stability_areas){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),((function (vec__49525,index,area,indexed_wind_stability_areas){
return (function (areas){
return weathergen.ui.remove_nth.call(null,areas,cljs.core.deref.call(null,index));
});})(vec__49525,index,area,indexed_wind_stability_areas))
);
});})(vec__49525,index,area,indexed_wind_stability_areas))
),weathergen.ui.buttons.image_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__49525,index,area,indexed_wind_stability_areas){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null),cljs.core.not);
});})(vec__49525,index,area,indexed_wind_stability_areas))
,new cljs.core.Keyword(null,"title","title",636505583),"Edit",new cljs.core.Keyword(null,"src","src",-1651076051),"images/move.svg",new cljs.core.Keyword(null,"width","width",-384071477),"16px",new cljs.core.Keyword(null,"height","height",1025178622),"16px",new cljs.core.Keyword(null,"latched?","latched?",2124907793),javelin.core.formula.call(null,((function (vec__49525,index,area,indexed_wind_stability_areas){
return (function (G__49532){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(G__49532);
});})(vec__49525,index,area,indexed_wind_stability_areas))
).call(null,area)),hoplon.core.hr.call(null));
});})(indexed_wind_stability_areas))
));
})(),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),(function (areas){
return cljs.core.conj.call(null,areas,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"bounds","bounds",1691609455),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"width","width",-384071477),(10),new cljs.core.Keyword(null,"height","height",1025178622),(10)], null),new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"heading","heading",-1312171873),(45),new cljs.core.Keyword(null,"speed","speed",1257663751),(5)], null),new cljs.core.Keyword(null,"index","index",-1531685915),cljs.core.count.call(null,areas)], null));
}));
}),"Add New"));
});
weathergen.ui.weather_override_parameters = (function weathergen$ui$weather_override_parameters(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Weather override regions"),new cljs.core.Keyword(null,"id","id",-1388402092),"weather-override-params-section",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__49579,G__49580){
return G__49579.call(null,G__49580,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),(function (){var indexed_weather_overrides = javelin.core.formula.call(null,(function (weather_params){
return cljs.core.map_indexed.call(null,cljs.core.vector,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(weather_params));
})).call(null,weathergen.ui.weather_params);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"weather-override-boxes",hoplon.core.loop_tpl_STAR_.call(null,indexed_weather_overrides,((function (indexed_weather_overrides){
return (function (item__29804__auto__){
var vec__49587 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (indexed_weather_overrides){
return (function (p__49590){
var vec__49591 = p__49590;
var index = cljs.core.nth.call(null,vec__49591,(0),null);
var override = cljs.core.nth.call(null,vec__49591,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [override,index], null);
});})(indexed_weather_overrides))
).call(null,item__29804__auto__));
var override = cljs.core.nth.call(null,vec__49587,(0),null);
var index = cljs.core.nth.call(null,vec__49587,(1),null);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"weather-overrides",hoplon.core.table.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"weather-override-params",(function (){var checkbox = ((function (vec__49587,override,index,indexed_weather_overrides){
return (function weathergen$ui$weather_override_parameters_$_checkbox(l,k,p__49594){
var map__49599 = p__49594;
var map__49599__$1 = ((((!((map__49599 == null)))?((((map__49599.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49599.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49599):map__49599);
var change = cljs.core.get.call(null,map__49599__$1,new cljs.core.Keyword(null,"change","change",-1163046502));
var row_attrs = cljs.core.get.call(null,map__49599__$1,new cljs.core.Keyword(null,"row-attrs","row-attrs",2139633863));
return hoplon.core.tr.call(null,(function (){var or__23338__auto__ = row_attrs;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.PersistentVector.EMPTY;
}
})(),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(2),hoplon.core.input.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),"25px"], null),new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (map__49599,map__49599__$1,change,row_attrs,vec__49587,override,index,indexed_weather_overrides){
return (function (G__49602,G__49601){
return G__49601.call(null,G__49602);
});})(map__49599,map__49599__$1,change,row_attrs,vec__49587,override,index,indexed_weather_overrides))
).call(null,override,k),new cljs.core.Keyword(null,"change","change",-1163046502),(function (){var or__23338__auto__ = change;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return ((function (or__23338__auto__,map__49599,map__49599__$1,change,row_attrs,vec__49587,override,index,indexed_weather_overrides){
return (function (___$1){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),k], null),cljs.core.not);
});
;})(or__23338__auto__,map__49599,map__49599__$1,change,row_attrs,vec__49587,override,index,indexed_weather_overrides))
}
})()),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),k], null),hoplon.core.label.call(null,l))));
});})(vec__49587,override,index,indexed_weather_overrides))
;
return hoplon.core.tbody.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"center","center",-748944368)], null),"Center X/Y")),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"location","location",1815599388),new cljs.core.Keyword(null,"x","x",2099068185)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"input-attrs","input-attrs",-38113667),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px"], null)], null)], null)),weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"location","location",1815599388),new cljs.core.Keyword(null,"y","y",-1757859776)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"radius","radius",-2073122258)], null),"Radius")),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"radius","radius",-2073122258)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"falloff","falloff",-1639069456)], null),"Falloff")),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"falloff","falloff",-1639069456)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),"Pressure")),hoplon.core.td.call(null,weathergen.ui.pressure_edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),weathergen.ui.pressure_unit))),hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"strength","strength",-415606478)], null),"Strength")),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"strength","strength",-415606478)], null)))),checkbox.call(null,"Show outline?",new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348),cljs.core.PersistentArrayMap.EMPTY),checkbox.call(null,"Fade in/out?",new cljs.core.Keyword(null,"animate?","animate?",-1559039739),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"change","change",-1163046502),((function (checkbox,vec__49587,override,index,indexed_weather_overrides){
return (function (___$1){
return javelin.core.dosync_STAR_.call(null,((function (checkbox,vec__49587,override,index,indexed_weather_overrides){
return (function (){
cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"animate?","animate?",-1559039739)], null),cljs.core.not);

return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,((function (checkbox,vec__49587,override,index,indexed_weather_overrides){
return (function (weather_params){
if(cljs.core.truth_(cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"animate?","animate?",-1559039739)], null)))){
return weather_params;
} else {
return cljs.core.assoc_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"exclude-from-forecast?","exclude-from-forecast?",1182671640)], null),false);
}
});})(checkbox,vec__49587,override,index,indexed_weather_overrides))
);
});})(checkbox,vec__49587,override,index,indexed_weather_overrides))
);
});})(checkbox,vec__49587,override,index,indexed_weather_overrides))
], null)),(function (){var iter__24200__auto__ = ((function (checkbox,vec__49587,override,index,indexed_weather_overrides){
return (function weathergen$ui$weather_override_parameters_$_iter__49603(s__49604){
return (new cljs.core.LazySeq(null,((function (checkbox,vec__49587,override,index,indexed_weather_overrides){
return (function (){
var s__49604__$1 = s__49604;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__49604__$1);
if(temp__5278__auto__){
var s__49604__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49604__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__49604__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__49606 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__49605 = (0);
while(true){
if((i__49605 < size__24199__auto__)){
var vec__49615 = cljs.core._nth.call(null,c__24198__auto__,i__49605);
var label = cljs.core.nth.call(null,vec__49615,(0),null);
var k = cljs.core.nth.call(null,vec__49615,(1),null);
cljs.core.chunk_append.call(null,b__49606,hoplon.core.tr.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (i__49605,vec__49615,label,k,c__24198__auto__,size__24199__auto__,b__49606,s__49604__$2,temp__5278__auto__,checkbox,vec__49587,override,index,indexed_weather_overrides){
return (function (G__49618){
return new cljs.core.Keyword(null,"animate?","animate?",-1559039739).cljs$core$IFn$_invoke$arity$1(G__49618);
});})(i__49605,vec__49615,label,k,c__24198__auto__,size__24199__auto__,b__49606,s__49604__$2,temp__5278__auto__,checkbox,vec__49587,override,index,indexed_weather_overrides))
).call(null,override),hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),k], null),label)),hoplon.core.td.call(null,weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.weather_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),k], null)))));

var G__49625 = (i__49605 + (1));
i__49605 = G__49625;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49606),weathergen$ui$weather_override_parameters_$_iter__49603.call(null,cljs.core.chunk_rest.call(null,s__49604__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49606),null);
}
} else {
var vec__49619 = cljs.core.first.call(null,s__49604__$2);
var label = cljs.core.nth.call(null,vec__49619,(0),null);
var k = cljs.core.nth.call(null,vec__49619,(1),null);
return cljs.core.cons.call(null,hoplon.core.tr.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (vec__49619,label,k,s__49604__$2,temp__5278__auto__,checkbox,vec__49587,override,index,indexed_weather_overrides){
return (function (G__49622){
return new cljs.core.Keyword(null,"animate?","animate?",-1559039739).cljs$core$IFn$_invoke$arity$1(G__49622);
});})(vec__49619,label,k,s__49604__$2,temp__5278__auto__,checkbox,vec__49587,override,index,indexed_weather_overrides))
).call(null,override),hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),k], null),label)),hoplon.core.td.call(null,weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.weather_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),k], null)))),weathergen$ui$weather_override_parameters_$_iter__49603.call(null,cljs.core.rest.call(null,s__49604__$2)));
}
} else {
return null;
}
break;
}
});})(checkbox,vec__49587,override,index,indexed_weather_overrides))
,null,null));
});})(checkbox,vec__49587,override,index,indexed_weather_overrides))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Begin",new cljs.core.Keyword(null,"begin","begin",-319034319)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Peak",new cljs.core.Keyword(null,"peak","peak",389096055)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Taper",new cljs.core.Keyword(null,"taper","taper",1772067478)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["End",new cljs.core.Keyword(null,"end","end",-268185958)], null)], null));
})(),checkbox.call(null,"Exclude from forecast?",new cljs.core.Keyword(null,"exclude-from-forecast?","exclude-from-forecast?",1182671640),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"row-attrs","row-attrs",2139633863),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (checkbox,vec__49587,override,index,indexed_weather_overrides){
return (function (G__49623){
return new cljs.core.Keyword(null,"animate?","animate?",-1559039739).cljs$core$IFn$_invoke$arity$1(G__49623);
});})(checkbox,vec__49587,override,index,indexed_weather_overrides))
).call(null,override)], null)], null)));
})()),weathergen.ui.buttons.image_button.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"images/trash.png",new cljs.core.Keyword(null,"width","width",-384071477),"16px",new cljs.core.Keyword(null,"title","title",636505583),"Remove",new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__49587,override,index,indexed_weather_overrides){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),((function (vec__49587,override,index,indexed_weather_overrides){
return (function (overrides){
return weathergen.ui.remove_nth.call(null,overrides,cljs.core.deref.call(null,index));
});})(vec__49587,override,index,indexed_weather_overrides))
);
});})(vec__49587,override,index,indexed_weather_overrides))
),weathergen.ui.buttons.image_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__49587,override,index,indexed_weather_overrides){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null),cljs.core.not);
});})(vec__49587,override,index,indexed_weather_overrides))
,new cljs.core.Keyword(null,"title","title",636505583),"Edit",new cljs.core.Keyword(null,"src","src",-1651076051),"images/move.svg",new cljs.core.Keyword(null,"width","width",-384071477),"16px",new cljs.core.Keyword(null,"height","height",1025178622),"16px",new cljs.core.Keyword(null,"latched","latched",657080362),javelin.core.formula.call(null,((function (vec__49587,override,index,indexed_weather_overrides){
return (function (G__49624){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(G__49624);
});})(vec__49587,override,index,indexed_weather_overrides))
).call(null,override)));
});})(indexed_weather_overrides))
));
})(),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,(function (wp){
return cljs.core.update.call(null,wp,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),(function (overrides){
return cljs.core.conj.call(null,overrides,cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348),new cljs.core.Keyword(null,"radius","radius",-2073122258),new cljs.core.Keyword(null,"falloff","falloff",-1639069456),new cljs.core.Keyword(null,"begin","begin",-319034319),new cljs.core.Keyword(null,"strength","strength",-415606478),new cljs.core.Keyword(null,"taper","taper",1772067478),new cljs.core.Keyword(null,"peak","peak",389096055),new cljs.core.Keyword(null,"exclude-from-forecast?","exclude-from-forecast?",1182671640),new cljs.core.Keyword(null,"end","end",-268185958),new cljs.core.Keyword(null,"location","location",1815599388)],[new cljs.core.Keyword(null,"min","min",444991522).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"pressure","pressure",505343747).cljs$core$IFn$_invoke$arity$1(wp)),true,(8),(2),new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(wp)),(1),weathergen.time.add_minutes.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(wp)),(180)),weathergen.time.add_minutes.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(wp)),(60)),false,weathergen.time.add_minutes.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(wp)),(240)),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),(30),new cljs.core.Keyword(null,"y","y",-1757859776),(30)], null)]));
}));
}));
}),"Add New"));
});
weathergen.ui.weather_type_configuration = (function weathergen$ui$weather_type_configuration(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Weather type configuration",new cljs.core.Keyword(null,"id","id",-1388402092),"weather-type-configuration-section",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__49681,G__49682){
return G__49681.call(null,G__49682,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),hoplon.core.table.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"category-params",hoplon.core.thead.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,""),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(2),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-type-config","weather-type-config",-2069342501),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),"Pressure")),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(3),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-type-config","weather-type-config",-2069342501),new cljs.core.Keyword(null,"wind","wind",-527553074)], null),"Wind")),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(3),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-type-config","weather-type-config",-2069342501),new cljs.core.Keyword(null,"temp","temp",1791541284)], null),"Temperature"))),hoplon.core.tr.call(null,cljs.core.map.call(null,(function (p1__49626_SHARP_){
return cljs.core.apply.call(null,hoplon.core.td,p1__49626_SHARP_);
}),new cljs.core.PersistentVector(null, 9, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [""], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["From"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["To"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Min"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Mean"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Max"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Min"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Mean"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Max"], null)], null)))),hoplon.core.tbody.call(null,(function (){var iter__24200__auto__ = (function weathergen$ui$weather_type_configuration_$_iter__49683(s__49684){
return (new cljs.core.LazySeq(null,(function (){
var s__49684__$1 = s__49684;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__49684__$1);
if(temp__5278__auto__){
var s__49684__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49684__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__49684__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__49686 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__49685 = (0);
while(true){
if((i__49685 < size__24199__auto__)){
var category = cljs.core._nth.call(null,c__24198__auto__,i__49685);
cljs.core.chunk_append.call(null,b__49686,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("weather-type "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,category))].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, ["background-color",(function (){var vec__49711 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__49711,(0),null);
var g = cljs.core.nth.call(null,vec__49711,(1),null);
var b = cljs.core.nth.call(null,vec__49711,(2),null);
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgb("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var pred__49714 = cljs.core.contains_QMARK_;
var expr__49715 = category;
if(cljs.core.truth_(pred__49714.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null], null), null),expr__49715))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (i__49685,pred__49714,expr__49715,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)),pressure_unit);
});})(i__49685,pred__49714,expr__49715,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit)),hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (i__49685,pred__49714,expr__49715,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"max","max",61366548)], null)),pressure_unit);
});})(i__49685,pred__49714,expr__49715,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit))], null);
} else {
if(cljs.core.truth_(pred__49714.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"poor","poor",1462482211),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null),expr__49715))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (i__49685,pred__49714,expr__49715,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"fair","fair",1684139423),category))?new cljs.core.Keyword(null,"poor","poor",1462482211):new cljs.core.Keyword(null,"inclement","inclement",-550669382)),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)),pressure_unit);
});})(i__49685,pred__49714,expr__49715,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit)),hoplon.core.td.call(null,hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.pressure_edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),weathergen.ui.pressure_unit)))], null);
} else {
if(cljs.core.truth_(pred__49714.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"inclement","inclement",-550669382),null], null), null),expr__49715))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (i__49685,pred__49714,expr__49715,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"min","min",444991522)], null)),pressure_unit);
});})(i__49685,pred__49714,expr__49715,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit)),hoplon.core.td.call(null,hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.pressure_edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),weathergen.ui.pressure_unit)))], null);
} else {
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("No matching clause: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(expr__49715)].join('')));
}
}
}
})(),(function (){var iter__24200__auto__ = ((function (i__49685,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__){
return (function weathergen$ui$weather_type_configuration_$_iter__49683_$_iter__49717(s__49718){
return (new cljs.core.LazySeq(null,((function (i__49685,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__){
return (function (){
var s__49718__$1 = s__49718;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__49718__$1);
if(temp__5278__auto____$1){
var xs__5831__auto__ = temp__5278__auto____$1;
var param = cljs.core.first.call(null,xs__5831__auto__);
var iterys__24196__auto__ = ((function (s__49718__$1,i__49685,param,xs__5831__auto__,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__){
return (function weathergen$ui$weather_type_configuration_$_iter__49683_$_iter__49717_$_iter__49719(s__49720){
return (new cljs.core.LazySeq(null,((function (s__49718__$1,i__49685,param,xs__5831__auto__,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__){
return (function (){
var s__49720__$1 = s__49720;
while(true){
var temp__5278__auto____$2 = cljs.core.seq.call(null,s__49720__$1);
if(temp__5278__auto____$2){
var s__49720__$2 = temp__5278__auto____$2;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49720__$2)){
var c__24198__auto____$1 = cljs.core.chunk_first.call(null,s__49720__$2);
var size__24199__auto____$1 = cljs.core.count.call(null,c__24198__auto____$1);
var b__49722 = cljs.core.chunk_buffer.call(null,size__24199__auto____$1);
if((function (){var i__49721 = (0);
while(true){
if((i__49721 < size__24199__auto____$1)){
var metric = cljs.core._nth.call(null,c__24198__auto____$1,i__49721);
cljs.core.chunk_append.call(null,b__49722,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,param)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,metric))].join(''),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,param,metric], null)))));

var G__49735 = (i__49721 + (1));
i__49721 = G__49735;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49722),weathergen$ui$weather_type_configuration_$_iter__49683_$_iter__49717_$_iter__49719.call(null,cljs.core.chunk_rest.call(null,s__49720__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49722),null);
}
} else {
var metric = cljs.core.first.call(null,s__49720__$2);
return cljs.core.cons.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,param)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,metric))].join(''),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,param,metric], null)))),weathergen$ui$weather_type_configuration_$_iter__49683_$_iter__49717_$_iter__49719.call(null,cljs.core.rest.call(null,s__49720__$2)));
}
} else {
return null;
}
break;
}
});})(s__49718__$1,i__49685,param,xs__5831__auto__,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__))
,null,null));
});})(s__49718__$1,i__49685,param,xs__5831__auto__,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"min","min",444991522),new cljs.core.Keyword(null,"mean","mean",-1359234715),new cljs.core.Keyword(null,"max","max",61366548)], null)));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$weather_type_configuration_$_iter__49683_$_iter__49717.call(null,cljs.core.rest.call(null,s__49718__$1)));
} else {
var G__49736 = cljs.core.rest.call(null,s__49718__$1);
s__49718__$1 = G__49736;
continue;
}
} else {
return null;
}
break;
}
});})(i__49685,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__))
,null,null));
});})(i__49685,category,c__24198__auto__,size__24199__auto__,b__49686,s__49684__$2,temp__5278__auto__))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"temp","temp",1791541284)], null));
})()));

var G__49737 = (i__49685 + (1));
i__49685 = G__49737;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49686),weathergen$ui$weather_type_configuration_$_iter__49683.call(null,cljs.core.chunk_rest.call(null,s__49684__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49686),null);
}
} else {
var category = cljs.core.first.call(null,s__49684__$2);
return cljs.core.cons.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("weather-type "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,category))].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, ["background-color",(function (){var vec__49723 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__49723,(0),null);
var g = cljs.core.nth.call(null,vec__49723,(1),null);
var b = cljs.core.nth.call(null,vec__49723,(2),null);
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgb("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var pred__49726 = cljs.core.contains_QMARK_;
var expr__49727 = category;
if(cljs.core.truth_(pred__49726.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null], null), null),expr__49727))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (pred__49726,expr__49727,category,s__49684__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)),pressure_unit);
});})(pred__49726,expr__49727,category,s__49684__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit)),hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (pred__49726,expr__49727,category,s__49684__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"max","max",61366548)], null)),pressure_unit);
});})(pred__49726,expr__49727,category,s__49684__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit))], null);
} else {
if(cljs.core.truth_(pred__49726.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"poor","poor",1462482211),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null),expr__49727))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (pred__49726,expr__49727,category,s__49684__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"fair","fair",1684139423),category))?new cljs.core.Keyword(null,"poor","poor",1462482211):new cljs.core.Keyword(null,"inclement","inclement",-550669382)),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)),pressure_unit);
});})(pred__49726,expr__49727,category,s__49684__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit)),hoplon.core.td.call(null,hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.pressure_edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),weathergen.ui.pressure_unit)))], null);
} else {
if(cljs.core.truth_(pred__49726.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"inclement","inclement",-550669382),null], null), null),expr__49727))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (pred__49726,expr__49727,category,s__49684__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"min","min",444991522)], null)),pressure_unit);
});})(pred__49726,expr__49727,category,s__49684__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit)),hoplon.core.td.call(null,hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.pressure_edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),weathergen.ui.pressure_unit)))], null);
} else {
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("No matching clause: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(expr__49727)].join('')));
}
}
}
})(),(function (){var iter__24200__auto__ = ((function (category,s__49684__$2,temp__5278__auto__){
return (function weathergen$ui$weather_type_configuration_$_iter__49683_$_iter__49729(s__49730){
return (new cljs.core.LazySeq(null,((function (category,s__49684__$2,temp__5278__auto__){
return (function (){
var s__49730__$1 = s__49730;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__49730__$1);
if(temp__5278__auto____$1){
var xs__5831__auto__ = temp__5278__auto____$1;
var param = cljs.core.first.call(null,xs__5831__auto__);
var iterys__24196__auto__ = ((function (s__49730__$1,param,xs__5831__auto__,temp__5278__auto____$1,category,s__49684__$2,temp__5278__auto__){
return (function weathergen$ui$weather_type_configuration_$_iter__49683_$_iter__49729_$_iter__49731(s__49732){
return (new cljs.core.LazySeq(null,((function (s__49730__$1,param,xs__5831__auto__,temp__5278__auto____$1,category,s__49684__$2,temp__5278__auto__){
return (function (){
var s__49732__$1 = s__49732;
while(true){
var temp__5278__auto____$2 = cljs.core.seq.call(null,s__49732__$1);
if(temp__5278__auto____$2){
var s__49732__$2 = temp__5278__auto____$2;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49732__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__49732__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__49734 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__49733 = (0);
while(true){
if((i__49733 < size__24199__auto__)){
var metric = cljs.core._nth.call(null,c__24198__auto__,i__49733);
cljs.core.chunk_append.call(null,b__49734,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,param)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,metric))].join(''),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,param,metric], null)))));

var G__49738 = (i__49733 + (1));
i__49733 = G__49738;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49734),weathergen$ui$weather_type_configuration_$_iter__49683_$_iter__49729_$_iter__49731.call(null,cljs.core.chunk_rest.call(null,s__49732__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49734),null);
}
} else {
var metric = cljs.core.first.call(null,s__49732__$2);
return cljs.core.cons.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,param)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,metric))].join(''),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,param,metric], null)))),weathergen$ui$weather_type_configuration_$_iter__49683_$_iter__49729_$_iter__49731.call(null,cljs.core.rest.call(null,s__49732__$2)));
}
} else {
return null;
}
break;
}
});})(s__49730__$1,param,xs__5831__auto__,temp__5278__auto____$1,category,s__49684__$2,temp__5278__auto__))
,null,null));
});})(s__49730__$1,param,xs__5831__auto__,temp__5278__auto____$1,category,s__49684__$2,temp__5278__auto__))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"min","min",444991522),new cljs.core.Keyword(null,"mean","mean",-1359234715),new cljs.core.Keyword(null,"max","max",61366548)], null)));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$weather_type_configuration_$_iter__49683_$_iter__49729.call(null,cljs.core.rest.call(null,s__49730__$1)));
} else {
var G__49739 = cljs.core.rest.call(null,s__49730__$1);
s__49730__$1 = G__49739;
continue;
}
} else {
return null;
}
break;
}
});})(category,s__49684__$2,temp__5278__auto__))
,null,null));
});})(category,s__49684__$2,temp__5278__auto__))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"temp","temp",1791541284)], null));
})()),weathergen$ui$weather_type_configuration_$_iter__49683.call(null,cljs.core.rest.call(null,s__49684__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null));
})())));
});
if(typeof weathergen.ui.cloud_param_conformer !== 'undefined'){
} else {
weathergen.ui.cloud_param_conformer = (function (){var method_table__24369__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__24370__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__24371__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__24372__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__24373__auto__ = cljs.core.get.call(null,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"weathergen.ui","cloud-param-conformer"),((function (method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__){
return (function (params,column,category){
return column;
});})(method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__))
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__24373__auto__,method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__));
})();
}
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"default","default",-1987822328),(function (params,column,category){
return weathergen.ui.int_conformer.call(null,(0),(99999));
}));
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"visibility","visibility",1338380893),(function (params,column,category){
return weathergen.ui.float_conformer.call(null,(0),(30));
}));
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),(function (params,column,category){
return (function (val_c){
var conformer = weathergen.ui.int_conformer.call(null,(0),(99999));
var conformed = conformer.call(null,val_c);
return javelin.core.formula.call(null,((function (conformer,conformed){
return (function (params__$1,conformed__$1){
var stratus_top = new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(params__$1);
if(cljs.core.not.call(null,new cljs.core.Keyword(null,"valid?","valid?",-212412379).cljs$core$IFn$_invoke$arity$1(conformed__$1))){
return conformed__$1;
} else {
if(cljs.core.truth_((function (){var and__23326__auto__ = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"poor","poor",1462482211),null,new cljs.core.Keyword(null,"inclement","inclement",-550669382),null], null), null).call(null,category);
if(cljs.core.truth_(and__23326__auto__)){
return (stratus_top < new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1));
} else {
return and__23326__auto__;
}
})())){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),false,new cljs.core.Keyword(null,"message","message",-406056002),"Stratus base must be below stratus top.",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1)], null);
} else {
return conformed__$1;

}
}
});})(conformer,conformed))
).call(null,params,conformed);
});
}));
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),(function (params,column,category){
return (function (val_c){
var ic = weathergen.ui.int_conformer.call(null,(0),(99999));
var conformed = ic.call(null,val_c);
return javelin.core.formula.call(null,((function (ic,conformed){
return (function (params__$1,conformed__$1){
var stratus_base = (function (){var x__23676__auto__ = cljs.core.get_in.call(null,params__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),new cljs.core.Keyword(null,"poor","poor",1462482211)], null));
var y__23677__auto__ = cljs.core.get_in.call(null,params__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null));
return ((x__23676__auto__ > y__23677__auto__) ? x__23676__auto__ : y__23677__auto__);
})();
if(cljs.core.not.call(null,new cljs.core.Keyword(null,"valid?","valid?",-212412379).cljs$core$IFn$_invoke$arity$1(conformed__$1))){
return conformed__$1;
} else {
if(cljs.core.truth_((function (){var and__23326__auto__ = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"poor","poor",1462482211),null,new cljs.core.Keyword(null,"inclement","inclement",-550669382),null], null), null).call(null,category);
if(cljs.core.truth_(and__23326__auto__)){
return (new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1) < stratus_base);
} else {
return and__23326__auto__;
}
})())){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),false,new cljs.core.Keyword(null,"message","message",-406056002),"Stratus base must be below stratus top.",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1)], null);
} else {
return conformed__$1;

}
}
});})(ic,conformed))
).call(null,params,conformed);
});
}));
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),(function (params,column,category){
return (function (val_c){
var ic = weathergen.ui.int_conformer.call(null,(0),(99999));
var conformed = ic.call(null,val_c);
return javelin.core.formula.call(null,((function (ic,conformed){
return (function (params__$1,conformed__$1){
var stratus_top = (cljs.core.truth_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null).call(null,category))?cljs.core.get_in.call(null,params__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),category], null)):new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(params__$1));
if(cljs.core.not.call(null,new cljs.core.Keyword(null,"valid?","valid?",-212412379).cljs$core$IFn$_invoke$arity$1(conformed__$1))){
return conformed__$1;
} else {
if(((stratus_top - (1000)) < new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1))){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),false,new cljs.core.Keyword(null,"message","message",-406056002),"Cumulus base must be at least 1000 feet below stratus top.",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1)], null);
} else {
return conformed__$1;

}
}
});})(ic,conformed))
).call(null,params,conformed);
});
}));
weathergen.ui.cloud_controls = (function weathergen$ui$cloud_controls(opts){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Clouds and contrails"),new cljs.core.Keyword(null,"id","id",-1388402092),cljs.core.gensym.call(null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__49863,G__49864){
return G__49863.call(null,G__49864,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"buttons","buttons",-1953831197)], null)),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px"], null),new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.cloud_params,weathergen.ui.random_cloud_params.call(null));
}),"Randomize"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return weathergen.ui.save_twx.call(null,cljs.core.deref.call(null,weathergen.ui.cloud_params),new cljs.core.Keyword(null,"direction","direction",-633359395).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.movement_params)),new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)));
}),"Save .TWX")),hoplon.core.table.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"cumulus-coverage","cumulus-coverage",255977312)], null),"Cumulus coverage")),hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"text-align","text-align",1786091845),"right"], null),"5%"),(function (){var l = weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-density","cumulus-density",-212067170)], null));
return hoplon.core.td.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"range",new cljs.core.Keyword(null,"disabled","disabled",-1529784218),javelin.core.formula.call(null,((function (l){
return (function (G__49865,G__49866){
return G__49865.call(null,G__49866,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(l))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode),new cljs.core.Keyword(null,"value","value",305978217),l,new cljs.core.Keyword(null,"min","min",444991522),(5),new cljs.core.Keyword(null,"max","max",61366548),(50),new cljs.core.Keyword(null,"change","change",-1163046502),((function (l){
return (function (p1__49740_SHARP_){
return cljs.core.reset_BANG_.call(null,l,cljs.core.long$.call(null,cljs.core.deref.call(null,p1__49740_SHARP_)));
});})(l))
));
})(),hoplon.core.td.call(null,"50%")),hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"cumulus-size","cumulus-size",-954219270)], null),"Cumulus qty/size")),hoplon.core.td.call(null,hoplon.core.div.call(null,"Fewer/",hoplon.core.br.call(null),"Larger")),(function (){var l = weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-size","cumulus-size",-954219270)], null));
return hoplon.core.td.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"range",new cljs.core.Keyword(null,"disabled","disabled",-1529784218),javelin.core.formula.call(null,((function (l){
return (function (G__49867,G__49868){
return G__49867.call(null,G__49868,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(l))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode),new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (l){
return (function (G__49869,G__49870){
return G__49869.call(null,(G__49870 * (20)));
});})(l))
).call(null,cljs.core.long$,l),new cljs.core.Keyword(null,"min","min",444991522),(0),new cljs.core.Keyword(null,"max","max",61366548),(100),new cljs.core.Keyword(null,"change","change",-1163046502),((function (l){
return (function (p1__49741_SHARP_){
return cljs.core.reset_BANG_.call(null,l,(cljs.core.long$.call(null,cljs.core.deref.call(null,p1__49741_SHARP_)) / 20.0));
});})(l))
));
})(),hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"text-align","text-align",1786091845),"right"], null),hoplon.core.div.call(null,"More/",hoplon.core.br.call(null),"Smaller")))),hoplon.core.table.call(null,hoplon.core.thead.call(null,(function (){var header = (function (path,words){
return hoplon.core.td.call(null,cljs.core.map.call(null,(function (p1__49742_SHARP_){
return hoplon.core.div.call(null,weathergen.help.with_help.call(null,path,p1__49742_SHARP_));
}),words));
});
return hoplon.core.tr.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),hoplon.core.td.call(null),header.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"visibility","visibility",1338380893)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Visibility"], null)),header.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Stratus","Base"], null)),header.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Stratus","Top"], null)),header.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Cumulus","Base"], null)),header.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"contrails","contrails",1430581743)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Contrails"], null)));
})()),hoplon.core.tbody.call(null,(function (){var iter__24200__auto__ = (function weathergen$ui$cloud_controls_$_iter__49871(s__49872){
return (new cljs.core.LazySeq(null,(function (){
var s__49872__$1 = s__49872;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__49872__$1);
if(temp__5278__auto__){
var s__49872__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49872__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__49872__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__49874 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__49873 = (0);
while(true){
if((i__49873 < size__24199__auto__)){
var category = cljs.core._nth.call(null,c__24198__auto__,i__49873);
cljs.core.chunk_append.call(null,b__49874,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("weather-type "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,category))].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background-color","background-color",570434026),(function (){var vec__49929 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__49929,(0),null);
var g = cljs.core.nth.call(null,vec__49929,(1),null);
var b = cljs.core.nth.call(null,vec__49929,(2),null);
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgb("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var iter__24200__auto__ = ((function (i__49873,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function weathergen$ui$cloud_controls_$_iter__49871_$_iter__49932(s__49933){
return (new cljs.core.LazySeq(null,((function (i__49873,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (){
var s__49933__$1 = s__49933;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__49933__$1);
if(temp__5278__auto____$1){
var s__49933__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49933__$2)){
var c__24198__auto____$1 = cljs.core.chunk_first.call(null,s__49933__$2);
var size__24199__auto____$1 = cljs.core.count.call(null,c__24198__auto____$1);
var b__49935 = cljs.core.chunk_buffer.call(null,size__24199__auto____$1);
if((function (){var i__49934 = (0);
while(true){
if((i__49934 < size__24199__auto____$1)){
var column = cljs.core._nth.call(null,c__24198__auto____$1,i__49934);
cljs.core.chunk_append.call(null,b__49935,hoplon.core.td.call(null,(function (){var path = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null);
var literal_style = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px",new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),"2px",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"93%",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null);
if(cljs.core.truth_((function (){var and__23326__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),column);
if(and__23326__auto__){
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null).call(null,category);
} else {
return and__23326__auto__;
}
})())){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__49934,i__49873,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (cloud_params){
return cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),category], null));
});})(i__49934,i__49873,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.Keyword(null,"sunny","sunny",1448267778)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null))){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,"0");
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null),path)){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__49934,i__49873,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (cloud_params){
return new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(cloud_params);
});})(i__49934,i__49873,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
var l = weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)))?new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)], null):path));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"text-align","text-align",1786091845),"right"], null),(function (){var con__29830__auto__ = (new cljs.core.Delay(((function (i__49934,i__49873,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.assoc.call(null,literal_style,new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.px.call(null,(35)):weathergen.ui.common.px.call(null,(55)))),javelin.core.formula.call(null,((function (i__49934,i__49873,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (l__$1){
if(cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893))){
return weathergen.ui.format_visibility.call(null,l__$1);
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(l__$1)].join('');
}
});})(i__49934,i__49873,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
).call(null,l));
});})(i__49934,i__49873,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
,null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (i__49934,i__49873,con__29830__auto__,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (){
return weathergen.ui.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),l,new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:cljs.core.str),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.cloud_param_conformer.call(null,weathergen.ui.cloud_params,column,category),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(function (){var pred__49946 = cljs.core._EQ_;
var expr__49947 = column;
if(cljs.core.truth_(pred__49946.call(null,new cljs.core.Keyword(null,"visibility","visibility",1338380893),expr__49947))){
return "vis (nm)";
} else {
return "altitude";
}
})(),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?(35):(55)));
});})(i__49934,i__49873,con__29830__auto__,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
,null));
var tpl__29832__auto__ = ((function (i__49934,i__49873,con__29830__auto__,alt__29831__auto__,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(i__49934,i__49873,con__29830__auto__,alt__29831__auto__,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,javelin.core.formula.call(null,((function (i__49934,i__49873,con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (G__49949,G__49950){
return G__49949.call(null,G__49950,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(i__49934,i__49873,con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49935,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})());

}
}
}
})()));

var G__49983 = (i__49934 + (1));
i__49934 = G__49983;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49935),weathergen$ui$cloud_controls_$_iter__49871_$_iter__49932.call(null,cljs.core.chunk_rest.call(null,s__49933__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49935),null);
}
} else {
var column = cljs.core.first.call(null,s__49933__$2);
return cljs.core.cons.call(null,hoplon.core.td.call(null,(function (){var path = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null);
var literal_style = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px",new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),"2px",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"93%",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null);
if(cljs.core.truth_((function (){var and__23326__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),column);
if(and__23326__auto__){
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null).call(null,category);
} else {
return and__23326__auto__;
}
})())){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__49873,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (cloud_params){
return cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),category], null));
});})(i__49873,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.Keyword(null,"sunny","sunny",1448267778)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null))){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,"0");
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null),path)){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__49873,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (cloud_params){
return new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(cloud_params);
});})(i__49873,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
var l = weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)))?new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)], null):path));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"text-align","text-align",1786091845),"right"], null),(function (){var con__29830__auto__ = (new cljs.core.Delay(((function (i__49873,l,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.assoc.call(null,literal_style,new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.px.call(null,(35)):weathergen.ui.common.px.call(null,(55)))),javelin.core.formula.call(null,((function (i__49873,l,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (l__$1){
if(cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893))){
return weathergen.ui.format_visibility.call(null,l__$1);
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(l__$1)].join('');
}
});})(i__49873,l,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
).call(null,l));
});})(i__49873,l,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
,null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (i__49873,con__29830__auto__,l,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (){
return weathergen.ui.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),l,new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:cljs.core.str),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.cloud_param_conformer.call(null,weathergen.ui.cloud_params,column,category),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(function (){var pred__49951 = cljs.core._EQ_;
var expr__49952 = column;
if(cljs.core.truth_(pred__49951.call(null,new cljs.core.Keyword(null,"visibility","visibility",1338380893),expr__49952))){
return "vis (nm)";
} else {
return "altitude";
}
})(),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?(35):(55)));
});})(i__49873,con__29830__auto__,l,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
,null));
var tpl__29832__auto__ = ((function (i__49873,con__29830__auto__,alt__29831__auto__,l,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(i__49873,con__29830__auto__,alt__29831__auto__,l,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,javelin.core.formula.call(null,((function (i__49873,con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,l,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__){
return (function (G__49954,G__49955){
return G__49954.call(null,G__49955,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(i__49873,con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,l,path,literal_style,column,s__49933__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})());

}
}
}
})()),weathergen$ui$cloud_controls_$_iter__49871_$_iter__49932.call(null,cljs.core.rest.call(null,s__49933__$2)));
}
} else {
return null;
}
break;
}
});})(i__49873,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
,null,null));
});})(i__49873,category,c__24198__auto__,size__24199__auto__,b__49874,s__49872__$2,temp__5278__auto__))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.Keyword(null,"contrails","contrails",1430581743)], null));
})()));

var G__49984 = (i__49873 + (1));
i__49873 = G__49984;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49874),weathergen$ui$cloud_controls_$_iter__49871.call(null,cljs.core.chunk_rest.call(null,s__49872__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49874),null);
}
} else {
var category = cljs.core.first.call(null,s__49872__$2);
return cljs.core.cons.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("weather-type "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,category))].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background-color","background-color",570434026),(function (){var vec__49956 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__49956,(0),null);
var g = cljs.core.nth.call(null,vec__49956,(1),null);
var b = cljs.core.nth.call(null,vec__49956,(2),null);
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgb("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var iter__24200__auto__ = ((function (category,s__49872__$2,temp__5278__auto__){
return (function weathergen$ui$cloud_controls_$_iter__49871_$_iter__49959(s__49960){
return (new cljs.core.LazySeq(null,((function (category,s__49872__$2,temp__5278__auto__){
return (function (){
var s__49960__$1 = s__49960;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__49960__$1);
if(temp__5278__auto____$1){
var s__49960__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49960__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__49960__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__49962 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__49961 = (0);
while(true){
if((i__49961 < size__24199__auto__)){
var column = cljs.core._nth.call(null,c__24198__auto__,i__49961);
cljs.core.chunk_append.call(null,b__49962,hoplon.core.td.call(null,(function (){var path = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null);
var literal_style = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px",new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),"2px",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"93%",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null);
if(cljs.core.truth_((function (){var and__23326__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),column);
if(and__23326__auto__){
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null).call(null,category);
} else {
return and__23326__auto__;
}
})())){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__49961,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (cloud_params){
return cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),category], null));
});})(i__49961,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.Keyword(null,"sunny","sunny",1448267778)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null))){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,"0");
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null),path)){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__49961,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (cloud_params){
return new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(cloud_params);
});})(i__49961,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
var l = weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)))?new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)], null):path));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"text-align","text-align",1786091845),"right"], null),(function (){var con__29830__auto__ = (new cljs.core.Delay(((function (i__49961,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.assoc.call(null,literal_style,new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.px.call(null,(35)):weathergen.ui.common.px.call(null,(55)))),javelin.core.formula.call(null,((function (i__49961,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (l__$1){
if(cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893))){
return weathergen.ui.format_visibility.call(null,l__$1);
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(l__$1)].join('');
}
});})(i__49961,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
).call(null,l));
});})(i__49961,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
,null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (i__49961,con__29830__auto__,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (){
return weathergen.ui.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),l,new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:cljs.core.str),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.cloud_param_conformer.call(null,weathergen.ui.cloud_params,column,category),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(function (){var pred__49973 = cljs.core._EQ_;
var expr__49974 = column;
if(cljs.core.truth_(pred__49973.call(null,new cljs.core.Keyword(null,"visibility","visibility",1338380893),expr__49974))){
return "vis (nm)";
} else {
return "altitude";
}
})(),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?(35):(55)));
});})(i__49961,con__29830__auto__,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
,null));
var tpl__29832__auto__ = ((function (i__49961,con__29830__auto__,alt__29831__auto__,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(i__49961,con__29830__auto__,alt__29831__auto__,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,javelin.core.formula.call(null,((function (i__49961,con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (G__49976,G__49977){
return G__49976.call(null,G__49977,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(i__49961,con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49962,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})());

}
}
}
})()));

var G__49985 = (i__49961 + (1));
i__49961 = G__49985;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49962),weathergen$ui$cloud_controls_$_iter__49871_$_iter__49959.call(null,cljs.core.chunk_rest.call(null,s__49960__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49962),null);
}
} else {
var column = cljs.core.first.call(null,s__49960__$2);
return cljs.core.cons.call(null,hoplon.core.td.call(null,(function (){var path = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null);
var literal_style = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px",new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),"2px",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"93%",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null);
if(cljs.core.truth_((function (){var and__23326__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),column);
if(and__23326__auto__){
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null).call(null,category);
} else {
return and__23326__auto__;
}
})())){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (cloud_params){
return cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),category], null));
});})(path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.Keyword(null,"sunny","sunny",1448267778)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null))){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,"0");
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null),path)){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (cloud_params){
return new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(cloud_params);
});})(path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
var l = weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)))?new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)], null):path));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"text-align","text-align",1786091845),"right"], null),(function (){var con__29830__auto__ = (new cljs.core.Delay(((function (l,path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.assoc.call(null,literal_style,new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.px.call(null,(35)):weathergen.ui.common.px.call(null,(55)))),javelin.core.formula.call(null,((function (l,path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (l__$1){
if(cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893))){
return weathergen.ui.format_visibility.call(null,l__$1);
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(l__$1)].join('');
}
});})(l,path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
).call(null,l));
});})(l,path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
,null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__,l,path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (){
return weathergen.ui.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),l,new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:cljs.core.str),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.cloud_param_conformer.call(null,weathergen.ui.cloud_params,column,category),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(function (){var pred__49978 = cljs.core._EQ_;
var expr__49979 = column;
if(cljs.core.truth_(pred__49978.call(null,new cljs.core.Keyword(null,"visibility","visibility",1338380893),expr__49979))){
return "vis (nm)";
} else {
return "altitude";
}
})(),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?(35):(55)));
});})(con__29830__auto__,l,path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__,l,path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__,l,path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,javelin.core.formula.call(null,((function (con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,l,path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__){
return (function (G__49981,G__49982){
return G__49981.call(null,G__49982,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,l,path,literal_style,column,s__49960__$2,temp__5278__auto____$1,category,s__49872__$2,temp__5278__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})());

}
}
}
})()),weathergen$ui$cloud_controls_$_iter__49871_$_iter__49959.call(null,cljs.core.rest.call(null,s__49960__$2)));
}
} else {
return null;
}
break;
}
});})(category,s__49872__$2,temp__5278__auto__))
,null,null));
});})(category,s__49872__$2,temp__5278__auto__))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.Keyword(null,"contrails","contrails",1430581743)], null));
})()),weathergen$ui$cloud_controls_$_iter__49871.call(null,cljs.core.rest.call(null,s__49872__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null));
})())));
});
weathergen.ui.advanced_controls = (function weathergen$ui$advanced_controls(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"advanced-params-section",new cljs.core.Keyword(null,"title","title",636505583),"Advanced configuration",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__49988,G__49989){
return G__49988.call(null,G__49989,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),weathergen.ui.control_layout.call(null,new cljs.core.PersistentVector(null, 9, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["X Offset",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"origin","origin",1037372088),(0)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"help-path","help-path",840478713),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"origin","origin",1037372088),new cljs.core.Keyword(null,"x","x",2099068185)], null)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Y Offset",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"origin","origin",1037372088),(1)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"help-path","help-path",840478713),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"origin","origin",1037372088),new cljs.core.Keyword(null,"y","y",-1757859776)], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["T Offset",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"offset","offset",296498311)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Evolution",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"evolution","evolution",944820557)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Wind uniformity",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-uniformity","wind-uniformity",827531801)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Temp uniformity",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"temp-uniformity","temp-uniformity",836756864)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Warp strength",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"turbulence","turbulence",-915506410),new cljs.core.Keyword(null,"power","power",-937852079)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Crossfade",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"crossfade","crossfade",-118506406)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Zoom",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"feature-size","feature-size",-878734864)], null)], null)], null)));
});
weathergen.ui.step_controls = (function weathergen$ui$step_controls(_){
var mission_time = javelin.core.formula.call(null,(function (G__50005,G__50006){
return G__50005.call(null,G__50006);
})).call(null,weathergen.falcon.files.mission.mission_time,weathergen.ui.mission);
var max_time = javelin.core.formula.call(null,((function (mission_time){
return (function (G__50008,G__50007){
return G__50007.call(null,new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(G__50008)));
});})(mission_time))
).call(null,weathergen.ui.weather_params,weathergen.time.campaign_time__GT_minutes);
var weather_time = javelin.core.formula.call(null,((function (mission_time,max_time){
return (function (G__50010,G__50009){
return G__50009.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(G__50010)));
});})(mission_time,max_time))
).call(null,weathergen.ui.weather_params,weathergen.time.campaign_time__GT_minutes);
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"time-location-params",new cljs.core.Keyword(null,"title","title",636505583),"Time controls",hoplon.core.table.call(null,hoplon.core.tbody.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"falcon-time","falcon-time",34959931)], null),"Falcon time: ")),hoplon.core.td.call(null,javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (G__50012,G__50011){
return G__50011.call(null,G__50012);
});})(mission_time,max_time,weather_time))
).call(null,mission_time,weathergen.ui.common.format_time)),hoplon.core.td.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (mission_time,max_time,weather_time){
return (function (){
return weathergen.ui.jump_to_time_STAR_.call(null,cljs.core.deref.call(null,mission_time));
});})(mission_time,max_time,weather_time))
,"Jump to"))),(function (){var con__29830__auto__ = (new cljs.core.Delay(((function (mission_time,max_time,weather_time){
return (function (){
return hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"browse-time","browse-time",832671504)], null),"Time")),hoplon.core.td.call(null,weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.weather_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"current","current",-1088038603)], null))));
});})(mission_time,max_time,weather_time))
,null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__,mission_time,max_time,weather_time){
return (function (){
return hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"displayed-time","displayed-time",141846012)], null),"Time")),hoplon.core.td.call(null,weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.time_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"displayed","displayed",-436192586)], null))),hoplon.core.td.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),weathergen.ui.jump_to_time,"Jump to"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (con__29830__auto__,mission_time,max_time,weather_time){
return (function (G__50013,G__50014){
return G__50013.call(null,G__50014,new cljs.core.Keyword(null,"edit","edit",-1641834166));
});})(con__29830__auto__,mission_time,max_time,weather_time))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode),new cljs.core.Keyword(null,"click","click",1912301393),weathergen.ui.set_time,"Set to")));
});})(con__29830__auto__,mission_time,max_time,weather_time))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__,mission_time,max_time,weather_time){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__,mission_time,max_time,weather_time))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,javelin.core.formula.call(null,((function (con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,mission_time,max_time,weather_time){
return (function (G__50015,G__50016){
return G__50015.call(null,G__50016,new cljs.core.Keyword(null,"browse","browse",2070502601));
});})(con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,mission_time,max_time,weather_time))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})(),hoplon.core.tr.call(null,cljs.core.map.call(null,hoplon.core.td,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"step","step",1288888124)], null),"Step interval"),weathergen.ui.validating_edit.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(50),new cljs.core.Keyword(null,"source","source",-433931539),javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (G__50017){
return new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(G__50017);
});})(mission_time,max_time,weather_time))
).call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.conform_positive_integer,new cljs.core.Keyword(null,"update","update",1045576396),((function (mission_time,max_time,weather_time){
return (function (p1__49990_SHARP_){
return cljs.core.swap_BANG_.call(null,weathergen.ui.movement_params,cljs.core.assoc,new cljs.core.Keyword(null,"step","step",1288888124),p1__49990_SHARP_);
});})(mission_time,max_time,weather_time))
,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"e.g. 60",new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str)], null))))),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Step back in time",new cljs.core.Keyword(null,"click","click",1912301393),((function (mission_time,max_time,weather_time){
return (function (){
return weathergen.ui.move.call(null,(-1));
});})(mission_time,max_time,weather_time))
,"<< Step Back"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"title","title",636505583),javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (G__50018){
if(cljs.core.truth_(new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(G__50018))){
return "Stop weather animation";
} else {
return "Animate weather";
}
});})(mission_time,max_time,weather_time))
).call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"click","click",1912301393),((function (mission_time,max_time,weather_time){
return (function (){
if(cljs.core.truth_(new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(cljs.core.swap_BANG_.call(null,weathergen.ui.movement_params,cljs.core.update,new cljs.core.Keyword(null,"looping?","looping?",78344245),cljs.core.not)))){
return weathergen.ui.recompute.call(null,cljs.core.deref.call(null,weathergen.ui.weather_params));
} else {
return null;
}
});})(mission_time,max_time,weather_time))
,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (movement_params){
if(cljs.core.truth_(new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(movement_params))){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"border","border",1444987323),"5px solid black",new cljs.core.Keyword(null,"transform","transform",1381301764),"",new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"2px"], null);
} else {
return new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"border-left","border-left",-1150760178),"5px solid transparent",new cljs.core.Keyword(null,"border-right","border-right",-668932860),"5px solid transparent",new cljs.core.Keyword(null,"border-top","border-top",-158897573),"7px solid black",new cljs.core.Keyword(null,"border-bottom","border-bottom",2110948415),"",new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"transform","transform",1381301764),"rotate(-90deg)"], null);
}
});})(mission_time,max_time,weather_time))
).call(null,weathergen.ui.movement_params),"")),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (max_time__$1,weather_time__$1,display_mode){
return (cljs.core._EQ_.call(null,display_mode,new cljs.core.Keyword(null,"edit","edit",-1641834166))) || ((weather_time__$1 < max_time__$1));
});})(mission_time,max_time,weather_time))
).call(null,max_time,weather_time,weathergen.ui.display_mode),new cljs.core.Keyword(null,"title","title",636505583),"Step forward in time",new cljs.core.Keyword(null,"click","click",1912301393),((function (mission_time,max_time,weather_time){
return (function (){
return weathergen.ui.move.call(null,(1));
});})(mission_time,max_time,weather_time))
,"Step Forward >>"));
});
weathergen.ui.serialization_controls = (function weathergen$ui$serialization_controls(_){
var inline = (function() { 
var G__50034__delegate = function (css,contents){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"5px"], null),css),contents);
};
var G__50034 = function (css,var_args){
var contents = null;
if (arguments.length > 1) {
var G__50035__i = 0, G__50035__a = new Array(arguments.length -  1);
while (G__50035__i < G__50035__a.length) {G__50035__a[G__50035__i] = arguments[G__50035__i + 1]; ++G__50035__i;}
  contents = new cljs.core.IndexedSeq(G__50035__a,0,null);
} 
return G__50034__delegate.call(this,css,contents);};
G__50034.cljs$lang$maxFixedArity = 1;
G__50034.cljs$lang$applyTo = (function (arglist__50036){
var css = cljs.core.first(arglist__50036);
var contents = cljs.core.rest(arglist__50036);
return G__50034__delegate(css,contents);
});
G__50034.cljs$core$IFn$_invoke$arity$variadic = G__50034__delegate;
return G__50034;
})()
;
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (inline){
return (function (G__50027,G__50028){
return G__50027.call(null,G__50028,new cljs.core.Keyword(null,"edit","edit",-1641834166));
});})(inline))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode),new cljs.core.Keyword(null,"id","id",-1388402092),"load-save-controls",new cljs.core.Keyword(null,"title","title",636505583),"Load/save",((cljs.core.not.call(null,weathergen.ui.safari_QMARK_))?cljs.core.PersistentVector.EMPTY:(function (){var p_STAR_ = ((function (inline){
return (function() { 
var G__50037__delegate = function (rest__50019_SHARP_){
return hoplon.core.p.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"3px",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null),rest__50019_SHARP_);
};
var G__50037 = function (var_args){
var rest__50019_SHARP_ = null;
if (arguments.length > 0) {
var G__50038__i = 0, G__50038__a = new Array(arguments.length -  0);
while (G__50038__i < G__50038__a.length) {G__50038__a[G__50038__i] = arguments[G__50038__i + 0]; ++G__50038__i;}
  rest__50019_SHARP_ = new cljs.core.IndexedSeq(G__50038__a,0,null);
} 
return G__50037__delegate.call(this,rest__50019_SHARP_);};
G__50037.cljs$lang$maxFixedArity = 0;
G__50037.cljs$lang$applyTo = (function (arglist__50039){
var rest__50019_SHARP_ = cljs.core.seq(arglist__50039);
return G__50037__delegate(rest__50019_SHARP_);
});
G__50037.cljs$core$IFn$_invoke$arity$variadic = G__50037__delegate;
return G__50037;
})()
;})(inline))
;
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"80%"], null),p_STAR_.call(null,"Due to a bug in Safari, settings files will open in a new\n        tab Use the browser's File->Save As to save the file. Be sure\n        to select 'Page Source' for the format. "),p_STAR_.call(null,"Due to the same bug, all other files will download with\n        name 'Unknown'. For these, once downloaded rename it with the\n        appropriate extension: .fmap for FMAPs, .twx for TWX files,\n        and .zip for weather packages."),p_STAR_.call(null,"Better still, don't use Safari. This application works\n        best in Chrome, but has also been tested in Firefox and\n        Internet Explorer."));
})()),weathergen.ui.control_subsection.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"save-single-files","save-single-files",-947469927)], null),"Load/Save individual files"),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"display","display",242065432),"flex",new cljs.core.Keyword(null,"flex-direction","flex-direction",364609438),"row",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-container",weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (inline){
return (function (){
return weathergen.ui.save_fmap.call(null,cljs.core.deref.call(null,weathergen.ui.weather_params),cljs.core.deref.call(null,weathergen.ui.weather_data));
});})(inline))
,"Save Current as FMAP")),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-container",weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (inline){
return (function (){
return weathergen.ui.save_twx.call(null,cljs.core.deref.call(null,weathergen.ui.cloud_params),new cljs.core.Keyword(null,"direction","direction",-633359395).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.movement_params)),new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)));
});})(inline))
,"Save .TWX")),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-container",weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),weathergen.ui.save_weather_settings,"Save Weather Settings")),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-container",weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),weathergen.ui.load_weather_settings,"Load Weather Settings")))),weathergen.ui.control_subsection.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (inline){
return (function (G__50029){
return cljs.core.not.call(null,(G__50029 == null));
});})(inline))
).call(null,weathergen.ui.mission),new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Save mission weather files"),(function (){var row = ((function (inline){
return (function() { 
var G__50040__delegate = function (label,help_path,edit,more){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"display","display",242065432),"flex",new cljs.core.Keyword(null,"flex-direction","flex-direction",364609438),"row",new cljs.core.Keyword(null,"margin","margin",-995903681),"0 2px 3px 2px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"white-space","white-space",-707351930),"nowrap",new cljs.core.Keyword(null,"width","width",-384071477),"50px",new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"3px"], null),weathergen.help.with_help.call(null,help_path,label)),edit,more);
};
var G__50040 = function (label,help_path,edit,var_args){
var more = null;
if (arguments.length > 3) {
var G__50041__i = 0, G__50041__a = new Array(arguments.length -  3);
while (G__50041__i < G__50041__a.length) {G__50041__a[G__50041__i] = arguments[G__50041__i + 3]; ++G__50041__i;}
  more = new cljs.core.IndexedSeq(G__50041__a,0,null);
} 
return G__50040__delegate.call(this,label,help_path,edit,more);};
G__50040.cljs$lang$maxFixedArity = 3;
G__50040.cljs$lang$applyTo = (function (arglist__50042){
var label = cljs.core.first(arglist__50042);
arglist__50042 = cljs.core.next(arglist__50042);
var help_path = cljs.core.first(arglist__50042);
arglist__50042 = cljs.core.next(arglist__50042);
var edit = cljs.core.first(arglist__50042);
var more = cljs.core.rest(arglist__50042);
return G__50040__delegate(label,help_path,edit,more);
});
G__50040.cljs$core$IFn$_invoke$arity$variadic = G__50040__delegate;
return G__50040;
})()
;})(inline))
;
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [row.call(null,"Mission:",new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"mission-name","mission-name",1479736582)], null),hoplon.core.div.call(null,javelin.core.formula.call(null,((function (row,inline){
return (function (G__50030){
var or__23338__auto__ = new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(G__50030);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "No Mission Loaded";
}
});})(row,inline))
).call(null,weathergen.ui.mission))),row.call(null,"From:",new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"from","from",1815293044)], null),weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.display_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"from","from",1815293044)], null)),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"14px"], null),new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (row,inline){
return (function (G__50031){
return cljs.core.not.call(null,(G__50031 == null));
});})(row,inline))
).call(null,weathergen.ui.mission),new cljs.core.Keyword(null,"click","click",1912301393),((function (row,inline){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.display_params,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"from","from",1815293044)], null),weathergen.falcon.files.mission.mission_time.call(null,cljs.core.deref.call(null,weathergen.ui.mission)));
});})(row,inline))
,"Set to mission time")),row.call(null,"To:",new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"to","to",192099007)], null),weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.display_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"to","to",192099007)], null))),row.call(null,"Step:",new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"step","step",1288888124)], null),weathergen.ui.validating_edit.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(32),new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.display_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"step","step",1288888124)], null)),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.conform_positive_integer,new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"60")),(function (){var progress = javelin.core.cell.call(null,null);
var cancelling_QMARK_ = javelin.core.cell.call(null,false);
var save_file = javelin.core.cell.call(null,null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (progress__$1,cancelling_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"width","width",-384071477),"115px",new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center",new cljs.core.Keyword(null,"background","background",-863952629),(((cljs.core.not.call(null,cancelling_QMARK___$1)) && (!((progress__$1 == null))))?(function (){var pct = cljs.core.long$.call(null,((100) * progress__$1));
return goog.string.format("linear-gradient(to right, lightblue, lightblue %f%%, white %f%%)",pct,pct);
})():null)], null);
});})(progress,cancelling_QMARK_,save_file,row,inline))
).call(null,progress,cancelling_QMARK_),new cljs.core.Keyword(null,"click","click",1912301393),((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (){
if(cljs.core.truth_(cljs.core.deref.call(null,progress))){
return javelin.core.dosync_STAR_.call(null,((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (){
return cljs.core.reset_BANG_.call(null,cancelling_QMARK_,true);
});})(progress,cancelling_QMARK_,save_file,row,inline))
);
} else {
cljs.core.reset_BANG_.call(null,cancelling_QMARK_,false);

cljs.core.reset_BANG_.call(null,save_file,null);

return weathergen.ui.save_weather_files.call(null,cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"mission-name","mission-name",1479736582),new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983),new cljs.core.Keyword(null,"nx","nx",-1996436366),new cljs.core.Keyword(null,"save-file","save-file",-250442926),new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.Keyword(null,"campaign-dir","campaign-dir",-1278307883),new cljs.core.Keyword(null,"weather-direction","weather-direction",-1789808873),new cljs.core.Keyword(null,"cancel","cancel",-1964088360),new cljs.core.Keyword(null,"ny","ny",1701791641),new cljs.core.Keyword(null,"progress","progress",244323547),new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),new cljs.core.Keyword(null,"step","step",1288888124),new cljs.core.Keyword(null,"to","to",192099007)],[new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)),cljs.core.deref.call(null,weathergen.ui.cloud_params),cljs.core.first.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))),save_file,cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"from","from",1815293044)], null)),weathergen.falcon.files.mission.campaign_dir.call(null,cljs.core.deref.call(null,weathergen.ui.mission)),new cljs.core.Keyword(null,"direction","direction",-633359395).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.movement_params)),cancelling_QMARK_,cljs.core.second.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))),progress,cljs.core.deref.call(null,weathergen.ui.weather_params),cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"step","step",1288888124)], null)),cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"to","to",192099007)], null))]));
}
});})(progress,cancelling_QMARK_,save_file,row,inline))
,javelin.core.formula.call(null,((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (progress__$1,cancelling_QMARK___$1){
if(cljs.core.truth_((function (){var and__23326__auto__ = progress__$1;
if(cljs.core.truth_(and__23326__auto__)){
return cancelling_QMARK___$1;
} else {
return and__23326__auto__;
}
})())){
return "Cancelling...";
} else {
if(cljs.core.truth_(progress__$1)){
return "Cancel";
} else {
return "Save Weather Files";

}
}
});})(progress,cancelling_QMARK_,save_file,row,inline))
).call(null,progress,cancelling_QMARK_)),(function (){var con__29830__auto__ = (new cljs.core.Delay(((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (){
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"5px"], null),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"5px"], null),"Saving"),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"120%"], null),save_file));
});})(progress,cancelling_QMARK_,save_file,row,inline))
,null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__,progress,cancelling_QMARK_,save_file,row,inline){
return (function (){
return null;
});})(con__29830__auto__,progress,cancelling_QMARK_,save_file,row,inline))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__,progress,cancelling_QMARK_,save_file,row,inline){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__,progress,cancelling_QMARK_,save_file,row,inline))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,javelin.core.formula.call(null,((function (con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,progress,cancelling_QMARK_,save_file,row,inline){
return (function (G__50032,G__50033){
var and__23326__auto__ = G__50032;
if(cljs.core.truth_(and__23326__auto__)){
return G__50033;
} else {
return and__23326__auto__;
}
});})(con__29830__auto__,alt__29831__auto__,tpl__29832__auto__,progress,cancelling_QMARK_,save_file,row,inline))
).call(null,progress,save_file));
})()], null);
})()], null);
})()));
});
weathergen.ui.debug_info = (function weathergen$ui$debug_info(){
return null;
});
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword(null,"viewBox","viewBox",-469489477),(function (elem,_,value){
if(cljs.core._EQ_.call(null,false,value)){
return elem.removeAttribute("viewBox");
} else {
return elem.setAttribute("viewBox",value);
}
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),(function (elem,_,value){
if(cljs.core._EQ_.call(null,false,value)){
return elem.removeAttributeNS("http://www.w3.org/1999/xlink","href");
} else {
return elem.setAttributeNS("http://www.w3.org/1999/xlink","href",value);
}
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword(null,"preserveAspectRatio","preserveAspectRatio",1832131817),(function (elem,_,value){
if(cljs.core._EQ_.call(null,false,value)){
return elem.removeAttribute("preserveAspectRatio");
} else {
return elem.setAttribute("preserveAspectRatio",value);
}
}));
weathergen.ui.test_section = (function weathergen$ui$test_section(p__50043){
var map__50050 = p__50043;
var map__50050__$1 = ((((!((map__50050 == null)))?((((map__50050.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__50050.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__50050):map__50050);
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Test",weathergen.ui.tabs.tabs.call(null,new cljs.core.Keyword(null,"selected","selected",574897764),javelin.core.cell.call(null,new cljs.core.Keyword(null,"one","one",935007904)),new cljs.core.Keyword(null,"tabs","tabs",-779855354),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Version",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"one","one",935007904),new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.div.call(null,javelin.core.formula.call(null,((function (map__50050,map__50050__$1){
return (function (G__50052,G__50053){
return G__50052.call(null,G__50053,"VERSION");
});})(map__50050,map__50050__$1))
).call(null,cljs.core.get,weathergen.ui.build_info))], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"App Path",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"two","two",627606869),new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.div.call(null,weathergen.ui.electron.remote.app.getAppPath())], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Three",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"three","three",-1651831795),new cljs.core.Keyword(null,"ui","ui",-469653645),(function (){var choice = javelin.core.cell.call(null,new cljs.core.Keyword(null,"a","a",-2123407586));
return hoplon.core.div.call(null,weathergen.ui.common.radio_group.call(null,new cljs.core.Keyword(null,"value","value",305978217),choice,new cljs.core.Keyword(null,"choices","choices",1385611597),javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"a","a",-2123407586),new cljs.core.Keyword(null,"label","label",1718410804),"a"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"b","b",1482224470),new cljs.core.Keyword(null,"label","label",1718410804),"b"], null)], null))),hoplon.core.div.call(null,javelin.core.formula.call(null,((function (choice,map__50050,map__50050__$1){
return (function (G__50055,G__50054){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("value: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__50054.call(null,G__50055))].join('');
});})(choice,map__50050,map__50050__$1))
).call(null,choice,cljs.core.pr_str)));
})()], null)], null)));
});
/**
 * @param {...*} var_args
 */
weathergen.ui.select2 = (function() { 
var weathergen$ui$select2__delegate = function (args__29776__auto__){
var vec__50063 = hoplon.core.parse_args.call(null,args__29776__auto__);
var attrs = cljs.core.nth.call(null,vec__50063,(0),null);
var kids = cljs.core.nth.call(null,vec__50063,(1),null);
var elem = hoplon.core.select.call(null,attrs,kids);
hoplon.core.when_dom.call(null,elem,((function (elem,vec__50063,attrs,kids){
return (function (){
return (function (){var G__50066 = jQuery(elem);
return G__50066;
})().select2();
});})(elem,vec__50063,attrs,kids))
);

return elem;
};
var weathergen$ui$select2 = function (var_args){
var args__29776__auto__ = null;
if (arguments.length > 0) {
var G__50067__i = 0, G__50067__a = new Array(arguments.length -  0);
while (G__50067__i < G__50067__a.length) {G__50067__a[G__50067__i] = arguments[G__50067__i + 0]; ++G__50067__i;}
  args__29776__auto__ = new cljs.core.IndexedSeq(G__50067__a,0,null);
} 
return weathergen$ui$select2__delegate.call(this,args__29776__auto__);};
weathergen$ui$select2.cljs$lang$maxFixedArity = 0;
weathergen$ui$select2.cljs$lang$applyTo = (function (arglist__50068){
var args__29776__auto__ = cljs.core.seq(arglist__50068);
return weathergen$ui$select2__delegate(args__29776__auto__);
});
weathergen$ui$select2.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$select2__delegate;
return weathergen$ui$select2;
})()
;
/**
 * Given mission and airbase cells, return a formula cell with the
 *   squadron for that airbase in the canonical order.
 */
weathergen.ui.airbase_squadrons = (function weathergen$ui$airbase_squadrons(mission,airbase){
return javelin.core.formula.call(null,(function (mission__$1,airbase__$1){
return cljs.core.sort_by.call(null,cljs.core.juxt.call(null,new cljs.core.Keyword("weathergen.falcon.files.mission","squadron-type","weathergen.falcon.files.mission/squadron-type",1124226793),new cljs.core.Keyword(null,"name","name",1843675177)),new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase__$1));
})).call(null,mission,airbase);
});
/**
 * Returns a control section that affects how airbases display on the
 *   map.
 */
weathergen.ui.airbase_display_controls = (function weathergen$ui$airbase_display_controls(title){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"display-options","display-options",1066052168),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),title),(function (){var map_airbase_label_style = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"airbase-label-style","airbase-label-style",-1349798514)], null));
return hoplon.core.div.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"display-options","display-options",1066052168),new cljs.core.Keyword(null,"airbase-labels","airbase-labels",580409100)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin","margin",-995903681),weathergen.ui.common.px.call(null,(0),(5))], null),hoplon.core.label.call(null,"Airbase labels:")),weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),map_airbase_label_style,new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Airbase name only",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"name-only","name-only",-124386571)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Airbase name and squadrons",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"all","all",892129742)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"No label",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"nothing","nothing",-1022703296)], null)], null)));
})(),(function (){var map_airbase_show_status_QMARK_ = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"show-airbase-status?","show-airbase-status?",-2059784435)], null));
return hoplon.core.div.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),map_airbase_show_status_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (map_airbase_show_status_QMARK_){
return (function (){
return cljs.core.swap_BANG_.call(null,map_airbase_show_status_QMARK_,cljs.core.not);
});})(map_airbase_show_status_QMARK_))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"display-options","display-options",1066052168),new cljs.core.Keyword(null,"show-airbase-status?","show-airbase-status?",-2059784435)], null),hoplon.core.label.call(null,"Show airbase status?")));
})(),(function (){var map_airbase_show_squadrons_QMARK_ = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"show-airbase-squadrons?","show-airbase-squadrons?",1245487954)], null));
return hoplon.core.div.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),map_airbase_show_squadrons_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (map_airbase_show_squadrons_QMARK_){
return (function (){
return cljs.core.swap_BANG_.call(null,map_airbase_show_squadrons_QMARK_,cljs.core.not);
});})(map_airbase_show_squadrons_QMARK_))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"display-options","display-options",1066052168),new cljs.core.Keyword(null,"show-airbase-squadrons?","show-airbase-squadrons?",1245487954)], null),hoplon.core.label.call(null,"Show airbase squadrons?")));
})());
});
weathergen.ui.air_forces_section = (function weathergen$ui$air_forces_section(_){
var expand_state = javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"expand-through-level","expand-through-level",-1840001384),(1)], null));
var row = ((function (expand_state){
return (function() { 
var G__50169__delegate = function (args){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"row",args);
};
var G__50169 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__50170__i = 0, G__50170__a = new Array(arguments.length -  0);
while (G__50170__i < G__50170__a.length) {G__50170__a[G__50170__i] = arguments[G__50170__i + 0]; ++G__50170__i;}
  args = new cljs.core.IndexedSeq(G__50170__a,0,null);
} 
return G__50169__delegate.call(this,args);};
G__50169.cljs$lang$maxFixedArity = 0;
G__50169.cljs$lang$applyTo = (function (arglist__50171){
var args = cljs.core.seq(arglist__50171);
return G__50169__delegate(args);
});
G__50169.cljs$core$IFn$_invoke$arity$variadic = G__50169__delegate;
return G__50169;
})()
;})(expand_state))
;
var G__50122 = (new cljs.core.Delay(((function (expand_state,row){
return (function (){
return "No mission loaded";
});})(expand_state,row))
,null));
var G__50123 = (new cljs.core.Delay(((function (G__50122,expand_state,row){
return (function (){
return "No airbases present in the mission.";
});})(G__50122,expand_state,row))
,null));
var G__50124 = (new cljs.core.Delay(((function (G__50122,G__50123,expand_state,row){
return (function (){
return weathergen.ui.common.styled.call(null,new cljs.core.Keyword(null,"garden","garden",-1966516149),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.row","div.row",133678515),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"3px"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button","button",1456579943),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px"], null)], null)], null),weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"airbase-filtering","airbase-filtering",-1721186951)], null),"Airbase Filtering"),row.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.hide_empty_airbases_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (G__50122,G__50123,expand_state,row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.hide_empty_airbases_QMARK_,cljs.core.not);
});})(G__50122,G__50123,expand_state,row))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"hide-no-squadron-airbases","hide-no-squadron-airbases",-1359048131)], null),hoplon.core.label.call(null,"Hide airbases with no squadrons"))),row.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.hide_inoperable_airbases_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (G__50122,G__50123,expand_state,row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.hide_inoperable_airbases_QMARK_,cljs.core.not);
});})(G__50122,G__50123,expand_state,row))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"hide-zero-status-airbases","hide-zero-status-airbases",1840033965)], null),hoplon.core.label.call(null,"Hide airbases at 0% status")))),weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"squadron-types","squadron-types",1890788688)], null),"Squadron Types"),row.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50122,G__50123,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.included_squadron_types,cljs.core.deref.call(null,weathergen.ui.all_squadron_types));
});})(G__50122,G__50123,expand_state,row))
,"Check all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50122,G__50123,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.included_squadron_types,cljs.core.PersistentHashSet.EMPTY);
});})(G__50122,G__50123,expand_state,row))
,"Uncheck all"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"squadron-type-buttons","squadron-type-buttons",-151353966)], null))),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"display","display",242065432),"flex",new cljs.core.Keyword(null,"flex-wrap","flex-wrap",455413707),"wrap",new cljs.core.Keyword(null,"max-width","max-width",-1939924051),weathergen.ui.common.px.call(null,(275))], null),hoplon.core.loop_tpl_STAR_.call(null,javelin.core.formula.call(null,((function (G__50122,G__50123,expand_state,row){
return (function (G__50125,G__50126){
return G__50125.call(null,G__50126);
});})(G__50122,G__50123,expand_state,row))
).call(null,cljs.core.sort,weathergen.ui.all_squadron_types),((function (G__50122,G__50123,expand_state,row){
return (function (item__29820__auto__){
var vec__50127 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (G__50122,G__50123,expand_state,row){
return (function (squadron_type){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [squadron_type], null);
});})(G__50122,G__50123,expand_state,row))
).call(null,item__29820__auto__));
var squadron_type = cljs.core.nth.call(null,vec__50127,(0),null);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(75)),new cljs.core.Keyword(null,"white-space","white-space",-707351930),"nowrap"], null),(function (){var val = javelin.core.formula.call(null,((function (vec__50127,squadron_type,G__50122,G__50123,expand_state,row){
return (function (G__50130,G__50132,G__50131){
return G__50130.call(null,G__50131,G__50132);
});})(vec__50127,squadron_type,G__50122,G__50123,expand_state,row))
).call(null,cljs.core.contains_QMARK_,squadron_type,weathergen.ui.included_squadron_types);
return hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),val,new cljs.core.Keyword(null,"change","change",-1163046502),((function (val,vec__50127,squadron_type,G__50122,G__50123,expand_state,row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.included_squadron_types,(cljs.core.truth_(cljs.core.deref.call(null,val))?cljs.core.disj:cljs.core.conj),cljs.core.deref.call(null,squadron_type));
});})(val,vec__50127,squadron_type,G__50122,G__50123,expand_state,row))
);
})(),hoplon.core.label.call(null,squadron_type));
});})(G__50122,G__50123,expand_state,row))
))),weathergen.ui.airbase_display_controls.call(null,"Display Options"),weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"airbases-and-squadrons","airbases-and-squadrons",396705313)], null),"Airbases and Squadrons"),row.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50122,G__50123,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,expand_state,new cljs.core.Keyword(null,"all-expanded","all-expanded",1437674225));
});})(G__50122,G__50123,expand_state,row))
,"Expand all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50122,G__50123,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,expand_state,new cljs.core.Keyword(null,"all-collapsed","all-collapsed",437702622));
});})(G__50122,G__50123,expand_state,row))
,"Collapse all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50122,G__50123,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,expand_state,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"expand-through-level","expand-through-level",-1840001384),(1)], null));
});})(G__50122,G__50123,expand_state,row))
,"Collapse to airbases"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"tree-collapse-buttons","tree-collapse-buttons",-1065929796)], null))),row.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50122,G__50123,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.checked_airbases,cljs.core.deref.call(null,weathergen.ui.listed_airbases));
});})(G__50122,G__50123,expand_state,row))
,"Show all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50122,G__50123,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.checked_airbases,cljs.core.PersistentHashSet.EMPTY);
});})(G__50122,G__50123,expand_state,row))
,"Hide all"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"airbase-selection-buttons","airbase-selection-buttons",-991641834)], null))),row.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"overflow","overflow",2058931880),"scroll",new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"120%",new cljs.core.Keyword(null,"background","background",-863952629),"white",new cljs.core.Keyword(null,"border","border",1444987323),"inset 1px lightgray"], null),(function (){var by_side = javelin.core.formula.call(null,((function (G__50122,G__50123,expand_state,row){
return (function (mission,all_airbases){
return cljs.core.group_by.call(null,((function (G__50122,G__50123,expand_state,row){
return (function (airbase){
return weathergen.falcon.files.mission.side.call(null,mission,new cljs.core.Keyword(null,"owner","owner",-392611939).cljs$core$IFn$_invoke$arity$1(airbase));
});})(G__50122,G__50123,expand_state,row))
,all_airbases);
});})(G__50122,G__50123,expand_state,row))
).call(null,weathergen.ui.mission,weathergen.ui.all_airbases);
var sorted = javelin.core.formula.call(null,((function (by_side,G__50122,G__50123,expand_state,row){
return (function (mission,by_side__$1){
var timer_name__15521__auto__ = "Updating air forces tree";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){var iter__24200__auto__ = ((function (timer_name__15521__auto__,ignore__15522__auto__,by_side,G__50122,G__50123,expand_state,row){
return (function weathergen$ui$air_forces_section_$_iter__50133(s__50134){
return (new cljs.core.LazySeq(null,((function (timer_name__15521__auto__,ignore__15522__auto__,by_side,G__50122,G__50123,expand_state,row){
return (function (){
var s__50134__$1 = s__50134;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__50134__$1);
if(temp__5278__auto__){
var s__50134__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50134__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__50134__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__50136 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__50135 = (0);
while(true){
if((i__50135 < size__24199__auto__)){
var side = cljs.core._nth.call(null,c__24198__auto__,i__50135);
var airbases = cljs.core.get.call(null,by_side__$1,side);
if((cljs.core.count.call(null,airbases) > (0))){
cljs.core.chunk_append.call(null,b__50136,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [side,airbases], null));

var G__50172 = (i__50135 + (1));
i__50135 = G__50172;
continue;
} else {
var G__50173 = (i__50135 + (1));
i__50135 = G__50173;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50136),weathergen$ui$air_forces_section_$_iter__50133.call(null,cljs.core.chunk_rest.call(null,s__50134__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50136),null);
}
} else {
var side = cljs.core.first.call(null,s__50134__$2);
var airbases = cljs.core.get.call(null,by_side__$1,side);
if((cljs.core.count.call(null,airbases) > (0))){
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [side,airbases], null),weathergen$ui$air_forces_section_$_iter__50133.call(null,cljs.core.rest.call(null,s__50134__$2)));
} else {
var G__50174 = cljs.core.rest.call(null,s__50134__$2);
s__50134__$1 = G__50174;
continue;
}
}
} else {
return null;
}
break;
}
});})(timer_name__15521__auto__,ignore__15522__auto__,by_side,G__50122,G__50123,expand_state,row))
,null,null));
});})(timer_name__15521__auto__,ignore__15522__auto__,by_side,G__50122,G__50123,expand_state,row))
;
return iter__24200__auto__.call(null,weathergen.falcon.files.mission.sides.call(null,mission));
})();
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});})(by_side,G__50122,G__50123,expand_state,row))
).call(null,weathergen.ui.mission,by_side);
return weathergen.ui.trees.tree.call(null,expand_state,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (expanded_QMARK_,item){
var vec__50143 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (p__50146){
var vec__50147 = p__50146;
var side = cljs.core.nth.call(null,vec__50147,(0),null);
var airbases = cljs.core.nth.call(null,vec__50147,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [airbases,side], null);
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,item));
var airbases = cljs.core.nth.call(null,vec__50143,(0),null);
var side = cljs.core.nth.call(null,vec__50143,(1),null);
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),javelin.core.formula.call(null,((function (vec__50143,airbases,side,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (G__50150,G__50151){
return G__50150.call(null,"air-forces-side-%d",G__50151);
});})(vec__50143,airbases,side,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,goog.string.format,side),new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (vec__50143,airbases,side,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (side__$1){
return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"height","height",1025178622),"20px",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"4px",new cljs.core.Keyword(null,"color","color",1011675173),weathergen.ui.common.team_color.call(null,side__$1,new cljs.core.Keyword(null,"dark-text","dark-text",814777253))], null);
});})(vec__50143,airbases,side,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,side),javelin.core.formula.call(null,((function (vec__50143,airbases,side,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (mission,side__$1){
return weathergen.ui.common.side_label.call(null,new cljs.core.Keyword(null,"mission","mission",1740288522),mission,new cljs.core.Keyword(null,"side","side",389652279),side__$1);
});})(vec__50143,airbases,side,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,weathergen.ui.mission,side));
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
,new cljs.core.Keyword(null,"children","children",-940561982),((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (item){
return javelin.core.formula.call(null,((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (item__$1,mission){
var vec__50152 = item__$1;
var side = cljs.core.nth.call(null,vec__50152,(0),null);
var airbases = cljs.core.nth.call(null,vec__50152,(1),null);
return cljs.core.sort_by.call(null,((function (vec__50152,side,airbases,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (airbase){
return weathergen.falcon.files.mission.objective_name.call(null,mission,airbase);
});})(vec__50152,side,airbases,by_side,sorted,G__50122,G__50123,expand_state,row))
,airbases);
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,item,weathergen.ui.mission);
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"attrs","attrs",-2090668713),((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (airbase){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (airbase__$1,listed_airbases){
return listed_airbases.call(null,airbase__$1);
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,airbase,weathergen.ui.listed_airbases)], null);
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
,new cljs.core.Keyword(null,"children","children",-940561982),((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (airbase){
return javelin.core.formula.call(null,((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (airbase__$1){
return cljs.core.sort_by.call(null,cljs.core.juxt.call(null,new cljs.core.Keyword("weathergen.falcon.files.mission","squadron-type","weathergen.falcon.files.mission/squadron-type",1124226793),new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975)),new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase__$1));
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,airbase);
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
,new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (expanded_QMARK_,airbase){
var ab_name = javelin.core.formula.call(null,((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (airbase__$1){
return new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975).cljs$core$IFn$_invoke$arity$1(airbase__$1);
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,airbase);
var status = javelin.core.formula.call(null,((function (ab_name,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (airbase__$1){
return new cljs.core.Keyword("weathergen.falcon.files.mission","status","weathergen.falcon.files.mission/status",667063917).cljs$core$IFn$_invoke$arity$1(airbase__$1);
});})(ab_name,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,airbase);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (G__50156,G__50155){
return G__50155.call(null,"air-forces-airbase-%d",new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(G__50156));
});})(ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,airbase,goog.string.format),new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (expanded_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"height","height",1025178622),"20px",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"4px",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer"], null);
});})(ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,expanded_QMARK_),new cljs.core.Keyword(null,"click","click",1912301393),((function (ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (){
cljs.core.swap_BANG_.call(null,weathergen.ui.checked_airbases,weathergen.util.toggle_set_membership,cljs.core.deref.call(null,airbase));

return cljs.core.reset_BANG_.call(null,weathergen.ui.highlighted_airbase,cljs.core.deref.call(null,weathergen.ui.checked_airbases).call(null,cljs.core.deref.call(null,airbase)));
});})(ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
);
});})(ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
,new cljs.core.Keyword(null,"mouseenter","mouseenter",-1792413560),((function (ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.highlighted_airbase,cljs.core.deref.call(null,airbase));
});})(ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
,new cljs.core.Keyword(null,"mouseleave","mouseleave",531566580),((function (ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.highlighted_airbase,null);
});})(ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"7px"], null),new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (airbase__$1,checked_airbases){
return checked_airbases.call(null,airbase__$1);
});})(ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,airbase,weathergen.ui.checked_airbases)),(function (){var width = (25);
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,width),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(3)),new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),hoplon.core.img.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),javelin.core.formula.call(null,((function (width,ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (mission,airbase__$1){
return weathergen.ui.common.get_image.call(null,mission,new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(airbase__$1));
});})(width,ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,weathergen.ui.mission,airbase),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"max-width","max-width",-1939924051),weathergen.ui.common.px.call(null,width),new cljs.core.Keyword(null,"max-height","max-height",-612563804),weathergen.ui.common.px.call(null,width),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null)));
})(),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (status__$1){
return new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(25)),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,(8)),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),weathergen.ui.common.px.call(null,(2)),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle",new cljs.core.Keyword(null,"border","border",1444987323),"solid 1px black",new cljs.core.Keyword(null,"background","background",-863952629),(function (){var color = weathergen.ui.airbase_status_color.call(null,status__$1);
return goog.string.format("linear-gradient(to right, %s, %s %f%%, white %f%%)",color,color,status__$1,status__$1);
})()], null);
});})(ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,status)),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (airbase__$1,highlighted_airbase){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"color","color",1011675173),weathergen.ui.common.team_color.call(null,new cljs.core.Keyword(null,"owner","owner",-392611939).cljs$core$IFn$_invoke$arity$1(airbase__$1),new cljs.core.Keyword(null,"dark-text","dark-text",814777253)),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"10px",new cljs.core.Keyword(null,"background","background",-863952629),((cljs.core._EQ_.call(null,airbase__$1,highlighted_airbase))?"lightgoldenrodyellow":null)], null);
});})(ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,airbase,weathergen.ui.highlighted_airbase),ab_name),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"5px"], null),hoplon.core.loop_tpl_STAR_.call(null,weathergen.ui.airbase_squadrons.call(null,weathergen.ui.mission,airbase),((function (ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (item__29820__auto__){
var vec__50157 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (squadron){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [squadron], null);
});})(ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,item__29820__auto__));
var squadron = cljs.core.nth.call(null,vec__50157,(0),null);
return hoplon.core.img.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (vec__50157,squadron,ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (squadron__$1,included_squadrons){
return included_squadrons.call(null,squadron__$1);
});})(vec__50157,squadron,ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,squadron,weathergen.ui.included_squadrons),new cljs.core.Keyword(null,"src","src",-1651076051),javelin.core.formula.call(null,((function (vec__50157,squadron,ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (mission,squadron__$1){
return weathergen.ui.common.get_image.call(null,mission,new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(squadron__$1));
});})(vec__50157,squadron,ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,weathergen.ui.mission,squadron),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"height","height",1025178622),"20px",new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"3px",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null));
});})(ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
)),hoplon.core.div.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),expanded_QMARK_,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"22px",new cljs.core.Keyword(null,"font-style","font-style",-773672352),"italic",new cljs.core.Keyword(null,"color","color",1011675173),"gray"], null),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (status__$1){
return goog.string.format("Status: %d%%",status__$1);
});})(ab_name,status,by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,status)));
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"attrs","attrs",-2090668713),((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (squadron){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (squadron__$1,included_squadrons){
return included_squadrons.call(null,squadron__$1);
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,squadron,weathergen.ui.included_squadrons)], null);
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
,new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (expanded_QMARK_,squadron){
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),javelin.core.formula.call(null,((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (G__50160,G__50161){
return G__50160.call(null,"air-forces-squadron-%d",new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(G__50161));
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,goog.string.format,squadron),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),"35px",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),hoplon.core.img.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),javelin.core.formula.call(null,((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (mission,squadron__$1){
return weathergen.ui.common.get_image.call(null,mission,new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(squadron__$1));
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,weathergen.ui.mission,squadron))),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"padding","padding",1660304693),"2px 4px 0 5px",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"3px",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"7px"], null),javelin.core.formula.call(null,((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (G__50162){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"quantity","quantity",-1929050694).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","aircraft","weathergen.falcon.files.mission/aircraft",774567258).cljs$core$IFn$_invoke$arity$1(G__50162)))].join('');
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,squadron)),weathergen.ui.common.inl.call(null,javelin.core.formula.call(null,((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (G__50163){
return new cljs.core.Keyword(null,"airframe","airframe",643222926).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","aircraft","weathergen.falcon.files.mission/aircraft",774567258).cljs$core$IFn$_invoke$arity$1(G__50163));
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,squadron))),hoplon.core.div.call(null,javelin.core.formula.call(null,((function (by_side,sorted,G__50122,G__50123,expand_state,row){
return (function (G__50164){
return new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(G__50164);
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
).call(null,squadron))));
});})(by_side,sorted,G__50122,G__50123,expand_state,row))
], null)], null),sorted);
})())));
});})(G__50122,G__50123,expand_state,row))
,null));
var tpl__29848__auto__ = ((function (G__50122,G__50123,G__50124,expand_state,row){
return (function (G__50119,G__50120,G__50121){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(G__50119)?G__50122:(cljs.core.truth_(G__50120)?G__50123:(cljs.core.truth_(G__50121)?G__50124:null)));
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(G__50122,G__50123,G__50124,expand_state,row))
;
return javelin.core.formula.call(null,tpl__29848__auto__).call(null,javelin.core.formula.call(null,((function (G__50122,G__50123,G__50124,tpl__29848__auto__,expand_state,row){
return (function (G__50166,G__50165){
return G__50165.call(null,G__50166);
});})(G__50122,G__50123,G__50124,tpl__29848__auto__,expand_state,row))
).call(null,weathergen.ui.mission,cljs.core.not),javelin.core.formula.call(null,((function (G__50122,G__50123,G__50124,tpl__29848__auto__,expand_state,row){
return (function (G__50168,G__50167){
return (G__50167.call(null,G__50168) === (0));
});})(G__50122,G__50123,G__50124,tpl__29848__auto__,expand_state,row))
).call(null,weathergen.ui.all_airbases,cljs.core.count),new cljs.core.Keyword(null,"else","else",-1508377146));
});
weathergen.ui.order_of_battle_section = (function weathergen$ui$order_of_battle_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Order of Battle",(function (){var con__29830__auto__ = (new cljs.core.Delay((function (){
return "No mission loaded";
}),null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__){
return (function (){
var side_type_units = javelin.core.formula.call(null,((function (con__29830__auto__){
return (function (G__50226,G__50225,G__50223,G__50227,G__50224){
return G__50223.call(null,((function (con__29830__auto__){
return (function (m,side,units){
return G__50224.call(null,m,side,G__50225.call(null,new cljs.core.Keyword(null,"type","type",1174270348),units));
});})(con__29830__auto__))
,cljs.core.PersistentArrayMap.EMPTY,G__50225.call(null,((function (con__29830__auto__){
return (function (p1__50175_SHARP_){
return G__50226.call(null,G__50227,new cljs.core.Keyword(null,"owner","owner",-392611939).cljs$core$IFn$_invoke$arity$1(p1__50175_SHARP_));
});})(con__29830__auto__))
,new cljs.core.Keyword(null,"units","units",-533089095).cljs$core$IFn$_invoke$arity$1(G__50227)));
});})(con__29830__auto__))
).call(null,weathergen.falcon.files.mission.side,cljs.core.group_by,cljs.core.reduce_kv,weathergen.ui.mission,cljs.core.assoc);
var search_text = javelin.core.cell.call(null,"");
return hoplon.core.div.call(null,hoplon.core.span.call(null,"Search:"),hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text",new cljs.core.Keyword(null,"value","value",305978217),search_text,new cljs.core.Keyword(null,"change","change",-1163046502),((function (side_type_units,search_text,con__29830__auto__){
return (function (p1__50176_SHARP_){
return cljs.core.reset_BANG_.call(null,search_text,cljs.core.deref.call(null,p1__50176_SHARP_));
});})(side_type_units,search_text,con__29830__auto__))
),hoplon.core.ol.call(null,hoplon.core.loop_tpl_STAR_.call(null,side_type_units,((function (side_type_units,search_text,con__29830__auto__){
return (function (item__29820__auto__){
var vec__50234 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (side_type_units,search_text,con__29830__auto__){
return (function (p__50237){
var vec__50238 = p__50237;
var side = cljs.core.nth.call(null,vec__50238,(0),null);
var type_units = cljs.core.nth.call(null,vec__50238,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [type_units,side], null);
});})(side_type_units,search_text,con__29830__auto__))
).call(null,item__29820__auto__));
var type_units = cljs.core.nth.call(null,vec__50234,(0),null);
var side = cljs.core.nth.call(null,vec__50234,(1),null);
return hoplon.core.li.call(null,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__){
return (function (G__50242,G__50243,G__50244,G__50241){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),G__50241.call(null,G__50242,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"team","team",1355747699),new cljs.core.Keyword(null,"dark-text","dark-text",814777253),G__50243.call(null,G__50244)], null))], null);
});})(vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__))
).call(null,weathergen.ui.common.colors,weathergen.falcon.files.mission.team_color,side,cljs.core.get_in),javelin.core.formula.call(null,((function (vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__){
return (function (G__50245,G__50246,G__50247){
return G__50245.call(null,G__50246,G__50247);
});})(vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__))
).call(null,weathergen.falcon.files.mission.team_name,weathergen.ui.mission,side)),hoplon.core.ol.call(null,hoplon.core.loop_tpl_STAR_.call(null,type_units,((function (vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__){
return (function (item__29820__auto____$1){
var vec__50254 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__){
return (function (p__50257){
var vec__50258 = p__50257;
var type = cljs.core.nth.call(null,vec__50258,(0),null);
var units = cljs.core.nth.call(null,vec__50258,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [units,type], null);
});})(vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__))
).call(null,item__29820__auto____$1));
var units = cljs.core.nth.call(null,vec__50254,(0),null);
var type = cljs.core.nth.call(null,vec__50254,(1),null);
return hoplon.core.li.call(null,hoplon.core.span.call(null,javelin.core.formula.call(null,((function (vec__50254,units,type,vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__){
return (function (G__50261,G__50262){
return G__50261.call(null,G__50262);
});})(vec__50254,units,type,vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__))
).call(null,cljs.core.name,type)),hoplon.core.ol.call(null,hoplon.core.loop_tpl_STAR_.call(null,units,((function (vec__50254,units,type,vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__){
return (function (item__29820__auto____$2){
var vec__50263 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__50254,units,type,vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__){
return (function (unit){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [unit], null);
});})(vec__50254,units,type,vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__))
).call(null,item__29820__auto____$2));
var unit = cljs.core.nth.call(null,vec__50263,(0),null);
return hoplon.core.li.call(null,hoplon.core.span.call(null,javelin.core.formula.call(null,((function (vec__50263,unit,vec__50254,units,type,vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__){
return (function (G__50266){
return new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(G__50266);
});})(vec__50263,unit,vec__50254,units,type,vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__))
).call(null,unit)));
});})(vec__50254,units,type,vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__))
)));
});})(vec__50234,type_units,side,side_type_units,search_text,con__29830__auto__))
)));
});})(side_type_units,search_text,con__29830__auto__))
)));
});})(con__29830__auto__))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,javelin.core.formula.call(null,((function (con__29830__auto__,alt__29831__auto__,tpl__29832__auto__){
return (function (G__50268,G__50267){
return G__50267.call(null,G__50268);
});})(con__29830__auto__,alt__29831__auto__,tpl__29832__auto__))
).call(null,weathergen.ui.mission,cljs.core.not));
})());
});
/**
 * Returns UI for the mission info section.
 */
weathergen.ui.mission_info_section = (function weathergen$ui$mission_info_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Mission Info",hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"5px"], null),(function (){var con__29830__auto__ = (new cljs.core.Delay((function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"3px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"text-decoration","text-decoration",1836813207),"underline",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"110%"], null),"Loaded mission"),hoplon.core.div.call(null,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),"Theater: "),javelin.core.formula.call(null,(function (G__50276,G__50275){
return G__50275.call(null,G__50276);
})).call(null,weathergen.ui.mission,weathergen.falcon.files.mission.theaterdef_name)),hoplon.core.div.call(null,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),"Mission: "),javelin.core.formula.call(null,(function (G__50277){
return new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(G__50277);
})).call(null,weathergen.ui.mission)),hoplon.core.div.call(null,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),"Falcon Time: "),javelin.core.formula.call(null,(function (G__50279,G__50280,G__50278){
return G__50278.call(null,G__50279.call(null,G__50280));
})).call(null,weathergen.falcon.files.mission.mission_time,weathergen.ui.mission,weathergen.ui.common.format_time)));
}),null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"110%",new cljs.core.Keyword(null,"font-style","font-style",-773672352),"italic"], null),"No mission loaded.");
});})(con__29830__auto__))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,weathergen.ui.mission);
})()));
});
/**
 * Returns UI for the save briefing section.
 */
weathergen.ui.save_briefing_section = (function weathergen$ui$save_briefing_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"mission-info","mission-info",1263062521),new cljs.core.Keyword(null,"save-briefing","save-briefing",-1540800301)], null),"Save Mission Briefing"),new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__50312,G__50313){
return G__50312.call(null,G__50313,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),(function (){var only_install = javelin.core.formula.call(null,(function (mission){
if(cljs.core._EQ_.call(null,cljs.core.count.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(mission)),(1))){
return cljs.core.first.call(null,cljs.core.keys.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(mission)));
} else {
return null;
}
})).call(null,weathergen.ui.mission);
var selected_install = javelin.core.cell.call(null,null);
var install_to_save = javelin.core.formula.call(null,((function (only_install,selected_install){
return (function (only_install__$1,selected_install__$1){
var or__23338__auto__ = only_install__$1;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return selected_install__$1;
}
});})(only_install,selected_install))
).call(null,only_install,selected_install);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"5px"], null),hoplon.core.div.call(null,(function (){var G__50317 = (new cljs.core.Delay(((function (only_install,selected_install,install_to_save){
return (function (){
return hoplon.core.div.call(null,hoplon.core.span.call(null,"Briefing will be saved for installation: "),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"120%"], null),javelin.core.formula.call(null,((function (only_install,selected_install,install_to_save){
return (function (G__50321,G__50320,G__50322){
return G__50320.call(null,G__50321.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(G__50322)));
});})(only_install,selected_install,install_to_save))
).call(null,cljs.core.first,cljs.core.key,weathergen.ui.mission)));
});})(only_install,selected_install,install_to_save))
,null));
var G__50318 = (new cljs.core.Delay(((function (G__50317,only_install,selected_install,install_to_save){
return (function (){
return "Cannot find a matching installation of Falcon BMS for this mission.";
});})(G__50317,only_install,selected_install,install_to_save))
,null));
var G__50319 = (new cljs.core.Delay(((function (G__50317,G__50318,only_install,selected_install,install_to_save){
return (function (){
return hoplon.core.div.call(null,hoplon.core.div.call(null,hoplon.core.span.call(null,"Multiple installed copies of Falcon BMS point at the mission directory, "),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"110%"], null),javelin.core.formula.call(null,((function (G__50317,G__50318,only_install,selected_install,install_to_save){
return (function (mission){
return cljs.core.val.call(null,cljs.core.first.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(mission)));
});})(G__50317,G__50318,only_install,selected_install,install_to_save))
).call(null,weathergen.ui.mission)),hoplon.core.span.call(null,". Select which installation this mission is for. (If unsure, choose 'Falcon BMS 4.33 U1'.)")),weathergen.ui.common.radio_group.call(null,new cljs.core.Keyword(null,"value","value",305978217),selected_install,new cljs.core.Keyword(null,"choices","choices",1385611597),javelin.core.formula.call(null,((function (G__50317,G__50318,only_install,selected_install,install_to_save){
return (function (mission){
var iter__24200__auto__ = ((function (G__50317,G__50318,only_install,selected_install,install_to_save){
return (function weathergen$ui$save_briefing_section_$_iter__50323(s__50324){
return (new cljs.core.LazySeq(null,((function (G__50317,G__50318,only_install,selected_install,install_to_save){
return (function (){
var s__50324__$1 = s__50324;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__50324__$1);
if(temp__5278__auto__){
var s__50324__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50324__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__50324__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__50326 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__50325 = (0);
while(true){
if((i__50325 < size__24199__auto__)){
var vec__50333 = cljs.core._nth.call(null,c__24198__auto__,i__50325);
var install_name = cljs.core.nth.call(null,vec__50333,(0),null);
var install_path = cljs.core.nth.call(null,vec__50333,(1),null);
cljs.core.chunk_append.call(null,b__50326,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),install_name,new cljs.core.Keyword(null,"label","label",1718410804),weathergen.ui.common.inl.call(null,install_name)], null));

var G__50343 = (i__50325 + (1));
i__50325 = G__50343;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50326),weathergen$ui$save_briefing_section_$_iter__50323.call(null,cljs.core.chunk_rest.call(null,s__50324__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50326),null);
}
} else {
var vec__50336 = cljs.core.first.call(null,s__50324__$2);
var install_name = cljs.core.nth.call(null,vec__50336,(0),null);
var install_path = cljs.core.nth.call(null,vec__50336,(1),null);
return cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),install_name,new cljs.core.Keyword(null,"label","label",1718410804),weathergen.ui.common.inl.call(null,install_name)], null),weathergen$ui$save_briefing_section_$_iter__50323.call(null,cljs.core.rest.call(null,s__50324__$2)));
}
} else {
return null;
}
break;
}
});})(G__50317,G__50318,only_install,selected_install,install_to_save))
,null,null));
});})(G__50317,G__50318,only_install,selected_install,install_to_save))
;
return iter__24200__auto__.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(mission));
});})(G__50317,G__50318,only_install,selected_install,install_to_save))
).call(null,weathergen.ui.mission)));
});})(G__50317,G__50318,only_install,selected_install,install_to_save))
,null));
var tpl__29848__auto__ = ((function (G__50317,G__50318,G__50319,only_install,selected_install,install_to_save){
return (function (G__50314,G__50315,G__50316){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(G__50314)?G__50317:(cljs.core.truth_(G__50315)?G__50318:(cljs.core.truth_(G__50316)?G__50319:null)));
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(G__50317,G__50318,G__50319,only_install,selected_install,install_to_save))
;
return javelin.core.formula.call(null,tpl__29848__auto__).call(null,only_install,javelin.core.formula.call(null,((function (G__50317,G__50318,G__50319,tpl__29848__auto__,only_install,selected_install,install_to_save){
return (function (G__50340,G__50339){
return (G__50339.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(G__50340)) === (0));
});})(G__50317,G__50318,G__50319,tpl__29848__auto__,only_install,selected_install,install_to_save))
).call(null,weathergen.ui.mission,cljs.core.count),new cljs.core.Keyword(null,"else","else",-1508377146));
})()),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"border","border",1444987323),"1px solid black",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"10px",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"10px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"background","background",-863952629),"black",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"5px",new cljs.core.Keyword(null,"padding","padding",1660304693),"2px"], null),"Visibility"),weathergen.ui.common.side_selector.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"0 0 5px 5px"], null),new cljs.core.Keyword(null,"mission","mission",1740288522),weathergen.ui.mission,new cljs.core.Keyword(null,"selected-sides","selected-sides",-922979619),weathergen.ui.visible_sides)),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181),javelin.core.formula.call(null,((function (only_install,selected_install,install_to_save){
return (function (G__50342,G__50341){
return G__50341.call(null,G__50342);
});})(only_install,selected_install,install_to_save))
).call(null,install_to_save,cljs.core.not),new cljs.core.Keyword(null,"click","click",1912301393),((function (only_install,selected_install,install_to_save){
return (function (){
return weathergen.ui.save_briefing.call(null,cljs.core.deref.call(null,install_to_save),cljs.core.deref.call(null,weathergen.ui.visible_sides));
});})(only_install,selected_install,install_to_save))
,"Save Briefing (.vmtb)"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"mission-info","mission-info",1263062521),new cljs.core.Keyword(null,"save-briefing","save-briefing",-1540800301)], null)));
})());
});
/**
 * Returns UI for the briefing notes section
 */
weathergen.ui.briefing_notes_section = (function weathergen$ui$briefing_notes_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),javelin.core.formula.call(null,(function (display_mode){
return weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"mission-info","mission-info",1263062521),new cljs.core.Keyword(null,"briefing-notes","briefing-notes",-1524193117),display_mode], null),"Briefing Notes");
})).call(null,weathergen.ui.display_mode),hoplon.core.div.call(null,(function (){var con__29830__auto__ = (new cljs.core.Delay((function (){
return hoplon.core.textarea.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(110)),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.pct.call(null,(100))], null),new cljs.core.Keyword(null,"rows","rows",850049680),(10),new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.briefing_notes,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"Enter briefing notes here",new cljs.core.Keyword(null,"change","change",-1163046502),(function (p1__50344_SHARP_){
return cljs.core.reset_BANG_.call(null,weathergen.ui.briefing_notes,cljs.core.deref.call(null,p1__50344_SHARP_));
}));
}),null));
var alt__29831__auto__ = (new cljs.core.Delay(((function (con__29830__auto__){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(110)),new cljs.core.Keyword(null,"white-space","white-space",-707351930),"pre-wrap",new cljs.core.Keyword(null,"padding","padding",1660304693),weathergen.ui.common.px.call(null,(10)),new cljs.core.Keyword(null,"background","background",-863952629),"white",new cljs.core.Keyword(null,"border-width","border-width",-1512605390),weathergen.ui.common.px.call(null,(1)),new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"lightgray",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid"], null),javelin.core.formula.call(null,((function (con__29830__auto__){
return (function (briefing_notes){
if(clojure.string.blank_QMARK_.call(null,briefing_notes)){
return hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-style","font-style",-773672352),"italic",new cljs.core.Keyword(null,"color","color",1011675173),"darkgrey"], null),"No briefing notes were included.");
} else {
return briefing_notes;
}
});})(con__29830__auto__))
).call(null,weathergen.ui.briefing_notes));
});})(con__29830__auto__))
,null));
var tpl__29832__auto__ = ((function (con__29830__auto__,alt__29831__auto__){
return (function (p__29833__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29833__auto__)?con__29830__auto__:alt__29831__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29830__auto__,alt__29831__auto__))
;
return javelin.core.formula.call(null,tpl__29832__auto__).call(null,javelin.core.formula.call(null,((function (con__29830__auto__,alt__29831__auto__,tpl__29832__auto__){
return (function (G__50347,G__50348){
return G__50347.call(null,G__50348,new cljs.core.Keyword(null,"edit","edit",-1641834166));
});})(con__29830__auto__,alt__29831__auto__,tpl__29832__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})()));
});
/**
 * Controls for how the map is displayed.
 */
weathergen.ui.map_controls_section = (function weathergen$ui$map_controls_section(_){
return hoplon.core.div.call(null,weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"general","general",380803686)], null),"General Display Options"),(function (){var slider_row = (function (p__50362){
var map__50363 = p__50362;
var map__50363__$1 = ((((!((map__50363 == null)))?((((map__50363.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__50363.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__50363):map__50363);
var label = cljs.core.get.call(null,map__50363__$1,new cljs.core.Keyword(null,"label","label",1718410804));
var key = cljs.core.get.call(null,map__50363__$1,new cljs.core.Keyword(null,"key","key",-1516042587));
var init = cljs.core.get.call(null,map__50363__$1,new cljs.core.Keyword(null,"init","init",-1875481434));
var min = cljs.core.get.call(null,map__50363__$1,new cljs.core.Keyword(null,"min","min",444991522));
var max = cljs.core.get.call(null,map__50363__$1,new cljs.core.Keyword(null,"max","max",61366548));
return hoplon.core.tr.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),key], null),hoplon.core.td.call(null,label)),(function (){var id = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.gensym.call(null))].join('');
return hoplon.core.td.call(null,hoplon.core.datalist.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),id,(function (){var iter__24200__auto__ = ((function (id,map__50363,map__50363__$1,label,key,init,min,max){
return (function weathergen$ui$map_controls_section_$_iter__50365(s__50366){
return (new cljs.core.LazySeq(null,((function (id,map__50363,map__50363__$1,label,key,init,min,max){
return (function (){
var s__50366__$1 = s__50366;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__50366__$1);
if(temp__5278__auto__){
var s__50366__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50366__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__50366__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__50368 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__50367 = (0);
while(true){
if((i__50367 < size__24199__auto__)){
var val = cljs.core._nth.call(null,c__24198__auto__,i__50367);
cljs.core.chunk_append.call(null,b__50368,hoplon.core.option.call(null,new cljs.core.Keyword(null,"value","value",305978217),val));

var G__50374 = (i__50367 + (1));
i__50367 = G__50374;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50368),weathergen$ui$map_controls_section_$_iter__50365.call(null,cljs.core.chunk_rest.call(null,s__50366__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50368),null);
}
} else {
var val = cljs.core.first.call(null,s__50366__$2);
return cljs.core.cons.call(null,hoplon.core.option.call(null,new cljs.core.Keyword(null,"value","value",305978217),val),weathergen$ui$map_controls_section_$_iter__50365.call(null,cljs.core.rest.call(null,s__50366__$2)));
}
} else {
return null;
}
break;
}
});})(id,map__50363,map__50363__$1,label,key,init,min,max))
,null,null));
});})(id,map__50363,map__50363__$1,label,key,init,min,max))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,((100) * min),((100) * (max + (1))),((max - min) * (25))));
})()),hoplon.core.input.call(null,new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"type","type",1174270348),"range",new cljs.core.Keyword(null,"list","list",765357683),id,new cljs.core.Keyword(null,"min","min",444991522),cljs.core.long$.call(null,(min * (100))),new cljs.core.Keyword(null,"max","max",61366548),cljs.core.long$.call(null,(max * (100))),new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (id,map__50363,map__50363__$1,label,key,init,min,max){
return (function (G__50369,G__50371,G__50370){
return (G__50369.call(null,G__50370,G__50371) * (100));
});})(id,map__50363,map__50363__$1,label,key,init,min,max))
).call(null,cljs.core.get,key,weathergen.ui.map_display),new cljs.core.Keyword(null,"input","input",556931961),((function (id,map__50363,map__50363__$1,label,key,init,min,max){
return (function (p1__50349_SHARP_){
return cljs.core.swap_BANG_.call(null,weathergen.ui.map_display,cljs.core.assoc,key,(cljs.core.deref.call(null,p1__50349_SHARP_) / 100.0));
});})(id,map__50363,map__50363__$1,label,key,init,min,max))
], null)));
})(),hoplon.core.td.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (map__50363,map__50363__$1,label,key,init,min,max){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.map_display,cljs.core.assoc,key,init);
});})(map__50363,map__50363__$1,label,key,init,min,max))
,"Reset"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),cljs.core.keyword.call(null,[cljs.core.str.cljs$core$IFn$_invoke$arity$1("reset-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,key))].join(''))], null))));
});
return hoplon.core.div.call(null,hoplon.core.table.call(null,slider_row.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"label","label",1718410804),"Brightness:",new cljs.core.Keyword(null,"key","key",-1516042587),new cljs.core.Keyword(null,"brightness","brightness",1067055820),new cljs.core.Keyword(null,"init","init",-1875481434),0.5,new cljs.core.Keyword(null,"min","min",444991522),(0),new cljs.core.Keyword(null,"max","max",61366548),1.0], null)),slider_row.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"label","label",1718410804),"Text size:",new cljs.core.Keyword(null,"key","key",-1516042587),new cljs.core.Keyword(null,"text-size","text-size",-945618309),new cljs.core.Keyword(null,"init","init",-1875481434),(0),new cljs.core.Keyword(null,"min","min",444991522),-1.0,new cljs.core.Keyword(null,"max","max",61366548),1.0], null)),slider_row.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"label","label",1718410804),"Icon size:",new cljs.core.Keyword(null,"key","key",-1516042587),new cljs.core.Keyword(null,"icon-size","icon-size",414161352),new cljs.core.Keyword(null,"init","init",-1875481434),(0),new cljs.core.Keyword(null,"min","min",444991522),-1.0,new cljs.core.Keyword(null,"max","max",61366548),1.0], null))),hoplon.core.div.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (slider_row){
return (function (G__50372){
return new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124).cljs$core$IFn$_invoke$arity$1(G__50372);
});})(slider_row))
).call(null,weathergen.ui.map_display),new cljs.core.Keyword(null,"change","change",-1163046502),((function (slider_row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.map_display,cljs.core.update,new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124),cljs.core.not);
});})(slider_row))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124)], null),hoplon.core.label.call(null,"Display text with contrasting background"))),hoplon.core.div.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (slider_row){
return (function (G__50373){
return new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003).cljs$core$IFn$_invoke$arity$1(G__50373);
});})(slider_row))
).call(null,weathergen.ui.map_display),new cljs.core.Keyword(null,"change","change",-1163046502),((function (slider_row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.map_display,cljs.core.update,new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003),cljs.core.not);
});})(slider_row))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003)], null),hoplon.core.label.call(null,"Show bullseye"))));
})()),weathergen.ui.airbase_display_controls.call(null,"Airbase Display Options"),(function (){var flight_path_display_controls = new cljs.core.Keyword(null,"map-display-controls-fn","map-display-controls-fn",1472969543).cljs$core$IFn$_invoke$arity$1(weathergen.ui.flight_paths_layer);
return flight_path_display_controls.call(null,"Flight Path Display Options");
})());
});
weathergen.ui.head = (function weathergen$ui$head(){
return hoplon.core.head.call(null,hoplon.core.title.call(null,javelin.core.formula.call(null,(function (mission,display_mode){
if(cljs.core.not.call(null,mission)){
return "Virtual Mission Tools";
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.falcon.files.mission.theaterdef_name.call(null,mission)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" - "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(mission)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"briefing","briefing",-176308969),display_mode))?".vmtb":null))].join('');
}
})).call(null,weathergen.ui.mission,weathergen.ui.display_mode)),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"lib/jquery-minicolors/jquery.minicolors.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"title","title",636505583),"main",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.script.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"lib/jquery-minicolors/jquery.minicolors.min.js",new cljs.core.Keyword(null,"type","type",1174270348),"text/javascript"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"select2.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"style.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"title","title",636505583),"main",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"fonts/open-sans-condensed/open-sans-condensed.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"fonts/share-tech-mono/share-tech-mono.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"fonts/source-code-pro/source-code-pro.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.style.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text/css",garden.core.css.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"fieldset","fieldset",-1949770816),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"10px"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [garden.selectors.input.call(null,garden.selectors.attr_EQ_.call(null,new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"range","range",1639692286))),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"5px"], null)], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,".info-grid",".info-grid",1372988462),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"border-collapse","border-collapse",919100239),"collapse",new cljs.core.Keyword(null,"border","border",1444987323),"solid 1px"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"thead","thead",-291875296),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"background","background",-863952629),"lightgray",new cljs.core.Keyword(null,"border-bottom","border-bottom",2110948415),"1px solid black"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tr","tr",-1424774646),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [garden.selectors._AMPERSAND_.call(null,garden.selectors.nth_child.call(null,new cljs.core.Keyword(null,"even","even",-275845692))),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background","background",-863952629),"#F2F0E0"], null)], null)], null)], null))));
});
weathergen.ui.message_display = (function weathergen$ui$message_display(){
return javelin.core.formula.call(null,(function (messages){
var iter__24200__auto__ = (function weathergen$ui$message_display_$_iter__50379(s__50380){
return (new cljs.core.LazySeq(null,(function (){
var s__50380__$1 = s__50380;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__50380__$1);
if(temp__5278__auto__){
var s__50380__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50380__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__50380__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__50382 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__50381 = (0);
while(true){
if((i__50381 < size__24199__auto__)){
var message = cljs.core._nth.call(null,c__24198__auto__,i__50381);
cljs.core.chunk_append.call(null,b__50382,(function (){var visible_QMARK_ = javelin.core.cell.call(null,true);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"fade-toggle","fade-toggle",-1468421852),visible_QMARK_,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"border","border",1444987323),"double",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black",new cljs.core.Keyword(null,"background","background",-863952629),"#945594",new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"3px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),"5px"], null),message),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"150%",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"top","top",-1856271961),"-8px",new cljs.core.Keyword(null,"right","right",-452581833),"5px",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer"], null),new cljs.core.Keyword(null,"click","click",1912301393),((function (i__50381,visible_QMARK_,message,c__24198__auto__,size__24199__auto__,b__50382,s__50380__$2,temp__5278__auto__){
return (function (){
return cljs.core.reset_BANG_.call(null,visible_QMARK_,false);
});})(i__50381,visible_QMARK_,message,c__24198__auto__,size__24199__auto__,b__50382,s__50380__$2,temp__5278__auto__))
,"\u00D7"));
})());

var G__50383 = (i__50381 + (1));
i__50381 = G__50383;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50382),weathergen$ui$message_display_$_iter__50379.call(null,cljs.core.chunk_rest.call(null,s__50380__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50382),null);
}
} else {
var message = cljs.core.first.call(null,s__50380__$2);
return cljs.core.cons.call(null,(function (){var visible_QMARK_ = javelin.core.cell.call(null,true);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"fade-toggle","fade-toggle",-1468421852),visible_QMARK_,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"border","border",1444987323),"double",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black",new cljs.core.Keyword(null,"background","background",-863952629),"#945594",new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"3px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),"5px"], null),message),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"150%",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"top","top",-1856271961),"-8px",new cljs.core.Keyword(null,"right","right",-452581833),"5px",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer"], null),new cljs.core.Keyword(null,"click","click",1912301393),((function (visible_QMARK_,message,s__50380__$2,temp__5278__auto__){
return (function (){
return cljs.core.reset_BANG_.call(null,visible_QMARK_,false);
});})(visible_QMARK_,message,s__50380__$2,temp__5278__auto__))
,"\u00D7"));
})(),weathergen$ui$message_display_$_iter__50379.call(null,cljs.core.rest.call(null,s__50380__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24200__auto__.call(null,messages);
})).call(null,weathergen.ui.messages);
});
/**
 * Returns UI that renders the titlebar.
 */
weathergen.ui.titlebar = (function weathergen$ui$titlebar(){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"titlebar",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"background","background",-863952629),"black",new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"padding","padding",1660304693),weathergen.ui.common.px.call(null,(4),(13)),new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),weathergen.ui.common.px.call(null,(2)),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,(64))], null),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"titlebar-contents",weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"left-words",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),weathergen.ui.common.px.call(null,(14))], null),hoplon.core.span.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"title",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),weathergen.ui.common.px.call(null,(16)),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(200))], null),"Virtual Mission Tools"),hoplon.core.span.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"version",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),weathergen.ui.common.px.call(null,(10))], null),javelin.core.formula.call(null,(function (build_info){
var map__50386 = build_info;
var map__50386__$1 = ((((!((map__50386 == null)))?((((map__50386.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__50386.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__50386):map__50386);
var VERSION = cljs.core.get.call(null,map__50386__$1,"VERSION");
var CHANNEL = cljs.core.get.call(null,map__50386__$1,"CHANNEL");
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("("),cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__23338__auto__ = VERSION;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "dev-build";
}
})()),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_((function (){var and__23326__auto__ = CHANNEL;
if(cljs.core.truth_(and__23326__auto__)){
return cljs.core.not_EQ_.call(null,CHANNEL,"stable");
} else {
return and__23326__auto__;
}
})())?[cljs.core.str.cljs$core$IFn$_invoke$arity$1("@"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(CHANNEL)].join(''):null)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join('');
})).call(null,weathergen.ui.build_info)),hoplon.core.span.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"byline",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),weathergen.ui.common.px.call(null,(5))], null),"by",weathergen.ui.common.styled.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block"], null),new cljs.core.Keyword(null,"garden","garden",-1966516149),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a","a",-2123407586),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),weathergen.ui.common.px.call(null,(5))], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:link","a:link",-504615780),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"white"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:visited","a:visited",-737262631),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"white"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:hover","a:hover",-1474674872),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"lightblue"], null)], null)], null),hoplon.core.a.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"http://firstfighterwing.com/VFW/member.php?893-Tyrant",new cljs.core.Keyword(null,"target","target",253001721),"_blank","Tyrant")))),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"right-words",weathergen.ui.common.styled.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"helpstring",new cljs.core.Keyword(null,"garden","garden",-1966516149),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"right","right",-452581833),weathergen.ui.common.px.call(null,(100)),new cljs.core.Keyword(null,"top","top",-1856271961),weathergen.ui.common.px.call(null,(45))], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a","a",-2123407586),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.ems.call(null,0.2)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:visited","a:visited",-737262631),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"white"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:hover","a:hover",-1474674872),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"lightblue"], null)], null)], null),hoplon.core.span.call(null,"Help? Bug? Feature request? Click",hoplon.core.a.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"help.html",new cljs.core.Keyword(null,"target","target",253001721),"_blank","here"),".")),hoplon.core.a.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"right","right",-452581833),weathergen.ui.common.px.call(null,(20)),new cljs.core.Keyword(null,"top","top",-1856271961),weathergen.ui.common.px.call(null,(12))], null),new cljs.core.Keyword(null,"href","href",-793805698),"http://firstfighterwing.com",new cljs.core.Keyword(null,"target","target",253001721),"_blank",hoplon.core.img.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,(64))], null),new cljs.core.Keyword(null,"src","src",-1651076051),"images/1stVFW_Insignia-64.png")))));
});
weathergen.ui.section_ctor = cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"mission-info-section","mission-info-section",1401749344),new cljs.core.Keyword(null,"weather-override-parameters","weather-override-parameters",491414981),new cljs.core.Keyword(null,"weather-display-controls","weather-display-controls",941597221),new cljs.core.Keyword(null,"forecast-section","forecast-section",-1278731643),new cljs.core.Keyword(null,"air-forces-section","air-forces-section",-222064121),new cljs.core.Keyword(null,"briefing-notes-section","briefing-notes-section",1870993417),new cljs.core.Keyword(null,"advanced-controls","advanced-controls",-278238996),new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"cloud-controls","cloud-controls",817145581),new cljs.core.Keyword(null,"wind-stability-parameters","wind-stability-parameters",1572956177),new cljs.core.Keyword(null,"weather-parameters","weather-parameters",-1852076459),new cljs.core.Keyword(null,"save-briefing-section","save-briefing-section",143974425),new cljs.core.Keyword(null,"oob-section","oob-section",1786899258),new cljs.core.Keyword(null,"map-controls-section","map-controls-section",684229466),new cljs.core.Keyword(null,"test-section","test-section",-945916038),new cljs.core.Keyword(null,"weather-type-configuration","weather-type-configuration",-358032997),new cljs.core.Keyword(null,"step-controls","step-controls",-854420677),new cljs.core.Keyword(null,"flights-section","flights-section",1247077532)],[weathergen.ui.mission_info_section,weathergen.ui.weather_override_parameters,weathergen.ui.weather_display_controls,weathergen.ui.forecast_section,weathergen.ui.air_forces_section,weathergen.ui.briefing_notes_section,weathergen.ui.advanced_controls,weathergen.ui.serialization_controls,weathergen.ui.cloud_controls,weathergen.ui.wind_stability_parameters,weathergen.ui.weather_parameters,weathergen.ui.save_briefing_section,weathergen.ui.order_of_battle_section,weathergen.ui.map_controls_section,weathergen.ui.test_section,weathergen.ui.weather_type_configuration,weathergen.ui.step_controls,(function (opts){
var ctor = new cljs.core.Keyword(null,"controls-fn","controls-fn",-807620277).cljs$core$IFn$_invoke$arity$1(weathergen.ui.flight_paths_layer);
var scroll_container = new cljs.core.Keyword("weathergen.ui","scroll-container","weathergen.ui/scroll-container",236222120).cljs$core$IFn$_invoke$arity$1(opts);
return ctor.call(null,scroll_container);
})]);
/**
 * Emits an app page. `section-infos` is a seq of maps, one for each
 *   tab, with keys `:title`, `:id`, and `:sections`. The sections are a
 *   seq of keys into `section-ctor` and the parameters for that
 *   section.
 */
weathergen.ui.weather_page = (function weathergen$ui$weather_page(section_infos){
return hoplon.core.html.call(null,weathergen.ui.head.call(null),hoplon.core.body.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin","margin",-995903681),"8px"], null)], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"app",weathergen.ui.titlebar.call(null),weathergen.ui.message_display.call(null),(function (){var right_width = (575);
var portrait_QMARK_ = javelin.core.formula.call(null,((function (right_width){
return (function (map_size,window_size){
var vec__50474 = map_size;
var grid_width = cljs.core.nth.call(null,vec__50474,(0),null);
var grid_height = cljs.core.nth.call(null,vec__50474,(1),null);
var vec__50477 = window_size;
var window_width = cljs.core.nth.call(null,vec__50477,(0),null);
var window_height = cljs.core.nth.call(null,vec__50477,(1),null);
return (window_width < ((grid_width + right_width) + (-10)));
});})(right_width))
).call(null,weathergen.ui.map_size,weathergen.ui.window_size);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (right_width,portrait_QMARK_){
return (function (portrait_QMARK___$1,p__50480){
var vec__50481 = p__50480;
var window_width = cljs.core.nth.call(null,vec__50481,(0),null);
var window_height = cljs.core.nth.call(null,vec__50481,(1),null);
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"display","display",242065432),"flex",new cljs.core.Keyword(null,"flex-direction","flex-direction",364609438),(cljs.core.truth_(portrait_QMARK___$1)?"column":"row"),new cljs.core.Keyword(null,"overflow","overflow",2058931880),(cljs.core.truth_(portrait_QMARK___$1)?"show":"hidden"),new cljs.core.Keyword(null,"height","height",1025178622),(cljs.core.truth_(portrait_QMARK___$1)?"100%":[cljs.core.str.cljs$core$IFn$_invoke$arity$1((window_height - (90))),cljs.core.str.cljs$core$IFn$_invoke$arity$1("px")].join(''))], null);
});})(right_width,portrait_QMARK_))
).call(null,portrait_QMARK_,weathergen.ui.window_size),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"left-column",new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (right_width,portrait_QMARK_){
return (function (portrait_QMARK___$1){
if(cljs.core.truth_(portrait_QMARK___$1)){
return cljs.core.PersistentArrayMap.EMPTY;
} else {
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"overflow","overflow",2058931880),"auto",new cljs.core.Keyword(null,"height","height",1025178622),"auto"], null);
}
});})(right_width,portrait_QMARK_))
).call(null,portrait_QMARK_),weathergen.ui.button_bar.call(null),weathergen.ui.grid.call(null,new cljs.core.Keyword(null,"display-params","display-params",573405707),weathergen.ui.display_params,new cljs.core.Keyword(null,"weather-data","weather-data",-664219401),weathergen.ui.weather_data,new cljs.core.Keyword(null,"selected-cell","selected-cell",1638390443),weathergen.ui.selected_cell,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),weathergen.ui.wind_stability_areas,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),weathergen.ui.weather_overrides,new cljs.core.Keyword(null,"computing","computing",-1002386157),weathergen.ui.computing,new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243),weathergen.ui.pressure_unit,new cljs.core.Keyword(null,"nx","nx",-1996436366),cljs.core.first.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))),new cljs.core.Keyword(null,"ny","ny",1701791641),cljs.core.second.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))))),(function (){var right_column = hoplon.core.div.call(null);
return right_column.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"right-column",new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (right_column,right_width,portrait_QMARK_){
return (function (portrait_QMARK___$1){
return cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"display","display",242065432),"block",new cljs.core.Keyword(null,"align-content","align-content",-990200349),"flex-start",new cljs.core.Keyword(null,"flex-wrap","flex-wrap",455413707),"wrap",new cljs.core.Keyword(null,"flex-grow","flex-grow",1865160747),(1),new cljs.core.Keyword(null,"min-width","min-width",1926193728),[cljs.core.str.cljs$core$IFn$_invoke$arity$1((right_width - (20))),cljs.core.str.cljs$core$IFn$_invoke$arity$1("px")].join(''),new cljs.core.Keyword(null,"width","width",-384071477),(0)], null),(cljs.core.truth_(portrait_QMARK___$1)?null:new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"overflow","overflow",2058931880),"auto",new cljs.core.Keyword(null,"height","height",1025178622),"auto"], null)));
});})(right_column,right_width,portrait_QMARK_))
).call(null,portrait_QMARK_),weathergen.ui.tabs.tabs.call(null,new cljs.core.Keyword(null,"selected","selected",574897764),javelin.core.cell.call(null,new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(cljs.core.first.call(null,section_infos))),new cljs.core.Keyword(null,"tabs","tabs",-779855354),(function (){var iter__24200__auto__ = ((function (right_column,right_width,portrait_QMARK_){
return (function weathergen$ui$weather_page_$_iter__50484(s__50485){
return (new cljs.core.LazySeq(null,((function (right_column,right_width,portrait_QMARK_){
return (function (){
var s__50485__$1 = s__50485;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__50485__$1);
if(temp__5278__auto__){
var s__50485__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50485__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__50485__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__50487 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__50486 = (0);
while(true){
if((i__50486 < size__24199__auto__)){
var map__50524 = cljs.core._nth.call(null,c__24198__auto__,i__50486);
var map__50524__$1 = ((((!((map__50524 == null)))?((((map__50524.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__50524.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__50524):map__50524);
var title = cljs.core.get.call(null,map__50524__$1,new cljs.core.Keyword(null,"title","title",636505583));
var id = cljs.core.get.call(null,map__50524__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var sections = cljs.core.get.call(null,map__50524__$1,new cljs.core.Keyword(null,"sections","sections",-886710106));
cljs.core.chunk_append.call(null,b__50487,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),title,new cljs.core.Keyword(null,"id","id",-1388402092),id,new cljs.core.Keyword(null,"ui","ui",-469653645),(function (){var iter__24200__auto__ = ((function (i__50486,map__50524,map__50524__$1,title,id,sections,c__24198__auto__,size__24199__auto__,b__50487,s__50485__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_){
return (function weathergen$ui$weather_page_$_iter__50484_$_iter__50526(s__50527){
return (new cljs.core.LazySeq(null,((function (i__50486,map__50524,map__50524__$1,title,id,sections,c__24198__auto__,size__24199__auto__,b__50487,s__50485__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_){
return (function (){
var s__50527__$1 = s__50527;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__50527__$1);
if(temp__5278__auto____$1){
var s__50527__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50527__$2)){
var c__24198__auto____$1 = cljs.core.chunk_first.call(null,s__50527__$2);
var size__24199__auto____$1 = cljs.core.count.call(null,c__24198__auto____$1);
var b__50529 = cljs.core.chunk_buffer.call(null,size__24199__auto____$1);
if((function (){var i__50528 = (0);
while(true){
if((i__50528 < size__24199__auto____$1)){
var vec__50536 = cljs.core._nth.call(null,c__24198__auto____$1,i__50528);
var section = cljs.core.nth.call(null,vec__50536,(0),null);
var opts = cljs.core.nth.call(null,vec__50536,(1),null);
var ctor = weathergen.ui.section_ctor.call(null,section);
cljs.core.chunk_append.call(null,b__50529,(function (){var timer_name__15521__auto__ = [cljs.core.str.cljs$core$IFn$_invoke$arity$1("Rendering "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(section)].join('');
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = ctor.call(null,cljs.core.assoc.call(null,opts,new cljs.core.Keyword("weathergen.ui","scroll-container","weathergen.ui/scroll-container",236222120),right_column));
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
})());

var G__50560 = (i__50528 + (1));
i__50528 = G__50560;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50529),weathergen$ui$weather_page_$_iter__50484_$_iter__50526.call(null,cljs.core.chunk_rest.call(null,s__50527__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50529),null);
}
} else {
var vec__50539 = cljs.core.first.call(null,s__50527__$2);
var section = cljs.core.nth.call(null,vec__50539,(0),null);
var opts = cljs.core.nth.call(null,vec__50539,(1),null);
var ctor = weathergen.ui.section_ctor.call(null,section);
return cljs.core.cons.call(null,(function (){var timer_name__15521__auto__ = [cljs.core.str.cljs$core$IFn$_invoke$arity$1("Rendering "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(section)].join('');
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = ctor.call(null,cljs.core.assoc.call(null,opts,new cljs.core.Keyword("weathergen.ui","scroll-container","weathergen.ui/scroll-container",236222120),right_column));
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
})(),weathergen$ui$weather_page_$_iter__50484_$_iter__50526.call(null,cljs.core.rest.call(null,s__50527__$2)));
}
} else {
return null;
}
break;
}
});})(i__50486,map__50524,map__50524__$1,title,id,sections,c__24198__auto__,size__24199__auto__,b__50487,s__50485__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_))
,null,null));
});})(i__50486,map__50524,map__50524__$1,title,id,sections,c__24198__auto__,size__24199__auto__,b__50487,s__50485__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_))
;
return iter__24200__auto__.call(null,cljs.core.partition.call(null,(2),sections));
})()], null));

var G__50561 = (i__50486 + (1));
i__50486 = G__50561;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50487),weathergen$ui$weather_page_$_iter__50484.call(null,cljs.core.chunk_rest.call(null,s__50485__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50487),null);
}
} else {
var map__50542 = cljs.core.first.call(null,s__50485__$2);
var map__50542__$1 = ((((!((map__50542 == null)))?((((map__50542.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__50542.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__50542):map__50542);
var title = cljs.core.get.call(null,map__50542__$1,new cljs.core.Keyword(null,"title","title",636505583));
var id = cljs.core.get.call(null,map__50542__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var sections = cljs.core.get.call(null,map__50542__$1,new cljs.core.Keyword(null,"sections","sections",-886710106));
return cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),title,new cljs.core.Keyword(null,"id","id",-1388402092),id,new cljs.core.Keyword(null,"ui","ui",-469653645),(function (){var iter__24200__auto__ = ((function (map__50542,map__50542__$1,title,id,sections,s__50485__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_){
return (function weathergen$ui$weather_page_$_iter__50484_$_iter__50544(s__50545){
return (new cljs.core.LazySeq(null,((function (map__50542,map__50542__$1,title,id,sections,s__50485__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_){
return (function (){
var s__50545__$1 = s__50545;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__50545__$1);
if(temp__5278__auto____$1){
var s__50545__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50545__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__50545__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__50547 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__50546 = (0);
while(true){
if((i__50546 < size__24199__auto__)){
var vec__50554 = cljs.core._nth.call(null,c__24198__auto__,i__50546);
var section = cljs.core.nth.call(null,vec__50554,(0),null);
var opts = cljs.core.nth.call(null,vec__50554,(1),null);
var ctor = weathergen.ui.section_ctor.call(null,section);
cljs.core.chunk_append.call(null,b__50547,(function (){var timer_name__15521__auto__ = [cljs.core.str.cljs$core$IFn$_invoke$arity$1("Rendering "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(section)].join('');
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = ctor.call(null,cljs.core.assoc.call(null,opts,new cljs.core.Keyword("weathergen.ui","scroll-container","weathergen.ui/scroll-container",236222120),right_column));
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
})());

var G__50562 = (i__50546 + (1));
i__50546 = G__50562;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50547),weathergen$ui$weather_page_$_iter__50484_$_iter__50544.call(null,cljs.core.chunk_rest.call(null,s__50545__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50547),null);
}
} else {
var vec__50557 = cljs.core.first.call(null,s__50545__$2);
var section = cljs.core.nth.call(null,vec__50557,(0),null);
var opts = cljs.core.nth.call(null,vec__50557,(1),null);
var ctor = weathergen.ui.section_ctor.call(null,section);
return cljs.core.cons.call(null,(function (){var timer_name__15521__auto__ = [cljs.core.str.cljs$core$IFn$_invoke$arity$1("Rendering "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(section)].join('');
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = ctor.call(null,cljs.core.assoc.call(null,opts,new cljs.core.Keyword("weathergen.ui","scroll-container","weathergen.ui/scroll-container",236222120),right_column));
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
})(),weathergen$ui$weather_page_$_iter__50484_$_iter__50544.call(null,cljs.core.rest.call(null,s__50545__$2)));
}
} else {
return null;
}
break;
}
});})(map__50542,map__50542__$1,title,id,sections,s__50485__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_))
,null,null));
});})(map__50542,map__50542__$1,title,id,sections,s__50485__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_))
;
return iter__24200__auto__.call(null,cljs.core.partition.call(null,(2),sections));
})()], null),weathergen$ui$weather_page_$_iter__50484.call(null,cljs.core.rest.call(null,s__50485__$2)));
}
} else {
return null;
}
break;
}
});})(right_column,right_width,portrait_QMARK_))
,null,null));
});})(right_column,right_width,portrait_QMARK_))
;
return iter__24200__auto__.call(null,section_infos);
})()));
})());
})()),weathergen.ui.debug_info.call(null)));
});
