git.fiddlerwoaroof.com
Raw Blame History
// Compiled by ClojureScript 1.9.293 {}
goog.provide('datascript.parser');
goog.require('cljs.core');
goog.require('clojure.set');
goog.require('datascript.db');
datascript.parser.collect_vars_acc = (function datascript$parser$collect_vars_acc(acc,form){
return null;
});
datascript.parser.parse_clause = (function datascript$parser$parse_clause(form){
return null;
});
datascript.parser.parse_clauses = (function datascript$parser$parse_clauses(clauses){
return null;
});
datascript.parser.parse_binding = (function datascript$parser$parse_binding(form){
return null;
});

/**
 * @interface
 */
datascript.parser.ITraversable = function(){};

datascript.parser._collect = (function datascript$parser$_collect(_,pred,acc){
if((!((_ == null))) && (!((_.datascript$parser$ITraversable$_collect$arity$3 == null)))){
return _.datascript$parser$ITraversable$_collect$arity$3(_,pred,acc);
} else {
var x__15882__auto__ = (((_ == null))?null:_);
var m__15883__auto__ = (datascript.parser._collect[goog.typeOf(x__15882__auto__)]);
if(!((m__15883__auto__ == null))){
return m__15883__auto__.call(null,_,pred,acc);
} else {
var m__15883__auto____$1 = (datascript.parser._collect["_"]);
if(!((m__15883__auto____$1 == null))){
return m__15883__auto____$1.call(null,_,pred,acc);
} else {
throw cljs.core.missing_protocol.call(null,"ITraversable.-collect",_);
}
}
}
});

datascript.parser._collect_vars = (function datascript$parser$_collect_vars(_,acc){
if((!((_ == null))) && (!((_.datascript$parser$ITraversable$_collect_vars$arity$2 == null)))){
return _.datascript$parser$ITraversable$_collect_vars$arity$2(_,acc);
} else {
var x__15882__auto__ = (((_ == null))?null:_);
var m__15883__auto__ = (datascript.parser._collect_vars[goog.typeOf(x__15882__auto__)]);
if(!((m__15883__auto__ == null))){
return m__15883__auto__.call(null,_,acc);
} else {
var m__15883__auto____$1 = (datascript.parser._collect_vars["_"]);
if(!((m__15883__auto____$1 == null))){
return m__15883__auto____$1.call(null,_,acc);
} else {
throw cljs.core.missing_protocol.call(null,"ITraversable.-collect-vars",_);
}
}
}
});

datascript.parser._postwalk = (function datascript$parser$_postwalk(_,f){
if((!((_ == null))) && (!((_.datascript$parser$ITraversable$_postwalk$arity$2 == null)))){
return _.datascript$parser$ITraversable$_postwalk$arity$2(_,f);
} else {
var x__15882__auto__ = (((_ == null))?null:_);
var m__15883__auto__ = (datascript.parser._postwalk[goog.typeOf(x__15882__auto__)]);
if(!((m__15883__auto__ == null))){
return m__15883__auto__.call(null,_,f);
} else {
var m__15883__auto____$1 = (datascript.parser._postwalk["_"]);
if(!((m__15883__auto____$1 == null))){
return m__15883__auto____$1.call(null,_,f);
} else {
throw cljs.core.missing_protocol.call(null,"ITraversable.-postwalk",_);
}
}
}
});

datascript.parser.of_size_QMARK_ = (function datascript$parser$of_size_QMARK_(form,size){
return (cljs.core.sequential_QMARK_.call(null,form)) && (cljs.core._EQ_.call(null,cljs.core.count.call(null,form),size));
});
datascript.parser.parse_seq = (function datascript$parser$parse_seq(parse_el,form){
if(cljs.core.sequential_QMARK_.call(null,form)){
return cljs.core.reduce.call(null,(function (p1__24120_SHARP_,p2__24119_SHARP_){
var temp__4655__auto__ = parse_el.call(null,p2__24119_SHARP_);
if(cljs.core.truth_(temp__4655__auto__)){
var parsed = temp__4655__auto__;
return cljs.core.conj.call(null,p1__24120_SHARP_,parsed);
} else {
return cljs.core.reduced.call(null,null);
}
}),cljs.core.PersistentVector.EMPTY,form);
} else {
return null;
}
});
datascript.parser.collect = (function datascript$parser$collect(var_args){
var args24121 = [];
var len__16327__auto___24125 = arguments.length;
var i__16328__auto___24126 = (0);
while(true){
if((i__16328__auto___24126 < len__16327__auto___24125)){
args24121.push((arguments[i__16328__auto___24126]));

var G__24127 = (i__16328__auto___24126 + (1));
i__16328__auto___24126 = G__24127;
continue;
} else {
}
break;
}

var G__24123 = args24121.length;
switch (G__24123) {
case 2:
return datascript.parser.collect.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return datascript.parser.collect.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str("Invalid arity: "),cljs.core.str(args24121.length)].join('')));

}
});

datascript.parser.collect.cljs$core$IFn$_invoke$arity$2 = (function (pred,form){
return datascript.parser.collect.call(null,pred,form,cljs.core.PersistentVector.EMPTY);
});

datascript.parser.collect.cljs$core$IFn$_invoke$arity$3 = (function (pred,form,acc){
if(cljs.core.truth_(pred.call(null,form))){
return cljs.core.conj.call(null,acc,form);
} else {
if(((!((form == null)))?(((false) || ((cljs.core.PROTOCOL_SENTINEL === form.datascript$parser$ITraversable$)))?true:(((!form.cljs$lang$protocol_mask$partition$))?cljs.core.native_satisfies_QMARK_.call(null,datascript.parser.ITraversable,form):false)):cljs.core.native_satisfies_QMARK_.call(null,datascript.parser.ITraversable,form))){
return datascript.parser._collect.call(null,form,pred,acc);
} else {
if(datascript.db.seqable_QMARK_.call(null,form)){
return cljs.core.reduce.call(null,(function (acc__$1,form__$1){
return datascript.parser.collect.call(null,pred,form__$1,acc__$1);
}),acc,form);
} else {
return acc;

}
}
}
});

datascript.parser.collect.cljs$lang$maxFixedArity = 3;

datascript.parser.distinct_QMARK_ = (function datascript$parser$distinct_QMARK_(coll){
var or__15219__auto__ = cljs.core.empty_QMARK_.call(null,coll);
if(or__15219__auto__){
return or__15219__auto__;
} else {
return cljs.core.apply.call(null,cljs.core.distinct_QMARK_,coll);
}
});
datascript.parser.postwalk = (function datascript$parser$postwalk(form,f){
if(((!((form == null)))?(((false) || ((cljs.core.PROTOCOL_SENTINEL === form.datascript$parser$ITraversable$)))?true:(((!form.cljs$lang$protocol_mask$partition$))?cljs.core.native_satisfies_QMARK_.call(null,datascript.parser.ITraversable,form):false)):cljs.core.native_satisfies_QMARK_.call(null,datascript.parser.ITraversable,form))){
return f.call(null,datascript.parser._postwalk.call(null,form,f));
} else {
if(cljs.core.map_QMARK_.call(null,form)){
return f.call(null,cljs.core.reduce.call(null,(function (form__$1,p__24137){
var vec__24138 = p__24137;
var k = cljs.core.nth.call(null,vec__24138,(0),null);
var v = cljs.core.nth.call(null,vec__24138,(1),null);
return cljs.core.assoc.call(null,form__$1,k,datascript.parser.postwalk.call(null,v,f));
}),form,form));
} else {
if(cljs.core.seq_QMARK_.call(null,form)){
return f.call(null,cljs.core.map.call(null,(function (p1__24129_SHARP_){
return datascript.parser.postwalk.call(null,p1__24129_SHARP_,f);
}),form));
} else {
if(cljs.core.coll_QMARK_.call(null,form)){
return f.call(null,cljs.core.into.call(null,cljs.core.empty.call(null,form),cljs.core.map.call(null,(function (p1__24130_SHARP_){
return datascript.parser.postwalk.call(null,p1__24130_SHARP_,f);
}),form)));
} else {
return f.call(null,form);

}
}
}
}
});
datascript.parser.with_source = (function datascript$parser$with_source(obj,source){
return cljs.core.with_meta.call(null,obj,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"source","source",-433931539),source], null));
});
datascript.parser.source = (function datascript$parser$source(obj){
var or__15219__auto__ = new cljs.core.Keyword(null,"source","source",-433931539).cljs$core$IFn$_invoke$arity$1(cljs.core.meta.call(null,obj));
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
return obj;
}
});

/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.Placeholder = (function (__meta,__extmap,__hash){
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.Placeholder.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.Placeholder.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24145,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24147 = k24145;
switch (G__24147) {
default:
return cljs.core.get.call(null,self__.__extmap,k24145,else__15844__auto__);

}
});

datascript.parser.Placeholder.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.Placeholder{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,cljs.core.PersistentVector.EMPTY,self__.__extmap));
});

datascript.parser.Placeholder.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Placeholder.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24144){
var self__ = this;
var G__24144__$1 = this;
return (new cljs.core.RecordIter((0),G__24144__$1,0,cljs.core.PersistentVector.EMPTY,(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.Placeholder.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.Placeholder.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.Placeholder(self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.Placeholder.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (0 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.Placeholder.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.Placeholder.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.Placeholder.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,cljs.core.PersistentHashSet.EMPTY,k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.Placeholder(self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.Placeholder.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24144){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24148 = cljs.core.keyword_identical_QMARK_;
var expr__24149 = k__15849__auto__;
return (new datascript.parser.Placeholder(self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24144),null));
});

datascript.parser.Placeholder.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,cljs.core.PersistentVector.EMPTY,self__.__extmap));
});

datascript.parser.Placeholder.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24144){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.Placeholder(G__24144,self__.__extmap,self__.__hash));
});

datascript.parser.Placeholder.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.Placeholder.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Placeholder.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24141){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.Placeholder(null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.Placeholder.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24142,acc24143){
var self__ = this;
var ___19939__auto____$1 = this;
return acc24143;
});

datascript.parser.Placeholder.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24143){
var self__ = this;
var ___19939__auto____$1 = this;
return acc24143;
});

datascript.parser.Placeholder.getBasis = (function (){
return cljs.core.PersistentVector.EMPTY;
});

datascript.parser.Placeholder.cljs$lang$type = true;

datascript.parser.Placeholder.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/Placeholder");
});

datascript.parser.Placeholder.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/Placeholder");
});

datascript.parser.__GT_Placeholder = (function datascript$parser$__GT_Placeholder(){
return (new datascript.parser.Placeholder(null,null,null));
});

datascript.parser.map__GT_Placeholder = (function datascript$parser$map__GT_Placeholder(G__24146){
return (new datascript.parser.Placeholder(null,cljs.core.dissoc.call(null,G__24146),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.Variable = (function (symbol,__meta,__extmap,__hash){
this.symbol = symbol;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.Variable.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.Variable.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24156,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24158 = (((k24156 instanceof cljs.core.Keyword))?k24156.fqn:null);
switch (G__24158) {
case "symbol":
return self__.symbol;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24156,else__15844__auto__);

}
});

datascript.parser.Variable.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.Variable{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"symbol","symbol",-1038572696),self__.symbol],null))], null),self__.__extmap));
});

datascript.parser.Variable.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Variable.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24155){
var self__ = this;
var G__24155__$1 = this;
return (new cljs.core.RecordIter((0),G__24155__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"symbol","symbol",-1038572696)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.Variable.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.Variable.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.Variable(self__.symbol,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.Variable.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (1 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.Variable.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.Variable.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.Variable.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"symbol","symbol",-1038572696),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.Variable(self__.symbol,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.Variable.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24155){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24159 = cljs.core.keyword_identical_QMARK_;
var expr__24160 = k__15849__auto__;
if(cljs.core.truth_(pred__24159.call(null,new cljs.core.Keyword(null,"symbol","symbol",-1038572696),expr__24160))){
return (new datascript.parser.Variable(G__24155,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.Variable(self__.symbol,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24155),null));
}
});

datascript.parser.Variable.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"symbol","symbol",-1038572696),self__.symbol],null))], null),self__.__extmap));
});

datascript.parser.Variable.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24155){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.Variable(self__.symbol,G__24155,self__.__extmap,self__.__hash));
});

datascript.parser.Variable.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.Variable.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Variable.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24152){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.Variable(datascript.parser.postwalk.call(null,self__.symbol,f24152),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.Variable.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24153,acc24154){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24153,self__.symbol,acc24154);
});

datascript.parser.Variable.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24154){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,acc24154,self__.symbol);
});

datascript.parser.Variable.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"symbol","symbol",601958831,null)], null);
});

datascript.parser.Variable.cljs$lang$type = true;

datascript.parser.Variable.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/Variable");
});

datascript.parser.Variable.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/Variable");
});

datascript.parser.__GT_Variable = (function datascript$parser$__GT_Variable(symbol){
return (new datascript.parser.Variable(symbol,null,null,null));
});

datascript.parser.map__GT_Variable = (function datascript$parser$map__GT_Variable(G__24157){
return (new datascript.parser.Variable(new cljs.core.Keyword(null,"symbol","symbol",-1038572696).cljs$core$IFn$_invoke$arity$1(G__24157),null,cljs.core.dissoc.call(null,G__24157,new cljs.core.Keyword(null,"symbol","symbol",-1038572696)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.SrcVar = (function (symbol,__meta,__extmap,__hash){
this.symbol = symbol;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.SrcVar.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.SrcVar.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24167,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24169 = (((k24167 instanceof cljs.core.Keyword))?k24167.fqn:null);
switch (G__24169) {
case "symbol":
return self__.symbol;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24167,else__15844__auto__);

}
});

datascript.parser.SrcVar.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.SrcVar{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"symbol","symbol",-1038572696),self__.symbol],null))], null),self__.__extmap));
});

datascript.parser.SrcVar.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.SrcVar.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24166){
var self__ = this;
var G__24166__$1 = this;
return (new cljs.core.RecordIter((0),G__24166__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"symbol","symbol",-1038572696)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.SrcVar.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.SrcVar.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.SrcVar(self__.symbol,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.SrcVar.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (1 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.SrcVar.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.SrcVar.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.SrcVar.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"symbol","symbol",-1038572696),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.SrcVar(self__.symbol,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.SrcVar.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24166){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24170 = cljs.core.keyword_identical_QMARK_;
var expr__24171 = k__15849__auto__;
if(cljs.core.truth_(pred__24170.call(null,new cljs.core.Keyword(null,"symbol","symbol",-1038572696),expr__24171))){
return (new datascript.parser.SrcVar(G__24166,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.SrcVar(self__.symbol,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24166),null));
}
});

datascript.parser.SrcVar.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"symbol","symbol",-1038572696),self__.symbol],null))], null),self__.__extmap));
});

datascript.parser.SrcVar.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24166){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.SrcVar(self__.symbol,G__24166,self__.__extmap,self__.__hash));
});

datascript.parser.SrcVar.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.SrcVar.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.SrcVar.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24163){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.SrcVar(datascript.parser.postwalk.call(null,self__.symbol,f24163),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.SrcVar.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24164,acc24165){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24164,self__.symbol,acc24165);
});

datascript.parser.SrcVar.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24165){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,acc24165,self__.symbol);
});

datascript.parser.SrcVar.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"symbol","symbol",601958831,null)], null);
});

datascript.parser.SrcVar.cljs$lang$type = true;

datascript.parser.SrcVar.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/SrcVar");
});

datascript.parser.SrcVar.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/SrcVar");
});

datascript.parser.__GT_SrcVar = (function datascript$parser$__GT_SrcVar(symbol){
return (new datascript.parser.SrcVar(symbol,null,null,null));
});

datascript.parser.map__GT_SrcVar = (function datascript$parser$map__GT_SrcVar(G__24168){
return (new datascript.parser.SrcVar(new cljs.core.Keyword(null,"symbol","symbol",-1038572696).cljs$core$IFn$_invoke$arity$1(G__24168),null,cljs.core.dissoc.call(null,G__24168,new cljs.core.Keyword(null,"symbol","symbol",-1038572696)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.DefaultSrc = (function (__meta,__extmap,__hash){
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.DefaultSrc.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.DefaultSrc.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24178,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24180 = k24178;
switch (G__24180) {
default:
return cljs.core.get.call(null,self__.__extmap,k24178,else__15844__auto__);

}
});

datascript.parser.DefaultSrc.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.DefaultSrc{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,cljs.core.PersistentVector.EMPTY,self__.__extmap));
});

datascript.parser.DefaultSrc.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.DefaultSrc.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24177){
var self__ = this;
var G__24177__$1 = this;
return (new cljs.core.RecordIter((0),G__24177__$1,0,cljs.core.PersistentVector.EMPTY,(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.DefaultSrc.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.DefaultSrc.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.DefaultSrc(self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.DefaultSrc.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (0 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.DefaultSrc.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.DefaultSrc.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.DefaultSrc.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,cljs.core.PersistentHashSet.EMPTY,k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.DefaultSrc(self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.DefaultSrc.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24177){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24181 = cljs.core.keyword_identical_QMARK_;
var expr__24182 = k__15849__auto__;
return (new datascript.parser.DefaultSrc(self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24177),null));
});

datascript.parser.DefaultSrc.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,cljs.core.PersistentVector.EMPTY,self__.__extmap));
});

datascript.parser.DefaultSrc.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24177){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.DefaultSrc(G__24177,self__.__extmap,self__.__hash));
});

datascript.parser.DefaultSrc.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.DefaultSrc.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.DefaultSrc.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24174){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.DefaultSrc(null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.DefaultSrc.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24175,acc24176){
var self__ = this;
var ___19939__auto____$1 = this;
return acc24176;
});

datascript.parser.DefaultSrc.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24176){
var self__ = this;
var ___19939__auto____$1 = this;
return acc24176;
});

datascript.parser.DefaultSrc.getBasis = (function (){
return cljs.core.PersistentVector.EMPTY;
});

datascript.parser.DefaultSrc.cljs$lang$type = true;

datascript.parser.DefaultSrc.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/DefaultSrc");
});

datascript.parser.DefaultSrc.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/DefaultSrc");
});

datascript.parser.__GT_DefaultSrc = (function datascript$parser$__GT_DefaultSrc(){
return (new datascript.parser.DefaultSrc(null,null,null));
});

datascript.parser.map__GT_DefaultSrc = (function datascript$parser$map__GT_DefaultSrc(G__24179){
return (new datascript.parser.DefaultSrc(null,cljs.core.dissoc.call(null,G__24179),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.RulesVar = (function (__meta,__extmap,__hash){
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.RulesVar.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.RulesVar.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24189,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24191 = k24189;
switch (G__24191) {
default:
return cljs.core.get.call(null,self__.__extmap,k24189,else__15844__auto__);

}
});

datascript.parser.RulesVar.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.RulesVar{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,cljs.core.PersistentVector.EMPTY,self__.__extmap));
});

datascript.parser.RulesVar.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.RulesVar.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24188){
var self__ = this;
var G__24188__$1 = this;
return (new cljs.core.RecordIter((0),G__24188__$1,0,cljs.core.PersistentVector.EMPTY,(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.RulesVar.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.RulesVar.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.RulesVar(self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.RulesVar.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (0 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.RulesVar.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.RulesVar.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.RulesVar.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,cljs.core.PersistentHashSet.EMPTY,k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.RulesVar(self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.RulesVar.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24188){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24192 = cljs.core.keyword_identical_QMARK_;
var expr__24193 = k__15849__auto__;
return (new datascript.parser.RulesVar(self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24188),null));
});

datascript.parser.RulesVar.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,cljs.core.PersistentVector.EMPTY,self__.__extmap));
});

datascript.parser.RulesVar.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24188){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.RulesVar(G__24188,self__.__extmap,self__.__hash));
});

datascript.parser.RulesVar.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.RulesVar.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.RulesVar.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24185){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.RulesVar(null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.RulesVar.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24186,acc24187){
var self__ = this;
var ___19939__auto____$1 = this;
return acc24187;
});

datascript.parser.RulesVar.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24187){
var self__ = this;
var ___19939__auto____$1 = this;
return acc24187;
});

datascript.parser.RulesVar.getBasis = (function (){
return cljs.core.PersistentVector.EMPTY;
});

datascript.parser.RulesVar.cljs$lang$type = true;

datascript.parser.RulesVar.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/RulesVar");
});

datascript.parser.RulesVar.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/RulesVar");
});

datascript.parser.__GT_RulesVar = (function datascript$parser$__GT_RulesVar(){
return (new datascript.parser.RulesVar(null,null,null));
});

datascript.parser.map__GT_RulesVar = (function datascript$parser$map__GT_RulesVar(G__24190){
return (new datascript.parser.RulesVar(null,cljs.core.dissoc.call(null,G__24190),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.Constant = (function (value,__meta,__extmap,__hash){
this.value = value;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.Constant.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.Constant.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24200,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24202 = (((k24200 instanceof cljs.core.Keyword))?k24200.fqn:null);
switch (G__24202) {
case "value":
return self__.value;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24200,else__15844__auto__);

}
});

datascript.parser.Constant.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.Constant{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"value","value",305978217),self__.value],null))], null),self__.__extmap));
});

