// Compiled by ClojureScript 0.0-2138
goog.provide('lt.objs.plugins');
goog.require('cljs.core');
goog.require('crate.binding');
goog.require('lt.util.js');
goog.require('lt.objs.app');
goog.require('lt.objs.files');
goog.require('lt.objs.settings');
goog.require('clojure.walk');
goog.require('lt.util.js');
goog.require('lt.util.dom');
goog.require('lt.objs.context');
goog.require('lt.objs.platform');
goog.require('lt.objs.tabs');
goog.require('lt.objs.popup');
goog.require('lt.objs.popup');
goog.require('cljs.reader');
goog.require('crate.core');
goog.require('lt.objs.context');
goog.require('lt.objs.notifos');
goog.require('lt.objs.notifos');
goog.require('lt.util.dom');
goog.require('lt.objs.editor.pool');
goog.require('clojure.string');
goog.require('lt.util.kahn');
goog.require('clojure.walk');
goog.require('lt.objs.command');
goog.require('lt.objs.platform');
goog.require('lt.objs.files');
goog.require('clojure.set');
goog.require('lt.objs.settings');
goog.require('lt.objs.app');
goog.require('lt.util.kahn');
goog.require('lt.util.load');
goog.require('clojure.string');
goog.require('lt.objs.deploy');
goog.require('crate.binding');
goog.require('lt.object');
goog.require('cljs.reader');
goog.require('lt.object');
goog.require('clojure.set');
goog.require('lt.util.load');
goog.require('lt.objs.console');
goog.require('lt.objs.tabs');
goog.require('lt.objs.console');
goog.require('crate.core');
goog.require('lt.objs.editor.pool');
goog.require('lt.objs.command');
goog.require('fetch.core');
goog.require('lt.objs.deploy');
goog.require('fetch.core');
lt.objs.plugins.plugins_dir = lt.objs.files.lt_home.call(null,"plugins");
lt.objs.plugins.user_plugins_dir = lt.objs.files.lt_user_dir.call(null,"plugins");
lt.objs.plugins._STAR_plugin_dir_STAR_ = null;
lt.objs.plugins.EOF_read = (function EOF_read(s){if(cljs.core.truth_((function (){var and__3508__auto__ = s;if(cljs.core.truth_(and__3508__auto__))
{return cljs.core.seq.call(null,s);
} else
{return and__3508__auto__;
}
})()))
{return cljs.reader.read_string.call(null,s);
} else
{return null;
}
});
lt.objs.plugins.munge_plugin_name = (function munge_plugin_name(n){if(cljs.core.truth_(n))
{return clojure.string.replace.call(null,clojure.string.replace.call(null,clojure.string.replace.call(null,n," ","_"),"-","_"),".","_");
} else
{return null;
}
});
lt.objs.plugins.adjust_path = (function adjust_path(path){if(lt.objs.files.absolute_QMARK_.call(null,path))
{return path;
} else
{return lt.objs.files.join.call(null,(function (){var or__3520__auto__ = new cljs.core.Keyword("lt.objs.plugins","dir","lt.objs.plugins/dir",3366558592).cljs$core$IFn$_invoke$arity$1(lt.object._STAR_behavior_meta_STAR_);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return lt.objs.files.lt_home.call(null);
}
})(),path);
}
});
lt.objs.plugins.find_plugin = (function find_plugin(plugin_name){var plugin_name__$1 = lt.objs.plugins.munge_plugin_name.call(null,plugin_name);if(cljs.core.truth_(new cljs.core.Keyword("lt.objs.plugins","dir","lt.objs.plugins/dir",3366558592).cljs$core$IFn$_invoke$arity$1(lt.object._STAR_behavior_meta_STAR_)))
{return new cljs.core.Keyword("lt.objs.plugins","dir","lt.objs.plugins/dir",3366558592).cljs$core$IFn$_invoke$arity$1(lt.object._STAR_behavior_meta_STAR_);
} else
{if(cljs.core.truth_(lt.objs.files.exists_QMARK_.call(null,lt.objs.files.join.call(null,lt.objs.plugins.user_plugins_dir,plugin_name__$1))))
{return lt.objs.files.join.call(null,lt.objs.plugins.user_plugins_dir,plugin_name__$1);
} else
{if(cljs.core.truth_(lt.objs.files.exists_QMARK_.call(null,lt.objs.files.join.call(null,lt.objs.plugins.plugins_dir,plugin_name__$1))))
{return lt.objs.files.join.call(null,lt.objs.plugins.plugins_dir,plugin_name__$1);
} else
{if(new cljs.core.Keyword(null,"else","else",1017020587))
{return null;
} else
{return null;
}
}
}
}
});
lt.objs.plugins.local_module = (function local_module(plugin_name,module_name){var temp__4092__auto__ = lt.objs.plugins.find_plugin.call(null,plugin_name);if(cljs.core.truth_(temp__4092__auto__))
{var plugin_path = temp__4092__auto__;return lt.objs.files.join.call(null,plugin_path,"node_modules",module_name);
} else
{return null;
}
});
lt.objs.plugins.by_name = (function by_name(plugin_name){return cljs.core.get.call(null,new cljs.core.Keyword("lt.objs.plugins","plugins","lt.objs.plugins/plugins",2920328683).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.app.app)),plugin_name);
});
lt.objs.plugins.installed_QMARK_ = (function installed_QMARK_(plugin_name){return cljs.core.boolean$.call(null,lt.objs.plugins.by_name.call(null,plugin_name));
});
lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"build","build",1107999200),new cljs.core.Keyword(null,"desc","desc",1016984067),"Editor: build file or project",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){var temp__4092__auto__ = lt.objs.editor.pool.last_active.call(null);if(cljs.core.truth_(temp__4092__auto__))
{var ed = temp__4092__auto__;return lt.object.raise.call(null,ed,new cljs.core.Keyword(null,"build","build",1107999200));
} else
{return null;
}
})], null));
lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"behaviors.force-reload","behaviors.force-reload",1611218586),new cljs.core.Keyword(null,"desc","desc",1016984067),"Plugins: Ignore cache and force reload the current behaviors file",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){var temp__4092__auto__ = lt.objs.editor.pool.last_active.call(null);if(cljs.core.truth_(temp__4092__auto__))
{var ed = temp__4092__auto__;if(cljs.core.truth_(lt.object.has_tag_QMARK_.call(null,ed,new cljs.core.Keyword(null,"editor.behaviors","editor.behaviors",2095045778))))
{cljs.core.swap_BANG_.call(null,lt.objs.plugins.manager,cljs.core.update_in,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("lt.objs.plugins","force-reload","lt.objs.plugins/force-reload",4731263182)], null),(function (p1__10341_SHARP_){return cljs.core.conj.call(null,(function (){var or__3520__auto__ = p1__10341_SHARP_;if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return cljs.core.PersistentHashSet.EMPTY;
}
})(),cljs.core.get_in.call(null,cljs.core.deref.call(null,ed),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"info","info",1017141280),new cljs.core.Keyword(null,"path","path",1017337751)], null)));
}));
return lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"behaviors.reload","behaviors.reload",2942796600));
} else
{return null;
}
} else
{return null;
}
})], null));
lt.objs.plugins.validate = (function validate(plugin,filename){var valid_QMARK_ = cljs.core.every_QMARK_.call(null,plugin,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"name","name",1017277949),new cljs.core.Keyword(null,"author","author",3902543101),new cljs.core.Keyword(null,"behaviors","behaviors",607554515),new cljs.core.Keyword(null,"desc","desc",1016984067)], null));if(!(valid_QMARK_))
{lt.objs.console.error.call(null,[cljs.core.str("Invalid "),cljs.core.str(filename),cljs.core.str(" file: "),cljs.core.str(new cljs.core.Keyword(null,"dir","dir",1014003711).cljs$core$IFn$_invoke$arity$1(plugin)),cljs.core.str("/"),cljs.core.str(filename),cljs.core.str("\nPlugins "),cljs.core.str("must include values for name, version, author, behaviors, and desc.")].join(''));
return null;
} else
{return plugin;
}
});
lt.objs.plugins.plugin_edn = (function plugin_edn(dir){var file = lt.objs.files.join.call(null,dir,"plugin.edn");var temp__4092__auto__ = (function (){var and__3508__auto__ = lt.objs.files.exists_QMARK_.call(null,file);if(cljs.core.truth_(and__3508__auto__))
{return lt.objs.files.open_sync.call(null,file);
} else
{return and__3508__auto__;
}
})();if(cljs.core.truth_(temp__4092__auto__))
{var content = temp__4092__auto__;try{return lt.objs.plugins.validate.call(null,cljs.core.assoc.call(null,lt.objs.plugins.EOF_read.call(null,new cljs.core.Keyword(null,"content","content",1965434859).cljs$core$IFn$_invoke$arity$1(content)),new cljs.core.Keyword(null,"dir","dir",1014003711),dir),"plugin.edn");
}catch (e10343){var e = e10343;return lt.objs.console.error.call(null,[cljs.core.str("FAILED to load plugin.edn: "),cljs.core.str(dir)].join(''));
}} else
{return null;
}
});
lt.objs.plugins.plugin_json = (function plugin_json(dir){var file = lt.objs.files.join.call(null,dir,"plugin.json");var temp__4092__auto__ = (function (){var and__3508__auto__ = lt.objs.files.exists_QMARK_.call(null,file);if(cljs.core.truth_(and__3508__auto__))
{return lt.objs.files.open_sync.call(null,file);
} else
{return and__3508__auto__;
}
})();if(cljs.core.truth_(temp__4092__auto__))
{var content = temp__4092__auto__;return lt.objs.plugins.validate.call(null,cljs.core.assoc.call(null,cljs.core.js__GT_clj.call(null,JSON.parse(new cljs.core.Keyword(null,"content","content",1965434859).cljs$core$IFn$_invoke$arity$1(content)),new cljs.core.Keyword(null,"keywordize-keys","keywordize-keys",4191781672),true),new cljs.core.Keyword(null,"dir","dir",1014003711),dir),"plugin.json");
} else
{return null;
}
});
lt.objs.plugins.plugin_info = (function plugin_info(dir){var or__3520__auto__ = lt.objs.plugins.plugin_json.call(null,dir);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return lt.objs.plugins.plugin_edn.call(null,dir);
}
});
lt.objs.plugins.missing_deps = (function missing_deps(all){var deps = cljs.core.mapcat.call(null,cljs.core.comp.call(null,cljs.core.seq,new cljs.core.Keyword(null,"dependencies","dependencies",1517678747)),cljs.core.vals.call(null,all));return cljs.core.seq.call(null,cljs.core.vals.call(null,cljs.core.persistent_BANG_.call(null,cljs.core.reduce.call(null,(function (final$,p__10346){var vec__10347 = p__10346;var name = cljs.core.nth.call(null,vec__10347,0,null);var version = cljs.core.nth.call(null,vec__10347,1,null);var name__$1 = cljs.core.name.call(null,name);var temp__4090__auto__ = (function (){var or__3520__auto__ = cljs.core.get.call(null,all,name__$1);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return cljs.core.get.call(null,final$,name__$1);
}
})();if(cljs.core.truth_(temp__4090__auto__))
{var cur = temp__4090__auto__;if(lt.objs.deploy.is_newer_QMARK_.call(null,new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(cur),version))
{return cljs.core.assoc_BANG_.call(null,final$,name__$1,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1017277949),name__$1,new cljs.core.Keyword(null,"version","version",1365512266),version], null));
} else
{return final$;
}
} else
{return cljs.core.assoc_BANG_.call(null,final$,name__$1,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1017277949),name__$1,new cljs.core.Keyword(null,"version","version",1365512266),version], null));
}
}),cljs.core.transient$.call(null,cljs.core.PersistentArrayMap.EMPTY),deps))));
});
lt.objs.plugins.outdated_QMARK_ = (function outdated_QMARK_(plugin){var cached = new cljs.core.Keyword(null,"latest-version","latest-version",1676217348).cljs$core$IFn$_invoke$arity$1(cljs.core.get.call(null,new cljs.core.Keyword(null,"server-plugins","server-plugins",1760987784).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.plugins.manager)),new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin)));if(cljs.core.truth_(cached))
{return lt.objs.deploy.is_newer_QMARK_.call(null,new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(plugin),cached);
} else
{return null;
}
});
lt.objs.plugins.plugin_behaviors = (function plugin_behaviors(plug){if(cljs.core.seq.call(null,plug))
{try{var map__10351 = plug;var map__10351__$1 = ((cljs.core.seq_QMARK_.call(null,map__10351))?cljs.core.apply.call(null,cljs.core.hash_map,map__10351):map__10351);var dir = cljs.core.get.call(null,map__10351__$1,new cljs.core.Keyword(null,"dir","dir",1014003711));var behaviors = cljs.core.get.call(null,map__10351__$1,new cljs.core.Keyword(null,"behaviors","behaviors",607554515));var file = lt.objs.files.join.call(null,dir,behaviors);var file__$1 = lt.objs.files.real_path.call(null,file);var behs = lt.objs.settings.parse_file.call(null,file__$1);var force_QMARK_ = cljs.core.get.call(null,new cljs.core.Keyword("lt.objs.plugins","force-reload","lt.objs.plugins/force-reload",4731263182).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.plugins.manager)),file__$1);if(cljs.core.truth_(force_QMARK_))
{cljs.core.swap_BANG_.call(null,lt.objs.plugins.manager,cljs.core.update_in,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("lt.objs.plugins","force-reload","lt.objs.plugins/force-reload",4731263182)], null),cljs.core.disj,file__$1);
} else
{}
if(cljs.core.truth_(behs))
{clojure.walk.prewalk.call(null,(function (x){if(cljs.core.coll_QMARK_.call(null,x))
{cljs.core.alter_meta_BANG_.call(null,x,cljs.core.assoc,new cljs.core.Keyword("lt.objs.plugins","dir","lt.objs.plugins/dir",3366558592),dir,new cljs.core.Keyword("lt.objs.plugins","force-reload","lt.objs.plugins/force-reload",4731263182),force_QMARK_);
} else
{}
return x;
}),behs);
return behs;
} else
{return null;
}
}catch (e10350){var e = e10350;lt.objs.console.error.call(null,[cljs.core.str("Could not load behaviors for plugin: "),cljs.core.str(new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plug))].join(''));
return cljs.core.PersistentArrayMap.EMPTY;
}} else
{return null;
}
});
lt.objs.plugins.plugin_dependency_graph = (function plugin_dependency_graph(plugins){return cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,(function (){var iter__4231__auto__ = (function iter__10360(s__10361){return (new cljs.core.LazySeq(null,(function (){var s__10361__$1 = s__10361;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__10361__$1);if(temp__4092__auto__)
{var s__10361__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__10361__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10361__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10363 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10362 = 0;while(true){
if((i__10362 < size__4230__auto__))
{var vec__10366 = cljs.core._nth.call(null,c__4229__auto__,i__10362);var nme = cljs.core.nth.call(null,vec__10366,0,null);var v = cljs.core.nth.call(null,vec__10366,1,null);cljs.core.chunk_append.call(null,b__10363,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [nme,cljs.core.set.call(null,cljs.core.map.call(null,cljs.core.name,cljs.core.keys.call(null,new cljs.core.Keyword(null,"dependencies","dependencies",1517678747).cljs$core$IFn$_invoke$arity$1(v))))], null));
{
var G__10368 = (i__10362 + 1);
i__10362 = G__10368;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10363),iter__10360.call(null,cljs.core.chunk_rest.call(null,s__10361__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10363),null);
}
} else
{var vec__10367 = cljs.core.first.call(null,s__10361__$2);var nme = cljs.core.nth.call(null,vec__10367,0,null);var v = cljs.core.nth.call(null,vec__10367,1,null);return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [nme,cljs.core.set.call(null,cljs.core.map.call(null,cljs.core.name,cljs.core.keys.call(null,new cljs.core.Keyword(null,"dependencies","dependencies",1517678747).cljs$core$IFn$_invoke$arity$1(v))))], null),iter__10360.call(null,cljs.core.rest.call(null,s__10361__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,plugins);
})());
});
lt.objs.plugins.find_cycles = (function find_cycles(cur,p__10369){var map__10375 = p__10369;var map__10375__$1 = ((cljs.core.seq_QMARK_.call(null,map__10375))?cljs.core.apply.call(null,cljs.core.hash_map,map__10375):map__10375);var state = map__10375__$1;var graph = cljs.core.get.call(null,map__10375__$1,new cljs.core.Keyword(null,"graph","graph",1112519872));var stack = cljs.core.get.call(null,map__10375__$1,new cljs.core.Keyword(null,"stack","stack",1123661306));var root = cljs.core.get.call(null,map__10375__$1,new cljs.core.Keyword(null,"root","root",1017410644));var seen = cljs.core.get.call(null,map__10375__$1,new cljs.core.Keyword(null,"seen","seen",1017430509));return cljs.core.first.call(null,cljs.core.filter.call(null,cljs.core.identity,(function (){var iter__4231__auto__ = (function iter__10376(s__10377){return (new cljs.core.LazySeq(null,(function (){var s__10377__$1 = s__10377;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__10377__$1);if(temp__4092__auto__)
{var s__10377__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__10377__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10377__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10379 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10378 = 0;while(true){
if((i__10378 < size__4230__auto__))
{var c = cljs.core._nth.call(null,c__4229__auto__,i__10378);cljs.core.chunk_append.call(null,b__10379,((cljs.core._EQ_.call(null,c,root))?cljs.core.conj.call(null,stack,c):find_cycles.call(null,cljs.core.get.call(null,graph,c),cljs.core.update_in.call(null,cljs.core.update_in.call(null,state,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stack","stack",1123661306)], null),cljs.core.conj,c),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"seen","seen",1017430509)], null),cljs.core.conj,c))));
{
var G__10380 = (i__10378 + 1);
i__10378 = G__10380;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10379),iter__10376.call(null,cljs.core.chunk_rest.call(null,s__10377__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10379),null);
}
} else
{var c = cljs.core.first.call(null,s__10377__$2);return cljs.core.cons.call(null,((cljs.core._EQ_.call(null,c,root))?cljs.core.conj.call(null,stack,c):find_cycles.call(null,cljs.core.get.call(null,graph,c),cljs.core.update_in.call(null,cljs.core.update_in.call(null,state,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stack","stack",1123661306)], null),cljs.core.conj,c),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"seen","seen",1017430509)], null),cljs.core.conj,c))),iter__10376.call(null,cljs.core.rest.call(null,s__10377__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,cljs.core.remove.call(null,seen,cur));
})()));
});
lt.objs.plugins.__GT_cycles = (function __GT_cycles(graph){return cljs.core.filterv.call(null,cljs.core.identity,(function (){var iter__4231__auto__ = (function iter__10389(s__10390){return (new cljs.core.LazySeq(null,(function (){var s__10390__$1 = s__10390;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__10390__$1);if(temp__4092__auto__)
{var s__10390__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__10390__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10390__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10392 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10391 = 0;while(true){
if((i__10391 < size__4230__auto__))
{var vec__10395 = cljs.core._nth.call(null,c__4229__auto__,i__10391);var root = cljs.core.nth.call(null,vec__10395,0,null);var deps = cljs.core.nth.call(null,vec__10395,1,null);var stack = lt.objs.plugins.find_cycles.call(null,deps,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"seen","seen",1017430509),cljs.core.PersistentHashSet.EMPTY,new cljs.core.Keyword(null,"stack","stack",1123661306),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [root], null),new cljs.core.Keyword(null,"graph","graph",1112519872),graph,new cljs.core.Keyword(null,"root","root",1017410644),root], null));cljs.core.chunk_append.call(null,b__10392,stack);
{
var G__10397 = (i__10391 + 1);
i__10391 = G__10397;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10392),iter__10389.call(null,cljs.core.chunk_rest.call(null,s__10390__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10392),null);
}
} else
{var vec__10396 = cljs.core.first.call(null,s__10390__$2);var root = cljs.core.nth.call(null,vec__10396,0,null);var deps = cljs.core.nth.call(null,vec__10396,1,null);var stack = lt.objs.plugins.find_cycles.call(null,deps,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"seen","seen",1017430509),cljs.core.PersistentHashSet.EMPTY,new cljs.core.Keyword(null,"stack","stack",1123661306),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [root], null),new cljs.core.Keyword(null,"graph","graph",1112519872),graph,new cljs.core.Keyword(null,"root","root",1017410644),root], null));return cljs.core.cons.call(null,stack,iter__10389.call(null,cljs.core.rest.call(null,s__10390__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,graph);
})());
});
lt.objs.plugins.cycle_desc = (function cycle_desc(cycles){var iter__4231__auto__ = (function iter__10402(s__10403){return (new cljs.core.LazySeq(null,(function (){var s__10403__$1 = s__10403;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__10403__$1);if(temp__4092__auto__)
{var s__10403__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__10403__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10403__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10405 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10404 = 0;while(true){
if((i__10404 < size__4230__auto__))
{var cycle = cljs.core._nth.call(null,c__4229__auto__,i__10404);cljs.core.chunk_append.call(null,b__10405,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),cljs.core.reduce.call(null,cljs.core.str,cljs.core.interpose.call(null," => ",cycle))], null));
{
var G__10406 = (i__10404 + 1);
i__10404 = G__10406;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10405),iter__10402.call(null,cljs.core.chunk_rest.call(null,s__10403__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10405),null);
}
} else
{var cycle = cljs.core.first.call(null,s__10403__$2);return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),cljs.core.reduce.call(null,cljs.core.str,cljs.core.interpose.call(null," => ",cycle))], null),iter__10402.call(null,cljs.core.rest.call(null,s__10403__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,cycles);
});
lt.objs.plugins.metadata_commits = "https://api.github.com/repos/LightTable/plugin-metadata/commits";
lt.objs.plugins.metadata_download = "https://api.github.com/repos/LightTable/plugin-metadata/tarball/master";
lt.objs.plugins.metadata_dir = lt.objs.files.lt_user_dir.call(null,"metadata");
lt.objs.plugins.metadata_cache = lt.objs.files.join.call(null,lt.objs.plugins.metadata_dir,"cache.json");
lt.objs.plugins.version_sort = (function version_sort(a,b){if(cljs.core._EQ_.call(null,a,b))
{return 0;
} else
{if(lt.objs.deploy.is_newer_QMARK_.call(null,a,b))
{return -1;
} else
{if(new cljs.core.Keyword(null,"else","else",1017020587))
{return 1;
} else
{return null;
}
}
}
});
lt.objs.plugins.build_cache = (function build_cache(sha){var items = cljs.core.filter.call(null,lt.objs.files.dir_QMARK_,lt.objs.files.full_path_ls.call(null,lt.objs.plugins.metadata_dir));var cache = cljs.core.into.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"__sha","__sha",1104582718),sha], null),(function (){var iter__4231__auto__ = ((function (items){
return (function iter__10411(s__10412){return (new cljs.core.LazySeq(null,((function (items){
return (function (){var s__10412__$1 = s__10412;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__10412__$1);if(temp__4092__auto__)
{var s__10412__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__10412__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10412__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10414 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10413 = 0;while(true){
if((i__10413 < size__4230__auto__))
{var plugin = cljs.core._nth.call(null,c__4229__auto__,i__10413);var versions = cljs.core.vec.call(null,cljs.core.sort_by.call(null,new cljs.core.Keyword(null,"version","version",1365512266),lt.objs.plugins.version_sort,cljs.core.map.call(null,lt.objs.plugins.plugin_info,cljs.core.filter.call(null,lt.objs.files.dir_QMARK_,lt.objs.files.full_path_ls.call(null,plugin)))));var latest = cljs.core.last.call(null,versions);cljs.core.chunk_append.call(null,b__10414,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(latest),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"versions","versions",3323818509),cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,cljs.core.map.call(null,cljs.core.juxt.call(null,new cljs.core.Keyword(null,"version","version",1365512266),cljs.core.identity),versions)),new cljs.core.Keyword(null,"latest-version","latest-version",1676217348),new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(latest)], null)], null));
{
var G__10415 = (i__10413 + 1);
i__10413 = G__10415;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10414),iter__10411.call(null,cljs.core.chunk_rest.call(null,s__10412__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10414),null);
}
} else
{var plugin = cljs.core.first.call(null,s__10412__$2);var versions = cljs.core.vec.call(null,cljs.core.sort_by.call(null,new cljs.core.Keyword(null,"version","version",1365512266),lt.objs.plugins.version_sort,cljs.core.map.call(null,lt.objs.plugins.plugin_info,cljs.core.filter.call(null,lt.objs.files.dir_QMARK_,lt.objs.files.full_path_ls.call(null,plugin)))));var latest = cljs.core.last.call(null,versions);return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(latest),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"versions","versions",3323818509),cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,cljs.core.map.call(null,cljs.core.juxt.call(null,new cljs.core.Keyword(null,"version","version",1365512266),cljs.core.identity),versions)),new cljs.core.Keyword(null,"latest-version","latest-version",1676217348),new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(latest)], null)], null),iter__10411.call(null,cljs.core.rest.call(null,s__10412__$2)));
}
} else
{return null;
}
break;
}
});})(items))
,null,null));
});})(items))
;return iter__4231__auto__.call(null,items);
})());return cache;
});
lt.objs.plugins.save_cache = (function save_cache(cache){return lt.objs.files.save.call(null,lt.objs.plugins.metadata_cache,JSON.stringify(cljs.core.clj__GT_js.call(null,cache)));
});
lt.objs.plugins.latest_metadata_sha = (function latest_metadata_sha(){return fetch.core.xhr.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"get","get",1014006472),lt.objs.plugins.metadata_commits], null),cljs.core.PersistentArrayMap.EMPTY,(function (data){var temp__4092__auto__ = (function (){try{return JSON.parse(data);
}catch (e10417){var e = e10417;return lt.objs.console.error.call(null,[cljs.core.str("Invalid JSON response from "),cljs.core.str(lt.objs.plugins.metadata_commits),cljs.core.str(": "),cljs.core.str(cljs.core.pr_str.call(null,data))].join(''));
}})();if(cljs.core.truth_(temp__4092__auto__))
{var parsed = temp__4092__auto__;var sha = ((parsed[0])["sha"]);return lt.object.raise.call(null,lt.objs.plugins.manager,new cljs.core.Keyword(null,"metadata.sha","metadata.sha",2333336799),sha);
} else
{return null;
}
}));
});
lt.objs.plugins.download_metadata = (function download_metadata(sha){var tmp_gz = lt.objs.files.lt_user_dir.call(null,"metadata-temp.tar.gz");var tmp_dir = lt.objs.files.lt_user_dir.call(null,"metadata-temp");lt.objs.notifos.working.call(null,"Updating plugin metadata");
return lt.objs.deploy.download_file.call(null,lt.objs.plugins.metadata_download,tmp_gz,(function (){return lt.objs.deploy.untar.call(null,tmp_gz,tmp_dir,(function (){lt.objs.notifos.done_working.call(null);
var munged_dir = cljs.core.first.call(null,lt.objs.files.full_path_ls.call(null,tmp_dir));if(cljs.core.truth_(munged_dir))
{if(cljs.core.truth_(lt.objs.files.exists_QMARK_.call(null,lt.objs.plugins.metadata_dir)))
{lt.objs.files.delete_BANG_.call(null,lt.objs.plugins.metadata_dir);
} else
{}
lt.objs.files.move_BANG_.call(null,munged_dir,lt.objs.plugins.metadata_dir);
} else
{}
lt.objs.files.delete_BANG_.call(null,tmp_dir);
lt.objs.files.delete_BANG_.call(null,tmp_gz);
if(cljs.core.truth_(munged_dir))
{lt.objs.plugins.save_cache.call(null,lt.objs.plugins.build_cache.call(null,sha));
lt.objs.notifos.done_working.call(null,[cljs.core.str("Plugin metadata updated. ")].join(''));
return lt.object.raise.call(null,lt.objs.plugins.manager,new cljs.core.Keyword(null,"metadata.updated","metadata.updated",1526644846));
} else
{return lt.objs.plugins.install_failed.call(null,"metadata");
}
}));
}));
});
lt.objs.plugins.read_cache = (function read_cache(){if(cljs.core.truth_(lt.objs.files.exists_QMARK_.call(null,lt.objs.plugins.metadata_cache)))
{return cljs.core.js__GT_clj.call(null,JSON.parse(new cljs.core.Keyword(null,"content","content",1965434859).cljs$core$IFn$_invoke$arity$1(lt.objs.files.open_sync.call(null,lt.objs.plugins.metadata_cache))),new cljs.core.Keyword(null,"keywordize-keys","keywordize-keys",4191781672),true);
} else
{return null;
}
});
lt.objs.plugins.search_plugins = (function search_plugins(plugins,search){var search__$1 = search.toLowerCase();return cljs.core.filter.call(null,(function (plugin){return ((new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$2(plugin,"").toLowerCase().indexOf(search__$1) > -1)) || ((new cljs.core.Keyword(null,"author","author",3902543101).cljs$core$IFn$_invoke$arity$2(plugin,"").toLowerCase().indexOf(search__$1) > -1)) || ((new cljs.core.Keyword(null,"desc","desc",1016984067).cljs$core$IFn$_invoke$arity$2(plugin,"").toLowerCase().indexOf(search__$1) > -1));
}),plugins);
});
lt.objs.plugins.latest_version_merge = (function latest_version_merge(neue,old){var neue__$1 = cljs.core.seq.call(null,neue);return cljs.core.reduce.call(null,(function (final$,p__10420){var vec__10421 = p__10420;var name = cljs.core.nth.call(null,vec__10421,0,null);var ver = cljs.core.nth.call(null,vec__10421,1,null);var temp__4090__auto__ = new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(final$.call(null,name));if(cljs.core.truth_(temp__4090__auto__))
{var cur_ver = temp__4090__auto__;if(lt.objs.deploy.is_newer_QMARK_.call(null,ver,cur_ver))
{return cljs.core.assoc.call(null,final$,name,ver);
} else
{return final$;
}
} else
{return cljs.core.assoc.call(null,final$,name,ver);
}
}),old,neue__$1);
});
lt.objs.plugins.transitive_deps = (function transitive_deps(plugins,p__10422,seen){var vec__10424 = p__10422;var name = cljs.core.nth.call(null,vec__10424,0,null);var ver = cljs.core.nth.call(null,vec__10424,1,null);var name__$1 = cljs.core.keyword.call(null,name);var temp__4090__auto__ = cljs.core.get_in.call(null,plugins,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [name__$1,new cljs.core.Keyword(null,"versions","versions",3323818509),cljs.core.keyword.call(null,ver)], null));if(cljs.core.truth_(temp__4090__auto__))
{var cur = temp__4090__auto__;var deps = new cljs.core.Keyword(null,"dependencies","dependencies",1517678747).cljs$core$IFn$_invoke$arity$1(cur);var unique = cljs.core.remove.call(null,seen,cljs.core.keys.call(null,deps));var seen__$1 = lt.objs.plugins.latest_version_merge.call(null,new cljs.core.PersistentArrayMap.fromArray([name__$1,cur], true, false),seen);return cljs.core.reduce.call(null,(function (seen__$2,cur__$1){return transitive_deps.call(null,plugins,cur__$1,seen__$2);
}),seen__$1,cljs.core.select_keys.call(null,deps,unique));
} else
{return seen;
}
});
lt.objs.plugins.latest_version = (function latest_version(plugin){return cljs.core.get.call(null,new cljs.core.Keyword(null,"versions","versions",3323818509).cljs$core$IFn$_invoke$arity$1(plugin),cljs.core.keyword.call(null,new cljs.core.Keyword(null,"latest-version","latest-version",1676217348).cljs$core$IFn$_invoke$arity$1(plugin)));
});
lt.objs.plugins.all_latest = (function all_latest(plugins){return cljs.core.map.call(null,lt.objs.plugins.latest_version,cljs.core.vals.call(null,cljs.core.dissoc.call(null,plugins,new cljs.core.Keyword(null,"__sha","__sha",1104582718))));
});
lt.objs.plugins.install_failed = (function install_failed(name){if(cljs.core.truth_((function (){var and__3508__auto__ = lt.objs.plugins.by_name.call(null,name);if(cljs.core.truth_(and__3508__auto__))
{return cljs.core.not.call(null,new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(lt.objs.plugins.by_name.call(null,name)));
} else
{return and__3508__auto__;
}
})()))
{lt.object.update_BANG_.call(null,lt.objs.app.app,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("lt.objs.plugins","plugins","lt.objs.plugins/plugins",2920328683)], null),cljs.core.dissoc,name);
} else
{}
return lt.objs.notifos.done_working.call(null,[cljs.core.str("Plugin install failed for: "),cljs.core.str(name)].join(''));
});
lt.objs.plugins.plugin__GT_tar = (function plugin__GT_tar(plugin){var vec__10427 = cljs.core.take.call(null,2,cljs.core.filter.call(null,(function (p1__10425_SHARP_){return cljs.core.not_EQ_.call(null,p1__10425_SHARP_,"");
}),cljs.core.reverse.call(null,clojure.string.split.call(null,new cljs.core.Keyword(null,"source","source",4412365709).cljs$core$IFn$_invoke$arity$1(plugin),"/"))));var repo = cljs.core.nth.call(null,vec__10427,0,null);var username = cljs.core.nth.call(null,vec__10427,1,null);var repo__$1 = repo.replace(/.git/,"");return [cljs.core.str("https://api.github.com/repos/"),cljs.core.str(username),cljs.core.str("/"),cljs.core.str(repo__$1),cljs.core.str("/tarball/"),cljs.core.str(new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(plugin))].join('');
});
lt.objs.plugins.fetch_and_install = (function fetch_and_install(url,name,cb){var munged_name = lt.objs.plugins.munge_plugin_name.call(null,name);var tmp_gz = [cljs.core.str(lt.objs.plugins.user_plugins_dir),cljs.core.str("/"),cljs.core.str(munged_name),cljs.core.str("-tmp.tar.gz")].join('');var tmp_dir = [cljs.core.str(lt.objs.plugins.user_plugins_dir),cljs.core.str("/"),cljs.core.str(munged_name),cljs.core.str("-tmp")].join('');lt.objs.notifos.working.call(null,[cljs.core.str("Downloading plugin: "),cljs.core.str(name)].join(''));
return lt.objs.deploy.download_file.call(null,url,tmp_gz,(function (){lt.objs.notifos.done_working.call(null);
lt.objs.notifos.working.call(null,"Extracting plugin...");
return lt.objs.deploy.untar.call(null,tmp_gz,tmp_dir,(function (){var munged_dir = cljs.core.first.call(null,lt.objs.files.full_path_ls.call(null,tmp_dir));var final_path = [cljs.core.str(lt.objs.plugins.user_plugins_dir),cljs.core.str("/"),cljs.core.str(munged_name),cljs.core.str("/")].join('');if(cljs.core.truth_(munged_dir))
{if(cljs.core.truth_(lt.objs.files.exists_QMARK_.call(null,final_path)))
{lt.objs.files.delete_BANG_.call(null,final_path);
} else
{}
lt.objs.files.move_BANG_.call(null,munged_dir,final_path);
} else
{}
lt.objs.files.delete_BANG_.call(null,tmp_dir);
lt.objs.files.delete_BANG_.call(null,tmp_gz);
if(cljs.core.truth_(munged_dir))
{lt.objs.notifos.done_working.call(null,[cljs.core.str("Plugin fetched: "),cljs.core.str(name)].join(''));
lt.object.raise.call(null,lt.objs.plugins.manager,new cljs.core.Keyword(null,"plugin.fetched","plugin.fetched",1905646736));
if(cljs.core.truth_(cb))
{return cb.call(null);
} else
{return null;
}
} else
{return lt.objs.plugins.install_failed.call(null,name);
}
}));
}));
});
lt.objs.plugins.install_version = (function install_version(plugin,cb){var name = new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin);var ver = new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(plugin);var installed_QMARK_ = cljs.core.get.call(null,new cljs.core.Keyword("lt.objs.plugins","plugins","lt.objs.plugins/plugins",2920328683).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.app.app)),name);if(cljs.core.truth_((function (){var or__3520__auto__ = cljs.core.not.call(null,installed_QMARK_);if(or__3520__auto__)
{return or__3520__auto__;
} else
{var and__3508__auto__ = new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(installed_QMARK_);if(cljs.core.truth_(and__3508__auto__))
{return lt.objs.deploy.is_newer_QMARK_.call(null,new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(installed_QMARK_),ver);
} else
{return and__3508__auto__;
}
}
})()))
{lt.object.update_BANG_.call(null,lt.objs.app.app,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("lt.objs.plugins","plugins","lt.objs.plugins/plugins",2920328683)], null),cljs.core.assoc,name,cljs.core.PersistentArrayMap.EMPTY);
return lt.objs.plugins.fetch_and_install.call(null,lt.objs.plugins.plugin__GT_tar.call(null,plugin),name,(function (){if(cljs.core.truth_(cb))
{return cb.call(null,true);
} else
{return null;
}
}));
} else
{lt.objs.notifos.set_msg_BANG_.call(null,[cljs.core.str(name),cljs.core.str(" is already installed")].join(''));
if(cljs.core.truth_(cb))
{return cb.call(null,false);
} else
{return null;
}
}
});
lt.objs.plugins.transitive_install = (function transitive_install(plugin,deps,cb){var cur = cljs.core.keyword.call(null,new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin));var others = cljs.core.dissoc.call(null,deps,cur);var counter = cljs.core.atom.call(null,cljs.core.count.call(null,others));var count_down = ((function (cur,others,counter){
return (function (){cljs.core.swap_BANG_.call(null,counter,cljs.core.dec);
if((cljs.core.deref.call(null,counter) <= 0))
{return lt.objs.plugins.install_version.call(null,deps.call(null,cur),((function (cur,others,counter){
return (function (installed_QMARK_){if(cljs.core.truth_(cb))
{return cb.call(null,installed_QMARK_);
} else
{return null;
}
});})(cur,others,counter))
);
} else
{return null;
}
});})(cur,others,counter))
;if(cljs.core.seq.call(null,others))
{var seq__10434 = cljs.core.seq.call(null,others);var chunk__10435 = null;var count__10436 = 0;var i__10437 = 0;while(true){
if((i__10437 < count__10436))
{var vec__10438 = cljs.core._nth.call(null,chunk__10435,i__10437);var _ = cljs.core.nth.call(null,vec__10438,0,null);var dep = cljs.core.nth.call(null,vec__10438,1,null);lt.objs.plugins.install_version.call(null,dep,count_down);
{
var G__10440 = seq__10434;
var G__10441 = chunk__10435;
var G__10442 = count__10436;
var G__10443 = (i__10437 + 1);
seq__10434 = G__10440;
chunk__10435 = G__10441;
count__10436 = G__10442;
i__10437 = G__10443;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__10434);if(temp__4092__auto__)
{var seq__10434__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10434__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__10434__$1);{
var G__10444 = cljs.core.chunk_rest.call(null,seq__10434__$1);
var G__10445 = c__4262__auto__;
var G__10446 = cljs.core.count.call(null,c__4262__auto__);
var G__10447 = 0;
seq__10434 = G__10444;
chunk__10435 = G__10445;
count__10436 = G__10446;
i__10437 = G__10447;
continue;
}
} else
{var vec__10439 = cljs.core.first.call(null,seq__10434__$1);var _ = cljs.core.nth.call(null,vec__10439,0,null);var dep = cljs.core.nth.call(null,vec__10439,1,null);lt.objs.plugins.install_version.call(null,dep,count_down);
{
var G__10448 = cljs.core.next.call(null,seq__10434__$1);
var G__10449 = null;
var G__10450 = 0;
var G__10451 = 0;
seq__10434 = G__10448;
chunk__10435 = G__10449;
count__10436 = G__10450;
i__10437 = G__10451;
continue;
}
}
} else
{return null;
}
}
break;
}
} else
{return count_down.call(null);
}
});
lt.objs.plugins.discover_deps = (function discover_deps(plugin,cb){var deps = lt.objs.plugins.transitive_deps.call(null,new cljs.core.Keyword(null,"server-plugins","server-plugins",1760987784).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.plugins.manager)),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin),new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(plugin)], null),cljs.core.PersistentArrayMap.EMPTY);if(cljs.core.not.call(null,cljs.core.seq.call(null,deps)))
{return lt.objs.plugins.install_failed.call(null,new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin));
} else
{return lt.objs.plugins.transitive_install.call(null,plugin,deps,cb);
}
});
lt.objs.plugins.install_missing = (function install_missing(missing){var counter = cljs.core.atom.call(null,cljs.core.count.call(null,missing));var count_down = ((function (counter){
return (function (){cljs.core.swap_BANG_.call(null,counter,cljs.core.dec);
if((cljs.core.deref.call(null,counter) <= 0))
{lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"behaviors.reload","behaviors.reload",2942796600));
lt.object.raise.call(null,lt.objs.plugins.manager,new cljs.core.Keyword(null,"refresh!","refresh!",4597922840));
return lt.objs.notifos.set_msg_BANG_.call(null,"All missing dependencies installed.");
} else
{return null;
}
});})(counter))
;var seq__10456 = cljs.core.seq.call(null,missing);var chunk__10457 = null;var count__10458 = 0;var i__10459 = 0;while(true){
if((i__10459 < count__10458))
{var dep = cljs.core._nth.call(null,chunk__10457,i__10459);lt.objs.plugins.discover_deps.call(null,dep,count_down);
{
var G__10460 = seq__10456;
var G__10461 = chunk__10457;
var G__10462 = count__10458;
var G__10463 = (i__10459 + 1);
seq__10456 = G__10460;
chunk__10457 = G__10461;
count__10458 = G__10462;
i__10459 = G__10463;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__10456);if(temp__4092__auto__)
{var seq__10456__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10456__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__10456__$1);{
var G__10464 = cljs.core.chunk_rest.call(null,seq__10456__$1);
var G__10465 = c__4262__auto__;
var G__10466 = cljs.core.count.call(null,c__4262__auto__);
var G__10467 = 0;
seq__10456 = G__10464;
chunk__10457 = G__10465;
count__10458 = G__10466;
i__10459 = G__10467;
continue;
}
} else
{var dep = cljs.core.first.call(null,seq__10456__$1);lt.objs.plugins.discover_deps.call(null,dep,count_down);
{
var G__10468 = cljs.core.next.call(null,seq__10456__$1);
var G__10469 = null;
var G__10470 = 0;
var G__10471 = 0;
seq__10456 = G__10468;
chunk__10457 = G__10469;
count__10458 = G__10470;
i__10459 = G__10471;
continue;
}
}
} else
{return null;
}
}
break;
}
});
/**
* Check a plugins map for outdated or missing :dependencies and prompt
* to install missing ones
*/
lt.objs.plugins.check_missing = (function check_missing(deps){var temp__4092__auto__ = lt.objs.plugins.missing_deps.call(null,deps);if(temp__4092__auto__)
{var missing_QMARK_ = temp__4092__auto__;return lt.objs.popup.popup_BANG_.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"header","header",4087600639),"Some plugin dependencies are missing.",new cljs.core.Keyword(null,"body","body",1016933652),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1017440956),"We found that the following plugin dependencies are missing: "], null),(function (){var iter__4231__auto__ = (function iter__10480(s__10481){return (new cljs.core.LazySeq(null,(function (){var s__10481__$1 = s__10481;while(true){
var temp__4092__auto____$1 = cljs.core.seq.call(null,s__10481__$1);if(temp__4092__auto____$1)
{var s__10481__$2 = temp__4092__auto____$1;if(cljs.core.chunked_seq_QMARK_.call(null,s__10481__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10481__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10483 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10482 = 0;while(true){
if((i__10482 < size__4230__auto__))
{var map__10486 = cljs.core._nth.call(null,c__4229__auto__,i__10482);var map__10486__$1 = ((cljs.core.seq_QMARK_.call(null,map__10486))?cljs.core.apply.call(null,cljs.core.hash_map,map__10486):map__10486);var version = cljs.core.get.call(null,map__10486__$1,new cljs.core.Keyword(null,"version","version",1365512266));var name = cljs.core.get.call(null,map__10486__$1,new cljs.core.Keyword(null,"name","name",1017277949));cljs.core.chunk_append.call(null,b__10483,new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),name," ",version," "], null));
{
var G__10488 = (i__10482 + 1);
i__10482 = G__10488;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10483),iter__10480.call(null,cljs.core.chunk_rest.call(null,s__10481__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10483),null);
}
} else
{var map__10487 = cljs.core.first.call(null,s__10481__$2);var map__10487__$1 = ((cljs.core.seq_QMARK_.call(null,map__10487))?cljs.core.apply.call(null,cljs.core.hash_map,map__10487):map__10487);var version = cljs.core.get.call(null,map__10487__$1,new cljs.core.Keyword(null,"version","version",1365512266));var name = cljs.core.get.call(null,map__10487__$1,new cljs.core.Keyword(null,"name","name",1017277949));return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),name," ",version," "], null),iter__10480.call(null,cljs.core.rest.call(null,s__10481__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,missing_QMARK_);
})(),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1017440956),"Would you like us to install them?"], null)], null),new cljs.core.Keyword(null,"buttons","buttons",1255256819),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1116631654),"Cancel"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Install all",new cljs.core.Keyword(null,"action","action",3885920680),(function (){return lt.objs.plugins.install_missing.call(null,missing_QMARK_);
})], null)], null)], null));
} else
{return null;
}
});
/**
* Return a map of plugins by plugin name based on what's read from filesystem
*/
lt.objs.plugins.available_plugins = (function available_plugins(){var ds = cljs.core.concat.call(null,lt.objs.files.dirs.call(null,lt.objs.plugins.user_plugins_dir),lt.objs.files.dirs.call(null,lt.objs.plugins.plugins_dir),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.settings.user_plugin_dir], null));var plugins = cljs.core.filterv.call(null,cljs.core.identity,cljs.core.map.call(null,lt.objs.plugins.plugin_info,ds));return cljs.core.persistent_BANG_.call(null,cljs.core.reduce.call(null,(function (final$,p){var temp__4090__auto__ = cljs.core.get.call(null,final$,new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(p));if(cljs.core.truth_(temp__4090__auto__))
{var cur = temp__4090__auto__;if(lt.objs.deploy.is_newer_QMARK_.call(null,new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(cur),new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(p)))
{return cljs.core.assoc_BANG_.call(null,final$,new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(p),p);
} else
{return final$;
}
} else
{return cljs.core.assoc_BANG_.call(null,final$,new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(p),p);
}
}),cljs.core.transient$.call(null,cljs.core.PersistentArrayMap.EMPTY),plugins));
});
lt.objs.plugins.uninstall = (function uninstall(plugin){if(cljs.core.truth_(new cljs.core.Keyword(null,"dir","dir",1014003711).cljs$core$IFn$_invoke$arity$1(plugin)))
{lt.objs.files.delete_BANG_.call(null,new cljs.core.Keyword(null,"dir","dir",1014003711).cljs$core$IFn$_invoke$arity$1(plugin));
lt.object.raise.call(null,lt.objs.plugins.manager,new cljs.core.Keyword(null,"refresh!","refresh!",4597922840),new cljs.core.Keyword(null,"ignore-missing","ignore-missing",2124702685),true);
return lt.objs.notifos.set_msg_BANG_.call(null,[cljs.core.str("Uninstalled "),cljs.core.str(new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin)),cljs.core.str(" "),cljs.core.str(new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(plugin))].join(''));
} else
{return null;
}
});
lt.objs.plugins.url_input = (function url_input(){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"input","input",1114262332),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"type","type",1017479852),"text",new cljs.core.Keyword(null,"placeholder","placeholder",1612151013),"Github URL"], null)], null));var seq__10495_10501 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"focus","focus",1111509066),(function (){return lt.objs.context.in_BANG_.call(null,new cljs.core.Keyword(null,"popup.input","popup.input",4788025210));
}),new cljs.core.Keyword(null,"blur","blur",1016931289),(function (){return lt.objs.context.out_BANG_.call(null,new cljs.core.Keyword(null,"popup.input","popup.input",4788025210));
})], null)));var chunk__10496_10502 = null;var count__10497_10503 = 0;var i__10498_10504 = 0;while(true){
if((i__10498_10504 < count__10497_10503))
{var vec__10499_10505 = cljs.core._nth.call(null,chunk__10496_10502,i__10498_10504);var ev__3326__auto___10506 = cljs.core.nth.call(null,vec__10499_10505,0,null);var func__3327__auto___10507 = cljs.core.nth.call(null,vec__10499_10505,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10506,func__3327__auto___10507);
{
var G__10508 = seq__10495_10501;
var G__10509 = chunk__10496_10502;
var G__10510 = count__10497_10503;
var G__10511 = (i__10498_10504 + 1);
seq__10495_10501 = G__10508;
chunk__10496_10502 = G__10509;
count__10497_10503 = G__10510;
i__10498_10504 = G__10511;
continue;
}
} else
{var temp__4092__auto___10512 = cljs.core.seq.call(null,seq__10495_10501);if(temp__4092__auto___10512)
{var seq__10495_10513__$1 = temp__4092__auto___10512;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10495_10513__$1))
{var c__4262__auto___10514 = cljs.core.chunk_first.call(null,seq__10495_10513__$1);{
var G__10515 = cljs.core.chunk_rest.call(null,seq__10495_10513__$1);
var G__10516 = c__4262__auto___10514;
var G__10517 = cljs.core.count.call(null,c__4262__auto___10514);
var G__10518 = 0;
seq__10495_10501 = G__10515;
chunk__10496_10502 = G__10516;
count__10497_10503 = G__10517;
i__10498_10504 = G__10518;
continue;
}
} else
{var vec__10500_10519 = cljs.core.first.call(null,seq__10495_10513__$1);var ev__3326__auto___10520 = cljs.core.nth.call(null,vec__10500_10519,0,null);var func__3327__auto___10521 = cljs.core.nth.call(null,vec__10500_10519,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10520,func__3327__auto___10521);
{
var G__10522 = cljs.core.next.call(null,seq__10495_10513__$1);
var G__10523 = null;
var G__10524 = 0;
var G__10525 = 0;
seq__10495_10501 = G__10522;
chunk__10496_10502 = G__10523;
count__10497_10503 = G__10524;
i__10498_10504 = G__10525;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.plugins.tab = (function tab(this$,tab_name,label){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button","button",3931183780),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",1108647146),crate.binding.bound.call(null,this$,(function (p1__10526_SHARP_){if(cljs.core._EQ_.call(null,tab_name,new cljs.core.Keyword(null,"tab","tab",1014018823).cljs$core$IFn$_invoke$arity$1(p1__10526_SHARP_)))
{return "active";
} else
{return null;
}
}))], null),label], null));var seq__10533_10539 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tab","tab",1014018823),tab_name], null));
})], null)));var chunk__10534_10540 = null;var count__10535_10541 = 0;var i__10536_10542 = 0;while(true){
if((i__10536_10542 < count__10535_10541))
{var vec__10537_10543 = cljs.core._nth.call(null,chunk__10534_10540,i__10536_10542);var ev__3326__auto___10544 = cljs.core.nth.call(null,vec__10537_10543,0,null);var func__3327__auto___10545 = cljs.core.nth.call(null,vec__10537_10543,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10544,func__3327__auto___10545);
{
var G__10546 = seq__10533_10539;
var G__10547 = chunk__10534_10540;
var G__10548 = count__10535_10541;
var G__10549 = (i__10536_10542 + 1);
seq__10533_10539 = G__10546;
chunk__10534_10540 = G__10547;
count__10535_10541 = G__10548;
i__10536_10542 = G__10549;
continue;
}
} else
{var temp__4092__auto___10550 = cljs.core.seq.call(null,seq__10533_10539);if(temp__4092__auto___10550)
{var seq__10533_10551__$1 = temp__4092__auto___10550;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10533_10551__$1))
{var c__4262__auto___10552 = cljs.core.chunk_first.call(null,seq__10533_10551__$1);{
var G__10553 = cljs.core.chunk_rest.call(null,seq__10533_10551__$1);
var G__10554 = c__4262__auto___10552;
var G__10555 = cljs.core.count.call(null,c__4262__auto___10552);
var G__10556 = 0;
seq__10533_10539 = G__10553;
chunk__10534_10540 = G__10554;
count__10535_10541 = G__10555;
i__10536_10542 = G__10556;
continue;
}
} else
{var vec__10538_10557 = cljs.core.first.call(null,seq__10533_10551__$1);var ev__3326__auto___10558 = cljs.core.nth.call(null,vec__10538_10557,0,null);var func__3327__auto___10559 = cljs.core.nth.call(null,vec__10538_10557,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10558,func__3327__auto___10559);
{
var G__10560 = cljs.core.next.call(null,seq__10533_10551__$1);
var G__10561 = null;
var G__10562 = 0;
var G__10563 = 0;
seq__10533_10539 = G__10560;
chunk__10534_10540 = G__10561;
count__10535_10541 = G__10562;
i__10536_10542 = G__10563;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.plugins.search_input = (function search_input(this$){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"input","input",1114262332),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"placeholder","placeholder",1612151013),"Search available plugins"], null)], null));var seq__10570_10576 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"focus","focus",1111509066),(function (){return lt.objs.context.in_BANG_.call(null,new cljs.core.Keyword(null,"plugin-manager.search","plugin-manager.search",4116247637),this$);
}),new cljs.core.Keyword(null,"blur","blur",1016931289),(function (){return lt.objs.context.out_BANG_.call(null,new cljs.core.Keyword(null,"plugin-manager.search","plugin-manager.search",4116247637));
})], null)));var chunk__10571_10577 = null;var count__10572_10578 = 0;var i__10573_10579 = 0;while(true){
if((i__10573_10579 < count__10572_10578))
{var vec__10574_10580 = cljs.core._nth.call(null,chunk__10571_10577,i__10573_10579);var ev__3326__auto___10581 = cljs.core.nth.call(null,vec__10574_10580,0,null);var func__3327__auto___10582 = cljs.core.nth.call(null,vec__10574_10580,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10581,func__3327__auto___10582);
{
var G__10583 = seq__10570_10576;
var G__10584 = chunk__10571_10577;
var G__10585 = count__10572_10578;
var G__10586 = (i__10573_10579 + 1);
seq__10570_10576 = G__10583;
chunk__10571_10577 = G__10584;
count__10572_10578 = G__10585;
i__10573_10579 = G__10586;
continue;
}
} else
{var temp__4092__auto___10587 = cljs.core.seq.call(null,seq__10570_10576);if(temp__4092__auto___10587)
{var seq__10570_10588__$1 = temp__4092__auto___10587;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10570_10588__$1))
{var c__4262__auto___10589 = cljs.core.chunk_first.call(null,seq__10570_10588__$1);{
var G__10590 = cljs.core.chunk_rest.call(null,seq__10570_10588__$1);
var G__10591 = c__4262__auto___10589;
var G__10592 = cljs.core.count.call(null,c__4262__auto___10589);
var G__10593 = 0;
seq__10570_10576 = G__10590;
chunk__10571_10577 = G__10591;
count__10572_10578 = G__10592;
i__10573_10579 = G__10593;
continue;
}
} else
{var vec__10575_10594 = cljs.core.first.call(null,seq__10570_10588__$1);var ev__3326__auto___10595 = cljs.core.nth.call(null,vec__10575_10594,0,null);var func__3327__auto___10596 = cljs.core.nth.call(null,vec__10575_10594,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10595,func__3327__auto___10596);
{
var G__10597 = cljs.core.next.call(null,seq__10570_10588__$1);
var G__10598 = null;
var G__10599 = 0;
var G__10600 = 0;
seq__10570_10576 = G__10597;
chunk__10571_10577 = G__10598;
count__10572_10578 = G__10599;
i__10573_10579 = G__10600;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.plugins.tabs_and_search = (function tabs_and_search(this$){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.tabs","div.tabs",1324158509),lt.objs.plugins.tab.call(null,this$,new cljs.core.Keyword(null,"installed","installed",1042950892),"Installed"),lt.objs.plugins.tab.call(null,this$,new cljs.core.Keyword(null,"server","server",4403045045),"Available"),lt.objs.plugins.search_input.call(null,this$)], null));var seq__10607_10613 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__10608_10614 = null;var count__10609_10615 = 0;var i__10610_10616 = 0;while(true){
if((i__10610_10616 < count__10609_10615))
{var vec__10611_10617 = cljs.core._nth.call(null,chunk__10608_10614,i__10610_10616);var ev__3326__auto___10618 = cljs.core.nth.call(null,vec__10611_10617,0,null);var func__3327__auto___10619 = cljs.core.nth.call(null,vec__10611_10617,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10618,func__3327__auto___10619);
{
var G__10620 = seq__10607_10613;
var G__10621 = chunk__10608_10614;
var G__10622 = count__10609_10615;
var G__10623 = (i__10610_10616 + 1);
seq__10607_10613 = G__10620;
chunk__10608_10614 = G__10621;
count__10609_10615 = G__10622;
i__10610_10616 = G__10623;
continue;
}
} else
{var temp__4092__auto___10624 = cljs.core.seq.call(null,seq__10607_10613);if(temp__4092__auto___10624)
{var seq__10607_10625__$1 = temp__4092__auto___10624;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10607_10625__$1))
{var c__4262__auto___10626 = cljs.core.chunk_first.call(null,seq__10607_10625__$1);{
var G__10627 = cljs.core.chunk_rest.call(null,seq__10607_10625__$1);
var G__10628 = c__4262__auto___10626;
var G__10629 = cljs.core.count.call(null,c__4262__auto___10626);
var G__10630 = 0;
seq__10607_10613 = G__10627;
chunk__10608_10614 = G__10628;
count__10609_10615 = G__10629;
i__10610_10616 = G__10630;
continue;
}
} else
{var vec__10612_10631 = cljs.core.first.call(null,seq__10607_10625__$1);var ev__3326__auto___10632 = cljs.core.nth.call(null,vec__10612_10631,0,null);var func__3327__auto___10633 = cljs.core.nth.call(null,vec__10612_10631,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10632,func__3327__auto___10633);
{
var G__10634 = cljs.core.next.call(null,seq__10607_10625__$1);
var G__10635 = null;
var G__10636 = 0;
var G__10637 = 0;
seq__10607_10613 = G__10634;
chunk__10608_10614 = G__10635;
count__10609_10615 = G__10636;
i__10610_10616 = G__10637;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.plugins.source_button = (function source_button(plugin){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.source","span.source",4763361969),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a","a",1013904339),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"href","href",1017115293),new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$2(plugin,new cljs.core.Keyword(null,"source","source",4412365709).cljs$core$IFn$_invoke$arity$1(plugin))], null),"source"], null)], null));var seq__10644_10650 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"click","click",1108654330),(function (e){lt.util.dom.prevent.call(null,e);
lt.util.dom.stop_propagation.call(null,e);
return lt.objs.platform.open_url.call(null,new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$2(plugin,new cljs.core.Keyword(null,"source","source",4412365709).cljs$core$IFn$_invoke$arity$1(plugin)));
})], null)));var chunk__10645_10651 = null;var count__10646_10652 = 0;var i__10647_10653 = 0;while(true){
if((i__10647_10653 < count__10646_10652))
{var vec__10648_10654 = cljs.core._nth.call(null,chunk__10645_10651,i__10647_10653);var ev__3326__auto___10655 = cljs.core.nth.call(null,vec__10648_10654,0,null);var func__3327__auto___10656 = cljs.core.nth.call(null,vec__10648_10654,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10655,func__3327__auto___10656);
{
var G__10657 = seq__10644_10650;
var G__10658 = chunk__10645_10651;
var G__10659 = count__10646_10652;
var G__10660 = (i__10647_10653 + 1);
seq__10644_10650 = G__10657;
chunk__10645_10651 = G__10658;
count__10646_10652 = G__10659;
i__10647_10653 = G__10660;
continue;
}
} else
{var temp__4092__auto___10661 = cljs.core.seq.call(null,seq__10644_10650);if(temp__4092__auto___10661)
{var seq__10644_10662__$1 = temp__4092__auto___10661;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10644_10662__$1))
{var c__4262__auto___10663 = cljs.core.chunk_first.call(null,seq__10644_10662__$1);{
var G__10664 = cljs.core.chunk_rest.call(null,seq__10644_10662__$1);
var G__10665 = c__4262__auto___10663;
var G__10666 = cljs.core.count.call(null,c__4262__auto___10663);
var G__10667 = 0;
seq__10644_10650 = G__10664;
chunk__10645_10651 = G__10665;
count__10646_10652 = G__10666;
i__10647_10653 = G__10667;
continue;
}
} else
{var vec__10649_10668 = cljs.core.first.call(null,seq__10644_10662__$1);var ev__3326__auto___10669 = cljs.core.nth.call(null,vec__10649_10668,0,null);var func__3327__auto___10670 = cljs.core.nth.call(null,vec__10649_10668,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10669,func__3327__auto___10670);
{
var G__10671 = cljs.core.next.call(null,seq__10644_10662__$1);
var G__10672 = null;
var G__10673 = 0;
var G__10674 = 0;
seq__10644_10650 = G__10671;
chunk__10645_10651 = G__10672;
count__10646_10652 = G__10673;
i__10647_10653 = G__10674;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.plugins.update_button = (function update_button(plugin){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.update","span.update",526054239)], null));var seq__10681_10687 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"click","click",1108654330),(function (e){lt.util.dom.prevent.call(null,e);
lt.util.dom.stop_propagation.call(null,e);
return lt.objs.plugins.discover_deps.call(null,plugin,(function (){lt.object.raise.call(null,lt.objs.plugins.manager,new cljs.core.Keyword(null,"refresh!","refresh!",4597922840));
lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"behaviors.reload","behaviors.reload",2942796600));
return lt.util.js.wait.call(null,1000,(function (){return lt.objs.notifos.set_msg_BANG_.call(null,[cljs.core.str("Updated "),cljs.core.str(new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin)),cljs.core.str(" "),cljs.core.str(new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(plugin))].join(''));
}));
}));
})], null)));var chunk__10682_10688 = null;var count__10683_10689 = 0;var i__10684_10690 = 0;while(true){
if((i__10684_10690 < count__10683_10689))
{var vec__10685_10691 = cljs.core._nth.call(null,chunk__10682_10688,i__10684_10690);var ev__3326__auto___10692 = cljs.core.nth.call(null,vec__10685_10691,0,null);var func__3327__auto___10693 = cljs.core.nth.call(null,vec__10685_10691,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10692,func__3327__auto___10693);
{
var G__10694 = seq__10681_10687;
var G__10695 = chunk__10682_10688;
var G__10696 = count__10683_10689;
var G__10697 = (i__10684_10690 + 1);
seq__10681_10687 = G__10694;
chunk__10682_10688 = G__10695;
count__10683_10689 = G__10696;
i__10684_10690 = G__10697;
continue;
}
} else
{var temp__4092__auto___10698 = cljs.core.seq.call(null,seq__10681_10687);if(temp__4092__auto___10698)
{var seq__10681_10699__$1 = temp__4092__auto___10698;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10681_10699__$1))
{var c__4262__auto___10700 = cljs.core.chunk_first.call(null,seq__10681_10699__$1);{
var G__10701 = cljs.core.chunk_rest.call(null,seq__10681_10699__$1);
var G__10702 = c__4262__auto___10700;
var G__10703 = cljs.core.count.call(null,c__4262__auto___10700);
var G__10704 = 0;
seq__10681_10687 = G__10701;
chunk__10682_10688 = G__10702;
count__10683_10689 = G__10703;
i__10684_10690 = G__10704;
continue;
}
} else
{var vec__10686_10705 = cljs.core.first.call(null,seq__10681_10699__$1);var ev__3326__auto___10706 = cljs.core.nth.call(null,vec__10686_10705,0,null);var func__3327__auto___10707 = cljs.core.nth.call(null,vec__10686_10705,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10706,func__3327__auto___10707);
{
var G__10708 = cljs.core.next.call(null,seq__10681_10699__$1);
var G__10709 = null;
var G__10710 = 0;
var G__10711 = 0;
seq__10681_10687 = G__10708;
chunk__10682_10688 = G__10709;
count__10683_10689 = G__10710;
i__10684_10690 = G__10711;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.plugins.install_button = (function install_button(plugin){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.install","span.install",967456361)], null));var seq__10718_10724 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"click","click",1108654330),(function (e){var me_10728 = this;lt.objs.plugins.discover_deps.call(null,plugin,((function (me_10728){
return (function (){lt.util.dom.remove.call(null,lt.util.dom.parent.call(null,me_10728));
lt.object.raise.call(null,lt.objs.plugins.manager,new cljs.core.Keyword(null,"refresh!","refresh!",4597922840));
lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"behaviors.reload","behaviors.reload",2942796600));
return lt.util.js.wait.call(null,1000,((function (me_10728){
return (function (){return lt.objs.notifos.set_msg_BANG_.call(null,[cljs.core.str("Installed "),cljs.core.str(new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin)),cljs.core.str(" "),cljs.core.str(new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(plugin))].join(''));
});})(me_10728))
);
});})(me_10728))
);
lt.util.dom.prevent.call(null,e);
return lt.util.dom.stop_propagation.call(null,e);
})], null)));var chunk__10719_10725 = null;var count__10720_10726 = 0;var i__10721_10727 = 0;while(true){
if((i__10721_10727 < count__10720_10726))
{var vec__10722_10729 = cljs.core._nth.call(null,chunk__10719_10725,i__10721_10727);var ev__3326__auto___10730 = cljs.core.nth.call(null,vec__10722_10729,0,null);var func__3327__auto___10731 = cljs.core.nth.call(null,vec__10722_10729,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10730,func__3327__auto___10731);
{
var G__10732 = seq__10718_10724;
var G__10733 = chunk__10719_10725;
var G__10734 = count__10720_10726;
var G__10735 = (i__10721_10727 + 1);
seq__10718_10724 = G__10732;
chunk__10719_10725 = G__10733;
count__10720_10726 = G__10734;
i__10721_10727 = G__10735;
continue;
}
} else
{var temp__4092__auto___10736 = cljs.core.seq.call(null,seq__10718_10724);if(temp__4092__auto___10736)
{var seq__10718_10737__$1 = temp__4092__auto___10736;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10718_10737__$1))
{var c__4262__auto___10738 = cljs.core.chunk_first.call(null,seq__10718_10737__$1);{
var G__10739 = cljs.core.chunk_rest.call(null,seq__10718_10737__$1);
var G__10740 = c__4262__auto___10738;
var G__10741 = cljs.core.count.call(null,c__4262__auto___10738);
var G__10742 = 0;
seq__10718_10724 = G__10739;
chunk__10719_10725 = G__10740;
count__10720_10726 = G__10741;
i__10721_10727 = G__10742;
continue;
}
} else
{var vec__10723_10743 = cljs.core.first.call(null,seq__10718_10737__$1);var ev__3326__auto___10744 = cljs.core.nth.call(null,vec__10723_10743,0,null);var func__3327__auto___10745 = cljs.core.nth.call(null,vec__10723_10743,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10744,func__3327__auto___10745);
{
var G__10746 = cljs.core.next.call(null,seq__10718_10737__$1);
var G__10747 = null;
var G__10748 = 0;
var G__10749 = 0;
seq__10718_10724 = G__10746;
chunk__10719_10725 = G__10747;
count__10720_10726 = G__10748;
i__10721_10727 = G__10749;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.plugins.server_plugin_ui = (function server_plugin_ui(plugin){var e__3325__auto__ = crate.core.html.call(null,(function (){var info = plugin;var ver = new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(info);var installed = cljs.core.get.call(null,new cljs.core.Keyword("lt.objs.plugins","plugins","lt.objs.plugins/plugins",2920328683).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.app.app)),new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(info));var update_QMARK_ = (function (){var and__3508__auto__ = new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(installed);if(cljs.core.truth_(and__3508__auto__))
{return lt.objs.deploy.is_newer_QMARK_.call(null,new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(installed),ver);
} else
{return and__3508__auto__;
}
})();return new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",1108647146),(cljs.core.truth_(update_QMARK_)?"has-update":null)], null),((cljs.core.not.call(null,installed))?lt.objs.plugins.install_button.call(null,plugin):(cljs.core.truth_(update_QMARK_)?lt.objs.plugins.update_button.call(null,plugin):new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.installed","span.installed",3622134088)], null))),lt.objs.plugins.source_button.call(null,plugin),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h1","h1",1013907515),new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(info),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.version","span.version",3656461734),ver], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h3","h3",1013907517),new cljs.core.Keyword(null,"author","author",3902543101).cljs$core$IFn$_invoke$arity$1(info)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p","p",1013904354),new cljs.core.Keyword(null,"desc","desc",1016984067).cljs$core$IFn$_invoke$arity$1(info)], null)], null);
})());var seq__10756_10762 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__10757_10763 = null;var count__10758_10764 = 0;var i__10759_10765 = 0;while(true){
if((i__10759_10765 < count__10758_10764))
{var vec__10760_10766 = cljs.core._nth.call(null,chunk__10757_10763,i__10759_10765);var ev__3326__auto___10767 = cljs.core.nth.call(null,vec__10760_10766,0,null);var func__3327__auto___10768 = cljs.core.nth.call(null,vec__10760_10766,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10767,func__3327__auto___10768);
{
var G__10769 = seq__10756_10762;
var G__10770 = chunk__10757_10763;
var G__10771 = count__10758_10764;
var G__10772 = (i__10759_10765 + 1);
seq__10756_10762 = G__10769;
chunk__10757_10763 = G__10770;
count__10758_10764 = G__10771;
i__10759_10765 = G__10772;
continue;
}
} else
{var temp__4092__auto___10773 = cljs.core.seq.call(null,seq__10756_10762);if(temp__4092__auto___10773)
{var seq__10756_10774__$1 = temp__4092__auto___10773;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10756_10774__$1))
{var c__4262__auto___10775 = cljs.core.chunk_first.call(null,seq__10756_10774__$1);{
var G__10776 = cljs.core.chunk_rest.call(null,seq__10756_10774__$1);
var G__10777 = c__4262__auto___10775;
var G__10778 = cljs.core.count.call(null,c__4262__auto___10775);
var G__10779 = 0;
seq__10756_10762 = G__10776;
chunk__10757_10763 = G__10777;
count__10758_10764 = G__10778;
i__10759_10765 = G__10779;
continue;
}
} else
{var vec__10761_10780 = cljs.core.first.call(null,seq__10756_10774__$1);var ev__3326__auto___10781 = cljs.core.nth.call(null,vec__10761_10780,0,null);var func__3327__auto___10782 = cljs.core.nth.call(null,vec__10761_10780,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10781,func__3327__auto___10782);
{
var G__10783 = cljs.core.next.call(null,seq__10756_10774__$1);
var G__10784 = null;
var G__10785 = 0;
var G__10786 = 0;
seq__10756_10762 = G__10783;
chunk__10757_10763 = G__10784;
count__10758_10764 = G__10785;
i__10759_10765 = G__10786;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.plugins.uninstall_button = (function uninstall_button(plugin){var e__3325__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.uninstall","span.uninstall",2967491248)], null));var seq__10793_10799 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.objs.popup.popup_BANG_.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"header","header",4087600639),"Uninstall plugin?",new cljs.core.Keyword(null,"body","body",1016933652),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),"This will delete the plugin from your system, removing any local\n                                 changes you may have made, and cannot be undone."], null),new cljs.core.Keyword(null,"buttons","buttons",1255256819),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Delete plugin",new cljs.core.Keyword(null,"action","action",3885920680),(function (){return lt.objs.plugins.uninstall.call(null,plugin);
})], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1116631654),"Cancel"], null)], null)], null));
})], null)));var chunk__10794_10800 = null;var count__10795_10801 = 0;var i__10796_10802 = 0;while(true){
if((i__10796_10802 < count__10795_10801))
{var vec__10797_10803 = cljs.core._nth.call(null,chunk__10794_10800,i__10796_10802);var ev__3326__auto___10804 = cljs.core.nth.call(null,vec__10797_10803,0,null);var func__3327__auto___10805 = cljs.core.nth.call(null,vec__10797_10803,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10804,func__3327__auto___10805);
{
var G__10806 = seq__10793_10799;
var G__10807 = chunk__10794_10800;
var G__10808 = count__10795_10801;
var G__10809 = (i__10796_10802 + 1);
seq__10793_10799 = G__10806;
chunk__10794_10800 = G__10807;
count__10795_10801 = G__10808;
i__10796_10802 = G__10809;
continue;
}
} else
{var temp__4092__auto___10810 = cljs.core.seq.call(null,seq__10793_10799);if(temp__4092__auto___10810)
{var seq__10793_10811__$1 = temp__4092__auto___10810;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10793_10811__$1))
{var c__4262__auto___10812 = cljs.core.chunk_first.call(null,seq__10793_10811__$1);{
var G__10813 = cljs.core.chunk_rest.call(null,seq__10793_10811__$1);
var G__10814 = c__4262__auto___10812;
var G__10815 = cljs.core.count.call(null,c__4262__auto___10812);
var G__10816 = 0;
seq__10793_10799 = G__10813;
chunk__10794_10800 = G__10814;
count__10795_10801 = G__10815;
i__10796_10802 = G__10816;
continue;
}
} else
{var vec__10798_10817 = cljs.core.first.call(null,seq__10793_10811__$1);var ev__3326__auto___10818 = cljs.core.nth.call(null,vec__10798_10817,0,null);var func__3327__auto___10819 = cljs.core.nth.call(null,vec__10798_10817,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10818,func__3327__auto___10819);
{
var G__10820 = cljs.core.next.call(null,seq__10793_10811__$1);
var G__10821 = null;
var G__10822 = 0;
var G__10823 = 0;
seq__10793_10799 = G__10820;
chunk__10794_10800 = G__10821;
count__10795_10801 = G__10822;
i__10796_10802 = G__10823;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.plugins.installed_plugin_ui = (function installed_plugin_ui(plugin){var e__3325__auto__ = crate.core.html.call(null,(function (){var cached = new cljs.core.Keyword(null,"latest-version","latest-version",1676217348).cljs$core$IFn$_invoke$arity$1(cljs.core.get.call(null,new cljs.core.Keyword(null,"server-plugins","server-plugins",1760987784).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.plugins.manager)),cljs.core.keyword.call(null,new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin))));var update_QMARK_ = (cljs.core.truth_(cached)?lt.objs.deploy.is_newer_QMARK_.call(null,new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(plugin),cached):null);return new cljs.core.PersistentVector(null, 8, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",1108647146),(cljs.core.truth_(update_QMARK_)?"has-update":null)], null),(cljs.core.truth_(update_QMARK_)?lt.objs.plugins.update_button.call(null,cljs.core.assoc.call(null,plugin,new cljs.core.Keyword(null,"version","version",1365512266),cached)):null),lt.objs.plugins.uninstall_button.call(null,plugin),lt.objs.plugins.source_button.call(null,plugin),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h1","h1",1013907515),new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.version","span.version",3656461734),new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(plugin)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h3","h3",1013907517),new cljs.core.Keyword(null,"author","author",3902543101).cljs$core$IFn$_invoke$arity$1(plugin)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p","p",1013904354),new cljs.core.Keyword(null,"desc","desc",1016984067).cljs$core$IFn$_invoke$arity$1(plugin)], null)], null);
})());var seq__10830_10836 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__10831_10837 = null;var count__10832_10838 = 0;var i__10833_10839 = 0;while(true){
if((i__10833_10839 < count__10832_10838))
{var vec__10834_10840 = cljs.core._nth.call(null,chunk__10831_10837,i__10833_10839);var ev__3326__auto___10841 = cljs.core.nth.call(null,vec__10834_10840,0,null);var func__3327__auto___10842 = cljs.core.nth.call(null,vec__10834_10840,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10841,func__3327__auto___10842);
{
var G__10843 = seq__10830_10836;
var G__10844 = chunk__10831_10837;
var G__10845 = count__10832_10838;
var G__10846 = (i__10833_10839 + 1);
seq__10830_10836 = G__10843;
chunk__10831_10837 = G__10844;
count__10832_10838 = G__10845;
i__10833_10839 = G__10846;
continue;
}
} else
{var temp__4092__auto___10847 = cljs.core.seq.call(null,seq__10830_10836);if(temp__4092__auto___10847)
{var seq__10830_10848__$1 = temp__4092__auto___10847;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10830_10848__$1))
{var c__4262__auto___10849 = cljs.core.chunk_first.call(null,seq__10830_10848__$1);{
var G__10850 = cljs.core.chunk_rest.call(null,seq__10830_10848__$1);
var G__10851 = c__4262__auto___10849;
var G__10852 = cljs.core.count.call(null,c__4262__auto___10849);
var G__10853 = 0;
seq__10830_10836 = G__10850;
chunk__10831_10837 = G__10851;
count__10832_10838 = G__10852;
i__10833_10839 = G__10853;
continue;
}
} else
{var vec__10835_10854 = cljs.core.first.call(null,seq__10830_10848__$1);var ev__3326__auto___10855 = cljs.core.nth.call(null,vec__10835_10854,0,null);var func__3327__auto___10856 = cljs.core.nth.call(null,vec__10835_10854,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___10855,func__3327__auto___10856);
{
var G__10857 = cljs.core.next.call(null,seq__10830_10848__$1);
var G__10858 = null;
var G__10859 = 0;
var G__10860 = 0;
seq__10830_10836 = G__10857;
chunk__10831_10837 = G__10858;
count__10832_10838 = G__10859;
i__10833_10839 = G__10860;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","plugin-manager","lt.objs.plugins/plugin-manager",2152899846),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"plugin-manager","plugin-manager",1960276613),null], null), null),new cljs.core.Keyword(null,"name","name",1017277949),"Plugins",new cljs.core.Keyword(null,"tab","tab",1014018823),new cljs.core.Keyword(null,"installed","installed",1042950892),new cljs.core.Keyword(null,"init","init",1017141378),(function (this$){lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"server-plugins","server-plugins",1760987784),lt.objs.plugins.read_cache.call(null)], null));
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",1108647146),crate.binding.bound.call(null,this$,(function (p1__10861_SHARP_){return [cljs.core.str("plugin-manager"),cljs.core.str(((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"tab","tab",1014018823).cljs$core$IFn$_invoke$arity$1(p1__10861_SHARP_),new cljs.core.Keyword(null,"server","server",4403045045)))?" server":null))].join('');
}))], null),lt.objs.plugins.tabs_and_search.call(null,this$),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ul.server-plugins","ul.server-plugins",2509222591)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"ul.plugins","ul.plugins",4244308667)], null)], null);
}));
lt.objs.plugins.manager = lt.object.create.call(null,new cljs.core.Keyword("lt.objs.plugins","plugin-manager","lt.objs.plugins/plugin-manager",2152899846));
lt.objs.plugins.__BEH__check_local_metadata_cache = (function __BEH__check_local_metadata_cache(this$,sha){if(!(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"__sha","__sha",1104582718).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"server-plugins","server-plugins",1760987784).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))),sha)))
{return lt.objs.plugins.download_metadata.call(null,sha);
} else
{return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"metadata.updated","metadata.updated",1526644846));
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","check-local-metadata-cache","lt.objs.plugins/check-local-metadata-cache",3873892318),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__check_local_metadata_cache,new cljs.core.Keyword(null,"desc","desc",1016984067),"Plugin Manager: check local metadata cache for update",new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"metadata.sha","metadata.sha",2333336799),null], null), null));
lt.objs.plugins.__BEH__draw_plugins_on_updated = (function __BEH__draw_plugins_on_updated(this$,sha){lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"server-plugins","server-plugins",1760987784),lt.objs.plugins.read_cache.call(null)], null));
return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"plugin-results","plugin-results",2222563022),lt.objs.plugins.all_latest.call(null,new cljs.core.Keyword(null,"server-plugins","server-plugins",1760987784).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","draw-plugins-on-updated","lt.objs.plugins/draw-plugins-on-updated",604527958),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__draw_plugins_on_updated,new cljs.core.Keyword(null,"desc","desc",1016984067),"Plugin Manager: draw plugins on metadata update",new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"metadata.updated","metadata.updated",1526644846),null], null), null));
lt.objs.plugins.__BEH__get_latest_metadata_sha = (function __BEH__get_latest_metadata_sha(this$,sha){return lt.objs.plugins.latest_metadata_sha.call(null);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","get-latest-metadata-sha","lt.objs.plugins/get-latest-metadata-sha",1607213808),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__get_latest_metadata_sha,new cljs.core.Keyword(null,"desc","desc",1016984067),"Plugin Manager: get the latest metadata sha",new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"fetch-plugins","fetch-plugins",2680814335),null], null), null));
lt.objs.plugins.__BEH__render_server_plugins = (function __BEH__render_server_plugins(this$,plugins){var ul = lt.util.dom.$.call(null,new cljs.core.Keyword(null,".server-plugins",".server-plugins",2388894262),lt.object.__GT_content.call(null,this$));lt.util.dom.empty.call(null,ul);
return lt.util.dom.append.call(null,ul,lt.util.dom.fragment.call(null,cljs.core.map.call(null,lt.objs.plugins.server_plugin_ui,cljs.core.remove.call(null,(function (p1__10862_SHARP_){return lt.objs.plugins.installed_QMARK_.call(null,new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(p1__10862_SHARP_));
}),plugins))));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","render-server-plugins","lt.objs.plugins/render-server-plugins",797162336),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__render_server_plugins,new cljs.core.Keyword(null,"desc","desc",1016984067),"Plugin Manager: render plugin results",new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"plugin-results","plugin-results",2222563022),null], null), null));
lt.objs.plugins.__BEH__search_server_plugins = (function __BEH__search_server_plugins(this$,search){var plugins = lt.objs.plugins.all_latest.call(null,new cljs.core.Keyword(null,"server-plugins","server-plugins",1760987784).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.plugins.manager)));return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"plugin-results","plugin-results",2222563022),((cljs.core.empty_QMARK_.call(null,search))?plugins:lt.objs.plugins.search_plugins.call(null,plugins,search)));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","search-server-plugins","lt.objs.plugins/search-server-plugins",2575945774),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__search_server_plugins,new cljs.core.Keyword(null,"desc","desc",1016984067),"Plugin Manager: search plugins",new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"search-plugins!","search-plugins!",4139281016),null], null), null));
lt.objs.plugins.save_plugins = (function save_plugins(plugin_maps){var plugin_edn_file = lt.objs.files.join.call(null,lt.objs.settings.user_plugin_dir,"plugin.edn");var plugin_edn = lt.objs.settings.safe_read.call(null,new cljs.core.Keyword(null,"content","content",1965434859).cljs$core$IFn$_invoke$arity$1(lt.objs.files.open_sync.call(null,plugin_edn_file)),plugin_edn_file);var plugin_name = (function (){var G__10866 = new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin_edn);if(cljs.core.truth_(G__10866))
{} else
{throw (new Error([cljs.core.str("Assert failed: "),cljs.core.str("User plugin doesn't have a :name"),cljs.core.str("\n"),cljs.core.str(cljs.core.pr_str.call(null,new cljs.core.Symbol(null,"G__10866","G__10866",-1275038165,null)))].join('')));
}
return G__10866;
})();var deps = cljs.core.into.call(null,cljs.core.sorted_map.call(null),cljs.core.map.call(null,cljs.core.juxt.call(null,new cljs.core.Keyword(null,"name","name",1017277949),new cljs.core.Keyword(null,"version","version",1365512266)),cljs.core.remove.call(null,((function (plugin_edn_file,plugin_edn,plugin_name){
return (function (p1__10863_SHARP_){return cljs.core.contains_QMARK_.call(null,cljs.core.PersistentHashSet.fromArray([plugin_name], true),new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(p1__10863_SHARP_));
});})(plugin_edn_file,plugin_edn,plugin_name))
,cljs.core.vals.call(null,plugin_maps))));var plugin_edn_body = cljs.core.pr_str.call(null,cljs.core.assoc.call(null,plugin_edn,new cljs.core.Keyword(null,"dependencies","dependencies",1517678747),deps));return lt.objs.files.save.call(null,plugin_edn_file,clojure.string.replace_first.call(null,clojure.string.replace_first.call(null,clojure.string.replace.call(null,plugin_edn_body,/(\"\s*,|\{|\},)/,(function (p1__10864_SHARP_){return [cljs.core.str(p1__10864_SHARP_),cljs.core.str("\n")].join('');
})),/^\{\n/,"{"),/:dependencies/,";; Do not edit - :dependencies are auto-generated\n:dependencies"));
});
/**
* @param {...*} var_args
*/
lt.objs.plugins.__BEH__save_user_plugin_dependencies = (function() { 
var __BEH__save_user_plugin_dependencies__delegate = function (this$,opts){return lt.objs.plugins.save_plugins.call(null,lt.objs.plugins.available_plugins.call(null));
};
var __BEH__save_user_plugin_dependencies = function (this$,var_args){
var opts = null;if (arguments.length > 1) {
  opts = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1),0);} 
return __BEH__save_user_plugin_dependencies__delegate.call(this,this$,opts);};
__BEH__save_user_plugin_dependencies.cljs$lang$maxFixedArity = 1;
__BEH__save_user_plugin_dependencies.cljs$lang$applyTo = (function (arglist__10867){
var this$ = cljs.core.first(arglist__10867);
var opts = cljs.core.rest(arglist__10867);
return __BEH__save_user_plugin_dependencies__delegate(this$,opts);
});
__BEH__save_user_plugin_dependencies.cljs$core$IFn$_invoke$arity$variadic = __BEH__save_user_plugin_dependencies__delegate;
return __BEH__save_user_plugin_dependencies;
})()
;
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","save-user-plugin-dependencies","lt.objs.plugins/save-user-plugin-dependencies",1525590204),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__save_user_plugin_dependencies,new cljs.core.Keyword(null,"desc","desc",1016984067),"Saves dependencies to user's plugin.edn",new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"refresh!","refresh!",4597922840),null], null), null));
/**
* @param {...*} var_args
*/
lt.objs.plugins.__BEH__render_installed_plugins = (function() { 
var __BEH__render_installed_plugins__delegate = function (this$,p__10869){var map__10871 = p__10869;var map__10871__$1 = ((cljs.core.seq_QMARK_.call(null,map__10871))?cljs.core.apply.call(null,cljs.core.hash_map,map__10871):map__10871);var ignore_missing = cljs.core.get.call(null,map__10871__$1,new cljs.core.Keyword(null,"ignore-missing","ignore-missing",2124702685));lt.object.merge_BANG_.call(null,lt.objs.app.app,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("lt.objs.plugins","plugins","lt.objs.plugins/plugins",2920328683),lt.objs.plugins.available_plugins.call(null)], null));
if(cljs.core.truth_(ignore_missing))
{} else
{lt.objs.plugins.check_missing.call(null,new cljs.core.Keyword("lt.objs.plugins","plugins","lt.objs.plugins/plugins",2920328683).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.app.app)));
}
var ul = lt.util.dom.$.call(null,new cljs.core.Keyword(null,".plugins",".plugins",3398138660),lt.object.__GT_content.call(null,this$));lt.util.dom.empty.call(null,ul);
return lt.util.dom.append.call(null,ul,lt.util.dom.fragment.call(null,cljs.core.map.call(null,lt.objs.plugins.installed_plugin_ui,cljs.core.sort_by.call(null,(function (p1__10868_SHARP_){return new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(p1__10868_SHARP_).toUpperCase();
}),cljs.core.vals.call(null,new cljs.core.Keyword("lt.objs.plugins","plugins","lt.objs.plugins/plugins",2920328683).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.app.app)))))));
};
var __BEH__render_installed_plugins = function (this$,var_args){
var p__10869 = null;if (arguments.length > 1) {
  p__10869 = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1),0);} 
