squint-cljs
Advanced tools
Comparing version 0.6.95 to 0.7.96
@@ -6,47 +6,47 @@ import { $APP, shadow$provide, $jscomp } from "./compiler.js"; | ||
import*as esm_import$fs from"fs";import*as esm_import$net from"net";import*as esm_import$readline from"readline";import*as esm_import$squint_cljs$core from"squint-cljs/core.js";import*as esm_import$node_util from"node:util";import*as esm_import$path from"path"; | ||
var rha=function(a,b){return $APP.Vd(a)&&$APP.Vd(b)?$APP.Qk.l($APP.F([a,b])):$APP.Rd(a)&&($APP.Ud(a)||$APP.Td(a))&&$APP.Rd(b)&&($APP.Ud(b)||$APP.Td(b))?$APP.Rg.g(a,b):b},W9=function(a,b){return $APP.oe.j(function(c,d){return $APP.Wu.l(rha,$APP.F([c,d]))},a,b)},X9=function(a){throw $APP.cl.g(["Unexpected format: ",$APP.t.h(a)].join(""),new $APP.n(null,1,[sha,a],null));},Y9=function(a){var b=JSON.parse(a);return $APP.ae(b)?b:X9(a)},tha=function(a){var b=JSON.parse(a);return $APP.KG(b)?b:X9(a)},uha= | ||
function(a){var b=JSON.parse(a);return $APP.LG(b)?b:X9(a)},Z9=function(a){var b=JSON.parse(a);return"number"===typeof b?b:X9(a)},$9=function(a){return"string"===typeof a?$APP.B.j(a,0,null):null},a$=function(a){return $APP.A.g(":",$9(a))?$APP.zi.h($APP.ji.g(a,1)):$APP.zi.h(a)},vha=function(a){return $APP.Rd(a)?$APP.y(a):a},b$=function(a){if("string"===typeof a)try{var b=$9(a);if($APP.A.g("true",a)||$APP.A.g("false",a))var c=Y9(a);else{if($APP.A.g("nil",a))var d=null;else{if($APP.Za(isNaN(a)))var e= | ||
Z9(a);else{var f=$APP.A.g(":",b);var k=f?$APP.hi(/:[a-zA-Z][a-zA-Z0-9_\/\.-]*/,a):f;e=$APP.r(k)?a$(a):a}d=e}c=d}return c}catch(l){return a}else return a},c$=function(a,b,c,d){throw $APP.cl.j(["Coerce failure: cannot transform ",$APP.r(b)?"(implicit) true":["input ",$APP.Ri.l($APP.F([a]))].join(""),c instanceof $APP.H?" to ":" with ",$APP.t.h(c instanceof $APP.H?$APP.ai(c):c)].join(""),new $APP.n(null,2,[wha,a,xha,c],null),d);},yha=function(a,b,c){var d=function(){switch(b instanceof $APP.H?b.da:null){case "boolean":case "bool":return Y9; | ||
case "int":case "long":return tha;case "double":return uha;case "number":return Z9;case "symbol":return $APP.Hi;case "keyword":return a$;case "string":return $APP.se;case "edn":return $APP.vH;case "auto":return b$;default:return b}}();if("string"===typeof a)try{var e=d.h?d.h(a):d.call(null,a)}catch(f){e=c$(a,c,b,f)}else e=a;d=e;return $APP.r($APP.r(c)?!0!==d:c)?c$(a,c,b,null):d},d$=function(a,b,c){a=$APP.fe.g(a,b);c=$APP.r(a)?a:$APP.Rd(c)?$APP.Hd(c):null;return $APP.r(c)?$APP.Rd(c)?$APP.Tq.g($APP.Ee, | ||
c):c:null},e$=function(a,b,c,d){return $APP.Qh.g(b,c)?(c=$APP.PG(a,b),$APP.r(c)?($APP.B.j(c,0,null),c=$APP.B.j(c,1,null),$APP.Rh.j(a,b,$APP.r(d)?d.g?d.g(c,!0):d.call(null,c,!0):!0)):$APP.Rh.j(a,b,$APP.r(d)?d.g?d.g(null,!0):d.call(null,null,!0):!0)):a},zha=function(a,b,c,d,e,f){d=$APP.r($APP.r(d)?!$APP.Rd(d):d)?yha(e,d,f):b$(e);return $APP.r(c)?$APP.Tm.A(a,b,c,d):$APP.Rh.j(a,b,d)},Aha=function(a){return $APP.oe.j(function(b,c){var d=$APP.B.j(c,0,null);c=$APP.B.j(c,1,null);var e=$APP.jf(c),f=$APP.fe.g(e, | ||
f$),k=$APP.fe.g(e,g$);c=$APP.fe.g(e,$APP.Dm);var l=$APP.fe.g(e,$APP.NE);e=$APP.fe.g(e,h$);b=$APP.r(f)?$APP.Tm.J(b,f$,$APP.Rh,d,f):b;b=$APP.r(k)?$APP.Tm.j(b,g$,function(m){if($APP.he(m,k))throw $APP.cl.g(["Conflicting alias ",$APP.t.h(k)," between ",$APP.t.h($APP.fe.g(m,k))," and ",$APP.t.h(d)].join(""),new $APP.n(null,1,[g$,k],null));return $APP.Rh.j(m,k,d)}):b;b=$APP.r(l)?$APP.Tm.j(b,$APP.NE,$APP.Tq.g(function(m){return $APP.Ee.g(m,d)},$APP.Vh)):b;b=$APP.r(e)?$APP.Tm.J(b,h$,$APP.Rh,d,e):b;return $APP.r(c)? | ||
$APP.Tm.J(b,i$,$APP.Rh,d,c):b},$APP.hf,a)},m$=function(a,b){b=$APP.jf(b);var c=$APP.fe.g(b,j$);b=$APP.QG(function(d){var e=$APP.r(c)?null:$APP.qa(d,":");return!($APP.r(e)?e:$APP.qa(d,"-"))},a);a=$APP.B.j(b,0,null);b=$APP.B.j(b,1,null);return new $APP.n(null,2,[k$,a,l$,b],null)},o$=function(a,b){if($APP.r(b))if($APP.x(a)){var c=$APP.xd(a),d=$APP.$e(c,b);c=c<d?c:d;a=new $APP.I(null,2,5,$APP.N,[$APP.R.g($APP.Hu.g(b,a),$APP.Nf.g(c,a)),$APP.Nf.g(c,b)],null)}else a=new $APP.I(null,2,5,$APP.N,[a,b],null); | ||
else a=new $APP.I(null,2,5,$APP.N,[a,b],null);b=a;a=$APP.B.j(b,0,null);b=$APP.B.j(b,1,null);return new $APP.n(null,2,[l$,a,n$,b],null)},w$=function(a,b,c,d,e){var f=$9(a),k="string"===typeof a?$APP.B.j(a,1,null):null,l;if(l=$APP.A.g(f,"-")){try{var m=Z9($APP.t.h(k))}catch(h){m=null}l=$APP.Za(m)}b=$APP.r(b)?b:l?p$:null;f=$APP.A.g(":",f);c=$APP.Qh.g(p$,b)&&f&&($APP.A.g(q$,d)||$APP.Za(c)||$APP.A.g(e,c));d=$APP.r(b)?b:c?r$:null;a=l?$APP.r(k)?$APP.Qh.g("-",k)&&2<$APP.xd(a):k:null;return new $APP.n(null, | ||
5,[$APP.Pw,d,s$,l,t$,a,u$,c,v$,f],null)},Eha=function(a,b){function c(vb){vb=$APP.Qk.l($APP.F([new $APP.n(null,2,[x$,d,$APP.Xk,y$],null),vb]));return O.h?O.h(vb):O.call(null,vb)}var d=x$.h(b),e=$APP.r(d)?W9(b,$APP.F([Aha(d)])):b,f=f$.h(e),k=function(){var vb=g$.h(e);return $APP.r(vb)?vb:$APP.Er.h(e)}(),l=Bha.h(e),m=$APP.NE.h(e),h=i$.h(e),p=j$.h(e),q=function(){var vb=z$.h(e);return $APP.r(vb)?vb:Cha.h(e)}(),v=$APP.Zh($APP.R.l($APP.Mh($APP.Vd(d)?d:$APP.Rg.g($APP.hf,d)),$APP.Oh(k),$APP.F([$APP.Mh(f)]))), | ||
D=$APP.A.g(!0,q)?v:null==q?null:$APP.Zh(q),J=h$.h(e),O=function(){var vb=Dha.h(e);return $APP.r(vb)?vb:function(Yb){Yb=$APP.jf(Yb);var Ic=$APP.fe.g(Yb,A$);throw $APP.cl.g(Ic,Yb);}}(),P=m$(a,null),W=$APP.jf(P),ca=$APP.fe.g(W,k$),ha=$APP.fe.g(W,l$),na=function(){var vb=n$.h(e);vb=$APP.r(vb)?vb:B$.h(e);return $APP.r(vb)?o$(ca,vb):new $APP.n(null,2,[n$,null,l$,ha],null)}(),pa=$APP.jf(na),fa=$APP.fe.g(pa,l$),E=$APP.fe.g(pa,n$),C=$APP.Qh.g(fa,ha)?new $APP.I(null,2,5,$APP.N,[null,$APP.R.g(fa,ha)],null): | ||
new $APP.I(null,2,5,$APP.N,[ca,ha],null),da=$APP.B.j(C,0,null),K=$APP.B.j(C,1,null),M=function(){for(var vb=$APP.hf,Yb=null,Ic=null,Le=$APP.r(p)?p$:null,hd=$APP.x(K),Ig=E;;){if($APP.Za(hd))return new $APP.I(null,3,5,$APP.N,[vb,Yb,Ic],null);var kg=$APP.y(hd),Tc=kg instanceof $APP.H;if(Tc){Yb=e$(vb,Yb,Ic,null);var me=kg;hd=$APP.z(hd);vb=Yb;Yb=me}else{var Al=!0===kg,Qf=$APP.t.h(kg);me=d$(l,Yb,$APP.fe.g(f,Yb));var xi=$APP.fe.g(f,Yb),Bl=w$(Qf,Le,Yb,xi,Ic),Kh=$APP.jf(Bl),Cl=$APP.fe.g(Kh,s$),Lh=$APP.fe.g(Kh, | ||
t$),Dl=$APP.fe.g(Kh,u$),Rf=$APP.fe.g(Kh,$APP.Pw),mk=$APP.fe.g(Kh,v$);if($APP.r(function(){var Ne=Cl;return $APP.r(Ne)?Ne:Dl}())){var Yc=$APP.qa(Qf,"--"),nk=Yc&&$APP.A.g("--",Qf);if(nk){var El=$APP.z(hd);return new $APP.I(null,3,5,$APP.N,[function(){var Ne=vb;return El?$APP.jo.A(Ne,$APP.Ju,new $APP.I(null,2,5,$APP.N,[y$,l$],null),$APP.mg(El)):Ne}(),Yb,Ic],null)}var ok=Yc?$APP.ji.g(Qf,2):$APP.Zj(Qf,/^(:|-|)/,""),zf=Yc?$APP.Ar.g(ok,/=/):new $APP.I(null,1,5,$APP.N,[ok],null),Sd=$APP.B.j(zf,0,null),Ce= | ||
$APP.B.j(zf,1,null),Tb=$APP.zi.h(Sd),Ec=$APP.fe.j(k,Tb,Tb);if($APP.r(Ce))Ic=e$(vb,Yb,Ic,me),Yb=Ec,Le=Rf,hd=$APP.He(Ce,$APP.cd(hd)),vb=Ic,Ic=null;else{var Ab=$APP.z(hd),Me=$APP.y(Ab),lw=w$(Me,Rf,Yb,xi,Ic);if($APP.r(function(){var Ne=s$.h(lw);return $APP.r(Ne)?Ne:$APP.Qd(Ab)}()))if($APP.r(Lh)){var mw=$APP.ai(Ec);Ic=$APP.aq.l(function(){return function(Ne){return new $APP.I(null,2,5,$APP.N,[["-",$APP.t.h(Ne)].join(""),!0],null)}}(vb,Yb,Ic,Le,hd,Ig,mw,Ab,Me,lw,ok,zf,Sd,Ce,Tb,Ec,Yc,nk,Al,Qf,me,xi,Bl,Kh, | ||
Cl,Lh,Dl,Rf,mk,kg,Tc,d,e,f,k,l,m,h,p,q,v,D,J,O,c,P,W,ca,ha,na,pa,fa,E,C,da,K),$APP.F([mw]));hd=$APP.R.g(Ic,Ab);Le=Rf;Ic=Yb=null}else hd=$APP.he(v,Ec)?null:$APP.FG($APP.t.h(Ec),":no-"),Le=$APP.r(hd)?$APP.zi.h($APP.Zj($APP.t.h(Ec),":no-","")):Ec,hd=$APP.He($APP.Za(hd),Ab),Yb=e$(vb,Yb,Ic,me),me=Le,Le=Rf,vb=Yb,Yb=me;else Yb=e$(vb,Yb,Ic,me),me=Ec,Le=Rf,hd=Ab,vb=Yb,Yb=me}}else if(nk=$APP.A.g(q$,xi)&&$APP.Qh.g(Qf,"true")&&$APP.Qh.g(Qf,"false")||$APP.A.g(Ic,Yb)&&$APP.Za(me))if(Ig=$APP.r(hd)?$APP.r(Ig)?o$(hd, | ||
Ig):new $APP.n(null,1,[l$,hd],null):new $APP.n(null,1,[l$,hd],null),Le=$APP.jf(Ig),Ig=$APP.fe.g(Le,l$),Le=$APP.fe.g(Le,n$),$APP.Qh.g(hd,Ig))me=Le,Le=Rf,hd=Ig,Ig=me;else return new $APP.I(null,3,5,$APP.N,[$APP.jo.A(vb,$APP.Ju,new $APP.I(null,2,5,$APP.N,[y$,l$],null),$APP.mg(hd)),Yb,Ic],null);else{try{var Zd=zha(vb,Yb,me,vha(xi),Qf,Al)}catch(Ne){c(new $APP.n(null,4,[C$,f$,A$,$APP.UG(Ne),D$,Yb,E$,Qf],null)),Zd=vb}Ic=$APP.r(function(){var Ne=$APP.A.g(r$,Rf);return Ne?mk:Ne}())?null:Yb;me=$APP.r(function(){var Ne= | ||
$APP.A.g(r$,Rf);return Ne?mk:Ne}())?null:Yb;Le=Rf;hd=$APP.z(hd);vb=Zd;Yb=Ic;Ic=me}}}}(),ea=$APP.B.j(M,0,null),ia=$APP.B.j(M,1,null),ja=$APP.B.j(M,2,null),ra=d$(l,ia,$APP.fe.g(f,ia)),ta=function(){var vb=e$(ea,ia,ja,ra);return $APP.x(da)?$APP.jo.A(vb,$APP.Nk,new $APP.I(null,2,5,$APP.N,[y$,l$],null),function(Yb){return $APP.Rg.g($APP.mg(da),Yb)}):vb}(),xa=$APP.r(h)?$APP.Md($APP.Qk.l($APP.F([h,ta])),$APP.Nd(ta)):ta;if($APP.r(D)){a=$APP.x($APP.Mh(xa));b=null;for(var ya=0,Ca=0;;)if(Ca<ya){var Ha=b.ba(null, | ||
Ca);$APP.he(D,Ha)||c(new $APP.n(null,4,[C$,z$,A$,["Unknown option: ",$APP.t.h(Ha)].join(""),z$,D,D$,Ha],null));Ca+=1}else if(a=$APP.x(a))b=a,$APP.Yd(b)?(a=$APP.uc(b),Ca=$APP.vc(b),b=a,ya=$APP.xd(a),a=Ca):(a=$APP.y(b),$APP.he(D,a)||c(new $APP.n(null,4,[C$,z$,A$,["Unknown option: ",$APP.t.h(a)].join(""),z$,D,D$,a],null)),a=$APP.z(b),b=null,ya=0),Ca=0;else break}if($APP.r(m))for(a=$APP.x(m),b=null,Ca=ya=0;;)if(Ca<ya)Ha=b.ba(null,Ca),$APP.r($APP.PG(xa,Ha))||c(new $APP.n(null,4,[C$,$APP.NE,A$,["Required option: ", | ||
$APP.t.h(Ha)].join(""),$APP.NE,m,D$,Ha],null)),Ca+=1;else if(a=$APP.x(a))b=a,$APP.Yd(b)?(a=$APP.uc(b),Ca=$APP.vc(b),b=a,ya=$APP.xd(a),a=Ca):(a=$APP.y(b),$APP.r($APP.PG(xa,a))||c(new $APP.n(null,4,[C$,$APP.NE,A$,["Required option: ",$APP.t.h(a)].join(""),$APP.NE,m,D$,a],null)),a=$APP.z(b),b=null,ya=0),Ca=0;else break;if($APP.r(J))for(var Da=$APP.x(J),za=null,Oa=0,Sa=0;;)if(Sa<Oa){var db=za.ba(null,Sa),ub=$APP.B.j(db,0,null),Bb=$APP.B.j(db,1,null),Xb=function(){var vb=(vb=$APP.Vd(Bb))?F$.h(Bb):vb;return $APP.r(vb)? | ||
vb:Bb}(),qc=$APP.PG(xa,ub);if($APP.r(qc)){var $c=qc,Rb=$APP.B.j($c,0,null),lf=$APP.B.j($c,1,null);if(!$APP.r(Xb.h?Xb.h(lf):Xb.call(null,lf))){var ik=function(){var vb=G$.h(Bb);return $APP.r(vb)?vb:function(){return function(Yb){var Ic=$APP.jf(Yb);Yb=$APP.fe.g(Ic,D$);Ic=$APP.fe.g(Ic,E$);return["Invalid value for option ",$APP.t.h(Yb),": ",$APP.t.h(Ic)].join("")}}(Da,za,Oa,Sa,vb,$c,Rb,lf,qc,Xb,db,ub,Bb,d,e,f,k,l,m,h,p,q,v,D,J,O,c,P,W,ca,ha,na,pa,fa,E,C,da,K,M,ea,ia,ja,ra,ta,xa)}();c(new $APP.n(null, | ||
5,[C$,h$,A$,function(){var vb=new $APP.n(null,2,[D$,ub,E$,lf],null);return ik.h?ik.h(vb):ik.call(null,vb)}(),h$,J,D$,ub,E$,lf],null))}}Sa+=1}else{var xl=$APP.x(Da);if(xl){var vi=xl;if($APP.Yd(vi))ya=$APP.uc(vi),a=$APP.vc(vi),b=ya,ya=$APP.xd(ya),Da=a,za=b,Oa=ya;else{var jk=$APP.y(vi),kk=$APP.B.j(jk,0,null),qj=$APP.B.j(jk,1,null),lk=function(){var vb=(vb=$APP.Vd(qj))?F$.h(qj):vb;return $APP.r(vb)?vb:qj}(),yl=$APP.PG(xa,kk);if($APP.r(yl)){var Hc=yl,rj=$APP.B.j(Hc,0,null),wi=$APP.B.j(Hc,1,null);if(!$APP.r(lk.h? | ||
lk.h(wi):lk.call(null,wi))){var zl=function(){var vb=G$.h(qj);return $APP.r(vb)?vb:function(){return function(Yb){var Ic=$APP.jf(Yb);Yb=$APP.fe.g(Ic,D$);Ic=$APP.fe.g(Ic,E$);return["Invalid value for option ",$APP.t.h(Yb),": ",$APP.t.h(Ic)].join("")}}(Da,za,Oa,Sa,vb,Hc,rj,wi,yl,lk,jk,kk,qj,vi,xl,d,e,f,k,l,m,h,p,q,v,D,J,O,c,P,W,ca,ha,na,pa,fa,E,C,da,K,M,ea,ia,ja,ra,ta,xa)}();c(new $APP.n(null,5,[C$,h$,A$,function(){var vb=new $APP.n(null,2,[D$,kk,E$,wi],null);return zl.h?zl.h(vb):zl.call(null,vb)}(), | ||
h$,J,D$,kk,E$,wi],null))}}Da=$APP.z(vi);za=null;Oa=0}Sa=0}else break}return xa},Fha=function(a,b){a=Eha(a,b);b=y$.h($APP.Nd(a));return $APP.Rh.j(b,$APP.xH,$APP.Rk.g(a,y$))},Gha=function(a,b){var c=$APP.Of($APP.xd(a),b);b=$APP.B.j(c,0,null);c=$APP.B.j(c,1,null);return $APP.A.g(b,a)?c:null},L$=function(a,b){$APP.Jf(H$,!1);a.setPrompt([$APP.t.h($APP.u(I$)),"\x3d\x3e "].join(""));a.prompt();return $APP.gk($APP.u(J$))?null:K$.g?K$.g(b,a):K$.call(null,b,a)},M$=function(a){var b=$APP.Bk(a);a=$APP.Ck(a); | ||
var c=$APP.VG($APP.u(J$));b=$APP.Nf.g(b-1,c);c=$APP.x(b);b=$APP.y(c);c=$APP.z(c);a=$APP.r(b)?$APP.ji.g(b,a):null;$APP.Jf(J$,$APP.Mp.g("\n",$APP.He(a,c)))},Iha=function(a,b,c){var d=function(){var f=$APP.ir;$APP.ir=$APP.u(I$);try{a:{var k=$APP.La;$APP.La=!0;try{var l=$APP.Ri.l($APP.F([a]));break a}finally{$APP.La=k}l=void 0}return $APP.gu(l,new $APP.n(null,3,[$APP.Op,$APP.Rp,$APP.Br,Hha,$APP.Wt,!0],null),null)}finally{$APP.ir=f}}(),e=$APP.jf(d);d=$APP.fe.g(e,$APP.fu);e=$APP.fe.g(e,$APP.T);d=$APP.Zj("(async function () {\n%s\n}) ()", | ||
"%s",d);$APP.Jf(I$,e);return Promise.resolve(eval(d)).then(function(f){$APP.r(c)?c.write(esm_import$node_util.inspect(f),"\n"):console.log(f);return K$.g?K$.g(c,b):K$.call(null,c,b)}).catch(function(f){esm_import$squint_cljs$core.println(f);return L$(b,c)})},K$=function(a,b){if($APP.r(function(){var e=$APP.u(H$);return $APP.r(e)?e:!$APP.gk($APP.u(J$))}())){$APP.Jf(H$,!0);var c=$APP.hp($APP.u(J$)),d=function(){try{return $APP.jp(c,$APP.Tt)}catch(f){var e=f;if(-1!=$APP.UG(e).indexOf("EOF while reading"))return N$; | ||
M$(c);$APP.tH.l($APP.F([$APP.t.h(e)]));return O$}}();if($APP.A.g(O$,d))return L$(b,a);if($APP.A.g(N$,d))return $APP.Jf(H$,!1);M$(c);return $APP.A.g($APP.ip,d)?L$(b,a):Iha(d,b,a)}return null},P$=function(a,b){a.on("line",function(c){$APP.Wi.A(J$,$APP.t,c,"\n");return K$(b,a)})},Jha=function(a){var b=esm_import$readline.createInterface({input:a,output:a});P$(b,a);a.setNoDelay(!0);return a.on("close",function(){return $APP.uH.l($APP.F(["Client closed connection."]))})},Q$=function(a,b,c){return $APP.r(c)? | ||
esm_import$path.resolve(c,$APP.iH(a,b)):a},R$=function(a,b,c){var d=$APP.nH.h(a),e=$APP.YG.h(a);b=Q$(b,e,d);c=$APP.$G(c);d=null==c?null:Q$(c,e,d);d=null==d?null:null==d?null:esm_import$path.relative(esm_import$path.dirname($APP.t.h(b)),d);return $APP.r(d)?(a=$APP.mH.g(a,".mjs"),a=$APP.qa(a,".")?a:[".",$APP.t.h(a)].join(""),e=esm_import$path.extname(d),["./",$APP.Zj(d,$APP.ki([$APP.t.h(e),"$"].join("")),a)].join("")):null},S$=function(a,b,c){b=esm_import$path.resolve(b,$APP.iH(a,c));c=esm_import$path.dirname(b); | ||
$APP.r(esm_import$fs.existsSync(c))||($APP.uH.l($APP.F(["[squint] Creating directory:",c])),esm_import$fs.mkdirSync(c,{recursive:!0}));$APP.uH.l($APP.F(["[squint] Copying resource",a,"to",c]));return esm_import$fs.copyFileSync(a,b)},V$=function(a,b){var c=$APP.u($APP.ZG),d=$APP.Qk.l($APP.F([c,a])),e=$APP.YG.h(c),f=$APP.nH.g(c,".");a=$APP.Qd(b)?$APP.mg($APP.aq.l(T$,$APP.F([e]))):b;b=$APP.nH.h(d);if($APP.r(b)&&"string"!==typeof b)throw Error("output-dir must be a string");return $APP.r(U$.h(d))?($APP.uH.l($APP.F(["Usage: squint compile \x3cfiles\x3e \x3copts\x3e"])), | ||
$APP.uH(),$APP.uH.l($APP.F(["Options:\n\n--elide-imports: do not include imports\n--elide-exports: do not include exports\n--extension: default extension for JS files\n--output-dir: output directory for JS files"]))):$APP.oe.j(function(k,l){return Promise.resolve(k).then(function(){return $APP.he(new $APP.Uh(null,new $APP.n(null,2,[".cljc",null,".cljs",null],null),null),esm_import$path.extname(l))?($APP.uH.l($APP.F(["[squint] Compiling CLJS file:",l])),$APP.oH($APP.Rh.l(d,$APP.jH,l,$APP.F([$APP.qr, | ||
function(m){return R$(d,l,m)}])))):S$(l,f,e)}).then(function(m){m=$APP.jf(m);m=$APP.fe.g(m,$APP.lH);$APP.r(m)&&$APP.uH.l($APP.F(["[squint] Wrote file:",m]));return m})},null,a)},u$=new $APP.H(null,"kwd-opt","kwd-opt",1313309243),p$=new $APP.H(null,"hyphens","hyphens",2113533609),x$=new $APP.H(null,"spec","spec",347520401),f$=new $APP.H(null,"coerce","coerce",1917884504),z$=new $APP.H(null,"restrict","restrict",-1071101511),r$=new $APP.H(null,"keywords","keywords",1526959054),O$=new $APP.H("squint.repl.node", | ||
"continue","squint.repl.node/continue",1558138730),A$=new $APP.H(null,"msg","msg",-1386103444),Kha=new $APP.H(null,"show","show",-576705889),q$=new $APP.H(null,"boolean","boolean",-1919418404),wha=new $APP.H(null,"input","input",556931961),W$=new $APP.H(null,"rest-cmds","rest-cmds",-423198324),y$=new $APP.H("org.babashka","cli","org.babashka/cli",1162430315),n$=new $APP.H(null,"args-\x3eopts","args-\x3eopts",964391046),g$=new $APP.H(null,"alias","alias",-2039751630),Bha=new $APP.H(null,"collect", | ||
"collect",-284321549),h$=new $APP.H(null,"validate","validate",-201300827),t$=new $APP.H(null,"composite-opt","composite-opt",-2021292928),Lha=new $APP.H(null,"run","run",-1821166653),s$=new $APP.H(null,"hyphen-opt","hyphen-opt",1836909464),U$=new $APP.H(null,"help","help",-439233446),C$=new $APP.H(null,"cause","cause",231901252),v$=new $APP.H(null,"fst-colon","fst-colon",1618567071),xha=new $APP.H(null,"coerce-fn","coerce-fn",-821146515),l$=new $APP.H(null,"args","args",1315556576),j$=new $APP.H(null, | ||
"no-keyword-opts","no-keyword-opts",761286018),E$=new $APP.H(null,"value","value",305978217),F$=new $APP.H(null,"pred","pred",1927423397),Cha=new $APP.H(null,"closed","closed",-919675359),N$=new $APP.H("squint.repl.node","eof-while-reading","squint.repl.node/eof-while-reading",198833493),Dha=new $APP.H(null,"error-fn","error-fn",-171437615),D$=new $APP.H(null,"option","option",65132272),i$=new $APP.H(null,"exec-args","exec-args",-1860766354),G$=new $APP.H(null,"ex-msg","ex-msg",-1111774387),sha=new $APP.H(null, | ||
"s","s",1705939918),B$=new $APP.H(null,"cmds-opts","cmds-opts",-390130362),Mha=new $APP.H(null,"h","h",1109658740),k$=new $APP.H(null,"cmds","cmds",-1841503952);var J$=$APP.Vi.h(""),H$=$APP.Vi.h(!1),I$=$APP.Vi.h($APP.ir),X$,Y$=process.stdout.isTTY;X$=$APP.r(Y$)?process.stdin.setRawMode:Y$;var Hha=$APP.Vi.h($APP.hf),Z$=function Z$(a){switch(arguments.length){case 0:return Z$.v();case 1:return Z$.h(arguments[0]);default:throw Error(["Invalid arity: ",$APP.t.h(arguments.length)].join(""));}};Z$.v=function(){return Z$.h(null)}; | ||
Z$.h=function(a){$APP.ir=$APP.Yx;$APP.Xq=$APP.hr=!0;var b=function(){var d=$APP.wH.h(a);return $APP.r(d)?d:0}(),c=esm_import$net.createServer(Jha);return c.listen(b,"127.0.0.1",function(){var d=c.address(),e=d.address;return $APP.uH.l($APP.F([["Socket REPL listening on port ",$APP.t.h(d.port)," on host ",$APP.t.h(e)].join("")]))})};Z$.m=1; | ||
var yha=function(a,b){return $APP.Vd(a)&&$APP.Vd(b)?$APP.Qk.l($APP.F([a,b])):$APP.Rd(a)&&($APP.Ud(a)||$APP.Td(a))&&$APP.Rd(b)&&($APP.Ud(b)||$APP.Td(b))?$APP.Rg.g(a,b):b},W9=function(a,b){return $APP.oe.j(function(c,d){return $APP.av.l(yha,$APP.F([c,d]))},a,b)},X9=function(a){throw $APP.cl.g(["Unexpected format: ",$APP.t.h(a)].join(""),new $APP.n(null,1,[zha,a],null));},Y9=function(a){var b=JSON.parse(a);return $APP.ae(b)?b:X9(a)},Aha=function(a){var b=JSON.parse(a);return $APP.RG(b)?b:X9(a)},Bha= | ||
function(a){var b=JSON.parse(a);return $APP.SG(b)?b:X9(a)},Z9=function(a){var b=JSON.parse(a);return"number"===typeof b?b:X9(a)},$9=function(a){return"string"===typeof a?$APP.B.j(a,0,null):null},a$=function(a){return $APP.A.g(":",$9(a))?$APP.zi.h($APP.ji.g(a,1)):$APP.zi.h(a)},Cha=function(a){return $APP.Rd(a)?$APP.y(a):a},b$=function(a){if("string"===typeof a)try{var b=$9(a);if($APP.A.g("true",a)||$APP.A.g("false",a))var c=Y9(a);else{if($APP.A.g("nil",a))var d=null;else{if($APP.Za(isNaN(a)))var e= | ||
Z9(a);else{var f=$APP.A.g(":",b);var k=f?$APP.hi(/:[a-zA-Z][a-zA-Z0-9_\/\.-]*/,a):f;e=$APP.r(k)?a$(a):a}d=e}c=d}return c}catch(l){return a}else return a},c$=function(a,b,c,d){throw $APP.cl.j(["Coerce failure: cannot transform ",$APP.r(b)?"(implicit) true":["input ",$APP.Ri.l($APP.F([a]))].join(""),c instanceof $APP.H?" to ":" with ",$APP.t.h(c instanceof $APP.H?$APP.ai(c):c)].join(""),new $APP.n(null,2,[Dha,a,Eha,c],null),d);},Fha=function(a,b,c){var d=function(){switch(b instanceof $APP.H?b.da:null){case "boolean":case "bool":return Y9; | ||
case "int":case "long":return Aha;case "double":return Bha;case "number":return Z9;case "symbol":return $APP.Hi;case "keyword":return a$;case "string":return $APP.se;case "edn":return $APP.CH;case "auto":return b$;default:return b}}();if("string"===typeof a)try{var e=d.h?d.h(a):d.call(null,a)}catch(f){e=c$(a,c,b,f)}else e=a;d=e;return $APP.r($APP.r(c)?!0!==d:c)?c$(a,c,b,null):d},d$=function(a,b,c){a=$APP.fe.g(a,b);c=$APP.r(a)?a:$APP.Rd(c)?$APP.Hd(c):null;return $APP.r(c)?$APP.Rd(c)?$APP.Wq.g($APP.Ee, | ||
c):c:null},e$=function(a,b,c,d){return $APP.Qh.g(b,c)?(c=$APP.WG(a,b),$APP.r(c)?($APP.B.j(c,0,null),c=$APP.B.j(c,1,null),$APP.Rh.j(a,b,$APP.r(d)?d.g?d.g(c,!0):d.call(null,c,!0):!0)):$APP.Rh.j(a,b,$APP.r(d)?d.g?d.g(null,!0):d.call(null,null,!0):!0)):a},Gha=function(a,b,c,d,e,f){d=$APP.r($APP.r(d)?!$APP.Rd(d):d)?Fha(e,d,f):b$(e);return $APP.r(c)?$APP.Tm.A(a,b,c,d):$APP.Rh.j(a,b,d)},Hha=function(a){return $APP.oe.j(function(b,c){var d=$APP.B.j(c,0,null);c=$APP.B.j(c,1,null);var e=$APP.jf(c),f=$APP.fe.g(e, | ||
f$),k=$APP.fe.g(e,g$);c=$APP.fe.g(e,$APP.Dm);var l=$APP.fe.g(e,$APP.WE);e=$APP.fe.g(e,h$);b=$APP.r(f)?$APP.Tm.J(b,f$,$APP.Rh,d,f):b;b=$APP.r(k)?$APP.Tm.j(b,g$,function(m){if($APP.he(m,k))throw $APP.cl.g(["Conflicting alias ",$APP.t.h(k)," between ",$APP.t.h($APP.fe.g(m,k))," and ",$APP.t.h(d)].join(""),new $APP.n(null,1,[g$,k],null));return $APP.Rh.j(m,k,d)}):b;b=$APP.r(l)?$APP.Tm.j(b,$APP.WE,$APP.Wq.g(function(m){return $APP.Ee.g(m,d)},$APP.Vh)):b;b=$APP.r(e)?$APP.Tm.J(b,h$,$APP.Rh,d,e):b;return $APP.r(c)? | ||
$APP.Tm.J(b,i$,$APP.Rh,d,c):b},$APP.hf,a)},m$=function(a,b){b=$APP.jf(b);var c=$APP.fe.g(b,j$);b=$APP.XG(function(d){var e=$APP.r(c)?null:$APP.qa(d,":");return!($APP.r(e)?e:$APP.qa(d,"-"))},a);a=$APP.B.j(b,0,null);b=$APP.B.j(b,1,null);return new $APP.n(null,2,[k$,a,l$,b],null)},o$=function(a,b){if($APP.r(b))if($APP.x(a)){var c=$APP.xd(a),d=$APP.$e(c,b);c=c<d?c:d;a=new $APP.J(null,2,5,$APP.N,[$APP.R.g($APP.Mu.g(b,a),$APP.Nf.g(c,a)),$APP.Nf.g(c,b)],null)}else a=new $APP.J(null,2,5,$APP.N,[a,b],null); | ||
else a=new $APP.J(null,2,5,$APP.N,[a,b],null);b=a;a=$APP.B.j(b,0,null);b=$APP.B.j(b,1,null);return new $APP.n(null,2,[l$,a,n$,b],null)},w$=function(a,b,c,d,e){var f=$9(a),k="string"===typeof a?$APP.B.j(a,1,null):null,l;if(l=$APP.A.g(f,"-")){try{var m=Z9($APP.t.h(k))}catch(h){m=null}l=$APP.Za(m)}b=$APP.r(b)?b:l?p$:null;f=$APP.A.g(":",f);c=$APP.Qh.g(p$,b)&&f&&($APP.A.g(q$,d)||$APP.Za(c)||$APP.A.g(e,c));d=$APP.r(b)?b:c?r$:null;a=l?$APP.r(k)?$APP.Qh.g("-",k)&&2<$APP.xd(a):k:null;return new $APP.n(null, | ||
5,[$APP.Xw,d,s$,l,t$,a,u$,c,v$,f],null)},Lha=function(a,b){function c(vb){vb=$APP.Qk.l($APP.F([new $APP.n(null,2,[x$,d,$APP.Xk,y$],null),vb]));return O.h?O.h(vb):O.call(null,vb)}var d=x$.h(b),e=$APP.r(d)?W9(b,$APP.F([Hha(d)])):b,f=f$.h(e),k=function(){var vb=g$.h(e);return $APP.r(vb)?vb:$APP.Hr.h(e)}(),l=Iha.h(e),m=$APP.WE.h(e),h=i$.h(e),q=j$.h(e),p=function(){var vb=z$.h(e);return $APP.r(vb)?vb:Jha.h(e)}(),v=$APP.Zh($APP.R.l($APP.Mh($APP.Vd(d)?d:$APP.Rg.g($APP.hf,d)),$APP.Oh(k),$APP.F([$APP.Mh(f)]))), | ||
D=$APP.A.g(!0,p)?v:null==p?null:$APP.Zh(p),I=h$.h(e),O=function(){var vb=Kha.h(e);return $APP.r(vb)?vb:function(Yb){Yb=$APP.jf(Yb);var Ic=$APP.fe.g(Yb,A$);throw $APP.cl.g(Ic,Yb);}}(),P=m$(a,null),W=$APP.jf(P),ca=$APP.fe.g(W,k$),ha=$APP.fe.g(W,l$),na=function(){var vb=n$.h(e);vb=$APP.r(vb)?vb:B$.h(e);return $APP.r(vb)?o$(ca,vb):new $APP.n(null,2,[n$,null,l$,ha],null)}(),pa=$APP.jf(na),fa=$APP.fe.g(pa,l$),E=$APP.fe.g(pa,n$),C=$APP.Qh.g(fa,ha)?new $APP.J(null,2,5,$APP.N,[null,$APP.R.g(fa,ha)],null): | ||
new $APP.J(null,2,5,$APP.N,[ca,ha],null),da=$APP.B.j(C,0,null),K=$APP.B.j(C,1,null),M=function(){for(var vb=$APP.hf,Yb=null,Ic=null,Me=$APP.r(q)?p$:null,hd=$APP.x(K),Jg=E;;){if($APP.Za(hd))return new $APP.J(null,3,5,$APP.N,[vb,Yb,Ic],null);var lg=$APP.y(hd),Tc=lg instanceof $APP.H;if(Tc){Yb=e$(vb,Yb,Ic,null);var me=lg;hd=$APP.z(hd);vb=Yb;Yb=me}else{var Al=!0===lg,Rf=$APP.t.h(lg);me=d$(l,Yb,$APP.fe.g(f,Yb));var xi=$APP.fe.g(f,Yb),Bl=w$(Rf,Me,Yb,xi,Ic),Kh=$APP.jf(Bl),Cl=$APP.fe.g(Kh,s$),Lh=$APP.fe.g(Kh, | ||
t$),Dl=$APP.fe.g(Kh,u$),Sf=$APP.fe.g(Kh,$APP.Xw),mk=$APP.fe.g(Kh,v$);if($APP.r(function(){var Oe=Cl;return $APP.r(Oe)?Oe:Dl}())){var Yc=$APP.qa(Rf,"--"),nk=Yc&&$APP.A.g("--",Rf);if(nk){var El=$APP.z(hd);return new $APP.J(null,3,5,$APP.N,[function(){var Oe=vb;return El?$APP.jo.A(Oe,$APP.Ou,new $APP.J(null,2,5,$APP.N,[y$,l$],null),$APP.mg(El)):Oe}(),Yb,Ic],null)}var ok=Yc?$APP.ji.g(Rf,2):$APP.Zj(Rf,/^(:|-|)/,""),zf=Yc?$APP.Dr.g(ok,/=/):new $APP.J(null,1,5,$APP.N,[ok],null),Sd=$APP.B.j(zf,0,null),Ce= | ||
$APP.B.j(zf,1,null),Tb=$APP.zi.h(Sd),Ec=$APP.fe.j(k,Tb,Tb);if($APP.r(Ce))Ic=e$(vb,Yb,Ic,me),Yb=Ec,Me=Sf,hd=$APP.He(Ce,$APP.cd(hd)),vb=Ic,Ic=null;else{var Ab=$APP.z(hd),Ne=$APP.y(Ab),mw=w$(Ne,Sf,Yb,xi,Ic);if($APP.r(function(){var Oe=s$.h(mw);return $APP.r(Oe)?Oe:$APP.Qd(Ab)}()))if($APP.r(Lh)){var nw=$APP.ai(Ec);Ic=$APP.aq.l(function(){return function(Oe){return new $APP.J(null,2,5,$APP.N,[["-",$APP.t.h(Oe)].join(""),!0],null)}}(vb,Yb,Ic,Me,hd,Jg,nw,Ab,Ne,mw,ok,zf,Sd,Ce,Tb,Ec,Yc,nk,Al,Rf,me,xi,Bl,Kh, | ||
Cl,Lh,Dl,Sf,mk,lg,Tc,d,e,f,k,l,m,h,q,p,v,D,I,O,c,P,W,ca,ha,na,pa,fa,E,C,da,K),$APP.F([nw]));hd=$APP.R.g(Ic,Ab);Me=Sf;Ic=Yb=null}else hd=$APP.he(v,Ec)?null:$APP.MG($APP.t.h(Ec),":no-"),Me=$APP.r(hd)?$APP.zi.h($APP.Zj($APP.t.h(Ec),":no-","")):Ec,hd=$APP.He($APP.Za(hd),Ab),Yb=e$(vb,Yb,Ic,me),me=Me,Me=Sf,vb=Yb,Yb=me;else Yb=e$(vb,Yb,Ic,me),me=Ec,Me=Sf,hd=Ab,vb=Yb,Yb=me}}else if(nk=$APP.A.g(q$,xi)&&$APP.Qh.g(Rf,"true")&&$APP.Qh.g(Rf,"false")||$APP.A.g(Ic,Yb)&&$APP.Za(me))if(Jg=$APP.r(hd)?$APP.r(Jg)?o$(hd, | ||
Jg):new $APP.n(null,1,[l$,hd],null):new $APP.n(null,1,[l$,hd],null),Me=$APP.jf(Jg),Jg=$APP.fe.g(Me,l$),Me=$APP.fe.g(Me,n$),$APP.Qh.g(hd,Jg))me=Me,Me=Sf,hd=Jg,Jg=me;else return new $APP.J(null,3,5,$APP.N,[$APP.jo.A(vb,$APP.Ou,new $APP.J(null,2,5,$APP.N,[y$,l$],null),$APP.mg(hd)),Yb,Ic],null);else{try{var Zd=Gha(vb,Yb,me,Cha(xi),Rf,Al)}catch(Oe){c(new $APP.n(null,4,[C$,f$,A$,$APP.aH(Oe),D$,Yb,E$,Rf],null)),Zd=vb}Ic=$APP.r(function(){var Oe=$APP.A.g(r$,Sf);return Oe?mk:Oe}())?null:Yb;me=$APP.r(function(){var Oe= | ||
$APP.A.g(r$,Sf);return Oe?mk:Oe}())?null:Yb;Me=Sf;hd=$APP.z(hd);vb=Zd;Yb=Ic;Ic=me}}}}(),ea=$APP.B.j(M,0,null),ia=$APP.B.j(M,1,null),ja=$APP.B.j(M,2,null),sa=d$(l,ia,$APP.fe.g(f,ia)),ta=function(){var vb=e$(ea,ia,ja,sa);return $APP.x(da)?$APP.jo.A(vb,$APP.Nk,new $APP.J(null,2,5,$APP.N,[y$,l$],null),function(Yb){return $APP.Rg.g($APP.mg(da),Yb)}):vb}(),wa=$APP.r(h)?$APP.Md($APP.Qk.l($APP.F([h,ta])),$APP.Nd(ta)):ta;if($APP.r(D)){a=$APP.x($APP.Mh(wa));b=null;for(var ya=0,Ca=0;;)if(Ca<ya){var Ha=b.ba(null, | ||
Ca);$APP.he(D,Ha)||c(new $APP.n(null,4,[C$,z$,A$,["Unknown option: ",$APP.t.h(Ha)].join(""),z$,D,D$,Ha],null));Ca+=1}else if(a=$APP.x(a))b=a,$APP.Yd(b)?(a=$APP.uc(b),Ca=$APP.vc(b),b=a,ya=$APP.xd(a),a=Ca):(a=$APP.y(b),$APP.he(D,a)||c(new $APP.n(null,4,[C$,z$,A$,["Unknown option: ",$APP.t.h(a)].join(""),z$,D,D$,a],null)),a=$APP.z(b),b=null,ya=0),Ca=0;else break}if($APP.r(m))for(a=$APP.x(m),b=null,Ca=ya=0;;)if(Ca<ya)Ha=b.ba(null,Ca),$APP.r($APP.WG(wa,Ha))||c(new $APP.n(null,4,[C$,$APP.WE,A$,["Required option: ", | ||
$APP.t.h(Ha)].join(""),$APP.WE,m,D$,Ha],null)),Ca+=1;else if(a=$APP.x(a))b=a,$APP.Yd(b)?(a=$APP.uc(b),Ca=$APP.vc(b),b=a,ya=$APP.xd(a),a=Ca):(a=$APP.y(b),$APP.r($APP.WG(wa,a))||c(new $APP.n(null,4,[C$,$APP.WE,A$,["Required option: ",$APP.t.h(a)].join(""),$APP.WE,m,D$,a],null)),a=$APP.z(b),b=null,ya=0),Ca=0;else break;if($APP.r(I))for(var Da=$APP.x(I),za=null,Oa=0,Sa=0;;)if(Sa<Oa){var db=za.ba(null,Sa),ub=$APP.B.j(db,0,null),Bb=$APP.B.j(db,1,null),Xb=function(){var vb=(vb=$APP.Vd(Bb))?F$.h(Bb):vb;return $APP.r(vb)? | ||
vb:Bb}(),qc=$APP.WG(wa,ub);if($APP.r(qc)){var $c=qc,Rb=$APP.B.j($c,0,null),mf=$APP.B.j($c,1,null);if(!$APP.r(Xb.h?Xb.h(mf):Xb.call(null,mf))){var ik=function(){var vb=G$.h(Bb);return $APP.r(vb)?vb:function(){return function(Yb){var Ic=$APP.jf(Yb);Yb=$APP.fe.g(Ic,D$);Ic=$APP.fe.g(Ic,E$);return["Invalid value for option ",$APP.t.h(Yb),": ",$APP.t.h(Ic)].join("")}}(Da,za,Oa,Sa,vb,$c,Rb,mf,qc,Xb,db,ub,Bb,d,e,f,k,l,m,h,q,p,v,D,I,O,c,P,W,ca,ha,na,pa,fa,E,C,da,K,M,ea,ia,ja,sa,ta,wa)}();c(new $APP.n(null, | ||
5,[C$,h$,A$,function(){var vb=new $APP.n(null,2,[D$,ub,E$,mf],null);return ik.h?ik.h(vb):ik.call(null,vb)}(),h$,I,D$,ub,E$,mf],null))}}Sa+=1}else{var xl=$APP.x(Da);if(xl){var vi=xl;if($APP.Yd(vi))ya=$APP.uc(vi),a=$APP.vc(vi),b=ya,ya=$APP.xd(ya),Da=a,za=b,Oa=ya;else{var jk=$APP.y(vi),kk=$APP.B.j(jk,0,null),rj=$APP.B.j(jk,1,null),lk=function(){var vb=(vb=$APP.Vd(rj))?F$.h(rj):vb;return $APP.r(vb)?vb:rj}(),yl=$APP.WG(wa,kk);if($APP.r(yl)){var Hc=yl,sj=$APP.B.j(Hc,0,null),wi=$APP.B.j(Hc,1,null);if(!$APP.r(lk.h? | ||
lk.h(wi):lk.call(null,wi))){var zl=function(){var vb=G$.h(rj);return $APP.r(vb)?vb:function(){return function(Yb){var Ic=$APP.jf(Yb);Yb=$APP.fe.g(Ic,D$);Ic=$APP.fe.g(Ic,E$);return["Invalid value for option ",$APP.t.h(Yb),": ",$APP.t.h(Ic)].join("")}}(Da,za,Oa,Sa,vb,Hc,sj,wi,yl,lk,jk,kk,rj,vi,xl,d,e,f,k,l,m,h,q,p,v,D,I,O,c,P,W,ca,ha,na,pa,fa,E,C,da,K,M,ea,ia,ja,sa,ta,wa)}();c(new $APP.n(null,5,[C$,h$,A$,function(){var vb=new $APP.n(null,2,[D$,kk,E$,wi],null);return zl.h?zl.h(vb):zl.call(null,vb)}(), | ||
h$,I,D$,kk,E$,wi],null))}}Da=$APP.z(vi);za=null;Oa=0}Sa=0}else break}return wa},Mha=function(a,b){a=Lha(a,b);b=y$.h($APP.Nd(a));return $APP.Rh.j(b,$APP.EH,$APP.Rk.g(a,y$))},Nha=function(a,b){var c=$APP.Of($APP.xd(a),b);b=$APP.B.j(c,0,null);c=$APP.B.j(c,1,null);return $APP.A.g(b,a)?c:null},L$=function(a,b){$APP.Jf(H$,!1);a.setPrompt([$APP.t.h($APP.u(I$)),"\x3d\x3e "].join(""));a.prompt();return $APP.gk($APP.u(J$))?null:K$.g?K$.g(b,a):K$.call(null,b,a)},M$=function(a){var b=$APP.Bk(a);a=$APP.Ck(a); | ||
var c=$APP.bH($APP.u(J$));b=$APP.Nf.g(b-1,c);c=$APP.x(b);b=$APP.y(c);c=$APP.z(c);a=$APP.r(b)?$APP.ji.g(b,a):null;$APP.Jf(J$,$APP.Mp.g("\n",$APP.He(a,c)))},Pha=function(a,b,c){var d=function(){var f=$APP.lr;$APP.lr=$APP.u(I$);try{a:{var k=$APP.La;$APP.La=!0;try{var l=$APP.Ri.l($APP.F([a]));break a}finally{$APP.La=k}l=void 0}return $APP.lu(l,new $APP.n(null,3,[$APP.Op,$APP.Rp,$APP.Er,Oha,$APP.au,!0],null),null)}finally{$APP.lr=f}}(),e=$APP.jf(d);d=$APP.fe.g(e,$APP.ku);e=$APP.fe.g(e,$APP.T);d=$APP.Zj("(async function () {\n%s\n}) ()", | ||
"%s",d);$APP.Jf(I$,e);return Promise.resolve(eval(d)).then(function(f){$APP.r(c)?c.write(esm_import$node_util.inspect(f),"\n"):console.log(f);return K$.g?K$.g(c,b):K$.call(null,c,b)}).catch(function(f){esm_import$squint_cljs$core.println(f);return L$(b,c)})},K$=function(a,b){if($APP.r(function(){var e=$APP.u(H$);return $APP.r(e)?e:!$APP.gk($APP.u(J$))}())){$APP.Jf(H$,!0);var c=$APP.hp($APP.u(J$)),d=function(){try{return $APP.jp(c,$APP.Yt)}catch(f){var e=f;if(-1!=$APP.aH(e).indexOf("EOF while reading"))return N$; | ||
M$(c);$APP.AH.l($APP.F([$APP.t.h(e)]));return O$}}();if($APP.A.g(O$,d))return L$(b,a);if($APP.A.g(N$,d))return $APP.Jf(H$,!1);M$(c);return $APP.A.g($APP.ip,d)?L$(b,a):Pha(d,b,a)}return null},P$=function(a,b){a.on("line",function(c){$APP.Wi.A(J$,$APP.t,c,"\n");return K$(b,a)})},Qha=function(a){var b=esm_import$readline.createInterface({input:a,output:a});P$(b,a);a.setNoDelay(!0);return a.on("close",function(){return $APP.BH.l($APP.F(["Client closed connection."]))})},Q$=function(a,b,c){return $APP.r(c)? | ||
esm_import$path.resolve(c,$APP.pH(a,b)):a},R$=function(a,b,c){var d=$APP.uH.h(a),e=$APP.eH.h(a);b=Q$(b,e,d);c=$APP.gH(c);d=null==c?null:Q$(c,e,d);d=null==d?null:null==d?null:esm_import$path.relative(esm_import$path.dirname($APP.t.h(b)),d);return $APP.r(d)?(a=$APP.tH.g(a,".mjs"),a=$APP.qa(a,".")?a:[".",$APP.t.h(a)].join(""),e=esm_import$path.extname(d),["./",$APP.Zj(d,$APP.ki([$APP.t.h(e),"$"].join("")),a)].join("")):null},S$=function(a,b,c){b=esm_import$path.resolve(b,$APP.pH(a,c));c=esm_import$path.dirname(b); | ||
$APP.r(esm_import$fs.existsSync(c))||($APP.BH.l($APP.F(["[squint] Creating directory:",c])),esm_import$fs.mkdirSync(c,{recursive:!0}));$APP.BH.l($APP.F(["[squint] Copying resource",a,"to",c]));return esm_import$fs.copyFileSync(a,b)},V$=function(a,b){var c=$APP.u($APP.fH),d=$APP.Qk.l($APP.F([c,a])),e=$APP.eH.h(c),f=$APP.uH.g(c,".");a=$APP.Qd(b)?$APP.mg($APP.aq.l(T$,$APP.F([e]))):b;b=$APP.uH.h(d);if($APP.r(b)&&"string"!==typeof b)throw Error("output-dir must be a string");return $APP.r(U$.h(d))?($APP.BH.l($APP.F(["Usage: squint compile \x3cfiles\x3e \x3copts\x3e"])), | ||
$APP.BH(),$APP.BH.l($APP.F(["Options:\n\n--elide-imports: do not include imports\n--elide-exports: do not include exports\n--extension: default extension for JS files\n--output-dir: output directory for JS files"]))):$APP.oe.j(function(k,l){return Promise.resolve(k).then(function(){return $APP.he(new $APP.Uh(null,new $APP.n(null,2,[".cljc",null,".cljs",null],null),null),esm_import$path.extname(l))?($APP.BH.l($APP.F(["[squint] Compiling CLJS file:",l])),$APP.vH($APP.Rh.l(d,$APP.qH,l,$APP.F([$APP.tr, | ||
function(m){return R$(d,l,m)}])))):S$(l,f,e)}).then(function(m){m=$APP.jf(m);m=$APP.fe.g(m,$APP.sH);$APP.r(m)&&$APP.BH.l($APP.F(["[squint] Wrote file:",m]));return m})},null,a)},u$=new $APP.H(null,"kwd-opt","kwd-opt",1313309243),p$=new $APP.H(null,"hyphens","hyphens",2113533609),x$=new $APP.H(null,"spec","spec",347520401),f$=new $APP.H(null,"coerce","coerce",1917884504),z$=new $APP.H(null,"restrict","restrict",-1071101511),r$=new $APP.H(null,"keywords","keywords",1526959054),O$=new $APP.H("squint.repl.node", | ||
"continue","squint.repl.node/continue",1558138730),A$=new $APP.H(null,"msg","msg",-1386103444),Rha=new $APP.H(null,"show","show",-576705889),q$=new $APP.H(null,"boolean","boolean",-1919418404),Dha=new $APP.H(null,"input","input",556931961),W$=new $APP.H(null,"rest-cmds","rest-cmds",-423198324),y$=new $APP.H("org.babashka","cli","org.babashka/cli",1162430315),n$=new $APP.H(null,"args-\x3eopts","args-\x3eopts",964391046),g$=new $APP.H(null,"alias","alias",-2039751630),Iha=new $APP.H(null,"collect", | ||
"collect",-284321549),h$=new $APP.H(null,"validate","validate",-201300827),t$=new $APP.H(null,"composite-opt","composite-opt",-2021292928),Sha=new $APP.H(null,"run","run",-1821166653),s$=new $APP.H(null,"hyphen-opt","hyphen-opt",1836909464),U$=new $APP.H(null,"help","help",-439233446),C$=new $APP.H(null,"cause","cause",231901252),v$=new $APP.H(null,"fst-colon","fst-colon",1618567071),Eha=new $APP.H(null,"coerce-fn","coerce-fn",-821146515),l$=new $APP.H(null,"args","args",1315556576),j$=new $APP.H(null, | ||
"no-keyword-opts","no-keyword-opts",761286018),E$=new $APP.H(null,"value","value",305978217),F$=new $APP.H(null,"pred","pred",1927423397),Jha=new $APP.H(null,"closed","closed",-919675359),N$=new $APP.H("squint.repl.node","eof-while-reading","squint.repl.node/eof-while-reading",198833493),Kha=new $APP.H(null,"error-fn","error-fn",-171437615),D$=new $APP.H(null,"option","option",65132272),i$=new $APP.H(null,"exec-args","exec-args",-1860766354),G$=new $APP.H(null,"ex-msg","ex-msg",-1111774387),zha=new $APP.H(null, | ||
"s","s",1705939918),B$=new $APP.H(null,"cmds-opts","cmds-opts",-390130362),Tha=new $APP.H(null,"h","h",1109658740),k$=new $APP.H(null,"cmds","cmds",-1841503952);var J$=$APP.Vi.h(""),H$=$APP.Vi.h(!1),I$=$APP.Vi.h($APP.lr),X$,Y$=process.stdout.isTTY;X$=$APP.r(Y$)?process.stdin.setRawMode:Y$;var Oha=$APP.Vi.h($APP.hf),Z$=function Z$(a){switch(arguments.length){case 0:return Z$.v();case 1:return Z$.h(arguments[0]);default:throw Error(["Invalid arity: ",$APP.t.h(arguments.length)].join(""));}};Z$.v=function(){return Z$.h(null)}; | ||
Z$.h=function(a){$APP.lr=$APP.iy;$APP.$q=$APP.kr=!0;var b=function(){var d=$APP.DH.h(a);return $APP.r(d)?d:0}(),c=esm_import$net.createServer(Qha);return c.listen(b,"127.0.0.1",function(){var d=c.address(),e=d.address;return $APP.BH.l($APP.F([["Socket REPL listening on port ",$APP.t.h(d.port)," on host ",$APP.t.h(e)].join("")]))})};Z$.m=1; | ||
var $$=function $$(a){switch(arguments.length){case 0:return $$.v();case 1:return $$.h(arguments[0]);default:throw Error(["Invalid arity: ",$APP.t.h(arguments.length)].join(""));}};$$.v=function(){return $$.h(null)}; | ||
$$.h=function(){$APP.ir=$APP.Yx;$APP.Xq=$APP.hr=!0;$APP.r(X$)&&process.stdin.setRawMode(!0);return Promise.resolve(eval("globalThis.user \x3d globalThis.user || {};")).then(function(){return new Promise(function(a){var b=$APP.r(null)?esm_import$readline.createInterface({input:null,output:null}):esm_import$readline.createInterface({input:process.stdin,output:process.stdout});P$(b,null);b.setPrompt([$APP.t.h($APP.u(I$)),"\x3d\x3e "].join(""));b.on("close",a);return b.prompt()})})};$$.m=1;var T$=function T$(a){var c=esm_import$fs.readdirSync(a);return $APP.mg($APP.aq.l(function(d){d=esm_import$path.resolve(a,d);return $APP.r(esm_import$fs.lstatSync(d).isDirectory())?T$.h?T$.h(d):T$.call(null,d):new $APP.I(null,1,5,$APP.N,[d],null)},$APP.F([c])))},Nha=new $APP.I(null,7,5,$APP.N,[new $APP.n(null,3,[k$,new $APP.I(null,1,5,$APP.N,["run"],null),$APP.yo,function(a){a=$APP.jf(a);a=$APP.fe.g(a,$APP.xH);var b=$APP.u($APP.ZG),c=$APP.Qk.l($APP.F([b,a]));a=$APP.jf(c);var d=$APP.fe.g(a,$APP.$k); | ||
a=$APP.fe.g(a,U$);if($APP.r(a))return null;$APP.uH.l($APP.F(["[squint] Running",d]));return $APP.oH($APP.Rh.l(c,$APP.jH,d,$APP.F([$APP.qr,function(e){return R$(c,d,e)}]))).then(function(e){e=$APP.jf(e);e=$APP.fe.g(e,$APP.lH);e=$APP.r(esm_import$path.isAbsolute(e))?e:[$APP.t.h(process.cwd()),"/",$APP.t.h(e)].join("");return shadow_esm_import(e)})},B$,new $APP.I(null,1,5,$APP.N,[$APP.$k],null)],null),new $APP.n(null,2,[k$,new $APP.I(null,1,5,$APP.N,["compile"],null),$APP.yo,function(a){var b=$APP.jf(a); | ||
a=$APP.fe.g(b,W$);b=$APP.fe.g(b,$APP.xH);return V$(b,a)}],null),new $APP.n(null,2,[k$,new $APP.I(null,1,5,$APP.N,["repl"],null),$APP.yo,$$],null),new $APP.n(null,2,[k$,new $APP.I(null,1,5,$APP.N,["socket-repl"],null),$APP.yo,Z$],null),new $APP.n(null,2,[k$,new $APP.I(null,1,5,$APP.N,["nrepl-server"],null),$APP.yo,function(a){a=$APP.jf(a);var b=$APP.fe.g(a,$APP.xH);return shadow_esm_import("./node.nrepl_server.js").then(function(c){c=c.startServer;return c.h?c.h(b):c.call(null,b)})}],null),new $APP.n(null, | ||
2,[k$,new $APP.I(null,1,5,$APP.N,["watch"],null),$APP.yo,function(a){var b=$APP.u($APP.ZG),c=$APP.Qk.l($APP.F([b,a])),d=$APP.YG.h(b),e=$APP.nH.g(b,".");return shadow_esm_import("chokidar").catch(function(f){return console.error(f)}).then(function(f){f=f.watch;$APP.uH.l($APP.F(["[squint] Watching paths:",$APP.Mp.g(", ",d)]));for(var k=$APP.x(d),l=null,m=0,h=0;;)if(h<m){var p=l.ba(null,h);(f.h?f.h(p):f.call(null,p)).on("all",function(D,J,O,P,W,ca,ha,na,pa,fa){return function(E,C){return $APP.r(esm_import$fs.existsSync(C))? | ||
$APP.r(esm_import$fs.lstatSync(C).isDirectory())?null:$APP.he(new $APP.Uh(null,new $APP.n(null,2,["add",null,"change",null],null),null),E)&&$APP.he(new $APP.Uh(null,new $APP.n(null,2,[".cljc",null,".cljs",null],null),null),esm_import$path.extname(C))?V$(na,new $APP.I(null,1,5,$APP.N,[C],null)).catch(function(){return function(da){return console.error(da)}}(D,J,O,P,W,ca,ha,na,pa,fa)):S$(C,fa,pa):null}}(k,l,m,h,p,f,b,c,d,e));h+=1}else{var q=$APP.x(k);if(q){var v=q;$APP.Yd(v)?(k=$APP.uc(v),m=$APP.vc(v), | ||
l=k,v=$APP.xd(k),k=m,m=v):(p=$APP.y(v),(f.h?f.h(p):f.call(null,p)).on("all",function(D,J,O,P,W,ca,ha,na,pa,fa,E,C){return function(da,K){return $APP.r(esm_import$fs.existsSync(K))?$APP.r(esm_import$fs.lstatSync(K).isDirectory())?null:$APP.he(new $APP.Uh(null,new $APP.n(null,2,["add",null,"change",null],null),null),da)&&$APP.he(new $APP.Uh(null,new $APP.n(null,2,[".cljc",null,".cljs",null],null),null),esm_import$path.extname(K))?V$(fa,new $APP.I(null,1,5,$APP.N,[K],null)).catch(function(){return function(M){return console.error(M)}}(D, | ||
J,O,P,W,ca,ha,na,pa,fa,E,C)):S$(K,C,E):null}}(k,l,m,h,p,v,q,f,b,c,d,e)),k=$APP.z(v),l=null,m=0);h=0}else return null}})}],null),new $APP.n(null,2,[k$,$APP.lg,$APP.yo,function(a){a=$APP.jf(a);var b=$APP.fe.g(a,W$),c=$APP.fe.g(a,$APP.xH);a=$APP.vE.h(c);if($APP.r(a)){if($APP.r(U$.h(c)))return $APP.uH.l($APP.F(["Usage: squint -e \x3cexpr\x3e \x3copts\x3e\n\nOptions:\n\n--no-run: do not run compiled expression\n--show: print compiled expression"]));a=$APP.r($APP.st.h(c))?$APP.Zj("(do %s\n)","%s",a): | ||
a;a=$APP.EG.g(a,$APP.Rh.l(c,$APP.st,$APP.st.h(c),$APP.F([$APP.Br,$APP.Vi.h(new $APP.n(null,1,[$APP.to,$APP.Yx],null)),$APP.Op,$APP.r($APP.st.h(c))?$APP.Rp:$APP.Sp,$APP.Wt,function(){var f=$APP.st.h(c);return $APP.r(f)?!1!==$APP.Wt.h(c):f}()])));a=$APP.r($APP.st.h(c))?$APP.Zj("(async function() { %s })()","%s",a):a;var d=esm_import$fs.mkdtempSync(".tmp"),e=[$APP.t.h(d),"/squint.mjs"].join("");esm_import$fs.writeFileSync(e,a,"utf-8");$APP.r(Kha.h(c))&&$APP.uH.l($APP.F([a]));if(!1===Lha.h(c))return null; | ||
e=$APP.r(esm_import$path.isAbsolute(e))?e:[$APP.t.h(process.cwd()),"/",e].join("");return($APP.r($APP.st.h(c))?Promise.resolve(eval(a)):shadow_esm_import(e)).then(function(f){return $APP.r($APP.st.h(c))?$APP.tH.l($APP.F([f])):null}).finally(function(){return esm_import$fs.rmSync(d,{force:!0,recursive:!0})})}return $APP.r(function(){var f=U$.h(c);return $APP.r(f)?f:$APP.A.g("help",$APP.y(b))||$APP.Qd(b)}())?$APP.uH.l($APP.F(["Squint v0.6.95\n\nUsage: squint \x3csubcommand\x3e \x3copts\x3e\n\nSubcommands:\n\n-e \x3cexpr\x3e Compile and run expression.\nrun \x3cfile.cljs\x3e Compile and run a file\nwatch Watch :paths in squint.edn\ncompile \x3cfile.cljs\x3e ... Compile file(s)\nrepl Start repl\nhelp Print this help\n\nUse squint \x3csubcommand\x3e --help to show more info."])): | ||
V$(c,b)}],null)],null);(function(){var a=new $APP.n(null,2,[$APP.Er,new $APP.n(null,1,[Mha,U$],null),f$,new $APP.n(null,4,[$APP.Wt,q$,$APP.Fr,q$,$APP.nH,$APP.nl,$APP.st,q$],null)],null),b=m$(process.argv.slice(2),a),c=$APP.jf(b),d=$APP.fe.g(c,k$),e=$APP.fe.g(c,l$);return $APP.oe.j(function(f,k){f=$APP.jf(k);var l=$APP.fe.g(f,k$),m=$APP.fe.g(f,$APP.yo),h=Gha(l,d);if($APP.r(h)){k=function(){var v=null==h?null:$APP.x(h);return null==v?null:$APP.mg(v)}();k=$APP.R.g(k,e);f=Fha(k,W9(a,$APP.F([f])));k=$APP.jf(f);var p=$APP.fe.g(k, | ||
$APP.xH);f=$APP.fe.g(k,l$);k=$APP.fe.g(k,k$);var q=$APP.R.g(k,f);return $APP.ld(function(){var v=$APP.Rh.l(c,l$,q,$APP.F([W$,q,$APP.xH,p,$APP.ap,l]));return m.h?m.h(v):m.call(null,v)}())}return null},null,Nha)})(); | ||
$$.h=function(){$APP.lr=$APP.iy;$APP.$q=$APP.kr=!0;$APP.r(X$)&&process.stdin.setRawMode(!0);return Promise.resolve(eval("globalThis.user \x3d globalThis.user || {};")).then(function(){return new Promise(function(a){var b=$APP.r(null)?esm_import$readline.createInterface({input:null,output:null}):esm_import$readline.createInterface({input:process.stdin,output:process.stdout});P$(b,null);b.setPrompt([$APP.t.h($APP.u(I$)),"\x3d\x3e "].join(""));b.on("close",a);return b.prompt()})})};$$.m=1;var T$=function T$(a){var c=esm_import$fs.readdirSync(a);return $APP.mg($APP.aq.l(function(d){d=esm_import$path.resolve(a,d);return $APP.r(esm_import$fs.lstatSync(d).isDirectory())?T$.h?T$.h(d):T$.call(null,d):new $APP.J(null,1,5,$APP.N,[d],null)},$APP.F([c])))},Uha=new $APP.J(null,7,5,$APP.N,[new $APP.n(null,3,[k$,new $APP.J(null,1,5,$APP.N,["run"],null),$APP.yo,function(a){a=$APP.jf(a);a=$APP.fe.g(a,$APP.EH);var b=$APP.u($APP.fH),c=$APP.Qk.l($APP.F([b,a]));a=$APP.jf(c);var d=$APP.fe.g(a,$APP.$k); | ||
a=$APP.fe.g(a,U$);if($APP.r(a))return null;$APP.BH.l($APP.F(["[squint] Running",d]));return $APP.vH($APP.Rh.l(c,$APP.qH,d,$APP.F([$APP.tr,function(e){return R$(c,d,e)}]))).then(function(e){e=$APP.jf(e);e=$APP.fe.g(e,$APP.sH);e=$APP.r(esm_import$path.isAbsolute(e))?e:[$APP.t.h(process.cwd()),"/",$APP.t.h(e)].join("");return shadow_esm_import(e)})},B$,new $APP.J(null,1,5,$APP.N,[$APP.$k],null)],null),new $APP.n(null,2,[k$,new $APP.J(null,1,5,$APP.N,["compile"],null),$APP.yo,function(a){var b=$APP.jf(a); | ||
a=$APP.fe.g(b,W$);b=$APP.fe.g(b,$APP.EH);return V$(b,a)}],null),new $APP.n(null,2,[k$,new $APP.J(null,1,5,$APP.N,["repl"],null),$APP.yo,$$],null),new $APP.n(null,2,[k$,new $APP.J(null,1,5,$APP.N,["socket-repl"],null),$APP.yo,Z$],null),new $APP.n(null,2,[k$,new $APP.J(null,1,5,$APP.N,["nrepl-server"],null),$APP.yo,function(a){a=$APP.jf(a);var b=$APP.fe.g(a,$APP.EH);return shadow_esm_import("./node.nrepl_server.js").then(function(c){c=c.startServer;return c.h?c.h(b):c.call(null,b)})}],null),new $APP.n(null, | ||
2,[k$,new $APP.J(null,1,5,$APP.N,["watch"],null),$APP.yo,function(a){var b=$APP.u($APP.fH),c=$APP.Qk.l($APP.F([b,a])),d=$APP.eH.h(b),e=$APP.uH.g(b,".");return shadow_esm_import("chokidar").catch(function(f){return console.error(f)}).then(function(f){f=f.watch;$APP.BH.l($APP.F(["[squint] Watching paths:",$APP.Mp.g(", ",d)]));for(var k=$APP.x(d),l=null,m=0,h=0;;)if(h<m){var q=l.ba(null,h);(f.h?f.h(q):f.call(null,q)).on("all",function(D,I,O,P,W,ca,ha,na,pa,fa){return function(E,C){return $APP.r(esm_import$fs.existsSync(C))? | ||
$APP.r(esm_import$fs.lstatSync(C).isDirectory())?null:$APP.he(new $APP.Uh(null,new $APP.n(null,2,["add",null,"change",null],null),null),E)&&$APP.he(new $APP.Uh(null,new $APP.n(null,2,[".cljc",null,".cljs",null],null),null),esm_import$path.extname(C))?V$(na,new $APP.J(null,1,5,$APP.N,[C],null)).catch(function(){return function(da){return console.error(da)}}(D,I,O,P,W,ca,ha,na,pa,fa)):S$(C,fa,pa):null}}(k,l,m,h,q,f,b,c,d,e));h+=1}else{var p=$APP.x(k);if(p){var v=p;$APP.Yd(v)?(k=$APP.uc(v),m=$APP.vc(v), | ||
l=k,v=$APP.xd(k),k=m,m=v):(q=$APP.y(v),(f.h?f.h(q):f.call(null,q)).on("all",function(D,I,O,P,W,ca,ha,na,pa,fa,E,C){return function(da,K){return $APP.r(esm_import$fs.existsSync(K))?$APP.r(esm_import$fs.lstatSync(K).isDirectory())?null:$APP.he(new $APP.Uh(null,new $APP.n(null,2,["add",null,"change",null],null),null),da)&&$APP.he(new $APP.Uh(null,new $APP.n(null,2,[".cljc",null,".cljs",null],null),null),esm_import$path.extname(K))?V$(fa,new $APP.J(null,1,5,$APP.N,[K],null)).catch(function(){return function(M){return console.error(M)}}(D, | ||
I,O,P,W,ca,ha,na,pa,fa,E,C)):S$(K,C,E):null}}(k,l,m,h,q,v,p,f,b,c,d,e)),k=$APP.z(v),l=null,m=0);h=0}else return null}})}],null),new $APP.n(null,2,[k$,$APP.kg,$APP.yo,function(a){a=$APP.jf(a);var b=$APP.fe.g(a,W$),c=$APP.fe.g(a,$APP.EH);a=$APP.CE.h(c);if($APP.r(a)){if($APP.r(U$.h(c)))return $APP.BH.l($APP.F(["Usage: squint -e \x3cexpr\x3e \x3copts\x3e\n\nOptions:\n\n--no-run: do not run compiled expression\n--show: print compiled expression"]));a=$APP.r($APP.vt.h(c))?$APP.Zj("(do %s\n)","%s",a): | ||
a;a=$APP.LG.g(a,$APP.Rh.l(c,$APP.vt,$APP.vt.h(c),$APP.F([$APP.Er,$APP.Vi.h(new $APP.n(null,1,[$APP.to,$APP.iy],null)),$APP.Op,$APP.r($APP.vt.h(c))?$APP.Rp:$APP.Sp,$APP.au,function(){var f=$APP.vt.h(c);return $APP.r(f)?!1!==$APP.au.h(c):f}()])));a=$APP.r($APP.vt.h(c))?$APP.Zj("(async function() { %s })()","%s",a):a;var d=esm_import$fs.mkdtempSync(".tmp"),e=[$APP.t.h(d),"/squint.mjs"].join("");esm_import$fs.writeFileSync(e,a,"utf-8");$APP.r(Rha.h(c))&&$APP.BH.l($APP.F([a]));if(!1===Sha.h(c))return null; | ||
e=$APP.r(esm_import$path.isAbsolute(e))?e:[$APP.t.h(process.cwd()),"/",e].join("");return($APP.r($APP.vt.h(c))?Promise.resolve(eval(a)):shadow_esm_import(e)).then(function(f){return $APP.r($APP.vt.h(c))?$APP.AH.l($APP.F([f])):null}).finally(function(){return esm_import$fs.rmSync(d,{force:!0,recursive:!0})})}return $APP.r(function(){var f=U$.h(c);return $APP.r(f)?f:$APP.A.g("help",$APP.y(b))||$APP.Qd(b)}())?$APP.BH.l($APP.F(["Squint v0.7.96\n\nUsage: squint \x3csubcommand\x3e \x3copts\x3e\n\nSubcommands:\n\n-e \x3cexpr\x3e Compile and run expression.\nrun \x3cfile.cljs\x3e Compile and run a file\nwatch Watch :paths in squint.edn\ncompile \x3cfile.cljs\x3e ... Compile file(s)\nrepl Start repl\nhelp Print this help\n\nUse squint \x3csubcommand\x3e --help to show more info."])): | ||
V$(c,b)}],null)],null);(function(){var a=new $APP.n(null,2,[$APP.Hr,new $APP.n(null,1,[Tha,U$],null),f$,new $APP.n(null,4,[$APP.au,q$,$APP.Ir,q$,$APP.uH,$APP.nl,$APP.vt,q$],null)],null),b=m$(process.argv.slice(2),a),c=$APP.jf(b),d=$APP.fe.g(c,k$),e=$APP.fe.g(c,l$);return $APP.oe.j(function(f,k){f=$APP.jf(k);var l=$APP.fe.g(f,k$),m=$APP.fe.g(f,$APP.yo),h=Nha(l,d);if($APP.r(h)){k=function(){var v=null==h?null:$APP.x(h);return null==v?null:$APP.mg(v)}();k=$APP.R.g(k,e);f=Mha(k,W9(a,$APP.F([f])));k=$APP.jf(f);var q=$APP.fe.g(k, | ||
$APP.EH);f=$APP.fe.g(k,l$);k=$APP.fe.g(k,k$);var p=$APP.R.g(k,f);return $APP.ld(function(){var v=$APP.Rh.l(c,l$,p,$APP.F([W$,p,$APP.EH,q,$APP.ap,l]));return m.h?m.h(v):m.call(null,v)}())}return null},null,Uha)})(); |
import { $APP, shadow$provide, $jscomp } from "./compiler.js"; | ||
import "./node.js"; | ||
const shadow_esm_import = function(x) { return import(x) }; | ||
import*as esm_import$fs from"fs";import*as esm_import$path from"path";var GG,HG,IG,WG,XG,gH,hH,pH,qH,aH,fH,kH;$APP.FG=function(a,b){return $APP.qa(a,b)};GG=function(a,b){a.sort(b||$APP.Ba)};HG=function(a,b){const c=Array(a.length);for(let e=0;e<a.length;e++)c[e]={index:e,value:a[e]};const d=b||$APP.Ba;GG(c,function(e,f){return d(e.value,f.value)||e.index-f.index});for(b=0;b<a.length;b++)a[b]=c[b].value};IG=function(){}; | ||
$APP.JG=function(a){return null!=a?a.D&512||$APP.Oc===a.Ce?!0:a.D?!1:$APP.cb($APP.yb,a):$APP.cb($APP.yb,a)};$APP.KG=function(a){return $APP.ee(a)||!1};$APP.LG=function(a){return"number"===typeof a};$APP.MG=function(){this.C=[]};$APP.NG=function(a){return $APP.A.g(a,$APP.ie)?$APP.ie:function(b,c){var d=a.g?a.g(b,c):a.call(null,b,c);return"number"===typeof d?d:$APP.r(d)?-1:$APP.r(a.g?a.g(c,b):a.call(null,c,b))?1:0}};$APP.OG=function(a){$APP.pi("\n");return $APP.fe.g(a,$APP.Ga),null}; | ||
$APP.PG=function(a,b){return(null!=a?$APP.Oc===a.Hc||(a.wd?0:$APP.cb(IG,a)):$APP.cb(IG,a))?$APP.Db(a,b):null!=a&&$APP.JG(a)&&$APP.he(a,b)?new $APP.Kg(b,$APP.fe.g(a,b),null):null};$APP.QG=function(a,b){return new $APP.I(null,2,5,$APP.N,[$APP.Tr.g(a,b),$APP.Vr.g(a,b)],null)};$APP.RG=function(a,b){this.f=a;this.value=b;this.D=2147516416;this.M=1};$APP.SG=function(a){return Math.floor(Math.random()*a)}; | ||
$APP.TG=function(){function a(){return $APP.SG(16).toString(16)}var b=(8|3&$APP.SG(16)).toString(16);return new $APP.nj([$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),"-",$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),"-4",$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),"-",$APP.t.h(b),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),"-",$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()), | ||
$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a())].join("").toLowerCase())};$APP.UG=function(a){return a instanceof Error?a.message:null};$APP.VG=function(a){return $APP.Ar.g(a,/\n|\r\n/)};WG=function(a,b){return $APP.r($APP.r(b)?$APP.Qh.g(b,""):b)?$APP.Em(a,$APP.Kk(b)):null};XG=function(a,b){return $APP.Ef(function(c){c=esm_import$path.resolve(a,[$APP.t.h(b),".",$APP.t.h(c)].join(""));return $APP.r(esm_import$fs.existsSync(c))?c:null},new $APP.I(null,2,5,$APP.N,["cljc","cljs"],null))}; | ||
$APP.$G=function(a){var b=$APP.Zj($APP.Zj($APP.t.h(a),"-","_"),".","/");return $APP.Ef(function(c){return XG(c,b)},$APP.YG.g($APP.u($APP.ZG),new $APP.I(null,2,5,$APP.N,[".","src"],null)))}; | ||
gH=function(a,b){b=$APP.jf(b);var c=$APP.fe.g(b,$APP.Br);a=$APP.jp($APP.hp(a),$APP.Tt);if($APP.be(a)&&$APP.A.g($APP.Dj,$APP.y(a))){a=$APP.x(a);$APP.y(a);a=$APP.z(a);var d=$APP.y(a);a=$APP.z(a);a=$APP.Ef(function(k){var l=$APP.B.j(k,0,null);k=$APP.B.j(k,1,null);return $APP.be(l)&&$APP.A.g(aH,$APP.y(l))?new $APP.I(null,2,5,$APP.N,[$APP.cd(l),k],null):null},$APP.bH.j(2,1,a));var e=$APP.B.j(a,0,null),f=$APP.B.j(a,1,null);return $APP.r(e)?shadow_esm_import("./compiler.sci.js").then(function(){var k=$APP.cH.h($APP.u($APP.dH)); | ||
return $APP.oe.j(function(l,m){return l.then(function(){var h=$APP.x(m),p=$APP.y(h);h=$APP.z(h);h=$APP.jf(h);var q=$APP.fe.g(h,$APP.wr),v=$APP.fe.g(h,$APP.xr);return Promise.resolve(function(){var D=function(){var O=new $APP.G(null,$APP.SE,new $APP.G(null,new $APP.G(null,$APP.Mj,new $APP.G(null,p,null,1,null),2,null),null,1,null),2,null);return $APP.r(f)?$APP.R.g(O,new $APP.I(null,1,5,$APP.N,[$APP.eH],null)):O}();k.h?k.h(D):k.call(null,D);var J=function(){var O=$APP.S.h($APP.x($APP.R.g(new $APP.G(null, | ||
fH,null,1,null),new $APP.G(null,$APP.S.h($APP.x($APP.R.g(new $APP.G(null,$APP.Mj,null,1,null),new $APP.G(null,p,null,1,null)))),null,1,null))));return k.h?k.h(O):k.call(null,O)}();D=$APP.Mh(J);J=$APP.Oh(J);J=$APP.ui.g($APP.od,J);return $APP.bi(D,J)}()).then(function(D){return $APP.Wi.g(c,function(J){J=$APP.Ju(J,new $APP.I(null,2,5,$APP.N,[$APP.rt,p],null),D);J=$APP.r(v)?$APP.Ju(J,new $APP.I(null,3,5,$APP.N,[d,$APP.Er,v],null),p):J;return $APP.r(q)?$APP.Ju(J,new $APP.I(null,2,5,$APP.N,[d,$APP.Cr], | ||
null),$APP.bi(q,$APP.Dr.h(p))):J})})})},Promise.resolve(null),e)}):null}return null};hH=function(a,b){return Promise.resolve(gH(a,b)).then(function(){return $APP.gu(a,b,null)})}; | ||
$APP.iH=function(a,b){return $APP.oe.j(function(c,d){a:{var e=esm_import$path.resolve(d).split(esm_import$path.sep);for(var f=esm_import$path.resolve(a).split(esm_import$path.sep);;){var k=$APP.Qd(e);if(k){e=k;break a}if(k=$APP.x(f))if(k=$APP.A.g($APP.y(e),$APP.y(f)))e=$APP.cd(e),f=$APP.cd(f);else{e=k;break a}else{e=k;break a}}}return e?$APP.ld(esm_import$path.relative(d,a)):c},a,b)}; | ||
$APP.oH=function(a){a=$APP.jf(a);var b=$APP.fe.g(a,$APP.jH),c=$APP.fe.g(a,kH),d=$APP.fe.g(a,$APP.lH),e=$APP.fe.g(a,$APP.mH),f=$APP.fe.j(a,$APP.nH,"");c=$APP.r(c)?c:esm_import$fs.readFileSync(b,"utf-8");return hH(c,$APP.Rh.j(a,$APP.Br,$APP.Vi.h(new $APP.n(null,1,[$APP.to,$APP.Yx],null)))).then(function(k){k=$APP.jf(k);var l=$APP.fe.g(k,$APP.fu),m=$APP.fe.g(k,$APP.vq),h=$APP.YG.g($APP.u($APP.ZG),new $APP.I(null,2,5,$APP.N,[".","src"],null)),p=esm_import$path,q=p.resolve;$APP.r(d)?h=d:(h=$APP.iH(b,h), | ||
$APP.r(m)?m=".jsx":(m=$APP.r(e)?[".",$APP.Zj(e,/^\./,"")].join(""):null,m=$APP.r(m)?m:".mjs"),h=$APP.Zj(h,/.clj(s|c)$/,m));p=q.call(p,f,h);q=esm_import$path.dirname(p);$APP.r(esm_import$fs.existsSync(q))||esm_import$fs.mkdirSync(q,{recursive:!0});if(!$APP.r(esm_import$fs.existsSync(q)))throw Error("File not found, make sure output-dir is a valid path: ",new $APP.n(null,2,[$APP.nH,f,$APP.lH,p],null));esm_import$fs.writeFileSync(p,l,"utf-8");return $APP.Rh.j(k,$APP.lH,p)})}; | ||
pH=function(a){return $APP.hu.l(a,$APP.F([$APP.iu,!0]))};qH=function(a){return function(){function b(d){var e=null;if(0<arguments.length){e=0;for(var f=Array(arguments.length-0);e<f.length;)f[e]=arguments[e+0],++e;e=new $APP.Xc(f,0,null)}return c.call(this,e)}function c(d){d=$APP.Iu.g(pH,d);d=$APP.Gf.g(a,d);return d instanceof Promise?d.then($APP.cv):$APP.cv(d)}b.m=0;b.o=function(d){d=$APP.x(d);return c(d)};b.l=c;return b}()};$APP.MG.prototype.add=function(a){return this.C.push(a)}; | ||
$APP.MG.prototype.size=function(){return this.C.length};$APP.MG.prototype.clear=function(){return this.C=[]};$APP.MG.prototype.fd=function(){return 0===this.C.length};$APP.rH=function rH(a){switch(arguments.length){case 1:return rH.h(arguments[0]);case 2:return rH.g(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",$APP.t.h(arguments.length)].join(""));}};$APP.rH.h=function(a){return $APP.rH.g($APP.ie,a)}; | ||
$APP.rH.g=function(a,b){if($APP.x(b)){var c=$APP.Ze.h?$APP.Ze.h(b):$APP.Ze.call(null,b);HG(c,$APP.NG(a));return $APP.Md($APP.x(c),$APP.Nd(b))}return $APP.bd};$APP.rH.m=2;$APP.sH=function sH(a){switch(arguments.length){case 2:return sH.g(arguments[0],arguments[1]);case 3:return sH.j(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",$APP.t.h(arguments.length)].join(""));}};$APP.sH.g=function(a,b){return $APP.sH.j(a,$APP.ie,b)}; | ||
$APP.sH.j=function(a,b,c){return $APP.rH.g(function(d,e){d=a.h?a.h(d):a.call(null,d);e=a.h?a.h(e):a.call(null,e);var f=$APP.NG(b);return f.g?f.g(d,e):f.call(null,d,e)},c)};$APP.sH.m=3;$APP.tH=function tH(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return tH.l(0<c.length?new $APP.Xc(c.slice(0),0,null):null)};$APP.tH.l=function(a){$APP.Gi(a,$APP.Ra());return $APP.r($APP.Ta)?$APP.OG($APP.Ra()):null};$APP.tH.m=0;$APP.tH.o=function(a){return this.l($APP.x(a))}; | ||
$APP.uH=function uH(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return uH.l(0<c.length?new $APP.Xc(c.slice(0),0,null):null)};$APP.uH.l=function(a){$APP.Gi(a,$APP.Rh.j($APP.Ra(),$APP.Ia,!1));return $APP.r($APP.Ta)?$APP.OG($APP.Ra()):null};$APP.uH.m=0;$APP.uH.o=function(a){return this.l($APP.x(a))}; | ||
$APP.bH=function bH(a){switch(arguments.length){case 1:return bH.h(arguments[0]);case 2:return bH.g(arguments[0],arguments[1]);case 3:return bH.j(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",$APP.t.h(arguments.length)].join(""));}}; | ||
$APP.bH.h=function(a){return function(b){var c=new $APP.MG;return function(){function d(l,m){c.add(m);return a===c.size()?(m=$APP.mg(c.C),c.clear(),b.g?b.g(l,m):b.call(null,l,m)):l}function e(l){if(!$APP.r(c.fd())){var m=$APP.mg(c.C);c.clear();l=$APP.pd(b.g?b.g(l,m):b.call(null,l,m))}return b.h?b.h(l):b.call(null,l)}function f(){return b.v?b.v():b.call(null)}var k=null;k=function(l,m){switch(arguments.length){case 0:return f.call(this);case 1:return e.call(this,l);case 2:return d.call(this,l,m)}throw Error("Invalid arity: "+ | ||
arguments.length);};k.v=f;k.h=e;k.g=d;return k}()}};$APP.bH.g=function(a,b){return $APP.bH.j(a,a,b)};$APP.bH.j=function(a,b,c){return new $APP.Qe(null,function(){var d=$APP.x(c);return d?$APP.He($APP.Mf.g(a,d),$APP.bH.j(a,b,$APP.Nf.g(b,d))):null},null,null)};$APP.bH.m=3;$APP.RG.prototype.nb=function(){$APP.r(this.f)&&(this.value=this.f.v?this.f.v():this.f.call(null),this.f=null);return this.value};$APP.RG.prototype.$c=function(){return $APP.Za(this.f)}; | ||
$APP.RG.prototype.R=function(a,b,c){$APP.ic(b,"#object[cljs.core.Delay ");$APP.ti(new $APP.n(null,2,[$APP.oD,null==this.f?$APP.rw:$APP.VA,$APP.av,this.value],null),b,c);return $APP.ic(b,"]")};$APP.vH=function vH(a){switch(arguments.length){case 1:return vH.h(arguments[0]);case 2:return vH.g(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",$APP.t.h(arguments.length)].join(""));}}; | ||
$APP.vH.h=function(a){return WG(new $APP.n(null,3,[$APP.Cm,$APP.u($APP.GF),$APP.Dm,$APP.u($APP.FF),$APP.il,null],null),a)};$APP.vH.g=function(a,b){return WG($APP.Tm.j($APP.Qk.l($APP.F([new $APP.n(null,1,[$APP.Dm,$APP.u($APP.FF)],null),a])),$APP.Cm,function(c){return $APP.Qk.l($APP.F([$APP.u($APP.GF),c]))}),b)};$APP.vH.m=2;$APP.wH=new $APP.H(null,"port","port",1534937262);$APP.eH=new $APP.H(null,"reload","reload",863702807);$APP.xH=new $APP.H(null,"opts","opts",155075701); | ||
$APP.nH=new $APP.H(null,"output-dir","output-dir",-290956991);aH=new $APP.H(null,"require-macros","require-macros",707947416);$APP.yH=new $APP.H(null,"message","message",-406056002);$APP.jH=new $APP.H(null,"in-file","in-file",-1682176692);$APP.zH=new $APP.H(null,"id","id",-1388402092);fH=new $APP.w("cljs.core","ns-publics","cljs.core/ns-publics",488240955,null);$APP.YG=new $APP.H(null,"paths","paths",-1807389588);$APP.AH=new $APP.H(null,"eval","eval",-1103567905); | ||
$APP.cH=new $APP.H(null,"eval-form","eval-form",-1934118476);$APP.lH=new $APP.H(null,"out-file","out-file",-1187066405);kH=new $APP.H(null,"in-str","in-str",-1014658121);$APP.mH=new $APP.H(null,"extension","extension",1453374065);$APP.ZG=new $APP.RG(function(){if($APP.r(esm_import$fs.existsSync("squint.edn"))){var a=esm_import$fs.readFileSync("squint.edn","utf-8");a=$APP.vH.h(a)}else a=null;return a},null);var BH;$APP.dH=$APP.Vi.h(null);BH=qH(hH);export const compileFile=qH($APP.oH);export const compileString=BH; | ||
import*as esm_import$fs from"fs";import*as esm_import$path from"path";var NG,OG,PG,cH,dH,nH,oH,wH,xH,hH,mH,rH;$APP.MG=function(a,b){return $APP.qa(a,b)};NG=function(a,b){a.sort(b||$APP.Ba)};OG=function(a,b){const c=Array(a.length);for(let e=0;e<a.length;e++)c[e]={index:e,value:a[e]};const d=b||$APP.Ba;NG(c,function(e,f){return d(e.value,f.value)||e.index-f.index});for(b=0;b<a.length;b++)a[b]=c[b].value};PG=function(){}; | ||
$APP.QG=function(a){return null!=a?a.D&512||$APP.Oc===a.Ce?!0:a.D?!1:$APP.cb($APP.yb,a):$APP.cb($APP.yb,a)};$APP.RG=function(a){return $APP.ee(a)||!1};$APP.SG=function(a){return"number"===typeof a};$APP.TG=function(){this.C=[]};$APP.UG=function(a){return $APP.A.g(a,$APP.ie)?$APP.ie:function(b,c){var d=a.g?a.g(b,c):a.call(null,b,c);return"number"===typeof d?d:$APP.r(d)?-1:$APP.r(a.g?a.g(c,b):a.call(null,c,b))?1:0}};$APP.VG=function(a){$APP.pi("\n");return $APP.fe.g(a,$APP.Ga),null}; | ||
$APP.WG=function(a,b){return(null!=a?$APP.Oc===a.Hc||(a.wd?0:$APP.cb(PG,a)):$APP.cb(PG,a))?$APP.Db(a,b):null!=a&&$APP.QG(a)&&$APP.he(a,b)?new $APP.Ig(b,$APP.fe.g(a,b),null):null};$APP.XG=function(a,b){return new $APP.J(null,2,5,$APP.N,[$APP.Xr.g(a,b),$APP.Yr.g(a,b)],null)};$APP.YG=function(a,b){this.f=a;this.value=b;this.D=2147516416;this.M=1};$APP.ZG=function(a){return Math.floor(Math.random()*a)}; | ||
$APP.$G=function(){function a(){return $APP.ZG(16).toString(16)}var b=(8|3&$APP.ZG(16)).toString(16);return new $APP.nj([$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),"-",$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),"-4",$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),"-",$APP.t.h(b),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),"-",$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()), | ||
$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a()),$APP.t.h(a())].join("").toLowerCase())};$APP.aH=function(a){return a instanceof Error?a.message:null};$APP.bH=function(a){return $APP.Dr.g(a,/\n|\r\n/)};cH=function(a,b){return $APP.r($APP.r(b)?$APP.Qh.g(b,""):b)?$APP.Em(a,$APP.Kk(b)):null};dH=function(a,b){return $APP.Ef(function(c){c=esm_import$path.resolve(a,[$APP.t.h(b),".",$APP.t.h(c)].join(""));return $APP.r(esm_import$fs.existsSync(c))?c:null},new $APP.J(null,2,5,$APP.N,["cljc","cljs"],null))}; | ||
$APP.gH=function(a){var b=$APP.Zj($APP.Zj($APP.t.h(a),"-","_"),".","/");return $APP.Ef(function(c){return dH(c,b)},$APP.eH.g($APP.u($APP.fH),new $APP.J(null,2,5,$APP.N,[".","src"],null)))}; | ||
nH=function(a,b){b=$APP.jf(b);var c=$APP.fe.g(b,$APP.Er);a=$APP.jp($APP.hp(a),$APP.Yt);if($APP.be(a)&&$APP.A.g($APP.Dj,$APP.y(a))){a=$APP.x(a);$APP.y(a);a=$APP.z(a);var d=$APP.y(a);a=$APP.z(a);a=$APP.Ef(function(k){var l=$APP.B.j(k,0,null);k=$APP.B.j(k,1,null);return $APP.be(l)&&$APP.A.g(hH,$APP.y(l))?new $APP.J(null,2,5,$APP.N,[$APP.cd(l),k],null):null},$APP.iH.j(2,1,a));var e=$APP.B.j(a,0,null),f=$APP.B.j(a,1,null);return $APP.r(e)?shadow_esm_import("./compiler.sci.js").then(function(){var k=$APP.jH.h($APP.u($APP.kH)); | ||
return $APP.oe.j(function(l,m){return l.then(function(){var h=$APP.x(m),q=$APP.y(h);h=$APP.z(h);h=$APP.jf(h);var p=$APP.fe.g(h,$APP.zr),v=$APP.fe.g(h,$APP.Ar);return Promise.resolve(function(){var D=function(){var O=new $APP.G(null,$APP.aF,new $APP.G(null,new $APP.G(null,$APP.Mj,new $APP.G(null,q,null,1,null),2,null),null,1,null),2,null);return $APP.r(f)?$APP.R.g(O,new $APP.J(null,1,5,$APP.N,[$APP.lH],null)):O}();k.h?k.h(D):k.call(null,D);var I=function(){var O=$APP.S.h($APP.x($APP.R.g(new $APP.G(null, | ||
mH,null,1,null),new $APP.G(null,$APP.S.h($APP.x($APP.R.g(new $APP.G(null,$APP.Mj,null,1,null),new $APP.G(null,q,null,1,null)))),null,1,null))));return k.h?k.h(O):k.call(null,O)}();D=$APP.Mh(I);I=$APP.Oh(I);I=$APP.ui.g($APP.od,I);return $APP.bi(D,I)}()).then(function(D){return $APP.Wi.g(c,function(I){I=$APP.Ou(I,new $APP.J(null,2,5,$APP.N,[$APP.ut,q],null),D);I=$APP.r(v)?$APP.Ou(I,new $APP.J(null,3,5,$APP.N,[d,$APP.Hr,v],null),q):I;return $APP.r(p)?$APP.Ou(I,new $APP.J(null,2,5,$APP.N,[d,$APP.Fr], | ||
null),$APP.bi(p,$APP.Gr.h(q))):I})})})},Promise.resolve(null),e)}):null}return null};oH=function(a,b){return Promise.resolve(nH(a,b)).then(function(){return $APP.lu(a,b,null)})}; | ||
$APP.pH=function(a,b){return $APP.oe.j(function(c,d){a:{var e=esm_import$path.resolve(d).split(esm_import$path.sep);for(var f=esm_import$path.resolve(a).split(esm_import$path.sep);;){var k=$APP.Qd(e);if(k){e=k;break a}if(k=$APP.x(f))if(k=$APP.A.g($APP.y(e),$APP.y(f)))e=$APP.cd(e),f=$APP.cd(f);else{e=k;break a}else{e=k;break a}}}return e?$APP.ld(esm_import$path.relative(d,a)):c},a,b)}; | ||
$APP.vH=function(a){a=$APP.jf(a);var b=$APP.fe.g(a,$APP.qH),c=$APP.fe.g(a,rH),d=$APP.fe.g(a,$APP.sH),e=$APP.fe.g(a,$APP.tH),f=$APP.fe.j(a,$APP.uH,"");c=$APP.r(c)?c:esm_import$fs.readFileSync(b,"utf-8");return oH(c,$APP.Rh.j(a,$APP.Er,$APP.Vi.h(new $APP.n(null,1,[$APP.to,$APP.iy],null)))).then(function(k){k=$APP.jf(k);var l=$APP.fe.g(k,$APP.ku),m=$APP.fe.g(k,$APP.wq),h=$APP.eH.g($APP.u($APP.fH),new $APP.J(null,2,5,$APP.N,[".","src"],null)),q=esm_import$path,p=q.resolve;$APP.r(d)?h=d:(h=$APP.pH(b,h), | ||
$APP.r(m)?m=".jsx":(m=$APP.r(e)?[".",$APP.Zj(e,/^\./,"")].join(""):null,m=$APP.r(m)?m:".mjs"),h=$APP.Zj(h,/.clj(s|c)$/,m));q=p.call(q,f,h);p=esm_import$path.dirname(q);$APP.r(esm_import$fs.existsSync(p))||esm_import$fs.mkdirSync(p,{recursive:!0});if(!$APP.r(esm_import$fs.existsSync(p)))throw Error("File not found, make sure output-dir is a valid path: ",new $APP.n(null,2,[$APP.uH,f,$APP.sH,q],null));esm_import$fs.writeFileSync(q,l,"utf-8");return $APP.Rh.j(k,$APP.sH,q)})}; | ||
wH=function(a){return $APP.mu.l(a,$APP.F([$APP.nu,!0]))};xH=function(a){return function(){function b(d){var e=null;if(0<arguments.length){e=0;for(var f=Array(arguments.length-0);e<f.length;)f[e]=arguments[e+0],++e;e=new $APP.Xc(f,0,null)}return c.call(this,e)}function c(d){d=$APP.Nu.g(wH,d);d=$APP.Gf.g(a,d);return d instanceof Promise?d.then($APP.hv):$APP.hv(d)}b.m=0;b.o=function(d){d=$APP.x(d);return c(d)};b.l=c;return b}()};$APP.TG.prototype.add=function(a){return this.C.push(a)}; | ||
$APP.TG.prototype.size=function(){return this.C.length};$APP.TG.prototype.clear=function(){return this.C=[]};$APP.TG.prototype.fd=function(){return 0===this.C.length};$APP.yH=function yH(a){switch(arguments.length){case 1:return yH.h(arguments[0]);case 2:return yH.g(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",$APP.t.h(arguments.length)].join(""));}};$APP.yH.h=function(a){return $APP.yH.g($APP.ie,a)}; | ||
$APP.yH.g=function(a,b){if($APP.x(b)){var c=$APP.Ze.h?$APP.Ze.h(b):$APP.Ze.call(null,b);OG(c,$APP.UG(a));return $APP.Md($APP.x(c),$APP.Nd(b))}return $APP.bd};$APP.yH.m=2;$APP.zH=function zH(a){switch(arguments.length){case 2:return zH.g(arguments[0],arguments[1]);case 3:return zH.j(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",$APP.t.h(arguments.length)].join(""));}};$APP.zH.g=function(a,b){return $APP.zH.j(a,$APP.ie,b)}; | ||
$APP.zH.j=function(a,b,c){return $APP.yH.g(function(d,e){d=a.h?a.h(d):a.call(null,d);e=a.h?a.h(e):a.call(null,e);var f=$APP.UG(b);return f.g?f.g(d,e):f.call(null,d,e)},c)};$APP.zH.m=3;$APP.AH=function AH(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return AH.l(0<c.length?new $APP.Xc(c.slice(0),0,null):null)};$APP.AH.l=function(a){$APP.Gi(a,$APP.Ra());return $APP.r($APP.Ta)?$APP.VG($APP.Ra()):null};$APP.AH.m=0;$APP.AH.o=function(a){return this.l($APP.x(a))}; | ||
$APP.BH=function BH(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return BH.l(0<c.length?new $APP.Xc(c.slice(0),0,null):null)};$APP.BH.l=function(a){$APP.Gi(a,$APP.Rh.j($APP.Ra(),$APP.Ia,!1));return $APP.r($APP.Ta)?$APP.VG($APP.Ra()):null};$APP.BH.m=0;$APP.BH.o=function(a){return this.l($APP.x(a))}; | ||
$APP.iH=function iH(a){switch(arguments.length){case 1:return iH.h(arguments[0]);case 2:return iH.g(arguments[0],arguments[1]);case 3:return iH.j(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",$APP.t.h(arguments.length)].join(""));}}; | ||
$APP.iH.h=function(a){return function(b){var c=new $APP.TG;return function(){function d(l,m){c.add(m);return a===c.size()?(m=$APP.mg(c.C),c.clear(),b.g?b.g(l,m):b.call(null,l,m)):l}function e(l){if(!$APP.r(c.fd())){var m=$APP.mg(c.C);c.clear();l=$APP.pd(b.g?b.g(l,m):b.call(null,l,m))}return b.h?b.h(l):b.call(null,l)}function f(){return b.v?b.v():b.call(null)}var k=null;k=function(l,m){switch(arguments.length){case 0:return f.call(this);case 1:return e.call(this,l);case 2:return d.call(this,l,m)}throw Error("Invalid arity: "+ | ||
arguments.length);};k.v=f;k.h=e;k.g=d;return k}()}};$APP.iH.g=function(a,b){return $APP.iH.j(a,a,b)};$APP.iH.j=function(a,b,c){return new $APP.Qe(null,function(){var d=$APP.x(c);return d?$APP.He($APP.Mf.g(a,d),$APP.iH.j(a,b,$APP.Nf.g(b,d))):null},null,null)};$APP.iH.m=3;$APP.YG.prototype.nb=function(){$APP.r(this.f)&&(this.value=this.f.v?this.f.v():this.f.call(null),this.f=null);return this.value};$APP.YG.prototype.$c=function(){return $APP.Za(this.f)}; | ||
$APP.YG.prototype.R=function(a,b,c){$APP.ic(b,"#object[cljs.core.Delay ");$APP.ti(new $APP.n(null,2,[$APP.sD,null==this.f?$APP.xw:$APP.fB,$APP.fv,this.value],null),b,c);return $APP.ic(b,"]")};$APP.CH=function CH(a){switch(arguments.length){case 1:return CH.h(arguments[0]);case 2:return CH.g(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",$APP.t.h(arguments.length)].join(""));}}; | ||
$APP.CH.h=function(a){return cH(new $APP.n(null,3,[$APP.Cm,$APP.u($APP.NF),$APP.Dm,$APP.u($APP.MF),$APP.il,null],null),a)};$APP.CH.g=function(a,b){return cH($APP.Tm.j($APP.Qk.l($APP.F([new $APP.n(null,1,[$APP.Dm,$APP.u($APP.MF)],null),a])),$APP.Cm,function(c){return $APP.Qk.l($APP.F([$APP.u($APP.NF),c]))}),b)};$APP.CH.m=2;$APP.DH=new $APP.H(null,"port","port",1534937262);$APP.lH=new $APP.H(null,"reload","reload",863702807);$APP.EH=new $APP.H(null,"opts","opts",155075701); | ||
$APP.uH=new $APP.H(null,"output-dir","output-dir",-290956991);hH=new $APP.H(null,"require-macros","require-macros",707947416);$APP.FH=new $APP.H(null,"message","message",-406056002);$APP.qH=new $APP.H(null,"in-file","in-file",-1682176692);$APP.GH=new $APP.H(null,"id","id",-1388402092);mH=new $APP.w("cljs.core","ns-publics","cljs.core/ns-publics",488240955,null);$APP.eH=new $APP.H(null,"paths","paths",-1807389588);$APP.HH=new $APP.H(null,"eval","eval",-1103567905); | ||
$APP.jH=new $APP.H(null,"eval-form","eval-form",-1934118476);$APP.sH=new $APP.H(null,"out-file","out-file",-1187066405);rH=new $APP.H(null,"in-str","in-str",-1014658121);$APP.tH=new $APP.H(null,"extension","extension",1453374065);$APP.fH=new $APP.YG(function(){if($APP.r(esm_import$fs.existsSync("squint.edn"))){var a=esm_import$fs.readFileSync("squint.edn","utf-8");a=$APP.CH.h(a)}else a=null;return a},null);var IH;$APP.kH=$APP.Vi.h(null);IH=xH(oH);export const compileFile=xH($APP.vH);export const compileString=IH; |
@@ -7,18 +7,18 @@ import { $APP, shadow$provide, $jscomp } from "./compiler.js"; | ||
import*as esm_import$fs from"fs";import*as esm_import$net from"net"; | ||
var J9=function(a,b){a=a.indexOf(b);if(0>a)throw Error("out of input");return a},K9=function(a,b){if(a.length<b)throw Error("out of input");return a.slice(b)},L9=function(a,b){if(b>a.length)throw Error("out of input");return a.slice(0,b)},M9=function(a){return console.debug($APP.Mp.g(" ",a))},Qga=function(a){return function(b,c){b=$APP.jf(b);var d=$APP.fe.g(b,$APP.zH),e=$APP.fe.g(b,Pga);c=$APP.Rh.j(c,"id",d);c=$APP.r(e)?$APP.Rh.j(c,"session",e):c;return a.g?a.g(b,c):a.call(null,b,c)}},Sga=function(){var a= | ||
Rga;return function(b,c){b=$APP.Tm.j(b,N9,$APP.zi);return a.g?a.g(b,c):a.call(null,b,c)}},Uga=function(){var a=Tga();return function(b,c){M9($APP.F(["request",b]));return a.g?a.g(b,c):a.call(null,b,c)}},Vga=function(a){return function(b,c){M9($APP.F(["response",c]));return a.g?a.g(b,c):a.call(null,b,c)}},Tga=function(){var a=Sga();return function(b,c){return a.g?a.g(b,c):a.call(null,b,c)}},O9=function(a){return $APP.Rh.j($APP.bi(new $APP.I(null,3,5,$APP.N,["major","minor","incremental"],null),$APP.hu.h(a.split("."))), | ||
"version-string",a)},Wga=function(a,b,c){if($APP.r(a))if(a=P9.h?P9.h(a):P9.call(null,a),$APP.r(a)){b=$APP.jf(b);var d=$APP.fe.g(b,$APP.r9),e=$APP.fe.g(b,$APP.k9),f=$APP.fe.g(b,$APP.t9);b=$APP.Qa;var k=$APP.li,l=$APP.S6;$APP.Qa=e;$APP.li=f;$APP.S6=d;try{var m=new $APP.Fa;d=$APP.Ta;e=$APP.Ua;$APP.Ta=!0;$APP.Ua=function(h){return m.append(h)};try{a.h?a.h(c):a.call(null,c)}finally{$APP.Ua=e,$APP.Ta=d}return $APP.t.h(m)}finally{$APP.S6=l,$APP.li=k,$APP.Qa=b}}else return M9($APP.F(["Pretty-Printing is only supported for cider.nrepl.pprint/pprint"])), | ||
$APP.Ri.l($APP.F([c]));else return $APP.Ri.l($APP.F([c]))},Yga=function(a){a:{var b=$APP.ir;$APP.ir=$APP.u(Q9);try{var c=$APP.gu(a,new $APP.n(null,5,[$APP.Op,$APP.Rp,$APP.Br,Xga,$APP.Wt,!0,$APP.st,!0,$APP.Up,!0],null),null);break a}finally{$APP.ir=b}c=void 0}c=$APP.jf(c);a=$APP.fe.g(c,$APP.fu);c=$APP.fe.g(c,$APP.T);a=$APP.Zj("(async function () {\n%s\n}) ()","%s",a);$APP.Jf(Q9,c);return a},dha=function(a,b){var c=$APP.jf(a);$APP.fe.g(c,$APP.T);a=$APP.fe.g(c,Zga);$APP.fe.g(c,$APP.$k);$APP.fe.g(c,$ga); | ||
$APP.fe.g(c,aha);return Promise.resolve(a).then(Yga).then(function(d){$APP.uH.l($APP.F(["About to eval:"]));$APP.uH.l($APP.F([d]));return eval(d)}).then(function(d){d=new $APP.n(null,2,["ns",$APP.t.h($APP.u(Q9)),"value",Wga(bha.h(c),cha.h(c),d)],null);return b.g?b.g(c,d):b.call(null,c,d)}).catch(function(d){console.error(d);var e=$APP.yH.h($APP.pj(d));e=$APP.r(e)?e:d.message;$APP.r(e)&&(e=new $APP.n(null,1,["err",[$APP.t.h(e),"\n"].join("")],null),b.g?b.g(c,e):b.call(null,c,e));d=new $APP.n(null, | ||
2,["ex",$APP.t.h(d),"ns",$APP.t.h($APP.ir)],null);return b.g?b.g(c,d):b.call(null,c,d)}).finally(function(){var d=new $APP.n(null,2,["ns",$APP.t.h($APP.u(Q9)),"status",new $APP.I(null,1,5,$APP.N,["done"],null)],null);return b.g?b.g(c,d):b.call(null,c,d)})},R9=function(a){a=$APP.jf(a);$APP.fe.g(a,$APP.T);return null},Rga=function(a,b){a=$APP.jf(a);var c=$APP.fe.g(a,N9),d=$APP.fe.g(S9,c);if($APP.r(d))return d.g?d.g(a,b):d.call(null,a,b);console.warn($APP.Mp.g(" ",$APP.F(["Unhandled operation",c]))); | ||
c=new $APP.n(null,1,["status",new $APP.I(null,3,5,$APP.N,["error","unknown-op","done"],null)],null);return b.g?b.g(a,c):b.call(null,a,c)},eha=function(a){return function(b,c){return a.write(T9(c))}},fha=function(a,b){M9($APP.F(["Connection accepted"]));b.setNoDelay(!0);var c=Uga(),d=Qga(Vga(eha(b))),e=$APP.Vi.h(null);b.on("data",function(f){var k=$APP.u(e);if($APP.r(k)){f=[$APP.t.h(k),$APP.t.h(f)].join("");$APP.Jf(e,null);var l=f}else l=f;a:for(f=$APP.F([$APP.iu,!0]),k=$APP.lg;;){var m=$APP.Gf.j(U9, | ||
l,f);l=$APP.B.j(m,0,null);m=$APP.B.j(m,1,null);if(null==l){k=new $APP.I(null,2,5,$APP.N,[k,m],null);break a}k=$APP.Ee.g(k,l);l=m}f=$APP.B.j(k,0,null);k=$APP.B.j(k,1,null);$APP.gk(k)||$APP.Jf(e,k);f=$APP.x(f);k=null;for(var h=m=0;;)if(h<m)l=k.ba(null,h),c(l,d),h+=1;else if(f=$APP.x(f))k=f,$APP.Yd(k)?(f=$APP.uc(k),m=$APP.vc(k),k=f,l=$APP.xd(f),f=m,m=l):(l=$APP.y(k),c(l,d),f=$APP.z(k),k=null,m=0),h=0;else return null});return b.on("close",function(f){return $APP.r(f)?M9($APP.F(["Connection lost"])): | ||
M9($APP.F(["Connection closed"]))})},aha=new $APP.H(null,"_line","_line",232847719),cha=new $APP.H("nrepl.middleware.print","options","nrepl.middleware.print/options",868480159),Pga=new $APP.H(null,"session","session",1008279103),gha=new $APP.H(null,"lookup","lookup",1225356838),hha=new $APP.H(null,"load-file","load-file",-424586670),$ga=new $APP.H(null,"_load-file?","_load-file?",-1198848711),N9=new $APP.H(null,"op","op",-1882987955),iha=new $APP.H(null,"describe","describe",1369790582),Zga=new $APP.H(null, | ||
"code","code",1586293142),jha=new $APP.H(null,"eldoc","eldoc",-1321421900),kha=new $APP.H(null,"log_level","log_level",-1756736313),bha=new $APP.H("nrepl.middleware.print","print","nrepl.middleware.print/print",-1616742548),lha=new $APP.H(null,"clone","clone",711747572),mha=new $APP.H(null,"close","close",1835149582),nha=new $APP.H(null,"info","info",-317069002),oha=new $APP.H(null,"host","host",-1558485167),pha=new $APP.H(null,"complete","complete",-500388775);var V9=function V9(a,b){switch($APP.t.h(L9(a,1))){case "i":return a=K9(a,1),b=J9(a,"e"),new $APP.I(null,2,5,$APP.N,[parseInt(L9(a,b)),K9(a,b+1)],null);case "l":var d=a=K9(a,1);for(a=$APP.mc($APP.lg);;){if($APP.A.g($APP.t.h(L9(d,1)),"e"))return new $APP.I(null,2,5,$APP.N,[$APP.oc(a),K9(d,1)],null);var e=V9.g?V9.g(d,b):V9.call(null,d,b),f=$APP.B.j(e,0,null),k=$APP.B.j(e,1,null);e=k;a=$APP.fg.g(a,f);d=e}case "d":for(a=K9(a,1),f=$APP.jf(b),f=$APP.fe.g(f,$APP.iu),d=a,e=$APP.mc($APP.hf);;){if($APP.A.g($APP.t.h(L9(d, | ||
1)),"e"))return new $APP.I(null,2,5,$APP.N,[$APP.oc(e),K9(d,1)],null);a=V9.g?V9.g(d,b):V9.call(null,d,b);d=$APP.B.j(a,0,null);k=$APP.B.j(a,1,null);k=V9.g?V9.g(k,b):V9.call(null,k,b);a=$APP.B.j(k,0,null);k=$APP.B.j(k,1,null);d=$APP.r(f)?$APP.zi.h(d):d;a=$APP.Ug.j(e,d,a);d=k;e=a}default:return b=J9(a,":"),f=parseInt(L9(a,b)),a=K9(a,b+1),new $APP.I(null,2,5,$APP.N,[$APP.t.h(L9(a,f)),K9(a,f)],null)}},U9=function U9(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return U9.l(arguments[0], | ||
1<c.length?new $APP.Xc(c.slice(1),0,null):null)};U9.l=function(a,b){try{return V9(a,b)}catch(c){if(c instanceof Error)return new $APP.I(null,2,5,$APP.N,[null,a],null);throw c;}};U9.m=1;U9.o=function(a){var b=$APP.y(a);a=$APP.z(a);return this.l(b,a)}; | ||
var T9=function T9(a){for(;;){if("string"===typeof a)return[$APP.t.h(Buffer.from(a).length),":",a].join("");if(a instanceof $APP.H||a instanceof $APP.w)a=[function(){var c=$APP.Oe(a);return $APP.r(c)?[c,"/"].join(""):null}(),$APP.ai(a)].join("");else return"number"===typeof a?["i",$APP.t.h(a),"e"].join(""):$APP.Td(a)||$APP.Xd(a)||null==a?["l",$APP.t.h($APP.Gf.g($APP.t,$APP.ui.g(T9,a))),"e"].join(""):$APP.Vd(a)?["d",$APP.t.h($APP.Gf.g($APP.t,$APP.ui.g(function(){return function(c){var d=$APP.B.j(c, | ||
0,null);c=$APP.B.j(c,1,null);return[$APP.t.h(T9.h?T9.h(d):T9.call(null,d)),$APP.t.h(T9.h?T9.h(c):T9.call(null,c))].join("")}}(a),$APP.sH.g($APP.y,a)))),"e"].join(""):null}};var Q9=$APP.Vi.h($APP.ir),P9=new $APP.n(null,1,["cider.nrepl.pprint/pprint",$APP.A9],null);$APP.Vi.h(!1); | ||
var Xga=$APP.Vi.h($APP.hf),S9=$APP.vh([gha,mha,hha,jha,lha,iha,nha,pha,$APP.AH],[R9,function(a,b){var c=new $APP.n(null,1,["status",new $APP.I(null,1,5,$APP.N,["done"],null)],null);return b.g?b.g(a,c):b.call(null,a,c)},function(a){a=$APP.jf(a);$APP.fe.g(a,$APP.$k);return null},R9,function(a,b){var c=new $APP.n(null,2,["new-session",$APP.t.h($APP.TG()),"status",new $APP.I(null,1,5,$APP.N,["done"],null)],null);return b.g?b.g(a,c):b.call(null,a,c)},function(a,b){var c=new $APP.n(null,4,["versions",new $APP.n(null, | ||
2,["nbb-nrepl",O9("TODO"),"node",O9(process.version)],null),"aux",$APP.hf,"ops",$APP.bi($APP.ui.g($APP.ai,$APP.Mh(S9)),$APP.Dr.h($APP.hf)),"status",new $APP.I(null,1,5,$APP.N,["done"],null)],null);return b.g?b.g(a,c):b.call(null,a,c)},R9,function(){return null},function(a,b){a=$APP.jf(a);var c=$APP.fe.g(a,$APP.T);$APP.tH.l($APP.F([$APP.T,c]));return dha($APP.Rh.j(a,$APP.T,$APP.u(Q9)),b)}]),qha=$APP.Vi.h(null);export const startServer=function(a){return Promise.resolve(null).then(function(){var b=function(){var e=$APP.wH.h(a);return $APP.r(e)?e:0}(),c=function(){var e=oha.h(a);return $APP.r(e)?e:"127.0.0.1"}();(function(){var e=$APP.$a(a)?a.bg:kha.h(a);return $APP.r(e)?e:"info"})();var d=esm_import$net.createServer($APP.Tk.g(fha,$APP.hf));d.listen(b,c,function(){var e=d.address(),f=e.port;e=e.address;$APP.uH.l($APP.F([["nREPL server started on port ",$APP.t.h(f)," on host ",$APP.t.h(e)," - nrepl://",$APP.t.h(e), | ||
":",$APP.t.h(f)].join("")]));try{return esm_import$fs.writeFileSync(".nrepl-port",$APP.t.h(f))}catch(k){return console.warn($APP.Mp.g(" ",$APP.F(["Could not write .nrepl-port",k])))}});return $APP.Jf(qha,d)})}; | ||
var J9=function(a,b){a=a.indexOf(b);if(0>a)throw Error("out of input");return a},K9=function(a,b){if(a.length<b)throw Error("out of input");return a.slice(b)},L9=function(a,b){if(b>a.length)throw Error("out of input");return a.slice(0,b)},M9=function(a){return console.debug($APP.Mp.g(" ",a))},Xga=function(a){return function(b,c){b=$APP.jf(b);var d=$APP.fe.g(b,$APP.GH),e=$APP.fe.g(b,Wga);c=$APP.Rh.j(c,"id",d);c=$APP.r(e)?$APP.Rh.j(c,"session",e):c;return a.g?a.g(b,c):a.call(null,b,c)}},Zga=function(){var a= | ||
Yga;return function(b,c){b=$APP.Tm.j(b,N9,$APP.zi);return a.g?a.g(b,c):a.call(null,b,c)}},aha=function(){var a=$ga();return function(b,c){M9($APP.F(["request",b]));return a.g?a.g(b,c):a.call(null,b,c)}},bha=function(a){return function(b,c){M9($APP.F(["response",c]));return a.g?a.g(b,c):a.call(null,b,c)}},$ga=function(){var a=Zga();return function(b,c){return a.g?a.g(b,c):a.call(null,b,c)}},O9=function(a){return $APP.Rh.j($APP.bi(new $APP.J(null,3,5,$APP.N,["major","minor","incremental"],null),$APP.mu.h(a.split("."))), | ||
"version-string",a)},cha=function(a,b,c){if($APP.r(a))if(a=P9.h?P9.h(a):P9.call(null,a),$APP.r(a)){b=$APP.jf(b);var d=$APP.fe.g(b,$APP.r9),e=$APP.fe.g(b,$APP.j9),f=$APP.fe.g(b,$APP.t9);b=$APP.Qa;var k=$APP.li,l=$APP.S6;$APP.Qa=e;$APP.li=f;$APP.S6=d;try{var m=new $APP.Fa;d=$APP.Ta;e=$APP.Ua;$APP.Ta=!0;$APP.Ua=function(h){return m.append(h)};try{a.h?a.h(c):a.call(null,c)}finally{$APP.Ua=e,$APP.Ta=d}return $APP.t.h(m)}finally{$APP.S6=l,$APP.li=k,$APP.Qa=b}}else return M9($APP.F(["Pretty-Printing is only supported for cider.nrepl.pprint/pprint"])), | ||
$APP.Ri.l($APP.F([c]));else return $APP.Ri.l($APP.F([c]))},eha=function(a){a:{var b=$APP.lr;$APP.lr=$APP.u(Q9);try{var c=$APP.lu(a,new $APP.n(null,5,[$APP.Op,$APP.Rp,$APP.Er,dha,$APP.au,!0,$APP.vt,!0,$APP.Up,!0],null),null);break a}finally{$APP.lr=b}c=void 0}c=$APP.jf(c);a=$APP.fe.g(c,$APP.ku);c=$APP.fe.g(c,$APP.T);a=$APP.Zj("(async function () {\n%s\n}) ()","%s",a);$APP.Jf(Q9,c);return a},kha=function(a,b){var c=$APP.jf(a);$APP.fe.g(c,$APP.T);a=$APP.fe.g(c,fha);$APP.fe.g(c,$APP.$k);$APP.fe.g(c,gha); | ||
$APP.fe.g(c,hha);return Promise.resolve(a).then(eha).then(function(d){$APP.BH.l($APP.F(["About to eval:"]));$APP.BH.l($APP.F([d]));return eval(d)}).then(function(d){d=new $APP.n(null,2,["ns",$APP.t.h($APP.u(Q9)),"value",cha(iha.h(c),jha.h(c),d)],null);return b.g?b.g(c,d):b.call(null,c,d)}).catch(function(d){console.error(d);var e=$APP.FH.h($APP.pj(d));e=$APP.r(e)?e:d.message;$APP.r(e)&&(e=new $APP.n(null,1,["err",[$APP.t.h(e),"\n"].join("")],null),b.g?b.g(c,e):b.call(null,c,e));d=new $APP.n(null, | ||
2,["ex",$APP.t.h(d),"ns",$APP.t.h($APP.lr)],null);return b.g?b.g(c,d):b.call(null,c,d)}).finally(function(){var d=new $APP.n(null,2,["ns",$APP.t.h($APP.u(Q9)),"status",new $APP.J(null,1,5,$APP.N,["done"],null)],null);return b.g?b.g(c,d):b.call(null,c,d)})},R9=function(a){a=$APP.jf(a);$APP.fe.g(a,$APP.T);return null},Yga=function(a,b){a=$APP.jf(a);var c=$APP.fe.g(a,N9),d=$APP.fe.g(S9,c);if($APP.r(d))return d.g?d.g(a,b):d.call(null,a,b);console.warn($APP.Mp.g(" ",$APP.F(["Unhandled operation",c]))); | ||
c=new $APP.n(null,1,["status",new $APP.J(null,3,5,$APP.N,["error","unknown-op","done"],null)],null);return b.g?b.g(a,c):b.call(null,a,c)},lha=function(a){return function(b,c){return a.write(T9(c))}},mha=function(a,b){M9($APP.F(["Connection accepted"]));b.setNoDelay(!0);var c=aha(),d=Xga(bha(lha(b))),e=$APP.Vi.h(null);b.on("data",function(f){var k=$APP.u(e);if($APP.r(k)){f=[$APP.t.h(k),$APP.t.h(f)].join("");$APP.Jf(e,null);var l=f}else l=f;a:for(f=$APP.F([$APP.nu,!0]),k=$APP.kg;;){var m=$APP.Gf.j(U9, | ||
l,f);l=$APP.B.j(m,0,null);m=$APP.B.j(m,1,null);if(null==l){k=new $APP.J(null,2,5,$APP.N,[k,m],null);break a}k=$APP.Ee.g(k,l);l=m}f=$APP.B.j(k,0,null);k=$APP.B.j(k,1,null);$APP.gk(k)||$APP.Jf(e,k);f=$APP.x(f);k=null;for(var h=m=0;;)if(h<m)l=k.ba(null,h),c(l,d),h+=1;else if(f=$APP.x(f))k=f,$APP.Yd(k)?(f=$APP.uc(k),m=$APP.vc(k),k=f,l=$APP.xd(f),f=m,m=l):(l=$APP.y(k),c(l,d),f=$APP.z(k),k=null,m=0),h=0;else return null});return b.on("close",function(f){return $APP.r(f)?M9($APP.F(["Connection lost"])): | ||
M9($APP.F(["Connection closed"]))})},hha=new $APP.H(null,"_line","_line",232847719),jha=new $APP.H("nrepl.middleware.print","options","nrepl.middleware.print/options",868480159),Wga=new $APP.H(null,"session","session",1008279103),nha=new $APP.H(null,"lookup","lookup",1225356838),oha=new $APP.H(null,"load-file","load-file",-424586670),gha=new $APP.H(null,"_load-file?","_load-file?",-1198848711),N9=new $APP.H(null,"op","op",-1882987955),pha=new $APP.H(null,"describe","describe",1369790582),fha=new $APP.H(null, | ||
"code","code",1586293142),qha=new $APP.H(null,"eldoc","eldoc",-1321421900),rha=new $APP.H(null,"log_level","log_level",-1756736313),iha=new $APP.H("nrepl.middleware.print","print","nrepl.middleware.print/print",-1616742548),sha=new $APP.H(null,"clone","clone",711747572),tha=new $APP.H(null,"close","close",1835149582),uha=new $APP.H(null,"info","info",-317069002),vha=new $APP.H(null,"host","host",-1558485167),wha=new $APP.H(null,"complete","complete",-500388775);var V9=function V9(a,b){switch($APP.t.h(L9(a,1))){case "i":return a=K9(a,1),b=J9(a,"e"),new $APP.J(null,2,5,$APP.N,[parseInt(L9(a,b)),K9(a,b+1)],null);case "l":var d=a=K9(a,1);for(a=$APP.mc($APP.kg);;){if($APP.A.g($APP.t.h(L9(d,1)),"e"))return new $APP.J(null,2,5,$APP.N,[$APP.oc(a),K9(d,1)],null);var e=V9.g?V9.g(d,b):V9.call(null,d,b),f=$APP.B.j(e,0,null),k=$APP.B.j(e,1,null);e=k;a=$APP.fg.g(a,f);d=e}case "d":for(a=K9(a,1),f=$APP.jf(b),f=$APP.fe.g(f,$APP.nu),d=a,e=$APP.mc($APP.hf);;){if($APP.A.g($APP.t.h(L9(d, | ||
1)),"e"))return new $APP.J(null,2,5,$APP.N,[$APP.oc(e),K9(d,1)],null);a=V9.g?V9.g(d,b):V9.call(null,d,b);d=$APP.B.j(a,0,null);k=$APP.B.j(a,1,null);k=V9.g?V9.g(k,b):V9.call(null,k,b);a=$APP.B.j(k,0,null);k=$APP.B.j(k,1,null);d=$APP.r(f)?$APP.zi.h(d):d;a=$APP.Ug.j(e,d,a);d=k;e=a}default:return b=J9(a,":"),f=parseInt(L9(a,b)),a=K9(a,b+1),new $APP.J(null,2,5,$APP.N,[$APP.t.h(L9(a,f)),K9(a,f)],null)}},U9=function U9(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return U9.l(arguments[0], | ||
1<c.length?new $APP.Xc(c.slice(1),0,null):null)};U9.l=function(a,b){try{return V9(a,b)}catch(c){if(c instanceof Error)return new $APP.J(null,2,5,$APP.N,[null,a],null);throw c;}};U9.m=1;U9.o=function(a){var b=$APP.y(a);a=$APP.z(a);return this.l(b,a)}; | ||
var T9=function T9(a){for(;;){if("string"===typeof a)return[$APP.t.h(Buffer.from(a).length),":",a].join("");if(a instanceof $APP.H||a instanceof $APP.w)a=[function(){var c=$APP.Le(a);return $APP.r(c)?[c,"/"].join(""):null}(),$APP.ai(a)].join("");else return"number"===typeof a?["i",$APP.t.h(a),"e"].join(""):$APP.Td(a)||$APP.Xd(a)||null==a?["l",$APP.t.h($APP.Gf.g($APP.t,$APP.ui.g(T9,a))),"e"].join(""):$APP.Vd(a)?["d",$APP.t.h($APP.Gf.g($APP.t,$APP.ui.g(function(){return function(c){var d=$APP.B.j(c, | ||
0,null);c=$APP.B.j(c,1,null);return[$APP.t.h(T9.h?T9.h(d):T9.call(null,d)),$APP.t.h(T9.h?T9.h(c):T9.call(null,c))].join("")}}(a),$APP.zH.g($APP.y,a)))),"e"].join(""):null}};var Q9=$APP.Vi.h($APP.lr),P9=new $APP.n(null,1,["cider.nrepl.pprint/pprint",$APP.A9],null);$APP.Vi.h(!1); | ||
var dha=$APP.Vi.h($APP.hf),S9=$APP.vh([nha,tha,oha,qha,sha,pha,uha,wha,$APP.HH],[R9,function(a,b){var c=new $APP.n(null,1,["status",new $APP.J(null,1,5,$APP.N,["done"],null)],null);return b.g?b.g(a,c):b.call(null,a,c)},function(a){a=$APP.jf(a);$APP.fe.g(a,$APP.$k);return null},R9,function(a,b){var c=new $APP.n(null,2,["new-session",$APP.t.h($APP.$G()),"status",new $APP.J(null,1,5,$APP.N,["done"],null)],null);return b.g?b.g(a,c):b.call(null,a,c)},function(a,b){var c=new $APP.n(null,4,["versions",new $APP.n(null, | ||
2,["nbb-nrepl",O9("TODO"),"node",O9(process.version)],null),"aux",$APP.hf,"ops",$APP.bi($APP.ui.g($APP.ai,$APP.Mh(S9)),$APP.Gr.h($APP.hf)),"status",new $APP.J(null,1,5,$APP.N,["done"],null)],null);return b.g?b.g(a,c):b.call(null,a,c)},R9,function(){return null},function(a,b){a=$APP.jf(a);var c=$APP.fe.g(a,$APP.T);$APP.AH.l($APP.F([$APP.T,c]));return kha($APP.Rh.j(a,$APP.T,$APP.u(Q9)),b)}]),xha=$APP.Vi.h(null);export const startServer=function(a){return Promise.resolve(null).then(function(){var b=function(){var e=$APP.DH.h(a);return $APP.r(e)?e:0}(),c=function(){var e=vha.h(a);return $APP.r(e)?e:"127.0.0.1"}();(function(){var e=$APP.$a(a)?a.bg:rha.h(a);return $APP.r(e)?e:"info"})();var d=esm_import$net.createServer($APP.Tk.g(mha,$APP.hf));d.listen(b,c,function(){var e=d.address(),f=e.port;e=e.address;$APP.BH.l($APP.F([["nREPL server started on port ",$APP.t.h(f)," on host ",$APP.t.h(e)," - nrepl://",$APP.t.h(e), | ||
":",$APP.t.h(f)].join("")]));try{return esm_import$fs.writeFileSync(".nrepl-port",$APP.t.h(f))}catch(k){return console.warn($APP.Mp.g(" ",$APP.F(["Could not write .nrepl-port",k])))}});return $APP.Jf(xha,d)})}; |
@@ -5,3 +5,3 @@ { | ||
"sideEffects": false, | ||
"version": "0.6.95", | ||
"version": "0.7.96", | ||
"files": [ | ||
@@ -13,2 +13,3 @@ "core.js", | ||
"src/squint/set.js", | ||
"src/squint/html.js", | ||
"lib", | ||
@@ -55,4 +56,5 @@ "node_cli.js", | ||
"./src/squint/set.js": "./src/squint/set.js", | ||
"./src/squint/string.js": "./src/squint/string.js" | ||
"./src/squint/string.js": "./src/squint/string.js", | ||
"./src/squint/html.js": "./src/squint/html.js" | ||
} | ||
} |
@@ -197,2 +197,29 @@ ## Squint | ||
## HTML | ||
Similar to JSX, squint allows you to produce HTML as strings using hiccup notation: | ||
``` clojure | ||
(def my-html #html [:div "Hello"]) | ||
``` | ||
will set the `my-html` variable to a string equal to `<div>Hello</div>`. | ||
Using metadata you can modify the tag function, e.g. to use this together with lit-html: | ||
``` clojure | ||
(ns my-app | ||
(:require ["lit" :as lit])) | ||
#html ^lit/html [:div "Hello"] | ||
``` | ||
This will produce: | ||
``` clojure | ||
lit/html`<div>Hello</div>` | ||
``` | ||
See [this](https://squint-cljs.github.io/squint/?src=KG5zIG15ZWxlbWVudAogICg6cmVxdWlyZSBbc3F1aW50LmNvcmUgOnJlZmVyIFtkZWZjbGFzcyBqcy10ZW1wbGF0ZV1dCiAgIFsiaHR0cHM6Ly9lc20uc2gvbGl0IiA6YXMgbGl0XSkpCgooZGVmY2xhc3MgTXlFbGVtZW50CiAgKGV4dGVuZHMgbGl0L0xpdEVsZW1lbnQpCiAgKGZpZWxkIG5hbWUgIldvcmxkIikKICAoZmllbGQgY291bnQgMCkKCiAgKGNvbnN0cnVjdG9yIFtfXQogICAgKHN1cGVyKSkKCiAgT2JqZWN0CiAgKHJlbmRlciBbdGhpc10KICAgICNodG1sIF5saXQvaHRtbAogICAgWzpkaXYKICAgICBbOmgxIG5hbWVdCiAgICAgWzpidXR0b24geyJAY2xpY2siICguLW9uQ2xpY2sgdGhpcykKICAgICAgICAgICAgICAgOnBhcnQgImJ1dHRvbiJ9CiAgICAgICJDbGljayBjb3VudCAiIGNvdW50XV0pCgogIChvbkNsaWNrIFt0aGlzXQogICAgKHNldCEgY291bnQgKGluYyBjb3VudCkpCiAgICAoLmRpc3BhdGNoRXZlbnQgdGhpcyAobmV3IGpzL0N1c3RvbUV2ZW50ICJjb3VudC1jaGFuZ2VkIikpKSkKCihzZXQhICguLXByb3BlcnRpZXMgTXlFbGVtZW50KSAjanMgeyJjb3VudCIgI2pzIHt9fSkKCihqcy93aW5kb3cuY3VzdG9tRWxlbWVudHMuZGVmaW5lICJteS1lbGVtZW50IiBNeUVsZW1lbnQpCgooZGVmIGFwcCAob3IgKGpzL2RvY3VtZW50LnF1ZXJ5U2VsZWN0b3IgIiNhcHAiKQogICAgICAgICAgIChkb3RvIChqcy9kb2N1bWVudC5jcmVhdGVFbGVtZW50ICJkaXYiKQogICAgICAgICAgICAgKHNldCEgLWlkICJhcHAiKQogICAgICAgICAgICAgKGpzL2RvY3VtZW50LmJvZHkucHJlcGVuZCkpKSkKCihzZXQhICguLWlubmVySFRNTCBhcHApICNodG1sIFs6bXktZWxlbWVudF0p) playground example for a full example. | ||
## Async/await | ||
@@ -199,0 +226,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1379538
19
8272
422