// Compiled by ClojureScript 0.0-2138
goog.provide('lt.objs.clients.devtools');
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.util.js');
goog.require('lt.util.dom');
goog.require('cljs.reader');
goog.require('crate.core');
goog.require('lt.util.dom');
goog.require('clojure.string');
goog.require('lt.objs.files');
goog.require('lt.objs.app');
goog.require('lt.objs.clients');
goog.require('clojure.string');
goog.require('crate.binding');
goog.require('lt.object');
goog.require('cljs.reader');
goog.require('lt.object');
goog.require('lt.objs.console');
goog.require('lt.util.ipc');
goog.require('lt.objs.console');
goog.require('crate.core');
goog.require('lt.objs.clients');
goog.require('lt.util.ipc');
goog.require('fetch.core');
goog.require('fetch.core');
lt.objs.clients.devtools.cbs = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
lt.objs.clients.devtools.id = cljs.core.atom.call(null,0);
lt.objs.clients.devtools.devtools_url = "http://localhost:8315/json";
lt.objs.clients.devtools.next_id = (function next_id(){return cljs.core.swap_BANG_.call(null,lt.objs.clients.devtools.id,cljs.core.inc);
});
lt.objs.clients.devtools.find_debugger_info = (function find_debugger_info(info,url){return cljs.core.first.call(null,cljs.core.filter.call(null,(function (cur){var and__3508__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$1(cur),url);if(and__3508__auto__)
{return new cljs.core.Keyword(null,"webSocketDebuggerUrl","webSocketDebuggerUrl",667502233).cljs$core$IFn$_invoke$arity$1(cur);
} else
{return and__3508__auto__;
}
}),info));
});
lt.objs.clients.devtools.socket = (function socket(this$,url){var sock = (new WebSocket(url));sock.onopen = (function (){lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"connected","connected",4729661051),true], null));
return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"connect","connect",1965255772));
});
sock.onmessage = (function (p1__14442_SHARP_){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"message","message",1968829305),cljs.core.js__GT_clj.call(null,JSON.parse(p1__14442_SHARP_.data),new cljs.core.Keyword(null,"keywordize-keys","keywordize-keys",4191781672),true));
});
return sock;
});
lt.objs.clients.devtools.send_STAR_ = (function send_STAR_(client,m,cb){new cljs.core.Keyword(null,"socket","socket",4411822821).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,client)).send(JSON.stringify(cljs.core.clj__GT_js.call(null,m)));
if(cljs.core.truth_(cb))
{return cljs.core.swap_BANG_.call(null,lt.objs.clients.devtools.cbs,cljs.core.assoc,new cljs.core.Keyword(null,"id","id",1013907597).cljs$core$IFn$_invoke$arity$1(m),cb);
} else
{return null;
}
});
/**
* @param {...*} var_args
*/
lt.objs.clients.devtools.send = (function() { 
var send__delegate = function (client,m,p__14443){var vec__14445 = p__14443;var cb = cljs.core.nth.call(null,vec__14445,0,null);if(cljs.core.truth_(new cljs.core.Keyword(null,"connected","connected",4729661051).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,client))))
{return lt.objs.clients.devtools.send_STAR_.call(null,client,m,cb);
} else
{return lt.object.update_BANG_.call(null,client,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"queue","queue",1121848451)], null),cljs.core.conj,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [client,m,cb], null));
}
};
var send = function (client,m,var_args){
var p__14443 = null;if (arguments.length > 2) {
  p__14443 = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2),0);} 
