// Compiled by ClojureScript 0.0-2138
goog.provide('lt.objs.document');
goog.require('cljs.core');
goog.require('lt.objs.popup');
goog.require('lt.objs.popup');
goog.require('lt.objs.files');
goog.require('lt.objs.files');
goog.require('lt.object');
goog.require('lt.object');
lt.objs.document.doc_keys = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"line-ending","line-ending",4015468690),new cljs.core.Keyword(null,"mime","mime",1017255846)], null);
lt.objs.document.create_STAR_ = (function create_STAR_(info){return CodeMirror.Doc(new cljs.core.Keyword(null,"content","content",1965434859).cljs$core$IFn$_invoke$arity$1(info),new cljs.core.Keyword(null,"mime","mime",1017255846).cljs$core$IFn$_invoke$arity$1(info));
});
lt.objs.document.__GT_cm_doc = (function __GT_cm_doc(doc){return new cljs.core.Keyword(null,"doc","doc",1014003882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,doc));
});
lt.objs.document.linked_STAR_ = (function linked_STAR_(doc,info){var map__12252 = info;var map__12252__$1 = ((cljs.core.seq_QMARK_.call(null,map__12252))?cljs.core.apply.call(null,cljs.core.hash_map,map__12252):map__12252);var type = cljs.core.get.call(null,map__12252__$1,new cljs.core.Keyword(null,"type","type",1017479852));var shared_history = cljs.core.get.call(null,map__12252__$1,new cljs.core.Keyword(null,"shared-history","shared-history",2516333214));var to = cljs.core.get.call(null,map__12252__$1,new cljs.core.Keyword(null,"to","to",1013907949));var from = cljs.core.get.call(null,map__12252__$1,new cljs.core.Keyword(null,"from","from",1017056028));return lt.objs.document.__GT_cm_doc.call(null,doc).linkedDoc(cljs.core.clj__GT_js.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"from","from",1017056028),from,new cljs.core.Keyword(null,"to","to",1013907949),to,new cljs.core.Keyword(null,"sharedHist","sharedHist",3524212889),shared_history,new cljs.core.Keyword(null,"mode","mode",1017261333),type], null)));
});
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.document","document","lt.objs.document/document",998139243),new cljs.core.Keyword(null,"sub-docs","sub-docs",3182649626),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("lt.objs.document","this","lt.objs.document/this",4506312184),null], null), null),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"document","document",1875625101),null], null), null),new cljs.core.Keyword(null,"init","init",1017141378),(function (this$,info){lt.object.merge_BANG_.call(null,this$,cljs.core.merge.call(null,cljs.core.dissoc.call(null,info,new cljs.core.Keyword(null,"content","content",1965434859)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"doc","doc",1014003882),(function (){var or__3520__auto__ = new cljs.core.Keyword(null,"doc","doc",1014003882).cljs$core$IFn$_invoke$arity$1(info);if(cljs.core.truth_(or__3520__auto__))
{return or__3520__auto__;
} else
{return lt.objs.document.create_STAR_.call(null,info);
}
})()], null)));
return null;
}));
lt.objs.document.__BEH__close_document_on_editor_close = (function __BEH__close_document_on_editor_close(editor){var temp__4092__auto__ = new cljs.core.Keyword(null,"doc","doc",1014003882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,editor));if(cljs.core.truth_(temp__4092__auto__))
{var doc = temp__4092__auto__;return lt.object.raise.call(null,doc,new cljs.core.Keyword(null,"close.force","close.force",4409585383));
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.document","close-document-on-editor-close","lt.objs.document/close-document-on-editor-close",4752984221),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.document.__BEH__close_document_on_editor_close,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"closed","closed",3951351006),null], null), null),new cljs.core.Keyword(null,"for","for",1014005819),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"editor","editor",4001043679),null], null), null));
lt.objs.document.__BEH__close_linked_document = (function __BEH__close_linked_document(this$){var temp__4092__auto___12253 = new cljs.core.Keyword(null,"root","root",1017410644).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$));if(cljs.core.truth_(temp__4092__auto___12253))
{var root_12254 = temp__4092__auto___12253;lt.objs.document.__GT_cm_doc.call(null,this$).unlinkDoc(lt.objs.document.__GT_cm_doc.call(null,root_12254));
lt.object.update_BANG_.call(null,root_12254,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"sub-docs","sub-docs",3182649626)], null),cljs.core.disj,this$);
} else
{}
return lt.object.destroy_BANG_.call(null,this$);
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.document","close-linked-document","lt.objs.document/close-linked-document",854834124),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.document.__BEH__close_linked_document,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"close.force","close.force",4409585383),null], null), null),new cljs.core.Keyword(null,"for","for",1014005819),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"document","document",1875625101),null], null), null));
lt.objs.document.__BEH__try_close_root_document = (function __BEH__try_close_root_document(this$){if(cljs.core._EQ_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("lt.objs.document","this","lt.objs.document/this",4506312184),null], null), null),new cljs.core.Keyword(null,"sub-docs","sub-docs",3182649626).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))))
{return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"close.force","close.force",4409585383));
} else
{return null;
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.document","try-close-root-document","lt.objs.document/try-close-root-document",515293911),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.document.__BEH__try_close_root_document,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"try-close","try-close",4311297752),null], null), null),new cljs.core.Keyword(null,"for","for",1014005819),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"document","document",1875625101),null], null), null));
lt.objs.document.__BEH__close_root_document = (function __BEH__close_root_document(this$){if((cljs.core._EQ_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("lt.objs.document","this","lt.objs.document/this",4506312184),null], null), null),new cljs.core.Keyword(null,"sub-docs","sub-docs",3182649626).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$)))) && (cljs.core.not.call(null,lt.object.has_tag_QMARK_.call(null,this$,new cljs.core.Keyword(null,"document.linked","document.linked",3550087614)))))
{return lt.object.destroy_BANG_.call(null,this$);
} else
{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,"sub-docs","sub-docs",3182649626)], null),cljs.core.disj,new cljs.core.Keyword("lt.objs.document","this","lt.objs.document/this",4506312184));
}
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.document","close-root-document","lt.objs.document/close-root-document",4033838565),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.document.__BEH__close_root_document,new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"close.force","close.force",4409585383),null], null), null),new cljs.core.Keyword(null,"for","for",1014005819),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"document","document",1875625101),null], null), null));
lt.objs.document.default_linked_doc_options = cljs.core.PersistentArrayMap.EMPTY;
lt.objs.document.__BEH__set_linked_doc_options = (function __BEH__set_linked_doc_options(this$,opts){return lt.objs.document.default_linked_doc_options = opts;
});
lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.objs.document","set-linked-doc-options","lt.objs.document/set-linked-doc-options",4426770422),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.objs.document.__BEH__set_linked_doc_options,new cljs.core.Keyword(null,"desc","desc",1016984067),"Doc: Set default options for new linked docs",new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"object.instant","object.instant",773332388),null], null), null),new cljs.core.Keyword(null,"type","type",1017479852),new cljs.core.Keyword(null,"user","user",1017503549),new cljs.core.Keyword(null,"exclusive","exclusive",2700522000),true);
lt.objs.document.create = (function create(info){return lt.object.create.call(null,new cljs.core.Keyword("lt.objs.document","document","lt.objs.document/document",998139243),info);
});
lt.objs.document.create_sub = (function() {
var create_sub = null;
var create_sub__1 = (function (doc){return create_sub.call(null,doc,null);
});
var create_sub__2 = (function (doc,info){var info__$1 = cljs.core.merge.call(null,lt.objs.document.default_linked_doc_options,info);var neue = lt.objs.document.create.call(null,cljs.core.merge.call(null,cljs.core.select_keys.call(null,cljs.core.deref.call(null,doc),lt.objs.document.doc_keys),info__$1,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"doc","doc",1014003882),lt.objs.document.linked_STAR_.call(null,doc,info__$1),new cljs.core.Keyword(null,"root","root",1017410644),doc], null)));lt.object.add_tags.call(null,neue,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"document.linked","document.linked",3550087614)], null));
return lt.object.update_BANG_.call(null,doc,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"sub-docs","sub-docs",3182649626)], null),cljs.core.conj,neue);
});
create_sub = function(doc,info){
switch(arguments.length){
case 1:
return create_sub__1.call(this,doc);
case 2:
return create_sub__2.call(this,doc,info);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
create_sub.cljs$core$IFn$_invoke$arity$1 = create_sub__1;
create_sub.cljs$core$IFn$_invoke$arity$2 = create_sub__2;
return create_sub;
})()
;
lt.objs.document.__GT_snapshot = (function __GT_snapshot(doc){var d = lt.objs.document.__GT_cm_doc.call(null,doc);var lines = cljs.core.transient$.call(null,cljs.core.PersistentVector.EMPTY);d.eachLine((function (line){cljs.core.conj_BANG_.call(null,lines,line.text);
return null;
}));
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"version","version",1365512266),d.changeGeneration(),new cljs.core.Keyword(null,"lines","lines",1116881521),cljs.core.persistent_BANG_.call(null,lines),new cljs.core.Keyword(null,"doc","doc",1014003882),doc], null);
});
lt.objs.document.latest_snapshot_QMARK_ = (function latest_snapshot_QMARK_(snapshot){return cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"version","version",1365512266).cljs$core$IFn$_invoke$arity$1(snapshot),lt.objs.document.__GT_cm_doc.call(null,new cljs.core.Keyword(null,"doc","doc",1014003882).cljs$core$IFn$_invoke$arity$1(snapshot)).changeGeneration());
});
lt.objs.document.__GT_val = (function __GT_val(doc){return lt.objs.document.__GT_cm_doc.call(null,doc).getValue();
});
lt.objs.document.set_val = (function set_val(doc,v){return lt.objs.document.__GT_cm_doc.call(null,doc).setValue(v);
});
lt.objs.document.replace = (function() {
var replace = null;
var replace__3 = (function (d,from,v){return lt.objs.document.__GT_cm_doc.call(null,d).replaceRange(v,cljs.core.clj__GT_js.call(null,from));
});
var replace__4 = (function (d,from,to,v){return lt.objs.document.__GT_cm_doc.call(null,d).replaceRange(v,cljs.core.clj__GT_js.call(null,from),cljs.core.clj__GT_js.call(null,to));
});
replace = function(d,from,to,v){
switch(arguments.length){
case 3:
return replace__3.call(this,d,from,to);
case 4:
return replace__4.call(this,d,from,to,v);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
replace.cljs$core$IFn$_invoke$arity$3 = replace__3;
replace.cljs$core$IFn$_invoke$arity$4 = replace__4;
return replace;
})()
;
lt.objs.document.register_doc = (function register_doc(doc,path){return lt.object.update_BANG_.call(null,lt.objs.document.manager,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"files","files",1111338473)], null),cljs.core.assoc,path,doc);
});
lt.objs.document.open = (function open(path,cb){return lt.objs.files.open.call(null,path,(function (data){var d = lt.objs.document.create.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"content","content",1965434859),new cljs.core.Keyword(null,"content","content",1965434859).cljs$core$IFn$_invoke$arity$1(data),new cljs.core.Keyword(null,"line-ending","line-ending",4015468690),new cljs.core.Keyword(null,"line-ending","line-ending",4015468690).cljs$core$IFn$_invoke$arity$1(data),new cljs.core.Keyword(null,"mtime","mtime",1118128172),lt.objs.files.stats.call(null,path),new cljs.core.Keyword(null,"mime","mime",1017255846),new cljs.core.Keyword(null,"type","type",1017479852).cljs$core$IFn$_invoke$arity$1(data)], null));lt.objs.document.register_doc.call(null,d,path);
if(cljs.core.truth_(cb))
{return cb.call(null,d);
} else
{return null;
}
}));
});
lt.objs.document.linked_open = (function linked_open(ed,ldoc_options,path,cb){lt.objs.document.create_sub.call(null,new cljs.core.Keyword(null,"doc","doc",1014003882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ed)),ldoc_options);
return lt.objs.files.open.call(null,path,(function (data){var d = cljs.core.last.call(null,new cljs.core.Keyword(null,"sub-docs","sub-docs",3182649626).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,new cljs.core.Keyword(null,"doc","doc",1014003882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,ed)))));if(cljs.core.truth_(cb))
{return cb.call(null,d);
} else
{return null;
}
}));
});
lt.objs.document.check_mtime = (function check_mtime(prev,updated){if(cljs.core.truth_((function (){var and__3508__auto__ = prev;if(cljs.core.truth_(and__3508__auto__))
{return updated;
} else
{return and__3508__auto__;
}
})()))
{return cljs.core._EQ_.call(null,prev.mtime.getTime(),updated.mtime.getTime());
} else
{return true;
}
});
/**
* @param {...*} var_args
*/
lt.objs.document.button = (function() { 
var button__delegate = function (label,p__12255){var vec__12263 = p__12255;var cb = cljs.core.nth.call(null,vec__12263,0,null);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,"div.button.right","div.button.right",629503503),label], null));var seq__12264_12270 = 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_(cb))
{return cb.call(null);
} else
{return null;
}
})], null)));var chunk__12265_12271 = null;var count__12266_12272 = 0;var i__12267_12273 = 0;while(true){
if((i__12267_12273 < count__12266_12272))
{var vec__12268_12274 = cljs.core._nth.call(null,chunk__12265_12271,i__12267_12273);var ev__3326__auto___12275 = cljs.core.nth.call(null,vec__12268_12274,0,null);var func__3327__auto___12276 = cljs.core.nth.call(null,vec__12268_12274,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12275,func__3327__auto___12276);
{
var G__12277 = seq__12264_12270;
var G__12278 = chunk__12265_12271;
var G__12279 = count__12266_12272;
var G__12280 = (i__12267_12273 + 1);
seq__12264_12270 = G__12277;
chunk__12265_12271 = G__12278;
count__12266_12272 = G__12279;
i__12267_12273 = G__12280;
continue;
}
} else
{var temp__4092__auto___12281 = cljs.core.seq.call(null,seq__12264_12270);if(temp__4092__auto___12281)
{var seq__12264_12282__$1 = temp__4092__auto___12281;if(cljs.core.chunked_seq_QMARK_.call(null,seq__12264_12282__$1))
{var c__4262__auto___12283 = cljs.core.chunk_first.call(null,seq__12264_12282__$1);{
var G__12284 = cljs.core.chunk_rest.call(null,seq__12264_12282__$1);
var G__12285 = c__4262__auto___12283;
var G__12286 = cljs.core.count.call(null,c__4262__auto___12283);
var G__12287 = 0;
seq__12264_12270 = G__12284;
chunk__12265_12271 = G__12285;
count__12266_12272 = G__12286;
i__12267_12273 = G__12287;
continue;
}
} else
{var vec__12269_12288 = cljs.core.first.call(null,seq__12264_12282__$1);var ev__3326__auto___12289 = cljs.core.nth.call(null,vec__12269_12288,0,null);var func__3327__auto___12290 = cljs.core.nth.call(null,vec__12269_12288,1,null);lt.util.dom.on.call(null,e__3325__auto__,ev__3326__auto___12289,func__3327__auto___12290);
{
var G__12291 = cljs.core.next.call(null,seq__12264_12282__$1);
var G__12292 = null;
var G__12293 = 0;
var G__12294 = 0;
seq__12264_12270 = G__12291;
chunk__12265_12271 = G__12292;
count__12266_12272 = G__12293;
i__12267_12273 = G__12294;
continue;
}
}
} else
{}
}
break;
}
return e__3325__auto__;
};
var button = function (label,var_args){
var p__12255 = null;if (arguments.length > 1) {
  p__12255 = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1),0);} 
