squint-cljs
Version:
<img src="./logo/logo.svg" width="100%">
6 lines • 60.5 kB
JavaScript
var squint;(squint||={}).core=(()=>{var me=Object.defineProperty;var uu=Object.getOwnPropertyDescriptor;var ou=Object.getOwnPropertyNames;var iu=Object.prototype.hasOwnProperty;var su=(t,e)=>{for(var n in e)me(t,n,{get:e[n],enumerable:!0})},cu=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of ou(e))!iu.call(t,u)&&u!==n&&me(t,u,{get:()=>e[u],enumerable:!(r=uu(e,u))||r.enumerable});return t};var fu=t=>cu(me({},"__esModule",{value:!0}),t);var wf={};su(wf,{Atom:()=>mr,Cons:()=>Gn,Delay:()=>cn,IAssociative:()=>io,IAssociative__assoc:()=>N,IAssociative__contains_key_QMARK_:()=>bt,IAtom:()=>no,ICollection:()=>fo,ICollection__conj:()=>w,ICounted:()=>so,ICounted__count:()=>It,IDeref:()=>ro,IDeref__deref:()=>O,IEditableCollection:()=>po,IEditableCollection__as_transient:()=>Mt,IEmptyableCollection:()=>lo,IEmptyableCollection__empty:()=>pt,IEncodeJS:()=>$o,IEncodeJS__clj__GT_js:()=>Te,IEquiv:()=>ao,IEquiv__equiv:()=>q,IHash:()=>wo,IHash__hash:()=>Ee,IIndexed:()=>Co,IIndexed__nth:()=>wt,IIterable:()=>jn,IIterable__iterator:()=>Qu,IKVReduce:()=>co,IKVReduce__kv_reduce:()=>$,ILookup:()=>oo,ILookup__lookup:()=>Y,IMap:()=>Wn,IMap__dissoc:()=>X,IMeta:()=>xo,IMeta__meta:()=>Z,IPrintWithWriter:()=>Ko,IPrintWithWriter__pr_writer:()=>qe,IRecord:()=>Le,IReset:()=>pr,IReset__reset_BANG_:()=>dt,ISeqable:()=>uo,ISeqable__seq:()=>At,ISet:()=>Fn,ISet__disjoin:()=>St,IStack:()=>jo,IStack__peek:()=>Re,IStack__pop:()=>ke,ISwap:()=>_r,ISwap__swap_BANG_:()=>j,ITransientAssociative:()=>ho,ITransientAssociative__assoc_BANG_:()=>ot,ITransientCollection:()=>_o,ITransientCollection__conj_BANG_:()=>Et,ITransientCollection__persistent_BANG_:()=>qt,ITransientMap:()=>yo,ITransientMap__dissoc_BANG_:()=>it,ITransientSet:()=>mo,ITransientSet__disjoin_BANG_:()=>st,ITransientVector:()=>Oo,ITransientVector__pop_BANG_:()=>ve,IVector:()=>Qt,IWatchable:()=>hr,IWatchable__add_watch:()=>ht,IWatchable__notify_watches:()=>Jt,IWatchable__remove_watch:()=>yt,IWithMeta:()=>go,IWithMeta__with_meta:()=>_t,IWriter:()=>Hn,IWriter__write:()=>Ht,LazySeq:()=>os,NaN_QMARK_:()=>Ps,PROTOCOL_SENTINEL:()=>eo,UUID:()=>Dt,_:()=>du,_EQ_:()=>Tt,_GT_:()=>yn,_GT__EQ_:()=>mn,_LT_:()=>lu,_LT__EQ_:()=>au,_PLUS_:()=>pu,_SLASH_:()=>hu,_STAR_:()=>_u,_STAR_print_err_fn_STAR_:()=>Ru,_STAR_print_fn_STAR_:()=>ft,_STAR_print_newline_STAR_:()=>Ce,__protocol_satisfies:()=>yu,__toFn:()=>a,_add_watch:()=>Ve,_as_transient:()=>ir,_assoc:()=>Jn,_assoc_BANG_:()=>fr,_conj:()=>er,_conj_BANG_:()=>sr,_contains_key_QMARK_:()=>Xn,_count:()=>Ut,_deref:()=>We,_disjoin:()=>or,_disjoin_BANG_:()=>ar,_dissoc:()=>Zn,_dissoc_BANG_:()=>lr,_empty:()=>nr,_equiv:()=>rr,_iterator:()=>Cn,_kv_reduce:()=>tr,_lookup:()=>Un,_notify_watches:()=>yr,_persistent_BANG_:()=>cr,_remove_watch:()=>Ye,_reset_BANG_:()=>Pe,_seq:()=>ur,_swap_BANG_:()=>dr,_write:()=>Fe,abs:()=>zc,aclone:()=>Is,add_watch:()=>ks,alength:()=>gs,any_QMARK_:()=>Ws,apply:()=>xr,array:()=>ri,array_QMARK_:()=>Ue,array_map:()=>Au,aset:()=>ws,assoc:()=>ct,assoc_BANG_:()=>P,assoc_in:()=>An,assoc_in_BANG_:()=>bn,associative_QMARK_:()=>Ns,atom:()=>Lo,boolean$:()=>_s,boolean_QMARK_:()=>bc,bounded_count:()=>Ic,butlast:()=>is,byte$:()=>Vc,cat:()=>tu,char$:()=>li,char_QMARK_:()=>fi,clj__GT_js:()=>af,coll_QMARK_:()=>lc,comp:()=>In,compare:()=>D,compare_and_set_BANG_:()=>Jo,complement:()=>Xt,concat:()=>di,conj:()=>Mn,conj_BANG_:()=>L,cons:()=>Fu,constantly:()=>pi,contains_QMARK_:()=>qn,count:()=>ne,counted_QMARK_:()=>Fr,cycle:()=>Qi,dec:()=>qu,dedupe:()=>Bi,deref:()=>rt,disj:()=>En,disj_BANG_:()=>je,dissoc:()=>kn,dissoc_BANG_:()=>Rn,distinct:()=>$i,distinct_QMARK_:()=>Fs,doall:()=>bs,dorun:()=>As,double$:()=>Lc,double_QMARK_:()=>Br,double_array:()=>qs,drop:()=>de,drop_last:()=>ss,drop_while:()=>vr,empty:()=>le,empty_QMARK_:()=>Zi,ensure_reduced:()=>kr,equiv:()=>Ao,es6_iterator:()=>k,even_QMARK_:()=>gr,every_QMARK_:()=>Tr,every_pred:()=>Ks,ex_cause:()=>dc,ex_data:()=>pc,ex_info:()=>hc,ex_message:()=>_c,false_QMARK_:()=>as,ffirst:()=>Cu,filter:()=>at,filterv:()=>Lu,find:()=>Sc,first:()=>C,flatten:()=>Nc,float$:()=>Fc,float_QMARK_:()=>yc,float_array:()=>Es,fn_QMARK_:()=>rn,fnext:()=>Ou,fnil:()=>tn,force:()=>lf,frequencies:()=>us,get:()=>R,get_in:()=>Ze,get_validator:()=>Po,group_by:()=>rs,hash:()=>Rt,hash_map:()=>gn,hash_ordered_coll:()=>ko,hash_set:()=>si,hash_unordered_coll:()=>vo,ident_QMARK_:()=>oc,identical_QMARK_:()=>qi,identity:()=>Ar,ifn_QMARK_:()=>zs,inc:()=>vn,inst_QMARK_:()=>sf,int_QMARK_:()=>xt,int_array:()=>Ss,integer_QMARK_:()=>mc,interleave:()=>br,interpose:()=>mi,into:()=>Rr,into_array:()=>Cr,iterable:()=>f,iterate:()=>js,js_keys:()=>Vs,js_obj:()=>xs,juxt:()=>Cs,keep:()=>Li,keep_indexed:()=>Xu,key:()=>Er,keys:()=>Gr,keyword:()=>Zs,keyword_QMARK_:()=>ec,last:()=>Bu,lazy:()=>A,list:()=>wr,list_QMARK_:()=>He,list_STAR_:()=>_i,long$:()=>Wc,long_array:()=>Ms,map:()=>lt,map_QMARK_:()=>jr,map_entry_QMARK_:()=>Ku,map_indexed:()=>Hu,mapcat:()=>hi,mapv:()=>se,max:()=>Qr,max_key:()=>qc,memoize:()=>Jc,merge:()=>Si,merge_with:()=>Mi,meta:()=>Dr,min:()=>Ts,min_key:()=>Ec,missing_protocol:()=>jt,mod:()=>Mc,name:()=>Zu,namespace:()=>Bt,nat_int_QMARK_:()=>gc,neg_QMARK_:()=>ys,neg_int_QMARK_:()=>wc,next:()=>tt,nfirst:()=>$u,nil_QMARK_:()=>to,nnext:()=>Os,not:()=>De,not_EQ_:()=>_f,not_any_QMARK_:()=>Ji,not_empty:()=>Tc,not_every_QMARK_:()=>Wi,nth:()=>Kn,nthnext:()=>$s,nthrest:()=>Gs,num:()=>Pc,number_QMARK_:()=>$r,object_QMARK_:()=>wn,object_array:()=>Rs,odd_QMARK_:()=>ai,parse_boolean:()=>ds,parse_double:()=>kc,parse_long:()=>Rc,parse_uuid:()=>of,partial:()=>Ki,partition:()=>Sr,partition_all:()=>Ir,partition_by:()=>Ii,partitionv:()=>wi,partitionv_all:()=>Ai,peek:()=>Xc,persistent_BANG_:()=>Qc,pop:()=>Zc,pop_BANG_:()=>tf,pos_QMARK_:()=>ms,pos_int_QMARK_:()=>xc,pr:()=>Tu,pr_str:()=>ye,print:()=>Tn,print_str:()=>Nn,println:()=>ku,println_str:()=>vu,prn:()=>xf,prn_str:()=>gf,qualified_ident_QMARK_:()=>sc,qualified_keyword_QMARK_:()=>uc,qualified_symbol_QMARK_:()=>fc,quot:()=>Vr,rand:()=>Ne,rand_int:()=>Kr,rand_nth:()=>ts,random_sample:()=>Pu,random_uuid:()=>nf,range:()=>Xo,re_find:()=>ti,re_matches:()=>Zo,re_pattern:()=>ei,re_seq:()=>Ls,realized_QMARK_:()=>ff,record_QMARK_:()=>Go,reduce:()=>V,reduce_kv:()=>kt,reduced:()=>re,reduced_QMARK_:()=>nt,reductions:()=>zu,regexp_QMARK_:()=>ac,rem:()=>eu,remove:()=>Vu,remove_watch:()=>vs,repeat:()=>Xe,repeatedly:()=>ns,replace:()=>Xi,req_BANG_:()=>bu,reset_BANG_:()=>Ct,reset_vals_BANG_:()=>Uo,rest:()=>Nt,reverse:()=>Pi,reversible_QMARK_:()=>Vi,rseq:()=>Yi,run_BANG_:()=>pf,satisfies_QMARK_:()=>mu,second:()=>ju,select_keys:()=>xi,seq:()=>K,seq_QMARK_:()=>Nu,seq_to_map_for_destructuring:()=>Su,seqable_QMARK_:()=>Oe,sequential_QMARK_:()=>Me,set:()=>oi,set_QMARK_:()=>ii,set_validator_BANG_:()=>Vo,short$:()=>Yc,shuffle:()=>Ui,simple_ident_QMARK_:()=>ic,simple_keyword_QMARK_:()=>rc,simple_symbol_QMARK_:()=>cc,some:()=>Nr,some_QMARK_:()=>ps,some_fn:()=>Qs,some_vals:()=>Iu,sort:()=>ee,sort_by:()=>Hi,sorted_QMARK_:()=>ci,sorted_map:()=>Oc,sorted_map_by:()=>$c,sorted_set:()=>jc,sorted_set_by:()=>Cc,split_at:()=>cs,split_with:()=>fs,str:()=>Be,string_QMARK_:()=>he,subs:()=>Or,subseq:()=>Dc,subvec:()=>ni,swap_BANG_:()=>Yo,swap_vals_BANG_:()=>Ho,symbol:()=>tc,symbol_QMARK_:()=>un,system_time:()=>Ei,t:()=>Ds,take:()=>pe,take_last:()=>ki,take_nth:()=>Ni,take_while:()=>_e,to_array:()=>Bs,trampoline:()=>Yr,transduce:()=>sn,transient$:()=>Kc,tree_seq:()=>Hr,true_QMARK_:()=>ls,truth_:()=>m,type:()=>Hc,unchecked_add_int:()=>Xs,unchecked_dec_int:()=>Js,unchecked_inc_int:()=>Us,unchecked_int:()=>Hs,unreduced:()=>Je,update:()=>Di,update_BANG_:()=>nn,update_in:()=>zi,update_keys:()=>ef,update_vals:()=>nu,uuid:()=>ru,uuid_QMARK_:()=>rf,val:()=>qr,vals:()=>Ys,var_QMARK_:()=>nc,vary_meta:()=>Ac,vec:()=>Ot,vector:()=>ie,vector_QMARK_:()=>ui,volatile_BANG_:()=>yf,vreset_BANG_:()=>mf,warn_on_lazy_reusage_BANG_:()=>Wu,with_meta:()=>zr,write_all:()=>Qo,zero_QMARK_:()=>hs,zipmap:()=>vc});function a(t){if(t==null||typeof t=="function")return t;if(typeof t=="string")return(e,n)=>R(e,t,n);switch(y(t)){case _:case M:case I:case b:return(e,n)=>R(t,e,n);case g:if(t[Y]!==void 0)return(e,n)=>R(t,e,n)}return t}var Se=Object.prototype.hasOwnProperty;function fn(t,e,n){for(n of t.keys())if(W(n,e))return n}function ln(t){return t!=null&&t[et]===!0&&t[h]===_}function zt(t){return t!=null&&(t instanceof Set||t[h]===b)}function Ft(t){return t!=null&&typeof t=="object"&&(t.constructor===Object||t instanceof Map||t[h]===_)}function an(t,e){return t instanceof Map||t[h]===_?t.has(e):Se.call(t,e)}function xe(t,e){return t instanceof Map||t[h]===_?t.get(e):t[e]}function Wt(t){return t instanceof Map||t[h]===_?t.size:Object.keys(t).length}function pn(t,e,n){var r;if(n===Array){if((r=t.length)===e.length)for(;r--&&W(t[r],e[r]););return r===-1}r=0;for(const u in t)if(Se.call(t,u)&&++r&&!Se.call(e,u)||!(u in e)||!W(t[u],e[u]))return!1;return Object.keys(e).length===r}function W(t,e){if(t===e)return!0;if(t==null)return e==null;if(e==null||typeof t!="object"||typeof e!="object")return!1;var n=t.constructor,r;if(n===e.constructor&&(n===Object||n===Array))return pn(t,e,n);if(typeof t=="object"&&t[q]!==void 0)return!!t[q](t,e);if(typeof e=="object"&&e[q]!==void 0)return!!e[q](e,t);const u=ln(t);if(u||ln(e)){const o=u?t:e,i=o===t?e:t;if(!Ft(i)||Wt(o)!==Wt(i))return!1;for(const s of o.keys())if(!an(i,s)||!W(o.get(s),xe(i,s)))return!1;return!0}if(Ft(t)&&Ft(e)&&t.constructor!==e.constructor){if(Wt(t)!==Wt(e))return!1;for(const o of t instanceof Map?t.keys():Object.keys(t))if(!an(e,o)||!W(xe(t,o),xe(e,o)))return!1;return!0}if(zt(t)||zt(e)){if(!zt(t)||!zt(e)||t.size!==e.size)return!1;for(let o of t)if(o&&typeof o=="object"&&(o=fn(e,o),!o)||!e.has(o))return!1;return!0}if(t&&e&&n===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return!1;if(n===Map){if(t.size!==e.size)return!1;for(const o of t)if(r=o[0],r&&typeof r=="object"&&(r=fn(e,r),!r)||!W(o[1],e.get(r)))return!1;return!0}if((!n||typeof t=="object")&&t[h]!==T)return pn(t,e,Object)}if(t&&e&&(Array.isArray(t)||t[h]===T)&&(Array.isArray(e)||e[h]===T)){const o=t[Symbol.iterator](),i=e[Symbol.iterator]();for(;;){const s=o.next(),c=i.next();if(s.done||c.done)return!!(s.done&&c.done);if(!W(s.value,c.value))return!1}}return!1}function vt(t,e){return t.every(function(n,r){return r===0||e(t[r-1],n)})}function Tt(...t){return vt(t,(e,n)=>W(e,n))}function yn(...t){return vt(t,(e,n)=>e>n)}function mn(...t){return vt(t,(e,n)=>e>=n)}function lu(...t){return vt(t,(e,n)=>e<n)}function au(...t){return vt(t,(e,n)=>e<=n)}function pu(...t){return t.reduce((e,n)=>e+n,0)}function _u(...t){return t.reduce((e,n)=>e*n,1)}function du(...t){return t.length==1?0-t[0]:t.reduce((e,n)=>e-n)}function hu(...t){return t.length===1?1/t[0]:t.reduce((e,n)=>e/n)}const yu={};function mu(t,e){return e==null?t[null]:typeof t=="symbol"?e[t]:e[t.__sym]}function xu(t,e,n){return t.set(e,n),t}function gu(t,e,n){return t[e]=n,t}function xn(t){switch(y(t)){case _:return xu;case M:case I:case g:return gu}}function wu(t,e,n){let r=t.length;for(let u=0;u<n.length+2;u+=2){const o=u===0?e:n[u-2];if(!Number.isInteger(o))throw new Error("Vector's key for assoc must be a number.");if(o<0||o>r)throw new Error(`Index ${o} out of bounds [0,${r}]`);o===r&&r++}}function P(t,e,n,...r){if(arguments.length<3||r.length%2!==0)throw new Error("Illegal argument: assoc expects an odd number of arguments.");switch(y(t)){case _:t.set(e,n);for(let u=0;u<r.length;u+=2)t.set(r[u],r[u+1]);break;case M:wu(t,e,r),t[e]=n;for(let u=0;u<r.length;u+=2)t[r[u]]=r[u+1];break;case g:if(t[ot]!==void 0){let u=t[ot](t,e,n);for(let o=0;o<r.length;o+=2)u=u[ot](u,r[o],r[o+1]);return u}case I:t[e]=n;for(let u=0;u<r.length;u+=2)t[r[u]]=r[u+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 S(t,e){const n=t?.[Z];return n!==void 0&&(e[Z]=n,e[_t]=t[_t]),e}function F(t){switch(y(t)){case _:return S(t,new t.constructor(t));case b:return S(t,new t.constructor(t));case M:return S(t,[...t]);case g:case I:return S(t,{...t});case B:return S(t,new $t(...t));default:throw new Error(`Don't know how to copy object of type ${typeof t}.`)}}function ct(t,e,n,...r){if(arguments.length<3||r.length%2!==0)throw new Error("Illegal argument: assoc expects an odd number of arguments.");if(t==null&&(t={}),!mt(t)&&!Array.isArray(t)&&t[N]!==void 0){let o=t[N](t,e,n);for(let i=0;i<r.length;i+=2)o=o[N](o,r[i],r[i+1]);return o}const u=F(t);return P(u,e,n,...r),u}function gn(...t){if(t.length===0)return{};if(t.length%2!==0)throw new Error("No value supplied for key: "+t[t.length-1]);return ct({},...t)}const Au=gn,_n={};function bu(t,e){const n=R(t,e,_n);if(n===_n)throw new Error("Missing required key: "+e);return n}function Iu(t){if(t==null)return null;let e=null;for(const[n,r]of f(t))r!=null&&(e===null&&(e={}),e[n]=r);return e}function Su(t){const e=Array.isArray(t)?t:[...f(t)],n=e.length;if(n<2)return n?e[0]:{};const r={};for(let u=0;u<n;u+=2)if(u===n-1)for(const[o,i]of f(e[u]))r[o]=i;else r[e[u]]=e[u+1];return r}const _=1,M=2,I=3,B=4,b=5,T=6,g=7,h=Symbol.for("squint.core/type"),et=Symbol.for("squint.core/sorted");function Mu(t,e){return t.squint$lang$variadic=e,t}function Qe(t){switch(t){case _:return new Map;case M:return[];case I:return{};case B:return new $t;case b:return new Set;case T:return A(function*(){})}}function mt(t){return t.constructor===Object}function E(t){return Array.isArray(t)&&t[h]!==B}function wn(t){return t!=null&&mt(t)}function y(t){if(t==null)return;if(mt(t))return I;if(t instanceof Map)return _;if(t instanceof Set)return b;const e=t[h];if(e!==void 0)return e;if(E(t))return M;if(typeof t=="object")return g}function Eu(t,e,n,r,u){r=Ot(r),n=n||{};const o=y(n);if(o!==_&&o!==M&&o!==I&&o!==g)throw new Error(`Illegal argument: ${e} expects the first argument to be a Map, Array, or Object.`);const i=[n];let s=n;for(let c=0;c<r.length-1;c+=1){const l=r[c];let d;s instanceof Map?d=s.get(l):s!=null&&s[Y]!==void 0?d=s[Y](s,l,void 0):d=s[l],d||(d=Qe(o)??{}),i.push(d),s=d}i.push(u);for(let c=i.length-2;c>=0;c-=1)i[c]=t(i[c],r[c],i[c+1]);return i[0]}function An(t,e,n){return Eu(ct,"assoc-in",t,e,n)}function bn(t,e,n){e=Ot(e);var r=t;const u=y(t);for(const o of e.splice(0,e.length-1)){let i=R(r,o);i===void 0&&(i=Qe(u),P(r,o,i)),r=i}return P(r,e[e.length-1],n),t}function In(...t){if(t=t.map(a),t.length===0)return Ar;if(t.length===1)return t[0];const[e,...n]=t.slice().reverse();return function(...r){let u=e(...r);for(const o of n)u=o(u);return u}}function Sn(t,e){for(const n of e)t.add(n);return t}function L(...t){const e=t.length;if(e===0)return ie();if(e===1)return t[0];let n=t[0];if(n==null&&(n=[]),e===2)switch(y(n)){case M:return n.push(t[1]),n;case b:return n.add(t[1]),n}const r=t.slice(1);switch(y(n)){case b:Sn(n,r);break;case B:n.unshift(...r.reverse());break;case M:n.push(...r);break;case _:for(const u of r)if(E(u))Vt(u),n.set(u[0],u[1]);else for(const o of Pt(u))n.set(o[0],o[1]);break;case g:if(n[Et]!==void 0){let u=n[Et](n,r[0]);for(let o=1;o<r.length;o++)u=L(u,r[o]);return u}case I:for(const u of r)if(E(u))Vt(u),n[u[0]]=u[1];else for(const o of Pt(u))n[o[0]]=o[1];break;default:throw new Error("Illegal argument: conj! expects a Set, Array, List, Map, or Object as the first argument.")}return n}function*Pt(t){if(Ft(t)){yield*f(t);return}for(const e of f(t)){if(!E(e))throw new Error("conj on a map takes map entries or seqables of map entries");yield e}}function Vt(t){if(t.length<2)throw new Error("Vector arg to map conj must be a pair");return t}function Mn(...t){if(t.length===0)return ie();const[e,...n]=t;if(n.length===0)return e;let r=e;r==null&&(r=wr());let u,o;switch(y(r)){case b:return r[et]?S(r,Sn(new r.constructor(r),n)):S(r,new r.constructor([...r,...n]));case B:return S(r,new $t(...n.reverse(),...r));case M:return S(r,[...r,...n]);case _:u=new Map(r);for(const i of n)if(E(i))Vt(i),u.set(i[0],i[1]);else for(const s of Pt(i))u.set(s[0],s[1]);return S(r,u);case T:return A(function*(){yield*n,yield*r});case g:if(r[w]!==void 0){o=r[w](r,n[0]);for(let i=1;i<n.length;i++)o=Mn(o,n[i]);return o}case I:o={...r};for(const i of n)if(E(i))Vt(i),o[i[0]]=i[1];else for(const s of Pt(i))o[s[0]]=s[1];return S(r,o);default:throw new Error("Illegal argument: conj expects a Set, Array, List, Map, or Object as the first argument.")}}function je(t,...e){if(t!=null&&t[st]!==void 0){let n=t;for(const r of e)n=n!=null&&n[st]!==void 0?n[st](n,r):je(n,r);return n}for(const n of e)t.delete(n);return t}function En(t,...e){if(t==null||e.length===0)return t;if(t[St]!==void 0){let r=t[St](t,e[0]);for(let u=1;u<e.length;u++)r=En(r,e[u]);return r}const n=new t.constructor(t);return S(t,je(n,...e))}function qn(t,e){if(typeof t=="string")return xt(e)&&e>=0&&e<t.length;switch(y(t)){case b:case _:return t.has(e);case void 0:return!1;case g:if(t[bt]!==void 0)return t[bt](t,e);default:return e in t}}function Rn(t,...e){if(t!=null&&t[it]!==void 0){let n=t;for(const r of e)n=n!=null&&n[it]!==void 0?n[it](n,r):Rn(n,r);return n}for(const n of e)delete t[n];return t}function kn(t,...e){if(!t)return;if(e.length===0)return t;const n=y(t);if(n!==_&&n!==I&&n!==g)throw new Error("dissoc expects a map, got: "+typeof t);if(n===g&&t[X]!==void 0){let o=t;for(const i of e){if(o==null)return o;o=o[X]!==void 0?o[X](o,i):kn(o,i)}return o}if(n===_){let o=!1;for(const s of e)if(t.has(s)){o=!0;break}if(!o)return t;const i=F(t);for(const s of e)i.delete(s);return i}let r=!1;for(const o of e)if(o in t){r=!0;break}if(!r)return t;const u=F(t);for(const o of e)delete u[o];return u}function vn(t){return t+1}function qu(t){return t-1}const Ce={val:!1},ft={val:t=>console.log(t)},Ru={val:t=>console.error(t)};function Tn(...t){ft.val(t.map(e=>Q(e,void 0,!1)).join(" "))}function ku(...t){Tn(...t),Ce.val&&ft.val(`
`)}function Nn(...t){return t.map(e=>Q(e,void 0,!1)).join(" ")}function vu(...t){return Nn(...t)+`
`}function Tu(...t){ft.val(ye(...t))}function Kn(t,e,n){if(typeof e!="number")throw new Error("Index argument to nth must be a number");const r=arguments.length>2;if(t==null)return r?n:null;if(Array.isArray(t)){if(e>=0&&e<t.length)return t[e]}else{if(t[wt]!==void 0)return r?t[wt](t,e,n):t[wt](t,e);if(e>=0){const u=U(t);let o=0,i;for(;(i=u())!==null;){if(e<o+i.length)return i[e-o];o+=i.length}}}if(r)return n;throw new Error("Index out of bounds: "+e)}function R(t,e,n=void 0){if(t==null)return n;let r;if(mt(t))return r=t[e],r===void 0?n:r;let u;switch(y(t)){case b:t.has(e)&&(r=e);break;case _:r=t.get(e);break;case M:r=t[e];break;default:if(t[Y]!==void 0)return r=t[Y](t,e,n),r===void 0?n:r;if(u=t.get,typeof u=="function")try{r=t.get(e);break}catch{}r=t[e];break}return r!==void 0?r:n}function Nu(t){return t!=null&&!!t[Symbol.iterator]}function Me(t){return Array.isArray(t)||t?.[h]===T||t!=null&&t[Qt.__sym]!==void 0}function Oe(t){return t==null||wn(t)||!!t[Symbol.iterator]||!!t[zn]}const Qn=Symbol.for("squint.core/map-entry");function Yt(t){return t[Qn]=!0,t}function Ku(t){return Array.isArray(t)&&t[Qn]===!0}function f(t){if(t==null)return[];if(t[Symbol.iterator])return t;if(t[At]!==void 0)return f(t[At](t));if(mt(t))return Object.entries(t).map(Yt);throw new TypeError(`${t} is not iterable`)}const jn=Symbol.for("squint.core/IIterable"),Qu=Symbol.iterator;function Cn(t){return t[Symbol.iterator]()}const k=Cn;function K(t){if(t==null)return t;if(!Oe(t))throw new TypeError(t+" is not ISeqable");if(typeof t=="string")return t.length?[...t]:null;const e=f(t);if(e.length===0||e.size===0)return null;if(e instanceof Set||e[h]===b)return[...e];if(e instanceof Map||e[h]===_)return[...e].map(Yt);if(e[X]!==void 0){const r=[...e].map(Yt);return r.length===0?null:r}return e[Symbol.iterator]().next().done?null:e}function C(t){if(t==null)return;if(Array.isArray(t))return t[0];if(t instanceof x)return t.force(),t.chunk===null?void 0:t.chunk[0];const[e]=f(t);return e}function ju(t){if(t instanceof x){t.force();const r=t.chunk;return r===null?void 0:r.length>1?r[1]:C(t._rest)}const[e,n]=f(t);return n}function Cu(t){return C(C(t))}function Ou(t){return C(tt(t))}function $u(t){return tt(C(t))}function Nt(t){const e=Ge(t);e.force();const n=e.chunk;if(n===null)return e;if(n.length>1){const r=new x(null);return r.realized=!0,r.chunk=n.slice(1),r._rest=e._rest,r}return e._rest}const Gu=t=>t.value;class ut{value;constructor(e){this.value=e,this[O]=Gu}}function Bu(t){if(t=f(t),Array.isArray(t))return t[t.length-1];const e=U(t);let n,r;for(;(r=e())!==null;)n=r[r.length-1];return n}function re(t){return new ut(t)}function nt(t){return t instanceof ut}function V(t,e,n){t=a(t);const r=arguments.length!==2,u=r?n:e;let o=r?e:void 0;if(Array.isArray(u)){let l=0;if(!r){if(u.length===0)return t();o=u[0],l=1}if(o instanceof ut)return o.value;for(;l<u.length;l++)if(o=t(o,u[l]),o instanceof ut)return o.value;return o}const i=U(u);let s=i(),c=0;if(!r){if(s===null)return t();o=s[0],c=1}if(o instanceof ut)return o.value;for(;s!==null;){for(;c<s.length;c++)if(o=t(o,s[c]),o instanceof ut)return o.value;s=i(),c=0}return o}function*Du(t,e){const n=e.next();n.done?yield t():yield*On(t,n.value,e)}function*On(t,e,n){let r=e;const u=n;for(;;){if(nt(r)){yield r.value;return}else yield r;const o=u.next();if(o.done)break;r=t(r,o.value)}}function zu(t,e,n){if(t=a(t),arguments.length===2){const u=k(f(e));return A(function*(){yield*Du(t,u)})}const r=k(f(n));return A(function*(){yield*On(t,e,r)})}function Wu(){console.warn("warn-on-lazy-reusage! is deprecated and does nothing: lazy values are now cached.")}const ue=32,x=class $n{constructor(e){this[h]=T,this[jn]=!0,this.step=e,this.realized=!1,this.chunk=null,this._rest=null}force(){if(!this.realized){this.realized=!0;const e=this.step();this.step=null,e!=null&&(this.chunk=e[0],this._rest=new $n(e[1]))}return this}[Symbol.iterator](){let e=this,n=0;return{next(){for(;;){e.force();const r=e.chunk;if(r===null)return{value:void 0,done:!0};if(n<r.length)return{value:r[n++],done:!1};e=e._rest,n=0}},[Symbol.iterator](){return this}}}indexOf(e,n=0){let r=0;for(const u of this){if(r>=n&&u===e)return r;r++}return-1}};function $e(t){const e=()=>{const n=t.next();return n.done?null:[[n.value],e]};return e}function A(t){return new x($e(t()))}function H(t,e){const n=k(f(t));return A(()=>e(n))}function Ge(t){if(t instanceof x)return t;if(Array.isArray(t)){const e=n=>()=>{if(n>=t.length)return null;const r=Math.min(n+ue,t.length);return[t.slice(n,r),e(r)]};return new x(e(0))}return new x($e(k(f(t))))}function U(t){if(t instanceof x){let n=t;return()=>{if(n===null)return null;n.force();const r=n.chunk;return n=r===null?null:n._rest,r}}const e=k(f(t));return()=>{const n=[];for(let r=0;r<ue;r++){const u=e.next();if(u.done)break;n.push(u.value)}return n.length===0?null:n}}function Kt(t,e){const n=Ge(t),r=(u,o)=>()=>{let i=u,s=o;for(;;){i.force();const c=i.chunk;if(c===null)return null;const l=e(c,s),d=i._rest;if(s+=c.length,l.length!==0)return[l,r(d,s)];i=d}};return new x(r(n,0))}const Gn=class{constructor(e,n){this[h]=T,this.x=e,this.coll=n}[Symbol.iterator](){const e=this.x;let n=this.coll,r=!1,u=null;return{next(){return r?(u||(u=k(f(n)),n=null),u.next()):(r=!0,{value:e,done:!1})},[Symbol.iterator](){return this}}}};function Fu(t,e){if(!Oe(e))throw new TypeError(e+" is not ISeqable");return new Gn(t,e)}function lt(t,...e){switch(t=a(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 Kt(e[0],n=>{const r=new Array(n.length);for(let u=0;u<n.length;u++)r[u]=t(n[u]);return r});default:{const n=e.map(r=>k(f(r)));return A(function*(){for(;;){const r=[];for(const u of n){const o=u.next();if(o.done)return;r.push(o.value)}yield t(...r)}})}}}function v(t){return e=>{const n=t(e);return(...r)=>r.length===0?e():r.length===1?e(r[0]):n(r[0],r[1])}}function Bn(t){return v(e=>(n,r)=>m(t(r))?e(n,r):n)}function at(t,e){return arguments.length===1?Bn(t):(t=a(t),Kt(e,n=>{const r=[];for(let u=0;u<n.length;u++){const o=n[u];m(t(o))&&r.push(o)}return r}))}function Lu(t,e){return ce([],at(t,e))}function Pu(t,e){return arguments.length===1?at(n=>Ne()<t):at(n=>Ne()<t,e)}function Vu(t,e){return arguments.length===1?Bn(Xt(t)):at(Xt(t),e)}function Yu(t){return v(e=>{let n=-1;return(r,u)=>e(r,t(++n,u))})}function Hu(t,e){return t=a(t),arguments.length===1?Yu(t):Kt(e,(n,r)=>{const u=new Array(n.length);for(let o=0;o<n.length;o++)u[o]=t(r+o,n[o]);return u})}function Uu(t,e){return t=a(t),Kt(e,(n,r)=>{const u=[];for(let o=0;o<n.length;o++){const i=t(r+o,n[o]);m(i)&&u.push(i)}return u})}function Ju(t){return v(e=>{let n=-1;return(r,u)=>{const o=t(++n,u);return o==null?r:e(r,o)}})}function Xu(t,e){return arguments.length===1?Ju(t):Uu(t,e)}function Be(...t){return t.join("")}function Zu(t){if(typeof t=="string"){const e=t.indexOf("/");return e>=1?t.slice(e+1):t}throw new Error("Doesn't support name: "+typeof t)}function De(t){return!m(t)}function to(t){return t==null}const eo={},Dn=Symbol.for("squint.core/IAtom"),ze=Symbol.for("squint.core/IDeref"),zn=Symbol.for("squint.core/ISeqable"),no={__sym:Dn},ro={__sym:ze},O=Symbol.for("squint.core/-deref");function We(t){return t!=null&&t[O]!==void 0?t[O](t):p(We,"IDeref.-deref",t)(t)}const uo={__sym:zn},At=Symbol.for("squint.core/-seq"),oo={__sym:Symbol.for("squint.core/ILookup")},Y=Symbol.for("squint.core/-lookup"),io={__sym:Symbol.for("squint.core/IAssociative")},N=Symbol.for("squint.core/-assoc"),bt=Symbol.for("squint.core/-contains-key?"),Wn={__sym:Symbol.for("squint.core/IMap")},X=Symbol.for("squint.core/-dissoc"),so={__sym:Symbol.for("squint.core/ICounted")},It=Symbol.for("squint.core/-count"),co={__sym:Symbol.for("squint.core/IKVReduce")},$=Symbol.for("squint.core/-kv-reduce"),fo={__sym:Symbol.for("squint.core/ICollection")},w=Symbol.for("squint.core/-conj"),lo={__sym:Symbol.for("squint.core/IEmptyableCollection")},pt=Symbol.for("squint.core/-empty"),ao={__sym:Symbol.for("squint.core/IEquiv")},q=Symbol.for("squint.core/-equiv"),Fn={__sym:Symbol.for("squint.core/ISet")},St=Symbol.for("squint.core/-disjoin"),po={__sym:Symbol.for("squint.core/IEditableCollection")},Mt=Symbol.for("squint.core/-as-transient"),_o={__sym:Symbol.for("squint.core/ITransientCollection")},Et=Symbol.for("squint.core/-conj!"),qt=Symbol.for("squint.core/-persistent!"),ho={__sym:Symbol.for("squint.core/ITransientAssociative")},ot=Symbol.for("squint.core/-assoc!"),yo={__sym:Symbol.for("squint.core/ITransientMap")},it=Symbol.for("squint.core/-dissoc!"),mo={__sym:Symbol.for("squint.core/ITransientSet")},st=Symbol.for("squint.core/-disjoin!"),xo={__sym:Symbol.for("squint.core/IMeta")},Z=Symbol.for("squint.core/-meta"),go={__sym:Symbol.for("squint.core/IWithMeta")},_t=Symbol.for("squint.core/-with-meta"),wo={__sym:Symbol.for("squint.core/IHash")},Ee=Symbol.for("squint.core/-hash");function Ao(t,e){return t===e?!0:t==null?e==null:e==null||typeof t!="object"||typeof e!="object"?!1:t[q]!==void 0?!!t[q](t,e):e[q]!==void 0?!!e[q](e,t):t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!1}const dn=new WeakMap;let bo=0;function hn(t){let e=dn.get(t);return e===void 0&&(e=++bo,dn.set(t,e)),e}const G=Math.imul,Io=-862048943,So=461845907;function Ln(t,e){return t<<e|t>>>32-e}function Pn(t){return G(Ln(G(t|0,Io),15),So)}function Vn(t,e){return G(Ln((t|0)^(e|0),13),5)+-430675100|0}function Yn(t,e){return t=t^e|0,t=t^t>>>16|0,t=G(t,-2048144789),t=t^t>>>13|0,t=G(t,-1028477387),t^t>>>16|0}function Mo(t){return t===0?0:Yn(Vn(0,Pn(t)),4)}let ge=Object.create(null),we=0;function Eo(t){let e=0;for(let n=0;n<t.length;n++)e=G(31,e)+t.charCodeAt(n)|0;return e}function qo(t){we>8192&&(ge=Object.create(null),we=0);let e=ge[t];return typeof e!="number"&&(e=Eo(t),ge[t]=e,we++),e}const Ae=(()=>{const t=new Float64Array(1);return{f64:t,i32:new Int32Array(t.buffer)}})();function Ro(t){return Ae.f64[0]=t,Ae.i32[0]^Ae.i32[1]|0}function oe(t,e){return Yn(Vn(0,Pn(t)),e)}function ko(t){let e=0,n=1;for(const r of t)n=G(31,n)+Rt(r)|0,e++;return oe(n,e)}function vo(t){let e=0,n=0;for(const r of t)n=n+Rt(r)|0,e++;return oe(n,e)}function To(t,e){return oe(G(31,G(31,1)+Rt(t)|0)+Rt(e)|0,2)}function No(t){let e=0,n=0;for(const[r,u]of t)n=n+To(r,u)|0,e++;return oe(n,e)}function Rt(t){if(t==null)return 0;switch(typeof t){case"number":return Number.isFinite(t)?Number.isSafeInteger(t)?t%2147483647|0:Ro(t):t===1/0?2146435072:t===-1/0?-1048576:2146959360;case"boolean":return t?1231:1237;case"string":return Mo(qo(t));case"bigint":return Number(t%2147483647n)|0;case"function":return hn(t)|0;case"object":break;default:return 0}return t[Ee]!==void 0?t[Ee](t)|0:t instanceof Date?t.valueOf()|0:t[q]!==void 0?No(Object.entries(t)):hn(t)|0}const Hn={__sym:Symbol.for("squint.core/IWriter")},Ht=Symbol.for("squint.core/-write"),Ko={__sym:Symbol.for("squint.core/IPrintWithWriter")},qe=Symbol.for("squint.core/-pr-writer");function Fe(t,e){return t!=null&&t[Ht]!==void 0?t[Ht](t,e):p(Fe,"IWriter.-write",t)(t,e)}function Qo(t,...e){for(const n of e)Fe(t,n)}const jo={__sym:Symbol.for("squint.core/IStack")},Re=Symbol.for("squint.core/-peek"),ke=Symbol.for("squint.core/-pop"),Co={__sym:Symbol.for("squint.core/IIndexed")},wt=Symbol.for("squint.core/-nth"),Oo={__sym:Symbol.for("squint.core/ITransientVector")},ve=Symbol.for("squint.core/-pop!"),Qt={__sym:Symbol.for("squint.core/IVector")},$o={__sym:Symbol.for("squint.core/IEncodeJS")},Te=Symbol.for("squint.core/-clj->js"),Le={__sym:Symbol.for("squint.core/IRecord")};function Go(t){return t!=null&&t[Le.__sym]!==void 0}function Un(t,e,n){return t!=null&&t[Y]!==void 0?t[Y](t,e,n):p(Un,"ILookup.-lookup",t)(t,e,n)}function Jn(t,e,n){return t!=null&&t[N]!==void 0?t[N](t,e,n):p(Jn,"IAssociative.-assoc",t)(t,e,n)}function Xn(t,e){return t!=null&&t[bt]!==void 0?t[bt](t,e):p(Xn,"IAssociative.-contains-key?",t)(t,e)}function Zn(t,e){return t!=null&&t[X]!==void 0?t[X](t,e):p(Zn,"IMap.-dissoc",t)(t,e)}function Ut(t){return t!=null&&t[It]!==void 0?t[It](t):p(Ut,"ICounted.-count",t)(t)}function tr(t,e,n){return t!=null&&t[$]!==void 0?t[$](t,e,n):p(tr,"IKVReduce.-kv-reduce",t)(t,e,n)}function er(t,e){return t!=null&&t[w]!==void 0?t[w](t,e):p(er,"ICollection.-conj",t)(t,e)}function nr(t){return t!=null&&t[pt]!==void 0?t[pt](t):p(nr,"IEmptyableCollection.-empty",t)(t)}function rr(t,e){return t!=null&&t[q]!==void 0?t[q](t,e):p(rr,"IEquiv.-equiv",t)(t,e)}function ur(t){return t!=null&&t[At]!==void 0?t[At](t):p(ur,"ISeqable.-seq",t)(t)}function or(t,e){return t!=null&&t[St]!==void 0?t[St](t,e):p(or,"ISet.-disjoin",t)(t,e)}function ir(t){return t!=null&&t[Mt]!==void 0?t[Mt](t):p(ir,"IEditableCollection.-as-transient",t)(t)}function sr(t,e){return t!=null&&t[Et]!==void 0?t[Et](t,e):p(sr,"ITransientCollection.-conj!",t)(t,e)}function cr(t){return t!=null&&t[qt]!==void 0?t[qt](t):p(cr,"ITransientCollection.-persistent!",t)(t)}function fr(t,e,n){return t!=null&&t[ot]!==void 0?t[ot](t,e,n):p(fr,"ITransientAssociative.-assoc!",t)(t,e,n)}function lr(t,e){return t!=null&&t[it]!==void 0?t[it](t,e):p(lr,"ITransientMap.-dissoc!",t)(t,e)}function ar(t,e){return t!=null&&t[st]!==void 0?t[st](t,e):p(ar,"ITransientSet.-disjoin!",t)(t,e)}function p(t,e,n){const r=t[null];if(r===void 0)throw jt(e,n);return r}const pr={__sym:Symbol.for("squint.core/IReset")},dt=Symbol.for("squint.core/-reset!");function Pe(t,e){return t!=null&&t[dt]!==void 0?t[dt](t,e):p(Pe,"IReset.-reset!",t)(t,e)}const _r={__sym:Symbol.for("squint.core/ISwap")},j=Symbol.for("squint.core/-swap!");function dr(t,e,...n){return t!=null&&t[j]!==void 0?t[j](t,e,...n):p(dr,"ISwap.-swap!",t)(t,e,...n)}const hr={__sym:Symbol.for("squint.core/IWatchable")},ht=Symbol.for("squint.core/-add-watch"),yt=Symbol.for("squint.core/-remove-watch"),Jt=Symbol.for("squint.core/-notify-watches");function Ve(t,e,n){return t!=null&&t[ht]!==void 0?t[ht](t,e,n):p(Ve,"IWatchable.-add-watch",t)(t,e,n)}function Ye(t,e){return t!=null&&t[yt]!==void 0?t[yt](t,e):p(Ye,"IWatchable.-remove-watch",t)(t,e)}function yr(t,e,n){return t!=null&&t[Jt]!==void 0?t[Jt](t,e,n):p(yr,"IWatchable.-notify-watches",t)(t,e,n)}const Bo=t=>t.val,gt=(t,e)=>{if(t._validator&&!m(t._validator(e)))throw new Error("Validator rejected reference state");const n=t.val;if(t.val=e,t._hasWatches)for(const[r,u]of Object.entries(t._watches))u(r,t,n,e);return e},Do=function(t,e,n,r,u){switch(arguments.length){case 2:return gt(t,e(t.val));case 3:return gt(t,e(t.val,n));case 4:return gt(t,e(t.val,n,r));default:return gt(t,e(t.val,n,r,...u))}},zo=(t,e,n)=>{t._watches[e]=n,t._hasWatches=!0},Wo=(t,e)=>{delete t._watches[e]},Fo=(t,e,n)=>{for(const[r,u]of Object.entries(t._watches))u(r,t,e,n)};class mr{constructor(e){this.val=e,this._watches={},this._hasWatches=!1,this[Dn]=!0,this[ze]=!0,this[O]=Bo,this[pr.__sym]=!0,this[dt]=gt,this[_r.__sym]=!0,this[j]=Do,this[hr.__sym]=!0,this[ht]=zo,this[yt]=Wo,this[Jt]=Fo}}function Lo(t,...e){const n=new mr(t);for(let r=0;r<e.length;r+=2)if(e[r]==="meta"){const u=e[r+1];n[Z]=()=>u}else e[r]==="validator"&&(n._validator=e[r+1]);return n}function Po(t){return t._validator??null}function Vo(t,e){if(e!=null&&!m(e(rt(t))))throw new Error("Validator rejected reference state");return t._validator=e,null}function jt(t,e){let n;return e===null?n="null":e===void 0?n="undefined":Array.isArray(e)?n="array":typeof e=="object"&&e.constructor&&e.constructor!==Object?n=e.constructor.name:n=typeof e,new Error(`No protocol method ${t} defined for type ${n}: ${e??""}`)}function rt(t){return t?.[O]!==void 0?t[O](t):p(We,"IDeref.-deref",t)(t)}function Ct(t,e){return t?.[dt]!==void 0?t[dt](t,e):p(Pe,"IReset.-reset!",t)(t,e)}function Yo(t,e,...n){if(e=a(e),t?.[j]!==void 0)switch(n.length){case 0:return t[j](t,e);case 1:return t[j](t,e,n[0]);case 2:return t[j](t,e,n[0],n[1]);default:return t[j](t,e,n[0],n[1],n.slice(2))}const r=e(rt(t),...n);return Ct(t,r),r}function Ho(t,e,...n){const r=rt(t);e=a(e);const u=e(r,...n);return Ct(t,u),[r,u]}function Uo(t,e){const n=rt(t);return Ct(t,e),[n,e]}function Jo(t,e,n){return rt(t)===e?(Ct(t,n),!0):!1}function Xo(t,e,n){let r=t,u=e,o=n;e===void 0&&(r=0,u=t);const i=r||0;o=n??1;const s=o>=0,c=d=>u===void 0||s&&d<u||!s&&u<d,l=d=>()=>{if(!c(d))return null;const z=[];let J=d;for(;z.length<ue&&c(J);)z.push(J),J+=o;return[z,l(J)]};return new x(l(i))}function Zo(t,e){const n=t.exec(e);return n&&e===n[0]?n.length===1?n[0]:n:null}function ti(t,e){if(he(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 ei(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 ni(t,e,n){if(t!=null&&t[Qt.__sym]!==void 0){if(n===void 0&&(n=Ut(t)),e==null||n==null)throw new Error("subvec: start and end must not be nil");if(e=e|0,n=n|0,e<0||n<e||n>Ut(t))throw new Error("subvec: index out of bounds");let r=t[pt](t);for(let u=e;u<n;u++)r=r[w](r,t[wt](t,u));return r}if(!E(t))throw new Error("subvec: argument must be a vector");if(n===void 0&&(n=t.length),e==null||n==null)throw new Error("subvec: start and end must not be nil");if(e=e|0,n=n|0,e<0||n<e||n>t.length)throw new Error("subvec: index out of bounds");return t.slice(e,n)}function ie(...t){return t}const ri=ie;function ui(t){return t==null?!1:E(t)||t[Qt.__sym]!==void 0}function se(...t){if(t.length===2){const[n,r]=t,u=a(n),o=f(r);if(Array.isArray(o)){const i=new Array(o.length);for(var e=0;e<o.length;e++)i[e]=u(o[e]);return i}else{const i=[],s=U(o);let c;for(;(c=s())!==null;)for(let l=0;l<c.length;l++)i.push(u(c[l]));return i}}return[...lt(...t)]}function ce(t,e){if(e instanceof x){let n=e;for(;;){n.force();const r=n.chunk;if(r===null)return t;Array.prototype.push.apply(t,r),n=n._rest}}for(const n of f(e))t.push(n);return t}function fe(t){return t instanceof x?ce([],t):[...f(t)]}function Ot(t){return E(t)||t!=null&&t[Qt.__sym]!==void 0?t:ce([],t)}function oi(t){return new Set(f(t))}function ii(t){return t==null?!1:y(t)===b||t[Fn.__sym]!==void 0}function si(...t){return new Set(t)}function ci(t){return t!=null&&t[et]===!0}function fi(t){return typeof t=="string"&&t.length===1}function li(t){if(typeof t=="string"&&t.length===1)return t;if(typeof t=="number")return String.fromCharCode(t);throw new Error("Argument to char must be a character or number: "+t)}function xr(t,...e){t=a(t);const n=e.slice(0,e.length-1),r=e[e.length-1],u=t.squint$lang$variadic;if(u){const o=u.length-1,i=[];let s=0,c;for(;s<o&&s<n.length;s++)i.push(n[s]);if(s<o){let l=K(r);for(;s<o&&l!=null;s++)i.push(C(l)),l=tt(l);c=l}else c=s<n.length?Zt([n.slice(s),r]):r;return c=c==null?null:K(c),c==null?t(...i):u(...i,c)}return t(...n,...f(r))}function gr(t){if(!Number.isInteger(t))throw new Error(`Argument must be an integer: ${t}`);return t%2==0}function ai(t){return!gr(t)}function Xt(t){return t=a(t),(...e)=>De(t(...e))}function pi(t){return(...e)=>t}class $t extends Array{constructor(...e){super(),this[h]=B,this.push(...e)}}function He(t){return t?.[h]===B}function wr(...t){return new $t(...t)}function _i(...t){const e=t.pop();return new $t(...t,...f(e))}function Ue(t){return Array.isArray(t)}const be={};function Zt(t){const e=Array.isArray(t),n=e?t.slice():null,r=e?null:k(f(t));let u=0;const o=()=>{if(e){if(u>=n.length)return be;const c=n[u];return n[u]=null,u++,c}const s=r.next();return s.done?be:s.value},i=s=>()=>{for(;;){if(s!==null)if(s instanceof x){if(s.force(),s.chunk!==null)return[s.chunk,i(s._rest)];s=null}else{const l=s.a,d=s.pos;if(d<l.length){const z=Math.min(d+ue,l.length);return[l.slice(d,z),i({a:l,pos:z})]}s=null}const c=o();if(c===be)return null;s=c instanceof x?c:Array.isArray(c)?{a:c,pos:0}:Ge(c)}};return new x(i(null))}const di=Mu((...t)=>Zt(t),t=>Zt(t));function hi(t,...e){return e.length===0?In(lt(t),tu):Zt(lt(t,...e))}function Ar(t){return t}function br(...t){const e=t.map(n=>k(f(n)));return A(function*(){for(;;){const n=[];for(const r of e){const u=r.next();if(u.done)return;n.push(u.value)}yield*n}})}function yi(t){return v(e=>{let n=!1;return(r,u)=>{if(!n)return n=!0,e(r,u);const o=e(r,t);return nt(o)?o:e(o,u)}})}function mi(t,e){return arguments.length===1?yi(t):de(1,br(Xe(t),e))}function xi(t,e){const r=y(t)===_?new Map:{};for(const u of f(e)){const o=R(t,u);o!==void 0&&P(r,u,o)}return r}function Je(t){return nt(t)?rt(t):t}function gi(t){return e=>{let n=[];return(...r)=>{let u,o;switch(r.length){case 0:return e();case 1:return u=r[0],n.length!==0&&(o=[...n],n=[],u=Je(e(u,o))),e(u);case 2:return u=r[0],n.push(r[1]),t===n.length?(o=[...n],n=[],e(u,o)):u}}}}function Ir(t,...e){if(arguments.length===1)return gi(t);let n=t,r=e[0];return e.length===2&&([n,r]=e),Mr(t,n,[],r,!0)}function Sr(t,...e){let n=t,r,u=e[0];return e.length===2?[n,u]=e:e.length>2&&([n,r,u]=e),Mr(t,n,r,u,!1)}const wi=Sr,Ai=Ir;function Mr(t,e,n,r,u){return H(r,function*(o){let i=[],s=0;for(const c of o)s<t&&(i.push(c),i.length===t&&(yield i,i=e<t?i.slice(e):[])),s++,s===e&&(s=0);i.length>0&&(i.length===t||u?yield i:n!==void 0&&(n!=null&&i.push(...[...f(n)].slice(0,t-i.length)),yield i))})}function bi(t){return e=>{let n=[];const r={};let u=r;return(...o)=>{const i=o.length;if(i===0)return e();if(i===1){let s=o[0];if(n.length!==0){const c=[...n];n=[],s=Je(e(s,c))}return e(s)}if(i===2){const s=o[0],c=o[1],l=u,d=t(c);if(u=d,l===r||d===l)return n.push(c),s;{const z=[...n];n=[];const J=e(s,z);return nt(J)||n.push(c),J}}}}}function Ii(t,e){if(t=a(t),arguments.length===1)return bi(t);const n=k(e);return A(function*(){const r=n.next();r.done&&(yield*null);const u=r.value;let o=t(u),i=[u],s=[];for(;;){const c=n.next();if(c.done){yield i;break}const l=c.value,d=t(l);o==d?i.push(l):(yield i,s.push(l),i=s,o=d,s=[])}})}function le(t){const e=y(t);return e!=null?e===g?t[pt]!==void 0?t[pt](t):t.constructor===void 0?S(t,{}):null:S(t,Qe(e)):null}function Si(...t){if(!t.some(m))return null;const e=t[0];let n;if(e==null?n={}:y(e)===void 0||e[w]!==void 0?n=e:n=Rr(le(e),e),n!=null&&n[w]!==void 0){for(let r=1;r<t.length;r++)n=n!=null&&n[w]!==void 0?n[w](n,t[r]):L(n,t[r]);return n}return L(n,...t.slice(1))}function Er(t){return t[0]}function qr(t){return t[1]}function Mi(t,...e){t=a(t);var n=!1;for(const r of e)if(r!=null){n=!0;break}if(n){const r=(o,i)=>{const s=Er(i),c=qr(i);return qn(o,s)?ct(o,s,t(R(o,s),c)):ct(o,s,c)};return V((o,i)=>V(r,o||{},K(i)),e)}else return null}function Ei(){return performance.now()}function Rr(...t){let e,n,r,u,o;switch(t.length){case 0:return[];case 1:return t[0];case 2:return e=t[0]??[],E(e)?ce(F(e),t[1]):e[w]!==void 0?V((i,s)=>i!=null&&i[w]!==void 0?i[w](i,s):L(i,s),e,t[1]):V(L,F(e),t[1]);case 3:return e=t[0],n=t[1],r=t[2],u=e!=null&&e[w]!==void 0?e:F(e),o=(i,s)=>s===void 0?i:i!=null&&i[w]!==void 0?i[w](i,s):L(i,s),sn(n,o,u,r);default:throw TypeError(`Invalid arity call of into: ${t.length}`)}}function qi(t,e){return t===e}function Xe(...t){if(t.length==0||t.length>2)throw new Error(`Invalid arity: ${t.length}`);if(t.length==1){const r=t[0];return A(function*(){for(;;)yield r})}const[e,n]=t;return A(function*(){for(var r=0;r<e;r++)yield n})}function kr(t){return nt(t)?t:re(t)}function Ri(t){return v(e=>{let n=t;return(r,u)=>{const o=--n+1;return o>0&&(r=e(r,u)),o>1?r:kr(r)}})}function ae(t){if(typeof t!="number")throw new Error("Assert failed: (number? n)");return t}function pe(t,e){return ae(t),arguments.length===1?Ri(t):H(e,function*(n){let r=t-1;for(const u of n)if(r-->=0&&(yield u),r<0)return})}function ki(t,e){if(ae(t),t<=0)return null;if(Array.isArray(e))return K(e.slice(-t));{const n=new Array(t);let r=0;for(const u of f(e))n[r%t]=u,r++;return r===0?null:r%t!==0&&r>=t?n.slice(r%t).concat(n.slice(0,r%t)):(n.length=Math.min(r,t),n)}}function vi(t){return v(e=>(n,r)=>m(t(r))?e(n,r):re(n))}function _e(t,e){return t=a(t),arguments.length===1?vi(t):H(e,function*(n){for(const r of n)if(m(t(r)))yield r;else return})}function Ti(t){return v(e=>{let n=-1;return(r,u)=>eu(++n,t)===0?e(r,u):r})}function Ni(t,e){return ae(t),arguments.length===1?Ti(t):t<=0?Xe(C(e)):H(e,function*(n){let r=0;for(const u of n)r%t===0&&(yield u),r++})}function Ki(t,...e){return t=a(t),function(...n){return t(...e,...n)}}function Qi(t){const e=f(t);return A(function*(){const n=[];for(const r of e)n.push(r),yield r;for(;n.length;)yield*n})}function ji(t){return v(e=>{let n=t;return(r,u)=>n-- >0?r:e(r,u)})}function de(t,e){return ae(t),arguments.length===1?ji(t):H(e,function*(n){for(let r=0;r<t;r++)n.next();yield*n})}function Ci(t){return v(e=>{let n=!0;return(r,u)=>n&&m(t(u))?r:(n=!1,e(r,u))})}function vr(t,e){return t=a(t),arguments.length===1?Ci(t):H(e,function*(n){for(;;){const r=n.next();if(r.done)break;const u=r.value;if(!m(t(u))){yield u;break}}yield*n})}function Oi(){return v(t=>{const e=new Set;return(n,r)=>e.has(r)?n:(e.add(r),t(n,r))})}function $i(t){return arguments.length===0?Oi():H(t,function*(e){const n=new Set;for(const r of e)n.has(r)||(yield r),n.add(r)})}const te={};function Gi(){return v(t=>{let e=te;return(n,r)=>{const u=e!==te&&m(Tt(e,r));return e=r,u?n:t(n,r)}})}function Bi(t){return arguments.length===0?Gi():H(t,function*(e){let n=te;for(const r of e)(n===te||!m(Tt(n,r)))&&(yield r),n=r})}function Di(t,e,n,...r){return n=a(n),ct(t,e,n(R(t,e),...r))}function Ze(t,e,n){let r=t;for(const u of f(e))r=R(r,u);return r===void 0?n:r}function zi(t,e,n,...r){return n=a(n),An(t,e,n(Ze(t,e),...r))}function tn(t,...e){t=a(t);const n=e.length;return function(...r){for(let u=0;u<n;u++)r[u]==null&&(r[u]=e[u]);return t(...r)}}function Tr(t,e){if(t=a(t),Array.isArray(e)){for(let u=0;u<e.length;u++)if(!t(e[u]))return!1;return!0}const n=U(e);let r;for(;(r=n())!==null;)for(let u=0;u<r.length;u++)if(!t(r[u]))return!1;return!0}function Wi(t,e){return!Tr(t,e)}function Fi(t){return v(e=>(n,r)=>{const u=t(r);return u==null?n:e(n,u)})}function Li(t,e){return t=a(t),arguments.length===1?Fi(t):Kt(e,n=>{const r=[];for(let u=0;u<n.length;u++){const o=t(n[u]);m(o)&&r.push(o)}return r})}function Pi(t){return fe(t).reverse()}function Vi(t){return E(t)||t!=null&&t[et]===!0}function Yi(t){if(E(t))return t.length===0?null:[...t].reverse();if(t!=null&&t[et]===!0){const e=[...t].reverse();return e.length===0?null:e}throw new Error("rseq not supported on: "+typeof t)}function ee(t,e){return arguments.length===1&&(e=t,t=void 0),t=a(t),fe(e).sort(t||D)}function en(t){return t===D?t:(e,n)=>{const r=t(e,n);return $r(r)?r:r?-1:t(n,e)?1:0}}function Hi(t,e,n){return arguments.length===2&&(n=e,e=D),t=a(t),e=a(e),ee((r,u)=>{const o=en(e),i=t(r),s=t(u);return o(i,s)},n)}function Ui(t){const e=fe(t);let n=e.length;for(;n;){const r=Math.floor(Math.random()*n--),u=e[n];e[n]=e[r],e[r]=u}return e}function Nr(t,e){if(t=a(t),Array.isArray(e)){for(let u=0;u<e.length;u++){const o=t(e[u]);if(m(o))return o}return}const n=U(e);let r;for(;(r=n())!==null;)for(let u=0;u<r.length;u++){const o=t(r[u]);if(m(o))return o}}function Ji(t,e){return t=a(t),!Nr(t,e)}function Xi(t,e){return(Array.isArray(e)?se:lt)(r=>{const u=t[r];return u!==void 0?u:r},e)}function Zi(t){return!K(t)}function Ne(t){return t===void 0&&(t=1),Math.random()*t}function Kr(t){return Math.floor(Math.random()*t)}function ts(t){const e=Kr(ne(t));return Kn(t,e)}function es(t){return A(function*(){for(;;)yield t()})}function ns(t,e){arguments.length===1&&(e=t,t=void 0);const n=es(e);if(t!==void 0){if(typeof t!="number")throw new Error("repeatedly: count must be a number, got: "+Be(t));return pe(t,n)}else return n}function nn(t,e,n,...r){n=a(n);const u=R(t,e);return P(t,e,n(u,...r))}function rs(t,e){t=a(t);const n={};for(const r of f(e)){const u=t(r);nn(n,u,tn(L,[]),r)}return n}function us(t){const e={},n=tn(vn,0);for(const r of f(t))nn(e,r,n);return e}class os extends x{static[Symbol.hasInstance](e){return e instanceof x}constructor(e){super(()=>$e(k(f(e())))())}}function is(t){const e=fe(t);return e.pop(),e.length>0?e:null}function ss(...t){const[e,n]=t.length>1?t:[1,t[0]];return lt((r,u)=>r,n,de(e,n))}function cs(t,e){return[pe(t,e),de(t,e)]}function fs(t,e){return[_e(t,e),vr(t,e)]}function ne(t){if(!t)return 0;const e=t.length||t.size;if(typeof e=="number")return e;if(t[It]!==void 0)return t[It](t);const n=U(t);let r=0,u;for(;(u=n())!==null;)r+=u.length;return r}function ls(t){return t===!0}function as(t){return t===!1}function ps(t){return t!=null}function _s(t){return m(t)}function ds(t){if(typeof t!="string")throw new Error("Argument must be a string");return t==="true"?!0:t==="false"?!1:null}function hs(t){return t===0}function ys(t){return t<0}function ms(t){return t>0}function xs(...t){let e=0;const n={};for(;!(e>=t.length);)n[t[e]]=t[e+1],e=e+2;return n}function gs(t){return t.length}function ws(t,e,n,...r){if(r.length==0)return t[e]=n,n;{const u=[e,n,...r],o=u[u.length-1];let i=t,s=0;const c=u.length-2;for(;s<c;s++)i=i[u[s]];return i[u[s]]=o,n}}function As(t){if(t instanceof x){const e=U(t);for(;e()!==null;);return null}for(const e of f(t));return null}function bs(t){if(t!=null&&t[h]===T)for(const e of t);return t}function Is(t){return[...t]}function Gt(t,e){if(e!==void 0){const n=new Array(t);if(typeof e=="number")return n.fill(e);let r=0;for(const u of f(e)){if(r>=t)break;n[r++]=u}return n}return typeof t=="number"?new Array(t).fill(null):[...f(t)]}function Ss(t,e){return Gt(t,e)}function Ms(t,e){return Gt(t,e)}function Es(t,e){return Gt(t,e)}function qs(t,e){return Gt(t,e)}function Rs(t,e){return Gt(t,e)}function ks(t,e,n){return t?.[ht]!==void 0?(t[ht](t,e,n),t):(p(Ve,"IWatchable.-add-watch",t)(t,e,n),t)}function vs(t,e){return t?.[yt]!==void 0?(t[yt](t,e),t):(p(Ye,"IWatchable.-remove-watch",t)(t,e),t)}function kt(t,e,n){if(!n)return e;if(n[$]!==void 0)return n[$](n,t,e);var r=e;for(const u of f(n))r=t(r,u[0],u[1]);return r}function Qr(t,...e){let n=t;for(const r of e)n=isNaN(n)?n:isNaN(r)?r:n>r?n:r;return n}function Ts(t,...e){let n=t;for(const r of e)n=isNaN(n)?n:isNaN(r)?r:n<r?n:r;return n}function Ns(t){switch(y(t)){case _:case M:case I:return!0;case g:return t[N]!==void 0;default:return!1}}function jr(t){return t==null?!1:!!(mt(t)||t instanceof Map||t[h]===_||t[Wn.__sym]!==void 0)}function Ks(...t){return(...e)=>{for(const n of t)for(const r of e)if(!n(r))return!1;return!0}}function Qs(...t){return(...e)=>{let n;for(const r of t)for(const u of e)if(n=r(u),m(n))return n;return n}}function Cr(t,e){return Ot(e||t)}function js(t,e){var n=e;return A(function*(){for(;;)yield n,n=t(n)})}function Cs(...t){return t=t.map(a),(...e)=>{const n=[];for(const r of t)n.push(r(...e));return n}}function tt(t){if(Array.isArray(t)){const e=t.slice(1);return e.length>0?e:null}else return K(Nt(t))}function Os(t){return tt(tt(t))}function $s(t,e){let n=K(t);for(;n!=null&&e>0;)n=tt(n),e=e-1;return n}function Gs(t,e){let n=t;for(;e>0&&K(n)!=null;)n=Nt(n),e=e-1;return n}function D(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"||n==="boolean"&&r==="boolean")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 u=0;u<t.length;u++){const o=D(t[u],e[u]);if(o!=0)return o}return 0}else throw new Error(`comparing ${n} to ${r}`)}}function Bs(t){return Cr(t)}function m(t){return t!=null&&t!==!1}const Ds=m;function Or(t,e,n){return t.substring(e,n)}function rn(t){return typeof t=="function"}function zs(t){return rn(t)}function Ws(t){return!0}function Fs(t,...e){if(e.length===0)return!0;const n=[t];for(const r of e){for(const u of n)if(m(Tt(u,r)))return!1;n.push(r)}return!0}function Ls(t,e){return A(function*(){for(;;){const n=t.exec(e);if(n){const r=n[0];yield n.length===1?r:Ot(n);const o=n.index+Qr(1,r.length);if(o>e.length)break;e=Or(e,o)}else break}})}function Ps(t){return isNaN(t)}function $r(t){return typeof t=="number"}function Gr(t){if(t==null)return null;switch(y(t)){case g:if(t[$]!==void 0){const n=t[$](t,(r,u,o)=>(r.push(u),r),[]);return n.length?n:void 0}case I:{const n=Object.keys(t);return n.length?n:void 0}case _:return t.size?Array.from(t.keys()):void 0}for(const n of f(t))throw new TypeError(t+" is not a map");return null}function Vs(t){return Gr(t)??[]}function Ys(t){if(t==null)return null;switch(y(t)){case g:if(t[$]!==void 0){const n=t[$](t,(r,u,o)=>(r.push(o),r),[]);return n.length?n:void 0}case I:{const n=Object.values(t);return n.length?n:void 0}case _:return t.size?Array.from(t.values()):void 0}for(const n of f(t))throw new TypeError(t+" is not a map");return null}function he(t){return typeof t=="string"}function Hs(t){return Math.trunc(t)}function Us(t){return t+1}function Js(t){return t-1}function Xs(t,e){return t+e}function Bt(t){const e=t.indexOf("/");return e>=1?t.slice(0,e):null}function Zs(t,e){return e!==void 0?(t!=null?t+"/":"")+e:t}function tc(t,e){return e!==void 0?(t!=null?t+"/":"")+e:t}function ec(t){return typeof t=="string"}function un(t){return typeof t=="string"}function nc(t){return!1}function rc(t){return typeof t=="string"&&!t.includes("/")}function uc(t){return typeof t=="string"&&t.includes("/")}function oc(t){return typeof t=="string"}function ic(t){return typeof t=="string"&&Bt(t)==null}function sc(t){return typeof t=="string"&&Bt(t)!=null}function cc(t){return un(t)&&Bt(t)==null}function fc(t){return un(t)&&Bt(t)!=null}function lc(t){return y(t)!=null}function ac(t){return t instanceof RegExp}class on extends Error{constructor(e,n,r){super(e),this._data=n,this._cause=r}}function pc(t){return t instanceof on?t._data:null}function _c(t){return t instanceof Error?t.message:null}function dc(t){return t instanceof on?t._cause:null}function hc(t,e,n){return new on(t,e,n)}function xt(t){return Number.isInteger(t)}function Br(t){return typeof t=="number"}function yc(t){return Br(t)}const mc=xt;function xc(t){return xt(t)&&t>0}function gc(t){return xt(t)&&t>-1}function wc(t){return xt(t)&&t<0}function Dr(t){return t!=null&&t[Z]!==void 0?t[Z](t):null}function zr(t,e){return t!=null&&t[_t]!==void 0?t[_t](t,e):Wr(t,e)}function Ie(t,e){return t[Z]=()=>e,t[_t]=Wr,t}function Wr(t,e){if(typeof t=="function")return Ie(function(...r){return t.apply(this,r)},e);if(t?.[h]===T){const n=Object.assign(Object.create(Object.getPrototypeOf(t)),t);return Ie(n,e)}return Ie(F(t),e)}function Ac(t,e,...n){return zr(t,e(Dr(t),...n))}function bc(t){return t===!0||t===!1}function Fr(t){switch(y(t)){case M:case _:case I:case g:case B:case b:return!0}return!1}function Ic(t,e){return Fr(e)?ne(e):ne(pe(t,e))}function Sc(t,e){const n=R(t,e);if(n!==void 0)return Yt([e,n])}function Mc(t,e){return(t%e+e)%e}function Ec(t,e,...n){t=a(t);let r=e;for(const u of n)t(r)<t(u)||(r=u);return r}function qc(t,e,...n){t=a(t);let r=e;for(const u of n)t(r)>t(u)||(r=u);return r}function Lr(t){throw new Error(`Expected string, got: ${typeof t}`)}function Rc(t){if(he(t)){if(/^[+-]?\d+$/.test(t)){const e=parseInt(t);if(Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER)return e}return null}return Lr(t)}function kc(t){return he(t)?/^[\x00-\x20]*[+-]?NaN[\x00-\x20]*$/.test(t)?NaN:/^[\x00-\x20]*[+-]?(Infinity|((\d+\.?\d*|\.\d+)([eE][+-]?\d+)?)[dDfF]?)[\x00-\x20]*$/.test(t)?parseFloat(t):null:Lr(t)}function Pr(t){return t>=0?Math.floor(t):Math.ceil(t)}function Vr(t,e){const n=t%e;return Pr((t-n)/e)}function Yr(t,...e){if(e.length==0)for(;;){const n=t();if(m(rn(n))){t=n;continue}else return n}else return Yr(function(){return xr(t,e)})}function sn(t,...e){if(e.length===2){const n=e[0],r=e[1];return sn(t,n,n(),r)}else{let n=e[0];const r=e[1],u=e[2];n=t(n);const o=V(n,r,u);return n(o)}}function vc(t,e){const n={},r=f(t)[Symbol.iterator](),u=f(e)[Symbol.iterator]();let o,i;for(;o=r.next(),!(o.done||(i=u.next(),i.done));)n[o.value]=i.value;return n}function Tc(t){return K(t)?t:null}function Hr(t,e,n){const r=function*(u){if(yield u,m(t(u)))for(const o of f(e(u)))yield*r(o)};return A(function*(){yield*r(n)})}function Nc(t){return at(Xt(Me),Nt(Hr(Me,K,t)))}function Kc(t){return t!=null&&t[Mt]!==void 0?t[Mt](t):F(t)}function Qc(t){return t!=null&&t[qt]!==void 0?t[qt](t):t}const Ur=class Jr{constructor(e,n){this[h]=b,this[et]=!0,this._cmp=n??e?._cmp,e instanceof Jr&&e._cmp===this._cmp||(e=this._cmp?ee(this._cmp,e):ee(e));const u=new Set(e);this._elts=[...u],this._set=u,this.size=this._elts.length}add(e){if(this._set.has(e))return this;const n=this._elts,r=this._cmp;let u=!1;for(let o=0;o<n.length;o++)if((r?r(e,n[o]):D(e,n[o]))<=0){n.splice(o,0,e),u=!0;break}return u?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 jc(...t){return new Ur(t)}function Cc(t,...e){return new Ur(e,en(a(t)))}const Xr=class{constructor(e,n){if(this[h]=_,this[et]=!0,this._cmp=n??e?._cmp,this._map=new Map,this._keys=[],this.size=0,e)for(const[r,u]of e)this.set(r,u)}set(e,n){if(!this._map.has(e)){const r=this._keys,u=this._cmp;let o=0;for(;o<r.length&&(u?u(e,r[o]):D(e,r[o]))>0;)o++;r.splice(o,0,e)}return this._map.set(e,n),this.size=this._map.size,this}get(e){return this._map.get(e)}has(e){return this._map.has(e)}delete(e){return this._map.delete(e)&&(this._keys.splice(this._keys.indexOf(e),1),this.size=this._map.size),this}*keys(){yield*this._keys}*values(){for(const e of this._keys)yield this._map.get(e)}*entries(){for(const e of this._keys)yield[e,this._map.get(e)]}forEach(e){for(const n of this._keys)e(this._map.get(n),n,this)}clear(){this._map.clear(),this._keys=[],this.size=0}[Symbol.iterator](){return this.entries()}};function Oc(...t){const e=new Xr;for(let n=0;n<t.length;n+=2)e.set(t[n],t[n+1]);return e}function $c(t,...e){const n=new Xr(null,en(a(t)));for(let r=0;r<e.length;r+=2)n.set(e[r],e[r+1]);return n}function Ke(t,e,n){return r=>e(D(r,n),0)}function Zr(t,e,n=!0){let r=0;for(;r<t.length&&D(e,t[r])>0;r++);return r}function Gc([t,e,n]){const r=Ke(t,e,n);if(e===yn||e===mn){const u=[...t],o=Zr(u,n,!0);return u.splice(0,o),r(u[0])||u.splice(0,1),u}else return[..._e(r,t)]}function Bc([t,e,n,r,u]){const o=[...t],i=Zr(o,n,!0);o.splice(0,i);const s=Ke(t,r,u);return Ke(t,e,n)(o[0])||o.splice(0,1),[..._e(s,o)]}function Dc(...t){if(t.length===3)return Gc(t);if(t.length===5)return Bc(t)}function zc(t){return Math.abs(t)}function Wc(t){return Pr(t)}function Fc(t){return t}function Lc(t){return t}function Pc(t){return t}function Vc(t){return t}function Yc(t){return t}function Hc(t){return t!=null&&t.constructor}function Uc(t){return(e,n)=>{const r=t(e,n);return nt(r)?re(r):r}}function tu(t){const e=Uc(t);return(...n)=>{switch(n.length){case 0:return t();case 1:return t(n[0]);case 2:return V(e,n[0],n[1])}}}function eu(t,e){const n=Vr(t,e);return t-e*n}function Jc(t){const e=new Map;return(...n)=>{const r=[n.length,...n],u=Ze(e,r);if(u===void 0){const o=t(...n);return bn(e,r,o),o}else return u}}function Xc(t){if(t==null)return null;if(He(t))return C(t);if(Ue(t))return t[t.length-1];if(t[Re]!==void 0)return t[Re](t);throw jt("IStack.-peek",t)}function Zc(t){if(t==null)return null;if(He(t)){if(t.length===0)throw new Error("Can't pop empty list");return Nt(t)}else if(Ue(t)){if(t.length===0)throw new Error("Can't pop empty vector");const e=[...t];return e.pop(),e}else{if(t[ke]!==void 0)return t[ke](t);throw jt("IStack.-pop",t)}}function tf(t){if(t!=null&&E(t)){if(t.length===0)throw new Error("Can't pop empty vector");return t.pop(),t}if(t!=null&&t[ve]!==void 0)return t[ve](t);throw jt("ITransientVector.-pop!",t)}function ef(t,e){const n=le(t);if(n!=null&&n[N]!==void 0)return kt((u,o,i)=>u[N](u,e(o),i),n,t);const r=xn(t)||P;return kt((u,o,i)=>r(u,e(o),i),n,t),n}function nu(t,e){const n=le(t);if(n!=null&&n[N]!==void 0)return kt((u,o,i)=>u[N](u,o,e(i)),n,t);const r=xn(t)||P;return kt((u,o,i)=>r(u,o,e(i)),n,t),n}function nf(){return new Dt(crypto.randomUUID())}class Dt{constructor(e){this.uuid=e}toString(){return this.uuid}}function ru(t){return new Dt(t.toLowerCase())}function rf(t){return t instanceof Dt}const uf=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;function of(t){if(typeof t!="string")throw new Error("Expected string, got: "+(t===null?"nil":typeof t));return uf.test(t)?ru(t):null}function sf(t){return t instanceof Date}const cf=t=>t._deref();class cn{constructor(e){this.f=e,this[ze]=!0,this[O]=cf}_deref(){return this.realized?this.v:(this.v=this.f(),this.realized=!0,this.v)}}function ff(t){if(t instanceof cn||t instanceof x)return t.realized===!0;throw new Error("realized? not supported on: "+Be(t))}function lf(t){return t instanceof cn?t._deref():t}function Lt(t,e){if(e.has(t))return t;if(e.add(t),t!=null&&t[Te]!==void 0)return t[Te](t,r=>Lt(r,e));if(jr(t))return nu(t,r=>Lt(r,e));const n=y(t);return n&&n!=I&&n!=g?se(r=>Lt(r,e),t):t}function af(t){return Lt(t,new Set)}function pf(t,e){V((n,r)=>t(r),null,e)}function _f(...t){return De(Tt(...t))}const df=t=>t.v;class hf{constructor(e){this.v=e,this[O]=df}}function yf(t){return new hf(t)}function mf(t,e){return t.v=e,e}function Q(t,e=new WeakSet,n=!0){if(t==null)return"nil";if(typeof t=="number")return t===1/0?"##Inf":t===-1/0?"##-Inf":Number.isNaN(t)?"##NaN":String(t);if(typeof t=="boolean")return String(t);if(typeof t=="string")return n?JSON.stringify(t):t;if(typeof t=="bigint")return`${t}N`;if(typeof t=="object"){if(t instanceof Dt)return n?`#uuid "${t.uuid}"`:t.uuid;if(e.has(t))return"#object[circular]";e.add(t);const r=y(t);let u,o;switch(r){case M:o=`[${t.map(i=>Q(i,e,n)).join(" ")}]`;break;case b:o=`#{${Array.from(t).map(i=>Q(i,e,n)).join(" ")}}`;break;case _:o=`#js/Map {${Array.from(t.entries()).map(([i,s])=>`${Q(i,e,n)} ${Q(s,e,n)}`).join(", ")}}`;break;case T:case B:o=`(${se(i=>`${Q(i,e,n)}`,t).join(", ")})`;break;default:if(t[qe]!==void 0){let i="";const s={[Ht]:(c,l)=>i+=l,[Hn.__sym]:!0};t[qe](t,s,{readably:n}),o=i;break}if(t[Le.__sym]!==void 0){u=Object.keys(t),o=`#${t.constructor.name}{${u.map(i=>`:${i} ${Q(t[i],e,n)}`).join(", ")}}`;break}if(t.constructor&&t.constructor!==Object)return e.delete(t),`#<${t.constructor.name}>`;u=Object.keys(t),o=`{${u.map(i=>`:${i} ${Q(t[i],e,n)}`).join(", ")}}`}return e.delete(t),o}return`#object[${t.constructor.name}]`}function ye(...t){return t.map((e,n)=>Q(e)).join(" ")}function xf(...t){ft.val(ye(...t)),Ce.val&&ft.val(`
`)}function gf(...t){return ye(...t)+`
`}return fu(wf);})();