// Compiled by ClojureScript 0.0-2138
goog.provide('lt.objs.menu');
goog.require('cljs.core');
goog.require('lt.objs.app');
goog.require('lt.util.dom');
goog.require('lt.objs.platform');
goog.require('lt.util.dom');
goog.require('clojure.string');
goog.require('lt.objs.command');
goog.require('lt.objs.platform');
goog.require('lt.objs.app');
goog.require('clojure.string');
goog.require('lt.objs.keyboard');
goog.require('lt.object');
goog.require('lt.object');
goog.require('lt.objs.command');
goog.require('lt.objs.keyboard');
lt.objs.menu.remote = require("remote");
lt.objs.menu.Menu = lt.objs.menu.remote.require("menu");
lt.objs.menu.MenuItem = lt.objs.menu.remote.require("menu-item");
lt.objs.menu.menu_item = (function menu_item(opts){var opts__$1 = ((cljs.core.not.call(null,new cljs.core.Keyword(null,"submenu","submenu",3441075985).cljs$core$IFn$_invoke$arity$1(opts)))?opts:cljs.core.assoc.call(null,opts,new cljs.core.Keyword(null,"submenu","submenu",3441075985),lt.objs.menu.submenu.call(null,new cljs.core.Keyword(null,"submenu","submenu",3441075985).cljs$core$IFn$_invoke$arity$1(opts))));var opts2 = (cljs.core.truth_(new cljs.core.Keyword(null,"click","click",1108654330).cljs$core$IFn$_invoke$arity$1(opts__$1))?cljs.core.assoc.call(null,opts__$1,new cljs.core.Keyword(null,"click","click",1108654330),((function (opts__$1){
return (function (){try{var temp__4092__auto__ = new cljs.core.Keyword(null,"click","click",1108654330).cljs$core$IFn$_invoke$arity$1(opts__$1);if(cljs.core.truth_(temp__4092__auto__))
{var func = temp__4092__auto__;return func.call(null);
} else
{return null;
}
}catch (e10143){var e = e10143;return lt.objs.console.error(e);
}});})(opts__$1))
):opts__$1);return (new lt.objs.menu.MenuItem(cljs.core.clj__GT_js.call(null,opts__$1)));
});
lt.objs.menu.submenu = (function submenu(items){var menu = (new lt.objs.menu.Menu());var seq__10150_10156 = cljs.core.seq.call(null,items);var chunk__10152_10157 = null;var count__10153_10158 = 0;var i__10154_10159 = 0;while(true){
if((i__10154_10159 < count__10153_10158))
{var i_10160 = cljs.core._nth.call(null,chunk__10152_10157,i__10154_10159);if(cljs.core.truth_(i_10160))
{menu.append(lt.objs.menu.menu_item.call(null,i_10160));
{
var G__10161 = seq__10150_10156;
var G__10162 = chunk__10152_10157;
var G__10163 = count__10153_10158;
var G__10164 = (i__10154_10159 + 1);
seq__10150_10156 = G__10161;
chunk__10152_10157 = G__10162;
count__10153_10158 = G__10163;
i__10154_10159 = G__10164;
continue;
}
} else
{{
var G__10165 = seq__10150_10156;
var G__10166 = chunk__10152_10157;
var G__10167 = count__10153_10158;
var G__10168 = (i__10154_10159 + 1);
seq__10150_10156 = G__10165;
chunk__10152_10157 = G__10166;
count__10153_10158 = G__10167;
i__10154_10159 = G__10168;
continue;
}
}
} else
{var temp__4092__auto___10169 = cljs.core.seq.call(null,seq__10150_10156);if(temp__4092__auto___10169)
{var seq__10150_10170__$1 = temp__4092__auto___10169;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10150_10170__$1))
{var c__4262__auto___10171 = cljs.core.chunk_first.call(null,seq__10150_10170__$1);{
var G__10172 = cljs.core.chunk_rest.call(null,seq__10150_10170__$1);
var G__10173 = c__4262__auto___10171;
var G__10174 = cljs.core.count.call(null,c__4262__auto___10171);
var G__10175 = 0;
seq__10150_10156 = G__10172;
chunk__10152_10157 = G__10173;
count__10153_10158 = G__10174;
i__10154_10159 = G__10175;
continue;
}
} else
{var i_10176 = cljs.core.first.call(null,seq__10150_10170__$1);if(cljs.core.truth_(i_10176))
{menu.append(lt.objs.menu.menu_item.call(null,i_10176));
{
var G__10177 = cljs.core.next.call(null,seq__10150_10170__$1);
var G__10178 = null;
var G__10179 = 0;
var G__10180 = 0;
seq__10150_10156 = G__10177;
chunk__10152_10157 = G__10178;
count__10153_10158 = G__10179;
i__10154_10159 = G__10180;
continue;
}
} else
{{
var G__10181 = cljs.core.next.call(null,seq__10150_10170__$1);
var G__10182 = null;
var G__10183 = 0;
var G__10184 = 0;
seq__10150_10156 = G__10181;
chunk__10152_10157 = G__10182;
count__10153_10158 = G__10183;
i__10154_10159 = G__10184;
continue;
}
}
}
} else
{}
}
break;
}
return menu;
});
lt.objs.menu.menu = (function menu(items){var menu_instance = (new lt.objs.menu.Menu());var seq__10189_10193 = cljs.core.seq.call(null,items);var chunk__10190_10194 = null;var count__10191_10195 = 0;var i__10192_10196 = 0;while(true){
if((i__10192_10196 < count__10191_10195))
{var i_10197 = cljs.core._nth.call(null,chunk__10190_10194,i__10192_10196);menu_instance.append(lt.objs.menu.menu_item.call(null,i_10197));
{
var G__10198 = seq__10189_10193;
var G__10199 = chunk__10190_10194;
var G__10200 = count__10191_10195;
var G__10201 = (i__10192_10196 + 1);
seq__10189_10193 = G__10198;
chunk__10190_10194 = G__10199;
count__10191_10195 = G__10200;
i__10192_10196 = G__10201;
continue;
}
} else
{var temp__4092__auto___10202 = cljs.core.seq.call(null,seq__10189_10193);if(temp__4092__auto___10202)
{var seq__10189_10203__$1 = temp__4092__auto___10202;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10189_10203__$1))
{var c__4262__auto___10204 = cljs.core.chunk_first.call(null,seq__10189_10203__$1);{
var G__10205 = cljs.core.chunk_rest.call(null,seq__10189_10203__$1);
var G__10206 = c__4262__auto___10204;
var G__10207 = cljs.core.count.call(null,c__4262__auto___10204);
var G__10208 = 0;
seq__10189_10193 = G__10205;
chunk__10190_10194 = G__10206;
count__10191_10195 = G__10207;
i__10192_10196 = G__10208;
continue;
}
} else
{var i_10209 = cljs.core.first.call(null,seq__10189_10203__$1);menu_instance.append(lt.objs.menu.menu_item.call(null,i_10209));
{
var G__10210 = cljs.core.next.call(null,seq__10189_10203__$1);
var G__10211 = null;
var G__10212 = 0;
var G__10213 = 0;
seq__10189_10193 = G__10210;
chunk__10190_10194 = G__10211;
count__10191_10195 = G__10212;
i__10192_10196 = G__10213;
continue;
}
}
} else
{}
}
break;
}
return menu_instance;
});
lt.objs.menu.show_menu = (function show_menu(m){return m.popup(lt.objs.menu.remote.getCurrentWindow());
});
lt.util.dom.on.call(null,lt.util.dom.$.call(null,new cljs.core.Keyword(null,"body","body",1016933652)),new cljs.core.Keyword(null,"contextmenu","contextmenu",911789824),(function (e){lt.util.dom.prevent.call(null,e);
lt.util.dom.stop_propagation.call(null,e);
return false;
}));
lt.objs.menu.set_menubar = (function set_menubar(items){var menubar = (new lt.objs.menu.Menu());var seq__10220_10226 = cljs.core.seq.call(null,items);var chunk__10222_10227 = null;var count__10223_10228 = 0;var i__10224_10229 = 0;while(true){
if((i__10224_10229 < count__10223_10228))
{var i_10230 = cljs.core._nth.call(null,chunk__10222_10227,i__10224_10229);if(cljs.core.truth_(i_10230))
{menubar.append(lt.objs.menu.menu_item.call(null,i_10230));
{
var G__10231 = seq__10220_10226;
var G__10232 = chunk__10222_10227;
var G__10233 = count__10223_10228;
var G__10234 = (i__10224_10229 + 1);
seq__10220_10226 = G__10231;
chunk__10222_10227 = G__10232;
count__10223_10228 = G__10233;
i__10224_10229 = G__10234;
continue;
}
} else
{{
var G__10235 = seq__10220_10226;
var G__10236 = chunk__10222_10227;
var G__10237 = count__10223_10228;
var G__10238 = (i__10224_10229 + 1);
seq__10220_10226 = G__10235;
chunk__10222_10227 = G__10236;
count__10223_10228 = G__10237;
i__10224_10229 = G__10238;
continue;
}
}
} else
{var temp__4092__auto___10239 = cljs.core.seq.call(null,seq__10220_10226);if(temp__4092__auto___10239)
{var seq__10220_10240__$1 = temp__4092__auto___10239;if(cljs.core.chunked_seq_QMARK_.call(null,seq__10220_10240__$1))
{var c__4262__auto___10241 = cljs.core.chunk_first.call(null,seq__10220_10240__$1);{
var G__10242 = cljs.core.chunk_rest.call(null,seq__10220_10240__$1);
var G__10243 = c__4262__auto___10241;
var G__10244 = cljs.core.count.call(null,c__4262__auto___10241);
var G__10245 = 0;
seq__10220_10226 = G__10242;
chunk__10222_10227 = G__10243;
count__10223_10228 = G__10244;
i__10224_10229 = G__10245;
continue;
}
} else
{var i_10246 = cljs.core.first.call(null,seq__10220_10240__$1);if(cljs.core.truth_(i_10246))
{menubar.append(lt.objs.menu.menu_item.call(null,i_10246));
{
var G__10247 = cljs.core.next.call(null,seq__10220_10240__$1);
var G__10248 = null;
var G__10249 = 0;
var G__10250 = 0;
seq__10220_10226 = G__10247;
chunk__10222_10227 = G__10248;
count__10223_10228 = G__10249;
i__10224_10229 = G__10250;
continue;
}
} else
{{
var G__10251 = cljs.core.next.call(null,seq__10220_10240__$1);
var G__10252 = null;
var G__10253 = 0;
var G__10254 = 0;
seq__10220_10226 = G__10251;
chunk__10222_10227 = G__10252;
count__10223_10228 = G__10253;
i__10224_10229 = G__10254;
continue;
}
}
}
} else
{}
}
break;
}
return lt.objs.menu.Menu.setApplicationMenu.call(null,menubar);
});
lt.objs.menu.key_mappings = new cljs.core.PersistentArrayMap(null, 4, ["cmd","Command","shift","Shift","ctrl","Control","alt","Alt"], null);
lt.objs.menu.command__GT_menu_binding = (function command__GT_menu_binding(cmd){var ks = cljs.core.first.call(null,lt.objs.keyboard.cmd__GT_current_binding.call(null,cmd));var parts = clojure.string.split.call(null,ks," ");var parts__$1 = (function (){var iter__4231__auto__ = ((function (ks,parts){
return (function iter__10275(s__10276){return (new cljs.core.LazySeq(null,((function (ks,parts){
return (function (){var s__10276__$1 = s__10276;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__10276__$1);if(temp__4092__auto__)
{var s__10276__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__10276__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10276__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10278 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10277 = 0;while(true){
if((i__10277 < size__4230__auto__))
{var part = cljs.core._nth.call(null,c__4229__auto__,i__10277);var ks__$1 = (function (){var iter__4231__auto__ = ((function (i__10277,part,c__4229__auto__,size__4230__auto__,b__10278,s__10276__$2,temp__4092__auto__,ks,parts){
return (function iter__10287(s__10288){return (new cljs.core.LazySeq(null,((function (i__10277,part,c__4229__auto__,size__4230__auto__,b__10278,s__10276__$2,temp__4092__auto__,ks,parts){
return (function (){var s__10288__$1 = s__10288;while(true){
var temp__4092__auto____$1 = cljs.core.seq.call(null,s__10288__$1);if(temp__4092__auto____$1)
{var s__10288__$2 = temp__4092__auto____$1;if(cljs.core.chunked_seq_QMARK_.call(null,s__10288__$2))
{var c__4229__auto____$1 = cljs.core.chunk_first.call(null,s__10288__$2);var size__4230__auto____$1 = cljs.core.count.call(null,c__4229__auto____$1);var b__10290 = cljs.core.chunk_buffer.call(null,size__4230__auto____$1);if((function (){var i__10289 = 0;while(true){
if((i__10289 < size__4230__auto____$1))
{var key = cljs.core._nth.call(null,c__4229__auto____$1,i__10289);cljs.core.chunk_append.call(null,b__10290,(function (){var or__3520__auto__ = lt.objs.menu.key_mappings.call(null,key);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return key;
}
})());
{
var G__10295 = (i__10289 + 1);
i__10289 = G__10295;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10290),iter__10287.call(null,cljs.core.chunk_rest.call(null,s__10288__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10290),null);
}
} else
{var key = cljs.core.first.call(null,s__10288__$2);return cljs.core.cons.call(null,(function (){var or__3520__auto__ = lt.objs.menu.key_mappings.call(null,key);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return key;
}
})(),iter__10287.call(null,cljs.core.rest.call(null,s__10288__$2)));
}
} else
{return null;
}
break;
}
});})(i__10277,part,c__4229__auto__,size__4230__auto__,b__10278,s__10276__$2,temp__4092__auto__,ks,parts))
,null,null));
});})(i__10277,part,c__4229__auto__,size__4230__auto__,b__10278,s__10276__$2,temp__4092__auto__,ks,parts))
;return iter__4231__auto__.call(null,clojure.string.split.call(null,part,"-"));
})();cljs.core.chunk_append.call(null,b__10278,clojure.string.join.call(null,"+",ks__$1));
{
var G__10296 = (i__10277 + 1);
i__10277 = G__10296;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10278),iter__10275.call(null,cljs.core.chunk_rest.call(null,s__10276__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10278),null);
}
} else
{var part = cljs.core.first.call(null,s__10276__$2);var ks__$1 = (function (){var iter__4231__auto__ = ((function (part,s__10276__$2,temp__4092__auto__,ks,parts){
return (function iter__10291(s__10292){return (new cljs.core.LazySeq(null,((function (part,s__10276__$2,temp__4092__auto__,ks,parts){
return (function (){var s__10292__$1 = s__10292;while(true){
var temp__4092__auto____$1 = cljs.core.seq.call(null,s__10292__$1);if(temp__4092__auto____$1)
{var s__10292__$2 = temp__4092__auto____$1;if(cljs.core.chunked_seq_QMARK_.call(null,s__10292__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__10292__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__10294 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__10293 = 0;while(true){
if((i__10293 < size__4230__auto__))
{var key = cljs.core._nth.call(null,c__4229__auto__,i__10293);cljs.core.chunk_append.call(null,b__10294,(function (){var or__3520__auto__ = lt.objs.menu.key_mappings.call(null,key);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return key;
}
})());
{
var G__10297 = (i__10293 + 1);
i__10293 = G__10297;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10294),iter__10291.call(null,cljs.core.chunk_rest.call(null,s__10292__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__10294),null);
}
} else
{var key = cljs.core.first.call(null,s__10292__$2);return cljs.core.cons.call(null,(function (){var or__3520__auto__ = lt.objs.menu.key_mappings.call(null,key);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return key;
}
})(),iter__10291.call(null,cljs.core.rest.call(null,s__10292__$2)));
}
} else
{return null;
}
break;
}
});})(part,s__10276__$2,temp__4092__auto__,ks,parts))
,null,null));
});})(part,s__10276__$2,temp__4092__auto__,ks,parts))
;return iter__4231__auto__.call(null,clojure.string.split.call(null,part,"-"));
})();return cljs.core.cons.call(null,clojure.string.join.call(null,"+",ks__$1),iter__10275.call(null,cljs.core.rest.call(null,s__10276__$2)));
}
} else
{return null;
}
break;
}
});})(ks,parts))
,null,null));
});})(ks,parts))
;return iter__4231__auto__.call(null,parts);
})();if((cljs.core.seq.call(null,parts__$1)) && ((!(lt.objs.platform.mac_QMARK_.call(null))) || (cljs.core._EQ_.call(null,cljs.core.count.call(null,parts__$1),1))))
{return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),clojure.string.join.call(null," ",parts__$1)], null);
} else
{return null;
}
});
lt.objs.menu.cmd_item = (function() {
var cmd_item = null;
var cmd_item__2 = (function (label,cmd){return cmd_item.call(null,label,cmd,cljs.core.PersistentArrayMap.EMPTY);
});
var cmd_item__3 = (function (label,cmd,opts){return cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),label,new cljs.core.Keyword(null,"click","click",1108654330),(cljs.core.truth_(new cljs.core.Keyword(null,"role","role",1017410536).cljs$core$IFn$_invoke$arity$1(opts))?null:(function (){return lt.objs.command.exec_BANG_.call(null,cmd);
}))], null),opts,lt.objs.menu.command__GT_menu_binding.call(null,cmd));
});
cmd_item = function(label,cmd,opts){
switch(arguments.length){
case 2:
return cmd_item__2.call(this,label,cmd);
case 3:
return cmd_item__3.call(this,label,cmd,opts);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
cmd_item.cljs$core$IFn$_invoke$arity$2 = cmd_item__2;
cmd_item.cljs$core$IFn$_invoke$arity$3 = cmd_item__3;
return cmd_item;
})()
;
lt.objs.menu.unknown_menu = (function unknown_menu(){return lt.objs.menu.set_menubar.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [((lt.objs.platform.mac_QMARK_.call(null))?new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"About Light Table",new cljs.core.Keyword(null,"version","version",1365512266)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Hide Light Table",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+H",new cljs.core.Keyword(null,"role","role",1017410536),"hide"], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Hide Others",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+Alt+H",new cljs.core.Keyword(null,"role","role",1017410536),"hideothers"], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Quit Light Table",new cljs.core.Keyword(null,"quit","quit",1017386433),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+Q"], null))], null)], null):null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Edit",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Undo",new cljs.core.Keyword(null,"editor.undo","editor.undo",4270768183),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"undo",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+Z"], null)),lt.objs.menu.cmd_item.call(null,"Redo",new cljs.core.Keyword(null,"editor.redo","editor.redo",4270670161),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"redo",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+Shift+Z"], null)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Cut",new cljs.core.Keyword(null,"editor.cut","editor.cut",3751346611),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"cut",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+X"], null)),lt.objs.menu.cmd_item.call(null,"Copy",new cljs.core.Keyword(null,"editor.copy","editor.copy",4270233288),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"copy",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+C"], null)),lt.objs.menu.cmd_item.call(null,"Paste",new cljs.core.Keyword(null,"editor.paste","editor.paste",3187448388),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"paste",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+V"], null)),lt.objs.menu.cmd_item.call(null,"Select All",new cljs.core.Keyword(null,"editor.select-all","editor.select-all",2519334883),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"selectall",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+A"], null))], null)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Window",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Minimize",new cljs.core.Keyword(null,"window.minimize","window.minimize",2477637198),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"minimize",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+M"], null)),lt.objs.menu.cmd_item.call(null,"Close window",new cljs.core.Keyword(null,"window.close","window.close",3118917100),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"close",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+W"], null))], null)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Help",new cljs.core.Keyword(null,"submenu","submenu",3441075985),cljs.core.PersistentVector.EMPTY], null)], null));
});
lt.objs.menu.main_menu = (function main_menu(){return lt.objs.menu.set_menubar.call(null,new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [((lt.objs.platform.mac_QMARK_.call(null))?new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"About Light Table",new cljs.core.Keyword(null,"version","version",1365512266)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Hide Light Table",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+H",new cljs.core.Keyword(null,"role","role",1017410536),"hide"], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"label","label",1116631654),"Hide Others",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+Alt+H",new cljs.core.Keyword(null,"role","role",1017410536),"hideothers"], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Quit Light Table",new cljs.core.Keyword(null,"quit","quit",1017386433),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Command+Q"], null))], null)], null):null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"&File",new cljs.core.Keyword(null,"submenu","submenu",3441075985),cljs.core.into.call(null,new cljs.core.PersistentVector(null, 11, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"New file",new cljs.core.Keyword(null,"new-file","new-file",2344641787)),lt.objs.menu.cmd_item.call(null,"Open file",new cljs.core.Keyword(null,"open-file","open-file",2513650321)),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Open folder",new cljs.core.Keyword(null,"click","click",1108654330),(function (){lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"workspace.show","workspace.show",1768599592),new cljs.core.Keyword(null,"force","force",1111522909));
return lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"workspace.add-folder","workspace.add-folder",2772643205));
})], null),lt.objs.menu.cmd_item.call(null,"Open recent workspace",new cljs.core.Keyword(null,"workspace.show-recents","workspace.show-recents",1806500563),cljs.core.PersistentArrayMap.EMPTY),lt.objs.menu.cmd_item.call(null,"Save file",new cljs.core.Keyword(null,"save","save",1017427183)),lt.objs.menu.cmd_item.call(null,"Save file as..",new cljs.core.Keyword(null,"save-as","save-as",2886670836)),lt.objs.menu.cmd_item.call(null,"Close file",new cljs.core.Keyword(null,"tabs.close","tabs.close",4150844154)),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Settings",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"User keymap",new cljs.core.Keyword(null,"keymap.modify-user","keymap.modify-user",625546911)),lt.objs.menu.cmd_item.call(null,"User behaviors",new cljs.core.Keyword(null,"behaviors.modify-user","behaviors.modify-user",4216959587)),lt.objs.menu.cmd_item.call(null,"User script",new cljs.core.Keyword(null,"user.modify-user","user.modify-user",581252813))], null)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"New window",new cljs.core.Keyword(null,"window.new","window.new",2875320852)),lt.objs.menu.cmd_item.call(null,"Close window",new cljs.core.Keyword(null,"window.close","window.close",3118917100))], null),((lt.objs.platform.mac_QMARK_.call(null))?null:new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"About Light Table",new cljs.core.Keyword(null,"version","version",1365512266)),lt.objs.menu.cmd_item.call(null,"Quit Light Table",new cljs.core.Keyword(null,"quit","quit",1017386433),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"Control+Q"], null))], null)))], null),((lt.objs.platform.mac_QMARK_.call(null))?new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Edit",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Undo",new cljs.core.Keyword(null,"editor.undo","editor.undo",4270768183),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"undo",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+Z"], null)),lt.objs.menu.cmd_item.call(null,"Redo",new cljs.core.Keyword(null,"editor.redo","editor.redo",4270670161),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"redo",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+Shift+Z"], null)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Cut",new cljs.core.Keyword(null,"editor.cut","editor.cut",3751346611),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"cut",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+X"], null)),lt.objs.menu.cmd_item.call(null,"Copy",new cljs.core.Keyword(null,"editor.copy","editor.copy",4270233288),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"copy",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+C"], null)),lt.objs.menu.cmd_item.call(null,"Paste",new cljs.core.Keyword(null,"editor.paste","editor.paste",3187448388),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"paste",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+V"], null)),lt.objs.menu.cmd_item.call(null,"Select All",new cljs.core.Keyword(null,"editor.select-all","editor.select-all",2519334883),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"role","role",1017410536),"selectall",new cljs.core.Keyword(null,"accelerator","accelerator",1975113181),"CommandOrControl+A"], null))], null)], null):new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"&Edit",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Undo",new cljs.core.Keyword(null,"editor.undo","editor.undo",4270768183)),lt.objs.menu.cmd_item.call(null,"Redo",new cljs.core.Keyword(null,"editor.redo","editor.redo",4270670161)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Cut",new cljs.core.Keyword(null,"editor.cut","editor.cut",3751346611)),lt.objs.menu.cmd_item.call(null,"Copy",new cljs.core.Keyword(null,"editor.copy","editor.copy",4270233288)),lt.objs.menu.cmd_item.call(null,"Paste",new cljs.core.Keyword(null,"editor.paste","editor.paste",3187448388)),lt.objs.menu.cmd_item.call(null,"Select All",new cljs.core.Keyword(null,"editor.select-all","editor.select-all",2519334883))], null)], null)),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"&View",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 10, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Workspace",new cljs.core.Keyword(null,"workspace.show","workspace.show",1768599592)),lt.objs.menu.cmd_item.call(null,"Connections",new cljs.core.Keyword(null,"show-connect","show-connect",2165693836)),lt.objs.menu.cmd_item.call(null,"Navigator",new cljs.core.Keyword(null,"navigate-workspace-transient","navigate-workspace-transient",615022696)),lt.objs.menu.cmd_item.call(null,"Commands",new cljs.core.Keyword(null,"show-commandbar-transient","show-commandbar-transient",3110127655)),lt.objs.menu.cmd_item.call(null,"Plugin Manager",new cljs.core.Keyword(null,"plugin-manager.show","plugin-manager.show",3752328298)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Language docs",new cljs.core.Keyword(null,"docs.search.show","docs.search.show",4500636610)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1017479852),"separator"], null),lt.objs.menu.cmd_item.call(null,"Console",new cljs.core.Keyword(null,"toggle-console","toggle-console",4454540112)),lt.objs.menu.cmd_item.call(null,"Developer Tools",new cljs.core.Keyword(null,"dev-inspector","dev-inspector",4263722673))], null)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"&Window",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Minimize",new cljs.core.Keyword(null,"window.minimize","window.minimize",2477637198)),lt.objs.menu.cmd_item.call(null,"Maximize",new cljs.core.Keyword(null,"window.maximize","window.maximize",4253833852)),lt.objs.menu.cmd_item.call(null,"Fullscreen",new cljs.core.Keyword(null,"window.fullscreen","window.fullscreen",3710835691))], null)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"&Help",new cljs.core.Keyword(null,"submenu","submenu",3441075985),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.menu.cmd_item.call(null,"Documentation",new cljs.core.Keyword(null,"show-docs","show-docs",3358896765)),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Report an Issue",new cljs.core.Keyword(null,"click","click",1108654330),(function (){return lt.objs.command.exec_BANG_.call(null,new cljs.core.Keyword(null,"add-browser-tab","add-browser-tab",3663273910),"https://github.com/LightTable/LightTable/issues?state=open");
})], null),((lt.objs.platform.mac_QMARK_.call(null))?null:lt.objs.menu.cmd_item.call(null,"About Light Table",new cljs.core.Keyword(null,"version","version",1365512266)))], null)], null)], null));
});
lt.objs.menu.__BEH__create_menu = (function __BEH__create_menu(this$){if(lt.objs.platform.mac_QMARK_.call(null))
{lt.objs.app.win.menu = null;
} else
{}
return lt.objs.menu.main_menu.call(null);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.menu","create-menu","lt.objs.menu/create-menu",1707993513),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.menu.__BEH__create_menu,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"init","init",1017141378),null], null), null));
lt.objs.menu.__BEH__recreate_menu = (function __BEH__recreate_menu(app){if(lt.objs.platform.mac_QMARK_.call(null))
{return lt.objs.menu.main_menu.call(null);
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.menu","recreate-menu","lt.objs.menu/recreate-menu",912131484),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.menu.__BEH__recreate_menu,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"app.keys.load","app.keys.load",3209213061),null], null), null),new cljs.core.Keyword(null,"debounce","debounce",1556599227),20);
lt.objs.menu.__BEH__set_menu = (function __BEH__set_menu(this$){if(lt.objs.platform.mac_QMARK_.call(null))
{return lt.objs.menu.main_menu.call(null);
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.menu","set-menu","lt.objs.menu/set-menu",4093310231),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.menu.__BEH__set_menu,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"focus","focus",1111509066),null], null), null));
lt.objs.menu.__BEH__remove_menu_close = (function __BEH__remove_menu_close(this$){if(lt.objs.platform.mac_QMARK_.call(null))
{return lt.objs.menu.unknown_menu.call(null);
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.menu","remove-menu-close","lt.objs.menu/remove-menu-close",1602484750),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.menu.__BEH__remove_menu_close,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"blur","blur",1016931289),null,new cljs.core.Keyword(null,"closed","closed",3951351006),null], null), null));
lt.objs.menu.__BEH__menu_BANG_ = (function __BEH__menu_BANG_(this$,e){var items_10298 = cljs.core.sort_by.call(null,new cljs.core.Keyword(null,"order","order",1119910592),cljs.core.filter.call(null,cljs.core.identity,lt.object.raise_reduce.call(null,this$,new cljs.core.Keyword(null,"menu+","menu+",1117686302),cljs.core.PersistentVector.EMPTY,e)));lt.objs.menu.show_menu.call(null,lt.objs.menu.menu.call(null,items_10298));
lt.util.dom.prevent.call(null,e);
return lt.util.dom.stop_propagation.call(null,e);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.menu","menu!","lt.objs.menu/menu!",2137957439),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.menu.__BEH__menu_BANG_,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"menu!","menu!",1117686292),null], null), null));
