-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod.js
4 lines (4 loc) · 64 KB
/
mod.js
1
2
3
4
// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
/// <reference types="./mod.d.ts" />
var r="function"==typeof Object.defineProperty?Object.defineProperty:null;var e=Object.defineProperty;function t(r){return"number"==typeof r}function n(r){var e,t="";for(e=0;e<r;e++)t+="0";return t}function i(r,e,t){var i=!1,o=e-r.length;return o<0||(function(r){return"-"===r[0]}(r)&&(i=!0,r=r.substr(1)),r=t?r+n(o):n(o)+r,i&&(r="-"+r)),r}var o=String.prototype.toLowerCase,a=String.prototype.toUpperCase;function u(r){var e,n,u;switch(r.specifier){case"b":e=2;break;case"o":e=8;break;case"x":case"X":e=16;break;default:e=10}if(n=r.arg,u=parseInt(n,10),!isFinite(u)){if(!t(n))throw new Error("invalid integer. Value: "+n);u=0}return u<0&&("u"===r.specifier||10!==e)&&(u=4294967295+u+1),u<0?(n=(-u).toString(e),r.precision&&(n=i(n,r.precision,r.padRight)),n="-"+n):(n=u.toString(e),u||r.precision?r.precision&&(n=i(n,r.precision,r.padRight)):n="",r.sign&&(n=r.sign+n)),16===e&&(r.alternate&&(n="0x"+n),n=r.specifier===a.call(r.specifier)?a.call(n):o.call(n)),8===e&&r.alternate&&"0"!==n.charAt(0)&&(n="0"+n),n}var f=Math.abs,l=String.prototype.toLowerCase,s=String.prototype.toUpperCase,h=String.prototype.replace,c=/e\+(\d)$/,p=/e-(\d)$/,y=/^(\d+)$/,m=/^(\d+)e/,g=/\.0$/,w=/\.0*e/,v=/(\..*[^0])0*e/;function b(r){var e,n,i=parseFloat(r.arg);if(!isFinite(i)){if(!t(r.arg))throw new Error("invalid floating-point number. Value: "+n);i=r.arg}switch(r.specifier){case"e":case"E":n=i.toExponential(r.precision);break;case"f":case"F":n=i.toFixed(r.precision);break;case"g":case"G":f(i)<1e-4?((e=r.precision)>0&&(e-=1),n=i.toExponential(e)):n=i.toPrecision(r.precision),r.alternate||(n=h.call(n,v,"$1e"),n=h.call(n,w,"e"),n=h.call(n,g,""));break;default:throw new Error("invalid double notation. Value: "+r.specifier)}return n=h.call(n,c,"e+0$1"),n=h.call(n,p,"e-0$1"),r.alternate&&(n=h.call(n,y,"$1."),n=h.call(n,m,"$1.e")),i>=0&&r.sign&&(n=r.sign+n),n=r.specifier===s.call(r.specifier)?s.call(n):l.call(n)}function d(r){var e,t="";for(e=0;e<r;e++)t+=" ";return t}var E=String.fromCharCode,_=Array.isArray;function T(r){return r!=r}function x(r){var e={};return e.specifier=r.specifier,e.precision=void 0===r.precision?1:r.precision,e.width=r.width,e.flags=r.flags||"",e.mapping=r.mapping,e}function V(r){var e,t,n,o,a,f,l,s,h,c,p,y,m;if(!_(r))throw new TypeError("invalid argument. First argument must be an array. Value: `"+r+"`.");for(f="",l=1,s=0;s<r.length;s++)if(n=r[s],"string"==typeof n)f+=n;else{if(e=void 0!==n.precision,!(n=x(n)).specifier)throw new TypeError("invalid argument. Token is missing `specifier` property. Index: `"+s+"`. Value: `"+n+"`.");for(n.mapping&&(l=n.mapping),t=n.flags,h=0;h<t.length;h++)switch(o=t.charAt(h)){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: "+o)}if("*"===n.width){if(n.width=parseInt(arguments[l],10),l+=1,T(n.width))throw new TypeError("the argument for * width at position "+l+" is not a number. Value: `"+n.width+"`.");n.width<0&&(n.padRight=!0,n.width=-n.width)}if(e&&"*"===n.precision){if(n.precision=parseInt(arguments[l],10),l+=1,T(n.precision))throw new TypeError("the argument for * precision at position "+l+" is not a number. Value: `"+n.precision+"`.");n.precision<0&&(n.precision=1,e=!1)}switch(n.arg=arguments[l],n.specifier){case"b":case"o":case"x":case"X":case"d":case"i":case"u":e&&(n.padZeros=!1),n.arg=u(n);break;case"s":n.maxWidth=e?n.precision:-1,n.arg=String(n.arg);break;case"c":if(!T(n.arg)){if((a=parseInt(n.arg,10))<0||a>127)throw new Error("invalid character code. Value: "+n.arg);n.arg=T(a)?String(n.arg):E(a)}break;case"e":case"E":case"f":case"F":case"g":case"G":e||(n.precision=6),n.arg=b(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,y=n.padRight,m=void 0,(m=p-c.length)<0?c:c=y?c+d(m):d(m)+c)),f+=n.arg||"",l+=1}return f}var A=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function S(r){var e={mapping:r[1]?parseInt(r[1],10):void 0,flags:r[2],width:r[3],precision:r[5],specifier:r[6]};return"."===r[4]&&void 0===r[5]&&(e.precision="1"),e}function j(r){var e,t,n,i;for(t=[],i=0,n=A.exec(r);n;)(e=r.slice(i,A.lastIndex-n[0].length)).length&&t.push(e),t.push(S(n)),i=A.lastIndex,n=A.exec(r);return(e=r.slice(i)).length&&t.push(e),t}function F(r){var e,t;if("string"!=typeof r)throw new TypeError(F("invalid argument. First argument must be a string. Value: `%s`.",r));for(e=[j(r)],t=1;t<arguments.length;t++)e.push(arguments[t]);return V.apply(null,e)}var L,k=Object.prototype,R=k.toString,B=k.__defineGetter__,I=k.__defineSetter__,O=k.__lookupGetter__,M=k.__lookupSetter__;L=function(){try{return r({},"x",{}),!0}catch(r){return!1}}()?e:function(r,e,t){var n,i,o,a;if("object"!=typeof r||null===r||"[object Array]"===R.call(r))throw new TypeError(F("invalid argument. First argument must be an object. Value: `%s`.",r));if("object"!=typeof t||null===t||"[object Array]"===R.call(t))throw new TypeError(F("invalid argument. Property descriptor must be an object. Value: `%s`.",t));if((i="value"in t)&&(O.call(r,e)||M.call(r,e)?(n=r.__proto__,r.__proto__=k,delete r[e],r[e]=t.value,r.__proto__=n):r[e]=t.value),o="get"in t,a="set"in t,i&&(o||a))throw new Error("invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.");return o&&B&&B.call(r,e,t.get),a&&I&&I.call(r,e,t.set),r};var C=L;function N(r,e,t){C(r,e,{configurable:!1,enumerable:!1,writable:!1,value:t})}function P(r){return"string"==typeof r}var U="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function Y(){return U&&"symbol"==typeof Symbol.toStringTag}var W=Object.prototype.toString;var $=Object.prototype.hasOwnProperty;function G(r,e){return null!=r&&$.call(r,e)}var Z="function"==typeof Symbol?Symbol:void 0,J="function"==typeof Z?Z.toStringTag:"";var X=Y()?function(r){var e,t,n;if(null==r)return W.call(r);t=r[J],e=G(r,J);try{r[J]=void 0}catch(e){return W.call(r)}return n=W.call(r),e?r[J]=t:delete r[J],n}:function(r){return W.call(r)},z=String.prototype.valueOf;var q=Y();function D(r){return"object"==typeof r&&(r instanceof String||(q?function(r){try{return z.call(r),!0}catch(r){return!1}}(r):"[object String]"===X(r)))}function H(r){return P(r)||D(r)}N(H,"isPrimitive",P),N(H,"isObject",D);var K="function"==typeof Float64Array;var Q="function"==typeof Float64Array?Float64Array:null;var rr="function"==typeof Float64Array?Float64Array:void 0;var er=function(){var r,e,t;if("function"!=typeof Q)return!1;try{e=new Q([1,3.14,-3.14,NaN]),t=e,r=(K&&t instanceof Float64Array||"[object Float64Array]"===X(t))&&1===e[0]&&3.14===e[1]&&-3.14===e[2]&&e[3]!=e[3]}catch(e){r=!1}return r}()?rr:function(){throw new Error("not implemented")},tr="function"==typeof Float32Array;var nr=Number.POSITIVE_INFINITY,ir="function"==typeof Float32Array?Float32Array:null;var or="function"==typeof Float32Array?Float32Array:void 0;var ar=function(){var r,e,t;if("function"!=typeof ir)return!1;try{e=new ir([1,3.14,-3.14,5e40]),t=e,r=(tr&&t instanceof Float32Array||"[object Float32Array]"===X(t))&&1===e[0]&&3.140000104904175===e[1]&&-3.140000104904175===e[2]&&e[3]===nr}catch(e){r=!1}return r}()?or:function(){throw new Error("not implemented")},ur="function"==typeof Int16Array;var fr="function"==typeof Int16Array?Int16Array:null;var lr="function"==typeof Int16Array?Int16Array:void 0;var sr=function(){var r,e,t;if("function"!=typeof fr)return!1;try{e=new fr([1,3.14,-3.14,32768]),t=e,r=(ur&&t instanceof Int16Array||"[object Int16Array]"===X(t))&&1===e[0]&&3===e[1]&&-3===e[2]&&-32768===e[3]}catch(e){r=!1}return r}()?lr:function(){throw new Error("not implemented")},hr="function"==typeof Int32Array;var cr="function"==typeof Int32Array?Int32Array:null;var pr="function"==typeof Int32Array?Int32Array:void 0;var yr=function(){var r,e,t;if("function"!=typeof cr)return!1;try{e=new cr([1,3.14,-3.14,2147483648]),t=e,r=(hr&&t instanceof Int32Array||"[object Int32Array]"===X(t))&&1===e[0]&&3===e[1]&&-3===e[2]&&-2147483648===e[3]}catch(e){r=!1}return r}()?pr:function(){throw new Error("not implemented")},mr="function"==typeof Int8Array;var gr="function"==typeof Int8Array?Int8Array:null;var wr="function"==typeof Int8Array?Int8Array:void 0;var vr=function(){var r,e,t;if("function"!=typeof gr)return!1;try{e=new gr([1,3.14,-3.14,128]),t=e,r=(mr&&t instanceof Int8Array||"[object Int8Array]"===X(t))&&1===e[0]&&3===e[1]&&-3===e[2]&&-128===e[3]}catch(e){r=!1}return r}()?wr:function(){throw new Error("not implemented")},br="function"==typeof Uint16Array;var dr="function"==typeof Uint16Array?Uint16Array:null;var Er="function"==typeof Uint16Array?Uint16Array:void 0;var _r=function(){var r,e,t;if("function"!=typeof dr)return!1;try{e=new dr(e=[1,3.14,-3.14,65536,65537]),t=e,r=(br&&t instanceof Uint16Array||"[object Uint16Array]"===X(t))&&1===e[0]&&3===e[1]&&65533===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?Er:function(){thro
8000
w new Error("not implemented")},Tr="function"==typeof Uint32Array;var xr="function"==typeof Uint32Array?Uint32Array:null;var Vr="function"==typeof Uint32Array?Uint32Array:void 0;var Ar=function(){var r,e,t;if("function"!=typeof xr)return!1;try{e=new xr(e=[1,3.14,-3.14,4294967296,4294967297]),t=e,r=(Tr&&t instanceof Uint32Array||"[object Uint32Array]"===X(t))&&1===e[0]&&3===e[1]&&4294967293===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?Vr:function(){throw new Error("not implemented")},Sr="function"==typeof Uint8Array;var jr="function"==typeof Uint8Array?Uint8Array:null;var Fr="function"==typeof Uint8Array?Uint8Array:void 0;var Lr=function(){var r,e,t;if("function"!=typeof jr)return!1;try{e=new jr(e=[1,3.14,-3.14,256,257]),t=e,r=(Sr&&t instanceof Uint8Array||"[object Uint8Array]"===X(t))&&1===e[0]&&3===e[1]&&253===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?Fr:function(){throw new Error("not implemented")},kr="function"==typeof Uint8ClampedArray;var Rr="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null;var Br="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0;var Ir=function(){var r,e,t;if("function"!=typeof Rr)return!1;try{e=new Rr([-1,0,1,3.14,4.99,255,256]),t=e,r=(kr&&t instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===X(t))&&0===e[0]&&0===e[1]&&1===e[2]&&3===e[3]&&5===e[4]&&255===e[5]&&255===e[6]}catch(e){r=!1}return r}()?Br:function(){throw new Error("not implemented")};function Or(r){return"number"==typeof r}var Mr=Number,Cr=Mr.prototype.toString;var Nr=Y();function Pr(r){return"object"==typeof r&&(r instanceof Mr||(Nr?function(r){try{return Cr.call(r),!0}catch(r){return!1}}(r):"[object Number]"===X(r)))}function Ur(r){return Or(r)||Pr(r)}N(Ur,"isPrimitive",Or),N(Ur,"isObject",Pr);var Yr=Mr.NEGATIVE_INFINITY,Wr=Math.floor;function $r(r){return Wr(r)===r}function Gr(r){return r<nr&&r>Yr&&$r(r)}function Zr(r){return Or(r)&&Gr(r)}function Jr(r){return Pr(r)&&Gr(r.valueOf())}function Xr(r){return Zr(r)||Jr(r)}function zr(r){return Zr(r)&&r>=0}function qr(r){return Jr(r)&&r.valueOf()>=0}function Dr(r){return zr(r)||qr(r)}N(Xr,"isPrimitive",Zr),N(Xr,"isObject",Jr),N(Dr,"isPrimitive",zr),N(Dr,"isObject",qr);var Hr=4294967295;function Kr(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&$r(r.length)&&r.length>=0&&r.length<=Hr}var Qr=9007199254740991;function re(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&$r(r.length)&&r.length>=0&&r.length<=Qr}var ee="function"==typeof ArrayBuffer;function te(r){return ee&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===X(r)}var ne=Array.isArray?Array.isArray:function(r){return"[object Array]"===X(r)};function ie(r){return"object"==typeof r&&null!==r&&!ne(r)}var oe=/./;function ae(r){return"boolean"==typeof r}var ue=Boolean,fe=Boolean.prototype.toString;var le=Y();function se(r){return"object"==typeof r&&(r instanceof ue||(le?function(r){try{return fe.call(r),!0}catch(r){return!1}}(r):"[object Boolean]"===X(r)))}function he(r){return ae(r)||se(r)}N(he,"isPrimitive",ae),N(he,"isObject",se);var ce="object"==typeof self?self:null,pe="object"==typeof window?window:null,ye="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},me="object"==typeof ye?ye:null,ge="object"==typeof globalThis?globalThis:null;var we=function(r){if(arguments.length){if(!ae(r))throw new TypeError(F("invalid argument. Must provide a boolean. Value: `%s`.",r));if(r)return new Function("return this;")()}if(ge)return ge;if(ce)return ce;if(pe)return pe;if(me)return me;throw new Error("unexpected error. Unable to resolve global object.")}(),ve=we.document&&we.document.childNodes,be=Int8Array;function de(){return/^\s*function\s*([^(]*)/i}var Ee=/^\s*function\s*([^(]*)/i;function _e(r){return null!==r&&"object"==typeof r}function Te(r){var e,t,n,i;if(("Object"===(t=X(r).slice(8,-1))||"Error"===t)&&r.constructor){if("string"==typeof(n=r.constructor).name)return n.name;if(e=Ee.exec(n.toString()))return e[1]}return _e(i=r)&&(i._isBuffer||i.constructor&&"function"==typeof i.constructor.isBuffer&&i.constructor.isBuffer(i))?"Buffer":t}N(de,"REGEXP",Ee),N(_e,"isObjectLikeArray",function(r){if("function"!=typeof r)throw new TypeError(F("invalid argument. Must provide a function. Value: `%s`.",r));return function(e){var t,n;if(!ne(e))return!1;if(0===(t=e.length))return!1;for(n=0;n<t;n++)if(!1===r(e[n]))return!1;return!0}}(_e));var xe="function"==typeof oe||"object"==typeof be||"function"==typeof ve?function(r){return Te(r).toLowerCase()}:function(r){var e;return null===r?"null":"object"===(e=typeof r)?Te(r).toLowerCase():e};function Ve(r){return"function"===xe(r)}function Ae(r,e){if(!(this instanceof Ae))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Or(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Or(e))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return C(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:r}),C(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:e}),this}N(Ae,"BYTES_PER_ELEMENT",8),N(Ae.prototype,"BYTES_PER_ELEMENT",8),N(Ae.prototype,"byteLength",16),N(Ae.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(Ae.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var Se="function"==typeof Math.fround?Math.fround:null,je=new ar(1);var Fe="function"==typeof Se?Se:function(r){return je[0]=r,je[0]};function Le(r,e){if(!(this instanceof Le))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Or(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Or(e))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return C(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Fe(r)}),C(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Fe(e)}),this}function ke(r){return r instanceof Ae||r instanceof Le||"object"==typeof r&&null!==r&&"number"==typeof r.re&&"number"==typeof r.im}function Re(r){return $r(r/2)}N(Le,"BYTES_PER_ELEMENT",4),N(Le.prototype,"BYTES_PER_ELEMENT",4),N(Le.prototype,"byteLength",8),N(Le.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(Le.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var Be=8;function Ie(r){return"object"==typeof r&&null!==r&&"Complex64Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Be}var Oe=16;function Me(r){return"object"==typeof r&&null!==r&&"Complex128Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Oe}function Ce(){return"function"==typeof Z&&"symbol"==typeof Z("foo")&&G(Z,"iterator")&&"symbol"==typeof Z.iterator}var Ne=Ce()?Symbol.iterator:null;function Pe(r,e,t){C(r,e,{configurable:!1,enumerable:!1,get:t})}function Ue(r,e){if(!(this instanceof Ue))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Or(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Or(e))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return C(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Fe(r)}),C(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Fe(e)}),this}function Ye(r){return r.re}function We(r){return r.im}function $e(r,e){return new ar(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*e,2*(r.length-e))}function Ge(r,e){return new er(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*e,2*(r.length-e))}N(Ue,"BYTES_PER_ELEMENT",4),N(Ue.prototype,"BYTES_PER_ELEMENT",4),N(Ue.prototype,"byteLength",8),N(Ue.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(Ue.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var Ze={float64:function(r,e){return r[e]},float32:function(r,e){return r[e]},int32:function(r,e){return r[e]},int16:function(r,e){return r[e]},int8:function(r,e){return r[e]},uint32:function(r,e){return r[e]},uint16:function(r,e){return r[e]},uint8:function(r,e){return r[e]},uint8c:function(r,e){return r[e]},generic:function(r,e){return r[e]},default:function(r,e){return r[e]}};function Je(r){var e=Ze[r];return"function"==typeof e?e:Ze.default}var Xe={complex128:function(r,e){return r.get(e)},complex64:function(r,e){return r.get(e)},default:function(r,e){return r.get(e)}};function ze(r){var e=Xe[r];return"function"==typeof e?e:Xe.default}function qe(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(Kr(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!ke(n))return new TypeError(F("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(Ye(n),We(n))}return e}var De=2*ar.BYTES_PER_ELEMENT,He=Ce();function Ke(r){return r instanceof et||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Qe(r){return r===et||"Complex128Array"===r.name}function rt(r,e){return new Ue(r[e*=2],r[e+1])}function et(){var r,e,t,n;if(e=arguments.length,!(this instanceof et))return 0===e?new et:1===e?new et(arguments[0]):2===e?new et(arguments[0],arguments[1]):new et(arguments[0],arguments[1],arguments[2]);if(0===e)t=new ar(0);else if(1===e)if(zr(arguments[0]))t=new ar(2*arguments[0]);else if(re(arguments[0]))if((n=(t=arguments[0]).length)&&ne(t)&&ke(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;i<t;i++){if(!ke(n=e[i]))return null;r[o]=Ye(n),r[o+1]=We(n),o+=2}return r}(new ar(2*n),t),null===t){if(!Re(n))throw new RangeError(F("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(Ie(t))t=$e(t,0);else if(Me(t))t=Ge(t,0);else if(!Re(n))throw new RangeError(F("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(te(arguments[0])){if(!$r((t=arguments[0]).byteLength/De))throw new RangeError(F("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",De,t.byteLength));t=new ar(t)}else{if(!ie(arguments[0]))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));if(t=arguments[0],!1===He)throw new TypeError(F("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",t));if(!Ve(t[Ne]))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!Ve((t=t[Ne]()).next))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if((t=qe(t))instanceof Error)throw t;t=new ar(t)}else{if(!te(t=arguments[0]))throw new TypeError(F("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!zr(r=arguments[1]))throw new TypeError(F("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(!$r(r/De))throw new RangeError(F("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",De,r));if(2===e){if(!$r((n=t.byteLength-r)/De))throw new RangeError(F("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",De,n));t=new ar(t,r)}else{if(!zr(n=arguments[2]))throw new TypeError(F("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*De>t.byteLength-r)throw new RangeError(F("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*De));t=new ar(t,r,2*n)}}return N(this,"_buffer",t),N(this,"_length",t.length/2),this}function tt(r,e){if(!(this instanceof tt))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Or(r))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Or(e))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return C(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:r}),C(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:e}),this}function nt(r){return r.re}function it(r){return r.im}function ot(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(Kr(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!ke(n))return new TypeError(F("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(nt(n),it(n))}return e}N(et,"BYTES_PER_ELEMENT",De),N(et,"name","Complex64Array"),N(et,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!Ve(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!Ve(n=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(Ke(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(ke(s=n.call(e,r.get(h),h)))o[c]=Ye(s),o[c+1]=We(s);else{if(!(Kr(s)&&s.length>=2))throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(re(r)){if(n){for(f=r.length,u=r.get&&r.set?ze("default"):Je("default"),h=0;h<f;h++)if(!ke(u(r,h))){l=!0;break}if(l){if(!Re(f))throw new RangeError(F("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,f));for(o=(i=new this(f/2))._buffer,h=0;h<f;h++)o[h]=n.call(e,u(r,h),h);return i}for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(ke(s=n.call(e,u(r,h),h)))o[c]=Ye(s),o[c+1]=We(s);else{if(!(Kr(s)&&s.length>=2))throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(ie(r)&&He&&Ve(r[Ne])){if(!Ve((o=r[Ne]()).next))throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,e,t){var n,i,o,a;for(n=[],a=-1;!(i=r.next()).done;)if(a+=1,Kr(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!ke(o))return new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(Ye(o),We(o))}return n}(o,n,e):qe(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h<f;h++)o[h]=a[h];return i}throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))})),N(et,"of",(function(){var r,e;if(!Ve(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],e=0;e<arguments.length;e++)r.push(arguments[e]);return new this(r)})),N(et.prototype,"at",(function(r){if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$r(r))throw new TypeError(F("invalid argument. Must provide an integer. Value: `%s`.",r));if(r<0&&(r+=this._length),!(r<0||r>=this._length))return rt(this._buffer,r)})),Pe(et.prototype,"buffer",(function(){return this._buffer.buffer})),Pe(et.prototype,"byteLength",(function(){return this._buffer.byteLength})),Pe(et.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),N(et.prototype,"BYTES_PER_ELEMENT",et.BYTES_PER_ELEMENT),N(et.prototype,"copyWithin",(function(r,e){if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*e):this._buffer.copyWithin(2*r,2*e,2*arguments[2]),this})),N(et.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,r=this._buffer,n=this._length,o=-1,a=-2,N(t={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new Ue(r[a+=2],r[a+1]),{value:[o,e],done:!1}})),N(t,"return",(function(r){if(i=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Ne&&N(t,Ne,(function(){return e.entries()})),t})),N(et.prototype,"every",(function(r,e){var t,n;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(!r.call(e,rt(t,n),n,this))return!1;return!0})),N(et.prototype,"fill",(function(r,e,t){var n,i,o,a,u,f;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ke(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(n=this._buffer,i=this._length,arguments.length>1){if(!$r(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!$r(t))throw new TypeError(F("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=i)<0&&(t=0),t>i&&(t=i)}else t=i}else e=0,t=i;for(a=Ye(r),u=We(r),f=e;f<t;f++)n[o=2*f]=a,n[o+1]=u;return this})),N(et.prototype,"filter",(function(r,e){var t,n,i,o;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=rt(t,i),r.call(e,o,i,this)&&n.push(o);return new this.constructor(n)})),N(et.prototype,"find",(function(r,e){var t,n,i;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=rt(t,n),r.call(e,i,n,this))return i})),N(et.prototype,"findIndex",(function(r,e){var t,n,i;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=rt(t,n),r.call(e,i,n,this))return n;return-1})),N(et.prototype,"findLast",(function(r,e){var t,n,i;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=rt(t,n),r.call(e,i,n,this))return i})),N(et.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=rt(t,n),r.call(e,i,n,this))return n;return-1})),N(et.prototype,"forEach",(function(r,e){var t,n,i;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)i=rt(t,n),r.call(e,i,n,this)})),N(et.prototype,"get",(function(r){if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!zr(r))throw new TypeError(F("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return rt(this._buffer,r)})),N(et.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ke(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!$r(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=Ye(r),o=We(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return!0;return!1})),N(et.prototype,"indexOf",(function(r,e){var t,n,i,o,a;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ke(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!$r(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=Ye(r),o=We(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),N(et.prototype,"join",(function(r){var e,t,n,i;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!P(r))throw new TypeError(F("invalid argument. First argument must be a string. Value: `%s`.",r));n=r}for(e=[],t=this._buffer,i=0;i<this._length;i++)e.push(rt(t,i).toString());return e.join(n)})),N(et.prototype,"lastIndexOf",(function(r,e){var t,n,i,o,a;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ke(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!$r(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=Ye(r),o=We(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),Pe(et.prototype,"length",(function(){return this._length})),N(et.prototype,"map",(function(r,e){var t,n,i,o,a;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(ke(a=r.call(e,rt(n,o),o,this)))t[2*o]=Ye(a),t[2*o+1]=We(a);else{if(!Kr(a)||2!==a.length)throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));t[2*o]=a[0],t[2*o+1]=a[1]}return i})),N(et.prototype,"reduce",(function(r,e){var t,n,i,o;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));if(t=this._buffer,i=this._length,arguments.length>1)n=e,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=rt(t,0),o=1}for(;o<i;o++)n=r(n,rt(t,o),o,this);return n})),N(et.prototype,"reverse",(function(){var r,e,t,n,i,o;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=this._buffer,n=Wr(t/2),i=0;i<n;i++)o=t-i-1,e=r[2*i],r[2*i]=r[2*o],r[2*o]=e,e=r[2*i+1],r[2*i+1]=r[2*o+1],r[2*o+1]=e;return this})),N(et.prototype,"set",(function(r){var e,t,n,i,o,a,u,f,l;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!zr(t=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(ke(r)){if(t>=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=Ye(r),void(n[t+1]=We(r))}if(Ke(r)){if(t+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r._buffer,l=n.byteOffset+t*De,e.buffer===n.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new ar(e.length),f=0;f<e.length;f++)i[f]=e[f];e=i}for(t*=2,l=0,f=0;f<a;f++)n[t]=e[l],n[t+1]=e[l+1],t+=2,l+=2}else{if(!re(r))throw new TypeError(F("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",r));for(a=r.length,f=0;f<a;f++)if(!ke(r[f])){o=!0;break}if(o){if(!Re(a))throw new RangeError(F("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",a));if(t+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,l=n.byteOffset+t*De,e.buffer===n.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new ar(a),f=0;f<a;f++)i[f]=e[f];e=i}for(t*=2,a/=2,l=0,f=0;f<a;f++)n[t]=e[l],n[t+1]=e[l+1],t+=2,l+=2;return}if(t+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;f<a;f++)u=r[f],n[t]=Ye(u),n[t+1]=We(u),t+=2}})),N(et.prototype,"slice",(function(r,e){var t,n,i,o,a,u,f;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)r=0,e=u;else{if(!$r(r))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=u)<0&&(r=0),1===arguments.length)e=u;else{if(!$r(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=u)<0&&(e=0):e>u&&(e=u)}}for(t=r<e?e-r:0,n=(i=new this.constructor(t))._buffer,f=0;f<t;f++)o=2*(f+r),n[2*f]=a[o],n[2*f+1]=a[o+1];return i})),N(et.prototype,"some",(function(r,e){var t,n;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(r.call(e,rt(t,n),n,this))return!0;return!1})),N(et.prototype,"subarray",(function(r,e){var t,n,i;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)r=0,e=i;else{if(!$r(r))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),1===arguments.length)e=i;else{if(!$r(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=i)<0&&(e=0):e>i&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*De):(i=e-r,t=n.byteOffset+r*De),new this.constructor(n.buffer,t,i<0?0:i)})),N(et.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i<t;i++)o=t-i-1,r[2*i]=n[2*o],r[2*i+1]=n[2*o+1];return e})),N(et.prototype,"toString",(function(){var r,e,t;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],e=this._buffer,t=0;t<this._length;t++)r.push(rt(e,t).toString());return r.join(",")})),N(et.prototype,"with",(function(r,e){var t,n,i;if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$r(r))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",r));if(i=this._length,r<0&&(r+=i),r<0||r>=i)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!ke(e))throw new TypeError(F("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=Ye(e),t[2*r+1]=We(e),n})),N(tt,"BYTES_PER_ELEMENT",8),N(tt.prototype,"BYTES_PER_ELEMENT",8),N(tt.prototype,"byteLength",16),N(tt.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(tt.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var at=2*er.BYTES_PER_ELEMENT,ut=Ce();function ft(r){return r instanceof ht||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.c
A448
onstructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function lt(r){return r===ht||"Complex64Array"===r.name}function st(r,e){return new tt(r[e*=2],r[e+1])}function ht(){var r,e,t,n;if(e=arguments.length,!(this instanceof ht))return 0===e?new ht:1===e?new ht(arguments[0]):2===e?new ht(arguments[0],arguments[1]):new ht(arguments[0],arguments[1],arguments[2]);if(0===e)t=new er(0);else if(1===e)if(zr(arguments[0]))t=new er(2*arguments[0]);else if(re(arguments[0]))if((n=(t=arguments[0]).length)&&ne(t)&&ke(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;i<t;i++){if(!ke(n=e[i]))return null;r[o]=nt(n),r[o+1]=it(n),o+=2}return r}(new er(2*n),t),null===t){if(!Re(n))throw new RangeError(F("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new er(arguments[0])}}else{if(Ie(t))t=$e(t,0);else if(Me(t))t=Ge(t,0);else if(!Re(n))throw new RangeError(F("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new er(t)}else if(te(arguments[0])){if(!$r((t=arguments[0]).byteLength/at))throw new RangeError(F("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",at,t.byteLength));t=new er(t)}else{if(!ie(arguments[0]))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));if(t=arguments[0],!1===ut)throw new TypeError(F("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",t));if(!Ve(t[Ne]))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!Ve((t=t[Ne]()).next))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if((t=ot(t))instanceof Error)throw t;t=new er(t)}else{if(!te(t=arguments[0]))throw new TypeError(F("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!zr(r=arguments[1]))throw new TypeError(F("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(!$r(r/at))throw new RangeError(F("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",at,r));if(2===e){if(!$r((n=t.byteLength-r)/at))throw new RangeError(F("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",at,n));t=new er(t,r)}else{if(!zr(n=arguments[2]))throw new TypeError(F("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*at>t.byteLength-r)throw new RangeError(F("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*at));t=new er(t,r,2*n)}}return N(this,"_buffer",t),N(this,"_length",t.length/2),this}function ct(r){var e,t;for(e=[];!(t=r.next()).done;)e.push(ue(t.value));return e}N(ht,"BYTES_PER_ELEMENT",at),N(ht,"name","Complex128Array"),N(ht,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!Ve(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!Ve(n=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(ft(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(ke(s=n.call(e,r.get(h),h)))o[c]=nt(s),o[c+1]=it(s);else{if(!(Kr(s)&&s.length>=2))throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(re(r)){if(n){for(f=r.length,u=r.get&&r.set?ze("default"):Je("default"),h=0;h<f;h++)if(!ke(u(r,h))){l=!0;break}if(l){if(!Re(f))throw new RangeError(F("invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.",f));for(o=(i=new this(f/2))._buffer,h=0;h<f;h++)o[h]=n.call(e,u(r,h),h);return i}for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(ke(s=n.call(e,u(r,h),h)))o[c]=nt(s),o[c+1]=it(s);else{if(!(Kr(s)&&s.length>=2))throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(ie(r)&&ut&&Ve(r[Ne])){if(!Ve((o=r[Ne]()).next))throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,e,t){var n,i,o,a;for(n=[],a=-1;!(i=r.next()).done;)if(a+=1,Kr(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!ke(o))return new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(nt(o),it(o))}return n}(o,n,e):ot(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h<f;h++)o[h]=a[h];return i}throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))})),N(ht,"of",(function(){var r,e;if(!Ve(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!lt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],e=0;e<arguments.length;e++)r.push(arguments[e]);return new this(r)})),N(ht.prototype,"at",(function(r){if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$r(r))throw new TypeError(F("invalid argument. Must provide an integer. Value: `%s`.",r));if(r<0&&(r+=this._length),!(r<0||r>=this._length))return st(this._buffer,r)})),Pe(ht.prototype,"buffer",(function(){return this._buffer.buffer})),Pe(ht.prototype,"byteLength",(function(){return this._buffer.byteLength})),Pe(ht.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),N(ht.prototype,"BYTES_PER_ELEMENT",ht.BYTES_PER_ELEMENT),N(ht.prototype,"copyWithin",(function(r,e){if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*e):this._buffer.copyWithin(2*r,2*e,2*arguments[2]),this})),N(ht.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,r=this._buffer,n=this._length,o=-1,a=-2,N(t={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new tt(r[a+=2],r[a+1]),{value:[o,e],done:!1}})),N(t,"return",(function(r){if(i=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Ne&&N(t,Ne,(function(){return e.entries()})),t})),N(ht.prototype,"every",(function(r,e){var t,n;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(!r.call(e,st(t,n),n,this))return!1;return!0})),N(ht.prototype,"fill",(function(r,e,t){var n,i,o,a,u,f;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ke(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(n=this._buffer,i=this._length,arguments.length>1){if(!$r(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!$r(t))throw new TypeError(F("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=i)<0&&(t=0),t>i&&(t=i)}else t=i}else e=0,t=i;for(a=nt(r),u=it(r),f=e;f<t;f++)n[o=2*f]=a,n[o+1]=u;return this})),N(ht.prototype,"filter",(function(r,e){var t,n,i,o;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=st(t,i),r.call(e,o,i,this)&&n.push(o);return new this.constructor(n)})),N(ht.prototype,"find",(function(r,e){var t,n,i;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=st(t,n),r.call(e,i,n,this))return i})),N(ht.prototype,"findIndex",(function(r,e){var t,n,i;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=st(t,n),r.call(e,i,n,this))return n;return-1})),N(ht.prototype,"findLast",(function(r,e){var t,n,i;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=st(t,n),r.call(e,i,n,this))return i})),N(ht.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=st(t,n),r.call(e,i,n,this))return n;return-1})),N(ht.prototype,"forEach",(function(r,e){var t,n,i;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)i=st(t,n),r.call(e,i,n,this)})),N(ht.prototype,"get",(function(r){if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!zr(r))throw new TypeError(F("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return st(this._buffer,r)})),Pe(ht.prototype,"length",(function(){return this._length})),N(ht.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ke(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!$r(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=nt(r),o=it(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return!0;return!1})),N(ht.prototype,"indexOf",(function(r,e){var t,n,i,o,a;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ke(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!$r(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=nt(r),o=it(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),N(ht.prototype,"join",(function(r){var e,t,n,i;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!H(r))throw new TypeError(F("invalid argument. First argument must be a string. Value: `%s`.",r));n=r}for(e=[],t=this._buffer,i=0;i<this._length;i++)e.push(st(t,i).toString());return e.join(n)})),N(ht.prototype,"lastIndexOf",(function(r,e){var t,n,i,o,a;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ke(r))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!$r(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=nt(r),o=it(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),N(ht.prototype,"map",(function(r,e){var t,n,i,o,a;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(ke(a=r.call(e,st(n,o),o,this)))t[2*o]=nt(a),t[2*o+1]=it(a);else{if(!Kr(a)||2!==a.length)throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));t[2*o]=a[0],t[2*o+1]=a[1]}return i})),N(ht.prototype,"reduce",(function(r,e){var t,n,i,o;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));if(t=this._buffer,i=this._length,arguments.length>1)n=e,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=st(t,0),o=1}for(;o<i;o++)n=r(n,st(t,o),o,this);return n})),N(ht.prototype,"reverse",(function(){var r,e,t,n,i,o;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=this._buffer,n=Wr(t/2),i=0;i<n;i++)o=t-i-1,e=r[2*i],r[2*i]=r[2*o],r[2*o]=e,e=r[2*i+1],r[2*i+1]=r[2*o+1],r[2*o+1]=e;return this})),N(ht.prototype,"set",(function(r){var e,t,n,i,o,a,u,f,l;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!zr(t=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(ke(r)){if(t>=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=nt(r),void(n[t+1]=it(r))}if(ft(r)){if(t+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r._buffer,l=n.byteOffset+t*at,e.buffer===n.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new er(e.length),f=0;f<e.length;f++)i[f]=e[f];e=i}for(t*=2,l=0,f=0;f<a;f++)n[t]=e[l],n[t+1]=e[l+1],t+=2,l+=2}else{if(!re(r))throw new TypeError(F("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",r));for(a=r.length,f=0;f<a;f++)if(!ke(r[f])){o=!0;break}if(o){if(!Re(a))throw new RangeError(F("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",a));if(t+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,l=n.byteOffset+t*at,e.buffer===n.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new er(a),f=0;f<a;f++)i[f]=e[f];e=i}for(t*=2,a/=2,l=0,f=0;f<a;f++)n[t]=e[l],n[t+1]=e[l+1],t+=2,l+=2;return}if(t+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;f<a;f++)u=r[f],n[t]=nt(u),n[t+1]=it(u),t+=2}})),N(ht.prototype,"slice",(function(r,e){var t,n,i,o,a,u,f;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)r=0,e=u;else{if(!$r(r))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=u)<0&&(r=0),1===arguments.length)e=u;else{if(!$r(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=u)<0&&(e=0):e>u&&(e=u)}}for(t=r<e?e-r:0,n=(i=new this.constructor(t))._buffer,f=0;f<t;f++)o=2*(f+r),n[2*f]=a[o],n[2*f+1]=a[o+1];return i})),N(ht.prototype,"some",(function(r,e){var t,n;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(r.call(e,st(t,n),n,this))return!0;return!1})),N(ht.prototype,"subarray",(function(r,e){var t,n,i;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)r=0,e=i;else{if(!$r(r))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),1===arguments.length)e=i;else{if(!$r(e))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=i)<0&&(e=0):e>i&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*at):(i=e-r,t=n.byteOffset+r*at),new this.constructor(n.buffer,t,i<0?0:i)})),N(ht.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i<t;i++)o=t-i-1,r[2*i]=n[2*o],r[2*i+1]=n[2*o+1];return e})),N(ht.prototype,"toString",(function(){var r,e,t;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],e=this._buffer,t=0;t<this._length;t++)r.push(st(e,t).toString());return r.join(",")})),N(ht.prototype,"with",(function(r,e){var t,n,i;if(!ft(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$r(r))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",r));if(i=this._length,r<0&&(r+=i),r<0||r>=i)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!ke(e))throw new TypeError(F("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=nt(e),t[2*r+1]=it(e),n}));var pt=Lr.BYTES_PER_ELEMENT,yt=Ce();function mt(r){return"object"==typeof r&&null!==r&&"BooleanArray"===r.constructor.name&&r.BYTES_PER_ELEMENT===pt}function gt(r){return r===wt}function wt(){var r,e,t,n,i;if(e=arguments.length,!(this instanceof wt))return 0===e?new wt:1===e?new wt(arguments[0]):2===e?new wt(arguments[0],arguments[1]):new wt(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Lr(0);else if(1===e)if(zr(i=arguments[0]))t=new Lr(i);else if(re(i))t=function(r,e){var t,n;for(t=e.length,n=0;n<t;n++)r[n]=ue(e[n]);return r}(new Lr(i.length),i);else if(te(i))t=new Lr(i);else{if(!ie(i))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(!1===yt)throw new TypeError(F("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",i));if(!Ve(i[Ne]))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(!Ve((t=i[Ne]()).next))throw new TypeError(F("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));t=new Lr(ct(t))}else{if(!te(t=arguments[0]))throw new TypeError(F("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!zr(r=arguments[1]))throw new TypeError(F("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(2===e)t=new Lr(t,r);else{if(!zr(n=arguments[2]))throw new TypeError(F("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*pt>t.byteLength-r)throw new RangeError(F("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*pt));t=new Lr(t,r,n)}}return N(this,"_buffer",t),N(this,"_length",t.length),this}N(wt,"BYTES_PER_ELEMENT",pt),N(wt,"name","BooleanArray"),N(wt,"from",(function(r){var e,t,n,i,o,a,u,f,l;if(!Ve(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!gt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((t=arguments.length)>1){if(!Ve(n=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(re(r)){if(n){for(f=r.length,u=r.get&&r.set?ze("default"):Je("default"),o=(i=new this(f))._buffer,l=0;l<f;l++)o[l]=ue(n.call(e,u(r,l),l));return i}return new this(r)}if(ie(r)&&yt&&Ve(r[Ne])){if(!Ve((o=r[Ne]()).next))throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));for(a=n?function(r,e,t){var n,i,o;for(n=[],o=-1;!(i=r.next()).done;)o+=1,n.push(ue(e.call(t,i.value,o)));return n}(o,n,e):ct(o),o=(i=new this(f=a.length))._buffer,l=0;l<f;l++)o[l]=a[l];return i}throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))})),N(wt,"of",(function(){var r,e;if(!Ve(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!gt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=[],e=0;e<arguments.length;e++)r.push(arguments[e]);return new this(r)})),Pe(wt.prototype,"buffer",(function(){return this._buffer.buffer})),Pe(wt.prototype,"byteLength",(function(){return this._buffer.byteLength})),Pe(wt.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),N(wt.prototype,"BYTES_PER_ELEMENT",wt.BYTES_PER_ELEMENT),N(wt.prototype,"find",(function(r,e){var t,n,i;if(!mt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,i=0;i<this._length;i++)if(n=ue(t[i]),r.call(e,n,i,this))return n})),N(wt.prototype,"findIndex",(function(r,e){var t,n,i;if(!mt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,i=0;i<this._length;i++)if(n=ue(t[i]),r.call(e,n,i,this))return i;return-1})),N(wt.prototype,"findLast",(function(r,e){var t,n,i;if(!mt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,i=this._length-1;i>=0;i--)if(n=ue(t[i]),r.call(e,n,i,this))return n})),N(wt.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!mt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,i=this._length-1;i>=0;i--)if(n=ue(t[i]),r.call(e,n,i,this))return i;return-1})),N(wt.prototype,"get",(function(r){if(!mt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!zr(r))throw new TypeError(F("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return ue(this._buffer[r])})),Pe(wt.prototype,"length",(function(){return this._length})),N(wt.prototype,"map",(function(r,e){var t,n,i,o;if(!mt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Ve(r))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",r);for(i=this._buffer,t=(n=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)t[o]=ue(r.call(e,ue(i[o]),o,this));return n})),N(wt.prototype,"reverse",(function(){var r,e,t,n,i,o;if(!mt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=this._buffer,t=this._length,n=Wr(t/2),i=0;i<n;i++)o=t-i-1,e=r[i],r[i]=r[o],r[o]=e;return this})),N(wt.prototype,"set",(function(r){var e,t,n,i,o,a,u;if(!mt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(n=this._buffer,arguments.length>1){if(!zr(t=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(re(r)){if(t+(o=r.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=mt(r)?r._buffer:r,u=n.byteOffset+t*pt,e.buffer===n.buffer&&e.byteOffset<u&&e.byteOffset+e.byteLength>u){for(i=new Lr(e.length),a=0;a<e.length;a++)i[a]=e[a];e=i}for(a=0;a<o;t++,a++)n[t]=e[a]?1:0}else{if(t>=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));n[t]=r?1:0}})),N(wt.prototype,"sort",(function(r){var e;if(!mt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(e=this._buffer,0===arguments.length)return e.sort(),this;if(!Ve(r))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",r));return e.sort((function(e,t){return r(ue(e),ue(t))})),this})),N(wt.prototype,"toReversed",(function(){var r,e,t,n,i;if(!mt(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i<t;i++)r[i]=n[t-i-1];return e}));var vt={float64:er,float32:ar,int16:sr,int32:yr,int8:vr,uint16:_r,uint32:Ar,uint8:Lr,uint8c:Ir,complex64:et,complex128:ht,bool:wt};function bt(r){return vt[r]||null}function dt(){return{dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",boolean:"bool",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32"}}}var Et={dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",boolean:"bool",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32"}},_t={"dtypes.default":Et.dtypes.default,"dtypes.numeric":Et.dtypes.numeric,"dtypes.real":Et.dtypes.real,"dtypes.floating_point":Et.dtypes.floating_point,"dtypes.real_floating_point":Et.dtypes.real_floating_point,"dtypes.complex_floating_point":Et.dtypes.complex_floating_point,"dtypes.boolean":Et.dtypes.boolean,"dtypes.integer":Et.dtypes.integer,"dtypes.signed_integer":Et.dtypes.signed_integer,"dtypes.unsigned_integer":Et.dtypes.unsigned_integer};N(dt,"get",(function(r){var e=_t[r];return void 0===e?null:e}));var Tt=dt.get("dtypes.default"),xt=bt("complex64"),Vt=bt("complex128"),At=bt("bool");function St(){var r,e,t,n,i,o;if(null===(t=bt(e=(r=arguments.length)&&P(arguments[r-1])?arguments[r-=1]:Tt)))throw new TypeError(function(){var r,e=arguments,t="https://stdlib.io/e/"+e[0]+"?";for(r=1;r<e.length;r++)t+="&arg[]="+encodeURIComponent(e[r]);return t}("02N2Y",e));return r<=0?new t(0):1===r?((n=arguments[0])instanceof xt?n=$e(n,0):n instanceof Vt?n=Ge(n,0):n instanceof At&&(o=0,n=new Lr((i=n).buffer,i.byteOffset+i.BYTES_PER_ELEMENT*o,i.length-o)),new t(n)):2===r?new t(arguments[0],arguments[1]):new t(arguments[0],arguments[1],arguments[2])}export{St as default};
//# sourceMappingURL=mod.js.map