// Compiled by ClojureScript 1.10.520 {}
goog.provide('weathergen.ui.layers.annotations');
goog.require('cljs.core');
goog.require('cljs.pprint');
goog.require('clojure.string');
goog.require('goog.string');
goog.require('goog.string.format');
goog.require('hoplon.core');
goog.require('hoplon.svg');
goog.require('javelin.core');
goog.require('weathergen.compression');
goog.require('weathergen.coordinates');
goog.require('weathergen.encoding');
goog.require('weathergen.falcon.files.mission');
goog.require('weathergen.filesystem');
goog.require('weathergen.help');
goog.require('weathergen.math');
goog.require('weathergen.ui.buttons');
goog.require('weathergen.ui.common');
goog.require('weathergen.ui.tabs');
goog.require('weathergen.ui.textarea');
goog.require('weathergen.util');
weathergen.ui.common.register_class_BANG_.call(null,new cljs.core.Keyword("weathergen.ui.layers.annotations","no-focus-border","weathergen.ui.layers.annotations/no-focus-border",-1173765124),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"&:hover","&:hover",-852658855),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"outline","outline",793464534),"none"], null)], null));
var counter_35934 = cljs.core.atom.call(null,(0));
weathergen.ui.layers.annotations.unique_id = ((function (counter_35934){
return (function weathergen$ui$layers$annotations$unique_id(){
return cljs.core.swap_BANG_.call(null,counter_35934,cljs.core.inc);
});})(counter_35934))
;
/**
 * Given a cell of points (a map from IDs to 2-tuples), return a cell of
 *   maps from IDs to names for them.
 */
weathergen.ui.layers.annotations.point_names = (function weathergen$ui$layers$annotations$point_names(points){
return javelin.core.formula.call(null,(function (points__$1){
return cljs.core.zipmap.call(null,cljs.core.sort.call(null,cljs.core.keys.call(null,points__$1)),cljs.core.map.call(null,(function (p1__35935_SHARP_){
return String.fromCharCode(((65) + p1__35935_SHARP_));
}),cljs.core.range.call(null)));
})).call(null,points);
});
/**
 * Computes the rotation of an arrow (0 is east) given a vector from its
 *   start to its end.
 */
weathergen.ui.layers.annotations.annotation_rotation = (function weathergen$ui$layers$annotations$annotation_rotation(v){
return cljs.core.mod.call(null,((90) - weathergen.math.heading.call(null,v)),(360));
});
/**
 * Returns the vector midpoint of two  
 */
weathergen.ui.layers.annotations.midpoint = (function weathergen$ui$layers$annotations$midpoint(a,b){
return weathergen.math.vector_scale.call(null,0.5,weathergen.math.vector_add.call(null,b,a));
});
weathergen.ui.layers.annotations.font_scale_factor = 7.87406581267874E-4;
var base_35936 = 1.0875853314770578;
var factor_35937 = weathergen.ui.layers.annotations.font_scale_factor;
weathergen.ui.layers.annotations.font_size__GT_scale = ((function (base_35936,factor_35937){
return (function weathergen$ui$layers$annotations$font_size__GT_scale(font_size){
return (Math.pow(base_35936,font_size) * factor_35937);
});})(base_35936,factor_35937))
;

weathergen.ui.layers.annotations.scale__GT_font_size = ((function (base_35936,factor_35937){
return (function weathergen$ui$layers$annotations$scale__GT_font_size(scale){
return (Math.log((scale / factor_35937)) / Math.log(base_35936));
});})(base_35936,factor_35937))
;
/**
 * Converts `val`, a value on the linear interval `linear-min` to
 *   `linear-max`, exponentially along the interval `exp-min` to
 *   `exp-max`.
 */
weathergen.ui.layers.annotations.linear__GT_exp = (function weathergen$ui$layers$annotations$linear__GT_exp(val,linear_min,linear_max,exp_min,exp_max){
var a = (exp_max / exp_min);
var b = Math.pow(a,(1.0 / (linear_max - linear_min)));
var c = (exp_min / Math.pow(b,linear_min));
return (c * Math.pow(b,val));
});
/**
 * Complement of `linear->exp`.
 */
weathergen.ui.layers.annotations.exp__GT_linear = (function weathergen$ui$layers$annotations$exp__GT_linear(val,linear_min,linear_max,exp_min,exp_max){
var a = (exp_max / exp_min);
var b = Math.pow(a,(1.0 / (linear_max - linear_min)));
var c = (exp_min / Math.pow(b,linear_min));
return (Math.log((val / c)) / Math.log(b));
});
weathergen.ui.layers.annotations.stroke_and_fill_attrs = (function weathergen$ui$layers$annotations$stroke_and_fill_attrs(annotation){
var fill_color = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"fill-color","fill-color",-1156875903)], null));
var filled_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"filled?","filled?",-1363697461)], null));
var edge_color = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-color","edge-color",-533761623)], null));
var edge_dash_length = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-dash-length","edge-dash-length",-19162360)], null));
var edge_dash_spacing = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-dash-spacing","edge-dash-spacing",1667711192)], null));
var edge_style = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-style","edge-style",1285542514)], null));
var edge_width = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-width","edge-width",-1845528442)], null));
var open_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"open?","open?",1238443125)], null));
var edge_dash_length__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_){
return (function (edge_dash_length__$1){
var or__4131__auto__ = edge_dash_length__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_))
).call(null,edge_dash_length),((function (fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,edge_dash_length,v__15911__auto__);
});})(fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_))
);
var edge_dash_spacing__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (edge_dash_length__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_){
return (function (edge_dash_spacing__$1){
var or__4131__auto__ = edge_dash_spacing__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(edge_dash_length__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_))
).call(null,edge_dash_spacing),((function (edge_dash_length__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,edge_dash_spacing,v__15911__auto__);
});})(edge_dash_length__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_))
);
var edge_width__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (edge_dash_length__$1,edge_dash_spacing__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_){
return (function (edge_width__$1){
var or__4131__auto__ = edge_width__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(edge_dash_length__$1,edge_dash_spacing__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_))
).call(null,edge_width),((function (edge_dash_length__$1,edge_dash_spacing__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,edge_width,v__15911__auto__);
});})(edge_dash_length__$1,edge_dash_spacing__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_))
);
var bw = javelin.core.formula.call(null,((function (edge_dash_length__$1,edge_dash_spacing__$1,edge_width__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_){
return (function (edge_style__$1,edge_width__$2){
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"none","none",1333468478),edge_style__$1)){
return (0);
} else {
return (edge_width__$2 / (200));
}
});})(edge_dash_length__$1,edge_dash_spacing__$1,edge_width__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_))
).call(null,edge_style,edge_width__$1);
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),javelin.core.formula.call(null,((function (bw,edge_dash_length__$1,edge_dash_spacing__$1,edge_width__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_){
return (function (G__35938,G__35939){
return G__35938.call(null,G__35939);
});})(bw,edge_dash_length__$1,edge_dash_spacing__$1,edge_width__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_))
).call(null,weathergen.ui.common.to_rgba,edge_color),new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),bw,new cljs.core.Keyword(null,"fill","fill",883462889),javelin.core.formula.call(null,((function (bw,edge_dash_length__$1,edge_dash_spacing__$1,edge_width__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_){
return (function (open_QMARK___$1,filled_QMARK___$1,fill_color__$1){
if(cljs.core.truth_((function (){var and__4120__auto__ = cljs.core.not.call(null,open_QMARK___$1);
if(and__4120__auto__){
return filled_QMARK___$1;
} else {
return and__4120__auto__;
}
})())){
return weathergen.ui.common.to_rgba.call(null,fill_color__$1);
} else {
return "none";
}
});})(bw,edge_dash_length__$1,edge_dash_spacing__$1,edge_width__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_))
).call(null,open_QMARK_,filled_QMARK_,fill_color),new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),javelin.core.formula.call(null,((function (bw,edge_dash_length__$1,edge_dash_spacing__$1,edge_width__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_){
return (function (edge_style__$1,edge_dash_length__$2,edge_dash_spacing__$2){
if(cljs.core._EQ_.call(null,edge_style__$1,new cljs.core.Keyword(null,"dashed","dashed",-1449249319))){
var dash_length = weathergen.ui.layers.annotations.linear__GT_exp.call(null,edge_dash_length__$2,(1),(100),0.005,(10));
var gap_length = (dash_length * weathergen.ui.layers.annotations.linear__GT_exp.call(null,edge_dash_spacing__$2,(1),(100),0.01,(100)));
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(dash_length)," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(gap_length)].join('');
} else {
return null;
}
});})(bw,edge_dash_length__$1,edge_dash_spacing__$1,edge_width__$1,fill_color,filled_QMARK_,edge_color,edge_dash_length,edge_dash_spacing,edge_style,edge_width,open_QMARK_))
).call(null,edge_style,edge_dash_length__$1,edge_dash_spacing__$1)], null);
});
/**
 * Returns SVG for the contents of the annotation
 */
