From 090ad77480ad8065aa051e625c248bc77e07efa5 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 2 Jan 2024 17:02:44 -0500 Subject: [PATCH] Update datascript for a dirty flag bug --- bb.edn | 4 +- lib/nbb_cljs_time.js | 124 +++++++++++++------------- lib/nbb_datascript.js | 134 ++++++++++++++-------------- lib/nbb_datascript_transit.js | 10 +-- lib/nbb_js_interop.js | 136 ++++++++++++++--------------- lib/nbb_promesa.js | 160 +++++++++++++++++----------------- lib/nbb_tools_cli.js | 40 ++++----- package-lock.json | 4 +- package.json | 2 +- 9 files changed, 307 insertions(+), 307 deletions(-) diff --git a/bb.edn b/bb.edn index 3464726..164a725 100644 --- a/bb.edn +++ b/bb.edn @@ -14,12 +14,12 @@ {:mvn/version "0.8.41"} datascript/deps {:git/url "https://github.com/logseq/nbb-features" - :git/sha "5530b80810d066a6dff2701ef1305478ec02fd31" + :git/sha "6d083f31c4aeafad5b0f40e9feb346b4cf77832a" :deps/root "features/datascript"} #_{:local/root "../nbb-features/features/datascript"} datascript-transit/deps {:git/url "https://github.com/logseq/nbb-features" - :git/sha "5530b80810d066a6dff2701ef1305478ec02fd31" + :git/sha "6d083f31c4aeafad5b0f40e9feb346b4cf77832a" :deps/root "features/datascript-transit"} #_{:local/root "../nbb-features/features/datascript-transit"} cljs-time/deps {:local/root "features/cljs-time"}} diff --git a/lib/nbb_cljs_time.js b/lib/nbb_cljs_time.js index 4e90fec..f07dec3 100644 --- a/lib/nbb_cljs_time.js +++ b/lib/nbb_cljs_time.js @@ -6,17 +6,17 @@ var Tpa=function(a,b){function c(){}c.prototype=b.prototype;a.Sk=b.prototype;a.p a.getMonth(),a.getDate()),bqa(this,a.getDate())):(this.Yi=new Date(Date.now()),a=this.Yi.getDate(),this.Yi.setHours(0),this.Yi.setMinutes(0),this.Yi.setSeconds(0),this.Yi.setMilliseconds(0),bqa(this,a)))},aqa=function(a,b,c){b=new Date(a,b,c);0<=a&&100>a&&b.setFullYear(b.getFullYear()-1900);return b},bqa=function(a,b){a.getDate()!=b&&a.Yi.setUTCHours(a.Yi.getUTCHours()+(a.getDate()=e:null,v=$APP.m(y)?$APP.m(e)?$APP.m(D)?fqa(y,e):D:e:$APP.m(e)?$APP.m(D)?eqa(e):D:e,J=$APP.m(h)?$APP.m(v)?1<=h&&h<=v:1<=h&&31>=h:null,P=$APP.m(A)?0<=A&&23>=A:null,W=$APP.m(b)?0<=b&&59>=b:null,Z=$APP.m(p)?0<=p&&60>=p:null,na=$APP.m(c)?0<=c&&999>=c:null,pa=$APP.m(t)?1<=t&&53>=t:null,sa=$APP.m(d)?1<=d&&7>=d:null;if($APP.Kh($APP.Te,$APP.Rq.h($APP.mb, -new $APP.H(null,8,5,$APP.I,[D,J,P,W,Z,na,pa,sa],null)))){if($APP.qb(function(){var Ba=$APP.m(y)?y:$APP.m(e)?e:h;return $APP.m(Ba)?$APP.m(l)?l:t:Ba}()))return a;throw $APP.Fp.h("Mixing year, month, day and week-year week-number fields",new $APP.g(null,3,[$APP.Im,JXa,KXa,a,$APP.QLa,$APP.uh],null));}throw $APP.Fp.h("Date is not valid",new $APP.g(null,3,[$APP.Im,JXa,KXa,a,$APP.QLa,function(){var Ba=$APP.uh;Ba=!1===D?$APP.K.j(Ba,C9,e):Ba;Ba=!1===J?$APP.K.j(Ba,E9,h):Ba;Ba=!1===P?$APP.K.j(Ba,K9,A):Ba;Ba= +new $APP.H(null,8,5,$APP.I,[D,J,P,W,Z,na,pa,sa],null)))){if($APP.qb(function(){var Ba=$APP.m(y)?y:$APP.m(e)?e:h;return $APP.m(Ba)?$APP.m(l)?l:t:Ba}()))return a;throw $APP.Fp.h("Mixing year, month, day and week-year week-number fields",new $APP.g(null,3,[$APP.Im,IXa,JXa,a,$APP.QLa,$APP.uh],null));}throw $APP.Fp.h("Date is not valid",new $APP.g(null,3,[$APP.Im,IXa,JXa,a,$APP.QLa,function(){var Ba=$APP.uh;Ba=!1===D?$APP.K.j(Ba,C9,e):Ba;Ba=!1===J?$APP.K.j(Ba,E9,h):Ba;Ba=!1===P?$APP.K.j(Ba,K9,A):Ba;Ba= !1===W?$APP.K.j(Ba,y9,b):Ba;Ba=!1===Z?$APP.K.j(Ba,G9,p):Ba;Ba=!1===na?$APP.K.j(Ba,A9,c):Ba;Ba=!1===pa?$APP.K.j(Ba,I9,t):Ba;return!1===sa?$APP.K.j(Ba,B9,d):Ba}()],null));},mqa=function(a,b){return $APP.x($APP.nA.h(function(c,d){return $APP.m(cqa($APP.F([d,b])))?c:null},a))},nqa=function(a){a=$APP.Wk.h(function(b){return b instanceof $APP.k||b instanceof $APP.r?$APP.n.g(b):b},a);return $APP.nh.j($APP.R3,"%s not implemented yet",a)},BL=function(a,b,c,d,e,h,l){this.Yi=new Date("number"===typeof a?Date.UTC(a, b||0,c||1,d||0,e||0,h||0,l||0):a?a.getTime():Date.now())},oqa=function(a){var b=new BL;b.setTime(a);return b},ZU=function(a){if(null!=a&&null!=a.tl)a=a.tl(a);else{var b=ZU[$APP.ca(null==a?null:a)];if(null!=b)a=b.g?b.g(a):b.call(null,a);else if(b=ZU._,null!=b)a=b.g?b.g(a):b.call(null,a);else throw $APP.Ab("DateTimeProtocol.year",a);}return a},aV=function(a){if(null!=a&&null!=a.sl)a=a.sl(a);else{var b=aV[$APP.ca(null==a?null:a)];if(null!=b)a=b.g?b.g(a):b.call(null,a);else if(b=aV._,null!=b)a=b.g?b.g(a): b.call(null,a);else throw $APP.Ab("DateTimeProtocol.month",a);}return a},bV=function(a){if(null!=a&&null!=a.ql)a=a.ql(a);else{var b=bV[$APP.ca(null==a?null:a)];if(null!=b)a=b.g?b.g(a):b.call(null,a);else if(b=bV._,null!=b)a=b.g?b.g(a):b.call(null,a);else throw $APP.Ab("DateTimeProtocol.day",a);}return a},hUa=function(a,b){if(null!=a&&null!=a.ul)a=a.ul(a,b);else{var c=hUa[$APP.ca(null==a?null:a)];if(null!=c)a=c.h?c.h(a,b):c.call(null,a,b);else if(c=hUa._,null!=c)a=c.h?c.h(a,b):c.call(null,a,b);else throw $APP.Ab("DateTimeProtocol.plus-", a);}return a},iUa=function(a,b){if(null!=a&&null!=a.ol)a=a.ol(a,b);else{var c=iUa[$APP.ca(null==a?null:a)];if(null!=c)a=c.h?c.h(a,b):c.call(null,a,b);else if(c=iUa._,null!=c)a=c.h?c.h(a,b):c.call(null,a,b);else throw $APP.Ab("DateTimeProtocol.minus-",a);}return a},hR=function(a,b,c,d,e,h,l,p,t,A,y){this.fk=a;this.dk=b;this.nl=c;this.gk=d;this.bk=e;this.ck=h;this.ek=l;this.ml=p;this.B=t;this.o=A;this.D=y;this.J=2230716170;this.N=139264},OTa=function(a){var b=$APP.cp.l(a,L9,$APP.F([C9,M9,E9,K9,y9,G9, A9]));b=$APP.Me(a)?$APP.In.h($APP.uh,b):b;return new hR(L9.g(a),C9.g(a),M9.g(a),E9.g(a),K9.g(a),y9.g(a),G9.g(a),A9.g(a),null,$APP.qh(b),null)},zUa=function(a){return function(b,c){function d(D,v,J){return $APP.m($APP.m(v)?J:v)?new wL(v,D.h?D.h(0,J):D.call(null,0,J)):null}c=c.clone();for(var e=$APP.u(a),h=null,l=0,p=0;;)if(p=b?new $APP.H(null,2,5,$APP.I,[parseInt($APP.nh.h($APP.n,$APP.ci.h(c,a))),$APP.S.h($APP.Yh.h(c, +c=$APP.B.h(b,e)?new $APP.H(null,2,5,$APP.I,[e,$APP.Ik.j(a,d,$APP.ie(a))],null):new $APP.H(null,2,5,$APP.I,[null,[$APP.n.g(c),$APP.n.g(a)].join("")],null);b=$APP.C.j(c,0,null);c=$APP.C.j(c,1,null);return $APP.m(b)?new $APP.H(null,2,5,$APP.I,[new $APP.H(null,2,5,$APP.I,[MXa,b],null),c],null):null},zqa=function(a,b,c){var d=tqa(function(e){return $APP.Fk(/\d/,e)},a);a=$APP.C.j(d,0,null);d=$APP.C.j(d,1,null);return $APP.ie(a)>=b?new $APP.H(null,2,5,$APP.I,[parseInt($APP.nh.h($APP.n,$APP.ci.h(c,a))),$APP.S.h($APP.Yh.h(c, a),d)],null):new $APP.H(null,2,5,$APP.I,[parseInt($APP.nh.h($APP.n,a)),d],null)},DL=function(a,b,c,d){c=zqa(a,c,d);a=$APP.C.j(c,0,null);c=$APP.C.j(c,1,null);return new $APP.H(null,2,5,$APP.I,[new $APP.H(null,2,5,$APP.I,[b,a],null),c],null)},Aqa=function(a,b){return function(c){return DL(c,L9,a,b)}},Bqa=function(a,b){return function(c){return DL(c,F9,a,b)}},Cqa=function(a){return function(b){return DL(b,I9,a,2)}},Dqa=function(){return function(a){return DL(a,C9,1,2)}},Eqa=function(a,b){return function(c){return DL(c, E9,a,b)}},Fqa=function(){return function(a){return DL(a,B9,1,2)}},Gqa=function(a){return function(b){return DL(b,K9,a,2)}},Hqa=function(a){return function(b){return DL(b,P9,a,2)}},Iqa=function(a){return function(b){return DL(b,y9,a,2)}},Jqa=function(a){return function(b){return DL(b,G9,a,2)}},Kqa=function(a,b){return function(c){var d=tqa(function(e){return $APP.Fk(/\d/,e)},c);c=$APP.C.j(d,0,null);d=$APP.C.j(d,1,null);d=$APP.ie(c)>=a?new $APP.H(null,2,5,$APP.I,[parseInt($APP.nh.h($APP.n,$APP.ci.h(3> b?b:3,c))),$APP.S.h($APP.Yh.h(b,c),d)],null):new $APP.H(null,2,5,$APP.I,[parseInt($APP.nh.h($APP.n,$APP.ci.h(3,c))),d],null);c=$APP.C.j(d,0,null);d=$APP.C.j(d,1,null);return new $APP.H(null,2,5,$APP.I,[new $APP.H(null,2,5,$APP.I,[A9,c],null),d],null)}},Lqa=function(a,b,c){b=60*parseInt(b,10)+parseInt(c,10);a=$APP.B.h(a,"+")?$APP.zw:$APP.Mz;return new $APP.H(null,2,5,$APP.I,[V9,new wL(Zpa,a.g?a.g(b):a.call(null,b))],null)},oN=function(a){return function(b){function c(A){var y=$APP.En.g($APP.ci.h(5, @@ -26,47 +26,47 @@ p)),D=$APP.Fk(/^(\d{2}):(\d{2})/,y);return $APP.m(D)?($APP.C.j(D,0,null),y=$APP. default:throw e();}}}},Oqa=function(){return function(a){a=$APP.di(2,a);var b=$APP.C.j(a,0,null),c=$APP.C.j(b,0,null);b=$APP.C.j(b,1,null);a=$APP.C.j(a,1,null);var d=[$APP.n.g(c),$APP.n.g(b)].join("");if($APP.m(function(){var e=new $APP.lk(null,new $APP.g(null,4,["AM",null,"am",null,"pm",null,"PM",null],null),null);return e.g?e.g(d):e.call(null,d)}()))a=new $APP.H(null,2,5,$APP.I,[d,a],null);else if($APP.m(function(){var e=new $APP.lk(null,new $APP.g(null,2,["a",null,"p",null],null),null);return e.g? e.g(c):e.call(null,c)}()))a=new $APP.H(null,2,5,$APP.I,[function(){var e=new $APP.g(null,2,["a","am","p","pm"],null);return e.g?e.g(c):e.call(null,c)}(),$APP.Fg(b,a)],null);else if($APP.m(function(){var e=new $APP.lk(null,new $APP.g(null,2,["A",null,"P",null],null),null);return e.g?e.g(c):e.call(null,c)}()))a=new $APP.H(null,2,5,$APP.I,[function(){var e=new $APP.g(null,2,["A","am","P","pm"],null);return e.g?e.g(c):e.call(null,c)}(),$APP.Fg(b,a)],null);else throw $APP.Fp.h(["Invalid meridiem format: ", d].join(""),new $APP.g(null,1,[$APP.Im,c$],null));b=a;a=$APP.C.j(b,0,null);b=$APP.C.j(b,1,null);return new $APP.H(null,2,5,$APP.I,[new $APP.H(null,2,5,$APP.I,[d$,$APP.Xk.g(a)],null),$APP.En.g(b)],null)}},Qqa=function(a,b,c){var d=$APP.S.h(c,$APP.Wk.h(function(l){return $APP.Ik.j(l,0,3)},c)),e=$APP.x($APP.Rq.h($APP.Pt.h($APP.rr.h($APP.B,a),$APP.ne),$APP.Wk.h(function(l){return new $APP.H(null,2,5,$APP.I,[l,qqa(a,$APP.Jk(["^",$APP.n.g(l)].join("")))],null)},d))),h=$APP.C.j(e,0,null);e=$APP.C.j(e,1, -null);if($APP.m(h))return new $APP.H(null,2,5,$APP.I,[new $APP.H(null,2,5,$APP.I,[b,$APP.Rf(mqa(d,h),$APP.ie(c))],null),e],null);throw $APP.Fp.h(["Could not parse ",$APP.sk(b)," name"].join(""),new $APP.g(null,4,[$APP.Im,c$,OXa,PXa,QXa,b,$APP.bga,e],null));},Sqa=function(){return function(a){return $APP.ap.j(Qqa(a,C9,Rqa),new $APP.H(null,2,5,$APP.I,[0,1],null),$APP.Ud)}},Uqa=function(){return function(a){var b=Qqa(a,B9,Tqa),c=$APP.C.j(b,0,null);a=$APP.C.j(c,0,null);c=$APP.C.j(c,1,null);b=$APP.C.j(b, -1,null);return new $APP.H(null,2,5,$APP.I,[new $APP.H(null,2,5,$APP.I,[a,$APP.B.h(c,0)?7:c],null),b],null)}},Wqa=function(a){var b=$APP.Jk($APP.nh.j($APP.n,"^",a));return function(c){c=$APP.En.g(c);var d=qqa(c,b);if($APP.B.h(c,d))throw $APP.Fp.h("Quoted text not found",new $APP.g(null,2,[$APP.Im,c$,$APP.aga,RXa],null));return new $APP.H(null,2,5,$APP.I,[new $APP.H(null,2,5,$APP.I,[LXa,a],null),d],null)}},Xqa=function(){return function(a){var b=yqa(a,"st");if($APP.m(b))return b;b=yqa(a,"nd");if($APP.m(b))return b; -b=yqa(a,"rd");return $APP.m(b)?b:yqa(a,"th")}},ara=function(a){var b=$APP.C.j(a,0,null);a=$APP.C.j(a,1,null);if($APP.B.h(b,MXa))switch(a){case "S":return Kqa(1,2);case "SSS":return Kqa(3,3);case "SSSS":return Kqa(1,9);case "s":return Jqa(1);case "ss":return Jqa(2);case "m":return Iqa(1);case "mm":return Iqa(2);case "h":return Gqa(1);case "hh":return Gqa(2);case "H":return Hqa(1);case "HH":return Hqa(2);case "d":return Eqa(1,2);case "dd":return Eqa(2,2);case "D":return Eqa(1,3);case "DD":return Eqa(2, +null);if($APP.m(h))return new $APP.H(null,2,5,$APP.I,[new $APP.H(null,2,5,$APP.I,[b,$APP.Rf(mqa(d,h),$APP.ie(c))],null),e],null);throw $APP.Fp.h(["Could not parse ",$APP.sk(b)," name"].join(""),new $APP.g(null,4,[$APP.Im,c$,NXa,OXa,PXa,b,$APP.bga,e],null));},Sqa=function(){return function(a){return $APP.ap.j(Qqa(a,C9,Rqa),new $APP.H(null,2,5,$APP.I,[0,1],null),$APP.Ud)}},Uqa=function(){return function(a){var b=Qqa(a,B9,Tqa),c=$APP.C.j(b,0,null);a=$APP.C.j(c,0,null);c=$APP.C.j(c,1,null);b=$APP.C.j(b, +1,null);return new $APP.H(null,2,5,$APP.I,[new $APP.H(null,2,5,$APP.I,[a,$APP.B.h(c,0)?7:c],null),b],null)}},Wqa=function(a){var b=$APP.Jk($APP.nh.j($APP.n,"^",a));return function(c){c=$APP.En.g(c);var d=qqa(c,b);if($APP.B.h(c,d))throw $APP.Fp.h("Quoted text not found",new $APP.g(null,2,[$APP.Im,c$,$APP.aga,QXa],null));return new $APP.H(null,2,5,$APP.I,[new $APP.H(null,2,5,$APP.I,[KXa,a],null),d],null)}},Xqa=function(){return function(a){var b=yqa(a,"st");if($APP.m(b))return b;b=yqa(a,"nd");if($APP.m(b))return b; +b=yqa(a,"rd");return $APP.m(b)?b:yqa(a,"th")}},ara=function(a){var b=$APP.C.j(a,0,null);a=$APP.C.j(a,1,null);if($APP.B.h(b,LXa))switch(a){case "S":return Kqa(1,2);case "SSS":return Kqa(3,3);case "SSSS":return Kqa(1,9);case "s":return Jqa(1);case "ss":return Jqa(2);case "m":return Iqa(1);case "mm":return Iqa(2);case "h":return Gqa(1);case "hh":return Gqa(2);case "H":return Hqa(1);case "HH":return Hqa(2);case "d":return Eqa(1,2);case "dd":return Eqa(2,2);case "D":return Eqa(1,3);case "DD":return Eqa(2, 3);case "DDD":return Eqa(3,3);case "M":return Dqa();case "MM":return Dqa();case "MMM":return Sqa();case "MMMM":return Sqa();case "y":return Aqa(1,4);case "yy":return Aqa(2,2);case "yyyy":return Aqa(4,4);case "Y":return Aqa(1,4);case "YY":return Aqa(2,2);case "YYYY":return Aqa(4,4);case "x":return Bqa(1,4);case "xx":return Bqa(2,2);case "xxxx":return Bqa(4,4);case "w":return Cqa(1);case "ww":return Cqa(2);case "E":return Uqa();case "EEE":return Uqa();case "EEEE":return Uqa();case "e":return Fqa(); -case "a":return Oqa();case "A":return Oqa();case "Z":return oN(SXa);case "ZZ":return oN(TXa);case "ZZZ":return oN(UXa);case "ZZZZ":return oN(UXa);case "z":return oN(UXa);case "zz":return oN(UXa);case "zzz":return oN(UXa);case "zzzz":return oN(VXa);case "o":return Xqa();default:throw $APP.Fp.h(["Illegal pattern component: ",$APP.n.g(a)].join(""),new $APP.g(null,1,[$APP.Im,WXa],null));}else return Wqa(a)},bra=function(a,b){a=$APP.Wk.h(ara,xqa(a));for(var c=$APP.u(a),d=$APP.x(c),e=$APP.z(c),h=$APP.qi, -l=b,p=a,t=h;;){var A=l,y=p,D=$APP.u(y),v=$APP.x(D),J=$APP.z(D),P=v,W=J,Z=t;l=function(na,pa,sa,Ba){return function(){return $APP.Fp.h(["Invalid format: ",$APP.n.g(b)," is malformed at ",$APP.yl.l($APP.F([Ba]))].join(""),new $APP.g(null,2,[$APP.Im,c$,OXa,XXa],null))}}(l,p,t,A,y,D,v,J,P,W,Z,b,a,a,c,d,e,d,e,h);if($APP.u(A)){if(null==P)throw l();p=P.g?P.g(A):P.call(null,A);l=$APP.C.j(p,0,null);p=$APP.C.j(p,1,null);Z=$APP.Cg.h(Z,l);l=p;p=W;t=Z}else{if($APP.m(P))throw l();return Z}}},cra=function(a,b){var c= +case "a":return Oqa();case "A":return Oqa();case "Z":return oN(RXa);case "ZZ":return oN(SXa);case "ZZZ":return oN(TXa);case "ZZZZ":return oN(TXa);case "z":return oN(TXa);case "zz":return oN(TXa);case "zzz":return oN(TXa);case "zzzz":return oN(UXa);case "o":return Xqa();default:throw $APP.Fp.h(["Illegal pattern component: ",$APP.n.g(a)].join(""),new $APP.g(null,1,[$APP.Im,VXa],null));}else return Wqa(a)},bra=function(a,b){a=$APP.Wk.h(ara,xqa(a));for(var c=$APP.u(a),d=$APP.x(c),e=$APP.z(c),h=$APP.qi, +l=b,p=a,t=h;;){var A=l,y=p,D=$APP.u(y),v=$APP.x(D),J=$APP.z(D),P=v,W=J,Z=t;l=function(na,pa,sa,Ba){return function(){return $APP.Fp.h(["Invalid format: ",$APP.n.g(b)," is malformed at ",$APP.yl.l($APP.F([Ba]))].join(""),new $APP.g(null,2,[$APP.Im,c$,NXa,WXa],null))}}(l,p,t,A,y,D,v,J,P,W,Z,b,a,a,c,d,e,d,e,h);if($APP.u(A)){if(null==P)throw l();p=P.g?P.g(A):P.call(null,A);l=$APP.C.j(p,0,null);p=$APP.C.j(p,1,null);Z=$APP.Cg.h(Z,l);l=p;p=W;t=Z}else{if($APP.m(P))throw l();return Z}}},cra=function(a,b){var c= (new yL).getYear(),d=c-$APP.Rf(c,100);a=$APP.m(a)?a:$APP.m(b)?b:0;return a<$APP.Rf(c-30+50,100)?a+d:a},dra=function(a){a=$APP.ph(a);var b=$APP.gf.h(a,F9),c=$APP.gf.h(a,I9),d=$APP.gf.h(a,B9);return $APP.m($APP.m(b)?c:b)?(b=new yL(b,0,4),b.add(new wL(0,0,7*(c-1))),b.add(new wL(0,0,($APP.m(d)?d:1)-($APP.Rf(b.getDay()-1,7)+1))),$APP.K.j($APP.K.j($APP.K.j(a,L9,b.getYear()),C9,b.getMonth()+1),E9,b.getDate())):a},gra=function(a,b,c){c=dra(lqa($APP.In.h($APP.uh,$APP.Rq.h($APP.Pt.h(new $APP.lk(null,new $APP.g(null, -1,[LXa,null],null),null),$APP.x),c))));c=$APP.ph(c);var d=$APP.gf.h(c,y9),e=$APP.gf.h(c,P9),h=$APP.gf.h(c,A9),l=$APP.gf.h(c,V9),p=$APP.gf.h(c,d$),t=$APP.gf.h(c,C9),A=$APP.gf.h(c,E9),y=$APP.gf.h(c,G9),D=$APP.gf.h(c,K9),v=$APP.gf.h(c,L9),J=cra(v,e$.g(b)),P=$APP.m(t)?t-1:null,W=$APP.m(p)?$APP.m(function(){var Z=new $APP.lk(null,new $APP.g(null,2,[YXa,null,ZXa,null],null),null);return Z.g?Z.g(p):Z.call(null,p)}())?function(){var Z=D+12;return $APP.B.h(Z,24)?12:Z}():$APP.B.h(D,12)?0:D:e;$APP.cp.l($APP.K.j(c, +1,[KXa,null],null),null),$APP.x),c))));c=$APP.ph(c);var d=$APP.gf.h(c,y9),e=$APP.gf.h(c,P9),h=$APP.gf.h(c,A9),l=$APP.gf.h(c,V9),p=$APP.gf.h(c,d$),t=$APP.gf.h(c,C9),A=$APP.gf.h(c,E9),y=$APP.gf.h(c,G9),D=$APP.gf.h(c,K9),v=$APP.gf.h(c,L9),J=cra(v,e$.g(b)),P=$APP.m(t)?t-1:null,W=$APP.m(p)?$APP.m(function(){var Z=new $APP.lk(null,new $APP.g(null,2,[XXa,null,YXa,null],null),null);return Z.g?Z.g(p):Z.call(null,p)}())?function(){var Z=D+12;return $APP.B.h(Z,24)?12:Z}():$APP.B.h(D,12)?0:D:e;$APP.cp.l($APP.K.j(c, K9,W),P9,$APP.F([d$]));b=l instanceof wL?l:new wL($pa,0);c=function(){var Z=a instanceof $APP.k?a.T:null;switch(Z){case "goog.date.Date":return new yL(J,P,A);case "goog.date.DateTime":return new AL(J,P,A,W,d,y,h);case "goog.date.UtcDateTime":return new BL(J,P,A,W,d,y,h);default:throw Error(["No matching clause: ",$APP.n.g(Z)].join(""));}}();c.add(b);return c},qN=function(a,b,c,d,e){c=1>d?$APP.n.g(c):[$APP.En.g($APP.ci.h(d-$APP.n.g(c).length,$APP.Qq.g("0"))),$APP.n.g(c)].join("");e=$APP.Ik.h(c,c.length- e);return new $APP.H(null,2,5,$APP.I,[[$APP.n.g(a),e].join(""),b],null)},hra=function(a){return function(b,c){return new $APP.H(null,2,5,$APP.I,[$APP.nh.j($APP.n,b,a),c],null)}},ira=function(a,b,c,d,e){var h=$APP.uf(function(){return $APP.m(e)?$APP.Wk.h(function(l){return $APP.Ik.j(l,0,3)},d):d}());return new $APP.H(null,2,5,$APP.I,[[$APP.n.g(a),$APP.n.g(h.g?h.g(c):h.call(null,c))].join(""),b],null)},jra=function(a){return function(b,c){return ira(b,c,c.getMonth(),Rqa,a)}},kra=function(a){return function(b, c){return ira(b,c,c.getDay(),Tqa,a)}},lra=function(a){return function(b,c){var d=c.getHours();d=$APP.m(a)?12>d?"AM":"PM":12>d?"am":"pm";return new $APP.H(null,2,5,$APP.I,[[$APP.n.g(b),d].join(""),c],null)}},mra=function(){return function(a,b){if(b instanceof BL){var c=$APP.I;a=$APP.n.g(a);var d=$APP.n,e=d.g;var h=b.getTimezoneOffset();if(0==h)h="Z";else{var l=Math.abs(h)/60,p=Math.floor(l);l=60*(l-p);h=(0a.nb){var b=a.Ne,c=a.Xh,d=a.Yh,e=a.ze;a=a.nb;var h=$APP.x(c),l=$APP.C.j(h,0,null);h=$APP.C.j(h,1,null);return new JW($APP.cp.h(b,h),$APP.cp.h(c,l),$APP.cp.h(d,h),e,a)}return a};MW=function(a,b,c){if(null!=a&&null!=a.Uh)a=a.Uh(a,b,c);else{var d=MW[$APP.ca(null==a?null:a)];if(null!=d)a=d.j?d.j(a,b,c):d.call(null,a,b,c);else if(d=MW._,null!=d)a=d.j?d.j(a,b,c):d.call(null,a,b,c);else throw $APP.Ab("ICache.-get",a);}return a}; OW=function(){var a=$APP.Wh(new JW($APP.uh,$APP.DA(),$APP.uh,0,100));if("undefined"===typeof datascript||"undefined"===typeof Zja||"undefined"===typeof lX)lX=function(b,c,d){this.nb=b;this.Sf=c;this.El=d;this.J=393216;this.N=0},lX.prototype.X=function(b,c){return new lX(this.nb,this.Sf,c)},lX.prototype.W=function(){return this.El},lX.prototype.Uh=function(b,c,d){b=$APP.gf.j($APP.q(this.Sf),c,null);if(null==b)return d=d.F?d.F():d.call(null),$APP.md(this.Sf,$APP.K.j($APP.q(this.Sf),c,d)),d;$APP.md(this.Sf, @@ -246,25 +246,25 @@ EQa=new $APP.r("datascript.storage","-\x3eStorageAdapter","datascript.storage/-\ xOa=new $APP.k(null,"max-addr","max-addr",1373100454);BOa=new $APP.k(null,"freeze-fn","freeze-fn",-575885995);GQa=new $APP.r("datascript.core","db-with","datascript.core/db-with",-1263574350,null);HQa=new $APP.k(null,"positional","positional",-203580463);IQa=new $APP.r(null,"db-with-tail","db-with-tail",-1072910014,null);RNa=new $APP.k(null,"ref-type","ref-type",-1367328851);w2=new $APP.k("db","unique","db/unique",329396388);KQa=new $APP.k("entity-id","syntax","entity-id/syntax",1921317045); AOa=new $APP.k(null,"eavt-metadata","eavt-metadata",-1384819842);p5=new $APP.k(null,"sources","sources",-321166424);LQa=new $APP.k("datascript.db","flush-tuples","datascript.db/flush-tuples",-797350002);Z5=new $APP.r(null,"tx-meta","tx-meta",-1495152575,null);JQa=new $APP.r(null,"delete-addrs","delete-addrs",742195107,null);yOa=new $APP.k(null,"aevt-metadata","aevt-metadata",-1844063817);N2=new $APP.k(null,"tx-meta","tx-meta",1159283194);MQa=new $APP.r(null,"pull-many","pull-many",1857679657,null); NQa=new $APP.r(null,"conn-from-db","conn-from-db",-184109372,null);PQa=new $APP.r(null,"ground","ground",-1460862835,null);OQa=new $APP.r("datascript","Datom","datascript/Datom",-901340080,null);x3=new $APP.k(null,"pattern","pattern",242135423);DOa=new $APP.k("parser","rule-var","parser/rule-var",-1584354459);QQa=new $APP.r("datascript.core","create-conn","datascript.core/create-conn",-768042587,null);SQa=new $APP.k(null,"new","new",-2085437848);XNa=new $APP.k(null,"index","index",-1531685915); -RQa=new $APP.r("datascript.core","empty-db","datascript.core/empty-db",-807971396,null);UQa=new $APP.r(null,"stddev","stddev",775056588,null);TQa=new $APP.r(null,"G__29104","G__29104",-1051005620,null);a6=new $APP.k(null,"entity-id","entity-id",1485898093);VQa=new $APP.r(null,"store-tail","store-tail",-757879320,null);WQa=new $APP.k("db","cas","db/cas",-451542322);XQa=new $APP.r("datascript.core","from-serializable","datascript.core/from-serializable",-1560031101,null); -$1=new $APP.k(null,"max-tx","max-tx",1119558339);H3=new $APP.k(null,"first-attr","first-attr",-1993039831);E3=new $APP.k(null,"ref?","ref?",1932693720);YQa=new $APP.r(null,"sum","sum",1777518341,null);b6=new $APP.k(null,"attr","attr",-604132353);D4=new $APP.k(null,"visitor","visitor",-1026865865);S5=new $APP.k(null,"elements","elements",657646735);ZQa=new $APP.k("datascript.impl.entity","nf","datascript.impl.entity/nf",-953741353);t5=new $APP.k("query","where","query/where",-1935159429); -$Qa=new $APP.r("datascript.storage","-store","datascript.storage/-store",-1879938067,null);T2=new $APP.k(null,"context","context",-830191113);aRa=new $APP.r("datascript.db","validate-schema","datascript.db/validate-schema",-783030261,null);bRa=new $APP.r("datascript.storage","store-impl!","datascript.storage/store-impl!",1553932187,null);cRa=new $APP.r(null,"!\x3d","!\x3d",-201205829,null);q5=new $APP.k(null,"rels","rels",1770187185); -eRa=new $APP.r("datascript.core","init-db","datascript.core/init-db",1493526573,null);J2=new $APP.k(null,"db-before","db-before",-553691536);fRa=new $APP.r(null,"adapter","adapter",444204808,null);Y2=new $APP.k("datascript.db","value-tempids","datascript.db/value-tempids",244806162);hOa=new $APP.k(null,"datom","datom",-371556090);VNa=new $APP.k(null,"strong","strong",269529E3);gOa=new $APP.k("transact","unique","transact/unique",-940992320); -kRa=new $APP.r("datascript.db","datom","datascript.db/datom",399198004,null);lRa=new $APP.k(null,"old","old",-1825222690);mRa=new $APP.k("db.pull","attr","db.pull/attr",-533298746);i6=new $APP.k(null,"db","db",993250759);nRa=new $APP.r("datascript.core","conn-from-db","datascript.core/conn-from-db",1590561228,null);wOa=new $APP.k("db.pull","wildcard","db.pull/wildcard",116316031);s2=new $APP.k(null,"pull-patterns","pull-patterns",-343695048); -oRa=new $APP.r("datascript.storage","restore","datascript.storage/restore",1486895617,null);pRa=new $APP.r(null,"init-db","init-db",-1059254491,null);qRa=new $APP.k(null,"dirty?","dirty?",-2059845846);rRa=new $APP.k(null,"internal-ctor","internal-ctor",937392560);sRa=new $APP.r(null,"datom-from-reader","datom-from-reader",1334075127,null);o5=new $APP.k(null,"variable","variable",-281346492);tRa=new $APP.r(null,"restore-conn","restore-conn",-1560700042,null); -uRa=new $APP.r(null,"transact!","transact!",817805717,null);aOa=new $APP.k("db","attrTuples","db/attrTuples",860541631);F3=new $APP.k(null,"component?","component?",407783990);HOa=new $APP.r(null,"$","$",-1580747756,null);JOa=new $APP.r(null,"aggregate","aggregate",-1142967327,null);V2=new $APP.k("db","add","db/add",235286841);u2=new $APP.k(null,"pull-attrs","pull-attrs",-974863177);FOa=new $APP.k("parser","binding","parser/binding",-346395752); -wRa=new $APP.r("datascript.db","datom-from-reader","datascript.db/datom-from-reader",2070683374,null);xRa=new $APP.r(null,"map-\x3eStorageAdapter","map-\x3eStorageAdapter",1827547664,null);c6=new $APP.k(null,"element","element",1974019749);INa=new $APP.k(null,"dirty","dirty",729553281);ARa=new $APP.r("datascript.storage","map-\x3eStorageAdapter","datascript.storage/map-\x3eStorageAdapter",1938064274,null);v6=new $APP.r(null,"DB","DB",1622874957,null); -yRa=new $APP.r(null,"get-some","get-some",409442058,null);zRa=new $APP.r(null,"avg","avg",1837937727,null);x6=new $APP.k(null,"unfiltered-db","unfiltered-db",-1363720391);G3=new $APP.k(null,"attrs","attrs",-2090668713);ZNa=new $APP.k(null,"components","components",-1073188942);r1=new $APP.k(null,"storage","storage",1867247511);BRa=new $APP.r(null,"StorageAdapter","StorageAdapter",106942083,null);MNa=new $APP.k(null,"branching-factor","branching-factor",1903198601); -CRa=new $APP.r(null,"create-conn","create-conn",2071410861,null);DRa=new $APP.r("datascript.storage","tail-addr","datascript.storage/tail-addr",1147435392,null);C3=new $APP.k(null,"xform","xform",-1725711008);MOa=new $APP.r(null,"not-join","not-join",-645515756,null);i5=new $APP.k(null,"qwith","qwith",-45809392);UOa=new $APP.k(null,"with","with",-1536296876);ERa=new $APP.r("datascript.core","datoms","datascript.core/datoms",961250077,null);EOa=new $APP.k("parser","rule-vars","parser/rule-vars",-1493174969); -FRa=new $APP.r("datascript.core","tx0","datascript.core/tx0",1432817831,null);GRa=new $APP.r("datascript.core","entity","datascript.core/entity",-1406213973,null);P3=new $APP.k(null,"reverse-attrs","reverse-attrs",630097702);E2=new $APP.k("schema","validation","schema/validation",1178447161);XOa=new $APP.k(null,"got","got",-1674745710);w6=new $APP.r(null,"Datom","Datom",1208901035,null);A3=new $APP.k(null,"reverse?","reverse?",-1672868474);WOa=new $APP.k("query","inputs","query/inputs",1042810394); -H2=new $APP.k("db","cardinality","db/cardinality",-104975659);HRa=new $APP.r(null,"serializable","serializable",1941609404,null);JRa=new $APP.r("datascript.db","db-from-reader","datascript.db/db-from-reader",266573302,null);IRa=new $APP.r(null,"count-distinct","count-distinct",-1566572514,null);KRa=new $APP.r("datascript.storage","storage","datascript.storage/storage",-366769060,null);LRa=new $APP.r(null,"listen!","listen!",-115577950,null); -MRa=new $APP.r("datascript.storage","IStorage","datascript.storage/IStorage",247541567,null);NRa=new $APP.r("datascript.storage","make-storage-adapter","datascript.storage/make-storage-adapter",521032624,null);PRa=new $APP.r(null,"db-with","db-with",233242042,null);ORa=new $APP.k("db.fn","call","db.fn/call",-151594418);QRa=new $APP.r(null,"force?","force?",-815397094,null);$Oa=new $APP.k(null,"prefix-clauses","prefix-clauses",1294180028);RRa=new $APP.k(null,"factory","factory",63933746); -SRa=new $APP.r(null,"touch","touch",-1158163300,null);TRa=new $APP.r("datascript.core","datom","datascript.core/datom",-1596234155,null);fOa=new $APP.k("db","current-tx","db/current-tx",1600722132);m1=new $APP.k(null,"address","address",559499426);URa=new $APP.r("datascript.core","restore-conn","datascript.core/restore-conn",-877528562,null);WRa=new $APP.r("datascript.storage","db-with-tail","datascript.storage/db-with-tail",-1156179008,null);VRa=new $APP.k(null,"operation","operation",-1267664310); -WNa=new $APP.k(null,"index-access","index-access",-1548960265);XRa=new $APP.r(null,"datascript.storage","datascript.storage",315947890,null);k5=new $APP.k(null,"qin","qin",1372651151);D6=new $APP.r(null,"storage","storage",-787188258,null);n5=new $APP.k(null,"symbols","symbols",1211743);YRa=new $APP.r(null,"squuid","squuid",-1898207797,null);t4=new $APP.k(null,"fragment","fragment",826775688);ZRa=new $APP.k("transaction","filtered","transaction/filtered",1699706605); -sOa=new $APP.k("datascript.db","internal","datascript.db/internal",-249301114);p2=new $APP.k(null,"rschema","rschema",-1196134054);$Ra=new $APP.r(null,"conn-from-datoms","conn-from-datoms",-1502002909,null);aSa=new $APP.r(null,"addr+data-seq","addr+data-seq",1516602343,null);dSa=new $APP.r(null,"store","store",-1142205747,null);bSa=new $APP.r(null,"median","median",-2084869638,null);cSa=new $APP.r("clojure.string","includes?","clojure.string/includes?",-1842146260,null); -eSa=new $APP.r(null,"restore","restore",1907703951,null);fSa=new $APP.r(null,"empty-db","empty-db",1486862004,null);P2=new $APP.k(null,"v","v",21465059);S2=new $APP.k("transact","syntax","transact/syntax",-299207078);F6=new $APP.r(null,"-restore","-restore",1124639208,null);ROa=new $APP.k(null,"find","find",496279456);Q2=new $APP.k(null,"a","a",-2123407586);hSa=new $APP.r("datascript","DB","datascript/DB",-487332776,null);uOa=new $APP.k(null,"*","*",-1294732318);h1=new $APP.k(null,"free","free",801364328); -gSa=new $APP.k("db.fn","cas","db.fn/cas",-379352172);LNa=new $APP.k(null,"shift","shift",997140064);iSa=new $APP.r(null,"tx0","tx0",-4656209,null);NOa=new $APP.k(null,"rule","rule",729973257);kSa=new $APP.r(null,"from-serializable","from-serializable",945516427,null);jSa=new $APP.r(null,"resolve-datom","resolve-datom",-294110827,null);lSa=new $APP.r(null,"datascript.storage.IStorage","datascript.storage.IStorage",348000814,null);nSa=new $APP.r(null,"IStorage","IStorage",668238001,null); -mSa=new $APP.r(null,"get-else","get-else",1312024065,null);w3=new $APP.k(null,"limit","limit",-1355822363);oSa=new $APP.r(null,"-\x3eStorageAdapter","-\x3eStorageAdapter",269379393,null);pSa=new $APP.r("datascript.core","pull-many","datascript.core/pull-many",394351057,null);vSa=new $APP.r(null,"Entity","Entity",1953938502,null);var Zja,lX;datascript={};Zja={};$APP.f=JW.prototype;$APP.f.U=function(a,b,c){return LW.j?LW.j(this,b,c):LW.call(null,this,b,c)};$APP.f.ja=function(a,b){return $APP.Yb(this.Ne,b)};$APP.f.ea=function(a,b){return $APP.Az(this.Ne,b,null)};$APP.f.M=function(a,b,c){return $APP.Az(this.Ne,b,c)};$APP.f.V=function(a,b,c){return $APP.Oc(this.Ne,b,c)};var xNa=Math.pow(2,31),e1=Math.pow(2,5),WY=e1/2,yNa=e1+WY>>>1,vNa=e1-1,wNa=$ja($APP.Wk.h(function(a){return Math.pow(2,a)},$APP.kr.j(0,52,5)));$APP.f=hX.prototype;$APP.f.$g=function(a,b){var c=this;lZ(this,$APP.ie(c.children));$APP.QA.g($APP.mA.h(function(d,e){var h=c.children[d];e=$APP.m(h)?(e=null==e)?e:h.Hl:h;return $APP.m(e)?(h=XY(h,b),c.Sb[d]=h):null},c.Sb));a=GX(b,this,c.gh);c.Hl=!1;return c.gh=a};$APP.f.ih=function(){var a=this.keys;return a[a.length-1]};$APP.f.Zh=function(){return this.keys.length}; +RQa=new $APP.r("datascript.core","empty-db","datascript.core/empty-db",-807971396,null);UQa=new $APP.r(null,"stddev","stddev",775056588,null);a6=new $APP.k(null,"entity-id","entity-id",1485898093);TQa=new $APP.r(null,"store-tail","store-tail",-757879320,null);WQa=new $APP.k("db","cas","db/cas",-451542322);VQa=new $APP.r("datascript.core","from-serializable","datascript.core/from-serializable",-1560031101,null);$1=new $APP.k(null,"max-tx","max-tx",1119558339); +H3=new $APP.k(null,"first-attr","first-attr",-1993039831);E3=new $APP.k(null,"ref?","ref?",1932693720);YQa=new $APP.r(null,"sum","sum",1777518341,null);b6=new $APP.k(null,"attr","attr",-604132353);D4=new $APP.k(null,"visitor","visitor",-1026865865);S5=new $APP.k(null,"elements","elements",657646735);ZQa=new $APP.k("datascript.impl.entity","nf","datascript.impl.entity/nf",-953741353);t5=new $APP.k("query","where","query/where",-1935159429); +XQa=new $APP.r("datascript.storage","-store","datascript.storage/-store",-1879938067,null);T2=new $APP.k(null,"context","context",-830191113);$Qa=new $APP.r("datascript.db","validate-schema","datascript.db/validate-schema",-783030261,null);aRa=new $APP.r("datascript.storage","store-impl!","datascript.storage/store-impl!",1553932187,null);cRa=new $APP.r(null,"!\x3d","!\x3d",-201205829,null);q5=new $APP.k(null,"rels","rels",1770187185); +bRa=new $APP.r("datascript.core","init-db","datascript.core/init-db",1493526573,null);J2=new $APP.k(null,"db-before","db-before",-553691536);eRa=new $APP.r(null,"adapter","adapter",444204808,null);Y2=new $APP.k("datascript.db","value-tempids","datascript.db/value-tempids",244806162);hOa=new $APP.k(null,"datom","datom",-371556090);VNa=new $APP.k(null,"strong","strong",269529E3);gOa=new $APP.k("transact","unique","transact/unique",-940992320); +fRa=new $APP.r("datascript.db","datom","datascript.db/datom",399198004,null);lRa=new $APP.k(null,"old","old",-1825222690);mRa=new $APP.k("db.pull","attr","db.pull/attr",-533298746);i6=new $APP.k(null,"db","db",993250759);kRa=new $APP.r("datascript.core","conn-from-db","datascript.core/conn-from-db",1590561228,null);wOa=new $APP.k("db.pull","wildcard","db.pull/wildcard",116316031);s2=new $APP.k(null,"pull-patterns","pull-patterns",-343695048); +nRa=new $APP.r("datascript.storage","restore","datascript.storage/restore",1486895617,null);oRa=new $APP.r(null,"init-db","init-db",-1059254491,null);pRa=new $APP.k(null,"internal-ctor","internal-ctor",937392560);qRa=new $APP.r(null,"datom-from-reader","datom-from-reader",1334075127,null);o5=new $APP.k(null,"variable","variable",-281346492);rRa=new $APP.r(null,"restore-conn","restore-conn",-1560700042,null);sRa=new $APP.r(null,"transact!","transact!",817805717,null); +aOa=new $APP.k("db","attrTuples","db/attrTuples",860541631);F3=new $APP.k(null,"component?","component?",407783990);HOa=new $APP.r(null,"$","$",-1580747756,null);JOa=new $APP.r(null,"aggregate","aggregate",-1142967327,null);V2=new $APP.k("db","add","db/add",235286841);u2=new $APP.k(null,"pull-attrs","pull-attrs",-974863177);FOa=new $APP.k("parser","binding","parser/binding",-346395752);tRa=new $APP.r("datascript.db","datom-from-reader","datascript.db/datom-from-reader",2070683374,null); +uRa=new $APP.r(null,"map-\x3eStorageAdapter","map-\x3eStorageAdapter",1827547664,null);c6=new $APP.k(null,"element","element",1974019749);INa=new $APP.k(null,"dirty","dirty",729553281);wRa=new $APP.r("datascript.storage","map-\x3eStorageAdapter","datascript.storage/map-\x3eStorageAdapter",1938064274,null);v6=new $APP.r(null,"DB","DB",1622874957,null);yRa=new $APP.r(null,"get-some","get-some",409442058,null);zRa=new $APP.r(null,"avg","avg",1837937727,null); +x6=new $APP.k(null,"unfiltered-db","unfiltered-db",-1363720391);G3=new $APP.k(null,"attrs","attrs",-2090668713);ZNa=new $APP.k(null,"components","components",-1073188942);r1=new $APP.k(null,"storage","storage",1867247511);xRa=new $APP.r(null,"StorageAdapter","StorageAdapter",106942083,null);MNa=new $APP.k(null,"branching-factor","branching-factor",1903198601);ARa=new $APP.r(null,"create-conn","create-conn",2071410861,null); +BRa=new $APP.r("datascript.storage","tail-addr","datascript.storage/tail-addr",1147435392,null);C3=new $APP.k(null,"xform","xform",-1725711008);MOa=new $APP.r(null,"not-join","not-join",-645515756,null);i5=new $APP.k(null,"qwith","qwith",-45809392);CRa=new $APP.r(null,"G__28482","G__28482",-348648009,null);UOa=new $APP.k(null,"with","with",-1536296876);DRa=new $APP.r("datascript.core","datoms","datascript.core/datoms",961250077,null);EOa=new $APP.k("parser","rule-vars","parser/rule-vars",-1493174969); +ERa=new $APP.r("datascript.core","tx0","datascript.core/tx0",1432817831,null);FRa=new $APP.r("datascript.core","entity","datascript.core/entity",-1406213973,null);P3=new $APP.k(null,"reverse-attrs","reverse-attrs",630097702);E2=new $APP.k("schema","validation","schema/validation",1178447161);XOa=new $APP.k(null,"got","got",-1674745710);w6=new $APP.r(null,"Datom","Datom",1208901035,null);A3=new $APP.k(null,"reverse?","reverse?",-1672868474);WOa=new $APP.k("query","inputs","query/inputs",1042810394); +H2=new $APP.k("db","cardinality","db/cardinality",-104975659);GRa=new $APP.r(null,"serializable","serializable",1941609404,null);HRa=new $APP.r("datascript.db","db-from-reader","datascript.db/db-from-reader",266573302,null);IRa=new $APP.r(null,"count-distinct","count-distinct",-1566572514,null);JRa=new $APP.r("datascript.storage","storage","datascript.storage/storage",-366769060,null);KRa=new $APP.r(null,"listen!","listen!",-115577950,null); +LRa=new $APP.r("datascript.storage","IStorage","datascript.storage/IStorage",247541567,null);MRa=new $APP.r("datascript.storage","make-storage-adapter","datascript.storage/make-storage-adapter",521032624,null);NRa=new $APP.r(null,"db-with","db-with",233242042,null);ORa=new $APP.k("db.fn","call","db.fn/call",-151594418);PRa=new $APP.r(null,"force?","force?",-815397094,null);$Oa=new $APP.k(null,"prefix-clauses","prefix-clauses",1294180028);QRa=new $APP.k(null,"factory","factory",63933746); +RRa=new $APP.r(null,"touch","touch",-1158163300,null);SRa=new $APP.r("datascript.core","datom","datascript.core/datom",-1596234155,null);fOa=new $APP.k("db","current-tx","db/current-tx",1600722132);m1=new $APP.k(null,"address","address",559499426);TRa=new $APP.r("datascript.core","restore-conn","datascript.core/restore-conn",-877528562,null);URa=new $APP.r("datascript.storage","db-with-tail","datascript.storage/db-with-tail",-1156179008,null);VRa=new $APP.k(null,"operation","operation",-1267664310); +WNa=new $APP.k(null,"index-access","index-access",-1548960265);WRa=new $APP.r(null,"datascript.storage","datascript.storage",315947890,null);k5=new $APP.k(null,"qin","qin",1372651151);D6=new $APP.r(null,"storage","storage",-787188258,null);n5=new $APP.k(null,"symbols","symbols",1211743);XRa=new $APP.r(null,"squuid","squuid",-1898207797,null);t4=new $APP.k(null,"fragment","fragment",826775688);YRa=new $APP.k("transaction","filtered","transaction/filtered",1699706605); +sOa=new $APP.k("datascript.db","internal","datascript.db/internal",-249301114);p2=new $APP.k(null,"rschema","rschema",-1196134054);ZRa=new $APP.r(null,"conn-from-datoms","conn-from-datoms",-1502002909,null);$Ra=new $APP.r(null,"addr+data-seq","addr+data-seq",1516602343,null);aSa=new $APP.r(null,"store","store",-1142205747,null);bSa=new $APP.r(null,"median","median",-2084869638,null);cSa=new $APP.r("clojure.string","includes?","clojure.string/includes?",-1842146260,null); +dSa=new $APP.r(null,"restore","restore",1907703951,null);eSa=new $APP.r(null,"empty-db","empty-db",1486862004,null);P2=new $APP.k(null,"v","v",21465059);S2=new $APP.k("transact","syntax","transact/syntax",-299207078);F6=new $APP.r(null,"-restore","-restore",1124639208,null);ROa=new $APP.k(null,"find","find",496279456);Q2=new $APP.k(null,"a","a",-2123407586);fSa=new $APP.r("datascript","DB","datascript/DB",-487332776,null);uOa=new $APP.k(null,"*","*",-1294732318);h1=new $APP.k(null,"free","free",801364328); +gSa=new $APP.k("db.fn","cas","db.fn/cas",-379352172);LNa=new $APP.k(null,"shift","shift",997140064);hSa=new $APP.r(null,"tx0","tx0",-4656209,null);NOa=new $APP.k(null,"rule","rule",729973257);iSa=new $APP.r(null,"from-serializable","from-serializable",945516427,null);jSa=new $APP.r(null,"resolve-datom","resolve-datom",-294110827,null);kSa=new $APP.r(null,"datascript.storage.IStorage","datascript.storage.IStorage",348000814,null);lSa=new $APP.r(null,"IStorage","IStorage",668238001,null); +mSa=new $APP.r(null,"get-else","get-else",1312024065,null);w3=new $APP.k(null,"limit","limit",-1355822363);nSa=new $APP.r(null,"-\x3eStorageAdapter","-\x3eStorageAdapter",269379393,null);oSa=new $APP.r("datascript.core","pull-many","datascript.core/pull-many",394351057,null);pSa=new $APP.r(null,"Entity","Entity",1953938502,null);var Zja,lX;datascript={};Zja={};$APP.f=JW.prototype;$APP.f.U=function(a,b,c){return LW.j?LW.j(this,b,c):LW.call(null,this,b,c)};$APP.f.ja=function(a,b){return $APP.Yb(this.Ne,b)};$APP.f.ea=function(a,b){return $APP.Az(this.Ne,b,null)};$APP.f.M=function(a,b,c){return $APP.Az(this.Ne,b,c)};$APP.f.V=function(a,b,c){return $APP.Oc(this.Ne,b,c)};var xNa=Math.pow(2,31),e1=Math.pow(2,5),WY=e1/2,yNa=e1+WY>>>1,vNa=e1-1,wNa=$ja($APP.Wk.h(function(a){return Math.pow(2,a)},$APP.kr.j(0,52,5)));$APP.f=hX.prototype;$APP.f.$g=function(a,b){var c=this;lZ(this,$APP.ie(c.children));$APP.QA.g($APP.mA.h(function(d,e){var h=c.children[d];e=$APP.m(h)?(e=null==e)?e:h.Hl:h;return $APP.m(e)?(h=XY(h,b),c.Sb[d]=h):null},c.Sb));a=GX(b,this,c.gh);c.Hl=!1;return c.gh=a};$APP.f.ih=function(){var a=this.keys;return a[a.length-1]};$APP.f.Zh=function(){return this.keys.length}; $APP.f.kh=function(a,b,c){lZ(this,$APP.ie(this.children));lZ(b,$APP.ie(b.children));a=b.gh;$APP.m(a)&&WR(c,new $APP.H(null,1,5,$APP.I,[a],null));return kX(this.keys.concat(b.keys),this.children.concat(b.children),this.Sb.concat(b.Sb),$APP.F([new $APP.g(null,1,[m1,this.gh],null)]))}; $APP.f.lh=function(a,b){lZ(this,$APP.ie(this.children));lZ(b,$APP.ie(b.children));a=WW(this.keys,b.keys);var c=WW(this.children,b.children),d=WW(this.Sb,b.Sb);return YW(kX(a[0],c[0],d[0],$APP.F([new $APP.g(null,1,[m1,this.gh],null)])),kX(a[1],c[1],d[1],$APP.F([new $APP.g(null,1,[m1,b.gh],null)])))};$APP.f.Yg=function(a,b){if($APP.B.h(-1,a))return null;var c=$APP.m(this.Sb)?this.Sb[a]:null;$APP.qb(this.children[a])?(b=FX(b,c),this.children[a]=b):$APP.m($APP.m(b)?c:b)&&uNa(b,c);return this.children[a]}; $APP.f.yl=function(a,b,c,d){a=TW(b,this.keys,c);a=this.Yg(a,d);return $APP.m(a)?dX(a,b,c,d):null}; @@ -479,12 +479,12 @@ $APP.f.V=function(a,b,c){return $APP.Lk(b,function(d){return $APP.Lk(b,$APP.Vk," $APP.f.Z=function(){return 1+$APP.ie(this.o)};$APP.f.Y=function(){var a=this.D;return null!=a?a:this.D=a=1627330428^$APP.Od(this)};$APP.f.R=function(a,b){return null!=b&&this.constructor===b.constructor&&$APP.B.h(this.storage,b.storage)&&$APP.B.h(this.o,b.o)};$APP.f.wa=function(a,b){return $APP.jf(new $APP.lk(null,new $APP.g(null,1,[r1,null],null),null),b)?$APP.cp.h($APP.tc($APP.In.h($APP.uh,this),this.B),b):new L4(this.storage,this.B,$APP.qh($APP.cp.h(this.o,b)),null)}; $APP.f.ja=function(a,b){switch(b instanceof $APP.k?b.T:null){case "storage":return!0;default:return $APP.jf(this.o,b)}};$APP.f.U=function(a,b,c){return $APP.m($APP.Ig.h?$APP.Ig.h(r1,b):$APP.Ig.call(null,r1,b))?new L4(c,this.B,this.o,null):new L4(this.storage,this.B,$APP.K.j(this.o,b,c),null)};$APP.f.aa=function(){return $APP.u($APP.S.h(new $APP.H(null,1,5,$APP.I,[new $APP.kf(r1,this.storage,null)],null),this.o))};$APP.f.X=function(a,b){return new L4(this.storage,b,this.o,this.D)}; $APP.f.da=function(a,b){return $APP.Ne(b)?this.U(null,$APP.ve(b,0),$APP.ve(b,1)):$APP.sf.j($APP.Pb,this,b)};$APP.f.Al=function(a,b,c){a=$APP.m($APP.m(c)?b instanceof hX&&$APP.jf($APP.qk(b.Sb),c):c)?R4.Mc(null,R4.Oa(null)+1):$APP.m(c)?c:R4.Mc(null,R4.Oa(null)+1);c=$APP.lq.h(iOa,b.keys);c=new $APP.g(null,1,[$APP.pD,c],null);b=b instanceof hX?$APP.K.j(c,gQa,b.Sb):c;$APP.md(P4,$APP.pi.h($APP.q(P4),new $APP.H(null,2,5,$APP.I,[a,b],null)));return a}; -$APP.f.zl=function(a,b){a=K4(this.storage,b);a=$APP.ph(a);var c=$APP.gf.h(a,$APP.pD);a=$APP.gf.h(a,gQa);if($APP.m(c)){c=$ja($APP.Wk.h(function(e){var h=$APP.C.j(e,0,null),l=$APP.C.j(e,1,null),p=$APP.C.j(e,2,null);e=$APP.C.j(e,3,null);return VX.I(h,l,p,e)},c));b=new $APP.g(null,2,[m1,b,qRa,!1],null);if($APP.m(a)){var d=Array($APP.ie(a));return kX(c,d,a,$APP.F([b]))}return q1.l(c,$APP.F([b]))}return null};$APP.f.Dl=function(){return null}; +$APP.f.zl=function(a,b){a=K4(this.storage,b);a=$APP.ph(a);var c=$APP.gf.h(a,$APP.pD);a=$APP.gf.h(a,gQa);if($APP.m(c)){c=$ja($APP.Wk.h(function(e){var h=$APP.C.j(e,0,null),l=$APP.C.j(e,1,null),p=$APP.C.j(e,2,null);e=$APP.C.j(e,3,null);return VX.I(h,l,p,e)},c));b=new $APP.g(null,2,[m1,b,INa,!1],null);if($APP.m(a)){var d=Array($APP.ie(a));return kX(c,d,a,$APP.F([b]))}return q1.l(c,$APP.F([b]))}return null};$APP.f.Dl=function(){return null}; $APP.f.Cl=function(a,b){return $APP.Dl.I(bPa,$APP.Eq,this.storage,function(c){return $APP.In.h(c,$APP.Rq.h($APP.mb,b))})};var kOa=$APP.Cl.g($APP.qi),y5=function y5(a){switch(arguments.length){case 1:return y5.g(arguments[0]);case 2:return y5.h(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",$APP.n.g(arguments.length)].join(""));}};y5.g=function(a){var b=N4(a);if(null==b)throw $APP.Fp.h("Database has no associated storage",$APP.uh);return U4(a,b,!1)}; y5.h=function(a,b){var c=N4(a);if(null==c)return $APP.K1.g(a),c=new L4(b,null,null,null),U4(a,c,!1);var d=r1.g(c);if(d===b)return U4(a,c,!1);throw $APP.Fp.h("Database is already stored with another IStorage",new $APP.g(null,1,[r1,d],null));};y5.C=2;var H6=function H6(a){switch(arguments.length){case 1:return H6.g(arguments[0]);case 2:return H6.h(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",$APP.n.g(arguments.length)].join(""));}};H6.g=function(a){return H6.h(a,$APP.uh)}; H6.h=function(a,b){b=qOa(a,b);a=$APP.C.j(b,0,null);b=$APP.C.j(b,1,null);return rOa(a,b)};H6.C=2;var n3=function n3(a){switch(arguments.length){case 1:return n3.g(arguments[0]);case 2:return n3.h(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",$APP.n.g(arguments.length)].join(""));}};n3.g=function(a){return N_(a,$APP.uh)};n3.h=function(a,b){return N_(a,b)};n3.C=2;var o3=function o3(a){switch(arguments.length){case 1:return o3.g(arguments[0]);case 2:return o3.h(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",$APP.n.g(arguments.length)].join(""));}}; o3.g=function(a){return o3.h(a,$APP.uh)}; -o3.h=function(a,b){b=$APP.ph(b);var c=$APP.gf.j(b,jQa,$APP.m3),d=$APP.gf.j(b,rQa,wka),e=K_(a,"tx0"),h=function(){var y=K_(a,"schema");return c.g?c.g(y):c.call(null,y)}();(function(){var y=new $APP.Dd(function(){return PY},aRa,$APP.Oj([$APP.cx,$APP.O,$APP.N,$APP.Km,$APP.vB,$APP.io,$APP.Lm,$APP.BP,$APP.U,$APP.V,$APP.mH],[!0,$APP.HK,uQa,"datascript/db.cljc",23,1,922,922,$APP.R(new $APP.H(null,1,5,$APP.I,[A5],null)),null,$APP.m(PY)?PY.A:null]));return y.g?y.g(h):y.call(null,h)})();var l=$APP.lq.h(d,K_(a, +o3.h=function(a,b){b=$APP.ph(b);var c=$APP.gf.j(b,jQa,$APP.m3),d=$APP.gf.j(b,rQa,wka),e=K_(a,"tx0"),h=function(){var y=K_(a,"schema");return c.g?c.g(y):c.call(null,y)}();(function(){var y=new $APP.Dd(function(){return PY},$Qa,$APP.Oj([$APP.cx,$APP.O,$APP.N,$APP.Km,$APP.vB,$APP.io,$APP.Lm,$APP.BP,$APP.U,$APP.V,$APP.mH],[!0,$APP.HK,uQa,"datascript/db.cljc",23,1,922,922,$APP.R(new $APP.H(null,1,5,$APP.I,[A5],null)),null,$APP.m(PY)?PY.A:null]));return y.g?y.g(h):y.call(null,h)})();var l=$APP.lq.h(d,K_(a, "attrs")),p=$APP.lq.h(d,K_(a,"keywords")),t=L_(function(y){var D=J_(y,0),v=$APP.C.h(l,J_(y,1)),J=J_(y,2);if("number"===typeof J)var P=J;else if("string"===typeof J)P=J;else if($APP.Ue(J))P=J;else if($APP.nb(J)||$APP.Ne(J))P=function(){var W=J_(J,0);if($APP.m($APP.on.h?$APP.on.h(0,W):$APP.on.call(null,0,W)))return $APP.C.h(p,J_(J,1));if($APP.m($APP.on.h?$APP.on.h(1,W):$APP.on.call(null,1,W)))return W=J_(J,1),c.g?c.g(W):c.call(null,W);if($APP.m($APP.on.h?$APP.on.h(2,W):$APP.on.call(null,2,W)))return Infinity; if($APP.m($APP.on.h?$APP.on.h(3,W):$APP.on.call(null,3,W)))return-Infinity;if($APP.m($APP.on.h?$APP.on.h(4,W):$APP.on.call(null,4,W)))return NaN;throw $APP.Fp.h(["Unexpected value marker ",$APP.yl.l($APP.F([W]))," in ",$APP.yl.l($APP.F([$APP.yl.l($APP.F([J]))]))].join(""),new $APP.g(null,2,[$APP.xJ,qQa,$APP.PJ,J],null));}();else throw $APP.Fp.h(["Unexpected value type ",$APP.yl.l($APP.F([$APP.zb(J)]))," (",$APP.yl.l($APP.F([$APP.yl.l($APP.F([J]))])),")"].join(""),new $APP.g(null,2,[$APP.xJ,qQa,$APP.PJ, J],null));y=e+J_(y,3);return VX.I(D,v,P,y)},K_(a,"eavt"));d=function(){var y=K_(a,"aevt");return null==y?null:L_(function(D){return t[D]},y)}();var A=function(){var y=K_(a,"avet");return null==y?null:L_(function(D){return t[D]},y)}();b=$APP.bp.l($APP.F([new $APP.g(null,2,[MNa,K_(a,"branching-factor"),RNa,function(){var y=K_(a,"ref-type");return null==y?null:$APP.Xk.g(y)}()],null),$APP.jk(b,new $APP.H(null,2,5,$APP.I,[MNa,RNa],null))]));return X4(new $APP.g(null,6,[$APP.F1,h,$APP.K1,k1(bY,t,b),W1, @@ -676,7 +676,7 @@ D0.prototype.wf=function(a,b,c){return null==b?c:j2(b,c)};E0.prototype.wf=functi p3.l=function(a,b){var c=MW(Rla,a,function(){return Kka(a)}),d=g5.g(c),e=C0(d),h=$APP.hi.l(z0,$APP.F([C0(d)])),l=$APP.ie(e),p=i5.g(c);p=$APP.S.h(h,$APP.Wk.h($APP.wn,p));h=$APP.Je(a)?n1(a):a;var t=$APP.aga.g(h);b=Nka(new s1($APP.qi,$APP.uh,$APP.uh,null,null,null),k5.g(c),b);p=dla(cla(b,t),p);h=$APP.m(UOa.g(h))?$APP.lq.h(function(A){return $APP.uf($APP.pn.j(A,0,l))},p):p;h=$APP.m($APP.Mh(H0,e))?fla(e,b,h):h;e=$APP.m($APP.Mh(I0,e))?hla(e,b,h):h;return k2(d,j5.g(c),e)};p3.C=1; p3.G=function(a){var b=$APP.x(a);a=$APP.z(a);return this.l(b,a)};var I6=function I6(a){switch(arguments.length){case 0:return I6.F();case 1:return I6.g(arguments[0]);case 2:return I6.h(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",$APP.n.g(arguments.length)].join(""));}};I6.F=function(){return Z2(null,$APP.uh)};I6.g=function(a){return Z2(a,$APP.uh)};I6.h=function(a,b){return Z2(a,QOa(b))};I6.C=2; var J6=function J6(a){switch(arguments.length){case 1:return J6.g(arguments[0]);case 2:return J6.h(arguments[0],arguments[1]);case 3:return J6.j(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",$APP.n.g(arguments.length)].join(""));}};J6.g=function(a){return UY(a,null,$APP.uh)};J6.h=function(a,b){return UY(a,b,$APP.uh)};J6.j=function(a,b,c){return UY(a,b,QOa(c))};J6.C=3;m2.h=function(a,b){return m2.j(a,b,null)}; -m2.j=function(a,b,c){if(a instanceof zY)throw $APP.Fp.h("Filtered DB cannot be modified",new $APP.g(null,1,[$APP.xJ,ZRa],null));return DZ(new bZ(a,a,$APP.qi,$APP.uh,c,null,null,null),b)};m2.C=3; +m2.j=function(a,b,c){if(a instanceof zY)throw $APP.Fp.h("Filtered DB cannot be modified",new $APP.g(null,1,[$APP.xJ,YRa],null));return DZ(new bZ(a,a,$APP.qi,$APP.uh,c,null,null,null),b)};m2.C=3; var q3=function q3(a){switch(arguments.length){case 2:return q3.h(arguments[0],arguments[1]);case 3:return q3.j(arguments[0],arguments[1],arguments[2]);case 4:return q3.I(arguments[0],arguments[1],arguments[2],arguments[3]);case 5:return q3.P(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]);case 6:return q3.ya(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);default:throw Error(["Invalid arity: ",$APP.n.g(arguments.length)].join(""));}}; q3.h=function(a,b){return mY(a,b,null,null,null,null)};q3.j=function(a,b,c){return mY(a,b,c,null,null,null)};q3.I=function(a,b,c,d){return mY(a,b,c,d,null,null)};q3.P=function(a,b,c,d,e){return mY(a,b,c,d,e,null)};q3.ya=function(a,b,c,d,e,h){return mY(a,b,c,d,e,h)};q3.C=6; var r3=function r3(a){switch(arguments.length){case 1:return r3.g(arguments[0]);case 2:return r3.h(arguments[0],arguments[1]);case 3:return r3.j(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",$APP.n.g(arguments.length)].join(""));}};r3.g=function(a){return q2(J6.g(a))};r3.h=function(a,b){return q2(J6.h(a,b))};r3.j=function(a,b,c){return q2(J6.j(a,b,c))};r3.C=3; @@ -688,76 +688,76 @@ var u3=function u3(a){switch(arguments.length){case 2:return u3.h(arguments[0],a u3.j=function(a,b,c){var d=$APP.q(a);c=fZ(new $APP.g(null,4,[J2,d,K2,b,L2,$APP.S.h($APP.Wk.h(function(t){return $APP.K.j(t,$APP.DE,!1)},q3.h(d,$APP.K1)),q3.h(b,$APP.K1)),N2,c],null));null!=O4(d)&&(y5.g(b),$APP.Th(cPa.g($APP.Be(a)),$APP.qi),$APP.Th(dPa.g($APP.Be(a)),b));$APP.Th(a,b);d=$APP.u(function(){var t=v5.g($APP.Be(a));return null==t?null:$APP.q(t)}());for(var e=null,h=0,l=0;;)if(l