// 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_html50571 !== '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_html50571 = (function (meta50572){
this.meta50572 = meta50572;
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_html50571.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_50573,meta50572__$1){
var self__ = this;
var _50573__$1 = this;
return (new hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50571(meta50572__$1));
});

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50571.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_50573){
var self__ = this;
var _50573__$1 = this;
return self__.meta50572;
});

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

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50571.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_html50574 !== '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_html50574 = (function (meta50572,this$,step_name,parent,step_id,meta50575){
this.meta50572 = meta50572;
this.this$ = this$;
this.step_name = step_name;
this.parent = parent;
this.step_id = step_id;
this.meta50575 = meta50575;
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_html50574.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (step_id,this$__$1){
return (function (_50576,meta50575__$1){
var self__ = this;
var _50576__$1 = this;
return (new hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50574(self__.meta50572,self__.this$,self__.step_name,self__.parent,self__.step_id,meta50575__$1));
});})(step_id,this$__$1))
;

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50574.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (step_id,this$__$1){
return (function (_50576){
var self__ = this;
var _50576__$1 = this;
return self__.meta50575;
});})(step_id,this$__$1))
;

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

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50574.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_html50574.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_html50574.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_html50574.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_html50574.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,"meta50572","meta50572",-1456112769,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_html50571","hoplon.app-pages._mission_DOT_html/t_hoplon$app_pages$_mission_DOT_html50571",1461869007,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,"meta50575","meta50575",1065421474,null)], null);
});})(step_id,this$__$1))
;

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

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

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50574.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_html50574");
});})(step_id,this$__$1))
;

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

}

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

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

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

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

hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50571.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_html50571");
});

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

}

return (new hoplon.app_pages._mission_DOT_html.t_hoplon$app_pages$_mission_DOT_html50571(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_50578_50579 = 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_50578_50579){
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_50578_50579))
,null)),null,-1529158630);

weathergen.ui.load_mission.call(null,installations,path);
}finally {weathergen.progress._STAR_reporter_STAR_ = _STAR_reporter_STAR_50578_50579;
}
return weathergen.ipc.send_to_main.call(null,"load-complete");
}catch (e50577){var e = e50577;
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,-869656829);

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_50581_50582 = 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_50581_50582){
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_50581_50582))
,null)),null,-1871190035);

weathergen.ui.load_briefing.call(null,installations,path);
}finally {weathergen.progress._STAR_reporter_STAR_ = _STAR_reporter_STAR_50581_50582;
}
return weathergen.ipc.send_to_main.call(null,"load-complete");
}catch (e50580){var e = e50580;
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,931970022);

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));
