parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};r[n]=t}function u(r,n){if(n<0||n>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};return r[n]}function f(r,n){for(var t=new Array(r),o=0;o=0;--f)t[f+o|0]=r[f+n|0]}function s(r){return r.slice(0)}exports.dup=s,exports.sub=r,exports.concat=o,exports.make=f,exports.make_float=i,exports.blit=a,exports.get=u,exports.set=e; },{}],"NSLD":[function(require,module,exports) { "use strict";var r=require("./caml_array.js");function n(e,t){for(;;){var u=t,c=e,s=c.length,a=0===s?1:s,i=a-u.length|0;if(0===i)return c.apply(null,u);if(i>=0)return function(r,e){return function(t){return n(r,e.concat([t]))}}(c,u);t=r.sub(u,a,0|-i),e=c.apply(null,r.sub(u,0,a))}}function e(r,e){var t=r.length;if(1===t)return r(e);switch(t){case 1:return r(e);case 2:return function(n){return r(e,n)};case 3:return function(n,t){return r(e,n,t)};case 4:return function(n,t,u){return r(e,n,t,u)};case 5:return function(n,t,u,c){return r(e,n,t,u,c)};case 6:return function(n,t,u,c,s){return r(e,n,t,u,c,s)};case 7:return function(n,t,u,c,s,a){return r(e,n,t,u,c,s,a)};default:return n(r,[e])}}function t(r){return 1===r.length?r:function(n){return e(r,n)}}function u(r,e,t){var u=r.length;if(2===u)return r(e,t);switch(u){case 1:return n(r(e),[t]);case 2:return r(e,t);case 3:return function(n){return r(e,t,n)};case 4:return function(n,u){return r(e,t,n,u)};case 5:return function(n,u,c){return r(e,t,n,u,c)};case 6:return function(n,u,c,s){return r(e,t,n,u,c,s)};case 7:return function(n,u,c,s,a){return r(e,t,n,u,c,s,a)};default:return n(r,[e,t])}}function c(r){return 2===r.length?r:function(n,e){return u(r,n,e)}}function s(r,e,t,u){var c=r.length;if(3===c)return r(e,t,u);switch(c){case 1:return n(r(e),[t,u]);case 2:return n(r(e,t),[u]);case 3:return r(e,t,u);case 4:return function(n){return r(e,t,u,n)};case 5:return function(n,c){return r(e,t,u,n,c)};case 6:return function(n,c,s){return r(e,t,u,n,c,s)};case 7:return function(n,c,s,a){return r(e,t,u,n,c,s,a)};default:return n(r,[e,t,u])}}function a(r){return 3===r.length?r:function(n,e,t){return s(r,n,e,t)}}function i(r,e,t,u,c){var s=r.length;if(4===s)return r(e,t,u,c);switch(s){case 1:return n(r(e),[t,u,c]);case 2:return n(r(e,t),[u,c]);case 3:return n(r(e,t,u),[c]);case 4:return r(e,t,u,c);case 5:return function(n){return r(e,t,u,c,n)};case 6:return function(n,s){return r(e,t,u,c,n,s)};case 7:return function(n,s,a){return r(e,t,u,c,n,s,a)};default:return n(r,[e,t,u,c])}}function f(r){return 4===r.length?r:function(n,e,t,u){return i(r,n,e,t,u)}}function o(r,e,t,u,c,s){var a=r.length;if(5===a)return r(e,t,u,c,s);switch(a){case 1:return n(r(e),[t,u,c,s]);case 2:return n(r(e,t),[u,c,s]);case 3:return n(r(e,t,u),[c,s]);case 4:return n(r(e,t,u,c),[s]);case 5:return r(e,t,u,c,s);case 6:return function(n){return r(e,t,u,c,s,n)};case 7:return function(n,a){return r(e,t,u,c,s,n,a)};default:return n(r,[e,t,u,c,s])}}function l(r){return 5===r.length?r:function(n,e,t,u,c){return o(r,n,e,t,u,c)}}function h(r,e,t,u,c,s,a){var i=r.length;if(6===i)return r(e,t,u,c,s,a);switch(i){case 1:return n(r(e),[t,u,c,s,a]);case 2:return n(r(e,t),[u,c,s,a]);case 3:return n(r(e,t,u),[c,s,a]);case 4:return n(r(e,t,u,c),[s,a]);case 5:return n(r(e,t,u,c,s),[a]);case 6:return r(e,t,u,c,s,a);case 7:return function(n){return r(e,t,u,c,s,a,n)};default:return n(r,[e,t,u,c,s,a])}}function _(r){return 6===r.length?r:function(n,e,t,u,c,s){return h(r,n,e,t,u,c,s)}}function p(r,e,t,u,c,s,a,i){var f=r.length;if(7===f)return r(e,t,u,c,s,a,i);switch(f){case 1:return n(r(e),[t,u,c,s,a,i]);case 2:return n(r(e,t),[u,c,s,a,i]);case 3:return n(r(e,t,u),[c,s,a,i]);case 4:return n(r(e,t,u,c),[s,a,i]);case 5:return n(r(e,t,u,c,s),[a,i]);case 6:return n(r(e,t,u,c,s,a),[i]);case 7:return r(e,t,u,c,s,a,i);default:return n(r,[e,t,u,c,s,a,i])}}function g(r){return 7===r.length?r:function(n,e,t,u,c,s,a){return p(r,n,e,t,u,c,s,a)}}function x(r,e,t,u,c,s,a,i,f){var o=r.length;if(8===o)return r(e,t,u,c,s,a,i,f);switch(o){case 1:return n(r(e),[t,u,c,s,a,i,f]);case 2:return n(r(e,t),[u,c,s,a,i,f]);case 3:return n(r(e,t,u),[c,s,a,i,f]);case 4:return n(r(e,t,u,c),[s,a,i,f]);case 5:return n(r(e,t,u,c,s),[a,i,f]);case 6:return n(r(e,t,u,c,s,a),[i,f]);case 7:return n(r(e,t,u,c,s,a,i),[f]);default:return n(r,[e,t,u,c,s,a,i,f])}}function v(r){return 8===r.length?r:function(n,e,t,u,c,s,a,i){return x(r,n,e,t,u,c,s,a,i)}}exports.app=n,exports._1=e,exports.__1=t,exports._2=u,exports.__2=c,exports._3=s,exports.__3=a,exports._4=i,exports.__4=f,exports._5=o,exports.__5=l,exports._6=h,exports.__6=_,exports._7=p,exports.__7=g,exports._8=x,exports.__8=v; },{"./caml_array.js":"Tpli"}],"gGFE":[function(require,module,exports) { "use strict";function n(n,t){return nt||n==n?1:t==t?-1:0}function o(n,t){return n===t?0:nt?n:t}function x(n,t){return n>t?n:t}function s(n,t){return n>t?n:t}function p(n,t){return n>t?n:t}function f(n,t){return n[1]===t[1]&&n[0]===t[0]}function l(n,t){var r=t[0],o=n[0];return o>r||!(o=t[1]}function g(n,t){return!f(n,t)}function b(n,t){return!l(n,t)}function q(n,t){return n[0]>t[0]||!(n[0]t[1]}function v(n,t){return!q(n,t)}function d(n,t){return l(n,t)?t:n}function h(n,t){return q(n,t)?n:t}exports.caml_int_compare=n,exports.caml_bool_compare=t,exports.caml_float_compare=r,exports.caml_string_compare=o,exports.caml_bool_min=e,exports.caml_int_min=i,exports.caml_float_min=u,exports.caml_string_min=c,exports.caml_int32_min=_,exports.caml_bool_max=m,exports.caml_int_max=a,exports.caml_float_max=x,exports.caml_string_max=s,exports.caml_int32_max=p,exports.i64_eq=f,exports.i64_neq=g,exports.i64_lt=b,exports.i64_gt=q,exports.i64_le=v,exports.i64_ge=l,exports.i64_min=d,exports.i64_max=h; },{}],"p3B5":[function(require,module,exports) { "use strict";var r=require("./caml.js"),n=function(r,n){for(var e in r)n(e)},e=function(r){if(Array.isArray(r)){for(var n=r.length,e=new Array(n),t=0;t0){var u=e.contents;return void 0!==u&&n>=u?void 0:void(e.contents=n)}},f=[e,t,o],c=[t,e,u];n(e,function(r){return i(f,r)}),n(t,function(r){return i(c,r)});var l=u.contents,_=o.contents;return void 0!==l?void 0!==_?r.caml_string_compare(l,_):-1:void 0!==_?1:0}function o(r,e){if(r===e)return!0;var t=typeof r;if("string"===t||"number"===t||"boolean"===t||"undefined"===t||null===r)return!1;var a=typeof e;if("function"===t||"function"===a)throw{RE_EXN_ID:"Invalid_argument",_1:"equal: functional value",Error:new Error};if("number"===a||"undefined"===a||null===e)return!1;var u=0|r.TAG,i=0|e.TAG;if(248===u)return r[1]===e[1];if(251===u)throw{RE_EXN_ID:"Invalid_argument",_1:"equal: abstract value",Error:new Error};if(u!==i)return!1;var f=0|r.length;if(f!==(0|e.length))return!1;if(!Array.isArray(r)){if(r instanceof Date&&e instanceof Date)return!(r>e||r=0}function s(r,n){return a(r,n)>0}function v(r,n){return a(r,n)<=0}function E(r,n){return a(r,n)<0}function m(r,n){return a(r,n)<=0?r:n}function d(r,n){return a(r,n)>=0?r:n}exports.caml_obj_dup=e,exports.update_dummy=t,exports.caml_compare=a,exports.caml_equal=o,exports.caml_equal_null=i,exports.caml_equal_undefined=f,exports.caml_equal_nullable=c,exports.caml_notequal=l,exports.caml_greaterequal=_,exports.caml_greaterthan=s,exports.caml_lessthan=E,exports.caml_lessequal=v,exports.caml_min=m,exports.caml_max=d; },{"./caml.js":"gGFE"}],"RiV8":[function(require,module,exports) { "use strict";var t={contents:0};function n(n){return t.contents=t.contents+1|0,n+"/"+t.contents}function e(t){return null!=t&&"string"==typeof t.RE_EXN_ID}function o(t){return t.RE_EXN_ID}exports.id=t,exports.create=n,exports.caml_is_extension=e,exports.caml_exn_slot_name=o; },{}],"dzFO":[function(require,module,exports) { "use strict";function o(o){return void 0!==o.BS_PRIVATE_NESTED_SOME_NONE}function E(o){return void 0===o?{BS_PRIVATE_NESTED_SOME_NONE:0}:null!==o&&void 0!==o.BS_PRIVATE_NESTED_SOME_NONE?{BS_PRIVATE_NESTED_SOME_NONE:o.BS_PRIVATE_NESTED_SOME_NONE+1|0}:o}function _(o){return null==o?void 0:E(o)}function t(o){return void 0===o?void 0:E(o)}function n(o){return null===o?void 0:E(o)}function r(o){if(null===o||void 0===o.BS_PRIVATE_NESTED_SOME_NONE)return o;var E=o.BS_PRIVATE_NESTED_SOME_NONE;return 0===E?void 0:{BS_PRIVATE_NESTED_SOME_NONE:E-1|0}}function i(o){return void 0===o?void 0:r(o)}function u(o){return void 0!==o?o.VAL:o}exports.nullable_to_opt=_,exports.undefined_to_opt=t,exports.null_to_opt=n,exports.valFromOption=r,exports.some=E,exports.isNested=o,exports.option_get=i,exports.option_unwrap=u; },{}],"yO2E":[function(require,module,exports) { "use strict";var e=require("./caml_option.js"),r=require("./caml_exceptions.js"),t=r.create("Caml_js_exceptions.Error");function n(e){return r.caml_is_extension(e)?e:{RE_EXN_ID:t,_1:e}}function o(r){if(r.RE_EXN_ID===t)return e.some(r._1)}exports.$$Error=t,exports.internalToOCamlException=n,exports.caml_as_js_exn=o; },{"./caml_option.js":"dzFO","./caml_exceptions.js":"RiV8"}],"d4B1":[function(require,module,exports) { "use strict";var r=require("./curry.js"),t=require("./caml_obj.js"),e=require("./caml_array.js"),n=require("./caml_exceptions.js"),o=require("./caml_js_exceptions.js"),a=e.make_float,i={};function f(t,n){if(0===t)return[];if(t<0)throw{RE_EXN_ID:"Invalid_argument",_1:"Array.init",Error:new Error};for(var o=e.make(t,r._1(n,0)),a=1;a(r.length-n|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Array.sub",Error:new Error};return e.sub(r,t,n)}function v(r,t,e,n){if(t<0||e<0||t>(r.length-e|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Array.fill",Error:new Error};for(var o=t,a=t+e|0;o(r.length-a|0)||o<0||o>(n.length-a|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Array.blit",Error:new Error};return e.blit(r,t,n,o,a)}function c(t,e){for(var n=0,o=e.length;n=0;--a)o=r._2(t,e[a],o);return o}function b(t,e){for(var n=e.length,o=0;;){var a=o;if(a===n)return!1;if(r._1(t,e[a]))return!0;o=a+1|0}}function D(t,e){for(var n=e.length,o=0;;){var a=o;if(a===n)return!0;if(!r._1(t,e[a]))return!1;o=a+1|0}}function N(r,e){for(var n=e.length,o=0;;){var a=o;if(a===n)return!1;if(t.caml_equal(e[a],r))return!0;o=a+1|0}}function R(r,t){for(var e=t.length,n=0;;){var o=n;if(o===e)return!1;if(r===t[o])return!0;n=o+1|0}}var X=n.create("Array.Bottom");function A(t,n){for(var a=function(o,a){var i=1+((a+a|0)+a|0)|0,f=i;if((i+2|0)=0)return e.set(n,i,a);if(e.set(n,i,e.get(n,f)),f<=0)return e.set(n,0,a);o=f}},_=n.length,s=((_+1|0)/3|0)-1|0;s>=0;--s)i(_,s,e.get(n,s));for(var l=_-1|0;l>=2;--l){var v=e.get(n,l);e.set(n,l,e.get(n,0)),u(f(l,0),v)}if(!(_<=1)){var g=e.get(n,1);return e.set(n,1,e.get(n,0)),e.set(n,0,g)}}function j(t,n){var o=function(o,a,i,f,u,_,s){for(var l=o+a|0,v=f+u|0,c=o,h=e.get(n,o),m=f,p=e.get(i,f),E=s;;){var x=E,w=p,y=m,I=h,d=c;if(r._2(t,I,w)<=0){e.set(_,x,I);var k=d+1|0;if(k>=l)return g(i,y,_,x+1|0,v-y|0);E=x+1|0,h=e.get(n,k),c=k}else{e.set(_,x,w);var b=y+1|0;if(b>=v)return g(n,d,_,x+1|0,l-d|0);E=x+1|0,p=e.get(i,b),m=b}}},a=function(o,a,i,f){for(var u=0;u=i&&r._2(t,e.get(a,s),_)>0;)e.set(a,s+1|0,e.get(a,s)),s=s-1|0;e.set(a,s+1|0,_)}},i=function(r,t,e,f){if(f<=5)return a(r,t,e,f);var u=f/2|0,_=f-u|0;return i(r+u|0,t,e+u|0,_),i(r,n,r+_|0,u),o(r+_|0,u,t,e+u|0,_,t,e)},f=n.length;if(f<=5)return a(0,n,0,f);var u=f/2|0,_=f-u|0,s=e.make(_,e.get(n,0));return i(u,s,0,_),i(0,n,_,u),o(_,u,s,0,_,n,0)}var q=u,C=e.concat,O=j;exports.make_float=a,exports.init=f,exports.make_matrix=u,exports.create_matrix=q,exports.append=s,exports.concat=C,exports.sub=l,exports.copy=_,exports.fill=v,exports.blit=g,exports.to_list=w,exports.of_list=I,exports.iter=c,exports.iteri=E,exports.map=m,exports.mapi=x,exports.fold_left=d,exports.fold_right=k,exports.iter2=h,exports.map2=p,exports.for_all=D,exports.exists=b,exports.mem=N,exports.memq=R,exports.sort=A,exports.stable_sort=j,exports.fast_sort=O,exports.Floatarray=i; },{"./curry.js":"NSLD","./caml_obj.js":"p3B5","./caml_array.js":"Tpli","./caml_exceptions.js":"RiV8","./caml_js_exceptions.js":"yO2E"}],"rH1J":[function(require,module,exports) { var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a1)for(var n=1;n=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};r[t]=e}function t(r,t){if(t<0||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};return r[t]}function e(r,t,e,n){if(!(e<=0))for(var o=t,a=e+t|0;os?s:l;_>=0;--_)r[n+_|0]=r[t+_|0];return}if(t<=n)return;for(var c=(r.length-t|0)-1|0,g=o-1|0,v=c>g?g:c,h=0;h<=v;++h)r[n+h|0]=r[t+h|0]}}function a(r){var t=r.length,e="",n=t;if(t<=4096&&t===r.length)return String.fromCharCode.apply(null,r);for(var o=0;n>0;){for(var a=n<1024?n:1024,f=new Array(a),i=0;i=n)return o;var f=r[a],i=t[a];if(f>i)return 1;if(f0}function c(r,t){return l(r,t)>=0}function g(r,t){return l(r,t)<0}function v(r,t){return l(r,t)<=0}exports.caml_create_bytes=n,exports.caml_fill_bytes=e,exports.get=t,exports.set=r,exports.bytes_to_string=a,exports.caml_blit_bytes=o,exports.caml_blit_string=f,exports.bytes_of_string=i,exports.caml_bytes_compare=l,exports.caml_bytes_greaterthan=_,exports.caml_bytes_greaterequal=c,exports.caml_bytes_lessthan=g,exports.caml_bytes_lessequal=v,exports.caml_bytes_equal=s; },{}],"Phox":[function(require,module,exports) { "use strict";var r=require("./caml.js");function t(r,t){return[t,r>>>0]}var n=[-2147483648,0],e=[2147483647,4294967295],i=[0,1],o=[0,0],u=[-1,4294967295];function f(r){return 0!=(-2147483648&r)}function a(r){return 0==(-2147483648&r)}function s(r){var t=r[1]+1|0;return[r[0]+(0===t?1:0)|0,t>>>0]}function c(r){var t=1+(-1^r[1])|0;return[(-1^r[0])+(0===t?1:0)|0,t>>>0]}function x(r,t,n){var e=r[1],i=e+t|0,o=f(e)&&(f(t)||a(i))||f(t)&&a(i)?1:0;return[r[0]+n+o|0,i>>>0]}function _(r,t){return x(r,t[1],t[0])}function l(t,n){return null!==n&&r.i64_eq(t,n)}function p(t,n){return void 0!==n&&r.i64_eq(t,n)}function v(t,n){return null!=n&&r.i64_eq(t,n)}function d(r,t,n){var e=1+(-1^t)>>>0;return x(r,e,(-1^n)+(0===e?1:0)|0)}function g(r,t){return d(r,t[1],t[0])}function h(r,t){if(0===t)return r;var n=r[1];return t>=32?[n<<(t-32|0),0]:[n>>>(32-t|0)|r[0]<>>0]}function q(r,t){if(0===t)return r;var n=r[0],e=t-32|0;return 0===e?[0,n>>>0]:e>0?[0,n>>>e]:[n>>>t,(n<<(0|-e)|r[1]>>>t)>>>0]}function m(r,t){if(0===t)return r;var n=r[0];return t<32?[n>>t,(n<<(32-t|0)|r[1]>>>t)>>>0]:[n>=0?0:-1,n>>(t-32|0)>>>0]}function M(r){return 0===r[0]&&0===r[1]}function b(r,t){for(;;){var e,i=t,u=r,f=u[0],a=0,s=0,x=0;if(0!==f)x=4;else{if(0===u[1])return o;x=4}if(4===x)if(0!==i[0])s=3;else{if(0===i[1])return o;s=3}if(3===s&&(-2147483648!==f||0!==u[1]?a=2:e=i[1]),2===a){var _=i[0],l=u[1],p=0;if(-2147483648!==_||0!==i[1]?p=3:e=l,3===p){var v=i[1];if(f<0){if(_>=0)return c(b(c(u),i));t=c(i),r=c(u);continue}if(_<0)return c(b(u,c(i)));var d=65535&f,g=l>>>16,h=65535&l,q=65535&_,m=v>>>16,M=65535&v,w=0,y=0,A=0,E=h*M;return w=(y=(y=(A=(E>>>16)+g*M)>>>16)+((A=(65535&A)+h*m)>>>16)+d*M)>>>16,w+=(y=(65535&y)+g*m)>>>16,w+=(y=(65535&y)+h*q)>>>16,[(y&=65535)|(w=w+((f>>>16)*M+d*m+g*q+h*(_>>>16))&65535)<<16,(65535&E|(65535&A)<<16)>>>0]}}return 0==(1&e)?o:n}}function w(r,t){return[r[0]^t[0],(r[1]^t[1])>>>0]}function y(r,t){return[r[0]|t[0],(r[1]|t[1])>>>0]}function A(r,t){return[r[0]&t[0],(r[1]&t[1])>>>0]}function E(r){return 4294967296*r[0]+r[1]}function N(r){return isNaN(r)||!isFinite(r)?o:r<=-0x8000000000000000?n:r+1>=0x8000000000000000?e:r<0?c(N(-r)):[r/4294967296|0,(r%4294967296|0)>>>0]}function S(r){var t=r[0],n=t>>21;return 0===n||-1===n&&!(0===r[1]&&-2097152===t)}function z(t){if(S(t))return String(E(t));if(t[0]<0)return r.i64_eq(t,n)?"-9223372036854775808":"-"+z(c(t));var e=N(Math.floor(E(t)/10)),i=e[1],o=e[0],u=d(d(t,i<<3,i>>>29|o<<3),i<<1,i>>>31|o<<1),f=u[1],a=u[0];if(0===f&&0===a)return z(e)+"0";if(a<0){var s=1+(-1^f)>>>0,_=Math.ceil(s/10),l=10*_-s;return z(d(e,0|_,0))+String(0|l)}var p=Math.floor(f/10),v=f-10*p;return z(x(e,0|p,0))+String(0|v)}function F(t,e){for(;;){var f=e,a=t,s=a[0],x=0;if(0===f[0]&&0===f[1])throw{RE_EXN_ID:"Division_by_zero",Error:new Error};if(2===2)if(-2147483648!==s)if(0!==s)x=1;else{if(0===a[1])return o;x=1}else if(0!==a[1])x=1;else{if(r.i64_eq(f,i)||r.i64_eq(f,u))return a;if(r.i64_eq(f,n))return i;var l=h(F(m(a,1),f),1),p=0;if(0!==l[0])p=3;else{if(0===l[1])return f[0]<0?i:c(i);p=3}if(3===p)return _(l,F(g(a,b(f,l)),f))}if(1===x){var v=f[0],d=0;if(-2147483648!==v)d=2;else{if(0===f[1])return o;d=2}if(2===d){if(s<0){if(v>=0)return c(F(c(a),f));e=c(f),t=c(a);continue}if(v<0)return c(F(a,c(f)));for(var q=o,w=a;r.i64_ge(w,f);){for(var y=Math.floor(E(w)/E(f)),A=1>y?1:y,S=Math.ceil(Math.log(A)/Math.LN2),z=S<=48?1:Math.pow(2,S-48),I=N(A),D=b(I,f);D[0]<0||r.i64_gt(D,w);)D=b(I=N(A-=z),f);M(I)&&(I=i),q=_(q,I),w=g(w,D)}return q}}}}function I(r,t){return g(r,b(F(r,t),t))}function D(r,t){var n=F(r,t);return[n,g(r,b(n,t))]}function j(r,t){var n=t[0],e=r[0],i=e>>0]}function L(r){return 0|r[1]}function R(r){var t=r[1],n=r[0],e=function(r){return(r>>>0).toString(16)};if(0===n&&0===t)return"0";if(0===t)return e(n)+"00000000";if(0===n)return e(t);var i=e(t),o=8-i.length|0;return o<=0?e(n)+i:e(n)+("0".repeat(o)+i)}function X(r){return[2147483647&r[0],r[1]]}function B(r){return t=r[1],n=r[0],new Float64Array(new Int32Array([t,n]).buffer)[0];var t,n}function C(r){var t=function(r){return new Int32Array(new Float64Array([r]).buffer)}(r);return[t[1],t[0]>>>0]}exports.mk=t,exports.succ=s,exports.min_int=n,exports.max_int=e,exports.one=i,exports.zero=o,exports.neg_one=u,exports.of_int32=k,exports.to_int32=L,exports.add=_,exports.neg=c,exports.sub=g,exports.lsl_=h,exports.lsr_=q,exports.asr_=m,exports.is_zero=M,exports.mul=b,exports.xor=w,exports.or_=y,exports.and_=A,exports.equal_null=l,exports.equal_undefined=p,exports.equal_nullable=v,exports.to_float=E,exports.of_float=N,exports.div=F,exports.mod_=I,exports.compare=j,exports.float_of_bits=B,exports.bits_of_float=C,exports.div_mod=D,exports.to_hex=R,exports.discard_sign=X,exports.to_string=z; },{"./caml.js":"gGFE"}],"Zve6":[function(require,module,exports) { "use strict";var e=require("./caml.js"),r=require("./caml_int64.js");function a(e){return e>=65?e>=97?e>=123?-1:e-87|0:e>=91?-1:e-55|0:e>57||e<48?-1:e-48|0}function t(e){switch(e){case 0:return 8;case 1:return 16;case 2:return 10;case 3:return 2}}function i(e){var r=1,a=2,t=0;switch(e.charCodeAt(t)){case 43:t=t+1|0;break;case 44:break;case 45:r=-1,t=t+1|0}if("0"===e[t]){var i=e.charCodeAt(t+1|0);if(i>=89)if(i>=111){if(i<121)switch(i){case 111:a=0,t=t+2|0;break;case 117:t=t+2|0;break;case 112:case 113:case 114:case 115:case 116:case 118:case 119:break;case 120:a=1,t=t+2|0}}else 98===i&&(a=3,t=t+2|0);else if(66!==i){if(i>=79)switch(i){case 79:a=0,t=t+2|0;break;case 85:t=t+2|0;break;case 80:case 81:case 82:case 83:case 84:case 86:case 87:break;case 88:a=1,t=t+2|0}}else a=3,t=t+2|0}return[t,r,a]}function n(e){var r=i(e),n=r[0],s=t(r[2]),c=e.length,o=a(n=s)throw{RE_EXN_ID:"Failure",_1:"int_of_string",Error:new Error};var f=r[1]*function(r,t){for(;;){var i=t,n=r;if(i===c)return n;var o=e.charCodeAt(i);if(95!==o){var f=a(o);if(f<0||f>=s)throw{RE_EXN_ID:"Failure",_1:"int_of_string",Error:new Error};var _=s*n+f;if(_>4294967295)throw{RE_EXN_ID:"Failure",_1:"int_of_string",Error:new Error};t=i+1|0,r=_}else t=i+1|0}}(o,n+1|0),_=0|f;if(10===s&&f!==_)throw{RE_EXN_ID:"Failure",_1:"int_of_string",Error:new Error};return _}function s(n){var s,c=i(n),o=c[2],f=c[0],_=r.of_int32(t(o)),u=r.of_int32(c[1]);switch(o){case 0:s=[536870911,4294967295];break;case 1:s=[268435455,4294967295];break;case 2:s=[429496729,2576980377];break;case 3:s=r.max_int}var l=n.length,v=f=65&&e<=90||e>=192&&e<=214||e>=216&&e<=222?e+32|0:e}function f(e){var r=e.length;if(r>31)throw{RE_EXN_ID:"Invalid_argument",_1:"format_int: format too long",Error:new Error};for(var a={justify:"+",signstyle:"-",filter:" ",alternate:!1,base:2,signedconv:!1,width:0,uppercase:!1,sign:1,prec:-1,conv:"f"},t=0;;){var i=t;if(i>=r)return a;var n=e.charCodeAt(i),s=0;if(n>=69)if(n>=88)if(n>=121)s=1;else switch(n){case 88:a.base=1,a.uppercase=!0,t=i+1|0;continue;case 101:case 102:case 103:s=5;break;case 100:case 105:s=4;break;case 111:a.base=0,t=i+1|0;continue;case 117:a.base=2,t=i+1|0;continue;case 89:case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:case 98:case 99:case 104:case 106:case 107:case 108:case 109:case 110:case 112:case 113:case 114:case 115:case 116:case 118:case 119:s=1;break;case 120:a.base=1,t=i+1|0;continue}else{if(!(n>=72)){a.signedconv=!0,a.uppercase=!0,a.conv=String.fromCharCode(o(n)),t=i+1|0;continue}s=1}else switch(n){case 35:a.alternate=!0,t=i+1|0;continue;case 32:case 43:s=2;break;case 45:a.justify="-",t=i+1|0;continue;case 46:a.prec=0;for(var c=i+1|0;function(r){return function(){var a=e.charCodeAt(r)-48|0;return a>=0&&a<=9}}(c)();)a.prec=(Math.imul(a.prec,10)+e.charCodeAt(c)|0)-48|0,c=c+1|0;t=c;continue;case 33:case 34:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 44:case 47:s=1;break;case 48:a.filter="0",t=i+1|0;continue;case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:s=3;break;default:s=1}switch(s){case 1:t=i+1|0;continue;case 2:a.signstyle=String.fromCharCode(n),t=i+1|0;continue;case 3:a.width=0;for(var f=i;function(r){return function(){var a=e.charCodeAt(r)-48|0;return a>=0&&a<=9}}(f)();)a.width=(Math.imul(a.width,10)+e.charCodeAt(f)|0)-48|0,f=f+1|0;t=f;continue;case 4:a.signedconv=!0,a.base=2,t=i+1|0;continue;case 5:a.signedconv=!0,a.conv=String.fromCharCode(n),t=i+1|0;continue}}}function _(e,r){var a=e.justify,t=e.signstyle,i=e.filter,n=e.alternate,s=e.base,c=e.signedconv,o=e.width,f=e.uppercase,_=e.sign,u=r.length;c&&(_<0||"-"!==t)&&(u=u+1|0),n&&(0===s?u=u+1|0:1===s&&(u=u+2|0));var l="";if("+"===a&&" "===i)for(var v=u;v>>0):r>>>0:r).toString(c(a.base));if(a.prec>=0){a.filter=" ";var i=a.prec-t.length|0;i>0&&(t="0".repeat(i)+t)}return _(a,t)}function l(a){if(!e.i64_lt(a,r.zero))return r.to_string(a);var t=[0,10],i=r.discard_sign(a),n=r.div_mod(i,t),s=r.div_mod(r.add([0,8],n[1]),t),c=r.add(r.add([214748364,3435973836],n[0]),s[0]);return r.to_string(c)+"0123456789"[r.to_int32(s[1])]}function v(a){var t="",i=[0,8],n="01234567";if(e.i64_lt(a,r.zero)){var s=r.discard_sign(a),c=r.div_mod(s,i),o=r.add([268435456,0],c[0]),f=c[1];for(t=n[r.to_int32(f)]+t;e.i64_neq(o,r.zero);){var _=r.div_mod(o,i);o=_[0],f=_[1],t=n[r.to_int32(f)]+t}}else{var u=r.div_mod(a,i),l=u[0],v=u[1];for(t=n[r.to_int32(v)]+t;e.i64_neq(l,r.zero);){var g=r.div_mod(l,i);l=g[0],v=g[1],t=n[r.to_int32(v)]+t}}return t}function g(a,t){if("%d"===a)return r.to_string(t);var i,n,s=f(a),c=s.signedconv&&e.i64_lt(t,r.zero)?(s.sign=-1,r.neg(t)):t;switch(s.base){case 0:i=v(c);break;case 1:i=r.to_hex(c);break;case 2:i=l(c)}if(s.prec>=0){s.filter=" ";var o=s.prec-i.length|0;n=o>0?"0".repeat(o)+i:i}else n=i;return _(s,n)}function d(e,r){var a=f(e),t=a.prec<0?6:a.prec,i=r<0?(a.sign=-1,-r):r,n="";if(isNaN(i))n="nan",a.filter=" ";else if(isFinite(i)){switch(a.conv){case"e":var s=(n=i.toExponential(t)).length;"e"===n[s-3|0]&&(n=n.slice(0,s-1|0)+"0"+n.slice(s-1|0));break;case"f":n=i.toFixed(t);break;case"g":var c=0!==t?t:1,o=(n=i.toExponential(c-1|0)).indexOf("e"),u=0|Number(n.slice(o+1|0));if(u<-4||i>=1e21||i.toFixed().length>c){for(var l=o-1|0;"0"===n[l];)l=l-1|0;"."===n[l]&&(l=l-1|0);var v=(n=n.slice(0,l+1|0)+n.slice(o)).length;"e"===n[v-3|0]&&(n=n.slice(0,v-1|0)+"0"+n.slice(v-1|0))}else{var g=c;if(u<0)g=g-(u+1|0)|0,n=i.toFixed(g);else for(;(n=i.toFixed(g)).length>(c+1|0);)g=g-1|0;if(0!==g){for(var d=n.length-1|0;"0"===n[d];)d=d-1|0;"."===n[d]&&(d=d-1|0),n=n.slice(0,d+1|0)}}}}else n="inf",a.filter=" ";return _(a,n)}var h=function(e,r,a){if(!isFinite(e))return isNaN(e)?"nan":e>0?"infinity":"-infinity";var t=0==e&&1/e==-1/0?1:e>=0?0:1;t&&(e=-e);var i=0;if(0==e);else if(e<1)for(;e<1&&i>-1022;)e*=2,i--;else for(;e>=2;)e/=2,i++;var n=i<0?"":"+",s="";if(t)s="-";else switch(a){case 43:s="+";break;case 32:s=" "}if(r>=0&&r<13){var c=Math.pow(2,4*r);e=Math.round(e*c)/c}var o=e.toString(16);if(r>=0){var f=o.indexOf(".");if(f<0)o+="."+"0".repeat(r);else{var _=f+1+r;o.length<_?o+="0".repeat(_-o.length):o=o.substr(0,_)}}return s+"0x"+o+"p"+n+i.toString(10)},p=function(e,r){var a=+e;if(e.length>0&&a==a)return a;if(a=+(e=e.replace(/_/g,"")),e.length>0&&a==a||/^[+-]?nan$/i.test(e))return a;var t=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)p([+-]?[0-9]+)/i.exec(e);if(t){var i=t[3].replace(/0+$/,""),n=parseInt(t[1]+t[2]+i,16),s=(0|t[4])-4*i.length;return a=n*Math.pow(2,s)}if(/^\+?inf(inity)?$/i.test(e))return 1/0;if(/^-inf(inity)?$/i.test(e))return-1/0;throw r};function m(e){return p(e,{RE_EXN_ID:"Failure",_1:"float_of_string"})}var w=u,E=u,b=n,x=n;exports.caml_format_float=d,exports.caml_hexstring_of_float=h,exports.caml_format_int=u,exports.caml_nativeint_format=w,exports.caml_int32_format=E,exports.caml_float_of_string=m,exports.caml_int64_format=g,exports.caml_int_of_string=n,exports.caml_int32_of_string=b,exports.caml_int64_of_string=s,exports.caml_nativeint_of_string=x; },{"./caml.js":"gGFE","./caml_int64.js":"Phox"}],"GLny":[function(require,module,exports) { "use strict";function r(r,t){if(t>=r.length||t<0)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};return r.charCodeAt(t)}function t(r,t){return String.fromCharCode(t).repeat(r)}exports.get=r,exports.make=t; },{}],"FC4F":[function(require,module,exports) { var global = arguments[3]; var e=arguments[3],r=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;if(void 0!==this)return this;throw new Error("Unable to locate global `this`")},t=function(e){var t=r();if(void 0===t[e])throw new Error(e+" not polyfilled by ReScript yet\n");return t[e]},n=function(e,t){return r()[e]=t,0};exports.getGlobalThis=r,exports.resolve=t,exports.register=n; },{}],"z22f":[function(require,module,exports) { "use strict";var r=require("./curry.js"),t=require("./caml_io.js"),e=require("./caml_sys.js"),n=require("./caml_bytes.js"),o=require("./caml_format.js"),_=require("./caml_string.js"),l=require("./caml_exceptions.js"),u=require("./caml_js_exceptions.js"),i=require("./caml_external_polyfill.js");function s(r){throw{RE_EXN_ID:"Failure",_1:r,Error:new Error}}function a(r){throw{RE_EXN_ID:"Invalid_argument",_1:r,Error:new Error}}var c=l.create("Pervasives.Exit");function p(r){return r>=0?r:0|-r}function f(r){return-1^r}var m=-2147483648;function x(r){return isFinite(r)?Math.abs(r)>=2.2250738585072014e-308?0:0!==r?1:2:isNaN(r)?4:3}function h(r){if(r<0||r>255)throw{RE_EXN_ID:"Invalid_argument",_1:"char_of_int",Error:new Error};return r}function v(r){return r?"true":"false"}function d(r){switch(r){case"false":return!1;case"true":return!0;default:throw{RE_EXN_ID:"Invalid_argument",_1:"bool_of_string",Error:new Error}}}function E(r){switch(r){case"false":return!1;case"true":return!0;default:return}}function g(r){try{return o.caml_int_of_string(r)}catch(e){var t=u.internalToOCamlException(e);if("Failure"===t.RE_EXN_ID)return;throw t}}function y(r){for(var t=r.length,e=0;;){var n=e;if(n>=t)return r+".";var o=_.get(r,n);if(o>=48){if(o>=58)return r;e=n+1|0}else{if(45!==o)return r;e=n+1|0}}}function b(r){return y(o.caml_format_float("%.12g",r))}function w(r){try{return o.caml_float_of_string(r)}catch(e){var t=u.internalToOCamlException(e);if("Failure"===t.RE_EXN_ID)return;throw t}}function I(r,t){return r?{hd:r.hd,tl:I(r.tl,t)}:t}var N=t.stdin,D=t.stdout,R=t.stderr;function X(r,t,e){var n=i.resolve("caml_ml_open_descriptor_out")(i.resolve("caml_sys_open")(e,r,t));return i.resolve("caml_ml_set_channel_name")(n,e),n}function j(r){return X({hd:1,tl:{hd:3,tl:{hd:4,tl:{hd:7,tl:0}}}},438,r)}function q(r){return X({hd:1,tl:{hd:3,tl:{hd:4,tl:{hd:6,tl:0}}}},438,r)}function k(r){for(var e=t.caml_ml_out_channels_list(void 0);;){var n=e;if(!n)return;try{t.caml_ml_flush(n.hd)}catch(_){var o=u.internalToOCamlException(_);if("Sys_error"!==o.RE_EXN_ID)throw o}e=n.tl}}function F(r,t){return i.resolve("caml_ml_output_bytes")(r,t,0,t.length)}function z(r,e){return t.caml_ml_output(r,e,0,e.length)}function C(r,t,e,n){if(e<0||n<0||e>(t.length-n|0))throw{RE_EXN_ID:"Invalid_argument",_1:"output",Error:new Error};return i.resolve("caml_ml_output_bytes")(r,t,e,n)}function O(r,e,n,o){if(n<0||o<0||n>(e.length-o|0))throw{RE_EXN_ID:"Invalid_argument",_1:"output_substring",Error:new Error};return t.caml_ml_output(r,e,n,o)}function S(r,t){return i.resolve("caml_output_value")(r,t,0)}function T(r){return t.caml_ml_flush(r),i.resolve("caml_ml_close_channel")(r)}function L(r){try{t.caml_ml_flush(r)}catch(e){}try{return i.resolve("caml_ml_close_channel")(r)}catch(n){return}}function M(r,t,e){var n=i.resolve("caml_ml_open_descriptor_in")(i.resolve("caml_sys_open")(e,r,t));return i.resolve("caml_ml_set_channel_name")(n,e),n}function P(r){return M({hd:0,tl:{hd:7,tl:0}},0,r)}function $(r){return M({hd:0,tl:{hd:6,tl:0}},0,r)}function A(r,t,e,n){if(e<0||n<0||e>(t.length-n|0))throw{RE_EXN_ID:"Invalid_argument",_1:"input",Error:new Error};return i.resolve("caml_ml_input")(r,t,e,n)}function B(r,t,e,n){for(;;){var o=n,_=e;if(o<=0)return;var l=i.resolve("caml_ml_input")(r,t,_,o);if(0===l)throw{RE_EXN_ID:"End_of_file",Error:new Error};n=o-l|0,e=_+l|0}}function G(r,t,e,n){if(e<0||n<0||e>(t.length-n|0))throw{RE_EXN_ID:"Invalid_argument",_1:"really_input",Error:new Error};return B(r,t,e,n)}function H(r,t){var e=n.caml_create_bytes(t);return G(r,e,0,t),n.bytes_to_string(e)}function J(r){var t=function(r,t,e){for(;;){var o=e,_=t;if(!o)return r;var l=o.hd,u=l.length;n.caml_blit_bytes(l,0,r,_-u|0,u),e=o.tl,t=_-u|0}};return n.bytes_to_string(function(e,o){for(;;){var _=o,l=e,u=i.resolve("caml_ml_input_scan_line")(r);if(0===u){if(l)return t(n.caml_create_bytes(_),_,l);throw{RE_EXN_ID:"End_of_file",Error:new Error}}if(u>0){var s=n.caml_create_bytes(u-1|0);if(i.resolve("caml_ml_input")(r,s,0,u-1|0),i.resolve("caml_ml_input_char")(r),!l)return s;var a=(_+u|0)-1|0;return t(n.caml_create_bytes(a),a,{hd:s,tl:l})}var c=n.caml_create_bytes(0|-u);i.resolve("caml_ml_input")(r,c,0,0|-u),o=_-u|0,e={hd:c,tl:l}}}(0,0))}function K(r){try{return i.resolve("caml_ml_close_channel")(r)}catch(t){return}}function Q(r){return t.caml_ml_output_char(D,r)}function U(r){return z(D,r)}function V(r){return F(D,r)}function W(r){return z(D,String(r))}function Y(r){return z(D,y(o.caml_format_float("%.12g",r)))}function Z(r){return t.caml_ml_output_char(D,10),t.caml_ml_flush(D)}function rr(r){return t.caml_ml_output_char(R,r)}function tr(r){return z(R,r)}function er(r){return F(R,r)}function nr(r){return z(R,String(r))}function or(r){return z(R,y(o.caml_format_float("%.12g",r)))}function _r(r){return t.caml_ml_output_char(R,10),t.caml_ml_flush(R)}function lr(r){return t.caml_ml_flush(D),J(N)}function ur(r){return o.caml_int_of_string((t.caml_ml_flush(D),J(N)))}function ir(r){return g((t.caml_ml_flush(D),J(N)))}function sr(r){return o.caml_float_of_string((t.caml_ml_flush(D),J(N)))}function ar(r){return w((t.caml_ml_flush(D),J(N)))}function cr(r){return r._1}var pr={contents:k};function fr(t){var e=pr.contents;pr.contents=function(n){return r._1(t,void 0),r._1(e,void 0)}}function mr(t){return r._1(pr.contents,void 0)}function xr(r){return mr(void 0),e.caml_sys_exit(r)}var hr=2147483647,vr=1/0,dr=-1/0,Er=1.7976931348623157e308,gr=2.2250738585072014e-308,yr=2.220446049250313e-16,br=t.caml_ml_flush,wr=t.caml_ml_output_char,Ir=t.caml_ml_output_char;function Nr(r,t){return i.resolve("caml_ml_output_int")(r,t)}function Dr(r,t){return i.resolve("caml_ml_seek_out")(r,t)}function Rr(r){return i.resolve("caml_ml_pos_out")(r)}function Xr(r){return i.resolve("caml_ml_channel_size")(r)}function jr(r,t){return i.resolve("caml_ml_set_binary_mode")(r,t)}function qr(r){return i.resolve("caml_ml_input_char")(r)}function kr(r){return i.resolve("caml_ml_input_char")(r)}function Fr(r){return i.resolve("caml_ml_input_int")(r)}function zr(r){return i.resolve("caml_input_value")(r)}function Cr(r,t){return i.resolve("caml_ml_seek_in")(r,t)}function Or(r){return i.resolve("caml_ml_pos_in")(r)}function Sr(r){return i.resolve("caml_ml_channel_size")(r)}function Tr(r){return i.resolve("caml_ml_close_channel")(r)}function Lr(r,t){return i.resolve("caml_ml_set_binary_mode")(r,t)}function Mr(r,t){return i.resolve("caml_ml_seek_out_64")(r,t)}function Pr(r){return i.resolve("caml_ml_pos_out_64")(r)}function $r(r){return i.resolve("caml_ml_channel_size_64")(r)}function Ar(r,t){return i.resolve("caml_ml_seek_in_64")(r,t)}function Br(r){return i.resolve("caml_ml_pos_in_64")(r)}function Gr(r){return i.resolve("caml_ml_channel_size_64")(r)}var Hr={seek_out:Mr,pos_out:Pr,out_channel_length:$r,seek_in:Ar,pos_in:Br,in_channel_length:Gr};exports.invalid_arg=a,exports.failwith=s,exports.Exit=c,exports.abs=p,exports.max_int=hr,exports.min_int=m,exports.lnot=f,exports.infinity=vr,exports.neg_infinity=dr,exports.max_float=Er,exports.min_float=gr,exports.epsilon_float=yr,exports.classify_float=x,exports.char_of_int=h,exports.string_of_bool=v,exports.bool_of_string=d,exports.bool_of_string_opt=E,exports.int_of_string_opt=g,exports.string_of_float=b,exports.float_of_string_opt=w,exports.$at=I,exports.stdin=N,exports.stdout=D,exports.stderr=R,exports.print_char=Q,exports.print_string=U,exports.print_bytes=V,exports.print_int=W,exports.print_float=Y,exports.print_newline=Z,exports.prerr_char=rr,exports.prerr_string=tr,exports.prerr_bytes=er,exports.prerr_int=nr,exports.prerr_float=or,exports.prerr_newline=_r,exports.read_line=lr,exports.read_int=ur,exports.read_int_opt=ir,exports.read_float=sr,exports.read_float_opt=ar,exports.open_out=j,exports.open_out_bin=q,exports.open_out_gen=X,exports.flush=br,exports.flush_all=k,exports.output_char=wr,exports.output_string=z,exports.output_bytes=F,exports.output=C,exports.output_substring=O,exports.output_byte=Ir,exports.output_binary_int=Nr,exports.output_value=S,exports.seek_out=Dr,exports.pos_out=Rr,exports.out_channel_length=Xr,exports.close_out=T,exports.close_out_noerr=L,exports.set_binary_mode_out=jr,exports.open_in=P,exports.open_in_bin=$,exports.open_in_gen=M,exports.input_char=qr,exports.input_line=J,exports.input=A,exports.really_input=G,exports.really_input_string=H,exports.input_byte=kr,exports.input_binary_int=Fr,exports.input_value=zr,exports.seek_in=Cr,exports.pos_in=Or,exports.in_channel_length=Sr,exports.close_in=Tr,exports.close_in_noerr=K,exports.set_binary_mode_in=Lr,exports.LargeFile=Hr,exports.string_of_format=cr,exports.exit=xr,exports.at_exit=fr,exports.valid_float_lexem=y,exports.unsafe_really_input=B,exports.do_at_exit=mr; },{"./curry.js":"NSLD","./caml_io.js":"bJMn","./caml_sys.js":"Juhd","./caml_bytes.js":"gmRG","./caml_format.js":"Zve6","./caml_string.js":"GLny","./caml_exceptions.js":"RiV8","./caml_js_exceptions.js":"yO2E","./caml_external_polyfill.js":"FC4F"}],"aYjQ":[function(require,module,exports) { "use strict";var r=require("./curry.js"),t=require("./caml_obj.js"),n=require("./pervasives.js"),l=require("./caml_option.js");function e(r){for(var t=0,n=r;;){var l=t;if(!n)return l;n=n.tl,t=l+1|0}}function o(r,t){return{hd:r,tl:t}}function i(r){if(r)return r.hd;throw{RE_EXN_ID:"Failure",_1:"hd",Error:new Error}}function h(r){if(r)return r.tl;throw{RE_EXN_ID:"Failure",_1:"tl",Error:new Error}}function d(r,t){if(t<0)throw{RE_EXN_ID:"Invalid_argument",_1:"List.nth",Error:new Error};for(var n=r,l=t;;){var e=l,o=n;if(!o)throw{RE_EXN_ID:"Failure",_1:"nth",Error:new Error};if(0===e)return o.hd;l=e-1|0,n=o.tl}}function f(r,t){if(t<0)throw{RE_EXN_ID:"Invalid_argument",_1:"List.nth",Error:new Error};for(var n=r,e=t;;){var o=e,i=n;if(!i)return;if(0===o)return l.some(i.hd);e=o-1|0,n=i.tl}}function u(r,t){for(;;){var n=t,l=r;if(!l)return n;t={hd:l.hd,tl:n},r=l.tl}}function _(r){return u(r,0)}function a(t,n,l,e){for(;;){var o=n,i=t;if(o>=l)return i;n=o+1|0,t={hd:r._1(e,o),tl:i}}}function v(t,n,l){return t>=n?0:{hd:r._1(l,t),tl:v(t+1|0,n,l)}}function s(r,t){if(r<0)throw{RE_EXN_ID:"Invalid_argument",_1:"List.init",Error:new Error};return r>1e4?u(a(0,0,r,t),0):v(0,r,t)}function E(r){return r?n.$at(r.hd,E(r.tl)):0}function c(t,n){return n?{hd:r._1(t,n.hd),tl:c(t,n.tl)}:0}function p(t,n,l){return l?{hd:r._2(n,t,l.hd),tl:p(t+1|0,n,l.tl)}:0}function m(r,t){return p(0,r,t)}function x(t,n){for(var l=0,e=n;;){var o=e,i=l;if(!o)return i;e=o.tl,l={hd:r._1(t,o.hd),tl:i}}}function w(t,n){for(;;){var l=n;if(!l)return;r._1(t,l.hd),n=l.tl}}function I(t,n){for(var l=0,e=n;;){var o=e,i=l;if(!o)return;r._2(t,i,o.hd),e=o.tl,l=i+1|0}}function N(t,n,l){for(;;){var e=l,o=n;if(!e)return o;l=e.tl,n=r._2(t,o,e.hd)}}function g(t,n,l){return n?r._2(t,n.hd,g(t,n.tl,l)):l}function D(t,n,l){if(n){if(l)return{hd:r._2(t,n.hd,l.hd),tl:D(t,n.tl,l.tl)};throw{RE_EXN_ID:"Invalid_argument",_1:"List.map2",Error:new Error}}if(!l)return 0;throw{RE_EXN_ID:"Invalid_argument",_1:"List.map2",Error:new Error}}function R(t,n,l){for(var e=0,o=n,i=l;;){var h=i,d=o,f=e;if(d){if(h){i=h.tl,o=d.tl,e={hd:r._2(t,d.hd,h.hd),tl:f};continue}throw{RE_EXN_ID:"Invalid_argument",_1:"List.rev_map2",Error:new Error}}if(h)throw{RE_EXN_ID:"Invalid_argument",_1:"List.rev_map2",Error:new Error};return f}}function X(t,n,l){for(;;){var e=l,o=n;if(o){if(e){r._2(t,o.hd,e.hd),l=e.tl,n=o.tl;continue}throw{RE_EXN_ID:"Invalid_argument",_1:"List.iter2",Error:new Error}}if(!e)return;throw{RE_EXN_ID:"Invalid_argument",_1:"List.iter2",Error:new Error}}}function L(t,n,l,e){for(;;){var o=e,i=l,h=n;if(i){if(o){e=o.tl,l=i.tl,n=r._3(t,h,i.hd,o.hd);continue}throw{RE_EXN_ID:"Invalid_argument",_1:"List.fold_left2",Error:new Error}}if(o)throw{RE_EXN_ID:"Invalid_argument",_1:"List.fold_left2",Error:new Error};return h}}function q(t,n,l,e){if(n){if(l)return r._3(t,n.hd,l.hd,q(t,n.tl,l.tl,e));throw{RE_EXN_ID:"Invalid_argument",_1:"List.fold_right2",Error:new Error}}if(l)throw{RE_EXN_ID:"Invalid_argument",_1:"List.fold_right2",Error:new Error};return e}function b(t,n){for(;;){var l=n;if(!l)return!0;if(!r._1(t,l.hd))return!1;n=l.tl}}function j(t,n){for(;;){var l=n;if(!l)return!1;if(r._1(t,l.hd))return!0;n=l.tl}}function F(t,n,l){for(;;){var e=l,o=n;if(o){if(e){if(!r._2(t,o.hd,e.hd))return!1;l=e.tl,n=o.tl;continue}throw{RE_EXN_ID:"Invalid_argument",_1:"List.for_all2",Error:new Error}}if(!e)return!0;throw{RE_EXN_ID:"Invalid_argument",_1:"List.for_all2",Error:new Error}}}function $(t,n,l){for(;;){var e=l,o=n;if(o){if(e){if(r._2(t,o.hd,e.hd))return!0;l=e.tl,n=o.tl;continue}throw{RE_EXN_ID:"Invalid_argument",_1:"List.exists2",Error:new Error}}if(!e)return!1;throw{RE_EXN_ID:"Invalid_argument",_1:"List.exists2",Error:new Error}}}function y(r,n){for(;;){var l=n;if(!l)return!1;if(t.caml_equal(l.hd,r))return!0;n=l.tl}}function A(r,t){for(;;){var n=t;if(!n)return!1;if(n.hd===r)return!0;t=n.tl}}function k(r,n){for(;;){var l=n;if(!l)throw{RE_EXN_ID:"Not_found",Error:new Error};var e=l.hd;if(t.caml_equal(e[0],r))return e[1];n=l.tl}}function z(r,n){for(;;){var e=n;if(!e)return;var o=e.hd;if(t.caml_equal(o[0],r))return l.some(o[1]);n=e.tl}}function B(r,t){for(;;){var n=t;if(!n)throw{RE_EXN_ID:"Not_found",Error:new Error};var l=n.hd;if(l[0]===r)return l[1];t=n.tl}}function C(r,t){for(;;){var n=t;if(!n)return;var e=n.hd;if(e[0]===r)return l.some(e[1]);t=n.tl}}function G(r,n){for(;;){var l=n;if(!l)return!1;if(t.caml_equal(l.hd[0],r))return!0;n=l.tl}}function H(r,t){for(;;){var n=t;if(!n)return!1;if(n.hd[0]===r)return!0;t=n.tl}}function J(r,n){if(!n)return 0;var l=n.tl,e=n.hd;return t.caml_equal(e[0],r)?l:{hd:e,tl:J(r,l)}}function K(r,t){if(!t)return 0;var n=t.tl,l=t.hd;return l[0]===r?n:{hd:l,tl:K(r,n)}}function M(t,n){for(;;){var l=n;if(!l)throw{RE_EXN_ID:"Not_found",Error:new Error};var e=l.hd;if(r._1(t,e))return e;n=l.tl}}function O(t,n){for(;;){var e=n;if(!e)return;var o=e.hd;if(r._1(t,o))return l.some(o);n=e.tl}}function P(t){return function(n){for(var l=0,e=n;;){var o=e,i=l;if(!o)return u(i,0);var h=o.tl,d=o.hd;r._1(t,d)?(e=h,l={hd:d,tl:i}):e=h}}}function Q(t,n){for(var l=0,e=0,o=n;;){var i=o,h=e,d=l;if(!i)return[u(d,0),u(h,0)];var f=i.tl,_=i.hd;r._1(t,_)?(o=f,l={hd:_,tl:d}):(o=f,e={hd:_,tl:h})}}function S(r){if(!r)return[0,0];var t=r.hd,n=S(r.tl);return[{hd:t[0],tl:n[0]},{hd:t[1],tl:n[1]}]}function T(r,t){if(r){if(t)return{hd:[r.hd,t.hd],tl:T(r.tl,t.tl)};throw{RE_EXN_ID:"Invalid_argument",_1:"List.combine",Error:new Error}}if(!t)return 0;throw{RE_EXN_ID:"Invalid_argument",_1:"List.combine",Error:new Error}}function U(t,n,l){if(!n)return l;if(!l)return n;var e=l.hd,o=n.hd;return r._2(t,o,e)<=0?{hd:o,tl:U(t,n.tl,l)}:{hd:e,tl:U(t,n,l.tl)}}function V(r,t){for(;;){var n=t,l=r;if(0===l)return n;if(!n)throw{RE_EXN_ID:"Assert_failure",_1:["list.ml",262,11],Error:new Error};t=n.tl,r=l-1|0}}function W(t,n){var l=function(n,l){if(2!==n){if(3===n&&l){var e=l.tl;if(e){var i=e.tl;if(i){var h=i.hd,d=e.hd,f=l.hd;return r._2(t,f,d)<=0?r._2(t,d,h)<=0?{hd:f,tl:{hd:d,tl:{hd:h,tl:0}}}:r._2(t,f,h)<=0?{hd:f,tl:{hd:h,tl:{hd:d,tl:0}}}:{hd:h,tl:{hd:f,tl:{hd:d,tl:0}}}:r._2(t,f,h)<=0?{hd:d,tl:{hd:f,tl:{hd:h,tl:0}}}:r._2(t,d,h)<=0?{hd:d,tl:{hd:h,tl:{hd:f,tl:0}}}:{hd:h,tl:{hd:d,tl:{hd:f,tl:0}}}}}}}else if(l){var _=l.tl;if(_){var a=_.hd,v=l.hd;return r._2(t,v,a)<=0?{hd:v,tl:{hd:a,tl:0}}:{hd:a,tl:{hd:v,tl:0}}}}for(var s=n>>1,E=n-s|0,c=V(s,l),p=o(s,l),m=o(E,c),x=0;;){var w=x,I=m,N=p;if(!N)return u(I,w);if(!I)return u(N,w);var g=I.hd,D=N.hd;r._2(t,D,g)>0?(x={hd:D,tl:w},p=N.tl):(x={hd:g,tl:w},m=I.tl)}},o=function(n,e){if(2!==n){if(3===n&&e){var o=e.tl;if(o){var i=o.tl;if(i){var h=i.hd,d=o.hd,f=e.hd;return r._2(t,f,d)>0?r._2(t,d,h)>0?{hd:f,tl:{hd:d,tl:{hd:h,tl:0}}}:r._2(t,f,h)>0?{hd:f,tl:{hd:h,tl:{hd:d,tl:0}}}:{hd:h,tl:{hd:f,tl:{hd:d,tl:0}}}:r._2(t,f,h)>0?{hd:d,tl:{hd:f,tl:{hd:h,tl:0}}}:r._2(t,d,h)>0?{hd:d,tl:{hd:h,tl:{hd:f,tl:0}}}:{hd:h,tl:{hd:d,tl:{hd:f,tl:0}}}}}}}else if(e){var _=e.tl;if(_){var a=_.hd,v=e.hd;return r._2(t,v,a)>0?{hd:v,tl:{hd:a,tl:0}}:{hd:a,tl:{hd:v,tl:0}}}}for(var s=n>>1,E=n-s|0,c=V(s,e),p=l(s,e),m=l(E,c),x=0;;){var w=x,I=m,N=p;if(!N)return u(I,w);if(!I)return u(N,w);var g=I.hd,D=N.hd;r._2(t,D,g)<=0?(x={hd:D,tl:w},p=N.tl):(x={hd:g,tl:w},m=I.tl)}},i=e(n);return i<2?n:l(i,n)}function Y(t,n){var l=function(n,l){if(2!==n){if(3===n&&l){var e=l.tl;if(e){var i=e.tl;if(i){var h=i.hd,d=e.hd,f=l.hd,_=r._2(t,f,d);if(0===_){var a=r._2(t,d,h);return 0===a?{hd:d,tl:0}:a<0?{hd:d,tl:{hd:h,tl:0}}:{hd:h,tl:{hd:d,tl:0}}}if(_<0){var v=r._2(t,d,h);if(0===v)return{hd:f,tl:{hd:d,tl:0}};if(v<0)return{hd:f,tl:{hd:d,tl:{hd:h,tl:0}}};var s=r._2(t,f,h);return 0===s?{hd:f,tl:{hd:d,tl:0}}:s<0?{hd:f,tl:{hd:h,tl:{hd:d,tl:0}}}:{hd:h,tl:{hd:f,tl:{hd:d,tl:0}}}}var E=r._2(t,f,h);if(0===E)return{hd:d,tl:{hd:f,tl:0}};if(E<0)return{hd:d,tl:{hd:f,tl:{hd:h,tl:0}}};var c=r._2(t,d,h);return 0===c?{hd:d,tl:{hd:f,tl:0}}:c<0?{hd:d,tl:{hd:h,tl:{hd:f,tl:0}}}:{hd:h,tl:{hd:d,tl:{hd:f,tl:0}}}}}}}else if(l){var p=l.tl;if(p){var m=p.hd,x=l.hd,w=r._2(t,x,m);return 0===w?{hd:x,tl:0}:w<0?{hd:x,tl:{hd:m,tl:0}}:{hd:m,tl:{hd:x,tl:0}}}}for(var I=n>>1,N=n-I|0,g=V(I,l),D=o(I,l),R=o(N,g),X=0;;){var L=X,q=R,b=D;if(!b)return u(q,L);if(!q)return u(b,L);var j=q.tl,F=q.hd,$=b.tl,y=b.hd,A=r._2(t,y,F);0!==A?A>0?(X={hd:y,tl:L},D=$):(X={hd:F,tl:L},R=j):(X={hd:y,tl:L},R=j,D=$)}},o=function(n,e){if(2!==n){if(3===n&&e){var o=e.tl;if(o){var i=o.tl;if(i){var h=i.hd,d=o.hd,f=e.hd,_=r._2(t,f,d);if(0===_){var a=r._2(t,d,h);return 0===a?{hd:d,tl:0}:a>0?{hd:d,tl:{hd:h,tl:0}}:{hd:h,tl:{hd:d,tl:0}}}if(_>0){var v=r._2(t,d,h);if(0===v)return{hd:f,tl:{hd:d,tl:0}};if(v>0)return{hd:f,tl:{hd:d,tl:{hd:h,tl:0}}};var s=r._2(t,f,h);return 0===s?{hd:f,tl:{hd:d,tl:0}}:s>0?{hd:f,tl:{hd:h,tl:{hd:d,tl:0}}}:{hd:h,tl:{hd:f,tl:{hd:d,tl:0}}}}var E=r._2(t,f,h);if(0===E)return{hd:d,tl:{hd:f,tl:0}};if(E>0)return{hd:d,tl:{hd:f,tl:{hd:h,tl:0}}};var c=r._2(t,d,h);return 0===c?{hd:d,tl:{hd:f,tl:0}}:c>0?{hd:d,tl:{hd:h,tl:{hd:f,tl:0}}}:{hd:h,tl:{hd:d,tl:{hd:f,tl:0}}}}}}}else if(e){var p=e.tl;if(p){var m=p.hd,x=e.hd,w=r._2(t,x,m);return 0===w?{hd:x,tl:0}:w>0?{hd:x,tl:{hd:m,tl:0}}:{hd:m,tl:{hd:x,tl:0}}}}for(var I=n>>1,N=n-I|0,g=V(I,e),D=l(I,e),R=l(N,g),X=0;;){var L=X,q=R,b=D;if(!b)return u(q,L);if(!q)return u(b,L);var j=q.tl,F=q.hd,$=b.tl,y=b.hd,A=r._2(t,y,F);0!==A?A<0?(X={hd:y,tl:L},D=$):(X={hd:F,tl:L},R=j):(X={hd:y,tl:L},R=j,D=$)}},i=e(n);return i<2?n:l(i,n)}function Z(r,t){for(;;){var n=r;if(!n)return t?-1:0;if(!t)return 1;t=t.tl,r=n.tl}}function rr(r,t){for(;;){if(!r)return 0===t?0:t>0?-1:1;if(t<=0)return 1;t=t-1|0,r=r.tl}}var tr=n.$at,nr=E,lr=P,er=W,or=W;exports.length=e,exports.compare_lengths=Z,exports.compare_length_with=rr,exports.cons=o,exports.hd=i,exports.tl=h,exports.nth=d,exports.nth_opt=f,exports.rev=_,exports.init=s,exports.append=tr,exports.rev_append=u,exports.concat=nr,exports.flatten=E,exports.iter=w,exports.iteri=I,exports.map=c,exports.mapi=m,exports.rev_map=x,exports.fold_left=N,exports.fold_right=g,exports.iter2=X,exports.map2=D,exports.rev_map2=R,exports.fold_left2=L,exports.fold_right2=q,exports.for_all=b,exports.exists=j,exports.for_all2=F,exports.exists2=$,exports.mem=y,exports.memq=A,exports.find=M,exports.find_opt=O,exports.filter=lr,exports.find_all=P,exports.partition=Q,exports.assoc=k,exports.assoc_opt=z,exports.assq=B,exports.assq_opt=C,exports.mem_assoc=G,exports.mem_assq=H,exports.remove_assoc=J,exports.remove_assq=K,exports.split=S,exports.combine=T,exports.sort=er,exports.stable_sort=W,exports.fast_sort=or,exports.sort_uniq=Y,exports.merge=U; },{"./curry.js":"NSLD","./caml_obj.js":"p3B5","./pervasives.js":"z22f","./caml_option.js":"dzFO"}],"eN7B":[function(require,module,exports) { "use strict";var r=require("./curry.js");function e(r){return r}function a(e){var a=e.cmp;return{cmp:r.__2(a)}}function t(r){return{cmp:r}}function n(e){return{cmp:r.__2(e)}}function o(r){return r}function s(e){var a=e.hash,t=r.__1(a),n=e.eq;return{hash:t,eq:r.__2(n)}}function u(r,e){return{hash:r,eq:e}}function c(e,a){return{hash:r.__1(e),eq:r.__2(a)}}exports.MakeComparableU=e,exports.MakeComparable=a,exports.comparableU=t,exports.comparable=n,exports.MakeHashableU=o,exports.MakeHashable=s,exports.hashableU=u,exports.hashable=c; },{"./curry.js":"NSLD"}],"NOig":[function(require,module,exports) { "use strict";var r=require("./caml_option.js");function e(r){var e=typeof r;return"string"===e?{TAG:0,_0:r}:"number"===e?{TAG:1,_0:r}:"boolean"===e?!0===r?1:0:null===r?2:Array.isArray(r)?{TAG:3,_0:r}:{TAG:2,_0:r}}function n(r,e){switch(e){case 0:return"string"==typeof r;case 1:return"number"==typeof r;case 2:return null!==r&&"object"==typeof r&&!Array.isArray(r);case 3:return Array.isArray(r);case 4:return"boolean"==typeof r;case 5:return null===r}}function t(r){if("string"==typeof r)return r}function o(r){if("number"==typeof r)return r}function i(e){if("object"==typeof e&&!Array.isArray(e)&&null!==e)return r.some(e)}function u(r){if(Array.isArray(r))return r}function a(r){if("boolean"==typeof r)return r}function s(r){if(null===r)return null}var f=function(r){for(var e=[r],n=[{kind:0,i:0,parent:e}];0!==n.length;){var t=n[n.length-1];0===t.kind?(t.val=t.parent[t.i],++t.i===t.parent.length&&n.pop()):n.pop();var o=t.val;if("object"==typeof o)if(Array.isArray(o)&&0!==o.length)n.push({kind:0,i:0,parent:o,val:void 0});else for(var i in o)"RE_PRIVATE_NONE"!==i?n.push({kind:1,i:i,parent:o,val:o[i]}):0===t.kind?t.parent[t.i-1]=void 0:t.parent[t.i]=void 0}return e[0]};function p(r){return function(r){var e=JSON.stringify(r,function(r,e){return void 0===e?{RE_PRIVATE_NONE:!0}:e});if(void 0===e)throw new TypeError("output is undefined");return e}(r)}function c(r){return f(JSON.parse(r))}exports.classify=e,exports.test=n,exports.decodeString=t,exports.decodeNumber=o,exports.decodeObject=i,exports.decodeArray=u,exports.decodeBoolean=a,exports.decodeNull=s,exports.deserializeUnsafe=c,exports.serializeExn=p; },{"./caml_option.js":"dzFO"}],"FisO":[function(require,module,exports) { "use strict";function r(r,t){return r===t}var t=2147483647,e=-2147483648;exports.equal=r,exports.max=t,exports.min=e; },{}],"MeLz":[function(require,module,exports) { "use strict";var r=require("./js_int.js");function t(r){return Math.ceil(r)}function n(t){return t>r.max?r.max:tr.max?r.max:t=0&&n=0&&n=0&&n=0&&n=0;--f)e[f+t|0]=r[f+n|0]}function j(n,e,t,o,u){var f=n.length,i=t.length,a=e<0?r.caml_int_max(f+e|0,0):e,c=o<0?r.caml_int_max(i+o|0,0):o,s=r.caml_int_min(u,r.caml_int_min(f-a|0,i-c|0));if(c<=a)for(var p=0;p=0;--l)t[l+c|0]=n[l+a|0]}function q(r,n){for(var e=0,t=r.length;e=0;--o)t=e(t,r[o]);return t}function Y(r,e,t){return V(r,e,n.__2(t))}function Z(n,e,t,o){for(var u=t,f=r.caml_int_min(n.length,e.length)-1|0;f>=0;--f)u=o(u,n[f],e[f]);return u}function $(r,e,t,o){return Z(r,e,t,n.__3(o))}function rr(r,n,e){for(var t=n,o=0,u=r.length;oo)return 1;if(t=n)return f;var a=r[f];if(!i(a,u))return f;e=f+1|0,t=a}}function f(r,t){var e=r.length;if(0===e||1===e)return e;var n=r[0],f=r[1];if(!t(n,f))return t(f,n)?0|-i(r,f,2,e,t):1;for(var u=f,a=2;;){var o=a,s=u;if(o>=e)return o;var v=r[o];if(!t(s,v))return o;a=o+1|0,u=v}}function u(r,t){return f(r,e.__2(t))}function a(r,t){var e=r.length;if(0===e)return!0;for(var n=0,i=e-1|0;;){var f=n;if(f===i)return!0;if(t(r[f],r[f+1|0])>0)return!1;n=f+1|0}}function o(r,t){return a(r,e.__2(t))}function s(r,t,e,i,f,u,a,o,s){for(var v=t+e|0,c=f+u|0,l=t,p=r[t],x=f,_=i[f],U=o;;){var b=U,y=_,S=x,h=p,g=l;if(s(h,y)<=0){a[b]=h;var d=g+1|0;if(d>=v)return n.blitUnsafe(i,S,a,b+1|0,c-S|0);U=b+1|0,p=r[d],l=d}else{a[b]=y;var B=S+1|0;if(B>=c)return n.blitUnsafe(r,g,a,b+1|0,v-g|0);U=b+1|0,_=i[B],x=B}}}function v(r,t,e,i,f,u,a,o,s){for(var v=t+e|0,c=f+u|0,l=t,p=r[t],x=f,_=i[f],U=o;;){var b=U,y=_,S=x,h=p,g=l,d=s(h,y);if(d<0){a[b]=h;var B=g+1|0,I=b+1|0;if(B=s)return U;l=r[g],c=g}else if(0!==h){var d=b+1|0;if(d>=v)return U;x=n[d],p=d}else{u[U]=y;var B=S+1|0,I=b+1|0,j=U+1|0;if(!(B=v)return d;U=d,p=r[B],l=B}else if(0!==g){var I=y+1|0;if(!(I=n&&f(e[o],a)>0;)e[o+1|0]=e[o],o=o-1|0;e[o+1|0]=a}}function b(r,t,e,n,i,f){if(i<=5)return U(r,t,e,n,i,f);var u=i/2|0,a=i-u|0;return b(r,t+u|0,e,n+u|0,a,f),b(r,t,r,t+a|0,u,f),s(r,t+a|0,u,e,n+u|0,a,e,n,f)}function y(r,t){var e=r.length;if(e<=5)return U(r,0,r,0,e,t);var n=e/2|0,i=e-n|0,f=new Array(i);return b(r,n,f,0,i,t),b(r,0,r,i,n,t),s(r,i,n,f,0,i,r,0,t)}function S(r,t){return y(r,e.__2(t))}function h(r,t){var e=r.slice(0);return y(e,t),e}function g(r,t){return h(r,e.__2(t))}function d(r,t,e){var n=r.length;if(0===n)return-1;if(e(t,r[0])<0)return-1;if(e(t,r[n-1|0])>0)return 0|-(n+1|0);for(var i=0,f=n-1|0;;){var u=f,a=i,o=(a+u|0)/2|0,s=e(t,r[o]);if(0===s)return o;if(s<0){if(u===o)return 0===e(r[a],t)?a:0|-(u+1|0);f=o}else{if(a===o)return 0===e(r[u],t)?u:0|-(u+1|0);i=o}}}function B(r,t,n){return d(r,t,e.__2(n))}exports.Int=r,exports.$$String=t,exports.strictlySortedLengthU=f,exports.strictlySortedLength=u,exports.isSortedU=a,exports.isSorted=o,exports.stableSortInPlaceByU=y,exports.stableSortInPlaceBy=S,exports.stableSortByU=h,exports.stableSortBy=g,exports.binarySearchByU=d,exports.binarySearchBy=B,exports.unionU=v,exports.union=c,exports.intersectU=l,exports.intersect=p,exports.diffU=x,exports.diff=_; },{"./curry.js":"NSLD","./belt_Array.js":"yUxI"}],"H9fU":[function(require,module,exports) { "use strict";var r=require("./curry.js"),t=require("./belt_Array.js"),n=require("./caml_option.js"),e=require("./belt_SortArray.js");function o(r){if(r)return n.some(r.hd)}function u(r){if(r)return r.hd;throw{RE_EXN_ID:"Not_found",Error:new Error}}function f(r){if(r)return r.tl}function i(r){if(r)return r.tl;throw{RE_EXN_ID:"Not_found",Error:new Error}}function l(r,t){return{hd:t,tl:r}}function a(r,t){if(!(t<0))for(var e=r,o=t;;){var u=o,f=e;if(!f)return;if(0===u)return n.some(f.hd);o=u-1|0,e=f.tl}}function d(r,t){if(t<0)throw{RE_EXN_ID:"Not_found",Error:new Error};for(var n=r,e=t;;){var o=e,u=n;if(!u)throw{RE_EXN_ID:"Not_found",Error:new Error};if(0===o)return u.hd;e=o-1|0,n=u.tl}}function h(r,t,n,e){for(;;){var o=e,u=n,f=t;if(!f)return;var i=f.tl,l=f.hd,a={hd:l,tl:0};r(l)?(u.tl=a,n=a,t=i):(o.tl=a,e=a,t=i)}}function s(r,t,n){for(;;){var e=n,o=t,u=r;if(!u)return;var f=u.hd,i={hd:f[0],tl:0},l={hd:f[1],tl:0};o.tl=i,e.tl=l,n=l,t=i,r=u.tl}}function c(r,t){for(;;){var n=t,e=r;if(!e)return n;var o={hd:e.hd,tl:0};n.tl=o,t=o,r=e.tl}}function v(r,t,n){for(;;){var e=n,o=t;if(!o)return;var u=o.tl,f=o.hd;if(r(f)){var i={hd:f,tl:0};e.tl=i,n=i,t=u}else t=u}}function p(r,t,n,e){for(;;){var o=e,u=n,f=t;if(!f)return;var i=f.tl,l=f.hd;if(r(l,o)){var a={hd:l,tl:0};u.tl=a,e=o+1|0,n=a,t=i}else e=o+1|0,t=i}}function x(r,t,e){for(;;){var o=e,u=t;if(!u)return;var f=u.tl,i=r(u.hd);if(void 0===i)t=f;else{var l={hd:n.valFromOption(i),tl:0};o.tl=l,e=l,t=f}}}function _(r,t,n,e){for(;;){var o=n,u=r;if(!u)return!1;var f=u.tl,i=u.hd;if(e(i[0],t))return o.tl=f,!0;var l={hd:i,tl:0};o.tl=l,n=l,r=f}}function U(r,t,n,e,o){for(;;){var u=e,f=r;if(!f)return!1;var i=f.tl,l=f.hd;if(o(l[0],t))return u.tl={hd:[t,n],tl:i},!0;var a={hd:l,tl:0};u.tl=a,e=a,r=i}}function m(r,t,n){for(;;){var e=t,o=r;if(!o)return;var u={hd:n(o.hd),tl:0};e.tl=u,t=u,r=o.tl}}function E(r,t,n){for(;;){var e=n,o=t,u=r;if(!u)return;if(!o)return;var f={hd:[u.hd,o.hd],tl:0};e.tl=f,n=f,t=o.tl,r=u.tl}}function y(r,t,n,e){for(;;){var o=e,u=n,f=t;if(!f)return;if(!u)return;var i={hd:r(f.hd,u.hd),tl:0};o.tl=i,e=i,n=u.tl,t=f.tl}}function I(r,t,n,e){for(;;){var o=e,u=n,f=t;if(!u)return;var i={hd:r(f,u.hd),tl:0};o.tl=i,e=i,n=u.tl,t=f+1|0}}function A(r,t,n){for(;;){var e=n,o=t,u=r;if(0===u)return!0;if(!o)return!1;var f={hd:o.hd,tl:0};e.tl=f,n=f,t=o.tl,r=u-1|0}}function R(r,t,n){for(;;){var e=n,o=t,u=r;if(0===u)return o;if(!o)return;var f={hd:o.hd,tl:0};e.tl=f,n=f,t=o.tl,r=u-1|0}}function g(r,t){if(!(t<0)){if(0===t)return 0;if(r){var n={hd:r.hd,tl:0};return A(t-1|0,r.tl,n)?n:void 0}}}function k(r,t){if(!(t<0))for(var n=r,e=t;;){if(0===e)return n;if(!n)return;e=e-1|0,n=n.tl}}function w(r,t){if(!(t<0)){if(0===t)return[0,r];if(r){var n={hd:r.hd,tl:0},e=R(t-1|0,r.tl,n);return void 0!==e?[n,e]:void 0}}}function W(r,t){if(!r)return t;var n={hd:r.hd,tl:0};return c(r.tl,n).tl=t,n}function B(r,t){if(!r)return 0;var n={hd:t(r.hd),tl:0};return m(r.tl,n,t),n}function N(t,n){return B(t,r.__1(n))}function q(r,t,n){if(!r)return 0;if(!t)return 0;var e={hd:n(r.hd,t.hd),tl:0};return y(n,r.tl,t.tl,e),e}function z(t,n,e){return q(t,n,r.__2(e))}function j(r,t){if(!r)return 0;var n={hd:t(0,r.hd),tl:0};return I(t,1,r.tl,n),n}function D(t,n){return j(t,r.__2(n))}function X(r,t){if(r<=0)return 0;for(var n={hd:t(0),tl:0},e=n,o=1;o=0;--o)e=W(r[o],e);return e}function Q(r,t){for(var n=0,e=r;;){var o=e,u=n;if(!o)return u;e=o.tl,n={hd:t(o.hd),tl:u}}}function T(t,n){return Q(t,r.__1(n))}function V(r,t){for(;;){var n=r;if(!n)return;t(n.hd),r=n.tl}}function Y(t,n){return V(t,r.__1(n))}function Z(r,t){for(var n=r,e=0;;){var o=e,u=n;if(!u)return;t(o,u.hd),e=o+1|0,n=u.tl}}function $(t,n){return Z(t,r.__2(n))}function rr(r,t,n){for(;;){var e=r;if(!e)return t;t=n(t,e.hd),r=e.tl}}function tr(t,n,e){return rr(t,n,r.__2(e))}function nr(r,t,n){return r?n(nr(r.tl,t,n),r.hd):t}function er(r,n,e){return F(r)<1e3?nr(r,n,e):t.reduceReverseU(S(r),n,e)}function or(t,n,e){return er(t,n,r.__2(e))}function ur(r,t,n){for(var e=r,o=t,u=0;;){var f=u,i=e;if(!i)return o;u=f+1|0,o=n(o,i.hd,f),e=i.tl}}function fr(t,n,e){return ur(t,n,r.__3(e))}function ir(r,t,n){for(var e=r,o=t,u=0;;){var f=u,i=o,l=e;if(!l)return f;if(!i)return f;u={hd:n(l.hd,i.hd),tl:f},o=i.tl,e=l.tl}}function lr(t,n,e){return ir(t,n,r.__2(e))}function ar(r,t,n){for(;;){var e=t,o=r;if(!o)return;if(!e)return;n(o.hd,e.hd),t=e.tl,r=o.tl}}function dr(t,n,e){return ar(t,n,r.__2(e))}function hr(r,t,n,e){for(;;){var o=t,u=r;if(!u)return n;if(!o)return n;n=e(n,u.hd,o.hd),t=o.tl,r=u.tl}}function sr(t,n,e,o){return hr(t,n,e,r.__3(o))}function cr(r,t,n,e){return r&&t?e(cr(r.tl,t.tl,n,e),r.hd,t.hd):n}function vr(r,n,e,o){return F(r)<1e3?cr(r,n,e,o):t.reduceReverse2U(S(r),S(n),e,o)}function pr(t,n,e,o){return vr(t,n,e,r.__3(o))}function xr(r,t){for(;;){var n=r;if(!n)return!0;if(!t(n.hd))return!1;r=n.tl}}function _r(t,n){return xr(t,r.__1(n))}function Ur(r,t){for(;;){var n=r;if(!n)return!1;if(t(n.hd))return!0;r=n.tl}}function mr(t,n){return Ur(t,r.__1(n))}function Er(r,t,n){for(;;){var e=t,o=r;if(!o)return!0;if(!e)return!0;if(!n(o.hd,e.hd))return!1;t=e.tl,r=o.tl}}function yr(t,n,e){return Er(t,n,r.__2(e))}function Ir(r,t){for(;;){var n=r;if(!n)return t?-1:0;if(!t)return 1;t=t.tl,r=n.tl}}function Ar(r,t,n){for(;;){var e=t,o=r;if(!o)return e?-1:0;if(!e)return 1;var u=n(o.hd,e.hd);if(0!==u)return u;t=e.tl,r=o.tl}}function Rr(t,n,e){return Ar(t,n,r.__2(e))}function gr(r,t,n){for(;;){var e=t,o=r;if(!o)return!e;if(!e)return!1;if(!n(o.hd,e.hd))return!1;t=e.tl,r=o.tl}}function kr(t,n,e){return gr(t,n,r.__2(e))}function wr(r,t,n){for(;;){var e=t,o=r;if(!o)return!1;if(!e)return!1;if(n(o.hd,e.hd))return!0;t=e.tl,r=o.tl}}function Wr(t,n,e){return wr(t,n,r.__2(e))}function Br(r,t,n){for(;;){var e=r;if(!e)return!1;if(n(e.hd,t))return!0;r=e.tl}}function Nr(t,n,e){return Br(t,n,r.__2(e))}function qr(r,t,e){for(;;){var o=r;if(!o)return;var u=o.hd;if(e(u[0],t))return n.some(u[1]);r=o.tl}}function zr(t,n,e){return qr(t,n,r.__2(e))}function jr(r,t,n){for(;;){var e=r;if(!e)return!1;if(n(e.hd[0],t))return!0;r=e.tl}}function Dr(t,n,e){return jr(t,n,r.__2(e))}function Xr(r,t,n){if(!r)return 0;var e=r.tl,o=r.hd;if(n(o[0],t))return e;var u={hd:o,tl:0};return _(e,t,u,n)?u:r}function br(t,n,e){return Xr(t,n,r.__2(e))}function Mr(r,t,n,e){if(!r)return{hd:[t,n],tl:0};var o=r.tl,u=r.hd;if(e(u[0],t))return{hd:[t,n],tl:o};var f={hd:u,tl:0};return U(o,t,n,f,e)?f:{hd:[t,n],tl:r}}function Fr(t,n,e,o){return Mr(t,n,e,r.__2(o))}function Or(r,t){var n=S(r);return e.stableSortInPlaceByU(n,t),P(n)}function Pr(t,n){return Or(t,r.__2(n))}function Sr(r,t){for(;;){var e=r;if(!e)return;var o=e.hd;if(t(o))return n.some(o);r=e.tl}}function Cr(t,n){return Sr(t,r.__1(n))}function Lr(r,t){for(;;){var n=r;if(!n)return 0;var e=n.tl,o=n.hd;if(t(o)){var u={hd:o,tl:0};return v(t,e,u),u}r=e}}function Gr(t,n){return Lr(t,r.__1(n))}function Hr(r,t){for(var n=r,e=0;;){var o=e,u=n;if(!u)return 0;var f=u.tl,i=u.hd;if(t(i,o)){var l={hd:i,tl:0};return p(t,f,l,o+1|0),l}e=o+1|0,n=f}}function Jr(t,n){return Hr(t,r.__2(n))}function Kr(r,t){for(;;){var e=r;if(!e)return 0;var o=e.tl,u=t(e.hd);if(void 0!==u){var f={hd:n.valFromOption(u),tl:0};return x(t,o,f),f}r=o}}function Qr(t,n){return Kr(t,r.__1(n))}function Tr(r,t){if(!r)return[0,0];var n=r.hd,e={hd:n,tl:0},o={hd:n,tl:0},u=t(n);return h(t,r.tl,e,o),u?[e,o.tl]:[e.tl,o]}function Vr(t,n){return Tr(t,r.__1(n))}function Yr(r){if(!r)return[0,0];var t=r.hd,n={hd:t[0],tl:0},e={hd:t[1],tl:0};return s(r.tl,n,e),[n,e]}function Zr(r,t){if(!r)return 0;if(!t)return 0;var n={hd:[r.hd,t.hd],tl:0};return E(r.tl,t.tl,n),n}var $r=F,rt=Gr,tt=Jr;exports.length=F,exports.size=$r,exports.head=o,exports.headExn=u,exports.tail=f,exports.tailExn=i,exports.add=l,exports.get=a,exports.getExn=d,exports.make=M,exports.makeByU=X,exports.makeBy=b,exports.shuffle=C,exports.drop=k,exports.take=g,exports.splitAt=w,exports.concat=W,exports.concatMany=K,exports.reverseConcat=L,exports.flatten=J,exports.mapU=B,exports.map=N,exports.zip=Zr,exports.zipByU=q,exports.zipBy=z,exports.mapWithIndexU=j,exports.mapWithIndex=D,exports.fromArray=P,exports.toArray=S,exports.reverse=G,exports.mapReverseU=Q,exports.mapReverse=T,exports.forEachU=V,exports.forEach=Y,exports.forEachWithIndexU=Z,exports.forEachWithIndex=$,exports.reduceU=rr,exports.reduce=tr,exports.reduceWithIndexU=ur,exports.reduceWithIndex=fr,exports.reduceReverseU=er,exports.reduceReverse=or,exports.mapReverse2U=ir,exports.mapReverse2=lr,exports.forEach2U=ar,exports.forEach2=dr,exports.reduce2U=hr,exports.reduce2=sr,exports.reduceReverse2U=vr,exports.reduceReverse2=pr,exports.everyU=xr,exports.every=_r,exports.someU=Ur,exports.some=mr,exports.every2U=Er,exports.every2=yr,exports.some2U=wr,exports.some2=Wr,exports.cmpByLength=Ir,exports.cmpU=Ar,exports.cmp=Rr,exports.eqU=gr,exports.eq=kr,exports.hasU=Br,exports.has=Nr,exports.getByU=Sr,exports.getBy=Cr,exports.keepU=Lr,exports.keep=Gr,exports.filter=rt,exports.keepWithIndexU=Hr,exports.keepWithIndex=Jr,exports.filterWithIndex=tt,exports.keepMapU=Kr,exports.keepMap=Qr,exports.partitionU=Tr,exports.partition=Vr,exports.unzip=Yr,exports.getAssocU=qr,exports.getAssoc=zr,exports.hasAssocU=jr,exports.hasAssoc=Dr,exports.removeAssocU=Xr,exports.removeAssoc=br,exports.setAssocU=Mr,exports.setAssoc=Fr,exports.sortU=Or,exports.sort=Pr; },{"./curry.js":"NSLD","./belt_Array.js":"yUxI","./caml_option.js":"dzFO","./belt_SortArray.js":"mJOW"}],"tKwj":[function(require,module,exports) { "use strict";var r=require("./curry.js");function t(r){if(0===r.TAG)return r._0;throw{RE_EXN_ID:"Not_found",Error:new Error}}function n(r,t,n){return 0===r.TAG?n(r._0):t}function e(t,e,u){return n(t,e,r.__1(u))}function u(r,t){return 0===r.TAG?{TAG:0,_0:t(r._0)}:{TAG:1,_0:r._0}}function o(t,n){return u(t,r.__1(n))}function _(r,t){return 0===r.TAG?t(r._0):{TAG:1,_0:r._0}}function i(t,n){return _(t,r.__1(n))}function p(r,t){return 0===r.TAG?r._0:t}function f(r){return 0===r.TAG}function s(r){return 0!==r.TAG}function c(r,t,n){return 0===r.TAG?0===t.TAG&&n(r._0,t._0):0!==t.TAG}function A(t,n,e){return c(t,n,r.__2(e))}function G(r,t,n){return 0===r.TAG?0===t.TAG?n(r._0,t._0):1:0===t.TAG?-1:0}function T(t,n,e){return G(t,n,r.__2(e))}exports.getExn=t,exports.mapWithDefaultU=n,exports.mapWithDefault=e,exports.mapU=u,exports.map=o,exports.flatMapU=_,exports.flatMap=i,exports.getWithDefault=p,exports.isOk=f,exports.isError=s,exports.eqU=c,exports.eq=A,exports.cmpU=G,exports.cmp=T; },{"./curry.js":"NSLD"}],"ApXr":[function(require,module,exports) { "use strict";var r=require("./curry.js"),t=require("./caml_option.js"),n=require("./belt_SortArray.js");function e(r){return void 0!==r?r.h:0}function o(r){return void 0!==r?{k:r.k,v:r.v,h:r.h,l:o(r.l),r:o(r.r)}:r}function i(r,t,n,o){var i=e(r),u=e(o);return{k:t,v:n,h:i>=u?i+1|0:u+1|0,l:r,r:o}}function u(r,t){return{k:r,v:t,h:1,l:void 0,r:void 0}}function v(r,t){return void 0===t||void 0!==r&&r.h>=t.h}function f(r,t){return r.v===t?r:{k:r.k,v:t,h:r.h,l:r.l,r:r.r}}function a(r,t,n,o){var u=void 0!==r?r.h:0,v=void 0!==o?o.h:0;if(u>(v+2|0)){var f=r.l,a=r.r;return e(f)>=e(a)?i(f,r.k,r.v,i(a,t,n,o)):i(i(f,r.k,r.v,a.l),a.k,a.v,i(a.r,t,n,o))}if(v<=(u+2|0))return{k:t,v:n,h:u>=v?u+1|0:v+1|0,l:r,r:o};var c=o.l,s=o.r;return e(s)>=e(c)?i(i(r,t,n,c),o.k,o.v,s):i(i(r,t,n,c.l),c.k,c.v,i(c.r,o.k,o.v,s))}function c(r){for(;;){var t=r,n=t.l;if(void 0===n)return t.k;r=n}}function s(r){if(void 0!==r)return t.some(c(r))}function d(r){if(void 0!==r)return c(r)}function l(r){for(;;){var t=r,n=t.r;if(void 0===n)return t.k;r=n}}function p(r){if(void 0!==r)return t.some(l(r))}function x(r){if(void 0!==r)return l(r)}function k(r){for(;;){var t=r,n=t.l;if(void 0===n)return[t.k,t.v];r=n}}function h(r){if(void 0!==r)return k(r)}function m(r){if(void 0!==r)return k(r)}function _(r){for(;;){var t=r,n=t.r;if(void 0===n)return[t.k,t.v];r=n}}function y(r){if(void 0!==r)return _(r)}function A(r){if(void 0!==r)return _(r)}function U(r,t,n){var e=r.l;return void 0!==e?a(U(e,t,n),r.k,r.v,r.r):(t.contents=r.k,n.contents=r.v,r.r)}function E(r){return void 0===r}function g(r,t){for(;;){if(void 0===r)return t;t={hd:r,tl:t},r=r.l}}function w(r,t){if(void 0!==r){var n=w(r.l,t);if(void 0!==n)return n;var e=r.k,o=r.v;if(t(e,o))return[e,o];var i=w(r.r,t);return void 0!==i?i:void 0}}function S(t,n){return w(t,r.__2(n))}function M(r,t){for(;;){var n=r;if(void 0===n)return;M(n.l,t),t(n.k,n.v),r=n.r}}function K(t,n){return M(t,r.__2(n))}function q(r,t){if(void 0!==r){var n=q(r.l,t),e=t(r.v),o=q(r.r,t);return{k:r.k,v:e,h:r.h,l:n,r:o}}}function R(t,n){return q(t,r.__1(n))}function W(r,t){if(void 0!==r){var n=r.k,e=W(r.l,t),o=t(n,r.v),i=W(r.r,t);return{k:n,v:o,h:r.h,l:e,r:i}}}function b(t,n){return W(t,r.__2(n))}function j(r,t,n){for(;;){var e=t,o=r;if(void 0===o)return e;var i=o.k,u=o.v,v=o.l,f=o.r;t=n(j(v,e,n),i,u),r=f}}function F(t,n,e){return j(t,n,r.__3(e))}function I(r,t){for(;;){var n=r;if(void 0===n)return!0;if(!t(n.k,n.v))return!1;if(!I(n.l,t))return!1;r=n.r}}function L(t,n){return I(t,r.__2(n))}function N(r,t){for(;;){var n=r;if(void 0===n)return!1;if(t(n.k,n.v))return!0;if(N(n.l,t))return!0;r=n.r}}function D(t,n){return N(t,r.__2(n))}function O(r,t,n){return void 0!==r?a(O(r.l,t,n),r.k,r.v,r.r):u(t,n)}function B(r,t,n){return void 0!==r?a(r.l,r.k,r.v,B(r.r,t,n)):u(t,n)}function T(r,t,n,e){if(void 0===r)return O(e,t,n);if(void 0===e)return B(r,t,n);var o=r.k,u=r.v,v=r.h,f=r.l,c=r.r,s=e.k,d=e.v,l=e.h,p=e.l,x=e.r;return v>(l+2|0)?a(f,o,u,T(c,t,n,e)):l>(v+2|0)?a(T(r,t,n,p),s,d,x):i(r,t,n,e)}function V(r,t){if(void 0===r)return t;if(void 0===t)return r;var n={contents:t.k},e={contents:t.v},o=U(t,n,e);return T(r,n.contents,e.contents,o)}function X(r,n,e,o){return void 0!==e?T(r,n,t.valFromOption(e),o):V(r,o)}function z(r,t){if(void 0!==r){var n=r.k,e=r.v,o=z(r.l,t),i=t(n,e),u=z(r.r,t);return i?T(o,n,e,u):V(o,u)}}function J(t,n){return z(t,r.__2(n))}function C(r,n){if(void 0!==r){var e=r.k,o=r.v,i=C(r.l,n),u=n(e,o),v=C(r.r,n);return void 0!==u?T(i,e,t.valFromOption(u),v):V(i,v)}}function G(t,n){return C(t,r.__2(n))}function H(r,t){if(void 0===r)return[void 0,void 0];var n=r.k,e=r.v,o=H(r.l,t),i=o[1],u=o[0],v=t(n,e),f=H(r.r,t),a=f[1],c=f[0];return v?[T(u,n,e,c),V(i,a)]:[V(u,c),T(i,n,e,a)]}function P(t,n){return H(t,r.__2(n))}function Q(r){var t=r.l,n=r.r;return(1+(void 0!==t?Q(t):0)|0)+(void 0!==n?Q(n):0)|0}function Y(r){return void 0!==r?Q(r):0}function Z(r,t){for(;;){var n=t,e=r;if(void 0===e)return n;var o=e.k,i=e.v,u=e.l;t={hd:[o,i],tl:Z(e.r,n)},r=u}}function $(r){return Z(r,0)}function rr(r){for(;;){var t=r;if(void 0===t)return;var n=t.l,o=t.r,i=e(n)-e(o)|0;if(!(i<=2&&i>=-2))throw{RE_EXN_ID:"Assert_failure",_1:["belt_internalAVLtree.ml",373,4],Error:new Error};rr(n),r=o}}function tr(r,t,n){for(;;){var e=t,o=r,i=o.k,u=o.l,v=o.r,f=void 0!==u?tr(u,e,n):e;n[f]=i;var a=f+1|0;if(void 0===v)return a;t=a,r=v}}function nr(r,t,n){for(;;){var e=t,o=r,i=o.l,u=o.r,v=void 0!==i?nr(i,e,n):e;n[v]=o.v;var f=v+1|0;if(void 0===u)return f;t=f,r=u}}function er(r,t,n){for(;;){var e=t,o=r,i=o.l,u=o.k,v=o.r,f=void 0!==i?er(i,e,n):e;n[f]=[u,o.v];var a=f+1|0;if(void 0===v)return a;t=a,r=v}}function or(r){if(void 0===r)return[];var t=Q(r),n=new Array(t);return er(r,0,n),n}function ir(r){if(void 0===r)return[];var t=Q(r),n=new Array(t);return tr(r,0,n),n}function ur(r){if(void 0===r)return[];var t=Q(r),n=new Array(t);return nr(r,0,n),n}function vr(r,t,n){switch(n){case 0:return;case 1:var e=r[t];return u(e[0],e[1]);case 2:var o=r[t],v=r[t-1|0],f=o;return{k:v[0],v:v[1],h:2,l:u(f[0],f[1]),r:void 0};case 3:var a=r[t],c=r[t-1|0],s=r[t-2|0],d=c,l=a;return{k:d[0],v:d[1],h:2,l:u(l[0],l[1]),r:u(s[0],s[1])};default:var p=n/2|0,x=vr(r,t,p),k=r[t-p|0],h=vr(r,(t-p|0)-1|0,(n-p|0)-1|0);return i(x,k[0],k[1],h)}}function fr(r,t,n){switch(n){case 0:return;case 1:var e=r[t];return u(e[0],e[1]);case 2:var o=r[t],v=r[t+1|0],f=o;return{k:v[0],v:v[1],h:2,l:u(f[0],f[1]),r:void 0};case 3:var a=r[t],c=r[t+1|0],s=r[t+2|0],d=c,l=a;return{k:d[0],v:d[1],h:2,l:u(l[0],l[1]),r:u(s[0],s[1])};default:var p=n/2|0,x=fr(r,t,p),k=r[t+p|0],h=fr(r,1+(t+p|0)|0,(n-p|0)-1|0);return i(x,k[0],k[1],h)}}function ar(r){return fr(r,0,r.length)}function cr(r,t,n,e){var o=Y(r),i=Y(t);if(o!==i)return oo?n:o)+1|0;var i=e(t.l),u=r.h;return t.h=(i>u?i:u)+1|0,t}function yr(r){var t=r.r;r.r=t.l,t.l=r;var n=e(r.l),o=e(r.r);r.h=(n>o?n:o)+1|0;var i=e(t.r),u=r.h;return t.h=(i>u?i:u)+1|0,t}function Ar(r){var t=yr(r.l);return r.l=t,_r(r)}function Ur(r){var t=_r(r.r);return r.r=t,yr(r)}function Er(r){var t=e(r.l),n=e(r.r);return r.h=(t>n?t:n)+1|0,r}function gr(r){var t=r.l,n=r.r,o=e(t),i=e(n);if(o>(2+i|0))return v(t.l,t.r)?Er(_r(r)):Er(Ar(r));if(i>(2+o|0)){var u=n.l;return v(n.r,u)?Er(yr(r)):Er(Ur(r))}return r.h=(o>i?o:i)+1|0,r}function wr(r,t,n,e){if(void 0===r)return u(t,n);var o=e(t,r.k);if(0===o)return r.v=n,r;var i=r.l,v=r.r;if(o<0){var f=wr(i,t,n,e);r.l=f}else r.r=wr(v,t,n,e);return gr(r)}function Sr(r,t){var e=r.length;if(0!==e){var o,i=n.strictlySortedLengthU(r,function(r,n){return t(r[0],n[0])<0});o=i>=0?fr(r,0,i):vr(r,(i=0|-i)-1|0,i);for(var u=i;u=n)return t;var i=o(t,r[u],a);if(void 0===i)return;e=u+1|0,t=i}}function d(t,r){var e=t.data;if(void 0!==e){var n=i(e,r,0,r.length,t.cmp);n===e||(t.data=n)}}function c(t,r,e,o){if(void 0!==t){var u=o(r,t.k);if(0===u){var i=e(n.some(t.v));if(void 0!==i)return t.v=n.valFromOption(i),t;var d=t.l,p=t.r;return void 0!==d?void 0!==p?(t.r=a.removeMinAuxWithRootMutate(t,p),a.balMutate(t)):d:void 0!==p?p:d}return u<0?t.l=c(t.l,r,e,o):t.r=c(t.r,r,e,o),a.balMutate(t)}var f=e(void 0);return void 0!==f?a.singleton(r,n.valFromOption(f)):t}function p(t,r,e){var n=t.data,a=c(n,r,e,t.cmp);a===n||(t.data=a)}function f(t,r,n){return p(t,r,e.__1(n))}function m(t){return{cmp:t.cmp,data:void 0}}function s(t){t.data=void 0}function x(t){return void 0===t.data}function v(t){return a.minKey(t.data)}function U(t){return a.minKeyUndefined(t.data)}function y(t){return a.maxKey(t.data)}function l(t){return a.maxKeyUndefined(t.data)}function _(t){return a.minimum(t.data)}function h(t){return a.minUndefined(t.data)}function g(t){return a.maximum(t.data)}function M(t){return a.maxUndefined(t.data)}function A(t,r){return a.forEachU(t.data,r)}function K(t,r){return a.forEachU(t.data,e.__2(r))}function k(t,r,e){return a.reduceU(t.data,r,e)}function E(t,r,n){return k(t,r,e.__3(n))}function W(t,r){return a.everyU(t.data,r)}function b(t,r){return a.everyU(t.data,e.__2(r))}function q(t,r){return a.someU(t.data,r)}function I(t,r){return a.someU(t.data,e.__2(r))}function T(t){return a.size(t.data)}function j(t){return a.toList(t.data)}function L(t){return a.toArray(t.data)}function z(t){return a.keysToArray(t.data)}function D(t){return a.valuesToArray(t.data)}function F(t){return a.checkInvariantInternal(t.data)}function O(t,r,e){return a.cmpU(t.data,r.data,t.cmp,e)}function R(t,r,n){return O(t,r,e.__2(n))}function $(t,r,e){return a.eqU(t.data,r.data,t.cmp,e)}function S(t,r,n){return $(t,r,e.__2(n))}function V(t,r){return{cmp:t.cmp,data:a.mapU(t.data,r)}}function w(t,r){return V(t,e.__1(r))}function B(t,r){return{cmp:t.cmp,data:a.mapWithKeyU(t.data,r)}}function C(t,r){return B(t,e.__2(r))}function G(t,r){return a.get(t.data,r,t.cmp)}function H(t,r){return a.getUndefined(t.data,r,t.cmp)}function J(t,r,e){return a.getWithDefault(t.data,r,e,t.cmp)}function N(t,r){return a.getExn(t.data,r,t.cmp)}function P(t,r){return a.has(t.data,r,t.cmp)}function Q(t,r){var e=r.cmp;return{cmp:e,data:a.fromArray(t,e)}}function X(t,r,e){var n=t.data,o=a.updateMutate(n,r,e,t.cmp);o===n||(t.data=o)}function Y(t,r,e){for(var n=t,o=0,u=r.length;oo?(t._1(e,void 0),r.contents=Date.now()):i.contents=n.some(setTimeout(function(n){t._1(e,void 0),r.contents=Date.now()},p))}}}var d=o,l=i;exports.always=e,exports.compose=o,exports.pipe=i,exports.false_=r,exports.true_=s,exports.flip=c,exports.identity=u,exports.Infix=p,exports.$less$pipe$pipe=d,exports.$pipe$pipe$great=l,exports.delay=v,exports.debounce=a,exports.throttle=f; },{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_option.js":"dzFO"}],"tIKZ":[function(require,module,exports) { "use strict";function e(e){return{apply:e.apply,pure:e.pure,alt:e.alt,empty:e.empty,$less$star$great:e.apply,$less$pipe$great:e.alt}}exports.MakeBasic=e; },{}],"Ddhm":[function(require,module,exports) { "use strict";var r=require("rescript/lib/js/curry.js"),t=require("rescript/lib/js/caml_option.js"),e=require("./Monad.bs.js"),o=require("./Function.bs.js"),n=require("./Alternative.bs.js");function i(r){return t.some(r)}function s(r){}function p(r){return void 0===r}function u(r){return void 0!==r}function a(r,e){return void 0!==e?t.valFromOption(e):r}function f(r){if(0===r.TAG)return t.some(r._0)}function l(r,e){if(void 0!==e)return t.valFromOption(e);throw{RE_EXN_ID:"Failure",_1:r,Error:new Error}}function $(r,t){return void 0!==r?r:t}function v(e){try{return t.some(r._1(e,void 0))}catch(o){return}}function c(e,o){if(void 0!==e)return r._1(o,t.valFromOption(e))}var x=e.MakeBasic({bind:c,$$return:i,fmap:"DefineWithBind"}),d=x.bind,m=x.$$return,_=x.$great$great$eq,F=x.$less$$great;function g(t,e){if(void 0!==t)return r._2(d,e,function(e){return r._1(m,r._1(t,e))})}function O(r,t){return void 0!==r?r:t}function q(r){}var y=n.MakeBasic({alt:O,empty:q,apply:g,pure:i}),b=y.alt;function j(r,t){return o.flip(F,r,t)}function h(e,o){if(void 0!==o)return r._1(e,t.valFromOption(o))}function E(e,o,n){return void 0!==n?r._2(e,o,t.valFromOption(n)):o}function M(e,o){if(void 0!==o&&r._1(e,t.valFromOption(o)))return o}function B(e,o){return void 0!==o&&r._1(e,t.valFromOption(o))}function k(r){if(void 0!==r)return t.valFromOption(r)}function w(r,t){return o.flip(_,r,t)}function A(e,o,n){return void 0!==o?void 0!==n?r._2(e,t.valFromOption(o),t.valFromOption(n)):1:void 0!==n?-1:0}function D(e,o,n){return void 0!==o?void 0!==n&&r._2(e,t.valFromOption(o),t.valFromOption(n)):void 0===n}function I(r){return void 0!==r?{hd:t.valFromOption(r),tl:0}:0}function L(r){if(r)return t.some(r.hd)}var N=x.fmap,R=y.$less$pipe$great,S=y.empty,W=y.apply,G=y.pure,T=y.$less$star$great,X={$great$great$eq:_,$less$$great:F,$less$star$great:T,$pipe$question:$,$less$pipe$great:b};exports.some=i,exports.none=s,exports.isNone=p,exports.isSome=u,exports.$$default=a,exports.default=a,exports.__esModule=!0,exports.ofResult=f,exports.toExn=l,exports.firstSome=$,exports.tryWith=v,exports.bind=d,exports.$great$great$eq=_,exports.$$return=m,exports.fmap=N,exports.$less$$great=F,exports.$less$pipe$great=R,exports.empty=S,exports.alt=b,exports.apply=W,exports.pure=G,exports.Infix=X,exports.map=j,exports.iter=h,exports.fold=E,exports.filter=M,exports.exists=B,exports.flatten=k,exports.flatMap=w,exports.compare=A,exports.equal=D,exports.toList=I,exports.ofList=L; },{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_option.js":"dzFO","./Monad.bs.js":"QyI5","./Function.bs.js":"JPps","./Alternative.bs.js":"tIKZ"}],"KUwe":[function(require,module,exports) { "use strict";var r=require("rescript/lib/js/list.js"),t=require("rescript/lib/js/curry.js"),n=require("rescript/lib/js/caml_obj.js"),e=require("rescript/lib/js/pervasives.js"),u=require("rescript/lib/js/caml_option.js"),i=require("./Util.bs.js"),o=require("./Option.bs.js"),f=require("./Function.bs.js");function s(t){var n;try{n=r.hd(t)}catch(e){return}return u.some(n)}function a(t){var n;try{n=r.tl(t)}catch(e){return}return n}function c(t,n){var e;try{e=r.nth(n,t)}catch(i){return}return u.some(e)}function l(n){return t._2(o.$less$$great,a(r.rev(n)),r.rev)}function p(t){return s(r.rev(t))}function v(n,e){return r.fold_left(function(r,e){return r||t._1(n,e)},!1,e)}function d(n,e){return r.fold_left(function(r,e){return r?t._1(n,e):r},!0,e)}function x(t,n){return r.append(n,{hd:t,tl:0})}function h(t,n){return r.append(n,t)}function _(r,t){for(var n=r,e=t,u=0;;){var i=u,o=e,f=n;if(f<=0)return i;if(!o)return i;u=x(o.hd,i),e=o.tl,n=f-1|0}}function $(t,n){return r.rev(_(t,r.rev(n)))}function g(r,n){for(var e=n,u=0;;){var i=u,o=e;if(!o)return i;var f=o.hd;if(!t._1(r,f))return i;u=x(f,i),e=o.tl}}function q(t,n){return r.rev(g(t,r.rev(n)))}function j(r,t){for(;;){var n=r;if(!t)return 0;if(n<=0)return t;t=t.tl,r=n-1|0}}function m(t,n){return _(r.length(n)-t|0,n)}function W(r,n){for(;;){var e=n;if(!e)return 0;if(!t._1(r,e.hd))return e;n=e.tl}}function y(t,n){return r.rev(W(t,r.rev(n)))}function b(n,e){for(var u=e,i=0;;){var f=i,a=u;if(!a)return f;var c=a.tl,l=a.hd;0!==r.length(f)?o.$$default(!1,t._2(o.$less$$great,s(r.rev(f)),t._1(n,l)))?u=c:(i=x(l,f),u=c):(i=x(l,f),u=c)}}function I(r){return b(n.caml_equal,r)}function L(t,n){return[_(t,n),$(r.length(n)-t|0,n)]}function O(n,e,u){var i=L(e+1|0,u),a=i[1],c=i[0];return e<0||e>=r.length(u)?u:c?c.tl?o.$$default(u,t._2(o.$less$$great,t._2(o.$great$great$eq,l(c),function(e){return t._2(o.$less$$great,t._2(o.$less$$great,s(r.rev(c)),n),function(r){return f.flip(x,e,r)})}),function(t){return r.append(t,a)})):{hd:t._1(n,c.hd),tl:a}:a}function k(t,n){for(var e=n,u=0;;){var i=u,o=e;if(!o)return i;if(r.length(o)r.length(c))return x(c,a);var p=L(l+1|0,c),v=p[1],d=p[0];o.$$default(!0,t._2(o.Infix.$less$star$great,t._2(o.Infix.$less$star$great,n,s(r.rev(d))),s(v)))?u=l+1|0:(f=x(d,a),i=v,u=0)}}function C(r,t){return B(function(t){return n.caml_equal(r,t)},t)}function D(t,n,e){var u=L(t,e);return r.append(x(n,u[0]),u[1])}function G(t,n,e){var u=L(t,e);return r.append(r.append(u[0],n),u[1])}function H(t,n){return r.fold_left(function(n,e){return r.length(n)>0?x(e,x(t,n)):{hd:e,tl:0}},0,n)}function J(t){return function(n){return r.fold_left(function(r,n){return 0===r.length?n:r+(t+n)},"",n)}}function K(t,n){var e=C(t,r.rev(n));if(void 0!==e)return(r.length(n)-e|0)-1|0}function M(t,n){return!r.exists(t,n)}function N(n,e){return[r.filter(n)(e),r.filter(function(r){return!t._1(n,r)})(e)]}function P(e,u,i){for(var o=0;;){var f=o,s=r.rev(f);if(s){var a=s.hd;if(n.caml_greaterthan(t._1(e,a),i))return f;o=x(t._1(e,a),f)}else o={hd:u,tl:0}}}function Q(r){return function(t,n){return P(function(t){return t+r|0},t,n)}}function S(r){return function(t,n){return P(function(t){return t+r},t,n)}}function T(n,e,u,i){return r.fold_left(function(r,u){if(!r[0])return r;var i=r[1];return t._2(n,i,u)?[!0,t._2(e,i,u)]:[!1,i]},[!0,u],i)[1]}function V(n){return r.filter(function(r){return!t._1(n,r)})}function X(r,t,n){var u=L(r,n);return e.$at(u[0],j(t,u[1]))}function Y(r,t){for(var n=t,e=0;;){var u=n;if(0===u)return e;e=x(r,e),n=u-1|0}}function Z(n,e){var u={hd:e,tl:0};return function(e){return r.fold_left(function(e,u){return o.$$default(0,t._2(o.$less$$great,t._2(o.$less$$great,s(r.rev(e)),function(r){return f.flip(n,u,r)}),function(r){return f.flip(x,e,r)}))},u,e)}}function rr(r,t,n){return L(t,L(r,n)[1])[0]}function tr(r,t){for(var n=t,e=0;;){var u=e,i=n;if(!i)return u;e=x(_(r,i),u),n=j(r,i)}}function nr(r,t){var n=B(r,t);return void 0!==n?L(n,t):[t,0]}function er(r,t){var e=s(t);return void 0!==e&&n.caml_equal(u.valFromOption(e),r)}function ur(r,n){for(var e=0,u=0;;){var i=u,o=e;if(o>=n)return i;u=x(t._1(r,o),i),e=o+1|0}}function ir(n,e,u){return r.fold_left(function(u,i){var o=u[1],f=u[0],s=t._1(n,t._1(e,i));return r.exists(s,o)?[f,o]:[x(i,f),x(t._1(e,i),o)]},[0,0],u)[0]}function or(r,t){return ir(i.eq,r,t)}function fr(r,t){return ir(r,f.identity,t)}function sr(r){return ir(i.eq,f.identity,r)}function ar(t,n,e){var u=r.append(n,e);return ir(t,f.identity,u)}function cr(t,n){var e=r.append(t,n);return ir(i.eq,f.identity,e)}function lr(r,t,n){return O(function(t){return f.always(r,t)},t,n)}function pr(n,e){var u=function(r){return w(r)(n)};return r.filter(function(r){return!t._1(u,r)})(e)}function vr(r,n,e){for(var u=n,i=e,o=0;;){var f=o,s=i,a=u;if(!a)return f;if(!s)return f;o=x(t._2(r,a.hd,s.hd),f),i=s.tl,u=a.tl}}function dr(n,e,u,i){for(;;){var o=i,f=e;if(!f)return o;var s=f.tl,a=f.hd,c=t._1(n,a);r.exists(c,u)?e=s:(i=x(a,o),e=s)}}function xr(r,t,n){return e.$at(dr(r,t,n,0),dr(r,n,t,0))}function hr(r,t){return xr(i.eq,r,t)}function _r(r,t){for(var n=r,e=0;;){var u=e,i=n;if(!i)return u;var o=i.tl,f=i.hd;w(f)(t)?(e=x(f,u),n=o):n=o}}function $r(r,t){for(var n=r,e=t,u=0;;){var i=u,o=e,f=n;if(!f)return i;if(!o)return i;u=x([f.hd,o.hd],i),e=o.tl,n=f.tl}}function gr(r,n,e){for(var u=0,i=n,o=e;;){var f=o,s=i,a=u;if(!f)return s;o=f.tl,i=t._3(r,s,a,f.hd),u=a+1|0}}function qr(r){return gr(function(r,t,n){return{hd:[t,n],tl:r}},0,r)}function jr(n,e,u){return r.fold_left(function(r,e){return t._3(n,r,e[0],e[1])},e,qr(u))}function mr(r,n){for(var e=n,u=0,i=0;;){var o=i,f=u,s=e;if(!s)return o;var a=s.tl,c=s.hd;t._2(r,f,c)?(i=x(c,o),u=f+1|0,e=a):(u=f+1|0,e=a)}}function Wr(n,e,u){return r.fold_left(function(r,u){return t._1(n,u)?x(t._1(e,u),r):r},0,u)}function yr(r,n,e){return gr(function(e,u,i){return t._2(r,u,i)?x(t._2(n,u,i),e):e},0,e)}function br(r){return{hd:r,tl:0}}function Ir(r,n){if(n<0)return 0;for(var e=n,u=0;;){var i=u,o=e;if(0===o)return i;u={hd:t._1(r,o-1|0),tl:i},e=o-1|0}}function Lr(t){return r.rev(function(r,t){for(;;){var n=t,e=r;if(!e)return n;var i=e.tl,o=e.hd;void 0===o?r=i:(t={hd:u.valFromOption(o),tl:n},r=i)}}(t,0))}function Or(t,n){if(n)return u.some(r.fold_left(t,n.hd,n.tl))}function kr(n,e,u){for(var i=0,o=e,f=u;;){var s=f,a=o,c=i;if(!a)return r.rev_append(c,s);if(!s)return r.rev_append(c,a);var l=s.hd,p=a.hd;t._2(n,p,l)<=0?(o=a.tl,i={hd:p,tl:c}):(f=s.tl,i={hd:l,tl:c})}}exports.head=s,exports.tail=a,exports.nth=c,exports.init=l,exports.last=p,exports.any=v,exports.all=d,exports.append=x,exports.concat=h,exports.take=_,exports.takeLast=$,exports.takeWhile=g,exports.takeLastWhile=q,exports.drop=j,exports.dropLast=m,exports.dropLastWhile=y,exports.dropRepeatsWith=b,exports.dropRepeats=I,exports.dropWhile=W,exports.splitAt=L,exports.adjust=O,exports.aperture=k,exports.containsWith=F,exports.contains=w,exports.endsWith=z,exports.find=A,exports.findIndex=B,exports.findLast=R,exports.findLastIndex=E,exports.groupWith=U,exports.indexOf=C,exports.insert=D,exports.insertAll=G,exports.intersperse=H,exports.join=J,exports.lastIndexOf=K,exports.none=M,exports.partition=N,exports.range=P,exports.rangeInt=Q,exports.rangeFloat=S,exports.reduceWhile=T,exports.reject=V,exports.remove=X,exports.repeat=Y,exports.scan=Z,exports.slice=rr,exports.splitEvery=tr,exports.splitWhen=nr,exports.startsWith=er,exports.times=ur,exports.uniqWithBy=ir,exports.uniqBy=or,exports.uniqWith=fr,exports.uniq=sr,exports.unionWith=ar,exports.union=cr,exports.update=lr,exports.without=pr,exports.zipWith=vr,exports.differenceWith=xr,exports.difference=hr,exports.intersection=_r,exports.zip=$r,exports.pure=br,exports.fold_lefti=gr,exports.fold_righti=jr,exports.filteri=mr,exports.filter_map=Wr,exports.filter_mapi=yr,exports.create=Ir,exports.filter_opt=Lr,exports.reduce=Or,exports.merge=kr; },{"rescript/lib/js/list.js":"aYjQ","rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_obj.js":"p3B5","rescript/lib/js/pervasives.js":"z22f","rescript/lib/js/caml_option.js":"dzFO","./Util.bs.js":"cfqr","./Option.bs.js":"Ddhm","./Function.bs.js":"JPps"}],"SRS9":[function(require,module,exports) { "use strict";var r=require("rescript/lib/js/curry.js"),e=require("rescript/lib/js/caml_option.js"),t=require("./Monad.bs.js");function n(r){return{TAG:1,_0:r}}function o(r){return 0===r.TAG}function s(r){if(0===r.TAG)return e.some(r._0)}function i(r){return 0===r.TAG?void 0:e.some(r._0)}function u(r){return 0!==r.TAG}function a(r,t){return void 0!==t?{TAG:0,_0:e.valFromOption(t)}:{TAG:1,_0:r}}function p(e,t){return 0===e.TAG?{TAG:0,_0:r._1(e._0,t)}:{TAG:1,_0:e._0}}function $(e,t,n){return 0===n.TAG?r._1(e,n._0):r._1(t,n._0)}function _(e,t,n){return 0===n.TAG?{TAG:0,_0:r._1(e,n._0)}:{TAG:1,_0:r._1(t,n._0)}}function x(e,t){return 0===e.TAG?r._1(t,e._0):{TAG:1,_0:e._0}}function f(r){return{TAG:0,_0:r}}var c=t.MakeBasic2({bind:x,$$return:f,fmap:"DefineWithBind"}),g=c.$great$great$eq,l=c.$less$$great,A={$great$great$eq:g,$less$$great:l},G=c.bind,T=c.$$return,m=c.fmap,q=c.seq,b=c.$great$great,d=c.join,j=c.all,v=c.all_ignore;exports.fail=n,exports.isOk=o,exports.getOk=s,exports.getError=i,exports.isError=u,exports.ofOption=a,exports.ap=p,exports.result=$,exports.bimap=_,exports.bind=G,exports.$$return=T,exports.fmap=m,exports.$great$great$eq=g,exports.$less$$great=l,exports.seq=q,exports.$great$great=b,exports.join=d,exports.all=j,exports.all_ignore=v,exports.Infix=A; },{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_option.js":"dzFO","./Monad.bs.js":"QyI5"}],"xX5m":[function(require,module,exports) { "use strict";function r(r,t,n){return t in r?Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[t]=n,r}var t=require("rescript/lib/js/caml.js"),n=require("rescript/lib/js/list.js"),e=require("rescript/lib/js/array.js"),i=require("rescript/lib/js/curry.js"),o=require("rescript/lib/js/belt_Id.js"),u=require("rescript/lib/js/js_json.js"),a=require("rescript/lib/js/js_math.js"),f=require("rescript/lib/js/caml_obj.js"),c=require("rescript/lib/js/belt_List.js"),s=require("rescript/lib/js/belt_Array.js"),l=require("rescript/lib/js/caml_array.js"),m=require("rescript/lib/js/belt_Result.js"),p=require("rescript/lib/js/caml_format.js"),_=require("rescript/lib/js/caml_option.js"),d=require("rescript/lib/js/belt_SortArray.js"),v=require("rescript/lib/js/belt_MutableMap.js"),g=require("rescript/lib/js/caml_exceptions.js"),b=require("rationale/src/RList.bs.js"),h=require("rationale/src/Option.bs.js"),y=require("rationale/src/Result.bs.js"),x=require("rationale/src/Function.bs.js"),j=t.caml_float_compare,S=o.MakeComparable({cmp:j});function E(r){return v.fromArray(r,S)}var A=v.toArray;function q(r){return v.make(S)}function $(r,t){return v.update(t,r,function(r){return void 0!==r?r+1:1})}function k(r,t){return v.get(t,r)}function I(r,t){return v.map(t,r)}var O={Id:S,fromArray:E,toArray:A,empty:q,increment:$,get:k,fmap:I};function T(r,t){return r>t?r:t}var B={max:T},F=f.caml_equal;function M(r){return[r]}function w(r){return r}var G={isEqual:F,toA:M,id:w};function R(r,t,n){return void 0!==n?i._1(r,_.valFromOption(n)):i._1(t,void 0)}function D(r,t){return h.flatten(i._2(h.apply,r,_.some(t)))}function L(r){return void 0!==r}function N(r,t){if(void 0!==t)return i._1(r,_.valFromOption(t))}function P(r){return void 0!==r?r:""}function W(t,n){return void 0!==n?r({TAG:0,_0:_.valFromOption(n)},Symbol.for("name"),"Ok"):r({TAG:1,_0:t},Symbol.for("name"),"Error")}function C(r,t,n){return void 0!==t?void 0!==n?i._2(r,t,n)?t:n:t:void 0!==n?n:void 0}function U(r,t){return C(function(r,t){return rt},r,t)}var X={dimap:R,fmap:h.fmap,bind:h.bind,$$default:h.$$default,isSome:h.isSome,isNone:h.isNone,toExn:h.toExn,some:h.some,firstSome:h.firstSome,toExt:h.toExn,flatApply:D,toBool:L,ffmap:N,toString:P,toResult:W,compare:C,min:U,max:J};function z(r,t){return i._1(t,r)}function H(r,t,n){return i._1(r,function(r){return i._1(t,function(t){return i._2(n,r,t)})})}function V(r,t,n,e){return i._1(r,function(r){return i._1(t,function(t){return i._1(n,function(n){return i._3(e,r,t,n)})})})}function K(r,t,n,e,o){return i._1(r,function(r){return i._1(t,function(t){return i._1(n,function(n){return i._1(e,function(e){return i._4(o,r,t,n,e)})})})})}var Q={apply:z,flatten2Callbacks:H,flatten3Callbacks:V,flatten4Callbacks:K};function Y(r){return r?"TRUE":"FALSE"}function Z(r){return"TRUE"===r}function rr(r){return!(void 0===r||!r)}var tr={toBool:rr},nr={toString:Y,fromString:Z,O:tr};function er(r){return r.toPrecision(2)}function ir(r){return r.toPrecision(3)}function or(r){return r.toFixed()}function ur(r){return r.toString()}var ar={with2DigitsPrecision:er,with3DigitsPrecision:ir,toFixed:or,toString:ur};function fr(r){return r+1|0}function cr(r){return r-1|0}function sr(r){return r.toString()}var lr={increment:fr,decrement:cr,toString:sr};function mr(r){return y.result(w,w,r)}function pr(r,t){return 0===t.TAG?t._0:r}function _r(t,n){return 0===t.TAG?0===n.TAG?r({TAG:0,_0:[t._0,n._0]},Symbol.for("name"),"Ok"):r({TAG:1,_0:n._0},Symbol.for("name"),"Error"):r({TAG:1,_0:t._0},Symbol.for("name"),"Error")}function dr(r){if(0===r.TAG)return _.some(r._0)}function vr(t,n,e){return i._1(t,e)?r({TAG:1,_0:n},Symbol.for("name"),"Error"):r({TAG:0,_0:e},Symbol.for("name"),"Ok")}var gr={result:y.result,id:mr,fmap:y.fmap,bind:y.bind,toExn:m.getExn,$$default:pr,merge:_r,toOption:dr,errorIfCondition:vr};function br(r,t){try{return _.some(i._1(r,t))}catch(n){return}}function hr(r){return br(p.caml_float_of_string,r)}function yr(r){return br(p.caml_int_of_string,r)}function xr(r,t){return""===t?r:t}var jr={safe_float:hr,safe_int:yr,$$default:xr};function Sr(r){return h.$$default("",r)}function Er(r){return x.Infix.$pipe$pipe$great(u.decodeString,Sr,r)}function Ar(r){return r}function qr(r){return r}function $r(r){return""===r?void 0:_.some(r)}function kr(r){if(void 0!==r)return x.Infix.$pipe$pipe$great(u.decodeString,function(r){return h.$$default("",r)},_.valFromOption(r))}var Ir={fromString:$r,toString:kr},Or={toString:Er,fromString:Ar,fromNumber:qr,O:Ir};function Tr(r){return new Date(r)}function Br(r){return Date.now()}function Fr(r){return new Date}function Mr(r){return r.valueOf()}var wr={fromString:Tr,now:Br,make:Fr,valueOf:Mr},Gr={fmap:n.map,get:c.get,toArray:e.of_list,fmapi:n.mapi,concat:n.concat,drop:b.drop,remove:b.remove,find:n.find,filter:n.filter,for_all:n.for_all,exists:n.exists,sort:n.sort,length:n.length,filter_opt:b.filter_opt,uniqBy:b.uniqBy,join:b.join,head:b.head,uniq:b.uniq,flatten:n.flatten,last:b.last,append:n.append,getBy:c.getBy,dropLast:b.dropLast,contains:b.contains,without:b.without,update:b.update,iter:n.iter,findIndex:b.findIndex};function Rr(r){return r.length}function Dr(r,t){return r[t]}function Lr(r){return s.get(r,r.length-1|0)}function Nr(r){return s.get(r,0)}function Pr(r,t){return h.isSome(s.getBy(r,t))}function Wr(r){return r.length<1}function Cr(r){return i._2(h.fmap,function(t){return s.reduce(r,t,function(r,t){return f.caml_lessthan(r,t)?r:t})},s.get(r,0))}function Ur(r){return i._2(h.fmap,function(t){return s.reduce(r,t,function(r,t){return f.caml_greaterthan(r,t)?r:t})},s.get(r,0))}function Jr(t){var n=t.length;if(0===n||1===n)return r({TAG:1,_0:"Must be at least 2 elements"},Symbol.for("name"),"Error");var e=s.makeBy(n-1|0,function(r){return r});return i._1(y.$$return,s.map(e,function(r){return[t[r],t[r+1|0]]}))}function Xr(r,t){for(var n=T(r.length,t.length),e=new Array(n),i=0;i=r.length?"overMax":0===e?"underMin":{NAME:"firstHigher",VAL:e}}function ut(r,t){var n=s.concat(r,t);return e.fast_sort(f.caml_compare,n),n}function at(r){var t=s.concatMany(r);return e.fast_sort(f.caml_compare,t),t}function ft(r,t){var n=e.mapi(function(r,t){return t+r|0},l.make(1+(t-r|0)|0,r));return s.map(n,function(r){return r})}function ct(r,t){var n=e.mapi(function(r,t){return t-r|0},l.make(1+(r-t|0)|0,r));return s.map(n,function(r){return r})}function st(r){var t=[],n=v.make(S);return s.forEachWithIndex(r,function(e,i){var o=r.length-1|0,u=0!==e?e===o?[e-1|0]:[e-1|0,e+1|0]:[e+1|0],a=s.map(u,function(t){return l.get(r,t)});s.some(a,function(r){return r===i})?$(i,n):t.push(i)}),[t,n]}var lt={makeIncrementalUp:ft,makeIncrementalDown:ct,split:st},mt={min:Nr,max:Lr,range:it,binarySearchFirstElementGreaterIndex:ot,concat:ut,concatMany:at,Floats:lt};function pt(r){return s.reduce(r,0,function(r,t){return r+t})}function _t(r){return pt(r)/r.length}var dt=g.create("E-ProbExample.A.Floats.RangeError");function vt(r,t,n){switch(n){case 0:return[];case 1:return[r];case 2:return[r,t];default:if(r===t)return s.make(n,r);if(n<0)throw{RE_EXN_ID:dt,_1:"n must be greater than 0",Error:new Error};if(r>t)throw{RE_EXN_ID:dt,_1:"Min value is less then max value",Error:new Error};var e=(t-r)/(n-1|0);return s.makeBy(n,function(t){return r+t*e})}}var gt={sum:pt,mean:_t,random:a.random_int,$$RangeError:dt,range:vt},bt={fmap:e.map,fmapi:e.mapi,to_list:e.to_list,of_list:e.of_list,length:Rr,append:e.append,unsafe_get:Dr,get:s.get,getBy:s.getBy,last:Lr,first:Nr,hasBy:Pr,fold_left:e.fold_left,fold_right:e.fold_right,concatMany:s.concatMany,keepMap:s.keepMap,init:e.init,reduce:s.reduce,reducei:s.reduceWithIndex,isEmpty:Wr,min:Cr,max:Ur,stableSortBy:d.stableSortBy,toRanges:Jr,zipMaxLength:Xr,asList:zr,uniq:Hr,intersperse:Vr,accumulate:Kr,findIndex:Qr,filter:Yr,O:tt,R:et,Sorted:mt,Floats:gt};function ht(r){return r.filter(h.isSome).map(function(r){return h.toExn("Warning: This should not have happened",r)})}function yt(r,t){return t.filter(i.__1(r))}var xt={concatSomes:ht,filter:yt};exports.FloatFloatMap=O,exports.Int=B,exports.U=G,exports.O=X,exports.F=Q,exports.Bool=nr,exports.Float=ar,exports.I=lr,exports.R=gr,exports.safe_fn_of_string=br,exports.S=jr,exports.J=Or,exports.JsDate=wr,exports.L=Gr,exports.A=bt,exports.JsArray=xt; },{"rescript/lib/js/caml.js":"gGFE","rescript/lib/js/list.js":"aYjQ","rescript/lib/js/array.js":"d4B1","rescript/lib/js/curry.js":"NSLD","rescript/lib/js/belt_Id.js":"eN7B","rescript/lib/js/js_json.js":"NOig","rescript/lib/js/js_math.js":"MeLz","rescript/lib/js/caml_obj.js":"p3B5","rescript/lib/js/belt_List.js":"H9fU","rescript/lib/js/belt_Array.js":"yUxI","rescript/lib/js/caml_array.js":"Tpli","rescript/lib/js/belt_Result.js":"tKwj","rescript/lib/js/caml_format.js":"Zve6","rescript/lib/js/caml_option.js":"dzFO","rescript/lib/js/belt_SortArray.js":"mJOW","rescript/lib/js/belt_MutableMap.js":"aHaK","rescript/lib/js/caml_exceptions.js":"RiV8","rationale/src/RList.bs.js":"KUwe","rationale/src/Option.bs.js":"Ddhm","rationale/src/Result.bs.js":"SRS9","rationale/src/Function.bs.js":"JPps"}],"qeUV":[function(require,module,exports) { "use strict";var r,t,e,n=require("./caml.js"),o=require("./curry.js"),i=require("./caml_option.js"),u=require("./belt_SortArray.js"),f=require("./belt_internalAVLtree.js");function v(r,t,e){if(void 0===r)return f.singleton(t,e);var n=r.k;if(t===n)return f.updateValue(r,e);var o=r.v;return t=(void 0!==t?t.h:0)){var n=r.k,o=r.v,u=r.l,v=r.r,a=k(n,t);return f.concatOrJoin(A(u,a[0],e),n,e(n,i.some(o),a[1]),A(v,a[2],e))}}else if(void 0===t)return;var s=t.k,l=t.v,c=t.l,d=t.r,p=k(s,r);return f.concatOrJoin(A(p[0],c,e),s,e(s,p[1],i.some(l)),A(p[2],d,e))}function m(r,t,e){return A(r,t,o.__3(e))}function _(r,t,e){for(;;){var o=t,i=r;if(!i)return 0;if(!o)return 0;var u=o.hd,v=i.hd,a=n.caml_string_compare(v.k,u.k);if(0!==a)return a;var s=e(v.v,u.v);if(0!==s)return s;t=f.stackAllLeft(u.r,o.tl),r=f.stackAllLeft(v.r,i.tl)}}function h(r,t,e){var n=f.size(r),o=f.size(t);return n===o?_(f.stackAllLeft(r,0),f.stackAllLeft(t,0),e):n=0?e=f.fromSortedArrayAux(r,0,n):(n=0|-n,e=f.fromSortedArrayRevAux(r,n-1|0,n));for(var o=n;o=t)return o;var s=p(o,r[i]);if(void 0===s)return s;n=i+1|0,o=s}}function v(e,r){for(var t=r.length,o=e,n=0;n=0?r:0|-r}function s(r){return-1^r}function u(r){return t.caml_int32_format("%d",r)}function c(r){try{return t.caml_int32_of_string(r)}catch(o){var n=e.internalToOCamlException(o);if("Failure"===n.RE_EXN_ID)return;throw n}}var a=r.caml_int_compare;function p(r,t){return r===t}var _=0,x=1,m=-1,f=2147483647,l=-2147483648;exports.zero=_,exports.one=x,exports.minus_one=m,exports.succ=n,exports.pred=o,exports.abs=i,exports.max_int=f,exports.min_int=l,exports.lognot=s,exports.of_string_opt=c,exports.to_string=u,exports.compare=a,exports.equal=p; },{"./caml.js":"gGFE","./caml_format.js":"Zve6","./caml_js_exceptions.js":"yO2E"}],"f266":[function(require,module,exports) { "use strict";var r=require("./caml.js"),e=require("./caml_int64.js"),t=require("./caml_format.js"),n=require("./caml_js_exceptions.js");function o(r){return e.sub(r,e.one)}function s(t){return r.i64_ge(t,e.zero)?t:e.neg(t)}function i(r){return e.xor(r,e.neg_one)}function c(r){try{return t.caml_int64_of_string(r)}catch(o){var e=n.internalToOCamlException(o);if("Failure"===e.RE_EXN_ID)return;throw e}}var u=e.compare;function a(r,t){return 0===e.compare(r,t)}var _=e.zero,p=e.one,x=e.neg_one,m=e.succ,l=e.max_int,f=e.min_int,g=e.to_string;exports.zero=_,exports.one=p,exports.minus_one=x,exports.succ=m,exports.pred=o,exports.abs=s,exports.max_int=l,exports.min_int=f,exports.lognot=i,exports.of_string_opt=c,exports.to_string=g,exports.compare=u,exports.equal=a; },{"./caml.js":"gGFE","./caml_int64.js":"Phox","./caml_format.js":"Zve6","./caml_js_exceptions.js":"yO2E"}],"cYhC":[function(require,module,exports) { "use strict";var e=require("./caml_bytes.js");function r(e){if(e<0||e>255)throw{RE_EXN_ID:"Invalid_argument",_1:"Char.chr",Error:new Error};return e}function t(r){var t=0;if(r>=40){if(92===r)return"\\\\";t=r>=127?1:2}else if(r>=32){if(r>=39)return"\\'";t=2}else if(r>=14)t=1;else switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 11:case 12:t=1;break;case 13:return"\\r"}switch(t){case 1:var s=[0,0,0,0];return s[0]=92,s[1]=48+(r/100|0)|0,s[2]=48+(r/10|0)%10|0,s[3]=48+r%10|0,e.bytes_to_string(s);case 2:var c=[0];return c[0]=r,e.bytes_to_string(c)}}function s(e){return e>=65&&e<=90||e>=192&&e<=214||e>=216&&e<=222?e+32|0:e}function c(e){return e>=97&&e<=122||e>=224&&e<=246||e>=248&&e<=254?e-32|0:e}function n(e){return e>=65&&e<=90?e+32|0:e}function a(e){return e>=97&&e<=122?e-32|0:e}function u(e,r){return e-r|0}function i(e,r){return 0==(e-r|0)}exports.chr=r,exports.escaped=t,exports.lowercase=s,exports.uppercase=c,exports.lowercase_ascii=n,exports.uppercase_ascii=a,exports.compare=u,exports.equal=i; },{"./caml_bytes.js":"gmRG"}],"JK9e":[function(require,module,exports) { "use strict";var r=require("./caml.js"),t=require("./char.js"),e=require("./curry.js"),n=require("./caml_bytes.js"),o=require("./caml_js_exceptions.js");function i(r,t){var e=n.caml_create_bytes(r);return n.caml_fill_bytes(e,0,r,t),e}function a(r,t){for(var o=n.caml_create_bytes(r),i=0;i(r.length-e|0))throw{RE_EXN_ID:"Invalid_argument",_1:"String.sub / Bytes.sub",Error:new Error};var o=n.caml_create_bytes(e);return n.caml_blit_bytes(r,t,o,0,e),o}function l(r,t,e){return n.bytes_to_string(f(r,t,e))}function p(r,t){var e=r+t|0,n=t<0,o=e<0;if(r<0){if(!n)return e;if(o)return e;throw{RE_EXN_ID:"Invalid_argument",_1:"Bytes.extend",Error:new Error}}if(n)return e;if(o)throw{RE_EXN_ID:"Invalid_argument",_1:"Bytes.extend",Error:new Error};return e}function g(t,e,o){var i=p(p(t.length,e),o),a=n.caml_create_bytes(i),_=e<0?[0|-e,0]:[0,e],s=_[1],c=_[0],u=r.caml_int_min(t.length-c|0,i-s|0);return u>0&&n.caml_blit_bytes(t,c,a,s,u),a}function m(r,t,e,o){if(t<0||e<0||t>(r.length-e|0))throw{RE_EXN_ID:"Invalid_argument",_1:"String.fill / Bytes.fill",Error:new Error};return n.caml_fill_bytes(r,t,e,o)}function E(r,t,e,o,i){if(i<0||t<0||t>(r.length-i|0)||o<0||o>(e.length-i|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Bytes.blit",Error:new Error};return n.caml_blit_bytes(r,t,e,o,i)}function x(r,t,e,o,i){if(i<0||t<0||t>(r.length-i|0)||o<0||o>(e.length-i|0))throw{RE_EXN_ID:"Invalid_argument",_1:"String.blit / Bytes.blit_string",Error:new Error};return n.caml_blit_string(r,t,e,o,i)}function h(r,t){for(var n=0,o=t.length;n=t)return r;throw{RE_EXN_ID:"Invalid_argument",_1:"Bytes.concat",Error:new Error}}function y(r,t,e){for(;;){var n=e,o=r;if(!n)return o;var i=n.tl,a=n.hd;if(!i)return a.length+o|0;e=i,r=v((a.length+t|0)+o|0,o)}}function w(r,t){if(!t)return _;for(var e=r.length,o=n.caml_create_bytes(y(0,e,t)),i=0,a=t;;){var s=a,c=i;if(!s)return o;var u=s.tl,f=s.hd;if(!u)return n.caml_blit_bytes(f,0,o,c,f.length),o;n.caml_blit_bytes(f,0,o,c,f.length),n.caml_blit_bytes(r,0,o,c+f.length|0,e),a=u,i=(c+f.length|0)+e|0}}function d(r,t){var e=r.length,o=t.length,i=n.caml_create_bytes(e+o|0);return n.caml_blit_bytes(r,0,i,0,e),n.caml_blit_bytes(t,0,i,e,o),i}function I(r){return r>13||r<9?32===r:11!==r}function N(r){for(var t=r.length,e=0;e=e&&I(r[n]);)n=n-1|0;return n>=e?f(r,e,1+(n-e|0)|0):_}function D(r){for(var t=0,e=0,o=r.length;e=32?i>92||i<34?i>=127?4:1:i>91||i<35?2:1:i>=11?13!==i?4:2:i>=8?2:4)|0}if(t===r.length)return s(r);var a=n.caml_create_bytes(t);t=0;for(var _=0,c=r.length;_=35)92!==u?u>=127?f=1:a[t]=u:f=2;else if(u>=32)u>=34?f=2:a[t]=u;else if(u>=14)f=1;else switch(u){case 8:a[t]=92,a[t=t+1|0]=98;break;case 9:a[t]=92,a[t=t+1|0]=116;break;case 10:a[t]=92,a[t=t+1|0]=110;break;case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 11:case 12:f=1;break;case 13:a[t]=92,a[t=t+1|0]=114}switch(f){case 1:a[t]=92,a[t=t+1|0]=48+(u/100|0)|0,a[t=t+1|0]=48+(u/10|0)%10|0,a[t=t+1|0]=48+u%10|0;break;case 2:a[t]=92,a[t=t+1|0]=u}t=t+1|0}return a}function R(r,t){var o=t.length;if(0===o)return t;for(var i=n.caml_create_bytes(o),a=0;a=t)throw{RE_EXN_ID:"Not_found",Error:new Error};if(r[o]===n)return o;e=o+1|0}}function C(r,t){return z(r,r.length,0,t)}function O(r,t,e,n){for(;;){var o=e;if(o>=t)return;if(r[o]===n)return o;e=o+1|0}}function T(r,t){return O(r,r.length,0,t)}function A(r,t,e){var n=r.length;if(t<0||t>n)throw{RE_EXN_ID:"Invalid_argument",_1:"String.index_from / Bytes.index_from",Error:new Error};return z(r,n,t,e)}function F(r,t,e){var n=r.length;if(t<0||t>n)throw{RE_EXN_ID:"Invalid_argument",_1:"String.index_from_opt / Bytes.index_from_opt",Error:new Error};return O(r,n,t,e)}function G(r,t,e){for(;;){var n=t;if(n<0)throw{RE_EXN_ID:"Not_found",Error:new Error};if(r[n]===e)return n;t=n-1|0}}function H(r,t){return G(r,r.length-1|0,t)}function J(r,t,e){if(t<-1||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rindex_from / Bytes.rindex_from",Error:new Error};return G(r,t,e)}function K(r,t,e){for(;;){var n=t;if(n<0)return;if(r[n]===e)return n;t=n-1|0}}function L(r,t){return K(r,r.length-1|0,t)}function M(r,t,e){if(t<-1||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rindex_from_opt / Bytes.rindex_from_opt",Error:new Error};return K(r,t,e)}function P(r,t,e){var n=r.length;if(t<0||t>n)throw{RE_EXN_ID:"Invalid_argument",_1:"String.contains_from / Bytes.contains_from",Error:new Error};try{return z(r,n,t,e),!0}catch(a){var i=o.internalToOCamlException(a);if("Not_found"===i.RE_EXN_ID)return!1;throw i}}function Q(r,t){return P(r,0,t)}function U(r,t,e){if(t<0||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rcontains_from / Bytes.rcontains_from",Error:new Error};try{return G(r,t,e),!0}catch(i){var n=o.internalToOCamlException(i);if("Not_found"===n.RE_EXN_ID)return!1;throw n}}var V=n.caml_bytes_compare;function W(r){return R(t.uppercase,r)}function Y(r){return R(t.lowercase,r)}function Z(r){return q(t.uppercase,r)}function $(r){return q(t.lowercase,r)}var rr=n.caml_bytes_equal,tr=n.bytes_to_string,er=n.bytes_of_string;exports.make=i,exports.init=a,exports.empty=_,exports.copy=s,exports.of_string=u,exports.to_string=c,exports.sub=f,exports.sub_string=l,exports.extend=g,exports.fill=m,exports.blit=E,exports.blit_string=x,exports.concat=w,exports.cat=d,exports.iter=h,exports.iteri=b,exports.map=R,exports.mapi=X,exports.trim=N,exports.escaped=D,exports.index=C,exports.index_opt=T,exports.rindex=H,exports.rindex_opt=L,exports.index_from=A,exports.index_from_opt=F,exports.rindex_from=J,exports.rindex_from_opt=M,exports.contains=Q,exports.contains_from=P,exports.rcontains_from=U,exports.uppercase=W,exports.lowercase=Y,exports.capitalize=Z,exports.uncapitalize=$,exports.uppercase_ascii=B,exports.lowercase_ascii=S,exports.capitalize_ascii=j,exports.uncapitalize_ascii=k,exports.compare=V,exports.equal=rr,exports.unsafe_to_string=tr,exports.unsafe_of_string=er; },{"./caml.js":"gGFE","./char.js":"cYhC","./curry.js":"NSLD","./caml_bytes.js":"gmRG","./caml_js_exceptions.js":"yO2E"}],"Vht3":[function(require,module,exports) { "use strict";var r=require("./caml.js"),t=require("./bytes.js"),n=require("./curry.js"),e=require("./caml_bytes.js"),o=require("./caml_string.js"),i=require("./caml_js_exceptions.js");function _(r,n){return e.bytes_to_string(t.init(r,n))}function s(r,n,o){return e.bytes_to_string(t.sub(e.bytes_of_string(r),n,o))}function u(r,t){if(r>=t)return r;throw{RE_EXN_ID:"Invalid_argument",_1:"String.concat",Error:new Error}}function a(r,t,n){for(;;){var e=n,o=r;if(!e)return o;var i=e.tl,_=e.hd;if(!i)return _.length+o|0;n=i,r=u((_.length+t|0)+o|0,o)}}function f(r,t,n,o,i){for(;;){var _=i,s=t;if(!_)return r;var u=_.tl,a=_.hd;if(!u)return e.caml_blit_string(a,0,r,s,a.length),r;e.caml_blit_string(a,0,r,s,a.length),e.caml_blit_string(n,0,r,s+a.length|0,o),i=u,t=(s+a.length|0)+o|0}}function c(r,t){if(!t)return"";var n=r.length;return e.bytes_to_string(f(e.caml_create_bytes(a(0,n,t)),0,r,n,t))}function g(r,t){for(var e=0,o=t.length;e13||r<9?32===r:11!==r}function m(r){return""===r||!h(r.charCodeAt(0))&&!h(r.charCodeAt(r.length-1|0))?r:e.bytes_to_string(t.trim(e.bytes_of_string(r)))}function d(r){return function(t){for(;;){var n=t;if(n>=r.length)return!1;var e=r.charCodeAt(n);if(e<32)return!0;if(e>92||e<34){if(e>=127)return!0;t=n+1|0}else{if(e>91||e<35)return!0;t=n+1|0}}}(0)?e.bytes_to_string(t.escaped(e.bytes_of_string(r))):r}function E(r,t,n,e){for(;;){var o=n;if(o>=t)throw{RE_EXN_ID:"Not_found",Error:new Error};if(r.charCodeAt(o)===e)return o;n=o+1|0}}function y(r,t){return E(r,r.length,0,t)}function b(r,t,n,e){for(;;){var o=n;if(o>=t)return;if(r.charCodeAt(o)===e)return o;n=o+1|0}}function v(r,t){return b(r,r.length,0,t)}function w(r,t,n){var e=r.length;if(t<0||t>e)throw{RE_EXN_ID:"Invalid_argument",_1:"String.index_from / Bytes.index_from",Error:new Error};return E(r,e,t,n)}function I(r,t,n){var e=r.length;if(t<0||t>e)throw{RE_EXN_ID:"Invalid_argument",_1:"String.index_from_opt / Bytes.index_from_opt",Error:new Error};return b(r,e,t,n)}function N(r,t,n){for(;;){var e=t;if(e<0)throw{RE_EXN_ID:"Not_found",Error:new Error};if(r.charCodeAt(e)===n)return e;t=e-1|0}}function C(r,t){return N(r,r.length-1|0,t)}function D(r,t,n){if(t<-1||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rindex_from / Bytes.rindex_from",Error:new Error};return N(r,t,n)}function R(r,t,n){for(;;){var e=t;if(e<0)return;if(r.charCodeAt(e)===n)return e;t=e-1|0}}function X(r,t){return R(r,r.length-1|0,t)}function A(r,t,n){if(t<-1||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rindex_from_opt / Bytes.rindex_from_opt",Error:new Error};return R(r,t,n)}function z(r,t,n){var e=r.length;if(t<0||t>e)throw{RE_EXN_ID:"Invalid_argument",_1:"String.contains_from / Bytes.contains_from",Error:new Error};try{return E(r,e,t,n),!0}catch(_){var o=i.internalToOCamlException(_);if("Not_found"===o.RE_EXN_ID)return!1;throw o}}function j(r,t){return z(r,0,t)}function q(r,t,n){if(t<0||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rcontains_from / Bytes.rcontains_from",Error:new Error};try{return N(r,t,n),!0}catch(o){var e=i.internalToOCamlException(o);if("Not_found"===e.RE_EXN_ID)return!1;throw e}}function S(r){return e.bytes_to_string(t.uppercase_ascii(e.bytes_of_string(r)))}function B(r){return e.bytes_to_string(t.lowercase_ascii(e.bytes_of_string(r)))}function k(r){return e.bytes_to_string(t.capitalize_ascii(e.bytes_of_string(r)))}function O(r){return e.bytes_to_string(t.uncapitalize_ascii(e.bytes_of_string(r)))}var T=r.caml_string_compare;function F(r,t){for(var n=0,e=t.length,o=t.length-1|0;o>=0;--o)t.charCodeAt(o)===r&&(n={hd:s(t,o+1|0,(e-o|0)-1|0),tl:n},e=o);return{hd:s(t,0,e),tl:n}}function G(r){return e.bytes_to_string(t.uppercase(e.bytes_of_string(r)))}function H(r){return e.bytes_to_string(t.lowercase(e.bytes_of_string(r)))}function J(r){return e.bytes_to_string(t.capitalize(e.bytes_of_string(r)))}function K(r){return e.bytes_to_string(t.uncapitalize(e.bytes_of_string(r)))}var L=o.make,M=t.blit_string;function P(r,t){return r===t}exports.make=L,exports.init=_,exports.sub=s,exports.blit=M,exports.concat=c,exports.iter=g,exports.iteri=p,exports.map=l,exports.mapi=x,exports.trim=m,exports.escaped=d,exports.index=y,exports.index_opt=v,exports.rindex=C,exports.rindex_opt=X,exports.index_from=w,exports.index_from_opt=I,exports.rindex_from=D,exports.rindex_from_opt=A,exports.contains=j,exports.contains_from=z,exports.rcontains_from=q,exports.uppercase=G,exports.lowercase=H,exports.capitalize=J,exports.uncapitalize=K,exports.uppercase_ascii=S,exports.lowercase_ascii=B,exports.capitalize_ascii=k,exports.uncapitalize_ascii=O,exports.compare=T,exports.equal=P,exports.split_on_char=F; },{"./caml.js":"gGFE","./bytes.js":"JK9e","./curry.js":"NSLD","./caml_bytes.js":"gmRG","./caml_string.js":"GLny","./caml_js_exceptions.js":"yO2E"}],"VSaX":[function(require,module,exports) { "use strict";function r(r,t,n,o,a,e){var c=((t+r|0)+o|0)+e|0;return(c<>>(32-a|0)|0)+n|0}function t(t,n,o,a,e,c,f){return r(n&o|(-1^n)&a,t,n,e,c,f)}function n(t,n,o,a,e,c,f){return r(n&a|o&(-1^a),t,n,e,c,f)}function o(t,n,o,a,e,c,f){return r(n^o^a,t,n,e,c,f)}function a(t,n,o,a,e,c,f){return r(o^(n|-1^a),t,n,e,c,f)}function e(r,e){var c=r[0],f=r[1],u=r[2],i=r[3];c=t(c,f,u,i,e[0],7,-680876936),i=t(i,c,f,u,e[1],12,-389564586),u=t(u,i,c,f,e[2],17,606105819),f=t(f,u,i,c,e[3],22,-1044525330),c=t(c,f,u,i,e[4],7,-176418897),i=t(i,c,f,u,e[5],12,1200080426),u=t(u,i,c,f,e[6],17,-1473231341),f=t(f,u,i,c,e[7],22,-45705983),c=t(c,f,u,i,e[8],7,1770035416),i=t(i,c,f,u,e[9],12,-1958414417),u=t(u,i,c,f,e[10],17,-42063),f=t(f,u,i,c,e[11],22,-1990404162),c=t(c,f,u,i,e[12],7,1804603682),i=t(i,c,f,u,e[13],12,-40341101),u=t(u,i,c,f,e[14],17,-1502002290),c=n(c,f=t(f,u,i,c,e[15],22,1236535329),u,i,e[1],5,-165796510),i=n(i,c,f,u,e[6],9,-1069501632),u=n(u,i,c,f,e[11],14,643717713),f=n(f,u,i,c,e[0],20,-373897302),c=n(c,f,u,i,e[5],5,-701558691),i=n(i,c,f,u,e[10],9,38016083),u=n(u,i,c,f,e[15],14,-660478335),f=n(f,u,i,c,e[4],20,-405537848),c=n(c,f,u,i,e[9],5,568446438),i=n(i,c,f,u,e[14],9,-1019803690),u=n(u,i,c,f,e[3],14,-187363961),f=n(f,u,i,c,e[8],20,1163531501),c=n(c,f,u,i,e[13],5,-1444681467),i=n(i,c,f,u,e[2],9,-51403784),u=n(u,i,c,f,e[7],14,1735328473),c=o(c,f=n(f,u,i,c,e[12],20,-1926607734),u,i,e[5],4,-378558),i=o(i,c,f,u,e[8],11,-2022574463),u=o(u,i,c,f,e[11],16,1839030562),f=o(f,u,i,c,e[14],23,-35309556),c=o(c,f,u,i,e[1],4,-1530992060),i=o(i,c,f,u,e[4],11,1272893353),u=o(u,i,c,f,e[7],16,-155497632),f=o(f,u,i,c,e[10],23,-1094730640),c=o(c,f,u,i,e[13],4,681279174),i=o(i,c,f,u,e[0],11,-358537222),u=o(u,i,c,f,e[3],16,-722521979),f=o(f,u,i,c,e[6],23,76029189),c=o(c,f,u,i,e[9],4,-640364487),i=o(i,c,f,u,e[12],11,-421815835),u=o(u,i,c,f,e[15],16,530742520),c=a(c,f=o(f,u,i,c,e[2],23,-995338651),u,i,e[0],6,-198630844),i=a(i,c,f,u,e[7],10,1126891415),u=a(u,i,c,f,e[14],15,-1416354905),f=a(f,u,i,c,e[5],21,-57434055),c=a(c,f,u,i,e[12],6,1700485571),i=a(i,c,f,u,e[3],10,-1894986606),u=a(u,i,c,f,e[10],15,-1051523),f=a(f,u,i,c,e[1],21,-2054922799),c=a(c,f,u,i,e[8],6,1873313359),i=a(i,c,f,u,e[15],10,-30611744),u=a(u,i,c,f,e[6],15,-1560198380),f=a(f,u,i,c,e[13],21,1309151649),c=a(c,f,u,i,e[4],6,-145523070),i=a(i,c,f,u,e[11],10,-1120210379),u=a(u,i,c,f,e[2],15,718787259),f=a(f,u,i,c,e[9],21,-343485551),r[0]=c+r[0]|0,r[1]=f+r[1]|0,r[2]=u+r[2]|0,r[3]=i+r[3]|0}var c=[1732584193,-271733879,-1732584194,271733878],f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function u(r,t,n){var o=r.slice(t,n),a=o.length;c[0]=1732584193,c[1]=-271733879,c[2]=-1732584194,c[3]=271733878;for(var u=0;u<=15;++u)f[u]=0;for(var i=a/64|0,v=1;v<=i;++v){for(var h=0;h<=15;++h){var d=((v<<6)-64|0)+(h<<2)|0;f[h]=((o.charCodeAt(d)+(o.charCodeAt(d+1|0)<<8)|0)+(o.charCodeAt(d+2|0)<<16)|0)+(o.charCodeAt(d+3|0)<<24)|0}e(c,f)}for(var C=o.slice(i<<6),s=0;s<=15;++s)f[s]=0;for(var l=C.length-1|0,A=0;A<=l;++A)f[A/4|0]=f[A/4|0]|C.charCodeAt(A)<<(A%4<<3);var g=l+1|0;if(f[g/4|0]=f[g/4|0]|128<<(g%4<<3),g>55){e(c,f);for(var m=0;m<=15;++m)f[m]=0}return f[14]=a<<3,e(c,f),String.fromCharCode(255&c[0],c[0]>>8&255,c[0]>>16&255,c[0]>>24&255,255&c[1],c[1]>>8&255,c[1]>>16&255,c[1]>>24&255,255&c[2],c[2]>>8&255,c[2]>>16&255,c[2]>>24&255,255&c[3],c[3]>>8&255,c[3]>>16&255,c[3]>>24&255)}exports.caml_md5_string=u; },{}],"ZLPc":[function(require,module,exports) { "use strict";var r=require("./char.js"),e=require("./string.js"),t=require("./caml_md5.js"),n=require("./caml_bytes.js"),o=require("./pervasives.js"),_=require("./caml_string.js"),i=require("./caml_external_polyfill.js");function s(r){return t.caml_md5_string(r,0,r.length)}function u(r){return s(n.bytes_to_string(r))}function a(r,e,n){if(e<0||n<0||e>(r.length-n|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.substring",Error:new Error};return t.caml_md5_string(r,e,n)}function l(r,e,t){return a(n.bytes_to_string(r),e,t)}function c(r){var e,t=o.open_in_bin(r);try{e=i.resolve("caml_md5_chan")(t,-1)}catch(n){throw i.resolve("caml_ml_close_channel")(t),n}return i.resolve("caml_ml_close_channel")(t),e}var g=o.output_string;function m(r){return o.really_input_string(r,16)}function f(r){return r+(r<10?48:87)|0}function h(r){if(16!==r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.to_hex",Error:new Error};for(var e=n.caml_create_bytes(32),t=0;t<=15;++t){var o=_.get(r,t);e[t<<1]=f(o>>>4),e[1+(t<<1)|0]=f(15&o)}return n.bytes_to_string(e)}function E(e){if(32!==e.length)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.from_hex",Error:new Error};for(var t=function(r){if(r>=65){if(r>=97){if(r>=103)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.from_hex",Error:new Error};return 10+(r-97|0)|0}if(r>=71)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.from_hex",Error:new Error};return 10+(r-65|0)|0}if(r>57||r<48)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.from_hex",Error:new Error};return r-48|0},o=function(r){return(t(_.get(e,r))<<4)+t(_.get(e,r+1|0))|0},i=n.caml_create_bytes(16),s=0;s<=15;++s)n.set(i,s,r.chr(o(s<<1)));return n.bytes_to_string(i)}var p=e.compare,x=e.equal;exports.compare=p,exports.equal=x,exports.string=s,exports.bytes=u,exports.substring=a,exports.subbytes=l,exports.file=c,exports.output=g,exports.input=m,exports.to_hex=h,exports.from_hex=E; },{"./char.js":"cYhC","./string.js":"Vht3","./caml_md5.js":"VSaX","./caml_bytes.js":"gmRG","./pervasives.js":"z22f","./caml_string.js":"GLny","./caml_external_polyfill.js":"FC4F"}],"l4ED":[function(require,module,exports) { "use strict";var t=require("./caml.js"),r=require("./array.js"),n=require("./int32.js"),i=require("./int64.js"),e=require("./digest.js"),o=require("./caml_array.js"),u=require("./caml_int64.js"),s=require("./caml_string.js");function f(t){return[Math.floor(2147483647*Math.random())]}function a(t,n){r.blit(n.st,0,t.st,0,55),t.idx=n.idx}function _(t,r){for(var n=function(t,r){return e.string(t+String(r))},i=0===r.length?[0]:r,u=i.length,f=0;f<=54;++f)o.set(t.st,f,f);for(var a,_="x",c=0,x=54+(55>u?55:u)|0;c<=x;++c){var d=c%55,l=c%u;_=n(_,o.get(i,l)),o.set(t.st,d,1073741823&(o.get(t.st,d)^(a=_,((s.get(a,0)+(s.get(a,1)<<8)|0)+(s.get(a,2)<<16)|0)+(s.get(a,3)<<24)|0)))}t.idx=0}function c(t){var r={st:o.make(55,0),idx:0};return _(r,t),r}function x(t){return c(f(void 0))}function d(t){var r={st:o.make(55,0),idx:0};return a(r,t),r}function l(t){t.idx=(t.idx+1|0)%55;var r=o.get(t.st,t.idx),n=1073741823&(o.get(t.st,(t.idx+24|0)%55)+(r^r>>>25&31)|0);return o.set(t.st,t.idx,n),n}function g(t,r){if(r>1073741823||r<=0)throw{RE_EXN_ID:"Invalid_argument",_1:"Random.int",Error:new Error};for(;;){var n=l(t),i=n%r;if((n-i|0)<=(1+(1073741823-r|0)|0))return i}}function m(t,r){if(r<=0)throw{RE_EXN_ID:"Invalid_argument",_1:"Random.int32",Error:new Error};for(;;){var i=l(t)|(1&l(t))<<30,e=i%r;if((i-e|0)<=(1+(n.max_int-r|0)|0))return e}}function v(r,n){if(t.i64_le(n,u.zero))throw{RE_EXN_ID:"Invalid_argument",_1:"Random.int64",Error:new Error};for(;;){var e=u.of_int32(l(r)),o=u.lsl_(u.of_int32(l(r)),30),s=u.lsl_(u.of_int32(7&l(r)),60),f=u.or_(e,u.or_(o,s)),a=u.mod_(f,n);if(!t.i64_gt(u.sub(f,a),u.add(u.sub(i.max_int,n),u.one)))return a}}function p(t){return(l(t)/1073741824+l(t))/1073741824}function E(t,r){return p(t)*r}function j(t){return 0==(1&l(t))}var q={st:[987910699,495797812,364182224,414272206,318284740,990407751,383018966,270373319,840823159,24560019,536292337,512266505,189156120,730249596,143776328,51606627,140166561,366354223,1003410265,700563762,981890670,913149062,526082594,1021425055,784300257,667753350,630144451,949649812,48546892,415514493,258888527,511570777,89983870,283659902,308386020,242688715,482270760,865188196,1027664170,207196989,193777847,619708188,671350186,149669678,257044018,87658204,558145612,183450813,28133145,901332182,710253903,510646120,652377910,409934019,801085050],idx:0};function $(t){return l(q)}function b(t){return g(q,t)}function h(t){return m(q,t)}function w(t){return v(q,t)}function I(t){return p(q)*t}function R(t){return j(q)}function k(t){return _(q,t)}function y(t){return _(q,[t])}function D(t){return k(f(void 0))}function N(t){return d(q)}function X(t){return a(q,t)}var M={make:c,make_self_init:x,copy:d,bits:l,$$int:g,int32:m,int64:v,$$float:E,bool:j};exports.init=y,exports.full_init=k,exports.self_init=D,exports.bits=$,exports.$$int=b,exports.int32=h,exports.int64=w,exports.$$float=I,exports.bool=R,exports.State=M,exports.get_state=N,exports.set_state=X; },{"./caml.js":"gGFE","./array.js":"d4B1","./int32.js":"wWOr","./int64.js":"f266","./digest.js":"ZLPc","./caml_array.js":"Tpli","./caml_int64.js":"Phox","./caml_string.js":"GLny"}],"QbOX":[function(require,module,exports) { "use strict";var o=require("./curry.js"),r=require("./caml_option.js");function t(o,t){if(void 0!==o&&t(r.valFromOption(o)))return o}function n(r,n){return t(r,o.__1(n))}function i(o,t){if(void 0!==o)return t(r.valFromOption(o))}function e(r,t){return i(r,o.__1(t))}function u(o){if(void 0!==o)return r.valFromOption(o);throw{RE_EXN_ID:"Not_found",Error:new Error}}function p(o,t,n){return void 0!==o?n(r.valFromOption(o)):t}function f(r,t,n){return p(r,t,o.__1(n))}function v(o,t){if(void 0!==o)return r.some(t(r.valFromOption(o)))}function a(r,t){return v(r,o.__1(t))}function c(o,t){if(void 0!==o)return t(r.valFromOption(o))}function s(r,t){return c(r,o.__1(t))}function m(o,t){return void 0!==o?r.valFromOption(o):t}function x(o){return void 0!==o}function _(o){return void 0===o}function l(o,t,n){return void 0!==o?void 0!==t&&n(r.valFromOption(o),r.valFromOption(t)):void 0===t}function d(r,t,n){return l(r,t,o.__2(n))}function F(o,t,n){return void 0!==o?void 0!==t?n(r.valFromOption(o),r.valFromOption(t)):1:void 0!==t?-1:0}function O(r,t,n){return F(r,t,o.__2(n))}exports.keepU=t,exports.keep=n,exports.forEachU=i,exports.forEach=e,exports.getExn=u,exports.mapWithDefaultU=p,exports.mapWithDefault=f,exports.mapU=v,exports.map=a,exports.flatMapU=c,exports.flatMap=s,exports.getWithDefault=m,exports.isSome=x,exports.isNone=_,exports.eqU=l,exports.eq=d,exports.cmpU=F,exports.cmp=O; },{"./curry.js":"NSLD","./caml_option.js":"dzFO"}],"Lf2V":[function(require,module,exports) { "use strict";function t(r){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}var r=require("rescript/lib/js/array.js"),n=require("rescript/lib/js/curry.js"),e=require("rescript/lib/js/caml_obj.js"),s=require("rescript/lib/js/belt_Array.js"),o=require("rescript/lib/js/caml_array.js"),u=require("rescript/lib/js/pervasives.js"),i=require("rescript/lib/js/belt_Option.js"),a=require("../utility/E.bs.js");function f(t,r,n,e,s){return n*((r-s)/(r-t))+e*((s-t)/(r-t))}var c=n._1(a.O.toExt,"Tried to perform an operation on an empty XYShape.");function p(t){return t}function l(t){return t.xs}function g(t){return t.ys}function y(t){return a.A.length(t.xs)}var x=[],v=[],m={xs:x,ys:v};function _(t){return 0===a.A.length(t.xs)}function A(t){return n._1(c,n._1(a.A.Sorted.min,t.xs))}function h(t){return n._1(c,n._1(a.A.Sorted.max,t.xs))}function d(t){return n._1(c,a.A.first(t.ys))}function b(t){return n._1(c,a.A.last(t.ys))}function S(t){return h(t)-A(t)}function X(t,r){return{xs:n._2(a.A.fmap,t,r.xs),ys:r.ys}}function j(t,r){return{xs:r.xs,ys:n._2(a.A.fmap,t,r.ys)}}function M(t){return s.zip(t.xs,t.ys)}function O(t){return{xs:t[0],ys:t[1]}}function q(t,r){return{xs:t,ys:r}}function w(t,r){return O([r.xs,a.A.accumulate(t,r.ys)])}function B(t,n){return{xs:r.concat({hd:t.xs,tl:{hd:n.xs,tl:0}}),ys:r.concat({hd:t.ys,tl:{hd:n.ys,tl:0}})}}function T(t){return O(s.unzip(t))}function Y(t,r){return n._3(a.A.Floats.range,A(t),h(t),r)}function z(t){return{xs:t.xs,ys:t.ys}}var E={toXyShape:p,xs:l,ys:g,length:y,empty:m,isEmpty:_,minX:A,maxX:h,firstY:d,lastY:b,xTotalRange:S,mapX:X,mapY:j,zip:M,fromArray:O,fromArrays:q,accumulateYs:w,concat:B,fromZippedArray:T,equallyDividedXs:Y,toJs:z};function I(t){return n._1(c,a.A.min(n._2(a.A.fmap,A,t)))}function L(t){return n._1(c,a.A.max(n._2(a.A.fmap,h,t)))}function R(t,r){return n._3(a.A.Floats.range,I(t),L(t),r)}function C(t){return n._1(a.A.Sorted.concatMany,n._2(a.A.fmap,l,t))}var F={minX:I,maxX:L,equallyDividedXs:R,allXs:C};function P(t){return t[0]}function D(t){return t[1]}function V(t){return[A(t),d(t)]}function Z(t){return[h(t),b(t)]}function G(t,r){var e=M(t);return n._2(a.A.getBy,e,r)}function U(t,r){var n=M(r),e=s.getIndexBy(n,function(r){return r[0]>t}),o=void 0!==e?0!==e?e-1|0:void 0:n.length-1|0;return i.flatMap(o,function(t){return s.get(n,t)})}var W={x:P,y:D,first:V,last:Z,getBy:G,firstAtOrBeforeXValue:U};function $(r,e){var s=n._2(a.A.Sorted.binarySearchFirstElementGreaterIndex,e.ys,r);if("object"!==t(s))return"overMax"===s?h(e):A(e);var u=s.VAL,i=(u-1|0)<0?0:u-1|0,c=e.xs,p=e.ys;return o.get(p,i)!==r?f(o.get(p,i),o.get(p,u),o.get(c,i),o.get(c,u),r):o.get(c,i)}var k={linear:$};function J(t,r){return n._2(a.O.fmap,D,U(t,r))}function H(t,r){return n._2(a.O.fmap,D,G(r,function(r){return r[0]===t}))}function K(r,e){var s=n._2(a.A.Sorted.binarySearchFirstElementGreaterIndex,e.xs,r);if("object"!==t(s))return"overMax"===s?b(e):d(e);var u=s.VAL,i=(u-1|0)<0?0:u-1|0,c=e.xs,p=e.ys;return o.get(c,i)!==r?f(o.get(c,i),o.get(c,u),o.get(p,i),o.get(p,u),r):o.get(p,i)}function N(t,r){return"Linear"===t?"UseZero"===r?function(t,r,n){if(r<0)return 0;if(r>=(a.A.length(t.xs)-1|0))return 0;var e=o.get(t.xs,r),s=(n-e)/(o.get(t.xs,r+1|0)-e);return o.get(t.ys,r)*(1-s)+o.get(t.ys,r+1|0)*s}:function(t,r,n){if(r<0)return o.get(t.ys,0);if(r>=(a.A.length(t.xs)-1|0))return o.get(t.ys,a.A.length(t.xs)-1|0);var e=o.get(t.xs,r),s=(n-e)/(o.get(t.xs,r+1|0)-e);return o.get(t.ys,r)*(1-s)+o.get(t.ys,r+1|0)*s}:"UseZero"===r?function(t,r,n){return r<0?0:r>=(a.A.length(t.xs)-1|0)?0:o.get(t.ys,r)}:function(t,r,n){return r<0?o.get(t.ys,0):r>=(a.A.length(t.xs)-1|0)?o.get(t.ys,a.A.length(t.xs)-1|0):o.get(t.ys,r)}}function Q(t,r,n){return 0}var tt={stepwiseIncremental:J,stepwiseIfAtX:H,linear:K,continuousInterpolator:N,discreteInterpolator:Q};function rt(t,r){return{xs:t,ys:s.map(t,function(t){return K(t,r)})}}function nt(t,r){return n._2(a.A.fmap,function(t){return $(t,r)},n._3(a.A.Floats.range,0,1,t))}function et(t,r){return rt(Y(r,t),r)}function st(t,r,n){return rt(nt(t,r),n)}var ot={_replaceWithXs:rt,equallyDivideXByMass:nt,proportionEquallyOverX:et,proportionByProbabilityMass:st};function ut(t,r){return e.caml_greaterthan(t[1],r[1])?1:0}function it(t,r){return e.caml_greaterthan(t[0],r[0])?1:0}function at(t){return n._2(a.A.stableSortBy,t,ut)}function ft(t){return n._2(a.A.stableSortBy,t,it)}function ct(t,r){return a.A.filter(function(r){return n._1(t,r[0])},r)}var pt={compareYs:ut,compareXs:it,sortByY:at,sortByX:ft,filterByX:ct},lt=function(t,r,n,e){for(var s=n.xs.length,o=e.xs.length,u=[],i=[],a=-1,f=-1;a<=s-1&&f<=o-1;){var c=void 0,p=void 0,l=void 0;if(f==o-1&&ae.xs[f+1])f++,c=e.xs[f],l=e.ys[f],p=r(n,a,c);else if(a1-i||r>1-i?void 0:r/(1-s(n));case 2:var t=n._0.excludingProbabilityMass;return r1-n._1.excludingProbabilityMass?void 0:(r-t)/(1-s(n))}}var d={excludedProbabilityMass:s,includedProbabilityMass:c,initialProbabilityMass:a,normalizeProbabilityMass:b,yPointToSubYPoint:l};function f(n){return n.continuous}function _(n){return n.discrete}function y(n){return{continuous:n,discrete:0}}function m(n){return{continuous:0,discrete:n}}function P(n,e){return{continuous:r._1(n,e.continuous),discrete:r._1(n,e.discrete)}}function x(n,e,i){return{continuous:r._2(n,e.continuous,i.continuous),discrete:r._2(n,e.discrete,i.discrete)}}function M(n,r){return x(function(n,r){return n+r},n,r)}var p={toContinuousValue:f,toDiscreteValue:_,makeContinuous:y,makeDiscrete:m,fmap:P,combine2:x,add:M};exports.ShapeMonad=t,exports.DistributionUnit=o,exports.Domain=d,exports.MixedPoint=p; },{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/js_null.js":"qr1b"}],"S4ET":[function(require,module,exports) { "use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(t)}function t(n,t,r){return t in n?Object.defineProperty(n,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[t]=r,n}var r=require("rescript/lib/js/curry.js"),e=require("../utility/E.bs.js");function o(n){return"Divide"===n?function(n,t){return n/t}:"Multiply"===n?function(n,t){return n*t}:"Add"===n?function(n,t){return n+t}:"Exponentiate"===n?function(n,t){return Math.pow(n,t)}:function(n,t){return n-t}}function i(n,r,e){return"Divide"===n&&0===e?t({TAG:1,_0:"Cannot divide $v1 by zero."},Symbol.for("name"),"Error"):t({TAG:0,_0:o(n)(r,e)},Symbol.for("name"),"Ok")}function u(n){return"Divide"===n?"/":"Multiply"===n?"*":"Add"===n?"+":"Exponentiate"===n?"**":"-"}function a(n,t,r){return t+" "+u(n)+" "+r}var f={toFn:o,applyFn:i,toString:u,format:a};function c(n){return"Add"===n?"+":"Exponentiate"===n?"^":"*"}function l(n,t,r){return t+" "+c(n)+" "+r}var p={toString:c,format:l};function m(t,r){if("object"!==n(t))return"Mean"===t?"mean($value)":"sample($value)";var e=t.NAME;return"Inv"===e?"inv(x="+t.VAL+","+r+")":"Pdf"===e?"pdf(x="+t.VAL+","+r+")":"cdf(x="+t.VAL+","+r+")"}var v={format:m};function y(n){return"Log"===n?function(n,t){return Math.log(n)/Math.log(t)}:"Exponentiate"===n?function(n,t){return Math.pow(n,t)}:function(n,t){return n*t}}function b(n,t,r){return"Log"===n?"verticalLog("+t+", "+r+") ":"Exponentiate"===n?"verticalExponentiate("+t+", "+r+") ":"verticalMultiply("+t+", "+r+") "}function s(n){return"Log"===n?function(n,t){}:"Exponentiate"===n?function(n,t){}:function(n,t){return n*t}}function g(n){return"Log"===n?function(n,t){}:"Exponentiate"===n?function(n,t){}:function(n,t){}}var A={toFn:y,format:b,toIntegralSumCacheFn:s,toIntegralCacheFn:g};function d(n,t,r){return"truncate("+r+", "+e.O.dimap(function(n){return n.toString()},function(n){return"-inf"},n)+", "+e.O.dimap(function(n){return n.toString()},function(n){return"inf"},t)+")"}function x(t,e){if("object"!==n(e))return"";var o=e.NAME;if("Normalize"===o)return"normalize(k"+r._1(t,e.VAL)+")";if("AlgebraicCombination"===o){var i=e.VAL;return a(i[0],r._1(t,i[1]),r._1(t,i[2]))}if("FloatFromDist"===o){var u=e.VAL;return m(u[0],r._1(t,u[1]))}if("PointwiseCombination"===o){var f=e.VAL;return l(f[0],r._1(t,f[1]),r._1(t,f[2]))}if("Truncate"===o){var c=e.VAL;return d(c[0],c[1],r._1(t,c[2]))}if("VerticalScaling"!==o)return"Render"===o?r._1(t,e.VAL):"";var p=e.VAL;return b(p[0],r._1(t,p[1]),r._1(t,p[2]))}var S={truncateToString:d,toString:x};exports.Algebraic=f,exports.Pointwise=p,exports.DistToFloat=v,exports.Scale=A,exports.T=S; },{"rescript/lib/js/curry.js":"NSLD","../utility/E.bs.js":"xX5m"}],"eTMD":[function(require,module,exports) { "use strict";var t=require("rescript/lib/js/curry.js");function e(e){var n=e.minX,r=e.maxX,a={get:e.integral,xToY:e.integralXtoY,yToX:e.integralYtoX,sum:e.integralEndY};return{minX:n,maxX:r,integral:e.integral,xTotalRange:function(e){return t._1(r,e)-t._1(n,e)},mapY:e.mapY,xToY:e.xToY,downsample:e.downsample,toShape:e.toShape,toDiscreteProbabilityMassFraction:e.toDiscreteProbabilityMassFraction,toContinuous:e.toContinuous,toDiscrete:e.toDiscrete,normalize:e.normalize,truncate:e.truncate,mean:e.mean,variance:e.variance,updateIntegralCache:e.updateIntegralCache,Integral:a}}function n(e,n,r){if(void 0!==n&&void 0!==r)return t._2(e,n,r)}function r(e,n,r){if(void 0!==n&&void 0!==r)return t._2(e,n,r)}var a={combineIntegralSums:n,combineIntegrals:r};exports.Dist=e,exports.Common=a; },{"rescript/lib/js/curry.js":"NSLD"}],"YXLi":[function(require,module,exports) { "use strict";var e=require("rescript/lib/js/curry.js"),t=require("rescript/lib/js/belt_Array.js"),r=require("rescript/lib/js/caml_array.js"),n=require("rescript/lib/js/pervasives.js"),s=require("../utility/E.bs.js"),a=require("./XYShape.bs.js"),i=require("../expressionTree/Operation.bs.js");function o(e,n){var i=void 0!==e&&e,o=a.T.length(n),g=n.ys,u=n.xs;u.unshift(r.get(u,0)),g.unshift(r.get(g,0)),u.push(r.get(u,o-1|0)),g.push(r.get(g,o-1|0));for(var f=s.A.length(u),c=new Array(f),h=new Array(f-1|0),l=new Array(f-2|0),p=0;pv&&(v=T)}for(var D=e._3(s.A.Floats.range,p,v,300),k=t.make(300,0),C=0,E=s.A.length(y);C0&&r.get(y,C)>0)for(var F=0,B=s.A.length(D);F=u&&e<=p},a.T.zip(o.xyShape)),s=r.O.dimap(function(e){return[[e-t.epsilon_float,0]]},function(e){return[]},e),h=r.O.dimap(function(e){return[[e+t.epsilon_float,0]]},function(e){return[]},i),m=n._1(r.A.concatMany,[s,c,h]);return l(void 0,void 0,void 0,a.T.fromZippedArray(m))}function P(e){var t=a.T.isEmpty(e.xyShape),i=e.integralCache;return t?y:void 0!==i?i:l(void 0,void 0,void 0,n._2(r.O.toExt,"This should not have happened",a.$$Range.integrateWithTriangles(e.xyShape)))}function E(e,n){var t=P(n).xyShape;return h(function(n){return a.XsConversion.proportionByProbabilityMass(e,t,n)},n)}function F(e){var t=P(e);return n._2(r.O.$$default,a.T.lastY(t.xyShape),e.integralSumCache)}function B(e,n){var t=P(n);return a.XtoY.linear(e,t.xyShape)}function R(e,n){var t=P(n);return a.YtoX.linear(e,t.xyShape)}function Z(e){return i.some(e)}function k(e){}function z(e){return Y(1,L(1/F(e),X(P(e),e)))}function U(e){return a.Analysis.integrateContinuousShape(function(e,n){return n*Math.pow(e,2)/2},function(e,n,t){return n*Math.pow(e,2)/2+t*Math.pow(e,3)/3},e)}function W(e){return a.Analysis.getVarianceDangerously(e,U,a.Analysis.getMeanOfSquaresContinuousShape)}var G=u.Dist({minX:D,maxX:M,mapY:j,xToY:q,toShape:A,toContinuous:Z,toDiscrete:k,normalize:z,toDiscreteProbabilityMassFraction:w,downsample:E,truncate:I,updateIntegralCache:X,integral:P,integralEndY:F,integralXtoY:B,integralYtoX:R,mean:U,variance:W});function V(e,n,t){var r=n.xyShape,o=t.xyShape;if(a.T.isEmpty(r)||a.T.isEmpty(o))return C;var c="Linear"===n.interpolation?n:b(n),s=p.combineShapesContinuousDiscrete(e,c.xyShape,o),h="Multiply"===e||"Divide"===e?u.Common.combineIntegralSums(function(e,n){return e*n},n.integralSumCache,t.integralSumCache):void 0;return l(n.interpolation,i.some(h),void 0,s)}function H(e,n,t){var r=n.xyShape,o=t.xyShape,c=a.T.length(r),s=a.T.length(o);if(0===c||0===s)return C;var h=p.combineShapesContinuousContinuous(e,r,o),m=u.Common.combineIntegralSums(function(e,n){return e*n},n.integralSumCache,t.integralSumCache);return l(void 0,i.some(m),void 0,h)}exports.getShape=c,exports.interpolation=s,exports.make=l,exports.shapeMap=h,exports.lastY=m,exports.oShapeMap=f,exports.emptyIntegral=y,exports.empty=C,exports.stepwiseToLinear=b,exports.combinePointwise=_,exports.toLinear=T,exports.shapeFn=O,exports.updateIntegralSumCache=Y,exports.updateIntegralCache=X,exports.reduce=$,exports.mapY=j,exports.scaleBy=L,exports.T=G,exports.combineAlgebraicallyWithDiscrete=V,exports.combineAlgebraically=H; },{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/pervasives.js":"z22f","rescript/lib/js/caml_option.js":"dzFO","../utility/E.bs.js":"xX5m","./XYShape.bs.js":"Lf2V","./DistTypes.bs.js":"r7Vb","./Distributions.bs.js":"eTMD","./AlgebraicShapeCombination.bs.js":"YXLi"}],"Ms6F":[function(require,module,exports) { "use strict";function e(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var r=require("rescript/lib/js/curry.js"),t=require("rescript/lib/js/belt_Array.js"),n=require("rescript/lib/js/caml_array.js"),i=require("rescript/lib/js/pervasives.js"),a=require("rescript/lib/js/caml_option.js"),o=require("../utility/E.bs.js"),u=require("rescript/lib/js/belt_MutableMap.js"),c=require("./XYShape.bs.js"),s=require("./DistTypes.bs.js"),p=require("../expressionTree/Operation.bs.js"),l=require("./Continuous.bs.js"),f=require("./Distributions.bs.js");function h(e,r,t){return{xyShape:t,integralSumCache:void 0!==e?a.valFromOption(e):void 0,integralCache:void 0!==r?a.valFromOption(r):void 0}}function m(e,t){return{xyShape:r._1(e,t.xyShape),integralSumCache:t.integralSumCache,integralCache:t.integralCache}}function y(e){return e.xyShape}function g(e,t){var n=a.some(t.integralCache),i=a.some(t.integralSumCache);return r._2(o.O.fmap,function(e){return h(i,n,e)},r._1(e,t.xyShape))}var S={xs:[i.neg_infinity],ys:[0]},x=0,d={xyShape:S,interpolation:"Stepwise",integralSumCache:x,integralCache:void 0},v=c.T.empty,C=0,b=d,_={xyShape:v,integralSumCache:C,integralCache:b};function T(e,t){return r._1(e,t.xyShape)}function j(e){return c.T.lastY(e.xyShape)}function Y(e,r,t,n,i){var o=void 0!==e?e:function(e,r){},u=f.Common.combineIntegralSums(o,n.integralSumCache,i.integralSumCache);return h(a.some(u),void 0,c.PointwiseCombination.combine(function(e,r){return e+r},c.XtoY.discreteInterpolator,n.xyShape,i.xyShape))}function X(e,t,n,i){var a=void 0!==t?t:function(e,r){},u=void 0!==e?e:function(e,r){};return r._3(o.A.fold_left,function(e,r){return Y(u,a,n,e,r)},_,i)}function O(e,r){return{xyShape:r.xyShape,integralSumCache:e,integralCache:r.integralCache}}function q(e,r){return{xyShape:r.xyShape,integralSumCache:r.integralSumCache,integralCache:e}}function A(e,t,i){for(var s=t.xyShape,l=i.xyShape,m=c.T.length(s),y=c.T.length(l),g=f.Common.combineIntegralSums(function(e,r){return e*r},t.integralSumCache,i.integralSumCache),S=p.Algebraic.toFn(e),x=o.FloatFloatMap.empty(void 0),d=0;d=1&&n>1?h(void 0,void 0,c.T.fromZippedArray(c.Zipped.sortByX(t.slice(t.reverse(c.Zipped.sortByY(c.T.zip(r.xyShape))),0,e)))):r}function G(e,t,n){return h(void 0,void 0,c.T.fromZippedArray(c.Zipped.filterByX(function(n){return n>=r._2(o.O.$$default,i.neg_infinity,e)&&n<=r._2(o.O.$$default,i.infinity,t)},c.T.zip(n.xyShape))))}function V(e,t){return s.MixedPoint.makeDiscrete(r._2(o.O.$$default,0,c.XtoY.stepwiseIfAtX(e,t.xyShape)))}function H(e,r){return c.XtoY.linear(e,l.getShape(M(r)))}function J(e,r){return c.YtoX.linear(e,l.getShape(M(r)))}function K(e){var t=e.xyShape;return r._3(o.A.reducei,t.xs,0,function(e,r,i){return e+r*n.get(t.ys,i)})}function L(e){return c.Analysis.getVarianceDangerously(e,K,function(e){return K(m(c.Analysis.squareXYShape,e))})}var N=f.Dist({minX:I,maxX:w,mapY:F,xToY:V,toShape:B,toContinuous:P,toDiscrete:k,normalize:z,toDiscreteProbabilityMassFraction:Z,downsample:E,truncate:G,updateIntegralCache:q,integral:M,integralEndY:D,integralXtoY:H,integralYtoX:J,mean:K,variance:L});exports.make=h,exports.shapeMap=m,exports.getShape=y,exports.oShapeMap=g,exports.emptyIntegral=d,exports.empty=_,exports.shapeFn=T,exports.lastY=j,exports.combinePointwise=Y,exports.reduce=X,exports.updateIntegralSumCache=O,exports.updateIntegralCache=q,exports.combineAlgebraically=A,exports.mapY=F,exports.scaleBy=$,exports.T=N; },{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/belt_Array.js":"yUxI","rescript/lib/js/caml_array.js":"Tpli","rescript/lib/js/pervasives.js":"z22f","rescript/lib/js/caml_option.js":"dzFO","../utility/E.bs.js":"xX5m","rescript/lib/js/belt_MutableMap.js":"aHaK","./XYShape.bs.js":"Lf2V","./DistTypes.bs.js":"r7Vb","../expressionTree/Operation.bs.js":"S4ET","./Continuous.bs.js":"CVcq","./Distributions.bs.js":"eTMD"}],"XMuZ":[function(require,module,exports) { "use strict";function e(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var n=require("rescript/lib/js/caml.js"),t=require("rescript/lib/js/curry.js"),r=require("rescript/lib/js/caml_option.js"),i=require("../utility/E.bs.js"),a=require("./XYShape.bs.js"),o=require("./Discrete.bs.js"),u=require("./DistTypes.bs.js"),c=require("./Continuous.bs.js"),s=require("./Distributions.bs.js");function l(e,n,t,i){return{continuous:t,discrete:i,integralSumCache:void 0!==e?r.valFromOption(e):void 0,integralCache:void 0!==n?r.valFromOption(n):void 0}}function m(e){return a.T.length(c.getShape(e.continuous))+a.T.length(o.getShape(e.discrete))|0}function d(e,n){var a=void 0!==e?e:1,u=o.scaleBy(a,n.discrete),s=c.scaleBy(a,n.continuous),m=t._2(i.O.bind,n.integralCache,function(e){return c.scaleBy(a,e)}),d=t._2(i.O.bind,n.integralSumCache,function(e){return e*a});return l(r.some(d),r.some(m),s,u)}function g(e){return e.continuous}function h(e){return e.discrete}function p(e,n){return{continuous:n.continuous,discrete:n.discrete,integralSumCache:n.integralSumCache,integralCache:e}}function _(e){return n.caml_float_min(t._1(c.T.minX,e.continuous),t._1(o.T.minX,e.discrete))}function C(e){return n.caml_float_max(t._1(c.T.maxX,e.continuous),t._1(o.T.maxX,e.discrete))}function v(n){return e({TAG:0,_0:n},Symbol.for("name"),"Mixed")}function f(e,n,i){var a=t._3(c.T.truncate,e,n,i.continuous),u=t._3(o.T.truncate,e,n,i.discrete);return l(r.some(void 0),r.some(void 0),a,u)}function b(e){var n=t._1(c.T.Integral.get,e.continuous),i=t._1(o.T.Integral.get,e.discrete),a=c.updateIntegralCache(n,e.continuous),u=o.updateIntegralCache(i,e.discrete),s=t._1(c.T.Integral.sum,a),m=t._1(o.T.Integral.sum,u),d=s+m,g=s/d,h=m/d,p=c.updateIntegralSumCache(g,c.scaleBy(g/s,a)),_=o.updateIntegralSumCache(h,o.scaleBy(h/m,u));return l(1,r.some(void 0),p,_)}function T(e,n){var r=b(n),i=t._2(c.T.xToY,e,r.continuous),a=t._2(o.T.xToY,e,r.discrete);return u.MixedPoint.add(i,a)}function S(e){var n=t._1(o.T.Integral.sum,e.discrete);return n/(n+t._1(c.T.Integral.sum,e.continuous))}function I(e,n){var r=t._1(o.T.Integral.sum,n.discrete),i=t._1(c.T.Integral.sum,n.continuous),a=r+i,u=t._2(o.T.downsample,e*(r/a)|0,n.discrete);return{continuous:t._2(c.T.downsample,e*(i/a)|0,n.continuous),discrete:u,integralSumCache:n.integralSumCache,integralCache:n.integralCache}}function y(e){var n=e.integralCache;if(void 0!==n)return n;var r=t._1(c.T.Integral.get,e.continuous),i=c.stepwiseToLinear(t._1(o.T.Integral.get,e.discrete));return c.make(void 0,void 0,void 0,a.PointwiseCombination.combine(function(e,n){return e+n},a.XtoY.continuousInterpolator("Linear","UseOutermostPoints"),c.getShape(r),c.getShape(i)))}function x(e){return c.lastY(y(e))}function O(e,n){return a.XtoY.linear(e,c.getShape(y(n)))}function Y(e,n){return a.YtoX.linear(e,c.getShape(y(n)))}function j(e,n,r,a){var u=void 0!==e?e:function(e){},s=void 0!==n?n:function(e){},l=o.T.mapY,m=o.updateIntegralCache(t._2(i.O.bind,a.discrete.integralCache,s),o.updateIntegralSumCache(t._2(i.O.bind,a.discrete.integralSumCache,u),t._4(l,void 0,void 0,r,a.discrete))),d=c.T.mapY;return{continuous:c.updateIntegralCache(t._2(i.O.bind,a.continuous.integralCache,s),c.updateIntegralSumCache(t._2(i.O.bind,a.continuous.integralSumCache,u),t._4(d,void 0,void 0,r,a.continuous))),discrete:m,integralSumCache:t._2(i.O.bind,a.integralSumCache,u),integralCache:t._2(i.O.bind,a.integralCache,s)}}function A(e){var n=e.discrete,r=e.continuous,i=t._1(o.T.mean,n),a=t._1(c.T.mean,r),u=t._1(o.T.Integral.sum,n),s=t._1(c.T.Integral.sum,r);return(i*u+a*s)/(u+s)}function X(e){var n=e.discrete,r=e.continuous,i=t._1(o.T.Integral.sum,n),u=t._1(c.T.Integral.sum,r),s=i+u,l=i/s;return 0!==l?1!==l?a.Analysis.getVarianceDangerously(e,A,function(e){var n=t._1(o.T.mean,o.shapeMap(a.Analysis.squareXYShape,e.discrete)),r=a.Analysis.getMeanOfSquaresContinuousShape(e.continuous);return(n*i+r*u)/s}):t._1(o.T.variance,n):t._1(c.T.variance,r)}var q=s.Dist({minX:_,maxX:C,mapY:j,xToY:T,toShape:v,toContinuous:g,toDiscrete:h,normalize:b,toDiscreteProbabilityMassFraction:S,downsample:I,truncate:f,updateIntegralCache:p,integral:y,integralEndY:x,integralXtoY:O,integralYtoX:Y,mean:A,variance:X});function D(e,n,t){var r=c.combineAlgebraically(e,n.continuous,t.continuous),i=c.combineAlgebraicallyWithDiscrete(e,t.continuous,n.discrete),a=c.combineAlgebraicallyWithDiscrete(e,n.continuous,t.discrete);return{continuous:c.reduce(void 0,void 0,function(e,n){return e+n},[r,i,a]),discrete:o.combineAlgebraically(e,n.discrete,t.discrete),integralSumCache:s.Common.combineIntegralSums(function(e,n){return e*n},n.integralSumCache,t.integralSumCache),integralCache:void 0}}function w(e,n,a,u,m){var d=void 0!==e?e:function(e,n){},p=void 0!==n?n:function(e,n){},_=o.reduce(d,p,a,t._1(i.A.O.concatSomes,t._2(i.A.fmap,h,[u,m]))),C=c.reduce(d,p,a,t._1(i.A.O.concatSomes,t._2(i.A.fmap,g,[u,m]))),v=s.Common.combineIntegralSums(d,u.integralSumCache,m.integralSumCache),f=s.Common.combineIntegrals(p,u.integralCache,m.integralCache);return l(r.some(v),r.some(f),C,_)}exports.make=l,exports.totalLength=m,exports.scaleBy=d,exports.toContinuous=g,exports.toDiscrete=h,exports.updateIntegralCache=p,exports.T=q,exports.combineAlgebraically=D,exports.combinePointwise=w; },{"rescript/lib/js/caml.js":"gGFE","rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_option.js":"dzFO","../utility/E.bs.js":"xX5m","./XYShape.bs.js":"Lf2V","./Discrete.bs.js":"Ms6F","./DistTypes.bs.js":"r7Vb","./Continuous.bs.js":"CVcq","./Distributions.bs.js":"eTMD"}],"wbI6":[function(require,module,exports) { "use strict";function e(r){return(e="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})(r)}function r(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var t=require("rescript/lib/js/curry.js"),n=require("rescript/lib/js/random.js"),a=require("rescript/lib/js/belt_Array.js"),o=require("rescript/lib/js/caml_option.js"),i=require("./Mixed.bs.js"),c=require("./Discrete.bs.js"),u=require("./Continuous.bs.js"),s=require("./Distributions.bs.js");function l(e,r){switch(0|r.TAG){case 0:return t._1(e[0],r._0);case 1:return t._1(e[1],r._0);case 2:return t._1(e[2],r._0)}}function T(e,n){switch(0|n.TAG){case 0:return r({TAG:0,_0:t._1(e[0],n._0)},Symbol.for("name"),"Mixed");case 1:return r({TAG:1,_0:t._1(e[1],n._0)},Symbol.for("name"),"Discrete");case 2:return r({TAG:2,_0:t._1(e[2],n._0)},Symbol.for("name"),"Continuous")}}function _(e){return e}function m(e){return i.make(o.some(e.integralSumCache),o.some(e.integralCache),u.empty,e)}function f(e){return i.make(o.some(e.integralSumCache),o.some(e.integralCache),e,c.empty)}var b=[_,m,f];function p(e){return l(b,e)}function g(e,r,n){switch(0|r.TAG){case 0:break;case 1:var a=r._0;switch(0|n.TAG){case 0:break;case 1:return t._1(c.T.toShape,c.combineAlgebraically(e,a,n._0));case 2:return t._1(u.T.toShape,u.combineAlgebraicallyWithDiscrete(e,n._0,a))}break;case 2:var o=r._0;switch(0|n.TAG){case 0:break;case 1:return t._1(u.T.toShape,u.combineAlgebraicallyWithDiscrete(e,o,n._0));case 2:return t._1(u.T.toShape,u.combineAlgebraically(e,o,n._0))}}return t._1(i.T.toShape,i.combineAlgebraically(e,p(r),p(n)))}function y(e,t,n,a,o){var s=void 0!==e?e:function(e,r){},l=void 0!==t?t:function(e,r){};switch(0|a.TAG){case 0:break;case 1:switch(0|o.TAG){case 1:return r({TAG:1,_0:c.combinePointwise(s,l,n,a._0,o._0)},Symbol.for("name"),"Discrete")}break;case 2:switch(0|o.TAG){case 0:case 1:break;case 2:return r({TAG:2,_0:u.combinePointwise(s,l,void 0,n,a._0,o._0)},Symbol.for("name"),"Continuous")}}return r({TAG:0,_0:i.combinePointwise(s,l,n,p(a),p(o))},Symbol.for("name"),"Mixed")}function v(e){var r=[t._1(i.T.xToY,e),t._1(c.T.xToY,e),t._1(u.T.xToY,e)];return function(e){return l(r,e)}}function x(e){return e}function h(e,r){return T([t._1(i.T.downsample,e),t._1(c.T.downsample,e),t._1(u.T.downsample,e)],r)}function d(e,r,n){return T([t._2(i.T.truncate,e,r),t._2(c.T.truncate,e,r),t._2(u.T.truncate,e,r)],n)}var A=i.T.normalize,I=c.T.normalize,w=u.T.normalize,S=[A,I,w];function G(e){return T(S,e)}function C(e,r){return T([t._1(i.T.updateIntegralCache,e),t._1(c.T.updateIntegralCache,e),t._1(u.T.updateIntegralCache,e)],r)}var Y=i.T.toContinuous,D=c.T.toContinuous,X=u.T.toContinuous,j=[Y,D,X];function k(e){return l(j,e)}var M=i.T.toDiscrete,P=c.T.toDiscrete,q=u.T.toDiscrete,F=[M,P,q];function z(e){return l(F,e)}var N=i.T.toDiscreteProbabilityMassFraction,E=c.T.toDiscreteProbabilityMassFraction,L=u.T.toDiscreteProbabilityMassFraction,V=[N,E,L];function W(e){return l(V,e)}var $=i.T.minX,O=c.T.minX,R=u.T.minX,B=[$,O,R];function H(e){return l(B,e)}var J=i.T.Integral.get,K=c.T.Integral.get,Q=u.T.Integral.get,U=[J,K,Q];function Z(e){return l(U,e)}var ee=i.T.Integral.sum,re=c.T.Integral.sum,te=u.T.Integral.sum,ne=[ee,re,te];function ae(e){return l(ne,e)}function oe(e){var r=[t._1(i.T.Integral.xToY,e),t._1(c.T.Integral.xToY,e),t._1(u.T.Integral.xToY,e)];return function(e){return l(r,e)}}function ie(e){var r=[t._1(i.T.Integral.yToX,e),t._1(c.T.Integral.yToX,e),t._1(u.T.Integral.yToX,e)];return function(e){return l(r,e)}}var ce=i.T.maxX,ue=c.T.maxX,se=u.T.maxX,le=[ce,ue,se];function Te(e){return l(le,e)}function _e(e,r,n){var a=void 0!==e?e:function(e){},o=void 0!==r?r:function(e){},s=[t._3(i.T.mapY,a,o,n),t._3(c.T.mapY,a,o,n),t._3(u.T.mapY,a,o,n)];return function(e){return T(s,e)}}function me(e){switch(0|e.TAG){case 0:return t._1(i.T.mean,e._0);case 1:return t._1(c.T.mean,e._0);case 2:return t._1(u.T.mean,e._0)}}function fe(e){switch(0|e.TAG){case 0:return t._1(i.T.variance,e._0);case 1:return t._1(c.T.variance,e._0);case 2:return t._1(u.T.variance,e._0)}}var be=s.Dist({minX:H,maxX:Te,mapY:_e,xToY:v,toShape:x,toContinuous:k,toDiscrete:z,normalize:G,toDiscreteProbabilityMassFraction:W,downsample:h,truncate:d,updateIntegralCache:C,integral:Z,integralEndY:ae,integralXtoY:oe,integralYtoX:ie,mean:me,variance:fe});function pe(e,r){var n=t._2(be.xToY,e,r);return n.continuous+n.discrete}var ge=be.Integral.yToX,ye=be.Integral.xToY;function ve(e,r){for(var n=a.make(e,0),o=0;o3?n.slice(3):"any":n).split("|").map(I).filter(C).filter(k),a=function(n,t){var r={};return n.forEach(function(n){-1!==t.indexOf(n.from)||-1===t.indexOf(n.to)||r[n.from]||(r[n.from]=n)}),Object.keys(r).map(function(n){return r[n]})}(t,e),o=e.map(function(n){var t=p(n);return{name:n,typeIndex:c(t),test:t.test,conversion:null,conversionIndex:-1}}),u=a.map(function(n){var r=p(n.from);return{name:n.from,typeIndex:c(r),test:r.test,conversion:n,conversionIndex:t.indexOf(n)}});return{types:o.concat(u),restParam:r}}function y(n){var t=U(n);return!!t&&t.restParam}function h(n){return n.types.some(function(n){return null!=n.conversion})}function v(t){if(t&&0!==t.types.length){if(1===t.types.length)return p(t.types[0].name).test;if(2===t.types.length){var r=p(t.types[0].name).test,e=p(t.types[1].name).test;return function(n){return r(n)||e(n)}}var a=t.types.map(function(n){return p(n.name).test});return function(n){for(var t=0;t=o+1}}return 0===n.length?function(n){return 0===n.length}:1===n.length?(r=v(n[0]),function(n){return r(n[0])&&1===n.length}):2===n.length?(r=v(n[0]),e=v(n[1]),function(n){return r(n[0])&&e(n[1])&&2===n.length}):(t=n.map(v),function(n){for(var r=0;r=a:i?a>=o:a===o}(t,n)});if(t)throw new TypeError('Conflicting signatures "'+m(t.params)+'" and "'+m(n.params)+'".');a.push(n)});var o=q(a,function(n){return(n?F(n.params,!1):[]).map(function(t){return{params:t,fn:n.fn}})}).filter(D);o.sort(A);var u=o[0]&&o[0].params.length<=2&&!y(o[0].params),i=o[1]&&o[1].params.length<=2&&!y(o[1].params),f=o[2]&&o[2].params.length<=2&&!y(o[2].params),p=o[3]&&o[3].params.length<=2&&!y(o[3].params),c=o[4]&&o[4].params.length<=2&&!y(o[4].params),b=o[5]&&o[5].params.length<=2&&!y(o[5].params),E=u&&i&&f&&p&&c&&b,O=o.map(function(n){return d(n.params)}),T=u?v(o[0].params[0]):r,P=i?v(o[1].params[0]):r,M=f?v(o[2].params[0]):r,k=p?v(o[3].params[0]):r,C=c?v(o[4].params[0]):r,U=b?v(o[5].params[0]):r,z=u?v(o[0].params[1]):r,B=i?v(o[1].params[1]):r,G=f?v(o[2].params[1]):r,H=p?v(o[3].params[1]):r,J=c?v(o[4].params[1]):r,K=b?v(o[5].params[1]):r,Q=o.map(function(n){return function(n,t){var r=t;if(n.some(h)){var e=y(n),a=n.map(S);r=function(){for(var n=[],r=e?arguments.length-1:arguments.length,o=0;o0){var s=l(t[o]);return(e=new TypeError("Unexpected type of argument in function "+u+" (expected: "+a.join(" or ")+", actual: "+s+", index: "+o+")")).data={category:"wrongType",fn:u,index:o,actual:s,expected:a},e}}else i=f}var p=i.map(function(n){return y(n.params)?1/0:n.params.length});if(t.lengthc?((e=new TypeError("Too many arguments in function "+u+" (expected: "+c+", actual: "+t.length+")")).data={category:"tooManyArgs",fn:u,index:t.length,expectedLength:c},e):((e=new TypeError('Arguments of type "'+t.join(", ")+'" do not match any of the defined signatures of function '+u+".")).data={category:"mismatch",actual:t.map(l)},e)}(n,arguments,o)},pn=function(n,t){"use strict";return arguments.length===nn&&T(n)&&z(t)?W.apply(null,arguments):arguments.length===tn&&P(n)&&B(t)?X.apply(null,arguments):arguments.length===rn&&M(n)&&G(t)?Y.apply(null,arguments):arguments.length===en&&k(n)&&H(t)?Z.apply(null,arguments):arguments.length===an&&C(n)&&J(t)?$.apply(null,arguments):arguments.length===on&&U(n)&&K(t)?_.apply(null,arguments):sn.apply(null,arguments)};try{Object.defineProperty(pn,"name",{value:n})}catch(cn){}return pn.signatures=function(n){var t={};return n.forEach(function(n){n.params.some(h)||F(n.params,!0).forEach(function(r){t[m(r)]=n.fn})}),t}(o),pn}function k(n){return-1===s.ignore.indexOf(n)}function I(n){return n.trim()}function C(n){return!!n}function D(n){return null!==n}function L(n){return 0===n.types.length}function U(n){return n[n.length-1]}function R(n,t,r){return Array.prototype.slice.call(n,t,r)}function V(n,t){for(var r=0;r0?1:e<0?-1:0},exports.format=function(n,t){if("function"==typeof t)return t(n);if(n===1/0)return"Infinity";if(n===-1/0)return"-Infinity";if(isNaN(n))return"NaN";var r,i="auto";switch(t&&(t.notation&&(i=t.notation),exports.isNumber(t)?r=t:exports.isNumber(t.precision)&&(r=t.precision)),i){case"fixed":return exports.toFixed(n,r);case"exponential":return exports.toExponential(n,r);case"engineering":return exports.toEngineering(n,r);case"auto":if(t&&t.exponential&&(void 0!==t.exponential.lower||void 0!==t.exponential.upper)){var o=e.map(t,function(e){return e});return o.exponential=void 0,void 0!==t.exponential.lower&&(o.lowerExp=Math.round(Math.log(t.exponential.lower)/Math.LN10)),void 0!==t.exponential.upper&&(o.upperExp=Math.round(Math.log(t.exponential.upper)/Math.LN10)),console.warn("Deprecation warning: Formatting options exponential.lower and exponential.upper (minimum and maximum value) are replaced with exponential.lowerExp and exponential.upperExp (minimum and maximum exponent) since version 4.0.0. Replace "+JSON.stringify(t)+" with "+JSON.stringify(o)),exports.toPrecision(n,r,o)}return exports.toPrecision(n,r,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],n=arguments[4];return"."!==e?e+n:n});default:throw new Error('Unknown notation "'+i+'". Choose "auto", "exponential", or "fixed".')}},exports.splitNumber=function(e){var n=String(e).toLowerCase().match(/^0*?(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!n)throw new SyntaxError("Invalid number "+e);var t=n[1],r=n[2],i=parseFloat(n[4]||"0"),o=r.indexOf(".");i+=-1!==o?o-1:r.length-1;var p=r.replace(".","").replace(/^0*/,function(e){return i-=e.length,""}).replace(/0*$/,"").split("").map(function(e){return parseInt(e)});return 0===p.length&&(p.push(0),i++),{sign:t,coefficients:p,exponent:i}},exports.toEngineering=function(e,n){if(isNaN(e)||!isFinite(e))return String(e);var t=exports.roundDigits(exports.splitNumber(e),n),r=t.exponent,i=t.coefficients,o=r%3==0?r:r<0?r-3-r%3:r-r%3;if(exports.isNumber(n))for(;n>i.length||r-o+1>i.length;)i.push(0);else for(var p=r>=0?r:Math.abs(o);i.length-10;)a++,s--;var u=i.slice(a).join(""),l=exports.isNumber(n)&&u.length||u.match(/[1-9]/)?"."+u:"",x=i.slice(0,a).join("")+l+"e"+(r>=0?"+":"")+o.toString();return t.sign+x},exports.toFixed=function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=exports.splitNumber(e),i="number"==typeof t?exports.roundDigits(r,r.exponent+1+t):r,o=i.coefficients,p=i.exponent+1,s=p+(t||0);return o.length0?"."+o.join(""):"")+"e"+(p>=0?"+":"")+p},exports.toPrecision=function(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var i=r&&void 0!==r.lowerExp?r.lowerExp:-3,o=r&&void 0!==r.upperExp?r.upperExp:5,p=exports.splitNumber(e);if(p.exponent=o)return exports.toExponential(e,t);var s=t?exports.roundDigits(p,t):p,a=s.coefficients,u=s.exponent;a.length0?u:0;return l<(a=n(-u).concat(a)).length-1&&a.splice(l+1,0,"."),s.sign+a.join("")},exports.roundDigits=function(e,n){for(var t={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=t.coefficients;n<=0;)r.unshift(0),t.exponent++,n++;if(r.length>n&&r.splice(n,r.length-n)[0]>=5){var i=n-1;for(r[i]++;10===r[i];)r.pop(),0===i&&(r.unshift(0),t.exponent++,i++),r[--i]++}return t},exports.digits=function(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length},exports.DBL_EPSILON=Number.EPSILON||2.220446049250313e-16,exports.nearlyEqual=function(e,n,t){if(null==t)return e===n;if(e===n)return!0;if(isNaN(e)||isNaN(n))return!1;if(isFinite(e)&&isFinite(n)){var r=Math.abs(e-n);return r15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+n+"). Use function bignumber(x) to convert to BigNumber.");return new t.BigNumber(n)}},{from:"number",to:"Complex",convert:function(n){return new t.Complex(n,0)}},{from:"number",to:"string",convert:function(t){return t+""}},{from:"BigNumber",to:"Complex",convert:function(n){return new t.Complex(n.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(t){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(n){return new t.Complex(n.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(n){if(new t.Fraction(n).valueOf()!==n)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+n+"). Use function fraction(x) to convert to Fraction.");return new t.Fraction(n)}},{from:"string",to:"number",convert:function(t){var n=Number(t);if(isNaN(n))throw new Error('Cannot convert "'+t+'" to a number');return n}},{from:"string",to:"BigNumber",convert:function(n){try{return new t.BigNumber(n)}catch(o){throw new Error('Cannot convert "'+n+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(n){try{return new t.Fraction(n)}catch(o){throw new Error('Cannot convert "'+n+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(n){try{return new t.Complex(n)}catch(o){throw new Error('Cannot convert "'+n+'" to Complex')}}},{from:"boolean",to:"number",convert:function(t){return+t}},{from:"boolean",to:"BigNumber",convert:function(n){return new t.BigNumber(+n)}},{from:"boolean",to:"Fraction",convert:function(n){return new t.Fraction(+n)}},{from:"boolean",to:"string",convert:function(t){return+t}},{from:"Array",to:"Matrix",convert:function(n){return new t.DenseMatrix(n)}},{from:"Matrix",to:"Array",convert:function(t){return t.valueOf()}}],o}; },{"typed-function":"Qbfe","./../utils/number":"uqMu","./../utils/bignumber/isBigNumber":"NR2f","./../utils/collection/isMatrix":"gfmG"}],"e2Zi":[function(require,module,exports) { function t(){}t.prototype={on:function(t,n,e){var i=this.e||(this.e={});return(i[t]||(i[t]=[])).push({fn:n,ctx:e}),this},once:function(t,n,e){var i=this;function o(){i.off(t,o),n.apply(e,arguments)}return o._=n,this.on(t,o,e)},emit:function(t){for(var n=[].slice.call(arguments,1),e=((this.e||(this.e={}))[t]||[]).slice(),i=0,o=e.length;i0){for(s+=o,e=1;ei)throw Error(p+n)}function S(n,e,i,t){var r,s,o,u;for(s=n[0];s>=10;s/=10)--e;return--e<0?(e+=M,r=0):(r=Math.ceil((e+1)/M),e%=M),s=v(10,M-e),u=n[r]%s|0,null==t?e<3?(0==e?u=u/100|0:1==e&&(u=u/10|0),o=i<4&&99999==u||i>3&&49999==u||5e4==u||0==u):o=(i<4&&u+1==s||i>3&&u+1==s/2)&&(n[r+1]/s/100|0)==v(10,e-2)-1||(u==s/2||0==u)&&0==(n[r+1]/s/100|0):e<4?(0==e?u=u/1e3|0:1==e?u=u/100|0:2==e&&(u=u/10|0),o=(t||i<4)&&9999==u||!t&&i>3&&4999==u):o=((t||i<4)&&u+1==s||!t&&i>3&&u+1==s/2)&&(n[r+1]/s/1e3|0)==v(10,e-3)-1,o}function Z(n,e,i){for(var t,r,s=[0],o=0,u=n.length;oi-1&&(void 0===s[t+1]&&(s[t+1]=0),s[t+1]+=s[t]/i|0,s[t]%=i)}return s.reverse()}D.absoluteValue=D.abs=function(){var n=new this.constructor(this);return n.s<0&&(n.s=1),R(n)},D.ceil=function(){return R(new this.constructor(this),this.e+1,2)},D.comparedTo=D.cmp=function(n){var e,i,t,r,s=this,o=s.d,u=(n=new s.constructor(n)).d,c=s.s,f=n.s;if(!o||!u)return c&&f?c!==f?c:o===u?0:!o^c<0?1:-1:NaN;if(!o[0]||!u[0])return o[0]?c:u[0]?-f:0;if(c!==f)return c;if(s.e!==n.e)return s.e>n.e^c<0?1:-1;for(e=0,i=(t=o.length)<(r=u.length)?t:r;eu[e]^c<0?1:-1;return t===r?0:t>r^c<0?1:-1},D.cosine=D.cos=function(){var n,e,i=this,t=i.constructor;return i.d?i.d[0]?(n=t.precision,e=t.rounding,t.precision=n+Math.max(i.e,i.sd())+M,t.rounding=1,i=function(n,e){var i,t,r=e.d.length;r<32?(i=Math.ceil(r/3),t=(1/G(4,i)).toString()):(i=16,t="2.3283064365386962890625e-10");n.precision+=i,e=z(n,1,e.times(t),new n(1));for(var s=i;s--;){var o=e.times(e);e=o.times(o).minus(o).times(8).plus(1)}return n.precision-=i,e}(t,K(t,i)),t.precision=n,t.rounding=e,R(2==s||3==s?i.neg():i,n,e,!0)):new t(1):new t(NaN)},D.cubeRoot=D.cbrt=function(){var n,e,i,t,r,s,o,u,c,f,a=this,h=a.constructor;if(!a.isFinite()||a.isZero())return new h(a);for(l=!1,(s=a.s*v(a.s*a,1/3))&&Math.abs(s)!=1/0?t=new h(s.toString()):(i=F(a.d),(s=((n=a.e)-i.length+1)%3)&&(i+=1==s||-2==s?"0":"00"),s=v(i,1/3),n=w((n+1)/3)-(n%3==(n<0?-1:2)),(t=new h(i=s==1/0?"5e"+n:(i=s.toExponential()).slice(0,i.indexOf("e")+1)+n)).s=a.s),o=(n=h.precision)+3;;)if(f=(c=(u=t).times(u).times(u)).plus(a),t=P(f.plus(a).times(u),f.plus(c),o+2,1),F(u.d).slice(0,o)===(i=F(t.d)).slice(0,o)){if("9999"!=(i=i.slice(o-3,o+1))&&(r||"4999"!=i)){+i&&(+i.slice(1)||"5"!=i.charAt(0))||(R(t,n+1,1),e=!t.times(t).times(t).eq(a));break}if(!r&&(R(u,n+1,0),u.times(u).times(u).eq(a))){t=u;break}o+=4,r=1}return l=!0,R(t,n,h.rounding,e)},D.decimalPlaces=D.dp=function(){var n,e=this.d,i=NaN;if(e){if(i=((n=e.length-1)-w(this.e/M))*M,n=e[n])for(;n%10==0;n/=10)i--;i<0&&(i=0)}return i},D.dividedBy=D.div=function(n){return P(this,new this.constructor(n))},D.dividedToIntegerBy=D.divToInt=function(n){var e=this.constructor;return R(P(this,new e(n),0,1,1),e.precision,e.rounding)},D.equals=D.eq=function(n){return 0===this.cmp(n)},D.floor=function(){return R(new this.constructor(this),this.e+1,3)},D.greaterThan=D.gt=function(n){return this.cmp(n)>0},D.greaterThanOrEqualTo=D.gte=function(n){var e=this.cmp(n);return 1==e||0===e},D.hyperbolicCosine=D.cosh=function(){var n,e,i,t,r,s=this,o=s.constructor,u=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return u;i=o.precision,t=o.rounding,o.precision=i+Math.max(s.e,s.sd())+4,o.rounding=1,(r=s.d.length)<32?e=(1/G(4,n=Math.ceil(r/3))).toString():(n=16,e="2.3283064365386962890625e-10"),s=z(o,1,s.times(e),new o(1),!0);for(var c,f=n,a=new o(8);f--;)c=s.times(s),s=u.minus(c.times(a.minus(c.times(a))));return R(s,o.precision=i,o.rounding=t,!0)},D.hyperbolicSine=D.sinh=function(){var n,e,i,t,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(e=s.precision,i=s.rounding,s.precision=e+Math.max(r.e,r.sd())+4,s.rounding=1,(t=r.d.length)<3)r=z(s,2,r,r,!0);else{n=(n=1.4*Math.sqrt(t))>16?16:0|n,r=z(s,2,r=r.times(1/G(5,n)),r,!0);for(var o,u=new s(5),c=new s(16),f=new s(20);n--;)o=r.times(r),r=r.times(u.plus(o.times(c.times(o).plus(f))))}return s.precision=e,s.rounding=i,R(r,e,i,!0)},D.hyperbolicTangent=D.tanh=function(){var n,e,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(n=t.precision,e=t.rounding,t.precision=n+7,t.rounding=1,P(i.sinh(),i.cosh(),t.precision=n,t.rounding=e)):new t(i.s)},D.inverseCosine=D.acos=function(){var n,e=this,i=e.constructor,t=e.abs().cmp(1),r=i.precision,s=i.rounding;return-1!==t?0===t?e.isNeg()?_(i,r,s):new i(0):new i(NaN):e.isZero()?_(i,r+4,s).times(.5):(i.precision=r+6,i.rounding=1,e=e.asin(),n=_(i,r+4,s).times(.5),i.precision=r,i.rounding=s,n.minus(e))},D.inverseHyperbolicCosine=D.acosh=function(){var n,e,i=this,t=i.constructor;return i.lte(1)?new t(i.eq(1)?0:NaN):i.isFinite()?(n=t.precision,e=t.rounding,t.precision=n+Math.max(Math.abs(i.e),i.sd())+4,t.rounding=1,l=!1,i=i.times(i).minus(1).sqrt().plus(i),l=!0,t.precision=n,t.rounding=e,i.ln()):new t(i)},D.inverseHyperbolicSine=D.asinh=function(){var n,e,i=this,t=i.constructor;return!i.isFinite()||i.isZero()?new t(i):(n=t.precision,e=t.rounding,t.precision=n+2*Math.max(Math.abs(i.e),i.sd())+6,t.rounding=1,l=!1,i=i.times(i).plus(1).sqrt().plus(i),l=!0,t.precision=n,t.rounding=e,i.ln())},D.inverseHyperbolicTangent=D.atanh=function(){var n,e,i,t,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(n=s.precision,e=s.rounding,t=r.sd(),Math.max(t,n)<2*-r.e-1?R(new s(r),n,e,!0):(s.precision=i=t-r.e,r=P(r.plus(1),new s(1).minus(r),i+n,1),s.precision=n+4,s.rounding=1,r=r.ln(),s.precision=n,s.rounding=e,r.times(.5))):new s(NaN)},D.inverseSine=D.asin=function(){var n,e,i,t,r=this,s=r.constructor;return r.isZero()?new s(r):(e=r.abs().cmp(1),i=s.precision,t=s.rounding,-1!==e?0===e?((n=_(s,i+4,t).times(.5)).s=r.s,n):new s(NaN):(s.precision=i+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=i,s.rounding=t,r.times(2)))},D.inverseTangent=D.atan=function(){var n,e,i,t,r,s,o,u,c,f=this,a=f.constructor,h=a.precision,d=a.rounding;if(f.isFinite()){if(f.isZero())return new a(f);if(f.abs().eq(1)&&h+4<=O)return(o=_(a,h+4,d).times(.25)).s=f.s,o}else{if(!f.s)return new a(NaN);if(h+4<=O)return(o=_(a,h+4,d).times(.5)).s=f.s,o}for(a.precision=u=h+10,a.rounding=1,n=i=Math.min(28,u/M+2|0);n;--n)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(l=!1,e=Math.ceil(u/M),t=1,c=f.times(f),o=new a(f),r=f;-1!==n;)if(r=r.times(c),s=o.minus(r.div(t+=2)),r=r.times(c),void 0!==(o=s.plus(r.div(t+=2))).d[e])for(n=e;o.d[n]===s.d[n]&&n--;);return i&&(o=o.times(2<this.d.length-2},D.isNaN=function(){return!this.s},D.isNegative=D.isNeg=function(){return this.s<0},D.isPositive=D.isPos=function(){return this.s>0},D.isZero=function(){return!!this.d&&0===this.d[0]},D.lessThan=D.lt=function(n){return this.cmp(n)<0},D.lessThanOrEqualTo=D.lte=function(n){return this.cmp(n)<1},D.logarithm=D.log=function(n){var e,i,t,r,s,o,u,c,f=this.constructor,a=f.precision,h=f.rounding;if(null==n)n=new f(10),e=!0;else{if(i=(n=new f(n)).d,n.s<0||!i||!i[0]||n.eq(1))return new f(NaN);e=n.eq(10)}if(i=this.d,this.s<0||!i||!i[0]||this.eq(1))return new f(i&&!i[0]?-1/0:1!=this.s?NaN:i?0:1/0);if(e)if(i.length>1)s=!0;else{for(r=i[0];r%10==0;)r/=10;s=1!==r}if(l=!1,o=j(this,u=a+5),t=e?U(f,u+10):j(n,u),S((c=P(o,t,u,1)).d,r=a,h))do{if(o=j(this,u+=10),t=e?U(f,u+10):j(n,u),c=P(o,t,u,1),!s){+F(c.d).slice(r+1,r+15)+1==1e14&&(c=R(c,a+1,0));break}}while(S(c.d,r+=10,h));return l=!0,R(c,a,h)},D.minus=D.sub=function(n){var e,i,t,r,s,o,u,c,f,a,h,d,p=this,g=p.constructor;if(n=new g(n),!p.d||!n.d)return p.s&&n.s?p.d?n.s=-n.s:n=new g(n.d||p.s!==n.s?p:NaN):n=new g(NaN),n;if(p.s!=n.s)return n.s=-n.s,p.plus(n);if(f=p.d,d=n.d,u=g.precision,c=g.rounding,!f[0]||!d[0]){if(d[0])n.s=-n.s;else{if(!f[0])return new g(3===c?-0:0);n=new g(p)}return l?R(n,u,c):n}if(i=w(n.e/M),a=w(p.e/M),f=f.slice(),s=a-i){for((h=s<0)?(e=f,s=-s,o=d.length):(e=d,i=a,o=f.length),s>(t=Math.max(Math.ceil(u/M),o)+2)&&(s=t,e.length=1),e.reverse(),t=s;t--;)e.push(0);e.reverse()}else{for((h=(t=f.length)<(o=d.length))&&(o=t),t=0;t0;--t)f[o++]=0;for(t=d.length;t>s;){if(f[--t](o=(s=Math.ceil(u/M))>o?s+1:o+1)&&(r=o,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for((o=f.length)-(r=a.length)<0&&(r=o,i=a,a=f,f=i),e=0;r;)e=(f[--r]=f[r]+a[r]+e)/y|0,f[r]%=y;for(e&&(f.unshift(e),++t),o=f.length;0==f[--o];)f.pop();return n.d=f,n.e=T(f,t),l?R(n,u,c):n},D.precision=D.sd=function(n){var e,i=this;if(void 0!==n&&n!==!!n&&1!==n&&0!==n)throw Error(p+n);return i.d?(e=k(i.d),n&&i.e+1>e&&(e=i.e+1)):e=NaN,e},D.round=function(){var n=this,e=n.constructor;return R(new e(n),n.e+1,e.rounding)},D.sine=D.sin=function(){var n,e,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(n=t.precision,e=t.rounding,t.precision=n+Math.max(i.e,i.sd())+M,t.rounding=1,i=function(n,e){var i,t=e.d.length;if(t<3)return z(n,2,e,e);i=(i=1.4*Math.sqrt(t))>16?16:0|i,e=e.times(1/G(5,i)),e=z(n,2,e,e);for(var r,s=new n(5),o=new n(16),u=new n(20);i--;)r=e.times(e),e=e.times(s.plus(r.times(o.times(r).minus(u))));return e}(t,K(t,i)),t.precision=n,t.rounding=e,R(s>2?i.neg():i,n,e,!0)):new t(NaN)},D.squareRoot=D.sqrt=function(){var n,e,i,t,r,s,o=this,u=o.d,c=o.e,f=o.s,a=o.constructor;if(1!==f||!u||!u[0])return new a(!f||f<0&&(!u||u[0])?NaN:u?o:1/0);for(l=!1,0==(f=Math.sqrt(+o))||f==1/0?(((e=F(u)).length+c)%2==0&&(e+="0"),f=Math.sqrt(e),c=w((c+1)/2)-(c<0||c%2),t=new a(e=f==1/0?"1e"+c:(e=f.toExponential()).slice(0,e.indexOf("e")+1)+c)):t=new a(f.toString()),i=(c=a.precision)+3;;)if(t=(s=t).plus(P(o,s,i+2,1)).times(.5),F(s.d).slice(0,i)===(e=F(t.d)).slice(0,i)){if("9999"!=(e=e.slice(i-3,i+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(R(t,c+1,1),n=!t.times(t).eq(o));break}if(!r&&(R(s,c+1,0),s.times(s).eq(o))){t=s;break}i+=4,r=1}return l=!0,R(t,c,a.rounding,n)},D.tangent=D.tan=function(){var n,e,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(n=t.precision,e=t.rounding,t.precision=n+10,t.rounding=1,(i=i.sin()).s=1,i=P(i,new t(1).minus(i.times(i)).sqrt(),n+10,0),t.precision=n,t.rounding=e,R(2==s||4==s?i.neg():i,n,e,!0)):new t(NaN)},D.times=D.mul=function(n){var e,i,t,r,s,o,u,c,f,a=this,h=a.constructor,d=a.d,p=(n=new h(n)).d;if(n.s*=a.s,!(d&&d[0]&&p&&p[0]))return new h(!n.s||d&&!d[0]&&!p||p&&!p[0]&&!d?NaN:d&&p?0*n.s:n.s/0);for(i=w(a.e/M)+w(n.e/M),(c=d.length)<(f=p.length)&&(s=d,d=p,p=s,o=c,c=f,f=o),s=[],t=o=c+f;t--;)s.push(0);for(t=f;--t>=0;){for(e=0,r=c+t;r>t;)u=s[r]+p[t]*d[r-t-1]+e,s[r--]=u%y|0,e=u/y|0;s[r]=(s[r]+e)%y|0}for(;!s[--o];)s.pop();return e?++i:s.shift(),n.d=s,n.e=T(s,i),l?R(n,h.precision,h.rounding):n},D.toBinary=function(n,e){return Q(this,2,n,e)},D.toDecimalPlaces=D.toDP=function(n,e){var i=this,t=i.constructor;return i=new t(i),void 0===n?i:(A(n,0,u),void 0===e?e=t.rounding:A(e,0,8),R(i,n+i.e+1,e))},D.toExponential=function(n,e){var i,t=this,r=t.constructor;return void 0===n?i=L(t,!0):(A(n,0,u),void 0===e?e=r.rounding:A(e,0,8),i=L(t=R(new r(t),n+1,e),!0,n+1)),t.isNeg()&&!t.isZero()?"-"+i:i},D.toFixed=function(n,e){var i,t,r=this,s=r.constructor;return void 0===n?i=L(r):(A(n,0,u),void 0===e?e=s.rounding:A(e,0,8),i=L(t=R(new s(r),n+r.e+1,e),!1,n+t.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i},D.toFraction=function(n){var e,i,t,r,s,o,u,c,f,a,h,d,g=this,m=g.d,w=g.constructor;if(!m)return new w(g);if(f=i=new w(1),t=c=new w(0),o=(s=(e=new w(t)).e=k(m)-g.e-1)%M,e.d[0]=v(10,o<0?M+o:o),null==n)n=s>0?e:f;else{if(!(u=new w(n)).isInt()||u.lt(f))throw Error(p+u);n=u.gt(e)?s>0?e:f:u}for(l=!1,u=new w(F(m)),a=w.precision,w.precision=s=m.length*M*2;h=P(u,e,0,1,1),1!=(r=i.plus(h.times(t))).cmp(n);)i=t,t=r,r=f,f=c.plus(h.times(r)),c=r,r=e,e=u.minus(h.times(r)),u=r;return r=P(n.minus(i),t,0,1,1),c=c.plus(r.times(f)),i=i.plus(r.times(t)),c.s=f.s=g.s,d=P(f,t,s,1).minus(g).abs().cmp(P(c,i,s,1).minus(g).abs())<1?[f,t]:[c,i],w.precision=a,l=!0,d},D.toHexadecimal=D.toHex=function(n,e){return Q(this,16,n,e)},D.toNearest=function(n,e){var i=this,t=i.constructor;if(i=new t(i),null==n){if(!i.d)return i;n=new t(1),e=t.rounding}else{if(n=new t(n),void 0===e?e=t.rounding:A(e,0,8),!i.d)return n.s?i:n;if(!n.d)return n.s&&(n.s=i.s),n}return n.d[0]?(l=!1,i=P(i,n,0,e,1).times(n),l=!0,R(i)):(n.s=i.s,i=n),i},D.toNumber=function(){return+this},D.toOctal=function(n,e){return Q(this,8,n,e)},D.toPower=D.pow=function(n){var e,i,t,r,s,o,u=this,c=u.constructor,f=+(n=new c(n));if(!(u.d&&n.d&&u.d[0]&&n.d[0]))return new c(v(+u,f));if((u=new c(u)).eq(1))return u;if(t=c.precision,s=c.rounding,n.eq(1))return R(u,t,s);if((e=w(n.e/M))>=n.d.length-1&&(i=f<0?-f:f)<=9007199254740991)return r=I(c,u,i,t),n.s<0?new c(1).div(r):R(r,t,s);if((o=u.s)<0){if(ec.maxE+1||e0?o/0:0):(l=!1,c.rounding=u.s=1,i=Math.min(12,(e+"").length),(r=V(n.times(j(u,t+i)),t)).d&&S((r=R(r,t+5,1)).d,t,s)&&(e=t+10,+F((r=R(V(n.times(j(u,e+i)),e),e+5,1)).d).slice(t+1,t+15)+1==1e14&&(r=R(r,t+1,0))),r.s=o,l=!0,c.rounding=s,R(r,t,s))},D.toPrecision=function(n,e){var i,t=this,r=t.constructor;return void 0===n?i=L(t,t.e<=r.toExpNeg||t.e>=r.toExpPos):(A(n,1,u),void 0===e?e=r.rounding:A(e,0,8),i=L(t=R(new r(t),n,e),n<=t.e||t.e<=r.toExpNeg,n)),t.isNeg()&&!t.isZero()?"-"+i:i},D.toSignificantDigits=D.toSD=function(n,e){var i=this.constructor;return void 0===n?(n=i.precision,e=i.rounding):(A(n,1,u),void 0===e?e=i.rounding:A(e,0,8)),R(new i(this),n,e)},D.toString=function(){var n=this,e=n.constructor,i=L(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()&&!n.isZero()?"-"+i:i},D.truncated=D.trunc=function(){return R(new this.constructor(this),this.e+1,1)},D.valueOf=D.toJSON=function(){var n=this,e=n.constructor,i=L(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()?"-"+i:i};var P=function(){function n(n,e,i){var t,r=0,s=n.length;for(n=n.slice();s--;)t=n[s]*e+r,n[s]=t%i|0,r=t/i|0;return r&&n.unshift(r),n}function e(n,e,i,t){var r,s;if(i!=t)s=i>t?1:-1;else for(r=s=0;re[r]?1:-1;break}return s}function i(n,e,i,t){for(var r=0;i--;)n[i]-=r,r=n[i]1;)n.shift()}return function(r,s,o,u,c,f){var a,h,l,d,p,g,m,v,N,b,E,x,q,O,D,F,A,S,Z,P,L=r.constructor,T=r.s==s.s?1:-1,U=r.d,_=s.d;if(!(U&&U[0]&&_&&_[0]))return new L(r.s&&s.s&&(U?!_||U[0]!=_[0]:_)?U&&0==U[0]||!_?0*T:T/0:NaN);for(f?(p=1,h=r.e-s.e):(f=y,p=M,h=w(r.e/p)-w(s.e/p)),Z=_.length,A=U.length,b=(N=new L(T)).d=[],l=0;_[l]==(U[l]||0);l++);if(_[l]>(U[l]||0)&&h--,null==o?(O=o=L.precision,u=L.rounding):O=c?o+(r.e-s.e)+1:o,O<0)b.push(1),g=!0;else{if(O=O/p+2|0,l=0,1==Z){for(d=0,_=_[0],O++;(l1&&(_=n(_,d,f),U=n(U,d,f),Z=_.length,A=U.length),F=Z,x=(E=U.slice(0,Z)).length;x=f/2&&++S;do{d=0,(a=e(_,E,Z,x))<0?(q=E[0],Z!=x&&(q=q*f+(E[1]||0)),(d=q/S|0)>1?(d>=f&&(d=f-1),1==(a=e(m=n(_,d,f),E,v=m.length,x=E.length))&&(d--,i(m,Z=10;d/=10)l++;N.e=l+h*p-1,R(N,c?o+N.e+1:o,u,g)}return N}}();function R(n,e,i,t){var r,s,o,u,c,f,a,h,d,p=n.constructor;n:if(null!=e){if(!(h=n.d))return n;for(r=1,u=h[0];u>=10;u/=10)r++;if((s=e-r)<0)s+=M,o=e,c=(a=h[d=0])/v(10,r-o-1)%10|0;else if((d=Math.ceil((s+1)/M))>=(u=h.length)){if(!t)break n;for(;u++<=d;)h.push(0);a=c=0,r=1,o=(s%=M)-M+1}else{for(a=u=h[d],r=1;u>=10;u/=10)r++;c=(o=(s%=M)-M+r)<0?0:a/v(10,r-o-1)%10|0}if(t=t||e<0||void 0!==h[d+1]||(o<0?a:a%v(10,r-o-1)),f=i<4?(c||t)&&(0==i||i==(n.s<0?3:2)):c>5||5==c&&(4==i||t||6==i&&(s>0?o>0?a/v(10,r-o):0:h[d-1])%10&1||i==(n.s<0?8:7)),e<1||!h[0])return h.length=0,f?(e-=n.e+1,h[0]=v(10,(M-e%M)%M),n.e=-e||0):h[0]=n.e=0,n;if(0==s?(h.length=d,u=1,d--):(h.length=d+1,u=v(10,M-s),h[d]=o>0?(a/v(10,r-o)%v(10,o)|0)*u:0),f)for(;;){if(0==d){for(s=1,o=h[0];o>=10;o/=10)s++;for(o=h[0]+=u,u=1;o>=10;o/=10)u++;s!=u&&(n.e++,h[0]==y&&(h[0]=1));break}if(h[d]+=u,h[d]!=y)break;h[d--]=0,u=1}for(s=h.length;0===h[--s];)h.pop()}return l&&(n.e>p.maxE?(n.d=null,n.e=NaN):n.e0?s=s.charAt(0)+"."+s.slice(1)+C(t):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(n.e<0?"e":"e+")+n.e):r<0?(s="0."+C(-r-1)+s,i&&(t=i-o)>0&&(s+=C(t))):r>=o?(s+=C(r+1-o),i&&(t=i-r-1)>0&&(s=s+"."+C(t))):((t=r+1)0&&(r+1===o&&(s+="."),s+=C(t))),s}function T(n,e){var i=n[0];for(e*=M;i>=10;i/=10)e++;return e}function U(n,e,i){if(e>q)throw l=!0,i&&(n.precision=i),Error(g);return R(new n(f),e,1,!0)}function _(n,e,i){if(e>O)throw Error(g);return R(new n(a),e,i,!0)}function k(n){var e=n.length-1,i=e*M+1;if(e=n[e]){for(;e%10==0;e/=10)i--;for(e=n[0];e>=10;e/=10)i++}return i}function C(n){for(var e="";n--;)e+="0";return e}function I(n,e,i,t){var r,s=new n(1),o=Math.ceil(t/M+4);for(l=!1;;){if(i%2&&X((s=s.times(e)).d,o)&&(r=!0),0===(i=w(i/2))){i=s.d.length-1,r&&0===s.d[i]&&++s.d[i];break}X((e=e.times(e)).d,o)}return l=!0,s}function H(n){return 1&n.d[n.d.length-1]}function B(n,e,i){for(var t,r=new n(e[0]),s=0;++s17)return new d(n.d?n.d[0]?n.s<0?0:1/0:1:n.s?n.s<0?0:n:NaN);for(null==e?(l=!1,c=g):c=e,u=new d(.03125);n.e>-2;)n=n.times(u),h+=5;for(c+=t=Math.log(v(2,h))/Math.LN10*2+5|0,i=s=o=new d(1),d.precision=c;;){if(s=R(s.times(n),c,1),i=i.times(++a),F((u=o.plus(P(s,i,c,1))).d).slice(0,c)===F(o.d).slice(0,c)){for(r=h;r--;)o=R(o.times(o),c,1);if(null!=e)return d.precision=g,o;if(!(f<3&&S(o.d,c-t,p,f)))return R(o,d.precision=g,p,l=!0);d.precision=c+=10,i=s=u=new d(1),a=0,f++}o=u}}function j(n,e){var i,t,r,s,o,u,c,f,a,h,d,p=1,g=n,m=g.d,w=g.constructor,v=w.rounding,N=w.precision;if(g.s<0||!m||!m[0]||!g.e&&1==m[0]&&1==m.length)return new w(m&&!m[0]?-1/0:1!=g.s?NaN:m?0:g);if(null==e?(l=!1,a=N):a=e,w.precision=a+=10,t=(i=F(m)).charAt(0),!(Math.abs(s=g.e)<15e14))return f=U(w,a+2,N).times(s+""),g=j(new w(t+"."+i.slice(1)),a-10).plus(f),w.precision=N,null==e?R(g,N,v,l=!0):g;for(;t<7&&1!=t||1==t&&i.charAt(1)>3;)t=(i=F((g=g.times(n)).d)).charAt(0),p++;for(s=g.e,t>1?(g=new w("0."+i),s++):g=new w(t+"."+i.slice(1)),h=g,c=o=g=P(g.minus(1),g.plus(1),a,1),d=R(g.times(g),a,1),r=3;;){if(o=R(o.times(d),a,1),F((f=c.plus(P(o,new w(r),a,1))).d).slice(0,a)===F(c.d).slice(0,a)){if(c=c.times(2),0!==s&&(c=c.plus(U(w,a+2,N).times(s+""))),c=P(c,new w(p),a,1),null!=e)return w.precision=N,c;if(!S(c.d,a-10,v,u))return R(c,w.precision=N,v,l=!0);w.precision=a+=10,f=o=g=P(h.minus(1),h.plus(1),a,1),d=R(g.times(g),a,1),r=u=1}c=f,r+=2}}function $(n){return String(n.s*n.s/0)}function W(n,e){var i,t,r;for((i=e.indexOf("."))>-1&&(e=e.replace(".","")),(t=e.search(/e/i))>0?(i<0&&(i=t),i+=+e.slice(t+1),e=e.substring(0,t)):i<0&&(i=e.length),t=0;48===e.charCodeAt(t);t++);for(r=e.length;48===e.charCodeAt(r-1);--r);if(e=e.slice(t,r)){if(r-=t,n.e=i=i-t-1,n.d=[],t=(i+1)%M,i<0&&(t+=M),tn.constructor.maxE?(n.d=null,n.e=NaN):n.e0?(f=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),u=(o=e.indexOf("."))>=0,r=n.constructor,u&&(o=(c=(e=e.replace(".","")).length)-o,s=I(r,new r(t),o,2*o)),o=h=(a=Z(e,t,y)).length-1;0===a[o];--o)a.pop();return o<0?new r(0*n.s):(n.e=T(a,h),n.d=a,l=!1,u&&(n=P(n,s,4*c)),f&&(n=n.times(Math.abs(f)<54?v(2,f):i.pow(2,f))),l=!0,n)}function z(n,e,i,t,r){var s,o,u,c,f=n.precision,a=Math.ceil(f/M);for(l=!1,c=i.times(i),u=new n(t);;){if(o=P(u.times(c),new n(e++*e++),f,1),u=r?t.plus(o):t.minus(o),t=P(o.times(c),new n(e++*e++),f,1),void 0!==(o=u.plus(t)).d[a]){for(s=a;o.d[s]===u.d[s]&&s--;);if(-1==s)break}s=u,u=t,t=o,o=s,0}return l=!0,o.d.length=a+1,o}function G(n,e){for(var i=n;--e;)i*=n;return i}function K(n,e){var i,t=e.s<0,r=_(n,n.precision,1),o=r.times(.5);if((e=e.abs()).lte(o))return s=t?4:1,e;if((i=e.divToInt(r)).isZero())s=t?3:2;else{if((e=e.minus(i.times(r))).lte(o))return s=H(i)?t?2:3:t?4:1,e;s=H(i)?t?1:4:t?3:2}return e.minus(r).abs()}function Q(n,e,i,r){var s,o,f,a,h,l,d,p,g,m=n.constructor,w=void 0!==i;if(w?(A(i,1,u),void 0===r?r=m.rounding:A(r,0,8)):(i=m.precision,r=m.rounding),n.isFinite()){for(w?(s=2,16==e?i=4*i-3:8==e&&(i=3*i-2)):s=e,(f=(d=L(n)).indexOf("."))>=0&&(d=d.replace(".",""),(g=new m(1)).e=d.length-f,g.d=Z(L(g),10,s),g.e=g.d.length),o=h=(p=Z(d,10,s)).length;0==p[--h];)p.pop();if(p[0]){if(f<0?o--:((n=new m(n)).d=p,n.e=o,p=(n=P(n,g,i,r,0,s)).d,o=n.e,l=t),f=p[i],a=s/2,l=l||void 0!==p[i+1],l=r<4?(void 0!==f||l)&&(0===r||r===(n.s<0?3:2)):f>a||f===a&&(4===r||l||6===r&&1&p[i-1]||r===(n.s<0?8:7)),p.length=i,l)for(;++p[--i]>s-1;)p[i]=0,i||(++o,p.unshift(1));for(h=p.length;!p[h-1];--h);for(f=0,d="";f1)if(16==e||8==e){for(f=16==e?4:3,--h;h%f;h++)d+="0";for(h=(p=Z(d,s,e)).length;!p[h-1];--h);for(f=1,d="1.";fh)for(o-=h;o--;)d+="0";else oe)return n.length=e,!0}function Y(n){return new this(n).abs()}function nn(n){return new this(n).acos()}function en(n){return new this(n).acosh()}function tn(n,e){return new this(n).plus(e)}function rn(n){return new this(n).asin()}function sn(n){return new this(n).asinh()}function on(n){return new this(n).atan()}function un(n){return new this(n).atanh()}function cn(n,e){n=new this(n),e=new this(e);var i,t=this.precision,r=this.rounding,s=t+4;return n.s&&e.s?n.d||e.d?!e.d||n.isZero()?(i=e.s<0?_(this,t,r):new this(0)).s=n.s:!n.d||e.isZero()?(i=_(this,s,1).times(.5)).s=n.s:e.s<0?(this.precision=s,this.rounding=1,i=this.atan(P(n,e,s,1)),e=_(this,s,1),this.precision=t,this.rounding=r,i=n.s<0?i.minus(e):i.plus(e)):i=this.atan(P(n,e,s,1)):(i=_(this,s,1).times(e.s>0?.25:.75)).s=n.s:i=new this(NaN),i}function fn(n){return new this(n).cbrt()}function an(n){return R(n=new this(n),n.e+1,2)}function hn(n){if(!n||"object"!=typeof n)throw Error(d+"Object expected");var e,i,t,r=!0===n.defaults,s=["precision",1,u,"rounding",0,8,"toExpNeg",-o,0,"toExpPos",0,o,"maxE",0,o,"minE",-o,0,"modulo",0,9];for(e=0;e=s[e+1]&&t<=s[e+2]))throw Error(p+i+": "+t);this[i]=t}if(i="crypto",r&&(this[i]=h[i]),void 0!==(t=n[i])){if(!0!==t&&!1!==t&&0!==t&&1!==t)throw Error(p+i+": "+t);if(t){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(m);this[i]=!0}else this[i]=!1}return this}function ln(n){return new this(n).cos()}function dn(n){return new this(n).cosh()}function pn(n,e){return new this(n).div(e)}function gn(n){return new this(n).exp()}function mn(n){return R(n=new this(n),n.e+1,3)}function wn(){var n,e,i=new this(0);for(l=!1,n=0;n=429e7?e[s]=crypto.getRandomValues(new Uint32Array(1))[0]:c[s++]=r%1e7;else{if(!crypto.randomBytes)throw Error(m);for(e=crypto.randomBytes(t*=4);s=214e7?crypto.randomBytes(4).copy(e,s):(c.push(r%1e7),s+=4);s=t/4}else for(;s=10;r/=10)t++;ts.maxE?(r.e=NaN,r.d=null):n.e=10;i/=10)e++;return void(l?e>s.maxE?(r.e=NaN,r.d=null):e=a&&x=0?"+":"")+o.toString()},exports.toExponential=function(e,n){return void 0!==n?e.toExponential(n-1):e.toExponential()},exports.toFixed=function(e,n){return e.toFixed(n)}; },{"../object":"FcSp"}],"PshC":[function(require,module,exports) { "use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(t)}function t(n){return(t="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)})(n)}var n=require("./number").format,e=require("./bignumber/formatter").format,o=require("./bignumber/isBigNumber");function i(r,t){if(Array.isArray(r)){for(var n="[",e=r.length,o=0;o/g,">")}; },{"./number":"uqMu","./bignumber/formatter":"bm1W","./bignumber/isBigNumber":"NR2f"}],"Dlkx":[function(require,module,exports) { "use strict";var t=require("../../utils/string").format,e=require("../../utils/object").lazy;function n(n,r,o,i,u){function a(t){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");n.isChain(t)?this.value=t.value:this.value=t}function p(t,e){"function"==typeof e&&(a.prototype[t]=f(e))}function f(t){return function(){for(var e=[this.value],n=0;n0&&r();break;case"number":n.im=0,n.re=i;break;default:r()}return isNaN(n.re)||isNaN(n.im),n};function h(i,t){if(!(this instanceof h))return new h(i,t);var n=a(i,t);this.re=n.re,this.im=n.im}h.prototype={re:0,im:0,sign:function(){var i=this.abs();return new h(this.re/i,this.im/i)},add:function(i,t){var n=new h(i,t);return this.isInfinite()&&n.isInfinite()?h.NAN:this.isInfinite()||n.isInfinite()?h.INFINITY:new h(this.re+n.re,this.im+n.im)},sub:function(i,t){var n=new h(i,t);return this.isInfinite()&&n.isInfinite()?h.NAN:this.isInfinite()||n.isInfinite()?h.INFINITY:new h(this.re-n.re,this.im-n.im)},mul:function(i,t){var n=new h(i,t);return this.isInfinite()&&n.isZero()||this.isZero()&&n.isInfinite()?h.NAN:this.isInfinite()||n.isInfinite()?h.INFINITY:0===n.im&&0===this.im?new h(this.re*n.re,0):new h(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(i,t){var n=new h(i,t);if(this.isZero()&&n.isZero()||this.isInfinite()&&n.isInfinite())return h.NAN;if(this.isInfinite()||n.isZero())return h.INFINITY;if(this.isZero()||n.isInfinite())return h.ZERO;i=this.re,t=this.im;var e,r,s=n.re,a=n.im;return 0===a?new h(i/s,t/s):Math.abs(s)=0)return new h(Math.pow(i,n.re),0);if(0===i)switch((n.re%4+4)%4){case 0:return new h(Math.pow(t,n.re),0);case 1:return new h(0,Math.pow(t,n.re));case 2:return new h(-Math.pow(t,n.re),0);case 3:return new h(0,-Math.pow(t,n.re))}}if(0===i&&0===t&&n.re>0&&n.im>=0)return h.ZERO;var e=Math.atan2(t,i),r=s(i,t);return i=Math.exp(n.re*r-n.im*e),t=n.im*r+n.re*e,new h(i*Math.cos(t),i*Math.sin(t))},sqrt:function(){var i,t,n=this.re,e=this.im,r=this.abs();if(n>=0){if(0===e)return new h(Math.sqrt(n),0);i=.5*Math.sqrt(2*(r+n))}else i=Math.abs(e)/Math.sqrt(2*(r-n));return t=n<=0?.5*Math.sqrt(2*(r-n)):Math.abs(e)/Math.sqrt(2*(r+n)),new h(i,e<0?-t:t)},exp:function(){var i=Math.exp(this.re);return this.im,new h(i*Math.cos(this.im),i*Math.sin(this.im))},expm1:function(){var i=this.re,t=this.im;return new h(Math.expm1(i)*Math.cos(t)+function(i){var t=Math.PI/4;if(i<-t||i>t)return Math.cos(i)-1;var n=i*i;return n*(n*(1/24+n*(-1/720+n*(1/40320+n*(-1/3628800+n*(1/4790014600+n*(-1/87178291200+n*(1/20922789888e3)))))))-.5)}(t),Math.exp(i)*Math.sin(t))},log:function(){var i=this.re,t=this.im;return new h(s(i,t),Math.atan2(t,i))},abs:function(){return i=this.re,t=this.im,n=Math.abs(i),e=Math.abs(t),n<3e3&&e<3e3?Math.sqrt(n*n+e*e):(n1&&0===t,e=1-i,r=1+i,a=e*e+t*t,u=0!==a?new h((r*e-t*t)/a,(t*e+r*t)/a):new h(-1!==i?i/0:0,0!==t?t/0:0),o=u.re;return u.re=s(u.re,u.im)/2,u.im=Math.atan2(u.im,o)/2,n&&(u.im=-u.im),u},acoth:function(){var i=this.re,t=this.im;if(0===i&&0===t)return new h(0,Math.PI/2);var n=i*i+t*t;return 0!==n?new h(i/n,-t/n).atanh():new h(0!==i?i/0:0,0!==t?-t/0:0).atanh()},acsch:function(){var i=this.re,t=this.im;if(0===t)return new h(0!==i?Math.log(i+Math.sqrt(i*i+1)):1/0,0);var n=i*i+t*t;return 0!==n?new h(i/n,-t/n).asinh():new h(0!==i?i/0:0,0!==t?-t/0:0).asinh()},asech:function(){var i=this.re,t=this.im;if(this.isZero())return h.INFINITY;var n=i*i+t*t;return 0!==n?new h(i/n,-t/n).acosh():new h(0!==i?i/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return h.INFINITY;if(this.isInfinite())return h.ZERO;var i=this.re,t=this.im,n=i*i+t*t;return new h(i/n,-t/n)},conjugate:function(){return new h(this.re,-this.im)},neg:function(){return new h(-this.re,-this.im)},ceil:function(i){return i=Math.pow(10,i||0),new h(Math.ceil(this.re*i)/i,Math.ceil(this.im*i)/i)},floor:function(i){return i=Math.pow(10,i||0),new h(Math.floor(this.re*i)/i,Math.floor(this.im*i)/i)},round:function(i){return i=Math.pow(10,i||0),new h(Math.round(this.re*i)/i,Math.round(this.im*i)/i)},equals:function(i,t){var n=new h(i,t);return Math.abs(n.re-this.re)<=h.EPSILON&&Math.abs(n.im-this.im)<=h.EPSILON},clone:function(){return new h(this.re,this.im)},toString:function(){var i=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isZero()?"0":this.isInfinite()?"Infinity":(0!==i&&(n+=i),0!==t&&(0!==i?n+=t<0?" - ":" + ":t<0&&(n+="-"),1!==(t=Math.abs(t))&&(n+=t),n+="i"),n||"0")},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.re&&-0!==this.re||0!==this.im&&-0!==this.im)},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},h.ZERO=new h(0,0),h.ONE=new h(1,0),h.I=new h(0,1),h.PI=new h(Math.PI,0),h.E=new h(Math.E,0),h.INFINITY=new h(1/0,1/0),h.NAN=new h(NaN,NaN),h.EPSILON=1e-16,"function"==typeof i&&i.amd?i([],function(){return h}):"object"==typeof exports?(Object.defineProperty(exports,"__esModule",{value:!0}),h.default=h,h.Complex=h,module.exports=h):t.Complex=h}(this); },{}],"dh9O":[function(require,module,exports) { "use strict";function t(r){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}function r(o){return(r="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(r){return t(r)}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":t(r)})(o)}var o=require("complex.js"),e=require("../../utils/number").format,n=require("../../utils/number").isNumber;function i(t,i,u,p,s){return o.prototype.type="Complex",o.prototype.isComplex=!0,o.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},o.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},o.prototype.format=function(t){var r=this.im,o=this.re,i=e(this.re,t),u=e(this.im,t),p=n(t)?t:t?t.precision:null;if(null!==p){var s=Math.pow(10,-p);Math.abs(o/r)r.re?1:t.rer.im?1:t.im1&&void 0!==arguments[1]?arguments[1]:{},l=c.preserveFormatting,a=void 0!==l&&l,o=c.escapeMapFn,s=void 0===o?r:o,u=String(i),g="",h=s(e({},t),a?e({},n):{}),v=Object.keys(h),f=function(){var e=!1;v.forEach(function(t,n){e||u.length>=t.length&&u.slice(0,t.length)===t&&(g+=h[v[n]],u=u.slice(t.length,u.length),e=!0)}),e||(g+=u.slice(0,1),u=u.slice(1,u.length))};u;)f();return g}; },{}],"H1Mr":[function(require,module,exports) { "use strict";var a=require("escape-latex");exports.symbols={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{?}"},exports.operators={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"},exports.defaultTemplate="\\mathrm{${name}}\\left(${args}\\right)";var t={deg:"^\\circ"};exports.escape=function(t){return a(t,{preserveFormatting:!0})},exports.toSymbol=function(a,e){return(e=void 0!==e&&e)?t.hasOwnProperty(a)?t[a]:"\\mathrm{"+exports.escape(a)+"}":exports.symbols.hasOwnProperty(a)?exports.symbols[a]:exports.escape(a)}; },{"escape-latex":"gC7Z"}],"V5uf":[function(require,module,exports) { "use strict";var r=require("../../../utils/collection/deepMap");function e(e,n,t,i){var o=require("../../../utils/latex"),u=i("complex",{"":function(){return e.Complex.ZERO},number:function(r){return new e.Complex(r,0)},"number, number":function(r,n){return new e.Complex(r,n)},"BigNumber, BigNumber":function(r,n){return new e.Complex(r.toNumber(),n.toNumber())},Complex:function(r){return r.clone()},string:function(r){return e.Complex(r)},null:function(r){return e.Complex(0)},Object:function(r){if("re"in r&&"im"in r)return new e.Complex(r.re,r.im);if("r"in r&&"phi"in r||"abs"in r&&"arg"in r)return new e.Complex(r);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":function(e){return r(e,u)}});return u.toTex={0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(o.symbols.i,"\\cdot\\left(${args[1]}\\right)\\right)")},u}exports.name="complex",exports.factory=e; },{"../../../utils/collection/deepMap":"lOYo","../../../utils/latex":"H1Mr"}],"Oad0":[function(require,module,exports) { "use strict";module.exports=[require("./Complex"),require("./function/complex")]; },{"./Complex":"dh9O","./function/complex":"V5uf"}],"TToH":[function(require,module,exports) { var define; var t;!function(n){"use strict";var i=2e3,s={s:1,n:0,d:1};function r(t){function n(){var n=Error.apply(this,arguments);n.name=this.name=t,this.stack=n.stack,this.message=n.message}function i(){}return i.prototype=Error.prototype,n.prototype=new i,n}var e=d.DivisionByZero=r("DivisionByZero"),h=d.InvalidParameter=r("InvalidParameter");function o(t,n){return isNaN(t=parseInt(t,10))&&a(),t*n}function a(){throw new h}var u=function(t,n){var i,r=0,h=1,u=1,f=0,d=0,c=0,N=1,l=1,w=0,p=1,v=1,M=1,b=1e7;if(null==t);else if(void 0!==n)u=(r=t)*(h=n);else switch(typeof t){case"object":"d"in t&&"n"in t?(r=t.n,h=t.d,"s"in t&&(r*=t.s)):0 in t?(r=t[0],1 in t&&(h=t[1])):a(),u=r*h;break;case"number":if(t<0&&(u=t,t=-t),t%1==0)r=t;else if(t>0){for(t>=1&&(t/=l=Math.pow(10,Math.floor(1+Math.log(t)/Math.LN10)));p<=b&&M<=b;){if(t===(i=(w+v)/(p+M))){p+M<=b?(r=w+v,h=p+M):M>p?(r=v,h=M):(r=w,h=p);break}t>i?(w+=v,p+=M):(v+=w,M+=p),p>b?(r=v,h=M):(r=w,h=p)}r*=l}else(isNaN(t)||isNaN(n))&&(h=r=NaN);break;case"string":if(null===(p=t.match(/\d+|./g))&&a(),"-"===p[w]?(u=-1,w++):"+"===p[w]&&w++,p.length===w+1?d=o(p[w++],u):"."===p[w+1]||"."===p[w]?("."!==p[w]&&(f=o(p[w++],u)),(++w+1===p.length||"("===p[w+1]&&")"===p[w+3]||"'"===p[w+1]&&"'"===p[w+3])&&(d=o(p[w],u),N=Math.pow(10,p[w].length),w++),("("===p[w]&&")"===p[w+2]||"'"===p[w]&&"'"===p[w+2])&&(c=o(p[w+1],u),l=Math.pow(10,p[w+1].length)-1,w+=3)):"/"===p[w+1]||":"===p[w+1]?(d=o(p[w],u),N=o(p[w+2],1),w+=3):"/"===p[w+3]&&" "===p[w+1]&&(f=o(p[w],u),d=o(p[w+2],u),N=o(p[w+4],1),w+=5),p.length<=w){u=r=c+(h=N*l)*f+l*d;break}default:a()}if(0===h)throw new e;s.s=u<0?-1:1,s.n=Math.abs(r),s.d=Math.abs(h)};function f(t,n){if(!t)return n;if(!n)return t;for(;;){if(!(t%=n))return n;if(!(n%=t))return t}}function d(t,n){if(!(this instanceof d))return new d(t,n);u(t,n),t=d.REDUCE?f(s.d,s.n):1,this.s=s.s,this.n=s.n/t,this.d=s.d/t}d.REDUCE=1,d.prototype={s:1,n:0,d:1,abs:function(){return new d(this.n,this.d)},neg:function(){return new d(-this.s*this.n,this.d)},add:function(t,n){return u(t,n),new d(this.s*this.n*s.d+s.s*this.d*s.n,this.d*s.d)},sub:function(t,n){return u(t,n),new d(this.s*this.n*s.d-s.s*this.d*s.n,this.d*s.d)},mul:function(t,n){return u(t,n),new d(this.s*s.s*this.n*s.n,this.d*s.d)},div:function(t,n){return u(t,n),new d(this.s*s.s*this.n*s.d,this.d*s.n)},clone:function(){return new d(this)},mod:function(t,n){return isNaN(this.n)||isNaN(this.d)?new d(NaN):void 0===t?new d(this.s*this.n%this.d,1):(u(t,n),0===s.n&&0===this.d&&d(0,0),new d(this.s*(s.d*this.n)%(s.n*this.d),s.d*this.d))},gcd:function(t,n){return u(t,n),new d(f(s.n,this.n)*f(s.d,this.d),s.d*this.d)},lcm:function(t,n){return u(t,n),0===s.n&&0===this.n?new d:new d(s.n*this.n,f(s.n,this.n)*f(s.d,this.d))},ceil:function(t){return t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d)?new d(NaN):new d(Math.ceil(t*this.s*this.n/this.d),t)},floor:function(t){return t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d)?new d(NaN):new d(Math.floor(t*this.s*this.n/this.d),t)},round:function(t){return t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d)?new d(NaN):new d(Math.round(t*this.s*this.n/this.d),t)},inverse:function(){return new d(this.s*this.d,this.n)},pow:function(t){return t<0?new d(Math.pow(this.s*this.d,-t),Math.pow(this.n,-t)):new d(Math.pow(this.s*this.n,t),Math.pow(this.d,t))},equals:function(t,n){return u(t,n),this.s*this.n*s.d==s.s*s.n*this.d},compare:function(t,n){u(t,n);var i=this.s*this.n*s.d-s.s*s.n*this.d;return(00&&(i+=n,i+=" ",s%=r),i+=s,i+="/",i+=r),i},toLatex:function(t){var n,i="",s=this.n,r=this.d;return this.s<0&&(i+="-"),1===r?i+=s:(t&&(n=Math.floor(s/r))>0&&(i+=n,s%=r),i+="\\frac{",i+=s,i+="}{",i+=r,i+="}"),i},toContinued:function(){var t,n=this.n,i=this.d,s=[];if(isNaN(this.n)||isNaN(this.d))return s;do{s.push(Math.floor(n/i)),t=n%i,n=i,i=t}while(1!==n);return s},toString:function(t){var n,s=this.n,r=this.d;if(isNaN(s)||isNaN(r))return"NaN";d.REDUCE||(s/=n=f(s,r),r/=n),t=t||15;var e=function(t,n){for(;n%2==0;n/=2);for(;n%5==0;n/=5);if(1===n)return 0;for(var s=10%n,r=1;1!==s;r++)if(s=10*s%n,r>i)return 0;return r}(0,r),h=function(t,n,i){for(var s=1,r=function(t,n,i){for(var s=1;n>0;t=t*t%i,n>>=1)1&n&&(s=s*t%i);return s}(10,i,n),e=0;e<300;e++){if(s===r)return e;s=10*s%n,r=10*r%n}return 0}(0,r,e),o=-1===this.s?"-":"";if(o+=s/r|0,s%=r,(s*=10)&&(o+="."),e){for(var a=h;a--;)o+=s/r|0,s%=r,s*=10;o+="(";for(a=e;a--;)o+=s/r|0,s%=r,s*=10;o+=")"}else for(a=t;s&&a--;)o+=s/r|0,s%=r,s*=10;return o}},"function"==typeof t&&t.amd?t([],function(){return d}):"object"==typeof exports?(Object.defineProperty(exports,"__esModule",{value:!0}),d.default=d,d.Fraction=d,module.exports=d):n.Fraction=d}(this); },{}],"ibo9":[function(require,module,exports) { "use strict";var t=require("fraction.js");function r(r,o,n,e){return t}t.prototype.type="Fraction",t.prototype.isFraction=!0,t.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},t.fromJSON=function(r){return new t(r)},exports.name="Fraction",exports.path="type",exports.factory=r; },{"fraction.js":"TToH"}],"CouR":[function(require,module,exports) { "use strict";var n=require("../../../utils/collection/deepMap");function r(r,t,e,i){var o=i("fraction",{number:function(n){if(!isFinite(n)||isNaN(n))throw new Error(n+" cannot be represented as a fraction");return new r.Fraction(n)},string:function(n){return new r.Fraction(n)},"number, number":function(n,t){return new r.Fraction(n,t)},null:function(n){return new r.Fraction(0)},BigNumber:function(n){return new r.Fraction(n.toString())},Fraction:function(n){return n},Object:function(n){return new r.Fraction(n)},"Array | Matrix":function(r){return n(r,o)}});return o}exports.name="fraction",exports.factory=r; },{"../../../utils/collection/deepMap":"lOYo"}],"sfyz":[function(require,module,exports) { "use strict";module.exports=[require("./Fraction"),require("./function/fraction")]; },{"./Fraction":"ibo9","./function/fraction":"CouR"}],"YiAw":[function(require,module,exports) { "use strict";function r(t,o,e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=o,this.relation=e,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(o)?"["+o.join(", ")+"]":o)+")",this.stack=(new Error).stack}r.prototype=new RangeError,r.prototype.constructor=RangeError,r.prototype.name="DimensionError",r.prototype.isDimensionError=!0,module.exports=r; },{}],"tfOV":[function(require,module,exports) { "use strict";function t(e,i,s){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=i):(this.min=i,this.max=s),void 0!==this.min&&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}t.prototype=new RangeError,t.prototype.constructor=RangeError,t.prototype.name="IndexError",t.prototype.isIndexError=!0,module.exports=t; },{}],"j2lF":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.size=i,exports.validate=f,exports.validateIndex=u,exports.resize=l,exports.reshape=h,exports.squeeze=p,exports.unsqueeze=A,exports.flatten=d,exports.map=v,exports.forEach=w,exports.filter=x,exports.filterRegExp=E,exports.join=m,exports.identify=z,exports.generalize=b;var r=o(require("./number")),e=o(require("./string")),t=o(require("../error/DimensionError")),n=o(require("../error/IndexError"));function o(r){return r&&r.__esModule?r:{default:r}}function i(r){for(var e=[];Array.isArray(r);)e.push(r.length),r=r[0];return e}function a(r,e,n){var o,i=r.length;if(i!==e[n])throw new t.default(i,e[n]);if(n")}function f(r,e){if(0===e.length){if(Array.isArray(r))throw new t.default(r.length,0)}else a(r,e,0)}function u(e,t){if(!r.default.isNumber(e)||!r.default.isInteger(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new n.default(e,t)}function l(t,n,o){if(!Array.isArray(t)||!Array.isArray(n))throw new TypeError("Array expected");if(0===n.length)throw new Error("Resizing to scalar is not supported");return n.forEach(function(t){if(!r.default.isNumber(t)||!r.default.isInteger(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+e.default.format(n)+")")}),s(t,n,0,void 0!==o?o:0),t}function s(r,e,t,n){var o,i,a=r.length,f=e[t],u=Math.min(a,f);if(r.length=f,ti[a]&&(i[a]=e[a],n=!0);n&&g(t,i,r)}return _.prototype=new y,_.prototype.type="DenseMatrix",_.prototype.isDenseMatrix=!0,_.prototype.getDataType=function(){return c(this._data)},_.prototype.storage=function(){return"dense"},_.prototype.datatype=function(){return this._datatype},_.prototype.create=function(t,e){return new _(t,e)},_.prototype.subset=function(t,r,o){switch(arguments.length){case 1:return function(t,r){if(!a.isIndex(r))throw new TypeError("Invalid index");if(r.isScalar())return t.get(r.min());var i=r.size();if(i.length!==t._size.length)throw new e(i.length,t._size.length);for(var n=r.min(),o=r.max(),s=0,h=t._size.length;s");var c=r.max().map(function(t){return t+1});w(t,c,s);var y=u.length;!function t(e,r,i,n,a){var o=a===n-1;var s=r.dimension(a);o?s.forEach(function(t,r){p(t),e[t]=i[r[0]]}):s.forEach(function(o,s){p(o),t(e[o],r,i[s[0]],n,a+1)})}(t._data,r,o,y,0)}return t}(this,t,r,o);default:throw new SyntaxError("Wrong number of arguments")}},_.prototype.get=function(t){if(!o(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new e(t.length,this._size.length);for(var r=0;r0?t:0,r=t<0?-t:0,i=this._size[0],n=this._size[1],o=Math.min(i-r,n-e),u=[],p=0;p0?r:0,c=r<0?-r:0,y=t[0],g=t[1],w=Math.min(y-c,g-l);if(o(e)){if(e.length!==w)throw new Error("Invalid value array length");f=function(t){return e[t]}}else if(a.isMatrix(e)){var z=e.size();if(1!==z.length||z[0]!==w)throw new Error("Invalid matrix length");f=function(t){return e.get([t])}}else f=function(){return e};n||(n=a.isBigNumber(f(0))?new a.BigNumber(0):0);var m=[];if(t.length>0){m=i.resize(m,t,n);for(var v=0;v0){var h=0;do{e._ptr.push(e._index.length);for(var _=0;_f){for(h=f;hl){if(u){var d=0;for(h=0;ht-1&&(e._values.splice(_,1),e._index.splice(_,1),w++)}e._ptr[h]=e._values.length}return e._size[0]=t,e._size[1]=r,e}function E(e,t,r,n,s){var a,o,h=n[0],p=n[1],_=[];for(a=0;a");for(var f=n.min()[0],v=n.min()[1],d=o[0],c=o[1],y=0;yo-1||s>h-1)&&(m(this,Math.max(n+1,o),Math.max(s+1,h),i),o=this._size[0],h=this._size[1]),_(n,o),_(s,h);var f=g(n,this._ptr[s],this._ptr[s+1],this._index);return f=t&&z<=r&&f(e._values[g],z-t,d-i)}else{for(var m={},E=y;E "+(this._values?n.format(this._values[p],e):"X")}return s},w.prototype.toString=function(){return n.format(this.toArray())},w.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},w.prototype.diagonal=function(e){if(e){if(u.isBigNumber(e)&&(e=e.toNumber()),!o(e)||!h(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,i=this._size[0],n=this._size[1],s=Math.min(i-r,n-t),a=[],p=[],_=[];_[0]=0;for(var l=t;l0?r:0,d=r<0?-r:0,y=e[0],x=e[1],g=Math.min(y-d,x-f);if(a(t)){if(t.length!==g)throw new Error("Invalid value array length");l=function(e){return t[e]}}else if(u.isMatrix(t)){var z=t.size();if(1!==z.length||z[0]!==g)throw new Error("Invalid matrix length");l=function(e){return t.get([e])}}else l=function(){return t};for(var m=[],E=[],b=[],S=0;S=0&&T=h||n[_]!==t)){var l=i?i[p]:void 0;n.splice(_,0,t),i&&i.splice(_,0,l),n.splice(_<=p?p+1:p,1),i&&i.splice(_<=p?p+1:p,1)}else if(_=h||n[p]!==e)){var f=i?i[_]:void 0;n.splice(p,0,e),i&&i.splice(p,0,f),n.splice(p<=_?_+1:_,1),i&&i.splice(p<=_?_+1:_,1)}}},u.Matrix._storage.sparse=w,w}exports.name="SparseMatrix",exports.path="type",exports.factory=u,exports.lazy=!1; },{"../../utils/index":"fsXI","../../error/DimensionError":"YiAw","./Matrix":"w7z6","../../function/relational/equalScalar":"QvIw","./utils/getArrayDataType":"XmtI"}],"vzj5":[function(require,module,exports) { "use strict";function r(r,t,n,i){var e=i("matrix",{"":function(){return a([])},string:function(r){return a([],r)},"string, string":function(r,t){return a([],r,t)},Array:function(r){return a(r)},Matrix:function(r){return a(r,r.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});return e.toTex={0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},e;function a(t,n,i){return new(r.Matrix.storage(n||"default"))(t,i)}}exports.name="matrix",exports.factory=r; },{}],"ZM3O":[function(require,module,exports) { "use strict";function n(n,r,e,t){var u=t("add",{"number, number":function(n,r){return n+r},"Complex, Complex":function(n,r){return n.add(r)},"BigNumber, BigNumber":function(n,r){return n.plus(r)},"Fraction, Fraction":function(n,r){return n.add(r)},"Unit, Unit":function(n,r){if(null===n.value||void 0===n.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(r))throw new Error("Units do not match");var e=n.clone();return e.value=u(e.value,r.value),e.fixPrefix=!1,e}});return u}exports.factory=n; },{}],"q1c8":[function(require,module,exports) { "use strict";var r=require("../../../error/DimensionError");function t(t,e,a,n){var i=t.DenseMatrix;return function(t,e,a,o){var s=t._data,f=t._size,h=t._datatype,p=e._values,d=e._index,m=e._ptr,u=e._size,v=e._datatype;if(f.length!==u.length)throw new r(f.length,u.length);if(f[0]!==u[0]||f[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+u+")");if(!p)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var x,_,g=f[0],w=f[1],c="string"==typeof h&&h===v?h:void 0,l=c?n.find(a,[c,c]):a,y=[];for(x=0;x0?function r(t,e,a,n,i,o){var s=[];if(e===a.length-1)for(var f=0;f0?function t(r,e,a,n,i,o,s){var f=[];if(e===a.length-1)for(var u=0;u=e&&(s(o.value,0)||a(o.key,o.value,this)),(o=i.extractMinimum())&&u.push(o);for(var h=0;he},"number, number":function(e,t){return e>t&&!r(e,t,n.epsilon)},"BigNumber, BigNumber":function(r,t){return r.gt(t)&&!e(r,t,n.epsilon)},"Fraction, Fraction":function(r,e){return 1===r.compare(e)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(r,e){if(!r.equalBase(e))throw new Error("Cannot compare units with different base");return m(r.value,e.value)},"SparseMatrix, SparseMatrix":function(r,e){return l(r,e,m)},"SparseMatrix, DenseMatrix":function(r,e){return o(e,r,m,!0)},"DenseMatrix, SparseMatrix":function(r,e){return o(r,e,m,!1)},"DenseMatrix, DenseMatrix":function(r,e){return f(r,e,m)},"Array, Array":function(r,e){return m(u(r),u(e)).valueOf()},"Array, Matrix":function(r,e){return m(u(r),e)},"Matrix, Array":function(r,e){return m(r,u(e))},"SparseMatrix, any":function(r,e){return s(r,e,m,!1)},"DenseMatrix, any":function(r,e){return c(r,e,m,!1)},"any, SparseMatrix":function(r,e){return s(e,r,m,!0)},"any, DenseMatrix":function(r,e){return c(e,r,m,!0)},"Array, any":function(r,e){return c(u(r),e,m,!1).valueOf()},"any, Array":function(r,e){return c(u(e),r,m,!0).valueOf()}});return m.toTex={2:"\\left(${args[0]}".concat(x.operators.larger,"${args[1]}\\right)")},m}exports.name="larger",exports.factory=t; },{"../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB","../../utils/latex":"H1Mr"}],"ifbV":[function(require,module,exports) { "use strict";function t(t,i,r,e){var h=r(require("../../function/relational/smaller")),n=r(require("../../function/relational/larger")),l=1/Math.log((1+Math.sqrt(5))/2);function o(){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function f(t,i,r){i.left.right=i.right,i.right.left=i.left,r.degree--,r.child===i&&(r.child=i.right),0===r.degree&&(r.child=null),i.left=t,i.right=t.right,t.right=i,i.right.left=i,i.parent=null,i.mark=!1}o.prototype.type="FibonacciHeap",o.prototype.isFibonacciHeap=!0,o.prototype.insert=function(t,i){var r={key:t,value:i,degree:0};if(this._minimum){var e=this._minimum;r.left=e,r.right=e.right,e.right=r,r.right.left=r,h(t,e.key)&&(this._minimum=r)}else r.left=r,r.right=r,this._minimum=r;return this._size++,r},o.prototype.size=function(){return this._size},o.prototype.clear=function(){this._minimum=null,this._size=0},o.prototype.isEmpty=function(){return 0===this._size},o.prototype.extractMinimum=function(){var t=this._minimum;if(null===t)return t;for(var i=this._minimum,r=t.degree,e=t.child;r>0;){var o=e.right;e.left.right=e.right,e.right.left=e.left,e.left=i,e.right=i.right,i.right=e,e.right.left=e,e.parent=null,e=o,r--}return t.left.right=t.right,t.right.left=t.left,i=t===t.right?null:function(t,i){var r,e=Math.floor(Math.log(i)*l)+1,o=new Array(e),f=0,u=t;if(u)for(f++,u=u.right;u!==t;)f++,u=u.right;for(;f>0;){for(var a=u.degree,m=u.right;r=o[a];){if(n(u.key,r.key)){var s=r;r=u,u=s}g(r,u),o[a]=null,a++}o[a]=u,u=m,f--}t=null;for(var c=0;c0?this.step>0?this.start:this.start+(t-1)*this.step:void 0},i.prototype.max=function(){var t=this.size()[0];return t>0?this.step>0?this.start+(t-1)*this.step:this.start:void 0},i.prototype.forEach=function(t){var r=this.start,e=this.step,n=this.end,s=0;if(e>0)for(;rn;)t(r,[s],this),r+=e,s++},i.prototype.map=function(t){var r=[];return this.forEach(function(e,n,s){r[n[0]]=t(e,n,s)}),r},i.prototype.toArray=function(){var t=[];return this.forEach(function(r,e){t[e[0]]=r}),t},i.prototype.valueOf=function(){return this.toArray()},i.prototype.format=function(r){var e=t.format(this.start,r);return 1!==this.step&&(e+=":"+t.format(this.step,r)),e+=":"+t.format(this.end,r)},i.prototype.toString=function(){return this.format()},i.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},i.fromJSON=function(t){return new i(t.start,t.end,t.step)},i}exports.name="Range",exports.path="type",exports.factory=r; },{"../../utils/number":"uqMu"}],"ChhM":[function(require,module,exports) { "use strict";function r(r,n,e,t){return t("index",{"...number | string | BigNumber | Range | Array | Matrix":function(n){var e=n.map(function(n){return r.isBigNumber(n)?n.toNumber():Array.isArray(n)||r.isMatrix(n)?n.map(function(n){return r.isBigNumber(n)?n.toNumber():n}):n}),t=new r.Index;return r.Index.apply(t,e),t}})}exports.name="index",exports.factory=r; },{}],"GmPR":[function(require,module,exports) { "use strict";function r(r,n,t,e){var s=r.SparseMatrix,a=e("sparse",{"":function(){return new s([])},string:function(r){return new s([],r)},"Array | Matrix":function(r){return new s(r)},"Array | Matrix, string":function(r,n){return new s(r,n)}});return a.toTex={0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},a}exports.name="sparse",exports.factory=r; },{}],"Xhzw":[function(require,module,exports) { "use strict";module.exports=[require("./Matrix"),require("./DenseMatrix"),require("./SparseMatrix"),require("./Spa"),require("./FibonacciHeap"),require("./ImmutableDenseMatrix"),require("./MatrixIndex"),require("./Range"),require("./function/index"),require("./function/matrix"),require("./function/sparse"),require("./utils/getArrayDataType")]; },{"./Matrix":"w7z6","./DenseMatrix":"bZ8L","./SparseMatrix":"armw","./Spa":"e3fS","./FibonacciHeap":"ifbV","./ImmutableDenseMatrix":"B6L6","./MatrixIndex":"SL3U","./Range":"rRNx","./function/index":"ChhM","./function/matrix":"vzj5","./function/sparse":"GmPR","./utils/getArrayDataType":"XmtI"}],"lESm":[function(require,module,exports) { "use strict";var r=require("./../utils/collection/deepMap");function n(n,t,e,u){var i=u("number",{"":function(){return 0},number:function(r){return r},string:function(r){if("NaN"===r)return NaN;var n=Number(r);if(isNaN(n))throw new SyntaxError('String "'+r+'" is no valid number');return n},BigNumber:function(r){return r.toNumber()},Fraction:function(r){return r.valueOf()},Unit:function(r){throw new Error("Second argument with valueless unit expected")},null:function(r){return 0},"Unit, string | Unit":function(r,n){return r.toNumber(n)},"Array | Matrix":function(n){return r(n,i)}});return i.toTex={0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},i}exports.name="number",exports.factory=n; },{"./../utils/collection/deepMap":"lOYo"}],"aA7E":[function(require,module,exports) { "use strict";function r(r,e,t,n){var i=t(require("../function/utils/typeof")),o={string:!0,number:!0,BigNumber:!0,Fraction:!0},u={number:t(require("./number")),BigNumber:t(require("./bignumber/function/bignumber")),Fraction:t(require("./fraction/function/fraction"))},c=function(r,e){var t=i(r);if(!(t in o))throw new TypeError("Cannot convert "+r+' of type "'+t+'"; valid input types are '+Object.keys(o).join(", "));if(!(e in u))throw new TypeError("Cannot convert "+r+' to type "'+e+'"; valid output types are '+Object.keys(u).join(", "));return e===t?r:u[e](r)};return c.toTex=function(r,e){return r.args[0].toTex()},c}exports.path="type",exports.name="_numeric",exports.factory=r; },{"../function/utils/typeof":"LZTG","./number":"lESm","./bignumber/function/bignumber":"ejiJ","./fraction/function/fraction":"CouR"}],"hpV8":[function(require,module,exports) { "use strict";function t(t,e,r,n){function o(t){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return o.prototype.type="ResultSet",o.prototype.isResultSet=!0,o.prototype.valueOf=function(){return this.entries},o.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},o.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},o.fromJSON=function(t){return new o(t.entries)},o}exports.name="ResultSet",exports.path="type",exports.factory=t; },{}],"seRb":[function(require,module,exports) { "use strict";module.exports=[require("./ResultSet")]; },{"./ResultSet":"hpV8"}],"QilD":[function(require,module,exports) { "use strict";var r=require("./../utils/collection/deepMap"),t=require("../utils/number");function n(n,e,u,i){var o=i("string",{"":function(){return""},number:t.format,null:function(r){return"null"},boolean:function(r){return r+""},string:function(r){return r},"Array | Matrix":function(t){return r(t,o)},any:function(r){return String(r)}});return o.toTex={0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},o}exports.name="string",exports.factory=n; },{"./../utils/collection/deepMap":"lOYo","../utils/number":"uqMu"}],"JQPe":[function(require,module,exports) { "use strict";var e=require("../function").memoize;function n(e){return e[0].precision}exports.e=e(function(e){return new e(1).exp()},n),exports.phi=e(function(e){return new e(1).plus(new e(5).sqrt()).div(2)},n),exports.pi=e(function(e){return e.acos(-1)},n),exports.tau=e(function(e){return exports.pi(e).times(2)},n); },{"../function":"woyg"}],"q5A1":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function n(n,e,t,u){var i=require("../../utils/latex"),o=u("unaryMinus",{number:function(r){return-r},Complex:function(r){return r.neg()},BigNumber:function(r){return r.neg()},Fraction:function(r){return r.neg()},Unit:function(r){var n=r.clone();return n.value=o(r.value),n},"Array | Matrix":function(n){return r(n,o,!0)}});return o.toTex={1:"".concat(i.operators.unaryMinus,"\\left(${args[0]}\\right)")},o}exports.name="unaryMinus",exports.factory=n; },{"../../utils/collection/deepMap":"lOYo","../../utils/latex":"H1Mr"}],"JNXe":[function(require,module,exports) { "use strict";var r=require("../../../error/DimensionError");function e(e,t,i,a){var n=i(require("../../../function/relational/equalScalar")),o=e.SparseMatrix;return function(e,t,i){var s=e._values,l=e._index,u=e._ptr,f=e._size,h=e._datatype,v=t._values,p=t._index,d=t._ptr,c=t._size,g=t._datatype;if(f.length!==c.length)throw new r(f.length,c.length);if(f[0]!==c[0]||f[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+c+")");var _,m=f[0],x=f[1],w=n,y=0,q=i;"string"==typeof h&&h===g&&(_=h,w=a.find(n,[_,_]),y=a.convert(0,_),q=a.find(i,[_,_]));var z,M,D,E,S=s&&v?[]:void 0,A=[],B=[],R=new o({values:S,index:A,ptr:B,size:[m,x],datatype:_}),b=S?[]:void 0,j=S?[]:void 0,k=[],C=[];for(M=0;Mq)for(var b=0,C=0;C=0||n.predictable?r.pow(e):new t.Complex(r.toNumber(),0).pow(e.toNumber(),0)},"Fraction, Fraction":function(r,e){if(1!==e.d){if(n.predictable)throw new Error("Function pow does not support non-integer exponents for fractions.");return c(r.valueOf(),e.valueOf())}return r.pow(e)},"Array, number":l,"Array, BigNumber":function(r,e){return l(r,e.toNumber())},"Matrix, number":w,"Matrix, BigNumber":function(r,e){return w(r,e.toNumber())},"Unit, number | BigNumber":function(r,e){return r.pow(e)}});function c(e,i){if(n.predictable&&!r(i)&&e<0)try{var o=m(i),u=s(o);if((i===u||Math.abs((i-u)/i)<1e-14)&&o.d%2==1)return(o.n%2==0?1:-1)*Math.pow(-e,i)}catch(a){}return e*e<1&&i===1/0||e*e>1&&i===-1/0?0:n.predictable&&(e<-1&&i===1/0||e>-1&&e<0&&i===-1/0)?NaN:r(i)||e>=0||n.predictable?Math.pow(e,i):new t.Complex(e,0).pow(i,0)}function l(t,n){if(!r(n)||n<0)throw new TypeError("For A^b, b must be a positive integer (value is "+n+")");var i=e(t);if(2!==i.length)throw new Error("For A^b, A must be 2 dimensional (A has "+i.length+" dimensions)");if(i[0]!==i[1])throw new Error("For A^b, A must be square (size is "+i[0]+"x"+i[1]+")");for(var o=a(i[0]).valueOf(),u=t;n>=1;)1==(1&n)&&(o=p(u,o)),n>>=1,u=p(u,u);return o}function w(r,e){return f(l(r.valueOf(),e))}return b.toTex={2:"\\left(${args[0]}\\right)".concat(u.operators.pow,"{${args[1]}}")},b}exports.name="pow",exports.factory=t; },{"../../utils/number":"uqMu","../../utils/array":"j2lF","../../utils/latex":"H1Mr","../matrix/identity":"zJUT","./multiply":"k7By","../../type/matrix/function/matrix":"vzj5","../../type/fraction/function/fraction":"CouR","../../type/number":"lESm"}],"K5X1":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function t(t,n,e,a){var u=a("abs",{number:Math.abs,Complex:function(r){return r.abs()},BigNumber:function(r){return r.abs()},Fraction:function(r){return r.abs()},"Array | Matrix":function(t){return r(t,u,!0)},Unit:function(r){return r.abs()}});return u.toTex={1:"\\left|${args[0]}\\right|"},u}exports.name="abs",exports.factory=t; },{"../../utils/collection/deepMap":"lOYo"}],"BAjv":[function(require,module,exports) { "use strict";var r=require("../../utils/number").isInteger,e=require("../../utils/array").resize;function t(t,n,i,u){var a=i(require("../../type/matrix/function/matrix")),o=u("zeros",{"":function(){return"Array"===n.matrix?f([]):f([],"default")},"...number | BigNumber | string":function(r){if("string"==typeof r[r.length-1]){var e=r.pop();return f(r,e)}return"Array"===n.matrix?f(r):f(r,"default")},Array:f,Matrix:function(r){var e=r.storage();return f(r.valueOf(),e)},"Array | Matrix, string":function(r,e){return f(r.valueOf(),e)}});return o.toTex=void 0,o;function f(n,i){var u=function(r){var e=!1;return r.forEach(function(r,n,i){t.isBigNumber(r)&&(e=!0,i[n]=r.toNumber())}),e}(n)?new t.BigNumber(0):0;if(function(e){e.forEach(function(e){if("number"!=typeof e||!r(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")})}(n),i){var o=a(i);return n.length>0?o.resize(n,u):o}var f=[];return n.length>0?e(f,n,u):f}}exports.name="zeros",exports.factory=t; },{"../../utils/number":"uqMu","../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5"}],"f25u":[function(require,module,exports) { "use strict";var r=require("../../utils/number").isInteger,e=require("../../utils/number").toFixed,n=require("../../utils/collection/deepMap"),t="Number of decimals in function round must be an integer";function u(e,u,o,m){var a=o(require("../../type/matrix/function/matrix")),c=o(require("../relational/equalScalar")),f=o(require("../matrix/zeros")),l=o(require("../../type/matrix/utils/algorithm11")),b=o(require("../../type/matrix/utils/algorithm12")),s=o(require("../../type/matrix/utils/algorithm14")),g=m("round",{number:function(r){return i(r,0)},"number, number":function(e,n){if(!r(n))throw new TypeError(t);if(n<0||n>15)throw new Error("Number of decimals in function round must be in te range of 0-15");return i(e,n)},Complex:function(r){return r.round()},"Complex, number":function(r,e){if(e%1)throw new TypeError(t);return r.round(e)},"Complex, BigNumber":function(r,e){if(!e.isInteger())throw new TypeError(t);var n=e.toNumber();return r.round(n)},"number, BigNumber":function(r,n){if(!n.isInteger())throw new TypeError(t);return new e.BigNumber(r).toDecimalPlaces(n.toNumber())},BigNumber:function(r){return r.toDecimalPlaces(0)},"BigNumber, BigNumber":function(r,e){if(!e.isInteger())throw new TypeError(t);return r.toDecimalPlaces(e.toNumber())},Fraction:function(r){return r.round()},"Fraction, number":function(r,e){if(e%1)throw new TypeError(t);return r.round(e)},"Array | Matrix":function(r){return n(r,g,!0)},"SparseMatrix, number | BigNumber":function(r,e){return l(r,e,g,!1)},"DenseMatrix, number | BigNumber":function(r,e){return s(r,e,g,!1)},"number | Complex | BigNumber, SparseMatrix":function(r,e){return c(r,0)?f(e.size(),e.storage()):b(e,r,g,!0)},"number | Complex | BigNumber, DenseMatrix":function(r,e){return c(r,0)?f(e.size(),e.storage()):s(e,r,g,!0)},"Array, number | BigNumber":function(r,e){return s(a(r),e,g,!1).valueOf()},"number | Complex | BigNumber, Array":function(r,e){return s(a(e),r,g,!0).valueOf()}});return g.toTex={1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},g}function i(r,n){return parseFloat(e(r,n))}exports.name="round",exports.factory=u; },{"../../utils/number":"uqMu","../../utils/collection/deepMap":"lOYo","../../type/matrix/function/matrix":"vzj5","../relational/equalScalar":"QvIw","../matrix/zeros":"BAjv","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm14":"S2eB"}],"CkRk":[function(require,module,exports) { "use strict";var e=require("../../utils/collection/deepMap"),r=require("../../utils/number").nearlyEqual,i=require("../../utils/bignumber/nearlyEqual");function n(n,t,u,l){var c=u(require("../../function/arithmetic/round")),o=l("ceil",{number:function(e){return r(e,c(e),t.epsilon)?c(e):Math.ceil(e)},Complex:function(e){return e.ceil()},BigNumber:function(e){return i(e,c(e),t.epsilon)?c(e):e.ceil()},Fraction:function(e){return e.ceil()},"Array | Matrix":function(r){return e(r,o,!0)}});return o.toTex={1:"\\left\\lceil${args[0]}\\right\\rceil"},o}exports.name="ceil",exports.factory=n; },{"../../utils/collection/deepMap":"lOYo","../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../function/arithmetic/round":"f25u"}],"Wigz":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap"),o=require("../../utils/number").nearlyEqual,e=require("../../utils/bignumber/nearlyEqual");function n(n,t,u,i){var l=u(require("../../function/arithmetic/round")),f=i("floor",{number:function(r){return o(r,l(r),t.epsilon)?l(r):Math.floor(r)},Complex:function(r){return r.floor()},BigNumber:function(r){return e(r,l(r),t.epsilon)?l(r):r.floor()},Fraction:function(r){return r.floor()},"Array | Matrix":function(o){return r(o,f,!0)}});return f.toTex={1:"\\left\\lfloor${args[0]}\\right\\rfloor"},f}exports.name="floor",exports.factory=n; },{"../../utils/collection/deepMap":"lOYo","../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../function/arithmetic/round":"f25u"}],"Pk2X":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function e(e,t,i,n){var o=i(require("../../function/arithmetic/ceil")),u=i(require("../../function/arithmetic/floor")),c=n("fix",{number:function(r){return r>0?u(r):o(r)},Complex:function(r){return new e.Complex(r.re>0?Math.floor(r.re):Math.ceil(r.re),r.im>0?Math.floor(r.im):Math.ceil(r.im))},BigNumber:function(r){return r.isNegative()?o(r):u(r)},Fraction:function(r){return r.s<0?r.ceil():r.floor()},"Array | Matrix":function(e){return r(e,c,!0)}});return c.toTex={1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},c}exports.name="fix",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo","../../function/arithmetic/ceil":"CkRk","../../function/arithmetic/floor":"Wigz"}],"IviB":[function(require,module,exports) { "use strict";function r(r,t,e,n){var a=e(require("../../type/matrix/function/matrix")),i=e(require("./equalScalar")),u=e(require("../../type/matrix/utils/algorithm03")),o=e(require("../../type/matrix/utils/algorithm07")),l=e(require("../../type/matrix/utils/algorithm12")),s=e(require("../../type/matrix/utils/algorithm13")),x=e(require("../../type/matrix/utils/algorithm14")),c=require("../../utils/latex"),f=n("equal",{"any, any":function(r,t){return null===r?null===t:null===t?null===r:void 0===r?void 0===t:void 0===t?void 0===r:i(r,t)},"SparseMatrix, SparseMatrix":function(r,t){return o(r,t,i)},"SparseMatrix, DenseMatrix":function(r,t){return u(t,r,i,!0)},"DenseMatrix, SparseMatrix":function(r,t){return u(r,t,i,!1)},"DenseMatrix, DenseMatrix":function(r,t){return s(r,t,i)},"Array, Array":function(r,t){return f(a(r),a(t)).valueOf()},"Array, Matrix":function(r,t){return f(a(r),t)},"Matrix, Array":function(r,t){return f(r,a(t))},"SparseMatrix, any":function(r,t){return l(r,t,i,!1)},"DenseMatrix, any":function(r,t){return x(r,t,i,!1)},"any, SparseMatrix":function(r,t){return l(t,r,i,!0)},"any, DenseMatrix":function(r,t){return x(t,r,i,!0)},"Array, any":function(r,t){return x(a(r),t,i,!1).valueOf()},"any, Array":function(r,t){return x(a(t),r,i,!0).valueOf()}});return f.toTex={2:"\\left(${args[0]}".concat(c.operators.equal,"${args[1]}\\right)")},f}exports.name="equal",exports.factory=r; },{"../../type/matrix/function/matrix":"vzj5","./equalScalar":"QvIw","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB","../../utils/latex":"H1Mr"}],"Rv38":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function e(e,n,t,i){var u=i("isNumeric",{"number | BigNumber | Fraction | boolean":function(){return!0},"Complex | Unit | string | null | undefined | Node":function(){return!1},"Array | Matrix":function(e){return r(e,u)}});return u}exports.name="isNumeric",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo"}],"A04Q":[function(require,module,exports) { "use strict";var r=require("../../utils/string");function t(t,o,a,e){var n=e("format",{any:r.format,"any, Object | function | number":r.format});return n.toTex=void 0,n}exports.name="format",exports.factory=t; },{"../../utils/string":"PshC"}],"zikE":[function(require,module,exports) { "use strict";function e(i){return(e="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})(i)}function i(n){return(i="function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?function(i){return e(i)}:function(i){return i&&"function"==typeof Symbol&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":e(i)})(n)}function n(){return(n=Object.assign||function(e){for(var i=1;i="0"&&e<="9"}function M(){m++,c=l.charAt(m)}function A(e){m=e,c=l.charAt(m)}function L(){var e,i="";if(e=m,"+"===c?M():"-"===c&&(i+=c,M()),!function(e){return e>="0"&&e<="9"||"."===e}(c))return A(e),null;if("."===c){if(i+=c,M(),!w(c))return A(e),null}else{for(;w(c);)i+=c,M();"."===c&&(i+=c,M())}for(;w(c);)i+=c,M();if("E"===c||"e"===c){var n="",a=m;if(n+=c,M(),"+"!==c&&"-"!==c||(n+=c,M()),!w(c))return A(a),i;for(i+=n;w(c);)i+=c,M()}return i}function I(){for(var e="",i=l.charCodeAt(m);i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122;)e+=c,M(),i=l.charCodeAt(m);return((i=e.charCodeAt(0))>=65&&i<=90||i>=97&&i<=122)&&e||null}function H(e){return c===e?(M(),e):null}function G(e){if(V.hasOwnProperty(e)){var i=V[e];return{unit:i,prefix:i.prefixes[""]}}for(var n in V)if(V.hasOwnProperty(n)&&a(e,n)){var t=V[n],s=e.length-n.length,r=e.substring(0,s),f=t.prefixes.hasOwnProperty(r)?t.prefixes[r]:void 0;if(void 0!==f)return{unit:t,prefix:f}}return null}function _(e){return e.equalBase(F.NONE)&&null!==e.value&&!r.predictable?e.value:e}C.prototype.type="Unit",C.prototype.isUnit=!0,C.parse=function(i,n){if(n=n||{},m=-1,c="","string"!=typeof(l=i))throw new TypeError("Invalid argument in Unit.parse, string expected");var a=new C;a.units=[];var t=1,s=!1;M(),U();var f=L(),o=null;f&&(o="BigNumber"===r.number?new e.BigNumber(f):"Fraction"===r.number?new e.Fraction(f):parseFloat(f),U(),H("*")?(t=1,s=!0):H("/")&&(t=-1,s=!0));for(var u=[],p=1;;){for(U();"("===c;)u.push(t),p*=t,t=1,M(),U();var v=void 0;if(!c)break;var E=c;if(null===(v=I()))throw new SyntaxError('Unexpected "'+E+'" in "'+l+'" at index '+m.toString());var N=G(v);if(null===N)throw new SyntaxError('Unit "'+v+'" not found.');var h=t*p;if(U(),H("^")){U();var O=L();if(null===O)throw new SyntaxError('In "'+i+'", "^" must be followed by a floating-point number');h*=O}a.units.push({unit:N.unit,prefix:N.prefix,power:h});for(var b=0;b1||Math.abs(this.units[0].power-1)>1e-15)},C.prototype._normalize=function(e){var i,n,a,t,s;if(null==e||0===this.units.length)return e;if(this._isDerived()){var r=e;s=C._getNumberConverter(R(e));for(var f=0;f1e-12)return!1;return!0},C.prototype.equalBase=function(e){for(var i=0;i1e-12)return!1;return!0},C.prototype.equals=function(e){return this.equalBase(e)&&d(this.value,e.value)},C.prototype.multiply=function(e){for(var i=this.clone(),n=0;n1e-12&&(W.hasOwnProperty(f)?a.push({unit:W[f].unit,prefix:W[f].prefix,power:n.dimensions[r]||0}):s=!0)}a.length1e-12){if(!D.si.hasOwnProperty(a))throw new Error("Cannot express custom unit "+a+" in SI units");i.push({unit:D.si[a].unit,prefix:D.si[a].prefix,power:e.dimensions[n]||0})}}return e.units=i,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,e},C.prototype.formatUnits=function(){for(var e="",i="",n=0,a=0,t=0;t0?(n++,e+=" "+this.units[t].prefix.name+this.units[t].unit.name,Math.abs(this.units[t].power-1)>1e-15&&(e+="^"+this.units[t].power)):this.units[t].power<0&&a++;if(a>0)for(var s=0;s0?(i+=" "+this.units[s].prefix.name+this.units[s].unit.name,Math.abs(this.units[s].power+1)>1e-15&&(i+="^"+-this.units[s].power)):(i+=" "+this.units[s].prefix.name+this.units[s].unit.name,i+="^"+this.units[s].power));e=e.substr(1),i=i.substr(1),n>1&&a>0&&(e="("+e+")"),a>1&&n>0&&(i="("+i+")");var r=e;return n>0&&a>0&&(r+=" / "),r+=i},C.prototype.format=function(i){var n=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),a=!1;for(var t in void 0!==n.value&&null!==n.value&&e.isComplex(n.value)&&(a=Math.abs(n.value.re)<1e-14),n.units)n.units[t].unit&&("VA"===n.units[t].unit.name&&a?n.units[t].unit=V.VAR:"VAR"!==n.units[t].unit.name||a||(n.units[t].unit=V.VA));1!==n.units.length||n.fixPrefix||Math.abs(n.units[0].power-Math.round(n.units[0].power))<1e-14&&(n.units[0].prefix=n._bestPrefix());var s=n._denormalize(n.value),r=null!==n.value?S(s,i||{}):"",f=n.formatUnits();return n.value&&e.isComplex(n.value)&&(r="("+r+")"),f.length>0&&r.length>0&&(r+=" "),r+=f},C.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?O(this.value):0,i=O(this.units[0].unit.value),n=this.units[0].prefix;if(0===e)return n;var a=this.units[0].power,t=Math.log(e/Math.pow(n.value*i,a))/Math.LN10-1.2;if(t>-2.200001&&t<1.800001)return n;t=Math.abs(t);var s=this.units[0].unit.prefixes;for(var r in s)if(s.hasOwnProperty(r)){var f=s[r];if(f.scientific){var o=Math.abs(Math.log(e/Math.pow(f.value*i,a))/Math.LN10-1.2);(o0&&!(a(n)||(t=n,t>="0"&&t<="9")))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}var t}(e);var t,s,r=null,f=[],o=0;if(n&&"Unit"===n.type)r=n.clone();else if("string"==typeof n)""!==n&&(t=n);else{if("object"!==i(n))throw new TypeError('Cannot create unit "'+e+'" from "'+n.toString()+'": expecting "string" or "Unit" or "Object"');t=n.definition,s=n.prefixes,o=n.offset,n.aliases&&(f=n.aliases.valueOf())}if(f)for(var u=0;u1e-12){p=!1;break}if(p){m=!0,l.base=F[c];break}}if(!m){var E=e+"_STUFF",N={dimensions:r.dimensions.slice(0)};N.key=E,F[E]=N,W[E]={unit:l,prefix:P.NONE[""]},l.base=F[E]}}else{var h=e+"_STUFF";if(k.indexOf(h)>=0)throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');for(var O in k.push(h),F)F.hasOwnProperty(O)&&(F[O].dimensions[k.length-1]=0);for(var b={dimensions:[]},x=0;xa)for(var c=a-1,x=u.length;c)'),e+this.index.toHTML(t)},c.prototype._toTex=function(t){var e=this.object.toTex(t);return h(this.object)&&(e="\\left(' + object + '\\right)"),e+this.index.toTex(t)},c.prototype.toJSON=function(){return{mathjs:"AccessorNode",object:this.object,index:this.index}},c.fromJSON=function(t){return new c(t.object,t.index)},c}exports.name="AccessorNode",exports.path="expression.node",exports.factory=e; },{"../../utils/customs":"PAPk","./Node":"dnbo","./utils/access":"oT9r"}],"onTs":[function(require,module,exports) { "use strict";var t=require("../../utils/array").map;function r(r,e,n,i){var o=n(require("./Node"));function s(t){if(!(this instanceof s))throw new SyntaxError("Constructor must be called with the new operator");if(this.items=t||[],!Array.isArray(this.items)||!this.items.every(r.isNode))throw new TypeError("Array containing Nodes expected");var e=function(){throw new Error("Property `ArrayNode.nodes` is deprecated, use `ArrayNode.items` instead")};Object.defineProperty(this,"nodes",{get:e,set:e})}return s.prototype=new o,s.prototype.type="ArrayNode",s.prototype.isArrayNode=!0,s.prototype._compile=function(r,e){var n=t(this.items,function(t){return t._compile(r,e)});if("Array"!==r.config().matrix){var i=r.matrix;return function(r,e,o){return i(t(n,function(t){return t(r,e,o)}))}}return function(r,e,i){return t(n,function(t){return t(r,e,i)})}},s.prototype.forEach=function(t){for(var r=0;r['+this.items.map(function(r){return r.toHTML(t)}).join(',')+']'},s.prototype._toTex=function(t){var r="\\begin{bmatrix}";return this.items.forEach(function(e){e.items?r+=e.items.map(function(r){return r.toTex(t)}).join("&"):r+=e.toTex(t),r+="\\\\"}),r+="\\end{bmatrix}"},s}exports.name="ArrayNode",exports.path="expression.node",exports.factory=r; },{"../../utils/array":"j2lF","./Node":"dnbo"}],"ft5y":[function(require,module,exports) { "use strict";function t(r){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}function r(o){return(r="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(r){return t(r)}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":t(r)})(o)}var o=require("../../transform/error.transform").transform,e=require("../../../utils/customs").setSafeProperty;function n(t,n,u,y){var i=u(require("../../../function/matrix/subset")),f=u(require("../../../type/matrix/function/matrix"));return function(t,n,u){try{if(Array.isArray(t))return f(t).subset(n,u).valueOf();if(t&&"function"==typeof t.subset)return t.subset(n,u);if("string"==typeof t)return i(t,n,u);if("object"===r(t)){if(!n.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return e(t,n.getObjectProperty(),u),t}throw new TypeError("Cannot apply index: unsupported type of object")}catch(y){throw o(y)}}}exports.factory=n; },{"../../transform/error.transform":"Bjol","../../../utils/customs":"PAPk","../../../function/matrix/subset":"ZWbZ","../../../type/matrix/function/matrix":"vzj5"}],"Huid":[function(require,module,exports) { "use strict";var t=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{associativity:"left",associativeWith:[]}},{"OperatorNode:and":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{associativity:"left",associativeWith:[]},"OperatorNode:unequal":{associativity:"left",associativeWith:[]},"OperatorNode:smaller":{associativity:"left",associativeWith:[]},"OperatorNode:larger":{associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{associativity:"left",associativeWith:[]}},{"OperatorNode:to":{associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{associativity:"left",associativeWith:[]},"OperatorNode:mod":{associativity:"left",associativeWith:[]}},{"OperatorNode:unaryPlus":{associativity:"right"},"OperatorNode:unaryMinus":{associativity:"right"},"OperatorNode:bitNot":{associativity:"right"},"OperatorNode:not":{associativity:"right"}},{"OperatorNode:pow":{associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{associativity:"left"}},{"OperatorNode:transpose":{associativity:"left"}}];function i(i,e){var a=i;"keep"!==e&&(a=i.getContent());for(var o=a.getIdentifier(),r=0;r)'),t+i+'='+o},u.prototype._toTex=function(e){var t=this.object.toTex(e),i=this.index?this.index.toTex(e):"",o=this.value.toTex(e);return p(this,e&&e.parenthesis)&&(o="\\left(".concat(o,"\\right)")),t+i+":="+o},u}exports.name="AssignmentNode",exports.path="expression.node",exports.factory=i; },{"../../utils/customs":"PAPk","./Node":"dnbo","./utils/assign":"ft5y","./utils/access":"oT9r","../operators":"Huid"}],"QBkn":[function(require,module,exports) { "use strict";var o=require("../../utils/array").forEach,e=require("../../utils/array").map;function t(t,r,n,i){var s=n(require("./Node")),p=n(require("../../type/resultset/ResultSet"));function a(o){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(o))throw new Error("Array expected");this.blocks=o.map(function(o){var e=o&&o.node,r=!o||void 0===o.visible||o.visible;if(!t.isNode(e))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof r)throw new TypeError('Property "visible" must be a boolean');return{node:e,visible:r}})}return a.prototype=new s,a.prototype.type="BlockNode",a.prototype.isBlockNode=!0,a.prototype._compile=function(t,r){var n=e(this.blocks,function(o){return{eval:o.node._compile(t,r),visible:o.visible}});return function(e,t,r){var i=[];return o(n,function(o){var n=o.eval(e,t,r);o.visible&&i.push(n)}),new p(i)}},a.prototype.forEach=function(o){for(var e=0;e;')}).join('
')},a.prototype._toTex=function(o){return this.blocks.map(function(e){return e.node.toTex(o)+(e.visible?"":";")}).join("\\;\\;\n")},a}exports.name="BlockNode",exports.path="expression.node",exports.factory=t; },{"../../utils/array":"j2lF","./Node":"dnbo","../../type/resultset/ResultSet":"hpV8"}],"uzAW":[function(require,module,exports) { "use strict";var t=require("../operators");function e(e,r,o,i){var n=o(require("./Node")),s=o(require("../../function/utils/typeof"));function p(t,r,o){if(!(this instanceof p))throw new SyntaxError("Constructor must be called with the new operator");if(!e.isNode(t))throw new TypeError("Parameter condition must be a Node");if(!e.isNode(r))throw new TypeError("Parameter trueExpr must be a Node");if(!e.isNode(o))throw new TypeError("Parameter falseExpr must be a Node");this.condition=t,this.trueExpr=r,this.falseExpr=o}return p.prototype=new n,p.prototype.type="ConditionalNode",p.prototype.isConditionalNode=!0,p.prototype._compile=function(t,r){var o=this.condition._compile(t,r),i=this.trueExpr._compile(t,r),n=this.falseExpr._compile(t,r);return function(t,r,p){return function(t){if("number"==typeof t||"boolean"==typeof t||"string"==typeof t)return!!t;if(t){if(e.isBigNumber(t))return!t.isZero();if(e.isComplex(t))return!(!t.re&&!t.im);if(e.isUnit(t))return!!t.value}if(null==t)return!1;throw new TypeError('Unsupported type of condition "'+s(t)+'"')}(o(t,r,p))?i(t,r,p):n(t,r,p)}},p.prototype.forEach=function(t){t(this.condition,"condition",this),t(this.trueExpr,"trueExpr",this),t(this.falseExpr,"falseExpr",this)},p.prototype.map=function(t){return new p(this._ifNode(t(this.condition,"condition",this)),this._ifNode(t(this.trueExpr,"trueExpr",this)),this._ifNode(t(this.falseExpr,"falseExpr",this)))},p.prototype.clone=function(){return new p(this.condition,this.trueExpr,this.falseExpr)},p.prototype._toString=function(e){var r=e&&e.parenthesis?e.parenthesis:"keep",o=t.getPrecedence(this,r),i=this.condition.toString(e),n=t.getPrecedence(this.condition,r);("all"===r||"OperatorNode"===this.condition.type||null!==n&&n<=o)&&(i="("+i+")");var s=this.trueExpr.toString(e),p=t.getPrecedence(this.trueExpr,r);("all"===r||"OperatorNode"===this.trueExpr.type||null!==p&&p<=o)&&(s="("+s+")");var a=this.falseExpr.toString(e),h=t.getPrecedence(this.falseExpr,r);return("all"===r||"OperatorNode"===this.falseExpr.type||null!==h&&h<=o)&&(a="("+a+")"),i+" ? "+s+" : "+a},p.prototype.toJSON=function(){return{mathjs:"ConditionalNode",condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}},p.fromJSON=function(t){return new p(t.condition,t.trueExpr,t.falseExpr)},p.prototype.toHTML=function(e){var r=e&&e.parenthesis?e.parenthesis:"keep",o=t.getPrecedence(this,r),i=this.condition.toHTML(e),n=t.getPrecedence(this.condition,r);("all"===r||"OperatorNode"===this.condition.type||null!==n&&n<=o)&&(i='('+i+')');var s=this.trueExpr.toHTML(e),p=t.getPrecedence(this.trueExpr,r);("all"===r||"OperatorNode"===this.trueExpr.type||null!==p&&p<=o)&&(s='('+s+')');var a=this.falseExpr.toHTML(e),h=t.getPrecedence(this.falseExpr,r);return("all"===r||"OperatorNode"===this.falseExpr.type||null!==h&&h<=o)&&(a='('+a+')'),i+'?'+s+':'+a},p.prototype._toTex=function(t){return"\\begin{cases} {"+this.trueExpr.toTex(t)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(t)+"}\\\\{"+this.falseExpr.toTex(t)+"}, &\\quad{\\text{otherwise}}\\end{cases}"},p}exports.name="ConditionalNode",exports.path="expression.node",exports.factory=e; },{"../operators":"Huid","./Node":"dnbo","../../function/utils/typeof":"LZTG"}],"MNuy":[function(require,module,exports) { "use strict";var t=require("../../utils/string").format,e=require("../../utils/latex").escape;function n(n,r,o,a){var s=o(require("./Node")),u=o(require("../../function/utils/typeof"));function i(t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(2===arguments.length)throw new SyntaxError("new ConstantNode(valueStr, valueType) is not supported anymore since math v4.0.0. Use new ConstantNode(value) instead, where value is a non-stringified value.");this.value=t}return i.prototype=new s,i.prototype.type="ConstantNode",i.prototype.isConstantNode=!0,i.prototype._compile=function(t,e){var n=this.value;return function(){return n}},i.prototype.forEach=function(t){},i.prototype.map=function(t){return this.clone()},i.prototype.clone=function(){return new i(this.value)},i.prototype._toString=function(e){return t(this.value,e)},i.prototype.toHTML=function(t){var e=this._toString(t);switch(u(this.value)){case"number":case"BigNumber":case"Fraction":return''+e+"";case"string":return''+e+"";case"boolean":return''+e+"";case"null":return''+e+"";case"undefined":return''+e+"";default:return''+e+""}},i.prototype.toJSON=function(){return{mathjs:"ConstantNode",value:this.value}},i.fromJSON=function(t){return new i(t.value)},i.prototype._toTex=function(t){var n=this._toString(t);switch(u(this.value)){case"string":return"\\mathtt{"+e(n)+"}";case"number":case"BigNumber":var r=n.toLowerCase().indexOf("e");return-1!==r?n.substring(0,r)+"\\cdot10^{"+n.substring(r+1)+"}":n;case"Fraction":return this.value.toLatex();default:return n}},i}exports.name="ConstantNode",exports.path="expression.node",exports.factory=n; },{"../../utils/string":"PshC","../../utils/latex":"H1Mr","./Node":"dnbo","../../function/utils/typeof":"LZTG"}],"PrPs":[function(require,module,exports) { "use strict";var e=require("../keywords"),t=require("../../utils/string").escape,r=require("../../utils/array").forEach,a=require("../../utils/array").join,s=require("../../utils/latex"),n=require("../operators"),i=require("../../utils/customs").setSafeProperty;function o(o,p,h,m){var u=h(require("./Node"));function c(t,r,a){if(!(this instanceof c))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof t)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(r))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!o.isNode(a))throw new TypeError('Node expected for parameter "expr"');if(t in e)throw new Error('Illegal function name, "'+t+'" is a reserved keyword');this.name=t,this.params=r.map(function(e){return e&&e.name||e}),this.types=r.map(function(e){return e&&e.type||"any"}),this.expr=a}function f(e,t){var r=n.getPrecedence(e,t),a=n.getPrecedence(e.expr,t);return"all"===t||null!==a&&a<=r}return c.prototype=new u,c.prototype.type="FunctionAssignmentNode",c.prototype.isFunctionAssignmentNode=!0,c.prototype._compile=function(e,t){var s=Object.create(t);r(this.params,function(e){s[e]=!0});var n=this.expr._compile(e,s),o=this.name,p=this.params,h=a(this.types,","),u=o+"("+a(this.params,", ")+")";return function(e,t,r){var a={};a[h]=function(){for(var a=Object.create(t),s=0;s'+t(this.params[s])+"");var n=this.expr.toHTML(e);return f(this,r)&&(n='('+n+')'),''+t(this.name)+'('+a.join(',')+')='+n},c.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=this.expr.toTex(e);return f(this,t)&&(r="\\left(".concat(r,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(s.toSymbol).join(",")+"\\right):="+r},c}exports.name="FunctionAssignmentNode",exports.path="expression.node",exports.factory=o; },{"../keywords":"psm5","../../utils/string":"PshC","../../utils/array":"j2lF","../../utils/latex":"H1Mr","../operators":"Huid","../../utils/customs":"PAPk","./Node":"dnbo"}],"SN5L":[function(require,module,exports) { "use strict";var t=require("../../utils/array").map,e=require("../../utils/string").escape;function n(n,o,r,i){var s=r(require("./Node")),a=r(require("../../type/matrix/Range")),p=Array.isArray;function c(t,e){if(!(this instanceof c))throw new SyntaxError("Constructor must be called with the new operator");if(this.dimensions=t,this.dotNotation=e||!1,!p(t)||!t.every(n.isNode))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties");var o=function(){throw new Error("Property `IndexNode.object` is deprecated, use `IndexNode.fn` instead")};Object.defineProperty(this,"object",{get:o,set:o})}function u(t,e,o){return new a(n.isBigNumber(t)?t.toNumber():t,n.isBigNumber(e)?e.toNumber():e,n.isBigNumber(o)?o.toNumber():o)}return c.prototype=new s,c.prototype.type="IndexNode",c.prototype.isIndexNode=!0,c.prototype._compile=function(e,o){var r=t(this.dimensions,function(t,r){if(n.isRangeNode(t)){if(t.needsEnd()){var i=Object.create(o);i.end=!0;var s=t.start._compile(e,i),a=t.end._compile(e,i),p=t.step?t.step._compile(e,i):function(){return 1};return function(t,n,o){var i=e.size(o).valueOf(),c=Object.create(n);return c.end=i[r],u(s(t,c,o),a(t,c,o),p(t,c,o))}}var c=t.start._compile(e,o),d=t.end._compile(e,o),h=t.step?t.step._compile(e,o):function(){return 1};return function(t,e,n){return u(c(t,e,n),d(t,e,n),h(t,e,n))}}if(n.isSymbolNode(t)&&"end"===t.name){var m=Object.create(o);m.end=!0;var f=t._compile(e,m);return function(t,n,o){var i=e.size(o).valueOf(),s=Object.create(n);return s.end=i[r],f(t,s,o)}}var y=t._compile(e,o);return function(t,e,n){return y(t,e,n)}});return function(n,o,i){var s=t(r,function(t){return t(n,o,i)});return e.index.apply(e,s)}},c.prototype.forEach=function(t){for(var e=0;e.'+e(this.getObjectProperty())+"":'['+n.join(',')+']'},c.prototype._toTex=function(t){var e=this.dimensions.map(function(e){return e.toTex(t)});return this.dotNotation?"."+this.getObjectProperty():"_{"+e.join(",")+"}"},c}exports.name="IndexNode",exports.path="expression.node",exports.factory=n; },{"../../utils/array":"j2lF","../../utils/string":"PshC","./Node":"dnbo","../../type/matrix/Range":"rRNx"}],"UI2T":[function(require,module,exports) { "use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(t)}function t(e){return(t="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)})(e)}var e=require("../../utils/string").stringify,o=require("../../utils/string").escape,p=require("../../utils/customs").isSafeProperty,s=require("../../utils/object").hasOwnProperty;function i(r,i,n,a){var h=n(require("./Node"));function u(e){if(!(this instanceof u))throw new SyntaxError("Constructor must be called with the new operator");if(this.properties=e||{},e&&("object"!==t(e)||!Object.keys(e).every(function(t){return r.isNode(e[t])})))throw new TypeError("Object containing Nodes expected")}return u.prototype=new h,u.prototype.type="ObjectNode",u.prototype.isObjectNode=!0,u.prototype._compile=function(r,t){var o={};for(var i in this.properties)if(s(this.properties,i)){var n=e(i),a=JSON.parse(n);if(!p(this.properties,a))throw new Error('No access to property "'+a+'"');o[a]=this.properties[i]._compile(r,t)}return function(r,t,e){var p={};for(var i in o)s(o,i)&&(p[i]=o[i](r,t,e));return p}},u.prototype.forEach=function(r){for(var t in this.properties)this.properties.hasOwnProperty(t)&&r(this.properties[t],"properties["+e(t)+"]",this)},u.prototype.map=function(r){var t={};for(var o in this.properties)this.properties.hasOwnProperty(o)&&(t[o]=this._ifNode(r(this.properties[o],"properties["+e(o)+"]",this)));return new u(t)},u.prototype.clone=function(){var r={};for(var t in this.properties)this.properties.hasOwnProperty(t)&&(r[t]=this.properties[t]);return new u(r)},u.prototype._toString=function(r){var t=[];for(var o in this.properties)this.properties.hasOwnProperty(o)&&t.push(e(o)+": "+this.properties[o].toString(r));return"{"+t.join(", ")+"}"},u.prototype.toJSON=function(){return{mathjs:"ObjectNode",properties:this.properties}},u.fromJSON=function(r){return new u(r.properties)},u.prototype.toHTML=function(r){var t=[];for(var e in this.properties)this.properties.hasOwnProperty(e)&&t.push(''+o(e)+':'+this.properties[e].toHTML(r));return'{'+t.join(',')+'}'},u.prototype._toTex=function(r){var t=[];for(var e in this.properties)this.properties.hasOwnProperty(e)&&t.push("\\mathbf{"+e+":} & "+this.properties[e].toTex(r)+"\\\\");return"\\left\\{\\begin{array}{ll}".concat(t.join("\n"),"\\end{array}\\right\\}")},u}exports.name="ObjectNode",exports.path="expression.node",exports.factory=i; },{"../../utils/string":"PshC","../../utils/customs":"PAPk","../../utils/object":"FcSp","./Node":"dnbo"}],"F3sc":[function(require,module,exports) { "use strict";var t=require("../../utils/latex"),e=require("../../utils/array").map,r=require("../../utils/string").escape,i=require("../../utils/customs").isSafeMethod,n=require("../../utils/customs").getSafeProperty,a=require("../operators");function s(s,o,p,h){var c=p(require("./Node"));function l(t,e,r,i){if(!(this instanceof l))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof t)throw new TypeError('string expected for parameter "op"');if("string"!=typeof e)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(r)||!r.every(s.isNode))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===i,this.op=t,this.fn=e,this.args=r||[]}function f(t,e,r,i,n){var s,o=a.getPrecedence(t,e),p=a.getAssociativity(t,e);if("all"===e||i.length>2&&"OperatorNode:add"!==t.getIdentifier()&&"OperatorNode:multiply"!==t.getIdentifier())return i.map(function(t){switch(t.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});switch(i.length){case 0:s=[];break;case 1:var h=a.getPrecedence(i[0],e);if(n&&null!==h){var c,l;if("keep"===e?(c=i[0].getIdentifier(),l=t.getIdentifier()):(c=i[0].getContent().getIdentifier(),l=t.getContent().getIdentifier()),!1===a.properties[o][l].latexLeftParens){s=[!1];break}if(!1===a.properties[h][c].latexParens){s=[!1];break}}if(null===h){s=[!1];break}if(h<=o){s=[!0];break}s=[!1];break;case 2:var f,u,d=a.getPrecedence(i[0],e),g=a.isAssociativeWith(t,i[0],e);f=null!==d&&(d===o&&"right"===p&&!g||d=2&&"OperatorNode:multiply"===t.getIdentifier()&&t.implicit&&"auto"===e&&"hide"===r&&(s=i.map(function(t,e){var r="ParenthesisNode"===t.getIdentifier();return!(!s[e]&&!r)})),s}return l.prototype=new c,l.prototype.type="OperatorNode",l.prototype.isOperatorNode=!0,l.prototype._compile=function(t,r){if("string"!=typeof this.fn||!i(t,this.fn))throw t[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var a=n(t,this.fn),s=e(this.args,function(e){return e._compile(t,r)});if(1===s.length){var o=s[0];return function(t,e,r){return a(o(t,e,r))}}if(2===s.length){var p=s[0],h=s[1];return function(t,e,r){return a(p(t,e,r),h(t,e,r))}}return function(t,r,i){return a.apply(null,e(s,function(e){return e(t,r,i)}))}},l.prototype.forEach=function(t){for(var e=0;e2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var l=i.map(function(e,r){return e=e.toString(t),n[r]&&(e="("+e+")"),e});return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?l.join(" "):l.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"},l.prototype.toJSON=function(){return{mathjs:"OperatorNode",op:this.op,fn:this.fn,args:this.args,implicit:this.implicit}},l.fromJSON=function(t){return new l(t.op,t.fn,t.args,t.implicit)},l.prototype.toHTML=function(t){var e=t&&t.parenthesis?t.parenthesis:"keep",i=t&&t.implicit?t.implicit:"hide",n=this.args,s=f(this,e,i,n,!1);if(1===n.length){var o=a.getAssociativity(this,e),p=n[0].toHTML(t);return s[0]&&(p='('+p+')'),"right"===o?''+r(this.op)+""+p:p+''+r(this.op)+""}if(2===n.length){var h=n[0].toHTML(t),c=n[1].toHTML(t);return s[0]&&(h='('+h+')'),s[1]&&(c='('+c+')'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===i?h+''+c:h+''+r(this.op)+""+c}var l=n.map(function(e,r){return e=e.toHTML(t),s[r]&&(e='('+e+')'),e});return n.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===i?l.join(''):l.join(''+r(this.op)+""):''+r(this.fn)+'('+l.join(',')+')'},l.prototype._toTex=function(e){var r=e&&e.parenthesis?e.parenthesis:"keep",i=e&&e.implicit?e.implicit:"hide",n=this.args,s=f(this,r,i,n,!0),o=t.operators[this.fn];if(o=void 0===o?this.op:o,1===n.length){var p=a.getAssociativity(this,r),h=n[0].toTex(e);return s[0]&&(h="\\left(".concat(h,"\\right)")),"right"===p?o+h:h+o}if(2===n.length){var c=n[0],l=c.toTex(e);s[0]&&(l="\\left(".concat(l,"\\right)"));var u,d=n[1].toTex(e);switch(s[1]&&(d="\\left(".concat(d,"\\right)")),u="keep"===r?c.getIdentifier():c.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return o+"{"+l+"}{"+d+"}";case"OperatorNode:pow":switch(l="{"+l+"}",d="{"+d+"}",u){case"ConditionalNode":case"OperatorNode:divide":l="\\left(".concat(l,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===i)return l+"~"+d}return l+o+d}if(n.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var g=n.map(function(t,r){return t=t.toTex(e),s[r]&&(t="\\left(".concat(t,"\\right)")),t});return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit?g.join("~"):g.join(o)}return"\\mathrm{"+this.fn+"}\\left("+n.map(function(t){return t.toTex(e)}).join(",")+"\\right)"},l.prototype.getIdentifier=function(){return this.type+":"+this.fn},l}exports.name="OperatorNode",exports.path="expression.node",exports.factory=s; },{"../../utils/latex":"H1Mr","../../utils/array":"j2lF","../../utils/string":"PshC","../../utils/customs":"PAPk","../operators":"Huid","./Node":"dnbo"}],"Mj7c":[function(require,module,exports) { "use strict";function t(t,e,n,o){var r=n(require("./Node"));function s(e){if(!(this instanceof s))throw new SyntaxError("Constructor must be called with the new operator");if(!t.isNode(e))throw new TypeError('Node expected for parameter "content"');this.content=e}return s.prototype=new r,s.prototype.type="ParenthesisNode",s.prototype.isParenthesisNode=!0,s.prototype._compile=function(t,e){return this.content._compile(t,e)},s.prototype.getContent=function(){return this.content.getContent()},s.prototype.forEach=function(t){t(this.content,"content",this)},s.prototype.map=function(t){return new s(t(this.content,"content",this))},s.prototype.clone=function(){return new s(this.content)},s.prototype._toString=function(t){return!t||t&&!t.parenthesis||t&&"keep"===t.parenthesis?"("+this.content.toString(t)+")":this.content.toString(t)},s.prototype.toJSON=function(){return{mathjs:"ParenthesisNode",content:this.content}},s.fromJSON=function(t){return new s(t.content)},s.prototype.toHTML=function(t){return!t||t&&!t.parenthesis||t&&"keep"===t.parenthesis?'('+this.content.toHTML(t)+')':this.content.toHTML(t)},s.prototype._toTex=function(t){return!t||t&&!t.parenthesis||t&&"keep"===t.parenthesis?"\\left(".concat(this.content.toTex(t),"\\right)"):this.content.toTex(t)},s}exports.name="ParenthesisNode",exports.path="expression.node",exports.factory=t; },{"./Node":"dnbo"}],"RtSa":[function(require,module,exports) { "use strict";var t=require("../../utils/latex"),n=require("../../utils/string").escape,e=require("../../utils/object").hasOwnProperty,o=require("../../utils/customs").getSafeProperty;function r(r,s,a,i,m){var p=a(require("./Node"));function u(t){return!!r.Unit&&r.Unit.isValuelessUnit(t)}function l(t){if(!(this instanceof l))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof t)throw new TypeError('String expected for parameter "name"');this.name=t}return l.prototype=new p,l.prototype.type="SymbolNode",l.prototype.isSymbolNode=!0,l.prototype._compile=function(t,n){var s=this.name;if(e(n,s))return function(t,n,e){return n[s]};if(s in t)return function(n,e,r){return o(s in n?n:t,s)};var a=u(s);return function(t,n,e){return s in t?o(t,s):a?new r.Unit(null,s):function(t){throw new Error("Undefined symbol "+t)}(s)}},l.prototype.forEach=function(t){},l.prototype.map=function(t){return this.clone()},l.prototype.clone=function(){return new l(this.name)},l.prototype._toString=function(t){return this.name},l.prototype.toHTML=function(t){var e=n(this.name);return"true"===e||"false"===e?''+e+"":"i"===e?''+e+"":"Infinity"===e?''+e+"":"NaN"===e?''+e+"":"null"===e?''+e+"":"undefined"===e?''+e+"":''+e+""},l.prototype.toJSON=function(){return{mathjs:"SymbolNode",name:this.name}},l.fromJSON=function(t){return new l(t.name)},l.prototype._toTex=function(n){var e=!1;void 0===m[this.name]&&u(this.name)&&(e=!0);var o=t.toSymbol(this.name,e);return"\\"===o[0]?o:" "+o},l}exports.name="SymbolNode",exports.path="expression.node",exports.math=!0,exports.factory=r; },{"../../utils/latex":"H1Mr","../../utils/string":"PshC","../../utils/object":"FcSp","../../utils/customs":"PAPk","./Node":"dnbo"}],"ZLEq":[function(require,module,exports) { "use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(r){return(e="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(e){return t(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)})(r)}function r(){return(r=Object.assign||function(t){for(var e=1;e'+o(this.fn)+'('+e.join(',')+')'};var b=d.prototype.toTex;return d.prototype.toTex=function(t){var r;return t&&"object"===e(t.handler)&&i(t.handler,this.name)&&(r=t.handler[this.name](this,t)),void 0!==r?r:b.call(this,t)},d.prototype._toTex=function(t){var r,o,i=this.args.map(function(e){return e.toTex(t)});switch(!h[this.name]||"function"!=typeof h[this.name].toTex&&"object"!==e(h[this.name].toTex)&&"string"!=typeof h[this.name].toTex||(r=h[this.name].toTex),e(r)){case"function":o=r(this,t);break;case"string":o=g(r,this,t);break;case"object":switch(e(r[i.length])){case"function":o=r[i.length](this,t);break;case"string":o=g(r[i.length],this,t)}}return void 0!==o?o:g(n.defaultTemplate,this,t)},d.prototype.getIdentifier=function(){return this.type+":"+this.name},d}exports.name="FunctionNode",exports.path="expression.node",exports.math=!0,exports.factory=f; },{"../../utils/latex":"H1Mr","../../utils/string":"PshC","../../utils/object":"FcSp","../../utils/array":"j2lF","../../utils/customs":"PAPk","./Node":"dnbo","./SymbolNode":"RtSa"}],"tJPg":[function(require,module,exports) { "use strict";var t=require("../operators");function e(e,s,r,n){var a=r(require("./Node"));function i(t,s,r){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(!e.isNode(t))throw new TypeError("Node expected");if(!e.isNode(s))throw new TypeError("Node expected");if(r&&!e.isNode(r))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=t,this.end=s,this.step=r||null}function o(e,s){var r=t.getPrecedence(e,s),n={},a=t.getPrecedence(e.start,s);if(n.start=null!==a&&a<=r||"all"===s,e.step){var i=t.getPrecedence(e.step,s);n.step=null!==i&&i<=r||"all"===s}var o=t.getPrecedence(e.end,s);return n.end=null!==o&&o<=r||"all"===s,n}return i.prototype=new a,i.prototype.type="RangeNode",i.prototype.isRangeNode=!0,i.prototype.needsEnd=function(){return this.filter(function(t){return e.isSymbolNode(t)&&"end"===t.name}).length>0},i.prototype._compile=function(t,e){var s=t.range,r=this.start._compile(t,e),n=this.end._compile(t,e);if(this.step){var a=this.step._compile(t,e);return function(t,e,i){return s(r(t,e,i),n(t,e,i),a(t,e,i))}}return function(t,e,a){return s(r(t,e,a),n(t,e,a))}},i.prototype.forEach=function(t){t(this.start,"start",this),t(this.end,"end",this),this.step&&t(this.step,"step",this)},i.prototype.map=function(t){return new i(this._ifNode(t(this.start,"start",this)),this._ifNode(t(this.end,"end",this)),this.step&&this._ifNode(t(this.step,"step",this)))},i.prototype.clone=function(){return new i(this.start,this.end,this.step&&this.step)},i.prototype._toString=function(t){var e,s=o(this,t&&t.parenthesis?t.parenthesis:"keep"),r=this.start.toString(t);if(s.start&&(r="("+r+")"),e=r,this.step){var n=this.step.toString(t);s.step&&(n="("+n+")"),e+=":"+n}var a=this.end.toString(t);return s.end&&(a="("+a+")"),e+=":"+a},i.prototype.toJSON=function(){return{mathjs:"RangeNode",start:this.start,end:this.end,step:this.step}},i.fromJSON=function(t){return new i(t.start,t.end,t.step)},i.prototype.toHTML=function(t){var e,s=o(this,t&&t.parenthesis?t.parenthesis:"keep"),r=this.start.toHTML(t);if(s.start&&(r='('+r+')'),e=r,this.step){var n=this.step.toHTML(t);s.step&&(n='('+n+')'),e+=':'+n}var a=this.end.toHTML(t);return s.end&&(a='('+a+')'),e+=':'+a},i.prototype._toTex=function(t){var e=o(this,t&&t.parenthesis?t.parenthesis:"keep"),s=this.start.toTex(t);if(e.start&&(s="\\left(".concat(s,"\\right)")),this.step){var r=this.step.toTex(t);e.step&&(r="\\left(".concat(r,"\\right)")),s+=":"+r}var n=this.end.toTex(t);return e.end&&(n="\\left(".concat(n,"\\right)")),s+=":"+n},i}exports.name="RangeNode",exports.path="expression.node",exports.factory=e; },{"../operators":"Huid","./Node":"dnbo"}],"E94o":[function(require,module,exports) { "use strict";var t=require("../operators"),r=require("../../utils/latex"),e=require("../../utils/string").escape;function a(a,n,o,i){var s=o(require("./Node")),p=require("../../utils/customs").getSafeProperty;function l(t,r){if(!(this instanceof l))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(t))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(r))throw new TypeError("Parameter params must be an array");if(t.length!==r.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=t,this.params=r}return l.prototype=new s,l.prototype.type="RelationalNode",l.prototype.isRelationalNode=!0,l.prototype._compile=function(t,r){var e=this,a=this.params.map(function(e){return e._compile(t,r)});return function(r,n,o){for(var i,s=a[0](r,n,o),l=0;l",smallerEq:"<=",largerEq:">="},i=n[0],s=0;s('+e.toHTML(r)+')':e.toHTML(r)}),i={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},s=o[0],p=0;p'+e(i[this.conditionals[p]])+""+o[p+1];return s},l.prototype._toTex=function(e){for(var a=e&&e.parenthesis?e.parenthesis:"keep",n=t.getPrecedence(this,a),o=this.params.map(function(r,o){var i=t.getPrecedence(r,a);return"all"===a||null!==i&&i<=n?"\\left("+r.toTex(e)+"\right)":r.toTex(e)}),i=o[0],s=0;s":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},T={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},M={true:!0,false:!1,null:null,undefined:void 0},O=["NaN","Infinity"];function b(e,n){return e.expression.substr(e.index,n)}function A(e){return b(e,1)}function C(e){e.index++}function S(e){return e.expression.charAt(e.index-1)}function I(e){return e.expression.charAt(e.index+1)}function q(e){for(e.tokenType=E.NULL,e.token="",e.comment="";N.isWhitespace(A(e),e.nestingLevel);)C(e);if("#"===A(e))for(;"\n"!==A(e)&&""!==A(e);)e.comment+=A(e),C(e);if(""!==A(e)){if("\n"===A(e)&&!e.nestingLevel)return e.tokenType=E.DELIMITER,e.token=A(e),void C(e);var n=A(e),t=b(e,2),o=b(e,3);if(3===o.length&&L[o])return e.tokenType=E.DELIMITER,e.token=o,C(e),C(e),void C(e);if(2===t.length&&L[t])return e.tokenType=E.DELIMITER,e.token=t,C(e),void C(e);if(L[n])return e.tokenType=E.DELIMITER,e.token=n,void C(e);if(N.isDigitDot(n)){if(e.tokenType=E.NUMBER,"."===A(e))e.token+=A(e),C(e),N.isDigit(A(e))||(e.tokenType=E.DELIMITER);else{for(;N.isDigit(A(e));)e.token+=A(e),C(e);N.isDecimalMark(A(e),I(e))&&(e.token+=A(e),C(e))}for(;N.isDigit(A(e));)e.token+=A(e),C(e);if("E"===A(e)||"e"===A(e))if(N.isDigit(I(e))||"-"===I(e)||"+"===I(e)){if(e.token+=A(e),C(e),"+"!==A(e)&&"-"!==A(e)||(e.token+=A(e),C(e)),!N.isDigit(A(e)))throw ie(e,'Digit expected, got "'+A(e)+'"');for(;N.isDigit(A(e));)e.token+=A(e),C(e);if(N.isDecimalMark(A(e),I(e)))throw ie(e,'Digit expected, got "'+A(e)+'"')}else if("."===I(e))throw C(e),ie(e,'Digit expected, got "'+A(e)+'"')}else{if(!N.isAlpha(A(e),S(e),I(e))){for(e.tokenType=E.UNKNOWN;""!==A(e);)e.token+=A(e),C(e);throw ie(e,'Syntax error in part "'+e.token+'"')}for(;N.isAlpha(A(e),S(e),I(e))||N.isDigit(A(e));)e.token+=A(e),C(e);T.hasOwnProperty(e.token)?e.tokenType=E.DELIMITER:e.tokenType=E.SYMBOL}}else e.tokenType=E.DELIMITER}function P(e){do{q(e)}while("\n"===e.token)}function B(e){e.nestingLevel++}function R(e){e.nestingLevel--}function F(n,t){var o={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:E.NULL,nestingLevel:0,conditionalLevel:null};e(o,{expression:n,extraNodes:t}),q(o);var r=function(e){var n,t,o=[];""!==e.token&&"\n"!==e.token&&";"!==e.token&&((n=U(e)).comment=e.comment);for(;"\n"===e.token||";"===e.token;)0===o.length&&n&&(t=";"!==e.token,o.push({node:n,visible:t})),q(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&((n=U(e)).comment=e.comment,t=";"!==e.token,o.push({node:n,visible:t}));return o.length>0?new c(o):(n||((n=new p(void 0)).comment=e.comment),n)}(o);if(""!==o.token)throw o.tokenType===E.DELIMITER?ue(o,"Unexpected operator "+o.token):ie(o,'Unexpected part "'+o.token+'"');return r}function U(e){var n,t,r,i,u=function(e){var n=function(e){var n=Y(e);for(;"or"===e.token;)P(e),n=new v("or","or",[n,Y(e)]);return n}(e);for(;"?"===e.token;){var t=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,P(e);var o=n,r=U(e);if(":"!==e.token)throw ie(e,"False part of conditional expression expected");e.conditionalLevel=null,P(e);var i=U(e);n=new d(o,r,i),e.conditionalLevel=t}return n}(e);if("="===e.token){if(o.isSymbolNode(u))return n=u.name,P(e),r=U(e),new k(new x(n),r);if(o.isAccessorNode(u))return P(e),r=U(e),new k(u.object,u.index,r);if(o.isFunctionNode(u)&&o.isSymbolNode(u.fn)&&(i=!0,t=[],n=u.name,u.args.forEach(function(e,n){o.isSymbolNode(e)?t[n]=e.name:i=!1}),i))return P(e),r=U(e),new l(n,t,r);throw ie(e,"Invalid left hand side of assignment operator =")}return u}function Y(e){for(var n=j(e);"xor"===e.token;)P(e),n=new v("xor","xor",[n,j(e)]);return n}function j(e){for(var n=V(e);"and"===e.token;)P(e),n=new v("and","and",[n,V(e)]);return n}function V(e){for(var n=$(e);"|"===e.token;)P(e),n=new v("|","bitOr",[n,$(e)]);return n}function $(e){for(var n=W(e);"^|"===e.token;)P(e),n=new v("^|","bitXor",[n,W(e)]);return n}function W(e){for(var n=G(e);"&"===e.token;)P(e),n=new v("&","bitAnd",[n,G(e)]);return n}function G(e){for(var n=[J(e)],t=[],o={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};o.hasOwnProperty(e.token);){var r={name:e.token,fn:o[e.token]};t.push(r),P(e),n.push(J(e))}return 1===n.length?n[0]:2===n.length?new v(t[0].name,t[0].fn,n):new g(t.map(function(e){return e.fn}),n)}function J(e){var n,t,o,r,i;for(n=K(e),t={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};t.hasOwnProperty(e.token);)r=t[o=e.token],P(e),i=[n,K(e)],n=new v(o,r,i);return n}function K(e){var n,t,o,r,i;for(n=z(e),t={to:"to",in:"to"};t.hasOwnProperty(e.token);)r=t[o=e.token],P(e),"in"===o&&""===e.token?n=new v("*","multiply",[n,new x("in")],!0):(i=[n,z(e)],n=new v(o,r,i));return n}function z(e){var n,t=[];if(n=":"===e.token?new p(1):X(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(t.push(n);":"===e.token&&t.length<3;)P(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?t.push(new x("end")):t.push(X(e));n=3===t.length?new m(t[0],t[2],t[1]):new m(t[0],t[1])}return n}function X(e){var n,t,o,r,i;for(n=Z(e),t={"+":"add","-":"subtract"};t.hasOwnProperty(e.token);)r=t[o=e.token],P(e),i=[n,Z(e)],n=new v(o,r,i);return n}function Z(e){var n,t,o,r,i;for(t=n=_(e),o={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide","%":"mod",mod:"mod"};o.hasOwnProperty(e.token);)i=o[r=e.token],P(e),t=_(e),n=new v(r,i,[n,t]);return n}function _(e){var n,t;for(t=n=H(e);e.tokenType===E.SYMBOL||"in"===e.token&&o.isConstantNode(n)||!(e.tokenType!==E.NUMBER||o.isConstantNode(t)||o.isOperatorNode(t)&&"!"!==t.op)||"("===e.token;)t=H(e),n=new v("*","multiply",[n,t],!0);return n}function H(n){for(var t=Q(n),r=t,i=[];"/"===n.token&&o.isConstantNode(r);){if(i.push(e({},n)),P(n),n.tokenType!==E.NUMBER){e(n,i.pop());break}if(i.push(e({},n)),P(n),n.tokenType!==E.SYMBOL&&"("!==n.token){i.pop(),e(n,i.pop());break}e(n,i.pop()),i.pop(),r=Q(n),t=new v("/","divide",[t,r])}return t}function Q(e){var n,t,o,i={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return i.hasOwnProperty(e.token)?(o=i[e.token],n=e.token,P(e),t=[Q(e)],new v(n,o,t)):function(e){var n,t,o,i;n=function(e){var n,t,o,i;for(n=function(e){var n=[];if(e.tokenType===E.SYMBOL&&e.extraNodes.hasOwnProperty(e.token)){var t=e.extraNodes[e.token];if(q(e),"("===e.token){if(n=[],B(e),q(e),")"!==e.token)for(n.push(U(e));","===e.token;)q(e),n.push(U(e));if(")"!==e.token)throw ie(e,"Parenthesis ) expected");R(e),q(e)}return new t(n)}return function(e){var n,t;return e.tokenType===E.SYMBOL||e.tokenType===E.DELIMITER&&e.token in T?(t=e.token,q(e),n=M.hasOwnProperty(t)?new p(M[t]):-1!==O.indexOf(t)?new p(a(t,"number")):new x(t),n=ee(e,n)):function(e){var n,t;return'"'===e.token?(t=ne(e),n=new p(t),n=ee(e,n)):function(e){var n,t;return"'"===e.token?(t=te(e),n=new p(t),n=ee(e,n)):function(e){var n,t,o,i;if("["===e.token){if(B(e),q(e),"]"!==e.token){var u=oe(e);if(";"===e.token){for(o=1,t=[u];";"===e.token;)q(e),t[o]=oe(e),o++;if("]"!==e.token)throw ie(e,"End of matrix ] expected");R(e),q(e),i=t[0].items.length;for(var f=1;f0},N.isDecimalMark=function(e,n){return"."===e&&"/"!==n&&"*"!==n&&"^"!==n},N.isDigitDot=function(e){return e>="0"&&e<="9"||"."===e},N.isDigit=function(e){return e>="0"&&e<="9"},N}exports.name="parse",exports.path="expression",exports.factory=o; },{"../error/ArgumentsError":"h0xI","../utils/collection/deepMap":"lOYo","../type/numeric":"aA7E","./node/AccessorNode":"vZNf","./node/ArrayNode":"onTs","./node/AssignmentNode":"yw4P","./node/BlockNode":"QBkn","./node/ConditionalNode":"uzAW","./node/ConstantNode":"MNuy","./node/FunctionAssignmentNode":"PrPs","./node/IndexNode":"SN5L","./node/ObjectNode":"UI2T","./node/OperatorNode":"F3sc","./node/ParenthesisNode":"Mj7c","./node/FunctionNode":"ZLEq","./node/RangeNode":"tJPg","./node/RelationalNode":"E94o","./node/SymbolNode":"RtSa"}],"eDsC":[function(require,module,exports) { "use strict";function r(r,t,n,e,a){var o=a.expression.node.FunctionNode,s=a.expression.node.OperatorNode,i=a.expression.node.SymbolNode,g={add:!0,multiply:!0},f={add:!0,multiply:!0};function u(t,n){if(!r.isOperatorNode(t))return!1;var e=t.fn.toString();return n&&n.hasOwnProperty(e)&&n[e].hasOwnProperty("associative")?n[e].associative:f[e]||!1}function c(t){var n,e=[];return u(t)?(n=t.op,function t(a){for(var o=0;o2&&u(t)){for(var o=t.args.pop();t.args.length>0;)o=n([t.args.pop(),o]);t.args=o.args}}},unflattenl:function r(t){if(t.args&&0!==t.args.length){for(var n=p(t),e=t.args.length,a=0;a2&&u(t)){for(var o=t.args.shift();t.args.length>0;)o=n([o,t.args.shift()]);t.args=o.args}}}}}exports.factory=r,exports.math=!0; },{}],"TWFw":[function(require,module,exports) { "use strict";function e(e,n,r,t,o){var i=r(require("./util")),a=i.isCommutative,u=i.isAssociative,s=i.allChildren,c=i.createMakeNodeFunction,d=o.expression.node.ConstantNode,f=o.expression.node.OperatorNode,m=o.expression.node.FunctionNode;function l(n,r,t){try{return b(o[n].apply(null,r),t)}catch(i){return r=r.map(function(n){return e.isFraction(n)?n.valueOf():n}),b(o[n].apply(null,r),t)}}var p=t({Fraction:function(e){var n,r=e.s*e.n;n=r<0?new f("-","unaryMinus",[new d(-r)]):new d(r);if(1===e.d)return n;return new f("/","divide",[n,new d(e.d)])},number:function(e){return e<0?y(new d(-e)):new d(e)},BigNumber:function(e){return e<0?y(new d(-e)):new d(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")}});function N(e,n){if(n&&!1!==n.exactFractions&&isFinite(e)){var r=o.fraction(e);if(r.valueOf()===e)return r}return e}var b=t({"string, Object":function(e,r){return"BigNumber"===n.number?o.bignumber(e):"Fraction"===n.number?o.fraction(e):N(parseFloat(e),r)},"Fraction, Object":function(e,n){return e},"BigNumber, Object":function(e,n){return e},"number, Object":function(e,n){return N(e,n)},"Complex, Object":function(e,n){return 0!==e.im?e:N(e.re,n)}});function y(e){return new f("-","unaryMinus",[e])}function v(n,r,t,o){return r.reduce(function(r,i){if(e.isNode(r)||e.isNode(i))e.isNode(r)?e.isNode(i)||(i=p(i)):r=p(r);else{try{return l(n,[r,i],o)}catch(a){}r=p(r),i=p(i)}return t([r,i])})}return function(n,r){var t=function n(r,t){switch(r.type){case"SymbolNode":return r;case"ConstantNode":return"number"!=typeof r.value&&isNaN(r.value)?r:b(r.value,t);case"FunctionNode":if(o[r.name]&&o[r.name].rawArgs)return r;if(-1===["add","multiply"].indexOf(r.name)){var i=r.args.map(function(e){return n(e,t)});if(!i.some(e.isNode))try{return l(r.name,i,t)}catch(x){}return i=i.map(function(n){return e.isNode(n)?n:p(n)}),new m(r.name,i)}case"OperatorNode":var d,f,N=r.fn.toString(),y=c(r);if(r.isUnary())d=[n(r.args[0],t)],f=e.isNode(d[0])?y(d):l(N,d,t);else if(u(r))if(d=(d=s(r)).map(function(e){return n(e,t)}),a(N)){for(var w=[],g=[],h=0;h1?(f=v(N,w,y,t),g.unshift(f),f=v(N,g,y,t)):f=v(N,d,y,t)}else f=v(N,d,y,t);else d=r.args.map(function(e){return n(e,t)}),f=v(N,d,y,t);return f;case"ParenthesisNode":return n(r.content,t);case"AccessorNode":case"ArrayNode":case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"IndexNode":case"ObjectNode":case"RangeNode":case"UpdateNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(r.type))}}(n,r);return e.isNode(t)?t:p(t)}}exports.math=!0,exports.name="simplifyConstant",exports.path="algebra.simplify",exports.factory=e; },{"./util":"eDsC"}],"geyZ":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function n(n,e,t,u){var i=u("isZero",{number:function(r){return 0===r},BigNumber:function(r){return r.isZero()},Complex:function(r){return 0===r.re&&0===r.im},Fraction:function(r){return 1===r.d&&0===r.n},Unit:function(r){return i(r.value)},"Array | Matrix":function(n){return r(n,i)}});return i}exports.name="isZero",exports.factory=n; },{"../../utils/collection/deepMap":"lOYo"}],"IRmO":[function(require,module,exports) { "use strict";var r=require("../../../utils/index"),t=r.object;function e(r,e,i,a){var n=i(require("../../../type/matrix/function/matrix")),u=i(require("../../arithmetic/abs")),o=i(require("../../arithmetic/addScalar")),s=i(require("../../arithmetic/divideScalar")),c=i(require("../../arithmetic/multiplyScalar")),f=i(require("../../arithmetic/subtract")),h=i(require("../../relational/larger")),p=i(require("../../relational/equalScalar")),l=i(require("../../arithmetic/unaryMinus")),v=r.SparseMatrix,m=r.DenseMatrix,g=r.Spa;function w(r){var e,i,a,n=r._size[0],l=r._size[1],v=Math.min(n,l),g=t.clone(r._data),w=[],S=[n,v],x=[],_=[v,l],d=[];for(e=0;e0)for(e=0;e0&&r.forEach(0,e-1,function(t,e){v._forEachRow(t,S,x,_,function(i,a){i>t&&r.accumulate(i,l(c(a,e)))})});var E,R,b,D,O=e,P=r.get(e),j=u(P);r.forEach(e+1,a-1,function(r,t){var e=u(t);h(e,j)&&(O=r,j=e,P=t)}),e!==O&&(v._swapRows(e,O,d[1],S,x,_),v._swapRows(e,O,M[1],q,z,L),r.swap(e,O),R=O,b=y[E=e],D=y[R],U[b]=R,U[D]=E,y[E]=D,y[R]=b),r.forEach(0,a-1,function(r,t){r<=e?(q.push(t),z.push(r)):(t=s(t,P),p(t,0)||(S.push(t),x.push(r)))})};for(e=0;e=t)break;for(var h=m,p=0;!x[a.p[h]];)x[a.p[h]]=!0,h=a.p[h],p++;p%2==0&&l++}return l%2==0?n:c(n)}(i.clone().valueOf(),n);throw new RangeError("Matrix must be square (size: "+t.format(a)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+t.format(a)+")")}}});return l.toTex={1:"\\det\\left(${args[0]}\\right)"},l}exports.name="det",exports.factory=i; },{"../../utils/index":"fsXI","../../type/matrix/function/matrix":"vzj5","../arithmetic/subtract":"m78R","../arithmetic/multiply":"k7By","../arithmetic/unaryMinus":"q5A1","../algebra/decomposition/lup":"IRmO"}],"yHuZ":[function(require,module,exports) { "use strict";var r=require("../../utils/index");function e(e,t,i,a){var n=i(require("../../type/matrix/function/matrix")),o=i(require("../arithmetic/divideScalar")),u=i(require("../arithmetic/addScalar")),s=i(require("../arithmetic/multiply")),f=i(require("../arithmetic/unaryMinus")),c=i(require("../matrix/det")),m=i(require("./identity")),v=i(require("../arithmetic/abs")),l=a("inv",{"Array | Matrix":function(t){var i=e.isMatrix(t)?t.size():r.array.size(t);switch(i.length){case 1:if(1===i[0])return e.isMatrix(t)?n([o(1,t.valueOf()[0])]):[o(1,t[0])];throw new RangeError("Matrix must be square (size: "+r.string.format(i)+")");case 2:var a=i[0],u=i[1];if(a===u)return e.isMatrix(t)?n(h(t.valueOf(),a,u),t.storage()):h(t,a,u);throw new RangeError("Matrix must be square (size: "+r.string.format(i)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+r.string.format(i)+")")}},any:function(r){return o(1,r)}});function h(r,e,t){var i,a,n,l,h;if(1===e){if(0===(l=r[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[o(1,l)]]}if(2===e){var x=c(r);if(0===x)throw Error("Cannot calculate inverse, determinant is zero");return[[o(r[1][1],x),o(f(r[0][1]),x)],[o(f(r[1][0]),x),o(r[0][0],x)]]}var d=r.concat();for(i=0;ig&&(g=v(d[i][w]),y=i),i++;if(0===g)throw Error("Cannot calculate inverse, determinant is zero");(i=y)!==w&&(h=d[w],d[w]=d[i],d[i]=h,h=q[w],q[w]=q[i],q[i]=h);var z=d[w],M=q[w];for(i=0;i");if(2!==s.length)throw SyntaxError("Could not parse rule: "+o);o={l:s[0],r:s[1]};case"object":if(i={l:j(l(o.l)),r:j(l(o.r))},o.context&&(i.evaluate=o.context),o.evaluate&&(i.evaluate=l(o.evaluate)),v(i.l)){var u=O(i.l),f=new p("_p"+q++);i.expanded={},i.expanded.l=u([i.l.clone(),f]),b(i.expanded.l),x(i.expanded.l),i.expanded.r=u([i.r,f])}break;case"function":i=o;break;default:throw TypeError("Unsupported type of rule: "+a)}r.push(i)}return r}(r);for(var i=m(n,t),a={},s=(i=j(i)).toString({parenthesis:"all"});!a[s];){a[s]=!0,q=0;for(var u=0;u=2&&2===e.args.length){for(var l=function(n,e){var r,t,o=[],i=O(n);if(y(n,e))for(var l=0;l2)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}for(var m=[],g=0;g0){for(var t=m(e,n.args[0],r),o=1;o0){var o=n.args.filter(function(e){return void 0===r[e]}),a=1===o.length?o[0]:new d("*","multiply",o),c=t.concat(v(a,r));return new d("*","multiply",c)}return new d("+","add",n.args.map(function(e){return new d("*","multiply",n.args.map(function(n){return n===e?v(n,r):n.clone()}))}))}if("/"===n.op&&n.isBinary()){var u=n.args[0],l=n.args[1];return void 0!==r[l]?new d("/","divide",[v(u,r),l]):void 0!==r[u]?new d("*","multiply",[new d("-","unaryMinus",[u]),new d("/","divide",[v(l,r),new d("^","pow",[l.clone(),y(2)])])]):new d("/","divide",[new d("-","subtract",[new d("*","multiply",[v(u,r),l.clone()]),new d("*","multiply",[u.clone(),v(l,r)])]),new d("^","pow",[l.clone(),y(2)])])}if("^"===n.op&&n.isBinary()){var p=n.args[0],g=n.args[1];if(void 0!==r[p])return e.isConstantNode(p)&&(s(p.value)||i(p.value,1))?y(0):new d("*","multiply",[n,new d("*","multiply",[new w("log",[p.clone()]),v(g.clone(),r)])]);if(void 0!==r[g]){if(e.isConstantNode(g)){if(s(g.value))return y(0);if(i(g.value,1))return v(p,r)}var b=new d("^","pow",[p.clone(),new d("-","subtract",[g,y(1)])]);return new d("*","multiply",[g.clone(),new d("*","multiply",[v(p,r),b])])}return new d("*","multiply",[new d("^","pow",[p.clone(),g.clone()]),new d("+","add",[new d("*","multiply",[v(p,r),new d("/","divide",[g.clone(),p.clone()])]),new d("*","multiply",[v(g,r),new w("log",[p.clone()])])])])}throw new Error('Operator "'+n.op+'" is not supported by derivative, or a wrong number of arguments is passed')}});function y(e,r){return new l(u(e,r||n.number))}return b}exports.name="derivative",exports.factory=e; },{"../../expression/parse":"EUvE","./simplify":"EVZ1","../relational/equal":"IviB","../utils/isZero":"geyZ","../utils/typeof":"LZTG","../../type/numeric":"aA7E","../../expression/node/ConstantNode":"MNuy","../../expression/node/FunctionNode":"ZLEq","../../expression/node/OperatorNode":"F3sc","../../expression/node/ParenthesisNode":"Mj7c","../../expression/node/SymbolNode":"RtSa"}],"uJKc":[function(require,module,exports) { "use strict";function r(r,t,e,a){var s=e(require("../parse"));return a("parse",{"string | Array | Matrix":s,"string | Array | Matrix, Object":s})}exports.name="parse",exports.factory=r; },{"../parse":"EUvE"}],"wmjX":[function(require,module,exports) { "use strict";function n(n,r,e,o){var t=e(require("./simplify")),i=e(require("./simplify/simplifyCore")),a=e(require("./simplify/simplifyConstant")),l=e(require("../../expression/function/parse")),s=require("../../utils/number"),f=e(require("../../expression/node/ConstantNode")),u=e(require("../../expression/node/OperatorNode")),c=e(require("../../expression/node/SymbolNode")),p=o("rationalize",{string:function(n){return p(l(n),{},!1)},"string, boolean":function(n,r){return p(l(n),{},r)},"string, Object":function(n,r){return p(l(n),r,!1)},"string, Object, boolean":function(n,r,e){return p(l(n),r,e)},Node:function(n){return p(n,{},!1)},"Node, boolean":function(n,r){return p(n,{},r)},"Node, Object":function(n,r){return p(n,r,!1)},"Node, Object, boolean":function(n,r,e){var o=function(){var n=[i,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},a,{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"}],r=[{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)"}],e=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],o={};return o.firstRules=n.concat(r,e),o.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)"}],o.sucDivRules=e,o.firstRulesAgain=n.concat(r),o.finalRules=[i,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},a,{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))"}],o}(),l=function(n,r,e,o){var i=[],a=t(n,o,r,{exactFractions:!1}),l="+-*"+((e=!!e)?"/":"");!function n(r){var e=r.type;if("FunctionNode"===e)throw new Error("There is an unsolved function call");if("OperatorNode"===e)if("^"===r.op){if("unaryMinus"===r.args[1].fn&&(r=r.args[0]),"ConstantNode"!==r.args[1].type||!s.isInteger(parseFloat(r.args[1].value)))throw new Error("There is a non-integer exponent");n(r.args[0])}else{if(-1===l.indexOf(r.op))throw new Error("Operator "+r.op+" invalid in polynomial expression");for(var o=0;o=1){var p,d;n=function n(r,e,o){var t=r.type;var i=arguments.length>1;if("OperatorNode"===t&&r.isBinary()){var a,l=!1;if("^"===r.op&&("ParenthesisNode"!==r.args[0].type&&"OperatorNode"!==r.args[0].type||"ConstantNode"!==r.args[1].type||(a=parseFloat(r.args[1].value),l=a>=2&&s.isInteger(a))),l){if(a>2){var c=r.args[0],p=new u("^","pow",[r.args[0].cloneDeep(),new f(a-1)]);r=new u("*","multiply",[c,p])}else r=new u("*","multiply",[r.args[0],r.args[0].cloneDeep()]);i&&("content"===o?e.content=r:e.args[o]=r)}}if("ParenthesisNode"===t)n(r.content,r,"content");else if("ConstantNode"!==t&&"SymbolNode"!==t)for(var v=0;vo&&(r[u]=0),r[u]+=a.cte*("+"===a.oper?1:-1),void(o=Math.max(u,o))}a.cte=u,""===a.fire&&(r[0]+=a.cte*("+"===a.oper?1:-1))}}(n,null,e);for(var i,a=!0,l=o=r.length-1;l>=0;l--)if(0!==r[l]){var p=new f(a?r[l]:Math.abs(r[l])),v=r[l]<0?"-":"+";if(l>0){var d=new c(t);if(l>1){var w=new f(l);d=new u("^","pow",[d,w])}p=-1===r[l]&&a?new u("-","unaryMinus",[d]):1===Math.abs(r[l])?d:new u("*","multiply",[p,d])}i=a?p:"+"===v?new u("+","add",[i,p]):new u("-","subtract",[i,p]),a=!1}return a?new f(0):i}return p}exports.name="rationalize",exports.factory=n; },{"./simplify":"EVZ1","./simplify/simplifyCore":"c7UI","./simplify/simplifyConstant":"TWFw","../../expression/function/parse":"uJKc","../../utils/number":"uqMu","../../expression/node/ConstantNode":"MNuy","../../expression/node/OperatorNode":"F3sc","../../expression/node/SymbolNode":"RtSa"}],"npE3":[function(require,module,exports) { "use strict";var r=require("../../utils/number").nearlyEqual,n=require("../../utils/bignumber/nearlyEqual");function e(e,t,u,i){var a=u(require("../../type/matrix/function/matrix")),o=u(require("../../type/matrix/utils/algorithm03")),l=u(require("../../type/matrix/utils/algorithm07")),s=u(require("../../type/matrix/utils/algorithm12")),f=u(require("../../type/matrix/utils/algorithm13")),c=u(require("../../type/matrix/utils/algorithm14")),x=require("../../utils/latex"),y=i("unequal",{"any, any":function(r,n){return null===r?null!==n:null===n?null!==r:void 0===r?void 0!==n:void 0===n?void 0!==r:m(r,n)},"SparseMatrix, SparseMatrix":function(r,n){return l(r,n,m)},"SparseMatrix, DenseMatrix":function(r,n){return o(n,r,m,!0)},"DenseMatrix, SparseMatrix":function(r,n){return o(r,n,m,!1)},"DenseMatrix, DenseMatrix":function(r,n){return f(r,n,m)},"Array, Array":function(r,n){return y(a(r),a(n)).valueOf()},"Array, Matrix":function(r,n){return y(a(r),n)},"Matrix, Array":function(r,n){return y(r,a(n))},"SparseMatrix, any":function(r,n){return s(r,n,m,!1)},"DenseMatrix, any":function(r,n){return c(r,n,m,!1)},"any, SparseMatrix":function(r,n){return s(n,r,m,!0)},"any, DenseMatrix":function(r,n){return c(n,r,m,!0)},"Array, any":function(r,n){return c(a(r),n,m,!1).valueOf()},"any, Array":function(r,n){return c(a(n),r,m,!0).valueOf()}}),m=i("_unequal",{"boolean, boolean":function(r,n){return r!==n},"number, number":function(n,e){return!r(n,e,t.epsilon)},"BigNumber, BigNumber":function(r,e){return!n(r,e,t.epsilon)},"Fraction, Fraction":function(r,n){return!r.equals(n)},"Complex, Complex":function(r,n){return!r.equals(n)},"Unit, Unit":function(r,n){if(!r.equalBase(n))throw new Error("Cannot compare units with different base");return y(r.value,n.value)}});return y.toTex={2:"\\left(${args[0]}".concat(x.operators.unequal,"${args[1]}\\right)")},y}exports.name="unequal",exports.factory=e; },{"../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB","../../utils/latex":"H1Mr"}],"Zr7Q":[function(require,module,exports) { "use strict";var r=require("../../utils/number"),n=require("../../utils/collection/deepMap");function e(e,t,i,u){var o=u("sign",{number:r.sign,Complex:function(r){return r.sign()},BigNumber:function(r){return new e.BigNumber(r.cmp(0))},Fraction:function(r){return new e.Fraction(r.s,1)},"Array | Matrix":function(r){return n(r,o,!0)},Unit:function(r){return o(r.value)}});return o.toTex={1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},o}exports.name="sign",exports.factory=e; },{"../../utils/number":"uqMu","../../utils/collection/deepMap":"lOYo"}],"T6pB":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function t(t,e,n,i){var u=i("sqrt",{number:o,Complex:function(r){return r.sqrt()},BigNumber:function(r){return!r.isNegative()||e.predictable?r.sqrt():o(r.toNumber())},"Array | Matrix":function(t){return r(t,u,!0)},Unit:function(r){return r.pow(.5)}});function o(r){return isNaN(r)?NaN:r>=0||e.predictable?Math.sqrt(r):new t.Complex(r,0).sqrt()}return u.toTex={1:"\\sqrt{${args[0]}}"},u}exports.name="sqrt",exports.factory=t; },{"../../utils/collection/deepMap":"lOYo"}],"msvi":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function t(t,n,e,u){var o=u("conj",{number:function(r){return r},BigNumber:function(r){return r},Complex:function(r){return r.conjugate()},"Array | Matrix":function(t){return r(t,o)}});return o.toTex={1:"\\left(${args[0]}\\right)^*"},o}exports.name="conj",exports.factory=t; },{"../../utils/collection/deepMap":"lOYo"}],"fqqA":[function(require,module,exports) { "use strict";function r(r,e,t,i){var a=t(require("../../../type/matrix/function/matrix")),n=t(require("../../matrix/zeros")),o=t(require("../../matrix/identity")),u=t(require("../../utils/isZero")),c=t(require("../../relational/unequal")),f=t(require("../../arithmetic/sign")),s=t(require("../../arithmetic/sqrt")),m=t(require("../../complex/conj")),q=t(require("../../arithmetic/unaryMinus")),l=t(require("../../arithmetic/addScalar")),h=t(require("../../arithmetic/divideScalar")),v=t(require("../../arithmetic/multiplyScalar")),d=t(require("../../arithmetic/subtract"));function x(r){var e,t,i,a=r._size[0],x=r._size[1],p=o([a],"dense"),y=p._data,S=r.clone(),w=S._data,R=n([a],"");for(i=0;i=0;){var f=e[o+c],p=e[s+f];-1===p?(c--,n[t++]=f):(e[s+f]=e[a+p],e[o+ ++c]=p)}return t}}exports.name="csTdfs",exports.path="algebra.sparse",exports.factory=r; },{}],"C2z0":[function(require,module,exports) { "use strict";var r=require("../../utils/object").clone,e=require("../../utils/string").format;function t(t,a,n,s){var o=require("../../utils/latex"),i=n(require("../../type/matrix/function/matrix")),u=t.DenseMatrix,c=t.SparseMatrix,f=s("transpose",{Array:function(r){return f(i(r)).valueOf()},Matrix:function(t){var a,n=t.size();switch(n.length){case 1:a=t.clone();break;case 2:var s=n[0],o=n[1];if(0===o)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+e(n)+")");switch(t.storage()){case"dense":a=function(e,t,a){for(var n,s=e._data,o=[],i=0;i3)return null;var a=f._size,c=a[0],l=a[1],m=0,p=Math.max(16,10*Math.sqrt(l)),h=function(r,f,a,e,t){var i=u(f);if(1===r&&e===a)return o(f,i);if(2===r){for(var v=i._index,s=i._ptr,c=0,l=0;lt))for(var p=s[l+1];mn)a[u+m]=0,a[i+m]=-1,l++,f[m]=e(r),a[u+r]++;else{var h=a[v+p];-1!==h&&(s[h]=m),a[c+m]=a[v+p],a[v+p]=m}}return l}(l,D,H,N,L,O,p,I,K,Q,J),U=0;SV?(g=M,y=Y,F=H[0+M]-V):(y=D[g=C[Y++]],F=H[0+g]),_=1;_<=F;_++)(b=H[I+(x=C[y++])])<=0||(X+=b,H[I+x]=-b,C[$++]=x,-1!==H[J+x]&&(Q[H[J+x]]=Q[x]),-1!==Q[x]?H[J+Q[x]]=H[J+x]:H[K+H[N+x]]=H[J+x]);g!==M&&(D[g]=e(M),H[O+g]=0)}for(0!==V&&(E=$),H[N+M]=X,D[M]=Z,H[0+M]=$-Z,H[L+M]=-2,R=v(R,m,H,O,l),k=Z;k<$;k++)if(!((z=H[L+(x=C[k])])<=0)){var rr=R-(b=-H[I+x]);for(Y=D[x],A=D[x]+z-1;Y<=A;Y++)H[O+(g=C[Y])]>=R?H[O+g]-=b:0!==H[O+g]&&(H[O+g]=H[N+g]+rr)}for(k=Z;k<$;k++){for(T=(A=D[x=C[k]])+H[L+x]-1,j=A,w=0,B=0,Y=A;Y<=T;Y++)if(0!==H[O+(g=C[Y])]){var fr=H[O+g]-R;fr>0?(B+=fr,C[j++]=g,w+=g):(D[g]=e(M),H[O+g]=0)}H[L+x]=j-A+1;var ar=j,er=A+H[0+x];for(Y=T+1;Y=0))for(x=H[P+(w=Q[x])],H[P+w]=-1;-1!==x&&-1!==H[J+x];x=H[J+x],R++){for(F=H[0+x],z=H[L+x],Y=D[x]+1;Y<=D[x]+F-1;Y++)H[O+C[Y]]=R;var ir=x;for(q=H[J+x];-1!==q;){var or=H[0+q]===F&&H[L+q]===z;for(Y=D[q]+1;or&&Y<=D[q]+F-1;Y++)H[O+C[Y]]!==R&&(or=0);or?(D[q]=e(x),H[I+x]+=H[I+q],H[I+q]=0,H[L+q]=-1,q=H[J+q],H[J+ir]=q):(ir=q,q=H[J+q])}}for(Y=Z,k=Z;k<$;k++)(b=-H[I+(x=C[k])])<=0||(H[I+x]=b,B=H[N+x]+X-b,-1!==H[K+(B=Math.min(B,l-S-b))]&&(Q[H[K+B]]=x),H[J+x]=H[K+B],Q[x]=-1,H[K+B]=x,U=Math.min(U,B),H[N+x]=B,C[Y++]=x);H[I+M]=W,0==(H[0+M]=Y-Z)&&(D[M]=-1,H[O+M]=0),0!==V&&(E=Y)}for(x=0;x=0;q--)H[I+q]>0||(H[J+q]=H[K+D[q]],H[K+D[q]]=q);for(g=l;g>=0;g--)H[I+g]<=0||-1!==D[g]&&(H[J+g]=H[K+D[g]],H[K+D[g]]=g);for(M=0,x=0;x<=l;x++)-1===D[x]&&(M=i(x,M,H,K,J,G,O));return G.splice(G.length-1,1),G}}exports.name="csAmd",exports.path="algebra.sparse",exports.factory=r; },{"./csFlip":"da3s","./csFkeep":"ppxA","./csTdfs":"xmPn","../../arithmetic/add":"zf2Z","../../arithmetic/multiply":"k7By","../../matrix/transpose":"C2z0"}],"rGf9":[function(require,module,exports) { "use strict";function e(e){var r=e.SparseMatrix;return function(e,a,t,s){for(var n=e._values,p=e._index,u=e._ptr,i=e._size,o=e._datatype,v=i[0],l=i[1],x=s&&e._values?[]:null,_=[],c=[],f=0,d=0;d=0;e--)-1!==r[e]&&(a[f+e]=a[0+r[e]],a[0+r[e]]=e);for(e=0;e=1&&y[s]++,2===M.jleaf&&y[M.q]--}-1!==e[s]&&(_[0+s]=e[s])}for(s=0;s=0;f--)for(p=n[f],c=n[f+1],i=p;i=0;a--)z[a]=-1,-1!==(f=q[a])&&(0==v[x+f]++&&(v[_+f]=a),v[0+a]=v[m+f],v[m+f]=a);for(e.lnz=0,e.m2=s,f=0;f=e},"number, number":function(e,t){return e>=t||r(e,t,n.epsilon)},"BigNumber, BigNumber":function(r,t){return r.gte(t)||e(r,t,n.epsilon)},"Fraction, Fraction":function(r,e){return-1!==r.compare(e)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(r,e){if(!r.equalBase(e))throw new Error("Cannot compare units with different base");return m(r.value,e.value)},"SparseMatrix, SparseMatrix":function(r,e){return l(r,e,m)},"SparseMatrix, DenseMatrix":function(r,e){return o(e,r,m,!0)},"DenseMatrix, SparseMatrix":function(r,e){return o(r,e,m,!1)},"DenseMatrix, DenseMatrix":function(r,e){return f(r,e,m)},"Array, Array":function(r,e){return m(u(r),u(e)).valueOf()},"Array, Matrix":function(r,e){return m(u(r),e)},"Matrix, Array":function(r,e){return m(r,u(e))},"SparseMatrix, any":function(r,e){return s(r,e,m,!1)},"DenseMatrix, any":function(r,e){return c(r,e,m,!1)},"any, SparseMatrix":function(r,e){return s(e,r,m,!0)},"any, DenseMatrix":function(r,e){return c(e,r,m,!0)},"Array, any":function(r,e){return c(u(r),e,m,!1).valueOf()},"any, Array":function(r,e){return c(u(e),r,m,!0).valueOf()}});return m.toTex={2:"\\left(${args[0]}".concat(x.operators.largerEq,"${args[1]}\\right)")},m}exports.name="largerEq",exports.factory=t; },{"../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB","../../utils/latex":"H1Mr"}],"HHkn":[function(require,module,exports) { "use strict";function r(){return function(r,t){return r[t]<0}}exports.name="csMarked",exports.path="algebra.sparse",exports.factory=r; },{}],"Lsyn":[function(require,module,exports) { "use strict";function r(r,e,t){var s=t(require("./csFlip"));return function(r,e){r[e]=s(r[e])}}exports.name="csMark",exports.path="algebra.sparse",exports.factory=r; },{"./csFlip":"da3s"}],"x9BP":[function(require,module,exports) { "use strict";function r(r,e,t){var s=t(require("./csFlip"));return function(r){return r<0?s(r):r}}exports.name="csUnflip",exports.path="algebra.sparse",exports.factory=r; },{"./csFlip":"da3s"}],"JD8V":[function(require,module,exports) { "use strict";function r(r,e,a){var s=a(require("./csMarked")),t=a(require("./csMark")),i=a(require("./csUnflip"));return function(r,e,a,n,c){var f,o,u,p=e._index,v=e._ptr,x=e._size[1],k=0;for(n[0]=r;k>=0;){r=n[k];var q=c?c[r]:r;s(v,r)||(t(v,r),n[x+k]=q<0?0:i(v[q]));var _=1;for(o=n[x+k],u=q<0?0:i(v[q+1]);o3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(n<0||n>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var i=s(t,r,!1),u=o(r,i,n);return{L:u.L,U:u.U,p:u.pinv,q:i.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})}exports.name="slu",exports.factory=n; },{"../../../utils/index":"fsXI","../../algebra/sparse/csSqr":"VNCK","../../algebra/sparse/csLu":"i7D2"}],"YTfO":[function(require,module,exports) { "use strict";var t=require("../../../../utils/index"),r=t.string,e=t.array,a=Array.isArray;function n(t){var n=t.DenseMatrix;return function(i,s,o){var m=i.size();if(2!==m.length)throw new RangeError("Matrix must be two dimensional (size: "+r.format(m)+")");var h,c,u,f=m[0];if(f!==m[1])throw new RangeError("Matrix must be square (size: "+r.format(m)+")");if(t.isMatrix(s)){var w=s.size();if(1===w.length){if(w[0]!==f)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(h=[],u=s._data,c=0;cy&&(q.push(x[i]),w.push(a));if(o(p,0))throw new Error("Linear system cannot be solved since matrix is singular");var M=n(h,p);for(i=0,z=w.length;i=0;x--){var d=a[x][0]||0,m=void 0;if(o(d,0))m=0;else{var _=v[x][x];if(o(_,0))throw new Error("Linear system cannot be solved since matrix is singular");m=n(d,_);for(var y=x-1;y>=0;y--)a[y]=[u(a[y][0]||0,s(m,v[y][x]))]}f[x]=[m]}return new c({data:f,size:[i,1]})}return i("usolve",{"SparseMatrix, Array | Matrix":function(r,e){return function(r,e){for(var a,i,t=(e=l(r,e,!0))._data,f=r._size[0],v=r._size[1],x=r._values,d=r._index,m=r._ptr,_=[],y=v-1;y>=0;y--){var h=t[y][0]||0;if(o(h,0))_[y]=[0];else{var p=0,q=[],w=[],z=m[y],M=m[y+1];for(i=M-1;i>=z;i--)(a=d[i])===y?p=x[i]:a=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6},Complex:function(e){var t=Math.exp(e.re);return new r.Complex(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)},"Array | Matrix":function(r){return e(r,u)}});return u.toTex="\\left(e".concat(o.operators.pow,"{${args[0]}}-1\\right)"),u}exports.name="expm1",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo","../../utils/latex":"H1Mr"}],"AWGe":[function(require,module,exports) { "use strict";var r=require("../../utils/number").isInteger;function e(r,e,n,i){var u=n(require("../../type/matrix/function/matrix")),a=n(require("../../type/matrix/utils/algorithm01")),m=n(require("../../type/matrix/utils/algorithm04")),o=n(require("../../type/matrix/utils/algorithm10")),s=n(require("../../type/matrix/utils/algorithm13")),c=n(require("../../type/matrix/utils/algorithm14")),f=i("gcd",{"number, number":t,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");var n=new r.BigNumber(0);for(;!t.isZero();){var i=e.mod(t);e=t,t=i}return e.lt(n)?e.neg():e},"Fraction, Fraction":function(r,e){return r.gcd(e)},"SparseMatrix, SparseMatrix":function(r,e){return m(r,e,f)},"SparseMatrix, DenseMatrix":function(r,e){return a(e,r,f,!0)},"DenseMatrix, SparseMatrix":function(r,e){return a(r,e,f,!1)},"DenseMatrix, DenseMatrix":function(r,e){return s(r,e,f)},"Array, Array":function(r,e){return f(u(r),u(e)).valueOf()},"Array, Matrix":function(r,e){return f(u(r),e)},"Matrix, Array":function(r,e){return f(r,u(e))},"SparseMatrix, number | BigNumber":function(r,e){return o(r,e,f,!1)},"DenseMatrix, number | BigNumber":function(r,e){return c(r,e,f,!1)},"number | BigNumber, SparseMatrix":function(r,e){return o(e,r,f,!0)},"number | BigNumber, DenseMatrix":function(r,e){return c(e,r,f,!0)},"Array, number | BigNumber":function(r,e){return c(u(r),e,f,!1).valueOf()},"number | BigNumber, Array":function(r,e){return c(u(e),r,f,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(r,e,t){for(var n=f(r,e),i=0;i0},BigNumber:function(r){return!r.isNeg()&&!r.isZero()&&!r.isNaN()},Fraction:function(r){return r.s>0&&r.n>0},Unit:function(r){return u(r.value)},"Array | Matrix":function(n){return r(n,u)}});return u}exports.name="isPositive",exports.factory=n; },{"../../utils/collection/deepMap":"lOYo"}],"YQ9T":[function(require,module,exports) { "use strict";var r=require("../../utils/array").flatten;function e(e,t,a,i){var u=a(require("./abs")),n=a(require("./addScalar")),l=a(require("./divideScalar")),o=a(require("./multiplyScalar")),s=a(require("./sqrt")),p=a(require("../relational/smaller")),y=a(require("../utils/isPositive")),c=i("hypot",{"... number | BigNumber":function(r){for(var e=0,t=0,a=0;a=0||t.predictable?Math.log(r):new e.Complex(r,0).log()},Complex:function(r){return r.log()},BigNumber:function(r){return!r.isNegative()||t.predictable?r.ln():new e.Complex(r.toNumber(),0).log()},"Array | Matrix":function(e){return r(e,l)},"any, any":function(r,e){return i(l(r),l(e))}});return l.toTex={1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},l}exports.name="log",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo","./divideScalar":"R3aq"}],"Bbg8":[function(require,module,exports) { "use strict";var e=require("../../utils/collection/deepMap");function t(t,o,n,i){var l=i("log10",{number:function(e){return e>=0||o.predictable?r(e):new t.Complex(e,0).log().div(Math.LN10)},Complex:function(e){return new t.Complex(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||o.predictable?e.log():new t.Complex(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":function(t){return e(t,l)}});return l.toTex={1:"\\log_{10}\\left(${args[0]}\\right)"},l}var r=Math.log10||function(e){return Math.log(e)/Math.LN10};exports.name="log10",exports.factory=t; },{"../../utils/collection/deepMap":"lOYo"}],"pWAs":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function e(e,t,n,a){var i=n(require("./divideScalar")),o=n(require("./log")),l=a("log1p",{number:function(r){return r>=-1||t.predictable?Math.log1p?Math.log1p(r):Math.log(r+1):u(new e.Complex(r,0))},Complex:u,BigNumber:function(r){var n=r.plus(1);return!n.isNegative()||t.predictable?n.ln():u(new e.Complex(r.toNumber(),0))},"Array | Matrix":function(e){return r(e,l)},"any, any":function(r,e){return i(l(r),o(e))}});function u(r){var t=r.re+1;return new e.Complex(Math.log(Math.sqrt(t*t+r.im*r.im)),Math.atan2(r.im,t))}return l.toTex={1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},l}exports.name="log1p",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo","./divideScalar":"R3aq","./log":"T05K"}],"MzTq":[function(require,module,exports) { "use strict";var t=require("../../utils/collection/deepMap");function e(e,r,o,a){var n=a("log2",{number:function(t){return t>=0||r.predictable?Math.log2?Math.log2(t):Math.log(t)/Math.LN2:l(new e.Complex(t,0))},Complex:l,BigNumber:function(t){return!t.isNegative()||r.predictable?t.log(2):l(new e.Complex(t.toNumber(),0))},"Array | Matrix":function(e){return t(e,n)}});function l(t){var r=Math.sqrt(t.re*t.re+t.im*t.im);return new e.Complex(Math.log2?Math.log2(r):Math.log(r)/Math.LN2,Math.atan2(t.im,t.re)/Math.LN2)}return n.toTex="\\log_{2}\\left(${args[0]}\\right)",n}exports.name="log2",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo"}],"sR9e":[function(require,module,exports) { "use strict";function r(r,t,e,i){var n=e(require("../../type/matrix/function/matrix")),a=require("../../utils/latex"),u=e(require("../../type/matrix/utils/algorithm02")),o=e(require("../../type/matrix/utils/algorithm03")),s=e(require("../../type/matrix/utils/algorithm05")),f=e(require("../../type/matrix/utils/algorithm11")),m=e(require("../../type/matrix/utils/algorithm12")),x=e(require("../../type/matrix/utils/algorithm13")),c=e(require("../../type/matrix/utils/algorithm14")),l=i("mod",{"number, number":function(r,t){if(t>0)return r-t*Math.floor(r/t);if(0===t)return r;throw new Error("Cannot calculate mod for a negative divisor")},"BigNumber, BigNumber":function(r,t){return t.isZero()?r:r.mod(t)},"Fraction, Fraction":function(r,t){return r.mod(t)},"SparseMatrix, SparseMatrix":function(r,t){return s(r,t,l,!1)},"SparseMatrix, DenseMatrix":function(r,t){return u(t,r,l,!0)},"DenseMatrix, SparseMatrix":function(r,t){return o(r,t,l,!1)},"DenseMatrix, DenseMatrix":function(r,t){return x(r,t,l)},"Array, Array":function(r,t){return l(n(r),n(t)).valueOf()},"Array, Matrix":function(r,t){return l(n(r),t)},"Matrix, Array":function(r,t){return l(r,n(t))},"SparseMatrix, any":function(r,t){return f(r,t,l,!1)},"DenseMatrix, any":function(r,t){return c(r,t,l,!1)},"any, SparseMatrix":function(r,t){return m(t,r,l,!0)},"any, DenseMatrix":function(r,t){return c(t,r,l,!0)},"Array, any":function(r,t){return c(n(r),t,l,!1).valueOf()},"any, Array":function(r,t){return c(n(t),r,l,!0).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(a.operators.mod,"${args[1]}\\right)")},l}exports.name="mod",exports.factory=r; },{"../../type/matrix/function/matrix":"vzj5","../../utils/latex":"H1Mr","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm05":"JNXe","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"Ts3b":[function(require,module,exports) { "use strict";function r(r,e,n,t){var i=n(require("../arithmetic/abs")),u=n(require("../arithmetic/add")),a=n(require("../arithmetic/pow")),o=n(require("../complex/conj")),f=n(require("../arithmetic/sqrt")),m=n(require("../arithmetic/multiply")),c=n(require("../relational/equalScalar")),l=n(require("../relational/larger")),s=n(require("../relational/smaller")),b=n(require("../../type/matrix/function/matrix")),p=t("norm",{number:Math.abs,Complex:function(r){return r.abs()},BigNumber:function(r){return r.abs()},boolean:function(r){return Math.abs(r)},Array:function(r){return N(b(r),2)},Matrix:function(r){return N(r,2)},"number | Complex | BigNumber | boolean, number | BigNumber | string":function(r){return p(r)},"Array, number | BigNumber | string":function(r,e){return N(b(r),e)},"Matrix, number | BigNumber | string":function(r,e){return N(r,e)}});function N(r,e){var n=r.size();if(1===n.length){if(e===Number.POSITIVE_INFINITY||"inf"===e){var t=0;return r.forEach(function(r){var e=i(r);l(e,t)&&(t=e)},!0),t}var b;if(e===Number.NEGATIVE_INFINITY||"-inf"===e)return r.forEach(function(r){var e=i(r);b&&!s(e,b)||(b=e)},!0),b||0;if("fro"===e)return N(r,2);if("number"==typeof e&&!isNaN(e)){if(!c(e,0)){var p=0;return r.forEach(function(r){p=u(a(i(r),e),p)},!0),a(p,1/e)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}if(2===n.length){if(1===e){var h=[],I=0;return r.forEach(function(r,e){var n=e[1],t=u(h[n]||0,i(r));l(t,I)&&(I=t),h[n]=t},!0),I}if(e===Number.POSITIVE_INFINITY||"inf"===e){var v=[],g=0;return r.forEach(function(r,e){var n=e[0],t=u(v[n]||0,i(r));l(t,g)&&(g=t),v[n]=t},!0),g}if("fro"===e){var E=0;return r.forEach(function(r,e){E=u(E,m(r,o(r)))}),i(f(E))}if(2===e)throw new Error("Unsupported parameter value, missing implementation of matrix singular value decomposition");throw new Error("Unsupported parameter value")}}return p.toTex={1:"\\left\\|${args[0]}\\right\\|",2:void 0},p}exports.name="norm",exports.factory=r; },{"../arithmetic/abs":"K5X1","../arithmetic/add":"zf2Z","../arithmetic/pow":"CsUv","../complex/conj":"msvi","../arithmetic/sqrt":"T6pB","../arithmetic/multiply":"k7By","../relational/equalScalar":"QvIw","../relational/larger":"SrDl","../relational/smaller":"Q7ag","../../type/matrix/function/matrix":"vzj5"}],"g0GR":[function(require,module,exports) { "use strict";function r(r,t,n,i){var o=n(require("../../type/matrix/function/matrix")),u=n(require("../../type/matrix/utils/algorithm01")),a=n(require("../../type/matrix/utils/algorithm02")),s=n(require("../../type/matrix/utils/algorithm06")),m=n(require("../../type/matrix/utils/algorithm11")),f=n(require("../../type/matrix/utils/algorithm13")),b=n(require("../../type/matrix/utils/algorithm14")),c="Complex number not supported in function nthRoot. Use nthRoots instead.",g=i("nthRoot",{number:function(r){return e(r,2)},"number, number":e,BigNumber:function(e){return x(e,new r.BigNumber(2))},Complex:function(r){throw new Error(c)},"Complex, number":function(r,e){throw new Error(c)},"BigNumber, BigNumber":x,"Array | Matrix":function(r){return g(r,2)},"SparseMatrix, SparseMatrix":function(r,e){if(1===e.density())return s(r,e,g);throw new Error("Root must be non-zero")},"SparseMatrix, DenseMatrix":function(r,e){return a(e,r,g,!0)},"DenseMatrix, SparseMatrix":function(r,e){if(1===e.density())return u(r,e,g,!1);throw new Error("Root must be non-zero")},"DenseMatrix, DenseMatrix":function(r,e){return f(r,e,g)},"Array, Array":function(r,e){return g(o(r),o(e)).valueOf()},"Array, Matrix":function(r,e){return g(o(r),e)},"Matrix, Array":function(r,e){return g(r,o(e))},"SparseMatrix, number | BigNumber":function(r,e){return m(r,e,g,!1)},"DenseMatrix, number | BigNumber":function(r,e){return b(r,e,g,!1)},"number | BigNumber, SparseMatrix":function(r,e){if(1===e.density())return m(e,r,g,!0);throw new Error("Root must be non-zero")},"number | BigNumber, DenseMatrix":function(r,e){return b(e,r,g,!0)},"Array, number | BigNumber":function(r,e){return g(o(r),e).valueOf()},"number | BigNumber, Array":function(r,e){return g(r,o(e)).valueOf()}});return g.toTex={2:"\\sqrt[${args[1]}]{${args[0]}}"},g;function x(e,t){var n=r.BigNumber.precision,i=r.BigNumber.clone({precision:n+2}),o=new r.BigNumber(0),u=new i(1),a=t.isNegative();if(a&&(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 a?new i(1/0):0;if(!e.isFinite())return a?o:e;var s=e.abs().pow(u.div(t));return s=e.isNeg()?s.neg():s,new r.BigNumber((a?u.div(s):s).toPrecision(n))}}function e(r,e){var t=e<0;if(t&&(e=-e),0===e)throw new Error("Root must be non-zero");if(r<0&&Math.abs(e)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===r)return t?1/0:0;if(!isFinite(r))return t?0:r;var n=Math.pow(Math.abs(r),1/e);return n=r<0?-n:n,t?1/n:n}exports.name="nthRoot",exports.factory=r; },{"../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm01":"q1c8","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm06":"WzD7","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"Eyh8":[function(require,module,exports) { "use strict";var r=require("../../type/complex/Complex"),t=require("../../core/typed"),o=r.factory("Complex",{},"",t,{on:function(r,t){}});function e(r,t,o,e){var n=e("nthRoots",{Complex:function(r){return u(r,2)},"Complex, number":u});return n.toTex={2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},n}var n=[function(r){return o(r)},function(r){return o(0,r)},function(r){return o(-r)},function(r){return o(0,-r)}];function u(r,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===r||0===r.abs())return[o(0)];var e,u="number"==typeof r;(u||0===r.re||0===r.im)&&(e=u?2*+(r<0):0===r.im?2*+(r.re<0):2*+(r.im<0)+1);for(var a=r.arg(),i=r.abs(),f=[],s=Math.pow(i,1/t),m=0;m0)if(++s>a)for(s-=a;s--;)f+="0";else s1&&(null!==c[v+1]&&void 0!==c[v+1]||(c[v+1]=0),c[v+1]+=c[v]>>1,c[v]&=1)}return c.reverse()}module.exports=function(n,t,l){var o,i,s,f,a,c=n.constructor,g=+(n.s<0),h=+(t.s<0);if(g){o=r(e(n));for(var v=0;v0;)l(s[--p],f[--d])===m&&(w=w.plus(A)),A=A.times(b);for(;d>0;)l(a,f[--d])===m&&(w=w.plus(A)),A=A.times(b);return c.config({precision:q}),0===m&&(w.s=-w.s),w}; },{"./bitNot":"LJa0"}],"upit":[function(require,module,exports) { "use strict";var i=require("./bitwise");module.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(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 n(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new n(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new n(0):e}return i(e,t,function(i,e){return i&e})}; },{"./bitwise":"aXnU"}],"LRIo":[function(require,module,exports) { "use strict";var r=require("../../utils/number").isInteger,t=require("../../utils/bignumber/bitAnd");function e(e,n,i,u){var a=require("../../utils/latex"),o=i(require("../../type/matrix/function/matrix")),s=i(require("../../type/matrix/utils/algorithm02")),x=i(require("../../type/matrix/utils/algorithm06")),f=i(require("../../type/matrix/utils/algorithm11")),c=i(require("../../type/matrix/utils/algorithm13")),m=i(require("../../type/matrix/utils/algorithm14")),y=u("bitAnd",{"number, number":function(t,e){if(!r(t)||!r(e))throw new Error("Integers expected in function bitAnd");return t&e},"BigNumber, BigNumber":t,"SparseMatrix, SparseMatrix":function(r,t){return x(r,t,y,!1)},"SparseMatrix, DenseMatrix":function(r,t){return s(t,r,y,!0)},"DenseMatrix, SparseMatrix":function(r,t){return s(r,t,y,!1)},"DenseMatrix, DenseMatrix":function(r,t){return c(r,t,y)},"Array, Array":function(r,t){return y(o(r),o(t)).valueOf()},"Array, Matrix":function(r,t){return y(o(r),t)},"Matrix, Array":function(r,t){return y(r,o(t))},"SparseMatrix, any":function(r,t){return f(r,t,y,!1)},"DenseMatrix, any":function(r,t){return m(r,t,y,!1)},"any, SparseMatrix":function(r,t){return f(t,r,y,!0)},"any, DenseMatrix":function(r,t){return m(t,r,y,!0)},"Array, any":function(r,t){return m(o(r),t,y,!1).valueOf()},"any, Array":function(r,t){return m(o(t),r,y,!0).valueOf()}});return y.toTex={2:"\\left(${args[0]}".concat(a.operators.bitAnd,"${args[1]}\\right)")},y}exports.name="bitAnd",exports.factory=e; },{"../../utils/number":"uqMu","../../utils/bignumber/bitAnd":"upit","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm06":"WzD7","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"Oh4X":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap"),t=require("../../utils/bignumber/bitNot"),e=require("../../utils/number").isInteger;function i(i,n,u,o){var s=require("../../utils/latex"),a=o("bitNot",{number:function(r){if(!e(r))throw new Error("Integer expected in function bitNot");return~r},BigNumber:t,"Array | Matrix":function(t){return r(t,a)}});return a.toTex={1:s.operators.bitNot+"\\left(${args[0]}\\right)"},a}exports.name="bitNot",exports.factory=i; },{"../../utils/collection/deepMap":"lOYo","../../utils/bignumber/bitNot":"LJa0","../../utils/number":"uqMu","../../utils/latex":"H1Mr"}],"MUNI":[function(require,module,exports) { "use strict";var i=require("./bitwise");module.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var s=e.constructor;if(e.isNaN()||t.isNaN())return new s(NaN);var n=new s(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:e.isFinite()&&t.isFinite()?i(e,t,function(i,e){return i|e}):!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}; },{"./bitwise":"aXnU"}],"kLOX":[function(require,module,exports) { "use strict";var r=require("../../utils/number").isInteger,t=require("../../utils/bignumber/bitOr");function e(e,i,n,u){var a=require("../../utils/latex"),o=n(require("../../type/matrix/function/matrix")),s=n(require("../../type/matrix/utils/algorithm01")),x=n(require("../../type/matrix/utils/algorithm04")),f=n(require("../../type/matrix/utils/algorithm10")),c=n(require("../../type/matrix/utils/algorithm13")),m=n(require("../../type/matrix/utils/algorithm14")),y=u("bitOr",{"number, number":function(t,e){if(!r(t)||!r(e))throw new Error("Integers expected in function bitOr");return t|e},"BigNumber, BigNumber":t,"SparseMatrix, SparseMatrix":function(r,t){return x(r,t,y)},"SparseMatrix, DenseMatrix":function(r,t){return s(t,r,y,!0)},"DenseMatrix, SparseMatrix":function(r,t){return s(r,t,y,!1)},"DenseMatrix, DenseMatrix":function(r,t){return c(r,t,y)},"Array, Array":function(r,t){return y(o(r),o(t)).valueOf()},"Array, Matrix":function(r,t){return y(o(r),t)},"Matrix, Array":function(r,t){return y(r,o(t))},"SparseMatrix, any":function(r,t){return f(r,t,y,!1)},"DenseMatrix, any":function(r,t){return m(r,t,y,!1)},"any, SparseMatrix":function(r,t){return f(t,r,y,!0)},"any, DenseMatrix":function(r,t){return m(t,r,y,!0)},"Array, any":function(r,t){return m(o(r),t,y,!1).valueOf()},"any, Array":function(r,t){return m(o(t),r,y,!0).valueOf()}});return y.toTex={2:"\\left(${args[0]}".concat(a.operators.bitOr,"${args[1]}\\right)")},y}exports.name="bitOr",exports.factory=e; },{"../../utils/number":"uqMu","../../utils/bignumber/bitOr":"MUNI","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm01":"q1c8","../../type/matrix/utils/algorithm04":"m7Qa","../../type/matrix/utils/algorithm10":"H0xb","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"LBOM":[function(require,module,exports) { "use strict";var i=require("./bitwise"),e=require("./bitNot");module.exports=function(r,t){if(r.isFinite()&&!r.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var n=r.constructor;if(r.isNaN()||t.isNaN())return new n(NaN);if(r.isZero())return t;if(t.isZero())return r;if(r.eq(t))return new n(0);var s=new n(-1);return r.eq(s)?e(t):t.eq(s)?e(r):r.isFinite()&&t.isFinite()?i(r,t,function(i,e){return i^e}):r.isFinite()||t.isFinite()?new n(r.isNegative()===t.isNegative()?1/0:-1/0):s}; },{"./bitwise":"aXnU","./bitNot":"LJa0"}],"WoWZ":[function(require,module,exports) { "use strict";var r=require("../../utils/number").isInteger,t=require("../../utils/bignumber/bitXor");function e(e,i,n,u){var a=require("../../utils/latex"),o=n(require("../../type/matrix/function/matrix")),s=n(require("../../type/matrix/utils/algorithm03")),x=n(require("../../type/matrix/utils/algorithm07")),f=n(require("../../type/matrix/utils/algorithm12")),c=n(require("../../type/matrix/utils/algorithm13")),m=n(require("../../type/matrix/utils/algorithm14")),y=u("bitXor",{"number, number":function(t,e){if(!r(t)||!r(e))throw new Error("Integers expected in function bitXor");return t^e},"BigNumber, BigNumber":t,"SparseMatrix, SparseMatrix":function(r,t){return x(r,t,y)},"SparseMatrix, DenseMatrix":function(r,t){return s(t,r,y,!0)},"DenseMatrix, SparseMatrix":function(r,t){return s(r,t,y,!1)},"DenseMatrix, DenseMatrix":function(r,t){return c(r,t,y)},"Array, Array":function(r,t){return y(o(r),o(t)).valueOf()},"Array, Matrix":function(r,t){return y(o(r),t)},"Matrix, Array":function(r,t){return y(r,o(t))},"SparseMatrix, any":function(r,t){return f(r,t,y,!1)},"DenseMatrix, any":function(r,t){return m(r,t,y,!1)},"any, SparseMatrix":function(r,t){return f(t,r,y,!0)},"any, DenseMatrix":function(r,t){return m(t,r,y,!0)},"Array, any":function(r,t){return m(o(r),t,y,!1).valueOf()},"any, Array":function(r,t){return m(o(t),r,y,!0).valueOf()}});return y.toTex={2:"\\left(${args[0]}".concat(a.operators.bitXor,"${args[1]}\\right)")},y}exports.name="bitXor",exports.factory=e; },{"../../utils/number":"uqMu","../../utils/bignumber/bitXor":"LBOM","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm07":"u44a","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"Wxcu":[function(require,module,exports) { "use strict";module.exports=function(e,i){if(e.isFinite()&&!e.isInteger()||i.isFinite()&&!i.isInteger())throw new Error("Integers expected in function leftShift");var t=e.constructor;return e.isNaN()||i.isNaN()||i.isNegative()&&!i.isZero()?new t(NaN):e.isZero()||i.isZero()?e:e.isFinite()||i.isFinite()?i.lt(55)?e.times(Math.pow(2,i.toNumber())+""):e.times(new t(2).pow(i)):new t(NaN)}; },{}],"sHbh":[function(require,module,exports) { "use strict";var r=require("../../../error/DimensionError");function e(e,t,n,a){var i=n(require("../../../function/relational/equalScalar")),o=e.SparseMatrix;return function(e,t,n){var s=e._values,l=e._index,p=e._ptr,f=e._size,h=e._datatype,u=t._values,c=t._index,v=t._ptr,g=t._size,_=t._datatype;if(f.length!==g.length)throw new r(f.length,g.length);if(f[0]!==g[0]||f[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+g+")");if(!s||!u)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var m,d=f[0],x=f[1],w=i,y=0,M=n;"string"==typeof h&&h===_&&(m=h,w=a.find(i,[m,m]),y=a.convert(0,m),M=a.find(n,[m,m]));for(var q,z,E,S,D=[],A=[],B=[],C=new o({values:D,index:A,ptr:B,size:[d,x],datatype:m}),P=[],R=[],b=0;b>e},"BigNumber, BigNumber":t,"SparseMatrix, SparseMatrix":function(r,t){return g(r,t,p,!1)},"SparseMatrix, DenseMatrix":function(r,t){return f(t,r,p,!0)},"DenseMatrix, SparseMatrix":function(r,t){return x(r,t,p,!1)},"DenseMatrix, DenseMatrix":function(r,t){return h(r,t,p)},"Array, Array":function(r,t){return p(o(r),o(t)).valueOf()},"Array, Matrix":function(r,t){return p(o(r),t)},"Matrix, Array":function(r,t){return p(r,o(t))},"SparseMatrix, number | BigNumber":function(r,t){return m(t,0)?r.clone():c(r,t,p,!1)},"DenseMatrix, number | BigNumber":function(r,t){return m(t,0)?r.clone():b(r,t,p,!1)},"number | BigNumber, SparseMatrix":function(r,t){return m(r,0)?s(t.size(),t.storage()):l(t,r,p,!0)},"number | BigNumber, DenseMatrix":function(r,t){return m(r,0)?s(t.size(),t.storage()):b(t,r,p,!0)},"Array, number | BigNumber":function(r,t){return p(o(r),t).valueOf()},"number | BigNumber, Array":function(r,t){return p(r,o(t)).valueOf()}});return p.toTex={2:"\\left(${args[0]}".concat(a.operators.rightArithShift,"${args[1]}\\right)")},p}exports.name="rightArithShift",exports.factory=e; },{"../../utils/number":"uqMu","../../utils/bignumber/rightArithShift":"gyUS","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../relational/equalScalar":"QvIw","../matrix/zeros":"BAjv","../../type/matrix/utils/algorithm01":"q1c8","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm08":"sHbh","../../type/matrix/utils/algorithm10":"H0xb","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"KdQk":[function(require,module,exports) { "use strict";var r=require("../../utils/number").isInteger;function e(e,t,i,n){var u=require("../../utils/latex"),a=i(require("../../type/matrix/function/matrix")),o=i(require("../relational/equalScalar")),s=i(require("../matrix/zeros")),m=i(require("../../type/matrix/utils/algorithm01")),x=i(require("../../type/matrix/utils/algorithm02")),g=i(require("../../type/matrix/utils/algorithm08")),f=i(require("../../type/matrix/utils/algorithm10")),l=i(require("../../type/matrix/utils/algorithm11")),c=i(require("../../type/matrix/utils/algorithm13")),p=i(require("../../type/matrix/utils/algorithm14")),h=n("rightLogShift",{"number, number":function(e,t){if(!r(e)||!r(t))throw new Error("Integers expected in function rightLogShift");return e>>>t},"SparseMatrix, SparseMatrix":function(r,e){return g(r,e,h,!1)},"SparseMatrix, DenseMatrix":function(r,e){return x(e,r,h,!0)},"DenseMatrix, SparseMatrix":function(r,e){return m(r,e,h,!1)},"DenseMatrix, DenseMatrix":function(r,e){return c(r,e,h)},"Array, Array":function(r,e){return h(a(r),a(e)).valueOf()},"Array, Matrix":function(r,e){return h(a(r),e)},"Matrix, Array":function(r,e){return h(r,a(e))},"SparseMatrix, number | BigNumber":function(r,e){return o(e,0)?r.clone():l(r,e,h,!1)},"DenseMatrix, number | BigNumber":function(r,e){return o(e,0)?r.clone():p(r,e,h,!1)},"number | BigNumber, SparseMatrix":function(r,e){return o(r,0)?s(e.size(),e.storage()):f(e,r,h,!0)},"number | BigNumber, DenseMatrix":function(r,e){return o(r,0)?s(e.size(),e.storage()):p(e,r,h,!0)},"Array, number | BigNumber":function(r,e){return h(a(r),e).valueOf()},"number | BigNumber, Array":function(r,e){return h(r,a(e)).valueOf()}});return h.toTex={2:"\\left(${args[0]}".concat(u.operators.rightLogShift,"${args[1]}\\right)")},h}exports.name="rightLogShift",exports.factory=e; },{"../../utils/number":"uqMu","../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../relational/equalScalar":"QvIw","../matrix/zeros":"BAjv","../../type/matrix/utils/algorithm01":"q1c8","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm08":"sHbh","../../type/matrix/utils/algorithm10":"H0xb","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"JhAg":[function(require,module,exports) { "use strict";module.exports=[require("./bitAnd"),require("./bitNot"),require("./bitOr"),require("./bitXor"),require("./leftShift"),require("./rightArithShift"),require("./rightLogShift")]; },{"./bitAnd":"LRIo","./bitNot":"Oh4X","./bitOr":"kLOX","./bitXor":"WoWZ","./leftShift":"p0FC","./rightArithShift":"DRd9","./rightLogShift":"KdQk"}],"FONy":[function(require,module,exports) { "use strict";function r(t,e){var u;return e>1)*r(u+1,e)}module.exports=r; },{}],"ciea":[function(require,module,exports) { "use strict";var e=require("../../utils/collection/deepMap"),r=require("../../utils/number").isInteger;function i(i,a,u,m){var o=u(require("../arithmetic/multiply")),s=u(require("../arithmetic/pow")),h=require("./product"),c=m("gamma",{number:function(e){var i,a;if(r(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:h(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*c(1-e));if(e>=171.35)return 1/0;if(e>85){var u=e*e,m=u*e,o=m*e,s=o*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*u)-139/(51840*m)-571/(2488320*o)+163879/(209018880*s)+5246819/(75246796800*s*e))}--e,a=n[0];for(var g=1;g1;)t=t.times(n),n--;return new i.BigNumber(t.toPrecision(i.BigNumber.precision))}(e.minus(1));if(!e.isFinite())return new i.BigNumber(e.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")},"Array | Matrix":function(r){return e(r,c)}});return c.toTex={1:"\\Gamma\\left(${args[0]}\\right)"},c}var t=4.7421875,n=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];exports.name="gamma",exports.factory=i; },{"../../utils/collection/deepMap":"lOYo","../../utils/number":"uqMu","../arithmetic/multiply":"k7By","../arithmetic/pow":"CsUv","./product":"FONy"}],"yidz":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function e(e,t,a,n){var i=a(require("./gamma")),o=require("../../utils/latex"),u=n("factorial",{number:function(r){if(r<0)throw new Error("Value must be non-negative");return i(r+1)},BigNumber:function(r){if(r.isNegative())throw new Error("Value must be non-negative");return i(r.plus(1))},"Array | Matrix":function(e){return r(e,u)}});return u.toTex={1:"\\left(${args[0]}\\right)".concat(o.operators.factorial)},u}exports.name="factorial",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo","./gamma":"ciea","../../utils/latex":"H1Mr"}],"n9b2":[function(require,module,exports) { "use strict";var e=require("../../utils/number").isInteger,n=require("./product");function r(r,t,o,u){var s=u("combinations",{"number, number":function(r,i){var t;if(!e(r)||r<0)throw new TypeError("Positive integer value expected in function combinations");if(!e(i)||i<0)throw new TypeError("Positive integer value expected in function combinations");if(i>r)throw new TypeError("k must be less than or equal to n");return i<(t=r-i)?n(t+1,r)/n(1,i):n(i+1,r)/n(1,t)},"BigNumber, BigNumber":function(e,n){var t,o,u,s,a=new r.BigNumber(1);if(!i(e)||!i(n))throw new TypeError("Positive integer value expected in function combinations");if(n.gt(e))throw new TypeError("k must be less than n in function combinations");for(t=e.minus(n),n.lt(t)&&(t=n),o=a,u=a,s=e.minus(t);u.lte(s);u=u.plus(1))o=o.times(t.plus(u)).dividedBy(u);return o}});return s.toTex={2:"\\binom{${args[0]}}{${args[1]}}"},s}function i(e){return e.isInteger()&&e.gte(0)}exports.name="combinations",exports.factory=r; },{"../../utils/number":"uqMu","./product":"FONy"}],"qG7X":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap"),e=require("../../utils/number");function n(n,t,i,u){var s=u("isInteger",{number:e.isInteger,BigNumber:function(r){return r.isInt()},Fraction:function(r){return 1===r.d&&isFinite(r.n)},"Array | Matrix":function(e){return r(e,s)}});return s}exports.name="isInteger",exports.factory=n; },{"../../utils/collection/deepMap":"lOYo","../../utils/number":"uqMu"}],"RVLq":[function(require,module,exports) { "use strict";function r(r,e,i,t){var n=i(require("../arithmetic/add")),u=i(require("../arithmetic/subtract")),a=i(require("../arithmetic/multiply")),o=i(require("../arithmetic/divide")),l=i(require("../arithmetic/pow")),s=i(require("../probability/factorial")),c=i(require("../probability/combinations")),m=i(require("../utils/isNegative")),g=i(require("../utils/isInteger")),b=i(require("../relational/larger")),q=t("stirlingS2",{"number | BigNumber, number | BigNumber":function(r,e){if(!g(r)||m(r)||!g(e)||m(e))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(b(e,r))throw new TypeError("k must be less than or equal to n in function stirlingS2");for(var i=s(e),t=0,q=0;q<=e;q++){var f=l(-1,u(e,q)),h=c(e,q),p=l(q,r);t=n(t,a(a(h,p),f))}return o(t,i)}});return q.toTex={2:"\\mathrm{S}\\left(${args}\\right)"},q}exports.name="stirlingS2",exports.factory=r; },{"../arithmetic/add":"zf2Z","../arithmetic/subtract":"m78R","../arithmetic/multiply":"k7By","../arithmetic/divide":"lVgQ","../arithmetic/pow":"CsUv","../probability/factorial":"yidz","../probability/combinations":"n9b2","../utils/isNegative":"HYoC","../utils/isInteger":"qG7X","../relational/larger":"SrDl"}],"VdBl":[function(require,module,exports) { "use strict";function e(e,r,t,i){var u=t(require("../arithmetic/add")),n=t(require("./stirlingS2")),s=t(require("../utils/isNegative")),a=t(require("../utils/isInteger")),o=i("bellNumbers",{"number | BigNumber":function(e){if(!a(e)||s(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var r=0,t=0;t<=e;t++)r=u(r,n(e,t));return r}});return o.toTex={1:"\\mathrm{B}_{${args[0]}}"},o}exports.name="bellNumbers",exports.factory=e; },{"../arithmetic/add":"zf2Z","./stirlingS2":"RVLq","../utils/isNegative":"HYoC","../utils/isInteger":"qG7X"}],"FQ9r":[function(require,module,exports) { "use strict";function e(e,i,r,o){var t=r(require("../probability/combinations")),n=r(require("../arithmetic/addScalar")),u=r(require("../utils/isPositive")),s=r(require("../utils/isInteger")),a=r(require("../relational/larger")),c=o("composition",{"number | BigNumber, number | BigNumber":function(e,i){if(!(s(e)&&u(e)&&s(i)&&u(i)))throw new TypeError("Positive integer value expected in function composition");if(a(i,e))throw new TypeError("k must be less than or equal to n in function composition");return t(n(e,-1),n(i,-1))}});return c.toTex=void 0,c}exports.name="composition",exports.factory=e; },{"../probability/combinations":"n9b2","../arithmetic/addScalar":"ZM3O","../utils/isPositive":"OFKG","../utils/isInteger":"qG7X","../relational/larger":"SrDl"}],"UHHf":[function(require,module,exports) { "use strict";function e(e,r,i,t){var a=i(require("../arithmetic/add")),n=i(require("../arithmetic/divide")),u=i(require("../arithmetic/multiply")),c=i(require("../probability/combinations")),o=i(require("../utils/isNegative")),m=i(require("../utils/isInteger")),s=t("catalan",{"number | BigNumber":function(e){if(!m(e)||o(e))throw new TypeError("Non-negative integer value expected in function catalan");return n(c(u(e,2),e),a(e,1))}});return s.toTex={1:"\\mathrm{C}_{${args[0]}}"},s}exports.name="catalan",exports.factory=e; },{"../arithmetic/add":"zf2Z","../arithmetic/divide":"lVgQ","../arithmetic/multiply":"k7By","../probability/combinations":"n9b2","../utils/isNegative":"HYoC","../utils/isInteger":"qG7X"}],"otxT":[function(require,module,exports) { "use strict";module.exports=[require("./bellNumbers"),require("./composition"),require("./stirlingS2"),require("./catalan")]; },{"./bellNumbers":"VdBl","./composition":"FQ9r","./stirlingS2":"RVLq","./catalan":"UHHf"}],"UjqL":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function t(t,e,n,a){var u=a("arg",{number:function(r){return Math.atan2(0,r)},BigNumber:function(r){return t.BigNumber.atan2(0,r)},Complex:function(r){return r.arg()},"Array | Matrix":function(t){return r(t,u)}});return u.toTex={1:"\\arg\\left(${args[0]}\\right)"},u}exports.name="arg",exports.factory=t; },{"../../utils/collection/deepMap":"lOYo"}],"NXCa":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function e(e,t,n,i){var u=i("im",{number:function(r){return 0},BigNumber:function(r){return new e.BigNumber(0)},Complex:function(r){return r.im},"Array | Matrix":function(e){return r(e,u)}});return u.toTex={1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},u}exports.name="im",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo"}],"Vvrl":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function e(e,t,n,u){var i=u("re",{number:function(r){return r},BigNumber:function(r){return r},Complex:function(r){return r.re},"Array | Matrix":function(e){return r(e,i)}});return i.toTex={1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},i}exports.name="re",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo"}],"gHt6":[function(require,module,exports) { "use strict";module.exports=[require("./arg"),require("./conj"),require("./im"),require("./re")]; },{"./arg":"UjqL","./conj":"msvi","./im":"NXCa","./re":"Vvrl"}],"Lso4":[function(require,module,exports) { "use strict";function r(r,e,t,i){var n=t(require("../arithmetic/abs")),u=t(require("../arithmetic/add")),a=t(require("../arithmetic/addScalar")),o=t(require("../../type/matrix/function/matrix")),f=t(require("../arithmetic/multiply")),m=t(require("../arithmetic/multiplyScalar")),c=t(require("../arithmetic/divideScalar")),h=t(require("../arithmetic/subtract")),s=t(require("../relational/smaller")),w=t(require("../relational/equalScalar")),y=i("intersect",{"Array, Array, Array":function(r,e,t){if(!g(r))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!g(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!function(r){return 4===r.length&&l(r[0])&&l(r[1])&&l(r[2])&&l(r[3])}(t))throw new TypeError("Array with 4 numbers expected as third argument");return function(r,e,t,i,n,u,o,f,s,w){var y=m(r,o),l=m(i,o),p=m(e,f),g=m(n,f),b=m(t,s),d=m(u,s),x=c(h(h(h(w,y),p),b),h(h(h(a(a(l,g),d),y),p),b)),A=a(r,m(x,h(i,r))),v=a(e,m(x,h(n,e))),E=a(t,m(x,h(u,t)));return[A,v,E]}(r[0],r[1],r[2],e[0],e[1],e[2],t[0],t[1],t[2],t[3])},"Array, Array, Array, Array":function(r,t,i,o){if(2===r.length){if(!p(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!p(i))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!p(o))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(r,t,i,o){var w=r,y=i,l=h(w,t),p=h(y,o),g=h(m(l[0],p[1]),m(p[0],l[1]));if(s(n(g),e.epsilon))return null;var b=m(p[0],w[1]),d=m(p[1],w[0]),x=m(p[0],y[1]),A=m(p[1],y[0]),v=c(a(h(h(b,d),x),A),g);return u(f(l,v),w)}(r,t,i,o)}if(3===r.length){if(!g(r))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!g(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!g(i))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!g(o))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return y=r[0],l=r[1],d=r[2],x=t[0],A=t[1],v=t[2],E=i[0],T=i[1],q=i[2],B=o[0],N=o[1],M=o[2],O=b(y,E,B,E,l,T,N,T,d,q,M,q),S=b(B,E,x,y,N,T,A,l,M,q,v,d),j=b(y,E,x,y,l,T,A,l,d,q,v,d),k=b(B,E,B,E,N,T,N,T,M,q,M,q),z=b(x,y,x,y,A,l,A,l,v,d,v,d),C=c(h(m(O,S),m(j,k)),h(m(z,k),m(S,S))),D=c(a(O,m(C,S)),k),F=a(y,m(C,h(x,y))),G=a(l,m(C,h(A,l))),H=a(d,m(C,h(v,d))),I=a(E,m(D,h(B,E))),J=a(T,m(D,h(N,T))),K=a(q,m(D,h(M,q))),w(F,I)&&w(G,J)&&w(H,K)?[F,G,H]:null}throw new TypeError("Arrays with two or thee dimensional points expected");var y,l,d,x,A,v,E,T,q,B,N,M,O,S,j,k,z,C,D,F,G,H,I,J,K},"Matrix, Matrix, Matrix":function(r,e,t){return o(y(r.valueOf(),e.valueOf(),t.valueOf()))},"Matrix, Matrix, Matrix, Matrix":function(r,e,t,i){return o(y(r.valueOf(),e.valueOf(),t.valueOf(),i.valueOf()))}});function l(e){return"number"==typeof e||r.isBigNumber(e)}function p(r){return 2===r.length&&l(r[0])&&l(r[1])}function g(r){return 3===r.length&&l(r[0])&&l(r[1])&&l(r[2])}function b(r,e,t,i,n,u,o,f,c,s,w,y){var l=m(h(r,e),h(t,i)),p=m(h(n,u),h(o,f)),g=m(h(c,s),h(w,y));return a(a(l,p),g)}return y}exports.name="intersect",exports.factory=r; },{"../arithmetic/abs":"K5X1","../arithmetic/add":"zf2Z","../arithmetic/addScalar":"ZM3O","../../type/matrix/function/matrix":"vzj5","../arithmetic/multiply":"k7By","../arithmetic/multiplyScalar":"obRw","../arithmetic/divideScalar":"R3aq","../arithmetic/subtract":"m78R","../relational/smaller":"Q7ag","../relational/equalScalar":"QvIw"}],"HQQE":[function(require,module,exports) { "use strict";function r(r,e,n,t){var o=n(require("../arithmetic/addScalar")),i=n(require("../arithmetic/subtract")),a=n(require("../arithmetic/multiplyScalar")),s=n(require("../arithmetic/divideScalar")),u=n(require("../arithmetic/unaryMinus")),p=n(require("../arithmetic/sqrt")),h=n(require("../arithmetic/abs"));function w(e){return"number"==typeof e||r.isBigNumber(e)}function y(r){return r.constructor!==Array&&(r=m(r)),w(r[0])&&w(r[1])}function f(r){return r.constructor!==Array&&(r=m(r)),w(r[0])&&w(r[1])&&w(r[2])}function c(r){return r.constructor!==Array&&(r=m(r)),w(r[0])&&w(r[1])&&w(r[2])&&w(r[3])&&w(r[4])&&w(r[5])}function m(r){for(var e=Object.keys(r),n=[],t=0;t=a.length)throw new t(u,a.length);return e(n)?n.create(i(n.valueOf(),u,o)):i(n,u,o)}});return s.toTex=void 0,s}function i(r,e,t){var n,o,a;if(e<=0){if(Array.isArray(r[0])){for(a=u(r),o=[],n=0;n0)for(;i(t,e);)u.push(t),t+=n;else if(n<0)for(;o(t,e);)u.push(t),t+=n;return u}function p(r,e,n){var u=[],t=r;if(n>0)for(;a(t,e);)u.push(t),t+=n;else if(n<0)for(;f(t,e);)u.push(t),t+=n;return u}function N(r,e,n){var u=[],t=r;if(n.gt(s))for(;i(t,e);)u.push(t),t=t.plus(n);else if(n.lt(s))for(;o(t,e);)u.push(t),t=t.plus(n);return u}function B(r,e,n){var u=[],t=r;if(n.gt(s))for(;a(t,e);)u.push(t),t=t.plus(n);else if(n.lt(s))for(;f(t,e);)u.push(t),t=t.plus(n);return u}}exports.name="range",exports.factory=r; },{"../../type/matrix/function/matrix":"vzj5","../relational/smaller":"Q7ag","../relational/larger":"SrDl","../relational/smallerEq":"rN68","../relational/largerEq":"d923"}],"g7VB":[function(require,module,exports) { "use strict";var r=require("../../utils/object").clone,e=require("../../utils/array").validateIndex;function t(t,i,n,u){var a=n(require("../../type/matrix/MatrixIndex")),o=n(require("../../type/matrix/function/matrix")),s=n(require("./range")),x=u("column",{"Matrix, number":c,"Array, number":function(e,t){return c(o(r(e)),t).valueOf()}});return x.toTex=void 0,x;function c(r,t){if(2!==r.size().length)throw new Error("Only two dimensional matrix is supported");e(t,r.size()[1]);var i=s(0,r.size()[0]),n=new a(i,t);return r.subset(n)}}exports.name="column",exports.factory=t; },{"../../utils/object":"FcSp","../../utils/array":"j2lF","../../type/matrix/MatrixIndex":"SL3U","../../type/matrix/function/matrix":"vzj5","./range":"lueR"}],"LXdZ":[function(require,module,exports) { "use strict";var r=require("../../utils/object").clone,e=require("../../utils/array"),t=require("../../error/IndexError"),n=require("../../error/DimensionError");function i(i,u,a,s){var f=a(require("../../type/matrix/function/matrix")),c=a(require("../utils/isInteger")),l=s("concat",{"...Array | Matrix | number | BigNumber":function(u){var a,s,l=u.length,h=-1,g=!1,m=[];for(a=0;a0&&h>s)throw new t(h,s+1)}else{var x=r(w).valueOf(),v=e.size(x);if(m[a]=x,s=h,h=v.length-1,a>0&&h!==s)throw new n(s+1,h+1)}}if(0===m.length)throw new SyntaxError("At least one matrix expected");for(var b=m.shift();m.length;)b=o(b,m.shift(),h,0);return g?f(b):b},"...string":function(r){return r.join("")}});return l.toTex=void 0,l}function o(r,e,t,i){if(i1?[s]:s}}exports.name="cross",exports.factory=t; },{"../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5","../arithmetic/subtract":"m78R","../arithmetic/multiply":"k7By"}],"pnEY":[function(require,module,exports) { "use strict";function r(r,e,t,o){var s=t(require("./transpose")),n=t(require("../complex/conj")),a=require("../../utils/latex"),c=o("ctranspose",{any:function(r){return n(s(r))}});return c.toTex={1:"\\left(${args[0]}\\right)".concat(a.operators.ctranspose)},c}exports.name="ctranspose",exports.factory=r; },{"./transpose":"C2z0","../complex/conj":"msvi","../../utils/latex":"H1Mr"}],"JNTV":[function(require,module,exports) { "use strict";var r=require("../../utils/array"),n=require("../../utils/number").isInteger;function t(t,e,i,u){var a=i(require("../../type/matrix/function/matrix")),o=u("diag",{Array:function(n){return s(n,0,r.size(n),null)},"Array, number":function(n,t){return s(n,t,r.size(n),null)},"Array, BigNumber":function(n,t){return s(n,t.toNumber(),r.size(n),null)},"Array, string":function(n,t){return s(n,0,r.size(n),t)},"Array, number, string":function(n,t,e){return s(n,t,r.size(n),e)},"Array, BigNumber, string":function(n,t,e){return s(n,t.toNumber(),r.size(n),e)},Matrix:function(r){return s(r,0,r.size(),r.storage())},"Matrix, number":function(r,n){return s(r,n,r.size(),r.storage())},"Matrix, BigNumber":function(r,n){return s(r,n.toNumber(),r.size(),r.storage())},"Matrix, string":function(r,n){return s(r,0,r.size(),n)},"Matrix, number, string":function(r,n,t){return s(r,n,r.size(),t)},"Matrix, BigNumber, string":function(r,n,t){return s(r,n.toNumber(),r.size(),t)}});return o.toTex=void 0,o;function s(r,e,i,u){if(!n(e))throw new TypeError("Second parameter in function diag must be an integer");var o=e>0?e:0,s=e<0?-e:0;switch(i.length){case 1:return function(r,n,e,i,u,a){var o=[i+u,i+a],s=t.Matrix.storage(e||"dense").diagonal(o,r,n);return null!==e?s:s.valueOf()}(r,e,u,i[0],s,o);case 2:return function(r,n,e,i,u,o){if(t.isMatrix(r)){var s=r.diagonal(n);return null!==e?e!==s.storage()?a(s,e):s:s.valueOf()}for(var f=Math.min(i[0]-u,i[1]-o),c=[],g=0;g1&&(M=s(M,h),g=-g),q=o(q,s(w=w*(x-d+1)/((2*x-d+1)*d),M)),l=o(l,s(w*g,M));for(var y=s(f(l),q),z=0;z2||r(n).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(t.length)+", y = "+JSON.stringify(n.length)+")");var e=[],i=[];return t.map(function(r){return n.map(function(t){return i=[],e.push(i),r.map(function(r){return t.map(function(t){return i.push(u(r,t))})})})})&&e}}exports.name="kron",exports.factory=t; },{"../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5","../arithmetic/multiplyScalar":"obRw"}],"dcuN":[function(require,module,exports) { "use strict";var r=require("../../utils/function").maxArgumentCount;function n(r,n,u,a){var o=a("map",{"Array, function":t,"Matrix, function":function(r,n){return r.map(n)}});return o.toTex=void 0,o}function t(n,t){var u=r(t);return function r(a,o){return Array.isArray(a)?a.map(function(n,t){return r(n,o.concat(t))}):1===u?t(a):2===u?t(a,o):t(a,o,n)}(n,[])}exports.name="map",exports.factory=n; },{"../../utils/function":"woyg"}],"dmcR":[function(require,module,exports) { "use strict";var r=require("../../utils/number").isInteger,e=require("../../utils/array").resize;function t(t,n,i,u){var a=i(require("../../type/matrix/function/matrix")),o=u("ones",{"":function(){return"Array"===n.matrix?f([]):f([],"default")},"...number | BigNumber | string":function(r){if("string"==typeof r[r.length-1]){var e=r.pop();return f(r,e)}return"Array"===n.matrix?f(r):f(r,"default")},Array:f,Matrix:function(r){var e=r.storage();return f(r.valueOf(),e)},"Array | Matrix, string":function(r,e){return f(r.valueOf(),e)}});return o.toTex=void 0,o;function f(n,i){var u=function(r){var e=!1;return r.forEach(function(r,n,i){t.isBigNumber(r)&&(e=!0,i[n]=r.toNumber())}),e}(n)?new t.BigNumber(1):1;if(function(e){e.forEach(function(e){if("number"!=typeof e||!r(e)||e<0)throw new Error("Parameters in function ones must be positive integers")})}(n),i){var o=a(i);return n.length>0?o.resize(n,u):o}var f=[];return n.length>0?e(f,n,u):f}}exports.name="ones",exports.factory=t; },{"../../utils/number":"uqMu","../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5"}],"AHex":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function n(n,t,e,u){return u("isNaN",{number:function(r){return Number.isNaN(r)},BigNumber:function(r){return r.isNaN()},Fraction:function(r){return!1},Complex:function(r){return r.isNaN()},Unit:function(r){return Number.isNaN(r.value)},"Array | Matrix":function(n){return r(n,Number.isNaN)}})}exports.name="isNaN",exports.factory=n; },{"../../utils/collection/deepMap":"lOYo"}],"yGce":[function(require,module,exports) { "use strict";var r=require("../../utils/number").nearlyEqual,e=require("../../utils/bignumber/nearlyEqual");function n(n,t,i,u){var a=i(require("../../type/matrix/function/matrix")),o=i(require("../../type/matrix/utils/algorithm03")),c=i(require("../../type/matrix/utils/algorithm05")),f=i(require("../../type/matrix/utils/algorithm12")),l=i(require("../../type/matrix/utils/algorithm13")),m=i(require("../../type/matrix/utils/algorithm14")),s=u("compare",{"boolean, boolean":function(r,e){return r===e?0:r>e?1:-1},"number, number":function(e,n){return e===n||r(e,n,t.epsilon)?0:e>n?1:-1},"BigNumber, BigNumber":function(r,i){return r.eq(i)||e(r,i,t.epsilon)?new n.BigNumber(0):new n.BigNumber(r.cmp(i))},"Fraction, Fraction":function(r,e){return new n.Fraction(r.compare(e))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(r,e){if(!r.equalBase(e))throw new Error("Cannot compare units with different base");return s(r.value,e.value)},"SparseMatrix, SparseMatrix":function(r,e){return c(r,e,s)},"SparseMatrix, DenseMatrix":function(r,e){return o(e,r,s,!0)},"DenseMatrix, SparseMatrix":function(r,e){return o(r,e,s,!1)},"DenseMatrix, DenseMatrix":function(r,e){return l(r,e,s)},"Array, Array":function(r,e){return s(a(r),a(e)).valueOf()},"Array, Matrix":function(r,e){return s(a(r),e)},"Matrix, Array":function(r,e){return s(r,a(e))},"SparseMatrix, any":function(r,e){return f(r,e,s,!1)},"DenseMatrix, any":function(r,e){return m(r,e,s,!1)},"any, SparseMatrix":function(r,e){return f(e,r,s,!0)},"any, DenseMatrix":function(r,e){return m(e,r,s,!0)},"Array, any":function(r,e){return m(a(r),e,s,!1).valueOf()},"any, Array":function(r,e){return m(a(e),r,s,!0).valueOf()}});return s.toTex=void 0,s}exports.name="compare",exports.factory=n; },{"../../utils/number":"uqMu","../../utils/bignumber/nearlyEqual":"Uu9K","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm05":"JNXe","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"kE3o":[function(require,module,exports) { "use strict";var r=require("../../utils/number").isInteger;function e(e,t,n,i){var o=n(require("../utils/isNumeric")),u=n(require("../utils/isNaN")),a=n(require("../relational/compare"));function s(r,e){return-a(r,e)}return i("partitionSelect",{"Array | Matrix, number":function(r,e){return f(r,e,a)},"Array | Matrix, number, string":function(r,e,t){if("asc"===t)return f(r,e,a);if("desc"===t)return f(r,e,s);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":f});function f(t,n,i){if(!r(n)||n<0)throw new Error("k must be a non-negative integer");if(e.isMatrix(t)){if(t.size().length>1)throw new Error("Only one dimensional matrices supported");return c(t.valueOf(),n,i)}if(Array.isArray(t))return c(t,n,i)}function c(r,e,t){if(e>=r.length)throw new Error("k out of bounds");for(var n=0;n=0){var l=r[f];r[f]=r[s],r[s]=l,--f}else++s;t(r[s],c)>0&&--s,e<=s?a=s:i=s+1}return r[e]}}exports.name="partitionSelect",exports.factory=e; },{"../../utils/number":"uqMu","../utils/isNumeric":"Rv38","../utils/isNaN":"AHex","../relational/compare":"yGce"}],"BrQj":[function(require,module,exports) { "use strict";var r=require("../../utils/array");function e(e,t,a,i){var n=a(require("../../type/matrix/function/matrix")),o=a(require("../utils/isInteger")),s=i("reshape",{"Matrix, Array":function(e,t){return e.reshape?e.reshape(t):n(r.reshape(e.valueOf(),t))},"Array, Array":function(e,t){return t.forEach(function(r){if(!o(r))throw new TypeError("Invalid size for dimension: "+r)}),r.reshape(e,t)}});return s.toTex=void 0,s}exports.name="reshape",exports.factory=e; },{"../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5","../utils/isInteger":"qG7X"}],"pwUu":[function(require,module,exports) { "use strict";var r=require("../../error/DimensionError"),e=require("../../error/ArgumentsError"),t=require("../../utils/number").isInteger,i=require("../../utils/string").format,n=require("../../utils/object").clone,u=require("../../utils/array");function s(s,o,a,f){var l=a(require("../../type/matrix/function/matrix")),g=function(a,f,g){if(2!==arguments.length&&3!==arguments.length)throw new e("resize",arguments.length,2,3);if(s.isMatrix(f)&&(f=f.valueOf()),s.isBigNumber(f[0])&&(f=f.map(function(r){return s.isBigNumber(r)?r.toNumber():r})),s.isMatrix(a))return a.resize(f,g,!0);if("string"==typeof a)return function(e,n,u){if(void 0!==u){if("string"!=typeof u||1!==u.length)throw new TypeError("Single character expected as defaultValue")}else u=" ";if(1!==n.length)throw new r(n.length,1);var s=n[0];if("number"!=typeof s||!t(s))throw new TypeError("Invalid size, must contain positive integers (size: "+i(n)+")");if(e.length>s)return e.substring(0,s);if(e.lengthw)return 1}for(var $=0,N=Math.max(o.length,h.length);$i)return 1}return 0}; },{}],"ljuJ":[function(require,module,exports) { "use strict";var r=require("javascript-natural-sort");function t(t,n,i,a){var u=i(require("../utils/typeof")),o=i(require("./compare")),f=o.signatures["boolean,boolean"],s=a("compareNatural",{"any, any":function(n,i){var a,c=u(n),m=u(i);if(!("number"!==c&&"BigNumber"!==c&&"Fraction"!==c||"number"!==m&&"BigNumber"!==m&&"Fraction"!==m))return"0"!==(a=o(n,i)).toString()?a>0?1:-1:r(c,m);if("Array"===c||"Matrix"===c||"Array"===m||"Matrix"===m)return 0!==(a=function r(e,n){if(t.isSparseMatrix(e)&&t.isSparseMatrix(n))return l(e.toJSON().values,n.toJSON().values);if(t.isSparseMatrix(e))return r(e.toArray(),n);if(t.isSparseMatrix(n))return r(e,n.toArray());if(t.isDenseMatrix(e))return r(e.toJSON().data,n);if(t.isDenseMatrix(n))return r(e,n.toJSON().data);if(!Array.isArray(e))return r([e],n);if(!Array.isArray(n))return r(e,[n]);return l(e,n)}(n,i))?a:r(c,m);if(c!==m)return r(c,m);if("Complex"===c)return e(n,i);if("Unit"===c)return n.equalBase(i)?s(n.value,i.value):l(n.formatUnits(),i.formatUnits());if("boolean"===c)return f(n,i);if("string"===c)return r(n,i);if("Object"===c)return function(t,e){var n=Object.keys(t),i=Object.keys(e);n.sort(r),i.sort(r);var a=l(n,i);if(0!==a)return a;for(var u=0;ut.length?1:r.lengtht.re?1:r.ret.im?1:r.im=a.length)throw new t(u,a.length);return e(i)?i.create(n(i.valueOf(),u,o)):n(i,u,o)}; },{"../array":"j2lF","../collection/isMatrix":"gfmG","../../error/IndexError":"tfOV"}],"m4c0":[function(require,module,exports) { "use strict";var r=require("./isMatrix");module.exports=function(e){return Array.isArray(e)||r(e)}; },{"./isMatrix":"gfmG"}],"UGDC":[function(require,module,exports) { "use strict";var r=require("./isCollection");module.exports=function(e){for(var t=0;t2?" (type: "+a(n)+", value: "+JSON.stringify(n)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+r)):-1!==String(e).indexOf("complex numbers")?(r=arguments.length>2?" (type: "+a(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+r)):e}}exports.factory=e; },{"../../utils/typeof":"LZTG"}],"US8O":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepForEach"),e=require("../../utils/collection/reduce"),t=require("../../utils/collection/containsCollections");function a(a,n,o,i){var u=o(require("../relational/larger")),c=o(require("./utils/improveErrorMessage")),l=i("max",{"Array | Matrix":f,"Array | Matrix, number | BigNumber":function(r,t){return e(r,t.valueOf(),s)},"...":function(r){if(t(r))throw new TypeError("Scalar values expected in function max");return f(r)}});return l.toTex="\\max\\left(${args}\\right)",l;function s(r,e){try{return u(r,e)?r:e}catch(t){throw c(t,"max",e)}}function f(e){var t;if(r(e,function(r){try{isNaN(r)&&"number"==typeof r?t=NaN:(void 0===t||u(r,t))&&(t=r)}catch(e){throw c(e,"max",r)}}),void 0===t)throw new Error("Cannot calculate max of an empty array");return t}}exports.name="max",exports.factory=a; },{"../../utils/collection/deepForEach":"Uh7d","../../utils/collection/reduce":"tjrJ","../../utils/collection/containsCollections":"UGDC","../relational/larger":"SrDl","./utils/improveErrorMessage":"lOhJ"}],"yVQR":[function(require,module,exports) { "use strict";var r=require("../../utils/array"),e=require("../../utils/latex"),t=require("../../utils/string");function i(i,a,s,u){var o=s(require("../arithmetic/abs")),n=s(require("../arithmetic/add")),c=s(require("../arithmetic/multiply")),m=s(require("../arithmetic/sqrt")),q=s(require("../arithmetic/subtract")),h=s(require("../matrix/inv")),x=s(require("../matrix/size")),f=s(require("../statistics/max")),l=s(require("./identity")),w=u("sqrtm",{"Array | Matrix":function(e){var a=i.isMatrix(e)?e.size():r.size(e);switch(a.length){case 1:if(1===a[0])return m(e);throw new RangeError("Matrix must be square (size: "+t.format(a)+")");case 2:if(a[0]===a[1])return d(e);throw new RangeError("Matrix must be square (size: "+t.format(a)+")")}}}),v=1e3,g=1e-6;function d(r){var e,t=0,i=r,a=l(x(r));do{var s=i;if(i=c(.5,n(s,h(a))),a=c(.5,n(a,h(s))),(e=f(o(q(i,s))))>g&&++t>v)throw new Error("computing square root of matrix: iterative method could not converge")}while(e>g);return i}return w.toTex={1:"{${args[0]}}".concat(e.operators.pow,"{\\frac{1}{2}}")},w}exports.name="sqrtm",exports.factory=i; },{"../../utils/array":"j2lF","../../utils/latex":"H1Mr","../../utils/string":"PshC","../arithmetic/abs":"K5X1","../arithmetic/add":"zf2Z","../arithmetic/multiply":"k7By","../arithmetic/sqrt":"T6pB","../arithmetic/subtract":"m78R","../matrix/inv":"yHuZ","../matrix/size":"OqDc","../statistics/max":"US8O","./identity":"zJUT"}],"c5o7":[function(require,module,exports) { "use strict";var r=require("../../utils/object"),e=require("../../utils/array");function t(t,u,n,i){var a=n(require("../../type/matrix/function/matrix")),o=i("squeeze",{Array:function(t){return e.squeeze(r.clone(t))},Matrix:function(r){var t=e.squeeze(r.toArray());return Array.isArray(t)?a(t):t},any:function(e){return r.clone(e)}});return o.toTex=void 0,o}exports.name="squeeze",exports.factory=t; },{"../../utils/object":"FcSp","../../utils/array":"j2lF","../../type/matrix/function/matrix":"vzj5"}],"YmDd":[function(require,module,exports) { "use strict";var r=require("../../utils/object").clone,e=require("../../utils/string").format;function t(t,a,i,n){var s=i(require("../../type/matrix/function/matrix")),u=i(require("../arithmetic/add")),o=n("trace",{Array:function(r){return f(s(r))},SparseMatrix:function(r){var t=r._values,a=r._index,i=r._ptr,n=r._size,s=n[0],o=n[1];if(s===o){var f=0;if(t.length>0)for(var c=0;cc)break}return f}throw new RangeError("Matrix must be square (size: "+e(n)+")")},DenseMatrix:f,any:r});function f(t){var a=t._size,i=t._data;switch(a.length){case 1:if(1===a[0])return r(i[0]);throw new RangeError("Matrix must be square (size: "+e(a)+")");case 2:var n=a[0];if(n===a[1]){for(var s=0,o=0;o1)throw new Error("first object must be one dimensional");if(i>1)throw new Error("second object must be one dimensional");if(t!==i)throw new Error("Length of two vectors must be equal");if(0===u(r))throw new Error("Sum of elements in first object must be non zero");if(0===u(e))throw new Error("Sum of elements in second object must be non zero");var n=o(r,u(r)),f=o(e,u(e)),l=u(s(n,c(a(n,f))));return m(l)?l:Number.NaN}return i("kldivergence",{"Array, Array":function(r,e){return f(n(r),n(e))},"Matrix, Array":function(r,e){return f(r,n(e))},"Array, Matrix":function(r,e){return f(n(r),e)},"Matrix, Matrix":function(r,e){return f(r,e)}})}exports.name="kldivergence",exports.factory=r; },{"../../type/matrix/function/matrix":"vzj5","../arithmetic/divide":"lVgQ","../statistics/sum":"y9hQ","../arithmetic/multiply":"k7By","../arithmetic/dotDivide":"JrX5","../arithmetic/log":"T05K","../utils/isNumeric":"Rv38"}],"kuKA":[function(require,module,exports) { "use strict";var i=require("../../utils/collection/deepForEach");function r(r,e,t,u){var a=t(require("../arithmetic/add")),n=t(require("../arithmetic/multiply")),o=t(require("../arithmetic/divide")),l=t(require("../probability/factorial")),c=t(require("../utils/isInteger")),m=t(require("../utils/isPositive"));return u("multinomial",{"Array | Matrix":function(r){var e=0,t=1;return i(r,function(i){if(!c(i)||!m(i))throw new TypeError("Positive integer value expected in function multinomial");e=a(e,i),t=n(t,l(i))}),o(l(e),t)}})}exports.name="multinomial",exports.factory=r; },{"../../utils/collection/deepForEach":"Uh7d","../arithmetic/add":"zf2Z","../arithmetic/multiply":"k7By","../arithmetic/divide":"lVgQ","../probability/factorial":"yidz","../utils/isInteger":"qG7X","../utils/isPositive":"OFKG"}],"IUt2":[function(require,module,exports) { "use strict";var e=require("../../utils/number").isInteger;function r(r,n,i,u){var o=i(require("./factorial")),s=require("./product"),a=u("permutations",{"number | BigNumber":o,"number, number":function(r,t){if(!e(r)||r<0)throw new TypeError("Positive integer value expected in function permutations");if(!e(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(t>r)throw new TypeError("second argument k must be less than or equal to first argument n");return s(r-t+1,r)},"BigNumber, BigNumber":function(e,n){var i,u;if(!t(e)||!t(n))throw new TypeError("Positive integer value expected in function permutations");if(n.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(i=new r.BigNumber(1),u=e.minus(n).plus(1);u.lte(e);u=u.plus(1))i=i.times(u);return i}});return a.toTex=void 0,a}function t(e){return e.isInteger()&&e.gte(0)}exports.name="permutations",exports.factory=r; },{"../../utils/number":"uqMu","./factorial":"yidz","./product":"FONy"}],"JPVl":[function(require,module,exports) { var global = arguments[3]; var r=arguments[3],n=256,t=6,o=52,a=[],e=void 0===r?window:r,u=Math.pow(n,t),i=Math.pow(2,o),f=2*i,l=n-1,c=Math.random;function h(r){var t,o=r.length,a=this,e=0,u=a.i=a.j=0,i=a.S=[];for(o||(r=[o++]);e=f;)r/=2,o/=2,a>>>=1;return(r+a)/o}},module.exports.resetGlobal=function(){Math.random=c},d(Math.random(),a); },{}],"qBYF":[function(require,module,exports) { "use strict";var n=require("seed-random"),r=n();function e(e,o,t,d,i){var u;function a(e){u=null===e?r:n(String(e))}return a(o.randomSeed),i.on("config",function(n,r,e){void 0!==e.randomSeed&&a(n.randomSeed)}),function(){return u()}}exports.factory=e,exports.math=!0; },{"seed-random":"JPVl"}],"pAyZ":[function(require,module,exports) { "use strict";var r=require("../../error/ArgumentsError"),n=require("../../utils/collection/isCollection"),e=require("../../utils/number").isNumber;function t(t,i,o,a,u){var f=o(require("../../type/matrix/function/matrix")),s=require("../../utils/array"),l=o(require("./seededRNG"));function v(i){if(!h.hasOwnProperty(i))throw new Error("Unknown distribution "+i);var o=Array.prototype.slice.call(arguments,1);return function(i){function o(r,n,i){var o=void 0===n;if(o&&(n=1),t.isMatrix(r))r=r.valueOf();else if(!Array.isArray(r))throw new TypeError("Unsupported type of value in function pickRandom");if(s.size(r).length>1)throw new Error("Only one dimensional vectors supported");var a=0;if(void 0!==i){if(i.length!==r.length)throw new Error("Weights must have the same length as possibles");for(var u=0,f=i.length;u=v)return n>1?r:r[0];for(var h,c=[];c.length1)for(var o=0,a=r.shift();o3)throw new r("random",arguments.length,0,3);if(1===arguments.length?n(i)?s=i:v=i:2===arguments.length?n(i)?(s=i,v=o):(l=i,v=o):(s=i,l=o,v=a),void 0!==l&&!e(l)||void 0!==v&&!e(v))throw new TypeError("Invalid argument in function random");if(void 0===v&&(v=1),void 0===l&&(l=0),void 0!==s){var c=h(s.valueOf(),l,v,u);return t.isMatrix(s)?f(c):c}return u(l,v)},randomInt:a({"number | Array":function(r){if(n(r)){var e=r,i=h(e.valueOf(),0,1,v);return t.isMatrix(e)?f(i):i}return v(0,r)},"number | Array, number":function(r,e){if(n(r)){var i=r,o=e,a=h(i.valueOf(),0,o,v);return t.isMatrix(i)?f(a):a}return v(r,e)},"Array, number, number":function(r,n,e){var t=h(r.valueOf(),n,e,v);return r&&!0===r.isMatrix?f(t):t}}),pickRandom:a({Array:function(r){return o(r)},"Array, number | Array":function(r,n){var t,i;if(Array.isArray(n))i=n;else{if(!e(n))throw new TypeError("Invalid argument in function pickRandom");t=n}return o(r,t,i)},"Array, number | Array, Array | number":function(r,n,t){var i,a;if(Array.isArray(n)?(a=n,i=t):(a=t,i=n),!Array.isArray(a)||!e(i))throw new TypeError("Invalid argument in function pickRandom");return o(r,i,a)}})}}(h[i].apply(this,o))}var h={uniform:function(){return l},normal:function(){return function(){for(var r,n,e=-1;e<0||e>1;)r=l(),n=l(),e=1/6*Math.pow(-2*Math.log(r),.5)*Math.cos(2*Math.PI*n)+.5;return e}}};return v.toTex=void 0,v}exports.name="distribution",exports.factory=t; },{"../../error/ArgumentsError":"h0xI","../../utils/collection/isCollection":"m4c0","../../utils/number":"uqMu","../../type/matrix/function/matrix":"vzj5","../../utils/array":"j2lF","./seededRNG":"qBYF"}],"JMJP":[function(require,module,exports) { "use strict";function r(r,i,o,t){var e=o(require("./distribution"))("uniform").pickRandom;return e.toTex=void 0,e}exports.name="pickRandom",exports.factory=r; },{"./distribution":"pAyZ"}],"YT9V":[function(require,module,exports) { "use strict";function r(r,o,t,e){var i=t(require("./distribution"))("uniform").random;return i.toTex=void 0,i}exports.name="random",exports.factory=r; },{"./distribution":"pAyZ"}],"Zogd":[function(require,module,exports) { "use strict";function r(r,t,n,o){var e=n(require("./distribution"))("uniform").randomInt;return e.toTex=void 0,e}exports.name="randomInt",exports.factory=r; },{"./distribution":"pAyZ"}],"xCRU":[function(require,module,exports) { "use strict";module.exports=[require("./combinations"),require("./factorial"),require("./gamma"),require("./kldivergence"),require("./multinomial"),require("./permutations"),require("./pickRandom"),require("./random"),require("./randomInt")]; },{"./combinations":"n9b2","./factorial":"yidz","./gamma":"ciea","./kldivergence":"CGIk","./multinomial":"kuKA","./permutations":"IUt2","./pickRandom":"JMJP","./random":"YT9V","./randomInt":"Zogd"}],"eVLO":[function(require,module,exports) { "use strict";function r(r,t,e,n){var i=e(require("../../type/matrix/function/matrix")),a=e(require("../utils/typeof")),u=e(require("../../type/matrix/utils/algorithm13")),o=e(require("../../type/matrix/utils/algorithm14")),c=n("compareText",{"any, any":x,"DenseMatrix, DenseMatrix":function(r,t){return u(r,t,x)},"Array, Array":function(r,t){return c(i(r),i(t)).valueOf()},"Array, Matrix":function(r,t){return c(i(r),t)},"Matrix, Array":function(r,t){return c(r,i(t))},"DenseMatrix, any":function(r,t){return o(r,t,x,!1)},"any, DenseMatrix":function(r,t){return o(t,r,x,!0)},"Array, any":function(r,t){return o(i(r),t,x,!1).valueOf()},"any, Array":function(r,t){return o(i(t),r,x,!0).valueOf()}});function x(t,e){if(!r.isString(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+a(t)+", index: 0)");if(!r.isString(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+a(e)+", index: 1)");return t===e?0:t>e?1:-1}return c.toTex=void 0,c}exports.name="compareText",exports.factory=r; },{"../../type/matrix/function/matrix":"vzj5","../utils/typeof":"LZTG","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"qExK":[function(require,module,exports) { "use strict";function r(r,e,a,n){var t=a(require("./equal")),u=n("deepEqual",{"any, any":function(r,e){return function r(e,a){if(Array.isArray(e)){if(Array.isArray(a)){var n=e.length;if(n!==a.length)return!1;for(var u=0;u0;e--)for(var n=0;nr[n+1].length&&(t=r[n],r[n]=r[n+1],r[n+1]=t);return r}(n)}});function l(r,t){for(var e=[],n=0;n=o?e(r):t<=n?e(r)*function(r){var e,t=r*r,n=u[0][4]*t,a=t;for(e=0;e<3;e+=1)n=(n+u[0][e])*t,a=(a+i[0][e])*t;return r*(n+u[0][3])/(a+i[0][3])}(t):t<=4?e(r)*(1-function(r){var e,t=u[1][8]*r,n=r;for(e=0;e<7;e+=1)t=(t+u[1][e])*r,n=(n+i[1][e])*r;var a=(t+u[1][7])/(n+i[1][7]),o=parseInt(16*r)/16,f=(r-o)*(r+o);return Math.exp(-o*o)*Math.exp(-f)*a}(t)):e(r)*(1-function(r){var e,t=1/(r*r),n=u[2][5]*t,o=t;for(e=0;e<4;e+=1)n=(n+u[2][e])*t,o=(o+i[2][e])*t;var f=t*(n+u[2][4])/(o+i[2][4]);f=(a-f)/r,t=parseInt(16*r)/16;var c=(r-t)*(r+t);return Math.exp(-t*t)*Math.exp(-c)*f}(t))},BigNumber:function(r){return new t.BigNumber(s(r.toNumber()))},"Array | Matrix":function(e){return r(e,s)}});return s.toTex={1:"erf\\left(${args[0]}\\right)"},s}var n=.46875,a=.5641895835477563,u=[[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]],i=[[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]],o=Math.pow(2,53);exports.name="erf",exports.factory=t; },{"../../utils/collection/deepMap":"lOYo","../../utils/number":"uqMu"}],"JuUL":[function(require,module,exports) { "use strict";module.exports=[require("./erf")]; },{"./erf":"eibQ"}],"LcS3":[function(require,module,exports) { "use strict";var r=require("../../utils/array").flatten,e=require("../../utils/collection/containsCollections");function t(t,i,n,a){var o=n(require("../arithmetic/addScalar")),u=n(require("../arithmetic/divideScalar")),c=n(require("../relational/compare")),m=n(require("../matrix/partitionSelect")),l=n(require("./utils/improveErrorMessage")),f=a("median",{"Array | Matrix":d,"Array | Matrix, number | BigNumber":function(r,e){throw new Error("median(A, dim) is not yet supported")},"...":function(r){if(e(r))throw new TypeError("Scalar values expected in function median");return d(r)}});function d(e){try{var t=(e=r(e.valueOf())).length;if(0===t)throw new Error("Cannot calculate median of an empty array");if(t%2==0){for(var i=t/2-1,n=m(e,i+1),a=e[i],o=0;o0&&(a=e[o]);return p(a,n)}var u=m(e,(t-1)/2);return s(u)}catch(f){throw l(f,"median")}}var s=a({"number | BigNumber | Complex | Unit":function(r){return r}}),p=a({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(r,e){return u(o(r,e),2)}});return f.toTex=void 0,f}exports.name="median",exports.factory=t; },{"../../utils/array":"j2lF","../../utils/collection/containsCollections":"UGDC","../arithmetic/addScalar":"ZM3O","../arithmetic/divideScalar":"R3aq","../relational/compare":"yGce","../matrix/partitionSelect":"kE3o","./utils/improveErrorMessage":"lOhJ"}],"Je7I":[function(require,module,exports) { "use strict";var r=require("../../utils/array").flatten;function e(e,a,t,i){var n=t(require("../arithmetic/abs")),o=t(require("../matrix/map")),u=t(require("../statistics/median")),s=t(require("../arithmetic/subtract")),m=t(require("./utils/improveErrorMessage")),c=i("mad",{"Array | Matrix":d,"...":function(r){return d(r)}});return c.toTex=void 0,c;function d(e){if(0===(e=r(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var a=u(e);return u(o(e,function(r){return n(s(r,a))}))}catch(t){throw t instanceof TypeError&&-1!==t.message.indexOf("median")?new TypeError(t.message.replace("median","mad")):m(t,"mad")}}}exports.name="mad",exports.factory=e; },{"../../utils/array":"j2lF","../arithmetic/abs":"K5X1","../matrix/map":"dcuN","../statistics/median":"LcS3","../arithmetic/subtract":"m78R","./utils/improveErrorMessage":"lOhJ"}],"WyK1":[function(require,module,exports) { "use strict";var r=require("../../utils/array").size,e=require("../../utils/collection/deepForEach"),t=require("../../utils/collection/reduce"),i=require("../../utils/collection/containsCollections");function a(a,n,o,c){var u=o(require("../arithmetic/add")),l=o(require("../arithmetic/divide")),s=o(require("./utils/improveErrorMessage")),m=c("mean",{"Array | Matrix":y,"Array | Matrix, number | BigNumber":function(e,i){try{var a=t(e,i,u),n=Array.isArray(e)?r(e):e.size();return l(a,n[i])}catch(o){throw s(o,"mean")}},"...":function(r){if(i(r))throw new TypeError("Scalar values expected in function mean");return y(r)}});return m.toTex=void 0,m;function y(r){var t=0,i=0;if(e(r,function(r){try{t=u(t,r),i++}catch(e){throw s(e,"mean",r)}}),0===i)throw new Error("Cannot calculate mean of an empty array");return l(t,i)}}exports.name="mean",exports.factory=a; },{"../../utils/array":"j2lF","../../utils/collection/deepForEach":"Uh7d","../../utils/collection/reduce":"tjrJ","../../utils/collection/containsCollections":"UGDC","../arithmetic/add":"zf2Z","../arithmetic/divide":"lVgQ","./utils/improveErrorMessage":"lOhJ"}],"VKqc":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepForEach"),e=require("../../utils/collection/reduce"),t=require("../../utils/collection/containsCollections");function n(n,i,o,a){var u=o(require("../relational/smaller")),c=o(require("./utils/improveErrorMessage")),l=a("min",{"Array | Matrix":f,"Array | Matrix, number | BigNumber":function(r,t){return e(r,t.valueOf(),s)},"...":function(r){if(t(r))throw new TypeError("Scalar values expected in function min");return f(r)}});return l.toTex="\\min\\left(${args}\\right)",l;function s(r,e){try{return u(r,e)?r:e}catch(t){throw c(t,"min",e)}}function f(e){var t;if(r(e,function(r){try{isNaN(r)&&"number"==typeof r?t=NaN:(void 0===t||u(r,t))&&(t=r)}catch(e){throw c(e,"min",r)}}),void 0===t)throw new Error("Cannot calculate min of an empty array");return t}}exports.name="min",exports.factory=n; },{"../../utils/collection/deepForEach":"Uh7d","../../utils/collection/reduce":"tjrJ","../../utils/collection/containsCollections":"UGDC","../relational/smaller":"Q7ag","./utils/improveErrorMessage":"lOhJ"}],"DTxj":[function(require,module,exports) { "use strict";var r=require("../../utils/array").flatten;function a(a,e,t,n){var o=t(require("../utils/isNaN")),i=t(require("../utils/isNumeric"));return n("mode",{"Array | Matrix":u,"...":function(r){return u(r)}});function u(a){if(0===(a=r(a.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");for(var e={},t=[],n=0,u=0;un&&(n=e[l],t=[l])}return t}}exports.name="mode",exports.factory=a; },{"../../utils/array":"j2lF","../utils/isNaN":"AHex","../utils/isNumeric":"Rv38"}],"Hc7x":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepForEach");function t(t,o,e,i){var n=e(require("../arithmetic/multiplyScalar")),a=e(require("./utils/improveErrorMessage")),u=i("prod",{"Array | Matrix":c,"Array | Matrix, number | BigNumber":function(r,t){throw new Error("prod(A, dim) is not yet supported")},"...":function(r){return c(r)}});return u.toTex=void 0,u;function c(t){var o;if(r(t,function(r){try{o=void 0===o?r:n(o,r)}catch(t){throw a(t,"prod",r)}}),void 0===o)throw new Error("Cannot calculate prod of an empty array");return o}}exports.name="prod",exports.factory=t; },{"../../utils/collection/deepForEach":"Uh7d","../arithmetic/multiplyScalar":"obRw","./utils/improveErrorMessage":"lOhJ"}],"hl2d":[function(require,module,exports) { "use strict";var r=require("../../utils/number").isInteger,e=require("../../utils/number").isNumber,t=require("../../utils/array").flatten,n=require("../../utils/collection/isCollection");function i(i,o,u,a){var f=u(require("../arithmetic/add")),s=u(require("../arithmetic/multiply")),l=u(require("../matrix/partitionSelect")),m=u(require("../relational/compare"));function w(r,n,i){var o=t(r),u=o.length;if(0===u)throw new Error("Cannot calculate quantile of an empty sequence");if(e(n)){var a=n*(u-1),w=a%1;if(0===w){var v=i?o[a]:l(o,a);return c(v),v}var b,g,h=Math.floor(a);if(i)b=o[h],g=o[h+1];else{g=l(o,h+1),b=o[h];for(var p=0;p0&&(b=o[p])}return c(b),c(g),f(s(b,1-w),s(g,w))}var q=n.times(u-1);if(q.isInteger()){q=q.toNumber();var y=i?o[q]:l(o,q);return c(y),y}var N,E,d=q.floor(),x=q.minus(d),S=d.toNumber();if(i)N=o[S],E=o[S+1];else{E=l(o,S+1),N=o[S];for(var B=0;B0&&(N=o[B])}c(N),c(E);var A=new x.constructor(1);return f(s(N,A.minus(x)),s(E,x))}var c=a({"number | BigNumber | Unit":function(r){return r}});return function(t,o,u){var a,f,s;if(arguments.length<2||arguments.length>3)throw new SyntaxError("Function quantileSeq requires two or three parameters");if(n(t)){if("boolean"==typeof(u=u||!1)){if(f=t.valueOf(),e(o)){if(o<0)throw new Error("N/prob must be non-negative");if(o<=1)return w(f,o,u);if(o>1){if(!r(o))throw new Error("N must be a positive integer");var l=o+1;a=new Array(o);for(var m=0;m4294967295)throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var v=new i.BigNumber(c+1);a=new Array(c);for(var b=0;b1)throw new Error("Probability must be between 0 and 1, inclusive")}else{if(!i.isBigNumber(h))throw new TypeError("Unexpected type of argument in function quantileSeq");if(s=new h.constructor(1),h.isNegative()||h.gt(s))throw new Error("Probability must be between 0 and 1, inclusive")}a[g]=w(f,h,u)}return a}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}}exports.name="quantileSeq",exports.factory=i; },{"../../utils/number":"uqMu","../../utils/array":"j2lF","../../utils/collection/isCollection":"m4c0","../arithmetic/add":"zf2Z","../arithmetic/multiply":"k7By","../matrix/partitionSelect":"kE3o","../relational/compare":"yGce"}],"ujYK":[function(require,module,exports) { "use strict";var r="unbiased",e=require("../../utils/collection/deepForEach");function t(t,a,i,n){var u=i(require("../matrix/apply")),o=i(require("../arithmetic/addScalar")),c=i(require("../arithmetic/subtract")),s=i(require("../arithmetic/multiplyScalar")),m=i(require("../arithmetic/divideScalar")),h=i(require("../utils/isNaN")),l=i(require("./utils/improveErrorMessage")),d=n("variance",{"Array | Matrix":function(e){return f(e,r)},"Array | Matrix, string":f,"Array | Matrix, number | BigNumber":function(e,t){return v(e,t,r)},"Array | Matrix, number | BigNumber, string":v,"...":function(e){return f(e,r)}});return d.toTex="\\mathrm{Var}\\left(${args}\\right)",d;function f(r,a){var i=0,n=0;if(0===r.length)throw new SyntaxError("Function var requires one or more parameters (0 provided)");if(e(r,function(r){try{i=o(i,r),n++}catch(e){throw l(e,"var",r)}}),0===n)throw new Error("Cannot calculate var of an empty array");var u=m(i,n);if(i=0,e(r,function(r){var e=c(r,u);i=o(i,s(e,e))}),h(i))return i;switch(a){case"uncorrected":return m(i,n);case"biased":return m(i,n+1);case"unbiased":var d=t.isBigNumber(i)?new t.BigNumber(0):0;return 1===n?d:m(i,n-1);default:throw new Error('Unknown normalization "'+a+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function v(r,e,t){try{if(0===r.length)throw new SyntaxError("Function var requires one or more parameters (0 provided)");return u(r,e,function(r){return f(r,t)})}catch(a){throw l(a,"var")}}}exports.name="var",exports.factory=t; },{"../../utils/collection/deepForEach":"Uh7d","../matrix/apply":"f9k3","../arithmetic/addScalar":"ZM3O","../arithmetic/subtract":"m78R","../arithmetic/multiplyScalar":"obRw","../arithmetic/divideScalar":"R3aq","../utils/isNaN":"AHex","./utils/improveErrorMessage":"lOhJ"}],"hFUZ":[function(require,module,exports) { "use strict";function r(r,e,t,a){var i=t(require("../arithmetic/sqrt")),n=t(require("../statistics/var")),s=a("std",{"Array | Matrix":o,"Array | Matrix, string":o,"Array | Matrix, number | BigNumber":o,"Array | Matrix, number | BigNumber, string":o,"...":function(r){return o(r)}});return s.toTex=void 0,s;function o(r,e){if(0===r.length)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{return i(n.apply(null,arguments))}catch(t){throw t instanceof TypeError&&-1!==t.message.indexOf(" var")?new TypeError(t.message.replace(" var"," std")):t}}}exports.name="std",exports.factory=r; },{"../arithmetic/sqrt":"T6pB","../statistics/var":"ujYK"}],"wF4V":[function(require,module,exports) { "use strict";module.exports=[require("./mad"),require("./max"),require("./mean"),require("./median"),require("./min"),require("./mode"),require("./prod"),require("./quantileSeq"),require("./std"),require("./sum"),require("./var")]; },{"./mad":"Je7I","./max":"US8O","./mean":"WyK1","./median":"LcS3","./min":"VKqc","./mode":"DTxj","./prod":"Hc7x","./quantileSeq":"hl2d","./std":"hFUZ","./sum":"y9hQ","./var":"ujYK"}],"Y1aD":[function(require,module,exports) { "use strict";var r=require("../../utils/string").isString,t=require("../../utils/string").format;function i(r,t,i,n){var s=n("print",{"string, Object | Array":e,"string, Object | Array, number | Object":e});return s.toTex=void 0,s}function e(i,e,n){return i.replace(/\$([\w.]+)/g,function(i,s){for(var o=s.split("."),u=e[o.shift()];o.length&&void 0!==u;){var a=o.shift();u=a?u[a]:u+"."}return void 0!==u?r(u)?u:t(u,n):i})}exports.name="print",exports.factory=i; },{"../../utils/string":"PshC"}],"PVZV":[function(require,module,exports) { "use strict";module.exports=[require("./format"),require("./print")]; },{"./format":"A04Q","./print":"Y1aD"}],"VaAN":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function e(e,t,o,n){var c=n("acos",{number:function(r){return r>=-1&&r<=1||t.predictable?Math.acos(r):new e.Complex(r,0).acos()},Complex:function(r){return r.acos()},BigNumber:function(r){return r.acos()},"Array | Matrix":function(e){return r(e,c)}});return c.toTex={1:"\\cos^{-1}\\left(${args[0]}\\right)"},c}exports.name="acos",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo"}],"ztg1":[function(require,module,exports) { "use strict";var t=require("../../utils/collection/deepMap");function r(r,o,n,a){var c=a("acosh",{number:function(t){return t>=1||o.predictable?e(t):t<=-1?new r.Complex(Math.log(Math.sqrt(t*t-1)-t),Math.PI):new r.Complex(t,0).acosh()},Complex:function(t){return t.acosh()},BigNumber:function(t){return t.acosh()},"Array | Matrix":function(r){return t(r,c)}});return c.toTex={1:"\\cosh^{-1}\\left(${args[0]}\\right)"},c}var e=Math.acosh||function(t){return Math.log(Math.sqrt(t*t-1)+t)};exports.name="acosh",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo"}],"y5e7":[function(require,module,exports) { "use strict";var t=require("../../utils/collection/deepMap");function r(r,e,n,a){var o=a("acot",{number:function(t){return Math.atan(1/t)},Complex:function(t){return t.acot()},BigNumber:function(t){return new r.BigNumber(1).div(t).atan()},"Array | Matrix":function(r){return t(r,o)}});return o.toTex={1:"\\cot^{-1}\\left(${args[0]}\\right)"},o}exports.name="acot",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo"}],"qhkj":[function(require,module,exports) { "use strict";var t=require("../../utils/collection/deepMap");function r(r,e,n,o){var i=o("acoth",{number:function(t){return t>=1||t<=-1||e.predictable?isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0:new r.Complex(t,0).acoth()},Complex:function(t){return t.acoth()},BigNumber:function(t){return new r.BigNumber(1).div(t).atanh()},"Array | Matrix":function(r){return t(r,i)}});return i.toTex={1:"\\coth^{-1}\\left(${args[0]}\\right)"},i}exports.name="acoth",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo"}],"U7Zf":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function e(e,t,n,c){var i=c("acsc",{number:function(r){return r<=-1||r>=1||t.predictable?Math.asin(1/r):new e.Complex(r,0).acsc()},Complex:function(r){return r.acsc()},BigNumber:function(r){return new e.BigNumber(1).div(r).asin()},"Array | Matrix":function(e){return r(e,i)}});return i.toTex={1:"\\csc^{-1}\\left(${args[0]}\\right)"},i}exports.name="acsc",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo"}],"YhGE":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function t(t,e,n,c){var u=c("acsch",{number:function(r){return r=1/r,Math.log(r+Math.sqrt(r*r+1))},Complex:function(r){return r.acsch()},BigNumber:function(r){return new t.BigNumber(1).div(r).asinh()},"Array | Matrix":function(t){return r(t,u)}});return u.toTex={1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},u}exports.name="acsch",exports.factory=t; },{"../../utils/collection/deepMap":"lOYo"}],"Ln1e":[function(require,module,exports) { "use strict";var e=require("../../utils/collection/deepMap");function r(r,t,n,c){var a=c("asec",{number:function(e){return e<=-1||e>=1||t.predictable?Math.acos(1/e):new r.Complex(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new r.BigNumber(1).div(e).acos()},"Array | Matrix":function(r){return e(r,a)}});return a.toTex={1:"\\sec^{-1}\\left(${args[0]}\\right)"},a}exports.name="asec",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo"}],"hL0t":[function(require,module,exports) { "use strict";var e=require("../../utils/collection/deepMap");function r(r,t,n,a){var c=a("asech",{number:function(e){if(e<=1&&e>=-1||t.predictable){e=1/e;var n=Math.sqrt(e*e-1);return e>0||t.predictable?Math.log(n+e):new r.Complex(Math.log(n-e),Math.PI)}return new r.Complex(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new r.BigNumber(1).div(e).acosh()},"Array | Matrix":function(r){return e(r,c)}});return c.toTex={1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},c}exports.name="asech",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo"}],"Kjxu":[function(require,module,exports) { "use strict";var n=require("../../utils/collection/deepMap");function r(r,e,t,i){var a=i("asin",{number:function(n){return n>=-1&&n<=1||e.predictable?Math.asin(n):new r.Complex(n,0).asin()},Complex:function(n){return n.asin()},BigNumber:function(n){return n.asin()},"Array | Matrix":function(r){return n(r,a,!0)}});return a.toTex={1:"\\sin^{-1}\\left(${args[0]}\\right)"},a}exports.name="asin",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo"}],"IRsU":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function t(t,n,e,i){var a=i("asinh",{number:Math.asinh||function(r){return Math.log(Math.sqrt(r*r+1)+r)},Complex:function(r){return r.asinh()},BigNumber:function(r){return r.asinh()},"Array | Matrix":function(t){return r(t,a,!0)}});return a.toTex={1:"\\sinh^{-1}\\left(${args[0]}\\right)"},a}exports.name="asinh",exports.factory=t; },{"../../utils/collection/deepMap":"lOYo"}],"RhXd":[function(require,module,exports) { "use strict";var t=require("../../utils/collection/deepMap");function r(r,n,a,e){var u=e("atan",{number:function(t){return Math.atan(t)},Complex:function(t){return t.atan()},BigNumber:function(t){return t.atan()},"Array | Matrix":function(r){return t(r,u,!0)}});return u.toTex={1:"\\tan^{-1}\\left(${args[0]}\\right)"},u}exports.name="atan",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo"}],"lP3L":[function(require,module,exports) { "use strict";function r(r,t,e,i){var n=e(require("../../type/matrix/function/matrix")),u=e(require("../../type/matrix/utils/algorithm02")),a=e(require("../../type/matrix/utils/algorithm03")),m=e(require("../../type/matrix/utils/algorithm09")),o=e(require("../../type/matrix/utils/algorithm11")),x=e(require("../../type/matrix/utils/algorithm12")),s=e(require("../../type/matrix/utils/algorithm13")),f=e(require("../../type/matrix/utils/algorithm14")),c=i("atan2",{"number, number":Math.atan2,"BigNumber, BigNumber":function(t,e){return r.BigNumber.atan2(t,e)},"SparseMatrix, SparseMatrix":function(r,t){return m(r,t,c,!1)},"SparseMatrix, DenseMatrix":function(r,t){return u(t,r,c,!0)},"DenseMatrix, SparseMatrix":function(r,t){return a(r,t,c,!1)},"DenseMatrix, DenseMatrix":function(r,t){return s(r,t,c)},"Array, Array":function(r,t){return c(n(r),n(t)).valueOf()},"Array, Matrix":function(r,t){return c(n(r),t)},"Matrix, Array":function(r,t){return c(r,n(t))},"SparseMatrix, number | BigNumber":function(r,t){return o(r,t,c,!1)},"DenseMatrix, number | BigNumber":function(r,t){return f(r,t,c,!1)},"number | BigNumber, SparseMatrix":function(r,t){return x(t,r,c,!0)},"number | BigNumber, DenseMatrix":function(r,t){return f(t,r,c,!0)},"Array, number | BigNumber":function(r,t){return f(n(r),t,c,!1).valueOf()},"number | BigNumber, Array":function(r,t){return f(n(t),r,c,!0).valueOf()}});return c.toTex={2:"\\mathrm{atan2}\\left(${args}\\right)"},c}exports.name="atan2",exports.factory=r; },{"../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm02":"j4Xj","../../type/matrix/utils/algorithm03":"oR02","../../type/matrix/utils/algorithm09":"PvZY","../../type/matrix/utils/algorithm11":"dpKK","../../type/matrix/utils/algorithm12":"Pn2O","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"PRlQ":[function(require,module,exports) { "use strict";var t=require("../../utils/collection/deepMap");function n(n,a,e,u){var o=u("atanh",{number:function(t){return t<=1&&t>=-1||a.predictable?r(t):new n.Complex(t,0).atanh()},Complex:function(t){return t.atanh()},BigNumber:function(t){return t.atanh()},"Array | Matrix":function(n){return t(n,o,!0)}});return o.toTex={1:"\\tanh^{-1}\\left(${args[0]}\\right)"},o}var r=Math.atanh||function(t){return Math.log((1+t)/(1-t))/2};exports.name="atanh",exports.factory=n; },{"../../utils/collection/deepMap":"lOYo"}],"WIaC":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function n(n,t,e,o){var i=o("cos",{number:Math.cos,Complex:function(r){return r.cos()},BigNumber:function(r){return r.cos()},Unit:function(r){if(!r.hasBase(n.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cos is no angle");return i(r.value)},"Array | Matrix":function(n){return r(n,i)}});return i.toTex={1:"\\cos\\left(${args[0]}\\right)"},i}exports.name="cos",exports.factory=n; },{"../../utils/collection/deepMap":"lOYo"}],"urk8":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function t(t,e,o,i){var u=i("cosh",{number:n,Complex:function(r){return r.cosh()},BigNumber:function(r){return r.cosh()},Unit:function(r){if(!r.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cosh is no angle");return u(r.value)},"Array | Matrix":function(t){return r(t,u)}});return u.toTex={1:"\\cosh\\left(${args[0]}\\right)"},u}var n=Math.cosh||function(r){return(Math.exp(r)+Math.exp(-r))/2};exports.name="cosh",exports.factory=t; },{"../../utils/collection/deepMap":"lOYo"}],"ray7":[function(require,module,exports) { "use strict";var t=require("../../utils/collection/deepMap");function n(n,r,e,i){var o=i("cot",{number:function(t){return 1/Math.tan(t)},Complex:function(t){return t.cot()},BigNumber:function(t){return new n.BigNumber(1).div(t.tan())},Unit:function(t){if(!t.hasBase(n.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return o(t.value)},"Array | Matrix":function(n){return t(n,o)}});return o.toTex={1:"\\cot\\left(${args[0]}\\right)"},o}exports.name="cot",exports.factory=n; },{"../../utils/collection/deepMap":"lOYo"}],"wqSx":[function(require,module,exports) { "use strict";var t=require("../../utils/collection/deepMap");function r(r,e,i,o){var u=o("coth",{number:n,Complex:function(t){return t.coth()},BigNumber:function(t){return new r.BigNumber(1).div(t.tanh())},Unit:function(t){if(!t.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function coth is no angle");return u(t.value)},"Array | Matrix":function(r){return t(r,u)}});return u.toTex={1:"\\coth\\left(${args[0]}\\right)"},u}function n(t){var r=Math.exp(2*t);return(r+1)/(r-1)}exports.name="coth",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo"}],"R45M":[function(require,module,exports) { "use strict";var n=require("../../utils/collection/deepMap");function r(r,t,e,i){var c=i("csc",{number:function(n){return 1/Math.sin(n)},Complex:function(n){return n.csc()},BigNumber:function(n){return new r.BigNumber(1).div(n.sin())},Unit:function(n){if(!n.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csc is no angle");return c(n.value)},"Array | Matrix":function(r){return n(r,c)}});return c.toTex={1:"\\csc\\left(${args[0]}\\right)"},c}exports.name="csc",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo"}],"AQW3":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap"),n=require("../../utils/number").sign;function e(n,e,i,u){var c=u("csch",{number:t,Complex:function(r){return r.csch()},BigNumber:function(r){return new n.BigNumber(1).div(r.sinh())},Unit:function(r){if(!r.hasBase(n.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csch is no angle");return c(r.value)},"Array | Matrix":function(n){return r(n,c)}});return c.toTex={1:"\\mathrm{csch}\\left(${args[0]}\\right)"},c}function t(r){return 0===r?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(r)-Math.exp(-r)))*n(r)}exports.name="csch",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo","../../utils/number":"uqMu"}],"CaBc":[function(require,module,exports) { "use strict";var e=require("../../utils/collection/deepMap");function r(r,n,t,i){var u=i("sec",{number:function(e){return 1/Math.cos(e)},Complex:function(e){return e.sec()},BigNumber:function(e){return new r.BigNumber(1).div(e.cos())},Unit:function(e){if(!e.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sec is no angle");return u(e.value)},"Array | Matrix":function(r){return e(r,u)}});return u.toTex={1:"\\sec\\left(${args[0]}\\right)"},u}exports.name="sec",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo"}],"twiY":[function(require,module,exports) { "use strict";var e=require("../../utils/collection/deepMap");function r(r,t,i,u){var o=u("sech",{number:n,Complex:function(e){return e.sech()},BigNumber:function(e){return new r.BigNumber(1).div(e.cosh())},Unit:function(e){if(!e.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sech is no angle");return o(e.value)},"Array | Matrix":function(r){return e(r,o)}});return o.toTex={1:"\\mathrm{sech}\\left(${args[0]}\\right)"},o}function n(e){return 2/(Math.exp(e)+Math.exp(-e))}exports.name="sech",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo"}],"v5Tm":[function(require,module,exports) { "use strict";var n=require("../../utils/collection/deepMap");function r(r,t,i,e){var u=e("sin",{number:Math.sin,Complex:function(n){return n.sin()},BigNumber:function(n){return n.sin()},Unit:function(n){if(!n.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sin is no angle");return u(n.value)},"Array | Matrix":function(r){return n(r,u,!0)}});return u.toTex={1:"\\sin\\left(${args[0]}\\right)"},u}exports.name="sin",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo"}],"Q1nY":[function(require,module,exports) { "use strict";var n=require("../../utils/collection/deepMap");function r(r,e,i,u){var o=u("sinh",{number:t,Complex:function(n){return n.sinh()},BigNumber:function(n){return n.sinh()},Unit:function(n){if(!n.hasBase(r.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sinh is no angle");return o(n.value)},"Array | Matrix":function(r){return n(r,o,!0)}});return o.toTex={1:"\\sinh\\left(${args[0]}\\right)"},o}var t=Math.sinh||function(n){return(Math.exp(n)-Math.exp(-n))/2};exports.name="sinh",exports.factory=r; },{"../../utils/collection/deepMap":"lOYo"}],"jk9z":[function(require,module,exports) { "use strict";var n=require("../../utils/collection/deepMap");function t(t,r,e,a){var i=a("tan",{number:Math.tan,Complex:function(n){return n.tan()},BigNumber:function(n){return n.tan()},Unit:function(n){if(!n.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tan is no angle");return i(n.value)},"Array | Matrix":function(t){return n(t,i,!0)}});return i.toTex={1:"\\tan\\left(${args[0]}\\right)"},i}exports.name="tan",exports.factory=t; },{"../../utils/collection/deepMap":"lOYo"}],"FXHB":[function(require,module,exports) { "use strict";var n=require("../../utils/collection/deepMap");function t(t,e,a,i){var u=i("tanh",{number:r,Complex:function(n){return n.tanh()},BigNumber:function(n){return n.tanh()},Unit:function(n){if(!n.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tanh is no angle");return u(n.value)},"Array | Matrix":function(t){return n(t,u,!0)}});return u.toTex={1:"\\tanh\\left(${args[0]}\\right)"},u}var r=Math.tanh||function(n){var t=Math.exp(2*n);return(t-1)/(t+1)};exports.name="tanh",exports.factory=t; },{"../../utils/collection/deepMap":"lOYo"}],"SGcX":[function(require,module,exports) { "use strict";module.exports=[require("./acos"),require("./acosh"),require("./acot"),require("./acoth"),require("./acsc"),require("./acsch"),require("./asec"),require("./asech"),require("./asin"),require("./asinh"),require("./atan"),require("./atan2"),require("./atanh"),require("./cos"),require("./cosh"),require("./cot"),require("./coth"),require("./csc"),require("./csch"),require("./sec"),require("./sech"),require("./sin"),require("./sinh"),require("./tan"),require("./tanh")]; },{"./acos":"VaAN","./acosh":"ztg1","./acot":"y5e7","./acoth":"qhkj","./acsc":"U7Zf","./acsch":"YhGE","./asec":"Ln1e","./asech":"hL0t","./asin":"Kjxu","./asinh":"IRsU","./atan":"RhXd","./atan2":"lP3L","./atanh":"PRlQ","./cos":"WIaC","./cosh":"urk8","./cot":"ray7","./coth":"wqSx","./csc":"R45M","./csch":"AQW3","./sec":"CaBc","./sech":"twiY","./sin":"v5Tm","./sinh":"Q1nY","./tan":"jk9z","./tanh":"FXHB"}],"aMR7":[function(require,module,exports) { "use strict";function r(r,t,n,i){var a=require("../../utils/latex"),e=n(require("../../type/matrix/function/matrix")),u=n(require("../../type/matrix/utils/algorithm13")),o=n(require("../../type/matrix/utils/algorithm14")),f=i("to",{"Unit, Unit | string":function(r,t){return r.to(t)},"Matrix, Matrix":function(r,t){return u(r,t,f)},"Array, Array":function(r,t){return f(e(r),e(t)).valueOf()},"Array, Matrix":function(r,t){return f(e(r),t)},"Matrix, Array":function(r,t){return f(r,e(t))},"Matrix, any":function(r,t){return o(r,t,f,!1)},"any, Matrix":function(r,t){return o(t,r,f,!0)},"Array, any":function(r,t){return o(e(r),t,f,!1).valueOf()},"any, Array":function(r,t){return o(e(t),r,f,!0).valueOf()}});return f.toTex={2:"\\left(${args[0]}".concat(a.operators.to,"${args[1]}\\right)")},f}exports.name="to",exports.factory=r; },{"../../utils/latex":"H1Mr","../../type/matrix/function/matrix":"vzj5","../../type/matrix/utils/algorithm13":"NS7U","../../type/matrix/utils/algorithm14":"S2eB"}],"rv7z":[function(require,module,exports) { "use strict";module.exports=[require("./to")]; },{"./to":"aMR7"}],"Oa1A":[function(require,module,exports) { "use strict";var e=require("../../utils/object");function o(o,r,t,n){var c=n("clone",{any:e.clone});return c.toTex=void 0,c}exports.name="clone",exports.factory=o; },{"../../utils/object":"FcSp"}],"mSLG":[function(require,module,exports) { "use strict";function r(r,e,t,u){var n=t(require("./isNumeric"));return u("hasNumericValue",{string:function(r){return r.trim().length>0&&!isNaN(Number(r))},any:function(r){return n(r)}})}exports.name="hasNumericValue",exports.factory=r; },{"./isNumeric":"Rv38"}],"on0C":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function e(e,t,i,u){var n=u("isPrime",{number:function(r){if(r<2)return!1;if(2===r)return!0;if(r%2==0)return!1;for(var e=3;e*e<=r;e+=2)if(r%e==0)return!1;return!0},BigNumber:function(r){if(r.lt(2))return!1;if(r.equals(2))return!0;if(r.mod(2).isZero())return!1;for(var t=e.BigNumber(3);t.times(t).lte(r);t=t.plus(1))if(r.mod(t).isZero())return!1;return!0},"Array | Matrix":function(e){return r(e,n)}});return n}exports.name="isPrime",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo"}],"tvom":[function(require,module,exports) { "use strict";module.exports=[require("./clone"),require("./isInteger"),require("./isNegative"),require("./isNumeric"),require("./hasNumericValue"),require("./isPositive"),require("./isPrime"),require("./isZero"),require("./isNaN"),require("./typeof")]; },{"./clone":"Oa1A","./isInteger":"qG7X","./isNegative":"HYoC","./isNumeric":"Rv38","./hasNumericValue":"mSLG","./isPositive":"OFKG","./isPrime":"on0C","./isZero":"geyZ","./isNaN":"AHex","./typeof":"LZTG"}],"wKfj":[function(require,module,exports) { "use strict";module.exports=[require("./algebra"),require("./arithmetic"),require("./bitwise"),require("./combinatorics"),require("./complex"),require("./geometry"),require("./logical"),require("./matrix"),require("./probability"),require("./relational"),require("./set"),require("./special"),require("./statistics"),require("./string"),require("./trigonometry"),require("./unit"),require("./utils")]; },{"./algebra":"VeYJ","./arithmetic":"bAc9","./bitwise":"JhAg","./combinatorics":"otxT","./complex":"gHt6","./geometry":"W9Zs","./logical":"TPFf","./matrix":"X3kh","./probability":"xCRU","./relational":"IR2w","./set":"O2mj","./special":"JuUL","./statistics":"wF4V","./string":"PVZV","./trigonometry":"SGcX","./unit":"rv7z","./utils":"tvom"}],"iLNC":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"t9At":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"JrNm":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"p1Y0":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"L0ae":[function(require,module,exports) { "use strict";module.exports={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(num,den)"],description:"Create a fraction from a number or from a numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]}; },{}],"u7WR":[function(require,module,exports) { "use strict";module.exports={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:["[]","[1, 2, 3]","A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[0:2, 0:2] = ones(2, 2)"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]}; },{}],"ig4c":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"a1WX":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"wNuW":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"YFZz":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"rqOi":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"x7uc":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"MQ99":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"T9NB":[function(require,module,exports) { "use strict";module.exports={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]}; },{}],"aPHB":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"QQb5":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"aXGR":[function(require,module,exports) { "use strict";module.exports={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]}; },{}],"ONCS":[function(require,module,exports) { "use strict";module.exports={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]}; },{}],"l03h":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"IwW2":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"sLjM":[function(require,module,exports) { "use strict";module.exports={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]}; },{}],"lowc":[function(require,module,exports) { "use strict";module.exports={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]}; },{}],"HJY8":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"jcFy":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"fDHA":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"yYpy":[function(require,module,exports) { "use strict";module.exports={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]}; },{}],"aQgJ":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"n6zq":[function(require,module,exports) { "use strict";module.exports={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]}; },{}],"CPzZ":[function(require,module,exports) { "use strict";module.exports={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]}; },{}],"HjBS":[function(require,module,exports) { "use strict";module.exports={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.eval({x: 3})"],seealso:["simplify","parse","eval"]}; },{}],"OFzm":[function(require,module,exports) { "use strict";module.exports={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Solves 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:["lup","lusolve","usolve","matrix","sparse"]}; },{}],"SsYr":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"F1Dh":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"yWjE":[function(require,module,exports) { "use strict";module.exports={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.eval({x: 2})"],seealso:["derivative","parse","eval"]}; },{}],"xCNe":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"h0vC":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"RXlV":[function(require,module,exports) { "use strict";module.exports={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Solves 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:["lup","lusolve","lsolve","matrix","sparse"]}; },{}],"rUq2":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"XkjO":[function(require,module,exports) { "use strict";module.exports={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]}; },{}],"k4Wb":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"aoF1":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"z4It":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"ruVI":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"sbSk":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"hr3Z":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"p0XP":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"HDd7":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"y0AC":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"iddg":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"pk0d":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"WGIH":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"vXNc":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"dwcd":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"Vx3c":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"gaE4":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"vbjs":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"XIlx":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"WGSj":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"qxOp":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"WNo3":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"rG0J":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"av88":[function(require,module,exports) { "use strict";module.exports={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")']}; },{}],"tPWr":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"Hwjx":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"RTne":[function(require,module,exports) { "use strict";module.exports={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)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]}; },{}],"ayTa":[function(require,module,exports) { "use strict";module.exports={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)"],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)"],seealso:["ceil","floor","fix"]}; },{}],"HnEg":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"uX7J":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"MaXS":[function(require,module,exports) { "use strict";module.exports={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([[1, 2], [3, 4]])"],seealso:["sqrt","abs","square","multiply"]}; },{}],"wa24":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"IpJ1":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"zSOc":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"hWWr":[function(require,module,exports) { "use strict";module.exports={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]}; },{}],"LePI":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"cry4":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"HcKC":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"ujKO":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"WecP":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"T9yh":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"ZNwk":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"XUC6":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"a5Km":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"gEl1":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"oDTX":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"sdgX":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"DO71":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"ZwB0":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"Shzo":[function(require,module,exports) { "use strict";module.exports={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number, number": f(x)=x+x })',"double(2)",'double("hello")'],seealso:[]}; },{}],"DVdV":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"Wmy6":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"zwHi":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"QAET":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"bVEH":[function(require,module,exports) { "use strict";module.exports={name:"eval",category:"Expression",syntax:["eval(expression)","eval([expr1, expr2, expr3, ...])"],description:"Evaluate an expression or an array with expressions.",examples:['eval("2 + 3")','eval("sqrt(" + 4 + ")")'],seealso:[]}; },{}],"Fax8":[function(require,module,exports) { "use strict";module.exports={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]}; },{}],"dMW5":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"bVBO":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"AWzT":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"AWWa":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"JhOe":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"JMRD":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"aMEf":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"q0hB":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"IWZn":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"nnFv":[function(require,module,exports) { "use strict";module.exports={name:"transpose",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"]}; },{}],"qD6G":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"UQh1":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"BlyW":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"bnMU":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"iJ3P":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"CckY":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"UmBd":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"l4FK":[function(require,module,exports) { "use strict";module.exports={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["forEach([1, 2, 3], function(val) { console.log(val) })"],seealso:["map","sort","filter"]}; },{}],"DDDN":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"DU2x":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"oHAh":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"fbw8":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"fQm4":[function(require,module,exports) { "use strict";module.exports={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)'],seealso:["sort"]}; },{}],"NLcZ":[function(require,module,exports) { "use strict";module.exports={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")',"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"]}; },{}],"tmIl":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"DOEY":[function(require,module,exports) { "use strict";module.exports={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])"],seealso:["size","squeeze","resize"]}; },{}],"FNOD":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"lVw7":[function(require,module,exports) { "use strict";module.exports={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","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]}; },{}],"bGuK":[function(require,module,exports) { "use strict";module.exports={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"])',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]}; },{}],"MpqE":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"WRJB":[function(require,module,exports) { "use strict";module.exports={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of a matrix or string. Indexes are one-based. Both the ranges lower-bound and upper-bound are included.",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]"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]}; },{}],"nc6c":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"fj0p":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"nFaR":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"M4Fz":[function(require,module,exports) { "use strict";module.exports={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:["permutations","factorial"]}; },{}],"cbU5":[function(require,module,exports) { "use strict";module.exports={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","permutations","gamma"]}; },{}],"mIdZ":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"W9Q9":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"y9uR":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"qGLJ":[function(require,module,exports) { "use strict";module.exports={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","factorial"]}; },{}],"iKEH":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"pXBT":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"fj2Q":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"jKwP":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"JLzY":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"Bmmt":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"bLpw":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"wgSR":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"HVZA":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"TH74":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"hahd":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"iBZ4":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"Ob6s":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"kwrJ":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"qllh":[function(require,module,exports) { "use strict";module.exports={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 before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]}; },{}],"jaWL":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"VDoP":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"kvfp":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"XvM6":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"sMXh":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"rmtw":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"AYWb":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"reLj":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"Wqu5":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"NbhS":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"EtYx":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"L2AM":[function(require,module,exports) { "use strict";module.exports={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dim)"],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","var"]}; },{}],"qRED":[function(require,module,exports) { "use strict";module.exports={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dim)"],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","var"]}; },{}],"nYR2":[function(require,module,exports) { "use strict";module.exports={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","var","quantileSeq"]}; },{}],"xrLZ":[function(require,module,exports) { "use strict";module.exports={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dim)"],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","var"]}; },{}],"yBPR":[function(require,module,exports) { "use strict";module.exports={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","var"]}; },{}],"NCYX":[function(require,module,exports) { "use strict";module.exports={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","var"]}; },{}],"Gbgi":[function(require,module,exports) { "use strict";module.exports={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","var"]}; },{}],"uXlw":[function(require,module,exports) { "use strict";module.exports={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(var(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","min","prod","sum","var"]}; },{}],"qyn0":[function(require,module,exports) { "use strict";module.exports={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)"],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","var"]}; },{}],"siyP":[function(require,module,exports) { "use strict";module.exports={name:"var",category:"Statistics",syntax:["var(a, b, c, ...)","var(A)","var(A, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["var(2, 4, 6)","var([2, 4, 6, 8])",'var([2, 4, 6, 8], "uncorrected")','var([2, 4, 6, 8], "biased")',"var([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]}; },{}],"HPVa":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"MvCO":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"xXPM":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"KpnL":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"Gt5T":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"XLHb":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"uxTA":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"eRMa":[function(require,module,exports) { "use strict";module.exports={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]}; },{}],"M9R8":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"qY7D":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"s9IB":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"fjot":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"Z7HZ":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"DWzk":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"maYo":[function(require,module,exports) { "use strict";module.exports={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]}; },{}],"wCAM":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"AM7w":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"cTPc":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"uHb4":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"hpuP":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"WKMm":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"gPaM":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"G3av":[function(require,module,exports) { "use strict";module.exports={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]}; },{}],"N6lO":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"teZk":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"ROe2":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"I9FW":[function(require,module,exports) { "use strict";module.exports={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:[]}; },{}],"gPkx":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"VF4n":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"rt70":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"hspf":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"Tqof":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"RYV2":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"pq0g":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"mX5V":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"MHMc":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"v295":[function(require,module,exports) { "use strict";module.exports={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"]}; },{}],"u4GE":[function(require,module,exports) { "use strict";function e(e,i,t,r){var n={};return n.bignumber=require("./construction/bignumber"),n.boolean=require("./construction/boolean"),n.complex=require("./construction/complex"),n.createUnit=require("./construction/createUnit"),n.fraction=require("./construction/fraction"),n.index=require("./construction/index"),n.matrix=require("./construction/matrix"),n.number=require("./construction/number"),n.sparse=require("./construction/sparse"),n.splitUnit=require("./construction/splitUnit"),n.string=require("./construction/string"),n.unit=require("./construction/unit"),n.e=require("./constants/e"),n.E=require("./constants/e"),n.false=require("./constants/false"),n.i=require("./constants/i"),n[1/0]=require("./constants/Infinity"),n.LN2=require("./constants/LN2"),n.LN10=require("./constants/LN10"),n.LOG2E=require("./constants/LOG2E"),n.LOG10E=require("./constants/LOG10E"),n.NaN=require("./constants/NaN"),n.null=require("./constants/null"),n.pi=require("./constants/pi"),n.PI=require("./constants/pi"),n.phi=require("./constants/phi"),n.SQRT1_2=require("./constants/SQRT1_2"),n.SQRT2=require("./constants/SQRT2"),n.tau=require("./constants/tau"),n.true=require("./constants/true"),n.version=require("./constants/version"),n.speedOfLight={description:"Speed of light in vacuum",examples:["speedOfLight"]},n.gravitationConstant={description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},n.planckConstant={description:"Planck constant",examples:["planckConstant"]},n.reducedPlanckConstant={description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},n.magneticConstant={description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},n.electricConstant={description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},n.vacuumImpedance={description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},n.coulomb={description:"Coulomb's constant",examples:["coulomb"]},n.elementaryCharge={description:"Elementary charge",examples:["elementaryCharge"]},n.bohrMagneton={description:"Borh magneton",examples:["bohrMagneton"]},n.conductanceQuantum={description:"Conductance quantum",examples:["conductanceQuantum"]},n.inverseConductanceQuantum={description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},n.magneticFluxQuantum={description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},n.nuclearMagneton={description:"Nuclear magneton",examples:["nuclearMagneton"]},n.klitzing={description:"Von Klitzing constant",examples:["klitzing"]},n.bohrRadius={description:"Borh radius",examples:["bohrRadius"]},n.classicalElectronRadius={description:"Classical electron radius",examples:["classicalElectronRadius"]},n.electronMass={description:"Electron mass",examples:["electronMass"]},n.fermiCoupling={description:"Fermi coupling constant",examples:["fermiCoupling"]},n.fineStructure={description:"Fine-structure constant",examples:["fineStructure"]},n.hartreeEnergy={description:"Hartree energy",examples:["hartreeEnergy"]},n.protonMass={description:"Proton mass",examples:["protonMass"]},n.deuteronMass={description:"Deuteron Mass",examples:["deuteronMass"]},n.neutronMass={description:"Neutron mass",examples:["neutronMass"]},n.quantumOfCirculation={description:"Quantum of circulation",examples:["quantumOfCirculation"]},n.rydberg={description:"Rydberg constant",examples:["rydberg"]},n.thomsonCrossSection={description:"Thomson cross section",examples:["thomsonCrossSection"]},n.weakMixingAngle={description:"Weak mixing angle",examples:["weakMixingAngle"]},n.efimovFactor={description:"Efimov factor",examples:["efimovFactor"]},n.atomicMass={description:"Atomic mass constant",examples:["atomicMass"]},n.avogadro={description:"Avogadro's number",examples:["avogadro"]},n.boltzmann={description:"Boltzmann constant",examples:["boltzmann"]},n.faraday={description:"Faraday constant",examples:["faraday"]},n.firstRadiation={description:"First radiation constant",examples:["firstRadiation"]},n.loschmidt={description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},n.gasConstant={description:"Gas constant",examples:["gasConstant"]},n.molarPlanckConstant={description:"Molar Planck constant",examples:["molarPlanckConstant"]},n.molarVolume={description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},n.sackurTetrode={description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},n.secondRadiation={description:"Second radiation constant",examples:["secondRadiation"]},n.stefanBoltzmann={description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},n.wienDisplacement={description:"Wien displacement law constant",examples:["wienDisplacement"]},n.molarMass={description:"Molar mass constant",examples:["molarMass"]},n.molarMassC12={description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},n.gravity={description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},n.planckLength={description:"Planck length",examples:["planckLength"]},n.planckMass={description:"Planck mass",examples:["planckMass"]},n.planckTime={description:"Planck time",examples:["planckTime"]},n.planckCharge={description:"Planck charge",examples:["planckCharge"]},n.planckTemperature={description:"Planck temperature",examples:["planckTemperature"]},n.derivative=require("./function/algebra/derivative"),n.lsolve=require("./function/algebra/lsolve"),n.lup=require("./function/algebra/lup"),n.lusolve=require("./function/algebra/lusolve"),n.simplify=require("./function/algebra/simplify"),n.rationalize=require("./function/algebra/rationalize"),n.slu=require("./function/algebra/slu"),n.usolve=require("./function/algebra/usolve"),n.qr=require("./function/algebra/qr"),n.abs=require("./function/arithmetic/abs"),n.add=require("./function/arithmetic/add"),n.cbrt=require("./function/arithmetic/cbrt"),n.ceil=require("./function/arithmetic/ceil"),n.cube=require("./function/arithmetic/cube"),n.divide=require("./function/arithmetic/divide"),n.dotDivide=require("./function/arithmetic/dotDivide"),n.dotMultiply=require("./function/arithmetic/dotMultiply"),n.dotPow=require("./function/arithmetic/dotPow"),n.exp=require("./function/arithmetic/exp"),n.expm=require("./function/arithmetic/expm"),n.expm1=require("./function/arithmetic/expm1"),n.fix=require("./function/arithmetic/fix"),n.floor=require("./function/arithmetic/floor"),n.gcd=require("./function/arithmetic/gcd"),n.hypot=require("./function/arithmetic/hypot"),n.lcm=require("./function/arithmetic/lcm"),n.log=require("./function/arithmetic/log"),n.log2=require("./function/arithmetic/log2"),n.log1p=require("./function/arithmetic/log1p"),n.log10=require("./function/arithmetic/log10"),n.mod=require("./function/arithmetic/mod"),n.multiply=require("./function/arithmetic/multiply"),n.norm=require("./function/arithmetic/norm"),n.nthRoot=require("./function/arithmetic/nthRoot"),n.nthRoots=require("./function/arithmetic/nthRoots"),n.pow=require("./function/arithmetic/pow"),n.round=require("./function/arithmetic/round"),n.sign=require("./function/arithmetic/sign"),n.sqrt=require("./function/arithmetic/sqrt"),n.sqrtm=require("./function/arithmetic/sqrtm"),n.square=require("./function/arithmetic/square"),n.subtract=require("./function/arithmetic/subtract"),n.unaryMinus=require("./function/arithmetic/unaryMinus"),n.unaryPlus=require("./function/arithmetic/unaryPlus"),n.xgcd=require("./function/arithmetic/xgcd"),n.bitAnd=require("./function/bitwise/bitAnd"),n.bitNot=require("./function/bitwise/bitNot"),n.bitOr=require("./function/bitwise/bitOr"),n.bitXor=require("./function/bitwise/bitXor"),n.leftShift=require("./function/bitwise/leftShift"),n.rightArithShift=require("./function/bitwise/rightArithShift"),n.rightLogShift=require("./function/bitwise/rightLogShift"),n.bellNumbers=require("./function/combinatorics/bellNumbers"),n.catalan=require("./function/combinatorics/catalan"),n.composition=require("./function/combinatorics/composition"),n.stirlingS2=require("./function/combinatorics/stirlingS2"),n.config=require("./core/config"),n.import=require("./core/import"),n.typed=require("./core/typed"),n.arg=require("./function/complex/arg"),n.conj=require("./function/complex/conj"),n.re=require("./function/complex/re"),n.im=require("./function/complex/im"),n.eval=require("./function/expression/eval"),n.help=require("./function/expression/help"),n.distance=require("./function/geometry/distance"),n.intersect=require("./function/geometry/intersect"),n.and=require("./function/logical/and"),n.not=require("./function/logical/not"),n.or=require("./function/logical/or"),n.xor=require("./function/logical/xor"),n.column=require("./function/matrix/column"),n.concat=require("./function/matrix/concat"),n.cross=require("./function/matrix/cross"),n.ctranspose=require("./function/matrix/ctranspose"),n.det=require("./function/matrix/det"),n.diag=require("./function/matrix/diag"),n.dot=require("./function/matrix/dot"),n.getMatrixDataType=require("./function/matrix/getMatrixDataType"),n.identity=require("./function/matrix/identity"),n.filter=require("./function/matrix/filter"),n.flatten=require("./function/matrix/flatten"),n.forEach=require("./function/matrix/forEach"),n.inv=require("./function/matrix/inv"),n.kron=require("./function/matrix/kron"),n.map=require("./function/matrix/map"),n.ones=require("./function/matrix/ones"),n.partitionSelect=require("./function/matrix/partitionSelect"),n.range=require("./function/matrix/range"),n.resize=require("./function/matrix/resize"),n.reshape=require("./function/matrix/reshape"),n.row=require("./function/matrix/row"),n.size=require("./function/matrix/size"),n.sort=require("./function/matrix/sort"),n.squeeze=require("./function/matrix/squeeze"),n.subset=require("./function/matrix/subset"),n.trace=require("./function/matrix/trace"),n.transpose=require("./function/matrix/transpose"),n.zeros=require("./function/matrix/zeros"),n.combinations=require("./function/probability/combinations"),n.factorial=require("./function/probability/factorial"),n.gamma=require("./function/probability/gamma"),n.kldivergence=require("./function/probability/kldivergence"),n.multinomial=require("./function/probability/multinomial"),n.permutations=require("./function/probability/permutations"),n.pickRandom=require("./function/probability/pickRandom"),n.random=require("./function/probability/random"),n.randomInt=require("./function/probability/randomInt"),n.compare=require("./function/relational/compare"),n.compareNatural=require("./function/relational/compareNatural"),n.compareText=require("./function/relational/compareText"),n.deepEqual=require("./function/relational/deepEqual"),n.equal=require("./function/relational/equal"),n.equalText=require("./function/relational/equalText"),n.larger=require("./function/relational/larger"),n.largerEq=require("./function/relational/largerEq"),n.smaller=require("./function/relational/smaller"),n.smallerEq=require("./function/relational/smallerEq"),n.unequal=require("./function/relational/unequal"),n.setCartesian=require("./function/set/setCartesian"),n.setDifference=require("./function/set/setDifference"),n.setDistinct=require("./function/set/setDistinct"),n.setIntersect=require("./function/set/setIntersect"),n.setIsSubset=require("./function/set/setIsSubset"),n.setMultiplicity=require("./function/set/setMultiplicity"),n.setPowerset=require("./function/set/setPowerset"),n.setSize=require("./function/set/setSize"),n.setSymDifference=require("./function/set/setSymDifference"),n.setUnion=require("./function/set/setUnion"),n.erf=require("./function/special/erf"),n.mad=require("./function/statistics/mad"),n.max=require("./function/statistics/max"),n.mean=require("./function/statistics/mean"),n.median=require("./function/statistics/median"),n.min=require("./function/statistics/min"),n.mode=require("./function/statistics/mode"),n.prod=require("./function/statistics/prod"),n.quantileSeq=require("./function/statistics/quantileSeq"),n.std=require("./function/statistics/std"),n.sum=require("./function/statistics/sum"),n.var=require("./function/statistics/var"),n.acos=require("./function/trigonometry/acos"),n.acosh=require("./function/trigonometry/acosh"),n.acot=require("./function/trigonometry/acot"),n.acoth=require("./function/trigonometry/acoth"),n.acsc=require("./function/trigonometry/acsc"),n.acsch=require("./function/trigonometry/acsch"),n.asec=require("./function/trigonometry/asec"),n.asech=require("./function/trigonometry/asech"),n.asin=require("./function/trigonometry/asin"),n.asinh=require("./function/trigonometry/asinh"),n.atan=require("./function/trigonometry/atan"),n.atanh=require("./function/trigonometry/atanh"),n.atan2=require("./function/trigonometry/atan2"),n.cos=require("./function/trigonometry/cos"),n.cosh=require("./function/trigonometry/cosh"),n.cot=require("./function/trigonometry/cot"),n.coth=require("./function/trigonometry/coth"),n.csc=require("./function/trigonometry/csc"),n.csch=require("./function/trigonometry/csch"),n.sec=require("./function/trigonometry/sec"),n.sech=require("./function/trigonometry/sech"),n.sin=require("./function/trigonometry/sin"),n.sinh=require("./function/trigonometry/sinh"),n.tan=require("./function/trigonometry/tan"),n.tanh=require("./function/trigonometry/tanh"),n.to=require("./function/units/to"),n.clone=require("./function/utils/clone"),n.format=require("./function/utils/format"),n.isNaN=require("./function/utils/isNaN"),n.isInteger=require("./function/utils/isInteger"),n.isNegative=require("./function/utils/isNegative"),n.isNumeric=require("./function/utils/isNumeric"),n.hasNumericValue=require("./function/utils/hasNumericValue"),n.isPositive=require("./function/utils/isPositive"),n.isPrime=require("./function/utils/isPrime"),n.isZero=require("./function/utils/isZero"),n.typeof=require("./function/utils/typeof"),n}exports.name="docs",exports.path="expression",exports.factory=e; },{"./construction/bignumber":"iLNC","./construction/boolean":"t9At","./construction/complex":"JrNm","./construction/createUnit":"p1Y0","./construction/fraction":"L0ae","./construction/index":"u7WR","./construction/matrix":"ig4c","./construction/number":"a1WX","./construction/sparse":"wNuW","./construction/splitUnit":"YFZz","./construction/string":"rqOi","./construction/unit":"x7uc","./constants/e":"MQ99","./constants/false":"T9NB","./constants/i":"aPHB","./constants/Infinity":"QQb5","./constants/LN2":"aXGR","./constants/LN10":"ONCS","./constants/LOG2E":"l03h","./constants/LOG10E":"IwW2","./constants/NaN":"sLjM","./constants/null":"lowc","./constants/pi":"HJY8","./constants/phi":"jcFy","./constants/SQRT1_2":"fDHA","./constants/SQRT2":"yYpy","./constants/tau":"aQgJ","./constants/true":"n6zq","./constants/version":"CPzZ","./function/algebra/derivative":"HjBS","./function/algebra/lsolve":"OFzm","./function/algebra/lup":"SsYr","./function/algebra/lusolve":"F1Dh","./function/algebra/simplify":"yWjE","./function/algebra/rationalize":"xCNe","./function/algebra/slu":"h0vC","./function/algebra/usolve":"RXlV","./function/algebra/qr":"rUq2","./function/arithmetic/abs":"XkjO","./function/arithmetic/add":"k4Wb","./function/arithmetic/cbrt":"aoF1","./function/arithmetic/ceil":"z4It","./function/arithmetic/cube":"ruVI","./function/arithmetic/divide":"sbSk","./function/arithmetic/dotDivide":"hr3Z","./function/arithmetic/dotMultiply":"p0XP","./function/arithmetic/dotPow":"HDd7","./function/arithmetic/exp":"y0AC","./function/arithmetic/expm":"iddg","./function/arithmetic/expm1":"pk0d","./function/arithmetic/fix":"WGIH","./function/arithmetic/floor":"vXNc","./function/arithmetic/gcd":"dwcd","./function/arithmetic/hypot":"Vx3c","./function/arithmetic/lcm":"gaE4","./function/arithmetic/log":"vbjs","./function/arithmetic/log2":"XIlx","./function/arithmetic/log1p":"WGSj","./function/arithmetic/log10":"qxOp","./function/arithmetic/mod":"WNo3","./function/arithmetic/multiply":"rG0J","./function/arithmetic/norm":"av88","./function/arithmetic/nthRoot":"tPWr","./function/arithmetic/nthRoots":"Hwjx","./function/arithmetic/pow":"RTne","./function/arithmetic/round":"ayTa","./function/arithmetic/sign":"HnEg","./function/arithmetic/sqrt":"uX7J","./function/arithmetic/sqrtm":"MaXS","./function/arithmetic/square":"wa24","./function/arithmetic/subtract":"IpJ1","./function/arithmetic/unaryMinus":"zSOc","./function/arithmetic/unaryPlus":"hWWr","./function/arithmetic/xgcd":"LePI","./function/bitwise/bitAnd":"cry4","./function/bitwise/bitNot":"HcKC","./function/bitwise/bitOr":"ujKO","./function/bitwise/bitXor":"WecP","./function/bitwise/leftShift":"T9yh","./function/bitwise/rightArithShift":"ZNwk","./function/bitwise/rightLogShift":"XUC6","./function/combinatorics/bellNumbers":"a5Km","./function/combinatorics/catalan":"gEl1","./function/combinatorics/composition":"oDTX","./function/combinatorics/stirlingS2":"sdgX","./core/config":"DO71","./core/import":"ZwB0","./core/typed":"Shzo","./function/complex/arg":"DVdV","./function/complex/conj":"Wmy6","./function/complex/re":"zwHi","./function/complex/im":"QAET","./function/expression/eval":"bVEH","./function/expression/help":"Fax8","./function/geometry/distance":"dMW5","./function/geometry/intersect":"bVBO","./function/logical/and":"AWzT","./function/logical/not":"AWWa","./function/logical/or":"JhOe","./function/logical/xor":"JMRD","./function/matrix/column":"aMEf","./function/matrix/concat":"q0hB","./function/matrix/cross":"IWZn","./function/matrix/ctranspose":"nnFv","./function/matrix/det":"qD6G","./function/matrix/diag":"UQh1","./function/matrix/dot":"BlyW","./function/matrix/getMatrixDataType":"bnMU","./function/matrix/identity":"iJ3P","./function/matrix/filter":"CckY","./function/matrix/flatten":"UmBd","./function/matrix/forEach":"l4FK","./function/matrix/inv":"DDDN","./function/matrix/kron":"DU2x","./function/matrix/map":"oHAh","./function/matrix/ones":"fbw8","./function/matrix/partitionSelect":"fQm4","./function/matrix/range":"NLcZ","./function/matrix/resize":"tmIl","./function/matrix/reshape":"DOEY","./function/matrix/row":"FNOD","./function/matrix/size":"lVw7","./function/matrix/sort":"bGuK","./function/matrix/squeeze":"MpqE","./function/matrix/subset":"WRJB","./function/matrix/trace":"nc6c","./function/matrix/transpose":"fj0p","./function/matrix/zeros":"nFaR","./function/probability/combinations":"M4Fz","./function/probability/factorial":"cbU5","./function/probability/gamma":"mIdZ","./function/probability/kldivergence":"W9Q9","./function/probability/multinomial":"y9uR","./function/probability/permutations":"qGLJ","./function/probability/pickRandom":"iKEH","./function/probability/random":"pXBT","./function/probability/randomInt":"fj2Q","./function/relational/compare":"jKwP","./function/relational/compareNatural":"JLzY","./function/relational/compareText":"Bmmt","./function/relational/deepEqual":"bLpw","./function/relational/equal":"wgSR","./function/relational/equalText":"HVZA","./function/relational/larger":"TH74","./function/relational/largerEq":"hahd","./function/relational/smaller":"iBZ4","./function/relational/smallerEq":"Ob6s","./function/relational/unequal":"kwrJ","./function/set/setCartesian":"qllh","./function/set/setDifference":"jaWL","./function/set/setDistinct":"VDoP","./function/set/setIntersect":"kvfp","./function/set/setIsSubset":"XvM6","./function/set/setMultiplicity":"sMXh","./function/set/setPowerset":"rmtw","./function/set/setSize":"AYWb","./function/set/setSymDifference":"reLj","./function/set/setUnion":"Wqu5","./function/special/erf":"NbhS","./function/statistics/mad":"EtYx","./function/statistics/max":"L2AM","./function/statistics/mean":"qRED","./function/statistics/median":"nYR2","./function/statistics/min":"xrLZ","./function/statistics/mode":"yBPR","./function/statistics/prod":"NCYX","./function/statistics/quantileSeq":"Gbgi","./function/statistics/std":"uXlw","./function/statistics/sum":"qyn0","./function/statistics/var":"siyP","./function/trigonometry/acos":"HPVa","./function/trigonometry/acosh":"MvCO","./function/trigonometry/acot":"xXPM","./function/trigonometry/acoth":"KpnL","./function/trigonometry/acsc":"Gt5T","./function/trigonometry/acsch":"XLHb","./function/trigonometry/asec":"uxTA","./function/trigonometry/asech":"eRMa","./function/trigonometry/asin":"M9R8","./function/trigonometry/asinh":"qY7D","./function/trigonometry/atan":"s9IB","./function/trigonometry/atanh":"fjot","./function/trigonometry/atan2":"Z7HZ","./function/trigonometry/cos":"DWzk","./function/trigonometry/cosh":"maYo","./function/trigonometry/cot":"wCAM","./function/trigonometry/coth":"AM7w","./function/trigonometry/csc":"cTPc","./function/trigonometry/csch":"uHb4","./function/trigonometry/sec":"hpuP","./function/trigonometry/sech":"WKMm","./function/trigonometry/sin":"gPaM","./function/trigonometry/sinh":"G3av","./function/trigonometry/tan":"N6lO","./function/trigonometry/tanh":"teZk","./function/units/to":"ROe2","./function/utils/clone":"I9FW","./function/utils/format":"gPkx","./function/utils/isNaN":"VF4n","./function/utils/isInteger":"rt70","./function/utils/isNegative":"hspf","./function/utils/isNumeric":"Tqof","./function/utils/hasNumericValue":"RYV2","./function/utils/isPositive":"pq0g","./function/utils/isPrime":"mX5V","./function/utils/isZero":"MHMc","./function/utils/typeof":"v295"}],"tSao":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function e(e,t,i,n){var o=i(require("../parse"));return n("compile",{string:function(r){return o(r).compile()},"Array | Matrix":function(e){return r(e,function(r){return o(r).compile()})}})}exports.name="compile",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo","../parse":"EUvE"}],"kgrW":[function(require,module,exports) { "use strict";var r=require("../../utils/collection/deepMap");function e(e,t,n,i){var c=n(require("../parse"));return i("compile",{string:function(r){return c(r).compile().eval({})},"string, Object":function(r,e){return c(r).compile().eval(e)},"Array | Matrix":function(e){var t={};return r(e,function(r){return c(r).compile().eval(t)})},"Array | Matrix, Object":function(e,t){return r(e,function(r){return c(r).compile().eval(t)})}})}exports.name="eval",exports.factory=e; },{"../../utils/collection/deepMap":"lOYo","../parse":"EUvE"}],"eMLC":[function(require,module,exports) { "use strict";var r=require("../../utils/customs").getSafeProperty;function e(e,t,o,n,a){var i=o(require("../embeddedDocs"));return n("help",{any:function(t){var o,n=t;if("string"!=typeof t)for(o in a)if(a.hasOwnProperty(o)&&t===a[o]){n=o;break}var s=r(i,n);if(!s)throw new Error('No documentation found on "'+n+'"');return new e.Help(s)}})}exports.math=!0,exports.name="help",exports.factory=e; },{"../../utils/customs":"PAPk","../embeddedDocs":"u4GE"}],"SQe8":[function(require,module,exports) { "use strict";var e=require("../utils/object").extend,t=require("../utils/customs");function r(r,o,s,p,i){var n=s(require("./parse"));function c(){if(!(this instanceof c))throw new SyntaxError("Constructor must be called with the new operator");this.scope={}}return c.prototype.type="Parser",c.prototype.isParser=!0,c.prototype.parse=function(e){throw new Error("Parser.parse is deprecated. Use math.parse instead.")},c.prototype.compile=function(e){throw new Error("Parser.compile is deprecated. Use math.compile instead.")},c.prototype.eval=function(e){return n(e).compile().eval(this.scope)},c.prototype.get=function(e){return e in this.scope?t.getSafeProperty(this.scope,e):void 0},c.prototype.getAll=function(){return e({},this.scope)},c.prototype.set=function(e,r){return t.setSafeProperty(this.scope,e,r)},c.prototype.remove=function(e){delete this.scope[e]},c.prototype.clear=function(){for(var e in this.scope)this.scope.hasOwnProperty(e)&&delete this.scope[e]},c}exports.name="Parser",exports.path="expression",exports.factory=r,exports.math=!0; },{"../utils/object":"FcSp","../utils/customs":"PAPk","./parse":"EUvE"}],"mLT7":[function(require,module,exports) { "use strict";function r(r,e,t,n,s){var a=t(require("../Parser"));return n("parser",{"":function(){return new a(s)}})}exports.name="parser",exports.factory=r,exports.math=!0; },{"../Parser":"SQe8"}],"bSaC":[function(require,module,exports) { "use strict";module.exports=[require("./compile"),require("./eval"),require("./help"),require("./parse"),require("./parser")]; },{"./compile":"tSao","./eval":"kgrW","./help":"eMLC","./parse":"uJKc","./parser":"mLT7"}],"EsLR":[function(require,module,exports) { "use strict";function e(e,t,o,r){return function(){throw new Error("UpdateNode is deprecated. Use AssignmentNode instead.")}}exports.name="UpdateNode",exports.path="expression.node",exports.factory=e; },{}],"gbLV":[function(require,module,exports) { "use strict";module.exports=[require("./AccessorNode"),require("./ArrayNode"),require("./AssignmentNode"),require("./BlockNode"),require("./ConditionalNode"),require("./ConstantNode"),require("./IndexNode"),require("./FunctionAssignmentNode"),require("./FunctionNode"),require("./Node"),require("./ObjectNode"),require("./OperatorNode"),require("./ParenthesisNode"),require("./RangeNode"),require("./RelationalNode"),require("./SymbolNode"),require("./UpdateNode")]; },{"./AccessorNode":"vZNf","./ArrayNode":"onTs","./AssignmentNode":"yw4P","./BlockNode":"QBkn","./ConditionalNode":"uzAW","./ConstantNode":"MNuy","./IndexNode":"SN5L","./FunctionAssignmentNode":"PrPs","./FunctionNode":"ZLEq","./Node":"dnbo","./ObjectNode":"UI2T","./OperatorNode":"F3sc","./ParenthesisNode":"Mj7c","./RangeNode":"tJPg","./RelationalNode":"E94o","./SymbolNode":"RtSa","./UpdateNode":"EsLR"}],"fYWL":[function(require,module,exports) { "use strict";var r=require("./error.transform").transform;function t(t,a,e,n){var o=e(require("../../function/matrix/apply"));return n("apply",{"...any":function(a){var e=a[1];t.isNumber(e)?a[1]=e-1:t.isBigNumber(e)&&(a[1]=e.minus(1));try{return o.apply(null,a)}catch(n){throw r(n)}}})}exports.name="apply",exports.path="expression.transform",exports.factory=t; },{"./error.transform":"Bjol","../../function/matrix/apply":"f9k3"}],"hFxa":[function(require,module,exports) { "use strict";var r=require("./error.transform").transform;function t(t,n,e,o){var a=e(require("../../function/matrix/column"));return o("column",{"...any":function(n){var e=n.length-1,o=n[e];t.isNumber(o)&&(n[e]=o-1);try{return a.apply(null,n)}catch(u){throw r(u)}}})}exports.name="column",exports.path="expression.transform",exports.factory=t; },{"./error.transform":"Bjol","../../function/matrix/column":"g7VB"}],"fUNc":[function(require,module,exports) { "use strict";var r=require("./error.transform").transform;function t(t,n,e,a){var o=e(require("../../function/matrix/concat"));return a("concat",{"...any":function(n){var e=n.length-1,a=n[e];t.isNumber(a)?n[e]=a-1:t.isBigNumber(a)&&(n[e]=a.minus(1));try{return o.apply(null,n)}catch(c){throw r(c)}}})}exports.name="concat",exports.path="expression.transform",exports.factory=t; },{"./error.transform":"Bjol","../../function/matrix/concat":"LXdZ"}],"yzMS":[function(require,module,exports) { "use strict";function n(n,e,r,i){return function(e,r,i){var t=e.filter(function(e){return n.isSymbolNode(e)&&!(e.name in r)&&!(e.name in i)})[0];if(!t)throw new Error('No undefined variable found in inline expression "'+e+'"');var o=t.name,u=Object.create(i),a=e.compile();return function(n){return u[o]=n,a.eval(u)}}}exports.factory=n; },{}],"Ozx7":[function(require,module,exports) { "use strict";var r=require("../../utils/array").filter,t=require("../../utils/array").filterRegExp,e=require("../../utils/function").maxArgumentCount;function i(r,e,i,o){var u=i(require("./utils/compileInlineExpression")),a=i(require("../../type/matrix/function/matrix"));function s(t,e,i){var n,o;return t[0]&&(n=t[0].compile().eval(i)),t[1]&&(o=r.isSymbolNode(t[1])||r.isFunctionAssignmentNode(t[1])?t[1].compile().eval(i):u(t[1],e,i)),c(n,o)}s.rawArgs=!0;var c=o("filter",{"Array, function":n,"Matrix, function":function(r,t){return a(n(r.toArray(),t))},"Array, RegExp":t,"Matrix, RegExp":function(r,e){return a(t(r.toArray(),e))}});return c.toTex=void 0,s}function n(t,i){var n=e(i);return r(t,function(r,t,e){return 1===n?i(r):2===n?i(r,[t+1]):i(r,[t+1],e)})}exports.name="filter",exports.path="expression.transform",exports.factory=i; },{"../../utils/array":"j2lF","../../utils/function":"woyg","./utils/compileInlineExpression":"yzMS","../../type/matrix/function/matrix":"vzj5"}],"YwEg":[function(require,module,exports) { "use strict";var r=require("../../utils/function").maxArgumentCount,n=require("../../utils/array").forEach;function e(e,i,o,t){var a=o(require("./utils/compileInlineExpression"));function u(r,n,i){var o,t;return r[0]&&(o=r[0].compile().eval(i)),r[1]&&(t=e.isSymbolNode(r[1])||e.isFunctionAssignmentNode(r[1])?r[1].compile().eval(i):a(r[1],n,i)),s(o,t)}u.rawArgs=!0;var s=t("forEach",{"Array | Matrix, function":function(e,i){var o=r(i);!function r(t,a){Array.isArray(t)?n(t,function(n,e){r(n,a.concat(e+1))}):1===o?i(t):2===o?i(t,a):i(t,a,e)}(e.valueOf(),[])}});return u}exports.name="forEach",exports.path="expression.transform",exports.factory=e; },{"../../utils/function":"woyg","../../utils/array":"j2lF","./utils/compileInlineExpression":"yzMS"}],"XTGQ":[function(require,module,exports) { "use strict";function e(e,r,n){return function(){for(var r=[],n=0,t=arguments.length;n0?0:2;else if(i&&!0===i.isSet)i=i.map(function(e){return e-1});else if(e.isArray(i)||e.isMatrix(i))i=i.map(function(e){return e-1});else if(e.isNumber(i))i--;else if(e.isBigNumber(i))i=i.toNumber()-1;else if("string"!=typeof i)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");r[n]=i}var s=new e.Index;return e.Index.apply(s,r),s}}exports.name="index",exports.path="expression.transform",exports.factory=e; },{}],"nCs5":[function(require,module,exports) { "use strict";var r=require("../../utils/function").maxArgumentCount,n=require("../../utils/array").map;function t(r,n,t,i){var u=t(require("./utils/compileInlineExpression")),o=t(require("../../type/matrix/function/matrix"));function a(n,t,e){var i,o;return n[0]&&(i=n[0].compile().eval(e)),n[1]&&(o=r.isSymbolNode(n[1])||r.isFunctionAssignmentNode(n[1])?n[1].compile().eval(e):u(n[1],t,e)),c(i,o)}a.rawArgs=!0;var c=i("map",{"Array, function":function(r,n){return e(r,n,r)},"Matrix, function":function(r,n){return o(e(r.valueOf(),n,r))}});return a}function e(t,e,i){var u=r(e);return function r(t,o){return Array.isArray(t)?n(t,function(n,t){return r(n,o.concat(t+1))}):1===u?e(t):2===u?e(t,o):e(t,o,i)}(t,[])}exports.name="map",exports.path="expression.transform",exports.factory=t; },{"../../utils/function":"woyg","../../utils/array":"j2lF","./utils/compileInlineExpression":"yzMS","../../type/matrix/function/matrix":"vzj5"}],"NHP1":[function(require,module,exports) { "use strict";var r=require("./error.transform").transform,t=require("../../utils/collection/isCollection");function e(e,i,n,s){var o=n(require("../../function/statistics/max"));return s("max",{"...any":function(i){if(2===i.length&&t(i[0])){var n=i[1];e.isNumber(n)?i[1]=n-1:e.isBigNumber(n)&&(i[1]=n.minus(1))}try{return o.apply(null,i)}catch(s){throw r(s)}}})}exports.name="max",exports.path="expression.transform",exports.factory=e; },{"./error.transform":"Bjol","../../utils/collection/isCollection":"m4c0","../../function/statistics/max":"US8O"}],"nlKP":[function(require,module,exports) { "use strict";var r=require("./error.transform").transform,t=require("../../utils/collection/isCollection");function e(e,n,i,s){var o=i(require("../../function/statistics/mean"));return s("mean",{"...any":function(n){if(2===n.length&&t(n[0])){var i=n[1];e.isNumber(i)?n[1]=i-1:e.isBigNumber(i)&&(n[1]=i.minus(1))}try{return o.apply(null,n)}catch(s){throw r(s)}}})}exports.name="mean",exports.path="expression.transform",exports.factory=e; },{"./error.transform":"Bjol","../../utils/collection/isCollection":"m4c0","../../function/statistics/mean":"WyK1"}],"cpNx":[function(require,module,exports) { "use strict";var r=require("./error.transform").transform,t=require("../../utils/collection/isCollection");function i(i,n,e,s){var o=e(require("../../function/statistics/min"));return s("min",{"...any":function(n){if(2===n.length&&t(n[0])){var e=n[1];i.isNumber(e)?n[1]=e-1:i.isBigNumber(e)&&(n[1]=e.minus(1))}try{return o.apply(null,n)}catch(s){throw r(s)}}})}exports.name="min",exports.path="expression.transform",exports.factory=i; },{"./error.transform":"Bjol","../../utils/collection/isCollection":"m4c0","../../function/statistics/min":"VKqc"}],"NRUm":[function(require,module,exports) { "use strict";function r(r,n,e,t){var a=e(require("../../function/matrix/range"));return t("range",{"...any":function(r){return"boolean"!=typeof r[r.length-1]&&r.push(!0),a.apply(null,r)}})}exports.name="range",exports.path="expression.transform",exports.factory=r; },{"../../function/matrix/range":"lueR"}],"tHFG":[function(require,module,exports) { "use strict";var r=require("./error.transform").transform,t=require("../../utils/collection/isCollection");function e(e,s,i,n){var o=i(require("../../function/statistics/std"));return n("std",{"...any":function(s){if(s.length>=2&&t(s[0])){var i=s[1];e.isNumber(i)?s[1]=i-1:e.isBigNumber(i)&&(s[1]=i.minus(1))}try{return o.apply(null,s)}catch(n){throw r(n)}}})}exports.name="std",exports.path="expression.transform",exports.factory=e; },{"./error.transform":"Bjol","../../utils/collection/isCollection":"m4c0","../../function/statistics/std":"hFUZ"}],"fCpa":[function(require,module,exports) { "use strict";var r=require("./error.transform").transform;function t(t,e,n,o){var a=n(require("../../function/matrix/row"));return o("row",{"...any":function(e){var n=e.length-1,o=e[n];t.isNumber(o)&&(e[n]=o-1);try{return a.apply(null,e)}catch(s){throw r(s)}}})}exports.name="row",exports.path="expression.transform",exports.factory=t; },{"./error.transform":"Bjol","../../function/matrix/row":"eLyh"}],"XVBF":[function(require,module,exports) { "use strict";var r=require("./error.transform").transform;function t(t,e,s,n){var o=s(require("../../function/matrix/subset"));return n("subset",{"...any":function(t){try{return o.apply(null,t)}catch(e){throw r(e)}}})}exports.name="subset",exports.path="expression.transform",exports.factory=t; },{"./error.transform":"Bjol","../../function/matrix/subset":"ZWbZ"}],"vC3z":[function(require,module,exports) { "use strict";var r=require("./error.transform").transform,t=require("../../utils/collection/isCollection");function e(e,s,i,n){var o=i(require("../../function/statistics/sum"));return n("sum",{"...any":function(s){if(2===s.length&&t(s[0])){var i=s[1];e.isNumber(i)?s[1]=i-1:e.isBigNumber(i)&&(s[1]=i.minus(1))}try{return o.apply(null,s)}catch(n){throw r(n)}}})}exports.name="sum",exports.path="expression.transform",exports.factory=e; },{"./error.transform":"Bjol","../../utils/collection/isCollection":"m4c0","../../function/statistics/sum":"y9hQ"}],"d6Xr":[function(require,module,exports) { "use strict";var r=require("./error.transform").transform,t=require("../../utils/collection/isCollection");function e(e,i,n,s){var o=n(require("../../function/statistics/var"));return s("var",{"...any":function(i){if(i.length>=2&&t(i[0])){var n=i[1];e.isNumber(n)?i[1]=n-1:e.isBigNumber(n)&&(i[1]=n.minus(1))}try{return o.apply(null,i)}catch(s){throw r(s)}}})}exports.name="var",exports.path="expression.transform",exports.factory=e; },{"./error.transform":"Bjol","../../utils/collection/isCollection":"m4c0","../../function/statistics/var":"ujYK"}],"mXCx":[function(require,module,exports) { "use strict";module.exports=[require("./apply.transform"),require("./column.transform"),require("./concat.transform"),require("./filter.transform"),require("./forEach.transform"),require("./index.transform"),require("./map.transform"),require("./max.transform"),require("./mean.transform"),require("./min.transform"),require("./range.transform"),require("./std.transform"),require("./row.transform"),require("./subset.transform"),require("./sum.transform"),require("./var.transform")]; },{"./apply.transform":"fYWL","./column.transform":"hFxa","./concat.transform":"fUNc","./filter.transform":"Ozx7","./forEach.transform":"YwEg","./index.transform":"XTGQ","./map.transform":"nCs5","./max.transform":"NHP1","./mean.transform":"nlKP","./min.transform":"cpNx","./range.transform":"NRUm","./std.transform":"tHFG","./row.transform":"fCpa","./subset.transform":"XVBF","./sum.transform":"vC3z","./var.transform":"d6Xr"}],"SNFv":[function(require,module,exports) { "use strict";var t=require("../utils/object"),e=require("../utils/string");function r(r,n,o,i){var a=o(require("./function/parser"))();function s(t){if(!(this instanceof s))throw new SyntaxError("Constructor must be called with the new operator");if(!t)throw new Error('Argument "doc" missing');this.doc=t}return s.prototype.type="Help",s.prototype.isHelp=!0,s.prototype.toString=function(){var t=this.doc||{},n="\n";if(t.name&&(n+="Name: "+t.name+"\n\n"),t.category&&(n+="Category: "+t.category+"\n\n"),t.description&&(n+="Description:\n "+t.description+"\n\n"),t.syntax&&(n+="Syntax:\n "+t.syntax.join("\n ")+"\n\n"),t.examples){n+="Examples:\n";for(var o=0;o>>")}function g(r){var t=s.parseMath(G(r)),o=n._2(i.R.bind,t,function(r){var n=u(r);return void 0!==n?e({TAG:0,_0:n},Symbol.for("name"),"Ok"):e({TAG:1,_0:"MathJsParse Error"},Symbol.for("name"),"Error")});return n._2(i.R.bind,o,S)}var E=g;exports.MathJsonToMathJsAdt=m,exports.MathAdtToDistDst=p,exports.pointwiseToRightLogShift=G,exports.fromString2=g,exports.fromString=E; },{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/js_dict.js":"GWKE","rescript/lib/js/belt_Array.js":"yUxI","@glennsl/bs-json/src/Json_decode.bs.js":"kurU","../utility/E.bs.js":"xX5m","./Mathjs.bs.js":"SRZe"}],"AuT8":[function(require,module,exports) { var define; var n;!function(r,t){"object"==typeof exports?module.exports=t():"function"==typeof n&&n.amd?n(t):r.jStat=t()}(this,function(){var n=function(n,r){var t=Array.prototype.concat,e=Array.prototype.slice,o=Object.prototype.toString;function a(r,t){var e=r>t?r:t;return n.pow(10,17-~~(n.log(e>0?e:-e)*n.LOG10E))}var u=Array.isArray||function(n){return"[object Array]"===o.call(n)};function i(n){return"[object Function]"===o.call(n)}function f(n){return"number"==typeof n&&n-n==0}function c(){return new c._init(arguments)}function l(){return 0}function s(){return 1}function m(n,r){return n===r?1:0}c.fn=c.prototype,c._init=function(n){if(u(n[0]))if(u(n[0][0])){i(n[1])&&(n[0]=c.map(n[0],n[1]));for(var r=0;r=0;r--,e++)t[e]=[n[e][r]];return t},c.transpose=function(n){var r,t,e,o,a,i=[];for(u(n[0])||(n=[n]),t=n.length,e=n[0].length,a=0;a0&&(i[e][0]=n[e][0]),f=1;ft&&e>0)return[];if(e>0)for(o=n;ot;o+=e)a.push(o);return a},c.slice=function(){function n(n,t,e,o){var a,u=[],i=n.length;if(t===r&&e===r&&o===r)return c.copy(n);if(o=o||1,(t=(t=t||0)>=0?t:i+t)===(e=(e=e||n.length)>=0?e:i+e)||0===o)return[];if(te&&o>0)return[];if(o>0)for(a=t;ae;a+=o)u.push(n[a]);return u}return function(r,t){var e,o;return f((t=t||{}).row)?f(t.col)?r[t.row][t.col]:n(c.rowa(r,t.row),(e=t.col||{}).start,e.end,e.step):f(t.col)?n(c.cola(r,t.col),(o=t.row||{}).start,o.end,o.step):(o=t.row||{},e=t.col||{},n(r,o.start,o.end,o.step).map(function(r){return n(r,e.start,e.end,e.step)}))}}(),c.sliceAssign=function(t,e,o){var a,u;if(f(e.row)){if(f(e.col))return t[e.row][e.col]=o;e.col=e.col||{},e.col.start=e.col.start||0,e.col.end=e.col.end||t[0].length,e.col.step=e.col.step||1,a=c.arange(e.col.start,n.min(t.length,e.col.end),e.col.step);var i=e.row;return a.forEach(function(n,r){t[i][n]=o[r]}),t}if(f(e.col)){e.row=e.row||{},e.row.start=e.row.start||0,e.row.end=e.row.end||t.length,e.row.step=e.row.step||1,u=c.arange(e.row.start,n.min(t[0].length,e.row.end),e.row.step);var l=e.col;return u.forEach(function(n,r){t[n][l]=o[r]}),t}return o[0].length===r&&(o=[o]),e.row.start=e.row.start||0,e.row.end=e.row.end||t.length,e.row.step=e.row.step||1,e.col.start=e.col.start||0,e.col.end=e.col.end||t[0].length,e.col.step=e.col.step||1,u=c.arange(e.row.start,n.min(t.length,e.row.end),e.row.step),a=c.arange(e.col.start,n.min(t[0].length,e.col.end),e.col.step),u.forEach(function(n,r){a.forEach(function(e,a){t[n][e]=o[r][a]})}),t},c.diagonal=function(n){var r=c.zeros(n.length,n.length);return n.forEach(function(n,t){r[t][t]=n}),r},c.copy=function(n){return n.map(function(n){return f(n)?n:n.map(function(n){return n})})};var g=c.prototype;return g.length=0,g.push=Array.prototype.push,g.sort=Array.prototype.sort,g.splice=Array.prototype.splice,g.slice=Array.prototype.slice,g.toArray=function(){return this.length>1?e.call(this):e.call(this)[0]},g.map=function(n,r){return c(c.map(this,n,r))},g.cumreduce=function(n,r){return c(c.cumreduce(this,n,r))},g.alter=function(n){return c.alter(this,n),this},function(n){for(var r=0;r=0;)r+=n[t];return r},n.sumsqrd=function(n){for(var r=0,t=n.length;--t>=0;)r+=n[t]*n[t];return r},n.sumsqerr=function(r){for(var t,e=n.mean(r),o=0,a=r.length;--a>=0;)o+=(t=r[a]-e)*t;return o},n.sumrow=function(n){for(var r=0,t=n.length;--t>=0;)r+=n[t];return r},n.product=function(n){for(var r=1,t=n.length;--t>=0;)r*=n[t];return r},n.min=function(n){for(var r=n[0],t=0;++tr&&(r=n[t]);return r},n.unique=function(n){for(var r={},t=[],e=0;eu?(f=[o[r]],u=a,i=0):a===u&&(f.push(o[r]),i++),a=1);return 0===i?f[0]:f},n.range=function(r){return n.max(r)-n.min(r)},n.variance=function(r,t){return n.sumsqerr(r)/(r.length-(t?1:0))},n.pooledvariance=function(r){return r.reduce(function(r,t){return r+n.sumsqerr(t)},0)/(r.reduce(function(n,r){return n+r.length},0)-r.length)},n.deviation=function(r){for(var t=n.mean(r),e=r.length,o=new Array(e),a=0;a=0;a--)o.push(r.abs(t[a]-e));return n.mean(o)},n.meddev=function(t){for(var e=n.median(t),o=[],a=t.length-1;a>=0;a--)o.push(r.abs(t[a]-e));return n.median(o)},n.coeffvar=function(r){return n.stdev(r)/n.mean(r)},n.quartiles=function(n){var t=n.length,o=n.slice().sort(e);return[o[r.round(t/4)-1],o[r.round(t/2)-1],o[r.round(3*t/4)-1]]},n.quantiles=function(n,t,a,u){var i,f,c,l,s,m=n.slice().sort(e),g=[t.length],p=n.length;for(void 0===a&&(a=3/8),void 0===u&&(u=3/8),i=0;i1){for(f=!0===e?this:this.transpose();i1){for("sumrow"!==r&&(f=!0===e?this:this.transpose());i1){for(i=i.transpose();u=0;i--)u*=e,u+=c[i];if(a=u/t+.5*r.log(o)+(t-.5)*r.log(t)-t,n<=7)for(i=1;i<=f;i++)a-=r.log(t-1),t-=1;return a},n.gammafn=function(n){var t,e,o,a,u=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],i=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],f=!1,c=0,l=0,s=0,m=n;if(m<=0){if(!(a=m%1+3.6e-16))return 1/0;f=(1&m?-1:1)*r.PI/r.sin(r.PI*a),m=1-m}for(o=m,e=m<1?m++:(m-=c=(0|m)-1)-1,t=0;t<8;++t)s=(s+u[t])*e,l=l*e+i[t];if(a=s/l+1,om)for(t=0;t=1?t:1/t)+.4*t+17);if(e<0||t<=0)return NaN;if(e170||e>170?r.exp(n.combinationln(t,e)):n.factorial(t)/n.factorial(e)/n.factorial(t-e)},n.combinationln=function(r,t){return n.factorialln(r)-n.factorialln(t)-n.factorialln(r-t)},n.permutation=function(r,t){return n.factorial(r)/n.factorial(r-t)},n.betafn=function(t,e){if(!(t<=0||e<=0))return t+e>170?r.exp(n.betaln(t,e)):n.gammafn(t)*n.gammafn(e)/n.gammafn(t+e)},n.betaln=function(r,t){return n.gammaln(r)+n.gammaln(t)-n.gammaln(r+t)},n.betacf=function(n,t,e){var o,a,u,i,f=1,c=t+e,l=t+1,s=t-1,m=1,g=1-c*n/l;for(r.abs(g)<1e-30&&(g=1e-30),i=g=1/g;f<=100&&(g=1+(a=f*(e-f)*n/((s+(o=2*f))*(t+o)))*g,r.abs(g)<1e-30&&(g=1e-30),m=1+a/m,r.abs(m)<1e-30&&(m=1e-30),i*=(g=1/g)*m,g=1+(a=-(t+f)*(c+f)*n/((t+o)*(l+o)))*g,r.abs(g)<1e-30&&(g=1e-30),m=1+a/m,r.abs(m)<1e-30&&(m=1e-30),i*=u=(g=1/g)*m,!(r.abs(u-1)<3e-7));f++);return i},n.gammapinv=function(t,e){var o,a,u,i,f,c,l=0,s=e-1,m=n.gammaln(e);if(t>=1)return r.max(100,e+100*r.sqrt(e));if(t<=0)return 0;for(e>1?(f=r.log(s),c=r.exp(s*(f-1)-m),i=t<.5?t:1-t,o=(2.30753+.27061*(a=r.sqrt(-2*r.log(i))))/(1+a*(.99229+.04481*a))-a,t<.5&&(o=-o),o=r.max(.001,e*r.pow(1-1/(9*e)-o/(3*r.sqrt(e)),3))):o=t<(a=1-e*(.253+.12*e))?r.pow(t/a,1/e):1-r.log(1-(t-a)/(1-a));l<12;l++){if(o<=0)return 0;if((o-=a=(u=(n.lowRegGamma(e,o)-t)/(a=e>1?c*r.exp(-(o-s)+s*(r.log(o)-f)):r.exp(-o+s*r.log(o)-m)))/(1-.5*r.min(1,u*((e-1)/o-1))))<=0&&(o=.5*(o+a)),r.abs(a)<1e-8*o)break}return o},n.erf=function(n){var t,e,o,a,u=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-9.91364156e-10,-2.27365122e-10,9.6467911e-11,2.394038e-12,-6.886027e-12,8.94487e-13,3.13092e-13,-1.12708e-13,3.81e-16,7.106e-15,-1.523e-15,-9.4e-17,1.21e-16,-2.8e-17],i=u.length-1,f=!1,c=0,l=0;for(n<0&&(n=-n,f=!0),e=4*(t=2/(2+n))-2;i>0;i--)o=c,c=e*c-l+u[i],l=o;return a=t*r.exp(-n*n+.5*(u[0]+e*c)-l),f?a-1:1-a},n.erfc=function(r){return 1-n.erf(r)},n.erfcinv=function(t){var e,o,a,u,i=0;if(t>=2)return-100;if(t<=0)return 100;for(u=t<1?t:2-t,e=-.70711*((2.30753+.27061*(a=r.sqrt(-2*r.log(u/2))))/(1+a*(.99229+.04481*a))-a);i<2;i++)e+=(o=n.erfc(e)-u)/(1.1283791670955126*r.exp(-e*e)-e*o);return t<1?e:-e},n.ibetainv=function(t,e,o){var a,u,i,f,c,l,s,m,g,p,d=e-1,h=o-1,v=0;if(t<=0)return 0;if(t>=1)return 1;for(e>=1&&o>=1?(i=t<.5?t:1-t,l=(2.30753+.27061*(f=r.sqrt(-2*r.log(i))))/(1+f*(.99229+.04481*f))-f,t<.5&&(l=-l),s=(l*l-3)/6,m=2/(1/(2*e-1)+1/(2*o-1)),g=l*r.sqrt(s+m)/m-(1/(2*o-1)-1/(2*e-1))*(s+5/6-2/(3*m)),l=e/(e+o*r.exp(2*g))):(a=r.log(e/(e+o)),u=r.log(o/(e+o)),l=t<(f=r.exp(e*a)/e)/(g=f+(c=r.exp(o*u)/o))?r.pow(e*g*t,1/e):1-r.pow(o*g*(1-t),1/o)),p=-n.gammaln(e)-n.gammaln(o)+n.gammaln(e+o);v<10;v++){if(0===l||1===l)return l;if((l-=f=(c=(n.ibeta(l,e,o)-t)/(f=r.exp(d*r.log(l)+h*r.log(1-l)+p)))/(1-.5*r.min(1,c*(d/l-h/(1-l)))))<=0&&(l=.5*(l+f)),l>=1&&(l=.5*(l+f+1)),r.abs(f)<1e-8*l&&v>0)break}return l},n.ibeta=function(t,e,o){var a=0===t||1===t?0:r.exp(n.gammaln(e+o)-n.gammaln(e)-n.gammaln(o)+e*r.log(t)+o*r.log(1-t));return!(t<0||t>1)&&(t<(e+1)/(e+o+2)?a*n.betacf(t,e,o)/e:1-a*n.betacf(1-t,o,e)/o)},n.randn=function(t,e){var o,a,u,i,f;if(e||(e=t),t)return n.create(t,e,function(){return n.randn()});do{o=n._random_fn(),a=1.7156*(n._random_fn()-.5),f=(u=o-.449871)*u+(i=r.abs(a)+.386595)*(.196*i-.25472*u)}while(f>.27597&&(f>.27846||a*a>-4*r.log(o)*o*o));return a/o},n.randg=function(t,e,o){var a,u,i,f,c,l,s=t;if(o||(o=e),t||(t=1),e)return(l=n.zeros(e,o)).alter(function(){return n.randg(t)}),l;t<1&&(t+=1),a=t-1/3,u=1/r.sqrt(9*a);do{do{f=1+u*(c=n.randn())}while(f<=0);f*=f*f,i=n._random_fn()}while(i>1-.331*r.pow(c,4)&&r.log(i)>.5*c*c+a*(1-f+r.log(f)));if(t==s)return a*f;do{i=n._random_fn()}while(0===i);return r.pow(i,1/s)*a*f},function(r){for(var t=0;to;)s=f,i=c+(a=-(t+l)*(t+e+l)*n/(t+2*l)/(t+2*l+1))*i,f=(u=f+a*u)+(a=(l+=1)*(e-l)*n/(t+2*l-1)/(t+2*l))*f,u/=c=i+a*c,i/=c,f/=c,c=1;return f/t}function e(t,e,o){var a=[.9815606342467192,.9041172563704749,.7699026741943047,.5873179542866175,.3678314989981802,.1252334085114689],u=[.04717533638651183,.10693932599531843,.16007832854334622,.20316742672306592,.2334925365383548,.24914704581340277],i=.5*t;if(i>=8)return 1;var f,c=2*n.normal.cdf(i,0,1,1,0)-1;c=c>=r.exp(-50/o)?r.pow(c,o):0;for(var l=i,s=(8-i)/(f=t>3?2:3),m=l+s,g=0,p=o-1,d=1;d<=f;d++){for(var h=0,v=.5*(m+l),w=.5*(m-l),y=1;y<=12;y++){var b,x=v+w*(660)break;var _=.5*(2*n.normal.cdf(x,0,1,1,0))-.5*(2*n.normal.cdf(x,t,1,1,0));_>=r.exp(-30/p)&&(h+=_=u[b-1]*r.exp(-.5*q)*r.pow(_,p))}g+=h*=2*w*o/r.sqrt(2*r.PI),l=m,m+=s}return(c+=g)<=r.exp(-30/e)?0:(c=r.pow(c,e))>=1?1:c}!function(r){for(var t=0;t1||t<0?0:1==e&&1==o?1:e<512&&o<512?r.pow(t,e-1)*r.pow(1-t,o-1)/n.betafn(e,o):r.exp((e-1)*r.log(t)+(o-1)*r.log(1-t)-n.betaln(e,o))},cdf:function(r,t,e){return r>1||r<0?1*(r>1):n.ibeta(r,t,e)},inv:function(r,t,e){return n.ibetainv(r,t,e)},mean:function(n,r){return n/(n+r)},median:function(r,t){return n.ibetainv(.5,r,t)},mode:function(n,r){return(n-1)/(n+r-2)},sample:function(r,t){var e=n.randg(r);return e/(e+n.randg(t))},variance:function(n,t){return n*t/(r.pow(n+t,2)*(n+t+1))}}),n.extend(n.centralF,{pdf:function(t,e,o){var a;return t<0?0:e<=2?0===t&&e<2?1/0:0===t&&2===e?1:1/n.betafn(e/2,o/2)*r.pow(e/o,e/2)*r.pow(t,e/2-1)*r.pow(1+e/o*t,-(e+o)/2):(a=e*t/(o+t*e),e*(o/(o+t*e))/2*n.binomial.pdf((e-2)/2,(e+o-2)/2,a))},cdf:function(r,t,e){return r<0?0:n.ibeta(t*r/(t*r+e),t/2,e/2)},inv:function(r,t,e){return e/(t*(1/n.ibetainv(r,t/2,e/2)-1))},mean:function(n,r){return r>2?r/(r-2):void 0},mode:function(n,r){return n>2?r*(n-2)/(n*(r+2)):void 0},sample:function(r,t){return 2*n.randg(r/2)/r/(2*n.randg(t/2)/t)},variance:function(n,r){if(!(r<=4))return 2*r*r*(n+r-2)/(n*(r-2)*(r-2)*(r-4))}}),n.extend(n.cauchy,{pdf:function(n,t,e){return e<0?0:e/(r.pow(n-t,2)+r.pow(e,2))/r.PI},cdf:function(n,t,e){return r.atan((n-t)/e)/r.PI+.5},inv:function(n,t,e){return t+e*r.tan(r.PI*(n-.5))},median:function(n){return n},mode:function(n){return n},sample:function(t,e){return n.randn()*r.sqrt(1/(2*n.randg(.5)))*e+t}}),n.extend(n.chisquare,{pdf:function(t,e){return t<0?0:0===t&&2===e?.5:r.exp((e/2-1)*r.log(t)-t/2-e/2*r.log(2)-n.gammaln(e/2))},cdf:function(r,t){return r<0?0:n.lowRegGamma(t/2,r/2)},inv:function(r,t){return 2*n.gammapinv(r,.5*t)},mean:function(n){return n},median:function(n){return n*r.pow(1-2/(9*n),3)},mode:function(n){return n-2>0?n-2:0},sample:function(r){return 2*n.randg(r/2)},variance:function(n){return 2*n}}),n.extend(n.exponential,{pdf:function(n,t){return n<0?0:t*r.exp(-t*n)},cdf:function(n,t){return n<0?0:1-r.exp(-t*n)},inv:function(n,t){return-r.log(1-n)/t},mean:function(n){return 1/n},median:function(n){return 1/n*r.log(2)},mode:function(){return 0},sample:function(t){return-1/t*r.log(n._random_fn())},variance:function(n){return r.pow(n,-2)}}),n.extend(n.gamma,{pdf:function(t,e,o){return t<0?0:0===t&&1===e?1/o:r.exp((e-1)*r.log(t)-t/o-n.gammaln(e)-e*r.log(o))},cdf:function(r,t,e){return r<0?0:n.lowRegGamma(t,r/e)},inv:function(r,t,e){return n.gammapinv(r,t)*e},mean:function(n,r){return n*r},mode:function(n,r){if(n>1)return(n-1)*r},sample:function(r,t){return n.randg(r)*t},variance:function(n,r){return n*r*r}}),n.extend(n.invgamma,{pdf:function(t,e,o){return t<=0?0:r.exp(-(e+1)*r.log(t)-o/t-n.gammaln(e)+e*r.log(o))},cdf:function(r,t,e){return r<=0?0:1-n.lowRegGamma(t,e/r)},inv:function(r,t,e){return e/n.gammapinv(1-r,t)},mean:function(n,r){return n>1?r/(n-1):void 0},mode:function(n,r){return r/(n+1)},sample:function(r,t){return t/n.randg(r)},variance:function(n,r){if(!(n<=2))return r*r/((n-1)*(n-1)*(n-2))}}),n.extend(n.kumaraswamy,{pdf:function(n,t,e){return 0===n&&1===t?e:1===n&&1===e?t:r.exp(r.log(t)+r.log(e)+(t-1)*r.log(n)+(e-1)*r.log(1-r.pow(n,t)))},cdf:function(n,t,e){return n<0?0:n>1?1:1-r.pow(1-r.pow(n,t),e)},inv:function(n,t,e){return r.pow(1-r.pow(1-n,1/e),1/t)},mean:function(r,t){return t*n.gammafn(1+1/r)*n.gammafn(t)/n.gammafn(1+1/r+t)},median:function(n,t){return r.pow(1-r.pow(2,-1/t),1/n)},mode:function(n,t){if(n>=1&&t>=1&&1!==n&&1!==t)return r.pow((n-1)/(n*t-1),1/n)},variance:function(){throw new Error("variance not yet implemented")}}),n.extend(n.lognormal,{pdf:function(n,t,e){return n<=0?0:r.exp(-r.log(n)-.5*r.log(2*r.PI)-r.log(e)-r.pow(r.log(n)-t,2)/(2*e*e))},cdf:function(t,e,o){return t<0?0:.5+.5*n.erf((r.log(t)-e)/r.sqrt(2*o*o))},inv:function(t,e,o){return r.exp(-1.4142135623730951*o*n.erfcinv(2*t)+e)},mean:function(n,t){return r.exp(n+t*t/2)},median:function(n){return r.exp(n)},mode:function(n,t){return r.exp(n-t*t)},sample:function(t,e){return r.exp(n.randn()*e+t)},variance:function(n,t){return(r.exp(t*t)-1)*r.exp(2*n+t*t)}}),n.extend(n.noncentralt,{pdf:function(t,e,o){return r.abs(o)<1e-14?n.studentt.pdf(t,e):r.abs(t)<1e-14?r.exp(n.gammaln((e+1)/2)-o*o/2-.5*r.log(r.PI*e)-n.gammaln(e/2)):e/t*(n.noncentralt.cdf(t*r.sqrt(1+2/e),e+2,o)-n.noncentralt.cdf(t,e,o))},cdf:function(t,e,o){if(r.abs(o)<1e-14)return n.studentt.cdf(t,e);var a=!1;t<0&&(a=!0,o=-o);for(var u=n.normal.cdf(-o,0,1),i=1e-14+1,f=i,c=t*t/(t*t+e),l=0,s=r.exp(-o*o/2),m=r.exp(-o*o/2-.5*r.log(2)-n.gammaln(1.5))*o;l<200||f>1e-14||i>1e-14;)f=i,l>0&&(s*=o*o/(2*l),m*=o*o/(2*(l+.5))),u+=.5*(i=s*n.beta.cdf(c,l+.5,e/2)+m*n.beta.cdf(c,l+1,e/2)),l++;return a?1-u:u}}),n.extend(n.normal,{pdf:function(n,t,e){return r.exp(-.5*r.log(2*r.PI)-r.log(e)-r.pow(n-t,2)/(2*e*e))},cdf:function(t,e,o){return.5*(1+n.erf((t-e)/r.sqrt(2*o*o)))},inv:function(r,t,e){return-1.4142135623730951*e*n.erfcinv(2*r)+t},mean:function(n){return n},median:function(n){return n},mode:function(n){return n},sample:function(r,t){return n.randn()*t+r},variance:function(n,r){return r*r}}),n.extend(n.pareto,{pdf:function(n,t,e){return n1e100?1e100:e,1/(r.sqrt(e)*n.betafn(.5,e/2))*r.pow(1+t*t/e,-(e+1)/2)},cdf:function(t,e){var o=e/2;return n.ibeta((t+r.sqrt(t*t+e))/(2*r.sqrt(t*t+e)),o,o)},inv:function(t,e){var o=n.ibetainv(2*r.min(t,1-t),.5*e,.5);return o=r.sqrt(e*(1-o)/o),t>.5?o:-o},mean:function(n){return n>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(t){return n.randn()*r.sqrt(t/(2*n.randg(t/2)))},variance:function(n){return n>2?n/(n-2):n>1?1/0:void 0}}),n.extend(n.weibull,{pdf:function(n,t,e){return n<0||t<0||e<0?0:e/t*r.pow(n/t,e-1)*r.exp(-r.pow(n/t,e))},cdf:function(n,t,e){return n<0?0:1-r.exp(-r.pow(n/t,e))},inv:function(n,t,e){return t*r.pow(-r.log(1-n),1/e)},mean:function(r,t){return r*n.gammafn(1+1/t)},median:function(n,t){return n*r.pow(r.log(2),1/t)},mode:function(n,t){return t<=1?0:n*r.pow((t-1)/t,1/t)},sample:function(t,e){return t*r.pow(-r.log(n._random_fn()),1/e)},variance:function(t,e){return t*t*n.gammafn(1+2/e)-r.pow(n.weibull.mean(t,e),2)}}),n.extend(n.uniform,{pdf:function(n,r,t){return nt?0:1/(t-r)},cdf:function(n,r,t){return n=o)return 1;if(a<0||a>1||o<=0)return NaN;var i=a,f=(e=r.floor(e))+1,c=o-e,l=f+c,s=r.exp(n.gammaln(l)-n.gammaln(c)-n.gammaln(f)+f*r.log(i)+c*r.log(1-i));return u=i<(f+1)/(l+2)?s*t(i,f,c,1e-10):1-s*t(1-i,c,f,1e-10),r.round(1e10*(1-u))/1e10}}),n.extend(n.negbin,{pdf:function(t,e,o){return t===t>>>0&&(t<0?0:n.combination(t+e-1,e-1)*r.pow(1-o,t)*r.pow(o,e))},cdf:function(r,t,e){var o=0,a=0;if(r<0)return 0;for(;a<=r;a++)o+=n.negbin.pdf(a,t,e);return o}}),n.extend(n.hypgeom,{pdf:function(t,e,o,a){if(t!=t|0)return!1;if(t<0||ta||t>o)return 0;if(2*o>e)return 2*a>e?n.hypgeom.pdf(e-o-a+t,e,e-o,e-a):n.hypgeom.pdf(a-t,e,e-o,a);if(2*a>e)return n.hypgeom.pdf(o-t,e,o,e-a);if(o1&&i=a||t>=o)return 1;if(2*o>e)return 2*a>e?n.hypgeom.cdf(e-o-a+t,e,e-o,e-a):1-n.hypgeom.cdf(a-t-1,e,e-o,a);if(2*a>e)return 1-n.hypgeom.cdf(o-t-1,e,o,e-a);if(o1&&fa);return o-1},sampleLarge:function(t){var e,o,a,u,i,f,c,l,s,m,g=t;for(u=r.sqrt(g),i=r.log(g),f=.02483*(c=.931+2.53*u)-.059,l=1.1239+1.1328/(c-3.4),s=.9277-3.6224/(c-2);;){if(o=r.random()-.5,a=r.random(),m=.5-r.abs(o),e=r.floor((2*f/m+c)*o+g+.43),m>=.07&&a<=s)return e;if(!(e<0||m<.013&&a>m)&&r.log(a)+r.log(l)-r.log(f/(m*m)+c)<=e*i-g-n.loggam(e+1))return e}},sample:function(n){return n<10?this.sampleSmall(n):this.sampleLarge(n)}}),n.extend(n.triangular,{pdf:function(n,r,t,e){return t<=r||et?NaN:nt?0:ne?NaN:n<=t?0:n>=e?1:n<=o?r.pow(n-t,2)/((e-t)*(o-t)):1-r.pow(e-n,2)/((e-t)*(e-o))},inv:function(n,t,e,o){return e<=t||oe?NaN:n<=(o-t)/(e-t)?t+(e-t)*r.sqrt(n*((o-t)/(e-t))):t+(e-t)*(1-r.sqrt((1-n)*(1-(o-t)/(e-t))))},mean:function(n,r,t){return(n+r+t)/3},median:function(n,t,e){return e<=(n+t)/2?t-r.sqrt((t-n)*(t-e))/r.sqrt(2):e>(n+t)/2?n+r.sqrt((t-n)*(e-n))/r.sqrt(2):void 0},mode:function(n,r,t){return t},sample:function(t,e,o){var a=n._random_fn();return a<(o-t)/(e-t)?t+r.sqrt(a*(e-t)*(o-t)):e-r.sqrt((1-a)*(e-t)*(e-o))},variance:function(n,r,t){return(n*n+r*r+t*t-n*r-n*t-r*t)/18}}),n.extend(n.arcsine,{pdf:function(n,t,e){return e<=t?NaN:n<=t||n>=e?0:2/r.PI*r.pow(r.pow(e-t,2)-r.pow(2*n-t-e,2),-.5)},cdf:function(n,t,e){return n25e3)return e(t,1,u);var c,l=.5*a,s=l*r.log(a)-a*r.log(2)-n.gammaln(l),m=l-1,g=.25*a;c=a<=100?1:a<=800?.5:a<=5e3?.25:.125,s+=r.log(c);for(var p=0,d=1;d<=50;d++){for(var h=0,v=(2*d-1)*c,w=1;w<=16;w++){var y,b;if(8=-30)h+=e(8=1&&h<=1e-14)break;p+=h}if(h>1e-14)throw new Error("tukey.cdf failed to converge");return p>1&&(p=1),p},inv:function(t,e,o){if(o<2||e<2)return NaN;if(t<0||t>1)return NaN;if(0===t)return 0;if(1===t)return 1/0;var a,u=function(n,t,e){var o=.5-.5*n,a=r.sqrt(r.log(1/(o*o))),u=a+((((-453642210148e-16*a-.204231210125)*a-.342242088547)*a-1)*a+.322232421088)/((((.0038560700634*a+.10353775285)*a+.531103462366)*a+.588581570495)*a+.099348462606);e<120&&(u+=(u*u*u+u)/e/4);var i=.8832-.2368*u;return e<120&&(i+=-1.214/e+1.208*u/e),u*(i*r.log(t-1)+1.4142)}(t,e,o),i=n.tukey.cdf(u,e,o)-t;a=i>0?r.max(0,u-1):u+1;for(var f,c=n.tukey.cdf(a,e,o)-t,l=1;l<50;l++){if(f=a-c*(a-u)/(c-i),i=c,u=a,f<0&&(f=0,c=-t),c=n.tukey.cdf(f,e,o)-t,a=f,r.abs(a-u)<1e-4)return f}throw new Error("tukey.inv failed to converge")}})}(n,Math),function(n,r){var t=Array.prototype.push,e=n.utils.isArray;function o(r){return e(r)||r instanceof n}n.extend({add:function(r,t){return o(t)?(o(t[0])||(t=[t]),n.map(r,function(n,r,e){return n+t[r][e]})):n.map(r,function(n){return n+t})},subtract:function(r,t){return o(t)?(o(t[0])||(t=[t]),n.map(r,function(n,r,e){return n-t[r][e]||0})):n.map(r,function(n){return n-t})},divide:function(r,t){return o(t)?(o(t[0])||(t=[t]),n.multiply(r,n.inv(t))):n.map(r,function(n){return n/t})},multiply:function(r,t){var e,a,u,i,f,c,l,s;if(void 0===r.length&&void 0===t.length)return r*t;if(f=r.length,c=r[0].length,l=n.zeros(f,u=o(t)?t[0].length:c),s=0,o(t)){for(;s=0;f--){for(g=0,c=f+1;c<=l-1;c++)g+=p[c]*t[f][c];p[f]=(t[f][o-1]-g)/t[f][f]}return p},gauss_jordan:function(t,e){var o,a,u,i=n.aug(t,e),f=i.length,c=i[0].length,l=0;for(a=0;ar.abs(i[s][a])&&(s=u);var m=i[a];for(i[a]=i[s],i[s]=m,u=a+1;u=0;a--){for(l=i[a][a],u=0;ua-1;o--)i[u][o]-=i[a][o]*i[u][a]/l;for(i[a][a]/=l,o=f;os?(g[l][s]=t[l][s],p[l][s]=d[l][s]=0):la;)u=c,c=n.add(n.multiply(f,u),i),l++;return c},gauss_seidel:function(t,e,o,a){for(var u,i,f,c,l,s=0,m=t.length,g=[],p=[],d=[];su?(g[s][u]=t[s][u],p[s][u]=d[s][u]=0):sa;)i=l,l=n.add(n.multiply(c,i),f),s+=1;return l},SOR:function(t,e,o,a,u){for(var i,f,c,l,s,m=0,g=t.length,p=[],d=[],h=[];mi?(p[m][i]=t[m][i],d[m][i]=h[m][i]=0):ma;)f=s,s=n.add(n.multiply(l,f),c),m++;return s},householder:function(t){for(var e,o,a,u,i=t.length,f=t[0].length,c=0,l=[],s=[];c0?-1:1)*r.sqrt(e),o=r.sqrt((e*e-t[c+1][c]*e)/2),(l=n.zeros(i,1))[c+1][0]=(t[c+1][c]-e)/(2*o),a=c+2;a0?r.PI/4:-r.PI/4:r.atan(2*t[a][u]/(t[a][a]-t[u][u]))/2,(c=n.identity(s,s))[a][a]=r.cos(f),c[a][u]=-r.sin(f),c[u][a]=r.sin(f),c[u][u]=r.cos(f),m=n.multiply(m,c),t=n.multiply(n.multiply(n.inv(c),t),c),l=0,e=1;e.001&&(l=1)}for(e=0;e=s;)u=a(n,e+o),i=a(n,e),g[m]=(t[u]-2*t[i]+t[2*i-u])/(o*o),o/=2,m++;for(c=g.length,f=1;1!=c;){for(l=0;le);o++);return t[o-=1]+(e-r[o])*m[o]+n.sq(e-r[o])*a[o]+(e-r[o])*n.sq(e-r[o])*g[o]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(r){var t,e,o,a,u,i=r.length,f=r[0].length,c=0,l=[],s=[],m=[],g=[],p=[],d=[],h=[];for(c=0;c1||e>1||n<=0||e<=0)throw new Error("Proportions should be greater than 0 and less than 1");var a=(n*t+e*o)/(t+o);return(n-e)/r.sqrt(a*(1-a)*(1/t+1/o))}n.extend({zscore:function(){var r=t.call(arguments);return e(r[1])?(r[0]-r[1])/r[2]:(r[0]-n.mean(r[1]))/n.stdev(r[1],r[2])},ztest:function(){var e,a=t.call(arguments);return o(a[1])?(e=n.zscore(a[0],a[1],a[3]),1===a[2]?n.normal.cdf(-r.abs(e),0,1):2*n.normal.cdf(-r.abs(e),0,1)):a.length>2?(e=n.zscore(a[0],a[1],a[2]),1===a[3]?n.normal.cdf(-r.abs(e),0,1):2*n.normal.cdf(-r.abs(e),0,1)):(e=a[0],1===a[1]?n.normal.cdf(-r.abs(e),0,1):2*n.normal.cdf(-r.abs(e),0,1))}}),n.extend(n.fn,{zscore:function(n,r){return(n-this.mean())/this.stdev(r)},ztest:function(t,e,o){var a=r.abs(this.zscore(t,o));return 1===e?n.normal.cdf(-a,0,1):2*n.normal.cdf(-a,0,1)}}),n.extend({tscore:function(){var e=t.call(arguments);return 4===e.length?(e[0]-e[1])/(e[2]/r.sqrt(e[3])):(e[0]-n.mean(e[1]))/(n.stdev(e[1],!0)/r.sqrt(e[1].length))},ttest:function(){var o,a=t.call(arguments);return 5===a.length?(o=r.abs(n.tscore(a[0],a[1],a[2],a[3])),1===a[4]?n.studentt.cdf(-o,a[3]-1):2*n.studentt.cdf(-o,a[3]-1)):e(a[1])?(o=r.abs(a[0]),1==a[2]?n.studentt.cdf(-o,a[1]-1):2*n.studentt.cdf(-o,a[1]-1)):(o=r.abs(n.tscore(a[0],a[1])),1==a[2]?n.studentt.cdf(-o,a[1].length-1):2*n.studentt.cdf(-o,a[1].length-1))}}),n.extend(n.fn,{tscore:function(n){return(n-this.mean())/(this.stdev(!0)/r.sqrt(this.cols()))},ttest:function(t,e){return 1===e?1-n.studentt.cdf(r.abs(this.tscore(t)),this.cols()-1):2*n.studentt.cdf(-r.abs(this.tscore(t)),this.cols()-1)}}),n.extend({anovafscore:function(){var e,o,a,u,i,f,c,l,s=t.call(arguments);if(1===s.length){for(i=new Array(s[0].length),c=0;c.5?1-e:e)}),l=n.studentt.inv(.975,t.df_resid),s=t.coef.map(function(n,r){var t=l*i[r];return[n-t,n+t]});return{se:i,t:f,p:c,sigmaHat:u,interval95:s}}return{ols:function(e,o){var a=r(e,o),u=t(a),i=function(r){var t,e,o,a=r.R2/r.df_model/((1-r.R2)/r.df_resid);return{F_statistic:a,pvalue:1-(t=a,e=r.df_model,o=r.df_resid,n.beta.cdf(t/(o/e+t),e/2,o/2))}}(a),f=1-(1-a.R2)*((a.nobs-1)/a.df_resid);return a.t=u,a.f=i,a.adjust_R2=f,a}}}(),n.extend({buildxmatrix:function(){for(var r=new Array(arguments.length),t=0;t1){for(u=[],e=0;e=r?1:0}function _n(n,r){return n=d.length)){var t=Math.max(e-h,0),n=e,u=Math.min(e+h,d.length-1),a=t-(e-h),o=e+h-u,f=M[-h-1+a]||0,m=M[-h-1+o]||0,s=g/(g-f-m);a>0&&(y+=s*(a-1)*v);var c=Math.max(0,e-h+1);r.inside(0,d.length-1,c)&&(d[c].y+=1*s*v),r.inside(0,d.length-1,n+1)&&(d[n+1].y-=2*s*v),r.inside(0,d.length-1,u+1)&&(d[u+1].y+=1*s*v)}});var p=y,b=0,w=0;return d.forEach(function(i){b+=i.y,p+=b,i.y=p,w+=p}),w>0&&d.forEach(function(i){i.y/=w}),d},module.exports.getExpectedValueFromPdf=function(i){if(i&&0!==i.length){var e=0;return i.forEach(function(i){e+=i.x*i.y}),e}},module.exports.getXWithLeftTailArea=function(i,e){if(i&&0!==i.length){for(var t=0,n=0,r=0;r=e));r++);return i[n].x}},module.exports.getPerplexity=function(i){if(i&&0!==i.length){var e=0;return i.forEach(function(i){var t=Math.log(i.y);isFinite(t)&&(e+=i.y*t)}),e=-e/t,Math.pow(2,e)}}; },{"./helper":"wUHb"}],"XPlA":[function(require,module,exports) { "use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){var n,o,a=h(r),u=a[0],i=a[1],f=new e(c(r,u,i)),A=0,d=i>0?u-4:u;for(o=0;o>16&255,f[A++]=n>>8&255,f[A++]=255&n;return 2===i&&(n=t[r.charCodeAt(o)]<<2|t[r.charCodeAt(o+1)]>>4,f[A++]=255&n),1===i&&(n=t[r.charCodeAt(o)]<<10|t[r.charCodeAt(o+1)]<<4|t[r.charCodeAt(o+2)]>>2,f[A++]=n>>8&255,f[A++]=255&n),f}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,o=[],a=t;au?u:h+16383));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63; },{}],"EEnl":[function(require,module,exports) { exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l}; },{}],"ZCp3":[function(require,module,exports) { var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}; },{}],"VjIL":[function(require,module,exports) { var global = arguments[3]; var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.isBuffer(r))return 0===r.length?-1:_(t,r,e,n,i);if("number"==typeof r)return r&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;of&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;li&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return O(n)}exports.Buffer=f,exports.SlowBuffer=d,exports.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,r,e){return s(null,t,r,e)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,r,e){return a(null,t,r,e)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,r){if(!f.isBuffer(t)||!f.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},f.prototype.compare=function(t,r,e,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),s=Math.min(o,u),h=this.slice(n,i),a=t.slice(r,e),c=0;ci)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return m(this,t,r,e);case"ascii":return P(this,t,r,e);case"latin1":case"binary":return T(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function O(t){var r=t.length;if(r<=I)return String.fromCharCode.apply(String,t);for(var e="",n=0;nn)&&(e=n);for(var i="",o=r;oe)throw new RangeError("Trying to access beyond buffer length")}function k(t,r,e,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||rt.length)throw new RangeError("Index out of range")}function N(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i>>8*(n?i:1-i)}function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i>>8*(n?i:3-i)&255}function F(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,n,i,o){return o||F(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function q(t,r,n,i,o){return o||F(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}f.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r0&&(i*=256);)n+=this[t+--r]*i;return n},f.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*r)),n},f.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},f.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o=0&&(o*=256);)this[r+i]=t/o&255;return r+e},f.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},f.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):z(this,t,r,!0),r+4},f.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o>0)-f&255;return r+e},f.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},f.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):z(this,t,r,!0),r+4},f.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},f.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},f.prototype.writeDoubleLE=function(t,r,e){return q(this,t,r,!0,e)},f.prototype.writeDoubleBE=function(t,r,e){return q(this,t,r,!1,e)},f.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r=0;--i)t[i+r]=this[i+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function G(t){for(var r=[],e=0;e>8,i=e%256,o.push(i),o.push(n);return o}function K(t){return r.toByteArray(X(t))}function Q(t,r,e,n){for(var i=0;i=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function W(t){return t!=t} },{"base64-js":"XPlA","ieee754":"EEnl","isarray":"ZCp3","buffer":"VjIL"}],"hKJs":[function(require,module,exports) { var global = arguments[3]; var Buffer = require("buffer").Buffer; var define; var n,t=arguments[3],r=require("buffer").Buffer;(function(){var r,e=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",o="__lodash_hash_undefined__",f=500,a="__lodash_placeholder__",c=1,l=2,s=4,h=1,p=2,v=1,_=2,g=4,y=8,d=16,b=32,w=64,m=128,x=256,j=512,A=30,k="...",O=800,I=16,R=1,E=2,z=1/0,S=9007199254740991,L=1.7976931348623157e308,W=NaN,C=4294967295,B=C-1,U=C>>>1,T=[["ary",m],["bind",v],["bindKey",_],["curry",y],["curryRight",d],["flip",j],["partial",b],["partialRight",w],["rearg",x]],$="[object Arguments]",D="[object Array]",M="[object AsyncFunction]",F="[object Boolean]",N="[object Date]",P="[object DOMException]",q="[object Error]",Z="[object Function]",K="[object GeneratorFunction]",V="[object Map]",G="[object Number]",H="[object Null]",J="[object Object]",Y="[object Proxy]",Q="[object RegExp]",X="[object Set]",nn="[object String]",tn="[object Symbol]",rn="[object Undefined]",en="[object WeakMap]",un="[object WeakSet]",on="[object ArrayBuffer]",fn="[object DataView]",an="[object Float32Array]",cn="[object Float64Array]",ln="[object Int8Array]",sn="[object Int16Array]",hn="[object Int32Array]",pn="[object Uint8Array]",vn="[object Uint8ClampedArray]",_n="[object Uint16Array]",gn="[object Uint32Array]",yn=/\b__p \+= '';/g,dn=/\b(__p \+=) '' \+/g,bn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wn=/&(?:amp|lt|gt|quot|#39);/g,mn=/[&<>"']/g,xn=RegExp(wn.source),jn=RegExp(mn.source),An=/<%-([\s\S]+?)%>/g,kn=/<%([\s\S]+?)%>/g,On=/<%=([\s\S]+?)%>/g,In=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Rn=/^\w*$/,En=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zn=/[\\^$.*+?()[\]{}|]/g,Sn=RegExp(zn.source),Ln=/^\s+|\s+$/g,Wn=/^\s+/,Cn=/\s+$/,Bn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Un=/\{\n\/\* \[wrapped with (.+)\] \*/,Tn=/,? & /,$n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dn=/\\(\\)?/g,Mn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Fn=/\w*$/,Nn=/^[-+]0x[0-9a-f]+$/i,Pn=/^0b[01]+$/i,qn=/^\[object .+?Constructor\]$/,Zn=/^0o[0-7]+$/i,Kn=/^(?:0|[1-9]\d*)$/,Vn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Gn=/($^)/,Hn=/['\n\r\u2028\u2029\\]/g,Jn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Yn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Qn="[\\ud800-\\udfff]",Xn="["+Yn+"]",nt="["+Jn+"]",tt="\\d+",rt="[\\u2700-\\u27bf]",et="[a-z\\xdf-\\xf6\\xf8-\\xff]",ut="[^\\ud800-\\udfff"+Yn+tt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",it="\\ud83c[\\udffb-\\udfff]",ot="[^\\ud800-\\udfff]",ft="(?:\\ud83c[\\udde6-\\uddff]){2}",at="[\\ud800-\\udbff][\\udc00-\\udfff]",ct="[A-Z\\xc0-\\xd6\\xd8-\\xde]",lt="(?:"+et+"|"+ut+")",st="(?:"+ct+"|"+ut+")",ht="(?:"+nt+"|"+it+")"+"?",pt="[\\ufe0e\\ufe0f]?"+ht+("(?:\\u200d(?:"+[ot,ft,at].join("|")+")[\\ufe0e\\ufe0f]?"+ht+")*"),vt="(?:"+[rt,ft,at].join("|")+")"+pt,_t="(?:"+[ot+nt+"?",nt,ft,at,Qn].join("|")+")",gt=RegExp("['’]","g"),yt=RegExp(nt,"g"),dt=RegExp(it+"(?="+it+")|"+_t+pt,"g"),bt=RegExp([ct+"?"+et+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[Xn,ct,"$"].join("|")+")",st+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[Xn,ct+lt,"$"].join("|")+")",ct+"?"+lt+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ct+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",tt,vt].join("|"),"g"),wt=RegExp("[\\u200d\\ud800-\\udfff"+Jn+"\\ufe0e\\ufe0f]"),mt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],jt=-1,At={};At[an]=At[cn]=At[ln]=At[sn]=At[hn]=At[pn]=At[vn]=At[_n]=At[gn]=!0,At[$]=At[D]=At[on]=At[F]=At[fn]=At[N]=At[q]=At[Z]=At[V]=At[G]=At[J]=At[Q]=At[X]=At[nn]=At[en]=!1;var kt={};kt[$]=kt[D]=kt[on]=kt[fn]=kt[F]=kt[N]=kt[an]=kt[cn]=kt[ln]=kt[sn]=kt[hn]=kt[V]=kt[G]=kt[J]=kt[Q]=kt[X]=kt[nn]=kt[tn]=kt[pn]=kt[vn]=kt[_n]=kt[gn]=!0,kt[q]=kt[Z]=kt[en]=!1;var Ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},It=parseFloat,Rt=parseInt,Et="object"==typeof t&&t&&t.Object===Object&&t,zt="object"==typeof self&&self&&self.Object===Object&&self,St=Et||zt||Function("return this")(),Lt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Wt=Lt&&"object"==typeof module&&module&&!module.nodeType&&module,Ct=Wt&&Wt.exports===Lt,Bt=Ct&&Et.process,Ut=function(){try{var n=Wt&&Wt.require&&Wt.require("util").types;return n||Bt&&Bt.binding&&Bt.binding("util")}catch(t){}}(),Tt=Ut&&Ut.isArrayBuffer,$t=Ut&&Ut.isDate,Dt=Ut&&Ut.isMap,Mt=Ut&&Ut.isRegExp,Ft=Ut&&Ut.isSet,Nt=Ut&&Ut.isTypedArray;function Pt(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function qt(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u-1}function Jt(n,t,r){for(var e=-1,u=null==n?0:n.length;++e-1;);return r}function dr(n,t){for(var r=n.length;r--&&ir(t,n[r],0)>-1;);return r}var br=lr({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),wr=lr({"&":"&","<":"<",">":">",'"':""","'":"'"});function mr(n){return"\\"+Ot[n]}function xr(n){return wt.test(n)}function jr(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function Ar(n,t){return function(r){return n(t(r))}}function kr(n,t){for(var r=-1,e=n.length,u=0,i=[];++r",""":'"',"'":"'"});var Sr=function n(t){var Jn,Yn=(t=null==t?St:Sr.defaults(St.Object(),t,Sr.pick(St,xt))).Array,Qn=t.Date,Xn=t.Error,nt=t.Function,tt=t.Math,rt=t.Object,et=t.RegExp,ut=t.String,it=t.TypeError,ot=Yn.prototype,ft=nt.prototype,at=rt.prototype,ct=t["__core-js_shared__"],lt=ft.toString,st=at.hasOwnProperty,ht=0,pt=(Jn=/[^.]+$/.exec(ct&&ct.keys&&ct.keys.IE_PROTO||""))?"Symbol(src)_1."+Jn:"",vt=at.toString,_t=lt.call(rt),dt=St._,wt=et("^"+lt.call(st).replace(zn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ot=Ct?t.Buffer:r,Et=t.Symbol,zt=t.Uint8Array,Lt=Ot?Ot.allocUnsafe:r,Wt=Ar(rt.getPrototypeOf,rt),Bt=rt.create,Ut=at.propertyIsEnumerable,rr=ot.splice,lr=Et?Et.isConcatSpreadable:r,Lr=Et?Et.iterator:r,Wr=Et?Et.toStringTag:r,Cr=function(){try{var n=$i(rt,"defineProperty");return n({},"",{}),n}catch(t){}}(),Br=t.clearTimeout!==St.clearTimeout&&t.clearTimeout,Ur=Qn&&Qn.now!==St.Date.now&&Qn.now,Tr=t.setTimeout!==St.setTimeout&&t.setTimeout,$r=tt.ceil,Dr=tt.floor,Mr=rt.getOwnPropertySymbols,Fr=Ot?Ot.isBuffer:r,Nr=t.isFinite,Pr=ot.join,qr=Ar(rt.keys,rt),Zr=tt.max,Kr=tt.min,Vr=Qn.now,Gr=t.parseInt,Hr=tt.random,Jr=ot.reverse,Yr=$i(t,"DataView"),Qr=$i(t,"Map"),Xr=$i(t,"Promise"),ne=$i(t,"Set"),te=$i(t,"WeakMap"),re=$i(rt,"create"),ee=te&&new te,ue={},ie=lo(Yr),oe=lo(Qr),fe=lo(Xr),ae=lo(ne),ce=lo(te),le=Et?Et.prototype:r,se=le?le.valueOf:r,he=le?le.toString:r;function pe(n){if(Ef(n)&&!df(n)&&!(n instanceof ye)){if(n instanceof ge)return n;if(st.call(n,"__wrapped__"))return so(n)}return new ge(n)}var ve=function(){function n(){}return function(t){if(!Rf(t))return{};if(Bt)return Bt(t);n.prototype=t;var e=new n;return n.prototype=r,e}}();function _e(){}function ge(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function ye(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=C,this.__views__=[]}function de(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function Be(n,t,e,u,i,o){var f,a=t&c,h=t&l,p=t&s;if(e&&(f=i?e(n,u,i,o):e(n)),f!==r)return f;if(!Rf(n))return n;var v=df(n);if(v){if(f=function(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&st.call(n,"index")&&(r.index=n.index,r.input=n.input),r}(n),!a)return ri(n,f)}else{var _=Fi(n),g=_==Z||_==K;if(xf(n))return Ju(n,a);if(_==J||_==$||g&&!i){if(f=h||g?{}:Pi(n),!a)return h?function(n,t){return ei(n,Mi(n),t)}(n,function(n,t){return n&&ei(t,oa(t),n)}(f,n)):function(n,t){return ei(n,Di(n),t)}(n,Se(f,n))}else{if(!kt[_])return i?n:{};f=function(n,t,r){var e,u,i,o=n.constructor;switch(t){case on:return Yu(n);case F:case N:return new o(+n);case fn:return function(n,t){var r=t?Yu(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}(n,r);case an:case cn:case ln:case sn:case hn:case pn:case vn:case _n:case gn:return Qu(n,r);case V:return new o;case G:case nn:return new o(n);case Q:return(i=new(u=n).constructor(u.source,Fn.exec(u))).lastIndex=u.lastIndex,i;case X:return new o;case tn:return e=n,se?rt(se.call(e)):{}}}(n,_,a)}}o||(o=new xe);var y=o.get(n);if(y)return y;o.set(n,f),Cf(n)?n.forEach(function(r){f.add(Be(r,t,e,r,n,o))}):zf(n)&&n.forEach(function(r,u){f.set(u,Be(r,t,e,u,n,o))});var d=v?r:(p?h?Si:zi:h?oa:ia)(n);return Zt(d||n,function(r,u){d&&(r=n[u=r]),Re(f,u,Be(r,t,e,u,n,o))}),f}function Ue(n,t,e){var u=e.length;if(null==n)return!u;for(n=rt(n);u--;){var i=e[u],o=t[i],f=n[i];if(f===r&&!(i in n)||!o(f))return!1}return!0}function Te(n,t,e){if("function"!=typeof n)throw new it(i);return eo(function(){n.apply(r,e)},t)}function $e(n,t,r,u){var i=-1,o=Ht,f=!0,a=n.length,c=[],l=t.length;if(!a)return c;r&&(t=Yt(t,vr(r))),u?(o=Jt,f=!1):t.length>=e&&(o=gr,f=!1,t=new me(t));n:for(;++i-1},be.prototype.set=function(n,t){var r=this.__data__,e=Ee(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this},we.prototype.clear=function(){this.size=0,this.__data__={hash:new de,map:new(Qr||be),string:new de}},we.prototype.delete=function(n){var t=Ui(this,n).delete(n);return this.size-=t?1:0,t},we.prototype.get=function(n){return Ui(this,n).get(n)},we.prototype.has=function(n){return Ui(this,n).has(n)},we.prototype.set=function(n,t){var r=Ui(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},me.prototype.add=me.prototype.push=function(n){return this.__data__.set(n,o),this},me.prototype.has=function(n){return this.__data__.has(n)},xe.prototype.clear=function(){this.__data__=new be,this.size=0},xe.prototype.delete=function(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r},xe.prototype.get=function(n){return this.__data__.get(n)},xe.prototype.has=function(n){return this.__data__.has(n)},xe.prototype.set=function(n,t){var r=this.__data__;if(r instanceof be){var u=r.__data__;if(!Qr||u.length0&&r(f)?t>1?qe(f,t-1,r,e,u):Qt(u,f):e||(u[u.length]=f)}return u}var Ze=fi(),Ke=fi(!0);function Ve(n,t){return n&&Ze(n,t,ia)}function Ge(n,t){return n&&Ke(n,t,ia)}function He(n,t){return Gt(t,function(t){return kf(n[t])})}function Je(n,t){for(var e=0,u=(t=Ku(t,n)).length;null!=n&&et}function nu(n,t){return null!=n&&st.call(n,t)}function tu(n,t){return null!=n&&t in rt(n)}function ru(n,t,e){for(var u=e?Jt:Ht,i=n[0].length,o=n.length,f=o,a=Yn(o),c=1/0,l=[];f--;){var s=n[f];f&&t&&(s=Yt(s,vr(t))),c=Kr(s.length,c),a[f]=!e&&(t||i>=120&&s.length>=120)?new me(f&&s):r}s=n[0];var h=-1,p=a[0];n:for(;++h=f)return a;var c=r[e];return a*("desc"==c?-1:1)}}return n.index-t.index}(n,t,r)})}function du(n,t,r){for(var e=-1,u=t.length,i={};++e-1;)f!==n&&rr.call(f,a,1),rr.call(n,a,1);return n}function wu(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;Zi(u)?rr.call(n,u,1):$u(n,u)}}return n}function mu(n,t){return n+Dr(Hr()*(t-n+1))}function xu(n,t){var r="";if(!n||t<1||t>S)return r;do{t%2&&(r+=n),(t=Dr(t/2))&&(n+=n)}while(t);return r}function ju(n,t){return uo(Xi(n,t,Sa),n+"")}function Au(n){return Ae(va(n))}function ku(n,t){var r=va(n);return fo(r,Ce(t,0,r.length))}function Ou(n,t,e,u){if(!Rf(n))return n;for(var i=-1,o=(t=Ku(t,n)).length,f=o-1,a=n;null!=a&&++iu?0:u+t),(r=r>u?u:r)<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=Yn(u);++e>>1,o=n[i];null!==o&&!Uf(o)&&(r?o<=t:o=e){var l=t?null:xi(n);if(l)return Or(l);f=!1,i=gr,c=new me}else c=t?[]:a;n:for(;++u=u?n:zu(n,t,e)}var Hu=Br||function(n){return St.clearTimeout(n)};function Ju(n,t){if(t)return n.slice();var r=n.length,e=Lt?Lt(r):new n.constructor(r);return n.copy(e),e}function Yu(n){var t=new n.constructor(n.byteLength);return new zt(t).set(new zt(n)),t}function Qu(n,t){var r=t?Yu(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function Xu(n,t){if(n!==t){var e=n!==r,u=null===n,i=n==n,o=Uf(n),f=t!==r,a=null===t,c=t==t,l=Uf(t);if(!a&&!l&&!o&&n>t||o&&f&&c&&!a&&!l||u&&f&&c||!e&&c||!i)return 1;if(!u&&!o&&!l&&n1?e[i-1]:r,f=i>2?e[2]:r;for(o=n.length>3&&"function"==typeof o?(i--,o):r,f&&Ki(e[0],e[1],f)&&(o=i<3?r:o,i=1),t=rt(t);++u-1?i[o?t[f]:f]:r}}function hi(n){return Ei(function(t){var e=t.length,u=e,o=ge.prototype.thru;for(n&&t.reverse();u--;){var f=t[u];if("function"!=typeof f)throw new it(i);if(o&&!a&&"wrapper"==Wi(f))var a=new ge([],!0)}for(u=a?u:e;++u1&&y.reverse(),s&&c<_&&(y.length=c),this&&this!==St&&this instanceof v&&(k=w||li(k)),k.apply(A,y)}}function vi(n,t){return function(r,e){return function(n,t,r,e){return Ve(n,function(n,u,i){t(e,r(n),u,i)}),e}(r,n,t(e),{})}}function _i(n,t){return function(e,u){var i;if(e===r&&u===r)return t;if(e!==r&&(i=e),u!==r){if(i===r)return u;"string"==typeof e||"string"==typeof u?(e=Uu(e),u=Uu(u)):(e=Bu(e),u=Bu(u)),i=n(e,u)}return i}}function gi(n){return Ei(function(t){return t=Yt(t,vr(Bi())),ju(function(r){var e=this;return n(t,function(n){return Pt(n,e,r)})})})}function yi(n,t){var e=(t=t===r?" ":Uu(t)).length;if(e<2)return e?xu(t,n):t;var u=xu(t,$r(n/Rr(t)));return xr(t)?Gu(Er(u),0,n).join(""):u.slice(0,n)}function di(n){return function(t,e,u){return u&&"number"!=typeof u&&Ki(t,e,u)&&(e=u=r),t=Ff(t),e===r?(e=t,t=0):e=Ff(e),function(n,t,r,e){for(var u=-1,i=Zr($r((t-n)/(r||1)),0),o=Yn(i);i--;)o[e?i:++u]=n,n+=r;return o}(t,e,u=u===r?ta))return!1;var l=o.get(n);if(l&&o.get(t))return l==t;var s=-1,v=!0,_=e&p?new me:r;for(o.set(n,t),o.set(t,n);++s-1&&n%1==0&&n1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(Bn,"{\n/* [wrapped with "+t+"] */\n")}(e,function(n,t){return Zt(T,function(r){var e="_."+r[0];t&r[1]&&!Ht(n,e)&&n.push(e)}),n.sort()}(function(n){var t=n.match(Un);return t?t[1].split(Tn):[]}(e),r)))}function oo(n){var t=0,e=0;return function(){var u=Vr(),i=I-(u-e);if(e=u,i>0){if(++t>=O)return arguments[0]}else t=0;return n.apply(r,arguments)}}function fo(n,t){var e=-1,u=n.length,i=u-1;for(t=t===r?u:t;++e1?n[t-1]:r;return e="function"==typeof e?(n.pop(),e):r,Lo(n,e)});function Do(n){var t=pe(n);return t.__chain__=!0,t}function Mo(n,t){return t(n)}var Fo=Ei(function(n){var t=n.length,e=t?n[0]:0,u=this.__wrapped__,i=function(t){return We(t,n)};return!(t>1||this.__actions__.length)&&u instanceof ye&&Zi(e)?((u=u.slice(e,+e+(t?1:0))).__actions__.push({func:Mo,args:[i],thisArg:r}),new ge(u,this.__chain__).thru(function(n){return t&&!n.length&&n.push(r),n})):this.thru(i)});var No=ui(function(n,t,r){st.call(n,r)?++n[r]:Le(n,r,1)});var Po=si(_o),qo=si(go);function Zo(n,t){return(df(n)?Zt:De)(n,Bi(t,3))}function Ko(n,t){return(df(n)?Kt:Me)(n,Bi(t,3))}var Vo=ui(function(n,t,r){st.call(n,r)?n[r].push(t):Le(n,r,[t])});var Go=ju(function(n,t,r){var e=-1,u="function"==typeof t,i=wf(n)?Yn(n.length):[];return De(n,function(n){i[++e]=u?Pt(t,n,r):eu(n,t,r)}),i}),Ho=ui(function(n,t,r){Le(n,r,t)});function Jo(n,t){return(df(n)?Yt:hu)(n,Bi(t,3))}var Yo=ui(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]});var Qo=ju(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Ki(n,t[0],t[1])?t=[]:r>2&&Ki(t[0],t[1],t[2])&&(t=[t[0]]),yu(n,qe(t,1),[])}),Xo=Ur||function(){return St.Date.now()};function nf(n,t,e){return t=e?r:t,t=n&&null==t?n.length:t,Ai(n,m,r,r,r,r,t)}function tf(n,t){var e;if("function"!=typeof t)throw new it(i);return n=Nf(n),function(){return--n>0&&(e=t.apply(this,arguments)),n<=1&&(t=r),e}}var rf=ju(function(n,t,r){var e=v;if(r.length){var u=kr(r,Ci(rf));e|=b}return Ai(n,e,t,r,u)}),ef=ju(function(n,t,r){var e=v|_;if(r.length){var u=kr(r,Ci(ef));e|=b}return Ai(t,e,n,r,u)});function uf(n,t,e){var u,o,f,a,c,l,s=0,h=!1,p=!1,v=!0;if("function"!=typeof n)throw new it(i);function _(t){var e=u,i=o;return u=o=r,s=t,a=n.apply(i,e)}function g(n){var e=n-l;return l===r||e>=t||e<0||p&&n-s>=f}function y(){var n=Xo();if(g(n))return d(n);c=eo(y,function(n){var r=t-(n-l);return p?Kr(r,f-(n-s)):r}(n))}function d(n){return c=r,v&&u?_(n):(u=o=r,a)}function b(){var n=Xo(),e=g(n);if(u=arguments,o=this,l=n,e){if(c===r)return function(n){return s=n,c=eo(y,t),h?_(n):a}(l);if(p)return Hu(c),c=eo(y,t),_(l)}return c===r&&(c=eo(y,t)),a}return t=qf(t)||0,Rf(e)&&(h=!!e.leading,f=(p="maxWait"in e)?Zr(qf(e.maxWait)||0,t):f,v="trailing"in e?!!e.trailing:v),b.cancel=function(){c!==r&&Hu(c),s=0,u=l=o=c=r},b.flush=function(){return c===r?a:d(Xo())},b}var of=ju(function(n,t){return Te(n,1,t)}),ff=ju(function(n,t,r){return Te(n,qf(t)||0,r)});function af(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new it(i);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(af.Cache||we),r}function cf(n){if("function"!=typeof n)throw new it(i);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}af.Cache=we;var lf=Vu(function(n,t){var r=(t=1==t.length&&df(t[0])?Yt(t[0],vr(Bi())):Yt(qe(t,1),vr(Bi()))).length;return ju(function(e){for(var u=-1,i=Kr(e.length,r);++u=t}),yf=uu(function(){return arguments}())?uu:function(n){return Ef(n)&&st.call(n,"callee")&&!Ut.call(n,"callee")},df=Yn.isArray,bf=Tt?vr(Tt):function(n){return Ef(n)&&Qe(n)==on};function wf(n){return null!=n&&If(n.length)&&!kf(n)}function mf(n){return Ef(n)&&wf(n)}var xf=Fr||qa,jf=$t?vr($t):function(n){return Ef(n)&&Qe(n)==N};function Af(n){if(!Ef(n))return!1;var t=Qe(n);return t==q||t==P||"string"==typeof n.message&&"string"==typeof n.name&&!Lf(n)}function kf(n){if(!Rf(n))return!1;var t=Qe(n);return t==Z||t==K||t==M||t==Y}function Of(n){return"number"==typeof n&&n==Nf(n)}function If(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=S}function Rf(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function Ef(n){return null!=n&&"object"==typeof n}var zf=Dt?vr(Dt):function(n){return Ef(n)&&Fi(n)==V};function Sf(n){return"number"==typeof n||Ef(n)&&Qe(n)==G}function Lf(n){if(!Ef(n)||Qe(n)!=J)return!1;var t=Wt(n);if(null===t)return!0;var r=st.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&<.call(r)==_t}var Wf=Mt?vr(Mt):function(n){return Ef(n)&&Qe(n)==Q};var Cf=Ft?vr(Ft):function(n){return Ef(n)&&Fi(n)==X};function Bf(n){return"string"==typeof n||!df(n)&&Ef(n)&&Qe(n)==nn}function Uf(n){return"symbol"==typeof n||Ef(n)&&Qe(n)==tn}var Tf=Nt?vr(Nt):function(n){return Ef(n)&&If(n.length)&&!!At[Qe(n)]};var $f=bi(su),Df=bi(function(n,t){return n<=t});function Mf(n){if(!n)return[];if(wf(n))return Bf(n)?Er(n):ri(n);if(Lr&&n[Lr])return function(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}(n[Lr]());var t=Fi(n);return(t==V?jr:t==X?Or:va)(n)}function Ff(n){return n?(n=qf(n))===z||n===-z?(n<0?-1:1)*L:n==n?n:0:0===n?n:0}function Nf(n){var t=Ff(n),r=t%1;return t==t?r?t-r:t:0}function Pf(n){return n?Ce(Nf(n),0,C):0}function qf(n){if("number"==typeof n)return n;if(Uf(n))return W;if(Rf(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=Rf(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=n.replace(Ln,"");var r=Pn.test(n);return r||Zn.test(n)?Rt(n.slice(2),r?2:8):Nn.test(n)?W:+n}function Zf(n){return ei(n,oa(n))}function Kf(n){return null==n?"":Uu(n)}var Vf=ii(function(n,t){if(Ji(t)||wf(t))ei(t,ia(t),n);else for(var r in t)st.call(t,r)&&Re(n,r,t[r])}),Gf=ii(function(n,t){ei(t,oa(t),n)}),Hf=ii(function(n,t,r,e){ei(t,oa(t),n,e)}),Jf=ii(function(n,t,r,e){ei(t,ia(t),n,e)}),Yf=Ei(We);var Qf=ju(function(n,t){n=rt(n);var e=-1,u=t.length,i=u>2?t[2]:r;for(i&&Ki(t[0],t[1],i)&&(u=1);++e1),t}),ei(n,Si(n),r),e&&(r=Be(r,c|l|s,Ii));for(var u=t.length;u--;)$u(r,t[u]);return r});var la=Ei(function(n,t){return null==n?{}:function(n,t){return du(n,t,function(t,r){return ta(n,r)})}(n,t)});function sa(n,t){if(null==n)return{};var r=Yt(Si(n),function(n){return[n]});return t=Bi(t),du(n,r,function(n,r){return t(n,r[0])})}var ha=ji(ia),pa=ji(oa);function va(n){return null==n?[]:_r(n,ia(n))}var _a=ci(function(n,t,r){return t=t.toLowerCase(),n+(r?ga(t):t)});function ga(n){return Aa(Kf(n).toLowerCase())}function ya(n){return(n=Kf(n))&&n.replace(Vn,br).replace(yt,"")}var da=ci(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),ba=ci(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),wa=ai("toLowerCase");var ma=ci(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()});var xa=ci(function(n,t,r){return n+(r?" ":"")+Aa(t)});var ja=ci(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Aa=ai("toUpperCase");function ka(n,t,e){return n=Kf(n),(t=e?r:t)===r?function(n){return mt.test(n)}(n)?function(n){return n.match(bt)||[]}(n):function(n){return n.match($n)||[]}(n):n.match(t)||[]}var Oa=ju(function(n,t){try{return Pt(n,r,t)}catch(e){return Af(e)?e:new Xn(e)}}),Ia=Ei(function(n,t){return Zt(t,function(t){t=co(t),Le(n,t,rf(n[t],n))}),n});function Ra(n){return function(){return n}}var Ea=hi(),za=hi(!0);function Sa(n){return n}function La(n){return au("function"==typeof n?n:Be(n,c))}var Wa=ju(function(n,t){return function(r){return eu(r,n,t)}}),Ca=ju(function(n,t){return function(r){return eu(n,r,t)}});function Ba(n,t,r){var e=ia(t),u=He(t,e);null!=r||Rf(t)&&(u.length||!e.length)||(r=t,t=n,n=this,u=He(t,ia(t)));var i=!(Rf(r)&&"chain"in r&&!r.chain),o=kf(n);return Zt(u,function(r){var e=t[r];n[r]=e,o&&(n.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=n(this.__wrapped__);return(r.__actions__=ri(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,Qt([this.value()],arguments))})}),n}function Ua(){}var Ta=gi(Yt),$a=gi(Vt),Da=gi(tr);function Ma(n){return Vi(n)?cr(co(n)):function(n){return function(t){return Je(t,n)}}(n)}var Fa=di(),Na=di(!0);function Pa(){return[]}function qa(){return!1}var Za=_i(function(n,t){return n+t},0),Ka=mi("ceil"),Va=_i(function(n,t){return n/t},1),Ga=mi("floor");var Ha,Ja=_i(function(n,t){return n*t},1),Ya=mi("round"),Qa=_i(function(n,t){return n-t},0);return pe.after=function(n,t){if("function"!=typeof t)throw new it(i);return n=Nf(n),function(){if(--n<1)return t.apply(this,arguments)}},pe.ary=nf,pe.assign=Vf,pe.assignIn=Gf,pe.assignInWith=Hf,pe.assignWith=Jf,pe.at=Yf,pe.before=tf,pe.bind=rf,pe.bindAll=Ia,pe.bindKey=ef,pe.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return df(n)?n:[n]},pe.chain=Do,pe.chunk=function(n,t,e){t=(e?Ki(n,t,e):t===r)?1:Zr(Nf(t),0);var u=null==n?0:n.length;if(!u||t<1)return[];for(var i=0,o=0,f=Yn($r(u/t));ii?0:i+e),(u=u===r||u>i?i:Nf(u))<0&&(u+=i),u=e>u?0:Pf(u);e>>0)?(n=Kf(n))&&("string"==typeof t||null!=t&&!Wf(t))&&!(t=Uu(t))&&xr(n)?Gu(Er(n),0,e):n.split(t,e):[]},pe.spread=function(n,t){if("function"!=typeof n)throw new it(i);return t=null==t?0:Zr(Nf(t),0),ju(function(r){var e=r[t],u=Gu(r,0,t);return e&&Qt(u,e),Pt(n,this,u)})},pe.tail=function(n){var t=null==n?0:n.length;return t?zu(n,1,t):[]},pe.take=function(n,t,e){return n&&n.length?zu(n,0,(t=e||t===r?1:Nf(t))<0?0:t):[]},pe.takeRight=function(n,t,e){var u=null==n?0:n.length;return u?zu(n,(t=u-(t=e||t===r?1:Nf(t)))<0?0:t,u):[]},pe.takeRightWhile=function(n,t){return n&&n.length?Mu(n,Bi(t,3),!1,!0):[]},pe.takeWhile=function(n,t){return n&&n.length?Mu(n,Bi(t,3)):[]},pe.tap=function(n,t){return t(n),n},pe.throttle=function(n,t,r){var e=!0,u=!0;if("function"!=typeof n)throw new it(i);return Rf(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),uf(n,t,{leading:e,maxWait:t,trailing:u})},pe.thru=Mo,pe.toArray=Mf,pe.toPairs=ha,pe.toPairsIn=pa,pe.toPath=function(n){return df(n)?Yt(n,co):Uf(n)?[n]:ri(ao(Kf(n)))},pe.toPlainObject=Zf,pe.transform=function(n,t,r){var e=df(n),u=e||xf(n)||Tf(n);if(t=Bi(t,4),null==r){var i=n&&n.constructor;r=u?e?new i:[]:Rf(n)&&kf(i)?ve(Wt(n)):{}}return(u?Zt:Ve)(n,function(n,e,u){return t(r,n,e,u)}),r},pe.unary=function(n){return nf(n,1)},pe.union=Ro,pe.unionBy=Eo,pe.unionWith=zo,pe.uniq=function(n){return n&&n.length?Tu(n):[]},pe.uniqBy=function(n,t){return n&&n.length?Tu(n,Bi(t,2)):[]},pe.uniqWith=function(n,t){return t="function"==typeof t?t:r,n&&n.length?Tu(n,r,t):[]},pe.unset=function(n,t){return null==n||$u(n,t)},pe.unzip=So,pe.unzipWith=Lo,pe.update=function(n,t,r){return null==n?n:Du(n,t,Zu(r))},pe.updateWith=function(n,t,e,u){return u="function"==typeof u?u:r,null==n?n:Du(n,t,Zu(e),u)},pe.values=va,pe.valuesIn=function(n){return null==n?[]:_r(n,oa(n))},pe.without=Wo,pe.words=ka,pe.wrap=function(n,t){return sf(Zu(t),n)},pe.xor=Co,pe.xorBy=Bo,pe.xorWith=Uo,pe.zip=To,pe.zipObject=function(n,t){return Pu(n||[],t||[],Re)},pe.zipObjectDeep=function(n,t){return Pu(n||[],t||[],Ou)},pe.zipWith=$o,pe.entries=ha,pe.entriesIn=pa,pe.extend=Gf,pe.extendWith=Hf,Ba(pe,pe),pe.add=Za,pe.attempt=Oa,pe.camelCase=_a,pe.capitalize=ga,pe.ceil=Ka,pe.clamp=function(n,t,e){return e===r&&(e=t,t=r),e!==r&&(e=(e=qf(e))==e?e:0),t!==r&&(t=(t=qf(t))==t?t:0),Ce(qf(n),t,e)},pe.clone=function(n){return Be(n,s)},pe.cloneDeep=function(n){return Be(n,c|s)},pe.cloneDeepWith=function(n,t){return Be(n,c|s,t="function"==typeof t?t:r)},pe.cloneWith=function(n,t){return Be(n,s,t="function"==typeof t?t:r)},pe.conformsTo=function(n,t){return null==t||Ue(n,t,ia(t))},pe.deburr=ya,pe.defaultTo=function(n,t){return null==n||n!=n?t:n},pe.divide=Va,pe.endsWith=function(n,t,e){n=Kf(n),t=Uu(t);var u=n.length,i=e=e===r?u:Ce(Nf(e),0,u);return(e-=t.length)>=0&&n.slice(e,i)==t},pe.eq=vf,pe.escape=function(n){return(n=Kf(n))&&jn.test(n)?n.replace(mn,wr):n},pe.escapeRegExp=function(n){return(n=Kf(n))&&Sn.test(n)?n.replace(zn,"\\$&"):n},pe.every=function(n,t,e){var u=df(n)?Vt:Fe;return e&&Ki(n,t,e)&&(t=r),u(n,Bi(t,3))},pe.find=Po,pe.findIndex=_o,pe.findKey=function(n,t){return er(n,Bi(t,3),Ve)},pe.findLast=qo,pe.findLastIndex=go,pe.findLastKey=function(n,t){return er(n,Bi(t,3),Ge)},pe.floor=Ga,pe.forEach=Zo,pe.forEachRight=Ko,pe.forIn=function(n,t){return null==n?n:Ze(n,Bi(t,3),oa)},pe.forInRight=function(n,t){return null==n?n:Ke(n,Bi(t,3),oa)},pe.forOwn=function(n,t){return n&&Ve(n,Bi(t,3))},pe.forOwnRight=function(n,t){return n&&Ge(n,Bi(t,3))},pe.get=na,pe.gt=_f,pe.gte=gf,pe.has=function(n,t){return null!=n&&Ni(n,t,nu)},pe.hasIn=ta,pe.head=bo,pe.identity=Sa,pe.includes=function(n,t,r,e){n=wf(n)?n:va(n),r=r&&!e?Nf(r):0;var u=n.length;return r<0&&(r=Zr(u+r,0)),Bf(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&ir(n,t,r)>-1},pe.indexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:Nf(r);return u<0&&(u=Zr(e+u,0)),ir(n,t,u)},pe.inRange=function(n,t,e){return t=Ff(t),e===r?(e=t,t=0):e=Ff(e),function(n,t,r){return n>=Kr(t,r)&&n=-S&&n<=S},pe.isSet=Cf,pe.isString=Bf,pe.isSymbol=Uf,pe.isTypedArray=Tf,pe.isUndefined=function(n){return n===r},pe.isWeakMap=function(n){return Ef(n)&&Fi(n)==en},pe.isWeakSet=function(n){return Ef(n)&&Qe(n)==un},pe.join=function(n,t){return null==n?"":Pr.call(n,t)},pe.kebabCase=da,pe.last=jo,pe.lastIndexOf=function(n,t,e){var u=null==n?0:n.length;if(!u)return-1;var i=u;return e!==r&&(i=(i=Nf(e))<0?Zr(u+i,0):Kr(i,u-1)),t==t?function(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e}(n,t,i):ur(n,fr,i,!0)},pe.lowerCase=ba,pe.lowerFirst=wa,pe.lt=$f,pe.lte=Df,pe.max=function(n){return n&&n.length?Ne(n,Sa,Xe):r},pe.maxBy=function(n,t){return n&&n.length?Ne(n,Bi(t,2),Xe):r},pe.mean=function(n){return ar(n,Sa)},pe.meanBy=function(n,t){return ar(n,Bi(t,2))},pe.min=function(n){return n&&n.length?Ne(n,Sa,su):r},pe.minBy=function(n,t){return n&&n.length?Ne(n,Bi(t,2),su):r},pe.stubArray=Pa,pe.stubFalse=qa,pe.stubObject=function(){return{}},pe.stubString=function(){return""},pe.stubTrue=function(){return!0},pe.multiply=Ja,pe.nth=function(n,t){return n&&n.length?gu(n,Nf(t)):r},pe.noConflict=function(){return St._===this&&(St._=dt),this},pe.noop=Ua,pe.now=Xo,pe.pad=function(n,t,r){n=Kf(n);var e=(t=Nf(t))?Rr(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return yi(Dr(u),r)+n+yi($r(u),r)},pe.padEnd=function(n,t,r){n=Kf(n);var e=(t=Nf(t))?Rr(n):0;return t&&et){var u=n;n=t,t=u}if(e||n%1||t%1){var i=Hr();return Kr(n+i*(t-n+It("1e-"+((i+"").length-1))),t)}return mu(n,t)},pe.reduce=function(n,t,r){var e=df(n)?Xt:sr,u=arguments.length<3;return e(n,Bi(t,4),r,u,De)},pe.reduceRight=function(n,t,r){var e=df(n)?nr:sr,u=arguments.length<3;return e(n,Bi(t,4),r,u,Me)},pe.repeat=function(n,t,e){return t=(e?Ki(n,t,e):t===r)?1:Nf(t),xu(Kf(n),t)},pe.replace=function(){var n=arguments,t=Kf(n[0]);return n.length<3?t:t.replace(n[1],n[2])},pe.result=function(n,t,e){var u=-1,i=(t=Ku(t,n)).length;for(i||(i=1,n=r);++uS)return[];var r=C,e=Kr(n,C);t=Bi(t),n-=C;for(var u=pr(e,t);++r=o)return n;var a=e-Rr(u);if(a<1)return u;var c=f?Gu(f,0,a).join(""):n.slice(0,a);if(i===r)return c+u;if(f&&(a+=c.length-a),Wf(i)){if(n.slice(a).search(i)){var l,s=c;for(i.global||(i=et(i.source,Kf(Fn.exec(i))+"g")),i.lastIndex=0;l=i.exec(s);)var h=l.index;c=c.slice(0,h===r?a:h)}}else if(n.indexOf(Uu(i),a)!=a){var p=c.lastIndexOf(i);p>-1&&(c=c.slice(0,p))}return c+u},pe.unescape=function(n){return(n=Kf(n))&&xn.test(n)?n.replace(wn,zr):n},pe.uniqueId=function(n){var t=++ht;return Kf(n)+t},pe.upperCase=ja,pe.upperFirst=Aa,pe.each=Zo,pe.eachRight=Ko,pe.first=bo,Ba(pe,(Ha={},Ve(pe,function(n,t){st.call(pe.prototype,t)||(Ha[t]=n)}),Ha),{chain:!1}),pe.VERSION="4.17.15",Zt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){pe[n].placeholder=pe}),Zt(["drop","take"],function(n,t){ye.prototype[n]=function(e){e=e===r?1:Zr(Nf(e),0);var u=this.__filtered__&&!t?new ye(this):this.clone();return u.__filtered__?u.__takeCount__=Kr(e,u.__takeCount__):u.__views__.push({size:Kr(e,C),type:n+(u.__dir__<0?"Right":"")}),u},ye.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),Zt(["filter","map","takeWhile"],function(n,t){var r=t+1,e=r==R||3==r;ye.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:Bi(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),Zt(["head","last"],function(n,t){var r="take"+(t?"Right":"");ye.prototype[n]=function(){return this[r](1).value()[0]}}),Zt(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");ye.prototype[n]=function(){return this.__filtered__?new ye(this):this[r](1)}}),ye.prototype.compact=function(){return this.filter(Sa)},ye.prototype.find=function(n){return this.filter(n).head()},ye.prototype.findLast=function(n){return this.reverse().find(n)},ye.prototype.invokeMap=ju(function(n,t){return"function"==typeof n?new ye(this):this.map(function(r){return eu(r,n,t)})}),ye.prototype.reject=function(n){return this.filter(cf(Bi(n)))},ye.prototype.slice=function(n,t){n=Nf(n);var e=this;return e.__filtered__&&(n>0||t<0)?new ye(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==r&&(e=(t=Nf(t))<0?e.dropRight(-t):e.take(t-n)),e)},ye.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},ye.prototype.toArray=function(){return this.take(C)},Ve(ye.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),u=/^(?:head|last)$/.test(t),i=pe[u?"take"+("last"==t?"Right":""):t],o=u||/^find/.test(t);i&&(pe.prototype[t]=function(){var t=this.__wrapped__,f=u?[1]:arguments,a=t instanceof ye,c=f[0],l=a||df(t),s=function(n){var t=i.apply(pe,Qt([n],f));return u&&h?t[0]:t};l&&e&&"function"==typeof c&&1!=c.length&&(a=l=!1);var h=this.__chain__,p=!!this.__actions__.length,v=o&&!h,_=a&&!p;if(!o&&l){t=_?t:new ye(this);var g=n.apply(t,f);return g.__actions__.push({func:Mo,args:[s],thisArg:r}),new ge(g,h)}return v&&_?n.apply(this,f):(g=this.thru(s),v?u?g.value()[0]:g.value():g)})}),Zt(["pop","push","shift","sort","splice","unshift"],function(n){var t=ot[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);pe.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(df(u)?u:[],n)}return this[r](function(r){return t.apply(df(r)?r:[],n)})}}),Ve(ye.prototype,function(n,t){var r=pe[t];if(r){var e=r.name+"";st.call(ue,e)||(ue[e]=[]),ue[e].push({name:t,func:r})}}),ue[pi(r,_).name]=[{name:"wrapper",func:r}],ye.prototype.clone=function(){var n=new ye(this.__wrapped__);return n.__actions__=ri(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=ri(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=ri(this.__views__),n},ye.prototype.reverse=function(){if(this.__filtered__){var n=new ye(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},ye.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,r=df(n),e=t<0,u=r?n.length:0,i=function(n,t,r){for(var e=-1,u=r.length;++e=this.__values__.length;return{done:n,value:n?r:this.__values__[this.__index__++]}},pe.prototype.plant=function(n){for(var t,e=this;e instanceof _e;){var u=so(e);u.__index__=0,u.__values__=r,t?i.__wrapped__=u:t=u;var i=u;e=e.__wrapped__}return i.__wrapped__=n,t},pe.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof ye){var t=n;return this.__actions__.length&&(t=new ye(this)),(t=t.reverse()).__actions__.push({func:Mo,args:[Io],thisArg:r}),new ge(t,this.__chain__)}return this.thru(Io)},pe.prototype.toJSON=pe.prototype.valueOf=pe.prototype.value=function(){return Fu(this.__wrapped__,this.__actions__)},pe.prototype.first=pe.prototype.head,Lr&&(pe.prototype[Lr]=function(){return this}),pe}();"function"==typeof n&&"object"==typeof n.amd&&n.amd?(St._=Sr,n(function(){return Sr})):Wt?((Wt.exports=Sr)._=Sr,Lt._=Sr):St._=Sr}).call(this); },{"buffer":"VjIL"}],"iO5H":[function(require,module,exports) { var i=require("pdfast"),e=require("lodash"),t=function(t,n,r){var u=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=e.filter(t,e.isFinite);e.isFinite(u)&&(s=e.filter(s,function(i){return i>u})),e.isFinite(o)&&(s=e.filter(s,function(i){return i5){var v=l.nrd0(f),q=S(f,n.outputXYPoints),_=e._2(s.O.$$default,v,n.kernelWidth),P=g(i,n.outputXYPoints,_),x={sampleCount:n.sampleCount,outputXYPoints:n.outputXYPoints,bandwidthXSuggested:v,bandwidthUnitSuggested:q,bandwidthXImplemented:_,bandwidthUnitImplemented:P};u=[p.make(void 0,void 0,void 0,j(f,n.outputXYPoints,y(P))),x]}else u=void 0;var F=c.buildSimple(e._2(s.O.fmap,function(t){return t[0]},u),h);return{continuousParseParams:e._2(s.O.fmap,function(t){return t[1]},u),shape:F}}function A(t,r){return F(r,t,void 0)}exports.Internals=x,exports.toShape=F,exports.fromSamples=A; },{"rescript/lib/js/caml.js":"gGFE","rescript/lib/js/array.js":"d4B1","rescript/lib/js/curry.js":"NSLD","jstat":"AuT8","rescript/lib/js/belt_Array.js":"yUxI","rescript/lib/js/caml_array.js":"Tpli","../utility/E.bs.js":"xX5m","./KdeLibrary.js":"iO5H","../distribution/XYShape.bs.js":"Lf2V","../distribution/Discrete.bs.js":"Ms6F","./Bandwidth.bs.js":"Oh6H","../distribution/Continuous.bs.js":"CVcq","../distribution/MixedShapeBuilder.bs.js":"O6rr"}],"OH0m":[function(require,module,exports) { "use strict";function e(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function r(e){return(r="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)}var t=require("rescript/lib/js/curry.js"),n=require("../utility/E.bs.js"),o=require("rescript/lib/js/belt_MapString.js");function u(e,r){return t._2(n.O.fmap,function(e){return e[1]},t._2(n.A.getBy,e,function(e){return e[0]===r}))}function i(e,r){return n.O.toResult(r+" expected and not found",u(e,r))}function a(e,r){return t._2(n.A.fmap,function(r){return[r,u(e,r)]},r)}var f={getByName:u,getByNameResult:i,getByNames:a};function s(e){if("object"===r(e)){var t=e.NAME;if("SymbolicDist"===t){var n=e.VAL;return"object"===r(n)&&"Float"===n.NAME?n.VAL:void 0}if("RenderedDist"===t){var o=e.VAL;switch(0|o.TAG){case 1:var u=o._0.xyShape,i=u.xs;if(1!==i.length)return;var a=i[0],f=u.ys;if(1!==f.length)return;return 1!==f[0]?void 0:a;case 0:case 2:return}}}}function d(e){var r=s(e);return void 0!==r?{NAME:"SymbolicDist",VAL:{NAME:"Float",VAL:r}}:e}function c(e){return{sampleCount:t._2(n.O.$$default,1e4,e.sampleCount),outputXYPoints:t._2(n.O.$$default,1e4,e.outputXYPoints),kernelWidth:e.kernelWidth,shapeLength:t._2(n.O.$$default,1e4,e.shapeLength)}}var l={withDefaults:c},A=o.fromArray([]);function m(e,r){return o.merge(e,r,function(e,r,t){return void 0!==t?t:void 0!==r?r:void 0})}var y=o.update,v=o.get;function b(t,n){var u=o.get(t,n);if(void 0!==u&&"object"===r(u)&&"Function"===u.NAME){var i=u.VAL;return e({TAG:0,_0:[i[0],i[1]]},Symbol.for("name"),"Ok")}return e({TAG:1,_0:"Function "+n+" not found"},Symbol.for("name"),"Error")}var p={MS:void 0,fromArray:o.fromArray,empty:A,mergeKeepSecond:m,update:y,get:v,getFunction:b};function _(e){return t._1(e.evaluateNode,e)}function S(e,r,o){var u=t._2(e.evaluateNode,e,o);return t._2(n.R.bind,u,t._1(r,e))}function g(e,r){return t._2(e.evaluateNode,e,{NAME:"Render",VAL:r})}function N(t,n){if("object"===r(n)&&"RenderedDist"===n.NAME)return e({TAG:0,_0:n},Symbol.for("name"),"Ok");var o=g(t,n);if(0!==o.TAG)return e({TAG:1,_0:o._0},Symbol.for("name"),"Error");var u=o._0;return"object"===r(u)&&"RenderedDist"===u.NAME?e({TAG:0,_0:{NAME:"RenderedDist",VAL:u.VAL}},Symbol.for("name"),"Ok"):e({TAG:1,_0:"Did not render as requested"},Symbol.for("name"),"Error")}function E(t,n){var o=N(t,n);if(0!==o.TAG)return e({TAG:1,_0:o._0},Symbol.for("name"),"Error");var u=o._0;return"object"===r(u)&&"RenderedDist"===u.NAME?e({TAG:0,_0:u.VAL},Symbol.for("name"),"Ok"):e({TAG:1,_0:"Did not render as requested"},Symbol.for("name"),"Error")}function h(e){if("object"===r(e)&&"RenderedDist"===e.NAME)return e.VAL}function L(e){switch(0|e.TAG){case 1:var r=e._0.xyShape,t=r.xs;if(1!==t.length)return;var n=t[0],o=r.ys;if(1!==o.length)return;return 1!==o[0]?void 0:{NAME:"SymbolicDist",VAL:{NAME:"Float",VAL:n}};case 0:case 2:return}}function M(e){var r=h(e);return n.O.toResult("Not valid shape",t._2(n.O.bind,r,L))}var R={render:g,ensureIsRendered:N,ensureIsRenderedAndGetShape:E,getShape:h,_toFloat:L,toFloat:M},G={Hash:f,getFloat:s,toFloatIfNeeded:d,SamplingInputs:l,Environment:p,evaluateNode:_,evaluateAndRetry:S,Render:R},T={};exports.ExpressionTree=G,exports.Program=T; },{"rescript/lib/js/curry.js":"NSLD","../utility/E.bs.js":"xX5m","rescript/lib/js/belt_MapString.js":"mO07"}],"uF38":[function(require,module,exports) { "use strict";function e(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function r(e){return(r="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)}var n=require("rescript/lib/js/curry.js"),t=require("rescript/lib/js/belt_Array.js"),i=require("rescript/lib/js/caml_option.js"),o=require("../utility/E.bs.js"),u=require("../distribution/Shape.bs.js"),s=require("./Operation.bs.js"),m=require("../symbolic/SymbolicDist.bs.js"),a=require("../samplesRenderer/SamplesToShape.bs.js"),f=require("./ExpressionTypes.bs.js");function l(e){if("object"===r(e)&&"Function"===e.NAME)return e.VAL}function c(e){return e[0]}function p(e){return e[1]}function b(r,i,u){if(o.A.length(i)!==o.A.length(c(u)))return e({TAG:1,_0:"Wrong number of variables"},Symbol.for("name"),"Error");var s=n._1(f.ExpressionTree.Environment.fromArray,t.zip(c(u),i)),m={samplingInputs:r.samplingInputs,environment:n._2(f.ExpressionTree.Environment.mergeKeepSecond,r.environment,s),evaluateNode:r.evaluateNode};return n._2(r.evaluateNode,m,p(u))}var d={fromNode:l,argumentNames:c,internals:p,run:b};function y(e){if("object"!==r(e))return!1;var n=e.NAME;return"RenderedDist"===n||"Function"===n||"SymbolicDist"===n}function A(e){if("object"===r(e)){var n=e.NAME;return"RenderedDist"===n||"Function"===n||"SymbolicDist"===n?e:void 0}}var v={isPrimative:y,fromNode:A};function S(e){if("object"!==r(e))return!1;var n=e.NAME;return"RenderedDist"===n||"SymbolicDist"===n}function N(n){if("object"!==r(n))return e({TAG:1,_0:"Not valid type"},Symbol.for("name"),"Error");var t=n.NAME;return"SymbolicDist"===t?e({TAG:0,_0:{NAME:"SymbolicDist",VAL:n.VAL}},Symbol.for("name"),"Ok"):"RenderedDist"===t?e({TAG:0,_0:{NAME:"RenderedDist",VAL:n.VAL}},Symbol.for("name"),"Ok"):e({TAG:1,_0:"Not valid type"},Symbol.for("name"),"Error")}function _(r,t){if(S(t))return e({TAG:0,_0:t},Symbol.for("name"),"Ok");var i=n._2(f.ExpressionTree.Render.render,r,t);return 0===i.TAG?e({TAG:0,_0:i._0},Symbol.for("name"),"Ok"):e({TAG:1,_0:i._0},Symbol.for("name"),"Error")}function E(e,t,o){if("object"===r(o)){var u=o.NAME;return"SymbolicDist"===u?i.some(n._1(t,o.VAL)):"RenderedDist"===u?i.some(n._1(e,o.VAL)):void 0}}function j(e){return function(r){return E(function(r){return u.sampleNRendered(e,r)},function(r){return m.T.sampleN(e,r)},r)}}function g(e,r,i,u){var m=j(e)(i),a=j(e)(u);if(void 0!==m&&void 0!==a)return n._2(o.A.fmap,function(e){return s.Algebraic.toFn(r)(e[0],e[1])},t.zip(m,a))}function D(e,r,t,i){var u=_(e,t),s=_(e,i),m=o.R.merge(u,s);return n._2(o.R.bind,m,function(t){var i=g(e.samplingInputs.sampleCount,r,t[0],t[1]),u=e.samplingInputs,s=n._2(o.O.fmap,function(e){return a.fromSamples(u,e)},i),m=o.O.toResult("No response",n._2(o.O.bind,s,function(e){return e.shape}));return n._2(o.R.fmap,function(e){return{NAME:"Normalize",VAL:{NAME:"RenderedDist",VAL:e}}},m)})}var T={isSamplingDistribution:S,fromNode:N,renderIfIsNotSamplingDistribution:_,map:E,sampleN:j,getCombinationSamples:g,combineShapesUsingSampling:D};exports.$$Function=d,exports.Primative=v,exports.SamplingDistribution=T; },{"rescript/lib/js/curry.js":"NSLD","rescript/lib/js/belt_Array.js":"yUxI","rescript/lib/js/caml_option.js":"dzFO","../utility/E.bs.js":"xX5m","../distribution/Shape.bs.js":"wbI6","./Operation.bs.js":"S4ET","../symbolic/SymbolicDist.bs.js":"wl7Z","../samplesRenderer/SamplesToShape.bs.js":"wVv4","./ExpressionTypes.bs.js":"OH0m"}],"N3i9":[function(require,module,exports) { "use strict";var r=function(r,p){var l,t;t=p.length;var e=[];for(l=0;l1e4?"Sampling":"Analytical"}function y(r,e,i,u){var a=o.R.merge(t.SamplingDistribution.renderIfIsNotSamplingDistribution(r,i),t.SamplingDistribution.renderIfIsNotSamplingDistribution(r,u));return n._2(o.R.bind,a,function(n){var o=n[1],i=n[0];return"Sampling"===d(i,o)?t.SamplingDistribution.combineShapesUsingSampling(r,e,i,o):b(r,e,i,o)})}function p(i,t,u,a){var s=m(t,u,a);return n._2(o.R.bind,s,function(n){return"object"===e(n)&&"SymbolicDist"===n.NAME?r({TAG:0,_0:n},Symbol.for("name"),"Ok"):y(i,t,u,a)})}var E={tryAnalyticalSimplification:m,combinationByRendering:b,nodeScore:l,choose:d,combine:y,operationToLeaf:p};function S(o,t,u){var s=n._2(f.ExpressionTree.Render.render,o,t),A=n._2(f.ExpressionTree.Render.render,o,u);if(0!==s.TAG)return r({TAG:1,_0:s._0},Symbol.for("name"),"Error");var c=s._0;if("object"===e(c)&&"RenderedDist"===c.NAME&&0===A.TAG){var m=A._0;return"object"===e(m)&&"RenderedDist"===m.NAME?r({TAG:0,_0:{NAME:"RenderedDist",VAL:i.combinePointwise(function(r,e){return r+e},function(r,e){return a.combinePointwise(void 0,void 0,"CDF",function(r,e){return r+e},r,e)},function(r,e){return r+e},c.VAL,m.VAL)}},Symbol.for("name"),"Ok"):r({TAG:1,_0:"Pointwise combination: rendering failed."},Symbol.for("name"),"Error")}return 0===A.TAG?r({TAG:1,_0:"Pointwise combination: rendering failed."},Symbol.for("name"),"Error"):r({TAG:1,_0:A._0},Symbol.for("name"),"Error")}function _(o,t,u,a){var s=n._2(f.ExpressionTree.Render.render,t,u),A=n._2(f.ExpressionTree.Render.render,t,a);if(0!==s.TAG)return r({TAG:1,_0:s._0},Symbol.for("name"),"Error");var c=s._0;if("object"===e(c)&&"RenderedDist"===c.NAME&&0===A.TAG){var m=A._0;return"object"===e(m)&&"RenderedDist"===m.NAME?r({TAG:0,_0:{NAME:"RenderedDist",VAL:i.combinePointwise(void 0,void 0,o,c.VAL,m.VAL)}},Symbol.for("name"),"Ok"):r({TAG:1,_0:"Pointwise combination: rendering failed."},Symbol.for("name"),"Error")}return 0===A.TAG?r({TAG:1,_0:"Pointwise combination: rendering failed."},Symbol.for("name"),"Error"):r({TAG:1,_0:A._0},Symbol.for("name"),"Error")}function T(r,e,n,o){return"Add"===e?S(r,n,o):_("Exponentiate"===e?function(r,e){return Math.pow(r,e)}:function(r,e){return r*e},r,n,o)}var v={pointwiseAdd:S,pointwiseCombine:_,operationToLeaf:T};function L(r,n,o){if(void 0!==r){if(void 0!==n&&r>n)return{NAME:"Error",VAL:"Left truncation bound must be smaller than right truncation bound."}}else if(void 0===n)return{NAME:"Solution",VAL:o};if("object"!==e(o))return"NoSolution";if("SymbolicDist"!==o.NAME)return"NoSolution";var i=o.VAL;return"object"===e(i)&&"Uniform"===i.NAME?{NAME:"Solution",VAL:{NAME:"SymbolicDist",VAL:{NAME:"Uniform",VAL:A.Uniform.truncate(r,n,i.VAL)}}}:"NoSolution"}function R(o,t,u,a){var s=n._2(f.ExpressionTree.Render.ensureIsRendered,o,a);if(0!==s.TAG)return r({TAG:1,_0:s._0},Symbol.for("name"),"Error");var A=s._0;return"object"===e(A)&&"RenderedDist"===A.NAME?r({TAG:0,_0:{NAME:"RenderedDist",VAL:n._3(i.T.truncate,t,u,A.VAL)}},Symbol.for("name"),"Ok"):r({TAG:1,_0:"Could not truncate distribution."},Symbol.for("name"),"Error")}function V(n,o,i,t){var u=L(o,i,t);return"object"===e(u)?"Error"===u.NAME?r({TAG:1,_0:u.VAL},Symbol.for("name"),"Error"):r({TAG:0,_0:u.VAL},Symbol.for("name"),"Ok"):R(n,o,i,t)}var N={trySimplification:L,truncateAsShape:R,operationToLeaf:V};function G(o,t){if("object"!==e(t))return f.ExpressionTree.evaluateAndRetry(o,G,t);var u=t.NAME;return"SymbolicDist"===u?r({TAG:0,_0:t},Symbol.for("name"),"Ok"):"RenderedDist"===u?r({TAG:0,_0:{NAME:"RenderedDist",VAL:n._1(i.T.normalize,t.VAL)}},Symbol.for("name"),"Ok"):f.ExpressionTree.evaluateAndRetry(o,G,t)}var M={operationToLeaf:G};function D(r,e,o){return n._4(s.$$Function.Ts.findByNameAndRun,c.all,r,e,o)}function g(r,e,i){var u=n._2(f.ExpressionTree.Environment.getFunction,e.environment,r);return n._2(o.R.bind,u,function(r){return t.$$Function.run(e,i,[r[0],r[1]])})}function j(r,e,i){return n._2(o.O.$$default,g(e,r,i),D(e,r,i))}function x(r,e,i){var t=n._1(o.A.R.firstErrorOrOpen,n._2(o.A.fmap,function(e){return n._2(r.evaluateNode,r,e)},i));return n._2(o.R.bind,t,function(n){return j(r,e,n)})}var O={_runHardcodedFunction:D,_runLocalFunction:g,_runWithEvaluatedInputs:j,run:x};function h(n,o){if("object"!==e(o))return f.ExpressionTree.evaluateAndRetry(n,h,o);var i=o.NAME;return"SymbolicDist"===i?r({TAG:0,_0:{NAME:"RenderedDist",VAL:A.T.toShape(n.samplingInputs.shapeLength,o.VAL)}},Symbol.for("name"),"Ok"):"Function"===i?r({TAG:1,_0:"Cannot render a function"},Symbol.for("name"),"Error"):"RenderedDist"===i?r({TAG:0,_0:o},Symbol.for("name"),"Ok"):f.ExpressionTree.evaluateAndRetry(n,h,o)}var w={operationToLeaf:h};function k(e,i){var t=i.NAME;if("RenderedDist"===t||"Function"===t||"SymbolicDist"===t)return r({TAG:0,_0:i},Symbol.for("name"),"Ok");if("FunctionCall"===t){var u=i.VAL,a=x(e,u[0],u[1]);return n._2(o.R.bind,a,function(r){return k(e,r)})}if("AlgebraicCombination"===t){var s=i.VAL;return p(e,s[0],s[1],s[2])}if("PointwiseCombination"===t){var A=i.VAL;return T(e,A[0],A[1],A[2])}if("Symbol"===t){var c=i.VAL,m=o.O.toResult("Undeclared variable "+c,n._2(f.ExpressionTree.Environment.get,e.environment,c));return n._2(o.R.bind,m,function(r){return k(e,r)})}if("Truncate"!==t)return"Hash"===t?n._2(o.R.fmap,function(r){return{NAME:"Hash",VAL:r}},n._1(o.A.R.firstErrorOrOpen,n._2(o.A.fmap,function(r){var i=r[0];return n._2(o.R.fmap,function(r){return[i,r]},k(e,r[1]))},i.VAL))):"Array"===t?n._2(o.R.fmap,function(r){return{NAME:"Array",VAL:r}},n._1(o.A.R.firstErrorOrOpen,n._2(o.A.fmap,function(r){return k(e,r)},i.VAL))):"Render"===t?h(e,i.VAL):G(e,i.VAL);var b=i.VAL;return V(e,b[0],b[1],b[2])}exports.AlgebraicCombination=E,exports.PointwiseCombination=v,exports.Truncate=N,exports.Normalize=M,exports.FunctionCall=O,exports.Render=w,exports.toLeaf=k; },{"rescript/lib/js/curry.js":"NSLD","../utility/E.bs.js":"xX5m","../distribution/Shape.bs.js":"wbI6","./PTypes.bs.js":"uF38","../distribution/XYShape.bs.js":"Lf2V","../distribution/Continuous.bs.js":"CVcq","../typeSystem/TypeSystem.bs.js":"TKgk","../symbolic/SymbolicDist.bs.js":"wl7Z","./ExpressionTypes.bs.js":"OH0m","../typeSystem/HardcodedFunctions.bs.js":"BBdU"}],"H74a":[function(require,module,exports) { "use strict";function e(r){return(e="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})(r)}function r(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var n=require("./PTypes.bs.js"),t=require("./ExpressionTreeBasic.bs.js"),o=require("./ExpressionTreeEvaluator.bs.js");function u(e,r){return{samplingInputs:e,environment:r,evaluateNode:o.toLeaf}}function i(e,r,n){return o.toLeaf({samplingInputs:e,environment:r,evaluateNode:o.toLeaf},n)}function a(n,t,o){var u=i(n,t,o);if(0!==u.TAG)return r({TAG:1,_0:u._0},Symbol.for("name"),"Error");var a=u._0;return"object"===e(a)&&"RenderedDist"===a.NAME?r({TAG:0,_0:a.VAL},Symbol.for("name"),"Ok"):r({TAG:1,_0:"Rendering failed."},Symbol.for("name"),"Error")}function s(e,r,t,u){var i={samplingInputs:e,environment:r,evaluateNode:o.toLeaf};return n.$$Function.run(i,t,u)}var f=t.toString;exports.toString=f,exports.envs=u,exports.toLeaf=i,exports.toShape=a,exports.runFunction=s; },{"./PTypes.bs.js":"uF38","./ExpressionTreeBasic.bs.js":"lpIF","./ExpressionTreeEvaluator.bs.js":"NgRJ"}],"uZ2e":[function(require,module,exports) { "use strict";function e(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function r(e){return(r="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)}var n=require("rescript/lib/js/array.js"),t=require("rescript/lib/js/curry.js"),o=require("rescript/lib/js/caml_option.js"),i=require("./utility/E.bs.js"),u=require("rescript/lib/js/belt_MapString.js"),s=require("./distribution/DistPlus.bs.js"),a=require("./expressionTree/MathJsParser.bs.js"),l=require("./expressionTree/ExpressionTree.bs.js"),m=require("./expressionTree/ExpressionTypes.bs.js"),p={},f={sampleCount:void 0,outputXYPoints:void 0,kernelWidth:void 0,shapeLength:void 0};function c(e,r,n,t){return{squiggleString:r,samplingInputs:void 0!==e?e:f,environment:void 0!==n?o.valFromOption(n):m.ExpressionTree.Environment.empty}}var d={SamplingInputs:p,defaultRecommendedLength:100,defaultShouldDownsample:!0,empty:f,make:c};function b(e,r,n){return{squiggleString:e.squiggleString,samplingInputs:e.samplingInputs,environment:t._3(m.ExpressionTree.Environment.update,e.environment,r,function(e){return n})}}function v(e,r){return{graph:e,shape:r}}function A(e){return{sampleCount:t._2(i.O.$$default,1e4,e.samplingInputs.sampleCount),outputXYPoints:t._2(i.O.$$default,1e4,e.samplingInputs.outputXYPoints),kernelWidth:e.samplingInputs.kernelWidth,shapeLength:t._2(i.O.$$default,1e4,e.samplingInputs.shapeLength)}}function y(e,r){return l.toLeaf(A(e),e.environment,r)}function g(e,r){var n={contents:e};return t._1(i.A.R.firstErrorOrOpen,t._1(i.A.O.concatSomes,t._2(i.A.fmap,function(e){if("Expression"===e.NAME)return t._2(i.R.fmap,function(e){return[n.contents.environment,e]},y(n.contents,e.VAL));var r=e.VAL;n.contents=b(n.contents,r[0],r[1])},r)))}function _(e){var r=a.fromString(e.squiggleString);return t._2(i.R.bind,r,function(r){return g(e,r)})}function S(e,r){return s.make(r,e.squiggleString,void 0,void 0,void 0)}var T={addVariable:b,makeOutputs:v,makeInputs:A,runNode:y,runProgram:g,inputsToLeaf:_,outputToDistPlus:S};function E(n,t){if("object"!==r(t))return e({TAG:0,_0:t},Symbol.for("name"),"Ok");var o=t.NAME;if("SymbolicDist"!==o&&"Normalize"!==o)return e({TAG:0,_0:t},Symbol.for("name"),"Ok");var i=y(n,{NAME:"Render",VAL:t});if(0!==i.TAG)return e({TAG:1,_0:i._0},Symbol.for("name"),"Error");var u=i._0;return"object"===r(u)&&"RenderedDist"===u.NAME?i:e({TAG:1,_0:"Didn't render, but intended to"},Symbol.for("name"),"Error")}function h(n,o,u){var s=E(n,u);return t._2(i.R.bind,s,function(t){if("object"===r(t)){var i=t.NAME;if("SymbolicDist"===i){var u=t.VAL;if("object"===r(u)&&"Float"===u.NAME)return e({TAG:0,_0:{NAME:"Float",VAL:u.VAL}},Symbol.for("name"),"Ok")}else{if("Function"===i)return e({TAG:0,_0:{NAME:"Function",VAL:[t.VAL,o]}},Symbol.for("name"),"Ok");if("RenderedDist"===i){var s=t.VAL,a=0;switch(0|s.TAG){case 1:var m=s._0.xyShape,p=m.xs;if(1!==p.length)a=2;else{var f=p[0],c=m.ys;if(1!==c.length)a=2;else{if(1===c[0])return e({TAG:0,_0:{NAME:"Float",VAL:f}},Symbol.for("name"),"Ok");a=2}}break;case 0:case 2:a=2}if(2===a)return e({TAG:0,_0:{NAME:"DistPlus",VAL:S(n,s)}},Symbol.for("name"),"Ok")}}}return e({TAG:1,_0:"Didn't output a rendered distribution. Format:"+l.toString(t)},Symbol.for("name"),"Error")})}function x(r,n){if(!n)return e({TAG:0,_0:0},Symbol.for("name"),"Ok");var o=t._1(r,n.hd);if(0!==o.TAG)return e({TAG:1,_0:o._0},Symbol.for("name"),"Error");var i=x(r,n.tl);return 0===i.TAG?e({TAG:0,_0:{hd:o._0,tl:i._0}},Symbol.for("name"),"Ok"):e({TAG:1,_0:i._0},Symbol.for("name"),"Error")}function j(e){var r=_(e);return t._2(i.R.bind,r,function(r){return x(function(r){return h(e,r[0],r[1])},n.to_list(r))})}function L(e,r,n){var o=l.runFunction(A(e),e.environment,n,r),u=e.environment;return t._2(i.R.bind,o,function(r){return h(e,u,r)})}function k(e){return j(c({sampleCount:1e4,outputXYPoints:1e4,kernelWidth:void 0,shapeLength:1e3},e,o.some(u.fromArray([])),void 0))}exports.Inputs=d,exports.Internals=T,exports.renderIfNeeded=E,exports.coersionToExportedTypes=h,exports.mapM=x,exports.evaluateProgram=j,exports.evaluateFunction=L,exports.runAll=k; },{"rescript/lib/js/array.js":"d4B1","rescript/lib/js/curry.js":"NSLD","rescript/lib/js/caml_option.js":"dzFO","./utility/E.bs.js":"xX5m","rescript/lib/js/belt_MapString.js":"mO07","./distribution/DistPlus.bs.js":"A9pM","./expressionTree/MathJsParser.bs.js":"dGOd","./expressionTree/ExpressionTree.bs.js":"H74a","./expressionTree/ExpressionTypes.bs.js":"OH0m"}],"OXj9":[function(require,module,exports) { var r=require("./ProgramEvaluator.bs"),a=function(a){var u=r.runAll(a);return 0===u.TAG?{tag:"Ok",value:u._0}:{tag:"Error",value:u._0}};exports.runAll=a; },{"./ProgramEvaluator.bs":"uZ2e"}],"Focm":[function(require,module,exports) { var r=require("../distPlus/ProgramEvaluator.gen.js");exports.runMePlease=r.runAll; },{"../distPlus/ProgramEvaluator.gen.js":"OXj9"}]},{},["Focm"], null)