// Compiled by ClojureScript 1.9.562 {}
goog.provide('hoplon.app_pages._mission_DOT_html');
goog.require('cljs.core');
goog.require('weathergen.ipc');
goog.require('weathergen.progress');
goog.require('weathergen.ui');
goog.require('taoensso.timbre');
goog.require('javelin.core');
goog.require('hoplon.jquery');
goog.require('hoplon.core');
hoplon.app_pages._mission_DOT_html.make_progress_reporter = (function hoplon$app_pages$_mission_DOT_html$make_progress_reporter(){
if(typeof hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50569 !== 'undefined'){
} else {

/**
* @constructor
 * @implements {weathergen.progress.Reporter}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50569 = (function (meta50570){
this.meta50570 = meta50570;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50569.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_50571,meta50570__$1){
var self__ = this;
var _50571__$1 = this;
return (new hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50569(meta50570__$1));
});

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50569.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_50571){
var self__ = this;
var _50571__$1 = this;
return self__.meta50570;
});

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50569.prototype.weathergen$progress$Reporter$ = cljs.core.PROTOCOL_SENTINEL;

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50569.prototype.weathergen$progress$Reporter$_start_step$arity$3 = (function (this$,step_name,parent){
var self__ = this;
var this$__$1 = this;
var step_id = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.gensym.call(null))].join('');
weathergen.ipc.send_to_main.call(null,"load-step-started",new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",-1388402092),step_id,new cljs.core.Keyword(null,"name","name",1843675177),step_name,new cljs.core.Keyword(null,"parent","parent",-878878779),(cljs.core.truth_(parent)?weathergen.progress._id.call(null,parent):null)], null));

if(typeof hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572 !== 'undefined'){
} else {

/**
* @constructor
 * @implements {weathergen.progress.Step}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572 = (function (meta50570,this$,step_name,parent,step_id,meta50573){
this.meta50570 = meta50570;
this.this$ = this$;
this.step_name = step_name;
this.parent = parent;
this.step_id = step_id;
this.meta50573 = meta50573;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
})
hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (step_id,this$__$1){
return (function (_50574,meta50573__$1){
var self__ = this;
var _50574__$1 = this;
return (new hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572(self__.meta50570,self__.this$,self__.step_name,self__.parent,self__.step_id,meta50573__$1));
});})(step_id,this$__$1))
;

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (step_id,this$__$1){
return (function (_50574){
var self__ = this;
var _50574__$1 = this;
return self__.meta50573;
});})(step_id,this$__$1))
;

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572.prototype.weathergen$progress$Step$ = cljs.core.PROTOCOL_SENTINEL;

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572.prototype.weathergen$progress$Step$_id$arity$1 = ((function (step_id,this$__$1){
return (function (this$__$1){
var self__ = this;
var this$__$2 = this;
return self__.step_id;
});})(step_id,this$__$1))
;

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572.prototype.weathergen$progress$Step$_succeeded$arity$1 = ((function (step_id,this$__$1){
return (function (this$__$1){
var self__ = this;
var this$__$2 = this;
return weathergen.ipc.send_to_main.call(null,"load-step-succeeded",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"id","id",-1388402092),self__.step_id], null));
});})(step_id,this$__$1))
;

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572.prototype.weathergen$progress$Step$_warn$arity$2 = ((function (step_id,this$__$1){
return (function (this$__$1,message){
var self__ = this;
var this$__$2 = this;
return weathergen.ipc.send_to_main.call(null,"load-step-warning",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",-1388402092),self__.step_id,new cljs.core.Keyword(null,"message","message",-406056002),message], null));
});})(step_id,this$__$1))
;

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572.prototype.weathergen$progress$Step$_failed$arity$2 = ((function (step_id,this$__$1){
return (function (this$__$1,message){
var self__ = this;
var this$__$2 = this;
return weathergen.ipc.send_to_main.call(null,"load-step-failed",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",-1388402092),self__.step_id,new cljs.core.Keyword(null,"message","message",-406056002),message], null));
});})(step_id,this$__$1))
;

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572.getBasis = ((function (step_id,this$__$1){
return (function (){
return new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta50570","meta50570",-1755914916,null),cljs.core.with_meta(new cljs.core.Symbol(null,"this","this",1028897902,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tag","tag",-1290361223),new cljs.core.Symbol("hoplon.app-pages._mission_DOT_html","t_hoplon$app_pages$_mission_DOT_html50569","hoplon.app-pages._mission_DOT_html/t_hoplon$app_pages$_mission_DOT_html50569",440921527,null)], null)),new cljs.core.Symbol(null,"step-name","step-name",1827656920,null),new cljs.core.Symbol(null,"parent","parent",761652748,null),new cljs.core.Symbol(null,"step-id","step-id",-1941481725,null),new cljs.core.Symbol(null,"meta50573","meta50573",1982309134,null)], null);
});})(step_id,this$__$1))
;

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572.cljs$lang$type = true;

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572.cljs$lang$ctorStr = "hoplon.app-pages._mission_DOT_html/t_hoplon$app_pages$_mission_DOT_html50572";

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572.cljs$lang$ctorPrWriter = ((function (step_id,this$__$1){
return (function (this__23995__auto__,writer__23996__auto__,opt__23997__auto__){
return cljs.core._write.call(null,writer__23996__auto__,"hoplon.app-pages._mission_DOT_html/t_hoplon$app_pages$_mission_DOT_html50572");
});})(step_id,this$__$1))
;

hoplon.app_pages._mission_DOT_html.__GT_t_hoplon$app_pages$_mission_DOT_html50572 = ((function (step_id,this$__$1){
return (function hoplon$app_pages$_mission_DOT_html$make_progress_reporter_$___GT_t_hoplon$app_pages$_mission_DOT_html50572(meta50570__$1,this$__$2,step_name__$1,parent__$1,step_id__$1,meta50573){
return (new hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572(meta50570__$1,this$__$2,step_name__$1,parent__$1,step_id__$1,meta50573));
});})(step_id,this$__$1))
;

}

return (new hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50572(self__.meta50570,this$__$1,step_name,parent,step_id,cljs.core.PersistentArrayMap.EMPTY));
});

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50569.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta50570","meta50570",-1755914916,null)], null);
});

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50569.cljs$lang$type = true;

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50569.cljs$lang$ctorStr = "hoplon.app-pages._mission_DOT_html/t_hoplon$app_pages$_mission_DOT_html50569";

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50569.cljs$lang$ctorPrWriter = (function (this__23995__auto__,writer__23996__auto__,opt__23997__auto__){
return cljs.core._write.call(null,writer__23996__auto__,"hoplon.app-pages._mission_DOT_html/t_hoplon$app_pages$_mission_DOT_html50569");
});

hoplon.app_pages._mission_DOT_html.__GT_t_hoplon$app_pages$_mission_DOT_html50569 = (function hoplon$app_pages$_mission_DOT_html$make_progress_reporter_$___GT_t_hoplon$app_pages$_mission_DOT_html50569(meta50570){
return (new hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50569(meta50570));
});

}

return (new hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50569(cljs.core.PersistentArrayMap.EMPTY));
});
cljs.core._add_method.call(null,weathergen.ipc.on_message,"open-mission",(function (_,event,installations,path){
try{var _STAR_reporter_STAR_50576_50577 = weathergen.progress._STAR_reporter_STAR_;
weathergen.progress._STAR_reporter_STAR_ = hoplon.app_pages._mission_DOT_html.make_progress_reporter.call(null);

try{taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"hoplon.app-pages._mission_DOT_html",null,35,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (_STAR_reporter_STAR_50576_50577){
return (function (){
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, ["open-mission",new cljs.core.Keyword(null,"installations","installations",-2091217739),installations,new cljs.core.Keyword(null,"path","path",-188191168),path], null);
});})(_STAR_reporter_STAR_50576_50577))
,null)),null,1134136628);

weathergen.ui.load_mission.call(null,installations,path);
}finally {weathergen.progress._STAR_reporter_STAR_ = _STAR_reporter_STAR_50576_50577;
}
return weathergen.ipc.send_to_main.call(null,"load-complete");
}catch (e50575){var e = e50575;
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"error","error",-978969032),"hoplon.app-pages._mission_DOT_html",null,39,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (e){
return (function (){
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [e,"Load failed",new cljs.core.Keyword(null,"stack","stack",-793405930),e.stack], null);
});})(e))
,null)),null,62435757);

return weathergen.ipc.send_to_main.call(null,"load-failed",((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(cljs.core.ex_data.call(null,e)),new cljs.core.Keyword("weathergen.progress","propagated-error","weathergen.progress/propagated-error",1931683700)))?null:e.stack));
}}));
cljs.core._add_method.call(null,weathergen.ipc.on_message,"open-briefing",(function (_,event,installations,path){
try{var _STAR_reporter_STAR_50579_50580 = weathergen.progress._STAR_reporter_STAR_;
weathergen.progress._STAR_reporter_STAR_ = hoplon.app_pages._mission_DOT_html.make_progress_reporter.call(null);

try{taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"hoplon.app-pages._mission_DOT_html",null,48,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (_STAR_reporter_STAR_50579_50580){
return (function (){
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, ["open-mission",new cljs.core.Keyword(null,"installations","installations",-2091217739),installations,new cljs.core.Keyword(null,"path","path",-188191168),path], null);
});})(_STAR_reporter_STAR_50579_50580))
,null)),null,1932030574);

weathergen.ui.load_briefing.call(null,installations,path);
}finally {weathergen.progress._STAR_reporter_STAR_ = _STAR_reporter_STAR_50579_50580;
}
return weathergen.ipc.send_to_main.call(null,"load-complete");
}catch (e50578){var e = e50578;
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"error","error",-978969032),"hoplon.app-pages._mission_DOT_html",null,52,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (e){
return (function (){
return new cljs.core.PersistentVector(null, 8, 5, cljs.core.PersistentVector.EMPTY_NODE, [e,"Load failed",new cljs.core.Keyword(null,"ex-data","ex-data",-309040259),cljs.core.ex_data.call(null,e),new cljs.core.Keyword(null,"propagated?","propagated?",-1087520388),cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(cljs.core.ex_data.call(null,e)),new cljs.core.Keyword("weathergen.progress","propagated-error","weathergen.progress/propagated-error",1931683700)),new cljs.core.Keyword(null,"stack","stack",-793405930),e.stack], null);
});})(e))
,null)),null,1085832678);

return weathergen.ipc.send_to_main.call(null,"load-failed",((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(cljs.core.ex_data.call(null,e)),new cljs.core.Keyword("weathergen.progress","propagated-error","weathergen.progress/propagated-error",1931683700)))?null:e.stack));
}}));
cljs.core.reset_BANG_.call(null,weathergen.ui.weather_params,weathergen.ui.default_weather_params);
if(cljs.core.truth_(weathergen.ui.safari_QMARK_)){
cljs.core.swap_BANG_.call(null,weathergen.ui.messages,cljs.core.conj,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Due to bugs related to downloading files in Safari, Safari\n  is not recommended for use with WeatherGen. To use Safari, make use\n  of the workarounds detailed below. Use of Chrome is recommended."], null));
} else {
}
if(cljs.core.truth_(weathergen.ui.ie_QMARK_)){
cljs.core.swap_BANG_.call(null,weathergen.ui.messages,cljs.core.conj,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Unfortunately, the weather design features of\n         WeatherGen (i.e. this page) do not currently work correctly\n         in Internet Explorer. Shared forecasts work fine, so forecast\n         links can be shared with pilots using IE. Use of Chrome is\n         recommended."], null));
} else {
}
weathergen.ui.weather_page.call(null,new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Mission",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"mission-info","mission-info",1263062521),new cljs.core.Keyword(null,"sections","sections",-886710106),new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"mission-info-section","mission-info-section",1401749344),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"save-briefing-section","save-briefing-section",143974425),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"briefing-notes-section","briefing-notes-section",1870993417),cljs.core.PersistentArrayMap.EMPTY], null)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Map",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"sections","sections",-886710106),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls-section","map-controls-section",684229466),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"weather-display-controls","weather-display-controls",941597221),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"title","title",636505583),"Weather Display Options"], null)], null)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Air Forces",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"sections","sections",-886710106),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces-section","air-forces-section",-222064121),cljs.core.PersistentArrayMap.EMPTY], null)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Flights",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"flights","flights",-1637719124),new cljs.core.Keyword(null,"sections","sections",-886710106),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"flights-section","flights-section",1247077532),cljs.core.PersistentArrayMap.EMPTY], null)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Weather",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"weather","weather",1320452344),new cljs.core.Keyword(null,"sections","sections",-886710106),new cljs.core.PersistentVector(null, 20, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"step-controls","step-controls",-854420677),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"weather-display-controls","weather-display-controls",941597221),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"weather-parameters","weather-parameters",-1852076459),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"forecast-section","forecast-section",-1278731643),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"forecast-link?","forecast-link?",93596965),false], null),new cljs.core.Keyword(null,"weather-type-configuration","weather-type-configuration",-358032997),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"cloud-controls","cloud-controls",817145581),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"wind-stability-parameters","wind-stability-parameters",1572956177),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"weather-override-parameters","weather-override-parameters",491414981),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"advanced-controls","advanced-controls",-278238996),cljs.core.PersistentArrayMap.EMPTY], null)], null)], null));
