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