-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrowser.js
More file actions
3 lines (3 loc) · 34.6 KB
/
Copy pathbrowser.js
File metadata and controls
3 lines (3 loc) · 34.6 KB
1
2
3
// Copyright (c) 2026 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
var r,e;r=this,e=function(){"use strict";var r="function"==typeof Object.defineProperty?Object.defineProperty:null,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,s=String.prototype.toLowerCase,l=String.prototype.toUpperCase,c=String.prototype.replace,h=/e\+(\d)$/,p=/e-(\d)$/,m=/^(\d+)$/,g=/^(\d+)e/,y=/\.0$/,w=/\.0*e/,b=/(\..*[^0])0*e/;function v(r,e){var t,n;switch(e.specifier){case"e":case"E":n=r.toExponential(e.precision);break;case"f":case"F":n=r.toFixed(e.precision);break;case"g":case"G":f(r)<1e-4?((t=e.precision)>0&&(t-=1),n=r.toExponential(t)):n=r.toPrecision(e.precision),e.alternate||(n=c.call(n,b,"$1e"),n=c.call(n,w,"e"),n=c.call(n,y,""));break;default:throw new Error("invalid double notation. Value: "+e.specifier)}return n=c.call(n,h,"e+0$1"),n=c.call(n,p,"e-0$1"),e.alternate&&(n=c.call(n,m,"$1."),n=c.call(n,g,"$1.e")),r>=0&&e.sign&&(n=e.sign+n),n=e.specifier===l.call(e.specifier)?l.call(n):s.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,n,o,a,f,s,l,c,h,p,m,g,y,w;if(!_(r))throw new TypeError("invalid argument. First argument must be an array. Value: `"+r+"`.");for(s="",l=1,h=0;h<r.length;h++)if("string"==typeof(o=r[h]))s+=o;else{if(e=void 0!==o.precision,!(o=x(o)).specifier)throw new TypeError("invalid argument. Token is missing `specifier` property. Index: `"+h+"`. Value: `"+o+"`.");for(o.mapping&&(l=o.mapping),n=o.flags,p=0;p<n.length;p++)switch(a=n.charAt(p)){case" ":o.sign=" ";break;case"+":o.sign="+";break;case"-":o.padRight=!0,o.padZeros=!1;break;case"0":o.padZeros=n.indexOf("-")<0;break;case"#":o.alternate=!0;break;default:throw new Error("invalid flag: "+a)}if("*"===o.width){if(o.width=parseInt(arguments[l],10),l+=1,T(o.width))throw new TypeError("the argument for * width at position "+l+" is not a number. Value: `"+o.width+"`.");o.width<0&&(o.padRight=!0,o.width=-o.width)}if(e&&"*"===o.precision){if(o.precision=parseInt(arguments[l],10),l+=1,T(o.precision))throw new TypeError("the argument for * precision at position "+l+" is not a number. Value: `"+o.precision+"`.");o.precision<0&&(o.precision=1,e=!1)}switch(o.arg=arguments[l],o.specifier){case"b":case"o":case"x":case"X":case"d":case"i":case"u":e&&(o.padZeros=!1),o.arg=u(o);break;case"s":o.maxWidth=e?o.precision:-1,o.arg=String(o.arg);break;case"c":if(!T(o.arg)){if((f=parseInt(o.arg,10))<0||f>127)throw new Error("invalid character code. Value: "+o.arg);o.arg=T(f)?String(o.arg):E(f)}break;case"e":case"E":case"f":case"F":case"g":case"G":if(e||(o.precision=6),c=parseFloat(o.arg),!isFinite(c)){if(!t(o.arg))throw new Error("invalid floating-point number. Value: "+s);c=o.arg,o.padZeros=!1}o.arg=v(c,o);break;default:throw new Error("invalid specifier: "+o.specifier)}o.maxWidth>=0&&o.arg.length>o.maxWidth&&(o.arg=o.arg.substring(0,o.maxWidth)),o.padZeros?o.arg=i(o.arg,o.width||o.precision,o.padRight):o.width&&(o.arg=(m=o.arg,g=o.width,y=o.padRight,w=void 0,(w=g-m.length)<0?m:m=y?m+d(w):d(w)+m)),s+=o.arg||"",l+=1}return s}var j=/%(?:([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 F(r){var e,t,n,i;for(t=[],i=0,n=j.exec(r);n;)(e=r.slice(i,j.lastIndex-n[0].length)).length&&t.push(e),"%"===n[6]?t.push("%"):t.push(S(n)),i=j.lastIndex,n=j.exec(r);return(e=r.slice(i)).length&&t.push(e),t}function A(r){var e,t;if("string"!=typeof r)throw new TypeError(A("invalid argument. First argument must be a string. Value: `%s`.",r));for(e=[F(r)],t=1;t<arguments.length;t++)e.push(arguments[t]);return V.apply(null,e)}var k,L=Object.prototype,O=L.toString,R=L.__defineGetter__,B=L.__defineSetter__,I=L.__lookupGetter__,C=L.__lookupSetter__;k=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]"===O.call(r))throw new TypeError(A("invalid argument. First argument must be an object. Value: `%s`.",r));if("object"!=typeof t||null===t||"[object Array]"===O.call(t))throw new TypeError(A("invalid argument. Property descriptor must be an object. Value: `%s`.",t));if((i="value"in t)&&(I.call(r,e)||C.call(r,e)?(n=r.__proto__,r.__proto__=L,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&&R&&R.call(r,e,t.get),a&&B&&B.call(r,e,t.set),r};var P=k;function M(r,e,t){P(r,e,{configurable:!1,enumerable:!1,writable:!1,value:t})}function N(r){return"number"==typeof r}var Y="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function $(){return Y&&"symbol"==typeof Symbol.toStringTag}var W=Object.prototype.toString,G=Object.prototype.hasOwnProperty;function Z(r,e){return null!=r&&G.call(r,e)}var U="function"==typeof Symbol?Symbol:void 0,X="function"==typeof U?U.toStringTag:"",J=$()?function(r){var e,t,n;if(null==r)return W.call(r);t=r[X],e=Z(r,X);try{r[X]=void 0}catch(e){return W.call(r)}return n=W.call(r),e?r[X]=t:delete r[X],n}:function(r){return W.call(r)},z=Number,q=z.prototype.toString,D=$();function H(r){return"object"==typeof r&&(r instanceof z||(D?function(r){try{return q.call(r),!0}catch(r){return!1}}(r):"[object Number]"===J(r)))}function K(r){return N(r)||H(r)}M(K,"isPrimitive",N),M(K,"isObject",H);var Q=Number.POSITIVE_INFINITY,rr=z.NEGATIVE_INFINITY,er=Math.floor;function tr(r){return er(r)===r}function nr(r){return r<Q&&r>rr&&tr(r)}function ir(r){return N(r)&&nr(r)}function or(r){return H(r)&&nr(r.valueOf())}function ar(r){return ir(r)||or(r)}function ur(r){return ir(r)&&r>=0}function fr(r){return or(r)&&r.valueOf()>=0}function sr(r){return ur(r)||fr(r)}M(ar,"isPrimitive",ir),M(ar,"isObject",or),M(sr,"isPrimitive",ur),M(sr,"isObject",fr);var lr=4294967295;function cr(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&tr(r.length)&&r.length>=0&&r.length<=lr}var hr=9007199254740991;function pr(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&tr(r.length)&&r.length>=0&&r.length<=hr}var mr="function"==typeof ArrayBuffer;function gr(r){return mr&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===J(r)}var yr=Array.isArray?Array.isArray:function(r){return"[object Array]"===J(r)};function wr(r){return"object"==typeof r&&null!==r&&!yr(r)}function br(r){if("function"!=typeof r)throw new TypeError(A("invalid argument. Must provide a function. Value: `%s`.",r));return function(e){var t,n;if(!yr(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}}function vr(r){return"string"==typeof r}var dr=String.prototype.valueOf,Er=$();function _r(r){return"object"==typeof r&&(r instanceof String||(Er?function(r){try{return dr.call(r),!0}catch(r){return!1}}(r):"[object String]"===J(r)))}function Tr(r){return vr(r)||_r(r)}M(Tr,"isPrimitive",vr),M(Tr,"isObject",_r);var xr=br(Tr.isPrimitive),Vr=br(Tr.isObject),jr=br(Tr);M(jr,"primitives",xr),M(jr,"objects",Vr);var Sr=/./;function Fr(r){return"boolean"==typeof r}var Ar=Boolean,kr=Boolean.prototype.toString,Lr=$();function Or(r){return"object"==typeof r&&(r instanceof Ar||(Lr?function(r){try{return kr.call(r),!0}catch(r){return!1}}(r):"[object Boolean]"===J(r)))}function Rr(r){return Fr(r)||Or(r)}M(Rr,"isPrimitive",Fr),M(Rr,"isObject",Or);var Br="object"==typeof self?self:null,Ir="object"==typeof window?window:null,Cr="object"==typeof globalThis?globalThis:null,Pr=function(r){if(arguments.length){if(!Fr(r))throw new TypeError(A("invalid argument. Must provide a boolean. Value: `%s`.",r));if(r)return new Function("return this;")()}if(Cr)return Cr;if(Br)return Br;if(Ir)return Ir;throw new Error("unexpected error. Unable to resolve global object.")}(),Mr=Pr.document&&Pr.document.childNodes,Nr=Int8Array;function Yr(){return/^\s*function\s*([^(]*)/i}var $r=/^\s*function\s*([^(]*)/i;function Wr(r){return null!==r&&"object"==typeof r}function Gr(r){var e,t,n,i;if(("Object"===(t=J(r).slice(8,-1))||"Error"===t)&&r.constructor){if("string"==typeof(n=r.constructor).name)return n.name;if(e=$r.exec(n.toString()))return e[1]}return Wr(i=r)&&(i._isBuffer||i.constructor&&"function"==typeof i.constructor.isBuffer&&i.constructor.isBuffer(i))?"Buffer":t}M(Yr,"REGEXP",$r),M(Wr,"isObjectLikeArray",br(Wr));var Zr="function"==typeof Sr||"object"==typeof Nr||"function"==typeof Mr?function(r){return Gr(r).toLowerCase()}:function(r){var e;return null===r?"null":"object"==(e=typeof r)?Gr(r).toLowerCase():e};function Ur(r){return"function"===Zr(r)}function Xr(r,e,t){P(r,e,{configurable:!1,enumerable:!0,writable:!1,value:t})}function Jr(r,e){if(!(this instanceof Jr))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!N(r))throw new TypeError(A("invalid argument. Real component must be a number. Value: `%s`.",r));if(!N(e))throw new TypeError(A("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return Xr(this,"re",r),Xr(this,"im",e),this}M(Jr,"name","Complex128"),M(Jr,"BYTES_PER_ELEMENT",8),M(Jr.prototype,"BYTES_PER_ELEMENT",8),M(Jr.prototype,"byteLength",16),M(Jr.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),M(Jr.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var zr="function"==typeof Math.fround?Math.fround:null,qr="function"==typeof Float32Array,Dr="function"==typeof Float32Array?Float32Array:null,Hr="function"==typeof Float32Array?Float32Array:void 0,Kr=function(){var r,e,t;if("function"!=typeof Dr)return!1;try{e=new Dr([1,3.14,-3.14,5e40]),t=e,r=(qr&&t instanceof Float32Array||"[object Float32Array]"===J(t))&&1===e[0]&&3.140000104904175===e[1]&&-3.140000104904175===e[2]&&e[3]===Q}catch(e){r=!1}return r}()?Hr:function(){throw new Error("not implemented")},Qr=new Kr(1),re="function"==typeof zr?zr:function(r){return Qr[0]=r,Qr[0]};function ee(r,e){if(!(this instanceof ee))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!N(r))throw new TypeError(A("invalid argument. Real component must be a number. Value: `%s`.",r));if(!N(e))throw new TypeError(A("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return Xr(this,"re",re(r)),Xr(this,"im",re(e)),this}function te(r){return r instanceof Jr||r instanceof ee||"object"==typeof r&&null!==r&&"number"==typeof r.re&&"number"==typeof r.im}function ne(r){return tr(r/2)}M(ee,"name","Complex64"),M(ee,"BYTES_PER_ELEMENT",4),M(ee.prototype,"BYTES_PER_ELEMENT",4),M(ee.prototype,"byteLength",8),M(ee.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),M(ee.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var ie=8,oe=16;function ae(){return"function"==typeof U&&"symbol"==typeof U("foo")&&Z(U,"iterator")&&"symbol"==typeof U.iterator}var ue=ae()?Symbol.iterator:null;function fe(r,e,t){P(r,e,{configurable:!1,enumerable:!1,get:t})}function se(r){return r.re}function le(r){return r.im}var ce="function"==typeof Float64Array,he="function"==typeof Float64Array?Float64Array:null,pe="function"==typeof Float64Array?Float64Array:void 0,me=function(){var r,e,t;if("function"!=typeof he)return!1;try{e=new he([1,3.14,-3.14,NaN]),t=e,r=(ce&&t instanceof Float64Array||"[object Float64Array]"===J(t))&&1===e[0]&&3.14===e[1]&&-3.14===e[2]&&e[3]!=e[3]}catch(e){r=!1}return r}()?pe:function(){throw new Error("not implemented")},ge={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]}},ye={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 we(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(cr(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!te(n))return new TypeError(A("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(se(n),le(n))}return e}var be=2*Kr.BYTES_PER_ELEMENT,ve=ae();function de(r){return r instanceof Te||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Ee(r){return r===Te||"Complex128Array"===r.name}function _e(r,e){return new ee(r[e*=2],r[e+1])}function Te(){var r,e,t,n,i,o,a;if(e=arguments.length,!(this instanceof Te))return 0===e?new Te:1===e?new Te(arguments[0]):2===e?new Te(arguments[0],arguments[1]):new Te(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Kr(0);else if(1===e)if(ur(arguments[0]))t=new Kr(2*arguments[0]);else if(pr(arguments[0]))if((n=(t=arguments[0]).length)&&yr(t)&&te(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;i<t;i++){if(!te(n=e[i]))return null;r[o]=se(n),r[o+1]=le(n),o+=2}return r}(new Kr(2*n),t),null===t){if(!ne(n))throw new RangeError(A("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new Kr(arguments[0])}}else{if("object"==typeof(a=t)&&null!==a&&"Complex64Array"===a.constructor.name&&a.BYTES_PER_ELEMENT===ie)o=0,t=new Kr((i=t).buffer,i.byteOffset+i.BYTES_PER_ELEMENT*o,2*(i.length-o));else if(function(r){return"object"==typeof r&&null!==r&&"Complex128Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===oe}(t))t=function(r,e){return new me(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*e,2*(r.length-e))}(t,0);else if(!ne(n))throw new RangeError(A("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new Kr(t)}else if(gr(arguments[0])){if(!tr((t=arguments[0]).byteLength/be))throw new RangeError(A("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",be,t.byteLength));t=new Kr(t)}else{if(!wr(arguments[0]))throw new TypeError(A("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));if(t=arguments[0],!1===ve)throw new TypeError(A("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",t));if(!Ur(t[ue]))throw new TypeError(A("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!Ur((t=t[ue]()).next))throw new TypeError(A("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if((t=we(t))instanceof Error)throw t;t=new Kr(t)}else{if(!gr(t=arguments[0]))throw new TypeError(A("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!ur(r=arguments[1]))throw new TypeError(A("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(!tr(r/be))throw new RangeError(A("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",be,r));if(2===e){if(!tr((n=t.byteLength-r)/be))throw new RangeError(A("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",be,n));t=new Kr(t,r)}else{if(!ur(n=arguments[2]))throw new TypeError(A("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*be>t.byteLength-r)throw new RangeError(A("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*be));t=new Kr(t,r,2*n)}}return M(this,"_buffer",t),M(this,"_length",t.length/2),this}return M(Te,"BYTES_PER_ELEMENT",be),M(Te,"name","Complex64Array"),M(Te,"from",(function(r){var e,t,n,i,o,a,u,f,s,l,c,h;if(!Ur(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Ee(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!Ur(n=arguments[1]))throw new TypeError(A("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(de(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,h=0,c=0;c<f;c++){if(te(l=n.call(e,r.get(c),c)))o[h]=se(l),o[h+1]=le(l);else{if(!(cr(l)&&l.length>=2))throw new TypeError(A("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[h]=l[0],o[h+1]=l[1]}h+=2}return i}return new this(r)}if(pr(r)){if(n){for(f=r.length,u=r.get&&r.set?function(r){var e=ye[r];return"function"==typeof e?e:ye.default}("default"):function(r){var e=ge[r];return"function"==typeof e?e:ge.default}("default"),c=0;c<f;c++)if(!te(u(r,c))){s=!0;break}if(s){if(!ne(f))throw new RangeError(A("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,c=0;c<f;c++)o[c]=n.call(e,u(r,c),c);return i}for(o=(i=new this(f))._buffer,h=0,c=0;c<f;c++){if(te(l=n.call(e,u(r,c),c)))o[h]=se(l),o[h+1]=le(l);else{if(!(cr(l)&&l.length>=2))throw new TypeError(A("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[h]=l[0],o[h+1]=l[1]}h+=2}return i}return new this(r)}if(wr(r)&&ve&&Ur(r[ue])){if(!Ur((o=r[ue]()).next))throw new TypeError(A("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,cr(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!te(o))return new TypeError(A("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(se(o),le(o))}return n}(o,n,e):we(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,c=0;c<f;c++)o[c]=a[c];return i}throw new TypeError(A("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))})),M(Te,"of",(function(){var r,e;if(!Ur(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Ee(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)})),M(Te.prototype,"at",(function(r){if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(r))throw new TypeError(A("invalid argument. Must provide an integer. Value: `%s`.",r));if(r<0&&(r+=this._length),!(r<0||r>=this._length))return _e(this._buffer,r)})),fe(Te.prototype,"buffer",(function(){return this._buffer.buffer})),fe(Te.prototype,"byteLength",(function(){return this._buffer.byteLength})),fe(Te.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),M(Te.prototype,"BYTES_PER_ELEMENT",Te.BYTES_PER_ELEMENT),M(Te.prototype,"copyWithin",(function(r,e){if(!de(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})),M(Te.prototype,"entries",(function(){var r,e,t,n,i,o;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,n=this._buffer,t=this._length,o=-1,M(e={},"next",(function(){return o+=1,i||o>=t?{done:!0}:{value:[o,_e(n,o)],done:!1}})),M(e,"return",(function(r){return i=!0,arguments.length?{value:r,done:!0}:{done:!0}})),ue&&M(e,ue,(function(){return r.entries()})),e})),M(Te.prototype,"every",(function(r,e){var t,n;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ur(r))throw new TypeError(A("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,_e(t,n),n,this))return!1;return!0})),M(Te.prototype,"fill",(function(r,e,t){var n,i,o,a,u,f;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!te(r))throw new TypeError(A("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(n=this._buffer,i=this._length,arguments.length>1){if(!tr(e))throw new TypeError(A("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!tr(t))throw new TypeError(A("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=se(r),u=le(r),f=e;f<t;f++)n[o=2*f]=a,n[o+1]=u;return this})),M(Te.prototype,"filter",(function(r,e){var t,n,i,o;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ur(r))throw new TypeError(A("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=_e(t,i),r.call(e,o,i,this)&&n.push(o);return new this.constructor(n)})),M(Te.prototype,"find",(function(r,e){var t,n,i;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ur(r))throw new TypeError(A("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=_e(t,n),r.call(e,i,n,this))return i})),M(Te.prototype,"findIndex",(function(r,e){var t,n,i;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ur(r))throw new TypeError(A("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=_e(t,n),r.call(e,i,n,this))return n;return-1})),M(Te.prototype,"findLast",(function(r,e){var t,n,i;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ur(r))throw new TypeError(A("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=_e(t,n),r.call(e,i,n,this))return i})),M(Te.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ur(r))throw new TypeError(A("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=_e(t,n),r.call(e,i,n,this))return n;return-1})),M(Te.prototype,"forEach",(function(r,e){var t,n,i;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ur(r))throw new TypeError(A("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)i=_e(t,n),r.call(e,i,n,this)})),M(Te.prototype,"get",(function(r){if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ur(r))throw new TypeError(A("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return _e(this._buffer,r)})),M(Te.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!te(r))throw new TypeError(A("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!tr(e))throw new TypeError(A("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=se(r),o=le(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return!0;return!1})),M(Te.prototype,"indexOf",(function(r,e){var t,n,i,o,a;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!te(r))throw new TypeError(A("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!tr(e))throw new TypeError(A("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=se(r),o=le(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),M(Te.prototype,"join",(function(r){var e,t,n,i;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!vr(r))throw new TypeError(A("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(_e(t,i).toString());return e.join(n)})),M(Te.prototype,"keys",(function(){var r,e,t,n,i;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,t=this._length,i=-1,M(e={},"next",(function(){return i+=1,n||i>=t?{done:!0}:{value:i,done:!1}})),M(e,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),ue&&M(e,ue,(function(){return r.keys()})),e})),M(Te.prototype,"lastIndexOf",(function(r,e){var t,n,i,o,a;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!te(r))throw new TypeError(A("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!tr(e))throw new TypeError(A("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=se(r),o=le(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),fe(Te.prototype,"length",(function(){return this._length})),M(Te.prototype,"map",(function(r,e){var t,n,i,o,a;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ur(r))throw new TypeError(A("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(te(a=r.call(e,_e(n,o),o,this)))t[2*o]=se(a),t[2*o+1]=le(a);else{if(!cr(a)||2!==a.length)throw new TypeError(A("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})),M(Te.prototype,"reduce",(function(r,e){var t,n,i,o;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ur(r))throw new TypeError(A("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=_e(t,0),o=1}for(;o<i;o++)n=r(n,_e(t,o),o,this);return n})),M(Te.prototype,"reduceRight",(function(r,e){var t,n,i,o;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ur(r))throw new TypeError(A("invalid argument. First argument must be a function. Value: `%s`.",r));if(t=this._buffer,i=this._length,arguments.length>1)n=e,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=_e(t,i-1),o=i-2}for(;o>=0;o--)n=r(n,_e(t,o),o,this);return n})),M(Te.prototype,"reverse",(function(){var r,e,t,n,i,o;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=this._buffer,n=er(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})),M(Te.prototype,"set",(function(r){var e,t,n,i,o,a,u,f,s;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!ur(t=arguments[1]))throw new TypeError(A("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(te(r)){if(t>=this._length)throw new RangeError(A("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=se(r),void(n[t+1]=le(r))}if(de(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,s=n.byteOffset+t*be,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new Kr(e.length),f=0;f<e.length;f++)i[f]=e[f];e=i}for(t*=2,s=0,f=0;f<a;f++)n[t]=e[s],n[t+1]=e[s+1],t+=2,s+=2}else{if(!pr(r))throw new TypeError(A("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(!te(r[f])){o=!0;break}if(o){if(!ne(a))throw new RangeError(A("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,s=n.byteOffset+t*be,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new Kr(a),f=0;f<a;f++)i[f]=e[f];e=i}for(t*=2,a/=2,s=0,f=0;f<a;f++)n[t]=e[s],n[t+1]=e[s+1],t+=2,s+=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]=se(u),n[t+1]=le(u),t+=2}})),M(Te.prototype,"slice",(function(r,e){var t,n,i,o,a,u,f;if(!de(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(!tr(r))throw new TypeError(A("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(!tr(e))throw new TypeError(A("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})),M(Te.prototype,"some",(function(r,e){var t,n;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ur(r))throw new TypeError(A("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,_e(t,n),n,this))return!0;return!1})),M(Te.prototype,"sort",(function(r){var e,t,n,i,o;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ur(r))throw new TypeError(A("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length,e=[],i=0;i<n;i++)e.push(_e(t,i));for(e.sort(r),i=0;i<n;i++)t[o=2*i]=se(e[i]),t[o+1]=le(e[i]);return this})),M(Te.prototype,"subarray",(function(r,e){var t,n,i;if(!de(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(!tr(r))throw new TypeError(A("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(!tr(e))throw new TypeError(A("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*be):(i=e-r,t=n.byteOffset+r*be),new this.constructor(n.buffer,t,i<0?0:i)})),M(Te.prototype,"toLocaleString",(function(r,e){var t,n,i,o,a;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!vr(r)&&!xr(r))throw new TypeError(A("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));n=r}if(arguments.length<2)t={};else{if(!wr(e))throw new TypeError(A("invalid argument. Options argument must be an object. Value: `%s`.",e));t=e}for(o=this._buffer,i=[],a=0;a<this._length;a++)i.push(_e(o,a).toLocaleString(n,t));return i.join(",")})),M(Te.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!de(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})),M(Te.prototype,"toSorted",(function(r){var e,t,n,i;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ur(r))throw new TypeError(A("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length,e=[],i=0;i<n;i++)e.push(_e(t,i));return e.sort(r),new Te(e)})),M(Te.prototype,"toString",(function(){var r,e,t;if(!de(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(_e(e,t).toString());return r.join(",")})),M(Te.prototype,"values",(function(){var r,e,t,n,i,o;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,i=this._buffer,t=this._length,o=-1,M(r={},"next",(function(){return o+=1,n||o>=t?{done:!0}:{value:_e(i,o),done:!1}})),M(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),ue&&M(r,ue,(function(){return e.values()})),r})),M(Te.prototype,"with",(function(r,e){var t,n,i;if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(r))throw new TypeError(A("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(A("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!te(e))throw new TypeError(A("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=se(e),t[2*r+1]=le(e),n})),function(r){return r instanceof Te||"Complex64Array"===Gr(r)}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).isComplex64Array=e();
//# sourceMappingURL=browser.js.map