datascript.parser.Constant.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Constant.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24199){
var self__ = this;
var G__24199__$1 = this;
return (new cljs.core.RecordIter((0),G__24199__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"value","value",305978217)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.Constant.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.Constant.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.Constant(self__.value,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.Constant.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (1 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.Constant.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.Constant.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.Constant.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"value","value",305978217),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.Constant(self__.value,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.Constant.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24199){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24203 = cljs.core.keyword_identical_QMARK_;
var expr__24204 = k__15849__auto__;
if(cljs.core.truth_(pred__24203.call(null,new cljs.core.Keyword(null,"value","value",305978217),expr__24204))){
return (new datascript.parser.Constant(G__24199,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.Constant(self__.value,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24199),null));
}
});

datascript.parser.Constant.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"value","value",305978217),self__.value],null))], null),self__.__extmap));
});

datascript.parser.Constant.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24199){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.Constant(self__.value,G__24199,self__.__extmap,self__.__hash));
});

datascript.parser.Constant.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.Constant.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Constant.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24196){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.Constant(datascript.parser.postwalk.call(null,self__.value,f24196),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.Constant.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24197,acc24198){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24197,self__.value,acc24198);
});

datascript.parser.Constant.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24198){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,acc24198,self__.value);
});

datascript.parser.Constant.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"value","value",1946509744,null)], null);
});

datascript.parser.Constant.cljs$lang$type = true;

datascript.parser.Constant.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/Constant");
});

datascript.parser.Constant.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/Constant");
});

datascript.parser.__GT_Constant = (function datascript$parser$__GT_Constant(value){
return (new datascript.parser.Constant(value,null,null,null));
});

datascript.parser.map__GT_Constant = (function datascript$parser$map__GT_Constant(G__24201){
return (new datascript.parser.Constant(new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(G__24201),null,cljs.core.dissoc.call(null,G__24201,new cljs.core.Keyword(null,"value","value",305978217)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.PlainSymbol = (function (symbol,__meta,__extmap,__hash){
this.symbol = symbol;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.PlainSymbol.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.PlainSymbol.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24211,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24213 = (((k24211 instanceof cljs.core.Keyword))?k24211.fqn:null);
switch (G__24213) {
case "symbol":
return self__.symbol;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24211,else__15844__auto__);

}
});

datascript.parser.PlainSymbol.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.PlainSymbol{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"symbol","symbol",-1038572696),self__.symbol],null))], null),self__.__extmap));
});

datascript.parser.PlainSymbol.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.PlainSymbol.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24210){
var self__ = this;
var G__24210__$1 = this;
return (new cljs.core.RecordIter((0),G__24210__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"symbol","symbol",-1038572696)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.PlainSymbol.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.PlainSymbol.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.PlainSymbol(self__.symbol,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.PlainSymbol.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (1 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.PlainSymbol.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.PlainSymbol.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.PlainSymbol.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"symbol","symbol",-1038572696),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.PlainSymbol(self__.symbol,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.PlainSymbol.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24210){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24214 = cljs.core.keyword_identical_QMARK_;
var expr__24215 = k__15849__auto__;
if(cljs.core.truth_(pred__24214.call(null,new cljs.core.Keyword(null,"symbol","symbol",-1038572696),expr__24215))){
return (new datascript.parser.PlainSymbol(G__24210,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.PlainSymbol(self__.symbol,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24210),null));
}
});

datascript.parser.PlainSymbol.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"symbol","symbol",-1038572696),self__.symbol],null))], null),self__.__extmap));
});

datascript.parser.PlainSymbol.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24210){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.PlainSymbol(self__.symbol,G__24210,self__.__extmap,self__.__hash));
});

datascript.parser.PlainSymbol.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.PlainSymbol.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.PlainSymbol.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24207){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.PlainSymbol(datascript.parser.postwalk.call(null,self__.symbol,f24207),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.PlainSymbol.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24208,acc24209){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24208,self__.symbol,acc24209);
});

datascript.parser.PlainSymbol.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24209){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,acc24209,self__.symbol);
});

datascript.parser.PlainSymbol.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"symbol","symbol",601958831,null)], null);
});

datascript.parser.PlainSymbol.cljs$lang$type = true;

datascript.parser.PlainSymbol.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/PlainSymbol");
});

datascript.parser.PlainSymbol.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/PlainSymbol");
});

datascript.parser.__GT_PlainSymbol = (function datascript$parser$__GT_PlainSymbol(symbol){
return (new datascript.parser.PlainSymbol(symbol,null,null,null));
});

datascript.parser.map__GT_PlainSymbol = (function datascript$parser$map__GT_PlainSymbol(G__24212){
return (new datascript.parser.PlainSymbol(new cljs.core.Keyword(null,"symbol","symbol",-1038572696).cljs$core$IFn$_invoke$arity$1(G__24212),null,cljs.core.dissoc.call(null,G__24212,new cljs.core.Keyword(null,"symbol","symbol",-1038572696)),null));
});

datascript.parser.parse_placeholder = (function datascript$parser$parse_placeholder(form){
if(cljs.core._EQ_.call(null,new cljs.core.Symbol(null,"_","_",-1201019570,null),form)){
return (new datascript.parser.Placeholder(null,null,null));
} else {
return null;
}
});
datascript.parser.parse_variable = (function datascript$parser$parse_variable(form){
if(((form instanceof cljs.core.Symbol)) && (cljs.core._EQ_.call(null,cljs.core.first.call(null,cljs.core.name.call(null,form)),"?"))){
return (new datascript.parser.Variable(form,null,null,null));
} else {
return null;
}
});
datascript.parser.parse_src_var = (function datascript$parser$parse_src_var(form){
if(((form instanceof cljs.core.Symbol)) && (cljs.core._EQ_.call(null,cljs.core.first.call(null,cljs.core.name.call(null,form)),"$"))){
return (new datascript.parser.SrcVar(form,null,null,null));
} else {
return null;
}
});
datascript.parser.parse_rules_var = (function datascript$parser$parse_rules_var(form){
if(cljs.core._EQ_.call(null,new cljs.core.Symbol(null,"%","%",-950237169,null),form)){
return (new datascript.parser.RulesVar(null,null,null));
} else {
return null;
}
});
datascript.parser.parse_constant = (function datascript$parser$parse_constant(form){
if(!((form instanceof cljs.core.Symbol))){
return (new datascript.parser.Constant(form,null,null,null));
} else {
return null;
}
});
datascript.parser.parse_plain_symbol = (function datascript$parser$parse_plain_symbol(form){
if(((form instanceof cljs.core.Symbol)) && (cljs.core.not.call(null,datascript.parser.parse_variable.call(null,form))) && (cljs.core.not.call(null,datascript.parser.parse_src_var.call(null,form))) && (cljs.core.not.call(null,datascript.parser.parse_rules_var.call(null,form))) && (cljs.core.not.call(null,datascript.parser.parse_placeholder.call(null,form)))){
return (new datascript.parser.PlainSymbol(form,null,null,null));
} else {
return null;
}
});
datascript.parser.parse_plain_variable = (function datascript$parser$parse_plain_variable(form){
if(cljs.core.truth_(datascript.parser.parse_plain_symbol.call(null,form))){
return (new datascript.parser.Variable(form,null,null,null));
} else {
return null;
}
});
datascript.parser.parse_fn_arg = (function datascript$parser$parse_fn_arg(form){
var or__15219__auto__ = datascript.parser.parse_variable.call(null,form);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
var or__15219__auto____$1 = datascript.parser.parse_constant.call(null,form);
if(cljs.core.truth_(or__15219__auto____$1)){
return or__15219__auto____$1;
} else {
return datascript.parser.parse_src_var.call(null,form);
}
}
});

/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.RuleVars = (function (required,free,__meta,__extmap,__hash){
this.required = required;
this.free = free;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.RuleVars.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.RuleVars.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24222,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24224 = (((k24222 instanceof cljs.core.Keyword))?k24222.fqn:null);
switch (G__24224) {
case "required":
return self__.required;

break;
case "free":
return self__.free;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24222,else__15844__auto__);

}
});

datascript.parser.RuleVars.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.RuleVars{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"required","required",1807647006),self__.required],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"free","free",801364328),self__.free],null))], null),self__.__extmap));
});

datascript.parser.RuleVars.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.RuleVars.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24221){
var self__ = this;
var G__24221__$1 = this;
return (new cljs.core.RecordIter((0),G__24221__$1,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"required","required",1807647006),new cljs.core.Keyword(null,"free","free",801364328)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.RuleVars.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.RuleVars.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.RuleVars(self__.required,self__.free,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.RuleVars.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (2 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.RuleVars.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.RuleVars.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.RuleVars.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"free","free",801364328),null,new cljs.core.Keyword(null,"required","required",1807647006),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.RuleVars(self__.required,self__.free,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.RuleVars.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24221){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24225 = cljs.core.keyword_identical_QMARK_;
var expr__24226 = k__15849__auto__;
if(cljs.core.truth_(pred__24225.call(null,new cljs.core.Keyword(null,"required","required",1807647006),expr__24226))){
return (new datascript.parser.RuleVars(G__24221,self__.free,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24225.call(null,new cljs.core.Keyword(null,"free","free",801364328),expr__24226))){
return (new datascript.parser.RuleVars(self__.required,G__24221,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.RuleVars(self__.required,self__.free,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24221),null));
}
}
});

datascript.parser.RuleVars.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"required","required",1807647006),self__.required],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"free","free",801364328),self__.free],null))], null),self__.__extmap));
});

datascript.parser.RuleVars.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24221){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.RuleVars(self__.required,self__.free,G__24221,self__.__extmap,self__.__hash));
});

datascript.parser.RuleVars.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.RuleVars.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.RuleVars.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24218){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.RuleVars(datascript.parser.postwalk.call(null,self__.required,f24218),datascript.parser.postwalk.call(null,self__.free,f24218),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.RuleVars.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24219,acc24220){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24219,self__.free,datascript.parser.collect.call(null,pred24219,self__.required,acc24220));
});

datascript.parser.RuleVars.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24220){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,acc24220,self__.required),self__.free);
});

datascript.parser.RuleVars.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"required","required",-846788763,null),new cljs.core.Symbol(null,"free","free",-1853071441,null)], null);
});

datascript.parser.RuleVars.cljs$lang$type = true;

datascript.parser.RuleVars.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/RuleVars");
});

datascript.parser.RuleVars.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/RuleVars");
});

datascript.parser.__GT_RuleVars = (function datascript$parser$__GT_RuleVars(required,free){
return (new datascript.parser.RuleVars(required,free,null,null,null));
});

datascript.parser.map__GT_RuleVars = (function datascript$parser$map__GT_RuleVars(G__24223){
return (new datascript.parser.RuleVars(new cljs.core.Keyword(null,"required","required",1807647006).cljs$core$IFn$_invoke$arity$1(G__24223),new cljs.core.Keyword(null,"free","free",801364328).cljs$core$IFn$_invoke$arity$1(G__24223),null,cljs.core.dissoc.call(null,G__24223,new cljs.core.Keyword(null,"required","required",1807647006),new cljs.core.Keyword(null,"free","free",801364328)),null));
});

datascript.parser.parse_rule_vars = (function datascript$parser$parse_rule_vars(form){
if(cljs.core.sequential_QMARK_.call(null,form)){
var vec__24232 = ((cljs.core.sequential_QMARK_.call(null,cljs.core.first.call(null,form)))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.first.call(null,form),cljs.core.next.call(null,form)], null):new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,form], null));
var required = cljs.core.nth.call(null,vec__24232,(0),null);
var rest = cljs.core.nth.call(null,vec__24232,(1),null);
var required_STAR_ = datascript.parser.parse_seq.call(null,datascript.parser.parse_variable,required);
var free_STAR_ = datascript.parser.parse_seq.call(null,datascript.parser.parse_variable,rest);
if((cljs.core.empty_QMARK_.call(null,required_STAR_)) && (cljs.core.empty_QMARK_.call(null,free_STAR_))){
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse rule-vars, expected [ variable+ | ([ variable+ ] variable*) ]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","rule-vars","parser/rule-vars",-1493174969),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
} else {
}

if(cljs.core.truth_(datascript.parser.distinct_QMARK_.call(null,cljs.core.concat.call(null,required_STAR_,free_STAR_)))){
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Rule variables should be distinct")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","rule-vars","parser/rule-vars",-1493174969),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}

return (new datascript.parser.RuleVars(required_STAR_,free_STAR_,null,null,null));
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse rule-vars, expected [ variable+ | ([ variable+ ] variable*) ]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","rule-vars","parser/rule-vars",-1493174969),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
});
datascript.parser.flatten_rule_vars = (function datascript$parser$flatten_rule_vars(rule_vars){
return cljs.core.concat.call(null,(cljs.core.truth_(new cljs.core.Keyword(null,"required","required",1807647006).cljs$core$IFn$_invoke$arity$1(rule_vars))?(function (){
new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.mapv.call(null,new cljs.core.Keyword(null,"symbol","symbol",-1038572696),new cljs.core.Keyword(null,"required","required",1807647006).cljs$core$IFn$_invoke$arity$1(rule_vars))], null);

return cljs.core.mapv.call(null,new cljs.core.Keyword(null,"symbol","symbol",-1038572696),new cljs.core.Keyword(null,"free","free",801364328).cljs$core$IFn$_invoke$arity$1(rule_vars));
})()
:null));
});
datascript.parser.rule_vars_arity = (function datascript$parser$rule_vars_arity(rule_vars){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.count.call(null,new cljs.core.Keyword(null,"required","required",1807647006).cljs$core$IFn$_invoke$arity$1(rule_vars)),cljs.core.count.call(null,new cljs.core.Keyword(null,"free","free",801364328).cljs$core$IFn$_invoke$arity$1(rule_vars))], null);
});

/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.BindIgnore = (function (__meta,__extmap,__hash){
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.BindIgnore.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.BindIgnore.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24239,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24241 = k24239;
switch (G__24241) {
default:
return cljs.core.get.call(null,self__.__extmap,k24239,else__15844__auto__);

}
});

datascript.parser.BindIgnore.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.BindIgnore{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,cljs.core.PersistentVector.EMPTY,self__.__extmap));
});

datascript.parser.BindIgnore.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.BindIgnore.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24238){
var self__ = this;
var G__24238__$1 = this;
return (new cljs.core.RecordIter((0),G__24238__$1,0,cljs.core.PersistentVector.EMPTY,(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.BindIgnore.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.BindIgnore.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.BindIgnore(self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.BindIgnore.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (0 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.BindIgnore.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.BindIgnore.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.BindIgnore.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,cljs.core.PersistentHashSet.EMPTY,k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.BindIgnore(self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.BindIgnore.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24238){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24242 = cljs.core.keyword_identical_QMARK_;
var expr__24243 = k__15849__auto__;
return (new datascript.parser.BindIgnore(self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24238),null));
});

datascript.parser.BindIgnore.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,cljs.core.PersistentVector.EMPTY,self__.__extmap));
});

datascript.parser.BindIgnore.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24238){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.BindIgnore(G__24238,self__.__extmap,self__.__hash));
});

datascript.parser.BindIgnore.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.BindIgnore.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.BindIgnore.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24235){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.BindIgnore(null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.BindIgnore.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24236,acc24237){
var self__ = this;
var ___19939__auto____$1 = this;
return acc24237;
});

datascript.parser.BindIgnore.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24237){
var self__ = this;
var ___19939__auto____$1 = this;
return acc24237;
});

datascript.parser.BindIgnore.getBasis = (function (){
return cljs.core.PersistentVector.EMPTY;
});

datascript.parser.BindIgnore.cljs$lang$type = true;

datascript.parser.BindIgnore.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/BindIgnore");
});

datascript.parser.BindIgnore.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/BindIgnore");
});

datascript.parser.__GT_BindIgnore = (function datascript$parser$__GT_BindIgnore(){
return (new datascript.parser.BindIgnore(null,null,null));
});

datascript.parser.map__GT_BindIgnore = (function datascript$parser$map__GT_BindIgnore(G__24240){
return (new datascript.parser.BindIgnore(null,cljs.core.dissoc.call(null,G__24240),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.BindScalar = (function (variable,__meta,__extmap,__hash){
this.variable = variable;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.BindScalar.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.BindScalar.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24250,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24252 = (((k24250 instanceof cljs.core.Keyword))?k24250.fqn:null);
switch (G__24252) {
case "variable":
return self__.variable;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24250,else__15844__auto__);

}
});

datascript.parser.BindScalar.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.BindScalar{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"variable","variable",-281346492),self__.variable],null))], null),self__.__extmap));
});

datascript.parser.BindScalar.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.BindScalar.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24249){
var self__ = this;
var G__24249__$1 = this;
return (new cljs.core.RecordIter((0),G__24249__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"variable","variable",-281346492)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.BindScalar.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.BindScalar.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.BindScalar(self__.variable,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.BindScalar.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (1 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.BindScalar.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.BindScalar.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.BindScalar.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"variable","variable",-281346492),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.BindScalar(self__.variable,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.BindScalar.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24249){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24253 = cljs.core.keyword_identical_QMARK_;
var expr__24254 = k__15849__auto__;
if(cljs.core.truth_(pred__24253.call(null,new cljs.core.Keyword(null,"variable","variable",-281346492),expr__24254))){
return (new datascript.parser.BindScalar(G__24249,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.BindScalar(self__.variable,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24249),null));
}
});

datascript.parser.BindScalar.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"variable","variable",-281346492),self__.variable],null))], null),self__.__extmap));
});

datascript.parser.BindScalar.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24249){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.BindScalar(self__.variable,G__24249,self__.__extmap,self__.__hash));
});

datascript.parser.BindScalar.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.BindScalar.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.BindScalar.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24246){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.BindScalar(datascript.parser.postwalk.call(null,self__.variable,f24246),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.BindScalar.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24247,acc24248){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24247,self__.variable,acc24248);
});

datascript.parser.BindScalar.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24248){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,acc24248,self__.variable);
});

datascript.parser.BindScalar.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"variable","variable",1359185035,null)], null);
});

datascript.parser.BindScalar.cljs$lang$type = true;

datascript.parser.BindScalar.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/BindScalar");
});

datascript.parser.BindScalar.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/BindScalar");
});

datascript.parser.__GT_BindScalar = (function datascript$parser$__GT_BindScalar(variable){
return (new datascript.parser.BindScalar(variable,null,null,null));
});

datascript.parser.map__GT_BindScalar = (function datascript$parser$map__GT_BindScalar(G__24251){
return (new datascript.parser.BindScalar(new cljs.core.Keyword(null,"variable","variable",-281346492).cljs$core$IFn$_invoke$arity$1(G__24251),null,cljs.core.dissoc.call(null,G__24251,new cljs.core.Keyword(null,"variable","variable",-281346492)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.BindTuple = (function (bindings,__meta,__extmap,__hash){
this.bindings = bindings;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.BindTuple.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.BindTuple.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24261,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24263 = (((k24261 instanceof cljs.core.Keyword))?k24261.fqn:null);
switch (G__24263) {
case "bindings":
return self__.bindings;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24261,else__15844__auto__);

}
});

datascript.parser.BindTuple.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.BindTuple{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"bindings","bindings",1271397192),self__.bindings],null))], null),self__.__extmap));
});

datascript.parser.BindTuple.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.BindTuple.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24260){
var self__ = this;
var G__24260__$1 = this;
return (new cljs.core.RecordIter((0),G__24260__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"bindings","bindings",1271397192)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.BindTuple.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.BindTuple.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.BindTuple(self__.bindings,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.BindTuple.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (1 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.BindTuple.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.BindTuple.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.BindTuple.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"bindings","bindings",1271397192),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.BindTuple(self__.bindings,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.BindTuple.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24260){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24264 = cljs.core.keyword_identical_QMARK_;
var expr__24265 = k__15849__auto__;
if(cljs.core.truth_(pred__24264.call(null,new cljs.core.Keyword(null,"bindings","bindings",1271397192),expr__24265))){
return (new datascript.parser.BindTuple(G__24260,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.BindTuple(self__.bindings,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24260),null));
}
});

datascript.parser.BindTuple.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"bindings","bindings",1271397192),self__.bindings],null))], null),self__.__extmap));
});

datascript.parser.BindTuple.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24260){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.BindTuple(self__.bindings,G__24260,self__.__extmap,self__.__hash));
});

datascript.parser.BindTuple.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.BindTuple.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.BindTuple.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24257){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.BindTuple(datascript.parser.postwalk.call(null,self__.bindings,f24257),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.BindTuple.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24258,acc24259){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24258,self__.bindings,acc24259);
});

datascript.parser.BindTuple.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24259){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,acc24259,self__.bindings);
});

datascript.parser.BindTuple.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"bindings","bindings",-1383038577,null)], null);
});

datascript.parser.BindTuple.cljs$lang$type = true;

