squint-cljs 0.12.190 → 0.12.192
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -5
- package/lib/cli.js +45 -45
- package/lib/cljs.pprint.js +168 -168
- package/lib/compiler.js +971 -974
- package/lib/compiler.node.js +32 -29
- package/lib/compiler.sci.js +1094 -1094
- package/lib/node.nrepl_server.js +18 -18
- package/lib/squint.core.umd.js +1 -1
- package/package.json +1 -1
- package/src/squint/core.js +69 -0
- package/vite.js +70 -10
package/lib/node.nrepl_server.js
CHANGED
|
@@ -4,24 +4,24 @@ import "./node.js";
|
|
|
4
4
|
import "./compiler.node.js";
|
|
5
5
|
const shadow_esm_import = function(x) { return import(x) };
|
|
6
6
|
import*as esm_import$fs from"fs";import*as esm_import$net from"net";
|
|
7
|
-
var C9=function(a,b){a=a.indexOf(b);if(a<0)throw Error("out of input");return a},D9=function(a,b){if(a.length<b)throw Error("out of input");return a.slice(b)},E9=function(a,b){if(b>a.length)throw Error("out of input");return a.slice(0,b)},F9=function(a){return console.debug($APP.
|
|
8
|
-
|
|
9
|
-
"version-string",a)},
|
|
10
|
-
$APP.
|
|
11
|
-
|
|
12
|
-
h.call(null):null;h=$APP.p(h)?"Open "+$APP.H.g(h)+" in a browser tab.":"Open the dev server URL in a browser tab.";h=Error("No response from the browser within "
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
h=null,m=0),n=0;else return null});return b.on("close",function(f){return $APP.p(f)?F9($APP.z(["Connection lost"])):F9($APP.z(["Connection closed"]))})},
|
|
18
|
-
|
|
19
|
-
kla=new $APP.D(null,"info","info",-317069002),
|
|
7
|
+
var C9=function(a,b){a=a.indexOf(b);if(a<0)throw Error("out of input");return a},D9=function(a,b){if(a.length<b)throw Error("out of input");return a.slice(b)},E9=function(a,b){if(b>a.length)throw Error("out of input");return a.slice(0,b)},F9=function(a){return console.debug($APP.rq.h(" ",a))},Qka=function(a){return function(b,c){b=$APP.$e(b);var d=$APP.Vd.h(b,$APP.at),e=$APP.Vd.h(b,G9);c=$APP.Lh.j(c,"id",d);c=$APP.p(e)?$APP.Lh.j(c,"session",e):c;return a.h?a.h(b,c):a.call(null,b,c)}},Ska=function(){var a=
|
|
8
|
+
Rka;return function(b,c){b=$APP.en.j(b,H9,$APP.wi);return a.h?a.h(b,c):a.call(null,b,c)}},Uka=function(){var a=Tka();return function(b,c){F9($APP.z(["request",b]));return a.h?a.h(b,c):a.call(null,b,c)}},Vka=function(a){return function(b,c){F9($APP.z(["response",c]));return a.h?a.h(b,c):a.call(null,b,c)}},Tka=function(){var a=Ska();return function(b,c){return a.h?a.h(b,c):a.call(null,b,c)}},I9=function(a){return $APP.Lh.j($APP.Wh(new $APP.E(null,3,5,$APP.F,["major","minor","incremental"],null),$APP.Vv.g(a.split("."))),
|
|
9
|
+
"version-string",a)},L9=function(){var a=function(){var b=$APP.Db(J9);b=b==null?null:$APP.Wo.g(b);b=b==null?null:$APP.Db(b);return b==null?null:$APP.Vn.g(b)}();if($APP.p(a))return a;a=function(){var b=$APP.Db(K9);b=b==null?null:$APP.Db(b);return b==null?null:$APP.Vn.g(b)}();return $APP.p(a)?a:$APP.Rq},Wka=function(a,b,c){if($APP.p(a)){var d=M9.g?M9.g(a):M9.call(null,a);if($APP.p(d)){var e=$APP.$e(b);a=$APP.Vd.h(e,$APP.k9);b=$APP.Vd.h(e,$APP.e9);e=$APP.Vd.h(e,$APP.m9);var f=$APP.li,h=$APP.ji,l=$APP.N6;
|
|
10
|
+
$APP.li=b;$APP.ji=e;$APP.N6=a;try{return Promise.resolve(function(){var m=new $APP.ya,n=$APP.Ba,k=$APP.Ca;$APP.Ba=!0;$APP.Ca=function(q){return m.append(q)};try{d.g?d.g(c):d.call(null,c)}finally{$APP.Ca=k,$APP.Ba=n}return""+$APP.H.g(m)}())}finally{$APP.N6=l,$APP.ji=h,$APP.li=f}}else return F9($APP.z(["Pretty-Printing is only supported for cider.nrepl.pprint/pprint"])),$APP.sJ(c)}else return $APP.sJ(c)},Xka=function(a,b){var c=function(){var f=$APP.VI();f=f==null?null:$APP.sr.g(f);return f==null?null:
|
|
11
|
+
$APP.Lh.j(f,$APP.Nv,!0)}(),d=$APP.p(b)?$APP.Fi.g(b):null;b=function(){var f=new $APP.G(null,4,[$APP.sq,$APP.Hv,$APP.Mv,!0,$APP.ms,!0,$APP.Bq,!0],null);f=$APP.p(c)?$APP.Lh.j(f,$APP.sr,c):f;f=$APP.p($APP.Db(K9))?$APP.Lh.j(f,$APP.Wo,$APP.Db(K9)):f;f=$APP.p(d)?$APP.Lh.j(f,$APP.T,d):f;var h=$APP.Db(J9);return $APP.Kv?$APP.Kv(a,f,h):$APP.SI.call(null,a,f,h)}();b=$APP.$e(b);var e=$APP.Vd.h(b,$APP.Tv);$APP.Cf(J9,b);b=""+$APP.H.g(e)+"\n;return [undefined];";return $APP.ar("(async function () {\n%s\n}) ()",
|
|
12
|
+
"%s",b)},N9=function(a,b){return Promise.resolve(eval(a)).then(function(c){c=c[0];return Wka(Yka.g(b),Zka.g(b),c)})},$ka=function(a,b){return new Promise(function(c,d){var e=$APP.at.g(b);$APP.Xi.A(O9,$APP.Lh,e,{resolve:c,reject:d});setTimeout(function(){if($APP.p($APP.Vd.h($APP.Db(O9),e))){$APP.Xi.j(O9,$APP.Zk,e);var h=$APP.Db(P9);h=$APP.p(h)?h.v?h.v():h.call(null):null;h=$APP.p(h)?"Open "+$APP.H.g(h)+" in a browser tab.":"Open the dev server URL in a browser tab.";h=Error("No response from the browser within "+
|
|
13
|
+
$APP.H.g(8E3)+"ms. "+$APP.H.g(h)+" The REPL evaluates in the page.");return d.g?d.g(h):d.call(null,h)}return null},8E3);c=$APP.Db(Q9);if($APP.p(c)){var f={op:"eval",code:a,id:e,session:G9.g(b)};return c.g?c.g(f):c.call(null,f)}$APP.Xi.j(O9,$APP.Zk,e);c=Error("No browser transport connected");return d.g?d.g(c):d.call(null,c)})},S9=function(a,b){return Promise.resolve(a).then(function(c){return Xka(c,$APP.T.g(b))}).then(function(c){var d=$APP.Db(R9);return d.h?d.h(c,b):d.call(null,c,b)})},dla=function(a,
|
|
14
|
+
b){var c=$APP.$e(a);$APP.Vd.h(c,$APP.T);a=$APP.Vd.h(c,ala);$APP.Vd.h(c,$APP.jl);$APP.Vd.h(c,bla);$APP.Vd.h(c,cla);return S9(a,c).then(function(d){d=new $APP.G(null,2,["ns",""+$APP.H.g(L9()),"value",d],null);return b.h?b.h(c,d):b.call(null,c,d)}).catch(function(d){console.error(d);var e=$APP.Iu.g($APP.uj(d));e=$APP.p(e)?e:d.message;$APP.p(e)&&(e=new $APP.G(null,1,["err",""+$APP.H.g(e)+"\n"],null),b.h?b.h(c,e):b.call(null,c,e));d=new $APP.G(null,2,["ex",""+$APP.H.g(d),"ns",""+$APP.H.g(L9())],null);
|
|
15
|
+
return b.h?b.h(c,d):b.call(null,c,d)}).finally(function(){var d=new $APP.G(null,2,["ns",""+$APP.H.g(L9()),"status",new $APP.E(null,1,5,$APP.F,["done"],null)],null);return b.h?b.h(c,d):b.call(null,c,d)})},T9=function(a){a=$APP.$e(a);$APP.Vd.h(a,$APP.T);return null},Rka=function(a,b){a=$APP.$e(a);var c=$APP.Vd.h(a,H9),d=$APP.Vd.h(U9,c);if($APP.p(d))return d.h?d.h(a,b):d.call(null,a,b);console.warn($APP.rq.h(" ",$APP.z(["Unhandled operation",c])));c=new $APP.G(null,1,["status",new $APP.E(null,3,5,$APP.F,
|
|
16
|
+
["error","unknown-op","done"],null)],null);return b.h?b.h(a,c):b.call(null,a,c)},ela=function(a){return function(b,c){return a.write(V9(c))}},fla=function(a,b){F9($APP.z(["Connection accepted"]));b.setNoDelay(!0);var c=Uka(),d=Qka(Vka(ela(b))),e=$APP.Wi.g(null);b.on("data",function(f){var h=$APP.Db(e);if($APP.p(h)){f=""+$APP.H.g(h)+$APP.H.g(f);$APP.Cf(e,null);var l=f}else l=f;a:{f=$APP.z([$APP.Wv,!0]);for(h=$APP.dg;;){var m=$APP.zf.j(W9,l,f);l=$APP.y.j(m,0,null);m=$APP.y.j(m,1,null);if(l==null){h=
|
|
17
|
+
new $APP.E(null,2,5,$APP.F,[h,m],null);break a}h=$APP.ve.h(h,l);l=m}h=void 0}f=$APP.y.j(h,0,null);h=$APP.y.j(h,1,null);$APP.nk(h)||$APP.Cf(e,h);f=$APP.t(f);h=null;for(var n=m=0;;)if(n<m)l=h.ea(null,n),c(l,d),n+=1;else if(f=$APP.t(f))h=f,$APP.Od(h)?(f=$APP.ic(h),m=$APP.lc(h),h=f,l=$APP.nd(f),f=m,m=l):(l=$APP.u(h),c(l,d),f=$APP.w(h),h=null,m=0),n=0;else return null});return b.on("close",function(f){return $APP.p(f)?F9($APP.z(["Connection lost"])):F9($APP.z(["Connection closed"]))})},cla=new $APP.D(null,
|
|
18
|
+
"_line","_line",232847719),Zka=new $APP.D("nrepl.middleware.print","options","nrepl.middleware.print/options",868480159),G9=new $APP.D(null,"session","session",1008279103),gla=new $APP.D(null,"lookup","lookup",1225356838),hla=new $APP.D(null,"browser-transport","browser-transport",-653558483),ila=new $APP.D(null,"load-file","load-file",-424586670),bla=new $APP.D(null,"_load-file?","_load-file?",-1198848711),H9=new $APP.D(null,"op","op",-1882987955),jla=new $APP.D(null,"describe","describe",1369790582),
|
|
19
|
+
ala=new $APP.D(null,"code","code",1586293142),kla=new $APP.D(null,"eldoc","eldoc",-1321421900),lla=new $APP.D(null,"log_level","log_level",-1756736313),Yka=new $APP.D("nrepl.middleware.print","print","nrepl.middleware.print/print",-1616742548),mla=new $APP.D(null,"clone","clone",711747572),nla=new $APP.D(null,"close","close",1835149582),ola=new $APP.D(null,"info","info",-317069002),pla=new $APP.D(null,"host","host",-1558485167),qla=new $APP.D(null,"complete","complete",-500388775);var X9=function X9(a,b){switch(""+$APP.H.g(E9(a,1))){case "i":return a=D9(a,1),b=C9(a,"e"),new $APP.E(null,2,5,$APP.F,[parseInt(E9(a,b)),D9(a,b+1)],null);case "l":var d=a=D9(a,1);for(a=$APP.$b($APP.dg);;){if($APP.x.h(""+$APP.H.g(E9(d,1)),"e"))return new $APP.E(null,2,5,$APP.F,[$APP.cc(a),D9(d,1)],null);var e=X9.h?X9.h(d,b):X9.call(null,d,b),f=$APP.y.j(e,0,null),h=$APP.y.j(e,1,null);e=h;a=$APP.Zf.h(a,f);d=e}break;case "d":a=D9(a,1);f=$APP.$e(b);f=$APP.Vd.h(f,$APP.Wv);d=a;for(e=$APP.$b($APP.Ze);;){if($APP.x.h(""+
|
|
20
20
|
$APP.H.g(E9(d,1)),"e"))return new $APP.E(null,2,5,$APP.F,[$APP.cc(e),D9(d,1)],null);a=X9.h?X9.h(d,b):X9.call(null,d,b);d=$APP.y.j(a,0,null);h=$APP.y.j(a,1,null);h=X9.h?X9.h(h,b):X9.call(null,h,b);a=$APP.y.j(h,0,null);h=$APP.y.j(h,1,null);d=$APP.p(f)?$APP.wi.g(d):d;a=$APP.Pg.j(e,d,a);d=h;e=a}break;default:return b=C9(a,":"),f=parseInt(E9(a,b)),a=D9(a,b+1),new $APP.E(null,2,5,$APP.F,[""+$APP.H.g(E9(a,f)),D9(a,f)],null)}},W9=function W9(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),
|
|
21
21
|
e+=1;else break;return W9.l(arguments[0],1<c.length?new $APP.Lc(c.slice(1),0,null):null)};W9.l=function(a,b){try{return X9(a,b)}catch(c){if(c instanceof Error)return new $APP.E(null,2,5,$APP.F,[null,a],null);throw c;}};W9.m=1;W9.o=function(a){var b=$APP.u(a);a=$APP.w(a);return this.l(b,a)};
|
|
22
22
|
var V9=function V9(a){for(;;){if(typeof a==="string")return""+$APP.H.g(Buffer.from(a).length)+":"+$APP.H.g(a);if(a instanceof $APP.D||a instanceof $APP.r)a=""+$APP.H.g(function(){var c=$APP.De(a);return $APP.p(c)?""+$APP.H.g(c)+"/":null}())+$APP.H.g($APP.Vh(a));else return typeof a==="number"?"i"+$APP.H.g(a)+"e":$APP.Jd(a)||$APP.Nd(a)||a==null?"l"+$APP.H.g($APP.zf.h($APP.H,$APP.jk.h(V9,a)))+"e":$APP.Ld(a)?"d"+$APP.H.g($APP.zf.h($APP.H,$APP.jk.h(function(){return function(c){var d=$APP.y.j(c,0,null);
|
|
23
|
-
c=$APP.y.j(c,1,null);return""+$APP.H.g(V9.g?V9.g(d):V9.call(null,d))+$APP.H.g(V9.g?V9.g(c):V9.call(null,c))}}(a),$APP.
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
$APP.Ze));$APP.p(e)&&$APP.Cf(K9,e);$APP.p(d)?($APP.Cf(Q9,d.send),$APP.Cf(P9,d.url),$APP.Cf(R9
|
|
27
|
-
export const handleBrowserMessage=function(a){var b=typeof a==="string"?JSON.parse(a):a,c=b.id;a=$APP.Vd.h($APP.Db(O9),c);if($APP.p(a)){$APP.Xi.j(O9,$APP.Zk,c);c=b.ex;if(c==null)return b=b.value,a=a.resolve,a.g?a.g(b):a.call(null,b);b=Error(""+$APP.H.g(c));a=a.reject;return a.g?a.g(b):a.call(null,b)}return null};export const evalString=function(a){return S9(a,new $APP.G(null,2,[$APP.
|
|
23
|
+
c=$APP.y.j(c,1,null);return""+$APP.H.g(V9.g?V9.g(d):V9.call(null,d))+$APP.H.g(V9.g?V9.g(c):V9.call(null,c))}}(a),$APP.uJ.h($APP.u,a))))+"e":null}};var J9=$APP.Wi.g(null),K9=$APP.Wi.g(null),M9=new $APP.G(null,1,["cider.nrepl.pprint/pprint",$APP.t9],null);$APP.Wi.g(!1);
|
|
24
|
+
var Q9=$APP.Wi.g(null),P9=$APP.Wi.g(null),O9=$APP.Wi.g($APP.Ze),R9=$APP.Wi.g(N9),U9=$APP.rh([gla,nla,ila,kla,mla,jla,ola,qla,$APP.Hba],[T9,function(a,b){var c=new $APP.G(null,1,["status",new $APP.E(null,1,5,$APP.F,["done"],null)],null);return b.h?b.h(a,c):b.call(null,a,c)},function(a){a=$APP.$e(a);$APP.Vd.h(a,$APP.jl);return null},T9,function(a,b){var c=new $APP.G(null,2,["new-session",""+$APP.H.g($APP.LI()),"status",new $APP.E(null,1,5,$APP.F,["done"],null)],null);return b.h?b.h(a,c):b.call(null,
|
|
25
|
+
a,c)},function(a,b){var c=new $APP.G(null,4,["versions",new $APP.G(null,2,["nbb-nrepl",I9("TODO"),"node",I9(process.version)],null),"aux",$APP.Ze,"ops",$APP.Wh($APP.jk.h($APP.Vh,$APP.Gh(U9)),$APP.On.g($APP.Ze)),"status",new $APP.E(null,1,5,$APP.F,["done"],null)],null);return b.h?b.h(a,c):b.call(null,a,c)},T9,function(){return null},function(a,b){a=$APP.$e(a);var c=$APP.Vd.h(a,$APP.T);return dla($APP.Lh.j(a,$APP.T,$APP.p(c)?c:L9()),b)}]),rla=$APP.Wi.g(null);export const startServer=function(a){return Promise.resolve(null).then(function(){var b=function(){var h=$APP.La(a)?a.port:$APP.xJ.g(a);return $APP.p(h)?h:0}(),c=function(){var h=$APP.La(a)?a.host:pla.g(a);return $APP.p(h)?h:"127.0.0.1"}();(function(){var h=$APP.La(a)?a.log_level:lla.g(a);return $APP.p(h)?h:"info"})();var d=function(){var h=hla.g(a);return $APP.p(h)?h:$APP.La(a)?a.browserTransport:null}(),e=function(){var h=$APP.Wo.g(a);return $APP.p(h)?h:$APP.La(a)?a.nsState:null}(),f=esm_import$net.createServer($APP.bl.h(fla,
|
|
26
|
+
$APP.Ze));$APP.p(e)&&$APP.Cf(K9,e);$APP.p(d)?($APP.Cf(Q9,d.send),$APP.Cf(P9,d.url),$APP.Cf(R9,$ka)):$APP.Cf(R9,N9);f.listen(b,c,function(){var h=f.address(),l=h.port;h=h.address;$APP.wJ.l($APP.z(["nREPL server started on port "+$APP.H.g(l)+" on host "+$APP.H.g(h)+" - nrepl://"+$APP.H.g(h)+":"+$APP.H.g(l)]));try{return esm_import$fs.writeFileSync(".nrepl-port",""+$APP.H.g(l))}catch(m){return console.warn($APP.rq.h(" ",$APP.z(["Could not write .nrepl-port",m])))}});return $APP.Cf(rla,f)})};
|
|
27
|
+
export const handleBrowserMessage=function(a){var b=typeof a==="string"?JSON.parse(a):a,c=b.id;a=$APP.Vd.h($APP.Db(O9),c);if($APP.p(a)){$APP.Xi.j(O9,$APP.Zk,c);c=b.ex;if(c==null)return b=b.value,a=a.resolve,a.g?a.g(b):a.call(null,b);b=Error(""+$APP.H.g(c));a=a.reject;return a.g?a.g(b):a.call(null,b)}return null};export const evalString=function(a){return S9(a,new $APP.G(null,2,[$APP.at,""+$APP.H.g($APP.LI()),G9,"http"],null)).then(function(b){return{value:b,ns:""+$APP.H.g(L9())}})};
|
package/lib/squint.core.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var squint;(squint||={}).core=(()=>{var ut=Object.defineProperty;var Ke=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var Te=Object.prototype.hasOwnProperty;var Ge=(t,e)=>{for(var n in e)ut(t,n,{get:e[n],enumerable:!0})},Oe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ie(e))!Te.call(t,o)&&o!==n&&ut(t,o,{get:()=>e[o],enumerable:!(r=Ke(e,o))||r.enumerable});return t};var $e=t=>Oe(ut({},"__esModule",{value:!0}),t);var Wo={};Ge(Wo,{Atom:()=>Vt,Cons:()=>Ct,Delay:()=>qo,IIterable:()=>at,IIterable__iterator:()=>Ft,LazySeq:()=>vr,NaN_QMARK_:()=>Zr,PROTOCOL_SENTINEL:()=>yn,_:()=>Fe,_EQ_:()=>St,_GT_:()=>kt,_GT__EQ_:()=>Nt,_LT_:()=>Be,_LT__EQ_:()=>ze,_PLUS_:()=>qe,_STAR_:()=>Le,__protocol_satisfies:()=>Pe,__toFn:()=>f,_iterator:()=>C,abs:()=>jo,aclone:()=>qr,add_watch:()=>Lr,alength:()=>Or,apply:()=>Jt,array:()=>kn,array_QMARK_:()=>H,aset:()=>$r,assoc:()=>K,assoc_BANG_:()=>A,assoc_in:()=>jt,assoc_in_BANG_:()=>Kt,atom:()=>mn,boolean$:()=>jr,boolean_QMARK_:()=>ho,bounded_count:()=>_o,butlast:()=>Mr,cat:()=>Se,clj__GT_js:()=>Lo,coll_QMARK_:()=>eo,comp:()=>It,compare:()=>b,compare_and_set_BANG_:()=>bn,complement:()=>z,concat:()=>Ht,conj:()=>Gt,conj_BANG_:()=>Y,cons:()=>cn,constantly:()=>In,contains_QMARK_:()=>$t,count:()=>q,counted_QMARK_:()=>ge,cycle:()=>tr,dec:()=>Ze,deref:()=>N,disj:()=>Ue,disj_BANG_:()=>Ot,dissoc:()=>Xe,dissoc_BANG_:()=>Je,distinct:()=>or,doall:()=>zr,dorun:()=>Br,drop:()=>rt,drop_last:()=>Er,drop_while:()=>fe,empty:()=>tt,empty_QMARK_:()=>xr,ensure_reduced:()=>se,es6_iterator:()=>D,even_QMARK_:()=>Xt,every_QMARK_:()=>le,every_pred:()=>Yr,ex_cause:()=>uo,ex_data:()=>ro,ex_info:()=>io,ex_message:()=>oo,false_QMARK_:()=>Nr,ffirst:()=>en,filter:()=>U,filterv:()=>sn,find:()=>xo,first:()=>I,flatten:()=>Mo,fn_QMARK_:()=>ye,fnil:()=>mt,frequencies:()=>br,get:()=>w,get_in:()=>yt,group_by:()=>Ar,identical_QMARK_:()=>Vn,identity:()=>te,inc:()=>Bt,int_QMARK_:()=>O,integer_QMARK_:()=>co,interleave:()=>ee,interpose:()=>$n,into:()=>ce,into_array:()=>de,iterable:()=>s,iterate:()=>Dr,js_keys:()=>Hr,js_obj:()=>Gr,juxt:()=>Vr,keep:()=>fr,keep_indexed:()=>_n,key:()=>ue,keys:()=>we,last:()=>nn,lazy:()=>l,list:()=>Zt,list_QMARK_:()=>Tn,long$:()=>Ko,map:()=>k,map_QMARK_:()=>_e,map_indexed:()=>an,mapcat:()=>Gn,mapv:()=>X,max:()=>he,max_key:()=>wo,memoize:()=>Go,merge:()=>Yn,merge_with:()=>Cn,meta:()=>ao,min:()=>Pr,min_key:()=>mo,mod:()=>yo,nat_int_QMARK_:()=>fo,neg_QMARK_:()=>Ir,neg_int_QMARK_:()=>lo,next:()=>ct,nil_QMARK_:()=>xn,nnext:()=>Wr,not:()=>ht,not_EQ_:()=>Po,not_any_QMARK_:()=>_r,not_empty:()=>vo,not_every_QMARK_:()=>cr,nth:()=>zt,number_QMARK_:()=>me,object_QMARK_:()=>Ve,odd_QMARK_:()=>Kn,parse_double:()=>Ao,parse_long:()=>go,partial:()=>Hn,partition:()=>re,partition_all:()=>ne,partition_by:()=>Pn,partitionv:()=>qn,partitionv_all:()=>Ln,peek:()=>Oo,persistent_BANG_:()=>Ro,pop:()=>$o,pos_QMARK_:()=>Tr,pos_int_QMARK_:()=>so,pr_str:()=>Qe,println:()=>He,prn:()=>Vo,quot:()=>ve,rand:()=>yr,rand_int:()=>pe,rand_nth:()=>mr,random_uuid:()=>zo,range:()=>vn,re_find:()=>En,re_matches:()=>Mn,re_pattern:()=>Rn,re_seq:()=>Xr,reduce:()=>S,reduce_kv:()=>At,reduced:()=>W,reduced_QMARK_:()=>R,reductions:()=>on,regexp_QMARK_:()=>no,rem:()=>ke,remove:()=>fn,remove_watch:()=>Fr,repeat:()=>xt,repeatedly:()=>gr,replace:()=>dr,reset_BANG_:()=>Wt,reset_vals_BANG_:()=>An,rest:()=>V,reverse:()=>lr,run_BANG_:()=>Fo,satisfies_QMARK_:()=>Ye,second:()=>tn,select_keys:()=>Bn,seq:()=>E,seq_QMARK_:()=>qt,seqable_QMARK_:()=>Lt,sequential_QMARK_:()=>it,set:()=>Qn,set_QMARK_:()=>jn,shuffle:()=>hr,some:()=>ae,some_QMARK_:()=>Qr,some_fn:()=>Cr,sort:()=>wt,sort_by:()=>pr,sorted_set:()=>So,split_at:()=>Rr,split_with:()=>Sr,str:()=>dn,string_QMARK_:()=>ot,subs:()=>xe,subseq:()=>Qo,subvec:()=>Sn,swap_BANG_:()=>wn,swap_vals_BANG_:()=>gn,system_time:()=>Dn,t:()=>Jr,take:()=>et,take_last:()=>Un,take_nth:()=>Zn,take_while:()=>nt,to_array:()=>Ur,trampoline:()=>Me,transduce:()=>vt,transient$:()=>Eo,tree_seq:()=>Ee,true_QMARK_:()=>kr,truth_:()=>_,type:()=>Io,unreduced:()=>dt,update:()=>ur,update_BANG_:()=>gt,update_in:()=>ir,update_keys:()=>Bo,update_vals:()=>Ne,val:()=>ie,vals:()=>to,vec:()=>Q,vector:()=>J,vector_QMARK_:()=>Nn,volatile_BANG_:()=>Co,vreset_BANG_:()=>Do,warn_on_lazy_reusage_BANG_:()=>un,with_meta:()=>po,zero_QMARK_:()=>Kr,zipmap:()=>bo});function f(t){if(t==null||typeof t=="function")return t;const e=typeof t;return e==="string"?(n,r)=>w(n,t,r):e==="object"?(n,r)=>w(t,n,r):t}var Et=Object.prototype.hasOwnProperty;function Rt(t,e,n){for(n of t.keys())if(j(n,e))return n}function j(t,e){if(t===e)return!0;var n,r,o;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Array){if((r=t.length)===e.length)for(;r--&&j(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(const u of t)if(o=u,o&&typeof o=="object"&&(o=Rt(e,o),!o)||!e.has(o))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(const u of t)if(o=u[0],o&&typeof o=="object"&&(o=Rt(e,o),!o)||!j(u[1],e.get(o)))return!1;return!0}if(!n||typeof t=="object"){r=0;for(const u in t)if(Et.call(t,u)&&++r&&!Et.call(e,u)||!(u in e)||!j(t[u],e[u]))return!1;return Object.keys(e).length===r}}return!1}function T(t,e){return t.every(function(n,r){return r===0||e(t[r-1],n)})}function St(...t){return T(t,(e,n)=>j(e,n))}function kt(...t){return T(t,(e,n)=>e>n)}function Nt(...t){return T(t,(e,n)=>e>=n)}function Be(...t){return T(t,(e,n)=>e<n)}function ze(...t){return T(t,(e,n)=>e<=n)}function qe(...t){return t.reduce((e,n)=>e+n,0)}function Le(...t){return t.reduce((e,n)=>e*n,1)}function Fe(...t){return t.length==1?0-t[0]:t.reduce((e,n)=>e-n)}const Pe={};function Ye(t,e){return e==null?t[null]:typeof t=="symbol"?e[t]:e[t.__sym]}function Ce(t,e,n){return t.set(e,n),t}function De(t,e,n){return t[e]=n,t}function Qt(t){switch(p(t)){case h:return Ce;case x:case d:return De}}function A(t,e,n,...r){if(r.length%2!==0)throw new Error("Illegal argument: assoc expects an odd number of arguments.");switch(p(t)){case h:t.set(e,n);for(let o=0;o<r.length;o+=2)t.set(r[o],r[o+1]);break;case x:case d:t[e]=n;for(let o=0;o<r.length;o+=2)t[r[o]]=r[o+1];break;default:throw new Error(`Illegal argument: assoc! expects a Map, Array, or Object as the first argument, but got ${typeof t}.`)}return t}function G(t){switch(p(t)){case h:return new Map(t);case m:return new t.constructor(t);case x:return[...t];case d:return{...t};default:throw new Error(`Don't know how to copy object of type ${typeof t}.`)}}function K(t,e,n,...r){t||(t={});const o=G(t);return A(o,e,n,...r),o}const h=1,x=2,d=3,M=4,m=5,L=6;function F(t){switch(t){case h:return new Map;case x:return[];case d:return{};case M:return new Z;case m:return new Set;case L:return l(function*(){})}}function P(t){return t.constructor===Object}function Ve(t){return t!=null&&P(t)}function p(t){if(t!=null){if(P(t))return d;if(t instanceof Map)return h;if(t instanceof Set)return m;if(t instanceof Z)return M;if(Array.isArray(t))return x;if(t instanceof pt)return L;if(t instanceof $)return m;if(t instanceof Object)return d}}function We(t,e,n,r,o){r=Q(r),n=n||{};const u=p(n);if(u!==h&&u!==x&&u!==d)throw new Error(`Illegal argument: ${e} expects the first argument to be a Map, Array, or Object.`);const i=[n];let c=n;for(let a=0;a<r.length-1;a+=1){const g=r[a];let y;c instanceof Map?y=c.get(g):y=c[g],y||(y=F(u)),i.push(y),c=y}i.push(o);for(let a=i.length-2;a>=0;a-=1)i[a]=t(i[a],r[a],i[a+1]);return i[0]}function jt(t,e,n){return We(K,"assoc-in",t,e,n)}function Kt(t,e,n){e=Q(e);var r=t;const o=p(t);for(const u of e.splice(0,e.length-1)){let i=w(r,u);i===void 0&&(i=F(o),A(r,u,i)),r=i}return A(r,e[e.length-1],n),t}function It(...t){if(t=t.map(f),t.length===0)return te;if(t.length===1)return t[0];const[e,...n]=t.slice().reverse();return function(...r){let o=e(...r);for(const u of n)o=u(o);return o}}function Tt(t,e){for(const n of e)t.add(n);return t}function Y(...t){if(t.length===0)return J();const[e,...n]=t;let r=e;switch(r==null&&(r=[]),p(r)){case m:Tt(r,n);break;case M:r.unshift(...n.reverse());break;case x:r.push(...n);break;case h:for(const o of n)Array.isArray(o)?r.set(o[0],o[1]):s(o).forEach(u=>{r.set(u[0],u[1])});break;case d:for(const o of n)Array.isArray(o)?r[o[0]]=o[1]:Object.assign(r,o);break;default:throw new Error("Illegal argument: conj! expects a Set, Array, List, Map, or Object as the first argument.")}return r}function Gt(...t){if(t.length===0)return J();const[e,...n]=t;let r=e;r==null&&(r=Zt());let o,u;switch(p(r)){case m:return r instanceof $?Tt(new r.constructor(r),n):new r.constructor([...r,...n]);case M:return new Z(...n.reverse(),...r);case x:return[...r,...n];case h:o=new Map(r);for(const i of n)Array.isArray(i)?o.set(i[0],i[1]):s(i).forEach(c=>{o.set(c[0],c[1])});return o;case L:return l(function*(){yield*n,yield*r});case d:u={...r};for(const i of n)Array.isArray(i)?u[i[0]]=i[1]:Object.assign(u,i);return u;default:throw new Error("Illegal argument: conj expects a Set, Array, List, Map, or Object as the first argument.")}}function Ot(t,...e){for(const n of e)t.delete(n);return t}function Ue(t,...e){const n=new t.constructor([...t]);return Ot(n,...e)}function $t(t,e){switch(p(t)){case m:case h:return t.has(e);case void 0:return!1;default:return e in t}}function Je(t,...e){for(const n of e)delete t[n];return t}function Xe(t,...e){if(!t)return;if(e.length===0)return t;const n=G(t);switch(p(t)){case h:for(const r of e)n.delete(r);break;default:for(const r of e)delete n[r];break}return n}function Bt(t){return t+1}function Ze(t){return t-1}function He(...t){console.log(...t)}function zt(t,e,n){if(t){var r=void 0;if(Array.isArray(t))r=t[e];else{const o=s(t);let u=0;for(const i of o)if(u++==e){r=i;break}}if(r!==void 0)return r}return n}function w(t,e,n=void 0){if(t==null)return n;let r;if(P(t))return r=t[e],r===void 0?n:r;let o;switch(p(t)){case m:t.has(e)&&(r=e);break;case h:r=t.get(e);break;case x:r=t[e];break;default:if(o=t.get,typeof o=="function")try{r=t.get(e);break}catch{}r=t[e];break}return r!==void 0?r:n}function qt(t){return t!=null&&!!t[Symbol.iterator]}const it=qt;function Lt(t){return t==null||!!t[Symbol.iterator]}function s(t){if(t==null)return[];if(Lt(t))return t;if(t instanceof Object)return Object.entries(t);throw new TypeError(`${t} is not iterable`)}const at=Symbol("Iterable"),Ft=Symbol.iterator;function C(t){return t[Symbol.iterator]()}const D=C;function E(t){if(t==null)return t;const e=s(t);return e.length===0||e.size===0||e[Symbol.iterator]().next().done?null:e}function I(t){const[e]=s(t);return e}function tn(t){const[e,n]=s(t);return n}function en(t){return I(I(t))}function V(t){return l(function*(){let e=!0;for(const n of s(t))e?e=!1:yield n})}class B{value;constructor(e){this.value=e}_deref(){return this.value}}function nn(t){t=s(t);let e;switch(p(t)){case x:return t[t.length-1];default:for(const n of t)e=n;return e}}function W(t){return new B(t)}function R(t){return t instanceof B}function S(t,e,n){t=f(t);let r,o;if(arguments.length===2){const u=s(e)[Symbol.iterator](),i=u.next();i.done?o=t():o=i.value,r=u}else o=e,r=s(n);if(o instanceof B)return o.value;for(const u of r)if(o=t(o,u),o instanceof B){o=o.value;break}return o}function*rn(t,e){const n=e.next();n.done?yield t():yield*Pt(t,n.value,e)}function*Pt(t,e,n){let r=e,o=n;for(;;){if(R(r)){yield r.value;return}else yield r;const u=o.next();if(u.done)break;r=t(r,u.value)}}function on(t,e,n){return t=f(t),arguments.length===2?l(function*(){yield*rn(t,s(e)[Symbol.iterator]())}):l(function*(){yield*Pt(t,e,s(n)[Symbol.iterator]())})}var Yt=!1;function un(){Yt=!0}class pt{constructor(e){this.gen=e,this.usages=0}[Symbol.iterator](){if(this.usages++,this.usages>=2&&Yt)try{throw new Error}catch(e){console.warn("Re-use of lazy value",e.stack)}return this.gen()}}pt.prototype[at]=!0;function l(t){return new pt(t)}class Ct{constructor(e,n){this.x=e,this.coll=n}*[Symbol.iterator](){yield this.x,yield*s(this.coll)}}function cn(t,e){return new Ct(t,e)}function k(t,...e){switch(t=f(t),e.length){case 0:return n=>(...r)=>{switch(r.length){case 0:return n();case 1:return n(r[0]);case 2:return n(r[0],t(r[1]));default:return n(r[0],t(...r.slice(1)))}};case 1:return l(function*(){for(const n of s(e[0]))yield t(n)});default:return l(function*(){const n=e.map(r=>D(s(r)));for(;;){const r=[];for(const o of n){const u=o.next();if(u.done)return;r.push(u.value)}yield t(...r)}})}}function Dt(t){return e=>(...n)=>{switch(n.length){case 0:return e();case 1:return e(n[0]);case 2:{const r=n[0],o=n[1];return _(t(o))?e(r,o):r}}}}function U(t,e){return arguments.length===1?Dt(t):(t=f(t),l(function*(){for(const n of s(e))_(t(n))&&(yield n)}))}function sn(t,e){return[...U(t,e)]}function fn(t,e){return arguments.length===1?Dt(z(t)):U(z(t),e)}function ln(t){return e=>{let n=-1;return(...r)=>{switch(r.length){case 0:return e();case 1:return e(r[0]);case 2:return e(r[0],t((n=n+1,n),r[1]))}}}}function an(t,e){return t=f(t),arguments.length===1?ln(t):l(function*(){let n=0;for(const r of s(e))yield t(n,r),n++})}function pn(t,e){return t=f(t),l(function*(){let n=0;for(const r of s(e)){const o=t(n,r);_(o)&&(yield o),n++}})}function hn(t){return e=>{let n=-1;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=r[0],i=r[1];n++;const c=t(n,i);return c==null?u:e(u,c)}}}}function _n(t,e){return arguments.length===1?hn(t):pn(t,e)}function dn(...t){return t.join("")}function ht(t){return!_(t)}function xn(t){return t==null}const yn={};class Vt{constructor(e){this.val=e,this._watches={},this._deref=()=>this.val,this._hasWatches=!1,this._reset_BANG_=n=>{const r=this.val;if(this.val=n,this._hasWatches)for(const o of Object.entries(this._watches)){const u=o[0],i=o[1];i(u,this,r,n)}return n},this._add_watch=(n,r)=>{this._watches[n]=r,this._hasWatches=!0},this._remove_watch=n=>{delete this._watches[n]}}}function mn(t){return new Vt(t)}function N(t){return t._deref()}function Wt(t,e){t._reset_BANG_(e)}function wn(t,e,...n){e=f(e);const r=e(N(t),...n);return Wt(t,r),r}function gn(t,e,...n){const r=N(t);e=f(e);const o=e(r,...n);return t._reset_BANG_(o),[r,o]}function An(t,e){const n=N(t);return t._reset_BANG_(e),[n,e]}function bn(t,e,n){return N(t)===e?(t._reset_BANG_(n),!0):!1}function vn(t,e,n){return l(function*(){let r=t,o=e,u=n;e===void 0&&(r=0,o=t);let i=r||0;u=n??1;const c=u>=0;for(;o===void 0||c&&i<o||!c&&o<i;)yield i,i+=u})}function Mn(t,e){const n=t.exec(e);return n&&e===n[0]?n.length===1?n[0]:n:null}function En(t,e){if(ot(e)){const n=t.exec(e);return n!=null?n.length===1?n[0]:[...n]:null}else throw new TypeError("re-find must match against a string.")}function Rn(t){if(t instanceof RegExp)return t;const e=t.match(/^\(\?([dgimsuvy]*)\)/);return e?new RegExp(t.slice(e[0].length),e[1]):new RegExp(t)}function Sn(t,e,n){return t.slice(e,n)}function J(...t){return t}const kn=J;function Nn(t){return p(t)===x}function X(...t){if(t.length===2){const[r,o]=t,u=f(r),i=s(o);if(Array.isArray(i)){const c=new Array(i.length);for(var e=0;e<i.length;e++)c[e]=u(i[e]);return c}else{var n=[];for(const c of i)n.push(u(c));return n}}return[...k(...t)]}function Q(t){return H(t)?t:[...s(t)]}function Qn(t){return new Set(s(t))}function jn(t){return p(t)===m}const Ut=Symbol("IApply__apply");function Jt(t,...e){t=f(t);const n=e.slice(0,e.length-1),r=s(e[e.length-1]),o=t[Ut];return o?o(...n,r):t(...n,...r)}function Xt(t){return t%2==0}function Kn(t){return!Xt(t)}function z(t){return t=f(t),(...e)=>ht(t(...e))}function In(t){return(...e)=>t}class Z extends Array{constructor(...e){super(),this.push(...e)}}function Tn(t){return p(t)===M}function Zt(...t){return new Z(...t)}function H(t){return Array.isArray(t)}function _t(t){return l(function*(){for(const e of t)yield*s(e)})}function Ht(...t){return _t(t)}Ht[Ut]=t=>_t(t);function Gn(t,...e){if(e.length===0)return It(k(t),Se);{const n=k(t,...e);return _t(n)}}function te(t){return t}function ee(...t){return l(function*(){const e=t.map(n=>D(s(n)));for(;;){const n=[];for(const r of e){const o=r.next();if(o.done)return;n.push(o.value)}yield*n}})}function On(t){return e=>{let n=!1;return(...r)=>{switch(r.length){case 0:return e();case 1:return e(r[0]);case 2:if(n){const o=e(r[0],t);return R(o)?o:e(o,r[1])}else return n=!0,e(r[0],r[1])}}}}function $n(t,e){return arguments.length===1?On(t):rt(1,ee(xt(t),e))}function Bn(t,e){const n=p(t),r=F(n)||{};for(const o of e){const u=w(t,o);u!=null&&A(r,o,u)}return r}function dt(t){return R(t)?N(t):t}function zn(t){return e=>{let n=[];return(...r)=>{let o,u;switch(r.length){case 0:return e();case 1:return o=r[0],n.length!==0&&(u=[...n],n=[],o=dt(e(o,u))),e(o);case 2:return o=r[0],n.push(r[1]),t===n.length?(u=[...n],n=[],e(o,u)):o}}}}function ne(t,...e){if(arguments.length===1)return zn(t);let n=t,r=e[0];return e.length===2&&([n,r]=e),oe(t,n,[],r,!0)}function re(t,...e){let n=t,r=[],o=e[0];return e.length===2?[n,o]=e:e.length>2&&([n,r,o]=e),oe(t,n,r,o,!1)}const qn=re,Ln=ne;function oe(t,e,n,r,o){return l(function*(){let u=[],i=0;for(const c of s(r))i<t&&(u.push(c),u.length===t&&(yield u,u=e<t?u.slice(e):[])),i++,i===e&&(i=0);u.length>0&&(u.length===t||o?yield u:n.length&&(u.push(...n.slice(0,t-u.length)),yield u))})}function Fn(t){return e=>{let n=[];const r={};let o=r;return(...u)=>{const i=u.length;if(i===0)return e();if(i===1){let c=u[0];if(n.length!==0){const a=[...n];n=[],c=dt(e(c,a))}return e(c)}if(i===2){const c=u[0],a=u[1],g=o,y=t(a);if(o=y,g===r||y===g)return n.push(a),c;{const je=[...n];n=[];const Mt=e(c,je);return R(Mt)||n.push(a),Mt}}}}}function Pn(t,e){return t=f(t),arguments.length===1?Fn(t):l(function*(){const n=D(e),r=n.next();r.done&&(yield*null);const o=r.value;let u=t(o),i=[o],c=[];for(;;){const a=n.next();if(a.done){yield i;break}const g=a.value,y=t(g);u==y?i.push(g):(yield i,c.push(g),i=c,u=y,c=[])}})}function tt(t){const e=p(t);if(e!=null)return F(e);throw new Error(`Can't create empty of ${typeof t}`)}function Yn(...t){const e=t[0];let n;return e==null?n={}:n=ce(tt(e),e),Y(n,...t.slice(1))}function ue(t){return t[0]}function ie(t){return t[1]}function Cn(t,...e){t=f(t);var n=!1;for(const r of e)if(r!=null){n=!0;break}if(n){const r=(u,i)=>{const c=ue(i),a=ie(i);return $t(u,c)?K(u,c,t(w(u,c),a)):K(u,c,a)};return S((u,i)=>S(r,u||{},E(i)),e)}else return null}function Dn(){return performance.now()}function ce(...t){let e,n,r,o,u;switch(t.length){case 0:return[];case 1:return t[0];case 2:return Gt(t[0]??[],...s(t[1]));case 3:return e=t[0],n=t[1],r=t[2],o=G(e),u=(i,c)=>c===void 0?i:Y(i,c),vt(n,u,o,r);default:throw TypeError(`Invalid arity call of into: ${t.length}`)}}function Vn(t,e){return t===e}function xt(...t){if(t.length==0||t.length>2)throw new Error(`Invalid arity: ${t.length}`);return{[at]:!0,[Ft]:t.length==1?function*(){const e=t[0];for(;;)yield e}:function*(){const[e,n]=t;for(var r=0;r<e;r++)yield n}}}function se(t){return R(t)?t:W(t)}function Wn(t){return e=>{let n=t;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1){const u=r[0];return e(u)}if(o===2){let u=r[0];const i=r[1],c=n,a=(n=n-1,n);return c>0&&(u=e(u,i)),a>0?u:se(u)}}}}function et(t,e){return arguments.length===1?Wn(t):l(function*(){let n=t-1;for(const r of s(e))if(n-->=0&&(yield r),n<0)return})}function Un(t,e){if(t<=0)return null;if(Array.isArray(e))return E(e.slice(-t));{const n=new Array(t);let r=0;for(const o of s(e))n[r%t]=o,r++;return r%t!==0&&r>=t?n.slice(r%t).concat(n.slice(0,r%t)):(n.length=Math.min(r,t),n)}}function Jn(t){return e=>(...n)=>{const r=n.length;if(r===0)return e();if(r===1)return e(n[0]);if(r===2){const o=n[0],u=n[1];return _(t(u))?e(o,u):W(o)}}}function nt(t,e){return t=f(t),arguments.length===1?Jn(t):l(function*(){for(const n of s(e))if(_(t(n)))yield n;else return})}function Xn(t){return e=>{let n=-1;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=r[0],i=r[1];return n++,ke(n,t)===0?e(u,i):u}}}}function Zn(t,e){return arguments.length===1?Xn(t):t<=0?xt(I(e)):l(function*(){let n=0;for(const r of s(e))n%t===0&&(yield r),n++})}function Hn(t,...e){return t=f(t),function(...n){return t(...e,...n)}}function tr(t){return l(function*(){for(;;)yield*t})}function er(t){return e=>{let n=t;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=r[0],i=r[1],c=n;return n--,c>0?u:e(u,i)}}}}function rt(t,e){return arguments.length===1?er(t):l(function*(){const n=C(s(e));for(let r=0;r<t;r++)n.next();yield*n})}function nr(t){return e=>{let n=!0;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=n,i=r[0],c=r[1];return u&&_(t(c))?i:(n=null,e(i,c))}}}}function fe(t,e){return t=f(t),arguments.length===1?nr(t):l(function*(){const n=C(s(e));for(;;){const r=n.next();if(r.done)break;const o=r.value;if(!_(t(o))){yield o;break}}yield*n})}function rr(){return t=>{const e=new Set;return(...n)=>{const r=n.length;if(r===0)return t();if(r===1)return t(n[0]);if(r===2){const o=n[0],u=n[1];return e.has(u)?o:(e.add(u),t(o,u))}}}}function or(t){return arguments.length===0?rr():l(function*(){const e=new Set;for(const n of s(t))e.has(n)||(yield n),e.add(n)})}function ur(t,e,n,...r){return n=f(n),K(t,e,n(w(t,e),...r))}function yt(t,e,n){let r=t;for(const o of e)r=w(r,o);return r===void 0?n:r}function ir(t,e,n,...r){return n=f(n),jt(t,e,n(yt(t,e),...r))}function mt(t,e,...n){return t=f(t),function(r,...o){return r?t(r,...n,...o):t(e,...n,...o)}}function le(t,e){t=f(t);for(const n of s(e))if(!t(n))return!1;return!0}function cr(t,e){return!le(t,e)}function sr(t){return e=>(...n)=>{const r=n.length;if(r===0)return e();if(r===1)return e(n[0]);if(r===2){const o=n[0],u=n[1],i=t(u);return i==null?o:e(o,i)}}}function fr(t,e){return t=f(t),arguments.length===1?sr(t):l(function*(){for(const n of s(e)){const r=t(n);_(r)&&(yield r)}})}function lr(t){return t=s(t),[...t].reverse()}function wt(t,e){return arguments.length===1&&(e=t,t=void 0),t=f(t),e=s(e),[...e].sort(t||b)}function ar(t){return t===b?t:(e,n)=>{const r=t(e,n);return me(r)?r:r?-1:t(n,e)?1:0}}function pr(t,e,n){return arguments.length===2&&(n=e,e=b),t=f(t),e=f(e),wt((r,o)=>{const u=ar(e),i=t(r),c=t(o);return u(i,c)},n)}function hr(t){const e=[...t];let n=e.length;for(;n;){const r=Math.floor(Math.random()*n--),o=e[n];e[n]=e[r],e[r]=o}return e}function ae(t,e){t=f(t);for(const n of s(e)){const r=t(n);if(_(r))return r}}function _r(t,e){return t=f(t),!ae(t,e)}function dr(t,e){return(Array.isArray(e)?X:k)(r=>{const o=t[r];return o!==void 0?o:r},e)}function xr(t){return!E(t)}function yr(t){return t===void 0&&(t=1),Math.random()*t}function pe(t){return Math.floor(Math.random()*t)}function mr(t){const e=pe(q(t));return zt(t,e)}function wr(t){return l(function*(){for(;;)yield t()})}function gr(t,e){arguments.length===1&&(e=t,t=void 0);const n=wr(e);return t?et(t,n):n}function gt(t,e,n,...r){n=f(n);const o=w(t,e);return A(t,e,n(o,...r))}function Ar(t,e){t=f(t);const n={};for(const r of s(e)){const o=t(r);gt(n,o,mt(Y,[]),r)}return n}function br(t){const e={},n=mt(Bt,0);for(const r of s(t))gt(e,r,n);return e}class vr{constructor(e){this.f=e,this.res=void 0}*[Symbol.iterator](){this.res===void 0&&(this.res=this.f(),this.f=null),yield*s(this.res)}}function Mr(t){const e=[...s(t)];return e.pop(),e.length>0?e:null}function Er(...t){const[e,n]=t.length>1?t:[1,t[0]];return k((r,o)=>r,n,rt(e,n))}function Rr(t,e){return[et(t,e),rt(t,e)]}function Sr(t,e){return[nt(t,e),fe(t,e)]}function q(t){if(!t)return 0;const e=t.length||t.size;if(typeof e=="number")return e;let n=0;for(const r of s(t))n++;return n}function kr(t){return t===!0}function Nr(t){return t===!1}function Qr(t){return t!=null}function jr(t){return!!t}function Kr(t){return t===0}function Ir(t){return t<0}function Tr(t){return t>0}function Gr(...t){let e=0;const n={};for(;!(e>=t.length);)n[t[e]]=t[e+1],e=e+2;return n}function Or(t){return t.length}function $r(t,e,n,...r){if(r.length==0)return t[e]=n,n;{const o=[e,n,...r],u=o[o.length-1];let i=t,c=0;const a=o.length-2;for(;c<a;c++)i=i[o[c]];return i[o[c]]=u,n}}function Br(t){for(const e of s(t));return null}function zr(t){return Q(t)}function qr(t){return[...t]}function Lr(t,e,n){return t._add_watch(e,n)}function Fr(t,e){return t._remove_watch(e)}function At(t,e,n){if(!n)return e;var r=e;for(const o of s(n))r=t(r,o[0],o[1]);return r}function he(t,e,...n){return e==null?t:Math.max(t,e,...n)}function Pr(t,e,...n){return e==null?t:Math.min(t,e,...n)}function _e(t){return t==null?!1:!!(P(t)||t instanceof Map)}function Yr(...t){return(...e)=>{for(const n of t)for(const r of e)if(!n(r))return!1;return!0}}function Cr(...t){return(...e)=>{for(const n of t)for(const r of e){const o=n(r);if(o)return o}}}function de(t,e){return Q(e||t)}function Dr(t,e){var n=e;return l(function*(){for(;;)yield n,n=t(n)})}function Vr(...t){return t=t.map(f),(...e)=>{const n=[];for(const r of t)n.push(r(...e));return n}}function ct(t){if(Array.isArray(t)){const e=t.slice(1);return e.length>0?e:null}else return E(V(t))}function Wr(t){return ct(ct(t))}function b(t,e){if(t===e)return 0;{if(t==null)return-1;if(e==null)return 1;const n=typeof t,r=typeof e;if(n==="number"&&r==="number"||n==="string"&&r==="string")return t===e?0:t<e?-1:1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length<e.length)return-1;if(t.length>e.length)return 1;for(let o=0;o<t.length;o++){const u=b(t[o],e[o]);if(u!=0)return u}return 0}else throw new Error(`comparing ${n} to ${r}`)}}function Ur(t){return de(t)}function _(t){return t!=null&&t!==!1}const Jr=_;function xe(t,e,n){return t.substring(e,n)}function ye(t){return typeof t=="function"}function Xr(t,e){return l(function*(){for(;;){const n=t.exec(e);if(n){const r=n[0];yield n.length===1?r:Q(n);const u=n.index+he(1,r.length);if(u>e.length)break;e=xe(e,u)}else break}})}function Zr(t){return Number.isNaN(t)}function me(t){return typeof t=="number"}function we(t){if(t==null)return;switch(p(t)){case d:return Object.keys(t);case h:return Array.from(t.keys())}}function Hr(t){return we(t)}function to(t){if(t==null)return;switch(p(t)){case d:return Object.values(t);case h:return Array.from(t.values())}}function ot(t){return typeof t=="string"}function eo(t){return p(t)!=null}function no(t){return t instanceof RegExp}class bt extends Error{constructor(e,n,r){super(e),this._data=n,this._cause=r}}function ro(t){return t instanceof bt?t._data:null}function oo(t){return t instanceof Error?t.message:null}function uo(t){return t instanceof bt?t._cause:null}function io(t,e,n){return new bt(t,e,n)}function O(t){return Number.isInteger(t)}const co=O;function so(t){return O(t)&&t>0}function fo(t){return O(t)&&t>-1}function lo(t){return O(t)&&t<0}const st=Symbol("meta");function ao(t){return t instanceof Object?t[st]:null}function po(t,e){if(typeof t=="function"){const r=function(...o){return t.apply(this,o)};return r[st]=e,r}const n=G(t);return n[st]=e,n}function ho(t){return t===!0||t===!1}function ge(t){switch(p(t)){case x:case h:case d:case M:case m:return!0}return!1}function _o(t,e){return ge(e)?q(e):q(et(t,e))}function xo(t,e){const n=w(t,e);if(n!==void 0)return[e,n]}function yo(t,e){return(t%e+e)%e}function mo(t,e,...n){if(n.length==0)return e;var r=t(e),o=e;return n.forEach(u=>{var i=t(u);i<=r&&(r=i,o=u)}),o}function wo(t,e,...n){if(n.length==0)return e;var r=t(e),o=e;return n.forEach(u=>{var i=t(u);i>=r&&(r=i,o=u)}),o}function Ae(t){throw new Error(`Expected string, got: ${typeof t}`)}function go(t){if(ot(t)){if(/^[+-]?\d+$/.test(t)){const e=parseInt(t);if(Number.MIN_SAFE_INTEGER<=e<=Number.MAX_SAFE_INTEGER)return e}return null}return Ae(t)}function Ao(t){if(ot(t))return/^[\\x00-\\x20]*[+-]?NaN[\\x00-\\x20]*$/.test(t)?NaN:/^[\\x00-\\x20]*[+-]?(Infinity|((\d+\.?\d*|\.\d+)([eE][+-]?\d+)?)[dDfF]?)[\\x00-\\x20]*$/.test(t)?parseFloat(t):null;throw new Ae(t)}function be(t){return t>=0?Math.floor(t):Math.ceil(t)}function ve(t,e){const n=t%e;return be((t-n)/e)}function Me(t,...e){if(e.length==0)for(;;){const n=t();if(_(ye(n))){t=n;continue}else return n}else return Me(function(){return Jt(t,e)})}function vt(t,...e){switch(e.length){case 2:{const n=e[0],r=e[1];return vt(t,n,n(),r)}default:{let n=e[0];const r=e[1],o=e[2];n=t(n);const u=S(n,r,o);return n(u)}}}function bo(t,e){const n={},r=s(t)[Symbol.iterator](),o=s(e)[Symbol.iterator]();let u,i;for(;u=r.next(),!(u.done||(i=o.next(),i.done));)n[u.value]=i.value;return n}function vo(t){return E(t)?t:null}function Ee(t,e,n){const r=function*(o){if(yield o,_(t(o)))for(const u of s(e(o)))yield*r(u)};return l(function*(){yield*r(n)})}function Mo(t){return U(z(it),V(Ee(it,E,t)))}function Eo(t){return G(t)}function Ro(t){return Object.freeze(t)}class ${constructor(e){e instanceof $||(e=wt(e));const r=new Set(e);this._elts=[...r],this._set=r}add(e){if(this._set.has(e))return this;const n=this._elts;let r=!1;for(let o=0;o<n.length;o++)if(b(e,n[o])<=0){n.splice(o,0,e),r=!0;break}return r?this._set=new Set(n):(n.push(e),this._set.add(e)),this.size=n.length,this}delete(e){if(!this._set.has(e))return this;const n=this._elts,r=n.indexOf(e);return n.splice(r,1),this._set=new Set(n),this.size=n.length,this}has(e){return this._set.has(e)}keys(){return this.values()}values(){return this._elts[Symbol.iterator]()}entries(){return this._set.entries()}forEach(...e){return this.set.forEach(...e)}clear(){this._elts=[],this._set=new Set(this._elts)}[Symbol.iterator](){return this.keys()}}function So(...t){return new $(t)}function ft(t,e,n){return r=>e(b(r,n),0)}function Re(t,e,n=!0){let r=0;for(;r<t.length&&b(e,t[r])>0;r++);return r}function ko([t,e,n]){const r=ft(t,e,n);if(e===kt||e===Nt){const o=[...t],u=Re(o,n,!0);return o.splice(0,u),r(o[0])||o.splice(0,1),o}else return[...nt(r,t)]}function No([t,e,n,r,o]){const u=[...t],i=Re(u,n,!0);u.splice(0,i);const c=ft(t,r,o);return ft(t,e,n)(u[0])||u.splice(0,1),[...nt(c,u)]}function Qo(...t){if(t.length===3)return ko(t);if(t.length===5)return No(t)}function jo(t){return Math.abs(t)}function Ko(t){return be(t)}function Io(t){return t!=null&&t.constructor}function To(t){return(e,n)=>{const r=t(e,n);return R(r)?W(r):r}}function Se(t){return t=To(t),(...e)=>{switch(e.length){case 0:return t();case 1:return t(e[0]);case 2:return S(t,e[0],e[1])}}}function ke(t,e){const n=ve(t,e);return t-e*n}function Go(t){const e=new Map;return(...n)=>{const r=[n.length,...n],o=yt(e,r);if(o===void 0){const u=t(...n);return Kt(e,r,u),u}else return o}}function Oo(t){return H(t)?t[t.length-1]:I(t)}function $o(t){if(H(t)){const e=[...t];return e.pop(),e}else return V(t)}function Bo(t,e){const n=tt(t),r=Qt(t)||A;return At((o,u,i)=>r(o,e(u),i),n,t),n}function Ne(t,e){const n=tt(t),r=Qt(t)||A;return At((o,u,i)=>r(o,u,e(i)),n,t),n}function zo(){return crypto.randomUUID()}class qo{constructor(e){this.f=e}_deref(){return this.realized?this.v:(this.v=this.f(),this.realized=!0,this.v)}}function lt(t,e){if(e.has(t))return t;if(e.add(t),_e(t))return Ne(t,r=>lt(r,e));const n=p(t);return n&&n!=d?X(r=>lt(r,e),t):t}function Lo(t){return lt(t,new Set)}function Fo(t,e){S((n,r)=>t(r),null,e)}function Po(...t){return ht(St(...t))}class Yo{constructor(e){this.v=e}_deref(){return this.v}}function Co(t){return new Yo(t)}function Do(t,e){t.v=e}function v(t,e=new WeakSet){if(t==null)return"nil";if(typeof t=="number"||typeof t=="boolean")return String(t);if(typeof t=="string")return JSON.stringify(t);if(typeof t=="bigint")return`${t}N`;if(typeof t=="object"){if(e.has(t))return"#object[circular]";e.add(t);const n=p(t);let r;switch(n){case x:return`[${t.map(o=>v(o,e)).join(" ")}]`;case m:return`#{${Array.from(t).map(o=>v(o,e)).join(" ")}}`;case h:return`#js/Map {${Array.from(t.entries()).map(([o,u])=>`${v(o,e)} ${v(u,e)}`).join(", ")}}`;case L:case M:return`(${X(o=>`${v(o,e)}`,t).join(", ")})`;default:return r=Object.keys(t),`{${r.map(o=>`:${o} ${v(t[o],e)}`).join(", ")}}`}}return`#object[${t.constructor.name}]`}function Qe(...t){return t.map((e,n)=>v(e)).join(" ")}function Vo(...t){return console.log(Qe(...t))}return $e(Wo);})();
|
|
1
|
+
var squint;(squint||={}).core=(()=>{var ct=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var Te=Object.prototype.hasOwnProperty;var $e=(t,e)=>{for(var n in e)ct(t,n,{get:e[n],enumerable:!0})},Ge=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Oe(e))!Te.call(t,o)&&o!==n&&ct(t,o,{get:()=>e[o],enumerable:!(r=Ie(e,o))||r.enumerable});return t};var Be=t=>Ge(ct({},"__esModule",{value:!0}),t);var nu={};$e(nu,{Atom:()=>Wt,Cons:()=>Vt,Delay:()=>Uo,IIterable:()=>ht,IIterable__iterator:()=>Dt,LazySeq:()=>Qr,NaN_QMARK_:()=>io,PROTOCOL_SENTINEL:()=>wn,_:()=>Pe,_EQ_:()=>T,_GT_:()=>kt,_GT__EQ_:()=>Kt,_LT_:()=>ze,_LT__EQ_:()=>qe,_PLUS_:()=>Le,_STAR_:()=>Fe,__protocol_satisfies:()=>De,__toFn:()=>f,_iterator:()=>U,abs:()=>zo,aclone:()=>Yr,add_watch:()=>Cr,alength:()=>Lr,any_QMARK_:()=>ro,apply:()=>Zt,array:()=>kn,array_QMARK_:()=>et,aset:()=>Fr,assoc:()=>j,assoc_BANG_:()=>A,assoc_in:()=>It,assoc_in_BANG_:()=>Ot,atom:()=>gn,boolean$:()=>$r,boolean_QMARK_:()=>bo,bounded_count:()=>vo,butlast:()=>Nr,cat:()=>Qe,clj__GT_js:()=>Wo,coll_QMARK_:()=>fo,comp:()=>Tt,compare:()=>b,compare_and_set_BANG_:()=>Mn,complement:()=>L,concat:()=>ee,conj:()=>Gt,conj_BANG_:()=>V,cons:()=>sn,constantly:()=>Tn,contains_QMARK_:()=>zt,count:()=>P,counted_QMARK_:()=>Ae,cycle:()=>rr,dec:()=>He,dedupe:()=>fr,deref:()=>N,disj:()=>Je,disj_BANG_:()=>Bt,dissoc:()=>Ze,dissoc_BANG_:()=>Xe,distinct:()=>cr,distinct_QMARK_:()=>oo,doall:()=>Dr,dorun:()=>Pr,drop:()=>ut,drop_last:()=>kr,drop_while:()=>ae,empty:()=>nt,empty_QMARK_:()=>Ar,ensure_reduced:()=>le,es6_iterator:()=>W,even_QMARK_:()=>Ht,every_QMARK_:()=>pe,every_pred:()=>Wr,ex_cause:()=>ho,ex_data:()=>ao,ex_info:()=>_o,ex_message:()=>po,false_QMARK_:()=>Or,ffirst:()=>nn,filter:()=>Z,filterv:()=>fn,find:()=>Mo,first:()=>I,flatten:()=>jo,fn_QMARK_:()=>Mt,fnil:()=>gt,frequencies:()=>Sr,get:()=>w,get_in:()=>wt,group_by:()=>Rr,identical_QMARK_:()=>Jn,identity:()=>ne,ifn_QMARK_:()=>no,inc:()=>qt,int_QMARK_:()=>B,integer_QMARK_:()=>xo,interleave:()=>re,interpose:()=>qn,into:()=>fe,into_array:()=>ye,iterable:()=>s,iterate:()=>Xr,js_keys:()=>co,js_obj:()=>qr,juxt:()=>Zr,keep:()=>_r,keep_indexed:()=>dn,key:()=>ce,keys:()=>ge,last:()=>rn,lazy:()=>l,list:()=>te,list_QMARK_:()=>$n,list_STAR_:()=>Gn,long$:()=>qo,map:()=>Q,map_QMARK_:()=>xe,map_indexed:()=>pn,mapcat:()=>Bn,mapv:()=>tt,max:()=>de,max_key:()=>So,memoize:()=>Po,merge:()=>Vn,merge_with:()=>Un,meta:()=>go,min:()=>Ur,min_key:()=>Ro,mod:()=>Eo,name:()=>yn,nat_int_QMARK_:()=>mo,neg_QMARK_:()=>Br,neg_int_QMARK_:()=>wo,next:()=>ft,nil_QMARK_:()=>mn,nnext:()=>Hr,not:()=>dt,not_EQ_:()=>Xo,not_any_QMARK_:()=>wr,not_empty:()=>Ko,not_every_QMARK_:()=>pr,nth:()=>Lt,number_QMARK_:()=>we,object_QMARK_:()=>Ue,odd_QMARK_:()=>On,parse_double:()=>No,parse_long:()=>Qo,partial:()=>nr,partition:()=>ue,partition_all:()=>oe,partition_by:()=>Cn,partitionv:()=>Pn,partitionv_all:()=>Dn,peek:()=>Do,persistent_BANG_:()=>Oo,pop:()=>Yo,pos_QMARK_:()=>zr,pos_int_QMARK_:()=>yo,pr_str:()=>Ke,println:()=>tn,prn:()=>eu,quot:()=>Me,rand:()=>br,rand_int:()=>_e,rand_nth:()=>vr,random_uuid:()=>Vo,range:()=>En,re_find:()=>Sn,re_matches:()=>Rn,re_pattern:()=>Qn,re_seq:()=>uo,reduce:()=>S,reduce_kv:()=>vt,reduced:()=>X,reduced_QMARK_:()=>R,reductions:()=>un,regexp_QMARK_:()=>lo,rem:()=>Ne,remove:()=>ln,remove_watch:()=>Vr,repeat:()=>mt,repeatedly:()=>Er,replace:()=>gr,reset_BANG_:()=>Jt,reset_vals_BANG_:()=>vn,rest:()=>J,reverse:()=>dr,run_BANG_:()=>Jo,satisfies_QMARK_:()=>Ye,second:()=>en,select_keys:()=>Ln,seq:()=>E,seq_QMARK_:()=>Ft,seqable_QMARK_:()=>Pt,sequential_QMARK_:()=>st,set:()=>jn,set_QMARK_:()=>In,shuffle:()=>mr,some:()=>he,some_QMARK_:()=>Tr,some_fn:()=>Jr,sort:()=>At,sort_by:()=>yr,sorted_set:()=>To,split_at:()=>Kr,split_with:()=>jr,str:()=>xn,string_QMARK_:()=>it,subs:()=>me,subseq:()=>Bo,subvec:()=>Nn,swap_BANG_:()=>An,swap_vals_BANG_:()=>bn,system_time:()=>Wn,t:()=>eo,take:()=>rt,take_last:()=>Zn,take_nth:()=>er,take_while:()=>ot,to_array:()=>to,trampoline:()=>Ee,transduce:()=>Rt,transient$:()=>Io,tree_seq:()=>Re,true_QMARK_:()=>Ir,truth_:()=>h,type:()=>Lo,unreduced:()=>yt,update:()=>lr,update_BANG_:()=>bt,update_in:()=>ar,update_keys:()=>Co,update_vals:()=>ke,val:()=>se,vals:()=>so,vec:()=>k,vector:()=>H,vector_QMARK_:()=>Kn,volatile_BANG_:()=>Ho,vreset_BANG_:()=>tu,warn_on_lazy_reusage_BANG_:()=>cn,with_meta:()=>Ao,zero_QMARK_:()=>Gr,zipmap:()=>ko});function f(t){if(t==null||typeof t=="function")return t;const e=typeof t;return e==="string"?(n,r)=>w(n,t,r):e==="object"?(n,r)=>w(t,n,r):t}var Qt=Object.prototype.hasOwnProperty;function Nt(t,e,n){for(n of t.keys())if(K(n,e))return n}function K(t,e){if(t===e)return!0;var n,r,o;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Array){if((r=t.length)===e.length)for(;r--&&K(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(const u of t)if(o=u,o&&typeof o=="object"&&(o=Nt(e,o),!o)||!e.has(o))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(const u of t)if(o=u[0],o&&typeof o=="object"&&(o=Nt(e,o),!o)||!K(u[1],e.get(o)))return!1;return!0}if(!n||typeof t=="object"){r=0;for(const u in t)if(Qt.call(t,u)&&++r&&!Qt.call(e,u)||!(u in e)||!K(t[u],e[u]))return!1;return Object.keys(e).length===r}}return!1}function O(t,e){return t.every(function(n,r){return r===0||e(t[r-1],n)})}function T(...t){return O(t,(e,n)=>K(e,n))}function kt(...t){return O(t,(e,n)=>e>n)}function Kt(...t){return O(t,(e,n)=>e>=n)}function ze(...t){return O(t,(e,n)=>e<n)}function qe(...t){return O(t,(e,n)=>e<=n)}function Le(...t){return t.reduce((e,n)=>e+n,0)}function Fe(...t){return t.reduce((e,n)=>e*n,1)}function Pe(...t){return t.length==1?0-t[0]:t.reduce((e,n)=>e-n)}const De={};function Ye(t,e){return e==null?t[null]:typeof t=="symbol"?e[t]:e[t.__sym]}function Ce(t,e,n){return t.set(e,n),t}function Ve(t,e,n){return t[e]=n,t}function jt(t){switch(p(t)){case _:return Ce;case x:case d:return Ve}}function A(t,e,n,...r){if(r.length%2!==0)throw new Error("Illegal argument: assoc expects an odd number of arguments.");switch(p(t)){case _:t.set(e,n);for(let o=0;o<r.length;o+=2)t.set(r[o],r[o+1]);break;case x:case d:t[e]=n;for(let o=0;o<r.length;o+=2)t[r[o]]=r[o+1];break;default:throw new Error(`Illegal argument: assoc! expects a Map, Array, or Object as the first argument, but got ${typeof t}.`)}return t}function $(t){switch(p(t)){case _:return new Map(t);case m:return new t.constructor(t);case x:return[...t];case d:return{...t};default:throw new Error(`Don't know how to copy object of type ${typeof t}.`)}}function j(t,e,n,...r){t||(t={});const o=$(t);return A(o,e,n,...r),o}const _=1,x=2,d=3,M=4,m=5,D=6;function Y(t){switch(t){case _:return new Map;case x:return[];case d:return{};case M:return new G;case m:return new Set;case D:return l(function*(){})}}function C(t){return t.constructor===Object}function Ue(t){return t!=null&&C(t)}function p(t){if(t!=null){if(C(t))return d;if(t instanceof Map)return _;if(t instanceof Set)return m;if(t instanceof G)return M;if(Array.isArray(t))return x;if(t instanceof _t)return D;if(t instanceof z)return m;if(t instanceof Object)return d}}function We(t,e,n,r,o){r=k(r),n=n||{};const u=p(n);if(u!==_&&u!==x&&u!==d)throw new Error(`Illegal argument: ${e} expects the first argument to be a Map, Array, or Object.`);const i=[n];let c=n;for(let a=0;a<r.length-1;a+=1){const g=r[a];let y;c instanceof Map?y=c.get(g):y=c[g],y||(y=Y(u)),i.push(y),c=y}i.push(o);for(let a=i.length-2;a>=0;a-=1)i[a]=t(i[a],r[a],i[a+1]);return i[0]}function It(t,e,n){return We(j,"assoc-in",t,e,n)}function Ot(t,e,n){e=k(e);var r=t;const o=p(t);for(const u of e.splice(0,e.length-1)){let i=w(r,u);i===void 0&&(i=Y(o),A(r,u,i)),r=i}return A(r,e[e.length-1],n),t}function Tt(...t){if(t=t.map(f),t.length===0)return ne;if(t.length===1)return t[0];const[e,...n]=t.slice().reverse();return function(...r){let o=e(...r);for(const u of n)o=u(o);return o}}function $t(t,e){for(const n of e)t.add(n);return t}function V(...t){if(t.length===0)return H();const[e,...n]=t;let r=e;switch(r==null&&(r=[]),p(r)){case m:$t(r,n);break;case M:r.unshift(...n.reverse());break;case x:r.push(...n);break;case _:for(const o of n)Array.isArray(o)?r.set(o[0],o[1]):s(o).forEach(u=>{r.set(u[0],u[1])});break;case d:for(const o of n)Array.isArray(o)?r[o[0]]=o[1]:Object.assign(r,o);break;default:throw new Error("Illegal argument: conj! expects a Set, Array, List, Map, or Object as the first argument.")}return r}function Gt(...t){if(t.length===0)return H();const[e,...n]=t;let r=e;r==null&&(r=te());let o,u;switch(p(r)){case m:return r instanceof z?$t(new r.constructor(r),n):new r.constructor([...r,...n]);case M:return new G(...n.reverse(),...r);case x:return[...r,...n];case _:o=new Map(r);for(const i of n)Array.isArray(i)?o.set(i[0],i[1]):s(i).forEach(c=>{o.set(c[0],c[1])});return o;case D:return l(function*(){yield*n,yield*r});case d:u={...r};for(const i of n)Array.isArray(i)?u[i[0]]=i[1]:Object.assign(u,i);return u;default:throw new Error("Illegal argument: conj expects a Set, Array, List, Map, or Object as the first argument.")}}function Bt(t,...e){for(const n of e)t.delete(n);return t}function Je(t,...e){const n=new t.constructor([...t]);return Bt(n,...e)}function zt(t,e){switch(p(t)){case m:case _:return t.has(e);case void 0:return!1;default:return e in t}}function Xe(t,...e){for(const n of e)delete t[n];return t}function Ze(t,...e){if(!t)return;if(e.length===0)return t;const n=$(t);switch(p(t)){case _:for(const r of e)n.delete(r);break;default:for(const r of e)delete n[r];break}return n}function qt(t){return t+1}function He(t){return t-1}function tn(...t){console.log(...t)}function Lt(t,e,n){if(t){var r=void 0;if(Array.isArray(t))r=t[e];else{const o=s(t);let u=0;for(const i of o)if(u++==e){r=i;break}}if(r!==void 0)return r}return n}function w(t,e,n=void 0){if(t==null)return n;let r;if(C(t))return r=t[e],r===void 0?n:r;let o;switch(p(t)){case m:t.has(e)&&(r=e);break;case _:r=t.get(e);break;case x:r=t[e];break;default:if(o=t.get,typeof o=="function")try{r=t.get(e);break}catch{}r=t[e];break}return r!==void 0?r:n}function Ft(t){return t!=null&&!!t[Symbol.iterator]}const st=Ft;function Pt(t){return t==null||!!t[Symbol.iterator]}function s(t){if(t==null)return[];if(Pt(t))return t;if(t instanceof Object)return Object.entries(t);throw new TypeError(`${t} is not iterable`)}const ht=Symbol("Iterable"),Dt=Symbol.iterator;function U(t){return t[Symbol.iterator]()}const W=U;function E(t){if(t==null)return t;const e=s(t);return e.length===0||e.size===0||e[Symbol.iterator]().next().done?null:e}function I(t){const[e]=s(t);return e}function en(t){const[e,n]=s(t);return n}function nn(t){return I(I(t))}function J(t){return l(function*(){let e=!0;for(const n of s(t))e?e=!1:yield n})}class q{value;constructor(e){this.value=e}_deref(){return this.value}}function rn(t){t=s(t);let e;switch(p(t)){case x:return t[t.length-1];default:for(const n of t)e=n;return e}}function X(t){return new q(t)}function R(t){return t instanceof q}function S(t,e,n){t=f(t);let r,o;if(arguments.length===2){const u=s(e)[Symbol.iterator](),i=u.next();i.done?o=t():o=i.value,r=u}else o=e,r=s(n);if(o instanceof q)return o.value;for(const u of r)if(o=t(o,u),o instanceof q){o=o.value;break}return o}function*on(t,e){const n=e.next();n.done?yield t():yield*Yt(t,n.value,e)}function*Yt(t,e,n){let r=e,o=n;for(;;){if(R(r)){yield r.value;return}else yield r;const u=o.next();if(u.done)break;r=t(r,u.value)}}function un(t,e,n){return t=f(t),arguments.length===2?l(function*(){yield*on(t,s(e)[Symbol.iterator]())}):l(function*(){yield*Yt(t,e,s(n)[Symbol.iterator]())})}var Ct=!1;function cn(){Ct=!0}class _t{constructor(e){this.gen=e,this.usages=0}[Symbol.iterator](){if(this.usages++,this.usages>=2&&Ct)try{throw new Error}catch(e){console.warn("Re-use of lazy value",e.stack)}return this.gen()}}_t.prototype[ht]=!0;function l(t){return new _t(t)}class Vt{constructor(e,n){this.x=e,this.coll=n}*[Symbol.iterator](){yield this.x,yield*s(this.coll)}}function sn(t,e){return new Vt(t,e)}function Q(t,...e){switch(t=f(t),e.length){case 0:return n=>(...r)=>{switch(r.length){case 0:return n();case 1:return n(r[0]);case 2:return n(r[0],t(r[1]));default:return n(r[0],t(...r.slice(1)))}};case 1:return l(function*(){for(const n of s(e[0]))yield t(n)});default:return l(function*(){const n=e.map(r=>W(s(r)));for(;;){const r=[];for(const o of n){const u=o.next();if(u.done)return;r.push(u.value)}yield t(...r)}})}}function Ut(t){return e=>(...n)=>{switch(n.length){case 0:return e();case 1:return e(n[0]);case 2:{const r=n[0],o=n[1];return h(t(o))?e(r,o):r}}}}function Z(t,e){return arguments.length===1?Ut(t):(t=f(t),l(function*(){for(const n of s(e))h(t(n))&&(yield n)}))}function fn(t,e){return[...Z(t,e)]}function ln(t,e){return arguments.length===1?Ut(L(t)):Z(L(t),e)}function an(t){return e=>{let n=-1;return(...r)=>{switch(r.length){case 0:return e();case 1:return e(r[0]);case 2:return e(r[0],t((n=n+1,n),r[1]))}}}}function pn(t,e){return t=f(t),arguments.length===1?an(t):l(function*(){let n=0;for(const r of s(e))yield t(n,r),n++})}function hn(t,e){return t=f(t),l(function*(){let n=0;for(const r of s(e)){const o=t(n,r);h(o)&&(yield o),n++}})}function _n(t){return e=>{let n=-1;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=r[0],i=r[1];n++;const c=t(n,i);return c==null?u:e(u,c)}}}}function dn(t,e){return arguments.length===1?_n(t):hn(t,e)}function xn(...t){return t.join("")}function yn(t){if(typeof t=="string")return t;throw new Error("Doesn't support name: "+typeof t)}function dt(t){return!h(t)}function mn(t){return t==null}const wn={};class Wt{constructor(e){this.val=e,this._watches={},this._deref=()=>this.val,this._hasWatches=!1,this._reset_BANG_=n=>{const r=this.val;if(this.val=n,this._hasWatches)for(const o of Object.entries(this._watches)){const u=o[0],i=o[1];i(u,this,r,n)}return n},this._add_watch=(n,r)=>{this._watches[n]=r,this._hasWatches=!0},this._remove_watch=n=>{delete this._watches[n]}}}function gn(t){return new Wt(t)}function N(t){return t._deref()}function Jt(t,e){t._reset_BANG_(e)}function An(t,e,...n){e=f(e);const r=e(N(t),...n);return Jt(t,r),r}function bn(t,e,...n){const r=N(t);e=f(e);const o=e(r,...n);return t._reset_BANG_(o),[r,o]}function vn(t,e){const n=N(t);return t._reset_BANG_(e),[n,e]}function Mn(t,e,n){return N(t)===e?(t._reset_BANG_(n),!0):!1}function En(t,e,n){return l(function*(){let r=t,o=e,u=n;e===void 0&&(r=0,o=t);let i=r||0;u=n??1;const c=u>=0;for(;o===void 0||c&&i<o||!c&&o<i;)yield i,i+=u})}function Rn(t,e){const n=t.exec(e);return n&&e===n[0]?n.length===1?n[0]:n:null}function Sn(t,e){if(it(e)){const n=t.exec(e);return n!=null?n.length===1?n[0]:[...n]:null}else throw new TypeError("re-find must match against a string.")}function Qn(t){if(t instanceof RegExp)return t;const e=t.match(/^\(\?([dgimsuvy]*)\)/);return e?new RegExp(t.slice(e[0].length),e[1]):new RegExp(t)}function Nn(t,e,n){return t.slice(e,n)}function H(...t){return t}const kn=H;function Kn(t){return p(t)===x}function tt(...t){if(t.length===2){const[r,o]=t,u=f(r),i=s(o);if(Array.isArray(i)){const c=new Array(i.length);for(var e=0;e<i.length;e++)c[e]=u(i[e]);return c}else{var n=[];for(const c of i)n.push(u(c));return n}}return[...Q(...t)]}function k(t){return et(t)?t:[...s(t)]}function jn(t){return new Set(s(t))}function In(t){return p(t)===m}const Xt=Symbol("IApply__apply");function Zt(t,...e){t=f(t);const n=e.slice(0,e.length-1),r=s(e[e.length-1]),o=t[Xt];return o?o(...n,r):t(...n,...r)}function Ht(t){return t%2==0}function On(t){return!Ht(t)}function L(t){return t=f(t),(...e)=>dt(t(...e))}function Tn(t){return(...e)=>t}class G extends Array{constructor(...e){super(),this.push(...e)}}function $n(t){return p(t)===M}function te(...t){return new G(...t)}function Gn(...t){const e=t.pop();return new G(...t,...s(e))}function et(t){return Array.isArray(t)}function xt(t){return l(function*(){for(const e of t)yield*s(e)})}function ee(...t){return xt(t)}ee[Xt]=t=>xt(t);function Bn(t,...e){if(e.length===0)return Tt(Q(t),Qe);{const n=Q(t,...e);return xt(n)}}function ne(t){return t}function re(...t){return l(function*(){const e=t.map(n=>W(s(n)));for(;;){const n=[];for(const r of e){const o=r.next();if(o.done)return;n.push(o.value)}yield*n}})}function zn(t){return e=>{let n=!1;return(...r)=>{switch(r.length){case 0:return e();case 1:return e(r[0]);case 2:if(n){const o=e(r[0],t);return R(o)?o:e(o,r[1])}else return n=!0,e(r[0],r[1])}}}}function qn(t,e){return arguments.length===1?zn(t):ut(1,re(mt(t),e))}function Ln(t,e){const n=p(t),r=Y(n)||{};for(const o of e){const u=w(t,o);u!=null&&A(r,o,u)}return r}function yt(t){return R(t)?N(t):t}function Fn(t){return e=>{let n=[];return(...r)=>{let o,u;switch(r.length){case 0:return e();case 1:return o=r[0],n.length!==0&&(u=[...n],n=[],o=yt(e(o,u))),e(o);case 2:return o=r[0],n.push(r[1]),t===n.length?(u=[...n],n=[],e(o,u)):o}}}}function oe(t,...e){if(arguments.length===1)return Fn(t);let n=t,r=e[0];return e.length===2&&([n,r]=e),ie(t,n,[],r,!0)}function ue(t,...e){let n=t,r=[],o=e[0];return e.length===2?[n,o]=e:e.length>2&&([n,r,o]=e),ie(t,n,r,o,!1)}const Pn=ue,Dn=oe;function ie(t,e,n,r,o){return l(function*(){let u=[],i=0;for(const c of s(r))i<t&&(u.push(c),u.length===t&&(yield u,u=e<t?u.slice(e):[])),i++,i===e&&(i=0);u.length>0&&(u.length===t||o?yield u:n.length&&(u.push(...n.slice(0,t-u.length)),yield u))})}function Yn(t){return e=>{let n=[];const r={};let o=r;return(...u)=>{const i=u.length;if(i===0)return e();if(i===1){let c=u[0];if(n.length!==0){const a=[...n];n=[],c=yt(e(c,a))}return e(c)}if(i===2){const c=u[0],a=u[1],g=o,y=t(a);if(o=y,g===r||y===g)return n.push(a),c;{const je=[...n];n=[];const St=e(c,je);return R(St)||n.push(a),St}}}}}function Cn(t,e){return t=f(t),arguments.length===1?Yn(t):l(function*(){const n=W(e),r=n.next();r.done&&(yield*null);const o=r.value;let u=t(o),i=[o],c=[];for(;;){const a=n.next();if(a.done){yield i;break}const g=a.value,y=t(g);u==y?i.push(g):(yield i,c.push(g),i=c,u=y,c=[])}})}function nt(t){const e=p(t);if(e!=null)return Y(e);throw new Error(`Can't create empty of ${typeof t}`)}function Vn(...t){const e=t[0];let n;return e==null?n={}:n=fe(nt(e),e),V(n,...t.slice(1))}function ce(t){return t[0]}function se(t){return t[1]}function Un(t,...e){t=f(t);var n=!1;for(const r of e)if(r!=null){n=!0;break}if(n){const r=(u,i)=>{const c=ce(i),a=se(i);return zt(u,c)?j(u,c,t(w(u,c),a)):j(u,c,a)};return S((u,i)=>S(r,u||{},E(i)),e)}else return null}function Wn(){return performance.now()}function fe(...t){let e,n,r,o,u;switch(t.length){case 0:return[];case 1:return t[0];case 2:return Gt(t[0]??[],...s(t[1]));case 3:return e=t[0],n=t[1],r=t[2],o=$(e),u=(i,c)=>c===void 0?i:V(i,c),Rt(n,u,o,r);default:throw TypeError(`Invalid arity call of into: ${t.length}`)}}function Jn(t,e){return t===e}function mt(...t){if(t.length==0||t.length>2)throw new Error(`Invalid arity: ${t.length}`);return{[ht]:!0,[Dt]:t.length==1?function*(){const e=t[0];for(;;)yield e}:function*(){const[e,n]=t;for(var r=0;r<e;r++)yield n}}}function le(t){return R(t)?t:X(t)}function Xn(t){return e=>{let n=t;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1){const u=r[0];return e(u)}if(o===2){let u=r[0];const i=r[1],c=n,a=(n=n-1,n);return c>0&&(u=e(u,i)),a>0?u:le(u)}}}}function rt(t,e){return arguments.length===1?Xn(t):l(function*(){let n=t-1;for(const r of s(e))if(n-->=0&&(yield r),n<0)return})}function Zn(t,e){if(t<=0)return null;if(Array.isArray(e))return E(e.slice(-t));{const n=new Array(t);let r=0;for(const o of s(e))n[r%t]=o,r++;return r%t!==0&&r>=t?n.slice(r%t).concat(n.slice(0,r%t)):(n.length=Math.min(r,t),n)}}function Hn(t){return e=>(...n)=>{const r=n.length;if(r===0)return e();if(r===1)return e(n[0]);if(r===2){const o=n[0],u=n[1];return h(t(u))?e(o,u):X(o)}}}function ot(t,e){return t=f(t),arguments.length===1?Hn(t):l(function*(){for(const n of s(e))if(h(t(n)))yield n;else return})}function tr(t){return e=>{let n=-1;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=r[0],i=r[1];return n++,Ne(n,t)===0?e(u,i):u}}}}function er(t,e){return arguments.length===1?tr(t):t<=0?mt(I(e)):l(function*(){let n=0;for(const r of s(e))n%t===0&&(yield r),n++})}function nr(t,...e){return t=f(t),function(...n){return t(...e,...n)}}function rr(t){return l(function*(){for(;;)yield*t})}function or(t){return e=>{let n=t;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=r[0],i=r[1],c=n;return n--,c>0?u:e(u,i)}}}}function ut(t,e){return arguments.length===1?or(t):l(function*(){const n=U(s(e));for(let r=0;r<t;r++)n.next();yield*n})}function ur(t){return e=>{let n=!0;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=n,i=r[0],c=r[1];return u&&h(t(c))?i:(n=null,e(i,c))}}}}function ae(t,e){return t=f(t),arguments.length===1?ur(t):l(function*(){const n=U(s(e));for(;;){const r=n.next();if(r.done)break;const o=r.value;if(!h(t(o))){yield o;break}}yield*n})}function ir(){return t=>{const e=new Set;return(...n)=>{const r=n.length;if(r===0)return t();if(r===1)return t(n[0]);if(r===2){const o=n[0],u=n[1];return e.has(u)?o:(e.add(u),t(o,u))}}}}function cr(t){return arguments.length===0?ir():l(function*(){const e=new Set;for(const n of s(t))e.has(n)||(yield n),e.add(n)})}const F=Symbol("dedupe-none");function sr(){return t=>{let e=F;return(...n)=>{const r=n.length;if(r===0)return t();if(r===1)return t(n[0]);if(r===2){const o=n[0],u=n[1],i=e!==F&&h(T(e,u));return e=u,i?o:t(o,u)}}}}function fr(t){return arguments.length===0?sr():l(function*(){let e=F;for(const n of s(t))(e===F||!h(T(e,n)))&&(yield n),e=n})}function lr(t,e,n,...r){return n=f(n),j(t,e,n(w(t,e),...r))}function wt(t,e,n){let r=t;for(const o of e)r=w(r,o);return r===void 0?n:r}function ar(t,e,n,...r){return n=f(n),It(t,e,n(wt(t,e),...r))}function gt(t,e,...n){return t=f(t),function(r,...o){return r?t(r,...n,...o):t(e,...n,...o)}}function pe(t,e){t=f(t);for(const n of s(e))if(!t(n))return!1;return!0}function pr(t,e){return!pe(t,e)}function hr(t){return e=>(...n)=>{const r=n.length;if(r===0)return e();if(r===1)return e(n[0]);if(r===2){const o=n[0],u=n[1],i=t(u);return i==null?o:e(o,i)}}}function _r(t,e){return t=f(t),arguments.length===1?hr(t):l(function*(){for(const n of s(e)){const r=t(n);h(r)&&(yield r)}})}function dr(t){return t=s(t),[...t].reverse()}function At(t,e){return arguments.length===1&&(e=t,t=void 0),t=f(t),e=s(e),[...e].sort(t||b)}function xr(t){return t===b?t:(e,n)=>{const r=t(e,n);return we(r)?r:r?-1:t(n,e)?1:0}}function yr(t,e,n){return arguments.length===2&&(n=e,e=b),t=f(t),e=f(e),At((r,o)=>{const u=xr(e),i=t(r),c=t(o);return u(i,c)},n)}function mr(t){const e=[...t];let n=e.length;for(;n;){const r=Math.floor(Math.random()*n--),o=e[n];e[n]=e[r],e[r]=o}return e}function he(t,e){t=f(t);for(const n of s(e)){const r=t(n);if(h(r))return r}}function wr(t,e){return t=f(t),!he(t,e)}function gr(t,e){return(Array.isArray(e)?tt:Q)(r=>{const o=t[r];return o!==void 0?o:r},e)}function Ar(t){return!E(t)}function br(t){return t===void 0&&(t=1),Math.random()*t}function _e(t){return Math.floor(Math.random()*t)}function vr(t){const e=_e(P(t));return Lt(t,e)}function Mr(t){return l(function*(){for(;;)yield t()})}function Er(t,e){arguments.length===1&&(e=t,t=void 0);const n=Mr(e);return t?rt(t,n):n}function bt(t,e,n,...r){n=f(n);const o=w(t,e);return A(t,e,n(o,...r))}function Rr(t,e){t=f(t);const n={};for(const r of s(e)){const o=t(r);bt(n,o,gt(V,[]),r)}return n}function Sr(t){const e={},n=gt(qt,0);for(const r of s(t))bt(e,r,n);return e}class Qr{constructor(e){this.f=e,this.res=void 0}*[Symbol.iterator](){this.res===void 0&&(this.res=this.f(),this.f=null),yield*s(this.res)}}function Nr(t){const e=[...s(t)];return e.pop(),e.length>0?e:null}function kr(...t){const[e,n]=t.length>1?t:[1,t[0]];return Q((r,o)=>r,n,ut(e,n))}function Kr(t,e){return[rt(t,e),ut(t,e)]}function jr(t,e){return[ot(t,e),ae(t,e)]}function P(t){if(!t)return 0;const e=t.length||t.size;if(typeof e=="number")return e;let n=0;for(const r of s(t))n++;return n}function Ir(t){return t===!0}function Or(t){return t===!1}function Tr(t){return t!=null}function $r(t){return!!t}function Gr(t){return t===0}function Br(t){return t<0}function zr(t){return t>0}function qr(...t){let e=0;const n={};for(;!(e>=t.length);)n[t[e]]=t[e+1],e=e+2;return n}function Lr(t){return t.length}function Fr(t,e,n,...r){if(r.length==0)return t[e]=n,n;{const o=[e,n,...r],u=o[o.length-1];let i=t,c=0;const a=o.length-2;for(;c<a;c++)i=i[o[c]];return i[o[c]]=u,n}}function Pr(t){for(const e of s(t));return null}function Dr(t){return k(t)}function Yr(t){return[...t]}function Cr(t,e,n){return t._add_watch(e,n)}function Vr(t,e){return t._remove_watch(e)}function vt(t,e,n){if(!n)return e;var r=e;for(const o of s(n))r=t(r,o[0],o[1]);return r}function de(t,e,...n){return e==null?t:Math.max(t,e,...n)}function Ur(t,e,...n){return e==null?t:Math.min(t,e,...n)}function xe(t){return t==null?!1:!!(C(t)||t instanceof Map)}function Wr(...t){return(...e)=>{for(const n of t)for(const r of e)if(!n(r))return!1;return!0}}function Jr(...t){return(...e)=>{for(const n of t)for(const r of e){const o=n(r);if(o)return o}}}function ye(t,e){return k(e||t)}function Xr(t,e){var n=e;return l(function*(){for(;;)yield n,n=t(n)})}function Zr(...t){return t=t.map(f),(...e)=>{const n=[];for(const r of t)n.push(r(...e));return n}}function ft(t){if(Array.isArray(t)){const e=t.slice(1);return e.length>0?e:null}else return E(J(t))}function Hr(t){return ft(ft(t))}function b(t,e){if(t===e)return 0;{if(t==null)return-1;if(e==null)return 1;const n=typeof t,r=typeof e;if(n==="number"&&r==="number"||n==="string"&&r==="string")return t===e?0:t<e?-1:1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length<e.length)return-1;if(t.length>e.length)return 1;for(let o=0;o<t.length;o++){const u=b(t[o],e[o]);if(u!=0)return u}return 0}else throw new Error(`comparing ${n} to ${r}`)}}function to(t){return ye(t)}function h(t){return t!=null&&t!==!1}const eo=h;function me(t,e,n){return t.substring(e,n)}function Mt(t){return typeof t=="function"}function no(t){return Mt(t)}function ro(t){return!0}function oo(t,...e){if(e.length===0)return!0;const n=[t];for(const r of e){for(const o of n)if(h(T(o,r)))return!1;n.push(r)}return!0}function uo(t,e){return l(function*(){for(;;){const n=t.exec(e);if(n){const r=n[0];yield n.length===1?r:k(n);const u=n.index+de(1,r.length);if(u>e.length)break;e=me(e,u)}else break}})}function io(t){return Number.isNaN(t)}function we(t){return typeof t=="number"}function ge(t){if(t==null)return;switch(p(t)){case d:return Object.keys(t);case _:return Array.from(t.keys())}}function co(t){return ge(t)}function so(t){if(t==null)return;switch(p(t)){case d:return Object.values(t);case _:return Array.from(t.values())}}function it(t){return typeof t=="string"}function fo(t){return p(t)!=null}function lo(t){return t instanceof RegExp}class Et extends Error{constructor(e,n,r){super(e),this._data=n,this._cause=r}}function ao(t){return t instanceof Et?t._data:null}function po(t){return t instanceof Error?t.message:null}function ho(t){return t instanceof Et?t._cause:null}function _o(t,e,n){return new Et(t,e,n)}function B(t){return Number.isInteger(t)}const xo=B;function yo(t){return B(t)&&t>0}function mo(t){return B(t)&&t>-1}function wo(t){return B(t)&&t<0}const lt=Symbol("meta");function go(t){return t instanceof Object?t[lt]:null}function Ao(t,e){if(typeof t=="function"){const r=function(...o){return t.apply(this,o)};return r[lt]=e,r}const n=$(t);return n[lt]=e,n}function bo(t){return t===!0||t===!1}function Ae(t){switch(p(t)){case x:case _:case d:case M:case m:return!0}return!1}function vo(t,e){return Ae(e)?P(e):P(rt(t,e))}function Mo(t,e){const n=w(t,e);if(n!==void 0)return[e,n]}function Eo(t,e){return(t%e+e)%e}function Ro(t,e,...n){if(n.length==0)return e;var r=t(e),o=e;return n.forEach(u=>{var i=t(u);i<=r&&(r=i,o=u)}),o}function So(t,e,...n){if(n.length==0)return e;var r=t(e),o=e;return n.forEach(u=>{var i=t(u);i>=r&&(r=i,o=u)}),o}function be(t){throw new Error(`Expected string, got: ${typeof t}`)}function Qo(t){if(it(t)){if(/^[+-]?\d+$/.test(t)){const e=parseInt(t);if(Number.MIN_SAFE_INTEGER<=e<=Number.MAX_SAFE_INTEGER)return e}return null}return be(t)}function No(t){if(it(t))return/^[\\x00-\\x20]*[+-]?NaN[\\x00-\\x20]*$/.test(t)?NaN:/^[\\x00-\\x20]*[+-]?(Infinity|((\d+\.?\d*|\.\d+)([eE][+-]?\d+)?)[dDfF]?)[\\x00-\\x20]*$/.test(t)?parseFloat(t):null;throw new be(t)}function ve(t){return t>=0?Math.floor(t):Math.ceil(t)}function Me(t,e){const n=t%e;return ve((t-n)/e)}function Ee(t,...e){if(e.length==0)for(;;){const n=t();if(h(Mt(n))){t=n;continue}else return n}else return Ee(function(){return Zt(t,e)})}function Rt(t,...e){switch(e.length){case 2:{const n=e[0],r=e[1];return Rt(t,n,n(),r)}default:{let n=e[0];const r=e[1],o=e[2];n=t(n);const u=S(n,r,o);return n(u)}}}function ko(t,e){const n={},r=s(t)[Symbol.iterator](),o=s(e)[Symbol.iterator]();let u,i;for(;u=r.next(),!(u.done||(i=o.next(),i.done));)n[u.value]=i.value;return n}function Ko(t){return E(t)?t:null}function Re(t,e,n){const r=function*(o){if(yield o,h(t(o)))for(const u of s(e(o)))yield*r(u)};return l(function*(){yield*r(n)})}function jo(t){return Z(L(st),J(Re(st,E,t)))}function Io(t){return $(t)}function Oo(t){return Object.freeze(t)}class z{constructor(e){e instanceof z||(e=At(e));const r=new Set(e);this._elts=[...r],this._set=r}add(e){if(this._set.has(e))return this;const n=this._elts;let r=!1;for(let o=0;o<n.length;o++)if(b(e,n[o])<=0){n.splice(o,0,e),r=!0;break}return r?this._set=new Set(n):(n.push(e),this._set.add(e)),this.size=n.length,this}delete(e){if(!this._set.has(e))return this;const n=this._elts,r=n.indexOf(e);return n.splice(r,1),this._set=new Set(n),this.size=n.length,this}has(e){return this._set.has(e)}keys(){return this.values()}values(){return this._elts[Symbol.iterator]()}entries(){return this._set.entries()}forEach(...e){return this.set.forEach(...e)}clear(){this._elts=[],this._set=new Set(this._elts)}[Symbol.iterator](){return this.keys()}}function To(...t){return new z(t)}function at(t,e,n){return r=>e(b(r,n),0)}function Se(t,e,n=!0){let r=0;for(;r<t.length&&b(e,t[r])>0;r++);return r}function $o([t,e,n]){const r=at(t,e,n);if(e===kt||e===Kt){const o=[...t],u=Se(o,n,!0);return o.splice(0,u),r(o[0])||o.splice(0,1),o}else return[...ot(r,t)]}function Go([t,e,n,r,o]){const u=[...t],i=Se(u,n,!0);u.splice(0,i);const c=at(t,r,o);return at(t,e,n)(u[0])||u.splice(0,1),[...ot(c,u)]}function Bo(...t){if(t.length===3)return $o(t);if(t.length===5)return Go(t)}function zo(t){return Math.abs(t)}function qo(t){return ve(t)}function Lo(t){return t!=null&&t.constructor}function Fo(t){return(e,n)=>{const r=t(e,n);return R(r)?X(r):r}}function Qe(t){return t=Fo(t),(...e)=>{switch(e.length){case 0:return t();case 1:return t(e[0]);case 2:return S(t,e[0],e[1])}}}function Ne(t,e){const n=Me(t,e);return t-e*n}function Po(t){const e=new Map;return(...n)=>{const r=[n.length,...n],o=wt(e,r);if(o===void 0){const u=t(...n);return Ot(e,r,u),u}else return o}}function Do(t){return et(t)?t[t.length-1]:I(t)}function Yo(t){if(et(t)){const e=[...t];return e.pop(),e}else return J(t)}function Co(t,e){const n=nt(t),r=jt(t)||A;return vt((o,u,i)=>r(o,e(u),i),n,t),n}function ke(t,e){const n=nt(t),r=jt(t)||A;return vt((o,u,i)=>r(o,u,e(i)),n,t),n}function Vo(){return crypto.randomUUID()}class Uo{constructor(e){this.f=e}_deref(){return this.realized?this.v:(this.v=this.f(),this.realized=!0,this.v)}}function pt(t,e){if(e.has(t))return t;if(e.add(t),xe(t))return ke(t,r=>pt(r,e));const n=p(t);return n&&n!=d?tt(r=>pt(r,e),t):t}function Wo(t){return pt(t,new Set)}function Jo(t,e){S((n,r)=>t(r),null,e)}function Xo(...t){return dt(T(...t))}class Zo{constructor(e){this.v=e}_deref(){return this.v}}function Ho(t){return new Zo(t)}function tu(t,e){t.v=e}function v(t,e=new WeakSet){if(t==null)return"nil";if(typeof t=="number"||typeof t=="boolean")return String(t);if(typeof t=="string")return JSON.stringify(t);if(typeof t=="bigint")return`${t}N`;if(typeof t=="object"){if(e.has(t))return"#object[circular]";e.add(t);const n=p(t);let r;switch(n){case x:return`[${t.map(o=>v(o,e)).join(" ")}]`;case m:return`#{${Array.from(t).map(o=>v(o,e)).join(" ")}}`;case _:return`#js/Map {${Array.from(t.entries()).map(([o,u])=>`${v(o,e)} ${v(u,e)}`).join(", ")}}`;case D:case M:return`(${tt(o=>`${v(o,e)}`,t).join(", ")})`;default:return t.constructor&&t.constructor!==Object?`#<${t.constructor.name}>`:(r=Object.keys(t),`{${r.map(o=>`:${o} ${v(t[o],e)}`).join(", ")}}`)}}return`#object[${t.constructor.name}]`}function Ke(...t){return t.map((e,n)=>v(e)).join(" ")}function eu(...t){return console.log(Ke(...t))}return Be(nu);})();
|
package/package.json
CHANGED
package/src/squint/core.js
CHANGED
|
@@ -962,6 +962,11 @@ export function str(...xs) {
|
|
|
962
962
|
return xs.join('');
|
|
963
963
|
}
|
|
964
964
|
|
|
965
|
+
export function name(x) {
|
|
966
|
+
if (typeof x === 'string') return x;
|
|
967
|
+
throw new Error("Doesn't support name: " + typeof x);
|
|
968
|
+
}
|
|
969
|
+
|
|
965
970
|
export function not(expr) {
|
|
966
971
|
return !truth_(expr);
|
|
967
972
|
}
|
|
@@ -1202,6 +1207,11 @@ export function list(...args) {
|
|
|
1202
1207
|
return new List(...args);
|
|
1203
1208
|
}
|
|
1204
1209
|
|
|
1210
|
+
export function list_STAR_(...args) {
|
|
1211
|
+
const last = args.pop();
|
|
1212
|
+
return new List(...args, ...iterable(last));
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1205
1215
|
export function array_QMARK_(x) {
|
|
1206
1216
|
return Array.isArray(x);
|
|
1207
1217
|
}
|
|
@@ -1856,6 +1866,38 @@ export function distinct(coll) {
|
|
|
1856
1866
|
});
|
|
1857
1867
|
}
|
|
1858
1868
|
|
|
1869
|
+
const DEDUPE_NONE = Symbol('dedupe-none');
|
|
1870
|
+
|
|
1871
|
+
function dedupe1() {
|
|
1872
|
+
return (rf) => {
|
|
1873
|
+
let prev = DEDUPE_NONE;
|
|
1874
|
+
return (...args) => {
|
|
1875
|
+
const al = args.length;
|
|
1876
|
+
if (al === 0) return rf();
|
|
1877
|
+
if (al === 1) return rf(args[0]);
|
|
1878
|
+
if (al === 2) {
|
|
1879
|
+
const result = args[0];
|
|
1880
|
+
const input = args[1];
|
|
1881
|
+
const skip = prev !== DEDUPE_NONE && truth_(_EQ_(prev, input));
|
|
1882
|
+
prev = input;
|
|
1883
|
+
return skip ? result : rf(result, input);
|
|
1884
|
+
}
|
|
1885
|
+
};
|
|
1886
|
+
};
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
export function dedupe(coll) {
|
|
1890
|
+
if (arguments.length === 0) return dedupe1();
|
|
1891
|
+
return lazy(function* () {
|
|
1892
|
+
let prev = DEDUPE_NONE;
|
|
1893
|
+
for (const x of iterable(coll)) {
|
|
1894
|
+
if (prev === DEDUPE_NONE || !truth_(_EQ_(prev, x))) yield x;
|
|
1895
|
+
prev = x;
|
|
1896
|
+
}
|
|
1897
|
+
return;
|
|
1898
|
+
});
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1859
1901
|
export function update(coll, k, f, ...args) {
|
|
1860
1902
|
f = __toFn(f);
|
|
1861
1903
|
return assoc(coll, k, f(get(coll, k), ...args));
|
|
@@ -2377,6 +2419,26 @@ export function fn_QMARK_(x) {
|
|
|
2377
2419
|
return 'function' === typeof x;
|
|
2378
2420
|
}
|
|
2379
2421
|
|
|
2422
|
+
export function ifn_QMARK_(x) {
|
|
2423
|
+
return fn_QMARK_(x);
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
export function any_QMARK_(_x) {
|
|
2427
|
+
return true;
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
export function distinct_QMARK_(x, ...more) {
|
|
2431
|
+
if (more.length === 0) return true;
|
|
2432
|
+
const seen = [x];
|
|
2433
|
+
for (const y of more) {
|
|
2434
|
+
for (const s of seen) {
|
|
2435
|
+
if (truth_(_EQ_(s, y))) return false;
|
|
2436
|
+
}
|
|
2437
|
+
seen.push(y);
|
|
2438
|
+
}
|
|
2439
|
+
return true;
|
|
2440
|
+
}
|
|
2441
|
+
|
|
2380
2442
|
export function re_seq(re, s) {
|
|
2381
2443
|
return lazy(function* () {
|
|
2382
2444
|
while (true) {
|
|
@@ -3018,6 +3080,13 @@ function toEDN(value, seen = new WeakSet()) {
|
|
|
3018
3080
|
case LIST_TYPE:
|
|
3019
3081
|
return `(${mapv((v) => `${toEDN(v, seen)}`, value).join(', ')})`;
|
|
3020
3082
|
default:
|
|
3083
|
+
// Non-plain objects (Promise, Error, Date, class instances, ...) have a
|
|
3084
|
+
// constructor other than Object. Print them as #<Name> rather than {}
|
|
3085
|
+
// (which is what Object.keys would yield for opaque values like a
|
|
3086
|
+
// Promise).
|
|
3087
|
+
if (value.constructor && value.constructor !== Object) {
|
|
3088
|
+
return `#<${value.constructor.name}>`;
|
|
3089
|
+
}
|
|
3021
3090
|
keys = Object.keys(value);
|
|
3022
3091
|
return `{${keys.map((k) => `:${k} ${toEDN(value[k], seen)}`).join(', ')}}`;
|
|
3023
3092
|
}
|
package/vite.js
CHANGED
|
@@ -42,16 +42,53 @@ const ENABLE_HTTP_EVAL = false;
|
|
|
42
42
|
function clientCode() {
|
|
43
43
|
return `
|
|
44
44
|
import { pr_str } from 'squint-cljs/core.js';
|
|
45
|
+
// Render a top-level Promise as #<Promise <value>> by racing it against a
|
|
46
|
+
// short timeout; pending/rejected get their own readable forms. Mirrors
|
|
47
|
+
// pr-str-repl in squint.repl.nrepl-server so node and browser eval print the
|
|
48
|
+
// same thing.
|
|
49
|
+
const PROMISE_PRINT_TIMEOUT_MS = 1000;
|
|
50
|
+
async function pr_str_repl(v) {
|
|
51
|
+
if (!(v instanceof Promise)) return pr_str(v);
|
|
52
|
+
const settled = v.then(r => ({ tag: 'resolved', val: r }),
|
|
53
|
+
e => ({ tag: 'rejected', val: e }));
|
|
54
|
+
const timer = new Promise(resolve =>
|
|
55
|
+
setTimeout(() => resolve({ tag: 'pending' }), PROMISE_PRINT_TIMEOUT_MS));
|
|
56
|
+
const r = await Promise.race([settled, timer]);
|
|
57
|
+
if (r.tag === 'pending') return '#<Promise pending>';
|
|
58
|
+
if (r.tag === 'rejected') return '#<Promise rejected ' + pr_str(r.val) + '>';
|
|
59
|
+
return '#<Promise ' + pr_str(r.val) + '>';
|
|
60
|
+
}
|
|
61
|
+
// Resolve a bare specifier to the exact url vite serves it at, then import THAT
|
|
62
|
+
// url. We can't \`import('/@resolve-deps/preact')\` and let the endpoint redirect:
|
|
63
|
+
// the browser's module map keys by the *request* url, so a redirected import is
|
|
64
|
+
// a different map entry than the page's own \`import('/node_modules/.vite/deps/
|
|
65
|
+
// preact.js?v=...')\` - two preact instances, two \`options\` registries, and a
|
|
66
|
+
// REPL \`render\` then can't reconcile the page's existing tree. Resolving first
|
|
67
|
+
// and importing the canonical url shares the one instance.
|
|
68
|
+
// Indirect import so vite's import-analysis doesn't rewrite it: a literal
|
|
69
|
+
// \`import(url)\` here gets wrapped as \`import(__vite__injectQuery(url,'import'))\`,
|
|
70
|
+
// which appends &import to the url - a different string than the page's own
|
|
71
|
+
// \`import('/node_modules/.vite/deps/preact.js?v=...')\`, hence a second module
|
|
72
|
+
// instance. Building the import() via Function keeps the url byte-for-byte.
|
|
73
|
+
const __rawImport = new Function('u', 'return import(u)');
|
|
74
|
+
async function __squintImport(spec) {
|
|
75
|
+
const res = await fetch('/@resolve-deps/' + encodeURIComponent(spec));
|
|
76
|
+
if (!res.ok) throw new Error('squint-repl: could not resolve ' + spec);
|
|
77
|
+
const url = await res.text();
|
|
78
|
+
return __rawImport(url);
|
|
79
|
+
}
|
|
45
80
|
if (import.meta.hot) {
|
|
46
81
|
import.meta.hot.on('squint:nrepl', async ({ op, code, id, session }) => {
|
|
47
82
|
if (op !== 'eval') return;
|
|
48
|
-
// bare dynamic imports in eval'd code
|
|
83
|
+
// bare dynamic imports in eval'd code resolve through __squintImport
|
|
49
84
|
// (\\s* tolerates squint emitting e.g. \`import ('preact')\` for :refer)
|
|
50
|
-
const rewritten = code.replace(/import\\s*\\(\\s*'(.+?)'\\s*\\)/g, "
|
|
85
|
+
const rewritten = code.replace(/import\\s*\\(\\s*'(.+?)'\\s*\\)/g, "__squintImport('$1')");
|
|
51
86
|
let value, ex;
|
|
52
87
|
try {
|
|
53
|
-
//
|
|
54
|
-
|
|
88
|
+
// compile wraps the user's top-level value in [v] so a Promise survives
|
|
89
|
+
// the async IIFE without being auto-unwrapped; unbox before printing.
|
|
90
|
+
const boxed = await eval(rewritten);
|
|
91
|
+
value = await pr_str_repl(boxed[0]);
|
|
55
92
|
} catch (e) {
|
|
56
93
|
ex = e && e.message ? e.message : String(e);
|
|
57
94
|
}
|
|
@@ -231,27 +268,50 @@ export default function squint(options = {}) {
|
|
|
231
268
|
server.watcher.on('change', onChange);
|
|
232
269
|
server.watcher.on('add', onChange);
|
|
233
270
|
|
|
234
|
-
// Resolve bare
|
|
271
|
+
// Resolve a bare specifier from REPL-eval'd dynamic import()s to the url
|
|
272
|
+
// vite serves it at, returned as text (the client imports that url; see
|
|
273
|
+
// __squintImport in the injected client - it must import the canonical
|
|
274
|
+
// url, not a redirect, to share the page's module instance). npm/path
|
|
235
275
|
// specifiers go through vite's resolver; a bare ns name (e.g. `index`,
|
|
236
276
|
// which squint emits for a local cljs require) that vite can't resolve
|
|
237
277
|
// falls back to its compiled output under outDir (e.g. /js/index.js).
|
|
278
|
+
const sendUrl = (res, url) => {
|
|
279
|
+
res.writeHead(200, { 'content-type': 'text/plain' });
|
|
280
|
+
res.end(url);
|
|
281
|
+
};
|
|
238
282
|
server.middlewares.use('/@resolve-deps', async (req, res) => {
|
|
239
283
|
const spec = decodeURIComponent(req.url.slice(1));
|
|
240
284
|
let resolved = null;
|
|
285
|
+
// resolve via the plugin container (runs vite's own resolver + dep
|
|
286
|
+
// pre-bundling). vite 6+ exposes it per-environment; older vite only on
|
|
287
|
+
// the server. (server.moduleGraph.resolveId existed in vite <=5 but was
|
|
288
|
+
// dropped in 6+, so don't depend on it.)
|
|
289
|
+
const container =
|
|
290
|
+
server.environments?.client?.pluginContainer ?? server.pluginContainer;
|
|
241
291
|
try {
|
|
242
|
-
resolved = await
|
|
292
|
+
resolved = await container.resolveId(spec);
|
|
243
293
|
} catch {
|
|
244
294
|
resolved = null;
|
|
245
295
|
}
|
|
246
296
|
if (resolved && resolved.id) {
|
|
247
|
-
|
|
248
|
-
|
|
297
|
+
// Return the SAME url the page uses for this module. vite serves files
|
|
298
|
+
// under `root` at a root-relative url and files outside it under /@fs;
|
|
299
|
+
// an optimized dep (<root>/node_modules/.vite/deps/foo.js?v=HASH) must
|
|
300
|
+
// come back as /node_modules/.vite/deps/foo.js?v=HASH - the form the
|
|
301
|
+
// page's own imports resolve to - so the browser reuses the one module
|
|
302
|
+
// instance (a different url string => a second copy => two `options`
|
|
303
|
+
// registries => a REPL `render` can't reconcile the page's tree and
|
|
304
|
+
// #jsx silently no-ops).
|
|
305
|
+
const id = resolved.id;
|
|
306
|
+
const url = id.startsWith(root + sep)
|
|
307
|
+
? id.slice(root.length)
|
|
308
|
+
: `/@fs${id}`;
|
|
309
|
+
sendUrl(res, url);
|
|
249
310
|
return;
|
|
250
311
|
}
|
|
251
312
|
const rel = outDir + '/' + spec.replace(/\./g, '/') + '.' + extension;
|
|
252
313
|
if (existsSync(join(root, rel))) {
|
|
253
|
-
res
|
|
254
|
-
res.end();
|
|
314
|
+
sendUrl(res, '/' + rel);
|
|
255
315
|
return;
|
|
256
316
|
}
|
|
257
317
|
res.writeHead(404);
|