-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.js
More file actions
4 lines (4 loc) · 224 KB
/
Copy pathmod.js
File metadata and controls
4 lines (4 loc) · 224 KB
1
2
3
4
// Copyright (c) 2026 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
/// <reference types="./mod.d.ts" />
var t=Object.prototype.hasOwnProperty;function e(e,r){return null!=e&&t.call(e,r)}var r="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function n(){return r&&"symbol"==typeof Symbol.toStringTag}var i=Object.prototype.toString;var o="function"==typeof Symbol?Symbol:void 0,a="function"==typeof o?o.toStringTag:"";var u=n()?function(t){var r,n,o;if(null==t)return i.call(t);n=t[a],r=e(t,a);try{t[a]=void 0}catch(e){return i.call(t)}return o=i.call(t),r?t[a]=n:delete t[a],o}:function(t){return i.call(t)};var f=Array.isArray?Array.isArray:function(t){return"[object Array]"===u(t)};function s(t){return"object"==typeof t&&null!==t&&!f(t)}var l=/./,c="function"==typeof Object.defineProperty?Object.defineProperty:null;var h=Object.defineProperty;function p(t){return"number"==typeof t}function g(t){var e,r="";for(e=0;e<t;e++)r+="0";return r}function y(t,e,r){var n=!1,i=e-t.length;return i<0||(function(t){return"-"===t[0]}(t)&&(n=!0,t=t.substr(1)),t=r?t+g(i):g(i)+t,n&&(t="-"+t)),t}var m=String.prototype.toLowerCase,d=String.prototype.toUpperCase;function v(t){var e,r,n;switch(t.specifier){case"b":e=2;break;case"o":e=8;break;case"x":case"X":e=16;break;default:e=10}if(r=t.arg,n=parseInt(r,10),!isFinite(n)){if(!p(r))throw new Error("invalid integer. Value: "+r);n=0}return n<0&&("u"===t.specifier||10!==e)&&(n=4294967295+n+1),n<0?(r=(-n).toString(e),t.precision&&(r=y(r,t.precision,t.padRight)),r="-"+r):(r=n.toString(e),n||t.precision?t.precision&&(r=y(r,t.precision,t.padRight)):r="",t.sign&&(r=t.sign+r)),16===e&&(t.alternate&&(r="0x"+r),r=t.specifier===d.call(t.specifier)?d.call(r):m.call(r)),8===e&&t.alternate&&"0"!==r.charAt(0)&&(r="0"+r),r}var b=Math.abs,w=String.prototype.toLowerCase,_=String.prototype.toUpperCase,E=String.prototype.replace,x=/e\+(\d)$/,T=/e-(\d)$/,A=/^(\d+)$/,O=/^(\d+)e/,V=/\.0$/,S=/\.0*e/,j=/(\..*[^0])0*e/;function R(t,e){var r,n;switch(e.specifier){case"e":case"E":n=t.toExponential(e.precision);break;case"f":case"F":n=t.toFixed(e.precision);break;case"g":case"G":b(t)<1e-4?((r=e.precision)>0&&(r-=1),n=t.toExponential(r)):n=t.toPrecision(e.precision),e.alternate||(n=E.call(n,j,"$1e"),n=E.call(n,S,"e"),n=E.call(n,V,""));break;default:throw new Error("invalid double notation. Value: "+e.specifier)}return n=E.call(n,x,"e+0$1"),n=E.call(n,T,"e-0$1"),e.alternate&&(n=E.call(n,A,"$1."),n=E.call(n,O,"$1.e")),t>=0&&e.sign&&(n=e.sign+n),n=e.specifier===_.call(e.specifier)?_.call(n):w.call(n)}function L(t){var e,r="";for(e=0;e<t;e++)r+=" ";return r}var I=String.fromCharCode,B=Array.isArray;function F(t){return t!=t}function P(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 U(t){var e,r,n,i,o,a,u,f,s,l,c,h,g,m;if(!B(t))throw new TypeError("invalid argument. First argument must be an array. Value: `"+t+"`.");for(a="",u=1,s=0;s<t.length;s++)if(n=t[s],"string"==typeof n)a+=n;else{if(e=void 0!==n.precision,!(n=P(n)).specifier)throw new TypeError("invalid argument. Token is missing `specifier` property. Index: `"+s+"`. Value: `"+n+"`.");for(n.mapping&&(u=n.mapping),r=n.flags,l=0;l<r.length;l++)switch(i=r.charAt(l)){case" ":n.sign=" ";break;case"+":n.sign="+";break;case"-":n.padRight=!0,n.padZeros=!1;break;case"0":n.padZeros=r.indexOf("-")<0;break;case"#":n.alternate=!0;break;default:throw new Error("invalid flag: "+i)}if("*"===n.width){if(n.width=parseInt(arguments[u],10),u+=1,F(n.width))throw new TypeError("the argument for * width at position "+u+" is not a number. Value: `"+n.width+"`.");n.width<0&&(n.padRight=!0,n.width=-n.width)}if(e&&"*"===n.precision){if(n.precision=parseInt(arguments[u],10),u+=1,F(n.precision))throw new TypeError("the argument for * precision at position "+u+" is not a number. Value: `"+n.precision+"`.");n.precision<0&&(n.precision=1,e=!1)}switch(n.arg=arguments[u],n.specifier){case"b":case"o":case"x":case"X":case"d":case"i":case"u":e&&(n.padZeros=!1),n.arg=v(n);break;case"s":n.maxWidth=e?n.precision:-1,n.arg=String(n.arg);break;case"c":if(!F(n.arg)){if((o=parseInt(n.arg,10))<0||o>127)throw new Error("invalid character code. Value: "+n.arg);n.arg=F(o)?String(n.arg):I(o)}break;case"e":case"E":case"f":case"F":case"g":case"G":if(e||(n.precision=6),f=parseFloat(n.arg),!isFinite(f)){if(!p(n.arg))throw new Error("invalid floating-point number. Value: "+a);f=n.arg,n.padZeros=!1}n.arg=R(f,n);break;default:throw new Error("invalid specifier: "+n.specifier)}n.maxWidth>=0&&n.arg.length>n.maxWidth&&(n.arg=n.arg.substring(0,n.maxWidth)),n.padZeros?n.arg=y(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=(c=n.arg,h=n.width,g=n.padRight,m=void 0,(m=h-c.length)<0?c:c=g?c+L(m):L(m)+c)),a+=n.arg||"",u+=1}return a}var M=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function k(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 C(t){var e,r,n,i;for(r=[],i=0,n=M.exec(t);n;)(e=t.slice(i,M.lastIndex-n[0].length)).length&&r.push(e),"%"===n[6]?r.push("%"):r.push(k(n)),i=M.lastIndex,n=M.exec(t);return(e=t.slice(i)).length&&r.push(e),r}function N(t){var e,r;if("string"!=typeof t)throw new TypeError(N("invalid argument. First argument must be a string. Value: `%s`.",t));for(e=[C(t)],r=1;r<arguments.length;r++)e.push(arguments[r]);return U.apply(null,e)}var Y,D=Object.prototype,z=D.toString,J=D.__defineGetter__,W=D.__defineSetter__,$=D.__lookupGetter__,G=D.__lookupSetter__;Y=function(){try{return c({},"x",{}),!0}catch(t){return!1}}()?h:function(t,e,r){var n,i,o,a;if("object"!=typeof t||null===t||"[object Array]"===z.call(t))throw new TypeError(N("invalid argument. First argument must be an object. Value: `%s`.",t));if("object"!=typeof r||null===r||"[object Array]"===z.call(r))throw new TypeError(N("invalid argument. Property descriptor must be an object. Value: `%s`.",r));if((i="value"in r)&&($.call(t,e)||G.call(t,e)?(n=t.__proto__,t.__proto__=D,delete t[e],t[e]=r.value,t.__proto__=n):t[e]=r.value),o="get"in r,a="set"in r,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&&J&&J.call(t,e,r.get),a&&W&&W.call(t,e,r.set),t};var Z=Y;function q(t,e,r){Z(t,e,{configurable:!1,enumerable:!1,writable:!1,value:r})}function X(t){return"boolean"==typeof t}var K=Boolean,H=Boolean.prototype.toString;var Q=n();function tt(t){return"object"==typeof t&&(t instanceof K||(Q?function(t){try{return H.call(t),!0}catch(t){return!1}}(t):"[object Boolean]"===u(t)))}function et(t){return X(t)||tt(t)}q(et,"isPrimitive",X),q(et,"isObject",tt);var rt="object"==typeof self?self:null,nt="object"==typeof window?window:null,it="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},ot="object"==typeof it?it:null,at="object"==typeof globalThis?globalThis:null;function ut(t){if(arguments.length){if(!X(t))throw new TypeError(N("invalid argument. Must provide a boolean. Value: `%s`.",t));if(t)return new Function("return this;")()}if(at)return at;if(rt)return rt;if(nt)return nt;if(ot)return ot;throw new Error("unexpected error. Unable to resolve global object.")}var ft=ut(),st=ft.document&&ft.document.childNodes,lt=Int8Array;function ct(){return/^\s*function\s*([^(]*)/i}var ht=/^\s*function\s*([^(]*)/i;function pt(t){if("function"!=typeof t)throw new TypeError(N("invalid argument. Must provide a function. Value: `%s`.",t));return function(e){var r,n;if(!f(e))return!1;if(r=e.length,0===r)return!1;for(n=0;n<r;n++)if(!1===t(e[n]))return!1;return!0}}function gt(t){return null!==t&&"object"==typeof t}function yt(t){return gt(t)&&(t._isBuffer||t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t))}function mt(t){var e,r,n;if(("Object"===(r=u(t).slice(8,-1))||"Error"===r)&&t.constructor){if("string"==typeof(n=t.constructor).name)return n.name;if(e=ht.exec(n.toString()))return e[1]}return yt(t)?"Buffer":r}q(ct,"REGEXP",ht),q(gt,"isObjectLikeArray",pt(gt));var dt="function"==typeof l||"object"==typeof lt||"function"==typeof st?function(t){return mt(t).toLowerCase()}:function(t){var e;return null===t?"null":"object"===(e=typeof t)?mt(t).toLowerCase():e};function vt(t){return"function"===dt(t)}var bt,wt=Object,_t=Object.getPrototypeOf;bt=vt(Object.getPrototypeOf)?_t:function(t){var e=function(t){return t.__proto__}(t);return e||null===e?e:"[object Function]"===u(t.constructor)?t.constructor.prototype:t instanceof wt?wt.prototype:null};var Et=bt;function xt(t){return null==t?null:(t=wt(t),Et(t))}var Tt=Object.prototype;function At(t){var r;return!!s(t)&&(!(r=xt(t))||!e(t,"constructor")&&e(r,"constructor")&&vt(r.constructor)&&"[object Function]"===u(r.constructor)&&e(r,"isPrototypeOf")&&vt(r.isPrototypeOf)&&(r===Tt||function(t){var r;for(r in t)if(!e(t,r))return!1;return!0}(t)))}function Ot(t){return"number"==typeof t}var Vt=Number,St=Vt.prototype.toString;var jt=n();function Rt(t){return"object"==typeof t&&(t instanceof Vt||(jt?function(t){try{return St.call(t),!0}catch(t){return!1}}(t):"[object Number]"===u(t)))}function Lt(t){return Ot(t)||Rt(t)}q(Lt,"isPrimitive",Ot),q(Lt,"isObject",Rt);var It=Number.POSITIVE_INFINITY,Bt=Vt.NEGATIVE_INFINITY,Ft=Math.floor;function Pt(t){return Ft(t)===t}function Ut(t){return t<It&&t>Bt&&Pt(t)}function Mt(t){return Ot(t)&&Ut(t)}function kt(t){return Rt(t)&&Ut(t.valueOf())}function Ct(t){return Mt(t)||kt(t)}function Nt(t){return Mt(t)&&t>=0}function Yt(t){return kt(t)&&t.valueOf()>=0}function Dt(t){return Nt(t)||Yt(t)}q(Ct,"isPrimitive",Mt),q(Ct,"isObject",kt),q(Dt,"isPrimitive",Nt),q(Dt,"isObject",Yt);var zt=ut();function Jt(){return"function"==typeof zt.BigInt&&"function"==typeof BigInt&&"bigint"==typeof zt.BigInt("1")&&"bigint"==typeof BigInt("1")}function Wt(t,e,r){Z(t,e,{configurable:!1,enumerable:!1,get:r})}function $t(t){return"string"==typeof t}var Gt=String.prototype.valueOf;var Zt=n();function qt(t){return"object"==typeof t&&(t instanceof String||(Zt?function(t){try{return Gt.call(t),!0}catch(t){return!1}}(t):"[object String]"===u(t)))}function Xt(t){return $t(t)||qt(t)}function Kt(t){return Mt(t)&&t>0}function Ht(t){return kt(t)&&t.valueOf()>0}function Qt(t){return Kt(t)||Ht(t)}function te(t){return Object.keys(Object(t))}q(Xt,"isPrimitive",$t),q(Xt,"isObject",qt),q(Qt,"isPrimitive",Kt),q(Qt,"isObject",Ht);var ee=void 0!==Object.keys;function re(t){return"[object Arguments]"===u(t)}var ne=function(){return re(arguments)}();function ie(t){return t!=t}function oe(t){return Ot(t)&&ie(t)}function ae(t){return Rt(t)&&ie(t.valueOf())}function ue(t){return oe(t)||ae(t)}q(ue,"isPrimitive",oe),q(ue,"isObject",ae);var fe=Object.prototype.propertyIsEnumerable;var se=!fe.call("beep","0");function le(t,e){var r;return null!=t&&(!(r=fe.call(t,e))&&se&&Xt(t)?!oe(e=+e)&&Mt(e)&&e>=0&&e<t.length:r)}var ce=4294967295;var he=ne?re:function(t){return null!==t&&"object"==typeof t&&!f(t)&&"number"==typeof t.length&&Pt(t.length)&&t.length>=0&&t.length<=ce&&e(t,"callee")&&!le(t,"callee")},pe=Array.prototype.slice;var ge=le((function(){}),"prototype"),ye=!le({toString:null},"toString"),me=9007199254740991;function de(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&Pt(t.length)&&t.length>=0&&t.length<=me}function ve(t,e,r){var n,i;if(!de(t)&&!$t(t))throw new TypeError(N("invalid argument. First argument must be an array-like object. Value: `%s`.",t));if(0===(n=t.length))return-1;if(3===arguments.length){if(!Mt(r))throw new TypeError(N("invalid argument. Third argument must be an integer. Value: `%s`.",r));if(r>=0){if(r>=n)return-1;i=r}else(i=n+r)<0&&(i=0)}else i=0;if(ue(e)){for(;i<n;i++)if(ue(t[i]))return i}else for(;i<n;i++)if(t[i]===e)return i;return-1}function be(t){return t.constructor&&t.constructor.prototype===t}var we=["console","external","frame","frameElement","frames","innerHeight","innerWidth","outerHeight","outerWidth","pageXOffset","pageYOffset","parent","scrollLeft","scrollTop","scrollX","scrollY","self","webkitIndexedDB","webkitStorageInfo","window"],_e="undefined"==typeof window?void 0:window;var Ee=function(){var t;if("undefined"===dt(_e))return!1;for(t in _e)try{-1===ve(we,t)&&e(_e,t)&&null!==_e[t]&&"object"===dt(_e[t])&&be(_e[t])}catch(t){return!0}return!1}(),xe="undefined"!=typeof window;var Te,Ae=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];Te=ee?function(){return 2!==(te(arguments)||"").length}(1,2)?function(t){return he(t)?te(pe.call(t)):te(t)}:te:function(t){var r,n,i,o,a,u,f;if(o=[],he(t)){for(f=0;f<t.length;f++)o.push(f.toString());return o}if("string"==typeof t){if(t.length>0&&!e(t,"0"))for(f=0;f<t.length;f++)o.push(f.toString())}else{if(!1==(i="function"==typeof t)&&!gt(t))return o;n=ge&&i}for(a in t)n&&"prototype"===a||!e(t,a)||o.push(String(a));if(ye)for(r=function(t){if(!1===xe&&!Ee)return be(t);try{return be(t)}catch(t){return!1}}(t),f=0;f<Ae.length;f++)u=Ae[f],r&&"constructor"===u||!e(t,u)||o.push(String(u));return o};var Oe=Te;var Ve=function(t,r){var n,i,o,a,u,s,l,c=!0;if(!gt(t))throw new TypeError(N("invalid argument. First argument must be an object (except null). Value: `%s`.",t));if(arguments.length>1){if(!At(r))throw new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e(r,"duplicates")&&!X(c=r.duplicates))throw new TypeError(N("invalid option. `%s` option must be a boolean. Option: `%s`.","duplicates",c))}if(i=(n=Oe(t)).length,u={},c)for(l=0;l<i;l++)e(u,a=t[o=n[l]])?(s=u[a],f(s)?u[a].push(o):u[a]=[s,o]):u[a]=o;else for(l=0;l<i;l++)u[t[o=n[l]]]=o;return u}({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 Se(t){var e=Ve[t];return $t(e)?e:null}var je={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 Re(t){var e;return $t(t)?je[t]||null:Ot(t)?je[Se(t)]||null:t&&Kt(e=t.byteLength)?e:null}function Le(t){var e,r;for(e=0,r=0;r<t.length;r++)t[r]<0&&(e+=1);return 0===e?1:e===t.length?-1:0}function Ie(t){return Math.abs(t)}function Be(t){var e,r,n,i,o,a;if(0===(r=t.length))return 0;for(e=!0,n=!0,i=Ie(t[0]),a=1;a<r;a++){if(o=Ie(t[a]),e&&o<i?e=!1:n&&o>i&&(n=!1),!n&&!e)return 0;i=o}return n&&e?3:n?1:2}var Fe="function";function Pe(t){return typeof t.get===Fe&&typeof t.set===Fe}var Ue={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 Me(t){var e=Ue[t];return"function"==typeof e?e:Ue.default}var ke={float64:function(t,e,r){t[e]=r},float32:function(t,e,r){t[e]=r},int32:function(t,e,r){t[e]=r},int16:function(t,e,r){t[e]=r},int8:function(t,e,r){t[e]=r},uint32:function(t,e,r){t[e]=r},uint16:function(t,e,r){t[e]=r},uint8:function(t,e,r){t[e]=r},uint8c:function(t,e,r){t[e]=r},generic:function(t,e,r){t[e]=r},default:function(t,e,r){t[e]=r}};function Ce(t){var e=ke[t];return"function"==typeof e?e:ke.default}var Ne={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 Ye(t){var e=Ne[t];return"function"==typeof e?e:Ne.default}var De={complex128:function(t,e,r){t.set(r,e)},complex64:function(t,e,r){t.set(r,e)},default:function(t,e,r){t.set(r,e)}};function ze(t){var e=De[t];return"function"==typeof e?e:De.default}var Je={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"},We="function"==typeof Float64Array;var $e="function"==typeof Float64Array?Float64Array:null;function Ge(){var t,e,r;if("function"!=typeof $e)return!1;try{e=new $e([1,3.14,-3.14,NaN]),r=e,t=(We&&r instanceof Float64Array||"[object Float64Array]"===u(r))&&1===e[0]&&3.14===e[1]&&-3.14===e[2]&&e[3]!=e[3]}catch(e){t=!1}return t}var Ze="function"==typeof Float64Array?Float64Array:void 0;var qe=Ge()?Ze:function(){throw new Error("not implemented")},Xe="function"==typeof Float32Array;var Ke="function"==typeof Float32Array?Float32Array:null;var He,Qe="function"==typeof Float32Array?Float32Array:void 0;He=function(){var t,e,r;if("function"!=typeof Ke)return!1;try{e=new Ke([1,3.14,-3.14,5e40]),r=e,t=(Xe&&r instanceof Float32Array||"[object Float32Array]"===u(r))&&1===e[0]&&3.140000104904175===e[1]&&-3.140000104904175===e[2]&&e[3]===It}catch(e){t=!1}return t}()?Qe:function(){throw new Error("not implemented")};var tr=He,er="function"==typeof Uint32Array;var rr="function"==typeof Uint32Array?Uint32Array:null;var nr,ir="function"==typeof Uint32Array?Uint32Array:void 0;nr=function(){var t,e,r;if("function"!=typeof rr)return!1;try{e=new rr(e=[1,3.14,-3.14,ce+1,ce+2]),r=e,t=(er&&r instanceof Uint32Array||"[object Uint32Array]"===u(r))&&1===e[0]&&3===e[1]&&e[2]===ce-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}()?ir:function(){throw new Error("not implemented")};var or=nr,ar="function"==typeof Int32Array;var ur=2147483647,fr=-2147483648,sr="function"==typeof Int32Array?Int32Array:null;var lr,cr="function"==typeof Int32Array?Int32Array:void 0;lr=function(){var t,e,r;if("function"!=typeof sr)return!1;try{e=new sr([1,3.14,-3.14,ur+1]),r=e,t=(ar&&r instanceof Int32Array||"[object Int32Array]"===u(r))&&1===e[0]&&3===e[1]&&-3===e[2]&&e[3]===fr}catch(e){t=!1}return t}()?cr:function(){throw new Error("not implemented")};var hr=lr,pr="function"==typeof Uint16Array;var gr=65535,yr="function"==typeof Uint16Array?Uint16Array:null;var mr,dr="function"==typeof Uint16Array?Uint16Array:void 0;mr=function(){var t,e,r;if("function"!=typeof yr)return!1;try{e=new yr(e=[1,3.14,-3.14,gr+1,gr+2]),r=e,t=(pr&&r instanceof Uint16Array||"[object Uint16Array]"===u(r))&&1===e[0]&&3===e[1]&&e[2]===gr-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}()?dr:function(){throw new Error("not implemented")};var vr=mr,br="function"==typeof Int16Array;var wr=32767,_r=-32768,Er="function"==typeof Int16Array?Int16Array:null;var xr,Tr="function"==typeof Int16Array?Int16Array:void 0;xr=function(){var t,e,r;if("function"!=typeof Er)return!1;try{e=new Er([1,3.14,-3.14,wr+1]),r=e,t=(br&&r instanceof Int16Array||"[object Int16Array]"===u(r))&&1===e[0]&&3===e[1]&&-3===e[2]&&e[3]===_r}catch(e){t=!1}return t}()?Tr:function(){throw new Error("not implemented")};var Ar=xr,Or="function"==typeof Uint8Array;var Vr=255,Sr="function"==typeof Uint8Array?Uint8Array:null;var jr,Rr="function"==typeof Uint8Array?Uint8Array:void 0;jr=function(){var t,e,r;if("function"!=typeof Sr)return!1;try{e=new Sr(e=[1,3.14,-3.14,Vr+1,Vr+2]),r=e,t=(Or&&r instanceof Uint8Array||"[object Uint8Array]"===u(r))&&1===e[0]&&3===e[1]&&e[2]===Vr-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}()?Rr:function(){throw new Error("not implemented")};var Lr=jr,Ir="function"==typeof Uint8ClampedArray;var Br="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null;var Fr,Pr="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0;Fr=function(){var t,e,r;if("function"!=typeof Br)return!1;try{e=new Br([-1,0,1,3.14,4.99,255,256]),r=e,t=(Ir&&r instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===u(r))&&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}()?Pr:function(){throw new Error("not implemented")};var Ur=Fr,Mr="function"==typeof Int8Array;var kr=127,Cr=-128,Nr="function"==typeof Int8Array?Int8Array:null;var Yr,Dr="function"==typeof Int8Array?Int8Array:void 0;Yr=function(){var t,e,r;if("function"!=typeof Nr)return!1;try{e=new Nr([1,3.14,-3.14,kr+1]),r=e,t=(Mr&&r instanceof Int8Array||"[object Int8Array]"===u(r))&&1===e[0]&&3===e[1]&&-3===e[2]&&e[3]===Cr}catch(e){t=!1}return t}()?Dr:function(){throw new Error("not implemented")};var zr=Yr,Jr=4294967295;function Wr(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&Pt(t.length)&&t.length>=0&&t.length<=Jr}var $r="function"==typeof ArrayBuffer;function Gr(t){return $r&&t instanceof ArrayBuffer||"[object ArrayBuffer]"===u(t)}var Zr=pt(Xt.isPrimitive),qr=pt(Xt.isObject),Xr=pt(Xt);function Kr(t,e,r){Z(t,e,{configurable:!1,enumerable:!0,writable:!1,value:r})}function Hr(t,e){if(!(this instanceof Hr))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Ot(t))throw new TypeError(N("invalid argument. Real component must be a number. Value: `%s`.",t));if(!Ot(e))throw new TypeError(N("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return Kr(this,"re",t),Kr(this,"im",e),this}q(Xr,"primitives",Zr),q(Xr,"objects",qr),q(Hr,"name","Complex128"),q(Hr,"BYTES_PER_ELEMENT",8),q(Hr.prototype,"BYTES_PER_ELEMENT",8),q(Hr.prototype,"byteLength",16),q(Hr.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),q(Hr.prototype,"toJSON",(function(){var t={type:"Complex128"};return t.re=this.re,t.im=this.im,t}));var Qr="function"==typeof Math.fround?Math.fround:null,tn=new tr(1);var en="function"==typeof Qr?Qr:function(t){return tn[0]=t,tn[0]};function rn(t,e){if(!(this instanceof rn))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Ot(t))throw new TypeError(N("invalid argument. Real component must be a number. Value: `%s`.",t));if(!Ot(e))throw new TypeError(N("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return Kr(this,"re",en(t)),Kr(this,"im",en(e)),this}function nn(t){return t instanceof Hr||t instanceof rn||"object"==typeof t&&null!==t&&"number"==typeof t.re&&"number"==typeof t.im}function on(t){return Pt(t/2)}q(rn,"name","Complex64"),q(rn,"BYTES_PER_ELEMENT",4),q(rn.prototype,"BYTES_PER_ELEMENT",4),q(rn.prototype,"byteLength",8),q(rn.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),q(rn.prototype,"toJSON",(function(){var t={type:"Complex64"};return t.re=this.re,t.im=this.im,t}));var an=8;function un(t){return"object"==typeof t&&null!==t&&"Complex64Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===an}var fn=16;function sn(t){return"object"==typeof t&&null!==t&&"Complex128Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===fn}function ln(){return"function"==typeof o&&"symbol"==typeof o("foo")&&e(o,"iterator")&&"symbol"==typeof o.iterator}var cn=ln()?Symbol.iterator:null;function hn(t){return t.re}function pn(t){return t.im}function gn(t,e){return new tr(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*e,2*(t.length-e))}function yn(t,e){return new qe(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*e,2*(t.length-e))}function mn(t){var e,r,n;for(e=[];!(r=t.next()).done;)if(Wr(n=r.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!nn(n))return new TypeError(N("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(hn(n),pn(n))}return e}var dn=2*tr.BYTES_PER_ELEMENT,vn=ln();function bn(t){return t instanceof En||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function wn(t){return t===En||"Complex128Array"===t.name}function _n(t,e){return new rn(t[e*=2],t[e+1])}function En(){var t,e,r,n;if(e=arguments.length,!(this instanceof En))return 0===e?new En:1===e?new En(arguments[0]):2===e?new En(arguments[0],arguments[1]):new En(arguments[0],arguments[1],arguments[2]);if(0===e)r=new tr(0);else if(1===e)if(Nt(arguments[0]))r=new tr(2*arguments[0]);else if(de(arguments[0]))if((n=(r=arguments[0]).length)&&f(r)&&nn(r[0])){if(r=function(t,e){var r,n,i,o;for(r=e.length,o=0,i=0;i<r;i++){if(!nn(n=e[i]))return null;t[o]=hn(n),t[o+1]=pn(n),o+=2}return t}(new tr(2*n),r),null===r){if(!on(n))throw new RangeError(N("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));r=new tr(arguments[0])}}else{if(un(r))r=gn(r,0);else if(sn(r))r=yn(r,0);else if(!on(n))throw new RangeError(N("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));r=new tr(r)}else if(Gr(arguments[0])){if(!Pt((r=arguments[0]).byteLength/dn))throw new RangeError(N("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",dn,r.byteLength));r=new tr(r)}else{if(!s(arguments[0]))throw new TypeError(N("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));if(r=arguments[0],!1===vn)throw new TypeError(N("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",r));if(!vt(r[cn]))throw new TypeError(N("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",r));if(!vt((r=r[cn]()).next))throw new TypeError(N("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",r));if((r=mn(r))instanceof Error)throw r;r=new tr(r)}else{if(!Gr(r=arguments[0]))throw new TypeError(N("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",r));if(!Nt(t=arguments[1]))throw new TypeError(N("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",t));if(!Pt(t/dn))throw new RangeError(N("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",dn,t));if(2===e){if(!Pt((n=r.byteLength-t)/dn))throw new RangeError(N("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",dn,n));r=new tr(r,t)}else{if(!Nt(n=arguments[2]))throw new TypeError(N("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*dn>r.byteLength-t)throw new RangeError(N("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*dn));r=new tr(r,t,2*n)}}return q(this,"_buffer",r),q(this,"_length",r.length/2),this}function xn(t){return t.re}function Tn(t){return t.im}function An(t){var e,r,n;for(e=[];!(r=t.next()).done;)if(Wr(n=r.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!nn(n))return new TypeError(N("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(xn(n),Tn(n))}return e}q(En,"BYTES_PER_ELEMENT",dn),q(En,"name","Complex64Array"),q(En,"from",(function(t){var e,r,n,i,o,a,u,f,l,c,h,p;if(!vt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!wn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((r=arguments.length)>1){if(!vt(n=arguments[1]))throw new TypeError(N("invalid argument. Second argument must be a function. Value: `%s`.",n));r>2&&(e=arguments[2])}if(bn(t)){if(f=t.length,n){for(o=(i=new this(f))._buffer,p=0,h=0;h<f;h++){if(nn(c=n.call(e,t.get(h),h)))o[p]=hn(c),o[p+1]=pn(c);else{if(!(Wr(c)&&c.length>=2))throw new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));o[p]=c[0],o[p+1]=c[1]}p+=2}return i}return new this(t)}if(de(t)){if(n){for(f=t.length,u=t.get&&t.set?Ye("default"):Me("default"),h=0;h<f;h++)if(!nn(u(t,h))){l=!0;break}if(l){if(!on(f))throw new RangeError(N("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,f));for(o=(i=new this(f/2))._buffer,h=0;h<f;h++)o[h]=n.call(e,u(t,h),h);return i}for(o=(i=new this(f))._buffer,p=0,h=0;h<f;h++){if(nn(c=n.call(e,u(t,h),h)))o[p]=hn(c),o[p+1]=pn(c);else{if(!(Wr(c)&&c.length>=2))throw new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));o[p]=c[0],o[p+1]=c[1]}p+=2}return i}return new this(t)}if(s(t)&&vn&&vt(t[cn])){if(!vt((o=t[cn]()).next))throw new TypeError(N("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=n?function(t,e,r){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,Wr(o=e.call(r,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!nn(o))return new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(hn(o),pn(o))}return n}(o,n,e):mn(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h<f;h++)o[h]=a[h];return i}throw new TypeError(N("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t))})),q(En,"of",(function(){var t,e;if(!vt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!wn(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)})),q(En.prototype,"at",(function(t){if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pt(t))throw new TypeError(N("invalid argument. Must provide an integer. Value: `%s`.",t));if(t<0&&(t+=this._length),!(t<0||t>=this._length))return _n(this._buffer,t)})),Wt(En.prototype,"buffer",(function(){return this._buffer.buffer})),Wt(En.prototype,"byteLength",(function(){return this._buffer.byteLength})),Wt(En.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),q(En.prototype,"BYTES_PER_ELEMENT",En.BYTES_PER_ELEMENT),q(En.prototype,"copyWithin",(function(t,e){if(!bn(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})),q(En.prototype,"entries",(function(){var t,e,r,n,i,o;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,n=this._buffer,r=this._length,o=-1,q(e={},"next",(function(){if(o+=1,i||o>=r)return{done:!0};return{value:[o,_n(n,o)],done:!1}})),q(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),cn&&q(e,cn,(function(){return t.entries()})),e})),q(En.prototype,"every",(function(t,e){var r,n;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n<this._length;n++)if(!t.call(e,_n(r,n),n,this))return!1;return!0})),q(En.prototype,"fill",(function(t,e,r){var n,i,o,a,u,f;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!nn(t))throw new TypeError(N("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(n=this._buffer,i=this._length,arguments.length>1){if(!Pt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!Pt(r))throw new TypeError(N("invalid argument. Third argument must be an integer. Value: `%s`.",r));r<0&&(r+=i)<0&&(r=0),r>i&&(r=i)}else r=i}else e=0,r=i;for(a=hn(t),u=pn(t),f=e;f<r;f++)n[o=2*f]=a,n[o+1]=u;return this})),q(En.prototype,"filter",(function(t,e){var r,n,i,o;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=[],i=0;i<this._length;i++)o=_n(r,i),t.call(e,o,i,this)&&n.push(o);return new this.constructor(n)})),q(En.prototype,"find",(function(t,e){var r,n,i;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n<this._length;n++)if(i=_n(r,n),t.call(e,i,n,this))return i})),q(En.prototype,"findIndex",(function(t,e){var r,n,i;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n<this._length;n++)if(i=_n(r,n),t.call(e,i,n,this))return n;return-1})),q(En.prototype,"findLast",(function(t,e){var r,n,i;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=this._length-1;n>=0;n--)if(i=_n(r,n),t.call(e,i,n,this))return i})),q(En.prototype,"findLastIndex",(function(t,e){var r,n,i;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=this._length-1;n>=0;n--)if(i=_n(r,n),t.call(e,i,n,this))return n;return-1})),q(En.prototype,"forEach",(function(t,e){var r,n,i;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n<this._length;n++)i=_n(r,n),t.call(e,i,n,this)})),q(En.prototype,"get",(function(t){if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(N("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return _n(this._buffer,t)})),q(En.prototype,"includes",(function(t,e){var r,n,i,o,a;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!nn(t))throw new TypeError(N("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Pt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=hn(t),o=pn(t),r=this._buffer,a=e;a<this._length;a++)if(i===r[n=2*a]&&o===r[n+1])return!0;return!1})),q(En.prototype,"indexOf",(function(t,e){var r,n,i,o,a;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!nn(t))throw new TypeError(N("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Pt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=hn(t),o=pn(t),r=this._buffer,a=e;a<this._length;a++)if(i===r[n=2*a]&&o===r[n+1])return a;return-1})),q(En.prototype,"join",(function(t){var e,r,n,i;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!$t(t))throw new TypeError(N("invalid argument. First argument must be a string. Value: `%s`.",t));n=t}for(e=[],r=this._buffer,i=0;i<this._length;i++)e.push(_n(r,i).toString());return e.join(n)})),q(En.prototype,"keys",(function(){var t,e,r,n,i;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,r=this._length,i=-1,q(e={},"next",(function(){if(i+=1,n||i>=r)return{done:!0};return{value:i,done:!1}})),q(e,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),cn&&q(e,cn,(function(){return t.keys()})),e})),q(En.prototype,"lastIndexOf",(function(t,e){var r,n,i,o,a;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!nn(t))throw new TypeError(N("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Pt(e))throw new TypeError(N("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=hn(t),o=pn(t),r=this._buffer,a=e;a>=0;a--)if(i===r[n=2*a]&&o===r[n+1])return a;return-1})),Wt(En.prototype,"length",(function(){return this._length})),q(En.prototype,"map",(function(t,e){var r,n,i,o,a;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(nn(a=t.call(e,_n(n,o),o,this)))r[2*o]=hn(a),r[2*o+1]=pn(a);else{if(!Wr(a)||2!==a.length)throw new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));r[2*o]=a[0],r[2*o+1]=a[1]}return i})),q(En.prototype,"reduce",(function(t,e){var r,n,i,o;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));if(r=this._buffer,i=this._length,arguments.length>1)n=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=_n(r,0),o=1}for(;o<i;o++)n=t(n,_n(r,o),o,this);return n})),q(En.prototype,"reduceRight",(function(t,e){var r,n,i,o;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));if(r=this._buffer,i=this._length,arguments.length>1)n=e,o=i-1;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=_n(r,i-1),o=i-2}for(;o>=0;o--)n=t(n,_n(r,o),o,this);return n})),q(En.prototype,"reverse",(function(){var t,e,r,n,i,o;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=this._length,t=this._buffer,n=Ft(r/2),i=0;i<n;i++)o=r-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})),q(En.prototype,"set",(function(t){var e,r,n,i,o,a,u,f,s;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!Nt(r=arguments[1]))throw new TypeError(N("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",r))}else r=0;if(nn(t)){if(r>=this._length)throw new RangeError(N("invalid argument. Index argument is out-of-bounds. Value: `%u`.",r));return n[r*=2]=hn(t),void(n[r+1]=pn(t))}if(bn(t)){if(r+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t._buffer,s=n.byteOffset+r*dn,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new tr(e.length),f=0;f<e.length;f++)i[f]=e[f];e=i}for(r*=2,s=0,f=0;f<a;f++)n[r]=e[s],n[r+1]=e[s+1],r+=2,s+=2}else{if(!de(t))throw new TypeError(N("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(!nn(t[f])){o=!0;break}if(o){if(!on(a))throw new RangeError(N("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",a));if(r+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t,s=n.byteOffset+r*dn,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new tr(a),f=0;f<a;f++)i[f]=e[f];e=i}for(r*=2,a/=2,s=0,f=0;f<a;f++)n[r]=e[s],n[r+1]=e[s+1],r+=2,s+=2;return}if(r+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(r*=2,f=0;f<a;f++)u=t[f],n[r]=hn(u),n[r+1]=pn(u),r+=2}})),q(En.prototype,"slice",(function(t,e){var r,n,i,o,a,u,f;if(!bn(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(!Pt(t))throw new TypeError(N("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(!Pt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=u)<0&&(e=0):e>u&&(e=u)}}for(r=t<e?e-t:0,n=(i=new this.constructor(r))._buffer,f=0;f<r;f++)o=2*(f+t),n[2*f]=a[o],n[2*f+1]=a[o+1];return i})),q(En.prototype,"some",(function(t,e){var r,n;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n<this._length;n++)if(t.call(e,_n(r,n),n,this))return!0;return!1})),q(En.prototype,"sort",(function(t){var e,r,n,i,o;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=this._length,e=[],i=0;i<n;i++)e.push(_n(r,i));for(e.sort(t),i=0;i<n;i++)r[o=2*i]=hn(e[i]),r[o+1]=pn(e[i]);return this})),q(En.prototype,"subarray",(function(t,e){var r,n,i;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)t=0,e=i;else{if(!Pt(t))throw new TypeError(N("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(!Pt(e))throw new TypeError(N("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,r=n.byteLength):t>=e?(i=0,r=n.byteOffset+t*dn):(i=e-t,r=n.byteOffset+t*dn),new this.constructor(n.buffer,r,i<0?0:i)})),q(En.prototype,"toLocaleString",(function(t,e){var r,n,i,o,a;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!$t(t)&&!Zr(t))throw new TypeError(N("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));n=t}if(arguments.length<2)r={};else{if(!s(e))throw new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",e));r=e}for(o=this._buffer,i=[],a=0;a<this._length;a++)i.push(_n(o,a).toLocaleString(n,r));return i.join(",")})),q(En.prototype,"toReversed",(function(){var t,e,r,n,i,o;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=this._length,e=new this.constructor(r),n=this._buffer,t=e._buffer,i=0;i<r;i++)o=r-i-1,t[2*i]=n[2*o],t[2*i+1]=n[2*o+1];return e})),q(En.prototype,"toSorted",(function(t){var e,r,n,i;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=this._length,e=[],i=0;i<n;i++)e.push(_n(r,i));return e.sort(t),new En(e)})),q(En.prototype,"toString",(function(){var t,e,r;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],e=this._buffer,r=0;r<this._length;r++)t.push(_n(e,r).toString());return t.join(",")})),q(En.prototype,"values",(function(){var t,e,r,n,i,o;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,i=this._buffer,r=this._length,o=-1,q(t={},"next",(function(){if(o+=1,n||o>=r)return{done:!0};return{value:_n(i,o),done:!1}})),q(t,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),cn&&q(t,cn,(function(){return e.values()})),t})),q(En.prototype,"with",(function(t,e){var r,n,i;if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pt(t))throw new TypeError(N("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(N("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!nn(e))throw new TypeError(N("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(r=(n=new this.constructor(this._buffer))._buffer)[2*t]=hn(e),r[2*t+1]=pn(e),n}));var On=2*qe.BYTES_PER_ELEMENT,Vn=ln();function Sn(t){return t instanceof Ln||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function jn(t){return t===Ln||"Complex64Array"===t.name}function Rn(t,e){return new Hr(t[e*=2],t[e+1])}function Ln(){var t,e,r,n;if(e=arguments.length,!(this instanceof Ln))return 0===e?new Ln:1===e?new Ln(arguments[0]):2===e?new Ln(arguments[0],arguments[1]):new Ln(arguments[0],arguments[1],arguments[2]);if(0===e)r=new qe(0);else if(1===e)if(Nt(arguments[0]))r=new qe(2*arguments[0]);else if(de(arguments[0]))if((n=(r=arguments[0]).length)&&f(r)&&nn(r[0])){if(r=function(t,e){var r,n,i,o;for(r=e.length,o=0,i=0;i<r;i++){if(!nn(n=e[i]))return null;t[o]=xn(n),t[o+1]=Tn(n),o+=2}return t}(new qe(2*n),r),null===r){if(!on(n))throw new RangeError(N("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));r=new qe(arguments[0])}}else{if(un(r))r=gn(r,0);else if(sn(r))r=yn(r,0);else if(!on(n))throw new RangeError(N("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));r=new qe(r)}else if(Gr(arguments[0])){if(!Pt((r=arguments[0]).byteLength/On))throw new RangeError(N("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",On,r.byteLength));r=new qe(r)}else{if(!s(arguments[0]))throw new TypeError(N("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));if(r=arguments[0],!1===Vn)throw new TypeError(N("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",r));if(!vt(r[cn]))throw new TypeError(N("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",r));if(!vt((r=r[cn]()).next))throw new TypeError(N("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",r));if((r=An(r))instanceof Error)throw r;r=new qe(r)}else{if(!Gr(r=arguments[0]))throw new TypeError(N("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",r));if(!Nt(t=arguments[1]))throw new TypeError(N("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",t));if(!Pt(t/On))throw new RangeError(N("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",On,t));if(2===e){if(!Pt((n=r.byteLength-t)/On))throw new RangeError(N("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",On,n));r=new qe(r,t)}else{if(!Nt(n=arguments[2]))throw new TypeError(N("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*On>r.byteLength-t)throw new RangeError(N("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*On));r=new qe(r,t,2*n)}}return q(this,"_buffer",r),q(this,"_length",r.length/2),this}function In(t){var e,r;for(e=[];!(r=t.next()).done;)e.push(K(r.value));return e}q(Ln,"BYTES_PER_ELEMENT",On),q(Ln,"name","Complex128Array"),q(Ln,"from",(function(t){var e,r,n,i,o,a,u,f,l,c,h,p;if(!vt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!jn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((r=arguments.length)>1){if(!vt(n=arguments[1]))throw new TypeError(N("invalid argument. Second argument must be a function. Value: `%s`.",n));r>2&&(e=arguments[2])}if(Sn(t)){if(f=t.length,n){for(o=(i=new this(f))._buffer,p=0,h=0;h<f;h++){if(nn(c=n.call(e,t.get(h),h)))o[p]=xn(c),o[p+1]=Tn(c);else{if(!(Wr(c)&&c.length>=2))throw new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));o[p]=c[0],o[p+1]=c[1]}p+=2}return i}return new this(t)}if(de(t)){if(n){for(f=t.length,u=t.get&&t.set?Ye("default"):Me("default"),h=0;h<f;h++)if(!nn(u(t,h))){l=!0;break}if(l){if(!on(f))throw new RangeError(N("invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.",f));for(o=(i=new this(f/2))._buffer,h=0;h<f;h++)o[h]=n.call(e,u(t,h),h);return i}for(o=(i=new this(f))._buffer,p=0,h=0;h<f;h++){if(nn(c=n.call(e,u(t,h),h)))o[p]=xn(c),o[p+1]=Tn(c);else{if(!(Wr(c)&&c.length>=2))throw new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));o[p]=c[0],o[p+1]=c[1]}p+=2}return i}return new this(t)}if(s(t)&&Vn&&vt(t[cn])){if(!vt((o=t[cn]()).next))throw new TypeError(N("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=n?function(t,e,r){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,Wr(o=e.call(r,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!nn(o))return new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(xn(o),Tn(o))}return n}(o,n,e):An(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h<f;h++)o[h]=a[h];return i}throw new TypeError(N("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t))})),q(Ln,"of",(function(){var t,e;if(!vt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!jn(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)})),q(Ln.prototype,"at",(function(t){if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pt(t))throw new TypeError(N("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)})),Wt(Ln.prototype,"buffer",(function(){return this._buffer.buffer})),Wt(Ln.prototype,"byteLength",(function(){return this._buffer.byteLength})),Wt(Ln.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),q(Ln.prototype,"BYTES_PER_ELEMENT",Ln.BYTES_PER_ELEMENT),q(Ln.prototype,"copyWithin",(function(t,e){if(!Sn(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})),q(Ln.prototype,"entries",(function(){var t,e,r,n,i,o,a;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,t=this._buffer,n=this._length,o=-1,a=-2,q(r={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new Hr(t[a+=2],t[a+1]),{value:[o,e],done:!1}})),q(r,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),cn&&q(r,cn,(function(){return e.entries()})),r})),q(Ln.prototype,"every",(function(t,e){var r,n;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n<this._length;n++)if(!t.call(e,Rn(r,n),n,this))return!1;return!0})),q(Ln.prototype,"fill",(function(t,e,r){var n,i,o,a,u,f;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!nn(t))throw new TypeError(N("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(n=this._buffer,i=this._length,arguments.length>1){if(!Pt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!Pt(r))throw new TypeError(N("invalid argument. Third argument must be an integer. Value: `%s`.",r));r<0&&(r+=i)<0&&(r=0),r>i&&(r=i)}else r=i}else e=0,r=i;for(a=xn(t),u=Tn(t),f=e;f<r;f++)n[o=2*f]=a,n[o+1]=u;return this})),q(Ln.prototype,"filter",(function(t,e){var r,n,i,o;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=[],i=0;i<this._length;i++)o=Rn(r,i),t.call(e,o,i,this)&&n.push(o);return new this.constructor(n)})),q(Ln.prototype,"find",(function(t,e){var r,n,i;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n<this._length;n++)if(i=Rn(r,n),t.call(e,i,n,this))return i})),q(Ln.prototype,"findIndex",(function(t,e){var r,n,i;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n<this._length;n++)if(i=Rn(r,n),t.call(e,i,n,this))return n;return-1})),q(Ln.prototype,"findLast",(function(t,e){var r,n,i;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=this._length-1;n>=0;n--)if(i=Rn(r,n),t.call(e,i,n,this))return i})),q(Ln.prototype,"findLastIndex",(function(t,e){var r,n,i;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=this._length-1;n>=0;n--)if(i=Rn(r,n),t.call(e,i,n,this))return n;return-1})),q(Ln.prototype,"forEach",(function(t,e){var r,n,i;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n<this._length;n++)i=Rn(r,n),t.call(e,i,n,this)})),q(Ln.prototype,"get",(function(t){if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Nt(t))throw new TypeError(N("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return Rn(this._buffer,t)})),Wt(Ln.prototype,"length",(function(){return this._length})),q(Ln.prototype,"includes",(function(t,e){var r,n,i,o,a;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!nn(t))throw new TypeError(N("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Pt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=xn(t),o=Tn(t),r=this._buffer,a=e;a<this._length;a++)if(i===r[n=2*a]&&o===r[n+1])return!0;return!1})),q(Ln.prototype,"indexOf",(function(t,e){var r,n,i,o,a;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!nn(t))throw new TypeError(N("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Pt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=xn(t),o=Tn(t),r=this._buffer,a=e;a<this._length;a++)if(i===r[n=2*a]&&o===r[n+1])return a;return-1})),q(Ln.prototype,"join",(function(t){var e,r,n,i;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!Xt(t))throw new TypeError(N("invalid argument. First argument must be a string. Value: `%s`.",t));n=t}for(e=[],r=this._buffer,i=0;i<this._length;i++)e.push(Rn(r,i).toString());return e.join(n)})),q(Ln.prototype,"keys",(function(){var t,e,r,n,i;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,r=this._length,i=-1,q(e={},"next",(function(){if(i+=1,n||i>=r)return{done:!0};return{value:i,done:!1}})),q(e,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),cn&&q(e,cn,(function(){return t.keys()})),e})),q(Ln.prototype,"lastIndexOf",(function(t,e){var r,n,i,o,a;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!nn(t))throw new TypeError(N("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Pt(e))throw new TypeError(N("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=xn(t),o=Tn(t),r=this._buffer,a=e;a>=0;a--)if(i===r[n=2*a]&&o===r[n+1])return a;return-1})),q(Ln.prototype,"map",(function(t,e){var r,n,i,o,a;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(nn(a=t.call(e,Rn(n,o),o,this)))r[2*o]=xn(a),r[2*o+1]=Tn(a);else{if(!Wr(a)||2!==a.length)throw new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));r[2*o]=a[0],r[2*o+1]=a[1]}return i})),q(Ln.prototype,"reduce",(function(t,e){var r,n,i,o;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));if(r=this._buffer,i=this._length,arguments.length>1)n=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Rn(r,0),o=1}for(;o<i;o++)n=t(n,Rn(r,o),o,this);return n})),q(Ln.prototype,"reduceRight",(function(t,e){var r,n,i,o;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));if(r=this._buffer,i=this._length,arguments.length>1)n=e,o=i-1;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Rn(r,i-1),o=i-2}for(;o>=0;o--)n=t(n,Rn(r,o),o,this);return n})),q(Ln.prototype,"reverse",(function(){var t,e,r,n,i,o;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=this._length,t=this._buffer,n=Ft(r/2),i=0;i<n;i++)o=r-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})),q(Ln.prototype,"set",(function(t){var e,r,n,i,o,a,u,f,s;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!Nt(r=arguments[1]))throw new TypeError(N("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",r))}else r=0;if(nn(t)){if(r>=this._length)throw new RangeError(N("invalid argument. Index argument is out-of-bounds. Value: `%u`.",r));return n[r*=2]=xn(t),void(n[r+1]=Tn(t))}if(Sn(t)){if(r+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t._buffer,s=n.byteOffset+r*On,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new qe(e.length),f=0;f<e.length;f++)i[f]=e[f];e=i}for(r*=2,s=0,f=0;f<a;f++)n[r]=e[s],n[r+1]=e[s+1],r+=2,s+=2}else{if(!de(t))throw new TypeError(N("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(!nn(t[f])){o=!0;break}if(o){if(!on(a))throw new RangeError(N("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",a));if(r+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t,s=n.byteOffset+r*On,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new qe(a),f=0;f<a;f++)i[f]=e[f];e=i}for(r*=2,a/=2,s=0,f=0;f<a;f++)n[r]=e[s],n[r+1]=e[s+1],r+=2,s+=2;return}if(r+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(r*=2,f=0;f<a;f++)u=t[f],n[r]=xn(u),n[r+1]=Tn(u),r+=2}})),q(Ln.prototype,"slice",(function(t,e){var r,n,i,o,a,u,f;if(!Sn(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(!Pt(t))throw new TypeError(N("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(!Pt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=u)<0&&(e=0):e>u&&(e=u)}}for(r=t<e?e-t:0,n=(i=new this.constructor(r))._buffer,f=0;f<r;f++)o=2*(f+t),n[2*f]=a[o],n[2*f+1]=a[o+1];return i})),q(Ln.prototype,"some",(function(t,e){var r,n;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n<this._length;n++)if(t.call(e,Rn(r,n),n,this))return!0;return!1})),q(Ln.prototype,"sort",(function(t){var e,r,n,i,o;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=this._length,e=[],i=0;i<n;i++)e.push(Rn(r,i));for(e.sort(t),i=0;i<n;i++)r[o=2*i]=xn(e[i]),r[o+1]=Tn(e[i]);return this})),q(Ln.prototype,"subarray",(function(t,e){var r,n,i;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)t=0,e=i;else{if(!Pt(t))throw new TypeError(N("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(!Pt(e))throw new TypeError(N("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,r=n.byteLength):t>=e?(i=0,r=n.byteOffset+t*On):(i=e-t,r=n.byteOffset+t*On),new this.constructor(n.buffer,r,i<0?0:i)})),q(Ln.prototype,"toLocaleString",(function(t,e){var r,n,i,o,a;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!Xt(t)&&!Zr(t))throw new TypeError(N("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));n=t}if(arguments.length<2)r={};else{if(!s(e))throw new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",e));r=e}for(o=this._buffer,i=[],a=0;a<this._length;a++)i.push(Rn(o,a).toLocaleString(n,r));return i.join(",")})),q(Ln.prototype,"toReversed",(function(){var t,e,r,n,i,o;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=this._length,e=new this.constructor(r),n=this._buffer,t=e._buffer,i=0;i<r;i++)o=r-i-1,t[2*i]=n[2*o],t[2*i+1]=n[2*o+1];return e})),q(Ln.prototype,"toSorted",(function(t){var e,r,n,i;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=this._length,e=[],i=0;i<n;i++)e.push(Rn(r,i));return e.sort(t),new Ln(e)})),q(Ln.prototype,"toString",(function(){var t,e,r;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=[],e=this._buffer,r=0;r<this._length;r++)t.push(Rn(e,r).toString());return t.join(",")})),q(Ln.prototype,"values",(function(){var t,e,r,n,i,o;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,i=this._buffer,r=this._length,o=-1,q(t={},"next",(function(){if(o+=1,n||o>=r)return{done:!0};return{value:Rn(i,o),done:!1}})),q(t,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),cn&&q(t,cn,(function(){return e.values()})),t})),q(Ln.prototype,"with",(function(t,e){var r,n,i;if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pt(t))throw new TypeError(N("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(N("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!nn(e))throw new TypeError(N("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(r=(n=new this.constructor(this._buffer))._buffer)[2*t]=xn(e),r[2*t+1]=Tn(e),n}));var Bn=Lr.BYTES_PER_ELEMENT,Fn=ln();function Pn(t){return"object"==typeof t&&null!==t&&"BooleanArray"===t.constructor.name&&t.BYTES_PER_ELEMENT===Bn}function Un(t){return t===Mn}function Mn(){var t,e,r,n,i;if(e=arguments.length,!(this instanceof Mn))return 0===e?new Mn:1===e?new Mn(arguments[0]):2===e?new Mn(arguments[0],arguments[1]):new Mn(arguments[0],arguments[1],arguments[2]);if(0===e)r=new Lr(0);else if(1===e)if(Nt(i=arguments[0]))r=new Lr(i);else if(de(i))r=function(t,e){var r,n;for(r=e.length,n=0;n<r;n++)t[n]=K(e[n]);return t}(new Lr(i.length),i);else if(Gr(i))r=new Lr(i);else{if(!s(i))throw new TypeError(N("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(!1===Fn)throw new TypeError(N("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",i));if(!vt(i[cn]))throw new TypeError(N("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(!vt((r=i[cn]()).next))throw new TypeError(N("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));r=new Lr(In(r))}else{if(!Gr(r=arguments[0]))throw new TypeError(N("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",r));if(!Nt(t=arguments[1]))throw new TypeError(N("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",t));if(2===e)r=new Lr(r,t);else{if(!Nt(n=arguments[2]))throw new TypeError(N("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*Bn>r.byteLength-t)throw new RangeError(N("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Bn));r=new Lr(r,t,n)}}return q(this,"_buffer",r),q(this,"_length",r.length),this}q(Mn,"BYTES_PER_ELEMENT",Bn),q(Mn,"name","BooleanArray"),q(Mn,"from",(function(t){var e,r,n,i,o,a,u,f,l;if(!vt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Un(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((r=arguments.length)>1){if(!vt(n=arguments[1]))throw new TypeError(N("invalid argument. Second argument must be a function. Value: `%s`.",n));r>2&&(e=arguments[2])}if(de(t)){if(n){for(f=t.length,u=t.get&&t.set?Ye("default"):Me("default"),o=(i=new this(f))._buffer,l=0;l<f;l++)o[l]=K(n.call(e,u(t,l),l));return i}return new this(t)}if(s(t)&&Fn&&vt(t[cn])){if(!vt((o=t[cn]()).next))throw new TypeError(N("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));for(a=n?function(t,e,r){var n,i,o;for(n=[],o=-1;!(i=t.next()).done;)o+=1,n.push(K(e.call(r,i.value,o)));return n}(o,n,e):In(o),o=(i=new this(f=a.length))._buffer,l=0;l<f;l++)o[l]=a[l];return i}throw new TypeError(N("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t))})),q(Mn,"of",(function(){var t,e;if(!vt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Un(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)})),q(Mn.prototype,"at",(function(t){var e,r;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Mt(t))throw new TypeError(N("invalid argument. Must provide an integer. Value: `%s`.",t));if(r=this._length,e=this._buffer,t<0&&(t+=r),!(t<0||t>=r))return K(e[t])})),Wt(Mn.prototype,"buffer",(function(){return this._buffer.buffer})),Wt(Mn.prototype,"byteLength",(function(){return this._buffer.byteLength})),Wt(Mn.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),q(Mn.prototype,"BYTES_PER_ELEMENT",Mn.BYTES_PER_ELEMENT),q(Mn.prototype,"copyWithin",(function(t,e){if(!Pn(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})),q(Mn.prototype,"entries",(function(){var t,e,r,n,i,o;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return t=this,n=this._buffer,r=this._length,o=-1,q(e={},"next",(function(){if(o+=1,i||o>=r)return{done:!0};return{value:[o,K(n[o])],done:!1}})),q(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),cn&&q(e,cn,(function(){return t.entries()})),e})),q(Mn.prototype,"every",(function(t,e){var r,n;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n<this._length;n++)if(!t.call(e,K(r[n]),n,this))return!1;return!0})),q(Mn.prototype,"fill",(function(t,e,r){var n,i,o,a;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!X(t))throw new TypeError(N("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(n=this._buffer,i=this._length,arguments.length>1){if(!Mt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!Mt(r))throw new TypeError(N("invalid argument. Third argument must be an integer. Value: `%s`.",r));r<0&&(r+=i)<0&&(r=0),r>i&&(r=i)}else r=i}else e=0,r=i;for(o=t?1:0,a=e;a<r;a++)n[a]=o;return this})),q(Mn.prototype,"filter",(function(t,e){var r,n,i,o;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=[],i=0;i<this._length;i++)o=K(r[i]),t.call(e,o,i,this)&&n.push(o);return new this.constructor(n)})),q(Mn.prototype,"find",(function(t,e){var r,n,i;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,i=0;i<this._length;i++)if(n=K(r[i]),t.call(e,n,i,this))return n})),q(Mn.prototype,"findIndex",(function(t,e){var r,n,i;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,i=0;i<this._length;i++)if(n=K(r[i]),t.call(e,n,i,this))return i;return-1})),q(Mn.prototype,"findLast",(function(t,e){var r,n,i;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,i=this._length-1;i>=0;i--)if(n=K(r[i]),t.call(e,n,i,this))return n})),q(Mn.prototype,"findLastIndex",(function(t,e){var r,n,i;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,i=this._length-1;i>=0;i--)if(n=K(r[i]),t.call(e,n,i,this))return i;return-1})),q(Mn.prototype,"forEach",(function(t,e){var r,n;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n<this._length;n++)t.call(e,K(r[n]),n,this)})),q(Mn.prototype,"get",(function(t){if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Nt(t))throw new TypeError(N("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return K(this._buffer[t])})),q(Mn.prototype,"includes",(function(t,e){var r,n;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!X(t))throw new TypeError(N("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!Mt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(r=this._buffer,n=e;n<this._length;n++)if(t===K(r[n]))return!0;return!1})),q(Mn.prototype,"indexOf",(function(t,e){var r,n;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!X(t))throw new TypeError(N("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!Mt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(r=this._buffer,n=e;n<this._length;n++)if(t===K(r[n]))return n;return-1})),q(Mn.prototype,"join",(function(t){var e,r,n;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(arguments.length>0){if(!$t(t))throw new TypeError(N("invalid argument. First argument must be a string. Value: `%s`.",t))}else t=",";for(e=this._buffer,r=[],n=0;n<this._length;n++)e[n]?r.push("true"):r.push("false");return r.join(t)})),q(Mn.prototype,"keys",(function(){var t,e,r,n,i;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return t=this,r=this._length,i=-1,q(e={},"next",(function(){if(i+=1,n||i>=r)return{done:!0};return{value:i,done:!1}})),q(e,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),cn&&q(e,cn,(function(){return t.keys()})),e})),q(Mn.prototype,"lastIndexOf",(function(t,e){var r,n;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!X(t))throw new TypeError(N("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!Mt(e))throw new TypeError(N("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(r=this._buffer,n=e;n>=0;n--)if(t===K(r[n]))return n;return-1})),Wt(Mn.prototype,"length",(function(){return this._length})),q(Mn.prototype,"map",(function(t,e){var r,n,i,o;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!vt(t))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",t);for(i=this._buffer,r=(n=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)r[o]=K(t.call(e,K(i[o]),o,this));return n})),q(Mn.prototype,"reduce",(function(t,e){var r,n,i,o;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));if(r=this._buffer,n=this._length,arguments.length>1)i=e,o=0;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=K(r[0]),o=1}for(;o<n;o++)i=t(i,K(r[o]),o,this);return i})),q(Mn.prototype,"reduceRight",(function(t,e){var r,n,i,o;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));if(r=this._buffer,n=this._length,arguments.length>1)i=e,o=n-1;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=K(r[n-1]),o=n-2}for(;o>=0;o--)i=t(i,K(r[o]),o,this);return i})),q(Mn.prototype,"reverse",(function(){var t,e,r,n,i,o;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(t=this._buffer,r=this._length,n=Ft(r/2),i=0;i<n;i++)o=r-i-1,e=t[i],t[i]=t[o],t[o]=e;return this})),q(Mn.prototype,"set",(function(t){var e,r,n,i,o,a,u;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(n=this._buffer,arguments.length>1){if(!Nt(r=arguments[1]))throw new TypeError(N("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",r))}else r=0;if(de(t)){if(r+(o=t.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=Pn(t)?t._buffer:t,u=n.byteOffset+r*Bn,e.buffer===n.buffer&&e.byteOffset<u&&e.byteOffset+e.byteLength>u){for(i=new Lr(e.length),a=0;a<e.length;a++)i[a]=e[a];e=i}for(a=0;a<o;r++,a++)n[r]=e[a]?1:0}else{if(r>=this._length)throw new RangeError(N("invalid argument. Index argument is out-of-bounds. Value: `%u`.",r));n[r]=t?1:0}})),q(Mn.prototype,"slice",(function(t,e){var r,n,i,o,a,u;if(!Pn(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(!Mt(t))throw new TypeError(N("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(!Mt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=a)<0&&(e=0):e>a&&(e=a)}}for(r=t<e?e-t:0,n=(i=new this.constructor(r))._buffer,u=0;u<r;u++)n[u]=o[u+t];return i})),q(Mn.prototype,"some",(function(t,e){var r,n;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n<this._length;n++)if(t.call(e,K(r[n]),n,this))return!0;return!1})),q(Mn.prototype,"sort",(function(t){var e;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(e=this._buffer,0===arguments.length)return e.sort(),this;if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));return e.sort((function(e,r){return t(K(e),K(r))})),this})),q(Mn.prototype,"subarray",(function(t,e){var r,n,i;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(n=this._buffer,i=this._length,0===arguments.length)t=0,e=i;else{if(!Mt(t))throw new TypeError(N("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(!Mt(e))throw new TypeError(N("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,r=n.byteLength):t>=e?(i=0,r=n.byteOffset+t*Bn):(i=e-t,r=n.byteOffset+t*Bn),new this.constructor(n.buffer,r,i<0?0:i)})),q(Mn.prototype,"toLocaleString",(function(t,e){var r,n,i,o,a;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(0===arguments.length)n=[];else{if(!$t(t)&&!Zr(t))throw new TypeError(N("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));n=t}if(arguments.length<2)r={};else{if(!s(e))throw new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",e));r=e}for(o=this._buffer,i=[],a=0;a<this._length;a++)i.push(K(o[a]).toLocaleString(n,r));return i.join(",")})),q(Mn.prototype,"toReversed",(function(){var t,e,r,n,i;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=this._length,e=new this.constructor(r),n=this._buffer,t=e._buffer,i=0;i<r;i++)t[i]=n[r-i-1];return e})),q(Mn.prototype,"toSorted",(function(t){var e,r,n,i,o;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(n=this._length,r=new this.constructor(n),i=this._buffer,e=r._buffer,o=0;o<n;o++)e[o]=i[o];if(0===arguments.length)return e.sort(),r;if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));return e.sort((function(e,r){return t(K(e),K(r))})),r})),q(Mn.prototype,"toString",(function(){var t,e,r;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(t=[],e=this._buffer,r=0;r<this._length;r++)e[r]?t.push("true"):t.push("false");return t.join(",")})),q(Mn.prototype,"values",(function(){var t,e,r,n,i,o;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return e=this,i=this._buffer,r=this._length,o=-1,q(t={},"next",(function(){if(o+=1,n||o>=r)return{done:!0};return{value:K(i[o]),done:!1}})),q(t,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),cn&&q(t,cn,(function(){return e.values()})),t})),q(Mn.prototype,"with",(function(t,e){var r,n;if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Mt(t))throw new TypeError(N("invalid argument. First argument must be an integer. Value: `%s`.",t));if(n=this._length,t<0&&(t+=n),t<0||t>=n)throw new RangeError(N("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!X(e))throw new TypeError(N("invalid argument. Second argument must be a boolean. Value: `%s`.",e));return(r=new this.constructor(this._buffer))._buffer[t]=e?1:0,r}));var kn=[qe,tr,hr,or,Ar,vr,zr,Lr,Ur,En,Ln,Mn],Cn=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"],Nn=Cn.length;function Yn(t){var e;if(f(t))return"generic";if(yt(t))return null;for(e=0;e<Nn;e++)if(t instanceof kn[e])return Cn[e];return Je[mt(t)]||null}function Dn(t){var e=Yn(t);return Pe(t)?{data:t,dtype:e,accessorProtocol:!0,accessors:[Ye(e),ze(e)]}:{data:t,dtype:e,accessorProtocol:!1,accessors:[Me(e),Ce(e)]}}var zn=Array.prototype.slice;function Jn(t,e,r){var n;return function(t,e){return"function"==typeof t[e]}(t,"slice")?t.slice(e,r):(n=Dn(t)).accessorProtocol?function(t,e,r){var n,i,o,a;for(n=t.data,i=t.accessors[0],o=[],a=e;a<r;a++)o.push(i(n,a));return o}(n,e,r):function(t,e,r){return zn.call(t,e,r)}(t,e,r)}function Wn(t,e){return e&&(2===t||3===t)}function $n(t,e){return e&&(1===t||3===t)}function Gn(t,e,r){var n,i,o,a,u;for(n=t.length,i=r,o=r,u=0;u<n;u++){if(0===t[u])return[r,r];(a=e[u])>0?o+=a*(t[u]-1):a<0&&(i+=a*(t[u]-1))}return[i,o]}function Zn(t){return"column-major"===t}q(Gn,"assign",(function(t,e,r,n){var i,o,a,u,f;for(i=t.length,o=r,a=r,f=0;f<i;f++){if(0===t[f])return n[0]=r,n[1]=r,n;(u=e[f])>0?a+=u*(t[f]-1):u<0&&(o+=u*(t[f]-1))}return n[0]=o,n[1]=a,n}));var qn=/[-\/\\^$*+?.()|[\]{}]/g;var Xn=RegExp.prototype.exec;var Kn=n();function Hn(t){return"object"==typeof t&&(t instanceof RegExp||(Kn?function(t){try{return Xn.call(t),!0}catch(t){return!1}}(t):"[object RegExp]"===u(t)))}function Qn(t,e,r){return t.replace(e,r)}function ti(t,e,r){if(!$t(t))throw new TypeError(N("invalid argument. First argument must be a string. Value: `%s`.",t));if($t(e))e=new RegExp(function(t){var e,r;if(!$t(t))throw new TypeError(N("invalid argument. Must provide a regular expression string. Value: `%s`.",t));if("/"===t[0])for(r=t.length-1;r>=0&&"/"!==t[r];r--);return void 0===r||r<=0?t.replace(qn,"\\$&"):(e=(e=t.substring(1,r)).replace(qn,"\\$&"),t=t[0]+e+t.substring(r))}(e),"g");else if(!Hn(e))throw new TypeError(N("invalid argument. Second argument must be a string or regular expression. Value: `%s`.",e));if(!$t(r)&&!vt(r))throw new TypeError(N("invalid argument. Third argument must be a string or replacement function. Value: `%s`.",r));return Qn(t,e,r)}var ei={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 ri,ni={uint16:vr,uint8:Lr};(ri=new ni.uint16(1))[0]=4660;var ii=52===new ni.uint8(ri.buffer)[0],oi="function"==typeof ArrayBuffer?ArrayBuffer:null;var ai,ui="function"==typeof ArrayBuffer?ArrayBuffer:void 0;ai=function(){var t,e,r;if("function"!=typeof oi)return!1;try{(t=Gr(r=new oi(16))&&"function"==typeof oi.isView)&&((e=new qe(r))[0]=-3.14,e[1]=NaN,t=t&&oi.isView(e)&&16===r.byteLength&&-3.14===e[0]&&e[1]!=e[1])}catch(e){t=!1}return t}()?ui:function(){throw new Error("not implemented")};var fi=ai,si="function"==typeof DataView;function li(t){return si&&t instanceof DataView||"[object DataView]"===u(t)}var ci="function"==typeof DataView?DataView:null;var hi,pi="function"==typeof DataView?DataView:void 0;hi=function(){var t,e,r;if("function"!=typeof ci)return!1;try{r=new fi(24),(t=li(e=new ci(r,8))&&"function"==typeof e.getFloat64&&"function"==typeof e.setFloat64)&&(e.setFloat64(0,-3.14),e.setFloat64(8,NaN),t=t&&e.buffer===r&&16===e.byteLength&&8===e.byteOffset&&-3.14===e.getFloat64(0)&&e.getFloat64(8)!=e.getFloat64(8))}catch(e){t=!1}return t}()?pi:function(){throw new Error("not implemented")};var gi=hi,yi="function"==typeof BigInt?BigInt:void 0,mi=["row-major","column-major"];function di(){return mi.slice()}var vi=["row-major","column-major"];function bi(){return{"row-major":101,"column-major":102}}q((function(){return vi.slice()}),"enum",bi);var wi={"row-major":101,"column-major":102};function _i(){return{"row-major":wi["row-major"],"column-major":wi["column-major"]}}q(di,"enum",_i);var Ei=["throw","normalize","clamp","wrap"];function xi(){return Ei.slice()}function Ti(){return{throw:1,clamp:2,wrap:3,normalize:4}}q(xi,"enum",Ti);var Ai={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},Oi=_i(),Vi={throw:1,clamp:2,wrap:3,normalize:4};var Si=4294967295,ji=4294967296,Ri=new Lr(8),Li=new gi(Ri.buffer);function Ii(t,e,r,n){var i,o,a;if(0===t){for(a=0;a<Ri.length;a++)e[n]=0,n+=r;return e}for(o=(t&Si)>>>0,i=Ft(t/ji),ii?(Li.setUint32(0,o,ii),Li.setUint32(4,i,ii)):(Li.setUint32(0,i,ii),Li.setUint32(4,o,ii)),a=0;a<Ri.length;a++)e[n]=Ri[a],n+=r;return e}q((function(t){var e,r,n,i;return e=new Lr(8),0===t||(i=(4294967295&t)>>>0,n=Ft(t/4294967296),r=new gi(e.buffer),ii?(r.setUint32(0,i,ii),r.setUint32(4,n,ii)):(r.setUint32(0,n,ii),r.setUint32(4,i,ii))),e}),"assign",Ii);var Bi={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},Fi=_i(),Pi={throw:1,clamp:2,wrap:3,normalize:4};function Ui(t,e,r,n,i,o){var a,u,f,s,l;if(!(this instanceof Ui))return new Ui(t,e,r,n,i,o);for(s=1,l=0;l<r.length;l++)s*=r[l];return u=e.BYTES_PER_ELEMENT?e.BYTES_PER_ELEMENT*s:null,this._byteLength=u,this._bytesPerElement=Re(t),this._buffer=e,this._dtype=t,this._length=s,this._ndims=r.length,this._offset=i,this._order=o,this._shape=r,this._strides=n,this._accessors=K(e.get&&e.set),this._iterationOrder=Le(n),a=function(t,e,r,n,i){var o;return 0!==t&&0!==i&&t===(o=Gn(e,r,n))[1]-o[0]+1}(s,r,n,i,this._iterationOrder),f=Be(n),this._flags={ROW_MAJOR_CONTIGUOUS:$n(f,a),COLUMN_MAJOR_CONTIGUOUS:Wn(f,a),READONLY:!1},this.__meta_dataview__=null,this}function Mi(t,e){var r,n,i,o;for(i=Yn(t),n=Pe(t)?Ye(i):Me(i),r=t.length,o=0;o<r;o++)if(n(t,o)===e)return!0;return!1}function ki(t){var e,r,n;if(!de(t))throw new TypeError(N("invalid argument. Must provide an array-like object. Value: `%s`.",t));return n=Yn(t),Pe(t)&&(e=Ye(n)),r=t.length,void 0===e?function(e){var n;for(n=0;n<r;n++)if(t[n]===e)return!0;return!1}:function(n){var i;for(i=0;i<r;i++)if(e(t,i)===n)return!0;return!1}}q(Ui,"name","ndarray"),Wt(Ui.prototype,"byteLength",(function(){return this._byteLength})),Wt(Ui.prototype,"BYTES_PER_ELEMENT",(function(){return this._bytesPerElement})),Wt(Ui.prototype,"data",(function(){return this._buffer})),Wt(Ui.prototype,"dtype",(function(){return this._dtype})),Wt(Ui.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})),Wt(Ui.prototype,"length",(function(){return this._length})),Wt(Ui.prototype,"ndims",(function(){return this._ndims})),Wt(Ui.prototype,"offset",(function(){return this._offset})),Wt(Ui.prototype,"order",(function(){return this._order})),Wt(Ui.prototype,"shape",(function(){return Jn(this._shape,0,this._shape.length)})),Wt(Ui.prototype,"strides",(function(){return Jn(this._strides,0,this._strides.length)})),q(Ui.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]})),q(Ui.prototype,"iget",(function(t){var e,r,n,i,o,a;if(0===(n=this._ndims))return this._accessors?this._buffer.get(this._offset):this._buffer[this._offset];if(this._flags.ROW_MAJOR_CONTIGUOUS||this._flags.COLUMN_MAJOR_CONTIGUOUS){if(1===this._iterationOrder)return this._accessors?this._buffer.get(this._offset+t):this._buffer[this._offset+t];if(-1===this._iterationOrder)return this._accessors?this._buffer.get(this.offset-t):this._buffer[this._offset-t]}if(r=this._shape,e=this._strides,i=this._offset,Zn(this._order)){for(a=0;a<n;a++)t-=o=t%r[a],t/=r[a],i+=o*e[a];return this._accessors?this._buffer.get(i):this._buffer[i]}for(a=n-1;a>=0;a--)t-=o=t%r[a],t/=r[a],i+=o*e[a];return this._accessors?this._buffer.get(i):this._buffer[i]})),q(Ui.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})),q(Ui.prototype,"iset",(function(t,e){var r,n,i,o,a,u;if(0===(i=this._ndims))return this._accessors?this._buffer.set(t,this._offset):this._buffer[this._offset]=t,this;if(this._flags.ROW_MAJOR_CONTIGUOUS||this._flags.COLUMN_MAJOR_CONTIGUOUS){if(1===this._iterationOrder)return this._accessors?this._buffer.set(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(n=this._shape,r=this._strides,o=this._offset,Zn(this._order)){for(u=0;u<i;u++)t-=a=t%n[u],t/=n[u],o+=a*r[u];return this._accessors?this._buffer.set(e,o):this._buffer[o]=e,this}for(u=i-1;u>=0;u--)t-=a=t%n[u],t/=n[u],o+=a*r[u];return this._accessors?this._buffer.set(e,o):this._buffer[o]=e,this})),q(Ui.prototype,"toString",(function(){var t,e,r,n,i,o;if(e=this._shape.length,r="ndarray( '"+(n=this._dtype)+"', ",t="",this._length<=100)if("complex64"===n||"complex128"===n)for(o=0;o<this._length;o++)t+=xn(i=this.iget(o))+", "+Tn(i),o<this._length-1&&(t+=", ");else for(o=0;o<this._length;o++)t+=this.iget(o),o<this._length-1&&(t+=", ");else{if("complex64"===n||"complex128"===n)for(o=0;o<3;o++)t+=xn(i=this.iget(o))+", "+Tn(i),o<2&&(t+=", ");else for(o=0;o<3;o++)t+=this.iget(o),o<2&&(t+=", ");if(t+=", ..., ","complex64"===n||"complex128"===n)for(o=2;o>=0;o--)t+=xn(i=this.iget(this._length-1-o))+", "+Tn(i),o>0&&(t+=", ");else for(o=2;o>=0;o--)t+=this.iget(this._length-1-o),o>0&&(t+=", ")}if(r+=ti(ei[this.dtype],"{{data}}",t),r+=", ",r+=0===e?"[]":"[ "+this._shape.join(", ")+" ]",r+=", ",r+="[ ",0===e)r+="0";else for(o=0;o<e;o++)this._strides[o]<0?r+=-this._strides[o]:r+=this._strides[o],o<e-1&&(r+=", ");return r+=" ]",r+=", ",r+="0",r+=", ",r+="'"+this._order+"'",r+=" )"})),q(Ui.prototype,"toJSON",(function(){var t,e,r,n;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(),n=0;n<t.strides.length;n++)t.strides[n]<0&&(t.strides[n]*=-1);if(t.data=[],"complex64"===t.dtype||"complex128"===t.dtype)for(n=0;n<e;n++)r=this.iget(n),t.data.push(xn(r),Tn(r));else for(n=0;n<e;n++)t.data.push(this.iget(n));return t})),q(Ui.prototype,"valueOf",(function(){return 0===this._ndims?this.iget():this})),q(Ui.prototype,"__array_meta_dataview__",Jt()?function(){var t,e,r,n,i,o,a,u,f,s,l,c,h,p;if(f=this._mode||"throw",a=this._submode||[f],r=33+16*(c=this._ndims)+(h=a.length),(u=this.__meta_dataview__)&&u.byteLength===r)return u;for(u=new gi(new fi(r)),i=this._shape,o=this._strides,n=this._dtype,t=this._bytesPerElement,s=0,u.setInt8(s,ii?1:0),s+=1,u.setInt16(s,Ai[n],ii),s+=2,u.setBigInt64(s,yi(c),ii),l=8*c,s+=8,p=0;p<c;p++)u.setBigInt64(s,yi(i[p]),ii),u.setBigInt64(s+l,yi(o[p]*t),ii),s+=8;for(s+=l,u.setBigInt64(s,yi(this._offset*t),ii),s+=8,u.setInt8(s,Oi[this._order]),s+=1,u.setInt8(s,Vi[f]),s+=1,u.setBigInt64(s,yi(h),ii),s+=8,p=0;p<h;p++)u.setInt8(s,Vi[a[p]]),s+=1;return e=0,e|=this._flags.READONLY?4:0,u.setInt32(s,e,ii),this.__meta_dataview__=u,u}:function(){var t,e,r,n,i,o,a,u,f,s,l,c,h,p,g;if(s=this._mode||"throw",u=this._submode||[s],n=33+16*(h=this._ndims)+(p=u.length),(f=this.__meta_dataview__)&&f.byteLength===n)return f;for(f=new gi(new fi(n)),e=new Lr(f.buffer),o=this._shape,a=this._strides,i=this._dtype,t=this._bytesPerElement,l=0,f.setInt8(l,ii?1:0),l+=1,f.setInt16(l,Bi[i],ii),Ii(h,e,1,l+=2),c=8*h,l+=8,g=0;g<h;g++)Ii(o[g],e,1,l),Ii(a[g]*t,e,1,l+c),l+=8;for(l+=c,Ii(this._offset*t,e,1,l),l+=8,f.setInt8(l,Fi[this._order]),l+=1,f.setInt8(l,Pi[s]),Ii(p,e,1,l+=1),l+=8,g=0;g<p;g++)f.setInt8(l,Pi[u[g]]),l+=1;return r=0,r|=this._flags.READONLY?4:0,f.setInt32(l,r,ii),this.__meta_dataview__=f,f}),q(Mi,"factory",ki);var Ci={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"]},Ni=/_and_generic$/;function Yi(){var t,e,r;return 0===arguments.length?Ci.all.slice():(r=!1,t=arguments[0],Ni.test(t)&&"all"!==(t=Qn(t,Ni,""))&&"index"!==t&&(r=!0),e=(e=Ci[t])?e.slice():[],r&&e.length>0&&e.push("generic"),e)}var Di=ki(Yi());function zi(t,e){return null!=t&&("symbol"==typeof e?e in Object(t):String(e)in Object(t))}function Ji(t){return vt(t)&&Kt(t.alignment)&&Kt(t.byteLength)&&vt(t.byteLengthOf)&&vt(t.byteOffsetOf)&&vt(t.bufferOf)&&vt(t.isStruct)&&vt(t.viewOf)&&e(t,"fields")&&e(t,"layout")}var Wi,$i,Gi,Zi={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 qi(t){var e=Zi[t];return Ot(e)?e:null}function Xi(t){var e=typeof t;return"string"===e?null===qi(t)?null:t:"number"===e?Se(t):"object"===e&&t?String(t):Ji(t)?t.layout:null}function Ki(t,r){var n,i,o;if(n=arguments.length,!(this instanceof Ki))return n<2?new Ki(t):new Ki(t,r);if(Di(t))i="builtin";else{if(function(t){return t instanceof Ki||"object"==typeof t&&null!==t&&"DataType"===t.constructor.name&&$t(t.char)&&$t(t.description)&&$t(t.byteOrder)&&zi(t,"value")}(t))return new Ki(t.value,{description:t.description});if(!Ji(t))throw new TypeError(N("invalid argument. First argument must be either a supported data type string, a struct constructor, or another data type instance. Value: `%s`.",t));i="struct"}if(n>1){if(!At(o=r))throw new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",o));if(e(o,"description")&&!$t(o.description))throw new TypeError(N("invalid option. `%s` option must be a string. Option: `%s`.","description",o.description))}else o={};return q(this,"_value",t),q(this,"_description",o.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===Wi&&(Wi={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"}),Wi[Xi(t)]||null)}(t)||""),q(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===$i&&($i={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"}),$i[Xi(t)]||null)}(t)||""),q(this,"_enum",function(t){var e=typeof t;return"number"===e?Se(t)?t:null:"string"===e?qi(t):"object"===e&&t&&Mt(t.enum)?t.enum:Ji(t)?qi("userdefined_type"):null}(t)||-1),q(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===Gi&&(Gi={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?Kt(e=t.alignment)?e:Gi[Xi(t)]||null:null)}(t)||-1),q(this,"_byteLength",Re(t)||-1),q(this,"_byteOrder","host"),q(this,"_type",i),this}function Hi(t){return t instanceof Ki||"object"==typeof t&&null!==t&&Mt(t.alignment)&&Mt(t.byteLength)&&$t(t.byteOrder)&&$t(t.char)&&Mt(t.enum)&&zi(t,"value")}function Qi(t){return vt(t)&&Kt(t.alignment)&&Kt(t.byteLength)&&vt(t.byteLengthOf)&&vt(t.byteOffsetOf)&&vt(t.bufferOf)&&vt(t.viewOf)||function(t){return t instanceof Ki||"object"==typeof t&&null!==t&&Mt(t.alignment)&&Mt(t.byteLength)&&$t(t.byteOrder)&&$t(t.char)&&Mt(t.enum)&&zi(t,"value")}(t)&&Qi(t.value)}function to(t,e){if(Di(t));else if(Hi(t))t=String(t);else{if(!Qi(t))return!1;t=t.layout}if(Di(e));else if(Hi(e))e=String(e);else{if(!Qi(e))return!1;e=e.layout}return t===e}function eo(t){return Di(t)||Hi(t)||Qi(t)}q(Ki,"name","DataType"),Wt(Ki.prototype,"alignment",(function(){return this._alignment})),Wt(Ki.prototype,"byteLength",(function(){return this._byteLength})),Wt(Ki.prototype,"byteOrder",(function(){return this._byteOrder})),Wt(Ki.prototype,"char",(function(){return this._char})),Wt(Ki.prototype,"description",(function(){return this._description})),Wt(Ki.prototype,"enum",(function(){return this._enum})),Wt(Ki.prototype,"value",(function(){return this._value})),q(Ki.prototype,"toJSON",(function(){return{type:"DataType",value:this.toString(),byteOrder:this._byteOrder,description:this._description}})),q(Ki.prototype,"toString",(function(){return"struct"===this._type?this._value.layout:String(this._value)})),q(Ki.prototype,"valueOf",(function(){return this.toString()}));var ro=ki(di()),no=["none","equiv","safe","mostly-safe","same-kind","unsafe"];function io(){return no.slice()}q(io,"enum",(function(){return{none:0,equiv:1,safe:2,"mostly-safe":3,"same-kind":4,unsafe:5}}));var oo=io(),ao=oo.length;function uo(t){var e;for(e=0;e<ao;e++)if(t===oo[e])return!0;return!1}var fo,so={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 lo=function(t){return 0===arguments.length?function(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=Oe(so)).length,f=0;f<e;f++){for(i=t[f],a=so[i],n={},u=0;u<e;u++)n[o=t[u]]=a[o];r[i]=n}return r}():(void 0===fo&&(fo=function(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=Oe(so)).length,f=0;f<e;f++){for(i=t[f],a=so[i],n=[],u=0;u<e;u++)1===a[o=t[u]]&&n.push(o);r[i]=n}return r}()),t=Xi(t),e(fo,t)?fo[t].slice():null)}();var co,ho={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 po=function(t){return 0===arguments.length?function(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=Oe(ho)).length,f=0;f<e;f++){for(i=t[f],a=ho[i],n={},u=0;u<e;u++)n[o=t[u]]=a[o];r[i]=n}return r}():(void 0===co&&(co=function(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=Oe(ho)).length,f=0;f<e;f++){for(i=t[f],a=ho[i],n=[],u=0;u<e;u++)1===a[o=t[u]]&&n.push(o);r[i]=n}return r}()),t=Xi(t),e(co,t)?co[t].slice():null)}();var go,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: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 mo=function(t){return 0===arguments.length?function(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=Oe(yo)).length,f=0;f<e;f++){for(i=t[f],a=yo[i],n={},u=0;u<e;u++)n[o=t[u]]=a[o];r[i]=n}return r}():(void 0===go&&(go=function(){var t,e,r,n,i,o,a,u,f;for(r={},e=(t=Oe(yo)).length,f=0;f<e;f++){for(i=t[f],a=yo[i],n=[],u=0;u<e;u++)1===a[o=t[u]]&&n.push(o);r[i]=n}return r}()),t=Xi(t),e(go,t)?go[t].slice():null)}();function vo(t,e,r){return"unsafe"===r||(Xi(t)===Xi(e)||"none"!==r&&"equiv"!==r&&("safe"===r?function(t,e){var r;return(t=Xi(t))===(e=Xi(e))||!!(r=lo[t])&&r[e]>0}(t,e):"mostly-safe"===r?function(t,e){var r;return(t=Xi(t))===(e=Xi(e))||!!(r=po[t])&&r[e]>0}(t,e):function(t,e){var r;return(t=Xi(t))===(e=Xi(e))||!!(r=mo[t])&&r[e]>0}(t,e)))}function bo(t,e){return Zn(e)?function(t){var e,r,n;for(e=[],r=1,n=0;n<t.length;n++)e.push(r),r*=t[n];return e}(t):function(t){var e,r,n,i;for(e=t.length,r=[],i=0;i<e;i++)r.push(0);for(n=1,i=e-1;i>=0;i--)r[i]=n,n*=t[i];return r}(t)}function wo(t,e){var r,n,i;for(n=t.length,r=0,i=0;i<n;i++)e[i]<0&&(r-=e[i]*(t[i]-1));return r}function _o(t){var e,r,n;if(0===(e=t.length))return 0;for(r=1,n=0;n<e;n++)r*=t[n];return r}function Eo(t){if("function"!=typeof t)throw new TypeError(N("invalid argument. Must provide a function. Value: `%s`.",t));return function(e){var r,n;if(!function(t){return null!=t&&"function"!=typeof t&&"number"==typeof t.length&&Pt(t.length)&&t.length>=0&&t.length<=Jr}(e))return!1;if(r=e.length,0===r)return!1;for(n=0;n<r;n++)if(!1===t(e[n]))return!1;return!0}}q(bo,"assign",(function(t,e,r){return Zn(e)?function(t,e){var r,n;for(r=1,n=0;n<t.length;n++)e[n]=r,r*=t[n];return e}(t,r):function(t,e){var r,n;for(r=1,n=t.length-1;n>=0;n--)e[n]=r,r*=t[n];return e}(t,r)}));var xo=Eo(Dt.isPrimitive),To=Eo(Dt.isObject),Ao=Eo(Dt);q(Ao,"primitives",xo),q(Ao,"objects",To);var Oo=Eo(Ct.isPrimitive),Vo=Eo(Ct.isObject),So=Eo(Ct);function jo(){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"}}q(So,"primitives",Oo),q(So,"objects",Vo);var Ro={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"},Lo={"dtypes.default":Ro.dtypes.default,"dtypes.numeric":Ro.dtypes.numeric,"dtypes.real":Ro.dtypes.real,"dtypes.floating_point":Ro.dtypes.floating_point,"dtypes.real_floating_point":Ro.dtypes.real_floating_point,"dtypes.complex_floating_point":Ro.dtypes.complex_floating_point,"dtypes.integer":Ro.dtypes.integer,"dtypes.signed_integer":Ro.dtypes.signed_integer,"dtypes.unsigned_integer":Ro.dtypes.unsigned_integer,"dtypes.boolean":Ro.dtypes.boolean,"dtypes.index":Ro.dtypes.index,"dtypes.integer_index":Ro.dtypes.integer_index,"dtypes.boolean_index":Ro.dtypes.boolean_index,"dtypes.mask_index":Ro.dtypes.mask_index,order:Ro.order,casting:Ro.casting,index_mode:Ro.index_mode};function Io(t){var e=typeof t;return null===t||"object"!==e&&"function"!==e?new TypeError(N("invalid argument. A provided constructor must be either an object (except null) or a function. Value: `%s`.",t)):null}q(jo,"get",(function(t){var e=Lo[t];return void 0===e?null:e}));var Bo=Object.create;function Fo(){}var Po="function"==typeof Bo?Bo:function(t){return Fo.prototype=t,new Fo};function Uo(t,e){return t<0?0:t>e?e:t}function Mo(t,e){var r=e+1;return t<0?((t+=r)<0&&0!==(t%=r)&&(t+=r),t):t>e?((t-=r)>e&&(t%=r),t):t}function ko(t,e){return t<0?(t+=e+1)<0?-1:t:t>e?-1:t}var Co=ki(xi()),No={wrap:Mo,clamp:Uo,normalize:function(t,e){var r=ko(t,e);if(r<0||r>e)throw new RangeError(N("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",e,t));return r},throw:function(t,e){if(t<0||t>e)throw new RangeError(N("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",e,t));return t}};function Yo(t,e,r){var n;if("clamp"===r)return Uo(t,e);if("wrap"===r)return Mo(t,e);if(n=t,"normalize"===r&&(n=ko(n,e)),n<0||n>e)throw new RangeError(N("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",e,t));return n}q(Yo,"factory",(function(t){if(!Co(t))throw new TypeError(N("invalid argument. First argument must be a recognized index mode. Value: `%s`.",t));return No[t]}));var Do=Ui.prototype.iget;var zo=Ui.prototype.iset;function Jo(t,e){var r,n;for(r=[],n=0;n<e;n++)r.push(t[n]);return r}var Wo=32767,$o=jo.get("index_mode"),Go=!1;function Zo(t,r,n,i,o,a,u){var f,s,l,c,h;if(!(this instanceof Zo))return arguments.length<7?new Zo(t,r,n,i,o,a):new Zo(t,r,n,i,o,a,u);if(!eo(t))throw new TypeError(N("invalid argument. First argument must be a supported ndarray data type. Value: `%s`.",t));if(!de(r))throw new TypeError(N("invalid argument. Second argument must be an array-like object, typed-array-like, or a Buffer. Value: `%s`.",r));if(r.get&&r.set&&(!vt(r.get)||!vt(r.set)))throw new TypeError(N("invalid argument. Second argument `get` and `set` properties must be functions. Value: `%s`.",r));if(!xo(n)&&(!de(n)||n.length>0))throw new TypeError(N("invalid argument. Third argument must be an array-like object containing nonnegative integers. Value: `%s`.",n));if((f=n.length)>Wo)throw new RangeError(N("invalid argument. Number of dimensions must not exceed %u due to stack limits. Value: `%u`.",Wo,f));if(!Oo(i))throw new TypeError(N("invalid argument. Fourth argument must be an array-like object containing integers. Value: `%s`.",i));if(f>0){if(i.length!==f)throw new RangeError(N("invalid argument. Fourth argument length must match the number of dimensions. Expected number of dimensions: `%u`. Strides length: `%u`.",f,i.length))}else{if(1!==i.length)throw new RangeError("invalid argument. Fourth argument length must be equal to 1 when creating a zero-dimensional ndarray.");if(0!==i[0])throw new RangeError(N("invalid argument. Fourth argument must contain a single element equal to 0. Value: `%d`.",i[0]))}if(!Nt(o))throw new TypeError(N("invalid argument. Fifth argument must be a nonnegative integer. Value: `%s`.",o));if(!ro(a))throw new TypeError(N("invalid argument. Sixth argument must be a supported order. Value: `%s`.",a));if(f>0&&!function(t,e,r,n){var i=Gn(e,r,n);return i[0]>=0&&i[1]<t}(r.length,n,i,o)&&_o(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((s={}).mode=$o,s.readonly=Go,arguments.length>6&&(l=function(t,r){var n;if(!At(r))return new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e(r,"mode")&&(t.mode=r.mode,!Co(t.mode)))return new TypeError(N("invalid option. `%s` option must be a recognized mode. Option: `%s`.","mode",t.mode));if(e(r,"submode")){if(t.submode=r.submode,!Wr(t.submode))return new TypeError(N("invalid option. `%s` option must be an array containing recognized modes. Option: `%s`.","submode",t.submode));if(0===t.submode.length)return new TypeError(N("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(!Co(t.submode[n]))return new TypeError(N("invalid option. Each submode must be a recognized mode. Option: `%s`.",t.submode[n]));t.submode=t.submode.slice()}return e(r,"readonly")&&(t.readonly=r.readonly,!X(t.readonly))?new TypeError(N("invalid option. `%s` option must be a boolean. Option: `%s`.","readonly",t.readonly)):null}(s,u),l))throw l;return this._mode=s.mode,void 0===s.submode&&(s.submode=[this._mode]),this._submode=s.submode,c=Jo(n,f),h=Jo(i,f||1),Ui.call(this,t,r,c,h,o,a),this._flags.READONLY=s.readonly,this}!function(t,e){var r=Io(t);if(r)throw r;if(r=Io(e))throw r;if(void 0===e.prototype)throw new TypeError(N("invalid argument. Second argument must have a prototype from which another object can inherit. Value: `%s`.",e.prototype));t.prototype=Po(e.prototype),Z(t.prototype,"constructor",{configurable:!0,enumerable:!1,writable:!0,value:t})}(Zo,Ui),q(Zo,"name","ndarray"),q(Zo.prototype,"get",(function(){var t,e,r,n;if(arguments.length!==this._ndims)throw new RangeError(N("invalid arguments. Number of indices must match the number of dimensions. ndims: `%u`. nargs: `%u`.",this._ndims,arguments.length));for(t=this._offset,r=this._submode.length,n=0;n<arguments.length;n++){if(!Mt(arguments[n]))throw new TypeError(N("invalid argument. Indices must be integer valued. Argument: `%u`. Value: `%s`.",n,arguments[n]));e=Yo(arguments[n],this._shape[n]-1,this._submode[n%r]),t+=this._strides[n]*e}return this._accessors?this._buffer.get(t):this._buffer[t]})),q(Zo.prototype,"iget",(function(t){if(this._ndims>0){if(!Mt(t))throw new TypeError(N("invalid argument. Index must be an integer. Value: `%s`.",t));return t=Yo(t,this._length-1,this._mode),Do.call(this,t)}return Do.call(this)})),q(Zo.prototype,"set",(function(){var t,e,r,n;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(N("invalid arguments. Number of indices must match the number of dimensions. ndims: `%u`. nargs: `%u`.",this._ndims,arguments.length));for(t=this._offset,r=this._submode.length,n=0;n<arguments.length-1;n++){if(!Mt(arguments[n]))throw new TypeError(N("invalid argument. Indices must be integer valued. Argument: `%i`. Value: `%s`.",n,arguments[n]));e=Yo(arguments[n],this._shape[n]-1,this._submode[n%r]),t+=this._strides[n]*e}return this._accessors?this._buffer.set(arguments[n],t):this._buffer[t]=arguments[n],this})),q(Zo.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(!Mt(t))throw new TypeError(N("invalid argument. Index must be an integer. Value: `%s`.",t));t=Yo(t,this._length-1,this._mode),zo.call(this,t,e)}else zo.call(this,t);return this}));var qo=Object.prototype.isPrototypeOf;function Xo(t,e,r,n,i,o,a){var u,f,s,l,c,h,p;for(u=e.data,f=i.data,l=e.accessors[0],s=i.accessors[1],c=n,h=a,p=0;p<t;p++)s(f,h,l(u,c)),c+=r,h+=o;return i}var Ko=8;function Ho(t,e,r,n,i){var o,a,u,f,s,l;if(t<=0)return n;if(u=Dn(e),f=Dn(n),u.accessorProtocol||f.accessorProtocol)return Xo(t,u,r,o=r<0?(1-t)*r:0,f,i,a=i<0?(1-t)*i:0),f.data;if(1===r&&1===i){if((s=t%Ko)>0)for(l=0;l<s;l++)n[l]=e[l];if(t<Ko)return n;for(l=s;l<t;l+=Ko)n[l]=e[l],n[l+1]=e[l+1],n[l+2]=e[l+2],n[l+3]=e[l+3],n[l+4]=e[l+4],n[l+5]=e[l+5],n[l+6]=e[l+6],n[l+7]=e[l+7];return n}for(o=r<0?(1-t)*r:0,a=i<0?(1-t)*i:0,l=0;l<t;l++)n[a]=e[o],o+=r,a+=i;return n}var Qo=8;function ta(t,e,r,n,i,o,a){var u,f,s,l,c,h;if(t<=0)return i;if(s=Dn(e),l=Dn(i),s.accessorProtocol||l.accessorProtocol)return Xo(t,s,r,n,l,o,a),l.data;if(u=n,f=a,1===r&&1===o){if((c=t%Qo)>0)for(h=0;h<c;h++)i[f]=e[u],u+=r,f+=o;if(t<Qo)return i;for(h=c;h<t;h+=Qo)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+=Qo,f+=Qo;return i}for(h=0;h<t;h++)i[f]=e[u],u+=r,f+=o;return i}function ea(t,e){return t<e?t:e}function ra(t,e){var r,n;for(r=[],n=0;n<e;n++)r.push(t);return r}q(Ho,"ndarray",ta);var na="__@@##$$@@__struct_buffer__@@$$##@@__",ia="Struct";function oa(t,e,r,n){Z(t,e,{configurable:!1,enumerable:!1,get:r,set:n})}function aa(t,e,r){Z(t,e,{configurable:!1,enumerable:!0,get:r})}function ua(t,e,r,n){Z(t,e,{configurable:!1,enumerable:!0,get:r,set:n})}var fa={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"}};var sa={complex64:rn,complex128:Hr};function la(t){return sa[t]||null}var ca={float64:"complex128",float32:"complex64"},ha=la(ca.float64);var pa={complex128:"float64",complex64:"float32",complex32:"float16"};function ga(t,e){return function(){var r=this[na],n=r[e](t.byteOffset,ii),i=r[e](t.byteOffset+t.byteLength/2,ii);return function(t,e,r){var n;if(arguments.length>2){if(n=la(ca[r]))return new n(t,e);throw new TypeError(N("invalid argument. Must provide a recognized data type. Value: `%s`.",r))}return new ha(t,e)}(n,i,pa[t.type])}}var ya={float64:qe,float32:tr,int16:Ar,int32:hr,int8:zr,uint16:vr,uint32:or,uint8:Lr,uint8c:Ur,complex64:En,complex128:Ln,bool:Mn};function ma(t){return ya[t]||null}function da(t,e){return new Lr(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*e,t.length-e)}function va(){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 ba={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"}},wa={"dtypes.default":ba.dtypes.default,"dtypes.numeric":ba.dtypes.numeric,"dtypes.real":ba.dtypes.real,"dtypes.floating_point":ba.dtypes.floating_point,"dtypes.real_floating_point":ba.dtypes.real_floating_point,"dtypes.complex_floating_point":ba.dtypes.complex_floating_point,"dtypes.integer":ba.dtypes.integer,"dtypes.signed_integer":ba.dtypes.signed_integer,"dtypes.unsigned_integer":ba.dtypes.unsigned_integer,"dtypes.boolean":ba.dtypes.boolean,"dtypes.index":ba.dtypes.index,"dtypes.integer_index":ba.dtypes.integer_index,"dtypes.boolean_index":ba.dtypes.boolean_index,"dtypes.mask_index":ba.dtypes.mask_index};q(va,"get",(function(t){var e=wa[t];return void 0===e?null:e}));var _a=va.get("dtypes.default"),Ea=ma("complex64"),xa=ma("complex128"),Ta=ma("bool");function Aa(){var t,e,r,n;if(null===(r=ma(e=(t=arguments.length)&&$t(arguments[t-1])?arguments[t-=1]:_a)))throw new TypeError(N("invalid argument. Must provide a recognized data type. Value: `%s`.",e));return t<=0?new r(0):1===t?((n=arguments[0])instanceof Ea?n=gn(n,0):n instanceof xa?n=yn(n,0):n instanceof Ta&&(n=da(n,0)),new r(n)):2===t?new r(arguments[0],arguments[1]):new r(arguments[0],arguments[1],arguments[2])}function Oa(t){if(t.length)return t.isStructType?function(t){return function(){var e,r,n,i;for(e=(r=this[na]).byteOffset+t.byteOffset,n=[],i=0;i<t.length;i++)n.push(new t.type(r.buffer,e,t.byteLength)),e+=t.byteOffset;return n}}(t):function(t){return function(){var e=this[na];return Aa(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[na][e](t.byteOffset,ii)}}(t,fa[t.type].get);case"bool":return function(t,e){return function(){var r=this[na];return K(r[e](t.byteOffset,ii))}}(t,fa[t.type].get);case"complex128":case"complex64":case"complex32":return ga(t,fa[t.type].get);default:if(t.isStructType)return function(t){return function(){var e=this[na];return new t.type(e.buffer,e.byteOffset+t.byteOffset,t.byteLength)}}(t);throw new Error(N("unexpected error. Unrecognized data type. Value: `%s`.",t.type))}}var Va={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"]},Sa=/_and_generic$/;function ja(){var t,e,r;return 0===arguments.length?Va.all.slice():(r=!1,t=arguments[0],Sa.test(t)&&"all"!==(t=Qn(t,Sa,""))&&"index"!==t&&(r=!0),e=(e=Va[t])?e.slice():[],r&&e.length>0&&e.push("generic"),e)}var Ra=ki(ja("real_floating_point")),La=ki(ja("signed_integer"));function Ia(t){return"bigint"==typeof t}function Ba(t){return"object"==typeof t&&"[object BigInt]"===u(t)&&function(t){try{return"bigint"==typeof t.valueOf()}catch(t){return!1}}(t)}function Fa(t){return Ia(t)||Ba(t)}function Pa(t){return function(){return t}}q(Fa,"isPrimitive",Ia),q(Fa,"isObject",Ba);var Ua,Ma=Pa(!1),ka=Pa(!1),Ca=Pa(!1);q(Ma,"isPrimitive",ka),q(Ma,"isObject",Ca),Ua=Jt()?Fa:Ma;const{isPrimitive:Na}=Ua;var Ya=1401298464324817e-60,Da=16777215,za=-16777215;function Ja(t){return t!=t||t===It||t===Bt?"float32":Pt(t)?t>=za&&t<=Da?"float32":"float64":t>-Ya&&t<Ya?"float64":"float32"}function Wa(t){return Ot(t)?t!=t||t===It||t===Bt?"float32":Pt(t)?0===t&&(0===(e=t)&&1/e===Bt)?"float32":t<0?t>=Cr?"int8":t>=_r?"int16":t>=fr?"int32":"float64":t<=Vr?"uint8":t<=gr?"uint16":t<=ce?"uint32":"float64":t>-Ya&&t<Ya?"float64":"float32":X(t)?"bool":nn(t)?"float64"===Ja(t.re)||"float64"===Ja(t.im)?"complex128":"complex64":"generic";var e}var $a={Complex64:"complex64",Complex128:"complex128"};var Ga,Za=["complex64","complex128"].slice(),qa=[];for(Ga=0;Ga<Za.length;Ga++)qa.push(la(Za[Ga]));var Xa=Za.length;function Ka(t){var e;for(e=0;e<Xa;e++)if(t instanceof qa[e])return Za[e];return $a[mt(t)]||null}function Ha(t){return t?1:0}function Qa(t){return Vt(t)}var tu={dtypes:{real:"float64",complex:"complex128"}};function eu(t,e){return function(r){var n,i;Ot(r)?(n=Ra(t.type)?t.type:Mt(r)?La(t.type)?function(t){return t<0?t>=Cr?"int8":t>=_r?"int16":t>=fr?"int32":"float64":t<=kr?"int8":t<=wr?"int16":t<=ur?"int32":"float64"}(r):Wa(r):tu.dtypes.real,i=r):nn(r)?(n=Ka(r)||("float32"===t.type?"complex64":"complex128"),i=r.re):X(r)?(n="bool",i=Ha(r)):Na(r)?(n="int64",i=Qa(r)):(n="generic",i=r);if(!vo(n,t.type,t.castingMode))throw new TypeError(N("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,n));this[na][e](t.byteOffset,i,ii)}}function ru(t){return K(t)}function nu(t){return K(t.re||t.im)}function iu(t,e){return function(r){var n,i;X(r)?(n="bool",i=Ha(r)):Ot(r)?(n=tu.dtypes.real,i=Ha(ru(r))):Na(r)?(n="int64",i=Ha(function(t){return K(t)}(r))):nn(r)?(n=Ka(r)||tu.dtypes.complex,i=Ha(nu(r))):(n="generic",i=K(r));if(!vo(n,t.type,t.castingMode))throw new TypeError(N("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,n));this[na][e](t.byteOffset,i,ii)}}function ou(t,e){return function(r){var n,i;Na(r)?(n="int64",i=r):Ot(r)?Mt(r)?(n=Wa(r),i=yi(r)):(n=tu.dtypes.real,i=yi(Ft(r))):X(r)?(n="bool",i=function(t){return yi(t?1:0)}(r)):nn(r)?(n=Ka(r)||tu.dtypes.complex,i=yi(Ft(r.re))):(n="generic",i=yi(Ft(Vt(i))));if(!vo(n,t.type,t.castingMode))throw new TypeError(N("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,n));this[na][e](t.byteOffset,i,ii)}}function au(t){return s(t)&&li(t[na])}var uu=ki(ja("complex_floating_point")),fu=ki(ja("boolean")),su=ki(ja("real"));function lu(t,e){if(sn(t))return yn(t,e);if(un(t))return gn(t,e);throw new TypeError(N("invalid argument. First argument must be a complex-valued floating-point array. Value: `%s`.",t))}function cu(t,e){return e>0?0:(1-t)*e}var hu=8;function pu(t,e,r,n,i){var o,a,u,f;if(t<=0)return r;if((u=Dn(r)).accessorProtocol)return function(t,e,r,n,i){var o,a,u,f;for(o=r.data,a=r.accessors[1],u=i,f=0;f<t;f++)a(o,u,e),u+=n}(t,e,u,n,i),u.data;if(o=i,1===n){if((a=t%hu)>0)for(f=0;f<a;f++)r[o]=e,o+=n;if(t<hu)return r;for(f=a;f<t;f+=hu)r[o]=e,r[o+1]=e,r[o+2]=e,r[o+3]=e,r[o+4]=e,r[o+5]=e,r[o+6]=e,r[o+7]=e,o+=hu;return r}for(f=0;f<t;f++)r[o]=e,o+=n;return r}function gu(t,e,r,n){return pu(t,e,r,n,cu(t,n))}function yu(t){return ra(0,t)}function mu(t,e,r,n,i,o){var a,u;return a=Dn(t),u=Dn(e),a.accessorProtocol||u.accessorProtocol?(function(t,e,r,n,i,o){var a,u,f,s,l,c;for(a=t.data,u=e.data,f=t.accessors[0],s=e.accessors[1],l=n,c=0;c<a.length;c++)s(u,l,i.call(o,f(a,c),c,a)),l+=r}(a,u,r,n,i,o),e):function(t,e,r,n,i,o){var a,u;for(a=n,u=0;u<t.length;u++)e[a]=i.call(o,t[u],u,t),a+=r;return e}(t,e,r,n,i,o)}function du(t,e,r){return function(t,e){return"function"==typeof t[e]}(t,"map")?t.map(e,r):mu(t,yu(t.length),1,0,e,r)}function vu(t){return t.re}function bu(t){if(t.length)return t.isStructType?function(t){return function(e){var r,n,i,o,a,u,f,s;if(!de(e))throw new TypeError(N("invalid assignment. `%s` must be an array-like object. Value: `%s`.",t.name,e));if(e.length!==t.length)throw new RangeError(N("invalid assignment. `%s` must be an array-like object having length %u.",t.name,t.length));if("none"===t.casting)for(s=0;s<e.length;s++)if(!(e[s]instanceof t.type))throw new TypeError(N("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Value: `%s`.",t.name,e[s]));for(f=t.byteLength/t.length,n=[],s=0;s<e.length;s++){if((u=this.constructor.viewOf(e[s])).byteLength!==f)throw new RangeError(N("invalid assignment. `%s` must be an array-like object containing `struct` instances having the same byte length.",t.name));a=new Lr(u.buffer,u.byteOffset,f),n.push(a)}for(r=(i=this[na]).byteOffset+t.byteOffset,s=0;s<e.length;s++)o=new Lr(i.buffer,r,f),Ho(t.length,n[s],1,o,1),r+=f}}(t):function(t){return function(e){var r,n,i;if(!de(e)||au(e))throw new TypeError(N("invalid assignment. `%s` must be an array-like object. Value: `%s`.",t.name,e));if(e.length!==t.length)throw new RangeError(N("invalid assignment. `%s` must be an array-like object having length %u.",t.name,t.length));if(!vo(i=Yn(e),t.type,t.castingMode))throw new TypeError(N("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,i));return r=Aa((n=this[na]).buffer,n.byteOffset+t.byteOffset,t.length,t.type),i===t.type?uu(i)?void Ho(2*t.length,lu(e,0),1,lu(r,0),1):fu(i)?void Ho(t.length,da(e,0),1,da(r,0),1):void Ho(t.length,e,1,r,1):su(i)?su(t.type)?void Ho(t.length,e,1,r,1):uu(t.type)?(r=lu(r,0),Ho(t.length,r,2,e,1),void gu.ndarray(t.length,0,r,2,1)):void du.assign(e,r,1,0,ru):uu(i)?su(t.type)?void du.assign(e,r,1,0,vu):uu(t.type)?void Ho(2*t.length,lu(e,0),1,lu(r,0),1):void du.assign(e,r,1,0,nu):void(su(t.type)?Ho(t.length,da(e,0),1,r,1):(r=lu(r,0),Ho(t.length,r,2,da(e,0),1),gu.ndarray(t.length,0,r,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 eu(t,fa[t.type].set);case"int64":case"uint64":return ou(t,fa[t.type].set);case"bool":return iu(t,fa[t.type].set);case"complex128":case"complex64":case"complex32":return function(t,e){return function(r){var n,i,o,a;if(nn(r)?(i=Ka(r)||t.type,o=r.re,a=r.im):Ot(r)?(i="complex64"===t.type?"float32":"float64",o=r,a=0):Na(r)?(i="int64",o=Qa(r),a=0):X(r)?(i="bool",o=Ha(r),a=0):(i="generic",o=r,a=0),!vo(i,t.type,t.castingMode))throw new TypeError(N("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,i));(n=this[na])[e](t.byteOffset,o,ii),n[e](t.byteOffset+t.byteLength/2,a,ii)}}(t,fa[t.type].set);default:if(t.isStructType)return function(t){return function(e){var r,n,i,o,a;if(!au(e))throw new TypeError(N("invalid assignment. `%s` must be a `struct` instance. Value: `%s`.",t.name,e));if("none"===t.casting&&!(e instanceof t.type))throw new TypeError(N("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(N("invalid assignment. `%s` must be a `struct` instance having the same byte length.",t.name));i=new Lr(o.buffer,o.byteOffset,a),r=this[na],n=new Lr(r.buffer,r.byteOffset+t.byteOffset,a),Ho(t.length,i,1,n,1)}}(t);throw new Error(N("unexpected error. Unrecognized data type. Value: `%s`.",t.type))}}q(gu,"ndarray",pu),q(du,"assign",mu);var wu=["name","type","description","length","enumerable","writable","default","castingMode"];function _u(t){return"union"===t.type&&de(t.fields)}function Eu(t){return null==t}function xu(t,e,r,n,i){var o,a,u,f,s;if(t<=0)return"";if(1===n&&0===i&&t===r.length&&function(t,e){return"function"==typeof t[e]}(r,"join"))return r.join(e);if((u=Dn(r)).accessorProtocol)return function(t,e,r,n,i){var o,a,u,f,s,l;for(o=r.data,a=r.accessors[0],f=i,u="",l=0;l<t;l++)l>0&&(u+=e),Eu(s=a(o,f))||(u+=String(s)),f+=n;return u}(t,e,u,n,i);for(a=i,o="",s=0;s<t;s++)s>0&&(o+=e),Eu(f=r[a])||(o+=String(f)),a+=n;return o}function Tu(t,e){return xu(t.length,e,t,1,0)}function Au(t,e){return X(t)?null:new TypeError(N("invalid argument. `%s` field must be a boolean. Value: `%s`.",e,t))}q((function(t,e,r,n){return xu(t,e,r,n,cu(t,n))}),"ndarray",xu);var Ou=["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float32","float64","complex64","complex128","bool"];var Vu,Su={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},ju=["name","type"],Ru={name:function(t,e){return $t(t)||t.length>0?null:new TypeError(N("invalid argument. `%s` field must be a non-empty string. Value: `%s`.",e,t))},type:function(t){return Mi(Ou,t)||Ji(t)?null:new TypeError(N('invalid argument. `%s` field must be either a struct type or one of the following: "%s". Value: `%s`.',"type",Tu(Ou,", "),t))},description:function(t,e){return $t(t)?null:new TypeError(N("invalid argument. `%s` field must be a string. Value: `%s`.",e,t))},length:function(t,e){return Kt(t)?null:new TypeError(N("invalid argument. `%s` field must be a positive integer. Value: `%s`.",e,t))},enumerable:Au,writable:Au,default:Pa(null),castingMode:(Vu=["none","safe","mostly-safe","same-kind","unsafe"],function(t,e){return Mi(Vu,t)?null:new TypeError(N('invalid argument. `%s` field must be one of the following: "%s". Value: `%s`.',e,Tu(Vu,", "),t))})};function Lu(t,e){var r,n,i,o,a;for(r={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(zi(t,o=e[a])){if(i=t[o],n=Ru[o](i,o))return n;r[o]=i}return function(t,e){var r;for(r=0;r<e.length;r++)if(!zi(t,e[r]))return!1;return!0}(r,ju)?(r.isStructType=Ji(r.type),r.byteLength=function(t){var e;return e=t.isStructType?t.type.byteLength:Re(t.type),t.length&&(e*=t.length),e}(r),r.isStructType?r.alignment=r.type.alignment:r.alignment=Su[r.type],r):new TypeError(N('invalid argument. Field objects must have the following properties: "%s". Value: `%s`.',Tu(ju,", "),JSON.stringify(t)))}function Iu(t){var e,r,n;for(e=0,n=0;n<t.length;n++)(r=t[n].alignment)>e&&(e=r);return e}function Bu(t){var e,r,n,i,o,a,u;if(0===(e=t.fields).length)return null;for(n=[],u=0;u<e.length;u++){if(!s(a=e[u]))return null;if(_u(a))return new TypeError(N("invalid argument. Union types cannot contain nested union types. Value: `%s`.",JSON.stringify(e)));if(void 0===r&&zi(a,"default"))r=!0;else if(!0===r&&zi(a,"default"))return new TypeError(N("invalid argument. Union types can only contain one field with a default value. Value: `%s`.",JSON.stringify(e)));if((i=Lu(a,wu))instanceof Error)return i;if(0===u)o=i.byteLength;else if(i.byteLength!==o)return new RangeError(N("invalid argument. Union types must contain fields having the same byte length. Value: `%s`.",JSON.stringify(e)));n.push(i)}return{type:"union",fields:n,byteLength:o,byteOffset:0,alignment:Iu(n),padding:0}}function Fu(t){var e=Yn(t);return Pe(t)?Ye(e):Me(e)}function Pu(t,e,r){return function(t,e){return"function"==typeof t[e]}(t,"indexOf")?t.indexOf(e,r):(r<0&&(r+=t.length)<0&&(r=0),de(n=t)&&vt(n.get)&&vt(n.set)?function(t,e,r){var n,i;for(n=Fu(t),i=r;i<t.length;i++)if(e===n(t,i))return i;return-1}(t,e,r):function(t,e,r){var n;for(n=r;n<t.length;n++)if(e===t[n])return n;return-1}(t,e,r));var n}function Uu(t,e){var r;return 0===t.length?new Error("invalid operation. struct does not have any fields."):(r=Pu(t,e,0))<0?new TypeError(N('invalid argument. Field name must be one of the following: "%s". Value: `%s`.',Tu(t,", "),e)):r}function Mu(t,e){var r;for(r=0;r<t.length;r++)t[r].padding=e;return t}function ku(t){return function(e,r){return N("[%u,",t+parseInt(r,10))}}function Cu(t){var e,r,n,i,o,a;for(i=t.length,n=/\[(\d{1,}),/g,e=[],a=0;a<i;a++)o=t[a],a>0&&o.byteOffset===t[a-1].byteOffset||(o.isStructType?e.push(Qn(o.type.layout,n,ku(o.byteOffset))):e.push(N("|<%s>[%u,%u]",o.type,o.byteOffset,o.byteLength)));return"|"===(r=N("%s|",e.join("")))[r.length-2]&&(r=r.substring(0,r.length-1)),r}var Nu=["none","linear","layout"],Yu=ki(Nu);function Du(t,r,n){var i;if(!At(n))throw new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",n));if(i={format:"none"},e(n,"format")&&(i.format=n.format,!Yu(i.format)))throw new TypeError(N('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"format",Tu(Nu,", "),n.format));return"linear"===i.format?function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x;for(d=e.length,r="%"+(t.byteLength-1).toString().length+"s",y=0,_=0;_<d;_++)(m=(v=e[_]).name.length+1+(v.byteLength-1).toString().length+1)>y&&(y=m);for(n="%"+y+"s",i="// %s",u="%s: %s %s",c=0,s=[],_=0;_<d;_++)if(v=e[_],!(_>0&&v.byteOffset===e[_-1].byteOffset)){for(l=_<d-1&&v.byteOffset===e[_+1].byteOffset,E=0;E<v.byteLength;E++){if(h=N(r,c.toString()),p=N(n,N("%s[%u]",v.name,E)),o=v.alignment>1?" (byte %u)":"",l){for(a=" => union: %s",f=[],x=_+1;x<d&&v.byteOffset===e[x].byteOffset;)w=(b=e[x]).isStructType?"<Struct>":b.type,f.push(N("%s<%s>[%u]",b.name,w,E%b.alignment)),x+=1;a=N(a,f.join(", "))}else a="";f=N(o+a,E%v.alignment),g=v.length?N(i,N("%s[%u]%s",v.type,Ft(E/v.alignment),f)):N(i,N("%s%s",v.type,f)),s.push(N(u,h,p,g)),c+=1}for(E=0;E<v.padding;E++)h=N(r,c.toString()),p=N(n,"--"),g=N(i,"padding"),s.push(N(u,h,p,g)),c+=1}return s.join("\n")}(t,r):"layout"===i.format?Cu(r):"<Struct>"}function zu(){}var Ju="foo"===zu.name;var Wu=[qe,tr,hr,or,Ar,vr,zr,Lr,Ur],$u=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"],Gu=Ge()?xt(qe):Zu;function Zu(){}Gu="TypedArray"===function(t){if(!1===vt(t))throw new TypeError(N("invalid argument. Must provide a function. Value: `%s`.",t));return Ju?t.name:ht.exec(t.toString())[1]}(Gu)?Gu:Zu;var qu=[Ln,En],Xu=["Complex64Array","Complex128Array"];function Ku(){return"function"==typeof o&&"symbol"==typeof o("foo")&&e(o,"hasInstance")&&"symbol"==typeof o.hasInstance}var Hu=Ku()?Symbol.hasInstance:null,Qu=Ku();function tf(t,e){if("function"!=typeof e&&(!Qu||"object"!=typeof e||"function"!=typeof e[Hu]))throw new TypeError(N("invalid argument. Second argument must be callable. Value: `%s`.",e));return t instanceof e}var ef=[[qe,"Float64Array"],[tr,"Float32Array"],[hr,"Int32Array"],[or,"Uint32Array"],[Ar,"Int16Array"],[vr,"Uint16Array"],[zr,"Int8Array"],[Lr,"Uint8Array"],[Ur,"Uint8ClampedArray"],[En,"Complex64Array"],[Ln,"Complex128Array"],[Mn,"BooleanArray"]];function rf(t){var e,r;for(r=0;r<ef.length;r++)if(tf(t,ef[r][0]))return ef[r][1];for(;t;){for(e=mt(t),r=0;r<ef.length;r++)if(e===ef[r][1])return ef[r][1];t=xt(t)}}function nf(t){var e,r,n,i;if(function(t){var e,r;if("object"!=typeof t||null===t)return!1;if(t instanceof Gu)return!0;for(r=0;r<Wu.length;r++)if(t instanceof Wu[r])return!0;for(;t;){for(e=mt(t),r=0;r<$u.length;r++)if($u[r]===e)return!0;t=xt(t)}return!1}(t))e=t;else if(function(t){var e,r;if("object"!=typeof t||null===t)return!1;for(r=0;r<qu.length;r++)if(t instanceof qu[r])return!0;for(;t;){for(e=mt(t),r=0;r<Xu.length;r++)if(Xu[r]===e)return!0;t=xt(t)}return!1}(t))e=8===t.BYTES_PER_ELEMENT?gn(t,0):yn(t,0);else{if(!((i=t)instanceof Mn||"BooleanArray"===mt(i)))throw new TypeError(N("invalid argument. Must provide a typed array. Value: `%s`.",t));e=da(t,0)}for(r={type:rf(t),data:[]},n=0;n<e.length;n++)r.data.push(e[n]);return r}function of(t){var e,r,n,i,o,a,u,f;if(!de(t))throw new TypeError(N("invalid argument. First argument must be an array-like object. Value: `%s`.",t));if(u=function(t){var e,r,n,i;for(e=[],i=0;i<t.length;i++){if(!s(n=t[i]))return new TypeError(N("invalid argument. First argument must be an array of objects. Value: `%s`. Index: `%d`.",n,i));if(_u(n)){if(null===(r=Bu(n)))return new TypeError(N("invalid argument. Union types must be an array of objects. Value: `%s`. Index: `%d`.",JSON.stringify(n),i));if(r instanceof Error)return r}else if((r=Lu(n,wu))instanceof Error)return r;e.push(r)}return e}(t),u instanceof Error)throw u;if(u=function(t){var e,r,n,i,o,a;for(e={},r=[],i=0;i<t.length;i++)if(a=(n=t[i]).name,_u(n))for(o=0;o<n.fields.length;o++){if(!0===e[a=n.fields[o].name])return new TypeError(N("invalid argument. First argument must be an array of objects having unique field names. Value: `%s`.",JSON.stringify(t)));e[a]=!0,r.push(a)}else{if(!0===e[a])return new TypeError(N("invalid argument. First argument must be an array of objects having unique field names. Value: `%s`.",JSON.stringify(t)));e[a]=!0,r.push(a)}return r}(a=u),u instanceof Error)throw u;function l(t,i,u){var f,c,h,p,g,y,m,d,v,b;if(c=arguments.length,!(this instanceof l))return 0===c?new l:1===c?new l(t):2===c?new l(t,i):new l(t,i,u);if(Gr(t)){if(1===c)p=new gi(t,0,r);else{if(!Nt(i))throw new TypeError(N("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",i));if(2===c)p=new gi(t,i,r);else{if(!Nt(u))throw new TypeError(N("invalid argument. Byte length must be a nonnegative integer. Value: `%s`.",u));p=new gi(t,i,ea(u,r))}}if(p.byteLength<r)throw new RangeError(N("invalid argument. ArrayBuffer has insufficient capacity. Minimum capacity: `%u`.",r))}else if(p=new gi(new fi(r)),c>0){if(!s(t))throw new TypeError(N("invalid argument. First argument must be an object. Value: `%s`.",t));g=t}if(q(this,na,p),void 0!==g){for(f=ra(void 0,a.length),h={},d=0;d<a.length;d++)if(b=e[d],v=n[d],zi(g,b)){if(h[v])throw new Error("invalid argument. Union types may only be initialized by a single member.");f[d]=g[b],h[v]=!0}for(d=0;d<a.length;d++)h[v=n[d]]||void 0!==(y=a[d]).default&&(f[d]=y.default);for(d=0;d<a.length;d++)void 0!==(m=f[d])&&o[e[d]][1].call(this,m)}return this}return e=u,i=Iu(a),a=function(t,e){var r,n,i,o,a,u,f;for(i=0,u=0;u<t.length;u++){if(i+=n=((r=ea((a=t[u]).alignment,e))-i%r)%r,u>0&&((o=t[u-1]).padding=n,_u(a)&&Mu(o.fields,n)),a.byteOffset=i,_u(a))for(f=0;f<a.fields.length;f++)a.fields[f].byteOffset=i;i+=a.byteLength}return n=(r-i%r)%r,a.padding=n,_u(a)&&Mu(a.fields,n),t}(a,i),a=function(t){var e,r,n,i;for(e=[],n=0;n<t.length;n++)if(_u(r=t[n]))for(i=0;i<r.fields.length;i++)e.push(r.fields[i]);else e.push(r);return e}(a),n=function(t){var e,r,n,i;for(r=t.length,e=[],i=0,n=0;n<r-1;n++)t[n].byteOffset!==t[n+1].byteOffset?(e.push(i),i+=1):e.push(i);return e.push(i),e}(a),f=a[a.length-1],r=f.byteOffset+f.byteLength+f.padding,q(l,"name",ia),q(l,"alignment",i),q(l,"byteLength",r),Wt(l,"fields",(function(){return e.slice()})),Wt(l,"layout",(function(){return Cu(a)})),q(l,"bufferOf",(function(t){if(!au(t))throw new TypeError(N("invalid argument. First argument must be a `struct` instance. Value: `%s`.",t));return t[na].buffer})),q(l,"byteLengthOf",(function(t){var r=Uu(e,t);if(r instanceof Error)throw r;return a[r].byteLength})),q(l,"byteOffsetOf",(function(t){var r=Uu(e,t);if(r instanceof Error)throw r;return a[r].byteOffset})),q(l,"descriptionOf",(function(t){var r=Uu(e,t);if(r instanceof Error)throw r;return a[r].description})),q(l,"isStruct",(function(t){return t instanceof l||au(t)&&Ji(t.constructor)})),q(l,"typeOf",(function(t){var r=Uu(e,t);if(r instanceof Error)throw r;return a[r].type})),q(l,"viewOf",(function(t){var e;if(!au(t))throw new TypeError(N("invalid argument. First argument must be a `struct` instance. Value: `%s`.",t));return e=t[na],new gi(e.buffer,e.byteOffset,e.byteLength)})),o=function(t,e){var r,n,i,o,a;for(i={},a=0;a<e.length;a++)r=Oa(o=e[a]),n=bu(o),o.enumerable?o.writable?ua(t,o.name,r,n):aa(t,o.name,r):o.writable?oa(t,o.name,r,n):Wt(t,o.name,r),i[o.name]=[r,n];return i}(l.prototype,a),q(l.prototype,"toString",(function(){if(!(this instanceof l))throw new Error("invalid invocation. `this` is not a struct instance.");return Du(l,a,arguments.length>0?arguments[0]:{})})),q(l.prototype,"toJSON",(function(){if(!(this instanceof l))throw new Error("invalid invocation. `this` is not a struct instance.");return function(t,e){var r,n,i,o;for(r={},o=0;o<e.length;o++)de(i=t[(n=e[o]).name])?i=nf(i):(au(i)||nn(i)&&vt(i.toJSON))&&(i=i.toJSON()),r[n.name]=i;return r}(this,a)})),l}function af(t,e,r){var n,i,o,a,u,f,s,l,c,h,p;for(u={format:"layout"},f=r.length,s=r.get&&r.set?Ye("default"):Me("default"),o=t.layout,c=t.byteLength,n=new Lr(e),i=0,p=0;p<f;p++){h=s(r,p);try{a=t.viewOf(h),l=!0}catch(e){try{h=new t(h)}catch(t){return null}a=t.viewOf(h),l=!1}if(l&&h.toString(u)!==o)return null;ta(c,new Lr(a.buffer,a.byteOffset,a.byteLength),1,0,n,1,i),i+=c}return e}var uf=ln(),ff="StructArray";function sf(t){var e,r,n,i;if(de(t))i=of(t);else{if(!Ji(t))throw new TypeError(N("invalid argument. First argument must be either a struct constructor or struct schema. Value: `%s`.",t));i=t}function o(t,r,n){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,r):new o(t,r,n);if(0===a)u=new fi(0),f=0;else if(1===a)if(Nt(t))u=new fi(t*e),f=t;else if(de(t)){if(f=t.length,null===(u=af(i,new fi(f*e),t)))throw new TypeError(N("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(Gr(t)){if(!Mt(f=(u=t).byteLength/e))throw new RangeError(N("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",e,u.byteLength))}else{if(!s(t))throw new TypeError(N("invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!1===uf)throw new TypeError(N("invalid argument. Environment lacks Symbol.iterator support. First argument must be a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",t));if(!vt(t[cn]))throw new TypeError(N("invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!vt((u=t[cn]()).next))throw new TypeError(N("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,r;for(e=[];!(r=t.next()).done;)e.push(r.value);return e}(u)).length,null===(u=af(i,new fi(f*e),l)))throw new TypeError(N("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(!Gr(u=arguments[0]))throw new TypeError(N("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!Nt(r))throw new TypeError(N("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",r));if(!Mt(r/e))throw new RangeError(N("invalid argument. Second argument must be a multiple of %u. Value: `%u`.",e,r));if(r>=u.byteLength)throw new RangeError(N("invalid argument. Second argument exceeds the bounds of the ArrayBuffer. Value: `%s`.",r));if(2===a){if(!Mt(f=(u.byteLength-r)/e))throw new RangeError(N("invalid argument. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",e,u.byteLength-r))}else{if(!Nt(f=n))throw new TypeError(N("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",f));if(f*e>u.byteLength-r)throw new RangeError(N("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",f*e))}}return q(this,"_buffer",u),q(this,"_byteOffset",r||0),q(this,"_byteLength",f*e),q(this,"_length",f),this}return e=i.byteLength,r=i.layout,n=i.fields,q(o,"BYTES_PER_ELEMENT",e),q(o,"name",ff),q(o,"struct",i),Wt(o.prototype,"buffer",(function(){return this._buffer})),Wt(o.prototype,"byteLength",(function(){return this._byteLength})),Wt(o.prototype,"byteOffset",(function(){return this._byteOffset})),q(o.prototype,"BYTES_PER_ELEMENT",o.BYTES_PER_ELEMENT),q(o.prototype,"get",(function(t){if(!a(this))throw new TypeError(N("invalid invocation. `this` is not a %s.",ff));if(!Nt(t))throw new TypeError(N("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return new i(this._buffer,this._byteOffset+t*e,e)})),Wt(o.prototype,"length",(function(){return this._length})),q(o.prototype,"set",(function(t){var o,u,f,l,c,h,p,g,y,m,d,v;if(!a(this))throw new TypeError(N("invalid invocation. `this` is not a %s.",ff));if(l=this._buffer,arguments.length>1){if(!Nt(f=arguments[1]))throw new TypeError(N("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",f))}else f=0;if(u={format:"layout"},p=i.byteLength,!de(t)||Mi(n,"length")){if(f>=this._length)throw new RangeError(N("invalid argument. Index argument is out-of-bounds. Value: `%u`.",f));if(!s(t))throw new TypeError(N("invalid argument. Must provide either a valid object or a struct instance. Value: `%s`.",t));if(t.toString(u)===r)return o=i.viewOf(t),void ta(p,new Lr(o.buffer,o.byteOffset,p),1,0,new Lr(l,this._byteOffset+f*e,p),1,0);for(y=new i(l,this._byteOffset+f*e,p),d=0;d<n.length;d++)zi(t,m=n[d])&&(y[m]=t[m])}else{if(f+(g=t.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(h=(o=t).get&&o.set?Ye("default"):Me("default"),v=this._byteOffset+f*e,o.buffer===l&&o.byteOffset<v&&o.byteOffset+o.byteLength>v){for(c=[],d=0;d<g;d++)c.push(h(t,d));o=c,h=Me("default")}for(d=0;d<g;f++,d++)this.set(h(o,d),f)}})),q(o.prototype,"struct",i),o;function a(t){return"object"==typeof t&&null!==t&&(t.constructor.name===ff||function(t,e){var r=typeof e;if(null===e||"object"!==r&&"function"!==r)throw new TypeError(N("invalid argument. Second argument must be either an object (except null) or a function. Value: `%s`.",e));return r=typeof t,null!==t&&("object"===r||"function"===r)&&qo.call(e,t)}(t,o.prototype))&&t.BYTES_PER_ELEMENT===e}}var lf=[],cf=[],hf="undefined"!=typeof Uint8Array?Uint8Array:Array,pf=!1;function gf(){pf=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0;e<64;++e)lf[e]=t[e],cf[t.charCodeAt(e)]=e;cf["-".charCodeAt(0)]=62,cf["_".charCodeAt(0)]=63}function yf(t,e,r){for(var n,i,o=[],a=e;a<r;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(lf[(i=n)>>18&63]+lf[i>>12&63]+lf[i>>6&63]+lf[63&i]);return o.join("")}function mf(t){var e;pf||gf();for(var r=t.length,n=r%3,i="",o=[],a=16383,u=0,f=r-n;u<f;u+=a)o.push(yf(t,u,u+a>f?f:u+a));return 1===n?(e=t[r-1],i+=lf[e>>2],i+=lf[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=lf[e>>10],i+=lf[e>>4&63],i+=lf[e<<2&63],i+="="),o.push(i),o.join("")}function df(t,e,r,n,i){var o,a,u=8*i-n-1,f=(1<<u)-1,s=f>>1,l=-7,c=r?i-1:0,h=r?-1:1,p=t[e+c];for(c+=h,o=p&(1<<-l)-1,p>>=-l,l+=u;l>0;o=256*o+t[e+c],c+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+c],c+=h,l-=8);if(0===o)o=1-s;else{if(o===f)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=s}return(p?-1:1)*a*Math.pow(2,o-n)}function vf(t,e,r,n,i,o){var a,u,f,s=8*o-i-1,l=(1<<s)-1,c=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),(e+=a+c>=1?h/f:h*Math.pow(2,1-c))*f>=2&&(a++,f/=2),a+c>=l?(u=0,a=l):a+c>=1?(u=(e*f-1)*Math.pow(2,i),a+=c):(u=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&u,p+=g,u/=256,i-=8);for(a=a<<i|u,s+=i;s>0;t[r+p]=255&a,p+=g,a/=256,s-=8);t[r+p-g]|=128*y}var bf={}.toString,wf=Array.isArray||function(t){return"[object Array]"==bf.call(t)};Tf.TYPED_ARRAY_SUPPORT=void 0===it.TYPED_ARRAY_SUPPORT||it.TYPED_ARRAY_SUPPORT;var _f=Ef();function Ef(){return Tf.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function xf(t,e){if(Ef()<e)throw new RangeError("Invalid typed array length");return Tf.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=Tf.prototype:(null===t&&(t=new Tf(e)),t.length=e),t}function Tf(t,e,r){if(!(Tf.TYPED_ARRAY_SUPPORT||this instanceof Tf))return new Tf(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return Vf(this,t)}return Af(this,t,e,r)}function Af(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);Tf.TYPED_ARRAY_SUPPORT?(t=e).__proto__=Tf.prototype:t=Sf(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!Tf.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|Lf(e,r);t=xf(t,n);var i=t.write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(Rf(e)){var r=0|jf(e.length);return 0===(t=xf(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?xf(t,0):Sf(t,e);if("Buffer"===e.type&&wf(e.data))return Sf(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function Of(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Vf(t,e){if(Of(e),t=xf(t,e<0?0:0|jf(e)),!Tf.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function Sf(t,e){var r=e.length<0?0:0|jf(e.length);t=xf(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function jf(t){if(t>=Ef())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ef().toString(16)+" bytes");return 0|t}function Rf(t){return!(null==t||!t._isBuffer)}function Lf(t,e){if(Rf(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return is(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return os(t).length;default:if(n)return is(t).length;e=(""+e).toLowerCase(),n=!0}}function If(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Gf(this,e,r);case"utf8":case"utf-8":return zf(this,e,r);case"ascii":return Wf(this,e,r);case"latin1":case"binary":return $f(this,e,r);case"base64":return Df(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Zf(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function Bf(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Ff(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=Tf.from(e,n)),Rf(e))return 0===e.length?-1:Pf(t,e,r,n,i);if("number"==typeof e)return e&=255,Tf.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Pf(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Pf(t,e,r,n,i){var o,a=1,u=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,f/=2,r/=2}function s(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=r;o<u;o++)if(s(t,o)===s(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===f)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(r+f>u&&(r=u-f),o=r;o>=0;o--){for(var c=!0,h=0;h<f;h++)if(s(t,o+h)!==s(e,h)){c=!1;break}if(c)return o}return-1}function Uf(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function Mf(t,e,r,n){return as(is(e,t.length-r),t,r,n)}function kf(t,e,r,n){return as(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function Cf(t,e,r,n){return kf(t,e,r,n)}function Nf(t,e,r,n){return as(os(e),t,r,n)}function Yf(t,e,r,n){return as(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function Df(t,e,r){return 0===e&&r===t.length?mf(t):mf(t.slice(e,r))}function zf(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,u,f,s=t[i],l=null,c=s>239?4:s>223?3:s>191?2:1;if(i+c<=r)switch(c){case 1:s<128&&(l=s);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&s)<<6|63&o)>127&&(l=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&s)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(l=f);break;case 4:o=t[i+1],a=t[i+2],u=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(f=(15&s)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&f<1114112&&(l=f)}null===l?(l=65533,c=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=c}return function(t){var e=t.length;if(e<=Jf)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Jf));return r}(n)}Tf.poolSize=8192,Tf._augment=function(t){return t.__proto__=Tf.prototype,t},Tf.from=function(t,e,r){return Af(null,t,e,r)},Tf.TYPED_ARRAY_SUPPORT&&(Tf.prototype.__proto__=Uint8Array.prototype,Tf.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Tf[Symbol.species]),Tf.alloc=function(t,e,r){return function(t,e,r,n){return Of(e),e<=0?xf(t,e):void 0!==r?"string"==typeof n?xf(t,e).fill(r,n):xf(t,e).fill(r):xf(t,e)}(null,t,e,r)},Tf.allocUnsafe=function(t){return Vf(null,t)},Tf.allocUnsafeSlow=function(t){return Vf(null,t)},Tf.isBuffer=us,Tf.compare=function(t,e){if(!Rf(t)||!Rf(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},Tf.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Tf.concat=function(t,e){if(!wf(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Tf.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=Tf.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!Rf(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},Tf.byteLength=Lf,Tf.prototype._isBuffer=!0,Tf.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)Bf(this,e,e+1);return this},Tf.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)Bf(this,e,e+3),Bf(this,e+1,e+2);return this},Tf.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)Bf(this,e,e+7),Bf(this,e+1,e+6),Bf(this,e+2,e+5),Bf(this,e+3,e+4);return this},Tf.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?zf(this,0,t):If.apply(this,arguments)},Tf.prototype.equals=function(t){if(!Rf(t))throw new TypeError("Argument must be a Buffer");return this===t||0===Tf.compare(this,t)},Tf.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},Tf.prototype.compare=function(t,e,r,n,i){if(!Rf(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(o,a),f=this.slice(n,i),s=t.slice(e,r),l=0;l<u;++l)if(f[l]!==s[l]){o=f[l],a=s[l];break}return o<a?-1:a<o?1:0},Tf.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},Tf.prototype.indexOf=function(t,e,r){return Ff(this,t,e,r,!0)},Tf.prototype.lastIndexOf=function(t,e,r){return Ff(this,t,e,r,!1)},Tf.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return Uf(this,t,e,r);case"utf8":case"utf-8":return Mf(this,t,e,r);case"ascii":return kf(this,t,e,r);case"latin1":case"binary":return Cf(this,t,e,r);case"base64":return Nf(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yf(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Tf.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Jf=4096;function Wf(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function $f(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function Gf(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=ns(t[o]);return i}function Zf(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function qf(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function Xf(t,e,r,n,i,o){if(!Rf(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function Kf(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function Hf(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function Qf(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ts(t,e,r,n,i){return i||Qf(t,0,r,4),vf(t,e,r,n,23,4),r+4}function es(t,e,r,n,i){return i||Qf(t,0,r,8),vf(t,e,r,n,52,8),r+8}Tf.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),Tf.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=Tf.prototype;else{var i=e-t;r=new Tf(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},Tf.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||qf(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},Tf.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||qf(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},Tf.prototype.readUInt8=function(t,e){return e||qf(t,1,this.length),this[t]},Tf.prototype.readUInt16LE=function(t,e){return e||qf(t,2,this.length),this[t]|this[t+1]<<8},Tf.prototype.readUInt16BE=function(t,e){return e||qf(t,2,this.length),this[t]<<8|this[t+1]},Tf.prototype.readUInt32LE=function(t,e){return e||qf(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Tf.prototype.readUInt32BE=function(t,e){return e||qf(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Tf.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||qf(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},Tf.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||qf(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},Tf.prototype.readInt8=function(t,e){return e||qf(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Tf.prototype.readInt16LE=function(t,e){e||qf(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Tf.prototype.readInt16BE=function(t,e){e||qf(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Tf.prototype.readInt32LE=function(t,e){return e||qf(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Tf.prototype.readInt32BE=function(t,e){return e||qf(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Tf.prototype.readFloatLE=function(t,e){return e||qf(t,4,this.length),df(this,t,!0,23,4)},Tf.prototype.readFloatBE=function(t,e){return e||qf(t,4,this.length),df(this,t,!1,23,4)},Tf.prototype.readDoubleLE=function(t,e){return e||qf(t,8,this.length),df(this,t,!0,52,8)},Tf.prototype.readDoubleBE=function(t,e){return e||qf(t,8,this.length),df(this,t,!1,52,8)},Tf.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||Xf(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},Tf.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||Xf(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},Tf.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||Xf(this,t,e,1,255,0),Tf.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Tf.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||Xf(this,t,e,2,65535,0),Tf.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Kf(this,t,e,!0),e+2},Tf.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||Xf(this,t,e,2,65535,0),Tf.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Kf(this,t,e,!1),e+2},Tf.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||Xf(this,t,e,4,4294967295,0),Tf.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Hf(this,t,e,!0),e+4},Tf.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||Xf(this,t,e,4,4294967295,0),Tf.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Hf(this,t,e,!1),e+4},Tf.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Xf(this,t,e,r,i-1,-i)}var o=0,a=1,u=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},Tf.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Xf(this,t,e,r,i-1,-i)}var o=r-1,a=1,u=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},Tf.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||Xf(this,t,e,1,127,-128),Tf.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},Tf.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||Xf(this,t,e,2,32767,-32768),Tf.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Kf(this,t,e,!0),e+2},Tf.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||Xf(this,t,e,2,32767,-32768),Tf.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Kf(this,t,e,!1),e+2},Tf.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||Xf(this,t,e,4,2147483647,-2147483648),Tf.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Hf(this,t,e,!0),e+4},Tf.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||Xf(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Tf.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Hf(this,t,e,!1),e+4},Tf.prototype.writeFloatLE=function(t,e,r){return ts(this,t,e,!0,r)},Tf.prototype.writeFloatBE=function(t,e,r){return ts(this,t,e,!1,r)},Tf.prototype.writeDoubleLE=function(t,e,r){return es(this,t,e,!0,r)},Tf.prototype.writeDoubleBE=function(t,e,r){return es(this,t,e,!1,r)},Tf.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!Tf.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},Tf.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Tf.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=Rf(t)?t:is(new Tf(t,n).toString()),u=a.length;for(o=0;o<r-e;++o)this[o+e]=a[o%u]}return this};var rs=/[^+\/0-9A-Za-z-_]/g;function ns(t){return t<16?"0"+t.toString(16):t.toString(16)}function is(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function os(t){return function(t){var e,r,n,i,o,a;pf||gf();var u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[u-2]?2:"="===t[u-1]?1:0,a=new hf(3*u/4-o),n=o>0?u-4:u;var f=0;for(e=0,r=0;e<n;e+=4,r+=3)i=cf[t.charCodeAt(e)]<<18|cf[t.charCodeAt(e+1)]<<12|cf[t.charCodeAt(e+2)]<<6|cf[t.charCodeAt(e+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=255&i;return 2===o?(i=cf[t.charCodeAt(e)]<<2|cf[t.charCodeAt(e+1)]>>4,a[f++]=255&i):1===o&&(i=cf[t.charCodeAt(e)]<<10|cf[t.charCodeAt(e+1)]<<4|cf[t.charCodeAt(e+2)]>>2,a[f++]=i>>8&255,a[f++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(rs,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function as(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function us(t){return null!=t&&(!!t._isBuffer||fs(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&fs(t.slice(0,0))}(t))}function fs(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var ss=Object.freeze({__proto__:null,Buffer:Tf,INSPECT_MAX_BYTES:50,SlowBuffer:function(t){return+t!=t&&(t=0),Tf.alloc(+t)},isBuffer:us,kMaxLength:_f}),ls=Tf;function cs(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var r=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})})),r}var hs,ps=cs(ss).Buffer;hs=function(){var t,e;if("function"!=typeof ls)return!1;try{t=yt(e="function"==typeof ls.from?ls.from([1,2,3,4]):new ls([1,2,3,4]))&&1===e[0]&&2===e[1]&&3===e[2]&&4===e[3]}catch(e){t=!1}return t}()?ps:function(){throw new Error("not implemented")};var gs=hs;function ys(){throw new Error("not implemented")}var ms={binary:gs,float64:qe,float32:tr,float16:ys,generic:Array,int16:Ar,int32:hr,int8:zr,uint16:vr,uint32:or,uint8:Lr,uint8c:Ur,complex32:ys,complex64:En,complex128:Ln,bool:Mn},ds={};function vs(t){var e,r,n;return!vt(t)&&(n=Xi(t),r=ms[n]||null)?r:Qi(t)?(n?e=t.value:n=(e=t).layout,(r=ds[n])||(r=sf(e),ds[n]=r),r):null}var bs=vt(gs.allocUnsafe)?function(t){if(!Dt(t))throw new TypeError(N("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));return gs.allocUnsafe(t)}:function(t){if(!Dt(t))throw new TypeError(N("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));return new gs(t)};function ws(t){return function(t,e,r,n){var i;return function(t,e){return"function"==typeof t["fill"]}(t)?t.fill(e,r,n):(r<0&&(r+=t.length)<0&&(r=0),n<0?n+=t.length:n>t.length&&(n=t.length),(i=Dn(t)).accessorProtocol?function(t,e,r,n){var i,o,a;for(i=t.data,o=t.accessors[1],a=r;a<n;a++)o(i,a,e);return i}(i,e,r,n):function(t,e,r,n){var i;for(i=r;i<n;i++)t[i]=e;return t}(t,e,r,n))}(bs(t),0,0,t)}function _s(t,e){var r=Xi(t);return"generic"===r?yu(e):"binary"===r?ws(e):function(t,e){var r=vs(t);return r?new r(e):null}(t,e)}var Es={Buffer:"binary",Float16Array:"float16",Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Object:"generic",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex32Array:"complex32",Complex64Array:"complex64",Complex128Array:"complex128",BooleanArray:"bool"};function xs(){throw new Error("not implemented")}var Ts=[qe,tr,xs,hr,or,Ar,vr,zr,Lr,Ur,xs,En,Ln,Mn],As=["float64","float32","float16","int32","uint32","int16","uint16","int8","uint8","uint8c","complex32","complex64","complex128","bool"],Os=As.length;function Vs(t){return Di(t)||((e=t)instanceof Ki||"object"==typeof e&&null!==e&&Mt(e.alignment)&&Mt(e.byteLength)&&$t(e.byteOrder)&&$t(e.char)&&Mt(e.enum)&&zi(e,"value"))||Qi(t);var e}function Ss(t){var e,r,n,i;if("object"!=typeof t||null===t)throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t));if(!de(r=t.shape))throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t));for(e=[],i=0;i<r.length;i++){if(!Nt(n=r[i]))throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t));e.push(n)}return e}function js(t){var e,r,n,i,o,a;if("object"!=typeof t||null===t)throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t));if(!de(i=t.strides)){if(!de(n=t.shape))throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t));return 0===n.length?[0]:(r=t.order,ro(r)||(r="row-major"),bo(n,r))}for(e=[],a=0;a<i.length;a++){if(!Mt(o=i[a]))throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t));e.push(o)}return e}var Rs="row-major",Ls="column-major";function Is(t){var e;if("object"!=typeof t||null===t)throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t));return e=t.order,ro(e)?e:1===(e=Be(js(t)))||3===e?Rs:2===e?Ls:0===function(t){var e,r;if("object"!=typeof t||null===t)throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t));if(Nt(r=t.ndims))return r;if(!de(e=t.shape))throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t));return e.length}(t)?Rs:null}function Bs(t,e){var r=e[0];return Wr(r)&&(t.push(r.length),Bs(t,r)),t}function Fs(t,e,r,n,i){var o,a,u;for(o=e[r],u=0;u<n.length;u++){if(!Wr(a=n[u])||a.length!==o)return r;if(i&&(a=Fs(t,e,r+1,a,r+1<t-1))<t)return a}return t}function Ps(t){var e,r;if(!Wr(t))throw new TypeError(N("invalid argument. Must provide an array-like object. Value: `%s`.",t));return Bs(e=[t.length],t),(r=e.length)>1&&(e.length=Fs(r,e,1,t,r>2)),e}function Us(t,e,r,n,i,o){var a,u,f,s,l;for(a=t.length,u=1,l=0;l<a;l++)u*=t[l];if("clamp"===o)i<0?i=0:i>=u&&(i=u-1);else if("wrap"===o)i<0?(i+=u)<0&&0!==(i%=u)&&(i+=u):i>=u&&(i-=u)>=u&&(i%=u);else if("normalize"===o&&i<0&&(i+=u),i<0||i>=u)throw new RangeError(N("invalid argument. Linear index must not exceed array dimensions. Number of array elements: `%u`. Value: `%d`.",u,i));if(f=r,Zn(n)){for(l=0;l<a;l++)i-=s=i%t[l],i/=t[l],f+=s*e[l];return f}for(l=a-1;l>=0;l--)i-=s=i%t[l],i/=t[l],f+=s*e[l];return f}var Ms=3;function ks(t,e,r,n){var i,o,a,u,f,s,l;if(t<=0)return e;if((u=Dn(e)).accessorProtocol)return function(t,e,r,n){var i,o,a,u,f,s,l,c;for(i=e.data,a=e.accessors[0],o=e.accessors[1],l=Ft(t/2),s=(f=n)+(t-1)*r,c=0;c<l;c++)u=a(i,f),o(i,f,a(i,s)),o(i,s,u),f+=r,s-=r}(t,u,r,n),u.data;if(s=Ft(t/2),o=n,1===r){if(a=o+t-1,(f=s%Ms)>0)for(l=0;l<f;l++)i=e[o],e[o]=e[a],e[a]=i,o+=r,a-=r;if(s<Ms)return e;for(l=f;l<s;l+=Ms)i=e[o],e[o]=e[a],e[a]=i,i=e[o+1],e[o+1]=e[a-1],e[a-1]=i,i=e[o+2],e[o+2]=e[a-2],e[a-2]=i,o+=Ms,a-=Ms;return e}for(a=o+(t-1)*r,l=0;l<s;l++)i=e[o],e[o]=e[a],e[a]=i,o+=r,a-=r;return e}function Cs(t,e,r){return ks(t,e,r,cu(t,r))}q(Cs,"ndarray",ks);var Ns="throw";function Ys(t,e,r,n,i){var o;for(o=0;o<e;o++)r[i]=t[o],i+=n}function Ds(t,e,r,n,i,o,a){var u,f,s,l;for(u=(s=n+1)===e,f=r[n],l=0;l<f;l++)u?(i[a]=t[l],a+=o):a=Ds(t[l],e,r,s,i,o,a);return a}function zs(t,e,r,n,i,o){var a=e.length;return 0===a?n:1===a?(Ys(t,e[0],n,i,o),n):r?(function(t,e,r,n,i,o){var a,u,f,s,l,c,h;for(Ds(t,e,r,0,u=yu(a=_o(r)),1,0),l=bo(r,f="row-major"),Ys(r,e,s=yu(e),1,0),Cs(e,s,1),Cs(e,l,1),h=0;h<a;h++)c=Us(s,l,0,f,h,Ns),n[o]=u[c],o+=i}(t,a,e,n,i,o),n):(Ds(t,a,e,0,n,i,o),n)}function Js(t,e,r){return zs(t,e,r,yu(_o(e)),1,0)}function Ws(){var t,e=arguments,r="https://stdlib.io/e/"+e[0]+"?";for(t=1;t<e.length;t++)r+="&arg[]="+encodeURIComponent(e[t]);return r}function $s(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&Pt(t.length)&&t.length>=0&&t.length<It}function Gs(t,e,r){var n,i,o,a,u,f;if(n=Fu(t),to(r,"generic")){for(o=[],a=0;a<e;a++)o.push(n(t,a));return o}if(to(r,"binary")){for(o=bs(e),a=0;a<e;a++)o[a]=n(t,a);return o}for(o=new(vs(r))(e),f=Yn(u=o),i=Pe(u)?ze(f):Ce(f),a=0;a<e;a++)i(o,a,n(t,a));return o}q(Js,"assign",zs);var Zs=ki(Yi("complex_floating_point"));var qs=ki(Yi("real"));var Xs=8,Ks=16;function Hs(t){return"object"==typeof t&&null!==t&&("Complex128Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===Ks||"Complex64Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===Xs)}var Qs=1;function tl(t){return"object"==typeof t&&null!==t&&"BooleanArray"===t.constructor.name&&t.BYTES_PER_ELEMENT===Qs}var el="number";function rl(t){var e,r,n;for(r=t.length,e=[],n=0;n<r;n++)e.push(t[n]);return e}var nl="row-major";function il(t,e){var r,n,i;return"object"!=typeof(i=t.strides)||null===i?0===(n=t.shape).length?[0]:($t(r=t.order)||(r=nl),bo(n,r)):e?rl(i):i}function ol(t){var e,r,n;return Ot(n=t.offset)?n:0===(r=t.shape).length||"object"!=typeof(e=t.strides)||null===e?0:wo(r,e)}var al="row-major",ul="column-major";function fl(t){var e,r;return $t(r=t.order)?r:"object"!=typeof(e=t.strides)||null===e||1===(r=Be(e))||3===r?al:2===r?ul:0===t.shape.length?al:null}function sl(t){var e,r,n,i;return e=function(t){return t.data}(t),n=function(t,e){var r=t.shape;return e?rl(r):r}(t,!0),i=function(t){return t.dtype}(t),r=Pe(e),{ref:t,dtype:i,data:e,length:_o(n),shape:n,strides:il(t,!0),offset:ol(t),order:fl(t),accessorProtocol:r,accessors:r?[Ye(i),ze(i)]:[Me(i),Ce(i)]}}var ll=5;var cl=5;function hl(t,e,r,n,i){var o,a,u,f;if(t<=0||1===e)return r;if((u=Dn(r)).accessorProtocol)return function(t,e,r,n,i){var o,a,u,f,s,l;if(o=r.data,a=r.accessors[0],u=r.accessors[1],f=i,0===n)return u(o,f,a(o,f)*t*e),r;if(1===n){if((s=t%ll)>0)for(l=0;l<s;l++)u(o,f,a(o,f)*e),f+=n;if(t<ll)return r;for(l=s;l<t;l+=ll)u(o,f,a(o,f)*e),u(o,f+1,a(o,f+1)*e),u(o,f+2,a(o,f+2)*e),u(o,f+3,a(o,f+3)*e),u(o,f+4,a(o,f+4)*e),f+=ll;return r}for(l=0;l<t;l++)u(o,f,a(o,f)*e),f+=n}(t,e,u,n,i),r;if(o=i,0===n)return r[o]*=e*t,r;if(1===n){if((a=t%cl)>0)for(f=0;f<a;f++)r[o]*=e,o+=n;if(t<cl)return r;for(f=a;f<t;f+=cl)r[o]*=e,r[o+1]*=e,r[o+2]*=e,r[o+3]*=e,r[o+4]*=e,o+=cl;return r}for(f=0;f<t;f++)r[o]*=e,o+=n;return r}function pl(t,e,r,n){return hl(t,e,r,n,cu(t,n))}function gl(t){var e,r;if(e=[],t<=0)return e;for(r=0;r<t;r++)e.push(r);return e}function yl(t,e,r,n){var i,o,a;for(o=2*r,a=2*n,i=0;a>=0&&a<e.length;)e[a]=i,e[a+1]=0,a+=o,i+=1;return t}function ml(t,e){var r,n;for(r=[],n=0;n<e.length;n++)r.push(t[e[n]]);return r}function dl(t,e,r){var n;return n=gl(t.length),function(t,e){var r,n,i,o,a,u,f,s,l;for(n=1,i=1,l=1;l<t.length;l++){for(r=(u=t[n])<0?-u:u,f=e[i],o=n-1,a=i-1;o>=0&&!(((s=t[o])<0?-s:s)<=r);)t[o+1]=s,e[a+1]=e[a],o-=1,a-=1;t[o+1]=u,e[a+1]=f,n+=1,i+=1}}(e=rl(e),n),{sh:t=ml(t,n),sx:e,sy:r=ml(r,n),idx:n}}q(pl,"ndarray",hl),q(gl,"assign",(function(t,e,r){var n=Dn(t);return n.accessorProtocol?"complex128"===n.dtype?yl(t,yn(t,0),e,r):"complex64"===n.dtype?yl(t,gn(t,0),e,r):function(t,e,r){var n,i,o,a;for(n=t.data,i=t.accessors[1],a=r,o=0;a>=0&&a<n.length;)i(n,a,o),a+=e,o+=1;return n}(n,e,r):function(t,e,r){var n,i;for(i=r,n=0;i>=0&&i<t.length;)t[i]=n,i+=e,n+=1;return t}(t,e,r)}));var vl={BLOCK_SIZE_IN_BYTES:64,BLOCK_SIZE_IN_ELEMENTS:8};function bl(t,e){return function(t){var e,r,n,i;if((r=t.length)<=0)return vl.BLOCK_SIZE_IN_ELEMENTS;if(null===(e=Re(t[0])))return vl.BLOCK_SIZE_IN_ELEMENTS;for(i=1;i<r;i++){if(null===(n=Re(t[i])))return vl.BLOCK_SIZE_IN_ELEMENTS;n>e&&(e=n)}return(n=vl.BLOCK_SIZE_IN_BYTES/e|0)>0?n:1}([t,e])}var wl="throw";var _l="throw";var El=[function(t,e){e.data[e.offset]=t.data[t.offset]},function(t,e){var r,n,i,o,a,u,f,s;for(a=t.shape[0],i=t.strides[0],o=e.strides[0],u=t.offset,f=e.offset,r=t.data,n=e.data,s=0;s<a;s++)n[f]=r[u],u+=i,f+=o},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d;for(s=t.shape,h=t.strides,p=e.strides,r?(l=s[1],c=s[0],o=h[1],a=h[0]-l*h[1],u=p[1],f=p[0]-l*p[1]):(l=s[0],c=s[1],o=h[0],a=h[1]-l*h[0],u=p[0],f=p[1]-l*p[0]),g=t.offset,y=e.offset,n=t.data,i=e.data,d=0;d<c;d++){for(m=0;m<l;m++)i[y]=n[g],g+=o,y+=u;g+=a,y+=f}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_;for(c=t.shape,y=t.strides,m=e.strides,r?(h=c[2],p=c[1],g=c[0],o=y[2],a=y[1]-h*y[2],u=y[0]-p*y[1],f=m[2],s=m[1]-h*m[2],l=m[0]-p*m[1]):(h=c[0],p=c[1],g=c[2],o=y[0],a=y[1]-h*y[0],u=y[2]-p*y[1],f=m[0],s=m[1]-h*m[0],l=m[2]-p*m[1]),d=t.offset,v=e.offset,n=t.data,i=e.data,_=0;_<g;_++){for(w=0;w<p;w++){for(b=0;b<h;b++)i[v]=n[d],d+=o,v+=f;d+=a,v+=s}d+=u,v+=l}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A;for(p=t.shape,v=t.strides,b=e.strides,r?(g=p[3],y=p[2],m=p[1],d=p[0],o=v[3],a=v[2]-g*v[3],u=v[1]-y*v[2],f=v[0]-m*v[1],s=b[3],l=b[2]-g*b[3],c=b[1]-y*b[2],h=b[0]-m*b[1]):(g=p[0],y=p[1],m=p[2],d=p[3],o=v[0],a=v[1]-g*v[0],u=v[2]-y*v[1],f=v[3]-m*v[2],s=b[0],l=b[1]-g*b[0],c=b[2]-y*b[1],h=b[3]-m*b[2]),w=t.offset,_=e.offset,n=t.data,i=e.data,A=0;A<d;A++){for(T=0;T<m;T++){for(x=0;x<y;x++){for(E=0;E<g;E++)i[_]=n[w],w+=o,_+=s;w+=a,_+=l}w+=u,_+=c}w+=f,_+=h}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j;for(y=t.shape,_=t.strides,E=e.strides,r?(m=y[4],d=y[3],v=y[2],b=y[1],w=y[0],o=_[4],a=_[3]-m*_[4],u=_[2]-d*_[3],f=_[1]-v*_[2],s=_[0]-b*_[1],l=E[4],c=E[3]-m*E[4],h=E[2]-d*E[3],p=E[1]-v*E[2],g=E[0]-b*E[1]):(m=y[0],d=y[1],v=y[2],b=y[3],w=y[4],o=_[0],a=_[1]-m*_[0],u=_[2]-d*_[1],f=_[3]-v*_[2],s=_[4]-b*_[3],l=E[0],c=E[1]-m*E[0],h=E[2]-d*E[1],p=E[3]-v*E[2],g=E[4]-b*E[3]),x=t.offset,T=e.offset,n=t.data,i=e.data,j=0;j<w;j++){for(S=0;S<b;S++){for(V=0;V<v;V++){for(O=0;O<d;O++){for(A=0;A<m;A++)i[T]=n[x],x+=o,T+=l;x+=a,T+=c}x+=u,T+=h}x+=f,T+=p}x+=s,T+=g}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B;for(d=t.shape,T=t.strides,A=e.strides,r?(v=d[5],b=d[4],w=d[3],_=d[2],E=d[1],x=d[0],o=T[5],a=T[4]-v*T[5],u=T[3]-b*T[4],f=T[2]-w*T[3],s=T[1]-_*T[2],l=T[0]-E*T[1],c=A[5],h=A[4]-v*A[5],p=A[3]-b*A[4],g=A[2]-w*A[3],y=A[1]-_*A[2],m=A[0]-E*A[1]):(v=d[0],b=d[1],w=d[2],_=d[3],E=d[4],x=d[5],o=T[0],a=T[1]-v*T[0],u=T[2]-b*T[1],f=T[3]-w*T[2],s=T[4]-_*T[3],l=T[5]-E*T[4],c=A[0],h=A[1]-v*A[0],p=A[2]-b*A[1],g=A[3]-w*A[2],y=A[4]-_*A[3],m=A[5]-E*A[4]),O=t.offset,V=e.offset,n=t.data,i=e.data,B=0;B<x;B++){for(I=0;I<E;I++){for(L=0;L<_;L++){for(R=0;R<w;R++){for(j=0;j<b;j++){for(S=0;S<v;S++)i[V]=n[O],O+=o,V+=c;O+=a,V+=h}O+=u,V+=p}O+=f,V+=g}O+=s,V+=y}O+=l,V+=m}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M;for(b=t.shape,V=t.strides,S=e.strides,r?(w=b[6],_=b[5],E=b[4],x=b[3],T=b[2],A=b[1],O=b[0],o=V[6],a=V[5]-w*V[6],u=V[4]-_*V[5],f=V[3]-E*V[4],s=V[2]-x*V[3],l=V[1]-T*V[2],c=V[0]-A*V[1],h=S[6],p=S[5]-w*S[6],g=S[4]-_*S[5],y=S[3]-E*S[4],m=S[2]-x*S[3],d=S[1]-T*S[2],v=S[0]-A*S[1]):(w=b[0],_=b[1],E=b[2],x=b[3],T=b[4],A=b[5],O=b[6],o=V[0],a=V[1]-w*V[0],u=V[2]-_*V[1],f=V[3]-E*V[2],s=V[4]-x*V[3],l=V[5]-T*V[4],c=V[6]-A*V[5],h=S[0],p=S[1]-w*S[0],g=S[2]-_*S[1],y=S[3]-E*S[2],m=S[4]-x*S[3],d=S[5]-T*S[4],v=S[6]-A*S[5]),j=t.offset,R=e.offset,n=t.data,i=e.data,M=0;M<O;M++){for(U=0;U<A;U++){for(P=0;P<T;P++){for(F=0;F<x;F++){for(B=0;B<E;B++){for(I=0;I<_;I++){for(L=0;L<w;L++)i[R]=n[j],j+=o,R+=h;j+=a,R+=p}j+=u,R+=g}j+=f,R+=y}j+=s,R+=m}j+=l,R+=d}j+=c,R+=v}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y;for(_=t.shape,R=t.strides,L=e.strides,r?(E=_[7],x=_[6],T=_[5],A=_[4],O=_[3],V=_[2],S=_[1],j=_[0],o=R[7],a=R[6]-E*R[7],u=R[5]-x*R[6],f=R[4]-T*R[5],s=R[3]-A*R[4],l=R[2]-O*R[3],c=R[1]-V*R[2],h=R[0]-S*R[1],p=L[7],g=L[6]-E*L[7],y=L[5]-x*L[6],m=L[4]-T*L[5],d=L[3]-A*L[4],v=L[2]-O*L[3],b=L[1]-V*L[2],w=L[0]-S*L[1]):(E=_[0],x=_[1],T=_[2],A=_[3],O=_[4],V=_[5],S=_[6],j=_[7],o=R[0],a=R[1]-E*R[0],u=R[2]-x*R[1],f=R[3]-T*R[2],s=R[4]-A*R[3],l=R[5]-O*R[4],c=R[6]-V*R[5],h=R[7]-S*R[6],p=L[0],g=L[1]-E*L[0],y=L[2]-x*L[1],m=L[3]-T*L[2],d=L[4]-A*L[3],v=L[5]-O*L[4],b=L[6]-V*L[5],w=L[7]-S*L[6]),I=t.offset,B=e.offset,n=t.data,i=e.data,Y=0;Y<j;Y++){for(N=0;N<S;N++){for(C=0;C<V;C++){for(k=0;k<O;k++){for(M=0;M<A;M++){for(U=0;U<T;U++){for(P=0;P<x;P++){for(F=0;F<E;F++)i[B]=n[I],I+=o,B+=p;I+=a,B+=g}I+=u,B+=y}I+=f,B+=m}I+=s,B+=d}I+=l,B+=v}I+=c,B+=b}I+=h,B+=w}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W;for(x=t.shape,B=t.strides,F=e.strides,r?(T=x[8],A=x[7],O=x[6],V=x[5],S=x[4],j=x[3],R=x[2],L=x[1],I=x[0],o=B[8],a=B[7]-T*B[8],u=B[6]-A*B[7],f=B[5]-O*B[6],s=B[4]-V*B[5],l=B[3]-S*B[4],c=B[2]-j*B[3],h=B[1]-R*B[2],p=B[0]-L*B[1],g=F[8],y=F[7]-T*F[8],m=F[6]-A*F[7],d=F[5]-O*F[6],v=F[4]-V*F[5],b=F[3]-S*F[4],w=F[2]-j*F[3],_=F[1]-R*F[2],E=F[0]-L*F[1]):(T=x[0],A=x[1],O=x[2],V=x[3],S=x[4],j=x[5],R=x[6],L=x[7],I=x[8],o=B[0],a=B[1]-T*B[0],u=B[2]-A*B[1],f=B[3]-O*B[2],s=B[4]-V*B[3],l=B[5]-S*B[4],c=B[6]-j*B[5],h=B[7]-R*B[6],p=B[8]-L*B[7],g=F[0],y=F[1]-T*F[0],m=F[2]-A*F[1],d=F[3]-O*F[2],v=F[4]-V*F[3],b=F[5]-S*F[4],w=F[6]-j*F[5],_=F[7]-R*F[6],E=F[8]-L*F[7]),P=t.offset,U=e.offset,n=t.data,i=e.data,W=0;W<I;W++){for(J=0;J<L;J++){for(z=0;z<R;z++){for(D=0;D<j;D++){for(Y=0;Y<S;Y++){for(N=0;N<V;N++){for(C=0;C<O;C++){for(k=0;k<A;k++){for(M=0;M<T;M++)i[U]=n[P],P+=o,U+=g;P+=a,U+=y}P+=u,U+=m}P+=f,U+=d}P+=s,U+=v}P+=l,U+=b}P+=c,U+=w}P+=h,U+=_}P+=p,U+=E}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G,Z,q;for(A=t.shape,U=t.strides,M=e.strides,r?(O=A[9],V=A[8],S=A[7],j=A[6],R=A[5],L=A[4],I=A[3],B=A[2],F=A[1],P=A[0],o=U[9],a=U[8]-O*U[9],u=U[7]-V*U[8],f=U[6]-S*U[7],s=U[5]-j*U[6],l=U[4]-R*U[5],c=U[3]-L*U[4],h=U[2]-I*U[3],p=U[1]-B*U[2],g=U[0]-F*U[1],y=M[9],m=M[8]-O*M[9],d=M[7]-V*M[8],v=M[6]-S*M[7],b=M[5]-j*M[6],w=M[4]-R*M[5],_=M[3]-L*M[4],E=M[2]-I*M[3],x=M[1]-B*M[2],T=M[0]-F*M[1]):(O=A[0],V=A[1],S=A[2],j=A[3],R=A[4],L=A[5],I=A[6],B=A[7],F=A[8],P=A[9],o=U[0],a=U[1]-O*U[0],u=U[2]-V*U[1],f=U[3]-S*U[2],s=U[4]-j*U[3],l=U[5]-R*U[4],c=U[6]-L*U[5],h=U[7]-I*U[6],p=U[8]-B*U[7],g=U[9]-F*U[8],y=M[0],m=M[1]-O*M[0],d=M[2]-V*M[1],v=M[3]-S*M[2],b=M[4]-j*M[3],w=M[5]-R*M[4],_=M[6]-L*M[5],E=M[7]-I*M[6],x=M[8]-B*M[7],T=M[9]-F*M[8]),k=t.offset,C=e.offset,n=t.data,i=e.data,q=0;q<P;q++){for(Z=0;Z<F;Z++){for(G=0;G<B;G++){for($=0;$<I;$++){for(W=0;W<L;W++){for(J=0;J<R;J++){for(z=0;z<j;z++){for(D=0;D<S;D++){for(Y=0;Y<V;Y++){for(N=0;N<O;N++)i[C]=n[k],k+=o,C+=y;k+=a,C+=m}k+=u,C+=d}k+=f,C+=v}k+=s,C+=b}k+=l,C+=w}k+=c,C+=_}k+=h,C+=E}k+=p,C+=x}k+=g,C+=T}}],xl=[function(t,e){e.accessors[1](e.data,e.offset,t.accessors[0](t.data,t.offset))},function(t,e){var r,n,i,o,a,u,f,s,l,c;for(f=t.shape[0],a=t.strides[0],u=e.strides[0],s=t.offset,l=e.offset,r=t.data,n=e.data,i=t.accessors[0],o=e.accessors[1],c=0;c<f;c++)o(n,l,i(r,s)),s+=a,l+=u},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b;for(c=t.shape,g=t.strides,y=e.strides,r?(h=c[1],p=c[0],u=g[1],f=g[0]-h*g[1],s=y[1],l=y[0]-h*y[1]):(h=c[0],p=c[1],u=g[0],f=g[1]-h*g[0],s=y[0],l=y[1]-h*y[0]),m=t.offset,d=e.offset,n=t.data,i=e.data,o=t.accessors[0],a=e.accessors[1],b=0;b<p;b++){for(v=0;v<h;v++)a(i,d,o(n,m)),m+=u,d+=s;m+=f,d+=l}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x;for(p=t.shape,d=t.strides,v=e.strides,r?(g=p[2],y=p[1],m=p[0],u=d[2],f=d[1]-g*d[2],s=d[0]-y*d[1],l=v[2],c=v[1]-g*v[2],h=v[0]-y*v[1]):(g=p[0],y=p[1],m=p[2],u=d[0],f=d[1]-g*d[0],s=d[2]-y*d[1],l=v[0],c=v[1]-g*v[0],h=v[2]-y*v[1]),b=t.offset,w=e.offset,n=t.data,i=e.data,o=t.accessors[0],a=e.accessors[1],x=0;x<m;x++){for(E=0;E<y;E++){for(_=0;_<g;_++)a(i,w,o(n,b)),b+=u,w+=l;b+=f,w+=c}b+=s,w+=h}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V;for(y=t.shape,w=t.strides,_=e.strides,r?(m=y[3],d=y[2],v=y[1],b=y[0],u=w[3],f=w[2]-m*w[3],s=w[1]-d*w[2],l=w[0]-v*w[1],c=_[3],h=_[2]-m*_[3],p=_[1]-d*_[2],g=_[0]-v*_[1]):(m=y[0],d=y[1],v=y[2],b=y[3],u=w[0],f=w[1]-m*w[0],s=w[2]-d*w[1],l=w[3]-v*w[2],c=_[0],h=_[1]-m*_[0],p=_[2]-d*_[1],g=_[3]-v*_[2]),E=t.offset,x=e.offset,n=t.data,i=e.data,o=t.accessors[0],a=e.accessors[1],V=0;V<b;V++){for(O=0;O<v;O++){for(A=0;A<d;A++){for(T=0;T<m;T++)a(i,x,o(n,E)),E+=u,x+=c;E+=f,x+=h}E+=s,x+=p}E+=l,x+=g}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L;for(d=t.shape,x=t.strides,T=e.strides,r?(v=d[4],b=d[3],w=d[2],_=d[1],E=d[0],u=x[4],f=x[3]-v*x[4],s=x[2]-b*x[3],l=x[1]-w*x[2],c=x[0]-_*x[1],h=T[4],p=T[3]-v*T[4],g=T[2]-b*T[3],y=T[1]-w*T[2],m=T[0]-_*T[1]):(v=d[0],b=d[1],w=d[2],_=d[3],E=d[4],u=x[0],f=x[1]-v*x[0],s=x[2]-b*x[1],l=x[3]-w*x[2],c=x[4]-_*x[3],h=T[0],p=T[1]-v*T[0],g=T[2]-b*T[1],y=T[3]-w*T[2],m=T[4]-_*T[3]),A=t.offset,O=e.offset,n=t.data,i=e.data,o=t.accessors[0],a=e.accessors[1],L=0;L<E;L++){for(R=0;R<_;R++){for(j=0;j<w;j++){for(S=0;S<b;S++){for(V=0;V<v;V++)a(i,O,o(n,A)),A+=u,O+=h;A+=f,O+=p}A+=s,O+=g}A+=l,O+=y}A+=c,O+=m}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P;for(b=t.shape,O=t.strides,V=e.strides,r?(w=b[5],_=b[4],E=b[3],x=b[2],T=b[1],A=b[0],u=O[5],f=O[4]-w*O[5],s=O[3]-_*O[4],l=O[2]-E*O[3],c=O[1]-x*O[2],h=O[0]-T*O[1],p=V[5],g=V[4]-w*V[5],y=V[3]-_*V[4],m=V[2]-E*V[3],d=V[1]-x*V[2],v=V[0]-T*V[1]):(w=b[0],_=b[1],E=b[2],x=b[3],T=b[4],A=b[5],u=O[0],f=O[1]-w*O[0],s=O[2]-_*O[1],l=O[3]-E*O[2],c=O[4]-x*O[3],h=O[5]-T*O[4],p=V[0],g=V[1]-w*V[0],y=V[2]-_*V[1],m=V[3]-E*V[2],d=V[4]-x*V[3],v=V[5]-T*V[4]),S=t.offset,j=e.offset,n=t.data,i=e.data,o=t.accessors[0],a=e.accessors[1],P=0;P<A;P++){for(F=0;F<T;F++){for(B=0;B<x;B++){for(I=0;I<E;I++){for(L=0;L<_;L++){for(R=0;R<w;R++)a(i,j,o(n,S)),S+=u,j+=p;S+=f,j+=g}S+=s,j+=y}S+=l,j+=m}S+=c,j+=d}S+=h,j+=v}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C;for(_=t.shape,j=t.strides,R=e.strides,r?(E=_[6],x=_[5],T=_[4],A=_[3],O=_[2],V=_[1],S=_[0],u=j[6],f=j[5]-E*j[6],s=j[4]-x*j[5],l=j[3]-T*j[4],c=j[2]-A*j[3],h=j[1]-O*j[2],p=j[0]-V*j[1],g=R[6],y=R[5]-E*R[6],m=R[4]-x*R[5],d=R[3]-T*R[4],v=R[2]-A*R[3],b=R[1]-O*R[2],w=R[0]-V*R[1]):(E=_[0],x=_[1],T=_[2],A=_[3],O=_[4],V=_[5],S=_[6],u=j[0],f=j[1]-E*j[0],s=j[2]-x*j[1],l=j[3]-T*j[2],c=j[4]-A*j[3],h=j[5]-O*j[4],p=j[6]-V*j[5],g=R[0],y=R[1]-E*R[0],m=R[2]-x*R[1],d=R[3]-T*R[2],v=R[4]-A*R[3],b=R[5]-O*R[4],w=R[6]-V*R[5]),L=t.offset,I=e.offset,n=t.data,i=e.data,o=t.accessors[0],a=e.accessors[1],C=0;C<S;C++){for(k=0;k<V;k++){for(M=0;M<O;M++){for(U=0;U<A;U++){for(P=0;P<T;P++){for(F=0;F<x;F++){for(B=0;B<E;B++)a(i,I,o(n,L)),L+=u,I+=g;L+=f,I+=y}L+=s,I+=m}L+=l,I+=d}L+=c,I+=v}L+=h,I+=b}L+=p,I+=w}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z;for(x=t.shape,I=t.strides,B=e.strides,r?(T=x[7],A=x[6],O=x[5],V=x[4],S=x[3],j=x[2],R=x[1],L=x[0],u=I[7],f=I[6]-T*I[7],s=I[5]-A*I[6],l=I[4]-O*I[5],c=I[3]-V*I[4],h=I[2]-S*I[3],p=I[1]-j*I[2],g=I[0]-R*I[1],y=B[7],m=B[6]-T*B[7],d=B[5]-A*B[6],v=B[4]-O*B[5],b=B[3]-V*B[4],w=B[2]-S*B[3],_=B[1]-j*B[2],E=B[0]-R*B[1]):(T=x[0],A=x[1],O=x[2],V=x[3],S=x[4],j=x[5],R=x[6],L=x[7],u=I[0],f=I[1]-T*I[0],s=I[2]-A*I[1],l=I[3]-O*I[2],c=I[4]-V*I[3],h=I[5]-S*I[4],p=I[6]-j*I[5],g=I[7]-R*I[6],y=B[0],m=B[1]-T*B[0],d=B[2]-A*B[1],v=B[3]-O*B[2],b=B[4]-V*B[3],w=B[5]-S*B[4],_=B[6]-j*B[5],E=B[7]-R*B[6]),F=t.offset,P=e.offset,n=t.data,i=e.data,o=t.accessors[0],a=e.accessors[1],z=0;z<L;z++){for(D=0;D<R;D++){for(Y=0;Y<j;Y++){for(N=0;N<S;N++){for(C=0;C<V;C++){for(k=0;k<O;k++){for(M=0;M<A;M++){for(U=0;U<T;U++)a(i,P,o(n,F)),F+=u,P+=y;F+=f,P+=m}F+=s,P+=d}F+=l,P+=v}F+=c,P+=b}F+=h,P+=w}F+=p,P+=_}F+=g,P+=E}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G;for(A=t.shape,P=t.strides,U=e.strides,r?(O=A[8],V=A[7],S=A[6],j=A[5],R=A[4],L=A[3],I=A[2],B=A[1],F=A[0],u=P[8],f=P[7]-O*P[8],s=P[6]-V*P[7],l=P[5]-S*P[6],c=P[4]-j*P[5],h=P[3]-R*P[4],p=P[2]-L*P[3],g=P[1]-I*P[2],y=P[0]-B*P[1],m=U[8],d=U[7]-O*U[8],v=U[6]-V*U[7],b=U[5]-S*U[6],w=U[4]-j*U[5],_=U[3]-R*U[4],E=U[2]-L*U[3],x=U[1]-I*U[2],T=U[0]-B*U[1]):(O=A[0],V=A[1],S=A[2],j=A[3],R=A[4],L=A[5],I=A[6],B=A[7],F=A[8],u=P[0],f=P[1]-O*P[0],s=P[2]-V*P[1],l=P[3]-S*P[2],c=P[4]-j*P[3],h=P[5]-R*P[4],p=P[6]-L*P[5],g=P[7]-I*P[6],y=P[8]-B*P[7],m=U[0],d=U[1]-O*U[0],v=U[2]-V*U[1],b=U[3]-S*U[2],w=U[4]-j*U[3],_=U[5]-R*U[4],E=U[6]-L*U[5],x=U[7]-I*U[6],T=U[8]-B*U[7]),M=t.offset,k=e.offset,n=t.data,i=e.data,o=t.accessors[0],a=e.accessors[1],G=0;G<F;G++){for($=0;$<B;$++){for(W=0;W<I;W++){for(J=0;J<L;J++){for(z=0;z<R;z++){for(D=0;D<j;D++){for(Y=0;Y<S;Y++){for(N=0;N<V;N++){for(C=0;C<O;C++)a(i,k,o(n,M)),M+=u,k+=m;M+=f,k+=d}M+=s,k+=v}M+=l,k+=b}M+=c,k+=w}M+=h,k+=_}M+=p,k+=E}M+=g,k+=x}M+=y,k+=T}},function(t,e,r){var n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G,Z,q,X,K;for(V=t.shape,k=t.strides,C=e.strides,r?(S=V[9],j=V[8],R=V[7],L=V[6],I=V[5],B=V[4],F=V[3],P=V[2],U=V[1],M=V[0],u=k[9],f=k[8]-S*k[9],s=k[7]-j*k[8],l=k[6]-R*k[7],c=k[5]-L*k[6],h=k[4]-I*k[5],p=k[3]-B*k[4],g=k[2]-F*k[3],y=k[1]-P*k[2],m=k[0]-U*k[1],d=C[9],v=C[8]-S*C[9],b=C[7]-j*C[8],w=C[6]-R*C[7],_=C[5]-L*C[6],E=C[4]-I*C[5],x=C[3]-B*C[4],T=C[2]-F*C[3],A=C[1]-P*C[2],O=C[0]-U*C[1]):(S=V[0],j=V[1],R=V[2],L=V[3],I=V[4],B=V[5],F=V[6],P=V[7],U=V[8],M=V[9],u=k[0],f=k[1]-S*k[0],s=k[2]-j*k[1],l=k[3]-R*k[2],c=k[4]-L*k[3],h=k[5]-I*k[4],p=k[6]-B*k[5],g=k[7]-F*k[6],y=k[8]-P*k[7],m=k[9]-U*k[8],d=C[0],v=C[1]-S*C[0],b=C[2]-j*C[1],w=C[3]-R*C[2],_=C[4]-L*C[3],E=C[5]-I*C[4],x=C[6]-B*C[5],T=C[7]-F*C[6],A=C[8]-P*C[7],O=C[9]-U*C[8]),N=t.offset,Y=e.offset,n=t.data,i=e.data,o=t.accessors[0],a=e.accessors[1],K=0;K<M;K++){for(X=0;X<U;X++){for(q=0;q<P;q++){for(Z=0;Z<F;Z++){for(G=0;G<B;G++){for($=0;$<I;$++){for(W=0;W<L;W++){for(J=0;J<R;J++){for(z=0;z<j;z++){for(D=0;D<S;D++)a(i,Y,o(n,N)),N+=u,Y+=d;N+=f,Y+=v}N+=s,Y+=b}N+=l,Y+=w}N+=c,Y+=_}N+=h,Y+=E}N+=p,Y+=x}N+=g,Y+=T}N+=y,Y+=A}N+=m,Y+=O}}],Tl=[function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T;for(c=(T=dl(t.shape,t.strides,e.strides)).sh,g=T.sx,y=T.sy,r=bl(t.dtype,e.dtype),m=t.offset,d=e.offset,n=t.data,i=e.data,o=g[0],u=y[0],x=c[1];x>0;)for(x<r?(p=x,x=0):(p=r,x-=r),s=m+x*g[1],l=d+x*y[1],E=c[0];E>0;)for(E<r?(h=E,E=0):(h=r,E-=r),v=s+E*g[0],b=l+E*y[0],a=g[1]-h*g[0],f=y[1]-h*y[0],_=0;_<p;_++){for(w=0;w<h;w++)i[b]=n[v],v+=o,b+=u;v+=a,b+=f}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L;for(y=(L=dl(t.shape,t.strides,e.strides)).sh,b=L.sx,w=L.sy,r=bl(t.dtype,e.dtype),_=t.offset,E=e.offset,n=t.data,i=e.data,o=b[0],f=w[0],R=y[2];R>0;)for(R<r?(v=R,R=0):(v=r,R-=r),h=_+R*b[2],g=E+R*w[2],j=y[1];j>0;)for(j<r?(d=j,j=0):(d=r,j-=r),u=b[2]-d*b[1],l=w[2]-d*w[1],c=h+j*b[1],p=g+j*w[1],S=y[0];S>0;)for(S<r?(m=S,S=0):(m=r,S-=r),x=c+S*b[0],T=p+S*w[0],a=b[1]-m*b[0],s=w[1]-m*w[0],V=0;V<v;V++){for(O=0;O<d;O++){for(A=0;A<m;A++)i[T]=n[x],x+=o,T+=f;x+=a,T+=s}x+=u,T+=l}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k;for(b=(k=dl(t.shape,t.strides,e.strides)).sh,T=k.sx,A=k.sy,r=bl(t.dtype,e.dtype),O=t.offset,V=e.offset,n=t.data,i=e.data,o=T[0],s=A[0],M=b[3];M>0;)for(M<r?(x=M,M=0):(x=r,M-=r),y=O+M*T[3],v=V+M*A[3],U=b[2];U>0;)for(U<r?(E=U,U=0):(E=r,U-=r),f=T[3]-E*T[2],h=A[3]-E*A[2],g=y+U*T[2],d=v+U*A[2],P=b[1];P>0;)for(P<r?(_=P,P=0):(_=r,P-=r),u=T[2]-_*T[1],c=A[2]-_*A[1],p=g+P*T[1],m=d+P*A[1],F=b[0];F>0;)for(F<r?(w=F,F=0):(w=r,F-=r),S=p+F*T[0],j=m+F*A[0],a=T[1]-w*T[0],l=A[1]-w*A[0],B=0;B<x;B++){for(I=0;I<E;I++){for(L=0;L<_;L++){for(R=0;R<w;R++)i[j]=n[S],S+=o,j+=s;S+=a,j+=l}S+=u,j+=c}S+=f,j+=h}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W;for(x=(W=dl(t.shape,t.strides,e.strides)).sh,j=W.sx,R=W.sy,r=bl(t.dtype,e.dtype),L=t.offset,I=e.offset,n=t.data,i=e.data,o=j[0],l=R[0],J=x[4];J>0;)for(J<r?(S=J,J=0):(S=r,J-=r),v=L+J*j[4],E=I+J*R[4],z=x[3];z>0;)for(z<r?(V=z,z=0):(V=r,z-=r),s=j[4]-V*j[3],g=R[4]-V*R[3],d=v+z*j[3],_=E+z*R[3],D=x[2];D>0;)for(D<r?(O=D,D=0):(O=r,D-=r),f=j[3]-O*j[2],p=R[3]-O*R[2],m=d+D*j[2],w=_+D*R[2],Y=x[1];Y>0;)for(Y<r?(A=Y,Y=0):(A=r,Y-=r),u=j[2]-A*j[1],h=R[2]-A*R[1],y=m+Y*j[1],b=w+Y*R[1],N=x[0];N>0;)for(N<r?(T=N,N=0):(T=r,N-=r),B=y+N*j[0],F=b+N*R[0],a=j[1]-T*j[0],c=R[1]-T*R[0],C=0;C<S;C++){for(k=0;k<V;k++){for(M=0;M<O;M++){for(U=0;U<A;U++){for(P=0;P<T;P++)i[F]=n[B],B+=o,F+=l;B+=a,F+=c}B+=u,F+=h}B+=f,F+=p}B+=s,F+=g}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G,Z,q,X,K,H;for(V=(H=dl(t.shape,t.strides,e.strides)).sh,F=H.sx,P=H.sy,r=bl(t.dtype,e.dtype),U=t.offset,M=e.offset,n=t.data,i=e.data,o=F[0],c=P[0],K=V[5];K>0;)for(K<r?(B=K,K=0):(B=r,K-=r),_=U+K*F[5],O=M+K*P[5],X=V[4];X>0;)for(X<r?(I=X,X=0):(I=r,X-=r),l=F[5]-I*F[4],m=P[5]-I*P[4],w=_+X*F[4],A=O+X*P[4],q=V[3];q>0;)for(q<r?(L=q,q=0):(L=r,q-=r),s=F[4]-L*F[3],y=P[4]-L*P[3],b=w+q*F[3],T=A+q*P[3],Z=V[2];Z>0;)for(Z<r?(R=Z,Z=0):(R=r,Z-=r),f=F[3]-R*F[2],g=P[3]-R*P[2],v=b+Z*F[2],x=T+Z*P[2],G=V[1];G>0;)for(G<r?(j=G,G=0):(j=r,G-=r),u=F[2]-j*F[1],p=P[2]-j*P[1],d=v+G*F[1],E=x+G*P[1],$=V[0];$>0;)for($<r?(S=$,$=0):(S=r,$-=r),k=d+$*F[0],C=E+$*P[0],a=F[1]-S*F[0],h=P[1]-S*P[0],W=0;W<B;W++){for(J=0;J<I;J++){for(z=0;z<L;z++){for(D=0;D<R;D++){for(Y=0;Y<j;Y++){for(N=0;N<S;N++)i[C]=n[k],k+=o,C+=c;k+=a,C+=h}k+=u,C+=p}k+=f,C+=g}k+=s,C+=y}k+=l,C+=m}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G,Z,q,X,K,H,Q,tt,et,rt,nt,it,ot;for(L=(ot=dl(t.shape,t.strides,e.strides)).sh,C=ot.sx,N=ot.sy,r=bl(t.dtype,e.dtype),Y=t.offset,D=e.offset,n=t.data,i=e.data,o=C[0],h=N[0],it=L[6];it>0;)for(it<r?(k=it,it=0):(k=r,it-=r),T=Y+it*C[6],R=D+it*N[6],nt=L[5];nt>0;)for(nt<r?(M=nt,nt=0):(M=r,nt-=r),c=C[6]-M*C[5],v=N[6]-M*N[5],x=T+nt*C[5],j=R+nt*N[5],rt=L[4];rt>0;)for(rt<r?(U=rt,rt=0):(U=r,rt-=r),l=C[5]-U*C[4],d=N[5]-U*N[4],E=x+rt*C[4],S=j+rt*N[4],et=L[3];et>0;)for(et<r?(P=et,et=0):(P=r,et-=r),s=C[4]-P*C[3],m=N[4]-P*N[3],_=E+et*C[3],V=S+et*N[3],tt=L[2];tt>0;)for(tt<r?(F=tt,tt=0):(F=r,tt-=r),f=C[3]-F*C[2],y=N[3]-F*N[2],w=_+tt*C[2],O=V+tt*N[2],Q=L[1];Q>0;)for(Q<r?(B=Q,Q=0):(B=r,Q-=r),u=C[2]-B*C[1],g=N[2]-B*N[1],b=w+Q*C[1],A=O+Q*N[1],H=L[0];H>0;)for(H<r?(I=H,H=0):(I=r,H-=r),z=b+H*C[0],J=A+H*N[0],a=C[1]-I*C[0],p=N[1]-I*N[0],K=0;K<k;K++){for(X=0;X<M;X++){for(q=0;q<U;q++){for(Z=0;Z<P;Z++){for(G=0;G<F;G++){for($=0;$<B;$++){for(W=0;W<I;W++)i[J]=n[z],z+=o,J+=h;z+=a,J+=p}z+=u,J+=g}z+=f,J+=y}z+=s,J+=m}z+=l,J+=d}z+=c,J+=v}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G,Z,q,X,K,H,Q,tt,et,rt,nt,it,ot,at,ut,ft,st,lt,ct,ht;for(P=(ht=dl(t.shape,t.strides,e.strides)).sh,J=ht.sx,W=ht.sy,r=bl(t.dtype,e.dtype),$=t.offset,G=e.offset,n=t.data,i=e.data,o=J[0],p=W[0],ct=P[7];ct>0;)for(ct<r?(z=ct,ct=0):(z=r,ct-=r),V=$+ct*J[7],F=G+ct*W[7],lt=P[6];lt>0;)for(lt<r?(D=lt,lt=0):(D=r,lt-=r),h=J[7]-D*J[6],w=W[7]-D*W[6],O=V+lt*J[6],B=F+lt*W[6],st=P[5];st>0;)for(st<r?(Y=st,st=0):(Y=r,st-=r),c=J[6]-Y*J[5],b=W[6]-Y*W[5],A=O+st*J[5],I=B+st*W[5],ft=P[4];ft>0;)for(ft<r?(N=ft,ft=0):(N=r,ft-=r),l=J[5]-N*J[4],v=W[5]-N*W[4],T=A+ft*J[4],L=I+ft*W[4],ut=P[3];ut>0;)for(ut<r?(C=ut,ut=0):(C=r,ut-=r),s=J[4]-C*J[3],d=W[4]-C*W[3],x=T+ut*J[3],R=L+ut*W[3],at=P[2];at>0;)for(at<r?(k=at,at=0):(k=r,at-=r),f=J[3]-k*J[2],m=W[3]-k*W[2],E=x+at*J[2],j=R+at*W[2],ot=P[1];ot>0;)for(ot<r?(M=ot,ot=0):(M=r,ot-=r),u=J[2]-M*J[1],y=W[2]-M*W[1],_=E+ot*J[1],S=j+ot*W[1],it=P[0];it>0;)for(it<r?(U=it,it=0):(U=r,it-=r),Z=_+it*J[0],q=S+it*W[0],a=J[1]-U*J[0],g=W[1]-U*W[0],nt=0;nt<z;nt++){for(rt=0;rt<D;rt++){for(et=0;et<Y;et++){for(tt=0;tt<N;tt++){for(Q=0;Q<C;Q++){for(H=0;H<k;H++){for(K=0;K<M;K++){for(X=0;X<U;X++)i[q]=n[Z],Z+=o,q+=p;Z+=a,q+=g}Z+=u,q+=y}Z+=f,q+=m}Z+=s,q+=d}Z+=l,q+=v}Z+=c,q+=b}Z+=h,q+=w}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G,Z,q,X,K,H,Q,tt,et,rt,nt,it,ot,at,ut,ft,st,lt,ct,ht,pt,gt,yt,mt,dt,vt,bt;for(C=(bt=dl(t.shape,t.strides,e.strides)).sh,q=bt.sx,X=bt.sy,r=bl(t.dtype,e.dtype),K=t.offset,H=e.offset,n=t.data,i=e.data,o=q[0],g=X[0],vt=C[8];vt>0;)for(vt<r?(Z=vt,vt=0):(Z=r,vt-=r),R=K+vt*q[8],k=H+vt*X[8],dt=C[7];dt>0;)for(dt<r?(G=dt,dt=0):(G=r,dt-=r),p=q[8]-G*q[7],E=X[8]-G*X[7],j=R+dt*q[7],M=k+dt*X[7],mt=C[6];mt>0;)for(mt<r?($=mt,mt=0):($=r,mt-=r),h=q[7]-$*q[6],_=X[7]-$*X[6],S=j+mt*q[6],U=M+mt*X[6],yt=C[5];yt>0;)for(yt<r?(W=yt,yt=0):(W=r,yt-=r),c=q[6]-W*q[5],w=X[6]-W*X[5],V=S+yt*q[5],P=U+yt*X[5],gt=C[4];gt>0;)for(gt<r?(J=gt,gt=0):(J=r,gt-=r),l=q[5]-J*q[4],b=X[5]-J*X[4],O=V+gt*q[4],F=P+gt*X[4],pt=C[3];pt>0;)for(pt<r?(z=pt,pt=0):(z=r,pt-=r),s=q[4]-z*q[3],v=X[4]-z*X[3],A=O+pt*q[3],B=F+pt*X[3],ht=C[2];ht>0;)for(ht<r?(D=ht,ht=0):(D=r,ht-=r),f=q[3]-D*q[2],d=X[3]-D*X[2],T=A+ht*q[2],I=B+ht*X[2],ct=C[1];ct>0;)for(ct<r?(Y=ct,ct=0):(Y=r,ct-=r),u=q[2]-Y*q[1],m=X[2]-Y*X[1],x=T+ct*q[1],L=I+ct*X[1],lt=C[0];lt>0;)for(lt<r?(N=lt,lt=0):(N=r,lt-=r),Q=x+lt*q[0],tt=L+lt*X[0],a=q[1]-N*q[0],y=X[1]-N*X[0],st=0;st<Z;st++){for(ft=0;ft<G;ft++){for(ut=0;ut<$;ut++){for(at=0;at<W;at++){for(ot=0;ot<J;ot++){for(it=0;it<z;it++){for(nt=0;nt<D;nt++){for(rt=0;rt<Y;rt++){for(et=0;et<N;et++)i[tt]=n[Q],Q+=o,tt+=g;Q+=a,tt+=y}Q+=u,tt+=m}Q+=f,tt+=d}Q+=s,tt+=v}Q+=l,tt+=b}Q+=c,tt+=w}Q+=h,tt+=_}Q+=p,tt+=E}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G,Z,q,X,K,H,Q,tt,et,rt,nt,it,ot,at,ut,ft,st,lt,ct,ht,pt,gt,yt,mt,dt,vt,bt,wt,_t,Et,xt,Tt,At,Ot;for(z=(Ot=dl(t.shape,t.strides,e.strides)).sh,tt=Ot.sx,et=Ot.sy,r=bl(t.dtype,e.dtype),rt=t.offset,nt=e.offset,n=t.data,i=e.data,o=tt[0],y=et[0],At=z[9];At>0;)for(At<r?(Q=At,At=0):(Q=r,At-=r),B=rt+At*tt[9],D=nt+At*et[9],Tt=z[8];Tt>0;)for(Tt<r?(H=Tt,Tt=0):(H=r,Tt-=r),g=tt[9]-H*tt[8],T=et[9]-H*et[8],I=B+Tt*tt[8],Y=D+Tt*et[8],xt=z[7];xt>0;)for(xt<r?(K=xt,xt=0):(K=r,xt-=r),p=tt[8]-K*tt[7],x=et[8]-K*et[7],L=I+xt*tt[7],N=Y+xt*et[7],Et=z[6];Et>0;)for(Et<r?(X=Et,Et=0):(X=r,Et-=r),h=tt[7]-X*tt[6],E=et[7]-X*et[6],R=L+Et*tt[6],C=N+Et*et[6],_t=z[5];_t>0;)for(_t<r?(q=_t,_t=0):(q=r,_t-=r),c=tt[6]-q*tt[5],_=et[6]-q*et[5],j=R+_t*tt[5],k=C+_t*et[5],wt=z[4];wt>0;)for(wt<r?(Z=wt,wt=0):(Z=r,wt-=r),l=tt[5]-Z*tt[4],w=et[5]-Z*et[4],S=j+wt*tt[4],M=k+wt*et[4],bt=z[3];bt>0;)for(bt<r?(G=bt,bt=0):(G=r,bt-=r),s=tt[4]-G*tt[3],b=et[4]-G*et[3],V=S+bt*tt[3],U=M+bt*et[3],vt=z[2];vt>0;)for(vt<r?($=vt,vt=0):($=r,vt-=r),f=tt[3]-$*tt[2],v=et[3]-$*et[2],O=V+vt*tt[2],P=U+vt*et[2],dt=z[1];dt>0;)for(dt<r?(W=dt,dt=0):(W=r,dt-=r),u=tt[2]-W*tt[1],d=et[2]-W*et[1],A=O+dt*tt[1],F=P+dt*et[1],mt=z[0];mt>0;)for(mt<r?(J=mt,mt=0):(J=r,mt-=r),it=A+mt*tt[0],ot=F+mt*et[0],a=tt[1]-J*tt[0],m=et[1]-J*et[0],yt=0;yt<Q;yt++){for(gt=0;gt<H;gt++){for(pt=0;pt<K;pt++){for(ht=0;ht<X;ht++){for(ct=0;ct<q;ct++){for(lt=0;lt<Z;lt++){for(st=0;st<G;st++){for(ft=0;ft<$;ft++){for(ut=0;ut<W;ut++){for(at=0;at<J;at++)i[ot]=n[it],it+=o,ot+=y;it+=a,ot+=m}it+=u,ot+=d}it+=f,ot+=v}it+=s,ot+=b}it+=l,ot+=w}it+=c,ot+=_}it+=h,ot+=E}it+=p,ot+=x}it+=g,ot+=T}}],Al=[function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O;for(p=(O=dl(t.shape,t.strides,e.strides)).sh,m=O.sx,d=O.sy,r=bl(t.dtype,e.dtype),v=t.offset,b=e.offset,n=t.data,i=e.data,u=m[0],s=d[0],o=t.accessors[0],a=e.accessors[1],A=p[1];A>0;)for(A<r?(y=A,A=0):(y=r,A-=r),c=v+A*m[1],h=b+A*d[1],T=p[0];T>0;)for(T<r?(g=T,T=0):(g=r,T-=r),w=c+T*m[0],_=h+T*d[0],f=m[1]-g*m[0],l=d[1]-g*d[0],x=0;x<y;x++){for(E=0;E<g;E++)a(i,_,o(n,w)),w+=u,_+=s;w+=f,_+=l}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B;for(d=(B=dl(t.shape,t.strides,e.strides)).sh,_=B.sx,E=B.sy,r=bl(t.dtype,e.dtype),x=t.offset,T=e.offset,n=t.data,i=e.data,u=_[0],l=E[0],o=t.accessors[0],a=e.accessors[1],I=d[2];I>0;)for(I<r?(w=I,I=0):(w=r,I-=r),g=x+I*_[2],m=T+I*E[2],L=d[1];L>0;)for(L<r?(b=L,L=0):(b=r,L-=r),s=_[2]-b*_[1],h=E[2]-b*E[1],p=g+L*_[1],y=m+L*E[1],R=d[0];R>0;)for(R<r?(v=R,R=0):(v=r,R-=r),A=p+R*_[0],O=y+R*E[0],f=_[1]-v*_[0],c=E[1]-v*E[0],j=0;j<w;j++){for(S=0;S<b;S++){for(V=0;V<v;V++)a(i,O,o(n,A)),A+=u,O+=l;A+=f,O+=c}A+=s,O+=h}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N;for(_=(N=dl(t.shape,t.strides,e.strides)).sh,O=N.sx,V=N.sy,r=bl(t.dtype,e.dtype),S=t.offset,j=e.offset,n=t.data,i=e.data,u=O[0],c=V[0],o=t.accessors[0],a=e.accessors[1],C=_[3];C>0;)for(C<r?(A=C,C=0):(A=r,C-=r),d=S+C*O[3],w=j+C*V[3],k=_[2];k>0;)for(k<r?(T=k,k=0):(T=r,k-=r),l=O[3]-T*O[2],g=V[3]-T*V[2],m=d+k*O[2],b=w+k*V[2],M=_[1];M>0;)for(M<r?(x=M,M=0):(x=r,M-=r),s=O[2]-x*O[1],p=V[2]-x*V[1],y=m+M*O[1],v=b+M*V[1],U=_[0];U>0;)for(U<r?(E=U,U=0):(E=r,U-=r),R=y+U*O[0],L=v+U*V[0],f=O[1]-E*O[0],h=V[1]-E*V[0],P=0;P<A;P++){for(F=0;F<T;F++){for(B=0;B<x;B++){for(I=0;I<E;I++)a(i,L,o(n,R)),R+=u,L+=c;R+=f,L+=h}R+=s,L+=p}R+=l,L+=g}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G;for(A=(G=dl(t.shape,t.strides,e.strides)).sh,L=G.sx,I=G.sy,r=bl(t.dtype,e.dtype),B=t.offset,F=e.offset,n=t.data,i=e.data,u=L[0],h=I[0],o=t.accessors[0],a=e.accessors[1],$=A[4];$>0;)for($<r?(R=$,$=0):(R=r,$-=r),w=B+$*L[4],T=F+$*I[4],W=A[3];W>0;)for(W<r?(j=W,W=0):(j=r,W-=r),c=L[4]-j*L[3],m=I[4]-j*I[3],b=w+W*L[3],x=T+W*I[3],J=A[2];J>0;)for(J<r?(S=J,J=0):(S=r,J-=r),l=L[3]-S*L[2],y=I[3]-S*I[2],v=b+J*L[2],E=x+J*I[2],z=A[1];z>0;)for(z<r?(V=z,z=0):(V=r,z-=r),s=L[2]-V*L[1],g=I[2]-V*I[1],d=v+z*L[1],_=E+z*I[1],D=A[0];D>0;)for(D<r?(O=D,D=0):(O=r,D-=r),P=d+D*L[0],U=_+D*I[0],f=L[1]-O*L[0],p=I[1]-O*I[0],Y=0;Y<R;Y++){for(N=0;N<j;N++){for(C=0;C<S;C++){for(k=0;k<V;k++){for(M=0;M<O;M++)a(i,U,o(n,P)),P+=u,U+=h;P+=f,U+=p}P+=s,U+=g}P+=l,U+=y}P+=c,U+=m}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G,Z,q,X,K,H,Q,tt;for(j=(tt=dl(t.shape,t.strides,e.strides)).sh,U=tt.sx,M=tt.sy,r=bl(t.dtype,e.dtype),k=t.offset,C=e.offset,n=t.data,i=e.data,u=U[0],p=M[0],o=t.accessors[0],a=e.accessors[1],Q=j[5];Q>0;)for(Q<r?(P=Q,Q=0):(P=r,Q-=r),x=k+Q*U[5],S=C+Q*M[5],H=j[4];H>0;)for(H<r?(F=H,H=0):(F=r,H-=r),h=U[5]-F*U[4],v=M[5]-F*M[4],E=x+H*U[4],V=S+H*M[4],K=j[3];K>0;)for(K<r?(B=K,K=0):(B=r,K-=r),c=U[4]-B*U[3],d=M[4]-B*M[3],_=E+K*U[3],O=V+K*M[3],X=j[2];X>0;)for(X<r?(I=X,X=0):(I=r,X-=r),l=U[3]-I*U[2],m=M[3]-I*M[2],w=_+X*U[2],A=O+X*M[2],q=j[1];q>0;)for(q<r?(L=q,q=0):(L=r,q-=r),s=U[2]-L*U[1],y=M[2]-L*M[1],b=w+q*U[1],T=A+q*M[1],Z=j[0];Z>0;)for(Z<r?(R=Z,Z=0):(R=r,Z-=r),N=b+Z*U[0],Y=T+Z*M[0],f=U[1]-R*U[0],g=M[1]-R*M[0],G=0;G<P;G++){for($=0;$<F;$++){for(W=0;W<B;W++){for(J=0;J<I;J++){for(z=0;z<L;z++){for(D=0;D<R;D++)a(i,Y,o(n,N)),N+=u,Y+=p;N+=f,Y+=g}N+=s,Y+=y}N+=l,Y+=m}N+=c,Y+=d}N+=h,Y+=v}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G,Z,q,X,K,H,Q,tt,et,rt,nt,it,ot,at,ut;for(B=(ut=dl(t.shape,t.strides,e.strides)).sh,Y=ut.sx,D=ut.sy,r=bl(t.dtype,e.dtype),z=t.offset,J=e.offset,n=t.data,i=e.data,u=Y[0],g=D[0],o=t.accessors[0],a=e.accessors[1],at=B[6];at>0;)for(at<r?(N=at,at=0):(N=r,at-=r),O=z+at*Y[6],I=J+at*D[6],ot=B[5];ot>0;)for(ot<r?(C=ot,ot=0):(C=r,ot-=r),p=Y[6]-C*Y[5],w=D[6]-C*D[5],A=O+ot*Y[5],L=I+ot*D[5],it=B[4];it>0;)for(it<r?(k=it,it=0):(k=r,it-=r),h=Y[5]-k*Y[4],b=D[5]-k*D[4],T=A+it*Y[4],R=L+it*D[4],nt=B[3];nt>0;)for(nt<r?(M=nt,nt=0):(M=r,nt-=r),c=Y[4]-M*Y[3],v=D[4]-M*D[3],x=T+nt*Y[3],j=R+nt*D[3],rt=B[2];rt>0;)for(rt<r?(U=rt,rt=0):(U=r,rt-=r),l=Y[3]-U*Y[2],d=D[3]-U*D[2],E=x+rt*Y[2],S=j+rt*D[2],et=B[1];et>0;)for(et<r?(P=et,et=0):(P=r,et-=r),s=Y[2]-P*Y[1],m=D[2]-P*D[1],_=E+et*Y[1],V=S+et*D[1],tt=B[0];tt>0;)for(tt<r?(F=tt,tt=0):(F=r,tt-=r),W=_+tt*Y[0],$=V+tt*D[0],f=Y[1]-F*Y[0],y=D[1]-F*D[0],Q=0;Q<N;Q++){for(H=0;H<C;H++){for(K=0;K<k;K++){for(X=0;X<M;X++){for(q=0;q<U;q++){for(Z=0;Z<P;Z++){for(G=0;G<F;G++)a(i,$,o(n,W)),W+=u,$+=g;W+=f,$+=y}W+=s,$+=m}W+=l,$+=d}W+=c,$+=v}W+=h,$+=b}W+=p,$+=w}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G,Z,q,X,K,H,Q,tt,et,rt,nt,it,ot,at,ut,ft,st,lt,ct,ht,pt,gt;for(M=(gt=dl(t.shape,t.strides,e.strides)).sh,$=gt.sx,G=gt.sy,r=bl(t.dtype,e.dtype),Z=t.offset,q=e.offset,n=t.data,i=e.data,u=$[0],y=G[0],o=t.accessors[0],a=e.accessors[1],pt=M[7];pt>0;)for(pt<r?(W=pt,pt=0):(W=r,pt-=r),j=Z+pt*$[7],U=q+pt*G[7],ht=M[6];ht>0;)for(ht<r?(J=ht,ht=0):(J=r,ht-=r),g=$[7]-J*$[6],E=G[7]-J*G[6],S=j+ht*$[6],P=U+ht*G[6],ct=M[5];ct>0;)for(ct<r?(z=ct,ct=0):(z=r,ct-=r),p=$[6]-z*$[5],_=G[6]-z*G[5],V=S+ct*$[5],F=P+ct*G[5],lt=M[4];lt>0;)for(lt<r?(D=lt,lt=0):(D=r,lt-=r),h=$[5]-D*$[4],w=G[5]-D*G[4],O=V+lt*$[4],B=F+lt*G[4],st=M[3];st>0;)for(st<r?(Y=st,st=0):(Y=r,st-=r),c=$[4]-Y*$[3],b=G[4]-Y*G[3],A=O+st*$[3],I=B+st*G[3],ft=M[2];ft>0;)for(ft<r?(N=ft,ft=0):(N=r,ft-=r),l=$[3]-N*$[2],v=G[3]-N*G[2],T=A+ft*$[2],L=I+ft*G[2],ut=M[1];ut>0;)for(ut<r?(C=ut,ut=0):(C=r,ut-=r),s=$[2]-C*$[1],d=G[2]-C*G[1],x=T+ut*$[1],R=L+ut*G[1],at=M[0];at>0;)for(at<r?(k=at,at=0):(k=r,at-=r),X=x+at*$[0],K=R+at*G[0],f=$[1]-k*$[0],m=G[1]-k*G[0],ot=0;ot<W;ot++){for(it=0;it<J;it++){for(nt=0;nt<z;nt++){for(rt=0;rt<D;rt++){for(et=0;et<Y;et++){for(tt=0;tt<N;tt++){for(Q=0;Q<C;Q++){for(H=0;H<k;H++)a(i,K,o(n,X)),X+=u,K+=y;X+=f,K+=m}X+=s,K+=d}X+=l,K+=v}X+=c,K+=b}X+=h,K+=w}X+=p,K+=_}X+=g,K+=E}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G,Z,q,X,K,H,Q,tt,et,rt,nt,it,ot,at,ut,ft,st,lt,ct,ht,pt,gt,yt,mt,dt,vt,bt,wt,_t;for(Y=(_t=dl(t.shape,t.strides,e.strides)).sh,K=_t.sx,H=_t.sy,r=bl(t.dtype,e.dtype),Q=t.offset,tt=e.offset,n=t.data,i=e.data,u=K[0],m=H[0],o=t.accessors[0],a=e.accessors[1],wt=Y[8];wt>0;)for(wt<r?(X=wt,wt=0):(X=r,wt-=r),I=Q+wt*K[8],N=tt+wt*H[8],bt=Y[7];bt>0;)for(bt<r?(q=bt,bt=0):(q=r,bt-=r),y=K[8]-q*K[7],T=H[8]-q*H[7],L=I+bt*K[7],C=N+bt*H[7],vt=Y[6];vt>0;)for(vt<r?(Z=vt,vt=0):(Z=r,vt-=r),g=K[7]-Z*K[6],x=H[7]-Z*H[6],R=L+vt*K[6],k=C+vt*H[6],dt=Y[5];dt>0;)for(dt<r?(G=dt,dt=0):(G=r,dt-=r),p=K[6]-G*K[5],E=H[6]-G*H[5],j=R+dt*K[5],M=k+dt*H[5],mt=Y[4];mt>0;)for(mt<r?($=mt,mt=0):($=r,mt-=r),h=K[5]-$*K[4],_=H[5]-$*H[4],S=j+mt*K[4],U=M+mt*H[4],yt=Y[3];yt>0;)for(yt<r?(W=yt,yt=0):(W=r,yt-=r),c=K[4]-W*K[3],w=H[4]-W*H[3],V=S+yt*K[3],P=U+yt*H[3],gt=Y[2];gt>0;)for(gt<r?(J=gt,gt=0):(J=r,gt-=r),l=K[3]-J*K[2],b=H[3]-J*H[2],O=V+gt*K[2],F=P+gt*H[2],pt=Y[1];pt>0;)for(pt<r?(z=pt,pt=0):(z=r,pt-=r),s=K[2]-z*K[1],v=H[2]-z*H[1],A=O+pt*K[1],B=F+pt*H[1],ht=Y[0];ht>0;)for(ht<r?(D=ht,ht=0):(D=r,ht-=r),et=A+ht*K[0],rt=B+ht*H[0],f=K[1]-D*K[0],d=H[1]-D*H[0],ct=0;ct<X;ct++){for(lt=0;lt<q;lt++){for(st=0;st<Z;st++){for(ft=0;ft<G;ft++){for(ut=0;ut<$;ut++){for(at=0;at<W;at++){for(ot=0;ot<J;ot++){for(it=0;it<z;it++){for(nt=0;nt<D;nt++)a(i,rt,o(n,et)),et+=u,rt+=m;et+=f,rt+=d}et+=s,rt+=v}et+=l,rt+=b}et+=c,rt+=w}et+=h,rt+=_}et+=p,rt+=E}et+=g,rt+=x}et+=y,rt+=T}},function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x,T,A,O,V,S,j,R,L,I,B,F,P,U,M,k,C,N,Y,D,z,J,W,$,G,Z,q,X,K,H,Q,tt,et,rt,nt,it,ot,at,ut,ft,st,lt,ct,ht,pt,gt,yt,mt,dt,vt,bt,wt,_t,Et,xt,Tt,At,Ot,Vt,St;for(W=(St=dl(t.shape,t.strides,e.strides)).sh,rt=St.sx,nt=St.sy,r=bl(t.dtype,e.dtype),it=t.offset,ot=e.offset,n=t.data,i=e.data,u=rt[0],d=nt[0],o=t.accessors[0],a=e.accessors[1],Vt=W[9];Vt>0;)for(Vt<r?(et=Vt,Vt=0):(et=r,Vt-=r),P=it+Vt*rt[9],J=ot+Vt*nt[9],Ot=W[8];Ot>0;)for(Ot<r?(tt=Ot,Ot=0):(tt=r,Ot-=r),m=rt[9]-tt*rt[8],O=nt[9]-tt*nt[8],F=P+Ot*rt[8],z=J+Ot*nt[8],At=W[7];At>0;)for(At<r?(Q=At,At=0):(Q=r,At-=r),y=rt[8]-Q*rt[7],A=nt[8]-Q*nt[7],B=F+At*rt[7],D=z+At*nt[7],Tt=W[6];Tt>0;)for(Tt<r?(H=Tt,Tt=0):(H=r,Tt-=r),g=rt[7]-H*rt[6],T=nt[7]-H*nt[6],I=B+Tt*rt[6],Y=D+Tt*nt[6],xt=W[5];xt>0;)for(xt<r?(K=xt,xt=0):(K=r,xt-=r),p=rt[6]-K*rt[5],x=nt[6]-K*nt[5],L=I+xt*rt[5],N=Y+xt*nt[5],Et=W[4];Et>0;)for(Et<r?(X=Et,Et=0):(X=r,Et-=r),h=rt[5]-X*rt[4],E=nt[5]-X*nt[4],R=L+Et*rt[4],C=N+Et*nt[4],_t=W[3];_t>0;)for(_t<r?(q=_t,_t=0):(q=r,_t-=r),c=rt[4]-q*rt[3],_=nt[4]-q*nt[3],j=R+_t*rt[3],k=C+_t*nt[3],wt=W[2];wt>0;)for(wt<r?(Z=wt,wt=0):(Z=r,wt-=r),l=rt[3]-Z*rt[2],w=nt[3]-Z*nt[2],S=j+wt*rt[2],M=k+wt*nt[2],bt=W[1];bt>0;)for(bt<r?(G=bt,bt=0):(G=r,bt-=r),s=rt[2]-G*rt[1],b=nt[2]-G*nt[1],V=S+bt*rt[1],U=M+bt*nt[1],vt=W[0];vt>0;)for(vt<r?($=vt,vt=0):($=r,vt-=r),at=V+vt*rt[0],ut=U+vt*nt[0],f=rt[1]-$*rt[0],v=nt[1]-$*nt[0],dt=0;dt<et;dt++){for(mt=0;mt<tt;mt++){for(yt=0;yt<Q;yt++){for(gt=0;gt<H;gt++){for(pt=0;pt<K;pt++){for(ht=0;ht<X;ht++){for(ct=0;ct<q;ct++){for(lt=0;lt<Z;lt++){for(st=0;st<G;st++){for(ft=0;ft<$;ft++)a(i,ut,o(n,at)),at+=u,ut+=d;at+=f,ut+=v}at+=s,ut+=b}at+=l,ut+=w}at+=c,ut+=_}at+=h,ut+=E}at+=p,ut+=x}at+=g,ut+=T}at+=y,ut+=A}at+=m,ut+=O}}],Ol=El.length-1,Vl={complex128:"float64",complex64:"float32",complex32:"float16"};function Sl(t){return t.data=da(t.data,0),t.accessorProtocol=!1,t}function jl(t){var e=t.shape.length;return t.data=lu(t.data,0),t.accessorProtocol=!1,t.dtype=Vl[String(t.dtype)],t.strides=pl(e,2,t.strides,1),t.offset*=2,t.shape.push(2),0===e?t.strides[0]=1:t.strides.push(1),t}function Rl(t){var e,r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b;if(y=sl(t[0]),m=sl(t[1]),tl(y.data)&&tl(m.data)?(y=Sl(y),m=Sl(m)):Hs(y.data)&&Hs(m.data)?(y=jl(y),m=jl(m)):(b=y.dtype,qs(String(b))&&function(t){return Zs(String(t))}(m.dtype)&&(y.accessorProtocol=!0,y.accessors[0]=function(t,e,r){var n;if(!vt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));if(!Nt(e))throw new TypeError(N("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!vt(r))throw new TypeError(N("invalid argument. Third argument must be a constructor function. Value: `%s`.",r));return n=[function(){var e=t();return typeof e===el?new r(e,0):e},function(e){var n=t(e);return typeof n===el?new r(n,0):n},function(e,n){var i=t(e,n);return typeof i===el?new r(i,0):i},function(e,n,i){var o=t(e,n,i);return typeof o===el?new r(o,0):o},function(e,n,i,o){var a=t(e,n,i,o);return typeof a===el?new r(a,0):a},function(e,n,i,o,a){var u=t(e,n,i,o,a);return typeof u===el?new r(u,0):u}],e<=5?n[e]:function(){var e,n,i;for(e=[],i=0;i<arguments.length;i++)e.push(arguments[i]);return typeof(n=t.apply(null,e))===el?new r(n,0):n}}(y.accessors[0],2,la(String(m.dtype))))),i=y.shape,o=m.shape,(e=i.length)!==o.length)throw new Error("invalid arguments. Arrays must have the same number of dimensions (i.e., same rank). ndims(x) == "+e+". ndims(y) == "+o.length+".");if(0===e)return y.accessorProtocol||m.accessorProtocol?xl[e](y,m):El[e](y,m);for(f=1,g=0,v=0;v<e;v++){if((d=i[v])!==o[v])throw new Error("invalid arguments. Arrays must have the same shape.");f*=d,1===d&&(g+=1)}if(0!==f){if(1===e)return y.accessorProtocol||m.accessorProtocol?xl[e](y,m):El[e](y,m);if(l=y.strides,c=m.strides,g===e-1){for(v=0;v<e&&1===i[v];v++);return y.shape=[i[v]],m.shape=y.shape,y.strides=[l[v]],m.strides=[c[v]],y.accessorProtocol||m.accessorProtocol?xl[1](y,m):El[1](y,m)}if(a=Le(l),u=Le(c),s=Be(l),0!==a&&0!==u&&s===Be(c)){if(r=Gn(i,l,y.offset),n=Gn(o,c,m.offset),f===r[1]-r[0]+1&&f===n[1]-n[0]+1)return h=1===a?r[0]:r[1],p=1===u?n[0]:n[1],y.shape=[f],m.shape=y.shape,y.strides=[a],m.strides=[u],y.offset=h,m.offset=p,y.accessorProtocol||m.accessorProtocol?xl[1](y,m):El[1](y,m);if(e<=Ol)return y.accessorProtocol||m.accessorProtocol?xl[e](y,m,1===s):El[e](y,m,1===s)}return e<=Ol?y.accessorProtocol||m.accessorProtocol?Al[e-2](y,m):Tl[e-2](y,m):y.accessorProtocol||m.accessorProtocol?function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y;for(a=_o(s=t.shape),r=t.data,n=e.data,l=t.strides,c=e.strides,h=t.offset,p=e.offset,i=t.order,o=e.order,u=t.accessors[0],f=e.accessors[1],y=0;y<a;y++)g=Us(s,l,h,i,y,wl),f(n,Us(s,c,p,o,y,wl),u(r,g))}(y,m):void function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p;for(a=_o(u=t.shape),r=t.data,n=e.data,f=t.strides,s=e.strides,l=t.offset,c=e.offset,i=t.order,o=e.order,p=0;p<a;p++)h=Us(u,f,l,i,p,_l),n[Us(u,s,c,o,p,_l)]=r[h]}(y,m)}}var Ll={casting:jo.get("casting"),copy:!1,dtype:jo.get("dtypes.default"),flatten:!0,mode:jo.get("index_mode"),ndmin:0,order:jo.get("order"),readonly:!1};function Il(){var t,r,n,i,o,a,u,s,l,c,h,p,g,y,m;if(1===arguments.length)if($s(arguments[0]))n=arguments[0],t={};else{if(!At(t=arguments[0]))throw new TypeError(Ws("0hT56",t));if(e(t,"buffer")&&!$s(n=t.buffer))throw new TypeError(Ws("0hT57","buffer",n))}else{if(!$s(n=arguments[0]))throw new TypeError(Ws("0hT58",n));if(!At(t=arguments[1]))throw new TypeError(Ws("0hT2V",t))}if(n&&((m=n)instanceof Ui||null!==m&&"object"==typeof m&&"object"==typeof m.data&&"object"==typeof m.shape&&"object"==typeof m.strides&&"number"==typeof m.offset&&"string"==typeof m.order&&"number"==typeof m.ndims&&m.dtype&&"number"==typeof m.length&&"object"==typeof m.flags&&"function"==typeof m.get&&"function"==typeof m.set?(u=function(t){var e;if("object"!=typeof t||null===t)throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t));if(Vs(e=t.dtype))return e;throw new TypeError(N("invalid argument. Must provide an ndarray having a supported data type. Value: `%s`.",e))}(n),y=!0):(u=function(t){var e;if(f(t))return"generic";if(yt(t))return"binary";for(e=0;e<Os;e++)if(t instanceof Ts[e])return As[e];return t&&Ji(t.struct)?t.struct:Es[mt(t)]||null}(n)||"generic",y=!1)),c={},h={},e(t,"casting")){if(h.casting=t.casting,!uo(h.casting))throw new TypeError(Ws("0hT59","casting",h.casting))}else h.casting=Ll.casting;if(e(t,"flatten")){if(h.flatten=t.flatten,!X(h.flatten))throw new TypeError(Ws("0hT2o","flatten",h.flatten))}else h.flatten=Ll.flatten;if(e(t,"ndmin")){if(h.ndmin=t.ndmin,!Nt(h.ndmin))throw new TypeError(Ws("0hT2t","ndmin",h.ndmin))}else h.ndmin=Ll.ndmin;if(e(t,"dtype")){if(!eo(a=t.dtype))throw new TypeError(Ws("invalid option. `%s` option must be a supported data type. Option: `%s`.","dtype",a));if(u&&!vo(u,a,h.casting))throw new Error(Ws("0hT5B",h.casting,u,a))}else a=u?!y&&to(u,"generic")?Ll.dtype:u:Ll.dtype;if(e(t,"order")){if("any"===(o=t.order)||"same"===o)y?"any"===o?o=3===Be(js(n))?Ll.order:Is(n):"same"===o&&(o=Is(n)):o=Ll.order;else if(!ro(o))throw new TypeError(Ws("0hT5C","order",o))}else o=Ll.order;if(e(t,"mode")?c.mode=t.mode:c.mode=Ll.mode,e(t,"submode")?c.submode=t.submode:c.submode=[c.mode],e(t,"readonly")?c.readonly=t.readonly:c.readonly=Ll.readonly,e(t,"copy")){if(h.copy=t.copy,!X(h.copy))throw new TypeError(Ws("0hT2o","copy",h.copy))}else h.copy=Ll.copy;if(e(t,"shape")){if(!$s(s=t.shape))throw new TypeError(Ws("0hT5D","shape",s));l=s.length,g=_o(s)}else{if(!n)throw new Error(Ws("0hT0X"));y?(l=(s=Ss(n)).length,g=_o(s)):h.flatten&&f(n)?(p=s=Ps(n),l=s.length,g=_o(s)):(l=1,s=[g=n.length])}if(l<h.ndmin&&(s=function(t,e,r){var n,i;for(n=[],i=0;i<r-t;i++)n.push(1);for(i=0;i<t;i++)n.push(e[i]);return n}(l,s,h.ndmin),l=h.ndmin),y){if(_o(n.shape)!==g)throw new RangeError(Ws("0hT0Y"));!to(u,a)||h.copy?n=function(t,e){var r,n,i,o;return o=Ss(t),i=Is(t),n=_o(o),Rl([t,{dtype:e,data:r=to(e,"generic")?yu(n):to(e,"binary")?bs(n):new(vs(e))(n),shape:o,strides:bo(o,i),offset:0,order:i}]),r}(n,a):(r=js(n),i=function(t){var e,r,n;if("object"!=typeof t||null===t)throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t));if(Nt(n=t.offset))return n;if(!de(r=t.shape))throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t));if(e=t.strides,0===r.length||!de(e))return 0;if(Nt(n=wo(r,e)))return n;throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t))}(n),n=function(t){var e;if("object"!=typeof t||null===t)throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t));if(de(e=t.data))return e;throw new TypeError(N("invalid argument. Must provide an ndarray. Value: `%s`.",t))}(n),r.length<l&&(r=function(t,e,r,n){var i,o,a,u,f;if(f=t-(o=r.length),i=[],"row-major"===n){for(a=Ie(r[0])*e[f],u=0;u<f;u++)i.push(a);for(u=0;u<o;u++)i.push(r[u])}else{for(u=0;u<f;u++)i.push(1);for(u=0;u<o;u++)i.push(r[u])}return i}(l,s,r,o)))}else if(n){if(to(u,"generic")&&h.flatten&&f(n)&&(n=Js(n,p||Ps(n),Zn(o))),n.length!==g)throw new RangeError(Ws("0hT0Y"));to(u,a)&&!h.copy||(n=Gs(n,g,a))}else n=_s(a,g);return void 0===r&&(i=wo(s,r=bo(s,o))),new Zo(a,n,s,r,i,o,c)}export{Il as default};
//# sourceMappingURL=mod.js.map