datascript.parser.BindTuple.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/BindTuple");
});

datascript.parser.BindTuple.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/BindTuple");
});

datascript.parser.__GT_BindTuple = (function datascript$parser$__GT_BindTuple(bindings){
return (new datascript.parser.BindTuple(bindings,null,null,null));
});

datascript.parser.map__GT_BindTuple = (function datascript$parser$map__GT_BindTuple(G__24262){
return (new datascript.parser.BindTuple(new cljs.core.Keyword(null,"bindings","bindings",1271397192).cljs$core$IFn$_invoke$arity$1(G__24262),null,cljs.core.dissoc.call(null,G__24262,new cljs.core.Keyword(null,"bindings","bindings",1271397192)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.BindColl = (function (binding,__meta,__extmap,__hash){
this.binding = binding;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.BindColl.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.BindColl.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24272,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24274 = (((k24272 instanceof cljs.core.Keyword))?k24272.fqn:null);
switch (G__24274) {
case "binding":
return self__.binding;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24272,else__15844__auto__);

}
});

datascript.parser.BindColl.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.BindColl{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"binding","binding",539932593),self__.binding],null))], null),self__.__extmap));
});

datascript.parser.BindColl.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.BindColl.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24271){
var self__ = this;
var G__24271__$1 = this;
return (new cljs.core.RecordIter((0),G__24271__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"binding","binding",539932593)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.BindColl.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.BindColl.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.BindColl(self__.binding,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.BindColl.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (1 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.BindColl.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.BindColl.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.BindColl.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"binding","binding",539932593),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.BindColl(self__.binding,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.BindColl.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24271){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24275 = cljs.core.keyword_identical_QMARK_;
var expr__24276 = k__15849__auto__;
if(cljs.core.truth_(pred__24275.call(null,new cljs.core.Keyword(null,"binding","binding",539932593),expr__24276))){
return (new datascript.parser.BindColl(G__24271,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.BindColl(self__.binding,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24271),null));
}
});

datascript.parser.BindColl.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"binding","binding",539932593),self__.binding],null))], null),self__.__extmap));
});

datascript.parser.BindColl.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24271){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.BindColl(self__.binding,G__24271,self__.__extmap,self__.__hash));
});

datascript.parser.BindColl.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.BindColl.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.BindColl.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24268){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.BindColl(datascript.parser.postwalk.call(null,self__.binding,f24268),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.BindColl.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24269,acc24270){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24269,self__.binding,acc24270);
});

datascript.parser.BindColl.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24270){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,acc24270,self__.binding);
});

datascript.parser.BindColl.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"binding","binding",-2114503176,null)], null);
});

datascript.parser.BindColl.cljs$lang$type = true;

datascript.parser.BindColl.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/BindColl");
});

datascript.parser.BindColl.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/BindColl");
});

datascript.parser.__GT_BindColl = (function datascript$parser$__GT_BindColl(binding){
return (new datascript.parser.BindColl(binding,null,null,null));
});

datascript.parser.map__GT_BindColl = (function datascript$parser$map__GT_BindColl(G__24273){
return (new datascript.parser.BindColl(new cljs.core.Keyword(null,"binding","binding",539932593).cljs$core$IFn$_invoke$arity$1(G__24273),null,cljs.core.dissoc.call(null,G__24273,new cljs.core.Keyword(null,"binding","binding",539932593)),null));
});

datascript.parser.parse_bind_ignore = (function datascript$parser$parse_bind_ignore(form){
if(cljs.core._EQ_.call(null,new cljs.core.Symbol(null,"_","_",-1201019570,null),form)){
return datascript.parser.with_source.call(null,(new datascript.parser.BindIgnore(null,null,null)),form);
} else {
return null;
}
});
datascript.parser.parse_bind_scalar = (function datascript$parser$parse_bind_scalar(form){
var temp__4657__auto__ = datascript.parser.parse_variable.call(null,form);
if(cljs.core.truth_(temp__4657__auto__)){
var var$ = temp__4657__auto__;
return datascript.parser.with_source.call(null,(new datascript.parser.BindScalar(var$,null,null,null)),form);
} else {
return null;
}
});
datascript.parser.parse_bind_coll = (function datascript$parser$parse_bind_coll(form){
if(cljs.core.truth_((function (){var and__15207__auto__ = datascript.parser.of_size_QMARK_.call(null,form,(2));
if(cljs.core.truth_(and__15207__auto__)){
return cljs.core._EQ_.call(null,cljs.core.second.call(null,form),new cljs.core.Symbol(null,"...","...",-1926939749,null));
} else {
return and__15207__auto__;
}
})())){
var temp__4655__auto__ = datascript.parser.parse_binding.call(null,cljs.core.first.call(null,form));
if(cljs.core.truth_(temp__4655__auto__)){
var sub_bind = temp__4655__auto__;
return datascript.parser.with_source.call(null,(new datascript.parser.BindColl(sub_bind,null,null,null)),form);
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse collection binding")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","binding","parser/binding",-346395752),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
} else {
return null;
}
});
datascript.parser.parse_tuple_el = (function datascript$parser$parse_tuple_el(form){
var or__15219__auto__ = datascript.parser.parse_bind_ignore.call(null,form);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
return datascript.parser.parse_binding.call(null,form);
}
});
datascript.parser.parse_bind_tuple = (function datascript$parser$parse_bind_tuple(form){
var temp__4657__auto__ = datascript.parser.parse_seq.call(null,datascript.parser.parse_tuple_el,form);
if(cljs.core.truth_(temp__4657__auto__)){
var sub_bindings = temp__4657__auto__;
if(!(cljs.core.empty_QMARK_.call(null,sub_bindings))){
return datascript.parser.with_source.call(null,(new datascript.parser.BindTuple(sub_bindings,null,null,null)),form);
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Tuple binding cannot be empty")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","binding","parser/binding",-346395752),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
} else {
return null;
}
});
datascript.parser.parse_bind_rel = (function datascript$parser$parse_bind_rel(form){
if(cljs.core.truth_((function (){var and__15207__auto__ = datascript.parser.of_size_QMARK_.call(null,form,(1));
if(cljs.core.truth_(and__15207__auto__)){
return cljs.core.sequential_QMARK_.call(null,cljs.core.first.call(null,form));
} else {
return and__15207__auto__;
}
})())){
return datascript.parser.with_source.call(null,(new datascript.parser.BindColl(datascript.parser.parse_bind_tuple.call(null,cljs.core.first.call(null,form)),null,null,null)),form);
} else {
return null;
}
});
datascript.parser.parse_binding = (function datascript$parser$parse_binding(form){
var or__15219__auto__ = datascript.parser.parse_bind_coll.call(null,form);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
var or__15219__auto____$1 = datascript.parser.parse_bind_rel.call(null,form);
if(cljs.core.truth_(or__15219__auto____$1)){
return or__15219__auto____$1;
} else {
var or__15219__auto____$2 = datascript.parser.parse_bind_tuple.call(null,form);
if(cljs.core.truth_(or__15219__auto____$2)){
return or__15219__auto____$2;
} else {
var or__15219__auto____$3 = datascript.parser.parse_bind_ignore.call(null,form);
if(cljs.core.truth_(or__15219__auto____$3)){
return or__15219__auto____$3;
} else {
var or__15219__auto____$4 = datascript.parser.parse_bind_scalar.call(null,form);
if(cljs.core.truth_(or__15219__auto____$4)){
return or__15219__auto____$4;
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse binding, expected (bind-scalar | bind-tuple | bind-coll | bind-rel)")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","binding","parser/binding",-346395752),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
}
}
}
}
});

/**
 * @interface
 */
datascript.parser.IFindVars = function(){};

datascript.parser._find_vars = (function datascript$parser$_find_vars(this$){
if((!((this$ == null))) && (!((this$.datascript$parser$IFindVars$_find_vars$arity$1 == null)))){
return this$.datascript$parser$IFindVars$_find_vars$arity$1(this$);
} else {
var x__15882__auto__ = (((this$ == null))?null:this$);
var m__15883__auto__ = (datascript.parser._find_vars[goog.typeOf(x__15882__auto__)]);
if(!((m__15883__auto__ == null))){
return m__15883__auto__.call(null,this$);
} else {
var m__15883__auto____$1 = (datascript.parser._find_vars["_"]);
if(!((m__15883__auto____$1 == null))){
return m__15883__auto____$1.call(null,this$);
} else {
throw cljs.core.missing_protocol.call(null,"IFindVars.-find-vars",this$);
}
}
}
});

datascript.parser.Variable.prototype.datascript$parser$IFindVars$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Variable.prototype.datascript$parser$IFindVars$_find_vars$arity$1 = (function (this$){
var this$__$1 = this;
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this$__$1.symbol], null);
});

/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {datascript.parser.IFindVars}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.Aggregate = (function (fn,args,__meta,__extmap,__hash){
this.fn = fn;
this.args = args;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.Aggregate.prototype.datascript$parser$IFindVars$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Aggregate.prototype.datascript$parser$IFindVars$_find_vars$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return datascript.parser._find_vars.call(null,cljs.core.last.call(null,self__.args));
});

datascript.parser.Aggregate.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.Aggregate.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24283,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24285 = (((k24283 instanceof cljs.core.Keyword))?k24283.fqn:null);
switch (G__24285) {
case "fn":
return self__.fn;

break;
case "args":
return self__.args;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24283,else__15844__auto__);

}
});

datascript.parser.Aggregate.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.Aggregate{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"fn","fn",-1175266204),self__.fn],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"args","args",1315556576),self__.args],null))], null),self__.__extmap));
});

datascript.parser.Aggregate.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Aggregate.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24282){
var self__ = this;
var G__24282__$1 = this;
return (new cljs.core.RecordIter((0),G__24282__$1,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"fn","fn",-1175266204),new cljs.core.Keyword(null,"args","args",1315556576)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.Aggregate.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.Aggregate.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.Aggregate(self__.fn,self__.args,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.Aggregate.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (2 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.Aggregate.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.Aggregate.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.Aggregate.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"args","args",1315556576),null,new cljs.core.Keyword(null,"fn","fn",-1175266204),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.Aggregate(self__.fn,self__.args,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.Aggregate.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24282){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24286 = cljs.core.keyword_identical_QMARK_;
var expr__24287 = k__15849__auto__;
if(cljs.core.truth_(pred__24286.call(null,new cljs.core.Keyword(null,"fn","fn",-1175266204),expr__24287))){
return (new datascript.parser.Aggregate(G__24282,self__.args,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24286.call(null,new cljs.core.Keyword(null,"args","args",1315556576),expr__24287))){
return (new datascript.parser.Aggregate(self__.fn,G__24282,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.Aggregate(self__.fn,self__.args,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24282),null));
}
}
});

datascript.parser.Aggregate.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"fn","fn",-1175266204),self__.fn],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"args","args",1315556576),self__.args],null))], null),self__.__extmap));
});

datascript.parser.Aggregate.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24282){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.Aggregate(self__.fn,self__.args,G__24282,self__.__extmap,self__.__hash));
});

datascript.parser.Aggregate.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.Aggregate.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Aggregate.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24279){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.Aggregate(datascript.parser.postwalk.call(null,self__.fn,f24279),datascript.parser.postwalk.call(null,self__.args,f24279),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.Aggregate.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24280,acc24281){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24280,self__.args,datascript.parser.collect.call(null,pred24280,self__.fn,acc24281));
});

datascript.parser.Aggregate.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24281){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,acc24281,self__.fn),self__.args);
});

datascript.parser.Aggregate.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"fn","fn",465265323,null),new cljs.core.Symbol(null,"args","args",-1338879193,null)], null);
});

datascript.parser.Aggregate.cljs$lang$type = true;

datascript.parser.Aggregate.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/Aggregate");
});

datascript.parser.Aggregate.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/Aggregate");
});

datascript.parser.__GT_Aggregate = (function datascript$parser$__GT_Aggregate(fn,args){
return (new datascript.parser.Aggregate(fn,args,null,null,null));
});

datascript.parser.map__GT_Aggregate = (function datascript$parser$map__GT_Aggregate(G__24284){
return (new datascript.parser.Aggregate(new cljs.core.Keyword(null,"fn","fn",-1175266204).cljs$core$IFn$_invoke$arity$1(G__24284),new cljs.core.Keyword(null,"args","args",1315556576).cljs$core$IFn$_invoke$arity$1(G__24284),null,cljs.core.dissoc.call(null,G__24284,new cljs.core.Keyword(null,"fn","fn",-1175266204),new cljs.core.Keyword(null,"args","args",1315556576)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {datascript.parser.IFindVars}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.Pull = (function (source,variable,pattern,__meta,__extmap,__hash){
this.source = source;
this.variable = variable;
this.pattern = pattern;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.Pull.prototype.datascript$parser$IFindVars$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Pull.prototype.datascript$parser$IFindVars$_find_vars$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return datascript.parser._find_vars.call(null,self__.variable);
});

datascript.parser.Pull.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.Pull.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24294,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24296 = (((k24294 instanceof cljs.core.Keyword))?k24294.fqn:null);
switch (G__24296) {
case "source":
return self__.source;

break;
case "variable":
return self__.variable;

break;
case "pattern":
return self__.pattern;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24294,else__15844__auto__);

}
});

datascript.parser.Pull.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.Pull{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"source","source",-433931539),self__.source],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"variable","variable",-281346492),self__.variable],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"pattern","pattern",242135423),self__.pattern],null))], null),self__.__extmap));
});

datascript.parser.Pull.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Pull.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24293){
var self__ = this;
var G__24293__$1 = this;
return (new cljs.core.RecordIter((0),G__24293__$1,3,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"source","source",-433931539),new cljs.core.Keyword(null,"variable","variable",-281346492),new cljs.core.Keyword(null,"pattern","pattern",242135423)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.Pull.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.Pull.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.Pull(self__.source,self__.variable,self__.pattern,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.Pull.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (3 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.Pull.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.Pull.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.Pull.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"variable","variable",-281346492),null,new cljs.core.Keyword(null,"source","source",-433931539),null,new cljs.core.Keyword(null,"pattern","pattern",242135423),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.Pull(self__.source,self__.variable,self__.pattern,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.Pull.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24293){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24297 = cljs.core.keyword_identical_QMARK_;
var expr__24298 = k__15849__auto__;
if(cljs.core.truth_(pred__24297.call(null,new cljs.core.Keyword(null,"source","source",-433931539),expr__24298))){
return (new datascript.parser.Pull(G__24293,self__.variable,self__.pattern,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24297.call(null,new cljs.core.Keyword(null,"variable","variable",-281346492),expr__24298))){
return (new datascript.parser.Pull(self__.source,G__24293,self__.pattern,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24297.call(null,new cljs.core.Keyword(null,"pattern","pattern",242135423),expr__24298))){
return (new datascript.parser.Pull(self__.source,self__.variable,G__24293,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.Pull(self__.source,self__.variable,self__.pattern,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24293),null));
}
}
}
});

datascript.parser.Pull.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"source","source",-433931539),self__.source],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"variable","variable",-281346492),self__.variable],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"pattern","pattern",242135423),self__.pattern],null))], null),self__.__extmap));
});

datascript.parser.Pull.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24293){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.Pull(self__.source,self__.variable,self__.pattern,G__24293,self__.__extmap,self__.__hash));
});

datascript.parser.Pull.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.Pull.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Pull.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24290){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.Pull(datascript.parser.postwalk.call(null,self__.source,f24290),datascript.parser.postwalk.call(null,self__.variable,f24290),datascript.parser.postwalk.call(null,self__.pattern,f24290),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.Pull.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24291,acc24292){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24291,self__.pattern,datascript.parser.collect.call(null,pred24291,self__.variable,datascript.parser.collect.call(null,pred24291,self__.source,acc24292)));
});

datascript.parser.Pull.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24292){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,acc24292,self__.source),self__.variable),self__.pattern);
});

datascript.parser.Pull.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"source","source",1206599988,null),new cljs.core.Symbol(null,"variable","variable",1359185035,null),new cljs.core.Symbol(null,"pattern","pattern",1882666950,null)], null);
});

datascript.parser.Pull.cljs$lang$type = true;

datascript.parser.Pull.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/Pull");
});

datascript.parser.Pull.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/Pull");
});

datascript.parser.__GT_Pull = (function datascript$parser$__GT_Pull(source,variable,pattern){
return (new datascript.parser.Pull(source,variable,pattern,null,null,null));
});

datascript.parser.map__GT_Pull = (function datascript$parser$map__GT_Pull(G__24295){
return (new datascript.parser.Pull(new cljs.core.Keyword(null,"source","source",-433931539).cljs$core$IFn$_invoke$arity$1(G__24295),new cljs.core.Keyword(null,"variable","variable",-281346492).cljs$core$IFn$_invoke$arity$1(G__24295),new cljs.core.Keyword(null,"pattern","pattern",242135423).cljs$core$IFn$_invoke$arity$1(G__24295),null,cljs.core.dissoc.call(null,G__24295,new cljs.core.Keyword(null,"source","source",-433931539),new cljs.core.Keyword(null,"variable","variable",-281346492),new cljs.core.Keyword(null,"pattern","pattern",242135423)),null));
});


/**
 * @interface
 */
datascript.parser.IFindElements = function(){};

datascript.parser.find_elements = (function datascript$parser$find_elements(this$){
if((!((this$ == null))) && (!((this$.datascript$parser$IFindElements$find_elements$arity$1 == null)))){
return this$.datascript$parser$IFindElements$find_elements$arity$1(this$);
} else {
var x__15882__auto__ = (((this$ == null))?null:this$);
var m__15883__auto__ = (datascript.parser.find_elements[goog.typeOf(x__15882__auto__)]);
if(!((m__15883__auto__ == null))){
return m__15883__auto__.call(null,this$);
} else {
var m__15883__auto____$1 = (datascript.parser.find_elements["_"]);
if(!((m__15883__auto____$1 == null))){
return m__15883__auto____$1.call(null,this$);
} else {
throw cljs.core.missing_protocol.call(null,"IFindElements.find-elements",this$);
}
}
}
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {datascript.parser.IFindElements}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.FindRel = (function (elements,__meta,__extmap,__hash){
this.elements = elements;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.FindRel.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.FindRel.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24305,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24307 = (((k24305 instanceof cljs.core.Keyword))?k24305.fqn:null);
switch (G__24307) {
case "elements":
return self__.elements;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24305,else__15844__auto__);

}
});

datascript.parser.FindRel.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.FindRel{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"elements","elements",657646735),self__.elements],null))], null),self__.__extmap));
});

datascript.parser.FindRel.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.FindRel.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24304){
var self__ = this;
var G__24304__$1 = this;
return (new cljs.core.RecordIter((0),G__24304__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"elements","elements",657646735)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.FindRel.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.FindRel.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.FindRel(self__.elements,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.FindRel.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (1 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.FindRel.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.FindRel.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.FindRel.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"elements","elements",657646735),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.FindRel(self__.elements,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.FindRel.prototype.datascript$parser$IFindElements$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.FindRel.prototype.datascript$parser$IFindElements$find_elements$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return self__.elements;
});

datascript.parser.FindRel.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24304){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24308 = cljs.core.keyword_identical_QMARK_;
var expr__24309 = k__15849__auto__;
if(cljs.core.truth_(pred__24308.call(null,new cljs.core.Keyword(null,"elements","elements",657646735),expr__24309))){
return (new datascript.parser.FindRel(G__24304,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.FindRel(self__.elements,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24304),null));
}
});

datascript.parser.FindRel.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"elements","elements",657646735),self__.elements],null))], null),self__.__extmap));
});

datascript.parser.FindRel.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24304){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.FindRel(self__.elements,G__24304,self__.__extmap,self__.__hash));
});

datascript.parser.FindRel.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.FindRel.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.FindRel.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24301){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.FindRel(datascript.parser.postwalk.call(null,self__.elements,f24301),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.FindRel.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24302,acc24303){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24302,self__.elements,acc24303);
});

datascript.parser.FindRel.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24303){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,acc24303,self__.elements);
});

datascript.parser.FindRel.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"elements","elements",-1996789034,null)], null);
});

datascript.parser.FindRel.cljs$lang$type = true;

datascript.parser.FindRel.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/FindRel");
});

datascript.parser.FindRel.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/FindRel");
});

datascript.parser.__GT_FindRel = (function datascript$parser$__GT_FindRel(elements){
return (new datascript.parser.FindRel(elements,null,null,null));
});

datascript.parser.map__GT_FindRel = (function datascript$parser$map__GT_FindRel(G__24306){
return (new datascript.parser.FindRel(new cljs.core.Keyword(null,"elements","elements",657646735).cljs$core$IFn$_invoke$arity$1(G__24306),null,cljs.core.dissoc.call(null,G__24306,new cljs.core.Keyword(null,"elements","elements",657646735)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {datascript.parser.IFindElements}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.FindColl = (function (element,__meta,__extmap,__hash){
this.element = element;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.FindColl.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.FindColl.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24316,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24318 = (((k24316 instanceof cljs.core.Keyword))?k24316.fqn:null);
switch (G__24318) {
case "element":
return self__.element;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24316,else__15844__auto__);

}
});

datascript.parser.FindColl.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.FindColl{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"element","element",1974019749),self__.element],null))], null),self__.__extmap));
});

