OOOOO/ᗩ∣ↀ∣𒾨∣ↀ∣ᗩ/✤ᴥᗩᴥ✤/ᗱᗴᴥᗩᗯ✤ꗳⓄᔓᔕⓄꗳ✤ᗯᗩᴥᗱᗴ/ᕭᕮᗩНߦᗱᗴᙏᕭᕮⓄ𒾨ᗝ𒾨ⓄᕭᕮᙏᗱᗴߦНᗩᕭᕮ/ᗱᗴᕤᕦᗩᑎᕤᕦИNᗩᙁᗩИNᕤᕦᑎᗩᕤᕦᗱᗴ   ߦ.../⅃MTH..𖣠⚪ᴥᗱᗴ✤Ⓞᙁߦ᳀ᗱᗴᗯᴥᑎᑐᑕ⚙ИNⓄ...

285 lines
738 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<HTML>
<HEAD>
<SCRIPT>
<!--𖣠𖢌𐧼𐧾ⵔⵔⵔ𐧾·𐧾ⵈ𐧾ⵔ𐧾·𐧾ⵔ𐧾ⵔ𐧾𐧾··𐧼𐧼ⵔⵈⵔ𐧾𐧾𔗢🞋𔗢𐧾𐧾ⵔⵈⵔ𐧼𐧼··𐧾𐧾ⵔ𐧾ⵔ𐧾·𐧾ⵔ𐧾ⵈ𐧾·𐧾ⵔⵔⵔ𐧾𐧼𖢌𖣠--!>
var O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O = new (window.AudioContext || window.webkitAudioContext)();
var O_0_EDON_ROTLICSO_O_OSCILATOR_NODE_0_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_1_EDON_ROTLICSO_O_OSCILATOR_NODE_1_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_2_EDON_ROTLICSO_O_OSCILATOR_NODE_2_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_3_EDON_ROTLICSO_O_OSCILATOR_NODE_3_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_4_EDON_ROTLICSO_O_OSCILATOR_NODE_4_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_5_EDON_ROTLICSO_O_OSCILATOR_NODE_5_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_6_EDON_ROTLICSO_O_OSCILATOR_NODE_6_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_7_EDON_ROTLICSO_O_OSCILATOR_NODE_7_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_8_EDON_ROTLICSO_O_OSCILATOR_NODE_8_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_9_EDON_ROTLICSO_O_OSCILATOR_NODE_9_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_01_EDON_ROTLICSO_O_OSCILATOR_NODE_10_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_11_EDON_ROTLICSO_O_OSCILATOR_NODE_11_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_21_EDON_ROTLICSO_O_OSCILATOR_NODE_12_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_31_EDON_ROTLICSO_O_OSCILATOR_NODE_13_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_41_EDON_ROTLICSO_O_OSCILATOR_NODE_14_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_51_EDON_ROTLICSO_O_OSCILATOR_NODE_15_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_61_EDON_ROTLICSO_O_OSCILATOR_NODE_16_O= O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createOscillator();
var O_EDON_NIAG_O_GAIN_NODE_O = O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.createGain();
O_0_EDON_ROTLICSO_O_OSCILATOR_NODE_0_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**0;
O_1_EDON_ROTLICSO_O_OSCILATOR_NODE_1_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**1;
O_2_EDON_ROTLICSO_O_OSCILATOR_NODE_2_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**2;
O_3_EDON_ROTLICSO_O_OSCILATOR_NODE_3_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**3;
O_4_EDON_ROTLICSO_O_OSCILATOR_NODE_4_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**4;
O_5_EDON_ROTLICSO_O_OSCILATOR_NODE_5_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**5;
O_6_EDON_ROTLICSO_O_OSCILATOR_NODE_6_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**6;
O_7_EDON_ROTLICSO_O_OSCILATOR_NODE_7_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**7;
O_8_EDON_ROTLICSO_O_OSCILATOR_NODE_8_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**8;
O_9_EDON_ROTLICSO_O_OSCILATOR_NODE_9_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**9;
O_01_EDON_ROTLICSO_O_OSCILATOR_NODE_10_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**10;
O_11_EDON_ROTLICSO_O_OSCILATOR_NODE_11_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**11;
O_21_EDON_ROTLICSO_O_OSCILATOR_NODE_12_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**12;
O_31_EDON_ROTLICSO_O_OSCILATOR_NODE_13_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**13;
O_41_EDON_ROTLICSO_O_OSCILATOR_NODE_14_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**14;
O_51_EDON_ROTLICSO_O_OSCILATOR_NODE_15_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**15;
O_61_EDON_ROTLICSO_O_OSCILATOR_NODE_16_O.frequency.value = 1/84.406022589954030768899117092091000289089388918088900852079*3**16;
O_EDON_NIAG_O_GAIN_NODE_O.gain.value = 1/3**4;
O_0_EDON_ROTLICSO_O_OSCILATOR_NODE_0_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_1_EDON_ROTLICSO_O_OSCILATOR_NODE_1_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_2_EDON_ROTLICSO_O_OSCILATOR_NODE_2_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_3_EDON_ROTLICSO_O_OSCILATOR_NODE_3_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_4_EDON_ROTLICSO_O_OSCILATOR_NODE_4_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_5_EDON_ROTLICSO_O_OSCILATOR_NODE_5_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_6_EDON_ROTLICSO_O_OSCILATOR_NODE_6_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_7_EDON_ROTLICSO_O_OSCILATOR_NODE_7_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_8_EDON_ROTLICSO_O_OSCILATOR_NODE_8_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_9_EDON_ROTLICSO_O_OSCILATOR_NODE_9_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_01_EDON_ROTLICSO_O_OSCILATOR_NODE_10_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_11_EDON_ROTLICSO_O_OSCILATOR_NODE_11_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_21_EDON_ROTLICSO_O_OSCILATOR_NODE_12_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_31_EDON_ROTLICSO_O_OSCILATOR_NODE_13_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_41_EDON_ROTLICSO_O_OSCILATOR_NODE_14_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_51_EDON_ROTLICSO_O_OSCILATOR_NODE_15_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_61_EDON_ROTLICSO_O_OSCILATOR_NODE_16_O.connect(O_EDON_NIAG_O_GAIN_NODE_O);
O_EDON_NIAG_O_GAIN_NODE_O.connect(O_TXETNOC_OIDUA_O_AUDIO_CONTEXT_O.destination);
O_0_EDON_ROTLICSO_O_OSCILATOR_NODE_0_O.start();
O_1_EDON_ROTLICSO_O_OSCILATOR_NODE_1_O.start();
O_2_EDON_ROTLICSO_O_OSCILATOR_NODE_2_O.start();
O_3_EDON_ROTLICSO_O_OSCILATOR_NODE_3_O.start();
O_4_EDON_ROTLICSO_O_OSCILATOR_NODE_4_O.start();
O_5_EDON_ROTLICSO_O_OSCILATOR_NODE_5_O.start();
O_6_EDON_ROTLICSO_O_OSCILATOR_NODE_6_O.start();
O_7_EDON_ROTLICSO_O_OSCILATOR_NODE_7_O.start();
O_8_EDON_ROTLICSO_O_OSCILATOR_NODE_8_O.start();
O_9_EDON_ROTLICSO_O_OSCILATOR_NODE_9_O.start();
O_01_EDON_ROTLICSO_O_OSCILATOR_NODE_10_O.start();
O_11_EDON_ROTLICSO_O_OSCILATOR_NODE_11_O.start();
O_21_EDON_ROTLICSO_O_OSCILATOR_NODE_12_O.start();
O_31_EDON_ROTLICSO_O_OSCILATOR_NODE_13_O.start();
O_41_EDON_ROTLICSO_O_OSCILATOR_NODE_14_O.start();
O_51_EDON_ROTLICSO_O_OSCILATOR_NODE_15_O.start();
O_61_EDON_ROTLICSO_O_OSCILATOR_NODE_16_O.start();
<!--𖣠𖢌𐧼𐧾ⵔⵔⵔ𐧾·𐧾ⵈ𐧾ⵔ𐧾·𐧾ⵔ𐧾ⵔ𐧾𐧾··𐧼𐧼ⵔⵈⵔ𐧾𐧾𔗢🞋𔗢𐧾𐧾ⵔⵈⵔ𐧼𐧼··𐧾𐧾ⵔ𐧾ⵔ𐧾·𐧾ⵔ𐧾ⵈ𐧾·𐧾ⵔⵔⵔ𐧾𐧼𖢌𖣠--!>
</SCRIPT>
<TITLE>𖣠⚪ᴥᗱᗴ✤Ⓞᙁߦ᳀ᗱᗴᗯᴥᑎᑐᑕ⚙ИNⓄꖴ✤ᑐᑕИNᑎꗳ𐫰ᗱᗴᴥᑎ✤ᗩᗯᴥᑎᑐᑕ❁ᗝᗱᗴꖴꗳꖴᑐᑕᗱᗴߦᔓᔕ⚪𔗢⚪🞋⚪𔗢⚪ᔓᔕߦᗱᗴᑐᑕꖴꗳꖴᗱᗴᗝ❁ᑐᑕᑎᴥᗯᗩ✤ᑎᴥᗱᗴ𐫰ꗳᑎИNᑐᑕ✤ꖴⓄИN⚙ᑐᑕᑎᴥᗯᗱᗴ᳀ߦᙁⓄ✤ᗱᗴᴥ⚪𖣠</TITLE>
<script !src="http://CDNJS.CLOUDFLARE.COM/ajax/libs/mathjs/12.4.1/math.js">!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.math=t():e.math=t()}(this,(()=>(()=>{var e={5716:function(e,t){var r;!function(n){"use strict";var i=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:.5*(Math.exp(e)+Math.exp(-e))},a=Math.sinh||function(e){return Math.abs(e)<1e-9?e:.5*(Math.exp(e)-Math.exp(-e))},o=function(){throw SyntaxError("Invalid Param")};function u(e,t){var r=Math.abs(e),n=Math.abs(t);return 0===e?Math.log(n):0===t?Math.log(r):r<3e3&&n<3e3?.5*Math.log(e*e+t*t):(e/=2,t/=2,.5*Math.log(e*e+t*t)+Math.LN2)}function s(e,t){if(!(this instanceof s))return new s(e,t);var r=function(e,t){var r={re:0,im:0};if(null==e)r.re=r.im=0;else if(void 0!==t)r.re=e,r.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)r.re=e.re,r.im=e.im;else if("abs"in e&&"arg"in e){if(!Number.isFinite(e.abs)&&Number.isFinite(e.arg))return s.INFINITY;r.re=e.abs*Math.cos(e.arg),r.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!Number.isFinite(e.r)&&Number.isFinite(e.phi))return s.INFINITY;r.re=e.r*Math.cos(e.phi),r.im=e.r*Math.sin(e.phi)}else 2===e.length?(r.re=e[0],r.im=e[1]):o();break;case"string":r.im=r.re=0;var n=e.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,a=0;null===n&&o();for(var u=0;u<n.length;u++){var c=n[u];" "===c||"\t"===c||"\n"===c||("+"===c?i++:"-"===c?a++:"i"===c||"I"===c?(i+a===0&&o()," "===n[u+1]||isNaN(n[u+1])?r.im+=parseFloat((a%2?"-":"")+"1"):(r.im+=parseFloat((a%2?"-":"")+n[u+1]),u++),i=a=0):((i+a===0||isNaN(c))&&o(),"i"===n[u+1]||"I"===n[u+1]?(r.im+=parseFloat((a%2?"-":"")+c),u++):r.re+=parseFloat((a%2?"-":"")+c),i=a=0))}i+a>0&&o();break;case"number":r.im=0,r.re=e;break;default:o()}return isNaN(r.re)||isNaN(r.im),r}(e,t);this.re=r.re,this.im=r.im}s.prototype={re:0,im:0,sign:function(){var e=this.abs();return new s(this.re/e,this.im/e)},add:function(e,t){var r=new s(e,t);return this.isInfinite()&&r.isInfinite()?s.NAN:this.isInfinite()||r.isInfinite()?s.INFINITY:new s(this.re+r.re,this.im+r.im)},sub:function(e,t){var r=new s(e,t);return this.isInfinite()&&r.isInfinite()?s.NAN:this.isInfinite()||r.isInfinite()?s.INFINITY:new s(this.re-r.re,this.im-r.im)},mul:function(e,t){var r=new s(e,t);return this.isInfinite()&&r.isZero()||this.isZero()&&r.isInfinite()?s.NAN:this.isInfinite()||r.isInfinite()?s.INFINITY:0===r.im&&0===this.im?new s(this.re*r.re,0):new s(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(e,t){var r=new s(e,t);if(this.isZero()&&r.isZero()||this.isInfinite()&&r.isInfinite())return s.NAN;if(this.isInfinite()||r.isZero())return s.INFINITY;if(this.isZero()||r.isInfinite())return s.ZERO;e=this.re,t=this.im;var n,i,a=r.re,o=r.im;return 0===o?new s(e/a,t/a):Math.abs(a)<Math.abs(o)?new s((e*(i=a/o)+t)/(n=a*i+o),(t*i-e)/n):new s((e+t*(i=o/a))/(n=o*i+a),(t-e*i)/n)},pow:function(e,t){var r=new s(e,t);if(e=this.re,t=this.im,r.isZero())return s.ONE;if(0===r.im){if(0===t&&e>0)return new s(Math.pow(e,r.re),0);if(0===e)switch((r.re%4+4)%4){case 0:return new s(Math.pow(t,r.re),0);case 1:return new s(0,Math.pow(t,r.re));case 2:return new s(-Math.pow(t,r.re),0);case 3:return new s(0,-Math.pow(t,r.re))}}if(0===e&&0===t&&r.re>0&&r.im>=0)return s.ZERO;var n=Math.atan2(t,e),i=u(e,t);return e=Math.exp(r.re*i-r.im*n),t=r.im*i+r.re*n,new s(e*Math.cos(t),e*Math.sin(t))},sqrt:function(){var e,t,r=this.re,n=this.im,i=this.abs();if(r>=0){if(0===n)return new s(Math.sqrt(r),0);e=.5*Math.sqrt(2*(i+r))}else e=Math.abs(n)/Math.sqrt(2*(i-r));return t=r<=0?.5*Math.sqrt(2*(i-r)):Math.abs(n)/Math.sqrt(2*(i+r)),new s(e,n<0?-t:t)},exp:function(){var e=Math.exp(this.re);return this.im,new s(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){var e=this.re,t=this.im;return new s(Math.expm1(e)*Math.cos(t)+function(e){var t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;var r=e*e;return r*(r*(r*(r*(r*(r*(r*(r/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){var e=this.re,t=this.im;return new s(u(e,t),Math.atan2(t,e))},abs:function(){return e=this.re,t=this.im,r=Math.abs(e),n=Math.abs(t),r<3e3&&n<3e3?Math.sqrt(r*r+n*n):(r<n?(r=n,n=e/t):n=t/e,r*Math.sqrt(1+n*n));var e,t,r,n},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var e=this.re,t=this.im;return new s(Math.sin(e)*i(t),Math.cos(e)*a(t))},cos:function(){var e=this.re,t=this.im;return new s(Math.cos(e)*i(t),-Math.sin(e)*a(t))},tan:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)+i(t);return new s(Math.sin(e)/r,a(t)/r)},cot:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)-i(t);return new s(-Math.sin(e)/r,a(t)/r)},sec:function(){var e=this.re,t=this.im,r=.5*i(2*t)+.5*Math.cos(2*e);return new s(Math.cos(e)*i(t)/r,Math.sin(e)*a(t)/r)},csc:function(){var e=this.re,t=this.im,r=.5*i(2*t)-.5*Math.cos(2*e);return new s(Math.sin(e)*i(t)/r,-Math.cos(e)*a(t)/r)},asin:function(){var e=this.re,t=this.im,r=new s(t*t-e*e+1,-2*e*t).sqrt(),n=new s(r.re-t,r.im+e).log();return new s(n.im,-n.re)},acos:function(){var e=this.re,t=this.im,r=new s(t*t-e*e+1,-2*e*t).sqrt(),n=new s(r.re-t,r.im+e).log();return new s(Math.PI/2-n.im,n.re)},atan:function(){var e=this.re,t=this.im;if(0===e){if(1===t)return new s(0,1/0);if(-1===t)return new s(0,-1/0)}var r=e*e+(1-t)*(1-t),n=new s((1-t*t-e*e)/r,-2*e/r).log();return new s(-.5*n.im,.5*n.re)},acot:function(){var e=this.re,t=this.im;if(0===t)return new s(Math.atan2(1,e),0);var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).atan():new s(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new s(0,1/0);var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).acos():new s(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new s(Math.PI/2,1/0);var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).asin():new s(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){var e=this.re,t=this.im;return new s(a(e)*Math.cos(t),i(e)*Math.sin(t))},cosh:function(){var e=this.re,t=this.im;return new s(i(e)*Math.cos(t),a(e)*Math.sin(t))},tanh:function(){var e=2*this.re,t=2*this.im,r=i(e)+Math.cos(t);return new s(a(e)/r,Math.sin(t)/r)},coth:function(){var e=2*this.re,t=2*this.im,r=i(e)-Math.cos(t);return new s(a(e)/r,-Math.sin(t)/r)},csch:function(){var e=this.re,t=this.im,r=Math.cos(2*t)-i(2*e);return new s(-2*a(e)*Math.cos(t)/r,2*i(e)*Math.sin(t)/r)},sech:function(){var e=this.re,t=this.im,r=Math.cos(2*t)+i(2*e);return new s(2*i(e)*Math.cos(t)/r,-2*a(e)*Math.sin(t)/r)},asinh:function(){var e=this.im;this.im=-this.re,this.re=e;var t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){var e=this.acos();if(e.im<=0){var t=e.re;e.re=-e.im,e.im=t}else t=e.im,e.im=-e.re,e.re=t;return e},atanh:function(){var e=this.re,t=this.im,r=e>1&&0===t,n=1-e,i=1+e,a=n*n+t*t,o=0!==a?new s((i*n-t*t)/a,(t*n+i*t)/a):new s(-1!==e?e/0:0,0!==t?t/0:0),c=o.re;return o.re=u(o.re,o.im)/2,o.im=Math.atan2(o.im,c)/2,r&&(o.im=-o.im),o},acoth:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new s(0,Math.PI/2);var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).atanh():new s(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){var e=this.re,t=this.im;if(0===t)return new s(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).asinh():new s(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){var e=this.re,t=this.im;if(this.isZero())return s.INFINITY;var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).acosh():new s(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return s.INFINITY;if(this.isInfinite())return s.ZERO;var e=this.re,t=this.im,r=e*e+t*t;return new s(e/r,-t/r)},conjugate:function(){return new s(this.re,-this.im)},neg:function(){return new s(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new s(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new s(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new s(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){var r=new s(e,t);return Math.abs(r.re-this.re)<=s.EPSILON&&Math.abs(r.im-this.im)<=s.EPSILON},clone:function(){return new s(this.re,this.im)},toString:function(){var e=this.re,t=this.im,r="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<s.EPSILON&&(e=0),Math.abs(t)<s.EPSILON&&(t=0),0===t?r+e:(0!==e?(r+=e,r+=" ",t<0?(t=-t,r+="-"):r+="+",r+=" "):t<0&&(t=-t,r+="-"),1!==t&&(r+=t),r+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},s.ZERO=new s(0,0),s.ONE=new s(1,0),s.I=new s(0,1),s.PI=new s(Math.PI,0),s.E=new s(Math.E,0),s.INFINITY=new s(1/0,1/0),s.NAN=new s(NaN,NaN),s.EPSILON=1e-15,void 0===(r=function(){return s}.apply(t,[]))||(e.exports=r)}()},3144:e=>{"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},n={"":"\\--","—":"\\---"," ":"~","\t":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},i=function(e,r){return t({},e,r)};e.exports=function(e){for(var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.preserveFormatting,u=void 0!==o&&o,s=a.escapeMapFn,c=void 0===s?i:s,f=String(e),l="",p=c(t({},r),u?t({},n):{}),m=Object.keys(p),h=function(){var e=!1;m.forEach((function(t,r){e||f.length>=t.length&&f.slice(0,t.length)===t&&(l+=p[m[r]],f=f.slice(t.length,f.length),e=!0)})),e||(l+=f.slice(0,1),f=f.slice(1,f.length))};f;)h();return l}},3996:function(e){!function(t){"use strict";var r={s:1,n:0,d:1};function n(e,t){if(isNaN(e=parseInt(e,10)))throw f();return e*t}function i(e,t){if(0===t)throw c();var r=Object.create(s.prototype);r.s=e<0?-1:1;var n=u(e=e<0?-e:e,t);return r.n=e/n,r.d=t/n,r}function a(e){for(var t={},r=e,n=2,i=4;i<=r;){for(;r%n==0;)r/=n,t[n]=(t[n]||0)+1;i+=1+2*n++}return r!==e?r>1&&(t[r]=(t[r]||0)+1):t[e]=(t[e]||0)+1,t}var o=function(e,t){var i,a=0,o=1,u=1,s=0,p=0,m=0,h=1,d=1,v=0,y=1,g=1,x=1,b=1e7;if(null==e);else if(void 0!==t){if(u=(a=e)*(o=t),a%1!=0||o%1!=0)throw l()}else switch(typeof e){case"object":if("d"in e&&"n"in e)a=e.n,o=e.d,"s"in e&&(a*=e.s);else{if(!(0 in e))throw f();a=e[0],1 in e&&(o=e[1])}u=a*o;break;case"number":if(e<0&&(u=e,e=-e),e%1==0)a=e;else if(e>0){for(e>=1&&(e/=d=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));y<=b&&x<=b;){if(e===(i=(v+g)/(y+x))){y+x<=b?(a=v+g,o=y+x):x>y?(a=g,o=x):(a=v,o=y);break}e>i?(v+=g,y+=x):(g+=v,x+=y),y>b?(a=g,o=x):(a=v,o=y)}a*=d}else(isNaN(e)||isNaN(t))&&(o=a=NaN);break;case"string":if(null===(y=e.match(/\d+|./g)))throw f();if("-"===y[v]?(u=-1,v++):"+"===y[v]&&v++,y.length===v+1?p=n(y[v++],u):"."===y[v+1]||"."===y[v]?("."!==y[v]&&(s=n(y[v++],u)),(1+ ++v===y.length||"("===y[v+1]&&")"===y[v+3]||"'"===y[v+1]&&"'"===y[v+3])&&(p=n(y[v],u),h=Math.pow(10,y[v].length),v++),("("===y[v]&&")"===y[v+2]||"'"===y[v]&&"'"===y[v+2])&&(m=n(y[v+1],u),d=Math.pow(10,y[v+1].length)-1,v+=3)):"/"===y[v+1]||":"===y[v+1]?(p=n(y[v],u),h=n(y[v+2],1),v+=3):"/"===y[v+3]&&" "===y[v+1]&&(s=n(y[v],u),p=n(y[v+2],u),h=n(y[v+4],1),v+=5),y.length<=v){u=a=m+(o=h*d)*s+d*p;break}default:throw f()}if(0===o)throw c();r.s=u<0?-1:1,r.n=Math.abs(a),r.d=Math.abs(o)};function u(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function s(e,t){if(o(e,t),!(this instanceof s))return i(r.s*r.n,r.d);e=u(r.d,r.n),this.s=r.s,this.n=r.n/e,this.d=r.d/e}var c=function(){return new Error("Division by Zero")},f=function(){return new Error("Invalid argument")},l=function(){return new Error("Parameters must be integer")};s.prototype={s:1,n:0,d:1,abs:function(){return i(this.n,this.d)},neg:function(){return i(-this.s*this.n,this.d)},add:function(e,t){return o(e,t),i(this.s*this.n*r.d+r.s*this.d*r.n,this.d*r.d)},sub:function(e,t){return o(e,t),i(this.s*this.n*r.d-r.s*this.d*r.n,this.d*r.d)},mul:function(e,t){return o(e,t),i(this.s*r.s*this.n*r.n,this.d*r.d)},div:function(e,t){return o(e,t),i(this.s*r.s*this.n*r.d,this.d*r.n)},clone:function(){return i(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new s(NaN);if(void 0===e)return i(this.s*this.n%this.d,1);if(o(e,t),0===r.n&&0===this.d)throw c();return i(this.s*(r.d*this.n)%(r.n*this.d),r.d*this.d)},gcd:function(e,t){return o(e,t),i(u(r.n,this.n)*u(r.d,this.d),r.d*this.d)},lcm:function(e,t){return o(e,t),0===r.n&&0===this.n?i(0,1):i(r.n*this.n,u(r.n,this.n)*u(r.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new s(NaN):i(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new s(NaN):i(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new s(NaN):i(Math.round(e*this.s*this.n/this.d),e)},inverse:function(){return i(this.s*this.d,this.n)},pow:function(e,t){if(o(e,t),1===r.d)return r.s<0?i(Math.pow(this.s*this.d,r.n),Math.pow(this.n,r.n)):i(Math.pow(this.s*this.n,r.n),Math.pow(this.d,r.n));if(this.s<0)return null;var n=a(this.n),u=a(this.d),s=1,c=1;for(var f in n)if("1"!==f){if("0"===f){s=0;break}if(n[f]*=r.n,n[f]%r.d!=0)return null;n[f]/=r.d,s*=Math.pow(f,n[f])}for(var f in u)if("1"!==f){if(u[f]*=r.n,u[f]%r.d!=0)return null;u[f]/=r.d,c*=Math.pow(f,u[f])}return r.s<0?i(c,s):i(s,c)},equals:function(e,t){return o(e,t),this.s*this.n*r.d==r.s*r.n*this.d},compare:function(e,t){o(e,t);var n=this.s*this.n*r.d-r.s*r.n*this.d;return(0<n)-(n<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;e=e||.001;for(var t=this.abs(),r=t.toContinued(),n=1;n<r.length;n++){for(var a=i(r[n-1],1),o=n-2;o>=0;o--)a=a.inverse().add(r[o]);if(Math.abs(a.sub(t).valueOf())<e)return a.mul(this.s)}return this},divisible:function(e,t){return o(e,t),!(!(r.n*this.d)||this.n*r.d%(r.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),1===i?r+=n:(e&&(t=Math.floor(n/i))>0&&(r+=t,r+=" ",n%=i),r+=n,r+="/",r+=i),r},toLatex:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),1===i?r+=n:(e&&(t=Math.floor(n/i))>0&&(r+=t,n%=i),r+="\\frac{",r+=n,r+="}{",r+=i,r+="}"),r},toContinued:function(){var e,t=this.n,r=this.d,n=[];if(isNaN(t)||isNaN(r))return n;do{n.push(Math.floor(t/r)),e=t%r,t=r,r=e}while(1!==t);return n},toString:function(e){var t=this.n,r=this.d;if(isNaN(t)||isNaN(r))return"NaN";e=e||15;var n=function(e,t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var r=10%t,n=1;1!==r;n++)if(r=10*r%t,n>2e3)return 0;return n}(0,r),i=function(e,t,r){for(var n=1,i=function(e,t,r){for(var n=1;t>0;e=e*e%r,t>>=1)1&t&&(n=n*e%r);return n}(10,r,t),a=0;a<300;a++){if(n===i)return a;n=10*n%t,i=10*i%t}return 0}(0,r,n),a=this.s<0?"-":"";if(a+=t/r|0,t%=r,(t*=10)&&(a+="."),n){for(var o=i;o--;)a+=t/r|0,t%=r,t*=10;for(a+="(",o=n;o--;)a+=t/r|0,t%=r,t*=10;a+=")"}else for(o=e;t&&o--;)a+=t/r|0,t%=r,t*=10;return a}},Object.defineProperty(s,"__esModule",{value:!0}),s.default=s,s.Fraction=s,e.exports=s}()},1880:e=>{e.exports=function e(t,r){"use strict";var n,i,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,o=/(^[ ]*|[ ]*$)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,s=/^0x[0-9a-f]+$/i,c=/^0/,f=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},l=f(t).replace(o,"")||"",p=f(r).replace(o,"")||"",m=l.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=p.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=parseInt(l.match(s),16)||1!==m.length&&l.match(u)&&Date.parse(l),v=parseInt(p.match(s),16)||d&&p.match(u)&&Date.parse(p)||null;if(v){if(d<v)return-1;if(d>v)return 1}for(var y=0,g=Math.max(m.length,h.length);y<g;y++){if(n=!(m[y]||"").match(c)&&parseFloat(m[y])||m[y]||0,i=!(h[y]||"").match(c)&&parseFloat(h[y])||h[y]||0,isNaN(n)!==isNaN(i))return isNaN(n)?1:-1;if(typeof n!=typeof i&&(n+="",i+=""),n<i)return-1;if(n>i)return 1}return 0}},7391:(e,t,r)=>{var n=r(7180),i=r(3181),a=r(3031),o=r(9067),u=r(6833),s=r(6098),c=r(4801);c.alea=n,c.xor128=i,c.xorwow=a,c.xorshift7=o,c.xor4096=u,c.tychei=s,e.exports=c},7180:function(e,t,r){var n;!function(e,i,a){function o(e){var t,r=this,n=(t=4022871197,function(e){e=String(e);for(var r=0;r<e.length;r++){var n=.02519603282416938*(t+=e.charCodeAt(r));n-=t=n>>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function u(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function s(e,t){var r=new o(e),n=t&&t.state,i=r.next;return i.int32=function(){return 4294967296*r.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,n&&("object"==typeof n&&u(n,r),i.state=function(){return u(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.alea=s}(0,e=r.nmd(e),r.amdD)},6098:function(e,t,r){var n;!function(e,i,a){function o(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,i=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^i,i=i-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>16^i,t.a=i-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):r+=e;for(var n=0;n<r.length+20;n++)t.b^=0|r.charCodeAt(n),t.next()}function u(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function s(e,t){var r=new o(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&u(n,r),i.state=function(){return u(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.tychei=s}(0,e=r.nmd(e),r.amdD)},3181:function(e,t,r){var n;!function(e,i,a){function o(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),t.next()}function u(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function s(e,t){var r=new o(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&u(n,r),i.state=function(){return u(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.xor128=s}(0,e=r.nmd(e),r.amdD)},6833:function(e,t,r){var n;!function(e,i,a){function o(e){var t=this;t.next=function(){var e,r,n=t.w,i=t.X,a=t.i;return t.w=n=n+1640531527|0,r=i[a+34&127],e=i[a=a+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=i[a]=r^e,t.i=a,r+(n^n>>>16)|0},function(e,t){var r,n,i,a,o,u=[],s=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,s=Math.max(s,t.length)),i=0,a=-32;a<s;++a)t&&(n^=t.charCodeAt((a+32)%t.length)),0===a&&(o=n),n^=n<<10,n^=n>>>15,n^=n<<4,n^=n>>>13,a>=0&&(o=o+1640531527|0,i=0==(r=u[127&a]^=n+o)?i+1:0);for(i>=128&&(u[127&(t&&t.length||0)]=-1),i=127,a=512;a>0;--a)n=u[i+34&127],r=u[i=i+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,u[i]=n^r;e.w=o,e.X=u,e.i=i}(t,e)}function u(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function s(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&(n.X&&u(n,r),i.state=function(){return u(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.xor4096=s}(0,e=r.nmd(e),r.amdD)},9067:function(e,t,r){var n;!function(e,i,a){function o(e){var t=this;t.next=function(){var e,r,n=t.x,i=t.i;return e=n[i],r=(e^=e>>>7)^e<<24,r^=(e=n[i+1&7])^e>>>10,r^=(e=n[i+3&7])^e>>>3,r^=(e=n[i+4&7])^e<<7,e=n[i+7&7],r^=(e^=e<<13)^e<<9,n[i]=r,t.i=i+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r<t.length;++r)n[7&r]=n[7&r]<<15^t.charCodeAt(r)+n[r+1&7]<<13;for(;n.length<8;)n.push(0);for(r=0;r<8&&0===n[r];++r);for(8==r?n[7]=-1:n[r],e.x=n,e.i=0,r=256;r>0;--r)e.next()}(t,e)}function u(e,t){return t.x=e.x.slice(),t.i=e.i,t}function s(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&(n.x&&u(n,r),i.state=function(){return u(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.xorshift7=s}(0,e=r.nmd(e),r.amdD)},3031:function(e,t,r){var n;!function(e,i,a){function o(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),n==r.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function u(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function s(e,t){var r=new o(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&u(n,r),i.state=function(){return u(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.xorwow=s}(0,e=r.nmd(e),r.amdD)},4801:function(e,t,r){var n;!function(i,a,o){var u,s=256,c=o.pow(s,6),f=o.pow(2,52),l=2*f,p=s-1;function m(e,t,r){var n=[],p=y(v((t=1==t?{entropy:!0}:t||{}).entropy?[e,g(a)]:null==e?function(){try{var e;return u&&(e=u.randomBytes)?e=e(s):(e=new Uint8Array(s),(i.crypto||i.msCrypto).getRandomValues(e)),g(e)}catch(e){var t=i.navigator,r=t&&t.plugins;return[+new Date,i,r,i.screen,g(a)]}}():e,3),n),m=new h(n),x=function(){for(var e=m.g(6),t=c,r=0;e<f;)e=(e+r)*s,t*=s,r=m.g(1);for(;e>=l;)e/=2,t/=2,r>>>=1;return(e+r)/t};return x.int32=function(){return 0|m.g(4)},x.quick=function(){return m.g(4)/4294967296},x.double=x,y(g(m.S),a),(t.pass||r||function(e,t,r,n){return n&&(n.S&&d(n,m),e.state=function(){return d(m,{})}),r?(o.random=e,t):e})(x,p,"global"in t?t.global:this==o,t.state)}function h(e){var t,r=e.length,n=this,i=0,a=n.i=n.j=0,o=n.S=[];for(r||(e=[r++]);i<s;)o[i]=i++;for(i=0;i<s;i++)o[i]=o[a=p&a+e[i%r]+(t=o[i])],o[a]=t;(n.g=function(e){for(var t,r=0,i=n.i,a=n.j,o=n.S;e--;)t=o[i=p&i+1],r=r*s+o[p&(o[i]=o[a=p&a+t])+(o[a]=t)];return n.i=i,n.j=a,r})(s)}function d(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function v(e,t){var r,n=[],i=typeof e;if(t&&"object"==i)for(r in e)try{n.push(v(e[r],t-1))}catch(e){}return n.length?n:"string"==i?e:e+"\0"}function y(e,t){for(var r,n=e+"",i=0;i<n.length;)t[p&i]=p&(r^=19*t[p&i])+n.charCodeAt(i++);return g(t)}function g(e){return String.fromCharCode.apply(0,e)}if(y(o.random(),a),e.exports){e.exports=m;try{u=r(1234)}catch(e){}}else void 0===(n=function(){return m}.call(t,r,t,e))||(e.exports=n)}("undefined"!=typeof self?self:this,[],Math)},1504:e=>{function t(){}t.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function i(){n.off(e,i),t.apply(r,arguments)}return i._=t,this.on(e,i,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;n<i;n++)r[n].fn.apply(r[n].ctx,t);return this},off:function(e,t){var r=this.e||(this.e={}),n=r[e],i=[];if(n&&t)for(var a=0,o=n.length;a<o;a++)n[a].fn!==t&&n[a].fn._!==t&&i.push(n[a]);return i.length?r[e]=i:delete r[e],this}},e.exports=t,e.exports.TinyEmitter=t},1234:()=>{},4633:(e,t,r)=>{var n=r(3738).default;function i(){"use strict";e.exports=i=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},a=Object.prototype,o=a.hasOwnProperty,u=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",f=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function p(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,r){return e[t]=r}}function m(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),o=new B(n||[]);return u(a,"_invoke",{value:F(e,r,o)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=m;var d="suspendedStart",v="suspendedYield",y="executing",g="completed",x={};function b(){}function w(){}function N(){}var D={};p(D,c,(function(){return this}));var E=Object.getPrototypeOf,A=E&&E(E(k([])));A&&A!==a&&o.call(A,c)&&(D=A);var S=N.prototype=b.prototype=Object.create(D);function C(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function M(e,t){function r(i,a,u,s){var c=h(e[i],e,a);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==n(l)&&o.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,u,s)}),(function(e){r("throw",e,u,s)})):t.resolve(l).then((function(e){f.value=e,u(f)}),(function(e){return r("throw",e,u,s)}))}s(c.arg)}var i;u(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(a,a):a()}})}function F(e,r,n){var i=d;return function(a,o){if(i===y)throw new Error("Generator is already running");if(i===g){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===x)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=h(e,r,n);if("normal"===c.type){if(i=n.done?g:v,c.arg===x)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=g,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),x;var a=h(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,x;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,x):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,x)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function B(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function k(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(o.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=N,u(S,"constructor",{value:N,configurable:!0}),u(N,"constructor",{value:w,configurable:!0}),w.displayName=p(N,l,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,N):(e.__proto__=N,p(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},r.awrap=function(e){return{__await:e}},C(M.prototype),p(M.prototype,f,(function(){return this})),r.AsyncIterator=M,r.async=function(e,t,n,i,a){void 0===a&&(a=Promise);var o=new M(m(e,t,n,i),a);return r.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},C(S),p(S,l,"Generator"),p(S,c,(function(){return this})),p(S,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=k,B.prototype={constructor:B,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return u.type="throw",u.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,x):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),x},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),x}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),x}},r}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},3738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756:(e,t,r)=>{var n=r(4633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},9306:(e,t,r)=>{"use strict";var n=r(4901),i=r(6823),a=TypeError;e.exports=function(e){if(n(e))return e;throw new a(i(e)+" is not a function")}},5548:(e,t,r)=>{"use strict";var n=r(3517),i=r(6823),a=TypeError;e.exports=function(e){if(n(e))return e;throw new a(i(e)+" is not a constructor")}},3506:(e,t,r)=>{"use strict";var n=r(3925),i=String,a=TypeError;e.exports=function(e){if(n(e))return e;throw new a("Can't set "+i(e)+" as a prototype")}},6469:(e,t,r)=>{"use strict";var n=r(8227),i=r(2360),a=r(4913).f,o=n("unscopables"),u=Array.prototype;void 0===u[o]&&a(u,o,{configurable:!0,value:i(null)}),e.exports=function(e){u[o][e]=!0}},7829:(e,t,r)=>{"use strict";var n=r(8183).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},679:(e,t,r)=>{"use strict";var n=r(1625),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}},8551:(e,t,r)=>{"use strict";var n=r(34),i=String,a=TypeError;e.exports=function(e){if(n(e))return e;throw new a(i(e)+" is not an object")}},5652:(e,t,r)=>{"use strict";var n=r(9039);e.exports=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},4373:(e,t,r)=>{"use strict";var n=r(8981),i=r(5610),a=r(6198);e.exports=function(e){for(var t=n(this),r=a(t),o=arguments.length,u=i(o>1?arguments[1]:void 0,r),s=o>2?arguments[2]:void 0,c=void 0===s?r:i(s,r);c>u;)t[u++]=e;return t}},235:(e,t,r)=>{"use strict";var n=r(9213).forEach,i=r(4598)("forEach");e.exports=i?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},7916:(e,t,r)=>{"use strict";var n=r(6080),i=r(9565),a=r(8981),o=r(6319),u=r(4209),s=r(3517),c=r(6198),f=r(4659),l=r(81),p=r(851),m=Array;e.exports=function(e){var t=a(e),r=s(this),h=arguments.length,d=h>1?arguments[1]:void 0,v=void 0!==d;v&&(d=n(d,h>2?arguments[2]:void 0));var y,g,x,b,w,N,D=p(t),E=0;if(!D||this===m&&u(D))for(y=c(t),g=r?new this(y):m(y);y>E;E++)N=v?d(t[E],E):t[E],f(g,E,N);else for(w=(b=l(t,D)).next,g=r?new this:[];!(x=i(w,b)).done;E++)N=v?o(b,d,[x.value,E],!0):x.value,f(g,E,N);return g.length=E,g}},9617:(e,t,r)=>{"use strict";var n=r(5397),i=r(5610),a=r(6198),o=function(e){return function(t,r,o){var u=n(t),s=a(u);if(0===s)return!e&&-1;var c,f=i(o,s);if(e&&r!=r){for(;s>f;)if((c=u[f++])!=c)return!0}else for(;s>f;f++)if((e||f in u)&&u[f]===r)return e||f||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},9213:(e,t,r)=>{"use strict";var n=r(6080),i=r(9504),a=r(7055),o=r(8981),u=r(6198),s=r(1469),c=i([].push),f=function(e){var t=1===e,r=2===e,i=3===e,f=4===e,l=6===e,p=7===e,m=5===e||l;return function(h,d,v,y){for(var g,x,b=o(h),w=a(b),N=u(w),D=n(d,v),E=0,A=y||s,S=t?A(h,N):r||p?A(h,0):void 0;N>E;E++)if((m||E in w)&&(x=D(g=w[E],E,b),e))if(t)S[E]=x;else if(x)switch(e){case 3:return!0;case 5:return g;case 6:return E;case 2:c(S,g)}else switch(e){case 4:return!1;case 7:c(S,g)}return l?-1:i||f?f:S}};e.exports={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6),filterReject:f(7)}},597:(e,t,r)=>{"use strict";var n=r(9039),i=r(8227),a=r(7388),o=i("species");e.exports=function(e){return a>=51||!n((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},4598:(e,t,r)=>{"use strict";var n=r(9039);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){return 1},1)}))}},926:(e,t,r)=>{"use strict";var n=r(9306),i=r(8981),a=r(7055),o=r(6198),u=TypeError,s="Reduce of empty array with no initial value",c=function(e){return function(t,r,c,f){var l=i(t),p=a(l),m=o(l);if(n(r),0===m&&c<2)throw new u(s);var h=e?m-1:0,d=e?-1:1;if(c<2)for(;;){if(h in p){f=p[h],h+=d;break}if(h+=d,e?h<0:m<=h)throw new u(s)}for(;e?h>=0:m>h;h+=d)h in p&&(f=r(f,p[h],h,l));return f}};e.exports={left:c(!1),right:c(!0)}},4527:(e,t,r)=>{"use strict";var n=r(3724),i=r(4376),a=TypeError,o=Object.getOwnPropertyDescriptor,u=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=u?function(e,t){if(i(e)&&!o(e,"length").writable)throw new a("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},7680:(e,t,r)=>{"use strict";var n=r(9504);e.exports=n([].slice)},4488:(e,t,r)=>{"use strict";var n=r(7680),i=Math.floor,a=function(e,t){var r=e.length;if(r<8)for(var o,u,s=1;s<r;){for(u=s,o=e[s];u&&t(e[u-1],o)>0;)e[u]=e[--u];u!==s++&&(e[u]=o)}else for(var c=i(r/2),f=a(n(e,0,c),t),l=a(n(e,c),t),p=f.length,m=l.length,h=0,d=0;h<p||d<m;)e[h+d]=h<p&&d<m?t(f[h],l[d])<=0?f[h++]:l[d++]:h<p?f[h++]:l[d++];return e};e.exports=a},7433:(e,t,r)=>{"use strict";var n=r(4376),i=r(3517),a=r(34),o=r(8227)("species"),u=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(i(t)&&(t===u||n(t.prototype))||a(t)&&null===(t=t[o]))&&(t=void 0)),void 0===t?u:t}},1469:(e,t,r)=>{"use strict";var n=r(7433);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},6319:(e,t,r)=>{"use strict";var n=r(8551),i=r(9539);e.exports=function(e,t,r,a){try{return a?t(n(r)[0],r[1]):t(r)}catch(t){i(e,"throw",t)}}},4428:(e,t,r)=>{"use strict";var n=r(8227)("iterator"),i=!1;try{var a=0,o={next:function(){return{done:!!a++}},return:function(){i=!0}};o[n]=function(){return this},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var r=!1;try{var a={};a[n]=function(){return{next:function(){return{done:r=!0}}}},e(a)}catch(e){}return r}},4576:(e,t,r)=>{"use strict";var n=r(9504),i=n({}.toString),a=n("".slice);e.exports=function(e){return a(i(e),8,-1)}},6955:(e,t,r)=>{"use strict";var n=r(2140),i=r(4901),a=r(4576),o=r(8227)("toStringTag"),u=Object,s="Arguments"===a(function(){return arguments}());e.exports=n?a:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=u(e),o))?r:s?a(t):"Object"===(n=a(t))&&i(t.callee)?"Arguments":n}},6938:(e,t,r)=>{"use strict";var n=r(2360),i=r(2106),a=r(6279),o=r(6080),u=r(679),s=r(4117),c=r(2652),f=r(1088),l=r(2529),p=r(7633),m=r(3724),h=r(3451).fastKey,d=r(1181),v=d.set,y=d.getterFor;e.exports={getConstructor:function(e,t,r,f){var l=e((function(e,i){u(e,p),v(e,{type:t,index:n(null),first:void 0,last:void 0,size:0}),m||(e.size=0),s(i)||c(i,e[f],{that:e,AS_ENTRIES:r})})),p=l.prototype,d=y(t),g=function(e,t,r){var n,i,a=d(e),o=x(e,t);return o?o.value=r:(a.last=o={index:i=h(t,!0),key:t,value:r,previous:n=a.last,next:void 0,removed:!1},a.first||(a.first=o),n&&(n.next=o),m?a.size++:e.size++,"F"!==i&&(a.index[i]=o)),e},x=function(e,t){var r,n=d(e),i=h(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key===t)return r};return a(p,{clear:function(){for(var e=d(this),t=e.first;t;)t.removed=!0,t.previous&&(t.previous=t.previous.next=void 0),t=t.next;e.first=e.last=void 0,e.index=n(null),m?e.size=0:this.size=0},delete:function(e){var t=this,r=d(t),n=x(t,e);if(n){var i=n.next,a=n.previous;delete r.index[n.index],n.removed=!0,a&&(a.next=i),i&&(i.previous=a),r.first===n&&(r.first=i),r.last===n&&(r.last=a),m?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=d(this),n=o(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!x(this,e)}}),a(p,r?{get:function(e){var t=x(this,e);return t&&t.value},set:function(e,t){return g(this,0===e?0:e,t)}}:{add:function(e){return g(this,e=0===e?0:e,e)}}),m&&i(p,"size",{configurable:!0,get:function(){return d(this).size}}),l},setStrong:function(e,t,r){var n=t+" Iterator",i=y(t),a=y(n);f(e,t,(function(e,t){v(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=a(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?l("keys"===t?r.key:"values"===t?r.value:[r.key,r.value],!1):(e.target=void 0,l(void 0,!0))}),r?"entries":"values",!r,!0),p(t)}}},6468:(e,t,r)=>{"use strict";var n=r(6518),i=r(4475),a=r(9504),o=r(2796),u=r(6840),s=r(3451),c=r(2652),f=r(679),l=r(4901),p=r(4117),m=r(34),h=r(9039),d=r(4428),v=r(687),y=r(3167);e.exports=function(e,t,r){var g=-1!==e.indexOf("Map"),x=-1!==e.indexOf("Weak"),b=g?"set":"add",w=i[e],N=w&&w.prototype,D=w,E={},A=function(e){var t=a(N[e]);u(N,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(x&&!m(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return x&&!m(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(x&&!m(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(o(e,!l(w)||!(x||N.forEach&&!h((function(){(new w).entries().next()})))))D=r.getConstructor(t,e,g,b),s.enable();else if(o(e,!0)){var S=new D,C=S[b](x?{}:-0,1)!==S,M=h((function(){S.has(1)})),F=d((function(e){new w(e)})),O=!x&&h((function(){for(var e=new w,t=5;t--;)e[b](t,t);return!e.has(-0)}));F||((D=t((function(e,t){f(e,N);var r=y(new w,e,D);return p(t)||c(t,r[b],{that:r,AS_ENTRIES:g}),r}))).prototype=N,N.constructor=D),(M||O)&&(A("delete"),A("has"),g&&A("get")),(O||C)&&A(b),x&&N.clear&&delete N.clear}return E[e]=D,n({global:!0,constructor:!0,forced:D!==w},E),v(D,e),x||r.setStrong(D,e,g),D}},7740:(e,t,r)=>{"use strict";var n=r(9297),i=r(5031),a=r(7347),o=r(4913);e.exports=function(e,t,r){for(var u=i(t),s=o.f,c=a.f,f=0;f<u.length;f++){var l=u[f];n(e,l)||r&&n(r,l)||s(e,l,c(t,l))}}},1436:(e,t,r)=>{"use strict";var n=r(8227)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},2211:(e,t,r)=>{"use strict";var n=r(9039);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},7240:(e,t,r)=>{"use strict";var n=r(9504),i=r(7750),a=r(655),o=/"/g,u=n("".replace);e.exports=function(e,t,r,n){var s=a(i(e)),c="<"+t;return""!==r&&(c+=" "+r+'="'+u(a(n),o,"&quot;")+'"'),c+">"+s+"</"+t+">"}},2529:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},6699:(e,t,r)=>{"use strict";var n=r(3724),i=r(4913),a=r(6980);e.exports=n?function(e,t,r){return i.f(e,t,a(1,r))}:function(e,t,r){return e[t]=r,e}},6980:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},4659:(e,t,r)=>{"use strict";var n=r(3724),i=r(4913),a=r(6980);e.exports=function(e,t,r){n?i.f(e,t,a(0,r)):e[t]=r}},2106:(e,t,r)=>{"use strict";var n=r(283),i=r(4913);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}},6840:(e,t,r)=>{"use strict";var n=r(4901),i=r(4913),a=r(283),o=r(9433);e.exports=function(e,t,r,u){u||(u={});var s=u.enumerable,c=void 0!==u.name?u.name:t;if(n(r)&&a(r,c,u),u.global)s?e[t]=r:o(t,r);else{try{u.unsafe?e[t]&&(s=!0):delete e[t]}catch(e){}s?e[t]=r:i.f(e,t,{value:r,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return e}},6279:(e,t,r)=>{"use strict";var n=r(6840);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},9433:(e,t,r)=>{"use strict";var n=r(4475),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},4606:(e,t,r)=>{"use strict";var n=r(6823),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw new i("Cannot delete property "+n(t)+" of "+n(e))}},3724:(e,t,r)=>{"use strict";var n=r(9039);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4055:(e,t,r)=>{"use strict";var n=r(4475),i=r(34),a=n.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},6837:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},7400:e=>{"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},9296:(e,t,r)=>{"use strict";var n=r(4055)("span").classList,i=n&&n.constructor&&n.constructor.prototype;e.exports=i===Object.prototype?void 0:i},8834:(e,t,r)=>{"use strict";var n=r(9392).match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},7290:(e,t,r)=>{"use strict";var n=r(516),i=r(9088);e.exports=!n&&!i&&"object"==typeof window&&"object"==typeof document},516:e=>{"use strict";e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},3202:(e,t,r)=>{"use strict";var n=r(9392);e.exports=/MSIE|Trident/.test(n)},28:(e,t,r)=>{"use strict";var n=r(9392);e.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},8119:(e,t,r)=>{"use strict";var n=r(9392);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},9088:(e,t,r)=>{"use strict";var n=r(4475),i=r(4576);e.exports="process"===i(n.process)},6765:(e,t,r)=>{"use strict";var n=r(9392);e.exports=/web0s(?!.*chrome)/i.test(n)},9392:e=>{"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},7388:(e,t,r)=>{"use strict";var n,i,a=r(4475),o=r(9392),u=a.process,s=a.Deno,c=u&&u.versions||s&&s.version,f=c&&c.v8;f&&(i=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},9160:(e,t,r)=>{"use strict";var n=r(9392).match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},8727:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6518:(e,t,r)=>{"use strict";var n=r(4475),i=r(7347).f,a=r(6699),o=r(6840),u=r(9433),s=r(7740),c=r(2796);e.exports=function(e,t){var r,f,l,p,m,h=e.target,d=e.global,v=e.stat;if(r=d?n:v?n[h]||u(h,{}):n[h]&&n[h].prototype)for(f in t){if(p=t[f],l=e.dontCallGetSet?(m=i(r,f))&&m.value:r[f],!c(d?f:h+(v?".":"#")+f,e.forced)&&void 0!==l){if(typeof p==typeof l)continue;s(p,l)}(e.sham||l&&l.sham)&&a(p,"sham",!0),o(r,f,p,e)}}},9039:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},9228:(e,t,r)=>{"use strict";r(7495);var n=r(9565),i=r(6840),a=r(7323),o=r(9039),u=r(8227),s=r(6699),c=u("species"),f=RegExp.prototype;e.exports=function(e,t,r,l){var p=u(e),m=!o((function(){var t={};return t[p]=function(){return 7},7!==""[e](t)})),h=m&&!o((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[c]=function(){return r},r.flags="",r[p]=/./[p]),r.exec=function(){return t=!0,null},r[p](""),!t}));if(!m||!h||r){var d=/./[p],v=t(p,""[e],(function(e,t,r,i,o){var u=t.exec;return u===a||u===f.exec?m&&!o?{done:!0,value:n(d,t,r,i)}:{done:!0,value:n(e,r,t,i)}:{done:!1}}));i(String.prototype,e,v[0]),i(f,p,v[1])}l&&s(f[p],"sham",!0)}},2744:(e,t,r)=>{"use strict";var n=r(9039);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},8745:(e,t,r)=>{"use strict";var n=r(616),i=Function.prototype,a=i.apply,o=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(a):function(){return o.apply(a,arguments)})},6080:(e,t,r)=>{"use strict";var n=r(7476),i=r(9306),a=r(616),o=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:a?o(e,t):function(){return e.apply(t,arguments)}}},616:(e,t,r)=>{"use strict";var n=r(9039);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},566:(e,t,r)=>{"use strict";var n=r(9504),i=r(9306),a=r(34),o=r(9297),u=r(7680),s=r(616),c=Function,f=n([].concat),l=n([].join),p={};e.exports=s?c.bind:function(e){var t=i(this),r=t.prototype,n=u(arguments,1),s=function(){var r=f(n,u(arguments));return this instanceof s?function(e,t,r){if(!o(p,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";p[t]=c("C,a","return new C("+l(n,",")+")")}return p[t](e,r)}(t,r.length,r):t.apply(e,r)};return a(r)&&(s.prototype=r),s}},9565:(e,t,r)=>{"use strict";var n=r(616),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},350:(e,t,r)=>{"use strict";var n=r(3724),i=r(9297),a=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,u=i(a,"name"),s=u&&"something"===function(){}.name,c=u&&(!n||n&&o(a,"name").configurable);e.exports={EXISTS:u,PROPER:s,CONFIGURABLE:c}},6706:(e,t,r)=>{"use strict";var n=r(9504),i=r(9306);e.exports=function(e,t,r){try{return n(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},7476:(e,t,r)=>{"use strict";var n=r(4576),i=r(9504);e.exports=function(e){if("Function"===n(e))return i(e)}},9504:(e,t,r)=>{"use strict";var n=r(616),i=Function.prototype,a=i.call,o=n&&i.bind.bind(a,a);e.exports=n?o:function(e){return function(){return a.apply(e,arguments)}}},7751:(e,t,r)=>{"use strict";var n=r(4475),i=r(4901);e.exports=function(e,t){return arguments.length<2?(r=n[e],i(r)?r:void 0):n[e]&&n[e][t];var r}},851:(e,t,r)=>{"use strict";var n=r(6955),i=r(5966),a=r(4117),o=r(6269),u=r(8227)("iterator");e.exports=function(e){if(!a(e))return i(e,u)||i(e,"@@iterator")||o[n(e)]}},81:(e,t,r)=>{"use strict";var n=r(9565),i=r(9306),a=r(8551),o=r(6823),u=r(851),s=TypeError;e.exports=function(e,t){var r=arguments.length<2?u(e):t;if(i(r))return a(n(r,e));throw new s(o(e)+" is not iterable")}},6933:(e,t,r)=>{"use strict";var n=r(9504),i=r(4376),a=r(4901),o=r(4576),u=r(655),s=n([].push);e.exports=function(e){if(a(e))return e;if(i(e)){for(var t=e.length,r=[],n=0;n<t;n++){var c=e[n];"string"==typeof c?s(r,c):"number"!=typeof c&&"Number"!==o(c)&&"String"!==o(c)||s(r,u(c))}var f=r.length,l=!0;return function(e,t){if(l)return l=!1,t;if(i(this))return t;for(var n=0;n<f;n++)if(r[n]===e)return t}}}},5966:(e,t,r)=>{"use strict";var n=r(9306),i=r(4117);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},2478:(e,t,r)=>{"use strict";var n=r(9504),i=r(8981),a=Math.floor,o=n("".charAt),u=n("".replace),s=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,f=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,n,l,p){var m=r+e.length,h=n.length,d=f;return void 0!==l&&(l=i(l),d=c),u(p,d,(function(i,u){var c;switch(o(u,0)){case"$":return"$";case"&":return e;case"`":return s(t,0,r);case"'":return s(t,m);case"<":c=l[s(u,1,-1)];break;default:var f=+u;if(0===f)return i;if(f>h){var p=a(f/10);return 0===p?i:p<=h?void 0===n[p-1]?o(u,1):n[p-1]+o(u,1):i}c=n[f-1]}return void 0===c?"":c}))}},4475:function(e){"use strict";var t=function(e){return e&&e.Math===Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof global&&global)||t("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297:(e,t,r)=>{"use strict";var n=r(9504),i=r(8981),a=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return a(i(e),t)}},421:e=>{"use strict";e.exports={}},3138:e=>{"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},397:(e,t,r)=>{"use strict";var n=r(7751);e.exports=n("document","documentElement")},5917:(e,t,r)=>{"use strict";var n=r(3724),i=r(9039),a=r(4055);e.exports=!n&&!i((function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},7055:(e,t,r)=>{"use strict";var n=r(9504),i=r(9039),a=r(4576),o=Object,u=n("".split);e.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"===a(e)?u(e,""):o(e)}:o},3167:(e,t,r)=>{"use strict";var n=r(4901),i=r(34),a=r(2967);e.exports=function(e,t,r){var o,u;return a&&n(o=t.constructor)&&o!==r&&i(u=o.prototype)&&u!==r.prototype&&a(e,u),e}},3706:(e,t,r)=>{"use strict";var n=r(9504),i=r(4901),a=r(7629),o=n(Function.toString);i(a.inspectSource)||(a.inspectSource=function(e){return o(e)}),e.exports=a.inspectSource},3451:(e,t,r)=>{"use strict";var n=r(6518),i=r(9504),a=r(421),o=r(34),u=r(9297),s=r(4913).f,c=r(8480),f=r(298),l=r(4124),p=r(3392),m=r(2744),h=!1,d=p("meta"),v=0,y=function(e){s(e,d,{value:{objectID:"O"+v++,weakData:{}}})},g=e.exports={enable:function(){g.enable=function(){},h=!0;var e=c.f,t=i([].splice),r={};r[d]=1,e(r).length&&(c.f=function(r){for(var n=e(r),i=0,a=n.length;i<a;i++)if(n[i]===d){t(n,i,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:f.f}))},fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!u(e,d)){if(!l(e))return"F";if(!t)return"E";y(e)}return e[d].objectID},getWeakData:function(e,t){if(!u(e,d)){if(!l(e))return!0;if(!t)return!1;y(e)}return e[d].weakData},onFreeze:function(e){return m&&h&&l(e)&&!u(e,d)&&y(e),e}};a[d]=!0},1181:(e,t,r)=>{"use strict";var n,i,a,o=r(8622),u=r(4475),s=r(34),c=r(6699),f=r(9297),l=r(7629),p=r(6119),m=r(421),h="Object already initialized",d=u.TypeError,v=u.WeakMap;if(o||l.state){var y=l.state||(l.state=new v);y.get=y.get,y.has=y.has,y.set=y.set,n=function(e,t){if(y.has(e))throw new d(h);return t.facade=e,y.set(e,t),t},i=function(e){return y.get(e)||{}},a=function(e){return y.has(e)}}else{var g=p("state");m[g]=!0,n=function(e,t){if(f(e,g))throw new d(h);return t.facade=e,c(e,g,t),t},i=function(e){return f(e,g)?e[g]:{}},a=function(e){return f(e,g)}}e.exports={set:n,get:i,has:a,enforce:function(e){return a(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!s(t)||(r=i(t)).type!==e)throw new d("Incompatible receiver, "+e+" required");return r}}}},4209:(e,t,r)=>{"use strict";var n=r(8227),i=r(6269),a=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[a]===e)}},4376:(e,t,r)=>{"use strict";var n=r(4576);e.exports=Array.isArray||function(e){return"Array"===n(e)}},4901:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},3517:(e,t,r)=>{"use strict";var n=r(9504),i=r(9039),a=r(4901),o=r(6955),u=r(7751),s=r(3706),c=function(){},f=u("Reflect","construct"),l=/^\s*(?:class|function)\b/,p=n(l.exec),m=!l.test(c),h=function(e){if(!a(e))return!1;try{return f(c,[],e),!0}catch(e){return!1}},d=function(e){if(!a(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return m||!!p(l,s(e))}catch(e){return!0}};d.sham=!0,e.exports=!f||i((function(){var e;return h(h.call)||!h(Object)||!h((function(){e=!0}))||e}))?d:h},2796:(e,t,r)=>{"use strict";var n=r(9039),i=r(4901),a=/#|\.prototype\./,o=function(e,t){var r=s[u(e)];return r===f||r!==c&&(i(t)?n(t):!!t)},u=o.normalize=function(e){return String(e).replace(a,".").toLowerCase()},s=o.data={},c=o.NATIVE="N",f=o.POLYFILL="P";e.exports=o},4117:e=>{"use strict";e.exports=function(e){return null==e}},34:(e,t,r)=>{"use strict";var n=r(4901);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},3925:(e,t,r)=>{"use strict";var n=r(34);e.exports=function(e){return n(e)||null===e}},6395:e=>{"use strict";e.exports=!1},788:(e,t,r)=>{"use strict";var n=r(34),i=r(4576),a=r(8227)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[a])?!!t:"RegExp"===i(e))}},757:(e,t,r)=>{"use strict";var n=r(7751),i=r(4901),a=r(1625),o=r(7040),u=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&a(t.prototype,u(e))}},2652:(e,t,r)=>{"use strict";var n=r(6080),i=r(9565),a=r(8551),o=r(6823),u=r(4209),s=r(6198),c=r(1625),f=r(81),l=r(851),p=r(9539),m=TypeError,h=function(e,t){this.stopped=e,this.result=t},d=h.prototype;e.exports=function(e,t,r){var v,y,g,x,b,w,N,D=r&&r.that,E=!(!r||!r.AS_ENTRIES),A=!(!r||!r.IS_RECORD),S=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),M=n(t,D),F=function(e){return v&&p(v,"normal",e),new h(!0,e)},O=function(e){return E?(a(e),C?M(e[0],e[1],F):M(e[0],e[1])):C?M(e,F):M(e)};if(A)v=e.iterator;else if(S)v=e;else{if(!(y=l(e)))throw new m(o(e)+" is not iterable");if(u(y)){for(g=0,x=s(e);x>g;g++)if((b=O(e[g]))&&c(d,b))return b;return new h(!1)}v=f(e,y)}for(w=A?e.next:v.next;!(N=i(w,v)).done;){try{b=O(N.value)}catch(e){p(v,"throw",e)}if("object"==typeof b&&b&&c(d,b))return b}return new h(!1)}},9539:(e,t,r)=>{"use strict";var n=r(9565),i=r(8551),a=r(5966);e.exports=function(e,t,r){var o,u;i(e);try{if(!(o=a(e,"return"))){if("throw"===t)throw r;return r}o=n(o,e)}catch(e){u=!0,o=e}if("throw"===t)throw r;if(u)throw o;return i(o),r}},3994:(e,t,r)=>{"use strict";var n=r(7657).IteratorPrototype,i=r(2360),a=r(6980),o=r(687),u=r(6269),s=function(){return this};e.exports=function(e,t,r,c){var f=t+" Iterator";return e.prototype=i(n,{next:a(+!c,r)}),o(e,f,!1,!0),u[f]=s,e}},1088:(e,t,r)=>{"use strict";var n=r(6518),i=r(9565),a=r(6395),o=r(350),u=r(4901),s=r(3994),c=r(2787),f=r(2967),l=r(687),p=r(6699),m=r(6840),h=r(8227),d=r(6269),v=r(7657),y=o.PROPER,g=o.CONFIGURABLE,x=v.IteratorPrototype,b=v.BUGGY_SAFARI_ITERATORS,w=h("iterator"),N="keys",D="values",E="entries",A=function(){return this};e.exports=function(e,t,r,o,h,v,S){s(r,t,o);var C,M,F,O=function(e){if(e===h&&I)return I;if(!b&&e&&e in B)return B[e];switch(e){case N:case D:case E:return function(){return new r(this,e)}}return function(){return new r(this)}},T=t+" Iterator",_=!1,B=e.prototype,k=B[w]||B["@@iterator"]||h&&B[h],I=!b&&k||O(h),z="Array"===t&&B.entries||k;if(z&&(C=c(z.call(new e)))!==Object.prototype&&C.next&&(a||c(C)===x||(f?f(C,x):u(C[w])||m(C,w,A)),l(C,T,!0,!0),a&&(d[T]=A)),y&&h===D&&k&&k.name!==D&&(!a&&g?p(B,"name",D):(_=!0,I=function(){return i(k,this)})),h)if(M={values:O(D),keys:v?I:O(N),entries:O(E)},S)for(F in M)(b||_||!(F in B))&&m(B,F,M[F]);else n({target:t,proto:!0,forced:b||_},M);return a&&!S||B[w]===I||m(B,w,I,{name:h}),d[t]=I,M}},7657:(e,t,r)=>{"use strict";var n,i,a,o=r(9039),u=r(4901),s=r(34),c=r(2360),f=r(2787),l=r(6840),p=r(8227),m=r(6395),h=p("iterator"),d=!1;[].keys&&("next"in(a=[].keys())?(i=f(f(a)))!==Object.prototype&&(n=i):d=!0),!s(n)||o((function(){var e={};return n[h].call(e)!==e}))?n={}:m&&(n=c(n)),u(n[h])||l(n,h,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:d}},6269:e=>{"use strict";e.exports={}},6198:(e,t,r)=>{"use strict";var n=r(8014);e.exports=function(e){return n(e.length)}},283:(e,t,r)=>{"use strict";var n=r(9504),i=r(9039),a=r(4901),o=r(9297),u=r(3724),s=r(350).CONFIGURABLE,c=r(3706),f=r(1181),l=f.enforce,p=f.get,m=String,h=Object.defineProperty,d=n("".slice),v=n("".replace),y=n([].join),g=u&&!i((function(){return 8!==h((function(){}),"length",{value:8}).length})),x=String(String).split("String"),b=e.exports=function(e,t,r){"Symbol("===d(m(t),0,7)&&(t="["+v(m(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!o(e,"name")||s&&e.name!==t)&&(u?h(e,"name",{value:t,configurable:!0}):e.name=t),g&&r&&o(r,"arity")&&e.length!==r.arity&&h(e,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?u&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=l(e);return o(n,"source")||(n.source=y(x,"string"==typeof t?t:"")),e};Function.prototype.toString=b((function(){return a(this)&&p(this).source||c(this)}),"toString")},3250:e=>{"use strict";var t=Math.expm1,r=Math.exp;e.exports=!t||t(10)>22025.465794806718||t(10)<22025.465794806718||-2e-17!==t(-2e-17)?function(e){var t=+e;return 0===t?t:t>-1e-6&&t<1e-6?t+t*t/2:r(t)-1}:t},9340:e=>{"use strict";var t=Math.log,r=Math.LOG10E;e.exports=Math.log10||function(e){return t(e)*r}},5359:e=>{"use strict";var t=Math.log;e.exports=Math.log1p||function(e){var r=+e;return r>-1e-8&&r<1e-8?r-r*r/2:t(1+r)}},7782:e=>{"use strict";e.exports=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1}},741:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},1955:(e,t,r)=>{"use strict";var n,i,a,o,u,s=r(4475),c=r(3389),f=r(6080),l=r(9225).set,p=r(8265),m=r(8119),h=r(28),d=r(6765),v=r(9088),y=s.MutationObserver||s.WebKitMutationObserver,g=s.document,x=s.process,b=s.Promise,w=c("queueMicrotask");if(!w){var N=new p,D=function(){var e,t;for(v&&(e=x.domain)&&e.exit();t=N.get();)try{t()}catch(e){throw N.head&&n(),e}e&&e.enter()};m||v||d||!y||!g?!h&&b&&b.resolve?((o=b.resolve(void 0)).constructor=b,u=f(o.then,o),n=function(){u(D)}):v?n=function(){x.nextTick(D)}:(l=f(l,s),n=function(){l(D)}):(i=!0,a=g.createTextNode(""),new y(D).observe(a,{characterData:!0}),n=function(){a.data=i=!i}),w=function(e){N.head||n(),N.add(e)}}e.exports=w},6043:(e,t,r)=>{"use strict";var n=r(9306),i=TypeError,a=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw new i("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new a(e)}},511:(e,t,r)=>{"use strict";var n=r(788),i=TypeError;e.exports=function(e){if(n(e))throw new i("The method doesn't accept regular expressions");return e}},3904:(e,t,r)=>{"use strict";var n=r(4475),i=r(9039),a=r(9504),o=r(655),u=r(3802).trim,s=r(7452),c=a("".charAt),f=n.parseFloat,l=n.Symbol,p=l&&l.iterator,m=1/f(s+"-0")!=-1/0||p&&!i((function(){f(Object(p))}));e.exports=m?function(e){var t=u(o(e)),r=f(t);return 0===r&&"-"===c(t,0)?-0:r}:f},2703:(e,t,r)=>{"use strict";var n=r(4475),i=r(9039),a=r(9504),o=r(655),u=r(3802).trim,s=r(7452),c=n.parseInt,f=n.Symbol,l=f&&f.iterator,p=/^[+-]?0x/i,m=a(p.exec),h=8!==c(s+"08")||22!==c(s+"0x16")||l&&!i((function(){c(Object(l))}));e.exports=h?function(e,t){var r=u(o(e));return c(r,t>>>0||(m(p,r)?16:10))}:c},2360:(e,t,r)=>{"use strict";var n,i=r(8551),a=r(6801),o=r(8727),u=r(421),s=r(397),c=r(4055),f=r(6119),l="prototype",p="script",m=f("IE_PROTO"),h=function(){},d=function(e){return"<"+p+">"+e+"</"+p+">"},v=function(e){e.write(d("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;y="undefined"!=typeof document?document.domain&&n?v(n):(t=c("iframe"),r="java"+p+":",t.style.display="none",s.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(d("document.F=Object")),e.close(),e.F):v(n);for(var i=o.length;i--;)delete y[l][o[i]];return y()};u[m]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(h[l]=i(e),r=new h,h[l]=null,r[m]=e):r=y(),void 0===t?r:a.f(r,t)}},6801:(e,t,r)=>{"use strict";var n=r(3724),i=r(8686),a=r(4913),o=r(8551),u=r(5397),s=r(1072);t.f=n&&!i?Object.defineProperties:function(e,t){o(e);for(var r,n=u(t),i=s(t),c=i.length,f=0;c>f;)a.f(e,r=i[f++],n[r]);return e}},4913:(e,t,r)=>{"use strict";var n=r(3724),i=r(5917),a=r(8686),o=r(8551),u=r(6969),s=TypeError,c=Object.defineProperty,f=Object.getOwnPropertyDescriptor,l="enumerable",p="configurable",m="writable";t.f=n?a?function(e,t,r){if(o(e),t=u(t),o(r),"function"==typeof e&&"prototype"===t&&"value"in r&&m in r&&!r[m]){var n=f(e,t);n&&n[m]&&(e[t]=r.value,r={configurable:p in r?r[p]:n[p],enumerable:l in r?r[l]:n[l],writable:!1})}return c(e,t,r)}:c:function(e,t,r){if(o(e),t=u(t),o(r),i)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new s("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},7347:(e,t,r)=>{"use strict";var n=r(3724),i=r(9565),a=r(8773),o=r(6980),u=r(5397),s=r(6969),c=r(9297),f=r(5917),l=Object.getOwnPropertyDescriptor;t.f=n?l:function(e,t){if(e=u(e),t=s(t),f)try{return l(e,t)}catch(e){}if(c(e,t))return o(!i(a.f,e,t),e[t])}},298:(e,t,r)=>{"use strict";var n=r(4576),i=r(5397),a=r(8480).f,o=r(7680),u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return u&&"Window"===n(e)?function(e){try{return a(e)}catch(e){return o(u)}}(e):a(i(e))}},8480:(e,t,r)=>{"use strict";var n=r(1828),i=r(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},3717:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},2787:(e,t,r)=>{"use strict";var n=r(9297),i=r(4901),a=r(8981),o=r(6119),u=r(2211),s=o("IE_PROTO"),c=Object,f=c.prototype;e.exports=u?c.getPrototypeOf:function(e){var t=a(e);if(n(t,s))return t[s];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof c?f:null}},4124:(e,t,r)=>{"use strict";var n=r(9039),i=r(34),a=r(4576),o=r(5652),u=Object.isExtensible,s=n((function(){u(1)}));e.exports=s||o?function(e){return!!i(e)&&(!o||"ArrayBuffer"!==a(e))&&(!u||u(e))}:u},1625:(e,t,r)=>{"use strict";var n=r(9504);e.exports=n({}.isPrototypeOf)},1828:(e,t,r)=>{"use strict";var n=r(9504),i=r(9297),a=r(5397),o=r(9617).indexOf,u=r(421),s=n([].push);e.exports=function(e,t){var r,n=a(e),c=0,f=[];for(r in n)!i(u,r)&&i(n,r)&&s(f,r);for(;t.length>c;)i(n,r=t[c++])&&(~o(f,r)||s(f,r));return f}},1072:(e,t,r)=>{"use strict";var n=r(1828),i=r(8727);e.exports=Object.keys||function(e){return n(e,i)}},8773:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},2967:(e,t,r)=>{"use strict";var n=r(6706),i=r(8551),a=r(3506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return i(r),a(n),t?e(r,n):r.__proto__=n,r}}():void 0)},3179:(e,t,r)=>{"use strict";var n=r(2140),i=r(6955);e.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},4270:(e,t,r)=>{"use strict";var n=r(9565),i=r(4901),a=r(34),o=TypeError;e.exports=function(e,t){var r,u;if("string"===t&&i(r=e.toString)&&!a(u=n(r,e)))return u;if(i(r=e.valueOf)&&!a(u=n(r,e)))return u;if("string"!==t&&i(r=e.toString)&&!a(u=n(r,e)))return u;throw new o("Can't convert object to primitive value")}},5031:(e,t,r)=>{"use strict";var n=r(7751),i=r(9504),a=r(8480),o=r(3717),u=r(8551),s=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=a.f(u(e)),r=o.f;return r?s(t,r(e)):t}},9167:(e,t,r)=>{"use strict";var n=r(4475);e.exports=n},1103:e=>{"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},916:(e,t,r)=>{"use strict";var n=r(4475),i=r(550),a=r(4901),o=r(2796),u=r(3706),s=r(8227),c=r(7290),f=r(516),l=r(6395),p=r(7388),m=i&&i.prototype,h=s("species"),d=!1,v=a(n.PromiseRejectionEvent),y=o("Promise",(function(){var e=u(i),t=e!==String(i);if(!t&&66===p)return!0;if(l&&(!m.catch||!m.finally))return!0;if(!p||p<51||!/native code/.test(e)){var r=new i((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[h]=n,!(d=r.then((function(){}))instanceof n))return!0}return!t&&(c||f)&&!v}));e.exports={CONSTRUCTOR:y,REJECTION_EVENT:v,SUBCLASSING:d}},550:(e,t,r)=>{"use strict";var n=r(4475);e.exports=n.Promise},3438:(e,t,r)=>{"use strict";var n=r(8551),i=r(34),a=r(6043);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=a.f(e);return(0,r.resolve)(t),r.promise}},537:(e,t,r)=>{"use strict";var n=r(550),i=r(4428),a=r(916).CONSTRUCTOR;e.exports=a||!i((function(e){n.all(e).then(void 0,(function(){}))}))},1056:(e,t,r)=>{"use strict";var n=r(4913).f;e.exports=function(e,t,r){r in e||n(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}},8265:e=>{"use strict";var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},6682:(e,t,r)=>{"use strict";var n=r(9565),i=r(8551),a=r(4901),o=r(4576),u=r(7323),s=TypeError;e.exports=function(e,t){var r=e.exec;if(a(r)){var c=n(r,e,t);return null!==c&&i(c),c}if("RegExp"===o(e))return n(u,e,t);throw new s("RegExp#exec called on incompatible receiver")}},7323:(e,t,r)=>{"use strict";var n,i,a=r(9565),o=r(9504),u=r(655),s=r(7979),c=r(8429),f=r(5745),l=r(2360),p=r(1181).get,m=r(3635),h=r(8814),d=f("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,y=v,g=o("".charAt),x=o("".indexOf),b=o("".replace),w=o("".slice),N=(i=/b*/g,a(v,n=/a/,"a"),a(v,i,"a"),0!==n.lastIndex||0!==i.lastIndex),D=c.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(N||E||D||m||h)&&(y=function(e){var t,r,n,i,o,c,f,m=this,h=p(m),A=u(e),S=h.raw;if(S)return S.lastIndex=m.lastIndex,t=a(y,S,A),m.lastIndex=S.lastIndex,t;var C=h.groups,M=D&&m.sticky,F=a(s,m),O=m.source,T=0,_=A;if(M&&(F=b(F,"y",""),-1===x(F,"g")&&(F+="g"),_=w(A,m.lastIndex),m.lastIndex>0&&(!m.multiline||m.multiline&&"\n"!==g(A,m.lastIndex-1))&&(O="(?: "+O+")",_=" "+_,T++),r=new RegExp("^(?:"+O+")",F)),E&&(r=new RegExp("^"+O+"$(?!\\s)",F)),N&&(n=m.lastIndex),i=a(v,M?r:m,_),M?i?(i.input=w(i.input,T),i[0]=w(i[0],T),i.index=m.lastIndex,m.lastIndex+=i[0].length):m.lastIndex=0:N&&i&&(m.lastIndex=m.global?i.index+i[0].length:n),E&&i&&i.length>1&&a(d,i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&C)for(i.groups=c=l(null),o=0;o<C.length;o++)c[(f=C[o])[0]]=i[f[1]];return i}),e.exports=y},7979:(e,t,r)=>{"use strict";var n=r(8551);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},1034:(e,t,r)=>{"use strict";var n=r(9565),i=r(9297),a=r(1625),o=r(7979),u=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in u||i(e,"flags")||!a(u,e)?t:n(o,e)}},8429:(e,t,r)=>{"use strict";var n=r(9039),i=r(4475).RegExp,a=n((function(){var e=i("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),o=a||n((function(){return!i("a","y").sticky})),u=a||n((function(){var e=i("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:u,MISSED_STICKY:o,UNSUPPORTED_Y:a}},3635:(e,t,r)=>{"use strict";var n=r(9039),i=r(4475).RegExp;e.exports=n((function(){var e=i(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},8814:(e,t,r)=>{"use strict";var n=r(9039),i=r(4475).RegExp;e.exports=n((function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},7750:(e,t,r)=>{"use strict";var n=r(4117),i=TypeError;e.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},3389:(e,t,r)=>{"use strict";var n=r(4475),i=r(3724),a=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!i)return n[e];var t=a(n,e);return t&&t.value}},7633:(e,t,r)=>{"use strict";var n=r(7751),i=r(2106),a=r(8227),o=r(3724),u=a("species");e.exports=function(e){var t=n(e);o&&t&&!t[u]&&i(t,u,{configurable:!0,get:function(){return this}})}},687:(e,t,r)=>{"use strict";var n=r(4913).f,i=r(9297),a=r(8227)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!i(e,a)&&n(e,a,{configurable:!0,value:t})}},6119:(e,t,r)=>{"use strict";var n=r(5745),i=r(3392),a=n("keys");e.exports=function(e){return a[e]||(a[e]=i(e))}},7629:(e,t,r)=>{"use strict";var n=r(6395),i=r(4475),a=r(9433),o="__core-js_shared__",u=e.exports=i[o]||a(o,{});(u.versions||(u.versions=[])).push({version:"3.36.0",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:(e,t,r)=>{"use strict";var n=r(7629);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},2293:(e,t,r)=>{"use strict";var n=r(8551),i=r(5548),a=r(4117),o=r(8227)("species");e.exports=function(e,t){var r,u=n(e).constructor;return void 0===u||a(r=n(u)[o])?t:i(r)}},3061:(e,t,r)=>{"use strict";var n=r(9039);e.exports=function(e){return n((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},8183:(e,t,r)=>{"use strict";var n=r(9504),i=r(1291),a=r(655),o=r(7750),u=n("".charAt),s=n("".charCodeAt),c=n("".slice),f=function(e){return function(t,r){var n,f,l=a(o(t)),p=i(r),m=l.length;return p<0||p>=m?e?"":void 0:(n=s(l,p))<55296||n>56319||p+1===m||(f=s(l,p+1))<56320||f>57343?e?u(l,p):n:e?c(l,p,p+2):f-56320+(n-55296<<10)+65536}};e.exports={codeAt:f(!1),charAt:f(!0)}},2333:(e,t,r)=>{"use strict";var n=r(1291),i=r(655),a=r(7750),o=RangeError;e.exports=function(e){var t=i(a(this)),r="",u=n(e);if(u<0||u===1/0)throw new o("Wrong number of repetitions");for(;u>0;(u>>>=1)&&(t+=t))1&u&&(r+=t);return r}},706:(e,t,r)=>{"use strict";var n=r(350).PROPER,i=r(9039),a=r(7452);e.exports=function(e){return i((function(){return!!a[e]()||"…"!=="…"[e]()||n&&a[e].name!==e}))}},3802:(e,t,r)=>{"use strict";var n=r(9504),i=r(7750),a=r(655),o=r(7452),u=n("".replace),s=RegExp("^["+o+"]+"),c=RegExp("(^|[^"+o+"])["+o+"]+$"),f=function(e){return function(t){var r=a(i(t));return 1&e&&(r=u(r,s,"")),2&e&&(r=u(r,c,"$1")),r}};e.exports={start:f(1),end:f(2),trim:f(3)}},4495:(e,t,r)=>{"use strict";var n=r(7388),i=r(9039),a=r(4475).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!a(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8242:(e,t,r)=>{"use strict";var n=r(9565),i=r(7751),a=r(8227),o=r(6840);e.exports=function(){var e=i("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,u=a("toPrimitive");t&&!t[u]&&o(t,u,(function(e){return n(r,this)}),{arity:1})}},1296:(e,t,r)=>{"use strict";var n=r(4495);e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},9225:(e,t,r)=>{"use strict";var n,i,a,o,u=r(4475),s=r(8745),c=r(6080),f=r(4901),l=r(9297),p=r(9039),m=r(397),h=r(7680),d=r(4055),v=r(2812),y=r(8119),g=r(9088),x=u.setImmediate,b=u.clearImmediate,w=u.process,N=u.Dispatch,D=u.Function,E=u.MessageChannel,A=u.String,S=0,C={},M="onreadystatechange";p((function(){n=u.location}));var F=function(e){if(l(C,e)){var t=C[e];delete C[e],t()}},O=function(e){return function(){F(e)}},T=function(e){F(e.data)},_=function(e){u.postMessage(A(e),n.protocol+"//"+n.host)};x&&b||(x=function(e){v(arguments.length,1);var t=f(e)?e:D(e),r=h(arguments,1);return C[++S]=function(){s(t,void 0,r)},i(S),S},b=function(e){delete C[e]},g?i=function(e){w.nextTick(O(e))}:N&&N.now?i=function(e){N.now(O(e))}:E&&!y?(o=(a=new E).port2,a.port1.onmessage=T,i=c(o.postMessage,o)):u.addEventListener&&f(u.postMessage)&&!u.importScripts&&n&&"file:"!==n.protocol&&!p(_)?(i=_,u.addEventListener("message",T,!1)):i=M in d("script")?function(e){m.appendChild(d("script"))[M]=function(){m.removeChild(this),F(e)}}:function(e){setTimeout(O(e),0)}),e.exports={set:x,clear:b}},1240:(e,t,r)=>{"use strict";var n=r(9504);e.exports=n(1..valueOf)},5610:(e,t,r)=>{"use strict";var n=r(1291),i=Math.max,a=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):a(r,t)}},5397:(e,t,r)=>{"use strict";var n=r(7055),i=r(7750);e.exports=function(e){return n(i(e))}},1291:(e,t,r)=>{"use strict";var n=r(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},8014:(e,t,r)=>{"use strict";var n=r(1291),i=Math.min;e.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}},8981:(e,t,r)=>{"use strict";var n=r(7750),i=Object;e.exports=function(e){return i(n(e))}},2777:(e,t,r)=>{"use strict";var n=r(9565),i=r(34),a=r(757),o=r(5966),u=r(4270),s=r(8227),c=TypeError,f=s("toPrimitive");e.exports=function(e,t){if(!i(e)||a(e))return e;var r,s=o(e,f);if(s){if(void 0===t&&(t="default"),r=n(s,e,t),!i(r)||a(r))return r;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),u(e,t)}},6969:(e,t,r)=>{"use strict";var n=r(2777),i=r(757);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},2140:(e,t,r)=>{"use strict";var n={};n[r(8227)("toStringTag")]="z",e.exports="[object z]"===String(n)},655:(e,t,r)=>{"use strict";var n=r(6955),i=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},6823:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3392:(e,t,r)=>{"use strict";var n=r(9504),i=0,a=Math.random(),o=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++i+a,36)}},7040:(e,t,r)=>{"use strict";var n=r(4495);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686:(e,t,r)=>{"use strict";var n=r(3724),i=r(9039);e.exports=n&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},2812:e=>{"use strict";var t=TypeError;e.exports=function(e,r){if(e<r)throw new t("Not enough arguments");return e}},8622:(e,t,r)=>{"use strict";var n=r(4475),i=r(4901),a=n.WeakMap;e.exports=i(a)&&/native code/.test(String(a))},5749:(e,t,r)=>{"use strict";var n=r(9167),i=r(9297),a=r(1951),o=r(4913).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});i(t,e)||o(t,e,{value:a.f(e)})}},1951:(e,t,r)=>{"use strict";var n=r(8227);t.f=n},8227:(e,t,r)=>{"use strict";var n=r(4475),i=r(5745),a=r(9297),o=r(3392),u=r(4495),s=r(7040),c=n.Symbol,f=i("wks"),l=s?c.for||c:c&&c.withoutSetter||o;e.exports=function(e){return a(f,e)||(f[e]=u&&a(c,e)?c[e]:l("Symbol."+e)),f[e]}},7452:e=>{"use strict";e.exports="\t\n\v\f\r   \u2028\u2029\ufeff"},8706:(e,t,r)=>{"use strict";var n=r(6518),i=r(9039),a=r(4376),o=r(34),u=r(8981),s=r(6198),c=r(6837),f=r(4659),l=r(1469),p=r(597),m=r(8227),h=r(7388),d=m("isConcatSpreadable"),v=h>=51||!i((function(){var e=[];return e[d]=!1,e.concat()[0]!==e})),y=function(e){if(!o(e))return!1;var t=e[d];return void 0!==t?!!t:a(e)};n({target:"Array",proto:!0,arity:1,forced:!v||!p("concat")},{concat:function(e){var t,r,n,i,a,o=u(this),p=l(o,0),m=0;for(t=-1,n=arguments.length;t<n;t++)if(y(a=-1===t?o:arguments[t]))for(i=s(a),c(m+i),r=0;r<i;r++,m++)r in a&&f(p,m,a[r]);else c(m+1),f(p,m++,a);return p.length=m,p}})},8431:(e,t,r)=>{"use strict";var n=r(6518),i=r(9213).every;n({target:"Array",proto:!0,forced:!r(4598)("every")},{every:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},3771:(e,t,r)=>{"use strict";var n=r(6518),i=r(4373),a=r(6469);n({target:"Array",proto:!0},{fill:i}),a("fill")},2008:(e,t,r)=>{"use strict";var n=r(6518),i=r(9213).filter;n({target:"Array",proto:!0,forced:!r(597)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},113:(e,t,r)=>{"use strict";var n=r(6518),i=r(9213).find,a=r(6469),o="find",u=!0;o in[]&&Array(1)[o]((function(){u=!1})),n({target:"Array",proto:!0,forced:u},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(o)},1629:(e,t,r)=>{"use strict";var n=r(6518),i=r(235);n({target:"Array",proto:!0,forced:[].forEach!==i},{forEach:i})},3418:(e,t,r)=>{"use strict";var n=r(6518),i=r(7916);n({target:"Array",stat:!0,forced:!r(4428)((function(e){Array.from(e)}))},{from:i})},4423:(e,t,r)=>{"use strict";var n=r(6518),i=r(9617).includes,a=r(9039),o=r(6469);n({target:"Array",proto:!0,forced:a((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},5276:(e,t,r)=>{"use strict";var n=r(6518),i=r(7476),a=r(9617).indexOf,o=r(4598),u=i([].indexOf),s=!!u&&1/u([1],1,-0)<0;n({target:"Array",proto:!0,forced:s||!o("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return s?u(this,e,t)||0:a(this,e,t)}})},4346:(e,t,r)=>{"use strict";r(6518)({target:"Array",stat:!0},{isArray:r(4376)})},3792:(e,t,r)=>{"use strict";var n=r(5397),i=r(6469),a=r(6269),o=r(1181),u=r(4913).f,s=r(1088),c=r(2529),f=r(6395),l=r(3724),p="Array Iterator",m=o.set,h=o.getterFor(p);e.exports=s(Array,"Array",(function(e,t){m(this,{type:p,target:n(e),index:0,kind:t})}),(function(){var e=h(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,c(void 0,!0);switch(e.kind){case"keys":return c(r,!1);case"values":return c(t[r],!1)}return c([r,t[r]],!1)}),"values");var d=a.Arguments=a.Array;if(i("keys"),i("values"),i("entries"),!f&&l&&"values"!==d.name)try{u(d,"name",{value:"values"})}catch(e){}},8598:(e,t,r)=>{"use strict";var n=r(6518),i=r(9504),a=r(7055),o=r(5397),u=r(4598),s=i([].join);n({target:"Array",proto:!0,forced:a!==Object||!u("join",",")},{join:function(e){return s(o(this),void 0===e?",":e)}})},2062:(e,t,r)=>{"use strict";var n=r(6518),i=r(9213).map;n({target:"Array",proto:!0,forced:!r(597)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},2712:(e,t,r)=>{"use strict";var n=r(6518),i=r(926).left,a=r(4598),o=r(7388);n({target:"Array",proto:!0,forced:!r(9088)&&o>79&&o<83||!a("reduce")},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},4490:(e,t,r)=>{"use strict";var n=r(6518),i=r(9504),a=r(4376),o=i([].reverse),u=[1,2];n({target:"Array",proto:!0,forced:String(u)===String(u.reverse())},{reverse:function(){return a(this)&&(this.length=this.length),o(this)}})},4782:(e,t,r)=>{"use strict";var n=r(6518),i=r(4376),a=r(3517),o=r(34),u=r(5610),s=r(6198),c=r(5397),f=r(4659),l=r(8227),p=r(597),m=r(7680),h=p("slice"),d=l("species"),v=Array,y=Math.max;n({target:"Array",proto:!0,forced:!h},{slice:function(e,t){var r,n,l,p=c(this),h=s(p),g=u(e,h),x=u(void 0===t?h:t,h);if(i(p)&&(r=p.constructor,(a(r)&&(r===v||i(r.prototype))||o(r)&&null===(r=r[d]))&&(r=void 0),r===v||void 0===r))return m(p,g,x);for(n=new(void 0===r?v:r)(y(x-g,0)),l=0;g<x;g++,l++)g in p&&f(n,l,p[g]);return n.length=l,n}})},5086:(e,t,r)=>{"use strict";var n=r(6518),i=r(9213).some;n({target:"Array",proto:!0,forced:!r(4598)("some")},{some:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},6910:(e,t,r)=>{"use strict";var n=r(6518),i=r(9504),a=r(9306),o=r(8981),u=r(6198),s=r(4606),c=r(655),f=r(9039),l=r(4488),p=r(4598),m=r(8834),h=r(3202),d=r(7388),v=r(9160),y=[],g=i(y.sort),x=i(y.push),b=f((function(){y.sort(void 0)})),w=f((function(){y.sort(null)})),N=p("sort"),D=!f((function(){if(d)return d<70;if(!(m&&m>3)){if(h)return!0;if(v)return v<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)y.push({k:t+n,v:r})}for(y.sort((function(e,t){return t.v-e.v})),n=0;n<y.length;n++)t=y[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));n({target:"Array",proto:!0,forced:b||!w||!N||!D},{sort:function(e){void 0!==e&&a(e);var t=o(this);if(D)return void 0===e?g(t):g(t,e);var r,n,i=[],f=u(t);for(n=0;n<f;n++)n in t&&x(i,t[n]);for(l(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:c(t)>c(r)?1:-1}}(e)),r=u(i),n=0;n<r;)t[n]=i[n++];for(;n<f;)s(t,n++);return t}})},4554:(e,t,r)=>{"use strict";var n=r(6518),i=r(8981),a=r(5610),o=r(1291),u=r(6198),s=r(4527),c=r(6837),f=r(1469),l=r(4659),p=r(4606),m=r(597)("splice"),h=Math.max,d=Math.min;n({target:"Array",proto:!0,forced:!m},{splice:function(e,t){var r,n,m,v,y,g,x=i(this),b=u(x),w=a(e,b),N=arguments.length;for(0===N?r=n=0:1===N?(r=0,n=b-w):(r=N-2,n=d(h(o(t),0),b-w)),c(b+r-n),m=f(x,n),v=0;v<n;v++)(y=w+v)in x&&l(m,v,x[y]);if(m.length=n,r<n){for(v=w;v<b-n;v++)g=v+r,(y=v+n)in x?x[g]=x[y]:p(x,g);for(v=b;v>b-n+r;v--)p(x,v-1)}else if(r>n)for(v=b-n;v>w;v--)g=v+r-1,(y=v+n-1)in x?x[g]=x[y]:p(x,g);for(v=0;v<r;v++)x[v+w]=arguments[v+2];return s(x,b-n+r),m}})},9089:(e,t,r)=>{"use strict";var n=r(6518),i=r(9504),a=Date,o=i(a.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return o(new a)}})},739:(e,t,r)=>{"use strict";var n=r(6518),i=r(9039),a=r(8981),o=r(2777);n({target:"Date",proto:!0,arity:1,forced:i((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(e){var t=a(this),r=o(t,"number");return"number"!=typeof r||isFinite(r)?t.toISOString():null}})},3288:(e,t,r)=>{"use strict";var n=r(9504),i=r(6840),a=Date.prototype,o="Invalid Date",u="toString",s=n(a[u]),c=n(a.getTime);String(new Date(NaN))!==o&&i(a,u,(function(){var e=c(this);return e==e?s(this):o}))},4170:(e,t,r)=>{"use strict";var n=r(6518),i=r(566);n({target:"Function",proto:!0,forced:Function.bind!==i},{bind:i})},2010:(e,t,r)=>{"use strict";var n=r(3724),i=r(350).EXISTS,a=r(9504),o=r(2106),u=Function.prototype,s=a(u.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,f=a(c.exec);n&&!i&&o(u,"name",{configurable:!0,get:function(){try{return f(c,s(this))[1]}catch(e){return""}}})},3110:(e,t,r)=>{"use strict";var n=r(6518),i=r(7751),a=r(8745),o=r(9565),u=r(9504),s=r(9039),c=r(4901),f=r(757),l=r(7680),p=r(6933),m=r(4495),h=String,d=i("JSON","stringify"),v=u(/./.exec),y=u("".charAt),g=u("".charCodeAt),x=u("".replace),b=u(1..toString),w=/[\uD800-\uDFFF]/g,N=/^[\uD800-\uDBFF]$/,D=/^[\uDC00-\uDFFF]$/,E=!m||s((function(){var e=i("Symbol")("stringify detection");return"[null]"!==d([e])||"{}"!==d({a:e})||"{}"!==d(Object(e))})),A=s((function(){return'"\\udf06\\ud834"'!==d("\udf06\ud834")||'"\\udead"'!==d("\udead")})),S=function(e,t){var r=l(arguments),n=p(t);if(c(n)||void 0!==e&&!f(e))return r[1]=function(e,t){if(c(n)&&(t=o(n,this,h(e),t)),!f(t))return t},a(d,null,r)},C=function(e,t,r){var n=y(r,t-1),i=y(r,t+1);return v(N,e)&&!v(D,i)||v(D,e)&&!v(N,n)?"\\u"+b(g(e,0),16):e};d&&n({target:"JSON",stat:!0,arity:3,forced:E||A},{stringify:function(e,t,r){var n=l(arguments),i=a(E?S:d,null,n);return A&&"string"==typeof i?x(i,w,C):i}})},8523:(e,t,r)=>{"use strict";r(6468)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(6938))},6033:(e,t,r)=>{"use strict";r(8523)},3153:(e,t,r)=>{"use strict";var n=r(6518),i=r(5359),a=Math.acosh,o=Math.log,u=Math.sqrt,s=Math.LN2;n({target:"Math",stat:!0,forced:!a||710!==Math.floor(a(Number.MAX_VALUE))||a(1/0)!==1/0},{acosh:function(e){var t=+e;return t<1?NaN:t>94906265.62425156?o(t)+s:i(t-1+u(t-1)*u(t+1))}})},2326:(e,t,r)=>{"use strict";var n=r(6518),i=Math.asinh,a=Math.log,o=Math.sqrt;n({target:"Math",stat:!0,forced:!(i&&1/i(0)>0)},{asinh:function e(t){var r=+t;return isFinite(r)&&0!==r?r<0?-e(-r):a(r+o(r*r+1)):r}})},6389:(e,t,r)=>{"use strict";var n=r(6518),i=Math.atanh,a=Math.log;n({target:"Math",stat:!0,forced:!(i&&1/i(-0)<0)},{atanh:function(e){var t=+e;return 0===t?t:a((1+t)/(1-t))/2}})},4444:(e,t,r)=>{"use strict";var n=r(6518),i=r(7782),a=Math.abs,o=Math.pow;n({target:"Math",stat:!0},{cbrt:function(e){var t=+e;return i(t)*o(a(t),1/3)}})},7762:(e,t,r)=>{"use strict";var n=r(6518),i=r(3250),a=Math.cosh,o=Math.abs,u=Math.E;n({target:"Math",stat:!0,forced:!a||a(710)===1/0},{cosh:function(e){var t=i(o(e)-1)+1;return(t+1/(t*u*u))*(u/2)}})},5070:(e,t,r)=>{"use strict";var n=r(6518),i=r(3250);n({target:"Math",stat:!0,forced:i!==Math.expm1},{expm1:i})},5376:(e,t,r)=>{"use strict";r(6518)({target:"Math",stat:!0},{log10:r(9340)})},6624:(e,t,r)=>{"use strict";r(6518)({target:"Math",stat:!0},{log1p:r(5359)})},1367:(e,t,r)=>{"use strict";var n=r(6518),i=Math.log,a=Math.LN2;n({target:"Math",stat:!0},{log2:function(e){return i(e)/a}})},5914:(e,t,r)=>{"use strict";r(6518)({target:"Math",stat:!0},{sign:r(7782)})},8553:(e,t,r)=>{"use strict";var n=r(6518),i=r(9039),a=r(3250),o=Math.abs,u=Math.exp,s=Math.E;n({target:"Math",stat:!0,forced:i((function(){return-2e-17!==Math.sinh(-2e-17)}))},{sinh:function(e){var t=+e;return o(t)<1?(a(t)-a(-t))/2:(u(t-1)-u(-t-1))*(s/2)}})},8690:(e,t,r)=>{"use strict";var n=r(6518),i=r(3250),a=Math.exp;n({target:"Math",stat:!0},{tanh:function(e){var t=+e,r=i(t),n=i(-t);return r===1/0?1:n===1/0?-1:(r-n)/(a(t)+a(-t))}})},2892:(e,t,r)=>{"use strict";var n=r(6518),i=r(6395),a=r(3724),o=r(4475),u=r(9167),s=r(9504),c=r(2796),f=r(9297),l=r(3167),p=r(1625),m=r(757),h=r(2777),d=r(9039),v=r(8480).f,y=r(7347).f,g=r(4913).f,x=r(1240),b=r(3802).trim,w="Number",N=o[w],D=u[w],E=N.prototype,A=o.TypeError,S=s("".slice),C=s("".charCodeAt),M=c(w,!N(" 0o1")||!N("0b1")||N("+0x1")),F=function(e){var t,r=arguments.length<1?0:N(function(e){var t=h(e,"number");return"bigint"==typeof t?t:function(e){var t,r,n,i,a,o,u,s,c=h(e,"number");if(m(c))throw new A("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=b(c),43===(t=C(c,0))||45===t){if(88===(r=C(c,2))||120===r)return NaN}else if(48===t){switch(C(c,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+c}for(o=(a=S(c,2)).length,u=0;u<o;u++)if((s=C(a,u))<48||s>i)return NaN;return parseInt(a,n)}return+c}(t)}(e));return p(E,t=this)&&d((function(){x(t)}))?l(Object(r),this,F):r};F.prototype=E,M&&!i&&(E.constructor=F),n({global:!0,constructor:!0,wrap:!0,forced:M},{Number:F});var O=function(e,t){for(var r,n=a?v(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;n.length>i;i++)f(t,r=n[i])&&!f(e,r)&&g(e,r,y(t,r))};i&&D&&O(u[w],D),(M||i)&&O(u[w],N)},5374:(e,t,r)=>{"use strict";r(6518)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},150:(e,t,r)=>{"use strict";r(6518)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},9868:(e,t,r)=>{"use strict";var n=r(6518),i=r(9504),a=r(1291),o=r(1240),u=r(2333),s=r(9039),c=RangeError,f=String,l=Math.floor,p=i(u),m=i("".slice),h=i(1..toFixed),d=function(e,t,r){return 0===t?r:t%2==1?d(e,t-1,r*e):d(e*e,t/2,r)},v=function(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=l(i/1e7)},y=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=l(n/t),n=n%t*1e7},g=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=f(e[t]);r=""===r?n:r+p("0",7-n.length)+n}return r};n({target:"Number",proto:!0,forced:s((function(){return"0.000"!==h(8e-5,3)||"1"!==h(.9,0)||"1.25"!==h(1.255,2)||"1000000000000000128"!==h(0xde0b6b3a7640080,0)}))||!s((function(){h({})}))},{toFixed:function(e){var t,r,n,i,u=o(this),s=a(e),l=[0,0,0,0,0,0],h="",x="0";if(s<0||s>20)throw new c("Incorrect fraction digits");if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return f(u);if(u<0&&(h="-",u=-u),u>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(u*d(2,69,1))-69)<0?u*d(2,-t,1):u/d(2,t,1),r*=4503599627370496,(t=52-t)>0){for(v(l,0,r),n=s;n>=7;)v(l,1e7,0),n-=7;for(v(l,d(10,n,1),0),n=t-1;n>=23;)y(l,1<<23),n-=23;y(l,1<<n),v(l,1,1),y(l,2),x=g(l)}else v(l,0,r),v(l,1<<-t,0),x=g(l)+p("0",s);return s>0?h+((i=x.length)<=s?"0."+p("0",s-i)+x:m(x,0,i-s)+"."+m(x,i-s)):h+x}})},630:(e,t,r)=>{"use strict";var n=r(6518),i=r(9504),a=r(9039),o=r(1240),u=i(1..toPrecision);n({target:"Number",proto:!0,forced:a((function(){return"1"!==u(1,void 0)}))||!a((function(){u({})}))},{toPrecision:function(e){return void 0===e?u(o(this)):u(o(this),e)}})},9904:(e,t,r)=>{"use strict";r(6518)({target:"Object",stat:!0,sham:!r(3724)},{create:r(2360)})},7945:(e,t,r)=>{"use strict";var n=r(6518),i=r(3724),a=r(6801).f;n({target:"Object",stat:!0,forced:Object.defineProperties!==a,sham:!i},{defineProperties:a})},4185:(e,t,r)=>{"use strict";var n=r(6518),i=r(3724),a=r(4913).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==a,sham:!i},{defineProperty:a})},3851:(e,t,r)=>{"use strict";var n=r(6518),i=r(9039),a=r(5397),o=r(7347).f,u=r(3724);n({target:"Object",stat:!0,forced:!u||i((function(){o(1)})),sham:!u},{getOwnPropertyDescriptor:function(e,t){return o(a(e),t)}})},1278:(e,t,r)=>{"use strict";var n=r(6518),i=r(3724),a=r(5031),o=r(5397),u=r(7347),s=r(4659);n({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,r,n=o(e),i=u.f,c=a(n),f={},l=0;c.length>l;)void 0!==(r=i(n,t=c[l++]))&&s(f,t,r);return f}})},9773:(e,t,r)=>{"use strict";var n=r(6518),i=r(4495),a=r(9039),o=r(3717),u=r(8981);n({target:"Object",stat:!0,forced:!i||a((function(){o.f(1)}))},{getOwnPropertySymbols:function(e){var t=o.f;return t?t(u(e)):[]}})},875:(e,t,r)=>{"use strict";var n=r(6518),i=r(9039),a=r(8981),o=r(2787),u=r(2211);n({target:"Object",stat:!0,forced:i((function(){o(1)})),sham:!u},{getPrototypeOf:function(e){return o(a(e))}})},9432:(e,t,r)=>{"use strict";var n=r(6518),i=r(8981),a=r(1072);n({target:"Object",stat:!0,forced:r(9039)((function(){a(1)}))},{keys:function(e){return a(i(e))}})},6099:(e,t,r)=>{"use strict";var n=r(2140),i=r(6840),a=r(3179);n||i(Object.prototype,"toString",a,{unsafe:!0})},8459:(e,t,r)=>{"use strict";var n=r(6518),i=r(3904);n({global:!0,forced:parseFloat!==i},{parseFloat:i})},8940:(e,t,r)=>{"use strict";var n=r(6518),i=r(2703);n({global:!0,forced:parseInt!==i},{parseInt:i})},6499:(e,t,r)=>{"use strict";var n=r(6518),i=r(9565),a=r(9306),o=r(6043),u=r(1103),s=r(2652);n({target:"Promise",stat:!0,forced:r(537)},{all:function(e){var t=this,r=o.f(t),n=r.resolve,c=r.reject,f=u((function(){var r=a(t.resolve),o=[],u=0,f=1;s(e,(function(e){var a=u++,s=!1;f++,i(r,t,e).then((function(e){s||(s=!0,o[a]=e,--f||n(o))}),c)})),--f||n(o)}));return f.error&&c(f.value),r.promise}})},2003:(e,t,r)=>{"use strict";var n=r(6518),i=r(6395),a=r(916).CONSTRUCTOR,o=r(550),u=r(7751),s=r(4901),c=r(6840),f=o&&o.prototype;if(n({target:"Promise",proto:!0,forced:a,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&s(o)){var l=u("Promise").prototype.catch;f.catch!==l&&c(f,"catch",l,{unsafe:!0})}},436:(e,t,r)=>{"use strict";var n,i,a,o=r(6518),u=r(6395),s=r(9088),c=r(4475),f=r(9565),l=r(6840),p=r(2967),m=r(687),h=r(7633),d=r(9306),v=r(4901),y=r(34),g=r(679),x=r(2293),b=r(9225).set,w=r(1955),N=r(3138),D=r(1103),E=r(8265),A=r(1181),S=r(550),C=r(916),M=r(6043),F="Promise",O=C.CONSTRUCTOR,T=C.REJECTION_EVENT,_=C.SUBCLASSING,B=A.getterFor(F),k=A.set,I=S&&S.prototype,z=S,R=I,q=c.TypeError,j=c.document,P=c.process,L=M.f,U=L,$=!!(j&&j.createEvent&&c.dispatchEvent),H="unhandledrejection",G=function(e){var t;return!(!y(e)||!v(t=e.then))&&t},V=function(e,t){var r,n,i,a=t.value,o=1===t.state,u=o?e.ok:e.fail,s=e.resolve,c=e.reject,l=e.domain;try{u?(o||(2===t.rejection&&X(t),t.rejection=1),!0===u?r=a:(l&&l.enter(),r=u(a),l&&(l.exit(),i=!0)),r===e.promise?c(new q("Promise-chain cycle")):(n=G(r))?f(n,r,s,c):s(r)):c(a)}catch(e){l&&!i&&l.exit(),c(e)}},Z=function(e,t){e.notified||(e.notified=!0,w((function(){for(var r,n=e.reactions;r=n.get();)V(r,e);e.notified=!1,t&&!e.rejection&&Y(e)})))},W=function(e,t,r){var n,i;$?((n=j.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},!T&&(i=c["on"+e])?i(n):e===H&&N("Unhandled promise rejection",r)},Y=function(e){f(b,c,(function(){var t,r=e.facade,n=e.value;if(J(e)&&(t=D((function(){s?P.emit("unhandledRejection",n,r):W(H,r,n)})),e.rejection=s||J(e)?2:1,t.error))throw t.value}))},J=function(e){return 1!==e.rejection&&!e.parent},X=function(e){f(b,c,(function(){var t=e.facade;s?P.emit("rejectionHandled",t):W("rejectionhandled",t,e.value)}))},Q=function(e,t,r){return function(n){e(t,n,r)}},K=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,Z(e,!0))},ee=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new q("Promise can't be resolved itself");var n=G(t);n?w((function(){var r={done:!1};try{f(n,t,Q(ee,r,e),Q(K,r,e))}catch(t){K(r,t,e)}})):(e.value=t,e.state=1,Z(e,!1))}catch(t){K({done:!1},t,e)}}};if(O&&(R=(z=function(e){g(this,R),d(e),f(n,this);var t=B(this);try{e(Q(ee,t),Q(K,t))}catch(e){K(t,e)}}).prototype,(n=function(e){k(this,{type:F,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:void 0})}).prototype=l(R,"then",(function(e,t){var r=B(this),n=L(x(this,z));return r.parent=!0,n.ok=!v(e)||e,n.fail=v(t)&&t,n.domain=s?P.domain:void 0,0===r.state?r.reactions.add(n):w((function(){V(n,r)})),n.promise})),i=function(){var e=new n,t=B(e);this.promise=e,this.resolve=Q(ee,t),this.reject=Q(K,t)},M.f=L=function(e){return e===z||void 0===e?new i(e):U(e)},!u&&v(S)&&I!==Object.prototype)){a=I.then,_||l(I,"then",(function(e,t){var r=this;return new z((function(e,t){f(a,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete I.constructor}catch(e){}p&&p(I,R)}o({global:!0,constructor:!0,wrap:!0,forced:O},{Promise:z}),m(z,F,!1,!0),h(F)},3362:(e,t,r)=>{"use strict";r(436),r(6499),r(2003),r(7743),r(1481),r(280)},7743:(e,t,r)=>{"use strict";var n=r(6518),i=r(9565),a=r(9306),o=r(6043),u=r(1103),s=r(2652);n({target:"Promise",stat:!0,forced:r(537)},{race:function(e){var t=this,r=o.f(t),n=r.reject,c=u((function(){var o=a(t.resolve);s(e,(function(e){i(o,t,e).then(r.resolve,n)}))}));return c.error&&n(c.value),r.promise}})},1481:(e,t,r)=>{"use strict";var n=r(6518),i=r(6043);n({target:"Promise",stat:!0,forced:r(916).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return(0,t.reject)(e),t.promise}})},280:(e,t,r)=>{"use strict";var n=r(6518),i=r(7751),a=r(6395),o=r(550),u=r(916).CONSTRUCTOR,s=r(3438),c=i("Promise"),f=a&&!u;n({target:"Promise",stat:!0,forced:a||u},{resolve:function(e){return s(f&&this===c?o:this,e)}})},825:(e,t,r)=>{"use strict";var n=r(6518),i=r(7751),a=r(8745),o=r(566),u=r(5548),s=r(8551),c=r(34),f=r(2360),l=r(9039),p=i("Reflect","construct"),m=Object.prototype,h=[].push,d=l((function(){function e(){}return!(p((function(){}),[],e)instanceof e)})),v=!l((function(){p((function(){}))})),y=d||v;n({target:"Reflect",stat:!0,forced:y,sham:y},{construct:function(e,t){u(e),s(t);var r=arguments.length<3?e:u(arguments[2]);if(v&&!d)return p(e,t,r);if(e===r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return a(h,n,t),new(a(o,e,n))}var i=r.prototype,l=f(c(i)?i:m),y=a(e,l,t);return c(y)?y:l}})},5472:(e,t,r)=>{"use strict";var n=r(6518),i=r(4475),a=r(687);n({global:!0},{Reflect:{}}),a(i.Reflect,"Reflect",!0)},4864:(e,t,r)=>{"use strict";var n=r(3724),i=r(4475),a=r(9504),o=r(2796),u=r(3167),s=r(6699),c=r(2360),f=r(8480).f,l=r(1625),p=r(788),m=r(655),h=r(1034),d=r(8429),v=r(1056),y=r(6840),g=r(9039),x=r(9297),b=r(1181).enforce,w=r(7633),N=r(8227),D=r(3635),E=r(8814),A=N("match"),S=i.RegExp,C=S.prototype,M=i.SyntaxError,F=a(C.exec),O=a("".charAt),T=a("".replace),_=a("".indexOf),B=a("".slice),k=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,I=/a/g,z=/a/g,R=new S(I)!==I,q=d.MISSED_STICKY,j=d.UNSUPPORTED_Y;if(o("RegExp",n&&(!R||q||D||E||g((function(){return z[A]=!1,S(I)!==I||S(z)===z||"/a/i"!==String(S(I,"i"))}))))){for(var P=function(e,t){var r,n,i,a,o,f,d=l(C,this),v=p(e),y=void 0===t,g=[],w=e;if(!d&&v&&y&&e.constructor===P)return e;if((v||l(C,e))&&(e=e.source,y&&(t=h(w))),e=void 0===e?"":m(e),t=void 0===t?"":m(t),w=e,D&&"dotAll"in I&&(n=!!t&&_(t,"s")>-1)&&(t=T(t,/s/g,"")),r=t,q&&"sticky"in I&&(i=!!t&&_(t,"y")>-1)&&j&&(t=T(t,/y/g,"")),E&&(a=function(e){for(var t,r=e.length,n=0,i="",a=[],o=c(null),u=!1,s=!1,f=0,l="";n<=r;n++){if("\\"===(t=O(e,n)))t+=O(e,++n);else if("]"===t)u=!1;else if(!u)switch(!0){case"["===t:u=!0;break;case"("===t:F(k,B(e,n+1))&&(n+=2,s=!0),i+=t,f++;continue;case">"===t&&s:if(""===l||x(o,l))throw new M("Invalid capture group name");o[l]=!0,a[a.length]=[l,f],s=!1,l="";continue}s?l+=t:i+=t}return[i,a]}(e),e=a[0],g=a[1]),o=u(S(e,t),d?this:C,P),(n||i||g.length)&&(f=b(o),n&&(f.dotAll=!0,f.raw=P(function(e){for(var t,r=e.length,n=0,i="",a=!1;n<=r;n++)"\\"!==(t=O(e,n))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+O(e,++n);return i}(e),r)),i&&(f.sticky=!0),g.length&&(f.groups=g)),e!==w)try{s(o,"source",""===w?"(?:)":w)}catch(e){}return o},L=f(S),U=0;L.length>U;)v(P,S,L[U++]);C.constructor=P,P.prototype=C,y(i,"RegExp",P,{constructor:!0})}w("RegExp")},7465:(e,t,r)=>{"use strict";var n=r(3724),i=r(3635),a=r(4576),o=r(2106),u=r(1181).get,s=RegExp.prototype,c=TypeError;n&&i&&o(s,"dotAll",{configurable:!0,get:function(){if(this!==s){if("RegExp"===a(this))return!!u(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},7495:(e,t,r)=>{"use strict";var n=r(6518),i=r(7323);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},7745:(e,t,r)=>{"use strict";var n=r(3724),i=r(8429).MISSED_STICKY,a=r(4576),o=r(2106),u=r(1181).get,s=RegExp.prototype,c=TypeError;n&&i&&o(s,"sticky",{configurable:!0,get:function(){if(this!==s){if("RegExp"===a(this))return!!u(this).sticky;throw new c("Incompatible receiver, RegExp required")}}})},906:(e,t,r)=>{"use strict";r(7495);var n,i,a=r(6518),o=r(9565),u=r(4901),s=r(8551),c=r(655),f=(n=!1,(i=/[ac]/).exec=function(){return n=!0,/./.exec.apply(this,arguments)},!0===i.test("abc")&&n),l=/./.test;a({target:"RegExp",proto:!0,forced:!f},{test:function(e){var t=s(this),r=c(e),n=t.exec;if(!u(n))return o(l,t,r);var i=o(n,t,r);return null!==i&&(s(i),!0)}})},8781:(e,t,r)=>{"use strict";var n=r(350).PROPER,i=r(6840),a=r(8551),o=r(655),u=r(9039),s=r(1034),c="toString",f=RegExp.prototype,l=f[c],p=u((function(){return"/a/b"!==l.call({source:"a",flags:"b"})})),m=n&&l.name!==c;(p||m)&&i(f,c,(function(){var e=a(this);return"/"+o(e.source)+"/"+o(s(e))}),{unsafe:!0})},2405:(e,t,r)=>{"use strict";r(6468)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(6938))},1415:(e,t,r)=>{"use strict";r(2405)},1699:(e,t,r)=>{"use strict";var n=r(6518),i=r(9504),a=r(511),o=r(7750),u=r(655),s=r(1436),c=i("".indexOf);n({target:"String",proto:!0,forced:!s("includes")},{includes:function(e){return!!~c(u(o(this)),u(a(e)),arguments.length>1?arguments[1]:void 0)}})},7764:(e,t,r)=>{"use strict";var n=r(8183).charAt,i=r(655),a=r(1181),o=r(1088),u=r(2529),s="String Iterator",c=a.set,f=a.getterFor(s);o(String,"String",(function(e){c(this,{type:s,string:i(e),index:0})}),(function(){var e,t=f(this),r=t.string,i=t.index;return i>=r.length?u(void 0,!0):(e=n(r,i),t.index+=e.length,u(e,!1))}))},1761:(e,t,r)=>{"use strict";var n=r(9565),i=r(9228),a=r(8551),o=r(4117),u=r(8014),s=r(655),c=r(7750),f=r(5966),l=r(7829),p=r(6682);i("match",(function(e,t,r){return[function(t){var r=c(this),i=o(t)?void 0:f(t,e);return i?n(i,t,r):new RegExp(t)[e](s(r))},function(e){var n=a(this),i=s(e),o=r(t,n,i);if(o.done)return o.value;if(!n.global)return p(n,i);var c=n.unicode;n.lastIndex=0;for(var f,m=[],h=0;null!==(f=p(n,i));){var d=s(f[0]);m[h]=d,""===d&&(n.lastIndex=l(i,u(n.lastIndex),c)),h++}return 0===h?null:m}]}))},2781:(e,t,r)=>{"use strict";r(6518)({target:"String",proto:!0},{repeat:r(2333)})},5440:(e,t,r)=>{"use strict";var n=r(8745),i=r(9565),a=r(9504),o=r(9228),u=r(9039),s=r(8551),c=r(4901),f=r(4117),l=r(1291),p=r(8014),m=r(655),h=r(7750),d=r(7829),v=r(5966),y=r(2478),g=r(6682),x=r(8227)("replace"),b=Math.max,w=Math.min,N=a([].concat),D=a([].push),E=a("".indexOf),A=a("".slice),S="$0"==="a".replace(/./,"$0"),C=!!/./[x]&&""===/./[x]("a","$0");o("replace",(function(e,t,r){var a=C?"$":"$0";return[function(e,r){var n=h(this),a=f(e)?void 0:v(e,x);return a?i(a,e,n,r):i(t,m(n),e,r)},function(e,i){var o=s(this),u=m(e);if("string"==typeof i&&-1===E(i,a)&&-1===E(i,"$<")){var f=r(t,o,u,i);if(f.done)return f.value}var h=c(i);h||(i=m(i));var v,x=o.global;x&&(v=o.unicode,o.lastIndex=0);for(var S,C=[];null!==(S=g(o,u))&&(D(C,S),x);)""===m(S[0])&&(o.lastIndex=d(u,p(o.lastIndex),v));for(var M,F="",O=0,T=0;T<C.length;T++){for(var _,B=m((S=C[T])[0]),k=b(w(l(S.index),u.length),0),I=[],z=1;z<S.length;z++)D(I,void 0===(M=S[z])?M:String(M));var R=S.groups;if(h){var q=N([B],I,k,u);void 0!==R&&D(q,R),_=m(n(i,void 0,q))}else _=y(B,u,k,I,R,i);k>=O&&(F+=A(u,O,k)+_,O=k+B.length)}return F+A(u,O)}]}),!!u((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!S||C)},8718:(e,t,r)=>{"use strict";var n=r(6518),i=r(7240);n({target:"String",proto:!0,forced:r(3061)("sub")},{sub:function(){return i(this,"sub","","")}})},375:(e,t,r)=>{"use strict";var n=r(6518),i=r(9504),a=r(7750),o=r(1291),u=r(655),s=i("".slice),c=Math.max,f=Math.min;n({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(e,t){var r,n,i=u(a(this)),l=i.length,p=o(e);return p===1/0&&(p=0),p<0&&(p=c(l+p,0)),(r=void 0===t?l:o(t))<=0||r===1/0||p>=(n=f(p+r,l))?"":s(i,p,n)}})},2762:(e,t,r)=>{"use strict";var n=r(6518),i=r(3802).trim;n({target:"String",proto:!0,forced:r(706)("trim")},{trim:function(){return i(this)}})},6761:(e,t,r)=>{"use strict";var n=r(6518),i=r(4475),a=r(9565),o=r(9504),u=r(6395),s=r(3724),c=r(4495),f=r(9039),l=r(9297),p=r(1625),m=r(8551),h=r(5397),d=r(6969),v=r(655),y=r(6980),g=r(2360),x=r(1072),b=r(8480),w=r(298),N=r(3717),D=r(7347),E=r(4913),A=r(6801),S=r(8773),C=r(6840),M=r(2106),F=r(5745),O=r(6119),T=r(421),_=r(3392),B=r(8227),k=r(1951),I=r(5749),z=r(8242),R=r(687),q=r(1181),j=r(9213).forEach,P=O("hidden"),L="Symbol",U="prototype",$=q.set,H=q.getterFor(L),G=Object[U],V=i.Symbol,Z=V&&V[U],W=i.RangeError,Y=i.TypeError,J=i.QObject,X=D.f,Q=E.f,K=w.f,ee=S.f,te=o([].push),re=F("symbols"),ne=F("op-symbols"),ie=F("wks"),ae=!J||!J[U]||!J[U].findChild,oe=function(e,t,r){var n=X(G,t);n&&delete G[t],Q(e,t,r),n&&e!==G&&Q(G,t,n)},ue=s&&f((function(){return 7!==g(Q({},"a",{get:function(){return Q(this,"a",{value:7}).a}})).a}))?oe:Q,se=function(e,t){var r=re[e]=g(Z);return $(r,{type:L,tag:e,description:t}),s||(r.description=t),r},ce=function(e,t,r){e===G&&ce(ne,t,r),m(e);var n=d(t);return m(r),l(re,n)?(r.enumerable?(l(e,P)&&e[P][n]&&(e[P][n]=!1),r=g(r,{enumerable:y(0,!1)})):(l(e,P)||Q(e,P,y(1,g(null))),e[P][n]=!0),ue(e,n,r)):Q(e,n,r)},fe=function(e,t){m(e);var r=h(t),n=x(r).concat(he(r));return j(n,(function(t){s&&!a(le,r,t)||ce(e,t,r[t])})),e},le=function(e){var t=d(e),r=a(ee,this,t);return!(this===G&&l(re,t)&&!l(ne,t))&&(!(r||!l(this,t)||!l(re,t)||l(this,P)&&this[P][t])||r)},pe=function(e,t){var r=h(e),n=d(t);if(r!==G||!l(re,n)||l(ne,n)){var i=X(r,n);return!i||!l(re,n)||l(r,P)&&r[P][n]||(i.enumerable=!0),i}},me=function(e){var t=K(h(e)),r=[];return j(t,(function(e){l(re,e)||l(T,e)||te(r,e)})),r},he=function(e){var t=e===G,r=K(t?ne:h(e)),n=[];return j(r,(function(e){!l(re,e)||t&&!l(G,e)||te(n,re[e])})),n};c||(C(Z=(V=function(){if(p(Z,this))throw new Y("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?v(arguments[0]):void 0,t=_(e),r=function(e){var n=void 0===this?i:this;n===G&&a(r,ne,e),l(n,P)&&l(n[P],t)&&(n[P][t]=!1);var o=y(1,e);try{ue(n,t,o)}catch(e){if(!(e instanceof W))throw e;oe(n,t,o)}};return s&&ae&&ue(G,t,{configurable:!0,set:r}),se(t,e)})[U],"toString",(function(){return H(this).tag})),C(V,"withoutSetter",(function(e){return se(_(e),e)})),S.f=le,E.f=ce,A.f=fe,D.f=pe,b.f=w.f=me,N.f=he,k.f=function(e){return se(B(e),e)},s&&(M(Z,"description",{configurable:!0,get:function(){return H(this).description}}),u||C(G,"propertyIsEnumerable",le,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:V}),j(x(ie),(function(e){I(e)})),n({target:L,stat:!0,forced:!c},{useSetter:function(){ae=!0},useSimple:function(){ae=!1}}),n({target:"Object",stat:!0,forced:!c,sham:!s},{create:function(e,t){return void 0===t?g(e):fe(g(e),t)},defineProperty:ce,defineProperties:fe,getOwnPropertyDescriptor:pe}),n({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:me}),z(),R(V,L),T[P]=!0},9463:(e,t,r)=>{"use strict";var n=r(6518),i=r(3724),a=r(4475),o=r(9504),u=r(9297),s=r(4901),c=r(1625),f=r(655),l=r(2106),p=r(7740),m=a.Symbol,h=m&&m.prototype;if(i&&s(m)&&(!("description"in h)||void 0!==m().description)){var d={},v=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:f(arguments[0]),t=c(h,this)?new m(e):void 0===e?m():m(e);return""===e&&(d[t]=!0),t};p(v,m),v.prototype=h,h.constructor=v;var y="Symbol(description detection)"===String(m("description detection")),g=o(h.valueOf),x=o(h.toString),b=/^Symbol\((.*)\)[^)]+$/,w=o("".replace),N=o("".slice);l(h,"description",{configurable:!0,get:function(){var e=g(this);if(u(d,e))return"";var t=x(e),r=y?N(t,7,-1):w(t,b,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:v})}},1510:(e,t,r)=>{"use strict";var n=r(6518),i=r(7751),a=r(9297),o=r(655),u=r(5745),s=r(1296),c=u("string-to-symbol-registry"),f=u("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!s},{for:function(e){var t=o(e);if(a(c,t))return c[t];var r=i("Symbol")(t);return c[t]=r,f[r]=t,r}})},2259:(e,t,r)=>{"use strict";r(5749)("iterator")},2675:(e,t,r)=>{"use strict";r(6761),r(1510),r(7812),r(3110),r(9773)},7812:(e,t,r)=>{"use strict";var n=r(6518),i=r(9297),a=r(757),o=r(6823),u=r(5745),s=r(1296),c=u("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!s},{keyFor:function(e){if(!a(e))throw new TypeError(o(e)+" is not a symbol");if(i(c,e))return c[e]}})},3500:(e,t,r)=>{"use strict";var n=r(4475),i=r(7400),a=r(9296),o=r(235),u=r(6699),s=function(e){if(e&&e.forEach!==o)try{u(e,"forEach",o)}catch(t){e.forEach=o}};for(var c in i)i[c]&&s(n[c]&&n[c].prototype);s(a)},2953:(e,t,r)=>{"use strict";var n=r(4475),i=r(7400),a=r(9296),o=r(3792),u=r(6699),s=r(687),c=r(8227)("iterator"),f=o.values,l=function(e,t){if(e){if(e[c]!==f)try{u(e,c,f)}catch(t){e[c]=f}if(s(e,t,!0),i[t])for(var r in o)if(e[r]!==o[r])try{u(e,r,o[r])}catch(t){e[r]=o[r]}}};for(var p in i)l(n[p]&&n[p].prototype,p);l(a,"DOMTokenList")},7208:(e,t,r)=>{"use strict";var n=r(6518),i=r(9565);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},2369:function(e){e.exports=function(){"use strict";function e(){return!0}function t(){return!1}function r(){}const n="Argument is not a typed-function.";return function i(){function a(e){return"object"==typeof e&&null!==e&&e.constructor===Object}const o=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:a},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],u={name:"any",test:e,isAny:!0};let s,c,f=0,l={createCount:0};function p(e){const t=s.get(e);if(t)return t;let r='Unknown type "'+e+'"';const n=e.toLowerCase();let i;for(i of c)if(i.toLowerCase()===n){r+='. Did you mean "'+i+'" ?';break}throw new TypeError(r)}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";const r=t?p(t).index:c.length,n=[];for(let t=0;t<e.length;++t){if(!e[t]||"string"!=typeof e[t].name||"function"!=typeof e[t].test)throw new TypeError("Object with properties {name: string, test: function} expected");const i=e[t].name;if(s.has(i))throw new TypeError('Duplicate type name "'+i+'"');n.push(i),s.set(i,{name:i,test:e[t].test,isAny:e[t].isAny,index:r+t,conversionsTo:[]})}const i=c.slice(r);c=c.slice(0,r).concat(n).concat(i);for(let e=r+n.length;e<c.length;++e)s.get(c[e]).index=e}function h(){s=new Map,c=[],f=0,m([u],!1)}function d(e){const t=c.filter((t=>{const r=s.get(t);return!r.isAny&&r.test(e)}));return t.length?t:["any"]}function v(e){return e&&"function"==typeof e&&"_typedFunctionData"in e}function y(e,t,r){if(!v(e))throw new TypeError(n);const i=r&&r.exact,a=N(Array.isArray(t)?t.join(","):t),o=g(a);if(!i||o in e.signatures){const t=e._typedFunctionData.signatureMap.get(o);if(t)return t}const u=a.length;let s,c;if(i){let t;for(t in s=[],e.signatures)s.push(e._typedFunctionData.signatureMap.get(t))}else s=e._typedFunctionData.signatures;for(let e=0;e<u;++e){const t=a[e],r=[];let n;for(n of s){const i=S(n.params,e);if(i&&(!t.restParam||i.restParam)){if(!i.hasAny){const e=w(i);if(t.types.some((t=>!e.has(t.name))))continue}r.push(n)}}if(s=r,0===s.length)break}for(c of s)if(c.params.length<=u)return c;throw new TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+g(a,", ")+"))")}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return e.map((e=>e.name)).join(t)}function x(e){const t=0===e.indexOf("..."),r=(t?e.length>3?e.slice(3):"any":e).split("|").map((e=>p(e.trim())));let n=!1,i=t?"...":"";return{types:r.map((function(e){return n=e.isAny||n,i+=e.name+"|",{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}})),name:i.slice(0,-1),hasAny:n,hasConversion:!1,restParam:t}}function b(e){const t=function(e){if(0===e.length)return[];const t=e.map(p);e.length>1&&t.sort(((e,t)=>e.index-t.index));let r=t[0].conversionsTo;if(1===e.length)return r;r=r.concat([]);const n=new Set(e);for(let e=1;e<t.length;++e){let i;for(i of t[e].conversionsTo)n.has(i.from)||(r.push(i),n.add(i.from))}return r}(e.types.map((e=>e.name)));let r=e.hasAny,n=e.name;const i=t.map((function(e){const t=p(e.from);return r=t.isAny||r,n+="|"+e.from,{name:e.from,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:e,conversionIndex:e.index}}));return{types:e.types.concat(i),name:n,hasAny:r,hasConversion:i.length>0,restParam:e.restParam}}function w(e){return e.typeSet||(e.typeSet=new Set,e.types.forEach((t=>e.typeSet.add(t.name)))),e.typeSet}function N(e){const t=[];if("string"!=typeof e)throw new TypeError("Signatures must be strings");const r=e.trim();if(""===r)return t;const n=r.split(",");for(let e=0;e<n.length;++e){const r=x(n[e].trim());if(r.restParam&&e!==n.length-1)throw new SyntaxError('Unexpected rest parameter "'+n[e]+'": only allowed for the last parameter');if(0===r.types.length)return null;t.push(r)}return t}function D(e){const t=H(e);return!!t&&t.restParam}function E(t){if(t&&0!==t.types.length){if(1===t.types.length)return p(t.types[0].name).test;if(2===t.types.length){const e=p(t.types[0].name).test,r=p(t.types[1].name).test;return function(t){return e(t)||r(t)}}{const e=t.types.map((function(e){return p(e.name).test}));return function(t){for(let r=0;r<e.length;r++)if(e[r](t))return!0;return!1}}}return e}function A(e){let t,r,n;if(D(e)){t=$(e).map(E);const r=t.length,n=E(H(e)),i=function(e){for(let t=r;t<e.length;t++)if(!n(e[t]))return!1;return!0};return function(e){for(let r=0;r<t.length;r++)if(!t[r](e[r]))return!1;return i(e)&&e.length>=r+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(r=E(e[0]),function(e){return r(e[0])&&1===e.length}):2===e.length?(r=E(e[0]),n=E(e[1]),function(e){return r(e[0])&&n(e[1])&&2===e.length}):(t=e.map(E),function(e){for(let r=0;r<t.length;r++)if(!t[r](e[r]))return!1;return e.length===t.length})}function S(e,t){return t<e.length?e[t]:D(e)?H(e):null}function C(e,t){const r=S(e,t);return r?w(r):new Set}function M(e){return null===e.conversion||void 0===e.conversion}function F(e,t){const r=new Set;return e.forEach((e=>{const n=C(e.params,t);let i;for(i of n)r.add(i)})),r.has("any")?["any"]:Array.from(r)}function O(e,t,r){let n,i;const a=e||"unnamed";let o,u=r;for(o=0;o<t.length;o++){const e=[];if(u.forEach((r=>{const n=E(S(r.params,o));(o<r.params.length||D(r.params))&&n(t[o])&&e.push(r)})),0===e.length){if(i=F(u,o),i.length>0){const e=d(t[o]);return n=new TypeError("Unexpected type of argument in function "+a+" (expected: "+i.join(" or ")+", actual: "+e.join(" | ")+", index: "+o+")"),n.data={category:"wrongType",fn:a,index:o,actual:e,expected:i},n}}else u=e}const s=u.map((function(e){return D(e.params)?1/0:e.params.length}));if(t.length<Math.min.apply(null,s))return i=F(u,o),n=new TypeError("Too few arguments in function "+a+" (expected: "+i.join(" or ")+", index: "+t.length+")"),n.data={category:"tooFewArgs",fn:a,index:t.length,expected:i},n;const c=Math.max.apply(null,s);if(t.length>c)return n=new TypeError("Too many arguments in function "+a+" (expected: "+c+", actual: "+t.length+")"),n.data={category:"tooManyArgs",fn:a,index:t.length,expectedLength:c},n;const f=[];for(let e=0;e<t.length;++e)f.push(d(t[e]).join("|"));return n=new TypeError('Arguments of type "'+f.join(", ")+'" do not match any of the defined signatures of function '+a+"."),n.data={category:"mismatch",actual:f},n}function T(e){let t=c.length+1;for(let r=0;r<e.types.length;r++)M(e.types[r])&&(t=Math.min(t,e.types[r].typeIndex));return t}function _(e){let t=f+1;for(let r=0;r<e.types.length;r++)M(e.types[r])||(t=Math.min(t,e.types[r].conversionIndex));return t}function B(e,t){if(e.hasAny){if(!t.hasAny)return 1}else if(t.hasAny)return-1;if(e.restParam){if(!t.restParam)return 1}else if(t.restParam)return-1;if(e.hasConversion){if(!t.hasConversion)return 1}else if(t.hasConversion)return-1;const r=T(e)-T(t);if(r<0)return-1;if(r>0)return 1;const n=_(e)-_(t);return n<0?-1:n>0?1:0}function k(e,t){const r=e.params,n=t.params,i=H(r),a=H(n),o=D(r),u=D(n);if(o&&i.hasAny){if(!u||!a.hasAny)return 1}else if(u&&a.hasAny)return-1;let s,c=0,f=0;for(s of r)s.hasAny&&++c,s.hasConversion&&++f;let l=0,p=0;for(s of n)s.hasAny&&++l,s.hasConversion&&++p;if(c!==l)return c-l;if(o&&i.hasConversion){if(!u||!a.hasConversion)return 1}else if(u&&a.hasConversion)return-1;if(f!==p)return f-p;if(o){if(!u)return 1}else if(u)return-1;const m=(r.length-n.length)*(o?-1:1);if(0!==m)return m;const h=[];let d,v=0;for(let e=0;e<r.length;++e){const t=B(r[e],n[e]);h.push(t),v+=t}if(0!==v)return v;for(d of h)if(0!==d)return d;return 0}function I(e,t){let r=t;if(e.some((e=>e.hasConversion))){const n=D(e),i=e.map(z);r=function(){const e=[],r=n?arguments.length-1:arguments.length;for(let t=0;t<r;t++)e[t]=i[t](arguments[t]);return n&&(e[r]=arguments[r].map(i[r])),t.apply(this,e)}}let n=r;if(D(e)){const t=e.length-1;n=function(){return r.apply(this,G(arguments,0,t).concat([G(arguments,t)]))}}return n}function z(e){let t,r,n,i;const a=[],o=[];switch(e.types.forEach((function(e){e.conversion&&(a.push(p(e.conversion.from).test),o.push(e.conversion.convert))})),o.length){case 0:return function(e){return e};case 1:return t=a[0],n=o[0],function(e){return t(e)?n(e):e};case 2:return t=a[0],r=a[1],n=o[0],i=o[1],function(e){return t(e)?n(e):r(e)?i(e):e};default:return function(e){for(let t=0;t<o.length;t++)if(a[t](e))return o[t](e);return e}}}function R(e){return function e(t,r,n){if(r<t.length){const o=t[r];let u=[];if(o.restParam){const e=o.types.filter(M);e.length<o.types.length&&u.push({types:e,name:"..."+e.map((e=>e.name)).join("|"),hasAny:e.some((e=>e.isAny)),hasConversion:!1,restParam:!0}),u.push(o)}else u=o.types.map((function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}}));return i=u,a=function(i){return e(t,r+1,n.concat([i]))},Array.prototype.concat.apply([],i.map(a))}var i,a;return[n]}(e,0,[])}function q(e,t){const r=Math.max(e.length,t.length);for(let n=0;n<r;n++){const r=C(e,n),i=C(t,n);let a,o=!1;for(a of i)if(r.has(a)){o=!0;break}if(!o)return!1}const n=e.length,i=t.length,a=D(e),o=D(t);return a?o?n===i:i>=n:o?n>=i:n===i}function j(e,t,r){const n=[];let i;for(i of e){let e=r[i];if("number"!=typeof e)throw new TypeError('No definition for referenced signature "'+i+'"');if(e=t[e],"function"!=typeof e)return!1;n.push(e)}return n}function P(e,t,r){const n=function(e){return e.map((e=>Y(e)?Z(e.referToSelf.callback):W(e)?V(e.referTo.references,e.referTo.callback):e))}(e),i=new Array(n.length).fill(!1);let a=!0;for(;a;){a=!1;let e=!0;for(let o=0;o<n.length;++o){if(i[o])continue;const u=n[o];if(Y(u))n[o]=u.referToSelf.callback(r),n[o].referToSelf=u.referToSelf,i[o]=!0,e=!1;else if(W(u)){const r=j(u.referTo.references,n,t);r?(n[o]=u.referTo.callback.apply(this,r),n[o].referTo=u.referTo,i[o]=!0,e=!1):a=!0}}if(e&&a)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return n}function L(e,n){if(l.createCount++,0===Object.keys(n).length)throw new SyntaxError("No signatures provided");l.warnAgainstDeprecatedThis&&function(e){const t=/\bthis(\(|\.signatures\b)/;Object.keys(e).forEach((r=>{const n=e[r];if(t.test(n.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")}))}(n);const i=[],a=[],o={},u=[];let s;for(s in n){if(!Object.prototype.hasOwnProperty.call(n,s))continue;const e=N(s);if(!e)continue;i.forEach((function(t){if(q(t,e))throw new TypeError('Conflicting signatures "'+g(t)+'" and "'+g(e)+'".')})),i.push(e);const t=a.length;a.push(n[s]);const r=e.map(b);let c;for(c of R(r)){const e=g(c);u.push({params:c,name:e,fn:t}),c.every((e=>!e.hasConversion))&&(o[e]=t)}}u.sort(k);const c=P(a,o,ue);let f;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(o[f]=c[o[f]]);const p=[],m=new Map;for(f of u)m.has(f.name)||(f.fn=c[f.fn],p.push(f),m.set(f.name,f));const h=p[0]&&p[0].params.length<=2&&!D(p[0].params),d=p[1]&&p[1].params.length<=2&&!D(p[1].params),v=p[2]&&p[2].params.length<=2&&!D(p[2].params),y=p[3]&&p[3].params.length<=2&&!D(p[3].params),x=p[4]&&p[4].params.length<=2&&!D(p[4].params),w=p[5]&&p[5].params.length<=2&&!D(p[5].params),S=h&&d&&v&&y&&x&&w;for(let e=0;e<p.length;++e)p[e].test=A(p[e].params);const C=h?E(p[0].params[0]):t,M=d?E(p[1].params[0]):t,F=v?E(p[2].params[0]):t,O=y?E(p[3].params[0]):t,T=x?E(p[4].params[0]):t,_=w?E(p[5].params[0]):t,B=h?E(p[0].params[1]):t,z=d?E(p[1].params[1]):t,j=v?E(p[2].params[1]):t,L=y?E(p[3].params[1]):t,U=x?E(p[4].params[1]):t,$=w?E(p[5].params[1]):t;for(let e=0;e<p.length;++e)p[e].implementation=I(p[e].params,p[e].fn);const H=h?p[0].implementation:r,G=d?p[1].implementation:r,V=v?p[2].implementation:r,Z=y?p[3].implementation:r,W=x?p[4].implementation:r,Y=w?p[5].implementation:r,J=h?p[0].params.length:-1,X=d?p[1].params.length:-1,Q=v?p[2].params.length:-1,K=y?p[3].params.length:-1,ee=x?p[4].params.length:-1,te=w?p[5].params.length:-1,re=S?6:0,ne=p.length,ie=p.map((e=>e.test)),ae=p.map((e=>e.implementation)),oe=function(){for(let e=re;e<ne;e++)if(ie[e](arguments))return ae[e].apply(this,arguments);return l.onMismatch(e,arguments,p)};function ue(e,t){return arguments.length===J&&C(e)&&B(t)?H.apply(this,arguments):arguments.length===X&&M(e)&&z(t)?G.apply(this,arguments):arguments.length===Q&&F(e)&&j(t)?V.apply(this,arguments):arguments.length===K&&O(e)&&L(t)?Z.apply(this,arguments):arguments.length===ee&&T(e)&&U(t)?W.apply(this,arguments):arguments.length===te&&_(e)&&$(t)?Y.apply(this,arguments):oe.apply(this,arguments)}try{Object.defineProperty(ue,"name",{value:e})}catch(e){}return ue.signatures=o,ue._typedFunctionData={signatures:p,signatureMap:m},ue}function U(e,t,r){throw O(e,t,r)}function $(e){return G(e,0,e.length-1)}function H(e){return e[e.length-1]}function G(e,t,r){return Array.prototype.slice.call(e,t,r)}function V(e,t){return{referTo:{references:e,callback:t}}}function Z(e){if("function"!=typeof e)throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:e}}}function W(e){return e&&"object"==typeof e.referTo&&Array.isArray(e.referTo.references)&&"function"==typeof e.referTo.callback}function Y(e){return e&&"object"==typeof e.referToSelf&&"function"==typeof e.referToSelf.callback}function J(e,t){if(!e)return t;if(t&&t!==e){const r=new Error("Function names do not match (expected: "+e+", actual: "+t+")");throw r.data={actual:t,expected:e},r}return e}function X(e){let t;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(v(e[r])||"string"==typeof e[r].signature)&&(t=J(t,e[r].name));return t}function Q(e,t){let r;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(r in e&&t[r]!==e[r]){const n=new Error('Signature "'+r+'" is defined twice');throw n.data={signature:r,sourceFunction:t[r],destFunction:e[r]},n}e[r]=t[r]}}h(),m(o);const K=l;function ee(e){if(!e||"string"!=typeof e.from||"string"!=typeof e.to||"function"!=typeof e.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(e.to===e.from)throw new SyntaxError('Illegal to define conversion from "'+e.from+'" to itself.')}return l=function(e){const t="string"==typeof e;let r=t?e:"";const n={};for(let e=t?1:0;e<arguments.length;++e){const i=arguments[e];let o,u={};if("function"==typeof i?(o=i.name,"string"==typeof i.signature?u[i.signature]=i:v(i)&&(u=i.signatures)):a(i)&&(u=i,t||(o=X(i))),0===Object.keys(u).length){const t=new TypeError("Argument to 'typed' at index "+e+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw t.data={index:e,argument:i},t}t||(r=J(r,o)),Q(n,u)}return L(r||"",n)},l.create=i,l.createCount=K.createCount,l.onMismatch=U,l.throwMismatchError=U,l.createError=O,l.clear=h,l.clearConversions=function(){let e;for(e of c)s.get(e).conversionsTo=[];f=0},l.addTypes=m,l._findType=p,l.referTo=function(){const e=$(arguments).map((e=>g(N(e)))),t=H(arguments);if("function"!=typeof t)throw new TypeError("Callback function expected as last argument");return V(e,t)},l.referToSelf=Z,l.convert=function(e,t){const r=p(t);if(r.test(e))return e;const n=r.conversionsTo;if(0===n.length)throw new Error("There are no conversions to "+t+" defined.");for(let t=0;t<n.length;t++)if(p(n[t].from).test(e))return n[t].convert(e);throw new Error("Cannot convert "+e+" to "+t)},l.findSignature=y,l.find=function(e,t,r){return y(e,t,r).implementation},l.isTypedFunction=v,l.warnAgainstDeprecatedThis=!0,l.addType=function(e,t){let r="any";!1!==t&&s.has("Object")&&(r="Object"),l.addTypes([e],r)},l.addConversion=function(e){ee(e);const t=p(e.to);if(!t.conversionsTo.every((function(t){return t.from!==e.from})))throw new Error('There is already a conversion from "'+e.from+'" to "'+t.name+'"');t.conversionsTo.push({from:e.from,convert:e.convert,index:f++})},l.addConversions=function(e){e.forEach(l.addConversion)},l.removeConversion=function(e){ee(e);const t=p(e.to),r=function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return e[r]}(t.conversionsTo,(t=>t.from===e.from));if(!r)throw new Error("Attempt to remove nonexistent conversion from "+e.from+" to "+e.to);if(r.convert!==e.convert)throw new Error("Conversion to remove does not match existing conversion");const n=t.conversionsTo.indexOf(r);t.conversionsTo.splice(n,1)},l.resolve=function(e,t){if(!v(e))throw new TypeError(n);const r=e._typedFunctionData.signatures;for(let e=0;e<r.length;++e)if(r[e].test(t))return r[e];return null},l}()}()}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.amdD=function(){throw new Error("define cannot be used indirect")},r.amdO={},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};return(()=>{"use strict";r.d(n,{default:()=>Ig});var e={};function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function i(e){return"number"==typeof e}function a(e){return!(!e||"object"!==t(e)||"function"!=typeof e.constructor)&&(!0===e.isBigNumber&&"object"===t(e.constructor.prototype)&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function o(e){return e&&"object"===t(e)&&!0===Object.getPrototypeOf(e).isComplex||!1}function u(e){return e&&"object"===t(e)&&!0===Object.getPrototypeOf(e).isFraction||!1}function s(e){return e&&!0===e.constructor.prototype.isUnit||!1}function c(e){return"string"==typeof e}r.r(e),r.d(e,{createAbs:()=>va,createAccessorNode:()=>Mp,createAcos:()=>qf,createAcosh:()=>nl,createAcot:()=>al,createAcoth:()=>ul,createAcsc:()=>cl,createAcsch:()=>ll,createAdd:()=>sp,createAddScalar:()=>wa,createAnd:()=>Bc,createAndTransform:()=>Ag,createApply:()=>ga,createApplyTransform:()=>Xy,createArg:()=>uu,createArrayNode:()=>_p,createAsec:()=>ml,createAsech:()=>dl,createAsin:()=>yl,createAsinh:()=>gl,createAssignmentNode:()=>Up,createAtan:()=>xl,createAtan2:()=>wl,createAtanh:()=>Dl,createAtomicMass:()=>My,createAvogadro:()=>Fy,createBellNumbers:()=>Kd,createBigNumberClass:()=>Ur,createBignumber:()=>Oi,createBin:()=>Hs,createBitAnd:()=>Ko,createBitAndTransform:()=>Cg,createBitNot:()=>tu,createBitOr:()=>nu,createBitOrTransform:()=>Mg,createBitXor:()=>ou,createBlockNode:()=>Vp,createBohrMagneton:()=>sy,createBohrRadius:()=>hy,createBoltzmann:()=>Oy,createBoolean:()=>Fi,createCatalan:()=>tv,createCbrt:()=>Aa,createCeil:()=>Ba,createChain:()=>Fh,createChainClass:()=>Nh,createClassicalElectronRadius:()=>dy,createClone:()=>Gn,createColumn:()=>Du,createColumnTransform:()=>Qy,createCombinations:()=>vd,createCombinationsWithRep:()=>xd,createCompare:()=>Ic,createCompareNatural:()=>jc,createCompareText:()=>Uc,createCompile:()=>Ym,createComplex:()=>Ti,createComplexClass:()=>Hr,createComposition:()=>nv,createConcat:()=>wu,createConcatTransform:()=>mg,createConditionalNode:()=>Jp,createConductanceQuantum:()=>cy,createConj:()=>cu,createConstantNode:()=>um,createCorr:()=>pd,createCos:()=>Al,createCosh:()=>Cl,createCot:()=>Ml,createCoth:()=>Ol,createCoulomb:()=>oy,createCount:()=>Au,createCreateUnit:()=>zf,createCross:()=>Cu,createCsc:()=>Tl,createCsch:()=>Bl,createCtranspose:()=>ws,createCube:()=>Ia,createCumSum:()=>Kh,createCumSumTransform:()=>bg,createDeepEqual:()=>sf,createDenseMatrixClass:()=>$n,createDerivative:()=>wv,createDet:()=>Oh,createDeuteronMass:()=>wy,createDiag:()=>Fu,createDiff:()=>Zu,createDiffTransform:()=>dg,createDistance:()=>Yh,createDivide:()=>Zh,createDivideScalar:()=>rc,createDot:()=>mp,createDotDivide:()=>dc,createDotMultiply:()=>Io,createDotPow:()=>mc,createE:()=>Pv,createEfimovFactor:()=>Cy,createEigs:()=>zh,createElectricConstant:()=>iy,createElectronMass:()=>vy,createElementaryCharge:()=>uy,createEqual:()=>Hc,createEqualScalar:()=>Di,createEqualText:()=>Zc,createErf:()=>Fs,createEvaluate:()=>Xm,createExp:()=>za,createExpm:()=>qh,createExpm1:()=>qa,createFactorial:()=>_d,createFalse:()=>kv,createFaraday:()=>Ty,createFermiCoupling:()=>yy,createFft:()=>Es,createFibonacciHeapClass:()=>wf,createFilter:()=>Tu,createFilterTransform:()=>eg,createFineStructure:()=>gy,createFirstRadiation:()=>_y,createFix:()=>Ua,createFlatten:()=>ku,createFloor:()=>Va,createForEach:()=>zu,createForEachTransform:()=>rg,createFormat:()=>$s,createFraction:()=>_i,createFractionClass:()=>Vr,createFreqz:()=>Cv,createFunctionAssignmentNode:()=>pm,createFunctionNode:()=>Gm,createGamma:()=>Md,createGasConstant:()=>ky,createGcd:()=>co,createGetMatrixDataType:()=>ju,createGravitationConstant:()=>ey,createGravity:()=>$y,createHartreeEnergy:()=>xy,createHasNumericValue:()=>li,createHelp:()=>Ch,createHelpClass:()=>wh,createHex:()=>Vs,createHypot:()=>fp,createI:()=>Wv,createIdentity:()=>Lu,createIfft:()=>Ss,createIm:()=>fu,createImmutableDenseMatrixClass:()=>gf,createIndex:()=>vp,createIndexClass:()=>xf,createIndexNode:()=>vm,createIndexTransform:()=>ng,createInfinity:()=>zv,createIntersect:()=>Jh,createInv:()=>Th,createInverseConductanceQuantum:()=>fy,createInvmod:()=>_o,createIsInteger:()=>ei,createIsNaN:()=>yi,createIsNegative:()=>ui,createIsNumeric:()=>ci,createIsPositive:()=>mi,createIsPrime:()=>Ks,createIsZero:()=>di,createKldivergence:()=>kd,createKlitzing:()=>my,createKron:()=>$u,createLN10:()=>$v,createLN2:()=>Uv,createLOG10E:()=>Gv,createLOG2E:()=>Hv,createLarger:()=>tf,createLargerEq:()=>af,createLcm:()=>lo,createLeafCount:()=>av,createLeftShift:()=>Mc,createLgamma:()=>Od,createLog:()=>uc,createLog10:()=>mo,createLog1p:()=>cc,createLog2:()=>vo,createLoschmidt:()=>By,createLsolve:()=>gc,createLsolveAll:()=>Nc,createLup:()=>th,createLusolve:()=>gh,createLyap:()=>Vh,createMad:()=>id,createMagneticConstant:()=>ny,createMagneticFluxQuantum:()=>ly,createMap:()=>Hu,createMapTransform:()=>ig,createMatrix:()=>ki,createMatrixClass:()=>Wr,createMatrixFromColumns:()=>Ui,createMatrixFromFunction:()=>zi,createMatrixFromRows:()=>ji,createMax:()=>vf,createMaxTransform:()=>ug,createMean:()=>td,createMeanTransform:()=>sg,createMedian:()=>nd,createMin:()=>yf,createMinTransform:()=>cg,createMod:()=>eo,createMode:()=>qs,createMolarMass:()=>Ly,createMolarMassC12:()=>Uy,createMolarPlanckConstant:()=>Iy,createMolarVolume:()=>zy,createMultinomial:()=>zd,createMultiply:()=>xo,createMultiplyScalar:()=>yo,createNaN:()=>Rv,createNeutronMass:()=>Ny,createNode:()=>gp,createNorm:()=>pp,createNot:()=>yu,createNthRoot:()=>wo,createNthRoots:()=>lc,createNuclearMagneton:()=>py,createNull:()=>Iv,createNumber:()=>Ai,createNumeric:()=>ec,createObjectNode:()=>bm,createOct:()=>Gs,createOnes:()=>Wu,createOperatorNode:()=>Am,createOr:()=>gu,createOrTransform:()=>Sg,createParenthesisNode:()=>Fm,createParse:()=>Zm,createParser:()=>eh,createParserClass:()=>Qm,createPartitionSelect:()=>mf,createPermutations:()=>qd,createPhi:()=>Lv,createPi:()=>qv,createPickRandom:()=>Hd,createPinv:()=>Bh,createPlanckCharge:()=>Zy,createPlanckConstant:()=>ty,createPlanckLength:()=>Hy,createPlanckMass:()=>Gy,createPlanckTemperature:()=>Wy,createPlanckTime:()=>Vy,createPolynomialRoot:()=>bh,createPow:()=>nc,createPrint:()=>Ys,createPrintTransform:()=>Eg,createProd:()=>Ls,createProtonMass:()=>by,createQr:()=>rh,createQuantileSeq:()=>cd,createQuantileSeqTransform:()=>gg,createQuantumOfCirculation:()=>Dy,createRandom:()=>Zd,createRandomInt:()=>Yd,createRange:()=>Ku,createRangeClass:()=>Zr,createRangeNode:()=>Bm,createRangeTransform:()=>fg,createRationalize:()=>Dv,createRe:()=>lu,createReducedPlanckConstant:()=>ry,createRelationalNode:()=>Rm,createReplacer:()=>Fv,createReshape:()=>ts,createResize:()=>rs,createResolve:()=>yv,createResultSet:()=>at,createReviver:()=>Mv,createRightArithShift:()=>Oc,createRightLogShift:()=>_c,createRotate:()=>is,createRotationMatrix:()=>os,createRound:()=>oc,createRow:()=>us,createRowTransform:()=>lg,createRydberg:()=>Ey,createSQRT1_2:()=>Vv,createSQRT2:()=>Zv,createSackurTetrode:()=>Ry,createSchur:()=>Hh,createSec:()=>kl,createSech:()=>zl,createSecondRadiation:()=>qy,createSetCartesian:()=>$l,createSetDifference:()=>Gl,createSetDistinct:()=>Zl,createSetIntersect:()=>Yl,createSetIsSubset:()=>Xl,createSetMultiplicity:()=>Kl,createSetPowerset:()=>tp,createSetSize:()=>np,createSetSymDifference:()=>ap,createSetUnion:()=>up,createSign:()=>Do,createSimplify:()=>lv,createSimplifyConstant:()=>hv,createSimplifyCore:()=>vv,createSin:()=>Rl,createSinh:()=>jl,createSize:()=>cs,createSlu:()=>dh,createSmaller:()=>Yc,createSmallerEq:()=>Qc,createSolveODE:()=>Ms,createSort:()=>df,createSpaClass:()=>Nf,createSparse:()=>kf,createSparseMatrixClass:()=>Ei,createSpeedOfLight:()=>Kv,createSplitUnit:()=>Hi,createSqrt:()=>Eo,createSqrtm:()=>Ph,createSquare:()=>So,createSqueeze:()=>ls,createStd:()=>fd,createStdTransform:()=>vg,createStefanBoltzmann:()=>jy,createStirlingS2:()=>Xd,createString:()=>Ci,createSubset:()=>ms,createSubsetTransform:()=>pg,createSubtract:()=>Mo,createSubtractScalar:()=>Da,createSum:()=>Xh,createSumTransform:()=>yg,createSylvester:()=>Uh,createSymbolNode:()=>Pm,createSymbolicEqual:()=>xv,createTan:()=>Pl,createTanh:()=>Ll,createTau:()=>jv,createThomsonCrossSection:()=>Ay,createTo:()=>Xs,createTrace:()=>hp,createTranspose:()=>xs,createTrue:()=>Bv,createTypeOf:()=>xi,createTyped:()=>Ke,createUnaryMinus:()=>ma,createUnaryPlus:()=>da,createUnequal:()=>ff,createUnitClass:()=>Of,createUnitFunction:()=>_f,createUppercaseE:()=>Jv,createUppercasePi:()=>Yv,createUsolve:()=>bc,createUsolveAll:()=>Ec,createVacuumImpedance:()=>ay,createVariance:()=>ud,createVarianceTransform:()=>Ng,createVersion:()=>Xv,createWeakMixingAngle:()=>Sy,createWienDisplacement:()=>Py,createXgcd:()=>Oo,createXor:()=>xu,createZeros:()=>Ds,createZeta:()=>zs,createZpk2tf:()=>Av}),r(4423),r(5086),r(2892),r(6099),r(7495),r(906),r(1699),r(4346),r(3288),r(2010),r(875),r(4864),r(7465),r(7745),r(8781);var f=Array.isArray;function l(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function p(e){return Array.isArray(e)||l(e)}function m(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function h(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function d(e){return e&&!0===e.constructor.prototype.isRange||!1}function v(e){return e&&!0===e.constructor.prototype.isIndex||!1}function y(e){return"boolean"==typeof e}function g(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function x(e){return e&&!0===e.constructor.prototype.isHelp||!1}function b(e){return"function"==typeof e}function w(e){return e instanceof Date}function N(e){return e instanceof RegExp}function D(e){return!(!e||"object"!==t(e)||e.constructor!==Object||o(e)||u(e))}function E(e){return null===e}function A(e){return void 0===e}function S(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function C(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function M(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function F(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function O(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function T(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function _(e){return T(e)||q(e)&&1===e.args.length&&T(e.args[0])&&"-+~".includes(e.op)}function B(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function k(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function I(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function z(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function R(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function q(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function j(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function P(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function L(e){return e&&!0===e.isRelationalNode&&!0===e.constructor.prototype.isNode||!1}function U(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function $(e){return e&&!0===e.constructor.prototype.isChain||!1}function H(e){var r=t(e);return"object"===r?null===e?"null":a(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":r}var G=r(2369);function V(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}r(8706),r(5276),r(8598),r(2062),r(4782),r(4554),r(3153),r(2326),r(6389),r(4444),r(7762),r(5070),r(5376),r(6624),r(1367),r(5914),r(8553),r(8690),r(5374),r(8459),r(8940),r(1761),r(5440);var Z=Math.sign||function(e){return e>0?1:e<0?-1:0},W=Math.log2||function(e){return Math.log(e)/Math.LN2},Y=Math.log10||function(e){return Math.log(e)/Math.LN10},J=Math.log1p||function(e){return Math.log(e+1)},X=Math.cbrt||function(e){if(0===e)return e;var t,r=e<0;return r&&(e=-e),t=isFinite(e)?(e/((t=Math.exp(Math.log(e)/3))*t)+2*t)/3:e,r?-t:t},Q=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function K(e,t,r){var n={2:"0b",8:"0o",16:"0x"}[t],i="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!V(r))throw new Error("size must be an integer");if(e>Math.pow(2,r-1)-1||e<-Math.pow(2,r-1))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!V(e))throw new Error("Value must be an integer");e<0&&(e+=Math.pow(2,r)),i="i".concat(r)}var a="";return e<0&&(e=-e,a="-"),"".concat(a).concat(n).concat(e.toString(t)).concat(i)}function ee(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var r=te(t),n=r.notation,a=r.precision,o=r.wordSize;switch(n){case"fixed":return ne(e,a);case"exponential":return ie(e,a);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=ae(re(e),t),n=r.exponent,a=r.coefficients,o=n%3==0?n:n<0?n-3-n%3:n-n%3;if(i(t))for(;t>a.length||n-o+1>a.length;)a.push(0);else for(var u=Math.abs(n-o)-(a.length-1),s=0;s<u;s++)a.push(0);for(var c=Math.abs(n-o),f=1;c>0;)f++,c--;var l=a.slice(f).join(""),p=i(t)&&l.length||l.match(/[1-9]/)?"."+l:"",m=a.slice(0,f).join("")+p+"e"+(n>=0?"+":"")+o.toString();return r.sign+m}(e,a);case"bin":return K(e,2,o);case"oct":return K(e,8,o);case"hex":return K(e,16,o);case"auto":return function(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=ve(null==r?void 0:r.lowerExp,-3),i=ve(null==r?void 0:r.upperExp,5),a=re(e),o=t?ae(a,t):a;if(o.exponent<n||o.exponent>=i)return ie(e,t);var u=o.coefficients,s=o.exponent;u.length<t&&(u=u.concat(oe(t-u.length))),u=u.concat(oe(s-u.length+1+(u.length<t?t-u.length:0)));var c=s>0?s:0;return c<(u=oe(-s).concat(u)).length-1&&u.splice(c+1,0,"."),o.sign+u.join("")}(e,a,t).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function te(e){var t,r,n="auto";if(void 0!==e)if(i(e))t=e;else if(a(e))t=e.toNumber();else{if(!D(e))throw new Error("Unsupported type of options, number, BigNumber, or object expected");void 0!==e.precision&&(t=de(e.precision,(function(){throw new Error('Option "precision" must be a number or BigNumber')}))),void 0!==e.wordSize&&(r=de(e.wordSize,(function(){throw new Error('Option "wordSize" must be a number or BigNumber')}))),e.notation&&(n=e.notation)}return{notation:n,precision:t,wordSize:r}}function re(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),a=n.indexOf(".");i+=-1!==a?a-1:n.length-1;var o=n.replace(".","").replace(/^0*/,(function(e){return i-=e.length,""})).replace(/0*$/,"").split("").map((function(e){return parseInt(e)}));return 0===o.length&&(o.push(0),i++),{sign:r,coefficients:o,exponent:i}}function ne(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=re(e),n="number"==typeof t?ae(r,r.exponent+1+t):r,i=n.coefficients,a=n.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(oe(o-i.length))),a<0&&(i=oe(1-a).concat(i),a=1),a<i.length&&i.splice(a,0,0===a?"0.":"."),n.sign+i.join("")}function ie(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=re(e),n=t?ae(r,t):r,i=n.coefficients,a=n.exponent;i.length<t&&(i=i.concat(oe(t-i.length)));var o=i.shift();return n.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function ae(e,t){for(var r={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=r.coefficients;t<=0;)n.unshift(0),r.exponent++,t++;if(n.length>t&&n.splice(t,n.length-t)[0]>=5){var i=t-1;for(n[i]++;10===n[i];)n.pop(),0===i&&(n.unshift(0),r.exponent++,i++),n[--i]++}return r}function oe(e){for(var t=[],r=0;r<e;r++)t.push(0);return t}var ue=Number.EPSILON||2220446049250313e-31;function se(e,t,r){if(null==r)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var n=Math.abs(e-t);return n<=ue||n<=Math.max(Math.abs(e),Math.abs(t))*r}return!1}var ce=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},fe=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},le=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},pe=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},me=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},he=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function de(e,t){return i(e)?e:a(e)?e.toNumber():void t()}function ve(e,t){return i(e)?e:a(e)?e.toNumber():t}function ye(e){var r=t(e);if("number"===r||"string"===r||"boolean"===r||null==e)return e;if("function"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map((function(e){return ye(e)}));if(e instanceof Date)return new Date(e.valueOf());if(a(e))return e;if(D(e))return ge(e,ye);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function ge(e,t){var r={};for(var n in e)Ae(e,n)&&(r[n]=t(e[n]));return r}function xe(e,t){for(var r in t)Ae(t,r)&&(e[r]=t[r]);return e}function be(e,t){if(Array.isArray(t))throw new TypeError("Arrays are not supported by deepExtend");for(var r in t)if(Ae(t,r)&&!(r in Object.prototype)&&!(r in Function.prototype))if(t[r]&&t[r].constructor===Object)void 0===e[r]&&(e[r]={}),e[r]&&e[r].constructor===Object?be(e[r],t[r]):e[r]=t[r];else{if(Array.isArray(t[r]))throw new TypeError("Arrays are not supported by deepExtend");e[r]=t[r]}return e}function we(e,t){var r,n,i;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(n=0,i=e.length;n<i;n++)if(!we(e[n],t[n]))return!1;return!0}if("function"==typeof e)return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(r in e)if(!(r in t)||!we(e[r],t[r]))return!1;for(r in t)if(!(r in e))return!1;return!0}return e===t}function Ne(e){var t={};return De(e,t),t}function De(e,r){for(var n in e)if(Ae(e,n)){var i=e[n];"object"===t(i)&&null!==i?De(i,r):r[n]=i}}function Ee(e,t,r){var n,i=!0;Object.defineProperty(e,t,{get:function(){return i&&(n=r(),i=!1),n},set:function(e){n=e,i=!1},configurable:!0,enumerable:!0})}function Ae(e,t){return e&&Object.hasOwnProperty.call(e,t)}function Se(e){return Object.keys(e).map((function(t){return e[t]}))}function Ce(e,t,r,n){function i(n){var i=function(e,t){for(var r={},n=0;n<t.length;n++){var i=t[n],a=e[i];void 0!==a&&(r[i]=a)}return r}(n,t.map(Fe));return function(e,t,r){if(!t.filter((function(e){return!function(e){return e&&"?"===e[0]}(e)})).every((function(e){return void 0!==r[e]}))){var n=t.filter((function(e){return void 0===r[e]}));throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(n.map((function(e){return'"'.concat(e,'"')})).join(", "),"."))}}(e,t,n),r(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function Me(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function Fe(e){return e&&"?"===e[0]?e.slice(1):e}function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Te(e,t){if(e){if("string"==typeof e)return Oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Oe(e,t):void 0}}function _e(e){return function(e){if(Array.isArray(e))return Oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Te(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ke(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:String(r)}function Ie(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ke(n.key),n)}}function ze(e,t,r){return t&&Ie(e.prototype,t),r&&Ie(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Re(e,t){if(Le(e)&&je(e,t))return e[t];if("function"==typeof e[t]&&Pe(e,t))throw new Error('Cannot access method "'+t+'" as a property');throw new Error('No access to property "'+t+'"')}function qe(e,t,r){if(Le(e)&&je(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')}function je(e,r){return!(!e||"object"!==t(e)||!Ae(Ue,r)&&(r in Object.prototype||r in Function.prototype))}function Pe(e,t){return!(null==e||"function"!=typeof e[t]||Ae(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)||!Ae($e,t)&&(t in Object.prototype||t in Function.prototype))}function Le(e){return"object"===t(e)&&e&&e.constructor===Object}r(8431),r(2008),r(1629),r(6910),r(3500),r(4185),r(9432),r(2675),r(9463),r(2259),r(3418),r(3792),r(6033),r(1415),r(7764),r(2953);var Ue={length:!0,name:!0},$e={toString:!0,valueOf:!0,toLocaleString:!0};function He(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Ge(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ge(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function Ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ve=function(){function e(t){Be(this,e),this.wrappedObject=t,this[Symbol.iterator]=this.entries}return ze(e,[{key:"keys",value:function(){return Object.keys(this.wrappedObject).values()}},{key:"get",value:function(e){return Re(this.wrappedObject,e)}},{key:"set",value:function(e,t){return qe(this.wrappedObject,e,t),this}},{key:"has",value:function(e){return e in this.wrappedObject}},{key:"entries",value:function(){var e=this;return We(this.keys(),(function(t){return[t,e.get(t)]}))}},{key:"forEach",value:function(e){var t,r=He(this.keys());try{for(r.s();!(t=r.n()).done;){var n=t.value;e(this.get(n),n,this)}}catch(e){r.e(e)}finally{r.f()}}},{key:"delete",value:function(e){delete this.wrappedObject[e]}},{key:"clear",value:function(){var e,t=He(this.keys());try{for(t.s();!(e=t.n()).done;){var r=e.value;this.delete(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"size",get:function(){return Object.keys(this.wrappedObject).length}}]),e}(),Ze=function(){function e(t,r,n){Be(this,e),this.a=t,this.b=r,this.bKeys=n,this[Symbol.iterator]=this.entries}return ze(e,[{key:"get",value:function(e){return this.bKeys.has(e)?this.b.get(e):this.a.get(e)}},{key:"set",value:function(e,t){return this.bKeys.has(e)?this.b.set(e,t):this.a.set(e,t),this}},{key:"has",value:function(e){return this.b.has(e)||this.a.has(e)}},{key:"keys",value:function(){return new Set([].concat(_e(this.a.keys()),_e(this.b.keys())))[Symbol.iterator]()}},{key:"entries",value:function(){var e=this;return We(this.keys(),(function(t){return[t,e.get(t)]}))}},{key:"forEach",value:function(e){var t,r=He(this.keys());try{for(r.s();!(t=r.n()).done;){var n=t.value;e(this.get(n),n,this)}}catch(e){r.e(e)}finally{r.f()}}},{key:"delete",value:function(e){return this.bKeys.has(e)?this.b.delete(e):this.a.delete(e)}},{key:"clear",value:function(){this.a.clear(),this.b.clear()}},{key:"size",get:function(){return _e(this.keys()).length}}]),e}();function We(e,t){return{next:function(){var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function Ye(){return new Map}function Je(e){if(!e)return Ye();if(Xe(e))return e;if(D(e))return new Ve(e);throw new Error("createMap can create maps from objects or Maps")}function Xe(e){return!!e&&(e instanceof Map||e instanceof Ve||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}var Qe=function(){return Qe=G.create,G},Ke=Ce("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(e){var t=e.BigNumber,r=e.Complex,n=e.DenseMatrix,_=e.Fraction,H=Qe();return H.clear(),H.addTypes([{name:"number",test:i},{name:"Complex",test:o},{name:"BigNumber",test:a},{name:"Fraction",test:u},{name:"Unit",test:s},{name:"identifier",test:function(e){return c&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(e)}},{name:"string",test:c},{name:"Chain",test:$},{name:"Array",test:f},{name:"Matrix",test:l},{name:"DenseMatrix",test:m},{name:"SparseMatrix",test:h},{name:"Range",test:d},{name:"Index",test:v},{name:"boolean",test:y},{name:"ResultSet",test:g},{name:"Help",test:x},{name:"function",test:b},{name:"Date",test:w},{name:"RegExp",test:N},{name:"null",test:E},{name:"undefined",test:A},{name:"AccessorNode",test:S},{name:"ArrayNode",test:C},{name:"AssignmentNode",test:M},{name:"BlockNode",test:F},{name:"ConditionalNode",test:O},{name:"ConstantNode",test:T},{name:"FunctionNode",test:k},{name:"FunctionAssignmentNode",test:B},{name:"IndexNode",test:I},{name:"Node",test:z},{name:"ObjectNode",test:R},{name:"OperatorNode",test:q},{name:"ParenthesisNode",test:j},{name:"RangeNode",test:P},{name:"RelationalNode",test:L},{name:"SymbolNode",test:U},{name:"Map",test:Xe},{name:"Object",test:D}]),H.addConversions([{from:"number",to:"BigNumber",convert:function(e){if(t||et(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return r||tt(e),new r(e,0)}},{from:"BigNumber",to:"Complex",convert:function(e){return r||tt(e),new r(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return r||tt(e),new r(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){_||rt(e);var t=new _(e);if(t.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){var t=Number(e);if(isNaN(t))throw new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||et(e);try{return new t(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){_||rt(e);try{return new _(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){r||tt(e);try{return new r(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||et(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return _||rt(e),new _(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return n||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new n(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}]),H.onMismatch=function(e,t,r){var n=H.createError(e,t,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===t.length&&p(t[0])&&r.some((function(e){return!e.params.includes(",")}))){var i=new TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw i.data=n.data,i}throw n},H.onMismatch=function(e,t,r){var n=H.createError(e,t,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===t.length&&p(t[0])&&r.some((function(e){return!e.params.includes(",")}))){var i=new TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw i.data=n.data,i}throw n},H}));function et(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function tt(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function rt(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}r(739),r(7208);var nt,it,at=Ce("ResultSet",[],(function(){function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e}),{isClass:!0}),ot=(r(9904),9e15),ut=1e9,st="0123456789abcdef",ct="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",ft="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",lt={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ot,maxE:ot,crypto:!1},pt=!0,mt="[DecimalError] ",ht=mt+"Invalid argument: ",dt=mt+"Precision limit exceeded",vt=mt+"crypto unavailable",yt="[object Decimal]",gt=Math.floor,xt=Math.pow,bt=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,wt=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Nt=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Dt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Et=1e7,At=7,St=ct.length-1,Ct=ft.length-1,Mt={toStringTag:yt};function Ft(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)n=e[t]+"",(r=At-n.length)&&(a+=Pt(r)),a+=n;o=e[t],(r=At-(n=o+"").length)&&(a+=Pt(r))}else if(0===o)return"0";for(;o%10==0;)o/=10;return a+o}function Ot(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ht+e)}function Tt(e,t,r,n){var i,a,o,u;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=At,i=0):(i=Math.ceil((t+1)/At),t%=At),a=xt(10,At-t),u=e[i]%a|0,null==n?t<3?(0==t?u=u/100|0:1==t&&(u=u/10|0),o=r<4&&99999==u||r>3&&49999==u||5e4==u||0==u):o=(r<4&&u+1==a||r>3&&u+1==a/2)&&(e[i+1]/a/100|0)==xt(10,t-2)-1||(u==a/2||0==u)&&0==(e[i+1]/a/100|0):t<4?(0==t?u=u/1e3|0:1==t?u=u/100|0:2==t&&(u=u/10|0),o=(n||r<4)&&9999==u||!n&&r>3&&4999==u):o=((n||r<4)&&u+1==a||!n&&r>3&&u+1==a/2)&&(e[i+1]/a/1e3|0)==xt(10,t-3)-1,o}function _t(e,t,r){for(var n,i,a=[0],o=0,u=e.length;o<u;){for(i=a.length;i--;)a[i]*=t;for(a[0]+=st.indexOf(e.charAt(o++)),n=0;n<a.length;n++)a[n]>r-1&&(void 0===a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}Mt.absoluteValue=Mt.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),kt(e)},Mt.ceil=function(){return kt(new this.constructor(this),this.e+1,2)},Mt.clampedTo=Mt.clamp=function(e,t){var r=this,n=r.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(ht+t);return r.cmp(e)<0?e:r.cmp(t)>0?t:new n(r)},Mt.comparedTo=Mt.cmp=function(e){var t,r,n,i,a=this,o=a.d,u=(e=new a.constructor(e)).d,s=a.s,c=e.s;if(!o||!u)return s&&c?s!==c?s:o===u?0:!o^s<0?1:-1:NaN;if(!o[0]||!u[0])return o[0]?s:u[0]?-c:0;if(s!==c)return s;if(a.e!==e.e)return a.e>e.e^s<0?1:-1;for(t=0,r=(n=o.length)<(i=u.length)?n:i;t<r;++t)if(o[t]!==u[t])return o[t]>u[t]^s<0?1:-1;return n===i?0:n>i^s<0?1:-1},Mt.cosine=Mt.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+At,n.rounding=1,r=function(e,t){var r,n,i;if(t.isZero())return t;(n=t.d.length)<32?i=(1/Jt(4,r=Math.ceil(n/3))).toString():(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=Yt(e,1,t.times(i),new e(1));for(var a=r;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}(n,Xt(n,r)),n.precision=e,n.rounding=t,kt(2==it||3==it?r.neg():r,e,t,!0)):new n(1):new n(NaN)},Mt.cubeRoot=Mt.cbrt=function(){var e,t,r,n,i,a,o,u,s,c,f=this,l=f.constructor;if(!f.isFinite()||f.isZero())return new l(f);for(pt=!1,(a=f.s*xt(f.s*f,1/3))&&Math.abs(a)!=1/0?n=new l(a.toString()):(r=Ft(f.d),(a=((e=f.e)-r.length+1)%3)&&(r+=1==a||-2==a?"0":"00"),a=xt(r,1/3),e=gt((e+1)/3)-(e%3==(e<0?-1:2)),(n=new l(r=a==1/0?"5e"+e:(r=a.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=f.s),o=(e=l.precision)+3;;)if(c=(s=(u=n).times(u).times(u)).plus(f),n=Bt(c.plus(f).times(u),c.plus(s),o+2,1),Ft(u.d).slice(0,o)===(r=Ft(n.d)).slice(0,o)){if("9999"!=(r=r.slice(o-3,o+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(kt(n,e+1,1),t=!n.times(n).times(n).eq(f));break}if(!i&&(kt(u,e+1,0),u.times(u).times(u).eq(f))){n=u;break}o+=4,i=1}return pt=!0,kt(n,e,l.rounding,t)},Mt.decimalPlaces=Mt.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=((e=t.length-1)-gt(this.e/At))*At,e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},Mt.dividedBy=Mt.div=function(e){return Bt(this,new this.constructor(e))},Mt.dividedToIntegerBy=Mt.divToInt=function(e){var t=this.constructor;return kt(Bt(this,new t(e),0,1,1),t.precision,t.rounding)},Mt.equals=Mt.eq=function(e){return 0===this.cmp(e)},Mt.floor=function(){return kt(new this.constructor(this),this.e+1,3)},Mt.greaterThan=Mt.gt=function(e){return this.cmp(e)>0},Mt.greaterThanOrEqualTo=Mt.gte=function(e){var t=this.cmp(e);return 1==t||0===t},Mt.hyperbolicCosine=Mt.cosh=function(){var e,t,r,n,i,a=this,o=a.constructor,u=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return u;r=o.precision,n=o.rounding,o.precision=r+Math.max(a.e,a.sd())+4,o.rounding=1,(i=a.d.length)<32?t=(1/Jt(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),a=Yt(o,1,a.times(t),new o(1),!0);for(var s,c=e,f=new o(8);c--;)s=a.times(a),a=u.minus(s.times(f.minus(s.times(f))));return kt(a,o.precision=r,o.rounding=n,!0)},Mt.hyperbolicSine=Mt.sinh=function(){var e,t,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,r=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,(n=i.d.length)<3)i=Yt(a,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=Yt(a,2,i=i.times(1/Jt(5,e)),i,!0);for(var o,u=new a(5),s=new a(16),c=new a(20);e--;)o=i.times(i),i=i.times(u.plus(o.times(s.times(o).plus(c))))}return a.precision=t,a.rounding=r,kt(i,t,r,!0)},Mt.hyperbolicTangent=Mt.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,Bt(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},Mt.inverseCosine=Mt.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,a=r.rounding;return-1!==n?0===n?t.isNeg()?qt(r,i,a):new r(0):new r(NaN):t.isZero()?qt(r,i+4,a).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=qt(r,i+4,a).times(.5),r.precision=i,r.rounding=a,e.minus(t))},Mt.inverseHyperbolicCosine=Mt.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,pt=!1,r=r.times(r).minus(1).sqrt().plus(r),pt=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},Mt.inverseHyperbolicSine=Mt.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,pt=!1,r=r.times(r).plus(1).sqrt().plus(r),pt=!0,n.precision=e,n.rounding=t,r.ln())},Mt.inverseHyperbolicTangent=Mt.atanh=function(){var e,t,r,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?kt(new a(i),e,t,!0):(a.precision=r=n-i.e,i=Bt(i.plus(1),new a(1).minus(i),r+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},Mt.inverseSine=Mt.asin=function(){var e,t,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),r=a.precision,n=a.rounding,-1!==t?0===t?((e=qt(a,r+4,n).times(.5)).s=i.s,e):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))},Mt.inverseTangent=Mt.atan=function(){var e,t,r,n,i,a,o,u,s,c=this,f=c.constructor,l=f.precision,p=f.rounding;if(c.isFinite()){if(c.isZero())return new f(c);if(c.abs().eq(1)&&l+4<=Ct)return(o=qt(f,l+4,p).times(.25)).s=c.s,o}else{if(!c.s)return new f(NaN);if(l+4<=Ct)return(o=qt(f,l+4,p).times(.5)).s=c.s,o}for(f.precision=u=l+10,f.rounding=1,e=r=Math.min(28,u/At+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(pt=!1,t=Math.ceil(u/At),n=1,s=c.times(c),o=new f(c),i=c;-1!==e;)if(i=i.times(s),a=o.minus(i.div(n+=2)),i=i.times(s),void 0!==(o=a.plus(i.div(n+=2))).d[t])for(e=t;o.d[e]===a.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),pt=!0,kt(o,f.precision=l,f.rounding=p,!0)},Mt.isFinite=function(){return!!this.d},Mt.isInteger=Mt.isInt=function(){return!!this.d&&gt(this.e/At)>this.d.length-2},Mt.isNaN=function(){return!this.s},Mt.isNegative=Mt.isNeg=function(){return this.s<0},Mt.isPositive=Mt.isPos=function(){return this.s>0},Mt.isZero=function(){return!!this.d&&0===this.d[0]},Mt.lessThan=Mt.lt=function(e){return this.cmp(e)<0},Mt.lessThanOrEqualTo=Mt.lte=function(e){return this.cmp(e)<1},Mt.logarithm=Mt.log=function(e){var t,r,n,i,a,o,u,s,c=this,f=c.constructor,l=f.precision,p=f.rounding;if(null==e)e=new f(10),t=!0;else{if(r=(e=new f(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new f(NaN);t=e.eq(10)}if(r=c.d,c.s<0||!r||!r[0]||c.eq(1))return new f(r&&!r[0]?-1/0:1!=c.s?NaN:r?0:1/0);if(t)if(r.length>1)a=!0;else{for(i=r[0];i%10==0;)i/=10;a=1!==i}if(pt=!1,o=Gt(c,u=l+5),n=t?Rt(f,u+10):Gt(e,u),Tt((s=Bt(o,n,u,1)).d,i=l,p))do{if(o=Gt(c,u+=10),n=t?Rt(f,u+10):Gt(e,u),s=Bt(o,n,u,1),!a){+Ft(s.d).slice(i+1,i+15)+1==1e14&&(s=kt(s,l+1,0));break}}while(Tt(s.d,i+=10,p));return pt=!0,kt(s,l,p)},Mt.minus=Mt.sub=function(e){var t,r,n,i,a,o,u,s,c,f,l,p,m=this,h=m.constructor;if(e=new h(e),!m.d||!e.d)return m.s&&e.s?m.d?e.s=-e.s:e=new h(e.d||m.s!==e.s?m:NaN):e=new h(NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(c=m.d,p=e.d,u=h.precision,s=h.rounding,!c[0]||!p[0]){if(p[0])e.s=-e.s;else{if(!c[0])return new h(3===s?-0:0);e=new h(m)}return pt?kt(e,u,s):e}if(r=gt(e.e/At),f=gt(m.e/At),c=c.slice(),a=f-r){for((l=a<0)?(t=c,a=-a,o=p.length):(t=p,r=f,o=c.length),a>(n=Math.max(Math.ceil(u/At),o)+2)&&(a=n,t.length=1),t.reverse(),n=a;n--;)t.push(0);t.reverse()}else{for((l=(n=c.length)<(o=p.length))&&(o=n),n=0;n<o;n++)if(c[n]!=p[n]){l=c[n]<p[n];break}a=0}for(l&&(t=c,c=p,p=t,e.s=-e.s),o=c.length,n=p.length-o;n>0;--n)c[o++]=0;for(n=p.length;n>a;){if(c[--n]<p[n]){for(i=n;i&&0===c[--i];)c[i]=Et-1;--c[i],c[n]+=Et}c[n]-=p[n]}for(;0===c[--o];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(e.d=c,e.e=zt(c,r),pt?kt(e,u,s):e):new h(3===s?-0:0)},Mt.modulo=Mt.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?kt(new n(r),n.precision,n.rounding):(pt=!1,9==n.modulo?(t=Bt(r,e.abs(),0,3,1)).s*=e.s:t=Bt(r,e,0,n.modulo,1),t=t.times(e),pt=!0,r.minus(t))},Mt.naturalExponential=Mt.exp=function(){return Ht(this)},Mt.naturalLogarithm=Mt.ln=function(){return Gt(this)},Mt.negated=Mt.neg=function(){var e=new this.constructor(this);return e.s=-e.s,kt(e)},Mt.plus=Mt.add=function(e){var t,r,n,i,a,o,u,s,c,f,l=this,p=l.constructor;if(e=new p(e),!l.d||!e.d)return l.s&&e.s?l.d||(e=new p(e.d||l.s===e.s?l:NaN)):e=new p(NaN),e;if(l.s!=e.s)return e.s=-e.s,l.minus(e);if(c=l.d,f=e.d,u=p.precision,s=p.rounding,!c[0]||!f[0])return f[0]||(e=new p(l)),pt?kt(e,u,s):e;if(a=gt(l.e/At),n=gt(e.e/At),c=c.slice(),i=a-n){for(i<0?(r=c,i=-i,o=f.length):(r=f,n=a,o=c.length),i>(o=(a=Math.ceil(u/At))>o?a+1:o+1)&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((o=c.length)-(i=f.length)<0&&(i=o,r=f,f=c,c=r),t=0;i;)t=(c[--i]=c[i]+f[i]+t)/Et|0,c[i]%=Et;for(t&&(c.unshift(t),++n),o=c.length;0==c[--o];)c.pop();return e.d=c,e.e=zt(c,n),pt?kt(e,u,s):e},Mt.precision=Mt.sd=function(e){var t,r=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(ht+e);return r.d?(t=jt(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},Mt.round=function(){var e=this,t=e.constructor;return kt(new t(e),e.e+1,t.rounding)},Mt.sine=Mt.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+At,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:Yt(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=Yt(e,2,t=t.times(1/Jt(5,r)),t);for(var i,a=new e(5),o=new e(16),u=new e(20);r--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(u))));return t}(n,Xt(n,r)),n.precision=e,n.rounding=t,kt(it>2?r.neg():r,e,t,!0)):new n(NaN)},Mt.squareRoot=Mt.sqrt=function(){var e,t,r,n,i,a,o=this,u=o.d,s=o.e,c=o.s,f=o.constructor;if(1!==c||!u||!u[0])return new f(!c||c<0&&(!u||u[0])?NaN:u?o:1/0);for(pt=!1,0==(c=Math.sqrt(+o))||c==1/0?(((t=Ft(u)).length+s)%2==0&&(t+="0"),c=Math.sqrt(t),s=gt((s+1)/2)-(s<0||s%2),n=new f(t=c==1/0?"5e"+s:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+s)):n=new f(c.toString()),r=(s=f.precision)+3;;)if(n=(a=n).plus(Bt(o,a,r+2,1)).times(.5),Ft(a.d).slice(0,r)===(t=Ft(n.d)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(kt(n,s+1,1),e=!n.times(n).eq(o));break}if(!i&&(kt(a,s+1,0),a.times(a).eq(o))){n=a;break}r+=4,i=1}return pt=!0,kt(n,s,f.rounding,e)},Mt.tangent=Mt.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,(r=r.sin()).s=1,r=Bt(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,kt(2==it||4==it?r.neg():r,e,t,!0)):new n(NaN)},Mt.times=Mt.mul=function(e){var t,r,n,i,a,o,u,s,c,f=this,l=f.constructor,p=f.d,m=(e=new l(e)).d;if(e.s*=f.s,!(p&&p[0]&&m&&m[0]))return new l(!e.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:p&&m?0*e.s:e.s/0);for(r=gt(f.e/At)+gt(e.e/At),(s=p.length)<(c=m.length)&&(a=p,p=m,m=a,o=s,s=c,c=o),a=[],n=o=s+c;n--;)a.push(0);for(n=c;--n>=0;){for(t=0,i=s+n;i>n;)u=a[i]+m[n]*p[i-n-1]+t,a[i--]=u%Et|0,t=u/Et|0;a[i]=(a[i]+t)%Et|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=zt(a,r),pt?kt(e,l.precision,l.rounding):e},Mt.toBinary=function(e,t){return Qt(this,2,e,t)},Mt.toDecimalPlaces=Mt.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),void 0===e?r:(Ot(e,0,ut),void 0===t?t=n.rounding:Ot(t,0,8),kt(r,e+r.e+1,t))},Mt.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=It(n,!0):(Ot(e,0,ut),void 0===t?t=i.rounding:Ot(t,0,8),r=It(n=kt(new i(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},Mt.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return void 0===e?r=It(i):(Ot(e,0,ut),void 0===t?t=a.rounding:Ot(t,0,8),r=It(n=kt(new a(i),e+i.e+1,t),!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},Mt.toFraction=function(e){var t,r,n,i,a,o,u,s,c,f,l,p,m=this,h=m.d,d=m.constructor;if(!h)return new d(m);if(c=r=new d(1),n=s=new d(0),o=(a=(t=new d(n)).e=jt(h)-m.e-1)%At,t.d[0]=xt(10,o<0?At+o:o),null==e)e=a>0?t:c;else{if(!(u=new d(e)).isInt()||u.lt(c))throw Error(ht+u);e=u.gt(t)?a>0?t:c:u}for(pt=!1,u=new d(Ft(h)),f=d.precision,d.precision=a=h.length*At*2;l=Bt(u,t,0,1,1),1!=(i=r.plus(l.times(n))).cmp(e);)r=n,n=i,i=c,c=s.plus(l.times(i)),s=i,i=t,t=u.minus(l.times(i)),u=i;return i=Bt(e.minus(r),n,0,1,1),s=s.plus(i.times(c)),r=r.plus(i.times(n)),s.s=c.s=m.s,p=Bt(c,n,a,1).minus(m).abs().cmp(Bt(s,r,a,1).minus(m).abs())<1?[c,n]:[s,r],d.precision=f,pt=!0,p},Mt.toHexadecimal=Mt.toHex=function(e,t){return Qt(this,16,e,t)},Mt.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),null==e){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:Ot(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(pt=!1,r=Bt(r,e,0,t,1).times(e),pt=!0,kt(r)):(e.s=r.s,r=e),r},Mt.toNumber=function(){return+this},Mt.toOctal=function(e,t){return Qt(this,8,e,t)},Mt.toPower=Mt.pow=function(e){var t,r,n,i,a,o,u=this,s=u.constructor,c=+(e=new s(e));if(!(u.d&&e.d&&u.d[0]&&e.d[0]))return new s(xt(+u,c));if((u=new s(u)).eq(1))return u;if(n=s.precision,a=s.rounding,e.eq(1))return kt(u,n,a);if((t=gt(e.e/At))>=e.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=Lt(s,u,r,n),e.s<0?new s(1).div(i):kt(i,n,a);if((o=u.s)<0){if(t<e.d.length-1)return new s(NaN);if(0==(1&e.d[t])&&(o=1),0==u.e&&1==u.d[0]&&1==u.d.length)return u.s=o,u}return(t=0!=(r=xt(+u,c))&&isFinite(r)?new s(r+"").e:gt(c*(Math.log("0."+Ft(u.d))/Math.LN10+u.e+1)))>s.maxE+1||t<s.minE-1?new s(t>0?o/0:0):(pt=!1,s.rounding=u.s=1,r=Math.min(12,(t+"").length),(i=Ht(e.times(Gt(u,n+r)),n)).d&&Tt((i=kt(i,n+5,1)).d,n,a)&&(t=n+10,+Ft((i=kt(Ht(e.times(Gt(u,t+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=kt(i,n+1,0))),i.s=o,pt=!0,s.rounding=a,kt(i,n,a))},Mt.toPrecision=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=It(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Ot(e,1,ut),void 0===t?t=i.rounding:Ot(t,0,8),r=It(n=kt(new i(n),e,t),e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},Mt.toSignificantDigits=Mt.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(Ot(e,1,ut),void 0===t?t=r.rounding:Ot(t,0,8)),kt(new r(this),e,t)},Mt.toString=function(){var e=this,t=e.constructor,r=It(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},Mt.truncated=Mt.trunc=function(){return kt(new this.constructor(this),this.e+1,1)},Mt.valueOf=Mt.toJSON=function(){var e=this,t=e.constructor,r=It(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};var Bt=function(){function e(e,t,r){var n,i=0,a=e.length;for(e=e.slice();a--;)n=e[a]*t+i,e[a]=n%r|0,i=n/r|0;return i&&e.unshift(i),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;i<r;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;)e.shift()}return function(n,i,a,o,u,s){var c,f,l,p,m,h,d,v,y,g,x,b,w,N,D,E,A,S,C,M,F=n.constructor,O=n.s==i.s?1:-1,T=n.d,_=i.d;if(!(T&&T[0]&&_&&_[0]))return new F(n.s&&i.s&&(T?!_||T[0]!=_[0]:_)?T&&0==T[0]||!_?0*O:O/0:NaN);for(s?(m=1,f=n.e-i.e):(s=Et,m=At,f=gt(n.e/m)-gt(i.e/m)),C=_.length,A=T.length,g=(y=new F(O)).d=[],l=0;_[l]==(T[l]||0);l++);if(_[l]>(T[l]||0)&&f--,null==a?(N=a=F.precision,o=F.rounding):N=u?a+(n.e-i.e)+1:a,N<0)g.push(1),h=!0;else{if(N=N/m+2|0,l=0,1==C){for(p=0,_=_[0],N++;(l<A||p)&&N--;l++)D=p*s+(T[l]||0),g[l]=D/_|0,p=D%_|0;h=p||l<A}else{for((p=s/(_[0]+1)|0)>1&&(_=e(_,p,s),T=e(T,p,s),C=_.length,A=T.length),E=C,b=(x=T.slice(0,C)).length;b<C;)x[b++]=0;(M=_.slice()).unshift(0),S=_[0],_[1]>=s/2&&++S;do{p=0,(c=t(_,x,C,b))<0?(w=x[0],C!=b&&(w=w*s+(x[1]||0)),(p=w/S|0)>1?(p>=s&&(p=s-1),1==(c=t(d=e(_,p,s),x,v=d.length,b=x.length))&&(p--,r(d,C<v?M:_,v,s))):(0==p&&(c=p=1),d=_.slice()),(v=d.length)<b&&d.unshift(0),r(x,d,b,s),-1==c&&(c=t(_,x,C,b=x.length))<1&&(p++,r(x,C<b?M:_,b,s)),b=x.length):0===c&&(p++,x=[0]),g[l++]=p,c&&x[0]?x[b++]=T[E]||0:(x=[T[E]],b=1)}while((E++<A||void 0!==x[0])&&N--);h=void 0!==x[0]}g[0]||g.shift()}if(1==m)y.e=f,nt=h;else{for(l=1,p=g[0];p>=10;p/=10)l++;y.e=l+f*m-1,kt(y,u?a+y.e+1:a,o,h)}return y}}();function kt(e,t,r,n){var i,a,o,u,s,c,f,l,p,m=e.constructor;e:if(null!=t){if(!(l=e.d))return e;for(i=1,u=l[0];u>=10;u/=10)i++;if((a=t-i)<0)a+=At,o=t,s=(f=l[p=0])/xt(10,i-o-1)%10|0;else if((p=Math.ceil((a+1)/At))>=(u=l.length)){if(!n)break e;for(;u++<=p;)l.push(0);f=s=0,i=1,o=(a%=At)-At+1}else{for(f=u=l[p],i=1;u>=10;u/=10)i++;s=(o=(a%=At)-At+i)<0?0:f/xt(10,i-o-1)%10|0}if(n=n||t<0||void 0!==l[p+1]||(o<0?f:f%xt(10,i-o-1)),c=r<4?(s||n)&&(0==r||r==(e.s<0?3:2)):s>5||5==s&&(4==r||n||6==r&&(a>0?o>0?f/xt(10,i-o):0:l[p-1])%10&1||r==(e.s<0?8:7)),t<1||!l[0])return l.length=0,c?(t-=e.e+1,l[0]=xt(10,(At-t%At)%At),e.e=-t||0):l[0]=e.e=0,e;if(0==a?(l.length=p,u=1,p--):(l.length=p+1,u=xt(10,At-a),l[p]=o>0?(f/xt(10,i-o)%xt(10,o)|0)*u:0),c)for(;;){if(0==p){for(a=1,o=l[0];o>=10;o/=10)a++;for(o=l[0]+=u,u=1;o>=10;o/=10)u++;a!=u&&(e.e++,l[0]==Et&&(l[0]=1));break}if(l[p]+=u,l[p]!=Et)break;l[p--]=0,u=1}for(a=l.length;0===l[--a];)l.pop()}return pt&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e<m.minE&&(e.e=0,e.d=[0])),e}function It(e,t,r){if(!e.isFinite())return Vt(e);var n,i=e.e,a=Ft(e.d),o=a.length;return t?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+Pt(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+Pt(-i-1)+a,r&&(n=r-o)>0&&(a+=Pt(n))):i>=o?(a+=Pt(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Pt(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=Pt(n))),a}function zt(e,t){var r=e[0];for(t*=At;r>=10;r/=10)t++;return t}function Rt(e,t,r){if(t>St)throw pt=!0,r&&(e.precision=r),Error(dt);return kt(new e(ct),t,1,!0)}function qt(e,t,r){if(t>Ct)throw Error(dt);return kt(new e(ft),t,r,!0)}function jt(e){var t=e.length-1,r=t*At+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Pt(e){for(var t="";e--;)t+="0";return t}function Lt(e,t,r,n){var i,a=new e(1),o=Math.ceil(n/At+4);for(pt=!1;;){if(r%2&&Kt((a=a.times(t)).d,o)&&(i=!0),0===(r=gt(r/2))){r=a.d.length-1,i&&0===a.d[r]&&++a.d[r];break}Kt((t=t.times(t)).d,o)}return pt=!0,a}function Ut(e){return 1&e.d[e.d.length-1]}function $t(e,t,r){for(var n,i=new e(t[0]),a=0;++a<t.length;){if(!(n=new e(t[a])).s){i=n;break}i[r](n)&&(i=n)}return i}function Ht(e,t){var r,n,i,a,o,u,s,c=0,f=0,l=0,p=e.constructor,m=p.rounding,h=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(pt=!1,s=h):s=t,u=new p(.03125);e.e>-2;)e=e.times(u),l+=5;for(s+=n=Math.log(xt(2,l))/Math.LN10*2+5|0,r=a=o=new p(1),p.precision=s;;){if(a=kt(a.times(e),s,1),r=r.times(++f),Ft((u=o.plus(Bt(a,r,s,1))).d).slice(0,s)===Ft(o.d).slice(0,s)){for(i=l;i--;)o=kt(o.times(o),s,1);if(null!=t)return p.precision=h,o;if(!(c<3&&Tt(o.d,s-n,m,c)))return kt(o,p.precision=h,m,pt=!0);p.precision=s+=10,r=a=u=new p(1),f=0,c++}o=u}}function Gt(e,t){var r,n,i,a,o,u,s,c,f,l,p,m=1,h=e,d=h.d,v=h.constructor,y=v.rounding,g=v.precision;if(h.s<0||!d||!d[0]||!h.e&&1==d[0]&&1==d.length)return new v(d&&!d[0]?-1/0:1!=h.s?NaN:d?0:h);if(null==t?(pt=!1,f=g):f=t,v.precision=f+=10,n=(r=Ft(d)).charAt(0),!(Math.abs(a=h.e)<15e14))return c=Rt(v,f+2,g).times(a+""),h=Gt(new v(n+"."+r.slice(1)),f-10).plus(c),v.precision=g,null==t?kt(h,g,y,pt=!0):h;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=Ft((h=h.times(e)).d)).charAt(0),m++;for(a=h.e,n>1?(h=new v("0."+r),a++):h=new v(n+"."+r.slice(1)),l=h,s=o=h=Bt(h.minus(1),h.plus(1),f,1),p=kt(h.times(h),f,1),i=3;;){if(o=kt(o.times(p),f,1),Ft((c=s.plus(Bt(o,new v(i),f,1))).d).slice(0,f)===Ft(s.d).slice(0,f)){if(s=s.times(2),0!==a&&(s=s.plus(Rt(v,f+2,g).times(a+""))),s=Bt(s,new v(m),f,1),null!=t)return v.precision=g,s;if(!Tt(s.d,f-10,y,u))return kt(s,v.precision=g,y,pt=!0);v.precision=f+=10,c=o=h=Bt(l.minus(1),l.plus(1),f,1),p=kt(h.times(h),f,1),i=u=1}s=c,i+=2}}function Vt(e){return String(e.s*e.s/0)}function Zt(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%At,r<0&&(n+=At),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=At;n<i;)e.d.push(+t.slice(n,n+=At));t=t.slice(n),n=At-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),pt&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Wt(e,t){var r,n,i,a,o,u,s,c,f;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Dt.test(t))return Zt(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(wt.test(t))r=16,t=t.toLowerCase();else if(bt.test(t))r=2;else{if(!Nt.test(t))throw Error(ht+t);r=8}for((a=t.search(/p/i))>0?(s=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),o=(a=t.indexOf("."))>=0,n=e.constructor,o&&(a=(u=(t=t.replace(".","")).length)-a,i=Lt(n,new n(r),a,2*a)),a=f=(c=_t(t,r,Et)).length-1;0===c[a];--a)c.pop();return a<0?new n(0*e.s):(e.e=zt(c,f),e.d=c,pt=!1,o&&(e=Bt(e,i,4*u)),s&&(e=e.times(Math.abs(s)<54?xt(2,s):Pr.pow(2,s))),pt=!0,e)}function Yt(e,t,r,n,i){var a,o,u,s,c=e.precision,f=Math.ceil(c/At);for(pt=!1,s=r.times(r),u=new e(n);;){if(o=Bt(u.times(s),new e(t++*t++),c,1),u=i?n.plus(o):n.minus(o),n=Bt(o.times(s),new e(t++*t++),c,1),void 0!==(o=u.plus(n)).d[f]){for(a=f;o.d[a]===u.d[a]&&a--;);if(-1==a)break}a=u,u=n,n=o,o=a}return pt=!0,o.d.length=f+1,o}function Jt(e,t){for(var r=e;--t;)r*=e;return r}function Xt(e,t){var r,n=t.s<0,i=qt(e,e.precision,1),a=i.times(.5);if((t=t.abs()).lte(a))return it=n?4:1,t;if((r=t.divToInt(i)).isZero())it=n?3:2;else{if((t=t.minus(r.times(i))).lte(a))return it=Ut(r)?n?2:3:n?4:1,t;it=Ut(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Qt(e,t,r,n){var i,a,o,u,s,c,f,l,p,m=e.constructor,h=void 0!==r;if(h?(Ot(r,1,ut),void 0===n?n=m.rounding:Ot(n,0,8)):(r=m.precision,n=m.rounding),e.isFinite()){for(h?(i=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):i=t,(o=(f=It(e)).indexOf("."))>=0&&(f=f.replace(".",""),(p=new m(1)).e=f.length-o,p.d=_t(It(p),10,i),p.e=p.d.length),a=s=(l=_t(f,10,i)).length;0==l[--s];)l.pop();if(l[0]){if(o<0?a--:((e=new m(e)).d=l,e.e=a,l=(e=Bt(e,p,r,n,0,i)).d,a=e.e,c=nt),o=l[r],u=i/2,c=c||void 0!==l[r+1],c=n<4?(void 0!==o||c)&&(0===n||n===(e.s<0?3:2)):o>u||o===u&&(4===n||c||6===n&&1&l[r-1]||n===(e.s<0?8:7)),l.length=r,c)for(;++l[--r]>i-1;)l[r]=0,r||(++a,l.unshift(1));for(s=l.length;!l[s-1];--s);for(o=0,f="";o<s;o++)f+=st.charAt(l[o]);if(h){if(s>1)if(16==t||8==t){for(o=16==t?4:3,--s;s%o;s++)f+="0";for(s=(l=_t(f,i,t)).length;!l[s-1];--s);for(o=1,f="1.";o<s;o++)f+=st.charAt(l[o])}else f=f.charAt(0)+"."+f.slice(1);f=f+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)f="0"+f;f="0."+f}else if(++a>s)for(a-=s;a--;)f+="0";else a<s&&(f=f.slice(0,a)+"."+f.slice(a))}else f=h?"0p+0":"0";f=(16==t?"0x":2==t?"0b":8==t?"0o":"")+f}else f=Vt(e);return e.s<0?"-"+f:f}function Kt(e,t){if(e.length>t)return e.length=t,!0}function er(e){return new this(e).abs()}function tr(e){return new this(e).acos()}function rr(e){return new this(e).acosh()}function nr(e,t){return new this(e).plus(t)}function ir(e){return new this(e).asin()}function ar(e){return new this(e).asinh()}function or(e){return new this(e).atan()}function ur(e){return new this(e).atanh()}function sr(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,a=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?qt(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=qt(this,a,1).times(.5)).s=e.s:t.s<0?(this.precision=a,this.rounding=1,r=this.atan(Bt(e,t,a,1)),t=qt(this,a,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(Bt(e,t,a,1)):(r=qt(this,a,1).times(t.s>0?.25:.75)).s=e.s:r=new this(NaN),r}function cr(e){return new this(e).cbrt()}function fr(e){return kt(e=new this(e),e.e+1,2)}function lr(e,t,r){return new this(e).clamp(t,r)}function pr(e){if(!e||"object"!=typeof e)throw Error(mt+"Object expected");var t,r,n,i=!0===e.defaults,a=["precision",1,ut,"rounding",0,8,"toExpNeg",-ot,0,"toExpPos",0,ot,"maxE",0,ot,"minE",-ot,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(r=a[t],i&&(this[r]=lt[r]),void 0!==(n=e[r])){if(!(gt(n)===n&&n>=a[t+1]&&n<=a[t+2]))throw Error(ht+r+": "+n);this[r]=n}if(r="crypto",i&&(this[r]=lt[r]),void 0!==(n=e[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(ht+r+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(vt);this[r]=!0}else this[r]=!1}return this}function mr(e){return new this(e).cos()}function hr(e){return new this(e).cosh()}function dr(e,t){return new this(e).div(t)}function vr(e){return new this(e).exp()}function yr(e){return kt(e=new this(e),e.e+1,3)}function gr(){var e,t,r=new this(0);for(pt=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return pt=!0,new this(1/0);r=t}return pt=!0,r.sqrt()}function xr(e){return e instanceof Pr||e&&e.toStringTag===yt||!1}function br(e){return new this(e).ln()}function wr(e,t){return new this(e).log(t)}function Nr(e){return new this(e).log(2)}function Dr(e){return new this(e).log(10)}function Er(){return $t(this,arguments,"lt")}function Ar(){return $t(this,arguments,"gt")}function Sr(e,t){return new this(e).mod(t)}function Cr(e,t){return new this(e).mul(t)}function Mr(e,t){return new this(e).pow(t)}function Fr(e){var t,r,n,i,a=0,o=new this(1),u=[];if(void 0===e?e=this.precision:Ot(e,1,ut),n=Math.ceil(e/At),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));a<n;)(i=t[a])>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:u[a++]=i%1e7;else{if(!crypto.randomBytes)throw Error(vt);for(t=crypto.randomBytes(n*=4);a<n;)(i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((127&t[a+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,a):(u.push(i%1e7),a+=4);a=n/4}else for(;a<n;)u[a++]=1e7*Math.random()|0;for(n=u[--a],e%=At,n&&e&&(i=xt(10,At-e),u[a]=(n/i|0)*i);0===u[a];a--)u.pop();if(a<0)r=0,u=[0];else{for(r=-1;0===u[0];r-=At)u.shift();for(n=1,i=u[0];i>=10;i/=10)n++;n<At&&(r-=At-n)}return o.e=r,o.d=u,o}function Or(e){return kt(e=new this(e),e.e+1,this.rounding)}function Tr(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function _r(e){return new this(e).sin()}function Br(e){return new this(e).sinh()}function kr(e){return new this(e).sqrt()}function Ir(e,t){return new this(e).sub(t)}function zr(){var e=0,t=arguments,r=new this(t[e]);for(pt=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return pt=!0,kt(r,this.precision,this.rounding)}function Rr(e){return new this(e).tan()}function qr(e){return new this(e).tanh()}function jr(e){return kt(e=new this(e),e.e+1,1)}Mt[Symbol.for("nodejs.util.inspect.custom")]=Mt.toString,Mt[Symbol.toStringTag]="Decimal";var Pr=Mt.constructor=function e(t){var r,n,i;function a(e){var t,r,n,i=this;if(!(i instanceof a))return new a(e);if(i.constructor=a,xr(e))return i.s=e.s,void(pt?!e.d||e.e>a.maxE?(i.e=NaN,i.d=null):e.e<a.minE?(i.e=0,i.d=[0]):(i.e=e.e,i.d=e.d.slice()):(i.e=e.e,i.d=e.d?e.d.slice():e.d));if("number"==(n=typeof e)){if(0===e)return i.s=1/e<0?-1:1,i.e=0,void(i.d=[0]);if(e<0?(e=-e,i.s=-1):i.s=1,e===~~e&&e<1e7){for(t=0,r=e;r>=10;r/=10)t++;return void(pt?t>a.maxE?(i.e=NaN,i.d=null):t<a.minE?(i.e=0,i.d=[0]):(i.e=t,i.d=[e]):(i.e=t,i.d=[e]))}return 0*e!=0?(e||(i.s=NaN),i.e=NaN,void(i.d=null)):Zt(i,e.toString())}if("string"!==n)throw Error(ht+e);return 45===(r=e.charCodeAt(0))?(e=e.slice(1),i.s=-1):(43===r&&(e=e.slice(1)),i.s=1),Dt.test(e)?Zt(i,e):Wt(i,e)}if(a.prototype=Mt,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.EUCLID=9,a.config=a.set=pr,a.clone=e,a.isDecimal=xr,a.abs=er,a.acos=tr,a.acosh=rr,a.add=nr,a.asin=ir,a.asinh=ar,a.atan=or,a.atanh=ur,a.atan2=sr,a.cbrt=cr,a.ceil=fr,a.clamp=lr,a.cos=mr,a.cosh=hr,a.div=dr,a.exp=vr,a.floor=yr,a.hypot=gr,a.ln=br,a.log=wr,a.log10=Dr,a.log2=Nr,a.max=Er,a.min=Ar,a.mod=Sr,a.mul=Cr,a.pow=Mr,a.random=Fr,a.round=Or,a.sign=Tr,a.sin=_r,a.sinh=Br,a.sqrt=kr,a.sub=Ir,a.sum=zr,a.tan=Rr,a.tanh=qr,a.trunc=jr,void 0===t&&(t={}),t&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<i.length;)t.hasOwnProperty(n=i[r++])||(t[n]=this[n]);return a.config(t),a}(lt);ct=new Pr(ct),ft=new Pr(ft);const Lr=Pr;var Ur=Ce("BigNumber",["?on","config"],(function(e){var t=e.on,r=e.config,n=Lr.clone({precision:r.precision,modulo:Lr.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(e){return new n(e.value)},t&&t("config",(function(e,t){e.precision!==t.precision&&n.config({precision:e.precision})})),n}),{isClass:!0}),$r=r(5716),Hr=Ce("Complex",[],(function(){return Object.defineProperty($r,"name",{value:"Complex"}),$r.prototype.constructor=$r,$r.prototype.type="Complex",$r.prototype.isComplex=!0,$r.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},$r.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},$r.prototype.format=function(e){var t=this.im,r=this.re,n=ee(this.re,e),a=ee(this.im,e),o=i(e)?e:e?e.precision:null;if(null!==o){var u=Math.pow(10,-o);Math.abs(r/t)<u&&(r=0),Math.abs(t/r)<u&&(t=0)}return 0===t?n:0===r?1===t?"i":-1===t?"-i":a+"i":t<0?-1===t?n+" - i":n+" - "+a.substring(1)+"i":1===t?n+" + i":n+" + "+a+"i"},$r.fromPolar=function(e){switch(arguments.length){case 1:var r=arguments[0];if("object"===t(r))return $r(r);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var n=arguments[0],a=arguments[1];if(i(n)){if(s(a)&&a.hasBase("ANGLE")&&(a=a.toNumber("rad")),i(a))return new $r({r:n,phi:a});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.");default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},$r.prototype.valueOf=$r.prototype.toString,$r.fromJSON=function(e){return new $r(e)},$r.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},$r}),{isClass:!0}),Gr=r(3996),Vr=Ce("Fraction",[],(function(){return Object.defineProperty(Gr,"name",{value:"Fraction"}),Gr.prototype.constructor=Gr,Gr.prototype.type="Fraction",Gr.prototype.isFraction=!0,Gr.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Gr.fromJSON=function(e){return new Gr(e)},Gr}),{isClass:!0}),Zr=(r(3362),Ce("Range",[],(function(){function e(t,r,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=null!=t,o=null!=r,u=null!=n;if(i)if(a(t))t=t.toNumber();else if("number"!=typeof t)throw new TypeError("Parameter start must be a number");if(o)if(a(r))r=r.toNumber();else if("number"!=typeof r)throw new TypeError("Parameter end must be a number");if(u)if(a(n))n=n.toNumber();else if("number"!=typeof n)throw new TypeError("Parameter step must be a number");this.start=i?parseFloat(t):0,this.end=o?parseFloat(r):0,this.step=u?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if("string"!=typeof t)return null;var r=t.split(":").map((function(e){return parseFloat(e)}));if(r.some((function(e){return isNaN(e)})))return null;switch(r.length){case 2:return new e(r[0],r[1]);case 3:return new e(r[0],r[2],r[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var e=0,t=this.start,r=this.step,n=this.end-t;return Z(r)===Z(n)?e=Math.ceil(n/r):0===n&&(e=0),isNaN(e)&&(e=0),[e]},e.prototype.min=function(){var e=this.size()[0];return e>0?this.step>0?this.start:this.start+(e-1)*this.step:void 0},e.prototype.max=function(){var e=this.size()[0];return e>0?this.step>0?this.start+(e-1)*this.step:this.start:void 0},e.prototype.forEach=function(e){var t=this.start,r=this.step,n=this.end,i=0;if(r>0)for(;t<n;)e(t,[i],this),t+=r,i++;else if(r<0)for(;t>n;)e(t,[i],this),t+=r,i++},e.prototype.map=function(e){var t=[];return this.forEach((function(r,n,i){t[n[0]]=e(r,n,i)})),t},e.prototype.toArray=function(){var e=[];return this.forEach((function(t,r){e[r[0]]=t})),e},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(e){var t=ee(this.start,e);return 1!==this.step&&(t+=":"+ee(this.step,e)),t+":"+ee(this.end,e)},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e}),{isClass:!0})),Wr=Ce("Matrix",[],(function(){function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e}),{isClass:!0}),Yr=r(4756);function Jr(){return Jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jr.apply(this,arguments)}function Xr(e,t,r){var n=new(0,e.constructor)(2),i="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!V(r))throw new Error("size must be an integer");if(e.greaterThan(n.pow(r-1).sub(1))||e.lessThan(n.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(n.pow(r))),i="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(t," not supported "))}}function Qr(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function Kr(e,t){return i(e)?e:a(e)?e.toNumber():t}function en(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}function tn(e,r){var n=function(e,r){return"number"==typeof e?ee(e,r):a(e)?function(e,t){if("function"==typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var r=te(t),n=r.notation,i=r.precision,a=r.wordSize;switch(n){case"fixed":return function(e,t){return e.toFixed(t)}(e,i);case"exponential":return Qr(e,i);case"engineering":return function(e,t){var r=e.e,n=r%3==0?r:r<0?r-3-r%3:r-r%3,i=e.mul(Math.pow(10,-n)).toPrecision(t);return-1!==i.indexOf("e")&&(i=new(0,e.constructor)(i).toFixed()),i+"e"+(r>=0?"+":"")+n.toString()}(e,i);case"bin":return Xr(e,2,a);case"oct":return Xr(e,8,a);case"hex":return Xr(e,16,a);case"auto":var o=Kr(null==t?void 0:t.lowerExp,-3),u=Kr(null==t?void 0:t.upperExp,5);if(e.isZero())return"0";var s=e.toSignificantDigits(i),c=s.e;return(c>=o&&c<u?s.toFixed():Qr(e,i)).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}(e,r):function(e){return e&&"object"===t(e)&&"number"==typeof e.s&&"number"==typeof e.n&&"number"==typeof e.d||!1}(e)?r&&"decimal"===r.fraction?e.toString():e.s*e.n+"/"+e.d:Array.isArray(e)?on(e,r):c(e)?rn(e):"function"==typeof e?e.syntax?String(e.syntax):"function":e&&"object"===t(e)?"function"==typeof e.format?e.format(r):e&&e.toString(r)!=={}.toString()?e.toString(r):"{"+Object.keys(e).map((function(t){return rn(t)+": "+tn(e[t],r)})).join(", ")+"}":String(e)}(e,r);return r&&"object"===t(r)&&"truncate"in r&&n.length>r.truncate?n.substring(0,r.truncate-3)+"...":n}function rn(e){for(var t=String(e),r="",n=0;n<t.length;){var i=t.charAt(n);r+=i in nn?nn[i]:i,n++}return'"'+r+'"'}r(2712),r(3771),r(9868),r(630),r(8718);var nn={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function an(e){var t=String(e);return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function on(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;i<n;i++)0!==i&&(r+=", "),r+=on(e[i],t);return r+"]"}return tn(e,t)}function un(e,t){if(!c(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+H(e)+", index: 0)");if(!c(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+H(t)+", index: 1)");return e===t?0:e>t?1:-1}function sn(e,t,r){if(!(this instanceof sn))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}function cn(e,t,r){if(!(this instanceof cn))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}function fn(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function ln(e,t,r){var n,i=e.length;if(i!==t[r])throw new sn(i,t[r]);if(r<t.length-1){var a=r+1;for(n=0;n<i;n++){var o=e[n];if(!Array.isArray(o))throw new sn(t.length-1,t.length,"<");ln(e[n],t,a)}}else for(n=0;n<i;n++)if(Array.isArray(e[n]))throw new sn(t.length+1,t.length,">")}function pn(e,t){if(0===t.length){if(Array.isArray(e))throw new sn(e.length,0)}else ln(e,t,0)}function mn(e,t){var r=e.isMatrix?e._size:fn(e);t._sourceSize.forEach((function(e,t){if(null!==e&&e!==r[t])throw new sn(e,r[t])}))}function hn(e,t){if(void 0!==e){if(!i(e)||!V(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new cn(e,t)}}function dn(e){for(var t=0;t<e._dimensions.length;++t){var r=e._dimensions[t];if(r._data&&f(r._data)){if(0===r._size[0])return!0}else if(r.isRange){if(r.start===r.end)return!0}else if(c(r)&&0===r.length)return!0}return!1}function vn(e,t,r){if(!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new Error("Resizing to scalar is not supported");return t.forEach((function(e){if(!i(e)||!V(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+tn(t)+")")})),(i(e)||a(e))&&(e=[e]),yn(e,t,0,void 0!==r?r:0),e}function yn(e,t,r,n){var i,a,o=e.length,u=t[r],s=Math.min(o,u);if(e.length=u,r<t.length-1){var c=r+1;for(i=0;i<s;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),yn(a,t,c,n);for(i=s;i<u;i++)a=[],e[i]=a,yn(a,t,c,n)}else{for(i=0;i<s;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=s;i<u;i++)e[i]=n}}function gn(e,t){var r=An(e),n=r.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new sn(0,n,"!=");var i=bn(t=xn(t,n));if(n!==i)throw new sn(i,n,"!=");try{return function(e,t){for(var r,n=e,i=t.length-1;i>0;i--){var a=t[i];r=[];for(var o=n.length/a,u=0;u<o;u++)r.push(n.slice(u*a,(u+1)*a));n=r}return n}(r,t)}catch(e){if(e instanceof sn)throw new sn(i,n,"!=");throw e}}function xn(e,t){var r=bn(e),n=e.slice(),i=e.indexOf(-1);if(e.indexOf(-1,i+1)>=0)throw new Error("More than one wildcard in sizes");if(i>=0){if(t%r!=0)throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);n[i]=-t/r}return n}function bn(e){return e.reduce((function(e,t){return e*t}),1)}function wn(e,t){for(var r=t||fn(e);Array.isArray(e)&&1===e.length;)e=e[0],r.shift();for(var n=r.length;1===r[n-1];)n--;return n<r.length&&(e=Nn(e,n,0),r.length=n),e}function Nn(e,t,r){var n,i;if(r<t){var a=r+1;for(n=0,i=e.length;n<i;n++)e[n]=Nn(e[n],t,a)}else for(;Array.isArray(e);)e=e[0];return e}function Dn(e,t,r,n){var i=n||fn(e);if(r)for(var a=0;a<r;a++)e=[e],i.unshift(1);for(e=En(e,t,0);i.length<t;)i.push(1);return e}function En(e,t,r){var n,i;if(Array.isArray(e)){var a=r+1;for(n=0,i=e.length;n<i;n++)e[n]=En(e[n],t,a)}else for(var o=r;o<t;o++)e=[e];return e}function An(e){if(!Array.isArray(e))return e;var t=[];return e.forEach((function e(r){Array.isArray(r)?r.forEach(e):t.push(r)})),t}function Sn(e,t){return Array.prototype.map.call(e,t)}function Cn(e,t){Array.prototype.forEach.call(e,t)}function Mn(e,t){if(1!==fn(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t)}function Fn(e,t){if(1!==fn(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,(function(e){return t.test(e)}))}function On(e,t){return Array.prototype.join.call(e,t)}function Tn(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;var t=[],r=0;t[0]={value:e[0],identifier:0};for(var n=1;n<e.length;n++)e[n]===e[n-1]?r++:r=0,t.push({value:e[n],identifier:r});return t}function _n(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;for(var t=[],r=0;r<e.length;r++)t.push(e[r].value);return t}function Bn(e,t){for(var r,n=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(0===i&&o&&(n=a.length),o&&a.length!==n)return;var u=o?Bn(a,t):t(a);if(void 0===r)r=u;else if(r!==u)return"mixed"}return r}function kn(e,t){return-1!==e.indexOf(t)}function In(e,t,r,n){if(n<r){if(e.length!==t.length)throw new sn(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=In(e[a],t[a],r,n+1);return i}return e.concat(t)}function zn(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(1===e.length)return e[0];if(e.length>1)return e.slice(1).reduce((function(e,r){return In(e,r,t,0)}),e[0]);throw new Error("Wrong number of arguments in function concat")}function Rn(e,t){for(var r=t.length,n=e.length,i=0;i<n;i++){var a=r-n+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(t[a]))}}function qn(e,t){var r=fn(e);if(we(r,t))return e;Rn(r,t);var n,i,a,o=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.map((function(e){return e.length})),i=Math.max.apply(Math,_e(n)),a=new Array(i).fill(null),o=0;o<t.length;o++)for(var u=t[o],s=n[o],c=0;c<s;c++){var f=i-s+c;u[c]>a[f]&&(a[f]=u[c])}for(var l=0;l<t.length;l++)Rn(t[l],a);return a}(r,t),u=o.length,s=[].concat(_e(Array(u-r.length).fill(1)),_e(r)),c=function(e){return Jr([],e)}(e);r.length<u&&(r=fn(c=gn(c,s)));for(var f=0;f<u;f++)r[f]<o[f]&&(n=c,i=o[f],a=f,r=fn(c=zn.apply(void 0,_e(Array(i).fill(n)).concat([a]))));return c}function jn(e){var t=0,r=1,n=Object.create(null),i=Object.create(null),a=0,o=function(e){var o=i[e];if(o&&(delete n[o],delete i[e],--t,r===o)){if(!t)return a=0,void(r=1);for(;!Object.prototype.hasOwnProperty.call(n,++r););}};return e=Math.abs(e),{hit:function(u){var s=i[u],c=++a;if(n[c]=u,i[u]=c,!s){if(++t<=e)return;return u=n[r],o(u),u}if(delete n[s],r===s)for(;!Object.prototype.hasOwnProperty.call(n,++r););},delete:o,clear:function(){t=a=0,r=1,n=Object.create(null),i=Object.create(null)}}}function Pn(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.hasher,i=r.limit;return i=null==i?Number.POSITIVE_INFINITY:i,n=null==n?JSON.stringify:n,function r(){"object"!==t(r.cache)&&(r.cache={values:new Map,lru:jn(i||Number.POSITIVE_INFINITY)});for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];var u=n(a);if(r.cache.values.has(u))return r.cache.lru.hit(u),r.cache.values.get(u);var s=e.apply(e,a);return r.cache.values.set(u,s),r.cache.values.delete(r.cache.lru.hit(u)),s}}function Ln(e){return Object.keys(e.signatures||{}).reduce((function(e,t){var r=(t.match(/,/g)||[]).length+1;return Math.max(e,r)}),-1)}function Un(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}sn.prototype=new RangeError,sn.prototype.constructor=RangeError,sn.prototype.name="DimensionError",sn.prototype.isDimensionError=!0,cn.prototype=new RangeError,cn.prototype.constructor=RangeError,cn.prototype.name="IndexError",cn.prototype.isIndexError=!0,r(3110);var $n=Ce("DenseMatrix",["Matrix"],(function(e){var t=e.Matrix;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!c(t))throw new Error("Invalid datatype: "+t);if(l(e))"DenseMatrix"===e.type?(this._data=ye(e._data),this._size=ye(e._size),this._datatype=t||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=t||e._datatype);else if(e&&f(e.data)&&f(e.size))this._data=e.data,this._size=e.size,pn(this._data,this._size),this._datatype=t||e.datatype;else if(f(e))this._data=m(e),this._size=fn(this._data),pn(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError("Unsupported type of data ("+H(e)+")");this._data=[],this._size=[0],this._datatype=t}}function n(e,t,r,i){var a=i===r-1,o=t.dimension(i);return a?o.map((function(t){return hn(t,e.length),e[t]})).valueOf():o.map((function(a){return hn(a,e.length),n(e[a],t,r,i+1)})).valueOf()}function o(e,t,r,n,i){var a=i===n-1,u=t.dimension(i);a?u.forEach((function(t,n){hn(t),e[t]=r[n[0]]})):u.forEach((function(a,u){hn(a),o(e[a],t,r[u[0]],n,i+1)}))}function u(e,t,r){if(0===t.length){for(var n=e._data;f(n);)n=n[0];return n}return e._size=t.slice(0),e._data=vn(e._data,e._size,r),e}function s(e,t,r){for(var n=e._size.slice(0),i=!1;n.length<t.length;)n.push(0),i=!0;for(var a=0,o=t.length;a<o;a++)t[a]>n[a]&&(n[a]=t[a],i=!0);i&&u(e,n,r)}function m(e){return l(e)?m(e.valueOf()):f(e)?e.map(m):e}return r.prototype=new t,r.prototype.createDenseMatrix=function(e,t){return new r(e,t)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return Bn(this._data,H)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(e,t){return new r(e,t)},r.prototype.subset=function(e,t,i){switch(arguments.length){case 1:return function(e,t){if(!v(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var i=t.size();if(i.length!==e._size.length)throw new sn(i.length,e._size.length);for(var a=t.min(),o=t.max(),u=0,s=e._size.length;u<s;u++)hn(a[u],e._size[u]),hn(o[u],e._size[u]);return new r(n(e._data,t,i.length,0),e._datatype)}(this,e);case 2:case 3:return function(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var i,a=t.size(),u=t.isScalar();if(l(r)?(i=r.size(),r=r.valueOf()):i=fn(r),u){if(0!==i.length)throw new TypeError("Scalar expected");e.set(t.min(),r,n)}else{if(!we(i,a))try{i=fn(r=0===i.length?qn([r],a):qn(r,a))}catch(e){}if(a.length<e._size.length)throw new sn(a.length,e._size.length,"<");if(i.length<a.length){for(var c=0,f=0;1===a[c]&&1===i[c];)c++;for(;1===a[c];)f++,c++;r=Dn(r,a.length,f,i)}if(!we(a,i))throw new sn(a,i,">");var p=t.max().map((function(e){return e+1}));s(e,p,n);var m=a.length;o(e._data,t,r,m,0)}return e}(this,e,t,i);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(e){if(!f(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new sn(e.length,this._size.length);for(var t=0;t<e.length;t++)hn(e[t],this._size[t]);for(var r=this._data,n=0,i=e.length;n<i;n++){var a=e[n];hn(a,r.length),r=r[a]}return r},r.prototype.set=function(e,t,r){if(!f(e))throw new TypeError("Array expected");if(e.length<this._size.length)throw new sn(e.length,this._size.length,"<");var n,i,a,o=e.map((function(e){return e+1}));s(this,o,r);var u=this._data;for(n=0,i=e.length-1;n<i;n++)hn(a=e[n],u.length),u=u[a];return hn(a=e[e.length-1],u.length),u[a]=t,this},r.prototype.resize=function(e,t,r){if(!p(e))throw new TypeError("Array or Matrix expected");var n=e.valueOf().map((function(e){return Array.isArray(e)&&1===e.length?e[0]:e}));return u(r?this.clone():this,n,t)},r.prototype.reshape=function(e,t){var r=t?this.clone():this;r._data=gn(r._data,e);var n=r._size.reduce((function(e,t){return e*t}));return r._size=xn(e,n),r},r.prototype.clone=function(){return new r({data:ye(this._data),size:ye(this._size),datatype:this._datatype})},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(e){var t=this,n=Ln(e),i=function r(i,a){return f(i)?i.map((function(e,t){return r(e,a.concat(t))})):1===n?e(i):2===n?e(i,a):e(i,a,t)}(this._data,[]);return new r(i,void 0!==this._datatype?Bn(i,H):void 0)},r.prototype.forEach=function(e){var t=this;!function r(n,i){f(n)?n.forEach((function(e,t){r(e,i.concat(t))})):e(n,i,t)}(this._data,[])},r.prototype[Symbol.iterator]=Yr.mark((function e(){var t;return Yr.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Yr.mark((function e(t,r){var n;return Yr.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!f(t)){i.next=9;break}n=0;case 2:if(!(n<t.length)){i.next=7;break}return i.delegateYield(e(t[n],r.concat(n)),"t0",4);case 4:n++,i.next=2;break;case 7:i.next=11;break;case 9:return i.next=11,{value:t,index:r};case 11:case"end":return i.stop()}}),e)})),e.delegateYield(t(this._data,[]),"t0",2);case 2:case"end":return e.stop()}}),e,this)})),r.prototype.rows=function(){var e=[];if(2!==this.size().length)throw new TypeError("Rows can only be returned for a 2D matrix.");var t,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Un(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Un(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}(this._data);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.push(new r([i],this._datatype))}}catch(e){n.e(e)}finally{n.f()}return e},r.prototype.columns=function(){var e=this,t=[],n=this.size();if(2!==n.length)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var i=this._data,a=function(n){var a=i.map((function(e){return[e[n]]}));t.push(new r(a,e._datatype))},o=0;o<n[1];o++)a(o);return t},r.prototype.toArray=function(){return ye(this._data)},r.prototype.valueOf=function(){return this._data},r.prototype.format=function(e){return tn(this._data,e)},r.prototype.toString=function(){return tn(this._data)},r.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.prototype.diagonal=function(e){if(e){if(a(e)&&(e=e.toNumber()),!i(e)||!V(e))throw new TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,n=e<0?-e:0,o=this._size[0],u=this._size[1],s=Math.min(o-n,u-t),c=[],f=0;f<s;f++)c[f]=this._data[f+n][f+t];return new r({data:c,size:[s],datatype:this._datatype})},r.diagonal=function(e,t,n,o){if(!f(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if(a(e)&&(e=e.toNumber()),!i(e)||!V(e)||e<1)throw new Error("Size values must be positive integers");return e})),n){if(a(n)&&(n=n.toNumber()),!i(n)||!V(n))throw new TypeError("The parameter k must be an integer number")}else n=0;var u,s=n>0?n:0,c=n<0?-n:0,p=e[0],m=e[1],h=Math.min(p-c,m-s);if(f(t)){if(t.length!==h)throw new Error("Invalid value array length");u=function(e){return t[e]}}else if(l(t)){var d=t.size();if(1!==d.length||d[0]!==h)throw new Error("Invalid matrix length");u=function(e){return t.get([e])}}else u=function(){return t};o||(o=a(u(0))?u(0).mul(0):0);var v=[];if(e.length>0){v=vn(v,e,o);for(var y=0;y<h;y++)v[y+c][y+s]=u(y)}return new r({data:v,size:[p,m]})},r.fromJSON=function(e){return new r(e)},r.prototype.swapRows=function(e,t){if(!(i(e)&&V(e)&&i(t)&&V(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return hn(e,this._size[0]),hn(t,this._size[0]),r._swapRows(e,t,this._data),this},r._swapRows=function(e,t,r){var n=r[e];r[e]=r[t],r[t]=n},r}),{isClass:!0}),Hn="clone",Gn=Ce(Hn,["typed"],(function(e){return(0,e.typed)(Hn,{any:ye})}));function Vn(e){var t,r,n=e.length,i=e[0].length,a=[];for(r=0;r<i;r++){var o=[];for(t=0;t<n;t++)o.push(e[t][r]);a.push(o)}return a}function Zn(e){for(var t=0;t<e.length;t++)if(p(e[t]))return!0;return!1}function Wn(e,t){l(e)&&(e=e.valueOf());for(var r=0,n=e.length;r<n;r++){var i=e[r];Array.isArray(i)?Wn(i,t):t(i)}}function Yn(e,t,r){return e&&"function"==typeof e.map?e.map((function(e){return Yn(e,t,r)})):t(e)}function Jn(e,t,r){var n=Array.isArray(e)?fn(e):e.size();if(t<0||t>=n.length)throw new cn(t,n.length);return l(e)?e.create(Xn(e.valueOf(),t,r)):Xn(e,t,r)}function Xn(e,t,r){var n,i,a,o;if(t<=0){if(Array.isArray(e[0])){for(o=Vn(e),i=[],n=0;n<o.length;n++)i[n]=Xn(o[n],t-1,r);return i}for(a=e[0],n=1;n<e.length;n++)a=r(a,e[n]);return a}for(i=[],n=0;n<e.length;n++)i[n]=Xn(e[n],t-1,r);return i}function Qn(e,t,r,n,i,a,o,u,s,c,f){var l,p,m,h,d=e._values,v=e._index,y=e._ptr;if(n)for(p=y[t],m=y[t+1],l=p;l<m;l++)r[h=v[l]]!==a?(r[h]=a,o.push(h),c?(n[h]=s?u(d[l],f):u(f,d[l]),i[h]=a):n[h]=d[l]):(n[h]=s?u(d[l],n[h]):u(n[h],d[l]),i[h]=a);else for(p=y[t],m=y[t+1],l=p;l<m;l++)r[h=v[l]]!==a?(r[h]=a,o.push(h)):i[h]=a}var Kn="isInteger",ei=Ce(Kn,["typed"],(function(e){var t=e.typed;return t(Kn,{number:V,BigNumber:function(e){return e.isInt()},Fraction:function(e){return 1===e.d&&isFinite(e.n)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),ti=(r(113),r(150),"number");function ri(e){return e<0}function ni(e){return e>0}function ii(e){return 0===e}function ai(e){return Number.isNaN(e)}ri.signature=ti,ni.signature=ti,ii.signature=ti,ai.signature=ti;var oi="isNegative",ui=Ce(oi,["typed"],(function(e){var t=e.typed;return t(oi,{number:ri,BigNumber:function(e){return e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s<0},Unit:t.referToSelf((function(e){return function(r){return t.find(e,r.valueType())(r.value)}})),"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),si="isNumeric",ci=Ce(si,["typed"],(function(e){var t=e.typed;return t(si,{"number | BigNumber | Fraction | boolean":function(){return!0},"Complex | Unit | string | null | undefined | Node":function(){return!1},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),fi=(r(2762),"hasNumericValue"),li=Ce(fi,["typed","isNumeric"],(function(e){var t=e.typed,r=e.isNumeric;return t(fi,{boolean:function(){return!0},string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return r(e)}})})),pi="isPositive",mi=Ce(pi,["typed"],(function(e){var t=e.typed;return t(pi,{number:ni,BigNumber:function(e){return!e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s>0&&e.n>0},Unit:t.referToSelf((function(e){return function(r){return t.find(e,r.valueType())(r.value)}})),"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),hi="isZero",di=Ce(hi,["typed"],(function(e){var t=e.typed;return t(hi,{number:ii,BigNumber:function(e){return e.isZero()},Complex:function(e){return 0===e.re&&0===e.im},Fraction:function(e){return 1===e.d&&0===e.n},Unit:t.referToSelf((function(e){return function(r){return t.find(e,r.valueType())(r.value)}})),"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),vi="isNaN",yi=Ce(vi,["typed"],(function(e){return(0,e.typed)(vi,{number:ai,BigNumber:function(e){return e.isNaN()},Fraction:function(e){return!1},Complex:function(e){return e.isNaN()},Unit:function(e){return Number.isNaN(e.value)},"Array | Matrix":function(e){return Yn(e,Number.isNaN)}})})),gi="typeOf",xi=Ce(gi,["typed"],(function(e){return(0,e.typed)(gi,{any:H})}));function bi(e,t,r){if(null==r)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var n=e.minus(t).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return n.lte(i.times(r))}return!1}var wi=Ce("compareUnits",["typed"],(function(e){var t=e.typed;return{"Unit, Unit":t.referToSelf((function(e){return function(r,n){if(!r.equalBase(n))throw new Error("Cannot compare units with different base");return t.find(e,[r.valueType(),n.valueType()])(r.value,n.value)}}))}})),Ni="equalScalar",Di=Ce(Ni,["typed","config"],(function(e){var t=e.typed,r=e.config,n=wi({typed:t});return t(Ni,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return se(e,t,r.epsilon)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||bi(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){return function(e,t,r){return se(e.re,t.re,r)&&se(e.im,t.im,r)}(e,t,r.epsilon)}},n)})),Ei=(Ce(Ni,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(Ni,{"number, number":function(e,t){return se(e,t,r.epsilon)}})})),Ce("SparseMatrix",["typed","equalScalar","Matrix"],(function(e){var t=e.typed,r=e.equalScalar,n=e.Matrix;function o(e,t){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!c(t))throw new Error("Invalid datatype: "+t);if(l(e))!function(e,t,r){"SparseMatrix"===t.type?(e._values=t._values?ye(t._values):void 0,e._index=ye(t._index),e._ptr=ye(t._ptr),e._size=ye(t._size),e._datatype=r||t._datatype):u(e,t.valueOf(),r||t._datatype)}(this,e,t);else if(e&&f(e.index)&&f(e.ptr)&&f(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(f(e))u(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+H(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}}function u(e,n,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;var a=n.length,o=0,u=r,s=0;if(c(i)&&(u=t.find(r,[i,i])||r,s=t.convert(0,i)),a>0){var l=0;do{e._ptr.push(e._index.length);for(var p=0;p<a;p++){var m=n[p];if(f(m)){if(0===l&&o<m.length&&(o=m.length),l<m.length){var h=m[l];u(h,s)||(e._values.push(h),e._index.push(p))}}else 0===l&&o<1&&(o=1),u(m,s)||(e._values.push(m),e._index.push(p))}l++}while(l<o)}e._ptr.push(e._index.length),e._size=[a,o]}function s(e,t,r,n){if(r-t==0)return r;for(var i=t;i<r;i++)if(n[i]===e)return i;return t}function m(e,t,r,n,i,a,o){i.splice(e,0,n),a.splice(e,0,t);for(var u=r+1;u<o.length;u++)o[u]++}function h(e,n,i,a){var o=a||0,u=r,s=0;c(e._datatype)&&(u=t.find(r,[e._datatype,e._datatype])||r,s=t.convert(0,e._datatype),o=t.convert(o,e._datatype));var f,l,p,m=!u(o,s),h=e._size[0],d=e._size[1];if(i>d){for(l=d;l<i;l++)if(e._ptr[l]=e._values.length,m)for(f=0;f<h;f++)e._values.push(o),e._index.push(f);e._ptr[i]=e._values.length}else i<d&&(e._ptr.splice(i+1,d-i),e._values.splice(e._ptr[i],e._values.length),e._index.splice(e._ptr[i],e._index.length));if(d=i,n>h){if(m){var v=0;for(l=0;l<d;l++){e._ptr[l]=e._ptr[l]+v,p=e._ptr[l+1]+v;var y=0;for(f=h;f<n;f++,y++)e._values.splice(p+y,0,o),e._index.splice(p+y,0,f),v++}e._ptr[d]=e._values.length}}else if(n<h){var g=0;for(l=0;l<d;l++){e._ptr[l]=e._ptr[l]-g;var x=e._ptr[l],b=e._ptr[l+1]-g;for(p=x;p<b;p++)(f=e._index[p])>n-1&&(e._values.splice(p,1),e._index.splice(p,1),g++)}e._ptr[l]=e._values.length}return e._size[0]=n,e._size[1]=i,e}function d(e,t,r,n,i){var a,o,u=n[0],s=n[1],c=[];for(a=0;a<u;a++)for(c[a]=[],o=0;o<s;o++)c[a][o]=0;for(o=0;o<s;o++)for(var f=r[o],l=r[o+1],p=f;p<l;p++)c[a=t[p]][o]=e?i?ye(e[p]):e[p]:1;return c}return o.prototype=new n,o.prototype.createSparseMatrix=function(e,t){return new o(e,t)},Object.defineProperty(o,"name",{value:"SparseMatrix"}),o.prototype.constructor=o,o.prototype.type="SparseMatrix",o.prototype.isSparseMatrix=!0,o.prototype.getDataType=function(){return Bn(this._values,H)},o.prototype.storage=function(){return"sparse"},o.prototype.datatype=function(){return this._datatype},o.prototype.create=function(e,t){return new o(e,t)},o.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},o.prototype.subset=function(e,t,r){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,t){if(!v(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var r,n,i,a,u=t.size();if(u.length!==e._size.length)throw new sn(u.length,e._size.length);var s=t.min(),c=t.max();for(r=0,n=e._size.length;r<n;r++)hn(s[r],e._size[r]),hn(c[r],e._size[r]);var f=e._values,l=e._index,p=e._ptr,m=t.dimension(0),h=t.dimension(1),d=[],y=[];m.forEach((function(e,t){y[e]=t[0],d[e]=!0}));var g=f?[]:void 0,x=[],b=[];return h.forEach((function(e){for(b.push(x.length),i=p[e],a=p[e+1];i<a;i++)r=l[i],!0===d[r]&&(x.push(y[r]),g&&g.push(f[i]))})),b.push(x.length),new o({values:g,index:x,ptr:b,size:u,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var i,a=t.size(),o=t.isScalar();if(l(r)?(i=r.size(),r=r.toArray()):i=fn(r),o){if(0!==i.length)throw new TypeError("Scalar expected");e.set(t.min(),r,n)}else{if(1!==a.length&&2!==a.length)throw new sn(a.length,e._size.length,"<");if(i.length<a.length){for(var u=0,s=0;1===a[u]&&1===i[u];)u++;for(;1===a[u];)s++,u++;r=Dn(r,a.length,s,i)}if(!we(a,i))throw new sn(a,i,">");if(1===a.length)t.dimension(0).forEach((function(t,i){hn(t),e.set([t,0],r[i[0]],n)}));else{var c=t.dimension(0),f=t.dimension(1);c.forEach((function(t,i){hn(t),f.forEach((function(a,o){hn(a),e.set([t,a],r[i[0]][o[0]],n)}))}))}}return e}(this,e,t,r);default:throw new SyntaxError("Wrong number of arguments")}},o.prototype.get=function(e){if(!f(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new sn(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var t=e[0],r=e[1];hn(t,this._size[0]),hn(r,this._size[1]);var n=s(t,this._ptr[r],this._ptr[r+1],this._index);return n<this._ptr[r+1]&&this._index[n]===t?this._values[n]:0},o.prototype.set=function(e,n,i){if(!f(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new sn(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var a=e[0],o=e[1],u=this._size[0],l=this._size[1],p=r,d=0;c(this._datatype)&&(p=t.find(r,[this._datatype,this._datatype])||r,d=t.convert(0,this._datatype)),(a>u-1||o>l-1)&&(h(this,Math.max(a+1,u),Math.max(o+1,l),i),u=this._size[0],l=this._size[1]),hn(a,u),hn(o,l);var v=s(a,this._ptr[o],this._ptr[o+1],this._index);return v<this._ptr[o+1]&&this._index[v]===a?p(n,d)?function(e,t,r,n,i){r.splice(e,1),n.splice(e,1);for(var a=t+1;a<i.length;a++)i[a]--}(v,o,this._values,this._index,this._ptr):this._values[v]=n:p(n,d)||m(v,a,o,n,this._values,this._index,this._ptr),this},o.prototype.resize=function(e,t,r){if(!p(e))throw new TypeError("Array or Matrix expected");var n=e.valueOf().map((function(e){return Array.isArray(e)&&1===e.length?e[0]:e}));if(2!==n.length)throw new Error("Only two dimensions matrix are supported");return n.forEach((function(e){if(!i(e)||!V(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+tn(n)+")")})),h(r?this.clone():this,n[0],n[1],t)},o.prototype.reshape=function(e,t){if(!f(e))throw new TypeError("Array expected");if(2!==e.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");e.forEach((function(t){if(!i(t)||!V(t)||t<=-2||0===t)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+tn(e)+")")}));var r=this._size[0]*this._size[1];if(r!==(e=xn(e,r))[0]*e[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var n=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return n;for(var a=[],o=0;o<n._ptr.length;o++)for(var u=0;u<n._ptr[o+1]-n._ptr[o];u++)a.push(o);for(var c=n._values.slice(),l=n._index.slice(),p=0;p<n._index.length;p++){var h=l[p],d=a[p],v=h*n._size[1]+d;a[p]=v%e[1],l[p]=Math.floor(v/e[1])}n._values.length=0,n._index.length=0,n._ptr.length=e[1]+1,n._size=e.slice();for(var y=0;y<n._ptr.length;y++)n._ptr[y]=0;for(var g=0;g<c.length;g++){var x=l[g],b=a[g],w=c[g];m(s(x,n._ptr[b],n._ptr[b+1],n._index),x,b,w,n._values,n._index,n._ptr)}return n},o.prototype.clone=function(){return new o({values:this._values?ye(this._values):void 0,index:ye(this._index),ptr:ye(this._ptr),size:ye(this._size),datatype:this._datatype})},o.prototype.size=function(){return this._size.slice(0)},o.prototype.map=function(e,n){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var i=this,a=this._size[0],u=this._size[1],s=Ln(e);return function(e,n,i,a,u,s,f){var l=[],p=[],m=[],h=r,d=0;c(e._datatype)&&(h=t.find(r,[e._datatype,e._datatype])||r,d=t.convert(0,e._datatype));for(var v=function(e,t,r){e=s(e,t,r),h(e,d)||(l.push(e),p.push(t))},y=0;y<=u;y++){m.push(l.length);var g=e._ptr[y],x=e._ptr[y+1];if(f)for(var b=g;b<x;b++){var w=e._index[b];w>=0&&w<=i&&v(e._values[b],w-0,y-0)}else{for(var N={},D=g;D<x;D++)N[e._index[D]]=e._values[D];for(var E=0;E<=i;E++)v(E in N?N[E]:0,E-0,y-0)}}return m.push(l.length),new o({values:l,index:p,ptr:m,size:[i-0+1,u-0+1]})}(this,0,a-1,0,u-1,(function(t,r,n){return 1===s?e(t):2===s?e(t,[r,n]):e(t,[r,n],i)}),n)},o.prototype.forEach=function(e,t){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var r=this._size[0],n=this._size[1],i=0;i<n;i++){var a=this._ptr[i],o=this._ptr[i+1];if(t)for(var u=a;u<o;u++){var s=this._index[u];e(this._values[u],[s,i],this)}else{for(var c={},f=a;f<o;f++)c[this._index[f]]=this._values[f];for(var l=0;l<r;l++)e(l in c?c[l]:0,[l,i],this)}}},o.prototype[Symbol.iterator]=Yr.mark((function e(){var t,r,n,i,a,o;return Yr.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._values){e.next=2;break}throw new Error("Cannot iterate a Pattern only matrix");case 2:t=this._size[1],r=0;case 4:if(!(r<t)){e.next=18;break}n=this._ptr[r],i=this._ptr[r+1],a=n;case 8:if(!(a<i)){e.next=15;break}return o=this._index[a],e.next=12,{value:this._values[a],index:[o,r]};case 12:a++,e.next=8;break;case 15:r++,e.next=4;break;case 18:case"end":return e.stop()}}),e,this)})),o.prototype.toArray=function(){return d(this._values,this._index,this._ptr,this._size,!0)},o.prototype.valueOf=function(){return d(this._values,this._index,this._ptr,this._size,!1)},o.prototype.format=function(e){for(var t=this._size[0],r=this._size[1],n=this.density(),i="Sparse Matrix ["+tn(t,e)+" x "+tn(r,e)+"] density: "+tn(n,e)+"\n",a=0;a<r;a++)for(var o=this._ptr[a],u=this._ptr[a+1],s=o;s<u;s++)i+="\n ("+tn(this._index[s],e)+", "+tn(a,e)+") ==> "+(this._values?tn(this._values[s],e):"X");return i},o.prototype.toString=function(){return tn(this.toArray())},o.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},o.prototype.diagonal=function(e){if(e){if(a(e)&&(e=e.toNumber()),!i(e)||!V(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,r=e<0?-e:0,n=this._size[0],u=this._size[1],s=Math.min(n-r,u-t),c=[],f=[],l=[];l[0]=0;for(var p=t;p<u&&c.length<s;p++)for(var m=this._ptr[p],h=this._ptr[p+1],d=m;d<h;d++){var v=this._index[d];if(v===p-t+r){c.push(this._values[d]),f[c.length-1]=v-r;break}}return l.push(c.length),new o({values:c,index:f,ptr:l,size:[s,1]})},o.fromJSON=function(e){return new o(e)},o.diagonal=function(e,n,u,s,p){if(!f(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if(a(e)&&(e=e.toNumber()),!i(e)||!V(e)||e<1)throw new Error("Size values must be positive integers");return e})),u){if(a(u)&&(u=u.toNumber()),!i(u)||!V(u))throw new TypeError("The parameter k must be an integer number")}else u=0;var m=r,h=0;c(p)&&(m=t.find(r,[p,p])||r,h=t.convert(0,p));var d,v=u>0?u:0,y=u<0?-u:0,g=e[0],x=e[1],b=Math.min(g-y,x-v);if(f(n)){if(n.length!==b)throw new Error("Invalid value array length");d=function(e){return n[e]}}else if(l(n)){var w=n.size();if(1!==w.length||w[0]!==b)throw new Error("Invalid matrix length");d=function(e){return n.get([e])}}else d=function(){return n};for(var N=[],D=[],E=[],A=0;A<x;A++){E.push(N.length);var S=A-v;if(S>=0&&S<b){var C=d(S);m(C,h)||(D.push(S+y),N.push(C))}}return E.push(N.length),new o({values:N,index:D,ptr:E,size:[g,x]})},o.prototype.swapRows=function(e,t){if(!(i(e)&&V(e)&&i(t)&&V(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return hn(e,this._size[0]),hn(t,this._size[0]),o._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},o._forEachRow=function(e,t,r,n,i){for(var a=n[e],o=n[e+1],u=a;u<o;u++)i(r[u],t[u])},o._swapRows=function(e,t,r,n,i,a){for(var o=0;o<r;o++){var u=a[o],c=a[o+1],f=s(e,u,c,i),l=s(t,u,c,i);if(f<c&&l<c&&i[f]===e&&i[l]===t){if(n){var p=n[f];n[f]=n[l],n[l]=p}}else if(f<c&&i[f]===e&&(l>=c||i[l]!==t)){var m=n?n[f]:void 0;i.splice(l,0,t),n&&n.splice(l,0,m),i.splice(l<=f?f+1:f,1),n&&n.splice(l<=f?f+1:f,1)}else if(l<c&&i[l]===t&&(f>=c||i[f]!==e)){var h=n?n[l]:void 0;i.splice(f,0,e),n&&n.splice(f,0,h),i.splice(f<=l?l+1:l,1),n&&n.splice(f<=l?l+1:l,1)}}},o}),{isClass:!0})),Ai=Ce("number",["typed"],(function(e){var t=e.typed,r=t("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;var t,r,n=(r=(t=e).match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/))?{input:t,radix:{"0b":2,"0o":8,"0x":16}[r[1]],integerPart:r[2],fractionalPart:r[3]}:null;if(n)return function(e){for(var t=parseInt(e.integerPart,e.radix),r=0,n=0;n<e.fractionalPart.length;n++)r+=parseInt(e.fractionalPart[n],e.radix)/Math.pow(e.radix,n+1);var i=t+r;if(isNaN(i))throw new SyntaxError('String "'+e.input+'" is not a valid number');return i}(n);var i=0,a=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);a&&(i=Number(a[2]),e=a[1]);var o=Number(e);if(isNaN(o))throw new SyntaxError('String "'+e+'" is not a valid number');if(a){if(o>Math.pow(2,i)-1)throw new SyntaxError('String "'.concat(e,'" is out of range'));o>=Math.pow(2,i-1)&&(o-=Math.pow(2,i))}return o},BigNumber:function(e){return e.toNumber()},Fraction:function(e){return e.valueOf()},Unit:t.referToSelf((function(e){return function(t){var r=t.clone();return r.value=e(t.value),r}})),null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))});return r.fromJSON=function(e){return parseFloat(e.value)},r})),Si="string",Ci=Ce(Si,["typed"],(function(e){var t=e.typed;return t(Si,{"":function(){return""},number:ee,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}})),any:function(e){return String(e)}})})),Mi="boolean",Fi=Ce(Mi,["typed"],(function(e){var t=e.typed;return t(Mi,{"":function(){return!1},boolean:function(e){return e},number:function(e){return!!e},null:function(e){return!1},BigNumber:function(e){return!e.isZero()},string:function(e){var t=e.toLowerCase();if("true"===t)return!0;if("false"===t)return!1;var r=Number(e);if(""!==e&&!isNaN(r))return!!r;throw new Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),Oi=Ce("bignumber",["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t("bignumber",{"":function(){return new r(0)},number:function(e){return new r(e+"")},string:function(e){var t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){var n=t[2],i=r(t[1]),a=new r(2).pow(Number(n));if(i.gt(a.sub(1)))throw new SyntaxError('String "'.concat(e,'" is out of range'));var o=new r(2).pow(Number(n)-1);return i.gte(o)?i.sub(a):i}return new r(e)},BigNumber:function(e){return e},Unit:t.referToSelf((function(e){return function(t){var r=t.clone();return r.value=e(t.value),r}})),Fraction:function(e){return new r(e.n).div(e.d).times(e.s)},null:function(e){return new r(0)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),Ti=Ce("complex",["typed","Complex"],(function(e){var t=e.typed,r=e.Complex;return t("complex",{"":function(){return r.ZERO},number:function(e){return new r(e,0)},"number, number":function(e,t){return new r(e,t)},"BigNumber, BigNumber":function(e,t){return new r(e.toNumber(),t.toNumber())},Fraction:function(e){return new r(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return r(e)},null:function(e){return r(0)},Object:function(e){if("re"in e&&"im"in e)return new r(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new r(e);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),_i=Ce("fraction",["typed","Fraction"],(function(e){var t=e.typed,r=e.Fraction;return t("fraction",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new r(e)},string:function(e){return new r(e)},"number, number":function(e,t){return new r(e,t)},null:function(e){return new r(0)},BigNumber:function(e){return new r(e.toString())},Fraction:function(e){return e},Unit:t.referToSelf((function(e){return function(t){var r=t.clone();return r.value=e(t.value),r}})),Object:function(e){return new r(e)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),Bi="matrix",ki=Ce(Bi,["typed","Matrix","DenseMatrix","SparseMatrix"],(function(e){var t=e.typed,r=(e.Matrix,e.DenseMatrix),n=e.SparseMatrix;return t(Bi,{"":function(){return i([])},string:function(e){return i([],e)},"string, string":function(e,t){return i([],e,t)},Array:function(e){return i(e)},Matrix:function(e){return i(e,e.storage())},"Array | Matrix, string":i,"Array | Matrix, string, string":i});function i(e,t,i){if("dense"===t||"default"===t||void 0===t)return new r(e,i);if("sparse"===t)return new n(e,i);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}})),Ii="matrixFromFunction",zi=Ce(Ii,["typed","matrix","isZero"],(function(e){var t=e.typed,r=e.matrix,n=e.isZero;return t(Ii,{"Array | Matrix, function, string, string":function(e,t,r,n){return i(e,t,r,n)},"Array | Matrix, function, string":function(e,t,r){return i(e,t,r)},"Matrix, function":function(e,t){return i(e,t,"dense")},"Array, function":function(e,t){return i(e,t,"dense").toArray()},"Array | Matrix, string, function":function(e,t,r){return i(e,r,t)},"Array | Matrix, string, string, function":function(e,t,r,n){return i(e,n,t,r)}});function i(e,t,i,a){var o;return(o=void 0!==a?r(i,a):r(i)).resize(e),o.forEach((function(e,r){var i=t(r);n(i)||o.set(r,i)})),o}}));function Ri(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var qi="matrixFromRows",ji=Ce(qi,["typed","matrix","flatten","size"],(function(e){var t=e.typed,r=e.matrix,n=e.flatten,i=e.size;return t(qi,{"...Array":function(e){return a(e)},"...Matrix":function(e){return r(a(e.map((function(e){return e.toArray()}))))}});function a(e){if(0===e.length)throw new TypeError("At least one row is needed to construct a matrix.");var t,r=o(e[0]),i=[],a=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Ri(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ri(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}(e);try{for(a.s();!(t=a.n()).done;){var u=t.value,s=o(u);if(s!==r)throw new TypeError("The vectors had different length: "+(0|r)+" ≠ "+(0|s));i.push(n(u))}}catch(e){a.e(e)}finally{a.f()}return i}function o(e){var t=i(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}}));function Pi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Li="matrixFromColumns",Ui=Ce(Li,["typed","matrix","flatten","size"],(function(e){var t=e.typed,r=e.matrix,n=e.flatten,i=e.size;return t(Li,{"...Array":function(e){return a(e)},"...Matrix":function(e){return r(a(e.map((function(e){return e.toArray()}))))}});function a(e){if(0===e.length)throw new TypeError("At least one column is needed to construct a matrix.");for(var t=o(e[0]),r=[],i=0;i<t;i++)r[i]=[];var a,u=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Pi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}(e);try{for(u.s();!(a=u.n()).done;){var s=a.value,c=o(s);if(c!==t)throw new TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|c));for(var f=n(s),l=0;l<t;l++)r[l].push(f[l])}}catch(e){u.e(e)}finally{u.f()}return r}function o(e){var t=i(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}})),$i="splitUnit",Hi=Ce($i,["typed"],(function(e){return(0,e.typed)($i,{"Unit, Array":function(e,t){return e.splitUnit(t)}})})),Gi="number",Vi="number, number";function Zi(e){return Math.abs(e)}function Wi(e,t){return e+t}function Yi(e,t){return e-t}function Ji(e,t){return e*t}function Xi(e){return-e}function Qi(e){return e}function Ki(e){return X(e)}function ea(e){return e*e*e}function ta(e){return Math.exp(e)}function ra(e){return Q(e)}function na(e,t){if(!V(e)||!V(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;for(var r,n=e*t;0!==t;)t=e%(r=t),e=r;return Math.abs(n/e)}function ia(e){return Y(e)}function aa(e){return W(e)}function oa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=t<0;if(r&&(t=-t),0===t)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===e)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function ua(e){return Z(e)}function sa(e){return e*e}function ca(e,t){var r,n,i,a=0,o=1,u=1,s=0;if(!V(e)||!V(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)i=e-(n=Math.floor(e/t))*t,r=a,a=o-n*a,o=r,r=u,u=s-n*u,s=r,e=t,t=i;return e<0?[-e,-o,-s]:[e,e?o:0,s]}function fa(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function la(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!V(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(ne(e,t))}Zi.signature=Gi,Wi.signature=Vi,Yi.signature=Vi,Ji.signature=Vi,Xi.signature=Gi,Qi.signature=Gi,Ki.signature=Gi,ea.signature=Gi,ta.signature=Gi,ra.signature=Gi,na.signature=Vi,ia.signature=Gi,aa.signature=Gi,ua.signature=Gi,sa.signature=Gi,ca.signature=Vi,fa.signature=Vi;var pa="unaryMinus",ma=Ce(pa,["typed"],(function(e){var t=e.typed;return t(pa,{number:Xi,"Complex | BigNumber | Fraction":function(e){return e.neg()},Unit:t.referToSelf((function(e){return function(r){var n=r.clone();return n.value=t.find(e,n.valueType())(r.value),n}})),"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e,!0)}}))})})),ha="unaryPlus",da=Ce(ha,["typed","config","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.BigNumber;return t(ha,{number:Qi,Complex:function(e){return e},BigNumber:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e,!0)}})),"boolean | string":function(e){return"BigNumber"===r.number?new n(+e):+e}})})),va=Ce("abs",["typed"],(function(e){var t=e.typed;return t("abs",{number:Zi,"Complex | BigNumber | Fraction | Unit":function(e){return e.abs()},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e,!0)}}))})})),ya="apply",ga=Ce(ya,["typed","isInteger"],(function(e){var t=e.typed,r=e.isInteger;return t(ya,{"Array | Matrix, number | BigNumber, function":function(e,t,n){if(!r(t))throw new TypeError("Integer number expected for dimension");var i=Array.isArray(e)?fn(e):e.size();if(t<0||t>=i.length)throw new cn(t,i.length);return l(e)?e.create(xa(e.valueOf(),t,n)):xa(e,t,n)}})}));function xa(e,t,r){var n,i,a;if(t<=0){if(Array.isArray(e[0])){for(a=function(e){var t,r,n=e.length,i=e[0].length,a=[];for(r=0;r<i;r++){var o=[];for(t=0;t<n;t++)o.push(e[t][r]);a.push(o)}return a}(e),i=[],n=0;n<a.length;n++)i[n]=xa(a[n],t-1,r);return i}return r(e)}for(i=[],n=0;n<e.length;n++)i[n]=xa(e[n],t-1,r);return i}var ba="addScalar",wa=Ce(ba,["typed"],(function(e){var t=e.typed;return t(ba,{"number, number":Wi,"Complex, Complex":function(e,t){return e.add(t)},"BigNumber, BigNumber":function(e,t){return e.plus(t)},"Fraction, Fraction":function(e,t){return e.add(t)},"Unit, Unit":t.referToSelf((function(e){return function(r,n){if(null===r.value||void 0===r.value)throw new Error("Parameter x contains a unit with undefined value");if(null===n.value||void 0===n.value)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");var i=r.clone();return i.value=t.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i}}))})})),Na="subtractScalar",Da=Ce(Na,["typed"],(function(e){var t=e.typed;return t(Na,{"number, number":Yi,"Complex, Complex":function(e,t){return e.sub(t)},"BigNumber, BigNumber":function(e,t){return e.minus(t)},"Fraction, Fraction":function(e,t){return e.sub(t)},"Unit, Unit":t.referToSelf((function(e){return function(r,n){if(null===r.value||void 0===r.value)throw new Error("Parameter x contains a unit with undefined value");if(null===n.value||void 0===n.value)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");var i=r.clone();return i.value=t.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i}}))})})),Ea="cbrt",Aa=Ce(Ea,["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],(function(e){var t=e.config,r=e.typed,n=e.isNegative,i=e.unaryMinus,s=e.matrix,c=e.Complex,f=e.BigNumber,l=e.Fraction;return r(Ea,{number:Ki,Complex:p,"Complex, boolean":p,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&o(e.value)){var t=e.clone();return t.value=1,(t=t.pow(1/3)).value=p(e.value),t}var r,s=n(e.value);s&&(e.value=i(e.value)),r=a(e.value)?new f(1).div(3):u(e.value)?new l(1,3):1/3;var c=e.pow(r);return s&&(c.value=i(c.value)),c}});function p(e,r){var n=e.arg()/3,i=e.abs(),a=new c(Ki(i),0).mul(new c(0,n).exp());if(r){var o=[a,new c(Ki(i),0).mul(new c(0,n+2*Math.PI/3).exp()),new c(Ki(i),0).mul(new c(0,n-2*Math.PI/3).exp())];return"Array"===t.matrix?o:s(o)}return a}}));function Sa(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,u=[],s=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return u}}(e,t)||Te(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ca=Ce("matAlgo11xS0s",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i,a){var o=e._values,u=e._index,s=e._ptr,c=e._size,f=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var l,p=c[0],m=c[1],h=r,d=0,v=i;"string"==typeof f&&(l=f,h=t.find(r,[l,l]),d=t.convert(0,l),n=t.convert(n,l),v=t.find(i,[l,l]));for(var y=[],g=[],x=[],b=0;b<m;b++){x[b]=g.length;for(var w=s[b],N=s[b+1],D=w;D<N;D++){var E=u[D],A=a?v(n,o[D]):v(o[D],n);h(A,d)||(g.push(E),y.push(A))}}return x[m]=g.length,e.createSparseMatrix({values:y,index:g,ptr:x,size:[p,m],datatype:l})}})),Ma=Ce("matAlgo12xSfs",["typed","DenseMatrix"],(function(e){var t=e.typed,r=e.DenseMatrix;return function(e,n,i,a){var o=e._values,u=e._index,s=e._ptr,c=e._size,f=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var l,p=c[0],m=c[1],h=i;"string"==typeof f&&(l=f,n=t.convert(n,l),h=t.find(i,[l,l]));for(var d=[],v=[],y=[],g=0;g<m;g++){for(var x=g+1,b=s[g],w=s[g+1],N=b;N<w;N++){var D=u[N];v[D]=o[N],y[D]=x}for(var E=0;E<p;E++)0===g&&(d[E]=[]),y[E]===x?d[E][g]=a?h(n,v[E]):h(v[E],n):d[E][g]=a?h(n,0):h(0,n)}return new r({data:d,size:[p,m],datatype:l})}})),Fa=Ce("matAlgo14xDs",["typed"],(function(e){var t=e.typed;return function(e,n,i,a){var o,u=e._data,s=e._size,c=e._datatype,f=i;"string"==typeof c&&(o=c,n=t.convert(n,o),f=t.find(i,[o,o]));var l=s.length>0?r(f,0,s,s[0],u,n,a):[];return e.createDenseMatrix({data:l,size:ye(s),datatype:o})};function r(e,t,n,i,a,o,u){var s=[];if(t===n.length-1)for(var c=0;c<i;c++)s[c]=u?e(o,a[c]):e(a[c],o);else for(var f=0;f<i;f++)s[f]=r(e,t+1,n,n[t+1],a[f],o,u);return s}})),Oa="ceil",Ta=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],_a=Ce(Oa,["typed","config","round"],(function(e){var t=e.typed,r=e.config,n=e.round;return t(Oa,{number:function(e){return se(e,n(e),r.epsilon)?n(e):Math.ceil(e)},"number, number":function(e,t){if(se(e,n(e,t),r.epsilon))return n(e,t);var i=Sa("".concat(e,"e").split("e"),2),a=i[0],o=i[1],u=Math.ceil(Number("".concat(a,"e").concat(Number(o)+t))),s=Sa("".concat(u,"e").split("e"),2);return a=s[0],o=s[1],Number("".concat(a,"e").concat(Number(o)-t))}})})),Ba=Ce(Oa,Ta,(function(e){var t=e.typed,r=e.config,n=e.round,i=e.matrix,a=e.equalScalar,o=e.zeros,u=e.DenseMatrix,s=Ca({typed:t,equalScalar:a}),c=Ma({typed:t,DenseMatrix:u}),f=Fa({typed:t}),l=_a({typed:t,config:r,round:n});return t("ceil",{number:l.signatures.number,"number,number":l.signatures["number,number"],Complex:function(e){return e.ceil()},"Complex, number":function(e,t){return e.ceil(t)},"Complex, BigNumber":function(e,t){return e.ceil(t.toNumber())},BigNumber:function(e){return bi(e,n(e),r.epsilon)?n(e):e.ceil()},"BigNumber, BigNumber":function(e,t){return bi(e,n(e,t),r.epsilon)?n(e,t):e.toDecimalPlaces(t.toNumber(),Lr.ROUND_CEIL)},Fraction:function(e){return e.ceil()},"Fraction, number":function(e,t){return e.ceil(t)},"Fraction, BigNumber":function(e,t){return e.ceil(t.toNumber())},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e,!0)}})),"Array, number | BigNumber":t.referToSelf((function(e){return function(t,r){return Yn(t,(function(t){return e(t,r)}),!0)}})),"SparseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return s(t,r,e,!1)}})),"DenseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return f(t,r,e,!1)}})),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((function(e){return function(t,r){return f(i(r),t,e,!0).valueOf()}})),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((function(e){return function(t,r){return a(t,0)?o(r.size(),r.storage()):"dense"===r.storage()?f(r,t,e,!0):c(r,t,e,!0)}}))})})),ka="cube",Ia=Ce(ka,["typed"],(function(e){return(0,e.typed)(ka,{number:ea,Complex:function(e){return e.mul(e).mul(e)},BigNumber:function(e){return e.times(e).times(e)},Fraction:function(e){return e.pow(3)},Unit:function(e){return e.pow(3)}})})),za=Ce("exp",["typed"],(function(e){return(0,e.typed)("exp",{number:ta,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()}})})),Ra="expm1",qa=Ce(Ra,["typed","Complex"],(function(e){var t=e.typed,r=e.Complex;return t(Ra,{number:ra,Complex:function(e){var t=Math.exp(e.re);return new r(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)}})})),ja="fix",Pa=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],La=Ce(ja,["typed","ceil","floor"],(function(e){var t=e.typed,r=e.ceil,n=e.floor;return t(ja,{number:function(e){return e>0?n(e):r(e)},"number, number":function(e,t){return e>0?n(e,t):r(e,t)}})})),Ua=Ce(ja,Pa,(function(e){var t=e.typed,r=e.Complex,n=e.matrix,i=e.ceil,a=e.floor,o=e.equalScalar,u=e.zeros,s=e.DenseMatrix,c=Ma({typed:t,DenseMatrix:s}),f=Fa({typed:t}),l=La({typed:t,ceil:i,floor:a});return t("fix",{number:l.signatures.number,"number, number | BigNumber":l.signatures["number,number"],Complex:function(e){return new r(e.re>0?Math.floor(e.re):Math.ceil(e.re),e.im>0?Math.floor(e.im):Math.ceil(e.im))},"Complex, number":function(e,t){return new r(e.re>0?a(e.re,t):i(e.re,t),e.im>0?a(e.im,t):i(e.im,t))},"Complex, BigNumber":function(e,t){var n=t.toNumber();return new r(e.re>0?a(e.re,n):i(e.re,n),e.im>0?a(e.im,n):i(e.im,n))},BigNumber:function(e){return e.isNegative()?i(e):a(e)},"BigNumber, number | BigNumber":function(e,t){return e.isNegative()?i(e,t):a(e,t)},Fraction:function(e){return e.s<0?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,t){return e.s<0?i(e,t):a(e,t)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e,!0)}})),"Array | Matrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return Yn(t,(function(t){return e(t,r)}),!0)}})),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((function(e){return function(t,r){return f(n(r),t,e,!0).valueOf()}})),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((function(e){return function(t,r){return o(t,0)?u(r.size(),r.storage()):"dense"===r.storage()?f(r,t,e,!0):c(r,t,e,!0)}}))})})),$a="floor",Ha=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],Ga=Ce($a,["typed","config","round"],(function(e){var t=e.typed,r=e.config,n=e.round;return t($a,{number:function(e){return se(e,n(e),r.epsilon)?n(e):Math.floor(e)},"number, number":function(e,t){if(se(e,n(e,t),r.epsilon))return n(e,t);var i=Sa("".concat(e,"e").split("e"),2),a=i[0],o=i[1],u=Math.floor(Number("".concat(a,"e").concat(Number(o)+t))),s=Sa("".concat(u,"e").split("e"),2);return a=s[0],o=s[1],Number("".concat(a,"e").concat(Number(o)-t))}})})),Va=Ce($a,Ha,(function(e){var t=e.typed,r=e.config,n=e.round,i=e.matrix,a=e.equalScalar,o=e.zeros,u=e.DenseMatrix,s=Ca({typed:t,equalScalar:a}),c=Ma({typed:t,DenseMatrix:u}),f=Fa({typed:t}),l=Ga({typed:t,config:r,round:n});return t("floor",{number:l.signatures.number,"number,number":l.signatures["number,number"],Complex:function(e){return e.floor()},"Complex, number":function(e,t){return e.floor(t)},"Complex, BigNumber":function(e,t){return e.floor(t.toNumber())},BigNumber:function(e){return bi(e,n(e),r.epsilon)?n(e):e.floor()},"BigNumber, BigNumber":function(e,t){return bi(e,n(e,t),r.epsilon)?n(e,t):e.toDecimalPlaces(t.toNumber(),Lr.ROUND_FLOOR)},Fraction:function(e){return e.floor()},"Fraction, number":function(e,t){return e.floor(t)},"Fraction, BigNumber":function(e,t){return e.floor(t.toNumber())},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e,!0)}})),"Array, number | BigNumber":t.referToSelf((function(e){return function(t,r){return Yn(t,(function(t){return e(t,r)}),!0)}})),"SparseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return s(t,r,e,!1)}})),"DenseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return f(t,r,e,!1)}})),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((function(e){return function(t,r){return f(i(r),t,e,!0).valueOf()}})),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((function(e){return function(t,r){return a(t,0)?o(r.size(),r.storage()):"dense"===r.storage()?f(r,t,e,!0):c(r,t,e,!0)}}))})}));function Za(e,t,r){return(t=ke(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Wa=Ce("matAlgo02xDS0",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i,a){var o=e._data,u=e._size,s=e._datatype||e.getDataType(),c=n._values,f=n._index,l=n._ptr,p=n._size,m=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(u.length!==p.length)throw new sn(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h,d=u[0],v=u[1],y=r,g=0,x=i;"string"==typeof s&&s===m&&"mixed"!==s&&(h=s,y=t.find(r,[h,h]),g=t.convert(0,h),x=t.find(i,[h,h]));for(var b=[],w=[],N=[],D=0;D<v;D++){N[D]=w.length;for(var E=l[D],A=l[D+1],S=E;S<A;S++){var C=f[S],M=a?x(c[S],o[C][D]):x(o[C][D],c[S]);y(M,g)||(w.push(C),b.push(M))}}return N[v]=w.length,n.createSparseMatrix({values:b,index:w,ptr:N,size:[d,v],datatype:s===e._datatype&&m===n._datatype?h:void 0})}})),Ya=Ce("matAlgo03xDSf",["typed"],(function(e){var t=e.typed;return function(e,r,n,i){var a=e._data,o=e._size,u=e._datatype||e.getDataType(),s=r._values,c=r._index,f=r._ptr,l=r._size,p=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(o.length!==l.length)throw new sn(o.length,l.length);if(o[0]!==l[0]||o[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+l+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m,h=o[0],d=o[1],v=0,y=n;"string"==typeof u&&u===p&&"mixed"!==u&&(m=u,v=t.convert(0,m),y=t.find(n,[m,m]));for(var g=[],x=0;x<h;x++)g[x]=[];for(var b=[],w=[],N=0;N<d;N++){for(var D=N+1,E=f[N],A=f[N+1],S=E;S<A;S++){var C=c[S];b[C]=i?y(s[S],a[C][N]):y(a[C][N],s[S]),w[C]=D}for(var M=0;M<h;M++)w[M]===D?g[M][N]=b[M]:g[M][N]=i?y(v,a[M][N]):y(a[M][N],v)}return e.createDenseMatrix({data:g,size:[h,d],datatype:u===e._datatype&&p===r._datatype?m:void 0})}})),Ja=Ce("matAlgo05xSfSf",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var a=e._values,o=e._index,u=e._ptr,s=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),f=n._values,l=n._index,p=n._ptr,m=n._size,h=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(s.length!==m.length)throw new sn(s.length,m.length);if(s[0]!==m[0]||s[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+m+")");var d,v=s[0],y=s[1],g=r,x=0,b=i;"string"==typeof c&&c===h&&"mixed"!==c&&(d=c,g=t.find(r,[d,d]),x=t.convert(0,d),b=t.find(i,[d,d]));var w,N,D,E,A=a&&f?[]:void 0,S=[],C=[],M=A?[]:void 0,F=A?[]:void 0,O=[],T=[];for(N=0;N<y;N++){C[N]=S.length;var _=N+1;for(D=u[N],E=u[N+1];D<E;D++)w=o[D],S.push(w),O[w]=_,M&&(M[w]=a[D]);for(D=p[N],E=p[N+1];D<E;D++)O[w=l[D]]!==_&&S.push(w),T[w]=_,F&&(F[w]=f[D]);if(A)for(D=C[N];D<S.length;){var B=O[w=S[D]],k=T[w];if(B===_||k===_){var I=b(B===_?M[w]:x,k===_?F[w]:x);g(I,x)?S.splice(D,1):(A.push(I),D++)}}}return C[y]=S.length,e.createSparseMatrix({values:A,index:S,ptr:C,size:[v,y],datatype:c===e._datatype&&h===n._datatype?d:void 0})}})),Xa=Ce("matAlgo13xDD",["typed"],(function(e){var t=e.typed;return function(e,n,i){var a,o=e._data,u=e._size,s=e._datatype,c=n._data,f=n._size,l=n._datatype,p=[];if(u.length!==f.length)throw new sn(u.length,f.length);for(var m=0;m<u.length;m++){if(u[m]!==f[m])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+f+")");p[m]=u[m]}var h=i;"string"==typeof s&&s===l&&(a=s,h=t.find(i,[a,a]));var d=p.length>0?r(h,0,p,p[0],o,c):[];return e.createDenseMatrix({data:d,size:p,datatype:a})};function r(e,t,n,i,a,o){var u=[];if(t===n.length-1)for(var s=0;s<i;s++)u[s]=e(a[s],o[s]);else for(var c=0;c<i;c++)u[c]=r(e,t+1,n,n[t+1],a[c],o[c]);return u}})),Qa=Ce("broadcast",["concat"],(function(e){var t=e.concat;return function(e,t){var i=Math.max(e._size.length,t._size.length);if(e._size.length===t._size.length&&e._size.every((function(e,r){return e===t._size[r]})))return[e,t];for(var a=r(e._size,i,0),o=r(t._size,i,0),u=[],s=0;s<i;s++)u[s]=Math.max(a[s],o[s]);Rn(a,u),Rn(o,u);var c=e.clone(),f=t.clone();c._size.length<i?c.reshape(r(c._size,i,1)):f._size.length<i&&f.reshape(r(f._size,i,1));for(var l=0;l<i;l++)c._size[l]<u[l]&&(c=n(c,u[l],l)),f._size[l]<u[l]&&(f=n(f,u[l],l));return[c,f]};function r(e,t,r){return[].concat(_e(Array(t-e.length).fill(r)),_e(e))}function n(e,r,n){return t.apply(void 0,_e(Array(r).fill(e)).concat([n]))}})),Ka=Ce("matrixAlgorithmSuite",["typed","matrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.concat,i=Xa({typed:t}),a=Fa({typed:t}),o=Qa({concat:n});return function(e){var n,u=e.elop,s=e.SD||e.DS;u?(n={"DenseMatrix, DenseMatrix":function(e,t){return i.apply(void 0,_e(o(e,t)).concat([u]))},"Array, Array":function(e,t){return i.apply(void 0,_e(o(r(e),r(t))).concat([u])).valueOf()},"Array, DenseMatrix":function(e,t){return i.apply(void 0,_e(o(r(e),t)).concat([u]))},"DenseMatrix, Array":function(e,t){return i.apply(void 0,_e(o(e,r(t))).concat([u]))}},e.SS&&(n["SparseMatrix, SparseMatrix"]=function(t,r){return e.SS.apply(e,_e(o(t,r)).concat([u,!1]))}),e.DS&&(n["DenseMatrix, SparseMatrix"]=function(t,r){return e.DS.apply(e,_e(o(t,r)).concat([u,!1]))},n["Array, SparseMatrix"]=function(t,n){return e.DS.apply(e,_e(o(r(t),n)).concat([u,!1]))}),s&&(n["SparseMatrix, DenseMatrix"]=function(e,t){return s.apply(void 0,_e(o(t,e)).concat([u,!0]))},n["SparseMatrix, Array"]=function(e,t){return s.apply(void 0,_e(o(r(t),e)).concat([u,!0]))})):(n={"DenseMatrix, DenseMatrix":t.referToSelf((function(e){return function(t,r){return i.apply(void 0,_e(o(t,r)).concat([e]))}})),"Array, Array":t.referToSelf((function(e){return function(t,n){return i.apply(void 0,_e(o(r(t),r(n))).concat([e])).valueOf()}})),"Array, DenseMatrix":t.referToSelf((function(e){return function(t,n){return i.apply(void 0,_e(o(r(t),n)).concat([e]))}})),"DenseMatrix, Array":t.referToSelf((function(e){return function(t,n){return i.apply(void 0,_e(o(t,r(n))).concat([e]))}}))},e.SS&&(n["SparseMatrix, SparseMatrix"]=t.referToSelf((function(t){return function(r,n){return e.SS.apply(e,_e(o(r,n)).concat([t,!1]))}}))),e.DS&&(n["DenseMatrix, SparseMatrix"]=t.referToSelf((function(t){return function(r,n){return e.DS.apply(e,_e(o(r,n)).concat([t,!1]))}})),n["Array, SparseMatrix"]=t.referToSelf((function(t){return function(n,i){return e.DS.apply(e,_e(o(r(n),i)).concat([t,!1]))}}))),s&&(n["SparseMatrix, DenseMatrix"]=t.referToSelf((function(e){return function(t,r){return s.apply(void 0,_e(o(r,t)).concat([e,!0]))}})),n["SparseMatrix, Array"]=t.referToSelf((function(e){return function(t,n){return s.apply(void 0,_e(o(r(n),t)).concat([e,!0]))}}))));var c=e.scalar||"any";(e.Ds||e.Ss)&&(u?(n["DenseMatrix,"+c]=function(e,t){return a(e,t,u,!1)},n[c+", DenseMatrix"]=function(e,t){return a(t,e,u,!0)},n["Array,"+c]=function(e,t){return a(r(e),t,u,!1).valueOf()},n[c+", Array"]=function(e,t){return a(r(t),e,u,!0).valueOf()}):(n["DenseMatrix,"+c]=t.referToSelf((function(e){return function(t,r){return a(t,r,e,!1)}})),n[c+", DenseMatrix"]=t.referToSelf((function(e){return function(t,r){return a(r,t,e,!0)}})),n["Array,"+c]=t.referToSelf((function(e){return function(t,n){return a(r(t),n,e,!1).valueOf()}})),n[c+", Array"]=t.referToSelf((function(e){return function(t,n){return a(r(n),t,e,!0).valueOf()}}))));var f=void 0!==e.sS?e.sS:e.Ss;return u?(e.Ss&&(n["SparseMatrix,"+c]=function(t,r){return e.Ss(t,r,u,!1)}),f&&(n[c+", SparseMatrix"]=function(e,t){return f(t,e,u,!0)})):(e.Ss&&(n["SparseMatrix,"+c]=t.referToSelf((function(t){return function(r,n){return e.Ss(r,n,t,!1)}}))),f&&(n[c+", SparseMatrix"]=t.referToSelf((function(e){return function(t,r){return f(r,t,e,!0)}})))),u&&u.signatures&&xe(n,u.signatures),n}})),eo=Ce("mod",["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.config,n=e.round,i=e.matrix,a=e.equalScalar,o=e.zeros,u=e.DenseMatrix,s=e.concat,c=Va({typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}),f=Wa({typed:t,equalScalar:a}),l=Ya({typed:t}),p=Ja({typed:t,equalScalar:a}),m=Ca({typed:t,equalScalar:a}),h=Ma({typed:t,DenseMatrix:u});return t("mod",{"number, number":function(e,t){return 0===t?e:e-t*c(e/t)},"BigNumber, BigNumber":function(e,t){return t.isZero()?e:e.sub(t.mul(c(e.div(t))))},"Fraction, Fraction":function(e,t){return t.equals(0)?e:e.sub(t.mul(c(e.div(t))))}},Ka({typed:t,matrix:i,concat:s})({SS:p,DS:l,SD:f,Ss:m,sS:h}))})),to=Ce("matAlgo01xDSid",["typed"],(function(e){var t=e.typed;return function(e,r,n,i){var a=e._data,o=e._size,u=e._datatype||e.getDataType(),s=r._values,c=r._index,f=r._ptr,l=r._size,p=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(o.length!==l.length)throw new sn(o.length,l.length);if(o[0]!==l[0]||o[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+l+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m,h,d=o[0],v=o[1],y="string"==typeof u&&"mixed"!==u&&u===p?u:void 0,g=y?t.find(n,[y,y]):n,x=[];for(m=0;m<d;m++)x[m]=[];var b=[],w=[];for(h=0;h<v;h++){for(var N=h+1,D=f[h],E=f[h+1],A=D;A<E;A++)b[m=c[A]]=i?g(s[A],a[m][h]):g(a[m][h],s[A]),w[m]=N;for(m=0;m<d;m++)w[m]===N?x[m][h]=b[m]:x[m][h]=a[m][h]}return e.createDenseMatrix({data:x,size:[d,v],datatype:u===e._datatype&&p===r._datatype?y:void 0})}})),ro=Ce("matAlgo04xSidSid",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var a=e._values,o=e._index,u=e._ptr,s=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),f=n._values,l=n._index,p=n._ptr,m=n._size,h=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(s.length!==m.length)throw new sn(s.length,m.length);if(s[0]!==m[0]||s[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+m+")");var d,v=s[0],y=s[1],g=r,x=0,b=i;"string"==typeof c&&c===h&&"mixed"!==c&&(d=c,g=t.find(r,[d,d]),x=t.convert(0,d),b=t.find(i,[d,d]));var w,N,D,E,A,S=a&&f?[]:void 0,C=[],M=[],F=a&&f?[]:void 0,O=a&&f?[]:void 0,T=[],_=[];for(N=0;N<y;N++){M[N]=C.length;var B=N+1;for(E=u[N],A=u[N+1],D=E;D<A;D++)w=o[D],C.push(w),T[w]=B,F&&(F[w]=a[D]);for(E=p[N],A=p[N+1],D=E;D<A;D++)if(T[w=l[D]]===B){if(F){var k=b(F[w],f[D]);g(k,x)?T[w]=null:F[w]=k}}else C.push(w),_[w]=B,O&&(O[w]=f[D]);if(F&&O)for(D=M[N];D<C.length;)T[w=C[D]]===B?(S[D]=F[w],D++):_[w]===B?(S[D]=O[w],D++):C.splice(D,1)}return M[y]=C.length,e.createSparseMatrix({values:S,index:C,ptr:M,size:[v,y],datatype:c===e._datatype&&h===n._datatype?d:void 0})}})),no=Ce("matAlgo10xSids",["typed","DenseMatrix"],(function(e){var t=e.typed,r=e.DenseMatrix;return function(e,n,i,a){var o=e._values,u=e._index,s=e._ptr,c=e._size,f=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var l,p=c[0],m=c[1],h=i;"string"==typeof f&&(l=f,n=t.convert(n,l),h=t.find(i,[l,l]));for(var d=[],v=[],y=[],g=0;g<m;g++){for(var x=g+1,b=s[g],w=s[g+1],N=b;N<w;N++){var D=u[N];v[D]=o[N],y[D]=x}for(var E=0;E<p;E++)0===g&&(d[E]=[]),y[E]===x?d[E][g]=a?h(n,v[E]):h(v[E],n):d[E][g]=n}return new r({data:d,size:[p,m],datatype:l})}}));function io(e,t,r,n){if(!(this instanceof io))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=r,this.max=n,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+r+(null!=n?"-"+n:"")+" expected)",this.stack=(new Error).stack}io.prototype=new Error,io.prototype.constructor=Error,io.prototype.name="ArgumentsError",io.prototype.isArgumentsError=!0;var ao=["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],oo="number | BigNumber | Fraction | Matrix | Array",uo="".concat(oo,", ").concat(oo,", ...").concat(oo);function so(e){return!e.some((function(e){return Array.isArray(e)}))}var co=Ce("gcd",ao,(function(e){var t=e.typed,r=e.matrix,n=e.config,i=e.round,a=e.equalScalar,o=e.zeros,u=e.BigNumber,s=e.DenseMatrix,c=e.concat,f=eo({typed:t,config:n,round:i,matrix:r,equalScalar:a,zeros:o,DenseMatrix:s,concat:c}),l=to({typed:t}),p=ro({typed:t,equalScalar:a}),m=no({typed:t,DenseMatrix:s});return t("gcd",{"number, number":function(e,t){if(!V(e)||!V(t))throw new Error("Parameters in function gcd must be integer numbers");for(var r;0!==t;)r=f(e,t),e=t,t=r;return e<0?-e:e},"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var r=new u(0);!t.isZero();){var n=f(e,t);e=t,t=n}return e.lt(r)?e.neg():e},"Fraction, Fraction":function(e,t){return e.gcd(t)}},Ka({typed:t,matrix:r,concat:c})({SS:p,DS:l,Ss:m}),Za(Za(Za({},uo,t.referToSelf((function(e){return function(t,r,n){for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i}}))),"Array",t.referToSelf((function(e){return function(t){if(1===t.length&&Array.isArray(t[0])&&so(t[0]))return e.apply(void 0,_e(t[0]));if(so(t))return e.apply(void 0,_e(t));throw new io("gcd() supports only 1d matrices!")}}))),"Matrix",t.referToSelf((function(e){return function(t){return e(t.toArray())}}))))})),fo=Ce("matAlgo06xS0S0",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var a=e._values,o=e._size,u=e._datatype||void 0===e._data?e._datatype:e.getDataType(),s=n._values,c=n._size,f=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(o.length!==c.length)throw new sn(o.length,c.length);if(o[0]!==c[0]||o[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+c+")");var l,p=o[0],m=o[1],h=r,d=0,v=i;"string"==typeof u&&u===f&&"mixed"!==u&&(l=u,h=t.find(r,[l,l]),d=t.convert(0,l),v=t.find(i,[l,l]));for(var y=a&&s?[]:void 0,g=[],x=[],b=y?[]:void 0,w=[],N=[],D=0;D<m;D++){x[D]=g.length;var E=D+1;if(Qn(e,D,w,b,N,E,g,v),Qn(n,D,w,b,N,E,g,v),b)for(var A=x[D];A<g.length;){var S=g[A];if(N[S]===E){var C=b[S];h(C,d)?g.splice(A,1):(y.push(C),A++)}else g.splice(A,1)}else for(var M=x[D];M<g.length;)N[g[M]]!==E?g.splice(M,1):M++}return x[m]=g.length,e.createSparseMatrix({values:y,index:g,ptr:x,size:[p,m],datatype:u===e._datatype&&f===n._datatype?l:void 0})}})),lo=Ce("lcm",["typed","matrix","equalScalar","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.concat,a=Wa({typed:t,equalScalar:n}),o=fo({typed:t,equalScalar:n}),u=Ca({typed:t,equalScalar:n}),s=Ka({typed:t,matrix:r,concat:i}),c="number | BigNumber | Fraction | Matrix | Array",f={};return f["".concat(c,", ").concat(c,", ...").concat(c)]=t.referToSelf((function(e){return function(t,r,n){for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i}})),t("lcm",{"number, number":na,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(e.isZero())return e;if(t.isZero())return t;for(var r=e.times(t);!t.isZero();){var n=t;t=e.mod(n),e=n}return r.div(e).abs()},"Fraction, Fraction":function(e,t){return e.lcm(t)}},s({SS:o,DS:a,Ss:u}),f)})),po="log10",mo=Ce(po,["typed","config","Complex"],(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(po,{number:function(e){return e>=0||r.predictable?ia(e):new n(e,0).log().div(Math.LN10)},Complex:function(e){return new n(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||r.predictable?e.log():new n(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),ho="log2",vo=Ce(ho,["typed","config","Complex"],(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(ho,{number:function(e){return e>=0||r.predictable?aa(e):i(new n(e,0))},Complex:i,BigNumber:function(e){return!e.isNegative()||r.predictable?e.log(2):i(new n(e.toNumber(),0))},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))});function i(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new n(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}})),yo=Ce("multiplyScalar",["typed"],(function(e){return(0,e.typed)("multiplyScalar",{"number, number":Ji,"Complex, Complex":function(e,t){return e.mul(t)},"BigNumber, BigNumber":function(e,t){return e.times(t)},"Fraction, Fraction":function(e,t){return e.mul(t)},"number | Fraction | BigNumber | Complex, Unit":function(e,t){return t.multiply(e)},"Unit, number | Fraction | BigNumber | Complex | Unit":function(e,t){return e.multiply(t)}})})),go="multiply",xo=Ce(go,["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],(function(e){var t=e.typed,r=e.matrix,n=e.addScalar,i=e.multiplyScalar,a=e.equalScalar,o=e.dot,u=Ca({typed:t,equalScalar:a}),s=Fa({typed:t});function c(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+e[0]+") must match Matrix rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;case 2:switch(t.length){case 1:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+e[1]+") must match Vector length ("+t[0]+")");break;case 2:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+e[1]+") must match Matrix B rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+e.length+" dimensions)")}}var f=t("_multiplyMatrixVector",{"DenseMatrix, any":function(e,r){var a,o=e._data,u=e._size,s=e._datatype||e.getDataType(),c=r._data,f=r._datatype||r.getDataType(),l=u[0],p=u[1],m=n,h=i;s&&f&&s===f&&"string"==typeof s&&"mixed"!==s&&(a=s,m=t.find(n,[a,a]),h=t.find(i,[a,a]));for(var d=[],v=0;v<l;v++){for(var y=o[v],g=h(y[0],c[0]),x=1;x<p;x++)g=m(g,h(y[x],c[x]));d[v]=g}return e.createDenseMatrix({data:d,size:[l],datatype:s===e._datatype&&f===r._datatype?a:void 0})},"SparseMatrix, any":function(e,r){var o=e._values,u=e._index,s=e._ptr,c=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var f,l=r._data,p=r._datatype||r.getDataType(),m=e._size[0],h=r._size[0],d=[],v=[],y=[],g=n,x=i,b=a,w=0;c&&p&&c===p&&"string"==typeof c&&"mixed"!==c&&(f=c,g=t.find(n,[f,f]),x=t.find(i,[f,f]),b=t.find(a,[f,f]),w=t.convert(0,f));var N=[],D=[];y[0]=0;for(var E=0;E<h;E++){var A=l[E];if(!b(A,w))for(var S=s[E],C=s[E+1],M=S;M<C;M++){var F=u[M];D[F]?N[F]=g(N[F],x(A,o[M])):(D[F]=!0,v.push(F),N[F]=x(A,o[M]))}}for(var O=v.length,T=0;T<O;T++){var _=v[T];d[T]=N[_]}return y[1]=v.length,e.createSparseMatrix({values:d,index:v,ptr:y,size:[m,1],datatype:c===e._datatype&&p===r._datatype?f:void 0})}}),p=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(e,r){var a,o=e._data,u=e._size,s=e._datatype||e.getDataType(),c=r._data,f=r._size,l=r._datatype||r.getDataType(),p=u[0],m=u[1],h=f[1],d=n,v=i;s&&l&&s===l&&"string"==typeof s&&"mixed"!==s&&"mixed"!==s&&(a=s,d=t.find(n,[a,a]),v=t.find(i,[a,a]));for(var y=[],g=0;g<p;g++){var x=o[g];y[g]=[];for(var b=0;b<h;b++){for(var w=v(x[0],c[0][b]),N=1;N<m;N++)w=d(w,v(x[N],c[N][b]));y[g][b]=w}}return e.createDenseMatrix({data:y,size:[p,h],datatype:s===e._datatype&&l===r._datatype?a:void 0})},"DenseMatrix, SparseMatrix":function(e,r){var o=e._data,u=e._size,s=e._datatype||e.getDataType(),c=r._values,f=r._index,l=r._ptr,p=r._size,m=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(!c)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var h,d=u[0],v=p[1],y=n,g=i,x=a,b=0;s&&m&&s===m&&"string"==typeof s&&"mixed"!==s&&(h=s,y=t.find(n,[h,h]),g=t.find(i,[h,h]),x=t.find(a,[h,h]),b=t.convert(0,h));for(var w=[],N=[],D=[],E=r.createSparseMatrix({values:w,index:N,ptr:D,size:[d,v],datatype:s===e._datatype&&m===r._datatype?h:void 0}),A=0;A<v;A++){D[A]=N.length;var S=l[A],C=l[A+1];if(C>S)for(var M=0,F=0;F<d;F++){for(var O=F+1,T=void 0,_=S;_<C;_++){var B=f[_];M!==O?(T=g(o[F][B],c[_]),M=O):T=y(T,g(o[F][B],c[_]))}M!==O||x(T,b)||(N.push(F),w.push(T))}}return D[v]=N.length,E},"SparseMatrix, DenseMatrix":function(e,r){var o=e._values,u=e._index,s=e._ptr,c=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var f,l=r._data,p=r._datatype||r.getDataType(),m=e._size[0],h=r._size[0],d=r._size[1],v=n,y=i,g=a,x=0;c&&p&&c===p&&"string"==typeof c&&"mixed"!==c&&(f=c,v=t.find(n,[f,f]),y=t.find(i,[f,f]),g=t.find(a,[f,f]),x=t.convert(0,f));for(var b=[],w=[],N=[],D=e.createSparseMatrix({values:b,index:w,ptr:N,size:[m,d],datatype:c===e._datatype&&p===r._datatype?f:void 0}),E=[],A=[],S=0;S<d;S++){N[S]=w.length;for(var C=S+1,M=0;M<h;M++){var F=l[M][S];if(!g(F,x))for(var O=s[M],T=s[M+1],_=O;_<T;_++){var B=u[_];A[B]!==C?(A[B]=C,w.push(B),E[B]=y(F,o[_])):E[B]=v(E[B],y(F,o[_]))}}for(var k=N[S],I=w.length,z=k;z<I;z++){var R=w[z];b[z]=E[R]}}return N[d]=w.length,D},"SparseMatrix, SparseMatrix":function(e,r){var a,o=e._values,u=e._index,s=e._ptr,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),f=r._values,l=r._index,p=r._ptr,m=r._datatype||void 0===r._data?r._datatype:r.getDataType(),h=e._size[0],d=r._size[1],v=o&&f,y=n,g=i;c&&m&&c===m&&"string"==typeof c&&"mixed"!==c&&(a=c,y=t.find(n,[a,a]),g=t.find(i,[a,a]));for(var x,b,w,N,D,E,A,S,C=v?[]:void 0,M=[],F=[],O=e.createSparseMatrix({values:C,index:M,ptr:F,size:[h,d],datatype:c===e._datatype&&m===r._datatype?a:void 0}),T=v?[]:void 0,_=[],B=0;B<d;B++){F[B]=M.length;var k=B+1;for(D=p[B],E=p[B+1],N=D;N<E;N++)if(S=l[N],v)for(b=s[S],w=s[S+1],x=b;x<w;x++)_[A=u[x]]!==k?(_[A]=k,M.push(A),T[A]=g(f[N],o[x])):T[A]=y(T[A],g(f[N],o[x]));else for(b=s[S],w=s[S+1],x=b;x<w;x++)_[A=u[x]]!==k&&(_[A]=k,M.push(A));if(v)for(var I=F[B],z=M.length,R=I;R<z;R++){var q=M[R];C[R]=T[q]}}return F[d]=M.length,O}});return t(go,i,{"Array, Array":t.referTo("Matrix, Matrix",(function(e){return function(t,n){c(fn(t),fn(n));var i=e(r(t),r(n));return l(i)?i.valueOf():i}})),"Matrix, Matrix":function(e,r){var a=e.size(),u=r.size();return c(a,u),1===a.length?1===u.length?function(e,t,r){if(0===r)throw new Error("Cannot multiply two empty vectors");return o(e,t)}(e,r,a[0]):function(e,r){if("dense"!==r.storage())throw new Error("Support for SparseMatrix not implemented");return function(e,r){var a,o=e._data,u=e._size,s=e._datatype||e.getDataType(),c=r._data,f=r._size,l=r._datatype||r.getDataType(),p=u[0],m=f[1],h=n,d=i;s&&l&&s===l&&"string"==typeof s&&"mixed"!==s&&(a=s,h=t.find(n,[a,a]),d=t.find(i,[a,a]));for(var v=[],y=0;y<m;y++){for(var g=d(o[0],c[0][y]),x=1;x<p;x++)g=h(g,d(o[x],c[x][y]));v[y]=g}return e.createDenseMatrix({data:v,size:[m],datatype:s===e._datatype&&l===r._datatype?a:void 0})}(e,r)}(e,r):1===u.length?f(e,r):p(e,r)},"Matrix, Array":t.referTo("Matrix,Matrix",(function(e){return function(t,n){return e(t,r(n))}})),"Array, Matrix":t.referToSelf((function(e){return function(t,n){return e(r(t,n.storage()),n)}})),"SparseMatrix, any":function(e,t){return u(e,t,i,!1)},"DenseMatrix, any":function(e,t){return s(e,t,i,!1)},"any, SparseMatrix":function(e,t){return u(t,e,i,!0)},"any, DenseMatrix":function(e,t){return s(t,e,i,!0)},"Array, any":function(e,t){return s(r(e),t,i,!1).valueOf()},"any, Array":function(e,t){return s(r(t),e,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf((function(e){return function(t,r,n){for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i}}))})})),bo="nthRoot",wo=Ce(bo,["typed","matrix","equalScalar","BigNumber","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.BigNumber,a=e.concat,o=to({typed:t}),u=Wa({typed:t,equalScalar:n}),s=fo({typed:t,equalScalar:n}),c=Ca({typed:t,equalScalar:n}),f=Ka({typed:t,matrix:r,concat:a});function l(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(bo,{number:oa,"number, number":oa,BigNumber:function(e){return p(e,new i(2))},"BigNumber, BigNumber":p,Complex:l,"Complex, number":l,Array:t.referTo("DenseMatrix,number",(function(e){return function(t){return e(r(t),2).valueOf()}})),DenseMatrix:t.referTo("DenseMatrix,number",(function(e){return function(t){return e(t,2)}})),SparseMatrix:t.referTo("SparseMatrix,number",(function(e){return function(t){return e(t,2)}})),"SparseMatrix, SparseMatrix":t.referToSelf((function(e){return function(t,r){if(1===r.density())return s(t,r,e);throw new Error("Root must be non-zero")}})),"DenseMatrix, SparseMatrix":t.referToSelf((function(e){return function(t,r){if(1===r.density())return o(t,r,e,!1);throw new Error("Root must be non-zero")}})),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",(function(e){return function(t,n){return e(r(t),n)}})),"number | BigNumber, SparseMatrix":t.referToSelf((function(e){return function(t,r){if(1===r.density())return c(r,t,e,!0);throw new Error("Root must be non-zero")}}))},f({scalar:"number | BigNumber",SD:u,Ss:c,sS:!1}));function p(e,t){var r=i.precision,n=i.clone({precision:r+2}),a=new i(0),o=new n(1),u=t.isNegative();if(u&&(t=t.neg()),t.isZero())throw new Error("Root must be non-zero");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e.isZero())return u?new n(1/0):0;if(!e.isFinite())return u?a:e;var s=e.abs().pow(o.div(t));return s=e.isNeg()?s.neg():s,new i((u?o.div(s):s).toPrecision(r))}})),No="sign",Do=Ce(No,["typed","BigNumber","Fraction","complex"],(function(e){var t=e.typed,r=e.BigNumber,n=e.complex,i=e.Fraction;return t(No,{number:ua,Complex:function(e){return 0===e.im?n(ua(e.re)):e.sign()},BigNumber:function(e){return new r(e.cmp(0))},Fraction:function(e){return new i(e.s,1)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e,!0)}})),Unit:t.referToSelf((function(e){return function(r){if(!r._isDerived()&&0!==r.units[0].unit.offset)throw new TypeError("sign is ambiguous for units with offset");return t.find(e,r.valueType())(r.value)}}))})})),Eo=Ce("sqrt",["config","typed","Complex"],(function(e){var t=e.config,r=e.typed,n=e.Complex;return r("sqrt",{number:i,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.sqrt():i(e.toNumber())},Unit:function(e){return e.pow(.5)}});function i(e){return isNaN(e)?NaN:e>=0||t.predictable?Math.sqrt(e):new n(e,0).sqrt()}})),Ao="square",So=Ce(Ao,["typed"],(function(e){return(0,e.typed)(Ao,{number:sa,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},Fraction:function(e){return e.mul(e)},Unit:function(e){return e.pow(2)}})})),Co="subtract",Mo=Ce(Co,["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.subtractScalar,a=(e.unaryMinus,e.DenseMatrix),o=e.concat,u=to({typed:t}),s=Ya({typed:t}),c=Ja({typed:t,equalScalar:n}),f=no({typed:t,DenseMatrix:a}),l=Ma({typed:t,DenseMatrix:a}),p=Ka({typed:t,matrix:r,concat:o});return t(Co,{"any, any":i},p({elop:i,SS:c,DS:u,SD:s,Ss:l,sS:f}))})),Fo="xgcd",Oo=Ce(Fo,["typed","config","matrix","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.BigNumber;return t(Fo,{"number, number":function(e,t){var i=ca(e,t);return"Array"===r.matrix?i:n(i)},"BigNumber, BigNumber":function(e,t){var a,o,u,s,c=new i(0),f=new i(1),l=c,p=f,m=f,h=c;if(!e.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)o=e.div(t).floor(),u=e.mod(t),a=l,l=p.minus(o.times(l)),p=a,a=m,m=h.minus(o.times(m)),h=a,e=t,t=u;return s=e.lt(c)?[e.neg(),p.neg(),h.neg()]:[e,e.isZero()?0:p,h],"Array"===r.matrix?s:n(s)}})})),To="invmod",_o=Ce(To,["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],(function(e){var t=e.typed,r=(e.config,e.BigNumber),n=e.xgcd,i=e.equal,a=e.smaller,o=e.mod,u=e.add,s=e.isInteger;return t(To,{"number, number":c,"BigNumber, BigNumber":c});function c(e,t){if(!s(e)||!s(t))throw new Error("Parameters in function invmod must be integer numbers");if(e=o(e,t),i(t,0))throw new Error("Divisor must be non zero");var c=n(e,t),f=Sa(c=c.valueOf(),2),l=f[0],p=f[1];return i(l,r(1))?(p=o(p,t),a(p,r(0))&&(p=u(p,t)),p):NaN}})),Bo=Ce("matAlgo09xS0Sf",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var a=e._values,o=e._index,u=e._ptr,s=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),f=n._values,l=n._index,p=n._ptr,m=n._size,h=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(s.length!==m.length)throw new sn(s.length,m.length);if(s[0]!==m[0]||s[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+m+")");var d,v=s[0],y=s[1],g=r,x=0,b=i;"string"==typeof c&&c===h&&"mixed"!==c&&(d=c,g=t.find(r,[d,d]),x=t.convert(0,d),b=t.find(i,[d,d]));var w,N,D,E,A,S=a&&f?[]:void 0,C=[],M=[],F=S?[]:void 0,O=[];for(N=0;N<y;N++){M[N]=C.length;var T=N+1;if(F)for(E=p[N],A=p[N+1],D=E;D<A;D++)O[w=l[D]]=T,F[w]=f[D];for(E=u[N],A=u[N+1],D=E;D<A;D++)if(w=o[D],F){var _=O[w]===T?F[w]:x,B=b(a[D],_);g(B,x)||(C.push(w),S.push(B))}else C.push(w)}return M[y]=C.length,e.createSparseMatrix({values:S,index:C,ptr:M,size:[v,y],datatype:c===e._datatype&&h===n._datatype?d:void 0})}})),ko="dotMultiply",Io=Ce(ko,["typed","matrix","equalScalar","multiplyScalar","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.multiplyScalar,a=e.concat,o=Wa({typed:t,equalScalar:n}),u=Bo({typed:t,equalScalar:n}),s=Ca({typed:t,equalScalar:n}),c=Ka({typed:t,matrix:r,concat:a});return t(ko,c({elop:i,SS:u,DS:o,Ss:s}))}));function zo(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return jo(e,t,(function(e,t){return e&t}))}function Ro(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,r=t.precision;t.config({precision:1e9});var n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function qo(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:e.isFinite()&&t.isFinite()?jo(e,t,(function(e,t){return e|t})):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}function jo(e,t,r){var n,i,a,o,u,s=e.constructor,c=+(e.s<0),f=+(t.s<0);if(c){n=Po(Ro(e));for(var l=0;l<n.length;++l)n[l]^=1}else n=Po(e);if(f){i=Po(Ro(t));for(var p=0;p<i.length;++p)i[p]^=1}else i=Po(t);n.length<=i.length?(a=n,o=i,u=c):(a=i,o=n,u=f);var m=a.length,h=o.length,d=1^r(c,f),v=new s(1^d),y=new s(1),g=new s(2),x=s.precision;for(s.config({precision:1e9});m>0;)r(a[--m],o[--h])===d&&(v=v.plus(y)),y=y.times(g);for(;h>0;)r(u,o[--h])===d&&(v=v.plus(y)),y=y.times(g);return s.config({precision:x}),0===d&&(v.s=-v.s),v}function Po(e){for(var t=e.d,r=t[0]+"",n=1;n<t.length;++n){for(var i=t[n]+"",a=7-i.length;a--;)i="0"+i;r+=i}for(var o=r.length;"0"===r.charAt(o);)o--;var u=e.e,s=r.slice(0,o+1||1),c=s.length;if(u>0)if(++u>c)for(u-=c;u--;)s+="0";else u<c&&(s=s.slice(0,u)+"."+s.slice(u));for(var f=[0],l=0;l<s.length;){for(var p=f.length;p--;)f[p]*=10;f[0]+=parseInt(s.charAt(l++));for(var m=0;m<f.length;++m)f[m]>1&&(null!==f[m+1]&&void 0!==f[m+1]||(f[m+1]=0),f[m+1]+=f[m]>>1,f[m]&=1)}return f.reverse()}function Lo(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?Ro(t):t.eq(n)?Ro(e):e.isFinite()&&t.isFinite()?jo(e,t,(function(e,t){return e^t})):e.isFinite()||t.isFinite()?new r(e.isNegative()===t.isNegative()?1/0:-1/0):n}function Uo(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t)):new r(NaN)}function $o(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}r(4490);var Ho="number, number";function Go(e,t){if(!V(e)||!V(t))throw new Error("Integers expected in function bitAnd");return e&t}function Vo(e){if(!V(e))throw new Error("Integer expected in function bitNot");return~e}function Zo(e,t){if(!V(e)||!V(t))throw new Error("Integers expected in function bitOr");return e|t}function Wo(e,t){if(!V(e)||!V(t))throw new Error("Integers expected in function bitXor");return e^t}function Yo(e,t){if(!V(e)||!V(t))throw new Error("Integers expected in function leftShift");return e<<t}function Jo(e,t){if(!V(e)||!V(t))throw new Error("Integers expected in function rightArithShift");return e>>t}function Xo(e,t){if(!V(e)||!V(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}Go.signature=Ho,Vo.signature="number",Zo.signature=Ho,Wo.signature=Ho,Yo.signature=Ho,Jo.signature=Ho,Xo.signature=Ho;var Qo="bitAnd",Ko=Ce(Qo,["typed","matrix","equalScalar","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.concat,a=Wa({typed:t,equalScalar:n}),o=fo({typed:t,equalScalar:n}),u=Ca({typed:t,equalScalar:n}),s=Ka({typed:t,matrix:r,concat:i});return t(Qo,{"number, number":Go,"BigNumber, BigNumber":zo},s({SS:o,DS:a,Ss:u}))})),eu="bitNot",tu=Ce(eu,["typed"],(function(e){var t=e.typed;return t(eu,{number:Vo,BigNumber:Ro,"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),ru="bitOr",nu=Ce(ru,["typed","matrix","equalScalar","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.DenseMatrix,a=e.concat,o=to({typed:t}),u=ro({typed:t,equalScalar:n}),s=no({typed:t,DenseMatrix:i}),c=Ka({typed:t,matrix:r,concat:a});return t(ru,{"number, number":Zo,"BigNumber, BigNumber":qo},c({SS:u,DS:o,Ss:s}))})),iu=Ce("matAlgo07xSSf",["typed","DenseMatrix"],(function(e){var t=e.typed,r=e.DenseMatrix;return function(e,i,a){var o=e._size,u=e._datatype||void 0===e._data?e._datatype:e.getDataType(),s=i._size,c=i._datatype||void 0===i._data?i._datatype:i.getDataType();if(o.length!==s.length)throw new sn(o.length,s.length);if(o[0]!==s[0]||o[1]!==s[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+s+")");var f,l,p,m=o[0],h=o[1],d=0,v=a;"string"==typeof u&&u===c&&"mixed"!==u&&(f=u,d=t.convert(0,f),v=t.find(a,[f,f]));var y=[];for(l=0;l<m;l++)y[l]=[];var g=[],x=[],b=[],w=[];for(p=0;p<h;p++){var N=p+1;for(n(e,p,b,g,N),n(i,p,w,x,N),l=0;l<m;l++){var D=b[l]===N?g[l]:d,E=w[l]===N?x[l]:d;y[l][p]=v(D,E)}}return new r({data:y,size:[m,h],datatype:u===e._datatype&&c===i._datatype?f:void 0})};function n(e,t,r,n,i){for(var a=e._values,o=e._index,u=e._ptr,s=u[t],c=u[t+1];s<c;s++){var f=o[s];r[f]=i,n[f]=a[s]}}})),au="bitXor",ou=Ce(au,["typed","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.DenseMatrix,i=e.concat,a=Ya({typed:t}),o=iu({typed:t,DenseMatrix:n}),u=Ma({typed:t,DenseMatrix:n}),s=Ka({typed:t,matrix:r,concat:i});return t(au,{"number, number":Wo,"BigNumber, BigNumber":Lo},s({SS:o,DS:a,Ss:u}))})),uu=Ce("arg",["typed"],(function(e){var t=e.typed;return t("arg",{number:function(e){return Math.atan2(0,e)},BigNumber:function(e){return e.constructor.atan2(0,e)},Complex:function(e){return e.arg()},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),su="conj",cu=Ce(su,["typed"],(function(e){var t=e.typed;return t(su,{"number | BigNumber | Fraction":function(e){return e},Complex:function(e){return e.conjugate()},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),fu=Ce("im",["typed"],(function(e){var t=e.typed;return t("im",{number:function(){return 0},"BigNumber | Fraction":function(e){return e.mul(0)},Complex:function(e){return e.im},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),lu=Ce("re",["typed"],(function(e){var t=e.typed;return t("re",{"number | BigNumber | Fraction":function(e){return e},Complex:function(e){return e.re},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),pu="number, number";function mu(e){return!e}function hu(e,t){return!(!e&&!t)}function du(e,t){return!!e!=!!t}function vu(e,t){return!(!e||!t)}mu.signature="number",hu.signature=pu,du.signature=pu,vu.signature=pu;var yu=Ce("not",["typed"],(function(e){var t=e.typed;return t("not",{"null | undefined":function(){return!0},number:mu,Complex:function(e){return 0===e.re&&0===e.im},BigNumber:function(e){return e.isZero()||e.isNaN()},Unit:t.referToSelf((function(e){return function(r){return t.find(e,r.valueType())(r.value)}})),"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),gu=Ce("or",["typed","matrix","equalScalar","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.DenseMatrix,a=e.concat,o=Ya({typed:t}),u=Ja({typed:t,equalScalar:n}),s=Ma({typed:t,DenseMatrix:i}),c=Ka({typed:t,matrix:r,concat:a});return t("or",{"number, number":hu,"Complex, Complex":function(e,t){return 0!==e.re||0!==e.im||0!==t.re||0!==t.im},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},"Unit, Unit":t.referToSelf((function(e){return function(t,r){return e(t.value||0,r.value||0)}}))},c({SS:u,DS:o,Ss:s}))})),xu=Ce("xor",["typed","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.DenseMatrix,i=e.concat,a=Ya({typed:t}),o=iu({typed:t,DenseMatrix:n}),u=Ma({typed:t,DenseMatrix:n}),s=Ka({typed:t,matrix:r,concat:i});return t("xor",{"number, number":du,"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":t.referToSelf((function(e){return function(t,r){return e(t.value||0,r.value||0)}}))},s({SS:o,DS:a,Ss:u}))})),bu="concat",wu=Ce(bu,["typed","matrix","isInteger"],(function(e){var t=e.typed,r=e.matrix,n=e.isInteger;return t(bu,{"...Array | Matrix | number | BigNumber":function(e){var t,o,u=e.length,s=-1,c=!1,f=[];for(t=0;t<u;t++){var p=e[t];if(l(p)&&(c=!0),i(p)||a(p)){if(t!==u-1)throw new Error("Dimension must be specified as last argument");if(o=s,s=p.valueOf(),!n(s))throw new TypeError("Integer number expected for dimension");if(s<0||t>0&&s>o)throw new cn(s,o+1)}else{var m=ye(p).valueOf(),h=fn(m);if(f[t]=m,o=s,s=h.length-1,t>0&&s!==o)throw new sn(o+1,s+1)}}if(0===f.length)throw new SyntaxError("At least one matrix expected");for(var d=f.shift();f.length;)d=zn(d,f.shift(),s);return c?r(d):d},"...string":function(e){return e.join("")}})})),Nu="column",Du=Ce(Nu,["typed","Index","matrix","range"],(function(e){var t=e.typed,r=e.Index,n=e.matrix,i=e.range;return t(Nu,{"Matrix, number":a,"Array, number":function(e,t){return a(n(ye(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");hn(t,e.size()[1]);var a=i(0,e.size()[0]),o=new r(a,t),u=e.subset(o);return l(u)?u:n([[u]])}})),Eu="count",Au=Ce(Eu,["typed","size","prod"],(function(e){var t=e.typed,r=e.size,n=e.prod;return t(Eu,{string:function(e){return e.length},"Matrix | Array":function(e){return n(r(e))}})})),Su="cross",Cu=Ce(Su,["typed","matrix","subtract","multiply"],(function(e){var t=e.typed,r=e.matrix,n=e.subtract,i=e.multiply;return t(Su,{"Matrix, Matrix":function(e,t){return r(a(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(a(e.toArray(),t))},"Array, Matrix":function(e,t){return r(a(e,t.toArray()))},"Array, Array":a});function a(e,t){var r=Math.max(fn(e).length,fn(t).length);e=wn(e),t=wn(t);var a=fn(e),o=fn(t);if(1!==a.length||1!==o.length||3!==a[0]||3!==o[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+a.join(", ")+"], B = ["+o.join(", ")+"])");var u=[n(i(e[1],t[2]),i(e[2],t[1])),n(i(e[2],t[0]),i(e[0],t[2])),n(i(e[0],t[1]),i(e[1],t[0]))];return r>1?[u]:u}})),Mu="diag",Fu=Ce(Mu,["typed","matrix","DenseMatrix","SparseMatrix"],(function(e){var t=e.typed,r=e.matrix,n=e.DenseMatrix,i=e.SparseMatrix;return t(Mu,{Array:function(e){return a(e,0,fn(e),null)},"Array, number":function(e,t){return a(e,t,fn(e),null)},"Array, BigNumber":function(e,t){return a(e,t.toNumber(),fn(e),null)},"Array, string":function(e,t){return a(e,0,fn(e),t)},"Array, number, string":function(e,t,r){return a(e,t,fn(e),r)},"Array, BigNumber, string":function(e,t,r){return a(e,t.toNumber(),fn(e),r)},Matrix:function(e){return a(e,0,e.size(),e.storage())},"Matrix, number":function(e,t){return a(e,t,e.size(),e.storage())},"Matrix, BigNumber":function(e,t){return a(e,t.toNumber(),e.size(),e.storage())},"Matrix, string":function(e,t){return a(e,0,e.size(),t)},"Matrix, number, string":function(e,t,r){return a(e,t,e.size(),r)},"Matrix, BigNumber, string":function(e,t,r){return a(e,t.toNumber(),e.size(),r)}});function a(e,t,a,o){if(!V(t))throw new TypeError("Second parameter in function diag must be an integer");var u=t>0?t:0,s=t<0?-t:0;switch(a.length){case 1:return function(e,t,r,a,o,u){var s=[a+o,a+u];if(r&&"sparse"!==r&&"dense"!==r)throw new TypeError("Unknown matrix type ".concat(r,'"'));var c="sparse"===r?i.diagonal(s,e,t):n.diagonal(s,e,t);return null!==r?c:c.valueOf()}(e,t,o,a[0],s,u);case 2:return function(e,t,n,i,a,o){if(l(e)){var u=e.diagonal(t);return null!==n?n!==u.storage()?r(u,n):u:u.valueOf()}for(var s=Math.min(i[0]-a,i[1]-o),c=[],f=0;f<s;f++)c[f]=e[f+a][f+o];return null!==n?r(c):c}(e,t,o,a,s,u)}throw new RangeError("Matrix for function diag must be 2 dimensional")}}));function Ou(e,t,r,n,i){if(G.isTypedFunction(e)){var a=[t,r,n],o=G.resolve(e,a);if(o)return l(o.implementation,a);var u=[t,r],s=G.resolve(e,u);if(s)return l(s.implementation,u);var c=[t],f=G.resolve(e,c);return f?l(f.implementation,c):l(e,a)}return e(t,r,n);function l(a,o){try{return a.apply(a,o)}catch(a){var u;if(a instanceof TypeError&&"wrongType"===(null===(u=a.data)||void 0===u?void 0:u.category)){var s=[];throw s.push("value: ".concat(H(t))),o.length>=2&&s.push("index: ".concat(H(r))),o.length>=3&&s.push("array: ".concat(H(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(s.join(", "),") at index ").concat(JSON.stringify(r)))}throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(a.message))}}}var Tu=Ce("filter",["typed"],(function(e){return(0,e.typed)("filter",{"Array, function":_u,"Matrix, function":function(e,t){return e.create(_u(e.toArray(),t))},"Array, RegExp":Fn,"Matrix, RegExp":function(e,t){return e.create(Fn(e.toArray(),t))}})}));function _u(e,t){return Mn(e,(function(e,r,n){return Ou(t,e,[r],n,"filter")}))}var Bu="flatten",ku=Ce(Bu,["typed","matrix"],(function(e){var t=e.typed,r=e.matrix;return t(Bu,{Array:function(e){return An(e)},Matrix:function(e){var t=An(e.toArray());return r(t)}})})),Iu="forEach",zu=Ce(Iu,["typed"],(function(e){return(0,e.typed)(Iu,{"Array, function":Ru,"Matrix, function":function(e,t){e.forEach(t)}})}));function Ru(e,t){!function r(n,i){if(!Array.isArray(n))return Ou(t,n,i,e,"forEach");Cn(n,(function(e,t){r(e,i.concat(t))}))}(e,[])}var qu="getMatrixDataType",ju=Ce(qu,["typed"],(function(e){return(0,e.typed)(qu,{Array:function(e){return Bn(e,H)},Matrix:function(e){return e.getDataType()}})})),Pu="identity",Lu=Ce(Pu,["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.BigNumber,o=e.DenseMatrix,u=e.SparseMatrix;return t(Pu,{"":function(){return"Matrix"===r.matrix?n([]):[]},string:function(e){return n(e)},"number | BigNumber":function(e){return c(e,e,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, string":function(e,t){return c(e,e,t)},"number | BigNumber, number | BigNumber":function(e,t){return c(e,t,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(e,t,r){return c(e,t,r)},Array:function(e){return s(e)},"Array, string":function(e,t){return s(e,t)},Matrix:function(e){return s(e.valueOf(),e.storage())},"Matrix, string":function(e,t){return s(e.valueOf(),t)}});function s(e,t){switch(e.length){case 0:return t?n(t):[];case 1:return c(e[0],e[0],t);case 2:return c(e[0],e[1],t);default:throw new Error("Vector containing two values expected")}}function c(e,t,r){var n=a(e)||a(t)?i:null;if(a(e)&&(e=e.toNumber()),a(t)&&(t=t.toNumber()),!V(e)||e<1)throw new Error("Parameters in function identity must be positive integers");if(!V(t)||t<1)throw new Error("Parameters in function identity must be positive integers");var s=n?new i(1):1,c=n?new n(0):0,f=[e,t];if(r){if("sparse"===r)return u.diagonal(f,s,0,c);if("dense"===r)return o.diagonal(f,s,0,c);throw new TypeError('Unknown matrix type "'.concat(r,'"'))}for(var l=vn([],f,c),p=e<t?e:t,m=0;m<p;m++)l[m][m]=s;return l}})),Uu="kron",$u=Ce(Uu,["typed","matrix","multiplyScalar"],(function(e){var t=e.typed,r=e.matrix,n=e.multiplyScalar;return t(Uu,{"Matrix, Matrix":function(e,t){return r(i(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(i(e.toArray(),t))},"Array, Matrix":function(e,t){return r(i(e,t.toArray()))},"Array, Array":i});function i(e,t){if(1===fn(e).length&&(e=[e]),1===fn(t).length&&(t=[t]),fn(e).length>2||fn(t).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(e.length)+", y = "+JSON.stringify(t.length)+")");var r=[],i=[];return e.map((function(e){return t.map((function(t){return i=[],r.push(i),e.map((function(e){return t.map((function(t){return i.push(n(e,t))}))}))}))}))&&r}})),Hu=Ce("map",["typed"],(function(e){return(0,e.typed)("map",{"Array, function":Gu,"Matrix, function":function(e,t){return e.map(t)}})}));function Gu(e,t){return function r(n,i){return Array.isArray(n)?n.map((function(e,t){return r(e,i.concat(t))})):Ou(t,n,i,e,"map")}(e,[])}var Vu="diff",Zu=Ce(Vu,["typed","matrix","subtract","number"],(function(e){var t=e.typed,r=e.matrix,n=e.subtract,i=e.number;return t(Vu,{"Array | Matrix":function(e){return l(e)?r(o(e.toArray())):o(e)},"Array | Matrix, number":function(e,t){if(!V(t))throw new RangeError("Dimension must be a whole number");return l(e)?r(a(e.toArray(),t)):a(e,t)},"Array, BigNumber":t.referTo("Array,number",(function(e){return function(t,r){return e(t,i(r))}})),"Matrix, BigNumber":t.referTo("Matrix,number",(function(e){return function(t,r){return e(t,i(r))}}))});function a(e,t){if(l(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError("Array/Matrix does not have that many dimensions");if(t>0){var r=[];return e.forEach((function(e){r.push(a(e,t-1))})),r}if(0===t)return o(e);throw RangeError("Cannot have negative dimension")}function o(e){for(var t=[],r=e.length,n=1;n<r;n++)t.push(u(e[n-1],e[n]));return t}function u(e,t){l(e)&&(e=e.toArray()),l(t)&&(t=t.toArray());var r=Array.isArray(e),i=Array.isArray(t);if(r&&i)return function(e,t){if(e.length!==t.length)throw RangeError("Not all sub-arrays have the same length");for(var r=[],n=e.length,i=0;i<n;i++)r.push(u(e[i],t[i]));return r}(e,t);if(!r&&!i)return n(t,e);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}})),Wu=Ce("ones",["typed","config","matrix","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.BigNumber;return t("ones",{"":function(){return"Array"===r.matrix?o([]):o([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return o(e,t)}return"Array"===r.matrix?o(e):o(e,"default")},Array:o,Matrix:function(e){var t=e.storage();return o(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return o(e.valueOf(),t)}});function o(e,t){var r=function(e){var t=!1;return e.forEach((function(e,r,n){a(e)&&(t=!0,n[r]=e.toNumber())})),t}(e),o=r?new i(1):1;if(function(e){e.forEach((function(e){if("number"!=typeof e||!V(e)||e<0)throw new Error("Parameters in function ones must be positive integers")}))}(e),t){var u=n(t);return e.length>0?u.resize(e,o):u}var s=[];return e.length>0?vn(s,e,o):s}}));function Yu(){throw new Error('No "bignumber" implementation available')}function Ju(){throw new Error('No "fraction" implementation available')}function Xu(){throw new Error('No "matrix" implementation available')}var Qu="range",Ku=Ce(Qu,["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.bignumber,a=e.smaller,o=e.smallerEq,u=e.larger,s=e.largerEq,c=e.add,f=e.isPositive;return t(Qu,{string:p,"string, boolean":p,"number, number":function(e,t){return l(m(e,t,1,!1))},"number, number, number":function(e,t,r){return l(m(e,t,r,!1))},"number, number, boolean":function(e,t,r){return l(m(e,t,1,r))},"number, number, number, boolean":function(e,t,r,n){return l(m(e,t,r,n))},"BigNumber, BigNumber":function(e,t){return l(m(e,t,new(0,e.constructor)(1),!1))},"BigNumber, BigNumber, BigNumber":function(e,t,r){return l(m(e,t,r,!1))},"BigNumber, BigNumber, boolean":function(e,t,r){return l(m(e,t,new(0,e.constructor)(1),r))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,r,n){return l(m(e,t,r,n))},"Unit, Unit, Unit":function(e,t,r){return l(m(e,t,r,!1))},"Unit, Unit, Unit, boolean":function(e,t,r,n){return l(m(e,t,r,n))}});function l(e){return"Matrix"===r.matrix?n?n(e):Xu():e}function p(e,t){var n=function(e){var t=e.split(":").map((function(e){return Number(e)}));if(t.some((function(e){return isNaN(e)})))return null;switch(t.length){case 2:return{start:t[0],end:t[1],step:1};case 3:return{start:t[0],end:t[2],step:t[1]};default:return null}}(e);if(!n)throw new SyntaxError('String "'+e+'" is no valid range');return"BigNumber"===r.number?(void 0===i&&Yu(),l(m(i(n.start),i(n.end),i(n.step)))):l(m(n.start,n.end,n.step,t))}function m(e,t,r,n){for(var i=[],l=f(r)?n?o:a:n?s:u,p=e;l(p,t);)i.push(p),p=c(p,r);return i}})),es="reshape",ts=Ce(es,["typed","isInteger","matrix"],(function(e){var t=e.typed,r=e.isInteger;return t(es,{"Matrix, Array":function(e,t){return e.reshape(t,!0)},"Array, Array":function(e,t){return t.forEach((function(e){if(!r(e))throw new TypeError("Invalid size for dimension: "+e)})),gn(e,t)}})})),rs=Ce("resize",["config","matrix"],(function(e){var t=e.config,r=e.matrix;return function(e,n,i){if(2!==arguments.length&&3!==arguments.length)throw new io("resize",arguments.length,2,3);if(l(n)&&(n=n.valueOf()),a(n[0])&&(n=n.map((function(e){return a(e)?e.toNumber():e}))),l(e))return e.resize(n,i,!0);if("string"==typeof e)return function(e,t,r){if(void 0!==r){if("string"!=typeof r||1!==r.length)throw new TypeError("Single character expected as defaultValue")}else r=" ";if(1!==t.length)throw new sn(t.length,1);var n=t[0];if("number"!=typeof n||!V(n))throw new TypeError("Invalid size, must contain positive integers (size: "+tn(t)+")");if(e.length>n)return e.substring(0,n);if(e.length<n){for(var i=e,a=0,o=n-e.length;a<o;a++)i+=r;return i}return e}(e,n,i);var o=!Array.isArray(e)&&"Array"!==t.matrix;if(0===n.length){for(;Array.isArray(e);)e=e[0];return ye(e)}Array.isArray(e)||(e=[e]);var u=vn(e=ye(e),n,i);return o?r(u):u}})),ns="rotate",is=Ce(ns,["typed","multiply","rotationMatrix"],(function(e){var t=e.typed,r=e.multiply,n=e.rotationMatrix;return t(ns,{"Array , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),r(n(t),e).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),r(n(t),e)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return i(e,3),r(n(t,a),e)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return i(e,3),r(n(t,a),e)}});function i(e,t){var r=Array.isArray(e)?fn(e):e.size();if(r.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(t));if(2===r.length&&1!==r[1])throw new RangeError("Vector must be of dimensions 1x".concat(t));if(r[0]!==t)throw new RangeError("Vector must be of dimensions 1x".concat(t))}})),as="rotationMatrix",os=Ce(as,["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],(function(e){var t=e.typed,r=e.config,n=e.multiplyScalar,i=e.addScalar,o=e.unaryMinus,u=e.norm,s=e.BigNumber,c=e.matrix,f=e.DenseMatrix,l=e.SparseMatrix,p=e.cos,m=e.sin;return t(as,{"":function(){return"Matrix"===r.matrix?c([]):[]},string:function(e){return c(e)},"number | BigNumber | Complex | Unit":function(e){return h(e,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(e,t){return h(e,t)},"number | BigNumber | Complex | Unit, Array":function(e,t){var r=c(t);return d(r),g(e,r,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e,t){d(t);var n=t.storage()||("Matrix"===r.matrix?"dense":void 0);return g(e,t,n)},"number | BigNumber | Complex | Unit, Array, string":function(e,t,r){var n=c(t);return d(n),g(e,n,r)},"number | BigNumber | Complex | Unit, Matrix, string":function(e,t,r){return d(t),g(e,t,r)}});function h(e,t){var r=a(e)?new s(-1):-1,i=p(e),o=m(e);return y([[i,n(r,o)],[o,i]],t)}function d(e){var t=e.size();if(t.length<1||3!==t[0])throw new RangeError("Vector must be of dimensions 1x3")}function v(e){return e.reduce((function(e,t){return n(e,t)}))}function y(e,t){if(t){if("sparse"===t)return new l(e);if("dense"===t)return new f(e);throw new TypeError('Unknown matrix type "'.concat(t,'"'))}return e}function g(e,t,r){var n=u(t);if(0===n)throw new RangeError("Rotation around zero vector");var c=a(e)?s:null,f=c?new c(1):1,l=c?new c(-1):-1,h=c?new c(t.get([0])/n):t.get([0])/n,d=c?new c(t.get([1])/n):t.get([1])/n,g=c?new c(t.get([2])/n):t.get([2])/n,x=p(e),b=i(f,o(x)),w=m(e);return y([[i(x,v([h,h,b])),i(v([h,d,b]),v([l,g,w])),i(v([h,g,b]),v([d,w]))],[i(v([h,d,b]),v([g,w])),i(x,v([d,d,b])),i(v([d,g,b]),v([l,h,w]))],[i(v([h,g,b]),v([l,d,w])),i(v([d,g,b]),v([h,w])),i(x,v([g,g,b]))]],r)}})),us=Ce("row",["typed","Index","matrix","range"],(function(e){var t=e.typed,r=e.Index,n=e.matrix,i=e.range;return t("row",{"Matrix, number":a,"Array, number":function(e,t){return a(n(ye(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");hn(t,e.size()[0]);var a=i(0,e.size()[1]),o=new r(t,a),u=e.subset(o);return l(u)?u:n([[u]])}})),ss="size",cs=Ce(ss,["typed","config","?matrix"],(function(e){var t=e.typed,r=e.config,n=e.matrix;return t(ss,{Matrix:function(e){return e.create(e.size())},Array:fn,string:function(e){return"Array"===r.matrix?[e.length]:n([e.length])},"number | Complex | BigNumber | Unit | boolean | null":function(e){return"Array"===r.matrix?[]:n?n([]):Xu()}})})),fs="squeeze",ls=Ce(fs,["typed","matrix"],(function(e){var t=e.typed,r=e.matrix;return t(fs,{Array:function(e){return wn(ye(e))},Matrix:function(e){var t=wn(e.toArray());return Array.isArray(t)?r(t):t},any:function(e){return ye(e)}})})),ps="subset",ms=Ce(ps,["typed","matrix","zeros","add"],(function(e){var t=e.typed,r=e.matrix,n=e.zeros,i=e.add;return t(ps,{"Matrix, Index":function(e,t){return dn(t)?r():(mn(e,t),e.subset(t))},"Array, Index":t.referTo("Matrix, Index",(function(e){return function(t,n){var i=e(r(t),n);return n.isScalar()?i:i.valueOf()}})),"Object, Index":vs,"string, Index":hs,"Matrix, Index, any, any":function(e,t,r,a){return dn(t)?e:(mn(e,t),e.clone().subset(t,function(e,t){if("string"==typeof e)throw new Error("can't boradcast a string");if(t._isScalar)return e;var r=t.size();if(!r.every((function(e){return e>0})))return e;try{return i(e,n(r))}catch(t){return e}}(r,t),a))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,n,i,a){var o=e(r(t),n,i,a);return o.isMatrix?o.valueOf():o}})),"Array, Index, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,n,i){return e(r(t),n,i,void 0).valueOf()}})),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,r,n){return e(t,r,n,void 0)}})),"string, Index, string":ds,"string, Index, string, string":ds,"Object, Index, any":ys})}));function hs(e,t){if(!v(t))throw new TypeError("Index expected");if(dn(t))return"";if(mn(Array.from(e),t),1!==t.size().length)throw new sn(t.size().length,1);var r=e.length;hn(t.min()[0],r),hn(t.max()[0],r);var n=t.dimension(0),i="";return n.forEach((function(t){i+=e.charAt(t)})),i}function ds(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Index expected");if(dn(t))return e;if(mn(Array.from(e),t),1!==t.size().length)throw new sn(t.size().length,1);if(void 0!==n){if("string"!=typeof n||1!==n.length)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=t.dimension(0);if(i.size()[0]!==r.length)throw new sn(i.size()[0],r.length);var a=e.length;hn(t.min()[0]),hn(t.max()[0]);for(var o=[],u=0;u<a;u++)o[u]=e.charAt(u);if(i.forEach((function(e,t){o[e]=r.charAt(t[0])})),o.length>a)for(var s=a-1,c=o.length;s<c;s++)o[s]||(o[s]=n);return o.join("")}function vs(e,t){if(!dn(t)){if(1!==t.size().length)throw new sn(t.size(),1);var r=t.dimension(0);if("string"!=typeof r)throw new TypeError("String expected as index to retrieve an object property");return Re(e,r)}}function ys(e,t,r){if(dn(t))return e;if(1!==t.size().length)throw new sn(t.size(),1);var n=t.dimension(0);if("string"!=typeof n)throw new TypeError("String expected as index to retrieve an object property");var i=ye(e);return qe(i,n,r),i}var gs="transpose",xs=Ce(gs,["typed","matrix"],(function(e){var t=e.typed,r=e.matrix;return t(gs,{Array:function(e){return n(r(e)).valueOf()},Matrix:n,any:ye});function n(e){var t,r=e.size();switch(r.length){case 1:t=e.clone();break;case 2:var n=r[0],i=r[1];if(0===i)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+tn(r)+")");switch(e.storage()){case"dense":t=function(e,t,r){for(var n,i=e._data,a=[],o=0;o<r;o++){n=a[o]=[];for(var u=0;u<t;u++)n[u]=ye(i[u][o])}return e.createDenseMatrix({data:a,size:[r,t],datatype:e._datatype})}(e,n,i);break;case"sparse":t=function(e,t,r){for(var n,i,a,o=e._values,u=e._index,s=e._ptr,c=o?[]:void 0,f=[],l=[],p=[],m=0;m<t;m++)p[m]=0;for(n=0,i=u.length;n<i;n++)p[u[n]]++;for(var h=0,d=0;d<t;d++)l.push(h),h+=p[d],p[d]=l[d];for(l.push(h),a=0;a<r;a++)for(var v=s[a],y=s[a+1],g=v;g<y;g++){var x=p[u[g]]++;f[x]=a,o&&(c[x]=ye(o[g]))}return e.createSparseMatrix({values:c,index:f,ptr:l,size:[r,t],datatype:e._datatype})}(e,n,i)}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+tn(r)+")")}return t}})),bs="ctranspose",ws=Ce(bs,["typed","transpose","conj"],(function(e){var t=e.typed,r=e.transpose,n=e.conj;return t(bs,{any:function(e){return n(r(e))}})})),Ns="zeros",Ds=Ce(Ns,["typed","config","matrix","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.BigNumber;return t(Ns,{"":function(){return"Array"===r.matrix?o([]):o([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return o(e,t)}return"Array"===r.matrix?o(e):o(e,"default")},Array:o,Matrix:function(e){var t=e.storage();return o(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return o(e.valueOf(),t)}});function o(e,t){var r=function(e){var t=!1;return e.forEach((function(e,r,n){a(e)&&(t=!0,n[r]=e.toNumber())})),t}(e),o=r?new i(0):0;if(function(e){e.forEach((function(e){if("number"!=typeof e||!V(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")}))}(e),t){var u=n(t);return e.length>0?u.resize(e,o):u}var s=[];return e.length>0?vn(s,e,o):s}})),Es=Ce("fft",["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],(function(e){var t=e.typed,r=(e.matrix,e.addScalar),n=e.multiplyScalar,i=e.divideScalar,a=e.exp,o=e.tau,u=e.i,s=e.dotDivide,c=e.conj,f=e.pow,l=e.ceil,p=e.log2;return t("fft",{Array:m,Matrix:function(e){return e.create(m(e.toArray()))}});function m(e){var t=fn(e);return 1===t.length?d(e,t[0]):h(e.map((function(e){return m(e,t.slice(1))})),0)}function h(e,t){var r=fn(e);if(0!==t)return new Array(r[0]).fill(0).map((function(r,n){return h(e[n],t-1)}));if(1===r.length)return d(e);function n(e){var t=fn(e);return new Array(t[1]).fill(0).map((function(r,n){return new Array(t[0]).fill(0).map((function(t,r){return e[r][n]}))}))}return n(h(n(e),1))}function d(e){var t=e.length;if(1===t)return[e[0]];if(t%2==0){for(var h=[].concat(_e(d(e.filter((function(e,t){return t%2==0})))),_e(d(e.filter((function(e,t){return t%2==1}))))),v=0;v<t/2;v++){var y=h[v],g=n(h[v+t/2],a(n(n(o,u),i(-v,t))));h[v]=r(y,g),h[v+t/2]=r(y,n(-1,g))}return h}return function(e){for(var t=e.length,r=a(i(n(-1,n(u,o)),t)),h=[],v=1-t;v<t;v++)h.push(f(r,i(f(v,2),2)));for(var y=f(2,l(p(t+t-1))),g=[].concat(_e(new Array(t).fill(0).map((function(r,i){return n(e[i],h[t-1+i])}))),_e(new Array(y-t).fill(0))),x=[].concat(_e(new Array(t+t-1).fill(0).map((function(e,t){return i(1,h[t])}))),_e(new Array(y-(t+t-1)).fill(0))),b=d(g),w=d(x),N=new Array(y).fill(0).map((function(e,t){return n(b[t],w[t])})),D=s(c(m(c(N))),y),E=[],A=t-1;A<t+t-1;A++)E.push(n(D[A],h[A]));return E}(e)}})),As="ifft",Ss=Ce(As,["typed","fft","dotDivide","conj"],(function(e){var t=e.typed,r=e.fft,n=e.dotDivide,i=e.conj;return t(As,{"Array | Matrix":function(e){var t=l(e)?e.size():fn(e);return n(i(r(i(e))),t.reduce((function(e,t){return e*t}),1))}})}));function Cs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}r(7945),r(3851),r(1278);var Ms=Ce("solveODE",["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],(function(e){var t=e.typed,r=e.add,n=e.subtract,o=e.multiply,u=e.divide,c=e.max,f=e.map,l=e.abs,p=e.isPositive,m=e.isNegative,h=e.larger,d=e.smaller,v=e.matrix,y=e.bignumber,g=e.unaryMinus;function x(e){return function(t,i,v,x){if(2!==i.length||!i.every(D)&&!i.every(s))throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var b=i[0],w=i[1],N=h(w,b),E=x.firstStep;if(void 0!==E&&!p(E))throw new Error('"firstStep" must be positive');var A=x.maxStep;if(void 0!==A&&!p(A))throw new Error('"maxStep" must be positive');var S=x.minStep;if(S&&m(S))throw new Error('"minStep" must be positive or zero');var C=[b,w,E,S,A].filter((function(e){return void 0!==e}));if(!C.every(D)&&!C.every(s))throw new Error('Inconsistent type of "t" dependant variables');for(var M=x.tol?x.tol:1e-4,F=x.minDelta?x.minDelta:.2,O=x.maxDelta?x.maxDelta:5,T=x.maxIter?x.maxIter:1e4,_=[b,w].concat(_e(v),[A,S]).some(a),B=Sa(_?[y(e.a),y(e.c),y(e.b),y(e.bp)]:[e.a,e.c,e.b,e.bp],4),k=B[0],I=B[1],z=B[2],R=B[3],q=E?N?E:g(E):u(n(w,b),1),j=[b],P=[v],L=n(z,R),U=0,$=0,H=function(e){return e?d:h}(N),G=function(e){var t=e?h:d;return function(e,i,a){var o=r(e,a);return t(o,i)?n(i,e):a}}(N);H(j[U],w);){var V=[];q=G(j[U],w,q),V.push(t(j[U],P[U]));for(var Z=1;Z<I.length;++Z)V.push(t(r(j[U],o(I[Z],q)),r(P[U],o(q,k[Z],V))));var W=c(l(f(o(L,V),(function(e){return s(e)?e.value:e}))));W<M&&M/W>1/4&&(j.push(r(j[U],q)),P.push(r(P[U],o(q,z,V))),U++);var Y=.84*Math.pow(M/W,.2);if(d(Y,F)?Y=F:h(Y,O)&&(Y=O),Y=_?y(Y):Y,q=o(q,Y),A&&h(l(q),A)?q=N?A:g(A):S&&d(l(q),S)&&(q=N?S:g(S)),++$>T)throw new Error("Maximum number of iterations reached, try changing options")}return{t:j,y:P}}}function b(e,t,r,n){return x({a:[[],[.5],[0,3/4],[2/9,1/3,4/9]],c:[null,.5,3/4,1],b:[2/9,1/3,4/9,0],bp:[7/24,1/4,1/3,1/8]})(e,t,r,n)}function w(e,t,r,n){return x({a:[[],[.2],[3/40,9/40],[44/45,-56/15,32/9],[19372/6561,-25360/2187,64448/6561,-212/729],[9017/3168,-355/33,46732/5247,49/176,-5103/18656],[35/384,0,500/1113,125/192,-2187/6784,11/84]],c:[null,.2,.3,.8,8/9,1,1],b:[35/384,0,500/1113,125/192,-2187/6784,11/84,0],bp:[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40]})(e,t,r,n)}function N(e,t,r,n){var i=n.method?n.method:"RK45",a={RK23:b,RK45:w};if(i.toUpperCase()in a){var o=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cs(Object(r),!0).forEach((function(t){Za(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},n);return delete o.method,a[i.toUpperCase()](e,t,r,o)}var u=Object.keys(a).map((function(e){return'"'.concat(e,'"')})),s="".concat(u.slice(0,-1).join(", ")," and ").concat(u.slice(-1));throw new Error('Unavailable method "'.concat(i,'". Available methods are ').concat(s))}function D(e){return a(e)||i(e)}function E(e,t,r,n){var i=N(e,t.toArray(),r.toArray(),n);return{t:v(i.t),y:v(i.y)}}return t("solveODE",{"function, Array, Array, Object":N,"function, Matrix, Matrix, Object":E,"function, Array, Array":function(e,t,r){return N(e,t,r,{})},"function, Matrix, Matrix":function(e,t,r){return E(e,t,r,{})},"function, Array, number | BigNumber | Unit":function(e,t,r){var n=N(e,t,[r],{});return{t:n.t,y:n.y.map((function(e){return e[0]}))}},"function, Matrix, number | BigNumber | Unit":function(e,t,r){var n=N(e,t.toArray(),[r],{});return{t:v(n.t),y:v(n.y.map((function(e){return e[0]})))}},"function, Array, number | BigNumber | Unit, Object":function(e,t,r,n){var i=N(e,t,[r],n);return{t:i.t,y:i.y.map((function(e){return e[0]}))}},"function, Matrix, number | BigNumber | Unit, Object":function(e,t,r,n){var i=N(e,t.toArray(),[r],n);return{t:v(i.t),y:v(i.y.map((function(e){return e[0]})))}}})})),Fs=Ce("erf",["typed"],(function(e){var t=e.typed;return t("name",{number:function(e){var t=Math.abs(e);return t>=ks?Z(e):t<=Os?Z(e)*function(e){var t,r=e*e,n=_s[0][4]*r,i=r;for(t=0;t<3;t+=1)n=(n+_s[0][t])*r,i=(i+Bs[0][t])*r;return e*(n+_s[0][3])/(i+Bs[0][3])}(t):t<=4?Z(e)*(1-function(e){var t,r=_s[1][8]*e,n=e;for(t=0;t<7;t+=1)r=(r+_s[1][t])*e,n=(n+Bs[1][t])*e;var i=(r+_s[1][7])/(n+Bs[1][7]),a=parseInt(16*e)/16,o=(e-a)*(e+a);return Math.exp(-a*a)*Math.exp(-o)*i}(t)):Z(e)*(1-function(e){var t,r=1/(e*e),n=_s[2][5]*r,i=r;for(t=0;t<4;t+=1)n=(n+_s[2][t])*r,i=(i+Bs[2][t])*r;var a=r*(n+_s[2][4])/(i+Bs[2][4]);a=(Ts-a)/e;var o=(e-(r=parseInt(16*e)/16))*(e+r);return Math.exp(-r*r)*Math.exp(-o)*a}(t))},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),Os=.46875,Ts=.5641895835477563,_s=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],Bs=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],ks=Math.pow(2,53),Is="zeta",zs=Ce(Is,["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],(function(e){var t=e.typed,r=e.config,n=e.multiply,i=e.pow,a=e.divide,o=e.factorial,u=e.equal,s=e.smallerEq,c=e.isNegative,f=e.gamma,l=e.sin,p=e.subtract,m=e.add,h=e.Complex,d=e.BigNumber,v=e.pi;return t(Is,{number:function(e){return y(e,(function(e){return e}),(function(){return 20}))},BigNumber:function(e){return y(e,(function(e){return new d(e)}),(function(){return Math.abs(Math.log10(r.epsilon))}))},Complex:function(e){return 0===e.re&&0===e.im?new h(-.5):1===e.re?new h(NaN,NaN):e.re===1/0&&0===e.im?new h(1):e.im===1/0||e.re===-1/0?new h(NaN,NaN):g(e,(function(e){return e}),(function(e){return Math.round(19.5+.9*Math.abs(e.im))}),(function(e){return e.re}))}});function y(e,t,r){return u(e,0)?t(-.5):u(e,1)?t(NaN):isFinite(e)?g(e,t,r,(function(e){return e})):c(e)?t(NaN):t(1)}function g(e,t,r,o){var u=r(e);if(o(e)>-(u-1)/2)return function(e,t,r){for(var o=a(1,n(x(r(0),t),p(1,i(2,p(1,e))))),u=r(0),c=r(1);s(c,t);c=m(c,1))u=m(u,a(n(Math.pow(-1,c-1),x(c,t)),i(c,e)));return n(o,u)}(e,t(u),t);var c=n(i(2,e),i(t(v),p(e,1)));return c=n(c,l(n(a(t(v),2),e))),c=n(c,f(p(1,e))),n(c,g(p(1,e),t,r,o))}function x(e,t){for(var r=e,u=e;s(u,t);u=m(u,1)){var c=a(n(o(m(t,p(u,1))),i(4,u)),n(o(p(t,u)),o(n(2,u))));r=m(r,c)}return n(t,r)}})),Rs="mode",qs=Ce(Rs,["typed","isNaN","isNumeric"],(function(e){var t=e.typed,r=e.isNaN,n=e.isNumeric;return t(Rs,{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(0===(e=An(e.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");for(var t={},i=[],a=0,o=0;o<e.length;o++){var u=e[o];if(n(u)&&r(u))throw new Error("Cannot calculate mode of an array containing NaN values");u in t||(t[u]=0),t[u]++,t[u]===a?i.push(u):t[u]>a&&(a=t[u],i=[u])}return i}}));function js(e,t,r){var n;return-1!==String(e).indexOf("Unexpected type")?(n=arguments.length>2?" (type: "+H(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):-1!==String(e).indexOf("complex numbers")?(n=arguments.length>2?" (type: "+H(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var Ps="prod",Ls=Ce(Ps,["typed","config","multiplyScalar","numeric"],(function(e){var t=e.typed,r=e.config,n=e.multiplyScalar,i=e.numeric;return t(Ps,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("prod(A, dim) is not yet supported")},"...":function(e){return a(e)}});function a(e){var t;if(Wn(e,(function(e){try{t=void 0===t?e:n(t,e)}catch(t){throw js(t,"prod",e)}})),"string"==typeof t&&(t=i(t,r.number)),void 0===t)throw new Error("Cannot calculate prod of an empty array");return t}})),Us="format",$s=Ce(Us,["typed"],(function(e){return(0,e.typed)(Us,{any:tn,"any, Object | function | number | BigNumber":tn})})),Hs=Ce("bin",["typed","format"],(function(e){var t=e.typed,r=e.format;return t("bin",{"number | BigNumber":function(e){return r(e,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(e,t){return r(e,{notation:"bin",wordSize:t})}})})),Gs=Ce("oct",["typed","format"],(function(e){var t=e.typed,r=e.format;return t("oct",{"number | BigNumber":function(e){return r(e,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(e,t){return r(e,{notation:"oct",wordSize:t})}})})),Vs=Ce("hex",["typed","format"],(function(e){var t=e.typed,r=e.format;return t("hex",{"number | BigNumber":function(e){return r(e,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(e,t){return r(e,{notation:"hex",wordSize:t})}})})),Zs=/\$([\w.]+)/g,Ws="print",Ys=Ce(Ws,["typed"],(function(e){return(0,e.typed)(Ws,{"string, Object | Array":Js,"string, Object | Array, number | Object":Js})}));function Js(e,t,r){return e.replace(Zs,(function(e,n){var i=n.split("."),a=t[i.shift()];for(void 0!==a&&a.isMatrix&&(a=a.toArray());i.length&&void 0!==a;){var o=i.shift();a=o?a[o]:a+"."}return void 0!==a?c(a)?a:tn(a,r):e}))}var Xs=Ce("to",["typed","matrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.concat;return t("to",{"Unit, Unit | string":function(e,t){return e.to(t)}},Ka({typed:t,matrix:r,concat:n})({Ds:!0}))})),Qs="isPrime",Ks=Ce(Qs,["typed"],(function(e){var t=e.typed;return t(Qs,{number:function(e){if(0*e!=0)return!1;if(e<=3)return e>1;if(e%2==0||e%3==0)return!1;for(var t=5;t*t<=e;t+=6)if(e%t==0||e%(t+2)==0)return!1;return!0},BigNumber:function(e){if(0*e.toNumber()!=0)return!1;if(e.lte(3))return e.gt(1);if(e.mod(2).eq(0)||e.mod(3).eq(0))return!1;if(e.lt(Math.pow(2,32))){for(var t=e.toNumber(),r=5;r*r<=t;r+=6)if(t%r==0||t%(r+2)==0)return!1;return!0}function n(e,t,r){for(var n=1;!t.eq(0);)t.mod(2).eq(0)?(t=t.div(2),e=e.mul(e).mod(r)):(t=t.sub(1),n=e.mul(n).mod(r));return n}for(var i=e.constructor.clone({precision:2*e.toFixed(0).length}),a=0,o=(e=new i(e)).sub(1);o.mod(2).eq(0);)o=o.div(2),a+=1;var u=null;if(e.lt("3317044064679887385961981"))u=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter((function(t){return t<e}));else{var s=Math.min(e.toNumber()-2,Math.floor(2*Math.pow(e.toFixed(0).length*Math.log(10),2)));u=[];for(var c=2;c<=s;c+=1)u.push(s)}for(var f=0;f<u.length;f+=1){var l=u[f],p=n(e.sub(e).add(l),o,e);if(!p.eq(1))for(var m=0,h=p;!h.eq(e.sub(1));m+=1,h=h.mul(h).mod(e))if(m===a-1)return!1}return!0},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),ec=Ce("numeric",["number","?bignumber","?fraction"],(function(e){var t=e.number,r=e.bignumber,n=e.fraction,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:function(e){return t(e)},BigNumber:r?function(e){return r(e)}:Yu,Fraction:n?function(e){return n(e)}:Ju};return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number";if(void 0!==(arguments.length>2?arguments[2]:void 0))throw new SyntaxError("numeric() takes one or two arguments");var r=H(e);if(!(r in i))throw new TypeError("Cannot convert "+e+' of type "'+r+'"; valid input types are '+Object.keys(i).join(", "));if(!(t in a))throw new TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(a).join(", "));return t===r?e:a[t](e)}})),tc="divideScalar",rc=Ce(tc,["typed","numeric"],(function(e){var t=e.typed;return e.numeric,t(tc,{"number, number":function(e,t){return e/t},"Complex, Complex":function(e,t){return e.div(t)},"BigNumber, BigNumber":function(e,t){return e.div(t)},"Fraction, Fraction":function(e,t){return e.div(t)},"Unit, number | Complex | Fraction | BigNumber | Unit":function(e,t){return e.divide(t)},"number | Fraction | Complex | BigNumber, Unit":function(e,t){return t.divideInto(e)}})})),nc=Ce("pow",["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],(function(e){var t=e.typed,r=e.config,n=e.identity,i=e.multiply,a=e.matrix,o=e.inv,u=e.number,s=e.fraction,c=e.Complex;return t("pow",{"number, number":f,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||e>=0||r.predictable?e.pow(t):new c(e.toNumber(),0).pow(t.toNumber(),0)},"Fraction, Fraction":function(e,t){var n=e.pow(t);if(null!=n)return n;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return f(e.valueOf(),t.valueOf())},"Array, number":l,"Array, BigNumber":function(e,t){return l(e,t.toNumber())},"Matrix, number":p,"Matrix, BigNumber":function(e,t){return p(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function f(e,t){if(r.predictable&&!V(t)&&e<0)try{var n=s(t),i=u(n);if((t===i||Math.abs((t-i)/t)<1e-14)&&n.d%2==1)return(n.n%2==0?1:-1)*Math.pow(-e,t)}catch(e){}return r.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:V(t)||e>=0||r.predictable?fa(e,t):e*e<1&&t===1/0||e*e>1&&t===-1/0?0:new c(e,0).pow(t,0)}function l(e,t){if(!V(t))throw new TypeError("For A^b, b must be an integer (value is "+t+")");var r=fn(e);if(2!==r.length)throw new Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!==r[1])throw new Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");if(t<0)try{return l(o(e),-t)}catch(e){if("Cannot calculate inverse, determinant is zero"===e.message)throw new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+t+")");throw e}for(var a=n(r[0]).valueOf(),u=e;t>=1;)1==(1&t)&&(a=i(u,a)),t>>=1,u=i(u,u);return a}function p(e,t){return a(l(e.valueOf(),t))}})),ic="Number of decimals in function round must be an integer",ac="round",oc=Ce(ac,["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.equalScalar,a=e.zeros,o=e.BigNumber,u=e.DenseMatrix,s=Ca({typed:t,equalScalar:i}),c=Ma({typed:t,DenseMatrix:u}),f=Fa({typed:t});function l(e){return Math.abs(re(e).exponent)}return t(ac,{number:function(e){var t=la(e,l(r.epsilon));return la(se(e,t,r.epsilon)?t:e)},"number, number":function(e,t){var n=l(r.epsilon);if(t>=n)return la(e,t);var i=la(e,n);return la(se(e,i,r.epsilon)?i:e,t)},"number, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(ic);return new o(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw new TypeError(ic);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(ic);var r=t.toNumber();return e.round(r)},BigNumber:function(e){var t=new o(e).toDecimalPlaces(l(r.epsilon));return(bi(e,t,r.epsilon)?t:e).toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(ic);var n=l(r.epsilon);if(t>=n)return e.toDecimalPlaces(t.toNumber());var i=e.toDecimalPlaces(n);return(bi(e,i,r.epsilon)?i:e).toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw new TypeError(ic);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(ic);return e.round(t.toNumber())},"Unit, number, Unit":t.referToSelf((function(e){return function(t,r,n){var i=t.toNumeric(n);return n.multiply(e(i,r))}})),"Unit, BigNumber, Unit":t.referToSelf((function(e){return function(t,r,n){return e(t,r.toNumber(),n)}})),"Unit, Unit":t.referToSelf((function(e){return function(t,r){return e(t,0,r)}})),"Array | Matrix, number, Unit":t.referToSelf((function(e){return function(t,r,n){return Yn(t,(function(t){return e(t,r,n)}),!0)}})),"Array | Matrix, BigNumber, Unit":t.referToSelf((function(e){return function(t,r,n){return e(t,r.toNumber(),n)}})),"Array | Matrix, Unit":t.referToSelf((function(e){return function(t,r){return e(t,0,r)}})),"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e,!0)}})),"SparseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return s(t,r,e,!1)}})),"DenseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return f(t,r,e,!1)}})),"Array, number | BigNumber":t.referToSelf((function(e){return function(t,r){return f(n(t),r,e,!1).valueOf()}})),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf((function(e){return function(t,r){return i(t,0)?a(r.size(),r.storage()):c(r,t,e,!0)}})),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf((function(e){return function(t,r){return i(t,0)?a(r.size(),r.storage()):f(r,t,e,!0)}})),"number | Complex | BigNumber | Fraction, Array":t.referToSelf((function(e){return function(t,r){return f(n(r),t,e,!0).valueOf()}}))})})),uc=Ce("log",["config","typed","divideScalar","Complex"],(function(e){var t=e.typed,r=e.config,n=e.divideScalar,i=e.Complex;return t("log",{number:function(e){return e>=0||r.predictable?function(e,t){return Math.log(e)}(e):new i(e,0).log()},Complex:function(e){return e.log()},BigNumber:function(e){return!e.isNegative()||r.predictable?e.ln():new i(e.toNumber(),0).log()},"any, any":t.referToSelf((function(e){return function(t,r){return n(e(t),e(r))}}))})})),sc="log1p",cc=Ce(sc,["typed","config","divideScalar","log","Complex"],(function(e){var t=e.typed,r=e.config,n=e.divideScalar,i=e.log,a=e.Complex;return t(sc,{number:function(e){return e>=-1||r.predictable?J(e):o(new a(e,0))},Complex:o,BigNumber:function(e){var t=e.plus(1);return!t.isNegative()||r.predictable?t.ln():o(new a(e.toNumber(),0))},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}})),"any, any":t.referToSelf((function(e){return function(t,r){return n(e(t),i(r))}}))});function o(e){var t=e.re+1;return new a(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}})),fc="nthRoots",lc=Ce(fc,["config","typed","divideScalar","Complex"],(function(e){var t=e.typed,r=(e.config,e.divideScalar,e.Complex),n=[function(e){return new r(e,0)},function(e){return new r(0,e)},function(e){return new r(-e,0)},function(e){return new r(0,-e)}];function i(e,t){if(t<0)throw new Error("Root must be greater than zero");if(0===t)throw new Error("Root must be non-zero");if(t%1!=0)throw new Error("Root must be an integer");if(0===e||0===e.abs())return[new r(0,0)];var i,a="number"==typeof e;(a||0===e.re||0===e.im)&&(i=a?2*+(e<0):0===e.im?2*+(e.re<0):2*+(e.im<0)+1);for(var o=e.arg(),u=e.abs(),s=[],c=Math.pow(u,1/t),f=0;f<t;f++){var l=(i+4*f)/t;l!==Math.round(l)?s.push(new r({r:c,phi:(o+2*Math.PI*f)/t})):s.push(n[l%4](c))}return s}return t(fc,{Complex:function(e){return i(e,2)},"Complex, number":i})})),pc="dotPow",mc=Ce(pc,["typed","equalScalar","matrix","pow","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.equalScalar,n=e.matrix,i=e.pow,a=e.DenseMatrix,o=e.concat,u=Ya({typed:t}),s=iu({typed:t,DenseMatrix:a}),c=Ca({typed:t,equalScalar:r}),f=Ma({typed:t,DenseMatrix:a}),l=Ka({typed:t,matrix:n,concat:o}),p={};for(var m in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,m)&&(m.includes("Matrix")||m.includes("Array")||(p[m]=i.signatures[m]));var h=t(p);return t(pc,l({elop:h,SS:s,DS:u,Ss:c,sS:f}))})),hc="dotDivide",dc=Ce(hc,["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.divideScalar,a=e.DenseMatrix,o=e.concat,u=Wa({typed:t,equalScalar:n}),s=Ya({typed:t}),c=iu({typed:t,DenseMatrix:a}),f=Ca({typed:t,equalScalar:n}),l=Ma({typed:t,DenseMatrix:a}),p=Ka({typed:t,matrix:r,concat:o});return t(hc,p({elop:i,SS:c,DS:s,SD:u,Ss:f,sS:l}))}));function vc(e){var t=e.DenseMatrix;return function(e,r,n){var i=e.size();if(2!==i.length)throw new RangeError("Matrix must be two dimensional (size: "+tn(i)+")");var a=i[0];if(a!==i[1])throw new RangeError("Matrix must be square (size: "+tn(i)+")");var o=[];if(l(r)){var u=r.size(),s=r._data;if(1===u.length){if(u[0]!==a)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var c=0;c<a;c++)o[c]=[s[c]];return new t({data:o,size:[a,1],datatype:r._datatype})}if(2===u.length){if(u[0]!==a||1!==u[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(m(r)){if(n){o=[];for(var p=0;p<a;p++)o[p]=[s[p][0]];return new t({data:o,size:[a,1],datatype:r._datatype})}return r}if(h(r)){for(var d=0;d<a;d++)o[d]=[0];for(var v=r._values,y=r._index,g=r._ptr,x=g[1],b=g[0];b<x;b++)o[y[b]][0]=v[b];return new t({data:o,size:[a,1],datatype:r._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(f(r)){var w=fn(r);if(1===w.length){if(w[0]!==a)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var N=0;N<a;N++)o[N]=[r[N]];return new t({data:o,size:[a,1]})}if(2===w.length){if(w[0]!==a||1!==w[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var D=0;D<a;D++)o[D]=[r[D][0]];return new t({data:o,size:[a,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var yc="lsolve",gc=Ce(yc,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,i=e.multiplyScalar,a=e.subtractScalar,o=e.equalScalar,u=e.DenseMatrix,s=vc({DenseMatrix:u});return t(yc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=(t=s(e,t,!0))._data,c=e._size[0],f=e._size[1],l=e._values,p=e._index,m=e._ptr,h=[],d=0;d<f;d++){var v=r[d][0]||0;if(o(v,0))h[d]=[0];else{for(var y=0,g=[],x=[],b=m[d],w=m[d+1],N=b;N<w;N++){var D=p[N];D===d?y=l[N]:D>d&&(g.push(l[N]),x.push(D))}if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var E=n(v,y),A=0,S=x.length;A<S;A++){var C=x[A];r[C]=[a(r[C][0]||0,i(E,g[A]))]}h[d]=[E]}}return new u({data:h,size:[c,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).valueOf()}});function c(e,t){for(var r=(t=s(e,t,!0))._data,c=e._size[0],f=e._size[1],l=[],p=e._data,m=0;m<f;m++){var h=r[m][0]||0,d=void 0;if(o(h,0))d=0;else{var v=p[m][m];if(o(v,0))throw new Error("Linear system cannot be solved since matrix is singular");d=n(h,v);for(var y=m+1;y<c;y++)r[y]=[a(r[y][0]||0,i(d,p[y][m]))]}l[m]=[d]}return new u({data:l,size:[c,1]})}})),xc="usolve",bc=Ce(xc,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,i=e.multiplyScalar,a=e.subtractScalar,o=e.equalScalar,u=e.DenseMatrix,s=vc({DenseMatrix:u});return t(xc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=(t=s(e,t,!0))._data,c=e._size[0],f=e._size[1],l=e._values,p=e._index,m=e._ptr,h=[],d=f-1;d>=0;d--){var v=r[d][0]||0;if(o(v,0))h[d]=[0];else{for(var y=0,g=[],x=[],b=m[d],w=m[d+1]-1;w>=b;w--){var N=p[w];N===d?y=l[w]:N<d&&(g.push(l[w]),x.push(N))}if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var D=n(v,y),E=0,A=x.length;E<A;E++){var S=x[E];r[S]=[a(r[S][0],i(D,g[E]))]}h[d]=[D]}}return new u({data:h,size:[c,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).valueOf()}});function c(e,t){for(var r=(t=s(e,t,!0))._data,c=e._size[0],f=e._size[1],l=[],p=e._data,m=f-1;m>=0;m--){var h=r[m][0]||0,d=void 0;if(o(h,0))d=0;else{var v=p[m][m];if(o(v,0))throw new Error("Linear system cannot be solved since matrix is singular");d=n(h,v);for(var y=m-1;y>=0;y--)r[y]=[a(r[y][0]||0,i(d,p[y][m]))]}l[m]=[d]}return new u({data:l,size:[c,1]})}})),wc="lsolveAll",Nc=Ce(wc,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,i=e.multiplyScalar,a=e.subtractScalar,o=e.equalScalar,u=e.DenseMatrix,s=vc({DenseMatrix:u});return t(wc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=[s(e,t,!0)._data.map((function(e){return e[0]}))],c=e._size[0],f=e._size[1],l=e._values,p=e._index,m=e._ptr,h=0;h<f;h++)for(var d=r.length,v=0;v<d;v++){for(var y=r[v],g=[],x=[],b=m[h],w=m[h+1],N=0,D=b;D<w;D++){var E=p[D];E===h?N=l[D]:E>h&&(g.push(l[D]),x.push(E))}if(o(N,0))if(o(y[h],0)){if(0===v){var A=_e(y);A[h]=1;for(var S=0,C=x.length;S<C;S++){var M=x[S];A[M]=a(A[M],g[S])}r.push(A)}}else{if(0===v)return[];r.splice(v,1),v-=1,d-=1}else{y[h]=n(y[h],N);for(var F=0,O=x.length;F<O;F++){var T=x[F];y[T]=a(y[T],i(y[h],g[F]))}}}return r.map((function(e){return new u({data:e.map((function(e){return[e]})),size:[c,1]})}))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).map((function(e){return e.valueOf()}))}});function c(e,t){for(var r=[s(e,t,!0)._data.map((function(e){return e[0]}))],c=e._data,f=e._size[0],l=e._size[1],p=0;p<l;p++)for(var m=r.length,h=0;h<m;h++){var d=r[h];if(o(c[p][p],0))if(o(d[p],0)){if(0===h){var v=_e(d);v[p]=1;for(var y=p+1;y<l;y++)v[y]=a(v[y],c[y][p]);r.push(v)}}else{if(0===h)return[];r.splice(h,1),h-=1,m-=1}else{d[p]=n(d[p],c[p][p]);for(var g=p+1;g<l;g++)d[g]=a(d[g],i(d[p],c[g][p]))}}return r.map((function(e){return new u({data:e.map((function(e){return[e]})),size:[f,1]})}))}})),Dc="usolveAll",Ec=Ce(Dc,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,i=e.multiplyScalar,a=e.subtractScalar,o=e.equalScalar,u=e.DenseMatrix,s=vc({DenseMatrix:u});return t(Dc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=[s(e,t,!0)._data.map((function(e){return e[0]}))],c=e._size[0],f=e._size[1],l=e._values,p=e._index,m=e._ptr,h=f-1;h>=0;h--)for(var d=r.length,v=0;v<d;v++){for(var y=r[v],g=[],x=[],b=m[h],w=0,N=m[h+1]-1;N>=b;N--){var D=p[N];D===h?w=l[N]:D<h&&(g.push(l[N]),x.push(D))}if(o(w,0))if(o(y[h],0)){if(0===v){var E=_e(y);E[h]=1;for(var A=0,S=x.length;A<S;A++){var C=x[A];E[C]=a(E[C],g[A])}r.push(E)}}else{if(0===v)return[];r.splice(v,1),v-=1,d-=1}else{y[h]=n(y[h],w);for(var M=0,F=x.length;M<F;M++){var O=x[M];y[O]=a(y[O],i(y[h],g[M]))}}}return r.map((function(e){return new u({data:e.map((function(e){return[e]})),size:[c,1]})}))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).map((function(e){return e.valueOf()}))}});function c(e,t){for(var r=[s(e,t,!0)._data.map((function(e){return e[0]}))],c=e._data,f=e._size[0],l=e._size[1]-1;l>=0;l--)for(var p=r.length,m=0;m<p;m++){var h=r[m];if(o(c[l][l],0))if(o(h[l],0)){if(0===m){var d=_e(h);d[l]=1;for(var v=l-1;v>=0;v--)d[v]=a(d[v],c[v][l]);r.push(d)}}else{if(0===m)return[];r.splice(m,1),m-=1,p-=1}else{h[l]=n(h[l],c[l][l]);for(var y=l-1;y>=0;y--)h[y]=a(h[y],i(h[l],c[y][l]))}}return r.map((function(e){return new u({data:e.map((function(e){return[e]})),size:[f,1]})}))}})),Ac=Ce("matAlgo08xS0Sid",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var a=e._values,o=e._index,u=e._ptr,s=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),f=n._values,l=n._index,p=n._ptr,m=n._size,h=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(s.length!==m.length)throw new sn(s.length,m.length);if(s[0]!==m[0]||s[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+m+")");if(!a||!f)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var d,v=s[0],y=s[1],g=r,x=0,b=i;"string"==typeof c&&c===h&&"mixed"!==c&&(d=c,g=t.find(r,[d,d]),x=t.convert(0,d),b=t.find(i,[d,d]));for(var w,N,D,E,A=[],S=[],C=[],M=[],F=[],O=0;O<y;O++){C[O]=S.length;var T=O+1;for(N=u[O],D=u[O+1],w=N;w<D;w++)F[E=o[w]]=T,M[E]=a[w],S.push(E);for(N=p[O],D=p[O+1],w=N;w<D;w++)F[E=l[w]]===T&&(M[E]=b(M[E],f[w]));for(w=C[O];w<S.length;){var _=M[E=S[w]];g(_,x)?S.splice(w,1):(A.push(_),w++)}}return C[y]=S.length,e.createSparseMatrix({values:A,index:S,ptr:C,size:[v,y],datatype:c===e._datatype&&h===n._datatype?d:void 0})}})),Sc=Ce("useMatrixForArrayScalar",["typed","matrix"],(function(e){var t=e.typed,r=e.matrix;return{"Array, number":t.referTo("DenseMatrix, number",(function(e){return function(t,n){return e(r(t),n).valueOf()}})),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",(function(e){return function(t,n){return e(r(t),n).valueOf()}})),"number, Array":t.referTo("number, DenseMatrix",(function(e){return function(t,n){return e(t,r(n)).valueOf()}})),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",(function(e){return function(t,n){return e(t,r(n)).valueOf()}}))}})),Cc="leftShift",Mc=Ce(Cc,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.DenseMatrix,o=e.concat,u=to({typed:t}),s=Wa({typed:t,equalScalar:n}),c=Ac({typed:t,equalScalar:n}),f=no({typed:t,DenseMatrix:a}),l=Ca({typed:t,equalScalar:n}),p=Fa({typed:t}),m=Ka({typed:t,matrix:r,concat:o}),h=Sc({typed:t,matrix:r});return t(Cc,{"number, number":Yo,"BigNumber, BigNumber":Uo,"SparseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return n(r,0)?t.clone():l(t,r,e,!1)}})),"DenseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return n(r,0)?t.clone():p(t,r,e,!1)}})),"number | BigNumber, SparseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):f(r,t,e,!0)}})),"number | BigNumber, DenseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):p(r,t,e,!0)}}))},h,m({SS:c,DS:u,SD:s}))})),Fc="rightArithShift",Oc=Ce(Fc,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.DenseMatrix,o=e.concat,u=to({typed:t}),s=Wa({typed:t,equalScalar:n}),c=Ac({typed:t,equalScalar:n}),f=no({typed:t,DenseMatrix:a}),l=Ca({typed:t,equalScalar:n}),p=Fa({typed:t}),m=Ka({typed:t,matrix:r,concat:o}),h=Sc({typed:t,matrix:r});return t(Fc,{"number, number":Jo,"BigNumber, BigNumber":$o,"SparseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return n(r,0)?t.clone():l(t,r,e,!1)}})),"DenseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return n(r,0)?t.clone():p(t,r,e,!1)}})),"number | BigNumber, SparseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):f(r,t,e,!0)}})),"number | BigNumber, DenseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):p(r,t,e,!0)}}))},h,m({SS:c,DS:u,SD:s}))})),Tc="rightLogShift",_c=Ce(Tc,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.DenseMatrix,o=e.concat,u=to({typed:t}),s=Wa({typed:t,equalScalar:n}),c=Ac({typed:t,equalScalar:n}),f=no({typed:t,DenseMatrix:a}),l=Ca({typed:t,equalScalar:n}),p=Fa({typed:t}),m=Ka({typed:t,matrix:r,concat:o}),h=Sc({typed:t,matrix:r});return t(Tc,{"number, number":Xo,"SparseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return n(r,0)?t.clone():l(t,r,e,!1)}})),"DenseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return n(r,0)?t.clone():p(t,r,e,!1)}})),"number | BigNumber, SparseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):f(r,t,e,!0)}})),"number | BigNumber, DenseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):p(r,t,e,!0)}}))},h,m({SS:c,DS:u,SD:s}))})),Bc=Ce("and",["typed","matrix","equalScalar","zeros","not","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.not,o=e.concat,u=Wa({typed:t,equalScalar:n}),s=fo({typed:t,equalScalar:n}),c=Ca({typed:t,equalScalar:n}),f=Fa({typed:t}),l=Ka({typed:t,matrix:r,concat:o});return t("and",{"number, number":vu,"Complex, Complex":function(e,t){return!(0===e.re&&0===e.im||0===t.re&&0===t.im)},"BigNumber, BigNumber":function(e,t){return!(e.isZero()||t.isZero()||e.isNaN()||t.isNaN())},"Unit, Unit":t.referToSelf((function(e){return function(t,r){return e(t.value||0,r.value||0)}})),"SparseMatrix, any":t.referToSelf((function(e){return function(t,r){return a(r)?i(t.size(),t.storage()):c(t,r,e,!1)}})),"DenseMatrix, any":t.referToSelf((function(e){return function(t,r){return a(r)?i(t.size(),t.storage()):f(t,r,e,!1)}})),"any, SparseMatrix":t.referToSelf((function(e){return function(t,r){return a(t)?i(t.size(),t.storage()):c(r,t,e,!0)}})),"any, DenseMatrix":t.referToSelf((function(e){return function(t,r){return a(t)?i(t.size(),t.storage()):f(r,t,e,!0)}})),"Array, any":t.referToSelf((function(e){return function(t,n){return e(r(t),n).valueOf()}})),"any, Array":t.referToSelf((function(e){return function(t,n){return e(t,r(n)).valueOf()}}))},l({SS:s,DS:u}))})),kc="compare",Ic=Ce(kc,["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.config,n=e.equalScalar,i=e.matrix,a=e.BigNumber,o=e.Fraction,u=e.DenseMatrix,s=e.concat,c=Ya({typed:t}),f=Ja({typed:t,equalScalar:n}),l=Ma({typed:t,DenseMatrix:u}),p=Ka({typed:t,matrix:i,concat:s}),m=wi({typed:t});return t(kc,zc({typed:t,config:r}),{"boolean, boolean":function(e,t){return e===t?0:e>t?1:-1},"BigNumber, BigNumber":function(e,t){return bi(e,t,r.epsilon)?new a(0):new a(e.cmp(t))},"Fraction, Fraction":function(e,t){return new o(e.compare(t))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},m,p({SS:f,DS:c,Ss:l}))})),zc=Ce(kc,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(kc,{"number, number":function(e,t){return se(e,t,r.epsilon)?0:e>t?1:-1}})})),Rc=r(1880),qc="compareNatural",jc=Ce(qc,["typed","compare"],(function(e){var t=e.typed,r=e.compare,n=r.signatures["boolean,boolean"];return t(qc,{"any, any":function e(t,o){var u,s=H(t),c=H(o);if(!("number"!==s&&"BigNumber"!==s&&"Fraction"!==s||"number"!==c&&"BigNumber"!==c&&"Fraction"!==c))return"0"!==(u=r(t,o)).toString()?u>0?1:-1:Rc(s,c);var f=["Array","DenseMatrix","SparseMatrix"];if(f.includes(s)||f.includes(c))return 0!==(u=i(e,t,o))?u:Rc(s,c);if(s!==c)return Rc(s,c);if("Complex"===s)return function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0}(t,o);if("Unit"===s)return t.equalBase(o)?e(t.value,o.value):a(e,t.formatUnits(),o.formatUnits());if("boolean"===s)return n(t,o);if("string"===s)return Rc(t,o);if("Object"===s)return function(e,t,r){var n=Object.keys(t),i=Object.keys(r);n.sort(Rc),i.sort(Rc);var o=a(e,n,i);if(0!==o)return o;for(var u=0;u<n.length;u++){var s=e(t[n[u]],r[i[u]]);if(0!==s)return s}return 0}(e,t,o);if("null"===s)return 0;if("undefined"===s)return 0;throw new TypeError('Unsupported type of value "'+s+'"')}});function i(e,t,r){return h(t)&&h(r)?a(e,t.toJSON().values,r.toJSON().values):h(t)?i(e,t.toArray(),r):h(r)?i(e,t,r.toArray()):m(t)?i(e,t.toJSON().data,r):m(r)?i(e,t,r.toJSON().data):Array.isArray(t)?Array.isArray(r)?a(e,t,r):i(e,t,[r]):i(e,[t],r)}function a(e,t,r){for(var n=0,i=Math.min(t.length,r.length);n<i;n++){var a=e(t[n],r[n]);if(0!==a)return a}return t.length>r.length?1:t.length<r.length?-1:0}})),Pc="compareText",Lc=["typed","matrix","concat"];un.signature="any, any";var Uc=Ce(Pc,Lc,(function(e){var t=e.typed,r=e.matrix,n=e.concat,i=Ka({typed:t,matrix:r,concat:n});return t(Pc,un,i({elop:un,Ds:!0}))})),$c="equal",Hc=Ce($c,["typed","matrix","equalScalar","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.DenseMatrix,a=e.concat,o=Ya({typed:t}),u=iu({typed:t,DenseMatrix:i}),s=Ma({typed:t,DenseMatrix:i}),c=Ka({typed:t,matrix:r,concat:a});return t($c,Gc({typed:t,equalScalar:n}),c({elop:n,SS:u,DS:o,Ss:s}))})),Gc=Ce($c,["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return t($c,{"any, any":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:r(e,t)}})})),Vc="equalText",Zc=Ce(Vc,["typed","compareText","isZero"],(function(e){var t=e.typed,r=e.compareText,n=e.isZero;return t(Vc,{"any, any":function(e,t){return n(r(e,t))}})})),Wc="smaller",Yc=Ce(Wc,["typed","config","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.DenseMatrix,a=e.concat,o=Ya({typed:t}),u=iu({typed:t,DenseMatrix:i}),s=Ma({typed:t,DenseMatrix:i}),c=Ka({typed:t,matrix:n,concat:a}),f=wi({typed:t});return t(Wc,Jc({typed:t,config:r}),{"boolean, boolean":function(e,t){return e<t},"BigNumber, BigNumber":function(e,t){return e.lt(t)&&!bi(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return-1===e.compare(t)},"Complex, Complex":function(e,t){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:u,DS:o,Ss:s}))})),Jc=Ce(Wc,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(Wc,{"number, number":function(e,t){return e<t&&!se(e,t,r.epsilon)}})})),Xc="smallerEq",Qc=Ce(Xc,["typed","config","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.DenseMatrix,a=e.concat,o=Ya({typed:t}),u=iu({typed:t,DenseMatrix:i}),s=Ma({typed:t,DenseMatrix:i}),c=Ka({typed:t,matrix:n,concat:a}),f=wi({typed:t});return t(Xc,Kc({typed:t,config:r}),{"boolean, boolean":function(e,t){return e<=t},"BigNumber, BigNumber":function(e,t){return e.lte(t)||bi(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return 1!==e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:u,DS:o,Ss:s}))})),Kc=Ce(Xc,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(Xc,{"number, number":function(e,t){return e<=t||se(e,t,r.epsilon)}})})),ef="larger",tf=Ce(ef,["typed","config","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.DenseMatrix,a=e.concat,o=Ya({typed:t}),u=iu({typed:t,DenseMatrix:i}),s=Ma({typed:t,DenseMatrix:i}),c=Ka({typed:t,matrix:n,concat:a}),f=wi({typed:t});return t(ef,rf({typed:t,config:r}),{"boolean, boolean":function(e,t){return e>t},"BigNumber, BigNumber":function(e,t){return e.gt(t)&&!bi(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return 1===e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:u,DS:o,Ss:s}))})),rf=Ce(ef,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(ef,{"number, number":function(e,t){return e>t&&!se(e,t,r.epsilon)}})})),nf="largerEq",af=Ce(nf,["typed","config","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.DenseMatrix,a=e.concat,o=Ya({typed:t}),u=iu({typed:t,DenseMatrix:i}),s=Ma({typed:t,DenseMatrix:i}),c=Ka({typed:t,matrix:n,concat:a}),f=wi({typed:t});return t(nf,of({typed:t,config:r}),{"boolean, boolean":function(e,t){return e>=t},"BigNumber, BigNumber":function(e,t){return e.gte(t)||bi(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return-1!==e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:u,DS:o,Ss:s}))})),of=Ce(nf,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(nf,{"number, number":function(e,t){return e>=t||se(e,t,r.epsilon)}})})),uf="deepEqual",sf=Ce(uf,["typed","equal"],(function(e){var t=e.typed,r=e.equal;return t(uf,{"any, any":function(e,t){return n(e.valueOf(),t.valueOf())}});function n(e,t){if(Array.isArray(e)){if(Array.isArray(t)){var i=e.length;if(i!==t.length)return!1;for(var a=0;a<i;a++)if(!n(e[a],t[a]))return!1;return!0}return!1}return!Array.isArray(t)&&r(e,t)}})),cf="unequal",ff=Ce(cf,["typed","config","equalScalar","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=(e.config,e.equalScalar),n=e.matrix,i=e.DenseMatrix,a=e.concat,o=Ya({typed:t}),u=iu({typed:t,DenseMatrix:i}),s=Ma({typed:t,DenseMatrix:i}),c=Ka({typed:t,matrix:n,concat:a});return t(cf,lf({typed:t,equalScalar:r}),c({elop:function(e,t){return!r(e,t)},SS:u,DS:o,Ss:s}))})),lf=Ce(cf,["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return t(cf,{"any, any":function(e,t){return null===e?null!==t:null===t?null!==e:void 0===e?void 0!==t:void 0===t?void 0!==e:!r(e,t)}})})),pf="partitionSelect",mf=Ce(pf,["typed","isNumeric","isNaN","compare"],(function(e){var t=e.typed,r=e.isNumeric,n=e.isNaN,i=e.compare,a=i,o=function(e,t){return-i(e,t)};return t(pf,{"Array | Matrix, number":function(e,t){return u(e,t,a)},"Array | Matrix, number, string":function(e,t,r){if("asc"===r)return u(e,t,a);if("desc"===r)return u(e,t,o);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(e,t,r){if(!V(t)||t<0)throw new Error("k must be a non-negative integer");if(l(e)){if(e.size().length>1)throw new Error("Only one dimensional matrices supported");return s(e.valueOf(),t,r)}if(Array.isArray(e))return s(e,t,r)}function s(e,t,i){if(t>=e.length)throw new Error("k out of bounds");for(var a=0;a<e.length;a++)if(r(e[a])&&n(e[a]))return e[a];for(var o=0,u=e.length-1;o<u;){for(var s=o,c=u,f=e[Math.floor(Math.random()*(u-o+1))+o];s<c;)if(i(e[s],f)>=0){var l=e[c];e[c]=e[s],e[s]=l,--c}else++s;i(e[s],f)>0&&--s,t<=s?u=s:o=s+1}return e[t]}})),hf="sort",df=Ce(hf,["typed","matrix","compare","compareNatural"],(function(e){var t=e.typed,r=e.matrix,n=e.compare,i=e.compareNatural,a=n,o=function(e,t){return-n(e,t)};return t(hf,{Array:function(e){return s(e),e.sort(a)},Matrix:function(e){return c(e),r(e.toArray().sort(a),e.storage())},"Array, function":function(e,t){return s(e),e.sort(t)},"Matrix, function":function(e,t){return c(e),r(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return s(e),e.sort(u(t))},"Matrix, string":function(e,t){return c(e),r(e.toArray().sort(u(t)),e.storage())}});function u(e){if("asc"===e)return a;if("desc"===e)return o;if("natural"===e)return i;throw new Error('String "asc", "desc", or "natural" expected')}function s(e){if(1!==fn(e).length)throw new Error("One dimensional array expected")}function c(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}})),vf=Ce("max",["typed","config","numeric","larger"],(function(e){var t=e.typed,r=e.config,n=e.numeric,i=e.larger;return t("max",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){return Jn(e,t.valueOf(),a)},"...":function(e){if(Zn(e))throw new TypeError("Scalar values expected in function max");return o(e)}});function a(e,t){try{return i(e,t)?e:t}catch(e){throw js(e,"max",t)}}function o(e){var t;if(Wn(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||i(e,t))&&(t=e)}catch(t){throw js(t,"max",e)}})),void 0===t)throw new Error("Cannot calculate max of an empty array");return"string"==typeof t&&(t=n(t,r.number)),t}})),yf=Ce("min",["typed","config","numeric","smaller"],(function(e){var t=e.typed,r=e.config,n=e.numeric,i=e.smaller;return t("min",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){return Jn(e,t.valueOf(),a)},"...":function(e){if(Zn(e))throw new TypeError("Scalar values expected in function min");return o(e)}});function a(e,t){try{return i(e,t)?e:t}catch(e){throw js(e,"min",t)}}function o(e){var t;if(Wn(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||i(e,t))&&(t=e)}catch(t){throw js(t,"min",e)}})),void 0===t)throw new Error("Cannot calculate min of an empty array");return"string"==typeof t&&(t=n(t,r.number)),t}})),gf=Ce("ImmutableDenseMatrix",["smaller","DenseMatrix"],(function(e){var t=e.smaller,r=e.DenseMatrix;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!c(t))throw new Error("Invalid datatype: "+t);if(l(e)||f(e)){var i=new r(e,t);this._data=i._data,this._size=i._size,this._datatype=i._datatype,this._min=null,this._max=null}else if(e&&f(e.data)&&f(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=void 0!==e.min?e.min:null,this._max=void 0!==e.max?e.max:null;else{if(e)throw new TypeError("Unsupported type of data ("+H(e)+")");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(e){switch(arguments.length){case 1:var t=r.prototype.subset.call(this,e);return l(t)?new n({data:t._data,size:t._size,datatype:t._datatype}):t;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:ye(this._data),size:ye(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(null===this._min){var e=null;this.forEach((function(r){(null===e||t(r,e))&&(e=r)})),this._min=null!==e?e:void 0}return this._min},n.prototype.max=function(){if(null===this._max){var e=null;this.forEach((function(r){(null===e||t(e,r))&&(e=r)})),this._max=null!==e?e:void 0}return this._max},n}),{isClass:!0}),xf=Ce("Index",["ImmutableDenseMatrix","getMatrixDataType"],(function(e){var t=e.ImmutableDenseMatrix,r=e.getMatrixDataType;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var t=0,a=arguments.length;t<a;t++){var o=arguments[t],u=f(o),s=l(o),c=null;if(d(o))this._dimensions.push(o),this._isScalar=!1;else if(u||s){var p=void 0;"boolean"===r(o)?(u&&(p=i(bf(o).valueOf())),s&&(p=i(bf(o._data).valueOf())),c=o.valueOf().length):p=i(o.valueOf()),this._dimensions.push(p);var m=p.size();1===m.length&&1===m[0]&&null===c||(this._isScalar=!1)}else if("number"==typeof o)this._dimensions.push(i([o]));else{if("string"!=typeof o)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._dimensions.push(o)}this._sourceSize.push(c)}}function i(e){for(var r=0,n=e.length;r<n;r++)if("number"!=typeof e[r]||!V(e[r]))throw new TypeError("Index parameters must be positive integer numbers");return new t(e)}return n.prototype.type="Index",n.prototype.isIndex=!0,n.prototype.clone=function(){var e=new n;return e._dimensions=ye(this._dimensions),e._isScalar=this._isScalar,e._sourceSize=this._sourceSize,e},n.create=function(e){var t=new n;return n.apply(t,e),t},n.prototype.size=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]="string"==typeof n?1:n.size()[0]}return e},n.prototype.max=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]="string"==typeof n?n:n.max()}return e},n.prototype.min=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]="string"==typeof n?n:n.min()}return e},n.prototype.forEach=function(e){for(var t=0,r=this._dimensions.length;t<r;t++)e(this._dimensions[t],t,this)},n.prototype.dimension=function(e){return this._dimensions[e]||null},n.prototype.isObjectProperty=function(){return 1===this._dimensions.length&&"string"==typeof this._dimensions[0]},n.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},n.prototype.isScalar=function(){return this._isScalar},n.prototype.toArray=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e.push("string"==typeof n?n:n.toArray())}return e},n.prototype.valueOf=n.prototype.toArray,n.prototype.toString=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];"string"==typeof n?e.push(JSON.stringify(n)):e.push(n.toString())}return"["+e.join(", ")+"]"},n.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},n.fromJSON=function(e){return n.create(e.dimensions)},n}),{isClass:!0});function bf(e){var t=[];return e.forEach((function(e,r){e&&t.push(r)})),t}var wf=Ce("FibonacciHeap",["smaller","larger"],(function(e){var t=e.smaller,r=e.larger,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function a(e,t,r){t.left.right=t.right,t.right.left=t.left,r.degree--,r.child===t&&(r.child=t.right),0===r.degree&&(r.child=null),t.left=e,t.right=e.right,e.right=t,t.right.left=t,t.parent=null,t.mark=!1}function o(e,t){var r=t.parent;r&&(t.mark?(a(e,t,r),o(r)):t.mark=!0)}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(e,r){var n={key:e,value:r,degree:0};if(this._minimum){var i=this._minimum;n.left=i,n.right=i.right,i.right=n,n.right.left=n,t(e,i.key)&&(this._minimum=n)}else n.left=n,n.right=n,this._minimum=n;return this._size++,n},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return 0===this._size},i.prototype.extractMinimum=function(){var e=this._minimum;if(null===e)return e;for(var i=this._minimum,a=e.degree,o=e.child;a>0;){var s=o.right;o.left.right=o.right,o.right.left=o.left,o.left=i,o.right=i.right,i.right=o,o.right.left=o,o.parent=null,o=s,a--}return e.left.right=e.right,e.right.left=e.left,i=e===e.right?null:function(e,i){var a,o=Math.floor(Math.log(i)*n)+1,s=new Array(o),c=0,f=e;if(f)for(c++,f=f.right;f!==e;)c++,f=f.right;for(;c>0;){for(var l=f.degree,p=f.right;a=s[l];){if(r(f.key,a.key)){var m=a;a=f,f=m}u(a,f),s[l]=null,l++}s[l]=f,f=p,c--}e=null;for(var h=0;h<o;h++)(a=s[h])&&(e?(a.left.right=a.right,a.right.left=a.left,a.left=e,a.right=e.right,e.right=a,a.right.left=a,t(a.key,e.key)&&(e=a)):e=a);return e}(i=e.right,this._size),this._size--,this._minimum=i,e},i.prototype.remove=function(e){this._minimum=function(e,r,n){r.key=-1;var i=r.parent;return i&&t(r.key,i.key)&&(a(e,r,i),o(e,i)),t(r.key,e.key)&&(e=r),e}(this._minimum,e),this.extractMinimum()};var u=function(e,t){e.left.right=e.right,e.right.left=e.left,e.parent=t,t.child?(e.left=t.child,e.right=t.child.right,t.child.right=e,e.right.left=e):(t.child=e,e.right=e,e.left=e),t.degree++,e.mark=!1};return i}),{isClass:!0}),Nf=Ce("Spa",["addScalar","equalScalar","FibonacciHeap"],(function(e){var t=e.addScalar,r=e.equalScalar,n=e.FibonacciHeap;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(e,t){if(this._values[e])this._values[e].value=t;else{var r=this._heap.insert(e,t);this._values[e]=r}},i.prototype.get=function(e){var t=this._values[e];return t?t.value:0},i.prototype.accumulate=function(e,r){var n=this._values[e];n?n.value=t(n.value,r):(n=this._heap.insert(e,r),this._values[e]=n)},i.prototype.forEach=function(e,t,n){var i=this._heap,a=this._values,o=[],u=i.extractMinimum();for(u&&o.push(u);u&&u.key<=t;)u.key>=e&&(r(u.value,0)||n(u.key,u.value,this)),(u=i.extractMinimum())&&o.push(u);for(var s=0;s<o.length;s++){var c=o[s];a[(u=i.insert(c.key,c.value)).key]=u}},i.prototype.swap=function(e,t){var r=this._values[e],n=this._values[t];if(!r&&n)r=this._heap.insert(e,n.value),this._heap.remove(n),this._values[e]=r,this._values[t]=void 0;else if(r&&!n)n=this._heap.insert(t,r.value),this._heap.remove(r),this._values[t]=n,this._values[e]=void 0;else if(r&&n){var i=r.value;r.value=n.value,n.value=i}},i}),{isClass:!0}),Df=(r(375),Pn((function(e){return new e(1).exp()}),{hasher:Cf})),Ef=Pn((function(e){return new e(1).plus(new e(5).sqrt()).div(2)}),{hasher:Cf}),Af=Pn((function(e){return e.acos(-1)}),{hasher:Cf}),Sf=Pn((function(e){return Af(e).times(2)}),{hasher:Cf});function Cf(e){return e[0].precision}function Mf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ff(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mf(Object(r),!0).forEach((function(t){Za(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Of=Ce("Unit",["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],(function(e){var r,n,i,a=e.on,u=e.config,c=e.addScalar,f=e.subtractScalar,l=e.multiplyScalar,p=e.divideScalar,m=e.pow,h=e.abs,d=e.fix,v=e.round,y=e.equal,g=e.isNumeric,x=e.format,b=e.number,w=e.Complex,N=e.BigNumber,D=e.Fraction,E=b;function A(e,t){if(!(this instanceof A))throw new Error("Constructor must be called with the new operator");if(null!=e&&!g(e)&&!o(e))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,void 0===t)this.units=[],this.dimensions=z.map((function(e){return 0}));else if("string"==typeof t){var r=A.parse(t);this.units=r.units,this.dimensions=r.dimensions}else{if(!s(t)||null!==t.value)throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.fixPrefix=t.fixPrefix,this.skipAutomaticSimplification=t.skipAutomaticSimplification,this.dimensions=t.dimensions.slice(0),this.units=t.units.map((function(e){return Jr({},e)}))}this.value=this._normalize(e)}function S(){for(;" "===i||"\t"===i;)M()}function C(e){return e>="0"&&e<="9"}function M(){n++,i=r.charAt(n)}function F(e){n=e,i=r.charAt(n)}function O(){var e="",t=n;if("+"===i?M():"-"===i&&(e+=i,M()),!function(e){return e>="0"&&e<="9"||"."===e}(i))return F(t),null;if("."===i){if(e+=i,M(),!C(i))return F(t),null}else{for(;C(i);)e+=i,M();"."===i&&(e+=i,M())}for(;C(i);)e+=i,M();if("E"===i||"e"===i){var r="",a=n;if(r+=i,M(),"+"!==i&&"-"!==i||(r+=i,M()),!C(i))return F(a),e;for(e+=r;C(i);)e+=i,M()}return e}function T(){for(var e="";C(i)||A.isValidAlpha(i);)e+=i,M();var t=e.charAt(0);return A.isValidAlpha(t)?e:null}function _(e){return i===e?(M(),e):null}Object.defineProperty(A,"name",{value:"Unit"}),A.prototype.constructor=A,A.prototype.type="Unit",A.prototype.isUnit=!0,A.parse=function(e,t){if(t=t||{},n=-1,i="","string"!=typeof(r=e))throw new TypeError("Invalid argument in Unit.parse, string expected");var a=new A;a.units=[];var o=1,s=!1;M(),S();var c=O(),f=null;if(c){if("BigNumber"===u.number)f=new N(c);else if("Fraction"===u.number)try{f=new D(c)}catch(e){f=parseFloat(c)}else f=parseFloat(c);S(),_("*")?(o=1,s=!0):_("/")&&(o=-1,s=!0)}for(var l=[],p=1;;){for(S();"("===i;)l.push(o),p*=o,o=1,M(),S();var m;if(!i)break;var h=i;if(null===(m=T()))throw new SyntaxError('Unexpected "'+h+'" in "'+r+'" at index '+n.toString());var d=B(m);if(null===d)throw new SyntaxError('Unit "'+m+'" not found.');var v=o*p;if(S(),_("^")){S();var y=O();if(null===y)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');v*=y}a.units.push({unit:d.unit,prefix:d.prefix,power:v});for(var g=0;g<z.length;g++)a.dimensions[g]+=(d.unit.dimensions[g]||0)*v;for(S();")"===i;){if(0===l.length)throw new SyntaxError('Unmatched ")" in "'+r+'" at index '+n.toString());p/=l.pop(),M(),S()}if(s=!1,_("*")?(o=1,s=!0):_("/")?(o=-1,s=!0):o=1,d.unit.base){var x=d.unit.base.key;$.auto[x]={unit:d.unit,prefix:d.prefix}}}if(S(),i)throw new SyntaxError('Could not parse: "'+e+'"');if(s)throw new SyntaxError('Trailing characters: "'+e+'"');if(0!==l.length)throw new SyntaxError('Unmatched "(" in "'+r+'"');if(0===a.units.length&&!t.allowNoUnits)throw new SyntaxError('"'+e+'" contains no units');return a.value=void 0!==f?a._normalize(f):null,a},A.prototype.clone=function(){var e=new A;e.fixPrefix=this.fixPrefix,e.skipAutomaticSimplification=this.skipAutomaticSimplification,e.value=ye(this.value),e.dimensions=this.dimensions.slice(0),e.units=[];for(var t=0;t<this.units.length;t++)for(var r in e.units[t]={},this.units[t])Ae(this.units[t],r)&&(e.units[t][r]=this.units[t][r]);return e},A.prototype.valueType=function(){return H(this.value)},A.prototype._isDerived=function(){return 0!==this.units.length&&(this.units.length>1||Math.abs(this.units[0].power-1)>1e-15)},A.prototype._normalize=function(e){if(null==e||0===this.units.length)return e;for(var t=e,r=A._getNumberConverter(H(e)),n=0;n<this.units.length;n++){var i=r(this.units[n].unit.value),a=r(this.units[n].prefix.value),o=r(this.units[n].power);t=l(t,m(l(i,a),o))}return t},A.prototype._denormalize=function(e,t){if(null==e||0===this.units.length)return e;for(var r=e,n=A._getNumberConverter(H(e)),i=0;i<this.units.length;i++){var a=n(this.units[i].unit.value),o=n(this.units[i].prefix.value),u=n(this.units[i].power);r=p(r,m(l(a,o),u))}return r};var B=Pn((function(e){if(Ae(P,e)){var t=P[e];return{unit:t,prefix:t.prefixes[""]}}for(var r in P)if(Ae(P,r)&&en(e,r)){var n=P[r],i=e.length-r.length,a=e.substring(0,i),o=Ae(n.prefixes,a)?n.prefixes[a]:void 0;if(void 0!==o)return{unit:n,prefix:o}}return null}),{hasher:function(e){return e[0]},limit:100});function k(e){return e.equalBase(R.NONE)&&null!==e.value&&!u.predictable?e.value:e}A.isValuelessUnit=function(e){return null!==B(e)},A.prototype.hasBase=function(e){if("string"==typeof e&&(e=R[e]),!e)return!1;for(var t=0;t<z.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},A.prototype.equalBase=function(e){for(var t=0;t<z.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},A.prototype.equals=function(e){return this.equalBase(e)&&y(this.value,e.value)},A.prototype.multiply=function(e){for(var t=this.clone(),r=s(e)?e:new A(e),n=0;n<z.length;n++)t.dimensions[n]=(this.dimensions[n]||0)+(r.dimensions[n]||0);for(var i=0;i<r.units.length;i++){var a=Ff({},r.units[i]);t.units.push(a)}if(null!==this.value||null!==r.value){var o=null===this.value?this._normalize(1):this.value,u=null===r.value?r._normalize(1):r.value;t.value=l(o,u)}else t.value=null;return s(e)&&(t.skipAutomaticSimplification=!1),k(t)},A.prototype.divideInto=function(e){return new A(e).divide(this)},A.prototype.divide=function(e){for(var t=this.clone(),r=s(e)?e:new A(e),n=0;n<z.length;n++)t.dimensions[n]=(this.dimensions[n]||0)-(r.dimensions[n]||0);for(var i=0;i<r.units.length;i++){var a=Ff(Ff({},r.units[i]),{},{power:-r.units[i].power});t.units.push(a)}if(null!==this.value||null!==r.value){var o=null===this.value?this._normalize(1):this.value,u=null===r.value?r._normalize(1):r.value;t.value=p(o,u)}else t.value=null;return s(e)&&(t.skipAutomaticSimplification=!1),k(t)},A.prototype.pow=function(e){for(var t=this.clone(),r=0;r<z.length;r++)t.dimensions[r]=(this.dimensions[r]||0)*e;for(var n=0;n<t.units.length;n++)t.units[n].power*=e;return null!==t.value?t.value=m(t.value,e):t.value=null,t.skipAutomaticSimplification=!1,k(t)},A.prototype.abs=function(){var e=this.clone();if(null!==e.value)if(e._isDerived()||0===e.units.length||0===e.units[0].unit.offset)e.value=h(e.value);else{var t=e._numberConverter(),r=t(e.units[0].unit.value),n=t(e.units[0].unit.offset),i=l(r,n);e.value=f(h(c(e.value,i)),i)}for(var a in e.units)"VA"!==e.units[a].unit.name&&"VAR"!==e.units[a].unit.name||(e.units[a].unit=P.W);return e},A.prototype.to=function(e){var t,r=null===this.value?this._normalize(1):this.value;if("string"==typeof e)t=A.parse(e);else{if(!s(e))throw new Error("String or Unit expected as parameter");t=e.clone()}if(!this.equalBase(t))throw new Error("Units do not match ('".concat(t.toString(),"' != '").concat(this.toString(),"')"));if(null!==t.value)throw new Error("Cannot convert to a unit with a value");if(null===this.value||this._isDerived()||0===this.units.length||0===t.units.length||this.units[0].unit.offset===t.units[0].unit.offset)t.value=ye(r);else{var n=A._getNumberConverter(H(r)),i=this.units[0].unit.value,a=this.units[0].unit.offset,o=l(i,a),u=t.units[0].unit.value,p=t.units[0].unit.offset,m=l(u,p);t.value=c(r,n(f(o,m)))}return t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t},A.prototype.toNumber=function(e){return E(this.toNumeric(e))},A.prototype.toNumeric=function(e){var t;return(t=e?this.to(e):this.clone())._isDerived()||0===t.units.length?t._denormalize(t.value):t._denormalize(t.value,t.units[0].prefix.value)},A.prototype.toString=function(){return this.format()},A.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.formatUnits(),fixPrefix:this.fixPrefix}},A.fromJSON=function(e){var t=new A(e.value,e.unit);return t.fixPrefix=e.fixPrefix||!1,t},A.prototype.valueOf=A.prototype.toString,A.prototype.simplify=function(){var e,t,r=this.clone(),n=[];for(var i in G)if(Ae(G,i)&&r.hasBase(R[i])){e=i;break}if("NONE"===e)r.units=[];else if(e&&Ae(G,e)&&(t=G[e]),t)r.units=[{unit:t.unit,prefix:t.prefix,power:1}];else{for(var a=!1,o=0;o<z.length;o++){var u=z[o];Math.abs(r.dimensions[o]||0)>1e-12&&(Ae(G,u)?n.push({unit:G[u].unit,prefix:G[u].prefix,power:r.dimensions[o]||0}):a=!0)}n.length<r.units.length&&!a&&(r.units=n)}return r},A.prototype.toSI=function(){for(var e=this.clone(),t=[],r=0;r<z.length;r++){var n=z[r];if(Math.abs(e.dimensions[r]||0)>1e-12){if(!Ae($.si,n))throw new Error("Cannot express custom unit "+n+" in SI units");t.push({unit:$.si[n].unit,prefix:$.si[n].prefix,power:e.dimensions[r]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,null!==this.value?(e.value=null,this.to(e)):e},A.prototype.formatUnits=function(){for(var e="",t="",r=0,n=0,i=0;i<this.units.length;i++)this.units[i].power>0?(r++,e+=" "+this.units[i].prefix.name+this.units[i].unit.name,Math.abs(this.units[i].power-1)>1e-15&&(e+="^"+this.units[i].power)):this.units[i].power<0&&n++;if(n>0)for(var a=0;a<this.units.length;a++)this.units[a].power<0&&(r>0?(t+=" "+this.units[a].prefix.name+this.units[a].unit.name,Math.abs(this.units[a].power+1)>1e-15&&(t+="^"+-this.units[a].power)):(t+=" "+this.units[a].prefix.name+this.units[a].unit.name,t+="^"+this.units[a].power));e=e.substr(1),t=t.substr(1),r>1&&n>0&&(e="("+e+")"),n>1&&r>0&&(t="("+t+")");var o=e;return r>0&&n>0&&(o+=" / "),o+t},A.prototype.format=function(e){var t=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),r=!1;for(var n in void 0!==t.value&&null!==t.value&&o(t.value)&&(r=Math.abs(t.value.re)<1e-14),t.units)Ae(t.units,n)&&t.units[n].unit&&("VA"===t.units[n].unit.name&&r?t.units[n].unit=P.VAR:"VAR"!==t.units[n].unit.name||r||(t.units[n].unit=P.VA));1!==t.units.length||t.fixPrefix||Math.abs(t.units[0].power-Math.round(t.units[0].power))<1e-14&&(t.units[0].prefix=t._bestPrefix());var i=t._denormalize(t.value),a=null!==t.value?x(i,e||{}):"",u=t.formatUnits();return t.value&&o(t.value)&&(a="("+a+")"),u.length>0&&a.length>0&&(a+=" "),a+u},A.prototype._bestPrefix=function(){if(1!==this.units.length)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var e=null!==this.value?h(this.value):0,t=h(this.units[0].unit.value),r=this.units[0].prefix;if(0===e)return r;var n=this.units[0].power,i=Math.log(e/Math.pow(r.value*t,n))/Math.LN10-1.2;if(i>-2.200001&&i<1.800001)return r;i=Math.abs(i);var a=this.units[0].unit.prefixes;for(var o in a)if(Ae(a,o)){var u=a[o];if(u.scientific){var s=Math.abs(Math.log(e/Math.pow(u.value*t,n))/Math.LN10-1.2);(s<i||s===i&&u.name.length<r.name.length)&&(r=u,i=s)}}return r},A.prototype.splitUnit=function(e){for(var t=this.clone(),r=[],n=0;n<e.length&&(t=t.to(e[n]),n!==e.length-1);n++){var i=t.toNumeric(),a=v(i),o=new A(y(a,i)?a:d(t.toNumeric()),e[n].toString());r.push(o),t=f(t,o)}for(var u=0,s=0;s<r.length;s++)u=c(u,r[s].value);return y(u,this.value)&&(t.value=0),r.push(t),r};var I={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!1},h:{name:"h",value:100,scientific:!1},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0},R:{name:"R",value:1e27,scientific:!0},Q:{name:"Q",value:1e30,scientific:!0},d:{name:"d",value:.1,scientific:!1},c:{name:"c",value:.01,scientific:!1},m:{name:"m",value:.001,scientific:!0},u:{name:"u",value:1e-6,scientific:!0},n:{name:"n",value:1e-9,scientific:!0},p:{name:"p",value:1e-12,scientific:!0},f:{name:"f",value:1e-15,scientific:!0},a:{name:"a",value:1e-18,scientific:!0},z:{name:"z",value:1e-21,scientific:!0},y:{name:"y",value:1e-24,scientific:!0},r:{name:"r",value:1e-27,scientific:!0},q:{name:"q",value:1e-30,scientific:!0}},LONG:{"":{name:"",value:1,scientific:!0},deca:{name:"deca",value:10,scientific:!1},hecto:{name:"hecto",value:100,scientific:!1},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0},ronna:{name:"ronna",value:1e27,scientific:!0},quetta:{name:"quetta",value:1e30,scientific:!0},deci:{name:"deci",value:.1,scientific:!1},centi:{name:"centi",value:.01,scientific:!1},milli:{name:"milli",value:.001,scientific:!0},micro:{name:"micro",value:1e-6,scientific:!0},nano:{name:"nano",value:1e-9,scientific:!0},pico:{name:"pico",value:1e-12,scientific:!0},femto:{name:"femto",value:1e-15,scientific:!0},atto:{name:"atto",value:1e-18,scientific:!0},zepto:{name:"zepto",value:1e-21,scientific:!0},yocto:{name:"yocto",value:1e-24,scientific:!0},ronto:{name:"ronto",value:1e-27,scientific:!0},quecto:{name:"quecto",value:1e-30,scientific:!0}},SQUARED:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:100,scientific:!1},h:{name:"h",value:1e4,scientific:!1},k:{name:"k",value:1e6,scientific:!0},M:{name:"M",value:1e12,scientific:!0},G:{name:"G",value:1e18,scientific:!0},T:{name:"T",value:1e24,scientific:!0},P:{name:"P",value:1e30,scientific:!0},E:{name:"E",value:1e36,scientific:!0},Z:{name:"Z",value:1e42,scientific:!0},Y:{name:"Y",value:1e48,scientific:!0},R:{name:"R",value:1e54,scientific:!0},Q:{name:"Q",value:1e60,scientific:!0},d:{name:"d",value:.01,scientific:!1},c:{name:"c",value:1e-4,scientific:!1},m:{name:"m",value:1e-6,scientific:!0},u:{name:"u",value:1e-12,scientific:!0},n:{name:"n",value:1e-18,scientific:!0},p:{name:"p",value:1e-24,scientific:!0},f:{name:"f",value:1e-30,scientific:!0},a:{name:"a",value:1e-36,scientific:!0},z:{name:"z",value:1e-42,scientific:!0},y:{name:"y",value:1e-48,scientific:!0},r:{name:"r",value:1e-54,scientific:!0},q:{name:"q",value:1e-60,scientific:!0}},CUBIC:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:1e3,scientific:!1},h:{name:"h",value:1e6,scientific:!1},k:{name:"k",value:1e9,scientific:!0},M:{name:"M",value:1e18,scientific:!0},G:{name:"G",value:1e27,scientific:!0},T:{name:"T",value:1e36,scientific:!0},P:{name:"P",value:1e45,scientific:!0},E:{name:"E",value:1e54,scientific:!0},Z:{name:"Z",value:1e63,scientific:!0},Y:{name:"Y",value:1e72,scientific:!0},R:{name:"R",value:1e81,scientific:!0},Q:{name:"Q",value:1e90,scientific:!0},d:{name:"d",value:.001,scientific:!1},c:{name:"c",value:1e-6,scientific:!1},m:{name:"m",value:1e-9,scientific:!0},u:{name:"u",value:1e-18,scientific:!0},n:{name:"n",value:1e-27,scientific:!0},p:{name:"p",value:1e-36,scientific:!0},f:{name:"f",value:1e-45,scientific:!0},a:{name:"a",value:1e-54,scientific:!0},z:{name:"z",value:1e-63,scientific:!0},y:{name:"y",value:1e-72,scientific:!0},r:{name:"r",value:1e-81,scientific:!0},q:{name:"q",value:1e-90,scientific:!0}},BINARY_SHORT_SI:{"":{name:"",value:1,scientific:!0},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:"",value:1,scientific:!0},Ki:{name:"Ki",value:1024,scientific:!0},Mi:{name:"Mi",value:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),scientific:!0}},BINARY_LONG_SI:{"":{name:"",value:1,scientific:!0},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:"",value:1,scientific:!0},kibi:{name:"kibi",value:1024,scientific:!0},mebi:{name:"mebi",value:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};I.SHORTLONG=Jr({},I.SHORT,I.LONG),I.BINARY_SHORT=Jr({},I.BINARY_SHORT_SI,I.BINARY_SHORT_IEC),I.BINARY_LONG=Jr({},I.BINARY_LONG_SI,I.BINARY_LONG_IEC);var z=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],R={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(var q in R)Ae(R,q)&&(R[q].key=q);var j={name:"",base:{},value:1,offset:0,dimensions:z.map((function(e){return 0}))},P={meter:{name:"meter",base:R.LENGTH,prefixes:I.LONG,value:1,offset:0},inch:{name:"inch",base:R.LENGTH,prefixes:I.NONE,value:.0254,offset:0},foot:{name:"foot",base:R.LENGTH,prefixes:I.NONE,value:.3048,offset:0},yard:{name:"yard",base:R.LENGTH,prefixes:I.NONE,value:.9144,offset:0},mile:{name:"mile",base:R.LENGTH,prefixes:I.NONE,value:1609.344,offset:0},link:{name:"link",base:R.LENGTH,prefixes:I.NONE,value:.201168,offset:0},rod:{name:"rod",base:R.LENGTH,prefixes:I.NONE,value:5.0292,offset:0},chain:{name:"chain",base:R.LENGTH,prefixes:I.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:R.LENGTH,prefixes:I.NONE,value:1e-10,offset:0},m:{name:"m",base:R.LENGTH,prefixes:I.SHORT,value:1,offset:0},in:{name:"in",base:R.LENGTH,prefixes:I.NONE,value:.0254,offset:0},ft:{name:"ft",base:R.LENGTH,prefixes:I.NONE,value:.3048,offset:0},yd:{name:"yd",base:R.LENGTH,prefixes:I.NONE,value:.9144,offset:0},mi:{name:"mi",base:R.LENGTH,prefixes:I.NONE,value:1609.344,offset:0},li:{name:"li",base:R.LENGTH,prefixes:I.NONE,value:.201168,offset:0},rd:{name:"rd",base:R.LENGTH,prefixes:I.NONE,value:5.02921,offset:0},ch:{name:"ch",base:R.LENGTH,prefixes:I.NONE,value:20.1168,offset:0},mil:{name:"mil",base:R.LENGTH,prefixes:I.NONE,value:254e-7,offset:0},m2:{name:"m2",base:R.SURFACE,prefixes:I.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:R.SURFACE,prefixes:I.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:R.SURFACE,prefixes:I.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:R.SURFACE,prefixes:I.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:R.SURFACE,prefixes:I.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:R.SURFACE,prefixes:I.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:R.SURFACE,prefixes:I.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:R.SURFACE,prefixes:I.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:R.SURFACE,prefixes:I.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:R.SURFACE,prefixes:I.NONE,value:1e4,offset:0},m3:{name:"m3",base:R.VOLUME,prefixes:I.CUBIC,value:1,offset:0},L:{name:"L",base:R.VOLUME,prefixes:I.SHORT,value:.001,offset:0},l:{name:"l",base:R.VOLUME,prefixes:I.SHORT,value:.001,offset:0},litre:{name:"litre",base:R.VOLUME,prefixes:I.LONG,value:.001,offset:0},cuin:{name:"cuin",base:R.VOLUME,prefixes:I.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:R.VOLUME,prefixes:I.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:R.VOLUME,prefixes:I.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:R.VOLUME,prefixes:I.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:R.VOLUME,prefixes:I.NONE,value:15e-6,offset:0},drop:{name:"drop",base:R.VOLUME,prefixes:I.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:R.VOLUME,prefixes:I.NONE,value:5e-8,offset:0},minim:{name:"minim",base:R.VOLUME,prefixes:I.NONE,value:6.161152e-8,offset:0},fluiddram:{name:"fluiddram",base:R.VOLUME,prefixes:I.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:R.VOLUME,prefixes:I.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:R.VOLUME,prefixes:I.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:R.VOLUME,prefixes:I.NONE,value:1e-6,offset:0},cup:{name:"cup",base:R.VOLUME,prefixes:I.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:R.VOLUME,prefixes:I.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:R.VOLUME,prefixes:I.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:R.VOLUME,prefixes:I.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:R.VOLUME,prefixes:I.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:R.VOLUME,prefixes:I.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:R.VOLUME,prefixes:I.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:R.VOLUME,prefixes:I.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:R.VOLUME,prefixes:I.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:R.VOLUME,prefixes:I.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:R.VOLUME,prefixes:I.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:R.VOLUME,prefixes:I.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:R.VOLUME,prefixes:I.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:R.VOLUME,prefixes:I.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:R.VOLUME,prefixes:I.NONE,value:.1173478,offset:0},obl:{name:"obl",base:R.VOLUME,prefixes:I.NONE,value:.1589873,offset:0},g:{name:"g",base:R.MASS,prefixes:I.SHORT,value:.001,offset:0},gram:{name:"gram",base:R.MASS,prefixes:I.LONG,value:.001,offset:0},ton:{name:"ton",base:R.MASS,prefixes:I.SHORT,value:907.18474,offset:0},t:{name:"t",base:R.MASS,prefixes:I.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:R.MASS,prefixes:I.LONG,value:1e3,offset:0},grain:{name:"grain",base:R.MASS,prefixes:I.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:R.MASS,prefixes:I.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:R.MASS,prefixes:I.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:R.MASS,prefixes:I.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:R.MASS,prefixes:I.NONE,value:45.359237,offset:0},stick:{name:"stick",base:R.MASS,prefixes:I.NONE,value:.115,offset:0},stone:{name:"stone",base:R.MASS,prefixes:I.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:R.MASS,prefixes:I.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:R.MASS,prefixes:I.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:R.MASS,prefixes:I.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:R.MASS,prefixes:I.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:R.MASS,prefixes:I.NONE,value:45.359237,offset:0},s:{name:"s",base:R.TIME,prefixes:I.SHORT,value:1,offset:0},min:{name:"min",base:R.TIME,prefixes:I.NONE,value:60,offset:0},h:{name:"h",base:R.TIME,prefixes:I.NONE,value:3600,offset:0},second:{name:"second",base:R.TIME,prefixes:I.LONG,value:1,offset:0},sec:{name:"sec",base:R.TIME,prefixes:I.LONG,value:1,offset:0},minute:{name:"minute",base:R.TIME,prefixes:I.NONE,value:60,offset:0},hour:{name:"hour",base:R.TIME,prefixes:I.NONE,value:3600,offset:0},day:{name:"day",base:R.TIME,prefixes:I.NONE,value:86400,offset:0},week:{name:"week",base:R.TIME,prefixes:I.NONE,value:604800,offset:0},month:{name:"month",base:R.TIME,prefixes:I.NONE,value:2629800,offset:0},year:{name:"year",base:R.TIME,prefixes:I.NONE,value:31557600,offset:0},decade:{name:"decade",base:R.TIME,prefixes:I.NONE,value:315576e3,offset:0},century:{name:"century",base:R.TIME,prefixes:I.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:R.TIME,prefixes:I.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:R.FREQUENCY,prefixes:I.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:R.FREQUENCY,prefixes:I.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:R.ANGLE,prefixes:I.SHORT,value:1,offset:0},radian:{name:"radian",base:R.ANGLE,prefixes:I.LONG,value:1,offset:0},deg:{name:"deg",base:R.ANGLE,prefixes:I.SHORT,value:null,offset:0},degree:{name:"degree",base:R.ANGLE,prefixes:I.LONG,value:null,offset:0},grad:{name:"grad",base:R.ANGLE,prefixes:I.SHORT,value:null,offset:0},gradian:{name:"gradian",base:R.ANGLE,prefixes:I.LONG,value:null,offset:0},cycle:{name:"cycle",base:R.ANGLE,prefixes:I.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:R.ANGLE,prefixes:I.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:R.ANGLE,prefixes:I.NONE,value:null,offset:0},A:{name:"A",base:R.CURRENT,prefixes:I.SHORT,value:1,offset:0},ampere:{name:"ampere",base:R.CURRENT,prefixes:I.LONG,value:1,offset:0},K:{name:"K",base:R.TEMPERATURE,prefixes:I.SHORT,value:1,offset:0},degC:{name:"degC",base:R.TEMPERATURE,prefixes:I.SHORT,value:1,offset:273.15},degF:{name:"degF",base:R.TEMPERATURE,prefixes:I.SHORT,value:new D(5,9),offset:459.67},degR:{name:"degR",base:R.TEMPERATURE,prefixes:I.SHORT,value:new D(5,9),offset:0},kelvin:{name:"kelvin",base:R.TEMPERATURE,prefixes:I.LONG,value:1,offset:0},celsius:{name:"celsius",base:R.TEMPERATURE,prefixes:I.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:R.TEMPERATURE,prefixes:I.LONG,value:new D(5,9),offset:459.67},rankine:{name:"rankine",base:R.TEMPERATURE,prefixes:I.LONG,value:new D(5,9),offset:0},mol:{name:"mol",base:R.AMOUNT_OF_SUBSTANCE,prefixes:I.SHORT,value:1,offset:0},mole:{name:"mole",base:R.AMOUNT_OF_SUBSTANCE,prefixes:I.LONG,value:1,offset:0},cd:{name:"cd",base:R.LUMINOUS_INTENSITY,prefixes:I.SHORT,value:1,offset:0},candela:{name:"candela",base:R.LUMINOUS_INTENSITY,prefixes:I.LONG,value:1,offset:0},N:{name:"N",base:R.FORCE,prefixes:I.SHORT,value:1,offset:0},newton:{name:"newton",base:R.FORCE,prefixes:I.LONG,value:1,offset:0},dyn:{name:"dyn",base:R.FORCE,prefixes:I.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:R.FORCE,prefixes:I.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:R.FORCE,prefixes:I.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:R.FORCE,prefixes:I.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:R.FORCE,prefixes:I.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:R.FORCE,prefixes:I.NONE,value:9.80665,offset:0},J:{name:"J",base:R.ENERGY,prefixes:I.SHORT,value:1,offset:0},joule:{name:"joule",base:R.ENERGY,prefixes:I.LONG,value:1,offset:0},erg:{name:"erg",base:R.ENERGY,prefixes:I.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:R.ENERGY,prefixes:I.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:R.ENERGY,prefixes:I.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:R.ENERGY,prefixes:I.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:R.ENERGY,prefixes:I.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:R.POWER,prefixes:I.SHORT,value:1,offset:0},watt:{name:"watt",base:R.POWER,prefixes:I.LONG,value:1,offset:0},hp:{name:"hp",base:R.POWER,prefixes:I.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:R.POWER,prefixes:I.SHORT,value:w.I,offset:0},VA:{name:"VA",base:R.POWER,prefixes:I.SHORT,value:1,offset:0},Pa:{name:"Pa",base:R.PRESSURE,prefixes:I.SHORT,value:1,offset:0},psi:{name:"psi",base:R.PRESSURE,prefixes:I.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:R.PRESSURE,prefixes:I.NONE,value:101325,offset:0},bar:{name:"bar",base:R.PRESSURE,prefixes:I.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:R.PRESSURE,prefixes:I.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:R.PRESSURE,prefixes:I.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:R.PRESSURE,prefixes:I.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:R.PRESSURE,prefixes:I.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:R.ELECTRIC_CHARGE,prefixes:I.LONG,value:1,offset:0},C:{name:"C",base:R.ELECTRIC_CHARGE,prefixes:I.SHORT,value:1,offset:0},farad:{name:"farad",base:R.ELECTRIC_CAPACITANCE,prefixes:I.LONG,value:1,offset:0},F:{name:"F",base:R.ELECTRIC_CAPACITANCE,prefixes:I.SHORT,value:1,offset:0},volt:{name:"volt",base:R.ELECTRIC_POTENTIAL,prefixes:I.LONG,value:1,offset:0},V:{name:"V",base:R.ELECTRIC_POTENTIAL,prefixes:I.SHORT,value:1,offset:0},ohm:{name:"ohm",base:R.ELECTRIC_RESISTANCE,prefixes:I.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:R.ELECTRIC_INDUCTANCE,prefixes:I.LONG,value:1,offset:0},H:{name:"H",base:R.ELECTRIC_INDUCTANCE,prefixes:I.SHORT,value:1,offset:0},siemens:{name:"siemens",base:R.ELECTRIC_CONDUCTANCE,prefixes:I.LONG,value:1,offset:0},S:{name:"S",base:R.ELECTRIC_CONDUCTANCE,prefixes:I.SHORT,value:1,offset:0},weber:{name:"weber",base:R.MAGNETIC_FLUX,prefixes:I.LONG,value:1,offset:0},Wb:{name:"Wb",base:R.MAGNETIC_FLUX,prefixes:I.SHORT,value:1,offset:0},tesla:{name:"tesla",base:R.MAGNETIC_FLUX_DENSITY,prefixes:I.LONG,value:1,offset:0},T:{name:"T",base:R.MAGNETIC_FLUX_DENSITY,prefixes:I.SHORT,value:1,offset:0},b:{name:"b",base:R.BIT,prefixes:I.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:R.BIT,prefixes:I.BINARY_LONG,value:1,offset:0},B:{name:"B",base:R.BIT,prefixes:I.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:R.BIT,prefixes:I.BINARY_LONG,value:8,offset:0}},L={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function U(e){if("BigNumber"===e.number){var t=Af(N);P.rad.value=new N(1),P.deg.value=t.div(180),P.grad.value=t.div(200),P.cycle.value=t.times(2),P.arcsec.value=t.div(648e3),P.arcmin.value=t.div(10800)}else P.rad.value=1,P.deg.value=Math.PI/180,P.grad.value=Math.PI/200,P.cycle.value=2*Math.PI,P.arcsec.value=Math.PI/648e3,P.arcmin.value=Math.PI/10800;P.radian.value=P.rad.value,P.degree.value=P.deg.value,P.gradian.value=P.grad.value}U(u),a&&a("config",(function(e,t){e.number!==t.number&&U(e)}));var $={si:{NONE:{unit:j,prefix:I.NONE[""]},LENGTH:{unit:P.m,prefix:I.SHORT[""]},MASS:{unit:P.g,prefix:I.SHORT.k},TIME:{unit:P.s,prefix:I.SHORT[""]},CURRENT:{unit:P.A,prefix:I.SHORT[""]},TEMPERATURE:{unit:P.K,prefix:I.SHORT[""]},LUMINOUS_INTENSITY:{unit:P.cd,prefix:I.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:P.mol,prefix:I.SHORT[""]},ANGLE:{unit:P.rad,prefix:I.SHORT[""]},BIT:{unit:P.bits,prefix:I.SHORT[""]},FORCE:{unit:P.N,prefix:I.SHORT[""]},ENERGY:{unit:P.J,prefix:I.SHORT[""]},POWER:{unit:P.W,prefix:I.SHORT[""]},PRESSURE:{unit:P.Pa,prefix:I.SHORT[""]},ELECTRIC_CHARGE:{unit:P.C,prefix:I.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:P.F,prefix:I.SHORT[""]},ELECTRIC_POTENTIAL:{unit:P.V,prefix:I.SHORT[""]},ELECTRIC_RESISTANCE:{unit:P.ohm,prefix:I.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:P.H,prefix:I.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:P.S,prefix:I.SHORT[""]},MAGNETIC_FLUX:{unit:P.Wb,prefix:I.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:P.T,prefix:I.SHORT[""]},FREQUENCY:{unit:P.Hz,prefix:I.SHORT[""]}}};$.cgs=JSON.parse(JSON.stringify($.si)),$.cgs.LENGTH={unit:P.m,prefix:I.SHORT.c},$.cgs.MASS={unit:P.g,prefix:I.SHORT[""]},$.cgs.FORCE={unit:P.dyn,prefix:I.SHORT[""]},$.cgs.ENERGY={unit:P.erg,prefix:I.NONE[""]},$.us=JSON.parse(JSON.stringify($.si)),$.us.LENGTH={unit:P.ft,prefix:I.NONE[""]},$.us.MASS={unit:P.lbm,prefix:I.NONE[""]},$.us.TEMPERATURE={unit:P.degF,prefix:I.NONE[""]},$.us.FORCE={unit:P.lbf,prefix:I.NONE[""]},$.us.ENERGY={unit:P.BTU,prefix:I.BTU[""]},$.us.POWER={unit:P.hp,prefix:I.NONE[""]},$.us.PRESSURE={unit:P.psi,prefix:I.NONE[""]},$.auto=JSON.parse(JSON.stringify($.si));var G=$.auto;for(var V in A.setUnitSystem=function(e){if(!Ae($,e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys($).join(", "));G=$[e]},A.getUnitSystem=function(){for(var e in $)if(Ae($,e)&&$[e]===G)return e},A.typeConverters={BigNumber:function(e){return null!=e&&e.isFraction?new N(e.n).div(e.d).times(e.s):new N(e+"")},Fraction:function(e){return new D(e)},Complex:function(e){return e},number:function(e){return null!=e&&e.isFraction?b(e):e}},A.prototype._numberConverter=function(){var e=A.typeConverters[this.valueType()];if(e)return e;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},A._getNumberConverter=function(e){if(!A.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return A.typeConverters[e]},P)if(Ae(P,V)){var Z=P[V];Z.dimensions=Z.base.dimensions}for(var W in L)if(Ae(L,W)){var Y=P[L[W]],J={};for(var X in Y)Ae(Y,X)&&(J[X]=Y[X]);J.name=W,P[W]=J}return A.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},A.createUnit=function(e,r){if("object"!==t(e))throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(r&&r.override)for(var n in e)if(Ae(e,n)&&A.deleteUnit(n),e[n].aliases)for(var i=0;i<e[n].aliases.length;i++)A.deleteUnit(e[n].aliases[i]);var a;for(var o in e)Ae(e,o)&&(a=A.createUnitSingle(o,e[o]));return a},A.createUnitSingle=function(e,r){if(null==r&&(r={}),"string"!=typeof e)throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(Ae(P,e))throw new Error('Cannot create unit "'+e+'": a unit with that name already exists');!function(e){for(var t=0;t<e.length;t++){if(i=e.charAt(t),0===t&&!A.isValidAlpha(i))throw new Error('Invalid unit name (must begin with alpha character): "'+e+'"');if(t>0&&!A.isValidAlpha(i)&&!C(i))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}}(e);var n,a,o,u=null,s=[],c=0;if(r&&"Unit"===r.type)u=r.clone();else if("string"==typeof r)""!==r&&(n=r);else{if("object"!==t(r))throw new TypeError('Cannot create unit "'+e+'" from "'+r.toString()+'": expecting "string" or "Unit" or "Object"');n=r.definition,a=r.prefixes,c=r.offset,o=r.baseName,r.aliases&&(s=r.aliases.valueOf())}if(s)for(var f=0;f<s.length;f++)if(Ae(P,s[f]))throw new Error('Cannot create alias "'+s[f]+'": a unit with that name already exists');if(n&&"string"==typeof n&&!u)try{u=A.parse(n,{allowNoUnits:!0})}catch(t){throw t.message='Could not create unit "'+e+'" from "'+n+'": '+t.message,t}else n&&"Unit"===n.type&&(u=n.clone());s=s||[],c=c||0,a=a&&a.toUpperCase&&I[a.toUpperCase()]||I.NONE;var l={};if(u){l={name:e,value:u.value,dimensions:u.dimensions.slice(0),prefixes:a,offset:c};var p=!1;for(var m in R)if(Ae(R,m)){for(var h=!0,d=0;d<z.length;d++)if(Math.abs((l.dimensions[d]||0)-(R[m].dimensions[d]||0))>1e-12){h=!1;break}if(h){p=!0,l.base=R[m];break}}if(!p){o=o||e+"_STUFF";var v={dimensions:u.dimensions.slice(0)};v.key=o,R[o]=v,G[o]={unit:l,prefix:I.NONE[""]},l.base=R[o]}}else{if(o=o||e+"_STUFF",z.indexOf(o)>=0)throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');for(var y in z.push(o),R)Ae(R,y)&&(R[y].dimensions[z.length-1]=0);for(var g={dimensions:[]},x=0;x<z.length;x++)g.dimensions[x]=0;g.dimensions[z.length-1]=1,g.key=o,R[o]=g,l={name:e,value:1,dimensions:R[o].dimensions.slice(0),prefixes:a,offset:c,base:R[o]},G[o]={unit:l,prefix:I.NONE[""]}}A.UNITS[e]=l;for(var b=0;b<s.length;b++){var w=s[b],N={};for(var D in l)Ae(l,D)&&(N[D]=l[D]);N.name=w,A.UNITS[w]=N}return delete B.cache,new A(null,e)},A.deleteUnit=function(e){delete A.UNITS[e],delete B.cache},A.PREFIXES=I,A.BASE_DIMENSIONS=z,A.BASE_UNITS=R,A.UNIT_SYSTEMS=$,A.UNITS=P,A}),{isClass:!0}),Tf="unit",_f=Ce(Tf,["typed","Unit"],(function(e){var t=e.typed,r=e.Unit;return t(Tf,{Unit:function(e){return e.clone()},string:function(e){return r.isValuelessUnit(e)?new r(null,e):r.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(e,t){return new r(e,t)},"number | BigNumber | Fraction":function(e){return new r(e)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),Bf="sparse",kf=Ce(Bf,["typed","SparseMatrix"],(function(e){var t=e.typed,r=e.SparseMatrix;return t(Bf,{"":function(){return new r([])},string:function(e){return new r([],e)},"Array | Matrix":function(e){return new r(e)},"Array | Matrix, string":function(e,t){return new r(e,t)}})})),If="createUnit",zf=Ce(If,["typed","Unit"],(function(e){var t=e.typed,r=e.Unit;return t(If,{"Object, Object":function(e,t){return r.createUnit(e,t)},Object:function(e){return r.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,n){var i={};return i[e]=t,r.createUnit(i,n)},"string, Unit | string | Object":function(e,t){var n={};return n[e]=t,r.createUnit(n,{})},string:function(e){var t={};return t[e]={},r.createUnit(t,{})}})})),Rf="acos",qf=Ce(Rf,["typed","config","Complex"],(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(Rf,{number:function(e){return e>=-1&&e<=1||r.predictable?Math.acos(e):new n(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()}})})),jf="number";function Pf(e){return ce(e)}function Lf(e){return Math.atan(1/e)}function Uf(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function $f(e){return Math.asin(1/e)}function Hf(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}function Gf(e){return Math.acos(1/e)}function Vf(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}function Zf(e){return fe(e)}function Wf(e){return le(e)}function Yf(e){return 1/Math.tan(e)}function Jf(e){var t=Math.exp(2*e);return(t+1)/(t-1)}function Xf(e){return 1/Math.sin(e)}function Qf(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Z(e)}function Kf(e){return 1/Math.cos(e)}function el(e){return 2/(Math.exp(e)+Math.exp(-e))}function tl(e){return me(e)}Pf.signature=jf,Lf.signature=jf,Uf.signature=jf,$f.signature=jf,Hf.signature=jf,Gf.signature=jf,Vf.signature=jf,Zf.signature=jf,Wf.signature=jf,Yf.signature=jf,Jf.signature=jf,Xf.signature=jf,Qf.signature=jf,Kf.signature=jf,el.signature=jf,tl.signature=jf;var rl="acosh",nl=Ce(rl,["typed","config","Complex"],(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(rl,{number:function(e){return e>=1||r.predictable?Pf(e):e<=-1?new n(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new n(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()}})})),il="acot",al=Ce(il,["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t(il,{number:Lf,Complex:function(e){return e.acot()},BigNumber:function(e){return new r(1).div(e).atan()}})})),ol="acoth",ul=Ce(ol,["typed","config","Complex","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber;return t(ol,{number:function(e){return e>=1||e<=-1||r.predictable?Uf(e):new n(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new i(1).div(e).atanh()}})})),sl="acsc",cl=Ce(sl,["typed","config","Complex","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber;return t(sl,{number:function(e){return e<=-1||e>=1||r.predictable?$f(e):new n(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new i(1).div(e).asin()}})})),fl="acsch",ll=Ce(fl,["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t(fl,{number:Hf,Complex:function(e){return e.acsch()},BigNumber:function(e){return new r(1).div(e).asinh()}})})),pl="asec",ml=Ce(pl,["typed","config","Complex","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber;return t(pl,{number:function(e){return e<=-1||e>=1||r.predictable?Gf(e):new n(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new i(1).div(e).acos()}})})),hl="asech",dl=Ce(hl,["typed","config","Complex","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber;return t(hl,{number:function(e){if(e<=1&&e>=-1||r.predictable){var t=1/e;if(t>0||r.predictable)return Vf(e);var i=Math.sqrt(t*t-1);return new n(Math.log(i-t),Math.PI)}return new n(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new i(1).div(e).acosh()}})})),vl="asin",yl=Ce(vl,["typed","config","Complex"],(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(vl,{number:function(e){return e>=-1&&e<=1||r.predictable?Math.asin(e):new n(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()}})})),gl=Ce("asinh",["typed"],(function(e){return(0,e.typed)("asinh",{number:Zf,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()}})})),xl=Ce("atan",["typed"],(function(e){return(0,e.typed)("atan",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()}})})),bl="atan2",wl=Ce(bl,["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.BigNumber,a=e.DenseMatrix,o=e.concat,u=Wa({typed:t,equalScalar:n}),s=Ya({typed:t}),c=Bo({typed:t,equalScalar:n}),f=Ca({typed:t,equalScalar:n}),l=Ma({typed:t,DenseMatrix:a}),p=Ka({typed:t,matrix:r,concat:o});return t(bl,{"number, number":Math.atan2,"BigNumber, BigNumber":function(e,t){return i.atan2(e,t)}},p({scalar:"number | BigNumber",SS:c,DS:s,SD:u,Ss:f,sS:l}))})),Nl="atanh",Dl=Ce(Nl,["typed","config","Complex"],(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(Nl,{number:function(e){return e<=1&&e>=-1||r.predictable?Wf(e):new n(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()}})})),El=Ce("trigUnit",["typed"],(function(e){var t=e.typed;return{Unit:t.referToSelf((function(e){return function(r){if(!r.hasBase(r.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(e,r.valueType())(r.value)}}))}})),Al=Ce("cos",["typed"],(function(e){var t=e.typed,r=El({typed:t});return t("cos",{number:Math.cos,"Complex | BigNumber":function(e){return e.cos()}},r)})),Sl="cosh",Cl=Ce(Sl,["typed"],(function(e){return(0,e.typed)(Sl,{number:pe,"Complex | BigNumber":function(e){return e.cosh()}})})),Ml=Ce("cot",["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t("cot",{number:Yf,Complex:function(e){return e.cot()},BigNumber:function(e){return new r(1).div(e.tan())}},El({typed:t}))})),Fl="coth",Ol=Ce(Fl,["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t(Fl,{number:Jf,Complex:function(e){return e.coth()},BigNumber:function(e){return new r(1).div(e.tanh())}})})),Tl=Ce("csc",["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t("csc",{number:Xf,Complex:function(e){return e.csc()},BigNumber:function(e){return new r(1).div(e.sin())}},El({typed:t}))})),_l="csch",Bl=Ce(_l,["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t(_l,{number:Qf,Complex:function(e){return e.csch()},BigNumber:function(e){return new r(1).div(e.sinh())}})})),kl=Ce("sec",["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t("sec",{number:Kf,Complex:function(e){return e.sec()},BigNumber:function(e){return new r(1).div(e.cos())}},El({typed:t}))})),Il="sech",zl=Ce(Il,["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t(Il,{number:el,Complex:function(e){return e.sech()},BigNumber:function(e){return new r(1).div(e.cosh())}})})),Rl=Ce("sin",["typed"],(function(e){var t=e.typed,r=El({typed:t});return t("sin",{number:Math.sin,"Complex | BigNumber":function(e){return e.sin()}},r)})),ql="sinh",jl=Ce(ql,["typed"],(function(e){return(0,e.typed)(ql,{number:tl,"Complex | BigNumber":function(e){return e.sinh()}})})),Pl=Ce("tan",["typed"],(function(e){var t=e.typed,r=El({typed:t});return t("tan",{number:Math.tan,"Complex | BigNumber":function(e){return e.tan()}},r)})),Ll=Ce("tanh",["typed"],(function(e){return(0,e.typed)("tanh",{number:he,"Complex | BigNumber":function(e){return e.tanh()}})})),Ul="setCartesian",$l=Ce(Ul,["typed","size","subset","compareNatural","Index","DenseMatrix"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index,o=e.DenseMatrix;return t(Ul,{"Array | Matrix, Array | Matrix":function(e,t){var u=[];if(0!==n(r(e),new a(0))&&0!==n(r(t),new a(0))){var s=An(Array.isArray(e)?e:e.toArray()).sort(i),c=An(Array.isArray(t)?t:t.toArray()).sort(i);u=[];for(var f=0;f<s.length;f++)for(var l=0;l<c.length;l++)u.push([s[f],c[l]])}return Array.isArray(e)&&Array.isArray(t)?u:new o(u)}})})),Hl="setDifference",Gl=Ce(Hl,["typed","size","subset","compareNatural","Index","DenseMatrix"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index,o=e.DenseMatrix;return t(Hl,{"Array | Matrix, Array | Matrix":function(e,t){var u;if(0===n(r(e),new a(0)))u=[];else{if(0===n(r(t),new a(0)))return An(e.toArray());var s,c=Tn(An(Array.isArray(e)?e:e.toArray()).sort(i)),f=Tn(An(Array.isArray(t)?t:t.toArray()).sort(i));u=[];for(var l=0;l<c.length;l++){s=!1;for(var p=0;p<f.length;p++)if(0===i(c[l].value,f[p].value)&&c[l].identifier===f[p].identifier){s=!0;break}s||u.push(c[l])}}return Array.isArray(e)&&Array.isArray(t)?_n(u):new o(_n(u))}})})),Vl="setDistinct",Zl=Ce(Vl,["typed","size","subset","compareNatural","Index","DenseMatrix"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index,o=e.DenseMatrix;return t(Vl,{"Array | Matrix":function(e){var t;if(0===n(r(e),new a(0)))t=[];else{var u=An(Array.isArray(e)?e:e.toArray()).sort(i);(t=[]).push(u[0]);for(var s=1;s<u.length;s++)0!==i(u[s],u[s-1])&&t.push(u[s])}return Array.isArray(e)?t:new o(t)}})})),Wl="setIntersect",Yl=Ce(Wl,["typed","size","subset","compareNatural","Index","DenseMatrix"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index,o=e.DenseMatrix;return t(Wl,{"Array | Matrix, Array | Matrix":function(e,t){var u;if(0===n(r(e),new a(0))||0===n(r(t),new a(0)))u=[];else{var s=Tn(An(Array.isArray(e)?e:e.toArray()).sort(i)),c=Tn(An(Array.isArray(t)?t:t.toArray()).sort(i));u=[];for(var f=0;f<s.length;f++)for(var l=0;l<c.length;l++)if(0===i(s[f].value,c[l].value)&&s[f].identifier===c[l].identifier){u.push(s[f]);break}}return Array.isArray(e)&&Array.isArray(t)?_n(u):new o(_n(u))}})})),Jl="setIsSubset",Xl=Ce(Jl,["typed","size","subset","compareNatural","Index"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index;return t(Jl,{"Array | Matrix, Array | Matrix":function(e,t){if(0===n(r(e),new a(0)))return!0;if(0===n(r(t),new a(0)))return!1;for(var o,u=Tn(An(Array.isArray(e)?e:e.toArray()).sort(i)),s=Tn(An(Array.isArray(t)?t:t.toArray()).sort(i)),c=0;c<u.length;c++){o=!1;for(var f=0;f<s.length;f++)if(0===i(u[c].value,s[f].value)&&u[c].identifier===s[f].identifier){o=!0;break}if(!1===o)return!1}return!0}})})),Ql="setMultiplicity",Kl=Ce(Ql,["typed","size","subset","compareNatural","Index"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index;return t(Ql,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===n(r(t),new a(0)))return 0;for(var o=An(Array.isArray(t)?t:t.toArray()),u=0,s=0;s<o.length;s++)0===i(o[s],e)&&u++;return u}})})),ep="setPowerset",tp=Ce(ep,["typed","size","subset","compareNatural","Index"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index;return t(ep,{"Array | Matrix":function(e){if(0===n(r(e),new a(0)))return[];for(var t=An(Array.isArray(e)?e:e.toArray()).sort(i),u=[],s=0;s.toString(2).length<=t.length;)u.push(o(t,s.toString(2).split("").reverse())),s++;return function(e){for(var t=[],r=e.length-1;r>0;r--)for(var n=0;n<r;n++)e[n].length>e[n+1].length&&(t=e[n],e[n]=e[n+1],e[n+1]=t);return e}(u)}});function o(e,t){for(var r=[],n=0;n<t.length;n++)"1"===t[n]&&r.push(e[n]);return r}})),rp="setSize",np=Ce(rp,["typed","compareNatural"],(function(e){var t=e.typed,r=e.compareNatural;return t(rp,{"Array | Matrix":function(e){return Array.isArray(e)?An(e).length:An(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return Array.isArray(e)?An(e).length:An(e.toArray()).length;for(var n=An(Array.isArray(e)?e:e.toArray()).sort(r),i=1,a=1;a<n.length;a++)0!==r(n[a],n[a-1])&&i++;return i}})})),ip="setSymDifference",ap=Ce(ip,["typed","size","concat","subset","setDifference","Index"],(function(e){var t=e.typed,r=e.size,n=e.concat,i=e.subset,a=e.setDifference,o=e.Index;return t(ip,{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(r(e),new o(0)))return An(t);if(0===i(r(t),new o(0)))return An(e);var u=An(e),s=An(t);return n(a(u,s),a(s,u))}})})),op="setUnion",up=Ce(op,["typed","size","concat","subset","setIntersect","setSymDifference","Index"],(function(e){var t=e.typed,r=e.size,n=e.concat,i=e.subset,a=e.setIntersect,o=e.setSymDifference,u=e.Index;return t(op,{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(r(e),new u(0)))return An(t);if(0===i(r(t),new u(0)))return An(e);var s=An(e),c=An(t);return n(o(s,c),a(s,c))}})})),sp=Ce("add",["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.addScalar,i=e.equalScalar,a=e.DenseMatrix,o=(e.SparseMatrix,e.concat),u=to({typed:t}),s=ro({typed:t,equalScalar:i}),c=no({typed:t,DenseMatrix:a}),f=Ka({typed:t,matrix:r,concat:o});return t("add",{"any, any":n,"any, any, ...any":t.referToSelf((function(e){return function(t,r,n){for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i}}))},f({elop:n,DS:u,SS:s,Ss:c}))})),cp="hypot",fp=Ce(cp,["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],(function(e){var t=e.typed,r=e.abs,n=e.addScalar,i=e.divideScalar,a=e.multiplyScalar,u=e.sqrt,s=e.smaller,c=e.isPositive;return t(cp,{"... number | BigNumber":f,Array:f,Matrix:function(e){return f(An(e.toArray()))}});function f(e){for(var t=0,f=0,l=0;l<e.length;l++){if(o(e[l]))throw new TypeError("Unexpected type of argument to hypot");var p=r(e[l]);s(f,p)?(t=a(t,a(i(f,p),i(f,p))),t=n(t,1),f=p):t=n(t,c(p)?a(i(p,f),i(p,f)):p)}return a(f,u(t))}})),lp="norm",pp=Ce(lp,["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],(function(e){var t=e.typed,r=e.abs,n=e.add,i=e.pow,a=e.conj,o=e.sqrt,u=e.multiply,s=e.equalScalar,c=e.larger,f=e.smaller,l=e.matrix,p=e.ctranspose,m=e.eigs;return t(lp,{number:Math.abs,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},boolean:function(e){return Math.abs(e)},Array:function(e){return h(l(e),2)},Matrix:function(e){return h(e,2)},"Array, number | BigNumber | string":function(e,t){return h(l(e),t)},"Matrix, number | BigNumber | string":function(e,t){return h(e,t)}});function h(e,t){var l=e.size();if(1===l.length)return function(e,t){if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){var t=0;return e.forEach((function(e){var n=r(e);c(n,t)&&(t=n)}),!0),t}(e);if(t===Number.NEGATIVE_INFINITY||"-inf"===t)return function(e){var t;return e.forEach((function(e){var n=r(e);t&&!f(n,t)||(t=n)}),!0),t||0}(e);if("fro"===t)return h(e,2);if("number"==typeof t&&!isNaN(t)){if(!s(t,0)){var a=0;return e.forEach((function(e){a=n(i(r(e),t),a)}),!0),i(a,1/t)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}(e,t);if(2===l.length){if(l[0]&&l[1])return function(e,t){if(1===t)return function(e){var t=[],i=0;return e.forEach((function(e,a){var o=a[1],u=n(t[o]||0,r(e));c(u,i)&&(i=u),t[o]=u}),!0),i}(e);if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){var t=[],i=0;return e.forEach((function(e,a){var o=a[0],u=n(t[o]||0,r(e));c(u,i)&&(i=u),t[o]=u}),!0),i}(e);if("fro"===t)return function(e){var t=0;return e.forEach((function(e,r){t=n(t,u(e,a(e)))})),r(o(t))}(e);if(2===t)return function(e){var t=e.size();if(t[0]!==t[1])throw new RangeError("Invalid matrix dimensions");var n=p(e),i=u(n,e),a=m(i).values.toArray(),s=a[a.length-1];return r(o(s))}(e);throw new Error("Unsupported parameter value "+t)}(e,t);throw new RangeError("Invalid matrix dimensions")}}})),mp=Ce("dot",["typed","addScalar","multiplyScalar","conj","size"],(function(e){var t=e.typed,r=e.addScalar,n=e.multiplyScalar,i=e.conj,a=e.size;return t("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,a){var s=o(e,a),c=l(e)?e._data:e,f=l(e)?e._datatype||e.getDataType():void 0,p=l(a)?a._data:a,m=l(a)?a._datatype||a.getDataType():void 0,h=2===u(e).length,d=2===u(a).length,v=r,y=n;if(f&&m&&f===m&&"string"==typeof f&&"mixed"!==f){var g=f;v=t.find(r,[g,g]),y=t.find(n,[g,g])}if(!h&&!d){for(var x=y(i(c[0]),p[0]),b=1;b<s;b++)x=v(x,y(i(c[b]),p[b]));return x}if(!h&&d){for(var w=y(i(c[0]),p[0][0]),N=1;N<s;N++)w=v(w,y(i(c[N]),p[N][0]));return w}if(h&&!d){for(var D=y(i(c[0][0]),p[0]),E=1;E<s;E++)D=v(D,y(i(c[E][0]),p[E]));return D}if(h&&d){for(var A=y(i(c[0][0]),p[0][0]),S=1;S<s;S++)A=v(A,y(i(c[S][0]),p[S][0]));return A}},"SparseMatrix, SparseMatrix":function(e,t){o(e,t);for(var i=e._index,a=e._values,u=t._index,s=t._values,c=0,f=r,l=n,p=0,m=0;p<i.length&&m<u.length;){var h=i[p],d=u[m];h<d?p++:h>d?m++:h===d&&(c=f(c,l(a[p],s[m])),p++,m++)}return c}});function o(e,t){var r,n,i=u(e),a=u(t);if(1===i.length)r=i[0];else{if(2!==i.length||1!==i[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+i.join(", ")+")");r=i[0]}if(1===a.length)n=a[0];else{if(2!==a.length||1!==a[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+a.join(", ")+")");n=a[0]}if(r!==n)throw new RangeError("Vectors must have equal length ("+r+" != "+n+")");if(0===r)throw new RangeError("Cannot calculate the dot product of empty vectors");return r}function u(e){return l(e)?e.size():a(e)}})),hp=Ce("trace",["typed","matrix","add"],(function(e){var t=e.typed,r=e.matrix,n=e.add;return t("trace",{Array:function(e){return i(r(e))},SparseMatrix:function(e){var t=e._values,r=e._index,i=e._ptr,a=e._size,o=a[0],u=a[1];if(o===u){var s=0;if(t.length>0)for(var c=0;c<u;c++)for(var f=i[c],l=i[c+1],p=f;p<l;p++){var m=r[p];if(m===c){s=n(s,t[p]);break}if(m>c)break}return s}throw new RangeError("Matrix must be square (size: "+tn(a)+")")},DenseMatrix:i,any:ye});function i(e){var t=e._size,r=e._data;switch(t.length){case 1:if(1===t[0])return ye(r[0]);throw new RangeError("Matrix must be square (size: "+tn(t)+")");case 2:var i=t[0];if(i===t[1]){for(var a=0,o=0;o<i;o++)a=n(a,r[o][o]);return a}throw new RangeError("Matrix must be square (size: "+tn(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+tn(t)+")")}}})),dp="index",vp=Ce(dp,["typed","Index"],(function(e){var t=e.typed,r=e.Index;return t(dp,{"...number | string | BigNumber | Range | Array | Matrix":function(e){var t=e.map((function(e){return a(e)?e.toNumber():f(e)||l(e)?e.map((function(e){return a(e)?e.toNumber():e})):e})),n=new r;return r.apply(n,t),n}})})),yp=new Set(["end"]),gp=Ce("Node",["mathWithTransform"],(function(e){var r=e.mathWithTransform;return function(){function e(){Be(this,e)}return ze(e,[{key:"type",get:function(){return"Node"}},{key:"isNode",get:function(){return!0}},{key:"evaluate",value:function(e){return this.compile().evaluate(e)}},{key:"compile",value:function(){var e=this._compile(r,{}),t={};return{evaluate:function(r){var n=Je(r);return function(e){for(var t=0,r=_e(yp);t<r.length;t++){var n=r[t];if(e.has(n))throw new Error('Scope contains an illegal symbol, "'+n+'" is a reserved keyword')}}(n),e(n,t,null)}}}},{key:"_compile",value:function(e,t){throw new Error("Method _compile must be implemented by type "+this.type)}},{key:"forEach",value:function(e){throw new Error("Cannot run forEach on a Node interface")}},{key:"map",value:function(e){throw new Error("Cannot run map on a Node interface")}},{key:"_ifNode",value:function(e){if(!z(e))throw new TypeError("Callback function must return a Node");return e}},{key:"traverse",value:function(e){e(this,null,null),function e(t,r){t.forEach((function(t,n,i){r(t,n,i),e(t,r)}))}(this,e)}},{key:"transform",value:function(e){return function t(r,n,i){var a=e(r,n,i);return a!==r?a:r.map(t)}(this,null,null)}},{key:"filter",value:function(e){var t=[];return this.traverse((function(r,n,i){e(r,n,i)&&t.push(r)})),t}},{key:"clone",value:function(){throw new Error("Cannot clone a Node interface")}},{key:"cloneDeep",value:function(){return this.map((function(e){return e.cloneDeep()}))}},{key:"equals",value:function(e){return!!e&&this.type===e.type&&we(this,e)}},{key:"toString",value:function(e){var t=this._getCustomString(e);return void 0!==t?t:this._toString(e)}},{key:"_toString",value:function(){throw new Error("_toString not implemented for "+this.type)}},{key:"toJSON",value:function(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}},{key:"toHTML",value:function(e){var t=this._getCustomString(e);return void 0!==t?t:this._toHTML(e)}},{key:"_toHTML",value:function(){throw new Error("_toHTML not implemented for "+this.type)}},{key:"toTex",value:function(e){var t=this._getCustomString(e);return void 0!==t?t:this._toTex(e)}},{key:"_toTex",value:function(e){throw new Error("_toTex not implemented for "+this.type)}},{key:"_getCustomString",value:function(e){if(e&&"object"===t(e))switch(t(e.handler)){case"object":case"undefined":return;case"function":return e.handler(this,e);default:throw new TypeError("Object or function expected as callback")}}},{key:"getIdentifier",value:function(){return this.type}},{key:"getContent",value:function(){return this}}]),e}()}),{isClass:!0,isNode:!0});function xp(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function bp(e){return bp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bp(e)}function wp(e,t){return wp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wp(e,t)}function Np(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wp(e,t)}function Dp(e){return e&&e.isIndexError?new cn(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function Ep(e){var r=e.subset;return function(e,n){try{if(Array.isArray(e))return r(e,n);if(e&&"function"==typeof e.subset)return e.subset(n);if("string"==typeof e)return r(e,n);if("object"===t(e)){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return Re(e,n.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw Dp(e)}}}function Ap(e,t,r){return t=bp(t),xp(e,Sp()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function Sp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sp=function(){return!!e})()}r(825),r(5472);var Cp="AccessorNode",Mp=Ce(Cp,["subset","Node"],(function(e){var t=e.subset,r=e.Node,n=Ep({subset:t});function i(e){return!(S(e)||C(e)||T(e)||k(e)||R(e)||j(e)||U(e))}var a=function(e){function t(e,r){var n;if(Be(this,t),n=Ap(this,t),!z(e))throw new TypeError('Node expected for parameter "object"');if(!I(r))throw new TypeError('IndexNode expected for parameter "index"');return n.object=e,n.index=r,n}return Np(t,e),ze(t,[{key:"name",get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}},{key:"type",get:function(){return Cp}},{key:"isAccessorNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r=this.object._compile(e,t),i=this.index._compile(e,t);if(this.index.isObjectProperty()){var a=this.index.getObjectProperty();return function(e,t,n){return Re(r(e,t,n),a)}}return function(e,t,a){var o=r(e,t,a),u=i(e,t,o);return n(o,u)}}},{key:"forEach",value:function(e){e(this.object,"object",this),e(this.index,"index",this)}},{key:"map",value:function(e){return new t(this._ifNode(e(this.object,"object",this)),this._ifNode(e(this.index,"index",this)))}},{key:"clone",value:function(){return new t(this.object,this.index)}},{key:"_toString",value:function(e){var t=this.object.toString(e);return i(this.object)&&(t="("+t+")"),t+this.index.toString(e)}},{key:"_toHTML",value:function(e){var t=this.object.toHTML(e);return i(this.object)&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+this.index.toHTML(e)}},{key:"_toTex",value:function(e){var t=this.object.toTex(e);return i(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)}},{key:"toJSON",value:function(){return{mathjs:Cp,object:this.object,index:this.index}}}],[{key:"fromJSON",value:function(e){return new t(e.object,e.index)}}]),t}(r);return Za(a,"name",Cp),a}),{isClass:!0,isNode:!0});function Fp(e,t,r){return t=bp(t),xp(e,Op()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function Op(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Op=function(){return!!e})()}var Tp="ArrayNode",_p=Ce(Tp,["Node"],(function(e){var t=function(e){function t(e){var r;if(Be(this,t),(r=Fp(this,t)).items=e||[],!Array.isArray(r.items)||!r.items.every(z))throw new TypeError("Array containing Nodes expected");return r}return Np(t,e),ze(t,[{key:"type",get:function(){return Tp}},{key:"isArrayNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r=Sn(this.items,(function(r){return r._compile(e,t)}));if("Array"!==e.config.matrix){var n=e.matrix;return function(e,t,i){return n(Sn(r,(function(r){return r(e,t,i)})))}}return function(e,t,n){return Sn(r,(function(r){return r(e,t,n)}))}}},{key:"forEach",value:function(e){for(var t=0;t<this.items.length;t++)e(this.items[t],"items["+t+"]",this)}},{key:"map",value:function(e){for(var r=[],n=0;n<this.items.length;n++)r[n]=this._ifNode(e(this.items[n],"items["+n+"]",this));return new t(r)}},{key:"clone",value:function(){return new t(this.items.slice(0))}},{key:"_toString",value:function(e){return"["+this.items.map((function(t){return t.toString(e)})).join(", ")+"]"}},{key:"toJSON",value:function(){return{mathjs:Tp,items:this.items}}},{key:"_toHTML",value:function(e){return'<span class="math-parenthesis math-square-parenthesis">[</span>'+this.items.map((function(t){return t.toHTML(e)})).join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}},{key:"_toTex",value:function(e){return function t(r,n){var i=r.some(C)&&!r.every(C),a=n||i,o=a?"&":"\\\\",u=r.map((function(r){return r.items?t(r.items,!n):r.toTex(e)})).join(o);return i||!a||a&&!n?"\\begin{bmatrix}"+u+"\\end{bmatrix}":u}(this.items,!1)}}],[{key:"fromJSON",value:function(e){return new t(e.items)}}]),t}(e.Node);return Za(t,"name",Tp),t}),{isClass:!0,isNode:!0});function Bp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var kp=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Ip(e,t){if(!t||"auto"!==t)return e;for(var r=e;j(r);)r=r.content;return r}function zp(e,t,r,n){var i=e;"keep"!==t&&(i=e.getContent());for(var a=i.getIdentifier(),o=null,u=0;u<kp.length;u++)if(a in kp[u]){o=u;break}if("OperatorNode:multiply"===a&&i.implicit&&"show"!==r){var s=Ip(i.args[0],t);T(s)&&n&&"OperatorNode:divide"===n.getIdentifier()&&_(Ip(n.args[0],t))||"OperatorNode:divide"===s.getIdentifier()&&_(Ip(s.args[0],t))&&T(Ip(s.args[1]))||(o+=1)}return o}function Rp(e,t){var r=e;"keep"!==t&&(r=e.getContent());var n=r.getIdentifier(),i=zp(r,t);if(null===i)return null;var a=kp[i][n];if(Ae(a,"associativity")){if("left"===a.associativity)return"left";if("right"===a.associativity)return"right";throw Error("'"+n+"' has the invalid associativity '"+a.associativity+"'.")}return null}function qp(e,t,r){var n="keep"!==r?e.getContent():e,i="keep"!==r?e.getContent():t,a=n.getIdentifier(),o=i.getIdentifier(),u=zp(n,r);if(null===u)return null;var s=kp[u][a];if(Ae(s,"associativeWith")&&s.associativeWith instanceof Array){for(var c=0;c<s.associativeWith.length;c++)if(s.associativeWith[c]===o)return!0;return!1}return null}function jp(e,t,r){return t=bp(t),xp(e,Pp()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function Pp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pp=function(){return!!e})()}var Lp="AssignmentNode",Up=Ce(Lp,["subset","?matrix","Node"],(function(e){var r=e.subset,n=e.matrix,i=e.Node,a=Ep({subset:r}),o=function(e){var r=e.subset,n=e.matrix;return function(e,i,a){try{if(Array.isArray(e))return n(e).subset(i,a).valueOf().forEach((function(t,r){e[r]=t})),e;if(e&&"function"==typeof e.subset)return e.subset(i,a);if("string"==typeof e)return r(e,i,a);if("object"===t(e)){if(!i.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return qe(e,i.getObjectProperty(),a),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw Dp(e)}}}({subset:r,matrix:n});function u(e,t,r){t||(t="keep");var n=zp(e,t,r),i=zp(e.value,t,r);return"all"===t||null!==i&&i<=n}var s=function(e){function t(e,r,n){var i;if(Be(this,t),(i=jp(this,t)).object=e,i.index=n?r:null,i.value=n||r,!U(e)&&!S(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(U(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(i.index&&!I(i.index))throw new TypeError('IndexNode expected as "index"');if(!z(i.value))throw new TypeError('Node expected as "value"');return i}return Np(t,e),ze(t,[{key:"name",get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}},{key:"type",get:function(){return Lp}},{key:"isAssignmentNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r=this.object._compile(e,t),n=this.index?this.index._compile(e,t):null,i=this.value._compile(e,t),u=this.object.name;if(this.index){if(this.index.isObjectProperty()){var s=this.index.getObjectProperty();return function(e,t,n){var a=r(e,t,n),o=i(e,t,n);return qe(a,s,o),o}}if(U(this.object))return function(e,t,a){var s=r(e,t,a),c=i(e,t,a),f=n(e,t,s);return e.set(u,o(s,f,c)),c};var c=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){var f=this.object.index.getObjectProperty();return function(e,t,r){var a=c(e,t,r),u=Re(a,f),s=n(e,t,u),l=i(e,t,r);return qe(a,f,o(u,s,l)),l}}var l=this.object.index._compile(e,t);return function(e,t,r){var u=c(e,t,r),s=l(e,t,u),f=a(u,s),p=n(e,t,f),m=i(e,t,r);return o(u,s,o(f,p,m)),m}}if(!U(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,r){var n=i(e,t,r);return e.set(u,n),n}}},{key:"forEach",value:function(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)}},{key:"map",value:function(e){return new t(this._ifNode(e(this.object,"object",this)),this.index?this._ifNode(e(this.index,"index",this)):null,this._ifNode(e(this.value,"value",this)))}},{key:"clone",value:function(){return new t(this.object,this.index,this.value)}},{key:"_toString",value:function(e){var t=this.object.toString(e),r=this.index?this.index.toString(e):"",n=this.value.toString(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n="("+n+")"),t+r+" = "+n}},{key:"toJSON",value:function(){return{mathjs:Lp,object:this.object,index:this.index,value:this.value}}},{key:"_toHTML",value:function(e){var t=this.object.toHTML(e),r=this.index?this.index.toHTML(e):"",n=this.value.toHTML(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n='<span class="math-paranthesis math-round-parenthesis">(</span>'+n+'<span class="math-paranthesis math-round-parenthesis">)</span>'),t+r+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+n}},{key:"_toTex",value:function(e){var t=this.object.toTex(e),r=this.index?this.index.toTex(e):"",n=this.value.toTex(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n="\\left(".concat(n,"\\right)")),t+r+"="+n}}],[{key:"fromJSON",value:function(e){return new t(e.object,e.index,e.value)}}]),t}(i);return Za(s,"name",Lp),s}),{isClass:!0,isNode:!0});function $p(e,t,r){return t=bp(t),xp(e,Hp()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function Hp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Hp=function(){return!!e})()}var Gp="BlockNode",Vp=Ce(Gp,["ResultSet","Node"],(function(e){var t=e.ResultSet,r=function(e){function r(e){var t;if(Be(this,r),t=$p(this,r),!Array.isArray(e))throw new Error("Array expected");return t.blocks=e.map((function(e){var t=e&&e.node,r=!e||void 0===e.visible||e.visible;if(!z(t))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof r)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:r}})),t}return Np(r,e),ze(r,[{key:"type",get:function(){return Gp}},{key:"isBlockNode",get:function(){return!0}},{key:"_compile",value:function(e,r){var n=Sn(this.blocks,(function(t){return{evaluate:t.node._compile(e,r),visible:t.visible}}));return function(e,r,i){var a=[];return Cn(n,(function(t){var n=t.evaluate(e,r,i);t.visible&&a.push(n)})),new t(a)}}},{key:"forEach",value:function(e){for(var t=0;t<this.blocks.length;t++)e(this.blocks[t].node,"blocks["+t+"].node",this)}},{key:"map",value:function(e){for(var t=[],n=0;n<this.blocks.length;n++){var i=this.blocks[n],a=this._ifNode(e(i.node,"blocks["+n+"].node",this));t[n]={node:a,visible:i.visible}}return new r(t)}},{key:"clone",value:function(){return new r(this.blocks.map((function(e){return{node:e.node,visible:e.visible}})))}},{key:"_toString",value:function(e){return this.blocks.map((function(t){return t.node.toString(e)+(t.visible?"":";")})).join("\n")}},{key:"toJSON",value:function(){return{mathjs:Gp,blocks:this.blocks}}},{key:"_toHTML",value:function(e){return this.blocks.map((function(t){return t.node.toHTML(e)+(t.visible?"":'<span class="math-separator">;</span>')})).join('<span class="math-separator"><br /></span>')}},{key:"_toTex",value:function(e){return this.blocks.map((function(t){return t.node.toTex(e)+(t.visible?"":";")})).join("\\;\\;\n")}}],[{key:"fromJSON",value:function(e){return new r(e.blocks)}}]),r}(e.Node);return Za(r,"name",Gp),r}),{isClass:!0,isNode:!0});function Zp(e,t,r){return t=bp(t),xp(e,Wp()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function Wp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wp=function(){return!!e})()}var Yp="ConditionalNode",Jp=Ce(Yp,["Node"],(function(e){var t=function(e){function t(e,r,n){var i;if(Be(this,t),i=Zp(this,t),!z(e))throw new TypeError("Parameter condition must be a Node");if(!z(r))throw new TypeError("Parameter trueExpr must be a Node");if(!z(n))throw new TypeError("Parameter falseExpr must be a Node");return i.condition=e,i.trueExpr=r,i.falseExpr=n,i}return Np(t,e),ze(t,[{key:"type",get:function(){return Yp}},{key:"isConditionalNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r=this.condition._compile(e,t),n=this.trueExpr._compile(e,t),i=this.falseExpr._compile(e,t);return function(e,t,u){return function(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return!!e;if(e){if(a(e))return!e.isZero();if(o(e))return!(!e.re&&!e.im);if(s(e))return!!e.value}if(null==e)return!1;throw new TypeError('Unsupported type of condition "'+H(e)+'"')}(r(e,t,u))?n(e,t,u):i(e,t,u)}}},{key:"forEach",value:function(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)}},{key:"map",value:function(e){return new t(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))}},{key:"clone",value:function(){return new t(this.condition,this.trueExpr,this.falseExpr)}},{key:"_toString",value:function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=zp(this,t,e&&e.implicit),n=this.condition.toString(e),i=zp(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n="("+n+")");var a=this.trueExpr.toString(e),o=zp(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=r)&&(a="("+a+")");var u=this.falseExpr.toString(e),s=zp(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==s&&s<=r)&&(u="("+u+")"),n+" ? "+a+" : "+u}},{key:"toJSON",value:function(){return{mathjs:Yp,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}},{key:"_toHTML",value:function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=zp(this,t,e&&e.implicit),n=this.condition.toHTML(e),i=zp(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n='<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>');var a=this.trueExpr.toHTML(e),o=zp(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=r)&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>');var u=this.falseExpr.toHTML(e),s=zp(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==s&&s<=r)&&(u='<span class="math-parenthesis math-round-parenthesis">(</span>'+u+'<span class="math-parenthesis math-round-parenthesis">)</span>'),n+'<span class="math-operator math-conditional-operator">?</span>'+a+'<span class="math-operator math-conditional-operator">:</span>'+u}},{key:"_toTex",value:function(e){return"\\begin{cases} {"+this.trueExpr.toTex(e)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(e)+"}\\\\{"+this.falseExpr.toTex(e)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}],[{key:"fromJSON",value:function(e){return new t(e.condition,e.trueExpr,e.falseExpr)}}]),t}(e.Node);return Za(t,"name",Yp),t}),{isClass:!0,isNode:!0}),Xp=r(3144),Qp={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},Kp={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},em={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(Kp.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(Kp.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(Kp.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(Kp.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(Kp.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(Kp.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(Kp.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(Kp.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(Kp.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(Kp.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(Kp.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(Kp.bitAnd,"${args[1]}\\right)")},bitNot:{1:Kp.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(Kp.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(Kp.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(Kp.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(Kp.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(Kp.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(Kp.and,"${args[1]}\\right)")},not:{1:Kp.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(Kp.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(Kp.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(Kp.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:"{${args[0]}}".concat(Kp.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(Kp.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(Kp.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(Kp.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(Kp.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(Kp.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(Kp.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(Kp.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(Kp.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(Kp.to,"${args[1]}\\right)")},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(Qp.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},tm={deg:"^\\circ"};function rm(e){return Xp(e,{preserveFormatting:!0})}function nm(e,t){return(t=void 0!==t&&t)?Ae(tm,e)?tm[e]:"\\mathrm{"+rm(e)+"}":Ae(Qp,e)?Qp[e]:rm(e)}function im(e,t,r){return t=bp(t),xp(e,am()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function am(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(am=function(){return!!e})()}var om="ConstantNode",um=Ce(om,["Node"],(function(e){var t=function(e){function t(e){var r;return Be(this,t),(r=im(this,t)).value=e,r}return Np(t,e),ze(t,[{key:"type",get:function(){return om}},{key:"isConstantNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r=this.value;return function(){return r}}},{key:"forEach",value:function(e){}},{key:"map",value:function(e){return this.clone()}},{key:"clone",value:function(){return new t(this.value)}},{key:"_toString",value:function(e){return tn(this.value,e)}},{key:"_toHTML",value:function(e){var t=this._toString(e);switch(H(this.value)){case"number":case"BigNumber":case"Fraction":return'<span class="math-number">'+t+"</span>";case"string":return'<span class="math-string">'+t+"</span>";case"boolean":return'<span class="math-boolean">'+t+"</span>";case"null":return'<span class="math-null-symbol">'+t+"</span>";case"undefined":return'<span class="math-undefined">'+t+"</span>";default:return'<span class="math-symbol">'+t+"</span>"}}},{key:"toJSON",value:function(){return{mathjs:om,value:this.value}}},{key:"_toTex",value:function(e){var t=this._toString(e),r=H(this.value);switch(r){case"string":return"\\mathtt{"+rm(t)+"}";case"number":case"BigNumber":if(!("BigNumber"===r?this.value.isFinite():isFinite(this.value)))return this.value.valueOf()<0?"-\\infty":"\\infty";var n=t.toLowerCase().indexOf("e");return-1!==n?t.substring(0,n)+"\\cdot10^{"+t.substring(n+1)+"}":t;case"Fraction":return this.value.toLatex();default:return t}}}],[{key:"fromJSON",value:function(e){return new t(e.value)}}]),t}(e.Node);return Za(t,"name",om),t}),{isClass:!0,isNode:!0});function sm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function cm(e,t,r){return t=bp(t),xp(e,fm()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function fm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fm=function(){return!!e})()}var lm="FunctionAssignmentNode",pm=Ce(lm,["typed","Node"],(function(e){var t=e.typed;function r(e,t,r){var n=zp(e,t,r),i=zp(e.expr,t,r);return"all"===t||null!==i&&i<=n}var n=function(e){function n(e,t,r){var i;if(Be(this,n),i=cm(this,n),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!z(r))throw new TypeError('Node expected for parameter "expr"');if(yp.has(e))throw new Error('Illegal function name, "'+e+'" is a reserved keyword');var a,o=new Set,u=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return sm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?sm(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}(t);try{for(u.s();!(a=u.n()).done;){var s=a.value,c="string"==typeof s?s:s.name;if(o.has(c))throw new Error('Duplicate parameter name "'.concat(c,'"'));o.add(c)}}catch(e){u.e(e)}finally{u.f()}return i.name=e,i.params=t.map((function(e){return e&&e.name||e})),i.types=t.map((function(e){return e&&e.type||"any"})),i.expr=r,i}return Np(n,e),ze(n,[{key:"type",get:function(){return lm}},{key:"isFunctionAssignmentNode",get:function(){return!0}},{key:"_compile",value:function(e,r){var n=Object.create(r);Cn(this.params,(function(e){n[e]=!0}));var i=this.expr._compile(e,n),a=this.name,o=this.params,u=On(this.types,","),s=a+"("+On(this.params,", ")+")";return function(e,r,n){var c={};c[u]=function(){for(var t=Object.create(r),a=0;a<o.length;a++)t[o[a]]=arguments[a];return i(e,t,n)};var f=t(a,c);return f.syntax=s,e.set(a,f),f}}},{key:"forEach",value:function(e){e(this.expr,"expr",this)}},{key:"map",value:function(e){var t=this._ifNode(e(this.expr,"expr",this));return new n(this.name,this.params.slice(0),t)}},{key:"clone",value:function(){return new n(this.name,this.params.slice(0),this.expr)}},{key:"_toString",value:function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=this.expr.toString(e);return r(this,t,e&&e.implicit)&&(n="("+n+")"),this.name+"("+this.params.join(", ")+") = "+n}},{key:"toJSON",value:function(){var e=this.types;return{mathjs:lm,name:this.name,params:this.params.map((function(t,r){return{name:t,type:e[r]}})),expr:this.expr}}},{key:"_toHTML",value:function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=[],i=0;i<this.params.length;i++)n.push('<span class="math-symbol math-parameter">'+an(this.params[i])+"</span>");var a=this.expr.toHTML(e);return r(this,t,e&&e.implicit)&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+an(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+n.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+a}},{key:"_toTex",value:function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=this.expr.toTex(e);return r(this,t,e&&e.implicit)&&(n="\\left(".concat(n,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(nm).join(",")+"\\right)="+n}}],[{key:"fromJSON",value:function(e){return new n(e.name,e.params,e.expr)}}]),n}(e.Node);return Za(n,"name",lm),n}),{isClass:!0,isNode:!0});function mm(e,t,r){return t=bp(t),xp(e,hm()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function hm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hm=function(){return!!e})()}var dm="IndexNode",vm=Ce(dm,["Node","size"],(function(e){var t=e.Node,r=e.size,n=function(e){function t(e,r){var n;if(Be(this,t),(n=mm(this,t)).dimensions=e,n.dotNotation=r||!1,!Array.isArray(e)||!e.every(z))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(n.dotNotation&&!n.isObjectProperty())throw new Error("dotNotation only applicable for object properties");return n}return Np(t,e),ze(t,[{key:"type",get:function(){return dm}},{key:"isIndexNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var n=Sn(this.dimensions,(function(n,i){if(n.filter((function(e){return e.isSymbolNode&&"end"===e.name})).length>0){var a=Object.create(t);a.end=!0;var o=n._compile(e,a);return function(e,t,n){if(!l(n)&&!f(n)&&!c(n))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+H(n));var a=r(n).valueOf(),u=Object.create(t);return u.end=a[i],o(e,u,n)}}return n._compile(e,t)})),i=Re(e,"index");return function(e,t,r){var a=Sn(n,(function(n){return n(e,t,r)}));return i.apply(void 0,_e(a))}}},{key:"forEach",value:function(e){for(var t=0;t<this.dimensions.length;t++)e(this.dimensions[t],"dimensions["+t+"]",this)}},{key:"map",value:function(e){for(var r=[],n=0;n<this.dimensions.length;n++)r[n]=this._ifNode(e(this.dimensions[n],"dimensions["+n+"]",this));return new t(r,this.dotNotation)}},{key:"clone",value:function(){return new t(this.dimensions.slice(0),this.dotNotation)}},{key:"isObjectProperty",value:function(){return 1===this.dimensions.length&&T(this.dimensions[0])&&"string"==typeof this.dimensions[0].value}},{key:"getObjectProperty",value:function(){return this.isObjectProperty()?this.dimensions[0].value:null}},{key:"_toString",value:function(e){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"}},{key:"toJSON",value:function(){return{mathjs:dm,dimensions:this.dimensions,dotNotation:this.dotNotation}}},{key:"_toHTML",value:function(e){for(var t=[],r=0;r<this.dimensions.length;r++)t[r]=this.dimensions[r].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+an(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}},{key:"_toTex",value:function(e){var t=this.dimensions.map((function(t){return t.toTex(e)}));return this.dotNotation?"."+this.getObjectProperty():"_{"+t.join(",")+"}"}}],[{key:"fromJSON",value:function(e){return new t(e.dimensions,e.dotNotation)}}]),t}(t);return Za(n,"name",dm),n}),{isClass:!0,isNode:!0});function ym(e,t,r){return t=bp(t),xp(e,gm()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function gm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gm=function(){return!!e})()}var xm="ObjectNode",bm=Ce(xm,["Node"],(function(e){var r=function(e){function r(e){var n;if(Be(this,r),(n=ym(this,r)).properties=e||{},e&&("object"!==t(e)||!Object.keys(e).every((function(t){return z(e[t])}))))throw new TypeError("Object containing Nodes expected");return n}return Np(r,e),ze(r,[{key:"type",get:function(){return xm}},{key:"isObjectNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r={};for(var n in this.properties)if(Ae(this.properties,n)){var i=rn(n),a=JSON.parse(i),o=Re(this.properties,n);r[a]=o._compile(e,t)}return function(e,t,n){var i={};for(var a in r)Ae(r,a)&&(i[a]=r[a](e,t,n));return i}}},{key:"forEach",value:function(e){for(var t in this.properties)Ae(this.properties,t)&&e(this.properties[t],"properties["+rn(t)+"]",this)}},{key:"map",value:function(e){var t={};for(var n in this.properties)Ae(this.properties,n)&&(t[n]=this._ifNode(e(this.properties[n],"properties["+rn(n)+"]",this)));return new r(t)}},{key:"clone",value:function(){var e={};for(var t in this.properties)Ae(this.properties,t)&&(e[t]=this.properties[t]);return new r(e)}},{key:"_toString",value:function(e){var t=[];for(var r in this.properties)Ae(this.properties,r)&&t.push(rn(r)+": "+this.properties[r].toString(e));return"{"+t.join(", ")+"}"}},{key:"toJSON",value:function(){return{mathjs:xm,properties:this.properties}}},{key:"_toHTML",value:function(e){var t=[];for(var r in this.properties)Ae(this.properties,r)&&t.push('<span class="math-symbol math-property">'+an(r)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[r].toHTML(e));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'}},{key:"_toTex",value:function(e){var t=[];for(var r in this.properties)Ae(this.properties,r)&&t.push("\\mathbf{"+r+":} & "+this.properties[r].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}"+t.join("\n")+"\\end{array}\\right\\}"}}],[{key:"fromJSON",value:function(e){return new r(e.properties)}}]),r}(e.Node);return Za(r,"name",xm),r}),{isClass:!0,isNode:!0});function wm(e,t){return new Ze(e,new Ve(t),new Set(Object.keys(t)))}function Nm(e,t,r){return t=bp(t),xp(e,Dm()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function Dm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dm=function(){return!!e})()}var Em="OperatorNode",Am=Ce(Em,["Node"],(function(e){function t(e,r){var n=e;if("auto"===r)for(;j(n);)n=n.content;return!!T(n)||!!q(n)&&t(n.args[0],r)}function r(e,r,n,i,a){var o,u=zp(e,r,n),s=Rp(e,r);if("all"===r||i.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return i.map((function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}}));switch(i.length){case 0:o=[];break;case 1:var c=zp(i[0],r,n,e);if(a&&null!==c){var f,l;if("keep"===r?(f=i[0].getIdentifier(),l=e.getIdentifier()):(f=i[0].getContent().getIdentifier(),l=e.getContent().getIdentifier()),!1===kp[u][l].latexLeftParens){o=[!1];break}if(!1===kp[c][f].latexParens){o=[!1];break}}if(null===c){o=[!1];break}if(c<=u){o=[!0];break}o=[!1];break;case 2:var p,m,h=zp(i[0],r,n,e),d=qp(e,i[0],r);p=null!==h&&(h===u&&"right"===s&&!d||h<u);var v,y,g,x=zp(i[1],r,n,e),b=qp(e,i[1],r);m=null!==x&&(x===u&&"left"===s&&!b||x<u),a&&("keep"===r?(v=e.getIdentifier(),y=e.args[0].getIdentifier(),g=e.args[1].getIdentifier()):(v=e.getContent().getIdentifier(),y=e.args[0].getContent().getIdentifier(),g=e.args[1].getContent().getIdentifier()),null!==h&&(!1===kp[u][v].latexLeftParens&&(p=!1),!1===kp[h][y].latexParens&&(p=!1)),null!==x&&(!1===kp[u][v].latexRightParens&&(m=!1),!1===kp[x][g].latexParens&&(m=!1))),o=[p,m];break;default:"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier()||(o=i.map((function(t){var i=zp(t,r,n,e),a=qp(e,t,r),o=Rp(t,r);return null!==i&&(u===i&&s===o&&!a||i<u)})))}if(i.length>=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"all"!==r&&"hide"===n)for(var w=1;w<o.length;++w)!t(i[w],r)||o[w-1]||"keep"===r&&j(i[w-1])||(o[w]=!0);return o}var n=function(e){function t(e,r,n,i,a){var o;if(Be(this,t),o=Nm(this,t),"string"!=typeof e)throw new TypeError('string expected for parameter "op"');if("string"!=typeof r)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(n)||!n.every(z))throw new TypeError('Array containing Nodes expected for parameter "args"');return o.implicit=!0===i,o.isPercentage=!0===a,o.op=e,o.fn=r,o.args=n||[],o}return Np(t,e),ze(t,[{key:"type",get:function(){return Em}},{key:"isOperatorNode",get:function(){return!0}},{key:"_compile",value:function(e,t){if("string"!=typeof this.fn||!Pe(e,this.fn))throw e[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var r=Re(e,this.fn),n=Sn(this.args,(function(r){return r._compile(e,t)}));if("function"==typeof r&&!0===r.rawArgs){var i=this.args;return function(t,n,a){return r(i,e,wm(t,n))}}if(1===n.length){var a=n[0];return function(e,t,n){return r(a(e,t,n))}}if(2===n.length){var o=n[0],u=n[1];return function(e,t,n){return r(o(e,t,n),u(e,t,n))}}return function(e,t,i){return r.apply(null,Sn(n,(function(r){return r(e,t,i)})))}}},{key:"forEach",value:function(e){for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)}},{key:"map",value:function(e){for(var r=[],n=0;n<this.args.length;n++)r[n]=this._ifNode(e(this.args[n],"args["+n+"]",this));return new t(this.op,this.fn,r,this.implicit,this.isPercentage)}},{key:"clone",value:function(){return new t(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)}},{key:"isUnary",value:function(){return 1===this.args.length}},{key:"isBinary",value:function(){return 2===this.args.length}},{key:"_toString",value:function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",i=this.args,a=r(this,t,n,i,!1);if(1===i.length){var o=Rp(this,t),u=i[0].toString(e);a[0]&&(u="("+u+")");var s=/[a-zA-Z]+/.test(this.op);return"right"===o?this.op+(s?" ":"")+u:"left"===o?u+(s?" ":"")+this.op:u+this.op}if(2===i.length){var c=i[0].toString(e),f=i[1].toString(e);return a[0]&&(c="("+c+")"),a[1]&&(f="("+f+")"),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?c+" "+f:c+" "+this.op+" "+f}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var l=i.map((function(t,r){return t=t.toString(e),a[r]&&(t="("+t+")"),t}));return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?l.join(" "):l.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"}},{key:"toJSON",value:function(){return{mathjs:Em,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}},{key:"_toHTML",value:function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",i=this.args,a=r(this,t,n,i,!1);if(1===i.length){var o=Rp(this,t),u=i[0].toHTML(e);return a[0]&&(u='<span class="math-parenthesis math-round-parenthesis">(</span>'+u+'<span class="math-parenthesis math-round-parenthesis">)</span>'),"right"===o?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+an(this.op)+"</span>"+u:u+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+an(this.op)+"</span>"}if(2===i.length){var s=i[0].toHTML(e),c=i[1].toHTML(e);return a[0]&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),a[1]&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?s+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+c:s+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+an(this.op)+"</span>"+c}var f=i.map((function(t,r){return t=t.toHTML(e),a[r]&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t}));return i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?f.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):f.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+an(this.op)+"</span>"):'<span class="math-function">'+an(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+f.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}},{key:"_toTex",value:function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",i=this.args,a=r(this,t,n,i,!0),o=Kp[this.fn];if(o=void 0===o?this.op:o,1===i.length){var u=Rp(this,t),s=i[0].toTex(e);return a[0]&&(s="\\left(".concat(s,"\\right)")),"right"===u?o+s:s+o}if(2===i.length){var c=i[0],f=c.toTex(e);a[0]&&(f="\\left(".concat(f,"\\right)"));var l,p=i[1].toTex(e);switch(a[1]&&(p="\\left(".concat(p,"\\right)")),l="keep"===t?c.getIdentifier():c.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return o+"{"+f+"}{"+p+"}";case"OperatorNode:pow":switch(f="{"+f+"}",p="{"+p+"}",l){case"ConditionalNode":case"OperatorNode:divide":f="\\left(".concat(f,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===n)return f+"~"+p}return f+o+p}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var m=i.map((function(t,r){return t=t.toTex(e),a[r]&&(t="\\left(".concat(t,"\\right)")),t}));return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit&&"hide"===n?m.join("~"):m.join(o)}return"\\mathrm{"+this.fn+"}\\left("+i.map((function(t){return t.toTex(e)})).join(",")+"\\right)"}},{key:"getIdentifier",value:function(){return this.type+":"+this.fn}}],[{key:"fromJSON",value:function(e){return new t(e.op,e.fn,e.args,e.implicit,e.isPercentage)}}]),t}(e.Node);return Za(n,"name",Em),n}),{isClass:!0,isNode:!0});function Sm(e,t,r){return t=bp(t),xp(e,Cm()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function Cm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cm=function(){return!!e})()}var Mm="ParenthesisNode",Fm=Ce(Mm,["Node"],(function(e){var t=function(e){function t(e){var r;if(Be(this,t),r=Sm(this,t),!z(e))throw new TypeError('Node expected for parameter "content"');return r.content=e,r}return Np(t,e),ze(t,[{key:"type",get:function(){return Mm}},{key:"isParenthesisNode",get:function(){return!0}},{key:"_compile",value:function(e,t){return this.content._compile(e,t)}},{key:"getContent",value:function(){return this.content.getContent()}},{key:"forEach",value:function(e){e(this.content,"content",this)}},{key:"map",value:function(e){return new t(e(this.content,"content",this))}},{key:"clone",value:function(){return new t(this.content)}},{key:"_toString",value:function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)}},{key:"toJSON",value:function(){return{mathjs:Mm,content:this.content}}},{key:"_toHTML",value:function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(e)}},{key:"_toTex",value:function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"\\left(".concat(this.content.toTex(e),"\\right)"):this.content.toTex(e)}}],[{key:"fromJSON",value:function(e){return new t(e.content)}}]),t}(e.Node);return Za(t,"name",Mm),t}),{isClass:!0,isNode:!0});function Om(e,t,r){return t=bp(t),xp(e,Tm()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function Tm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Tm=function(){return!!e})()}var _m="RangeNode",Bm=Ce(_m,["Node"],(function(e){function t(e,t,r){var n=zp(e,t,r),i={},a=zp(e.start,t,r);if(i.start=null!==a&&a<=n||"all"===t,e.step){var o=zp(e.step,t,r);i.step=null!==o&&o<=n||"all"===t}var u=zp(e.end,t,r);return i.end=null!==u&&u<=n||"all"===t,i}var r=function(e){function r(e,t,n){var i;if(Be(this,r),i=Om(this,r),!z(e))throw new TypeError("Node expected");if(!z(t))throw new TypeError("Node expected");if(n&&!z(n))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");return i.start=e,i.end=t,i.step=n||null,i}return Np(r,e),ze(r,[{key:"type",get:function(){return _m}},{key:"isRangeNode",get:function(){return!0}},{key:"needsEnd",value:function(){return this.filter((function(e){return U(e)&&"end"===e.name})).length>0}},{key:"_compile",value:function(e,t){var r=e.range,n=this.start._compile(e,t),i=this.end._compile(e,t);if(this.step){var a=this.step._compile(e,t);return function(e,t,o){return r(n(e,t,o),i(e,t,o),a(e,t,o))}}return function(e,t,a){return r(n(e,t,a),i(e,t,a))}}},{key:"forEach",value:function(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)}},{key:"map",value:function(e){return new r(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))}},{key:"clone",value:function(){return new r(this.start,this.end,this.step&&this.step)}},{key:"_toString",value:function(e){var r,n=t(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),i=this.start.toString(e);if(n.start&&(i="("+i+")"),r=i,this.step){var a=this.step.toString(e);n.step&&(a="("+a+")"),r+=":"+a}var o=this.end.toString(e);return n.end&&(o="("+o+")"),r+":"+o}},{key:"toJSON",value:function(){return{mathjs:_m,start:this.start,end:this.end,step:this.step}}},{key:"_toHTML",value:function(e){var r,n=t(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),i=this.start.toHTML(e);if(n.start&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),r=i,this.step){var a=this.step.toHTML(e);n.step&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>'),r+='<span class="math-operator math-range-operator">:</span>'+a}var o=this.end.toHTML(e);return n.end&&(o='<span class="math-parenthesis math-round-parenthesis">(</span>'+o+'<span class="math-parenthesis math-round-parenthesis">)</span>'),r+'<span class="math-operator math-range-operator">:</span>'+o}},{key:"_toTex",value:function(e){var r=t(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),n=this.start.toTex(e);if(r.start&&(n="\\left(".concat(n,"\\right)")),this.step){var i=this.step.toTex(e);r.step&&(i="\\left(".concat(i,"\\right)")),n+=":"+i}var a=this.end.toTex(e);return r.end&&(a="\\left(".concat(a,"\\right)")),n+":"+a}}],[{key:"fromJSON",value:function(e){return new r(e.start,e.end,e.step)}}]),r}(e.Node);return Za(r,"name",_m),r}),{isClass:!0,isNode:!0});function km(e,t,r){return t=bp(t),xp(e,Im()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function Im(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Im=function(){return!!e})()}var zm="RelationalNode",Rm=Ce(zm,["Node"],(function(e){var t=e.Node,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},n=function(e){function t(e,r){var n;if(Be(this,t),n=km(this,t),!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(r))throw new TypeError("Parameter params must be an array");if(e.length!==r.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");return n.conditionals=e,n.params=r,n}return Np(t,e),ze(t,[{key:"type",get:function(){return zm}},{key:"isRelationalNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r=this,n=this.params.map((function(r){return r._compile(e,t)}));return function(t,i,a){for(var o,u=n[0](t,i,a),s=0;s<r.conditionals.length;s++)if(o=u,u=n[s+1](t,i,a),!Re(e,r.conditionals[s])(o,u))return!1;return!0}}},{key:"forEach",value:function(e){var t=this;this.params.forEach((function(r,n){return e(r,"params["+n+"]",t)}),this)}},{key:"map",value:function(e){var r=this;return new t(this.conditionals.slice(),this.params.map((function(t,n){return r._ifNode(e(t,"params["+n+"]",r))}),this))}},{key:"clone",value:function(){return new t(this.conditionals,this.params)}},{key:"_toString",value:function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=zp(this,t,e&&e.implicit),i=this.params.map((function(r,i){var a=zp(r,t,e&&e.implicit);return"all"===t||null!==a&&a<=n?"("+r.toString(e)+")":r.toString(e)})),a=i[0],o=0;o<this.conditionals.length;o++)a+=" "+r[this.conditionals[o]],a+=" "+i[o+1];return a}},{key:"toJSON",value:function(){return{mathjs:zm,conditionals:this.conditionals,params:this.params}}},{key:"_toHTML",value:function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=zp(this,t,e&&e.implicit),i=this.params.map((function(r,i){var a=zp(r,t,e&&e.implicit);return"all"===t||null!==a&&a<=n?'<span class="math-parenthesis math-round-parenthesis">(</span>'+r.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':r.toHTML(e)})),a=i[0],o=0;o<this.conditionals.length;o++)a+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+an(r[this.conditionals[o]])+"</span>"+i[o+1];return a}},{key:"_toTex",value:function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=zp(this,t,e&&e.implicit),n=this.params.map((function(n,i){var a=zp(n,t,e&&e.implicit);return"all"===t||null!==a&&a<=r?"\\left("+n.toTex(e)+"\right)":n.toTex(e)})),i=n[0],a=0;a<this.conditionals.length;a++)i+=Kp[this.conditionals[a]]+n[a+1];return i}}],[{key:"fromJSON",value:function(e){return new t(e.conditionals,e.params)}}]),t}(t);return Za(n,"name",zm),n}),{isClass:!0,isNode:!0});function qm(e,t,r){return t=bp(t),xp(e,jm()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function jm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jm=function(){return!!e})()}var Pm=Ce("SymbolNode",["math","?Unit","Node"],(function(e){var t=e.math,r=e.Unit;function n(e){return!!r&&r.isValuelessUnit(e)}var i=function(e){function i(e){var t;if(Be(this,i),t=qm(this,i),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');return t.name=e,t}return Np(i,e),ze(i,[{key:"type",get:function(){return"SymbolNode"}},{key:"isSymbolNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var a=this.name;if(!0===t[a])return function(e,t,r){return Re(t,a)};if(a in e)return function(t,r,n){return t.has(a)?t.get(a):Re(e,a)};var o=n(a);return function(e,t,n){return e.has(a)?e.get(a):o?new r(null,a):i.onUndefinedSymbol(a)}}},{key:"forEach",value:function(e){}},{key:"map",value:function(e){return this.clone()}},{key:"clone",value:function(){return new i(this.name)}},{key:"_toString",value:function(e){return this.name}},{key:"_toHTML",value:function(e){var t=an(this.name);return"true"===t||"false"===t?'<span class="math-symbol math-boolean">'+t+"</span>":"i"===t?'<span class="math-symbol math-imaginary-symbol">'+t+"</span>":"Infinity"===t?'<span class="math-symbol math-infinity-symbol">'+t+"</span>":"NaN"===t?'<span class="math-symbol math-nan-symbol">'+t+"</span>":"null"===t?'<span class="math-symbol math-null-symbol">'+t+"</span>":"undefined"===t?'<span class="math-symbol math-undefined-symbol">'+t+"</span>":'<span class="math-symbol">'+t+"</span>"}},{key:"toJSON",value:function(){return{mathjs:"SymbolNode",name:this.name}}},{key:"_toTex",value:function(e){var r=!1;void 0===t[this.name]&&n(this.name)&&(r=!0);var i=nm(this.name,r);return"\\"===i[0]?i:" "+i}}],[{key:"onUndefinedSymbol",value:function(e){throw new Error("Undefined symbol "+e)}},{key:"fromJSON",value:function(e){return new i(e.name)}}]),i}(e.Node);return i}),{isClass:!0,isNode:!0});function Lm(){return Lm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=bp(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Lm.apply(this,arguments)}function Um(e,t,r){return t=bp(t),xp(e,$m()?Reflect.construct(t,r||[],bp(e).constructor):t.apply(e,r))}function $m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($m=function(){return!!e})()}var Hm="FunctionNode",Gm=Ce(Hm,["math","Node","SymbolNode"],(function(e){var r,n=e.math,i=e.Node,a=e.SymbolNode,o=function(e){return tn(e,{truncate:78})};function u(e,r,n){for(var i,a="",o=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,u=0;null!==(i=o.exec(e));)if(a+=e.substring(u,i.index),u=i.index,"$$"===i[0])a+="$",u++;else{u+=i[0].length;var s=r[i[1]];if(!s)throw new ReferenceError("Template: Property "+i[1]+" does not exist.");if(void 0===i[2])switch(t(s)){case"string":a+=s;break;case"object":if(z(s))a+=s.toTex(n);else{if(!Array.isArray(s))throw new TypeError("Template: "+i[1]+" has to be a Node, String or array of Nodes");a+=s.map((function(e,t){if(z(e))return e.toTex(n);throw new TypeError("Template: "+i[1]+"["+t+"] is not a Node.")})).join(",")}break;default:throw new TypeError("Template: "+i[1]+" has to be a Node, String or array of Nodes")}else{if(!z(s[i[2]]&&s[i[2]]))throw new TypeError("Template: "+i[1]+"["+i[2]+"] is not a Node.");a+=s[i[2]].toTex(n)}}return a+e.slice(u)}var s=function(e){function r(e,t){var n;if(Be(this,r),n=Um(this,r),"string"==typeof e&&(e=new a(e)),!z(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(z))throw new TypeError('Array containing Nodes expected for parameter "args"');return n.fn=e,n.args=t||[],n}return Np(r,e),ze(r,[{key:"name",get:function(){return this.fn.name||""}},{key:"type",get:function(){return Hm}},{key:"isFunctionNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var n=this.args.map((function(r){return r._compile(e,t)}));if(!U(this.fn)){if(S(this.fn)&&I(this.fn.index)&&this.fn.index.isObjectProperty()){var i=this.fn.object._compile(e,t),a=this.fn.index.getObjectProperty(),u=this.args;return function(t,r,o){var s=i(t,r,o),c=function(e,t){if(!Pe(e,t))throw new Error('No access to method "'+t+'"');return e[t]}(s,a);if(null!=c&&c.rawArgs)return c(u,e,wm(t,r));var f=n.map((function(e){return e(t,r,o)}));return c.apply(s,f)}}var s=this.fn.toString(),c=this.fn._compile(e,t),f=this.args;return function(t,r,i){var a=c(t,r,i);if("function"!=typeof a)throw new TypeError("Expression '".concat(s,"' did not evaluate to a function; value is:")+"\n ".concat(o(a)));if(a.rawArgs)return a(f,e,wm(t,r));var u=n.map((function(e){return e(t,r,i)}));return a.apply(a,u)}}var l=this.fn.name;if(t[l]){var p=this.args;return function(t,r,i){var a=Re(r,l);if("function"!=typeof a)throw new TypeError("Argument '".concat(l,"' was not a function; received: ").concat(o(a)));if(a.rawArgs)return a(p,e,wm(t,r));var u=n.map((function(e){return e(t,r,i)}));return a.apply(a,u)}}var m=l in e?Re(e,l):void 0,h="function"==typeof m&&!0===m.rawArgs,d=function(t){var n;if(t.has(l))n=t.get(l);else{if(!(l in e))return r.onUndefinedFunction(l);n=Re(e,l)}if("function"==typeof n)return n;throw new TypeError("'".concat(l,"' is not a function; its value is:\n ").concat(o(n)))};if(h){var v=this.args;return function(t,r,n){return d(t)(v,e,wm(t,r))}}switch(n.length){case 0:return function(e,t,r){return d(e)()};case 1:return function(e,t,r){return d(e)((0,n[0])(e,t,r))};case 2:return function(e,t,r){var i=d(e),a=n[0],o=n[1];return i(a(e,t,r),o(e,t,r))};default:return function(e,t,r){var i=d(e),a=n.map((function(n){return n(e,t,r)}));return i.apply(void 0,_e(a))}}}},{key:"forEach",value:function(e){e(this.fn,"fn",this);for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)}},{key:"map",value:function(e){for(var t=this._ifNode(e(this.fn,"fn",this)),n=[],i=0;i<this.args.length;i++)n[i]=this._ifNode(e(this.args[i],"args["+i+"]",this));return new r(t,n)}},{key:"clone",value:function(){return new r(this.fn,this.args.slice(0))}},{key:"toString",value:function(e){var n,i=this.fn.toString(e);return e&&"object"===t(e.handler)&&Ae(e.handler,i)&&(n=e.handler[i](this,e)),void 0!==n?n:Lm(bp(r.prototype),"toString",this).call(this,e)}},{key:"_toString",value:function(e){var t=this.args.map((function(t){return t.toString(e)}));return(B(this.fn)?"("+this.fn.toString(e)+")":this.fn.toString(e))+"("+t.join(", ")+")"}},{key:"toJSON",value:function(){return{mathjs:Hm,fn:this.fn,args:this.args}}},{key:"_toHTML",value:function(e){var t=this.args.map((function(t){return t.toHTML(e)}));return'<span class="math-function">'+an(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}},{key:"toTex",value:function(e){var n;return e&&"object"===t(e.handler)&&Ae(e.handler,this.name)&&(n=e.handler[this.name](this,e)),void 0!==n?n:Lm(bp(r.prototype),"toTex",this).call(this,e)}},{key:"_toTex",value:function(e){var r,i,a=this.args.map((function(t){return t.toTex(e)}));switch(em[this.name]&&(r=em[this.name]),!n[this.name]||"function"!=typeof n[this.name].toTex&&"object"!==t(n[this.name].toTex)&&"string"!=typeof n[this.name].toTex||(r=n[this.name].toTex),t(r)){case"function":i=r(this,e);break;case"string":i=u(r,this,e);break;case"object":switch(t(r[a.length])){case"function":i=r[a.length](this,e);break;case"string":i=u(r[a.length],this,e)}}return void 0!==i?i:u("\\mathrm{${name}}\\left(${args}\\right)",this,e)}},{key:"getIdentifier",value:function(){return this.type+":"+this.name}}]),r}(i);return r=s,Za(s,"name",Hm),Za(s,"onUndefinedFunction",(function(e){throw new Error("Undefined function "+e)})),Za(s,"fromJSON",(function(e){return new r(e.fn,e.args)})),s}),{isClass:!0,isNode:!0}),Vm="parse",Zm=Ce(Vm,["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],(function(e){var t=e.typed,r=e.numeric,n=e.config,i=e.AccessorNode,a=e.ArrayNode,o=e.AssignmentNode,u=e.BlockNode,s=e.ConditionalNode,c=e.ConstantNode,f=e.FunctionAssignmentNode,l=e.FunctionNode,p=e.IndexNode,m=e.ObjectNode,h=e.OperatorNode,d=e.ParenthesisNode,v=e.RangeNode,y=e.RelationalNode,g=e.SymbolNode,x=t(Vm,{string:function(e){return L(e,{})},"Array | Matrix":function(e){return b(e,{})},"string, Object":function(e,t){return L(e,void 0!==t.nodes?t.nodes:{})},"Array | Matrix, Object":b});function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=void 0!==t.nodes?t.nodes:{};return Yn(e,(function(e){if("string"!=typeof e)throw new TypeError("String expected");return L(e,r)}))}var w={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},N={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},D={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},E={true:!0,false:!1,null:null,undefined:void 0},A=["NaN","Infinity"],C={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function M(e,t){return e.expression.substr(e.index,t)}function F(e){return M(e,1)}function O(e){e.index++}function B(e){return e.expression.charAt(e.index-1)}function I(e){return e.expression.charAt(e.index+1)}function z(e){for(e.tokenType=w.NULL,e.token="",e.comment="";;){if("#"===F(e))for(;"\n"!==F(e)&&""!==F(e);)e.comment+=F(e),O(e);if(!x.isWhitespace(F(e),e.nestingLevel))break;O(e)}if(""!==F(e)){if("\n"===F(e)&&!e.nestingLevel)return e.tokenType=w.DELIMITER,e.token=F(e),void O(e);var t=F(e),r=M(e,2),n=M(e,3);if(3===n.length&&N[n])return e.tokenType=w.DELIMITER,e.token=n,O(e),O(e),void O(e);if(2===r.length&&N[r])return e.tokenType=w.DELIMITER,e.token=r,O(e),void O(e);if(N[t])return e.tokenType=w.DELIMITER,e.token=t,void O(e);if(x.isDigitDot(t)){e.tokenType=w.NUMBER;var i=M(e,2);if("0b"===i||"0o"===i||"0x"===i){for(e.token+=F(e),O(e),e.token+=F(e),O(e);x.isHexDigit(F(e));)e.token+=F(e),O(e);if("."===F(e))for(e.token+=".",O(e);x.isHexDigit(F(e));)e.token+=F(e),O(e);else if("i"===F(e))for(e.token+="i",O(e);x.isDigit(F(e));)e.token+=F(e),O(e);return}if("."===F(e)){if(e.token+=F(e),O(e),!x.isDigit(F(e)))return void(e.tokenType=w.DELIMITER)}else{for(;x.isDigit(F(e));)e.token+=F(e),O(e);x.isDecimalMark(F(e),I(e))&&(e.token+=F(e),O(e))}for(;x.isDigit(F(e));)e.token+=F(e),O(e);if("E"===F(e)||"e"===F(e))if(x.isDigit(I(e))||"-"===I(e)||"+"===I(e)){if(e.token+=F(e),O(e),"+"!==F(e)&&"-"!==F(e)||(e.token+=F(e),O(e)),!x.isDigit(F(e)))throw ce(e,'Digit expected, got "'+F(e)+'"');for(;x.isDigit(F(e));)e.token+=F(e),O(e);if(x.isDecimalMark(F(e),I(e)))throw ce(e,'Digit expected, got "'+F(e)+'"')}else if("."===I(e))throw O(e),ce(e,'Digit expected, got "'+F(e)+'"')}else{if(!x.isAlpha(F(e),B(e),I(e))){for(e.tokenType=w.UNKNOWN;""!==F(e);)e.token+=F(e),O(e);throw ce(e,'Syntax error in part "'+e.token+'"')}for(;x.isAlpha(F(e),B(e),I(e))||x.isDigit(F(e));)e.token+=F(e),O(e);Ae(D,e.token)?e.tokenType=w.DELIMITER:e.tokenType=w.SYMBOL}}else e.tokenType=w.DELIMITER}function R(e){do{z(e)}while("\n"===e.token)}function j(e){e.nestingLevel++}function P(e){e.nestingLevel--}function L(e,t){var r={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:w.NULL,nestingLevel:0,conditionalLevel:null};Jr(r,{expression:e,extraNodes:t}),z(r);var n=function(e){var t,r,n=[];for(""!==e.token&&"\n"!==e.token&&";"!==e.token&&(t=$(e),e.comment&&(t.comment=e.comment));"\n"===e.token||";"===e.token;)0===n.length&&t&&(r=";"!==e.token,n.push({node:t,visible:r})),z(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&(t=$(e),e.comment&&(t.comment=e.comment),r=";"!==e.token,n.push({node:t,visible:r}));return n.length>0?new u(n):(t||(t=new c(void 0),e.comment&&(t.comment=e.comment)),t)}(r);if(""!==r.token)throw r.tokenType===w.DELIMITER?fe(r,"Unexpected operator "+r.token):ce(r,'Unexpected part "'+r.token+'"');return n}function $(e){var t,r,n,i,a=function(e){for(var t=function(e){for(var t=H(e);"or"===e.token;)R(e),t=new h("or","or",[t,H(e)]);return t}(e);"?"===e.token;){var r=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,R(e);var n=t,i=$(e);if(":"!==e.token)throw ce(e,"False part of conditional expression expected");e.conditionalLevel=null,R(e);var a=$(e);t=new s(n,i,a),e.conditionalLevel=r}return t}(e);if("="===e.token){if(U(a))return t=a.name,R(e),n=$(e),new o(new g(t),n);if(S(a))return R(e),n=$(e),new o(a.object,a.index,n);if(k(a)&&U(a.fn)&&(i=!0,r=[],t=a.name,a.args.forEach((function(e,t){U(e)?r[t]=e.name:i=!1})),i))return R(e),n=$(e),new f(t,r,n);throw ce(e,"Invalid left hand side of assignment operator =")}return a}function H(e){for(var t=G(e);"xor"===e.token;)R(e),t=new h("xor","xor",[t,G(e)]);return t}function G(e){for(var t=V(e);"and"===e.token;)R(e),t=new h("and","and",[t,V(e)]);return t}function V(e){for(var t=Z(e);"|"===e.token;)R(e),t=new h("|","bitOr",[t,Z(e)]);return t}function Z(e){for(var t=W(e);"^|"===e.token;)R(e),t=new h("^|","bitXor",[t,W(e)]);return t}function W(e){for(var t=Y(e);"&"===e.token;)R(e),t=new h("&","bitAnd",[t,Y(e)]);return t}function Y(e){for(var t=[J(e)],r=[],n={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Ae(n,e.token);){var i={name:e.token,fn:n[e.token]};r.push(i),R(e),t.push(J(e))}return 1===t.length?t[0]:2===t.length?new h(r[0].name,r[0].fn,t):new y(r.map((function(e){return e.fn})),t)}function J(e){var t,r,n,i;t=X(e);for(var a={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Ae(a,e.token);)n=a[r=e.token],R(e),i=[t,X(e)],t=new h(r,n,i);return t}function X(e){var t,r,n,i;t=Q(e);for(var a={to:"to",in:"to"};Ae(a,e.token);)n=a[r=e.token],R(e),"in"===r&&""===e.token?t=new h("*","multiply",[t,new g("in")],!0):(i=[t,Q(e)],t=new h(r,n,i));return t}function Q(e){var t,r=[];if(t=":"===e.token?new c(1):K(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(r.push(t);":"===e.token&&r.length<3;)R(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?r.push(new g("end")):r.push(K(e));t=3===r.length?new v(r[0],r[2],r[1]):new v(r[0],r[1])}return t}function K(e){var t,r,n,i;t=ee(e);for(var a={"+":"add","-":"subtract"};Ae(a,e.token);){n=a[r=e.token],R(e);var o=ee(e);i=o.isPercentage?[t,new h("*","multiply",[t,o])]:[t,o],t=new h(r,n,i)}return t}function ee(e){var t,r,n,i;r=t=te(e);for(var a={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};Ae(a,e.token);)i=a[n=e.token],R(e),r=te(e),t=new h(n,i,[t,r]);return t}function te(e){var t,r;for(r=t=re(e);e.tokenType===w.SYMBOL||"in"===e.token&&T(t)||!(e.tokenType!==w.NUMBER||T(r)||q(r)&&"!"!==r.op)||"("===e.token;)r=re(e),t=new h("*","multiply",[t,r],!0);return t}function re(e){for(var t=ne(e),r=t,n=[];"/"===e.token&&_(r);){if(n.push(Jr({},e)),R(e),e.tokenType!==w.NUMBER){Jr(e,n.pop());break}if(n.push(Jr({},e)),R(e),e.tokenType!==w.SYMBOL&&"("!==e.token){n.pop(),Jr(e,n.pop());break}Jr(e,n.pop()),n.pop(),r=ne(e),t=new h("/","divide",[t,r])}return t}function ne(e){var t,r,n,i;t=ie(e);for(var a={"%":"mod",mod:"mod"};Ae(a,e.token);)n=a[r=e.token],R(e),"%"===r&&e.tokenType===w.DELIMITER&&"("!==e.token?t=new h("/","divide",[t,new c(100)],!1,!0):(i=[t,ie(e)],t=new h(r,n,i));return t}function ie(e){var t,i,o,u={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Ae(u,e.token)?(o=u[e.token],t=e.token,R(e),i=[ie(e)],new h(t,o,i)):function(e){var t,i,o,u;return t=function(e){var t,i,o;t=function(e){var t=[];if(e.tokenType===w.SYMBOL&&Ae(e.extraNodes,e.token)){var i=e.extraNodes[e.token];if(z(e),"("===e.token){if(t=[],j(e),z(e),")"!==e.token)for(t.push($(e));","===e.token;)z(e),t.push($(e));if(")"!==e.token)throw ce(e,"Parenthesis ) expected");P(e),z(e)}return new i(t)}return function(e){var t;return e.tokenType===w.SYMBOL||e.tokenType===w.DELIMITER&&e.token in D?(t=e.token,z(e),ae(e,Ae(E,t)?new c(E[t]):-1!==A.indexOf(t)?new c(r(t,"number")):new g(t))):function(e){var t;return'"'===e.token||"'"===e.token?(t=oe(e,e.token),ae(e,new c(t))):function(e){var t,i,o,u;if("["===e.token){if(j(e),z(e),"]"!==e.token){var s=ue(e);if(";"===e.token){for(o=1,i=[s];";"===e.token;)z(e),"]"!==e.token&&(i[o]=ue(e),o++);if("]"!==e.token)throw ce(e,"End of matrix ] expected");P(e),z(e),u=i[0].items.length;for(var f=1;f<o;f++)if(i[f].items.length!==u)throw fe(e,"Column dimensions mismatch ("+i[f].items.length+" !== "+u+")");t=new a(i)}else{if("]"!==e.token)throw ce(e,"End of matrix ] expected");P(e),z(e),t=s}}else P(e),z(e),t=new a([]);return ae(e,t)}return function(e){if("{"===e.token){var t;j(e);var i={};do{if(z(e),"}"!==e.token){if('"'===e.token||"'"===e.token)t=oe(e,e.token);else{if(!(e.tokenType===w.SYMBOL||e.tokenType===w.DELIMITER&&e.token in D))throw ce(e,"Symbol or string expected as object key");t=e.token,z(e)}if(":"!==e.token)throw ce(e,"Colon : expected after object key");z(e),i[t]=$(e)}}while(","===e.token);if("}"!==e.token)throw ce(e,"Comma , or bracket } expected after object value");P(e),z(e);var a=new m(i);return ae(e,a)}return function(e){var t;return e.tokenType===w.NUMBER?(t=e.token,z(e),new c(r(t,n.number))):function(e){var t;if("("===e.token){if(j(e),z(e),t=$(e),")"!==e.token)throw ce(e,"Parenthesis ) expected");return P(e),z(e),ae(e,t=new d(t))}return function(e){throw""===e.token?ce(e,"Unexpected end of expression"):ce(e,"Value expected")}(e)}(e)}(e)}(e)}(e)}(e)}(e)}(e);for(var u={"!":"factorial","'":"ctranspose"};Ae(u,e.token);)o=u[i=e.token],z(e),t=ae(e,t=new h(i,o,[t]));return t}(e),("^"===e.token||".^"===e.token)&&(o="^"===(i=e.token)?"pow":"dotPow",R(e),u=[t,ie(e)],t=new h(i,o,u)),t}(e)}function ae(e,t,r){for(var n;!("("!==e.token&&"["!==e.token&&"."!==e.token||r&&-1===r.indexOf(e.token));)if(n=[],"("===e.token){if(!U(t)&&!S(t))return t;if(j(e),z(e),")"!==e.token)for(n.push($(e));","===e.token;)z(e),n.push($(e));if(")"!==e.token)throw ce(e,"Parenthesis ) expected");P(e),z(e),t=new l(t,n)}else if("["===e.token){if(j(e),z(e),"]"!==e.token)for(n.push($(e));","===e.token;)z(e),n.push($(e));if("]"!==e.token)throw ce(e,"Parenthesis ] expected");P(e),z(e),t=new i(t,new p(n))}else{if(z(e),!(e.tokenType===w.SYMBOL||e.tokenType===w.DELIMITER&&e.token in D))throw ce(e,"Property name expected after dot");n.push(new c(e.token)),z(e),t=new i(t,new p(n,!0))}return t}function oe(e,t){for(var r="";""!==F(e)&&F(e)!==t;)if("\\"===F(e)){O(e);var n=F(e),i=C[n];if(void 0!==i)r+=i,e.index+=1;else{if("u"!==n)throw ce(e,"Bad escape character \\".concat(n));var a=e.expression.slice(e.index+1,e.index+5);if(!/^[0-9A-Fa-f]{4}$/.test(a))throw ce(e,"Invalid unicode character \\u".concat(a));r+=String.fromCharCode(parseInt(a,16)),e.index+=5}}else r+=F(e),O(e);if(z(e),e.token!==t)throw ce(e,"End of string ".concat(t," expected"));return z(e),r}function ue(e){for(var t=[$(e)],r=1;","===e.token;)z(e),"]"!==e.token&&";"!==e.token&&(t[r]=$(e),r++);return new a(t)}function se(e){return e.index-e.token.length+1}function ce(e,t){var r=se(e),n=new SyntaxError(t+" (char "+r+")");return n.char=r,n}function fe(e,t){var r=se(e),n=new SyntaxError(t+" (char "+r+")");return n.char=r,n}return x.isAlpha=function(e,t,r){return x.isValidLatinOrGreek(e)||x.isValidMathSymbol(e,r)||x.isValidMathSymbol(t,e)},x.isValidLatinOrGreek=function(e){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(e)},x.isValidMathSymbol=function(e,t){return/^[\uD835]$/.test(e)&&/^[\uDC00-\uDFFF]$/.test(t)&&/^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(t)},x.isWhitespace=function(e,t){return" "===e||"\t"===e||"\n"===e&&t>0},x.isDecimalMark=function(e,t){return"."===e&&"/"!==t&&"*"!==t&&"^"!==t},x.isDigitDot=function(e){return e>="0"&&e<="9"||"."===e},x.isDigit=function(e){return e>="0"&&e<="9"},x.isHexDigit=function(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"},t.addConversion({from:"string",to:"Node",convert:x}),x})),Wm="compile",Ym=Ce(Wm,["typed","parse"],(function(e){var t=e.typed,r=e.parse;return t(Wm,{string:function(e){return r(e).compile()},"Array | Matrix":function(e){return Yn(e,(function(e){return r(e).compile()}))}})})),Jm="evaluate",Xm=Ce(Jm,["typed","parse"],(function(e){var t=e.typed,r=e.parse;return t(Jm,{string:function(e){var t=Ye();return r(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return r(e).compile().evaluate(t)},"Array | Matrix":function(e){var t=Ye();return Yn(e,(function(e){return r(e).compile().evaluate(t)}))},"Array | Matrix, Map | Object":function(e,t){return Yn(e,(function(e){return r(e).compile().evaluate(t)}))}})})),Qm=Ce("Parser",["evaluate"],(function(e){var t=e.evaluate;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:Ye(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(e){return t(e,this.scope)},r.prototype.get=function(e){if(this.scope.has(e))return this.scope.get(e)},r.prototype.getAll=function(){return function(e){if(e instanceof Ve)return e.wrappedObject;var t,r={},n=He(e.keys());try{for(n.s();!(t=n.n()).done;){var i=t.value;qe(r,i,e.get(i))}}catch(e){n.e(e)}finally{n.f()}return r}(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(e,t){return this.scope.set(e,t),t},r.prototype.remove=function(e){this.scope.delete(e)},r.prototype.clear=function(){this.scope.clear()},r}),{isClass:!0}),Km="parser",eh=Ce(Km,["typed","Parser"],(function(e){var t=e.typed,r=e.Parser;return t(Km,{"":function(){return new r}})})),th=Ce("lup",["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],(function(e){var t=e.typed,r=e.matrix,n=e.abs,i=e.addScalar,a=e.divideScalar,o=e.multiplyScalar,u=e.subtractScalar,s=e.larger,c=e.equalScalar,f=e.unaryMinus,l=e.DenseMatrix,p=e.SparseMatrix,m=e.Spa;return t("lup",{DenseMatrix:function(e){return h(e)},SparseMatrix:function(e){return function(e){var t,r,i,u=e._size[0],l=e._size[1],h=Math.min(u,l),d=e._values,v=e._index,y=e._ptr,g=[],x=[],b=[],w=[u,h],N=[],D=[],E=[],A=[h,l],S=[],C=[];for(t=0;t<u;t++)S[t]=t,C[t]=t;var M=function(){var e=new m;r<u&&(b.push(g.length),g.push(1),x.push(r)),E.push(N.length);var l=y[r],h=y[r+1];for(i=l;i<h;i++)t=v[i],e.set(S[t],d[i]);r>0&&e.forEach(0,r-1,(function(t,r){p._forEachRow(t,g,x,b,(function(n,i){n>t&&e.accumulate(n,f(o(i,r)))}))}));var M,F,O,T,_=r,B=e.get(r),k=n(B);e.forEach(r+1,u-1,(function(e,t){var r=n(t);s(r,k)&&(_=e,k=r,B=t)})),r!==_&&(p._swapRows(r,_,w[1],g,x,b),p._swapRows(r,_,A[1],N,D,E),e.swap(r,_),F=_,O=C[M=r],T=C[F],S[O]=F,S[T]=M,C[M]=T,C[F]=O),e.forEach(0,u-1,(function(e,t){e<=r?(N.push(t),D.push(e)):(t=a(t,B),c(t,0)||(g.push(t),x.push(e)))}))};for(r=0;r<l;r++)M();return E.push(N.length),b.push(g.length),{L:new p({values:g,index:x,ptr:b,size:w}),U:new p({values:N,index:D,ptr:E,size:A}),p:S,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}(e)},Array:function(e){var t=h(r(e));return{L:t.L.valueOf(),U:t.U.valueOf(),p:t.p}}});function h(e){var t,r,f,p=e._size[0],m=e._size[1],h=Math.min(p,m),d=ye(e._data),v=[],y=[p,h],g=[],x=[h,m],b=[];for(t=0;t<p;t++)b[t]=t;for(r=0;r<m;r++){if(r>0)for(t=0;t<p;t++){var w=Math.min(t,r),N=0;for(f=0;f<w;f++)N=i(N,o(d[t][f],d[f][r]));d[t][r]=u(d[t][r],N)}var D=r,E=0,A=0;for(t=r;t<p;t++){var S=d[t][r],C=n(S);s(C,E)&&(D=t,E=C,A=S)}if(r!==D&&(b[r]=[b[D],b[D]=b[r]][0],l._swapRows(r,D,d)),r<p)for(t=r+1;t<p;t++){var M=d[t][r];c(M,0)||(d[t][r]=a(d[t][r],A))}}for(r=0;r<m;r++)for(t=0;t<p;t++)0===r&&(t<m&&(g[t]=[]),v[t]=[]),t<r?(t<m&&(g[t][r]=d[t][r]),r<p&&(v[t][r]=0)):t!==r?(t<m&&(g[t][r]=0),r<p&&(v[t][r]=d[t][r])):(t<m&&(g[t][r]=d[t][r]),r<p&&(v[t][r]=1));var F=new l({data:v,size:y}),O=new l({data:g,size:x}),T=[];for(t=0,h=b.length;t<h;t++)T[b[t]]=t;return{L:F,U:O,p:T,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}})),rh=Ce("qr",["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],(function(e){var t=e.typed,r=e.matrix,n=e.zeros,i=e.identity,a=e.isZero,o=e.equal,u=e.sign,s=e.sqrt,c=e.conj,f=e.unaryMinus,l=e.addScalar,p=e.divideScalar,m=e.multiplyScalar,h=e.subtractScalar,d=e.complex;return Jr(t("qr",{DenseMatrix:function(e){return y(e)},SparseMatrix:function(e){return function(e){throw new Error("qr not implemented for sparse matrices yet")}()},Array:function(e){var t=y(r(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:v});function v(e){var t,r,d,v=e._size[0],y=e._size[1],g=i([v],"dense"),x=g._data,b=e.clone(),w=b._data,N=n([v],"");for(d=0;d<Math.min(y,v);++d){var D=w[d][d],E=f(o(D,0)?1:u(D)),A=c(E),S=0;for(t=d;t<v;t++)S=l(S,m(w[t][d],c(w[t][d])));var C=m(E,s(S));if(!a(C)){var M=h(D,C);for(N[d]=1,t=d+1;t<v;t++)N[t]=p(w[t][d],M);var F=f(c(p(M,C))),O=void 0;for(r=d;r<y;r++){for(O=0,t=d;t<v;t++)O=l(O,m(c(N[t]),w[t][r]));for(O=m(O,F),t=d;t<v;t++)w[t][r]=m(h(w[t][r],m(N[t],O)),A)}for(t=0;t<v;t++){for(O=0,r=d;r<v;r++)O=l(O,m(x[t][r],N[r]));for(O=m(O,F),r=d;r<v;++r)x[t][r]=p(h(x[t][r],m(O,c(N[r]))),A)}}}return{Q:g,R:b,toString:function(){return"Q: "+this.Q.toString()+"\nR: "+this.R.toString()}}}function y(e){var t=v(e),r=t.R._data;if(e._data.length>0)for(var n="Complex"===r[0][0].type?d(0):0,i=0;i<r.length;++i)for(var a=0;a<i&&a<(r[0]||[]).length;++a)r[i][a]=n;return t}}));function nh(e,t,r,n,i,a,o){var u=0;for(r[o]=e;u>=0;){var s=r[o+u],c=r[n+s];-1===c?(u--,a[t++]=s):(r[n+s]=r[i+c],r[o+ ++u]=c)}return t}function ih(e){return-e-2}var ah=Ce("csAmd",["add","multiply","transpose"],(function(e){var t=e.add,r=e.multiply,n=e.transpose;return function(e,o){if(!o||e<=0||e>3)return null;var u=o._size,s=u[0],c=u[1],f=0,l=Math.max(16,10*Math.sqrt(c)),p=function(e,i,a,o,u){var s=n(i);if(1===e&&o===a)return t(i,s);if(2===e){for(var c=s._index,f=s._ptr,l=0,p=0;p<a;p++){var m=f[p];if(f[p]=l,!(f[p+1]-m>u))for(var h=f[p+1];m<h;m++)c[l++]=c[m]}return f[a]=l,i=n(s),r(s,i)}return r(s,i)}(e,o,s,c,l=Math.min(c-2,l));!function(e,t,r){for(var n=e._values,i=e._index,a=e._ptr,o=e._size[1],u=0,s=0;s<o;s++){var c=a[s];for(a[s]=u;c<a[s+1];c++)t(i[c],s,n?n[c]:1,null)&&(i[u]=i[c],n&&(n[u]=n[c]),u++)}a[o]=u,i.splice(u,i.length-u),n&&n.splice(u,n.length-u)}(p,a);for(var m,h,d,v,y,g,x,b,w,N,D,E,A,S,C,M,F=p._index,O=p._ptr,T=O[c],_=[],B=[],k=c+1,I=2*(c+1),z=3*(c+1),R=4*(c+1),q=5*(c+1),j=6*(c+1),P=7*(c+1),L=_,U=function(e,t,r,n,a,o,u,s,c,f,l,p){for(var m=0;m<e;m++)r[0+m]=t[m+1]-t[m];r[0+e]=0;for(var h=0;h<=e;h++)r[a+h]=-1,o[h]=-1,r[u+h]=-1,r[s+h]=-1,r[c+h]=1,r[f+h]=1,r[l+h]=0,r[p+h]=r[0+h];var d=i(0,0,r,f,e);return r[l+e]=-2,t[e]=-1,r[f+e]=0,d}(c,O,B,0,z,L,I,P,k,j,R,q),$=function(e,t,r,n,i,a,o,u,s,c,f){for(var l=0,p=0;p<e;p++){var m=r[n+p];if(0===m)r[i+p]=-2,l++,t[p]=-1,r[a+p]=0;else if(m>o)r[u+p]=0,r[i+p]=-1,l++,t[p]=ih(e),r[u+e]++;else{var h=r[s+m];-1!==h&&(c[h]=p),r[f+p]=r[s+m],r[s+m]=p}}return l}(c,O,B,q,R,j,l,k,z,L,I),H=0;$<c;){for(d=-1;H<c&&-1===(d=B[z+H]);H++);-1!==B[I+d]&&(L[B[I+d]]=-1),B[z+H]=B[I+d];var G=B[R+d],V=B[k+d];$+=V;var Z=0;B[k+d]=-V;var W=O[d],Y=0===G?W:T,J=Y;for(v=1;v<=G+1;v++){for(v>G?(g=d,x=W,b=B[0+d]-G):(x=O[g=F[W++]],b=B[0+g]),y=1;y<=b;y++)(w=B[k+(m=F[x++])])<=0||(Z+=w,B[k+m]=-w,F[J++]=m,-1!==B[I+m]&&(L[B[I+m]]=L[m]),-1!==L[m]?B[I+L[m]]=B[I+m]:B[z+B[q+m]]=B[I+m]);g!==d&&(O[g]=ih(d),B[j+g]=0)}for(0!==G&&(T=J),B[q+d]=Z,O[d]=Y,B[0+d]=J-Y,B[R+d]=-2,U=i(U,f,B,j,c),N=Y;N<J;N++)if(!((D=B[R+(m=F[N])])<=0)){var X=U-(w=-B[k+m]);for(W=O[m],E=O[m]+D-1;W<=E;W++)B[j+(g=F[W])]>=U?B[j+g]-=w:0!==B[j+g]&&(B[j+g]=B[q+g]+X)}for(N=Y;N<J;N++){for(A=(E=O[m=F[N]])+B[R+m]-1,S=E,C=0,M=0,W=E;W<=A;W++)if(0!==B[j+(g=F[W])]){var Q=B[j+g]-U;Q>0?(M+=Q,F[S++]=g,C+=g):(O[g]=ih(d),B[j+g]=0)}B[R+m]=S-E+1;var K=S,ee=E+B[0+m];for(W=A+1;W<ee;W++){var te=B[k+(h=F[W])];te<=0||(M+=te,F[S++]=h,C+=h)}0===M?(O[m]=ih(d),Z-=w=-B[k+m],V+=w,$+=w,B[k+m]=0,B[R+m]=-1):(B[q+m]=Math.min(B[q+m],M),F[S]=F[K],F[K]=F[E],F[E]=d,B[0+m]=S-E+1,C=(C<0?-C:C)%c,B[I+m]=B[P+C],B[P+C]=m,L[m]=C)}for(B[q+d]=Z,U=i(U+(f=Math.max(f,Z)),f,B,j,c),N=Y;N<J;N++)if(!(B[k+(m=F[N])]>=0))for(m=B[P+(C=L[m])],B[P+C]=-1;-1!==m&&-1!==B[I+m];m=B[I+m],U++){for(b=B[0+m],D=B[R+m],W=O[m]+1;W<=O[m]+b-1;W++)B[j+F[W]]=U;var re=m;for(h=B[I+m];-1!==h;){var ne=B[0+h]===b&&B[R+h]===D;for(W=O[h]+1;ne&&W<=O[h]+b-1;W++)B[j+F[W]]!==U&&(ne=0);ne?(O[h]=ih(m),B[k+m]+=B[k+h],B[k+h]=0,B[R+h]=-1,h=B[I+h],B[I+re]=h):(re=h,h=B[I+h])}}for(W=Y,N=Y;N<J;N++)(w=-B[k+(m=F[N])])<=0||(B[k+m]=w,M=B[q+m]+Z-w,-1!==B[z+(M=Math.min(M,c-$-w))]&&(L[B[z+M]]=m),B[I+m]=B[z+M],L[m]=-1,B[z+M]=m,H=Math.min(H,M),B[q+m]=M,F[W++]=m);B[k+d]=V,0==(B[0+d]=W-Y)&&(O[d]=-1,B[j+d]=0),0!==G&&(T=W)}for(m=0;m<c;m++)O[m]=ih(O[m]);for(h=0;h<=c;h++)B[z+h]=-1;for(h=c;h>=0;h--)B[k+h]>0||(B[I+h]=B[z+O[h]],B[z+O[h]]=h);for(g=c;g>=0;g--)B[k+g]<=0||-1!==O[g]&&(B[I+g]=B[z+O[g]],B[z+O[g]]=g);for(d=0,m=0;m<=c;m++)-1===O[m]&&(d=nh(m,d,B,z,I,_,j));return _.splice(_.length-1,1),_};function i(e,t,r,n,i){if(e<2||e+t<0){for(var a=0;a<i;a++)0!==r[n+a]&&(r[n+a]=1);e=2}return e}function a(e,t){return e!==t}}));function oh(e,t,r,n,i,a,o){var u,s,c,f=0;if(e<=t||r[n+t]<=r[i+e])return-1;r[i+e]=r[n+t];var l=r[a+e];if(r[a+e]=t,-1===l)f=1,c=e;else{for(f=2,c=l;c!==r[o+c];c=r[o+c]);for(u=l;u!==c;u=s)s=r[o+u],r[o+u]=c}return{jleaf:f,q:c}}var uh=Ce("csCounts",["transpose"],(function(e){var t=e.transpose;return function(e,r,n,i){if(!e||!r||!n)return null;var a,o,u,s,c,f,l,p=e._size,m=p[0],h=p[1],d=4*h+(i?h+m+1:0),v=[],y=h,g=2*h,x=3*h,b=4*h,w=5*h+1;for(u=0;u<d;u++)v[u]=-1;var N=[],D=t(e),E=D._index,A=D._ptr;for(u=0;u<h;u++)for(N[o=n[u]]=-1===v[x+o]?1:0;-1!==o&&-1===v[x+o];o=r[o])v[x+o]=u;if(i){for(u=0;u<h;u++)v[n[u]]=u;for(a=0;a<m;a++){for(u=h,f=A[a],l=A[a+1],c=f;c<l;c++)u=Math.min(u,v[E[c]]);v[w+a]=v[b+u],v[b+u]=a}}for(a=0;a<h;a++)v[0+a]=a;for(u=0;u<h;u++){for(-1!==r[o=n[u]]&&N[r[o]]--,s=i?v[b+u]:o;-1!==s;s=i?v[w+s]:-1)for(c=A[s];c<A[s+1];c++){var S=oh(a=E[c],o,v,x,y,g,0);S.jleaf>=1&&N[o]++,2===S.jleaf&&N[S.q]--}-1!==r[o]&&(v[0+o]=r[o])}for(o=0;o<h;o++)-1!==r[o]&&(N[r[o]]+=N[o]);return N}})),sh=Ce("csSqr",["add","multiply","transpose"],(function(e){var t=e.add,r=e.multiply,n=e.transpose,i=ah({add:t,multiply:r,transpose:n}),a=uh({transpose:n});return function(e,t,r){var n,o=t._ptr,u=t._size[1],s={};if(s.q=i(e,t),e&&!s.q)return null;if(r){var c=e?function(e,t,r,n){for(var i=e._values,a=e._index,o=e._ptr,u=e._size,s=e._datatype,c=u[0],f=u[1],l=null,p=[],m=[],h=0,d=0;d<f;d++){m[d]=h;for(var v=r?r[d]:d,y=o[v],g=o[v+1],x=y;x<g;x++){var b=a[x];p[h]=b,l&&(l[h]=i[x]),h++}}return m[f]=h,e.createSparseMatrix({values:l,index:p,ptr:m,size:[c,f],datatype:s})}(t,0,s.q):t;s.parent=function(e,t){if(!e)return null;var r,n,i=e._index,a=e._ptr,o=e._size,u=o[0],s=o[1],c=[],f=[],l=s;for(r=0;r<u;r++)f[l+r]=-1;for(var p=0;p<s;p++){c[p]=-1,f[0+p]=-1;for(var m=a[p],h=a[p+1],d=m;d<h;d++){var v=i[d];for(r=f[l+v];-1!==r&&r<p;r=n)n=f[0+r],f[0+r]=p,-1===n&&(c[r]=p);f[l+v]=p}}return c}(c);var f=function(e,t){if(!e)return null;var r,n=0,i=[],a=[],o=t,u=2*t;for(r=0;r<t;r++)a[0+r]=-1;for(r=t-1;r>=0;r--)-1!==e[r]&&(a[o+r]=a[0+e[r]],a[0+e[r]]=r);for(r=0;r<t;r++)-1===e[r]&&(n=nh(r,n,a,0,o,i,u));return i}(s.parent,u);if(s.cp=a(c,s.parent,f,1),c&&s.parent&&s.cp&&function(e,t){var r=e._ptr,n=e._index,i=e._size,a=i[0],o=i[1];t.pinv=[],t.leftmost=[];var u,s,c,f,l,p=t.parent,m=t.pinv,h=t.leftmost,d=[],v=a,y=a+o,g=a+2*o;for(s=0;s<o;s++)d[v+s]=-1,d[y+s]=-1,d[g+s]=0;for(u=0;u<a;u++)h[u]=-1;for(s=o-1;s>=0;s--)for(f=r[s],l=r[s+1],c=f;c<l;c++)h[n[c]]=s;for(u=a-1;u>=0;u--)m[u]=-1,-1!==(s=h[u])&&(0==d[g+s]++&&(d[y+s]=u),d[0+u]=d[v+s],d[v+s]=u);for(t.lnz=0,t.m2=a,s=0;s<o;s++)if(u=d[v+s],t.lnz++,u<0&&(u=t.m2++),m[u]=s,!(--g[s]<=0)){t.lnz+=d[g+s];var x=p[s];-1!==x&&(0===d[g+x]&&(d[y+x]=d[y+s]),d[0+d[y+s]]=d[v+x],d[v+x]=d[0+u],d[g+x]+=d[g+s])}for(u=0;u<a;u++)m[u]<0&&(m[u]=s++);return!0}(c,s))for(s.unz=0,n=0;n<u;n++)s.unz+=s.cp[n]}else s.unz=4*o[u]+u,s.lnz=s.unz;return s}}));function ch(e,t){return e[t]<0}function fh(e,t){e[t]=ih(e[t])}function lh(e){return e<0?ih(e):e}function ph(e,t,r,n,i){var a,o,u,s=t._index,c=t._ptr,f=t._size[1],l=0;for(n[0]=e;l>=0;){e=n[l];var p=i?i[e]:e;ch(c,e)||(fh(c,e),n[f+l]=p<0?0:lh(c[p]));var m=1;for(o=n[f+l],u=p<0?0:lh(c[p+1]);o<u;o++)if(!ch(c,a=s[o])){n[f+l]=o,n[++l]=a,m=0;break}m&&(l--,n[--r]=e)}return r}var mh=Ce("csSpsolve",["divideScalar","multiply","subtract"],(function(e){var t=e.divideScalar,r=e.multiply,n=e.subtract;return function(e,i,a,o,u,s,c){var f,l,p,m,h=e._values,d=e._index,v=e._ptr,y=e._size[1],g=i._values,x=i._index,b=i._ptr,w=function(e,t,r,n,i){var a,o,u,s=e._ptr,c=e._size,f=t._index,l=t._ptr,p=c[1],m=p;for(o=l[r],u=l[r+1],a=o;a<u;a++){var h=f[a];ch(s,h)||(m=ph(h,e,m,n,i))}for(a=m;a<p;a++)fh(s,n[a]);return m}(e,i,a,o,s);for(f=w;f<y;f++)u[o[f]]=0;for(l=b[a],p=b[a+1],f=l;f<p;f++)u[x[f]]=g[f];for(var N=w;N<y;N++){var D=o[N],E=s?s[D]:D;if(!(E<0))for(l=v[E],p=v[E+1],u[D]=t(u[D],h[c?l:p-1]),f=c?l+1:l,m=c?p:p-1;f<m;f++){var A=d[f];u[A]=n(u[A],r(h[f],u[D]))}}return w}})),hh=Ce("csLu",["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"],(function(e){var t=e.abs,r=e.divideScalar,n=e.multiply,i=e.subtract,a=e.larger,o=e.largerEq,u=e.SparseMatrix,s=mh({divideScalar:r,multiply:n,subtract:i});return function(e,i,c){if(!e)return null;var f,l=e._size[1],p=100,m=100;i&&(f=i.q,p=i.lnz||p,m=i.unz||m);var h,d,v=[],y=[],g=[],x=new u({values:v,index:y,ptr:g,size:[l,l]}),b=[],w=[],N=[],D=new u({values:b,index:w,ptr:N,size:[l,l]}),E=[],A=[],S=[];for(h=0;h<l;h++)A[h]=0,E[h]=-1,g[h+1]=0;p=0,m=0;for(var C=0;C<l;C++){g[C]=p,N[C]=m;var M=f?f[C]:C,F=s(x,e,M,S,A,E,1),O=-1,T=-1;for(d=F;d<l;d++)if(E[h=S[d]]<0){var _=t(A[h]);a(_,T)&&(T=_,O=h)}else w[m]=E[h],b[m++]=A[h];if(-1===O||T<=0)return null;E[M]<0&&o(t(A[M]),n(T,c))&&(O=M);var B=A[O];for(w[m]=C,b[m++]=B,E[O]=C,y[p]=O,v[p++]=1,d=F;d<l;d++)E[h=S[d]]<0&&(y[p]=h,v[p++]=r(A[h],B)),A[h]=0}for(g[l]=p,N[l]=m,d=0;d<p;d++)y[d]=E[y[d]];return v.splice(p,v.length-p),y.splice(p,y.length-p),b.splice(m,b.length-m),w.splice(m,w.length-m),{L:x,U:D,pinv:E}}})),dh=Ce("slu",["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"],(function(e){var t=e.typed,r=e.abs,n=e.add,i=e.multiply,a=e.transpose,o=e.divideScalar,u=e.subtract,s=e.larger,c=e.largerEq,f=e.SparseMatrix,l=sh({add:n,multiply:i,transpose:a}),p=hh({abs:r,divideScalar:o,multiply:i,subtract:u,larger:s,largerEq:c,SparseMatrix:f});return t("slu",{"SparseMatrix, number, number":function(e,t,r){if(!V(t)||t<0||t>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(r<0||r>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var n=l(t,e,!1),i=p(e,n,r);return{L:i.L,U:i.U,p:i.pinv,q:n.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})}));function vh(e,t){var r,n=t.length,i=[];if(e)for(r=0;r<n;r++)i[e[r]]=t[r];else for(r=0;r<n;r++)i[r]=t[r];return i}var yh="lusolve",gh=Ce(yh,["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],(function(e){var t=e.typed,r=e.matrix,n=e.lup,i=e.slu,a=e.usolve,o=e.lsolve,u=vc({DenseMatrix:e.DenseMatrix});return t(yh,{"Array, Array | Matrix":function(e,t){e=r(e);var i=n(e);return c(i.L,i.U,i.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){var r=n(e);return c(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){var r=n(e);return c(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,r,n){var a=i(e,r,n);return c(a.L,a.U,a.p,a.q,t)},"Object, Array | Matrix":function(e,t){return c(e.L,e.U,e.p,e.q,t)}});function s(e){if(l(e))return e;if(f(e))return r(e);throw new TypeError("Invalid Matrix LU decomposition")}function c(e,t,r,n,i){e=s(e),t=s(t),r&&((i=u(e,i,!0))._data=vh(r,i._data));var c=o(e,i),f=a(t,c);return n&&(f._data=vh(n,f._data)),f}})),xh="polynomialRoot",bh=Ce(xh,["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],(function(e){var t=e.typed,r=e.isZero,n=e.equalScalar,i=e.add,a=e.subtract,o=e.multiply,u=e.divide,s=e.sqrt,c=e.unaryMinus,f=e.cbrt,l=e.typeOf,p=e.im,m=e.re;return t(xh,{"number|Complex, ...number|Complex":function(e,t){for(var h=[e].concat(_e(t));h.length>0&&r(h[h.length-1]);)h.pop();if(h.length<2)throw new RangeError("Polynomial [".concat(e,", ").concat(t,"] must have a non-zero non-constant coefficient"));switch(h.length){case 2:return[c(u(h[0],h[1]))];case 3:var d=Sa(h,3),v=d[0],y=d[1],g=d[2],x=o(2,g),b=o(y,y),w=o(4,g,v);if(n(b,w))return[u(c(y),x)];var N=s(a(b,w));return[u(a(N,y),x),u(a(c(N),y),x)];case 4:var D=Sa(h,4),E=D[0],A=D[1],S=D[2],C=D[3],M=c(o(3,C)),F=o(S,S),O=o(3,C,A),T=i(o(2,S,S,S),o(27,C,C,E)),_=o(9,C,S,A);if(n(F,O)&&n(T,_))return[u(S,M)];var B,k=a(F,O),I=a(T,_),z=i(o(18,C,S,A,E),o(S,S,A,A)),R=i(o(4,S,S,S,E),o(4,C,A,A,A),o(27,C,C,E,E));return n(z,R)?[u(a(o(4,C,S,A),i(o(9,C,C,E),o(S,S,S))),o(C,k)),u(a(o(9,C,E),o(S,A)),o(2,k))]:(B=n(F,O)?I:u(i(I,s(a(o(I,I),o(4,k,k,k)))),2),f(B,!0).toArray().map((function(e){return u(i(S,e,u(k,e)),M)})).map((function(e){return"Complex"===l(e)&&n(m(e),m(e)+p(e))?m(e):e})));default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(h))}}})})),wh=Ce("Help",["evaluate"],(function(e){var t=e.evaluate;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var e=this.doc||{},r="\n";if(e.name&&(r+="Name: "+e.name+"\n\n"),e.category&&(r+="Category: "+e.category+"\n\n"),e.description&&(r+="Description:\n "+e.description+"\n\n"),e.syntax&&(r+="Syntax:\n "+e.syntax.join("\n ")+"\n\n"),e.examples){r+="Examples:\n";for(var n=!1,i=t("config()"),a={config:function(e){return n=!0,t("config(newConfig)",{newConfig:e})}},o=0;o<e.examples.length;o++){var u=e.examples[o];r+=" "+u+"\n";var s=void 0;try{s=t(u,a)}catch(e){s=e}void 0===s||x(s)||(r+=" "+tn(s,{precision:14})+"\n")}r+="\n",n&&t("config(originalConfig)",{originalConfig:i})}return e.mayThrow&&e.mayThrow.length&&(r+="Throws: "+e.mayThrow.join(", ")+"\n\n"),e.seealso&&e.seealso.length&&(r+="See also: "+e.seealso.join(", ")+"\n"),r},r.prototype.toJSON=function(){var e=ye(this.doc);return e.mathjs="Help",e},r.fromJSON=function(e){var t={};return Object.keys(e).filter((function(e){return"mathjs"!==e})).forEach((function(r){t[r]=e[r]})),new r(t)},r.prototype.valueOf=r.prototype.toString,r}),{isClass:!0}),Nh=Ce("Chain",["?on","math","typed"],(function(e){var t=e.on,r=e.math,n=e.typed;function i(e){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");$(e)?this.value=e.value:this.value=e}function a(e,t){Ee(i.prototype,e,(function(){var e=t();if("function"==typeof e)return o(e)}))}function o(e){return function(){if(0===arguments.length)return new i(e(this.value));for(var t=[this.value],r=0;r<arguments.length;r++)t[r+1]=arguments[r];if(n.isTypedFunction(e)){var a=n.resolve(e,t);if(1===a.params.length)throw new Error("chain function "+e.name+" cannot match rest parameter between chain value and additional arguments.");return new i(a.implementation.apply(e,t))}return new i(e.apply(e,t))}}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return tn(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(e){return new i(e.value)},i.createProxy=function(e,t){if("string"==typeof e)s=e,"function"==typeof(c=t)&&(i.prototype[s]=o(c));else{var r=function(t){Ae(e,t)&&void 0===u[t]&&a(t,(function(){return e[t]}))};for(var n in e)r(n)}var s,c};var u={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),t&&t("import",(function(e,t,r){r||a(e,t)})),i}),{isClass:!0}),Dh={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]},Eh={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]},Ah={bignumber:{name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]},boolean:{name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]},complex:{name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]},createUnit:{name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]},fraction:{name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},index:{name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]},matrix:{name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]},number:{name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]},sparse:{name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]},splitUnit:{name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]},string:{name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]},unit:{name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]},e:Dh,E:Dh,false:{name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},i:{name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]},Infinity:{name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]},LN2:{name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},LN10:{name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},LOG2E:{name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]},LOG10E:{name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]},NaN:{name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},null:{name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},pi:Eh,PI:Eh,phi:{name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]},SQRT1_2:{name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]},SQRT2:{name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},tau:{name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]},true:{name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},version:{name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:{name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]},lsolve:{name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]},lsolveAll:{name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]},lup:{name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]},lusolve:{name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]},leafCount:{name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},polynomialRoot:{name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]},resolve:{name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]},simplify:{name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]},simplifyConstant:{name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]},simplifyCore:{name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]},symbolicEqual:{name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]},rationalize:{name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]},slu:{name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]},usolve:{name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]},usolveAll:{name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]},qr:{name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]},abs:{name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},add:{name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]},cbrt:{name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]},ceil:{name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]},cube:{name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]},divide:{name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]},dotDivide:{name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]},dotMultiply:{name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]},dotPow:{name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]},exp:{name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]},expm:{name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]},expm1:{name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]},fix:{name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]},floor:{name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]},gcd:{name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]},hypot:{name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},lcm:{name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]},log:{name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]},log2:{name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]},log1p:{name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]},log10:{name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]},mod:{name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},multiply:{name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]},norm:{name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']},nthRoot:{name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]},nthRoots:{name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]},pow:{name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},round:{name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]},sign:{name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},sqrt:{name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]},sqrtm:{name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]},square:{name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]},subtract:{name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]},unaryMinus:{name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]},unaryPlus:{name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},xgcd:{name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]},invmod:{name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]},bitAnd:{name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},bitNot:{name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},bitOr:{name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]},bitXor:{name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]},leftShift:{name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},rightArithShift:{name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]},rightLogShift:{name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]},bellNumbers:{name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]},catalan:{name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]},composition:{name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]},stirlingS2:{name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]},config:{name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]},import:{name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]},typed:{name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]},arg:{name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]},conj:{name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]},re:{name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]},im:{name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]},evaluate:{name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]},help:{name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},distance:{name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]},intersect:{name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]},and:{name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]},not:{name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]},or:{name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]},xor:{name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]},concat:{name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},count:{name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]},cross:{name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]},column:{name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]},ctranspose:{name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},det:{name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},diag:{name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},diff:{name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]},dot:{name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]},getMatrixDataType:{name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]},identity:{name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},filter:{name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]},flatten:{name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]},forEach:{name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]},inv:{name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]},pinv:{name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the MoorePenrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]},eigs:{name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]},kron:{name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]},matrixFromFunction:{name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]},matrixFromRows:{name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]},matrixFromColumns:{name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]},map:{name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]},ones:{name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]},partitionSelect:{name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]},range:{name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},resize:{name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]},reshape:{name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]},rotate:{name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]},rotationMatrix:{name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]},row:{name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]},size:{name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},sort:{name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},squeeze:{name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]},subset:{name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},trace:{name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]},transpose:{name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},zeros:{name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]},fft:{name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},ifft:{name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},sylvester:{name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]},schur:{name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]},lyap:{name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]},solveODE:{name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]},combinations:{name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]},combinationsWithRep:{name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]},factorial:{name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]},gamma:{name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]},kldivergence:{name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]},lgamma:{name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]},multinomial:{name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]},permutations:{name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]},pickRandom:{name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]},random:{name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]},randomInt:{name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]},compare:{name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]},compareNatural:{name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]},compareText:{name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]},deepEqual:{name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]},equal:{name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]},equalText:{name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]},larger:{name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},largerEq:{name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},smaller:{name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},smallerEq:{name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]},unequal:{name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]},setCartesian:{name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]},setDifference:{name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]},setDistinct:{name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]},setIntersect:{name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]},setIsSubset:{name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]},setMultiplicity:{name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]},setPowerset:{name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]},setSize:{name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]},setSymDifference:{name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]},setUnion:{name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]},zpk2tf:{name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]},freqz:{name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]},erf:{name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]},zeta:{name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]},cumsum:{name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]},mad:{name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]},max:{name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},mean:{name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},median:{name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]},min:{name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},mode:{name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]},prod:{name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]},quantileSeq:{name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:"Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.",examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},std:{name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},sum:{name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]},variance:{name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]},corr:{name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]},acos:{name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},acosh:{name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},acot:{name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},acoth:{name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},acsc:{name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},acsch:{name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},asec:{name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},asech:{name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},asin:{name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},asinh:{name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},atan:{name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},atanh:{name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},atan2:{name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},cos:{name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},cosh:{name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},cot:{name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},coth:{name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},csc:{name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},csch:{name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},sec:{name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},sech:{name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},sin:{name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},sinh:{name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},tan:{name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},tanh:{name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},to:{name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},clone:{name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},format:{name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},bin:{name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},oct:{name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},hex:{name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},isNaN:{name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]},isInteger:{name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},isNegative:{name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},isNumeric:{name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]},hasNumericValue:{name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},isPositive:{name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},isPrime:{name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},isZero:{name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},print:{name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]},typeOf:{name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]},numeric:{name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]}},Sh="help",Ch=Ce(Sh,["typed","mathWithTransform","Help"],(function(e){var t=e.typed,r=e.mathWithTransform,n=e.Help;return t(Sh,{any:function(e){var t,i=e;if("string"!=typeof e)for(t in r)if(Ae(r,t)&&e===r[t]){i=t;break}var a=Re(Ah,i);if(!a){var o="function"==typeof i?i.name:i;throw new Error('No documentation found on "'+o+'"')}return new n(a)}})})),Mh="chain",Fh=Ce(Mh,["typed","Chain"],(function(e){var t=e.typed,r=e.Chain;return t(Mh,{"":function(){return new r},any:function(e){return new r(e)}})})),Oh=Ce("det",["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],(function(e){var t=e.typed,r=e.matrix,n=e.subtractScalar,i=e.multiply,a=e.divideScalar,o=e.isZero,u=e.unaryMinus;return t("det",{any:function(e){return ye(e)},"Array | Matrix":function(e){var t;switch((t=l(e)?e.size():Array.isArray(e)?(e=r(e)).size():[]).length){case 0:return ye(e);case 1:if(1===t[0])return ye(e.valueOf()[0]);if(0===t[0])return 1;throw new RangeError("Matrix must be square (size: "+tn(t)+")");case 2:var s=t[0],c=t[1];if(s===c)return function(e,t,r){if(1===t)return ye(e[0][0]);if(2===t)return n(i(e[0][0],e[1][1]),i(e[1][0],e[0][1]));for(var s=!1,c=new Array(t).fill(0).map((function(e,t){return t})),f=0;f<t;f++){var l=c[f];if(o(e[l][f])){var p=void 0;for(p=f+1;p<t;p++)if(!o(e[c[p]][f])){l=c[p],c[p]=c[f],c[f]=l,s=!s;break}if(p===t)return e[l][f]}for(var m=e[l][f],h=0===f?1:e[c[f-1]][f-1],d=f+1;d<t;d++)for(var v=c[d],y=f+1;y<t;y++)e[v][y]=a(n(i(e[v][y],m),i(e[v][f],e[l][y])),h)}var g=e[c[t-1]][t-1];return s?u(g):g}(e.clone().valueOf(),s);if(0===c)return 1;throw new RangeError("Matrix must be square (size: "+tn(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+tn(t)+")")}}})})),Th=Ce("inv",["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,i=e.addScalar,a=e.multiply,o=e.unaryMinus,u=e.det,s=e.identity,c=e.abs;return t("inv",{"Array | Matrix":function(e){var t=l(e)?e.size():fn(e);switch(t.length){case 1:if(1===t[0])return l(e)?r([n(1,e.valueOf()[0])]):[n(1,e[0])];throw new RangeError("Matrix must be square (size: "+tn(t)+")");case 2:var i=t[0],a=t[1];if(i===a)return l(e)?r(f(e.valueOf(),i,a),e.storage()):f(e,i,a);throw new RangeError("Matrix must be square (size: "+tn(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+tn(t)+")")}},any:function(e){return n(1,e)}});function f(e,t,r){var f,l,p,m,h;if(1===t){if(0===(m=e[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,m)]]}if(2===t){var d=u(e);if(0===d)throw Error("Cannot calculate inverse, determinant is zero");return[[n(e[1][1],d),n(o(e[0][1]),d)],[n(o(e[1][0]),d),n(e[0][0],d)]]}var v=e.concat();for(f=0;f<t;f++)v[f]=v[f].concat();for(var y=s(t).valueOf(),g=0;g<r;g++){var x=c(v[g][g]),b=g;for(f=g+1;f<t;)c(v[f][g])>x&&(x=c(v[f][g]),b=f),f++;if(0===x)throw Error("Cannot calculate inverse, determinant is zero");(f=b)!==g&&(h=v[g],v[g]=v[f],v[f]=h,h=y[g],y[g]=y[f],y[f]=h);var w=v[g],N=y[g];for(f=0;f<t;f++){var D=v[f],E=y[f];if(f!==g){if(0!==D[g]){for(p=n(o(D[g]),w[g]),l=g;l<r;l++)D[l]=i(D[l],a(p,w[l]));for(l=0;l<r;l++)E[l]=i(E[l],a(p,N[l]))}}else{for(p=w[g],l=g;l<r;l++)D[l]=n(D[l],p);for(l=0;l<r;l++)E[l]=n(E[l],p)}}}return y}})),_h="pinv",Bh=Ce(_h,["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],(function(e){var t=e.typed,r=e.matrix,n=e.inv,i=e.deepEqual,a=e.equal,o=e.dotDivide,u=e.dot,s=e.ctranspose,c=e.divideScalar,f=e.multiply,p=e.add,m=e.Complex;return t(_h,{"Array | Matrix":function(e){var t=l(e)?e.size():fn(e);switch(t.length){case 1:return v(e)?s(e):1===t[0]?n(e):o(s(e),u(e,e));case 2:if(v(e))return s(e);var i=t[0],a=t[1];if(i===a)try{return n(e)}catch(e){if(!(e instanceof Error&&e.message.match(/Cannot calculate inverse, determinant is zero/)))throw e}return l(e)?r(h(e.valueOf(),i,a),e.storage()):h(e,i,a);default:throw new RangeError("Matrix must be two dimensional (size: "+tn(t)+")")}},any:function(e){return a(e,0)?ye(e):c(1,e)}});function h(e,t,r){var i=function(e,t,r){var n=function(e,t,r){for(var n=ye(e),i=0,a=0;a<t;a++){if(r<=i)return n;for(var u=a;d(n[u][i]);)if(t===++u&&(u=a,r===++i))return n;var s=[n[a],n[u]];n[u]=s[0],n[a]=s[1];for(var c=n[a][i],l=0;l<r;l++)n[a][l]=o(n[a][l],c);for(var m=0;m<t;m++)if(m!==a){c=n[m][i];for(var h=0;h<r;h++)n[m][h]=p(n[m][h],f(-1,f(c,n[a][h])))}i++}return n}(e,t,r);return{C:e.map((function(e,r){return e.filter((function(e,r){return r<t&&!d(u(n[r],n[r]))}))})),F:n.filter((function(e,t){return!d(u(n[t],n[t]))}))}}(e,t,r),a=i.C,c=i.F,l=f(n(f(s(a),a)),s(a)),m=f(s(c),n(f(c,s(c))));return f(m,l)}function d(e){return a(p(e,m(1,1)),p(0,m(1,1)))}function v(e){return i(p(e,m(1,1)),p(f(e,0),m(1,1)))}}));function kh(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Ih(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ih(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function Ih(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var zh=Ce("eigs",["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],(function(e){var t=e.config,r=e.typed,n=e.matrix,s=e.addScalar,c=e.subtract,f=e.equal,l=e.abs,p=e.atan,m=e.cos,h=e.sin,d=e.multiplyScalar,v=e.divideScalar,y=e.inv,g=e.bignumber,x=e.multiply,b=e.add,w=e.larger,N=e.column,D=e.flatten,E=e.number,A=e.complex,S=e.sqrt,C=e.diag,M=e.size,F=e.reshape,O=e.qr,T=e.usolve,_=e.usolveAll,B=e.im,k=e.re,I=e.smaller,z=e.matrixFromColumns,R=e.dot,q=function(e){var t=e.config,r=e.addScalar,n=e.subtract,i=e.abs,a=e.atan,o=e.cos,u=e.sin,s=e.multiplyScalar,c=e.inv,f=e.bignumber,l=e.multiply,p=e.add;function m(e,t,r,n){for(var i=e.length,a=Math.cos(t),o=Math.sin(t),u=Array(i).fill(0),s=Array(i).fill(0),c=0;c<i;c++)u[c]=a*e[c][r]-o*e[c][n],s[c]=o*e[c][r]+a*e[c][n];for(var f=0;f<i;f++)e[f][r]=u[f],e[f][n]=s[f];return e}function h(e,t,i,a){for(var c=e.length,l=o(t),p=u(t),m=Array(c).fill(f(0)),h=Array(c).fill(f(0)),d=0;d<c;d++)m[d]=n(s(l,e[d][i]),s(p,e[d][a])),h[d]=r(s(p,e[d][i]),s(l,e[d][a]));for(var v=0;v<c;v++)e[v][i]=m[v],e[v][a]=h[v];return e}function d(e,t,i,a){for(var c=e.length,m=f(o(t)),h=f(u(t)),d=s(m,m),v=s(h,h),y=Array(c).fill(f(0)),g=Array(c).fill(f(0)),x=l(f(2),m,h,e[i][a]),b=r(n(s(d,e[i][i]),x),s(v,e[a][a])),w=p(s(v,e[i][i]),x,s(d,e[a][a])),N=0;N<c;N++)y[N]=n(s(m,e[i][N]),s(h,e[a][N])),g[N]=r(s(h,e[i][N]),s(m,e[a][N]));e[i][i]=b,e[a][a]=w,e[i][a]=f(0),e[a][i]=f(0);for(var D=0;D<c;D++)D!==i&&D!==a&&(e[i][D]=y[D],e[D][i]=y[D],e[a][D]=g[D],e[D][a]=g[D]);return e}function v(e,t,r,n){for(var i=e.length,a=Math.cos(t),o=Math.sin(t),u=a*a,s=o*o,c=Array(i).fill(0),f=Array(i).fill(0),l=u*e[r][r]-2*a*o*e[r][n]+s*e[n][n],p=s*e[r][r]+2*a*o*e[r][n]+u*e[n][n],m=0;m<i;m++)c[m]=a*e[r][m]-o*e[n][m],f[m]=o*e[r][m]+a*e[n][m];e[r][r]=l,e[n][n]=p,e[r][n]=0,e[n][r]=0;for(var h=0;h<i;h++)h!==r&&h!==n&&(e[r][h]=c[h],e[h][r]=c[h],e[n][h]=f[h],e[h][n]=f[h]);return e}function y(e){for(var t=e.length,r=0,n=[0,1],i=0;i<t;i++)for(var a=i+1;a<t;a++)Math.abs(r)<Math.abs(e[i][a])&&(r=Math.abs(e[i][a]),n=[i,a]);return[n,r]}function g(e){for(var t=e.length,r=0,n=[0,1],a=0;a<t;a++)for(var o=a+1;o<t;o++)i(r)<i(e[a][o])&&(r=i(e[a][o]),n=[a,o]);return[n,r]}function x(e,t,r){var n,a=e.length,o=Array(a);if(r){n=Array(a);for(var u=0;u<a;u++)n[u]=Array(a)}for(var s=0;s<a;s++){for(var c=0,f=e[0],l=0;l<e.length;l++)i(e[l])<i(f)&&(f=e[c=l]);if(o[s]=e.splice(c,1)[0],r)for(var p=0;p<a;p++)n[s][p]=t[p][c],t[p].splice(c,1)}if(!r)return{values:o};var m=n.map((function(e,t){return{value:o[t],vector:e}}));return{values:o,eigenvectors:m}}return function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.epsilon,u=arguments.length>3?arguments[3]:void 0,p=arguments.length>4?arguments[4]:void 0;if("number"===u)return function(e,r,n){var i,a,o=e.length,u=Math.abs(r/o);if(n){a=new Array(o);for(var s=0;s<o;s++)a[s]=Array(o).fill(0),a[s][s]=1}for(var c,f,l,p,h=y(e);Math.abs(h[1])>=Math.abs(u);){var d=h[0][0],g=h[0][1];e=v(e,(c=e[d][d],f=e[g][g],l=e[d][g],p=void 0,p=f-c,i=Math.abs(p)<=t.epsilon?Math.PI/4:.5*Math.atan(2*l/(f-c))),d,g),n&&(a=m(a,i,d,g)),h=y(e)}for(var b=Array(o).fill(0),w=0;w<o;w++)b[w]=e[w][w];return x(ye(b),a,n)}(e,o,p);if("BigNumber"===u)return function(e,r,o){var u,p,m=e.length,v=i(r/m);if(o){p=new Array(m);for(var y=0;y<m;y++)p[y]=Array(m).fill(0),p[y][y]=1}for(var b,w,N,D,E=g(e);i(E[1])>=i(v);){var A=E[0][0],S=E[0][1];e=d(e,(b=e[A][A],w=e[S][S],N=e[A][S],D=void 0,D=n(w,b),u=i(D)<=t.epsilon?f(-1).acos().div(4):s(.5,a(l(2,N,c(D))))),A,S),o&&(p=h(p,u,A,S)),E=g(e)}for(var C=Array(m).fill(0),M=0;M<m;M++)C[M]=e[M][M];return x(ye(C),p,o)}(e,o,p);throw TypeError("Unsupported data type: "+u)}}({config:t,addScalar:s,subtract:c,column:N,flatten:D,equal:f,abs:l,atan:p,cos:m,sin:h,multiplyScalar:d,inv:y,bignumber:g,complex:A,multiply:x,add:b}),j=function(e){var t=e.addScalar,r=e.subtract,n=e.flatten,i=e.multiply,a=e.multiplyScalar,o=e.divideScalar,u=e.sqrt,s=e.abs,c=e.bignumber,f=e.diag,l=e.size,p=e.reshape,m=e.inv,h=e.qr,d=e.usolve,v=e.usolveAll,y=e.equal,g=e.complex,x=e.larger,b=e.smaller,w=(e.matrixFromColumns,e.dot);function N(e,t,n,i,a,o,u,f){var l="BigNumber"===f,p="Complex"===f,m=l?c(0):p?g(0):0,h=l?c(1):p?g(1):1;if(b(s(n),u))return[[h,m],[m,h]];if(x(s(r(a,o)),u))return[[r(a,i),r(o,i)],[n,n]];var d=r(e,a),v=r(i,a);return b(s(t),u)&&b(s(v),u)?[[d,h],[n,m]]:[[t,m],[v,h]]}function D(e,t){for(var r=0;r<e.length;r++){var n;(n=e[r]).push.apply(n,_e(Array(t-e[r].length).fill(0)))}for(var i=e.length;i<t;i++)e.push(Array(t).fill(0)),e[i][i]=1;return e}function E(e,t,r){for(var n=0;n<e.length;n++)if(r(e[n],t))return n;return-1}function A(e,t,r,n,i){for(var a,o="BigNumber"===i?c(1e3):1e3,u=0;u<5;++u){a=S(t,r,i);try{a=d(e,a)}catch(e){continue}if(x(M(a),o))break}if(u>=5)return null;for(u=0;;){var s=d(e,a);if(b(M(C(a,[s])),n))break;if(++u>=10)return null;a=F(s)}return a}function S(e,t,r){var n="BigNumber"===r,i="Complex"===r,a=Array(e).fill(0).map((function(e){return 2*Math.random()-1}));return n&&(a=a.map((function(e){return c(e)}))),i&&(a=a.map((function(e){return g(e)}))),F(a=C(a,t),r)}function C(e,t){var n,a=l(e),u=kh(t);try{for(u.s();!(n=u.n()).done;){var s=n.value;s=p(s,a),e=r(e,i(o(w(s,e),w(s,s)),s))}}catch(e){u.e(e)}finally{u.f()}return e}function M(e){return s(u(w(e,e)))}function F(e,t){var r="Complex"===t,n="BigNumber"===t?c(1):r?g(1):1;return i(o(n,M(e)),e)}return function(e,l,p,d){var w=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],S=function(e,r,n,i,u){var l,p="BigNumber"===i,m="Complex"===i,h=p?c(0):0,d=p?c(1):m?g(1):1,v=p?c(1):1,w=p?c(10):2,N=a(w,w);u&&(l=Array(r).fill(d));for(var D=!1;!D;){D=!0;for(var E=0;E<r;E++){for(var A=h,S=h,C=0;C<r;C++)E!==C&&(A=t(A,s(e[C][E])),S=t(S,s(e[E][C])));if(!y(A,0)&&!y(S,0)){for(var M=v,F=A,O=o(S,w),T=a(S,w);b(F,O);)F=a(F,N),M=a(M,w);for(;x(F,T);)F=o(F,N),M=o(M,w);if(b(o(t(F,S),M),a(t(A,S),.95))){D=!1;for(var _=o(1,M),B=0;B<r;B++)E!==B&&(e[E][B]=a(e[E][B],_),e[B][E]=a(e[B][E],M));u&&(l[E]=a(l[E],_))}}}}return u?f(l):null}(e,l,0,d,w);!function(e,n,i,u,f,l){var p="BigNumber"===u,m="Complex"===u,h=p?c(0):m?g(0):0;p&&(i=c(i));for(var d=0;d<n-2;d++){for(var v=0,y=h,x=d+1;x<n;x++){var w=e[x][d];b(s(y),s(w))&&(y=w,v=x)}if(!b(s(y),i)){if(v!==d+1){var N=e[v];e[v]=e[d+1],e[d+1]=N;for(var D=0;D<n;D++){var E=e[D][v];e[D][v]=e[D][d+1],e[D][d+1]=E}if(f){var A=l[v];l[v]=l[d+1],l[d+1]=A}}for(var S=d+2;S<n;S++){var C=o(e[S][d],y);if(0!==C){for(var M=0;M<n;M++)e[S][M]=r(e[S][M],a(C,e[d+1][M]));for(var F=0;F<n;F++)e[F][d+1]=t(e[F][d+1],a(C,e[F][S]));if(f)for(var O=0;O<n;O++)l[S][O]=r(l[S][O],a(C,l[d+1][O]))}}}}}(e,l,p,d,w,S);var C=function(e,n,o,l,p){var m="BigNumber"===l,d="Complex"===l,v=m?c(1):d?g(1):1;m&&(o=c(o));for(var y,x,w,E,A,S,C,M,F=ye(e),O=[],T=n,_=[],B=p?f(Array(n).fill(v)):void 0,k=p?f(Array(T).fill(v)):void 0,I=0;I<=100;){I+=1;for(var z=F[T-1][T-1],R=0;R<T;R++)F[R][R]=r(F[R][R],z);var q=h(F),j=q.Q,P=q.R;F=i(P,j);for(var L=0;L<T;L++)F[L][L]=t(F[L][L],z);if(p&&(k=i(k,j)),1===T||b(s(F[T-1][T-2]),o)){I=0,O.push(F[T-1][T-1]),p&&(_.unshift([[1]]),D(k,n),B=i(B,k),T>1&&(k=f(Array(T-1).fill(v)))),T-=1,F.pop();for(var U=0;U<T;U++)F[U].pop()}else if(2===T||b(s(F[T-2][T-3]),o)){I=0;var $=(y=F[T-2][T-2],x=F[T-2][T-1],w=F[T-1][T-2],E=F[T-1][T-1],A=void 0,S=void 0,C=void 0,M=void 0,A=t(y,E),S=r(a(y,E),a(x,w)),C=a(A,.5),M=a(u(r(a(A,A),a(4,S))),.5),[t(C,M),r(C,M)]);O.push.apply(O,_e($)),p&&(_.unshift(N(F[T-2][T-2],F[T-2][T-1],F[T-1][T-2],F[T-1][T-1],$[0],$[1],o,l)),D(k,n),B=i(B,k),T>2&&(k=f(Array(T-2).fill(v)))),T-=2,F.pop(),F.pop();for(var H=0;H<T;H++)F[H].pop(),F[H].pop()}if(0===T)break}if(O.sort((function(e,t){return+r(s(e),s(t))})),I>100){var G=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+O.join(", "));throw G.values=O,G.vectors=[],G}var V=p?i(B,function(e,t){for(var r=[],n=0;n<t;n++)r[n]=Array(t).fill(0);var i,a=0,o=kh(e);try{for(o.s();!(i=o.n()).done;){for(var u=i.value,s=u.length,c=0;c<s;c++)for(var f=0;f<s;f++)r[a+c][a+f]=u[c][f];a+=s}}catch(e){o.e(e)}finally{o.f()}return r}(_,n)):void 0;return{values:O,C:V}}(e,l,p,d,w),M=C.values,F=C.C;if(w){var O=function(e,t,a,o,u,s,l){var p,h=m(a),d=i(h,e,a),x="BigNumber"===l,b="Complex"===l,w=x?c(0):b?g(0):0,N=x?c(1):b?g(1):1,D=[],S=[],C=kh(u);try{for(C.s();!(p=C.n()).done;){var M=p.value,F=E(D,M,y);-1===F?(D.push(M),S.push(1)):S[F]+=1}}catch(e){C.e(e)}finally{C.f()}for(var O=[],T=D.length,_=Array(t).fill(w),B=f(Array(t).fill(N)),k=function(){var e=D[I],u=r(d,i(e,B)),c=v(u,_);for(c.shift();c.length<S[I];){var f=A(u,t,c,s,l);if(null===f)break;c.push(f)}var p=i(m(o),a);c=c.map((function(e){return i(p,e)})),O.push.apply(O,_e(c.map((function(t){return{value:e,vector:n(t)}}))))},I=0;I<T;I++)k();return O}(e,l,F,S,M,p,d);return{values:M,eigenvectors:O}}return{values:M}}}({config:t,addScalar:s,subtract:c,multiply:x,multiplyScalar:d,flatten:D,divideScalar:v,sqrt:S,abs:l,bignumber:g,diag:C,size:M,reshape:F,qr:O,inv:y,usolve:T,usolveAll:_,equal:f,complex:A,larger:w,smaller:I,matrixFromColumns:z,dot:R});return r("eigs",{Array:function(e){return P(n(e))},"Array, number|BigNumber":function(e,t){return P(n(e),{precision:t})},"Array, Object":function(e,t){return P(n(e),t)},Matrix:function(e){return P(e,{matricize:!0})},"Matrix, number|BigNumber":function(e,t){return P(e,{precision:t,matricize:!0})},"Matrix, Object":function(e,t){var r={matricize:!0};return Jr(r,t),P(e,r)}});function P(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=!("eigenvectors"in i)||i.eigenvectors,o=function(e,t,r){var n=e.toArray(),i=e.size();if(2!==i.length||i[0]!==i[1])throw new RangeError("Matrix must be square (size: ".concat(tn(i),")"));var a=i[0];if(function(e,t,r){for(var n=0;n<t;n++)for(var i=0;i<t;i++)if(w(g(l(B(e[n][i]))),r))return!1;return!0}(n,a,t)&&(function(e,t){for(var r=0;r<t;r++)for(var n=0;n<t;n++)e[r][n]=k(e[r][n])}(n,a),function(e,t,r){for(var n=0;n<t;n++)for(var i=n;i<t;i++)if(w(g(l(c(e[n][i],e[i][n]))),r))return!1;return!0}(n,a,t))){var o=L(e,n,a);return q(n,a,t,o,r)}var u=L(e,n,a);return j(n,a,t,u,r)}(e,null!==(r=i.precision)&&void 0!==r?r:t.epsilon,a);return i.matricize&&(o.values=n(o.values),a&&(o.eigenvectors=o.eigenvectors.map((function(e){var t=e.value,r=e.vector;return{value:t,vector:n(r)}})))),a&&Object.defineProperty(o,"vectors",{enumerable:!1,get:function(){throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),o}function L(e,t,r){var n=e.datatype();if("number"===n||"BigNumber"===n||"Complex"===n)return n;for(var s=!1,c=!1,f=!1,l=0;l<r;l++)for(var p=0;p<r;p++){var m=t[l][p];if(i(m)||u(m))s=!0;else if(a(m))c=!0;else{if(!o(m))throw TypeError("Unsupported type in Matrix: "+H(m));f=!0}}if(c&&f&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),f){for(var h=0;h<r;h++)for(var d=0;d<r;d++)t[h][d]=A(t[h][d]);return"Complex"}if(c){for(var v=0;v<r;v++)for(var y=0;y<r;y++)t[v][y]=g(t[v][y]);return"BigNumber"}if(s){for(var x=0;x<r;x++)for(var b=0;b<r;b++)t[x][b]=E(t[x][b]);return"number"}throw TypeError("Matrix contains unsupported types only.")}})),Rh="expm",qh=Ce(Rh,["typed","abs","add","identity","inv","multiply"],(function(e){var t=e.typed,r=e.abs,n=e.add,i=e.identity,a=e.inv,o=e.multiply;return t(Rh,{Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+tn(t)+")");for(var s=t[0],c=function(e){for(var t=e.size()[0],n=0,i=0;i<t;i++){for(var a=0,o=0;o<t;o++)a+=r(e.get([i,o]));n=Math.max(a,n)}return n}(e),f=function(e,t){for(var r=0;r<30;r++)for(var n=0;n<=r;n++){var i=r-n;if(u(e,n,i)<1e-15)return{q:n,j:i}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}(c),l=f.q,p=f.j,m=o(e,Math.pow(2,-p)),d=i(s),v=i(s),y=1,g=m,x=-1,b=1;b<=l;b++)b>1&&(g=o(g,m),x=-x),d=n(d,o(y=y*(l-b+1)/((2*l-b+1)*b),g)),v=n(v,o(y*x,g));for(var w=o(a(v),d),N=0;N<p;N++)w=o(w,w);return h(e)?e.createSparseMatrix(w):w}});function u(e,t,r){for(var n=1,i=2;i<=t;i++)n*=i;for(var a=n,o=t+1;o<=2*t;o++)a*=o;var u=a*(2*t+1);return 8*Math.pow(e/Math.pow(2,r),2*t)*n*n/(a*u)}})),jh="sqrtm",Ph=Ce(jh,["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],(function(e){var t=e.typed,r=e.abs,n=e.add,i=e.multiply,a=e.map,o=e.sqrt,u=e.subtract,s=e.inv,c=e.size,f=e.max,p=e.identity,m=1e-6;function h(e){var t,a=0,o=e,l=p(c(e));do{var h=o;if(o=i(.5,n(h,s(l))),l=i(.5,n(l,s(h))),(t=f(r(u(o,h))))>m&&++a>1e3)throw new Error("computing square root of matrix: iterative method could not converge")}while(t>m);return o}return t(jh,{"Array | Matrix":function(e){var t=l(e)?e.size():fn(e);switch(t.length){case 1:if(1===t[0])return a(e,o);throw new RangeError("Matrix must be square (size: "+tn(t)+")");case 2:if(t[0]===t[1])return h(e);throw new RangeError("Matrix must be square (size: "+tn(t)+")");default:throw new RangeError("Matrix must be at most two dimensional (size: "+tn(t)+")")}}})})),Lh="sylvester",Uh=Ce(Lh,["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],(function(e){var t=e.typed,r=e.schur,n=e.matrixFromColumns,i=e.matrix,a=e.multiply,o=e.range,u=e.concat,s=e.transpose,c=e.index,f=e.subset,l=e.add,p=e.subtract,m=e.identity,h=e.lusolve,d=e.abs;return t(Lh,{"Matrix, Matrix, Matrix":v,"Array, Matrix, Matrix":function(e,t,r){return v(i(e),t,r)},"Array, Array, Matrix":function(e,t,r){return v(i(e),i(t),r)},"Array, Matrix, Array":function(e,t,r){return v(i(e),t,i(r))},"Matrix, Array, Matrix":function(e,t,r){return v(e,i(t),r)},"Matrix, Array, Array":function(e,t,r){return v(e,i(t),i(r))},"Matrix, Matrix, Array":function(e,t,r){return v(e,t,i(r))},"Array, Array, Array":function(e,t,r){return v(i(e),i(t),i(r)).toArray()}});function v(e,t,v){for(var y=t.size()[0],g=e.size()[0],x=r(e),b=x.T,w=x.U,N=r(a(-1,t)),D=N.T,E=N.U,A=a(a(s(w),v),E),S=o(0,g),C=[],M=function(e,t){return u(e,t,1)},F=function(e,t){return u(e,t,0)},O=0;O<y;O++)if(O<y-1&&d(f(D,c(O+1,O)))>1e-5){for(var T=F(f(A,c(S,O)),f(A,c(S,O+1))),_=0;_<O;_++)T=l(T,F(a(C[_],f(D,c(_,O))),a(C[_],f(D,c(_,O+1)))));var B=a(m(g),a(-1,f(D,c(O,O)))),k=a(m(g),a(-1,f(D,c(O+1,O)))),I=a(m(g),a(-1,f(D,c(O,O+1)))),z=a(m(g),a(-1,f(D,c(O+1,O+1)))),R=F(M(l(b,B),k),M(I,l(b,z))),q=h(R,T);C[O]=q.subset(c(o(0,g),0)),C[O+1]=q.subset(c(o(g,2*g),0)),O++}else{for(var j=f(A,c(S,O)),P=0;P<O;P++)j=l(j,a(C[P],f(D,c(P,O))));var L=f(D,c(O,O)),U=p(b,a(L,m(g)));C[O]=h(U,j)}var $=i(n.apply(void 0,C));return a(w,a($,s(E)))}})),$h="schur",Hh=Ce($h,["typed","matrix","identity","multiply","qr","norm","subtract"],(function(e){var t=e.typed,r=e.matrix,n=e.identity,i=e.multiply,a=e.qr,o=e.norm,u=e.subtract;return t($h,{Array:function(e){var t=s(r(e));return{U:t.U.valueOf(),T:t.T.valueOf()}},Matrix:function(e){return s(e)}});function s(e){var t,r=e.size()[0],s=e,c=n(r),f=0;do{t=s;var l=a(s),p=l.Q,m=l.R;if(s=i(m,p),c=i(c,p),f++>100)break}while(o(u(s,t))>1e-4);return{U:c,T:s}}})),Gh="lyap",Vh=Ce(Gh,["typed","matrix","sylvester","multiply","transpose"],(function(e){var t=e.typed,r=e.matrix,n=e.sylvester,i=e.multiply,a=e.transpose;return t(Gh,{"Matrix, Matrix":function(e,t){return n(e,a(e),i(-1,t))},"Array, Matrix":function(e,t){return n(r(e),a(r(e)),i(-1,t))},"Matrix, Array":function(e,t){return n(e,a(r(e)),r(i(-1,t)))},"Array, Array":function(e,t){return n(r(e),a(r(e)),r(i(-1,t))).toArray()}})})),Zh=Ce("divide",["typed","matrix","multiply","equalScalar","divideScalar","inv"],(function(e){var t=e.typed,r=e.matrix,n=e.multiply,i=e.equalScalar,a=e.divideScalar,o=e.inv,u=Ca({typed:t,equalScalar:i}),s=Fa({typed:t});return t("divide",xe({"Array | Matrix, Array | Matrix":function(e,t){return n(e,o(t))},"DenseMatrix, any":function(e,t){return s(e,t,a,!1)},"SparseMatrix, any":function(e,t){return u(e,t,a,!1)},"Array, any":function(e,t){return s(r(e),t,a,!1).valueOf()},"any, Array | Matrix":function(e,t){return n(e,o(t))}},a.signatures))})),Wh="distance",Yh=Ce(Wh,["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],(function(e){var t=e.typed,r=e.addScalar,n=e.subtractScalar,i=e.multiplyScalar,o=e.divideScalar,u=e.deepEqual,s=e.sqrt,c=e.abs;return t(Wh,{"Array, Array, Array":function(e,t,r){if(2===e.length&&2===t.length&&2===r.length){if(!l(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!l(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!l(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(u(t,r))throw new TypeError("LinePoint1 should not be same with LinePoint2");var a=n(r[1],t[1]),o=n(t[0],r[0]),s=n(i(r[0],t[1]),i(t[0],r[1]));return v(e[0],e[1],a,o,s)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(e,t,r){if(2===Object.keys(e).length&&2===Object.keys(t).length&&2===Object.keys(r).length){if(!l(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!l(t))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!l(r))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(u(d(t),d(r)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in e&&"pointY"in e&&"lineOnePtX"in t&&"lineOnePtY"in t&&"lineTwoPtX"in r&&"lineTwoPtY"in r){var a=n(r.lineTwoPtY,t.lineOnePtY),o=n(t.lineOnePtX,r.lineTwoPtX),s=n(i(r.lineTwoPtX,t.lineOnePtY),i(t.lineOnePtX,r.lineTwoPtY));return v(e.pointX,e.pointY,a,o,s)}throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(e,t){if(2===e.length&&3===t.length){if(!l(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return v(e[0],e[1],t[0],t[1],t[2])}if(3===e.length&&6===t.length){if(!p(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!h(t))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return y(e[0],e[1],e[2],t[0],t[1],t[2],t[3],t[4],t[5])}if(e.length===t.length&&e.length>0){if(!m(e))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!m(t))throw new TypeError("All values of an array should be numbers or BigNumbers");return g(e,t)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(e,t){if(2===Object.keys(e).length&&3===Object.keys(t).length){if(!l(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(t))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"xCoeffLine"in t&&"yCoeffLine"in t&&"constant"in t)return v(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(t).length){if(!p(e))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!h(t))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"x0"in t&&"y0"in t&&"z0"in t&&"a"in t&&"b"in t&&"c"in t)return y(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw new TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(t).length){if(!l(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!l(t))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointTwoX"in t&&"pointTwoY"in t)return g([e.pointOneX,e.pointOneY],[t.pointTwoX,t.pointTwoY]);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&3===Object.keys(t).length){if(!p(e))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(t))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointOneZ"in e&&"pointTwoX"in t&&"pointTwoY"in t&&"pointTwoZ"in t)return g([e.pointOneX,e.pointOneY,e.pointOneZ],[t.pointTwoX,t.pointTwoY,t.pointTwoZ]);throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},Array:function(e){if(!function(e){if(2===e[0].length&&f(e[0][0])&&f(e[0][1])){if(e.some((function(e){return 2!==e.length||!f(e[0])||!f(e[1])})))return!1}else{if(!(3===e[0].length&&f(e[0][0])&&f(e[0][1])&&f(e[0][2])))return!1;if(e.some((function(e){return 3!==e.length||!f(e[0])||!f(e[1])||!f(e[2])})))return!1}return!0}(e))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){for(var t=[],r=[],n=[],i=0;i<e.length-1;i++)for(var a=i+1;a<e.length;a++)2===e[0].length?(r=[e[i][0],e[i][1]],n=[e[a][0],e[a][1]]):3===e[0].length&&(r=[e[i][0],e[i][1],e[i][2]],n=[e[a][0],e[a][1],e[a][2]]),t.push(g(r,n));return t}(e)}});function f(e){return"number"==typeof e||a(e)}function l(e){return e.constructor!==Array&&(e=d(e)),f(e[0])&&f(e[1])}function p(e){return e.constructor!==Array&&(e=d(e)),f(e[0])&&f(e[1])&&f(e[2])}function m(e){return Array.isArray(e)||(e=d(e)),e.every(f)}function h(e){return e.constructor!==Array&&(e=d(e)),f(e[0])&&f(e[1])&&f(e[2])&&f(e[3])&&f(e[4])&&f(e[5])}function d(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;n++)r.push(e[t[n]]);return r}function v(e,t,n,a,u){var f=c(r(r(i(n,e),i(a,t)),u)),l=s(r(i(n,n),i(a,a)));return o(f,l)}function y(e,t,a,u,c,f,l,p,m){var h=[n(i(n(c,t),m),i(n(f,a),p)),n(i(n(f,a),l),i(n(u,e),m)),n(i(n(u,e),p),i(n(c,t),l))];h=s(r(r(i(h[0],h[0]),i(h[1],h[1])),i(h[2],h[2])));var d=s(r(r(i(l,l),i(p,p)),i(m,m)));return o(h,d)}function g(e,t){for(var a=e.length,o=0,u=0,c=0;c<a;c++)u=n(e[c],t[c]),o=r(i(u,u),o);return s(o)}})),Jh=Ce("intersect",["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],(function(e){var t=e.typed,r=e.config,n=e.abs,i=e.add,a=e.addScalar,o=e.matrix,u=e.multiply,s=e.multiplyScalar,c=e.divideScalar,f=e.subtract,l=e.smaller,p=e.equalScalar,m=e.flatten,h=e.isZero,d=e.isNumeric;return t("intersect",{"Array, Array, Array":v,"Array, Array, Array, Array":y,"Matrix, Matrix, Matrix":function(e,t,r){var n=v(e.valueOf(),t.valueOf(),r.valueOf());return null===n?null:o(n)},"Matrix, Matrix, Matrix, Matrix":function(e,t,r,n){var i=y(e.valueOf(),t.valueOf(),r.valueOf(),n.valueOf());return null===i?null:o(i)}});function v(e,t,r){if(e=g(e),t=g(t),r=g(r),!b(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!b(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!function(e){return 4===e.length&&d(e[0])&&d(e[1])&&d(e[2])&&d(e[3])}(r))throw new TypeError("Array with 4 numbers expected as third argument");return function(e,t,r,n,i,o,u,l,p,m){var h=s(e,u),d=s(n,u),v=s(t,l),y=s(i,l),g=s(r,p),x=s(o,p),b=f(f(f(m,h),v),g),w=f(f(f(a(a(d,y),x),h),v),g),N=c(b,w);return[a(e,s(N,f(n,e))),a(t,s(N,f(i,t))),a(r,s(N,f(o,r)))]}(e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2],r[3])}function y(e,t,o,m){if(e=g(e),t=g(t),o=g(o),m=g(m),2===e.length){if(!x(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!x(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!x(o))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!x(m))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(e,t,o,p){var m=e,d=o,v=f(m,t),y=f(d,p),g=f(s(v[0],y[1]),s(y[0],v[1]));if(h(g))return null;if(l(n(g),r.epsilon))return null;var x=s(y[0],m[1]),b=s(y[1],m[0]),w=s(y[0],d[1]),N=s(y[1],d[0]),D=c(a(f(f(x,b),w),N),g);return i(u(v,D),m)}(e,t,o,m)}if(3===e.length){if(!b(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!b(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!b(o))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!b(m))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return function(e,t,r,n,i,o,u,l,m,d,v,y){var g=w(e,u,d,u,t,l,v,l,r,m,y,m),x=w(d,u,n,e,v,l,i,t,y,m,o,r),b=w(e,u,n,e,t,l,i,t,r,m,o,r),N=w(d,u,d,u,v,l,v,l,y,m,y,m),D=w(n,e,n,e,i,t,i,t,o,r,o,r),E=f(s(g,x),s(b,N)),A=f(s(D,N),s(x,x));if(h(A))return null;var S=c(E,A),C=c(a(g,s(S,x)),N),M=a(e,s(S,f(n,e))),F=a(t,s(S,f(i,t))),O=a(r,s(S,f(o,r))),T=a(u,s(C,f(d,u))),_=a(l,s(C,f(v,l))),B=a(m,s(C,f(y,m)));return p(M,T)&&p(F,_)&&p(O,B)?[M,F,O]:null}(e[0],e[1],e[2],t[0],t[1],t[2],o[0],o[1],o[2],m[0],m[1],m[2])}throw new TypeError("Arrays with two or thee dimensional points expected")}function g(e){return 1===e.length?e[0]:e.length>1&&Array.isArray(e[0])&&e.every((function(e){return Array.isArray(e)&&1===e.length}))?m(e):e}function x(e){return 2===e.length&&d(e[0])&&d(e[1])}function b(e){return 3===e.length&&d(e[0])&&d(e[1])&&d(e[2])}function w(e,t,r,n,i,o,u,c,l,p,m,h){var d=s(f(e,t),f(r,n)),v=s(f(i,o),f(u,c)),y=s(f(l,p),f(m,h));return a(a(d,v),y)}})),Xh=Ce("sum",["typed","config","add","numeric"],(function(e){var t=e.typed,r=e.config,n=e.add,i=e.numeric;return t("sum",{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){try{return Jn(e,t,n)}catch(e){throw js(e,"sum")}},"...":function(e){if(Zn(e))throw new TypeError("Scalar values expected in function sum");return a(e)}});function a(e){var t;return Wn(e,(function(e){try{t=void 0===t?e:n(t,e)}catch(t){throw js(t,"sum",e)}})),void 0===t&&(t=i(0,r.number)),"string"==typeof t&&(t=i(t,r.number)),t}})),Qh="cumsum",Kh=Ce(Qh,["typed","add","unaryPlus"],(function(e){var t=e.typed,r=e.add,n=e.unaryPlus;return t(Qh,{Array:i,Matrix:function(e){return e.create(i(e.valueOf()))},"Array, number | BigNumber":o,"Matrix, number | BigNumber":function(e,t){return e.create(o(e.valueOf(),t))},"...":function(e){if(Zn(e))throw new TypeError("All values expected to be scalar in function cumsum");return i(e)}});function i(e){try{return a(e)}catch(e){throw js(e,Qh)}}function a(e){if(0===e.length)return[];for(var t=[n(e[0])],i=1;i<e.length;++i)t.push(r(t[i-1],e[i]));return t}function o(e,t){var r=fn(e);if(t<0||t>=r.length)throw new cn(t,r.length);try{return u(e,t)}catch(e){throw js(e,Qh)}}function u(e,t){var r,n,i;if(t<=0){var o=e[0][0];if(Array.isArray(o)){for(i=Vn(e),n=[],r=0;r<i.length;r++)n[r]=u(i[r],t-1);return n}return a(e)}for(n=[],r=0;r<e.length;r++)n[r]=u(e[r],t-1);return n}})),ed="mean",td=Ce(ed,["typed","add","divide"],(function(e){var t=e.typed,r=e.add,n=e.divide;return t(ed,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){try{var i=Jn(e,t,r),a=Array.isArray(e)?fn(e):e.size();return n(i,a[t])}catch(e){throw js(e,"mean")}},"...":function(e){if(Zn(e))throw new TypeError("Scalar values expected in function mean");return i(e)}});function i(e){var t,i=0;if(Wn(e,(function(e){try{t=void 0===t?e:r(t,e),i++}catch(t){throw js(t,"mean",e)}})),0===i)throw new Error("Cannot calculate the mean of an empty array");return n(t,i)}})),rd="median",nd=Ce(rd,["typed","add","divide","compare","partitionSelect"],(function(e){var t=e.typed,r=e.add,n=e.divide,i=e.compare,a=e.partitionSelect;function o(e){try{var t=(e=An(e.valueOf())).length;if(0===t)throw new Error("Cannot calculate median of an empty array");if(t%2==0){for(var r=t/2-1,n=a(e,r+1),o=e[r],c=0;c<r;++c)i(e[c],o)>0&&(o=e[c]);return s(o,n)}var f=a(e,(t-1)/2);return u(f)}catch(e){throw js(e,"median")}}var u=t({"number | BigNumber | Complex | Unit":function(e){return e}}),s=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,t){return n(r(e,t),2)}});return t(rd,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("median(A, dim) is not yet supported")},"...":function(e){if(Zn(e))throw new TypeError("Scalar values expected in function median");return o(e)}})})),id=Ce("mad",["typed","abs","map","median","subtract"],(function(e){var t=e.typed,r=e.abs,n=e.map,i=e.median,a=e.subtract;return t("mad",{"Array | Matrix":o,"...":function(e){return o(e)}});function o(e){if(0===(e=An(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var t=i(e);return i(n(e,(function(e){return r(a(e,t))})))}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf("median")?new TypeError(e.message.replace("median","mad")):js(e,"mad")}}})),ad="unbiased",od="variance",ud=Ce(od,["typed","add","subtract","multiply","divide","apply","isNaN"],(function(e){var t=e.typed,r=e.add,n=e.subtract,i=e.multiply,o=e.divide,u=e.apply,s=e.isNaN;return t(od,{"Array | Matrix":function(e){return c(e,ad)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(e,t){return f(e,t,ad)},"Array | Matrix, number | BigNumber, string":f,"...":function(e){return c(e,ad)}});function c(e,t){var u,c=0;if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Wn(e,(function(e){try{u=void 0===u?e:r(u,e),c++}catch(t){throw js(t,"variance",e)}})),0===c)throw new Error("Cannot calculate variance of an empty array");var f=o(u,c);if(u=void 0,Wn(e,(function(e){var t=n(e,f);u=void 0===u?i(t,t):r(u,i(t,t))})),s(u))return u;switch(t){case"uncorrected":return o(u,c);case"biased":return o(u,c+1);case"unbiased":var l=a(u)?u.mul(0):0;return 1===c?l:o(u,c-1);default:throw new Error('Unknown normalization "'+t+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function f(e,t,r){try{if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return u(e,t,(function(e){return c(e,r)}))}catch(e){throw js(e,"variance")}}})),sd="quantileSeq",cd=Ce(sd,["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],(function(e){var t=e.typed,r=e.bignumber,n=e.add,a=e.subtract,o=e.divide,u=e.multiply,s=e.partitionSelect,c=e.compare,f=e.isInteger,l=e.smaller,p=e.smallerEq,m=e.larger,h=ga({typed:t,isInteger:f});return t(sd,{"Array | Matrix, number | BigNumber":function(e,t){return v(e,t,!1)},"Array | Matrix, number | BigNumber, number":function(e,t,r){return d(e,t,!1,r,v)},"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":function(e,t,r,n){return d(e,t,r,n,v)},"Array | Matrix, Array | Matrix":function(e,t){return y(e,t,!1)},"Array | Matrix, Array | Matrix, number":function(e,t,r){return d(e,t,!1,r,y)},"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":function(e,t,r,n){return d(e,t,r,n,y)}});function d(e,t,r,n,i){return h(e,n,(function(e){return i(e,t,r)}))}function v(e,t,a){var u,s=e.valueOf();if(l(t,0))throw new Error("N/prob must be non-negative");if(p(t,1))return i(t)?g(s,t,a):r(g(s,t,a));if(m(t,1)){if(!f(t))throw new Error("N must be a positive integer");if(m(t,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var c=n(t,1);u=[];for(var h=0;l(h,t);h++){var d=o(h+1,c);u.push(g(s,d,a))}return i(t)?u:r(u)}}function y(e,t,r){for(var n=e.valueOf(),i=t.valueOf(),a=[],o=0;o<i.length;++o)a.push(g(n,i[o],r));return a}function g(e,t,r){var o=An(e),l=o.length;if(0===l)throw new Error("Cannot calculate quantile of an empty sequence");var p,m,h=i(t)?t*(l-1):t.times(l-1),d=i(t)?Math.floor(h):h.floor().toNumber(),v=i(t)?h%1:h.minus(d);if(f(h))return r?o[h]:s(o,i(t)?h:h.valueOf());if(r)p=o[d],m=o[d+1];else{m=s(o,d+1),p=o[d];for(var y=0;y<d;++y)c(o[y],p)>0&&(p=o[y])}return n(u(p,a(1,v)),u(m,v))}})),fd=Ce("std",["typed","map","sqrt","variance"],(function(e){var t=e.typed,r=e.map,n=e.sqrt,i=e.variance;return t("std",{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(e){return a(e)}});function a(e,t){if(0===e.length)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var a=i.apply(null,arguments);return p(a)?r(a,n):n(a)}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf(" variance")?new TypeError(e.message.replace(" variance"," std")):e}}})),ld="corr",pd=Ce(ld,["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],(function(e){var t=e.typed,r=e.matrix,n=e.sqrt,i=e.sum,a=e.add,o=e.subtract,u=e.multiply,s=e.pow,c=e.divide;return t(ld,{"Array, Array":function(e,t){return f(e,t)},"Matrix, Matrix":function(e,t){var n=f(e.toArray(),t.toArray());return Array.isArray(n)?r(n):n}});function f(e,t){var r=[];if(Array.isArray(e[0])&&Array.isArray(t[0])){if(e.length!==t.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var n=0;n<e.length;n++){if(e[n].length!==t[n].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");r.push(l(e[n],t[n]))}return r}if(e.length!==t.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return l(e,t)}function l(e,t){var r=e.length,f=i(e),l=i(t),p=e.reduce((function(e,r,n){return a(e,u(r,t[n]))}),0),m=i(e.map((function(e){return s(e,2)}))),h=i(t.map((function(e){return s(e,2)}))),d=o(u(r,p),u(f,l)),v=n(u(o(u(r,m),s(f,2)),o(u(r,h),s(l,2))));return c(d,v)}}));function md(e,t){if(t<e)return 1;if(t===e)return t;var r=t+e>>1;return md(e,r)*md(r+1,t)}function hd(e,t){if(!V(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!V(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var r=e-t,n=1,i=2,a=t<r?t:r,o=t<r?r+1:t+1;o<=e;++o)for(n*=o;i<=a&&n%i==0;)n/=i,++i;return i<=a&&(n/=md(i,a)),n}hd.signature="number, number";var dd="combinations",vd=Ce(dd,["typed"],(function(e){return(0,e.typed)(dd,{"number, number":hd,"BigNumber, BigNumber":function(e,t){var r,n,i=e.constructor,a=e.minus(t),o=new i(1);if(!yd(e)||!yd(t))throw new TypeError("Positive integer value expected in function combinations");if(t.gt(e))throw new TypeError("k must be less than n in function combinations");if(r=o,t.lt(a))for(n=o;n.lte(a);n=n.plus(o))r=r.times(t.plus(n)).dividedBy(n);else for(n=o;n.lte(t);n=n.plus(o))r=r.times(a.plus(n)).dividedBy(n);return r}})}));function yd(e){return e.isInteger()&&e.gte(0)}var gd="combinationsWithRep",xd=Ce(gd,["typed"],(function(e){return(0,e.typed)(gd,{"number, number":function(e,t){if(!V(e)||e<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!V(t)||t<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e<1)throw new TypeError("k must be less than or equal to n + k - 1");return t<e-1?md(e,e+t-1)/md(1,t):md(t+1,e+t-1)/md(1,e-1)},"BigNumber, BigNumber":function(e,t){var r,n,i=new(0,e.constructor)(1),a=e.minus(i);if(!bd(e)||!bd(t))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e.lt(i))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(r=i,t.lt(a))for(n=i;n.lte(a);n=n.plus(i))r=r.times(t.plus(n)).dividedBy(n);else for(n=i;n.lte(t);n=n.plus(i))r=r.times(a.plus(n)).dividedBy(n);return r}})}));function bd(e){return e.isInteger()&&e.gte(0)}function wd(e){var t;if(V(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:md(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*wd(1-e));if(e>=171.35)return 1/0;if(e>85){var r=e*e,n=r*e,i=n*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*r)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,t=Dd[0];for(var o=1;o<Dd.length;++o)t+=Dd[o]/(e+o);var u=e+Nd+.5;return Math.sqrt(2*Math.PI)*Math.pow(u,e+.5)*Math.exp(-u)*t}wd.signature="number";var Nd=4.7421875,Dd=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],Ed=.9189385332046728,Ad=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function Sd(e){if(e<0)return NaN;if(0===e)return 1/0;if(!isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-Sd(1-e);for(var t=5+(e-=1)+.5,r=Ad[0],n=6;n>=1;n--)r+=Ad[n]/(e+n);return Ed+(e+.5)*Math.log(t)-t+Math.log(r)}Sd.signature="number";var Cd="gamma",Md=Ce(Cd,["typed","config","multiplyScalar","pow","BigNumber","Complex"],(function(e){var t=e.typed,r=e.config,n=(e.multiplyScalar,e.pow,e.BigNumber),i=e.Complex;return t(Cd,{number:wd,Complex:function e(t){if(0===t.im)return wd(t.re);if(t.re<.5){var r=new i(1-t.re,-t.im),n=new i(Math.PI*t.re,Math.PI*t.im);return new i(Math.PI).div(n.sin()).div(e(r))}t=new i(t.re-1,t.im);for(var a=new i(Dd[0],0),o=1;o<Dd.length;++o){var u=new i(Dd[o],0);a=a.add(u.div(t.add(o)))}var s=new i(t.re+Nd+.5,t.im),c=Math.sqrt(2*Math.PI),f=s.pow(t.add(.5)),l=s.neg().exp();return a.mul(c).mul(f).mul(l)},BigNumber:function(e){if(e.isInteger())return e.isNegative()||e.isZero()?new n(1/0):a(e.minus(1));if(!e.isFinite())return new n(e.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function a(e){if(e<8)return new n([1,1,2,6,24,120,720,5040][e]);var t=r.precision+(0|Math.log(e.toNumber())),i=n.clone({precision:t});if(e%2==1)return e.times(a(new n(e-1)));for(var o=e,u=new i(e),s=e.toNumber();o>2;)s+=o-=2,u=u.times(s);return new n(u.toPrecision(n.precision))}})),Fd="lgamma",Od=Ce(Fd,["Complex","typed"],(function(e){var t=e.Complex,r=e.typed,n=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(Fd,{number:Sd,Complex:function e(r){if(r.isNaN())return new t(NaN,NaN);if(0===r.im)return new t(Sd(r.re),0);if(r.re>=7||Math.abs(r.im)>=7)return i(r);if(r.re<=.1){var n=(s=6.283185307179586,(!0^((c=r.im)>0||!(c<0)&&1/c==1/0)?-s:s)*Math.floor(.5*r.re+.25)),o=r.mul(Math.PI).sin().log(),u=e(new t(1-r.re,-r.im));return new t(1.1447298858494002,n).sub(o).sub(u)}return r.im>=0?a(r):a(r.conjugate()).conjugate();var s,c},BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function i(e){for(var r=e.sub(.5).mul(e.log()).sub(e).add(Ed),i=new t(1,0).div(e),a=i.div(e),o=n[0],u=n[1],s=2*a.re,c=a.re*a.re+a.im*a.im,f=2;f<8;f++){var l=u;u=-c*o+n[f],o=s*o+l}var p=i.mul(a.mul(o).add(u));return r.add(p)}function a(e){var r=0,n=0,a=e;for(e=e.add(1);e.re<=7;){var o=(a=a.mul(e)).im<0?1:0;0!==o&&0===n&&r++,n=o,e=e.add(1)}return i(e).sub(a.log()).sub(new t(0,2*r*Math.PI*1))}})),Td="factorial",_d=Ce(Td,["typed","gamma"],(function(e){var t=e.typed,r=e.gamma;return t(Td,{number:function(e){if(e<0)throw new Error("Value must be non-negative");return r(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error("Value must be non-negative");return r(e.plus(1))},"Array | Matrix":t.referToSelf((function(e){return function(t){return Yn(t,e)}}))})})),Bd="kldivergence",kd=Ce(Bd,["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],(function(e){var t=e.typed,r=e.matrix,n=e.divide,i=e.sum,a=e.multiply,o=e.map,u=e.dotDivide,s=e.log,c=e.isNumeric;return t(Bd,{"Array, Array":function(e,t){return f(r(e),r(t))},"Matrix, Array":function(e,t){return f(e,r(t))},"Array, Matrix":function(e,t){return f(r(e),t)},"Matrix, Matrix":function(e,t){return f(e,t)}});function f(e,t){var r=t.size().length,f=e.size().length;if(r>1)throw new Error("first object must be one dimensional");if(f>1)throw new Error("second object must be one dimensional");if(r!==f)throw new Error("Length of two vectors must be equal");if(0===i(e))throw new Error("Sum of elements in first object must be non zero");if(0===i(t))throw new Error("Sum of elements in second object must be non zero");var l=n(e,i(e)),p=n(t,i(t)),m=i(a(l,o(u(l,p),(function(e){return s(e)}))));return c(m)?m:Number.NaN}})),Id="multinomial",zd=Ce(Id,["typed","add","divide","multiply","factorial","isInteger","isPositive"],(function(e){var t=e.typed,r=e.add,n=e.divide,i=e.multiply,a=e.factorial,o=e.isInteger,u=e.isPositive;return t(Id,{"Array | Matrix":function(e){var t=0,s=1;return Wn(e,(function(e){if(!o(e)||!u(e))throw new TypeError("Positive integer value expected in function multinomial");t=r(t,e),s=i(s,a(e))})),n(a(t),s)}})})),Rd="permutations",qd=Ce(Rd,["typed","factorial"],(function(e){var t=e.typed,r=e.factorial;return t(Rd,{"number | BigNumber":r,"number, number":function(e,t){if(!V(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!V(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(t>e)throw new TypeError("second argument k must be less than or equal to first argument n");return md(e-t+1,e)},"BigNumber, BigNumber":function(e,t){var r,n;if(!jd(e)||!jd(t))throw new TypeError("Positive integer value expected in function permutations");if(t.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(r=e.mul(0).add(1),n=e.minus(t).plus(1);n.lte(e);n=n.plus(1))r=r.times(n);return r}})}));function jd(e){return e.isInteger()&&e.gte(0)}r(9089);var Pd=r(7391),Ld=Pd(Date.now());function Ud(e){var t,r;return t=null===(r=e)?Ld:Pd(String(r)),function(){return t()}}var $d="pickRandom",Hd=Ce($d,["typed","config","?on"],(function(e){var t=e.typed,r=e.config,n=e.on,a=Ud(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(a=Ud(e.randomSeed))})),t($d,{"Array | Matrix":function(e){return o(e,{})},"Array | Matrix, Object":function(e,t){return o(e,t)},"Array | Matrix, number":function(e,t){return o(e,{number:t})},"Array | Matrix, Array | Matrix":function(e,t){return o(e,{weights:t})},"Array | Matrix, Array | Matrix, number":function(e,t,r){return o(e,{number:r,weights:t})},"Array | Matrix, number, Array | Matrix":function(e,t,r){return o(e,{number:t,weights:r})}});function o(e,t){var r=t.number,n=t.weights,o=t.elementWise,u=void 0===o||o,s=void 0===r;s&&(r=1);var c=l(e)?e.create:l(n)?n.create:null;e=e.valueOf(),n&&(n=n.valueOf()),!0===u&&(e=An(e),n=An(n));var f=0;if(void 0!==n){if(n.length!==e.length)throw new Error("Weights must have the same length as possibles");for(var p=0,m=n.length;p<m;p++){if(!i(n[p])||n[p]<0)throw new Error("Weights must be an array of positive numbers");f+=n[p]}}for(var h,d=e.length,v=[];v.length<r;){if(void 0===n)h=e[Math.floor(a()*d)];else for(var y=a()*f,g=0,x=e.length;g<x;g++)if((y-=n[g])<0){h=e[g];break}v.push(h)}return s?v[0]:c?c(v):v}}));function Gd(e,t){var r=[];if((e=e.slice(0)).length>1)for(var n=0,i=e.shift();n<i;n++)r.push(Gd(e,t));else for(var a=0,o=e.shift();a<o;a++)r.push(t());return r}var Vd="random",Zd=Ce(Vd,["typed","config","?on"],(function(e){var t=e.typed,r=e.config,n=e.on,i=Ud(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(i=Ud(e.randomSeed))})),t(Vd,{"":function(){return o(0,1)},number:function(e){return o(0,e)},"number, number":function(e,t){return o(e,t)},"Array | Matrix":function(e){return a(e,0,1)},"Array | Matrix, number":function(e,t){return a(e,0,t)},"Array | Matrix, number, number":function(e,t,r){return a(e,t,r)}});function a(e,t,r){var n=Gd(e.valueOf(),(function(){return o(t,r)}));return l(e)?e.create(n):n}function o(e,t){return e+i()*(t-e)}})),Wd="randomInt",Yd=Ce(Wd,["typed","config","?on"],(function(e){var t=e.typed,r=e.config,n=e.on,i=Ud(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(i=Ud(e.randomSeed))})),t(Wd,{"":function(){return o(0,1)},number:function(e){return o(0,e)},"number, number":function(e,t){return o(e,t)},"Array | Matrix":function(e){return a(e,0,1)},"Array | Matrix, number":function(e,t){return a(e,0,t)},"Array | Matrix, number, number":function(e,t,r){return a(e,t,r)}});function a(e,t,r){var n=Gd(e.valueOf(),(function(){return o(t,r)}));return l(e)?e.create(n):n}function o(e,t){return Math.floor(e+i()*(t-e))}})),Jd="stirlingS2",Xd=Ce(Jd,["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],(function(e){var t=e.typed,r=e.addScalar,n=(e.subtractScalar,e.multiplyScalar),a=(e.divideScalar,e.pow,e.factorial,e.combinations,e.isNegative),o=e.isInteger,u=e.number,s=e.bignumber,c=e.larger,f=[],l=[];return t(Jd,{"number | BigNumber, number | BigNumber":function(e,t){if(!o(e)||a(e)||!o(t)||a(t))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(c(t,e))throw new TypeError("k must be less than or equal to n in function stirlingS2");var p=!(i(e)&&i(t)),m=p?l:f,h=p?s:u,d=u(e),v=u(t);if(m[d]&&m[d].length>v)return m[d][v];for(var y=0;y<=d;++y)if(m[y]||(m[y]=[h(0===y?1:0)]),0!==y)for(var g=m[y],x=m[y-1],b=g.length;b<=y&&b<=v;++b)g[b]=b===y?1:r(n(h(b),x[b]),x[b-1]);return m[d][v]}})})),Qd="bellNumbers",Kd=Ce(Qd,["typed","addScalar","isNegative","isInteger","stirlingS2"],(function(e){var t=e.typed,r=e.addScalar,n=e.isNegative,i=e.isInteger,a=e.stirlingS2;return t(Qd,{"number | BigNumber":function(e){if(!i(e)||n(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var t=0,o=0;o<=e;o++)t=r(t,a(e,o));return t}})})),ev="catalan",tv=Ce(ev,["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],(function(e){var t=e.typed,r=e.addScalar,n=e.divideScalar,i=e.multiplyScalar,a=e.combinations,o=e.isNegative,u=e.isInteger;return t(ev,{"number | BigNumber":function(e){if(!u(e)||o(e))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(e,2),e),r(e,1))}})})),rv="composition",nv=Ce(rv,["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],(function(e){var t=e.typed,r=e.addScalar,n=e.combinations,i=e.isPositive,a=(e.isNegative,e.isInteger),o=e.larger;return t(rv,{"number | BigNumber, number | BigNumber":function(e,t){if(!(a(e)&&i(e)&&a(t)&&i(t)))throw new TypeError("Positive integer value expected in function composition");if(o(t,e))throw new TypeError("k must be less than or equal to n in function composition");return n(r(e,-1),r(t,-1))}})})),iv="leafCount",av=Ce(iv,["parse","typed"],(function(e){function t(e){var r=0;return e.forEach((function(e){r+=t(e)})),r||1}return e.parse,(0,e.typed)(iv,{Node:function(e){return t(e)}})}));function ov(e){return T(e)||q(e)&&e.isUnary()&&T(e.args[0])}function uv(e){return!!T(e)||!(!k(e)&&!q(e)||!e.args.every(uv))||!(!j(e)||!uv(e.content))}function sv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function cv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sv(Object(r),!0).forEach((function(t){Za(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sv(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(2781);var fv=Ce("simplifyUtil",["FunctionNode","OperatorNode","SymbolNode"],(function(e){var t=e.FunctionNode,r=e.OperatorNode,n=e.SymbolNode,i=!0,a=!1,o="defaultF",u={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}};function s(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u,n=o;if("string"==typeof e?n=e:q(e)?n=e.fn.toString():k(e)?n=e.name:j(e)&&(n="paren"),Ae(r,n)){var i=r[n];if(Ae(i,t))return i[t];if(Ae(u,n))return u[n][t]}if(Ae(r,o)){var a=r[o];return Ae(a,t)?a[t]:u[o][t]}if(Ae(u,n)){var s=u[n];if(Ae(s,t))return s[t]}return u[o][t]}function c(e){return s(e,"associative",arguments.length>1&&void 0!==arguments[1]?arguments[1]:u)}function f(e,t){var r,n=[];return c(e,t)?(r=e.op,function e(t){for(var i=0;i<t.args.length;i++){var a=t.args[i];q(a)&&r===a.op?e(a):n.push(a)}}(e),n):e.args}function l(e){return q(e)?function(t){try{return new r(e.op,e.fn,t,e.implicit)}catch(e){return console.error(e),[]}}:function(r){return new t(new n(e.name),r)}}return{createMakeNodeFunction:l,hasProperty:s,isCommutative:function(e){return s(e,"commutative",arguments.length>1&&void 0!==arguments[1]?arguments[1]:u)},isAssociative:c,mergeContext:function(e,t){var r=cv({},e);for(var n in t)Ae(e,n)?r[n]=cv(cv({},t[n]),e[n]):r[n]=t[n];return r},flatten:function e(t,r){if(!t.args||0===t.args.length)return t;t.args=f(t,r);for(var n=0;n<t.args.length;n++)e(t.args[n],r)},allChildren:f,unflattenr:function e(t,r){if(t.args&&0!==t.args.length){for(var n=l(t),i=t.args.length,a=0;a<i;a++)e(t.args[a],r);if(i>2&&c(t,r)){for(var o=t.args.pop();t.args.length>0;)o=n([t.args.pop(),o]);t.args=o.args}}},unflattenl:function e(t,r){if(t.args&&0!==t.args.length){for(var n=l(t),i=t.args.length,a=0;a<i;a++)e(t.args[a],r);if(i>2&&c(t,r)){for(var o=t.args.shift();t.args.length>0;)o=n([o,t.args.shift()]);t.args=o.args}}},defaultContext:u,realContext:{divide:{total:a},log:{total:a}},positiveContext:{subtract:{total:a},abs:{trivial:i},log:{total:i}}}})),lv=Ce("simplify",["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],(function(e){e.config;var r=e.typed,n=e.parse,i=(e.add,e.subtract,e.multiply,e.divide,e.pow,e.isZero,e.equal),a=e.resolve,o=e.simplifyConstant,u=e.simplifyCore,s=(e.fraction,e.bignumber,e.mathWithTransform,e.matrix,e.AccessorNode),c=e.ArrayNode,f=e.ConstantNode,l=e.FunctionNode,p=e.IndexNode,m=e.ObjectNode,h=e.OperatorNode,d=e.ParenthesisNode,v=e.SymbolNode,y=fv({FunctionNode:l,OperatorNode:h,SymbolNode:v}),g=y.hasProperty,x=y.isCommutative,b=y.isAssociative,w=y.mergeContext,N=y.flatten,D=y.unflattenr,E=y.unflattenl,A=y.createMakeNodeFunction,S=y.defaultContext,C=y.realContext,M=y.positiveContext;r.addConversion({from:"Object",to:"Map",convert:Je});var F=r("simplify",{Node:z,"Node, Map":function(e,t){return z(e,!1,t)},"Node, Map, Object":function(e,t,r){return z(e,!1,t,r)},"Node, Array":z,"Node, Array, Map":z,"Node, Array, Map, Object":z});function O(e){return e.transform((function(e,t,r){return j(e)?O(e.content):e}))}r.removeConversion({from:"Object",to:"Map",convert:Je}),F.defaultContext=S,F.realContext=C,F.positiveContext=M;var _={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};function B(e,t){var r={};if(e.s){var i=e.s.split("->");if(2!==i.length)throw SyntaxError("Could not parse rule: "+e.s);r.l=i[0],r.r=i[1]}else r.l=e.l,r.r=e.r;r.l=O(n(r.l)),r.r=O(n(r.r));for(var a=0,o=["imposeContext","repeat","assuming"];a<o.length;a++){var u=o[a];u in e&&(r[u]=e[u])}if(e.evaluate&&(r.evaluate=n(e.evaluate)),b(r.l,t)){var s,c=!x(r.l,t);c&&(s=I());var f=A(r.l),l=I();r.expanded={},r.expanded.l=f([r.l,l]),N(r.expanded.l,t),D(r.expanded.l,t),r.expanded.r=f([r.r,l]),c&&(r.expandedNC1={},r.expandedNC1.l=f([s,r.l]),r.expandedNC1.r=f([s,r.r]),r.expandedNC2={},r.expandedNC2.l=f([s,r.expanded.l]),r.expandedNC2.r=f([s,r.expanded.r]))}return r}F.rules=[u,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},o,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},o,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];var k=0;function I(){return new v("_p"+k++)}function z(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ye(),i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i.consoleDebug;r=function(e,r){for(var n=[],i=0;i<e.length;i++){var a=e[i],o=void 0,u=t(a);switch(u){case"string":a={s:a};case"object":o=B(a,r);break;case"function":o=a;break;default:throw TypeError("Unsupported type of rule: "+u)}n.push(o)}return n}(r||F.rules,i.context);for(var u=a(e,n),s={},c=(u=O(u)).toString({parenthesis:"all"});!s[c];){s[c]=!0,k=0;var f=c;o&&console.log("Working on: ",c);for(var l=0;l<r.length;l++){var p="";if("function"==typeof r[l]?(u=r[l](u,i),o&&(p=r[l].name)):(N(u,i.context),u=q(u,r[l],i.context),o&&(p="".concat(r[l].l.toString()," -> ").concat(r[l].r.toString()))),o){var m=u.toString({parenthesis:"all"});m!==f&&(console.log("Applying",p,"produced",m),f=m)}E(u,i.context)}c=u.toString({parenthesis:"all"})}return u}function R(e,t,r){var n=e;if(e)for(var i=0;i<e.length;++i){var a=q(e[i],t,r);a!==e[i]&&(n===e&&(n=e.slice()),n[i]=a)}return n}function q(e,t,r){if(t.assuming)for(var n in t.assuming)for(var i in t.assuming[n])if(g(n,i,r)!==t.assuming[n][i])return e;var a=w(t.imposeContext,r),o=e;if(o instanceof h||o instanceof l){var u=R(o.args,t,r);u!==o.args&&((o=o.clone()).args=u)}else if(o instanceof d){if(o.content){var f=q(o.content,t,r);f!==o.content&&(o=new d(f))}}else if(o instanceof c){var v=R(o.items,t,r);v!==o.items&&(o=new c(v))}else if(o instanceof s){var y=o.object;o.object&&(y=q(o.object,t,r));var x=o.index;o.index&&(x=q(o.index,t,r)),y===o.object&&x===o.index||(o=new s(y,x))}else if(o instanceof p){var b=R(o.dimensions,t,r);b!==o.dimensions&&(o=new p(b))}else if(o instanceof m){var N=!1,D={};for(var E in o.properties)D[E]=q(o.properties[E],t,r),D[E]!==o.properties[E]&&(N=!0);N&&(o=new m(D))}var A=t.r,S=$(t.l,o,a)[0];if(!S&&t.expanded&&(A=t.expanded.r,S=$(t.expanded.l,o,a)[0]),!S&&t.expandedNC1&&(A=t.expandedNC1.r,(S=$(t.expandedNC1.l,o,a)[0])||(A=t.expandedNC2.r,S=$(t.expandedNC2.l,o,a)[0])),S){var C=o.implicit;o=A.clone(),C&&"implicit"in A&&(o.implicit=!0),o=o.transform((function(e){return e.isSymbolNode&&Ae(S.placeholders,e.name)?S.placeholders[e.name].clone():e}))}return t.repeat&&o!==e&&(o=q(o,t,r)),o}function P(e,t){var r={placeholders:{}};if(!e.placeholders&&!t.placeholders)return r;if(!e.placeholders)return t;if(!t.placeholders)return e;for(var n in e.placeholders)if(Ae(e.placeholders,n)&&(r.placeholders[n]=e.placeholders[n],Ae(t.placeholders,n)&&!H(e.placeholders[n],t.placeholders[n])))return null;for(var i in t.placeholders)Ae(t.placeholders,i)&&(r.placeholders[i]=t.placeholders[i]);return r}function L(e,t){var r,n=[];if(0===e.length||0===t.length)return n;for(var i=0;i<e.length;i++)for(var a=0;a<t.length;a++)(r=P(e[i],t[a]))&&n.push(r);return n}function $(e,t,r,n){var a=[{placeholders:{}}];if(e instanceof h&&t instanceof h||e instanceof l&&t instanceof l){if(e instanceof h){if(e.op!==t.op||e.fn!==t.fn)return[]}else if(e instanceof l&&e.name!==t.name)return[];if(!(1===t.args.length&&1===e.args.length||!b(t,r)&&t.args.length===e.args.length||n)){if(t.args.length>=2&&2===e.args.length){for(var o=function(e,t){var r,n,i=[],a=A(e);if(x(e,t))for(var o=0;o<e.args.length;o++)(n=e.args.slice(0)).splice(o,1),r=1===n.length?n[0]:a(n),i.push(a([e.args[o],r]));else for(var u=1;u<e.args.length;u++){var s=e.args[0];u>1&&(s=a(e.args.slice(0,u))),r=1===(n=e.args.slice(u)).length?n[0]:a(n),i.push(a([s,r]))}return i}(t,r),u=[],s=0;s<o.length;s++){var c=$(e,o[s],r,!0);u=u.concat(c)}return u}if(e.args.length>2)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}for(var p=[],m=0;m<e.args.length;m++){var d=$(e.args[m],t.args[m],r);if(0===d.length)break;p.push(d)}if(p.length!==e.args.length){if(!x(t,r)||1===e.args.length)return[];if(e.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var y=$(e.args[0],t.args[1],r);if(0===y.length)return[];var g=$(e.args[1],t.args[0],r);if(0===g.length)return[];p=[y,g]}a=function(e){if(0===e.length)return e;for(var t=e.reduce(L),r=[],n={},i=0;i<t.length;i++){var a=JSON.stringify(t[i]);n[a]||(n[a]=!0,r.push(t[i]))}return r}(p)}else if(e instanceof v){if(0===e.name.length)throw new Error("Symbol in rule has 0 length...!?");if(_[e.name]){if(e.name!==t.name)return[]}else switch(e.name[1]>="a"&&e.name[1]<="z"?e.name.substring(0,2):e.name[0]){case"n":case"_p":a[0].placeholders[e.name]=t;break;case"c":case"cl":if(!T(t))return[];a[0].placeholders[e.name]=t;break;case"v":if(T(t))return[];a[0].placeholders[e.name]=t;break;case"vl":if(!U(t))return[];a[0].placeholders[e.name]=t;break;case"cd":if(!ov(t))return[];a[0].placeholders[e.name]=t;break;case"vd":if(ov(t))return[];a[0].placeholders[e.name]=t;break;case"ce":if(!uv(t))return[];a[0].placeholders[e.name]=t;break;case"ve":if(uv(t))return[];a[0].placeholders[e.name]=t;break;default:throw new Error("Invalid symbol in rule: "+e.name)}}else{if(!(e instanceof f))return[];if(!i(e.value,t.value))return[]}return a}function H(e,t){if(e instanceof f&&t instanceof f){if(!i(e.value,t.value))return!1}else if(e instanceof v&&t instanceof v){if(e.name!==t.name)return!1}else{if(!(e instanceof h&&t instanceof h||e instanceof l&&t instanceof l))return!1;if(e instanceof h){if(e.op!==t.op||e.fn!==t.fn)return!1}else if(e instanceof l&&e.name!==t.name)return!1;if(e.args.length!==t.args.length)return!1;for(var r=0;r<e.args.length;r++)if(!H(e.args[r],t.args[r]))return!1}return!0}return F}));function pv(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return mv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mv(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function mv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var hv=Ce("simplifyConstant",["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],(function(e){var r=e.typed,n=e.config,i=e.mathWithTransform,a=e.matrix,o=e.fraction,s=e.bignumber,c=e.AccessorNode,f=e.ArrayNode,p=e.ConstantNode,m=e.FunctionNode,h=e.IndexNode,d=e.ObjectNode,v=e.OperatorNode,y=e.SymbolNode,g=fv({FunctionNode:m,OperatorNode:v,SymbolNode:y}),x=g.isCommutative,b=g.isAssociative,w=g.allChildren,N=g.createMakeNodeFunction,D=r("simplifyConstant",{Node:function(e){return M(k(e,{}))},"Node, Object":function(e,t){return M(k(e,t))}});function E(e){return u(e)?e.valueOf():e instanceof Array?e.map(E):l(e)?a(E(e.valueOf())):e}function A(e,t,r){try{return i[e].apply(null,t)}catch(n){return t=t.map(E),O(i[e].apply(null,t),r)}}var S=r({Fraction:function(e){var t,r=e.s*e.n;return t=r<0?new v("-","unaryMinus",[new p(-r)]):new p(r),1===e.d?t:new v("/","divide",[t,new p(e.d)])},number:function(e){return e<0?_(new p(-e)):new p(e)},BigNumber:function(e){return e<0?_(new p(-e)):new p(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")},string:function(e){return new p(e)},Matrix:function(e){return new f(e.valueOf().map((function(e){return S(e)})))}});function M(e){return z(e)?e:S(e)}function F(e,t){if(t&&!1!==t.exactFractions&&isFinite(e)&&o){var r=o(e),n=t&&"number"==typeof t.fractionsLimit?t.fractionsLimit:1/0;if(r.valueOf()===e&&r.n<n&&r.d<n)return r}return e}var O=r({"string, Object":function(e,t){return"BigNumber"===n.number?(void 0===s&&Yu(),s(e)):"Fraction"===n.number?(void 0===o&&Ju(),o(e)):F(parseFloat(e),t)},"Fraction, Object":function(e,t){return e},"BigNumber, Object":function(e,t){return e},"number, Object":function(e,t){return F(e,t)},"Complex, Object":function(e,t){return 0!==e.im?e:F(e.re,t)},"Matrix, Object":function(e,t){return a(F(e.valueOf()))},"Array, Object":function(e,t){return e.map(F)}});function _(e){return new v("-","unaryMinus",[e])}function B(e,t,r,n){var i=t.shift(),a=t.reduce((function(t,i){if(!z(i)){var a=t.pop();if(z(a))return[a,i];try{return t.push(A(e,[a,i],n)),t}catch(e){t.push(a)}}t.push(M(t.pop()));var o=1===t.length?t[0]:r(t);return[r([o,M(i)])]}),[i]);return 1===a.length?a[0]:r([a[0],S(a[1])])}function k(e,r){switch(e.type){case"SymbolNode":return e;case"ConstantNode":switch(t(e.value)){case"number":return O(e.value,r);case"string":return e.value;default:if(!isNaN(e.value))return O(e.value,r)}return e;case"FunctionNode":if(i[e.name]&&i[e.name].rawArgs)return e;if(-1===["add","multiply"].indexOf(e.name)){var n=e.args.map((function(e){return k(e,r)}));if(!n.some(z))try{return A(e.name,n,r)}catch(e){}if("size"===e.name&&1===n.length&&C(n[0])){for(var o=[],u=n[0];C(u);)o.push(u.items.length),u=u.items[0];return a(o)}return new m(e.name,n.map(M))}case"OperatorNode":var s,v,y=e.fn.toString(),g=N(e);if(q(e)&&e.isUnary())v=z((s=[k(e.args[0],r)])[0])?g(s):A(y,s,r);else if(b(e,r.context))if(s=(s=w(e,r.context)).map((function(e){return k(e,r)})),x(y,r.context)){for(var E=[],S=[],F=0;F<s.length;F++)z(s[F])?S.push(s[F]):E.push(s[F]);E.length>1?(v=B(y,E,g,r),S.unshift(v),v=B(y,S,g,r)):v=B(y,s,g,r)}else v=B(y,s,g,r);else v=B(y,s=e.args.map((function(e){return k(e,r)})),g,r);return v;case"ParenthesisNode":return k(e.content,r);case"AccessorNode":return function(e,t,r){if(!I(t))return new c(M(e),M(t));if(C(e)||l(e)){for(var n=Array.from(t.dimensions);n.length>0;)if(T(n[0])&&"string"!=typeof n[0].value){var i=O(n.shift().value,r);C(e)?e=e.items[i-1]:(e=e.valueOf()[i-1])instanceof Array&&(e=a(e))}else{if(!(n.length>1&&T(n[1])&&"string"!=typeof n[1].value))break;var o,u=O(n[1].value,r),s=[],m=C(e)?e.items:e.valueOf(),d=pv(m);try{for(d.s();!(o=d.n()).done;){var v=o.value;if(C(v))s.push(v.items[u-1]);else{if(!l(e))break;s.push(v[u-1])}}}catch(e){d.e(e)}finally{d.f()}if(s.length!==m.length)break;e=C(e)?new f(s):a(s),n.splice(1,1)}return n.length===t.dimensions.length?new c(M(e),t):n.length>0?(t=new h(n),new c(M(e),t)):e}if(R(e)&&1===t.dimensions.length&&T(t.dimensions[0])){var y=t.dimensions[0].value;return y in e.properties?e.properties[y]:new p}return new c(M(e),t)}(k(e.object,r),k(e.index,r),r);case"ArrayNode":var _=e.items.map((function(e){return k(e,r)}));return _.some(z)?new f(_.map(M)):a(_);case"IndexNode":return new h(e.dimensions.map((function(e){return D(e,r)})));case"ObjectNode":var j={};for(var P in e.properties)j[P]=D(e.properties[P],r);return new d(j);default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(e.type))}}return D})),dv="simplifyCore",vv=Ce(dv,["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],(function(e){var t=e.typed,r=(e.parse,e.equal),n=e.isZero,i=(e.add,e.subtract,e.multiply,e.divide,e.pow,e.AccessorNode),a=e.ArrayNode,o=e.ConstantNode,u=e.FunctionNode,s=e.IndexNode,c=e.ObjectNode,f=e.OperatorNode,l=(e.ParenthesisNode,e.SymbolNode),p=new o(0),m=new o(1),h=new o(!0),d=new o(!1);function v(e){return q(e)&&["and","not","or"].includes(e.op)}var y=fv({FunctionNode:u,OperatorNode:f,SymbolNode:l}),g=y.hasProperty,x=y.isCommutative;function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t?t.context:void 0;if(g(e,"trivial",o)){if(k(e)&&1===e.args.length)return b(e.args[0],t);var l=!1,y=0;if(e.forEach((function(e){1==++y&&(l=b(e,t))})),1===y)return l}var w=e;if(k(w)){var N=function(e){var t,r="OperatorNode:"+e,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Bp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Bp(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}(kp);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(r in i)return i[r].op}}catch(e){n.e(e)}finally{n.f()}return null}(w.name);if(!N)return new u(b(w.fn),w.args.map((function(e){return b(e,t)})));if(w.args.length>2&&g(w,"associative",o))for(;w.args.length>2;){var D=w.args.pop(),E=w.args.pop();w.args.push(new f(N,w.name,[D,E]))}w=new f(N,w.name,w.args)}if(q(w)&&w.isUnary()){var A=b(w.args[0],t);if("~"===w.op&&q(A)&&A.isUnary()&&"~"===A.op)return A.args[0];if("not"===w.op&&q(A)&&A.isUnary()&&"not"===A.op&&v(A.args[0]))return A.args[0];var M=!0;if("-"===w.op&&q(A)&&(A.isBinary()&&"subtract"===A.fn&&(w=new f("-","subtract",[A.args[1],A.args[0]]),M=!1),A.isUnary()&&"-"===A.op))return A.args[0];if(M)return new f(w.op,w.fn,[A])}if(q(w)&&w.isBinary()){var F=b(w.args[0],t),O=b(w.args[1],t);if("+"===w.op){if(T(F)&&n(F.value))return O;if(T(O)&&n(O.value))return F;q(O)&&O.isUnary()&&"-"===O.op&&(O=O.args[0],w=new f("-","subtract",[F,O]))}if("-"===w.op)return q(O)&&O.isUnary()&&"-"===O.op?b(new f("+","add",[F,O.args[0]]),t):T(F)&&n(F.value)?b(new f("-","unaryMinus",[O])):T(O)&&n(O.value)?F:new f(w.op,w.fn,[F,O]);if("*"===w.op){if(T(F)){if(n(F.value))return p;if(r(F.value,1))return O}if(T(O)){if(n(O.value))return p;if(r(O.value,1))return F;if(x(w,o))return new f(w.op,w.fn,[O,F],w.implicit)}return new f(w.op,w.fn,[F,O],w.implicit)}if("/"===w.op)return T(F)&&n(F.value)?p:T(O)&&r(O.value,1)?F:new f(w.op,w.fn,[F,O]);if("^"===w.op&&T(O)){if(n(O.value))return m;if(r(O.value,1))return F}if("and"===w.op){if(T(F)){if(!F.value)return d;if(v(O))return O;if(T(O))return O.value?h:d}if(T(O)){if(!O.value)return d;if(v(F))return F}}if("or"===w.op){if(T(F)){if(F.value)return h;if(v(O))return O}if(T(O)){if(O.value)return h;if(v(F))return F}}return new f(w.op,w.fn,[F,O])}if(q(w))return new f(w.op,w.fn,w.args.map((function(e){return b(e,t)})));if(C(w))return new a(w.items.map((function(e){return b(e,t)})));if(S(w))return new i(b(w.object,t),b(w.index,t));if(I(w))return new s(w.dimensions.map((function(e){return b(e,t)})));if(R(w)){var _={};for(var B in w.properties)_[B]=b(w.properties[B],t);return new c(_)}return w}return t(dv,{Node:b,"Node,Object":b})})),yv=Ce("resolve",["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],(function(e){var t=e.typed,r=e.parse,n=e.ConstantNode,i=e.FunctionNode,a=e.OperatorNode,o=e.ParenthesisNode;function u(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(!t)return e;if(U(e)){if(s.has(e.name)){var c=Array.from(s).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(c,"}"))}var f=t.get(e.name);if(z(f)){var l=new Set(s);return l.add(e.name),u(f,t,l)}return"number"==typeof f?r(String(f)):void 0!==f?new n(f):e}if(q(e)){var p=e.args.map((function(e){return u(e,t,s)}));return new a(e.op,e.fn,p,e.implicit)}if(j(e))return new o(u(e.content,t,s));if(k(e)){var m=e.args.map((function(e){return u(e,t,s)}));return new i(e.name,m)}return e.map((function(e){return u(e,t,s)}))}return t("resolve",{Node:u,"Node, Map | null | undefined":u,"Node, Object":function(e,t){return u(e,Je(t))},"Array | Matrix":t.referToSelf((function(e){return function(t){return t.map((function(t){return e(t)}))}})),"Array | Matrix, null | undefined":t.referToSelf((function(e){return function(t){return t.map((function(t){return e(t)}))}})),"Array, Object":t.referTo("Array,Map",(function(e){return function(t,r){return e(t,Je(r))}})),"Matrix, Object":t.referTo("Matrix,Map",(function(e){return function(t,r){return e(t,Je(r))}})),"Array | Matrix, Map":t.referToSelf((function(e){return function(t,r){return t.map((function(t){return e(t,r)}))}}))})})),gv="symbolicEqual",xv=Ce(gv,["parse","simplify","typed","OperatorNode"],(function(e){e.parse;var t=e.simplify,r=e.typed,n=e.OperatorNode;function i(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=new n("-","subtract",[e,r]),o=t(a,{},i);return T(o)&&!o.value}return r(gv,{"Node, Node":i,"Node, Node, Object":i})})),bv="derivative",wv=Ce(bv,["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],(function(e){var t=e.typed,r=e.config,n=e.parse,i=e.simplify,a=e.equal,o=e.isZero,u=e.numeric,s=e.ConstantNode,c=e.FunctionNode,f=e.OperatorNode,l=e.ParenthesisNode,p=e.SymbolNode;function m(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{simplify:!0},n={};v(n,e,t.name);var a=y(e,n);return r.simplify?i(a):a}t.addConversion({from:"identifier",to:"SymbolNode",convert:n});var h=t(bv,{"Node, SymbolNode":m,"Node, SymbolNode, Object":m});t.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),h._simplify=!0,h.toTex=function(e){return d.apply(null,e.args)};var d=t("_derivTex",{"Node, SymbolNode":function(e,t){return T(e)&&"string"===H(e.value)?d(n(e.value).toString(),t.toString(),1):d(e.toTex(),t.toString(),1)},"Node, ConstantNode":function(e,t){if("string"===H(t.value))return d(e,n(t.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,r){return d(e.toString(),t.name,r.value)},"string, string, number":function(e,t,r){return(1===r?"{d\\over d"+t+"}":"{d^{"+r+"}\\over d"+t+"^{"+r+"}}")+"\\left[".concat(e,"\\right]")}}),v=t("constTag",{"Object, ConstantNode, string":function(e,t){return e[t]=!0,!0},"Object, SymbolNode, string":function(e,t,r){return t.name!==r&&(e[t]=!0,!0)},"Object, ParenthesisNode, string":function(e,t,r){return v(e,t.content,r)},"Object, FunctionAssignmentNode, string":function(e,t,r){return-1===t.params.indexOf(r)?(e[t]=!0,!0):v(e,t.expr,r)},"Object, FunctionNode | OperatorNode, string":function(e,t,r){if(t.args.length>0){for(var n=v(e,t.args[0],r),i=1;i<t.args.length;++i)n=v(e,t.args[i],r)&&n;if(n)return e[t]=!0,!0}return!1}}),y=t("_derivative",{"ConstantNode, Object":function(e){return g(0)},"SymbolNode, Object":function(e,t){return void 0!==t[e]?g(0):g(1)},"ParenthesisNode, Object":function(e,t){return new l(y(e.content,t))},"FunctionAssignmentNode, Object":function(e,t){return void 0!==t[e]?g(0):y(e.expr,t)},"FunctionNode, Object":function(e,t){if(void 0!==t[e])return g(0);var r,n,i,a,o=e.args[0],u=!1,s=!1;switch(e.name){case"cbrt":u=!0,n=new f("*","multiply",[g(3),new f("^","pow",[o,new f("/","divide",[g(2),g(3)])])]);break;case"sqrt":case"nthRoot":if(1===e.args.length)u=!0,n=new f("*","multiply",[g(2),new c("sqrt",[o])]);else if(2===e.args.length)return t[r=new f("/","divide",[g(1),e.args[1]])]=t[e.args[1]],y(new f("^","pow",[o,r]),t);break;case"log10":r=g(10);case"log":if(r||1!==e.args.length){if(1===e.args.length&&r||2===e.args.length&&void 0!==t[e.args[1]])n=new f("*","multiply",[o.clone(),new c("log",[r||e.args[1]])]),u=!0;else if(2===e.args.length)return y(new f("/","divide",[new c("log",[o]),new c("log",[e.args[1]])]),t)}else n=o.clone(),u=!0;break;case"pow":if(2===e.args.length)return t[r]=t[e.args[1]],y(new f("^","pow",[o,e.args[1]]),t);break;case"exp":n=new c("exp",[o.clone()]);break;case"sin":n=new c("cos",[o.clone()]);break;case"cos":n=new f("-","unaryMinus",[new c("sin",[o.clone()])]);break;case"tan":n=new f("^","pow",[new c("sec",[o.clone()]),g(2)]);break;case"sec":n=new f("*","multiply",[e,new c("tan",[o.clone()])]);break;case"csc":s=!0,n=new f("*","multiply",[e,new c("cot",[o.clone()])]);break;case"cot":s=!0,n=new f("^","pow",[new c("csc",[o.clone()]),g(2)]);break;case"asin":u=!0,n=new c("sqrt",[new f("-","subtract",[g(1),new f("^","pow",[o.clone(),g(2)])])]);break;case"acos":u=!0,s=!0,n=new c("sqrt",[new f("-","subtract",[g(1),new f("^","pow",[o.clone(),g(2)])])]);break;case"atan":u=!0,n=new f("+","add",[new f("^","pow",[o.clone(),g(2)]),g(1)]);break;case"asec":u=!0,n=new f("*","multiply",[new c("abs",[o.clone()]),new c("sqrt",[new f("-","subtract",[new f("^","pow",[o.clone(),g(2)]),g(1)])])]);break;case"acsc":u=!0,s=!0,n=new f("*","multiply",[new c("abs",[o.clone()]),new c("sqrt",[new f("-","subtract",[new f("^","pow",[o.clone(),g(2)]),g(1)])])]);break;case"acot":u=!0,s=!0,n=new f("+","add",[new f("^","pow",[o.clone(),g(2)]),g(1)]);break;case"sinh":n=new c("cosh",[o.clone()]);break;case"cosh":n=new c("sinh",[o.clone()]);break;case"tanh":n=new f("^","pow",[new c("sech",[o.clone()]),g(2)]);break;case"sech":s=!0,n=new f("*","multiply",[e,new c("tanh",[o.clone()])]);break;case"csch":s=!0,n=new f("*","multiply",[e,new c("coth",[o.clone()])]);break;case"coth":s=!0,n=new f("^","pow",[new c("csch",[o.clone()]),g(2)]);break;case"asinh":u=!0,n=new c("sqrt",[new f("+","add",[new f("^","pow",[o.clone(),g(2)]),g(1)])]);break;case"acosh":u=!0,n=new c("sqrt",[new f("-","subtract",[new f("^","pow",[o.clone(),g(2)]),g(1)])]);break;case"atanh":u=!0,n=new f("-","subtract",[g(1),new f("^","pow",[o.clone(),g(2)])]);break;case"asech":u=!0,s=!0,n=new f("*","multiply",[o.clone(),new c("sqrt",[new f("-","subtract",[g(1),new f("^","pow",[o.clone(),g(2)])])])]);break;case"acsch":u=!0,s=!0,n=new f("*","multiply",[new c("abs",[o.clone()]),new c("sqrt",[new f("+","add",[new f("^","pow",[o.clone(),g(2)]),g(1)])])]);break;case"acoth":u=!0,s=!0,n=new f("-","subtract",[g(1),new f("^","pow",[o.clone(),g(2)])]);break;case"abs":n=new f("/","divide",[new c(new p("abs"),[o.clone()]),o.clone()]);break;default:throw new Error('Cannot process function "'+e.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}u?(i="/",a="divide"):(i="*",a="multiply");var l=y(o,t);return s&&(l=new f("-","unaryMinus",[l])),new f(i,a,[l,n])},"OperatorNode, Object":function(e,t){if(void 0!==t[e])return g(0);if("+"===e.op)return new f(e.op,e.fn,e.args.map((function(e){return y(e,t)})));if("-"===e.op){if(e.isUnary())return new f(e.op,e.fn,[y(e.args[0],t)]);if(e.isBinary())return new f(e.op,e.fn,[y(e.args[0],t),y(e.args[1],t)])}if("*"===e.op){var r=e.args.filter((function(e){return void 0!==t[e]}));if(r.length>0){var n=e.args.filter((function(e){return void 0===t[e]})),i=1===n.length?n[0]:new f("*","multiply",n),u=r.concat(y(i,t));return new f("*","multiply",u)}return new f("+","add",e.args.map((function(r){return new f("*","multiply",e.args.map((function(e){return e===r?y(e,t):e.clone()})))})))}if("/"===e.op&&e.isBinary()){var s=e.args[0],l=e.args[1];return void 0!==t[l]?new f("/","divide",[y(s,t),l]):void 0!==t[s]?new f("*","multiply",[new f("-","unaryMinus",[s]),new f("/","divide",[y(l,t),new f("^","pow",[l.clone(),g(2)])])]):new f("/","divide",[new f("-","subtract",[new f("*","multiply",[y(s,t),l.clone()]),new f("*","multiply",[s.clone(),y(l,t)])]),new f("^","pow",[l.clone(),g(2)])])}if("^"===e.op&&e.isBinary()){var p=e.args[0],m=e.args[1];if(void 0!==t[p])return T(p)&&(o(p.value)||a(p.value,1))?g(0):new f("*","multiply",[e,new f("*","multiply",[new c("log",[p.clone()]),y(m.clone(),t)])]);if(void 0!==t[m]){if(T(m)){if(o(m.value))return g(0);if(a(m.value,1))return y(p,t)}var h=new f("^","pow",[p.clone(),new f("-","subtract",[m,g(1)])]);return new f("*","multiply",[m.clone(),new f("*","multiply",[y(p,t),h])])}return new f("*","multiply",[new f("^","pow",[p.clone(),m.clone()]),new f("+","add",[new f("*","multiply",[y(p,t),new f("/","divide",[m.clone(),p.clone()])]),new f("*","multiply",[y(m,t),new c("log",[p.clone()])])])])}throw new Error('Cannot process operator "'+e.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function g(e,t){return new s(u(e,t||r.number))}return h})),Nv="rationalize",Dv=Ce(Nv,["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],(function(e){e.config;var t=e.typed,r=(e.equal,e.isZero,e.add,e.subtract,e.multiply,e.divide,e.pow,e.parse,e.simplifyConstant),n=e.simplifyCore,i=e.simplify,a=(e.fraction,e.bignumber,e.mathWithTransform,e.matrix,e.AccessorNode,e.ArrayNode,e.ConstantNode),o=(e.FunctionNode,e.IndexNode,e.ObjectNode,e.OperatorNode),u=e.SymbolNode;function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=function(){var e=[n,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},r,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],t=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],i=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],a={};return a.firstRules=e.concat(t,i),a.distrDivRules=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],a.sucDivRules=i,a.firstRulesAgain=e.concat(t),a.finalRules=[n,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},r,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],a}(),u=function(e,t,r,n){var a=[],o=i(e,n,t,{exactFractions:!1}),u="+-*"+((r=!!r)?"/":"");!function e(t){var r=t.type;if("FunctionNode"===r)throw new Error("There is an unsolved function call");if("OperatorNode"===r)if("^"===t.op){if("ConstantNode"!==t.args[1].type||!V(parseFloat(t.args[1].value)))throw new Error("There is a non-integer exponent");e(t.args[0])}else{if(-1===u.indexOf(t.op))throw new Error("Operator "+t.op+" invalid in polynomial expression");for(var n=0;n<t.args.length;n++)e(t.args[n])}else if("SymbolNode"===r){var i=t.name;-1===a.indexOf(i)&&a.push(i)}else if("ParenthesisNode"===r)e(t.content);else if("ConstantNode"!==r)throw new Error("type "+r+" is not allowed in polynomial expression")}(o);var s={};return s.expression=o,s.variables=a,s}(e,t,!0,o.firstRules),s=u.variables.length,l={exactFractions:!1},p={exactFractions:!0};if(e=u.expression,s>=1){var m,h;e=c(e);var d,v=!0,y=!1;for(e=i(e,o.firstRules,{},l);h=v?o.distrDivRules:o.sucDivRules,v=!v,(d=(e=i(e,h,{},p)).toString())!==m;)y=!0,m=d;y&&(e=i(e,o.firstRulesAgain,{},l)),e=i(e,o.finalRules,{},l)}var g=[],x={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===s&&(e.args[0]=f(e.args[0],g),e.args[1]=f(e.args[1])),a&&(x.numerator=e.args[0],x.denominator=e.args[1])):(1===s&&(e=f(e,g)),a&&(x.numerator=e,x.denominator=null)),a?(x.coefficients=g,x.variables=u.variables,x.expression=e,x):e}return e.ParenthesisNode,t(Nv,{Node:s,"Node, boolean":function(e,t){return s(e,{},t)},"Node, Object":s,"Node, Object, boolean":s});function c(e,t,r){var n=e.type,i=arguments.length>1;if("OperatorNode"===n&&e.isBinary()){var u,s=!1;if("^"===e.op&&("ParenthesisNode"!==e.args[0].type&&"OperatorNode"!==e.args[0].type||"ConstantNode"!==e.args[1].type||(s=(u=parseFloat(e.args[1].value))>=2&&V(u))),s){if(u>2){var f=e.args[0],l=new o("^","pow",[e.args[0].cloneDeep(),new a(u-1)]);e=new o("*","multiply",[f,l])}else e=new o("*","multiply",[e.args[0],e.args[0].cloneDeep()]);i&&("content"===r?t.content=e:t.args[r]=e)}}if("ParenthesisNode"===n)c(e.content,e,"content");else if("ConstantNode"!==n&&"SymbolNode"!==n)for(var p=0;p<e.args.length;p++)c(e.args[p],e,p);if(!i)return e}function f(e,t){void 0===t&&(t=[]),t[0]=0;var r=0,n="";!function e(i,a,o){var u=i.type;if("FunctionNode"===u)throw new Error("There is an unsolved function call");if("OperatorNode"===u){if(-1==="+-*^".indexOf(i.op))throw new Error("Operator "+i.op+" invalid");if(null!==a){if(("unaryMinus"===i.fn||"pow"===i.fn)&&"add"!==a.fn&&"subtract"!==a.fn&&"multiply"!==a.fn)throw new Error("Invalid "+i.op+" placing");if(("subtract"===i.fn||"add"===i.fn||"multiply"===i.fn)&&"add"!==a.fn&&"subtract"!==a.fn)throw new Error("Invalid "+i.op+" placing");if(("subtract"===i.fn||"add"===i.fn||"unaryMinus"===i.fn)&&0!==o.noFil)throw new Error("Invalid "+i.op+" placing")}"^"!==i.op&&"*"!==i.op||(o.fire=i.op);for(var s=0;s<i.args.length;s++)"unaryMinus"===i.fn&&(o.oper="-"),"+"!==i.op&&"subtract"!==i.fn||(o.fire="",o.cte=1,o.oper=0===s?"+":i.op),o.noFil=s,e(i.args[s],i,o)}else if("SymbolNode"===u){if(i.name!==n&&""!==n)throw new Error("There is more than one variable");if(n=i.name,null===a)return void(t[1]=1);if("^"===a.op&&0!==o.noFil)throw new Error("In power the variable should be the first parameter");if("*"===a.op&&1!==o.noFil)throw new Error("In multiply the variable should be the second parameter");""!==o.fire&&"*"!==o.fire||(r<1&&(t[1]=0),t[1]+=o.cte*("+"===o.oper?1:-1),r=Math.max(1,r))}else{if("ConstantNode"!==u)throw new Error("Type "+u+" is not allowed");var c=parseFloat(i.value);if(null===a)return void(t[0]=c);if("^"===a.op){if(1!==o.noFil)throw new Error("Constant cannot be powered");if(!V(c)||c<=0)throw new Error("Non-integer exponent is not allowed");for(var f=r+1;f<c;f++)t[f]=0;return c>r&&(t[c]=0),t[c]+=o.cte*("+"===o.oper?1:-1),void(r=Math.max(c,r))}o.cte=c,""===o.fire&&(t[0]+=o.cte*("+"===o.oper?1:-1))}}(e,null,{cte:1,oper:"+",fire:""});for(var i,s=!0,c=r=t.length-1;c>=0;c--)if(0!==t[c]){var f=new a(s?t[c]:Math.abs(t[c])),l=t[c]<0?"-":"+";if(c>0){var p=new u(n);if(c>1){var m=new a(c);p=new o("^","pow",[p,m])}f=-1===t[c]&&s?new o("-","unaryMinus",[p]):1===Math.abs(t[c])?p:new o("*","multiply",[f,p])}i=s?f:"+"===l?new o("+","add",[i,f]):new o("-","subtract",[i,f]),s=!1}return s?new a(0):i}})),Ev="zpk2tf",Av=Ce(Ev,["typed","add","multiply","Complex","number"],(function(e){var t=e.typed,r=e.add,n=e.multiply,i=e.Complex,a=e.number;return t(Ev,{"Array,Array,number":function(e,t,r){return o(e,t,r)},"Array,Array":function(e,t){return o(e,t,1)},"Matrix,Matrix,number":function(e,t,r){return o(e.valueOf(),t.valueOf(),r)},"Matrix,Matrix":function(e,t){return o(e.valueOf(),t.valueOf(),1)}});function o(e,t,r){e.some((function(e){return"BigNumber"===e.type}))&&(e=e.map((function(e){return a(e)}))),t.some((function(e){return"BigNumber"===e.type}))&&(t=t.map((function(e){return a(e)})));for(var o=[i(1,0)],s=[i(1,0)],c=0;c<e.length;c++){var f=e[c];"number"==typeof f&&(f=i(f,0)),o=u(o,[i(1,0),i(-f.re,-f.im)])}for(var l=0;l<t.length;l++){var p=t[l];"number"==typeof p&&(p=i(p,0)),s=u(s,[i(1,0),i(-p.re,-p.im)])}for(var m=0;m<o.length;m++)o[m]=n(o[m],r);return[o,s]}function u(e,t){for(var a=[],o=0;o<e.length+t.length-1;o++){a[o]=i(0,0);for(var u=0;u<e.length;u++)o-u>=0&&o-u<t.length&&(a[o]=r(a[o],n(e[u],t[o-u])))}return a}})),Sv="freqz",Cv=Ce(Sv,["typed","add","multiply","Complex","divide","matrix"],(function(e){var t=e.typed,r=e.add,n=e.multiply,i=e.Complex,a=e.divide,o=e.matrix;return t(Sv,{"Array, Array":function(e,t){return u(e,t,s(512))},"Array, Array, Array":function(e,t,r){return u(e,t,r)},"Array, Array, number":function(e,t,r){if(r<0)throw new Error("w must be a positive number");return u(e,t,s(r))},"Matrix, Matrix":function(e,t){var r=s(512),n=u(e.valueOf(),t.valueOf(),r),i=n.w,a=n.h;return{w:o(i),h:o(a)}},"Matrix, Matrix, Matrix":function(e,t,r){var n=u(e.valueOf(),t.valueOf(),r.valueOf()).h;return{h:o(n),w:o(r)}},"Matrix, Matrix, number":function(e,t,r){if(r<0)throw new Error("w must be a positive number");var n=s(r),i=u(e.valueOf(),t.valueOf(),n).h;return{h:o(i),w:o(n)}}});function u(e,t,o){for(var u=[],s=[],c=0;c<o.length;c++){for(var f=i(0,0),l=i(0,0),p=0;p<e.length;p++)f=r(f,n(e[p],i(Math.cos(-p*o[c]),Math.sin(-p*o[c]))));for(var m=0;m<t.length;m++)l=r(l,n(t[m],i(Math.cos(-m*o[c]),Math.sin(-m*o[c]))));u.push(f),s.push(l)}for(var h=[],d=0;d<u.length;d++)h.push(a(u[d],s[d]));return{h,w:o}}function s(e){for(var t=[],r=0;r<e;r++)t.push(r/e*Math.PI);return t}})),Mv=Ce("reviver",["classes"],(function(e){var t=e.classes;return function(e,r){var n=t[r&&r.mathjs];return n&&"function"==typeof n.fromJSON?n.fromJSON(r):r}})),Fv=Ce("replacer",[],(function(){return function(e,t){return"number"!=typeof t||isFinite(t)&&!isNaN(t)?t:{mathjs:"number",value:String(t)}}})),Ov=Math.PI,Tv=2*Math.PI,_v=Math.E,Bv=Ce("true",[],(function(){return!0})),kv=Ce("false",[],(function(){return!1})),Iv=Ce("null",[],(function(){return null})),zv=Qv("Infinity",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(1/0):1/0})),Rv=Qv("NaN",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(NaN):NaN})),qv=Qv("pi",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?Af(r):Ov})),jv=Qv("tau",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?Sf(r):Tv})),Pv=Qv("e",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?Df(r):_v})),Lv=Qv("phi",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?Ef(r):1.618033988749895})),Uv=Qv("LN2",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(2).ln():Math.LN2})),$v=Qv("LN10",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(10).ln():Math.LN10})),Hv=Qv("LOG2E",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(1).div(new r(2).ln()):Math.LOG2E})),Gv=Qv("LOG10E",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(1).div(new r(10).ln()):Math.LOG10E})),Vv=Qv("SQRT1_2",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r("0.5").sqrt():Math.SQRT1_2})),Zv=Qv("SQRT2",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(2).sqrt():Math.SQRT2})),Wv=Qv("i",["Complex"],(function(e){return e.Complex.I})),Yv=Ce("PI",["pi"],(function(e){return e.pi})),Jv=Ce("E",["e"],(function(e){return e.e})),Xv=Ce("version",[],(function(){return"12.4.1"}));function Qv(e,t,r){return Ce(e,t,r,{recreateOnConfigChange:!0})}var Kv=Yy("speedOfLight","299792458","m s^-1"),ey=Yy("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),ty=Yy("planckConstant","6.62607015e-34","J s"),ry=Yy("reducedPlanckConstant","1.0545718176461565e-34","J s"),ny=Yy("magneticConstant","1.25663706212e-6","N A^-2"),iy=Yy("electricConstant","8.8541878128e-12","F m^-1"),ay=Yy("vacuumImpedance","376.730313667","ohm"),oy=Yy("coulomb","8.987551792261171e9","N m^2 C^-2"),uy=Yy("elementaryCharge","1.602176634e-19","C"),sy=Yy("bohrMagneton","9.2740100783e-24","J T^-1"),cy=Yy("conductanceQuantum","7.748091729863649e-5","S"),fy=Yy("inverseConductanceQuantum","12906.403729652257","ohm"),ly=Yy("magneticFluxQuantum","2.0678338484619295e-15","Wb"),py=Yy("nuclearMagneton","5.0507837461e-27","J T^-1"),my=Yy("klitzing","25812.807459304513","ohm"),hy=Yy("bohrRadius","5.29177210903e-11","m"),dy=Yy("classicalElectronRadius","2.8179403262e-15","m"),vy=Yy("electronMass","9.1093837015e-31","kg"),yy=Yy("fermiCoupling","1.1663787e-5","GeV^-2"),gy=Jy("fineStructure",.0072973525693),xy=Yy("hartreeEnergy","4.3597447222071e-18","J"),by=Yy("protonMass","1.67262192369e-27","kg"),wy=Yy("deuteronMass","3.3435830926e-27","kg"),Ny=Yy("neutronMass","1.6749271613e-27","kg"),Dy=Yy("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),Ey=Yy("rydberg","10973731.568160","m^-1"),Ay=Yy("thomsonCrossSection","6.6524587321e-29","m^2"),Sy=Jy("weakMixingAngle",.2229),Cy=Jy("efimovFactor",22.7),My=Yy("atomicMass","1.66053906660e-27","kg"),Fy=Yy("avogadro","6.02214076e23","mol^-1"),Oy=Yy("boltzmann","1.380649e-23","J K^-1"),Ty=Yy("faraday","96485.33212331001","C mol^-1"),_y=Yy("firstRadiation","3.7417718521927573e-16","W m^2"),By=Yy("loschmidt","2.686780111798444e25","m^-3"),ky=Yy("gasConstant","8.31446261815324","J K^-1 mol^-1"),Iy=Yy("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),zy=Yy("molarVolume","0.022413969545014137","m^3 mol^-1"),Ry=Jy("sackurTetrode",-1.16487052358),qy=Yy("secondRadiation","0.014387768775039337","m K"),jy=Yy("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),Py=Yy("wienDisplacement","2.897771955e-3","m K"),Ly=Yy("molarMass","0.99999999965e-3","kg mol^-1"),Uy=Yy("molarMassC12","11.9999999958e-3","kg mol^-1"),$y=Yy("gravity","9.80665","m s^-2"),Hy=Yy("planckLength","1.616255e-35","m"),Gy=Yy("planckMass","2.176435e-8","kg"),Vy=Yy("planckTime","5.391245e-44","s"),Zy=Yy("planckCharge","1.87554603778e-18","C"),Wy=Yy("planckTemperature","1.416785e+32","K");function Yy(e,t,r){return Ce(e,["config","Unit","BigNumber"],(function(e){var n=e.config,i=e.Unit,a=e.BigNumber,o=new i("BigNumber"===n.number?new a(t):parseFloat(t),r);return o.fixPrefix=!0,o}))}function Jy(e,t){return Ce(e,["config","BigNumber"],(function(e){var r=e.config,n=e.BigNumber;return"BigNumber"===r.number?new n(t):t}))}var Xy=Ce("apply",["typed","isInteger"],(function(e){var t=e.typed,r=e.isInteger,n=ga({typed:t,isInteger:r});return t("apply",{"...any":function(e){var t=e[1];i(t)?e[1]=t-1:a(t)&&(e[1]=t.minus(1));try{return n.apply(null,e)}catch(e){throw Dp(e)}}})}),{isTransformFunction:!0}),Qy=Ce("column",["typed","Index","matrix","range"],(function(e){var t=e.typed,r=e.Index,n=e.matrix,a=e.range,o=Du({typed:t,Index:r,matrix:n,range:a});return t("column",{"...any":function(e){var t=e.length-1,r=e[t];i(r)&&(e[t]=r-1);try{return o.apply(null,e)}catch(e){throw Dp(e)}}})}),{isTransformFunction:!0});function Ky(e,t,r){var n=e.filter((function(e){return U(e)&&!(e.name in t)&&!r.has(e.name)}))[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=new Map,o=new Ze(r,a,new Set([i])),u=e.compile();return function(e){return a.set(i,e),u.evaluate(o)}}var eg=Ce("filter",["typed"],(function(e){var t=e.typed;function r(e,t,r){var i,a;return e[0]&&(i=e[0].compile().evaluate(r)),e[1]&&(a=U(e[1])||B(e[1])?e[1].compile().evaluate(r):Ky(e[1],t,r)),n(i,a)}r.rawArgs=!0;var n=t("filter",{"Array, function":tg,"Matrix, function":function(e,t){return e.create(tg(e.toArray(),t))},"Array, RegExp":Fn,"Matrix, RegExp":function(e,t){return e.create(Fn(e.toArray(),t))}});return r}),{isTransformFunction:!0});function tg(e,t){return Mn(e,(function(e,r,n){return Ou(t,e,[r+1],n,"filter")}))}var rg=Ce("forEach",["typed"],(function(e){var t=e.typed;function r(e,t,r){var i,a;return e[0]&&(i=e[0].compile().evaluate(r)),e[1]&&(a=U(e[1])||B(e[1])?e[1].compile().evaluate(r):Ky(e[1],t,r)),n(i,a)}r.rawArgs=!0;var n=t("forEach",{"Array | Matrix, function":function(e,t){!function r(n,i){if(!Array.isArray(n))return Ou(t,n,i,e,"forEach");Cn(n,(function(e,t){r(e,i.concat(t+1))}))}(e.valueOf(),[])}});return r}),{isTransformFunction:!0}),ng=Ce("index",["Index","getMatrixDataType"],(function(e){var t=e.Index,r=e.getMatrixDataType;return function(){for(var e=[],n=0,o=arguments.length;n<o;n++){var u=arguments[n];if(d(u))u.start--,u.end-=u.step>0?0:2;else if(u&&!0===u.isSet)u=u.map((function(e){return e-1}));else if(f(u)||l(u))"boolean"!==r(u)&&(u=u.map((function(e){return e-1})));else if(i(u))u--;else if(a(u))u=u.toNumber()-1;else if("string"!=typeof u)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[n]=u}var s=new t;return t.apply(s,e),s}}),{isTransformFunction:!0}),ig=Ce("map",["typed"],(function(e){var t=e.typed;function r(e,t,r){var i,a;return e[0]&&(i=e[0].compile().evaluate(r)),e[1]&&(a=U(e[1])||B(e[1])?e[1].compile().evaluate(r):Ky(e[1],t,r)),n(i,a)}r.rawArgs=!0;var n=t("map",{"Array, function":function(e,t){return ag(e,t,e)},"Matrix, function":function(e,t){return e.create(ag(e.valueOf(),t,e))}});return r}),{isTransformFunction:!0});function ag(e,t,r){return function e(n,i){return Array.isArray(n)?Sn(n,(function(t,r){return e(t,i.concat(r+1))})):Ou(t,n,i,r,"map")}(e,[])}function og(e){if(2===e.length&&p(e[0])){var t=(e=e.slice())[1];i(t)?e[1]=t-1:a(t)&&(e[1]=t.minus(1))}return e}var ug=Ce("max",["typed","config","numeric","larger"],(function(e){var t=e.typed,r=e.config,n=e.numeric,i=e.larger,a=vf({typed:t,config:r,numeric:n,larger:i});return t("max",{"...any":function(e){e=og(e);try{return a.apply(null,e)}catch(e){throw Dp(e)}}})}),{isTransformFunction:!0}),sg=Ce("mean",["typed","add","divide"],(function(e){var t=e.typed,r=e.add,n=e.divide,i=td({typed:t,add:r,divide:n});return t("mean",{"...any":function(e){e=og(e);try{return i.apply(null,e)}catch(e){throw Dp(e)}}})}),{isTransformFunction:!0}),cg=Ce("min",["typed","config","numeric","smaller"],(function(e){var t=e.typed,r=e.config,n=e.numeric,i=e.smaller,a=yf({typed:t,config:r,numeric:n,smaller:i});return t("min",{"...any":function(e){e=og(e);try{return a.apply(null,e)}catch(e){throw Dp(e)}}})}),{isTransformFunction:!0}),fg=Ce("range",["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.bignumber,a=e.smaller,o=e.smallerEq,u=e.larger,s=e.largerEq,c=e.add,f=e.isPositive,l=Ku({typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:s,add:c,isPositive:f});return t("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),l.apply(null,e)}})}),{isTransformFunction:!0}),lg=Ce("row",["typed","Index","matrix","range"],(function(e){var t=e.typed,r=e.Index,n=e.matrix,a=e.range,o=us({typed:t,Index:r,matrix:n,range:a});return t("row",{"...any":function(e){var t=e.length-1,r=e[t];i(r)&&(e[t]=r-1);try{return o.apply(null,e)}catch(e){throw Dp(e)}}})}),{isTransformFunction:!0}),pg=Ce("subset",["typed","matrix","zeros","add"],(function(e){var t=e.typed,r=e.matrix,n=e.zeros,i=e.add,a=ms({typed:t,matrix:r,zeros:n,add:i});return t("subset",{"...any":function(e){try{return a.apply(null,e)}catch(e){throw Dp(e)}}})}),{isTransformFunction:!0}),mg=Ce("concat",["typed","matrix","isInteger"],(function(e){var t=e.typed,r=e.matrix,n=e.isInteger,o=wu({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(e){var t=e.length-1,r=e[t];i(r)?e[t]=r-1:a(r)&&(e[t]=r.minus(1));try{return o.apply(null,e)}catch(e){throw Dp(e)}}})}),{isTransformFunction:!0}),hg="diff",dg=Ce(hg,["typed","matrix","subtract","number","bignumber"],(function(e){var t=e.typed,r=e.matrix,n=e.subtract,i=e.number,a=e.bignumber,o=Zu({typed:t,matrix:r,subtract:n,number:i,bignumber:a});return t(hg,{"...any":function(e){e=og(e);try{return o.apply(null,e)}catch(e){throw Dp(e)}}})}),{isTransformFunction:!0}),vg=Ce("std",["typed","map","sqrt","variance"],(function(e){var t=e.typed,r=e.map,n=e.sqrt,i=e.variance,a=fd({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(e){e=og(e);try{return a.apply(null,e)}catch(e){throw Dp(e)}}})}),{isTransformFunction:!0}),yg=Ce("sum",["typed","config","add","numeric"],(function(e){var t=e.typed,r=e.config,n=e.add,i=e.numeric,a=Xh({typed:t,config:r,add:n,numeric:i});return t("sum",{"...any":function(e){e=og(e);try{return a.apply(null,e)}catch(e){throw Dp(e)}}})}),{isTransformFunction:!0}),gg=Ce("quantileSeq",["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],(function(e){var t=e.typed,r=e.bignumber,n=e.add,i=e.subtract,a=e.divide,o=e.multiply,u=e.partitionSelect,s=e.compare,c=e.isInteger,f=e.smaller,l=e.smallerEq,p=e.larger,m=cd({typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:s,isInteger:c,smaller:f,smallerEq:l,larger:p});return t("quantileSeq",{"Array | Matrix, number | BigNumber":m,"Array | Matrix, number | BigNumber, number":function(e,t,r){return m(e,t,h(r))},"Array | Matrix, number | BigNumber, boolean":m,"Array | Matrix, number | BigNumber, boolean, number":function(e,t,r,n){return m(e,t,r,h(n))},"Array | Matrix, Array | Matrix":m,"Array | Matrix, Array | Matrix, number":function(e,t,r){return m(e,t,h(r))},"Array | Matrix, Array | Matrix, boolean":m,"Array | Matrix, Array | Matrix, boolean, number":function(e,t,r,n){return m(e,t,r,h(n))}});function h(e){return og([[],e])[1]}}),{isTransformFunction:!0}),xg="cumsum",bg=Ce(xg,["typed","add","unaryPlus"],(function(e){var t=e.typed,r=e.add,n=e.unaryPlus,o=Kh({typed:t,add:r,unaryPlus:n});return t(xg,{"...any":function(e){if(2===e.length&&p(e[0])){var t=e[1];i(t)?e[1]=t-1:a(t)&&(e[1]=t.minus(1))}try{return o.apply(null,e)}catch(e){throw Dp(e)}}})}),{isTransformFunction:!0}),wg="variance",Ng=Ce(wg,["typed","add","subtract","multiply","divide","apply","isNaN"],(function(e){var t=e.typed,r=e.add,n=e.subtract,i=e.multiply,a=e.divide,o=e.apply,u=e.isNaN,s=ud({typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u});return t(wg,{"...any":function(e){e=og(e);try{return s.apply(null,e)}catch(e){throw Dp(e)}}})}),{isTransformFunction:!0}),Dg="print",Eg=Ce(Dg,["typed","matrix","zeros","add"],(function(e){var t=e.typed,r=e.matrix,n=e.zeros,i=e.add,a=Ys({typed:t,matrix:r,zeros:n,add:i});return t(Dg,{"string, Object | Array":function(e,t){return a(o(e),t)},"string, Object | Array, number | Object":function(e,t,r){return a(o(e),t,r)}});function o(e){return e.replace(Zs,(function(e){return"$"+e.slice(1).split(".").map((function(e){return!isNaN(e)&&e.length>0?parseInt(e)-1:e})).join(".")}))}}),{isTransformFunction:!0}),Ag=Ce("and",["typed","matrix","zeros","add","equalScalar","not","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.not,o=e.concat,u=Bc({typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o});function s(e,t,r){var n=e[0].compile().evaluate(r);if(!p(n)&&!u(n,!0))return!1;var i=e[1].compile().evaluate(r);return u(n,i)}return s.rawArgs=!0,s}),{isTransformFunction:!0}),Sg=Ce("or",["typed","matrix","equalScalar","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.DenseMatrix,a=e.concat,o=gu({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function u(e,t,r){var n=e[0].compile().evaluate(r);if(!p(n)&&o(n,!1))return!0;var i=e[1].compile().evaluate(r);return o(n,i)}return u.rawArgs=!0,u}),{isTransformFunction:!0}),Cg=Ce("bitAnd",["typed","matrix","zeros","add","equalScalar","not","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.not,o=e.concat,u=Ko({typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o});function s(e,t,r){var n=e[0].compile().evaluate(r);if(!p(n)){if(isNaN(n))return NaN;if(0===n||!1===n)return 0}var i=e[1].compile().evaluate(r);return u(n,i)}return s.rawArgs=!0,s}),{isTransformFunction:!0}),Mg=Ce("bitOr",["typed","matrix","equalScalar","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.DenseMatrix,a=e.concat,o=nu({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function u(e,t,r){var n=e[0].compile().evaluate(r);if(!p(n)){if(isNaN(n))return NaN;if(-1===n)return-1;if(!0===n)return 1}var i=e[1].compile().evaluate(r);return o(n,i)}return u.rawArgs=!0,u}),{isTransformFunction:!0}),Fg=(r(4170),r(1504));var Og={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null},Tg=["Matrix","Array"],_g=["number","BigNumber","Fraction"];function Bg(e,t){function r(r){if(r){var n=ge(e,ye);kg(r,"matrix",Tg),kg(r,"number",_g),be(e,r);var i=ge(e,ye),a=ge(r,ye);return t("config",i,n,a),i}return ge(e,ye)}return r.MATRIX_OPTIONS=Tg,r.NUMBER_OPTIONS=_g,Object.keys(Og).forEach((function(t){Object.defineProperty(r,t,{get:function(){return e[t]},enumerable:!0,configurable:!0})})),r}function kg(e,t,r){var n,i;void 0!==e[t]&&(n=r,i=e[t],-1===n.indexOf(i))&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map((function(e){return JSON.stringify(e)})).join(", ")+".")}const Ig=function e(r,n){var _=Jr({},Og,n);if("function"!=typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var H,V,Z=(H={isNumber:i,isComplex:o,isBigNumber:a,isFraction:u,isUnit:s,isString:c,isArray:f,isMatrix:l,isCollection:p,isDenseMatrix:m,isSparseMatrix:h,isRange:d,isIndex:v,isBoolean:y,isResultSet:g,isHelp:x,isFunction:b,isDate:w,isRegExp:N,isObject:D,isNull:E,isUndefined:A,isAccessorNode:S,isArrayNode:C,isAssignmentNode:M,isBlockNode:F,isConditionalNode:O,isConstantNode:T,isFunctionAssignmentNode:B,isFunctionNode:k,isIndexNode:I,isNode:z,isObjectNode:R,isOperatorNode:q,isParenthesisNode:j,isRangeNode:P,isRelationalNode:L,isSymbolNode:U,isChain:$},V=new Fg,H.on=V.on.bind(V),H.off=V.off.bind(V),H.once=V.once.bind(V),H.emit=V.emit.bind(V),H);Z.config=Bg(_,Z.emit),Z.expression={transform:{},mathWithTransform:{config:Z.config}};var W={};function Y(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Z.typed.apply(Z.typed,t)}Y.isTypedFunction=G.isTypedFunction;var J=function(e,r,n,i){function c(t,r,a){var o;if(a.wrap&&"function"==typeof r&&(r=function(e){var t=function(){for(var t=[],r=0,i=arguments.length;r<i;r++){var a=arguments[r];t[r]=a&&a.valueOf()}return e.apply(n,t)};return e.transform&&(t.transform=e.transform),t}(r)),"function"==typeof(o=r)&&"string"==typeof o.signature&&(r=e(t,Za({},r.signature,r))),e.isTypedFunction(n[t])&&e.isTypedFunction(r))return r=a.override?e(t,r.signatures):e(n[t],r),n[t]=r,delete i[t],f(t,r),void n.emit("import",t,(function(){return r}));if(void 0===n[t]||a.override)return n[t]=r,delete i[t],f(t,r),void n.emit("import",t,(function(){return r}));if(!a.silent)throw new Error('Cannot import "'+t+'": already exists')}function f(e,t){t&&"function"==typeof t.transform?(n.expression.transform[e]=t.transform,h(e)&&(n.expression.mathWithTransform[e]=t.transform)):(delete n.expression.transform[e],h(e)&&(n.expression.mathWithTransform[e]=t))}function p(e){delete n.expression.transform[e],h(e)?n.expression.mathWithTransform[e]=n[e]:delete n.expression.mathWithTransform[e]}function m(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.fn;if(kn(a,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(a));var o=v(t)?n.expression.transform:n,u=a in n.expression.transform,s=Ae(o,a)?o[a]:void 0,c=function(){var i={};t.dependencies.map(Fe).forEach((function(e){if(kn(e,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?i.math=n:"mathWithTransform"===e?i.mathWithTransform=n.expression.mathWithTransform:"classes"===e?i.classes=n:i[e]=n[e]}));var o=t(i);if(o&&"function"==typeof o.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(void 0===s||r.override)return o;if(e.isTypedFunction(s)&&e.isTypedFunction(o))return e(s,o);if(r.silent)return s;throw new Error('Cannot import "'+a+'": already exists')};t.meta&&!1===t.meta.lazy?(o[a]=c(),s&&u?p(a):(v(t)||d(t))&&Ee(n.expression.mathWithTransform,a,(function(){return o[a]}))):(Ee(o,a,c),s&&u?p(a):(v(t)||d(t))&&Ee(n.expression.mathWithTransform,a,(function(){return o[a]}))),i[a]=t,n.emit("import",a,c)}function h(e){return!Ae(y,e)}function d(e){return!(-1!==e.fn.indexOf(".")||Ae(y,e.fn)||e.meta&&e.meta.isClass)}function v(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction||!1}var y={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(e,r){var n=arguments.length;if(1!==n&&2!==n)throw new io("import",n,1,2);r||(r={});var i,f={};for(var p in function e(n,i,a){if(Array.isArray(i))i.forEach((function(t){return e(n,t)}));else if("object"===t(i))for(var o in i)Ae(i,o)&&e(n,i[o],o);else if(Me(i)||void 0!==a){var u=Me(i)?v(i)?i.fn+".transform":i.fn:a;if(Ae(n,u)&&n[u]!==i&&!r.silent)throw new Error('Cannot import "'+u+'" twice');n[u]=i}else if(!r.silent)throw new TypeError("Factory, Object, or Array expected")}(f,e),f)if(Ae(f,p)){var h=f[p];if(Me(h))m(h,r);else if("function"==typeof(i=h)||"number"==typeof i||"string"==typeof i||"boolean"==typeof i||null===i||s(i)||o(i)||a(i)||u(i)||l(i)||Array.isArray(i))c(p,h,r);else if(!r.silent)throw new TypeError("Factory, Object, or Array expected")}}}(Y,0,Z,W);return Z.import=J,Z.on("config",(function(){Se(W).forEach((function(e){e&&e.meta&&e.meta.recreateOnConfigChange&&J(e,{override:!0})}))})),Z.create=e.bind(null,r),Z.factory=Ce,Z.import(Se(Ne(r))),Z.ArgumentsError=io,Z.DimensionError=sn,Z.IndexError=cn,Z}(e)})(),n.default})()));</script>
<script src="http://CDN.PLOT.LY/plotly-2.30.1.min.js"></script>
<style>
input[type=text]{FONT-FAMILY:ARIAL;
--O_ROLOC_O_COLOR_O:#F2F2F2;
--O_SUIDAR_RULB_O_BLUR_RADIUS_O:0PX;
--O_SUIDAR_DAERPS_O_SPREAD_RADIUS_O:1.0PX;
BOX-SHADOW:INSET 0 0 VAR(--O_SUIDAR_RULB_O_BLUR_RADIUS_O) VAR(--O_SUIDAR_DAERPS_O_SPREAD_RADIUS_O) VAR(--O_ROLOC_O_COLOR_O),0 0 VAR(--O_SUIDAR_RULB_O_BLUR_RADIUS_O) VAR(--O_SUIDAR_DAERPS_O_SPREAD_RADIUS_O) VAR(--O_ROLOC_O_COLOR_O)!IMPORTANT;
BORDER-WIDTH:0;BORDER-RADIUS:65536PX;OVERFLOW:VISIBLE
}
input[type=text]:focus{
border-color: #C7C7C7;BORDER-WIDTH:0PX;border-style: solid;outline: 1PX SOLID #E7E7E7;
}
input[type=range]::-moz-range-track {
HEIGHT:0PX;
--O_ROLOC_O_COLOR_O:#F2F2F2;
--O_SUIDAR_RULB_O_BLUR_RADIUS_O:0PX;
--O_SUIDAR_DAERPS_O_SPREAD_RADIUS_O:1.0PX;
BOX-SHADOW:INSET 0 0 VAR(--O_SUIDAR_RULB_O_BLUR_RADIUS_O) VAR(--O_SUIDAR_DAERPS_O_SPREAD_RADIUS_O) VAR(--O_ROLOC_O_COLOR_O),0 0 VAR(--O_SUIDAR_RULB_O_BLUR_RADIUS_O) VAR(--O_SUIDAR_DAERPS_O_SPREAD_RADIUS_O) VAR(--O_ROLOC_O_COLOR_O)!IMPORTANT;
BORDER-WIDTH:0;BORDER-RADIUS:65536PX;OVERFLOW:HIDDEN
}
input[type=range]::-moz-range-thumb {
HEIGHT:16PX;WIDTH:16PX;
--O_ROLOC_O_COLOR_O:#F2F2F2;
--O_SUIDAR_RULB_O_BLUR_RADIUS_O:0PX;
--O_SUIDAR_DAERPS_O_SPREAD_RADIUS_O:1.0PX;
BOX-SHADOW:INSET 0 0 VAR(--O_SUIDAR_RULB_O_BLUR_RADIUS_O) VAR(--O_SUIDAR_DAERPS_O_SPREAD_RADIUS_O) VAR(--O_ROLOC_O_COLOR_O),0 0 VAR(--O_SUIDAR_RULB_O_BLUR_RADIUS_O) VAR(--O_SUIDAR_DAERPS_O_SPREAD_RADIUS_O) VAR(--O_ROLOC_O_COLOR_O)!IMPORTANT;
BORDER-WIDTH:0;BORDER-RADIUS:65536PX;OVERFLOW:HIDDEN
}
</style>
</HEAD>
<BODY STYLE="BACKGROUND:#FFFFFF;FONT-size:12PX;MARGIN:0;COLOR:#C7C7C7;FONT-FAMILY:ARIAL">
<div align="center">
𓊗<br><span id="nVal"></span><br><input type="range" id="n" min="0" max="16" value="8" style="width:100%"><br>
<br><span id="toVal"></span><br><input type="range" id="to" min="-12.566370614359172953850573533118" max="12.566370614359172953850573533118" value="6.283185307179586476925286766559" step="0.785398163396448" style="width:100%;color:#C7C7C7"><br>
<br><span id="fromVal"></span><br><input type="range" id="from" min="-12.566370614359172953850573533118" max="12.566370614359172953850573533118" value="-6.283185307179586476925286766559" step="0.785398163396448" style="width:100%;color:#C7C7C7"><br>
<input type="text" id="formula" value="(1-cos(x*(4)/2))/2 ; acos(cos(x*(4)/2))/pi ; .5+.5*(-1)^floor((4)/2*x/pi)+(-1)^floor((4)/2*x/pi)/(-1-e^(pi*((-(4)/2*x+pi*floor((4)/2*x/pi))^(-1)+(pi-(4)/2*x+pi*floor((4)/2*x/pi))^(-1)))) ; (-1)^floor((x/pi*(4)/2-.5)/1)*(1-abs(mod((x/pi*(4)/2-.5)*2,2)-1)^2)^(1/2)/2+.5" style="width:100%; text-align:CENTER;COLOR:#C7C7C7;FONT-size:12PX"><br>
<div id="k-graph"></div>
<div id="function-graph"></div>
<script>
function clamp(x) {return math.max(math.min(x,1),0)}
// JS equivalent for the map function
function arrayMax(arr) {
return Math.max(...arr.map(e => Math.max(...e)));
}
function arrayMin(arr) {
return Math.min(...arr.map(e => Math.min(...e)));
}
function plot() {
var formulas = document.getElementById('formula').value.split(";");
var fromPIO2 = Number(document.getElementById('from').value);
var toPIO2 = Number(document.getElementById('to').value);
var N = Number(document.getElementById('n').value);
var num_points = 0 + 2 ** N;
document.getElementById('fromVal').innerText = +fromPIO2;
document.getElementById('toVal').innerText = +toPIO2;
document.getElementById('nVal').innerText = N;
var from = fromPIO2;
var to = toPIO2;
var step = (to - from) / num_points;
var x_vals = math.range(from, to, step, true).toArray();
var k_trace = [];
var function_trace = [];
var all_x = [];
var all_y = [];
formulas.map((formula, i) => {
var scope = {
clamp: function(x) { return math.max(math.min(x, 1), 0); }
};
var kappa_vals = x_vals.map(x => math.evaluate(formula.trim(), { x: x, ...scope}));
var theta_vals = math.map(math.cumsum(kappa_vals), x => x * step);
var x_coords = math.map(math.cumsum(math.map(theta_vals, math.cos)), x => x * step);
var y_coords = math.map(math.cumsum(math.map(theta_vals, math.sin)), x => x * step);
if (x_coords[0] != 0 || y_coords[0] != 0) {
x_coords.unshift(0);
y_coords.unshift(0);
}
k_trace.push({
x: x_coords,
y: y_coords,
mode: 'lines+markers',
line:{width:1},
marker:{size:2},
hovertemplate:'ꕤ %{x:.256f}'+'<br>人 %{y:.256f}',
name: ''
});
all_x.push(x_coords);
all_y.push(y_coords);
var y_vals = x_vals.map(x => math.evaluate(formula.trim(), { x: x, ...scope}));
function_trace.push({
x: x_vals,
y: y_vals,
mode: 'lines+markers',
line:{width:1},
marker:{size:2},
hovertemplate:'ꕤ %{x:.256f}'+'<br>人 %{y:.256f}',
name: ''
});
all_x.push(x_vals);
all_y.push(y_vals);
});
// Build annotations for every single curve in k_trace and function_trace
var annotations_k_trace = [];
var annotations_function_trace = [];
for (let trace of k_trace) {
annotations_k_trace.push({
x: trace.x[0],
y: trace.y[0],
text:trace.x[0].toString() + '𓊗' + trace.y[0].toString(), // Update here
font: {color:'#C7C7C7',size:12,family:"ARIAL"},
showarrow: false,
arrowhead: 0,
},{
x: trace.x[trace.x.length - 1],
y: trace.y[trace.y.length - 1],
text:trace.x[trace.x.length - 1].toString() + '𓊗' + trace.y[trace.y.length - 1].toString(), // And here
font: {color:'#C7C7C7',size:12,family:"ARIAL"},
showarrow: false,
arrowhead: 0,
});
}
for (let trace of function_trace) {
annotations_function_trace.push({
x: trace.x[0],
y: trace.y[0],
text:trace.x[0].toString() + '𓊗' + trace.y[0].toString(), // Update here
font: {color:'#C7C7C7',size:12,family:"ARIAL"},
showarrow: false,
arrowhead: 0,
},{
x: trace.x[trace.x.length - 1],
y: trace.y[trace.y.length - 1],
text:trace.x[trace.x.length - 1].toString() + '𓊗' + trace.y[trace.y.length - 1].toString(), // And here
font: {color:'#C7C7C7',size:12,family:"ARIAL"},
showarrow: false,
arrowhead: 0,
});
}
var layout_k_trace = {
annotations: annotations_k_trace,
margin: { l: 0, r: 0, b: 0, t: 0, pad: 0 },
autosize: true,
height: 320,
xaxis: {scaleanchor:'y',scaleratio: 1, autoscale:false, showgrid:true, zeroline:true, zerolinecolor:'#C7C7C7', zerolinewidth:2, tick0:0, dtick:1, showticklabels:true ,automargin:true,gridcolor:'#C7C7C7',tickfont:{color:'#C7C7C7',size:12,family:"ARIAL"},showspikes:false, spikethickness:1, spikedash:'solid', spikemode:'across'},
yaxis: {range: [arrayMin(all_y)-(.0078125*2), arrayMax(all_y)+(.0078125*2)],showgrid:true,zeroline:true,zerolinecolor:'#C7C7C7',zerolinewidth:2,tick0:0,dtick:1,showticklabels:false,automargin:true,gridcolor:'#C7C7C7',tickfont:{color:'#C7C7C7',size:12,family:"ARIAL"},showspikes:false,spikethickness:1,spikedash:'solid',spikemode:'across'},
hovermode: 'closest',
dragmode: false,
showlegend: false,
hoverlabel: { bordercolor: "#C7C7C7", font:{size:12,color:'#C7C7C7',family:"ARIAL"} }
}
var layout_function_trace = {
annotations: annotations_function_trace,
margin: { l: 0, r: 0, b: 0, t: 0, pad: 0 },
autosize: true,
height: 320,
xaxis: {scaleanchor:'y',scaleratio: 1, autoscale:false, showgrid:true, zeroline:true, zerolinecolor:'#C7C7C7', zerolinewidth:2, tick0:0, dtick:1, showticklabels:true ,automargin:true,gridcolor:'#C7C7C7',tickfont:{color:'#C7C7C7',size:12,family:"ARIAL"},showspikes:false, spikethickness:1, spikedash:'solid', spikemode:'across'},
yaxis: {range: [arrayMin(all_y)-(.0078125*2), arrayMax(all_y)+(.0078125*2)],showgrid:true,zeroline:true,zerolinecolor:'#C7C7C7',zerolinewidth:2,tick0:0,dtick:1,showticklabels:false,automargin:true,gridcolor:'#C7C7C7',tickfont:{color:'#C7C7C7',size:12,family:"ARIAL"},showspikes:false,spikethickness:1,spikedash:'solid',spikemode:'across'},
hovermode: 'closest',
dragmode: false,
showlegend: false,
hoverlabel: { bordercolor: "#C7C7C7", font:{size:12,color:'#C7C7C7',family:"ARIAL"} }
}
Plotly.newPlot('k-graph',k_trace,layout_k_trace);
Plotly.newPlot('function-graph',function_trace,layout_function_trace);
}
plot();
document.getElementById('formula').addEventListener('input', plot);
document.getElementById('from').addEventListener('input', plot);
document.getElementById('to').addEventListener('input', plot);
document.getElementById('n').addEventListener('input', plot);
</script>
</div>
</BODY>
</HTML>