import "./cljs_env.js";
goog.provide('clojure_eval.util');
var module$node_modules$$codemirror$state$dist$index_cjs=shadow.js.require("module$node_modules$$codemirror$state$dist$index_cjs", {});
/**
 * @define {boolean}
 */
clojure_eval.util.node_js_QMARK_ = goog.define("clojure_eval.util.node_js_QMARK_",false);
clojure_eval.util.user_event_annotation = (function clojure_eval$util$user_event_annotation(event_name){
return module$node_modules$$codemirror$state$dist$index_cjs.Transaction.userEvent.of(event_name);
});
clojure_eval.util.get_user_event_annotation = (function clojure_eval$util$get_user_event_annotation(tr){
return tr.annotation(module$node_modules$$codemirror$state$dist$index_cjs.Transaction.userEvent);
});
clojure_eval.util.guard = (function clojure_eval$util$guard(x,f){
if(cljs.core.truth_((f.cljs$core$IFn$_invoke$arity$1 ? f.cljs$core$IFn$_invoke$arity$1(x) : f.call(null,x)))){
return x;
} else {
return null;
}
});
clojure_eval.util.from_to = (function clojure_eval$util$from_to(p1,p2){
if((p1 > p2)){
return ({"from": p2, "to": p1});
} else {
return ({"from": p1, "to": p2});
}
});
/**
 * If passed a transaction, dispatch to view and return true to stop processing commands.
 */
clojure_eval.util.dispatch_some = (function clojure_eval$util$dispatch_some(view,tr){
if(cljs.core.truth_(tr)){
view.dispatch(tr);

return true;
} else {
return false;
}
});
/**
 * Returns a `change` that inserts string `s` at position `from` and moves cursor to end of insertion.
 */
clojure_eval.util.insertion = (function clojure_eval$util$insertion(var_args){
var G__54838 = arguments.length;
switch (G__54838) {
case 2:
return clojure_eval.util.insertion.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return clojure_eval.util.insertion.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));

}
});

(clojure_eval.util.insertion.cljs$core$IFn$_invoke$arity$2 = (function (from,s){
return clojure_eval.util.insertion.cljs$core$IFn$_invoke$arity$3(from,from,s);
}));

(clojure_eval.util.insertion.cljs$core$IFn$_invoke$arity$3 = (function (from,to,s){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"changes","changes",1492088),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"insert","insert",1286475395),s,new cljs.core.Keyword(null,"from","from",1815293044),from,new cljs.core.Keyword(null,"to","to",192099007),to], null),new cljs.core.Keyword(null,"cursor","cursor",1011937484),(from + ((s).length))], null);
}));

(clojure_eval.util.insertion.cljs$lang$maxFixedArity = 3);

clojure_eval.util.deletion = (function clojure_eval$util$deletion(var_args){
var G__54844 = arguments.length;
switch (G__54844) {
case 1:
return clojure_eval.util.deletion.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return clojure_eval.util.deletion.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));

}
});

(clojure_eval.util.deletion.cljs$core$IFn$_invoke$arity$1 = (function (from){
return clojure_eval.util.deletion.cljs$core$IFn$_invoke$arity$2((function (){var x__4306__auto__ = (0);
var y__4307__auto__ = (from - (1));
return ((x__4306__auto__ > y__4307__auto__) ? x__4306__auto__ : y__4307__auto__);
})(),from);
}));

(clojure_eval.util.deletion.cljs$core$IFn$_invoke$arity$2 = (function (from,to){
var from__$1 = ((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(from,to))?(function (){var x__4306__auto__ = (0);
var y__4307__auto__ = (from - (1));
return ((x__4306__auto__ > y__4307__auto__) ? x__4306__auto__ : y__4307__auto__);
})():from);
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),from__$1,new cljs.core.Keyword(null,"changes","changes",1492088),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"from","from",1815293044),from__$1,new cljs.core.Keyword(null,"to","to",192099007),to], null)], null);
}));

(clojure_eval.util.deletion.cljs$lang$maxFixedArity = 2);