datascript.parser.FindColl.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.FindColl.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24315){
var self__ = this;
var G__24315__$1 = this;
return (new cljs.core.RecordIter((0),G__24315__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"element","element",1974019749)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.FindColl.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.FindColl.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.FindColl(self__.element,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.FindColl.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (1 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.FindColl.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.FindColl.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.FindColl.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"element","element",1974019749),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.FindColl(self__.element,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.FindColl.prototype.datascript$parser$IFindElements$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.FindColl.prototype.datascript$parser$IFindElements$find_elements$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [self__.element], null);
});

datascript.parser.FindColl.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24315){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24319 = cljs.core.keyword_identical_QMARK_;
var expr__24320 = k__15849__auto__;
if(cljs.core.truth_(pred__24319.call(null,new cljs.core.Keyword(null,"element","element",1974019749),expr__24320))){
return (new datascript.parser.FindColl(G__24315,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.FindColl(self__.element,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24315),null));
}
});

datascript.parser.FindColl.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"element","element",1974019749),self__.element],null))], null),self__.__extmap));
});

datascript.parser.FindColl.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24315){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.FindColl(self__.element,G__24315,self__.__extmap,self__.__hash));
});

datascript.parser.FindColl.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.FindColl.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.FindColl.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24312){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.FindColl(datascript.parser.postwalk.call(null,self__.element,f24312),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.FindColl.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24313,acc24314){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24313,self__.element,acc24314);
});

datascript.parser.FindColl.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24314){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,acc24314,self__.element);
});

datascript.parser.FindColl.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"element","element",-680416020,null)], null);
});

datascript.parser.FindColl.cljs$lang$type = true;

datascript.parser.FindColl.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/FindColl");
});

datascript.parser.FindColl.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/FindColl");
});

datascript.parser.__GT_FindColl = (function datascript$parser$__GT_FindColl(element){
return (new datascript.parser.FindColl(element,null,null,null));
});

datascript.parser.map__GT_FindColl = (function datascript$parser$map__GT_FindColl(G__24317){
return (new datascript.parser.FindColl(new cljs.core.Keyword(null,"element","element",1974019749).cljs$core$IFn$_invoke$arity$1(G__24317),null,cljs.core.dissoc.call(null,G__24317,new cljs.core.Keyword(null,"element","element",1974019749)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {datascript.parser.IFindElements}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.FindScalar = (function (element,__meta,__extmap,__hash){
this.element = element;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.FindScalar.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.FindScalar.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24327,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24329 = (((k24327 instanceof cljs.core.Keyword))?k24327.fqn:null);
switch (G__24329) {
case "element":
return self__.element;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24327,else__15844__auto__);

}
});

datascript.parser.FindScalar.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.FindScalar{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"element","element",1974019749),self__.element],null))], null),self__.__extmap));
});

datascript.parser.FindScalar.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.FindScalar.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24326){
var self__ = this;
var G__24326__$1 = this;
return (new cljs.core.RecordIter((0),G__24326__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"element","element",1974019749)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.FindScalar.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.FindScalar.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.FindScalar(self__.element,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.FindScalar.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (1 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.FindScalar.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.FindScalar.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.FindScalar.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"element","element",1974019749),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.FindScalar(self__.element,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.FindScalar.prototype.datascript$parser$IFindElements$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.FindScalar.prototype.datascript$parser$IFindElements$find_elements$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [self__.element], null);
});

datascript.parser.FindScalar.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24326){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24330 = cljs.core.keyword_identical_QMARK_;
var expr__24331 = k__15849__auto__;
if(cljs.core.truth_(pred__24330.call(null,new cljs.core.Keyword(null,"element","element",1974019749),expr__24331))){
return (new datascript.parser.FindScalar(G__24326,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.FindScalar(self__.element,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24326),null));
}
});

datascript.parser.FindScalar.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"element","element",1974019749),self__.element],null))], null),self__.__extmap));
});

datascript.parser.FindScalar.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24326){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.FindScalar(self__.element,G__24326,self__.__extmap,self__.__hash));
});

datascript.parser.FindScalar.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.FindScalar.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.FindScalar.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24323){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.FindScalar(datascript.parser.postwalk.call(null,self__.element,f24323),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.FindScalar.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24324,acc24325){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24324,self__.element,acc24325);
});

datascript.parser.FindScalar.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24325){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,acc24325,self__.element);
});

datascript.parser.FindScalar.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"element","element",-680416020,null)], null);
});

datascript.parser.FindScalar.cljs$lang$type = true;

datascript.parser.FindScalar.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/FindScalar");
});

datascript.parser.FindScalar.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/FindScalar");
});

datascript.parser.__GT_FindScalar = (function datascript$parser$__GT_FindScalar(element){
return (new datascript.parser.FindScalar(element,null,null,null));
});

datascript.parser.map__GT_FindScalar = (function datascript$parser$map__GT_FindScalar(G__24328){
return (new datascript.parser.FindScalar(new cljs.core.Keyword(null,"element","element",1974019749).cljs$core$IFn$_invoke$arity$1(G__24328),null,cljs.core.dissoc.call(null,G__24328,new cljs.core.Keyword(null,"element","element",1974019749)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {datascript.parser.IFindElements}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.FindTuple = (function (elements,__meta,__extmap,__hash){
this.elements = elements;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.FindTuple.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.FindTuple.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24338,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24340 = (((k24338 instanceof cljs.core.Keyword))?k24338.fqn:null);
switch (G__24340) {
case "elements":
return self__.elements;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24338,else__15844__auto__);

}
});

datascript.parser.FindTuple.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.FindTuple{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"elements","elements",657646735),self__.elements],null))], null),self__.__extmap));
});

datascript.parser.FindTuple.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.FindTuple.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24337){
var self__ = this;
var G__24337__$1 = this;
return (new cljs.core.RecordIter((0),G__24337__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"elements","elements",657646735)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.FindTuple.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.FindTuple.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.FindTuple(self__.elements,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.FindTuple.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (1 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.FindTuple.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.FindTuple.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.FindTuple.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"elements","elements",657646735),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.FindTuple(self__.elements,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.FindTuple.prototype.datascript$parser$IFindElements$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.FindTuple.prototype.datascript$parser$IFindElements$find_elements$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return self__.elements;
});

datascript.parser.FindTuple.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24337){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24341 = cljs.core.keyword_identical_QMARK_;
var expr__24342 = k__15849__auto__;
if(cljs.core.truth_(pred__24341.call(null,new cljs.core.Keyword(null,"elements","elements",657646735),expr__24342))){
return (new datascript.parser.FindTuple(G__24337,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.FindTuple(self__.elements,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24337),null));
}
});

datascript.parser.FindTuple.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"elements","elements",657646735),self__.elements],null))], null),self__.__extmap));
});

datascript.parser.FindTuple.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24337){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.FindTuple(self__.elements,G__24337,self__.__extmap,self__.__hash));
});

datascript.parser.FindTuple.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.FindTuple.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.FindTuple.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24334){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.FindTuple(datascript.parser.postwalk.call(null,self__.elements,f24334),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.FindTuple.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24335,acc24336){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24335,self__.elements,acc24336);
});

datascript.parser.FindTuple.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24336){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,acc24336,self__.elements);
});

datascript.parser.FindTuple.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"elements","elements",-1996789034,null)], null);
});

datascript.parser.FindTuple.cljs$lang$type = true;

datascript.parser.FindTuple.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/FindTuple");
});

datascript.parser.FindTuple.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/FindTuple");
});

datascript.parser.__GT_FindTuple = (function datascript$parser$__GT_FindTuple(elements){
return (new datascript.parser.FindTuple(elements,null,null,null));
});

datascript.parser.map__GT_FindTuple = (function datascript$parser$map__GT_FindTuple(G__24339){
return (new datascript.parser.FindTuple(new cljs.core.Keyword(null,"elements","elements",657646735).cljs$core$IFn$_invoke$arity$1(G__24339),null,cljs.core.dissoc.call(null,G__24339,new cljs.core.Keyword(null,"elements","elements",657646735)),null));
});

datascript.parser.find_vars = (function datascript$parser$find_vars(find){
return cljs.core.mapcat.call(null,datascript.parser._find_vars,datascript.parser.find_elements.call(null,find));
});
datascript.parser.aggregate_QMARK_ = (function datascript$parser$aggregate_QMARK_(element){
return (element instanceof datascript.parser.Aggregate);
});
datascript.parser.pull_QMARK_ = (function datascript$parser$pull_QMARK_(element){
return (element instanceof datascript.parser.Pull);
});
datascript.parser.parse_aggregate = (function datascript$parser$parse_aggregate(form){
if((cljs.core.sequential_QMARK_.call(null,form)) && ((cljs.core.count.call(null,form) >= (2)))){
var vec__24348 = form;
var seq__24349 = cljs.core.seq.call(null,vec__24348);
var first__24350 = cljs.core.first.call(null,seq__24349);
var seq__24349__$1 = cljs.core.next.call(null,seq__24349);
var fn = first__24350;
var args = seq__24349__$1;
var fn_STAR_ = datascript.parser.parse_plain_symbol.call(null,fn);
var args_STAR_ = datascript.parser.parse_seq.call(null,datascript.parser.parse_fn_arg,args);
if(cljs.core.truth_((function (){var and__15207__auto__ = fn_STAR_;
if(cljs.core.truth_(and__15207__auto__)){
return args_STAR_;
} else {
return and__15207__auto__;
}
})())){
return (new datascript.parser.Aggregate(fn_STAR_,args_STAR_,null,null,null));
} else {
return null;
}
} else {
return null;
}
});
datascript.parser.parse_aggregate_custom = (function datascript$parser$parse_aggregate_custom(form){
if((cljs.core.sequential_QMARK_.call(null,form)) && (cljs.core._EQ_.call(null,cljs.core.first.call(null,form),new cljs.core.Symbol(null,"aggregate","aggregate",-1142967327,null)))){
if((cljs.core.count.call(null,form) >= (3))){
var vec__24354 = form;
var seq__24355 = cljs.core.seq.call(null,vec__24354);
var first__24356 = cljs.core.first.call(null,seq__24355);
var seq__24355__$1 = cljs.core.next.call(null,seq__24355);
var _ = first__24356;
var first__24356__$1 = cljs.core.first.call(null,seq__24355__$1);
var seq__24355__$2 = cljs.core.next.call(null,seq__24355__$1);
var fn = first__24356__$1;
var args = seq__24355__$2;
var fn_STAR_ = datascript.parser.parse_variable.call(null,fn);
var args_STAR_ = datascript.parser.parse_seq.call(null,datascript.parser.parse_fn_arg,args);
if(cljs.core.truth_((function (){var and__15207__auto__ = fn_STAR_;
if(cljs.core.truth_(and__15207__auto__)){
return args_STAR_;
} else {
return and__15207__auto__;
}
})())){
return (new datascript.parser.Aggregate(fn_STAR_,args_STAR_,null,null,null));
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse custom aggregate call, expect ['aggregate' variable fn-arg+]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","find","parser/find",-801023103),new cljs.core.Keyword(null,"fragment","fragment",826775688),form], null));
}
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse custom aggregate call, expect ['aggregate' variable fn-arg+]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","find","parser/find",-801023103),new cljs.core.Keyword(null,"fragment","fragment",826775688),form], null));
}
} else {
return null;
}
});
datascript.parser.parse_pull_expr = (function datascript$parser$parse_pull_expr(form){
if((cljs.core.sequential_QMARK_.call(null,form)) && (cljs.core._EQ_.call(null,cljs.core.first.call(null,form),new cljs.core.Symbol(null,"pull","pull",779986722,null)))){
if((((3) <= cljs.core.count.call(null,form))) && ((cljs.core.count.call(null,form) <= (4)))){
var long_QMARK_ = cljs.core._EQ_.call(null,cljs.core.count.call(null,form),(4));
var src = ((long_QMARK_)?cljs.core.nth.call(null,form,(1)):new cljs.core.Symbol(null,"$","$",-1580747756,null));
var vec__24360 = ((long_QMARK_)?cljs.core.nnext.call(null,form):cljs.core.next.call(null,form));
var var$ = cljs.core.nth.call(null,vec__24360,(0),null);
var pattern = cljs.core.nth.call(null,vec__24360,(1),null);
var src_STAR_ = datascript.parser.parse_src_var.call(null,src);
var var_STAR_ = datascript.parser.parse_variable.call(null,var$);
var pattern_STAR_ = (function (){var or__15219__auto__ = datascript.parser.parse_variable.call(null,pattern);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
var or__15219__auto____$1 = datascript.parser.parse_plain_variable.call(null,pattern);
if(cljs.core.truth_(or__15219__auto____$1)){
return or__15219__auto____$1;
} else {
return datascript.parser.parse_constant.call(null,pattern);
}
}
})();
if(cljs.core.truth_((function (){var and__15207__auto__ = src_STAR_;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = var_STAR_;
if(cljs.core.truth_(and__15207__auto____$1)){
return pattern_STAR_;
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return (new datascript.parser.Pull(src_STAR_,var_STAR_,pattern_STAR_,null,null,null));
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse pull expression, expect ['pull' src-var? variable (constant | variable | plain-symbol)]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","find","parser/find",-801023103),new cljs.core.Keyword(null,"fragment","fragment",826775688),form], null));
}
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse pull expression, expect ['pull' src-var? variable (constant | variable | plain-symbol)]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","find","parser/find",-801023103),new cljs.core.Keyword(null,"fragment","fragment",826775688),form], null));
}
} else {
return null;
}
});
datascript.parser.parse_find_elem = (function datascript$parser$parse_find_elem(form){
var or__15219__auto__ = datascript.parser.parse_variable.call(null,form);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
var or__15219__auto____$1 = datascript.parser.parse_pull_expr.call(null,form);
if(cljs.core.truth_(or__15219__auto____$1)){
return or__15219__auto____$1;
} else {
var or__15219__auto____$2 = datascript.parser.parse_aggregate_custom.call(null,form);
if(cljs.core.truth_(or__15219__auto____$2)){
return or__15219__auto____$2;
} else {
return datascript.parser.parse_aggregate.call(null,form);
}
}
}
});
datascript.parser.parse_find_rel = (function datascript$parser$parse_find_rel(form){
var G__24364 = datascript.parser.parse_seq.call(null,datascript.parser.parse_find_elem,form);
if((G__24364 == null)){
return null;
} else {
return (new datascript.parser.FindRel(G__24364,null,null,null));
}
});
datascript.parser.parse_find_coll = (function datascript$parser$parse_find_coll(form){
if((cljs.core.sequential_QMARK_.call(null,form)) && (cljs.core._EQ_.call(null,cljs.core.count.call(null,form),(1)))){
var inner = cljs.core.first.call(null,form);
if((cljs.core.sequential_QMARK_.call(null,inner)) && (cljs.core._EQ_.call(null,cljs.core.count.call(null,inner),(2))) && (cljs.core._EQ_.call(null,cljs.core.second.call(null,inner),new cljs.core.Symbol(null,"...","...",-1926939749,null)))){
var G__24366 = datascript.parser.parse_find_elem.call(null,cljs.core.first.call(null,inner));
if((G__24366 == null)){
return null;
} else {
return (new datascript.parser.FindColl(G__24366,null,null,null));
}
} else {
return null;
}
} else {
return null;
}
});
datascript.parser.parse_find_scalar = (function datascript$parser$parse_find_scalar(form){
if((cljs.core.sequential_QMARK_.call(null,form)) && (cljs.core._EQ_.call(null,cljs.core.count.call(null,form),(2))) && (cljs.core._EQ_.call(null,cljs.core.second.call(null,form),new cljs.core.Symbol(null,".",".",1975675962,null)))){
var G__24368 = datascript.parser.parse_find_elem.call(null,cljs.core.first.call(null,form));
if((G__24368 == null)){
return null;
} else {
return (new datascript.parser.FindScalar(G__24368,null,null,null));
}
} else {
return null;
}
});
datascript.parser.parse_find_tuple = (function datascript$parser$parse_find_tuple(form){
if((cljs.core.sequential_QMARK_.call(null,form)) && (cljs.core._EQ_.call(null,cljs.core.count.call(null,form),(1)))){
var inner = cljs.core.first.call(null,form);
var G__24370 = datascript.parser.parse_seq.call(null,datascript.parser.parse_find_elem,inner);
if((G__24370 == null)){
return null;
} else {
return (new datascript.parser.FindTuple(G__24370,null,null,null));
}
} else {
return null;
}
});
datascript.parser.parse_find = (function datascript$parser$parse_find(form){
var or__15219__auto__ = datascript.parser.parse_find_rel.call(null,form);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
var or__15219__auto____$1 = datascript.parser.parse_find_coll.call(null,form);
if(cljs.core.truth_(or__15219__auto____$1)){
return or__15219__auto____$1;
} else {
var or__15219__auto____$2 = datascript.parser.parse_find_scalar.call(null,form);
if(cljs.core.truth_(or__15219__auto____$2)){
return or__15219__auto____$2;
} else {
var or__15219__auto____$3 = datascript.parser.parse_find_tuple.call(null,form);
if(cljs.core.truth_(or__15219__auto____$3)){
return or__15219__auto____$3;
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse :find, expected: (find-rel | find-coll | find-tuple | find-scalar)")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","find","parser/find",-801023103),new cljs.core.Keyword(null,"fragment","fragment",826775688),form], null));
}
}
}
}
});
datascript.parser.parse_with = (function datascript$parser$parse_with(form){
var or__15219__auto__ = datascript.parser.parse_seq.call(null,datascript.parser.parse_variable,form);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse :with clause, expected [ variable+ ]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","with","parser/with",-386255821),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
});
datascript.parser.parse_in_binding = (function datascript$parser$parse_in_binding(form){
var temp__4655__auto__ = (function (){var or__15219__auto__ = datascript.parser.parse_src_var.call(null,form);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
var or__15219__auto____$1 = datascript.parser.parse_rules_var.call(null,form);
if(cljs.core.truth_(or__15219__auto____$1)){
return or__15219__auto____$1;
} else {
return datascript.parser.parse_plain_variable.call(null,form);
}
}
})();
if(cljs.core.truth_(temp__4655__auto__)){
var var$ = temp__4655__auto__;
return datascript.parser.with_source.call(null,(new datascript.parser.BindScalar(var$,null,null,null)),form);
} else {
return datascript.parser.parse_binding.call(null,form);
}
});
datascript.parser.parse_in = (function datascript$parser$parse_in(form){
var or__15219__auto__ = datascript.parser.parse_seq.call(null,datascript.parser.parse_in_binding,form);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse :in clause, expected (src-var | % | plain-symbol | bind-scalar | bind-tuple | bind-coll | bind-rel)")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","in","parser/in",1617442048),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
});

/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.Pattern = (function (source,pattern,__meta,__extmap,__hash){
this.source = source;
this.pattern = pattern;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.Pattern.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.Pattern.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24375,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24377 = (((k24375 instanceof cljs.core.Keyword))?k24375.fqn:null);
switch (G__24377) {
case "source":
return self__.source;

break;
case "pattern":
return self__.pattern;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24375,else__15844__auto__);

}
});

datascript.parser.Pattern.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.Pattern{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"source","source",-433931539),self__.source],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"pattern","pattern",242135423),self__.pattern],null))], null),self__.__extmap));
});

datascript.parser.Pattern.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Pattern.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24374){
var self__ = this;
var G__24374__$1 = this;
return (new cljs.core.RecordIter((0),G__24374__$1,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"source","source",-433931539),new cljs.core.Keyword(null,"pattern","pattern",242135423)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.Pattern.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.Pattern.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.Pattern(self__.source,self__.pattern,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.Pattern.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (2 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.Pattern.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.Pattern.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.Pattern.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"source","source",-433931539),null,new cljs.core.Keyword(null,"pattern","pattern",242135423),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.Pattern(self__.source,self__.pattern,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.Pattern.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24374){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24378 = cljs.core.keyword_identical_QMARK_;
var expr__24379 = k__15849__auto__;
if(cljs.core.truth_(pred__24378.call(null,new cljs.core.Keyword(null,"source","source",-433931539),expr__24379))){
return (new datascript.parser.Pattern(G__24374,self__.pattern,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24378.call(null,new cljs.core.Keyword(null,"pattern","pattern",242135423),expr__24379))){
return (new datascript.parser.Pattern(self__.source,G__24374,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.Pattern(self__.source,self__.pattern,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24374),null));
}
}
});

datascript.parser.Pattern.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"source","source",-433931539),self__.source],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"pattern","pattern",242135423),self__.pattern],null))], null),self__.__extmap));
});

datascript.parser.Pattern.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24374){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.Pattern(self__.source,self__.pattern,G__24374,self__.__extmap,self__.__hash));
});