weathergen.ui.layers.annotations.shape_contents_overlay = (function weathergen$ui$layers$annotations$shape_contents_overlay(annotation,p__35940){
var map__35941 = p__35940;
var map__35941__$1 = (((((!((map__35941 == null))))?(((((map__35941.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__35941.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__35941):map__35941);
var state = map__35941__$1;
var suppress_bullseye_info_box_QMARK_ = cljs.core.get.call(null,map__35941__$1,new cljs.core.Keyword(null,"suppress-bullseye-info-box?","suppress-bullseye-info-box?",-1654633798));
var dragging = cljs.core.get.call(null,map__35941__$1,new cljs.core.Keyword(null,"dragging","dragging",1185097613));
var edge_color = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-color","edge-color",-533761623)], null));
var edge_width = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-width","edge-width",-1845528442)], null));
var edge_style = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-style","edge-style",1285542514)], null));
var edge_dash_length = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-dash-length","edge-dash-length",-19162360)], null));
var edge_dash_spacing = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-dash-spacing","edge-dash-spacing",1667711192)], null));
var editing_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null));
var font_bold_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-bold?","font-bold?",-796638521)], null));
var font_color = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-color","font-color",-2019660285)], null));
var font_italic_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-italic?","font-italic?",-663673639)], null));
var font_family = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-family","font-family",-667419874)], null));
var font_size = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346)], null));
var halign = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"halign","halign",-1113968481)], null));
var height = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"height","height",1025178622)], null));
var text = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"text","text",-1790561697)], null));
var shape_type = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"shape-type","shape-type",-835891005)], null));
var valign = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"valign","valign",1485197511)], null));
var width = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"width","width",-384071477)], null));
var edge_width__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (edge_width__$1){
var or__4131__auto__ = edge_width__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,edge_width),((function (edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,edge_width,v__15911__auto__);
});})(edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
);
var edge_dash_length__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (edge_width__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (edge_dash_length__$1){
var or__4131__auto__ = edge_dash_length__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(edge_width__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,edge_dash_length),((function (edge_width__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,edge_dash_length,v__15911__auto__);
});})(edge_width__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
);
var edge_dash_spacing__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (edge_width__$1,edge_dash_length__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (edge_dash_spacing__$1){
var or__4131__auto__ = edge_dash_spacing__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(edge_width__$1,edge_dash_length__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,edge_dash_spacing),((function (edge_width__$1,edge_dash_length__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,edge_dash_spacing,v__15911__auto__);
});})(edge_width__$1,edge_dash_length__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
);
var width__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (width__$1){
var or__4131__auto__ = width__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,width),((function (edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,width,v__15911__auto__);
});})(edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
);
var height__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (height__$1){
var or__4131__auto__ = height__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,height),((function (edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,height,v__15911__auto__);
});})(edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
);
var ew = javelin.core.formula.call(null,((function (edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (edge_style__$1,edge_width__$2){
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"none","none",1333468478),edge_style__$1)){
return (0);
} else {
return (edge_width__$2 / (200));
}
});})(edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,edge_style,edge_width__$1);
var offset = javelin.core.formula.call(null,((function (ew,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (G__35943){
return (G__35943 / (2));
});})(ew,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,ew);
var w = javelin.core.formula.call(null,((function (ew,offset,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (G__35944,G__35945){
var x__4219__auto__ = (0);
var y__4220__auto__ = (G__35944 - G__35945);
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
});})(ew,offset,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,width__$1,ew);
var h = javelin.core.formula.call(null,((function (ew,offset,w,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (G__35946,G__35947){
var x__4219__auto__ = (0);
var y__4220__auto__ = (G__35946 - G__35947);
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
});})(ew,offset,w,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,height__$1,ew);
return hoplon.svg.g.call(null,weathergen.ui.layers.annotations.stroke_and_fill_attrs.call(null,annotation),new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (editing_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"pointer-events","pointer-events",-1053858853),(cljs.core.truth_(editing_QMARK___$1)?null:"none")], null);
});})(ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,editing_QMARK_),(function (){var G__35948 = (new cljs.core.Delay(((function (ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (){
return hoplon.svg.ellipse.call(null,new cljs.core.Keyword(null,"cx","cx",1272694324),javelin.core.formula.call(null,((function (ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (G__35951,G__35952){
return ((G__35951 + G__35952) / (2));
});})(ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,offset,w),new cljs.core.Keyword(null,"cy","cy",755331060),javelin.core.formula.call(null,((function (ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (G__35953,G__35954){
return ((G__35953 + G__35954) / (2));
});})(ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,offset,h),new cljs.core.Keyword(null,"rx","rx",1627208482),javelin.core.formula.call(null,((function (ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (G__35955){
return (G__35955 / (2));
});})(ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,w),new cljs.core.Keyword(null,"ry","ry",-334598563),javelin.core.formula.call(null,((function (ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (G__35956){
return (G__35956 / (2));
});})(ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,h));
});})(ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
,null));
var G__35949 = (new cljs.core.Delay(((function (G__35948,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (){
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),offset,new cljs.core.Keyword(null,"y","y",-1757859776),offset,new cljs.core.Keyword(null,"width","width",-384071477),w,new cljs.core.Keyword(null,"height","height",1025178622),h);
});})(G__35948,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
,null));
var G__35950 = (new cljs.core.Delay(((function (G__35948,G__35949,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (){
return null;
});})(G__35948,G__35949,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
,null));
var tpl__30316__auto__ = ((function (G__35948,G__35949,G__35950,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (expr__30317__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (function (){var G__35958 = expr__30317__auto__;
var G__35958__$1 = (((G__35958 instanceof cljs.core.Keyword))?G__35958.fqn:null);
switch (G__35958__$1) {
case "oval":
return G__35948;

break;
case "rectangle":
return G__35949;

break;
default:
return G__35950;

}
})();
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(G__35948,G__35949,G__35950,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
;
return javelin.core.formula.call(null,tpl__30316__auto__).call(null,shape_type);
})(),(function (){var editing_text_QMARK_ = javelin.core.cell.call(null,false);
var scale_factor = javelin.core.formula.call(null,((function (editing_text_QMARK_,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (font_size__$1){
return weathergen.ui.layers.annotations.font_size__GT_scale.call(null,font_size__$1);
});})(editing_text_QMARK_,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,font_size);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (G__35960,G__35959){
return G__35959.call(null,G__35960);
});})(editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,scale_factor,weathergen.ui.common.svg_scale),(function (){var fo_width = javelin.core.formula.call(null,((function (editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (G__35962,G__35961){
return (G__35961 / G__35962);
});})(editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,scale_factor,width__$1);
var fo_height = javelin.core.formula.call(null,((function (fo_width,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (G__35964,G__35963){
return (G__35963 / G__35964);
});})(fo_width,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,scale_factor,height__$1);
var fo = hoplon.svg.foreignObject.call(null,new cljs.core.Keyword(null,"width","width",-384071477),fo_width,new cljs.core.Keyword(null,"height","height",1025178622),fo_height);
var text_y_35971 = javelin.core.cell.call(null,(0));
fo.call(null,new cljs.core.Keyword(null,"y","y",-1757859776),text_y_35971,(function (){var elem = hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),weathergen.ui.common.class_for.call(null,new cljs.core.Keyword("weathergen.ui.layers.annotations","no-focus-border","weathergen.ui.layers.annotations/no-focus-border",-1173765124)));
hoplon.core.do_watch.call(null,javelin.core.formula.call(null,((function (elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (annotation__$1,scale_factor__$1,fo_height__$1){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"scale-factor","scale-factor",-645225638),scale_factor__$1,new cljs.core.Keyword(null,"annotation","annotation",-344661666),annotation__$1,new cljs.core.Keyword(null,"fo-height","fo-height",-358322921),fo_height__$1], null);
});})(elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,annotation,scale_factor,fo_height),((function (elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (_,p__35965){
var map__35966 = p__35965;
var map__35966__$1 = (((((!((map__35966 == null))))?(((((map__35966.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__35966.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__35966):map__35966);
var scale_factor__$1 = cljs.core.get.call(null,map__35966__$1,new cljs.core.Keyword(null,"scale-factor","scale-factor",-645225638));
var annotation__$1 = cljs.core.get.call(null,map__35966__$1,new cljs.core.Keyword(null,"annotation","annotation",-344661666));
var fo_height__$1 = cljs.core.get.call(null,map__35966__$1,new cljs.core.Keyword(null,"fo-height","fo-height",-358322921));
var map__35968 = annotation__$1;
var map__35968__$1 = (((((!((map__35968 == null))))?(((((map__35968.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__35968.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__35968):map__35968);
var height__$2 = cljs.core.get.call(null,map__35968__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var valign__$1 = cljs.core.get.call(null,map__35968__$1,new cljs.core.Keyword(null,"valign","valign",1485197511));
return setTimeout(((function (map__35968,map__35968__$1,height__$2,valign__$1,map__35966,map__35966__$1,scale_factor__$1,annotation__$1,fo_height__$1,elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (){
return cljs.core.reset_BANG_.call(null,text_y_35971,((cljs.core._EQ_.call(null,valign__$1,new cljs.core.Keyword(null,"bottom","bottom",-1550509018)))?(fo_height__$1 - elem.clientHeight):((cljs.core._EQ_.call(null,valign__$1,new cljs.core.Keyword(null,"middle","middle",-701029031)))?((fo_height__$1 - elem.clientHeight) / (2)):(0)
)));
});})(map__35968,map__35968__$1,height__$2,valign__$1,map__35966,map__35966__$1,scale_factor__$1,annotation__$1,fo_height__$1,elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
,(0));
});})(elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
);

elem.call(null,new cljs.core.Keyword(null,"xmlns","xmlns",-1862095571),"http://www.w3.org/1999/xhtml",new cljs.core.Keyword(null,"contenteditable","contenteditable",-770210530),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (){
return "true";
});})(elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (){
return null;
});})(con__30287__auto__,elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,editing_text_QMARK_);
})(),new cljs.core.Keyword(null,"click","click",1912301393),((function (elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (){
cljs.core.reset_BANG_.call(null,editing_text_QMARK_,true);

return setTimeout(((function (elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (){
return elem.focus();
});})(elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
,(0));
});})(elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
,new cljs.core.Keyword(null,"keyup","keyup",-794526927),((function (elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (e){
if(cljs.core._EQ_.call(null,weathergen.ui.common.ESCAPE_KEY,e.keyCode)){
return javelin.core.dosync_STAR_.call(null,((function (elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (){
cljs.core.reset_BANG_.call(null,text,elem.innerText);

return cljs.core.reset_BANG_.call(null,editing_text_QMARK_,false);
});})(elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
);
} else {
return null;
}
});})(elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
,new cljs.core.Keyword(null,"mousemove","mousemove",-1077794734),((function (elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (e){
cljs.core.reset_BANG_.call(null,suppress_bullseye_info_box_QMARK_,true);

e.preventDefault();

return false;
});})(elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
,new cljs.core.Keyword(null,"blur","blur",-453500461),((function (elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (e){
return javelin.core.dosync_STAR_.call(null,((function (elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (){
cljs.core.reset_BANG_.call(null,text,elem.innerText);

return cljs.core.reset_BANG_.call(null,editing_text_QMARK_,false);
});})(elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
);
});})(elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging){
return (function (font_bold_QMARK___$1,font_family__$1,font_italic_QMARK___$1,font_color__$1,font_size__$1,editing_QMARK___$1,dragging__$1,halign__$1){
return cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"font-style","font-style",-773672352),new cljs.core.Keyword(null,"color","color",1011675173),new cljs.core.Keyword(null,"text-align","text-align",1786091845),new cljs.core.Keyword(null,"white-space","white-space",-707351930),new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),new cljs.core.Keyword(null,"cursor","cursor",1011937484),new cljs.core.Keyword(null,"padding","padding",1660304693),new cljs.core.Keyword(null,"pointer-events","pointer-events",-1053858853),new cljs.core.Keyword(null,"font-family","font-family",-667419874)],[(cljs.core.truth_(font_italic_QMARK___$1)?"italic":null),weathergen.ui.common.to_rgba.call(null,font_color__$1),halign__$1,"pre-wrap",(cljs.core.truth_(font_bold_QMARK___$1)?"bold":null),(cljs.core.truth_(editing_QMARK___$1)?"text":null),weathergen.ui.common.ems.call(null,(0),0.2),(cljs.core.truth_((function (){var and__4120__auto__ = editing_QMARK___$1;
if(cljs.core.truth_(and__4120__auto__)){
return (dragging__$1 == null);
} else {
return and__4120__auto__;
}
})())?"all":"none"),font_family__$1]);
});})(elem,text_y_35971,fo,fo_width,fo_height,editing_text_QMARK_,scale_factor,ew,offset,w,h,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,width__$1,height__$1,edge_color,edge_width,edge_style,edge_dash_length,edge_dash_spacing,editing_QMARK_,font_bold_QMARK_,font_color,font_italic_QMARK_,font_family,font_size,halign,height,text,shape_type,valign,width,map__35941,map__35941__$1,state,suppress_bullseye_info_box_QMARK_,dragging))
).call(null,font_bold_QMARK_,font_family,font_italic_QMARK_,font_color,font_size,editing_QMARK_,dragging,halign),text);

return elem;
})());

return fo;
})());
})());
});
/**
 * Returns SVG for manipulating a shape or PPT via a blue edit frame.
 */
weathergen.ui.layers.annotations.edit_frame_overlay = (function weathergen$ui$layers$annotations$edit_frame_overlay(annotation,p__35972,p__35973,p__35974){
var map__35975 = p__35972;
var map__35975__$1 = (((((!((map__35975 == null))))?(((((map__35975.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__35975.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__35975):map__35975);
var state = map__35975__$1;
var map_zoom = cljs.core.get.call(null,map__35975__$1,new cljs.core.Keyword(null,"map-zoom","map-zoom",1543291337));
var map_viewbox = cljs.core.get.call(null,map__35975__$1,new cljs.core.Keyword(null,"map-viewbox","map-viewbox",860086717));
var dragging = cljs.core.get.call(null,map__35975__$1,new cljs.core.Keyword(null,"dragging","dragging",1185097613));
var map__35976 = p__35973;
var map__35976__$1 = (((((!((map__35976 == null))))?(((((map__35976.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__35976.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__35976):map__35976);
var handlers = map__35976__$1;
var register_drag = cljs.core.get.call(null,map__35976__$1,new cljs.core.Keyword(null,"register-drag","register-drag",1575693720));
var delete_annotation = cljs.core.get.call(null,map__35976__$1,new cljs.core.Keyword(null,"delete-annotation","delete-annotation",563372499));
var map__35977 = p__35974;
var map__35977__$1 = (((((!((map__35977 == null))))?(((((map__35977.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__35977.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__35977):map__35977);
var opts = map__35977__$1;
var width_override = cljs.core.get.call(null,map__35977__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height_override = cljs.core.get.call(null,map__35977__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var buttons = cljs.core.get.call(null,map__35977__$1,new cljs.core.Keyword(null,"buttons","buttons",-1953831197));
var width = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"width","width",-384071477)], null));
var height = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"height","height",1025178622)], null));
var font_size = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346)], null));
var rotation = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"rotation","rotation",-1728051644)], null));
var x = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"x","x",2099068185)], null));
var y = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"y","y",-1757859776)], null));
var editing_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null));
var x__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (x__$1){
var or__4131__auto__ = x__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,x),((function (width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,x,v__15911__auto__);
});})(width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
);
var y__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (x__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (y__$1){
var or__4131__auto__ = y__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(x__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,y),((function (x__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,y,v__15911__auto__);
});})(x__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
);
var rotation__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (x__$1,y__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (rotation__$1){
var or__4131__auto__ = rotation__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(x__$1,y__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,rotation),((function (x__$1,y__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,rotation,v__15911__auto__);
});})(x__$1,y__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
);
var width__$1 = (function (){var or__4131__auto__ = width_override;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return width;
}
})();
var height__$1 = (function (){var or__4131__auto__ = height_override;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return height;
}
})();
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"edit controls",(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (){
var large_edge_width = javelin.core.formula.call(null,((function (width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__35981){
return (0.2 / G__35981);
});})(width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,map_zoom);
var small_edge_width = javelin.core.formula.call(null,((function (large_edge_width,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__35982){
return (G__35982 * 0.65);
});})(large_edge_width,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,large_edge_width);
var outer_width = javelin.core.formula.call(null,((function (large_edge_width,small_edge_width,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__35983,G__35984){
return (G__35983 + ((2) * G__35984));
});})(large_edge_width,small_edge_width,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,width__$1,large_edge_width);
var outer_height = javelin.core.formula.call(null,((function (large_edge_width,small_edge_width,outer_width,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__35985,G__35986){
return (G__35985 + ((2) * G__35986));
});})(large_edge_width,small_edge_width,outer_width,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,height__$1,large_edge_width);
var size = javelin.core.formula.call(null,((function (large_edge_width,small_edge_width,outer_width,outer_height,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__35987){
return (1.7 / G__35987);
});})(large_edge_width,small_edge_width,outer_width,outer_height,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,map_zoom);
var path = javelin.core.formula.call(null,((function (large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (outer_width__$1,large_edge_width__$1,size__$1){
var x__$2 = ((outer_width__$1 / (2)) - large_edge_width__$1);
var y__$2 = (size__$1 * -2.5);
return ["M",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x__$2),",0"," L",cljs.core.str.cljs$core$IFn$_invoke$arity$1(x__$2),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y__$2)].join('');
});})(large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,outer_width,large_edge_width,size);
return hoplon.svg.g.call(null,(cljs.core.truth_(buttons.call(null,new cljs.core.Keyword(null,"rotate","rotate",152705015)))?hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"rotate handle",hoplon.svg.path.call(null,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"lightblue",new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),large_edge_width,new cljs.core.Keyword(null,"d","d",1972142424),path),hoplon.svg.path.call(null,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"blue",new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),small_edge_width,new cljs.core.Keyword(null,"d","d",1972142424),path)):null),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__35988,G__35989){
return (G__35988 - G__35989);
});})(path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,outer_width,large_edge_width),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__35990,G__35991){
return (G__35990 - G__35991);
});})(path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,outer_height,large_edge_width),new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__35992){
return (G__35992 * -0.5);
});})(path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,large_edge_width),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__35993){
return (G__35993 * -0.5);
});})(path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,large_edge_width),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"lightblue",new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),large_edge_width),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__35994,G__35995){
return (G__35994 - G__35995);
});})(path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,outer_width,large_edge_width),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__35996,G__35997){
return (G__35996 - G__35997);
});})(path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,outer_height,large_edge_width),new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__35998){
return (G__35998 * -0.5);
});})(path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,large_edge_width),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__35999){
return (G__35999 * -0.5);
});})(path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,large_edge_width),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"blue",new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),small_edge_width),(function (){var button = ((function (path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (p__36000){
var map__36001 = p__36000;
var map__36001__$1 = (((((!((map__36001 == null))))?(((((map__36001.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36001.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36001):map__36001);
var x__$2 = cljs.core.get.call(null,map__36001__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y__$2 = cljs.core.get.call(null,map__36001__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var name = cljs.core.get.call(null,map__36001__$1,new cljs.core.Keyword(null,"name","name",1843675177));
var src = cljs.core.get.call(null,map__36001__$1,new cljs.core.Keyword(null,"src","src",-1651076051));
var drag = cljs.core.get.call(null,map__36001__$1,new cljs.core.Keyword(null,"drag","drag",449951290));
var click = cljs.core.get.call(null,map__36001__$1,new cljs.core.Keyword(null,"click","click",1912301393));
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),name,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36004,G__36003,G__36005){
return G__36003.call(null,G__36004,G__36005);
});})(map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,x__$2,weathergen.ui.common.svg_translate,y__$2),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (_){
if(cljs.core.truth_(drag)){
return register_drag.call(null,(function (){var drag_fn = drag.call(null);
cljs.core.reset_BANG_.call(null,dragging,name);

return ((function (drag_fn,map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (dpos,final_QMARK_){
drag_fn.call(null,dpos,final_QMARK_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,dragging,null);
} else {
return null;
}
});
;})(drag_fn,map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
})());
} else {
return null;
}
});})(map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
,new cljs.core.Keyword(null,"click","click",1912301393),((function (map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (_){
if(cljs.core.truth_(click)){
return click.call(null);
} else {
return null;
}
});})(map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
,hoplon.svg.rect.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,"width","width",-384071477),size,new cljs.core.Keyword(null,"height","height",1025178622),size,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"fill","fill",883462889),javelin.core.formula.call(null,((function (map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (dragging__$1){
if(cljs.core._EQ_.call(null,dragging__$1,name)){
return "lightblue";
} else {
return "white";
}
});})(map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,dragging),new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),javelin.core.formula.call(null,((function (map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36006){
return (0.1 / G__36006);
});})(map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,map_zoom)),hoplon.svg.image.call(null,new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),src,new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36007){
return (G__36007 * 0.1);
});})(map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,size),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36008){
return (G__36008 * 0.1);
});})(map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,size),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36009){
return (G__36009 * 0.8);
});})(map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,size),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36010){
return (G__36010 * 0.8);
});})(map__36001,map__36001__$1,x__$2,y__$2,name,src,drag,click,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,size)));
});})(path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
;
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),javelin.core.formula.call(null,((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36011,G__36012){
return ["edit buttons. Dragging: ",G__36011.call(null,G__36012)].join('');
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,cljs.core.pr_str,dragging),(cljs.core.truth_(buttons.call(null,new cljs.core.Keyword(null,"move","move",-2110884309)))?button.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"Move",new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36013,G__36014){
return (- (G__36013 + (G__36014 / (2))));
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,size,large_edge_width),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36015,G__36016){
return (- (G__36015 + (G__36016 / (2))));
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,size,large_edge_width),new cljs.core.Keyword(null,"src","src",-1651076051),"images/move.svg",new cljs.core.Keyword(null,"drag","drag",449951290),((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (){
var x0 = new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,annotation));
var y0 = new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,annotation));
return ((function (x0,y0,button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (p__36017,final_QMARK_){
var vec__36018 = p__36017;
var dx = cljs.core.nth.call(null,vec__36018,(0),null);
var dy = cljs.core.nth.call(null,vec__36018,(1),null);
return cljs.core.swap_BANG_.call(null,annotation,cljs.core.assoc,new cljs.core.Keyword(null,"x","x",2099068185),(x0 + dx),new cljs.core.Keyword(null,"y","y",-1757859776),(y0 + dy));
});
;})(x0,y0,button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
], null)):null),(cljs.core.truth_(buttons.call(null,new cljs.core.Keyword(null,"rotate","rotate",152705015)))?button.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"Rotate",new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36021,G__36022){
return ((G__36021 / (2)) + (G__36022 / (-2)));
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,width__$1,size),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36023,G__36024){
return (- ((G__36023 * (3)) + (G__36024 / (2))));
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,size,large_edge_width),new cljs.core.Keyword(null,"src","src",-1651076051),"images/rotate.svg",new cljs.core.Keyword(null,"drag","drag",449951290),((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (){
var theta0 = cljs.core.deref.call(null,rotation__$1);
var pivot = weathergen.math.rotate.call(null,(- theta0),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(cljs.core.deref.call(null,size) * -2.5)], null));
var v = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(- (cljs.core.deref.call(null,width__$1) / (2))),(0)], null);
var x0 = cljs.core.deref.call(null,x__$1);
var y0 = cljs.core.deref.call(null,y__$1);
var p0 = weathergen.math.rotate.call(null,theta0,v);
return ((function (theta0,pivot,v,x0,y0,p0,button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (p__36025,final_QMARK_){
var vec__36026 = p__36025;
var dx = cljs.core.nth.call(null,vec__36026,(0),null);
var dy = cljs.core.nth.call(null,vec__36026,(1),null);
var dp = vec__36026;
var vec__36029 = weathergen.math.vector_add.call(null,dp,pivot);
var x1 = cljs.core.nth.call(null,vec__36029,(0),null);
var y1 = cljs.core.nth.call(null,vec__36029,(1),null);
var theta1 = weathergen.math.heading.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x1,(- y1)], null));
var p1 = weathergen.math.rotate.call(null,theta1,v);
var vec__36032 = weathergen.math.vector_add.call(null,p1,weathergen.math.vector_scale.call(null,(-1),p0));
var dx0 = cljs.core.nth.call(null,vec__36032,(0),null);
var dy0 = cljs.core.nth.call(null,vec__36032,(1),null);
return cljs.core.swap_BANG_.call(null,annotation,cljs.core.assoc,new cljs.core.Keyword(null,"rotation","rotation",-1728051644),cljs.core.mod.call(null,theta1,(360)),new cljs.core.Keyword(null,"x","x",2099068185),(x0 + dx0),new cljs.core.Keyword(null,"y","y",-1757859776),(y0 - dy0));
});
;})(theta0,pivot,v,x0,y0,p0,button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
], null)):null),(cljs.core.truth_(buttons.call(null,new cljs.core.Keyword(null,"resize-text","resize-text",1413184480)))?button.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"Resize Text",new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36035,G__36036){
return (G__36035 + (G__36036 / (-2)));
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,size,large_edge_width),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36037,G__36038){
return (- (G__36037 + (G__36038 / (2))));
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,size,large_edge_width),new cljs.core.Keyword(null,"src","src",-1651076051),"images/text-resize.svg",new cljs.core.Keyword(null,"drag","drag",449951290),((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (){
var extent = (0.5 * new cljs.core.Keyword(null,"width","width",-384071477).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,map_viewbox)));
var size0 = cljs.core.deref.call(null,font_size);
return ((function (extent,size0,button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (p__36039,final_QMARK_){
var vec__36040 = p__36039;
var dx = cljs.core.nth.call(null,vec__36040,(0),null);
var dy = cljs.core.nth.call(null,vec__36040,(1),null);
return cljs.core.reset_BANG_.call(null,font_size,(function (){var x__4222__auto__ = (function (){var x__4219__auto__ = (((dx / extent) * (100)) + size0);
var y__4220__auto__ = (1);
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
})();
var y__4223__auto__ = (100);
return ((x__4222__auto__ < y__4223__auto__) ? x__4222__auto__ : y__4223__auto__);
})());
});
;})(extent,size0,button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
], null)):null),(cljs.core.truth_(buttons.call(null,new cljs.core.Keyword(null,"done","done",-889844188)))?button.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"Done",new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36043,G__36044){
return (- (G__36043 + (G__36044 / (2))));
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,size,large_edge_width),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36045,G__36046){
return (G__36045 + (G__36046 / (2)));
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,height__$1,large_edge_width),new cljs.core.Keyword(null,"src","src",-1651076051),"images/checkmark.png",new cljs.core.Keyword(null,"click","click",1912301393),((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (){
return cljs.core.reset_BANG_.call(null,editing_QMARK_,false);
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
], null)):null),(cljs.core.truth_(buttons.call(null,new cljs.core.Keyword(null,"delete","delete",-1768633620)))?button.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"Delete",new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36047,G__36048){
return (G__36047 + (G__36048 / (-2)));
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,size,large_edge_width),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36049,G__36050){
return (G__36049 + (G__36050 / (2)));
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,height__$1,large_edge_width),new cljs.core.Keyword(null,"src","src",-1651076051),"images/trash.png",new cljs.core.Keyword(null,"click","click",1912301393),delete_annotation], null)):null),(cljs.core.truth_(buttons.call(null,new cljs.core.Keyword(null,"resize","resize",297367086)))?button.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"name","name",1843675177),"Resize",new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36051,G__36052){
return (G__36051 + (G__36052 / (2)));
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,width__$1,large_edge_width),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (G__36053,G__36054){
return (G__36053 + (G__36054 / (2)));
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
).call(null,height__$1,large_edge_width),new cljs.core.Keyword(null,"src","src",-1651076051),"images/resize.svg",new cljs.core.Keyword(null,"drag","drag",449951290),((function (button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (){
var w0 = cljs.core.deref.call(null,width__$1);
var h0 = cljs.core.deref.call(null,height__$1);
var theta0 = cljs.core.deref.call(null,rotation__$1);
return ((function (w0,h0,theta0,button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (dpos,final_QMARK_){
var vec__36055 = weathergen.math.rotate.call(null,theta0,dpos);
var dx_SINGLEQUOTE_ = cljs.core.nth.call(null,vec__36055,(0),null);
var dy_SINGLEQUOTE_ = cljs.core.nth.call(null,vec__36055,(1),null);
var w = (w0 + dx_SINGLEQUOTE_);
var h = (h0 + dy_SINGLEQUOTE_);
return cljs.core.swap_BANG_.call(null,annotation,cljs.core.assoc,new cljs.core.Keyword(null,"width","width",-384071477),(function (){var x__4219__auto__ = (0);
var y__4220__auto__ = w;
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
})(),new cljs.core.Keyword(null,"height","height",1025178622),(function (){var x__4219__auto__ = (0);
var y__4220__auto__ = h;
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
})());
});
;})(w0,h0,theta0,button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
});})(button,path,large_edge_width,small_edge_width,outer_width,outer_height,size,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
], null)):null));
})());
});})(width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (){
return null;
});})(con__30287__auto__,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,width__$1,height__$1,x__$1,y__$1,rotation__$1,width,height,font_size,rotation,x,y,editing_QMARK_,map__35975,map__35975__$1,state,map_zoom,map_viewbox,dragging,map__35976,map__35976__$1,handlers,register_drag,delete_annotation,map__35977,map__35977__$1,opts,width_override,height_override,buttons))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,editing_QMARK_);
})());
});
/**
 * Returns SVG for a rectangle or oval annotation.
 */
weathergen.ui.layers.annotations.shape_overlay = (function weathergen$ui$layers$annotations$shape_overlay(annotation,p__36058,p__36059){
var map__36060 = p__36058;
var map__36060__$1 = (((((!((map__36060 == null))))?(((((map__36060.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36060.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36060):map__36060);
var state = map__36060__$1;
var annotations = cljs.core.get.call(null,map__36060__$1,new cljs.core.Keyword(null,"annotations","annotations",1640956248));
var map_viewbox = cljs.core.get.call(null,map__36060__$1,new cljs.core.Keyword(null,"map-viewbox","map-viewbox",860086717));
var map_zoom = cljs.core.get.call(null,map__36060__$1,new cljs.core.Keyword(null,"map-zoom","map-zoom",1543291337));
var map__36061 = p__36059;
var map__36061__$1 = (((((!((map__36061 == null))))?(((((map__36061.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36061.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36061):map__36061);
var handlers = map__36061__$1;
var register_drag = cljs.core.get.call(null,map__36061__$1,new cljs.core.Keyword(null,"register-drag","register-drag",1575693720));
var delete_annotation = cljs.core.get.call(null,map__36061__$1,new cljs.core.Keyword(null,"delete-annotation","delete-annotation",563372499));
var shape_type = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"shape-type","shape-type",-835891005)], null));
var font_size = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346)], null));
var font_family = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-family","font-family",-667419874)], null));
var font_color = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-color","font-color",-2019660285)], null));
var text = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"text","text",-1790561697)], null));
var x = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"x","x",2099068185)], null));
var y = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"y","y",-1757859776)], null));
var width = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"width","width",-384071477)], null));
var height = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"height","height",1025178622)], null));
var rotation = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"rotation","rotation",-1728051644)], null));
var editing_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null));
var x__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (x__$1){
var or__4131__auto__ = x__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
).call(null,x),((function (shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,x,v__15911__auto__);
});})(shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
);
var y__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (x__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (y__$1){
var or__4131__auto__ = y__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(x__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
).call(null,y),((function (x__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,y,v__15911__auto__);
});})(x__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
);
var width__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (x__$1,y__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (width__$1){
var or__4131__auto__ = width__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(x__$1,y__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
).call(null,width),((function (x__$1,y__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,width,v__15911__auto__);
});})(x__$1,y__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
);
var height__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (x__$1,y__$1,width__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (height__$1){
var or__4131__auto__ = height__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(x__$1,y__$1,width__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
).call(null,height),((function (x__$1,y__$1,width__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,height,v__15911__auto__);
});})(x__$1,y__$1,width__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
);
var rotation__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (x__$1,y__$1,width__$1,height__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (rotation__$1){
var or__4131__auto__ = rotation__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(x__$1,y__$1,width__$1,height__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
).call(null,rotation),((function (x__$1,y__$1,width__$1,height__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,rotation,v__15911__auto__);
});})(x__$1,y__$1,width__$1,height__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
);
var font_size__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (x__$1,y__$1,width__$1,height__$1,rotation__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (font_size__$1){
var or__4131__auto__ = font_size__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(x__$1,y__$1,width__$1,height__$1,rotation__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
).call(null,font_size),((function (x__$1,y__$1,width__$1,height__$1,rotation__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,font_size,v__15911__auto__);
});})(x__$1,y__$1,width__$1,height__$1,rotation__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (x__$1,y__$1,width__$1,height__$1,rotation__$1,font_size__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (G__36065,G__36064,G__36066){
return G__36064.call(null,G__36065,G__36066);
});})(x__$1,y__$1,width__$1,height__$1,rotation__$1,font_size__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
).call(null,x__$1,weathergen.ui.common.svg_translate,y__$1),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (x__$1,y__$1,width__$1,height__$1,rotation__$1,font_size__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (G__36067,G__36068){
return G__36067.call(null,G__36068);
});})(x__$1,y__$1,width__$1,height__$1,rotation__$1,font_size__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
).call(null,weathergen.ui.common.svg_rotate,rotation__$1),(function (){var dragging = javelin.core.cell.call(null,null);
var state_STAR_ = cljs.core.assoc.call(null,state,new cljs.core.Keyword(null,"dragging","dragging",1185097613),dragging);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"shape annotation",weathergen.ui.layers.annotations.shape_contents_overlay.call(null,annotation,state_STAR_),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (dragging,state_STAR_,x__$1,y__$1,width__$1,height__$1,rotation__$1,font_size__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (){
return weathergen.ui.layers.annotations.edit_frame_overlay.call(null,annotation,state_STAR_,handlers,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"buttons","buttons",-1953831197),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"resize-text","resize-text",1413184480),null,new cljs.core.Keyword(null,"done","done",-889844188),null,new cljs.core.Keyword(null,"move","move",-2110884309),null,new cljs.core.Keyword(null,"delete","delete",-1768633620),null,new cljs.core.Keyword(null,"resize","resize",297367086),null,new cljs.core.Keyword(null,"rotate","rotate",152705015),null], null), null)], null));
});})(dragging,state_STAR_,x__$1,y__$1,width__$1,height__$1,rotation__$1,font_size__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,dragging,state_STAR_,x__$1,y__$1,width__$1,height__$1,rotation__$1,font_size__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (){
return null;
});})(con__30287__auto__,dragging,state_STAR_,x__$1,y__$1,width__$1,height__$1,rotation__$1,font_size__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,dragging,state_STAR_,x__$1,y__$1,width__$1,height__$1,rotation__$1,font_size__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,dragging,state_STAR_,x__$1,y__$1,width__$1,height__$1,rotation__$1,font_size__$1,shape_type,font_size,font_family,font_color,text,x,y,width,height,rotation,editing_QMARK_,map__36060,map__36060__$1,state,annotations,map_viewbox,map_zoom,map__36061,map__36061__$1,handlers,register_drag,delete_annotation))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,editing_QMARK_);
})());
})()));
});
/**
 * Returns a drag handler that will move all the points.
 */