clojure_eval.util.line_content_at = (function clojure_eval$util$line_content_at(state,from){
var obj__54402__auto__ = (function (){var parent__54409__auto__ = (state["doc"]);
var f__54410__auto__ = (parent__54409__auto__["lineAt"]);
return f__54410__auto__.call(parent__54409__auto__,from);
})();
var f__54403__auto__ = (obj__54402__auto__["slice"]);
return f__54403__auto__.call(obj__54402__auto__);
});
clojure_eval.util.map_cursor = (function clojure_eval$util$map_cursor(original_range,state,update_map){
if(cljs.core.map_QMARK_(update_map)){
} else {
throw (new Error("Assert failed: (map? update-map)"));
}

var map__54883 = clojure_eval.util.guard(update_map,cljs.core.map_QMARK_);
var map__54883__$1 = cljs.core.__destructure_map(map__54883);
var mapped = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54883__$1,new cljs.core.Keyword("cursor","mapped","cursor/mapped",1625530272));
var cursor = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54883__$1,new cljs.core.Keyword(null,"cursor","cursor",1011937484));
var from_to = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54883__$1,new cljs.core.Keyword(null,"from-to","from-to",-640428401));
var range = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54883__$1,new cljs.core.Keyword(null,"range","range",1639692286));
var changes = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54883__$1,new cljs.core.Keyword(null,"changes","changes",1492088));
var change_desc = (cljs.core.truth_(changes)?state.changes(cljs.core.clj__GT_js(changes)):null);
var G__54884 = ({"range": (function (){var or__4223__auto__ = range;
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
var or__4223__auto____$1 = (cljs.core.truth_(mapped)?clojure_eval.selections.cursor(change_desc.mapPos(mapped)):(cljs.core.truth_(cursor)?clojure_eval.selections.cursor(cursor):(cljs.core.truth_(from_to)?clojure_eval.selections.range.cljs$core$IFn$_invoke$arity$2((from_to.cljs$core$IFn$_invoke$arity$1 ? from_to.cljs$core$IFn$_invoke$arity$1((0)) : from_to.call(null,(0))),(from_to.cljs$core$IFn$_invoke$arity$1 ? from_to.cljs$core$IFn$_invoke$arity$1((1)) : from_to.call(null,(1)))):null)));
if(cljs.core.truth_(or__4223__auto____$1)){
return or__4223__auto____$1;
} else {
return original_range;
}
}
})()});
if(cljs.core.truth_(change_desc)){
var obj54885 = G__54884;
(obj54885["changes"] = change_desc);

return obj54885;
} else {
return G__54884;
}
});
/**
 * Applies `f` to each range in `state` (see `changeByRange`)
 */
clojure_eval.util.update_ranges = (function clojure_eval$util$update_ranges(var_args){
var G__54888 = arguments.length;
switch (G__54888) {
case 2:
return clojure_eval.util.update_ranges.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return clojure_eval.util.update_ranges.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));

}
});

(clojure_eval.util.update_ranges.cljs$core$IFn$_invoke$arity$2 = (function (state,f){
return clojure_eval.util.update_ranges.cljs$core$IFn$_invoke$arity$3(state,null,f);
}));

(clojure_eval.util.update_ranges.cljs$core$IFn$_invoke$arity$3 = (function (state,tr_specs,f){
return state.update((function (p1__54886_SHARP_){
return applied_science.js_interop.extend_BANG_.cljs$core$IFn$_invoke$arity$2(p1__54886_SHARP_,tr_specs);
})(state.changeByRange((function (range){
var or__4223__auto__ = (function (){var temp__5757__auto__ = (f.cljs$core$IFn$_invoke$arity$1 ? f.cljs$core$IFn$_invoke$arity$1(range) : f.call(null,range));
if((temp__5757__auto__ == null)){
return null;
} else {
var result = temp__5757__auto__;
return clojure_eval.util.map_cursor(range,state,result);
}
})();
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return ({"range": range});
}
}))));
}));

(clojure_eval.util.update_ranges.cljs$lang$maxFixedArity = 3);