datascript.parser.Pattern.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.Pattern.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Pattern.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24371){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.Pattern(datascript.parser.postwalk.call(null,self__.source,f24371),datascript.parser.postwalk.call(null,self__.pattern,f24371),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.Pattern.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24372,acc24373){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24372,self__.pattern,datascript.parser.collect.call(null,pred24372,self__.source,acc24373));
});

datascript.parser.Pattern.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24373){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,acc24373,self__.source),self__.pattern);
});

datascript.parser.Pattern.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"source","source",1206599988,null),new cljs.core.Symbol(null,"pattern","pattern",1882666950,null)], null);
});

datascript.parser.Pattern.cljs$lang$type = true;

datascript.parser.Pattern.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/Pattern");
});

datascript.parser.Pattern.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/Pattern");
});

datascript.parser.__GT_Pattern = (function datascript$parser$__GT_Pattern(source,pattern){
return (new datascript.parser.Pattern(source,pattern,null,null,null));
});

datascript.parser.map__GT_Pattern = (function datascript$parser$map__GT_Pattern(G__24376){
return (new datascript.parser.Pattern(new cljs.core.Keyword(null,"source","source",-433931539).cljs$core$IFn$_invoke$arity$1(G__24376),new cljs.core.Keyword(null,"pattern","pattern",242135423).cljs$core$IFn$_invoke$arity$1(G__24376),null,cljs.core.dissoc.call(null,G__24376,new cljs.core.Keyword(null,"source","source",-433931539),new cljs.core.Keyword(null,"pattern","pattern",242135423)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.Predicate = (function (fn,args,__meta,__extmap,__hash){
this.fn = fn;
this.args = args;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.Predicate.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.Predicate.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24386,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24388 = (((k24386 instanceof cljs.core.Keyword))?k24386.fqn:null);
switch (G__24388) {
case "fn":
return self__.fn;

break;
case "args":
return self__.args;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24386,else__15844__auto__);

}
});

datascript.parser.Predicate.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.Predicate{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"fn","fn",-1175266204),self__.fn],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"args","args",1315556576),self__.args],null))], null),self__.__extmap));
});

datascript.parser.Predicate.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Predicate.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24385){
var self__ = this;
var G__24385__$1 = this;
return (new cljs.core.RecordIter((0),G__24385__$1,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"fn","fn",-1175266204),new cljs.core.Keyword(null,"args","args",1315556576)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.Predicate.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.Predicate.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.Predicate(self__.fn,self__.args,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.Predicate.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (2 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.Predicate.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.Predicate.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.Predicate.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"args","args",1315556576),null,new cljs.core.Keyword(null,"fn","fn",-1175266204),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.Predicate(self__.fn,self__.args,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.Predicate.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24385){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24389 = cljs.core.keyword_identical_QMARK_;
var expr__24390 = k__15849__auto__;
if(cljs.core.truth_(pred__24389.call(null,new cljs.core.Keyword(null,"fn","fn",-1175266204),expr__24390))){
return (new datascript.parser.Predicate(G__24385,self__.args,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24389.call(null,new cljs.core.Keyword(null,"args","args",1315556576),expr__24390))){
return (new datascript.parser.Predicate(self__.fn,G__24385,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.Predicate(self__.fn,self__.args,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24385),null));
}
}
});

datascript.parser.Predicate.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"fn","fn",-1175266204),self__.fn],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"args","args",1315556576),self__.args],null))], null),self__.__extmap));
});

datascript.parser.Predicate.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24385){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.Predicate(self__.fn,self__.args,G__24385,self__.__extmap,self__.__hash));
});

datascript.parser.Predicate.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.Predicate.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Predicate.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24382){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.Predicate(datascript.parser.postwalk.call(null,self__.fn,f24382),datascript.parser.postwalk.call(null,self__.args,f24382),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.Predicate.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24383,acc24384){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24383,self__.args,datascript.parser.collect.call(null,pred24383,self__.fn,acc24384));
});

datascript.parser.Predicate.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24384){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,acc24384,self__.fn),self__.args);
});

datascript.parser.Predicate.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"fn","fn",465265323,null),new cljs.core.Symbol(null,"args","args",-1338879193,null)], null);
});

datascript.parser.Predicate.cljs$lang$type = true;

datascript.parser.Predicate.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/Predicate");
});

datascript.parser.Predicate.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/Predicate");
});

datascript.parser.__GT_Predicate = (function datascript$parser$__GT_Predicate(fn,args){
return (new datascript.parser.Predicate(fn,args,null,null,null));
});

datascript.parser.map__GT_Predicate = (function datascript$parser$map__GT_Predicate(G__24387){
return (new datascript.parser.Predicate(new cljs.core.Keyword(null,"fn","fn",-1175266204).cljs$core$IFn$_invoke$arity$1(G__24387),new cljs.core.Keyword(null,"args","args",1315556576).cljs$core$IFn$_invoke$arity$1(G__24387),null,cljs.core.dissoc.call(null,G__24387,new cljs.core.Keyword(null,"fn","fn",-1175266204),new cljs.core.Keyword(null,"args","args",1315556576)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.Function = (function (fn,args,binding,__meta,__extmap,__hash){
this.fn = fn;
this.args = args;
this.binding = binding;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.Function.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.Function.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24397,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24399 = (((k24397 instanceof cljs.core.Keyword))?k24397.fqn:null);
switch (G__24399) {
case "fn":
return self__.fn;

break;
case "args":
return self__.args;

break;
case "binding":
return self__.binding;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24397,else__15844__auto__);

}
});

datascript.parser.Function.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.Function{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"fn","fn",-1175266204),self__.fn],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"args","args",1315556576),self__.args],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"binding","binding",539932593),self__.binding],null))], null),self__.__extmap));
});

datascript.parser.Function.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Function.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24396){
var self__ = this;
var G__24396__$1 = this;
return (new cljs.core.RecordIter((0),G__24396__$1,3,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"fn","fn",-1175266204),new cljs.core.Keyword(null,"args","args",1315556576),new cljs.core.Keyword(null,"binding","binding",539932593)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.Function.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.Function.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.Function(self__.fn,self__.args,self__.binding,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.Function.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (3 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.Function.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.Function.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.Function.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"args","args",1315556576),null,new cljs.core.Keyword(null,"fn","fn",-1175266204),null,new cljs.core.Keyword(null,"binding","binding",539932593),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.Function(self__.fn,self__.args,self__.binding,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.Function.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24396){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24400 = cljs.core.keyword_identical_QMARK_;
var expr__24401 = k__15849__auto__;
if(cljs.core.truth_(pred__24400.call(null,new cljs.core.Keyword(null,"fn","fn",-1175266204),expr__24401))){
return (new datascript.parser.Function(G__24396,self__.args,self__.binding,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24400.call(null,new cljs.core.Keyword(null,"args","args",1315556576),expr__24401))){
return (new datascript.parser.Function(self__.fn,G__24396,self__.binding,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24400.call(null,new cljs.core.Keyword(null,"binding","binding",539932593),expr__24401))){
return (new datascript.parser.Function(self__.fn,self__.args,G__24396,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.Function(self__.fn,self__.args,self__.binding,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24396),null));
}
}
}
});

datascript.parser.Function.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"fn","fn",-1175266204),self__.fn],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"args","args",1315556576),self__.args],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"binding","binding",539932593),self__.binding],null))], null),self__.__extmap));
});

datascript.parser.Function.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24396){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.Function(self__.fn,self__.args,self__.binding,G__24396,self__.__extmap,self__.__hash));
});

datascript.parser.Function.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.Function.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Function.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24393){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.Function(datascript.parser.postwalk.call(null,self__.fn,f24393),datascript.parser.postwalk.call(null,self__.args,f24393),datascript.parser.postwalk.call(null,self__.binding,f24393),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.Function.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24394,acc24395){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24394,self__.binding,datascript.parser.collect.call(null,pred24394,self__.args,datascript.parser.collect.call(null,pred24394,self__.fn,acc24395)));
});

datascript.parser.Function.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24395){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,acc24395,self__.fn),self__.args),self__.binding);
});

datascript.parser.Function.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"fn","fn",465265323,null),new cljs.core.Symbol(null,"args","args",-1338879193,null),new cljs.core.Symbol(null,"binding","binding",-2114503176,null)], null);
});

datascript.parser.Function.cljs$lang$type = true;

datascript.parser.Function.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/Function");
});

datascript.parser.Function.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/Function");
});

datascript.parser.__GT_Function = (function datascript$parser$__GT_Function(fn,args,binding){
return (new datascript.parser.Function(fn,args,binding,null,null,null));
});

datascript.parser.map__GT_Function = (function datascript$parser$map__GT_Function(G__24398){
return (new datascript.parser.Function(new cljs.core.Keyword(null,"fn","fn",-1175266204).cljs$core$IFn$_invoke$arity$1(G__24398),new cljs.core.Keyword(null,"args","args",1315556576).cljs$core$IFn$_invoke$arity$1(G__24398),new cljs.core.Keyword(null,"binding","binding",539932593).cljs$core$IFn$_invoke$arity$1(G__24398),null,cljs.core.dissoc.call(null,G__24398,new cljs.core.Keyword(null,"fn","fn",-1175266204),new cljs.core.Keyword(null,"args","args",1315556576),new cljs.core.Keyword(null,"binding","binding",539932593)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.RuleExpr = (function (source,name,args,__meta,__extmap,__hash){
this.source = source;
this.name = name;
this.args = args;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.RuleExpr.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.RuleExpr.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24408,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24410 = (((k24408 instanceof cljs.core.Keyword))?k24408.fqn:null);
switch (G__24410) {
case "source":
return self__.source;

break;
case "name":
return self__.name;

break;
case "args":
return self__.args;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24408,else__15844__auto__);

}
});

datascript.parser.RuleExpr.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.RuleExpr{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"source","source",-433931539),self__.source],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"name","name",1843675177),self__.name],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"args","args",1315556576),self__.args],null))], null),self__.__extmap));
});

datascript.parser.RuleExpr.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.RuleExpr.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24407){
var self__ = this;
var G__24407__$1 = this;
return (new cljs.core.RecordIter((0),G__24407__$1,3,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"source","source",-433931539),new cljs.core.Keyword(null,"name","name",1843675177),new cljs.core.Keyword(null,"args","args",1315556576)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.RuleExpr.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.RuleExpr.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.RuleExpr(self__.source,self__.name,self__.args,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.RuleExpr.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (3 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.RuleExpr.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.RuleExpr.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.RuleExpr.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"args","args",1315556576),null,new cljs.core.Keyword(null,"name","name",1843675177),null,new cljs.core.Keyword(null,"source","source",-433931539),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.RuleExpr(self__.source,self__.name,self__.args,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.RuleExpr.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24407){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24411 = cljs.core.keyword_identical_QMARK_;
var expr__24412 = k__15849__auto__;
if(cljs.core.truth_(pred__24411.call(null,new cljs.core.Keyword(null,"source","source",-433931539),expr__24412))){
return (new datascript.parser.RuleExpr(G__24407,self__.name,self__.args,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24411.call(null,new cljs.core.Keyword(null,"name","name",1843675177),expr__24412))){
return (new datascript.parser.RuleExpr(self__.source,G__24407,self__.args,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24411.call(null,new cljs.core.Keyword(null,"args","args",1315556576),expr__24412))){
return (new datascript.parser.RuleExpr(self__.source,self__.name,G__24407,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.RuleExpr(self__.source,self__.name,self__.args,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24407),null));
}
}
}
});

datascript.parser.RuleExpr.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"source","source",-433931539),self__.source],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"name","name",1843675177),self__.name],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"args","args",1315556576),self__.args],null))], null),self__.__extmap));
});

datascript.parser.RuleExpr.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24407){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.RuleExpr(self__.source,self__.name,self__.args,G__24407,self__.__extmap,self__.__hash));
});

datascript.parser.RuleExpr.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.RuleExpr.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.RuleExpr.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24404){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.RuleExpr(datascript.parser.postwalk.call(null,self__.source,f24404),datascript.parser.postwalk.call(null,self__.name,f24404),datascript.parser.postwalk.call(null,self__.args,f24404),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.RuleExpr.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24405,acc24406){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24405,self__.args,datascript.parser.collect.call(null,pred24405,self__.name,datascript.parser.collect.call(null,pred24405,self__.source,acc24406)));
});

datascript.parser.RuleExpr.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24406){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,acc24406,self__.source),self__.name),self__.args);
});

datascript.parser.RuleExpr.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"source","source",1206599988,null),new cljs.core.Symbol(null,"name","name",-810760592,null),new cljs.core.Symbol(null,"args","args",-1338879193,null)], null);
});

datascript.parser.RuleExpr.cljs$lang$type = true;

datascript.parser.RuleExpr.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/RuleExpr");
});

datascript.parser.RuleExpr.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/RuleExpr");
});

datascript.parser.__GT_RuleExpr = (function datascript$parser$__GT_RuleExpr(source,name,args){
return (new datascript.parser.RuleExpr(source,name,args,null,null,null));
});

datascript.parser.map__GT_RuleExpr = (function datascript$parser$map__GT_RuleExpr(G__24409){
return (new datascript.parser.RuleExpr(new cljs.core.Keyword(null,"source","source",-433931539).cljs$core$IFn$_invoke$arity$1(G__24409),new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(G__24409),new cljs.core.Keyword(null,"args","args",1315556576).cljs$core$IFn$_invoke$arity$1(G__24409),null,cljs.core.dissoc.call(null,G__24409,new cljs.core.Keyword(null,"source","source",-433931539),new cljs.core.Keyword(null,"name","name",1843675177),new cljs.core.Keyword(null,"args","args",1315556576)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.Not = (function (source,vars,clauses,__meta,__extmap,__hash){
this.source = source;
this.vars = vars;
this.clauses = clauses;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.Not.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.Not.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24419,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24421 = (((k24419 instanceof cljs.core.Keyword))?k24419.fqn:null);
switch (G__24421) {
case "source":
return self__.source;

break;
case "vars":
return self__.vars;

break;
case "clauses":
return self__.clauses;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24419,else__15844__auto__);

}
});

datascript.parser.Not.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.Not{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"source","source",-433931539),self__.source],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"vars","vars",-2046957217),self__.vars],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"clauses","clauses",1454841241),self__.clauses],null))], null),self__.__extmap));
});

datascript.parser.Not.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Not.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24418){
var self__ = this;
var G__24418__$1 = this;
return (new cljs.core.RecordIter((0),G__24418__$1,3,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"source","source",-433931539),new cljs.core.Keyword(null,"vars","vars",-2046957217),new cljs.core.Keyword(null,"clauses","clauses",1454841241)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.Not.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.Not.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.Not(self__.source,self__.vars,self__.clauses,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.Not.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (3 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.Not.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.Not.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.Not.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"source","source",-433931539),null,new cljs.core.Keyword(null,"clauses","clauses",1454841241),null,new cljs.core.Keyword(null,"vars","vars",-2046957217),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.Not(self__.source,self__.vars,self__.clauses,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.Not.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24418){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24422 = cljs.core.keyword_identical_QMARK_;
var expr__24423 = k__15849__auto__;
if(cljs.core.truth_(pred__24422.call(null,new cljs.core.Keyword(null,"source","source",-433931539),expr__24423))){
return (new datascript.parser.Not(G__24418,self__.vars,self__.clauses,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24422.call(null,new cljs.core.Keyword(null,"vars","vars",-2046957217),expr__24423))){
return (new datascript.parser.Not(self__.source,G__24418,self__.clauses,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24422.call(null,new cljs.core.Keyword(null,"clauses","clauses",1454841241),expr__24423))){
return (new datascript.parser.Not(self__.source,self__.vars,G__24418,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.Not(self__.source,self__.vars,self__.clauses,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24418),null));
}
}
}
});

datascript.parser.Not.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"source","source",-433931539),self__.source],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"vars","vars",-2046957217),self__.vars],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"clauses","clauses",1454841241),self__.clauses],null))], null),self__.__extmap));
});

datascript.parser.Not.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24418){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.Not(self__.source,self__.vars,self__.clauses,G__24418,self__.__extmap,self__.__hash));
});

datascript.parser.Not.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.Not.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Not.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24415){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.Not(datascript.parser.postwalk.call(null,self__.source,f24415),datascript.parser.postwalk.call(null,self__.vars,f24415),datascript.parser.postwalk.call(null,self__.clauses,f24415),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.Not.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24416,acc24417){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24416,self__.clauses,datascript.parser.collect.call(null,pred24416,self__.vars,datascript.parser.collect.call(null,pred24416,self__.source,acc24417)));
});

datascript.parser.Not.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24417){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,acc24417,self__.source),self__.vars),self__.clauses);
});

datascript.parser.Not.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"source","source",1206599988,null),new cljs.core.Symbol(null,"vars","vars",-406425690,null),new cljs.core.Symbol(null,"clauses","clauses",-1199594528,null)], null);
});

datascript.parser.Not.cljs$lang$type = true;

datascript.parser.Not.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/Not");
});

datascript.parser.Not.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/Not");
});

datascript.parser.__GT_Not = (function datascript$parser$__GT_Not(source,vars,clauses){
return (new datascript.parser.Not(source,vars,clauses,null,null,null));
});

datascript.parser.map__GT_Not = (function datascript$parser$map__GT_Not(G__24420){
return (new datascript.parser.Not(new cljs.core.Keyword(null,"source","source",-433931539).cljs$core$IFn$_invoke$arity$1(G__24420),new cljs.core.Keyword(null,"vars","vars",-2046957217).cljs$core$IFn$_invoke$arity$1(G__24420),new cljs.core.Keyword(null,"clauses","clauses",1454841241).cljs$core$IFn$_invoke$arity$1(G__24420),null,cljs.core.dissoc.call(null,G__24420,new cljs.core.Keyword(null,"source","source",-433931539),new cljs.core.Keyword(null,"vars","vars",-2046957217),new cljs.core.Keyword(null,"clauses","clauses",1454841241)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.Or = (function (source,rule_vars,clauses,__meta,__extmap,__hash){
this.source = source;
this.rule_vars = rule_vars;
this.clauses = clauses;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.Or.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.Or.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24430,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24432 = (((k24430 instanceof cljs.core.Keyword))?k24430.fqn:null);
switch (G__24432) {
case "source":
return self__.source;

break;
case "rule-vars":
return self__.rule_vars;

break;
case "clauses":
return self__.clauses;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24430,else__15844__auto__);

}
});

datascript.parser.Or.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.Or{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"source","source",-433931539),self__.source],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"rule-vars","rule-vars",1665972520),self__.rule_vars],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"clauses","clauses",1454841241),self__.clauses],null))], null),self__.__extmap));
});

datascript.parser.Or.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Or.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24429){
var self__ = this;
var G__24429__$1 = this;
return (new cljs.core.RecordIter((0),G__24429__$1,3,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"source","source",-433931539),new cljs.core.Keyword(null,"rule-vars","rule-vars",1665972520),new cljs.core.Keyword(null,"clauses","clauses",1454841241)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.Or.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.Or.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.Or(self__.source,self__.rule_vars,self__.clauses,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.Or.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (3 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.Or.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.Or.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.Or.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"rule-vars","rule-vars",1665972520),null,new cljs.core.Keyword(null,"source","source",-433931539),null,new cljs.core.Keyword(null,"clauses","clauses",1454841241),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.Or(self__.source,self__.rule_vars,self__.clauses,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.Or.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24429){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24433 = cljs.core.keyword_identical_QMARK_;
var expr__24434 = k__15849__auto__;
if(cljs.core.truth_(pred__24433.call(null,new cljs.core.Keyword(null,"source","source",-433931539),expr__24434))){
return (new datascript.parser.Or(G__24429,self__.rule_vars,self__.clauses,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24433.call(null,new cljs.core.Keyword(null,"rule-vars","rule-vars",1665972520),expr__24434))){
return (new datascript.parser.Or(self__.source,G__24429,self__.clauses,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24433.call(null,new cljs.core.Keyword(null,"clauses","clauses",1454841241),expr__24434))){
return (new datascript.parser.Or(self__.source,self__.rule_vars,G__24429,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.Or(self__.source,self__.rule_vars,self__.clauses,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24429),null));
}
}
}
});

datascript.parser.Or.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"source","source",-433931539),self__.source],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"rule-vars","rule-vars",1665972520),self__.rule_vars],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"clauses","clauses",1454841241),self__.clauses],null))], null),self__.__extmap));
});

datascript.parser.Or.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24429){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.Or(self__.source,self__.rule_vars,self__.clauses,G__24429,self__.__extmap,self__.__hash));
});

datascript.parser.Or.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.Or.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Or.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24426){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.Or(datascript.parser.postwalk.call(null,self__.source,f24426),datascript.parser.postwalk.call(null,self__.rule_vars,f24426),datascript.parser.postwalk.call(null,self__.clauses,f24426),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.Or.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24427,acc24428){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24427,self__.clauses,datascript.parser.collect.call(null,pred24427,self__.rule_vars,datascript.parser.collect.call(null,pred24427,self__.source,acc24428)));
});