weathergen.ui.layers.annotations.move_all = (function weathergen$ui$layers$annotations$move_all(points){
var points0 = cljs.core.deref.call(null,points);
return ((function (points0){
return (function (p__36070,_){
var vec__36071 = p__36070;
var dx = cljs.core.nth.call(null,vec__36071,(0),null);
var dy = cljs.core.nth.call(null,vec__36071,(1),null);
var dp = vec__36071;
return cljs.core.swap_BANG_.call(null,points,((function (vec__36071,dx,dy,dp,points0){
return (function (p1__36069_SHARP_){
return cljs.core.into.call(null,cljs.core.sorted_map.call(null),cljs.core.map.call(null,((function (vec__36071,dx,dy,dp,points0){
return (function (p__36074){
var vec__36075 = p__36074;
var k = cljs.core.nth.call(null,vec__36075,(0),null);
var ___$1 = cljs.core.nth.call(null,vec__36075,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [k,weathergen.math.vector_add.call(null,cljs.core.get.call(null,points0,k),dp)], null);
});})(vec__36071,dx,dy,dp,points0))
,p1__36069_SHARP_));
});})(vec__36071,dx,dy,dp,points0))
);
});
;})(points0))
});
/**
 * Returns SVG for an arrow or lines annotation.
 */
weathergen.ui.layers.annotations.linear_edit_buttons = (function weathergen$ui$layers$annotations$linear_edit_buttons(annotation,p__36078,p__36079){
var map__36080 = p__36078;
var map__36080__$1 = (((((!((map__36080 == null))))?(((((map__36080.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36080.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36080):map__36080);
var state = map__36080__$1;
var annotations = cljs.core.get.call(null,map__36080__$1,new cljs.core.Keyword(null,"annotations","annotations",1640956248));
var map_viewbox = cljs.core.get.call(null,map__36080__$1,new cljs.core.Keyword(null,"map-viewbox","map-viewbox",860086717));
var map_zoom = cljs.core.get.call(null,map__36080__$1,new cljs.core.Keyword(null,"map-zoom","map-zoom",1543291337));
var dragging = cljs.core.get.call(null,map__36080__$1,new cljs.core.Keyword(null,"dragging","dragging",1185097613));
var rotation = cljs.core.get.call(null,map__36080__$1,new cljs.core.Keyword(null,"rotation","rotation",-1728051644));
var add_points_QMARK_ = cljs.core.get.call(null,map__36080__$1,new cljs.core.Keyword(null,"add-points?","add-points?",-228600117));
var map__36081 = p__36079;
var map__36081__$1 = (((((!((map__36081 == null))))?(((((map__36081.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36081.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36081):map__36081);
var handlers = map__36081__$1;
var register_drag = cljs.core.get.call(null,map__36081__$1,new cljs.core.Keyword(null,"register-drag","register-drag",1575693720));
var delete_annotation = cljs.core.get.call(null,map__36081__$1,new cljs.core.Keyword(null,"delete-annotation","delete-annotation",563372499));
var points = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"points","points",-1486596883)], null));
var editing_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null));
var open_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"open?","open?",1238443125)], null));
var ks = javelin.core.formula.call(null,((function (points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36084,G__36086,G__36085){
return G__36084.call(null,G__36085.call(null,G__36086));
});})(points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,cljs.core.sort,points,cljs.core.keys);
var k0 = javelin.core.formula.call(null,((function (ks,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36087,G__36088){
return G__36087.call(null,G__36088);
});})(ks,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,cljs.core.first,ks);
var k1 = javelin.core.formula.call(null,((function (ks,k0,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36089,G__36090){
return G__36089.call(null,G__36090);
});})(ks,k0,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,cljs.core.second,ks);
var kn_1 = javelin.core.formula.call(null,((function (ks,k0,k1,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36092,G__36091,G__36093){
return G__36091.call(null,G__36092.call(null,G__36093));
});})(ks,k0,k1,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,cljs.core.butlast,cljs.core.last,ks);
var kn = javelin.core.formula.call(null,((function (ks,k0,k1,kn_1,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36094,G__36095){
return G__36094.call(null,G__36095);
});})(ks,k0,k1,kn_1,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,cljs.core.last,ks);
var p0 = weathergen.ui.common.map_lens.call(null,points,k0);
var x0 = weathergen.ui.common.map_lens.call(null,p0,(0));
var y0 = weathergen.ui.common.map_lens.call(null,p0,(1));
var p1 = weathergen.ui.common.map_lens.call(null,points,k1);
var pn_1 = weathergen.ui.common.map_lens.call(null,points,kn_1);
var pn = weathergen.ui.common.map_lens.call(null,points,kn);
var n = javelin.core.formula.call(null,((function (ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36097,G__36096){
return G__36096.call(null,G__36097);
});})(ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,points,cljs.core.count);
var rotations = javelin.core.formula.call(null,((function (ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (points__$1,ks__$1,k0__$1,kn__$1,p0__$1,p1__$1,pn_1__$1,pn__$1,n__$1,open_QMARK___$1){
var nexts = cljs.core.drop.call(null,(1),cljs.core.cycle.call(null,ks__$1));
var prevs = cljs.core.drop.call(null,(n__$1 - (1)),cljs.core.cycle.call(null,ks__$1));
var closed_QMARK_ = ((cljs.core.not.call(null,open_QMARK___$1)) && (((2) < n__$1)));
var bisect = ((function (nexts,prevs,closed_QMARK_,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (from,to1,to2){
var v1 = weathergen.math.normalize.call(null,weathergen.math.vector_subtract.call(null,to1,from));
var v2 = weathergen.math.normalize.call(null,weathergen.math.vector_subtract.call(null,to2,from));
return weathergen.ui.layers.annotations.annotation_rotation.call(null,weathergen.ui.layers.annotations.midpoint.call(null,v1,v2));
});})(nexts,prevs,closed_QMARK_,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
;
var angles = cljs.core.zipmap.call(null,ks__$1,cljs.core.map.call(null,bisect,cljs.core.map.call(null,points__$1,ks__$1),cljs.core.map.call(null,points__$1,nexts),cljs.core.map.call(null,points__$1,prevs)));
if(cljs.core.truth_(open_QMARK___$1)){
return cljs.core.assoc.call(null,angles,k0__$1,bisect.call(null,p0__$1,p1__$1,p1__$1),kn__$1,bisect.call(null,pn__$1,pn_1__$1,pn_1__$1));
} else {
return angles;
}
});})(ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,points,ks,k0,kn,p0,p1,pn_1,pn,n,open_QMARK_);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"edit controls",(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (){
var size = javelin.core.formula.call(null,((function (ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36098){
return (1.0 / G__36098);
});})(ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,map_zoom);
var half_size = javelin.core.formula.call(null,((function (size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36099){
return (G__36099 / (2));
});})(size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,size);
return hoplon.svg.g.call(null,(function (){var button = ((function (size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (p__36100){
var map__36101 = p__36100;
var map__36101__$1 = (((((!((map__36101 == null))))?(((((map__36101.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36101.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36101):map__36101);
var x = cljs.core.get.call(null,map__36101__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var drag = cljs.core.get.call(null,map__36101__$1,new cljs.core.Keyword(null,"drag","drag",449951290));
var y = cljs.core.get.call(null,map__36101__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var rotation__$1 = cljs.core.get.call(null,map__36101__$1,new cljs.core.Keyword(null,"rotation","rotation",-1728051644));
var scale = cljs.core.get.call(null,map__36101__$1,new cljs.core.Keyword(null,"scale","scale",-230427353));
var name = cljs.core.get.call(null,map__36101__$1,new cljs.core.Keyword(null,"name","name",1843675177));
var cursor = cljs.core.get.call(null,map__36101__$1,new cljs.core.Keyword(null,"cursor","cursor",1011937484));
var src = cljs.core.get.call(null,map__36101__$1,new cljs.core.Keyword(null,"src","src",-1651076051));
var click = cljs.core.get.call(null,map__36101__$1,new cljs.core.Keyword(null,"click","click",1912301393));
var label = cljs.core.get.call(null,map__36101__$1,new cljs.core.Keyword(null,"label","label",1718410804));
var size__$1 = javelin.core.formula.call(null,((function (map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36104,G__36103){
return (G__36103 * (function (){var or__4131__auto__ = G__36104;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (1);
}
})());
});})(map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,scale,size);
var half_size__$1 = javelin.core.formula.call(null,((function (size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36105){
return (G__36105 / (2));
});})(size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,size__$1);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),name,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36108,G__36107,G__36110,G__36109,G__36111,G__36106){
return G__36106.call(null,G__36107.call(null,G__36108,G__36109),G__36110.call(null,(function (){var or__4131__auto__ = G__36111;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
})()));
});})(size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,x,weathergen.ui.common.svg_translate,weathergen.ui.common.svg_rotate,y,rotation__$1,weathergen.ui.common.svg_xform_combine),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (_){
if(cljs.core.truth_(drag)){
return register_drag.call(null,(function (){var drag_fn = drag.call(null);
cljs.core.reset_BANG_.call(null,dragging,name);

return ((function (drag_fn,size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (dpos,final_QMARK_){
drag_fn.call(null,dpos,final_QMARK_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,dragging,null);
} else {
return null;
}
});
;})(drag_fn,size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
})());
} else {
return null;
}
});})(size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
,new cljs.core.Keyword(null,"click","click",1912301393),((function (size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (_){
if(cljs.core.truth_(click)){
return click.call(null);
} else {
return null;
}
});})(size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),cursor], null),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36112){
return (- G__36112);
});})(size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,half_size__$1),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36113){
return (- G__36113);
});})(size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,half_size__$1),new cljs.core.Keyword(null,"width","width",-384071477),size__$1,new cljs.core.Keyword(null,"height","height",1025178622),size__$1,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"fill","fill",883462889),javelin.core.formula.call(null,((function (size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (dragging__$1){
if(cljs.core._EQ_.call(null,dragging__$1,name)){
return "lightblue";
} else {
return "white";
}
});})(size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,dragging),new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),javelin.core.formula.call(null,((function (size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36114){
return (0.1 / G__36114);
});})(size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,map_zoom)),(cljs.core.truth_(label)?hoplon.svg.text.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (size__$2){
return weathergen.ui.common.svg_scale.call(null,(size__$2 / (17)));
});})(size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,size__$1),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"pointer-events","pointer-events",-1053858853),"none"], null),new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),1.5,new cljs.core.Keyword(null,"font-family","font-family",-667419874),"Helvetica",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"Black",new cljs.core.Keyword(null,"alignment-baseline","alignment-baseline",-311060879),"middle",new cljs.core.Keyword(null,"text-anchor","text-anchor",585613696),"middle",new cljs.core.Keyword(null,"text","text",-1790561697),label):null),(cljs.core.truth_(src)?hoplon.svg.image.call(null,new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),src,new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36115){
return (G__36115 * -0.4);
});})(size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,size__$1),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36116){
return (G__36116 * -0.4);
});})(size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,size__$1),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36117){
return (G__36117 * 0.8);
});})(size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,size__$1),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36118){
return (G__36118 * 0.8);
});})(size__$1,half_size__$1,map__36101,map__36101__$1,x,drag,y,rotation__$1,scale,name,cursor,src,click,label,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,size__$1)):null));
});})(size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
;
var spacing_lg = javelin.core.formula.call(null,((function (button,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36119){
return ((3) * G__36119);
});})(button,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,size);
var spacing_sm = javelin.core.formula.call(null,((function (button,spacing_lg,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36120){
return (G__36120 * 0.75);
});})(button,spacing_lg,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,spacing_lg);
var bar_width = javelin.core.formula.call(null,((function (button,spacing_lg,spacing_sm,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36121){
return (G__36121 * 0.1);
});})(button,spacing_lg,spacing_sm,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,size);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),javelin.core.formula.call(null,((function (button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36122,G__36123){
return ["edit buttons. Dragging: ",G__36122.call(null,G__36123)].join('');
});})(button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,cljs.core.pr_str,dragging),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Big button bars",new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (x0__$1,y0__$1,k0__$1,rotations__$1){
return weathergen.ui.common.svg_xform_combine.call(null,weathergen.ui.common.svg_translate.call(null,x0__$1,y0__$1),weathergen.ui.common.svg_rotate.call(null,cljs.core.get.call(null,rotations__$1,k0__$1,(0))));
});})(button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,x0,y0,k0,rotations),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36124){
return (- G__36124);
});})(button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,spacing_lg),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"width","width",-384071477),spacing_lg,new cljs.core.Keyword(null,"height","height",1025178622),bar_width,new cljs.core.Keyword(null,"fill","fill",883462889),"blue",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"lightblue",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),javelin.core.formula.call(null,((function (button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36125){
return (G__36125 / (2));
});})(button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,bar_width)),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36126){
return (- G__36126);
});})(button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,spacing_lg),new cljs.core.Keyword(null,"width","width",-384071477),bar_width,new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36127){
return ((2) * G__36127);
});})(button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,spacing_lg),new cljs.core.Keyword(null,"fill","fill",883462889),"blue",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"lightblue",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),javelin.core.formula.call(null,((function (button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36128){
return (G__36128 / (2));
});})(button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,bar_width))),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (){
var rotation__$1 = javelin.core.formula.call(null,((function (button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36129,G__36131,G__36130){
return G__36129.call(null,G__36130,G__36131,(0));
});})(button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,cljs.core.get,kn,rotations);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Add new point (last) bar",new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (rotation__$1,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (rotation__$2,pn__$1){
var vec__36132 = pn__$1;
var xn = cljs.core.nth.call(null,vec__36132,(0),null);
var yn = cljs.core.nth.call(null,vec__36132,(1),null);
return weathergen.ui.common.svg_xform_combine.call(null,weathergen.ui.common.svg_translate.call(null,xn,yn),weathergen.ui.common.svg_rotate.call(null,((180) + rotation__$2)));
});})(rotation__$1,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,rotation__$1,pn),hoplon.svg.rect.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,"width","width",-384071477),spacing_sm,new cljs.core.Keyword(null,"height","height",1025178622),bar_width,new cljs.core.Keyword(null,"fill","fill",883462889),"blue",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"lightblue",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),javelin.core.formula.call(null,((function (rotation__$1,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36135){
return (G__36135 / (2));
});})(rotation__$1,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,bar_width)));
});})(button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (){
return null;
});})(con__30287__auto__,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,open_QMARK_);
})(),(function (){var point_names = weathergen.ui.layers.annotations.point_names.call(null,points);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Point buttons",weathergen.ui.common.keyed_loop_tpl_STAR_.call(null,points,cljs.core.key,((function (point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (item__15894__auto__){
var vec__36142 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (p__36145){
var vec__36146 = p__36145;
var k = cljs.core.nth.call(null,vec__36146,(0),null);
var _ = cljs.core.nth.call(null,vec__36146,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [_,k], null);
});})(point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,item__15894__auto__));
var _ = cljs.core.nth.call(null,vec__36142,(0),null);
var k = cljs.core.nth.call(null,vec__36142,(1),null);
var point = weathergen.ui.common.map_lens.call(null,points,k);
var rotation__$1 = weathergen.ui.common.map_lens.call(null,rotations,k);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),javelin.core.formula.call(null,((function (rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36149,G__36150){
return G__36149.call(null,G__36150);
});})(rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,point_names,k),new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (point__$1,rotation__$2){
return weathergen.ui.common.svg_xform_combine.call(null,weathergen.ui.common.svg_translate.call(null,cljs.core.get.call(null,point__$1,(0)),cljs.core.get.call(null,point__$1,(1))),weathergen.ui.common.svg_rotate.call(null,(function (){var or__4131__auto__ = rotation__$2;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
})()));
});})(rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,point,rotation__$1),(cljs.core.truth_(add_points_QMARK_)?hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),javelin.core.formula.call(null,((function (rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36151){
return ["Delete point ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__36151)].join('');
});})(rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,k),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Delete point bar",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),spacing_sm,new cljs.core.Keyword(null,"height","height",1025178622),bar_width,new cljs.core.Keyword(null,"fill","fill",883462889),"blue",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"lightblue",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),javelin.core.formula.call(null,((function (rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36152){
return (G__36152 / (2));
});})(rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,bar_width)),button.call(null,new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"name","name",1843675177),javelin.core.formula.call(null,((function (rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36153,G__36154){
return ["-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__36153.call(null,G__36154))].join('');
});})(rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,point_names,k),new cljs.core.Keyword(null,"label","label",1718410804),"-",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer",new cljs.core.Keyword(null,"scale","scale",-230427353),0.8,new cljs.core.Keyword(null,"rotation","rotation",-1728051644),javelin.core.formula.call(null,((function (rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36155){
return (- G__36155);
});})(rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,rotation__$1),new cljs.core.Keyword(null,"x","x",2099068185),spacing_sm,new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"click","click",1912301393),((function (rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (___$1){
return cljs.core.swap_BANG_.call(null,points,cljs.core.dissoc,cljs.core.deref.call(null,k));
});})(rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
], null))):null),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"point button",button.call(null,new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"name","name",1843675177),javelin.core.formula.call(null,((function (rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36156,G__36157){
return G__36156.call(null,G__36157);
});})(rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,point_names,k),new cljs.core.Keyword(null,"label","label",1718410804),javelin.core.formula.call(null,((function (rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36158,G__36159){
return G__36158.call(null,G__36159);
});})(rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,point_names,k),new cljs.core.Keyword(null,"cursor","cursor",1011937484),"move",new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"rotation","rotation",-1728051644),javelin.core.formula.call(null,((function (rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36160){
return (- G__36160);
});})(rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,rotation__$1),new cljs.core.Keyword(null,"drag","drag",449951290),((function (rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (){
var p0__$1 = cljs.core.get_in.call(null,cljs.core.deref.call(null,annotation),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"points","points",-1486596883),cljs.core.deref.call(null,k)], null));
return ((function (p0__$1,rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (p__36161,final_QMARK_){
var vec__36162 = p__36161;
var dx = cljs.core.nth.call(null,vec__36162,(0),null);
var dy = cljs.core.nth.call(null,vec__36162,(1),null);
var dp = vec__36162;
return cljs.core.swap_BANG_.call(null,points,cljs.core.assoc,cljs.core.deref.call(null,k),weathergen.math.vector_add.call(null,p0__$1,dp));
});
;})(p0__$1,rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
});})(rotation__$1,point,vec__36142,_,k,point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
], null))));
});})(point_names,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
));
})(),(cljs.core.truth_(add_points_QMARK_)?(function (){var intermediaries = javelin.core.formula.call(null,((function (button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (points__$1,open_QMARK___$1){
var vec__36165 = cljs.core.first.call(null,points__$1);
var _ = cljs.core.nth.call(null,vec__36165,(0),null);
var pfirst = cljs.core.nth.call(null,vec__36165,(1),null);
var vec__36168 = cljs.core.last.call(null,points__$1);
var ___$1 = cljs.core.nth.call(null,vec__36168,(0),null);
var plast = cljs.core.nth.call(null,vec__36168,(1),null);
var mids = cljs.core.mapv.call(null,((function (vec__36165,_,pfirst,vec__36168,___$1,plast,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (p__36171,p__36172){
var vec__36173 = p__36171;
var kprev = cljs.core.nth.call(null,vec__36173,(0),null);
var pprev = cljs.core.nth.call(null,vec__36173,(1),null);
var vec__36176 = p__36172;
var knext = cljs.core.nth.call(null,vec__36176,(0),null);
var pnext = cljs.core.nth.call(null,vec__36176,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [((kprev + knext) / (2)),weathergen.ui.layers.annotations.midpoint.call(null,pprev,pnext)], null);
});})(vec__36165,_,pfirst,vec__36168,___$1,plast,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
,points__$1,cljs.core.drop.call(null,(1),points__$1));
return cljs.core.into.call(null,cljs.core.sorted_map.call(null),((((cljs.core.not.call(null,open_QMARK___$1)) && (((2) < cljs.core.count.call(null,points__$1)))))?cljs.core.conj.call(null,mids,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,weathergen.ui.layers.annotations.midpoint.call(null,pfirst,plast)], null)):mids));
});})(button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,points,open_QMARK_);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Add point buttons",hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Nonlast",weathergen.ui.common.keyed_loop_tpl_STAR_.call(null,intermediaries,cljs.core.key,((function (intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (item__15894__auto__){
var vec__36185 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (p__36188){
var vec__36189 = p__36188;
var k = cljs.core.nth.call(null,vec__36189,(0),null);
var _ = cljs.core.nth.call(null,vec__36189,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [_,k], null);
});})(intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,item__15894__auto__));
var _ = cljs.core.nth.call(null,vec__36185,(0),null);
var k = cljs.core.nth.call(null,vec__36185,(1),null);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (vec__36185,_,k,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (intermediaries__$1,k__$1){
return weathergen.ui.common.svg_translate.call(null,cljs.core.get_in.call(null,intermediaries__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [k__$1,(0)], null)),cljs.core.get_in.call(null,intermediaries__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [k__$1,(1)], null)));
});})(vec__36185,_,k,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,intermediaries,k),button.call(null,new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"name","name",1843675177),javelin.core.formula.call(null,((function (vec__36185,_,k,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36192){
return ["intermediary",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__36192)].join('');
});})(vec__36185,_,k,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,k),new cljs.core.Keyword(null,"label","label",1718410804),"+",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"move",new cljs.core.Keyword(null,"scale","scale",-230427353),0.8,new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"drag","drag",449951290),((function (vec__36185,_,k,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (){
var k0__$1 = (function (){var or__4131__auto__ = cljs.core.deref.call(null,k);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return weathergen.ui.layers.annotations.unique_id.call(null);
}
})();
var p0__$1 = cljs.core.get.call(null,cljs.core.deref.call(null,intermediaries),cljs.core.deref.call(null,k));
return ((function (k0__$1,p0__$1,vec__36185,_,k,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (p__36193,final_QMARK_){
var vec__36194 = p__36193;
var dx = cljs.core.nth.call(null,vec__36194,(0),null);
var dy = cljs.core.nth.call(null,vec__36194,(1),null);
var dp = vec__36194;
return cljs.core.swap_BANG_.call(null,annotation,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"points","points",-1486596883),k0__$1], null),weathergen.math.vector_add.call(null,p0__$1,dp));
});
;})(k0__$1,p0__$1,vec__36185,_,k,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
});})(vec__36185,_,k,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
], null)));
});})(intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
)),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Last",(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (){
var rotation__$1 = javelin.core.formula.call(null,((function (intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36197,G__36199,G__36198){
return G__36197.call(null,G__36198,G__36199,(0));
});})(intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,cljs.core.get,kn,rotations);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Add new point (last)",new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (rotation__$1,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (rotation__$2,pn__$1){
var vec__36200 = pn__$1;
var xn = cljs.core.nth.call(null,vec__36200,(0),null);
var yn = cljs.core.nth.call(null,vec__36200,(1),null);
return weathergen.ui.common.svg_xform_combine.call(null,weathergen.ui.common.svg_translate.call(null,xn,yn),weathergen.ui.common.svg_rotate.call(null,((180) + rotation__$2)));
});})(rotation__$1,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,rotation__$1,pn),button.call(null,new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"name","name",1843675177),javelin.core.formula.call(null,((function (rotation__$1,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36203){
return ["add",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__36203)].join('');
});})(rotation__$1,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,kn),new cljs.core.Keyword(null,"label","label",1718410804),"+",new cljs.core.Keyword(null,"rotation","rotation",-1728051644),javelin.core.formula.call(null,((function (rotation__$1,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36204){
return (- G__36204);
});})(rotation__$1,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,rotation__$1),new cljs.core.Keyword(null,"cursor","cursor",1011937484),"move",new cljs.core.Keyword(null,"scale","scale",-230427353),0.8,new cljs.core.Keyword(null,"x","x",2099068185),spacing_sm,new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"drag","drag",449951290),((function (rotation__$1,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (){
var k0__$1 = weathergen.ui.layers.annotations.unique_id.call(null);
var p0__$1 = weathergen.math.vector_add.call(null,weathergen.math.rotate.call(null,((180) - cljs.core.deref.call(null,rotation__$1)),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.deref.call(null,spacing_sm),(0)], null)),cljs.core.deref.call(null,pn));
return ((function (k0__$1,p0__$1,rotation__$1,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (p__36205,final_QMARK_){
var vec__36206 = p__36205;
var dx = cljs.core.nth.call(null,vec__36206,(0),null);
var dy = cljs.core.nth.call(null,vec__36206,(1),null);
var dp = vec__36206;
return cljs.core.swap_BANG_.call(null,annotation,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"points","points",-1486596883),k0__$1], null),weathergen.math.vector_add.call(null,p0__$1,dp));
});
;})(k0__$1,p0__$1,rotation__$1,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
});})(rotation__$1,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
], null)));
});})(intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (){
return null;
});})(con__30287__auto__,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,intermediaries,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,open_QMARK_);
})()));
})():null),(function (){var r0 = javelin.core.formula.call(null,((function (button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36209,G__36211,G__36210){
return G__36209.call(null,G__36210,G__36211,(0));
});})(button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,cljs.core.get,k0,rotations);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Big edit buttons",new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (x0__$1,y0__$1,r0__$1){
return weathergen.ui.common.svg_xform_combine.call(null,weathergen.ui.common.svg_translate.call(null,x0__$1,y0__$1),weathergen.ui.common.svg_rotate.call(null,r0__$1));
});})(r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,x0,y0,r0),button.call(null,new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"name","name",1843675177),"Move",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"move",new cljs.core.Keyword(null,"scale","scale",-230427353),(2),new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36212){
return (- G__36212);
});})(r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,spacing_lg),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"rotation","rotation",-1728051644),javelin.core.formula.call(null,((function (r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36213){
return (- G__36213);
});})(r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,r0),new cljs.core.Keyword(null,"src","src",-1651076051),"images/move.svg",new cljs.core.Keyword(null,"drag","drag",449951290),((function (r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (){
return weathergen.ui.layers.annotations.move_all.call(null,points);
});})(r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
], null)),button.call(null,new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"name","name",1843675177),"Done",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer",new cljs.core.Keyword(null,"scale","scale",-230427353),(2),new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),spacing_lg,new cljs.core.Keyword(null,"rotation","rotation",-1728051644),javelin.core.formula.call(null,((function (r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36214){
return (- G__36214);
});})(r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,r0),new cljs.core.Keyword(null,"src","src",-1651076051),"images/checkmark.png",new cljs.core.Keyword(null,"click","click",1912301393),((function (r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (){
return cljs.core.reset_BANG_.call(null,editing_QMARK_,false);
});})(r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
], null)),button.call(null,new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"name","name",1843675177),"Delete",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer",new cljs.core.Keyword(null,"scale","scale",-230427353),(2),new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36215){
return (- G__36215);
});})(r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,spacing_lg),new cljs.core.Keyword(null,"rotation","rotation",-1728051644),javelin.core.formula.call(null,((function (r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36216){
return (- G__36216);
});})(r0,button,spacing_lg,spacing_sm,bar_width,size,half_size,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,r0),new cljs.core.Keyword(null,"src","src",-1651076051),"images/trash.png",new cljs.core.Keyword(null,"click","click",1912301393),delete_annotation], null)));
})());
})());
});})(ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (){
return null;
});})(con__30287__auto__,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation){
return (function (G__36217,G__36219,G__36218){
var and__4120__auto__ = G__36217;
if(cljs.core.truth_(and__4120__auto__)){
return (G__36218.call(null,G__36219) > (0));
} else {
return and__4120__auto__;
}
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,ks,k0,k1,kn_1,kn,p0,x0,y0,p1,pn_1,pn,n,rotations,points,editing_QMARK_,open_QMARK_,map__36080,map__36080__$1,state,annotations,map_viewbox,map_zoom,dragging,rotation,add_points_QMARK_,map__36081,map__36081__$1,handlers,register_drag,delete_annotation))
).call(null,editing_QMARK_,points,cljs.core.count));
})());
});
/**
 * Returns SVG for an arrow annotation.
 */
