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.
- package/README.md +0 -4
- package/dist/numpy-ts.browser.js +1 -396
- package/dist/numpy-ts.esm.js +1 -396
- package/dist/numpy-ts.node.cjs +1 -412
- package/dist/types/core/ndarray.d.ts +94 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/ops/linalg.d.ts +79 -0
- package/package.json +1 -5
package/dist/numpy-ts.browser.js
CHANGED
|
@@ -1,397 +1,2 @@
|
|
|
1
|
-
"use strict";var np=(()=>{var fh=Object.create;var me=Object.defineProperty;var lh=Object.getOwnPropertyDescriptor;var ch=Object.getOwnPropertyNames;var ph=Object.getPrototypeOf,yh=Object.prototype.hasOwnProperty;var c=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),mh=(e,r)=>{for(var t in r)me(e,t,{get:r[t],enumerable:!0})},Sn=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of ch(r))!yh.call(e,i)&&i!==t&&me(e,i,{get:()=>r[i],enumerable:!(n=lh(r,i))||n.enumerable});return e};var hh=(e,r,t)=>(t=e!=null?fh(ph(e)):{},Sn(r||!e||!e.__esModule?me(t,"default",{value:e,enumerable:!0}):t,e)),gh=e=>Sn(me({},"__esModule",{value:!0}),e);var ei=c((e_,ri)=>{"use strict";var Ch=typeof Object.defineProperty=="function"?Object.defineProperty:null;ri.exports=Ch});var ni=c((t_,ti)=>{"use strict";var jh=ei();function Lh(){try{return jh({},"x",{}),!0}catch{return!1}}ti.exports=Lh});var ai=c((n_,ii)=>{"use strict";var Mh=Object.defineProperty;ii.exports=Mh});var Qe=c((i_,oi)=>{"use strict";function kh(e){return typeof e=="number"}oi.exports=kh});var Ke=c((a_,ui)=>{"use strict";function Ph(e){return e[0]==="-"}function si(e){var r="",t;for(t=0;t<e;t++)r+="0";return r}function $h(e,r,t){var n=!1,i=r-e.length;return i<0||(Ph(e)&&(n=!0,e=e.substr(1)),e=t?e+si(i):si(i)+e,n&&(e="-"+e)),e}ui.exports=$h});var pi=c((o_,ci)=>{"use strict";var Gh=Qe(),fi=Ke(),Yh=String.prototype.toLowerCase,li=String.prototype.toUpperCase;function Wh(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(!Gh(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=fi(t,e.precision,e.padRight)),t="-"+t):(t=n.toString(r),!n&&!e.precision?t="":e.precision&&(t=fi(t,e.precision,e.padRight)),e.sign&&(t=e.sign+t)),r===16&&(e.alternate&&(t="0x"+t),t=e.specifier===li.call(e.specifier)?li.call(t):Yh.call(t)),r===8&&e.alternate&&t.charAt(0)!=="0"&&(t="0"+t),t}ci.exports=Wh});var mi=c((s_,yi)=>{"use strict";function Zh(e){return typeof e=="string"}yi.exports=Zh});var vi=c((u_,gi)=>{"use strict";var Jh=Qe(),Hh=Math.abs,Xh=String.prototype.toLowerCase,hi=String.prototype.toUpperCase,Dr=String.prototype.replace,Qh=/e\+(\d)$/,Kh=/e-(\d)$/,rg=/^(\d+)$/,eg=/^(\d+)e/,tg=/\.0$/,ng=/\.0*e/,ig=/(\..*[^0])0*e/;function ag(e){var r,t,n=parseFloat(e.arg);if(!isFinite(n)){if(!Jh(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":Hh(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,ig,"$1e"),t=Dr.call(t,ng,"e"),t=Dr.call(t,tg,""));break;default:throw new Error("invalid double notation. Value: "+e.specifier)}return t=Dr.call(t,Qh,"e+0$1"),t=Dr.call(t,Kh,"e-0$1"),e.alternate&&(t=Dr.call(t,rg,"$1."),t=Dr.call(t,eg,"$1.e")),n>=0&&e.sign&&(t=e.sign+t),t=e.specifier===hi.call(e.specifier)?hi.call(t):Xh.call(t),t}gi.exports=ag});var wi=c((f_,di)=>{"use strict";function bi(e){var r="",t;for(t=0;t<e;t++)r+=" ";return r}function og(e,r,t){var n=r-e.length;return n<0||(e=t?e+bi(n):bi(n)+e),e}di.exports=og});var xi=c((l_,Ai)=>{"use strict";var sg=pi(),ug=mi(),fg=vi(),lg=wi(),cg=Ke(),pg=String.fromCharCode,yg=Array.isArray;function ge(e){return e!==e}function mg(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 hg(e){var r,t,n,i,a,s,o,f,u;if(!yg(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],ug(n))s+=n;else{if(r=n.precision!==void 0,n=mg(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,ge(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,ge(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=sg(n);break;case"s":n.maxWidth=r?n.precision:-1,n.arg=String(n.arg);break;case"c":if(!ge(n.arg)){if(a=parseInt(n.arg,10),a<0||a>127)throw new Error("invalid character code. Value: "+n.arg);n.arg=ge(a)?String(n.arg):pg(a)}break;case"e":case"E":case"f":case"F":case"g":case"G":r||(n.precision=6),n.arg=fg(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=cg(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=lg(n.arg,n.width,n.padRight)),s+=n.arg||"",o+=1}return s}Ai.exports=hg});var Si=c((c_,Ei)=>{"use strict";var gg=xi();Ei.exports=gg});var _i=c((p_,Ti)=>{"use strict";var ve=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function vg(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 bg(e){var r,t,n,i;for(t=[],i=0,n=ve.exec(e);n;)r=e.slice(i,ve.lastIndex-n[0].length),r.length&&t.push(r),t.push(vg(n)),i=ve.lastIndex,n=ve.exec(e);return r=e.slice(i),r.length&&t.push(r),t}Ti.exports=bg});var Ii=c((y_,qi)=>{"use strict";var dg=_i();qi.exports=dg});var Ni=c((m_,Di)=>{"use strict";function wg(e){return typeof e=="string"}Di.exports=wg});var Vi=c((h_,Oi)=>{"use strict";var Ag=Si(),xg=Ii(),Eg=Ni();function Bi(e){var r,t;if(!Eg(e))throw new TypeError(Bi("invalid argument. First argument must be a string. Value: `%s`.",e));for(r=[xg(e)],t=1;t<arguments.length;t++)r.push(arguments[t]);return Ag.apply(null,r)}Oi.exports=Bi});var Z=c((g_,Ui)=>{"use strict";var Sg=Vi();Ui.exports=Sg});var Li=c((v_,ji)=>{"use strict";var zi=Z(),Fr=Object.prototype,Fi=Fr.toString,Ri=Fr.__defineGetter__,Ci=Fr.__defineSetter__,Tg=Fr.__lookupGetter__,_g=Fr.__lookupSetter__;function qg(e,r,t){var n,i,a,s;if(typeof e!="object"||e===null||Fi.call(e)==="[object Array]")throw new TypeError(zi("invalid argument. First argument must be an object. Value: `%s`.",e));if(typeof t!="object"||t===null||Fi.call(t)==="[object Array]")throw new TypeError(zi("invalid argument. Property descriptor must be an object. Value: `%s`.",t));if(i="value"in t,i&&(Tg.call(e,r)||_g.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&&Ri&&Ri.call(e,r,t.get),s&&Ci&&Ci.call(e,r,t.set),e}ji.exports=qg});var kr=c((b_,Mi)=>{"use strict";var Ig=ni(),Dg=ai(),Ng=Li(),rt;Ig()?rt=Dg:rt=Ng;Mi.exports=rt});var Pi=c((d_,ki)=>{"use strict";var Bg=kr();function Og(e,r,t){Bg(e,r,{configurable:!1,enumerable:!1,writable:!1,value:t})}ki.exports=Og});var W=c((w_,$i)=>{"use strict";var Vg=Pi();$i.exports=Vg});var Yi=c((A_,Gi)=>{"use strict";function Ug(e,r){return e>r?e:r}Gi.exports=Ug});var Zi=c((x_,Wi)=>{"use strict";var zg=Yi();Wi.exports=zg});var Xi=c((E_,Hi)=>{"use strict";var Ji="function";function Fg(e){return typeof e.get===Ji&&typeof e.set===Ji}Hi.exports=Fg});var et=c((S_,Qi)=>{"use strict";var Rg=Xi();Qi.exports=Rg});var ea=c((T_,ra)=>{"use strict";var Ki={complex128:Cg,complex64:jg,default:Lg};function Cg(e,r){return e.get(r)}function jg(e,r){return e.get(r)}function Lg(e,r){return e.get(r)}function Mg(e){var r=Ki[e];return typeof r=="function"?r:Ki.default}ra.exports=Mg});var Rr=c((__,ta)=>{"use strict";var kg=ea();ta.exports=kg});var aa=c((q_,ia)=>{"use strict";var na={float64:Pg,float32:$g,int32:Gg,int16:Yg,int8:Wg,uint32:Zg,uint16:Jg,uint8:Hg,uint8c:Xg,generic:Qg,default:Kg};function Pg(e,r){return e[r]}function $g(e,r){return e[r]}function Gg(e,r){return e[r]}function Yg(e,r){return e[r]}function Wg(e,r){return e[r]}function Zg(e,r){return e[r]}function Jg(e,r){return e[r]}function Hg(e,r){return e[r]}function Xg(e,r){return e[r]}function Qg(e,r){return e[r]}function Kg(e,r){return e[r]}function rv(e){var r=na[e];return typeof r=="function"?r:na.default}ia.exports=rv});var Pr=c((I_,oa)=>{"use strict";var ev=aa();oa.exports=ev});var ua=c((D_,sa)=>{"use strict";function tv(){return typeof Symbol=="function"&&typeof Symbol("foo")=="symbol"}sa.exports=tv});var la=c((N_,fa)=>{"use strict";var nv=ua();fa.exports=nv});var pa=c((B_,ca)=>{"use strict";var iv=la(),av=iv();function ov(){return av&&typeof Symbol.toStringTag=="symbol"}ca.exports=ov});var $r=c((O_,ya)=>{"use strict";var sv=pa();ya.exports=sv});var tt=c((V_,ma)=>{"use strict";var uv=Object.prototype.toString;ma.exports=uv});var ga=c((U_,ha)=>{"use strict";var fv=tt();function lv(e){return fv.call(e)}ha.exports=lv});var ba=c((z_,va)=>{"use strict";var cv=Object.prototype.hasOwnProperty;function pv(e,r){return e==null?!1:cv.call(e,r)}va.exports=pv});var nt=c((F_,da)=>{"use strict";var yv=ba();da.exports=yv});var Aa=c((R_,wa)=>{"use strict";var mv=typeof Symbol=="function"?Symbol:void 0;wa.exports=mv});var it=c((C_,xa)=>{"use strict";var hv=Aa();xa.exports=hv});var Ta=c((j_,Sa)=>{"use strict";var Ea=it(),gv=typeof Ea=="function"?Ea.toStringTag:"";Sa.exports=gv});var qa=c((L_,_a)=>{"use strict";var vv=nt(),Gr=Ta(),at=tt();function bv(e){var r,t,n;if(e==null)return at.call(e);t=e[Gr],r=vv(e,Gr);try{e[Gr]=void 0}catch{return at.call(e)}return n=at.call(e),r?e[Gr]=t:delete e[Gr],n}_a.exports=bv});var J=c((M_,Ia)=>{"use strict";var dv=$r(),wv=ga(),Av=qa(),ot;dv()?ot=Av:ot=wv;Ia.exports=ot});var Na=c((k_,Da)=>{"use strict";var xv=J(),st;function Ev(e){return xv(e)==="[object Array]"}Array.isArray?st=Array.isArray:st=Ev;Da.exports=st});var Cr=c((P_,Ba)=>{"use strict";var Sv=Na();Ba.exports=Sv});var Va=c(($_,Oa)=>{"use strict";var Tv=Cr(),_v=Z();function qv(e){if(typeof e!="function")throw new TypeError(_v("invalid argument. Must provide a function. Value: `%s`.",e));return r;function r(t){var n,i;if(!Tv(t)||(n=t.length,n===0))return!1;for(i=0;i<n;i++)if(e(t[i])===!1)return!1;return!0}}Oa.exports=qv});var ut=c((G_,Ua)=>{"use strict";var Iv=Va();Ua.exports=Iv});var Fa=c((Y_,za)=>{"use strict";function Dv(e){return e!==null&&typeof e=="object"}za.exports=Dv});var Ca=c((W_,Ra)=>{"use strict";var Nv=W(),Bv=ut(),ft=Fa(),Ov=Bv(ft);Nv(ft,"isObjectLikeArray",Ov);Ra.exports=ft});var La=c((Z_,ja)=>{"use strict";var Vv=Ca();function Uv(e){return Vv(e)&&(e._isBuffer||e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))}ja.exports=Uv});var lt=c((J_,Ma)=>{"use strict";var zv=La();Ma.exports=zv});var ct=c((H_,ka)=>{"use strict";function Fv(){return/^\s*function\s*([^(]*)/i}ka.exports=Fv});var $a=c((X_,Pa)=>{"use strict";var Rv=ct(),Cv=Rv();Pa.exports=Cv});var Wa=c((Q_,Ya)=>{"use strict";var jv=W(),Ga=ct(),Lv=$a();jv(Ga,"REGEXP",Lv);Ya.exports=Ga});var Ja=c((K_,Za)=>{"use strict";var Mv=J(),kv=Wa().REGEXP,Pv=lt();function $v(e){var r,t,n;if(t=Mv(e).slice(8,-1),(t==="Object"||t==="Error")&&e.constructor){if(n=e.constructor,typeof n.name=="string")return n.name;if(r=kv.exec(n.toString()),r)return r[1]}return Pv(e)?"Buffer":t}Za.exports=$v});var be=c((r1,Ha)=>{"use strict";var Gv=Ja();Ha.exports=Gv});var Qa=c((e1,Xa)=>{"use strict";var Yv={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"};Xa.exports=Yv});var ro=c((t1,Ka)=>{"use strict";var Wv=J(),Zv=typeof Float64Array=="function";function Jv(e){return Zv&&e instanceof Float64Array||Wv(e)==="[object Float64Array]"}Ka.exports=Jv});var to=c((n1,eo)=>{"use strict";var Hv=ro();eo.exports=Hv});var io=c((i1,no)=>{"use strict";var Xv=typeof Float64Array=="function"?Float64Array:null;no.exports=Xv});var so=c((a1,oo)=>{"use strict";var Qv=to(),ao=io();function Kv(){var e,r;if(typeof ao!="function")return!1;try{r=new ao([1,3.14,-3.14,NaN]),e=Qv(r)&&r[0]===1&&r[1]===3.14&&r[2]===-3.14&&r[3]!==r[3]}catch{e=!1}return e}oo.exports=Kv});var fo=c((o1,uo)=>{"use strict";var rb=so();uo.exports=rb});var co=c((s1,lo)=>{"use strict";var eb=typeof Float64Array=="function"?Float64Array:void 0;lo.exports=eb});var yo=c((u1,po)=>{"use strict";function tb(){throw new Error("not implemented")}po.exports=tb});var de=c((f1,mo)=>{"use strict";var nb=fo(),ib=co(),ab=yo(),pt;nb()?pt=ib:pt=ab;mo.exports=pt});var go=c((l1,ho)=>{"use strict";var ob=J(),sb=typeof Float32Array=="function";function ub(e){return sb&&e instanceof Float32Array||ob(e)==="[object Float32Array]"}ho.exports=ub});var bo=c((c1,vo)=>{"use strict";var fb=go();vo.exports=fb});var yt=c((p1,wo)=>{"use strict";var lb=Number.POSITIVE_INFINITY;wo.exports=lb});var xo=c((y1,Ao)=>{"use strict";var cb=typeof Float32Array=="function"?Float32Array:null;Ao.exports=cb});var To=c((m1,So)=>{"use strict";var pb=bo(),yb=yt(),Eo=xo();function mb(){var e,r;if(typeof Eo!="function")return!1;try{r=new Eo([1,3.14,-3.14,5e40]),e=pb(r)&&r[0]===1&&r[1]===3.140000104904175&&r[2]===-3.140000104904175&&r[3]===yb}catch{e=!1}return e}So.exports=mb});var qo=c((h1,_o)=>{"use strict";var hb=To();_o.exports=hb});var Do=c((g1,Io)=>{"use strict";var gb=typeof Float32Array=="function"?Float32Array:void 0;Io.exports=gb});var Bo=c((v1,No)=>{"use strict";function vb(){throw new Error("not implemented")}No.exports=vb});var Yr=c((b1,Oo)=>{"use strict";var bb=qo(),db=Do(),wb=Bo(),mt;bb()?mt=db:mt=wb;Oo.exports=mt});var Uo=c((d1,Vo)=>{"use strict";var Ab=J(),xb=typeof Uint32Array=="function";function Eb(e){return xb&&e instanceof Uint32Array||Ab(e)==="[object Uint32Array]"}Vo.exports=Eb});var Fo=c((w1,zo)=>{"use strict";var Sb=Uo();zo.exports=Sb});var Co=c((A1,Ro)=>{"use strict";var Tb=4294967295;Ro.exports=Tb});var Lo=c((x1,jo)=>{"use strict";var _b=typeof Uint32Array=="function"?Uint32Array:null;jo.exports=_b});var Po=c((E1,ko)=>{"use strict";var qb=Fo(),ht=Co(),Mo=Lo();function Ib(){var e,r;if(typeof Mo!="function")return!1;try{r=[1,3.14,-3.14,ht+1,ht+2],r=new Mo(r),e=qb(r)&&r[0]===1&&r[1]===3&&r[2]===ht-2&&r[3]===0&&r[4]===1}catch{e=!1}return e}ko.exports=Ib});var Go=c((S1,$o)=>{"use strict";var Db=Po();$o.exports=Db});var Wo=c((T1,Yo)=>{"use strict";var Nb=typeof Uint32Array=="function"?Uint32Array:void 0;Yo.exports=Nb});var Jo=c((_1,Zo)=>{"use strict";function Bb(){throw new Error("not implemented")}Zo.exports=Bb});var Xo=c((q1,Ho)=>{"use strict";var Ob=Go(),Vb=Wo(),Ub=Jo(),gt;Ob()?gt=Vb:gt=Ub;Ho.exports=gt});var Ko=c((I1,Qo)=>{"use strict";var zb=J(),Fb=typeof Int32Array=="function";function Rb(e){return Fb&&e instanceof Int32Array||zb(e)==="[object Int32Array]"}Qo.exports=Rb});var es=c((D1,rs)=>{"use strict";var Cb=Ko();rs.exports=Cb});var ns=c((N1,ts)=>{"use strict";var jb=2147483647;ts.exports=jb});var as=c((B1,is)=>{"use strict";var Lb=-2147483648;is.exports=Lb});var ss=c((O1,os)=>{"use strict";var Mb=typeof Int32Array=="function"?Int32Array:null;os.exports=Mb});var ls=c((V1,fs)=>{"use strict";var kb=es(),Pb=ns(),$b=as(),us=ss();function Gb(){var e,r;if(typeof us!="function")return!1;try{r=new us([1,3.14,-3.14,Pb+1]),e=kb(r)&&r[0]===1&&r[1]===3&&r[2]===-3&&r[3]===$b}catch{e=!1}return e}fs.exports=Gb});var ps=c((U1,cs)=>{"use strict";var Yb=ls();cs.exports=Yb});var ms=c((z1,ys)=>{"use strict";var Wb=typeof Int32Array=="function"?Int32Array:void 0;ys.exports=Wb});var gs=c((F1,hs)=>{"use strict";function Zb(){throw new Error("not implemented")}hs.exports=Zb});var bs=c((R1,vs)=>{"use strict";var Jb=ps(),Hb=ms(),Xb=gs(),vt;Jb()?vt=Hb:vt=Xb;vs.exports=vt});var ws=c((C1,ds)=>{"use strict";var Qb=J(),Kb=typeof Uint16Array=="function";function rd(e){return Kb&&e instanceof Uint16Array||Qb(e)==="[object Uint16Array]"}ds.exports=rd});var xs=c((j1,As)=>{"use strict";var ed=ws();As.exports=ed});var Ss=c((L1,Es)=>{"use strict";var td=65535;Es.exports=td});var _s=c((M1,Ts)=>{"use strict";var nd=typeof Uint16Array=="function"?Uint16Array:null;Ts.exports=nd});var Ds=c((k1,Is)=>{"use strict";var id=xs(),bt=Ss(),qs=_s();function ad(){var e,r;if(typeof qs!="function")return!1;try{r=[1,3.14,-3.14,bt+1,bt+2],r=new qs(r),e=id(r)&&r[0]===1&&r[1]===3&&r[2]===bt-2&&r[3]===0&&r[4]===1}catch{e=!1}return e}Is.exports=ad});var Bs=c((P1,Ns)=>{"use strict";var od=Ds();Ns.exports=od});var Vs=c(($1,Os)=>{"use strict";var sd=typeof Uint16Array=="function"?Uint16Array:void 0;Os.exports=sd});var zs=c((G1,Us)=>{"use strict";function ud(){throw new Error("not implemented")}Us.exports=ud});var Rs=c((Y1,Fs)=>{"use strict";var fd=Bs(),ld=Vs(),cd=zs(),dt;fd()?dt=ld:dt=cd;Fs.exports=dt});var js=c((W1,Cs)=>{"use strict";var pd=J(),yd=typeof Int16Array=="function";function md(e){return yd&&e instanceof Int16Array||pd(e)==="[object Int16Array]"}Cs.exports=md});var Ms=c((Z1,Ls)=>{"use strict";var hd=js();Ls.exports=hd});var Ps=c((J1,ks)=>{"use strict";var gd=32767;ks.exports=gd});var Gs=c((H1,$s)=>{"use strict";var vd=-32768;$s.exports=vd});var Ws=c((X1,Ys)=>{"use strict";var bd=typeof Int16Array=="function"?Int16Array:null;Ys.exports=bd});var Hs=c((Q1,Js)=>{"use strict";var dd=Ms(),wd=Ps(),Ad=Gs(),Zs=Ws();function xd(){var e,r;if(typeof Zs!="function")return!1;try{r=new Zs([1,3.14,-3.14,wd+1]),e=dd(r)&&r[0]===1&&r[1]===3&&r[2]===-3&&r[3]===Ad}catch{e=!1}return e}Js.exports=xd});var Qs=c((K1,Xs)=>{"use strict";var Ed=Hs();Xs.exports=Ed});var ru=c((rq,Ks)=>{"use strict";var Sd=typeof Int16Array=="function"?Int16Array:void 0;Ks.exports=Sd});var tu=c((eq,eu)=>{"use strict";function Td(){throw new Error("not implemented")}eu.exports=Td});var iu=c((tq,nu)=>{"use strict";var _d=Qs(),qd=ru(),Id=tu(),wt;_d()?wt=qd:wt=Id;nu.exports=wt});var ou=c((nq,au)=>{"use strict";var Dd=J(),Nd=typeof Uint8Array=="function";function Bd(e){return Nd&&e instanceof Uint8Array||Dd(e)==="[object Uint8Array]"}au.exports=Bd});var uu=c((iq,su)=>{"use strict";var Od=ou();su.exports=Od});var lu=c((aq,fu)=>{"use strict";var Vd=255;fu.exports=Vd});var pu=c((oq,cu)=>{"use strict";var Ud=typeof Uint8Array=="function"?Uint8Array:null;cu.exports=Ud});var hu=c((sq,mu)=>{"use strict";var zd=uu(),At=lu(),yu=pu();function Fd(){var e,r;if(typeof yu!="function")return!1;try{r=[1,3.14,-3.14,At+1,At+2],r=new yu(r),e=zd(r)&&r[0]===1&&r[1]===3&&r[2]===At-2&&r[3]===0&&r[4]===1}catch{e=!1}return e}mu.exports=Fd});var vu=c((uq,gu)=>{"use strict";var Rd=hu();gu.exports=Rd});var du=c((fq,bu)=>{"use strict";var Cd=typeof Uint8Array=="function"?Uint8Array:void 0;bu.exports=Cd});var Au=c((lq,wu)=>{"use strict";function jd(){throw new Error("not implemented")}wu.exports=jd});var Et=c((cq,xu)=>{"use strict";var Ld=vu(),Md=du(),kd=Au(),xt;Ld()?xt=Md:xt=kd;xu.exports=xt});var Su=c((pq,Eu)=>{"use strict";var Pd=J(),$d=typeof Uint8ClampedArray=="function";function Gd(e){return $d&&e instanceof Uint8ClampedArray||Pd(e)==="[object Uint8ClampedArray]"}Eu.exports=Gd});var _u=c((yq,Tu)=>{"use strict";var Yd=Su();Tu.exports=Yd});var Iu=c((mq,qu)=>{"use strict";var Wd=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:null;qu.exports=Wd});var Bu=c((hq,Nu)=>{"use strict";var Zd=_u(),Du=Iu();function Jd(){var e,r;if(typeof Du!="function")return!1;try{r=new Du([-1,0,1,3.14,4.99,255,256]),e=Zd(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}Nu.exports=Jd});var Vu=c((gq,Ou)=>{"use strict";var Hd=Bu();Ou.exports=Hd});var zu=c((vq,Uu)=>{"use strict";var Xd=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:void 0;Uu.exports=Xd});var Ru=c((bq,Fu)=>{"use strict";function Qd(){throw new Error("not implemented")}Fu.exports=Qd});var ju=c((dq,Cu)=>{"use strict";var Kd=Vu(),rw=zu(),ew=Ru(),St;Kd()?St=rw:St=ew;Cu.exports=St});var Mu=c((wq,Lu)=>{"use strict";var tw=J(),nw=typeof Int8Array=="function";function iw(e){return nw&&e instanceof Int8Array||tw(e)==="[object Int8Array]"}Lu.exports=iw});var Pu=c((Aq,ku)=>{"use strict";var aw=Mu();ku.exports=aw});var Gu=c((xq,$u)=>{"use strict";var ow=127;$u.exports=ow});var Wu=c((Eq,Yu)=>{"use strict";var sw=-128;Yu.exports=sw});var Ju=c((Sq,Zu)=>{"use strict";var uw=typeof Int8Array=="function"?Int8Array:null;Zu.exports=uw});var Qu=c((Tq,Xu)=>{"use strict";var fw=Pu(),lw=Gu(),cw=Wu(),Hu=Ju();function pw(){var e,r;if(typeof Hu!="function")return!1;try{r=new Hu([1,3.14,-3.14,lw+1]),e=fw(r)&&r[0]===1&&r[1]===3&&r[2]===-3&&r[3]===cw}catch{e=!1}return e}Xu.exports=pw});var rf=c((_q,Ku)=>{"use strict";var yw=Qu();Ku.exports=yw});var tf=c((qq,ef)=>{"use strict";var mw=typeof Int8Array=="function"?Int8Array:void 0;ef.exports=mw});var af=c((Iq,nf)=>{"use strict";function hw(){throw new Error("not implemented")}nf.exports=hw});var sf=c((Dq,of)=>{"use strict";var gw=rf(),vw=tf(),bw=af(),Tt;gw()?Tt=vw:Tt=bw;of.exports=Tt});var _t=c((Nq,uf)=>{"use strict";function dw(e){return typeof e=="number"}uf.exports=dw});var lf=c((Bq,ff)=>{"use strict";ff.exports=Number});var we=c((Oq,cf)=>{"use strict";var ww=lf();cf.exports=ww});var yf=c((Vq,pf)=>{"use strict";var Aw=we(),xw=Aw.prototype.toString;pf.exports=xw});var hf=c((Uq,mf)=>{"use strict";var Ew=yf();function Sw(e){try{return Ew.call(e),!0}catch{return!1}}mf.exports=Sw});var qt=c((zq,gf)=>{"use strict";var Tw=$r(),_w=J(),qw=we(),Iw=hf(),Dw=Tw();function Nw(e){return typeof e=="object"?e instanceof qw?!0:Dw?Iw(e):_w(e)==="[object Number]":!1}gf.exports=Nw});var bf=c((Fq,vf)=>{"use strict";var Bw=_t(),Ow=qt();function Vw(e){return Bw(e)||Ow(e)}vf.exports=Vw});var Wr=c((Rq,wf)=>{"use strict";var df=W(),It=bf(),Uw=_t(),zw=qt();df(It,"isPrimitive",Uw);df(It,"isObject",zw);wf.exports=It});var xf=c((Cq,Af)=>{"use strict";var Fw=we(),Rw=Fw.NEGATIVE_INFINITY;Af.exports=Rw});var Sf=c((jq,Ef)=>{"use strict";var Cw=Math.floor;Ef.exports=Cw});var Zr=c((Lq,Tf)=>{"use strict";var jw=Sf();Tf.exports=jw});var qf=c((Mq,_f)=>{"use strict";var Lw=Zr();function Mw(e){return Lw(e)===e}_f.exports=Mw});var Nr=c((kq,If)=>{"use strict";var kw=qf();If.exports=kw});var Dt=c((Pq,Df)=>{"use strict";var Pw=yt(),$w=xf(),Gw=Nr();function Yw(e){return e<Pw&&e>$w&&Gw(e)}Df.exports=Yw});var Nt=c(($q,Nf)=>{"use strict";var Ww=Wr().isPrimitive,Zw=Dt();function Jw(e){return Ww(e)&&Zw(e)}Nf.exports=Jw});var Bt=c((Gq,Bf)=>{"use strict";var Hw=Wr().isObject,Xw=Dt();function Qw(e){return Hw(e)&&Xw(e.valueOf())}Bf.exports=Qw});var Vf=c((Yq,Of)=>{"use strict";var Kw=Nt(),rA=Bt();function eA(e){return Kw(e)||rA(e)}Of.exports=eA});var Ae=c((Wq,zf)=>{"use strict";var Uf=W(),Ot=Vf(),tA=Nt(),nA=Bt();Uf(Ot,"isPrimitive",tA);Uf(Ot,"isObject",nA);zf.exports=Ot});var Vt=c((Zq,Ff)=>{"use strict";var iA=Ae().isPrimitive;function aA(e){return iA(e)&&e>=0}Ff.exports=aA});var Ut=c((Jq,Rf)=>{"use strict";var oA=Ae().isObject;function sA(e){return oA(e)&&e.valueOf()>=0}Rf.exports=sA});var jf=c((Hq,Cf)=>{"use strict";var uA=Vt(),fA=Ut();function lA(e){return uA(e)||fA(e)}Cf.exports=lA});var xe=c((Xq,Mf)=>{"use strict";var Lf=W(),zt=jf(),cA=Vt(),pA=Ut();Lf(zt,"isPrimitive",cA);Lf(zt,"isObject",pA);Mf.exports=zt});var Pf=c((Qq,kf)=>{"use strict";var yA=4294967295;kf.exports=yA});var Gf=c((Kq,$f)=>{"use strict";var mA=Nr(),hA=Pf();function gA(e){return typeof e=="object"&&e!==null&&typeof e.length=="number"&&mA(e.length)&&e.length>=0&&e.length<=hA}$f.exports=gA});var Br=c((rI,Yf)=>{"use strict";var vA=Gf();Yf.exports=vA});var Zf=c((eI,Wf)=>{"use strict";var bA=9007199254740991;Wf.exports=bA});var Hf=c((tI,Jf)=>{"use strict";var dA=Nr(),wA=Zf();function AA(e){return typeof e=="object"&&e!==null&&typeof e.length=="number"&&dA(e.length)&&e.length>=0&&e.length<=wA}Jf.exports=AA});var Jr=c((nI,Xf)=>{"use strict";var xA=Hf();Xf.exports=xA});var Kf=c((iI,Qf)=>{"use strict";var EA=J(),SA=typeof ArrayBuffer=="function";function TA(e){return SA&&e instanceof ArrayBuffer||EA(e)==="[object ArrayBuffer]"}Qf.exports=TA});var Ee=c((aI,rl)=>{"use strict";var _A=Kf();rl.exports=_A});var tl=c((oI,el)=>{"use strict";var qA=Cr();function IA(e){return typeof e=="object"&&e!==null&&!qA(e)}el.exports=IA});var Se=c((sI,nl)=>{"use strict";var DA=tl();nl.exports=DA});var Ft=c((uI,il)=>{"use strict";function NA(e){return typeof e=="string"}il.exports=NA});var ol=c((fI,al)=>{"use strict";var BA=String.prototype.valueOf;al.exports=BA});var ul=c((lI,sl)=>{"use strict";var OA=ol();function VA(e){try{return OA.call(e),!0}catch{return!1}}sl.exports=VA});var Rt=c((cI,fl)=>{"use strict";var UA=$r(),zA=J(),FA=ul(),RA=UA();function CA(e){return typeof e=="object"?e instanceof String?!0:RA?FA(e):zA(e)==="[object String]":!1}fl.exports=CA});var cl=c((pI,ll)=>{"use strict";var jA=Ft(),LA=Rt();function MA(e){return jA(e)||LA(e)}ll.exports=MA});var Hr=c((yI,yl)=>{"use strict";var pl=W(),Ct=cl(),kA=Ft(),PA=Rt();pl(Ct,"isPrimitive",kA);pl(Ct,"isObject",PA);yl.exports=Ct});var Te=c((mI,hl)=>{"use strict";var ml=W(),jt=ut(),Lt=Hr(),$A=jt(Lt.isPrimitive),GA=jt(Lt.isObject),Mt=jt(Lt);ml(Mt,"primitives",$A);ml(Mt,"objects",GA);hl.exports=Mt});var vl=c((hI,gl)=>{"use strict";var YA=/./;gl.exports=YA});var kt=c((gI,bl)=>{"use strict";function WA(e){return typeof e=="boolean"}bl.exports=WA});var wl=c((vI,dl)=>{"use strict";var ZA=Boolean;dl.exports=ZA});var jr=c((bI,Al)=>{"use strict";var JA=wl();Al.exports=JA});var El=c((dI,xl)=>{"use strict";var HA=Boolean.prototype.toString;xl.exports=HA});var Tl=c((wI,Sl)=>{"use strict";var XA=El();function QA(e){try{return XA.call(e),!0}catch{return!1}}Sl.exports=QA});var Pt=c((AI,_l)=>{"use strict";var KA=$r(),r0=J(),e0=jr(),t0=Tl(),n0=KA();function i0(e){return typeof e=="object"?e instanceof e0?!0:n0?t0(e):r0(e)==="[object Boolean]":!1}_l.exports=i0});var Il=c((xI,ql)=>{"use strict";var a0=kt(),o0=Pt();function s0(e){return a0(e)||o0(e)}ql.exports=s0});var Gt=c((EI,Nl)=>{"use strict";var Dl=W(),$t=Il(),u0=kt(),f0=Pt();Dl($t,"isPrimitive",u0);Dl($t,"isObject",f0);Nl.exports=$t});var Ol=c((SI,Bl)=>{"use strict";function l0(){return new Function("return this;")()}Bl.exports=l0});var Ul=c((TI,Vl)=>{"use strict";var c0=typeof self=="object"?self:null;Vl.exports=c0});var Fl=c((_I,zl)=>{"use strict";var p0=typeof window=="object"?window:null;zl.exports=p0});var Cl=c((qI,Rl)=>{"use strict";var y0=typeof globalThis=="object"?globalThis:null;Rl.exports=y0});var Pl=c((II,kl)=>{"use strict";var m0=Gt().isPrimitive,h0=Z(),g0=Ol(),jl=Ul(),Ll=Fl(),Ml=Cl();function v0(e){if(arguments.length){if(!m0(e))throw new TypeError(h0("invalid argument. Must provide a boolean. Value: `%s`.",e));if(e)return g0()}if(Ml)return Ml;if(jl)return jl;if(Ll)return Ll;throw new Error("unexpected error. Unable to resolve global object.")}kl.exports=v0});var Yl=c((DI,Gl)=>{"use strict";var b0=Pl(),$l=b0(),d0=$l.document&&$l.document.childNodes;Gl.exports=d0});var Zl=c((NI,Wl)=>{"use strict";var w0=Int8Array;Wl.exports=w0});var Hl=c((BI,Jl)=>{"use strict";var A0=vl(),x0=Yl(),E0=Zl();function S0(){return typeof A0=="function"||typeof E0=="object"||typeof x0=="function"}Jl.exports=S0});var Ql=c((OI,Xl)=>{"use strict";var T0=be();function _0(e){var r;return e===null?"null":(r=typeof e,r==="object"?T0(e).toLowerCase():r)}Xl.exports=_0});var rc=c((VI,Kl)=>{"use strict";var q0=be();function I0(e){return q0(e).toLowerCase()}Kl.exports=I0});var tc=c((UI,ec)=>{"use strict";var D0=Hl(),N0=Ql(),B0=rc(),O0=D0()?B0:N0;ec.exports=O0});var ic=c((zI,nc)=>{"use strict";var V0=tc();function U0(e){return V0(e)==="function"}nc.exports=U0});var _e=c((FI,ac)=>{"use strict";var z0=ic();ac.exports=z0});var sc=c((RI,oc)=>{"use strict";function F0(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i",e}oc.exports=F0});var fc=c((CI,uc)=>{"use strict";function R0(){var e={};return e.type="Complex128",e.re=this.re,e.im=this.im,e}uc.exports=R0});var mc=c((jI,yc)=>{"use strict";var lc=Wr().isPrimitive,cc=kr(),Xr=W(),pc=Z(),C0=sc(),j0=fc();function Or(e,r){if(!(this instanceof Or))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!lc(e))throw new TypeError(pc("invalid argument. Real component must be a number. Value: `%s`.",e));if(!lc(r))throw new TypeError(pc("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return cc(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:e}),cc(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:r}),this}Xr(Or,"BYTES_PER_ELEMENT",8);Xr(Or.prototype,"BYTES_PER_ELEMENT",8);Xr(Or.prototype,"byteLength",16);Xr(Or.prototype,"toString",C0);Xr(Or.prototype,"toJSON",j0);yc.exports=Or});var Yt=c((LI,hc)=>{"use strict";var L0=mc();hc.exports=L0});var vc=c((MI,gc)=>{"use strict";var M0=typeof Math.fround=="function"?Math.fround:null;gc.exports=M0});var wc=c((kI,dc)=>{"use strict";var k0=Yr(),bc=new k0(1);function P0(e){return bc[0]=e,bc[0]}dc.exports=P0});var Ec=c((PI,xc)=>{"use strict";var Ac=vc(),$0=wc(),Wt;typeof Ac=="function"?Wt=Ac:Wt=$0;xc.exports=Wt});var Tc=c(($I,Sc)=>{"use strict";function G0(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i",e}Sc.exports=G0});var qc=c((GI,_c)=>{"use strict";function Y0(){var e={};return e.type="Complex64",e.re=this.re,e.im=this.im,e}_c.exports=Y0});var Vc=c((YI,Oc)=>{"use strict";var Ic=Wr().isPrimitive,Dc=kr(),Qr=W(),Nc=Ec(),Bc=Z(),W0=Tc(),Z0=qc();function Vr(e,r){if(!(this instanceof Vr))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Ic(e))throw new TypeError(Bc("invalid argument. Real component must be a number. Value: `%s`.",e));if(!Ic(r))throw new TypeError(Bc("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return Dc(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Nc(e)}),Dc(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Nc(r)}),this}Qr(Vr,"BYTES_PER_ELEMENT",4);Qr(Vr.prototype,"BYTES_PER_ELEMENT",4);Qr(Vr.prototype,"byteLength",8);Qr(Vr.prototype,"toString",W0);Qr(Vr.prototype,"toJSON",Z0);Oc.exports=Vr});var Zt=c((WI,Uc)=>{"use strict";var J0=Vc();Uc.exports=J0});var Fc=c((ZI,zc)=>{"use strict";var H0=Yt(),X0=Zt();function Q0(e){return e instanceof H0||e instanceof X0?!0:typeof e=="object"&&e!==null&&typeof e.re=="number"&&typeof e.im=="number"}zc.exports=Q0});var br=c((JI,Rc)=>{"use strict";var K0=Fc();Rc.exports=K0});var jc=c((HI,Cc)=>{"use strict";var rx=Nr();function ex(e){return rx(e/2)}Cc.exports=ex});var Jt=c((XI,Lc)=>{"use strict";var tx=jc();Lc.exports=tx});var kc=c((QI,Mc)=>{"use strict";var nx=8;function ix(e){return typeof e=="object"&&e!==null&&e.constructor.name==="Complex64Array"&&e.BYTES_PER_ELEMENT===nx}Mc.exports=ix});var Ht=c((KI,Pc)=>{"use strict";var ax=kc();Pc.exports=ax});var Gc=c((r6,$c)=>{"use strict";var ox=16;function sx(e){return typeof e=="object"&&e!==null&&e.constructor.name==="Complex128Array"&&e.BYTES_PER_ELEMENT===ox}$c.exports=sx});var Xt=c((e6,Yc)=>{"use strict";var ux=Gc();Yc.exports=ux});var Zc=c((t6,Wc)=>{"use strict";var fx=nt(),qe=it();function lx(){return typeof qe=="function"&&typeof qe("foo")=="symbol"&&fx(qe,"iterator")&&typeof qe.iterator=="symbol"}Wc.exports=lx});var Kr=c((n6,Jc)=>{"use strict";var cx=Zc();Jc.exports=cx});var Xc=c((i6,Hc)=>{"use strict";var px=Kr(),yx=px()?Symbol.iterator:null;Hc.exports=yx});var Ie=c((a6,Qc)=>{"use strict";var mx=Xc();Qc.exports=mx});var rp=c((o6,Kc)=>{"use strict";var hx=kr();function gx(e,r,t){hx(e,r,{configurable:!1,enumerable:!1,get:t})}Kc.exports=gx});var De=c((s6,ep)=>{"use strict";var vx=rp();ep.exports=vx});var np=c((u6,tp)=>{"use strict";function bx(e){return e.re}tp.exports=bx});var re=c((f6,ip)=>{"use strict";var dx=np();ip.exports=dx});var op=c((l6,ap)=>{"use strict";function wx(e){return e.im}ap.exports=wx});var ee=c((c6,sp)=>{"use strict";var Ax=op();sp.exports=Ax});var fp=c((p6,up)=>{"use strict";var xx=Yr();function Ex(e,r){return new xx(e.buffer,e.byteOffset+e.BYTES_PER_ELEMENT*r,2*(e.length-r))}up.exports=Ex});var Qt=c((y6,lp)=>{"use strict";var Sx=fp();lp.exports=Sx});var pp=c((m6,cp)=>{"use strict";var Tx=de();function _x(e,r){return new Tx(e.buffer,e.byteOffset+e.BYTES_PER_ELEMENT*r,2*(e.length-r))}cp.exports=_x});var Kt=c((h6,yp)=>{"use strict";var qx=pp();yp.exports=qx});var hp=c((g6,mp)=>{"use strict";var Ix=Br(),Dx=br(),Nx=re(),Bx=ee(),Ox=Z();function Vx(e){var r,t,n;for(r=[];t=e.next(),!t.done;)if(n=t.value,Ix(n)&&n.length>=2)r.push(n[0],n[1]);else if(Dx(n))r.push(Nx(n),Bx(n));else return new TypeError(Ox("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}mp.exports=Vx});var vp=c((v6,gp)=>{"use strict";var Ux=Br(),zx=br(),Fx=re(),Rx=ee(),Cx=Z();function jx(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),Ux(a)&&a.length>=2)n.push(a[0],a[1]);else if(zx(a))n.push(Fx(a),Rx(a));else return new TypeError(Cx("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));return n}gp.exports=jx});var dp=c((b6,bp)=>{"use strict";var Lx=br(),Mx=re(),kx=ee();function Px(e,r){var t,n,i,a;for(t=r.length,a=0,i=0;i<t;i++){if(n=r[i],!Lx(n))return null;e[a]=Mx(n),e[a+1]=kx(n),a+=2}return e}bp.exports=Px});var _p=c((d6,Tp)=>{"use strict";var te=xe().isPrimitive,rn=Br(),en=Jr(),wp=Ee(),tn=Se(),$x=Cr(),Gx=Te().primitives,Ap=Hr().isPrimitive,$=_e(),ir=br(),Ne=Jt(),Q=Nr(),Yx=Ht(),Wx=Xt(),Zx=Kr(),yr=Ie(),I=W(),Be=De(),nr=Yr(),Jx=Zt(),x=Z(),ur=re(),fr=ee(),Hx=Zr(),Xx=Qt(),Qx=Kt(),Kx=Pr(),rE=Rr(),xp=hp(),eE=vp(),tE=dp(),er=nr.BYTES_PER_ELEMENT*2,Ep=Zx();function V(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 Sp(e){return e===T||e.name==="Complex128Array"}function j(e,r){return r*=2,new Jx(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 nr(0);else if(r===1)if(te(arguments[0]))t=new nr(arguments[0]*2);else if(en(arguments[0]))if(t=arguments[0],n=t.length,n&&$x(t)&&ir(t[0])){if(t=tE(new nr(n*2),t),t===null){if(!Ne(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(Yx(t))t=Xx(t,0);else if(Wx(t))t=Qx(t,0);else if(!Ne(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(wp(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(tn(arguments[0])){if(t=arguments[0],Ep===!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=xp(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],!wp(t))throw new TypeError(x("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(e=arguments[1],!te(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],!te(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(T,"BYTES_PER_ELEMENT",er);I(T,"name","Complex64Array");I(T,"from",function(r){var t,n,i,a,s,o,f,u,l,p,y,m;if(!$(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Sp(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(rn(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(en(r)){if(i){for(u=r.length,r.get&&r.set?f=rE("default"):f=Kx("default"),y=0;y<u;y++)if(!ir(f(r,y))){l=!0;break}if(l){if(!Ne(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(rn(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(tn(r)&&Ep&&$(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=eE(s,i,t):o=xp(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(T,"of",function(){var r,t;if(!$(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Sp(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(T.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 j(this._buffer,r)});Be(T.prototype,"buffer",function(){return this._buffer.buffer});Be(T.prototype,"byteLength",function(){return this._buffer.byteLength});Be(T.prototype,"byteOffset",function(){return this._buffer.byteOffset});I(T.prototype,"BYTES_PER_ELEMENT",T.BYTES_PER_ELEMENT);I(T.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(T.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,j(i,s)],done:!1}}function f(l){return a=!0,arguments.length?{value:l,done:!0}:{done:!0}}function u(){return r.entries()}});I(T.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,j(n,i),i,this))return!1;return!0});I(T.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(T.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=j(n,a),r.call(t,s,a,this)&&i.push(s);return new this.constructor(i)});I(T.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=j(n,i),r.call(t,a,i,this))return a});I(T.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=j(n,i),r.call(t,a,i,this))return i;return-1});I(T.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=j(n,i),r.call(t,a,i,this))return a});I(T.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=j(n,i),r.call(t,a,i,this))return i;return-1});I(T.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=j(n,i),r.call(t,a,i,this)});I(T.prototype,"get",function(r){if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!te(r))throw new TypeError(x("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return j(this._buffer,r)});I(T.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(T.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(T.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(Ap(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(j(n,a).toString());return t.join(i)});I(T.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(T.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});Be(T.prototype,"length",function(){return this._length});I(T.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,j(i,s),s,this),ir(o))n[2*s]=ur(o),n[2*s+1]=fr(o);else if(rn(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(T.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=j(n,0),o=1}for(;o<a;o++)s=j(n,o),i=r(i,s,o,this);return i});I(T.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=j(n,a-1),o=a-2}for(;o>=0;o--)s=j(n,o),i=r(i,s,o,this);return i});I(T.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=Hx(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(T.prototype,"set",function(r){var t,n,i,a,s,o,f,u,l;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],!te(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,l=i.byteOffset+n*er,t.buffer===i.buffer&&t.byteOffset<l&&t.byteOffset+t.byteLength>l){for(a=new nr(t.length),u=0;u<t.length;u++)a[u]=t[u];t=a}for(n*=2,l=0,u=0;u<o;u++)i[n]=t[l],i[n+1]=t[l+1],n+=2,l+=2;return}if(en(r)){for(o=r.length,u=0;u<o;u++)if(!ir(r[u])){s=!0;break}if(s){if(!Ne(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,l=i.byteOffset+n*er,t.buffer===i.buffer&&t.byteOffset<l&&t.byteOffset+t.byteLength>l){for(a=new nr(o),u=0;u<o;u++)a[u]=t[u];t=a}for(n*=2,o/=2,l=0,u=0;u<o;u++)i[n]=t[l],i[n+1]=t[l+1],n+=2,l+=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(T.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(T.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,j(n,i),i,this))return!0;return!1});I(T.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(j(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(T.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(T.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(Ap(r)||Gx(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(tn(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(j(s,o).toLocaleString(i,n));return a.join(",")});I(T.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(T.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(j(n,a));return t.sort(r),new T(t)});I(T.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(j(t,n).toString());return r.join(",")});I(T.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:j(a,s),done:!1}}function f(l){return i=!0,arguments.length?{value:l,done:!0}:{done:!0}}function u(){return t.values()}});I(T.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});Tp.exports=T});var Ip=c((w6,qp)=>{"use strict";var nE=_p();qp.exports=nE});var Np=c((A6,Dp)=>{"use strict";function iE(e){return e.re}Dp.exports=iE});var ne=c((x6,Bp)=>{"use strict";var aE=Np();Bp.exports=aE});var Vp=c((E6,Op)=>{"use strict";function oE(e){return e.im}Op.exports=oE});var ie=c((S6,Up)=>{"use strict";var sE=Vp();Up.exports=sE});var Fp=c((T6,zp)=>{"use strict";var uE=Br(),fE=br(),lE=Z(),cE=ne(),pE=ie();function yE(e){var r,t,n;for(r=[];t=e.next(),!t.done;)if(n=t.value,uE(n)&&n.length>=2)r.push(n[0],n[1]);else if(fE(n))r.push(cE(n),pE(n));else return new TypeError(lE("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}zp.exports=yE});var Cp=c((_6,Rp)=>{"use strict";var mE=Br(),hE=br(),gE=Z(),vE=ne(),bE=ie();function dE(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(hE(a))n.push(vE(a),bE(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}Rp.exports=dE});var Lp=c((q6,jp)=>{"use strict";var wE=br(),AE=ne(),xE=ie();function EE(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]=AE(n),e[a+1]=xE(n),a+=2}return e}jp.exports=EE});var Zp=c((I6,Wp)=>{"use strict";var ae=xe().isPrimitive,nn=Br(),an=Jr(),Mp=Ee(),on=Se(),SE=Cr(),TE=Te().primitives,kp=Hr(),G=_e(),or=br(),Oe=Jt(),K=Nr(),_E=Ht(),qE=Xt(),IE=Kr(),mr=Ie(),D=W(),Ve=De(),ar=de(),Pp=Yt(),lr=ne(),cr=ie(),DE=Zr(),NE=Qt(),BE=Kt(),OE=Pr(),VE=Rr(),E=Z(),$p=Fp(),UE=Cp(),zE=Lp(),tr=ar.BYTES_PER_ELEMENT*2,Gp=IE();function U(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 Yp(e){return e===_||e.name==="Complex64Array"}function L(e,r){return r*=2,new Pp(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 ar(0);else if(r===1)if(ae(arguments[0]))t=new ar(arguments[0]*2);else if(an(arguments[0]))if(t=arguments[0],n=t.length,n&&SE(t)&&or(t[0])){if(t=zE(new ar(n*2),t),t===null){if(!Oe(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(_E(t))t=NE(t,0);else if(qE(t))t=BE(t,0);else if(!Oe(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(Mp(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(on(arguments[0])){if(t=arguments[0],Gp===!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=$p(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],!Mp(t))throw new TypeError(E("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(e=arguments[1],!ae(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],!ae(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(_,"BYTES_PER_ELEMENT",tr);D(_,"name","Complex128Array");D(_,"from",function(r){var t,n,i,a,s,o,f,u,l,p,y,m;if(!G(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Yp(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(nn(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(an(r)){if(i){for(u=r.length,r.get&&r.set?f=VE("default"):f=OE("default"),y=0;y<u;y++)if(!or(f(r,y))){l=!0;break}if(l){if(!Oe(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(nn(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(on(r)&&Gp&&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=UE(s,i,t):o=$p(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(_,"of",function(){var r,t;if(!G(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Yp(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(_.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)});Ve(_.prototype,"buffer",function(){return this._buffer.buffer});Ve(_.prototype,"byteLength",function(){return this._buffer.byteLength});Ve(_.prototype,"byteOffset",function(){return this._buffer.byteOffset});D(_.prototype,"BYTES_PER_ELEMENT",_.BYTES_PER_ELEMENT);D(_.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(_.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,l),n;function f(){var p;return s+=1,a||s>=i?{done:!0}:(o+=2,p=new Pp(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 l(){return t.entries()}});D(_.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(_.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(_.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(_.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(_.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(_.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(_.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(_.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(_.prototype,"get",function(r){if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ae(r))throw new TypeError(E("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return L(this._buffer,r)});Ve(_.prototype,"length",function(){return this._length});D(_.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(_.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(_.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(kp(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(_.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(_.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(_.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(nn(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(_.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(_.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(_.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=DE(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(_.prototype,"set",function(r){var t,n,i,a,s,o,f,u,l;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],!ae(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,l=i.byteOffset+n*tr,t.buffer===i.buffer&&t.byteOffset<l&&t.byteOffset+t.byteLength>l){for(a=new ar(t.length),u=0;u<t.length;u++)a[u]=t[u];t=a}for(n*=2,l=0,u=0;u<o;u++)i[n]=t[l],i[n+1]=t[l+1],n+=2,l+=2;return}if(an(r)){for(o=r.length,u=0;u<o;u++)if(!or(r[u])){s=!0;break}if(s){if(!Oe(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,l=i.byteOffset+n*tr,t.buffer===i.buffer&&t.byteOffset<l&&t.byteOffset+t.byteLength>l){for(a=new ar(o),u=0;u<o;u++)a[u]=t[u];t=a}for(n*=2,o/=2,l=0,u=0;u<o;u++)i[n]=t[l],i[n+1]=t[l+1],n+=2,l+=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(_.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(_.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(_.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(_.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(_.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(kp(r)||TE(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(on(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(_.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(_.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)});D(_.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(_.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(l){return i=!0,arguments.length?{value:l,done:!0}:{done:!0}}function u(){return t.values()}});D(_.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});Wp.exports=_});var Hp=c((D6,Jp)=>{"use strict";var FE=Zp();Jp.exports=FE});var Qp=c((N6,Xp)=>{"use strict";var RE=jr();function CE(e){var r,t;for(r=[];t=e.next(),!t.done;)r.push(RE(t.value));return r}Xp.exports=CE});var ry=c((B6,Kp)=>{"use strict";var jE=jr();function LE(e,r,t){var n,i,a;for(n=[],a=-1;i=e.next(),!i.done;)a+=1,n.push(jE(r.call(t,i.value,a)));return n}Kp.exports=LE});var ty=c((O6,ey)=>{"use strict";var ME=jr();function kE(e,r){var t,n;for(t=r.length,n=0;n<t;n++)e[n]=ME(r[n]);return e}ey.exports=kE});var fy=c((V6,uy)=>{"use strict";var oe=xe().isPrimitive,sn=Jr(),ny=Ee(),un=Se(),Y=_e(),se=Gt().isPrimitive,pr=Ae().isPrimitive,iy=Hr().isPrimitive,PE=Te().primitives,$E=Kr(),hr=Ie(),N=W(),Ue=De(),dr=Et(),R=jr(),GE=Pr(),YE=Zr(),WE=Rr(),B=Z(),ay=Qp(),ZE=ry(),JE=ty(),Ur=dr.BYTES_PER_ELEMENT,oy=$E();function z(e){return typeof e=="object"&&e!==null&&e.constructor.name==="BooleanArray"&&e.BYTES_PER_ELEMENT===Ur}function sy(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],oe(i))t=new dr(i);else if(sn(i))t=JE(new dr(i.length),i);else if(ny(i))t=new dr(i);else if(un(i)){if(oy===!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(ay(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],!ny(t))throw new TypeError(B("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(e=arguments[1],!oe(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],!oe(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,l;if(!Y(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!sy(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(sn(r)){if(i){for(u=r.length,r.get&&r.set?f=WE("default"):f=GE("default"),a=new this(u),s=a._buffer,l=0;l<u;l++)s[l]=R(i.call(t,f(r,l),l));return a}return new this(r)}if(un(r)&&oy&&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=ZE(s,i,t):o=ay(s),u=o.length,a=new this(u),s=a._buffer,l=0;l<u;l++)s[l]=o[l];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(!sy(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])});Ue(q.prototype,"buffer",function(){return this._buffer.buffer});Ue(q.prototype,"byteLength",function(){return this._buffer.byteLength});Ue(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(l){return a=!0,arguments.length?{value:l,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(!se(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(!oe(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(!se(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(!se(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(!iy(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(!se(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});Ue(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=YE(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],!oe(n))throw new TypeError(B("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(sn(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(iy(r)||PE(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(un(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(l){return i=!0,arguments.length?{value:l,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(!se(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});uy.exports=q});var cy=c((U6,ly)=>{"use strict";var HE=fy();ly.exports=HE});var yy=c((z6,py)=>{"use strict";var XE=de(),QE=Yr(),KE=Xo(),rS=bs(),eS=Rs(),tS=iu(),nS=Et(),iS=ju(),aS=sf(),oS=Ip(),sS=Hp(),uS=cy(),fS=[XE,QE,rS,KE,tS,eS,aS,nS,iS,oS,sS,uS];py.exports=fS});var hy=c((F6,my)=>{"use strict";var lS=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"];my.exports=lS});var by=c((R6,vy)=>{"use strict";var cS=lt(),pS=Cr(),yS=be(),mS=Qa(),hS=yy(),gy=hy(),gS=gy.length;function vS(e){var r;if(pS(e))return"generic";if(cS(e))return null;for(r=0;r<gS;r++)if(e instanceof hS[r])return gy[r];return mS[yS(e)]||null}vy.exports=vS});var fn=c((C6,dy)=>{"use strict";var bS=by();dy.exports=bS});var Ay=c((j6,wy)=>{"use strict";var dS=et(),wS=Rr(),AS=Pr(),xS=fn();function ES(e,r){var t,n,i,a;for(i=xS(e),dS(e)?n=wS(i):n=AS(i),t=e.length,a=0;a<t;a++)if(n(e,a)===r)return!0;return!1}wy.exports=ES});var Ey=c((L6,xy)=>{"use strict";var SS=Jr(),TS=et(),_S=Rr(),qS=fn(),IS=Z();function DS(e){var r,t,n;if(!SS(e))throw new TypeError(IS("invalid argument. Must provide an array-like object. Value: `%s`.",e));return n=qS(e),TS(e)&&(r=_S(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}}xy.exports=DS});var ln=c((M6,Ty)=>{"use strict";var NS=W(),Sy=Ay(),BS=Ey();NS(Sy,"factory",BS);Ty.exports=Sy});var _y=c((k6,OS)=>{OS.exports=["row-major","column-major"]});var Iy=c((P6,qy)=>{"use strict";var VS=_y();function US(){return VS.slice()}qy.exports=US});var Ny=c(($6,Dy)=>{"use strict";function zS(){return{"row-major":101,"column-major":102}}Dy.exports=zS});var Vy=c((G6,Oy)=>{"use strict";var FS=W(),By=Iy(),RS=Ny();FS(By,"enum",RS);Oy.exports=By});var zy=c((Y6,Uy)=>{"use strict";var CS=ln().factory,jS=Vy(),LS=CS(jS());Uy.exports=LS});var Ry=c((W6,Fy)=>{"use strict";var MS=zy();Fy.exports=MS});var Cy=c((Z6,kS)=>{kS.exports=["no-transpose","transpose","conjugate-transpose"]});var Ly=c((J6,jy)=>{"use strict";var PS=Cy();function $S(){return PS.slice()}jy.exports=$S});var ky=c((H6,My)=>{"use strict";function GS(){return{"no-transpose":111,transpose:112,"conjugate-transpose":113}}My.exports=GS});var Gy=c((X6,$y)=>{"use strict";var YS=W(),Py=Ly(),WS=ky();YS(Py,"enum",WS);$y.exports=Py});var Wy=c((Q6,Yy)=>{"use strict";var ZS=ln().factory,JS=Gy(),HS=ZS(JS());Yy.exports=HS});var cn=c((K6,Zy)=>{"use strict";var XS=Wy();Zy.exports=XS});var Hy=c((r2,Jy)=>{"use strict";function QS(e){return Math.abs(e)}Jy.exports=QS});var Qy=c((e2,Xy)=>{"use strict";var KS=Hy();Xy.exports=KS});var em=c((t2,rm)=>{"use strict";var Ky=Qy();function rT(e){var r,t,n,i;if(r=e.length,r===0)return!1;for(t=Ky(e[0]),i=1;i<r;i++){if(n=Ky(e[i]),n>t)return!1;t=n}return!0}rm.exports=rT});var nm=c((n2,tm)=>{"use strict";var eT=em();tm.exports=eT});var am=c((i2,im)=>{"use strict";function tT(e,r){return r>0?0:(1-e)*r}im.exports=tT});var sm=c((a2,om)=>{"use strict";var nT=am();om.exports=nT});var pn=c((o2,um)=>{"use strict";var ue=5;function iT(e,r,t,n,i,a,s){var o,f,u,l,p;if(o=0,e<=0)return o;if(f=n,u=s,t===1&&a===1){if(l=e%ue,l>0)for(p=0;p<l;p++)o+=r[f]*i[u],f+=1,u+=1;if(e<ue)return o;for(p=l;p<e;p+=ue)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+=ue,u+=ue;return o}for(p=0;p<e;p++)o+=r[f]*i[u],f+=t,u+=a;return o}um.exports=iT});var cm=c((s2,lm)=>{"use strict";var fm=sm(),aT=pn();function oT(e,r,t,n,i){var a,s;return e<=0?0:(a=fm(e,t),s=fm(e,i),aT(e,r,t,a,n,i,s))}lm.exports=oT});var mm=c((u2,ym)=>{"use strict";var sT=W(),pm=cm(),uT=pn();sT(pm,"ndarray",uT);ym.exports=pm});var hm=c((f2,fT)=>{fT.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 vm=c((l2,gm)=>{"use strict";var lT=hm();function cT(e){return lT[e]||null}gm.exports=cT});var dm=c((c2,bm)=>{"use strict";var pT=vm();bm.exports=pT});var Am=c((p2,wm)=>{"use strict";var yT={BLOCK_SIZE_IN_BYTES:64,BLOCK_SIZE_IN_ELEMENTS:8};wm.exports=yT});var Sm=c((y2,Em)=>{"use strict";var xm=dm(),yn=Am();function mT(e,r){var t,n;return t=xm(e),n=xm(r),t===null||n===null?yn.BLOCK_SIZE_IN_ELEMENTS:t>n?yn.BLOCK_SIZE_IN_BYTES/t|0:yn.BLOCK_SIZE_IN_BYTES/n|0}Em.exports=mT});var _m=c((m2,Tm)=>{"use strict";var hT=Sm();Tm.exports=hT});var mn=c((h2,Im)=>{"use strict";var Fe=nm(),qm=mm().ndarray,gT=_m(),wr=gT("float64");function Ir(e){return e!=="no-transpose"}function vT(e,r,t,n,i,a){var s,o,f,u,l,p,y;for(Fe([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(l=0;l<f;l++)t[y]=0,y+=s;y+=o}return t}function bT(e,r,t,n,i,a,s){var o,f,u,l,p,y,m;for(Fe([i,a])?(u=r,l=e,o=a,f=i-u*a):(u=e,l=r,o=i,f=a-u*i),m=s,y=0;y<l;y++){for(p=0;p<u;p++)n[m]*=t,m+=o;m+=f}return n}function ze(e,r,t,n,i,a,s,o,f,u,l,p,y,m,h,g){var v,w,A,S,O,C,F,M,gr,Lr,vr;for(O=r,C=e,v=s,w=u,A=h,S=m-O*h,vr=g,M=0;M<C;M++){for(gr=o+M*a,F=0;F<O;F++)Lr=p+F*l,y[vr]+=n*qm(t,i,v,gr,f,w,Lr),vr+=A;vr+=S}return y}function dT(e,r,t,n,i,a,s,o,f,u,l,p,y,m,h,g){var v,w,A,S,O,C,F,M,gr,Lr,vr,Re,Ce,ce,pe,Er,Sr,wn,An,ye,xn,En,Tr;for(gr=r,Lr=e,v=s,w=u,A=h,Sr=Lr;Sr>0;)for(Sr<wr?(Re=Sr,Sr=0):(Re=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),C=p+Er*l,F=M+Er*h,S=m-vr*h,Tr=t;Tr>0;)for(Tr<wr?(Ce=Tr,Tr=0):(Ce=wr,Tr-=wr),xn=O+Tr*s,En=C+Tr*u,ye=F,pe=0;pe<Re;pe++){for(wn=xn+pe*a,ce=0;ce<vr;ce++)An=En+ce*l,y[ye]+=n*qm(Ce,i,v,wn,f,w,An),ye+=A;ye+=S}return y}function wT(e,r,t,n,i,a,s,o,f,u,l,p,y,m,h,g,v,w,A){var S,O,C,F,M,gr;if(t===0||n===0||h===1&&(a===0||i===0)||(h===0?g=vT(t,n,g,v,w,A):h!==1&&(g=bT(t,n,h,g,v,w,A)),a===0))return g;if(S=Fe([o,f]),O=Fe([p,y]),S){if(!Ir(e)){if(!O&&!Ir(r))return ze(t,n,i,a,s,o,f,u,l,p,y,m,g,v,w,A);if(O&&Ir(r))return ze(t,n,i,a,s,o,f,u,l,y,p,m,g,v,w,A)}}else if(Ir(e)){if(O&&Ir(r))return ze(t,n,i,a,s,f,o,u,l,y,p,m,g,v,w,A);if(!O&&!Ir(r))return ze(t,n,i,a,s,f,o,u,l,p,y,m,g,v,w,A)}return Ir(e)?(C=f,F=o):(C=o,F=f),Ir(r)?(M=y,gr=p):(M=p,gr=y),dT(t,n,i,a,s,C,F,u,l,M,gr,m,g,v,w,A)}Im.exports=wT});var Bm=c((g2,Nm)=>{"use strict";var hn=Zi(),AT=Ry(),Dm=cn(),Ar=Z(),xT=mn();function ET(e,r,t,n,i,a,s,o,f,u,l,p,y,m){var h,g,v,w,A,S,O,C,F;if(!AT(e))throw new TypeError(Ar("invalid argument. First argument must be a valid order. Value: `%s`.",e));if(!Dm(r))throw new TypeError(Ar("invalid argument. Second argument must be a valid transpose operation. Value: `%s`.",r));if(!Dm(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<hn(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(l<hn(1,g))throw new RangeError(Ar("invalid argument. Eleventh argument must be greater than or equal to max(1,%d). Value: `%d`.",g,l));if(e==="row-major"?v=i:v=n,m<hn(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=l,C=1,F=m):(w=f,A=1,S=l,O=1,C=m,F=1),xT(r,t,n,i,a,s,o,w,A,0,u,S,O,0,p,y,C,F,0)}Nm.exports=ET});var Um=c((v2,Vm)=>{"use strict";var Om=cn(),fe=Z(),ST=mn();function TT(e,r,t,n,i,a,s,o,f,u,l,p,y,m,h,g,v,w,A){if(!Om(e))throw new TypeError(fe("invalid argument. First argument must be a valid transpose operation. Value: `%s`.",e));if(!Om(r))throw new TypeError(fe("invalid argument. Second argument must be a valid transpose operation. Value: `%s`.",r));if(t<0)throw new RangeError(fe("invalid argument. Third argument must be a nonnegative integer. Value: `%d`.",t));if(n<0)throw new RangeError(fe("invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.",t));if(i<0)throw new RangeError(fe("invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.",i));return ST(e,r,t,n,i,a,s,o,f,u,l,p,y,m,h,g,v,w,A)}Vm.exports=TT});var Rm=c((b2,Fm)=>{"use strict";var _T=W(),zm=Bm(),qT=Um();_T(zm,"ndarray",qT);Fm.exports=zm});var UT={};mh(UT,{NDArray:()=>rr,__version__:()=>VT,absolute:()=>th,arange:()=>Pm,array:()=>xr,asarray:()=>Zm,copy:()=>Jm,empty:()=>bn,empty_like:()=>Qm,eye:()=>vn,floor_divide:()=>oh,full:()=>dn,full_like:()=>Km,geomspace:()=>Ym,identity:()=>Wm,linspace:()=>$m,logspace:()=>Gm,mod:()=>ah,negative:()=>nh,ones:()=>gn,ones_like:()=>Xm,positive:()=>sh,power:()=>eh,reciprocal:()=>uh,sign:()=>ih,sqrt:()=>rh,zeros:()=>le,zeros_like:()=>Hm});function Tn(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 _n(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 qn(e){return e==="float64"||e==="float32"}function d(e){return e==="int64"||e==="uint64"}function _r(e,r){if(e===r)return e;if(e==="bool")return r;if(r==="bool")return e;if(qn(e)||qn(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 l=o+1;l<i;l++)f*=t[l];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 l=Math.floor(s/u);s=s%u,o+=l*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 je(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 In(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 vh(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 he(e,r){let t=vh(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=In(e.shape,r.shape),a=he(e,i),s=he(r,i),o=_r(e.dtype,r.dtype),f=b.zeros(i,o),u=f.data,l=f.size;if(d(o)){let p=u;for(let y=0;y<l;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<l;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=In(e.shape,r.shape),i=he(e,n),a=he(r,n),s=n.reduce((u,l)=>u*l,1),o=new Uint8Array(s),f=d(e.dtype)||d(r.dtype);for(let u=0;u<s;u++){let l=i.iget(u),p=a.iget(u),y=Number(l),m=Number(p);o[u]=t(y,m)?1:0}return b.fromData(o,n,"bool")}function Dn(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,l=e.data;if(d(n))if(d(o)){let p=u;for(let y=0;y<a;y++){let m=Number(l[y]);p[y]=BigInt(Math.round(r(m)))}}else for(let p=0;p<a;p++)u[p]=r(Number(l[p]));else for(let p=0;p<a;p++)u[p]=r(Number(l[p]));return f}function Le(e,r){return e.isCContiguous&&r.isCContiguous&&e.shape.length===r.shape.length&&e.shape.every((t,n)=>t===r.shape[n])}function Nn(e,r){return typeof r=="number"?Ah(e,r):Le(e,r)?bh(e,r):sr(e,r,(t,n)=>t+n,"add")}function bh(e,r){let t=_r(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 l=0;l<i;l++){let p=typeof a[l]=="bigint"?a[l]:BigInt(Math.round(Number(a[l]))),y=typeof s[l]=="bigint"?s[l]:BigInt(Math.round(Number(s[l])));f[l]=p+y}else{let l=a,p=s;for(let y=0;y<i;y++)f[y]=l[y]+p[y]}}else if(d(e.dtype)||d(r.dtype))for(let u=0;u<i;u++){let l=typeof a[u]=="bigint"?Number(a[u]):a[u],p=typeof s[u]=="bigint"?Number(s[u]):s[u];o[u]=l+p}else for(let u=0;u<i;u++)o[u]=a[u]+s[u];return n}function Bn(e,r){return typeof r=="number"?xh(e,r):Le(e,r)?dh(e,r):sr(e,r,(t,n)=>t-n,"subtract")}function dh(e,r){let t=_r(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 l=0;l<i;l++){let p=typeof a[l]=="bigint"?a[l]:BigInt(Math.round(Number(a[l]))),y=typeof s[l]=="bigint"?s[l]:BigInt(Math.round(Number(s[l])));f[l]=p-y}else{let l=a,p=s;for(let y=0;y<i;y++)f[y]=l[y]-p[y]}}else if(d(e.dtype)||d(r.dtype))for(let u=0;u<i;u++){let l=typeof a[u]=="bigint"?Number(a[u]):a[u],p=typeof s[u]=="bigint"?Number(s[u]):s[u];o[u]=l-p}else for(let u=0;u<i;u++)o[u]=a[u]-s[u];return n}function On(e,r){return typeof r=="number"?Eh(e,r):Le(e,r)?wh(e,r):sr(e,r,(t,n)=>t*n,"multiply")}function wh(e,r){let t=_r(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 l=0;l<i;l++){let p=typeof a[l]=="bigint"?a[l]:BigInt(Math.round(Number(a[l]))),y=typeof s[l]=="bigint"?s[l]:BigInt(Math.round(Number(s[l])));f[l]=p*y}else{let l=a,p=s;for(let y=0;y<i;y++)f[y]=l[y]*p[y]}}else if(d(e.dtype)||d(r.dtype))for(let u=0;u<i;u++){let l=typeof a[u]=="bigint"?Number(a[u]):a[u],p=typeof s[u]=="bigint"?Number(s[u]):s[u];o[u]=l*p}else for(let u=0;u<i;u++)o[u]=a[u]*s[u];return n}function Vn(e,r){if(typeof r=="number")return Sh(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,(l,p)=>l/p,"divide")}if(i||a){let f=i?e:zr(e,"float32"),u=a?r:zr(r,"float32");return sr(f,u,(l,p)=>l/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 Ah(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,l=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]+l}else for(let f=0;f<a;f++)o[f]=Number(i[f])+r;return s}function xh(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,l=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]-l}else for(let f=0;f<a;f++)o[f]=Number(i[f])-r;return s}function Eh(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,l=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]*l}else for(let f=0;f<a;f++)o[f]=Number(i[f])*r;return s}function Sh(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 l=0;l<a;l++)u[l]=Number(i[l])/r;else for(let l=0;l<a;l++)u[l]=Number(i[l])/r;return f}function Un(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 l=o[u];f[u]=l<0n?-l:l}}else for(let o=0;o<i;o++)s[o]=Math.abs(Number(n[o]));return a}function zn(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 Fn(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 l=o[u];f[u]=l>0n?1n:l<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 Rn(e,r){return typeof r=="number"?Th(e,r):sr(e,r,(t,n)=>(t%n+n)%n,"mod")}function Th(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,l=BigInt(Math.round(r));for(let p=0;p<a;p++){let y=f[p];u[p]=(y%l+l)%l}}else for(let f=0;f<a;f++){let u=Number(i[f]);o[f]=(u%r+r)%r}return s}function Cn(e,r){return typeof r=="number"?_h(e,r):sr(e,r,(t,n)=>Math.floor(t/n),"floor_divide")}function _h(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,l=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]/l}else for(let f=0;f<a;f++)o[f]=Math.floor(Number(i[f])/r);return s}function jn(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 Ln(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 Mn(e,r){return typeof r=="number"?Ih(e,r):qr(e,r,(t,n)=>t>n)}function kn(e,r){return typeof r=="number"?Dh(e,r):qr(e,r,(t,n)=>t>=n)}function Pn(e,r){return typeof r=="number"?Nh(e,r):qr(e,r,(t,n)=>t<n)}function $n(e,r){return typeof r=="number"?Bh(e,r):qr(e,r,(t,n)=>t<=n)}function Gn(e,r){return typeof r=="number"?Oh(e,r):qr(e,r,(t,n)=>t===n)}function Yn(e,r){return typeof r=="number"?Vh(e,r):qr(e,r,(t,n)=>t!==n)}function Me(e,r,t=1e-5,n=1e-8){return typeof r=="number"?Uh(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 Wn(e,r,t=1e-5,n=1e-8){let i=Me(e,r,t,n),a=i.data;for(let s=0;s<i.size;s++)if(a[s]===0)return!1;return!0}function Ih(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 Dh(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 Nh(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 Bh(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 Oh(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 Vh(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 Uh(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]),l=Math.abs(u-r),p=n+t*Math.abs(r);i[f]=l<=p?1:0}}else for(let o=0;o<e.size;o++){let f=Number(a[o]),u=Math.abs(f-r),l=n+t*Math.abs(r);i[o]=u<=l?1:0}return b.fromData(i,Array.from(e.shape),"bool")}function k(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 P(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 l=b.zeros(u,n),p=l.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=P(v,f,A,i),O=k(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=P(h,f,v,i),A=k(w,i);g+=Number(o[A])}p[h]=g}if(t){let h=[...i];return h[f]=1,b.fromData(p,h,n)}return l}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),l=u.data,p=s.data;if(d(n)){let y=p;for(let m=0;m<l.length;m++)l[m]=Number(y[m])/o}else for(let y=0;y<l.length;y++)l[y]=Number(p[y])/o;return u}function Pe(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 Pe(e);let l=b.zeros(u,n),p=l.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=P(v,f,0,i),A=k(w,i),S=h[A];for(let O=1;O<y;O++){let C=P(v,f,O,i),F=k(C,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=P(h,f,v,i),A=k(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 l}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(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 $e(e);let l=b.zeros(u,n),p=l.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=P(v,f,A,i),O=k(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=P(h,f,v,i),A=k(w,i);g*=Number(o[A])}p[h]=g}if(t){let h=[...i];return h[f]=1,b.fromData(p,h,n)}return l}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(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 Ge(e);let l=b.zeros(u,n),p=l.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=P(v,f,0,i),A=k(w,i),S=h[A];for(let O=1;O<y;O++){let C=P(v,f,O,i),F=k(C,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=P(h,f,v,i),A=k(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 l}function Ye(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 Ye(e);let u=b.zeros(f,"int32"),l=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=P(h,o,0,n),v=k(g,n),w=m[v],A=0;for(let S=1;S<p;S++){let O=P(h,o,S,n),C=k(O,n),F=m[C];F<w&&(w=F,A=S)}l[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=P(m,o,v,n),A=k(w,n),S=Number(s[A]);S<h&&(h=S,g=v)}l[m]=g}return u}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("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 We(e);let u=b.zeros(f,"int32"),l=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=P(h,o,0,n),v=k(g,n),w=m[v],A=0;for(let S=1;S<p;S++){let O=P(h,o,S,n),C=k(O,n),F=m[C];F>w&&(w=F,A=S)}l[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=P(m,o,v,n),A=k(w,n),S=Number(s[A]);S>h&&(h=S,g=v)}l[m]=g}return u}function Ze(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 l=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<l;O++){let C=P(w,u,O,i),F=k(C,i),M=Number(o[F])-S;A+=M*M}g[w]=A/(l-t)}return h}function Zn(e,r,t=0,n=!1){let i=Ze(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 Je(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 Je(e);let u=b.zeros(f,"bool"),l=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=P(m,o,g,n),w=k(v,n);if(!s[w]){h=!1;break}}l[m]=h?1:0}if(t){let m=[...n];return m[o]=1,b.fromData(l,m,"bool")}return u}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!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 He(e);let u=b.zeros(f,"bool"),l=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=P(m,o,g,n),w=k(v,n);if(s[w]){h=!0;break}}l[m]=h?1:0}if(t){let m=[...n];return m[o]=1,b.fromData(l,m,"bool")}return u}function Jn(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),l=t/u;if(!Number.isInteger(l))throw new Error(`cannot reshape array of size ${t} into shape ${JSON.stringify(r)}`);a=r.map((p,y)=>y===i?l:p)}else a=r;if(a.reduce((u,l)=>u*l,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,je(a),0)}let f=e.copy().data;return b.fromData(f,a,n,je(a),0)}function Xe(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,l)=>{if(l===t){let p=e.get(...u);s[o++]=p;return}for(let p=0;p<r[l];p++)u[l]=p,f(u,l+1)};return f(new Array(t),0),b.fromData(s,[n],i,[1],0)}function Hn(e){let r=e.size,t=e.dtype;if(e.isCContiguous){let n=e.data;return b.fromData(n,[r],t,[1],0)}return Xe(e)}function Xn(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),l=o.map(p=>u[p]);return b.fromData(a,f,s,l,e.offset)}function Qn(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 l=0;l<n;l++)l!==o&&(f.push(t[l]),u.push(i[l]));return b.fromData(a,f,s,u,e.offset)}}function Kn(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)],l=o<n?i[o]*(t[o]||1):1;return u.splice(o,0,l),b.fromData(a,f,s,u,e.offset)}var Cm=hh(Rm(),1);function jm(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=_r(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)),l=b.zeros([t,a],"float64");return(0,Cm.default)("row-major","no-transpose","no-transpose",t,a,n,1,f,n,u,a,0,l.data,a),l}function Lm(e){return Dn(e,Math.sqrt,!1)}function Mm(e,r){return typeof r=="number"?DT(e,r):sr(e,r,Math.pow,"power")}function DT(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),l=u.data;if(d(t))if(d(f)&&Number.isInteger(r)&&r>=0){let p=i,y=l;for(let m=0;m<a;m++)y[m]=p[m]**BigInt(r)}else for(let p=0;p<a;p++)l[p]=Math.pow(Number(i[p]),r);else for(let p=0;p<a;p++)l[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 l=f;if(r==="bool")for(let p=0;p<a;p++)o[p]=l[p]!==BigInt(0)?1:0;else for(let p=0;p<a;p++)o[p]=Number(l[p])}else if(!d(n)&&d(r)){let l=f;for(let p=0;p<a;p++)o[p]=BigInt(Math.round(Number(l[p])))}else if(r==="bool"){let l=f;for(let p=0;p<a;p++)o[p]=l[p]!==0?1:0}else if(n==="bool"&&!d(r)){let l=f;for(let p=0;p<a;p++)o[p]=l[p]}else if(!d(n)&&!d(r)){let l=f;for(let p=0;p<a;p++)o[p]=l[p]}else{let l=f;for(let p=0;p<a;p++)o[p]=l[p]}let u=b.fromData(o,i,r);return new e(u)}add(r){let t=typeof r=="number"?r:r._storage,n=Nn(this._storage,t);return e._fromStorage(n)}subtract(r){let t=typeof r=="number"?r:r._storage,n=Bn(this._storage,t);return e._fromStorage(n)}multiply(r){let t=typeof r=="number"?r:r._storage,n=On(this._storage,t);return e._fromStorage(n)}divide(r){let t=typeof r=="number"?r:r._storage,n=Vn(this._storage,t);return e._fromStorage(n)}mod(r){let t=typeof r=="number"?r:r._storage,n=Rn(this._storage,t);return e._fromStorage(n)}floor_divide(r){let t=typeof r=="number"?r:r._storage,n=Cn(this._storage,t);return e._fromStorage(n)}positive(){let r=jn(this._storage);return e._fromStorage(r)}reciprocal(){let r=Ln(this._storage);return e._fromStorage(r)}sqrt(){let r=Lm(this._storage);return e._fromStorage(r)}power(r){let t=typeof r=="number"?r:r._storage,n=Mm(this._storage,t);return e._fromStorage(n)}absolute(){let r=Un(this._storage);return e._fromStorage(r)}negative(){let r=zn(this._storage);return e._fromStorage(r)}sign(){let r=Fn(this._storage);return e._fromStorage(r)}greater(r){let t=typeof r=="number"?r:r._storage,n=Mn(this._storage,t);return e._fromStorage(n)}greater_equal(r){let t=typeof r=="number"?r:r._storage,n=kn(this._storage,t);return e._fromStorage(n)}less(r){let t=typeof r=="number"?r:r._storage,n=Pn(this._storage,t);return e._fromStorage(n)}less_equal(r){let t=typeof r=="number"?r:r._storage,n=$n(this._storage,t);return e._fromStorage(n)}equal(r){let t=typeof r=="number"?r:r._storage,n=Gn(this._storage,t);return e._fromStorage(n)}not_equal(r){let t=typeof r=="number"?r:r._storage,n=Yn(this._storage,t);return e._fromStorage(n)}isclose(r,t=1e-5,n=1e-8){let i=typeof r=="number"?r:r._storage,a=Me(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 Wn(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=Pe(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}min(r,t=!1){let n=Ge(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}prod(r,t=!1){let n=$e(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}argmin(r){let t=Ye(this._storage,r);return typeof t=="number"?t:e._fromStorage(t)}argmax(r){let t=We(this._storage,r);return typeof t=="number"?t:e._fromStorage(t)}var(r,t=0,n=!1){let i=Ze(this._storage,r,t,n);return typeof i=="number"?i:e._fromStorage(i)}std(r,t=0,n=!1){let i=Zn(this._storage,r,t,n);return typeof i=="number"?i:e._fromStorage(i)}all(r,t=!1){let n=Je(this._storage,r,t);return typeof n=="boolean"?n:e._fromStorage(n)}any(r,t=!1){let n=He(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=Jn(this._storage,t),a=n.data===this.data?this._base??this:void 0;return e._fromStorage(n,a)}flatten(){let r=Xe(this._storage);return e._fromStorage(r)}ravel(){let r=Hn(this._storage),n=r.data===this.data?this._base??this:void 0;return e._fromStorage(r,n)}transpose(r){let t=Xn(this._storage,r),n=this._base??this;return e._fromStorage(t,n)}squeeze(r){let t=Qn(this._storage,r),n=this._base??this;return e._fromStorage(t,n)}expand_dims(r){let t=Kn(this._storage,r),n=this._base??this;return e._fromStorage(t,n)}matmul(r){let t=jm(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 l=Tn(f);return _n(l,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],l=this._storage.strides[f];if(a+=u.start*l,!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(l*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 le(e,r=H){let t=b.zeros(e,r);return new rr(t)}function gn(e,r=H){let t=b.ones(e,r);return new rr(t)}function BT(e){let r=[],t=e;for(;Array.isArray(t);)r.push(t.length),t=t[0];return r}function km(e){return typeof e=="bigint"?!0:Array.isArray(e)?e.some(r=>km(r)):!1}function OT(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=km(e),n=BT(e),i=n.reduce((l,p)=>l*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=OT(e);if(d(a)){let l=o;for(let p=0;p<i;p++){let y=f[p];l[p]=typeof y=="bigint"?y:BigInt(Math.round(Number(y)))}}else if(a==="bool"){let l=o;for(let p=0;p<i;p++)l[p]=f[p]?1:0}else{let l=o;for(let p=0;p<i;p++){let y=f[p];l[p]=Number(y)}}let u=b.fromData(o,n,a);return new rr(u)}function Pm(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 l=0;l<s;l++)f[l]=BigInt(Math.round(i+l*t));else if(n==="bool")for(let l=0;l<s;l++)f[l]=i+l*t!==0?1:0;else for(let l=0;l<s;l++)f[l]=i+l*t;let u=b.fromData(f,[s],n);return new rr(u)}function $m(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 Gm(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 l=e+u*o;s[u]=BigInt(Math.round(Math.pow(n,l)))}else if(i==="bool")for(let u=0;u<t;u++){let l=e+u*o;s[u]=Math.pow(n,l)!==0?1:0}else for(let u=0;u<t;u++){let l=e+u*o;s[u]=Math.pow(n,l)}let f=b.fromData(s,[t],i);return new rr(f)}function Ym(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)),l=(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*l);o[y]=BigInt(Math.round(m))}else if(n==="bool")for(let y=0;y<t;y++){let m=i*Math.exp(f+y*l);o[y]=m!==0?1:0}else for(let y=0;y<t;y++){let m=i*Math.exp(f+y*l);o[y]=m}let p=b.fromData(o,[t],n);return new rr(p)}function vn(e,r,t=0,n=H){let i=r??e,a=le([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 bn(e,r=H){return le(e,r)}function dn(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 Wm(e,r=H){return vn(e,e,0,r)}function Zm(e,r){return e instanceof rr?!r||e.dtype===r?e:e.astype(r):xr(e,r)}function Jm(e){return e.copy()}function Hm(e,r){return le(Array.from(e.shape),r??e.dtype)}function Xm(e,r){return gn(Array.from(e.shape),r??e.dtype)}function Qm(e,r){return bn(Array.from(e.shape),r??e.dtype)}function Km(e,r,t){return dn(Array.from(e.shape),r,t??e.dtype)}function rh(e){return e.sqrt()}function eh(e,r){return e.power(r)}function th(e){return e.absolute()}function nh(e){return e.negative()}function ih(e){return e.sign()}function ah(e,r){return e.mod(r)}function oh(e,r){return e.floor_divide(r)}function sh(e){return e.positive()}function uh(e){return e.reciprocal()}var VT="0.3.0";return gh(UT);})();
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
@stdlib/utils/define-property/lib/define_property.js:
|
|
5
|
-
@stdlib/utils/define-property/lib/has_define_property_support.js:
|
|
6
|
-
@stdlib/regexp/function-name/lib/main.js:
|
|
7
|
-
@stdlib/regexp/function-name/lib/index.js:
|
|
8
|
-
@stdlib/complex/float32/real/lib/main.js:
|
|
9
|
-
@stdlib/complex/float32/real/lib/index.js:
|
|
10
|
-
@stdlib/complex/float32/imag/lib/main.js:
|
|
11
|
-
@stdlib/complex/float32/imag/lib/index.js:
|
|
12
|
-
@stdlib/strided/base/reinterpret-complex64/lib/main.js:
|
|
13
|
-
@stdlib/strided/base/reinterpret-complex64/lib/index.js:
|
|
14
|
-
@stdlib/strided/base/reinterpret-complex128/lib/main.js:
|
|
15
|
-
@stdlib/strided/base/reinterpret-complex128/lib/index.js:
|
|
16
|
-
@stdlib/math/base/special/abs/lib/main.js:
|
|
17
|
-
(**
|
|
18
|
-
* @license Apache-2.0
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) 2021 The Stdlib Authors.
|
|
21
|
-
*
|
|
22
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
23
|
-
* you may not use this file except in compliance with the License.
|
|
24
|
-
* You may obtain a copy of the License at
|
|
25
|
-
*
|
|
26
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
27
|
-
*
|
|
28
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
29
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
30
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
31
|
-
* See the License for the specific language governing permissions and
|
|
32
|
-
* limitations under the License.
|
|
33
|
-
*)
|
|
34
|
-
|
|
35
|
-
@stdlib/utils/define-property/lib/builtin.js:
|
|
36
|
-
@stdlib/utils/define-property/lib/polyfill.js:
|
|
37
|
-
@stdlib/utils/define-property/lib/index.js:
|
|
38
|
-
@stdlib/utils/define-nonenumerable-read-only-property/lib/main.js:
|
|
39
|
-
@stdlib/utils/define-nonenumerable-read-only-property/lib/index.js:
|
|
40
|
-
@stdlib/math/base/special/fast/max/lib/main.js:
|
|
41
|
-
@stdlib/math/base/special/fast/max/lib/index.js:
|
|
42
|
-
@stdlib/assert/has-symbol-support/lib/main.js:
|
|
43
|
-
@stdlib/assert/has-symbol-support/lib/index.js:
|
|
44
|
-
@stdlib/assert/has-tostringtag-support/lib/main.js:
|
|
45
|
-
@stdlib/assert/has-tostringtag-support/lib/index.js:
|
|
46
|
-
@stdlib/utils/native-class/lib/tostring.js:
|
|
47
|
-
@stdlib/utils/native-class/lib/main.js:
|
|
48
|
-
@stdlib/assert/has-own-property/lib/main.js:
|
|
49
|
-
@stdlib/assert/has-own-property/lib/index.js:
|
|
50
|
-
@stdlib/symbol/ctor/lib/main.js:
|
|
51
|
-
@stdlib/symbol/ctor/lib/index.js:
|
|
52
|
-
@stdlib/utils/native-class/lib/tostringtag.js:
|
|
53
|
-
@stdlib/utils/native-class/lib/polyfill.js:
|
|
54
|
-
@stdlib/utils/native-class/lib/index.js:
|
|
55
|
-
@stdlib/assert/is-array/lib/main.js:
|
|
56
|
-
@stdlib/assert/is-array/lib/index.js:
|
|
57
|
-
@stdlib/assert/tools/array-function/lib/main.js:
|
|
58
|
-
@stdlib/assert/tools/array-function/lib/index.js:
|
|
59
|
-
@stdlib/assert/is-object-like/lib/main.js:
|
|
60
|
-
@stdlib/assert/is-object-like/lib/index.js:
|
|
61
|
-
@stdlib/assert/is-buffer/lib/main.js:
|
|
62
|
-
@stdlib/assert/is-buffer/lib/index.js:
|
|
63
|
-
@stdlib/regexp/function-name/lib/regexp.js:
|
|
64
|
-
@stdlib/utils/constructor-name/lib/main.js:
|
|
65
|
-
@stdlib/utils/constructor-name/lib/index.js:
|
|
66
|
-
@stdlib/assert/is-float64array/lib/main.js:
|
|
67
|
-
@stdlib/assert/is-float64array/lib/index.js:
|
|
68
|
-
@stdlib/assert/has-float64array-support/lib/float64array.js:
|
|
69
|
-
@stdlib/assert/has-float64array-support/lib/main.js:
|
|
70
|
-
@stdlib/assert/has-float64array-support/lib/index.js:
|
|
71
|
-
@stdlib/array/float64/lib/main.js:
|
|
72
|
-
@stdlib/array/float64/lib/polyfill.js:
|
|
73
|
-
@stdlib/array/float64/lib/index.js:
|
|
74
|
-
@stdlib/assert/is-float32array/lib/main.js:
|
|
75
|
-
@stdlib/assert/is-float32array/lib/index.js:
|
|
76
|
-
@stdlib/constants/float64/pinf/lib/index.js:
|
|
77
|
-
@stdlib/assert/has-float32array-support/lib/float32array.js:
|
|
78
|
-
@stdlib/assert/has-float32array-support/lib/main.js:
|
|
79
|
-
@stdlib/assert/has-float32array-support/lib/index.js:
|
|
80
|
-
@stdlib/array/float32/lib/main.js:
|
|
81
|
-
@stdlib/array/float32/lib/polyfill.js:
|
|
82
|
-
@stdlib/array/float32/lib/index.js:
|
|
83
|
-
@stdlib/assert/is-uint32array/lib/main.js:
|
|
84
|
-
@stdlib/assert/is-uint32array/lib/index.js:
|
|
85
|
-
@stdlib/constants/uint32/max/lib/index.js:
|
|
86
|
-
@stdlib/assert/has-uint32array-support/lib/uint32array.js:
|
|
87
|
-
@stdlib/assert/has-uint32array-support/lib/main.js:
|
|
88
|
-
@stdlib/assert/has-uint32array-support/lib/index.js:
|
|
89
|
-
@stdlib/array/uint32/lib/main.js:
|
|
90
|
-
@stdlib/array/uint32/lib/polyfill.js:
|
|
91
|
-
@stdlib/array/uint32/lib/index.js:
|
|
92
|
-
@stdlib/assert/is-int32array/lib/main.js:
|
|
93
|
-
@stdlib/assert/is-int32array/lib/index.js:
|
|
94
|
-
@stdlib/constants/int32/max/lib/index.js:
|
|
95
|
-
@stdlib/constants/int32/min/lib/index.js:
|
|
96
|
-
@stdlib/assert/has-int32array-support/lib/int32array.js:
|
|
97
|
-
@stdlib/assert/has-int32array-support/lib/main.js:
|
|
98
|
-
@stdlib/assert/has-int32array-support/lib/index.js:
|
|
99
|
-
@stdlib/array/int32/lib/main.js:
|
|
100
|
-
@stdlib/array/int32/lib/polyfill.js:
|
|
101
|
-
@stdlib/array/int32/lib/index.js:
|
|
102
|
-
@stdlib/assert/is-uint16array/lib/main.js:
|
|
103
|
-
@stdlib/assert/is-uint16array/lib/index.js:
|
|
104
|
-
@stdlib/constants/uint16/max/lib/index.js:
|
|
105
|
-
@stdlib/assert/has-uint16array-support/lib/uint16array.js:
|
|
106
|
-
@stdlib/assert/has-uint16array-support/lib/main.js:
|
|
107
|
-
@stdlib/assert/has-uint16array-support/lib/index.js:
|
|
108
|
-
@stdlib/array/uint16/lib/main.js:
|
|
109
|
-
@stdlib/array/uint16/lib/polyfill.js:
|
|
110
|
-
@stdlib/array/uint16/lib/index.js:
|
|
111
|
-
@stdlib/assert/is-int16array/lib/main.js:
|
|
112
|
-
@stdlib/assert/is-int16array/lib/index.js:
|
|
113
|
-
@stdlib/constants/int16/max/lib/index.js:
|
|
114
|
-
@stdlib/constants/int16/min/lib/index.js:
|
|
115
|
-
@stdlib/assert/has-int16array-support/lib/int16array.js:
|
|
116
|
-
@stdlib/assert/has-int16array-support/lib/main.js:
|
|
117
|
-
@stdlib/assert/has-int16array-support/lib/index.js:
|
|
118
|
-
@stdlib/array/int16/lib/main.js:
|
|
119
|
-
@stdlib/array/int16/lib/polyfill.js:
|
|
120
|
-
@stdlib/array/int16/lib/index.js:
|
|
121
|
-
@stdlib/assert/is-uint8array/lib/main.js:
|
|
122
|
-
@stdlib/assert/is-uint8array/lib/index.js:
|
|
123
|
-
@stdlib/constants/uint8/max/lib/index.js:
|
|
124
|
-
@stdlib/assert/has-uint8array-support/lib/uint8array.js:
|
|
125
|
-
@stdlib/assert/has-uint8array-support/lib/main.js:
|
|
126
|
-
@stdlib/assert/has-uint8array-support/lib/index.js:
|
|
127
|
-
@stdlib/array/uint8/lib/main.js:
|
|
128
|
-
@stdlib/array/uint8/lib/polyfill.js:
|
|
129
|
-
@stdlib/array/uint8/lib/index.js:
|
|
130
|
-
@stdlib/assert/is-uint8clampedarray/lib/main.js:
|
|
131
|
-
@stdlib/assert/is-uint8clampedarray/lib/index.js:
|
|
132
|
-
@stdlib/assert/has-uint8clampedarray-support/lib/uint8clampedarray.js:
|
|
133
|
-
@stdlib/assert/has-uint8clampedarray-support/lib/main.js:
|
|
134
|
-
@stdlib/assert/has-uint8clampedarray-support/lib/index.js:
|
|
135
|
-
@stdlib/array/uint8c/lib/main.js:
|
|
136
|
-
@stdlib/array/uint8c/lib/polyfill.js:
|
|
137
|
-
@stdlib/array/uint8c/lib/index.js:
|
|
138
|
-
@stdlib/assert/is-int8array/lib/main.js:
|
|
139
|
-
@stdlib/assert/is-int8array/lib/index.js:
|
|
140
|
-
@stdlib/constants/int8/max/lib/index.js:
|
|
141
|
-
@stdlib/constants/int8/min/lib/index.js:
|
|
142
|
-
@stdlib/assert/has-int8array-support/lib/int8array.js:
|
|
143
|
-
@stdlib/assert/has-int8array-support/lib/main.js:
|
|
144
|
-
@stdlib/assert/has-int8array-support/lib/index.js:
|
|
145
|
-
@stdlib/array/int8/lib/main.js:
|
|
146
|
-
@stdlib/array/int8/lib/polyfill.js:
|
|
147
|
-
@stdlib/array/int8/lib/index.js:
|
|
148
|
-
@stdlib/assert/is-number/lib/primitive.js:
|
|
149
|
-
@stdlib/number/ctor/lib/main.js:
|
|
150
|
-
@stdlib/number/ctor/lib/index.js:
|
|
151
|
-
@stdlib/assert/is-number/lib/tostring.js:
|
|
152
|
-
@stdlib/assert/is-number/lib/try2serialize.js:
|
|
153
|
-
@stdlib/assert/is-number/lib/object.js:
|
|
154
|
-
@stdlib/assert/is-number/lib/main.js:
|
|
155
|
-
@stdlib/assert/is-number/lib/index.js:
|
|
156
|
-
@stdlib/constants/float64/ninf/lib/index.js:
|
|
157
|
-
@stdlib/math/base/special/floor/lib/main.js:
|
|
158
|
-
@stdlib/math/base/special/floor/lib/index.js:
|
|
159
|
-
@stdlib/math/base/assert/is-integer/lib/main.js:
|
|
160
|
-
@stdlib/math/base/assert/is-integer/lib/index.js:
|
|
161
|
-
@stdlib/assert/is-integer/lib/integer.js:
|
|
162
|
-
@stdlib/assert/is-integer/lib/primitive.js:
|
|
163
|
-
@stdlib/assert/is-integer/lib/object.js:
|
|
164
|
-
@stdlib/assert/is-integer/lib/main.js:
|
|
165
|
-
@stdlib/assert/is-integer/lib/index.js:
|
|
166
|
-
@stdlib/assert/is-nonnegative-integer/lib/primitive.js:
|
|
167
|
-
@stdlib/assert/is-nonnegative-integer/lib/object.js:
|
|
168
|
-
@stdlib/assert/is-nonnegative-integer/lib/main.js:
|
|
169
|
-
@stdlib/assert/is-nonnegative-integer/lib/index.js:
|
|
170
|
-
@stdlib/constants/array/max-array-length/lib/index.js:
|
|
171
|
-
@stdlib/assert/is-array-like-object/lib/main.js:
|
|
172
|
-
@stdlib/assert/is-array-like-object/lib/index.js:
|
|
173
|
-
@stdlib/constants/array/max-typed-array-length/lib/index.js:
|
|
174
|
-
@stdlib/assert/is-collection/lib/main.js:
|
|
175
|
-
@stdlib/assert/is-collection/lib/index.js:
|
|
176
|
-
@stdlib/assert/is-arraybuffer/lib/main.js:
|
|
177
|
-
@stdlib/assert/is-arraybuffer/lib/index.js:
|
|
178
|
-
@stdlib/assert/is-object/lib/main.js:
|
|
179
|
-
@stdlib/assert/is-object/lib/index.js:
|
|
180
|
-
@stdlib/assert/is-string/lib/primitive.js:
|
|
181
|
-
@stdlib/assert/is-string/lib/valueof.js:
|
|
182
|
-
@stdlib/assert/is-string/lib/try2valueof.js:
|
|
183
|
-
@stdlib/assert/is-string/lib/object.js:
|
|
184
|
-
@stdlib/assert/is-string/lib/main.js:
|
|
185
|
-
@stdlib/assert/is-string/lib/index.js:
|
|
186
|
-
@stdlib/assert/is-string-array/lib/index.js:
|
|
187
|
-
@stdlib/utils/type-of/lib/fixtures/re.js:
|
|
188
|
-
@stdlib/assert/is-boolean/lib/primitive.js:
|
|
189
|
-
@stdlib/assert/is-boolean/lib/tostring.js:
|
|
190
|
-
@stdlib/assert/is-boolean/lib/try2serialize.js:
|
|
191
|
-
@stdlib/assert/is-boolean/lib/object.js:
|
|
192
|
-
@stdlib/assert/is-boolean/lib/main.js:
|
|
193
|
-
@stdlib/assert/is-boolean/lib/index.js:
|
|
194
|
-
@stdlib/utils/global/lib/codegen.js:
|
|
195
|
-
@stdlib/utils/global/lib/self.js:
|
|
196
|
-
@stdlib/utils/global/lib/window.js:
|
|
197
|
-
@stdlib/utils/type-of/lib/fixtures/nodelist.js:
|
|
198
|
-
@stdlib/utils/type-of/lib/fixtures/typedarray.js:
|
|
199
|
-
@stdlib/utils/type-of/lib/check.js:
|
|
200
|
-
@stdlib/utils/type-of/lib/main.js:
|
|
201
|
-
@stdlib/utils/type-of/lib/polyfill.js:
|
|
202
|
-
@stdlib/utils/type-of/lib/index.js:
|
|
203
|
-
@stdlib/assert/is-function/lib/main.js:
|
|
204
|
-
@stdlib/assert/is-function/lib/index.js:
|
|
205
|
-
@stdlib/complex/float64/ctor/lib/tostring.js:
|
|
206
|
-
@stdlib/complex/float64/ctor/lib/tojson.js:
|
|
207
|
-
@stdlib/complex/float64/ctor/lib/main.js:
|
|
208
|
-
@stdlib/complex/float64/ctor/lib/index.js:
|
|
209
|
-
@stdlib/number/float64/base/to-float32/lib/main.js:
|
|
210
|
-
@stdlib/number/float64/base/to-float32/lib/polyfill.js:
|
|
211
|
-
@stdlib/number/float64/base/to-float32/lib/index.js:
|
|
212
|
-
@stdlib/complex/float32/ctor/lib/tostring.js:
|
|
213
|
-
@stdlib/complex/float32/ctor/lib/tojson.js:
|
|
214
|
-
@stdlib/complex/float32/ctor/lib/main.js:
|
|
215
|
-
@stdlib/complex/float32/ctor/lib/index.js:
|
|
216
|
-
@stdlib/assert/is-complex-like/lib/main.js:
|
|
217
|
-
@stdlib/assert/is-complex-like/lib/index.js:
|
|
218
|
-
@stdlib/math/base/assert/is-even/lib/main.js:
|
|
219
|
-
@stdlib/math/base/assert/is-even/lib/index.js:
|
|
220
|
-
@stdlib/assert/has-iterator-symbol-support/lib/main.js:
|
|
221
|
-
@stdlib/assert/has-iterator-symbol-support/lib/index.js:
|
|
222
|
-
@stdlib/symbol/iterator/lib/main.js:
|
|
223
|
-
@stdlib/symbol/iterator/lib/index.js:
|
|
224
|
-
@stdlib/utils/define-nonenumerable-read-only-accessor/lib/main.js:
|
|
225
|
-
@stdlib/utils/define-nonenumerable-read-only-accessor/lib/index.js:
|
|
226
|
-
@stdlib/array/complex64/lib/from_iterator.js:
|
|
227
|
-
@stdlib/array/complex64/lib/from_iterator_map.js:
|
|
228
|
-
@stdlib/array/complex64/lib/from_array.js:
|
|
229
|
-
@stdlib/array/complex64/lib/main.js:
|
|
230
|
-
@stdlib/array/complex64/lib/index.js:
|
|
231
|
-
@stdlib/complex/float64/real/lib/main.js:
|
|
232
|
-
@stdlib/complex/float64/real/lib/index.js:
|
|
233
|
-
@stdlib/complex/float64/imag/lib/main.js:
|
|
234
|
-
@stdlib/complex/float64/imag/lib/index.js:
|
|
235
|
-
@stdlib/array/complex128/lib/from_iterator.js:
|
|
236
|
-
@stdlib/array/complex128/lib/from_iterator_map.js:
|
|
237
|
-
@stdlib/array/complex128/lib/from_array.js:
|
|
238
|
-
@stdlib/array/complex128/lib/index.js:
|
|
239
|
-
@stdlib/array/dtype/lib/main.js:
|
|
240
|
-
@stdlib/array/dtype/lib/index.js:
|
|
241
|
-
@stdlib/math/base/special/abs/lib/index.js:
|
|
242
|
-
@stdlib/ndarray/base/assert/is-row-major/lib/main.js:
|
|
243
|
-
@stdlib/ndarray/base/assert/is-row-major/lib/index.js:
|
|
244
|
-
@stdlib/ndarray/base/bytes-per-element/lib/main.js:
|
|
245
|
-
@stdlib/ndarray/base/bytes-per-element/lib/index.js:
|
|
246
|
-
(**
|
|
247
|
-
* @license Apache-2.0
|
|
248
|
-
*
|
|
249
|
-
* Copyright (c) 2018 The Stdlib Authors.
|
|
250
|
-
*
|
|
251
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
252
|
-
* you may not use this file except in compliance with the License.
|
|
253
|
-
* You may obtain a copy of the License at
|
|
254
|
-
*
|
|
255
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
256
|
-
*
|
|
257
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
258
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
259
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
260
|
-
* See the License for the specific language governing permissions and
|
|
261
|
-
* limitations under the License.
|
|
262
|
-
*)
|
|
263
|
-
|
|
264
|
-
@stdlib/string/base/format-interpolate/lib/is_number.js:
|
|
265
|
-
@stdlib/string/base/format-interpolate/lib/zero_pad.js:
|
|
266
|
-
@stdlib/string/base/format-interpolate/lib/format_integer.js:
|
|
267
|
-
@stdlib/string/base/format-interpolate/lib/is_string.js:
|
|
268
|
-
@stdlib/string/base/format-interpolate/lib/format_double.js:
|
|
269
|
-
@stdlib/string/base/format-interpolate/lib/space_pad.js:
|
|
270
|
-
@stdlib/string/base/format-interpolate/lib/main.js:
|
|
271
|
-
@stdlib/string/base/format-interpolate/lib/index.js:
|
|
272
|
-
@stdlib/string/base/format-tokenize/lib/main.js:
|
|
273
|
-
@stdlib/string/base/format-tokenize/lib/index.js:
|
|
274
|
-
@stdlib/string/format/lib/is_string.js:
|
|
275
|
-
@stdlib/string/format/lib/main.js:
|
|
276
|
-
@stdlib/string/format/lib/index.js:
|
|
277
|
-
@stdlib/array/base/assert/is-accessor-array/lib/main.js:
|
|
278
|
-
@stdlib/array/base/assert/is-accessor-array/lib/index.js:
|
|
279
|
-
@stdlib/array/base/accessor-getter/lib/main.js:
|
|
280
|
-
@stdlib/array/base/accessor-getter/lib/index.js:
|
|
281
|
-
@stdlib/array/base/getter/lib/main.js:
|
|
282
|
-
@stdlib/array/base/getter/lib/index.js:
|
|
283
|
-
@stdlib/boolean/ctor/lib/main.js:
|
|
284
|
-
@stdlib/boolean/ctor/lib/index.js:
|
|
285
|
-
@stdlib/utils/global/lib/global_this.js:
|
|
286
|
-
@stdlib/utils/global/lib/browser.js:
|
|
287
|
-
@stdlib/ndarray/base/unary-tiling-block-size/lib/defaults.js:
|
|
288
|
-
@stdlib/ndarray/base/unary-tiling-block-size/lib/main.js:
|
|
289
|
-
@stdlib/ndarray/base/unary-tiling-block-size/lib/index.js:
|
|
290
|
-
(**
|
|
291
|
-
* @license Apache-2.0
|
|
292
|
-
*
|
|
293
|
-
* Copyright (c) 2022 The Stdlib Authors.
|
|
294
|
-
*
|
|
295
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
296
|
-
* you may not use this file except in compliance with the License.
|
|
297
|
-
* You may obtain a copy of the License at
|
|
298
|
-
*
|
|
299
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
300
|
-
*
|
|
301
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
302
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
303
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
304
|
-
* See the License for the specific language governing permissions and
|
|
305
|
-
* limitations under the License.
|
|
306
|
-
*)
|
|
307
|
-
|
|
308
|
-
@stdlib/array/dtype/lib/ctor2dtype.js:
|
|
309
|
-
@stdlib/array/base/assert/is-complex64array/lib/main.js:
|
|
310
|
-
@stdlib/array/base/assert/is-complex64array/lib/index.js:
|
|
311
|
-
@stdlib/array/base/assert/is-complex128array/lib/main.js:
|
|
312
|
-
@stdlib/array/base/assert/is-complex128array/lib/index.js:
|
|
313
|
-
@stdlib/array/complex128/lib/main.js:
|
|
314
|
-
@stdlib/array/bool/lib/from_iterator.js:
|
|
315
|
-
@stdlib/array/bool/lib/from_iterator_map.js:
|
|
316
|
-
@stdlib/array/bool/lib/from_array.js:
|
|
317
|
-
@stdlib/array/bool/lib/main.js:
|
|
318
|
-
@stdlib/array/bool/lib/index.js:
|
|
319
|
-
@stdlib/array/dtype/lib/ctors.js:
|
|
320
|
-
@stdlib/array/dtype/lib/dtypes.js:
|
|
321
|
-
@stdlib/blas/base/layouts/lib/main.js:
|
|
322
|
-
@stdlib/blas/base/layouts/lib/enum.js:
|
|
323
|
-
@stdlib/blas/base/layouts/lib/index.js:
|
|
324
|
-
@stdlib/blas/base/assert/is-layout/lib/main.js:
|
|
325
|
-
@stdlib/blas/base/assert/is-layout/lib/index.js:
|
|
326
|
-
@stdlib/blas/base/transpose-operations/lib/main.js:
|
|
327
|
-
@stdlib/blas/base/transpose-operations/lib/enum.js:
|
|
328
|
-
@stdlib/blas/base/transpose-operations/lib/index.js:
|
|
329
|
-
@stdlib/blas/base/assert/is-transpose-operation/lib/main.js:
|
|
330
|
-
@stdlib/blas/base/assert/is-transpose-operation/lib/index.js:
|
|
331
|
-
@stdlib/strided/base/stride2offset/lib/main.js:
|
|
332
|
-
@stdlib/strided/base/stride2offset/lib/index.js:
|
|
333
|
-
@stdlib/blas/base/dgemm/lib/base.js:
|
|
334
|
-
@stdlib/blas/base/dgemm/lib/dgemm.js:
|
|
335
|
-
@stdlib/blas/base/dgemm/lib/ndarray.js:
|
|
336
|
-
@stdlib/blas/base/dgemm/lib/main.js:
|
|
337
|
-
(**
|
|
338
|
-
* @license Apache-2.0
|
|
339
|
-
*
|
|
340
|
-
* Copyright (c) 2024 The Stdlib Authors.
|
|
341
|
-
*
|
|
342
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
343
|
-
* you may not use this file except in compliance with the License.
|
|
344
|
-
* You may obtain a copy of the License at
|
|
345
|
-
*
|
|
346
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
347
|
-
*
|
|
348
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
349
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
350
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
351
|
-
* See the License for the specific language governing permissions and
|
|
352
|
-
* limitations under the License.
|
|
353
|
-
*)
|
|
354
|
-
|
|
355
|
-
@stdlib/array/base/assert/contains/lib/main.js:
|
|
356
|
-
@stdlib/array/base/assert/contains/lib/factory.js:
|
|
357
|
-
@stdlib/array/base/assert/contains/lib/index.js:
|
|
358
|
-
(**
|
|
359
|
-
* @license Apache-2.0
|
|
360
|
-
*
|
|
361
|
-
* Copyright (c) 2023 The Stdlib Authors.
|
|
362
|
-
*
|
|
363
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
364
|
-
* you may not use this file except in compliance with the License.
|
|
365
|
-
* You may obtain a copy of the License at
|
|
366
|
-
*
|
|
367
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
368
|
-
*
|
|
369
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
370
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
371
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
372
|
-
* See the License for the specific language governing permissions and
|
|
373
|
-
* limitations under the License.
|
|
374
|
-
*)
|
|
375
|
-
|
|
376
|
-
@stdlib/blas/base/ddot/lib/ndarray.js:
|
|
377
|
-
@stdlib/blas/base/ddot/lib/ddot.js:
|
|
378
|
-
@stdlib/blas/base/ddot/lib/main.js:
|
|
379
|
-
(**
|
|
380
|
-
* @license Apache-2.0
|
|
381
|
-
*
|
|
382
|
-
* Copyright (c) 2019 The Stdlib Authors.
|
|
383
|
-
*
|
|
384
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
385
|
-
* you may not use this file except in compliance with the License.
|
|
386
|
-
* You may obtain a copy of the License at
|
|
387
|
-
*
|
|
388
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
389
|
-
*
|
|
390
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
391
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
392
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
393
|
-
* See the License for the specific language governing permissions and
|
|
394
|
-
* limitations under the License.
|
|
395
|
-
*)
|
|
396
|
-
*/
|
|
1
|
+
"use strict";var np=(()=>{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});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";return Dt(Yt);})();
|
|
397
2
|
//# sourceMappingURL=numpy-ts.browser.js.map
|