datascript.parser.Or.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24428){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,acc24428,self__.source),self__.rule_vars),self__.clauses);
});

datascript.parser.Or.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"source","source",1206599988,null),new cljs.core.Symbol(null,"rule-vars","rule-vars",-988463249,null),new cljs.core.Symbol(null,"clauses","clauses",-1199594528,null)], null);
});

datascript.parser.Or.cljs$lang$type = true;

datascript.parser.Or.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/Or");
});

datascript.parser.Or.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/Or");
});

datascript.parser.__GT_Or = (function datascript$parser$__GT_Or(source,rule_vars,clauses){
return (new datascript.parser.Or(source,rule_vars,clauses,null,null,null));
});

datascript.parser.map__GT_Or = (function datascript$parser$map__GT_Or(G__24431){
return (new datascript.parser.Or(new cljs.core.Keyword(null,"source","source",-433931539).cljs$core$IFn$_invoke$arity$1(G__24431),new cljs.core.Keyword(null,"rule-vars","rule-vars",1665972520).cljs$core$IFn$_invoke$arity$1(G__24431),new cljs.core.Keyword(null,"clauses","clauses",1454841241).cljs$core$IFn$_invoke$arity$1(G__24431),null,cljs.core.dissoc.call(null,G__24431,new cljs.core.Keyword(null,"source","source",-433931539),new cljs.core.Keyword(null,"rule-vars","rule-vars",1665972520),new cljs.core.Keyword(null,"clauses","clauses",1454841241)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.And = (function (clauses,__meta,__extmap,__hash){
this.clauses = clauses;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.And.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.And.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24441,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24443 = (((k24441 instanceof cljs.core.Keyword))?k24441.fqn:null);
switch (G__24443) {
case "clauses":
return self__.clauses;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24441,else__15844__auto__);

}
});

datascript.parser.And.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.And{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"clauses","clauses",1454841241),self__.clauses],null))], null),self__.__extmap));
});

datascript.parser.And.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.And.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24440){
var self__ = this;
var G__24440__$1 = this;
return (new cljs.core.RecordIter((0),G__24440__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clauses","clauses",1454841241)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.And.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.And.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.And(self__.clauses,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.And.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (1 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.And.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.And.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.And.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"clauses","clauses",1454841241),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.And(self__.clauses,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.And.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24440){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24444 = cljs.core.keyword_identical_QMARK_;
var expr__24445 = k__15849__auto__;
if(cljs.core.truth_(pred__24444.call(null,new cljs.core.Keyword(null,"clauses","clauses",1454841241),expr__24445))){
return (new datascript.parser.And(G__24440,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.And(self__.clauses,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24440),null));
}
});

datascript.parser.And.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"clauses","clauses",1454841241),self__.clauses],null))], null),self__.__extmap));
});

datascript.parser.And.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24440){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.And(self__.clauses,G__24440,self__.__extmap,self__.__hash));
});

datascript.parser.And.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.And.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.And.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24437){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.And(datascript.parser.postwalk.call(null,self__.clauses,f24437),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.And.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24438,acc24439){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24438,self__.clauses,acc24439);
});

datascript.parser.And.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24439){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,acc24439,self__.clauses);
});

datascript.parser.And.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"clauses","clauses",-1199594528,null)], null);
});

datascript.parser.And.cljs$lang$type = true;

datascript.parser.And.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/And");
});

datascript.parser.And.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/And");
});

datascript.parser.__GT_And = (function datascript$parser$__GT_And(clauses){
return (new datascript.parser.And(clauses,null,null,null));
});

datascript.parser.map__GT_And = (function datascript$parser$map__GT_And(G__24442){
return (new datascript.parser.And(new cljs.core.Keyword(null,"clauses","clauses",1454841241).cljs$core$IFn$_invoke$arity$1(G__24442),null,cljs.core.dissoc.call(null,G__24442,new cljs.core.Keyword(null,"clauses","clauses",1454841241)),null));
});

datascript.parser.parse_pattern_el = (function datascript$parser$parse_pattern_el(form){
var or__15219__auto__ = datascript.parser.parse_placeholder.call(null,form);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
var or__15219__auto____$1 = datascript.parser.parse_variable.call(null,form);
if(cljs.core.truth_(or__15219__auto____$1)){
return or__15219__auto____$1;
} else {
return datascript.parser.parse_constant.call(null,form);
}
}
});
datascript.parser.take_source = (function datascript$parser$take_source(form){
if(cljs.core.sequential_QMARK_.call(null,form)){
var temp__4655__auto__ = datascript.parser.parse_src_var.call(null,cljs.core.first.call(null,form));
if(cljs.core.truth_(temp__4655__auto__)){
var source_STAR_ = temp__4655__auto__;
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [source_STAR_,cljs.core.next.call(null,form)], null);
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new datascript.parser.DefaultSrc(null,null,null)),form], null);
}
} else {
return null;
}
});
datascript.parser.parse_pattern = (function datascript$parser$parse_pattern(form){
var temp__4657__auto__ = datascript.parser.take_source.call(null,form);
if(cljs.core.truth_(temp__4657__auto__)){
var vec__24451 = temp__4657__auto__;
var source_STAR_ = cljs.core.nth.call(null,vec__24451,(0),null);
var next_form = cljs.core.nth.call(null,vec__24451,(1),null);
var temp__4657__auto____$1 = datascript.parser.parse_seq.call(null,datascript.parser.parse_pattern_el,next_form);
if(cljs.core.truth_(temp__4657__auto____$1)){
var pattern_STAR_ = temp__4657__auto____$1;
if(!(cljs.core.empty_QMARK_.call(null,pattern_STAR_))){
return datascript.parser.with_source.call(null,(new datascript.parser.Pattern(source_STAR_,pattern_STAR_,null,null,null)),form);
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Pattern could not be empty")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","where","parser/where",-966053850),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
} else {
return null;
}
} else {
return null;
}
});
datascript.parser.parse_call = (function datascript$parser$parse_call(form){
if(cljs.core.sequential_QMARK_.call(null,form)){
var vec__24457 = form;
var seq__24458 = cljs.core.seq.call(null,vec__24457);
var first__24459 = cljs.core.first.call(null,seq__24458);
var seq__24458__$1 = cljs.core.next.call(null,seq__24458);
var fn = first__24459;
var args = seq__24458__$1;
var args__$1 = (((args == null))?cljs.core.PersistentVector.EMPTY:args);
var fn_STAR_ = (function (){var or__15219__auto__ = datascript.parser.parse_plain_symbol.call(null,fn);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
return datascript.parser.parse_variable.call(null,fn);
}
})();
var args_STAR_ = datascript.parser.parse_seq.call(null,datascript.parser.parse_fn_arg,args__$1);
if(cljs.core.truth_((function (){var and__15207__auto__ = fn_STAR_;
if(cljs.core.truth_(and__15207__auto__)){
return args_STAR_;
} else {
return and__15207__auto__;
}
})())){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [fn_STAR_,args_STAR_], null);
} else {
return null;
}
} else {
return null;
}
});
datascript.parser.parse_pred = (function datascript$parser$parse_pred(form){
if(cljs.core.truth_(datascript.parser.of_size_QMARK_.call(null,form,(1)))){
var temp__4657__auto__ = datascript.parser.parse_call.call(null,cljs.core.first.call(null,form));
if(cljs.core.truth_(temp__4657__auto__)){
var vec__24463 = temp__4657__auto__;
var fn_STAR_ = cljs.core.nth.call(null,vec__24463,(0),null);
var args_STAR_ = cljs.core.nth.call(null,vec__24463,(1),null);
return datascript.parser.with_source.call(null,(new datascript.parser.Predicate(fn_STAR_,args_STAR_,null,null,null)),form);
} else {
return null;
}
} else {
return null;
}
});
datascript.parser.parse_fn = (function datascript$parser$parse_fn(form){
if(cljs.core.truth_(datascript.parser.of_size_QMARK_.call(null,form,(2)))){
var vec__24472 = form;
var call = cljs.core.nth.call(null,vec__24472,(0),null);
var binding = cljs.core.nth.call(null,vec__24472,(1),null);
var temp__4657__auto__ = datascript.parser.parse_call.call(null,call);
if(cljs.core.truth_(temp__4657__auto__)){
var vec__24475 = temp__4657__auto__;
var fn_STAR_ = cljs.core.nth.call(null,vec__24475,(0),null);
var args_STAR_ = cljs.core.nth.call(null,vec__24475,(1),null);
var temp__4657__auto____$1 = datascript.parser.parse_binding.call(null,binding);
if(cljs.core.truth_(temp__4657__auto____$1)){
var binding_STAR_ = temp__4657__auto____$1;
return datascript.parser.with_source.call(null,(new datascript.parser.Function(fn_STAR_,args_STAR_,binding_STAR_,null,null,null)),form);
} else {
return null;
}
} else {
return null;
}
} else {
return null;
}
});
datascript.parser.parse_rule_expr = (function datascript$parser$parse_rule_expr(form){
var temp__4657__auto__ = datascript.parser.take_source.call(null,form);
if(cljs.core.truth_(temp__4657__auto__)){
var vec__24484 = temp__4657__auto__;
var source_STAR_ = cljs.core.nth.call(null,vec__24484,(0),null);
var next_form = cljs.core.nth.call(null,vec__24484,(1),null);
var vec__24487 = next_form;
var seq__24488 = cljs.core.seq.call(null,vec__24487);
var first__24489 = cljs.core.first.call(null,seq__24488);
var seq__24488__$1 = cljs.core.next.call(null,seq__24488);
var name = first__24489;
var args = seq__24488__$1;
var name_STAR_ = datascript.parser.parse_plain_symbol.call(null,name);
var args_STAR_ = datascript.parser.parse_seq.call(null,datascript.parser.parse_pattern_el,args);
if(cljs.core.truth_(name_STAR_)){
if(cljs.core.empty_QMARK_.call(null,args)){
throw cljs.core.ex_info.call(null,[cljs.core.str("rule-expr requires at least one argument")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","where","parser/where",-966053850),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
} else {
if((args_STAR_ == null)){
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse rule-expr arguments, expected [ (variable | constant | '_')+ ]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","where","parser/where",-966053850),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
} else {
return (new datascript.parser.RuleExpr(source_STAR_,name_STAR_,args_STAR_,null,null,null));

}
}
} else {
return null;
}
} else {
return null;
}
});
datascript.parser.collect_vars_acc = (function datascript$parser$collect_vars_acc(acc,form){
if((form instanceof datascript.parser.Variable)){
return cljs.core.conj.call(null,acc,form);
} else {
if((form instanceof datascript.parser.Not)){
return cljs.core.into.call(null,acc,new cljs.core.Keyword(null,"vars","vars",-2046957217).cljs$core$IFn$_invoke$arity$1(form));
} else {
if((form instanceof datascript.parser.Or)){
return datascript.parser.collect_vars_acc.call(null,acc,new cljs.core.Keyword(null,"rule-vars","rule-vars",1665972520).cljs$core$IFn$_invoke$arity$1(form));
} else {
if(((!((form == null)))?(((false) || ((cljs.core.PROTOCOL_SENTINEL === form.datascript$parser$ITraversable$)))?true:(((!form.cljs$lang$protocol_mask$partition$))?cljs.core.native_satisfies_QMARK_.call(null,datascript.parser.ITraversable,form):false)):cljs.core.native_satisfies_QMARK_.call(null,datascript.parser.ITraversable,form))){
return datascript.parser._collect_vars.call(null,form,acc);
} else {
if(cljs.core.sequential_QMARK_.call(null,form)){
return cljs.core.reduce.call(null,datascript.parser.collect_vars_acc,acc,form);
} else {
return acc;

}
}
}
}
}
});
datascript.parser.collect_vars = (function datascript$parser$collect_vars(form){
return datascript.parser.collect_vars_acc.call(null,cljs.core.PersistentVector.EMPTY,form);
});
datascript.parser.collect_vars_distinct = (function datascript$parser$collect_vars_distinct(form){
return cljs.core.vec.call(null,cljs.core.distinct.call(null,datascript.parser.collect_vars.call(null,form)));
});
datascript.parser.validate_join_vars = (function datascript$parser$validate_join_vars(vars,clauses,form){
var undeclared_24492 = clojure.set.difference.call(null,cljs.core.set.call(null,vars),cljs.core.set.call(null,datascript.parser.collect_vars.call(null,clauses)));
if(cljs.core.empty_QMARK_.call(null,undeclared_24492)){
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Join variable not declared inside clauses: "),cljs.core.str(cljs.core.pr_str.call(null,cljs.core.mapv.call(null,new cljs.core.Keyword(null,"symbol","symbol",-1038572696),undeclared_24492)))].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","where","parser/where",-966053850),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}

if(cljs.core.empty_QMARK_.call(null,vars)){
throw cljs.core.ex_info.call(null,[cljs.core.str("Join variables should not be empty")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","where","parser/where",-966053850),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
} else {
return null;
}
});
datascript.parser.validate_not = (function datascript$parser$validate_not(clause,form){
datascript.parser.validate_join_vars.call(null,new cljs.core.Keyword(null,"vars","vars",-2046957217).cljs$core$IFn$_invoke$arity$1(clause),new cljs.core.Keyword(null,"clauses","clauses",1454841241).cljs$core$IFn$_invoke$arity$1(clause),form);

return clause;
});
datascript.parser.parse_not = (function datascript$parser$parse_not(form){
var temp__4657__auto__ = datascript.parser.take_source.call(null,form);
if(cljs.core.truth_(temp__4657__auto__)){
var vec__24499 = temp__4657__auto__;
var source_STAR_ = cljs.core.nth.call(null,vec__24499,(0),null);
var next_form = cljs.core.nth.call(null,vec__24499,(1),null);
var vec__24502 = next_form;
var seq__24503 = cljs.core.seq.call(null,vec__24502);
var first__24504 = cljs.core.first.call(null,seq__24503);
var seq__24503__$1 = cljs.core.next.call(null,seq__24503);
var sym = first__24504;
var clauses = seq__24503__$1;
if(cljs.core._EQ_.call(null,new cljs.core.Symbol(null,"not","not",1044554643,null),sym)){
var temp__4655__auto__ = datascript.parser.parse_clauses.call(null,clauses);
if(cljs.core.truth_(temp__4655__auto__)){
var clauses_STAR_ = temp__4655__auto__;
return datascript.parser.validate_not.call(null,datascript.parser.with_source.call(null,(new datascript.parser.Not(source_STAR_,datascript.parser.collect_vars_distinct.call(null,clauses_STAR_),clauses_STAR_,null,null,null)),form),form);
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse 'not' clause, expected [ src-var? 'not' clause+ ]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","where","parser/where",-966053850),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
} else {
return null;
}
} else {
return null;
}
});
datascript.parser.parse_not_join = (function datascript$parser$parse_not_join(form){
var temp__4657__auto__ = datascript.parser.take_source.call(null,form);
if(cljs.core.truth_(temp__4657__auto__)){
var vec__24511 = temp__4657__auto__;
var source_STAR_ = cljs.core.nth.call(null,vec__24511,(0),null);
var next_form = cljs.core.nth.call(null,vec__24511,(1),null);
var vec__24514 = next_form;
var seq__24515 = cljs.core.seq.call(null,vec__24514);
var first__24516 = cljs.core.first.call(null,seq__24515);
var seq__24515__$1 = cljs.core.next.call(null,seq__24515);
var sym = first__24516;
var first__24516__$1 = cljs.core.first.call(null,seq__24515__$1);
var seq__24515__$2 = cljs.core.next.call(null,seq__24515__$1);
var vars = first__24516__$1;
var clauses = seq__24515__$2;
if(cljs.core._EQ_.call(null,new cljs.core.Symbol(null,"not-join","not-join",-645515756,null),sym)){
var vars_STAR_ = datascript.parser.parse_seq.call(null,datascript.parser.parse_variable,vars);
var clauses_STAR_ = datascript.parser.parse_clauses.call(null,clauses);
if(cljs.core.truth_((function (){var and__15207__auto__ = vars_STAR_;
if(cljs.core.truth_(and__15207__auto__)){
return clauses_STAR_;
} else {
return and__15207__auto__;
}
})())){
return datascript.parser.validate_not.call(null,datascript.parser.with_source.call(null,(new datascript.parser.Not(source_STAR_,vars_STAR_,clauses_STAR_,null,null,null)),form),form);
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse 'not-join' clause, expected [ src-var? 'not-join' [variable+] clause+ ]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","where","parser/where",-966053850),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
} else {
return null;
}
} else {
return null;
}
});
datascript.parser.validate_or = (function datascript$parser$validate_or(clause,form){
var map__24525 = clause;
var map__24525__$1 = ((((!((map__24525 == null)))?((((map__24525.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__24525.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24525):map__24525);
var map__24526 = cljs.core.get.call(null,map__24525__$1,new cljs.core.Keyword(null,"rule-vars","rule-vars",1665972520));
var map__24526__$1 = ((((!((map__24526 == null)))?((((map__24526.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__24526.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24526):map__24526);
var required = cljs.core.get.call(null,map__24526__$1,new cljs.core.Keyword(null,"required","required",1807647006));
var free = cljs.core.get.call(null,map__24526__$1,new cljs.core.Keyword(null,"free","free",801364328));
var clauses = cljs.core.get.call(null,map__24525__$1,new cljs.core.Keyword(null,"clauses","clauses",1454841241));
var vars = cljs.core.concat.call(null,required,free);
var seq__24529_24533 = cljs.core.seq.call(null,clauses);
var chunk__24530_24534 = null;
var count__24531_24535 = (0);
var i__24532_24536 = (0);
while(true){
if((i__24532_24536 < count__24531_24535)){
var clause_24537__$1 = cljs.core._nth.call(null,chunk__24530_24534,i__24532_24536);
datascript.parser.validate_join_vars.call(null,vars,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [clause_24537__$1], null),form);

var G__24538 = seq__24529_24533;
var G__24539 = chunk__24530_24534;
var G__24540 = count__24531_24535;
var G__24541 = (i__24532_24536 + (1));
seq__24529_24533 = G__24538;
chunk__24530_24534 = G__24539;
count__24531_24535 = G__24540;
i__24532_24536 = G__24541;
continue;
} else {
var temp__4657__auto___24542 = cljs.core.seq.call(null,seq__24529_24533);
if(temp__4657__auto___24542){
var seq__24529_24543__$1 = temp__4657__auto___24542;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__24529_24543__$1)){
var c__16033__auto___24544 = cljs.core.chunk_first.call(null,seq__24529_24543__$1);
var G__24545 = cljs.core.chunk_rest.call(null,seq__24529_24543__$1);
var G__24546 = c__16033__auto___24544;
var G__24547 = cljs.core.count.call(null,c__16033__auto___24544);
var G__24548 = (0);
seq__24529_24533 = G__24545;
chunk__24530_24534 = G__24546;
count__24531_24535 = G__24547;
i__24532_24536 = G__24548;
continue;
} else {
var clause_24549__$1 = cljs.core.first.call(null,seq__24529_24543__$1);
datascript.parser.validate_join_vars.call(null,vars,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [clause_24549__$1], null),form);

var G__24550 = cljs.core.next.call(null,seq__24529_24543__$1);
var G__24551 = null;
var G__24552 = (0);
var G__24553 = (0);
seq__24529_24533 = G__24550;
chunk__24530_24534 = G__24551;
count__24531_24535 = G__24552;
i__24532_24536 = G__24553;
continue;
}
} else {
}
}
break;
}

return clause;
});
datascript.parser.parse_and = (function datascript$parser$parse_and(form){
if((cljs.core.sequential_QMARK_.call(null,form)) && (cljs.core._EQ_.call(null,new cljs.core.Symbol(null,"and","and",668631710,null),cljs.core.first.call(null,form)))){
var clauses_STAR_ = datascript.parser.parse_clauses.call(null,cljs.core.next.call(null,form));
if(cljs.core.truth_(cljs.core.not_empty.call(null,clauses_STAR_))){
return (new datascript.parser.And(clauses_STAR_,null,null,null));
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse 'and' clause, expected [ 'and' clause+ ]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","where","parser/where",-966053850),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
} else {
return null;
}
});
datascript.parser.parse_or = (function datascript$parser$parse_or(form){
var temp__4657__auto__ = datascript.parser.take_source.call(null,form);
if(cljs.core.truth_(temp__4657__auto__)){
var vec__24560 = temp__4657__auto__;
var source_STAR_ = cljs.core.nth.call(null,vec__24560,(0),null);
var next_form = cljs.core.nth.call(null,vec__24560,(1),null);
var vec__24563 = next_form;
var seq__24564 = cljs.core.seq.call(null,vec__24563);
var first__24565 = cljs.core.first.call(null,seq__24564);
var seq__24564__$1 = cljs.core.next.call(null,seq__24564);
var sym = first__24565;
var clauses = seq__24564__$1;
if(cljs.core._EQ_.call(null,new cljs.core.Symbol(null,"or","or",1876275696,null),sym)){
var temp__4655__auto__ = datascript.parser.parse_seq.call(null,cljs.core.some_fn.call(null,datascript.parser.parse_and,datascript.parser.parse_clause),clauses);
if(cljs.core.truth_(temp__4655__auto__)){
var clauses_STAR_ = temp__4655__auto__;
return datascript.parser.validate_or.call(null,datascript.parser.with_source.call(null,(new datascript.parser.Or(source_STAR_,(new datascript.parser.RuleVars(null,datascript.parser.collect_vars_distinct.call(null,clauses_STAR_),null,null,null)),clauses_STAR_,null,null,null)),form),form);
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse 'or' clause, expected [ src-var? 'or' clause+ ]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","where","parser/where",-966053850),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
} else {
return null;
}
} else {
return null;
}
});
datascript.parser.parse_or_join = (function datascript$parser$parse_or_join(form){
var temp__4657__auto__ = datascript.parser.take_source.call(null,form);
if(cljs.core.truth_(temp__4657__auto__)){
var vec__24572 = temp__4657__auto__;
var source_STAR_ = cljs.core.nth.call(null,vec__24572,(0),null);
var next_form = cljs.core.nth.call(null,vec__24572,(1),null);
var vec__24575 = next_form;
var seq__24576 = cljs.core.seq.call(null,vec__24575);
var first__24577 = cljs.core.first.call(null,seq__24576);
var seq__24576__$1 = cljs.core.next.call(null,seq__24576);
var sym = first__24577;
var first__24577__$1 = cljs.core.first.call(null,seq__24576__$1);
var seq__24576__$2 = cljs.core.next.call(null,seq__24576__$1);
var vars = first__24577__$1;
var clauses = seq__24576__$2;
if(cljs.core._EQ_.call(null,new cljs.core.Symbol(null,"or-join","or-join",591375469,null),sym)){
var vars_STAR_ = datascript.parser.parse_rule_vars.call(null,vars);
var clauses_STAR_ = datascript.parser.parse_seq.call(null,cljs.core.some_fn.call(null,datascript.parser.parse_and,datascript.parser.parse_clause),clauses);
if(cljs.core.truth_((function (){var and__15207__auto__ = vars_STAR_;
if(cljs.core.truth_(and__15207__auto__)){
return clauses_STAR_;
} else {
return and__15207__auto__;
}
})())){
return datascript.parser.validate_or.call(null,datascript.parser.with_source.call(null,(new datascript.parser.Or(source_STAR_,vars_STAR_,clauses_STAR_,null,null,null)),form),form);
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse 'or-join' clause, expected [ src-var? 'or-join' [variable+] clause+ ]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","where","parser/where",-966053850),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
} else {
return null;
}
} else {
return null;
}
});
datascript.parser.parse_clause = (function datascript$parser$parse_clause(form){
var or__15219__auto__ = datascript.parser.parse_not.call(null,form);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
var or__15219__auto____$1 = datascript.parser.parse_not_join.call(null,form);
if(cljs.core.truth_(or__15219__auto____$1)){
return or__15219__auto____$1;
} else {
var or__15219__auto____$2 = datascript.parser.parse_or.call(null,form);
if(cljs.core.truth_(or__15219__auto____$2)){
return or__15219__auto____$2;
} else {
var or__15219__auto____$3 = datascript.parser.parse_or_join.call(null,form);
if(cljs.core.truth_(or__15219__auto____$3)){
return or__15219__auto____$3;
} else {
var or__15219__auto____$4 = datascript.parser.parse_pred.call(null,form);
if(cljs.core.truth_(or__15219__auto____$4)){
return or__15219__auto____$4;
} else {
var or__15219__auto____$5 = datascript.parser.parse_fn.call(null,form);
if(cljs.core.truth_(or__15219__auto____$5)){
return or__15219__auto____$5;
} else {
var or__15219__auto____$6 = datascript.parser.parse_rule_expr.call(null,form);
if(cljs.core.truth_(or__15219__auto____$6)){
return or__15219__auto____$6;
} else {
var or__15219__auto____$7 = datascript.parser.parse_pattern.call(null,form);
if(cljs.core.truth_(or__15219__auto____$7)){
return or__15219__auto____$7;
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse clause, expected (data-pattern | pred-expr | fn-expr | rule-expr | not-clause | not-join-clause | or-clause | or-join-clause)")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","where","parser/where",-966053850),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
}
}
}
}
}
}
}
});
datascript.parser.parse_clauses = (function datascript$parser$parse_clauses(clauses){
return datascript.parser.parse_seq.call(null,datascript.parser.parse_clause,clauses);
});
datascript.parser.parse_where = (function datascript$parser$parse_where(form){
var or__15219__auto__ = datascript.parser.parse_clauses.call(null,form);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse :where clause, expected [clause+]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","where","parser/where",-966053850),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
});

/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.RuleBranch = (function (vars,clauses,__meta,__extmap,__hash){
this.vars = vars;
this.clauses = clauses;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.RuleBranch.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.RuleBranch.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24583,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24585 = (((k24583 instanceof cljs.core.Keyword))?k24583.fqn:null);
switch (G__24585) {
case "vars":
return self__.vars;

break;
case "clauses":
return self__.clauses;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24583,else__15844__auto__);

}
});

datascript.parser.RuleBranch.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.RuleBranch{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"vars","vars",-2046957217),self__.vars],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"clauses","clauses",1454841241),self__.clauses],null))], null),self__.__extmap));
});

datascript.parser.RuleBranch.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.RuleBranch.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24582){
var self__ = this;
var G__24582__$1 = this;
return (new cljs.core.RecordIter((0),G__24582__$1,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"vars","vars",-2046957217),new cljs.core.Keyword(null,"clauses","clauses",1454841241)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.RuleBranch.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.RuleBranch.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.RuleBranch(self__.vars,self__.clauses,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.RuleBranch.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (2 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.RuleBranch.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.RuleBranch.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.RuleBranch.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"clauses","clauses",1454841241),null,new cljs.core.Keyword(null,"vars","vars",-2046957217),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.RuleBranch(self__.vars,self__.clauses,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.RuleBranch.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24582){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24586 = cljs.core.keyword_identical_QMARK_;
var expr__24587 = k__15849__auto__;
if(cljs.core.truth_(pred__24586.call(null,new cljs.core.Keyword(null,"vars","vars",-2046957217),expr__24587))){
return (new datascript.parser.RuleBranch(G__24582,self__.clauses,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24586.call(null,new cljs.core.Keyword(null,"clauses","clauses",1454841241),expr__24587))){
return (new datascript.parser.RuleBranch(self__.vars,G__24582,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.RuleBranch(self__.vars,self__.clauses,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24582),null));
}
}
});

datascript.parser.RuleBranch.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"vars","vars",-2046957217),self__.vars],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"clauses","clauses",1454841241),self__.clauses],null))], null),self__.__extmap));
});