weathergen.ui.layers.annotations.arrow_overlay = (function weathergen$ui$layers$annotations$arrow_overlay(annotation,p__36222,p__36223){
var map__36224 = p__36222;
var map__36224__$1 = (((((!((map__36224 == null))))?(((((map__36224.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36224.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36224):map__36224);
var state = map__36224__$1;
var annotations = cljs.core.get.call(null,map__36224__$1,new cljs.core.Keyword(null,"annotations","annotations",1640956248));
var map_viewbox = cljs.core.get.call(null,map__36224__$1,new cljs.core.Keyword(null,"map-viewbox","map-viewbox",860086717));
var map_zoom = cljs.core.get.call(null,map__36224__$1,new cljs.core.Keyword(null,"map-zoom","map-zoom",1543291337));
var map__36225 = p__36223;
var map__36225__$1 = (((((!((map__36225 == null))))?(((((map__36225.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36225.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36225):map__36225);
var handlers = map__36225__$1;
var register_drag = cljs.core.get.call(null,map__36225__$1,new cljs.core.Keyword(null,"register-drag","register-drag",1575693720));
var delete_annotation = cljs.core.get.call(null,map__36225__$1,new cljs.core.Keyword(null,"delete-annotation","delete-annotation",563372499));
var points = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"points","points",-1486596883)], null));
var arrowhead_width = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"arrowhead-width","arrowhead-width",839938517)], null));
var arrowhead_length = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"arrowhead-length","arrowhead-length",437777364)], null));
var shaft = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"shaft","shaft",-278047141)], null));
var heft = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"heft","heft",-1112917)], null));
var editing_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null));
var arrowhead_width__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (arrowhead_width__$1){
var or__4131__auto__ = arrowhead_width__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
).call(null,arrowhead_width),((function (points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,arrowhead_width,v__15911__auto__);
});})(points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
);
var arrowhead_length__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (arrowhead_width__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (arrowhead_length__$1){
var or__4131__auto__ = arrowhead_length__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(arrowhead_width__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
).call(null,arrowhead_length),((function (arrowhead_width__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,arrowhead_length,v__15911__auto__);
});})(arrowhead_width__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
);
var shaft__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (arrowhead_width__$1,arrowhead_length__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (shaft__$1){
var or__4131__auto__ = shaft__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(arrowhead_width__$1,arrowhead_length__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
).call(null,shaft),((function (arrowhead_width__$1,arrowhead_length__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,shaft,v__15911__auto__);
});})(arrowhead_width__$1,arrowhead_length__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
);
var dragging = javelin.core.cell.call(null,null);
var rotation = javelin.core.formula.call(null,((function (dragging,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (points__$1){
var a = cljs.core.get.call(null,points__$1,(0));
var b = cljs.core.get.call(null,points__$1,(1));
return weathergen.ui.layers.annotations.annotation_rotation.call(null,weathergen.math.vector_subtract.call(null,b,a));
});})(dragging,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
).call(null,points);
var length = javelin.core.formula.call(null,((function (dragging,rotation,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (points__$1){
var a = cljs.core.get.call(null,points__$1,(0));
var b = cljs.core.get.call(null,points__$1,(1));
return weathergen.math.magnitude.call(null,weathergen.math.vector_subtract.call(null,b,a));
});})(dragging,rotation,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
).call(null,points);
return hoplon.svg.g.call(null,hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Arrow annotation",new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (points__$1){
var a = cljs.core.get.call(null,points__$1,(0));
var vec__36228 = a;
var ax = cljs.core.nth.call(null,vec__36228,(0),null);
var ay = cljs.core.nth.call(null,vec__36228,(1),null);
return weathergen.ui.common.svg_translate.call(null,ax,ay);
});})(dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
).call(null,points),new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (editing_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),(cljs.core.truth_(editing_QMARK___$1)?"move":null),new cljs.core.Keyword(null,"pointer-events","pointer-events",-1053858853),(cljs.core.truth_(editing_QMARK___$1)?null:"none")], null);
});})(dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
).call(null,editing_QMARK_),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (G__36231,G__36232){
return G__36231.call(null,G__36232);
});})(dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
).call(null,weathergen.ui.common.svg_rotate,rotation),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (_){
cljs.core.reset_BANG_.call(null,dragging,"all");

var a = cljs.core.get_in.call(null,cljs.core.deref.call(null,annotation),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"points","points",-1486596883),(0)], null));
var b = cljs.core.get_in.call(null,cljs.core.deref.call(null,annotation),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"points","points",-1486596883),(1)], null));
return register_drag.call(null,((function (a,b,dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (p__36233,final_QMARK_){
var vec__36234 = p__36233;
var dx = cljs.core.nth.call(null,vec__36234,(0),null);
var dy = cljs.core.nth.call(null,vec__36234,(1),null);
var dp = vec__36234;
cljs.core.swap_BANG_.call(null,annotation,((function (vec__36234,dx,dy,dp,a,b,dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (p1__36220_SHARP_){
return cljs.core.assoc_in.call(null,cljs.core.assoc_in.call(null,p1__36220_SHARP_,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"points","points",-1486596883),(0)], null),weathergen.math.vector_add.call(null,a,dp)),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"points","points",-1486596883),(1)], null),weathergen.math.vector_add.call(null,b,dp));
});})(vec__36234,dx,dy,dp,a,b,dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,dragging,null);
} else {
return null;
}
});})(a,b,dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
);
});})(dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
,weathergen.ui.layers.annotations.stroke_and_fill_attrs.call(null,annotation),hoplon.svg.polygon.call(null,new cljs.core.Keyword(null,"points","points",-1486596883),javelin.core.formula.call(null,((function (dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (arrowhead_width__$2,arrowhead_length__$2,shaft__$2,heft__$1,length__$1){
var heft_STAR_ = weathergen.ui.layers.annotations.linear__GT_exp.call(null,heft__$1,(1),(100),0.1,(10));
var shaft_STAR_ = (heft_STAR_ * weathergen.ui.layers.annotations.linear__GT_exp.call(null,shaft__$2,(1),(100),0.005,(4)));
var head_width = weathergen.ui.layers.annotations.linear__GT_exp.call(null,arrowhead_width__$2,(1),(100),0.005,(25));
var head_length = weathergen.ui.layers.annotations.linear__GT_exp.call(null,arrowhead_length__$2,(1),(100),0.005,(10));
var abs_head_width = (head_width * heft_STAR_);
var abs_head_length = (head_length * heft_STAR_);
var shaft_end_x = (length__$1 - abs_head_length);
var shaft_top_y = (shaft_STAR_ / (-2));
var shaft_bottom_y = (- shaft_top_y);
var head_top_y = (abs_head_width / (-2));
var head_bottom_y = (- head_top_y);
return clojure.string.join.call(null," ",cljs.core.map.call(null,((function (heft_STAR_,shaft_STAR_,head_width,head_length,abs_head_width,abs_head_length,shaft_end_x,shaft_top_y,shaft_bottom_y,head_top_y,head_bottom_y,dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation){
return (function (p1__36221_SHARP_){
return clojure.string.join.call(null,",",p1__36221_SHARP_);
});})(heft_STAR_,shaft_STAR_,head_width,head_length,abs_head_width,abs_head_length,shaft_end_x,shaft_top_y,shaft_bottom_y,head_top_y,head_bottom_y,dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
,new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),shaft_top_y], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [shaft_end_x,shaft_top_y], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [shaft_end_x,head_top_y], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [length__$1,(0)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [shaft_end_x,head_bottom_y], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [shaft_end_x,shaft_bottom_y], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),shaft_bottom_y], null)], null)));
});})(dragging,rotation,length,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,points,arrowhead_width,arrowhead_length,shaft,heft,editing_QMARK_,map__36224,map__36224__$1,state,annotations,map_viewbox,map_zoom,map__36225,map__36225__$1,handlers,register_drag,delete_annotation))
).call(null,arrowhead_width__$1,arrowhead_length__$1,shaft__$1,heft,length))))),weathergen.ui.layers.annotations.linear_edit_buttons.call(null,annotation,cljs.core.assoc.call(null,state,new cljs.core.Keyword(null,"dragging","dragging",1185097613),dragging),handlers));
});
weathergen.ui.layers.annotations.lines_overlay = (function weathergen$ui$layers$annotations$lines_overlay(annotation,p__36237,p__36238){
var map__36239 = p__36237;
var map__36239__$1 = (((((!((map__36239 == null))))?(((((map__36239.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36239.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36239):map__36239);
var state = map__36239__$1;
var annotations = cljs.core.get.call(null,map__36239__$1,new cljs.core.Keyword(null,"annotations","annotations",1640956248));
var map_viewbox = cljs.core.get.call(null,map__36239__$1,new cljs.core.Keyword(null,"map-viewbox","map-viewbox",860086717));
var map_zoom = cljs.core.get.call(null,map__36239__$1,new cljs.core.Keyword(null,"map-zoom","map-zoom",1543291337));
var map__36240 = p__36238;
var map__36240__$1 = (((((!((map__36240 == null))))?(((((map__36240.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36240.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36240):map__36240);
var handlers = map__36240__$1;
var register_drag = cljs.core.get.call(null,map__36240__$1,new cljs.core.Keyword(null,"register-drag","register-drag",1575693720));
var delete_annotation = cljs.core.get.call(null,map__36240__$1,new cljs.core.Keyword(null,"delete-annotation","delete-annotation",563372499));
var points = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"points","points",-1486596883)], null));
var editing_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null));
var open_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"open?","open?",1238443125)], null));
var dragging = javelin.core.cell.call(null,null);
var path = javelin.core.formula.call(null,((function (dragging,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation){
return (function (points__$1){
return clojure.string.join.call(null," ",cljs.core.map.call(null,((function (dragging,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation){
return (function (p__36243){
var vec__36244 = p__36243;
var x = cljs.core.nth.call(null,vec__36244,(0),null);
var y = cljs.core.nth.call(null,vec__36244,(1),null);
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),",",cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join('');
});})(dragging,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation))
,cljs.core.map.call(null,cljs.core.val,cljs.core.sort_by.call(null,cljs.core.key,points__$1))));
});})(dragging,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation))
).call(null,points);
var attrs = weathergen.ui.layers.annotations.stroke_and_fill_attrs.call(null,annotation);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Line annotation",new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (dragging,path,attrs,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation){
return (function (editing_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),(cljs.core.truth_(editing_QMARK___$1)?"move":null),new cljs.core.Keyword(null,"pointer-events","pointer-events",-1053858853),(cljs.core.truth_(editing_QMARK___$1)?null:"none")], null);
});})(dragging,path,attrs,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation))
).call(null,editing_QMARK_),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (dragging,path,attrs,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation){
return (function (_){
cljs.core.reset_BANG_.call(null,dragging,"all");

var move_all = weathergen.ui.layers.annotations.move_all.call(null,points);
return register_drag.call(null,((function (move_all,dragging,path,attrs,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation){
return (function (p__36247,final_QMARK_){
var vec__36248 = p__36247;
var dx = cljs.core.nth.call(null,vec__36248,(0),null);
var dy = cljs.core.nth.call(null,vec__36248,(1),null);
var dp = vec__36248;
move_all.call(null,dp,final_QMARK_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,dragging,null);
} else {
return null;
}
});})(move_all,dragging,path,attrs,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation))
);
});})(dragging,path,attrs,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation))
,(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (dragging,path,attrs,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation){
return (function (){
return hoplon.svg.polyline.call(null,attrs,new cljs.core.Keyword(null,"points","points",-1486596883),path);
});})(dragging,path,attrs,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,dragging,path,attrs,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation){
return (function (){
return hoplon.svg.polygon.call(null,attrs,new cljs.core.Keyword(null,"points","points",-1486596883),path);
});})(con__30287__auto__,dragging,path,attrs,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,dragging,path,attrs,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,dragging,path,attrs,points,editing_QMARK_,open_QMARK_,map__36239,map__36239__$1,state,annotations,map_viewbox,map_zoom,map__36240,map__36240__$1,handlers,register_drag,delete_annotation))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,open_QMARK_);
})(),weathergen.ui.layers.annotations.linear_edit_buttons.call(null,annotation,cljs.core.assoc.call(null,state,new cljs.core.Keyword(null,"dragging","dragging",1185097613),dragging,new cljs.core.Keyword(null,"add-points?","add-points?",-228600117),true),handlers));
});
/**
 * Returns SVG for a PPT annotation.
 */