return button__delegate.call(this,label,p__12255);};
button.cljs$lang$maxFixedArity = 1;
button.cljs$lang$applyTo = (function (arglist__12295){
var label = cljs.core.first(arglist__12295);
var p__12255 = cljs.core.rest(arglist__12295);
return button__delegate(label,p__12255);
});
button.cljs$core$IFn$_invoke$arity$variadic = button__delegate;
return button;
})()
;
lt.objs.document.overwrite_warn = (function overwrite_warn(cb){return lt.objs.popup.popup_BANG_.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"header","header",4087600639),"This file was modified.",new cljs.core.Keyword(null,"body","body",1016933652),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"p","p",1013904354),"It looks like this file was modified outside of Light Table and saving\n                  would overwrite those changes. Do you want to overwrite or cancel?"], null),new cljs.core.Keyword(null,"buttons","buttons",1255256819),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1116631654),"Overwrite file",new cljs.core.Keyword(null,"action","action",3885920680),cb], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1116631654),"Cancel"], null)], null)], null));
});
lt.objs.document.path__GT_doc = (function path__GT_doc(path){return cljs.core.get.call(null,new cljs.core.Keyword(null,"files","files",1111338473).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.document.manager)),path);
});
lt.objs.document.__GT_stats = (function __GT_stats(path){return new cljs.core.Keyword(null,"mtime","mtime",1118128172).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,lt.objs.document.path__GT_doc.call(null,path)));
});
lt.objs.document.update_stats = (function update_stats(path){return lt.object.merge_BANG_.call(null,cljs.core.get_in.call(null,cljs.core.deref.call(null,lt.objs.document.manager),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"files","files",1111338473),path], null)),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mtime","mtime",1118128172),lt.objs.files.stats.call(null,path)], null));
});
lt.objs.document.move_doc = (function move_doc(old,neue){var temp__4092__auto__ = lt.objs.document.path__GT_doc.call(null,old);if(cljs.core.truth_(temp__4092__auto__))
{var old_d = temp__4092__auto__;lt.object.update_BANG_.call(null,lt.objs.document.manager,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"files","files",1111338473)], null),cljs.core.assoc,neue,old_d);
lt.object.update_BANG_.call(null,lt.objs.document.manager,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"files","files",1111338473)], null),cljs.core.dissoc,old);
return lt.objs.document.update_stats.call(null,neue);
} else
{return null;
}
});
lt.objs.document.save_STAR_ = (function save_STAR_(path,content,cb){return lt.objs.files.save.call(null,path,content,(function (data){lt.objs.document.update_stats.call(null,path);
if(cljs.core.truth_(cb))
{return cb.call(null,data);
} else
{return null;
}
}));
});
lt.objs.document.save = (function save(path,content,cb){var updated = lt.objs.files.stats.call(null,path);var safe_QMARK_ = lt.objs.document.check_mtime.call(null,lt.objs.document.__GT_stats.call(null,path),updated);if(!(safe_QMARK_))
{return lt.objs.document.overwrite_warn.call(null,(function (){return lt.objs.document.save_STAR_.call(null,path,content,cb);
}));
} else
{return lt.objs.document.save_STAR_.call(null,path,content,cb);
}
});
lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.objs.document","doc-manager","lt.objs.document/doc-manager",3973346414),new cljs.core.Keyword(null,"triggers","triggers",2516997421),cljs.core.PersistentVector.EMPTY,new cljs.core.Keyword(null,"behaviors","behaviors",607554515),cljs.core.PersistentVector.EMPTY,new cljs.core.Keyword(null,"files","files",1111338473),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"init","init",1017141378),(function (){return null;
}));
lt.objs.document.manager = lt.object.create.call(null,new cljs.core.Keyword("lt.objs.document","doc-manager","lt.objs.document/doc-manager",3973346414));