return __BEH__render_installed_plugins__delegate.call(this,this$,p__10869);};
__BEH__render_installed_plugins.cljs$lang$maxFixedArity = 1;
__BEH__render_installed_plugins.cljs$lang$applyTo = (function (arglist__10872){
var this$ = cljs.core.first(arglist__10872);
var p__10869 = cljs.core.rest(arglist__10872);
return __BEH__render_installed_plugins__delegate(this$,p__10869);
});
__BEH__render_installed_plugins.cljs$core$IFn$_invoke$arity$variadic = __BEH__render_installed_plugins__delegate;
return __BEH__render_installed_plugins;
})()
;
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","render-installed-plugins","lt.objs.plugins/render-installed-plugins",560702913),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__render_installed_plugins,new cljs.core.Keyword(null,"desc","desc",1016984067),"Plugin Manager: refresh installed plugins",new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"refresh!","refresh!",4597922840),null], null), null));
lt.objs.plugins.__BEH__on_close = (function __BEH__on_close(this$){return lt.objs.tabs.rem_BANG_.call(null,this$);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","on-close","lt.objs.plugins/on-close",1621607293),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__on_close,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"close","close",1108660586),null], null), null));
lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"plugin-manager.search","plugin-manager.search",4116247637),new cljs.core.Keyword(null,"hidden","hidden",4091384092),true,new cljs.core.Keyword(null,"desc","desc",1016984067),"Plugins: Search",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (term){var term__$1 = (function (){var or__3520__auto__ = term;if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return lt.util.dom.val.call(null,lt.util.dom.$.call(null,new cljs.core.Keyword(null,"input","input",1114262332),lt.object.__GT_content.call(null,lt.objs.plugins.manager)));
}
})();lt.object.merge_BANG_.call(null,lt.objs.plugins.manager,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tab","tab",1014018823),new cljs.core.Keyword(null,"server","server",4403045045)], null));
return lt.object.raise.call(null,lt.objs.plugins.manager,new cljs.core.Keyword(null,"search-plugins!","search-plugins!",4139281016),term__$1);
})], null));
lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"plugin-manager.refresh","plugin-manager.refresh",1814385266),new cljs.core.Keyword(null,"desc","desc",1016984067),"Plugins: Refresh plugin list",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){lt.object.raise.call(null,lt.objs.plugins.manager,new cljs.core.Keyword(null,"refresh!","refresh!",4597922840));
return lt.object.raise.call(null,lt.objs.plugins.manager,new cljs.core.Keyword(null,"fetch-plugins","fetch-plugins",2680814335));
})], null));
lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"plugin-manager.show","plugin-manager.show",3752328298),new cljs.core.Keyword(null,"desc","desc",1016984067),"Plugins: Show plugin manager",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){lt.objs.tabs.add_or_focus_BANG_.call(null,lt.objs.plugins.manager);
lt.util.dom.focus.call(null,lt.util.dom.$.call(null,new cljs.core.Keyword(null,"input","input",1114262332),lt.object.__GT_content.call(null,lt.objs.plugins.manager)));
return lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"plugin-manager.refresh","plugin-manager.refresh",1814385266));
})], null));
lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"plugin-manager.update-outdated","plugin-manager.update-outdated",1387765507),new cljs.core.Keyword(null,"desc","desc",1016984067),"Plugins: Update all outdated",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){var outdated = cljs.core.filter.call(null,lt.objs.plugins.outdated_QMARK_,cljs.core.vals.call(null,new cljs.core.Keyword("lt.objs.plugins","plugins","lt.objs.plugins/plugins",2920328683).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.app.app))));var names = cljs.core.atom.call(null,cljs.core.PersistentHashSet.EMPTY);var countdown = cljs.core.atom.call(null,cljs.core.count.call(null,outdated));var seq__10873 = cljs.core.seq.call(null,outdated);var chunk__10876 = null;var count__10877 = 0;var i__10878 = 0;while(true){
if((i__10878 < count__10877))
{var plugin = cljs.core._nth.call(null,chunk__10876,i__10878);if(cljs.core.seq.call(null,outdated))
{var cached_10881 = new cljs.core.Keyword(null,"latest-version","latest-version",1676217348).cljs$core$IFn$_invoke$arity$1(cljs.core.get.call(null,new cljs.core.Keyword(null,"server-plugins","server-plugins",1760987784).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.plugins.manager)),new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin)));lt.objs.plugins.discover_deps.call(null,cljs.core.assoc.call(null,plugin,new cljs.core.Keyword(null,"version","version",1365512266),cached_10881),((function (seq__10873,chunk__10876,count__10877,i__10878,cached_10881,plugin){
return (function (){cljs.core.swap_BANG_.call(null,names,cljs.core.conj,new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin));
cljs.core.swap_BANG_.call(null,countdown,cljs.core.dec);
lt.object.raise.call(null,lt.objs.plugins.manager,new cljs.core.Keyword(null,"refresh!","refresh!",4597922840));
if((cljs.core.deref.call(null,countdown) <= 0))
{lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"behaviors.reload","behaviors.reload",2942796600));
return lt.objs.notifos.set_msg_BANG_.call(null,cljs.core.apply.call(null,cljs.core.str,"Updated: ",cljs.core.interpose.call(null,", ",cljs.core.deref.call(null,names))));
} else
{return null;
}
});})(seq__10873,chunk__10876,count__10877,i__10878,cached_10881,plugin))
);
{
var G__10882 = seq__10873;
var G__10883 = chunk__10876;
var G__10884 = count__10877;
var G__10885 = (i__10878 + 1);
seq__10873 = G__10882;
chunk__10876 = G__10883;
count__10877 = G__10884;
i__10878 = G__10885;
continue;
}
} else
{{
var G__10886 = seq__10873;
var G__10887 = chunk__10876;
var G__10888 = count__10877;
var G__10889 = (i__10878 + 1);
seq__10873 = G__10886;
chunk__10876 = G__10887;
count__10877 = G__10888;
i__10878 = G__10889;
continue;
}
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__10873);if(temp__4092__auto__)
{var seq__10873__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10873__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__10873__$1);{
var G__10890 = cljs.core.chunk_rest.call(null,seq__10873__$1);
var G__10891 = c__4262__auto__;
var G__10892 = cljs.core.count.call(null,c__4262__auto__);
var G__10893 = 0;
seq__10873 = G__10890;
chunk__10876 = G__10891;
count__10877 = G__10892;
i__10878 = G__10893;
continue;
}
} else
{var plugin = cljs.core.first.call(null,seq__10873__$1);if(cljs.core.seq.call(null,outdated))
{var cached_10894 = new cljs.core.Keyword(null,"latest-version","latest-version",1676217348).cljs$core$IFn$_invoke$arity$1(cljs.core.get.call(null,new cljs.core.Keyword(null,"server-plugins","server-plugins",1760987784).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.plugins.manager)),new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin)));lt.objs.plugins.discover_deps.call(null,cljs.core.assoc.call(null,plugin,new cljs.core.Keyword(null,"version","version",1365512266),cached_10894),((function (seq__10873,chunk__10876,count__10877,i__10878,cached_10894,plugin,seq__10873__$1,temp__4092__auto__){
return (function (){cljs.core.swap_BANG_.call(null,names,cljs.core.conj,new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(plugin));
cljs.core.swap_BANG_.call(null,countdown,cljs.core.dec);
lt.object.raise.call(null,lt.objs.plugins.manager,new cljs.core.Keyword(null,"refresh!","refresh!",4597922840));
if((cljs.core.deref.call(null,countdown) <= 0))
{lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"behaviors.reload","behaviors.reload",2942796600));
return lt.objs.notifos.set_msg_BANG_.call(null,cljs.core.apply.call(null,cljs.core.str,"Updated: ",cljs.core.interpose.call(null,", ",cljs.core.deref.call(null,names))));
} else
{return null;
}
});})(seq__10873,chunk__10876,count__10877,i__10878,cached_10894,plugin,seq__10873__$1,temp__4092__auto__))
);
{
var G__10895 = cljs.core.next.call(null,seq__10873__$1);
var G__10896 = null;
var G__10897 = 0;
var G__10898 = 0;
seq__10873 = G__10895;
chunk__10876 = G__10896;
count__10877 = G__10897;
i__10878 = G__10898;
continue;
}
} else
{{
var G__10899 = cljs.core.next.call(null,seq__10873__$1);
var G__10900 = null;
var G__10901 = 0;
var G__10902 = 0;
seq__10873 = G__10899;
chunk__10876 = G__10900;
count__10877 = G__10901;
i__10878 = G__10902;
continue;
}
}
}
} else
{return null;
}
}
break;
}
})], null));
lt.objs.plugins.__BEH__init_plugins = (function __BEH__init_plugins(app){if(cljs.core.truth_(lt.objs.files.exists_QMARK_.call(null,lt.objs.plugins.user_plugins_dir)))
{} else
{lt.objs.files.mkdir.call(null,lt.objs.plugins.user_plugins_dir);
}
lt.object.raise.call(null,lt.objs.app.app,new cljs.core.Keyword(null,"create-user-plugin","create-user-plugin",2686594966));
lt.object.raise.call(null,lt.objs.app.app,new cljs.core.Keyword(null,"flatten-map-settings","flatten-map-settings",3992976911));
lt.object.merge_BANG_.call(null,lt.objs.app.app,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("lt.objs.plugins","plugins","lt.objs.plugins/plugins",2920328683),lt.objs.plugins.available_plugins.call(null)], null));
return lt.objs.plugins.check_missing.call(null,new cljs.core.Keyword("lt.objs.plugins","plugins","lt.objs.plugins/plugins",2920328683).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.app.app)));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","init-plugins","lt.objs.plugins/init-plugins",4096325174),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__init_plugins,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"pre-load","pre-load",3967767874),null], null), null));
lt.objs.plugins.__BEH__behaviors__DOT__refreshed_load_keys = (function __BEH__behaviors__DOT__refreshed_load_keys(){return lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"keymaps.reload","keymaps.reload",666881155));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","behaviors.refreshed-load-keys","lt.objs.plugins/behaviors.refreshed-load-keys",1002486638),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__behaviors__DOT__refreshed_load_keys,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"behaviors.refreshed","behaviors.refreshed",1338765023),null], null), null));
lt.objs.plugins.__BEH__plugin_behavior_diffs = (function __BEH__plugin_behavior_diffs(this$,diffs){var plugins = new cljs.core.Keyword("lt.objs.plugins","plugins","lt.objs.plugins/plugins",2920328683).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$));var dep_graph = lt.objs.plugins.plugin_dependency_graph.call(null,plugins);var dep_ordered = cljs.core.seq.call(null,lt.util.kahn.kahn_sort.call(null,dep_graph));var mapped = ((dep_ordered)?cljs.core.map.call(null,plugins,dep_ordered):cljs.core.vals.call(null,plugins));if(cljs.core.truth_((function (){var and__3508__auto__ = plugins;if(cljs.core.truth_(and__3508__auto__))
{return (cljs.core.not.call(null,dep_ordered)) && (cljs.core.not.call(null,new cljs.core.Keyword("lt.objs.plugins","cycle-warned","lt.objs.plugins/cycle-warned",1103523743).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))));
} else
{return and__3508__auto__;
}
})()))
{lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("lt.objs.plugins","cycle-warned","lt.objs.plugins/cycle-warned",1103523743),true], null));
lt.objs.popup.popup_BANG_.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"header","header",4087600639),"There's a cycle in your plugin dependencies.",new cljs.core.Keyword(null,"body","body",1016933652),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),"As a result, we can't come up with an optimal way to load them.\n                                                This means there may be unexpected consequences to being loaded out of order.\n                                                Here are the plugins causing the cycle: ",lt.objs.plugins.cycle_desc.call(null,lt.objs.plugins.__GT_cycles.call(null,dep_graph))], null),new cljs.core.Keyword(null,"buttons","buttons",1255256819),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1116631654),"ok"], null)], null)], null));
} else
{}
return cljs.core.concat.call(null,diffs,cljs.core.mapv.call(null,lt.objs.plugins.plugin_behaviors,mapped));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","plugin-behavior-diffs","lt.objs.plugins/plugin-behavior-diffs",1511349728),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__plugin_behavior_diffs,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"behaviors.diffs.plugin+","behaviors.diffs.plugin+",2303858461),null], null), null));
lt.objs.plugins.__BEH__plugin_keymap_diffs = (function __BEH__plugin_keymap_diffs(this$,diffs){return cljs.core.concat.call(null,diffs,cljs.core.filter.call(null,cljs.core.identity,cljs.core.mapv.call(null,lt.objs.settings.parse_key_file,new cljs.core.Keyword("lt.objs.plugins","keymaps","lt.objs.plugins/keymaps",4718281889).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)))));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","plugin-keymap-diffs","lt.objs.plugins/plugin-keymap-diffs",4431416675),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__plugin_keymap_diffs,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"keymap.diffs.plugin+","keymap.diffs.plugin+",4109982809),null], null), null));
lt.objs.plugins.__BEH__load_js = (function __BEH__load_js(this$,path){var _STAR_plugin_dir_STAR_10912 = lt.objs.plugins._STAR_plugin_dir_STAR_;var _STAR_force_reload_STAR_10913 = lt.util.load._STAR_force_reload_STAR_;try{lt.objs.plugins._STAR_plugin_dir_STAR_ = new cljs.core.Keyword("lt.objs.plugins","dir","lt.objs.plugins/dir",3366558592).cljs$core$IFn$_invoke$arity$1(lt.object._STAR_behavior_meta_STAR_);
lt.util.load._STAR_force_reload_STAR_ = new cljs.core.Keyword("lt.objs.plugins","force-reload","lt.objs.plugins/force-reload",4731263182).cljs$core$IFn$_invoke$arity$1(lt.object._STAR_behavior_meta_STAR_);
var paths = ((cljs.core.coll_QMARK_.call(null,path))?path:new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [path], null));var seq__10914 = cljs.core.seq.call(null,paths);var chunk__10915 = null;var count__10916 = 0;var i__10917 = 0;while(true){
if((i__10917 < count__10916))
{var path__$1 = cljs.core._nth.call(null,chunk__10915,i__10917);var path_10920__$2 = lt.objs.plugins.adjust_path.call(null,path__$1);if(cljs.core.truth_((function (){var or__3520__auto__ = lt.util.load._STAR_force_reload_STAR_;if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return cljs.core.not.call(null,cljs.core.get.call(null,new cljs.core.Keyword("lt.objs.plugins","loaded-files","lt.objs.plugins/loaded-files",2343697626).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),path_10920__$2));
}
})()))
{try{lt.util.load.js.call(null,path_10920__$2,true);
lt.object.update_BANG_.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("lt.objs.plugins","loaded-files","lt.objs.plugins/loaded-files",2343697626)], null),((function (seq__10914,chunk__10915,count__10916,i__10917,path_10920__$2,path__$1){
return (function (p1__10903_SHARP_){return cljs.core.conj.call(null,(function (){var or__3520__auto__ = p1__10903_SHARP_;if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return cljs.core.PersistentHashSet.EMPTY;
}
})(),path_10920__$2);
});})(seq__10914,chunk__10915,count__10916,i__10917,path_10920__$2,path__$1))
);
}catch (e10918){var e_10921 = e10918;lt.objs.console.error.call(null,[cljs.core.str("Error loading JS file: "),cljs.core.str(path_10920__$2),cljs.core.str(" : "),cljs.core.str(e_10921)].join(''),e_10921);
}} else
{}
{
var G__10922 = seq__10914;
var G__10923 = chunk__10915;
var G__10924 = count__10916;
var G__10925 = (i__10917 + 1);
seq__10914 = G__10922;
chunk__10915 = G__10923;
count__10916 = G__10924;
i__10917 = G__10925;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__10914);if(temp__4092__auto__)
{var seq__10914__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10914__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__10914__$1);{
var G__10926 = cljs.core.chunk_rest.call(null,seq__10914__$1);
var G__10927 = c__4262__auto__;
var G__10928 = cljs.core.count.call(null,c__4262__auto__);
var G__10929 = 0;
seq__10914 = G__10926;
chunk__10915 = G__10927;
count__10916 = G__10928;
i__10917 = G__10929;
continue;
}
} else
{var path__$1 = cljs.core.first.call(null,seq__10914__$1);var path_10930__$2 = lt.objs.plugins.adjust_path.call(null,path__$1);if(cljs.core.truth_((function (){var or__3520__auto__ = lt.util.load._STAR_force_reload_STAR_;if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return cljs.core.not.call(null,cljs.core.get.call(null,new cljs.core.Keyword("lt.objs.plugins","loaded-files","lt.objs.plugins/loaded-files",2343697626).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),path_10930__$2));
}
})()))
{try{lt.util.load.js.call(null,path_10930__$2,true);
lt.object.update_BANG_.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("lt.objs.plugins","loaded-files","lt.objs.plugins/loaded-files",2343697626)], null),((function (seq__10914,chunk__10915,count__10916,i__10917,path_10930__$2,path__$1,seq__10914__$1,temp__4092__auto__){
return (function (p1__10903_SHARP_){return cljs.core.conj.call(null,(function (){var or__3520__auto__ = p1__10903_SHARP_;if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return cljs.core.PersistentHashSet.EMPTY;
}
})(),path_10930__$2);
});})(seq__10914,chunk__10915,count__10916,i__10917,path_10930__$2,path__$1,seq__10914__$1,temp__4092__auto__))
);
}catch (e10919){var e_10931 = e10919;lt.objs.console.error.call(null,[cljs.core.str("Error loading JS file: "),cljs.core.str(path_10930__$2),cljs.core.str(" : "),cljs.core.str(e_10931)].join(''),e_10931);
}} else
{}
{
var G__10932 = cljs.core.next.call(null,seq__10914__$1);
var G__10933 = null;
var G__10934 = 0;
var G__10935 = 0;
seq__10914 = G__10932;
chunk__10915 = G__10933;
count__10916 = G__10934;
i__10917 = G__10935;
continue;
}
}
} else
{return null;
}
}
break;
}
}finally {lt.util.load._STAR_force_reload_STAR_ = _STAR_force_reload_STAR_10913;
lt.objs.plugins._STAR_plugin_dir_STAR_ = _STAR_plugin_dir_STAR_10912;
}});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","load-js","lt.objs.plugins/load-js",3701155451),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__load_js,new cljs.core.Keyword(null,"desc","desc",1016984067),"App: Load javascript file(s)",new cljs.core.Keyword(null,"params","params",4313443576),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1116631654),"path(s)"], null)], null),new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"object.instant-load","object.instant-load",4025433875),null], null), null),new cljs.core.Keyword(null,"type","type",1017479852),new cljs.core.Keyword(null,"user","user",1017503549));
lt.objs.plugins.__BEH__load_css = (function __BEH__load_css(this$,path){var paths = cljs.core.map.call(null,lt.objs.plugins.adjust_path,((cljs.core.coll_QMARK_.call(null,path))?path:new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [path], null)));var seq__10941 = cljs.core.seq.call(null,paths);var chunk__10942 = null;var count__10943 = 0;var i__10944 = 0;while(true){
if((i__10944 < count__10943))
{var path__$1 = cljs.core._nth.call(null,chunk__10942,i__10944);if(cljs.core.truth_((function (){var or__3520__auto__ = lt.util.load._STAR_force_reload_STAR_;if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return cljs.core.not.call(null,cljs.core.get.call(null,new cljs.core.Keyword("lt.objs.plugins","loaded-files","lt.objs.plugins/loaded-files",2343697626).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),path__$1));
}
})()))
{lt.object.update_BANG_.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("lt.objs.plugins","loaded-files","lt.objs.plugins/loaded-files",2343697626)], null),((function (seq__10941,chunk__10942,count__10943,i__10944,path__$1){
return (function (p1__10936_SHARP_){return cljs.core.conj.call(null,(function (){var or__3520__auto__ = p1__10936_SHARP_;if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return cljs.core.PersistentHashSet.EMPTY;
}
})(),path__$1);
});})(seq__10941,chunk__10942,count__10943,i__10944,path__$1))
);
lt.util.load.css.call(null,path__$1);
} else
{}
{
var G__10945 = seq__10941;
var G__10946 = chunk__10942;
var G__10947 = count__10943;
var G__10948 = (i__10944 + 1);
seq__10941 = G__10945;
chunk__10942 = G__10946;
count__10943 = G__10947;
i__10944 = G__10948;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__10941);if(temp__4092__auto__)
{var seq__10941__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10941__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__10941__$1);{
var G__10949 = cljs.core.chunk_rest.call(null,seq__10941__$1);
var G__10950 = c__4262__auto__;
var G__10951 = cljs.core.count.call(null,c__4262__auto__);
var G__10952 = 0;
seq__10941 = G__10949;
chunk__10942 = G__10950;
count__10943 = G__10951;
i__10944 = G__10952;
continue;
}
} else
{var path__$1 = cljs.core.first.call(null,seq__10941__$1);if(cljs.core.truth_((function (){var or__3520__auto__ = lt.util.load._STAR_force_reload_STAR_;if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return cljs.core.not.call(null,cljs.core.get.call(null,new cljs.core.Keyword("lt.objs.plugins","loaded-files","lt.objs.plugins/loaded-files",2343697626).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),path__$1));
}
})()))
{lt.object.update_BANG_.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("lt.objs.plugins","loaded-files","lt.objs.plugins/loaded-files",2343697626)], null),((function (seq__10941,chunk__10942,count__10943,i__10944,path__$1,seq__10941__$1,temp__4092__auto__){
return (function (p1__10936_SHARP_){return cljs.core.conj.call(null,(function (){var or__3520__auto__ = p1__10936_SHARP_;if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return cljs.core.PersistentHashSet.EMPTY;
}
})(),path__$1);
});})(seq__10941,chunk__10942,count__10943,i__10944,path__$1,seq__10941__$1,temp__4092__auto__))
);
lt.util.load.css.call(null,path__$1);
} else
{}
{
var G__10953 = cljs.core.next.call(null,seq__10941__$1);
var G__10954 = null;
var G__10955 = 0;
var G__10956 = 0;
seq__10941 = G__10953;
chunk__10942 = G__10954;
count__10943 = G__10955;
i__10944 = G__10956;
continue;
}
}
} else
{return null;
}
}
break;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","load-css","lt.objs.plugins/load-css",934792943),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__load_css,new cljs.core.Keyword(null,"desc","desc",1016984067),"App: Load css file(s)",new cljs.core.Keyword(null,"params","params",4313443576),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1116631654),"path(s)"], null)], null),new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"object.instant","object.instant",773332388),null], null), null),new cljs.core.Keyword(null,"type","type",1017479852),new cljs.core.Keyword(null,"user","user",1017503549));
lt.objs.plugins.__BEH__load_keymap = (function __BEH__load_keymap(this$,path){var path__$1 = lt.objs.plugins.adjust_path.call(null,path);if(cljs.core.truth_(new cljs.core.Keyword("lt.objs.plugins","keymaps","lt.objs.plugins/keymaps",4718281889).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))))
{return lt.object.update_BANG_.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("lt.objs.plugins","keymaps","lt.objs.plugins/keymaps",4718281889)], null),cljs.core.conj,path__$1);
} else
{return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("lt.objs.plugins","keymaps","lt.objs.plugins/keymaps",4718281889),cljs.core.PersistentHashSet.fromArray([path__$1], true)], null));
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","load-keymap","lt.objs.plugins/load-keymap",1368994999),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__load_keymap,new cljs.core.Keyword(null,"desc","desc",1016984067),"App: Load a keymap file",new cljs.core.Keyword(null,"params","params",4313443576),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1116631654),"path"], null)], null),new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"object.instant","object.instant",773332388),null], null), null),new cljs.core.Keyword(null,"type","type",1017479852),new cljs.core.Keyword(null,"user","user",1017503549));
lt.objs.plugins.__BEH__check_for_plugin_file = (function __BEH__check_for_plugin_file(this$){var path = new cljs.core.Keyword(null,"path","path",1017337751).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"info","info",1017141280).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));var plugin_edn = (function (){var or__3520__auto__ = lt.objs.files.walk_up_find.call(null,path,"plugin.json");if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return lt.objs.files.walk_up_find.call(null,path,"plugin.edn");
}
})();if(cljs.core.truth_(plugin_edn))
{lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("lt.objs.plugins","plugin-path","lt.objs.plugins/plugin-path",2063828362),lt.objs.files.parent.call(null,plugin_edn)], null));
return lt.object.add_tags.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"plugin.file","plugin.file",1865693897)], null));
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.plugins","check-for-plugin-file","lt.objs.plugins/check-for-plugin-file",3384140800),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.plugins.__BEH__check_for_plugin_file,new cljs.core.Keyword(null,"desc","desc",1016984067),"Plugin: Determine if this is a plugin file",new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"create","create",3956577390),null], null), null));
lt.object.tag_behaviors.call(null,new cljs.core.Keyword(null,"app","app",1014001043),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("lt.objs.plugins","init-plugins","lt.objs.plugins/init-plugins",4096325174),new cljs.core.Keyword("lt.objs.plugins","plugin-behavior-diffs","lt.objs.plugins/plugin-behavior-diffs",1511349728),new cljs.core.Keyword("lt.objs.plugins","plugin-keymap-diffs","lt.objs.plugins/plugin-keymap-diffs",4431416675)], null));