clojure_eval.util.dispatch_changes = (function clojure_eval$util$dispatch_changes(state,dispatch,changes){
if(cljs.core.truth_(changes.empty)){
return null;
} else {
var G__54889 = state.update(({"changes": changes}));
return (dispatch.cljs$core$IFn$_invoke$arity$1 ? dispatch.cljs$core$IFn$_invoke$arity$1(G__54889) : dispatch.call(null,G__54889));
}
});
clojure_eval.util.update_lines = (function clojure_eval$util$update_lines(var_args){
var args__4835__auto__ = [];
var len__4829__auto___55219 = arguments.length;
var i__4830__auto___55220 = (0);
while(true){
if((i__4830__auto___55220 < len__4829__auto___55219)){
args__4835__auto__.push((arguments[i__4830__auto___55220]));

var G__55222 = (i__4830__auto___55220 + (1));
i__4830__auto___55220 = G__55222;
continue;
} else {
}
break;
}

var argseq__4836__auto__ = ((((2) < args__4835__auto__.length))?(new cljs.core.IndexedSeq(args__4835__auto__.slice((2)),(0),null)):null);
return clojure_eval.util.update_lines.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__4836__auto__);
});

(clojure_eval.util.update_lines.cljs$core$IFn$_invoke$arity$variadic = (function (state,f,p__54897){
var vec__54898 = p__54897;
var map__54901 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__54898,(0),null);
var map__54901__$1 = cljs.core.__destructure_map(map__54901);
var from = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__54901__$1,new cljs.core.Keyword(null,"from","from",1815293044),(0));
var to = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54901__$1,new cljs.core.Keyword(null,"to","to",192099007));
var spec = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__54901__$1,new cljs.core.Keyword(null,"spec","spec",347520401));
var iterator = state.doc.iter();
var result = iterator.next();
var changes = [];
var from_pos = from;
var line_num = (1);
while(true){
var map__54925 = result;
var map__54925__$1 = (((((!((map__54925 == null))))?(((((map__54925.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__54925.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__54925):map__54925);
var done = (function (){var obj54927 = map__54925__$1;
var k54928 = "done";
if((function (){var obj54929 = obj54927;
return (((!((obj54929 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k54928,obj54929)));
})()){
return (obj54927[k54928]);
} else {
return undefined;
}
})();
var lineBreak = (function (){var obj54930 = map__54925__$1;
var k54931 = "lineBreak";
if((function (){var obj54932 = obj54930;
return (((!((obj54932 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k54931,obj54932)));
})()){
return (obj54930[k54931]);
} else {
return undefined;
}
})();
var value = (function (){var obj54933 = map__54925__$1;
var k54934 = "value";
if((function (){var obj54935 = obj54933;
return (((!((obj54935 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k54934,obj54935)));
})()){
return (obj54933[k54934]);
} else {
return undefined;
}
})();
if(cljs.core.truth_((function (){var or__4223__auto__ = done;
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return (from > to);
}
})())){
return state.update(applied_science.js_interop.extend_BANG_.cljs$core$IFn$_invoke$arity$2(({"changes": state.changes(changes)}),spec));
} else {
var G__55223 = iterator.next();
var G__55224 = (function (){var temp__5751__auto__ = (function (){var and__4221__auto__ = cljs.core.not(lineBreak);
if(and__4221__auto__){
return (f.cljs$core$IFn$_invoke$arity$3 ? f.cljs$core$IFn$_invoke$arity$3(from_pos,value,line_num) : f.call(null,from_pos,value,line_num));
} else {
return and__4221__auto__;
}
})();
if(cljs.core.truth_(temp__5751__auto__)){
var change = temp__5751__auto__;
var array54936 = changes;
array54936.push(change);

return array54936;
} else {
return changes;
}
})();
var G__55225 = (from_pos + ((value).length));
var G__55226 = (function (){var G__54937 = line_num;
if(cljs.core.truth_(lineBreak)){
return (G__54937 + (1));
} else {
return G__54937;
}
})();
result = G__55223;
changes = G__55224;
from_pos = G__55225;
line_num = G__55226;
continue;
}
break;
}
}));

(clojure_eval.util.update_lines.cljs$lang$maxFixedArity = (2));

/** @this {Function} */
(clojure_eval.util.update_lines.cljs$lang$applyTo = (function (seq54892){
var G__54893 = cljs.core.first(seq54892);
var seq54892__$1 = cljs.core.next(seq54892);
var G__54894 = cljs.core.first(seq54892__$1);
var seq54892__$2 = cljs.core.next(seq54892__$1);
var self__4816__auto__ = this;
return self__4816__auto__.cljs$core$IFn$_invoke$arity$variadic(G__54893,G__54894,seq54892__$2);
}));

/**
 * `f` will be called for each selected line with args [line, changes-array, range]
 * and should *mutate* changes-array
 */
clojure_eval.util.update_selected_lines = (function clojure_eval$util$update_selected_lines(state,f){
var at_line = cljs.core.atom.cljs$core$IFn$_invoke$arity$1((-1));
var doc = state.doc;
return state.changeByRange((function (p__54939){
var map__54940 = p__54939;
var map__54940__$1 = (((((!((map__54940 == null))))?(((((map__54940.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__54940.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__54940):map__54940);
var range = map__54940__$1;
var from = (function (){var obj54942 = map__54940__$1;
var k54943 = "from";
if((function (){var obj54944 = obj54942;
return (((!((obj54944 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k54943,obj54944)));
})()){
return (obj54942[k54943]);
} else {
return undefined;
}
})();
var to = (function (){var obj54945 = map__54940__$1;
var k54946 = "to";
if((function (){var obj54947 = obj54945;
return (((!((obj54947 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k54946,obj54947)));
})()){
return (obj54945[k54946]);
} else {
return undefined;
}
})();
var anchor = (function (){var obj54948 = map__54940__$1;
var k54949 = "anchor";
if((function (){var obj54950 = obj54948;
return (((!((obj54950 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k54949,obj54950)));
})()){
return (obj54948[k54949]);
} else {
return undefined;
}
})();
var head = (function (){var obj54951 = map__54940__$1;
var k54952 = "head";
if((function (){var obj54953 = obj54951;
return (((!((obj54953 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k54952,obj54953)));
})()){
return (obj54951[k54952]);
} else {
return undefined;
}
})();
var changes = [];
var line = doc.lineAt(from);
while(true){
var map__54964 = line;
var map__54964__$1 = (((((!((map__54964 == null))))?(((((map__54964.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__54964.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__54964):map__54964);
var line_number = (function (){var obj54966 = map__54964__$1;
var k54967 = "number";
if((function (){var obj54968 = obj54966;
return (((!((obj54968 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k54967,obj54968)));
})()){
return (obj54966[k54967]);
} else {
return undefined;
}
})();
var line_to = (function (){var obj54969 = map__54964__$1;
var k54970 = "to";
if((function (){var obj54971 = obj54969;
return (((!((obj54971 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k54970,obj54971)));
})()){
return (obj54969[k54970]);
} else {
return undefined;
}
})();
if((line.number > cljs.core.deref(at_line))){
cljs.core.reset_BANG_(at_line,line_number);

(f.cljs$core$IFn$_invoke$arity$3 ? f.cljs$core$IFn$_invoke$arity$3(line,changes,range) : f.call(null,line,changes,range));
} else {
}

var temp__5751__auto__ = (function (){var and__4221__auto__ = (to > line_to);
if(and__4221__auto__){
return clojure_eval.util.guard(doc.lineAt((line_to + (1))),((function (line,and__4221__auto__,map__54964,map__54964__$1,line_number,line_to,changes,map__54940,map__54940__$1,range,from,to,anchor,head,at_line,doc){
return (function (p1__54938_SHARP_){
return (p1__54938_SHARP_.number > line_number);
});})(line,and__4221__auto__,map__54964,map__54964__$1,line_number,line_to,changes,map__54940,map__54940__$1,range,from,to,anchor,head,at_line,doc))
);
} else {
return and__4221__auto__;
}
})();
if(cljs.core.truth_(temp__5751__auto__)){
var next_line = temp__5751__auto__;
var G__55227 = next_line;
line = G__55227;
continue;
} else {
var change_set = state.changes(changes);
return ({"changes": changes, "range": module$node_modules$$codemirror$state$dist$index_cjs.EditorSelection.range(change_set.mapPos(anchor,(1)),change_set.mapPos(head,(1)))});
}
break;
}
}));
});
/**
 * `f` will be called for each changed line with args [line, changes-array]
 * and should *mutate* changes-array. Selections will be mapped through the resulting changeset.
 */
clojure_eval.util.iter_changed_lines = (function clojure_eval$util$iter_changed_lines(p__54976,f){
var map__54977 = p__54976;
var map__54977__$1 = (((((!((map__54977 == null))))?(((((map__54977.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__54977.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__54977):map__54977);
var tr = map__54977__$1;
var map__54979 = (function (){var obj54983 = map__54977__$1;
var k54984 = "state";
if((function (){var obj54985 = obj54983;
return (((!((obj54985 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k54984,obj54985)));
})()){
return (obj54983[k54984]);
} else {
return undefined;
}
})();
var map__54979__$1 = (((((!((map__54979 == null))))?(((((map__54979.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__54979.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__54979):map__54979);
var state = map__54979__$1;
var doc = (function (){var obj54996 = map__54979__$1;
var k54997 = "doc";
if((function (){var obj54999 = obj54996;
return (((!((obj54999 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k54997,obj54999)));
})()){
return (obj54996[k54997]);
} else {
return undefined;
}
})();
var changes = (function (){var obj55004 = map__54977__$1;
var k55005 = "changes";
if((function (){var obj55006 = obj55004;
return (((!((obj55006 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55005,obj55006)));
})()){
return (obj55004[k55005]);
} else {
return undefined;
}
})();
var effects = (function (){var obj55012 = map__54977__$1;
var k55013 = "effects";
if((function (){var obj55018 = obj55012;
return (((!((obj55018 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55013,obj55018)));
})()){
return (obj55012[k55013]);
} else {
return undefined;
}
})();
var selection = (function (){var obj55024 = map__54977__$1;
var k55025 = "selection";
if((function (){var obj55026 = obj55024;
return (((!((obj55026 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55025,obj55026)));
})()){
return (obj55024[k55025]);
} else {
return undefined;
}
})();
var at_line = cljs.core.atom.cljs$core$IFn$_invoke$arity$1((-1));
var next_changes = [];
var _ = changes.iterChanges((function (from_a,to_a,from_b,to_b,inserted){
var map__55028 = doc.lineAt(from_b);
var map__55028__$1 = (((((!((map__55028 == null))))?(((((map__55028.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__55028.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__55028):map__55028);
var line = map__55028__$1;
var line_number = (function (){var obj55065 = map__55028__$1;
var k55066 = "number";
if((function (){var obj55067 = obj55065;
return (((!((obj55067 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55066,obj55067)));
})()){
return (obj55065[k55066]);
} else {
return undefined;
}
})();
var line_to = (function (){var obj55068 = map__55028__$1;
var k55069 = "to";
if((function (){var obj55074 = obj55068;
return (((!((obj55074 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55069,obj55074)));
})()){
return (obj55068[k55069]);
} else {
return undefined;
}
})();
var line__$1 = line;
while(true){
if((line_number > cljs.core.deref(at_line))){
cljs.core.reset_BANG_(at_line,line_number);

(f.cljs$core$IFn$_invoke$arity$2 ? f.cljs$core$IFn$_invoke$arity$2(line__$1,next_changes) : f.call(null,line__$1,next_changes));
} else {
}

if((to_b <= line_to)){
return null;
} else {
var next_line = doc.lineAt((line_to + (1)));
if(cljs.core.truth_((function (){var and__4221__auto__ = next_line;
if(cljs.core.truth_(and__4221__auto__)){
return (next_line.number > line__$1.number);
} else {
return and__4221__auto__;
}
})())){
var G__55228 = next_line;
line__$1 = G__55228;
continue;
} else {
return null;
}
}
break;
}
}));
var next_changeset = state.changes(next_changes);
if(cljs.core.seq(next_changes)){
var G__55104 = (function (){var obj55105 = (function (){var obj55106 = tr;
if((!((obj55106 == null)))){
var out55107 = ({});
var k__54310__auto___55229 = "annotations";
if(applied_science.js_interop.impl.in_QMARK__STAR_(k__54310__auto___55229,obj55106)){
var obj55126_55230 = out55107;
(obj55126_55230[k__54310__auto___55229] = (obj55106[k__54310__auto___55229]));

} else {
}

var k__54310__auto___55231 = "scrollIntoView";
if(applied_science.js_interop.impl.in_QMARK__STAR_(k__54310__auto___55231,obj55106)){
var obj55135_55232 = out55107;
(obj55135_55232[k__54310__auto___55231] = (obj55106[k__54310__auto___55231]));

} else {
}

var k__54310__auto___55233 = "reconfigure";
if(applied_science.js_interop.impl.in_QMARK__STAR_(k__54310__auto___55233,obj55106)){
var obj55139_55234 = out55107;
(obj55139_55234[k__54310__auto___55233] = (obj55106[k__54310__auto___55233]));

} else {
}

return out55107;
} else {
return ({});
}
})();
var obj55150 = (((!((obj55105 == null))))?obj55105:({}));
(obj55150["changes"] = changes.compose(next_changeset));

return obj55150;
})();
var G__55104__$1 = (cljs.core.truth_(selection)?(function (){var obj55165 = G__55104;
var obj55167 = (((!((obj55165 == null))))?obj55165:({}));
(obj55167["selection"] = state.selection.map(next_changeset));

return obj55167;
})():G__55104);
if(cljs.core.truth_(effects)){
var obj55175 = G__55104__$1;
var obj55184 = (((!((obj55175 == null))))?obj55175:({}));
(obj55184["effects"] = module$node_modules$$codemirror$state$dist$index_cjs.StateEffect.mapEffects(effects,next_changeset));

return obj55184;
} else {
return G__55104__$1;
}
} else {
return tr;
}
});
clojure_eval.util.something_selected_QMARK_ = (function clojure_eval$util$something_selected_QMARK_(p__55196){
var map__55197 = p__55196;
var map__55197__$1 = (((((!((map__55197 == null))))?(((((map__55197.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__55197.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__55197):map__55197);
var map__55198 = (function (){var obj55200 = map__55197__$1;
var k55201 = "selection";
if((function (){var obj55202 = obj55200;
return (((!((obj55202 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55201,obj55202)));
})()){
return (obj55200[k55201]);
} else {
return undefined;
}
})();
var map__55198__$1 = (((((!((map__55198 == null))))?(((((map__55198.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__55198.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__55198):map__55198);
var ranges = (function (){var obj55204 = map__55198__$1;
var k55205 = "ranges";
if((function (){var obj55206 = obj55204;
return (((!((obj55206 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55205,obj55206)));
})()){
return (obj55204[k55205]);
} else {
return undefined;
}
})();
return (!(cljs.core.every_QMARK_((function (p1__55195_SHARP_){
return p1__55195_SHARP_.empty;
}),ranges)));
});
clojure_eval.util.range_str = (function clojure_eval$util$range_str(state,p__55207){
var map__55208 = p__55207;
var map__55208__$1 = (((((!((map__55208 == null))))?(((((map__55208.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__55208.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__55208):map__55208);
var selection = map__55208__$1;
var from = (function (){var obj55210 = map__55208__$1;
var k55211 = "from";
if((function (){var obj55212 = obj55210;
return (((!((obj55212 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55211,obj55212)));
})()){
return (obj55210[k55211]);
} else {
return undefined;
}
})();
var to = (function (){var obj55213 = map__55208__$1;
var k55214 = "to";
if((function (){var obj55215 = obj55213;
return (((!((obj55215 == null)))) && (applied_science.js_interop.impl.in_QMARK__STAR_(k55214,obj55215)));
})()){
return (obj55213[k55214]);
} else {
return undefined;
}
})();
return cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var parent__54409__auto__ = (state["doc"]);
var f__54410__auto__ = (parent__54409__auto__["slice"]);
return f__54410__auto__.call(parent__54409__auto__,from,to);
})());
});

//# sourceMappingURL=clojure_eval.util.js.map
