numpy-ts 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,413 +1,2 @@
1
- "use strict";var Wh=Object.create;var he=Object.defineProperty;var Zh=Object.getOwnPropertyDescriptor;var Jh=Object.getOwnPropertyNames;var Hh=Object.getPrototypeOf,Xh=Object.prototype.hasOwnProperty;var l=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Qh=(e,r)=>{for(var t in r)he(e,t,{get:r[t],enumerable:!0})},Dn=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Jh(r))!Xh.call(e,i)&&i!==t&&he(e,i,{get:()=>r[i],enumerable:!(n=Zh(r,i))||n.enumerable});return e};var Kh=(e,r,t)=>(t=e!=null?Wh(Hh(e)):{},Dn(r||!e||!e.__esModule?he(t,"default",{value:e,enumerable:!0}):t,e)),rg=e=>Dn(he({},"__esModule",{value:!0}),e);var oi=l((g1,ai)=>{"use strict";var xg=Object;ai.exports=xg});var ui=l((v1,si)=>{"use strict";var Eg=oi();si.exports=Eg});var li=l((b1,fi)=>{"use strict";var Sg=/./;fi.exports=Sg});var pi=l((d1,ci)=>{"use strict";var _g=typeof Object.defineProperty=="function"?Object.defineProperty:null;ci.exports=_g});var mi=l((w1,yi)=>{"use strict";var Tg=pi();function qg(){try{return Tg({},"x",{}),!0}catch{return!1}}yi.exports=qg});var gi=l((A1,hi)=>{"use strict";var Ig=Object.defineProperty;hi.exports=Ig});var Ke=l((x1,vi)=>{"use strict";function Dg(e){return typeof e=="number"}vi.exports=Dg});var rt=l((E1,di)=>{"use strict";function Ng(e){return e[0]==="-"}function bi(e){var r="",t;for(t=0;t<e;t++)r+="0";return r}function Bg(e,r,t){var n=!1,i=r-e.length;return i<0||(Ng(e)&&(n=!0,e=e.substr(1)),e=t?e+bi(i):bi(i)+e,n&&(e="-"+e)),e}di.exports=Bg});var Ei=l((S1,xi)=>{"use strict";var Og=Ke(),wi=rt(),Vg=String.prototype.toLowerCase,Ai=String.prototype.toUpperCase;function Ug(e){var r,t,n;switch(e.specifier){case"b":r=2;break;case"o":r=8;break;case"x":case"X":r=16;break;case"d":case"i":case"u":default:r=10;break}if(t=e.arg,n=parseInt(t,10),!isFinite(n)){if(!Og(t))throw new Error("invalid integer. Value: "+t);n=0}return n<0&&(e.specifier==="u"||r!==10)&&(n=4294967295+n+1),n<0?(t=(-n).toString(r),e.precision&&(t=wi(t,e.precision,e.padRight)),t="-"+t):(t=n.toString(r),!n&&!e.precision?t="":e.precision&&(t=wi(t,e.precision,e.padRight)),e.sign&&(t=e.sign+t)),r===16&&(e.alternate&&(t="0x"+t),t=e.specifier===Ai.call(e.specifier)?Ai.call(t):Vg.call(t)),r===8&&e.alternate&&t.charAt(0)!=="0"&&(t="0"+t),t}xi.exports=Ug});var _i=l((_1,Si)=>{"use strict";function zg(e){return typeof e=="string"}Si.exports=zg});var Ii=l((T1,qi)=>{"use strict";var Fg=Ke(),Rg=Math.abs,jg=String.prototype.toLowerCase,Ti=String.prototype.toUpperCase,Dr=String.prototype.replace,Cg=/e\+(\d)$/,Lg=/e-(\d)$/,Mg=/^(\d+)$/,Pg=/^(\d+)e/,kg=/\.0$/,$g=/\.0*e/,Gg=/(\..*[^0])0*e/;function Yg(e){var r,t,n=parseFloat(e.arg);if(!isFinite(n)){if(!Fg(e.arg))throw new Error("invalid floating-point number. Value: "+t);n=e.arg}switch(e.specifier){case"e":case"E":t=n.toExponential(e.precision);break;case"f":case"F":t=n.toFixed(e.precision);break;case"g":case"G":Rg(n)<1e-4?(r=e.precision,r>0&&(r-=1),t=n.toExponential(r)):t=n.toPrecision(e.precision),e.alternate||(t=Dr.call(t,Gg,"$1e"),t=Dr.call(t,$g,"e"),t=Dr.call(t,kg,""));break;default:throw new Error("invalid double notation. Value: "+e.specifier)}return t=Dr.call(t,Cg,"e+0$1"),t=Dr.call(t,Lg,"e-0$1"),e.alternate&&(t=Dr.call(t,Mg,"$1."),t=Dr.call(t,Pg,"$1.e")),n>=0&&e.sign&&(t=e.sign+t),t=e.specifier===Ti.call(e.specifier)?Ti.call(t):jg.call(t),t}qi.exports=Yg});var Bi=l((q1,Ni)=>{"use strict";function Di(e){var r="",t;for(t=0;t<e;t++)r+=" ";return r}function Wg(e,r,t){var n=r-e.length;return n<0||(e=t?e+Di(n):Di(n)+e),e}Ni.exports=Wg});var Vi=l((I1,Oi)=>{"use strict";var Zg=Ei(),Jg=_i(),Hg=Ii(),Xg=Bi(),Qg=rt(),Kg=String.fromCharCode,rv=Array.isArray;function ve(e){return e!==e}function ev(e){var r={};return r.specifier=e.specifier,r.precision=e.precision===void 0?1:e.precision,r.width=e.width,r.flags=e.flags||"",r.mapping=e.mapping,r}function tv(e){var r,t,n,i,a,s,o,f,u;if(!rv(e))throw new TypeError("invalid argument. First argument must be an array. Value: `"+e+"`.");for(s="",o=1,f=0;f<e.length;f++)if(n=e[f],Jg(n))s+=n;else{if(r=n.precision!==void 0,n=ev(n),!n.specifier)throw new TypeError("invalid argument. Token is missing `specifier` property. Index: `"+f+"`. Value: `"+n+"`.");for(n.mapping&&(o=n.mapping),t=n.flags,u=0;u<t.length;u++)switch(i=t.charAt(u),i){case" ":n.sign=" ";break;case"+":n.sign="+";break;case"-":n.padRight=!0,n.padZeros=!1;break;case"0":n.padZeros=t.indexOf("-")<0;break;case"#":n.alternate=!0;break;default:throw new Error("invalid flag: "+i)}if(n.width==="*"){if(n.width=parseInt(arguments[o],10),o+=1,ve(n.width))throw new TypeError("the argument for * width at position "+o+" is not a number. Value: `"+n.width+"`.");n.width<0&&(n.padRight=!0,n.width=-n.width)}if(r&&n.precision==="*"){if(n.precision=parseInt(arguments[o],10),o+=1,ve(n.precision))throw new TypeError("the argument for * precision at position "+o+" is not a number. Value: `"+n.precision+"`.");n.precision<0&&(n.precision=1,r=!1)}switch(n.arg=arguments[o],n.specifier){case"b":case"o":case"x":case"X":case"d":case"i":case"u":r&&(n.padZeros=!1),n.arg=Zg(n);break;case"s":n.maxWidth=r?n.precision:-1,n.arg=String(n.arg);break;case"c":if(!ve(n.arg)){if(a=parseInt(n.arg,10),a<0||a>127)throw new Error("invalid character code. Value: "+n.arg);n.arg=ve(a)?String(n.arg):Kg(a)}break;case"e":case"E":case"f":case"F":case"g":case"G":r||(n.precision=6),n.arg=Hg(n);break;default:throw new Error("invalid specifier: "+n.specifier)}n.maxWidth>=0&&n.arg.length>n.maxWidth&&(n.arg=n.arg.substring(0,n.maxWidth)),n.padZeros?n.arg=Qg(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=Xg(n.arg,n.width,n.padRight)),s+=n.arg||"",o+=1}return s}Oi.exports=tv});var zi=l((D1,Ui)=>{"use strict";var nv=Vi();Ui.exports=nv});var Ri=l((N1,Fi)=>{"use strict";var be=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function iv(e){var r={mapping:e[1]?parseInt(e[1],10):void 0,flags:e[2],width:e[3],precision:e[5],specifier:e[6]};return e[4]==="."&&e[5]===void 0&&(r.precision="1"),r}function av(e){var r,t,n,i;for(t=[],i=0,n=be.exec(e);n;)r=e.slice(i,be.lastIndex-n[0].length),r.length&&t.push(r),t.push(iv(n)),i=be.lastIndex,n=be.exec(e);return r=e.slice(i),r.length&&t.push(r),t}Fi.exports=av});var Ci=l((B1,ji)=>{"use strict";var ov=Ri();ji.exports=ov});var Mi=l((O1,Li)=>{"use strict";function sv(e){return typeof e=="string"}Li.exports=sv});var $i=l((V1,ki)=>{"use strict";var uv=zi(),fv=Ci(),lv=Mi();function Pi(e){var r,t;if(!lv(e))throw new TypeError(Pi("invalid argument. First argument must be a string. Value: `%s`.",e));for(r=[fv(e)],t=1;t<arguments.length;t++)r.push(arguments[t]);return uv.apply(null,r)}ki.exports=Pi});var J=l((U1,Gi)=>{"use strict";var cv=$i();Gi.exports=cv});var Xi=l((z1,Hi)=>{"use strict";var Yi=J(),Fr=Object.prototype,Wi=Fr.toString,Zi=Fr.__defineGetter__,Ji=Fr.__defineSetter__,pv=Fr.__lookupGetter__,yv=Fr.__lookupSetter__;function mv(e,r,t){var n,i,a,s;if(typeof e!="object"||e===null||Wi.call(e)==="[object Array]")throw new TypeError(Yi("invalid argument. First argument must be an object. Value: `%s`.",e));if(typeof t!="object"||t===null||Wi.call(t)==="[object Array]")throw new TypeError(Yi("invalid argument. Property descriptor must be an object. Value: `%s`.",t));if(i="value"in t,i&&(pv.call(e,r)||yv.call(e,r)?(n=e.__proto__,e.__proto__=Fr,delete e[r],e[r]=t.value,e.__proto__=n):e[r]=t.value),a="get"in t,s="set"in t,i&&(a||s))throw new Error("invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.");return a&&Zi&&Zi.call(e,r,t.get),s&&Ji&&Ji.call(e,r,t.set),e}Hi.exports=mv});var Pr=l((F1,Qi)=>{"use strict";var hv=mi(),gv=gi(),vv=Xi(),et;hv()?et=gv:et=vv;Qi.exports=et});var ra=l((R1,Ki)=>{"use strict";var bv=Pr();function dv(e,r,t){bv(e,r,{configurable:!1,enumerable:!1,writable:!1,value:t})}Ki.exports=dv});var W=l((j1,ea)=>{"use strict";var wv=ra();ea.exports=wv});var tt=l((C1,ta)=>{"use strict";function Av(e){return typeof e=="boolean"}ta.exports=Av});var ia=l((L1,na)=>{"use strict";function xv(){return typeof Symbol=="function"&&typeof Symbol("foo")=="symbol"}na.exports=xv});var oa=l((M1,aa)=>{"use strict";var Ev=ia();aa.exports=Ev});var ua=l((P1,sa)=>{"use strict";var Sv=oa(),_v=Sv();function Tv(){return _v&&typeof Symbol.toStringTag=="symbol"}sa.exports=Tv});var kr=l((k1,fa)=>{"use strict";var qv=ua();fa.exports=qv});var nt=l(($1,la)=>{"use strict";var Iv=Object.prototype.toString;la.exports=Iv});var pa=l((G1,ca)=>{"use strict";var Dv=nt();function Nv(e){return Dv.call(e)}ca.exports=Nv});var ma=l((Y1,ya)=>{"use strict";var Bv=Object.prototype.hasOwnProperty;function Ov(e,r){return e==null?!1:Bv.call(e,r)}ya.exports=Ov});var it=l((W1,ha)=>{"use strict";var Vv=ma();ha.exports=Vv});var va=l((Z1,ga)=>{"use strict";var Uv=typeof Symbol=="function"?Symbol:void 0;ga.exports=Uv});var at=l((J1,ba)=>{"use strict";var zv=va();ba.exports=zv});var Aa=l((H1,wa)=>{"use strict";var da=at(),Fv=typeof da=="function"?da.toStringTag:"";wa.exports=Fv});var Ea=l((X1,xa)=>{"use strict";var Rv=it(),$r=Aa(),ot=nt();function jv(e){var r,t,n;if(e==null)return ot.call(e);t=e[$r],r=Rv(e,$r);try{e[$r]=void 0}catch{return ot.call(e)}return n=ot.call(e),r?e[$r]=t:delete e[$r],n}xa.exports=jv});var Z=l((Q1,Sa)=>{"use strict";var Cv=kr(),Lv=pa(),Mv=Ea(),st;Cv()?st=Mv:st=Lv;Sa.exports=st});var Ta=l((K1,_a)=>{"use strict";var Pv=Boolean;_a.exports=Pv});var Rr=l((rq,qa)=>{"use strict";var kv=Ta();qa.exports=kv});var Da=l((eq,Ia)=>{"use strict";var $v=Boolean.prototype.toString;Ia.exports=$v});var Ba=l((tq,Na)=>{"use strict";var Gv=Da();function Yv(e){try{return Gv.call(e),!0}catch{return!1}}Na.exports=Yv});var ut=l((nq,Oa)=>{"use strict";var Wv=kr(),Zv=Z(),Jv=Rr(),Hv=Ba(),Xv=Wv();function Qv(e){return typeof e=="object"?e instanceof Jv?!0:Xv?Hv(e):Zv(e)==="[object Boolean]":!1}Oa.exports=Qv});var Ua=l((iq,Va)=>{"use strict";var Kv=tt(),rb=ut();function eb(e){return Kv(e)||rb(e)}Va.exports=eb});var lt=l((aq,Fa)=>{"use strict";var za=W(),ft=Ua(),tb=tt(),nb=ut();za(ft,"isPrimitive",tb);za(ft,"isObject",nb);Fa.exports=ft});var ja=l((oq,Ra)=>{"use strict";function ib(){return new Function("return this;")()}Ra.exports=ib});var La=l((sq,Ca)=>{"use strict";var ab=typeof self=="object"?self:null;Ca.exports=ab});var Pa=l((uq,Ma)=>{"use strict";var ob=typeof window=="object"?window:null;Ma.exports=ob});var $a=l((fq,ka)=>{"use strict";var sb=typeof global=="object"?global:null;ka.exports=sb});var Ya=l((lq,Ga)=>{"use strict";var ub=typeof globalThis=="object"?globalThis:null;Ga.exports=ub});var Qa=l((cq,Xa)=>{"use strict";var fb=lt().isPrimitive,lb=J(),cb=ja(),Wa=La(),Za=Pa(),Ja=$a(),Ha=Ya();function pb(e){if(arguments.length){if(!fb(e))throw new TypeError(lb("invalid argument. Must provide a boolean. Value: `%s`.",e));if(e)return cb()}if(Ha)return Ha;if(Wa)return Wa;if(Za)return Za;if(Ja)return Ja;throw new Error("unexpected error. Unable to resolve global object.")}Xa.exports=pb});var ro=l((pq,Ka)=>{"use strict";var yb=Qa();Ka.exports=yb});var no=l((yq,to)=>{"use strict";var mb=ro(),eo=mb(),hb=eo.document&&eo.document.childNodes;to.exports=hb});var ao=l((mq,io)=>{"use strict";var gb=Int8Array;io.exports=gb});var so=l((hq,oo)=>{"use strict";var vb=li(),bb=no(),db=ao();function wb(){return typeof vb=="function"||typeof db=="object"||typeof bb=="function"}oo.exports=wb});var ct=l((gq,uo)=>{"use strict";function Ab(){return/^\s*function\s*([^(]*)/i}uo.exports=Ab});var lo=l((vq,fo)=>{"use strict";var xb=ct(),Eb=xb();fo.exports=Eb});var yo=l((bq,po)=>{"use strict";var Sb=W(),co=ct(),_b=lo();Sb(co,"REGEXP",_b);po.exports=co});var ho=l((dq,mo)=>{"use strict";var Tb=Z(),pt;function qb(e){return Tb(e)==="[object Array]"}Array.isArray?pt=Array.isArray:pt=qb;mo.exports=pt});var jr=l((wq,go)=>{"use strict";var Ib=ho();go.exports=Ib});var bo=l((Aq,vo)=>{"use strict";var Db=jr(),Nb=J();function Bb(e){if(typeof e!="function")throw new TypeError(Nb("invalid argument. Must provide a function. Value: `%s`.",e));return r;function r(t){var n,i;if(!Db(t)||(n=t.length,n===0))return!1;for(i=0;i<n;i++)if(e(t[i])===!1)return!1;return!0}}vo.exports=Bb});var yt=l((xq,wo)=>{"use strict";var Ob=bo();wo.exports=Ob});var xo=l((Eq,Ao)=>{"use strict";function Vb(e){return e!==null&&typeof e=="object"}Ao.exports=Vb});var So=l((Sq,Eo)=>{"use strict";var Ub=W(),zb=yt(),mt=xo(),Fb=zb(mt);Ub(mt,"isObjectLikeArray",Fb);Eo.exports=mt});var To=l((_q,_o)=>{"use strict";var Rb=So();function jb(e){return Rb(e)&&(e._isBuffer||e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))}_o.exports=jb});var ht=l((Tq,qo)=>{"use strict";var Cb=To();qo.exports=Cb});var Do=l((qq,Io)=>{"use strict";var Lb=Z(),Mb=yo().REGEXP,Pb=ht();function kb(e){var r,t,n;if(t=Lb(e).slice(8,-1),(t==="Object"||t==="Error")&&e.constructor){if(n=e.constructor,typeof n.name=="string")return n.name;if(r=Mb.exec(n.toString()),r)return r[1]}return Pb(e)?"Buffer":t}Io.exports=kb});var de=l((Iq,No)=>{"use strict";var $b=Do();No.exports=$b});var Oo=l((Dq,Bo)=>{"use strict";var Gb=de();function Yb(e){var r;return e===null?"null":(r=typeof e,r==="object"?Gb(e).toLowerCase():r)}Bo.exports=Yb});var Uo=l((Nq,Vo)=>{"use strict";var Wb=de();function Zb(e){return Wb(e).toLowerCase()}Vo.exports=Zb});var Fo=l((Bq,zo)=>{"use strict";var Jb=so(),Hb=Oo(),Xb=Uo(),Qb=Jb()?Xb:Hb;zo.exports=Qb});var jo=l((Oq,Ro)=>{"use strict";var Kb=Fo();function rd(e){return Kb(e)==="function"}Ro.exports=rd});var Gr=l((Vq,Co)=>{"use strict";var ed=jo();Co.exports=ed});var Mo=l((Uq,Lo)=>{"use strict";var td=Object.getPrototypeOf;Lo.exports=td});var ko=l((zq,Po)=>{"use strict";function nd(e){return e.__proto__}Po.exports=nd});var Go=l((Fq,$o)=>{"use strict";var id=Z(),ad=ko();function od(e){var r=ad(e);return r||r===null?r:id(e.constructor)==="[object Function]"?e.constructor.prototype:e instanceof Object?Object.prototype:null}$o.exports=od});var Wo=l((Rq,Yo)=>{"use strict";var sd=Gr(),ud=Mo(),fd=Go(),gt;sd(Object.getPrototypeOf)?gt=ud:gt=fd;Yo.exports=gt});var Jo=l((jq,Zo)=>{"use strict";var ld=ui(),cd=Wo();function pd(e){return e==null?null:(e=ld(e),cd(e))}Zo.exports=pd});var Xo=l((Cq,Ho)=>{"use strict";var yd=Jo();Ho.exports=yd});var Ko=l((Lq,Qo)=>{"use strict";var md=Xo(),hd=Z();function gd(e){if(typeof e!="object"||e===null)return!1;if(e instanceof Error)return!0;for(;e;){if(hd(e)==="[object Error]")return!0;e=md(e)}return!1}Qo.exports=gd});var we=l((Mq,rs)=>{"use strict";var vd=Ko();rs.exports=vd});var ts=l((Pq,es)=>{"use strict";var bd=we();function dd(e){try{return require(e)}catch(r){return bd(r)?r:typeof r=="object"?new Error(JSON.stringify(r)):new Error(r.toString())}}es.exports=dd});var vt=l((kq,ns)=>{"use strict";var wd=ts();ns.exports=wd});var as=l(($q,is)=>{"use strict";function Ad(e,r){return e>r?e:r}is.exports=Ad});var ss=l((Gq,os)=>{"use strict";var xd=as();os.exports=xd});var ls=l((Yq,fs)=>{"use strict";var us="function";function Ed(e){return typeof e.get===us&&typeof e.set===us}fs.exports=Ed});var bt=l((Wq,cs)=>{"use strict";var Sd=ls();cs.exports=Sd});var ms=l((Zq,ys)=>{"use strict";var ps={complex128:_d,complex64:Td,default:qd};function _d(e,r){return e.get(r)}function Td(e,r){return e.get(r)}function qd(e,r){return e.get(r)}function Id(e){var r=ps[e];return typeof r=="function"?r:ps.default}ys.exports=Id});var Cr=l((Jq,hs)=>{"use strict";var Dd=ms();hs.exports=Dd});var bs=l((Hq,vs)=>{"use strict";var gs={float64:Nd,float32:Bd,int32:Od,int16:Vd,int8:Ud,uint32:zd,uint16:Fd,uint8:Rd,uint8c:jd,generic:Cd,default:Ld};function Nd(e,r){return e[r]}function Bd(e,r){return e[r]}function Od(e,r){return e[r]}function Vd(e,r){return e[r]}function Ud(e,r){return e[r]}function zd(e,r){return e[r]}function Fd(e,r){return e[r]}function Rd(e,r){return e[r]}function jd(e,r){return e[r]}function Cd(e,r){return e[r]}function Ld(e,r){return e[r]}function Md(e){var r=gs[e];return typeof r=="function"?r:gs.default}vs.exports=Md});var Yr=l((Xq,ds)=>{"use strict";var Pd=bs();ds.exports=Pd});var As=l((Qq,ws)=>{"use strict";var kd={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128",BooleanArray:"bool"};ws.exports=kd});var Es=l((Kq,xs)=>{"use strict";var $d=Z(),Gd=typeof Float64Array=="function";function Yd(e){return Gd&&e instanceof Float64Array||$d(e)==="[object Float64Array]"}xs.exports=Yd});var _s=l((rI,Ss)=>{"use strict";var Wd=Es();Ss.exports=Wd});var qs=l((eI,Ts)=>{"use strict";var Zd=typeof Float64Array=="function"?Float64Array:null;Ts.exports=Zd});var Ns=l((tI,Ds)=>{"use strict";var Jd=_s(),Is=qs();function Hd(){var e,r;if(typeof Is!="function")return!1;try{r=new Is([1,3.14,-3.14,NaN]),e=Jd(r)&&r[0]===1&&r[1]===3.14&&r[2]===-3.14&&r[3]!==r[3]}catch{e=!1}return e}Ds.exports=Hd});var Os=l((nI,Bs)=>{"use strict";var Xd=Ns();Bs.exports=Xd});var Us=l((iI,Vs)=>{"use strict";var Qd=typeof Float64Array=="function"?Float64Array:void 0;Vs.exports=Qd});var Fs=l((aI,zs)=>{"use strict";function Kd(){throw new Error("not implemented")}zs.exports=Kd});var Ae=l((oI,Rs)=>{"use strict";var rw=Os(),ew=Us(),tw=Fs(),dt;rw()?dt=ew:dt=tw;Rs.exports=dt});var Cs=l((sI,js)=>{"use strict";var nw=Z(),iw=typeof Float32Array=="function";function aw(e){return iw&&e instanceof Float32Array||nw(e)==="[object Float32Array]"}js.exports=aw});var Ms=l((uI,Ls)=>{"use strict";var ow=Cs();Ls.exports=ow});var wt=l((fI,Ps)=>{"use strict";var sw=Number.POSITIVE_INFINITY;Ps.exports=sw});var $s=l((lI,ks)=>{"use strict";var uw=typeof Float32Array=="function"?Float32Array:null;ks.exports=uw});var Ws=l((cI,Ys)=>{"use strict";var fw=Ms(),lw=wt(),Gs=$s();function cw(){var e,r;if(typeof Gs!="function")return!1;try{r=new Gs([1,3.14,-3.14,5e40]),e=fw(r)&&r[0]===1&&r[1]===3.140000104904175&&r[2]===-3.140000104904175&&r[3]===lw}catch{e=!1}return e}Ys.exports=cw});var Js=l((pI,Zs)=>{"use strict";var pw=Ws();Zs.exports=pw});var Xs=l((yI,Hs)=>{"use strict";var yw=typeof Float32Array=="function"?Float32Array:void 0;Hs.exports=yw});var Ks=l((mI,Qs)=>{"use strict";function mw(){throw new Error("not implemented")}Qs.exports=mw});var Wr=l((hI,ru)=>{"use strict";var hw=Js(),gw=Xs(),vw=Ks(),At;hw()?At=gw:At=vw;ru.exports=At});var tu=l((gI,eu)=>{"use strict";var bw=Z(),dw=typeof Uint32Array=="function";function ww(e){return dw&&e instanceof Uint32Array||bw(e)==="[object Uint32Array]"}eu.exports=ww});var iu=l((vI,nu)=>{"use strict";var Aw=tu();nu.exports=Aw});var ou=l((bI,au)=>{"use strict";var xw=4294967295;au.exports=xw});var uu=l((dI,su)=>{"use strict";var Ew=typeof Uint32Array=="function"?Uint32Array:null;su.exports=Ew});var cu=l((wI,lu)=>{"use strict";var Sw=iu(),xt=ou(),fu=uu();function _w(){var e,r;if(typeof fu!="function")return!1;try{r=[1,3.14,-3.14,xt+1,xt+2],r=new fu(r),e=Sw(r)&&r[0]===1&&r[1]===3&&r[2]===xt-2&&r[3]===0&&r[4]===1}catch{e=!1}return e}lu.exports=_w});var yu=l((AI,pu)=>{"use strict";var Tw=cu();pu.exports=Tw});var hu=l((xI,mu)=>{"use strict";var qw=typeof Uint32Array=="function"?Uint32Array:void 0;mu.exports=qw});var vu=l((EI,gu)=>{"use strict";function Iw(){throw new Error("not implemented")}gu.exports=Iw});var du=l((SI,bu)=>{"use strict";var Dw=yu(),Nw=hu(),Bw=vu(),Et;Dw()?Et=Nw:Et=Bw;bu.exports=Et});var Au=l((_I,wu)=>{"use strict";var Ow=Z(),Vw=typeof Int32Array=="function";function Uw(e){return Vw&&e instanceof Int32Array||Ow(e)==="[object Int32Array]"}wu.exports=Uw});var Eu=l((TI,xu)=>{"use strict";var zw=Au();xu.exports=zw});var _u=l((qI,Su)=>{"use strict";var Fw=2147483647;Su.exports=Fw});var qu=l((II,Tu)=>{"use strict";var Rw=-2147483648;Tu.exports=Rw});var Du=l((DI,Iu)=>{"use strict";var jw=typeof Int32Array=="function"?Int32Array:null;Iu.exports=jw});var Ou=l((NI,Bu)=>{"use strict";var Cw=Eu(),Lw=_u(),Mw=qu(),Nu=Du();function Pw(){var e,r;if(typeof Nu!="function")return!1;try{r=new Nu([1,3.14,-3.14,Lw+1]),e=Cw(r)&&r[0]===1&&r[1]===3&&r[2]===-3&&r[3]===Mw}catch{e=!1}return e}Bu.exports=Pw});var Uu=l((BI,Vu)=>{"use strict";var kw=Ou();Vu.exports=kw});var Fu=l((OI,zu)=>{"use strict";var $w=typeof Int32Array=="function"?Int32Array:void 0;zu.exports=$w});var ju=l((VI,Ru)=>{"use strict";function Gw(){throw new Error("not implemented")}Ru.exports=Gw});var Lu=l((UI,Cu)=>{"use strict";var Yw=Uu(),Ww=Fu(),Zw=ju(),St;Yw()?St=Ww:St=Zw;Cu.exports=St});var Pu=l((zI,Mu)=>{"use strict";var Jw=Z(),Hw=typeof Uint16Array=="function";function Xw(e){return Hw&&e instanceof Uint16Array||Jw(e)==="[object Uint16Array]"}Mu.exports=Xw});var $u=l((FI,ku)=>{"use strict";var Qw=Pu();ku.exports=Qw});var Yu=l((RI,Gu)=>{"use strict";var Kw=65535;Gu.exports=Kw});var Zu=l((jI,Wu)=>{"use strict";var rA=typeof Uint16Array=="function"?Uint16Array:null;Wu.exports=rA});var Xu=l((CI,Hu)=>{"use strict";var eA=$u(),_t=Yu(),Ju=Zu();function tA(){var e,r;if(typeof Ju!="function")return!1;try{r=[1,3.14,-3.14,_t+1,_t+2],r=new Ju(r),e=eA(r)&&r[0]===1&&r[1]===3&&r[2]===_t-2&&r[3]===0&&r[4]===1}catch{e=!1}return e}Hu.exports=tA});var Ku=l((LI,Qu)=>{"use strict";var nA=Xu();Qu.exports=nA});var ef=l((MI,rf)=>{"use strict";var iA=typeof Uint16Array=="function"?Uint16Array:void 0;rf.exports=iA});var nf=l((PI,tf)=>{"use strict";function aA(){throw new Error("not implemented")}tf.exports=aA});var of=l((kI,af)=>{"use strict";var oA=Ku(),sA=ef(),uA=nf(),Tt;oA()?Tt=sA:Tt=uA;af.exports=Tt});var uf=l(($I,sf)=>{"use strict";var fA=Z(),lA=typeof Int16Array=="function";function cA(e){return lA&&e instanceof Int16Array||fA(e)==="[object Int16Array]"}sf.exports=cA});var lf=l((GI,ff)=>{"use strict";var pA=uf();ff.exports=pA});var pf=l((YI,cf)=>{"use strict";var yA=32767;cf.exports=yA});var mf=l((WI,yf)=>{"use strict";var mA=-32768;yf.exports=mA});var gf=l((ZI,hf)=>{"use strict";var hA=typeof Int16Array=="function"?Int16Array:null;hf.exports=hA});var df=l((JI,bf)=>{"use strict";var gA=lf(),vA=pf(),bA=mf(),vf=gf();function dA(){var e,r;if(typeof vf!="function")return!1;try{r=new vf([1,3.14,-3.14,vA+1]),e=gA(r)&&r[0]===1&&r[1]===3&&r[2]===-3&&r[3]===bA}catch{e=!1}return e}bf.exports=dA});var Af=l((HI,wf)=>{"use strict";var wA=df();wf.exports=wA});var Ef=l((XI,xf)=>{"use strict";var AA=typeof Int16Array=="function"?Int16Array:void 0;xf.exports=AA});var _f=l((QI,Sf)=>{"use strict";function xA(){throw new Error("not implemented")}Sf.exports=xA});var qf=l((KI,Tf)=>{"use strict";var EA=Af(),SA=Ef(),_A=_f(),qt;EA()?qt=SA:qt=_A;Tf.exports=qt});var Df=l((r6,If)=>{"use strict";var TA=Z(),qA=typeof Uint8Array=="function";function IA(e){return qA&&e instanceof Uint8Array||TA(e)==="[object Uint8Array]"}If.exports=IA});var Bf=l((e6,Nf)=>{"use strict";var DA=Df();Nf.exports=DA});var Vf=l((t6,Of)=>{"use strict";var NA=255;Of.exports=NA});var zf=l((n6,Uf)=>{"use strict";var BA=typeof Uint8Array=="function"?Uint8Array:null;Uf.exports=BA});var jf=l((i6,Rf)=>{"use strict";var OA=Bf(),It=Vf(),Ff=zf();function VA(){var e,r;if(typeof Ff!="function")return!1;try{r=[1,3.14,-3.14,It+1,It+2],r=new Ff(r),e=OA(r)&&r[0]===1&&r[1]===3&&r[2]===It-2&&r[3]===0&&r[4]===1}catch{e=!1}return e}Rf.exports=VA});var Lf=l((a6,Cf)=>{"use strict";var UA=jf();Cf.exports=UA});var Pf=l((o6,Mf)=>{"use strict";var zA=typeof Uint8Array=="function"?Uint8Array:void 0;Mf.exports=zA});var $f=l((s6,kf)=>{"use strict";function FA(){throw new Error("not implemented")}kf.exports=FA});var Nt=l((u6,Gf)=>{"use strict";var RA=Lf(),jA=Pf(),CA=$f(),Dt;RA()?Dt=jA:Dt=CA;Gf.exports=Dt});var Wf=l((f6,Yf)=>{"use strict";var LA=Z(),MA=typeof Uint8ClampedArray=="function";function PA(e){return MA&&e instanceof Uint8ClampedArray||LA(e)==="[object Uint8ClampedArray]"}Yf.exports=PA});var Jf=l((l6,Zf)=>{"use strict";var kA=Wf();Zf.exports=kA});var Xf=l((c6,Hf)=>{"use strict";var $A=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:null;Hf.exports=$A});var rl=l((p6,Kf)=>{"use strict";var GA=Jf(),Qf=Xf();function YA(){var e,r;if(typeof Qf!="function")return!1;try{r=new Qf([-1,0,1,3.14,4.99,255,256]),e=GA(r)&&r[0]===0&&r[1]===0&&r[2]===1&&r[3]===3&&r[4]===5&&r[5]===255&&r[6]===255}catch{e=!1}return e}Kf.exports=YA});var tl=l((y6,el)=>{"use strict";var WA=rl();el.exports=WA});var il=l((m6,nl)=>{"use strict";var ZA=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:void 0;nl.exports=ZA});var ol=l((h6,al)=>{"use strict";function JA(){throw new Error("not implemented")}al.exports=JA});var ul=l((g6,sl)=>{"use strict";var HA=tl(),XA=il(),QA=ol(),Bt;HA()?Bt=XA:Bt=QA;sl.exports=Bt});var ll=l((v6,fl)=>{"use strict";var KA=Z(),r0=typeof Int8Array=="function";function e0(e){return r0&&e instanceof Int8Array||KA(e)==="[object Int8Array]"}fl.exports=e0});var pl=l((b6,cl)=>{"use strict";var t0=ll();cl.exports=t0});var ml=l((d6,yl)=>{"use strict";var n0=127;yl.exports=n0});var gl=l((w6,hl)=>{"use strict";var i0=-128;hl.exports=i0});var bl=l((A6,vl)=>{"use strict";var a0=typeof Int8Array=="function"?Int8Array:null;vl.exports=a0});var Al=l((x6,wl)=>{"use strict";var o0=pl(),s0=ml(),u0=gl(),dl=bl();function f0(){var e,r;if(typeof dl!="function")return!1;try{r=new dl([1,3.14,-3.14,s0+1]),e=o0(r)&&r[0]===1&&r[1]===3&&r[2]===-3&&r[3]===u0}catch{e=!1}return e}wl.exports=f0});var El=l((E6,xl)=>{"use strict";var l0=Al();xl.exports=l0});var _l=l((S6,Sl)=>{"use strict";var c0=typeof Int8Array=="function"?Int8Array:void 0;Sl.exports=c0});var ql=l((_6,Tl)=>{"use strict";function p0(){throw new Error("not implemented")}Tl.exports=p0});var Dl=l((T6,Il)=>{"use strict";var y0=El(),m0=_l(),h0=ql(),Ot;y0()?Ot=m0:Ot=h0;Il.exports=Ot});var Vt=l((q6,Nl)=>{"use strict";function g0(e){return typeof e=="number"}Nl.exports=g0});var Ol=l((I6,Bl)=>{"use strict";Bl.exports=Number});var xe=l((D6,Vl)=>{"use strict";var v0=Ol();Vl.exports=v0});var zl=l((N6,Ul)=>{"use strict";var b0=xe(),d0=b0.prototype.toString;Ul.exports=d0});var Rl=l((B6,Fl)=>{"use strict";var w0=zl();function A0(e){try{return w0.call(e),!0}catch{return!1}}Fl.exports=A0});var Ut=l((O6,jl)=>{"use strict";var x0=kr(),E0=Z(),S0=xe(),_0=Rl(),T0=x0();function q0(e){return typeof e=="object"?e instanceof S0?!0:T0?_0(e):E0(e)==="[object Number]":!1}jl.exports=q0});var Ll=l((V6,Cl)=>{"use strict";var I0=Vt(),D0=Ut();function N0(e){return I0(e)||D0(e)}Cl.exports=N0});var Zr=l((U6,Pl)=>{"use strict";var Ml=W(),zt=Ll(),B0=Vt(),O0=Ut();Ml(zt,"isPrimitive",B0);Ml(zt,"isObject",O0);Pl.exports=zt});var $l=l((z6,kl)=>{"use strict";var V0=xe(),U0=V0.NEGATIVE_INFINITY;kl.exports=U0});var Yl=l((F6,Gl)=>{"use strict";var z0=Math.floor;Gl.exports=z0});var Jr=l((R6,Wl)=>{"use strict";var F0=Yl();Wl.exports=F0});var Jl=l((j6,Zl)=>{"use strict";var R0=Jr();function j0(e){return R0(e)===e}Zl.exports=j0});var Nr=l((C6,Hl)=>{"use strict";var C0=Jl();Hl.exports=C0});var Ft=l((L6,Xl)=>{"use strict";var L0=wt(),M0=$l(),P0=Nr();function k0(e){return e<L0&&e>M0&&P0(e)}Xl.exports=k0});var Rt=l((M6,Ql)=>{"use strict";var $0=Zr().isPrimitive,G0=Ft();function Y0(e){return $0(e)&&G0(e)}Ql.exports=Y0});var jt=l((P6,Kl)=>{"use strict";var W0=Zr().isObject,Z0=Ft();function J0(e){return W0(e)&&Z0(e.valueOf())}Kl.exports=J0});var ec=l((k6,rc)=>{"use strict";var H0=Rt(),X0=jt();function Q0(e){return H0(e)||X0(e)}rc.exports=Q0});var Ee=l(($6,nc)=>{"use strict";var tc=W(),Ct=ec(),K0=Rt(),rx=jt();tc(Ct,"isPrimitive",K0);tc(Ct,"isObject",rx);nc.exports=Ct});var Lt=l((G6,ic)=>{"use strict";var ex=Ee().isPrimitive;function tx(e){return ex(e)&&e>=0}ic.exports=tx});var Mt=l((Y6,ac)=>{"use strict";var nx=Ee().isObject;function ix(e){return nx(e)&&e.valueOf()>=0}ac.exports=ix});var sc=l((W6,oc)=>{"use strict";var ax=Lt(),ox=Mt();function sx(e){return ax(e)||ox(e)}oc.exports=sx});var Se=l((Z6,fc)=>{"use strict";var uc=W(),Pt=sc(),ux=Lt(),fx=Mt();uc(Pt,"isPrimitive",ux);uc(Pt,"isObject",fx);fc.exports=Pt});var cc=l((J6,lc)=>{"use strict";var lx=4294967295;lc.exports=lx});var yc=l((H6,pc)=>{"use strict";var cx=Nr(),px=cc();function yx(e){return typeof e=="object"&&e!==null&&typeof e.length=="number"&&cx(e.length)&&e.length>=0&&e.length<=px}pc.exports=yx});var Br=l((X6,mc)=>{"use strict";var mx=yc();mc.exports=mx});var gc=l((Q6,hc)=>{"use strict";var hx=9007199254740991;hc.exports=hx});var bc=l((K6,vc)=>{"use strict";var gx=Nr(),vx=gc();function bx(e){return typeof e=="object"&&e!==null&&typeof e.length=="number"&&gx(e.length)&&e.length>=0&&e.length<=vx}vc.exports=bx});var Hr=l((r2,dc)=>{"use strict";var dx=bc();dc.exports=dx});var Ac=l((e2,wc)=>{"use strict";var wx=Z(),Ax=typeof ArrayBuffer=="function";function xx(e){return Ax&&e instanceof ArrayBuffer||wx(e)==="[object ArrayBuffer]"}wc.exports=xx});var _e=l((t2,xc)=>{"use strict";var Ex=Ac();xc.exports=Ex});var Sc=l((n2,Ec)=>{"use strict";var Sx=jr();function _x(e){return typeof e=="object"&&e!==null&&!Sx(e)}Ec.exports=_x});var Te=l((i2,_c)=>{"use strict";var Tx=Sc();_c.exports=Tx});var kt=l((a2,Tc)=>{"use strict";function qx(e){return typeof e=="string"}Tc.exports=qx});var Ic=l((o2,qc)=>{"use strict";var Ix=String.prototype.valueOf;qc.exports=Ix});var Nc=l((s2,Dc)=>{"use strict";var Dx=Ic();function Nx(e){try{return Dx.call(e),!0}catch{return!1}}Dc.exports=Nx});var $t=l((u2,Bc)=>{"use strict";var Bx=kr(),Ox=Z(),Vx=Nc(),Ux=Bx();function zx(e){return typeof e=="object"?e instanceof String?!0:Ux?Vx(e):Ox(e)==="[object String]":!1}Bc.exports=zx});var Vc=l((f2,Oc)=>{"use strict";var Fx=kt(),Rx=$t();function jx(e){return Fx(e)||Rx(e)}Oc.exports=jx});var Xr=l((l2,zc)=>{"use strict";var Uc=W(),Gt=Vc(),Cx=kt(),Lx=$t();Uc(Gt,"isPrimitive",Cx);Uc(Gt,"isObject",Lx);zc.exports=Gt});var qe=l((c2,Rc)=>{"use strict";var Fc=W(),Yt=yt(),Wt=Xr(),Mx=Yt(Wt.isPrimitive),Px=Yt(Wt.isObject),Zt=Yt(Wt);Fc(Zt,"primitives",Mx);Fc(Zt,"objects",Px);Rc.exports=Zt});var Cc=l((p2,jc)=>{"use strict";function kx(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i",e}jc.exports=kx});var Mc=l((y2,Lc)=>{"use strict";function $x(){var e={};return e.type="Complex128",e.re=this.re,e.im=this.im,e}Lc.exports=$x});var Yc=l((m2,Gc)=>{"use strict";var Pc=Zr().isPrimitive,kc=Pr(),Qr=W(),$c=J(),Gx=Cc(),Yx=Mc();function Or(e,r){if(!(this instanceof Or))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Pc(e))throw new TypeError($c("invalid argument. Real component must be a number. Value: `%s`.",e));if(!Pc(r))throw new TypeError($c("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return kc(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:e}),kc(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:r}),this}Qr(Or,"BYTES_PER_ELEMENT",8);Qr(Or.prototype,"BYTES_PER_ELEMENT",8);Qr(Or.prototype,"byteLength",16);Qr(Or.prototype,"toString",Gx);Qr(Or.prototype,"toJSON",Yx);Gc.exports=Or});var Jt=l((h2,Wc)=>{"use strict";var Wx=Yc();Wc.exports=Wx});var Jc=l((g2,Zc)=>{"use strict";var Zx=typeof Math.fround=="function"?Math.fround:null;Zc.exports=Zx});var Qc=l((v2,Xc)=>{"use strict";var Jx=Wr(),Hc=new Jx(1);function Hx(e){return Hc[0]=e,Hc[0]}Xc.exports=Hx});var ep=l((b2,rp)=>{"use strict";var Kc=Jc(),Xx=Qc(),Ht;typeof Kc=="function"?Ht=Kc:Ht=Xx;rp.exports=Ht});var np=l((d2,tp)=>{"use strict";function Qx(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i",e}tp.exports=Qx});var ap=l((w2,ip)=>{"use strict";function Kx(){var e={};return e.type="Complex64",e.re=this.re,e.im=this.im,e}ip.exports=Kx});var cp=l((A2,lp)=>{"use strict";var op=Zr().isPrimitive,sp=Pr(),Kr=W(),up=ep(),fp=J(),rE=np(),eE=ap();function Vr(e,r){if(!(this instanceof Vr))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!op(e))throw new TypeError(fp("invalid argument. Real component must be a number. Value: `%s`.",e));if(!op(r))throw new TypeError(fp("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return sp(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:up(e)}),sp(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:up(r)}),this}Kr(Vr,"BYTES_PER_ELEMENT",4);Kr(Vr.prototype,"BYTES_PER_ELEMENT",4);Kr(Vr.prototype,"byteLength",8);Kr(Vr.prototype,"toString",rE);Kr(Vr.prototype,"toJSON",eE);lp.exports=Vr});var Xt=l((x2,pp)=>{"use strict";var tE=cp();pp.exports=tE});var mp=l((E2,yp)=>{"use strict";var nE=Jt(),iE=Xt();function aE(e){return e instanceof nE||e instanceof iE?!0:typeof e=="object"&&e!==null&&typeof e.re=="number"&&typeof e.im=="number"}yp.exports=aE});var br=l((S2,hp)=>{"use strict";var oE=mp();hp.exports=oE});var vp=l((_2,gp)=>{"use strict";var sE=Nr();function uE(e){return sE(e/2)}gp.exports=uE});var Qt=l((T2,bp)=>{"use strict";var fE=vp();bp.exports=fE});var wp=l((q2,dp)=>{"use strict";var lE=8;function cE(e){return typeof e=="object"&&e!==null&&e.constructor.name==="Complex64Array"&&e.BYTES_PER_ELEMENT===lE}dp.exports=cE});var Kt=l((I2,Ap)=>{"use strict";var pE=wp();Ap.exports=pE});var Ep=l((D2,xp)=>{"use strict";var yE=16;function mE(e){return typeof e=="object"&&e!==null&&e.constructor.name==="Complex128Array"&&e.BYTES_PER_ELEMENT===yE}xp.exports=mE});var rn=l((N2,Sp)=>{"use strict";var hE=Ep();Sp.exports=hE});var Tp=l((B2,_p)=>{"use strict";var gE=it(),Ie=at();function vE(){return typeof Ie=="function"&&typeof Ie("foo")=="symbol"&&gE(Ie,"iterator")&&typeof Ie.iterator=="symbol"}_p.exports=vE});var re=l((O2,qp)=>{"use strict";var bE=Tp();qp.exports=bE});var Dp=l((V2,Ip)=>{"use strict";var dE=re(),wE=dE()?Symbol.iterator:null;Ip.exports=wE});var De=l((U2,Np)=>{"use strict";var AE=Dp();Np.exports=AE});var Op=l((z2,Bp)=>{"use strict";var xE=Pr();function EE(e,r,t){xE(e,r,{configurable:!1,enumerable:!1,get:t})}Bp.exports=EE});var Ne=l((F2,Vp)=>{"use strict";var SE=Op();Vp.exports=SE});var zp=l((R2,Up)=>{"use strict";function _E(e){return e.re}Up.exports=_E});var ee=l((j2,Fp)=>{"use strict";var TE=zp();Fp.exports=TE});var jp=l((C2,Rp)=>{"use strict";function qE(e){return e.im}Rp.exports=qE});var te=l((L2,Cp)=>{"use strict";var IE=jp();Cp.exports=IE});var Mp=l((M2,Lp)=>{"use strict";var DE=Wr();function NE(e,r){return new DE(e.buffer,e.byteOffset+e.BYTES_PER_ELEMENT*r,2*(e.length-r))}Lp.exports=NE});var en=l((P2,Pp)=>{"use strict";var BE=Mp();Pp.exports=BE});var $p=l((k2,kp)=>{"use strict";var OE=Ae();function VE(e,r){return new OE(e.buffer,e.byteOffset+e.BYTES_PER_ELEMENT*r,2*(e.length-r))}kp.exports=VE});var tn=l(($2,Gp)=>{"use strict";var UE=$p();Gp.exports=UE});var Wp=l((G2,Yp)=>{"use strict";var zE=Br(),FE=br(),RE=ee(),jE=te(),CE=J();function LE(e){var r,t,n;for(r=[];t=e.next(),!t.done;)if(n=t.value,zE(n)&&n.length>=2)r.push(n[0],n[1]);else if(FE(n))r.push(RE(n),jE(n));else return new TypeError(CE("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));return r}Yp.exports=LE});var Jp=l((Y2,Zp)=>{"use strict";var ME=Br(),PE=br(),kE=ee(),$E=te(),GE=J();function YE(e,r,t){var n,i,a,s;for(n=[],s=-1;i=e.next(),!i.done;)if(s+=1,a=r.call(t,i.value,s),ME(a)&&a.length>=2)n.push(a[0],a[1]);else if(PE(a))n.push(kE(a),$E(a));else return new TypeError(GE("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));return n}Zp.exports=YE});var Xp=l((W2,Hp)=>{"use strict";var WE=br(),ZE=ee(),JE=te();function HE(e,r){var t,n,i,a;for(t=r.length,a=0,i=0;i<t;i++){if(n=r[i],!WE(n))return null;e[a]=ZE(n),e[a+1]=JE(n),a+=2}return e}Hp.exports=HE});var iy=l((Z2,ny)=>{"use strict";var ne=Se().isPrimitive,nn=Br(),an=Hr(),Qp=_e(),on=Te(),XE=jr(),QE=qe().primitives,Kp=Xr().isPrimitive,$=Gr(),ir=br(),Be=Qt(),Q=Nr(),KE=Kt(),rS=rn(),eS=re(),yr=De(),I=W(),Oe=Ne(),nr=Wr(),tS=Xt(),x=J(),ur=ee(),fr=te(),nS=Jr(),iS=en(),aS=tn(),oS=Yr(),sS=Cr(),ry=Wp(),uS=Jp(),fS=Xp(),er=nr.BYTES_PER_ELEMENT*2,ey=eS();function V(e){return e instanceof _||typeof e=="object"&&e!==null&&(e.constructor.name==="Complex64Array"||e.constructor.name==="Complex128Array")&&typeof e._length=="number"&&typeof e._buffer=="object"}function ty(e){return e===_||e.name==="Complex128Array"}function C(e,r){return r*=2,new tS(e[r],e[r+1])}function _(){var e,r,t,n;if(r=arguments.length,!(this instanceof _))return r===0?new _:r===1?new _(arguments[0]):r===2?new _(arguments[0],arguments[1]):new _(arguments[0],arguments[1],arguments[2]);if(r===0)t=new nr(0);else if(r===1)if(ne(arguments[0]))t=new nr(arguments[0]*2);else if(an(arguments[0]))if(t=arguments[0],n=t.length,n&&XE(t)&&ir(t[0])){if(t=fS(new nr(n*2),t),t===null){if(!Be(n))throw new RangeError(x("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new nr(arguments[0])}}else{if(KE(t))t=iS(t,0);else if(rS(t))t=aS(t,0);else if(!Be(n))throw new RangeError(x("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new nr(t)}else if(Qp(arguments[0])){if(t=arguments[0],!Q(t.byteLength/er))throw new RangeError(x("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",er,t.byteLength));t=new nr(t)}else if(on(arguments[0])){if(t=arguments[0],ey===!1)throw new TypeError(x("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",t));if(!$(t[yr]))throw new TypeError(x("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(t=t[yr](),!$(t.next))throw new TypeError(x("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(t=ry(t),t instanceof Error)throw t;t=new nr(t)}else throw new TypeError(x("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));else{if(t=arguments[0],!Qp(t))throw new TypeError(x("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(e=arguments[1],!ne(e))throw new TypeError(x("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(!Q(e/er))throw new RangeError(x("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",er,e));if(r===2){if(n=t.byteLength-e,!Q(n/er))throw new RangeError(x("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",er,n));t=new nr(t,e)}else{if(n=arguments[2],!ne(n))throw new TypeError(x("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*er>t.byteLength-e)throw new RangeError(x("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*er));t=new nr(t,e,n*2)}}return I(this,"_buffer",t),I(this,"_length",t.length/2),this}I(_,"BYTES_PER_ELEMENT",er);I(_,"name","Complex64Array");I(_,"from",function(r){var t,n,i,a,s,o,f,u,c,p,y,m;if(!$(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ty(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=arguments.length,n>1){if(i=arguments[1],!$(i))throw new TypeError(x("invalid argument. Second argument must be a function. Value: `%s`.",i));n>2&&(t=arguments[2])}if(V(r)){if(u=r.length,i){for(a=new this(u),s=a._buffer,m=0,y=0;y<u;y++){if(p=i.call(t,r.get(y),y),ir(p))s[m]=ur(p),s[m+1]=fr(p);else if(nn(p)&&p.length>=2)s[m]=p[0],s[m+1]=p[1];else throw new TypeError(x("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",p));m+=2}return a}return new this(r)}if(an(r)){if(i){for(u=r.length,r.get&&r.set?f=sS("default"):f=oS("default"),y=0;y<u;y++)if(!ir(f(r,y))){c=!0;break}if(c){if(!Be(u))throw new RangeError(x("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,u));for(a=new this(u/2),s=a._buffer,y=0;y<u;y++)s[y]=i.call(t,f(r,y),y);return a}for(a=new this(u),s=a._buffer,m=0,y=0;y<u;y++){if(p=i.call(t,f(r,y),y),ir(p))s[m]=ur(p),s[m+1]=fr(p);else if(nn(p)&&p.length>=2)s[m]=p[0],s[m+1]=p[1];else throw new TypeError(x("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",p));m+=2}return a}return new this(r)}if(on(r)&&ey&&$(r[yr])){if(s=r[yr](),!$(s.next))throw new TypeError(x("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(i?o=uS(s,i,t):o=ry(s),o instanceof Error)throw o;for(u=o.length/2,a=new this(u),s=a._buffer,y=0;y<u;y++)s[y]=o[y];return a}throw new TypeError(x("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))});I(_,"of",function(){var r,t;if(!$(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ty(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],t=0;t<arguments.length;t++)r.push(arguments[t]);return new this(r)});I(_.prototype,"at",function(r){if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Q(r))throw new TypeError(x("invalid argument. Must provide an integer. Value: `%s`.",r));if(r<0&&(r+=this._length),!(r<0||r>=this._length))return C(this._buffer,r)});Oe(_.prototype,"buffer",function(){return this._buffer.buffer});Oe(_.prototype,"byteLength",function(){return this._buffer.byteLength});Oe(_.prototype,"byteOffset",function(){return this._buffer.byteOffset});I(_.prototype,"BYTES_PER_ELEMENT",_.BYTES_PER_ELEMENT);I(_.prototype,"copyWithin",function(r,t){if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(r*2,t*2):this._buffer.copyWithin(r*2,t*2,arguments[2]*2),this});I(_.prototype,"entries",function(){var r,t,n,i,a,s;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,i=this._buffer,n=this._length,s=-1,t={},I(t,"next",o),I(t,"return",f),yr&&I(t,yr,u),t;function o(){return s+=1,a||s>=n?{done:!0}:{value:[s,C(i,s)],done:!1}}function f(c){return a=!0,arguments.length?{value:c,done:!0}:{done:!0}}function u(){return r.entries()}});I(_.prototype,"every",function(r,t){var n,i;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(!r.call(t,C(n,i),i,this))return!1;return!0});I(_.prototype,"fill",function(r,t,n){var i,a,s,o,f,u;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ir(r))throw new TypeError(x("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(i=this._buffer,a=this._length,arguments.length>1){if(!Q(t))throw new TypeError(x("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=a,t<0&&(t=0)),arguments.length>2){if(!Q(n))throw new TypeError(x("invalid argument. Third argument must be an integer. Value: `%s`.",n));n<0&&(n+=a,n<0&&(n=0)),n>a&&(n=a)}else n=a}else t=0,n=a;for(o=ur(r),f=fr(r),u=t;u<n;u++)s=2*u,i[s]=o,i[s+1]=f;return this});I(_.prototype,"filter",function(r,t){var n,i,a,s;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=[],a=0;a<this._length;a++)s=C(n,a),r.call(t,s,a,this)&&i.push(s);return new this.constructor(i)});I(_.prototype,"find",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(a=C(n,i),r.call(t,a,i,this))return a});I(_.prototype,"findIndex",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(a=C(n,i),r.call(t,a,i,this))return i;return-1});I(_.prototype,"findLast",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length-1;i>=0;i--)if(a=C(n,i),r.call(t,a,i,this))return a});I(_.prototype,"findLastIndex",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length-1;i>=0;i--)if(a=C(n,i),r.call(t,a,i,this))return i;return-1});I(_.prototype,"forEach",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)a=C(n,i),r.call(t,a,i,this)});I(_.prototype,"get",function(r){if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ne(r))throw new TypeError(x("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return C(this._buffer,r)});I(_.prototype,"includes",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ir(r))throw new TypeError(x("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Q(t))throw new TypeError(x("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(a=ur(r),s=fr(r),n=this._buffer,o=t;o<this._length;o++)if(i=2*o,a===n[i]&&s===n[i+1])return!0;return!1});I(_.prototype,"indexOf",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ir(r))throw new TypeError(x("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Q(t))throw new TypeError(x("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(a=ur(r),s=fr(r),n=this._buffer,o=t;o<this._length;o++)if(i=2*o,a===n[i]&&s===n[i+1])return o;return-1});I(_.prototype,"join",function(r){var t,n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(arguments.length===0)i=",";else if(Kp(r))i=r;else throw new TypeError(x("invalid argument. First argument must be a string. Value: `%s`.",r));for(t=[],n=this._buffer,a=0;a<this._length;a++)t.push(C(n,a).toString());return t.join(i)});I(_.prototype,"keys",function(){var r,t,n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,n=this._length,a=-1,t={},I(t,"next",s),I(t,"return",o),yr&&I(t,yr,f),t;function s(){return a+=1,i||a>=n?{done:!0}:{value:a,done:!1}}function o(u){return i=!0,arguments.length?{value:u,done:!0}:{done:!0}}function f(){return r.keys()}});I(_.prototype,"lastIndexOf",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ir(r))throw new TypeError(x("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Q(t))throw new TypeError(x("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(a=ur(r),s=fr(r),n=this._buffer,o=t;o>=0;o--)if(i=2*o,a===n[i]&&s===n[i+1])return o;return-1});Oe(_.prototype,"length",function(){return this._length});I(_.prototype,"map",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(i=this._buffer,a=new this.constructor(this._length),n=a._buffer,s=0;s<this._length;s++)if(o=r.call(t,C(i,s),s,this),ir(o))n[2*s]=ur(o),n[2*s+1]=fr(o);else if(nn(o)&&o.length===2)n[2*s]=o[0],n[2*s+1]=o[1];else throw new TypeError(x("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));return a});I(_.prototype,"reduce",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));if(n=this._buffer,a=this._length,arguments.length>1)i=t,o=0;else{if(a===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=C(n,0),o=1}for(;o<a;o++)s=C(n,o),i=r(i,s,o,this);return i});I(_.prototype,"reduceRight",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));if(n=this._buffer,a=this._length,arguments.length>1)i=t,o=a-1;else{if(a===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=C(n,a-1),o=a-2}for(;o>=0;o--)s=C(n,o),i=r(i,s,o,this);return i});I(_.prototype,"reverse",function(){var r,t,n,i,a,s;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,r=this._buffer,i=nS(n/2),a=0;a<i;a++)s=n-a-1,t=r[2*a],r[2*a]=r[2*s],r[2*s]=t,t=r[2*a+1],r[2*a+1]=r[2*s+1],r[2*s+1]=t;return this});I(_.prototype,"set",function(r){var t,n,i,a,s,o,f,u,c;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=this._buffer,arguments.length>1){if(n=arguments[1],!ne(n))throw new TypeError(x("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(ir(r)){if(n>=this._length)throw new RangeError(x("invalid argument. Index argument is out-of-bounds. Value: `%u`.",n));n*=2,i[n]=ur(r),i[n+1]=fr(r);return}if(V(r)){if(o=r._length,n+o>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r._buffer,c=i.byteOffset+n*er,t.buffer===i.buffer&&t.byteOffset<c&&t.byteOffset+t.byteLength>c){for(a=new nr(t.length),u=0;u<t.length;u++)a[u]=t[u];t=a}for(n*=2,c=0,u=0;u<o;u++)i[n]=t[c],i[n+1]=t[c+1],n+=2,c+=2;return}if(an(r)){for(o=r.length,u=0;u<o;u++)if(!ir(r[u])){s=!0;break}if(s){if(!Be(o))throw new RangeError(x("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",o));if(n+o/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,c=i.byteOffset+n*er,t.buffer===i.buffer&&t.byteOffset<c&&t.byteOffset+t.byteLength>c){for(a=new nr(o),u=0;u<o;u++)a[u]=t[u];t=a}for(n*=2,o/=2,c=0,u=0;u<o;u++)i[n]=t[c],i[n+1]=t[c+1],n+=2,c+=2;return}if(n+o>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(n*=2,u=0;u<o;u++)f=r[u],i[n]=ur(f),i[n+1]=fr(f),n+=2;return}throw new TypeError(x("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",r))});I(_.prototype,"slice",function(r,t){var n,i,a,s,o,f,u;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(o=this._buffer,f=this._length,arguments.length===0)r=0,t=f;else{if(!Q(r))throw new TypeError(x("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=f,r<0&&(r=0)),arguments.length===1)t=f;else{if(!Q(t))throw new TypeError(x("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=f,t<0&&(t=0)):t>f&&(t=f)}}for(r<t?n=t-r:n=0,a=new this.constructor(n),i=a._buffer,u=0;u<n;u++)s=2*(u+r),i[2*u]=o[s],i[2*u+1]=o[s+1];return a});I(_.prototype,"some",function(r,t){var n,i;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(r.call(t,C(n,i),i,this))return!0;return!1});I(_.prototype,"sort",function(r){var t,n,i,a,s;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length,t=[],a=0;a<i;a++)t.push(C(n,a));for(t.sort(r),a=0;a<i;a++)s=2*a,n[s]=ur(t[a]),n[s+1]=fr(t[a]);return this});I(_.prototype,"subarray",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=this._buffer,a=this._length,arguments.length===0)r=0,t=a;else{if(!Q(r))throw new TypeError(x("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=a,r<0&&(r=0)),arguments.length===1)t=a;else{if(!Q(t))throw new TypeError(x("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=a,t<0&&(t=0)):t>a&&(t=a)}}return r>=a?(a=0,n=i.byteLength):r>=t?(a=0,n=i.byteOffset+r*er):(a=t-r,n=i.byteOffset+r*er),new this.constructor(i.buffer,n,a<0?0:a)});I(_.prototype,"toLocaleString",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(arguments.length===0)i=[];else if(Kp(r)||QE(r))i=r;else throw new TypeError(x("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));if(arguments.length<2)n={};else if(on(t))n=t;else throw new TypeError(x("invalid argument. Options argument must be an object. Value: `%s`.",t));for(s=this._buffer,a=[],o=0;o<this._length;o++)a.push(C(s,o).toLocaleString(i,n));return a.join(",")});I(_.prototype,"toReversed",function(){var r,t,n,i,a,s;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,t=new this.constructor(n),i=this._buffer,r=t._buffer,a=0;a<n;a++)s=n-a-1,r[2*a]=i[2*s],r[2*a+1]=i[2*s+1];return t});I(_.prototype,"toSorted",function(r){var t,n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length,t=[],a=0;a<i;a++)t.push(C(n,a));return t.sort(r),new _(t)});I(_.prototype,"toString",function(){var r,t,n;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],t=this._buffer,n=0;n<this._length;n++)r.push(C(t,n).toString());return r.join(",")});I(_.prototype,"values",function(){var r,t,n,i,a,s;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,a=this._buffer,n=this._length,s=-1,r={},I(r,"next",o),I(r,"return",f),yr&&I(r,yr,u),r;function o(){return s+=1,i||s>=n?{done:!0}:{value:C(a,s),done:!1}}function f(c){return i=!0,arguments.length?{value:c,done:!0}:{done:!0}}function u(){return t.values()}});I(_.prototype,"with",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Q(r))throw new TypeError(x("invalid argument. First argument must be an integer. Value: `%s`.",r));if(a=this._length,r<0&&(r+=a),r<0||r>=a)throw new RangeError(x("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!ir(t))throw new TypeError(x("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return i=new this.constructor(this._buffer),n=i._buffer,n[2*r]=ur(t),n[2*r+1]=fr(t),i});ny.exports=_});var oy=l((J2,ay)=>{"use strict";var lS=iy();ay.exports=lS});var uy=l((H2,sy)=>{"use strict";function cS(e){return e.re}sy.exports=cS});var ie=l((X2,fy)=>{"use strict";var pS=uy();fy.exports=pS});var cy=l((Q2,ly)=>{"use strict";function yS(e){return e.im}ly.exports=yS});var ae=l((K2,py)=>{"use strict";var mS=cy();py.exports=mS});var my=l((r4,yy)=>{"use strict";var hS=Br(),gS=br(),vS=J(),bS=ie(),dS=ae();function wS(e){var r,t,n;for(r=[];t=e.next(),!t.done;)if(n=t.value,hS(n)&&n.length>=2)r.push(n[0],n[1]);else if(gS(n))r.push(bS(n),dS(n));else return new TypeError(vS("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));return r}yy.exports=wS});var gy=l((e4,hy)=>{"use strict";var AS=Br(),xS=br(),ES=J(),SS=ie(),_S=ae();function TS(e,r,t){var n,i,a,s;for(n=[],s=-1;i=e.next(),!i.done;)if(s+=1,a=r.call(t,i.value,s),AS(a)&&a.length>=2)n.push(a[0],a[1]);else if(xS(a))n.push(SS(a),_S(a));else return new TypeError(ES("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));return n}hy.exports=TS});var by=l((t4,vy)=>{"use strict";var qS=br(),IS=ie(),DS=ae();function NS(e,r){var t,n,i,a;for(t=r.length,a=0,i=0;i<t;i++){if(n=r[i],!qS(n))return null;e[a]=IS(n),e[a+1]=DS(n),a+=2}return e}vy.exports=NS});var Ty=l((n4,_y)=>{"use strict";var oe=Se().isPrimitive,sn=Br(),un=Hr(),dy=_e(),fn=Te(),BS=jr(),OS=qe().primitives,wy=Xr(),G=Gr(),or=br(),Ve=Qt(),K=Nr(),VS=Kt(),US=rn(),zS=re(),mr=De(),D=W(),Ue=Ne(),ar=Ae(),Ay=Jt(),lr=ie(),cr=ae(),FS=Jr(),RS=en(),jS=tn(),CS=Yr(),LS=Cr(),E=J(),xy=my(),MS=gy(),PS=by(),tr=ar.BYTES_PER_ELEMENT*2,Ey=zS();function U(e){return e instanceof T||typeof e=="object"&&e!==null&&(e.constructor.name==="Complex64Array"||e.constructor.name==="Complex128Array")&&typeof e._length=="number"&&typeof e._buffer=="object"}function Sy(e){return e===T||e.name==="Complex64Array"}function L(e,r){return r*=2,new Ay(e[r],e[r+1])}function T(){var e,r,t,n;if(r=arguments.length,!(this instanceof T))return r===0?new T:r===1?new T(arguments[0]):r===2?new T(arguments[0],arguments[1]):new T(arguments[0],arguments[1],arguments[2]);if(r===0)t=new ar(0);else if(r===1)if(oe(arguments[0]))t=new ar(arguments[0]*2);else if(un(arguments[0]))if(t=arguments[0],n=t.length,n&&BS(t)&&or(t[0])){if(t=PS(new ar(n*2),t),t===null){if(!Ve(n))throw new RangeError(E("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new ar(arguments[0])}}else{if(VS(t))t=RS(t,0);else if(US(t))t=jS(t,0);else if(!Ve(n))throw new RangeError(E("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new ar(t)}else if(dy(arguments[0])){if(t=arguments[0],!K(t.byteLength/tr))throw new RangeError(E("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",tr,t.byteLength));t=new ar(t)}else if(fn(arguments[0])){if(t=arguments[0],Ey===!1)throw new TypeError(E("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",t));if(!G(t[mr]))throw new TypeError(E("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(t=t[mr](),!G(t.next))throw new TypeError(E("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(t=xy(t),t instanceof Error)throw t;t=new ar(t)}else throw new TypeError(E("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));else{if(t=arguments[0],!dy(t))throw new TypeError(E("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(e=arguments[1],!oe(e))throw new TypeError(E("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(!K(e/tr))throw new RangeError(E("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",tr,e));if(r===2){if(n=t.byteLength-e,!K(n/tr))throw new RangeError(E("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",tr,n));t=new ar(t,e)}else{if(n=arguments[2],!oe(n))throw new TypeError(E("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*tr>t.byteLength-e)throw new RangeError(E("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*tr));t=new ar(t,e,n*2)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}D(T,"BYTES_PER_ELEMENT",tr);D(T,"name","Complex128Array");D(T,"from",function(r){var t,n,i,a,s,o,f,u,c,p,y,m;if(!G(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Sy(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=arguments.length,n>1){if(i=arguments[1],!G(i))throw new TypeError(E("invalid argument. Second argument must be a function. Value: `%s`.",i));n>2&&(t=arguments[2])}if(U(r)){if(u=r.length,i){for(a=new this(u),s=a._buffer,m=0,y=0;y<u;y++){if(p=i.call(t,r.get(y),y),or(p))s[m]=lr(p),s[m+1]=cr(p);else if(sn(p)&&p.length>=2)s[m]=p[0],s[m+1]=p[1];else throw new TypeError(E("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",p));m+=2}return a}return new this(r)}if(un(r)){if(i){for(u=r.length,r.get&&r.set?f=LS("default"):f=CS("default"),y=0;y<u;y++)if(!or(f(r,y))){c=!0;break}if(c){if(!Ve(u))throw new RangeError(E("invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.",u));for(a=new this(u/2),s=a._buffer,y=0;y<u;y++)s[y]=i.call(t,f(r,y),y);return a}for(a=new this(u),s=a._buffer,m=0,y=0;y<u;y++){if(p=i.call(t,f(r,y),y),or(p))s[m]=lr(p),s[m+1]=cr(p);else if(sn(p)&&p.length>=2)s[m]=p[0],s[m+1]=p[1];else throw new TypeError(E("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",p));m+=2}return a}return new this(r)}if(fn(r)&&Ey&&G(r[mr])){if(s=r[mr](),!G(s.next))throw new TypeError(E("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(i?o=MS(s,i,t):o=xy(s),o instanceof Error)throw o;for(u=o.length/2,a=new this(u),s=a._buffer,y=0;y<u;y++)s[y]=o[y];return a}throw new TypeError(E("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))});D(T,"of",function(){var r,t;if(!G(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Sy(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],t=0;t<arguments.length;t++)r.push(arguments[t]);return new this(r)});D(T.prototype,"at",function(r){if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!K(r))throw new TypeError(E("invalid argument. Must provide an integer. Value: `%s`.",r));if(r<0&&(r+=this._length),!(r<0||r>=this._length))return L(this._buffer,r)});Ue(T.prototype,"buffer",function(){return this._buffer.buffer});Ue(T.prototype,"byteLength",function(){return this._buffer.byteLength});Ue(T.prototype,"byteOffset",function(){return this._buffer.byteOffset});D(T.prototype,"BYTES_PER_ELEMENT",T.BYTES_PER_ELEMENT);D(T.prototype,"copyWithin",function(r,t){if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(r*2,t*2):this._buffer.copyWithin(r*2,t*2,arguments[2]*2),this});D(T.prototype,"entries",function(){var r,t,n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,r=this._buffer,i=this._length,s=-1,o=-2,n={},D(n,"next",f),D(n,"return",u),mr&&D(n,mr,c),n;function f(){var p;return s+=1,a||s>=i?{done:!0}:(o+=2,p=new Ay(r[o],r[o+1]),{value:[s,p],done:!1})}function u(p){return a=!0,arguments.length?{value:p,done:!0}:{done:!0}}function c(){return t.entries()}});D(T.prototype,"every",function(r,t){var n,i;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(!r.call(t,L(n,i),i,this))return!1;return!0});D(T.prototype,"fill",function(r,t,n){var i,a,s,o,f,u;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!or(r))throw new TypeError(E("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(i=this._buffer,a=this._length,arguments.length>1){if(!K(t))throw new TypeError(E("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=a,t<0&&(t=0)),arguments.length>2){if(!K(n))throw new TypeError(E("invalid argument. Third argument must be an integer. Value: `%s`.",n));n<0&&(n+=a,n<0&&(n=0)),n>a&&(n=a)}else n=a}else t=0,n=a;for(o=lr(r),f=cr(r),u=t;u<n;u++)s=2*u,i[s]=o,i[s+1]=f;return this});D(T.prototype,"filter",function(r,t){var n,i,a,s;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=[],a=0;a<this._length;a++)s=L(n,a),r.call(t,s,a,this)&&i.push(s);return new this.constructor(i)});D(T.prototype,"find",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(a=L(n,i),r.call(t,a,i,this))return a});D(T.prototype,"findIndex",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(a=L(n,i),r.call(t,a,i,this))return i;return-1});D(T.prototype,"findLast",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length-1;i>=0;i--)if(a=L(n,i),r.call(t,a,i,this))return a});D(T.prototype,"findLastIndex",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length-1;i>=0;i--)if(a=L(n,i),r.call(t,a,i,this))return i;return-1});D(T.prototype,"forEach",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)a=L(n,i),r.call(t,a,i,this)});D(T.prototype,"get",function(r){if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!oe(r))throw new TypeError(E("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return L(this._buffer,r)});Ue(T.prototype,"length",function(){return this._length});D(T.prototype,"includes",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!or(r))throw new TypeError(E("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!K(t))throw new TypeError(E("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(a=lr(r),s=cr(r),n=this._buffer,o=t;o<this._length;o++)if(i=2*o,a===n[i]&&s===n[i+1])return!0;return!1});D(T.prototype,"indexOf",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!or(r))throw new TypeError(E("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!K(t))throw new TypeError(E("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(a=lr(r),s=cr(r),n=this._buffer,o=t;o<this._length;o++)if(i=2*o,a===n[i]&&s===n[i+1])return o;return-1});D(T.prototype,"join",function(r){var t,n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(arguments.length===0)i=",";else if(wy(r))i=r;else throw new TypeError(E("invalid argument. First argument must be a string. Value: `%s`.",r));for(t=[],n=this._buffer,a=0;a<this._length;a++)t.push(L(n,a).toString());return t.join(i)});D(T.prototype,"keys",function(){var r,t,n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,n=this._length,a=-1,t={},D(t,"next",s),D(t,"return",o),mr&&D(t,mr,f),t;function s(){return a+=1,i||a>=n?{done:!0}:{value:a,done:!1}}function o(u){return i=!0,arguments.length?{value:u,done:!0}:{done:!0}}function f(){return r.keys()}});D(T.prototype,"lastIndexOf",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!or(r))throw new TypeError(E("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!K(t))throw new TypeError(E("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(a=lr(r),s=cr(r),n=this._buffer,o=t;o>=0;o--)if(i=2*o,a===n[i]&&s===n[i+1])return o;return-1});D(T.prototype,"map",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(i=this._buffer,a=new this.constructor(this._length),n=a._buffer,s=0;s<this._length;s++)if(o=r.call(t,L(i,s),s,this),or(o))n[2*s]=lr(o),n[2*s+1]=cr(o);else if(sn(o)&&o.length===2)n[2*s]=o[0],n[2*s+1]=o[1];else throw new TypeError(E("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));return a});D(T.prototype,"reduce",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));if(n=this._buffer,a=this._length,arguments.length>1)i=t,o=0;else{if(a===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=L(n,0),o=1}for(;o<a;o++)s=L(n,o),i=r(i,s,o,this);return i});D(T.prototype,"reduceRight",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));if(n=this._buffer,a=this._length,arguments.length>1)i=t,o=a-1;else{if(a===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=L(n,a-1),o=a-2}for(;o>=0;o--)s=L(n,o),i=r(i,s,o,this);return i});D(T.prototype,"reverse",function(){var r,t,n,i,a,s;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,r=this._buffer,i=FS(n/2),a=0;a<i;a++)s=n-a-1,t=r[2*a],r[2*a]=r[2*s],r[2*s]=t,t=r[2*a+1],r[2*a+1]=r[2*s+1],r[2*s+1]=t;return this});D(T.prototype,"set",function(r){var t,n,i,a,s,o,f,u,c;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=this._buffer,arguments.length>1){if(n=arguments[1],!oe(n))throw new TypeError(E("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(or(r)){if(n>=this._length)throw new RangeError(E("invalid argument. Index argument is out-of-bounds. Value: `%u`.",n));n*=2,i[n]=lr(r),i[n+1]=cr(r);return}if(U(r)){if(o=r._length,n+o>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r._buffer,c=i.byteOffset+n*tr,t.buffer===i.buffer&&t.byteOffset<c&&t.byteOffset+t.byteLength>c){for(a=new ar(t.length),u=0;u<t.length;u++)a[u]=t[u];t=a}for(n*=2,c=0,u=0;u<o;u++)i[n]=t[c],i[n+1]=t[c+1],n+=2,c+=2;return}if(un(r)){for(o=r.length,u=0;u<o;u++)if(!or(r[u])){s=!0;break}if(s){if(!Ve(o))throw new RangeError(E("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",o));if(n+o/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,c=i.byteOffset+n*tr,t.buffer===i.buffer&&t.byteOffset<c&&t.byteOffset+t.byteLength>c){for(a=new ar(o),u=0;u<o;u++)a[u]=t[u];t=a}for(n*=2,o/=2,c=0,u=0;u<o;u++)i[n]=t[c],i[n+1]=t[c+1],n+=2,c+=2;return}if(n+o>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(n*=2,u=0;u<o;u++)f=r[u],i[n]=lr(f),i[n+1]=cr(f),n+=2;return}throw new TypeError(E("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",r))});D(T.prototype,"slice",function(r,t){var n,i,a,s,o,f,u;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(o=this._buffer,f=this._length,arguments.length===0)r=0,t=f;else{if(!K(r))throw new TypeError(E("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=f,r<0&&(r=0)),arguments.length===1)t=f;else{if(!K(t))throw new TypeError(E("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=f,t<0&&(t=0)):t>f&&(t=f)}}for(r<t?n=t-r:n=0,a=new this.constructor(n),i=a._buffer,u=0;u<n;u++)s=2*(u+r),i[2*u]=o[s],i[2*u+1]=o[s+1];return a});D(T.prototype,"some",function(r,t){var n,i;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(r.call(t,L(n,i),i,this))return!0;return!1});D(T.prototype,"sort",function(r){var t,n,i,a,s;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length,t=[],a=0;a<i;a++)t.push(L(n,a));for(t.sort(r),a=0;a<i;a++)s=2*a,n[s]=lr(t[a]),n[s+1]=cr(t[a]);return this});D(T.prototype,"subarray",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=this._buffer,a=this._length,arguments.length===0)r=0,t=a;else{if(!K(r))throw new TypeError(E("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=a,r<0&&(r=0)),arguments.length===1)t=a;else{if(!K(t))throw new TypeError(E("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=a,t<0&&(t=0)):t>a&&(t=a)}}return r>=a?(a=0,n=i.byteLength):r>=t?(a=0,n=i.byteOffset+r*tr):(a=t-r,n=i.byteOffset+r*tr),new this.constructor(i.buffer,n,a<0?0:a)});D(T.prototype,"toLocaleString",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(arguments.length===0)i=[];else if(wy(r)||OS(r))i=r;else throw new TypeError(E("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));if(arguments.length<2)n={};else if(fn(t))n=t;else throw new TypeError(E("invalid argument. Options argument must be an object. Value: `%s`.",t));for(s=this._buffer,a=[],o=0;o<this._length;o++)a.push(L(s,o).toLocaleString(i,n));return a.join(",")});D(T.prototype,"toReversed",function(){var r,t,n,i,a,s;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,t=new this.constructor(n),i=this._buffer,r=t._buffer,a=0;a<n;a++)s=n-a-1,r[2*a]=i[2*s],r[2*a+1]=i[2*s+1];return t});D(T.prototype,"toSorted",function(r){var t,n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length,t=[],a=0;a<i;a++)t.push(L(n,a));return t.sort(r),new T(t)});D(T.prototype,"toString",function(){var r,t,n;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],t=this._buffer,n=0;n<this._length;n++)r.push(L(t,n).toString());return r.join(",")});D(T.prototype,"values",function(){var r,t,n,i,a,s;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,a=this._buffer,n=this._length,s=-1,r={},D(r,"next",o),D(r,"return",f),mr&&D(r,mr,u),r;function o(){return s+=1,i||s>=n?{done:!0}:{value:L(a,s),done:!1}}function f(c){return i=!0,arguments.length?{value:c,done:!0}:{done:!0}}function u(){return t.values()}});D(T.prototype,"with",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!K(r))throw new TypeError(E("invalid argument. First argument must be an integer. Value: `%s`.",r));if(a=this._length,r<0&&(r+=a),r<0||r>=a)throw new RangeError(E("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!or(t))throw new TypeError(E("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return i=new this.constructor(this._buffer),n=i._buffer,n[2*r]=lr(t),n[2*r+1]=cr(t),i});_y.exports=T});var Iy=l((i4,qy)=>{"use strict";var kS=Ty();qy.exports=kS});var Ny=l((a4,Dy)=>{"use strict";var $S=Rr();function GS(e){var r,t;for(r=[];t=e.next(),!t.done;)r.push($S(t.value));return r}Dy.exports=GS});var Oy=l((o4,By)=>{"use strict";var YS=Rr();function WS(e,r,t){var n,i,a;for(n=[],a=-1;i=e.next(),!i.done;)a+=1,n.push(YS(r.call(t,i.value,a)));return n}By.exports=WS});var Uy=l((s4,Vy)=>{"use strict";var ZS=Rr();function JS(e,r){var t,n;for(t=r.length,n=0;n<t;n++)e[n]=ZS(r[n]);return e}Vy.exports=JS});var My=l((u4,Ly)=>{"use strict";var se=Se().isPrimitive,ln=Hr(),zy=_e(),cn=Te(),Y=Gr(),ue=lt().isPrimitive,pr=Ee().isPrimitive,Fy=Xr().isPrimitive,HS=qe().primitives,XS=re(),hr=De(),N=W(),ze=Ne(),dr=Nt(),R=Rr(),QS=Yr(),KS=Jr(),r_=Cr(),B=J(),Ry=Ny(),e_=Oy(),t_=Uy(),Ur=dr.BYTES_PER_ELEMENT,jy=XS();function z(e){return typeof e=="object"&&e!==null&&e.constructor.name==="BooleanArray"&&e.BYTES_PER_ELEMENT===Ur}function Cy(e){return e===q}function q(){var e,r,t,n,i;if(r=arguments.length,!(this instanceof q))return r===0?new q:r===1?new q(arguments[0]):r===2?new q(arguments[0],arguments[1]):new q(arguments[0],arguments[1],arguments[2]);if(r===0)t=new dr(0);else if(r===1)if(i=arguments[0],se(i))t=new dr(i);else if(ln(i))t=t_(new dr(i.length),i);else if(zy(i))t=new dr(i);else if(cn(i)){if(jy===!1)throw new TypeError(B("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",i));if(!Y(i[hr]))throw new TypeError(B("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(t=i[hr](),!Y(t.next))throw new TypeError(B("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));t=new dr(Ry(t))}else throw new TypeError(B("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));else{if(t=arguments[0],!zy(t))throw new TypeError(B("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(e=arguments[1],!se(e))throw new TypeError(B("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(r===2)t=new dr(t,e);else{if(n=arguments[2],!se(n))throw new TypeError(B("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*Ur>t.byteLength-e)throw new RangeError(B("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Ur));t=new dr(t,e,n)}}return N(this,"_buffer",t),N(this,"_length",t.length),this}N(q,"BYTES_PER_ELEMENT",Ur);N(q,"name","BooleanArray");N(q,"from",function(r){var t,n,i,a,s,o,f,u,c;if(!Y(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Cy(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(n=arguments.length,n>1){if(i=arguments[1],!Y(i))throw new TypeError(B("invalid argument. Second argument must be a function. Value: `%s`.",i));n>2&&(t=arguments[2])}if(ln(r)){if(i){for(u=r.length,r.get&&r.set?f=r_("default"):f=QS("default"),a=new this(u),s=a._buffer,c=0;c<u;c++)s[c]=R(i.call(t,f(r,c),c));return a}return new this(r)}if(cn(r)&&jy&&Y(r[hr])){if(s=r[hr](),!Y(s.next))throw new TypeError(B("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));for(i?o=e_(s,i,t):o=Ry(s),u=o.length,a=new this(u),s=a._buffer,c=0;c<u;c++)s[c]=o[c];return a}throw new TypeError(B("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))});N(q,"of",function(){var r,t;if(!Y(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Cy(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=[],t=0;t<arguments.length;t++)r.push(arguments[t]);return new this(r)});N(q.prototype,"at",function(r){var t,n;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!pr(r))throw new TypeError(B("invalid argument. Must provide an integer. Value: `%s`.",r));if(n=this._length,t=this._buffer,r<0&&(r+=n),!(r<0||r>=n))return R(t[r])});ze(q.prototype,"buffer",function(){return this._buffer.buffer});ze(q.prototype,"byteLength",function(){return this._buffer.byteLength});ze(q.prototype,"byteOffset",function(){return this._buffer.byteOffset});N(q.prototype,"BYTES_PER_ELEMENT",q.BYTES_PER_ELEMENT);N(q.prototype,"copyWithin",function(r,t){if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return arguments.length===2?this._buffer.copyWithin(r,t):this._buffer.copyWithin(r,t,arguments[2]),this});N(q.prototype,"entries",function(){var r,t,n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return r=this,i=this._buffer,n=this._length,s=-1,t={},N(t,"next",o),N(t,"return",f),hr&&N(t,hr,u),t;function o(){return s+=1,a||s>=n?{done:!0}:{value:[s,R(i[s])],done:!1}}function f(c){return a=!0,arguments.length?{value:c,done:!0}:{done:!0}}function u(){return r.entries()}});N(q.prototype,"every",function(r,t){var n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(!r.call(t,R(n[i]),i,this))return!1;return!0});N(q.prototype,"fill",function(r,t,n){var i,a,s,o;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ue(r))throw new TypeError(B("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(i=this._buffer,a=this._length,arguments.length>1){if(!pr(t))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=a,t<0&&(t=0)),arguments.length>2){if(!pr(n))throw new TypeError(B("invalid argument. Third argument must be an integer. Value: `%s`.",n));n<0&&(n+=a,n<0&&(n=0)),n>a&&(n=a)}else n=a}else t=0,n=a;for(r?s=1:s=0,o=t;o<n;o++)i[o]=s;return this});N(q.prototype,"filter",function(r,t){var n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=[],a=0;a<this._length;a++)s=R(n[a]),r.call(t,s,a,this)&&i.push(s);return new this.constructor(i)});N(q.prototype,"find",function(r,t){var n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,a=0;a<this._length;a++)if(i=R(n[a]),r.call(t,i,a,this))return i});N(q.prototype,"findIndex",function(r,t){var n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,a=0;a<this._length;a++)if(i=R(n[a]),r.call(t,i,a,this))return a;return-1});N(q.prototype,"findLast",function(r,t){var n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,a=this._length-1;a>=0;a--)if(i=R(n[a]),r.call(t,i,a,this))return i});N(q.prototype,"findLastIndex",function(r,t){var n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,a=this._length-1;a>=0;a--)if(i=R(n[a]),r.call(t,i,a,this))return a;return-1});N(q.prototype,"forEach",function(r,t){var n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)r.call(t,R(n[i]),i,this)});N(q.prototype,"get",function(r){if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!se(r))throw new TypeError(B("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return R(this._buffer[r])});N(q.prototype,"includes",function(r,t){var n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ue(r))throw new TypeError(B("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!pr(t))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(n=this._buffer,i=t;i<this._length;i++)if(r===R(n[i]))return!0;return!1});N(q.prototype,"indexOf",function(r,t){var n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ue(r))throw new TypeError(B("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!pr(t))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(n=this._buffer,i=t;i<this._length;i++)if(r===R(n[i]))return i;return-1});N(q.prototype,"join",function(r){var t,n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(arguments.length>0){if(!Fy(r))throw new TypeError(B("invalid argument. First argument must be a string. Value: `%s`.",r))}else r=",";for(t=this._buffer,n=[],i=0;i<this._length;i++)t[i]?n.push("true"):n.push("false");return n.join(r)});N(q.prototype,"keys",function(){var r,t,n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return r=this,n=this._length,a=-1,t={},N(t,"next",s),N(t,"return",o),hr&&N(t,hr,f),t;function s(){return a+=1,i||a>=n?{done:!0}:{value:a,done:!1}}function o(u){return i=!0,arguments.length?{value:u,done:!0}:{done:!0}}function f(){return r.keys()}});N(q.prototype,"lastIndexOf",function(r,t){var n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ue(r))throw new TypeError(B("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!pr(t))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(n=this._buffer,i=t;i>=0;i--)if(r===R(n[i]))return i;return-1});ze(q.prototype,"length",function(){return this._length});N(q.prototype,"map",function(r,t){var n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",r);for(a=this._buffer,i=new this.constructor(this._length),n=i._buffer,s=0;s<this._length;s++)n[s]=R(r.call(t,R(a[s]),s,this));return i});N(q.prototype,"reduce",function(r,t){var n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));if(n=this._buffer,i=this._length,arguments.length>1)a=t,s=0;else{if(i===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");a=R(n[0]),s=1}for(;s<i;s++)a=r(a,R(n[s]),s,this);return a});N(q.prototype,"reduceRight",function(r,t){var n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));if(n=this._buffer,i=this._length,arguments.length>1)a=t,s=i-1;else{if(i===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");a=R(n[i-1]),s=i-2}for(;s>=0;s--)a=r(a,R(n[s]),s,this);return a});N(q.prototype,"reverse",function(){var r,t,n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=this._buffer,n=this._length,i=KS(n/2),a=0;a<i;a++)s=n-a-1,t=r[a],r[a]=r[s],r[s]=t;return this});N(q.prototype,"set",function(r){var t,n,i,a,s,o,f;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(i=this._buffer,arguments.length>1){if(n=arguments[1],!se(n))throw new TypeError(B("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(ln(r)){if(s=r.length,n+s>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(z(r)?t=r._buffer:t=r,f=i.byteOffset+n*Ur,t.buffer===i.buffer&&t.byteOffset<f&&t.byteOffset+t.byteLength>f){for(a=new dr(t.length),o=0;o<t.length;o++)a[o]=t[o];t=a}for(o=0;o<s;n++,o++)i[n]=t[o]?1:0;return}if(n>=this._length)throw new RangeError(B("invalid argument. Index argument is out-of-bounds. Value: `%u`.",n));i[n]=r?1:0});N(q.prototype,"slice",function(r,t){var n,i,a,s,o,f;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(s=this._buffer,o=this._length,arguments.length===0)r=0,t=o;else{if(!pr(r))throw new TypeError(B("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=o,r<0&&(r=0)),arguments.length===1)t=o;else{if(!pr(t))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o)}}for(r<t?n=t-r:n=0,a=new this.constructor(n),i=a._buffer,f=0;f<n;f++)i[f]=s[f+r];return a});N(q.prototype,"some",function(r,t){var n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(r.call(t,R(n[i]),i,this))return!0;return!1});N(q.prototype,"sort",function(r){var t;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(t=this._buffer,arguments.length===0)return t.sort(),this;if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));return t.sort(n),this;function n(i,a){return r(R(i),R(a))}});N(q.prototype,"subarray",function(r,t){var n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(i=this._buffer,a=this._length,arguments.length===0)r=0,t=a;else{if(!pr(r))throw new TypeError(B("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=a,r<0&&(r=0)),arguments.length===1)t=a;else{if(!pr(t))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=a,t<0&&(t=0)):t>a&&(t=a)}}return r>=a?(a=0,n=i.byteLength):r>=t?(a=0,n=i.byteOffset+r*Ur):(a=t-r,n=i.byteOffset+r*Ur),new this.constructor(i.buffer,n,a<0?0:a)});N(q.prototype,"toLocaleString",function(r,t){var n,i,a,s,o;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(arguments.length===0)i=[];else if(Fy(r)||HS(r))i=r;else throw new TypeError(B("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));if(arguments.length<2)n={};else if(cn(t))n=t;else throw new TypeError(B("invalid argument. Options argument must be an object. Value: `%s`.",t));for(s=this._buffer,a=[],o=0;o<this._length;o++)a.push(R(s[o]).toLocaleString(i,n));return a.join(",")});N(q.prototype,"toReversed",function(){var r,t,n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(n=this._length,t=new this.constructor(n),i=this._buffer,r=t._buffer,a=0;a<n;a++)r[a]=i[n-a-1];return t});N(q.prototype,"toSorted",function(r){var t,n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(i=this._length,n=new this.constructor(i),a=this._buffer,t=n._buffer,s=0;s<i;s++)t[s]=a[s];if(arguments.length===0)return t.sort(),n;if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));return t.sort(o),n;function o(f,u){return r(R(f),R(u))}});N(q.prototype,"toString",function(){var r,t,n;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=[],t=this._buffer,n=0;n<this._length;n++)t[n]?r.push("true"):r.push("false");return r.join(",")});N(q.prototype,"values",function(){var r,t,n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return t=this,a=this._buffer,n=this._length,s=-1,r={},N(r,"next",o),N(r,"return",f),hr&&N(r,hr,u),r;function o(){return s+=1,i||s>=n?{done:!0}:{value:R(a[s]),done:!1}}function f(c){return i=!0,arguments.length?{value:c,done:!0}:{done:!0}}function u(){return t.values()}});N(q.prototype,"with",function(r,t){var n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!pr(r))throw new TypeError(B("invalid argument. First argument must be an integer. Value: `%s`.",r));if(a=this._length,r<0&&(r+=a),r<0||r>=a)throw new RangeError(B("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!ue(t))throw new TypeError(B("invalid argument. Second argument must be a boolean. Value: `%s`.",t));return i=new this.constructor(this._buffer),n=i._buffer,t?n[r]=1:n[r]=0,i});Ly.exports=q});var ky=l((f4,Py)=>{"use strict";var n_=My();Py.exports=n_});var Gy=l((l4,$y)=>{"use strict";var i_=Ae(),a_=Wr(),o_=du(),s_=Lu(),u_=of(),f_=qf(),l_=Nt(),c_=ul(),p_=Dl(),y_=oy(),m_=Iy(),h_=ky(),g_=[i_,a_,s_,o_,f_,u_,p_,l_,c_,y_,m_,h_];$y.exports=g_});var Wy=l((c4,Yy)=>{"use strict";var v_=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"];Yy.exports=v_});var Hy=l((p4,Jy)=>{"use strict";var b_=ht(),d_=jr(),w_=de(),A_=As(),x_=Gy(),Zy=Wy(),E_=Zy.length;function S_(e){var r;if(d_(e))return"generic";if(b_(e))return null;for(r=0;r<E_;r++)if(e instanceof x_[r])return Zy[r];return A_[w_(e)]||null}Jy.exports=S_});var pn=l((y4,Xy)=>{"use strict";var __=Hy();Xy.exports=__});var Ky=l((m4,Qy)=>{"use strict";var T_=bt(),q_=Cr(),I_=Yr(),D_=pn();function N_(e,r){var t,n,i,a;for(i=D_(e),T_(e)?n=q_(i):n=I_(i),t=e.length,a=0;a<t;a++)if(n(e,a)===r)return!0;return!1}Qy.exports=N_});var em=l((h4,rm)=>{"use strict";var B_=Hr(),O_=bt(),V_=Cr(),U_=pn(),z_=J();function F_(e){var r,t,n;if(!B_(e))throw new TypeError(z_("invalid argument. Must provide an array-like object. Value: `%s`.",e));return n=U_(e),O_(e)&&(r=V_(n)),t=e.length,r===void 0?i:a;function i(s){var o;for(o=0;o<t;o++)if(e[o]===s)return!0;return!1}function a(s){var o;for(o=0;o<t;o++)if(r(e,o)===s)return!0;return!1}}rm.exports=F_});var yn=l((g4,nm)=>{"use strict";var R_=W(),tm=Ky(),j_=em();R_(tm,"factory",j_);nm.exports=tm});var im=l((v4,C_)=>{C_.exports=["row-major","column-major"]});var om=l((b4,am)=>{"use strict";var L_=im();function M_(){return L_.slice()}am.exports=M_});var um=l((d4,sm)=>{"use strict";function P_(){return{"row-major":101,"column-major":102}}sm.exports=P_});var cm=l((w4,lm)=>{"use strict";var k_=W(),fm=om(),$_=um();k_(fm,"enum",$_);lm.exports=fm});var ym=l((A4,pm)=>{"use strict";var G_=yn().factory,Y_=cm(),W_=G_(Y_());pm.exports=W_});var hm=l((x4,mm)=>{"use strict";var Z_=ym();mm.exports=Z_});var gm=l((E4,J_)=>{J_.exports=["no-transpose","transpose","conjugate-transpose"]});var bm=l((S4,vm)=>{"use strict";var H_=gm();function X_(){return H_.slice()}vm.exports=X_});var wm=l((_4,dm)=>{"use strict";function Q_(){return{"no-transpose":111,transpose:112,"conjugate-transpose":113}}dm.exports=Q_});var Em=l((T4,xm)=>{"use strict";var K_=W(),Am=bm(),rT=wm();K_(Am,"enum",rT);xm.exports=Am});var _m=l((q4,Sm)=>{"use strict";var eT=yn().factory,tT=Em(),nT=eT(tT());Sm.exports=nT});var mn=l((I4,Tm)=>{"use strict";var iT=_m();Tm.exports=iT});var Im=l((D4,qm)=>{"use strict";function aT(e){return Math.abs(e)}qm.exports=aT});var Nm=l((N4,Dm)=>{"use strict";var oT=Im();Dm.exports=oT});var Vm=l((B4,Om)=>{"use strict";var Bm=Nm();function sT(e){var r,t,n,i;if(r=e.length,r===0)return!1;for(t=Bm(e[0]),i=1;i<r;i++){if(n=Bm(e[i]),n>t)return!1;t=n}return!0}Om.exports=sT});var zm=l((O4,Um)=>{"use strict";var uT=Vm();Um.exports=uT});var Rm=l((V4,Fm)=>{"use strict";function fT(e,r){return r>0?0:(1-e)*r}Fm.exports=fT});var Cm=l((U4,jm)=>{"use strict";var lT=Rm();jm.exports=lT});var hn=l((z4,Lm)=>{"use strict";var fe=5;function cT(e,r,t,n,i,a,s){var o,f,u,c,p;if(o=0,e<=0)return o;if(f=n,u=s,t===1&&a===1){if(c=e%fe,c>0)for(p=0;p<c;p++)o+=r[f]*i[u],f+=1,u+=1;if(e<fe)return o;for(p=c;p<e;p+=fe)o+=r[f]*i[u]+r[f+1]*i[u+1]+r[f+2]*i[u+2]+r[f+3]*i[u+3]+r[f+4]*i[u+4],f+=fe,u+=fe;return o}for(p=0;p<e;p++)o+=r[f]*i[u],f+=t,u+=a;return o}Lm.exports=cT});var km=l((F4,Pm)=>{"use strict";var Mm=Cm(),pT=hn();function yT(e,r,t,n,i){var a,s;return e<=0?0:(a=Mm(e,t),s=Mm(e,i),pT(e,r,t,a,n,i,s))}Pm.exports=yT});var Ym=l((R4,Gm)=>{"use strict";var mT=W(),$m=km(),hT=hn();mT($m,"ndarray",hT);Gm.exports=$m});var Jm=l((j4,Zm)=>{"use strict";var gT=require("path").join,vT=vt(),bT=we(),dT=Ym(),gn,Wm=vT(gT(__dirname,"./native.js"));bT(Wm)?gn=dT:gn=Wm;Zm.exports=gn});var Hm=l((C4,wT)=>{wT.exports={binary:1,bool:1,complex64:8,complex128:16,float16:2,bfloat16:2,float32:4,float64:8,float128:16,generic:null,int8:1,int16:2,int32:4,int64:8,int128:16,int256:32,uint8:1,uint8c:1,uint16:2,uint32:4,uint64:8,uint128:16,uint256:32}});var Qm=l((L4,Xm)=>{"use strict";var AT=Hm();function xT(e){return AT[e]||null}Xm.exports=xT});var rh=l((M4,Km)=>{"use strict";var ET=Qm();Km.exports=ET});var th=l((P4,eh)=>{"use strict";var ST={BLOCK_SIZE_IN_BYTES:64,BLOCK_SIZE_IN_ELEMENTS:8};eh.exports=ST});var ah=l((k4,ih)=>{"use strict";var nh=rh(),vn=th();function _T(e,r){var t,n;return t=nh(e),n=nh(r),t===null||n===null?vn.BLOCK_SIZE_IN_ELEMENTS:t>n?vn.BLOCK_SIZE_IN_BYTES/t|0:vn.BLOCK_SIZE_IN_BYTES/n|0}ih.exports=_T});var sh=l(($4,oh)=>{"use strict";var TT=ah();oh.exports=TT});var bn=l((G4,fh)=>{"use strict";var Re=zm(),uh=Jm().ndarray,qT=sh(),wr=qT("float64");function Ir(e){return e!=="no-transpose"}function IT(e,r,t,n,i,a){var s,o,f,u,c,p,y;for(Re([n,i])?(f=r,u=e,s=i,o=n-f*i):(f=e,u=r,s=n,o=i-f*n),y=a,p=0;p<u;p++){for(c=0;c<f;c++)t[y]=0,y+=s;y+=o}return t}function DT(e,r,t,n,i,a,s){var o,f,u,c,p,y,m;for(Re([i,a])?(u=r,c=e,o=a,f=i-u*a):(u=e,c=r,o=i,f=a-u*i),m=s,y=0;y<c;y++){for(p=0;p<u;p++)n[m]*=t,m+=o;m+=f}return n}function Fe(e,r,t,n,i,a,s,o,f,u,c,p,y,m,h,g){var v,w,A,S,O,j,F,M,gr,Lr,vr;for(O=r,j=e,v=s,w=u,A=h,S=m-O*h,vr=g,M=0;M<j;M++){for(gr=o+M*a,F=0;F<O;F++)Lr=p+F*c,y[vr]+=n*uh(t,i,v,gr,f,w,Lr),vr+=A;vr+=S}return y}function NT(e,r,t,n,i,a,s,o,f,u,c,p,y,m,h,g){var v,w,A,S,O,j,F,M,gr,Lr,vr,je,Ce,pe,ye,Er,Sr,_n,Tn,me,qn,In,_r;for(gr=r,Lr=e,v=s,w=u,A=h,Sr=Lr;Sr>0;)for(Sr<wr?(je=Sr,Sr=0):(je=wr,Sr-=wr),O=o+Sr*a,M=g+Sr*m,Er=gr;Er>0;)for(Er<wr?(vr=Er,Er=0):(vr=wr,Er-=wr),j=p+Er*c,F=M+Er*h,S=m-vr*h,_r=t;_r>0;)for(_r<wr?(Ce=_r,_r=0):(Ce=wr,_r-=wr),qn=O+_r*s,In=j+_r*u,me=F,ye=0;ye<je;ye++){for(_n=qn+ye*a,pe=0;pe<vr;pe++)Tn=In+pe*c,y[me]+=n*uh(Ce,i,v,_n,f,w,Tn),me+=A;me+=S}return y}function BT(e,r,t,n,i,a,s,o,f,u,c,p,y,m,h,g,v,w,A){var S,O,j,F,M,gr;if(t===0||n===0||h===1&&(a===0||i===0)||(h===0?g=IT(t,n,g,v,w,A):h!==1&&(g=DT(t,n,h,g,v,w,A)),a===0))return g;if(S=Re([o,f]),O=Re([p,y]),S){if(!Ir(e)){if(!O&&!Ir(r))return Fe(t,n,i,a,s,o,f,u,c,p,y,m,g,v,w,A);if(O&&Ir(r))return Fe(t,n,i,a,s,o,f,u,c,y,p,m,g,v,w,A)}}else if(Ir(e)){if(O&&Ir(r))return Fe(t,n,i,a,s,f,o,u,c,y,p,m,g,v,w,A);if(!O&&!Ir(r))return Fe(t,n,i,a,s,f,o,u,c,p,y,m,g,v,w,A)}return Ir(e)?(j=f,F=o):(j=o,F=f),Ir(r)?(M=y,gr=p):(M=p,gr=y),NT(t,n,i,a,s,j,F,u,c,M,gr,m,g,v,w,A)}fh.exports=BT});var ph=l((Y4,ch)=>{"use strict";var dn=ss(),OT=hm(),lh=mn(),Ar=J(),VT=bn();function UT(e,r,t,n,i,a,s,o,f,u,c,p,y,m){var h,g,v,w,A,S,O,j,F;if(!OT(e))throw new TypeError(Ar("invalid argument. First argument must be a valid order. Value: `%s`.",e));if(!lh(r))throw new TypeError(Ar("invalid argument. Second argument must be a valid transpose operation. Value: `%s`.",r));if(!lh(t))throw new TypeError(Ar("invalid argument. Third argument must be a valid transpose operation. Value: `%s`.",t));if(n<0)throw new RangeError(Ar("invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.",n));if(i<0)throw new RangeError(Ar("invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.",n));if(a<0)throw new RangeError(Ar("invalid argument. Sixth argument must be a nonnegative integer. Value: `%d`.",a));if(e==="row-major"&&r==="no-transpose"||e==="column-major"&&r==="transpose"?h=a:h=n,e==="row-major"&&t==="no-transpose"||e==="column-major"&&t==="transpose"?g=i:g=a,f<dn(1,h))throw new RangeError(Ar("invalid argument. Ninth argument must be greater than or equal to max(1,%d). Value: `%d`.",h,f));if(c<dn(1,g))throw new RangeError(Ar("invalid argument. Eleventh argument must be greater than or equal to max(1,%d). Value: `%d`.",g,c));if(e==="row-major"?v=i:v=n,m<dn(1,v))throw new RangeError(Ar("invalid argument. Fourteenth argument must be greater than or equal to max(1,%d). Value: `%d`.",v,m));return e==="column-major"?(w=1,A=f,S=1,O=c,j=1,F=m):(w=f,A=1,S=c,O=1,j=m,F=1),VT(r,t,n,i,a,s,o,w,A,0,u,S,O,0,p,y,j,F,0)}ch.exports=UT});var hh=l((W4,mh)=>{"use strict";var yh=mn(),le=J(),zT=bn();function FT(e,r,t,n,i,a,s,o,f,u,c,p,y,m,h,g,v,w,A){if(!yh(e))throw new TypeError(le("invalid argument. First argument must be a valid transpose operation. Value: `%s`.",e));if(!yh(r))throw new TypeError(le("invalid argument. Second argument must be a valid transpose operation. Value: `%s`.",r));if(t<0)throw new RangeError(le("invalid argument. Third argument must be a nonnegative integer. Value: `%d`.",t));if(n<0)throw new RangeError(le("invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.",t));if(i<0)throw new RangeError(le("invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.",i));return zT(e,r,t,n,i,a,s,o,f,u,c,p,y,m,h,g,v,w,A)}mh.exports=FT});var bh=l((Z4,vh)=>{"use strict";var RT=W(),gh=ph(),jT=hh();RT(gh,"ndarray",jT);vh.exports=gh});var Ah=l((J4,wh)=>{"use strict";var CT=require("path").join,LT=vt(),MT=we(),PT=bh(),wn,dh=LT(CT(__dirname,"./native.js"));MT(dh)?wn=PT:wn=dh;wh.exports=wn});var JT={};Qh(JT,{NDArray:()=>rr,__version__:()=>ZT,absolute:()=>Lh,arange:()=>qh,array:()=>xr,asarray:()=>Oh,copy:()=>Vh,empty:()=>En,empty_like:()=>Fh,eye:()=>xn,floor_divide:()=>$h,full:()=>Sn,full_like:()=>Rh,geomspace:()=>Nh,identity:()=>Bh,linspace:()=>Ih,logspace:()=>Dh,mod:()=>kh,negative:()=>Mh,ones:()=>An,ones_like:()=>zh,positive:()=>Gh,power:()=>Ch,reciprocal:()=>Yh,sign:()=>Ph,sqrt:()=>jh,zeros:()=>ce,zeros_like:()=>Uh});module.exports=rg(JT);function Nn(e){if(!e.includes(":")){if(e.includes("."))throw new Error(`Invalid slice index: "${e}" (must be integer)`);let a=parseInt(e,10);if(isNaN(a))throw new Error(`Invalid slice index: "${e}"`);return{start:a,stop:null,step:1,isIndex:!0}}let r=e.split(":");if(r.length>3)throw new Error(`Invalid slice notation: "${e}" (too many colons)`);let t=r[0]===""?null:parseInt(r[0],10),n=r[1]===""||r[1]===void 0?null:parseInt(r[1],10),i=r[2]===""||r[2]===void 0?1:parseInt(r[2],10);if(t!==null&&isNaN(t))throw new Error(`Invalid start index in slice: "${e}"`);if(n!==null&&isNaN(n))throw new Error(`Invalid stop index in slice: "${e}"`);if(isNaN(i))throw new Error(`Invalid step in slice: "${e}"`);if(i===0)throw new Error("Slice step cannot be zero");return{start:t,stop:n,step:i,isIndex:!1}}function Bn(e,r){let{start:t,stop:n}=e,{step:i,isIndex:a}=e;if(a){if(t===null)throw new Error("Index cannot be null");let s=t<0?r+t:t;if(s<0||s>=r)throw new Error(`Index ${t} is out of bounds for size ${r}`);return{start:s,stop:s+1,step:1,isIndex:!0}}return i>0?(t===null&&(t=0),n===null&&(n=r)):(t===null&&(t=r-1),n===null&&(n=-r-1)),t<0&&(t=r+t),n<0&&(n=r+n),t=Math.max(0,Math.min(t,r)),n=Math.max(-1,Math.min(n,r)),{start:t,stop:n,step:i,isIndex:!1}}var H="float64";function X(e){switch(e){case"float64":return Float64Array;case"float32":return Float32Array;case"int64":return BigInt64Array;case"int32":return Int32Array;case"int16":return Int16Array;case"int8":return Int8Array;case"uint64":return BigUint64Array;case"uint32":return Uint32Array;case"uint16":return Uint16Array;case"uint8":return Uint8Array;case"bool":return Uint8Array;default:throw new Error(`Unknown dtype: ${e}`)}}function On(e){return e==="float64"||e==="float32"}function d(e){return e==="int64"||e==="uint64"}function Tr(e,r){if(e===r)return e;if(e==="bool")return r;if(r==="bool")return e;if(On(e)||On(r)){if(e==="float64"||r==="float64")return"float64";if(e==="float32"){let u=r;return u==="int32"||u==="int64"||u==="uint32"||u==="uint64"?"float64":"float32"}if(r==="float32"){let u=e;return u==="int32"||u==="int64"||u==="uint32"||u==="uint64"?"float64":"float32"}return"float32"}let t=e.startsWith("int"),n=r.startsWith("int"),i=e.startsWith("uint"),a=r.startsWith("uint"),s=u=>u.includes("64")?64:u.includes("32")?32:u.includes("16")?16:u.includes("8")?8:0,o=s(e),f=s(r);if(e==="int64"&&r==="uint64"||e==="uint64"&&r==="int64")return"float64";if(t&&a&&o===f){if(o===8)return"int16";if(o===16)return"int32";if(o===32)return"int64"}if(i&&n&&o===f){if(f===8)return"int16";if(f===16)return"int32";if(f===32)return"int64"}if(t&&n||i&&a){let u=Math.max(o,f);return t?u===64?"int64":u===32?"int32":u===16?"int16":"int8":u===64?"uint64":u===32?"uint32":u===16?"uint16":"uint8"}return t&&a?o>f?e:f===8?"int16":f===16?"int32":f===32?"int64":"float64":i&&n?f>o?r:o===8?"int16":o===16?"int32":o===32?"int64":"float64":"float64"}var b=class e{constructor(r,t,n,i,a){this._data=r,this._shape=t,this._strides=n,this._offset=i,this._dtype=a}get shape(){return this._shape}get ndim(){return this._shape.length}get size(){return this._shape.reduce((r,t)=>r*t,1)}get dtype(){return this._dtype}get data(){return this._data}get strides(){return this._strides}get offset(){return this._offset}get isCContiguous(){let r=this._shape,t=this._strides,n=r.length;if(n===0)return!0;if(n===1)return t[0]===1;let i=1;for(let a=n-1;a>=0;a--){if(t[a]!==i)return!1;i*=r[a]}return!0}get isFContiguous(){let r=this._shape,t=this._strides,n=r.length;if(n===0)return!0;if(n===1)return t[0]===1;let i=1;for(let a=0;a<n;a++){if(t[a]!==i)return!1;i*=r[a]}return!0}iget(r){let t=this._shape,n=this._strides,i=t.length;if(i===0)return this._data[this._offset];let a=r,s=this._offset;for(let o=0;o<i;o++){let f=1;for(let c=o+1;c<i;c++)f*=t[c];let u=Math.floor(a/f);a=a%f,s+=u*n[o]}return this._data[s]}iset(r,t){let n=this._shape,i=this._strides,a=n.length;if(a===0){this._data[this._offset]=t;return}let s=r,o=this._offset;for(let f=0;f<a;f++){let u=1;for(let p=f+1;p<a;p++)u*=n[p];let c=Math.floor(s/u);s=s%u,o+=c*i[f]}this._data[o]=t}get(...r){let t=this._strides,n=this._offset;for(let i=0;i<r.length;i++)n+=r[i]*t[i];return this._data[n]}set(r,t){let n=this._strides,i=this._offset;for(let a=0;a<r.length;a++)i+=r[a]*n[a];this._data[i]=t}copy(){let r=Array.from(this._shape),t=this._dtype,n=this.size,i=X(t);if(!i)throw new Error(`Cannot copy array with dtype ${t}`);let a=new i(n);if(this.isCContiguous&&this._offset===0)if(d(t)){let s=this._data,o=a;for(let f=0;f<n;f++)o[f]=s[f]}else a.set(this._data);else if(d(t)){let s=a;for(let o=0;o<n;o++)s[o]=this.iget(o)}else for(let s=0;s<n;s++)a[s]=this.iget(s);return new e(a,r,e._computeStrides(r),0,t)}static fromData(r,t,n,i,a){let s=i??e._computeStrides(t),o=a??0;return new e(r,t,s,o,n)}static zeros(r,t=H){let n=r.reduce((s,o)=>s*o,1),i=X(t);if(!i)throw new Error(`Cannot create array with dtype ${t}`);let a=new i(n);return new e(a,r,e._computeStrides(r),0,t)}static ones(r,t=H){let n=r.reduce((s,o)=>s*o,1),i=X(t);if(!i)throw new Error(`Cannot create array with dtype ${t}`);let a=new i(n);return d(t)?a.fill(BigInt(1)):a.fill(1),new e(a,r,e._computeStrides(r),0,t)}static _computeStrides(r){let t=new Array(r.length),n=1;for(let i=r.length-1;i>=0;i--)t[i]=n,n*=r[i];return t}};function Le(e){let r=new Array(e.length),t=1;for(let n=e.length-1;n>=0;n--)r[n]=t,t*=e[n];return r}function Vn(e,r){let t=e.length,n=r.length,i=Math.max(t,n),a=new Array(i);for(let s=0;s<i;s++){let o=s<i-t?1:e[s-(i-t)],f=s<i-n?1:r[s-(i-n)];if(o===f)a[s]=o;else if(o===1)a[s]=f;else if(f===1)a[s]=o;else throw new Error(`operands could not be broadcast together with shapes ${JSON.stringify(Array.from(e))} ${JSON.stringify(Array.from(r))}`)}return a}function eg(e,r,t){let n=e.length,i=t.length,a=new Array(i).fill(0);for(let s=0;s<n;s++){let o=i-n+s,f=e[s],u=t[o];if(f===u)a[o]=r[s];else if(f===1)a[o]=0;else throw new Error("Invalid broadcast")}return a}function ge(e,r){let t=eg(e.shape,e.strides,r);return b.fromData(e.data,Array.from(r),e.dtype,t,e.offset)}function sr(e,r,t,n){let i=Vn(e.shape,r.shape),a=ge(e,i),s=ge(r,i),o=Tr(e.dtype,r.dtype),f=b.zeros(i,o),u=f.data,c=f.size;if(d(o)){let p=u;for(let y=0;y<c;y++){let m=a.iget(y),h=s.iget(y),g=typeof m=="bigint"?m:BigInt(Math.round(m)),v=typeof h=="bigint"?h:BigInt(Math.round(h));n==="add"?p[y]=g+v:n==="subtract"?p[y]=g-v:n==="multiply"?p[y]=g*v:n==="divide"?p[y]=g/v:p[y]=BigInt(Math.round(t(Number(g),Number(v))))}}else{let p=d(e.dtype)||d(r.dtype);for(let y=0;y<c;y++){let m=a.iget(y),h=s.iget(y),g=Number(m),v=Number(h);u[y]=t(g,v)}}return f}function qr(e,r,t){let n=Vn(e.shape,r.shape),i=ge(e,n),a=ge(r,n),s=n.reduce((u,c)=>u*c,1),o=new Uint8Array(s),f=d(e.dtype)||d(r.dtype);for(let u=0;u<s;u++){let c=i.iget(u),p=a.iget(u),y=Number(c),m=Number(p);o[u]=t(y,m)?1:0}return b.fromData(o,n,"bool")}function Un(e,r,t=!0){let n=e.dtype,i=Array.from(e.shape),a=e.size,o=t?n:n!=="float32"&&n!=="float64"?"float64":n,f=b.zeros(i,o),u=f.data,c=e.data;if(d(n))if(d(o)){let p=u;for(let y=0;y<a;y++){let m=Number(c[y]);p[y]=BigInt(Math.round(r(m)))}}else for(let p=0;p<a;p++)u[p]=r(Number(c[p]));else for(let p=0;p<a;p++)u[p]=r(Number(c[p]));return f}function Me(e,r){return e.isCContiguous&&r.isCContiguous&&e.shape.length===r.shape.length&&e.shape.every((t,n)=>t===r.shape[n])}function zn(e,r){return typeof r=="number"?ag(e,r):Me(e,r)?tg(e,r):sr(e,r,(t,n)=>t+n,"add")}function tg(e,r){let t=Tr(e.dtype,r.dtype),n=b.zeros(Array.from(e.shape),t),i=e.size,a=e.data,s=r.data,o=n.data;if(d(t)){let f=o;if(!d(e.dtype)||!d(r.dtype))for(let c=0;c<i;c++){let p=typeof a[c]=="bigint"?a[c]:BigInt(Math.round(Number(a[c]))),y=typeof s[c]=="bigint"?s[c]:BigInt(Math.round(Number(s[c])));f[c]=p+y}else{let c=a,p=s;for(let y=0;y<i;y++)f[y]=c[y]+p[y]}}else if(d(e.dtype)||d(r.dtype))for(let u=0;u<i;u++){let c=typeof a[u]=="bigint"?Number(a[u]):a[u],p=typeof s[u]=="bigint"?Number(s[u]):s[u];o[u]=c+p}else for(let u=0;u<i;u++)o[u]=a[u]+s[u];return n}function Fn(e,r){return typeof r=="number"?og(e,r):Me(e,r)?ng(e,r):sr(e,r,(t,n)=>t-n,"subtract")}function ng(e,r){let t=Tr(e.dtype,r.dtype),n=b.zeros(Array.from(e.shape),t),i=e.size,a=e.data,s=r.data,o=n.data;if(d(t)){let f=o;if(!d(e.dtype)||!d(r.dtype))for(let c=0;c<i;c++){let p=typeof a[c]=="bigint"?a[c]:BigInt(Math.round(Number(a[c]))),y=typeof s[c]=="bigint"?s[c]:BigInt(Math.round(Number(s[c])));f[c]=p-y}else{let c=a,p=s;for(let y=0;y<i;y++)f[y]=c[y]-p[y]}}else if(d(e.dtype)||d(r.dtype))for(let u=0;u<i;u++){let c=typeof a[u]=="bigint"?Number(a[u]):a[u],p=typeof s[u]=="bigint"?Number(s[u]):s[u];o[u]=c-p}else for(let u=0;u<i;u++)o[u]=a[u]-s[u];return n}function Rn(e,r){return typeof r=="number"?sg(e,r):Me(e,r)?ig(e,r):sr(e,r,(t,n)=>t*n,"multiply")}function ig(e,r){let t=Tr(e.dtype,r.dtype),n=b.zeros(Array.from(e.shape),t),i=e.size,a=e.data,s=r.data,o=n.data;if(d(t)){let f=o;if(!d(e.dtype)||!d(r.dtype))for(let c=0;c<i;c++){let p=typeof a[c]=="bigint"?a[c]:BigInt(Math.round(Number(a[c]))),y=typeof s[c]=="bigint"?s[c]:BigInt(Math.round(Number(s[c])));f[c]=p*y}else{let c=a,p=s;for(let y=0;y<i;y++)f[y]=c[y]*p[y]}}else if(d(e.dtype)||d(r.dtype))for(let u=0;u<i;u++){let c=typeof a[u]=="bigint"?Number(a[u]):a[u],p=typeof s[u]=="bigint"?Number(s[u]):s[u];o[u]=c*p}else for(let u=0;u<i;u++)o[u]=a[u]*s[u];return n}function jn(e,r){if(typeof r=="number")return ug(e,r);let t=e.dtype==="float64",n=r.dtype==="float64",i=e.dtype==="float32",a=r.dtype==="float32";if(t||n){let f=t?e:zr(e,"float64"),u=n?r:zr(r,"float64");return sr(f,u,(c,p)=>c/p,"divide")}if(i||a){let f=i?e:zr(e,"float32"),u=a?r:zr(r,"float32");return sr(f,u,(c,p)=>c/p,"divide")}let s=zr(e,"float64"),o=zr(r,"float64");return sr(s,o,(f,u)=>f/u,"divide")}function zr(e,r){let t=b.zeros(Array.from(e.shape),r),n=e.size,i=e.data,a=t.data;for(let s=0;s<n;s++)a[s]=Number(i[s]);return t}function ag(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,s=b.zeros(n,t),o=s.data;if(d(t)){let f=i,u=o,c=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]+c}else for(let f=0;f<a;f++)o[f]=Number(i[f])+r;return s}function og(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,s=b.zeros(n,t),o=s.data;if(d(t)){let f=i,u=o,c=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]-c}else for(let f=0;f<a;f++)o[f]=Number(i[f])-r;return s}function sg(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,s=b.zeros(n,t),o=s.data;if(d(t)){let f=i,u=o,c=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]*c}else for(let f=0;f<a;f++)o[f]=Number(i[f])*r;return s}function ug(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,o=t!=="float32"&&t!=="float64"?"float64":t,f=b.zeros(n,o),u=f.data;if(d(t))for(let c=0;c<a;c++)u[c]=Number(i[c])/r;else for(let c=0;c<a;c++)u[c]=Number(i[c])/r;return f}function Cn(e){let r=e.dtype,t=Array.from(e.shape),n=e.data,i=e.size,a=b.zeros(t,r),s=a.data;if(d(r)){let o=n,f=s;for(let u=0;u<i;u++){let c=o[u];f[u]=c<0n?-c:c}}else for(let o=0;o<i;o++)s[o]=Math.abs(Number(n[o]));return a}function Ln(e){let r=e.dtype,t=Array.from(e.shape),n=e.data,i=e.size,a=b.zeros(t,r),s=a.data;if(d(r)){let o=n,f=s;for(let u=0;u<i;u++)f[u]=-o[u]}else for(let o=0;o<i;o++)s[o]=-Number(n[o]);return a}function Mn(e){let r=e.dtype,t=Array.from(e.shape),n=e.data,i=e.size,a=b.zeros(t,r),s=a.data;if(d(r)){let o=n,f=s;for(let u=0;u<i;u++){let c=o[u];f[u]=c>0n?1n:c<0n?-1n:0n}}else for(let o=0;o<i;o++){let f=Number(n[o]);s[o]=f>0?1:f<0?-1:0}return a}function Pn(e,r){return typeof r=="number"?fg(e,r):sr(e,r,(t,n)=>(t%n+n)%n,"mod")}function fg(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,s=b.zeros(n,t),o=s.data;if(d(t)){let f=i,u=o,c=BigInt(Math.round(r));for(let p=0;p<a;p++){let y=f[p];u[p]=(y%c+c)%c}}else for(let f=0;f<a;f++){let u=Number(i[f]);o[f]=(u%r+r)%r}return s}function kn(e,r){return typeof r=="number"?lg(e,r):sr(e,r,(t,n)=>Math.floor(t/n),"floor_divide")}function lg(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,s=b.zeros(n,t),o=s.data;if(d(t)){let f=i,u=o,c=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]/c}else for(let f=0;f<a;f++)o[f]=Math.floor(Number(i[f])/r);return s}function $n(e){let r=e.dtype,t=Array.from(e.shape),n=e.data,i=e.size,a=b.zeros(t,r),s=a.data;for(let o=0;o<i;o++)s[o]=n[o];return a}function Gn(e){let r=e.dtype,t=Array.from(e.shape),n=e.data,i=e.size,s=r!=="float32"&&r!=="float64"?"float64":r,o=b.zeros(t,s),f=o.data;if(d(r))for(let u=0;u<i;u++)f[u]=1/Number(n[u]);else for(let u=0;u<i;u++)f[u]=1/Number(n[u]);return o}function Yn(e,r){return typeof r=="number"?pg(e,r):qr(e,r,(t,n)=>t>n)}function Wn(e,r){return typeof r=="number"?yg(e,r):qr(e,r,(t,n)=>t>=n)}function Zn(e,r){return typeof r=="number"?mg(e,r):qr(e,r,(t,n)=>t<n)}function Jn(e,r){return typeof r=="number"?hg(e,r):qr(e,r,(t,n)=>t<=n)}function Hn(e,r){return typeof r=="number"?gg(e,r):qr(e,r,(t,n)=>t===n)}function Xn(e,r){return typeof r=="number"?vg(e,r):qr(e,r,(t,n)=>t!==n)}function Pe(e,r,t=1e-5,n=1e-8){return typeof r=="number"?bg(e,r,t,n):qr(e,r,(i,a)=>{let s=Math.abs(i-a),o=n+t*Math.abs(a);return s<=o})}function Qn(e,r,t=1e-5,n=1e-8){let i=Pe(e,r,t,n),a=i.data;for(let s=0;s<i.size;s++)if(a[s]===0)return!1;return!0}function pg(e,r){let t=new Uint8Array(e.size),n=e.data;for(let i=0;i<e.size;i++)t[i]=n[i]>r?1:0;return b.fromData(t,Array.from(e.shape),"bool")}function yg(e,r){let t=new Uint8Array(e.size),n=e.data;for(let i=0;i<e.size;i++)t[i]=n[i]>=r?1:0;return b.fromData(t,Array.from(e.shape),"bool")}function mg(e,r){let t=new Uint8Array(e.size),n=e.data;for(let i=0;i<e.size;i++)t[i]=n[i]<r?1:0;return b.fromData(t,Array.from(e.shape),"bool")}function hg(e,r){let t=new Uint8Array(e.size),n=e.data;for(let i=0;i<e.size;i++)t[i]=n[i]<=r?1:0;return b.fromData(t,Array.from(e.shape),"bool")}function gg(e,r){let t=new Uint8Array(e.size),n=e.data,i=e.dtype;if(d(i)){let a=BigInt(Math.round(r)),s=n;for(let o=0;o<e.size;o++)t[o]=s[o]===a?1:0}else for(let a=0;a<e.size;a++)t[a]=n[a]===r?1:0;return b.fromData(t,Array.from(e.shape),"bool")}function vg(e,r){let t=new Uint8Array(e.size),n=e.data;for(let i=0;i<e.size;i++)t[i]=n[i]!==r?1:0;return b.fromData(t,Array.from(e.shape),"bool")}function bg(e,r,t,n){let i=new Uint8Array(e.size),a=e.data,s=e.dtype;if(d(s)){let o=a;for(let f=0;f<e.size;f++){let u=Number(o[f]),c=Math.abs(u-r),p=n+t*Math.abs(r);i[f]=c<=p?1:0}}else for(let o=0;o<e.size;o++){let f=Number(a[o]),u=Math.abs(f-r),c=n+t*Math.abs(r);i[o]=u<=c?1:0}return b.fromData(i,Array.from(e.shape),"bool")}function P(e,r){let t=0,n=1;for(let i=e.length-1;i>=0;i--)t+=e[i]*n,n*=r[i];return t}function k(e,r,t,n){let i=n.length,a=new Array(i),s=Array.from(n).filter((f,u)=>u!==r),o=e;for(let f=s.length-1;f>=0;f--)a[f>=r?f+1:f]=o%s[f],o=Math.floor(o/s[f]);return a[r]=t,a}function Mr(e,r,t=!1){let n=e.dtype,i=e.shape,a=i.length,s=e.size,o=e.data;if(r===void 0)if(d(n)){let h=o,g=BigInt(0);for(let v=0;v<s;v++)g+=h[v];return Number(g)}else{let h=0;for(let g=0;g<s;g++)h+=Number(o[g]);return h}let f=r;if(f<0&&(f=a+f),f<0||f>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(i).filter((h,g)=>g!==f);if(u.length===0)return Mr(e);let c=b.zeros(u,n),p=c.data,y=i[f],m=u.reduce((h,g)=>h*g,1);if(d(n)){let h=o,g=p;for(let v=0;v<m;v++){let w=BigInt(0);for(let A=0;A<y;A++){let S=k(v,f,A,i),O=P(S,i);w+=h[O]}g[v]=w}}else for(let h=0;h<m;h++){let g=0;for(let v=0;v<y;v++){let w=k(h,f,v,i),A=P(w,i);g+=Number(o[A])}p[h]=g}if(t){let h=[...i];return h[f]=1,b.fromData(p,h,n)}return c}function ke(e,r,t=!1){let n=e.dtype,i=e.shape;if(r===void 0)return Mr(e)/e.size;let a=r;if(a<0&&(a=i.length+a),a<0||a>=i.length)throw new Error(`axis ${r} is out of bounds for array of dimension ${i.length}`);let s=Mr(e,r,t);if(typeof s=="number")return s/i[a];let o=i[a],f=n;(d(n)||n.startsWith("int")||n.startsWith("uint"))&&(f="float64");let u=b.zeros(Array.from(s.shape),f),c=u.data,p=s.data;if(d(n)){let y=p;for(let m=0;m<c.length;m++)c[m]=Number(y[m])/o}else for(let y=0;y<c.length;y++)c[y]=Number(p[y])/o;return u}function $e(e,r,t=!1){let n=e.dtype,i=e.shape,a=i.length,s=e.size,o=e.data;if(r===void 0){if(s===0)throw new Error("max of empty array");let h=o[0];for(let g=1;g<s;g++)o[g]>h&&(h=o[g]);return Number(h)}let f=r;if(f<0&&(f=a+f),f<0||f>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(i).filter((h,g)=>g!==f);if(u.length===0)return $e(e);let c=b.zeros(u,n),p=c.data,y=i[f],m=u.reduce((h,g)=>h*g,1);if(d(n)){let h=o,g=p;for(let v=0;v<m;v++){let w=k(v,f,0,i),A=P(w,i),S=h[A];for(let O=1;O<y;O++){let j=k(v,f,O,i),F=P(j,i),M=h[F];M>S&&(S=M)}g[v]=S}}else for(let h=0;h<m;h++){let g=-1/0;for(let v=0;v<y;v++){let w=k(h,f,v,i),A=P(w,i),S=Number(o[A]);S>g&&(g=S)}p[h]=g}if(t){let h=[...i];return h[f]=1,b.fromData(p,h,n)}return c}function Ge(e,r,t=!1){let n=e.dtype,i=e.shape,a=i.length,s=e.size,o=e.data;if(r===void 0)if(d(n)){let h=o,g=BigInt(1);for(let v=0;v<s;v++)g*=h[v];return Number(g)}else{let h=1;for(let g=0;g<s;g++)h*=Number(o[g]);return h}let f=r;if(f<0&&(f=a+f),f<0||f>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(i).filter((h,g)=>g!==f);if(u.length===0)return Ge(e);let c=b.zeros(u,n),p=c.data,y=i[f],m=u.reduce((h,g)=>h*g,1);if(d(n)){let h=o,g=p;for(let v=0;v<m;v++){let w=BigInt(1);for(let A=0;A<y;A++){let S=k(v,f,A,i),O=P(S,i);w*=h[O]}g[v]=w}}else for(let h=0;h<m;h++){let g=1;for(let v=0;v<y;v++){let w=k(h,f,v,i),A=P(w,i);g*=Number(o[A])}p[h]=g}if(t){let h=[...i];return h[f]=1,b.fromData(p,h,n)}return c}function Ye(e,r,t=!1){let n=e.dtype,i=e.shape,a=i.length,s=e.size,o=e.data;if(r===void 0){if(s===0)throw new Error("min of empty array");let h=o[0];for(let g=1;g<s;g++)o[g]<h&&(h=o[g]);return Number(h)}let f=r;if(f<0&&(f=a+f),f<0||f>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(i).filter((h,g)=>g!==f);if(u.length===0)return Ye(e);let c=b.zeros(u,n),p=c.data,y=i[f],m=u.reduce((h,g)=>h*g,1);if(d(n)){let h=o,g=p;for(let v=0;v<m;v++){let w=k(v,f,0,i),A=P(w,i),S=h[A];for(let O=1;O<y;O++){let j=k(v,f,O,i),F=P(j,i),M=h[F];M<S&&(S=M)}g[v]=S}}else for(let h=0;h<m;h++){let g=1/0;for(let v=0;v<y;v++){let w=k(h,f,v,i),A=P(w,i),S=Number(o[A]);S<g&&(g=S)}p[h]=g}if(t){let h=[...i];return h[f]=1,b.fromData(p,h,n)}return c}function We(e,r){let t=e.dtype,n=e.shape,i=n.length,a=e.size,s=e.data;if(r===void 0){if(a===0)throw new Error("argmin of empty array");let m=s[0],h=0;for(let g=1;g<a;g++)s[g]<m&&(m=s[g],h=g);return h}let o=r;if(o<0&&(o=i+o),o<0||o>=i)throw new Error(`axis ${r} is out of bounds for array of dimension ${i}`);let f=Array.from(n).filter((m,h)=>h!==o);if(f.length===0)return We(e);let u=b.zeros(f,"int32"),c=u.data,p=n[o],y=f.reduce((m,h)=>m*h,1);if(d(t)){let m=s;for(let h=0;h<y;h++){let g=k(h,o,0,n),v=P(g,n),w=m[v],A=0;for(let S=1;S<p;S++){let O=k(h,o,S,n),j=P(O,n),F=m[j];F<w&&(w=F,A=S)}c[h]=A}}else for(let m=0;m<y;m++){let h=1/0,g=0;for(let v=0;v<p;v++){let w=k(m,o,v,n),A=P(w,n),S=Number(s[A]);S<h&&(h=S,g=v)}c[m]=g}return u}function Ze(e,r){let t=e.dtype,n=e.shape,i=n.length,a=e.size,s=e.data;if(r===void 0){if(a===0)throw new Error("argmax of empty array");let m=s[0],h=0;for(let g=1;g<a;g++)s[g]>m&&(m=s[g],h=g);return h}let o=r;if(o<0&&(o=i+o),o<0||o>=i)throw new Error(`axis ${r} is out of bounds for array of dimension ${i}`);let f=Array.from(n).filter((m,h)=>h!==o);if(f.length===0)return Ze(e);let u=b.zeros(f,"int32"),c=u.data,p=n[o],y=f.reduce((m,h)=>m*h,1);if(d(t)){let m=s;for(let h=0;h<y;h++){let g=k(h,o,0,n),v=P(g,n),w=m[v],A=0;for(let S=1;S<p;S++){let O=k(h,o,S,n),j=P(O,n),F=m[j];F>w&&(w=F,A=S)}c[h]=A}}else for(let m=0;m<y;m++){let h=-1/0,g=0;for(let v=0;v<p;v++){let w=k(m,o,v,n),A=P(w,n),S=Number(s[A]);S>h&&(h=S,g=v)}c[m]=g}return u}function Je(e,r,t=0,n=!1){let i=e.shape,a=i.length,s=e.size,o=e.data,f=ke(e,r,n);if(r===void 0){let w=f,A=0;for(let S=0;S<s;S++){let O=Number(o[S])-w;A+=O*O}return A/(s-t)}let u=r;if(u<0&&(u=a+u),u<0||u>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let c=i[u],p=f,y=p.data,m=n?p.shape:Array.from(i).filter((w,A)=>A!==u),h=b.zeros(Array.from(m),"float64"),g=h.data,v=m.reduce((w,A)=>w*A,1);for(let w=0;w<v;w++){let A=0,S=Number(y[w]);for(let O=0;O<c;O++){let j=k(w,u,O,i),F=P(j,i),M=Number(o[F])-S;A+=M*M}g[w]=A/(c-t)}return h}function Kn(e,r,t=0,n=!1){let i=Je(e,r,t,n);if(typeof i=="number")return Math.sqrt(i);let a=b.zeros(Array.from(i.shape),"float64"),s=i.data,o=a.data;for(let f=0;f<s.length;f++)o[f]=Math.sqrt(Number(s[f]));return a}function He(e,r,t=!1){let n=e.shape,i=n.length,a=e.size,s=e.data;if(r===void 0){for(let m=0;m<a;m++)if(!s[m])return!1;return!0}let o=r;if(o<0&&(o=i+o),o<0||o>=i)throw new Error(`axis ${r} is out of bounds for array of dimension ${i}`);let f=Array.from(n).filter((m,h)=>h!==o);if(f.length===0)return He(e);let u=b.zeros(f,"bool"),c=u.data,p=n[o],y=f.reduce((m,h)=>m*h,1);for(let m=0;m<y;m++){let h=!0;for(let g=0;g<p;g++){let v=k(m,o,g,n),w=P(v,n);if(!s[w]){h=!1;break}}c[m]=h?1:0}if(t){let m=[...n];return m[o]=1,b.fromData(c,m,"bool")}return u}function Xe(e,r,t=!1){let n=e.shape,i=n.length,a=e.size,s=e.data;if(r===void 0){for(let m=0;m<a;m++)if(s[m])return!0;return!1}let o=r;if(o<0&&(o=i+o),o<0||o>=i)throw new Error(`axis ${r} is out of bounds for array of dimension ${i}`);let f=Array.from(n).filter((m,h)=>h!==o);if(f.length===0)return Xe(e);let u=b.zeros(f,"bool"),c=u.data,p=n[o],y=f.reduce((m,h)=>m*h,1);for(let m=0;m<y;m++){let h=!1;for(let g=0;g<p;g++){let v=k(m,o,g,n),w=P(v,n);if(s[w]){h=!0;break}}c[m]=h?1:0}if(t){let m=[...n];return m[o]=1,b.fromData(c,m,"bool")}return u}function ri(e,r){let t=e.size,n=e.dtype,i=r.indexOf(-1),a;if(i!==-1){let u=r.reduce((p,y,m)=>m===i?p:p*y,1),c=t/u;if(!Number.isInteger(c))throw new Error(`cannot reshape array of size ${t} into shape ${JSON.stringify(r)}`);a=r.map((p,y)=>y===i?c:p)}else a=r;if(a.reduce((u,c)=>u*c,1)!==t)throw new Error(`cannot reshape array of size ${t} into shape ${JSON.stringify(a)}`);if(e.isCContiguous){let u=e.data;return b.fromData(u,a,n,Le(a),0)}let f=e.copy().data;return b.fromData(f,a,n,Le(a),0)}function Qe(e){let r=e.shape,t=r.length,n=e.size,i=e.dtype,a=X(i);if(!a)throw new Error(`Cannot flatten array with dtype ${i}`);let s=new a(n),o=0,f=(u,c)=>{if(c===t){let p=e.get(...u);s[o++]=p;return}for(let p=0;p<r[c];p++)u[c]=p,f(u,c+1)};return f(new Array(t),0),b.fromData(s,[n],i,[1],0)}function ei(e){let r=e.size,t=e.dtype;if(e.isCContiguous){let n=e.data;return b.fromData(n,[r],t,[1],0)}return Qe(e)}function ti(e,r){let t=e.shape,n=t.length,i=e.strides,a=e.data,s=e.dtype,o;if(r===void 0)o=Array.from({length:n},(p,y)=>n-1-y);else{if(r.length!==n)throw new Error(`axes must have length ${n}, got ${r.length}`);let p=new Set;for(let y of r){let m=y<0?n+y:y;if(m<0||m>=n)throw new Error(`axis ${y} is out of bounds for array of dimension ${n}`);if(p.has(m))throw new Error("repeated axis in transpose");p.add(m)}o=r.map(y=>y<0?n+y:y)}let f=o.map(p=>t[p]),u=Array.from(i),c=o.map(p=>u[p]);return b.fromData(a,f,s,c,e.offset)}function ni(e,r){let t=e.shape,n=t.length,i=e.strides,a=e.data,s=e.dtype;if(r===void 0){let o=[],f=[];for(let u=0;u<n;u++)t[u]!==1&&(o.push(t[u]),f.push(i[u]));return o.length===0&&(o.push(1),f.push(1)),b.fromData(a,o,s,f,e.offset)}else{let o=r<0?n+r:r;if(o<0||o>=n)throw new Error(`axis ${r} is out of bounds for array of dimension ${n}`);if(t[o]!==1)throw new Error(`cannot select an axis which has size not equal to one (axis ${r} has size ${t[o]})`);let f=[],u=[];for(let c=0;c<n;c++)c!==o&&(f.push(t[c]),u.push(i[c]));return b.fromData(a,f,s,u,e.offset)}}function ii(e,r){let t=e.shape,n=t.length,i=e.strides,a=e.data,s=e.dtype,o=r;if(o<0&&(o=n+r+1),o<0||o>n)throw new Error(`axis ${r} is out of bounds for array of dimension ${n+1}`);let f=[...Array.from(t)];f.splice(o,0,1);let u=[...Array.from(i)],c=o<n?i[o]*(t[o]||1):1;return u.splice(o,0,c),b.fromData(a,f,s,u,e.offset)}var xh=Kh(Ah(),1);function Eh(e,r){if(e.ndim!==2||r.ndim!==2)throw new Error("matmul requires 2D arrays");let[t=0,n=0]=e.shape,[i=0,a=0]=r.shape;if(n!==i)throw new Error(`matmul shape mismatch: (${t},${n}) @ (${i},${a})`);let s=Tr(e.dtype,r.dtype),o=s.startsWith("int")||s.startsWith("uint")||s==="bool"?"float64":s;if(o!=="float64")throw new Error(`matmul currently only supports float64, got ${o}`);let f=e.dtype==="float64"?e.data:Float64Array.from(Array.from(e.data).map(Number)),u=r.dtype==="float64"?r.data:Float64Array.from(Array.from(r.data).map(Number)),c=b.zeros([t,a],"float64");return(0,xh.default)("row-major","no-transpose","no-transpose",t,a,n,1,f,n,u,a,0,c.data,a),c}function Sh(e){return Un(e,Math.sqrt,!1)}function _h(e,r){return typeof r=="number"?$T(e,r):sr(e,r,Math.pow,"power")}function $T(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,f=t!=="float32"&&t!=="float64"&&(r<0||!Number.isInteger(r))?"float64":t,u=b.zeros(n,f),c=u.data;if(d(t))if(d(f)&&Number.isInteger(r)&&r>=0){let p=i,y=c;for(let m=0;m<a;m++)y[m]=p[m]**BigInt(r)}else for(let p=0;p<a;p++)c[p]=Math.pow(Number(i[p]),r);else for(let p=0;p<a;p++)c[p]=Math.pow(Number(i[p]),r);return u}var rr=class e{constructor(r,t){this._storage=r,this._base=t}get storage(){return this._storage}static _fromStorage(r,t){return new e(r,t)}get shape(){return this._storage.shape}get ndim(){return this._storage.ndim}get size(){return this._storage.size}get dtype(){return this._storage.dtype}get data(){return this._storage.data}get strides(){return this._storage.strides}get flags(){return{C_CONTIGUOUS:this._storage.isCContiguous,F_CONTIGUOUS:this._storage.isFContiguous,OWNDATA:this._base===void 0}}get base(){return this._base??null}get(r){if(r.length!==this.ndim)throw new Error(`Index has ${r.length} dimensions, but array has ${this.ndim} dimensions`);let t=r.map((n,i)=>{let a=n;if(a<0&&(a=this.shape[i]+a),a<0||a>=this.shape[i])throw new Error(`Index ${n} is out of bounds for axis ${i} with size ${this.shape[i]}`);return a});return this._storage.get(...t)}set(r,t){if(r.length!==this.ndim)throw new Error(`Index has ${r.length} dimensions, but array has ${this.ndim} dimensions`);let n=r.map((s,o)=>{let f=s;if(f<0&&(f=this.shape[o]+f),f<0||f>=this.shape[o])throw new Error(`Index ${s} is out of bounds for axis ${o} with size ${this.shape[o]}`);return f}),i=this.dtype,a;d(i)?a=typeof t=="bigint"?t:BigInt(Math.round(t)):i==="bool"?a=t?1:0:a=Number(t),this._storage.set(n,a)}copy(){return new e(this._storage.copy())}astype(r,t=!0){let n=this.dtype;if(n===r&&!t)return this;if(n===r&&t)return this.copy();let i=Array.from(this.shape),a=this.size,s=X(r);if(!s)throw new Error(`Cannot convert to dtype ${r}`);let o=new s(a),f=this.data;if(d(n)&&!d(r)){let c=f;if(r==="bool")for(let p=0;p<a;p++)o[p]=c[p]!==BigInt(0)?1:0;else for(let p=0;p<a;p++)o[p]=Number(c[p])}else if(!d(n)&&d(r)){let c=f;for(let p=0;p<a;p++)o[p]=BigInt(Math.round(Number(c[p])))}else if(r==="bool"){let c=f;for(let p=0;p<a;p++)o[p]=c[p]!==0?1:0}else if(n==="bool"&&!d(r)){let c=f;for(let p=0;p<a;p++)o[p]=c[p]}else if(!d(n)&&!d(r)){let c=f;for(let p=0;p<a;p++)o[p]=c[p]}else{let c=f;for(let p=0;p<a;p++)o[p]=c[p]}let u=b.fromData(o,i,r);return new e(u)}add(r){let t=typeof r=="number"?r:r._storage,n=zn(this._storage,t);return e._fromStorage(n)}subtract(r){let t=typeof r=="number"?r:r._storage,n=Fn(this._storage,t);return e._fromStorage(n)}multiply(r){let t=typeof r=="number"?r:r._storage,n=Rn(this._storage,t);return e._fromStorage(n)}divide(r){let t=typeof r=="number"?r:r._storage,n=jn(this._storage,t);return e._fromStorage(n)}mod(r){let t=typeof r=="number"?r:r._storage,n=Pn(this._storage,t);return e._fromStorage(n)}floor_divide(r){let t=typeof r=="number"?r:r._storage,n=kn(this._storage,t);return e._fromStorage(n)}positive(){let r=$n(this._storage);return e._fromStorage(r)}reciprocal(){let r=Gn(this._storage);return e._fromStorage(r)}sqrt(){let r=Sh(this._storage);return e._fromStorage(r)}power(r){let t=typeof r=="number"?r:r._storage,n=_h(this._storage,t);return e._fromStorage(n)}absolute(){let r=Cn(this._storage);return e._fromStorage(r)}negative(){let r=Ln(this._storage);return e._fromStorage(r)}sign(){let r=Mn(this._storage);return e._fromStorage(r)}greater(r){let t=typeof r=="number"?r:r._storage,n=Yn(this._storage,t);return e._fromStorage(n)}greater_equal(r){let t=typeof r=="number"?r:r._storage,n=Wn(this._storage,t);return e._fromStorage(n)}less(r){let t=typeof r=="number"?r:r._storage,n=Zn(this._storage,t);return e._fromStorage(n)}less_equal(r){let t=typeof r=="number"?r:r._storage,n=Jn(this._storage,t);return e._fromStorage(n)}equal(r){let t=typeof r=="number"?r:r._storage,n=Hn(this._storage,t);return e._fromStorage(n)}not_equal(r){let t=typeof r=="number"?r:r._storage,n=Xn(this._storage,t);return e._fromStorage(n)}isclose(r,t=1e-5,n=1e-8){let i=typeof r=="number"?r:r._storage,a=Pe(this._storage,i,t,n);return e._fromStorage(a)}allclose(r,t=1e-5,n=1e-8){let i=typeof r=="number"?r:r._storage;return Qn(this._storage,i,t,n)}sum(r,t=!1){let n=Mr(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}mean(r,t=!1){let n=ke(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}max(r,t=!1){let n=$e(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}min(r,t=!1){let n=Ye(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}prod(r,t=!1){let n=Ge(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}argmin(r){let t=We(this._storage,r);return typeof t=="number"?t:e._fromStorage(t)}argmax(r){let t=Ze(this._storage,r);return typeof t=="number"?t:e._fromStorage(t)}var(r,t=0,n=!1){let i=Je(this._storage,r,t,n);return typeof i=="number"?i:e._fromStorage(i)}std(r,t=0,n=!1){let i=Kn(this._storage,r,t,n);return typeof i=="number"?i:e._fromStorage(i)}all(r,t=!1){let n=He(this._storage,r,t);return typeof n=="boolean"?n:e._fromStorage(n)}any(r,t=!1){let n=Xe(this._storage,r,t);return typeof n=="boolean"?n:e._fromStorage(n)}reshape(...r){let t=r.length===1&&Array.isArray(r[0])?r[0]:r,n=ri(this._storage,t),a=n.data===this.data?this._base??this:void 0;return e._fromStorage(n,a)}flatten(){let r=Qe(this._storage);return e._fromStorage(r)}ravel(){let r=ei(this._storage),n=r.data===this.data?this._base??this:void 0;return e._fromStorage(r,n)}transpose(r){let t=ti(this._storage,r),n=this._base??this;return e._fromStorage(t,n)}squeeze(r){let t=ni(this._storage,r),n=this._base??this;return e._fromStorage(t,n)}expand_dims(r){let t=ii(this._storage,r),n=this._base??this;return e._fromStorage(t,n)}matmul(r){let t=Eh(this._storage,r._storage);return e._fromStorage(t)}slice(...r){if(r.length===0)return this;if(r.length>this.ndim)throw new Error(`Too many indices for array: array is ${this.ndim}-dimensional, but ${r.length} were indexed`);let t=r.map((f,u)=>{let c=Nn(f);return Bn(c,this.shape[u])});for(;t.length<this.ndim;)t.push({start:0,stop:this.shape[t.length],step:1,isIndex:!1});let n=[],i=[],a=this._storage.offset;for(let f=0;f<t.length;f++){let u=t[f],c=this._storage.strides[f];if(a+=u.start*c,!u.isIndex){let p;u.step>0?p=Math.max(0,Math.ceil((u.stop-u.start)/u.step)):p=Math.max(0,Math.ceil((u.start-u.stop)/Math.abs(u.step))),n.push(p),i.push(c*u.step)}}let s=b.fromData(this._storage.data,n,this._storage.dtype,i,a),o=this._base??this;return new e(s,o)}row(r){if(this.ndim<2)throw new Error("row() requires at least 2 dimensions");return this.slice(String(r),":")}col(r){if(this.ndim<2)throw new Error("col() requires at least 2 dimensions");return this.slice(":",String(r))}rows(r,t){if(this.ndim<2)throw new Error("rows() requires at least 2 dimensions");return this.slice(`${r}:${t}`,":")}cols(r,t){if(this.ndim<2)throw new Error("cols() requires at least 2 dimensions");return this.slice(":",`${r}:${t}`)}toString(){return`NDArray(shape=${JSON.stringify(this.shape)}, dtype=${this.dtype})`}toArray(){if(this.ndim===0)return this._storage.iget(0);let r=this.shape,t=r.length,n=(i,a)=>{if(a===t)return this._storage.get(...i);let s=[];for(let o=0;o<r[a];o++)i[a]=o,s.push(n(i,a+1));return s};return n(new Array(t),0)}};function ce(e,r=H){let t=b.zeros(e,r);return new rr(t)}function An(e,r=H){let t=b.ones(e,r);return new rr(t)}function YT(e){let r=[],t=e;for(;Array.isArray(t);)r.push(t.length),t=t[0];return r}function Th(e){return typeof e=="bigint"?!0:Array.isArray(e)?e.some(r=>Th(r)):!1}function WT(e){let r=[];function t(n){Array.isArray(n)?n.forEach(i=>t(i)):r.push(n)}return t(e),r}function xr(e,r){if(e instanceof rr)return!r||e.dtype===r?e.copy():e.astype(r);let t=Th(e),n=YT(e),i=n.reduce((c,p)=>c*p,1),a=r;a||(t?a="int64":a=H);let s=X(a);if(!s)throw new Error(`Cannot create array with dtype ${a}`);let o=new s(i),f=WT(e);if(d(a)){let c=o;for(let p=0;p<i;p++){let y=f[p];c[p]=typeof y=="bigint"?y:BigInt(Math.round(Number(y)))}}else if(a==="bool"){let c=o;for(let p=0;p<i;p++)c[p]=f[p]?1:0}else{let c=o;for(let p=0;p<i;p++){let y=f[p];c[p]=Number(y)}}let u=b.fromData(o,n,a);return new rr(u)}function qh(e,r,t=1,n=H){let i=e,a=r;if(r===void 0&&(i=0,a=e),a===void 0)throw new Error("stop is required");let s=Math.max(0,Math.ceil((a-i)/t)),o=X(n);if(!o)throw new Error(`Cannot create arange array with dtype ${n}`);let f=new o(s);if(d(n))for(let c=0;c<s;c++)f[c]=BigInt(Math.round(i+c*t));else if(n==="bool")for(let c=0;c<s;c++)f[c]=i+c*t!==0?1:0;else for(let c=0;c<s;c++)f[c]=i+c*t;let u=b.fromData(f,[s],n);return new rr(u)}function Ih(e,r,t=50,n=H){if(t<0)throw new Error("num must be non-negative");if(t===0)return xr([],n);if(t===1)return xr([e],n);let i=X(n);if(!i)throw new Error(`Cannot create linspace array with dtype ${n}`);let a=new i(t),s=(r-e)/(t-1);if(d(n))for(let f=0;f<t;f++)a[f]=BigInt(Math.round(e+f*s));else if(n==="bool")for(let f=0;f<t;f++)a[f]=e+f*s!==0?1:0;else for(let f=0;f<t;f++)a[f]=e+f*s;let o=b.fromData(a,[t],n);return new rr(o)}function Dh(e,r,t=50,n=10,i=H){if(t<0)throw new Error("num must be non-negative");if(t===0)return xr([],i);if(t===1)return xr([Math.pow(n,e)],i);let a=X(i);if(!a)throw new Error(`Cannot create logspace array with dtype ${i}`);let s=new a(t),o=(r-e)/(t-1);if(d(i))for(let u=0;u<t;u++){let c=e+u*o;s[u]=BigInt(Math.round(Math.pow(n,c)))}else if(i==="bool")for(let u=0;u<t;u++){let c=e+u*o;s[u]=Math.pow(n,c)!==0?1:0}else for(let u=0;u<t;u++){let c=e+u*o;s[u]=Math.pow(n,c)}let f=b.fromData(s,[t],i);return new rr(f)}function Nh(e,r,t=50,n=H){if(t<0)throw new Error("num must be non-negative");if(e===0||r===0)throw new Error("Geometric sequence cannot include zero");if(t===0)return xr([],n);if(t===1)return xr([e],n);let i=Math.sign(e),a=Math.sign(r);if(i!==a)throw new Error("Geometric sequence cannot contain both positive and negative values");let s=X(n);if(!s)throw new Error(`Cannot create geomspace array with dtype ${n}`);let o=new s(t),f=Math.log(Math.abs(e)),c=(Math.log(Math.abs(r))-f)/(t-1);if(d(n))for(let y=0;y<t;y++){let m=i*Math.exp(f+y*c);o[y]=BigInt(Math.round(m))}else if(n==="bool")for(let y=0;y<t;y++){let m=i*Math.exp(f+y*c);o[y]=m!==0?1:0}else for(let y=0;y<t;y++){let m=i*Math.exp(f+y*c);o[y]=m}let p=b.fromData(o,[t],n);return new rr(p)}function xn(e,r,t=0,n=H){let i=r??e,a=ce([e,i],n),s=a.data;if(d(n)){let o=s;for(let f=0;f<e;f++){let u=f+t;u>=0&&u<i&&(o[f*i+u]=BigInt(1))}}else{let o=s;for(let f=0;f<e;f++){let u=f+t;u>=0&&u<i&&(o[f*i+u]=1)}}return a}function En(e,r=H){return ce(e,r)}function Sn(e,r,t){let n=t;n||(typeof r=="bigint"?n="int64":typeof r=="boolean"?n="bool":Number.isInteger(r)?n="int32":n=H);let i=X(n);if(!i)throw new Error(`Cannot create full array with dtype ${n}`);let a=e.reduce((f,u)=>f*u,1),s=new i(a);if(d(n)){let f=typeof r=="bigint"?r:BigInt(Math.round(Number(r)));s.fill(f)}else n==="bool"?s.fill(r?1:0):s.fill(Number(r));let o=b.fromData(s,e,n);return new rr(o)}function Bh(e,r=H){return xn(e,e,0,r)}function Oh(e,r){return e instanceof rr?!r||e.dtype===r?e:e.astype(r):xr(e,r)}function Vh(e){return e.copy()}function Uh(e,r){return ce(Array.from(e.shape),r??e.dtype)}function zh(e,r){return An(Array.from(e.shape),r??e.dtype)}function Fh(e,r){return En(Array.from(e.shape),r??e.dtype)}function Rh(e,r,t){return Sn(Array.from(e.shape),r,t??e.dtype)}function jh(e){return e.sqrt()}function Ch(e,r){return e.power(r)}function Lh(e){return e.absolute()}function Mh(e){return e.negative()}function Ph(e){return e.sign()}function kh(e,r){return e.mod(r)}function $h(e,r){return e.floor_divide(r)}function Gh(e){return e.positive()}function Yh(e){return e.reciprocal()}var ZT="0.3.0";0&&(module.exports={NDArray,__version__,absolute,arange,array,asarray,copy,empty,empty_like,eye,floor_divide,full,full_like,geomspace,identity,linspace,logspace,mod,negative,ones,ones_like,positive,power,reciprocal,sign,sqrt,zeros,zeros_like});
2
- /*! Bundled license information:
3
-
4
- @stdlib/object/ctor/lib/main.js:
5
- @stdlib/object/ctor/lib/index.js:
6
- @stdlib/string/base/format-interpolate/lib/is_number.js:
7
- @stdlib/string/base/format-interpolate/lib/zero_pad.js:
8
- @stdlib/string/base/format-interpolate/lib/format_integer.js:
9
- @stdlib/string/base/format-interpolate/lib/is_string.js:
10
- @stdlib/string/base/format-interpolate/lib/format_double.js:
11
- @stdlib/string/base/format-interpolate/lib/space_pad.js:
12
- @stdlib/string/base/format-interpolate/lib/main.js:
13
- @stdlib/string/base/format-interpolate/lib/index.js:
14
- @stdlib/string/base/format-tokenize/lib/main.js:
15
- @stdlib/string/base/format-tokenize/lib/index.js:
16
- @stdlib/string/format/lib/is_string.js:
17
- @stdlib/string/format/lib/main.js:
18
- @stdlib/string/format/lib/index.js:
19
- @stdlib/boolean/ctor/lib/main.js:
20
- @stdlib/boolean/ctor/lib/index.js:
21
- @stdlib/utils/global/lib/global_this.js:
22
- @stdlib/array/base/assert/is-accessor-array/lib/main.js:
23
- @stdlib/array/base/assert/is-accessor-array/lib/index.js:
24
- @stdlib/array/base/accessor-getter/lib/main.js:
25
- @stdlib/array/base/accessor-getter/lib/index.js:
26
- @stdlib/array/base/getter/lib/main.js:
27
- @stdlib/array/base/getter/lib/index.js:
28
- @stdlib/ndarray/base/unary-tiling-block-size/lib/defaults.js:
29
- @stdlib/ndarray/base/unary-tiling-block-size/lib/main.js:
30
- @stdlib/ndarray/base/unary-tiling-block-size/lib/index.js:
31
- (**
32
- * @license Apache-2.0
33
- *
34
- * Copyright (c) 2022 The Stdlib Authors.
35
- *
36
- * Licensed under the Apache License, Version 2.0 (the "License");
37
- * you may not use this file except in compliance with the License.
38
- * You may obtain a copy of the License at
39
- *
40
- * http://www.apache.org/licenses/LICENSE-2.0
41
- *
42
- * Unless required by applicable law or agreed to in writing, software
43
- * distributed under the License is distributed on an "AS IS" BASIS,
44
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45
- * See the License for the specific language governing permissions and
46
- * limitations under the License.
47
- *)
48
-
49
- @stdlib/utils/type-of/lib/fixtures/re.js:
50
- @stdlib/utils/define-property/lib/builtin.js:
51
- @stdlib/utils/define-property/lib/polyfill.js:
52
- @stdlib/utils/define-property/lib/index.js:
53
- @stdlib/utils/define-nonenumerable-read-only-property/lib/main.js:
54
- @stdlib/utils/define-nonenumerable-read-only-property/lib/index.js:
55
- @stdlib/assert/is-boolean/lib/primitive.js:
56
- @stdlib/assert/has-symbol-support/lib/main.js:
57
- @stdlib/assert/has-symbol-support/lib/index.js:
58
- @stdlib/assert/has-tostringtag-support/lib/main.js:
59
- @stdlib/assert/has-tostringtag-support/lib/index.js:
60
- @stdlib/utils/native-class/lib/tostring.js:
61
- @stdlib/utils/native-class/lib/main.js:
62
- @stdlib/assert/has-own-property/lib/main.js:
63
- @stdlib/assert/has-own-property/lib/index.js:
64
- @stdlib/symbol/ctor/lib/main.js:
65
- @stdlib/symbol/ctor/lib/index.js:
66
- @stdlib/utils/native-class/lib/tostringtag.js:
67
- @stdlib/utils/native-class/lib/polyfill.js:
68
- @stdlib/utils/native-class/lib/index.js:
69
- @stdlib/assert/is-boolean/lib/tostring.js:
70
- @stdlib/assert/is-boolean/lib/try2serialize.js:
71
- @stdlib/assert/is-boolean/lib/object.js:
72
- @stdlib/assert/is-boolean/lib/main.js:
73
- @stdlib/assert/is-boolean/lib/index.js:
74
- @stdlib/utils/global/lib/codegen.js:
75
- @stdlib/utils/global/lib/self.js:
76
- @stdlib/utils/global/lib/window.js:
77
- @stdlib/utils/global/lib/global.js:
78
- @stdlib/utils/global/lib/main.js:
79
- @stdlib/utils/global/lib/index.js:
80
- @stdlib/utils/type-of/lib/fixtures/nodelist.js:
81
- @stdlib/utils/type-of/lib/fixtures/typedarray.js:
82
- @stdlib/utils/type-of/lib/check.js:
83
- @stdlib/regexp/function-name/lib/regexp.js:
84
- @stdlib/assert/is-array/lib/main.js:
85
- @stdlib/assert/is-array/lib/index.js:
86
- @stdlib/assert/tools/array-function/lib/main.js:
87
- @stdlib/assert/tools/array-function/lib/index.js:
88
- @stdlib/assert/is-object-like/lib/main.js:
89
- @stdlib/assert/is-object-like/lib/index.js:
90
- @stdlib/assert/is-buffer/lib/main.js:
91
- @stdlib/assert/is-buffer/lib/index.js:
92
- @stdlib/utils/constructor-name/lib/main.js:
93
- @stdlib/utils/constructor-name/lib/index.js:
94
- @stdlib/utils/type-of/lib/main.js:
95
- @stdlib/utils/type-of/lib/polyfill.js:
96
- @stdlib/utils/type-of/lib/index.js:
97
- @stdlib/assert/is-function/lib/main.js:
98
- @stdlib/assert/is-function/lib/index.js:
99
- @stdlib/utils/get-prototype-of/lib/native.js:
100
- @stdlib/utils/get-prototype-of/lib/proto.js:
101
- @stdlib/utils/get-prototype-of/lib/polyfill.js:
102
- @stdlib/utils/get-prototype-of/lib/detect.js:
103
- @stdlib/utils/get-prototype-of/lib/main.js:
104
- @stdlib/utils/get-prototype-of/lib/index.js:
105
- @stdlib/assert/is-error/lib/main.js:
106
- @stdlib/assert/is-error/lib/index.js:
107
- @stdlib/utils/try-require/lib/main.js:
108
- @stdlib/utils/try-require/lib/index.js:
109
- @stdlib/math/base/special/fast/max/lib/main.js:
110
- @stdlib/math/base/special/fast/max/lib/index.js:
111
- @stdlib/assert/is-float64array/lib/main.js:
112
- @stdlib/assert/is-float64array/lib/index.js:
113
- @stdlib/assert/has-float64array-support/lib/float64array.js:
114
- @stdlib/assert/has-float64array-support/lib/main.js:
115
- @stdlib/assert/has-float64array-support/lib/index.js:
116
- @stdlib/array/float64/lib/main.js:
117
- @stdlib/array/float64/lib/polyfill.js:
118
- @stdlib/array/float64/lib/index.js:
119
- @stdlib/assert/is-float32array/lib/main.js:
120
- @stdlib/assert/is-float32array/lib/index.js:
121
- @stdlib/constants/float64/pinf/lib/index.js:
122
- @stdlib/assert/has-float32array-support/lib/float32array.js:
123
- @stdlib/assert/has-float32array-support/lib/main.js:
124
- @stdlib/assert/has-float32array-support/lib/index.js:
125
- @stdlib/array/float32/lib/main.js:
126
- @stdlib/array/float32/lib/polyfill.js:
127
- @stdlib/array/float32/lib/index.js:
128
- @stdlib/assert/is-uint32array/lib/main.js:
129
- @stdlib/assert/is-uint32array/lib/index.js:
130
- @stdlib/constants/uint32/max/lib/index.js:
131
- @stdlib/assert/has-uint32array-support/lib/uint32array.js:
132
- @stdlib/assert/has-uint32array-support/lib/main.js:
133
- @stdlib/assert/has-uint32array-support/lib/index.js:
134
- @stdlib/array/uint32/lib/main.js:
135
- @stdlib/array/uint32/lib/polyfill.js:
136
- @stdlib/array/uint32/lib/index.js:
137
- @stdlib/assert/is-int32array/lib/main.js:
138
- @stdlib/assert/is-int32array/lib/index.js:
139
- @stdlib/constants/int32/max/lib/index.js:
140
- @stdlib/constants/int32/min/lib/index.js:
141
- @stdlib/assert/has-int32array-support/lib/int32array.js:
142
- @stdlib/assert/has-int32array-support/lib/main.js:
143
- @stdlib/assert/has-int32array-support/lib/index.js:
144
- @stdlib/array/int32/lib/main.js:
145
- @stdlib/array/int32/lib/polyfill.js:
146
- @stdlib/array/int32/lib/index.js:
147
- @stdlib/assert/is-uint16array/lib/main.js:
148
- @stdlib/assert/is-uint16array/lib/index.js:
149
- @stdlib/constants/uint16/max/lib/index.js:
150
- @stdlib/assert/has-uint16array-support/lib/uint16array.js:
151
- @stdlib/assert/has-uint16array-support/lib/main.js:
152
- @stdlib/assert/has-uint16array-support/lib/index.js:
153
- @stdlib/array/uint16/lib/main.js:
154
- @stdlib/array/uint16/lib/polyfill.js:
155
- @stdlib/array/uint16/lib/index.js:
156
- @stdlib/assert/is-int16array/lib/main.js:
157
- @stdlib/assert/is-int16array/lib/index.js:
158
- @stdlib/constants/int16/max/lib/index.js:
159
- @stdlib/constants/int16/min/lib/index.js:
160
- @stdlib/assert/has-int16array-support/lib/int16array.js:
161
- @stdlib/assert/has-int16array-support/lib/main.js:
162
- @stdlib/assert/has-int16array-support/lib/index.js:
163
- @stdlib/array/int16/lib/main.js:
164
- @stdlib/array/int16/lib/polyfill.js:
165
- @stdlib/array/int16/lib/index.js:
166
- @stdlib/assert/is-uint8array/lib/main.js:
167
- @stdlib/assert/is-uint8array/lib/index.js:
168
- @stdlib/constants/uint8/max/lib/index.js:
169
- @stdlib/assert/has-uint8array-support/lib/uint8array.js:
170
- @stdlib/assert/has-uint8array-support/lib/main.js:
171
- @stdlib/assert/has-uint8array-support/lib/index.js:
172
- @stdlib/array/uint8/lib/main.js:
173
- @stdlib/array/uint8/lib/polyfill.js:
174
- @stdlib/array/uint8/lib/index.js:
175
- @stdlib/assert/is-uint8clampedarray/lib/main.js:
176
- @stdlib/assert/is-uint8clampedarray/lib/index.js:
177
- @stdlib/assert/has-uint8clampedarray-support/lib/uint8clampedarray.js:
178
- @stdlib/assert/has-uint8clampedarray-support/lib/main.js:
179
- @stdlib/assert/has-uint8clampedarray-support/lib/index.js:
180
- @stdlib/array/uint8c/lib/main.js:
181
- @stdlib/array/uint8c/lib/polyfill.js:
182
- @stdlib/array/uint8c/lib/index.js:
183
- @stdlib/assert/is-int8array/lib/main.js:
184
- @stdlib/assert/is-int8array/lib/index.js:
185
- @stdlib/constants/int8/max/lib/index.js:
186
- @stdlib/constants/int8/min/lib/index.js:
187
- @stdlib/assert/has-int8array-support/lib/int8array.js:
188
- @stdlib/assert/has-int8array-support/lib/main.js:
189
- @stdlib/assert/has-int8array-support/lib/index.js:
190
- @stdlib/array/int8/lib/main.js:
191
- @stdlib/array/int8/lib/polyfill.js:
192
- @stdlib/array/int8/lib/index.js:
193
- @stdlib/assert/is-number/lib/primitive.js:
194
- @stdlib/number/ctor/lib/main.js:
195
- @stdlib/number/ctor/lib/index.js:
196
- @stdlib/assert/is-number/lib/tostring.js:
197
- @stdlib/assert/is-number/lib/try2serialize.js:
198
- @stdlib/assert/is-number/lib/object.js:
199
- @stdlib/assert/is-number/lib/main.js:
200
- @stdlib/assert/is-number/lib/index.js:
201
- @stdlib/constants/float64/ninf/lib/index.js:
202
- @stdlib/math/base/special/floor/lib/main.js:
203
- @stdlib/math/base/special/floor/lib/index.js:
204
- @stdlib/math/base/assert/is-integer/lib/main.js:
205
- @stdlib/math/base/assert/is-integer/lib/index.js:
206
- @stdlib/assert/is-integer/lib/integer.js:
207
- @stdlib/assert/is-integer/lib/primitive.js:
208
- @stdlib/assert/is-integer/lib/object.js:
209
- @stdlib/assert/is-integer/lib/main.js:
210
- @stdlib/assert/is-integer/lib/index.js:
211
- @stdlib/assert/is-nonnegative-integer/lib/primitive.js:
212
- @stdlib/assert/is-nonnegative-integer/lib/object.js:
213
- @stdlib/assert/is-nonnegative-integer/lib/main.js:
214
- @stdlib/assert/is-nonnegative-integer/lib/index.js:
215
- @stdlib/constants/array/max-array-length/lib/index.js:
216
- @stdlib/assert/is-array-like-object/lib/main.js:
217
- @stdlib/assert/is-array-like-object/lib/index.js:
218
- @stdlib/constants/array/max-typed-array-length/lib/index.js:
219
- @stdlib/assert/is-collection/lib/main.js:
220
- @stdlib/assert/is-collection/lib/index.js:
221
- @stdlib/assert/is-arraybuffer/lib/main.js:
222
- @stdlib/assert/is-arraybuffer/lib/index.js:
223
- @stdlib/assert/is-object/lib/main.js:
224
- @stdlib/assert/is-object/lib/index.js:
225
- @stdlib/assert/is-string/lib/primitive.js:
226
- @stdlib/assert/is-string/lib/valueof.js:
227
- @stdlib/assert/is-string/lib/try2valueof.js:
228
- @stdlib/assert/is-string/lib/object.js:
229
- @stdlib/assert/is-string/lib/main.js:
230
- @stdlib/assert/is-string/lib/index.js:
231
- @stdlib/assert/is-string-array/lib/index.js:
232
- @stdlib/complex/float64/ctor/lib/tostring.js:
233
- @stdlib/complex/float64/ctor/lib/tojson.js:
234
- @stdlib/complex/float64/ctor/lib/main.js:
235
- @stdlib/complex/float64/ctor/lib/index.js:
236
- @stdlib/number/float64/base/to-float32/lib/main.js:
237
- @stdlib/number/float64/base/to-float32/lib/polyfill.js:
238
- @stdlib/number/float64/base/to-float32/lib/index.js:
239
- @stdlib/complex/float32/ctor/lib/tostring.js:
240
- @stdlib/complex/float32/ctor/lib/tojson.js:
241
- @stdlib/complex/float32/ctor/lib/main.js:
242
- @stdlib/complex/float32/ctor/lib/index.js:
243
- @stdlib/assert/is-complex-like/lib/main.js:
244
- @stdlib/assert/is-complex-like/lib/index.js:
245
- @stdlib/math/base/assert/is-even/lib/main.js:
246
- @stdlib/math/base/assert/is-even/lib/index.js:
247
- @stdlib/assert/has-iterator-symbol-support/lib/main.js:
248
- @stdlib/assert/has-iterator-symbol-support/lib/index.js:
249
- @stdlib/symbol/iterator/lib/main.js:
250
- @stdlib/symbol/iterator/lib/index.js:
251
- @stdlib/utils/define-nonenumerable-read-only-accessor/lib/main.js:
252
- @stdlib/utils/define-nonenumerable-read-only-accessor/lib/index.js:
253
- @stdlib/array/complex64/lib/from_iterator.js:
254
- @stdlib/array/complex64/lib/from_iterator_map.js:
255
- @stdlib/array/complex64/lib/from_array.js:
256
- @stdlib/array/complex64/lib/main.js:
257
- @stdlib/array/complex64/lib/index.js:
258
- @stdlib/complex/float64/real/lib/main.js:
259
- @stdlib/complex/float64/real/lib/index.js:
260
- @stdlib/complex/float64/imag/lib/main.js:
261
- @stdlib/complex/float64/imag/lib/index.js:
262
- @stdlib/array/complex128/lib/from_iterator.js:
263
- @stdlib/array/complex128/lib/from_iterator_map.js:
264
- @stdlib/array/complex128/lib/from_array.js:
265
- @stdlib/array/complex128/lib/index.js:
266
- @stdlib/array/dtype/lib/main.js:
267
- @stdlib/array/dtype/lib/index.js:
268
- @stdlib/math/base/special/abs/lib/index.js:
269
- @stdlib/ndarray/base/assert/is-row-major/lib/main.js:
270
- @stdlib/ndarray/base/assert/is-row-major/lib/index.js:
271
- @stdlib/ndarray/base/bytes-per-element/lib/main.js:
272
- @stdlib/ndarray/base/bytes-per-element/lib/index.js:
273
- (**
274
- * @license Apache-2.0
275
- *
276
- * Copyright (c) 2018 The Stdlib Authors.
277
- *
278
- * Licensed under the Apache License, Version 2.0 (the "License");
279
- * you may not use this file except in compliance with the License.
280
- * You may obtain a copy of the License at
281
- *
282
- * http://www.apache.org/licenses/LICENSE-2.0
283
- *
284
- * Unless required by applicable law or agreed to in writing, software
285
- * distributed under the License is distributed on an "AS IS" BASIS,
286
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
287
- * See the License for the specific language governing permissions and
288
- * limitations under the License.
289
- *)
290
-
291
- @stdlib/utils/define-property/lib/define_property.js:
292
- @stdlib/utils/define-property/lib/has_define_property_support.js:
293
- @stdlib/regexp/function-name/lib/main.js:
294
- @stdlib/regexp/function-name/lib/index.js:
295
- @stdlib/complex/float32/real/lib/main.js:
296
- @stdlib/complex/float32/real/lib/index.js:
297
- @stdlib/complex/float32/imag/lib/main.js:
298
- @stdlib/complex/float32/imag/lib/index.js:
299
- @stdlib/strided/base/reinterpret-complex64/lib/main.js:
300
- @stdlib/strided/base/reinterpret-complex64/lib/index.js:
301
- @stdlib/strided/base/reinterpret-complex128/lib/main.js:
302
- @stdlib/strided/base/reinterpret-complex128/lib/index.js:
303
- @stdlib/math/base/special/abs/lib/main.js:
304
- (**
305
- * @license Apache-2.0
306
- *
307
- * Copyright (c) 2021 The Stdlib Authors.
308
- *
309
- * Licensed under the Apache License, Version 2.0 (the "License");
310
- * you may not use this file except in compliance with the License.
311
- * You may obtain a copy of the License at
312
- *
313
- * http://www.apache.org/licenses/LICENSE-2.0
314
- *
315
- * Unless required by applicable law or agreed to in writing, software
316
- * distributed under the License is distributed on an "AS IS" BASIS,
317
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
318
- * See the License for the specific language governing permissions and
319
- * limitations under the License.
320
- *)
321
-
322
- @stdlib/array/dtype/lib/ctor2dtype.js:
323
- @stdlib/array/base/assert/is-complex64array/lib/main.js:
324
- @stdlib/array/base/assert/is-complex64array/lib/index.js:
325
- @stdlib/array/base/assert/is-complex128array/lib/main.js:
326
- @stdlib/array/base/assert/is-complex128array/lib/index.js:
327
- @stdlib/array/complex128/lib/main.js:
328
- @stdlib/array/bool/lib/from_iterator.js:
329
- @stdlib/array/bool/lib/from_iterator_map.js:
330
- @stdlib/array/bool/lib/from_array.js:
331
- @stdlib/array/bool/lib/main.js:
332
- @stdlib/array/bool/lib/index.js:
333
- @stdlib/array/dtype/lib/ctors.js:
334
- @stdlib/array/dtype/lib/dtypes.js:
335
- @stdlib/blas/base/layouts/lib/main.js:
336
- @stdlib/blas/base/layouts/lib/enum.js:
337
- @stdlib/blas/base/layouts/lib/index.js:
338
- @stdlib/blas/base/assert/is-layout/lib/main.js:
339
- @stdlib/blas/base/assert/is-layout/lib/index.js:
340
- @stdlib/blas/base/transpose-operations/lib/main.js:
341
- @stdlib/blas/base/transpose-operations/lib/enum.js:
342
- @stdlib/blas/base/transpose-operations/lib/index.js:
343
- @stdlib/blas/base/assert/is-transpose-operation/lib/main.js:
344
- @stdlib/blas/base/assert/is-transpose-operation/lib/index.js:
345
- @stdlib/strided/base/stride2offset/lib/main.js:
346
- @stdlib/strided/base/stride2offset/lib/index.js:
347
- @stdlib/blas/base/dgemm/lib/base.js:
348
- @stdlib/blas/base/dgemm/lib/dgemm.js:
349
- @stdlib/blas/base/dgemm/lib/ndarray.js:
350
- @stdlib/blas/base/dgemm/lib/main.js:
351
- @stdlib/blas/base/dgemm/lib/index.js:
352
- (**
353
- * @license Apache-2.0
354
- *
355
- * Copyright (c) 2024 The Stdlib Authors.
356
- *
357
- * Licensed under the Apache License, Version 2.0 (the "License");
358
- * you may not use this file except in compliance with the License.
359
- * You may obtain a copy of the License at
360
- *
361
- * http://www.apache.org/licenses/LICENSE-2.0
362
- *
363
- * Unless required by applicable law or agreed to in writing, software
364
- * distributed under the License is distributed on an "AS IS" BASIS,
365
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
366
- * See the License for the specific language governing permissions and
367
- * limitations under the License.
368
- *)
369
-
370
- @stdlib/array/base/assert/contains/lib/main.js:
371
- @stdlib/array/base/assert/contains/lib/factory.js:
372
- @stdlib/array/base/assert/contains/lib/index.js:
373
- (**
374
- * @license Apache-2.0
375
- *
376
- * Copyright (c) 2023 The Stdlib Authors.
377
- *
378
- * Licensed under the Apache License, Version 2.0 (the "License");
379
- * you may not use this file except in compliance with the License.
380
- * You may obtain a copy of the License at
381
- *
382
- * http://www.apache.org/licenses/LICENSE-2.0
383
- *
384
- * Unless required by applicable law or agreed to in writing, software
385
- * distributed under the License is distributed on an "AS IS" BASIS,
386
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
387
- * See the License for the specific language governing permissions and
388
- * limitations under the License.
389
- *)
390
-
391
- @stdlib/blas/base/ddot/lib/ndarray.js:
392
- @stdlib/blas/base/ddot/lib/ddot.js:
393
- @stdlib/blas/base/ddot/lib/main.js:
394
- @stdlib/blas/base/ddot/lib/index.js:
395
- (**
396
- * @license Apache-2.0
397
- *
398
- * Copyright (c) 2019 The Stdlib Authors.
399
- *
400
- * Licensed under the Apache License, Version 2.0 (the "License");
401
- * you may not use this file except in compliance with the License.
402
- * You may obtain a copy of the License at
403
- *
404
- * http://www.apache.org/licenses/LICENSE-2.0
405
- *
406
- * Unless required by applicable law or agreed to in writing, software
407
- * distributed under the License is distributed on an "AS IS" BASIS,
408
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
409
- * See the License for the specific language governing permissions and
410
- * limitations under the License.
411
- *)
412
- */
1
+ "use strict";var j=Object.defineProperty;var gt=Object.getOwnPropertyDescriptor;var ht=Object.getOwnPropertyNames;var At=Object.prototype.hasOwnProperty;var bt=(t,r)=>{for(var n in r)j(t,n,{get:r[n],enumerable:!0})},St=(t,r,n,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of ht(r))!At.call(t,o)&&o!==n&&j(t,o,{get:()=>r[o],enumerable:!(e=gt(r,o))||e.enumerable});return t};var Dt=t=>St(j({},"__esModule",{value:!0}),t);var Yt={};bt(Yt,{NDArray:()=>E,__version__:()=>Ht,absolute:()=>nt,arange:()=>Wr,array:()=>v,asarray:()=>Yr,copy:()=>Qr,dot:()=>ft,empty:()=>ar,empty_like:()=>Kr,eye:()=>sr,floor_divide:()=>it,full:()=>ir,full_like:()=>rt,geomspace:()=>Gr,identity:()=>Hr,inner:()=>pt,linspace:()=>Jr,logspace:()=>Pr,mod:()=>at,negative:()=>ot,ones:()=>or,ones_like:()=>Zr,outer:()=>mt,positive:()=>ut,power:()=>et,reciprocal:()=>lt,sign:()=>st,sqrt:()=>tt,tensordot:()=>dt,trace:()=>ct,transpose:()=>yt,zeros:()=>k,zeros_like:()=>Xr});module.exports=Dt(Yt);function lr(t){if(!t.includes(":")){if(t.includes("."))throw new Error(`Invalid slice index: "${t}" (must be integer)`);let a=parseInt(t,10);if(isNaN(a))throw new Error(`Invalid slice index: "${t}"`);return{start:a,stop:null,step:1,isIndex:!0}}let r=t.split(":");if(r.length>3)throw new Error(`Invalid slice notation: "${t}" (too many colons)`);let n=r[0]===""?null:parseInt(r[0],10),e=r[1]===""||r[1]===void 0?null:parseInt(r[1],10),o=r[2]===""||r[2]===void 0?1:parseInt(r[2],10);if(n!==null&&isNaN(n))throw new Error(`Invalid start index in slice: "${t}"`);if(e!==null&&isNaN(e))throw new Error(`Invalid stop index in slice: "${t}"`);if(isNaN(o))throw new Error(`Invalid step in slice: "${t}"`);if(o===0)throw new Error("Slice step cannot be zero");return{start:n,stop:e,step:o,isIndex:!1}}function fr(t,r){let{start:n,stop:e}=t,{step:o,isIndex:a}=t;if(a){if(n===null)throw new Error("Index cannot be null");let l=n<0?r+n:n;if(l<0||l>=r)throw new Error(`Index ${n} is out of bounds for size ${r}`);return{start:l,stop:l+1,step:1,isIndex:!0}}return o>0?(n===null&&(n=0),e===null&&(e=r)):(n===null&&(n=r-1),e===null&&(e=-r-1)),n<0&&(n=r+n),e<0&&(e=r+e),n=Math.max(0,Math.min(n,r)),e=Math.max(-1,Math.min(e,r)),{start:n,stop:e,step:o,isIndex:!1}}var T="float64";function U(t){switch(t){case"float64":return Float64Array;case"float32":return Float32Array;case"int64":return BigInt64Array;case"int32":return Int32Array;case"int16":return Int16Array;case"int8":return Int8Array;case"uint64":return BigUint64Array;case"uint32":return Uint32Array;case"uint16":return Uint16Array;case"uint8":return Uint8Array;case"bool":return Uint8Array;default:throw new Error(`Unknown dtype: ${t}`)}}function cr(t){return t==="float64"||t==="float32"}function x(t){return t==="int64"||t==="uint64"}function _(t,r){if(t===r)return t;if(t==="bool")return r;if(r==="bool")return t;if(cr(t)||cr(r)){if(t==="float64"||r==="float64")return"float64";if(t==="float32"){let u=r;return u==="int32"||u==="int64"||u==="uint32"||u==="uint64"?"float64":"float32"}if(r==="float32"){let u=t;return u==="int32"||u==="int64"||u==="uint32"||u==="uint64"?"float64":"float32"}return"float32"}let n=t.startsWith("int"),e=r.startsWith("int"),o=t.startsWith("uint"),a=r.startsWith("uint"),l=u=>u.includes("64")?64:u.includes("32")?32:u.includes("16")?16:u.includes("8")?8:0,i=l(t),s=l(r);if(t==="int64"&&r==="uint64"||t==="uint64"&&r==="int64")return"float64";if(n&&a&&i===s){if(i===8)return"int16";if(i===16)return"int32";if(i===32)return"int64"}if(o&&e&&i===s){if(s===8)return"int16";if(s===16)return"int32";if(s===32)return"int64"}if(n&&e||o&&a){let u=Math.max(i,s);return n?u===64?"int64":u===32?"int32":u===16?"int16":"int8":u===64?"uint64":u===32?"uint32":u===16?"uint16":"uint8"}return n&&a?i>s?t:s===8?"int16":s===16?"int32":s===32?"int64":"float64":o&&e?s>i?r:i===8?"int16":i===16?"int32":i===32?"int64":"float64":"float64"}var D=class t{constructor(r,n,e,o,a){this._data=r,this._shape=n,this._strides=e,this._offset=o,this._dtype=a}get shape(){return this._shape}get ndim(){return this._shape.length}get size(){return this._shape.reduce((r,n)=>r*n,1)}get dtype(){return this._dtype}get data(){return this._data}get strides(){return this._strides}get offset(){return this._offset}get isCContiguous(){let r=this._shape,n=this._strides,e=r.length;if(e===0)return!0;if(e===1)return n[0]===1;let o=1;for(let a=e-1;a>=0;a--){if(n[a]!==o)return!1;o*=r[a]}return!0}get isFContiguous(){let r=this._shape,n=this._strides,e=r.length;if(e===0)return!0;if(e===1)return n[0]===1;let o=1;for(let a=0;a<e;a++){if(n[a]!==o)return!1;o*=r[a]}return!0}iget(r){let n=this._shape,e=this._strides,o=n.length;if(o===0)return this._data[this._offset];let a=r,l=this._offset;for(let i=0;i<o;i++){let s=1;for(let c=i+1;c<o;c++)s*=n[c];let u=Math.floor(a/s);a=a%s,l+=u*e[i]}return this._data[l]}iset(r,n){let e=this._shape,o=this._strides,a=e.length;if(a===0){this._data[this._offset]=n;return}let l=r,i=this._offset;for(let s=0;s<a;s++){let u=1;for(let f=s+1;f<a;f++)u*=e[f];let c=Math.floor(l/u);l=l%u,i+=c*o[s]}this._data[i]=n}get(...r){let n=this._strides,e=this._offset;for(let o=0;o<r.length;o++)e+=r[o]*n[o];return this._data[e]}set(r,n){let e=this._strides,o=this._offset;for(let a=0;a<r.length;a++)o+=r[a]*e[a];this._data[o]=n}copy(){let r=Array.from(this._shape),n=this._dtype,e=this.size,o=U(n);if(!o)throw new Error(`Cannot copy array with dtype ${n}`);let a=new o(e);if(this.isCContiguous&&this._offset===0)if(x(n)){let l=this._data,i=a;for(let s=0;s<e;s++)i[s]=l[s]}else a.set(this._data);else if(x(n)){let l=a;for(let i=0;i<e;i++)l[i]=this.iget(i)}else for(let l=0;l<e;l++)a[l]=this.iget(l);return new t(a,r,t._computeStrides(r),0,n)}static fromData(r,n,e,o,a){let l=o??t._computeStrides(n),i=a??0;return new t(r,n,l,i,e)}static zeros(r,n=T){let e=r.reduce((l,i)=>l*i,1),o=U(n);if(!o)throw new Error(`Cannot create array with dtype ${n}`);let a=new o(e);return new t(a,r,t._computeStrides(r),0,n)}static ones(r,n=T){let e=r.reduce((l,i)=>l*i,1),o=U(n);if(!o)throw new Error(`Cannot create array with dtype ${n}`);let a=new o(e);return x(n)?a.fill(BigInt(1)):a.fill(1),new t(a,r,t._computeStrides(r),0,n)}static _computeStrides(r){let n=new Array(r.length),e=1;for(let o=r.length-1;o>=0;o--)n[o]=e,e*=r[o];return n}};function L(t){let r=new Array(t.length),n=1;for(let e=t.length-1;e>=0;e--)r[e]=n,n*=t[e];return r}function yr(t,r){let n=t.length,e=r.length,o=Math.max(n,e),a=new Array(o);for(let l=0;l<o;l++){let i=l<o-n?1:t[l-(o-n)],s=l<o-e?1:r[l-(o-e)];if(i===s)a[l]=i;else if(i===1)a[l]=s;else if(s===1)a[l]=i;else throw new Error(`operands could not be broadcast together with shapes ${JSON.stringify(Array.from(t))} ${JSON.stringify(Array.from(r))}`)}return a}function xt(t,r,n){let e=t.length,o=n.length,a=new Array(o).fill(0);for(let l=0;l<e;l++){let i=o-e+l,s=t[l],u=n[i];if(s===u)a[i]=r[l];else if(s===1)a[i]=0;else throw new Error("Invalid broadcast")}return a}function q(t,r){let n=xt(t.shape,t.strides,r);return D.fromData(t.data,Array.from(r),t.dtype,n,t.offset)}function O(t,r,n,e){let o=yr(t.shape,r.shape),a=q(t,o),l=q(r,o),i=_(t.dtype,r.dtype),s=D.zeros(o,i),u=s.data,c=s.size;if(x(i)){let f=u;for(let y=0;y<c;y++){let m=a.iget(y),p=l.iget(y),d=typeof m=="bigint"?m:BigInt(Math.round(m)),A=typeof p=="bigint"?p:BigInt(Math.round(p));e==="add"?f[y]=d+A:e==="subtract"?f[y]=d-A:e==="multiply"?f[y]=d*A:e==="divide"?f[y]=d/A:f[y]=BigInt(Math.round(n(Number(d),Number(A))))}}else{let f=x(t.dtype)||x(r.dtype);for(let y=0;y<c;y++){let m=a.iget(y),p=l.iget(y),d=Number(m),A=Number(p);u[y]=n(d,A)}}return s}function M(t,r,n){let e=yr(t.shape,r.shape),o=q(t,e),a=q(r,e),l=e.reduce((u,c)=>u*c,1),i=new Uint8Array(l),s=x(t.dtype)||x(r.dtype);for(let u=0;u<l;u++){let c=o.iget(u),f=a.iget(u),y=Number(c),m=Number(f);i[u]=n(y,m)?1:0}return D.fromData(i,e,"bool")}function pr(t,r,n=!0){let e=t.dtype,o=Array.from(t.shape),a=t.size,i=n?e:e!=="float32"&&e!=="float64"?"float64":e,s=D.zeros(o,i),u=s.data,c=t.data;if(x(e))if(x(i)){let f=u;for(let y=0;y<a;y++){let m=Number(c[y]);f[y]=BigInt(Math.round(r(m)))}}else for(let f=0;f<a;f++)u[f]=r(Number(c[f]));else for(let f=0;f<a;f++)u[f]=r(Number(c[f]));return s}function R(t,r){return t.isCContiguous&&r.isCContiguous&&t.shape.length===r.shape.length&&t.shape.every((n,e)=>n===r.shape[e])}function mr(t,r){return typeof r=="number"?Bt(t,r):R(t,r)?It(t,r):O(t,r,(n,e)=>n+e,"add")}function It(t,r){let n=_(t.dtype,r.dtype),e=D.zeros(Array.from(t.shape),n),o=t.size,a=t.data,l=r.data,i=e.data;if(x(n)){let s=i;if(!x(t.dtype)||!x(r.dtype))for(let c=0;c<o;c++){let f=typeof a[c]=="bigint"?a[c]:BigInt(Math.round(Number(a[c]))),y=typeof l[c]=="bigint"?l[c]:BigInt(Math.round(Number(l[c])));s[c]=f+y}else{let c=a,f=l;for(let y=0;y<o;y++)s[y]=c[y]+f[y]}}else if(x(t.dtype)||x(r.dtype))for(let u=0;u<o;u++){let c=typeof a[u]=="bigint"?Number(a[u]):a[u],f=typeof l[u]=="bigint"?Number(l[u]):l[u];i[u]=c+f}else for(let u=0;u<o;u++)i[u]=a[u]+l[u];return e}function dr(t,r){return typeof r=="number"?zt(t,r):R(t,r)?wt(t,r):O(t,r,(n,e)=>n-e,"subtract")}function wt(t,r){let n=_(t.dtype,r.dtype),e=D.zeros(Array.from(t.shape),n),o=t.size,a=t.data,l=r.data,i=e.data;if(x(n)){let s=i;if(!x(t.dtype)||!x(r.dtype))for(let c=0;c<o;c++){let f=typeof a[c]=="bigint"?a[c]:BigInt(Math.round(Number(a[c]))),y=typeof l[c]=="bigint"?l[c]:BigInt(Math.round(Number(l[c])));s[c]=f-y}else{let c=a,f=l;for(let y=0;y<o;y++)s[y]=c[y]-f[y]}}else if(x(t.dtype)||x(r.dtype))for(let u=0;u<o;u++){let c=typeof a[u]=="bigint"?Number(a[u]):a[u],f=typeof l[u]=="bigint"?Number(l[u]):l[u];i[u]=c-f}else for(let u=0;u<o;u++)i[u]=a[u]-l[u];return e}function gr(t,r){return typeof r=="number"?_t(t,r):R(t,r)?Nt(t,r):O(t,r,(n,e)=>n*e,"multiply")}function Nt(t,r){let n=_(t.dtype,r.dtype),e=D.zeros(Array.from(t.shape),n),o=t.size,a=t.data,l=r.data,i=e.data;if(x(n)){let s=i;if(!x(t.dtype)||!x(r.dtype))for(let c=0;c<o;c++){let f=typeof a[c]=="bigint"?a[c]:BigInt(Math.round(Number(a[c]))),y=typeof l[c]=="bigint"?l[c]:BigInt(Math.round(Number(l[c])));s[c]=f*y}else{let c=a,f=l;for(let y=0;y<o;y++)s[y]=c[y]*f[y]}}else if(x(t.dtype)||x(r.dtype))for(let u=0;u<o;u++){let c=typeof a[u]=="bigint"?Number(a[u]):a[u],f=typeof l[u]=="bigint"?Number(l[u]):l[u];i[u]=c*f}else for(let u=0;u<o;u++)i[u]=a[u]*l[u];return e}function hr(t,r){if(typeof r=="number")return Tt(t,r);let n=t.dtype==="float64",e=r.dtype==="float64",o=t.dtype==="float32",a=r.dtype==="float32";if(n||e){let s=n?t:V(t,"float64"),u=e?r:V(r,"float64");return O(s,u,(c,f)=>c/f,"divide")}if(o||a){let s=o?t:V(t,"float32"),u=a?r:V(r,"float32");return O(s,u,(c,f)=>c/f,"divide")}let l=V(t,"float64"),i=V(r,"float64");return O(l,i,(s,u)=>s/u,"divide")}function V(t,r){let n=D.zeros(Array.from(t.shape),r),e=t.size,o=t.data,a=n.data;for(let l=0;l<e;l++)a[l]=Number(o[l]);return n}function Bt(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,l=D.zeros(e,n),i=l.data;if(x(n)){let s=o,u=i,c=BigInt(Math.round(r));for(let f=0;f<a;f++)u[f]=s[f]+c}else for(let s=0;s<a;s++)i[s]=Number(o[s])+r;return l}function zt(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,l=D.zeros(e,n),i=l.data;if(x(n)){let s=o,u=i,c=BigInt(Math.round(r));for(let f=0;f<a;f++)u[f]=s[f]-c}else for(let s=0;s<a;s++)i[s]=Number(o[s])-r;return l}function _t(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,l=D.zeros(e,n),i=l.data;if(x(n)){let s=o,u=i,c=BigInt(Math.round(r));for(let f=0;f<a;f++)u[f]=s[f]*c}else for(let s=0;s<a;s++)i[s]=Number(o[s])*r;return l}function Tt(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,i=n!=="float32"&&n!=="float64"?"float64":n,s=D.zeros(e,i),u=s.data;if(x(n))for(let c=0;c<a;c++)u[c]=Number(o[c])/r;else for(let c=0;c<a;c++)u[c]=Number(o[c])/r;return s}function Ar(t){let r=t.dtype,n=Array.from(t.shape),e=t.data,o=t.size,a=D.zeros(n,r),l=a.data;if(x(r)){let i=e,s=l;for(let u=0;u<o;u++){let c=i[u];s[u]=c<0n?-c:c}}else for(let i=0;i<o;i++)l[i]=Math.abs(Number(e[i]));return a}function br(t){let r=t.dtype,n=Array.from(t.shape),e=t.data,o=t.size,a=D.zeros(n,r),l=a.data;if(x(r)){let i=e,s=l;for(let u=0;u<o;u++)s[u]=-i[u]}else for(let i=0;i<o;i++)l[i]=-Number(e[i]);return a}function Sr(t){let r=t.dtype,n=Array.from(t.shape),e=t.data,o=t.size,a=D.zeros(n,r),l=a.data;if(x(r)){let i=e,s=l;for(let u=0;u<o;u++){let c=i[u];s[u]=c>0n?1n:c<0n?-1n:0n}}else for(let i=0;i<o;i++){let s=Number(e[i]);l[i]=s>0?1:s<0?-1:0}return a}function Dr(t,r){return typeof r=="number"?Ut(t,r):O(t,r,(n,e)=>(n%e+e)%e,"mod")}function Ut(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,l=D.zeros(e,n),i=l.data;if(x(n)){let s=o,u=i,c=BigInt(Math.round(r));for(let f=0;f<a;f++){let y=s[f];u[f]=(y%c+c)%c}}else for(let s=0;s<a;s++){let u=Number(o[s]);i[s]=(u%r+r)%r}return l}function xr(t,r){return typeof r=="number"?Et(t,r):O(t,r,(n,e)=>Math.floor(n/e),"floor_divide")}function Et(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,l=D.zeros(e,n),i=l.data;if(x(n)){let s=o,u=i,c=BigInt(Math.round(r));for(let f=0;f<a;f++)u[f]=s[f]/c}else for(let s=0;s<a;s++)i[s]=Math.floor(Number(o[s])/r);return l}function Ir(t){let r=t.dtype,n=Array.from(t.shape),e=t.data,o=t.size,a=D.zeros(n,r),l=a.data;for(let i=0;i<o;i++)l[i]=e[i];return a}function wr(t){let r=t.dtype,n=Array.from(t.shape),e=t.data,o=t.size,l=r!=="float32"&&r!=="float64"?"float64":r,i=D.zeros(n,l),s=i.data;if(x(r))for(let u=0;u<o;u++)s[u]=1/Number(e[u]);else for(let u=0;u<o;u++)s[u]=1/Number(e[u]);return i}function Nr(t,r){return typeof r=="number"?Ot(t,r):M(t,r,(n,e)=>n>e)}function Br(t,r){return typeof r=="number"?vt(t,r):M(t,r,(n,e)=>n>=e)}function zr(t,r){return typeof r=="number"?Mt(t,r):M(t,r,(n,e)=>n<e)}function _r(t,r){return typeof r=="number"?Vt(t,r):M(t,r,(n,e)=>n<=e)}function Tr(t,r){return typeof r=="number"?Ct(t,r):M(t,r,(n,e)=>n===e)}function Ur(t,r){return typeof r=="number"?Ft(t,r):M(t,r,(n,e)=>n!==e)}function W(t,r,n=1e-5,e=1e-8){return typeof r=="number"?kt(t,r,n,e):M(t,r,(o,a)=>{let l=Math.abs(o-a),i=e+n*Math.abs(a);return l<=i})}function Er(t,r,n=1e-5,e=1e-8){let o=W(t,r,n,e),a=o.data;for(let l=0;l<o.size;l++)if(a[l]===0)return!1;return!0}function Ot(t,r){let n=new Uint8Array(t.size),e=t.data;for(let o=0;o<t.size;o++)n[o]=e[o]>r?1:0;return D.fromData(n,Array.from(t.shape),"bool")}function vt(t,r){let n=new Uint8Array(t.size),e=t.data;for(let o=0;o<t.size;o++)n[o]=e[o]>=r?1:0;return D.fromData(n,Array.from(t.shape),"bool")}function Mt(t,r){let n=new Uint8Array(t.size),e=t.data;for(let o=0;o<t.size;o++)n[o]=e[o]<r?1:0;return D.fromData(n,Array.from(t.shape),"bool")}function Vt(t,r){let n=new Uint8Array(t.size),e=t.data;for(let o=0;o<t.size;o++)n[o]=e[o]<=r?1:0;return D.fromData(n,Array.from(t.shape),"bool")}function Ct(t,r){let n=new Uint8Array(t.size),e=t.data,o=t.dtype;if(x(o)){let a=BigInt(Math.round(r)),l=e;for(let i=0;i<t.size;i++)n[i]=l[i]===a?1:0}else for(let a=0;a<t.size;a++)n[a]=e[a]===r?1:0;return D.fromData(n,Array.from(t.shape),"bool")}function Ft(t,r){let n=new Uint8Array(t.size),e=t.data;for(let o=0;o<t.size;o++)n[o]=e[o]!==r?1:0;return D.fromData(n,Array.from(t.shape),"bool")}function kt(t,r,n,e){let o=new Uint8Array(t.size),a=t.data,l=t.dtype;if(x(l)){let i=a;for(let s=0;s<t.size;s++){let u=Number(i[s]),c=Math.abs(u-r),f=e+n*Math.abs(r);o[s]=c<=f?1:0}}else for(let i=0;i<t.size;i++){let s=Number(a[i]),u=Math.abs(s-r),c=e+n*Math.abs(r);o[i]=u<=c?1:0}return D.fromData(o,Array.from(t.shape),"bool")}function B(t,r){let n=0,e=1;for(let o=t.length-1;o>=0;o--)n+=t[o]*e,e*=r[o];return n}function z(t,r,n,e){let o=e.length,a=new Array(o),l=Array.from(e).filter((s,u)=>u!==r),i=t;for(let s=l.length-1;s>=0;s--)a[s>=r?s+1:s]=i%l[s],i=Math.floor(i/l[s]);return a[r]=n,a}function C(t,r,n=!1){let e=t.dtype,o=t.shape,a=o.length,l=t.size,i=t.data;if(r===void 0)if(x(e)){let p=i,d=BigInt(0);for(let A=0;A<l;A++)d+=p[A];return Number(d)}else{let p=0;for(let d=0;d<l;d++)p+=Number(i[d]);return p}let s=r;if(s<0&&(s=a+s),s<0||s>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(o).filter((p,d)=>d!==s);if(u.length===0)return C(t);let c=D.zeros(u,e),f=c.data,y=o[s],m=u.reduce((p,d)=>p*d,1);if(x(e)){let p=i,d=f;for(let A=0;A<m;A++){let g=BigInt(0);for(let h=0;h<y;h++){let S=z(A,s,h,o),b=B(S,o);g+=p[b]}d[A]=g}}else for(let p=0;p<m;p++){let d=0;for(let A=0;A<y;A++){let g=z(p,s,A,o),h=B(g,o);d+=Number(i[h])}f[p]=d}if(n){let p=[...o];return p[s]=1,D.fromData(f,p,e)}return c}function J(t,r,n=!1){let e=t.dtype,o=t.shape;if(r===void 0)return C(t)/t.size;let a=r;if(a<0&&(a=o.length+a),a<0||a>=o.length)throw new Error(`axis ${r} is out of bounds for array of dimension ${o.length}`);let l=C(t,r,n);if(typeof l=="number")return l/o[a];let i=o[a],s=e;(x(e)||e.startsWith("int")||e.startsWith("uint"))&&(s="float64");let u=D.zeros(Array.from(l.shape),s),c=u.data,f=l.data;if(x(e)){let y=f;for(let m=0;m<c.length;m++)c[m]=Number(y[m])/i}else for(let y=0;y<c.length;y++)c[y]=Number(f[y])/i;return u}function P(t,r,n=!1){let e=t.dtype,o=t.shape,a=o.length,l=t.size,i=t.data;if(r===void 0){if(l===0)throw new Error("max of empty array");let p=i[0];for(let d=1;d<l;d++)i[d]>p&&(p=i[d]);return Number(p)}let s=r;if(s<0&&(s=a+s),s<0||s>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(o).filter((p,d)=>d!==s);if(u.length===0)return P(t);let c=D.zeros(u,e),f=c.data,y=o[s],m=u.reduce((p,d)=>p*d,1);if(x(e)){let p=i,d=f;for(let A=0;A<m;A++){let g=z(A,s,0,o),h=B(g,o),S=p[h];for(let b=1;b<y;b++){let I=z(A,s,b,o),w=B(I,o),$=p[w];$>S&&(S=$)}d[A]=S}}else for(let p=0;p<m;p++){let d=-1/0;for(let A=0;A<y;A++){let g=z(p,s,A,o),h=B(g,o),S=Number(i[h]);S>d&&(d=S)}f[p]=d}if(n){let p=[...o];return p[s]=1,D.fromData(f,p,e)}return c}function G(t,r,n=!1){let e=t.dtype,o=t.shape,a=o.length,l=t.size,i=t.data;if(r===void 0)if(x(e)){let p=i,d=BigInt(1);for(let A=0;A<l;A++)d*=p[A];return Number(d)}else{let p=1;for(let d=0;d<l;d++)p*=Number(i[d]);return p}let s=r;if(s<0&&(s=a+s),s<0||s>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(o).filter((p,d)=>d!==s);if(u.length===0)return G(t);let c=D.zeros(u,e),f=c.data,y=o[s],m=u.reduce((p,d)=>p*d,1);if(x(e)){let p=i,d=f;for(let A=0;A<m;A++){let g=BigInt(1);for(let h=0;h<y;h++){let S=z(A,s,h,o),b=B(S,o);g*=p[b]}d[A]=g}}else for(let p=0;p<m;p++){let d=1;for(let A=0;A<y;A++){let g=z(p,s,A,o),h=B(g,o);d*=Number(i[h])}f[p]=d}if(n){let p=[...o];return p[s]=1,D.fromData(f,p,e)}return c}function H(t,r,n=!1){let e=t.dtype,o=t.shape,a=o.length,l=t.size,i=t.data;if(r===void 0){if(l===0)throw new Error("min of empty array");let p=i[0];for(let d=1;d<l;d++)i[d]<p&&(p=i[d]);return Number(p)}let s=r;if(s<0&&(s=a+s),s<0||s>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(o).filter((p,d)=>d!==s);if(u.length===0)return H(t);let c=D.zeros(u,e),f=c.data,y=o[s],m=u.reduce((p,d)=>p*d,1);if(x(e)){let p=i,d=f;for(let A=0;A<m;A++){let g=z(A,s,0,o),h=B(g,o),S=p[h];for(let b=1;b<y;b++){let I=z(A,s,b,o),w=B(I,o),$=p[w];$<S&&(S=$)}d[A]=S}}else for(let p=0;p<m;p++){let d=1/0;for(let A=0;A<y;A++){let g=z(p,s,A,o),h=B(g,o),S=Number(i[h]);S<d&&(d=S)}f[p]=d}if(n){let p=[...o];return p[s]=1,D.fromData(f,p,e)}return c}function Y(t,r){let n=t.dtype,e=t.shape,o=e.length,a=t.size,l=t.data;if(r===void 0){if(a===0)throw new Error("argmin of empty array");let m=l[0],p=0;for(let d=1;d<a;d++)l[d]<m&&(m=l[d],p=d);return p}let i=r;if(i<0&&(i=o+i),i<0||i>=o)throw new Error(`axis ${r} is out of bounds for array of dimension ${o}`);let s=Array.from(e).filter((m,p)=>p!==i);if(s.length===0)return Y(t);let u=D.zeros(s,"int32"),c=u.data,f=e[i],y=s.reduce((m,p)=>m*p,1);if(x(n)){let m=l;for(let p=0;p<y;p++){let d=z(p,i,0,e),A=B(d,e),g=m[A],h=0;for(let S=1;S<f;S++){let b=z(p,i,S,e),I=B(b,e),w=m[I];w<g&&(g=w,h=S)}c[p]=h}}else for(let m=0;m<y;m++){let p=1/0,d=0;for(let A=0;A<f;A++){let g=z(m,i,A,e),h=B(g,e),S=Number(l[h]);S<p&&(p=S,d=A)}c[m]=d}return u}function Q(t,r){let n=t.dtype,e=t.shape,o=e.length,a=t.size,l=t.data;if(r===void 0){if(a===0)throw new Error("argmax of empty array");let m=l[0],p=0;for(let d=1;d<a;d++)l[d]>m&&(m=l[d],p=d);return p}let i=r;if(i<0&&(i=o+i),i<0||i>=o)throw new Error(`axis ${r} is out of bounds for array of dimension ${o}`);let s=Array.from(e).filter((m,p)=>p!==i);if(s.length===0)return Q(t);let u=D.zeros(s,"int32"),c=u.data,f=e[i],y=s.reduce((m,p)=>m*p,1);if(x(n)){let m=l;for(let p=0;p<y;p++){let d=z(p,i,0,e),A=B(d,e),g=m[A],h=0;for(let S=1;S<f;S++){let b=z(p,i,S,e),I=B(b,e),w=m[I];w>g&&(g=w,h=S)}c[p]=h}}else for(let m=0;m<y;m++){let p=-1/0,d=0;for(let A=0;A<f;A++){let g=z(m,i,A,e),h=B(g,e),S=Number(l[h]);S>p&&(p=S,d=A)}c[m]=d}return u}function X(t,r,n=0,e=!1){let o=t.shape,a=o.length,l=t.size,i=t.data,s=J(t,r,e);if(r===void 0){let g=s,h=0;for(let S=0;S<l;S++){let b=Number(i[S])-g;h+=b*b}return h/(l-n)}let u=r;if(u<0&&(u=a+u),u<0||u>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let c=o[u],f=s,y=f.data,m=e?f.shape:Array.from(o).filter((g,h)=>h!==u),p=D.zeros(Array.from(m),"float64"),d=p.data,A=m.reduce((g,h)=>g*h,1);for(let g=0;g<A;g++){let h=0,S=Number(y[g]);for(let b=0;b<c;b++){let I=z(g,u,b,o),w=B(I,o),$=Number(i[w])-S;h+=$*$}d[g]=h/(c-n)}return p}function $r(t,r,n=0,e=!1){let o=X(t,r,n,e);if(typeof o=="number")return Math.sqrt(o);let a=D.zeros(Array.from(o.shape),"float64"),l=o.data,i=a.data;for(let s=0;s<l.length;s++)i[s]=Math.sqrt(Number(l[s]));return a}function Z(t,r,n=!1){let e=t.shape,o=e.length,a=t.size,l=t.data;if(r===void 0){for(let m=0;m<a;m++)if(!l[m])return!1;return!0}let i=r;if(i<0&&(i=o+i),i<0||i>=o)throw new Error(`axis ${r} is out of bounds for array of dimension ${o}`);let s=Array.from(e).filter((m,p)=>p!==i);if(s.length===0)return Z(t);let u=D.zeros(s,"bool"),c=u.data,f=e[i],y=s.reduce((m,p)=>m*p,1);for(let m=0;m<y;m++){let p=!0;for(let d=0;d<f;d++){let A=z(m,i,d,e),g=B(A,e);if(!l[g]){p=!1;break}}c[m]=p?1:0}if(n){let m=[...e];return m[i]=1,D.fromData(c,m,"bool")}return u}function K(t,r,n=!1){let e=t.shape,o=e.length,a=t.size,l=t.data;if(r===void 0){for(let m=0;m<a;m++)if(l[m])return!0;return!1}let i=r;if(i<0&&(i=o+i),i<0||i>=o)throw new Error(`axis ${r} is out of bounds for array of dimension ${o}`);let s=Array.from(e).filter((m,p)=>p!==i);if(s.length===0)return K(t);let u=D.zeros(s,"bool"),c=u.data,f=e[i],y=s.reduce((m,p)=>m*p,1);for(let m=0;m<y;m++){let p=!1;for(let d=0;d<f;d++){let A=z(m,i,d,e),g=B(A,e);if(l[g]){p=!0;break}}c[m]=p?1:0}if(n){let m=[...e];return m[i]=1,D.fromData(c,m,"bool")}return u}function Or(t,r){let n=t.size,e=t.dtype,o=r.indexOf(-1),a;if(o!==-1){let u=r.reduce((f,y,m)=>m===o?f:f*y,1),c=n/u;if(!Number.isInteger(c))throw new Error(`cannot reshape array of size ${n} into shape ${JSON.stringify(r)}`);a=r.map((f,y)=>y===o?c:f)}else a=r;if(a.reduce((u,c)=>u*c,1)!==n)throw new Error(`cannot reshape array of size ${n} into shape ${JSON.stringify(a)}`);if(t.isCContiguous){let u=t.data;return D.fromData(u,a,e,L(a),0)}let s=t.copy().data;return D.fromData(s,a,e,L(a),0)}function rr(t){let r=t.shape,n=r.length,e=t.size,o=t.dtype,a=U(o);if(!a)throw new Error(`Cannot flatten array with dtype ${o}`);let l=new a(e),i=0,s=(u,c)=>{if(c===n){let f=t.get(...u);l[i++]=f;return}for(let f=0;f<r[c];f++)u[c]=f,s(u,c+1)};return s(new Array(n),0),D.fromData(l,[e],o,[1],0)}function F(t){let r=t.size,n=t.dtype;if(t.isCContiguous){let e=t.data;return D.fromData(e,[r],n,[1],0)}return rr(t)}function tr(t,r){let n=t.shape,e=n.length,o=t.strides,a=t.data,l=t.dtype,i;if(r===void 0)i=Array.from({length:e},(f,y)=>e-1-y);else{if(r.length!==e)throw new Error(`axes must have length ${e}, got ${r.length}`);let f=new Set;for(let y of r){let m=y<0?e+y:y;if(m<0||m>=e)throw new Error(`axis ${y} is out of bounds for array of dimension ${e}`);if(f.has(m))throw new Error("repeated axis in transpose");f.add(m)}i=r.map(y=>y<0?e+y:y)}let s=i.map(f=>n[f]),u=Array.from(o),c=i.map(f=>u[f]);return D.fromData(a,s,l,c,t.offset)}function vr(t,r){let n=t.shape,e=n.length,o=t.strides,a=t.data,l=t.dtype;if(r===void 0){let i=[],s=[];for(let u=0;u<e;u++)n[u]!==1&&(i.push(n[u]),s.push(o[u]));return i.length===0&&(i.push(1),s.push(1)),D.fromData(a,i,l,s,t.offset)}else{let i=r<0?e+r:r;if(i<0||i>=e)throw new Error(`axis ${r} is out of bounds for array of dimension ${e}`);if(n[i]!==1)throw new Error(`cannot select an axis which has size not equal to one (axis ${r} has size ${n[i]})`);let s=[],u=[];for(let c=0;c<e;c++)c!==i&&(s.push(n[c]),u.push(o[c]));return D.fromData(a,s,l,u,t.offset)}}function Mr(t,r){let n=t.shape,e=n.length,o=t.strides,a=t.data,l=t.dtype,i=r;if(i<0&&(i=e+r+1),i<0||i>e)throw new Error(`axis ${r} is out of bounds for array of dimension ${e+1}`);let s=[...Array.from(n)];s.splice(i,0,1);let u=[...Array.from(o)],c=i<e?o[i]*(n[i]||1):1;return u.splice(i,0,c),D.fromData(a,s,l,u,t.offset)}function Lt(t,r,n,e,o,a,l,i,s,u,c,f,y,m){if(f===0)for(let g=0;g<e*o;g++)y[g]=0;else if(f!==1)for(let g=0;g<e*o;g++)y[g]=(y[g]??0)*f;let p=t==="row-major",d=r==="transpose",A=n==="transpose";if(p&&!d&&!A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[g*s+b]??0)*(u[b*c+h]??0);y[g*m+h]=(y[g*m+h]??0)+l*S}else if(p&&d&&!A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[b*s+g]??0)*(u[b*c+h]??0);y[g*m+h]=(y[g*m+h]??0)+l*S}else if(p&&!d&&A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[g*s+b]??0)*(u[h*c+b]??0);y[g*m+h]=(y[g*m+h]??0)+l*S}else if(p&&d&&A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[b*s+g]??0)*(u[h*c+b]??0);y[g*m+h]=(y[g*m+h]??0)+l*S}else if(!p&&!d&&!A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[b*s+g]??0)*(u[h*c+b]??0);y[h*m+g]=(y[h*m+g]??0)+l*S}else if(!p&&d&&!A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[g*s+b]??0)*(u[h*c+b]??0);y[h*m+g]=(y[h*m+g]??0)+l*S}else if(!p&&!d&&A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[b*s+g]??0)*(u[b*c+h]??0);y[h*m+g]=(y[h*m+g]??0)+l*S}else for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[g*s+b]??0)*(u[b*c+h]??0);y[h*m+g]=(y[h*m+g]??0)+l*S}}function er(t,r){let n=t.ndim,e=r.ndim;if(n===0||e===0){let o=n===0?t.get():null,a=e===0?r.get():null;if(n===0&&e===0)return typeof o=="bigint"&&typeof a=="bigint"?o*a:Number(o)*Number(a);if(n===0){let l=_(t.dtype,r.dtype),i=D.zeros([...r.shape],l);for(let s=0;s<r.size;s++){let u=r.data[s+r.offset];typeof o=="bigint"&&typeof u=="bigint"?i.data[s]=o*u:i.data[s]=Number(o)*Number(u)}return i}else{let l=_(t.dtype,r.dtype),i=D.zeros([...t.shape],l);for(let s=0;s<t.size;s++){let u=t.data[s+t.offset];typeof u=="bigint"&&typeof a=="bigint"?i.data[s]=u*a:i.data[s]=Number(u)*Number(a)}return i}}if(n===1&&e===1){if(t.shape[0]!==r.shape[0])throw new Error(`dot: incompatible shapes (${t.shape[0]},) and (${r.shape[0]},)`);let o=t.shape[0],a=0;for(let l=0;l<o;l++){let i=t.get(l),s=r.get(l);typeof i=="bigint"&&typeof s=="bigint"?a=Number(a)+Number(i*s):a+=Number(i)*Number(s)}return a}if(n===2&&e===2)return nr(t,r);if(n===2&&e===1){let[o,a]=t.shape,l=r.shape[0];if(a!==l)throw new Error(`dot: incompatible shapes (${o},${a}) and (${l},)`);let i=_(t.dtype,r.dtype),s=D.zeros([o],i);for(let u=0;u<o;u++){let c=0;for(let f=0;f<a;f++){let y=t.get(u,f),m=r.get(f);typeof y=="bigint"&&typeof m=="bigint"?c=Number(c)+Number(y*m):c+=Number(y)*Number(m)}s.set([u],c)}return s}if(n===1&&e===2){let o=t.shape[0],[a,l]=r.shape;if(o!==a)throw new Error(`dot: incompatible shapes (${o},) and (${a},${l})`);let i=_(t.dtype,r.dtype),s=D.zeros([l],i);for(let u=0;u<l;u++){let c=0;for(let f=0;f<o;f++){let y=t.get(f),m=r.get(f,u);typeof y=="bigint"&&typeof m=="bigint"?c=Number(c)+Number(y*m):c+=Number(y)*Number(m)}s.set([u],c)}return s}if(n>2&&e===1){let o=t.shape[n-1],a=r.shape[0];if(o!==a)throw new Error(`dot: incompatible shapes ${JSON.stringify(t.shape)} and (${a},)`);let l=[...t.shape.slice(0,-1)],i=_(t.dtype,r.dtype),s=D.zeros(l,i),u=l.reduce((c,f)=>c*f,1);for(let c=0;c<u;c++){let f=0,y=c,m=[];for(let p=l.length-1;p>=0;p--)m[p]=y%l[p],y=Math.floor(y/l[p]);for(let p=0;p<o;p++){let d=[...m,p],A=t.get(...d),g=r.get(p);typeof A=="bigint"&&typeof g=="bigint"?f=Number(f)+Number(A*g):f+=Number(A)*Number(g)}s.set(m,f)}return s}if(n===1&&e>2){let o=t.shape[0],a=1,l=r.shape[a];if(o!==l)throw new Error(`dot: incompatible shapes (${o},) and ${JSON.stringify(r.shape)}`);let i=[...r.shape.slice(0,a),...r.shape.slice(a+1)],s=_(t.dtype,r.dtype),u=D.zeros(i,s),c=i.reduce((f,y)=>f*y,1);for(let f=0;f<c;f++){let y=f,m=[];for(let g=i.length-1;g>=0;g--)m[g]=y%i[g],y=Math.floor(y/i[g]);let p=m.slice(0,a),d=m.slice(a),A=0;for(let g=0;g<o;g++){let h=t.get(g),S=[...p,g,...d],b=r.get(...S);typeof h=="bigint"&&typeof b=="bigint"?A=Number(A)+Number(h*b):A+=Number(h)*Number(b)}u.set(m,A)}return u}if(n>=2&&e>=2&&!(n===2&&e===2)){let o=t.shape[n-1],a=r.shape[e-2];if(o!==a)throw new Error(`dot: incompatible shapes ${JSON.stringify(t.shape)} and ${JSON.stringify(r.shape)}`);let l=[...t.shape.slice(0,-1),...r.shape.slice(0,-2),r.shape[e-1]],i=_(t.dtype,r.dtype),s=D.zeros(l,i),u=t.shape.slice(0,-1).reduce((m,p)=>m*p,1),c=r.shape.slice(0,-2).reduce((m,p)=>m*p,1),f=r.shape[e-1],y=o;for(let m=0;m<u;m++)for(let p=0;p<c;p++)for(let d=0;d<f;d++){let A=0;for(let h=0;h<y;h++){let S=m*y+h,b=t.data[S+t.offset],I=p*y*f+h*f+d,w=r.data[I+r.offset];typeof b=="bigint"&&typeof w=="bigint"?A=Number(A)+Number(b*w):A+=Number(b)*Number(w)}let g=m*c*f+p*f+d;s.data[g]=A}return s}throw new Error(`dot: unexpected combination of dimensions ${n}D \xB7 ${e}D`)}function nr(t,r){if(t.ndim!==2||r.ndim!==2)throw new Error("matmul requires 2D arrays");let[n=0,e=0]=t.shape,[o=0,a=0]=r.shape;if(e!==o)throw new Error(`matmul shape mismatch: (${n},${e}) @ (${o},${a})`);let l=_(t.dtype,r.dtype),i=l.startsWith("int")||l.startsWith("uint")||l==="bool"?"float64":l;if(i!=="float64")throw new Error(`matmul currently only supports float64, got ${i}`);let s=t.dtype==="float64"?t.data:Float64Array.from(Array.from(t.data).map(Number)),u=r.dtype==="float64"?r.data:Float64Array.from(Array.from(r.data).map(Number));t.offset>0&&(s=s.subarray(t.offset)),r.offset>0&&(u=u.subarray(r.offset));let[c=0,f=0]=t.strides,[y=0,m=0]=r.strides,p=f>c,d=m>y,A=p?"transpose":"no-transpose",g=d?"transpose":"no-transpose",h,S;p?h=f:h=c,d?S=m:S=y;let b=D.zeros([n,a],"float64");return Lt("row-major",A,g,n,a,e,1,s,h,u,S,0,b.data,a),b}function Cr(t){if(t.ndim!==2)throw new Error(`trace requires 2D array, got ${t.ndim}D`);let[r=0,n=0]=t.shape,e=Math.min(r,n),o=0;for(let a=0;a<e;a++){let l=t.get(a,a);typeof l=="bigint"?o=(typeof o=="bigint"?o:BigInt(o))+l:o=(typeof o=="bigint"?Number(o):o)+l}return o}function Fr(t,r){let n=t.ndim,e=r.ndim,o=t.shape[n-1],a=r.shape[e-1];if(o!==a)throw new Error(`inner: incompatible shapes - last dimensions ${o} and ${a} don't match`);if(n===1&&e===1)return er(t,r);let l=[...t.shape.slice(0,-1),...r.shape.slice(0,-1)],i=_(t.dtype,r.dtype),s=D.zeros(l,i),u=n===1?1:t.shape.slice(0,-1).reduce((y,m)=>y*m,1),c=e===1?1:r.shape.slice(0,-1).reduce((y,m)=>y*m,1),f=o;for(let y=0;y<u;y++)for(let m=0;m<c;m++){let p=0;for(let A=0;A<f;A++){let g=n===1?A:y*f+A,h=e===1?A:m*f+A,S=t.data[g+t.offset],b=r.data[h+r.offset];typeof S=="bigint"&&typeof b=="bigint"?p=Number(p)+Number(S*b):p+=Number(S)*Number(b)}if(l.length===0)return p;let d=u===1?m:y*c+m;s.data[d]=p}return s}function kr(t,r){let n=t.ndim===1?t:F(t),e=r.ndim===1?r:F(r),o=n.size,a=e.size,l=_(t.dtype,r.dtype),i=D.zeros([o,a],l);for(let s=0;s<o;s++)for(let u=0;u<a;u++){let c=n.get(s),f=e.get(u),y;typeof c=="bigint"&&typeof f=="bigint"?y=c*f:y=Number(c)*Number(f),i.set([s,u],y)}return i}function qr(t,r,n){let e,o;if(typeof n=="number"){let y=n;if(y<0)throw new Error("tensordot: axes must be non-negative");if(y>t.ndim||y>r.ndim)throw new Error("tensordot: axes exceeds array dimensions");e=Array.from({length:y},(m,p)=>t.ndim-y+p),o=Array.from({length:y},(m,p)=>p)}else if([e,o]=n,e.length!==o.length)throw new Error("tensordot: axes lists must have same length");for(let y=0;y<e.length;y++){let m=e[y],p=o[y];if(m<0||m>=t.ndim||p<0||p>=r.ndim)throw new Error("tensordot: axis out of bounds");if(t.shape[m]!==r.shape[p])throw new Error(`tensordot: shape mismatch on axes ${m} and ${p}: ${t.shape[m]} != ${r.shape[p]}`)}let a=[],l=[];for(let y=0;y<t.ndim;y++)e.includes(y)||a.push(y);for(let y=0;y<r.ndim;y++)o.includes(y)||l.push(y);let i=[...a.map(y=>t.shape[y]),...l.map(y=>r.shape[y])];if(i.length===0){let y=0,m=e.map(p=>t.shape[p]).reduce((p,d)=>p*d,1);for(let p=0;p<m;p++){let d=p,A=new Array(e.length);for(let I=e.length-1;I>=0;I--){let w=e[I];A[I]=d%t.shape[w],d=Math.floor(d/t.shape[w])}let g=new Array(t.ndim),h=new Array(r.ndim);for(let I=0;I<e.length;I++)g[e[I]]=A[I];for(let I=0;I<o.length;I++)h[o[I]]=A[I];let S=t.get(...g),b=r.get(...h);typeof S=="bigint"&&typeof b=="bigint"?y=Number(y)+Number(S*b):y+=Number(S)*Number(b)}return y}let s=_(t.dtype,r.dtype),u=D.zeros(i,s),c=i.reduce((y,m)=>y*m,1),f=e.map(y=>t.shape[y]).reduce((y,m)=>y*m,1);for(let y=0;y<c;y++){let m=y,p=[];for(let h=i.length-1;h>=0;h--)p[h]=m%i[h],m=Math.floor(m/i[h]);let d=p.slice(0,a.length),A=p.slice(a.length),g=0;for(let h=0;h<f;h++){m=h;let S=[];for(let N=e.length-1;N>=0;N--){let ur=e[N];S[N]=m%t.shape[ur],m=Math.floor(m/t.shape[ur])}let b=new Array(t.ndim),I=new Array(r.ndim);for(let N=0;N<a.length;N++)b[a[N]]=d[N];for(let N=0;N<l.length;N++)I[l[N]]=A[N];for(let N=0;N<e.length;N++)b[e[N]]=S[N],I[o[N]]=S[N];let w=t.get(...b),$=r.get(...I);typeof w=="bigint"&&typeof $=="bigint"?g=Number(g)+Number(w*$):g+=Number(w)*Number($)}u.set(p,g)}return u}function jr(t){return pr(t,Math.sqrt,!1)}function Lr(t,r){return typeof r=="number"?Wt(t,r):O(t,r,Math.pow,"power")}function Wt(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,s=n!=="float32"&&n!=="float64"&&(r<0||!Number.isInteger(r))?"float64":n,u=D.zeros(e,s),c=u.data;if(x(n))if(x(s)&&Number.isInteger(r)&&r>=0){let f=o,y=c;for(let m=0;m<a;m++)y[m]=f[m]**BigInt(r)}else for(let f=0;f<a;f++)c[f]=Math.pow(Number(o[f]),r);else for(let f=0;f<a;f++)c[f]=Math.pow(Number(o[f]),r);return u}var E=class t{constructor(r,n){this._storage=r,this._base=n}get storage(){return this._storage}static _fromStorage(r,n){return new t(r,n)}get shape(){return this._storage.shape}get ndim(){return this._storage.ndim}get size(){return this._storage.size}get dtype(){return this._storage.dtype}get data(){return this._storage.data}get strides(){return this._storage.strides}get flags(){return{C_CONTIGUOUS:this._storage.isCContiguous,F_CONTIGUOUS:this._storage.isFContiguous,OWNDATA:this._base===void 0}}get base(){return this._base??null}get(r){if(r.length!==this.ndim)throw new Error(`Index has ${r.length} dimensions, but array has ${this.ndim} dimensions`);let n=r.map((e,o)=>{let a=e;if(a<0&&(a=this.shape[o]+a),a<0||a>=this.shape[o])throw new Error(`Index ${e} is out of bounds for axis ${o} with size ${this.shape[o]}`);return a});return this._storage.get(...n)}set(r,n){if(r.length!==this.ndim)throw new Error(`Index has ${r.length} dimensions, but array has ${this.ndim} dimensions`);let e=r.map((l,i)=>{let s=l;if(s<0&&(s=this.shape[i]+s),s<0||s>=this.shape[i])throw new Error(`Index ${l} is out of bounds for axis ${i} with size ${this.shape[i]}`);return s}),o=this.dtype,a;x(o)?a=typeof n=="bigint"?n:BigInt(Math.round(n)):o==="bool"?a=n?1:0:a=Number(n),this._storage.set(e,a)}copy(){return new t(this._storage.copy())}astype(r,n=!0){let e=this.dtype;if(e===r&&!n)return this;if(e===r&&n)return this.copy();let o=Array.from(this.shape),a=this.size,l=U(r);if(!l)throw new Error(`Cannot convert to dtype ${r}`);let i=new l(a),s=this.data;if(x(e)&&!x(r)){let c=s;if(r==="bool")for(let f=0;f<a;f++)i[f]=c[f]!==BigInt(0)?1:0;else for(let f=0;f<a;f++)i[f]=Number(c[f])}else if(!x(e)&&x(r)){let c=s;for(let f=0;f<a;f++)i[f]=BigInt(Math.round(Number(c[f])))}else if(r==="bool"){let c=s;for(let f=0;f<a;f++)i[f]=c[f]!==0?1:0}else if(e==="bool"&&!x(r)){let c=s;for(let f=0;f<a;f++)i[f]=c[f]}else if(!x(e)&&!x(r)){let c=s;for(let f=0;f<a;f++)i[f]=c[f]}else{let c=s;for(let f=0;f<a;f++)i[f]=c[f]}let u=D.fromData(i,o,r);return new t(u)}add(r){let n=typeof r=="number"?r:r._storage,e=mr(this._storage,n);return t._fromStorage(e)}subtract(r){let n=typeof r=="number"?r:r._storage,e=dr(this._storage,n);return t._fromStorage(e)}multiply(r){let n=typeof r=="number"?r:r._storage,e=gr(this._storage,n);return t._fromStorage(e)}divide(r){let n=typeof r=="number"?r:r._storage,e=hr(this._storage,n);return t._fromStorage(e)}mod(r){let n=typeof r=="number"?r:r._storage,e=Dr(this._storage,n);return t._fromStorage(e)}floor_divide(r){let n=typeof r=="number"?r:r._storage,e=xr(this._storage,n);return t._fromStorage(e)}positive(){let r=Ir(this._storage);return t._fromStorage(r)}reciprocal(){let r=wr(this._storage);return t._fromStorage(r)}sqrt(){let r=jr(this._storage);return t._fromStorage(r)}power(r){let n=typeof r=="number"?r:r._storage,e=Lr(this._storage,n);return t._fromStorage(e)}absolute(){let r=Ar(this._storage);return t._fromStorage(r)}negative(){let r=br(this._storage);return t._fromStorage(r)}sign(){let r=Sr(this._storage);return t._fromStorage(r)}greater(r){let n=typeof r=="number"?r:r._storage,e=Nr(this._storage,n);return t._fromStorage(e)}greater_equal(r){let n=typeof r=="number"?r:r._storage,e=Br(this._storage,n);return t._fromStorage(e)}less(r){let n=typeof r=="number"?r:r._storage,e=zr(this._storage,n);return t._fromStorage(e)}less_equal(r){let n=typeof r=="number"?r:r._storage,e=_r(this._storage,n);return t._fromStorage(e)}equal(r){let n=typeof r=="number"?r:r._storage,e=Tr(this._storage,n);return t._fromStorage(e)}not_equal(r){let n=typeof r=="number"?r:r._storage,e=Ur(this._storage,n);return t._fromStorage(e)}isclose(r,n=1e-5,e=1e-8){let o=typeof r=="number"?r:r._storage,a=W(this._storage,o,n,e);return t._fromStorage(a)}allclose(r,n=1e-5,e=1e-8){let o=typeof r=="number"?r:r._storage;return Er(this._storage,o,n,e)}sum(r,n=!1){let e=C(this._storage,r,n);return typeof e=="number"?e:t._fromStorage(e)}mean(r,n=!1){let e=J(this._storage,r,n);return typeof e=="number"?e:t._fromStorage(e)}max(r,n=!1){let e=P(this._storage,r,n);return typeof e=="number"?e:t._fromStorage(e)}min(r,n=!1){let e=H(this._storage,r,n);return typeof e=="number"?e:t._fromStorage(e)}prod(r,n=!1){let e=G(this._storage,r,n);return typeof e=="number"?e:t._fromStorage(e)}argmin(r){let n=Y(this._storage,r);return typeof n=="number"?n:t._fromStorage(n)}argmax(r){let n=Q(this._storage,r);return typeof n=="number"?n:t._fromStorage(n)}var(r,n=0,e=!1){let o=X(this._storage,r,n,e);return typeof o=="number"?o:t._fromStorage(o)}std(r,n=0,e=!1){let o=$r(this._storage,r,n,e);return typeof o=="number"?o:t._fromStorage(o)}all(r,n=!1){let e=Z(this._storage,r,n);return typeof e=="boolean"?e:t._fromStorage(e)}any(r,n=!1){let e=K(this._storage,r,n);return typeof e=="boolean"?e:t._fromStorage(e)}reshape(...r){let n=r.length===1&&Array.isArray(r[0])?r[0]:r,e=Or(this._storage,n),a=e.data===this.data?this._base??this:void 0;return t._fromStorage(e,a)}flatten(){let r=rr(this._storage);return t._fromStorage(r)}ravel(){let r=F(this._storage),e=r.data===this.data?this._base??this:void 0;return t._fromStorage(r,e)}transpose(r){let n=tr(this._storage,r),e=this._base??this;return t._fromStorage(n,e)}squeeze(r){let n=vr(this._storage,r),e=this._base??this;return t._fromStorage(n,e)}expand_dims(r){let n=Mr(this._storage,r),e=this._base??this;return t._fromStorage(n,e)}matmul(r){let n=nr(this._storage,r._storage);return t._fromStorage(n)}dot(r){let n=er(this._storage,r._storage);return typeof n=="number"||typeof n=="bigint"?n:t._fromStorage(n)}trace(){return Cr(this._storage)}inner(r){let n=Fr(this._storage,r._storage);return typeof n=="number"||typeof n=="bigint"?n:t._fromStorage(n)}outer(r){let n=kr(this._storage,r._storage);return t._fromStorage(n)}tensordot(r,n=2){let e=qr(this._storage,r._storage,n);return typeof e=="number"||typeof e=="bigint"?e:t._fromStorage(e)}slice(...r){if(r.length===0)return this;if(r.length>this.ndim)throw new Error(`Too many indices for array: array is ${this.ndim}-dimensional, but ${r.length} were indexed`);let n=r.map((s,u)=>{let c=lr(s);return fr(c,this.shape[u])});for(;n.length<this.ndim;)n.push({start:0,stop:this.shape[n.length],step:1,isIndex:!1});let e=[],o=[],a=this._storage.offset;for(let s=0;s<n.length;s++){let u=n[s],c=this._storage.strides[s];if(a+=u.start*c,!u.isIndex){let f;u.step>0?f=Math.max(0,Math.ceil((u.stop-u.start)/u.step)):f=Math.max(0,Math.ceil((u.start-u.stop)/Math.abs(u.step))),e.push(f),o.push(c*u.step)}}let l=D.fromData(this._storage.data,e,this._storage.dtype,o,a),i=this._base??this;return new t(l,i)}row(r){if(this.ndim<2)throw new Error("row() requires at least 2 dimensions");return this.slice(String(r),":")}col(r){if(this.ndim<2)throw new Error("col() requires at least 2 dimensions");return this.slice(":",String(r))}rows(r,n){if(this.ndim<2)throw new Error("rows() requires at least 2 dimensions");return this.slice(`${r}:${n}`,":")}cols(r,n){if(this.ndim<2)throw new Error("cols() requires at least 2 dimensions");return this.slice(":",`${r}:${n}`)}toString(){return`NDArray(shape=${JSON.stringify(this.shape)}, dtype=${this.dtype})`}toArray(){if(this.ndim===0)return this._storage.iget(0);let r=this.shape,n=r.length,e=(o,a)=>{if(a===n)return this._storage.get(...o);let l=[];for(let i=0;i<r[a];i++)o[a]=i,l.push(e(o,a+1));return l};return e(new Array(n),0)}};function k(t,r=T){let n=D.zeros(t,r);return new E(n)}function or(t,r=T){let n=D.ones(t,r);return new E(n)}function Pt(t){let r=[],n=t;for(;Array.isArray(n);)r.push(n.length),n=n[0];return r}function Rr(t){return typeof t=="bigint"?!0:Array.isArray(t)?t.some(r=>Rr(r)):!1}function Gt(t){let r=[];function n(e){Array.isArray(e)?e.forEach(o=>n(o)):r.push(e)}return n(t),r}function v(t,r){if(t instanceof E)return!r||t.dtype===r?t.copy():t.astype(r);let n=Rr(t),e=Pt(t),o=e.reduce((c,f)=>c*f,1),a=r;a||(n?a="int64":a=T);let l=U(a);if(!l)throw new Error(`Cannot create array with dtype ${a}`);let i=new l(o),s=Gt(t);if(x(a)){let c=i;for(let f=0;f<o;f++){let y=s[f];c[f]=typeof y=="bigint"?y:BigInt(Math.round(Number(y)))}}else if(a==="bool"){let c=i;for(let f=0;f<o;f++)c[f]=s[f]?1:0}else{let c=i;for(let f=0;f<o;f++){let y=s[f];c[f]=Number(y)}}let u=D.fromData(i,e,a);return new E(u)}function Wr(t,r,n=1,e=T){let o=t,a=r;if(r===void 0&&(o=0,a=t),a===void 0)throw new Error("stop is required");let l=Math.max(0,Math.ceil((a-o)/n)),i=U(e);if(!i)throw new Error(`Cannot create arange array with dtype ${e}`);let s=new i(l);if(x(e))for(let c=0;c<l;c++)s[c]=BigInt(Math.round(o+c*n));else if(e==="bool")for(let c=0;c<l;c++)s[c]=o+c*n!==0?1:0;else for(let c=0;c<l;c++)s[c]=o+c*n;let u=D.fromData(s,[l],e);return new E(u)}function Jr(t,r,n=50,e=T){if(n<0)throw new Error("num must be non-negative");if(n===0)return v([],e);if(n===1)return v([t],e);let o=U(e);if(!o)throw new Error(`Cannot create linspace array with dtype ${e}`);let a=new o(n),l=(r-t)/(n-1);if(x(e))for(let s=0;s<n;s++)a[s]=BigInt(Math.round(t+s*l));else if(e==="bool")for(let s=0;s<n;s++)a[s]=t+s*l!==0?1:0;else for(let s=0;s<n;s++)a[s]=t+s*l;let i=D.fromData(a,[n],e);return new E(i)}function Pr(t,r,n=50,e=10,o=T){if(n<0)throw new Error("num must be non-negative");if(n===0)return v([],o);if(n===1)return v([Math.pow(e,t)],o);let a=U(o);if(!a)throw new Error(`Cannot create logspace array with dtype ${o}`);let l=new a(n),i=(r-t)/(n-1);if(x(o))for(let u=0;u<n;u++){let c=t+u*i;l[u]=BigInt(Math.round(Math.pow(e,c)))}else if(o==="bool")for(let u=0;u<n;u++){let c=t+u*i;l[u]=Math.pow(e,c)!==0?1:0}else for(let u=0;u<n;u++){let c=t+u*i;l[u]=Math.pow(e,c)}let s=D.fromData(l,[n],o);return new E(s)}function Gr(t,r,n=50,e=T){if(n<0)throw new Error("num must be non-negative");if(t===0||r===0)throw new Error("Geometric sequence cannot include zero");if(n===0)return v([],e);if(n===1)return v([t],e);let o=Math.sign(t),a=Math.sign(r);if(o!==a)throw new Error("Geometric sequence cannot contain both positive and negative values");let l=U(e);if(!l)throw new Error(`Cannot create geomspace array with dtype ${e}`);let i=new l(n),s=Math.log(Math.abs(t)),c=(Math.log(Math.abs(r))-s)/(n-1);if(x(e))for(let y=0;y<n;y++){let m=o*Math.exp(s+y*c);i[y]=BigInt(Math.round(m))}else if(e==="bool")for(let y=0;y<n;y++){let m=o*Math.exp(s+y*c);i[y]=m!==0?1:0}else for(let y=0;y<n;y++){let m=o*Math.exp(s+y*c);i[y]=m}let f=D.fromData(i,[n],e);return new E(f)}function sr(t,r,n=0,e=T){let o=r??t,a=k([t,o],e),l=a.data;if(x(e)){let i=l;for(let s=0;s<t;s++){let u=s+n;u>=0&&u<o&&(i[s*o+u]=BigInt(1))}}else{let i=l;for(let s=0;s<t;s++){let u=s+n;u>=0&&u<o&&(i[s*o+u]=1)}}return a}function ar(t,r=T){return k(t,r)}function ir(t,r,n){let e=n;e||(typeof r=="bigint"?e="int64":typeof r=="boolean"?e="bool":Number.isInteger(r)?e="int32":e=T);let o=U(e);if(!o)throw new Error(`Cannot create full array with dtype ${e}`);let a=t.reduce((s,u)=>s*u,1),l=new o(a);if(x(e)){let s=typeof r=="bigint"?r:BigInt(Math.round(Number(r)));l.fill(s)}else e==="bool"?l.fill(r?1:0):l.fill(Number(r));let i=D.fromData(l,t,e);return new E(i)}function Hr(t,r=T){return sr(t,t,0,r)}function Yr(t,r){return t instanceof E?!r||t.dtype===r?t:t.astype(r):v(t,r)}function Qr(t){return t.copy()}function Xr(t,r){return k(Array.from(t.shape),r??t.dtype)}function Zr(t,r){return or(Array.from(t.shape),r??t.dtype)}function Kr(t,r){return ar(Array.from(t.shape),r??t.dtype)}function rt(t,r,n){return ir(Array.from(t.shape),r,n??t.dtype)}function tt(t){return t.sqrt()}function et(t,r){return t.power(r)}function nt(t){return t.absolute()}function ot(t){return t.negative()}function st(t){return t.sign()}function at(t,r){return t.mod(r)}function it(t,r){return t.floor_divide(r)}function ut(t){return t.positive()}function lt(t){return t.reciprocal()}function ft(t,r){return t.dot(r)}function ct(t){return t.trace()}function yt(t,r){return t.transpose(r)}function pt(t,r){return t.inner(r)}function mt(t,r){return t.outer(r)}function dt(t,r,n=2){return t.tensordot(r,n)}var Ht="0.4.0";0&&(module.exports={NDArray,__version__,absolute,arange,array,asarray,copy,dot,empty,empty_like,eye,floor_divide,full,full_like,geomspace,identity,inner,linspace,logspace,mod,negative,ones,ones_like,outer,positive,power,reciprocal,sign,sqrt,tensordot,trace,transpose,zeros,zeros_like});
413
2
  //# sourceMappingURL=numpy-ts.node.cjs.map