-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrowser.js
3 lines (3 loc) · 100 KB
/
browser.js
1
2
3
// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).slice=r()}(this,(function(){"use strict";var t="function"==typeof Object.defineProperty?Object.defineProperty:null;var r=Object.defineProperty;function e(t){return"number"==typeof t}function n(t){var r,e="";for(r=0;r<t;r++)e+="0";return e}function i(t,r,e){var i=!1,o=r-t.length;return o<0||(function(t){return"-"===t[0]}(t)&&(i=!0,t=t.substr(1)),t=e?t+n(o):n(o)+t,i&&(t="-"+t)),t}var o=String.prototype.toLowerCase,a=String.prototype.toUpperCase;function u(t){var r,n,u;switch(t.specifier){case"b":r=2;break;case"o":r=8;break;case"x":case"X":r=16;break;default:r=10}if(n=t.arg,u=parseInt(n,10),!isFinite(u)){if(!e(n))throw new Error("invalid integer. Value: "+n);u=0}return u<0&&("u"===t.specifier||10!==r)&&(u=4294967295+u+1),u<0?(n=(-u).toString(r),t.precision&&(n=i(n,t.precision,t.padRight)),n="-"+n):(n=u.toString(r),u||t.precision?t.precision&&(n=i(n,t.precision,t.padRight)):n="",t.sign&&(n=t.sign+n)),16===r&&(t.alternate&&(n="0x"+n),n=t.specifier===a.call(t.specifier)?a.call(n):o.call(n)),8===r&&t.alternate&&"0"!==n.charAt(0)&&(n="0"+n),n}var f=Math.abs,s=String.prototype.toLowerCase,l=String.prototype.toUpperCase,h=String.prototype.replace,c=/e\+(\d)$/,p=/e-(\d)$/,g=/^(\d+)$/,y=/^(\d+)e/,m=/\.0$/,w=/\.0*e/,d=/(\..*[^0])0*e/;function v(t){var r,n,i=parseFloat(t.arg);if(!isFinite(i)){if(!e(t.arg))throw new Error("invalid floating-point number. Value: "+n);i=t.arg}switch(t.specifier){case"e":case"E":n=i.toExponential(t.precision);break;case"f":case"F":n=i.toFixed(t.precision);break;case"g":case"G":f(i)<1e-4?((r=t.precision)>0&&(r-=1),n=i.toExponential(r)):n=i.toPrecision(t.precision),t.alternate||(n=h.call(n,d,"$1e"),n=h.call(n,w,"e"),n=h.call(n,m,""));break;default:throw new Error("invalid double notation. Value: "+t.specifier)}return n=h.call(n,c,"e+0$1"),n=h.call(n,p,"e-0$1"),t.alternate&&(n=h.call(n,g,"$1."),n=h.call(n,y,"$1.e")),i>=0&&t.sign&&(n=t.sign+n),n=t.specifier===l.call(t.specifier)?l.call(n):s.call(n)}function b(t){var r,e="";for(r=0;r<t;r++)e+=" ";return e}var _=String.fromCharCode,E=isNaN,T=Array.isArray;function A(t){var r={};return r.specifier=t.specifier,r.precision=void 0===t.precision?1:t.precision,r.width=t.width,r.flags=t.flags||"",r.mapping=t.mapping,r}function x(t){var r,e,n,o,a,f,s,l,h,c,p,g,y;if(!T(t))throw new TypeError("invalid argument. First argument must be an array. Value: `"+t+"`.");for(f="",s=1,l=0;l<t.length;l++)if(n=t[l],"string"==typeof n)f+=n;else{if(r=void 0!==n.precision,!(n=A(n)).specifier)throw new TypeError("invalid argument. Token is missing `specifier` property. Index: `"+l+"`. Value: `"+n+"`.");for(n.mapping&&(s=n.mapping),e=n.flags,h=0;h<e.length;h++)switch(o=e.charAt(h)){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: "+o)}if("*"===n.width){if(n.width=parseInt(arguments[s],10),s+=1,E(n.width))throw new TypeError("the argument for * width at position "+s+" is not a number. Value: `"+n.width+"`.");n.width<0&&(n.padRight=!0,n.width=-n.width)}if(r&&"*"===n.precision){if(n.precision=parseInt(arguments[s],10),s+=1,E(n.precision))throw new TypeError("the argument for * precision at position "+s+" is not a number. Value: `"+n.precision+"`.");n.precision<0&&(n.precision=1,r=!1)}switch(n.arg=arguments[s],n.specifier){case"b":case"o":case"x":case"X":case"d":case"i":case"u":r&&(n.padZeros=!1),n.arg=u(n);break;case"s":n.maxWidth=r?n.precision:-1;break;case"c":if(!E(n.arg)){if((a=parseInt(n.arg,10))<0||a>127)throw new Error("invalid character code. Value: "+n.arg);n.arg=E(a)?String(n.arg):_(a)}break;case"e":case"E":case"f":case"F":case"g":case"G":r||(n.precision=6),n.arg=v(n);break;default:throw new Error("invalid specifier: "+n.specifier)}n.maxWidth>=0&&n.arg.length>n.maxWidth&&(n.arg=n.arg.substring(0,n.maxWidth)),n.padZeros?n.arg=i(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=(c=n.arg,p=n.width,g=n.padRight,y=void 0,(y=p-c.length)<0?c:c=g?c+b(y):b(y)+c)),f+=n.arg||"",s+=1}return f}var R=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function O(t){var r={mapping:t[1]?parseInt(t[1],10):void 0,flags:t[2],width:t[3],precision:t[5],specifier:t[6]};return"."===t[4]&&void 0===t[5]&&(r.precision="1"),r}function S(t){var r,e,n,i;for(e=[],i=0,n=R.exec(t);n;)(r=t.slice(i,R.lastIndex-n[0].length)).length&&e.push(r),e.push(O(n)),i=R.lastIndex,n=R.exec(t);return(r=t.slice(i)).length&&e.push(r),e}function V(t){var r,e;if("string"!=typeof t)throw new TypeError(V("invalid argument. First argument must be a string. Value: `%s`.",t));for(r=[S(t)],e=1;e<arguments.length;e++)r.push(arguments[e]);return x.apply(null,r)}var j,I=Object.prototype,U=I.toString,B=I.__defineGetter__,L=I.__defineSetter__,P=I.__lookupGetter__,F=I.__lookupSetter__;j=function(){try{return t({},"x",{}),!0}catch(t){return!1}}()?r:function(t,r,e){var n,i,o,a;if("object"!=typeof t||null===t||"[object Array]"===U.call(t))throw new TypeError(V("invalid argument. First argument must be an object. Value: `%s`.",t));if("object"!=typeof e||null===e||"[object Array]"===U.call(e))throw new TypeError(V("invalid argument. Property descriptor must be an object. Value: `%s`.",e));if((i="value"in e)&&(P.call(t,r)||F.call(t,r)?(n=t.__proto__,t.__proto__=I,delete t[r],t[r]=e.value,t.__proto__=n):t[r]=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&&B&&B.call(t,r,e.get),a&&L&&L.call(t,r,e.set),t};var M=j;function C(t,r,e){M(t,r,{configurable:!1,enumerable:!1,writable:!1,value:e})}function N(t){return"boolean"==typeof t}var k="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function Y(){return k&&"symbol"==typeof Symbol.toStringTag}var D=Object.prototype.toString;var J=Object.prototype.hasOwnProperty;function W(t,r){return null!=t&&J.call(t,r)}var G="function"==typeof Symbol?Symbol:void 0,z="function"==typeof G?G.toStringTag:"";var $=Y()?function(t){var r,e,n;if(null==t)return D.call(t);e=t[z],r=W(t,z);try{t[z]=void 0}catch(r){return D.call(t)}return n=D.call(t),r?t[z]=e:delete t[z],n}:function(t){return D.call(t)},X=Boolean,Z=Boolean.prototype.toString;var H=Y();function q(t){return"object"==typeof t&&(t instanceof X||(H?function(t){try{return Z.call(t),!0}catch(t){return!1}}(t):"[object Boolean]"===$(t)))}function K(t){return N(t)||q(t)}C(K,"isPrimitive",N),C(K,"isObject",q);var Q="object"==typeof self?self:null,tt="object"==typeof window?window:null,rt="object"==typeof globalThis?globalThis:null;function et(t){if(arguments.length){if(!N(t))throw new TypeError(V("invalid argument. Must provide a boolean. Value: `%s`.",t));if(t)return new Function("return this;")()}if(rt)return rt;if(Q)return Q;if(tt)return tt;throw new Error("unexpected error. Unable to resolve global object.")}var nt=et();function it(t,r,e){M(t,r,{configurable:!1,enumerable:!1,get:e})}var ot={binary:1,bool:1,complex64:8,complex128:16,float16:2,bfloat16:2,float32:4,float64:8,float128:16,generic:null,int8:1,int16:2,int32:4,int64:8,int128:16,int256:32,uint8:1,uint8c:1,uint16:2,uint32:4,uint64:8,uint128:16,uint256:32};function at(t){return Math.abs(t)}function ut(t){var r,e,n,i,o,a;if(0===(e=t.length))return 0;for(r=!0,n=!0,i=at(t[0]),a=1;a<e;a++){if(o=at(t[a]),r&&o<i?r=!1:n&&o>i&&(n=!1),!n&&!r)return 0;i=o}return n&&r?3:n?1:2}function ft(t,r){return r&&(2===t||3===t)}function st(t,r){return r&&(1===t||3===t)}function lt(t,r,e){var n,i,o,a,u;for(n=t.length,i=e,o=e,u=0;u<n;u++){if(0===t[u])return[e,e];(a=r[u])>0?o+=a*(t[u]-1):a<0&&(i+=a*(t[u]-1))}return[i,o]}function ht(t){return t.re}function ct(t){return t.im}function pt(t){return"string"==typeof t}C(lt,"assign",(function(t,r,e,n){var i,o,a,u,f;for(i=t.length,o=e,a=e,f=0;f<i;f++){if(0===t[f])return n[0]=e,n[1]=e,n;(u=r[f])>0?a+=u*(t[f]-1):u<0&&(o+=u*(t[f]-1))}return n[0]=o,n[1]=a,n}));var gt=String.prototype.valueOf;var yt=Y();function mt(t){return"object"==typeof t&&(t instanceof String||(yt?function(t){try{return gt.call(t),!0}catch(t){return!1}}(t):"[object String]"===$(t)))}function wt(t){return pt(t)||mt(t)}C(wt,"isPrimitive",pt),C(wt,"isObject",mt);var dt=/[-\/\\^$*+?.()|[\]{}]/g;var vt=/./,bt=et(),_t=bt.document&&bt.document.childNodes,Et=Int8Array;function Tt(){return/^\s*function\s*([^(]*)/i}var At=/^\s*function\s*([^(]*)/i;C(Tt,"REGEXP",At);var xt=Array.isArray?Array.isArray:function(t){return"[object Array]"===$(t)};function Rt(t){return null!==t&&"object"==typeof t}function Ot(t){var r,e,n,i;if(("Object"===(e=$(t).slice(8,-1))||"Error"===e)&&t.constructor){if("string"==typeof(n=t.constructor).name)return n.name;if(r=At.exec(n.toString()))return r[1]}return Rt(i=t)&&(i._isBuffer||i.constructor&&"function"==typeof i.constructor.isBuffer&&i.constructor.isBuffer(i))?"Buffer":e}C(Rt,"isObjectLikeArray",function(t){if("function"!=typeof t)throw new TypeError(V("invalid argument. Must provide a function. Value: `%s`.",t));return function(r){var e,n;if(!xt(r))return!1;if(0===(e=r.length))return!1;for(n=0;n<e;n++)if(!1===t(r[n]))return!1;return!0}}(Rt));var St="function"==typeof vt||"object"==typeof Et||"function"==typeof _t?function(t){return Ot(t).toLowerCase()}:function(t){var r;return null===t?"null":"object"===(r=typeof t)?Ot(t).toLowerCase():r};function Vt(t){return"function"===St(t)}var jt=RegExp.prototype.exec;var It=Y();function Ut(t){return"object"==typeof t&&(t instanceof RegExp||(It?function(t){try{return jt.call(t),!0}catch(t){return!1}}(t):"[object RegExp]"===$(t)))}function Bt(t,r,e){if(!pt(t))throw new TypeError(V("invalid argument. First argument must be a string. Value: `%s`.",t));if(pt(r))r=new RegExp(function(t){var r,e;if(!pt(t))throw new TypeError(V("invalid argument. Must provide a regular expression string. Value: `%s`.",t));if("/"===t[0])for(e=t.length-1;e>=0&&"/"!==t[e];e--);return void 0===e||e<=0?t.replace(dt,"\\$&"):(r=(r=t.substring(1,e)).replace(dt,"\\$&"),t=t[0]+r+t.substring(e))}(r),"g");else if(!Ut(r))throw new TypeError(V("invalid argument. Second argument must be a string or regular expression. Value: `%s`.",r));if(!pt(e)&&!Vt(e))throw new TypeError(V("invalid argument. Third argument must be a string or replacement function. Value: `%s`.",e));return function(t,r,e){return t.replace(r,e)}(t,r,e)}var Lt={int8:"new Int8Array( [ {{data}} ] )",uint8:"new Uint8Array( [ {{data}} ] )",uint8c:"new Uint8ClampedArray( [ {{data}} ] )",int16:"new Int16Array( [ {{data}} ] )",uint16:"new Uint16Array( [ {{data}} ] )",int32:"new Int32Array( [ {{data}} ] )",uint32:"new Uint32Array( [ {{data}} ] )",float32:"new Float32Array( [ {{data}} ] )",float64:"new Float64Array( [ {{data}} ] )",generic:"[ {{data}} ]",binary:"new Buffer( [ {{data}} ] )",complex64:"new Complex64Array( [ {{data}} ] )",complex128:"new Complex128Array( [ {{data}} ] )"};var Pt="function"==typeof Uint8Array;var Ft="function"==typeof Uint8Array?Uint8Array:null;var Mt,Ct="function"==typeof Uint8Array?Uint8Array:void 0;Mt=function(){var t,r,e;if("function"!=typeof Ft)return!1;try{r=new Ft(r=[1,3.14,-3.14,256,257]),e=r,t=(Pt&&e instanceof Uint8Array||"[object Uint8Array]"===$(e))&&1===r[0]&&3===r[1]&&253===r[2]&&0===r[3]&&1===r[4]}catch(r){t=!1}return t}()?Ct:function(){throw new Error("not implemented")};var Nt=Mt,kt="function"==typeof Uint16Array;var Yt="function"==typeof Uint16Array?Uint16Array:null;var Dt,Jt="function"==typeof Uint16Array?Uint16Array:void 0;Dt=function(){var t,r,e;if("function"!=typeof Yt)return!1;try{r=new Yt(r=[1,3.14,-3.14,65536,65537]),e=r,t=(kt&&e instanceof Uint16Array||"[object Uint16Array]"===$(e))&&1===r[0]&&3===r[1]&&65533===r[2]&&0===r[3]&&1===r[4]}catch(r){t=!1}return t}()?Jt:function(){throw new Error("not implemented")};var Wt,Gt=Dt,zt={uint16:Gt,uint8:Nt};(Wt=new zt.uint16(1))[0]=4660;var $t=52===new zt.uint8(Wt.buffer)[0],Xt="function"==typeof ArrayBuffer;function Zt(t){return Xt&&t instanceof ArrayBuffer||"[object ArrayBuffer]"===$(t)}var Ht="function"==typeof Float64Array;var qt="function"==typeof Float64Array?Float64Array:null;var Kt,Qt="function"==typeof Float64Array?Float64Array:void 0;Kt=function(){var t,r,e;if("function"!=typeof qt)return!1;try{r=new qt([1,3.14,-3.14,NaN]),e=r,t=(Ht&&e instanceof Float64Array||"[object Float64Array]"===$(e))&&1===r[0]&&3.14===r[1]&&-3.14===r[2]&&r[3]!=r[3]}catch(r){t=!1}return t}()?Qt:function(){throw new Error("not implemented")};var tr=Kt,rr="function"==typeof ArrayBuffer?ArrayBuffer:null;var er,nr="function"==typeof ArrayBuffer?ArrayBuffer:void 0;er=function(){var t,r,e;if("function"!=typeof rr)return!1;try{(t=Zt(e=new rr(16))&&"function"==typeof rr.isView)&&((r=new tr(e))[0]=-3.14,r[1]=NaN,t=t&&rr.isView(r)&&16===e.byteLength&&-3.14===r[0]&&r[1]!=r[1])}catch(r){t=!1}return t}()?nr:function(){throw new Error("not implemented")};var ir=er,or="function"==typeof DataView;var ar="function"==typeof DataView?DataView:null;var ur,fr="function"==typeof DataView?DataView:void 0;ur=function(){var t,r,e,n;if("function"!=typeof ar)return!1;try{e=new ir(24),r=new ar(e,8),n=r,(t=(or&&n instanceof DataView||"[object DataView]"===$(n))&&"function"==typeof r.getFloat64&&"function"==typeof r.setFloat64)&&(r.setFloat64(0,-3.14),r.setFloat64(8,NaN),t=t&&r.buffer===e&&16===r.byteLength&&8===r.byteOffset&&-3.14===r.getFloat64(0)&&r.getFloat64(8)!=r.getFloat64(8))}catch(r){t=!1}return t}()?fr:function(){throw new Error("not implemented")};var sr=ur,lr="function"==typeof BigInt?BigInt:void 0,hr={all:["binary","complex64","complex128","float32","float64","generic","int16","int32","int8","uint16","uint32","uint8","uint8c"],typed:["binary","complex64","complex128","float32","float64","int16","int32","int8","uint16","uint32","uint8","uint8c"],floating_point:["complex64","complex128","float32","float64"],real_floating_point:["float32","float64"],complex_floating_point:["complex64","complex128"],integer:["int16","int32","int8","uint16","uint32","uint8","uint8c"],signed_integer:["int16","int32","int8"],unsigned_integer:["uint16","uint32","uint8","uint8c"],real:["float32","float64","int16","int32","int8","uint16","uint32","uint8","uint8c"],numeric:["complex64","complex128","float32","float64","int16","int32","int8","uint16","uint32","uint8","uint8c"]};function cr(){var t;return 0===arguments.length?hr.all.slice():(t=hr[arguments[0]])?t.slice():[]}function pr(){return{bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256}}function gr(t,r,e){M(t,r,{configurable:!1,enumerable:!0,writable:!1,value:e})}function yr(t){return Object.keys(Object(t))}var mr,wr=void 0!==Object.keys;function dr(t){return"[object Arguments]"===$(t)}mr=function(){return dr(arguments)}();var vr=mr;function br(t){return"number"==typeof t}var _r=Number,Er=_r.prototype.toString;var Tr=Y();function Ar(t){return"object"==typeof t&&(t instanceof _r||(Tr?function(t){try{return Er.call(t),!0}catch(t){return!1}}(t):"[object Number]"===$(t)))}function xr(t){return br(t)||Ar(t)}function Rr(t){return t!=t}function Or(t){return br(t)&&Rr(t)}function Sr(t){return Ar(t)&&Rr(t.valueOf())}function Vr(t){return Or(t)||Sr(t)}C(xr,"isPrimitive",br),C(xr,"isObject",Ar),C(Vr,"isPrimitive",Or),C(Vr,"isObject",Sr);var jr=Number.POSITIVE_INFINITY,Ir=_r.NEGATIVE_INFINITY,Ur=Math.floor;function Br(t){return Ur(t)===t}function Lr(t){return t<jr&&t>Ir&&Br(t)}function Pr(t){return br(t)&&Lr(t)}function Fr(t){return Ar(t)&&Lr(t.valueOf())}function Mr(t){return Pr(t)||Fr(t)}C(Mr,"isPrimitive",Pr),C(Mr,"isObject",Fr);var Cr=Object.prototype.propertyIsEnumerable;var Nr=!Cr.call("beep","0");function kr(t,r){var e;return null!=t&&(!(e=Cr.call(t,r))&&Nr&&wt(t)?!Or(r=+r)&&Pr(r)&&r>=0&&r<t.length:e)}var Yr=4294967295;var Dr=vr?dr:function(t){return null!==t&&"object"==typeof t&&!xt(t)&&"number"==typeof t.length&&Br(t.length)&&t.length>=0&&t.length<=Yr&&W(t,"callee")&&!kr(t,"callee")},Jr=Array.prototype.slice;var Wr=kr((function(){}),"prototype"),Gr=!kr({toString:null},"toString"),zr=9007199254740991;function $r(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&Br(t.length)&&t.length>=0&&t.length<=zr}function Xr(t,r,e){var n,i;if(!$r(t)&&!pt(t))throw new TypeError(V("invalid argument. First argument must be an array-like object. Value: `%s`.",t));if(0===(n=t.length))return-1;if(3===arguments.length){if(!Pr(e))throw new TypeError(V("invalid argument. Third argument must be an integer. Value: `%s`.",e));if(e>=0){if(e>=n)return-1;i=e}else(i=n+e)<0&&(i=0)}else i=0;if(Vr(r)){for(;i<n;i++)if(Vr(t[i]))return i}else for(;i<n;i++)if(t[i]===r)return i;return-1}function Zr(t){return t.constructor&&t.constructor.prototype===t}var Hr=["console","external","frame","frameElement","frames","innerHeight","innerWidth","outerHeight","outerWidth","pageXOffset","pageYOffset","parent","scrollLeft","scrollTop","scrollX","scrollY","self","webkitIndexedDB","webkitStorageInfo","window"],qr="undefined"==typeof window?void 0:window;var Kr=function(){var t;if("undefined"===St(qr))return!1;for(t in qr)try{-1===Xr(Hr,t)&&W(qr,t)&&null!==qr[t]&&"object"===St(qr[t])&&Zr(qr[t])}catch(t){return!0}return!1}(),Qr="undefined"!=typeof window;var te,re=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];te=wr?function(){return 2!==(yr(arguments)||"").length}(1,2)?function(t){return Dr(t)?yr(Jr.call(t)):yr(t)}:yr:function(t){var r,e,n,i,o,a,u;if(i=[],Dr(t)){for(u=0;u<t.length;u++)i.push(u.toString());return i}if("string"==typeof t){if(t.length>0&&!W(t,"0"))for(u=0;u<t.length;u++)i.push(u.toString())}else{if(!1==(n="function"==typeof t)&&!Rt(t))return i;e=Wr&&n}for(o in t)e&&"prototype"===o||!W(t,o)||i.push(String(o));if(Gr)for(r=function(t){if(!1===Qr&&!Kr)return Zr(t);try{return Zr(t)}catch(t){return!1}}(t),u=0;u<re.length;u++)a=re[u],r&&"constructor"===a||!W(t,a)||i.push(String(a));return i};var ee=te;C(cr,"enum",pr),function(t,r){var e,n,i;for(e=ee(r),i=0;i<e.length;i++)gr(t,n=e[i],r[n])}(cr,{bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256});var ne=["row-major","column-major"];function ie(){return{"row-major":1,"column-major":2}}C((function(){return ne.slice()}),"enum",ie);var oe=["throw","normalize","clamp","wrap"];function ae(){return{throw:1,clamp:2,wrap:3,normalize:4}}C((function(){return oe.slice()}),"enum",ae);var ue={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256},fe={"row-major":1,"column-major":2},se={throw:1,clamp:2,wrap:3,normalize:4};var le=4294967295,he=4294967296,ce=new Nt(8),pe=new sr(ce.buffer);function ge(t,r,e,n){var i,o,a;if(0===t){for(a=0;a<ce.length;a++)r[n]=0,n+=e;return r}for(o=(t&le)>>>0,i=Ur(t/he),$t?(pe.setUint32(0,o,$t),pe.setUint32(4,i,$t)):(pe.setUint32(0,i,$t),pe.setUint32(4,o,$t)),a=0;a<ce.length;a++)r[n]=ce[a],n+=e;return r}C((function(t){var r,e,n,i;return r=new Nt(8),0===t||(i=(4294967295&t)>>>0,n=Ur(t/4294967296),e=new sr(r.buffer),$t?(e.setUint32(0,i,$t),e.setUint32(4,n,$t)):(e.setUint32(0,n,$t),e.setUint32(4,i,$t))),r}),"assign",ge);var ye={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256},me={"row-major":1,"column-major":2},we={throw:1,clamp:2,wrap:3,normalize:4};function de(t,r,e,n,i,o){var a,u,f,s,l;if(!(this instanceof de))return new de(t,r,e,n,i,o);for(s=1,l=0;l<e.length;l++)s*=e[l];return u=r.BYTES_PER_ELEMENT?r.BYTES_PER_ELEMENT*s:null,this._byteLength=u,this._bytesPerElement=function(t){return ot[t]||null}(t),this._buffer=r,this._dtype=t,this._length=s,this._ndims=e.length,this._offset=i,this._order=o,this._shape=e,this._strides=n,this._accessors=X(r.get&&r.set),this._iterationOrder=function(t){var r,e;for(r=0,e=0;e<t.length;e++)t[e]<0&&(r+=1);return 0===r?1:r===t.length?-1:0}(n),a=function(t,r,e,n,i){var o;return 0!==t&&0!==i&&t===(o=lt(r,e,n))[1]-o[0]+1}(s,e,n,i,this._iterationOrder),f=ut(n),this._flags={ROW_MAJOR_CONTIGUOUS:st(f,a),COLUMN_MAJOR_CONTIGUOUS:ft(f,a),READONLY:!1},this.__meta_dataview__=null,this}function ve(t){return null===t}function be(t){return void 0===t}function _e(t){return Pr(t)||ve(t)||be(t)}function Ee(){var t,r,e,n;if(0===(t=arguments.length)?(r=null,e=null,n=null):1===t?(r=null,e=arguments[0],n=null):2===t?(r=arguments[0],e=arguments[1],n=null):(r=arguments[0],e=arguments[1],n=arguments[2]),!(this instanceof Ee))return new Ee(r,e,n);if(!_e(r))throw new TypeError(V("invalid argument. First argument must be an integer, null, or undefined. Value: `%s`.",r));if(!_e(e))throw new TypeError(V("invalid argument. Second argument must be an integer, null, or undefined. Value: `%s`.",e));if(!_e(n))throw new TypeError(V("invalid argument. Third argument must be an integer, null, or undefined. Value: `%s`.",n));if(0===n)throw new RangeError(V("invalid argument. Third argument cannot be zero. Value: `%s`.",n));return this._start=void 0===r?null:r,this._stop=void 0===e?null:e,this._step=void 0===n?null:n,this}function Te(t){return Pr(t)||ve(t)||be(t)||function(t){return t instanceof Ee||"Slice"===Ot(t)}(t)}function Ae(){var t,r,e,n,i;if(t=arguments.length,!(this instanceof Ae)){if(1===t)return new Ae(arguments[0]);if(2===t)return new Ae(arguments[0],arguments[1]);if(3===t)return new Ae(arguments[0],arguments[1],arguments[2]);if(4===t)return new Ae(arguments[0],arguments[1],arguments[2],arguments[3]);if(5===t)return new Ae(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]);for(e=[],i=0;i<t;i++)e.push(arguments[i]);return r=Object.create(Ae.prototype),Ae.apply(r,e)}for(this._data=[],i=0;i<t;i++){if(!Te(n=arguments[i]))throw new TypeError(V("invalid argument. Provided arguments must be either a Slice, integer, null, or undefined. Argument: `%d`. Value: `%s`.",i,String(n)));this._data.push(void 0===n?null:n)}return this}C(de,"name","ndarray"),it(de.prototype,"byteLength",(function(){return this._byteLength})),it(de.prototype,"BYTES_PER_ELEMENT",(function(){return this._bytesPerElement})),it(de.prototype,"data",(function(){return this._buffer})),it(de.prototype,"dtype",(function(){return this._dtype})),it(de.prototype,"flags",(function(){return{ROW_MAJOR_CONTIGUOUS:(t=this._flags).ROW_MAJOR_CONTIGUOUS,COLUMN_MAJOR_CONTIGUOUS:t.COLUMN_MAJOR_CONTIGUOUS,READONLY:t.READONLY};var t})),it(de.prototype,"length",(function(){return this._length})),it(de.prototype,"ndims",(function(){return this._ndims})),it(de.prototype,"offset",(function(){return this._offset})),it(de.prototype,"order",(function(){return this._order})),it(de.prototype,"shape",(function(){return this._shape.slice()})),it(de.prototype,"strides",(function(){return this._strides.slice()})),C(de.prototype,"get",(function(){var t,r;for(t=this._offset,r=0;r<arguments.length;r++)t+=this._strides[r]*arguments[r];return this._accessors?this._buffer.get(t):this._buffer[t]})),C(de.prototype,"iget",(function(t){var r,e,n,i,o,a;if(0===(n=this._ndims))return this._accessors?this._buffer.get(this._offset):this._buffer[this._offset];if(this._flags.ROW_MAJOR_CONTIGUOUS||this._flags.COLUMN_MAJOR_CONTIGUOUS){if(1===this._iterationOrder)return this._accessors?this._buffer.get(this._offset+t):this._buffer[this._offset+t];if(-1===this._iterationOrder)return this._accessors?this._buffer.get(this.offset-t):this._buffer[this._offset-t]}if(e=this._shape,r=this._strides,i=this._offset,"column-major"===this._order){for(a=0;a<n;a++)t-=o=t%e[a],t/=e[a],i+=o*r[a];return this._accessors?this._buffer.get(i):this._buffer[i]}for(a=n-1;a>=0;a--)t-=o=t%e[a],t/=e[a],i+=o*r[a];return this._accessors?this._buffer.get(i):this._buffer[i]})),C(de.prototype,"set",(function(){var t,r;for(t=this._offset,r=0;r<arguments.length-1;r++)t+=this._strides[r]*arguments[r];return this._accessors?this._buffer.set(arguments[r],t):this._buffer[t]=arguments[r],this})),C(de.prototype,"iset",(function(t,r){var e,n,i,o,a,u;if(0===(i=this._ndims))return this._accessors?this._buffer.set(t,this._offset):this._buffer[this._offset]=t,this;if(this._flags.ROW_MAJOR_CONTIGUOUS||this._flags.COLUMN_MAJOR_CONTIGUOUS){if(1===this._iterationOrder)return this._accessors?this._buffer.set(r,this._offset+t):this._buffer[this._offset+t]=r,this;if(-1===this._iterationOrder)return this._accessors?this._buffer.set(r,this._offset-t):this._buffer[this._offset-t]=r,this}if(n=this._shape,e=this._strides,o=this._offset,"column-major"===this._order){for(u=0;u<i;u++)t-=a=t%n[u],t/=n[u],o+=a*e[u];return this._accessors?this._buffer.set(r,o):this._buffer[o]=r,this}for(u=i-1;u>=0;u--)t-=a=t%n[u],t/=n[u],o+=a*e[u];return this._accessors?this._buffer.set(r,o):this._buffer[o]=r,this})),C(de.prototype,"toString",(function(){var t,r,e,n,i,o;if(r=this._shape.length,e="ndarray( '"+(n=this._dtype)+"', ",t="",this._length<=100)if("complex64"===n||"complex128"===n)for(o=0;o<this._length;o++)t+=ht(i=this.iget(o))+", "+ct(i),o<this._length-1&&(t+=", ");else for(o=0;o<this._length;o++)t+=this.iget(o),o<this._length-1&&(t+=", ");else{if("complex64"===n||"complex128"===n)for(o=0;o<3;o++)t+=ht(i=this.iget(o))+", "+ct(i),o<2&&(t+=", ");else for(o=0;o<3;o++)t+=this.iget(o),o<2&&(t+=", ");if(t+=", ..., ","complex64"===n||"complex128"===n)for(o=2;o>=0;o--)t+=ht(i=this.iget(this._length-1-o))+", "+ct(i),o>0&&(t+=", ");else for(o=2;o>=0;o--)t+=this.iget(this._length-1-o),o>0&&(t+=", ")}if(e+=Bt(Lt[this.dtype],"{{data}}",t),e+=", ",e+=0===r?"[]":"[ "+this._shape.join(", ")+" ]",e+=", ",e+="[ ",0===r)e+="0";else for(o=0;o<r;o++)this._strides[o]<0?e+=-this._strides[o]:e+=this._strides[o],o<r-1&&(e+=", ");return e+=" ]",e+=", ",e+="0",e+=", ",e+="'"+this._order+"'",e+=" )"})),C(de.prototype,"toJSON",(function(){var t,r,e,n;for(r=this._length,(t={}).type="ndarray",t.dtype=this.dtype,t.flags={READONLY:this._flags.READONLY},t.order=this._order,t.shape=this._shape.slice(),t.strides=this._strides.slice(),n=0;n<r;n++)t.strides[n]<0&&(t.strides[n]*=-1);if(t.data=[],"complex64"===t.dtype||"complex128"===t.dtype)for(n=0;n<r;n++)e=this.iget(n),t.data.push(ht(e),ct(e));else for(n=0;n<r;n++)t.data.push(this.iget(n));return t})),C(de.prototype,"__array_meta_dataview__","function"==typeof nt.BigInt&&"function"==typeof BigInt&&"bigint"==typeof nt.BigInt("1")&&"bigint"==typeof BigInt("1")?function(){var t,r,e,n,i,o,a,u,f,s,l,h,c,p;if(f=this._mode||"throw",a=this._submode||[f],e=33+16*(h=this._ndims)+(c=a.length),(u=this.__meta_dataview__)&&u.byteLength===e)return u;for(u=new sr(new ir(e)),i=this._shape,o=this._strides,n=this._dtype,t=this._bytesPerElement,s=0,u.setInt8(s,$t?1:0),s+=1,u.setInt16(s,ue[n],$t),s+=2,u.setBigInt64(s,lr(h),$t),l=8*h,s+=8,p=0;p<h;p++)u.setBigInt64(s,lr(i[p]),$t),u.setBigInt64(s+l,lr(o[p]*t),$t),s+=8;for(s+=l,u.setBigInt64(s,lr(this._offset*t),$t),s+=8,u.setInt8(s,fe[this._order]),s+=1,u.setInt8(s,se[f]),s+=1,u.setBigInt64(s,lr(c),$t),s+=8,p=0;p<c;p++)u.setInt8(s,se[a[p]]),s+=1;return r=0,r|=this._flags.READONLY?4:0,u.setInt32(s,r,$t),this.__meta_dataview__=u,u}:function(){var t,r,e,n,i,o,a,u,f,s,l,h,c,p,g;if(s=this._mode||"throw",u=this._submode||[s],n=33+16*(c=this._ndims)+(p=u.length),(f=this.__meta_dataview__)&&f.byteLength===n)return f;for(f=new sr(new ir(n)),r=new Nt(f.buffer),o=this._shape,a=this._strides,i=this._dtype,t=this._bytesPerElement,l=0,f.setInt8(l,$t?1:0),l+=1,f.setInt16(l,ye[i],$t),ge(c,r,1,l+=2),h=8*c,l+=8,g=0;g<c;g++)ge(o[g],r,1,l),ge(a[g]*t,r,1,l+h),l+=8;for(l+=h,ge(this._offset*t,r,1,l),l+=8,f.setInt8(l,me[this._order]),l+=1,f.setInt8(l,we[s]),ge(p,r,1,l+=1),l+=8,g=0;g<p;g++)f.setInt8(l,we[u[g]]),l+=1;return e=0,e|=this._flags.READONLY?4:0,f.setInt32(l,e,$t),this.__meta_dataview__=f,f}),C(Ee,"name","Slice"),it(Ee.prototype,"start",(function(){return this._start})),it(Ee.prototype,"stop",(function(){return this._stop})),it(Ee.prototype,"step",(function(){return this._step})),C(Ee.prototype,"toString",(function(){return"Slice("+this._start+","+this._stop+","+this.step+")"})),C(Ee.prototype,"toJSON",(function(){return{type:"Slice",data:[this._start,this._stop,this._step]}})),C(Ae,"name","MultiSlice"),it(Ae.prototype,"ndims",(function(){return this._data.length})),it(Ae.prototype,"data",(function(){return this._data.slice()})),C(Ae.prototype,"toString",(function(){var t,r,e;for(t=this._data,r=[],e=0;e<t.length;e++)r.push(String(t[e]));return"MultiSlice("+r.join(",")+")"})),C(Ae.prototype,"toJSON",(function(){var t,r,e,n;for(t=this._data,r={type:"MultiSlice",data:[]},n=0;n<t.length;n++)e=t[n],r.data.push(e&&"function"==typeof e.toJSON?e.toJSON():e);return r}));var xe=4294967295;function Re(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&Br(t.length)&&t.length>=0&&t.length<=xe}function Oe(t){return"object"==typeof t&&null!==t&&!xt(t)}var Se,Ve=Object,je=Object.getPrototypeOf;Se=Vt(Object.getPrototypeOf)?je:function(t){var r=function(t){return t.__proto__}(t);return r||null===r?r:"[object Function]"===$(t.constructor)?t.constructor.prototype:t instanceof Object?Object.prototype:null};var Ie=Se;var Ue=Object.prototype;function Be(t){var r;return!!Oe(t)&&(r=function(t){return null==t?null:(t=Ve(t),Ie(t))}(t),!r||!W(t,"constructor")&&W(r,"constructor")&&Vt(r.constructor)&&"[object Function]"===$(r.constructor)&&W(r,"isPrototypeOf")&&Vt(r.isPrototypeOf)&&(r===Ue||function(t){var r;for(r in t)if(!W(t,r))return!1;return!0}(t)))}function Le(t){switch(t.length){case 0:return new Ae;case 1:return new Ae(t[0]);case 2:return new Ae(t[0],t[1]);case 3:return new Ae(t[0],t[1],t[2]);case 4:return new Ae(t[0],t[1],t[2],t[3]);case 5:return new Ae(t[0],t[1],t[2],t[3],t[4]);case 6:return new Ae(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new Ae(t[0],t[1],t[2],t[3],t[4],t[5],t[6]);case 8:return new Ae(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]);case 9:return new Ae(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]);case 10:return new Ae(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9]);default:return Ae.apply(null,t)}}function Pe(t,r,e){return null===t?new Ee(0,r,1):"number"==typeof t?function(t,r,e){return t>=r?e?{code:"ERR_SLICE_OUT_OF_BOUNDS"}:new Ee(r,r,1):t<0&&(t=r+t)<0?e?{code:"ERR_SLICE_OUT_OF_BOUNDS"}:new Ee(0,0,1):new Ee(t,t+1,1)}(t,r,e):function(t,r,e){var n,i,o;if(n=t.start,i=t.stop,null===(o=t.step)&&(o=1),null===n)n=o>0?0:r-1;else if(n<0){if((n=r+n)<0){if(e)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};n=0}}else if(n>=r){if(e)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};n=o<0?r-1:r}if(null===i)i=o>0?r:null;else if(i<0){if((i=r+i)<0)if(o>0){if(e)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};i=0}else{if(e&&i<-1)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};i=null}}else if(i>r){if(e)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};i=r}return new Ee(n,i,o)}(t,r,e)}function Fe(t,r,e){var n,i,o,a;for(n=t.data,i=[],a=0;a<n.length;a++){if(void 0!==(o=Pe(n[a],r[a],e)).code)return o;i.push(o)}return Le(i)}var Me=Math.ceil;function Ce(t){var r,e,n;return e=t.start,null===(n=t.stop)&&(n=-1),(r=t.step)>0&&e>=n||r<0&&e<=n?0:Me((n-e)/r)}function Ne(t){var r,e,n;for(r=t.data,e=[],n=0;n<r.length;n++)e.push(Ce(r[n]));return e}function ke(t,r){var e,n;for(e=[],n=0;n<r.length;n++)e.push(t[r[n]]);return e}function Ye(t){return function(t,r){var e,n;for(e=[],n=0;n<r;n++)e.push(t);return e}(0,t)}function De(t){var r,e,n;if(0===(r=t.length))return 0;for(e=1,n=0;n<r;n++)e*=t[n];return e}function Je(t){var r,e,n;for(e=t.length,r=[],n=0;n<e;n++)r.push(t[n]);return r}function We(t,r){return"column-major"===r?function(t){var r,e,n;for(r=[],e=1,n=0;n<t.length;n++)r.push(e),e*=t[n];return r}(t):function(t){var r,e,n,i;for(r=t.length,e=[],i=0;i<r;i++)e.push(0);for(n=1,i=r-1;i>=0;i--)e[i]=n,n*=t[i];return e}(t)}C(We,"assign",(function(t,r,e){return"column-major"===r?function(t,r){var e,n;for(e=1,n=0;n<t.length;n++)r[n]=e,e*=t[n];return r}(t,e):function(t,r){var e,n;for(e=1,n=t.length-1;n>=0;n--)r[n]=e,e*=t[n];return r}(t,e)}));var Ge="row-major";var ze="row-major",$e="column-major";function Xe(t){return t.data}function Ze(t){if(t.__esModule)return t;var r=t.default;if("function"==typeof r){var e=function t(){return this instanceof t?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};e.prototype=r.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach((function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})})),e}var He="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},qe=[],Ke=[],Qe="undefined"!=typeof Uint8Array?Uint8Array:Array,tn=!1;function rn(){tn=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)qe[r]=t[r],Ke[t.charCodeAt(r)]=r;Ke["-".charCodeAt(0)]=62,Ke["_".charCodeAt(0)]=63}function en(t,r,e){for(var n,i,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(qe[(i=n)>>18&63]+qe[i>>12&63]+qe[i>>6&63]+qe[63&i]);return o.join("")}function nn(t){var r;tn||rn();for(var e=t.length,n=e%3,i="",o=[],a=16383,u=0,f=e-n;u<f;u+=a)o.push(en(t,u,u+a>f?f:u+a));return 1===n?(r=t[e-1],i+=qe[r>>2],i+=qe[r<<4&63],i+="=="):2===n&&(r=(t[e-2]<<8)+t[e-1],i+=qe[r>>10],i+=qe[r>>4&63],i+=qe[r<<2&63],i+="="),o.push(i),o.join("")}function on(t,r,e,n,i){var o,a,u=8*i-n-1,f=(1<<u)-1,s=f>>1,l=-7,h=e?i-1:0,c=e?-1:1,p=t[r+h];for(h+=c,o=p&(1<<-l)-1,p>>=-l,l+=u;l>0;o=256*o+t[r+h],h+=c,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[r+h],h+=c,l-=8);if(0===o)o=1-s;else{if(o===f)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=s}return(p?-1:1)*a*Math.pow(2,o-n)}function an(t,r,e,n,i,o){var a,u,f,s=8*o-i-1,l=(1<<s)-1,h=l>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=l):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),(r+=a+h>=1?c/f:c*Math.pow(2,1-h))*f>=2&&(a++,f/=2),a+h>=l?(u=0,a=l):a+h>=1?(u=(r*f-1)*Math.pow(2,i),a+=h):(u=r*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[e+p]=255&u,p+=g,u/=256,i-=8);for(a=a<<i|u,s+=i;s>0;t[e+p]=255&a,p+=g,a/=256,s-=8);t[e+p-g]|=128*y}var un={}.toString,fn=Array.isArray||function(t){return"[object Array]"==un.call(t)};cn.TYPED_ARRAY_SUPPORT=void 0===He.TYPED_ARRAY_SUPPORT||He.TYPED_ARRAY_SUPPORT;var sn=ln();function ln(){return cn.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function hn(t,r){if(ln()<r)throw new RangeError("Invalid typed array length");return cn.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=cn.prototype:(null===t&&(t=new cn(r)),t.length=r),t}function cn(t,r,e){if(!(cn.TYPED_ARRAY_SUPPORT||this instanceof cn))return new cn(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return yn(this,t)}return pn(this,t,r,e)}function pn(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);cn.TYPED_ARRAY_SUPPORT?(t=r).__proto__=cn.prototype:t=mn(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!cn.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|vn(r,e);t=hn(t,n);var i=t.write(r,e);i!==n&&(t=t.slice(0,i));return t}(t,r,e):function(t,r){if(dn(r)){var e=0|wn(r.length);return 0===(t=hn(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?hn(t,0):mn(t,r);if("Buffer"===r.type&&fn(r.data))return mn(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function gn(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function yn(t,r){if(gn(r),t=hn(t,r<0?0:0|wn(r)),!cn.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function mn(t,r){var e=r.length<0?0:0|wn(r.length);t=hn(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function wn(t){if(t>=ln())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ln().toString(16)+" bytes");return 0|t}function dn(t){return!(null==t||!t._isBuffer)}function vn(t,r){if(dn(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return zn(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return $n(t).length;default:if(n)return zn(t).length;r=(""+r).toLowerCase(),n=!0}}function bn(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Pn(this,r,e);case"utf8":case"utf-8":return In(this,r,e);case"ascii":return Bn(this,r,e);case"latin1":case"binary":return Ln(this,r,e);case"base64":return jn(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fn(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _n(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function En(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=cn.from(r,n)),dn(r))return 0===r.length?-1:Tn(t,r,e,n,i);if("number"==typeof r)return r&=255,cn.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Tn(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Tn(t,r,e,n,i){var o,a=1,u=t.length,f=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;a=2,u/=2,f/=2,e/=2}function s(t,r){return 1===a?t[r]:t.readUInt16BE(r*a)}if(i){var l=-1;for(o=e;o<u;o++)if(s(t,o)===s(r,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===f)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(e+f>u&&(e=u-f),o=e;o>=0;o--){for(var h=!0,c=0;c<f;c++)if(s(t,o+c)!==s(r,c)){h=!1;break}if(h)return o}return-1}function An(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var u=parseInt(r.substr(2*a,2),16);if(isNaN(u))return a;t[e+a]=u}return a}function xn(t,r,e,n){return Xn(zn(r,t.length-e),t,e,n)}function Rn(t,r,e,n){return Xn(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function On(t,r,e,n){return Rn(t,r,e,n)}function Sn(t,r,e,n){return Xn($n(r),t,e,n)}function Vn(t,r,e,n){return Xn(function(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)n=(e=t.charCodeAt(a))>>8,i=e%256,o.push(i),o.push(n);return o}(r,t.length-e),t,e,n)}function jn(t,r,e){return 0===r&&e===t.length?nn(t):nn(t.slice(r,e))}function In(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,a,u,f,s=t[i],l=null,h=s>239?4:s>223?3:s>191?2:1;if(i+h<=e)switch(h){case 1:s<128&&(l=s);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&s)<<6|63&o)>127&&(l=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&s)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(l=f);break;case 4:o=t[i+1],a=t[i+2],u=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(f=(15&s)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&f<1114112&&(l=f)}null===l?(l=65533,h=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=h}return function(t){var r=t.length;if(r<=Un)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Un));return e}(n)}cn.poolSize=8192,cn._augment=function(t){return t.__proto__=cn.prototype,t},cn.from=function(t,r,e){return pn(null,t,r,e)},cn.TYPED_ARRAY_SUPPORT&&(cn.prototype.__proto__=Uint8Array.prototype,cn.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&cn[Symbol.species]),cn.alloc=function(t,r,e){return function(t,r,e,n){return gn(r),r<=0?hn(t,r):void 0!==e?"string"==typeof n?hn(t,r).fill(e,n):hn(t,r).fill(e):hn(t,r)}(null,t,r,e)},cn.allocUnsafe=function(t){return yn(null,t)},cn.allocUnsafeSlow=function(t){return yn(null,t)},cn.isBuffer=Zn,cn.compare=function(t,r){if(!dn(t)||!dn(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},cn.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},cn.concat=function(t,r){if(!fn(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return cn.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=cn.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var o=t[e];if(!dn(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},cn.byteLength=vn,cn.prototype._isBuffer=!0,cn.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)_n(this,r,r+1);return this},cn.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)_n(this,r,r+3),_n(this,r+1,r+2);return this},cn.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)_n(this,r,r+7),_n(this,r+1,r+6),_n(this,r+2,r+5),_n(this,r+3,r+4);return this},cn.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?In(this,0,t):bn.apply(this,arguments)},cn.prototype.equals=function(t){if(!dn(t))throw new TypeError("Argument must be a Buffer");return this===t||0===cn.compare(this,t)},cn.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},cn.prototype.compare=function(t,r,e,n,i){if(!dn(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(e>>>=0)-(r>>>=0),u=Math.min(o,a),f=this.slice(n,i),s=t.slice(r,e),l=0;l<u;++l)if(f[l]!==s[l]){o=f[l],a=s[l];break}return o<a?-1:a<o?1:0},cn.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},cn.prototype.indexOf=function(t,r,e){return En(this,t,r,e,!0)},cn.prototype.lastIndexOf=function(t,r,e){return En(this,t,r,e,!1)},cn.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return An(this,t,r,e);case"utf8":case"utf-8":return xn(this,t,r,e);case"ascii":return Rn(this,t,r,e);case"latin1":case"binary":return On(this,t,r,e);case"base64":return Sn(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Vn(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},cn.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Un=4096;function Bn(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function Ln(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function Pn(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Gn(t[o]);return i}function Fn(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function Mn(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function Cn(t,r,e,n,i,o){if(!dn(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function Nn(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function kn(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function Yn(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Dn(t,r,e,n,i){return i||Yn(t,0,e,4),an(t,r,e,n,23,4),e+4}function Jn(t,r,e,n,i){return i||Yn(t,0,e,8),an(t,r,e,n,52,8),e+8}cn.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),cn.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=cn.prototype;else{var i=r-t;e=new cn(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},cn.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||Mn(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},cn.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||Mn(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},cn.prototype.readUInt8=function(t,r){return r||Mn(t,1,this.length),this[t]},cn.prototype.readUInt16LE=function(t,r){return r||Mn(t,2,this.length),this[t]|this[t+1]<<8},cn.prototype.readUInt16BE=function(t,r){return r||Mn(t,2,this.length),this[t]<<8|this[t+1]},cn.prototype.readUInt32LE=function(t,r){return r||Mn(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},cn.prototype.readUInt32BE=function(t,r){return r||Mn(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},cn.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||Mn(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},cn.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||Mn(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},cn.prototype.readInt8=function(t,r){return r||Mn(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},cn.prototype.readInt16LE=function(t,r){r||Mn(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},cn.prototype.readInt16BE=function(t,r){r||Mn(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},cn.prototype.readInt32LE=function(t,r){return r||Mn(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},cn.prototype.readInt32BE=function(t,r){return r||Mn(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},cn.prototype.readFloatLE=function(t,r){return r||Mn(t,4,this.length),on(this,t,!0,23,4)},cn.prototype.readFloatBE=function(t,r){return r||Mn(t,4,this.length),on(this,t,!1,23,4)},cn.prototype.readDoubleLE=function(t,r){return r||Mn(t,8,this.length),on(this,t,!0,52,8)},cn.prototype.readDoubleBE=function(t,r){return r||Mn(t,8,this.length),on(this,t,!1,52,8)},cn.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||Cn(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},cn.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||Cn(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},cn.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||Cn(this,t,r,1,255,0),cn.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},cn.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||Cn(this,t,r,2,65535,0),cn.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):Nn(this,t,r,!0),r+2},cn.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||Cn(this,t,r,2,65535,0),cn.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):Nn(this,t,r,!1),r+2},cn.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||Cn(this,t,r,4,4294967295,0),cn.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):kn(this,t,r,!0),r+4},cn.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||Cn(this,t,r,4,4294967295,0),cn.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):kn(this,t,r,!1),r+4},cn.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);Cn(this,t,r,e,i-1,-i)}var o=0,a=1,u=0;for(this[r]=255&t;++o<e&&(a*=256);)t<0&&0===u&&0!==this[r+o-1]&&(u=1),this[r+o]=(t/a>>0)-u&255;return r+e},cn.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);Cn(this,t,r,e,i-1,-i)}var o=e-1,a=1,u=0;for(this[r+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[r+o+1]&&(u=1),this[r+o]=(t/a>>0)-u&255;return r+e},cn.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||Cn(this,t,r,1,127,-128),cn.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},cn.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||Cn(this,t,r,2,32767,-32768),cn.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):Nn(this,t,r,!0),r+2},cn.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||Cn(this,t,r,2,32767,-32768),cn.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):Nn(this,t,r,!1),r+2},cn.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||Cn(this,t,r,4,2147483647,-2147483648),cn.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):kn(this,t,r,!0),r+4},cn.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||Cn(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),cn.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):kn(this,t,r,!1),r+4},cn.prototype.writeFloatLE=function(t,r,e){return Dn(this,t,r,!0,e)},cn.prototype.writeFloatBE=function(t,r,e){return Dn(this,t,r,!1,e)},cn.prototype.writeDoubleLE=function(t,r,e){return Jn(this,t,r,!0,e)},cn.prototype.writeDoubleBE=function(t,r,e){return Jn(this,t,r,!1,e)},cn.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!cn.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},cn.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!cn.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var a=dn(t)?t:zn(new cn(t,n).toString()),u=a.length;for(o=0;o<e-r;++o)this[o+r]=a[o%u]}return this};var Wn=/[^+\/0-9A-Za-z-_]/g;function Gn(t){return t<16?"0"+t.toString(16):t.toString(16)}function zn(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((e=t.charCodeAt(a))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function $n(t){return function(t){var r,e,n,i,o,a;tn||rn();var u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[u-2]?2:"="===t[u-1]?1:0,a=new Qe(3*u/4-o),n=o>0?u-4:u;var f=0;for(r=0,e=0;r<n;r+=4,e+=3)i=Ke[t.charCodeAt(r)]<<18|Ke[t.charCodeAt(r+1)]<<12|Ke[t.charCodeAt(r+2)]<<6|Ke[t.charCodeAt(r+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=255&i;return 2===o?(i=Ke[t.charCodeAt(r)]<<2|Ke[t.charCodeAt(r+1)]>>4,a[f++]=255&i):1===o&&(i=Ke[t.charCodeAt(r)]<<10|Ke[t.charCodeAt(r+1)]<<4|Ke[t.charCodeAt(r+2)]>>2,a[f++]=i>>8&255,a[f++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Wn,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Xn(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function Zn(t){return null!=t&&(!!t._isBuffer||Hn(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Hn(t.slice(0,0))}(t))}function Hn(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}Ze(Object.freeze({__proto__:null,Buffer:cn,INSPECT_MAX_BYTES:50,SlowBuffer:function(t){return+t!=t&&(t=0),cn.alloc(+t)},isBuffer:Zn,kMaxLength:sn})).Buffer;var qn=function(){throw new Error("not implemented")},Kn="function"==typeof Float32Array;var Qn="function"==typeof Float32Array?Float32Array:null;var ti,ri="function"==typeof Float32Array?Float32Array:void 0;ti=function(){var t,r,e;if("function"!=typeof Qn)return!1;try{r=new Qn([1,3.14,-3.14,5e40]),e=r,t=(Kn&&e instanceof Float32Array||"[object Float32Array]"===$(e))&&1===r[0]&&3.140000104904175===r[1]&&-3.140000104904175===r[2]&&r[3]===jr}catch(r){t=!1}return t}()?ri:function(){throw new Error("not implemented")};var ei=ti,ni="function"==typeof Int16Array;var ii="function"==typeof Int16Array?Int16Array:null;var oi,ai="function"==typeof Int16Array?Int16Array:void 0;oi=function(){var t,r,e;if("function"!=typeof ii)return!1;try{r=new ii([1,3.14,-3.14,32768]),e=r,t=(ni&&e instanceof Int16Array||"[object Int16Array]"===$(e))&&1===r[0]&&3===r[1]&&-3===r[2]&&-32768===r[3]}catch(r){t=!1}return t}()?ai:function(){throw new Error("not implemented")};var ui=oi,fi="function"==typeof Int32Array;var si="function"==typeof Int32Array?Int32Array:null;var li,hi="function"==typeof Int32Array?Int32Array:void 0;li=function(){var t,r,e;if("function"!=typeof si)return!1;try{r=new si([1,3.14,-3.14,2147483648]),e=r,t=(fi&&e instanceof Int32Array||"[object Int32Array]"===$(e))&&1===r[0]&&3===r[1]&&-3===r[2]&&-2147483648===r[3]}catch(r){t=!1}return t}()?hi:function(){throw new Error("not implemented")};var ci=li,pi="function"==typeof Int8Array;var gi="function"==typeof Int8Array?Int8Array:null;var yi,mi="function"==typeof Int8Array?Int8Array:void 0;yi=function(){var t,r,e;if("function"!=typeof gi)return!1;try{r=new gi([1,3.14,-3.14,128]),e=r,t=(pi&&e instanceof Int8Array||"[object Int8Array]"===$(e))&&1===r[0]&&3===r[1]&&-3===r[2]&&-128===r[3]}catch(r){t=!1}return t}()?mi:function(){throw new Error("not implemented")};var wi=yi,di="function"==typeof Uint32Array;var vi="function"==typeof Uint32Array?Uint32Array:null;var bi,_i="function"==typeof Uint32Array?Uint32Array:void 0;bi=function(){var t,r,e;if("function"!=typeof vi)return!1;try{r=new vi(r=[1,3.14,-3.14,4294967296,4294967297]),e=r,t=(di&&e instanceof Uint32Array||"[object Uint32Array]"===$(e))&&1===r[0]&&3===r[1]&&4294967293===r[2]&&0===r[3]&&1===r[4]}catch(r){t=!1}return t}()?_i:function(){throw new Error("not implemented")};var Ei=bi,Ti="function"==typeof Uint8ClampedArray;var Ai="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null;var xi,Ri="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0;xi=function(){var t,r,e;if("function"!=typeof Ai)return!1;try{r=new Ai([-1,0,1,3.14,4.99,255,256]),e=r,t=(Ti&&e instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===$(e))&&0===r[0]&&0===r[1]&&1===r[2]&&3===r[3]&&5===r[4]&&255===r[5]&&255===r[6]}catch(r){t=!1}return t}()?Ri:function(){throw new Error("not implemented")};var Oi=xi;function Si(t){return Pr(t)&&t>=0}function Vi(t){return Fr(t)&&t.valueOf()>=0}function ji(t){return Si(t)||Vi(t)}function Ii(t,r){if(!(this instanceof Ii))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!br(t))throw new TypeError(V("invalid argument. Real component must be a number. Value: `%s`.",t));if(!br(r))throw new TypeError(V("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return M(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:t}),M(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:r}),this}C(ji,"isPrimitive",Si),C(ji,"isObject",Vi),C(Ii,"BYTES_PER_ELEMENT",8),C(Ii.prototype,"BYTES_PER_ELEMENT",8),C(Ii.prototype,"byteLength",16),C(Ii.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),C(Ii.prototype,"toJSON",(function(){var t={type:"Complex128"};return t.re=this.re,t.im=this.im,t}));var Ui="function"==typeof Math.fround?Math.fround:null,Bi=new ei(1);var Li="function"==typeof Ui?Ui:function(t){return Bi[0]=t,Bi[0]};function Pi(t,r){if(!(this instanceof Pi))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!br(t))throw new TypeError(V("invalid argument. Real component must be a number. Value: `%s`.",t));if(!br(r))throw new TypeError(V("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return M(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Li(t)}),M(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Li(r)}),this}function Fi(t){return t instanceof Ii||t instanceof Pi||"object"==typeof t&&null!==t&&"number"==typeof t.re&&"number"==typeof t.im}function Mi(t){return Br(t/2)}C(Pi,"BYTES_PER_ELEMENT",4),C(Pi.prototype,"BYTES_PER_ELEMENT",4),C(Pi.prototype,"byteLength",8),C(Pi.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),C(Pi.prototype,"toJSON",(function(){var t={type:"Complex64"};return t.re=this.re,t.im=this.im,t}));var Ci=8;function Ni(t){return"object"==typeof t&&null!==t&&"Complex64Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===Ci}var ki=16;function Yi(t){return"object"==typeof t&&null!==t&&"Complex128Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===ki}function Di(){return"function"==typeof G&&"symbol"==typeof G("foo")&&W(G,"iterator")&&"symbol"==typeof G.iterator}var Ji=Di()?Symbol.iterator:null;function Wi(t){return t.re}function Gi(t){return t.im}function zi(t,r){return new ei(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*r,2*(t.length-r))}function $i(t,r){return new tr(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*r,2*(t.length-r))}var Xi={float64:function(t,r){return t[r]},float32:function(t,r){return t[r]},int32:function(t,r){return t[r]},int16:function(t,r){return t[r]},int8:function(t,r){return t[r]},uint32:function(t,r){return t[r]},uint16:function(t,r){return t[r]},uint8:function(t,r){return t[r]},uint8c:function(t,r){return t[r]},generic:function(t,r){return t[r]},default:function(t,r){return t[r]}};function Zi(t){var r=Xi[t];return"function"==typeof r?r:Xi.default}var Hi={complex128:function(t,r){return t.get(r)},complex64:function(t,r){return t.get(r)},default:function(t,r){return t.get(r)}};function qi(t){var r=Hi[t];return"function"==typeof r?r:Hi.default}function Ki(t){var r,e,n;for(r=[];!(e=t.next()).done;)if(Re(n=e.value)&&n.length>=2)r.push(n[0],n[1]);else{if(!Fi(n))return new TypeError(V("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));r.push(Wi(n),Gi(n))}return r}var Qi=2*ei.BYTES_PER_ELEMENT,to=Di();function ro(t){return t instanceof io||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function eo(t){return t===io||"Complex128Array"===t.name}function no(t,r){return new Pi(t[r*=2],t[r+1])}function io(){var t,r,e,n;if(r=arguments.length,!(this instanceof io))return 0===r?new io:1===r?new io(arguments[0]):2===r?new io(arguments[0],arguments[1]):new io(arguments[0],arguments[1],arguments[2]);if(0===r)e=new ei(0);else if(1===r)if(Si(arguments[0]))e=new ei(2*arguments[0]);else if($r(arguments[0]))if((n=(e=arguments[0]).length)&&xt(e)&&Fi(e[0])){if(e=function(t,r){var e,n,i,o;for(e=r.length,o=0,i=0;i<e;i++){if(!Fi(n=r[i]))return null;t[o]=Wi(n),t[o+1]=Gi(n),o+=2}return t}(new ei(2*n),e),null===e){if(!Mi(n))throw new RangeError(V("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));e=new ei(arguments[0])}}else{if(Ni(e))e=zi(e,0);else if(Yi(e))e=$i(e,0);else if(!Mi(n))throw new RangeError(V("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));e=new ei(e)}else if(Zt(arguments[0])){if(!Br((e=arguments[0]).byteLength/Qi))throw new RangeError(V("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",Qi,e.byteLength));e=new ei(e)}else{if(!Oe(arguments[0]))throw new TypeError(V("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));if(e=arguments[0],!1===to)throw new TypeError(V("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",e));if(!Vt(e[Ji]))throw new TypeError(V("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",e));if(!Vt((e=e[Ji]()).next))throw new TypeError(V("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",e));if((e=Ki(e))instanceof Error)throw e;e=new ei(e)}else{if(!Zt(e=arguments[0]))throw new TypeError(V("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",e));if(!Si(t=arguments[1]))throw new TypeError(V("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",t));if(!Br(t/Qi))throw new RangeError(V("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",Qi,t));if(2===r){if(!Br((n=e.byteLength-t)/Qi))throw new RangeError(V("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",Qi,n));e=new ei(e,t)}else{if(!Si(n=arguments[2]))throw new TypeError(V("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*Qi>e.byteLength-t)throw new RangeError(V("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Qi));e=new ei(e,t,2*n)}}return C(this,"_buffer",e),C(this,"_length",e.length/2),this}function oo(t){var r,e,n;for(r=[];!(e=t.next()).done;)if(Re(n=e.value)&&n.length>=2)r.push(n[0],n[1]);else{if(!Fi(n))return new TypeError(V("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));r.push(ht(n),ct(n))}return r}C(io,"BYTES_PER_ELEMENT",Qi),C(io,"name","Complex64Array"),C(io,"from",(function(t){var r,e,n,i,o,a,u,f,s,l,h,c;if(!Vt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!eo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!Vt(n=arguments[1]))throw new TypeError(V("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(r=arguments[2])}if(ro(t)){if(f=t.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(Fi(l=n.call(r,t.get(h),h)))o[c]=Wi(l),o[c+1]=Gi(l);else{if(!(Re(l)&&l.length>=2))throw new TypeError(V("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if($r(t)){if(n){for(f=t.length,u=t.get&&t.set?qi("default"):Zi("default"),h=0;h<f;h++)if(!Fi(u(t,h))){s=!0;break}if(s){if(!Mi(f))throw new RangeError(V("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,f));for(o=(i=new this(f/2))._buffer,h=0;h<f;h++)o[h]=n.call(r,u(t,h),h);return i}for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(Fi(l=n.call(r,u(t,h),h)))o[c]=Wi(l),o[c+1]=Gi(l);else{if(!(Re(l)&&l.length>=2))throw new TypeError(V("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(Oe(t)&&to&&Vt(t[Ji])){if(!Vt((o=t[Ji]()).next))throw new TypeError(V("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=n?function(t,r,e){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,Re(o=r.call(e,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Fi(o))return new TypeError(V("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(Wi(o),Gi(o))}return n}(o,n,r):Ki(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h<f;h++)o[h]=a[h];return i}throw new TypeError(V("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t))})),C(io,"of",(function(){var t,r;if(!Vt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!eo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);return new this(t)})),C(io.prototype,"at",(function(t){if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Br(t))throw new TypeError(V("invalid argument. Must provide an integer. Value: `%s`.",t));if(t<0&&(t+=this._length),!(t<0||t>=this._length))return no(this._buffer,t)})),it(io.prototype,"buffer",(function(){return this._buffer.buffer})),it(io.prototype,"byteLength",(function(){return this._buffer.byteLength})),it(io.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),C(io.prototype,"BYTES_PER_ELEMENT",io.BYTES_PER_ELEMENT),C(io.prototype,"copyWithin",(function(t,r){if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*r):this._buffer.copyWithin(2*t,2*r,2*arguments[2]),this})),C(io.prototype,"entries",(function(){var t,r,e,n,i,o,a;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,t=this._buffer,n=this._length,o=-1,a=-2,C(e={},"next",(function(){var r;if(o+=1,i||o>=n)return{done:!0};return r=new Pi(t[a+=2],t[a+1]),{value:[o,r],done:!1}})),C(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ji&&C(e,Ji,(function(){return r.entries()})),e})),C(io.prototype,"every",(function(t,r){var e,n;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n<this._length;n++)if(!t.call(r,no(e,n),n,this))return!1;return!0})),C(io.prototype,"fill",(function(t,r,e){var n,i,o,a,u,f;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Fi(t))throw new TypeError(V("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(n=this._buffer,i=this._length,arguments.length>1){if(!Br(r))throw new TypeError(V("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!Br(e))throw new TypeError(V("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=i)<0&&(e=0),e>i&&(e=i)}else e=i}else r=0,e=i;for(a=Wi(t),u=Gi(t),f=r;f<e;f++)n[o=2*f]=a,n[o+1]=u;return this})),C(io.prototype,"filter",(function(t,r){var e,n,i,o;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=[],i=0;i<this._length;i++)o=no(e,i),t.call(r,o,i,this)&&n.push(o);return new this.constructor(n)})),C(io.prototype,"find",(function(t,r){var e,n,i;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n<this._length;n++)if(i=no(e,n),t.call(r,i,n,this))return i})),C(io.prototype,"findIndex",(function(t,r){var e,n,i;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n<this._length;n++)if(i=no(e,n),t.call(r,i,n,this))return n;return-1})),C(io.prototype,"findLast",(function(t,r){var e,n,i;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=no(e,n),t.call(r,i,n,this))return i})),C(io.prototype,"findLastIndex",(function(t,r){var e,n,i;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=no(e,n),t.call(r,i,n,this))return n;return-1})),C(io.prototype,"forEach",(function(t,r){var e,n,i;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n<this._length;n++)i=no(e,n),t.call(r,i,n,this)})),C(io.prototype,"get",(function(t){if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Si(t))throw new TypeError(V("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return no(this._buffer,t)})),C(io.prototype,"includes",(function(t,r){var e,n,i,o,a;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Fi(t))throw new TypeError(V("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Br(r))throw new TypeError(V("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=Wi(t),o=Gi(t),e=this._buffer,a=r;a<this._length;a++)if(i===e[n=2*a]&&o===e[n+1])return!0;return!1})),C(io.prototype,"indexOf",(function(t,r){var e,n,i,o,a;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Fi(t))throw new TypeError(V("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Br(r))throw new TypeError(V("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=Wi(t),o=Gi(t),e=this._buffer,a=r;a<this._length;a++)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),C(io.prototype,"join",(function(t){var r,e,n,i;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!pt(t))throw new TypeError(V("invalid argument. First argument must be a string. Value: `%s`.",t));n=t}for(r=[],e=this._buffer,i=0;i<this._length;i++)r.push(no(e,i).toString());return r.join(n)})),C(io.prototype,"lastIndexOf",(function(t,r){var e,n,i,o,a;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Fi(t))throw new TypeError(V("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Br(r))throw new TypeError(V("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=Wi(t),o=Gi(t),e=this._buffer,a=r;a>=0;a--)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),it(io.prototype,"length",(function(){return this._length})),C(io.prototype,"map",(function(t,r){var e,n,i,o,a;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(Fi(a=t.call(r,no(n,o),o,this)))e[2*o]=Wi(a),e[2*o+1]=Gi(a);else{if(!Re(a)||2!==a.length)throw new TypeError(V("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})),C(io.prototype,"reduce",(function(t,r){var e,n,i,o;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));if(e=this._buffer,i=this._length,arguments.length>1)n=r,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=no(e,0),o=1}for(;o<i;o++)n=t(n,no(e,o),o,this);return n})),C(io.prototype,"reverse",(function(){var t,r,e,n,i,o;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,t=this._buffer,n=Ur(e/2),i=0;i<n;i++)o=e-i-1,r=t[2*i],t[2*i]=t[2*o],t[2*o]=r,r=t[2*i+1],t[2*i+1]=t[2*o+1],t[2*o+1]=r;return this})),C(io.prototype,"set",(function(t){var r,e,n,i,o,a,u,f,s;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!Si(e=arguments[1]))throw new TypeError(V("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Fi(t)){if(e>=this._length)throw new RangeError(V("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=Wi(t),void(n[e+1]=Gi(t))}if(ro(t)){if(e+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t._buffer,s=n.byteOffset+e*Qi,r.buffer===n.buffer&&r.byteOffset<s&&r.byteOffset+r.byteLength>s){for(i=new ei(r.length),f=0;f<r.length;f++)i[f]=r[f];r=i}for(e*=2,s=0,f=0;f<a;f++)n[e]=r[s],n[e+1]=r[s+1],e+=2,s+=2}else{if(!$r(t))throw new TypeError(V("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",t));for(a=t.length,f=0;f<a;f++)if(!Fi(t[f])){o=!0;break}if(o){if(!Mi(a))throw new RangeError(V("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(r=t,s=n.byteOffset+e*Qi,r.buffer===n.buffer&&r.byteOffset<s&&r.byteOffset+r.byteLength>s){for(i=new ei(a),f=0;f<a;f++)i[f]=r[f];r=i}for(e*=2,a/=2,s=0,f=0;f<a;f++)n[e]=r[s],n[e+1]=r[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=t[f],n[e]=Wi(u),n[e+1]=Gi(u),e+=2}})),C(io.prototype,"slice",(function(t,r){var e,n,i,o,a,u,f;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)t=0,r=u;else{if(!Br(t))throw new TypeError(V("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=u)<0&&(t=0),1===arguments.length)r=u;else{if(!Br(r))throw new TypeError(V("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=u)<0&&(r=0):r>u&&(r=u)}}for(e=t<r?r-t:0,n=(i=new this.constructor(e))._buffer,f=0;f<e;f++)o=2*(f+t),n[2*f]=a[o],n[2*f+1]=a[o+1];return i})),C(io.prototype,"some",(function(t,r){var e,n;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n<this._length;n++)if(t.call(r,no(e,n),n,this))return!0;return!1})),C(io.prototype,"subarray",(function(t,r){var e,n,i;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)t=0,r=i;else{if(!Br(t))throw new TypeError(V("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=i)<0&&(t=0),1===arguments.length)r=i;else{if(!Br(r))throw new TypeError(V("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=i)<0&&(r=0):r>i&&(r=i)}}return t>=i?(i=0,e=n.byteLength):t>=r?(i=0,e=n.byteOffset+t*Qi):(i=r-t,e=n.byteOffset+t*Qi),new this.constructor(n.buffer,e,i<0?0:i)})),C(io.prototype,"toReversed",(function(){var t,r,e,n,i,o;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=new this.constructor(e),n=this._buffer,t=r._buffer,i=0;i<e;i++)o=e-i-1,t[2*i]=n[2*o],t[2*i+1]=n[2*o+1];return r})),C(io.prototype,"toString",(function(){var t,r,e;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],r=this._buffer,e=0;e<this._length;e++)t.push(no(r,e).toString());return t.join(",")})),C(io.prototype,"with",(function(t,r){var e,n,i;if(!ro(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Br(t))throw new TypeError(V("invalid argument. First argument must be an integer. Value: `%s`.",t));if(i=this._length,t<0&&(t+=i),t<0||t>=i)throw new RangeError(V("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!Fi(r))throw new TypeError(V("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(e=(n=new this.constructor(this._buffer))._buffer)[2*t]=Wi(r),e[2*t+1]=Gi(r),n}));var ao=2*tr.BYTES_PER_ELEMENT,uo=Di();function fo(t){return t instanceof ho||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function so(t){return t===ho||"Complex64Array"===t.name}function lo(t,r){return new Ii(t[r*=2],t[r+1])}function ho(){var t,r,e,n;if(r=arguments.length,!(this instanceof ho))return 0===r?new ho:1===r?new ho(arguments[0]):2===r?new ho(arguments[0],arguments[1]):new ho(arguments[0],arguments[1],arguments[2]);if(0===r)e=new tr(0);else if(1===r)if(Si(arguments[0]))e=new tr(2*arguments[0]);else if($r(arguments[0]))if((n=(e=arguments[0]).length)&&xt(e)&&Fi(e[0])){if(e=function(t,r){var e,n,i,o;for(e=r.length,o=0,i=0;i<e;i++){if(!Fi(n=r[i]))return null;t[o]=ht(n),t[o+1]=ct(n),o+=2}return t}(new tr(2*n),e),null===e){if(!Mi(n))throw new RangeError(V("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));e=new tr(arguments[0])}}else{if(Ni(e))e=zi(e,0);else if(Yi(e))e=$i(e,0);else if(!Mi(n))throw new RangeError(V("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));e=new tr(e)}else if(Zt(arguments[0])){if(!Br((e=arguments[0]).byteLength/ao))throw new RangeError(V("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",ao,e.byteLength));e=new tr(e)}else{if(!Oe(arguments[0]))throw new TypeError(V("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));if(e=arguments[0],!1===uo)throw new TypeError(V("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",e));if(!Vt(e[Ji]))throw new TypeError(V("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",e));if(!Vt((e=e[Ji]()).next))throw new TypeError(V("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",e));if((e=oo(e))instanceof Error)throw e;e=new tr(e)}else{if(!Zt(e=arguments[0]))throw new TypeError(V("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",e));if(!Si(t=arguments[1]))throw new TypeError(V("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",t));if(!Br(t/ao))throw new RangeError(V("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",ao,t));if(2===r){if(!Br((n=e.byteLength-t)/ao))throw new RangeError(V("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",ao,n));e=new tr(e,t)}else{if(!Si(n=arguments[2]))throw new TypeError(V("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*ao>e.byteLength-t)throw new RangeError(V("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*ao));e=new tr(e,t,2*n)}}return C(this,"_buffer",e),C(this,"_length",e.length/2),this}C(ho,"BYTES_PER_ELEMENT",ao),C(ho,"name","Complex128Array"),C(ho,"from",(function(t){var r,e,n,i,o,a,u,f,s,l,h,c;if(!Vt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!so(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!Vt(n=arguments[1]))throw new TypeError(V("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(r=arguments[2])}if(fo(t)){if(f=t.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(Fi(l=n.call(r,t.get(h),h)))o[c]=ht(l),o[c+1]=ct(l);else{if(!(Re(l)&&l.length>=2))throw new TypeError(V("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if($r(t)){if(n){for(f=t.length,u=t.get&&t.set?qi("default"):Zi("default"),h=0;h<f;h++)if(!Fi(u(t,h))){s=!0;break}if(s){if(!Mi(f))throw new RangeError(V("invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.",f));for(o=(i=new this(f/2))._buffer,h=0;h<f;h++)o[h]=n.call(r,u(t,h),h);return i}for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(Fi(l=n.call(r,u(t,h),h)))o[c]=ht(l),o[c+1]=ct(l);else{if(!(Re(l)&&l.length>=2))throw new TypeError(V("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(Oe(t)&&uo&&Vt(t[Ji])){if(!Vt((o=t[Ji]()).next))throw new TypeError(V("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=n?function(t,r,e){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,Re(o=r.call(e,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Fi(o))return new TypeError(V("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(ht(o),ct(o))}return n}(o,n,r):oo(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h<f;h++)o[h]=a[h];return i}throw new TypeError(V("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t))})),C(ho,"of",(function(){var t,r;if(!Vt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!so(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);return new this(t)})),C(ho.prototype,"at",(function(t){if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Br(t))throw new TypeError(V("invalid argument. Must provide an integer. Value: `%s`.",t));if(t<0&&(t+=this._length),!(t<0||t>=this._length))return lo(this._buffer,t)})),it(ho.prototype,"buffer",(function(){return this._buffer.buffer})),it(ho.prototype,"byteLength",(function(){return this._buffer.byteLength})),it(ho.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),C(ho.prototype,"BYTES_PER_ELEMENT",ho.BYTES_PER_ELEMENT),C(ho.prototype,"copyWithin",(function(t,r){if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*r):this._buffer.copyWithin(2*t,2*r,2*arguments[2]),this})),C(ho.prototype,"entries",(function(){var t,r,e,n,i,o,a;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,t=this._buffer,n=this._length,o=-1,a=-2,C(e={},"next",(function(){var r;if(o+=1,i||o>=n)return{done:!0};return r=new Ii(t[a+=2],t[a+1]),{value:[o,r],done:!1}})),C(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ji&&C(e,Ji,(function(){return r.entries()})),e})),C(ho.prototype,"every",(function(t,r){var e,n;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n<this._length;n++)if(!t.call(r,lo(e,n),n,this))return!1;return!0})),C(ho.prototype,"fill",(function(t,r,e){var n,i,o,a,u,f;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Fi(t))throw new TypeError(V("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(n=this._buffer,i=this._length,arguments.length>1){if(!Br(r))throw new TypeError(V("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!Br(e))throw new TypeError(V("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=i)<0&&(e=0),e>i&&(e=i)}else e=i}else r=0,e=i;for(a=ht(t),u=ct(t),f=r;f<e;f++)n[o=2*f]=a,n[o+1]=u;return this})),C(ho.prototype,"filter",(function(t,r){var e,n,i,o;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=[],i=0;i<this._length;i++)o=lo(e,i),t.call(r,o,i,this)&&n.push(o);return new this.constructor(n)})),C(ho.prototype,"find",(function(t,r){var e,n,i;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n<this._length;n++)if(i=lo(e,n),t.call(r,i,n,this))return i})),C(ho.prototype,"findIndex",(function(t,r){var e,n,i;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n<this._length;n++)if(i=lo(e,n),t.call(r,i,n,this))return n;return-1})),C(ho.prototype,"findLast",(function(t,r){var e,n,i;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=lo(e,n),t.call(r,i,n,this))return i})),C(ho.prototype,"findLastIndex",(function(t,r){var e,n,i;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=lo(e,n),t.call(r,i,n,this))return n;return-1})),C(ho.prototype,"forEach",(function(t,r){var e,n,i;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n<this._length;n++)i=lo(e,n),t.call(r,i,n,this)})),C(ho.prototype,"get",(function(t){if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Si(t))throw new TypeError(V("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return lo(this._buffer,t)})),it(ho.prototype,"length",(function(){return this._length})),C(ho.prototype,"includes",(function(t,r){var e,n,i,o,a;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Fi(t))throw new TypeError(V("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Br(r))throw new TypeError(V("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=ht(t),o=ct(t),e=this._buffer,a=r;a<this._length;a++)if(i===e[n=2*a]&&o===e[n+1])return!0;return!1})),C(ho.prototype,"indexOf",(function(t,r){var e,n,i,o,a;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Fi(t))throw new TypeError(V("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Br(r))throw new TypeError(V("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=ht(t),o=ct(t),e=this._buffer,a=r;a<this._length;a++)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),C(ho.prototype,"join",(function(t){var r,e,n,i;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!wt(t))throw new TypeError(V("invalid argument. First argument must be a string. Value: `%s`.",t));n=t}for(r=[],e=this._buffer,i=0;i<this._length;i++)r.push(lo(e,i).toString());return r.join(n)})),C(ho.prototype,"lastIndexOf",(function(t,r){var e,n,i,o,a;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Fi(t))throw new TypeError(V("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Br(r))throw new TypeError(V("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=ht(t),o=ct(t),e=this._buffer,a=r;a>=0;a--)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),C(ho.prototype,"map",(function(t,r){var e,n,i,o,a;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(Fi(a=t.call(r,lo(n,o),o,this)))e[2*o]=ht(a),e[2*o+1]=ct(a);else{if(!Re(a)||2!==a.length)throw new TypeError(V("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})),C(ho.prototype,"reduce",(function(t,r){var e,n,i,o;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));if(e=this._buffer,i=this._length,arguments.length>1)n=r,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=lo(e,0),o=1}for(;o<i;o++)n=t(n,lo(e,o),o,this);return n})),C(ho.prototype,"reverse",(function(){var t,r,e,n,i,o;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,t=this._buffer,n=Ur(e/2),i=0;i<n;i++)o=e-i-1,r=t[2*i],t[2*i]=t[2*o],t[2*o]=r,r=t[2*i+1],t[2*i+1]=t[2*o+1],t[2*o+1]=r;return this})),C(ho.prototype,"set",(function(t){var r,e,n,i,o,a,u,f,s;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!Si(e=arguments[1]))throw new TypeError(V("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Fi(t)){if(e>=this._length)throw new RangeError(V("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=ht(t),void(n[e+1]=ct(t))}if(fo(t)){if(e+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t._buffer,s=n.byteOffset+e*ao,r.buffer===n.buffer&&r.byteOffset<s&&r.byteOffset+r.byteLength>s){for(i=new tr(r.length),f=0;f<r.length;f++)i[f]=r[f];r=i}for(e*=2,s=0,f=0;f<a;f++)n[e]=r[s],n[e+1]=r[s+1],e+=2,s+=2}else{if(!$r(t))throw new TypeError(V("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",t));for(a=t.length,f=0;f<a;f++)if(!Fi(t[f])){o=!0;break}if(o){if(!Mi(a))throw new RangeError(V("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(r=t,s=n.byteOffset+e*ao,r.buffer===n.buffer&&r.byteOffset<s&&r.byteOffset+r.byteLength>s){for(i=new tr(a),f=0;f<a;f++)i[f]=r[f];r=i}for(e*=2,a/=2,s=0,f=0;f<a;f++)n[e]=r[s],n[e+1]=r[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=t[f],n[e]=ht(u),n[e+1]=ct(u),e+=2}})),C(ho.prototype,"slice",(function(t,r){var e,n,i,o,a,u,f;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)t=0,r=u;else{if(!Br(t))throw new TypeError(V("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=u)<0&&(t=0),1===arguments.length)r=u;else{if(!Br(r))throw new TypeError(V("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=u)<0&&(r=0):r>u&&(r=u)}}for(e=t<r?r-t:0,n=(i=new this.constructor(e))._buffer,f=0;f<e;f++)o=2*(f+t),n[2*f]=a[o],n[2*f+1]=a[o+1];return i})),C(ho.prototype,"some",(function(t,r){var e,n;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Vt(t))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n<this._length;n++)if(t.call(r,lo(e,n),n,this))return!0;return!1})),C(ho.prototype,"subarray",(function(t,r){var e,n,i;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)t=0,r=i;else{if(!Br(t))throw new TypeError(V("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=i)<0&&(t=0),1===arguments.length)r=i;else{if(!Br(r))throw new TypeError(V("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=i)<0&&(r=0):r>i&&(r=i)}}return t>=i?(i=0,e=n.byteLength):t>=r?(i=0,e=n.byteOffset+t*ao):(i=r-t,e=n.byteOffset+t*ao),new this.constructor(n.buffer,e,i<0?0:i)})),C(ho.prototype,"toReversed",(function(){var t,r,e,n,i,o;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=new this.constructor(e),n=this._buffer,t=r._buffer,i=0;i<e;i++)o=e-i-1,t[2*i]=n[2*o],t[2*i+1]=n[2*o+1];return r})),C(ho.prototype,"toString",(function(){var t,r,e;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],r=this._buffer,e=0;e<this._length;e++)t.push(lo(r,e).toString());return t.join(",")})),C(ho.prototype,"with",(function(t,r){var e,n,i;if(!fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Br(t))throw new TypeError(V("invalid argument. First argument must be an integer. Value: `%s`.",t));if(i=this._length,t<0&&(t+=i),t<0||t>=i)throw new RangeError(V("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!Fi(r))throw new TypeError(V("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(e=(n=new this.constructor(this._buffer))._buffer)[2*t]=ht(r),e[2*t+1]=ct(r),n}));var co={binary:qn,float64:tr,float32:ei,generic:Array,int16:ui,int32:ci,int8:wi,uint16:Gt,uint32:Ei,uint8:Nt,uint8c:Oi,complex64:io,complex128:ho};var po=Vt(qn.allocUnsafe)?function(t){if(!ji(t))throw new TypeError(V("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));return qn.allocUnsafe(t)}:function(t){if(!ji(t))throw new TypeError(V("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));return new qn(t)};function go(t,r){var e=function(t){return co[t]||null}(t);return e?new e(r):null}function yo(t,r){return"generic"===t?function(t){var r,e;for(r=[],e=0;e<t;e++)r.push(0);return r}(r):"binary"===t?function(t){return function(t){var r;for(r=0;r<t.length;r++)t[r]=0;return t}(po(t))}(r):go(t,r)}function mo(t,r,e,n){var i,o,a,u,f,s,l,h,c,p;if(a=function(t){return t.dtype}(t),u=function(t,r){var e=t.shape;return r?Je(e):e}(t,!0),i=function(t,r){var e,n,i;return"object"!=typeof(i=t.strides)||null===i?0===(n=t.shape).length?[0]:("string"!=typeof(e=t.order)&&(e=Ge),We(n,e)):r?Je(i):i}(t,!0),o=function(t){var r,e,n;return"number"==typeof(n=t.offset)?n:0===(e=t.shape).length||"object"!=typeof(r=t.strides)||null===r?0:function(t,r){var e,n,i;for(n=t.length,e=0,i=0;i<n;i++)r[i]<0&&(e-=r[i]*(t[i]-1));return e}(e,r)}(t),f=function(t){var r,e;return"string"==typeof(e=t.order)?e:"object"!=typeof(r=t.strides)||null===r||1===(e=ut(r))||3===e?ze:2===e?$e:0===t.shape.length?ze:null}(t),l=u.length,r.ndims!==l)throw new RangeError(V("invalid argument. Number of slice dimensions does not match the number of array dimensions. Array shape: (%s). Slice dimensions: %u.",u.join(","),r.ndims));if(h=t.constructor,0===l)return new h(a,Xe(t),u,i,o,f,{readonly:!n});if(s=function(t){var r,e,n;for(r=t.data,e=[],n=0;n<r.length;n++)"number"!=typeof r[n]&&e.push(n);return e}(r),(p=Fe(r,u,!0)).code){if(e)throw new RangeError(V("invalid argument. Slice exceeds array bounds. Array shape: (%s).",u.join(",")));De(ke(c=Ne(p=Fe(r,u,!1)),s))>0&&(c=Ye(c.length))}else c=Ne(p);return 0===De(c)?function(t,r,e,n,i){var o,a;return o=0===(a=e.length)?[0]:Ye(a),new t(r,yo(r,0),e,o,0,n,{readonly:i})}(h,a,ke(c,s),f,!n):(o=function(t,r,e){var n,i,o;for(n=t.data,i=e,o=0;o<n.length;o++)i+=r[o]*n[o].start;return i}(p,i,o),0===(c=ke(c,s)).length?new h(a,Xe(t),[],[0],o,f,{readonly:!n}):(i=function(t,r,e){var n,i,o,a;for(n=t.data,i=[],o=0;o<e.length;o++)a=e[o],i.push(r[a]*n[a].step);return i}(p,i,s),new h(a,Xe(t),c,i,o,f,{readonly:!n})))}function wo(){var t,r=arguments,e="https://stdlib.io/e/"+r[0]+"?";for(t=1;t<r.length;t++)e+="&arg[]="+encodeURIComponent(r[t]);return e}return function(t,r){var e,n,i,o,a,u,f,s,l;if(i={strict:!0},n=arguments.length,!((s=t)instanceof de||null!==s&&"object"==typeof s&&"object"==typeof s.data&&"object"==typeof s.shape&&"object"==typeof s.strides&&"number"==typeof s.offset&&"string"==typeof s.order&&"number"==typeof s.ndims&&"string"==typeof s.dtype&&"number"==typeof s.length&&"object"==typeof s.flags&&"function"==typeof s.get&&"function"==typeof s.set))throw new TypeError(wo("1jV4f",t));if(Be(arguments[n-1])){if(W(e=arguments[n-=1],"strict")){if(!N(e.strict))throw new TypeError(wo("1jV2o","strict",e.strict));i.strict=e.strict}if(a=function(t){var r,e,n,i;if("object"!=typeof t||null===t)throw new TypeError(V("invalid argument. Must provide an ndarray. Value: `%s`.",t));if(!$r(e=t.shape))throw new TypeError(V("invalid argument. Must provide an ndarray. Value: `%s`.",t));for(r=[],i=0;i<e.length;i++){if(!Si(n=e[i]))throw new TypeError(V("invalid argument. Must provide an ndarray. Value: `%s`.",t));r.push(n)}return r}(t),1===n&&a.length>0)throw new RangeError(wo("1jVEt",a.join(","),0))}if((l=r)instanceof Ae||"MultiSlice"===Ot(l)){if(u=r,n>2)throw new Error(wo("1jV0m"))}else{if(Re(r)){if(o=r,n>2)throw new Error(wo("1jV0m"))}else for(o=[],f=1;f<n;f++)o.push(arguments[f]);try{u=Le(o)}catch(t){for(f=0;f<o.length;f++)try{new Ae(o[f])}catch(t){throw new TypeError(wo("1jVEu",String(o[f])))}}}return mo(t,u,i.strict,!1)}}));
//# sourceMappingURL=browser.js.map