UNPKG

squint-cljs

Version:

<img src="./logo/logo.svg" width="100%">

3 lines 60.2 kB
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:()=>q,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:()=>Ne,IEquiv:()=>ao,IEquiv__equiv:()=>R,IHash:()=>wo,IHash__hash:()=>Ee,IIndexed:()=>Co,IIndexed__nth:()=>wt,IIterable:()=>jn,IIterable__iterator:()=>Qu,IKVReduce:()=>co,IKVReduce__kv_reduce:()=>$,ILookup:()=>oo,ILookup__lookup:()=>H,IMap:()=>zn,IMap__dissoc:()=>X,IMeta:()=>xo,IMeta__meta:()=>Z,IPrintWithWriter:()=>Ko,IPrintWithWriter__pr_writer:()=>Re,IRecord:()=>Le,IReset:()=>pr,IReset__reset_BANG_:()=>dt,ISeqable:()=>uo,ISeqable__seq:()=>At,ISet:()=>Fn,ISet__disjoin:()=>St,IStack:()=>jo,IStack__peek:()=>ke,IStack__pop:()=>Te,ISwap:()=>_r,ISwap__swap_BANG_:()=>j,ITransientAssociative:()=>ho,ITransientAssociative__assoc_BANG_:()=>ot,ITransientCollection:()=>_o,ITransientCollection__conj_BANG_:()=>Et,ITransientCollection__persistent_BANG_:()=>Rt,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:()=>Yn,IWriter__write:()=>Yt,LazySeq:()=>os,NaN_QMARK_:()=>Vs,PROTOCOL_SENTINEL:()=>eo,UUID:()=>Wt,_:()=>du,_EQ_:()=>Nt,_GT_:()=>yn,_GT__EQ_:()=>mn,_LT_:()=>lu,_LT__EQ_:()=>au,_PLUS_:()=>pu,_SLASH_:()=>hu,_STAR_:()=>_u,_STAR_print_err_fn_STAR_:()=>ku,_STAR_print_fn_STAR_:()=>ft,_STAR_print_newline_STAR_:()=>Ce,__protocol_satisfies:()=>yu,__toFn:()=>a,_add_watch:()=>Pe,_as_transient:()=>ir,_assoc:()=>Jn,_assoc_BANG_:()=>fr,_conj:()=>er,_conj_BANG_:()=>sr,_contains_key_QMARK_:()=>Xn,_count:()=>Ut,_deref:()=>ze,_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:()=>He,_reset_BANG_:()=>Ve,_seq:()=>ur,_swap_BANG_:()=>dr,_write:()=>Fe,abs:()=>Dc,aclone:()=>Is,add_watch:()=>Ts,alength:()=>gs,any_QMARK_:()=>zs,apply:()=>xr,array:()=>ri,array_QMARK_:()=>Ue,array_map:()=>Au,aset:()=>ws,assoc:()=>ct,assoc_BANG_:()=>V,assoc_in:()=>An,assoc_in_BANG_:()=>bn,associative_QMARK_:()=>qs,atom:()=>Lo,boolean$:()=>_s,boolean_QMARK_:()=>bc,bounded_count:()=>Ic,butlast:()=>is,byte$:()=>Pc,cat:()=>tu,char$:()=>li,char_QMARK_:()=>fi,clj__GT_js:()=>af,coll_QMARK_:()=>lc,comp:()=>In,compare:()=>W,compare_and_set_BANG_:()=>Jo,complement:()=>Xt,concat:()=>di,conj:()=>Mn,conj_BANG_:()=>L,cons:()=>Fu,constantly:()=>pi,contains_QMARK_:()=>Rn,count:()=>ne,counted_QMARK_:()=>Fr,cycle:()=>Qi,dec:()=>Ru,dedupe:()=>Bi,deref:()=>rt,disj:()=>En,disj_BANG_:()=>je,dissoc:()=>Tn,dissoc_BANG_:()=>kn,distinct:()=>$i,distinct_QMARK_:()=>Fs,doall:()=>bs,dorun:()=>As,double$:()=>Lc,double_QMARK_:()=>Br,double_array:()=>Rs,drop:()=>de,drop_last:()=>ss,drop_while:()=>vr,empty:()=>le,empty_QMARK_:()=>Zi,ensure_reduced:()=>Tr,equiv:()=>Ao,es6_iterator:()=>T,even_QMARK_:()=>gr,every_QMARK_:()=>Nr,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:()=>qc,float$:()=>Fc,float_QMARK_:()=>yc,float_array:()=>Es,fn_QMARK_:()=>rn,fnext:()=>Ou,fnil:()=>tn,force:()=>lf,frequencies:()=>us,get:()=>k,get_in:()=>Ze,get_validator:()=>Vo,group_by:()=>rs,hash:()=>kt,hash_map:()=>gn,hash_ordered_coll:()=>To,hash_set:()=>si,hash_unordered_coll:()=>vo,ident_QMARK_:()=>oc,identical_QMARK_:()=>Ri,identity:()=>Ar,ifn_QMARK_:()=>Ds,inc:()=>vn,inst_QMARK_:()=>sf,int_QMARK_:()=>xt,int_array:()=>Ss,integer_QMARK_:()=>mc,interleave:()=>br,interpose:()=>mi,into:()=>kr,into_array:()=>Cr,iterable:()=>f,iterate:()=>js,js_keys:()=>Ps,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_:()=>Ye,list_STAR_:()=>_i,long$:()=>zc,long_array:()=>Ms,map:()=>lt,map_QMARK_:()=>jr,map_entry_QMARK_:()=>Ku,map_indexed:()=>Yu,mapcat:()=>hi,mapv:()=>se,max:()=>Qr,max_key:()=>Rc,memoize:()=>Jc,merge:()=>Si,merge_with:()=>Mi,meta:()=>Wr,min:()=>Ns,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:()=>We,not_EQ_:()=>_f,not_any_QMARK_:()=>Ji,not_empty:()=>Nc,not_every_QMARK_:()=>zi,nth:()=>Kn,nthnext:()=>$s,nthrest:()=>Gs,num:()=>Vc,number_QMARK_:()=>$r,object_QMARK_:()=>wn,object_array:()=>ks,odd_QMARK_:()=>ai,parse_boolean:()=>ds,parse_double:()=>Tc,parse_long:()=>kc,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:()=>Nu,pr_str:()=>ye,print:()=>Nn,print_str:()=>qn,println:()=>Tu,println_str:()=>vu,prn:()=>xf,prn_str:()=>gf,qualified_ident_QMARK_:()=>sc,qualified_keyword_QMARK_:()=>uc,qualified_symbol_QMARK_:()=>fc,quot:()=>Pr,rand:()=>qe,rand_int:()=>Kr,rand_nth:()=>ts,random_sample:()=>Vu,random_uuid:()=>nf,range:()=>Xo,re_find:()=>ti,re_matches:()=>Zo,re_pattern:()=>ei,re_seq:()=>Ls,realized_QMARK_:()=>ff,record_QMARK_:()=>Go,reduce:()=>P,reduce_kv:()=>Tt,reduced:()=>re,reduced_QMARK_:()=>nt,reductions:()=>Du,regexp_QMARK_:()=>ac,rem:()=>eu,remove:()=>Pu,remove_watch:()=>vs,repeat:()=>Xe,repeatedly:()=>ns,replace:()=>Xi,req_BANG_:()=>bu,reset_BANG_:()=>Ct,reset_vals_BANG_:()=>Uo,rest:()=>qt,reverse:()=>Vi,reversible_QMARK_:()=>Pi,rseq:()=>Hi,run_BANG_:()=>pf,satisfies_QMARK_:()=>mu,second:()=>ju,select_keys:()=>xi,seq:()=>K,seq_QMARK_:()=>qu,seq_to_map_for_destructuring:()=>Su,seqable_QMARK_:()=>Oe,sequential_QMARK_:()=>Me,set:()=>oi,set_QMARK_:()=>ii,set_validator_BANG_:()=>Po,short$:()=>Hc,shuffle:()=>Ui,simple_ident_QMARK_:()=>ic,simple_keyword_QMARK_:()=>rc,simple_symbol_QMARK_:()=>cc,some:()=>qr,some_QMARK_:()=>ps,some_fn:()=>Qs,some_vals:()=>Iu,sort:()=>ee,sort_by:()=>Yi,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:()=>Wc,subvec:()=>ni,swap_BANG_:()=>Ho,swap_vals_BANG_:()=>Yo,symbol:()=>tc,symbol_QMARK_:()=>un,system_time:()=>Ei,t:()=>Ws,take:()=>pe,take_last:()=>Ti,take_nth:()=>qi,take_while:()=>_e,to_array:()=>Bs,trampoline:()=>Hr,transduce:()=>sn,transient$:()=>Kc,tree_seq:()=>Yr,true_QMARK_:()=>ls,truth_:()=>m,type:()=>Yc,unchecked_add_int:()=>Xs,unchecked_dec_int:()=>Js,unchecked_inc_int:()=>Us,unchecked_int:()=>Ys,unreduced:()=>Je,update:()=>Wi,update_BANG_:()=>nn,update_in:()=>Di,update_keys:()=>ef,update_vals:()=>nu,uuid:()=>ru,uuid_QMARK_:()=>rf,val:()=>Rr,vals:()=>Hs,var_QMARK_:()=>nc,vary_meta:()=>Ac,vec:()=>Ot,vector:()=>ie,vector_QMARK_:()=>ui,volatile_BANG_:()=>yf,vreset_BANG_:()=>mf,warn_on_lazy_reusage_BANG_:()=>zu,with_meta:()=>Dr,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)=>k(e,t,n);switch(y(t)){case _:case M:case I:case b:return(e,n)=>k(t,e,n);case g:if(t[H]!==void 0)return(e,n)=>k(t,e,n)}return t}var Se=Object.prototype.hasOwnProperty;function fn(t,e,n){for(n of t.keys())if(z(n,e))return n}function ln(t){return t!=null&&t[et]===!0&&t[h]===_}function Dt(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 zt(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--&&z(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)||!z(t[u],e[u]))return!1;return Object.keys(e).length===r}function z(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[R]!==void 0)return!!t[R](t,e);if(typeof e=="object"&&e[R]!==void 0)return!!e[R](e,t);const u=ln(t);if(u||ln(e)){const o=u?t:e,i=o===t?e:t;if(!Ft(i)||zt(o)!==zt(i))return!1;for(const s of o.keys())if(!an(i,s)||!z(o.get(s),xe(i,s)))return!1;return!0}if(Ft(t)&&Ft(e)&&t.constructor!==e.constructor){if(zt(t)!==zt(e))return!1;for(const o of t instanceof Map?t.keys():Object.keys(t))if(!an(e,o)||!z(xe(t,o),xe(e,o)))return!1;return!0}if(Dt(t)||Dt(e)){if(!Dt(t)||!Dt(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)||!z(o[1],e.get(r)))return!1;return!0}if((!n||typeof t=="object")&&t[h]!==N)return pn(t,e,Object)}if(t&&e&&(Array.isArray(t)||t[h]===N)&&(Array.isArray(e)||e[h]===N)){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(!z(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 Nt(...t){return vt(t,(e,n)=>z(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 V(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[q]!==void 0){let o=t[q](t,e,n);for(let i=0;i<r.length;i+=2)o=o[q](o,r[i],r[i+1]);return o}const u=F(t);return V(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=k(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,N=6,g=7,h=Symbol("squint.lang.type"),et=Symbol("squint.lang.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 N: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[H]!==void 0?d=s[H](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=k(r,o);i===void 0&&(i=Qe(u),V(r,o,i)),r=i}return V(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))Pt(u),n.set(u[0],u[1]);else for(const o of Vt(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))Pt(u),n[u[0]]=u[1];else for(const o of Vt(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*Vt(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 Pt(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))Pt(i),u.set(i[0],i[1]);else for(const s of Vt(i))u.set(s[0],s[1]);return S(r,u);case N: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))Pt(i),o[i[0]]=i[1];else for(const s of Vt(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 Rn(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 kn(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):kn(n,r);return n}for(const n of e)delete t[n];return t}function Tn(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):Tn(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 Ru(t){return t-1}const Ce={val:!1},ft={val:t=>console.log(t)},ku={val:t=>console.error(t)};function Nn(...t){ft.val(t.map(e=>Q(e,void 0,!1)).join(" "))}function Tu(...t){Nn(...t),Ce.val&&ft.val(` `)}function qn(...t){return t.map(e=>Q(e,void 0,!1)).join(" ")}function vu(...t){return qn(...t)+` `}function Nu(...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 k(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[H]!==void 0)return r=t[H](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 qu(t){return t!=null&&!!t[Symbol.iterator]}function Me(t){return Array.isArray(t)||t?.[h]===N||t!=null&&t[Qt.__sym]!==void 0}function Oe(t){return t==null||wn(t)||!!t[Symbol.iterator]||!!t[Dn]}const Qn=Symbol("squint.lang.map-entry");function Ht(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(Ht);throw new TypeError(`${t} is not iterable`)}const jn=Symbol("Iterable"),Qu=Symbol.iterator;function Cn(t){return t[Symbol.iterator]()}const T=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(Ht);if(e[X]!==void 0){const r=[...e].map(Ht);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 qt(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 P(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*Wu(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 Du(t,e,n){if(t=a(t),arguments.length===2){const u=T(f(e));return A(function*(){yield*Wu(t,u)})}const r=T(f(n));return A(function*(){yield*On(t,e,r)})}function zu(){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]=N,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 Y(t,e){const n=T(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(T(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=T(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]=N,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=T(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=>T(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 Vu(t,e){return arguments.length===1?at(n=>qe()<t):at(n=>qe()<t,e)}function Pu(t,e){return arguments.length===1?Bn(Xt(t)):at(Xt(t),e)}function Hu(t){return v(e=>{let n=-1;return(r,u)=>e(r,t(++n,u))})}function Yu(t,e){return t=a(t),arguments.length===1?Hu(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 We(t){return!m(t)}function to(t){return t==null}const eo={},Wn=Symbol("squint.core.IAtom"),De=Symbol("squint.core.IDeref"),Dn=Symbol("squint.core.ISeqable"),no={__sym:Wn},ro={__sym:De},O=Symbol("IDeref_-deref");function ze(t){return t!=null&&t[O]!==void 0?t[O](t):p(ze,"IDeref.-deref",t)(t)}const uo={__sym:Dn},At=Symbol("ISeqable_-seq"),oo={__sym:Symbol("squint.core.ILookup")},H=Symbol("ILookup_-lookup"),io={__sym:Symbol("squint.core.IAssociative")},q=Symbol("IAssociative_-assoc"),bt=Symbol("IAssociative_-contains-key?"),zn={__sym:Symbol("squint.core.IMap")},X=Symbol("IMap_-dissoc"),so={__sym:Symbol("squint.core.ICounted")},It=Symbol("ICounted_-count"),co={__sym:Symbol("squint.core.IKVReduce")},$=Symbol("IKVReduce_-kv-reduce"),fo={__sym:Symbol("squint.core.ICollection")},w=Symbol("ICollection_-conj"),lo={__sym:Symbol("squint.core.IEmptyableCollection")},pt=Symbol("IEmptyableCollection_-empty"),ao={__sym:Symbol("squint.core.IEquiv")},R=Symbol("IEquiv_-equiv"),Fn={__sym:Symbol("squint.core.ISet")},St=Symbol("ISet_-disjoin"),po={__sym:Symbol("squint.core.IEditableCollection")},Mt=Symbol("IEditableCollection_-as-transient"),_o={__sym:Symbol("squint.core.ITransientCollection")},Et=Symbol("ITransientCollection_-conj!"),Rt=Symbol("ITransientCollection_-persistent!"),ho={__sym:Symbol("squint.core.ITransientAssociative")},ot=Symbol("ITransientAssociative_-assoc!"),yo={__sym:Symbol("squint.core.ITransientMap")},it=Symbol("ITransientMap_-dissoc!"),mo={__sym:Symbol("squint.core.ITransientSet")},st=Symbol("ITransientSet_-disjoin!"),xo={__sym:Symbol("squint.core.IMeta")},Z=Symbol("IMeta_-meta"),go={__sym:Symbol("squint.core.IWithMeta")},_t=Symbol("IWithMeta_-with-meta"),wo={__sym:Symbol("squint.core.IHash")},Ee=Symbol("IHash_-hash");function Ao(t,e){return t===e?!0:t==null?e==null:e==null||typeof t!="object"||typeof e!="object"?!1:t[R]!==void 0?!!t[R](t,e):e[R]!==void 0?!!e[R](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 Vn(t){return G(Ln(G(t|0,Io),15),So)}function Pn(t,e){return G(Ln((t|0)^(e|0),13),5)+-430675100|0}function Hn(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:Hn(Pn(0,Vn(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 Ro(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 ko(t){return Ae.f64[0]=t,Ae.i32[0]^Ae.i32[1]|0}function oe(t,e){return Hn(Pn(0,Vn(t)),e)}function To(t){let e=0,n=1;for(const r of t)n=G(31,n)+kt(r)|0,e++;return oe(n,e)}function vo(t){let e=0,n=0;for(const r of t)n=n+kt(r)|0,e++;return oe(n,e)}function No(t,e){return oe(G(31,G(31,1)+kt(t)|0)+kt(e)|0,2)}function qo(t){let e=0,n=0;for(const[r,u]of t)n=n+No(r,u)|0,e++;return oe(n,e)}function kt(t){if(t==null)return 0;switch(typeof t){case"number":return Number.isFinite(t)?Number.isSafeInteger(t)?t%2147483647|0:ko(t):t===1/0?2146435072:t===-1/0?-1048576:2146959360;case"boolean":return t?1231:1237;case"string":return Mo(Ro(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[R]!==void 0?qo(Object.entries(t)):hn(t)|0}const Yn={__sym:Symbol("squint.core.IWriter")},Yt=Symbol("IWriter_-write"),Ko={__sym:Symbol("squint.core.IPrintWithWriter")},Re=Symbol("IPrintWithWriter_-pr-writer");function Fe(t,e){return t!=null&&t[Yt]!==void 0?t[Yt](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("squint.core.IStack")},ke=Symbol("IStack_-peek"),Te=Symbol("IStack_-pop"),Co={__sym:Symbol("squint.core.IIndexed")},wt=Symbol("IIndexed_-nth"),Oo={__sym:Symbol("squint.core.ITransientVector")},ve=Symbol("ITransientVector_-pop!"),Qt={__sym:Symbol("squint.core.IVector")},$o={__sym:Symbol("squint.core.IEncodeJS")},Ne=Symbol("IEncodeJS_-clj->js"),Le={__sym:Symbol("squint.core.IRecord")};function Go(t){return t!=null&&t[Le.__sym]!==void 0}function Un(t,e,n){return t!=null&&t[H]!==void 0?t[H](t,e,n):p(Un,"ILookup.-lookup",t)(t,e,n)}function Jn(t,e,n){return t!=null&&t[q]!==void 0?t[q](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[R]!==void 0?t[R](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[Rt]!==void 0?t[Rt](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("squint.core.IReset")},dt=Symbol("IReset_-reset!");function Ve(t,e){return t!=null&&t[dt]!==void 0?t[dt](t,e):p(Ve,"IReset.-reset!",t)(t,e)}const _r={__sym:Symbol("squint.core.ISwap")},j=Symbol("ISwap_-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("squint.core.IWatchable")},ht=Symbol("IWatchable_-add-watch"),yt=Symbol("IWatchable_-remove-watch"),Jt=Symbol("IWatchable_-notify-watches");function Pe(t,e,n){return t!=null&&t[ht]!==void 0?t[ht](t,e,n):p(Pe,"IWatchable.-add-watch",t)(t,e,n)}function He(t,e){return t!=null&&t[yt]!==void 0?t[yt](t,e):p(He,"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},Wo=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))}},Do=(t,e,n)=>{t._watches[e]=n,t._hasWatches=!0},zo=(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[Wn]=!0,this[De]=!0,this[O]=Bo,this[pr.__sym]=!0,this[dt]=gt,this[_r.__sym]=!0,this[j]=Wo,this[hr.__sym]=!0,this[ht]=Do,this[yt]=zo,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 Vo(t){return t._validator??null}function Po(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(ze,"IDeref.-deref",t)(t)}function Ct(t,e){return t?.[dt]!==void 0?t[dt](t,e):p(Ve,"IReset.-reset!",t)(t,e)}function Ho(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 Yo(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 D=[];let J=d;for(;D.length<ue&&c(J);)D.push(J),J+=o;return[D,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)=>We(t(...e))}function pi(t){return(...e)=>t}class $t extends Array{constructor(...e){super(),this[h]=B,this.push(...e)}}function Ye(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:T(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 D=Math.min(d+ue,l.length);return[l.slice(d,D),i({a:l,pos:D})]}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=>T(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=k(t,u);o!==void 0&&V(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 Y(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 D=[...n];n=[];const J=e(s,D);return nt(J)||n.push(c),J}}}}}function Ii(t,e){if(t=a(t),arguments.length===1)return bi(t);const n=T(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=kr(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 Rr(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=Rr(i);return Rn(o,s)?ct(o,s,t(k(o,s),c)):ct(o,s,c)};return P((o,i)=>P(r,o||{},K(i)),e)}else return null}function Ei(){return performance.now()}function kr(...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?P((i,s)=>i!=null&&i[w]!==void 0?i[w](i,s):L(i,s),e,t[1]):P(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 Ri(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 Tr(t){return nt(t)?t:re(t)}function ki(t){return v(e=>{let n=t;return(r,u)=>{const o=--n+1;return o>0&&(r=e(r,u)),o>1?r:Tr(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?ki(t):Y(e,function*(n){let r=t-1;for(const u of n)if(r-->=0&&(yield u),r<0)return})}function Ti(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):Y(e,function*(n){for(const r of n)if(m(t(r)))yield r;else return})}function Ni(t){return v(e=>{let n=-1;return(r,u)=>eu(++n,t)===0?e(r,u):r})}function qi(t,e){return ae(t),arguments.length===1?Ni(t):t<=0?Xe(C(e)):Y(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):Y(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):Y(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():Y(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(Nt(e,r));return e=r,u?n:t(n,r)}})}function Bi(t){return arguments.length===0?Gi():Y(t,function*(e){let n=te;for(const r of e)(n===te||!m(Nt(n,r)))&&(yield r),n=r})}function Wi(t,e,n,...r){return n=a(n),ct(t,e,n(k(t,e),...r))}function Ze(t,e,n){let r=t;for(const u of f(e))r=k(r,u);return r===void 0?n:r}function Di(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 Nr(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 zi(t,e){return!Nr(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 Vi(t){return fe(t).reverse()}function Pi(t){return E(t)||t!=null&&t[et]===!0}function Hi(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||W)}function en(t){return t===W?t:(e,n)=>{const r=t(e,n);return $r(r)?r:r?-1:t(n,e)?1:0}}function Yi(t,e,n){return arguments.length===2&&(n=e,e=W),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 qr(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),!qr(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 qe(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=k(t,e);return V(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(T(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]===N)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 Rs(t,e){return Gt(t,e)}function ks(t,e){return Gt(t,e)}function Ts(t,e,n){return t?.[ht]!==void 0?(t[ht](t,e,n),t):(p(Pe,"IWatchable.-add-watch",t)(t,e,n),t)}function vs(t,e){return t?.[yt]!==void 0?(t[yt](t,e),t):(p(He,"IWatchable.-remove-watch",t)(t,e),t)}function Tt(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 Ns(t,...e){let n=t;for(const r of e)n=isNaN(n)?n:isNaN(r)?r:n<r?n:r;return n}function qs(t){switch(y(t)){case _:case M:case I:return!0;case g:return t[q]!==void 0;default:return!1}}function jr(t){return t==null?!1:!!(mt(t)||t instanceof Map||t[h]===_||t[zn.__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(qt(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=qt(n),e=e-1;return n}function W(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=W(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 Ws=m;function Or(t,e,n){return t.substring(e,n)}function rn(t){return typeof t=="function"}function Ds(t){return rn(t)}function zs(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(Nt(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 Vs(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 Ps(t){return Gr(t)??[]}function Hs(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?Arra