// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 !function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).zeros=r()}(this,(function(){"use strict";var t="function"==typeof Object.defineProperty?Object.defineProperty:null;var r=Object.defineProperty;function e(t){return"number"==typeof t}function n(t){var r,e="";for(r=0;r0&&(r-=1),n=i.toExponential(r)):n=i.toPrecision(t.precision),t.alternate||(n=h.call(n,d,"$1e"),n=h.call(n,w,"e"),n=h.call(n,y,""));break;default:throw new Error("invalid double notation. Value: "+t.specifier)}return n=h.call(n,c,"e+0$1"),n=h.call(n,p,"e-0$1"),t.alternate&&(n=h.call(n,g,"$1."),n=h.call(n,m,"$1.e")),i>=0&&t.sign&&(n=t.sign+n),n=t.specifier===l.call(t.specifier)?l.call(n):s.call(n)}function b(t){var r,e="";for(r=0;r127)throw new Error("invalid character code. Value: "+n.arg);n.arg=T(a)?String(n.arg):_(a)}break;case"e":case"E":case"f":case"F":case"g":case"G":r||(n.precision=6),n.arg=v(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=i(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=(c=n.arg,p=n.width,g=n.padRight,m=void 0,(m=p-c.length)<0?c:c=g?c+b(m):b(m)+c)),f+=n.arg||"",s+=1}return f}var V=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function R(t){var r={mapping:t[1]?parseInt(t[1],10):void 0,flags:t[2],width:t[3],precision:t[5],specifier:t[6]};return"."===t[4]&&void 0===t[5]&&(r.precision="1"),r}function O(t){var r,e,n,i;for(e=[],i=0,n=V.exec(t);n;)(r=t.slice(i,V.lastIndex-n[0].length)).length&&e.push(r),e.push(R(n)),i=V.lastIndex,n=V.exec(t);return(r=t.slice(i)).length&&e.push(r),e}function S(t){var r,e;if("string"!=typeof t)throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",t));for(r=[O(t)],e=1;e=0&&t.length<=It}function Bt(t,r){return"column-major"===r?function(t){var r,e,n;for(r=[],e=1,n=0;n=0;i--)e[i]=n,n*=t[i];return e}(t)}function Ft(t){if(t.__esModule)return t;var r=t.default;if("function"==typeof r){var e=function t(){return this instanceof t?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};e.prototype=r.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach((function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})})),e}M(Bt,"assign",(function(t,r,e){return"column-major"===r?function(t,r){var e,n;for(e=1,n=0;n=0;n--)r[n]=e,e*=t[n];return r}(t,e)}));var kt="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Ut=[],Pt=[],Mt="undefined"!=typeof Uint8Array?Uint8Array:Array,Ct=!1;function Nt(){Ct=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)Ut[r]=t[r],Pt[t.charCodeAt(r)]=r;Pt["-".charCodeAt(0)]=62,Pt["_".charCodeAt(0)]=63}function Yt(t,r,e){for(var n,i,o=[],a=r;a>18&63]+Ut[i>>12&63]+Ut[i>>6&63]+Ut[63&i]);return o.join("")}function Dt(t){var r;Ct||Nt();for(var e=t.length,n=e%3,i="",o=[],a=16383,u=0,f=e-n;uf?f:u+a));return 1===n?(r=t[e-1],i+=Ut[r>>2],i+=Ut[r<<4&63],i+="=="):2===n&&(r=(t[e-2]<<8)+t[e-1],i+=Ut[r>>10],i+=Ut[r>>4&63],i+=Ut[r<<2&63],i+="="),o.push(i),o.join("")}function zt(t,r,e,n,i){var o,a,u=8*i-n-1,f=(1<>1,l=-7,h=e?i-1:0,c=e?-1:1,p=t[r+h];for(h+=c,o=p&(1<<-l)-1,p>>=-l,l+=u;l>0;o=256*o+t[r+h],h+=c,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[r+h],h+=c,l-=8);if(0===o)o=1-s;else{if(o===f)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=s}return(p?-1:1)*a*Math.pow(2,o-n)}function Wt(t,r,e,n,i,o){var a,u,f,s=8*o-i-1,l=(1<>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,m=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=l):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),(r+=a+h>=1?c/f:c*Math.pow(2,1-h))*f>=2&&(a++,f/=2),a+h>=l?(u=0,a=l):a+h>=1?(u=(r*f-1)*Math.pow(2,i),a+=h):(u=r*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[e+p]=255&u,p+=g,u/=256,i-=8);for(a=a<0;t[e+p]=255&a,p+=g,a/=256,s-=8);t[e+p-g]|=128*m}var Jt={}.toString,Gt=Array.isArray||function(t){return"[object Array]"==Jt.call(t)};qt.TYPED_ARRAY_SUPPORT=void 0===kt.TYPED_ARRAY_SUPPORT||kt.TYPED_ARRAY_SUPPORT;var $t=Xt();function Xt(){return qt.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Zt(t,r){if(Xt()=Xt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Xt().toString(16)+" bytes");return 0|t}function er(t){return!(null==t||!t._isBuffer)}function nr(t,r){if(er(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return jr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return Ir(t).length;default:if(n)return jr(t).length;r=(""+r).toLowerCase(),n=!0}}function ir(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return vr(this,r,e);case"utf8":case"utf-8":return mr(this,r,e);case"ascii":return wr(this,r,e);case"latin1":case"binary":return dr(this,r,e);case"base64":return gr(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return br(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function or(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function ar(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=qt.from(r,n)),er(r))return 0===r.length?-1:ur(t,r,e,n,i);if("number"==typeof r)return r&=255,qt.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):ur(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function ur(t,r,e,n,i){var o,a=1,u=t.length,f=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;a=2,u/=2,f/=2,e/=2}function s(t,r){return 1===a?t[r]:t.readUInt16BE(r*a)}if(i){var l=-1;for(o=e;ou&&(e=u-f),o=e;o>=0;o--){for(var h=!0,c=0;ci&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=e%256,o.push(i),o.push(n);return o}(r,t.length-e),t,e,n)}function gr(t,r,e){return 0===r&&e===t.length?Dt(t):Dt(t.slice(r,e))}function mr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i239?4:s>223?3:s>191?2:1;if(i+h<=e)switch(h){case 1:s<128&&(l=s);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&s)<<6|63&o)>127&&(l=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&s)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(l=f);break;case 4:o=t[i+1],a=t[i+2],u=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(f=(15&s)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&f<1114112&&(l=f)}null===l?(l=65533,h=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=h}return function(t){var r=t.length;if(r<=yr)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),""},qt.prototype.compare=function(t,r,e,n,i){if(!er(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(e>>>=0)-(r>>>=0),u=Math.min(o,a),f=this.slice(n,i),s=t.slice(r,e),l=0;li)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return fr(this,t,r,e);case"utf8":case"utf-8":return sr(this,t,r,e);case"ascii":return lr(this,t,r,e);case"latin1":case"binary":return hr(this,t,r,e);case"base64":return cr(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pr(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},qt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var yr=4096;function wr(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;in)&&(e=n);for(var i="",o=r;oe)throw new RangeError("Trying to access beyond buffer length")}function Er(t,r,e,n,i,o){if(!er(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||rt.length)throw new RangeError("Index out of range")}function Tr(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i>>8*(n?i:1-i)}function xr(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i>>8*(n?i:3-i)&255}function Ar(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Vr(t,r,e,n,i){return i||Ar(t,0,e,4),Wt(t,r,e,n,23,4),e+4}function Rr(t,r,e,n,i){return i||Ar(t,0,e,8),Wt(t,r,e,n,52,8),e+8}qt.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r0&&(i*=256);)n+=this[t+--r]*i;return n},qt.prototype.readUInt8=function(t,r){return r||_r(t,1,this.length),this[t]},qt.prototype.readUInt16LE=function(t,r){return r||_r(t,2,this.length),this[t]|this[t+1]<<8},qt.prototype.readUInt16BE=function(t,r){return r||_r(t,2,this.length),this[t]<<8|this[t+1]},qt.prototype.readUInt32LE=function(t,r){return r||_r(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},qt.prototype.readUInt32BE=function(t,r){return r||_r(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},qt.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||_r(t,r,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*r)),n},qt.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||_r(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},qt.prototype.readInt8=function(t,r){return r||_r(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},qt.prototype.readInt16LE=function(t,r){r||_r(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},qt.prototype.readInt16BE=function(t,r){r||_r(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},qt.prototype.readInt32LE=function(t,r){return r||_r(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},qt.prototype.readInt32BE=function(t,r){return r||_r(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},qt.prototype.readFloatLE=function(t,r){return r||_r(t,4,this.length),zt(this,t,!0,23,4)},qt.prototype.readFloatBE=function(t,r){return r||_r(t,4,this.length),zt(this,t,!1,23,4)},qt.prototype.readDoubleLE=function(t,r){return r||_r(t,8,this.length),zt(this,t,!0,52,8)},qt.prototype.readDoubleBE=function(t,r){return r||_r(t,8,this.length),zt(this,t,!1,52,8)},qt.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||Er(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o=0&&(o*=256);)this[r+i]=t/o&255;return r+e},qt.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||Er(this,t,r,1,255,0),qt.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},qt.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||Er(this,t,r,2,65535,0),qt.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):Tr(this,t,r,!0),r+2},qt.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||Er(this,t,r,2,65535,0),qt.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):Tr(this,t,r,!1),r+2},qt.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||Er(this,t,r,4,4294967295,0),qt.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):xr(this,t,r,!0),r+4},qt.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||Er(this,t,r,4,4294967295,0),qt.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):xr(this,t,r,!1),r+4},qt.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);Er(this,t,r,e,i-1,-i)}var o=0,a=1,u=0;for(this[r]=255&t;++o>0)-u&255;return r+e},qt.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);Er(this,t,r,e,i-1,-i)}var o=e-1,a=1,u=0;for(this[r+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[r+o+1]&&(u=1),this[r+o]=(t/a>>0)-u&255;return r+e},qt.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||Er(this,t,r,1,127,-128),qt.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},qt.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||Er(this,t,r,2,32767,-32768),qt.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):Tr(this,t,r,!0),r+2},qt.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||Er(this,t,r,2,32767,-32768),qt.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):Tr(this,t,r,!1),r+2},qt.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||Er(this,t,r,4,2147483647,-2147483648),qt.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):xr(this,t,r,!0),r+4},qt.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||Er(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),qt.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):xr(this,t,r,!1),r+4},qt.prototype.writeFloatLE=function(t,r,e){return Vr(this,t,r,!0,e)},qt.prototype.writeFloatBE=function(t,r,e){return Vr(this,t,r,!1,e)},qt.prototype.writeDoubleLE=function(t,r,e){return Rr(this,t,r,!0,e)},qt.prototype.writeDoubleBE=function(t,r,e){return Rr(this,t,r,!1,e)},qt.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r=0;--i)t[i+r]=this[i+e];else if(o<1e3||!qt.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function Ir(t){return function(t){var r,e,n,i,o,a;Ct||Nt();var u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[u-2]?2:"="===t[u-1]?1:0,a=new Mt(3*u/4-o),n=o>0?u-4:u;var f=0;for(r=0,e=0;r>16&255,a[f++]=i>>8&255,a[f++]=255&i;return 2===o?(i=Pt[t.charCodeAt(r)]<<2|Pt[t.charCodeAt(r+1)]>>4,a[f++]=255&i):1===o&&(i=Pt[t.charCodeAt(r)]<<10|Pt[t.charCodeAt(r+1)]<<4|Pt[t.charCodeAt(r+2)]>>2,a[f++]=i>>8&255,a[f++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Or,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Lr(t,r,e,n){for(var i=0;i=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function Br(t){return null!=t&&(!!t._isBuffer||Fr(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Fr(t.slice(0,0))}(t))}function Fr(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}Ft(Object.freeze({__proto__:null,Buffer:qt,INSPECT_MAX_BYTES:50,SlowBuffer:function(t){return+t!=t&&(t=0),qt.alloc(+t)},isBuffer:Br,kMaxLength:$t})).Buffer;var kr=function(){throw new Error("not implemented")},Ur="function"==typeof Float64Array;var Pr="function"==typeof Float64Array?Float64Array:null;var Mr,Cr="function"==typeof Float64Array?Float64Array:void 0;Mr=function(){var t,r,e;if("function"!=typeof Pr)return!1;try{r=new Pr([1,3.14,-3.14,NaN]),e=r,t=(Ur&&e instanceof Float64Array||"[object Float64Array]"===$(e))&&1===r[0]&&3.14===r[1]&&-3.14===r[2]&&r[3]!=r[3]}catch(r){t=!1}return t}()?Cr:function(){throw new Error("not implemented")};var Nr=Mr,Yr="function"==typeof Float32Array;var Dr=Number.POSITIVE_INFINITY,zr="function"==typeof Float32Array?Float32Array:null;var Wr,Jr="function"==typeof Float32Array?Float32Array:void 0;Wr=function(){var t,r,e;if("function"!=typeof zr)return!1;try{r=new zr([1,3.14,-3.14,5e40]),e=r,t=(Yr&&e instanceof Float32Array||"[object Float32Array]"===$(e))&&1===r[0]&&3.140000104904175===r[1]&&-3.140000104904175===r[2]&&r[3]===Dr}catch(r){t=!1}return t}()?Jr:function(){throw new Error("not implemented")};var Gr=Wr,$r="function"==typeof Int16Array;var Xr="function"==typeof Int16Array?Int16Array:null;var Zr,qr="function"==typeof Int16Array?Int16Array:void 0;Zr=function(){var t,r,e;if("function"!=typeof Xr)return!1;try{r=new Xr([1,3.14,-3.14,32768]),e=r,t=($r&&e instanceof Int16Array||"[object Int16Array]"===$(e))&&1===r[0]&&3===r[1]&&-3===r[2]&&-32768===r[3]}catch(r){t=!1}return t}()?qr:function(){throw new Error("not implemented")};var Hr=Zr,Kr="function"==typeof Int32Array;var Qr="function"==typeof Int32Array?Int32Array:null;var te,re="function"==typeof Int32Array?Int32Array:void 0;te=function(){var t,r,e;if("function"!=typeof Qr)return!1;try{r=new Qr([1,3.14,-3.14,2147483648]),e=r,t=(Kr&&e instanceof Int32Array||"[object Int32Array]"===$(e))&&1===r[0]&&3===r[1]&&-3===r[2]&&-2147483648===r[3]}catch(r){t=!1}return t}()?re:function(){throw new Error("not implemented")};var ee=te,ne="function"==typeof Int8Array;var ie="function"==typeof Int8Array?Int8Array:null;var oe,ae="function"==typeof Int8Array?Int8Array:void 0;oe=function(){var t,r,e;if("function"!=typeof ie)return!1;try{r=new ie([1,3.14,-3.14,128]),e=r,t=(ne&&e instanceof Int8Array||"[object Int8Array]"===$(e))&&1===r[0]&&3===r[1]&&-3===r[2]&&-128===r[3]}catch(r){t=!1}return t}()?ae:function(){throw new Error("not implemented")};var ue=oe,fe="function"==typeof Uint16Array;var se="function"==typeof Uint16Array?Uint16Array:null;var le,he="function"==typeof Uint16Array?Uint16Array:void 0;le=function(){var t,r,e;if("function"!=typeof se)return!1;try{r=new se(r=[1,3.14,-3.14,65536,65537]),e=r,t=(fe&&e instanceof Uint16Array||"[object Uint16Array]"===$(e))&&1===r[0]&&3===r[1]&&65533===r[2]&&0===r[3]&&1===r[4]}catch(r){t=!1}return t}()?he:function(){throw new Error("not implemented")};var ce=le,pe="function"==typeof Uint32Array;var ge=4294967295,me="function"==typeof Uint32Array?Uint32Array:null;var ye,we="function"==typeof Uint32Array?Uint32Array:void 0;ye=function(){var t,r,e;if("function"!=typeof me)return!1;try{r=new me(r=[1,3.14,-3.14,4294967296,4294967297]),e=r,t=(pe&&e instanceof Uint32Array||"[object Uint32Array]"===$(e))&&1===r[0]&&3===r[1]&&4294967293===r[2]&&0===r[3]&&1===r[4]}catch(r){t=!1}return t}()?we:function(){throw new Error("not implemented")};var de=ye,ve="function"==typeof Uint8Array;var be="function"==typeof Uint8Array?Uint8Array:null;var _e,Ee="function"==typeof Uint8Array?Uint8Array:void 0;_e=function(){var t,r,e;if("function"!=typeof be)return!1;try{r=new be(r=[1,3.14,-3.14,256,257]),e=r,t=(ve&&e instanceof Uint8Array||"[object Uint8Array]"===$(e))&&1===r[0]&&3===r[1]&&253===r[2]&&0===r[3]&&1===r[4]}catch(r){t=!1}return t}()?Ee:function(){throw new Error("not implemented")};var Te=_e,xe="function"==typeof Uint8ClampedArray;var Ae="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null;var Ve,Re="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0;Ve=function(){var t,r,e;if("function"!=typeof Ae)return!1;try{r=new Ae([-1,0,1,3.14,4.99,255,256]),e=r,t=(xe&&e instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===$(e))&&0===r[0]&&0===r[1]&&1===r[2]&&3===r[3]&&5===r[4]&&255===r[5]&&255===r[6]}catch(r){t=!1}return t}()?Re:function(){throw new Error("not implemented")};var Oe=Ve,Se=X.NEGATIVE_INFINITY;function je(t){return tSe&&jt(t)}function Ie(t){return C(t)&&je(t)}function Le(t){return H(t)&&je(t.valueOf())}function Be(t){return Ie(t)||Le(t)}function Fe(t){return Ie(t)&&t>=0}function ke(t){return Le(t)&&t.valueOf()>=0}function Ue(t){return Fe(t)||ke(t)}function Pe(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&jt(t.length)&&t.length>=0&&t.length<=It}M(Be,"isPrimitive",Ie),M(Be,"isObject",Le),M(Ue,"isPrimitive",Fe),M(Ue,"isObject",ke);var Me=9007199254740991;function Ce(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&jt(t.length)&&t.length>=0&&t.length<=Me}var Ne="function"==typeof ArrayBuffer;function Ye(t){return Ne&&t instanceof ArrayBuffer||"[object ArrayBuffer]"===$(t)}function De(t){return"string"==typeof t}var ze=String.prototype.valueOf;var We=Y();function Je(t){return"object"==typeof t&&(t instanceof String||(We?function(t){try{return ze.call(t),!0}catch(t){return!1}}(t):"[object String]"===$(t)))}function Ge(t){return De(t)||Je(t)}function $e(t,r){if(!(this instanceof $e))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!C(t))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",t));if(!C(r))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return P(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:t}),P(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:r}),this}M(Ge,"isPrimitive",De),M(Ge,"isObject",Je),M($e,"BYTES_PER_ELEMENT",8),M($e.prototype,"BYTES_PER_ELEMENT",8),M($e.prototype,"byteLength",16),M($e.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),M($e.prototype,"toJSON",(function(){var t={type:"Complex128"};return t.re=this.re,t.im=this.im,t}));var Xe="function"==typeof Math.fround?Math.fround:null,Ze=new Gr(1);var qe="function"==typeof Xe?Xe:function(t){return Ze[0]=t,Ze[0]};function He(t,r){if(!(this instanceof He))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!C(t))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",t));if(!C(r))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return P(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:qe(t)}),P(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:qe(r)}),this}function Ke(t){return t instanceof $e||t instanceof He||"object"==typeof t&&null!==t&&"number"==typeof t.re&&"number"==typeof t.im}function Qe(t){return jt(t/2)}M(He,"BYTES_PER_ELEMENT",4),M(He.prototype,"BYTES_PER_ELEMENT",4),M(He.prototype,"byteLength",8),M(He.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),M(He.prototype,"toJSON",(function(){var t={type:"Complex64"};return t.re=this.re,t.im=this.im,t}));var tn=8;function rn(t){return"object"==typeof t&&null!==t&&"Complex64Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===tn}var en=16;function nn(t){return"object"==typeof t&&null!==t&&"Complex128Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===en}function on(){return"function"==typeof J&&"symbol"==typeof J("foo")&&W(J,"iterator")&&"symbol"==typeof J.iterator}var an=on()?Symbol.iterator:null;function un(t,r,e){P(t,r,{configurable:!1,enumerable:!1,get:e})}function fn(t,r){if(!(this instanceof fn))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!C(t))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",t));if(!C(r))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return P(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:qe(t)}),P(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:qe(r)}),this}function sn(t){return t.re}function ln(t){return t.im}function hn(t,r){return new Gr(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*r,2*(t.length-r))}function cn(t,r){return new Nr(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*r,2*(t.length-r))}M(fn,"BYTES_PER_ELEMENT",4),M(fn.prototype,"BYTES_PER_ELEMENT",4),M(fn.prototype,"byteLength",8),M(fn.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),M(fn.prototype,"toJSON",(function(){var t={type:"Complex64"};return t.re=this.re,t.im=this.im,t}));var pn={float64:function(t,r){return t[r]},float32:function(t,r){return t[r]},int32:function(t,r){return t[r]},int16:function(t,r){return t[r]},int8:function(t,r){return t[r]},uint32:function(t,r){return t[r]},uint16:function(t,r){return t[r]},uint8:function(t,r){return t[r]},uint8c:function(t,r){return t[r]},generic:function(t,r){return t[r]},default:function(t,r){return t[r]}};function gn(t){var r=pn[t];return"function"==typeof r?r:pn.default}var mn={complex128:function(t,r){return t.get(r)},complex64:function(t,r){return t.get(r)},default:function(t,r){return t.get(r)}};function yn(t){var r=mn[t];return"function"==typeof r?r:mn.default}function wn(t){var r,e,n;for(r=[];!(e=t.next()).done;)if(Pe(n=e.value)&&n.length>=2)r.push(n[0],n[1]);else{if(!Ke(n))return new TypeError(S("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));r.push(sn(n),ln(n))}return r}var dn=2*Gr.BYTES_PER_ELEMENT,vn=on();function bn(t){return t instanceof Tn||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function _n(t){return t===Tn||"Complex128Array"===t.name}function En(t,r){return new fn(t[r*=2],t[r+1])}function Tn(){var t,r,e,n;if(r=arguments.length,!(this instanceof Tn))return 0===r?new Tn:1===r?new Tn(arguments[0]):2===r?new Tn(arguments[0],arguments[1]):new Tn(arguments[0],arguments[1],arguments[2]);if(0===r)e=new Gr(0);else if(1===r)if(Fe(arguments[0]))e=new Gr(2*arguments[0]);else if(Ce(arguments[0]))if((n=(e=arguments[0]).length)&&Q(e)&&Ke(e[0])){if(e=function(t,r){var e,n,i,o;for(e=r.length,o=0,i=0;ie.byteLength-t)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*dn));e=new Gr(e,t,2*n)}}return M(this,"_buffer",e),M(this,"_length",e.length/2),this}function xn(t,r){if(!(this instanceof xn))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!C(t))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",t));if(!C(r))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return P(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:t}),P(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:r}),this}function An(t){return t.re}function Vn(t){return t.im}function Rn(t){var r,e,n;for(r=[];!(e=t.next()).done;)if(Pe(n=e.value)&&n.length>=2)r.push(n[0],n[1]);else{if(!Ke(n))return new TypeError(S("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));r.push(An(n),Vn(n))}return r}M(Tn,"BYTES_PER_ELEMENT",dn),M(Tn,"name","Complex64Array"),M(Tn,"from",(function(t){var r,e,n,i,o,a,u,f,s,l,h,c;if(!Et(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!_n(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!Et(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(r=arguments[2])}if(bn(t)){if(f=t.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(Ce(t)){if(n){for(f=t.length,u=t.get&&t.set?yn("default"):gn("default"),h=0;h=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(tt(t)&&vn&&Et(t[an])){if(!Et((o=t[an]()).next))throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=n?function(t,r,e){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,Pe(o=r.call(e,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Ke(o))return new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(sn(o),ln(o))}return n}(o,n,r):wn(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return En(this._buffer,t)})),un(Tn.prototype,"buffer",(function(){return this._buffer.buffer})),un(Tn.prototype,"byteLength",(function(){return this._buffer.byteLength})),un(Tn.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),M(Tn.prototype,"BYTES_PER_ELEMENT",Tn.BYTES_PER_ELEMENT),M(Tn.prototype,"copyWithin",(function(t,r){if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*r):this._buffer.copyWithin(2*t,2*r,2*arguments[2]),this})),M(Tn.prototype,"entries",(function(){var t,r,e,n,i,o,a;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,t=this._buffer,n=this._length,o=-1,a=-2,M(e={},"next",(function(){var r;if(o+=1,i||o>=n)return{done:!0};return r=new fn(t[a+=2],t[a+1]),{value:[o,r],done:!1}})),M(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),an&&M(e,an,(function(){return r.entries()})),e})),M(Tn.prototype,"every",(function(t,r){var e,n;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!jt(e))throw new TypeError(S("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=i)<0&&(e=0),e>i&&(e=i)}else e=i}else r=0,e=i;for(a=sn(t),u=ln(t),f=r;f=0;n--)if(i=En(e,n),t.call(r,i,n,this))return i})),M(Tn.prototype,"findLastIndex",(function(t,r){var e,n,i;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=En(e,n),t.call(r,i,n,this))return n;return-1})),M(Tn.prototype,"forEach",(function(t,r){var e,n,i;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n=this._length))return En(this._buffer,t)})),M(Tn.prototype,"includes",(function(t,r){var e,n,i,o,a;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ke(t))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=sn(t),o=ln(t),e=this._buffer,a=r;a1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=sn(t),o=ln(t),e=this._buffer,a=r;a1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=sn(t),o=ln(t),e=this._buffer,a=r;a>=0;a--)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),un(Tn.prototype,"length",(function(){return this._length})),M(Tn.prototype,"map",(function(t,r){var e,n,i,o,a;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o1)n=r,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=En(e,0),o=1}for(;o1){if(!Fe(e=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Ke(t)){if(e>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=sn(t),void(n[e+1]=ln(t))}if(bn(t)){if(e+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t._buffer,s=n.byteOffset+e*dn,r.buffer===n.buffer&&r.byteOffsets){for(i=new Gr(r.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t,s=n.byteOffset+e*dn,r.buffer===n.buffer&&r.byteOffsets){for(i=new Gr(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,f=0;fu&&(r=u)}}for(e=ti&&(r=i)}}return t>=i?(i=0,e=n.byteLength):t>=r?(i=0,e=n.byteOffset+t*dn):(i=r-t,e=n.byteOffset+t*dn),new this.constructor(n.buffer,e,i<0?0:i)})),M(Tn.prototype,"toReversed",(function(){var t,r,e,n,i,o;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=new this.constructor(e),n=this._buffer,t=r._buffer,i=0;i=i)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!Ke(r))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(e=(n=new this.constructor(this._buffer))._buffer)[2*t]=sn(r),e[2*t+1]=ln(r),n})),M(xn,"BYTES_PER_ELEMENT",8),M(xn.prototype,"BYTES_PER_ELEMENT",8),M(xn.prototype,"byteLength",16),M(xn.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),M(xn.prototype,"toJSON",(function(){var t={type:"Complex128"};return t.re=this.re,t.im=this.im,t}));var On=2*Nr.BYTES_PER_ELEMENT,Sn=on();function jn(t){return t instanceof Bn||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function In(t){return t===Bn||"Complex64Array"===t.name}function Ln(t,r){return new xn(t[r*=2],t[r+1])}function Bn(){var t,r,e,n;if(r=arguments.length,!(this instanceof Bn))return 0===r?new Bn:1===r?new Bn(arguments[0]):2===r?new Bn(arguments[0],arguments[1]):new Bn(arguments[0],arguments[1],arguments[2]);if(0===r)e=new Nr(0);else if(1===r)if(Fe(arguments[0]))e=new Nr(2*arguments[0]);else if(Ce(arguments[0]))if((n=(e=arguments[0]).length)&&Q(e)&&Ke(e[0])){if(e=function(t,r){var e,n,i,o;for(e=r.length,o=0,i=0;ie.byteLength-t)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*On));e=new Nr(e,t,2*n)}}return M(this,"_buffer",e),M(this,"_length",e.length/2),this}M(Bn,"BYTES_PER_ELEMENT",On),M(Bn,"name","Complex128Array"),M(Bn,"from",(function(t){var r,e,n,i,o,a,u,f,s,l,h,c;if(!Et(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!Et(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(r=arguments[2])}if(jn(t)){if(f=t.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(Ce(t)){if(n){for(f=t.length,u=t.get&&t.set?yn("default"):gn("default"),h=0;h=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(tt(t)&&Sn&&Et(t[an])){if(!Et((o=t[an]()).next))throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=n?function(t,r,e){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,Pe(o=r.call(e,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Ke(o))return new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(An(o),Vn(o))}return n}(o,n,r):Rn(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return Ln(this._buffer,t)})),un(Bn.prototype,"buffer",(function(){return this._buffer.buffer})),un(Bn.prototype,"byteLength",(function(){return this._buffer.byteLength})),un(Bn.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),M(Bn.prototype,"BYTES_PER_ELEMENT",Bn.BYTES_PER_ELEMENT),M(Bn.prototype,"copyWithin",(function(t,r){if(!jn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*r):this._buffer.copyWithin(2*t,2*r,2*arguments[2]),this})),M(Bn.prototype,"entries",(function(){var t,r,e,n,i,o,a;if(!jn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,t=this._buffer,n=this._length,o=-1,a=-2,M(e={},"next",(function(){var r;if(o+=1,i||o>=n)return{done:!0};return r=new xn(t[a+=2],t[a+1]),{value:[o,r],done:!1}})),M(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),an&&M(e,an,(function(){return r.entries()})),e})),M(Bn.prototype,"every",(function(t,r){var e,n;if(!jn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!jt(e))throw new TypeError(S("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=i)<0&&(e=0),e>i&&(e=i)}else e=i}else r=0,e=i;for(a=An(t),u=Vn(t),f=r;f=0;n--)if(i=Ln(e,n),t.call(r,i,n,this))return i})),M(Bn.prototype,"findLastIndex",(function(t,r){var e,n,i;if(!jn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=Ln(e,n),t.call(r,i,n,this))return n;return-1})),M(Bn.prototype,"forEach",(function(t,r){var e,n,i;if(!jn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n=this._length))return Ln(this._buffer,t)})),un(Bn.prototype,"length",(function(){return this._length})),M(Bn.prototype,"includes",(function(t,r){var e,n,i,o,a;if(!jn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ke(t))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=An(t),o=Vn(t),e=this._buffer,a=r;a1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=An(t),o=Vn(t),e=this._buffer,a=r;a1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=An(t),o=Vn(t),e=this._buffer,a=r;a>=0;a--)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),M(Bn.prototype,"map",(function(t,r){var e,n,i,o,a;if(!jn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o1)n=r,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Ln(e,0),o=1}for(;o1){if(!Fe(e=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Ke(t)){if(e>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=An(t),void(n[e+1]=Vn(t))}if(jn(t)){if(e+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t._buffer,s=n.byteOffset+e*On,r.buffer===n.buffer&&r.byteOffsets){for(i=new Nr(r.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t,s=n.byteOffset+e*On,r.buffer===n.buffer&&r.byteOffsets){for(i=new Nr(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,f=0;fu&&(r=u)}}for(e=ti&&(r=i)}}return t>=i?(i=0,e=n.byteLength):t>=r?(i=0,e=n.byteOffset+t*On):(i=r-t,e=n.byteOffset+t*On),new this.constructor(n.buffer,e,i<0?0:i)})),M(Bn.prototype,"toReversed",(function(){var t,r,e,n,i,o;if(!jn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=new this.constructor(e),n=this._buffer,t=r._buffer,i=0;i=i)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!Ke(r))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(e=(n=new this.constructor(this._buffer))._buffer)[2*t]=An(r),e[2*t+1]=Vn(r),n}));var Fn={binary:kr,float64:Nr,float32:Gr,generic:Array,int16:Hr,int32:ee,int8:ue,uint16:ce,uint32:de,uint8:Te,uint8c:Oe,complex64:Tn,complex128:Bn};var kn=Et(kr.allocUnsafe)?function(t){if(!Ue(t))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));return kr.allocUnsafe(t)}:function(t){if(!Ue(t))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));return new kr(t)};function Un(t,r){var e=function(t){return Fn[t]||null}(t);return e?new e(r):null}function Pn(t,r){return"generic"===t?function(t){var r,e;for(r=[],e=0;e=2)r.push(n[0],n[1]);else{if(!Ke(n))return new TypeError(S("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));r.push(sn(n),ln(n))}return r}var ii=2*Gr.BYTES_PER_ELEMENT,oi=on();function ai(t){return t instanceof si||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function ui(t){return t===si||"Complex128Array"===t.name}function fi(t,r){return new fn(t[r*=2],t[r+1])}function si(){var t,r,e,n;if(r=arguments.length,!(this instanceof si))return 0===r?new si:1===r?new si(arguments[0]):2===r?new si(arguments[0],arguments[1]):new si(arguments[0],arguments[1],arguments[2]);if(0===r)e=new Gr(0);else if(1===r)if(Fe(arguments[0]))e=new Gr(2*arguments[0]);else if(Ce(arguments[0]))if((n=(e=arguments[0]).length)&&Q(e)&&Ke(e[0])){if(e=function(t,r){var e,n,i,o;for(e=r.length,o=0,i=0;ie.byteLength-t)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*ii));e=new Gr(e,t,2*n)}}return M(this,"_buffer",e),M(this,"_length",e.length/2),this}function li(t){var r,e,n;for(r=[];!(e=t.next()).done;)if(Pe(n=e.value)&&n.length>=2)r.push(n[0],n[1]);else{if(!Ke(n))return new TypeError(S("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));r.push(An(n),Vn(n))}return r}M(si,"BYTES_PER_ELEMENT",ii),M(si,"name","Complex64Array"),M(si,"from",(function(t){var r,e,n,i,o,a,u,f,s,l,h,c;if(!Et(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ui(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!Et(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(r=arguments[2])}if(ai(t)){if(f=t.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(Ce(t)){if(n){for(f=t.length,u=t.get&&t.set?yn("default"):gn("default"),h=0;h=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(tt(t)&&oi&&Et(t[an])){if(!Et((o=t[an]()).next))throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=n?function(t,r,e){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,Pe(o=r.call(e,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Ke(o))return new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(sn(o),ln(o))}return n}(o,n,r):ni(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return fi(this._buffer,t)})),un(si.prototype,"buffer",(function(){return this._buffer.buffer})),un(si.prototype,"byteLength",(function(){return this._buffer.byteLength})),un(si.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),M(si.prototype,"BYTES_PER_ELEMENT",si.BYTES_PER_ELEMENT),M(si.prototype,"copyWithin",(function(t,r){if(!ai(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*r):this._buffer.copyWithin(2*t,2*r,2*arguments[2]),this})),M(si.prototype,"entries",(function(){var t,r,e,n,i,o,a;if(!ai(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,t=this._buffer,n=this._length,o=-1,a=-2,M(e={},"next",(function(){var r;if(o+=1,i||o>=n)return{done:!0};return r=new fn(t[a+=2],t[a+1]),{value:[o,r],done:!1}})),M(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),an&&M(e,an,(function(){return r.entries()})),e})),M(si.prototype,"every",(function(t,r){var e,n;if(!ai(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!jt(e))throw new TypeError(S("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=i)<0&&(e=0),e>i&&(e=i)}else e=i}else r=0,e=i;for(a=sn(t),u=ln(t),f=r;f=0;n--)if(i=fi(e,n),t.call(r,i,n,this))return i})),M(si.prototype,"findLastIndex",(function(t,r){var e,n,i;if(!ai(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=fi(e,n),t.call(r,i,n,this))return n;return-1})),M(si.prototype,"forEach",(function(t,r){var e,n,i;if(!ai(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n=this._length))return fi(this._buffer,t)})),M(si.prototype,"includes",(function(t,r){var e,n,i,o,a;if(!ai(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ke(t))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=sn(t),o=ln(t),e=this._buffer,a=r;a1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=sn(t),o=ln(t),e=this._buffer,a=r;a1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=sn(t),o=ln(t),e=this._buffer,a=r;a>=0;a--)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),un(si.prototype,"length",(function(){return this._length})),M(si.prototype,"map",(function(t,r){var e,n,i,o,a;if(!ai(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o1)n=r,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=fi(e,0),o=1}for(;o1){if(!Fe(e=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Ke(t)){if(e>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=sn(t),void(n[e+1]=ln(t))}if(ai(t)){if(e+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t._buffer,s=n.byteOffset+e*ii,r.buffer===n.buffer&&r.byteOffsets){for(i=new Gr(r.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t,s=n.byteOffset+e*ii,r.buffer===n.buffer&&r.byteOffsets){for(i=new Gr(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,f=0;fu&&(r=u)}}for(e=ti&&(r=i)}}return t>=i?(i=0,e=n.byteLength):t>=r?(i=0,e=n.byteOffset+t*ii):(i=r-t,e=n.byteOffset+t*ii),new this.constructor(n.buffer,e,i<0?0:i)})),M(si.prototype,"toReversed",(function(){var t,r,e,n,i,o;if(!ai(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=new this.constructor(e),n=this._buffer,t=r._buffer,i=0;i=i)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!Ke(r))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(e=(n=new this.constructor(this._buffer))._buffer)[2*t]=sn(r),e[2*t+1]=ln(r),n}));var hi=2*Nr.BYTES_PER_ELEMENT,ci=on();function pi(t){return t instanceof yi||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function gi(t){return t===yi||"Complex64Array"===t.name}function mi(t,r){return new xn(t[r*=2],t[r+1])}function yi(){var t,r,e,n;if(r=arguments.length,!(this instanceof yi))return 0===r?new yi:1===r?new yi(arguments[0]):2===r?new yi(arguments[0],arguments[1]):new yi(arguments[0],arguments[1],arguments[2]);if(0===r)e=new Nr(0);else if(1===r)if(Fe(arguments[0]))e=new Nr(2*arguments[0]);else if(Ce(arguments[0]))if((n=(e=arguments[0]).length)&&Q(e)&&Ke(e[0])){if(e=function(t,r){var e,n,i,o;for(e=r.length,o=0,i=0;ie.byteLength-t)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*hi));e=new Nr(e,t,2*n)}}return M(this,"_buffer",e),M(this,"_length",e.length/2),this}M(yi,"BYTES_PER_ELEMENT",hi),M(yi,"name","Complex128Array"),M(yi,"from",(function(t){var r,e,n,i,o,a,u,f,s,l,h,c;if(!Et(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!gi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!Et(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(r=arguments[2])}if(pi(t)){if(f=t.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(Ce(t)){if(n){for(f=t.length,u=t.get&&t.set?yn("default"):gn("default"),h=0;h=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(tt(t)&&ci&&Et(t[an])){if(!Et((o=t[an]()).next))throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=n?function(t,r,e){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,Pe(o=r.call(e,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Ke(o))return new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(An(o),Vn(o))}return n}(o,n,r):li(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return mi(this._buffer,t)})),un(yi.prototype,"buffer",(function(){return this._buffer.buffer})),un(yi.prototype,"byteLength",(function(){return this._buffer.byteLength})),un(yi.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),M(yi.prototype,"BYTES_PER_ELEMENT",yi.BYTES_PER_ELEMENT),M(yi.prototype,"copyWithin",(function(t,r){if(!pi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*r):this._buffer.copyWithin(2*t,2*r,2*arguments[2]),this})),M(yi.prototype,"entries",(function(){var t,r,e,n,i,o,a;if(!pi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,t=this._buffer,n=this._length,o=-1,a=-2,M(e={},"next",(function(){var r;if(o+=1,i||o>=n)return{done:!0};return r=new xn(t[a+=2],t[a+1]),{value:[o,r],done:!1}})),M(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),an&&M(e,an,(function(){return r.entries()})),e})),M(yi.prototype,"every",(function(t,r){var e,n;if(!pi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!jt(e))throw new TypeError(S("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=i)<0&&(e=0),e>i&&(e=i)}else e=i}else r=0,e=i;for(a=An(t),u=Vn(t),f=r;f=0;n--)if(i=mi(e,n),t.call(r,i,n,this))return i})),M(yi.prototype,"findLastIndex",(function(t,r){var e,n,i;if(!pi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=mi(e,n),t.call(r,i,n,this))return n;return-1})),M(yi.prototype,"forEach",(function(t,r){var e,n,i;if(!pi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n=this._length))return mi(this._buffer,t)})),un(yi.prototype,"length",(function(){return this._length})),M(yi.prototype,"includes",(function(t,r){var e,n,i,o,a;if(!pi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ke(t))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=An(t),o=Vn(t),e=this._buffer,a=r;a1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=An(t),o=Vn(t),e=this._buffer,a=r;a1){if(!jt(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=An(t),o=Vn(t),e=this._buffer,a=r;a>=0;a--)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),M(yi.prototype,"map",(function(t,r){var e,n,i,o,a;if(!pi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Et(t))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o1)n=r,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=mi(e,0),o=1}for(;o1){if(!Fe(e=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Ke(t)){if(e>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=An(t),void(n[e+1]=Vn(t))}if(pi(t)){if(e+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t._buffer,s=n.byteOffset+e*hi,r.buffer===n.buffer&&r.byteOffsets){for(i=new Nr(r.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t,s=n.byteOffset+e*hi,r.buffer===n.buffer&&r.byteOffsets){for(i=new Nr(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,f=0;fu&&(r=u)}}for(e=ti&&(r=i)}}return t>=i?(i=0,e=n.byteLength):t>=r?(i=0,e=n.byteOffset+t*hi):(i=r-t,e=n.byteOffset+t*hi),new this.constructor(n.buffer,e,i<0?0:i)})),M(yi.prototype,"toReversed",(function(){var t,r,e,n,i,o;if(!pi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=new this.constructor(e),n=this._buffer,t=r._buffer,i=0;i=i)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!Ke(r))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(e=(n=new this.constructor(this._buffer))._buffer)[2*t]=An(r),e[2*t+1]=Vn(r),n}));var wi=[Nr,Gr,ee,de,Hr,ce,ue,Te,Oe,si,yi],di=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128"],vi=di.length;function bi(t){var r;if(Q(t))return"generic";if(vt(t))return null;for(r=0;r0&&r.push("generic"),r)}function Vi(){return{bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256}}function Ri(t,r,e){P(t,r,{configurable:!1,enumerable:!0,writable:!1,value:e})}function Oi(t){return Object.keys(Object(t))}var Si,ji=void 0!==Object.keys;function Ii(t){return"[object Arguments]"===$(t)}Si=function(){return Ii(arguments)}();var Li=Si;function Bi(t){return t!=t}function Fi(t){return C(t)&&Bi(t)}function ki(t){return H(t)&&Bi(t.valueOf())}function Ui(t){return Fi(t)||ki(t)}M(Ui,"isPrimitive",Fi),M(Ui,"isObject",ki);var Pi=Object.prototype.propertyIsEnumerable;var Mi=!Pi.call("beep","0");function Ci(t,r){var e;return null!=t&&(!(e=Pi.call(t,r))&&Mi&&Ge(t)?!Fi(r=+r)&&Ie(r)&&r>=0&&r=0&&t.length<=ge&&W(t,"callee")&&!Ci(t,"callee")},Yi=Array.prototype.slice;var Di=Ci((function(){}),"prototype"),zi=!Ci({toString:null},"toString");function Wi(t,r,e){var n,i;if(!Ce(t)&&!De(t))throw new TypeError(S("invalid argument. First argument must be an array-like object. Value: `%s`.",t));if(0===(n=t.length))return-1;if(3===arguments.length){if(!Ie(e))throw new TypeError(S("invalid argument. Third argument must be an integer. Value: `%s`.",e));if(e>=0){if(e>=n)return-1;i=e}else(i=n+e)<0&&(i=0)}else i=0;if(Ui(r)){for(;i0&&!W(t,"0"))for(u=0;u0?o+=a*(t[u]-1):a<0&&(i+=a*(t[u]-1))}return[i,o]}M(to,"assign",(function(t,r,e,n){var i,o,a,u,f;for(i=t.length,o=e,a=e,f=0;f0?a+=u*(t[f]-1):u<0&&(o+=u*(t[f]-1))}return n[0]=o,n[1]=a,n}));var ro=ht();var eo={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};function no(t){return Math.abs(t)}function io(t,r){return r&&(2===t||3===t)}function oo(t,r){return r&&(1===t||3===t)}function ao(t){return t.re}function uo(t){return t.im}var fo=/[-\/\\^$*+?.()|[\]{}]/g;var so=RegExp.prototype.exec;var lo=Y();function ho(t){return"object"==typeof t&&(t instanceof RegExp||(lo?function(t){try{return so.call(t),!0}catch(t){return!1}}(t):"[object RegExp]"===$(t)))}function co(t,r,e){if(!De(t))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",t));if(De(r))r=new RegExp(function(t){var r,e;if(!De(t))throw new TypeError(S("invalid argument. Must provide a regular expression string. Value: `%s`.",t));if("/"===t[0])for(e=t.length-1;e>=0&&"/"!==t[e];e--);return void 0===e||e<=0?t.replace(fo,"\\$&"):(r=(r=t.substring(1,e)).replace(fo,"\\$&"),t=t[0]+r+t.substring(e))}(r),"g");else if(!ho(r))throw new TypeError(S("invalid argument. Second argument must be a string or regular expression. Value: `%s`.",r));if(!De(e)&&!Et(e))throw new TypeError(S("invalid argument. Third argument must be a string or replacement function. Value: `%s`.",e));return Ei(t,r,e)}var po={int8:"new Int8Array( [ {{data}} ] )",uint8:"new Uint8Array( [ {{data}} ] )",uint8c:"new Uint8ClampedArray( [ {{data}} ] )",int16:"new Int16Array( [ {{data}} ] )",uint16:"new Uint16Array( [ {{data}} ] )",int32:"new Int32Array( [ {{data}} ] )",uint32:"new Uint32Array( [ {{data}} ] )",float32:"new Float32Array( [ {{data}} ] )",float64:"new Float64Array( [ {{data}} ] )",generic:"[ {{data}} ]",binary:"new Buffer( [ {{data}} ] )",complex64:"new Complex64Array( [ {{data}} ] )",complex128:"new Complex128Array( [ {{data}} ] )"};var go,mo={uint16:ce,uint8:Te};(go=new mo.uint16(1))[0]=4660;var yo=52===new mo.uint8(go.buffer)[0],wo="function"==typeof ArrayBuffer?ArrayBuffer:null;var vo,bo="function"==typeof ArrayBuffer?ArrayBuffer:void 0;vo=function(){var t,r,e;if("function"!=typeof wo)return!1;try{(t=Ye(e=new wo(16))&&"function"==typeof wo.isView)&&((r=new Nr(e))[0]=-3.14,r[1]=NaN,t=t&&wo.isView(r)&&16===e.byteLength&&-3.14===r[0]&&r[1]!=r[1])}catch(r){t=!1}return t}()?bo:function(){throw new Error("not implemented")};var _o=vo,Eo="function"==typeof DataView;var To="function"==typeof DataView?DataView:null;var xo,Ao="function"==typeof DataView?DataView:void 0;xo=function(){var t,r,e,n;if("function"!=typeof To)return!1;try{e=new _o(24),r=new To(e,8),n=r,(t=(Eo&&n instanceof DataView||"[object DataView]"===$(n))&&"function"==typeof r.getFloat64&&"function"==typeof r.setFloat64)&&(r.setFloat64(0,-3.14),r.setFloat64(8,NaN),t=t&&r.buffer===e&&16===r.byteLength&&8===r.byteOffset&&-3.14===r.getFloat64(0)&&r.getFloat64(8)!=r.getFloat64(8))}catch(r){t=!1}return t}()?Ao:function(){throw new Error("not implemented")};var Vo=xo,Ro="function"==typeof BigInt?BigInt:void 0,Oo=["throw","normalize","clamp","wrap"];function So(){return Oo.slice()}function jo(){return{throw:1,clamp:2,wrap:3,normalize:4}}M(So,"enum",jo);var Io={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256},Lo=Hn(),Bo={throw:1,clamp:2,wrap:3,normalize:4};var Fo=4294967295,ko=4294967296,Uo=new Te(8),Po=new Vo(Uo.buffer);function Mo(t,r,e,n){var i,o,a;if(0===t){for(a=0;a>>0,i=St(t/ko),yo?(Po.setUint32(0,o,yo),Po.setUint32(4,i,yo)):(Po.setUint32(0,i,yo),Po.setUint32(4,o,yo)),a=0;a>>0,n=St(t/4294967296),e=new Vo(r.buffer),yo?(e.setUint32(0,i,yo),e.setUint32(4,n,yo)):(e.setUint32(0,n,yo),e.setUint32(4,i,yo))),r}),"assign",Mo);var Co={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256},No=Hn(),Yo={throw:1,clamp:2,wrap:3,normalize:4};function Do(t,r,e,n,i,o){var a,u,f,s,l;if(!(this instanceof Do))return new Do(t,r,e,n,i,o);for(s=1,l=0;li&&(n=!1),!n&&!r)return 0;i=o}return n&&r?3:n?1:2}(n),this._flags={ROW_MAJOR_CONTIGUOUS:oo(f,a),COLUMN_MAJOR_CONTIGUOUS:io(f,a),READONLY:!1},this.__meta_dataview__=null,this}function zo(){return{dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32",boolean:"bool"},order:"row-major",casting:"safe",index_mode:"throw"}}M(Do,"name","ndarray"),un(Do.prototype,"byteLength",(function(){return this._byteLength})),un(Do.prototype,"BYTES_PER_ELEMENT",(function(){return this._bytesPerElement})),un(Do.prototype,"data",(function(){return this._buffer})),un(Do.prototype,"dtype",(function(){return this._dtype})),un(Do.prototype,"flags",(function(){return{ROW_MAJOR_CONTIGUOUS:(t=this._flags).ROW_MAJOR_CONTIGUOUS,COLUMN_MAJOR_CONTIGUOUS:t.COLUMN_MAJOR_CONTIGUOUS,READONLY:t.READONLY};var t})),un(Do.prototype,"length",(function(){return this._length})),un(Do.prototype,"ndims",(function(){return this._ndims})),un(Do.prototype,"offset",(function(){return this._offset})),un(Do.prototype,"order",(function(){return this._order})),un(Do.prototype,"shape",(function(){return this._shape.slice()})),un(Do.prototype,"strides",(function(){return this._strides.slice()})),M(Do.prototype,"get",(function(){var t,r;for(t=this._offset,r=0;r=0;a--)t-=o=t%e[a],t/=e[a],i+=o*r[a];return this._accessors?this._buffer.get(i):this._buffer[i]})),M(Do.prototype,"set",(function(){var t,r;for(t=this._offset,r=0;r=0;u--)t-=a=t%n[u],t/=n[u],o+=a*e[u];return this._accessors?this._buffer.set(r,o):this._buffer[o]=r,this})),M(Do.prototype,"toString",(function(){var t,r,e,n,i,o;if(r=this._shape.length,e="ndarray( '"+(n=this._dtype)+"', ",t="",this._length<=100)if("complex64"===n||"complex128"===n)for(o=0;o=0;o--)t+=ao(i=this.iget(this._length-1-o))+", "+uo(i),o>0&&(t+=", ");else for(o=2;o>=0;o--)t+=this.iget(this._length-1-o),o>0&&(t+=", ")}if(e+=co(po[this.dtype],"{{data}}",t),e+=", ",e+=0===r?"[]":"[ "+this._shape.join(", ")+" ]",e+=", ",e+="[ ",0===r)e+="0";else for(o=0;or?r:t}function Ho(t,r){var e=r+1;return t<0?((t+=e)<0&&0!==(t%=e)&&(t+=e),t):t>r?((t-=e)>r&&(t%=e),t):t}function Ko(t,r){return t<0?(t+=r+1)<0?-1:t:t>r?-1:t}var Qo=_i(So()),ta={wrap:Ho,clamp:qo,normalize:function(t,r){var e=Ko(t,r);if(e<0||e>r)throw new RangeError(S("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",r,t));return e},throw:function(t,r){if(t<0||t>r)throw new RangeError(S("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",r,t));return t}};function ra(t,r,e){var n;if("clamp"===e)return qo(t,r);if("wrap"===e)return Ho(t,r);if(n=t,"normalize"===e&&(n=Ko(n,r)),n<0||n>r)throw new RangeError(S("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",r,t));return n}M(ra,"factory",(function(t){if(!Qo(t))throw new TypeError(S("invalid argument. First argument must be a recognized index mode. Value: `%s`.",t));return ta[t]}));var ea=Do.prototype.iget;var na=Do.prototype.iset;function ia(t,r){var e,n;for(e=[],n=0;n0))throw new TypeError(S("invalid argument. Third argument must be an array-like object containing nonnegative integers. Value: `%s`.",e));if((u=e.length)>oa)throw new RangeError(S("invalid argument. Number of dimensions must not exceed %u due to stack limits. Value: `%u`.",oa,u));if(!zn(n))throw new TypeError(S("invalid argument. Fourth argument must be an array-like object containing integers. Value: `%s`.",n));if(u>0){if(n.length!==u)throw new RangeError(S("invalid argument. Fourth argument length must match the number of dimensions. Expected number of dimensions: `%u`. Strides length: `%u`.",u,n.length))}else{if(1!==n.length)throw new RangeError("invalid argument. Fourth argument length must be equal to 1 when creating a zero-dimensional ndarray.");if(0!==n[0])throw new RangeError(S("invalid argument. Fourth argument must contain a single element equal to 0. Value: `%d`.",n[0]))}if(!Fe(i))throw new TypeError(S("invalid argument. Fifth argument must be a nonnegative integer. Value: `%s`.",i));if(!function(t){var r;for(r=0;r0&&!function(t,r,e,n){var i=to(r,e,n);return i[0]>=0&&i[1]0)throw new Error("invalid arguments. Input buffer is incompatible with the specified meta data. Ensure that the offset is valid with regard to the strides array and that the buffer has enough elements to satisfy the desired array shape.");if((f={}).mode=aa,f.readonly=ua,arguments.length>6&&(s=function(t,r){var e;if(!Ot(r))return new TypeError(S("invalid argument. Options argument must be an object. Value: `%s`.",r));if(W(r,"mode")&&(t.mode=r.mode,!Qo(t.mode)))return new TypeError(S("invalid option. `%s` option must be a recognized mode. Option: `%s`.","mode",t.mode));if(W(r,"submode")){if(t.submode=r.submode,!Q(t.submode))return new TypeError(S("invalid option. `%s` option must be an array containing recognized modes. Option: `%s`.","submode",t.submode));if(0===t.submode.length)return new TypeError(S("invalid option. `%s` option must be an array containing recognized modes. Option: `%s`.","submode",t.submode.join(",")));for(e=0;e0){if(!Ie(t))throw new TypeError(S("invalid argument. Index must be an integer. Value: `%s`.",t));return t=ra(t,this._length-1,this._mode),ea.call(this,t)}return ea.call(this)})),M(fa.prototype,"set",(function(){var t,r,e,n;if(this._flags.READONLY)throw new Error("invalid invocation. Cannot write to a read-only array.");if(arguments.length!==this._ndims+1)throw new RangeError(S("invalid arguments. Number of indices must match the number of dimensions. ndims: `%u`. nargs: `%u`.",this._ndims,arguments.length));for(t=this._offset,e=this._submode.length,n=0;n0){if(!Ie(t))throw new TypeError(S("invalid argument. Index must be an integer. Value: `%s`.",t));t=ra(t,this._length-1,this._mode),na.call(this,t,r)}else na.call(this,t);return this}));var la=zo.get("dtypes.default"),ha=zo.get("order");return function(t){var r,e,n,i,o,a,u,f;if(i={},arguments.length>1){if(!Ot(r=arguments[1]))throw new TypeError(sa("0kJ2V",r));e=W(r,"dtype")?r.dtype:la,n=W(r,"order")?r.order:ha,W(r,"mode")&&(i.mode=r.mode),W(r,"submode")&&(i.submode=r.submode),W(r,"readonly")&&(i.readonly=r.readonly)}else e=la,n=ha;if(C(t))f=[t];else{if(!Lt(t))throw new TypeError(sa("0kJ5s",t));f=t}if(f.length>0){if((a=Mn(f))!=a||a<0)throw new TypeError(sa("0kJ5s",t));u=Bt(f,n)}else a=1,u=[0];if(null===(o=Pn(e,a)))throw new TypeError(sa("0kJBf","dtype",e));return new fa(e,o,f,u,function(t,r){var e,n,i;for(n=t.length,e=0,i=0;i