datascript.parser.RuleBranch.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24582){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.RuleBranch(self__.vars,self__.clauses,G__24582,self__.__extmap,self__.__hash));
});

datascript.parser.RuleBranch.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.RuleBranch.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.RuleBranch.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24579){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.RuleBranch(datascript.parser.postwalk.call(null,self__.vars,f24579),datascript.parser.postwalk.call(null,self__.clauses,f24579),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.RuleBranch.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24580,acc24581){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24580,self__.clauses,datascript.parser.collect.call(null,pred24580,self__.vars,acc24581));
});

datascript.parser.RuleBranch.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24581){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,acc24581,self__.vars),self__.clauses);
});

datascript.parser.RuleBranch.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"vars","vars",-406425690,null),new cljs.core.Symbol(null,"clauses","clauses",-1199594528,null)], null);
});

datascript.parser.RuleBranch.cljs$lang$type = true;

datascript.parser.RuleBranch.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/RuleBranch");
});

datascript.parser.RuleBranch.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/RuleBranch");
});

datascript.parser.__GT_RuleBranch = (function datascript$parser$__GT_RuleBranch(vars,clauses){
return (new datascript.parser.RuleBranch(vars,clauses,null,null,null));
});

datascript.parser.map__GT_RuleBranch = (function datascript$parser$map__GT_RuleBranch(G__24584){
return (new datascript.parser.RuleBranch(new cljs.core.Keyword(null,"vars","vars",-2046957217).cljs$core$IFn$_invoke$arity$1(G__24584),new cljs.core.Keyword(null,"clauses","clauses",1454841241).cljs$core$IFn$_invoke$arity$1(G__24584),null,cljs.core.dissoc.call(null,G__24584,new cljs.core.Keyword(null,"vars","vars",-2046957217),new cljs.core.Keyword(null,"clauses","clauses",1454841241)),null));
});


/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.Rule = (function (name,branches,__meta,__extmap,__hash){
this.name = name;
this.branches = branches;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.Rule.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.Rule.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24594,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24596 = (((k24594 instanceof cljs.core.Keyword))?k24594.fqn:null);
switch (G__24596) {
case "name":
return self__.name;

break;
case "branches":
return self__.branches;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24594,else__15844__auto__);

}
});

datascript.parser.Rule.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.Rule{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"name","name",1843675177),self__.name],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"branches","branches",-1240337268),self__.branches],null))], null),self__.__extmap));
});

datascript.parser.Rule.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Rule.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24593){
var self__ = this;
var G__24593__$1 = this;
return (new cljs.core.RecordIter((0),G__24593__$1,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"name","name",1843675177),new cljs.core.Keyword(null,"branches","branches",-1240337268)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.Rule.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.Rule.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.Rule(self__.name,self__.branches,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.Rule.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (2 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.Rule.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.Rule.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.Rule.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),null,new cljs.core.Keyword(null,"branches","branches",-1240337268),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.Rule(self__.name,self__.branches,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.Rule.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24593){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24597 = cljs.core.keyword_identical_QMARK_;
var expr__24598 = k__15849__auto__;
if(cljs.core.truth_(pred__24597.call(null,new cljs.core.Keyword(null,"name","name",1843675177),expr__24598))){
return (new datascript.parser.Rule(G__24593,self__.branches,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24597.call(null,new cljs.core.Keyword(null,"branches","branches",-1240337268),expr__24598))){
return (new datascript.parser.Rule(self__.name,G__24593,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.Rule(self__.name,self__.branches,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24593),null));
}
}
});

datascript.parser.Rule.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"name","name",1843675177),self__.name],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"branches","branches",-1240337268),self__.branches],null))], null),self__.__extmap));
});

datascript.parser.Rule.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24593){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.Rule(self__.name,self__.branches,G__24593,self__.__extmap,self__.__hash));
});

datascript.parser.Rule.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.Rule.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Rule.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24590){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.Rule(datascript.parser.postwalk.call(null,self__.name,f24590),datascript.parser.postwalk.call(null,self__.branches,f24590),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.Rule.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24591,acc24592){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24591,self__.branches,datascript.parser.collect.call(null,pred24591,self__.name,acc24592));
});

datascript.parser.Rule.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24592){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,acc24592,self__.name),self__.branches);
});

datascript.parser.Rule.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"name","name",-810760592,null),new cljs.core.Symbol(null,"branches","branches",400194259,null)], null);
});

datascript.parser.Rule.cljs$lang$type = true;

datascript.parser.Rule.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/Rule");
});

datascript.parser.Rule.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/Rule");
});

datascript.parser.__GT_Rule = (function datascript$parser$__GT_Rule(name,branches){
return (new datascript.parser.Rule(name,branches,null,null,null));
});

datascript.parser.map__GT_Rule = (function datascript$parser$map__GT_Rule(G__24595){
return (new datascript.parser.Rule(new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(G__24595),new cljs.core.Keyword(null,"branches","branches",-1240337268).cljs$core$IFn$_invoke$arity$1(G__24595),null,cljs.core.dissoc.call(null,G__24595,new cljs.core.Keyword(null,"name","name",1843675177),new cljs.core.Keyword(null,"branches","branches",-1240337268)),null));
});

datascript.parser.validate_vars = (function datascript$parser$validate_vars(vars,clauses,form){
var declared_vars = datascript.parser.collect.call(null,(function (p1__24601_SHARP_){
return (p1__24601_SHARP_ instanceof datascript.parser.Variable);
}),vars,cljs.core.PersistentHashSet.EMPTY);
var used_vars = datascript.parser.collect.call(null,((function (declared_vars){
return (function (p1__24602_SHARP_){
return (p1__24602_SHARP_ instanceof datascript.parser.Variable);
});})(declared_vars))
,clauses,cljs.core.PersistentHashSet.EMPTY);
var undeclared_vars = clojure.set.difference.call(null,used_vars,declared_vars);
if(cljs.core.empty_QMARK_.call(null,undeclared_vars)){
return null;
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Reference to the unknown variables: "),cljs.core.str(cljs.core.pr_str.call(null,cljs.core.map.call(null,new cljs.core.Keyword(null,"symbol","symbol",-1038572696),undeclared_vars)))].join(''),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","rule","parser/rule",-464044566),new cljs.core.Keyword(null,"form","form",-1624062471),form,new cljs.core.Keyword(null,"vars","vars",-2046957217),undeclared_vars], null));
}
});
datascript.parser.parse_rule = (function datascript$parser$parse_rule(form){
if(cljs.core.sequential_QMARK_.call(null,form)){
var vec__24609 = form;
var seq__24610 = cljs.core.seq.call(null,vec__24609);
var first__24611 = cljs.core.first.call(null,seq__24610);
var seq__24610__$1 = cljs.core.next.call(null,seq__24610);
var head = first__24611;
var clauses = seq__24610__$1;
if(cljs.core.sequential_QMARK_.call(null,head)){
var vec__24612 = head;
var seq__24613 = cljs.core.seq.call(null,vec__24612);
var first__24614 = cljs.core.first.call(null,seq__24613);
var seq__24613__$1 = cljs.core.next.call(null,seq__24613);
var name = first__24614;
var vars = seq__24613__$1;
var name_STAR_ = (function (){var or__15219__auto__ = datascript.parser.parse_plain_symbol.call(null,name);
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse rule name, expected plain-symbol")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","rule","parser/rule",-464044566),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
})();
var vars_STAR_ = datascript.parser.parse_rule_vars.call(null,vars);
var clauses_STAR_ = (function (){var or__15219__auto__ = cljs.core.not_empty.call(null,datascript.parser.parse_clauses.call(null,clauses));
if(cljs.core.truth_(or__15219__auto__)){
return or__15219__auto__;
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Rule branch should have clauses")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","rule","parser/rule",-464044566),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
})();
datascript.parser.validate_vars.call(null,vars_STAR_,clauses_STAR_,form);

return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"name","name",1843675177),name_STAR_,new cljs.core.Keyword(null,"vars","vars",-2046957217),vars_STAR_,new cljs.core.Keyword(null,"clauses","clauses",1454841241),clauses_STAR_], null);
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse rule head, expected [rule-name rule-vars]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","rule","parser/rule",-464044566),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Cannot parse rule, expected [rule-head clause+]")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","rule","parser/rule",-464044566),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}
});
datascript.parser.validate_arity = (function datascript$parser$validate_arity(name,branches){
var vars0 = new cljs.core.Keyword(null,"vars","vars",-2046957217).cljs$core$IFn$_invoke$arity$1(cljs.core.first.call(null,branches));
var arity0 = datascript.parser.rule_vars_arity.call(null,vars0);
var seq__24621 = cljs.core.seq.call(null,cljs.core.next.call(null,branches));
var chunk__24623 = null;
var count__24624 = (0);
var i__24625 = (0);
while(true){
if((i__24625 < count__24624)){
var b = cljs.core._nth.call(null,chunk__24623,i__24625);
var vars_24627 = new cljs.core.Keyword(null,"vars","vars",-2046957217).cljs$core$IFn$_invoke$arity$1(b);
if(cljs.core.not_EQ_.call(null,arity0,datascript.parser.rule_vars_arity.call(null,vars_24627))){
throw cljs.core.ex_info.call(null,[cljs.core.str("Arity mismatch for rule '"),cljs.core.str(cljs.core.pr_str.call(null,new cljs.core.Keyword(null,"symbol","symbol",-1038572696).cljs$core$IFn$_invoke$arity$1(name))),cljs.core.str("': "),cljs.core.str(cljs.core.pr_str.call(null,datascript.parser.flatten_rule_vars.call(null,vars0))),cljs.core.str(" vs. "),cljs.core.str(cljs.core.pr_str.call(null,datascript.parser.flatten_rule_vars.call(null,vars_24627)))].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","rule","parser/rule",-464044566),new cljs.core.Keyword(null,"rule","rule",729973257),name], null));
} else {
}

var G__24628 = seq__24621;
var G__24629 = chunk__24623;
var G__24630 = count__24624;
var G__24631 = (i__24625 + (1));
seq__24621 = G__24628;
chunk__24623 = G__24629;
count__24624 = G__24630;
i__24625 = G__24631;
continue;
} else {
var temp__4657__auto__ = cljs.core.seq.call(null,seq__24621);
if(temp__4657__auto__){
var seq__24621__$1 = temp__4657__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__24621__$1)){
var c__16033__auto__ = cljs.core.chunk_first.call(null,seq__24621__$1);
var G__24632 = cljs.core.chunk_rest.call(null,seq__24621__$1);
var G__24633 = c__16033__auto__;
var G__24634 = cljs.core.count.call(null,c__16033__auto__);
var G__24635 = (0);
seq__24621 = G__24632;
chunk__24623 = G__24633;
count__24624 = G__24634;
i__24625 = G__24635;
continue;
} else {
var b = cljs.core.first.call(null,seq__24621__$1);
var vars_24636 = new cljs.core.Keyword(null,"vars","vars",-2046957217).cljs$core$IFn$_invoke$arity$1(b);
if(cljs.core.not_EQ_.call(null,arity0,datascript.parser.rule_vars_arity.call(null,vars_24636))){
throw cljs.core.ex_info.call(null,[cljs.core.str("Arity mismatch for rule '"),cljs.core.str(cljs.core.pr_str.call(null,new cljs.core.Keyword(null,"symbol","symbol",-1038572696).cljs$core$IFn$_invoke$arity$1(name))),cljs.core.str("': "),cljs.core.str(cljs.core.pr_str.call(null,datascript.parser.flatten_rule_vars.call(null,vars0))),cljs.core.str(" vs. "),cljs.core.str(cljs.core.pr_str.call(null,datascript.parser.flatten_rule_vars.call(null,vars_24636)))].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","rule","parser/rule",-464044566),new cljs.core.Keyword(null,"rule","rule",729973257),name], null));
} else {
}

var G__24637 = cljs.core.next.call(null,seq__24621__$1);
var G__24638 = null;
var G__24639 = (0);
var G__24640 = (0);
seq__24621 = G__24637;
chunk__24623 = G__24638;
count__24624 = G__24639;
i__24625 = G__24640;
continue;
}
} else {
return null;
}
}
break;
}
});
datascript.parser.parse_rules = (function datascript$parser$parse_rules(form){
return cljs.core.vec.call(null,(function (){var iter__16002__auto__ = (function datascript$parser$parse_rules_$_iter__24658(s__24659){
return (new cljs.core.LazySeq(null,(function (){
var s__24659__$1 = s__24659;
while(true){
var temp__4657__auto__ = cljs.core.seq.call(null,s__24659__$1);
if(temp__4657__auto__){
var s__24659__$2 = temp__4657__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__24659__$2)){
var c__16000__auto__ = cljs.core.chunk_first.call(null,s__24659__$2);
var size__16001__auto__ = cljs.core.count.call(null,c__16000__auto__);
var b__24661 = cljs.core.chunk_buffer.call(null,size__16001__auto__);
if((function (){var i__24660 = (0);
while(true){
if((i__24660 < size__16001__auto__)){
var vec__24668 = cljs.core._nth.call(null,c__16000__auto__,i__24660);
var name = cljs.core.nth.call(null,vec__24668,(0),null);
var branches = cljs.core.nth.call(null,vec__24668,(1),null);
var branches__$1 = cljs.core.mapv.call(null,((function (i__24660,vec__24668,name,branches,c__16000__auto__,size__16001__auto__,b__24661,s__24659__$2,temp__4657__auto__){
return (function (p1__24641_SHARP_){
return (new datascript.parser.RuleBranch(new cljs.core.Keyword(null,"vars","vars",-2046957217).cljs$core$IFn$_invoke$arity$1(p1__24641_SHARP_),new cljs.core.Keyword(null,"clauses","clauses",1454841241).cljs$core$IFn$_invoke$arity$1(p1__24641_SHARP_),null,null,null));
});})(i__24660,vec__24668,name,branches,c__16000__auto__,size__16001__auto__,b__24661,s__24659__$2,temp__4657__auto__))
,branches);
cljs.core.chunk_append.call(null,b__24661,(function (){
datascript.parser.validate_arity.call(null,name,branches__$1);

return (new datascript.parser.Rule(name,branches__$1,null,null,null));
})()
);

var G__24674 = (i__24660 + (1));
i__24660 = G__24674;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__24661),datascript$parser$parse_rules_$_iter__24658.call(null,cljs.core.chunk_rest.call(null,s__24659__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__24661),null);
}
} else {
var vec__24671 = cljs.core.first.call(null,s__24659__$2);
var name = cljs.core.nth.call(null,vec__24671,(0),null);
var branches = cljs.core.nth.call(null,vec__24671,(1),null);
var branches__$1 = cljs.core.mapv.call(null,((function (vec__24671,name,branches,s__24659__$2,temp__4657__auto__){
return (function (p1__24641_SHARP_){
return (new datascript.parser.RuleBranch(new cljs.core.Keyword(null,"vars","vars",-2046957217).cljs$core$IFn$_invoke$arity$1(p1__24641_SHARP_),new cljs.core.Keyword(null,"clauses","clauses",1454841241).cljs$core$IFn$_invoke$arity$1(p1__24641_SHARP_),null,null,null));
});})(vec__24671,name,branches,s__24659__$2,temp__4657__auto__))
,branches);
return cljs.core.cons.call(null,(function (){
datascript.parser.validate_arity.call(null,name,branches__$1);

return (new datascript.parser.Rule(name,branches__$1,null,null,null));
})()
,datascript$parser$parse_rules_$_iter__24658.call(null,cljs.core.rest.call(null,s__24659__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__16002__auto__.call(null,cljs.core.group_by.call(null,new cljs.core.Keyword(null,"name","name",1843675177),datascript.parser.parse_seq.call(null,datascript.parser.parse_rule,form)));
})());
});

/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {datascript.parser.ITraversable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
datascript.parser.Query = (function (qfind,qwith,qin,qwhere,__meta,__extmap,__hash){
this.qfind = qfind;
this.qwith = qwith;
this.qin = qin;
this.qwhere = qwhere;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 8192;
})
datascript.parser.Query.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__15841__auto__,k__15842__auto__){
var self__ = this;
var this__15841__auto____$1 = this;
return cljs.core._lookup.call(null,this__15841__auto____$1,k__15842__auto__,null);
});

datascript.parser.Query.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__15843__auto__,k24679,else__15844__auto__){
var self__ = this;
var this__15843__auto____$1 = this;
var G__24681 = (((k24679 instanceof cljs.core.Keyword))?k24679.fqn:null);
switch (G__24681) {
case "qfind":
return self__.qfind;

break;
case "qwith":
return self__.qwith;

break;
case "qin":
return self__.qin;

break;
case "qwhere":
return self__.qwhere;

break;
default:
return cljs.core.get.call(null,self__.__extmap,k24679,else__15844__auto__);

}
});

datascript.parser.Query.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__15855__auto__,writer__15856__auto__,opts__15857__auto__){
var self__ = this;
var this__15855__auto____$1 = this;
var pr_pair__15858__auto__ = ((function (this__15855__auto____$1){
return (function (keyval__15859__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,cljs.core.pr_writer,""," ","",opts__15857__auto__,keyval__15859__auto__);
});})(this__15855__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__15856__auto__,pr_pair__15858__auto__,"#datascript.parser.Query{",", ","}",opts__15857__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"qfind","qfind",1529332972),self__.qfind],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"qwith","qwith",-45809392),self__.qwith],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"qin","qin",1372651151),self__.qin],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"qwhere","qwhere",-1645067378),self__.qwhere],null))], null),self__.__extmap));
});