weathergen.ui.layers.annotations.ppt_overlay = (function weathergen$ui$layers$annotations$ppt_overlay(annotation,p__36251,p__36252){
var map__36253 = p__36251;
var map__36253__$1 = (((((!((map__36253 == null))))?(((((map__36253.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36253.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36253):map__36253);
var state = map__36253__$1;
var annotations = cljs.core.get.call(null,map__36253__$1,new cljs.core.Keyword(null,"annotations","annotations",1640956248));
var map_viewbox = cljs.core.get.call(null,map__36253__$1,new cljs.core.Keyword(null,"map-viewbox","map-viewbox",860086717));
var map_zoom = cljs.core.get.call(null,map__36253__$1,new cljs.core.Keyword(null,"map-zoom","map-zoom",1543291337));
var mission = cljs.core.get.call(null,map__36253__$1,new cljs.core.Keyword(null,"mission","mission",1740288522));
var map_text_scale = cljs.core.get.call(null,map__36253__$1,new cljs.core.Keyword(null,"map-text-scale","map-text-scale",1420206123));
var map_icon_scale = cljs.core.get.call(null,map__36253__$1,new cljs.core.Keyword(null,"map-icon-scale","map-icon-scale",-1307959664));
var map__36254 = p__36252;
var map__36254__$1 = (((((!((map__36254 == null))))?(((((map__36254.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36254.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36254):map__36254);
var handlers = map__36254__$1;
var register_drag = cljs.core.get.call(null,map__36254__$1,new cljs.core.Keyword(null,"register-drag","register-drag",1575693720));
var delete_annotation = cljs.core.get.call(null,map__36254__$1,new cljs.core.Keyword(null,"delete-annotation","delete-annotation",563372499));
var edge_style = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-style","edge-style",1285542514)], null));
var edge_width = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-width","edge-width",-1845528442)], null));
var x = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"x","x",2099068185)], null));
var y = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"y","y",-1757859776)], null));
var label = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"label","label",1718410804)], null));
var threat = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"threat","threat",-2071776455)], null));
var editing_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null));
var x_36289__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (x__$1){
var or__4131__auto__ = x__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,x),((function (edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,x,v__15911__auto__);
});})(edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
);
var y_36290__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (x_36289__$1,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (y__$1){
var or__4131__auto__ = y__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(x_36289__$1,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,y),((function (x_36289__$1,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,y,v__15911__auto__);
});})(x_36289__$1,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
);
var edge_width_36291__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (x_36289__$1,y_36290__$1,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (edge_width__$1){
var or__4131__auto__ = edge_width__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(x_36289__$1,y_36290__$1,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,edge_width),((function (x_36289__$1,y_36290__$1,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,edge_width,v__15911__auto__);
});})(x_36289__$1,y_36290__$1,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
);

var icon_size = javelin.core.formula.call(null,((function (edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (G__36258,G__36257){
return (G__36257 / G__36258);
});})(edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,map_zoom,map_icon_scale);
var dragging = javelin.core.cell.call(null,null);
var radius = javelin.core.formula.call(null,((function (icon_size,dragging,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (G__36262,G__36259,G__36260,G__36261){
return G__36259.call(null,G__36260,G__36261.call(null,(function (){var or__4131__auto__ = new cljs.core.Keyword(null,"radius-ft","radius-ft",1860060448).cljs$core$IFn$_invoke$arity$1(G__36262);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
})()));
});})(icon_size,dragging,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,threat,weathergen.coordinates.nm__GT_weather,mission,weathergen.coordinates.ft__GT_nm);
var ew = javelin.core.formula.call(null,((function (icon_size,dragging,radius,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (edge_style__$1,edge_width__$1){
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"none","none",1333468478),edge_style__$1)){
return (0);
} else {
return (edge_width__$1 / (200));
}
});})(icon_size,dragging,radius,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,edge_style,edge_width);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (G__36264,G__36263,G__36265){
return G__36263.call(null,G__36264,G__36265);
});})(icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,x,weathergen.ui.common.svg_translate,y),new cljs.core.Keyword(null,"cursor","cursor",1011937484),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (){
return "move";
});})(icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (){
return null;
});})(con__30287__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,editing_QMARK_);
})(),new cljs.core.Keyword(null,"pointer-events","pointer-events",-1053858853),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (){
return "all";
});})(icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (){
return "none";
});})(con__30287__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,editing_QMARK_);
})(),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (_){
cljs.core.reset_BANG_.call(null,dragging,"all");

var x0 = cljs.core.deref.call(null,x);
var y0 = cljs.core.deref.call(null,y);
return register_drag.call(null,((function (x0,y0,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (p__36266,final_QMARK_){
var vec__36267 = p__36266;
var dx = cljs.core.nth.call(null,vec__36267,(0),null);
var dy = cljs.core.nth.call(null,vec__36267,(1),null);
var dp = vec__36267;
cljs.core.reset_BANG_.call(null,x,(x0 + dx));

cljs.core.reset_BANG_.call(null,y,(y0 + dy));

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,dragging,null);
} else {
return null;
}
});})(x0,y0,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
);
});})(icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
,(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (){
return hoplon.svg.circle.call(null,weathergen.ui.layers.annotations.stroke_and_fill_attrs.call(null,annotation),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 (icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (G__36271,G__36270){
return (G__36270 - G__36271);
});})(icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,ew,radius));
});})(icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (){
return null;
});})(con__30287__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,javelin.core.formula.call(null,((function (con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (G__36272){
return (0.1 < G__36272);
});})(con__30287__auto__,alt__30288__auto__,tpl__30289__auto__,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,radius));
})(),hoplon.svg.image.call(null,new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),"images/ppt.svg",new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (G__36273){
return (G__36273 * -0.4);
});})(icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,icon_size),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (G__36274){
return (G__36274 * -0.4);
});})(icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,icon_size),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (G__36275){
return (G__36275 * 0.8);
});})(icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,icon_size),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (G__36276){
return (G__36276 * 0.8);
});})(icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,icon_size)),hoplon.svg.text.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (G__36278,G__36280,G__36279,G__36282,G__36281,G__36277){
return G__36277.call(null,G__36278.call(null,(0),(G__36279 / (2))),G__36280.call(null,((G__36281 * 0.06) / G__36282)));
});})(icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,weathergen.ui.common.svg_translate,weathergen.ui.common.svg_scale,icon_size,map_zoom,map_text_scale,weathergen.ui.common.svg_xform_combine),new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),-2.5,new cljs.core.Keyword(null,"dominant-baseline","dominant-baseline",609259826),"text-before-edge",new cljs.core.Keyword(null,"text-anchor","text-anchor",585613696),"middle",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"none",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"font-family","font-family",-667419874),"Courier New",javelin.core.formula.call(null,((function (icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (G__36284,G__36283){
var or__4131__auto__ = G__36283;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(G__36284);
}
});})(icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,threat,label)),(cljs.core.truth_(editing_QMARK_)?(function (){var frame_size = javelin.core.formula.call(null,((function (icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (G__36286,G__36285){
var x__4219__auto__ = ((2) * G__36285);
var y__4220__auto__ = ((4) / G__36286);
return ((x__4219__auto__ > y__4220__auto__) ? x__4219__auto__ : y__4220__auto__);
});})(icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,map_zoom,radius);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (frame_size,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation){
return (function (G__36287,G__36288){
return G__36287.call(null,(G__36288 / (-2)),(G__36288 / (-2)));
});})(frame_size,icon_size,dragging,radius,ew,edge_style,edge_width,x,y,label,threat,editing_QMARK_,map__36253,map__36253__$1,state,annotations,map_viewbox,map_zoom,mission,map_text_scale,map_icon_scale,map__36254,map__36254__$1,handlers,register_drag,delete_annotation))
).call(null,weathergen.ui.common.svg_translate,frame_size),weathergen.ui.layers.annotations.edit_frame_overlay.call(null,annotation,cljs.core.assoc.call(null,state,new cljs.core.Keyword(null,"dragging","dragging",1185097613),dragging),handlers,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"width","width",-384071477),frame_size,new cljs.core.Keyword(null,"height","height",1025178622),frame_size,new cljs.core.Keyword(null,"buttons","buttons",-1953831197),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"done","done",-889844188),null,new cljs.core.Keyword(null,"move","move",-2110884309),null,new cljs.core.Keyword(null,"delete","delete",-1768633620),null], null), null)], null)));
})():null));
});
/**
 * Renders the UI for the display of the annotations.
 */
weathergen.ui.layers.annotations.overlay = (function weathergen$ui$layers$annotations$overlay(p__36292,register_drag_handler){
var map__36293 = p__36292;
var map__36293__$1 = (((((!((map__36293 == null))))?(((((map__36293.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36293.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36293):map__36293);
var state = map__36293__$1;
var annotations = cljs.core.get.call(null,map__36293__$1,new cljs.core.Keyword(null,"annotations","annotations",1640956248));
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"annotations-overlay",weathergen.ui.common.keyed_loop_tpl_STAR_.call(null,annotations,cljs.core.key,((function (map__36293,map__36293__$1,state,annotations){
return (function (item__15894__auto__){
var vec__36301 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (map__36293,map__36293__$1,state,annotations){
return (function (p__36304){
var vec__36305 = p__36304;
var k = cljs.core.nth.call(null,vec__36305,(0),null);
var _ = cljs.core.nth.call(null,vec__36305,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [_,k], null);
});})(map__36293,map__36293__$1,state,annotations))
).call(null,item__15894__auto__));
var _ = cljs.core.nth.call(null,vec__36301,(0),null);
var k = cljs.core.nth.call(null,vec__36301,(1),null);
var annotation = weathergen.ui.common.map_lens.call(null,annotations,k);
var delete$ = ((function (annotation,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (){
return cljs.core.swap_BANG_.call(null,annotations,cljs.core.dissoc,cljs.core.deref.call(null,k));
});})(annotation,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
;
var handlers = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"register-drag","register-drag",1575693720),register_drag_handler,new cljs.core.Keyword(null,"delete-annotation","delete-annotation",563372499),delete$], null);
var rotation = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"rotation","rotation",-1728051644)], null));
var type = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"type","type",1174270348)], null));
var x = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"x","x",2099068185)], null));
var y = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"y","y",-1757859776)], null));
var editing_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null));
var hidden_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"hidden?","hidden?",1339691380)], null));
var rotation__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (rotation__$1){
var or__4131__auto__ = rotation__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
).call(null,rotation),((function (rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,rotation,v__15911__auto__);
});})(rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
);
var x__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (rotation__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (x__$1){
var or__4131__auto__ = x__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(rotation__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
).call(null,x),((function (rotation__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,x,v__15911__auto__);
});})(rotation__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
);
var y__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (rotation__$1,x__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (y__$1){
var or__4131__auto__ = y__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(rotation__$1,x__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
).call(null,y),((function (rotation__$1,x__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,y,v__15911__auto__);
});})(rotation__$1,x__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),javelin.core.formula.call(null,((function (rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (G__36308,G__36309){
return G__36308.call(null,(function (){var or__4131__auto__ = G__36309;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "";
}
})());
});})(rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
).call(null,cljs.core.name,type),new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (editing_QMARK___$1,hidden_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"display","display",242065432),(cljs.core.truth_((function (){var and__4120__auto__ = cljs.core.not.call(null,editing_QMARK___$1);
if(and__4120__auto__){
return hidden_QMARK___$1;
} else {
return and__4120__auto__;
}
})())?"none":null)], null);
});})(rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
).call(null,editing_QMARK_,hidden_QMARK_),(function (){var G__36310 = (new cljs.core.Delay(((function (rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (){
return weathergen.ui.layers.annotations.shape_overlay.call(null,annotation,state,handlers);
});})(rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
,null));
var G__36311 = (new cljs.core.Delay(((function (G__36310,rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (){
return weathergen.ui.layers.annotations.arrow_overlay.call(null,annotation,state,handlers);
});})(G__36310,rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
,null));
var G__36312 = (new cljs.core.Delay(((function (G__36310,G__36311,rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (){
return weathergen.ui.layers.annotations.lines_overlay.call(null,annotation,state,handlers);
});})(G__36310,G__36311,rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
,null));
var G__36313 = (new cljs.core.Delay(((function (G__36310,G__36311,G__36312,rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (){
return weathergen.ui.layers.annotations.ppt_overlay.call(null,annotation,state,handlers);
});})(G__36310,G__36311,G__36312,rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
,null));
var G__36314 = (new cljs.core.Delay(((function (G__36310,G__36311,G__36312,G__36313,rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Unsupported type");
});})(G__36310,G__36311,G__36312,G__36313,rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
,null));
var tpl__30316__auto__ = ((function (G__36310,G__36311,G__36312,G__36313,G__36314,rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (expr__30317__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (function (){var G__36316 = expr__30317__auto__;
var G__36316__$1 = (((G__36316 instanceof cljs.core.Keyword))?G__36316.fqn:null);
switch (G__36316__$1) {
case "shape":
return G__36310;

break;
case "arrow":
return G__36311;

break;
case "lines":
return G__36312;

break;
case "ppt":
return G__36313;

break;
default:
return G__36314;

}
})();
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(G__36310,G__36311,G__36312,G__36313,G__36314,rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
;
return javelin.core.formula.call(null,tpl__30316__auto__).call(null,javelin.core.formula.call(null,((function (G__36310,G__36311,G__36312,G__36313,G__36314,tpl__30316__auto__,rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations){
return (function (G__36317){
return G__36317;
});})(G__36310,G__36311,G__36312,G__36313,G__36314,tpl__30316__auto__,rotation__$1,x__$1,y__$1,rotation,type,x,y,editing_QMARK_,hidden_QMARK_,annotation,delete$,handlers,vec__36301,_,k,map__36293,map__36293__$1,state,annotations))
).call(null,type));
})());
});})(map__36293,map__36293__$1,state,annotations))
));
});
/**
 * Returns UI for a coordinate edit over `source`.
 */
weathergen.ui.layers.annotations.coord_edit = (function weathergen$ui$layers$annotations$coord_edit(source){
return weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(50),new cljs.core.Keyword(null,"source","source",-433931539),source,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.conform_nonnegative_float,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"0.00",new cljs.core.Keyword(null,"fmt","fmt",332300772),(function (v){
return v.toFixed((2));
}));
});
/**
 * Wraps `contents` in an appropriate `with-help`.
 */
weathergen.ui.layers.annotations.helped = (function weathergen$ui$layers$annotations$helped(help_tag,contents){
return weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"annotations","annotations",1640956248),help_tag], null),contents);
});
/**
 * Returns UI for the location of an annotation.
 */
weathergen.ui.layers.annotations.location_controls = (function weathergen$ui$layers$annotations$location_controls(var_args){
var args__4736__auto__ = [];
var len__4730__auto___36324 = arguments.length;
var i__4731__auto___36325 = (0);
while(true){
if((i__4731__auto___36325 < len__4730__auto___36324)){
args__4736__auto__.push((arguments[i__4731__auto___36325]));

var G__36326 = (i__4731__auto___36325 + (1));
i__4731__auto___36325 = G__36326;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((4) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((4)),(0),null)):null);
return weathergen.ui.layers.annotations.location_controls.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]),argseq__4737__auto__);
});

weathergen.ui.layers.annotations.location_controls.cljs$core$IFn$_invoke$arity$variadic = (function (label,help_tag,x,y,extra_columns){
var x__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,(function (x__$1){
var or__4131__auto__ = x__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
})).call(null,x),(function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,x,v__15911__auto__);
}));
var y__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (x__$1){
return (function (y__$1){
var or__4131__auto__ = y__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(x__$1))
).call(null,y),((function (x__$1){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,y,v__15911__auto__);
});})(x__$1))
);
return cljs.core.apply.call(null,hoplon.core.tr,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,help_tag,label)),hoplon.core.td.call(null,weathergen.ui.layers.annotations.coord_edit.call(null,x__$1)),hoplon.core.td.call(null,weathergen.ui.layers.annotations.coord_edit.call(null,y__$1)),extra_columns);
});

weathergen.ui.layers.annotations.location_controls.cljs$lang$maxFixedArity = (4);

/** @this {Function} */
weathergen.ui.layers.annotations.location_controls.cljs$lang$applyTo = (function (seq36319){
var G__36320 = cljs.core.first.call(null,seq36319);
var seq36319__$1 = cljs.core.next.call(null,seq36319);
var G__36321 = cljs.core.first.call(null,seq36319__$1);
var seq36319__$2 = cljs.core.next.call(null,seq36319__$1);
var G__36322 = cljs.core.first.call(null,seq36319__$2);
var seq36319__$3 = cljs.core.next.call(null,seq36319__$2);
var G__36323 = cljs.core.first.call(null,seq36319__$3);
var seq36319__$4 = cljs.core.next.call(null,seq36319__$3);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__36320,G__36321,G__36322,G__36323,seq36319__$4);
});

/**
 * Returns UI for the location of a shape annotation.
 */
weathergen.ui.layers.annotations.shape_location_controls = (function weathergen$ui$layers$annotations$shape_location_controls(annotation){
var x = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"x","x",2099068185)], null));
var y = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"y","y",-1757859776)], null));
var x__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (x,y){
return (function (x__$1){
var or__4131__auto__ = x__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(x,y))
).call(null,x),((function (x,y){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,x,v__15911__auto__);
});})(x,y))
);
var y__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (x__$1,x,y){
return (function (y__$1){
var or__4131__auto__ = y__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(x__$1,x,y))
).call(null,y),((function (x__$1,x,y){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,y,v__15911__auto__);
});})(x__$1,x,y))
);
return weathergen.ui.layers.annotations.location_controls.call(null,"Location:",new cljs.core.Keyword(null,"location","location",1815599388),x__$1,y__$1);
});
/**
 * Returns UI for the size of an annotation.
 */
weathergen.ui.layers.annotations.size_controls = (function weathergen$ui$layers$annotations$size_controls(annotation){
var width = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"width","width",-384071477)], null));
var height = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"height","height",1025178622)], null));
var width__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (width,height){
return (function (width__$1){
var or__4131__auto__ = width__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(width,height))
).call(null,width),((function (width,height){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,width,v__15911__auto__);
});})(width,height))
);
var height__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (width__$1,width,height){
return (function (height__$1){
var or__4131__auto__ = height__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(width__$1,width,height))
).call(null,height),((function (width__$1,width,height){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,height,v__15911__auto__);
});})(width__$1,width,height))
);
return hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"size","size",1098693007),"Size:")),hoplon.core.td.call(null,weathergen.ui.layers.annotations.coord_edit.call(null,width__$1)),hoplon.core.td.call(null,weathergen.ui.layers.annotations.coord_edit.call(null,height__$1)));
});
/**
 * Returns UI for the rotation of an annotation.
 */
weathergen.ui.layers.annotations.rotation_controls = (function weathergen$ui$layers$annotations$rotation_controls(annotation){
var rotation = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"rotation","rotation",-1728051644)], null));
var rotation__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (rotation){
return (function (rotation__$1){
var or__4131__auto__ = rotation__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(rotation))
).call(null,rotation),((function (rotation){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,rotation,v__15911__auto__);
});})(rotation))
);
return hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"rotation","rotation",-1728051644),"Rotation:")),hoplon.core.td.call(null,weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(50),new cljs.core.Keyword(null,"source","source",-433931539),rotation__$1,new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.float_conformer.call(null,(-360),(360)),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"0.00",new cljs.core.Keyword(null,"fmt","fmt",332300772),((function (rotation__$1,rotation){
return (function (v){
return v.toFixed((2));
});})(rotation__$1,rotation))
)));
});
/**
 * Returns UI for a range slider that moves between 1 and 100.
 */
weathergen.ui.layers.annotations.range_controls = (function weathergen$ui$layers$annotations$range_controls(label,help_tag,source){
return hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,help_tag,label)),hoplon.core.td.call(null,weathergen.ui.common.slider.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.pct.call(null,(100)),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null),new cljs.core.Keyword(null,"value","value",305978217),source,new cljs.core.Keyword(null,"min","min",444991522),(1),new cljs.core.Keyword(null,"max","max",61366548),(100))),hoplon.core.td.call(null,weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),source,new cljs.core.Keyword(null,"width","width",-384071477),(50),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"0.00",new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.common.float_conformer.call(null,(1),(100)),new cljs.core.Keyword(null,"fmt","fmt",332300772),(function (v){
return v.toFixed((2));
}))));
});
/**
 * Returns UI for a boolean option.
 */
weathergen.ui.layers.annotations.checkbox_controls = (function weathergen$ui$layers$annotations$checkbox_controls(label,help_tag,source){
return hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,help_tag,label)),hoplon.core.td.call(null,weathergen.ui.common.checkbox.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.pct.call(null,(100)),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null),new cljs.core.Keyword(null,"value","value",305978217),source)));
});
/**
 * Returns UI for a color picker control.
 */
