-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
3 lines (3 loc) · 165 KB
/
index.js
File metadata and controls
3 lines (3 loc) · 165 KB
1
2
3
// Copyright (c) 2026 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("buffer"),require("process")):"function"==typeof define&&define.amd?define(["buffer","process"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).Uint16Vector=e(t.require$$0,t.require$$0$1)}(this,(function(t,e){"use strict";var n="function"==typeof Object.defineProperty?Object.defineProperty:null;var r=Object.defineProperty;function i(t){return"number"==typeof t}function o(t){var e,n="";for(e=0;e<t;e++)n+="0";return n}function a(t,e,n){var r=!1,i=e-t.length;return i<0||(function(t){return"-"===t[0]}(t)&&(r=!0,t=t.substr(1)),t=n?t+o(i):o(i)+t,r&&(t="-"+t)),t}var u=String.prototype.toLowerCase,f=String.prototype.toUpperCase;function l(t){var e,n,r;switch(t.specifier){case"b":e=2;break;case"o":e=8;break;case"x":case"X":e=16;break;default:e=10}if(n=t.arg,r=parseInt(n,10),!isFinite(r)){if(!i(n))throw new Error("invalid integer. Value: "+n);r=0}return r<0&&("u"===t.specifier||10!==e)&&(r=4294967295+r+1),r<0?(n=(-r).toString(e),t.precision&&(n=a(n,t.precision,t.padRight)),n="-"+n):(n=r.toString(e),r||t.precision?t.precision&&(n=a(n,t.precision,t.padRight)):n="",t.sign&&(n=t.sign+n)),16===e&&(t.alternate&&(n="0x"+n),n=t.specifier===f.call(t.specifier)?f.call(n):u.call(n)),8===e&&t.alternate&&"0"!==n.charAt(0)&&(n="0"+n),n}var s=Math.abs,c=String.prototype.toLowerCase,h=String.prototype.toUpperCase,p=String.prototype.replace,g=/e\+(\d)$/,m=/e-(\d)$/,y=/^(\d+)$/,d=/^(\d+)e/,b=/\.0$/,v=/\.0*e/,w=/(\..*[^0])0*e/;function _(t,e){var n,r;switch(e.specifier){case"e":case"E":r=t.toExponential(e.precision);break;case"f":case"F":r=t.toFixed(e.precision);break;case"g":case"G":s(t)<1e-4?((n=e.precision)>0&&(n-=1),r=t.toExponential(n)):r=t.toPrecision(e.precision),e.alternate||(r=p.call(r,w,"$1e"),r=p.call(r,v,"e"),r=p.call(r,b,""));break;default:throw new Error("invalid double notation. Value: "+e.specifier)}return r=p.call(r,g,"e+0$1"),r=p.call(r,m,"e-0$1"),e.alternate&&(r=p.call(r,y,"$1."),r=p.call(r,d,"$1.e")),t>=0&&e.sign&&(r=e.sign+r),r=e.specifier===h.call(e.specifier)?h.call(r):c.call(r)}function E(t){var e,n="";for(e=0;e<t;e++)n+=" ";return n}var x=String.fromCharCode,T=Array.isArray;function V(t){return t!=t}function O(t){var e={};return e.specifier=t.specifier,e.precision=void 0===t.precision?1:t.precision,e.width=t.width,e.flags=t.flags||"",e.mapping=t.mapping,e}function A(t){var e,n,r,o,u,f,s,c,h,p,g,m,y,d;if(!T(t))throw new TypeError("invalid argument. First argument must be an array. Value: `"+t+"`.");for(f="",s=1,h=0;h<t.length;h++)if(r=t[h],"string"==typeof r)f+=r;else{if(e=void 0!==r.precision,!(r=O(r)).specifier)throw new TypeError("invalid argument. Token is missing `specifier` property. Index: `"+h+"`. Value: `"+r+"`.");for(r.mapping&&(s=r.mapping),n=r.flags,p=0;p<n.length;p++)switch(o=n.charAt(p)){case" ":r.sign=" ";break;case"+":r.sign="+";break;case"-":r.padRight=!0,r.padZeros=!1;break;case"0":r.padZeros=n.indexOf("-")<0;break;case"#":r.alternate=!0;break;default:throw new Error("invalid flag: "+o)}if("*"===r.width){if(r.width=parseInt(arguments[s],10),s+=1,V(r.width))throw new TypeError("the argument for * width at position "+s+" is not a number. Value: `"+r.width+"`.");r.width<0&&(r.padRight=!0,r.width=-r.width)}if(e&&"*"===r.precision){if(r.precision=parseInt(arguments[s],10),s+=1,V(r.precision))throw new TypeError("the argument for * precision at position "+s+" is not a number. Value: `"+r.precision+"`.");r.precision<0&&(r.precision=1,e=!1)}switch(r.arg=arguments[s],r.specifier){case"b":case"o":case"x":case"X":case"d":case"i":case"u":e&&(r.padZeros=!1),r.arg=l(r);break;case"s":r.maxWidth=e?r.precision:-1,r.arg=String(r.arg);break;case"c":if(!V(r.arg)){if((u=parseInt(r.arg,10))<0||u>127)throw new Error("invalid character code. Value: "+r.arg);r.arg=V(u)?String(r.arg):x(u)}break;case"e":case"E":case"f":case"F":case"g":case"G":if(e||(r.precision=6),c=parseFloat(r.arg),!isFinite(c)){if(!i(r.arg))throw new Error("invalid floating-point number. Value: "+f);c=r.arg,r.padZeros=!1}r.arg=_(c,r);break;default:throw new Error("invalid specifier: "+r.specifier)}r.maxWidth>=0&&r.arg.length>r.maxWidth&&(r.arg=r.arg.substring(0,r.maxWidth)),r.padZeros?r.arg=a(r.arg,r.width||r.precision,r.padRight):r.width&&(r.arg=(g=r.arg,m=r.width,y=r.padRight,d=void 0,(d=m-g.length)<0?g:g=y?g+E(d):E(d)+g)),f+=r.arg||"",s+=1}return f}var j=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function S(t){var e={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]&&(e.precision="1"),e}function F(t){var e,n,r,i;for(n=[],i=0,r=j.exec(t);r;)(e=t.slice(i,j.lastIndex-r[0].length)).length&&n.push(e),"%"===r[6]?n.push("%"):n.push(S(r)),i=j.lastIndex,r=j.exec(t);return(e=t.slice(i)).length&&n.push(e),n}function L(t){var e,n;if("string"!=typeof t)throw new TypeError(L("invalid argument. First argument must be a string. Value: `%s`.",t));for(e=[F(t)],n=1;n<arguments.length;n++)e.push(arguments[n]);return A.apply(null,e)}var I,B=Object.prototype,R=B.toString,k=B.__defineGetter__,U=B.__defineSetter__,M=B.__lookupGetter__,N=B.__lookupSetter__;I=function(){try{return n({},"x",{}),!0}catch(t){return!1}}()?r:function(t,e,n){var r,i,o,a;if("object"!=typeof t||null===t||"[object Array]"===R.call(t))throw new TypeError(L("invalid argument. First argument must be an object. Value: `%s`.",t));if("object"!=typeof n||null===n||"[object Array]"===R.call(n))throw new TypeError(L("invalid argument. Property descriptor must be an object. Value: `%s`.",n));if((i="value"in n)&&(M.call(t,e)||N.call(t,e)?(r=t.__proto__,t.__proto__=B,delete t[e],t[e]=n.value,t.__proto__=r):t[e]=n.value),o="get"in n,a="set"in n,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&&k&&k.call(t,e,n.get),a&&U&&U.call(t,e,n.set),t};var P=I;function C(t,e,n){P(t,e,{configurable:!1,enumerable:!1,writable:!1,value:n})}function Y(t){return"number"==typeof t}var D="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function J(){return D&&"symbol"==typeof Symbol.toStringTag}var $=Object.prototype.toString;var z=Object.prototype.hasOwnProperty;function W(t,e){return null!=t&&z.call(t,e)}var G="function"==typeof Symbol?Symbol:void 0,q="function"==typeof G?G.toStringTag:"";var Z=J()?function(t){var e,n,r;if(null==t)return $.call(t);n=t[q],e=W(t,q);try{t[q]=void 0}catch(e){return $.call(t)}return r=$.call(t),e?t[q]=n:delete t[q],r}:function(t){return $.call(t)},X=Number,H=X.prototype.toString;var K=J();function Q(t){return"object"==typeof t&&(t instanceof X||(K?function(t){try{return H.call(t),!0}catch(t){return!1}}(t):"[object Number]"===Z(t)))}function tt(t){return Y(t)||Q(t)}C(tt,"isPrimitive",Y),C(tt,"isObject",Q);var et=Number.POSITIVE_INFINITY,nt=X.NEGATIVE_INFINITY,rt=Math.floor;function it(t){return rt(t)===t}function ot(t){return t<et&&t>nt&&it(t)}function at(t){return Y(t)&&ot(t)}function ut(t){return Q(t)&&ot(t.valueOf())}function ft(t){return at(t)||ut(t)}function lt(t){return at(t)&&t>=0}function st(t){return ut(t)&&t.valueOf()>=0}function ct(t){return lt(t)||st(t)}function ht(){return"function"==typeof G&&"symbol"==typeof G("foo")&&W(G,"iterator")&&"symbol"==typeof G.iterator}function pt(t){return function(){return t}}C(ft,"isPrimitive",at),C(ft,"isObject",ut),C(ct,"isPrimitive",lt),C(ct,"isObject",st);var gt=/./;function mt(t){return"boolean"==typeof t}var yt=Boolean,dt=Boolean.prototype.toString;var bt=J();function vt(t){return"object"==typeof t&&(t instanceof yt||(bt?function(t){try{return dt.call(t),!0}catch(t){return!1}}(t):"[object Boolean]"===Z(t)))}function wt(t){return mt(t)||vt(t)}C(wt,"isPrimitive",mt),C(wt,"isObject",vt);var _t="object"==typeof self?self:null,Et="object"==typeof window?window:null,xt="object"==typeof global?global:null,Tt="object"==typeof globalThis?globalThis:null;function Vt(t){if(arguments.length){if(!mt(t))throw new TypeError(L("invalid argument. Must provide a boolean. Value: `%s`.",t));if(t)return new Function("return this;")()}if(Tt)return Tt;if(_t)return _t;if(Et)return Et;if(xt)return xt;throw new Error("unexpected error. Unable to resolve global object.")}var Ot=Vt(),At=Ot.document&&Ot.document.childNodes,jt=Int8Array;function St(){return/^\s*function\s*([^(]*)/i}var Ft,Lt=/^\s*function\s*([^(]*)/i;C(St,"REGEXP",Lt),Ft=Array.isArray?Array.isArray:function(t){return"[object Array]"===Z(t)};var It=Ft;function Bt(t){if("function"!=typeof t)throw new TypeError(L("invalid argument. Must provide a function. Value: `%s`.",t));return function(e){var n,r;if(!It(e))return!1;if(0===(n=e.length))return!1;for(r=0;r<n;r++)if(!1===t(e[r]))return!1;return!0}}function Rt(t){return null!==t&&"object"==typeof t}function kt(t){return Rt(t)&&(t._isBuffer||t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t))}function Ut(t){var e,n,r;if(("Object"===(n=Z(t).slice(8,-1))||"Error"===n)&&t.constructor){if("string"==typeof(r=t.constructor).name)return r.name;if(e=Lt.exec(r.toString()))return e[1]}return kt(t)?"Buffer":n}C(Rt,"isObjectLikeArray",Bt(Rt));var Mt="function"==typeof gt||"object"==typeof jt||"function"==typeof At?function(t){return Ut(t).toLowerCase()}:function(t){var e;return null===t?"null":"object"===(e=typeof t)?Ut(t).toLowerCase():e};function Nt(t){return"function"===Mt(t)}var Pt,Ct=ht()?Symbol.iterator:null;function Yt(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)&&Nt(t.next)}Pt=ht()?function(t){var e;return!function(t){var e=typeof t;return"string"===e||"number"===e||"boolean"===e||"symbol"===e||"bigint"===e||null==t}(t)&&Nt(e=t[Ct])&&0===e.length&&Yt(t[Ct]())}:pt(!1);var Dt=Pt,Jt="function"==typeof ArrayBuffer;function $t(t){return Jt&&t instanceof ArrayBuffer||"[object ArrayBuffer]"===Z(t)}var zt=9007199254740991;function Wt(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&it(t.length)&&t.length>=0&&t.length<=zt}var Gt="function";function qt(t){return typeof t.get===Gt&&typeof t.set===Gt}var Zt={complex128:function(t,e){return t.get(e)},complex64:function(t,e){return t.get(e)},default:function(t,e){return t.get(e)}};function Xt(t){var e=Zt[t];return"function"==typeof e?e:Zt.default}var Ht={float64:function(t,e){return t[e]},float32:function(t,e){return t[e]},int32:function(t,e){return t[e]},int16:function(t,e){return t[e]},int8:function(t,e){return t[e]},uint32:function(t,e){return t[e]},uint16:function(t,e){return t[e]},uint8:function(t,e){return t[e]},uint8c:function(t,e){return t[e]},generic:function(t,e){return t[e]},default:function(t,e){return t[e]}};function Kt(t){var e=Ht[t];return"function"==typeof e?e:Ht.default}var Qt={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128",BooleanArray:"bool"},te="function"==typeof Float64Array;var ee="function"==typeof Float64Array?Float64Array:null;function ne(){var t,e,n;if("function"!=typeof ee)return!1;try{e=new ee([1,3.14,-3.14,NaN]),n=e,t=(te&&n instanceof Float64Array||"[object Float64Array]"===Z(n))&&1===e[0]&&3.14===e[1]&&-3.14===e[2]&&e[3]!=e[3]}catch(e){t=!1}return t}var re="function"==typeof Float64Array?Float64Array:void 0;var ie=ne()?re:function(){throw new Error("not implemented")},oe="function"==typeof Float32Array;var ae="function"==typeof Float32Array?Float32Array:null;var ue,fe="function"==typeof Float32Array?Float32Array:void 0;ue=function(){var t,e,n;if("function"!=typeof ae)return!1;try{e=new ae([1,3.14,-3.14,5e40]),n=e,t=(oe&&n instanceof Float32Array||"[object Float32Array]"===Z(n))&&1===e[0]&&3.140000104904175===e[1]&&-3.140000104904175===e[2]&&e[3]===et}catch(e){t=!1}return t}()?fe:function(){throw new Error("not implemented")};var le=ue,se="function"==typeof Uint32Array;var ce=4294967295,he="function"==typeof Uint32Array?Uint32Array:null;var pe,ge="function"==typeof Uint32Array?Uint32Array:void 0;pe=function(){var t,e,n;if("function"!=typeof he)return!1;try{e=new he(e=[1,3.14,-3.14,ce+1,ce+2]),n=e,t=(se&&n instanceof Uint32Array||"[object Uint32Array]"===Z(n))&&1===e[0]&&3===e[1]&&e[2]===ce-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}()?ge:function(){throw new Error("not implemented")};var me=pe,ye="function"==typeof Int32Array;var de=2147483647,be=-2147483648,ve="function"==typeof Int32Array?Int32Array:null;var we,_e="function"==typeof Int32Array?Int32Array:void 0;we=function(){var t,e,n;if("function"!=typeof ve)return!1;try{e=new ve([1,3.14,-3.14,de+1]),n=e,t=(ye&&n instanceof Int32Array||"[object Int32Array]"===Z(n))&&1===e[0]&&3===e[1]&&-3===e[2]&&e[3]===be}catch(e){t=!1}return t}()?_e:function(){throw new Error("not implemented")};var Ee=we,xe="function"==typeof Uint16Array;var Te=65535,Ve="function"==typeof Uint16Array?Uint16Array:null;var Oe,Ae="function"==typeof Uint16Array?Uint16Array:void 0;Oe=function(){var t,e,n;if("function"!=typeof Ve)return!1;try{e=new Ve(e=[1,3.14,-3.14,Te+1,Te+2]),n=e,t=(xe&&n instanceof Uint16Array||"[object Uint16Array]"===Z(n))&&1===e[0]&&3===e[1]&&e[2]===Te-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}()?Ae:function(){throw new Error("not implemented")};var je=Oe,Se="function"==typeof Int16Array;var Fe=32767,Le=-32768,Ie="function"==typeof Int16Array?Int16Array:null;var Be,Re="function"==typeof Int16Array?Int16Array:void 0;Be=function(){var t,e,n;if("function"!=typeof Ie)return!1;try{e=new Ie([1,3.14,-3.14,Fe+1]),n=e,t=(Se&&n instanceof Int16Array||"[object Int16Array]"===Z(n))&&1===e[0]&&3===e[1]&&-3===e[2]&&e[3]===Le}catch(e){t=!1}return t}()?Re:function(){throw new Error("not implemented")};var ke=Be,Ue="function"==typeof Uint8Array;var Me=255,Ne="function"==typeof Uint8Array?Uint8Array:null;var Pe,Ce="function"==typeof Uint8Array?Uint8Array:void 0;Pe=function(){var t,e,n;if("function"!=typeof Ne)return!1;try{e=new Ne(e=[1,3.14,-3.14,Me+1,Me+2]),n=e,t=(Ue&&n instanceof Uint8Array||"[object Uint8Array]"===Z(n))&&1===e[0]&&3===e[1]&&e[2]===Me-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}()?Ce:function(){throw new Error("not implemented")};var Ye=Pe,De="function"==typeof Uint8ClampedArray;var Je="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null;var $e,ze="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0;$e=function(){var t,e,n;if("function"!=typeof Je)return!1;try{e=new Je([-1,0,1,3.14,4.99,255,256]),n=e,t=(De&&n instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===Z(n))&&0===e[0]&&0===e[1]&&1===e[2]&&3===e[3]&&5===e[4]&&255===e[5]&&255===e[6]}catch(e){t=!1}return t}()?ze:function(){throw new Error("not implemented")};var We=$e,Ge="function"==typeof Int8Array;var qe=127,Ze=-128,Xe="function"==typeof Int8Array?Int8Array:null;var He,Ke="function"==typeof Int8Array?Int8Array:void 0;He=function(){var t,e,n;if("function"!=typeof Xe)return!1;try{e=new Xe([1,3.14,-3.14,qe+1]),n=e,t=(Ge&&n instanceof Int8Array||"[object Int8Array]"===Z(n))&&1===e[0]&&3===e[1]&&-3===e[2]&&e[3]===Ze}catch(e){t=!1}return t}()?Ke:function(){throw new Error("not implemented")};var Qe=He,tn=4294967295;function en(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&it(t.length)&&t.length>=0&&t.length<=tn}function nn(t){return"object"==typeof t&&null!==t&&!It(t)}function rn(t){return"string"==typeof t}var on=String.prototype.valueOf;var an=J();function un(t){return"object"==typeof t&&(t instanceof String||(an?function(t){try{return on.call(t),!0}catch(t){return!1}}(t):"[object String]"===Z(t)))}function fn(t){return rn(t)||un(t)}C(fn,"isPrimitive",rn),C(fn,"isObject",un);var ln=Bt(fn.isPrimitive),sn=Bt(fn.isObject),cn=Bt(fn);function hn(t,e,n){P(t,e,{configurable:!1,enumerable:!0,writable:!1,value:n})}function pn(t,e){if(!(this instanceof pn))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Y(t))throw new TypeError(L("invalid argument. Real component must be a number. Value: `%s`.",t));if(!Y(e))throw new TypeError(L("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return hn(this,"re",t),hn(this,"im",e),this}C(cn,"primitives",ln),C(cn,"objects",sn),C(pn,"name","Complex128"),C(pn,"BYTES_PER_ELEMENT",8),C(pn.prototype,"BYTES_PER_ELEMENT",8),C(pn.prototype,"byteLength",16),C(pn.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),C(pn.prototype,"toJSON",(function(){var t={type:"Complex128"};return t.re=this.re,t.im=this.im,t}));var gn="function"==typeof Math.fround?Math.fround:null,mn=new le(1);var yn="function"==typeof gn?gn:function(t){return mn[0]=t,mn[0]};function dn(t,e){if(!(this instanceof dn))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Y(t))throw new TypeError(L("invalid argument. Real component must be a number. Value: `%s`.",t));if(!Y(e))throw new TypeError(L("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return hn(this,"re",yn(t)),hn(this,"im",yn(e)),this}function bn(t){return t instanceof pn||t instanceof dn||"object"==typeof t&&null!==t&&"number"==typeof t.re&&"number"==typeof t.im}function vn(t){return it(t/2)}C(dn,"name","Complex64"),C(dn,"BYTES_PER_ELEMENT",4),C(dn.prototype,"BYTES_PER_ELEMENT",4),C(dn.prototype,"byteLength",8),C(dn.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),C(dn.prototype,"toJSON",(function(){var t={type:"Complex64"};return t.re=this.re,t.im=this.im,t}));var wn=8;function _n(t){return"object"==typeof t&&null!==t&&"Complex64Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===wn}var En=16;function xn(t){return"object"==typeof t&&null!==t&&"Complex128Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===En}function Tn(t,e,n){P(t,e,{configurable:!1,enumerable:!1,get:n})}function Vn(t){return t.re}function On(t){return t.im}function An(t,e){return new le(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*e,2*(t.length-e))}function jn(t,e){return new ie(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*e,2*(t.length-e))}function Sn(t){var e,n,r;for(e=[];!(n=t.next()).done;)if(en(r=n.value)&&r.length>=2)e.push(r[0],r[1]);else{if(!bn(r))return new TypeError(L("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",r));e.push(Vn(r),On(r))}return e}var Fn=2*le.BYTES_PER_ELEMENT,Ln=ht();function In(t){return t instanceof kn||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function Bn(t){return t===kn||"Complex128Array"===t.name}function Rn(t,e){return new dn(t[e*=2],t[e+1])}function kn(){var t,e,n,r;if(e=arguments.length,!(this instanceof kn))return 0===e?new kn:1===e?new kn(arguments[0]):2===e?new kn(arguments[0],arguments[1]):new kn(arguments[0],arguments[1],arguments[2]);if(0===e)n=new le(0);else if(1===e)if(lt(arguments[0]))n=new le(2*arguments[0]);else if(Wt(arguments[0]))if((r=(n=arguments[0]).length)&&It(n)&&bn(n[0])){if(n=function(t,e){var n,r,i,o;for(n=e.length,o=0,i=0;i<n;i++){if(!bn(r=e[i]))return null;t[o]=Vn(r),t[o+1]=On(r),o+=2}return t}(new le(2*r),n),null===n){if(!vn(r))throw new RangeError(L("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",r));n=new le(arguments[0])}}else{if(_n(n))n=An(n,0);else if(xn(n))n=jn(n,0);else if(!vn(r))throw new RangeError(L("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",r));n=new le(n)}else if($t(arguments[0])){if(!it((n=arguments[0]).byteLength/Fn))throw new RangeError(L("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",Fn,n.byteLength));n=new le(n)}else{if(!nn(arguments[0]))throw new TypeError(L("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));if(n=arguments[0],!1===Ln)throw new TypeError(L("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",n));if(!Nt(n[Ct]))throw new TypeError(L("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",n));if(!Nt((n=n[Ct]()).next))throw new TypeError(L("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",n));if((n=Sn(n))instanceof Error)throw n;n=new le(n)}else{if(!$t(n=arguments[0]))throw new TypeError(L("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",n));if(!lt(t=arguments[1]))throw new TypeError(L("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",t));if(!it(t/Fn))throw new RangeError(L("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",Fn,t));if(2===e){if(!it((r=n.byteLength-t)/Fn))throw new RangeError(L("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",Fn,r));n=new le(n,t)}else{if(!lt(r=arguments[2]))throw new TypeError(L("invalid argument. Length must be a nonnegative integer. Value: `%s`.",r));if(r*Fn>n.byteLength-t)throw new RangeError(L("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",r*Fn));n=new le(n,t,2*r)}}return C(this,"_buffer",n),C(this,"_length",n.length/2),this}function Un(t){return t.re}function Mn(t){return t.im}function Nn(t){var e,n,r;for(e=[];!(n=t.next()).done;)if(en(r=n.value)&&r.length>=2)e.push(r[0],r[1]);else{if(!bn(r))return new TypeError(L("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",r));e.push(Un(r),Mn(r))}return e}C(kn,"BYTES_PER_ELEMENT",Fn),C(kn,"name","Complex64Array"),C(kn,"from",(function(t){var e,n,r,i,o,a,u,f,l,s,c,h;if(!Nt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((n=arguments.length)>1){if(!Nt(r=arguments[1]))throw new TypeError(L("invalid argument. Second argument must be a function. Value: `%s`.",r));n>2&&(e=arguments[2])}if(In(t)){if(f=t.length,r){for(o=(i=new this(f))._buffer,h=0,c=0;c<f;c++){if(bn(s=r.call(e,t.get(c),c)))o[h]=Vn(s),o[h+1]=On(s);else{if(!(en(s)&&s.length>=2))throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[h]=s[0],o[h+1]=s[1]}h+=2}return i}return new this(t)}if(Wt(t)){if(r){for(f=t.length,u=t.get&&t.set?Xt("default"):Kt("default"),c=0;c<f;c++)if(!bn(u(t,c))){l=!0;break}if(l){if(!vn(f))throw new RangeError(L("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,f));for(o=(i=new this(f/2))._buffer,c=0;c<f;c++)o[c]=r.call(e,u(t,c),c);return i}for(o=(i=new this(f))._buffer,h=0,c=0;c<f;c++){if(bn(s=r.call(e,u(t,c),c)))o[h]=Vn(s),o[h+1]=On(s);else{if(!(en(s)&&s.length>=2))throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[h]=s[0],o[h+1]=s[1]}h+=2}return i}return new this(t)}if(nn(t)&&Ln&&Nt(t[Ct])){if(!Nt((o=t[Ct]()).next))throw new TypeError(L("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=r?function(t,e,n){var r,i,o,a;for(r=[],a=-1;!(i=t.next()).done;)if(a+=1,en(o=e.call(n,i.value,a))&&o.length>=2)r.push(o[0],o[1]);else{if(!bn(o))return new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));r.push(Vn(o),On(o))}return r}(o,r,e):Sn(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,c=0;c<f;c++)o[c]=a[c];return i}throw new TypeError(L("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t))})),C(kn,"of",(function(){var t,e;if(!Nt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);return new this(t)})),C(kn.prototype,"at",(function(t){if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!it(t))throw new TypeError(L("invalid argument. Must provide an integer. Value: `%s`.",t));if(t<0&&(t+=this._length),!(t<0||t>=this._length))return Rn(this._buffer,t)})),Tn(kn.prototype,"buffer",(function(){return this._buffer.buffer})),Tn(kn.prototype,"byteLength",(function(){return this._buffer.byteLength})),Tn(kn.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),C(kn.prototype,"BYTES_PER_ELEMENT",kn.BYTES_PER_ELEMENT),C(kn.prototype,"copyWithin",(function(t,e){if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*e):this._buffer.copyWithin(2*t,2*e,2*arguments[2]),this})),C(kn.prototype,"entries",(function(){var t,e,n,r,i,o;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,r=this._buffer,n=this._length,o=-1,C(e={},"next",(function(){if(o+=1,i||o>=n)return{done:!0};return{value:[o,Rn(r,o)],done:!1}})),C(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ct&&C(e,Ct,(function(){return t.entries()})),e})),C(kn.prototype,"every",(function(t,e){var n,r;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=0;r<this._length;r++)if(!t.call(e,Rn(n,r),r,this))return!1;return!0})),C(kn.prototype,"fill",(function(t,e,n){var r,i,o,a,u,f;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!bn(t))throw new TypeError(L("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(r=this._buffer,i=this._length,arguments.length>1){if(!it(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!it(n))throw new TypeError(L("invalid argument. Third argument must be an integer. Value: `%s`.",n));n<0&&(n+=i)<0&&(n=0),n>i&&(n=i)}else n=i}else e=0,n=i;for(a=Vn(t),u=On(t),f=e;f<n;f++)r[o=2*f]=a,r[o+1]=u;return this})),C(kn.prototype,"filter",(function(t,e){var n,r,i,o;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=[],i=0;i<this._length;i++)o=Rn(n,i),t.call(e,o,i,this)&&r.push(o);return new this.constructor(r)})),C(kn.prototype,"find",(function(t,e){var n,r,i;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=0;r<this._length;r++)if(i=Rn(n,r),t.call(e,i,r,this))return i})),C(kn.prototype,"findIndex",(function(t,e){var n,r,i;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=0;r<this._length;r++)if(i=Rn(n,r),t.call(e,i,r,this))return r;return-1})),C(kn.prototype,"findLast",(function(t,e){var n,r,i;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=this._length-1;r>=0;r--)if(i=Rn(n,r),t.call(e,i,r,this))return i})),C(kn.prototype,"findLastIndex",(function(t,e){var n,r,i;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=this._length-1;r>=0;r--)if(i=Rn(n,r),t.call(e,i,r,this))return r;return-1})),C(kn.prototype,"forEach",(function(t,e){var n,r,i;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=0;r<this._length;r++)i=Rn(n,r),t.call(e,i,r,this)})),C(kn.prototype,"get",(function(t){if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!lt(t))throw new TypeError(L("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return Rn(this._buffer,t)})),C(kn.prototype,"includes",(function(t,e){var n,r,i,o,a;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!bn(t))throw new TypeError(L("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!it(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=Vn(t),o=On(t),n=this._buffer,a=e;a<this._length;a++)if(i===n[r=2*a]&&o===n[r+1])return!0;return!1})),C(kn.prototype,"indexOf",(function(t,e){var n,r,i,o,a;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!bn(t))throw new TypeError(L("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!it(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=Vn(t),o=On(t),n=this._buffer,a=e;a<this._length;a++)if(i===n[r=2*a]&&o===n[r+1])return a;return-1})),C(kn.prototype,"join",(function(t){var e,n,r,i;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)r=",";else{if(!rn(t))throw new TypeError(L("invalid argument. First argument must be a string. Value: `%s`.",t));r=t}for(e=[],n=this._buffer,i=0;i<this._length;i++)e.push(Rn(n,i).toString());return e.join(r)})),C(kn.prototype,"keys",(function(){var t,e,n,r,i;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,n=this._length,i=-1,C(e={},"next",(function(){if(i+=1,r||i>=n)return{done:!0};return{value:i,done:!1}})),C(e,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ct&&C(e,Ct,(function(){return t.keys()})),e})),C(kn.prototype,"lastIndexOf",(function(t,e){var n,r,i,o,a;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!bn(t))throw new TypeError(L("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!it(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=Vn(t),o=On(t),n=this._buffer,a=e;a>=0;a--)if(i===n[r=2*a]&&o===n[r+1])return a;return-1})),Tn(kn.prototype,"length",(function(){return this._length})),C(kn.prototype,"map",(function(t,e){var n,r,i,o,a;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(bn(a=t.call(e,Rn(r,o),o,this)))n[2*o]=Vn(a),n[2*o+1]=On(a);else{if(!en(a)||2!==a.length)throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));n[2*o]=a[0],n[2*o+1]=a[1]}return i})),C(kn.prototype,"reduce",(function(t,e){var n,r,i,o;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));if(n=this._buffer,i=this._length,arguments.length>1)r=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");r=Rn(n,0),o=1}for(;o<i;o++)r=t(r,Rn(n,o),o,this);return r})),C(kn.prototype,"reduceRight",(function(t,e){var n,r,i,o;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));if(n=this._buffer,i=this._length,arguments.length>1)r=e,o=i-1;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");r=Rn(n,i-1),o=i-2}for(;o>=0;o--)r=t(r,Rn(n,o),o,this);return r})),C(kn.prototype,"reverse",(function(){var t,e,n,r,i,o;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,t=this._buffer,r=rt(n/2),i=0;i<r;i++)o=n-i-1,e=t[2*i],t[2*i]=t[2*o],t[2*o]=e,e=t[2*i+1],t[2*i+1]=t[2*o+1],t[2*o+1]=e;return this})),C(kn.prototype,"set",(function(t){var e,n,r,i,o,a,u,f,l;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(r=this._buffer,arguments.length>1){if(!lt(n=arguments[1]))throw new TypeError(L("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(bn(t)){if(n>=this._length)throw new RangeError(L("invalid argument. Index argument is out-of-bounds. Value: `%u`.",n));return r[n*=2]=Vn(t),void(r[n+1]=On(t))}if(In(t)){if(n+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t._buffer,l=r.byteOffset+n*Fn,e.buffer===r.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new le(e.length),f=0;f<e.length;f++)i[f]=e[f];e=i}for(n*=2,l=0,f=0;f<a;f++)r[n]=e[l],r[n+1]=e[l+1],n+=2,l+=2}else{if(!Wt(t))throw new TypeError(L("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(!bn(t[f])){o=!0;break}if(o){if(!vn(a))throw new RangeError(L("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",a));if(n+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t,l=r.byteOffset+n*Fn,e.buffer===r.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new le(a),f=0;f<a;f++)i[f]=e[f];e=i}for(n*=2,a/=2,l=0,f=0;f<a;f++)r[n]=e[l],r[n+1]=e[l+1],n+=2,l+=2;return}if(n+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(n*=2,f=0;f<a;f++)u=t[f],r[n]=Vn(u),r[n+1]=On(u),n+=2}})),C(kn.prototype,"slice",(function(t,e){var n,r,i,o,a,u,f;if(!In(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,e=u;else{if(!it(t))throw new TypeError(L("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=u)<0&&(t=0),1===arguments.length)e=u;else{if(!it(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=u)<0&&(e=0):e>u&&(e=u)}}for(n=t<e?e-t:0,r=(i=new this.constructor(n))._buffer,f=0;f<n;f++)o=2*(f+t),r[2*f]=a[o],r[2*f+1]=a[o+1];return i})),C(kn.prototype,"some",(function(t,e){var n,r;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=0;r<this._length;r++)if(t.call(e,Rn(n,r),r,this))return!0;return!1})),C(kn.prototype,"sort",(function(t){var e,n,r,i,o;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=this._length,e=[],i=0;i<r;i++)e.push(Rn(n,i));for(e.sort(t),i=0;i<r;i++)n[o=2*i]=Vn(e[i]),n[o+1]=On(e[i]);return this})),C(kn.prototype,"subarray",(function(t,e){var n,r,i;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(r=this._buffer,i=this._length,0===arguments.length)t=0,e=i;else{if(!it(t))throw new TypeError(L("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=i)<0&&(t=0),1===arguments.length)e=i;else{if(!it(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=i)<0&&(e=0):e>i&&(e=i)}}return t>=i?(i=0,n=r.byteLength):t>=e?(i=0,n=r.byteOffset+t*Fn):(i=e-t,n=r.byteOffset+t*Fn),new this.constructor(r.buffer,n,i<0?0:i)})),C(kn.prototype,"toLocaleString",(function(t,e){var n,r,i,o,a;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)r=[];else{if(!rn(t)&&!ln(t))throw new TypeError(L("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));r=t}if(arguments.length<2)n={};else{if(!nn(e))throw new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",e));n=e}for(o=this._buffer,i=[],a=0;a<this._length;a++)i.push(Rn(o,a).toLocaleString(r,n));return i.join(",")})),C(kn.prototype,"toReversed",(function(){var t,e,n,r,i,o;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,e=new this.constructor(n),r=this._buffer,t=e._buffer,i=0;i<n;i++)o=n-i-1,t[2*i]=r[2*o],t[2*i+1]=r[2*o+1];return e})),C(kn.prototype,"toSorted",(function(t){var e,n,r,i;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=this._length,e=[],i=0;i<r;i++)e.push(Rn(n,i));return e.sort(t),new kn(e)})),C(kn.prototype,"toString",(function(){var t,e,n;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],e=this._buffer,n=0;n<this._length;n++)t.push(Rn(e,n).toString());return t.join(",")})),C(kn.prototype,"values",(function(){var t,e,n,r,i,o;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,i=this._buffer,n=this._length,o=-1,C(t={},"next",(function(){if(o+=1,r||o>=n)return{done:!0};return{value:Rn(i,o),done:!1}})),C(t,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ct&&C(t,Ct,(function(){return e.values()})),t})),C(kn.prototype,"with",(function(t,e){var n,r,i;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!it(t))throw new TypeError(L("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(L("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!bn(e))throw new TypeError(L("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(n=(r=new this.constructor(this._buffer))._buffer)[2*t]=Vn(e),n[2*t+1]=On(e),r}));var Pn=2*ie.BYTES_PER_ELEMENT,Cn=ht();function Yn(t){return t instanceof $n||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function Dn(t){return t===$n||"Complex64Array"===t.name}function Jn(t,e){return new pn(t[e*=2],t[e+1])}function $n(){var t,e,n,r;if(e=arguments.length,!(this instanceof $n))return 0===e?new $n:1===e?new $n(arguments[0]):2===e?new $n(arguments[0],arguments[1]):new $n(arguments[0],arguments[1],arguments[2]);if(0===e)n=new ie(0);else if(1===e)if(lt(arguments[0]))n=new ie(2*arguments[0]);else if(Wt(arguments[0]))if((r=(n=arguments[0]).length)&&It(n)&&bn(n[0])){if(n=function(t,e){var n,r,i,o;for(n=e.length,o=0,i=0;i<n;i++){if(!bn(r=e[i]))return null;t[o]=Un(r),t[o+1]=Mn(r),o+=2}return t}(new ie(2*r),n),null===n){if(!vn(r))throw new RangeError(L("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",r));n=new ie(arguments[0])}}else{if(_n(n))n=An(n,0);else if(xn(n))n=jn(n,0);else if(!vn(r))throw new RangeError(L("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",r));n=new ie(n)}else if($t(arguments[0])){if(!it((n=arguments[0]).byteLength/Pn))throw new RangeError(L("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",Pn,n.byteLength));n=new ie(n)}else{if(!nn(arguments[0]))throw new TypeError(L("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));if(n=arguments[0],!1===Cn)throw new TypeError(L("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",n));if(!Nt(n[Ct]))throw new TypeError(L("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",n));if(!Nt((n=n[Ct]()).next))throw new TypeError(L("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",n));if((n=Nn(n))instanceof Error)throw n;n=new ie(n)}else{if(!$t(n=arguments[0]))throw new TypeError(L("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",n));if(!lt(t=arguments[1]))throw new TypeError(L("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",t));if(!it(t/Pn))throw new RangeError(L("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",Pn,t));if(2===e){if(!it((r=n.byteLength-t)/Pn))throw new RangeError(L("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",Pn,r));n=new ie(n,t)}else{if(!lt(r=arguments[2]))throw new TypeError(L("invalid argument. Length must be a nonnegative integer. Value: `%s`.",r));if(r*Pn>n.byteLength-t)throw new RangeError(L("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",r*Pn));n=new ie(n,t,2*r)}}return C(this,"_buffer",n),C(this,"_length",n.length/2),this}function zn(t){var e,n;for(e=[];!(n=t.next()).done;)e.push(yt(n.value));return e}C($n,"BYTES_PER_ELEMENT",Pn),C($n,"name","Complex128Array"),C($n,"from",(function(t){var e,n,r,i,o,a,u,f,l,s,c,h;if(!Nt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Dn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((n=arguments.length)>1){if(!Nt(r=arguments[1]))throw new TypeError(L("invalid argument. Second argument must be a function. Value: `%s`.",r));n>2&&(e=arguments[2])}if(Yn(t)){if(f=t.length,r){for(o=(i=new this(f))._buffer,h=0,c=0;c<f;c++){if(bn(s=r.call(e,t.get(c),c)))o[h]=Un(s),o[h+1]=Mn(s);else{if(!(en(s)&&s.length>=2))throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[h]=s[0],o[h+1]=s[1]}h+=2}return i}return new this(t)}if(Wt(t)){if(r){for(f=t.length,u=t.get&&t.set?Xt("default"):Kt("default"),c=0;c<f;c++)if(!bn(u(t,c))){l=!0;break}if(l){if(!vn(f))throw new RangeError(L("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,c=0;c<f;c++)o[c]=r.call(e,u(t,c),c);return i}for(o=(i=new this(f))._buffer,h=0,c=0;c<f;c++){if(bn(s=r.call(e,u(t,c),c)))o[h]=Un(s),o[h+1]=Mn(s);else{if(!(en(s)&&s.length>=2))throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[h]=s[0],o[h+1]=s[1]}h+=2}return i}return new this(t)}if(nn(t)&&Cn&&Nt(t[Ct])){if(!Nt((o=t[Ct]()).next))throw new TypeError(L("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=r?function(t,e,n){var r,i,o,a;for(r=[],a=-1;!(i=t.next()).done;)if(a+=1,en(o=e.call(n,i.value,a))&&o.length>=2)r.push(o[0],o[1]);else{if(!bn(o))return new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));r.push(Un(o),Mn(o))}return r}(o,r,e):Nn(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,c=0;c<f;c++)o[c]=a[c];return i}throw new TypeError(L("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t))})),C($n,"of",(function(){var t,e;if(!Nt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Dn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);return new this(t)})),C($n.prototype,"at",(function(t){if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!it(t))throw new TypeError(L("invalid argument. Must provide an integer. Value: `%s`.",t));if(t<0&&(t+=this._length),!(t<0||t>=this._length))return Jn(this._buffer,t)})),Tn($n.prototype,"buffer",(function(){return this._buffer.buffer})),Tn($n.prototype,"byteLength",(function(){return this._buffer.byteLength})),Tn($n.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),C($n.prototype,"BYTES_PER_ELEMENT",$n.BYTES_PER_ELEMENT),C($n.prototype,"copyWithin",(function(t,e){if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*e):this._buffer.copyWithin(2*t,2*e,2*arguments[2]),this})),C($n.prototype,"entries",(function(){var t,e,n,r,i,o,a;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,t=this._buffer,r=this._length,o=-1,a=-2,C(n={},"next",(function(){var e;if(o+=1,i||o>=r)return{done:!0};return e=new pn(t[a+=2],t[a+1]),{value:[o,e],done:!1}})),C(n,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ct&&C(n,Ct,(function(){return e.entries()})),n})),C($n.prototype,"every",(function(t,e){var n,r;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=0;r<this._length;r++)if(!t.call(e,Jn(n,r),r,this))return!1;return!0})),C($n.prototype,"fill",(function(t,e,n){var r,i,o,a,u,f;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!bn(t))throw new TypeError(L("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(r=this._buffer,i=this._length,arguments.length>1){if(!it(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!it(n))throw new TypeError(L("invalid argument. Third argument must be an integer. Value: `%s`.",n));n<0&&(n+=i)<0&&(n=0),n>i&&(n=i)}else n=i}else e=0,n=i;for(a=Un(t),u=Mn(t),f=e;f<n;f++)r[o=2*f]=a,r[o+1]=u;return this})),C($n.prototype,"filter",(function(t,e){var n,r,i,o;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=[],i=0;i<this._length;i++)o=Jn(n,i),t.call(e,o,i,this)&&r.push(o);return new this.constructor(r)})),C($n.prototype,"find",(function(t,e){var n,r,i;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=0;r<this._length;r++)if(i=Jn(n,r),t.call(e,i,r,this))return i})),C($n.prototype,"findIndex",(function(t,e){var n,r,i;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=0;r<this._length;r++)if(i=Jn(n,r),t.call(e,i,r,this))return r;return-1})),C($n.prototype,"findLast",(function(t,e){var n,r,i;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=this._length-1;r>=0;r--)if(i=Jn(n,r),t.call(e,i,r,this))return i})),C($n.prototype,"findLastIndex",(function(t,e){var n,r,i;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=this._length-1;r>=0;r--)if(i=Jn(n,r),t.call(e,i,r,this))return r;return-1})),C($n.prototype,"forEach",(function(t,e){var n,r,i;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=0;r<this._length;r++)i=Jn(n,r),t.call(e,i,r,this)})),C($n.prototype,"get",(function(t){if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!lt(t))throw new TypeError(L("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return Jn(this._buffer,t)})),Tn($n.prototype,"length",(function(){return this._length})),C($n.prototype,"includes",(function(t,e){var n,r,i,o,a;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!bn(t))throw new TypeError(L("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!it(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=Un(t),o=Mn(t),n=this._buffer,a=e;a<this._length;a++)if(i===n[r=2*a]&&o===n[r+1])return!0;return!1})),C($n.prototype,"indexOf",(function(t,e){var n,r,i,o,a;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!bn(t))throw new TypeError(L("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!it(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=Un(t),o=Mn(t),n=this._buffer,a=e;a<this._length;a++)if(i===n[r=2*a]&&o===n[r+1])return a;return-1})),C($n.prototype,"join",(function(t){var e,n,r,i;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)r=",";else{if(!fn(t))throw new TypeError(L("invalid argument. First argument must be a string. Value: `%s`.",t));r=t}for(e=[],n=this._buffer,i=0;i<this._length;i++)e.push(Jn(n,i).toString());return e.join(r)})),C($n.prototype,"keys",(function(){var t,e,n,r,i;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,n=this._length,i=-1,C(e={},"next",(function(){if(i+=1,r||i>=n)return{done:!0};return{value:i,done:!1}})),C(e,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ct&&C(e,Ct,(function(){return t.keys()})),e})),C($n.prototype,"lastIndexOf",(function(t,e){var n,r,i,o,a;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!bn(t))throw new TypeError(L("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!it(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=Un(t),o=Mn(t),n=this._buffer,a=e;a>=0;a--)if(i===n[r=2*a]&&o===n[r+1])return a;return-1})),C($n.prototype,"map",(function(t,e){var n,r,i,o,a;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(bn(a=t.call(e,Jn(r,o),o,this)))n[2*o]=Un(a),n[2*o+1]=Mn(a);else{if(!en(a)||2!==a.length)throw new TypeError(L("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));n[2*o]=a[0],n[2*o+1]=a[1]}return i})),C($n.prototype,"reduce",(function(t,e){var n,r,i,o;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));if(n=this._buffer,i=this._length,arguments.length>1)r=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");r=Jn(n,0),o=1}for(;o<i;o++)r=t(r,Jn(n,o),o,this);return r})),C($n.prototype,"reduceRight",(function(t,e){var n,r,i,o;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));if(n=this._buffer,i=this._length,arguments.length>1)r=e,o=i-1;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");r=Jn(n,i-1),o=i-2}for(;o>=0;o--)r=t(r,Jn(n,o),o,this);return r})),C($n.prototype,"reverse",(function(){var t,e,n,r,i,o;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,t=this._buffer,r=rt(n/2),i=0;i<r;i++)o=n-i-1,e=t[2*i],t[2*i]=t[2*o],t[2*o]=e,e=t[2*i+1],t[2*i+1]=t[2*o+1],t[2*o+1]=e;return this})),C($n.prototype,"set",(function(t){var e,n,r,i,o,a,u,f,l;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(r=this._buffer,arguments.length>1){if(!lt(n=arguments[1]))throw new TypeError(L("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(bn(t)){if(n>=this._length)throw new RangeError(L("invalid argument. Index argument is out-of-bounds. Value: `%u`.",n));return r[n*=2]=Un(t),void(r[n+1]=Mn(t))}if(Yn(t)){if(n+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t._buffer,l=r.byteOffset+n*Pn,e.buffer===r.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new ie(e.length),f=0;f<e.length;f++)i[f]=e[f];e=i}for(n*=2,l=0,f=0;f<a;f++)r[n]=e[l],r[n+1]=e[l+1],n+=2,l+=2}else{if(!Wt(t))throw new TypeError(L("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(!bn(t[f])){o=!0;break}if(o){if(!vn(a))throw new RangeError(L("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",a));if(n+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t,l=r.byteOffset+n*Pn,e.buffer===r.buffer&&e.byteOffset<l&&e.byteOffset+e.byteLength>l){for(i=new ie(a),f=0;f<a;f++)i[f]=e[f];e=i}for(n*=2,a/=2,l=0,f=0;f<a;f++)r[n]=e[l],r[n+1]=e[l+1],n+=2,l+=2;return}if(n+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(n*=2,f=0;f<a;f++)u=t[f],r[n]=Un(u),r[n+1]=Mn(u),n+=2}})),C($n.prototype,"slice",(function(t,e){var n,r,i,o,a,u,f;if(!Yn(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,e=u;else{if(!it(t))throw new TypeError(L("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=u)<0&&(t=0),1===arguments.length)e=u;else{if(!it(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=u)<0&&(e=0):e>u&&(e=u)}}for(n=t<e?e-t:0,r=(i=new this.constructor(n))._buffer,f=0;f<n;f++)o=2*(f+t),r[2*f]=a[o],r[2*f+1]=a[o+1];return i})),C($n.prototype,"some",(function(t,e){var n,r;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=0;r<this._length;r++)if(t.call(e,Jn(n,r),r,this))return!0;return!1})),C($n.prototype,"sort",(function(t){var e,n,r,i,o;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=this._length,e=[],i=0;i<r;i++)e.push(Jn(n,i));for(e.sort(t),i=0;i<r;i++)n[o=2*i]=Un(e[i]),n[o+1]=Mn(e[i]);return this})),C($n.prototype,"subarray",(function(t,e){var n,r,i;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(r=this._buffer,i=this._length,0===arguments.length)t=0,e=i;else{if(!it(t))throw new TypeError(L("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=i)<0&&(t=0),1===arguments.length)e=i;else{if(!it(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=i)<0&&(e=0):e>i&&(e=i)}}return t>=i?(i=0,n=r.byteLength):t>=e?(i=0,n=r.byteOffset+t*Pn):(i=e-t,n=r.byteOffset+t*Pn),new this.constructor(r.buffer,n,i<0?0:i)})),C($n.prototype,"toLocaleString",(function(t,e){var n,r,i,o,a;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)r=[];else{if(!fn(t)&&!ln(t))throw new TypeError(L("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));r=t}if(arguments.length<2)n={};else{if(!nn(e))throw new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",e));n=e}for(o=this._buffer,i=[],a=0;a<this._length;a++)i.push(Jn(o,a).toLocaleString(r,n));return i.join(",")})),C($n.prototype,"toReversed",(function(){var t,e,n,r,i,o;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,e=new this.constructor(n),r=this._buffer,t=e._buffer,i=0;i<n;i++)o=n-i-1,t[2*i]=r[2*o],t[2*i+1]=r[2*o+1];return e})),C($n.prototype,"toSorted",(function(t){var e,n,r,i;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=this._length,e=[],i=0;i<r;i++)e.push(Jn(n,i));return e.sort(t),new $n(e)})),C($n.prototype,"toString",(function(){var t,e,n;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],e=this._buffer,n=0;n<this._length;n++)t.push(Jn(e,n).toString());return t.join(",")})),C($n.prototype,"values",(function(){var t,e,n,r,i,o;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,i=this._buffer,n=this._length,o=-1,C(t={},"next",(function(){if(o+=1,r||o>=n)return{done:!0};return{value:Jn(i,o),done:!1}})),C(t,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ct&&C(t,Ct,(function(){return e.values()})),t})),C($n.prototype,"with",(function(t,e){var n,r,i;if(!Yn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!it(t))throw new TypeError(L("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(L("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!bn(e))throw new TypeError(L("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(n=(r=new this.constructor(this._buffer))._buffer)[2*t]=Un(e),n[2*t+1]=Mn(e),r}));var Wn=Ye.BYTES_PER_ELEMENT,Gn=ht();function qn(t){return"object"==typeof t&&null!==t&&"BooleanArray"===t.constructor.name&&t.BYTES_PER_ELEMENT===Wn}function Zn(t){return t===Xn}function Xn(){var t,e,n,r,i;if(e=arguments.length,!(this instanceof Xn))return 0===e?new Xn:1===e?new Xn(arguments[0]):2===e?new Xn(arguments[0],arguments[1]):new Xn(arguments[0],arguments[1],arguments[2]);if(0===e)n=new Ye(0);else if(1===e)if(lt(i=arguments[0]))n=new Ye(i);else if(Wt(i))n=function(t,e){var n,r;for(n=e.length,r=0;r<n;r++)t[r]=yt(e[r]);return t}(new Ye(i.length),i);else if($t(i))n=new Ye(i);else{if(!nn(i))throw new TypeError(L("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(!1===Gn)throw new TypeError(L("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",i));if(!Nt(i[Ct]))throw new TypeError(L("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(!Nt((n=i[Ct]()).next))throw new TypeError(L("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));n=new Ye(zn(n))}else{if(!$t(n=arguments[0]))throw new TypeError(L("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",n));if(!lt(t=arguments[1]))throw new TypeError(L("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",t));if(2===e)n=new Ye(n,t);else{if(!lt(r=arguments[2]))throw new TypeError(L("invalid argument. Length must be a nonnegative integer. Value: `%s`.",r));if(r*Wn>n.byteLength-t)throw new RangeError(L("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",r*Wn));n=new Ye(n,t,r)}}return C(this,"_buffer",n),C(this,"_length",n.length),this}C(Xn,"BYTES_PER_ELEMENT",Wn),C(Xn,"name","BooleanArray"),C(Xn,"from",(function(t){var e,n,r,i,o,a,u,f,l;if(!Nt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Zn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((n=arguments.length)>1){if(!Nt(r=arguments[1]))throw new TypeError(L("invalid argument. Second argument must be a function. Value: `%s`.",r));n>2&&(e=arguments[2])}if(Wt(t)){if(r){for(f=t.length,u=t.get&&t.set?Xt("default"):Kt("default"),o=(i=new this(f))._buffer,l=0;l<f;l++)o[l]=yt(r.call(e,u(t,l),l));return i}return new this(t)}if(nn(t)&&Gn&&Nt(t[Ct])){if(!Nt((o=t[Ct]()).next))throw new TypeError(L("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));for(a=r?function(t,e,n){var r,i,o;for(r=[],o=-1;!(i=t.next()).done;)o+=1,r.push(yt(e.call(n,i.value,o)));return r}(o,r,e):zn(o),o=(i=new this(f=a.length))._buffer,l=0;l<f;l++)o[l]=a[l];return i}throw new TypeError(L("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t))})),C(Xn,"of",(function(){var t,e;if(!Nt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Zn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);return new this(t)})),C(Xn.prototype,"at",(function(t){var e,n;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!at(t))throw new TypeError(L("invalid argument. Must provide an integer. Value: `%s`.",t));if(n=this._length,e=this._buffer,t<0&&(t+=n),!(t<0||t>=n))return yt(e[t])})),Tn(Xn.prototype,"buffer",(function(){return this._buffer.buffer})),Tn(Xn.prototype,"byteLength",(function(){return this._buffer.byteLength})),Tn(Xn.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),C(Xn.prototype,"BYTES_PER_ELEMENT",Xn.BYTES_PER_ELEMENT),C(Xn.prototype,"copyWithin",(function(t,e){if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return 2===arguments.length?this._buffer.copyWithin(t,e):this._buffer.copyWithin(t,e,arguments[2]),this})),C(Xn.prototype,"entries",(function(){var t,e,n,r,i,o;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return t=this,r=this._buffer,n=this._length,o=-1,C(e={},"next",(function(){if(o+=1,i||o>=n)return{done:!0};return{value:[o,yt(r[o])],done:!1}})),C(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ct&&C(e,Ct,(function(){return t.entries()})),e})),C(Xn.prototype,"every",(function(t,e){var n,r;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=0;r<this._length;r++)if(!t.call(e,yt(n[r]),r,this))return!1;return!0})),C(Xn.prototype,"fill",(function(t,e,n){var r,i,o,a;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!mt(t))throw new TypeError(L("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(r=this._buffer,i=this._length,arguments.length>1){if(!at(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!at(n))throw new TypeError(L("invalid argument. Third argument must be an integer. Value: `%s`.",n));n<0&&(n+=i)<0&&(n=0),n>i&&(n=i)}else n=i}else e=0,n=i;for(o=t?1:0,a=e;a<n;a++)r[a]=o;return this})),C(Xn.prototype,"filter",(function(t,e){var n,r,i,o;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=[],i=0;i<this._length;i++)o=yt(n[i]),t.call(e,o,i,this)&&r.push(o);return new this.constructor(r)})),C(Xn.prototype,"find",(function(t,e){var n,r,i;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,i=0;i<this._length;i++)if(r=yt(n[i]),t.call(e,r,i,this))return r})),C(Xn.prototype,"findIndex",(function(t,e){var n,r,i;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,i=0;i<this._length;i++)if(r=yt(n[i]),t.call(e,r,i,this))return i;return-1})),C(Xn.prototype,"findLast",(function(t,e){var n,r,i;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,i=this._length-1;i>=0;i--)if(r=yt(n[i]),t.call(e,r,i,this))return r})),C(Xn.prototype,"findLastIndex",(function(t,e){var n,r,i;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,i=this._length-1;i>=0;i--)if(r=yt(n[i]),t.call(e,r,i,this))return i;return-1})),C(Xn.prototype,"forEach",(function(t,e){var n,r;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=0;r<this._length;r++)t.call(e,yt(n[r]),r,this)})),C(Xn.prototype,"get",(function(t){if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!lt(t))throw new TypeError(L("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return yt(this._buffer[t])})),C(Xn.prototype,"includes",(function(t,e){var n,r;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!mt(t))throw new TypeError(L("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!at(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(n=this._buffer,r=e;r<this._length;r++)if(t===yt(n[r]))return!0;return!1})),C(Xn.prototype,"indexOf",(function(t,e){var n,r;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!mt(t))throw new TypeError(L("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!at(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(n=this._buffer,r=e;r<this._length;r++)if(t===yt(n[r]))return r;return-1})),C(Xn.prototype,"join",(function(t){var e,n,r;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(arguments.length>0){if(!rn(t))throw new TypeError(L("invalid argument. First argument must be a string. Value: `%s`.",t))}else t=",";for(e=this._buffer,n=[],r=0;r<this._length;r++)e[r]?n.push("true"):n.push("false");return n.join(t)})),C(Xn.prototype,"keys",(function(){var t,e,n,r,i;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return t=this,n=this._length,i=-1,C(e={},"next",(function(){if(i+=1,r||i>=n)return{done:!0};return{value:i,done:!1}})),C(e,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ct&&C(e,Ct,(function(){return t.keys()})),e})),C(Xn.prototype,"lastIndexOf",(function(t,e){var n,r;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!mt(t))throw new TypeError(L("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!at(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(n=this._buffer,r=e;r>=0;r--)if(t===yt(n[r]))return r;return-1})),Tn(Xn.prototype,"length",(function(){return this._length})),C(Xn.prototype,"map",(function(t,e){var n,r,i,o;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Nt(t))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",t);for(i=this._buffer,n=(r=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)n[o]=yt(t.call(e,yt(i[o]),o,this));return r})),C(Xn.prototype,"reduce",(function(t,e){var n,r,i,o;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));if(n=this._buffer,r=this._length,arguments.length>1)i=e,o=0;else{if(0===r)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=yt(n[0]),o=1}for(;o<r;o++)i=t(i,yt(n[o]),o,this);return i})),C(Xn.prototype,"reduceRight",(function(t,e){var n,r,i,o;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));if(n=this._buffer,r=this._length,arguments.length>1)i=e,o=r-1;else{if(0===r)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=yt(n[r-1]),o=r-2}for(;o>=0;o--)i=t(i,yt(n[o]),o,this);return i})),C(Xn.prototype,"reverse",(function(){var t,e,n,r,i,o;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(t=this._buffer,n=this._length,r=rt(n/2),i=0;i<r;i++)o=n-i-1,e=t[i],t[i]=t[o],t[o]=e;return this})),C(Xn.prototype,"set",(function(t){var e,n,r,i,o,a,u;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(r=this._buffer,arguments.length>1){if(!lt(n=arguments[1]))throw new TypeError(L("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(Wt(t)){if(n+(o=t.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=qn(t)?t._buffer:t,u=r.byteOffset+n*Wn,e.buffer===r.buffer&&e.byteOffset<u&&e.byteOffset+e.byteLength>u){for(i=new Ye(e.length),a=0;a<e.length;a++)i[a]=e[a];e=i}for(a=0;a<o;n++,a++)r[n]=e[a]?1:0}else{if(n>=this._length)throw new RangeError(L("invalid argument. Index argument is out-of-bounds. Value: `%u`.",n));r[n]=t?1:0}})),C(Xn.prototype,"slice",(function(t,e){var n,r,i,o,a,u;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(o=this._buffer,a=this._length,0===arguments.length)t=0,e=a;else{if(!at(t))throw new TypeError(L("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=a)<0&&(t=0),1===arguments.length)e=a;else{if(!at(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=a)<0&&(e=0):e>a&&(e=a)}}for(n=t<e?e-t:0,r=(i=new this.constructor(n))._buffer,u=0;u<n;u++)r[u]=o[u+t];return i})),C(Xn.prototype,"some",(function(t,e){var n,r;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=0;r<this._length;r++)if(t.call(e,yt(n[r]),r,this))return!0;return!1})),C(Xn.prototype,"sort",(function(t){var e;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(e=this._buffer,0===arguments.length)return e.sort(),this;if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));return e.sort((function(e,n){return t(yt(e),yt(n))})),this})),C(Xn.prototype,"subarray",(function(t,e){var n,r,i;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(r=this._buffer,i=this._length,0===arguments.length)t=0,e=i;else{if(!at(t))throw new TypeError(L("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=i)<0&&(t=0),1===arguments.length)e=i;else{if(!at(e))throw new TypeError(L("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=i)<0&&(e=0):e>i&&(e=i)}}return t>=i?(i=0,n=r.byteLength):t>=e?(i=0,n=r.byteOffset+t*Wn):(i=e-t,n=r.byteOffset+t*Wn),new this.constructor(r.buffer,n,i<0?0:i)})),C(Xn.prototype,"toLocaleString",(function(t,e){var n,r,i,o,a;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(0===arguments.length)r=[];else{if(!rn(t)&&!ln(t))throw new TypeError(L("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));r=t}if(arguments.length<2)n={};else{if(!nn(e))throw new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",e));n=e}for(o=this._buffer,i=[],a=0;a<this._length;a++)i.push(yt(o[a]).toLocaleString(r,n));return i.join(",")})),C(Xn.prototype,"toReversed",(function(){var t,e,n,r,i;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(n=this._length,e=new this.constructor(n),r=this._buffer,t=e._buffer,i=0;i<n;i++)t[i]=r[n-i-1];return e})),C(Xn.prototype,"toSorted",(function(t){var e,n,r,i,o;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=this._length,n=new this.constructor(r),i=this._buffer,e=n._buffer,o=0;o<r;o++)e[o]=i[o];if(0===arguments.length)return e.sort(),n;if(!Nt(t))throw new TypeError(L("invalid argument. First argument must be a function. Value: `%s`.",t));return e.sort((function(e,n){return t(yt(e),yt(n))})),n})),C(Xn.prototype,"toString",(function(){var t,e,n;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(t=[],e=this._buffer,n=0;n<this._length;n++)e[n]?t.push("true"):t.push("false");return t.join(",")})),C(Xn.prototype,"values",(function(){var t,e,n,r,i,o;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return e=this,i=this._buffer,n=this._length,o=-1,C(t={},"next",(function(){if(o+=1,r||o>=n)return{done:!0};return{value:yt(i[o]),done:!1}})),C(t,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ct&&C(t,Ct,(function(){return e.values()})),t})),C(Xn.prototype,"with",(function(t,e){var n,r;if(!qn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!at(t))throw new TypeError(L("invalid argument. First argument must be an integer. Value: `%s`.",t));if(r=this._length,t<0&&(t+=r),t<0||t>=r)throw new RangeError(L("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!mt(e))throw new TypeError(L("invalid argument. Second argument must be a boolean. Value: `%s`.",e));return(n=new this.constructor(this._buffer))._buffer[t]=e?1:0,n}));var Hn=[ie,le,Ee,me,ke,je,Qe,Ye,We,kn,$n,Xn],Kn=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"],Qn=Kn.length;function tr(t){var e;if(It(t))return"generic";if(kt(t))return null;for(e=0;e<Qn;e++)if(t instanceof Hn[e])return Kn[e];return Qt[Ut(t)]||null}function er(t,e){var n,r,i,o;for(i=tr(t),r=qt(t)?Xt(i):Kt(i),n=t.length,o=0;o<n;o++)if(r(t,o)===e)return!0;return!1}function nr(t){var e,n,r;if(!Wt(t))throw new TypeError(L("invalid argument. Must provide an array-like object. Value: `%s`.",t));return r=tr(t),qt(t)&&(e=Xt(r)),n=t.length,void 0===e?function(e){var r;for(r=0;r<n;r++)if(t[r]===e)return!0;return!1}:function(r){var i;for(i=0;i<n;i++)if(e(t,i)===r)return!0;return!1}}function rr(t,e,n){return t.replace(e,n)}C(er,"factory",nr);var ir={all:["binary","bool","complex32","complex64","complex128","float16","float32","float64","generic","int16","int32","int8","uint16","uint32","uint8","uint8c"],typed:["binary","bool","complex32","complex64","complex128","float16","float32","float64","int16","int32","int8","uint16","uint32","uint8","uint8c"],floating_point:["complex32","complex64","complex128","float16","float32","float64"],real_floating_point:["float16","float32","float64"],complex_floating_point:["complex32","complex64","complex128"],boolean:["bool"],integer:["int16","int32","int8","uint16","uint32","uint8","uint8c"],signed_integer:["int16","int32","int8"],unsigned_integer:["uint16","uint32","uint8","uint8c"],real:["float16","float32","float64","int16","int32","int8","uint16","uint32","uint8","uint8c"],numeric:["complex32","complex64","complex128","float16","float32","float64","int16","int32","int8","uint16","uint32","uint8","uint8c"],index:["int32","uint8","bool","generic"],integer_index:["int32"],boolean_index:["bool"],mask_index:["uint8"],typed_index:["int32","uint8","bool"]},or=/_and_generic$/;var ar=nr(function(){var t,e,n;return 0===arguments.length?ir.all.slice():(n=!1,t=arguments[0],or.test(t)&&"all"!==(t=rr(t,or,""))&&"index"!==t&&(n=!0),e=(e=ir[t])?e.slice():[],n&&e.length>0&&e.push("generic"),e)}());function ur(t,e){return null!=t&&("symbol"==typeof e?e in Object(t):String(e)in Object(t))}function fr(t){return at(t)&&t>0}function lr(t){return ut(t)&&t.valueOf()>0}function sr(t){return fr(t)||lr(t)}function cr(t){return Nt(t)&&fr(t.alignment)&&fr(t.byteLength)&&Nt(t.byteLengthOf)&&Nt(t.byteOffsetOf)&&Nt(t.bufferOf)&&Nt(t.isStruct)&&Nt(t.viewOf)&&W(t,"fields")&&W(t,"layout")}C(sr,"isPrimitive",fr),C(sr,"isObject",lr);var hr,pr=Object,gr=Object.getPrototypeOf;hr=Nt(Object.getPrototypeOf)?gr:function(t){var e=function(t){return t.__proto__}(t);return e||null===e?e:"[object Function]"===Z(t.constructor)?t.constructor.prototype:t instanceof pr?pr.prototype:null};var mr=hr;function yr(t){return null==t?null:(t=pr(t),mr(t))}var dr=Object.prototype;function br(t){var e;return!!nn(t)&&(!(e=yr(t))||!W(t,"constructor")&&W(e,"constructor")&&Nt(e.constructor)&&"[object Function]"===Z(e.constructor)&&W(e,"isPrototypeOf")&&Nt(e.isPrototypeOf)&&(e===dr||function(t){var e;for(e in t)if(!W(t,e))return!1;return!0}(t)))}function vr(t){return Object.keys(Object(t))}var wr,_r=void 0!==Object.keys;function Er(t){return"[object Arguments]"===Z(t)}wr=function(){return Er(arguments)}();var xr=wr;function Tr(t){return t!=t}function Vr(t){return Y(t)&&Tr(t)}function Or(t){return Q(t)&&Tr(t.valueOf())}function Ar(t){return Vr(t)||Or(t)}C(Ar,"isPrimitive",Vr),C(Ar,"isObject",Or);var jr=Object.prototype.propertyIsEnumerable;var Sr,Fr=!jr.call("beep","0");function Lr(t,e){var n;return null!=t&&(!(n=jr.call(t,e))&&Fr&&fn(t)?!Vr(e=+e)&&at(e)&&e>=0&&e<t.length:n)}Sr=xr?Er:function(t){return null!==t&&"object"==typeof t&&!It(t)&&"number"==typeof t.length&&it(t.length)&&t.length>=0&&t.length<=ce&&W(t,"callee")&&!Lr(t,"callee")};var Ir=Sr,Br=Array.prototype.slice;var Rr=Lr((function(){}),"prototype"),kr=!Lr({toString:null},"toString");function Ur(t,e,n){var r,i;if(!Wt(t)&&!rn(t))throw new TypeError(L("invalid argument. First argument must be an array-like object. Value: `%s`.",t));if(0===(r=t.length))return-1;if(3===arguments.length){if(!at(n))throw new TypeError(L("invalid argument. Third argument must be an integer. Value: `%s`.",n));if(n>=0){if(n>=r)return-1;i=n}else(i=r+n)<0&&(i=0)}else i=0;if(Ar(e)){for(;i<r;i++)if(Ar(t[i]))return i}else for(;i<r;i++)if(t[i]===e)return i;return-1}function Mr(t){return t.constructor&&t.constructor.prototype===t}var Nr=["console","external","frame","frameElement","frames","innerHeight","innerWidth","outerHeight","outerWidth","pageXOffset","pageYOffset","parent","scrollLeft","scrollTop","scrollX","scrollY","self","webkitIndexedDB","webkitStorageInfo","window"],Pr="undefined"==typeof window?void 0:window;var Cr=function(){var t;if("undefined"===Mt(Pr))return!1;for(t in Pr)try{-1===Ur(Nr,t)&&W(Pr,t)&&null!==Pr[t]&&"object"===Mt(Pr[t])&&Mr(Pr[t])}catch(t){return!0}return!1}(),Yr="undefined"!=typeof window;var Dr,Jr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];Dr=_r?function(){return 2!==(vr(arguments)||"").length}(1,2)?function(t){return Ir(t)?vr(Br.call(t)):vr(t)}:vr:function(t){var e,n,r,i,o,a,u;if(i=[],Ir(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==(r="function"==typeof t)&&!Rt(t))return i;n=Rr&&r}for(o in t)n&&"prototype"===o||!W(t,o)||i.push(String(o));if(kr)for(e=function(t){if(!1===Yr&&!Cr)return Mr(t);try{return Mr(t)}catch(t){return!1}}(t),u=0;u<Jr.length;u++)a=Jr[u],e&&"constructor"===a||!W(t,a)||i.push(String(a));return i};var $r=Dr;var zr=function(t,e){var n,r,i,o,a,u,f,l=!0;if(!Rt(t))throw new TypeError(L("invalid argument. First argument must be an object (except null). Value: `%s`.",t));if(arguments.length>1){if(!br(e))throw new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",e));if(W(e,"duplicates")&&!mt(l=e.duplicates))throw new TypeError(L("invalid option. `%s` option must be a boolean. Option: `%s`.","duplicates",l))}if(r=(n=$r(t)).length,a={},l)for(f=0;f<r;f++)W(a,o=t[i=n[f]])?(u=a[o],It(u)?a[o].push(i):a[o]=[u,i]):a[o]=i;else for(f=0;f<r;f++)a[t[i=n[f]]]=i;return a}({bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float16:10,float32:11,float64:12,complex32:13,complex64:14,complex128:15,binary:16,generic:17,notype:18,userdefined_type:256},{duplicates:!1});function Wr(t){var e=zr[t];return rn(e)?e:null}var Gr,qr,Zr,Xr={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float16:10,float32:11,float64:12,complex32:13,complex64:14,complex128:15,binary:16,generic:17,notype:18,userdefined_type:256};function Hr(t){var e=Xr[t];return Y(e)?e:null}function Kr(t){var e=typeof t;return"string"===e?null===Hr(t)?null:t:"number"===e?Wr(t):"object"===e&&t?String(t):cr(t)?t.layout:null}var Qr={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 ti(t){var e;return rn(t)?Qr[t]||null:Y(t)?Qr[Wr(t)]||null:t&&fr(e=t.byteLength)?e:null}function ei(t,e){var n,r,i;if(n=arguments.length,!(this instanceof ei))return n<2?new ei(t):new ei(t,e);if(ar(t))r="builtin";else{if(function(t){return t instanceof ei||"object"==typeof t&&null!==t&&"DataType"===t.constructor.name&&rn(t.char)&&rn(t.description)&&rn(t.byteOrder)&&ur(t,"value")}(t))return new ei(t.value,{description:t.description});if(!cr(t))throw new TypeError(L("invalid argument. First argument must be either a supported data type string, a struct constructor, or another data type instance. Value: `%s`.",t));r="struct"}if(n>1){if(!br(i=e))throw new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",i));if(W(i,"description")&&!rn(i.description))throw new TypeError(L("invalid option. `%s` option must be a string. Option: `%s`.","description",i.description))}else i={};return C(this,"_value",t),C(this,"_description",i.description||function(t){return 0===arguments.length?{binary:"byte",bool:"boolean",complex32:"half-precision floating-point complex number",complex64:"single-precision floating-point complex number",complex128:"double-precision floating-point complex number",float16:"half-precision floating-point number",bfloat16:"brain floating-point number",float32:"single-precision floating-point number",float64:"double-precision floating-point number",float128:"quadruple-precision floating-point number",generic:"generic array value",int8:"signed 8-bit integer",int16:"signed 16-bit integer",int32:"signed 32-bit integer",int64:"signed 64-bit integer",int128:"signed 128-bit integer",int256:"signed 256-bit integer",uint8:"unsigned 8-bit integer",uint8c:"unsigned 8-bit integer (clamped)",uint16:"unsigned 16-bit integer",uint32:"unsigned 32-bit integer",uint64:"unsigned 64-bit integer",uint128:"unsigned 128-bit integer",uint256:"unsigned 256-bit integer"}:(void 0===Gr&&(Gr={binary:"byte",bool:"boolean",complex32:"half-precision floating-point complex number",complex64:"single-precision floating-point complex number",complex128:"double-precision floating-point complex number",float16:"half-precision floating-point number",bfloat16:"brain floating-point number",float32:"single-precision floating-point number",float64:"double-precision floating-point number",float128:"quadruple-precision floating-point number",generic:"generic array value",int8:"signed 8-bit integer",int16:"signed 16-bit integer",int32:"signed 32-bit integer",int64:"signed 64-bit integer",int128:"signed 128-bit integer",int256:"signed 256-bit integer",uint8:"unsigned 8-bit integer",uint8c:"unsigned 8-bit integer (clamped)",uint16:"unsigned 16-bit integer",uint32:"unsigned 32-bit integer",uint64:"unsigned 64-bit integer",uint128:"unsigned 128-bit integer",uint256:"unsigned 256-bit integer"}),Gr[Kr(t)]||null)}(t)||""),C(this,"_char",function(t){return 0===arguments.length?{binary:"r",bool:"x",complex32:"j",complex64:"c",complex128:"z",float16:"h",bfloat16:"e",float32:"f",float64:"d",float128:"g",generic:"o",int8:"s",int16:"k",int32:"i",int64:"l",int128:"m",int256:"n",uint8:"b",uint8c:"a",uint16:"t",uint32:"u",uint64:"v",uint128:"w",uint256:"y"}:(void 0===qr&&(qr={binary:"r",bool:"x",complex32:"j",complex64:"c",complex128:"z",float16:"h",bfloat16:"e",float32:"f",float64:"d",float128:"g",generic:"o",int8:"s",int16:"k",int32:"i",int64:"l",int128:"m",int256:"n",uint8:"b",uint8c:"a",uint16:"t",uint32:"u",uint64:"v",uint128:"w",uint256:"y"}),qr[Kr(t)]||null)}(t)||""),C(this,"_enum",function(t){var e=typeof t;return"number"===e?Wr(t)?t:null:"string"===e?Hr(t):"object"===e&&t&&at(t.enum)?t.enum:cr(t)?Hr("userdefined_type"):null}(t)||-1),C(this,"_alignment",function(t){var e;return 0===arguments.length?{binary:1,bool:1,complex32:2,complex64:4,complex128:8,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}:(void 0===Zr&&(Zr={binary:1,bool:1,complex32:2,complex64:4,complex128:8,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}),t?fr(e=t.alignment)?e:Zr[Kr(t)]||null:null)}(t)||-1),C(this,"_byteLength",ti(t)||-1),C(this,"_byteOrder","host"),C(this,"_type",r),this}function ni(t){return Nt(t)&&fr(t.alignment)&&fr(t.byteLength)&&Nt(t.byteLengthOf)&&Nt(t.byteOffsetOf)&&Nt(t.bufferOf)&&Nt(t.viewOf)||function(t){return t instanceof ei||"object"==typeof t&&null!==t&&at(t.alignment)&&at(t.byteLength)&&rn(t.byteOrder)&&rn(t.char)&&at(t.enum)&&ur(t,"value")}(t)&&ni(t.value)}function ri(t){return ar(t)||((e=t)instanceof ei||"object"==typeof e&&null!==e&&at(e.alignment)&&at(e.byteLength)&&rn(e.byteOrder)&&rn(e.char)&&at(e.enum)&&ur(e,"value"))||ni(t);var e}C(ei,"name","DataType"),Tn(ei.prototype,"alignment",(function(){return this._alignment})),Tn(ei.prototype,"byteLength",(function(){return this._byteLength})),Tn(ei.prototype,"byteOrder",(function(){return this._byteOrder})),Tn(ei.prototype,"char",(function(){return this._char})),Tn(ei.prototype,"description",(function(){return this._description})),Tn(ei.prototype,"enum",(function(){return this._enum})),Tn(ei.prototype,"value",(function(){return this._value})),C(ei.prototype,"toJSON",(function(){return{type:"DataType",value:this.toString(),byteOrder:this._byteOrder,description:this._description}})),C(ei.prototype,"toString",(function(){return"struct"===this._type?this._value.layout:String(this._value)})),C(ei.prototype,"valueOf",(function(){return this.toString()}));var ii,oi=Nt(Object.assign),ai=Object.assign,ui=void 0!==Object.getOwnPropertySymbols,fi=pr.getOwnPropertySymbols;ii=ui?function(t){return fi(pr(t))}:function(){return[]};var li,si=ii;function ci(t){var e,n,r;for(e=$r(t),n=si(t),r=0;r<n.length;r++)Lr(t,n[r])&&e.push(n[r]);return e}li=oi?ai:function(t){var e,n,r,i,o,a,u;if(null==t)throw new TypeError(L("invalid argument. First argument must be a non-null object. Value: `%s`.",t));for(o=pr(t),a=1;a<arguments.length;a++)if(null!=(e=arguments[a]))for(i=(n=ci(pr(e))).length,u=0;u<i;u++)o[r=n[u]]=e[r];return o};var hi=li,pi=["throw","normalize","clamp","wrap"];function gi(){return pi.slice()}function mi(){return{throw:1,clamp:2,wrap:3,normalize:4}}C(gi,"enum",mi);var yi=nr(gi()),di=["row-major","column-major"];function bi(){return di.slice()}var vi=["row-major","column-major"];function wi(){return{"row-major":101,"column-major":102}}C((function(){return vi.slice()}),"enum",wi);var _i={"row-major":101,"column-major":102};function Ei(){return{"row-major":_i["row-major"],"column-major":_i["column-major"]}}C(bi,"enum",Ei);var xi=nr(bi());function Ti(t,e){return br(e)?W(e,"readonly")&&(t.readonly=e.readonly,!mt(t.readonly))?new TypeError(L("invalid option. `%s` option must be a boolean. Option: `%s`.","readonly",t.readonly)):W(e,"mode")&&(t.mode=e.mode,!yi(t.mode))?new TypeError(L("invalid option. `%s` option must be a valid index mode. Option: `%s`.","mode",t.mode)):W(e,"order")&&(t.order=e.order,!xi(t.order))?new TypeError(L("invalid option. `%s` option must be a memory layout. Option: `%s`.","order",t.order)):null:new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",e))}var Vi=Object.prototype.isPrototypeOf;var Oi="function"==typeof ArrayBuffer?ArrayBuffer:null;var Ai,ji="function"==typeof ArrayBuffer?ArrayBuffer:void 0;Ai=function(){var t,e,n;if("function"!=typeof Oi)return!1;try{(t=$t(n=new Oi(16))&&"function"==typeof Oi.isView)&&((e=new ie(n))[0]=-3.14,e[1]=NaN,t=t&&Oi.isView(e)&&16===n.byteLength&&-3.14===e[0]&&e[1]!=e[1])}catch(e){t=!1}return t}()?ji:function(){throw new Error("not implemented")};var Si=Ai,Fi={float64:function(t,e,n){t[e]=n},float32:function(t,e,n){t[e]=n},int32:function(t,e,n){t[e]=n},int16:function(t,e,n){t[e]=n},int8:function(t,e,n){t[e]=n},uint32:function(t,e,n){t[e]=n},uint16:function(t,e,n){t[e]=n},uint8:function(t,e,n){t[e]=n},uint8c:function(t,e,n){t[e]=n},generic:function(t,e,n){t[e]=n},default:function(t,e,n){t[e]=n}};function Li(t){var e=Fi[t];return"function"==typeof e?e:Fi.default}var Ii={complex128:function(t,e,n){t.set(n,e)},complex64:function(t,e,n){t.set(n,e)},default:function(t,e,n){t.set(n,e)}};function Bi(t){var e=Ii[t];return"function"==typeof e?e:Ii.default}function Ri(t){var e=tr(t);return qt(t)?{data:t,dtype:e,accessorProtocol:!0,accessors:[Xt(e),Bi(e)]}:{data:t,dtype:e,accessorProtocol:!1,accessors:[Kt(e),Li(e)]}}function ki(t,e,n,r,i,o,a){var u,f,l,s,c,h,p;for(u=e.data,f=i.data,s=e.accessors[0],l=i.accessors[1],c=r,h=a,p=0;p<t;p++)l(f,h,s(u,c)),c+=n,h+=o;return i}var Ui=8;function Mi(t,e,n,r,i){var o,a,u,f,l,s;if(t<=0)return r;if(u=Ri(e),f=Ri(r),u.accessorProtocol||f.accessorProtocol)return ki(t,u,n,o=n<0?(1-t)*n:0,f,i,a=i<0?(1-t)*i:0),f.data;if(1===n&&1===i){if((l=t%Ui)>0)for(s=0;s<l;s++)r[s]=e[s];if(t<Ui)return r;for(s=l;s<t;s+=Ui)r[s]=e[s],r[s+1]=e[s+1],r[s+2]=e[s+2],r[s+3]=e[s+3],r[s+4]=e[s+4],r[s+5]=e[s+5],r[s+6]=e[s+6],r[s+7]=e[s+7];return r}for(o=n<0?(1-t)*n:0,a=i<0?(1-t)*i:0,s=0;s<t;s++)r[a]=e[o],o+=n,a+=i;return r}var Ni=8;function Pi(t,e,n,r,i,o,a){var u,f,l,s,c,h;if(t<=0)return i;if(l=Ri(e),s=Ri(i),l.accessorProtocol||s.accessorProtocol)return ki(t,l,n,r,s,o,a),s.data;if(u=r,f=a,1===n&&1===o){if((c=t%Ni)>0)for(h=0;h<c;h++)i[f]=e[u],u+=n,f+=o;if(t<Ni)return i;for(h=c;h<t;h+=Ni)i[f]=e[u],i[f+1]=e[u+1],i[f+2]=e[u+2],i[f+3]=e[u+3],i[f+4]=e[u+4],i[f+5]=e[u+5],i[f+6]=e[u+6],i[f+7]=e[u+7],u+=Ni,f+=Ni;return i}for(h=0;h<t;h++)i[f]=e[u],u+=n,f+=o;return i}function Ci(t,e){return t<e?t:e}function Yi(t,e){var n,r;for(n=[],r=0;r<e;r++)n.push(t);return n}C(Mi,"ndarray",Pi);var Di="function"==typeof DataView;function Ji(t){return Di&&t instanceof DataView||"[object DataView]"===Z(t)}var $i="function"==typeof DataView?DataView:null;var zi,Wi="function"==typeof DataView?DataView:void 0;zi=function(){var t,e,n;if("function"!=typeof $i)return!1;try{n=new Si(24),(t=Ji(e=new $i(n,8))&&"function"==typeof e.getFloat64&&"function"==typeof e.setFloat64)&&(e.setFloat64(0,-3.14),e.setFloat64(8,NaN),t=t&&e.buffer===n&&16===e.byteLength&&8===e.byteOffset&&-3.14===e.getFloat64(0)&&e.getFloat64(8)!=e.getFloat64(8))}catch(e){t=!1}return t}()?Wi:function(){throw new Error("not implemented")};var Gi=zi,qi="__@@##$$@@__struct_buffer__@@$$##@@__",Zi="Struct";function Xi(t,e,n,r){P(t,e,{configurable:!1,enumerable:!1,get:n,set:r})}function Hi(t,e,n){P(t,e,{configurable:!1,enumerable:!0,get:n})}function Ki(t,e,n,r){P(t,e,{configurable:!1,enumerable:!0,get:n,set:r})}var Qi,to={int8:{get:"getInt8",set:"setInt8"},int16:{get:"getInt16",set:"setInt16"},int32:{get:"getInt32",set:"setInt32"},int64:{get:"getBigInt64",set:"setBigInt64"},uint8:{get:"getUint8",set:"setUint8"},uint16:{get:"getUint16",set:"setUint16"},uint32:{get:"getUint32",set:"setUint32"},uint64:{get:"getBigUint64",set:"setBigUint64"},float16:{get:"getFloat16",set:"setFloat16"},float32:{get:"getFloat32",set:"setFloat32"},float64:{get:"getFloat64",set:"setFloat64"},complex32:{get:"getFloat16",set:"setFloat16"},complex64:{get:"getFloat32",set:"setFloat32"},complex128:{get:"getFloat64",set:"setFloat64"},bool:{get:"getUint8",set:"setUint8"}},eo={uint16:je,uint8:Ye};(Qi=new eo.uint16(1))[0]=4660;var no=52===new eo.uint8(Qi.buffer)[0];var ro={complex64:dn,complex128:pn};function io(t){return ro[t]||null}var oo={float64:"complex128",float32:"complex64"},ao=io(oo.float64);var uo={complex128:"float64",complex64:"float32",complex32:"float16"};function fo(t,e){return function(){var n=this[qi],r=n[e](t.byteOffset,no),i=n[e](t.byteOffset+t.byteLength/2,no);return function(t,e,n){var r;if(arguments.length>2){if(r=io(oo[n]))return new r(t,e);throw new TypeError(L("invalid argument. Must provide a recognized data type. Value: `%s`.",n))}return new ao(t,e)}(r,i,uo[t.type])}}var lo={float64:ie,float32:le,int16:ke,int32:Ee,int8:Qe,uint16:je,uint32:me,uint8:Ye,uint8c:We,complex64:kn,complex128:$n,bool:Xn};function so(t){return lo[t]||null}function co(t,e){return new Ye(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*e,t.length-e)}function ho(){return{dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32",boolean:"bool",index:"int32",integer_index:"int32",boolean_index:"bool",mask_index:"uint8"}}}var po={dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32",boolean:"bool",index:"int32",integer_index:"int32",boolean_index:"bool",mask_index:"uint8"}},go={"dtypes.default":po.dtypes.default,"dtypes.numeric":po.dtypes.numeric,"dtypes.real":po.dtypes.real,"dtypes.floating_point":po.dtypes.floating_point,"dtypes.real_floating_point":po.dtypes.real_floating_point,"dtypes.complex_floating_point":po.dtypes.complex_floating_point,"dtypes.integer":po.dtypes.integer,"dtypes.signed_integer":po.dtypes.signed_integer,"dtypes.unsigned_integer":po.dtypes.unsigned_integer,"dtypes.boolean":po.dtypes.boolean,"dtypes.index":po.dtypes.index,"dtypes.integer_index":po.dtypes.integer_index,"dtypes.boolean_index":po.dtypes.boolean_index,"dtypes.mask_index":po.dtypes.mask_index};C(ho,"get",(function(t){var e=go[t];return void 0===e?null:e}));var mo=ho.get("dtypes.default"),yo=so("complex64"),bo=so("complex128"),vo=so("bool");function wo(){var t,e,n,r;if(null===(n=so(e=(t=arguments.length)&&rn(arguments[t-1])?arguments[t-=1]:mo)))throw new TypeError(L("invalid argument. Must provide a recognized data type. Value: `%s`.",e));return t<=0?new n(0):1===t?((r=arguments[0])instanceof yo?r=An(r,0):r instanceof bo?r=jn(r,0):r instanceof vo&&(r=co(r,0)),new n(r)):2===t?new n(arguments[0],arguments[1]):new n(arguments[0],arguments[1],arguments[2])}function _o(t){if(t.length)return t.isStructType?function(t){return function(){var e,n,r,i;for(e=(n=this[qi]).byteOffset+t.byteOffset,r=[],i=0;i<t.length;i++)r.push(new t.type(n.buffer,e,t.byteLength)),e+=t.byteOffset;return r}}(t):function(t){return function(){var e=this[qi];return wo(e.buffer,e.byteOffset+t.byteOffset,t.length,t.type)}}(t);switch(t.type){case"float64":case"float32":case"float16":case"int8":case"int16":case"int32":case"uint8":case"uint16":case"uint32":case"int64":case"uint64":return function(t,e){return function(){return this[qi][e](t.byteOffset,no)}}(t,to[t.type].get);case"bool":return function(t,e){return function(){var n=this[qi];return yt(n[e](t.byteOffset,no))}}(t,to[t.type].get);case"complex128":case"complex64":case"complex32":return fo(t,to[t.type].get);default:if(t.isStructType)return function(t){return function(){var e=this[qi];return new t.type(e.buffer,e.byteOffset+t.byteOffset,t.byteLength)}}(t);throw new Error(L("unexpected error. Unrecognized data type. Value: `%s`.",t.type))}}var Eo={all:["bool","complex64","complex128","float32","float64","generic","int16","int32","int8","uint16","uint32","uint8","uint8c"],typed:["bool","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"],boolean:["bool"],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"],index:["int32","uint8","bool","generic"],integer_index:["int32"],boolean_index:["bool"],mask_index:["uint8"],typed_index:["int32","uint8","bool"]},xo=/_and_generic$/;function To(){var t,e,n;return 0===arguments.length?Eo.all.slice():(n=!1,t=arguments[0],xo.test(t)&&"all"!==(t=rr(t,xo,""))&&"index"!==t&&(n=!0),e=(e=Eo[t])?e.slice():[],n&&e.length>0&&e.push("generic"),e)}var Vo=nr(To("real_floating_point")),Oo=nr(To("signed_integer")),Ao=Vt();function jo(){return"function"==typeof Ao.BigInt&&"function"==typeof BigInt&&"bigint"==typeof Ao.BigInt("1")&&"bigint"==typeof BigInt("1")}function So(t){return"bigint"==typeof t}function Fo(t){return"object"==typeof t&&"[object BigInt]"===Z(t)&&function(t){try{return"bigint"==typeof t.valueOf()}catch(t){return!1}}(t)}function Lo(t){return So(t)||Fo(t)}C(Lo,"isPrimitive",So),C(Lo,"isObject",Fo);var Io,Bo=pt(!1),Ro=pt(!1),ko=pt(!1);C(Bo,"isPrimitive",Ro),C(Bo,"isObject",ko),Io=jo()?Lo:Bo;const{isPrimitive:Uo}=Io;var Mo,No={float64:{float64:1,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},float32:{float64:1,float32:1,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},float16:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},int64:{float64:0,float32:0,float16:0,int64:1,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},int32:{float64:1,float32:0,float16:0,int64:1,int32:1,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},int16:{float64:1,float32:1,float16:0,int64:1,int32:1,int16:1,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},int8:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:1,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},uint64:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:1,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},uint32:{float64:1,float32:0,float16:0,int64:1,int32:0,int16:0,int8:0,uint64:1,uint32:1,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},uint16:{float64:1,float32:1,float16:0,int64:1,int32:1,int16:0,int8:0,uint64:1,uint32:1,uint16:1,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},uint8:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},uint8c:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},complex128:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},complex64:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},complex32:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},generic:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},binary:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:1,generic:0,bool:0},bool:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:1}};var Po=function(t){return 0===arguments.length?function(){var t,e,n,r,i,o,a,u,f;for(n={},e=(t=$r(No)).length,f=0;f<e;f++){for(i=t[f],a=No[i],r={},u=0;u<e;u++)r[o=t[u]]=a[o];n[i]=r}return n}():(void 0===Mo&&(Mo=function(){var t,e,n,r,i,o,a,u,f;for(n={},e=(t=$r(No)).length,f=0;f<e;f++){for(i=t[f],a=No[i],r=[],u=0;u<e;u++)1===a[o=t[u]]&&r.push(o);n[i]=r}return n}()),t=Kr(t),W(Mo,t)?Mo[t].slice():null)}();var Co,Yo={float64:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},float32:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},float16:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},int64:{float64:0,float32:0,float16:0,int64:1,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},int32:{float64:1,float32:0,float16:0,int64:1,int32:1,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},int16:{float64:1,float32:1,float16:0,int64:1,int32:1,int16:1,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},int8:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:1,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},uint64:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:1,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},uint32:{float64:1,float32:0,float16:0,int64:1,int32:0,int16:0,int8:0,uint64:1,uint32:1,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},uint16:{float64:1,float32:1,float16:0,int64:1,int32:1,int16:0,int8:0,uint64:1,uint32:1,uint16:1,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},uint8:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},uint8c:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},complex128:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},complex64:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},complex32:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},generic:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},binary:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:1,generic:0,bool:0},bool:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:1}};var Do=function(t){return 0===arguments.length?function(){var t,e,n,r,i,o,a,u,f;for(n={},e=(t=$r(Yo)).length,f=0;f<e;f++){for(i=t[f],a=Yo[i],r={},u=0;u<e;u++)r[o=t[u]]=a[o];n[i]=r}return n}():(void 0===Co&&(Co=function(){var t,e,n,r,i,o,a,u,f;for(n={},e=(t=$r(Yo)).length,f=0;f<e;f++){for(i=t[f],a=Yo[i],r=[],u=0;u<e;u++)1===a[o=t[u]]&&r.push(o);n[i]=r}return n}()),t=Kr(t),W(Co,t)?Co[t].slice():null)}();var Jo,$o={float64:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},float32:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},float16:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},int64:{float64:0,float32:0,float16:0,int64:1,int32:1,int16:1,int8:1,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},int32:{float64:1,float32:0,float16:0,int64:1,int32:1,int16:1,int8:1,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},int16:{float64:1,float32:1,float16:0,int64:1,int32:1,int16:1,int8:1,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},int8:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:1,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},uint64:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},uint32:{float64:1,float32:0,float16:0,int64:1,int32:0,int16:0,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},uint16:{float64:1,float32:1,float16:0,int64:1,int32:1,int16:0,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},uint8:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},uint8c:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},complex128:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:0,bool:0},complex64:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:0,bool:0},complex32:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:0,bool:0},generic:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},binary:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:1,generic:0,bool:0},bool:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:1}};var zo=function(t){return 0===arguments.length?function(){var t,e,n,r,i,o,a,u,f;for(n={},e=(t=$r($o)).length,f=0;f<e;f++){for(i=t[f],a=$o[i],r={},u=0;u<e;u++)r[o=t[u]]=a[o];n[i]=r}return n}():(void 0===Jo&&(Jo=function(){var t,e,n,r,i,o,a,u,f;for(n={},e=(t=$r($o)).length,f=0;f<e;f++){for(i=t[f],a=$o[i],r=[],u=0;u<e;u++)1===a[o=t[u]]&&r.push(o);n[i]=r}return n}()),t=Kr(t),W(Jo,t)?Jo[t].slice():null)}();function Wo(t,e,n){return"unsafe"===n||(Kr(t)===Kr(e)||"none"!==n&&"equiv"!==n&&("safe"===n?function(t,e){var n;return(t=Kr(t))===(e=Kr(e))||!!(n=Po[t])&&n[e]>0}(t,e):"mostly-safe"===n?function(t,e){var n;return(t=Kr(t))===(e=Kr(e))||!!(n=Do[t])&&n[e]>0}(t,e):function(t,e){var n;return(t=Kr(t))===(e=Kr(e))||!!(n=zo[t])&&n[e]>0}(t,e)))}var Go=1401298464324817e-60,qo=16777215,Zo=-16777215;function Xo(t){return t!=t||t===et||t===nt?"float32":it(t)?t>=Zo&&t<=qo?"float32":"float64":t>-Go&&t<Go?"float64":"float32"}function Ho(t){return Y(t)?t!=t||t===et||t===nt?"float32":it(t)?0===t&&(0===(e=t)&&1/e===nt)?"float32":t<0?t>=Ze?"int8":t>=Le?"int16":t>=be?"int32":"float64":t<=Me?"uint8":t<=Te?"uint16":t<=ce?"uint32":"float64":t>-Go&&t<Go?"float64":"float32":mt(t)?"bool":bn(t)?"float64"===Xo(t.re)||"float64"===Xo(t.im)?"complex128":"complex64":"generic";var e}var Ko={Complex64:"complex64",Complex128:"complex128"};var Qo,ta=["complex64","complex128"].slice(),ea=[];for(Qo=0;Qo<ta.length;Qo++)ea.push(io(ta[Qo]));var na=ta.length;function ra(t){var e;for(e=0;e<na;e++)if(t instanceof ea[e])return ta[e];return Ko[Ut(t)]||null}function ia(t){return t?1:0}function oa(t){return X(t)}var aa={dtypes:{real:"float64",complex:"complex128"}};function ua(t,e){return function(n){var r,i;Y(n)?(r=Vo(t.type)?t.type:at(n)?Oo(t.type)?function(t){return t<0?t>=Ze?"int8":t>=Le?"int16":t>=be?"int32":"float64":t<=qe?"int8":t<=Fe?"int16":t<=de?"int32":"float64"}(n):Ho(n):aa.dtypes.real,i=n):bn(n)?(r=ra(n)||("float32"===t.type?"complex64":"complex128"),i=n.re):mt(n)?(r="bool",i=ia(n)):Uo(n)?(r="int64",i=oa(n)):(r="generic",i=n);if(!Wo(r,t.type,t.castingMode))throw new TypeError(L("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,r));this[qi][e](t.byteOffset,i,no)}}function fa(t){return yt(t)}function la(t){return yt(t.re||t.im)}function sa(t,e){return function(n){var r,i;mt(n)?(r="bool",i=ia(n)):Y(n)?(r=aa.dtypes.real,i=ia(fa(n))):Uo(n)?(r="int64",i=ia(function(t){return yt(t)}(n))):bn(n)?(r=ra(n)||aa.dtypes.complex,i=ia(la(n))):(r="generic",i=yt(n));if(!Wo(r,t.type,t.castingMode))throw new TypeError(L("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,r));this[qi][e](t.byteOffset,i,no)}}var ca="function"==typeof BigInt?BigInt:void 0;function ha(t,e){return function(n){var r,i;Uo(n)?(r="int64",i=n):Y(n)?at(n)?(r=Ho(n),i=ca(n)):(r=aa.dtypes.real,i=ca(rt(n))):mt(n)?(r="bool",i=function(t){return ca(t?1:0)}(n)):bn(n)?(r=ra(n)||aa.dtypes.complex,i=ca(rt(n.re))):(r="generic",i=ca(rt(X(i))));if(!Wo(r,t.type,t.castingMode))throw new TypeError(L("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,r));this[qi][e](t.byteOffset,i,no)}}function pa(t){return nn(t)&&Ji(t[qi])}var ga=nr(To("complex_floating_point")),ma=nr(To("boolean")),ya=nr(To("real"));function da(t,e){if(xn(t))return jn(t,e);if(_n(t))return An(t,e);throw new TypeError(L("invalid argument. First argument must be a complex-valued floating-point array. Value: `%s`.",t))}function ba(t,e){return e>0?0:(1-t)*e}var va=8;function wa(t,e,n,r,i){var o,a,u,f;if(t<=0)return n;if((u=Ri(n)).accessorProtocol)return function(t,e,n,r,i){var o,a,u,f;for(o=n.data,a=n.accessors[1],u=i,f=0;f<t;f++)a(o,u,e),u+=r}(t,e,u,r,i),u.data;if(o=i,1===r){if((a=t%va)>0)for(f=0;f<a;f++)n[o]=e,o+=r;if(t<va)return n;for(f=a;f<t;f+=va)n[o]=e,n[o+1]=e,n[o+2]=e,n[o+3]=e,n[o+4]=e,n[o+5]=e,n[o+6]=e,n[o+7]=e,o+=va;return n}for(f=0;f<t;f++)n[o]=e,o+=r;return n}function _a(t,e,n,r){return wa(t,e,n,r,ba(t,r))}function Ea(t){return Yi(0,t)}function xa(t,e,n,r,i,o){var a,u;return a=Ri(t),u=Ri(e),a.accessorProtocol||u.accessorProtocol?(function(t,e,n,r,i,o){var a,u,f,l,s,c;for(a=t.data,u=e.data,f=t.accessors[0],l=e.accessors[1],s=r,c=0;c<a.length;c++)l(u,s,i.call(o,f(a,c),c,a)),s+=n}(a,u,n,r,i,o),e):function(t,e,n,r,i,o){var a,u;for(a=r,u=0;u<t.length;u++)e[a]=i.call(o,t[u],u,t),a+=n;return e}(t,e,n,r,i,o)}function Ta(t,e,n){return function(t,e){return"function"==typeof t[e]}(t,"map")?t.map(e,n):xa(t,Ea(t.length),1,0,e,n)}function Va(t){return t.re}function Oa(t){if(t.length)return t.isStructType?function(t){return function(e){var n,r,i,o,a,u,f,l;if(!Wt(e))throw new TypeError(L("invalid assignment. `%s` must be an array-like object. Value: `%s`.",t.name,e));if(e.length!==t.length)throw new RangeError(L("invalid assignment. `%s` must be an array-like object having length %u.",t.name,t.length));if("none"===t.casting)for(l=0;l<e.length;l++)if(!(e[l]instanceof t.type))throw new TypeError(L("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Value: `%s`.",t.name,e[l]));for(f=t.byteLength/t.length,r=[],l=0;l<e.length;l++){if((u=this.constructor.viewOf(e[l])).byteLength!==f)throw new RangeError(L("invalid assignment. `%s` must be an array-like object containing `struct` instances having the same byte length.",t.name));a=new Ye(u.buffer,u.byteOffset,f),r.push(a)}for(n=(i=this[qi]).byteOffset+t.byteOffset,l=0;l<e.length;l++)o=new Ye(i.buffer,n,f),Mi(t.length,r[l],1,o,1),n+=f}}(t):function(t){return function(e){var n,r,i;if(!Wt(e)||pa(e))throw new TypeError(L("invalid assignment. `%s` must be an array-like object. Value: `%s`.",t.name,e));if(e.length!==t.length)throw new RangeError(L("invalid assignment. `%s` must be an array-like object having length %u.",t.name,t.length));if(!Wo(i=tr(e),t.type,t.castingMode))throw new TypeError(L("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,i));return n=wo((r=this[qi]).buffer,r.byteOffset+t.byteOffset,t.length,t.type),i===t.type?ga(i)?void Mi(2*t.length,da(e,0),1,da(n,0),1):ma(i)?void Mi(t.length,co(e,0),1,co(n,0),1):void Mi(t.length,e,1,n,1):ya(i)?ya(t.type)?void Mi(t.length,e,1,n,1):ga(t.type)?(n=da(n,0),Mi(t.length,n,2,e,1),void _a.ndarray(t.length,0,n,2,1)):void Ta.assign(e,n,1,0,fa):ga(i)?ya(t.type)?void Ta.assign(e,n,1,0,Va):ga(t.type)?void Mi(2*t.length,da(e,0),1,da(n,0),1):void Ta.assign(e,n,1,0,la):void(ya(t.type)?Mi(t.length,co(e,0),1,n,1):(n=da(n,0),Mi(t.length,n,2,co(e,0),1),_a.ndarray(t.length,0,n,2,1)))}}(t);switch(t.type){case"float64":case"float32":case"float16":case"int8":case"int16":case"int32":case"uint8":case"uint16":case"uint32":return ua(t,to[t.type].set);case"int64":case"uint64":return ha(t,to[t.type].set);case"bool":return sa(t,to[t.type].set);case"complex128":case"complex64":case"complex32":return function(t,e){return function(n){var r,i,o,a;if(bn(n)?(i=ra(n)||t.type,o=n.re,a=n.im):Y(n)?(i="complex64"===t.type?"float32":"float64",o=n,a=0):Uo(n)?(i="int64",o=oa(n),a=0):mt(n)?(i="bool",o=ia(n),a=0):(i="generic",o=n,a=0),!Wo(i,t.type,t.castingMode))throw new TypeError(L("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,i));(r=this[qi])[e](t.byteOffset,o,no),r[e](t.byteOffset+t.byteLength/2,a,no)}}(t,to[t.type].set);default:if(t.isStructType)return function(t){return function(e){var n,r,i,o,a;if(!pa(e))throw new TypeError(L("invalid assignment. `%s` must be a `struct` instance. Value: `%s`.",t.name,e));if("none"===t.casting&&!(e instanceof t.type))throw new TypeError(L("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Value: `%s`.",t.name,e));if(a=t.byteLength,(o=this.constructor.viewOf(e)).byteLength!==a)throw new RangeError(L("invalid assignment. `%s` must be a `struct` instance having the same byte length.",t.name));i=new Ye(o.buffer,o.byteOffset,a),n=this[qi],r=new Ye(n.buffer,n.byteOffset+t.byteOffset,a),Mi(t.length,i,1,r,1)}}(t);throw new Error(L("unexpected error. Unrecognized data type. Value: `%s`.",t.type))}}C(_a,"ndarray",wa),C(Ta,"assign",xa);var Aa=["name","type","description","length","enumerable","writable","default","castingMode"];function ja(t){return"union"===t.type&&Wt(t.fields)}function Sa(t){return null==t}function Fa(t,e,n,r,i){var o,a,u,f,l;if(t<=0)return"";if(1===r&&0===i&&t===n.length&&function(t,e){return"function"==typeof t[e]}(n,"join"))return n.join(e);if((u=Ri(n)).accessorProtocol)return function(t,e,n,r,i){var o,a,u,f,l,s;for(o=n.data,a=n.accessors[0],f=i,u="",s=0;s<t;s++)s>0&&(u+=e),Sa(l=a(o,f))||(u+=String(l)),f+=r;return u}(t,e,u,r,i);for(a=i,o="",l=0;l<t;l++)l>0&&(o+=e),Sa(f=n[a])||(o+=String(f)),a+=r;return o}function La(t,e){return Fa(t.length,e,t,1,0)}function Ia(t,e){return mt(t)?null:new TypeError(L("invalid argument. `%s` field must be a boolean. Value: `%s`.",e,t))}C((function(t,e,n,r){return Fa(t,e,n,r,ba(t,r))}),"ndarray",Fa);var Ba=["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float32","float64","complex64","complex128","bool"];var Ra,ka={int8:1,int16:2,int32:4,int64:8,uint8:1,uint16:2,uint32:4,uint64:8,float16:2,float32:4,float64:8,complex32:2,complex64:4,complex128:8,bool:1},Ua=["name","type"],Ma={name:function(t,e){return rn(t)||t.length>0?null:new TypeError(L("invalid argument. `%s` field must be a non-empty string. Value: `%s`.",e,t))},type:function(t){return er(Ba,t)||cr(t)?null:new TypeError(L('invalid argument. `%s` field must be either a struct type or one of the following: "%s". Value: `%s`.',"type",La(Ba,", "),t))},description:function(t,e){return rn(t)?null:new TypeError(L("invalid argument. `%s` field must be a string. Value: `%s`.",e,t))},length:function(t,e){return fr(t)?null:new TypeError(L("invalid argument. `%s` field must be a positive integer. Value: `%s`.",e,t))},enumerable:Ia,writable:Ia,default:pt(null),castingMode:(Ra=["none","safe","mostly-safe","same-kind","unsafe"],function(t,e){return er(Ra,t)?null:new TypeError(L('invalid argument. `%s` field must be one of the following: "%s". Value: `%s`.',e,La(Ra,", "),t))})};function Na(t,e){var n,r,i,o,a;for(n={isStructType:!1,description:"",byteLength:0,byteOffset:0,alignment:0,padding:0,enumerable:!0,writable:!0,default:void 0,castingMode:"none"},a=0;a<e.length;a++)if(ur(t,o=e[a])){if(i=t[o],r=Ma[o](i,o))return r;n[o]=i}return function(t,e){var n;for(n=0;n<e.length;n++)if(!ur(t,e[n]))return!1;return!0}(n,Ua)?(n.isStructType=cr(n.type),n.byteLength=function(t){var e;return e=t.isStructType?t.type.byteLength:ti(t.type),t.length&&(e*=t.length),e}(n),n.isStructType?n.alignment=n.type.alignment:n.alignment=ka[n.type],n):new TypeError(L('invalid argument. Field objects must have the following properties: "%s". Value: `%s`.',La(Ua,", "),JSON.stringify(t)))}function Pa(t){var e,n,r;for(e=0,r=0;r<t.length;r++)(n=t[r].alignment)>e&&(e=n);return e}function Ca(t){var e,n,r,i,o,a,u;if(0===(e=t.fields).length)return null;for(r=[],u=0;u<e.length;u++){if(!nn(a=e[u]))return null;if(ja(a))return new TypeError(L("invalid argument. Union types cannot contain nested union types. Value: `%s`.",JSON.stringify(e)));if(void 0===n&&ur(a,"default"))n=!0;else if(!0===n&&ur(a,"default"))return new TypeError(L("invalid argument. Union types can only contain one field with a default value. Value: `%s`.",JSON.stringify(e)));if((i=Na(a,Aa))instanceof Error)return i;if(0===u)o=i.byteLength;else if(i.byteLength!==o)return new RangeError(L("invalid argument. Union types must contain fields having the same byte length. Value: `%s`.",JSON.stringify(e)));r.push(i)}return{type:"union",fields:r,byteLength:o,byteOffset:0,alignment:Pa(r),padding:0}}function Ya(t){var e=tr(t);return qt(t)?Xt(e):Kt(e)}function Da(t,e,n){return function(t,e){return"function"==typeof t[e]}(t,"indexOf")?t.indexOf(e,n):(n<0&&(n+=t.length)<0&&(n=0),Wt(r=t)&&Nt(r.get)&&Nt(r.set)?function(t,e,n){var r,i;for(r=Ya(t),i=n;i<t.length;i++)if(e===r(t,i))return i;return-1}(t,e,n):function(t,e,n){var r;for(r=n;r<t.length;r++)if(e===t[r])return r;return-1}(t,e,n));var r}function Ja(t,e){var n;return 0===t.length?new Error("invalid operation. struct does not have any fields."):(n=Da(t,e,0))<0?new TypeError(L('invalid argument. Field name must be one of the following: "%s". Value: `%s`.',La(t,", "),e)):n}function $a(t,e){var n;for(n=0;n<t.length;n++)t[n].padding=e;return t}function za(t){return function(e,n){return L("[%u,",t+parseInt(n,10))}}function Wa(t){var e,n,r,i,o,a;for(i=t.length,r=/\[(\d{1,}),/g,e=[],a=0;a<i;a++)o=t[a],a>0&&o.byteOffset===t[a-1].byteOffset||(o.isStructType?e.push(rr(o.type.layout,r,za(o.byteOffset))):e.push(L("|<%s>[%u,%u]",o.type,o.byteOffset,o.byteLength)));return"|"===(n=L("%s|",e.join("")))[n.length-2]&&(n=n.substring(0,n.length-1)),n}var Ga=["none","linear","layout"],qa=nr(Ga);function Za(t,e,n){var r;if(!br(n))throw new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",n));if(r={format:"none"},W(n,"format")&&(r.format=n.format,!qa(r.format)))throw new TypeError(L('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"format",La(Ga,", "),n.format));return"linear"===r.format?function(t,e){var n,r,i,o,a,u,f,l,s,c,h,p,g,m,y,d,b,v,w,_,E,x;for(d=e.length,n="%"+(t.byteLength-1).toString().length+"s",m=0,_=0;_<d;_++)(y=(b=e[_]).name.length+1+(b.byteLength-1).toString().length+1)>m&&(m=y);for(r="%"+m+"s",i="// %s",u="%s: %s %s",c=0,l=[],_=0;_<d;_++)if(b=e[_],!(_>0&&b.byteOffset===e[_-1].byteOffset)){for(s=_<d-1&&b.byteOffset===e[_+1].byteOffset,E=0;E<b.byteLength;E++){if(h=L(n,c.toString()),p=L(r,L("%s[%u]",b.name,E)),o=b.alignment>1?" (byte %u)":"",s){for(a=" => union: %s",f=[],x=_+1;x<d&&b.byteOffset===e[x].byteOffset;)w=(v=e[x]).isStructType?"<Struct>":v.type,f.push(L("%s<%s>[%u]",v.name,w,E%v.alignment)),x+=1;a=L(a,f.join(", "))}else a="";f=L(o+a,E%b.alignment),g=b.length?L(i,L("%s[%u]%s",b.type,rt(E/b.alignment),f)):L(i,L("%s%s",b.type,f)),l.push(L(u,h,p,g)),c+=1}for(E=0;E<b.padding;E++)h=L(n,c.toString()),p=L(r,"--"),g=L(i,"padding"),l.push(L(u,h,p,g)),c+=1}return l.join("\n")}(t,e):"layout"===r.format?Wa(e):"<Struct>"}function Xa(){}var Ha="foo"===Xa.name;var Ka=[ie,le,Ee,me,ke,je,Qe,Ye,We],Qa=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"],tu=ne()?yr(ie):eu;function eu(){}tu="TypedArray"===function(t){if(!1===Nt(t))throw new TypeError(L("invalid argument. Must provide a function. Value: `%s`.",t));return Ha?t.name:Lt.exec(t.toString())[1]}(tu)?tu:eu;var nu=[$n,kn],ru=["Complex64Array","Complex128Array"];function iu(){return"function"==typeof G&&"symbol"==typeof G("foo")&&W(G,"hasInstance")&&"symbol"==typeof G.hasInstance}var ou=iu()?Symbol.hasInstance:null,au=iu();function uu(t,e){if("function"!=typeof e&&(!au||"object"!=typeof e||"function"!=typeof e[ou]))throw new TypeError(L("invalid argument. Second argument must be callable. Value: `%s`.",e));return t instanceof e}var fu=[[ie,"Float64Array"],[le,"Float32Array"],[Ee,"Int32Array"],[me,"Uint32Array"],[ke,"Int16Array"],[je,"Uint16Array"],[Qe,"Int8Array"],[Ye,"Uint8Array"],[We,"Uint8ClampedArray"],[kn,"Complex64Array"],[$n,"Complex128Array"],[Xn,"BooleanArray"]];function lu(t){var e,n;for(n=0;n<fu.length;n++)if(uu(t,fu[n][0]))return fu[n][1];for(;t;){for(e=Ut(t),n=0;n<fu.length;n++)if(e===fu[n][1])return fu[n][1];t=yr(t)}}function su(t){var e,n,r,i;if(function(t){var e,n;if("object"!=typeof t||null===t)return!1;if(t instanceof tu)return!0;for(n=0;n<Ka.length;n++)if(t instanceof Ka[n])return!0;for(;t;){for(e=Ut(t),n=0;n<Qa.length;n++)if(Qa[n]===e)return!0;t=yr(t)}return!1}(t))e=t;else if(function(t){var e,n;if("object"!=typeof t||null===t)return!1;for(n=0;n<nu.length;n++)if(t instanceof nu[n])return!0;for(;t;){for(e=Ut(t),n=0;n<ru.length;n++)if(ru[n]===e)return!0;t=yr(t)}return!1}(t))e=8===t.BYTES_PER_ELEMENT?An(t,0):jn(t,0);else{if(!((i=t)instanceof Xn||"BooleanArray"===Ut(i)))throw new TypeError(L("invalid argument. Must provide a typed array. Value: `%s`.",t));e=co(t,0)}for(n={type:lu(t),data:[]},r=0;r<e.length;r++)n.data.push(e[r]);return n}function cu(t){var e,n,r,i,o,a,u,f;if(!Wt(t))throw new TypeError(L("invalid argument. First argument must be an array-like object. Value: `%s`.",t));if(u=function(t){var e,n,r,i;for(e=[],i=0;i<t.length;i++){if(!nn(r=t[i]))return new TypeError(L("invalid argument. First argument must be an array of objects. Value: `%s`. Index: `%d`.",r,i));if(ja(r)){if(null===(n=Ca(r)))return new TypeError(L("invalid argument. Union types must be an array of objects. Value: `%s`. Index: `%d`.",JSON.stringify(r),i));if(n instanceof Error)return n}else if((n=Na(r,Aa))instanceof Error)return n;e.push(n)}return e}(t),u instanceof Error)throw u;if(u=function(t){var e,n,r,i,o,a;for(e={},n=[],i=0;i<t.length;i++)if(a=(r=t[i]).name,ja(r))for(o=0;o<r.fields.length;o++){if(!0===e[a=r.fields[o].name])return new TypeError(L("invalid argument. First argument must be an array of objects having unique field names. Value: `%s`.",JSON.stringify(t)));e[a]=!0,n.push(a)}else{if(!0===e[a])return new TypeError(L("invalid argument. First argument must be an array of objects having unique field names. Value: `%s`.",JSON.stringify(t)));e[a]=!0,n.push(a)}return n}(a=u),u instanceof Error)throw u;function l(t,i,u){var f,s,c,h,p,g,m,y,d,b;if(s=arguments.length,!(this instanceof l))return 0===s?new l:1===s?new l(t):2===s?new l(t,i):new l(t,i,u);if($t(t)){if(1===s)h=new Gi(t,0,n);else{if(!lt(i))throw new TypeError(L("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",i));if(2===s)h=new Gi(t,i,n);else{if(!lt(u))throw new TypeError(L("invalid argument. Byte length must be a nonnegative integer. Value: `%s`.",u));h=new Gi(t,i,Ci(u,n))}}if(h.byteLength<n)throw new RangeError(L("invalid argument. ArrayBuffer has insufficient capacity. Minimum capacity: `%u`.",n))}else if(h=new Gi(new Si(n)),s>0){if(!nn(t))throw new TypeError(L("invalid argument. First argument must be an object. Value: `%s`.",t));p=t}if(C(this,qi,h),void 0!==p){for(f=Yi(void 0,a.length),c={},y=0;y<a.length;y++)if(b=e[y],d=r[y],ur(p,b)){if(c[d])throw new Error("invalid argument. Union types may only be initialized by a single member.");f[y]=p[b],c[d]=!0}for(y=0;y<a.length;y++)c[d=r[y]]||void 0!==(g=a[y]).default&&(f[y]=g.default);for(y=0;y<a.length;y++)void 0!==(m=f[y])&&o[e[y]][1].call(this,m)}return this}return e=u,i=Pa(a),a=function(t,e){var n,r,i,o,a,u,f;for(i=0,u=0;u<t.length;u++){if(i+=r=((n=Ci((a=t[u]).alignment,e))-i%n)%n,u>0&&((o=t[u-1]).padding=r,ja(a)&&$a(o.fields,r)),a.byteOffset=i,ja(a))for(f=0;f<a.fields.length;f++)a.fields[f].byteOffset=i;i+=a.byteLength}return r=(n-i%n)%n,a.padding=r,ja(a)&&$a(a.fields,r),t}(a,i),a=function(t){var e,n,r,i;for(e=[],r=0;r<t.length;r++)if(ja(n=t[r]))for(i=0;i<n.fields.length;i++)e.push(n.fields[i]);else e.push(n);return e}(a),r=function(t){var e,n,r,i;for(n=t.length,e=[],i=0,r=0;r<n-1;r++)t[r].byteOffset!==t[r+1].byteOffset?(e.push(i),i+=1):e.push(i);return e.push(i),e}(a),f=a[a.length-1],n=f.byteOffset+f.byteLength+f.padding,C(l,"name",Zi),C(l,"alignment",i),C(l,"byteLength",n),Tn(l,"fields",(function(){return e.slice()})),Tn(l,"layout",(function(){return Wa(a)})),C(l,"bufferOf",(function(t){if(!pa(t))throw new TypeError(L("invalid argument. First argument must be a `struct` instance. Value: `%s`.",t));return t[qi].buffer})),C(l,"byteLengthOf",(function(t){var n=Ja(e,t);if(n instanceof Error)throw n;return a[n].byteLength})),C(l,"byteOffsetOf",(function(t){var n=Ja(e,t);if(n instanceof Error)throw n;return a[n].byteOffset})),C(l,"descriptionOf",(function(t){var n=Ja(e,t);if(n instanceof Error)throw n;return a[n].description})),C(l,"isStruct",(function(t){return t instanceof l||pa(t)&&cr(t.constructor)})),C(l,"typeOf",(function(t){var n=Ja(e,t);if(n instanceof Error)throw n;return a[n].type})),C(l,"viewOf",(function(t){var e;if(!pa(t))throw new TypeError(L("invalid argument. First argument must be a `struct` instance. Value: `%s`.",t));return e=t[qi],new Gi(e.buffer,e.byteOffset,e.byteLength)})),o=function(t,e){var n,r,i,o,a;for(i={},a=0;a<e.length;a++)n=_o(o=e[a]),r=Oa(o),o.enumerable?o.writable?Ki(t,o.name,n,r):Hi(t,o.name,n):o.writable?Xi(t,o.name,n,r):Tn(t,o.name,n),i[o.name]=[n,r];return i}(l.prototype,a),C(l.prototype,"toString",(function(){if(!(this instanceof l))throw new Error("invalid invocation. `this` is not a struct instance.");return Za(l,a,arguments.length>0?arguments[0]:{})})),C(l.prototype,"toJSON",(function(){if(!(this instanceof l))throw new Error("invalid invocation. `this` is not a struct instance.");return function(t,e){var n,r,i,o;for(n={},o=0;o<e.length;o++)Wt(i=t[(r=e[o]).name])?i=su(i):(pa(i)||bn(i)&&Nt(i.toJSON))&&(i=i.toJSON()),n[r.name]=i;return n}(this,a)})),l}function hu(t,e,n){var r,i,o,a,u,f,l,s,c,h,p;for(u={format:"layout"},f=n.length,l=n.get&&n.set?Xt("default"):Kt("default"),o=t.layout,c=t.byteLength,r=new Ye(e),i=0,p=0;p<f;p++){h=l(n,p);try{a=t.viewOf(h),s=!0}catch(e){try{h=new t(h)}catch(t){return null}a=t.viewOf(h),s=!1}if(s&&h.toString(u)!==o)return null;Pi(c,new Ye(a.buffer,a.byteOffset,a.byteLength),1,0,r,1,i),i+=c}return e}var pu=ht(),gu="StructArray";function mu(t){var e,n,r,i;if(Wt(t))i=cu(t);else{if(!cr(t))throw new TypeError(L("invalid argument. First argument must be either a struct constructor or struct schema. Value: `%s`.",t));i=t}function o(t,n,r){var a,u,f,l;if(a=arguments.length,!(this instanceof o))return 0===a?new o:1===a?new o(t):2===a?new o(t,n):new o(t,n,r);if(0===a)u=new Si(0),f=0;else if(1===a)if(lt(t))u=new Si(t*e),f=t;else if(Wt(t)){if(f=t.length,null===(u=hu(i,new Si(f*e),t)))throw new TypeError(L("invalid argument. Each element of a provided input array must be a valid object or a struct instance having the same layout as elements in the desired output array."))}else if($t(t)){if(!at(f=(u=t).byteLength/e))throw new RangeError(L("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",e,u.byteLength))}else{if(!nn(t))throw new TypeError(L("invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!1===pu)throw new TypeError(L("invalid argument. Environment lacks Symbol.iterator support. First argument must be a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",t));if(!Nt(t[Ct]))throw new TypeError(L("invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!Nt((u=t[Ct]()).next))throw new TypeError(L("invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(f=(l=function(t){var e,n;for(e=[];!(n=t.next()).done;)e.push(n.value);return e}(u)).length,null===(u=hu(i,new Si(f*e),l)))throw new TypeError(L("invalid argument. Each element of a provided input iterable must be either a valid object or a struct instance having the same layout as elements in the desired output array."))}else{if(!$t(u=arguments[0]))throw new TypeError(L("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!lt(n))throw new TypeError(L("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",n));if(!at(n/e))throw new RangeError(L("invalid argument. Second argument must be a multiple of %u. Value: `%u`.",e,n));if(n>=u.byteLength)throw new RangeError(L("invalid argument. Second argument exceeds the bounds of the ArrayBuffer. Value: `%s`.",n));if(2===a){if(!at(f=(u.byteLength-n)/e))throw new RangeError(L("invalid argument. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",e,u.byteLength-n))}else{if(!lt(f=r))throw new TypeError(L("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",f));if(f*e>u.byteLength-n)throw new RangeError(L("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",f*e))}}return C(this,"_buffer",u),C(this,"_byteOffset",n||0),C(this,"_byteLength",f*e),C(this,"_length",f),this}return e=i.byteLength,n=i.layout,r=i.fields,C(o,"BYTES_PER_ELEMENT",e),C(o,"name",gu),C(o,"struct",i),Tn(o.prototype,"buffer",(function(){return this._buffer})),Tn(o.prototype,"byteLength",(function(){return this._byteLength})),Tn(o.prototype,"byteOffset",(function(){return this._byteOffset})),C(o.prototype,"BYTES_PER_ELEMENT",o.BYTES_PER_ELEMENT),C(o.prototype,"get",(function(t){if(!a(this))throw new TypeError(L("invalid invocation. `this` is not a %s.",gu));if(!lt(t))throw new TypeError(L("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return new i(this._buffer,this._byteOffset+t*e,e)})),Tn(o.prototype,"length",(function(){return this._length})),C(o.prototype,"set",(function(t){var o,u,f,l,s,c,h,p,g,m,y,d;if(!a(this))throw new TypeError(L("invalid invocation. `this` is not a %s.",gu));if(l=this._buffer,arguments.length>1){if(!lt(f=arguments[1]))throw new TypeError(L("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",f))}else f=0;if(u={format:"layout"},h=i.byteLength,!Wt(t)||er(r,"length")){if(f>=this._length)throw new RangeError(L("invalid argument. Index argument is out-of-bounds. Value: `%u`.",f));if(!nn(t))throw new TypeError(L("invalid argument. Must provide either a valid object or a struct instance. Value: `%s`.",t));if(t.toString(u)===n)return o=i.viewOf(t),void Pi(h,new Ye(o.buffer,o.byteOffset,h),1,0,new Ye(l,this._byteOffset+f*e,h),1,0);for(g=new i(l,this._byteOffset+f*e,h),y=0;y<r.length;y++)ur(t,m=r[y])&&(g[m]=t[m])}else{if(f+(p=t.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(c=(o=t).get&&o.set?Xt("default"):Kt("default"),d=this._byteOffset+f*e,o.buffer===l&&o.byteOffset<d&&o.byteOffset+o.byteLength>d){for(s=[],y=0;y<p;y++)s.push(c(t,y));o=s,c=Kt("default")}for(y=0;y<p;f++,y++)this.set(c(o,y),f)}})),C(o.prototype,"struct",i),o;function a(t){return"object"==typeof t&&null!==t&&(t.constructor.name===gu||function(t,e){var n=typeof e;if(null===e||"object"!==n&&"function"!==n)throw new TypeError(L("invalid argument. Second argument must be either an object (except null) or a function. Value: `%s`.",e));return n=typeof t,null!==t&&("object"===n||"function"===n)&&Vi.call(e,t)}(t,o.prototype))&&t.BYTES_PER_ELEMENT===e}}var yu="function"==typeof Buffer?Buffer:null;var du,bu=t.Buffer;du=function(){var t,e;if("function"!=typeof yu)return!1;try{t=kt(e="function"==typeof yu.from?yu.from([1,2,3,4]):new yu([1,2,3,4]))&&1===e[0]&&2===e[1]&&3===e[2]&&4===e[3]}catch(e){t=!1}return t}()?bu:function(){throw new Error("not implemented")};var vu=du;function wu(){throw new Error("not implemented")}var _u={binary:vu,float64:ie,float32:le,float16:wu,generic:Array,int16:ke,int32:Ee,int8:Qe,uint16:je,uint32:me,uint8:Ye,uint8c:We,complex32:wu,complex64:kn,complex128:$n,bool:Xn},Eu={};var xu=Nt(vu.allocUnsafe)?function(t){if(!ct(t))throw new TypeError(L("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));return vu.allocUnsafe(t)}:function(t){if(!ct(t))throw new TypeError(L("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));return new vu(t)};function Tu(t){return function(t,e,n,r){var i;return function(t,e){return"function"==typeof t["fill"]}(t)?t.fill(e,n,r):(n<0&&(n+=t.length)<0&&(n=0),r<0?r+=t.length:r>t.length&&(r=t.length),(i=Ri(t)).accessorProtocol?function(t,e,n,r){var i,o,a;for(i=t.data,o=t.accessors[1],a=n;a<r;a++)o(i,a,e);return i}(i,e,n,r):function(t,e,n,r){var i;for(i=n;i<r;i++)t[i]=e;return t}(t,e,n,r))}(xu(t),0,0,t)}function Vu(t,e){var n=function(t){var e,n,r;return!Nt(t)&&(r=Kr(t),n=_u[r]||null)?n:ni(t)?(r?e=t.value:r=(e=t).layout,(n=Eu[r])||(n=mu(e),Eu[r]=n),n):null}(t);return n?new n(e):null}function Ou(t,e){var n=Kr(t);return"generic"===n?Ea(e):"binary"===n?Tu(e):Vu(t,e)}function Au(t){var e,n,r,i;for(r=Ya(t),n=t.length,e=[],i=0;i<n;i++)e.push(r(t,i));return e}function ju(t){if("function"!=typeof t)throw new TypeError(L("invalid argument. Must provide a function. Value: `%s`.",t));return function(e){var n,r;if(!function(t){return null!=t&&"function"!=typeof t&&"number"==typeof t.length&&it(t.length)&&t.length>=0&&t.length<=tn}(e))return!1;if(0===(n=e.length))return!1;for(r=0;r<n;r++)if(!1===t(e[r]))return!1;return!0}}var Su=ju(ct.isPrimitive),Fu=ju(ct.isObject),Lu=ju(ct);C(Lu,"primitives",Su),C(Lu,"objects",Fu);var Iu=ju(ft.isPrimitive),Bu=ju(ft.isObject),Ru=ju(ft);function ku(t,e,n){var r,i,o,a,u;for(r=t.length,i=n,o=n,u=0;u<r;u++){if(0===t[u])return[n,n];(a=e[u])>0?o+=a*(t[u]-1):a<0&&(i+=a*(t[u]-1))}return[i,o]}function Uu(t){return Math.abs(t)}C(Ru,"primitives",Iu),C(Ru,"objects",Bu),C(ku,"assign",(function(t,e,n,r){var i,o,a,u,f;for(i=t.length,o=n,a=n,f=0;f<i;f++){if(0===t[f])return r[0]=n,r[1]=n,r;(u=e[f])>0?a+=u*(t[f]-1):u<0&&(o+=u*(t[f]-1))}return r[0]=o,r[1]=a,r}));var Mu=Array.prototype.slice;function Nu(t,e,n){var r;return function(t,e){return"function"==typeof t[e]}(t,"slice")?t.slice(e,n):(r=Ri(t)).accessorProtocol?function(t,e,n){var r,i,o,a;for(r=t.data,i=t.accessors[0],o=[],a=e;a<n;a++)o.push(i(r,a));return o}(r,e,n):function(t,e,n){return Mu.call(t,e,n)}(t,e,n)}function Pu(t,e){return e&&(2===t||3===t)}function Cu(t,e){return e&&(1===t||3===t)}function Yu(t){return"column-major"===t}var Du=/[-\/\\^$*+?.()|[\]{}]/g;var Ju=RegExp.prototype.exec;var $u=J();function zu(t){return"object"==typeof t&&(t instanceof RegExp||($u?function(t){try{return Ju.call(t),!0}catch(t){return!1}}(t):"[object RegExp]"===Z(t)))}function Wu(t,e,n){if(!rn(t))throw new TypeError(L("invalid argument. First argument must be a string. Value: `%s`.",t));if(rn(e))e=new RegExp(function(t){var e,n;if(!rn(t))throw new TypeError(L("invalid argument. Must provide a regular expression string. Value: `%s`.",t));if("/"===t[0])for(n=t.length-1;n>=0&&"/"!==t[n];n--);return void 0===n||n<=0?t.replace(Du,"\\$&"):(e=(e=t.substring(1,n)).replace(Du,"\\$&"),t=t[0]+e+t.substring(n))}(e),"g");else if(!zu(e))throw new TypeError(L("invalid argument. Second argument must be a string or regular expression. Value: `%s`.",e));if(!rn(n)&&!Nt(n))throw new TypeError(L("invalid argument. Third argument must be a string or replacement function. Value: `%s`.",n));return rr(t,e,n)}var Gu={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}} ] )",bool:"new BooleanArray( [ {{data}} ] )"};var qu={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float16:10,float32:11,float64:12,complex32:13,complex64:14,complex128:15,binary:16,generic:17,notype:18,userdefined_type:256},Zu=Ei(),Xu={throw:1,clamp:2,wrap:3,normalize:4};var Hu=4294967295,Ku=4294967296,Qu=new Ye(8),tf=new Gi(Qu.buffer);function ef(t,e,n,r){var i,o,a;if(0===t){for(a=0;a<Qu.length;a++)e[r]=0,r+=n;return e}for(o=(t&Hu)>>>0,i=rt(t/Ku),no?(tf.setUint32(0,o,no),tf.setUint32(4,i,no)):(tf.setUint32(0,i,no),tf.setUint32(4,o,no)),a=0;a<Qu.length;a++)e[r]=Qu[a],r+=n;return e}C((function(t){var e,n,r,i;return e=new Ye(8),0===t||(i=(4294967295&t)>>>0,r=rt(t/4294967296),n=new Gi(e.buffer),no?(n.setUint32(0,i,no),n.setUint32(4,r,no)):(n.setUint32(0,r,no),n.setUint32(4,i,no))),e}),"assign",ef);var nf={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float16:10,float32:11,float64:12,complex32:13,complex64:14,complex128:15,binary:16,generic:17,notype:18,userdefined_type:256},rf=Ei(),of={throw:1,clamp:2,wrap:3,normalize:4};function af(t,e,n,r,i,o){var a,u,f,l,s;if(!(this instanceof af))return new af(t,e,n,r,i,o);for(l=1,s=0;s<n.length;s++)l*=n[s];return u=e.BYTES_PER_ELEMENT?e.BYTES_PER_ELEMENT*l:null,this._byteLength=u,this._bytesPerElement=ti(t),this._buffer=e,this._dtype=t,this._length=l,this._ndims=n.length,this._offset=i,this._order=o,this._shape=n,this._strides=r,this._accessors=yt(e.get&&e.set),this._iterationOrder=function(t){var e,n;for(e=0,n=0;n<t.length;n++)t[n]<0&&(e+=1);return 0===e?1:e===t.length?-1:0}(r),a=function(t,e,n,r,i){var o;return 0!==t&&0!==i&&t===(o=ku(e,n,r))[1]-o[0]+1}(l,n,r,i,this._iterationOrder),f=function(t){var e,n,r,i,o,a;if(0===(n=t.length))return 0;for(e=!0,r=!0,i=Uu(t[0]),a=1;a<n;a++){if(o=Uu(t[a]),e&&o<i?e=!1:r&&o>i&&(r=!1),!r&&!e)return 0;i=o}return r&&e?3:r?1:2}(r),this._flags={ROW_MAJOR_CONTIGUOUS:Cu(f,a),COLUMN_MAJOR_CONTIGUOUS:Pu(f,a),READONLY:!1},this.__meta_dataview__=null,this}function uf(){return{dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32",boolean:"bool",index:"int32",integer_index:"int32",boolean_index:"bool",mask_index:"uint8"},order:"row-major",casting:"safe",index_mode:"throw"}}C(af,"name","ndarray"),Tn(af.prototype,"byteLength",(function(){return this._byteLength})),Tn(af.prototype,"BYTES_PER_ELEMENT",(function(){return this._bytesPerElement})),Tn(af.prototype,"data",(function(){return this._buffer})),Tn(af.prototype,"dtype",(function(){return this._dtype})),Tn(af.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})),Tn(af.prototype,"length",(function(){return this._length})),Tn(af.prototype,"ndims",(function(){return this._ndims})),Tn(af.prototype,"offset",(function(){return this._offset})),Tn(af.prototype,"order",(function(){return this._order})),Tn(af.prototype,"shape",(function(){return Nu(this._shape,0,this._shape.length)})),Tn(af.prototype,"strides",(function(){return Nu(this._strides,0,this._strides.length)})),C(af.prototype,"get",(function(){var t,e;for(t=this._offset,e=0;e<arguments.length;e++)t+=this._strides[e]*arguments[e];return this._accessors?this._buffer.get(t):this._buffer[t]})),C(af.prototype,"iget",(function(t){var e,n,r,i,o,a;if(0===(r=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(n=this._shape,e=this._strides,i=this._offset,Yu(this._order)){for(a=0;a<r;a++)t-=o=t%n[a],t/=n[a],i+=o*e[a];return this._accessors?this._buffer.get(i):this._buffer[i]}for(a=r-1;a>=0;a--)t-=o=t%n[a],t/=n[a],i+=o*e[a];return this._accessors?this._buffer.get(i):this._buffer[i]})),C(af.prototype,"set",(function(){var t,e;for(t=this._offset,e=0;e<arguments.length-1;e++)t+=this._strides[e]*arguments[e];return this._accessors?this._buffer.set(arguments[e],t):this._buffer[t]=arguments[e],this})),C(af.prototype,"iset",(function(t,e){var n,r,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(e,this._offset+t):this._buffer[this._offset+t]=e,this;if(-1===this._iterationOrder)return this._accessors?this._buffer.set(e,this._offset-t):this._buffer[this._offset-t]=e,this}if(r=this._shape,n=this._strides,o=this._offset,Yu(this._order)){for(u=0;u<i;u++)t-=a=t%r[u],t/=r[u],o+=a*n[u];return this._accessors?this._buffer.set(e,o):this._buffer[o]=e,this}for(u=i-1;u>=0;u--)t-=a=t%r[u],t/=r[u],o+=a*n[u];return this._accessors?this._buffer.set(e,o):this._buffer[o]=e,this})),C(af.prototype,"toString",(function(){var t,e,n,r,i,o;if(e=this._shape.length,n="ndarray( '"+(r=this._dtype)+"', ",t="",this._length<=100)if("complex64"===r||"complex128"===r)for(o=0;o<this._length;o++)t+=Un(i=this.iget(o))+", "+Mn(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"===r||"complex128"===r)for(o=0;o<3;o++)t+=Un(i=this.iget(o))+", "+Mn(i),o<2&&(t+=", ");else for(o=0;o<3;o++)t+=this.iget(o),o<2&&(t+=", ");if(t+=", ..., ","complex64"===r||"complex128"===r)for(o=2;o>=0;o--)t+=Un(i=this.iget(this._length-1-o))+", "+Mn(i),o>0&&(t+=", ");else for(o=2;o>=0;o--)t+=this.iget(this._length-1-o),o>0&&(t+=", ")}if(n+=Wu(Gu[this.dtype],"{{data}}",t),n+=", ",n+=0===e?"[]":"[ "+this._shape.join(", ")+" ]",n+=", ",n+="[ ",0===e)n+="0";else for(o=0;o<e;o++)this._strides[o]<0?n+=-this._strides[o]:n+=this._strides[o],o<e-1&&(n+=", ");return n+=" ]",n+=", ",n+="0",n+=", ",n+="'"+this._order+"'",n+=" )"})),C(af.prototype,"toJSON",(function(){var t,e,n,r;for(e=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(),r=0;r<t.strides.length;r++)t.strides[r]<0&&(t.strides[r]*=-1);if(t.data=[],"complex64"===t.dtype||"complex128"===t.dtype)for(r=0;r<e;r++)n=this.iget(r),t.data.push(Un(n),Mn(n));else for(r=0;r<e;r++)t.data.push(this.iget(r));return t})),C(af.prototype,"valueOf",(function(){return 0===this._ndims?this.iget():this})),C(af.prototype,"__array_meta_dataview__",jo()?function(){var t,e,n,r,i,o,a,u,f,l,s,c,h,p;if(f=this._mode||"throw",a=this._submode||[f],n=33+16*(c=this._ndims)+(h=a.length),(u=this.__meta_dataview__)&&u.byteLength===n)return u;for(u=new Gi(new Si(n)),i=this._shape,o=this._strides,r=this._dtype,t=this._bytesPerElement,l=0,u.setInt8(l,no?1:0),l+=1,u.setInt16(l,qu[r],no),l+=2,u.setBigInt64(l,ca(c),no),s=8*c,l+=8,p=0;p<c;p++)u.setBigInt64(l,ca(i[p]),no),u.setBigInt64(l+s,ca(o[p]*t),no),l+=8;for(l+=s,u.setBigInt64(l,ca(this._offset*t),no),l+=8,u.setInt8(l,Zu[this._order]),l+=1,u.setInt8(l,Xu[f]),l+=1,u.setBigInt64(l,ca(h),no),l+=8,p=0;p<h;p++)u.setInt8(l,Xu[a[p]]),l+=1;return e=0,e|=this._flags.READONLY?4:0,u.setInt32(l,e,no),this.__meta_dataview__=u,u}:function(){var t,e,n,r,i,o,a,u,f,l,s,c,h,p,g;if(l=this._mode||"throw",u=this._submode||[l],r=33+16*(h=this._ndims)+(p=u.length),(f=this.__meta_dataview__)&&f.byteLength===r)return f;for(f=new Gi(new Si(r)),e=new Ye(f.buffer),o=this._shape,a=this._strides,i=this._dtype,t=this._bytesPerElement,s=0,f.setInt8(s,no?1:0),s+=1,f.setInt16(s,nf[i],no),ef(h,e,1,s+=2),c=8*h,s+=8,g=0;g<h;g++)ef(o[g],e,1,s),ef(a[g]*t,e,1,s+c),s+=8;for(s+=c,ef(this._offset*t,e,1,s),s+=8,f.setInt8(s,rf[this._order]),s+=1,f.setInt8(s,of[l]),ef(p,e,1,s+=1),s+=8,g=0;g<p;g++)f.setInt8(s,of[u[g]]),s+=1;return n=0,n|=this._flags.READONLY?4:0,f.setInt32(s,n,no),this.__meta_dataview__=f,f});var ff={dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32",boolean:"bool",index:"int32",integer_index:"int32",boolean_index:"bool",mask_index:"uint8"},order:"row-major",casting:"safe",index_mode:"throw"},lf={"dtypes.default":ff.dtypes.default,"dtypes.numeric":ff.dtypes.numeric,"dtypes.real":ff.dtypes.real,"dtypes.floating_point":ff.dtypes.floating_point,"dtypes.real_floating_point":ff.dtypes.real_floating_point,"dtypes.complex_floating_point":ff.dtypes.complex_floating_point,"dtypes.integer":ff.dtypes.integer,"dtypes.signed_integer":ff.dtypes.signed_integer,"dtypes.unsigned_integer":ff.dtypes.unsigned_integer,"dtypes.boolean":ff.dtypes.boolean,"dtypes.index":ff.dtypes.index,"dtypes.integer_index":ff.dtypes.integer_index,"dtypes.boolean_index":ff.dtypes.boolean_index,"dtypes.mask_index":ff.dtypes.mask_index,order:ff.order,casting:ff.casting,index_mode:ff.index_mode};function sf(t){var e=typeof t;return null===t||"object"!==e&&"function"!==e?new TypeError(L("invalid argument. A provided constructor must be either an object (except null) or a function. Value: `%s`.",t)):null}C(uf,"get",(function(t){var e=lf[t];return void 0===e?null:e}));var cf=Object.create;function hf(){}var pf="function"==typeof cf?cf:function(t){return hf.prototype=t,new hf};function gf(t,e){return t<0?0:t>e?e:t}function mf(t,e){var n=e+1;return t<0?((t+=n)<0&&0!==(t%=n)&&(t+=n),t):t>e?((t-=n)>e&&(t%=n),t):t}function yf(t,e){return t<0?(t+=e+1)<0?-1:t:t>e?-1:t}var df={wrap:mf,clamp:gf,normalize:function(t,e){var n=yf(t,e);if(n<0||n>e)throw new RangeError(L("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",e,t));return n},throw:function(t,e){if(t<0||t>e)throw new RangeError(L("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",e,t));return t}};function bf(t,e,n){var r;if("clamp"===n)return gf(t,e);if("wrap"===n)return mf(t,e);if(r=t,"normalize"===n&&(r=yf(r,e)),r<0||r>e)throw new RangeError(L("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",e,t));return r}C(bf,"factory",(function(t){if(!yi(t))throw new TypeError(L("invalid argument. First argument must be a recognized index mode. Value: `%s`.",t));return df[t]}));var vf=af.prototype.iget;var wf=af.prototype.iset;function _f(t,e){var n,r;for(n=[],r=0;r<e;r++)n.push(t[r]);return n}var Ef=32767,xf=uf.get("index_mode"),Tf=!1;function Vf(t,e,n,r,i,o,a){var u,f,l,s,c;if(!(this instanceof Vf))return arguments.length<7?new Vf(t,e,n,r,i,o):new Vf(t,e,n,r,i,o,a);if(!ri(t))throw new TypeError(L("invalid argument. First argument must be a supported ndarray data type. Value: `%s`.",t));if(!Wt(e))throw new TypeError(L("invalid argument. Second argument must be an array-like object, typed-array-like, or a Buffer. Value: `%s`.",e));if(e.get&&e.set&&(!Nt(e.get)||!Nt(e.set)))throw new TypeError(L("invalid argument. Second argument `get` and `set` properties must be functions. Value: `%s`.",e));if(!Su(n)&&(!Wt(n)||n.length>0))throw new TypeError(L("invalid argument. Third argument must be an array-like object containing nonnegative integers. Value: `%s`.",n));if((u=n.length)>Ef)throw new RangeError(L("invalid argument. Number of dimensions must not exceed %u due to stack limits. Value: `%u`.",Ef,u));if(!Iu(r))throw new TypeError(L("invalid argument. Fourth argument must be an array-like object containing integers. Value: `%s`.",r));if(u>0){if(r.length!==u)throw new RangeError(L("invalid argument. Fourth argument length must match the number of dimensions. Expected number of dimensions: `%u`. Strides length: `%u`.",u,r.length))}else{if(1!==r.length)throw new RangeError("invalid argument. Fourth argument length must be equal to 1 when creating a zero-dimensional ndarray.");if(0!==r[0])throw new RangeError(L("invalid argument. Fourth argument must contain a single element equal to 0. Value: `%d`.",r[0]))}if(!lt(i))throw new TypeError(L("invalid argument. Fifth argument must be a nonnegative integer. Value: `%s`.",i));if(!xi(o))throw new TypeError(L("invalid argument. Sixth argument must be a supported order. Value: `%s`.",o));if(u>0&&!function(t,e,n,r){var i=ku(e,n,r);return i[0]>=0&&i[1]<t}(e.length,n,r,i)&&function(t){var e,n,r;if(0===(e=t.length))return 0;for(n=1,r=0;r<e;r++)n*=t[r];return n}(n)>0)throw new Error("invalid arguments. Input buffer is incompatible with the specified meta data. Ensure that the offset is valid with regard to the strides array and that the buffer has enough elements to satisfy the desired array shape.");if((f={}).mode=xf,f.readonly=Tf,arguments.length>6&&(l=function(t,e){var n;if(!br(e))return new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",e));if(W(e,"mode")&&(t.mode=e.mode,!yi(t.mode)))return new TypeError(L("invalid option. `%s` option must be a recognized mode. Option: `%s`.","mode",t.mode));if(W(e,"submode")){if(t.submode=e.submode,!en(t.submode))return new TypeError(L("invalid option. `%s` option must be an array containing recognized modes. Option: `%s`.","submode",t.submode));if(0===t.submode.length)return new TypeError(L("invalid option. `%s` option must be an array containing recognized modes. Option: `%s`.","submode",t.submode.join(",")));for(n=0;n<t.submode.length;n++)if(!yi(t.submode[n]))return new TypeError(L("invalid option. Each submode must be a recognized mode. Option: `%s`.",t.submode[n]));t.submode=t.submode.slice()}return W(e,"readonly")&&(t.readonly=e.readonly,!mt(t.readonly))?new TypeError(L("invalid option. `%s` option must be a boolean. Option: `%s`.","readonly",t.readonly)):null}(f,a),l))throw l;return this._mode=f.mode,void 0===f.submode&&(f.submode=[this._mode]),this._submode=f.submode,s=_f(n,u),c=_f(r,u||1),af.call(this,t,e,s,c,i,o),this._flags.READONLY=f.readonly,this}!function(t,e){var n=sf(t);if(n)throw n;if(n=sf(e))throw n;if(void 0===e.prototype)throw new TypeError(L("invalid argument. Second argument must have a prototype from which another object can inherit. Value: `%s`.",e.prototype));t.prototype=pf(e.prototype),P(t.prototype,"constructor",{configurable:!0,enumerable:!1,writable:!0,value:t})}(Vf,af),C(Vf,"name","ndarray"),C(Vf.prototype,"get",(function(){var t,e,n,r;if(arguments.length!==this._ndims)throw new RangeError(L("invalid arguments. Number of indices must match the number of dimensions. ndims: `%u`. nargs: `%u`.",this._ndims,arguments.length));for(t=this._offset,n=this._submode.length,r=0;r<arguments.length;r++){if(!at(arguments[r]))throw new TypeError(L("invalid argument. Indices must be integer valued. Argument: `%u`. Value: `%s`.",r,arguments[r]));e=bf(arguments[r],this._shape[r]-1,this._submode[r%n]),t+=this._strides[r]*e}return this._accessors?this._buffer.get(t):this._buffer[t]})),C(Vf.prototype,"iget",(function(t){if(this._ndims>0){if(!at(t))throw new TypeError(L("invalid argument. Index must be an integer. Value: `%s`.",t));return t=bf(t,this._length-1,this._mode),vf.call(this,t)}return vf.call(this)})),C(Vf.prototype,"set",(function(){var t,e,n,r;if(this._flags.READONLY)throw new Error("invalid invocation. Cannot write to a read-only array.");if(arguments.length!==this._ndims+1)throw new RangeError(L("invalid arguments. Number of indices must match the number of dimensions. ndims: `%u`. nargs: `%u`.",this._ndims,arguments.length));for(t=this._offset,n=this._submode.length,r=0;r<arguments.length-1;r++){if(!at(arguments[r]))throw new TypeError(L("invalid argument. Indices must be integer valued. Argument: `%i`. Value: `%s`.",r,arguments[r]));e=bf(arguments[r],this._shape[r]-1,this._submode[r%n]),t+=this._strides[r]*e}return this._accessors?this._buffer.set(arguments[r],t):this._buffer[t]=arguments[r],this})),C(Vf.prototype,"iset",(function(t,e){if(this._flags.READONLY)throw new Error("invalid invocation. Cannot write to a read-only array.");if(this._ndims>0){if(!at(t))throw new TypeError(L("invalid argument. Index must be an integer. Value: `%s`.",t));t=bf(t,this._length-1,this._mode),wf.call(this,t,e)}else wf.call(this,t);return this}));var Of=Object.prototype.toString;var Af=new Function("try {return this === global;} catch ( err ) {return false;}")(),jf=e,Sf=Vt(),Ff=/node|io\.js/;var Lf,If,Bf="object"==typeof global&&global===Sf&&Sf===Sf.global&&("[object global]"===Z(Sf)||"[object Object]"===Z(Sf))&&!0===Af&&"object"==typeof jf&&"[object process]"===(Lf=jf,Of.call(Lf))&&br(jf.versions)&&rn(jf.versions.node)&&(void 0===jf.release||br(jf.release)&&rn(jf.release.name)&&Ff.test(jf.release.name)),Rf=e.versions.node,kf=(If=Bf?Rf:null,If?parseInt(If.split(".")[0],10):-1),Uf=Nt(vu.from)&&kf>=5;var Mf,Nf=Nt(vu.from)?function(t){if(!Wt(t))throw new TypeError(L("invalid argument. Must provide an array-like object. Value: `%s`.",t));return vu.from(t)}:function(t){if(!Wt(t))throw new TypeError(L("invalid argument. Must provide an array-like object. Value: `%s`.",t));return new vu(t)};Mf=Uf?function(t,e,n){var r,i;if(!$t(t))throw new TypeError(L("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(arguments.length>1){if(!lt(e))throw new TypeError(L("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(e>t.byteLength)throw new RangeError(L("invalid argument. Second argument must not exceed the number of bytes in the input ArrayBuffer. Value: `%s`.",e));if(r=e,arguments.length>2){if(!lt(n))throw new TypeError(L("invalid argument. Last argument must be a nonnegative integer. Value: `%s`.",n));if(n>t.byteLength)throw new RangeError(L("invalid argument. Last argument must not exceed the number of bytes in the input ArrayBuffer. Value: `%s`.",n));i=n}else i=t.byteLength-r}else r=0,i=t.byteLength;return 0===i&&kf<6?vu.from([]):vu.from(t,r,i)}:function(t,e,n){var r;if(!$t(t))throw new TypeError(L("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(arguments.length>1){if(!lt(e))throw new TypeError(L("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(e>t.byteLength)throw new RangeError(L("invalid argument. Second argument must not exceed the number of bytes in the input ArrayBuffer. Value: `%s`.",e));if(arguments.length>2){if(!lt(n))throw new TypeError(L("invalid argument. Last argument must be a nonnegative integer. Value: `%s`.",n));if(n>t.byteLength)throw new RangeError(L("invalid argument. Last argument must not exceed the number of bytes in the input ArrayBuffer. Value: `%s`.",n));r=n}else r=t.byteLength-e;return Nf(new Ye(t,e,r))}return kf<3?Nf(new Ye(t)):0===t.byteLength?new vu([]):new vu(t)};var Pf,Cf=Mf;Pf=Nt(vu.from)?function(t){if(!kt(t))throw new TypeError(L("invalid argument. Must provide a Buffer. Value: `%s`.",t));return vu.from(t)}:function(t){if(!kt(t))throw new TypeError(L("invalid argument. Must provide a Buffer. Value: `%s`.",t));return new vu(t)};var Yf=Pf;var Df=uf.get("dtypes.default"),Jf=uf.get("order");function $f(t){return"generic"===t}function zf(t){return"binary"===t}function Wf(t){return W(t,"order")?t.order:Jf}function Gf(t,e,n,r,i,o,a){var u,f,l,s,c;if($f(t))throw new TypeError(L("invalid argument. ArrayBuffer is incompatible with the specified data type. Value: `%s`.",t));return c=i,s=n*r,r<0&&(c-=(s*=-1)*ti(t)),u=zf(t)?Cf(e,c,s):wo(e,c,s,t),c=function(t,e){var n,r,i;for(r=t.length,n=0,i=0;i<r;i++)e[i]<0&&(n-=e[i]*(t[i]-1));return n}(f=[n],l=[r]),arguments.length>6?new Vf(t,u,f,l,c,o,a):new Vf(t,u,f,l,c,o)}function qf(t,e,n){var r,i;return r=null===n?{}:n,lt(t)?new Vf(e,i=Ou(e,t),[i.length],[1],0,Wf(r),r):kt(t)?new Vf(e,i=$f(e)?Au(t):zf(e)?Yf(t):wo(t,e),[i.length],[1],0,Wf(r),r):Wt(t)?new Vf(e,i=$f(e)?Au(t):zf(e)?Nf(t):wo(t,e),[i.length],[1],0,Wf(r),r):$t(t)?Gf(e,t,t.byteLength/ti(e),1,0,Wf(r),r):Dt(t)?(i=function(){var t,e,n,r,i,o,a,u,f;if(t=arguments[0],arguments.length>1)if(Wt(arguments[1])){if(r=arguments[1],arguments.length>2){if(!Nt(n=arguments[2]))throw new TypeError(L("invalid argument. Callback argument must be a function. Value: `%s`.",n));e=arguments[3]}}else{if(!Nt(n=arguments[1]))throw new TypeError(L("invalid argument. Callback argument must be a function. Value: `%s`.",n));e=arguments[2]}if(!Yt(t))throw new TypeError(L("invalid argument. Iterator argument must be an iterator protocol-compliant object. Value: `%s`.",t));if(u=-1,void 0===r){if(r=[],n){for(;u+=1,!(f=t.next()).done;)r.push(n.call(e,f.value,u));return r}for(;!(f=t.next()).done;)r.push(f.value);return r}if(i=r.length,a=tr(r),o=qt(r)?Bi(a):Li(a),n){for(;u<i-1&&(u+=1,!(f=t.next()).done);)o(r,u,n.call(e,f.value,u));return r}for(;u<i-1&&(u+=1,!(f=t.next()).done);)o(r,u,f.value);return r}(i=t[Ct]()),zf(e)?i=Nf(i):$f(e)||(i=wo(i,e)),new Vf(e,i,[i.length],[1],0,Wf(r),r)):null===n&&br(t)?new Vf(e,i=Ou(e,0),[i.length],[1],0,Wf(t),t):null}function Zf(){var t,e,n,r,i,o,a,u;if(0===(t=arguments.length))return a=Ou(Df,0),new Vf(Df,a,[a.length],[1],0,Jf);if(e=arguments[0],1===t){if(ri(e))return qf(0,e,null);if(null===(u=qf(e,Df,null)))throw new TypeError(L("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, iterable, data type, or options object. Value: `%s`.",e));return u}if(n=arguments[1],2===t){if(ri(e)){if(null===n)throw new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",n));return qf(0,e,n)}if(ri(n)){if(null===(u=qf(e,n,null)))throw new TypeError(L("invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or iterable. Value: `%s`.",e));return u}if(lt(n)){if(!$t(e))throw new TypeError(L("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",e));return Gf(Df,e,(e.byteLength-n)/ti(Df),1,n,Jf)}if(null===n)throw new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",n));if(null===(u=qf(e,Df,n)))throw new TypeError(L("invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or iterable. Value: `%s`.",e));return u}if(r=arguments[2],3===t){if(ri(r)){if(!$t(e))throw new TypeError(L("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",e));if(!lt(n))throw new TypeError(L("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",n));return Gf(r,e,(e.byteLength-n)/ti(r),1,n,Jf)}if(ri(n)){if(null===r)throw new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",r));if(null===(u=qf(e,n,r)))throw new TypeError(L("invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or iterable. Value: `%s`.",e));return u}if(!$t(e))throw new TypeError(L("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",e));if(!lt(n))throw new TypeError(L("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",n));if(lt(r))return Gf(Df,e,r,1,n,Jf);if(null===r)throw new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",r));return Gf(Df,e,(e.byteLength-n)/ti(Df),1,n,Wf(r),r)}if(i=arguments[3],4===t){if(!$t(e))throw new TypeError(L("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",e));if(!lt(n))throw new TypeError(L("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",n));if(lt(r)){if(ri(i))return Gf(i,e,r,1,n,Jf);if(!br(i))throw new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",i));return Gf(Df,e,r,1,n,Wf(i),i)}if(!ri(r))throw new TypeError(L("invalid argument. Third argument must be a recognized/supported data type. Value: `%s`.",r));if(!br(i))throw new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",i));return Gf(r,e,(e.byteLength-n)/ti(r),1,n,Wf(i),i)}if(o=arguments[4],!$t(e))throw new TypeError(L("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",e));if(!lt(n))throw new TypeError(L("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",n));if(!lt(r))throw new TypeError(L("invalid argument. Length must be a nonnegative integer. Value: `%s`.",r));if(!ri(i))throw new TypeError(L("invalid argument. Fourth argument must be a recognized/supported data type. Value: `%s`.",i));if(!br(o))throw new TypeError(L("invalid argument. Options argument must be an object. Value: `%s`.",o));return Gf(i,e,r,1,n,Wf(o),o)}function Xf(t,e){var n,r;if(!ri(t))throw new TypeError(L("invalid argument. First argument must be a supported data type. Value: `%s`.",t));if(n={},arguments.length>1&&(r=Ti(n,e)))throw r;return function(){var e,r,i,o,a;if(e=hi({},n),r=arguments.length,0===r)return Zf(t,e);if(r>3){if(a=Ti(e,arguments[3]))throw a;return Zf(arguments[0],arguments[1],arguments[2],t,e)}if(3===r){if(lt(arguments[2]))return Zf(arguments[0],arguments[1],arguments[2],t,e);if(a=Ti(e,arguments[2]))throw a;return Zf(arguments[0],arguments[1],t,e)}if(2===r){if(o=arguments[1],lt(i=arguments[0])){if(a=Ti(e,o))throw a;return Zf(i,t,e)}if($t(i)){if(lt(o))return Zf(i,o,t,e);if(a=Ti(e,o))throw a;return Zf(i,t,e)}if(Wt(i)){if(a=Ti(e,o))throw a;return Zf(i,t,e)}if(a=Ti(e,o))throw a;return Zf(i,t,e)}if(i=arguments[0],lt(i)||$t(i)||Wt(i)||Dt(i))return Zf(i,t,e);if(a=Ti(e,i),a)throw a;return Zf(t,e)}}return C(Zf,"factory",Xf),Xf("uint16")}));
//# sourceMappingURL=index.js.map