datascript.parser.Query.prototype.cljs$core$IIterable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Query.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__24678){
var self__ = this;
var G__24678__$1 = this;
return (new cljs.core.RecordIter((0),G__24678__$1,4,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"qfind","qfind",1529332972),new cljs.core.Keyword(null,"qwith","qwith",-45809392),new cljs.core.Keyword(null,"qin","qin",1372651151),new cljs.core.Keyword(null,"qwhere","qwhere",-1645067378)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});

datascript.parser.Query.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__15839__auto__){
var self__ = this;
var this__15839__auto____$1 = this;
return self__.__meta;
});

datascript.parser.Query.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__15835__auto__){
var self__ = this;
var this__15835__auto____$1 = this;
return (new datascript.parser.Query(self__.qfind,self__.qwith,self__.qin,self__.qwhere,self__.__meta,self__.__extmap,self__.__hash));
});

datascript.parser.Query.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__15845__auto__){
var self__ = this;
var this__15845__auto____$1 = this;
return (4 + cljs.core.count.call(null,self__.__extmap));
});

datascript.parser.Query.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__15836__auto__){
var self__ = this;
var this__15836__auto____$1 = this;
var h__15654__auto__ = self__.__hash;
if(!((h__15654__auto__ == null))){
return h__15654__auto__;
} else {
var h__15654__auto____$1 = cljs.core.hash_imap.call(null,this__15836__auto____$1);
self__.__hash = h__15654__auto____$1;

return h__15654__auto____$1;
}
});

datascript.parser.Query.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__15837__auto__,other__15838__auto__){
var self__ = this;
var this__15837__auto____$1 = this;
if(cljs.core.truth_((function (){var and__15207__auto__ = other__15838__auto__;
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = (this__15837__auto____$1.constructor === other__15838__auto__.constructor);
if(and__15207__auto____$1){
return cljs.core.equiv_map.call(null,this__15837__auto____$1,other__15838__auto__);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
return true;
} else {
return false;
}
});

datascript.parser.Query.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__15850__auto__,k__15851__auto__){
var self__ = this;
var this__15850__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"qfind","qfind",1529332972),null,new cljs.core.Keyword(null,"qwhere","qwhere",-1645067378),null,new cljs.core.Keyword(null,"qin","qin",1372651151),null,new cljs.core.Keyword(null,"qwith","qwith",-45809392),null], null), null),k__15851__auto__)){
return cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__15850__auto____$1),self__.__meta),k__15851__auto__);
} else {
return (new datascript.parser.Query(self__.qfind,self__.qwith,self__.qin,self__.qwhere,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__15851__auto__)),null));
}
});

datascript.parser.Query.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__15848__auto__,k__15849__auto__,G__24678){
var self__ = this;
var this__15848__auto____$1 = this;
var pred__24682 = cljs.core.keyword_identical_QMARK_;
var expr__24683 = k__15849__auto__;
if(cljs.core.truth_(pred__24682.call(null,new cljs.core.Keyword(null,"qfind","qfind",1529332972),expr__24683))){
return (new datascript.parser.Query(G__24678,self__.qwith,self__.qin,self__.qwhere,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24682.call(null,new cljs.core.Keyword(null,"qwith","qwith",-45809392),expr__24683))){
return (new datascript.parser.Query(self__.qfind,G__24678,self__.qin,self__.qwhere,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24682.call(null,new cljs.core.Keyword(null,"qin","qin",1372651151),expr__24683))){
return (new datascript.parser.Query(self__.qfind,self__.qwith,G__24678,self__.qwhere,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_(pred__24682.call(null,new cljs.core.Keyword(null,"qwhere","qwhere",-1645067378),expr__24683))){
return (new datascript.parser.Query(self__.qfind,self__.qwith,self__.qin,G__24678,self__.__meta,self__.__extmap,null));
} else {
return (new datascript.parser.Query(self__.qfind,self__.qwith,self__.qin,self__.qwhere,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__15849__auto__,G__24678),null));
}
}
}
}
});

datascript.parser.Query.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__15853__auto__){
var self__ = this;
var this__15853__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"qfind","qfind",1529332972),self__.qfind],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"qwith","qwith",-45809392),self__.qwith],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"qin","qin",1372651151),self__.qin],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"qwhere","qwhere",-1645067378),self__.qwhere],null))], null),self__.__extmap));
});

datascript.parser.Query.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__15840__auto__,G__24678){
var self__ = this;
var this__15840__auto____$1 = this;
return (new datascript.parser.Query(self__.qfind,self__.qwith,self__.qin,self__.qwhere,G__24678,self__.__extmap,self__.__hash));
});

datascript.parser.Query.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__15846__auto__,entry__15847__auto__){
var self__ = this;
var this__15846__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__15847__auto__)){
return cljs.core._assoc.call(null,this__15846__auto____$1,cljs.core._nth.call(null,entry__15847__auto__,(0)),cljs.core._nth.call(null,entry__15847__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__15846__auto____$1,entry__15847__auto__);
}
});

datascript.parser.Query.prototype.datascript$parser$ITraversable$ = cljs.core.PROTOCOL_SENTINEL;

datascript.parser.Query.prototype.datascript$parser$ITraversable$_postwalk$arity$2 = (function (this__19936__auto__,f24675){
var self__ = this;
var this__19936__auto____$1 = this;
var new__19937__auto__ = (new datascript.parser.Query(datascript.parser.postwalk.call(null,self__.qfind,f24675),datascript.parser.postwalk.call(null,self__.qwith,f24675),datascript.parser.postwalk.call(null,self__.qin,f24675),datascript.parser.postwalk.call(null,self__.qwhere,f24675),null,null,null));
var temp__4655__auto__ = cljs.core.meta.call(null,this__19936__auto____$1);
if(cljs.core.truth_(temp__4655__auto__)){
var meta__19938__auto__ = temp__4655__auto__;
return cljs.core.with_meta.call(null,new__19937__auto__,meta__19938__auto__);
} else {
return new__19937__auto__;
}
});

datascript.parser.Query.prototype.datascript$parser$ITraversable$_collect$arity$3 = (function (___19939__auto__,pred24676,acc24677){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect.call(null,pred24676,self__.qwhere,datascript.parser.collect.call(null,pred24676,self__.qin,datascript.parser.collect.call(null,pred24676,self__.qwith,datascript.parser.collect.call(null,pred24676,self__.qfind,acc24677))));
});

datascript.parser.Query.prototype.datascript$parser$ITraversable$_collect_vars$arity$2 = (function (___19939__auto__,acc24677){
var self__ = this;
var ___19939__auto____$1 = this;
return datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,datascript.parser.collect_vars_acc.call(null,acc24677,self__.qfind),self__.qwith),self__.qin),self__.qwhere);
});

datascript.parser.Query.getBasis = (function (){
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"qfind","qfind",-1125102797,null),new cljs.core.Symbol(null,"qwith","qwith",1594722135,null),new cljs.core.Symbol(null,"qin","qin",-1281784618,null),new cljs.core.Symbol(null,"qwhere","qwhere",-4535851,null)], null);
});

datascript.parser.Query.cljs$lang$type = true;

datascript.parser.Query.cljs$lang$ctorPrSeq = (function (this__15875__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"datascript.parser/Query");
});

datascript.parser.Query.cljs$lang$ctorPrWriter = (function (this__15875__auto__,writer__15876__auto__){
return cljs.core._write.call(null,writer__15876__auto__,"datascript.parser/Query");
});

datascript.parser.__GT_Query = (function datascript$parser$__GT_Query(qfind,qwith,qin,qwhere){
return (new datascript.parser.Query(qfind,qwith,qin,qwhere,null,null,null));
});

datascript.parser.map__GT_Query = (function datascript$parser$map__GT_Query(G__24680){
return (new datascript.parser.Query(new cljs.core.Keyword(null,"qfind","qfind",1529332972).cljs$core$IFn$_invoke$arity$1(G__24680),new cljs.core.Keyword(null,"qwith","qwith",-45809392).cljs$core$IFn$_invoke$arity$1(G__24680),new cljs.core.Keyword(null,"qin","qin",1372651151).cljs$core$IFn$_invoke$arity$1(G__24680),new cljs.core.Keyword(null,"qwhere","qwhere",-1645067378).cljs$core$IFn$_invoke$arity$1(G__24680),null,cljs.core.dissoc.call(null,G__24680,new cljs.core.Keyword(null,"qfind","qfind",1529332972),new cljs.core.Keyword(null,"qwith","qwith",-45809392),new cljs.core.Keyword(null,"qin","qin",1372651151),new cljs.core.Keyword(null,"qwhere","qwhere",-1645067378)),null));
});

datascript.parser.query__GT_map = (function datascript$parser$query__GT_map(query){
var parsed = cljs.core.PersistentArrayMap.EMPTY;
var key = null;
var qs = query;
while(true){
var temp__4655__auto__ = cljs.core.first.call(null,qs);
if(cljs.core.truth_(temp__4655__auto__)){
var q = temp__4655__auto__;
if((q instanceof cljs.core.Keyword)){
var G__24686 = parsed;
var G__24687 = q;
var G__24688 = cljs.core.next.call(null,qs);
parsed = G__24686;
key = G__24687;
qs = G__24688;
continue;
} else {
var G__24689 = cljs.core.update_in.call(null,parsed,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [key], null),cljs.core.fnil.call(null,cljs.core.conj,cljs.core.PersistentVector.EMPTY),q);
var G__24690 = key;
var G__24691 = cljs.core.next.call(null,qs);
parsed = G__24689;
key = G__24690;
qs = G__24691;
continue;
}
} else {
return parsed;
}
break;
}
});
datascript.parser.validate_query = (function datascript$parser$validate_query(q,form){
var find_vars_24698 = cljs.core.set.call(null,datascript.parser.collect_vars.call(null,new cljs.core.Keyword(null,"qfind","qfind",1529332972).cljs$core$IFn$_invoke$arity$1(q)));
var with_vars_24699 = cljs.core.set.call(null,new cljs.core.Keyword(null,"qwith","qwith",-45809392).cljs$core$IFn$_invoke$arity$1(q));
var in_vars_24700 = cljs.core.set.call(null,datascript.parser.collect_vars.call(null,new cljs.core.Keyword(null,"qin","qin",1372651151).cljs$core$IFn$_invoke$arity$1(q)));
var where_vars_24701 = cljs.core.set.call(null,datascript.parser.collect_vars.call(null,new cljs.core.Keyword(null,"qwhere","qwhere",-1645067378).cljs$core$IFn$_invoke$arity$1(q)));
var unknown_24702 = clojure.set.difference.call(null,clojure.set.union.call(null,find_vars_24698,with_vars_24699),clojure.set.union.call(null,where_vars_24701,in_vars_24700));
var shared_24703 = clojure.set.intersection.call(null,find_vars_24698,with_vars_24699);
if(cljs.core.empty_QMARK_.call(null,unknown_24702)){
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Query for unknown vars: "),cljs.core.str(cljs.core.pr_str.call(null,cljs.core.mapv.call(null,new cljs.core.Keyword(null,"symbol","symbol",-1038572696),unknown_24702)))].join(''),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","query","parser/query",1877320671),new cljs.core.Keyword(null,"vars","vars",-2046957217),unknown_24702,new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}

if(cljs.core.empty_QMARK_.call(null,shared_24703)){
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str(":in and :with should not use same variables: "),cljs.core.str(cljs.core.pr_str.call(null,cljs.core.mapv.call(null,new cljs.core.Keyword(null,"symbol","symbol",-1038572696),shared_24703)))].join(''),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","query","parser/query",1877320671),new cljs.core.Keyword(null,"vars","vars",-2046957217),shared_24703,new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}

var in_vars_24704 = datascript.parser.collect_vars.call(null,new cljs.core.Keyword(null,"qin","qin",1372651151).cljs$core$IFn$_invoke$arity$1(q));
var in_sources_24705 = datascript.parser.collect.call(null,((function (in_vars_24704){
return (function (p1__24692_SHARP_){
return (p1__24692_SHARP_ instanceof datascript.parser.SrcVar);
});})(in_vars_24704))
,new cljs.core.Keyword(null,"qin","qin",1372651151).cljs$core$IFn$_invoke$arity$1(q));
var in_rules_24706 = datascript.parser.collect.call(null,((function (in_vars_24704,in_sources_24705){
return (function (p1__24693_SHARP_){
return (p1__24693_SHARP_ instanceof datascript.parser.RulesVar);
});})(in_vars_24704,in_sources_24705))
,new cljs.core.Keyword(null,"qin","qin",1372651151).cljs$core$IFn$_invoke$arity$1(q));
if(cljs.core.truth_((function (){var and__15207__auto__ = datascript.parser.distinct_QMARK_.call(null,in_vars_24704);
if(cljs.core.truth_(and__15207__auto__)){
var and__15207__auto____$1 = datascript.parser.distinct_QMARK_.call(null,in_sources_24705);
if(cljs.core.truth_(and__15207__auto____$1)){
return datascript.parser.distinct_QMARK_.call(null,in_rules_24706);
} else {
return and__15207__auto____$1;
}
} else {
return and__15207__auto__;
}
})())){
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Vars used in :in should be distinct")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","query","parser/query",1877320671),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}

var with_vars_24707 = datascript.parser.collect_vars.call(null,new cljs.core.Keyword(null,"qwith","qwith",-45809392).cljs$core$IFn$_invoke$arity$1(q));
if(cljs.core.truth_(datascript.parser.distinct_QMARK_.call(null,with_vars_24707))){
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Vars used in :with should be distinct")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","query","parser/query",1877320671),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}

var in_sources_24708 = datascript.parser.collect.call(null,(function (p1__24694_SHARP_){
return (p1__24694_SHARP_ instanceof datascript.parser.SrcVar);
}),new cljs.core.Keyword(null,"qin","qin",1372651151).cljs$core$IFn$_invoke$arity$1(q),cljs.core.PersistentHashSet.EMPTY);
var where_sources_24709 = datascript.parser.collect.call(null,((function (in_sources_24708){
return (function (p1__24695_SHARP_){
return (p1__24695_SHARP_ instanceof datascript.parser.SrcVar);
});})(in_sources_24708))
,new cljs.core.Keyword(null,"qwhere","qwhere",-1645067378).cljs$core$IFn$_invoke$arity$1(q),cljs.core.PersistentHashSet.EMPTY);
var unknown_24710 = clojure.set.difference.call(null,where_sources_24709,in_sources_24708);
if(cljs.core.empty_QMARK_.call(null,unknown_24710)){
} else {
throw cljs.core.ex_info.call(null,[cljs.core.str("Where uses unknown source vars: "),cljs.core.str(cljs.core.pr_str.call(null,cljs.core.mapv.call(null,new cljs.core.Keyword(null,"symbol","symbol",-1038572696),unknown_24710)))].join(''),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","query","parser/query",1877320671),new cljs.core.Keyword(null,"vars","vars",-2046957217),unknown_24710,new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
}

var rule_exprs = datascript.parser.collect.call(null,(function (p1__24696_SHARP_){
return (p1__24696_SHARP_ instanceof datascript.parser.RuleExpr);
}),new cljs.core.Keyword(null,"qwhere","qwhere",-1645067378).cljs$core$IFn$_invoke$arity$1(q));
var rules_vars = datascript.parser.collect.call(null,((function (rule_exprs){
return (function (p1__24697_SHARP_){
return (p1__24697_SHARP_ instanceof datascript.parser.RulesVar);
});})(rule_exprs))
,new cljs.core.Keyword(null,"qin","qin",1372651151).cljs$core$IFn$_invoke$arity$1(q));
if((!(cljs.core.empty_QMARK_.call(null,rule_exprs))) && (cljs.core.empty_QMARK_.call(null,rules_vars))){
throw cljs.core.ex_info.call(null,[cljs.core.str("Missing rules var '%' in :in")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","query","parser/query",1877320671),new cljs.core.Keyword(null,"form","form",-1624062471),form], null));
} else {
return null;
}
});
datascript.parser.parse_query = (function datascript$parser$parse_query(q){
var qm = ((cljs.core.map_QMARK_.call(null,q))?q:((cljs.core.sequential_QMARK_.call(null,q))?datascript.parser.query__GT_map.call(null,q):(function(){throw cljs.core.ex_info.call(null,[cljs.core.str("Query should be a vector or a map")].join(''),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"error","error",-978969032),new cljs.core.Keyword("parser","query","parser/query",1877320671),new cljs.core.Keyword(null,"form","form",-1624062471),q], null))})()
));
var res = datascript.parser.map__GT_Query.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"qfind","qfind",1529332972),datascript.parser.parse_find.call(null,new cljs.core.Keyword(null,"find","find",496279456).cljs$core$IFn$_invoke$arity$1(qm)),new cljs.core.Keyword(null,"qwith","qwith",-45809392),(function (){var temp__4657__auto__ = new cljs.core.Keyword(null,"with","with",-1536296876).cljs$core$IFn$_invoke$arity$1(qm);
if(cljs.core.truth_(temp__4657__auto__)){
var with$ = temp__4657__auto__;
return datascript.parser.parse_with.call(null,with$);
} else {
return null;
}
})(),new cljs.core.Keyword(null,"qin","qin",1372651151),datascript.parser.parse_in.call(null,new cljs.core.Keyword(null,"in","in",-1531184865).cljs$core$IFn$_invoke$arity$2(qm,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"$","$",-1580747756,null)], null))),new cljs.core.Keyword(null,"qwhere","qwhere",-1645067378),datascript.parser.parse_where.call(null,new cljs.core.Keyword(null,"where","where",-2044795965).cljs$core$IFn$_invoke$arity$2(qm,cljs.core.PersistentVector.EMPTY))], null));
datascript.parser.validate_query.call(null,res,q);

return res;
});

//# sourceMappingURL=parser.js.map