weathergen.ui.layers.annotations.color_controls = (function weathergen$ui$layers$annotations$color_controls(label,help_tag,source){
return hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,help_tag,label)),hoplon.core.td.call(null,weathergen.ui.common.color_picker2.call(null,new cljs.core.Keyword(null,"value","value",305978217),source,new cljs.core.Keyword(null,"alpha?","alpha?",1329751525),true)),hoplon.core.td.call(null,weathergen.ui.common.validating_edit.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(70),new cljs.core.Keyword(null,"source","source",-433931539),source,new cljs.core.Keyword(null,"conform","conform",1846236460),(function (source_STAR_){
return javelin.core.formula.call(null,(function (source_STAR___$1){
var c = weathergen.ui.common.tinycolor.call(null,source_STAR___$1);
var valid_QMARK_ = c.isValid();
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 a valid color"),new cljs.core.Keyword(null,"value","value",305978217),source_STAR___$1], null);
})).call(null,source_STAR_);
}),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"#aarrggbb",new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.identity)));
});
weathergen.ui.layers.annotations.point_controls = (function weathergen$ui$layers$annotations$point_controls(points){
return hoplon.core.table.call(null,weathergen.ui.common.keyed_loop_tpl_STAR_.call(null,points,cljs.core.key,(function (item__15894__auto__){
var vec__36333 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,(function (p__36336){
var vec__36337 = p__36336;
var k = cljs.core.nth.call(null,vec__36337,(0),null);
var _ = cljs.core.nth.call(null,vec__36337,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [_,k], null);
})).call(null,item__15894__auto__));
var _ = cljs.core.nth.call(null,vec__36333,(0),null);
var k = cljs.core.nth.call(null,vec__36333,(1),null);
var point = weathergen.ui.common.map_lens.call(null,points,k);
var point_names = weathergen.ui.layers.annotations.point_names.call(null,points);
var x = weathergen.ui.common.path_lens.call(null,point,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0)], null));
var y = weathergen.ui.common.path_lens.call(null,point,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1)], null));
return weathergen.ui.layers.annotations.location_controls.call(null,javelin.core.formula.call(null,((function (point_names,x,y,point,vec__36333,_,k){
return (function (G__36340,G__36341){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__36340.call(null,G__36341)),":"].join('');
});})(point_names,x,y,point,vec__36333,_,k))
).call(null,point_names,k),new cljs.core.Keyword(null,"points","points",-1486596883),x,y,hoplon.core.td.call(null,weathergen.ui.buttons.image_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (point_names,x,y,point,vec__36333,_,k){
return (function (___$1){
return cljs.core.swap_BANG_.call(null,points,cljs.core.dissoc,cljs.core.deref.call(null,k));
});})(point_names,x,y,point,vec__36333,_,k))
,new cljs.core.Keyword(null,"src","src",-1651076051),"images/trash.png",new cljs.core.Keyword(null,"title","title",636505583),"Delete Point",new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(16)))));
})));
});
/**
 * Returns UI for the locations of points within a line or arrow.
 */
weathergen.ui.layers.annotations.line_point_controls = (function weathergen$ui$layers$annotations$line_point_controls(annotation,map_viewbox){
return hoplon.core.div.call(null,(function (){var points = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"points","points",-1486596883)], null));
var open_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"open?","open?",1238443125)], null));
return hoplon.core.div.call(null,weathergen.ui.common.inl.call(null,weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"closed?","closed?",-1408769040),"Closed?"),weathergen.ui.common.checkbox.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.not_lens.call(null,open_QMARK_))),weathergen.ui.layers.annotations.point_controls.call(null,points),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (points,open_QMARK_){
return (function (_){
return cljs.core.swap_BANG_.call(null,annotation,cljs.core.update,new cljs.core.Keyword(null,"points","points",-1486596883),cljs.core.assoc,weathergen.ui.layers.annotations.unique_id.call(null),((cljs.core.empty_QMARK_.call(null,cljs.core.deref.call(null,points)))?(function (){var map__36342 = cljs.core.deref.call(null,map_viewbox);
var map__36342__$1 = (((((!((map__36342 == null))))?(((((map__36342.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36342.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36342):map__36342);
var x = cljs.core.get.call(null,map__36342__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__36342__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__36342__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__36342__$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);
})():weathergen.math.vector_clamp.call(null,weathergen.math.vector_add.call(null,cljs.core.last.call(null,cljs.core.vals.call(null,cljs.core.deref.call(null,points))),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(new cljs.core.Keyword(null,"width","width",-384071477).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,map_viewbox)) / (20))], null)),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(0)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(59),(59)], null))));
});})(points,open_QMARK_))
,"Add New Point"));
})());
});
weathergen.ui.layers.annotations.arrow_point_controls = (function weathergen$ui$layers$annotations$arrow_point_controls(annotation){
return hoplon.core.div.call(null,(function (){var points = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"points","points",-1486596883)], null));
return weathergen.ui.layers.annotations.point_controls.call(null,points);
})());
});
/**
 * Returns UI for the appearance of an arrow.
 */
weathergen.ui.layers.annotations.arrow_appearance_controls = (function weathergen$ui$layers$annotations$arrow_appearance_controls(annotation){
var shaft = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"shaft","shaft",-278047141)], null));
var arrowhead_length = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"arrowhead-length","arrowhead-length",437777364)], null));
var arrowhead_width = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"arrowhead-width","arrowhead-width",839938517)], null));
var heft = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"heft","heft",-1112917)], null));
var shaft__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (shaft,arrowhead_length,arrowhead_width,heft){
return (function (shaft__$1){
var or__4131__auto__ = shaft__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(shaft,arrowhead_length,arrowhead_width,heft))
).call(null,shaft),((function (shaft,arrowhead_length,arrowhead_width,heft){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,shaft,v__15911__auto__);
});})(shaft,arrowhead_length,arrowhead_width,heft))
);
var arrowhead_width__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (shaft__$1,shaft,arrowhead_length,arrowhead_width,heft){
return (function (arrowhead_width__$1){
var or__4131__auto__ = arrowhead_width__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(shaft__$1,shaft,arrowhead_length,arrowhead_width,heft))
).call(null,arrowhead_width),((function (shaft__$1,shaft,arrowhead_length,arrowhead_width,heft){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,arrowhead_width,v__15911__auto__);
});})(shaft__$1,shaft,arrowhead_length,arrowhead_width,heft))
);
var arrowhead_length__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (shaft__$1,arrowhead_width__$1,shaft,arrowhead_length,arrowhead_width,heft){
return (function (arrowhead_length__$1){
var or__4131__auto__ = arrowhead_length__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(shaft__$1,arrowhead_width__$1,shaft,arrowhead_length,arrowhead_width,heft))
).call(null,arrowhead_length),((function (shaft__$1,arrowhead_width__$1,shaft,arrowhead_length,arrowhead_width,heft){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,arrowhead_length,v__15911__auto__);
});})(shaft__$1,arrowhead_width__$1,shaft,arrowhead_length,arrowhead_width,heft))
);
var heft__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (shaft__$1,arrowhead_width__$1,arrowhead_length__$1,shaft,arrowhead_length,arrowhead_width,heft){
return (function (heft__$1){
var or__4131__auto__ = heft__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(shaft__$1,arrowhead_width__$1,arrowhead_length__$1,shaft,arrowhead_length,arrowhead_width,heft))
).call(null,heft),((function (shaft__$1,arrowhead_width__$1,arrowhead_length__$1,shaft,arrowhead_length,arrowhead_width,heft){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,heft,v__15911__auto__);
});})(shaft__$1,arrowhead_width__$1,arrowhead_length__$1,shaft,arrowhead_length,arrowhead_width,heft))
);
return hoplon.core.table.call(null,weathergen.ui.layers.annotations.range_controls.call(null,"Overall:",new cljs.core.Keyword(null,"heft","heft",-1112917),heft__$1),weathergen.ui.layers.annotations.range_controls.call(null,"Shaft:",new cljs.core.Keyword(null,"shaft","shaft",-278047141),shaft__$1),weathergen.ui.layers.annotations.range_controls.call(null,"Head Width:",new cljs.core.Keyword(null,"arrowhead-width","arrowhead-width",839938517),arrowhead_width__$1),weathergen.ui.layers.annotations.range_controls.call(null,"Head Length:",new cljs.core.Keyword(null,"arrowhead-length","arrowhead-length",437777364),arrowhead_length__$1));
});
/**
 * Returns UI for the controls used to render a text annotation.
 */
weathergen.ui.layers.annotations.text_controls = (function weathergen$ui$layers$annotations$text_controls(annotation){
var font_size = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346)], null));
var font_family = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-family","font-family",-667419874)], null));
var font_color = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-color","font-color",-2019660285)], null));
var font_bold_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-bold?","font-bold?",-796638521)], null));
var font_italic_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"font-italic?","font-italic?",-663673639)], null));
var halign = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"halign","halign",-1113968481)], null));
var height = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"height","height",1025178622)], null));
var rotation = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"rotation","rotation",-1728051644)], null));
var text = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"text","text",-1790561697)], null));
var valign = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"valign","valign",1485197511)], null));
var width = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"width","width",-384071477)], null));
var font_size__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width){
return (function (font_size__$1){
var or__4131__auto__ = font_size__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width))
).call(null,font_size),((function (font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,font_size,v__15911__auto__);
});})(font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width))
);
return hoplon.core.table.call(null,weathergen.ui.layers.annotations.range_controls.call(null,"Font Size:",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),font_size__$1),hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"font","font",-1506159249),"Font:")),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(2),weathergen.ui.common.select2.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.pct.call(null,(100))], null),new cljs.core.Keyword(null,"value","value",305978217),font_family,new cljs.core.Keyword(null,"choices","choices",1385611597),(function (){var iter__4523__auto__ = ((function (font_size__$1,font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width){
return (function weathergen$ui$layers$annotations$text_controls_$_iter__36344(s__36345){
return (new cljs.core.LazySeq(null,((function (font_size__$1,font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width){
return (function (){
var s__36345__$1 = s__36345;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__36345__$1);
if(temp__5720__auto__){
var s__36345__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__36345__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__36345__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__36347 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__36346 = (0);
while(true){
if((i__36346 < size__4522__auto__)){
var font = cljs.core._nth.call(null,c__4521__auto__,i__36346);
cljs.core.chunk_append.call(null,b__36347,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),font,new cljs.core.Keyword(null,"label","label",1718410804),font], null));

var G__36351 = (i__36346 + (1));
i__36346 = G__36351;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__36347),weathergen$ui$layers$annotations$text_controls_$_iter__36344.call(null,cljs.core.chunk_rest.call(null,s__36345__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__36347),null);
}
} else {
var font = cljs.core.first.call(null,s__36345__$2);
return cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),font,new cljs.core.Keyword(null,"label","label",1718410804),font], null),weathergen$ui$layers$annotations$text_controls_$_iter__36344.call(null,cljs.core.rest.call(null,s__36345__$2)));
}
} else {
return null;
}
break;
}
});})(font_size__$1,font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width))
,null,null));
});})(font_size__$1,font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width))
;
return iter__4523__auto__.call(null,new cljs.core.PersistentVector(null, 12, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Arial","Bookman","Comic Sans MS","Courier","Courier New","Garamond","Georgia","Helvetica","Palatino","Times","Times New Roman","Verdana"], null));
})(),new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (font_size__$1,font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width){
return (function (p__36348){
var map__36349 = p__36348;
var map__36349__$1 = (((((!((map__36349 == null))))?(((((map__36349.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36349.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36349):map__36349);
var label = cljs.core.get.call(null,map__36349__$1,new cljs.core.Keyword(null,"label","label",1718410804));
return 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-family","font-family",-667419874),label], null),label);
});})(font_size__$1,font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width))
))),hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"halign","halign",-1113968481),"Horizontal alignment:")),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(2),weathergen.ui.common.select2.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.pct.call(null,(100))], null),new cljs.core.Keyword(null,"value","value",305978217),halign,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,"value","value",305978217),"left",new cljs.core.Keyword(null,"label","label",1718410804),"Left"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),"center",new cljs.core.Keyword(null,"label","label",1718410804),"Center"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),"right",new cljs.core.Keyword(null,"label","label",1718410804),"Right"], null)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"valign","valign",1485197511),"Vertical alignment:")),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(2),weathergen.ui.common.select2.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.pct.call(null,(100))], null),new cljs.core.Keyword(null,"value","value",305978217),valign,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,"value","value",305978217),new cljs.core.Keyword(null,"top","top",-1856271961),new cljs.core.Keyword(null,"label","label",1718410804),"Top"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"middle","middle",-701029031),new cljs.core.Keyword(null,"label","label",1718410804),"Middle"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"bottom","bottom",-1550509018),new cljs.core.Keyword(null,"label","label",1718410804),"Bottom"], null)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"font-bold?","font-bold?",-796638521),"Bold?:")),hoplon.core.td.call(null,weathergen.ui.common.checkbox.call(null,new cljs.core.Keyword(null,"value","value",305978217),font_bold_QMARK_))),hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"font-italic?","font-italic?",-663673639),"Italic?:")),hoplon.core.td.call(null,weathergen.ui.common.checkbox.call(null,new cljs.core.Keyword(null,"value","value",305978217),font_italic_QMARK_))),weathergen.ui.layers.annotations.color_controls.call(null,"Color:",new cljs.core.Keyword(null,"color","color",1011675173),font_color),hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"text","text",-1790561697),"Text:")),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(2),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),weathergen.ui.common.px.call(null,(8))], null),weathergen.ui.textarea.textarea2.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (font_size__$1,font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width){
return (function (font_family__$1,font_italic_QMARK___$1,font_bold_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),font_family__$1,new cljs.core.Keyword(null,"font-style","font-style",-773672352),(cljs.core.truth_(font_italic_QMARK___$1)?"italic":null),new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),(cljs.core.truth_(font_bold_QMARK___$1)?"bold":null),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(100)),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.pct.call(null,(100)),new cljs.core.Keyword(null,"horizontal-alignment","horizontal-alignment",-280310931),halign], null);
});})(font_size__$1,font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width))
).call(null,font_family,font_italic_QMARK_,font_bold_QMARK_),new cljs.core.Keyword(null,"value","value",305978217),text,new cljs.core.Keyword(null,"change","change",-1163046502),((function (font_size__$1,font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width){
return (function (val){
return cljs.core.reset_BANG_.call(null,text,val);
});})(font_size__$1,font_size,font_family,font_color,font_bold_QMARK_,font_italic_QMARK_,halign,height,rotation,text,valign,width))
,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"Enter text here"))));
});
/**
 * Returns UI for the controls used to set up edges.
 */
weathergen.ui.layers.annotations.edge_controls = (function weathergen$ui$layers$annotations$edge_controls(annotation){
var edge_style = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-style","edge-style",1285542514)], null));
var edge_width = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-width","edge-width",-1845528442)], null));
var edge_color = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-color","edge-color",-533761623)], null));
var edge_dash_length = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-dash-length","edge-dash-length",-19162360)], null));
var edge_dash_spacing = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"edge-dash-spacing","edge-dash-spacing",1667711192)], null));
var edge_width__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (edge_width__$1){
var or__4131__auto__ = edge_width__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
).call(null,edge_width),((function (edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,edge_width,v__15911__auto__);
});})(edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
);
var edge_dash_length__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (edge_width__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (edge_dash_length__$1){
var or__4131__auto__ = edge_dash_length__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(edge_width__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
).call(null,edge_dash_length),((function (edge_width__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,edge_dash_length,v__15911__auto__);
});})(edge_width__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
);
var edge_dash_spacing__$1 = javelin.core.lens.call(null,javelin.core.formula.call(null,((function (edge_width__$1,edge_dash_length__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (edge_dash_spacing__$1){
var or__4131__auto__ = edge_dash_spacing__$1;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return (0);
}
});})(edge_width__$1,edge_dash_length__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
).call(null,edge_dash_spacing),((function (edge_width__$1,edge_dash_length__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (v__15911__auto__){
return cljs.core.reset_BANG_.call(null,edge_dash_spacing,v__15911__auto__);
});})(edge_width__$1,edge_dash_length__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
);
return hoplon.core.table.call(null,(function (){var dashed_QMARK_ = javelin.core.formula.call(null,((function (edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (G__36352,G__36353){
return G__36352.call(null,G__36353,new cljs.core.Keyword(null,"dashed","dashed",-1449249319));
});})(edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
).call(null,cljs.core._EQ_,edge_style);
var has_edge_QMARK_ = javelin.core.formula.call(null,((function (dashed_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (G__36354){
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"solid","solid",-2023773691),null,new cljs.core.Keyword(null,"dashed","dashed",-1449249319),null], null), null).call(null,G__36354);
});})(dashed_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
).call(null,edge_style);
return hoplon.core.tbody.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"edge-style","edge-style",1285542514),"Style:")),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(2),weathergen.ui.common.select2.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.pct.call(null,(100))], null),new cljs.core.Keyword(null,"value","value",305978217),edge_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,"value","value",305978217),new cljs.core.Keyword(null,"none","none",1333468478),new cljs.core.Keyword(null,"label","label",1718410804),"No Edge"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"solid","solid",-2023773691),new cljs.core.Keyword(null,"label","label",1718410804),"Solid"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"dashed","dashed",-1449249319),new cljs.core.Keyword(null,"label","label",1718410804),"Dashed"], null)], null),new cljs.core.Keyword(null,"formatter","formatter",-483008823),new cljs.core.Keyword(null,"label","label",1718410804)))),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (){
return weathergen.ui.layers.annotations.color_controls.call(null,"Color:",new cljs.core.Keyword(null,"edge-color","edge-color",-533761623),edge_color);
});})(dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (){
return null;
});})(con__30287__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,has_edge_QMARK_);
})(),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (){
return weathergen.ui.layers.annotations.range_controls.call(null,"Width:",new cljs.core.Keyword(null,"edge-width","edge-width",-1845528442),edge_width__$1);
});})(dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (){
return null;
});})(con__30287__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,has_edge_QMARK_);
})(),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (){
return weathergen.ui.layers.annotations.range_controls.call(null,"Dash length:",new cljs.core.Keyword(null,"edge-dash-length","edge-dash-length",-19162360),edge_dash_length__$1);
});})(dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (){
return null;
});})(con__30287__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,dashed_QMARK_);
})(),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (){
return weathergen.ui.layers.annotations.range_controls.call(null,"Dash spacing:",new cljs.core.Keyword(null,"edge-dash-spacing","edge-dash-spacing",1667711192),edge_dash_spacing__$1);
});})(dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (){
return null;
});})(con__30287__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,dashed_QMARK_,has_edge_QMARK_,edge_width__$1,edge_dash_length__$1,edge_dash_spacing__$1,edge_style,edge_width,edge_color,edge_dash_length,edge_dash_spacing))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,dashed_QMARK_);
})());
})());
});
/**
 * Returns UI for selecting a pre-planned threat.
 */