return send__delegate.call(this,client,m,p__14443);};
send.cljs$lang$maxFixedArity = 2;
send.cljs$lang$applyTo = (function (arglist__14446){
var client = cljs.core.first(arglist__14446);
arglist__14446 = cljs.core.next(arglist__14446);
var m = cljs.core.first(arglist__14446);
var p__14443 = cljs.core.rest(arglist__14446);
return send__delegate(client,m,p__14443);
});
send.cljs$core$IFn$_invoke$arity$variadic = send__delegate;
return send;
})()
;
lt.objs.clients.devtools.close = (function close(client){new cljs.core.Keyword(null,"socket","socket",4411822821).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,client)).close();
return lt.object.merge_BANG_.call(null,client,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"socket","socket",4411822821),null,new cljs.core.Keyword(null,"connected","connected",4729661051),null], null));
});
lt.objs.clients.devtools.format_value = (function format_value(v){var val = new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(v);if(cljs.core._EQ_.call(null,val,"undefined"))
{return "undefined";
} else
{if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1017479852).cljs$core$IFn$_invoke$arity$1(v),"string"))
{return cljs.core.pr_str.call(null,val);
} else
{if((val === true) || (val === false))
{return cljs.core.pr_str.call(null,val);
} else
{if(((val == null)) || (cljs.core.empty_QMARK_.call(null,val)))
{return "null";
} else
{if(new cljs.core.Keyword(null,"else","else",1017020587))
{return new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(v);
} else
{return null;
}
}
}
}
}
});
lt.objs.clients.devtools.msg__GT_log = (function msg__GT_log(this$,m){var params = new cljs.core.Keyword(null,"parameters","parameters",1472640348).cljs$core$IFn$_invoke$arity$1(m);var iter__4231__auto__ = (function iter__14451(s__14452){return (new cljs.core.LazySeq(null,(function (){var s__14452__$1 = s__14452;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__14452__$1);if(temp__4092__auto__)
{var s__14452__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__14452__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__14452__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__14454 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__14453 = 0;while(true){
if((i__14453 < size__4230__auto__))
{var p = cljs.core._nth.call(null,c__4229__auto__,i__14453);cljs.core.chunk_append.call(null,b__14454,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.log-val","span.log-val",3645418982),(cljs.core.truth_((function (){var and__3508__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1017479852).cljs$core$IFn$_invoke$arity$1(p),"object");if(and__3508__auto__)
{var and__3508__auto____$1 = new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(p);if(cljs.core.truth_(and__3508__auto____$1))
{return cljs.core.not.call(null,new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(p)));
} else
{return and__3508__auto____$1;
}
} else
{return and__3508__auto__;
}
})())?"null":((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1017479852).cljs$core$IFn$_invoke$arity$1(p),"object"))?lt.object.__GT_content.call(null,lt.object.create.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","inspector-object","lt.objs.clients.devtools/inspector-object",4768596045),this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"value","value",1125876963),p], null))):((new cljs.core.Keyword(null,"else","else",1017020587))?new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$2(p,new cljs.core.Keyword(null,"text","text",1017460895).cljs$core$IFn$_invoke$arity$1(p)):null)))], null));
{
var G__14455 = (i__14453 + 1);
i__14453 = G__14455;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__14454),iter__14451.call(null,cljs.core.chunk_rest.call(null,s__14452__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__14454),null);
}
} else
{var p = cljs.core.first.call(null,s__14452__$2);return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.log-val","span.log-val",3645418982),(cljs.core.truth_((function (){var and__3508__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1017479852).cljs$core$IFn$_invoke$arity$1(p),"object");if(and__3508__auto__)
{var and__3508__auto____$1 = new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(p);if(cljs.core.truth_(and__3508__auto____$1))
{return cljs.core.not.call(null,new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(p)));
} else
{return and__3508__auto____$1;
}
} else
{return and__3508__auto__;
}
})())?"null":((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1017479852).cljs$core$IFn$_invoke$arity$1(p),"object"))?lt.object.__GT_content.call(null,lt.object.create.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","inspector-object","lt.objs.clients.devtools/inspector-object",4768596045),this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"value","value",1125876963),p], null))):((new cljs.core.Keyword(null,"else","else",1017020587))?new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$2(p,new cljs.core.Keyword(null,"text","text",1017460895).cljs$core$IFn$_invoke$arity$1(p)):null)))], null),iter__14451.call(null,cljs.core.rest.call(null,s__14452__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,params);
});
lt.objs.clients.devtools.msg__GT_string = (function msg__GT_string(m){var params = new cljs.core.Keyword(null,"parameters","parameters",1472640348).cljs$core$IFn$_invoke$arity$1(m);return cljs.core.reduce.call(null,(function (res,p){return [cljs.core.str(res),cljs.core.str(" "),cljs.core.str(new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(p))].join('');
}),"",params);
});
lt.objs.clients.devtools.error__GT_string = (function error__GT_string(e){return [cljs.core.str("ERROR: "),cljs.core.str(new cljs.core.Keyword(null,"text","text",1017460895).cljs$core$IFn$_invoke$arity$1(e)),cljs.core.str(": "),cljs.core.str(new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$1(e)),cljs.core.str("\n"),cljs.core.str(cljs.core.reduce.call(null,(function (res,f){return [cljs.core.str(res),cljs.core.str("       "),cljs.core.str(lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$1(f))),cljs.core.str(" ["),cljs.core.str(new cljs.core.Keyword(null,"lineNumber","lineNumber",684762063).cljs$core$IFn$_invoke$arity$1(f)),cljs.core.str("]: "),cljs.core.str(((cljs.core.empty_QMARK_.call(null,new cljs.core.Keyword(null,"functionName","functionName",802531829).cljs$core$IFn$_invoke$arity$1(f)))?"anonymous":new cljs.core.Keyword(null,"functionName","functionName",802531829).cljs$core$IFn$_invoke$arity$1(f))),cljs.core.str("\n")].join('');
}),"",new cljs.core.Keyword(null,"stackTrace","stackTrace",3040184079).cljs$core$IFn$_invoke$arity$1(e)))].join('');
});
lt.objs.clients.devtools.frame = (function frame(f){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,"tr","tr",1013907952),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"td.url","td.url",4428724323),lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$1(f))," [",new cljs.core.Keyword(null,"lineNumber","lineNumber",684762063).cljs$core$IFn$_invoke$arity$1(f),"]"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"td","td",1013907938),((cljs.core.empty_QMARK_.call(null,new cljs.core.Keyword(null,"functionName","functionName",802531829).cljs$core$IFn$_invoke$arity$1(f)))?"anonymous":new cljs.core.Keyword(null,"functionName","functionName",802531829).cljs$core$IFn$_invoke$arity$1(f))], null)], null));var seq__14462_14468 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__14463_14469 = null;var count__14464_14470 = 0;var i__14465_14471 = 0;while(true){
if((i__14465_14471 < count__14464_14470))
{var vec__14466_14472 = cljs.core._nth.call(null,chunk__14463_14469,i__14465_14471);var ev__3326__auto___14473 = cljs.core.nth.call(null,vec__14466_14472,0,null);var func__3327__auto___14474 = cljs.core.nth.call(null,vec__14466_14472,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___14473,func__3327__auto___14474);
{
var G__14475 = seq__14462_14468;
var G__14476 = chunk__14463_14469;
var G__14477 = count__14464_14470;
var G__14478 = (i__14465_14471 + 1);
seq__14462_14468 = G__14475;
chunk__14463_14469 = G__14476;
count__14464_14470 = G__14477;
i__14465_14471 = G__14478;
continue;
}
} else
{var temp__4092__auto___14479 = cljs.core.seq.call(null,seq__14462_14468);if(temp__4092__auto___14479)
{var seq__14462_14480__$1 = temp__4092__auto___14479;if(cljs.core.chunked_seq_QMARK_.call(null,seq__14462_14480__$1))
{var c__4262__auto___14481 = cljs.core.chunk_first.call(null,seq__14462_14480__$1);{
var G__14482 = cljs.core.chunk_rest.call(null,seq__14462_14480__$1);
var G__14483 = c__4262__auto___14481;
var G__14484 = cljs.core.count.call(null,c__4262__auto___14481);
var G__14485 = 0;
seq__14462_14468 = G__14482;
chunk__14463_14469 = G__14483;
count__14464_14470 = G__14484;
i__14465_14471 = G__14485;
continue;
}
} else
{var vec__14467_14486 = cljs.core.first.call(null,seq__14462_14480__$1);var ev__3326__auto___14487 = cljs.core.nth.call(null,vec__14467_14486,0,null);var func__3327__auto___14488 = cljs.core.nth.call(null,vec__14467_14486,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___14487,func__3327__auto___14488);
{
var G__14489 = cljs.core.next.call(null,seq__14462_14480__$1);
var G__14490 = null;
var G__14491 = 0;
var G__14492 = 0;
seq__14462_14468 = G__14489;
chunk__14463_14469 = G__14490;
count__14464_14470 = G__14491;
i__14465_14471 = G__14492;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.clients.devtools.handle_log_msg = (function (){var method_table__4372__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);var prefer_table__4373__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);var method_cache__4374__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);var cached_hierarchy__4375__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);var hierarchy__4376__auto__ = cljs.core.get.call(null,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",3129050535),cljs.core.get_global_hierarchy.call(null));return (new cljs.core.MultiFn("handle-log-msg",(function (p1__14494_SHARP_,p2__14493_SHARP_){return new cljs.core.Keyword(null,"level","level",1116770038).cljs$core$IFn$_invoke$arity$1(p2__14493_SHARP_);
}),new cljs.core.Keyword(null,"default","default",2558708147),hierarchy__4376__auto__,method_table__4372__auto__,prefer_table__4373__auto__,method_cache__4374__auto__,cached_hierarchy__4375__auto__));
})();
lt.objs.clients.devtools.valid_error_QMARK_ = (function valid_error_QMARK_(text){var text__$1 = text.toLowerCase();return cljs.core.every_QMARK_.call(null,(function (p1__14495_SHARP_){return cljs.core._EQ_.call(null,-1,text__$1.indexOf(p1__14495_SHARP_));
}),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["failed to load resource: http://app.kodowa.com"], null));
});
cljs.core._add_method.call(null,lt.objs.clients.devtools.handle_log_msg,"error",(function (this$,msg){if(lt.objs.clients.devtools.valid_error_QMARK_.call(null,[cljs.core.str(new cljs.core.Keyword(null,"text","text",1017460895).cljs$core$IFn$_invoke$arity$1(msg)),cljs.core.str(": "),cljs.core.str(new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$1(msg))].join('')))
{var top = cljs.core.first.call(null,new cljs.core.Keyword(null,"stackTrace","stackTrace",3040184079).cljs$core$IFn$_invoke$arity$1(msg));return lt.objs.console.verbatim.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h3","h3",1013907517),new cljs.core.Keyword(null,"text","text",1017460895).cljs$core$IFn$_invoke$arity$1(msg),(cljs.core.truth_(new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$1(top))?null:[cljs.core.str(": "),cljs.core.str(new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$1(msg))].join(''))], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"table","table",1124020032),(function (){var iter__4231__auto__ = (function iter__14496(s__14497){return (new cljs.core.LazySeq(null,(function (){var s__14497__$1 = s__14497;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__14497__$1);if(temp__4092__auto__)
{var s__14497__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__14497__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__14497__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__14499 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__14498 = 0;while(true){
if((i__14498 < size__4230__auto__))
{var f = cljs.core._nth.call(null,c__4229__auto__,i__14498);cljs.core.chunk_append.call(null,b__14499,lt.objs.clients.devtools.frame.call(null,f));
{
var G__14500 = (i__14498 + 1);
i__14498 = G__14500;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__14499),iter__14496.call(null,cljs.core.chunk_rest.call(null,s__14497__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__14499),null);
}
} else
{var f = cljs.core.first.call(null,s__14497__$2);return cljs.core.cons.call(null,lt.objs.clients.devtools.frame.call(null,f),iter__14496.call(null,cljs.core.rest.call(null,s__14497__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,new cljs.core.Keyword(null,"stackTrace","stackTrace",3040184079).cljs$core$IFn$_invoke$arity$1(msg));
})()], null)], null),"error",lt.objs.clients.devtools.error__GT_string.call(null,msg));
} else
{return null;
}
}));
cljs.core._add_method.call(null,lt.objs.clients.devtools.handle_log_msg,"log",(function (this$,msg){var stack = cljs.core.first.call(null,cljs.core.filter.call(null,(function (p1__14501_SHARP_){return cljs.core.not_EQ_.call(null,lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$1(p1__14501_SHARP_)),"bootstrap.js");
}),new cljs.core.Keyword(null,"stackTrace","stackTrace",3040184079).cljs$core$IFn$_invoke$arity$1(msg)));var stack__$1 = ((cljs.core.not.call(null,stack))?cljs.core.first.call(null,new cljs.core.Keyword(null,"stackTrace","stackTrace",3040184079).cljs$core$IFn$_invoke$arity$1(msg)):stack);return lt.objs.console.loc_log.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"file","file",1017047278),lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$1(stack__$1)),new cljs.core.Keyword(null,"line","line",1017226086),new cljs.core.Keyword(null,"lineNumber","lineNumber",684762063).cljs$core$IFn$_invoke$arity$1(stack__$1),new cljs.core.Keyword(null,"content","content",1965434859),lt.objs.clients.devtools.msg__GT_log.call(null,this$,msg),new cljs.core.Keyword(null,"str-content","str-content",1379403855),lt.objs.clients.devtools.msg__GT_string.call(null,msg)], null));
}));
cljs.core._add_method.call(null,lt.objs.clients.devtools.handle_log_msg,"warning",(function (this$,msg){return lt.objs.console.loc_log.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"file","file",1017047278),lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$1(msg)),new cljs.core.Keyword(null,"line","line",1017226086),new cljs.core.Keyword(null,"line","line",1017226086).cljs$core$IFn$_invoke$arity$1(msg),new cljs.core.Keyword(null,"class","class",1108647146),"warning",new cljs.core.Keyword(null,"content","content",1965434859),new cljs.core.Keyword(null,"text","text",1017460895).cljs$core$IFn$_invoke$arity$1(msg),new cljs.core.Keyword(null,"str-content","str-content",1379403855),new cljs.core.Keyword(null,"text","text",1017460895).cljs$core$IFn$_invoke$arity$1(msg)], null));
}));
cljs.core._add_method.call(null,lt.objs.clients.devtools.handle_log_msg,new cljs.core.Keyword(null,"default","default",2558708147),(function (this$,msg){return lt.objs.console.loc_log.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"file","file",1017047278),lt.objs.files.basename.call(null,new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$1(msg)),new cljs.core.Keyword(null,"line","line",1017226086),new cljs.core.Keyword(null,"line","line",1017226086).cljs$core$IFn$_invoke$arity$1(msg),new cljs.core.Keyword(null,"content","content",1965434859),new cljs.core.Keyword(null,"text","text",1017460895).cljs$core$IFn$_invoke$arity$1(msg),new cljs.core.Keyword(null,"str-content","str-content",1379403855),new cljs.core.Keyword(null,"text","text",1017460895).cljs$core$IFn$_invoke$arity$1(msg)], null));
}));
lt.objs.clients.devtools.extra_escape = (function extra_escape(code){return clojure.string.replace.call(null,clojure.string.replace.call(null,clojure.string.replace.call(null,code,"\\","\\\\"),"\n","\\n"),"'","\\'");
});
lt.objs.clients.devtools.eval_in_webview_client = (function eval_in_webview_client(webview_client,msg,cb){return lt.objs.clients.devtools.send.call(null,webview_client,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",1013907597),lt.objs.clients.devtools.next_id.call(null),new cljs.core.Keyword(null,"method","method",4231316563),"Runtime.evaluate",new cljs.core.Keyword(null,"params","params",4313443576),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"expression","expression",3513419274),new cljs.core.Keyword(null,"code","code",1016963423).cljs$core$IFn$_invoke$arity$1(msg)], null)], null),cb);
});
lt.objs.clients.devtools.clear_scripts_BANG_ = (function clear_scripts_BANG_(this$){return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"scripts","scripts",2940419194),cljs.core.PersistentArrayMap.EMPTY], null));
});
lt.objs.clients.devtools.find_script = (function find_script(client,path){var found_QMARK_ = cljs.core.get.call(null,cljs.core.deref.call(null,client).call(null,new cljs.core.Keyword(null,"scripts","scripts",2940419194)),lt.objs.files.basename.call(null,path));return found_QMARK_;
});
lt.objs.clients.devtools.script_exists_QMARK_ = (function script_exists_QMARK_(this$,id,cb){return lt.objs.clients.devtools.send.call(null,this$,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",1013907597),lt.objs.clients.devtools.next_id.call(null),new cljs.core.Keyword(null,"method","method",4231316563),"Debugger.canSetScriptSource",new cljs.core.Keyword(null,"params","params",4313443576),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"scriptId","scriptId",606324408),id], null)], null),(function (res){return cb.call(null,new cljs.core.Keyword(null,"result","result",4374444943).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"result","result",4374444943).cljs$core$IFn$_invoke$arity$1(res)));
}));
});
lt.objs.clients.devtools.remove_script_BANG_ = (function remove_script_BANG_(client,path,id){var vec__14504 = cljs.core.first.call(null,cljs.core.filter.call(null,(function (p1__14502_SHARP_){return cljs.core._EQ_.call(null,id,new cljs.core.Keyword(null,"scriptId","scriptId",606324408).cljs$core$IFn$_invoke$arity$1(cljs.core.second.call(null,p1__14502_SHARP_)));
}),lt.objs.clients.devtools.find_script.call(null,client,path)));var k = cljs.core.nth.call(null,vec__14504,0,null);var v = cljs.core.nth.call(null,vec__14504,1,null);return lt.object.update_BANG_.call(null,client,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"scripts","scripts",2940419194),lt.objs.files.basename.call(null,path)], null),cljs.core.dissoc,k);
});
lt.objs.clients.devtools.changelive_BANG_ = (function changelive_BANG_(obj,path,code,cb,else$){var temp__4090__auto__ = lt.objs.clients.devtools.find_script.call(null,obj,path);if(cljs.core.truth_(temp__4090__auto__))
{var s = temp__4090__auto__;var id = new cljs.core.Keyword(null,"scriptId","scriptId",606324408).cljs$core$IFn$_invoke$arity$1(cljs.core.first.call(null,cljs.core.vals.call(null,s)));return lt.objs.clients.devtools.script_exists_QMARK_.call(null,obj,id,(function (exists_QMARK_){if(cljs.core.not.call(null,exists_QMARK_))
{lt.objs.clients.devtools.remove_script_BANG_.call(null,obj,path,id);
return changelive_BANG_.call(null,obj,path,code,cb);
} else
{lt.object.merge_BANG_.call(null,obj,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"script-id","script-id",1263804623),id], null));
return lt.objs.clients.devtools.send.call(null,obj,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",1013907597),lt.objs.clients.devtools.next_id.call(null),new cljs.core.Keyword(null,"method","method",4231316563),"Debugger.setScriptSource",new cljs.core.Keyword(null,"params","params",4313443576),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"scriptId","scriptId",606324408),id,new cljs.core.Keyword(null,"scriptSource","scriptSource",3711898680),code], null)], null),cb);
}
}));
} else
{return else$.call(null);
}
});
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","devtools-client","lt.objs.clients.devtools/devtools-client",2732459658),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"clients.devtools","clients.devtools",2282697598),null], null), null),new cljs.core.Keyword(null,"init","init",1017141378),(function (this$,url){lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"url","url",1014020321),url], null));
return null;
}));
lt.objs.clients.devtools.local = lt.object.create.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","devtools-client","lt.objs.clients.devtools/devtools-client",2732459658),lt.objs.app.app_url.call(null));
lt.util.ipc.on.call(null,"devtools",(function (p1__14505_SHARP_){return lt.object.raise.call(null,lt.objs.clients.devtools.local,cljs.core.keyword.call(null,p1__14505_SHARP_));
}));
lt.objs.clients.devtools.__BEH__connect_BANG_ = (function __BEH__connect_BANG_(this$,url){lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"socket","socket",4411822821),lt.objs.clients.devtools.socket.call(null,this$,url)], null));
lt.objs.clients.devtools.send.call(null,this$,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",1013907597),lt.objs.clients.devtools.next_id.call(null),new cljs.core.Keyword(null,"method","method",4231316563),"Console.enable"], null));
lt.objs.clients.devtools.send.call(null,this$,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",1013907597),lt.objs.clients.devtools.next_id.call(null),new cljs.core.Keyword(null,"method","method",4231316563),"Debugger.enable"], null));
return lt.objs.clients.devtools.send.call(null,this$,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",1013907597),lt.objs.clients.devtools.next_id.call(null),new cljs.core.Keyword(null,"method","method",4231316563),"Network.setCacheDisabled",new cljs.core.Keyword(null,"params","params",4313443576),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"cacheDisabled","cacheDisabled",3367083920),true], null)], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","connect!","lt.objs.clients.devtools/connect!",4727522991),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.clients.devtools.__BEH__connect_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,"connect!","connect!",4735997929),null], null), null));
lt.objs.clients.devtools.__BEH__clear_queue_on_connect = (function __BEH__clear_queue_on_connect(this$){var seq__14510 = cljs.core.seq.call(null,new cljs.core.Keyword(null,"queue","queue",1121848451).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)));var chunk__14511 = null;var count__14512 = 0;var i__14513 = 0;while(true){
if((i__14513 < count__14512))
{var msg = cljs.core._nth.call(null,chunk__14511,i__14513);cljs.core.apply.call(null,lt.objs.clients.devtools.send,msg);
{
var G__14514 = seq__14510;
var G__14515 = chunk__14511;
var G__14516 = count__14512;
var G__14517 = (i__14513 + 1);
seq__14510 = G__14514;
chunk__14511 = G__14515;
count__14512 = G__14516;
i__14513 = G__14517;
continue;
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__14510);if(temp__4092__auto__)
{var seq__14510__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__14510__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__14510__$1);{
var G__14518 = cljs.core.chunk_rest.call(null,seq__14510__$1);
var G__14519 = c__4262__auto__;
var G__14520 = cljs.core.count.call(null,c__4262__auto__);
var G__14521 = 0;
seq__14510 = G__14518;
chunk__14511 = G__14519;
count__14512 = G__14520;
i__14513 = G__14521;
continue;
}
} else
{var msg = cljs.core.first.call(null,seq__14510__$1);cljs.core.apply.call(null,lt.objs.clients.devtools.send,msg);
{
var G__14522 = cljs.core.next.call(null,seq__14510__$1);
var G__14523 = null;
var G__14524 = 0;
var G__14525 = 0;
seq__14510 = G__14522;
chunk__14511 = G__14523;
count__14512 = G__14524;
i__14513 = G__14525;
continue;
}
}
} else
{return null;
}
}
break;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","clear-queue-on-connect","lt.objs.clients.devtools/clear-queue-on-connect",2202730096),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.clients.devtools.__BEH__clear_queue_on_connect,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"connect","connect",1965255772),null], null), null));
lt.objs.clients.devtools.__BEH__print_messages = (function __BEH__print_messages(this$,m){return null;
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","print-messages","lt.objs.clients.devtools/print-messages",675571380),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.clients.devtools.__BEH__print_messages,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"message","message",1968829305),null], null), null));
lt.objs.clients.devtools.__BEH__handle_message = (function __BEH__handle_message(this$,m){var temp__4090__auto__ = cljs.core.deref.call(null,lt.objs.clients.devtools.cbs).call(null,new cljs.core.Keyword(null,"id","id",1013907597).cljs$core$IFn$_invoke$arity$1(m));if(cljs.core.truth_(temp__4090__auto__))
{var cb = temp__4090__auto__;cb.call(null,m);
return cljs.core.swap_BANG_.call(null,lt.objs.clients.devtools.cbs,cljs.core.dissoc,new cljs.core.Keyword(null,"id","id",1013907597).cljs$core$IFn$_invoke$arity$1(m));
} else
{if(cljs.core.truth_(new cljs.core.Keyword(null,"method","method",4231316563).cljs$core$IFn$_invoke$arity$1(m)))
{return lt.object.raise.call(null,this$,cljs.core.keyword.call(null,new cljs.core.Keyword(null,"method","method",4231316563).cljs$core$IFn$_invoke$arity$1(m)),m);
} else
{return null;
}
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","handle-message","lt.objs.clients.devtools/handle-message",1428636858),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.clients.devtools.__BEH__handle_message,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"message","message",1968829305),null], null), null));
lt.objs.clients.devtools.__BEH__script_parsed = (function __BEH__script_parsed(this$,s){var url = new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"params","params",4313443576).cljs$core$IFn$_invoke$arity$1(s));return lt.object.update_BANG_.call(null,this$,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"scripts","scripts",2940419194)], null),cljs.core.assoc_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [lt.objs.files.basename.call(null,url),url], null),new cljs.core.Keyword(null,"params","params",4313443576).cljs$core$IFn$_invoke$arity$1(s));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","script-parsed","lt.objs.clients.devtools/script-parsed",1407217355),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.clients.devtools.__BEH__script_parsed,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"Debugger.scriptParsed","Debugger.scriptParsed",1050864827),null], null), null));
lt.objs.clients.devtools.__BEH__console_log = (function __BEH__console_log(this$,m){var msg = new cljs.core.Keyword(null,"message","message",1968829305).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"params","params",4313443576).cljs$core$IFn$_invoke$arity$1(m));return lt.objs.clients.devtools.handle_log_msg.call(null,this$,msg);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","console-log","lt.objs.clients.devtools/console-log",1720612182),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.clients.devtools.__BEH__console_log,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"Console.messageAdded","Console.messageAdded",4767739906),null], null), null));
lt.objs.clients.devtools.__BEH__clear_console = (function __BEH__clear_console(this$){return lt.objs.clients.devtools.send.call(null,this$,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",1013907597),lt.objs.clients.devtools.next_id.call(null),new cljs.core.Keyword(null,"method","method",4231316563),"Console.clearMessages"], null));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","clear-console","lt.objs.clients.devtools/clear-console",2897345871),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.clients.devtools.__BEH__clear_console,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"clear!","clear!",3951036134),null], null), null));
lt.objs.clients.devtools.__BEH__disconnect = (function __BEH__disconnect(this$){if(cljs.core.truth_(new cljs.core.Keyword(null,"socket","socket",4411822821).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))))
{return lt.objs.clients.devtools.close.call(null,this$);
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","disconnect","lt.objs.clients.devtools/disconnect",3633156740),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.clients.devtools.__BEH__disconnect,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"disconnect","disconnect",1544309774),null], null), null));
lt.objs.clients.devtools.__BEH__reconnect = (function __BEH__reconnect(this$){lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"disconnect","disconnect",1544309774));
return fetch.core.xhr.call(null,lt.objs.clients.devtools.devtools_url,cljs.core.PersistentArrayMap.EMPTY,(function (d){var temp__4090__auto__ = new cljs.core.Keyword(null,"webSocketDebuggerUrl","webSocketDebuggerUrl",667502233).cljs$core$IFn$_invoke$arity$1(lt.objs.clients.devtools.find_debugger_info.call(null,cljs.core.js__GT_clj.call(null,JSON.parse(d),new cljs.core.Keyword(null,"keywordize-keys","keywordize-keys",4191781672),true),new cljs.core.Keyword(null,"url","url",1014020321).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))));if(cljs.core.truth_(temp__4090__auto__))
{var url = temp__4090__auto__;return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"connect!","connect!",4735997929),url);
} else
{return lt.util.js.wait.call(null,1000,(function (){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"reconnect!","reconnect!",1644020508));
}));
}
}));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","reconnect","lt.objs.clients.devtools/reconnect",3171303119),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.clients.devtools.__BEH__reconnect,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"reconnect!","reconnect!",1644020508),null], null), null));
lt.objs.clients.devtools.__BEH__connect_on_init = (function __BEH__connect_on_init(app){return lt.object.raise.call(null,lt.objs.clients.devtools.local,new cljs.core.Keyword(null,"reconnect!","reconnect!",1644020508));
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","connect-on-init","lt.objs.clients.devtools/connect-on-init",605011907),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.clients.devtools.__BEH__connect_on_init,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.clients.devtools.i_compare = (function i_compare(a,b){var ia = a.indexOf("__");var ib = b.indexOf("__");if((cljs.core._EQ_.call(null,ia,-1)) && (cljs.core._EQ_.call(null,ib,-1)))
{return cljs.core.compare.call(null,a,b);
} else
{if(((ia > -1)) && ((ib > -1)))
{return cljs.core.compare.call(null,a,b);
} else
{if((ia > -1))
{return 1;
} else
{if(new cljs.core.Keyword(null,"else","else",1017020587))
{return -1;
} else
{return null;
}
}
}
}
});
lt.objs.clients.devtools.__GT_name = (function __GT_name(obj){var n = (function (){var or__3520__auto__ = new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(obj);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{var or__3520__auto____$1 = new cljs.core.Keyword(null,"description","description",3584325486).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(obj));if(cljs.core.truth_(or__3520__auto____$1))
{return or__3520__auto____$1;
} else
{var or__3520__auto____$2 = new cljs.core.Keyword(null,"description","description",3584325486).cljs$core$IFn$_invoke$arity$1(obj);if(cljs.core.truth_(or__3520__auto____$2))
{return or__3520__auto____$2;
} else
{return "UnknownObject";
}
}
}
})();if((n.indexOf("e.fn.e.init") > -1))
{return [cljs.core.str("jQuery"),cljs.core.str(cljs.core.subs.call(null,n,11))].join('');
} else
{if(new cljs.core.Keyword(null,"else","else",1017020587))
{return n;
} else
{return null;
}
}
});
lt.objs.clients.devtools.desc = (function desc(this$,obj){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,"h2","h2",1013907516),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"em","em",1013907482),lt.objs.clients.devtools.__GT_name.call(null,obj)], null),(cljs.core.truth_(new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(obj))?[cljs.core.str(": "),cljs.core.str(new cljs.core.Keyword(null,"description","description",3584325486).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(obj)))].join(''):null)], null));var seq__14532_14538 = 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 (){if(cljs.core.truth_(new cljs.core.Keyword(null,"open","open",1017321916).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))))
{return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"open","open",1017321916),false], null));
} else
{lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"open","open",1017321916),true], null));
if(cljs.core.seq.call(null,new cljs.core.Keyword(null,"children","children",2673430897).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))))
{return null;
} else
{return lt.objs.clients.devtools.send.call(null,new cljs.core.Keyword(null,"client","client",3951159101).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",1013907597),1,new cljs.core.Keyword(null,"method","method",4231316563),"Runtime.getProperties",new cljs.core.Keyword(null,"params","params",4313443576),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"objectId","objectId",1104399404),(function (){var or__3520__auto__ = new cljs.core.Keyword(null,"objectId","objectId",1104399404).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(obj));if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return new cljs.core.Keyword(null,"objectId","objectId",1104399404).cljs$core$IFn$_invoke$arity$1(obj);
}
})(),new cljs.core.Keyword(null,"ownProperties","ownProperties",1958141131),true], null)], null),(function (d){return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"children","children",2673430897),new cljs.core.Keyword(null,"result","result",4374444943).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"result","result",4374444943).cljs$core$IFn$_invoke$arity$1(d))], null));
}));
}
}
})], null)));var chunk__14533_14539 = null;var count__14534_14540 = 0;var i__14535_14541 = 0;while(true){
if((i__14535_14541 < count__14534_14540))
{var vec__14536_14542 = cljs.core._nth.call(null,chunk__14533_14539,i__14535_14541);var ev__3326__auto___14543 = cljs.core.nth.call(null,vec__14536_14542,0,null);var func__3327__auto___14544 = cljs.core.nth.call(null,vec__14536_14542,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___14543,func__3327__auto___14544);
{
var G__14545 = seq__14532_14538;
var G__14546 = chunk__14533_14539;
var G__14547 = count__14534_14540;
var G__14548 = (i__14535_14541 + 1);
seq__14532_14538 = G__14545;
chunk__14533_14539 = G__14546;
count__14534_14540 = G__14547;
i__14535_14541 = G__14548;
continue;
}
} else
{var temp__4092__auto___14549 = cljs.core.seq.call(null,seq__14532_14538);if(temp__4092__auto___14549)
{var seq__14532_14550__$1 = temp__4092__auto___14549;if(cljs.core.chunked_seq_QMARK_.call(null,seq__14532_14550__$1))
{var c__4262__auto___14551 = cljs.core.chunk_first.call(null,seq__14532_14550__$1);{
var G__14552 = cljs.core.chunk_rest.call(null,seq__14532_14550__$1);
var G__14553 = c__4262__auto___14551;
var G__14554 = cljs.core.count.call(null,c__4262__auto___14551);
var G__14555 = 0;
seq__14532_14538 = G__14552;
chunk__14533_14539 = G__14553;
count__14534_14540 = G__14554;
i__14535_14541 = G__14555;
continue;
}
} else
{var vec__14537_14556 = cljs.core.first.call(null,seq__14532_14550__$1);var ev__3326__auto___14557 = cljs.core.nth.call(null,vec__14537_14556,0,null);var func__3327__auto___14558 = cljs.core.nth.call(null,vec__14537_14556,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___14557,func__3327__auto___14558);
{
var G__14559 = cljs.core.next.call(null,seq__14532_14550__$1);
var G__14560 = null;
var G__14561 = 0;
var G__14562 = 0;
seq__14532_14538 = G__14559;
chunk__14533_14539 = G__14560;
count__14534_14540 = G__14561;
i__14535_14541 = G__14562;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.clients.devtools.props = (function props(this$,children){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,"ul","ul",1013907977),(function (){var iter__4231__auto__ = (function iter__14573(s__14574){return (new cljs.core.LazySeq(null,(function (){var s__14574__$1 = s__14574;while(true){
var temp__4092__auto__ = cljs.core.seq.call(null,s__14574__$1);if(temp__4092__auto__)
{var s__14574__$2 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,s__14574__$2))
{var c__4229__auto__ = cljs.core.chunk_first.call(null,s__14574__$2);var size__4230__auto__ = cljs.core.count.call(null,c__4229__auto__);var b__14576 = cljs.core.chunk_buffer.call(null,size__4230__auto__);if((function (){var i__14575 = 0;while(true){
if((i__14575 < size__4230__auto__))
{var c = cljs.core._nth.call(null,c__4229__auto__,i__14575);cljs.core.chunk_append.call(null,b__14576,(cljs.core.truth_((function (){var and__3508__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1017479852).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(c)),"object");if(and__3508__auto__)
{return new cljs.core.Keyword(null,"objectId","objectId",1104399404).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(c));
} else
{return and__3508__auto__;
}
})())?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),lt.object.__GT_content.call(null,lt.object.create.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","inspector-object","lt.objs.clients.devtools/inspector-object",4768596045),new cljs.core.Keyword(null,"client","client",3951159101).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),c))], null):new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"em","em",1013907482),new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(c)], null),": ",(function (){var or__3520__auto__ = new cljs.core.Keyword(null,"description","description",3584325486).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(c));if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return [cljs.core.str(lt.objs.clients.devtools.format_value.call(null,new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(c)))].join('');
}
})()], null)));
{
var G__14583 = (i__14575 + 1);
i__14575 = G__14583;
continue;
}
} else
{return true;
}
break;
}
})())
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__14576),iter__14573.call(null,cljs.core.chunk_rest.call(null,s__14574__$2)));
} else
{return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__14576),null);
}
} else
{var c = cljs.core.first.call(null,s__14574__$2);return cljs.core.cons.call(null,(cljs.core.truth_((function (){var and__3508__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1017479852).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(c)),"object");if(and__3508__auto__)
{return new cljs.core.Keyword(null,"objectId","objectId",1104399404).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(c));
} else
{return and__3508__auto__;
}
})())?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),lt.object.__GT_content.call(null,lt.object.create.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","inspector-object","lt.objs.clients.devtools/inspector-object",4768596045),new cljs.core.Keyword(null,"client","client",3951159101).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),c))], null):new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"li","li",1013907695),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"em","em",1013907482),new cljs.core.Keyword(null,"name","name",1017277949).cljs$core$IFn$_invoke$arity$1(c)], null),": ",(function (){var or__3520__auto__ = new cljs.core.Keyword(null,"description","description",3584325486).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(c));if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return [cljs.core.str(lt.objs.clients.devtools.format_value.call(null,new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(c)))].join('');
}
})()], null)),iter__14573.call(null,cljs.core.rest.call(null,s__14574__$2)));
}
} else
{return null;
}
break;
}
}),null,null));
});return iter__4231__auto__.call(null,cljs.core.sort_by.call(null,new cljs.core.Keyword(null,"name","name",1017277949),lt.objs.clients.devtools.i_compare,children));
})()], null));var seq__14577_14584 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__14578_14585 = null;var count__14579_14586 = 0;var i__14580_14587 = 0;while(true){
if((i__14580_14587 < count__14579_14586))
{var vec__14581_14588 = cljs.core._nth.call(null,chunk__14578_14585,i__14580_14587);var ev__3326__auto___14589 = cljs.core.nth.call(null,vec__14581_14588,0,null);var func__3327__auto___14590 = cljs.core.nth.call(null,vec__14581_14588,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___14589,func__3327__auto___14590);
{
var G__14591 = seq__14577_14584;
var G__14592 = chunk__14578_14585;
var G__14593 = count__14579_14586;
var G__14594 = (i__14580_14587 + 1);
seq__14577_14584 = G__14591;
chunk__14578_14585 = G__14592;
count__14579_14586 = G__14593;
i__14580_14587 = G__14594;
continue;
}
} else
{var temp__4092__auto___14595 = cljs.core.seq.call(null,seq__14577_14584);if(temp__4092__auto___14595)
{var seq__14577_14596__$1 = temp__4092__auto___14595;if(cljs.core.chunked_seq_QMARK_.call(null,seq__14577_14596__$1))
{var c__4262__auto___14597 = cljs.core.chunk_first.call(null,seq__14577_14596__$1);{
var G__14598 = cljs.core.chunk_rest.call(null,seq__14577_14596__$1);
var G__14599 = c__4262__auto___14597;
var G__14600 = cljs.core.count.call(null,c__4262__auto___14597);
var G__14601 = 0;
seq__14577_14584 = G__14598;
chunk__14578_14585 = G__14599;
count__14579_14586 = G__14600;
i__14580_14587 = G__14601;
continue;
}
} else
{var vec__14582_14602 = cljs.core.first.call(null,seq__14577_14596__$1);var ev__3326__auto___14603 = cljs.core.nth.call(null,vec__14582_14602,0,null);var func__3327__auto___14604 = cljs.core.nth.call(null,vec__14582_14602,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___14603,func__3327__auto___14604);
{
var G__14605 = cljs.core.next.call(null,seq__14577_14596__$1);
var G__14606 = null;
var G__14607 = 0;
var G__14608 = 0;
seq__14577_14584 = G__14605;
chunk__14578_14585 = G__14606;
count__14579_14586 = G__14607;
i__14580_14587 = G__14608;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
});
lt.objs.clients.devtools.__GT_open = (function __GT_open(this$){if(cljs.core.truth_(new cljs.core.Keyword(null,"open","open",1017321916).cljs$core$IFn$_invoke$arity$1(this$)))
{return "inspector-object open";
} else
{return "inspector-object";
}
});
lt.objs.clients.devtools.inspector__GT_result = (function inspector__GT_result(this$,o){var res = new cljs.core.Keyword(null,"result","result",4374444943).cljs$core$IFn$_invoke$arity$1(o);var data = new cljs.core.Keyword(null,"result","result",4374444943).cljs$core$IFn$_invoke$arity$1(res);if(cljs.core.truth_(new cljs.core.Keyword(null,"wasThrown","wasThrown",3712175619).cljs$core$IFn$_invoke$arity$1(res)))
{return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ex","ex",1013907493),new cljs.core.Keyword(null,"description","description",3584325486).cljs$core$IFn$_invoke$arity$1(data)], null);
} else
{return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"result","result",4374444943),(function (){var pred__14612 = cljs.core._EQ_;var expr__14613 = new cljs.core.Keyword(null,"type","type",1017479852).cljs$core$IFn$_invoke$arity$1(data);if(cljs.core.truth_(pred__14612.call(null,"object",expr__14613)))
{return lt.object.__GT_content.call(null,lt.object.create.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","inspector-object","lt.objs.clients.devtools/inspector-object",4768596045),this$,data));
} else
{var or__3520__auto__ = new cljs.core.Keyword(null,"description","description",3584325486).cljs$core$IFn$_invoke$arity$1(data);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return cljs.core.pr_str.call(null,new cljs.core.Keyword(null,"value","value",1125876963).cljs$core$IFn$_invoke$arity$1(data));
}
}
})()], null);
}
});
lt.objs.clients.devtools.clear_unused_inspectors = (function clear_unused_inspectors(){var seq__14621 = cljs.core.seq.call(null,lt.object.by_tag.call(null,new cljs.core.Keyword(null,"inspector.object","inspector.object",1285492104)));var chunk__14623 = null;var count__14624 = 0;var i__14625 = 0;while(true){
if((i__14625 < count__14624))
{var obj = cljs.core._nth.call(null,chunk__14623,i__14625);if((cljs.core.not.call(null,lt.object.__GT_content.call(null,obj))) || (cljs.core.not.call(null,lt.util.dom.parents.call(null,lt.object.__GT_content.call(null,obj),new cljs.core.Keyword(null,"body","body",1016933652)))))
{lt.object.destroy_BANG_.call(null,obj);
{
var G__14627 = seq__14621;
var G__14628 = chunk__14623;
var G__14629 = count__14624;
var G__14630 = (i__14625 + 1);
seq__14621 = G__14627;
chunk__14623 = G__14628;
count__14624 = G__14629;
i__14625 = G__14630;
continue;
}
} else
{{
var G__14631 = seq__14621;
var G__14632 = chunk__14623;
var G__14633 = count__14624;
var G__14634 = (i__14625 + 1);
seq__14621 = G__14631;
chunk__14623 = G__14632;
count__14624 = G__14633;
i__14625 = G__14634;
continue;
}
}
} else
{var temp__4092__auto__ = cljs.core.seq.call(null,seq__14621);if(temp__4092__auto__)
{var seq__14621__$1 = temp__4092__auto__;if(cljs.core.chunked_seq_QMARK_.call(null,seq__14621__$1))
{var c__4262__auto__ = cljs.core.chunk_first.call(null,seq__14621__$1);{
var G__14635 = cljs.core.chunk_rest.call(null,seq__14621__$1);
var G__14636 = c__4262__auto__;
var G__14637 = cljs.core.count.call(null,c__4262__auto__);
var G__14638 = 0;
seq__14621 = G__14635;
chunk__14623 = G__14636;
count__14624 = G__14637;
i__14625 = G__14638;
continue;
}
} else
{var obj = cljs.core.first.call(null,seq__14621__$1);if((cljs.core.not.call(null,lt.object.__GT_content.call(null,obj))) || (cljs.core.not.call(null,lt.util.dom.parents.call(null,lt.object.__GT_content.call(null,obj),new cljs.core.Keyword(null,"body","body",1016933652)))))
{lt.object.destroy_BANG_.call(null,obj);
{
var G__14639 = cljs.core.next.call(null,seq__14621__$1);
var G__14640 = null;
var G__14641 = 0;
var G__14642 = 0;
seq__14621 = G__14639;
chunk__14623 = G__14640;
count__14624 = G__14641;
i__14625 = G__14642;
continue;
}
} else
{{
var G__14643 = cljs.core.next.call(null,seq__14621__$1);
var G__14644 = null;
var G__14645 = 0;
var G__14646 = 0;
seq__14621 = G__14643;
chunk__14623 = G__14644;
count__14624 = G__14645;
i__14625 = G__14646;
continue;
}
}
}
} else
{return null;
}
}
break;
}
});
lt.objs.clients.devtools.__BEH__clean_inspectors_timer = (function __BEH__clean_inspectors_timer(this$){return lt.util.js.every.call(null,60000,lt.objs.clients.devtools.clear_unused_inspectors);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","clean-inspectors-timer","lt.objs.clients.devtools/clean-inspectors-timer",3384727952),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.clients.devtools.__BEH__clean_inspectors_timer,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.clients.devtools.__BEH__clear_inspector_object = (function __BEH__clear_inspector_object(this$){var temp__4092__auto__ = (function (){var or__3520__auto__ = new cljs.core.Keyword(null,"objectId","objectId",1104399404).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"value","value",1125876963).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$))));if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return new cljs.core.Keyword(null,"objectId","objectId",1104399404).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$)));
}
})();if(cljs.core.truth_(temp__4092__auto__))
{var id = temp__4092__auto__;return lt.objs.clients.devtools.send.call(null,new cljs.core.Keyword(null,"client","client",3951159101).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",1013907597),lt.objs.clients.devtools.next_id.call(null),new cljs.core.Keyword(null,"method","method",4231316563),"Runtime.releaseObject",new cljs.core.Keyword(null,"params","params",4313443576),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"objectId","objectId",1104399404),id], null)], null));
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","clear-inspector-object","lt.objs.clients.devtools/clear-inspector-object",3133205453),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.clients.devtools.__BEH__clear_inspector_object,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"destroy","destroy",2571277164),null], null), null));
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.clients.devtools","inspector-object","lt.objs.clients.devtools/inspector-object",4768596045),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"inspector.object","inspector.object",1285492104),null], null), null),new cljs.core.Keyword(null,"init","init",1017141378),(function (this$,client,m){lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"client","client",3951159101),client,new cljs.core.Keyword(null,"info","info",1017141280),m], null));
return new cljs.core.PersistentVector(null, 4, 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$,lt.objs.clients.devtools.__GT_open)], null),lt.objs.clients.devtools.desc.call(null,this$,m),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1014003715),crate.binding.bound.call(null,crate.binding.subatom.call(null,this$,new cljs.core.Keyword(null,"children","children",2673430897)),cljs.core.partial.call(null,lt.objs.clients.devtools.props,this$))], null)], null);
}));