weathergen.ui.layers.annotations.threat_controls = (function weathergen$ui$layers$annotations$threat_controls(annotation,threats){
var threat = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"threat","threat",-2071776455)], null));
var label = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"label","label",1718410804)], null));
return hoplon.core.tbody.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"threat","threat",-2071776455),"Threat:")),hoplon.core.td.call(null,weathergen.ui.common.select2.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(150))], null),new cljs.core.Keyword(null,"value","value",305978217),threat,new cljs.core.Keyword(null,"choices","choices",1385611597),javelin.core.formula.call(null,((function (threat,label){
return (function (threats__$1){
var iter__4523__auto__ = ((function (threat,label){
return (function weathergen$ui$layers$annotations$threat_controls_$_iter__36356(s__36357){
return (new cljs.core.LazySeq(null,((function (threat,label){
return (function (){
var s__36357__$1 = s__36357;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__36357__$1);
if(temp__5720__auto__){
var s__36357__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__36357__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__36357__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__36359 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__36358 = (0);
while(true){
if((i__36358 < size__4522__auto__)){
var map__36360 = cljs.core._nth.call(null,c__4521__auto__,i__36358);
var map__36360__$1 = (((((!((map__36360 == null))))?(((((map__36360.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36360.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36360):map__36360);
var threat__$1 = map__36360__$1;
var id = cljs.core.get.call(null,map__36360__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var radius_ft = cljs.core.get.call(null,map__36360__$1,new cljs.core.Keyword(null,"radius-ft","radius-ft",1860060448));
var description = cljs.core.get.call(null,map__36360__$1,new cljs.core.Keyword(null,"description","description",-1428560544));
cljs.core.chunk_append.call(null,b__36359,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),threat__$1,new cljs.core.Keyword(null,"label","label",1718410804),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(id)," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(description)].join('')], null));

var G__36371 = (i__36358 + (1));
i__36358 = G__36371;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__36359),weathergen$ui$layers$annotations$threat_controls_$_iter__36356.call(null,cljs.core.chunk_rest.call(null,s__36357__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__36359),null);
}
} else {
var map__36362 = cljs.core.first.call(null,s__36357__$2);
var map__36362__$1 = (((((!((map__36362 == null))))?(((((map__36362.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36362.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36362):map__36362);
var threat__$1 = map__36362__$1;
var id = cljs.core.get.call(null,map__36362__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var radius_ft = cljs.core.get.call(null,map__36362__$1,new cljs.core.Keyword(null,"radius-ft","radius-ft",1860060448));
var description = cljs.core.get.call(null,map__36362__$1,new cljs.core.Keyword(null,"description","description",-1428560544));
return cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),threat__$1,new cljs.core.Keyword(null,"label","label",1718410804),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(id)," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(description)].join('')], null),weathergen$ui$layers$annotations$threat_controls_$_iter__36356.call(null,cljs.core.rest.call(null,s__36357__$2)));
}
} else {
return null;
}
break;
}
});})(threat,label))
,null,null));
});})(threat,label))
;
return iter__4523__auto__.call(null,threats__$1);
});})(threat,label))
).call(null,threats),new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (threat,label){
return (function (p__36364){
var map__36365 = p__36364;
var map__36365__$1 = (((((!((map__36365 == null))))?(((((map__36365.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36365.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36365):map__36365);
var value = cljs.core.get.call(null,map__36365__$1,new cljs.core.Keyword(null,"value","value",305978217));
var label__$1 = cljs.core.get.call(null,map__36365__$1,new cljs.core.Keyword(null,"label","label",1718410804));
var map__36367 = value;
var map__36367__$1 = (((((!((map__36367 == null))))?(((((map__36367.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36367.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36367):map__36367);
var id = cljs.core.get.call(null,map__36367__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var radius_ft = cljs.core.get.call(null,map__36367__$1,new cljs.core.Keyword(null,"radius-ft","radius-ft",1860060448));
var description = cljs.core.get.call(null,map__36367__$1,new cljs.core.Keyword(null,"description","description",-1428560544));
return hoplon.core.div.call(null,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-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(5))], null),id),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),weathergen.ui.common.px.call(null,(5))], null),"(",description,")"),hoplon.core.span.call(null,weathergen.coordinates.ft__GT_nm.call(null,radius_ft).toFixed((1)),"nm"));
});})(threat,label))
))),hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"label","label",1718410804),"Label:")),hoplon.core.td.call(null,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),weathergen.ui.common.pct.call(null,(97))], null),new cljs.core.Keyword(null,"value","value",305978217),label,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),javelin.core.formula.call(null,((function (threat,label){
return (function (G__36370,G__36369){
if(cljs.core.truth_(G__36369)){
return null;
} else {
return new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(G__36370);
}
});})(threat,label))
).call(null,threat,label),new cljs.core.Keyword(null,"input","input",556931961),((function (threat,label){
return (function (p1__36355_SHARP_){
return cljs.core.reset_BANG_.call(null,label,cljs.core.deref.call(null,p1__36355_SHARP_));
});})(threat,label))
)),hoplon.core.td.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (threat,label){
return (function (){
return cljs.core.reset_BANG_.call(null,label,null);
});})(threat,label))
,"Reset"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"annotations","annotations",1640956248),new cljs.core.Keyword(null,"reset-label","reset-label",-1700235787)], null)))));
});
weathergen.ui.layers.annotations.annotation_edit_section = (function weathergen$ui$layers$annotations$annotation_edit_section(p__36373){
var map__36374 = p__36373;
var map__36374__$1 = (((((!((map__36374 == null))))?(((((map__36374.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36374.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36374):map__36374);
var state = map__36374__$1;
var annotations = cljs.core.get.call(null,map__36374__$1,new cljs.core.Keyword(null,"annotations","annotations",1640956248));
var map_viewbox = cljs.core.get.call(null,map__36374__$1,new cljs.core.Keyword(null,"map-viewbox","map-viewbox",860086717));
var map_zoom = cljs.core.get.call(null,map__36374__$1,new cljs.core.Keyword(null,"map-zoom","map-zoom",1543291337));
var mission = cljs.core.get.call(null,map__36374__$1,new cljs.core.Keyword(null,"mission","mission",1740288522));
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"overview","overview",-435037267),"Annotations"),hoplon.core.div.call(null,(function (){var make = ((function (map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (type,overrides){
var map__36376 = cljs.core.deref.call(null,map_viewbox);
var map__36376__$1 = (((((!((map__36376 == null))))?(((((map__36376.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36376.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36376):map__36376);
var x = cljs.core.get.call(null,map__36376__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__36376__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__36376__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__36376__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var font_size = weathergen.ui.layers.annotations.scale__GT_font_size.call(null,((width / (59)) / (4)));
return cljs.core.swap_BANG_.call(null,annotations,cljs.core.assoc,weathergen.ui.layers.annotations.unique_id.call(null),(function (){var defaults = cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"y","y",-1757859776),new cljs.core.Keyword(null,"editing?","editing?",1646440800),new cljs.core.Keyword(null,"fill-color","fill-color",-1156875903),new cljs.core.Keyword(null,"shape-type","shape-type",-835891005),new cljs.core.Keyword(null,"font-color","font-color",-2019660285),new cljs.core.Keyword(null,"rotation","rotation",-1728051644),new cljs.core.Keyword(null,"edge-width","edge-width",-1845528442),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),new cljs.core.Keyword(null,"valign","valign",1485197511),new cljs.core.Keyword(null,"edge-dash-length","edge-dash-length",-19162360),new cljs.core.Keyword(null,"edge-color","edge-color",-533761623),new cljs.core.Keyword(null,"width","width",-384071477),new cljs.core.Keyword(null,"filled?","filled?",-1363697461),new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"edge-style","edge-style",1285542514),new cljs.core.Keyword(null,"hidden?","hidden?",1339691380),new cljs.core.Keyword(null,"edge-dash-spacing","edge-dash-spacing",1667711192),new cljs.core.Keyword(null,"x","x",2099068185),new cljs.core.Keyword(null,"font-family","font-family",-667419874),new cljs.core.Keyword(null,"height","height",1025178622),new cljs.core.Keyword(null,"halign","halign",-1113968481),new cljs.core.Keyword(null,"text","text",-1790561697)],[(y + (height / 2.0)),true,"#80000000",new cljs.core.Keyword(null,"rectangle","rectangle",293163262),"white",(0),((12) / cljs.core.deref.call(null,map_zoom)),font_size,new cljs.core.Keyword(null,"middle","middle",-701029031),font_size,"black",(width / (2)),true,type,new cljs.core.Keyword(null,"solid","solid",-2023773691),false,(50),(x + (width / (4))),"Times New Roman",(height / (12)),"center","Edit this text"]);
return cljs.core.merge.call(null,defaults,overrides.call(null,defaults));
})());
});})(map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
;
return hoplon.core.div.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return make.call(null,new cljs.core.Keyword(null,"shape","shape",1190694006),cljs.core.constantly.call(null,null));
});})(make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,"Add Shape"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return make.call(null,new cljs.core.Keyword(null,"arrow","arrow",1071351425),((function (make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (p__36378){
var map__36379 = p__36378;
var map__36379__$1 = (((((!((map__36379 == null))))?(((((map__36379.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36379.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36379):map__36379);
var font_size = cljs.core.get.call(null,map__36379__$1,new cljs.core.Keyword(null,"font-size","font-size",-1847940346));
var width = cljs.core.get.call(null,map__36379__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var x = cljs.core.get.call(null,map__36379__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__36379__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var zoom = cljs.core.deref.call(null,map_zoom);
var rescale = ((function (zoom,map__36379,map__36379__$1,font_size,width,x,y,make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (val,lower,upper){
return weathergen.ui.layers.annotations.exp__GT_linear.call(null,(weathergen.ui.layers.annotations.linear__GT_exp.call(null,val,(1),(100),lower,upper) / zoom),(1),(100),lower,upper);
});})(zoom,map__36379,map__36379__$1,font_size,width,x,y,make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
;
return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"shaft","shaft",-278047141),rescale.call(null,(70),0.005,(4)),new cljs.core.Keyword(null,"arrowhead-width","arrowhead-width",839938517),rescale.call(null,(65),0.005,(25)),new cljs.core.Keyword(null,"arrowhead-length","arrowhead-length",437777364),rescale.call(null,(82),0.005,(10)),new cljs.core.Keyword(null,"heft","heft",-1112917),(50),new cljs.core.Keyword(null,"points","points",-1486596883),cljs.core.sorted_map.call(null,(0),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null),(1),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(x + width),y], null))], null);
});})(make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
);
});})(make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,"Add Arrow"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return make.call(null,new cljs.core.Keyword(null,"lines","lines",-700165781),((function (make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (p__36381){
var map__36382 = p__36381;
var map__36382__$1 = (((((!((map__36382 == null))))?(((((map__36382.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36382.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36382):map__36382);
var font_size = cljs.core.get.call(null,map__36382__$1,new cljs.core.Keyword(null,"font-size","font-size",-1847940346));
var width = cljs.core.get.call(null,map__36382__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var x = cljs.core.get.call(null,map__36382__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__36382__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var zoom = cljs.core.deref.call(null,map_zoom);
var rescale = ((function (zoom,map__36382,map__36382__$1,font_size,width,x,y,make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (val,lower,upper){
return weathergen.ui.layers.annotations.exp__GT_linear.call(null,(weathergen.ui.layers.annotations.linear__GT_exp.call(null,val,(1),(100),lower,upper) / zoom),(1),(100),lower,upper);
});})(zoom,map__36382,map__36382__$1,font_size,width,x,y,make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
;
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"points","points",-1486596883),cljs.core.sorted_map.call(null,(0),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null),(1),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(x + width),y], null)),new cljs.core.Keyword(null,"open?","open?",1238443125),true], null);
});})(make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
);
});})(make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,"Add Lines"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return make.call(null,new cljs.core.Keyword(null,"ppt","ppt",976691076),((function (make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (p__36384){
var map__36385 = p__36384;
var map__36385__$1 = (((((!((map__36385 == null))))?(((((map__36385.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36385.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36385):map__36385);
var font_size = cljs.core.get.call(null,map__36385__$1,new cljs.core.Keyword(null,"font-size","font-size",-1847940346));
var width = cljs.core.get.call(null,map__36385__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var x = cljs.core.get.call(null,map__36385__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__36385__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
return new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"threat","threat",-2071776455),cljs.core.first.call(null,new cljs.core.Keyword(null,"ppt-data","ppt-data",-1749164693).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,mission))),new cljs.core.Keyword(null,"text","text",-1790561697),new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(cljs.core.first.call(null,new cljs.core.Keyword(null,"ppt-data","ppt-data",-1749164693).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,mission)))),new cljs.core.Keyword(null,"font-family","font-family",-667419874),"Courier New",new cljs.core.Keyword(null,"filled?","filled?",-1363697461),false,new cljs.core.Keyword(null,"fill-color","fill-color",-1156875903),"#80ff0000",new cljs.core.Keyword(null,"edge-color","edge-color",-533761623),"red",new cljs.core.Keyword(null,"edge-width","edge-width",-1845528442),(12),new cljs.core.Keyword(null,"x","x",2099068185),(x + (width / (2)))], null);
});})(make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
);
});})(make,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,"Add PPT"));
})(),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),"flex",new cljs.core.Keyword(null,"flex-wrap","flex-wrap",455413707),"wrap"], null),weathergen.ui.common.keyed_loop_tpl_STAR_.call(null,annotations,cljs.core.key,((function (map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (item__15894__auto__){
var vec__36393 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (p__36396){
var vec__36397 = p__36396;
var k = cljs.core.nth.call(null,vec__36397,(0),null);
var _ = cljs.core.nth.call(null,vec__36397,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [_,k], null);
});})(map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
).call(null,item__15894__auto__));
var _ = cljs.core.nth.call(null,vec__36393,(0),null);
var k = cljs.core.nth.call(null,vec__36393,(1),null);
var annotation = weathergen.ui.common.map_lens.call(null,annotations,k);
var type = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"type","type",1174270348)], null));
var shape_type = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"shape-type","shape-type",-835891005)], null));
var editing_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null));
var hidden_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"hidden?","hidden?",1339691380)], null));
var fill_color = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"fill-color","fill-color",-1156875903)], null));
var filled_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"filled?","filled?",-1363697461)], null));
var open_QMARK_ = weathergen.ui.common.path_lens.call(null,annotation,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"open?","open?",1238443125)], null));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (hidden_QMARK___$1,editing_QMARK___$1){
return cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"border-style","border-style",-485574304),new cljs.core.Keyword(null,"min-width","min-width",1926193728),new cljs.core.Keyword(null,"min-height","min-height",398480837),new cljs.core.Keyword(null,"background","background",-863952629),new cljs.core.Keyword(null,"border-width","border-width",-1512605390),new cljs.core.Keyword(null,"padding","padding",1660304693),new cljs.core.Keyword(null,"position","position",-2011731912),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941)],[(cljs.core.truth_(hidden_QMARK___$1)?"dashed":"double"),weathergen.ui.common.px.call(null,(350)),weathergen.ui.common.px.call(null,(330)),(cljs.core.truth_(editing_QMARK___$1)?"#e0ffff":(cljs.core.truth_(hidden_QMARK___$1)?"#f0f0f0":null)),weathergen.ui.common.px.call(null,(3)),weathergen.ui.common.px.call(null,(0),(5),(30)),"relative",weathergen.ui.common.px.call(null,(3)),weathergen.ui.common.px.call(null,(3))]);
});})(type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
).call(null,hidden_QMARK_,editing_QMARK_),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin","margin",-995903681),weathergen.ui.common.px.call(null,(5),(0),(15),(7))], null),weathergen.ui.common.inl.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-right","margin-right",809689658),weathergen.ui.common.px.call(null,(10))], null)], null),weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"Type:")),weathergen.ui.common.inl.call(null,(function (){var G__36400 = (new cljs.core.Delay(((function (type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return weathergen.ui.common.select2.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(125))], null),new cljs.core.Keyword(null,"value","value",305978217),shape_type,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,"value","value",305978217),new cljs.core.Keyword(null,"rectangle","rectangle",293163262),new cljs.core.Keyword(null,"label","label",1718410804),"Rectangle"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"oval","oval",910486219),new cljs.core.Keyword(null,"label","label",1718410804),"Oval"], null)], null));
});})(type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,null));
var G__36401 = (new cljs.core.Delay(((function (G__36400,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return hoplon.core.span.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,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(110))], null)], null),"Arrow");
});})(G__36400,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,null));
var G__36402 = (new cljs.core.Delay(((function (G__36400,G__36401,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return hoplon.core.span.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,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(110))], null)], null),"Lines");
});})(G__36400,G__36401,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,null));
var G__36403 = (new cljs.core.Delay(((function (G__36400,G__36401,G__36402,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return hoplon.core.span.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,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(110))], null)], null),"PPT");
});})(G__36400,G__36401,G__36402,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,null));
var G__36404 = (new cljs.core.Delay(((function (G__36400,G__36401,G__36402,G__36403,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return null;
});})(G__36400,G__36401,G__36402,G__36403,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,null));
var tpl__30316__auto__ = ((function (G__36400,G__36401,G__36402,G__36403,G__36404,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (expr__30317__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (function (){var G__36406 = expr__30317__auto__;
var G__36406__$1 = (((G__36406 instanceof cljs.core.Keyword))?G__36406.fqn:null);
switch (G__36406__$1) {
case "shape":
return G__36400;

break;
case "arrow":
return G__36401;

break;
case "lines":
return G__36402;

break;
case "ppt":
return G__36403;

break;
default:
return G__36404;

}
})();
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(G__36400,G__36401,G__36402,G__36403,G__36404,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
;
return javelin.core.formula.call(null,tpl__30316__auto__).call(null,type);
})())),(function (){var all_tabs = new cljs.core.PersistentVector(null, 10, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"shape-positioning","shape-positioning",-1114086428),new cljs.core.Keyword(null,"title","title",636505583),"Positioning",new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.table.call(null,weathergen.ui.layers.annotations.shape_location_controls.call(null,annotation),weathergen.ui.layers.annotations.size_controls.call(null,annotation),weathergen.ui.layers.annotations.rotation_controls.call(null,annotation))], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"arrow-positioning","arrow-positioning",1649570193),new cljs.core.Keyword(null,"title","title",636505583),"Positioning",new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.layers.annotations.arrow_point_controls.call(null,annotation)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"line-positioning","line-positioning",-2137933824),new cljs.core.Keyword(null,"title","title",636505583),"Points",new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.layers.annotations.line_point_controls.call(null,annotation,map_viewbox)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"ppt-positioning","ppt-positioning",678266284),new cljs.core.Keyword(null,"title","title",636505583),"Positioning",new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.table.call(null,weathergen.ui.layers.annotations.shape_location_controls.call(null,annotation))], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"threat","threat",-2071776455),new cljs.core.Keyword(null,"title","title",636505583),"Threat",new cljs.core.Keyword(null,"ui","ui",-469653645),(function (){var ppt_data = weathergen.ui.common.path_lens.call(null,mission,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ppt-data","ppt-data",-1749164693)], null));
return hoplon.core.table.call(null,weathergen.ui.layers.annotations.threat_controls.call(null,annotation,ppt_data));
})()], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"arrow-appearance","arrow-appearance",-45540204),new cljs.core.Keyword(null,"title","title",636505583),"Appearance",new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.layers.annotations.arrow_appearance_controls.call(null,annotation)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"edge","edge",919909153),new cljs.core.Keyword(null,"title","title",636505583),"Edges",new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.layers.annotations.edge_controls.call(null,annotation)], null),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"fill","fill",883462889),new cljs.core.Keyword(null,"title","title",636505583),"Fill",new cljs.core.Keyword(null,"hidden?","hidden?",1339691380),javelin.core.formula.call(null,((function (type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (G__36407,G__36408,G__36409){
var and__4120__auto__ = G__36407.call(null,G__36408,new cljs.core.Keyword(null,"lines","lines",-700165781));
if(cljs.core.truth_(and__4120__auto__)){
return G__36409;
} else {
return and__4120__auto__;
}
});})(type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
).call(null,cljs.core._EQ_,type,open_QMARK_),new cljs.core.Keyword(null,"ui","ui",-469653645),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.Keyword(null,"td","td",1479933353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"min-width","min-width",1926193728),weathergen.ui.common.px.call(null,(40))], null)], null),hoplon.core.table.call(null,weathergen.ui.layers.annotations.checkbox_controls.call(null,"Fill:",new cljs.core.Keyword(null,"filled?","filled?",-1363697461),filled_QMARK_),(function (){var con__30287__auto__ = (new cljs.core.Delay(((function (type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return weathergen.ui.layers.annotations.color_controls.call(null,"Color:",new cljs.core.Keyword(null,"fill-color","fill-color",-1156875903),fill_color);
});})(type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,null));
var alt__30288__auto__ = (new cljs.core.Delay(((function (con__30287__auto__,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return null;
});})(con__30287__auto__,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,null));
var tpl__30289__auto__ = ((function (con__30287__auto__,alt__30288__auto__,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (p__30290__auto__){
return cljs.core.deref.call(null,(function (){var or__4131__auto__ = (cljs.core.truth_(p__30290__auto__)?con__30287__auto__:alt__30288__auto__);
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.atom.call(null,null);
}
})());
});})(con__30287__auto__,alt__30288__auto__,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
;
return javelin.core.formula.call(null,tpl__30289__auto__).call(null,filled_QMARK_);
})()))], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"text","text",-1790561697),new cljs.core.Keyword(null,"title","title",636505583),"Text",new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.layers.annotations.text_controls.call(null,annotation)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"debug","debug",-1608172596),new cljs.core.Keyword(null,"title","title",636505583),"Debug",new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.pre.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),"pre-wrap"], null),javelin.core.formula.call(null,((function (type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (G__36415,G__36418,G__36416,G__36414,G__36417){
var sb__4661__auto__ = (new G__36414());
var _STAR_print_newline_STAR__orig_val__36410_36420 = cljs.core._STAR_print_newline_STAR_;
var _STAR_print_fn_STAR__orig_val__36411_36421 = cljs.core._STAR_print_fn_STAR_;
var _STAR_print_newline_STAR__temp_val__36412_36422 = true;
var _STAR_print_fn_STAR__temp_val__36413_36423 = ((function (_STAR_print_newline_STAR__orig_val__36410_36420,_STAR_print_fn_STAR__orig_val__36411_36421,_STAR_print_newline_STAR__temp_val__36412_36422,sb__4661__auto__,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (x__4662__auto__){
return sb__4661__auto__.append(x__4662__auto__);
});})(_STAR_print_newline_STAR__orig_val__36410_36420,_STAR_print_fn_STAR__orig_val__36411_36421,_STAR_print_newline_STAR__temp_val__36412_36422,sb__4661__auto__,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
;
cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__temp_val__36412_36422;

cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__temp_val__36413_36423;

try{G__36415.call(null,G__36416.call(null,G__36417.call(null),G__36418));
}finally {cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__orig_val__36411_36421;

cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__orig_val__36410_36420;
}
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(sb__4661__auto__);
});})(type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
).call(null,cljs.pprint.pprint,annotation,cljs.core.into,goog.string.StringBuffer,cljs.core.sorted_map))], null)], null);
var tabs = new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"shape","shape",1190694006),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"shape-positioning","shape-positioning",-1114086428),new cljs.core.Keyword(null,"edge","edge",919909153),new cljs.core.Keyword(null,"fill","fill",883462889),new cljs.core.Keyword(null,"text","text",-1790561697)], null),new cljs.core.Keyword(null,"arrow","arrow",1071351425),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"arrow-positioning","arrow-positioning",1649570193),new cljs.core.Keyword(null,"arrow-appearance","arrow-appearance",-45540204),new cljs.core.Keyword(null,"edge","edge",919909153),new cljs.core.Keyword(null,"fill","fill",883462889)], null),new cljs.core.Keyword(null,"lines","lines",-700165781),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"line-positioning","line-positioning",-2137933824),new cljs.core.Keyword(null,"edge","edge",919909153),new cljs.core.Keyword(null,"fill","fill",883462889)], null),new cljs.core.Keyword(null,"ppt","ppt",976691076),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"threat","threat",-2071776455),new cljs.core.Keyword(null,"ppt-positioning","ppt-positioning",678266284),new cljs.core.Keyword(null,"edge","edge",919909153),new cljs.core.Keyword(null,"fill","fill",883462889)], null)], null);
return javelin.core.formula.call(null,((function (all_tabs,tabs,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (type__$1){
return weathergen.ui.tabs.tabs.call(null,new cljs.core.Keyword(null,"selected","selected",574897764),javelin.core.cell.call(null,cljs.core.first.call(null,cljs.core.get.call(null,tabs,type__$1))),new cljs.core.Keyword(null,"tabs","tabs",-779855354),cljs.core.filter.call(null,((function (all_tabs,tabs,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (p1__36372_SHARP_){
return cljs.core.contains_QMARK_.call(null,cljs.core.set.call(null,cljs.core.get.call(null,tabs,type__$1)),new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(p1__36372_SHARP_));
});})(all_tabs,tabs,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,all_tabs));
});})(all_tabs,tabs,type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
).call(null,type);
})(),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"bottom","bottom",-1550509018),weathergen.ui.common.px.call(null,(7))], null),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"annotations","annotations",1640956248),new cljs.core.Keyword(null,"edit-buttons","edit-buttons",-799797836)], null))),weathergen.ui.buttons.image_button.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,"bottom","bottom",-1550509018),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"left","left",-399115937),weathergen.ui.common.px.call(null,(30))], null),new cljs.core.Keyword(null,"click","click",1912301393),((function (type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return cljs.core.swap_BANG_.call(null,editing_QMARK_,cljs.core.not);
});})(type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,new cljs.core.Keyword(null,"title","title",636505583),"Edit",new cljs.core.Keyword(null,"src","src",-1651076051),"images/edit.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),editing_QMARK_),weathergen.ui.buttons.image_button.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,"bottom","bottom",-1550509018),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"left","left",-399115937),weathergen.ui.common.px.call(null,((30) + (27)))], null),new cljs.core.Keyword(null,"click","click",1912301393),((function (type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return cljs.core.swap_BANG_.call(null,hidden_QMARK_,cljs.core.not);
});})(type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,new cljs.core.Keyword(null,"title","title",636505583),"Hide",new cljs.core.Keyword(null,"src","src",-1651076051),"images/hide-eye.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),hidden_QMARK_),weathergen.ui.buttons.image_button.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,"bottom","bottom",-1550509018),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"left","left",-399115937),weathergen.ui.common.px.call(null,((30) + ((27) * (2))))], null),new cljs.core.Keyword(null,"click","click",1912301393),((function (type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return cljs.core.swap_BANG_.call(null,annotations,cljs.core.assoc,weathergen.ui.layers.annotations.unique_id.call(null),cljs.core.deref.call(null,annotation));
});})(type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
,new cljs.core.Keyword(null,"title","title",636505583),"Copy",new cljs.core.Keyword(null,"src","src",-1651076051),"images/copy.svg",new cljs.core.Keyword(null,"width","width",-384071477),"16px",new cljs.core.Keyword(null,"height","height",1025178622),"16px"),weathergen.ui.buttons.image_button.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,"bottom","bottom",-1550509018),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"right","right",-452581833),weathergen.ui.common.px.call(null,(5))], 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 (type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission){
return (function (){
return cljs.core.swap_BANG_.call(null,annotations,cljs.core.dissoc,cljs.core.deref.call(null,k));
});})(type,shape_type,editing_QMARK_,hidden_QMARK_,fill_color,filled_QMARK_,open_QMARK_,annotation,vec__36393,_,k,map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
));
});})(map__36374,map__36374__$1,state,annotations,map_viewbox,map_zoom,mission))
))));
});
weathergen.ui.layers.annotations.save_annotations = (function weathergen$ui$layers$annotations$save_annotations(p__36424){
var map__36425 = p__36424;
var map__36425__$1 = (((((!((map__36425 == null))))?(((((map__36425.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36425.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36425):map__36425);
var mission = cljs.core.get.call(null,map__36425__$1,new cljs.core.Keyword(null,"mission","mission",1740288522));
var annotations = cljs.core.get.call(null,map__36425__$1,new cljs.core.Keyword(null,"annotations","annotations",1640956248));
var build_info = cljs.core.get.call(null,map__36425__$1,new cljs.core.Keyword(null,"build-info","build-info",-622713066));
return weathergen.ui.common.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),weathergen.encoding.encode.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"vmt-version","vmt-version",587039393),cljs.core.get.call(null,build_info,"VERSION"),new cljs.core.Keyword(null,"annotations","annotations",1640956248),cljs.core.vals.call(null,cljs.core.deref.call(null,annotations))], null)),new cljs.core.Keyword(null,"title","title",636505583),"Save VMT Annoations",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 Annotations",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["vmta"], null)], null)], null),new cljs.core.Keyword(null,"default-path","default-path",-1046856029),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.filesystem.basename.call(null,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,mission)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"omit-extension?","omit-extension?",-1855127967),true], null))),".vmta"].join('')], null));
});
weathergen.ui.layers.annotations.load_annotations = (function weathergen$ui$layers$annotations$load_annotations(p__36427){
var map__36428 = p__36427;
var map__36428__$1 = (((((!((map__36428 == null))))?(((((map__36428.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36428.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36428):map__36428);
var annotations = cljs.core.get.call(null,map__36428__$1,new cljs.core.Keyword(null,"annotations","annotations",1640956248));
var build_info = cljs.core.get.call(null,map__36428__$1,new cljs.core.Keyword(null,"build-info","build-info",-622713066));
var serialization_messages = cljs.core.get.call(null,map__36428__$1,new cljs.core.Keyword(null,"serialization-messages","serialization-messages",1294708403));
var temp__5720__auto__ = weathergen.ui.common.get_path_for_load.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Load VMT Annotations",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 Annotations",new cljs.core.Keyword(null,"extensions","extensions",-1103629196),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["vmta"], null)], null)], null),new cljs.core.Keyword(null,"default-path","default-path",-1046856029),null], null));
if(cljs.core.truth_(temp__5720__auto__)){
var path = temp__5720__auto__;
var decoded = weathergen.encoding.decode.call(null,weathergen.filesystem.file_text.call(null,path));
var this_version = cljs.core.get.call(null,build_info,"VERSION");
var map__36430 = decoded;
var map__36430__$1 = (((((!((map__36430 == null))))?(((((map__36430.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36430.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36430):map__36430);
var loaded_version = cljs.core.get.call(null,map__36430__$1,new cljs.core.Keyword(null,"vmt-version","vmt-version",587039393));
var loaded_annotations = cljs.core.get.call(null,map__36430__$1,new cljs.core.Keyword(null,"annotations","annotations",1640956248));
cljs.core.swap_BANG_.call(null,annotations,cljs.core.merge,cljs.core.zipmap.call(null,cljs.core.repeatedly.call(null,weathergen.ui.layers.annotations.unique_id),loaded_annotations));

if(cljs.core.not_EQ_.call(null,loaded_version,cljs.core.get.call(null,build_info,"VERSION"))){
return cljs.core.swap_BANG_.call(null,serialization_messages,cljs.core.assoc,weathergen.ui.layers.annotations.unique_id.call(null),["You are running version ",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__4131__auto__ = this_version;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "(no version)";
}
})()),"of VMT, but the loaded annotation file was saved with version ",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__4131__auto__ = loaded_version;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "(no version)";
}
})()),". Using different versions of VMT does not usually cause a problem, but if you see anything unusal in the loaded annotations, this may be the reason."].join(''));
} else {
return null;
}
} else {
return null;
}
});
weathergen.ui.layers.annotations.import_annotations = (function weathergen$ui$layers$annotations$import_annotations(p__36432){
var map__36433 = p__36432;
var map__36433__$1 = (((((!((map__36433 == null))))?(((((map__36433.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36433.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36433):map__36433);
var annotations = cljs.core.get.call(null,map__36433__$1,new cljs.core.Keyword(null,"annotations","annotations",1640956248));
var mission = cljs.core.get.call(null,map__36433__$1,new cljs.core.Keyword(null,"mission","mission",1740288522));
var build_info = cljs.core.get.call(null,map__36433__$1,new cljs.core.Keyword(null,"build-info","build-info",-622713066));
var serialization_messages = cljs.core.get.call(null,map__36433__$1,new cljs.core.Keyword(null,"serialization-messages","serialization-messages",1294708403));
var temp__5720__auto__ = weathergen.ui.common.get_path_for_load.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Choose VMT Briefing",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,"extensions","extensions",-1103629196),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["vmtb"], null)], null)], null),new cljs.core.Keyword(null,"default-path","default-path",-1046856029),null], null));
if(cljs.core.truth_(temp__5720__auto__)){
var path = temp__5720__auto__;
var decoded = weathergen.encoding.decode.call(null,weathergen.compression.decompress.call(null,weathergen.filesystem.file_buffer.call(null,path)));
var map__36435 = decoded;
var map__36435__$1 = (((((!((map__36435 == null))))?(((((map__36435.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36435.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36435):map__36435);
var loaded_version = cljs.core.get.call(null,map__36435__$1,new cljs.core.Keyword(null,"vmt-version","vmt-version",587039393));
var briefing_data = cljs.core.get.call(null,map__36435__$1,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
var annotation_data = cljs.core.get.call(null,map__36435__$1,new cljs.core.Keyword(null,"annotations","annotations",1640956248));
var loaded_install = new cljs.core.Keyword(null,"install-id","install-id",-1310868737).cljs$core$IFn$_invoke$arity$1(briefing_data);
var loaded_theater = new cljs.core.Keyword(null,"theaterdef-name","theaterdef-name",-635231832).cljs$core$IFn$_invoke$arity$1(briefing_data);
var loaded_annotations = new cljs.core.Keyword(null,"annotations","annotations",1640956248).cljs$core$IFn$_invoke$arity$1(annotation_data);
var this_installs = (function (){var temp__5718__auto__ = new cljs.core.Keyword(null,"install-id","install-id",-1310868737).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,mission));
if(cljs.core.truth_(temp__5718__auto__)){
var install_id = temp__5718__auto__;
return cljs.core.PersistentHashSet.createAsIfByAssoc([install_id]);
} else {
return cljs.core.set.call(null,cljs.core.keys.call(null,new cljs.core.Keyword(null,"installs","installs",-915592927).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,mission))));
}
})();
var this_version = cljs.core.get.call(null,build_info,"VERSION");
var this_theater = weathergen.falcon.files.mission.theaterdef_name.call(null,cljs.core.deref.call(null,mission));
console.log("briefing",cljs.core.pr_str.call(null,cljs.core.keys.call(null,briefing_data)));

console.log("annotation-data",cljs.core.pr_str.call(null,annotation_data));

console.log("annotations",cljs.core.count.call(null,loaded_annotations));

if((cljs.core.count.call(null,loaded_annotations) === (0))){
return cljs.core.swap_BANG_.call(null,serialization_messages,cljs.core.assoc,weathergen.ui.layers.annotations.unique_id.call(null),"No annotations were found in the briefing.");
} else {
if(cljs.core._EQ_.call(null,this_theater,loaded_theater)){
} else {
cljs.core.swap_BANG_.call(null,serialization_messages,cljs.core.assoc,weathergen.ui.layers.annotations.unique_id.call(null),["The selected briefing is for theater ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(loaded_theater)," but this mission is for theater ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(this_theater),". The locations of the loaded annotations may therefore be incorrect."].join(''));
}

if(cljs.core.truth_(this_installs.call(null,loaded_install))){
} else {
cljs.core.swap_BANG_.call(null,serialization_messages,cljs.core.assoc,weathergen.ui.layers.annotations.unique_id.call(null),["The imported briefing was saved for installation ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(loaded_install)," but this mission targets ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.util.format_list.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"conjuction","conjuction",-1999183686),"or"], null),this_installs)),". Unexpected results may occur."].join(''));
}

if(cljs.core.not_EQ_.call(null,loaded_version,cljs.core.get.call(null,build_info,"VERSION"))){
cljs.core.swap_BANG_.call(null,serialization_messages,cljs.core.assoc,weathergen.ui.layers.annotations.unique_id.call(null),["You are running version ",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__4131__auto__ = this_version;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "(no version)";
}
})()),"of VMT, but the loaded annotation file was saved with version ",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__4131__auto__ = loaded_version;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "(no version)";
}
})()),". Using different versions of VMT does not usually cause a problem, but if you see anything unusal in the loaded annotations, this may be the reason."].join(''));
} else {
}

return cljs.core.swap_BANG_.call(null,annotations,cljs.core.merge,cljs.core.zipmap.call(null,cljs.core.repeatedly.call(null,weathergen.ui.layers.annotations.unique_id),loaded_annotations));

}
} else {
return null;
}
});
weathergen.ui.layers.annotations.annotation_serialization_section = (function weathergen$ui$layers$annotations$annotation_serialization_section(p__36437){
var map__36438 = p__36437;
var map__36438__$1 = (((((!((map__36438 == null))))?(((((map__36438.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36438.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36438):map__36438);
var state = map__36438__$1;
var annotations = cljs.core.get.call(null,map__36438__$1,new cljs.core.Keyword(null,"annotations","annotations",1640956248));
var mission = cljs.core.get.call(null,map__36438__$1,new cljs.core.Keyword(null,"mission","mission",1740288522));
var messages = javelin.core.cell.call(null,cljs.core.sorted_map.call(null));
var state__$1 = cljs.core.assoc.call(null,state,new cljs.core.Keyword(null,"serialization-messages","serialization-messages",1294708403),messages);
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.ui.layers.annotations.helped.call(null,new cljs.core.Keyword(null,"serialization","serialization",-471429060),"Save/load"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (messages,state__$1,map__36438,map__36438__$1,state,annotations,mission){
return (function (){
return weathergen.ui.layers.annotations.save_annotations.call(null,state__$1);
});})(messages,state__$1,map__36438,map__36438__$1,state,annotations,mission))
,new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181),javelin.core.formula.call(null,((function (messages,state__$1,map__36438,map__36438__$1,state,annotations,mission){
return (function (G__36440,G__36441){
return G__36440.call(null,G__36441);
});})(messages,state__$1,map__36438,map__36438__$1,state,annotations,mission))
).call(null,cljs.core.empty_QMARK_,annotations),"Save"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (messages,state__$1,map__36438,map__36438__$1,state,annotations,mission){
return (function (){
return weathergen.ui.layers.annotations.load_annotations.call(null,state__$1);
});})(messages,state__$1,map__36438,map__36438__$1,state,annotations,mission))
,"Load"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (messages,state__$1,map__36438,map__36438__$1,state,annotations,mission){
return (function (){
return weathergen.ui.layers.annotations.import_annotations.call(null,state__$1);
});})(messages,state__$1,map__36438,map__36438__$1,state,annotations,mission))
,"Import From Briefing"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"annotations","annotations",1640956248),new cljs.core.Keyword(null,"serialization-buttons","serialization-buttons",-1286443653)], null)),weathergen.ui.common.keyed_loop_tpl_STAR_.call(null,messages,cljs.core.key,((function (messages,state__$1,map__36438,map__36438__$1,state,annotations,mission){
return (function (item__15894__auto__){
var vec__36448 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (messages,state__$1,map__36438,map__36438__$1,state,annotations,mission){
return (function (p__36451){
var vec__36452 = p__36451;
var id = cljs.core.nth.call(null,vec__36452,(0),null);
var _ = cljs.core.nth.call(null,vec__36452,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [_,id], null);
});})(messages,state__$1,map__36438,map__36438__$1,state,annotations,mission))
).call(null,item__15894__auto__));
var _ = cljs.core.nth.call(null,vec__36448,(0),null);
var id = cljs.core.nth.call(null,vec__36448,(1),null);
var message = weathergen.ui.common.map_lens.call(null,messages,id);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 7, [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),weathergen.ui.common.px.call(null,(3)),new cljs.core.Keyword(null,"padding","padding",1660304693),weathergen.ui.common.px.call(null,(0),(3))], null),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.Keyword(null,"a","a",-2123407586),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"#ebff00"], null)], 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),weathergen.ui.common.px.call(null,(10))], null),message),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"color","color",1011675173),"#ff6b6b",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(150)),new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"top","top",-1856271961),weathergen.ui.common.px.call(null,(-8)),new cljs.core.Keyword(null,"right","right",-452581833),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer"], null),new cljs.core.Keyword(null,"click","click",1912301393),((function (message,vec__36448,_,id,messages,state__$1,map__36438,map__36438__$1,state,annotations,mission){
return (function (){
return cljs.core.swap_BANG_.call(null,messages,cljs.core.dissoc,cljs.core.deref.call(null,id));
});})(message,vec__36448,_,id,messages,state__$1,map__36438,map__36438__$1,state,annotations,mission))
,"\u00D7"));
});})(messages,state__$1,map__36438,map__36438__$1,state,annotations,mission))
));
});
/**
 * Returns UI for the map annotation controls.
 */
weathergen.ui.layers.annotations.controls = (function weathergen$ui$layers$annotations$controls(state){
return hoplon.core.div.call(null,weathergen.ui.layers.annotations.annotation_serialization_section.call(null,state),weathergen.ui.layers.annotations.annotation_edit_section.call(null,state));
});
/**
 * Creates the annotations layer.
 */
weathergen.ui.layers.annotations.create = (function weathergen$ui$layers$annotations$create(mission,p__36455){
var map__36456 = p__36455;
var map__36456__$1 = (((((!((map__36456 == null))))?(((((map__36456.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__36456.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__36456):map__36456);
var state = map__36456__$1;
var map_viewbox = cljs.core.get.call(null,map__36456__$1,new cljs.core.Keyword(null,"map-viewbox","map-viewbox",860086717));
var map_zoom = cljs.core.get.call(null,map__36456__$1,new cljs.core.Keyword(null,"map-zoom","map-zoom",1543291337));
var state__$1 = cljs.core.assoc.call(null,state,new cljs.core.Keyword(null,"annotations","annotations",1640956248),javelin.core.cell.call(null,cljs.core.sorted_map.call(null)),new cljs.core.Keyword(null,"mission","mission",1740288522),mission);
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"controls-fn","controls-fn",-807620277),((function (state__$1,map__36456,map__36456__$1,state,map_viewbox,map_zoom){
return (function (){
return weathergen.ui.layers.annotations.controls.call(null,state__$1);
});})(state__$1,map__36456,map__36456__$1,state,map_viewbox,map_zoom))
,new cljs.core.Keyword(null,"overlay-fn","overlay-fn",1005125217),((function (state__$1,map__36456,map__36456__$1,state,map_viewbox,map_zoom){
return (function (register_drag_handler){
return weathergen.ui.layers.annotations.overlay.call(null,state__$1,register_drag_handler);
});})(state__$1,map__36456,map__36456__$1,state,map_viewbox,map_zoom))
,new cljs.core.Keyword(null,"state","state",-1988618099),state__$1], null);
});
/**
 * Returns data for saving in a briefing file.
 */
weathergen.ui.layers.annotations.briefing_data = (function weathergen$ui$layers$annotations$briefing_data(layer){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"annotations","annotations",1640956248),cljs.core.map.call(null,(function (p1__36458_SHARP_){
return cljs.core.assoc.call(null,p1__36458_SHARP_,new cljs.core.Keyword(null,"editing?","editing?",1646440800),false);
}),cljs.core.vals.call(null,cljs.core.deref.call(null,new cljs.core.Keyword(null,"annotations","annotations",1640956248).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"state","state",-1988618099).cljs$core$IFn$_invoke$arity$1(layer)))))], null);
});
/**
 * Given briefing data, update the layer with the state from it.
 */
weathergen.ui.layers.annotations.load_briefing_data = (function weathergen$ui$layers$annotations$load_briefing_data(layer,data){
return cljs.core.reset_BANG_.call(null,cljs.core.get_in.call(null,layer,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"state","state",-1988618099),new cljs.core.Keyword(null,"annotations","annotations",1640956248)], null)),cljs.core.into.call(null,cljs.core.sorted_map.call(null),(function (){var G__36459 = data;
var G__36459__$1 = (((G__36459 == null))?null:new cljs.core.Keyword(null,"annotations","annotations",1640956248).cljs$core$IFn$_invoke$arity$1(G__36459));
if((G__36459__$1 == null)){
return null;
} else {
return cljs.core.zipmap.call(null,cljs.core.repeatedly.call(null,weathergen.ui.layers.annotations.unique_id),G__36459__$1);
}
})()));
});
