jbrowse-plugin-graphgenomeviewer 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +36 -0
  2. package/dist/GraphGenomeView/components/FeatureDialog.d.ts +5 -0
  3. package/dist/GraphGenomeView/components/FeatureDialog.js +18 -0
  4. package/dist/GraphGenomeView/components/FeatureDialog.js.map +1 -0
  5. package/dist/GraphGenomeView/components/GraphGenomeView.d.ts +6 -0
  6. package/dist/GraphGenomeView/components/GraphGenomeView.js +17 -0
  7. package/dist/GraphGenomeView/components/GraphGenomeView.js.map +1 -0
  8. package/dist/GraphGenomeView/components/GraphPanel.d.ts +6 -0
  9. package/dist/GraphGenomeView/components/GraphPanel.js +17 -0
  10. package/dist/GraphGenomeView/components/GraphPanel.js.map +1 -0
  11. package/dist/GraphGenomeView/components/Header.d.ts +6 -0
  12. package/dist/GraphGenomeView/components/Header.js +59 -0
  13. package/dist/GraphGenomeView/components/Header.js.map +1 -0
  14. package/dist/GraphGenomeView/components/SettingsDialog.d.ts +7 -0
  15. package/dist/GraphGenomeView/components/SettingsDialog.js +24 -0
  16. package/dist/GraphGenomeView/components/SettingsDialog.js.map +1 -0
  17. package/dist/GraphGenomeView/index.d.ts +2 -0
  18. package/dist/GraphGenomeView/index.js +15 -0
  19. package/dist/GraphGenomeView/index.js.map +1 -0
  20. package/dist/GraphGenomeView/model.d.ts +80 -0
  21. package/dist/GraphGenomeView/model.js +96 -0
  22. package/dist/GraphGenomeView/model.js.map +1 -0
  23. package/dist/GraphGenomeView/util.d.ts +1 -0
  24. package/dist/GraphGenomeView/util.js +8 -0
  25. package/dist/GraphGenomeView/util.js.map +1 -0
  26. package/dist/index.d.ts +8 -0
  27. package/dist/index.js +24 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/jbrowse-plugin-graphgenomeviewer.umd.production.min.js +67 -0
  30. package/dist/jbrowse-plugin-graphgenomeviewer.umd.production.min.js.map +7 -0
  31. package/package.json +63 -0
  32. package/src/GraphGenomeView/components/FeatureDialog.tsx +51 -0
  33. package/src/GraphGenomeView/components/GraphGenomeView.tsx +32 -0
  34. package/src/GraphGenomeView/components/GraphPanel.tsx +37 -0
  35. package/src/GraphGenomeView/components/Header.tsx +90 -0
  36. package/src/GraphGenomeView/components/SettingsDialog.tsx +71 -0
  37. package/src/GraphGenomeView/index.ts +19 -0
  38. package/src/GraphGenomeView/model.ts +110 -0
  39. package/src/GraphGenomeView/util.ts +7 -0
  40. package/src/declare.d.ts +1 -0
  41. package/src/index.ts +28 -0
@@ -0,0 +1,67 @@
1
+ "use strict";var JBrowsePluginGraphGenomeViewer=(()=>{var wV=Object.create;var xu=Object.defineProperty;var TV=Object.getOwnPropertyDescriptor;var bV=Object.getOwnPropertyNames;var DV=Object.getPrototypeOf,AV=Object.prototype.hasOwnProperty;var T=(e,r)=>()=>(e&&(r=e(e=0)),r);var Ir=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Yl=(e,r)=>{for(var t in r)xu(e,t,{get:r[t],enumerable:!0})},sw=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of bV(r))!AV.call(e,a)&&a!==t&&xu(e,a,{get:()=>r[a],enumerable:!(o=TV(r,a))||o.enumerable});return e};var hr=(e,r,t)=>(t=e!=null?wV(DV(e)):{},sw(r||!e||!e.__esModule?xu(t,"default",{value:e,enumerable:!0}):t,e)),OV=e=>sw(xu({},"__esModule",{value:!0}),e);var dw=Ir((loe,lw)=>{lw.exports=JBrowseExports["@jbrowse/core/Plugin"]});var Xl=Ir((doe,pw)=>{pw.exports=JBrowseExports["@jbrowse/core/util"]});var cw=Ir((poe,mw)=>{mw.exports=JBrowseExports["@mui/material/utils"]});var Ii,Jl=T(()=>{"use client";Ii=hr(cw())});var zi=Ir((coe,xw)=>{xw.exports=JBrowseExports["react/jsx-runtime"]});var hw,vw,gw=T(()=>{"use client";Jl();hw=hr(zi()),vw=(0,Ii.createSvgIcon)((0,hw.jsx)("path",{d:"M8.4 18.2c.38.5.6 1.12.6 1.8 0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3c.44 0 .85.09 1.23.26l1.41-1.77c-.92-1.03-1.29-2.39-1.09-3.69l-2.03-.68c-.54.83-1.46 1.38-2.52 1.38-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3c0 .07 0 .14-.01.21l2.03.68c.64-1.21 1.82-2.09 3.22-2.32V5.91C9.96 5.57 9 4.4 9 3c0-1.66 1.34-3 3-3s3 1.34 3 3c0 1.4-.96 2.57-2.25 2.91v2.16c1.4.23 2.58 1.11 3.22 2.32L18 9.71V9.5c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3c-1.06 0-1.98-.55-2.52-1.37l-2.03.68c.2 1.29-.16 2.65-1.09 3.69l1.41 1.77Q17.34 17 18 17c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3c0-.68.22-1.3.6-1.8l-1.41-1.77c-1.35.75-3.01.76-4.37 0z"}),"Hub")});var Xo=Ir((goe,Sw)=>{Sw.exports=JBrowseExports.react});var jl=Ir((yoe,ww)=>{ww.exports=JBrowseExports["@jbrowse/core/pluggableElementTypes"]});function zn(e,r,t){e.prototype=r.prototype=t,t.constructor=e}function qi(e,r){var t=Object.create(e.prototype);for(var o in r)t[o]=r[o];return t}var ed=T(()=>{});function nn(){}function bw(){return this.rgb().formatHex()}function PV(){return this.rgb().formatHex8()}function kV(){return Mw(this).formatHsl()}function Dw(){return this.rgb().formatRgb()}function wa(e){var r,t;return e=(e+"").trim().toLowerCase(),(r=RV.exec(e))?(t=r[1].length,r=parseInt(r[1],16),t===6?Aw(r):t===3?new ct(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):t===8?hu(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):t===4?hu(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=NV.exec(e))?new ct(r[1],r[2],r[3],1):(r=MV.exec(e))?new ct(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=EV.exec(e))?hu(r[1],r[2],r[3],r[4]):(r=FV.exec(e))?hu(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=BV.exec(e))?Rw(r[1],r[2]/100,r[3]/100,1):(r=_V.exec(e))?Rw(r[1],r[2]/100,r[3]/100,r[4]):Tw.hasOwnProperty(e)?Aw(Tw[e]):e==="transparent"?new ct(NaN,NaN,NaN,0):null}function Aw(e){return new ct(e>>16&255,e>>8&255,e&255,1)}function hu(e,r,t,o){return o<=0&&(e=r=t=NaN),new ct(e,r,t,o)}function td(e){return e instanceof nn||(e=wa(e)),e?(e=e.rgb(),new ct(e.r,e.g,e.b,e.opacity)):new ct}function Ta(e,r,t,o){return arguments.length===1?td(e):new ct(e,r,t,o??1)}function ct(e,r,t,o){this.r=+e,this.g=+r,this.b=+t,this.opacity=+o}function Ow(){return`#${tn(this.r)}${tn(this.g)}${tn(this.b)}`}function LV(){return`#${tn(this.r)}${tn(this.g)}${tn(this.b)}${tn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cw(){let e=gu(this.opacity);return`${e===1?"rgb(":"rgba("}${on(this.r)}, ${on(this.g)}, ${on(this.b)}${e===1?")":`, ${e})`}`}function gu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function on(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tn(e){return e=on(e),(e<16?"0":"")+e.toString(16)}function Rw(e,r,t,o){return o<=0?e=r=t=NaN:t<=0||t>=1?e=r=NaN:r<=0&&(e=NaN),new Ro(e,r,t,o)}function Mw(e){if(e instanceof Ro)return new Ro(e.h,e.s,e.l,e.opacity);if(e instanceof nn||(e=wa(e)),!e)return new Ro;if(e instanceof Ro)return e;e=e.rgb();var r=e.r/255,t=e.g/255,o=e.b/255,a=Math.min(r,t,o),n=Math.max(r,t,o),i=NaN,u=n-a,l=(n+a)/2;return u?(r===n?i=(t-o)/u+(t<o)*6:t===n?i=(o-r)/u+2:i=(r-t)/u+4,u/=l<.5?n+a:2-n-a,i*=60):u=l>0&&l<1?0:i,new Ro(i,u,l,e.opacity)}function yu(e,r,t,o){return arguments.length===1?Mw(e):new Ro(e,r,t,o??1)}function Ro(e,r,t,o){this.h=+e,this.s=+r,this.l=+t,this.opacity=+o}function Nw(e){return e=(e||0)%360,e<0?e+360:e}function vu(e){return Math.max(0,Math.min(1,e||0))}function rd(e,r,t){return(e<60?r+(t-r)*e/60:e<180?t:e<240?r+(t-r)*(240-e)/60:r)*255}var Sa,an,qn,Ui,Ho,RV,NV,MV,EV,FV,BV,_V,Tw,od=T(()=>{ed();Sa=.7,an=1/Sa,qn="\\s*([+-]?\\d+)\\s*",Ui="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ho="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",RV=/^#([0-9a-f]{3,8})$/,NV=new RegExp(`^rgb\\(${qn},${qn},${qn}\\)$`),MV=new RegExp(`^rgb\\(${Ho},${Ho},${Ho}\\)$`),EV=new RegExp(`^rgba\\(${qn},${qn},${qn},${Ui}\\)$`),FV=new RegExp(`^rgba\\(${Ho},${Ho},${Ho},${Ui}\\)$`),BV=new RegExp(`^hsl\\(${Ui},${Ho},${Ho}\\)$`),_V=new RegExp(`^hsla\\(${Ui},${Ho},${Ho},${Ui}\\)$`),Tw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};zn(nn,wa,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:bw,formatHex:bw,formatHex8:PV,formatHsl:kV,formatRgb:Dw,toString:Dw});zn(ct,Ta,qi(nn,{brighter(e){return e=e==null?an:Math.pow(an,e),new ct(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Sa:Math.pow(Sa,e),new ct(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ct(on(this.r),on(this.g),on(this.b),gu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ow,formatHex:Ow,formatHex8:LV,formatRgb:Cw,toString:Cw}));zn(Ro,yu,qi(nn,{brighter(e){return e=e==null?an:Math.pow(an,e),new Ro(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Sa:Math.pow(Sa,e),new Ro(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,o=t+(t<.5?t:1-t)*r,a=2*t-o;return new ct(rd(e>=240?e-240:e+120,a,o),rd(e,a,o),rd(e<120?e+240:e-120,a,o),this.opacity)},clamp(){return new Ro(Nw(this.h),vu(this.s),vu(this.l),gu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=gu(this.opacity);return`${e===1?"hsl(":"hsla("}${Nw(this.h)}, ${vu(this.s)*100}%, ${vu(this.l)*100}%${e===1?")":`, ${e})`}`}}))});var Ew,Fw,Bw=T(()=>{Ew=Math.PI/180,Fw=180/Math.PI});function IV(e){if(e instanceof fn)return new fn(e.h,e.s,e.l,e.opacity);e instanceof ct||(e=td(e));var r=e.r/255,t=e.g/255,o=e.b/255,a=(kw*o+_w*r-Pw*t)/(kw+_w-Pw),n=o-a,i=(Hi*(t-a)-nd*n)/Su,u=Math.sqrt(i*i+n*n)/(Hi*a*(1-a)),l=u?Math.atan2(i,n)*Fw-120:NaN;return new fn(l<0?l+360:l,u,a,e.opacity)}function Lt(e,r,t,o){return arguments.length===1?IV(e):new fn(e,r,t,o??1)}function fn(e,r,t,o){this.h=+e,this.s=+r,this.l=+t,this.opacity=+o}var Lw,ad,nd,Su,Hi,_w,Pw,kw,Iw=T(()=>{ed();od();Bw();Lw=-.14861,ad=1.78277,nd=-.29227,Su=-.90649,Hi=1.97294,_w=Hi*Su,Pw=Hi*ad,kw=ad*nd-Su*Lw;zn(fn,Lt,qi(nn,{brighter(e){return e=e==null?an:Math.pow(an,e),new fn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Sa:Math.pow(Sa,e),new fn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Ew,r=+this.l,t=isNaN(this.s)?0:this.s*r*(1-r),o=Math.cos(e),a=Math.sin(e);return new ct(255*(r+t*(Lw*o+ad*a)),255*(r+t*(nd*o+Su*a)),255*(r+t*(Hi*o)),this.opacity)}}))});var ba=T(()=>{od();Iw()});function qw(){for(var e=0,r=arguments.length,t={},o;e<r;++e){if(!(o=arguments[e]+"")||o in t||/[\s.]/.test(o))throw new Error("illegal type: "+o);t[o]=[]}return new wu(t)}function wu(e){this._=e}function qV(e,r){return e.trim().split(/^|\s+/).map(function(t){var o="",a=t.indexOf(".");if(a>=0&&(o=t.slice(a+1),t=t.slice(0,a)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:o}})}function UV(e,r){for(var t=0,o=e.length,a;t<o;++t)if((a=e[t]).name===r)return a.value}function zw(e,r,t){for(var o=0,a=e.length;o<a;++o)if(e[o].name===r){e[o]=zV,e=e.slice(0,o).concat(e.slice(o+1));break}return t!=null&&e.push({name:r,value:t}),e}var zV,Jo,Uw=T(()=>{zV={value:()=>{}};wu.prototype=qw.prototype={constructor:wu,on:function(e,r){var t=this._,o=qV(e+"",t),a,n=-1,i=o.length;if(arguments.length<2){for(;++n<i;)if((a=(e=o[n]).type)&&(a=UV(t[a],e.name)))return a;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++n<i;)if(a=(e=o[n]).type)t[a]=zw(t[a],e.name,r);else if(r==null)for(a in t)t[a]=zw(t[a],e.name,null);return this},copy:function(){var e={},r=this._;for(var t in r)e[t]=r[t].slice();return new wu(e)},call:function(e,r){if((a=arguments.length-2)>0)for(var t=new Array(a),o=0,a,n;o<a;++o)t[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(n=this._[e],o=0,a=n.length;o<a;++o)n[o].value.apply(r,t)},apply:function(e,r,t){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],a=0,n=o.length;a<n;++a)o[a].value.apply(r,t)}};Jo=qw});var Wi=T(()=>{Uw()});var Tu,id,fd=T(()=>{Tu="http://www.w3.org/1999/xhtml",id={svg:"http://www.w3.org/2000/svg",xhtml:Tu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function jo(e){var r=e+="",t=r.indexOf(":");return t>=0&&(r=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),id.hasOwnProperty(r)?{space:id[r],local:e}:e}var bu=T(()=>{fd()});function HV(e){return function(){var r=this.ownerDocument,t=this.namespaceURI;return t===Tu&&r.documentElement.namespaceURI===Tu?r.createElement(e):r.createElementNS(t,e)}}function WV(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Du(e){var r=jo(e);return(r.local?WV:HV)(r)}var ud=T(()=>{bu();fd()});function VV(){}function un(e){return e==null?VV:function(){return this.querySelector(e)}}var Au=T(()=>{});function Hw(e){typeof e!="function"&&(e=un(e));for(var r=this._groups,t=r.length,o=new Array(t),a=0;a<t;++a)for(var n=r[a],i=n.length,u=o[a]=new Array(i),l,f,s=0;s<i;++s)(l=n[s])&&(f=e.call(l,l.__data__,s,n))&&("__data__"in l&&(f.__data__=l.__data__),u[s]=f);return new $r(o,this._parents)}var Ww=T(()=>{No();Au()});function sd(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}var Vw=T(()=>{});function GV(){return[]}function Vi(e){return e==null?GV:function(){return this.querySelectorAll(e)}}var ld=T(()=>{});function $V(e){return function(){return sd(e.apply(this,arguments))}}function Gw(e){typeof e=="function"?e=$V(e):e=Vi(e);for(var r=this._groups,t=r.length,o=[],a=[],n=0;n<t;++n)for(var i=r[n],u=i.length,l,f=0;f<u;++f)(l=i[f])&&(o.push(e.call(l,l.__data__,f,i)),a.push(l));return new $r(o,a)}var $w=T(()=>{No();Vw();ld()});function Gi(e){return function(){return this.matches(e)}}function Ou(e){return function(r){return r.matches(e)}}var $i=T(()=>{});function QV(e){return function(){return KV.call(this.children,e)}}function ZV(){return this.firstElementChild}function Kw(e){return this.select(e==null?ZV:QV(typeof e=="function"?e:Ou(e)))}var KV,Qw=T(()=>{$i();KV=Array.prototype.find});function XV(){return Array.from(this.children)}function JV(e){return function(){return YV.call(this.children,e)}}function Zw(e){return this.selectAll(e==null?XV:JV(typeof e=="function"?e:Ou(e)))}var YV,Yw=T(()=>{$i();YV=Array.prototype.filter});function Xw(e){typeof e!="function"&&(e=Gi(e));for(var r=this._groups,t=r.length,o=new Array(t),a=0;a<t;++a)for(var n=r[a],i=n.length,u=o[a]=[],l,f=0;f<i;++f)(l=n[f])&&e.call(l,l.__data__,f,n)&&u.push(l);return new $r(o,this._parents)}var Jw=T(()=>{No();$i()});function Cu(e){return new Array(e.length)}var dd=T(()=>{});function jw(){return new $r(this._enter||this._groups.map(Cu),this._parents)}function Ki(e,r){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=r}var pd=T(()=>{dd();No();Ki.prototype={constructor:Ki,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,r){return this._parent.insertBefore(e,r)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}}});function eT(e){return function(){return e}}var rT=T(()=>{});function jV(e,r,t,o,a,n){for(var i=0,u,l=r.length,f=n.length;i<f;++i)(u=r[i])?(u.__data__=n[i],o[i]=u):t[i]=new Ki(e,n[i]);for(;i<l;++i)(u=r[i])&&(a[i]=u)}function eG(e,r,t,o,a,n,i){var u,l,f=new Map,s=r.length,d=n.length,m=new Array(s),p;for(u=0;u<s;++u)(l=r[u])&&(m[u]=p=i.call(l,l.__data__,u,r)+"",f.has(p)?a[u]=l:f.set(p,l));for(u=0;u<d;++u)p=i.call(e,n[u],u,n)+"",(l=f.get(p))?(o[u]=l,l.__data__=n[u],f.delete(p)):t[u]=new Ki(e,n[u]);for(u=0;u<s;++u)(l=r[u])&&f.get(m[u])===l&&(a[u]=l)}function rG(e){return e.__data__}function tT(e,r){if(!arguments.length)return Array.from(this,rG);var t=r?eG:jV,o=this._parents,a=this._groups;typeof e!="function"&&(e=eT(e));for(var n=a.length,i=new Array(n),u=new Array(n),l=new Array(n),f=0;f<n;++f){var s=o[f],d=a[f],m=d.length,p=tG(e.call(s,s&&s.__data__,f,o)),x=p.length,c=u[f]=new Array(x),v=i[f]=new Array(x),y=l[f]=new Array(m);t(s,d,c,v,y,p,r);for(var b=0,h=0,S,w;b<x;++b)if(S=c[b]){for(b>=h&&(h=b+1);!(w=v[h])&&++h<x;);S._next=w||null}}return i=new $r(i,o),i._enter=u,i._exit=l,i}function tG(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}var oT=T(()=>{No();pd();rT()});function aT(){return new $r(this._exit||this._groups.map(Cu),this._parents)}var nT=T(()=>{dd();No()});function iT(e,r,t){var o=this.enter(),a=this,n=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),r!=null&&(a=r(a),a&&(a=a.selection())),t==null?n.remove():t(n),o&&a?o.merge(a).order():a}var fT=T(()=>{});function uT(e){for(var r=e.selection?e.selection():e,t=this._groups,o=r._groups,a=t.length,n=o.length,i=Math.min(a,n),u=new Array(a),l=0;l<i;++l)for(var f=t[l],s=o[l],d=f.length,m=u[l]=new Array(d),p,x=0;x<d;++x)(p=f[x]||s[x])&&(m[x]=p);for(;l<a;++l)u[l]=t[l];return new $r(u,this._parents)}var sT=T(()=>{No()});function lT(){for(var e=this._groups,r=-1,t=e.length;++r<t;)for(var o=e[r],a=o.length-1,n=o[a],i;--a>=0;)(i=o[a])&&(n&&i.compareDocumentPosition(n)^4&&n.parentNode.insertBefore(i,n),n=i);return this}var dT=T(()=>{});function pT(e){e||(e=oG);function r(d,m){return d&&m?e(d.__data__,m.__data__):!d-!m}for(var t=this._groups,o=t.length,a=new Array(o),n=0;n<o;++n){for(var i=t[n],u=i.length,l=a[n]=new Array(u),f,s=0;s<u;++s)(f=i[s])&&(l[s]=f);l.sort(r)}return new $r(a,this._parents).order()}function oG(e,r){return e<r?-1:e>r?1:e>=r?0:NaN}var mT=T(()=>{No()});function cT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}var xT=T(()=>{});function hT(){return Array.from(this)}var vT=T(()=>{});function gT(){for(var e=this._groups,r=0,t=e.length;r<t;++r)for(var o=e[r],a=0,n=o.length;a<n;++a){var i=o[a];if(i)return i}return null}var yT=T(()=>{});function ST(){let e=0;for(let r of this)++e;return e}var wT=T(()=>{});function TT(){return!this.node()}var bT=T(()=>{});function DT(e){for(var r=this._groups,t=0,o=r.length;t<o;++t)for(var a=r[t],n=0,i=a.length,u;n<i;++n)(u=a[n])&&e.call(u,u.__data__,n,a);return this}var AT=T(()=>{});function aG(e){return function(){this.removeAttribute(e)}}function nG(e){return function(){this.removeAttributeNS(e.space,e.local)}}function iG(e,r){return function(){this.setAttribute(e,r)}}function fG(e,r){return function(){this.setAttributeNS(e.space,e.local,r)}}function uG(e,r){return function(){var t=r.apply(this,arguments);t==null?this.removeAttribute(e):this.setAttribute(e,t)}}function sG(e,r){return function(){var t=r.apply(this,arguments);t==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}}function OT(e,r){var t=jo(e);if(arguments.length<2){var o=this.node();return t.local?o.getAttributeNS(t.space,t.local):o.getAttribute(t)}return this.each((r==null?t.local?nG:aG:typeof r=="function"?t.local?sG:uG:t.local?fG:iG)(t,r))}var CT=T(()=>{bu()});function Ru(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}var md=T(()=>{});function lG(e){return function(){this.style.removeProperty(e)}}function dG(e,r,t){return function(){this.style.setProperty(e,r,t)}}function pG(e,r,t){return function(){var o=r.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,t)}}function RT(e,r,t){return arguments.length>1?this.each((r==null?lG:typeof r=="function"?pG:dG)(e,r,t??"")):Da(this.node(),e)}function Da(e,r){return e.style.getPropertyValue(r)||Ru(e).getComputedStyle(e,null).getPropertyValue(r)}var cd=T(()=>{md()});function mG(e){return function(){delete this[e]}}function cG(e,r){return function(){this[e]=r}}function xG(e,r){return function(){var t=r.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function NT(e,r){return arguments.length>1?this.each((r==null?mG:typeof r=="function"?xG:cG)(e,r)):this.node()[e]}var MT=T(()=>{});function ET(e){return e.trim().split(/^|\s+/)}function xd(e){return e.classList||new FT(e)}function FT(e){this._node=e,this._names=ET(e.getAttribute("class")||"")}function BT(e,r){for(var t=xd(e),o=-1,a=r.length;++o<a;)t.add(r[o])}function _T(e,r){for(var t=xd(e),o=-1,a=r.length;++o<a;)t.remove(r[o])}function hG(e){return function(){BT(this,e)}}function vG(e){return function(){_T(this,e)}}function gG(e,r){return function(){(r.apply(this,arguments)?BT:_T)(this,e)}}function PT(e,r){var t=ET(e+"");if(arguments.length<2){for(var o=xd(this.node()),a=-1,n=t.length;++a<n;)if(!o.contains(t[a]))return!1;return!0}return this.each((typeof r=="function"?gG:r?hG:vG)(t,r))}var kT=T(()=>{FT.prototype={add:function(e){var r=this._names.indexOf(e);r<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var r=this._names.indexOf(e);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}}});function yG(){this.textContent=""}function SG(e){return function(){this.textContent=e}}function wG(e){return function(){var r=e.apply(this,arguments);this.textContent=r??""}}function LT(e){return arguments.length?this.each(e==null?yG:(typeof e=="function"?wG:SG)(e)):this.node().textContent}var IT=T(()=>{});function TG(){this.innerHTML=""}function bG(e){return function(){this.innerHTML=e}}function DG(e){return function(){var r=e.apply(this,arguments);this.innerHTML=r??""}}function zT(e){return arguments.length?this.each(e==null?TG:(typeof e=="function"?DG:bG)(e)):this.node().innerHTML}var qT=T(()=>{});function AG(){this.nextSibling&&this.parentNode.appendChild(this)}function UT(){return this.each(AG)}var HT=T(()=>{});function OG(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function WT(){return this.each(OG)}var VT=T(()=>{});function GT(e){var r=typeof e=="function"?e:Du(e);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}var $T=T(()=>{ud()});function CG(){return null}function KT(e,r){var t=typeof e=="function"?e:Du(e),o=r==null?CG:typeof r=="function"?r:un(r);return this.select(function(){return this.insertBefore(t.apply(this,arguments),o.apply(this,arguments)||null)})}var QT=T(()=>{ud();Au()});function RG(){var e=this.parentNode;e&&e.removeChild(this)}function ZT(){return this.each(RG)}var YT=T(()=>{});function NG(){var e=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function MG(){var e=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function XT(e){return this.select(e?MG:NG)}var JT=T(()=>{});function jT(e){return arguments.length?this.property("__data__",e):this.node().__data__}var eb=T(()=>{});function EG(e){return function(r){e.call(this,r,this.__data__)}}function FG(e){return e.trim().split(/^|\s+/).map(function(r){var t="",o=r.indexOf(".");return o>=0&&(t=r.slice(o+1),r=r.slice(0,o)),{type:r,name:t}})}function BG(e){return function(){var r=this.__on;if(r){for(var t=0,o=-1,a=r.length,n;t<a;++t)n=r[t],(!e.type||n.type===e.type)&&n.name===e.name?this.removeEventListener(n.type,n.listener,n.options):r[++o]=n;++o?r.length=o:delete this.__on}}}function _G(e,r,t){return function(){var o=this.__on,a,n=EG(r);if(o){for(var i=0,u=o.length;i<u;++i)if((a=o[i]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=n,a.options=t),a.value=r;return}}this.addEventListener(e.type,n,t),a={type:e.type,name:e.name,value:r,listener:n,options:t},o?o.push(a):this.__on=[a]}}function rb(e,r,t){var o=FG(e+""),a,n=o.length,i;if(arguments.length<2){var u=this.node().__on;if(u){for(var l=0,f=u.length,s;l<f;++l)for(a=0,s=u[l];a<n;++a)if((i=o[a]).type===s.type&&i.name===s.name)return s.value}return}for(u=r?_G:BG,a=0;a<n;++a)this.each(u(o[a],r,t));return this}var tb=T(()=>{});function ob(e,r,t){var o=Ru(e),a=o.CustomEvent;typeof a=="function"?a=new a(r,t):(a=o.document.createEvent("Event"),t?(a.initEvent(r,t.bubbles,t.cancelable),a.detail=t.detail):a.initEvent(r,!1,!1)),e.dispatchEvent(a)}function PG(e,r){return function(){return ob(this,e,r)}}function kG(e,r){return function(){return ob(this,e,r.apply(this,arguments))}}function ab(e,r){return this.each((typeof r=="function"?kG:PG)(e,r))}var nb=T(()=>{md()});function*ib(){for(var e=this._groups,r=0,t=e.length;r<t;++r)for(var o=e[r],a=0,n=o.length,i;a<n;++a)(i=o[a])&&(yield i)}var fb=T(()=>{});function $r(e,r){this._groups=e,this._parents=r}function ub(){return new $r([[document.documentElement]],hd)}function LG(){return this}var hd,ea,No=T(()=>{Ww();$w();Qw();Yw();Jw();oT();pd();nT();fT();sT();dT();mT();xT();vT();yT();wT();bT();AT();CT();cd();MT();kT();IT();qT();HT();VT();$T();QT();YT();JT();eb();tb();nb();fb();hd=[null];$r.prototype=ub.prototype={constructor:$r,select:Hw,selectAll:Gw,selectChild:Kw,selectChildren:Zw,filter:Xw,data:tT,enter:jw,exit:aT,join:iT,merge:uT,selection:LG,order:lT,sort:pT,call:cT,nodes:hT,node:gT,size:ST,empty:TT,each:DT,attr:OT,style:RT,property:NT,classed:PT,text:LT,html:zT,raise:UT,lower:WT,append:GT,insert:KT,remove:ZT,clone:XT,datum:jT,on:rb,dispatch:ab,[Symbol.iterator]:ib};ea=ub});function it(e){return typeof e=="string"?new $r([[document.querySelector(e)]],[document.documentElement]):new $r([[e]],hd)}var sb=T(()=>{No()});function lb(e){let r;for(;r=e.sourceEvent;)e=r;return e}var db=T(()=>{});function uo(e,r){if(e=lb(e),r===void 0&&(r=e.currentTarget),r){var t=r.ownerSVGElement||r;if(t.createSVGPoint){var o=t.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(r.getScreenCTM().inverse()),[o.x,o.y]}if(r.getBoundingClientRect){var a=r.getBoundingClientRect();return[e.clientX-a.left-r.clientLeft,e.clientY-a.top-r.clientTop]}}return[e.pageX,e.pageY]}var pb=T(()=>{db()});var Gt=T(()=>{$i();bu();pb();sb();No();Au();ld();cd()});function Nu(e){e.stopImmediatePropagation()}function Aa(e){e.preventDefault(),e.stopImmediatePropagation()}var mb,sn,vd=T(()=>{mb={passive:!1},sn={capture:!0,passive:!1}});function Qi(e){var r=e.document.documentElement,t=it(e).on("dragstart.drag",Aa,sn);"onselectstart"in r?t.on("selectstart.drag",Aa,sn):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Zi(e,r){var t=e.document.documentElement,o=it(e).on("dragstart.drag",null);r&&(o.on("click.drag",Aa,sn),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in t?o.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}var gd=T(()=>{Gt();vd()});var Yi,cb=T(()=>{Yi=e=>()=>e});function Xi(e,{sourceEvent:r,subject:t,target:o,identifier:a,active:n,x:i,y:u,dx:l,dy:f,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:n,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:s}})}var xb=T(()=>{Xi.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e}});function IG(e){return!e.ctrlKey&&!e.button}function zG(){return this.parentNode}function qG(e,r){return r??{x:e.x,y:e.y}}function UG(){return navigator.maxTouchPoints||"ontouchstart"in this}function yd(){var e=IG,r=zG,t=qG,o=UG,a={},n=Jo("start","drag","end"),i=0,u,l,f,s,d=0;function m(S){S.on("mousedown.drag",p).filter(o).on("touchstart.drag",v).on("touchmove.drag",y,mb).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(S,w){if(!(s||!e.call(this,S,w))){var g=h(this,r.call(this,S,w),S,w,"mouse");g&&(it(S.view).on("mousemove.drag",x,sn).on("mouseup.drag",c,sn),Qi(S.view),Nu(S),f=!1,u=S.clientX,l=S.clientY,g("start",S))}}function x(S){if(Aa(S),!f){var w=S.clientX-u,g=S.clientY-l;f=w*w+g*g>d}a.mouse("drag",S)}function c(S){it(S.view).on("mousemove.drag mouseup.drag",null),Zi(S.view,f),Aa(S),a.mouse("end",S)}function v(S,w){if(e.call(this,S,w)){var g=S.changedTouches,A=r.call(this,S,w),C=g.length,D,N;for(D=0;D<C;++D)(N=h(this,A,S,w,g[D].identifier,g[D]))&&(Nu(S),N("start",S,g[D]))}}function y(S){var w=S.changedTouches,g=w.length,A,C;for(A=0;A<g;++A)(C=a[w[A].identifier])&&(Aa(S),C("drag",S,w[A]))}function b(S){var w=S.changedTouches,g=w.length,A,C;for(s&&clearTimeout(s),s=setTimeout(function(){s=null},500),A=0;A<g;++A)(C=a[w[A].identifier])&&(Nu(S),C("end",S,w[A]))}function h(S,w,g,A,C,D){var N=n.copy(),E=uo(D||g,w),_,L,P;if((P=t.call(S,new Xi("beforestart",{sourceEvent:g,target:m,identifier:C,active:i,x:E[0],y:E[1],dx:0,dy:0,dispatch:N}),A))!=null)return _=P.x-E[0]||0,L=P.y-E[1]||0,function k(R,F,I){var B=E,V;switch(R){case"start":a[C]=k,V=i++;break;case"end":delete a[C],--i;case"drag":E=uo(I||F,w),V=i;break}N.call(R,S,new Xi(R,{sourceEvent:F,subject:P,target:m,identifier:C,active:V,x:E[0]+_,y:E[1]+L,dx:E[0]-B[0],dy:E[1]-B[1],dispatch:N}),A)}}return m.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Yi(!!S),m):e},m.container=function(S){return arguments.length?(r=typeof S=="function"?S:Yi(S),m):r},m.subject=function(S){return arguments.length?(t=typeof S=="function"?S:Yi(S),m):t},m.touchable=function(S){return arguments.length?(o=typeof S=="function"?S:Yi(!!S),m):o},m.on=function(){var S=n.on.apply(n,arguments);return S===n?m:S},m.clickDistance=function(S){return arguments.length?(d=(S=+S)*S,m):Math.sqrt(d)},m}var hb=T(()=>{Wi();Gt();gd();vd();cb();xb()});var Sd=T(()=>{hb();gd()});function Pr(){return Pr=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Pr.apply(null,arguments)}var Oa=T(()=>{});var wd,vb=T(()=>{wd={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null}});function Br(e,r){if(Ji(e,r))return e[r];throw typeof e[r]=="function"&&Mu(e,r)?new Error('Cannot access method "'+r+'" as a property'):new Error('No access to property "'+r+'"')}function Wo(e,r,t){if(Ji(e,r))return e[r]=t,t;throw new Error('No access to property "'+r+'"')}function Ji(e,r){return!WG(e)&&!Array.isArray(e)?!1:Me(VG,r)?!0:!(r in Object.prototype||r in Function.prototype)}function gb(e,r){if(!Mu(e,r))throw new Error('No access to method "'+r+'"');return e[r]}function Mu(e,r){return e==null||typeof e[r]!="function"||Me(e,r)&&Object.getPrototypeOf&&r in Object.getPrototypeOf(e)?!1:Me(GG,r)?!0:!(r in Object.prototype||r in Function.prototype)}function WG(e){return typeof e=="object"&&e&&e.constructor===Object}var VG,GG,$t=T(()=>{lr();VG={length:!0,name:!0},GG={toString:!0,valueOf:!0,toLocaleString:!0}});function yb(e,r){return{next:()=>{var t=e.next();return t.done?t:{value:r(t.value),done:!1}}}}function Ra(){return new Map}function ra(e){if(!e)return Ra();if(Eu(e))return e;if(Na(e))return new Ca(e);throw new Error("createMap can create maps from objects or Maps")}function Sb(e){if(e instanceof Ca)return e.wrappedObject;var r={};for(var t of e.keys()){var o=e.get(t);Wo(r,t,o)}return r}var Ca,Un,ta=T(()=>{$t();Se();Ca=class{constructor(r){this.wrappedObject=r,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(r=>this.has(r)).values()}get(r){return Br(this.wrappedObject,r)}set(r,t){return Wo(this.wrappedObject,r,t),this}has(r){return Ji(this.wrappedObject,r)&&r in this.wrappedObject}entries(){return yb(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){Ji(this.wrappedObject,r)&&delete this.wrappedObject[r]}clear(){for(var r of this.keys())this.delete(r)}get size(){return Object.keys(this.wrappedObject).length}},Un=class{constructor(r,t,o){this.a=r,this.b=t,this.bKeys=o,this[Symbol.iterator]=this.entries}get(r){return this.bKeys.has(r)?this.b.get(r):this.a.get(r)}set(r,t){return this.bKeys.has(r)?this.b.set(r,t):this.a.set(r,t),this}has(r){return this.b.has(r)||this.a.has(r)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return yb(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){return this.bKeys.has(r)?this.b.delete(r):this.a.delete(r)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}});function ke(e){return typeof e=="number"}function Fe(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function Ma(e){return typeof e=="bigint"}function It(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function oa(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function xt(e){return e&&e.constructor.prototype.isUnit===!0||!1}function zr(e){return typeof e=="string"}function Ae(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function Wr(e){return Array.isArray(e)||Ae(e)}function ln(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function Mo(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function Hn(e){return e&&e.constructor.prototype.isRange===!0||!1}function Ea(e){return e&&e.constructor.prototype.isIndex===!0||!1}function wb(e){return typeof e=="boolean"}function Tb(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function Fu(e){return e&&e.constructor.prototype.isHelp===!0||!1}function bb(e){return typeof e=="function"}function Db(e){return e instanceof Date}function Ab(e){return e instanceof RegExp}function Na(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!It(e)&&!oa(e))}function Eu(e){return e?e instanceof Map||e instanceof Ca||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}function Ob(e){return e===null}function Cb(e){return e===void 0}function eo(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function ht(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function Rb(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Nb(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function Mb(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function Je(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function ji(e){return Je(e)||Cr(e)&&e.args.length===1&&Je(e.args[0])&&"-+~".includes(e.op)}function Vo(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function zt(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function so(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function er(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function Fa(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function Cr(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function vt(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function Eb(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function Fb(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function Tr(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function Bu(e){return e&&e.constructor.prototype.isChain===!0||!1}function ar(e){var r=typeof e;return r==="object"?e===null?"null":Fe(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":r}var fr,Se=T(()=>{ta();fr=Array.isArray});function Pe(e){var r=typeof e;if(r==="number"||r==="bigint"||r==="string"||r==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(t){return Pe(t)});if(e instanceof Date)return new Date(e.valueOf());if(Fe(e))return e;if(Na(e))return $G(e,Pe);if(r==="function")return e;throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function $G(e,r){var t={};for(var o in e)Me(e,o)&&(t[o]=r(e[o]));return t}function _u(e,r){for(var t in r)Me(r,t)&&(e[t]=r[t]);return e}function Kt(e,r){var t,o,a;if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(o=0,a=e.length;o<a;o++)if(!Kt(e[o],r[o]))return!1;return!0}else{if(typeof e=="function")return e===r;if(e instanceof Object){if(Array.isArray(r)||!(r instanceof Object))return!1;for(t in e)if(!(t in r)||!Kt(e[t],r[t]))return!1;for(t in r)if(!(t in e))return!1;return!0}else return e===r}}function Bb(e,r,t){var o=!0,a;Object.defineProperty(e,r,{get:function(){return o&&(a=t(),o=!1),a},set:function(i){a=i,o=!1},configurable:!0,enumerable:!0})}function Me(e,r){return e&&Object.hasOwnProperty.call(e,r)}function _b(e,r){for(var t={},o=0;o<r.length;o++){var a=r[o],n=e[a];n!==void 0&&(t[a]=n)}return t}var lr=T(()=>{Se()});var Pb,kb,Lb=T(()=>{Pb=["Matrix","Array"],kb=["number","BigNumber","Fraction"]});var me,Td=T(()=>{Oa();vb();Lb();me=function(r){if(r)throw new Error(`The global config is readonly.
2
+ Please create a mathjs instance if you want to change the default configuration.
3
+ Example:
4
+
5
+ import { create, all } from 'mathjs';
6
+ const mathjs = create(all);
7
+ mathjs.config({ number: 'BigNumber' });
8
+ `);return Object.freeze(wd)};Pr(me,wd,{MATRIX_OPTIONS:Pb,NUMBER_OPTIONS:kb})});var Ad=Ir((bd,Dd)=>{(function(e,r){typeof bd=="object"&&typeof Dd<"u"?Dd.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e["'typed'"]=r())})(bd,function(){"use strict";function e(){return!0}function r(){return!1}function t(){}let o="Argument is not a typed-function.";function a(){function i(Z){return typeof Z=="object"&&Z!==null&&Z.constructor===Object}let u=[{name:"number",test:function(Z){return typeof Z=="number"}},{name:"string",test:function(Z){return typeof Z=="string"}},{name:"boolean",test:function(Z){return typeof Z=="boolean"}},{name:"Function",test:function(Z){return typeof Z=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(Z){return Z instanceof Date}},{name:"RegExp",test:function(Z){return Z instanceof RegExp}},{name:"Object",test:i},{name:"null",test:function(Z){return Z===null}},{name:"undefined",test:function(Z){return Z===void 0}}],l={name:"any",test:e,isAny:!0},f,s,d=0,m={createCount:0};function p(Z){let ae=f.get(Z);if(ae)return ae;let fe='Unknown type "'+Z+'"',ve=Z.toLowerCase(),ge;for(ge of s)if(ge.toLowerCase()===ve){fe+='. Did you mean "'+ge+'" ?';break}throw new TypeError(fe)}function x(Z){let ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",fe=ae?p(ae).index:s.length,ve=[];for(let pe=0;pe<Z.length;++pe){if(!Z[pe]||typeof Z[pe].name!="string"||typeof Z[pe].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");let Re=Z[pe].name;if(f.has(Re))throw new TypeError('Duplicate type name "'+Re+'"');ve.push(Re),f.set(Re,{name:Re,test:Z[pe].test,isAny:Z[pe].isAny,index:fe+pe,conversionsTo:[]})}let ge=s.slice(fe);s=s.slice(0,fe).concat(ve).concat(ge);for(let pe=fe+ve.length;pe<s.length;++pe)f.get(s[pe]).index=pe}function c(){f=new Map,s=[],d=0,x([l],!1)}c(),x(u);function v(){let Z;for(Z of s)f.get(Z).conversionsTo=[];d=0}function y(Z){let ae=s.filter(fe=>{let ve=f.get(fe);return!ve.isAny&&ve.test(Z)});return ae.length?ae:["any"]}function b(Z){return Z&&typeof Z=="function"&&"_typedFunctionData"in Z}function h(Z,ae,fe){if(!b(Z))throw new TypeError(o);let ve=fe&&fe.exact,ge=Array.isArray(ae)?ae.join(","):ae,pe=N(ge),Re=g(pe);if(!ve||Re in Z.signatures){let xe=Z._typedFunctionData.signatureMap.get(Re);if(xe)return xe}let M=pe.length,H;if(ve){H=[];let xe;for(xe in Z.signatures)H.push(Z._typedFunctionData.signatureMap.get(xe))}else H=Z._typedFunctionData.signatures;for(let xe=0;xe<M;++xe){let Be=pe[xe],Le=[],Mr;for(Mr of H){let mt=P(Mr.params,xe);if(!(!mt||Be.restParam&&!mt.restParam)){if(!mt.hasAny){let Oo=D(mt);if(Be.types.some(Co=>!Oo.has(Co.name)))continue}Le.push(Mr)}}if(H=Le,H.length===0)break}let X;for(X of H)if(X.params.length<=M)return X;throw new TypeError("Signature not found (signature: "+(Z.name||"unnamed")+"("+g(pe,", ")+"))")}function S(Z,ae,fe){return h(Z,ae,fe).implementation}function w(Z,ae){let fe=p(ae);if(fe.test(Z))return Z;let ve=fe.conversionsTo;if(ve.length===0)throw new Error("There are no conversions to "+ae+" defined.");for(let ge=0;ge<ve.length;ge++)if(p(ve[ge].from).test(Z))return ve[ge].convert(Z);throw new Error("Cannot convert "+Z+" to "+ae)}function g(Z){let ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return Z.map(fe=>fe.name).join(ae)}function A(Z){let ae=Z.indexOf("...")===0,ve=(ae?Z.length>3?Z.slice(3):"any":Z).split("|").map(M=>p(M.trim())),ge=!1,pe=ae?"...":"";return{types:ve.map(function(M){return ge=M.isAny||ge,pe+=M.name+"|",{name:M.name,typeIndex:M.index,test:M.test,isAny:M.isAny,conversion:null,conversionIndex:-1}}),name:pe.slice(0,-1),hasAny:ge,hasConversion:!1,restParam:ae}}function C(Z){let ae=Z.types.map(Re=>Re.name),fe=z(ae),ve=Z.hasAny,ge=Z.name,pe=fe.map(function(Re){let M=p(Re.from);return ve=M.isAny||ve,ge+="|"+Re.from,{name:Re.from,typeIndex:M.index,test:M.test,isAny:M.isAny,conversion:Re,conversionIndex:Re.index}});return{types:Z.types.concat(pe),name:ge,hasAny:ve,hasConversion:pe.length>0,restParam:Z.restParam}}function D(Z){return Z.typeSet||(Z.typeSet=new Set,Z.types.forEach(ae=>Z.typeSet.add(ae.name))),Z.typeSet}function N(Z){let ae=[];if(typeof Z!="string")throw new TypeError("Signatures must be strings");let fe=Z.trim();if(fe==="")return ae;let ve=fe.split(",");for(let ge=0;ge<ve.length;++ge){let pe=A(ve[ge].trim());if(pe.restParam&&ge!==ve.length-1)throw new SyntaxError('Unexpected rest parameter "'+ve[ge]+'": only allowed for the last parameter');if(pe.types.length===0)return null;ae.push(pe)}return ae}function E(Z){let ae=q(Z);return ae?ae.restParam:!1}function _(Z){if(!Z||Z.types.length===0)return e;if(Z.types.length===1)return p(Z.types[0].name).test;if(Z.types.length===2){let ae=p(Z.types[0].name).test,fe=p(Z.types[1].name).test;return function(ge){return ae(ge)||fe(ge)}}else{let ae=Z.types.map(function(fe){return p(fe.name).test});return function(ve){for(let ge=0;ge<ae.length;ge++)if(ae[ge](ve))return!0;return!1}}}function L(Z){let ae,fe,ve;if(E(Z)){ae=se(Z).map(_);let ge=ae.length,pe=_(q(Z)),Re=function(M){for(let H=ge;H<M.length;H++)if(!pe(M[H]))return!1;return!0};return function(H){for(let X=0;X<ae.length;X++)if(!ae[X](H[X]))return!1;return Re(H)&&H.length>=ge+1}}else return Z.length===0?function(pe){return pe.length===0}:Z.length===1?(fe=_(Z[0]),function(pe){return fe(pe[0])&&pe.length===1}):Z.length===2?(fe=_(Z[0]),ve=_(Z[1]),function(pe){return fe(pe[0])&&ve(pe[1])&&pe.length===2}):(ae=Z.map(_),function(pe){for(let Re=0;Re<ae.length;Re++)if(!ae[Re](pe[Re]))return!1;return pe.length===ae.length})}function P(Z,ae){return ae<Z.length?Z[ae]:E(Z)?q(Z):null}function k(Z,ae){let fe=P(Z,ae);return fe?D(fe):new Set}function R(Z){return Z.conversion===null||Z.conversion===void 0}function F(Z,ae){let fe=new Set;return Z.forEach(ve=>{let ge=k(ve.params,ae),pe;for(pe of ge)fe.add(pe)}),fe.has("any")?["any"]:Array.from(fe)}function I(Z,ae,fe){let ve,ge,pe=Z||"unnamed",Re=fe,M;for(M=0;M<ae.length;M++){let Be=[];if(Re.forEach(Le=>{let Mr=P(Le.params,M),mt=_(Mr);(M<Le.params.length||E(Le.params))&&mt(ae[M])&&Be.push(Le)}),Be.length===0){if(ge=F(Re,M),ge.length>0){let Le=y(ae[M]);return ve=new TypeError("Unexpected type of argument in function "+pe+" (expected: "+ge.join(" or ")+", actual: "+Le.join(" | ")+", index: "+M+")"),ve.data={category:"wrongType",fn:pe,index:M,actual:Le,expected:ge},ve}}else Re=Be}let H=Re.map(function(Be){return E(Be.params)?1/0:Be.params.length});if(ae.length<Math.min.apply(null,H))return ge=F(Re,M),ve=new TypeError("Too few arguments in function "+pe+" (expected: "+ge.join(" or ")+", index: "+ae.length+")"),ve.data={category:"tooFewArgs",fn:pe,index:ae.length,expected:ge},ve;let X=Math.max.apply(null,H);if(ae.length>X)return ve=new TypeError("Too many arguments in function "+pe+" (expected: "+X+", actual: "+ae.length+")"),ve.data={category:"tooManyArgs",fn:pe,index:ae.length,expectedLength:X},ve;let xe=[];for(let Be=0;Be<ae.length;++Be)xe.push(y(ae[Be]).join("|"));return ve=new TypeError('Arguments of type "'+xe.join(", ")+'" do not match any of the defined signatures of function '+pe+"."),ve.data={category:"mismatch",actual:xe},ve}function B(Z){let ae=s.length+1;for(let fe=0;fe<Z.types.length;fe++)R(Z.types[fe])&&(ae=Math.min(ae,Z.types[fe].typeIndex));return ae}function V(Z){let ae=d+1;for(let fe=0;fe<Z.types.length;fe++)R(Z.types[fe])||(ae=Math.min(ae,Z.types[fe].conversionIndex));return ae}function J(Z,ae){if(Z.hasAny){if(!ae.hasAny)return 1}else if(ae.hasAny)return-1;if(Z.restParam){if(!ae.restParam)return 1}else if(ae.restParam)return-1;if(Z.hasConversion){if(!ae.hasConversion)return 1}else if(ae.hasConversion)return-1;let fe=B(Z)-B(ae);if(fe<0)return-1;if(fe>0)return 1;let ve=V(Z)-V(ae);return ve<0?-1:ve>0?1:0}function K(Z,ae){let fe=Z.params,ve=ae.params,ge=q(fe),pe=q(ve),Re=E(fe),M=E(ve);if(Re&&ge.hasAny){if(!M||!pe.hasAny)return 1}else if(M&&pe.hasAny)return-1;let H=0,X=0,xe;for(xe of fe)xe.hasAny&&++H,xe.hasConversion&&++X;let Be=0,Le=0;for(xe of ve)xe.hasAny&&++Be,xe.hasConversion&&++Le;if(H!==Be)return H-Be;if(Re&&ge.hasConversion){if(!M||!pe.hasConversion)return 1}else if(M&&pe.hasConversion)return-1;if(X!==Le)return X-Le;if(Re){if(!M)return 1}else if(M)return-1;let Mr=(fe.length-ve.length)*(Re?-1:1);if(Mr!==0)return Mr;let mt=[],Oo=0;for(let In=0;In<fe.length;++In){let mu=J(fe[In],ve[In]);mt.push(mu),Oo+=mu}if(Oo!==0)return Oo;let Co;for(Co of mt)if(Co!==0)return Co;return 0}function z(Z){if(Z.length===0)return[];let ae=Z.map(p);Z.length>1&&ae.sort((ge,pe)=>ge.index-pe.index);let fe=ae[0].conversionsTo;if(Z.length===1)return fe;fe=fe.concat([]);let ve=new Set(Z);for(let ge=1;ge<ae.length;++ge){let pe;for(pe of ae[ge].conversionsTo)ve.has(pe.from)||(fe.push(pe),ve.add(pe.from))}return fe}function j(Z,ae){let fe=ae;if(Z.some(ge=>ge.hasConversion)){let ge=E(Z),pe=Z.map(ue);fe=function(){let M=[],H=ge?arguments.length-1:arguments.length;for(let X=0;X<H;X++)M[X]=pe[X](arguments[X]);return ge&&(M[H]=arguments[H].map(pe[H])),ae.apply(this,M)}}let ve=fe;if(E(Z)){let ge=Z.length-1;ve=function(){return fe.apply(this,G(arguments,0,ge).concat([G(arguments,ge)]))}}return ve}function ue(Z){let ae,fe,ve,ge,pe=[],Re=[];switch(Z.types.forEach(function(M){M.conversion&&(pe.push(p(M.conversion.from).test),Re.push(M.conversion.convert))}),Re.length){case 0:return function(H){return H};case 1:return ae=pe[0],ve=Re[0],function(H){return ae(H)?ve(H):H};case 2:return ae=pe[0],fe=pe[1],ve=Re[0],ge=Re[1],function(H){return ae(H)?ve(H):fe(H)?ge(H):H};default:return function(H){for(let X=0;X<Re.length;X++)if(pe[X](H))return Re[X](H);return H}}}function ee(Z){function ae(fe,ve,ge){if(ve<fe.length){let pe=fe[ve],Re=[];if(pe.restParam){let M=pe.types.filter(R);M.length<pe.types.length&&Re.push({types:M,name:"..."+M.map(H=>H.name).join("|"),hasAny:M.some(H=>H.isAny),hasConversion:!1,restParam:!0}),Re.push(pe)}else Re=pe.types.map(function(M){return{types:[M],name:M.name,hasAny:M.isAny,hasConversion:M.conversion,restParam:!1}});return ie(Re,function(M){return ae(fe,ve+1,ge.concat([M]))})}else return[ge]}return ae(Z,0,[])}function ne(Z,ae){let fe=Math.max(Z.length,ae.length);for(let M=0;M<fe;M++){let H=k(Z,M),X=k(ae,M),xe=!1,Be;for(Be of X)if(H.has(Be)){xe=!0;break}if(!xe)return!1}let ve=Z.length,ge=ae.length,pe=E(Z),Re=E(ae);return pe?Re?ve===ge:ge>=ve:Re?ve>=ge:ve===ge}function $(Z){return Z.map(ae=>Xe(ae)?De(ae.referToSelf.callback):Ne(ae)?he(ae.referTo.references,ae.referTo.callback):ae)}function W(Z,ae,fe){let ve=[],ge;for(ge of Z){let pe=fe[ge];if(typeof pe!="number")throw new TypeError('No definition for referenced signature "'+ge+'"');if(pe=ae[pe],typeof pe!="function")return!1;ve.push(pe)}return ve}function Y(Z,ae,fe){let ve=$(Z),ge=new Array(ve.length).fill(!1),pe=!0;for(;pe;){pe=!1;let Re=!0;for(let M=0;M<ve.length;++M){if(ge[M])continue;let H=ve[M];if(Xe(H))ve[M]=H.referToSelf.callback(fe),ve[M].referToSelf=H.referToSelf,ge[M]=!0,Re=!1;else if(Ne(H)){let X=W(H.referTo.references,ve,ae);X?(ve[M]=H.referTo.callback.apply(this,X),ve[M].referTo=H.referTo,ge[M]=!0,Re=!1):pe=!0}}if(Re&&pe)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return ve}function oe(Z){let ae=/\bthis(\(|\.signatures\b)/;Object.keys(Z).forEach(fe=>{let ve=Z[fe];if(ae.test(ve.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function re(Z,ae){if(m.createCount++,Object.keys(ae).length===0)throw new SyntaxError("No signatures provided");m.warnAgainstDeprecatedThis&&oe(ae);let fe=[],ve=[],ge={},pe=[],Re;for(Re in ae){if(!Object.prototype.hasOwnProperty.call(ae,Re))continue;let Or=N(Re);if(!Or)continue;fe.forEach(function(Li){if(ne(Li,Or))throw new TypeError('Conflicting signatures "'+g(Li)+'" and "'+g(Or)+'".')}),fe.push(Or);let Vt=ve.length;ve.push(ae[Re]);let yV=Or.map(C),cu;for(cu of ee(yV)){let Li=g(cu);pe.push({params:cu,name:Li,fn:Vt}),cu.every(SV=>!SV.hasConversion)&&(ge[Li]=Vt)}}pe.sort(K);let M=Y(ve,ge,ki),H;for(H in ge)Object.prototype.hasOwnProperty.call(ge,H)&&(ge[H]=M[ge[H]]);let X=[],xe=new Map;for(H of pe)xe.has(H.name)||(H.fn=M[H.fn],X.push(H),xe.set(H.name,H));let Be=X[0]&&X[0].params.length<=2&&!E(X[0].params),Le=X[1]&&X[1].params.length<=2&&!E(X[1].params),Mr=X[2]&&X[2].params.length<=2&&!E(X[2].params),mt=X[3]&&X[3].params.length<=2&&!E(X[3].params),Oo=X[4]&&X[4].params.length<=2&&!E(X[4].params),Co=X[5]&&X[5].params.length<=2&&!E(X[5].params),In=Be&&Le&&Mr&&mt&&Oo&&Co;for(let Or=0;Or<X.length;++Or)X[Or].test=L(X[Or].params);let mu=Be?_(X[0].params[0]):r,GW=Le?_(X[1].params[0]):r,$W=Mr?_(X[2].params[0]):r,KW=mt?_(X[3].params[0]):r,QW=Oo?_(X[4].params[0]):r,ZW=Co?_(X[5].params[0]):r,YW=Be?_(X[0].params[1]):r,XW=Le?_(X[1].params[1]):r,JW=Mr?_(X[2].params[1]):r,jW=mt?_(X[3].params[1]):r,eV=Oo?_(X[4].params[1]):r,rV=Co?_(X[5].params[1]):r;for(let Or=0;Or<X.length;++Or)X[Or].implementation=j(X[Or].params,X[Or].fn);let tV=Be?X[0].implementation:t,oV=Le?X[1].implementation:t,aV=Mr?X[2].implementation:t,nV=mt?X[3].implementation:t,iV=Oo?X[4].implementation:t,fV=Co?X[5].implementation:t,uV=Be?X[0].params.length:-1,sV=Le?X[1].params.length:-1,lV=Mr?X[2].params.length:-1,dV=mt?X[3].params.length:-1,pV=Oo?X[4].params.length:-1,mV=Co?X[5].params.length:-1,cV=In?6:0,xV=X.length,hV=X.map(Or=>Or.test),vV=X.map(Or=>Or.implementation),gV=function(){for(let Vt=cV;Vt<xV;Vt++)if(hV[Vt](arguments))return vV[Vt].apply(this,arguments);return m.onMismatch(Z,arguments,X)};function ki(Or,Vt){return arguments.length===uV&&mu(Or)&&YW(Vt)?tV.apply(this,arguments):arguments.length===sV&&GW(Or)&&XW(Vt)?oV.apply(this,arguments):arguments.length===lV&&$W(Or)&&JW(Vt)?aV.apply(this,arguments):arguments.length===dV&&KW(Or)&&jW(Vt)?nV.apply(this,arguments):arguments.length===pV&&QW(Or)&&eV(Vt)?iV.apply(this,arguments):arguments.length===mV&&ZW(Or)&&rV(Vt)?fV.apply(this,arguments):gV.apply(this,arguments)}try{Object.defineProperty(ki,"name",{value:Z})}catch{}return ki.signatures=ge,ki._typedFunctionData={signatures:X,signatureMap:xe},ki}function le(Z,ae,fe){throw I(Z,ae,fe)}function se(Z){return G(Z,0,Z.length-1)}function q(Z){return Z[Z.length-1]}function G(Z,ae,fe){return Array.prototype.slice.call(Z,ae,fe)}function te(Z,ae){for(let fe=0;fe<Z.length;fe++)if(ae(Z[fe]))return Z[fe]}function ie(Z,ae){return Array.prototype.concat.apply([],Z.map(ae))}function de(){let Z=se(arguments).map(fe=>g(N(fe))),ae=q(arguments);if(typeof ae!="function")throw new TypeError("Callback function expected as last argument");return he(Z,ae)}function he(Z,ae){return{referTo:{references:Z,callback:ae}}}function De(Z){if(typeof Z!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:Z}}}function Ne(Z){return Z&&typeof Z.referTo=="object"&&Array.isArray(Z.referTo.references)&&typeof Z.referTo.callback=="function"}function Xe(Z){return Z&&typeof Z.referToSelf=="object"&&typeof Z.referToSelf.callback=="function"}function qe(Z,ae){if(!Z)return ae;if(ae&&ae!==Z){let fe=new Error("Function names do not match (expected: "+Z+", actual: "+ae+")");throw fe.data={actual:ae,expected:Z},fe}return Z}function yr(Z){let ae;for(let fe in Z)Object.prototype.hasOwnProperty.call(Z,fe)&&(b(Z[fe])||typeof Z[fe].signature=="string")&&(ae=qe(ae,Z[fe].name));return ae}function xr(Z,ae){let fe;for(fe in ae)if(Object.prototype.hasOwnProperty.call(ae,fe)){if(fe in Z&&ae[fe]!==Z[fe]){let ve=new Error('Signature "'+fe+'" is defined twice');throw ve.data={signature:fe,sourceFunction:ae[fe],destFunction:Z[fe]},ve}Z[fe]=ae[fe]}}let kr=m;m=function(Z){let ae=typeof Z=="string",fe=ae?1:0,ve=ae?Z:"",ge={};for(let pe=fe;pe<arguments.length;++pe){let Re=arguments[pe],M={},H;if(typeof Re=="function"?(H=Re.name,typeof Re.signature=="string"?M[Re.signature]=Re:b(Re)&&(M=Re.signatures)):i(Re)&&(M=Re,ae||(H=yr(Re))),Object.keys(M).length===0){let X=new TypeError("Argument to 'typed' at index "+pe+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw X.data={index:pe,argument:Re},X}ae||(ve=qe(ve,H)),xr(ge,M)}return re(ve||"",ge)},m.create=a,m.createCount=kr.createCount,m.onMismatch=le,m.throwMismatchError=le,m.createError=I,m.clear=c,m.clearConversions=v,m.addTypes=x,m._findType=p,m.referTo=de,m.referToSelf=De,m.convert=w,m.findSignature=h,m.find=S,m.isTypedFunction=b,m.warnAgainstDeprecatedThis=!0,m.addType=function(Z,ae){let fe="any";ae!==!1&&f.has("Object")&&(fe="Object"),m.addTypes([Z],fe)};function Yr(Z){if(!Z||typeof Z.from!="string"||typeof Z.to!="string"||typeof Z.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(Z.to===Z.from)throw new SyntaxError('Illegal to define conversion from "'+Z.from+'" to itself.')}return m.addConversion=function(Z){let ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};Yr(Z);let fe=p(Z.to),ve=fe.conversionsTo.find(ge=>ge.from===Z.from);if(ve)if(ae&&ae.override)m.removeConversion({from:ve.from,to:Z.to,convert:ve.convert});else throw new Error('There is already a conversion from "'+Z.from+'" to "'+fe.name+'"');fe.conversionsTo.push({from:Z.from,convert:Z.convert,index:d++})},m.addConversions=function(Z,ae){Z.forEach(fe=>m.addConversion(fe,ae))},m.removeConversion=function(Z){Yr(Z);let ae=p(Z.to),fe=te(ae.conversionsTo,ge=>ge.from===Z.from);if(!fe)throw new Error("Attempt to remove nonexistent conversion from "+Z.from+" to "+Z.to);if(fe.convert!==Z.convert)throw new Error("Conversion to remove does not match existing conversion");let ve=ae.conversionsTo.indexOf(fe);ae.conversionsTo.splice(ve,1)},m.resolve=function(Z,ae){if(!b(Z))throw new TypeError(o);let fe=Z._typedFunctionData.signatures;for(let ve=0;ve<fe.length;++ve)if(fe[ve].test(ae))return fe[ve];return null},m}var n=a();return n})});function O(e,r,t,o){function a(n){var i=_b(n,r.map(ZG));return KG(e,r,n),t(i)}return a.isFactory=!0,a.fn=e,a.dependencies=r.slice().sort(),o&&(a.meta=o),a}function KG(e,r,t){var o=r.filter(n=>!QG(n)).every(n=>t[n]!==void 0);if(!o){var a=r.filter(n=>t[n]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(a.map(n=>'"'.concat(n,'"')).join(", "),"."))}}function QG(e){return e&&e[0]==="?"}function ZG(e){return e&&e[0]==="?"?e.slice(1):e}var U=T(()=>{lr()});function be(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}function Dt(e,r){if(r.number==="bigint")try{BigInt(e)}catch{return r.numberFallback}return r.number}function Od(e,r,t){var o={2:"0b",8:"0o",16:"0x"},a=o[r],n="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!be(t))throw new Error("size must be an integer");if(e>2**(t-1)-1||e<-(2**(t-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!be(e))throw new Error("Value must be an integer");e<0&&(e=e+2**t),n="i".concat(t)}var i="";return e<0&&(e=-e,i="-"),"".concat(i).concat(a).concat(e.toString(r)).concat(n)}function Eo(e,r){if(typeof r=="function")return r(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:t,precision:o,wordSize:a}=Cd(r);switch(t){case"fixed":return Rd(e,o);case"exponential":return Vb(e,o);case"engineering":return YG(e,o);case"bin":return Od(e,2,a);case"oct":return Od(e,8,a);case"hex":return Od(e,16,a);case"auto":return XG(e,o,r).replace(/((\.\d*?)(0+))($|e)/,function(){var n=arguments[2],i=arguments[4];return n!=="."?n+i:i});default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Cd(e){var r="auto",t,o;if(e!==void 0)if(ke(e))t=e;else if(Fe(e))t=e.toNumber();else if(Na(e))e.precision!==void 0&&(t=Ib(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(o=Ib(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(r=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:r,precision:t,wordSize:o}}function Vn(e){var r=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!r)throw new SyntaxError("Invalid number "+e);var t=r[1],o=r[2],a=parseFloat(r[4]||"0"),n=o.indexOf(".");a+=n!==-1?n-1:o.length-1;var i=o.replace(".","").replace(/^0*/,function(u){return a-=u.length,""}).replace(/0*$/,"").split("").map(function(u){return parseInt(u)});return i.length===0&&(i.push(0),a++),{sign:t,coefficients:i,exponent:a}}function YG(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Vn(e),o=ku(t,r),a=o.exponent,n=o.coefficients,i=a%3===0?a:a<0?a-3-a%3:a-a%3;if(ke(r))for(;r>n.length||a-i+1>n.length;)n.push(0);else for(var u=Math.abs(a-i)-(n.length-1),l=0;l<u;l++)n.push(0);for(var f=Math.abs(a-i),s=1;f>0;)s++,f--;var d=n.slice(s).join(""),m=ke(r)&&d.length||d.match(/[1-9]/)?"."+d:"",p=n.slice(0,s).join("")+m+"e"+(a>=0?"+":"")+i.toString();return o.sign+p}function Rd(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Vn(e),o=typeof r=="number"?ku(t,t.exponent+1+r):t,a=o.coefficients,n=o.exponent+1,i=n+(r||0);return a.length<i&&(a=a.concat(Wn(i-a.length))),n<0&&(a=Wn(-n+1).concat(a),n=1),n<a.length&&a.splice(n,0,n===0?"0.":"."),o.sign+a.join("")}function Vb(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Vn(e),o=r?ku(t,r):t,a=o.coefficients,n=o.exponent;a.length<r&&(a=a.concat(Wn(r-a.length)));var i=a.shift();return o.sign+i+(a.length>0?"."+a.join(""):"")+"e"+(n>=0?"+":"")+n}function XG(e,r,t){if(isNaN(e)||!isFinite(e))return String(e);var o=zb(t?.lowerExp,-3),a=zb(t?.upperExp,5),n=Vn(e),i=r?ku(n,r):n;if(i.exponent<o||i.exponent>=a)return Vb(e,r);var u=i.coefficients,l=i.exponent;u.length<r&&(u=u.concat(Wn(r-u.length))),u=u.concat(Wn(l-u.length+1+(u.length<r?r-u.length:0))),u=Wn(-l).concat(u);var f=l>0?l:0;return f<u.length-1&&u.splice(f+1,0,"."),i.sign+u.join("")}function ku(e,r){for(var t={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},o=t.coefficients;r<=0;)o.unshift(0),t.exponent++,r++;if(o.length>r){var a=o.splice(r,o.length-r);if(a[0]>=5){var n=r-1;for(o[n]++;o[n]===10;)o.pop(),n===0&&(o.unshift(0),t.exponent++,n++),n--,o[n]++}}return t}function Wn(e){for(var r=[],t=0;t<e;t++)r.push(0);return r}function Gb(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}function Rr(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-8,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(t<=0)throw new Error("Relative tolerance must be greater than 0");if(o<0)throw new Error("Absolute tolerance must be at least 0");return isNaN(e)||isNaN(r)?!1:!isFinite(e)||!isFinite(r)?e===r:e===r?!0:Math.abs(e-r)<=Math.max(t*Math.max(Math.abs(e),Math.abs(r)),o)}function Yb(e,r){var t=e>0?!0:e<0?!1:1/e===1/0,o=r>0?!0:r<0?!1:1/r===1/0;return t^o?-e:e}function Ib(e,r){if(ke(e))return e;if(Fe(e))return e.toNumber();r()}function zb(e,r){return ke(e)?e:Fe(e)?e.toNumber():r}var lo,qb,Ub,Pu,Hb,Wb,$b,Kb,Qb,Lu,Zb,Iu,He=T(()=>{Se();lo=Math.sign||function(e){return e>0?1:e<0?-1:0},qb=Math.log2||function(r){return Math.log(r)/Math.LN2},Ub=Math.log10||function(r){return Math.log(r)/Math.LN10},Pu=Math.log1p||function(e){return Math.log(e+1)},Hb=Math.cbrt||function(r){if(r===0)return r;var t=r<0,o;return t&&(r=-r),isFinite(r)?(o=Math.exp(Math.log(r)/3),o=(r/(o*o)+2*o)/3):o=r,t?-o:o},Wb=Math.expm1||function(r){return r>=2e-4||r<=-2e-4?Math.exp(r)-1:r+r*r/2+r*r*r/6};$b=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},Kb=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},Qb=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},Lu=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},Zb=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},Iu=Math.tanh||function(e){var r=Math.exp(2*e);return(r-1)/(r+1)}});function zu(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function qu(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function jG(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Uu(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var Nd,Xb,JG,Md,Jb=T(()=>{Nd=hr(Ad(),1);U();Se();He();Xb=function(){return Xb=Nd.default.create,Nd.default},JG=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],Md=O("typed",JG,function(r){var{BigNumber:t,Complex:o,DenseMatrix:a,Fraction:n}=r,i=Xb();return i.clear(),i.addTypes([{name:"number",test:ke},{name:"Complex",test:It},{name:"BigNumber",test:Fe},{name:"bigint",test:Ma},{name:"Fraction",test:oa},{name:"Unit",test:xt},{name:"identifier",test:u=>zr&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(u)},{name:"string",test:zr},{name:"Chain",test:Bu},{name:"Array",test:fr},{name:"Matrix",test:Ae},{name:"DenseMatrix",test:ln},{name:"SparseMatrix",test:Mo},{name:"Range",test:Hn},{name:"Index",test:Ea},{name:"boolean",test:wb},{name:"ResultSet",test:Tb},{name:"Help",test:Fu},{name:"function",test:bb},{name:"Date",test:Db},{name:"RegExp",test:Ab},{name:"null",test:Ob},{name:"undefined",test:Cb},{name:"AccessorNode",test:eo},{name:"ArrayNode",test:ht},{name:"AssignmentNode",test:Rb},{name:"BlockNode",test:Nb},{name:"ConditionalNode",test:Mb},{name:"ConstantNode",test:Je},{name:"FunctionNode",test:zt},{name:"FunctionAssignmentNode",test:Vo},{name:"IndexNode",test:so},{name:"Node",test:er},{name:"ObjectNode",test:Fa},{name:"OperatorNode",test:Cr},{name:"ParenthesisNode",test:vt},{name:"RangeNode",test:Eb},{name:"RelationalNode",test:Fb},{name:"SymbolNode",test:Tr},{name:"Map",test:Eu},{name:"Object",test:Na}]),i.addConversions([{from:"number",to:"BigNumber",convert:function(l){if(t||zu(l),Gb(l)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+l+"). Use function bignumber(x) to convert to BigNumber.");return new t(l)}},{from:"number",to:"Complex",convert:function(l){return o||qu(l),new o(l,0)}},{from:"BigNumber",to:"Complex",convert:function(l){return o||qu(l),new o(l.toNumber(),0)}},{from:"bigint",to:"number",convert:function(l){if(l>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+l+")");return Number(l)}},{from:"bigint",to:"BigNumber",convert:function(l){return t||zu(l),new t(l.toString())}},{from:"bigint",to:"Fraction",convert:function(l){return n||Uu(l),new n(l)}},{from:"Fraction",to:"BigNumber",convert:function(l){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(l){return o||qu(l),new o(l.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(l){n||Uu(l);var f=new n(l);if(f.valueOf()!==l)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+l+"). Use function fraction(x) to convert to Fraction.");return f}},{from:"string",to:"number",convert:function(l){var f=Number(l);if(isNaN(f))throw new Error('Cannot convert "'+l+'" to a number');return f}},{from:"string",to:"BigNumber",convert:function(l){t||zu(l);try{return new t(l)}catch{throw new Error('Cannot convert "'+l+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(l){try{return BigInt(l)}catch{throw new Error('Cannot convert "'+l+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(l){n||Uu(l);try{return new n(l)}catch{throw new Error('Cannot convert "'+l+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(l){o||qu(l);try{return new o(l)}catch{throw new Error('Cannot convert "'+l+'" to Complex')}}},{from:"boolean",to:"number",convert:function(l){return+l}},{from:"boolean",to:"BigNumber",convert:function(l){return t||zu(l),new t(+l)}},{from:"boolean",to:"bigint",convert:function(l){return BigInt(+l)}},{from:"boolean",to:"Fraction",convert:function(l){return n||Uu(l),new n(+l)}},{from:"boolean",to:"string",convert:function(l){return String(l)}},{from:"Array",to:"Matrix",convert:function(l){return a||jG(),new a(l)}},{from:"Matrix",to:"Array",convert:function(l){return l.valueOf()}}]),i.onMismatch=(u,l,f)=>{var s=i.createError(u,l,f);if(["wrongType","mismatch"].includes(s.data.category)&&l.length===1&&Wr(l[0])&&f.some(m=>!m.params.includes(","))){var d=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw d.data=s.data,d}throw s},i.onMismatch=(u,l,f)=>{var s=i.createError(u,l,f);if(["wrongType","mismatch"].includes(s.data.category)&&l.length===1&&Wr(l[0])&&f.some(m=>!m.params.includes(","))){var d=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw d.data=s.data,d}throw s},i})});var e$,r$,Ed,jb=T(()=>{U();e$="ResultSet",r$=[],Ed=O(e$,r$,()=>{function e(r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=r||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.map(String).join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(r){return new e(r.entries)},e},{isClass:!0})});function gt(e){var r,t,o,a=e.length-1,n="",i=e[0];if(a>0){for(n+=i,r=1;r<a;r++)o=e[r]+"",t=Ze-o.length,t&&(n+=Ba(t)),n+=o;i=e[r],o=i+"",t=Ze-o.length,t&&(n+=Ba(t))}else if(i===0)return"0";for(;i%10===0;)i/=10;return n+i}function Qt(e,r,t){if(e!==~~e||e<r||e>t)throw Error(Pa+e)}function ef(e,r,t,o){var a,n,i,u;for(n=e[0];n>=10;n/=10)--r;return--r<0?(r+=Ze,a=0):(a=Math.ceil((r+1)/Ze),r%=Ze),n=rt(10,Ze-r),u=e[a]%n|0,o==null?r<3?(r==0?u=u/100|0:r==1&&(u=u/10|0),i=t<4&&u==99999||t>3&&u==49999||u==5e4||u==0):i=(t<4&&u+1==n||t>3&&u+1==n/2)&&(e[a+1]/n/100|0)==rt(10,r-2)-1||(u==n/2||u==0)&&(e[a+1]/n/100|0)==0:r<4?(r==0?u=u/1e3|0:r==1?u=u/100|0:r==2&&(u=u/10|0),i=(o||t<4)&&u==9999||!o&&t>3&&u==4999):i=((o||t<4)&&u+1==n||!o&&t>3&&u+1==n/2)&&(e[a+1]/n/1e3|0)==rt(10,r-3)-1,i}function Hu(e,r,t){for(var o,a=[0],n,i=0,u=e.length;i<u;){for(n=a.length;n--;)a[n]*=r;for(a[0]+=Fd.indexOf(e.charAt(i++)),o=0;o<a.length;o++)a[o]>t-1&&(a[o+1]===void 0&&(a[o+1]=0),a[o+1]+=a[o]/t|0,a[o]%=t)}return a.reverse()}function f$(e,r){var t,o,a;if(r.isZero())return r;o=r.d.length,o<32?(t=Math.ceil(o/3),a=(1/Zu(4,t)).toString()):(t=16,a="2.3283064365386962890625e-10"),e.precision+=t,r=$n(e,1,r.times(a),new e(1));for(var n=t;n--;){var i=r.times(r);r=i.times(i).minus(i).times(8).plus(1)}return e.precision-=t,r}function We(e,r,t,o){var a,n,i,u,l,f,s,d,m,p=e.constructor;e:if(r!=null){if(d=e.d,!d)return e;for(a=1,u=d[0];u>=10;u/=10)a++;if(n=r-a,n<0)n+=Ze,i=r,s=d[m=0],l=s/rt(10,a-i-1)%10|0;else if(m=Math.ceil((n+1)/Ze),u=d.length,m>=u)if(o){for(;u++<=m;)d.push(0);s=l=0,a=1,n%=Ze,i=n-Ze+1}else break e;else{for(s=u=d[m],a=1;u>=10;u/=10)a++;n%=Ze,i=n-Ze+a,l=i<0?0:s/rt(10,a-i-1)%10|0}if(o=o||r<0||d[m+1]!==void 0||(i<0?s:s%rt(10,a-i-1)),f=t<4?(l||o)&&(t==0||t==(e.s<0?3:2)):l>5||l==5&&(t==4||o||t==6&&(n>0?i>0?s/rt(10,a-i):0:d[m-1])%10&1||t==(e.s<0?8:7)),r<1||!d[0])return d.length=0,f?(r-=e.e+1,d[0]=rt(10,(Ze-r%Ze)%Ze),e.e=-r||0):d[0]=e.e=0,e;if(n==0?(d.length=m,u=1,m--):(d.length=m+1,u=rt(10,Ze-n),d[m]=i>0?(s/rt(10,a-i)%rt(10,i)|0)*u:0),f)for(;;)if(m==0){for(n=1,i=d[0];i>=10;i/=10)n++;for(i=d[0]+=u,u=1;i>=10;i/=10)u++;n!=u&&(e.e++,d[0]==Fo&&(d[0]=1));break}else{if(d[m]+=u,d[m]!=Fo)break;d[m--]=0,u=1}for(n=d.length;d[--n]===0;)d.pop()}return rr&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function $o(e,r,t){if(!e.isFinite())return d1(e);var o,a=e.e,n=gt(e.d),i=n.length;return r?(t&&(o=t-i)>0?n=n.charAt(0)+"."+n.slice(1)+Ba(o):i>1&&(n=n.charAt(0)+"."+n.slice(1)),n=n+(e.e<0?"e":"e+")+e.e):a<0?(n="0."+Ba(-a-1)+n,t&&(o=t-i)>0&&(n+=Ba(o))):a>=i?(n+=Ba(a+1-i),t&&(o=t-a-1)>0&&(n=n+"."+Ba(o))):((o=a+1)<i&&(n=n.slice(0,o)+"."+n.slice(o)),t&&(o=t-i)>0&&(a+1===i&&(n+="."),n+=Ba(o))),n}function Qu(e,r){var t=e[0];for(r*=Ze;t>=10;t/=10)r++;return r}function $u(e,r,t){if(r>i$)throw rr=!0,t&&(e.precision=t),Error(a1);return We(new e(Vu),r,1,!0)}function Go(e,r,t){if(r>_d)throw Error(a1);return We(new e(Gu),r,t,!0)}function u1(e){var r=e.length-1,t=r*Ze+1;if(r=e[r],r){for(;r%10==0;r/=10)t--;for(r=e[0];r>=10;r/=10)t++}return t}function Ba(e){for(var r="";e--;)r+="0";return r}function s1(e,r,t,o){var a,n=new e(1),i=Math.ceil(o/Ze+4);for(rr=!1;;){if(t%2&&(n=n.times(r),r1(n.d,i)&&(a=!0)),t=At(t/2),t===0){t=n.d.length-1,a&&n.d[t]===0&&++n.d[t];break}r=r.times(r),r1(r.d,i)}return rr=!0,n}function e1(e){return e.d[e.d.length-1]&1}function l1(e,r,t){for(var o,a,n=new e(r[0]),i=0;++i<r.length;){if(a=new e(r[i]),!a.s){n=a;break}o=n.cmp(a),(o===t||o===0&&n.s===t)&&(n=a)}return n}function Pd(e,r){var t,o,a,n,i,u,l,f=0,s=0,d=0,m=e.constructor,p=m.rounding,x=m.precision;if(!e.d||!e.d[0]||e.e>17)return new m(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(r==null?(rr=!1,l=x):l=r,u=new m(.03125);e.e>-2;)e=e.times(u),d+=5;for(o=Math.log(rt(2,d))/Math.LN10*2+5|0,l+=o,t=n=i=new m(1),m.precision=l;;){if(n=We(n.times(e),l,1),t=t.times(++s),u=i.plus(_r(n,t,l,1)),gt(u.d).slice(0,l)===gt(i.d).slice(0,l)){for(a=d;a--;)i=We(i.times(i),l,1);if(r==null)if(f<3&&ef(i.d,l-o,p,f))m.precision=l+=10,t=n=u=new m(1),s=0,f++;else return We(i,m.precision=x,p,rr=!0);else return m.precision=x,i}i=u}}function _a(e,r){var t,o,a,n,i,u,l,f,s,d,m,p=1,x=10,c=e,v=c.d,y=c.constructor,b=y.rounding,h=y.precision;if(c.s<0||!v||!v[0]||!c.e&&v[0]==1&&v.length==1)return new y(v&&!v[0]?-1/0:c.s!=1?NaN:v?0:c);if(r==null?(rr=!1,s=h):s=r,y.precision=s+=x,t=gt(v),o=t.charAt(0),Math.abs(n=c.e)<15e14){for(;o<7&&o!=1||o==1&&t.charAt(1)>3;)c=c.times(e),t=gt(c.d),o=t.charAt(0),p++;n=c.e,o>1?(c=new y("0."+t),n++):c=new y(o+"."+t.slice(1))}else return f=$u(y,s+2,h).times(n+""),c=_a(new y(o+"."+t.slice(1)),s-x).plus(f),y.precision=h,r==null?We(c,h,b,rr=!0):c;for(d=c,l=i=c=_r(c.minus(1),c.plus(1),s,1),m=We(c.times(c),s,1),a=3;;){if(i=We(i.times(m),s,1),f=l.plus(_r(i,new y(a),s,1)),gt(f.d).slice(0,s)===gt(l.d).slice(0,s))if(l=l.times(2),n!==0&&(l=l.plus($u(y,s+2,h).times(n+""))),l=_r(l,new y(p),s,1),r==null)if(ef(l.d,s-x,b,u))y.precision=s+=x,f=i=c=_r(d.minus(1),d.plus(1),s,1),m=We(c.times(c),s,1),a=u=1;else return We(l,y.precision=h,b,rr=!0);else return y.precision=h,l;l=f,a+=2}}function d1(e){return String(e.s*e.s/0)}function Wu(e,r){var t,o,a;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(o=r.search(/e/i))>0?(t<0&&(t=o),t+=+r.slice(o+1),r=r.substring(0,o)):t<0&&(t=r.length),o=0;r.charCodeAt(o)===48;o++);for(a=r.length;r.charCodeAt(a-1)===48;--a);if(r=r.slice(o,a),r){if(a-=o,e.e=t=t-o-1,e.d=[],o=(t+1)%Ze,t<0&&(o+=Ze),o<a){for(o&&e.d.push(+r.slice(0,o)),a-=Ze;o<a;)e.d.push(+r.slice(o,o+=Ze));r=r.slice(o),o=Ze-r.length}else o-=a;for(;o--;)r+="0";e.d.push(+r),rr&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function u$(e,r){var t,o,a,n,i,u,l,f,s;if(r.indexOf("_")>-1){if(r=r.replace(/(\d)_(?=\d)/g,"$1"),f1.test(r))return Wu(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(o$.test(r))t=16,r=r.toLowerCase();else if(t$.test(r))t=2;else if(a$.test(r))t=8;else throw Error(Pa+r);for(n=r.search(/p/i),n>0?(l=+r.slice(n+1),r=r.substring(2,n)):r=r.slice(2),n=r.indexOf("."),i=n>=0,o=e.constructor,i&&(r=r.replace(".",""),u=r.length,n=u-n,a=s1(o,new o(t),n,n*2)),f=Hu(r,t,Fo),s=f.length-1,n=s;f[n]===0;--n)f.pop();return n<0?new o(e.s*0):(e.e=Qu(f,s),e.d=f,rr=!1,i&&(e=_r(e,a,u*4)),l&&(e=e.times(Math.abs(l)<54?rt(2,l):rf.pow(2,l))),rr=!0,e)}function s$(e,r){var t,o=r.d.length;if(o<3)return r.isZero()?r:$n(e,2,r,r);t=1.4*Math.sqrt(o),t=t>16?16:t|0,r=r.times(1/Zu(5,t)),r=$n(e,2,r,r);for(var a,n=new e(5),i=new e(16),u=new e(20);t--;)a=r.times(r),r=r.times(n.plus(a.times(i.times(a).minus(u))));return r}function $n(e,r,t,o,a){var n,i,u,l,f=1,s=e.precision,d=Math.ceil(s/Ze);for(rr=!1,l=t.times(t),u=new e(o);;){if(i=_r(u.times(l),new e(r++*r++),s,1),u=a?o.plus(i):o.minus(i),o=_r(i.times(l),new e(r++*r++),s,1),i=u.plus(o),i.d[d]!==void 0){for(n=d;i.d[n]===u.d[n]&&n--;);if(n==-1)break}n=u,u=o,o=i,i=n,f++}return rr=!0,i.d.length=d+1,i}function Zu(e,r){for(var t=e;--r;)t*=e;return t}function p1(e,r){var t,o=r.s<0,a=Go(e,e.precision,1),n=a.times(.5);if(r=r.abs(),r.lte(n))return aa=o?4:1,r;if(t=r.divToInt(a),t.isZero())aa=o?3:2;else{if(r=r.minus(t.times(a)),r.lte(n))return aa=e1(t)?o?2:3:o?4:1,r;aa=e1(t)?o?1:4:o?3:2}return r.minus(a).abs()}function kd(e,r,t,o){var a,n,i,u,l,f,s,d,m,p=e.constructor,x=t!==void 0;if(x?(Qt(t,1,ka),o===void 0?o=p.rounding:Qt(o,0,8)):(t=p.precision,o=p.rounding),!e.isFinite())s=d1(e);else{for(s=$o(e),i=s.indexOf("."),x?(a=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):a=r,i>=0&&(s=s.replace(".",""),m=new p(1),m.e=s.length-i,m.d=Hu($o(m),10,a),m.e=m.d.length),d=Hu(s,10,a),n=l=d.length;d[--l]==0;)d.pop();if(!d[0])s=x?"0p+0":"0";else{if(i<0?n--:(e=new p(e),e.d=d,e.e=n,e=_r(e,m,t,o,0,a),d=e.d,n=e.e,f=o1),i=d[t],u=a/2,f=f||d[t+1]!==void 0,f=o<4?(i!==void 0||f)&&(o===0||o===(e.s<0?3:2)):i>u||i===u&&(o===4||f||o===6&&d[t-1]&1||o===(e.s<0?8:7)),d.length=t,f)for(;++d[--t]>a-1;)d[t]=0,t||(++n,d.unshift(1));for(l=d.length;!d[l-1];--l);for(i=0,s="";i<l;i++)s+=Fd.charAt(d[i]);if(x){if(l>1)if(r==16||r==8){for(i=r==16?4:3,--l;l%i;l++)s+="0";for(d=Hu(s,a,r),l=d.length;!d[l-1];--l);for(i=1,s="1.";i<l;i++)s+=Fd.charAt(d[i])}else s=s.charAt(0)+"."+s.slice(1);s=s+(n<0?"p":"p+")+n}else if(n<0){for(;++n;)s="0"+s;s="0."+s}else if(++n>l)for(n-=l;n--;)s+="0";else n<l&&(s=s.slice(0,n)+"."+s.slice(n))}s=(r==16?"0x":r==2?"0b":r==8?"0o":"")+s}return e.s<0?"-"+s:s}function r1(e,r){if(e.length>r)return e.length=r,!0}function l$(e){return new this(e).abs()}function d$(e){return new this(e).acos()}function p$(e){return new this(e).acosh()}function m$(e,r){return new this(e).plus(r)}function c$(e){return new this(e).asin()}function x$(e){return new this(e).asinh()}function h$(e){return new this(e).atan()}function v$(e){return new this(e).atanh()}function g$(e,r){e=new this(e),r=new this(r);var t,o=this.precision,a=this.rounding,n=o+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=Go(this,n,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?Go(this,o,a):new this(0),t.s=e.s):!e.d||r.isZero()?(t=Go(this,n,1).times(.5),t.s=e.s):r.s<0?(this.precision=n,this.rounding=1,t=this.atan(_r(e,r,n,1)),r=Go(this,n,1),this.precision=o,this.rounding=a,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(_r(e,r,n,1)),t}function y$(e){return new this(e).cbrt()}function S$(e){return We(e=new this(e),e.e+1,2)}function w$(e,r,t){return new this(e).clamp(r,t)}function T$(e){if(!e||typeof e!="object")throw Error(Ku+"Object expected");var r,t,o,a=e.defaults===!0,n=["precision",1,ka,"rounding",0,8,"toExpNeg",-Gn,0,"toExpPos",0,Gn,"maxE",0,Gn,"minE",-Gn,0,"modulo",0,9];for(r=0;r<n.length;r+=3)if(t=n[r],a&&(this[t]=Bd[t]),(o=e[t])!==void 0)if(At(o)===o&&o>=n[r+1]&&o<=n[r+2])this[t]=o;else throw Error(Pa+t+": "+o);if(t="crypto",a&&(this[t]=Bd[t]),(o=e[t])!==void 0)if(o===!0||o===!1||o===0||o===1)if(o)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(n1);else this[t]=!1;else throw Error(Pa+t+": "+o);return this}function b$(e){return new this(e).cos()}function D$(e){return new this(e).cosh()}function m1(e){var r,t,o;function a(n){var i,u,l,f=this;if(!(f instanceof a))return new a(n);if(f.constructor=a,t1(n)){f.s=n.s,rr?!n.d||n.e>a.maxE?(f.e=NaN,f.d=null):n.e<a.minE?(f.e=0,f.d=[0]):(f.e=n.e,f.d=n.d.slice()):(f.e=n.e,f.d=n.d?n.d.slice():n.d);return}if(l=typeof n,l==="number"){if(n===0){f.s=1/n<0?-1:1,f.e=0,f.d=[0];return}if(n<0?(n=-n,f.s=-1):f.s=1,n===~~n&&n<1e7){for(i=0,u=n;u>=10;u/=10)i++;rr?i>a.maxE?(f.e=NaN,f.d=null):i<a.minE?(f.e=0,f.d=[0]):(f.e=i,f.d=[n]):(f.e=i,f.d=[n]);return}if(n*0!==0){n||(f.s=NaN),f.e=NaN,f.d=null;return}return Wu(f,n.toString())}if(l==="string")return(u=n.charCodeAt(0))===45?(n=n.slice(1),f.s=-1):(u===43&&(n=n.slice(1)),f.s=1),f1.test(n)?Wu(f,n):u$(f,n);if(l==="bigint")return n<0?(n=-n,f.s=-1):f.s=1,Wu(f,n.toString());throw Error(Pa+n)}if(a.prototype=ye,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.EUCLID=9,a.config=a.set=T$,a.clone=m1,a.isDecimal=t1,a.abs=l$,a.acos=d$,a.acosh=p$,a.add=m$,a.asin=c$,a.asinh=x$,a.atan=h$,a.atanh=v$,a.atan2=g$,a.cbrt=y$,a.ceil=S$,a.clamp=w$,a.cos=b$,a.cosh=D$,a.div=A$,a.exp=O$,a.floor=C$,a.hypot=R$,a.ln=N$,a.log=M$,a.log10=F$,a.log2=E$,a.max=B$,a.min=_$,a.mod=P$,a.mul=k$,a.pow=L$,a.random=I$,a.round=z$,a.sign=q$,a.sin=U$,a.sinh=H$,a.sqrt=W$,a.sub=V$,a.sum=G$,a.tan=$$,a.tanh=K$,a.trunc=Q$,e===void 0&&(e={}),e&&e.defaults!==!0)for(o=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<o.length;)e.hasOwnProperty(t=o[r++])||(e[t]=this[t]);return a.config(e),a}function A$(e,r){return new this(e).div(r)}function O$(e){return new this(e).exp()}function C$(e){return We(e=new this(e),e.e+1,3)}function R$(){var e,r,t=new this(0);for(rr=!1,e=0;e<arguments.length;)if(r=new this(arguments[e++]),r.d)t.d&&(t=t.plus(r.times(r)));else{if(r.s)return rr=!0,new this(1/0);t=r}return rr=!0,t.sqrt()}function t1(e){return e instanceof rf||e&&e.toStringTag===i1||!1}function N$(e){return new this(e).ln()}function M$(e,r){return new this(e).log(r)}function E$(e){return new this(e).log(2)}function F$(e){return new this(e).log(10)}function B$(){return l1(this,arguments,-1)}function _$(){return l1(this,arguments,1)}function P$(e,r){return new this(e).mod(r)}function k$(e,r){return new this(e).mul(r)}function L$(e,r){return new this(e).pow(r)}function I$(e){var r,t,o,a,n=0,i=new this(1),u=[];if(e===void 0?e=this.precision:Qt(e,1,ka),o=Math.ceil(e/Ze),this.crypto)if(crypto.getRandomValues)for(r=crypto.getRandomValues(new Uint32Array(o));n<o;)a=r[n],a>=429e7?r[n]=crypto.getRandomValues(new Uint32Array(1))[0]:u[n++]=a%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(o*=4);n<o;)a=r[n]+(r[n+1]<<8)+(r[n+2]<<16)+((r[n+3]&127)<<24),a>=214e7?crypto.randomBytes(4).copy(r,n):(u.push(a%1e7),n+=4);n=o/4}else throw Error(n1);else for(;n<o;)u[n++]=Math.random()*1e7|0;for(o=u[--n],e%=Ze,o&&e&&(a=rt(10,Ze-e),u[n]=(o/a|0)*a);u[n]===0;n--)u.pop();if(n<0)t=0,u=[0];else{for(t=-1;u[0]===0;t-=Ze)u.shift();for(o=1,a=u[0];a>=10;a/=10)o++;o<Ze&&(t-=Ze-o)}return i.e=t,i.d=u,i}function z$(e){return We(e=new this(e),e.e+1,this.rounding)}function q$(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function U$(e){return new this(e).sin()}function H$(e){return new this(e).sinh()}function W$(e){return new this(e).sqrt()}function V$(e,r){return new this(e).sub(r)}function G$(){var e=0,r=arguments,t=new this(r[e]);for(rr=!1;t.s&&++e<r.length;)t=t.plus(r[e]);return rr=!0,We(t,this.precision,this.rounding)}function $$(e){return new this(e).tan()}function K$(e){return new this(e).tanh()}function Q$(e){return We(e=new this(e),e.e+1,1)}var Gn,ka,Fd,Vu,Gu,Bd,o1,aa,rr,Ku,Pa,a1,n1,i1,At,rt,t$,o$,a$,f1,Fo,Ze,n$,i$,_d,ye,_r,rf,dn,Yu=T(()=>{Gn=9e15,ka=1e9,Fd="0123456789abcdef",Vu="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Gu="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Bd={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Gn,maxE:Gn,crypto:!1},rr=!0,Ku="[DecimalError] ",Pa=Ku+"Invalid argument: ",a1=Ku+"Precision limit exceeded",n1=Ku+"crypto unavailable",i1="[object Decimal]",At=Math.floor,rt=Math.pow,t$=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,o$=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,a$=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,f1=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Fo=1e7,Ze=7,n$=9007199254740991,i$=Vu.length-1,_d=Gu.length-1,ye={toStringTag:i1};ye.absoluteValue=ye.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),We(e)};ye.ceil=function(){return We(new this.constructor(this),this.e+1,2)};ye.clampedTo=ye.clamp=function(e,r){var t,o=this,a=o.constructor;if(e=new a(e),r=new a(r),!e.s||!r.s)return new a(NaN);if(e.gt(r))throw Error(Pa+r);return t=o.cmp(e),t<0?e:o.cmp(r)>0?r:new a(o)};ye.comparedTo=ye.cmp=function(e){var r,t,o,a,n=this,i=n.d,u=(e=new n.constructor(e)).d,l=n.s,f=e.s;if(!i||!u)return!l||!f?NaN:l!==f?l:i===u?0:!i^l<0?1:-1;if(!i[0]||!u[0])return i[0]?l:u[0]?-f:0;if(l!==f)return l;if(n.e!==e.e)return n.e>e.e^l<0?1:-1;for(o=i.length,a=u.length,r=0,t=o<a?o:a;r<t;++r)if(i[r]!==u[r])return i[r]>u[r]^l<0?1:-1;return o===a?0:o>a^l<0?1:-1};ye.cosine=ye.cos=function(){var e,r,t=this,o=t.constructor;return t.d?t.d[0]?(e=o.precision,r=o.rounding,o.precision=e+Math.max(t.e,t.sd())+Ze,o.rounding=1,t=f$(o,p1(o,t)),o.precision=e,o.rounding=r,We(aa==2||aa==3?t.neg():t,e,r,!0)):new o(1):new o(NaN)};ye.cubeRoot=ye.cbrt=function(){var e,r,t,o,a,n,i,u,l,f,s=this,d=s.constructor;if(!s.isFinite()||s.isZero())return new d(s);for(rr=!1,n=s.s*rt(s.s*s,1/3),!n||Math.abs(n)==1/0?(t=gt(s.d),e=s.e,(n=(e-t.length+1)%3)&&(t+=n==1||n==-2?"0":"00"),n=rt(t,1/3),e=At((e+1)/3)-(e%3==(e<0?-1:2)),n==1/0?t="5e"+e:(t=n.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),o=new d(t),o.s=s.s):o=new d(n.toString()),i=(e=d.precision)+3;;)if(u=o,l=u.times(u).times(u),f=l.plus(s),o=_r(f.plus(s).times(u),f.plus(l),i+2,1),gt(u.d).slice(0,i)===(t=gt(o.d)).slice(0,i))if(t=t.slice(i-3,i+1),t=="9999"||!a&&t=="4999"){if(!a&&(We(u,e+1,0),u.times(u).times(u).eq(s))){o=u;break}i+=4,a=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(We(o,e+1,1),r=!o.times(o).times(o).eq(s));break}return rr=!0,We(o,e,d.rounding,r)};ye.decimalPlaces=ye.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-At(this.e/Ze))*Ze,e=r[e],e)for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t};ye.dividedBy=ye.div=function(e){return _r(this,new this.constructor(e))};ye.dividedToIntegerBy=ye.divToInt=function(e){var r=this,t=r.constructor;return We(_r(r,new t(e),0,1,1),t.precision,t.rounding)};ye.equals=ye.eq=function(e){return this.cmp(e)===0};ye.floor=function(){return We(new this.constructor(this),this.e+1,3)};ye.greaterThan=ye.gt=function(e){return this.cmp(e)>0};ye.greaterThanOrEqualTo=ye.gte=function(e){var r=this.cmp(e);return r==1||r===0};ye.hyperbolicCosine=ye.cosh=function(){var e,r,t,o,a,n=this,i=n.constructor,u=new i(1);if(!n.isFinite())return new i(n.s?1/0:NaN);if(n.isZero())return u;t=i.precision,o=i.rounding,i.precision=t+Math.max(n.e,n.sd())+4,i.rounding=1,a=n.d.length,a<32?(e=Math.ceil(a/3),r=(1/Zu(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),n=$n(i,1,n.times(r),new i(1),!0);for(var l,f=e,s=new i(8);f--;)l=n.times(n),n=u.minus(l.times(s.minus(l.times(s))));return We(n,i.precision=t,i.rounding=o,!0)};ye.hyperbolicSine=ye.sinh=function(){var e,r,t,o,a=this,n=a.constructor;if(!a.isFinite()||a.isZero())return new n(a);if(r=n.precision,t=n.rounding,n.precision=r+Math.max(a.e,a.sd())+4,n.rounding=1,o=a.d.length,o<3)a=$n(n,2,a,a,!0);else{e=1.4*Math.sqrt(o),e=e>16?16:e|0,a=a.times(1/Zu(5,e)),a=$n(n,2,a,a,!0);for(var i,u=new n(5),l=new n(16),f=new n(20);e--;)i=a.times(a),a=a.times(u.plus(i.times(l.times(i).plus(f))))}return n.precision=r,n.rounding=t,We(a,r,t,!0)};ye.hyperbolicTangent=ye.tanh=function(){var e,r,t=this,o=t.constructor;return t.isFinite()?t.isZero()?new o(t):(e=o.precision,r=o.rounding,o.precision=e+7,o.rounding=1,_r(t.sinh(),t.cosh(),o.precision=e,o.rounding=r)):new o(t.s)};ye.inverseCosine=ye.acos=function(){var e=this,r=e.constructor,t=e.abs().cmp(1),o=r.precision,a=r.rounding;return t!==-1?t===0?e.isNeg()?Go(r,o,a):new r(0):new r(NaN):e.isZero()?Go(r,o+4,a).times(.5):(r.precision=o+6,r.rounding=1,e=new r(1).minus(e).div(e.plus(1)).sqrt().atan(),r.precision=o,r.rounding=a,e.times(2))};ye.inverseHyperbolicCosine=ye.acosh=function(){var e,r,t=this,o=t.constructor;return t.lte(1)?new o(t.eq(1)?0:NaN):t.isFinite()?(e=o.precision,r=o.rounding,o.precision=e+Math.max(Math.abs(t.e),t.sd())+4,o.rounding=1,rr=!1,t=t.times(t).minus(1).sqrt().plus(t),rr=!0,o.precision=e,o.rounding=r,t.ln()):new o(t)};ye.inverseHyperbolicSine=ye.asinh=function(){var e,r,t=this,o=t.constructor;return!t.isFinite()||t.isZero()?new o(t):(e=o.precision,r=o.rounding,o.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,o.rounding=1,rr=!1,t=t.times(t).plus(1).sqrt().plus(t),rr=!0,o.precision=e,o.rounding=r,t.ln())};ye.inverseHyperbolicTangent=ye.atanh=function(){var e,r,t,o,a=this,n=a.constructor;return a.isFinite()?a.e>=0?new n(a.abs().eq(1)?a.s/0:a.isZero()?a:NaN):(e=n.precision,r=n.rounding,o=a.sd(),Math.max(o,e)<2*-a.e-1?We(new n(a),e,r,!0):(n.precision=t=o-a.e,a=_r(a.plus(1),new n(1).minus(a),t+e,1),n.precision=e+4,n.rounding=1,a=a.ln(),n.precision=e,n.rounding=r,a.times(.5))):new n(NaN)};ye.inverseSine=ye.asin=function(){var e,r,t,o,a=this,n=a.constructor;return a.isZero()?new n(a):(r=a.abs().cmp(1),t=n.precision,o=n.rounding,r!==-1?r===0?(e=Go(n,t+4,o).times(.5),e.s=a.s,e):new n(NaN):(n.precision=t+6,n.rounding=1,a=a.div(new n(1).minus(a.times(a)).sqrt().plus(1)).atan(),n.precision=t,n.rounding=o,a.times(2)))};ye.inverseTangent=ye.atan=function(){var e,r,t,o,a,n,i,u,l,f=this,s=f.constructor,d=s.precision,m=s.rounding;if(f.isFinite()){if(f.isZero())return new s(f);if(f.abs().eq(1)&&d+4<=_d)return i=Go(s,d+4,m).times(.25),i.s=f.s,i}else{if(!f.s)return new s(NaN);if(d+4<=_d)return i=Go(s,d+4,m).times(.5),i.s=f.s,i}for(s.precision=u=d+10,s.rounding=1,t=Math.min(28,u/Ze+2|0),e=t;e;--e)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(rr=!1,r=Math.ceil(u/Ze),o=1,l=f.times(f),i=new s(f),a=f;e!==-1;)if(a=a.times(l),n=i.minus(a.div(o+=2)),a=a.times(l),i=n.plus(a.div(o+=2)),i.d[r]!==void 0)for(e=r;i.d[e]===n.d[e]&&e--;);return t&&(i=i.times(2<<t-1)),rr=!0,We(i,s.precision=d,s.rounding=m,!0)};ye.isFinite=function(){return!!this.d};ye.isInteger=ye.isInt=function(){return!!this.d&&At(this.e/Ze)>this.d.length-2};ye.isNaN=function(){return!this.s};ye.isNegative=ye.isNeg=function(){return this.s<0};ye.isPositive=ye.isPos=function(){return this.s>0};ye.isZero=function(){return!!this.d&&this.d[0]===0};ye.lessThan=ye.lt=function(e){return this.cmp(e)<0};ye.lessThanOrEqualTo=ye.lte=function(e){return this.cmp(e)<1};ye.logarithm=ye.log=function(e){var r,t,o,a,n,i,u,l,f=this,s=f.constructor,d=s.precision,m=s.rounding,p=5;if(e==null)e=new s(10),r=!0;else{if(e=new s(e),t=e.d,e.s<0||!t||!t[0]||e.eq(1))return new s(NaN);r=e.eq(10)}if(t=f.d,f.s<0||!t||!t[0]||f.eq(1))return new s(t&&!t[0]?-1/0:f.s!=1?NaN:t?0:1/0);if(r)if(t.length>1)n=!0;else{for(a=t[0];a%10===0;)a/=10;n=a!==1}if(rr=!1,u=d+p,i=_a(f,u),o=r?$u(s,u+10):_a(e,u),l=_r(i,o,u,1),ef(l.d,a=d,m))do if(u+=10,i=_a(f,u),o=r?$u(s,u+10):_a(e,u),l=_r(i,o,u,1),!n){+gt(l.d).slice(a+1,a+15)+1==1e14&&(l=We(l,d+1,0));break}while(ef(l.d,a+=10,m));return rr=!0,We(l,d,m)};ye.minus=ye.sub=function(e){var r,t,o,a,n,i,u,l,f,s,d,m,p=this,x=p.constructor;if(e=new x(e),!p.d||!e.d)return!p.s||!e.s?e=new x(NaN):p.d?e.s=-e.s:e=new x(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(f=p.d,m=e.d,u=x.precision,l=x.rounding,!f[0]||!m[0]){if(m[0])e.s=-e.s;else if(f[0])e=new x(p);else return new x(l===3?-0:0);return rr?We(e,u,l):e}if(t=At(e.e/Ze),s=At(p.e/Ze),f=f.slice(),n=s-t,n){for(d=n<0,d?(r=f,n=-n,i=m.length):(r=m,t=s,i=f.length),o=Math.max(Math.ceil(u/Ze),i)+2,n>o&&(n=o,r.length=1),r.reverse(),o=n;o--;)r.push(0);r.reverse()}else{for(o=f.length,i=m.length,d=o<i,d&&(i=o),o=0;o<i;o++)if(f[o]!=m[o]){d=f[o]<m[o];break}n=0}for(d&&(r=f,f=m,m=r,e.s=-e.s),i=f.length,o=m.length-i;o>0;--o)f[i++]=0;for(o=m.length;o>n;){if(f[--o]<m[o]){for(a=o;a&&f[--a]===0;)f[a]=Fo-1;--f[a],f[o]+=Fo}f[o]-=m[o]}for(;f[--i]===0;)f.pop();for(;f[0]===0;f.shift())--t;return f[0]?(e.d=f,e.e=Qu(f,t),rr?We(e,u,l):e):new x(l===3?-0:0)};ye.modulo=ye.mod=function(e){var r,t=this,o=t.constructor;return e=new o(e),!t.d||!e.s||e.d&&!e.d[0]?new o(NaN):!e.d||t.d&&!t.d[0]?We(new o(t),o.precision,o.rounding):(rr=!1,o.modulo==9?(r=_r(t,e.abs(),0,3,1),r.s*=e.s):r=_r(t,e,0,o.modulo,1),r=r.times(e),rr=!0,t.minus(r))};ye.naturalExponential=ye.exp=function(){return Pd(this)};ye.naturalLogarithm=ye.ln=function(){return _a(this)};ye.negated=ye.neg=function(){var e=new this.constructor(this);return e.s=-e.s,We(e)};ye.plus=ye.add=function(e){var r,t,o,a,n,i,u,l,f,s,d=this,m=d.constructor;if(e=new m(e),!d.d||!e.d)return!d.s||!e.s?e=new m(NaN):d.d||(e=new m(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(f=d.d,s=e.d,u=m.precision,l=m.rounding,!f[0]||!s[0])return s[0]||(e=new m(d)),rr?We(e,u,l):e;if(n=At(d.e/Ze),o=At(e.e/Ze),f=f.slice(),a=n-o,a){for(a<0?(t=f,a=-a,i=s.length):(t=s,o=n,i=f.length),n=Math.ceil(u/Ze),i=n>i?n+1:i+1,a>i&&(a=i,t.length=1),t.reverse();a--;)t.push(0);t.reverse()}for(i=f.length,a=s.length,i-a<0&&(a=i,t=s,s=f,f=t),r=0;a;)r=(f[--a]=f[a]+s[a]+r)/Fo|0,f[a]%=Fo;for(r&&(f.unshift(r),++o),i=f.length;f[--i]==0;)f.pop();return e.d=f,e.e=Qu(f,o),rr?We(e,u,l):e};ye.precision=ye.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Pa+e);return t.d?(r=u1(t.d),e&&t.e+1>r&&(r=t.e+1)):r=NaN,r};ye.round=function(){var e=this,r=e.constructor;return We(new r(e),e.e+1,r.rounding)};ye.sine=ye.sin=function(){var e,r,t=this,o=t.constructor;return t.isFinite()?t.isZero()?new o(t):(e=o.precision,r=o.rounding,o.precision=e+Math.max(t.e,t.sd())+Ze,o.rounding=1,t=s$(o,p1(o,t)),o.precision=e,o.rounding=r,We(aa>2?t.neg():t,e,r,!0)):new o(NaN)};ye.squareRoot=ye.sqrt=function(){var e,r,t,o,a,n,i=this,u=i.d,l=i.e,f=i.s,s=i.constructor;if(f!==1||!u||!u[0])return new s(!f||f<0&&(!u||u[0])?NaN:u?i:1/0);for(rr=!1,f=Math.sqrt(+i),f==0||f==1/0?(r=gt(u),(r.length+l)%2==0&&(r+="0"),f=Math.sqrt(r),l=At((l+1)/2)-(l<0||l%2),f==1/0?r="5e"+l:(r=f.toExponential(),r=r.slice(0,r.indexOf("e")+1)+l),o=new s(r)):o=new s(f.toString()),t=(l=s.precision)+3;;)if(n=o,o=n.plus(_r(i,n,t+2,1)).times(.5),gt(n.d).slice(0,t)===(r=gt(o.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!a&&r=="4999"){if(!a&&(We(n,l+1,0),n.times(n).eq(i))){o=n;break}t+=4,a=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(We(o,l+1,1),e=!o.times(o).eq(i));break}return rr=!0,We(o,l,s.rounding,e)};ye.tangent=ye.tan=function(){var e,r,t=this,o=t.constructor;return t.isFinite()?t.isZero()?new o(t):(e=o.precision,r=o.rounding,o.precision=e+10,o.rounding=1,t=t.sin(),t.s=1,t=_r(t,new o(1).minus(t.times(t)).sqrt(),e+10,0),o.precision=e,o.rounding=r,We(aa==2||aa==4?t.neg():t,e,r,!0)):new o(NaN)};ye.times=ye.mul=function(e){var r,t,o,a,n,i,u,l,f,s=this,d=s.constructor,m=s.d,p=(e=new d(e)).d;if(e.s*=s.s,!m||!m[0]||!p||!p[0])return new d(!e.s||m&&!m[0]&&!p||p&&!p[0]&&!m?NaN:!m||!p?e.s/0:e.s*0);for(t=At(s.e/Ze)+At(e.e/Ze),l=m.length,f=p.length,l<f&&(n=m,m=p,p=n,i=l,l=f,f=i),n=[],i=l+f,o=i;o--;)n.push(0);for(o=f;--o>=0;){for(r=0,a=l+o;a>o;)u=n[a]+p[o]*m[a-o-1]+r,n[a--]=u%Fo|0,r=u/Fo|0;n[a]=(n[a]+r)%Fo|0}for(;!n[--i];)n.pop();return r?++t:n.shift(),e.d=n,e.e=Qu(n,t),rr?We(e,d.precision,d.rounding):e};ye.toBinary=function(e,r){return kd(this,2,e,r)};ye.toDecimalPlaces=ye.toDP=function(e,r){var t=this,o=t.constructor;return t=new o(t),e===void 0?t:(Qt(e,0,ka),r===void 0?r=o.rounding:Qt(r,0,8),We(t,e+t.e+1,r))};ye.toExponential=function(e,r){var t,o=this,a=o.constructor;return e===void 0?t=$o(o,!0):(Qt(e,0,ka),r===void 0?r=a.rounding:Qt(r,0,8),o=We(new a(o),e+1,r),t=$o(o,!0,e+1)),o.isNeg()&&!o.isZero()?"-"+t:t};ye.toFixed=function(e,r){var t,o,a=this,n=a.constructor;return e===void 0?t=$o(a):(Qt(e,0,ka),r===void 0?r=n.rounding:Qt(r,0,8),o=We(new n(a),e+a.e+1,r),t=$o(o,!1,e+o.e+1)),a.isNeg()&&!a.isZero()?"-"+t:t};ye.toFraction=function(e){var r,t,o,a,n,i,u,l,f,s,d,m,p=this,x=p.d,c=p.constructor;if(!x)return new c(p);if(f=t=new c(1),o=l=new c(0),r=new c(o),n=r.e=u1(x)-p.e-1,i=n%Ze,r.d[0]=rt(10,i<0?Ze+i:i),e==null)e=n>0?r:f;else{if(u=new c(e),!u.isInt()||u.lt(f))throw Error(Pa+u);e=u.gt(r)?n>0?r:f:u}for(rr=!1,u=new c(gt(x)),s=c.precision,c.precision=n=x.length*Ze*2;d=_r(u,r,0,1,1),a=t.plus(d.times(o)),a.cmp(e)!=1;)t=o,o=a,a=f,f=l.plus(d.times(a)),l=a,a=r,r=u.minus(d.times(a)),u=a;return a=_r(e.minus(t),o,0,1,1),l=l.plus(a.times(f)),t=t.plus(a.times(o)),l.s=f.s=p.s,m=_r(f,o,n,1).minus(p).abs().cmp(_r(l,t,n,1).minus(p).abs())<1?[f,o]:[l,t],c.precision=s,rr=!0,m};ye.toHexadecimal=ye.toHex=function(e,r){return kd(this,16,e,r)};ye.toNearest=function(e,r){var t=this,o=t.constructor;if(t=new o(t),e==null){if(!t.d)return t;e=new o(1),r=o.rounding}else{if(e=new o(e),r===void 0?r=o.rounding:Qt(r,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(rr=!1,t=_r(t,e,0,r,1).times(e),rr=!0,We(t)):(e.s=t.s,t=e),t};ye.toNumber=function(){return+this};ye.toOctal=function(e,r){return kd(this,8,e,r)};ye.toPower=ye.pow=function(e){var r,t,o,a,n,i,u=this,l=u.constructor,f=+(e=new l(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new l(rt(+u,f));if(u=new l(u),u.eq(1))return u;if(o=l.precision,n=l.rounding,e.eq(1))return We(u,o,n);if(r=At(e.e/Ze),r>=e.d.length-1&&(t=f<0?-f:f)<=n$)return a=s1(l,u,t,o),e.s<0?new l(1).div(a):We(a,o,n);if(i=u.s,i<0){if(r<e.d.length-1)return new l(NaN);if((e.d[r]&1)==0&&(i=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=i,u}return t=rt(+u,f),r=t==0||!isFinite(t)?At(f*(Math.log("0."+gt(u.d))/Math.LN10+u.e+1)):new l(t+"").e,r>l.maxE+1||r<l.minE-1?new l(r>0?i/0:0):(rr=!1,l.rounding=u.s=1,t=Math.min(12,(r+"").length),a=Pd(e.times(_a(u,o+t)),o),a.d&&(a=We(a,o+5,1),ef(a.d,o,n)&&(r=o+10,a=We(Pd(e.times(_a(u,r+t)),r),r+5,1),+gt(a.d).slice(o+1,o+15)+1==1e14&&(a=We(a,o+1,0)))),a.s=i,rr=!0,l.rounding=n,We(a,o,n))};ye.toPrecision=function(e,r){var t,o=this,a=o.constructor;return e===void 0?t=$o(o,o.e<=a.toExpNeg||o.e>=a.toExpPos):(Qt(e,1,ka),r===void 0?r=a.rounding:Qt(r,0,8),o=We(new a(o),e,r),t=$o(o,e<=o.e||o.e<=a.toExpNeg,e)),o.isNeg()&&!o.isZero()?"-"+t:t};ye.toSignificantDigits=ye.toSD=function(e,r){var t=this,o=t.constructor;return e===void 0?(e=o.precision,r=o.rounding):(Qt(e,1,ka),r===void 0?r=o.rounding:Qt(r,0,8)),We(new o(t),e,r)};ye.toString=function(){var e=this,r=e.constructor,t=$o(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t};ye.truncated=ye.trunc=function(){return We(new this.constructor(this),this.e+1,1)};ye.valueOf=ye.toJSON=function(){var e=this,r=e.constructor,t=$o(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};_r=function(){function e(o,a,n){var i,u=0,l=o.length;for(o=o.slice();l--;)i=o[l]*a+u,o[l]=i%n|0,u=i/n|0;return u&&o.unshift(u),o}function r(o,a,n,i){var u,l;if(n!=i)l=n>i?1:-1;else for(u=l=0;u<n;u++)if(o[u]!=a[u]){l=o[u]>a[u]?1:-1;break}return l}function t(o,a,n,i){for(var u=0;n--;)o[n]-=u,u=o[n]<a[n]?1:0,o[n]=u*i+o[n]-a[n];for(;!o[0]&&o.length>1;)o.shift()}return function(o,a,n,i,u,l){var f,s,d,m,p,x,c,v,y,b,h,S,w,g,A,C,D,N,E,_,L=o.constructor,P=o.s==a.s?1:-1,k=o.d,R=a.d;if(!k||!k[0]||!R||!R[0])return new L(!o.s||!a.s||(k?R&&k[0]==R[0]:!R)?NaN:k&&k[0]==0||!R?P*0:P/0);for(l?(p=1,s=o.e-a.e):(l=Fo,p=Ze,s=At(o.e/p)-At(a.e/p)),E=R.length,D=k.length,y=new L(P),b=y.d=[],d=0;R[d]==(k[d]||0);d++);if(R[d]>(k[d]||0)&&s--,n==null?(g=n=L.precision,i=L.rounding):u?g=n+(o.e-a.e)+1:g=n,g<0)b.push(1),x=!0;else{if(g=g/p+2|0,d=0,E==1){for(m=0,R=R[0],g++;(d<D||m)&&g--;d++)A=m*l+(k[d]||0),b[d]=A/R|0,m=A%R|0;x=m||d<D}else{for(m=l/(R[0]+1)|0,m>1&&(R=e(R,m,l),k=e(k,m,l),E=R.length,D=k.length),C=E,h=k.slice(0,E),S=h.length;S<E;)h[S++]=0;_=R.slice(),_.unshift(0),N=R[0],R[1]>=l/2&&++N;do m=0,f=r(R,h,E,S),f<0?(w=h[0],E!=S&&(w=w*l+(h[1]||0)),m=w/N|0,m>1?(m>=l&&(m=l-1),c=e(R,m,l),v=c.length,S=h.length,f=r(c,h,v,S),f==1&&(m--,t(c,E<v?_:R,v,l))):(m==0&&(f=m=1),c=R.slice()),v=c.length,v<S&&c.unshift(0),t(h,c,S,l),f==-1&&(S=h.length,f=r(R,h,E,S),f<1&&(m++,t(h,E<S?_:R,S,l))),S=h.length):f===0&&(m++,h=[0]),b[d++]=m,f&&h[0]?h[S++]=k[C]||0:(h=[k[C]],S=1);while((C++<D||h[0]!==void 0)&&g--);x=h[0]!==void 0}b[0]||b.shift()}if(p==1)y.e=s,o1=x;else{for(d=1,m=b[0];m>=10;m/=10)d++;y.e=d+s*p-1,We(y,u?n+y.e+1:n,i,x)}return y}}();ye[Symbol.for("nodejs.util.inspect.custom")]=ye.toString;ye[Symbol.toStringTag]="Decimal";rf=ye.constructor=m1(Bd);Vu=new rf(Vu);Gu=new rf(Gu);dn=rf});var Z$,Y$,Ld,c1=T(()=>{Yu();U();Z$="BigNumber",Y$=["?on","config"],Ld=O(Z$,Y$,e=>{var{on:r,config:t}=e,o=dn.clone({precision:t.precision,modulo:dn.EUCLID});return o.prototype=Object.create(o.prototype),o.prototype.type="BigNumber",o.prototype.isBigNumber=!0,o.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},o.fromJSON=function(a){return new o(a.value)},r&&r("config",function(a,n){a.precision!==n.precision&&o.config({precision:a.precision})}),o},{isClass:!0})});function zd(e,r){let t=Math.abs(e),o=Math.abs(r);return e===0?Math.log(o):r===0?Math.log(t):t<3e3&&o<3e3?Math.log(e*e+r*r)*.5:(e=e*.5,r=r*.5,.5*Math.log(e*e+r*r)+Math.LN2)}function ce(e,r){if(!(this instanceof ce))return new ce(e,r);let t=pn(e,r);this.re=t.re,this.im=t.im}var Ot,po,X$,Id,Kn,J$,pn,x1=T(()=>{"use strict";Ot=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:(Math.exp(e)+Math.exp(-e))*.5},po=Math.sinh||function(e){return Math.abs(e)<1e-9?e:(Math.exp(e)-Math.exp(-e))*.5},X$=function(e){let r=Math.PI/4;if(-r>e||e>r)return Math.cos(e)-1;let t=e*e;return t*(t*(t*(t*(t*(t*(t*(t/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},Id=function(e,r){return e=Math.abs(e),r=Math.abs(r),e<r&&([e,r]=[r,e]),e<1e8?Math.sqrt(e*e+r*r):(r/=e,e*Math.sqrt(1+r*r))},Kn=function(){throw SyntaxError("Invalid Param")};J$={re:0,im:0},pn=function(e,r){let t=J$;if(e==null)t.re=t.im=0;else if(r!==void 0)t.re=e,t.im=r;else switch(typeof e){case"object":if("im"in e&&"re"in e)t.re=e.re,t.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return ce.INFINITY;t.re=e.abs*Math.cos(e.arg),t.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return ce.INFINITY;t.re=e.r*Math.cos(e.phi),t.im=e.r*Math.sin(e.phi)}else e.length===2?(t.re=e[0],t.im=e[1]):Kn();break;case"string":t.im=t.re=0;let o=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),a=1,n=0;o===null&&Kn();for(let i=0;i<o.length;i++){let u=o[i];u===" "||u===" "||u===`
9
+ `||(u==="+"?a++:u==="-"?n++:u==="i"||u==="I"?(a+n===0&&Kn(),o[i+1]!==" "&&!isNaN(o[i+1])?(t.im+=parseFloat((n%2?"-":"")+o[i+1]),i++):t.im+=parseFloat((n%2?"-":"")+"1"),a=n=0):((a+n===0||isNaN(u))&&Kn(),o[i+1]==="i"||o[i+1]==="I"?(t.im+=parseFloat((n%2?"-":"")+u),i++):t.re+=parseFloat((n%2?"-":"")+u),a=n=0))}a+n>0&&Kn();break;case"number":t.im=0,t.re=e;break;default:Kn()}return isNaN(t.re)||isNaN(t.im),t};ce.prototype={re:0,im:0,sign:function(){let e=Id(this.re,this.im);return new ce(this.re/e,this.im/e)},add:function(e,r){let t=pn(e,r),o=this.isInfinite(),a=!(isFinite(t.re)&&isFinite(t.im));return o||a?o&&a?ce.NAN:ce.INFINITY:new ce(this.re+t.re,this.im+t.im)},sub:function(e,r){let t=pn(e,r),o=this.isInfinite(),a=!(isFinite(t.re)&&isFinite(t.im));return o||a?o&&a?ce.NAN:ce.INFINITY:new ce(this.re-t.re,this.im-t.im)},mul:function(e,r){let t=pn(e,r),o=this.isInfinite(),a=!(isFinite(t.re)&&isFinite(t.im)),n=this.re===0&&this.im===0,i=t.re===0&&t.im===0;return o&&i||a&&n?ce.NAN:o||a?ce.INFINITY:t.im===0&&this.im===0?new ce(this.re*t.re,0):new ce(this.re*t.re-this.im*t.im,this.re*t.im+this.im*t.re)},div:function(e,r){let t=pn(e,r),o=this.isInfinite(),a=!(isFinite(t.re)&&isFinite(t.im)),n=this.re===0&&this.im===0,i=t.re===0&&t.im===0;if(n&&i||o&&a)return ce.NAN;if(i||o)return ce.INFINITY;if(n||a)return ce.ZERO;if(t.im===0)return new ce(this.re/t.re,this.im/t.re);if(Math.abs(t.re)<Math.abs(t.im)){let u=t.re/t.im,l=t.re*u+t.im;return new ce((this.re*u+this.im)/l,(this.im*u-this.re)/l)}else{let u=t.im/t.re,l=t.im*u+t.re;return new ce((this.re+this.im*u)/l,(this.im-this.re*u)/l)}},pow:function(e,r){let t=pn(e,r),o=this.re===0&&this.im===0;if(t.re===0&&t.im===0)return ce.ONE;if(t.im===0){if(this.im===0&&this.re>0)return new ce(Math.pow(this.re,t.re),0);if(this.re===0)switch((t.re%4+4)%4){case 0:return new ce(Math.pow(this.im,t.re),0);case 1:return new ce(0,Math.pow(this.im,t.re));case 2:return new ce(-Math.pow(this.im,t.re),0);case 3:return new ce(0,-Math.pow(this.im,t.re))}}if(o&&t.re>0)return ce.ZERO;let n=Math.atan2(this.im,this.re),i=zd(this.re,this.im),u=Math.exp(t.re*i-t.im*n),l=t.im*i+t.re*n;return new ce(u*Math.cos(l),u*Math.sin(l))},sqrt:function(){let e=this.re,r=this.im;if(r===0)return e>=0?new ce(Math.sqrt(e),0):new ce(0,Math.sqrt(-e));let t=Id(e,r),o=Math.sqrt(.5*(t+Math.abs(e))),a=Math.abs(r)/(2*o);return e>=0?new ce(o,r<0?-a:a):new ce(a,r<0?-o:o)},exp:function(){let e=Math.exp(this.re);return this.im===0?new ce(e,0):new ce(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){let e=this.re,r=this.im;return new ce(Math.expm1(e)*Math.cos(r)+X$(r),Math.exp(e)*Math.sin(r))},log:function(){let e=this.re,r=this.im;return r===0&&e>0?new ce(Math.log(e),0):new ce(zd(e,r),Math.atan2(r,e))},abs:function(){return Id(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let e=this.re,r=this.im;return new ce(Math.sin(e)*Ot(r),Math.cos(e)*po(r))},cos:function(){let e=this.re,r=this.im;return new ce(Math.cos(e)*Ot(r),-Math.sin(e)*po(r))},tan:function(){let e=2*this.re,r=2*this.im,t=Math.cos(e)+Ot(r);return new ce(Math.sin(e)/t,po(r)/t)},cot:function(){let e=2*this.re,r=2*this.im,t=Math.cos(e)-Ot(r);return new ce(-Math.sin(e)/t,po(r)/t)},sec:function(){let e=this.re,r=this.im,t=.5*Ot(2*r)+.5*Math.cos(2*e);return new ce(Math.cos(e)*Ot(r)/t,Math.sin(e)*po(r)/t)},csc:function(){let e=this.re,r=this.im,t=.5*Ot(2*r)-.5*Math.cos(2*e);return new ce(Math.sin(e)*Ot(r)/t,-Math.cos(e)*po(r)/t)},asin:function(){let e=this.re,r=this.im,t=new ce(r*r-e*e+1,-2*e*r).sqrt(),o=new ce(t.re-r,t.im+e).log();return new ce(o.im,-o.re)},acos:function(){let e=this.re,r=this.im,t=new ce(r*r-e*e+1,-2*e*r).sqrt(),o=new ce(t.re-r,t.im+e).log();return new ce(Math.PI/2-o.im,o.re)},atan:function(){let e=this.re,r=this.im;if(e===0){if(r===1)return new ce(0,1/0);if(r===-1)return new ce(0,-1/0)}let t=e*e+(1-r)*(1-r),o=new ce((1-r*r-e*e)/t,-2*e/t).log();return new ce(-.5*o.im,.5*o.re)},acot:function(){let e=this.re,r=this.im;if(r===0)return new ce(Math.atan2(1,e),0);let t=e*e+r*r;return t!==0?new ce(e/t,-r/t).atan():new ce(e!==0?e/0:0,r!==0?-r/0:0).atan()},asec:function(){let e=this.re,r=this.im;if(e===0&&r===0)return new ce(0,1/0);let t=e*e+r*r;return t!==0?new ce(e/t,-r/t).acos():new ce(e!==0?e/0:0,r!==0?-r/0:0).acos()},acsc:function(){let e=this.re,r=this.im;if(e===0&&r===0)return new ce(Math.PI/2,1/0);let t=e*e+r*r;return t!==0?new ce(e/t,-r/t).asin():new ce(e!==0?e/0:0,r!==0?-r/0:0).asin()},sinh:function(){let e=this.re,r=this.im;return new ce(po(e)*Math.cos(r),Ot(e)*Math.sin(r))},cosh:function(){let e=this.re,r=this.im;return new ce(Ot(e)*Math.cos(r),po(e)*Math.sin(r))},tanh:function(){let e=2*this.re,r=2*this.im,t=Ot(e)+Math.cos(r);return new ce(po(e)/t,Math.sin(r)/t)},coth:function(){let e=2*this.re,r=2*this.im,t=Ot(e)-Math.cos(r);return new ce(po(e)/t,-Math.sin(r)/t)},csch:function(){let e=this.re,r=this.im,t=Math.cos(2*r)-Ot(2*e);return new ce(-2*po(e)*Math.cos(r)/t,2*Ot(e)*Math.sin(r)/t)},sech:function(){let e=this.re,r=this.im,t=Math.cos(2*r)+Ot(2*e);return new ce(2*Ot(e)*Math.cos(r)/t,-2*po(e)*Math.sin(r)/t)},asinh:function(){let e=this.im;this.im=-this.re,this.re=e;let r=this.asin();return this.re=-this.im,this.im=e,e=r.re,r.re=-r.im,r.im=e,r},acosh:function(){let e=this.acos();if(e.im<=0){let r=e.re;e.re=-e.im,e.im=r}else{let r=e.im;e.im=-e.re,e.re=r}return e},atanh:function(){let e=this.re,r=this.im,t=e>1&&r===0,o=1-e,a=1+e,n=o*o+r*r,i=n!==0?new ce((a*o-r*r)/n,(r*o+a*r)/n):new ce(e!==-1?e/0:0,r!==0?r/0:0),u=i.re;return i.re=zd(i.re,i.im)/2,i.im=Math.atan2(i.im,u)/2,t&&(i.im=-i.im),i},acoth:function(){let e=this.re,r=this.im;if(e===0&&r===0)return new ce(0,Math.PI/2);let t=e*e+r*r;return t!==0?new ce(e/t,-r/t).atanh():new ce(e!==0?e/0:0,r!==0?-r/0:0).atanh()},acsch:function(){let e=this.re,r=this.im;if(r===0)return new ce(e!==0?Math.log(e+Math.sqrt(e*e+1)):1/0,0);let t=e*e+r*r;return t!==0?new ce(e/t,-r/t).asinh():new ce(e!==0?e/0:0,r!==0?-r/0:0).asinh()},asech:function(){let e=this.re,r=this.im;if(this.isZero())return ce.INFINITY;let t=e*e+r*r;return t!==0?new ce(e/t,-r/t).acosh():new ce(e!==0?e/0:0,r!==0?-r/0:0).acosh()},inverse:function(){if(this.isZero())return ce.INFINITY;if(this.isInfinite())return ce.ZERO;let e=this.re,r=this.im,t=e*e+r*r;return new ce(e/t,-r/t)},conjugate:function(){return new ce(this.re,-this.im)},neg:function(){return new ce(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new ce(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new ce(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new ce(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,r){let t=pn(e,r);return Math.abs(t.re-this.re)<=ce.EPSILON&&Math.abs(t.im-this.im)<=ce.EPSILON},clone:function(){return new ce(this.re,this.im)},toString:function(){let e=this.re,r=this.im,t="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<ce.EPSILON&&(e=0),Math.abs(r)<ce.EPSILON&&(r=0),r===0?t+e:(e!==0?(t+=e,t+=" ",r<0?(r=-r,t+="-"):t+="+",t+=" "):r<0&&(r=-r,t+="-"),r!==1&&(t+=r),t+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}};ce.ZERO=new ce(0,0);ce.ONE=new ce(1,0);ce.I=new ce(0,1);ce.PI=new ce(Math.PI,0);ce.E=new ce(Math.E,0);ce.INFINITY=new ce(1/0,1/0);ce.NAN=new ce(NaN,NaN);ce.EPSILON=1e-15});var j$,eK,qd,h1=T(()=>{x1();He();Se();U();j$="Complex",eK=[],qd=O(j$,eK,()=>(Object.defineProperty(ce,"name",{value:"Complex"}),ce.prototype.constructor=ce,ce.prototype.type="Complex",ce.prototype.isComplex=!0,ce.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},ce.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},ce.prototype.format=function(e){var r="",t=this.im,o=this.re,a=Eo(this.re,e),n=Eo(this.im,e),i=ke(e)?e:e?e.precision:null;if(i!==null){var u=Math.pow(10,-i);Math.abs(o/t)<u&&(o=0),Math.abs(t/o)<u&&(t=0)}return t===0?r=a:o===0?t===1?r="i":t===-1?r="-i":r=n+"i":t<0?t===-1?r=a+" - i":r=a+" - "+n.substring(1)+"i":t===1?r=a+" + i":r=a+" + "+n+"i",r},ce.fromPolar=function(e){switch(arguments.length){case 1:{var r=arguments[0];if(typeof r=="object")return ce(r);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var t=arguments[0],o=arguments[1];if(ke(t)){if(xt(o)&&o.hasBase("ANGLE")&&(o=o.toNumber("rad")),ke(o))return new ce({r:t,phi:o});throw new TypeError("Phi is not a number nor an angle unit.")}else throw new TypeError("Radius r is not a number.")}default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},ce.prototype.valueOf=ce.prototype.toString,ce.fromJSON=function(e){return new ce(e)},ce.compare=function(e,r){return e.re>r.re?1:e.re<r.re?-1:e.im>r.im?1:e.im<r.im?-1:0},ce),{isClass:!0})});function na(e,r){try{e=BigInt(e)}catch{throw La()}return e*r}function Bo(e){return typeof e=="bigint"?e:Math.floor(e)}function qr(e,r){if(r===Ve)throw Hd();let t=Object.create(ro.prototype);t.s=e<Ve?-ir:ir,e=e<Ve?-e:e;let o=mn(e,r);return t.n=e/o,t.d=r/o,t}function Qn(e){let r={},t=e,o=tf,a=Ud-ir;for(;a<=t;){for(;t%o===Ve;)t/=o,r[o]=(r[o]||Ve)+ir;a+=ir+tf*o++}return t!==e?t>1&&(r[t]=(r[t]||Ve)+ir):r[e]=(r[e]||Ve)+ir,r}function tK(e,r,t){let o=ir;for(;r>Ve;e=e*e%t,r>>=ir)r&ir&&(o=o*e%t);return o}function oK(e,r){for(;r%tf===Ve;r/=tf);for(;r%Ud===Ve;r/=Ud);if(r===ir)return Ve;let t=Zt%r,o=1;for(;t!==ir;o++)if(t=t*Zt%r,o>rK)return Ve;return BigInt(o)}function aK(e,r,t){let o=ir,a=tK(Zt,t,r);for(let n=0;n<300;n++){if(o===a)return BigInt(n);o=o*Zt%r,a=a*Zt%r}return 0}function mn(e,r){if(!e)return r;if(!r)return e;for(;;){if(e%=r,!e)return r;if(r%=e,!r)return e}}function ro(e,r){if(ft(e,r),this instanceof ro)e=mn(Ee.d,Ee.n),this.s=Ee.s,this.n=Ee.n/e,this.d=Ee.d/e;else return qr(Ee.s*Ee.n,Ee.d)}var Ve,ir,tf,Ud,Zt,rK,Ee,ft,Hd,La,v1,g1=T(()=>{"use strict";typeof BigInt>"u"&&(BigInt=function(e){if(isNaN(e))throw new Error("");return e});Ve=BigInt(0),ir=BigInt(1),tf=BigInt(2),Ud=BigInt(5),Zt=BigInt(10),rK=2e3,Ee={s:ir,n:Ve,d:ir};ft=function(e,r){let t=Ve,o=ir,a=ir;if(e!=null)if(r!==void 0){if(typeof e=="bigint")t=e;else{if(isNaN(e))throw La();if(e%1!==0)throw v1();t=BigInt(e)}if(typeof r=="bigint")o=r;else{if(isNaN(r))throw La();if(r%1!==0)throw v1();o=BigInt(r)}a=t*o}else if(typeof e=="object"){if("d"in e&&"n"in e)t=BigInt(e.n),o=BigInt(e.d),"s"in e&&(t*=BigInt(e.s));else if(0 in e)t=BigInt(e[0]),1 in e&&(o=BigInt(e[1]));else if(typeof e=="bigint")t=e;else throw La();a=t*o}else if(typeof e=="number"){if(isNaN(e))throw La();if(e<0&&(a=-ir,e=-e),e%1===0)t=BigInt(e);else if(e>0){let n=1,i=0,u=1,l=1,f=1,s=1e7;for(e>=1&&(n=10**Math.floor(1+Math.log10(e)),e/=n);u<=s&&f<=s;){let d=(i+l)/(u+f);if(e===d){u+f<=s?(t=i+l,o=u+f):f>u?(t=l,o=f):(t=i,o=u);break}else e>d?(i+=l,u+=f):(l+=i,f+=u),u>s?(t=l,o=f):(t=i,o=u)}t=BigInt(t)*BigInt(n),o=BigInt(o)}}else if(typeof e=="string"){let n=0,i=Ve,u=Ve,l=Ve,f=ir,s=ir,d=e.replace(/_/g,"").match(/\d+|./g);if(d===null)throw La();if(d[n]==="-"?(a=-ir,n++):d[n]==="+"&&n++,d.length===n+1?u=na(d[n++],a):d[n+1]==="."||d[n]==="."?(d[n]!=="."&&(i=na(d[n++],a)),n++,(n+1===d.length||d[n+1]==="("&&d[n+3]===")"||d[n+1]==="'"&&d[n+3]==="'")&&(u=na(d[n],a),f=Zt**BigInt(d[n].length),n++),(d[n]==="("&&d[n+2]===")"||d[n]==="'"&&d[n+2]==="'")&&(l=na(d[n+1],a),s=Zt**BigInt(d[n+1].length)-ir,n+=3)):d[n+1]==="/"||d[n+1]===":"?(u=na(d[n],a),f=na(d[n+2],ir),n+=3):d[n+3]==="/"&&d[n+1]===" "&&(i=na(d[n],a),u=na(d[n+2],a),f=na(d[n+4],ir),n+=5),d.length<=n)o=f*s,a=t=l+o*i+s*u;else throw La()}else if(typeof e=="bigint")t=e,a=e,o=ir;else throw La();if(o===Ve)throw Hd();Ee.s=a<Ve?-ir:ir,Ee.n=t<Ve?-t:t,Ee.d=o<Ve?-o:o};Hd=function(){return new Error("Division by Zero")},La=function(){return new Error("Invalid argument")},v1=function(){return new Error("Parameters must be integer")};ro.prototype={s:ir,n:Ve,d:ir,abs:function(){return qr(this.n,this.d)},neg:function(){return qr(-this.s*this.n,this.d)},add:function(e,r){return ft(e,r),qr(this.s*this.n*Ee.d+Ee.s*this.d*Ee.n,this.d*Ee.d)},sub:function(e,r){return ft(e,r),qr(this.s*this.n*Ee.d-Ee.s*this.d*Ee.n,this.d*Ee.d)},mul:function(e,r){return ft(e,r),qr(this.s*Ee.s*this.n*Ee.n,this.d*Ee.d)},div:function(e,r){return ft(e,r),qr(this.s*Ee.s*this.n*Ee.d,this.d*Ee.n)},clone:function(){return qr(this.s*this.n,this.d)},mod:function(e,r){if(e===void 0)return qr(this.s*this.n%this.d,ir);if(ft(e,r),Ve===Ee.n*this.d)throw Hd();return qr(this.s*(Ee.d*this.n)%(Ee.n*this.d),Ee.d*this.d)},gcd:function(e,r){return ft(e,r),qr(mn(Ee.n,this.n)*mn(Ee.d,this.d),Ee.d*this.d)},lcm:function(e,r){return ft(e,r),Ee.n===Ve&&this.n===Ve?qr(Ve,ir):qr(Ee.n*this.n,mn(Ee.n,this.n)*mn(Ee.d,this.d))},inverse:function(){return qr(this.s*this.d,this.n)},pow:function(e,r){if(ft(e,r),Ee.d===ir)return Ee.s<Ve?qr((this.s*this.d)**Ee.n,this.n**Ee.n):qr((this.s*this.n)**Ee.n,this.d**Ee.n);if(this.s<Ve)return null;let t=Qn(this.n),o=Qn(this.d),a=ir,n=ir;for(let i in t)if(i!=="1"){if(i==="0"){a=Ve;break}if(t[i]*=Ee.n,t[i]%Ee.d===Ve)t[i]/=Ee.d;else return null;a*=BigInt(i)**t[i]}for(let i in o)if(i!=="1"){if(o[i]*=Ee.n,o[i]%Ee.d===Ve)o[i]/=Ee.d;else return null;n*=BigInt(i)**o[i]}return Ee.s<Ve?qr(n,a):qr(a,n)},log:function(e,r){if(ft(e,r),this.s<=Ve||Ee.s<=Ve)return null;let t={},o=Qn(Ee.n),a=Qn(Ee.d),n=Qn(this.n),i=Qn(this.d);for(let f in a)o[f]=(o[f]||Ve)-a[f];for(let f in i)n[f]=(n[f]||Ve)-i[f];for(let f in o)f!=="1"&&(t[f]=!0);for(let f in n)f!=="1"&&(t[f]=!0);let u=null,l=null;for(let f in t){let s=o[f]||Ve,d=n[f]||Ve;if(s===Ve){if(d!==Ve)return null;continue}let m=d,p=s,x=mn(m,p);if(m/=x,p/=x,u===null&&l===null)u=m,l=p;else if(m*l!==u*p)return null}return u!==null&&l!==null?qr(u,l):null},equals:function(e,r){return ft(e,r),this.s*this.n*Ee.d===Ee.s*Ee.n*this.d},lt:function(e,r){return ft(e,r),this.s*this.n*Ee.d<Ee.s*Ee.n*this.d},lte:function(e,r){return ft(e,r),this.s*this.n*Ee.d<=Ee.s*Ee.n*this.d},gt:function(e,r){return ft(e,r),this.s*this.n*Ee.d>Ee.s*Ee.n*this.d},gte:function(e,r){return ft(e,r),this.s*this.n*Ee.d>=Ee.s*Ee.n*this.d},compare:function(e,r){ft(e,r);let t=this.s*this.n*Ee.d-Ee.s*Ee.n*this.d;return(Ve<t)-(t<Ve)},ceil:function(e){return e=Zt**BigInt(e||0),qr(Bo(this.s*e*this.n/this.d)+(e*this.n%this.d>Ve&&this.s>=Ve?ir:Ve),e)},floor:function(e){return e=Zt**BigInt(e||0),qr(Bo(this.s*e*this.n/this.d)-(e*this.n%this.d>Ve&&this.s<Ve?ir:Ve),e)},round:function(e){return e=Zt**BigInt(e||0),qr(Bo(this.s*e*this.n/this.d)+this.s*((this.s>=Ve?ir:Ve)+tf*(e*this.n%this.d)>this.d?ir:Ve),e)},roundTo:function(e,r){ft(e,r);let t=this.n*Ee.d,o=this.d*Ee.n,a=t%o,n=Bo(t/o);return a+a>=o&&n++,qr(this.s*n*Ee.n,Ee.d)},divisible:function(e,r){return ft(e,r),!(!(Ee.n*this.d)||this.n*Ee.d%(Ee.n*this.d))},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(e){let r=this.n,t=this.d;e=e||15;let o=oK(r,t),a=aK(r,t,o),n=this.s<Ve?"-":"";if(n+=Bo(r/t),r%=t,r*=Zt,r&&(n+="."),o){for(let i=a;i--;)n+=Bo(r/t),r%=t,r*=Zt;n+="(";for(let i=o;i--;)n+=Bo(r/t),r%=t,r*=Zt;n+=")"}else for(let i=e;r&&i--;)n+=Bo(r/t),r%=t,r*=Zt;return n},toFraction:function(e){let r=this.n,t=this.d,o=this.s<Ve?"-":"";if(t===ir)o+=r;else{let a=Bo(r/t);e&&a>Ve&&(o+=a,o+=" ",r%=t),o+=r,o+="/",o+=t}return o},toLatex:function(e){let r=this.n,t=this.d,o=this.s<Ve?"-":"";if(t===ir)o+=r;else{let a=Bo(r/t);e&&a>Ve&&(o+=a,r%=t),o+="\\frac{",o+=r,o+="}{",o+=t,o+="}"}return o},toContinued:function(){let e=this.n,r=this.d,t=[];do{t.push(Bo(e/r));let o=e%r;e=r,r=o}while(e!==ir);return t},simplify:function(e){let r=BigInt(1/(e||.001)|0),t=this.abs(),o=t.toContinued();for(let a=1;a<o.length;a++){let n=qr(o[a-1],ir);for(let u=a-2;u>=0;u--)n=n.inverse().add(o[u]);let i=n.sub(t);if(i.n*r<i.d)return n.mul(this.s)}return this}}});var nK,iK,Wd,y1=T(()=>{g1();U();nK="Fraction",iK=[],Wd=O(nK,iK,()=>(Object.defineProperty(ro,"name",{value:"Fraction"}),ro.prototype.constructor=ro,ro.prototype.type="Fraction",ro.prototype.isFraction=!0,ro.prototype.toJSON=function(){return{mathjs:"Fraction",n:String(this.s*this.n),d:String(this.d)}},ro.fromJSON=function(e){return new ro(e)},ro),{isClass:!0})});var fK,uK,Vd,S1=T(()=>{Se();He();U();fK="Range",uK=[],Vd=O(fK,uK,()=>{function e(r,t,o){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var a=r!=null,n=t!=null,i=o!=null;if(a){if(Fe(r))r=r.toNumber();else if(typeof r!="number"&&!Ma(r))throw new TypeError("Parameter start must be a number or bigint")}if(n){if(Fe(t))t=t.toNumber();else if(typeof t!="number"&&!Ma(t))throw new TypeError("Parameter end must be a number or bigint")}if(i){if(Fe(o))o=o.toNumber();else if(typeof o!="number"&&!Ma(o))throw new TypeError("Parameter step must be a number or bigint")}this.start=a?parseFloat(r):0,this.end=n?parseFloat(t):0,this.step=i?parseFloat(o):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(r){if(typeof r!="string")return null;var t=r.split(":"),o=t.map(function(n){return parseFloat(n)}),a=o.some(function(n){return isNaN(n)});if(a)return null;switch(o.length){case 2:return new e(o[0],o[1]);case 3:return new e(o[0],o[2],o[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var r=0,t=this.start,o=this.step,a=this.end,n=a-t;return lo(o)===lo(n)?r=Math.ceil(n/o):n===0&&(r=0),isNaN(r)&&(r=0),[r]},e.prototype.min=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start:this.start+(r-1)*this.step},e.prototype.max=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start+(r-1)*this.step:this.start},e.prototype.forEach=function(r){var t=this.start,o=this.step,a=this.end,n=0;if(o>0)for(;t<a;)r(t,[n],this),t+=o,n++;else if(o<0)for(;t>a;)r(t,[n],this),t+=o,n++},e.prototype.map=function(r){var t=[];return this.forEach(function(o,a,n){t[a[0]]=r(o,a,n)}),t},e.prototype.toArray=function(){var r=[];return this.forEach(function(t,o){r[o[0]]=t}),r},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(r){var t=Eo(this.start,r);return this.step!==1&&(t+=":"+Eo(this.step,r)),t+=":"+Eo(this.end,r),t},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(r){return new e(r.start,r.end,r.step)},e},{isClass:!0})});var sK,lK,Gd,w1=T(()=>{U();sK="Matrix",lK=[],Gd=O(sK,lK,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(r,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(r,t,o){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(r){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(r,t,o){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(r,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(r,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(r,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(r){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(r){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0})});function $d(e,r,t){var o=e.constructor,a=new o(2),n="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!be(t))throw new Error("size must be an integer");if(e.greaterThan(a.pow(t-1).sub(1))||e.lessThan(a.pow(t-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(a.pow(t))),n="i".concat(t)}switch(r){case 2:return"".concat(e.toBinary()).concat(n);case 8:return"".concat(e.toOctal()).concat(n);case 16:return"".concat(e.toHexadecimal()).concat(n);default:throw new Error("Base ".concat(r," not supported "))}}function D1(e,r){if(typeof r=="function")return r(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:t,precision:o,wordSize:a}=Cd(r);switch(t){case"fixed":return pK(e,o);case"exponential":return T1(e,o);case"engineering":return dK(e,o);case"bin":return $d(e,2,a);case"oct":return $d(e,8,a);case"hex":return $d(e,16,a);case"auto":{var n=b1(r?.lowerExp,-3),i=b1(r?.upperExp,5);if(e.isZero())return"0";var u,l=e.toSignificantDigits(o),f=l.e;return f>=n&&f<i?u=l.toFixed():u=T1(e,o),u.replace(/((\.\d*?)(0+))($|e)/,function(){var s=arguments[2],d=arguments[4];return s!=="."?s+d:d})}default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function dK(e,r){var t=e.e,o=t%3===0?t:t<0?t-3-t%3:t-t%3,a=e.mul(Math.pow(10,-o)),n=a.toPrecision(r);if(n.includes("e")){var i=e.constructor;n=new i(n).toFixed()}return n+"e"+(t>=0?"+":"")+o.toString()}function T1(e,r){return r!==void 0?e.toExponential(r-1):e.toExponential()}function pK(e,r){return e.toFixed(r)}function b1(e,r){return ke(e)?e:Fe(e)?e.toNumber():r}var A1=T(()=>{Se();He()});function C1(e,r){var t=e.length-r.length,o=e.length;return e.substring(t,o)===r}function Ie(e,r){var t=mK(e,r);return r&&typeof r=="object"&&"truncate"in r&&t.length>r.truncate?t.substring(0,r.truncate-3)+"...":t}function mK(e,r){if(typeof e=="number")return Eo(e,r);if(Fe(e))return D1(e,r);if(cK(e))return!r||r.fraction!=="decimal"?"".concat(e.s*e.n,"/").concat(e.d):e.toString();if(Array.isArray(e))return R1(e,r);if(zr(e))return cn(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(r);if(e&&e.toString(r)!=={}.toString())return e.toString(r);var t=Object.keys(e).map(o=>cn(o)+": "+Ie(e[o],r));return"{"+t.join(", ")+"}"}return String(e)}function cn(e){for(var r=String(e),t="",o=0;o<r.length;){var a=r.charAt(o);t+=a in O1?O1[a]:a,o++}return'"'+t+'"'}function tt(e){var r=String(e);return r=r.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),r}function R1(e,r){if(Array.isArray(e)){for(var t="[",o=e.length,a=0;a<o;a++)a!==0&&(t+=", "),t+=R1(e[a],r);return t+="]",t}else return Ie(e,r)}function cK(e){return e&&typeof e=="object"&&typeof e.s=="bigint"&&typeof e.n=="bigint"&&typeof e.d=="bigint"||!1}function Xu(e,r){if(!zr(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+ar(e)+", index: 0)");if(!zr(r))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+ar(r)+", index: 1)");return e===r?0:e>r?1:-1}var O1,Er=T(()=>{Se();He();A1();O1={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"}});function Ue(e,r,t){if(!(this instanceof Ue))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=r,this.relation=t,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(r)?"["+r.join(", ")+"]":r)+")",this.stack=new Error().stack}var yt=T(()=>{Ue.prototype=new RangeError;Ue.prototype.constructor=RangeError;Ue.prototype.name="DimensionError";Ue.prototype.isDimensionError=!0});function St(e,r,t){if(!(this instanceof St))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=r):(this.min=r,this.max=t),this.min!==void 0&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":this.max!==void 0&&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}var xn=T(()=>{St.prototype=new RangeError;St.prototype.constructor=RangeError;St.prototype.name="IndexError";St.prototype.isIndexError=!0});function _e(e){for(var r=[];Array.isArray(e);)r.push(e.length),e=e[0];return r}function N1(e,r,t){var o,a=e.length;if(a!==r[t])throw new Ue(a,r[t]);if(t<r.length-1){var n=t+1;for(o=0;o<a;o++){var i=e[o];if(!Array.isArray(i))throw new Ue(r.length-1,r.length,"<");N1(e[o],r,n)}}else for(o=0;o<a;o++)if(Array.isArray(e[o]))throw new Ue(r.length+1,r.length,">")}function Qd(e,r){var t=r.length===0;if(t){if(Array.isArray(e))throw new Ue(e.length,0)}else N1(e,r,0)}function of(e,r){var t=e.isMatrix?e._size:_e(e),o=r._sourceSize;o.forEach((a,n)=>{if(a!==null&&a!==t[n])throw new Ue(a,t[n])})}function Sr(e,r){if(e!==void 0){if(!ke(e)||!be(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof r=="number"&&e>=r)throw new St(e,r)}}function hn(e){for(var r=0;r<e._dimensions.length;++r){var t=e._dimensions[r];if(t._data&&fr(t._data)){if(t._size[0]===0)return!0}else if(t.isRange){if(t.start===t.end)return!0}else if(zr(t)&&t.length===0)return!0}return!1}function _o(e,r,t){if(!Array.isArray(r))throw new TypeError("Array expected");if(r.length===0)throw new Error("Resizing to scalar is not supported");r.forEach(function(a){if(!ke(a)||!be(a)||a<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ie(r)+")")}),(ke(e)||Fe(e))&&(e=[e]);var o=t!==void 0?t:0;return Kd(e,r,0,o),e}function Kd(e,r,t,o){var a,n,i=e.length,u=r[t],l=Math.min(i,u);if(e.length=u,t<r.length-1){var f=t+1;for(a=0;a<l;a++)n=e[a],Array.isArray(n)||(n=[n],e[a]=n),Kd(n,r,f,o);for(a=l;a<u;a++)n=[],e[a]=n,Kd(n,r,f,o)}else{for(a=0;a<l;a++)for(;Array.isArray(e[a]);)e[a]=e[a][0];for(a=l;a<u;a++)e[a]=o}}function af(e,r){var t=Qe(e),o=t.length;if(!Array.isArray(e)||!Array.isArray(r))throw new TypeError("Array expected");if(r.length===0)throw new Ue(0,o,"!=");r=nf(r,o);var a=M1(r);if(o!==a)throw new Ue(a,o,"!=");try{return xK(t,r)}catch(n){throw n instanceof Ue?new Ue(a,o,"!="):n}}function nf(e,r){var t=M1(e),o=e.slice(),a=-1,n=e.indexOf(a),i=e.indexOf(a,n+1)>=0;if(i)throw new Error("More than one wildcard in sizes");var u=n>=0,l=r%t===0;if(u)if(l)o[n]=-r/t;else throw new Error("Could not replace wildcard, since "+r+" is no multiple of "+-t);return o}function M1(e){return e.reduce((r,t)=>r*t,1)}function xK(e,r){for(var t=e,o,a=r.length-1;a>0;a--){var n=r[a];o=[];for(var i=t.length/n,u=0;u<i;u++)o.push(t.slice(u*n,(u+1)*n));t=o}return t}function Zn(e,r){for(var t=r||_e(e);Array.isArray(e)&&e.length===1;)e=e[0],t.shift();for(var o=t.length;t[o-1]===1;)o--;return o<t.length&&(e=E1(e,o,0),t.length=o),e}function E1(e,r,t){var o,a;if(t<r){var n=t+1;for(o=0,a=e.length;o<a;o++)e[o]=E1(e[o],r,n)}else for(;Array.isArray(e);)e=e[0];return e}function Ju(e,r,t,o){var a=o||_e(e);if(t)for(var n=0;n<t;n++)e=[e],a.unshift(1);for(e=F1(e,r,0);a.length<r;)a.push(1);return e}function F1(e,r,t){var o,a;if(Array.isArray(e)){var n=t+1;for(o=0,a=e.length;o<a;o++)e[o]=F1(e[o],r,n)}else for(var i=t;i<r;i++)e=[e];return e}function Qe(e){if(!Array.isArray(e))return e;var r=[];return e.forEach(function t(o){Array.isArray(o)?o.forEach(t):r.push(o)}),r}function mo(e,r){return Array.prototype.map.call(e,r)}function ju(e,r){Array.prototype.forEach.call(e,r)}function B1(e,r){if(_e(e).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,r)}function Zd(e,r){if(_e(e).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t=>r.test(t))}function Yd(e,r){return Array.prototype.join.call(e,r)}function ia(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var r=[],t=0;r[0]={value:e[0],identifier:0};for(var o=1;o<e.length;o++)e[o]===e[o-1]?t++:t=0,r.push({value:e[o],identifier:t});return r}function Yn(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;for(var r=[],t=0;t<e.length;t++)r.push(e[t].value);return r}function vn(e,r){for(var t,o=0,a=0;a<e.length;a++){var n=e[a],i=Array.isArray(n);if(a===0&&i&&(o=n.length),i&&n.length!==o)return;var u=i?vn(n,r):r(n);if(t===void 0)t=u;else if(t!==u)return"mixed"}return t}function _1(e,r,t,o){if(o<t){if(e.length!==r.length)throw new Ue(e.length,r.length);for(var a=[],n=0;n<e.length;n++)a[n]=_1(e[n],r[n],t,o+1);return a}else return e.concat(r)}function Xd(){var e=Array.prototype.slice.call(arguments,0,-1),r=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(t,o){return _1(t,o,r,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function ff(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];for(var o=r.map(m=>m.length),a=Math.max(...o),n=new Array(a).fill(null),i=0;i<r.length;i++)for(var u=r[i],l=o[i],f=0;f<l;f++){var s=a-l+f;u[f]>n[s]&&(n[s]=u[f])}for(var d=0;d<r.length;d++)P1(r[d],n);return n}function P1(e,r){for(var t=r.length,o=e.length,a=0;a<o;a++){var n=t-o+a;if(e[a]<r[n]&&e[a]>1||e[a]>r[n])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(o," with size ").concat(e[a]," to size ").concat(r[n]))}}function Ko(e,r){var t=_e(e);if(Kt(t,r))return e;P1(t,r);var o=ff(t,r),a=o.length,n=[...Array(a-t.length).fill(1),...t],i=vK(e);t.length<a&&(i=af(i,n),t=_e(i));for(var u=0;u<a;u++)t[u]<o[u]&&(i=hK(i,o[u],u),t=_e(i));return i}function hK(e,r,t){return Xd(...Array(r).fill(e),t)}function Xn(e,r){if(!Array.isArray(e))throw new Error("Array expected");var t=_e(e);if(r.length!==t.length)throw new Ue(r.length,t.length);for(var o=0;o<r.length;o++)Sr(r[o],t[o]);return r.reduce((a,n)=>a[n],e)}function uf(e,r,t,o){return Array.isArray(e)?e.map(function(a,n){return uf(a,r.concat(n),t,o)}):o(e,r,t)}function vK(e){return Pr([],e)}var ze=T(()=>{Oa();He();Se();Er();yt();xn();lr()});function co(e,r,t){if(Jd.default.isTypedFunction(e)){var o=(r.isMatrix?r.size():_e(r)).map(()=>0),a=r.isMatrix?r.get(o):Xn(r,o),n=Object.keys(e.signatures).length===1,i=gK(e,a,o,r),u=n?Object.values(e.signatures)[0]:e;return i>=1&&i<=3?function(){for(var l=arguments.length,f=new Array(l),s=0;s<l;s++)f[s]=arguments[s];return k1(u,f.slice(0,i),t,e.name)}:function(){for(var l=arguments.length,f=new Array(l),s=0;s<l;s++)f[s]=arguments[s];return k1(u,f,t,e.name)}}return e}function gK(e,r,t,o){for(var a=[r,t,o],n=3;n>0;n--){var i=a.slice(0,n);if(Jd.default.resolve(e,i)!==null)return n}}function k1(e,r,t,o){try{return e(...r)}catch(a){yK(a,r,t,o)}}function yK(e,r,t,o){var a;if(e instanceof TypeError&&((a=e.data)===null||a===void 0?void 0:a.category)==="wrongType"){var n=[];throw n.push("value: ".concat(ar(r[0]))),r.length>=2&&n.push("index: ".concat(ar(r[1]))),r.length>=3&&n.push("array: ".concat(ar(r[2]))),new TypeError("Function ".concat(t," cannot apply callback arguments ")+"".concat(o,"(").concat(n.join(", "),") at index ").concat(JSON.stringify(r[1])))}else throw new TypeError("Function ".concat(t," cannot apply callback arguments ")+"to function ".concat(o,": ").concat(e.message))}var Jd,Jn=T(()=>{Jd=hr(Ad(),1);ze();Se()});var SK,wK,jd,L1=T(()=>{Se();ze();Er();He();lr();yt();U();Jn();SK="DenseMatrix",wK=["Matrix"],jd=O(SK,wK,e=>{var{Matrix:r}=e;function t(s,d){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(d&&!zr(d))throw new Error("Invalid datatype: "+d);if(Ae(s))s.type==="DenseMatrix"?(this._data=Pe(s._data),this._size=Pe(s._size),this._datatype=d||s._datatype):(this._data=s.toArray(),this._size=s.size(),this._datatype=d||s._datatype);else if(s&&fr(s.data)&&fr(s.size))this._data=s.data,this._size=s.size,Qd(this._data,this._size),this._datatype=d||s.datatype;else if(fr(s))this._data=f(s),this._size=_e(this._data),Qd(this._data,this._size),this._datatype=d;else{if(s)throw new TypeError("Unsupported type of data ("+ar(s)+")");this._data=[],this._size=[0],this._datatype=d}}t.prototype=new r,t.prototype.createDenseMatrix=function(s,d){return new t(s,d)},Object.defineProperty(t,"name",{value:"DenseMatrix"}),t.prototype.constructor=t,t.prototype.type="DenseMatrix",t.prototype.isDenseMatrix=!0,t.prototype.getDataType=function(){return vn(this._data,ar)},t.prototype.storage=function(){return"dense"},t.prototype.datatype=function(){return this._datatype},t.prototype.create=function(s,d){return new t(s,d)},t.prototype.subset=function(s,d,m){switch(arguments.length){case 1:return o(this,s);case 2:case 3:return n(this,s,d,m);default:throw new SyntaxError("Wrong number of arguments")}},t.prototype.get=function(s){return Xn(this._data,s)},t.prototype.set=function(s,d,m){if(!fr(s))throw new TypeError("Array expected");if(s.length<this._size.length)throw new Ue(s.length,this._size.length,"<");var p,x,c,v=s.map(function(b){return b+1});l(this,v,m);var y=this._data;for(p=0,x=s.length-1;p<x;p++)c=s[p],Sr(c,y.length),y=y[c];return c=s[s.length-1],Sr(c,y.length),y[c]=d,this};function o(s,d){if(!Ea(d))throw new TypeError("Invalid index");var m=d.isScalar();if(m)return s.get(d.min());var p=d.size();if(p.length!==s._size.length)throw new Ue(p.length,s._size.length);for(var x=d.min(),c=d.max(),v=0,y=s._size.length;v<y;v++)Sr(x[v],s._size[v]),Sr(c[v],s._size[v]);return new t(a(s._data,d,p.length,0),s._datatype)}function a(s,d,m,p){var x=p===m-1,c=d.dimension(p);return x?c.map(function(v){return Sr(v,s.length),s[v]}).valueOf():c.map(function(v){Sr(v,s.length);var y=s[v];return a(y,d,m,p+1)}).valueOf()}function n(s,d,m,p){if(!d||d.isIndex!==!0)throw new TypeError("Invalid index");var x=d.size(),c=d.isScalar(),v;if(Ae(m)?(v=m.size(),m=m.valueOf()):v=_e(m),c){if(v.length!==0)throw new TypeError("Scalar expected");s.set(d.min(),m,p)}else{if(!Kt(v,x))try{v.length===0?m=Ko([m],x):m=Ko(m,x),v=_e(m)}catch{}if(x.length<s._size.length)throw new Ue(x.length,s._size.length,"<");if(v.length<x.length){for(var y=0,b=0;x[y]===1&&v[y]===1;)y++;for(;x[y]===1;)b++,y++;m=Ju(m,x.length,b,v)}if(!Kt(x,v))throw new Ue(x,v,">");var h=d.max().map(function(g){return g+1});l(s,h,p);var S=x.length,w=0;i(s._data,d,m,S,w)}return s}function i(s,d,m,p,x){var c=x===p-1,v=d.dimension(x);c?v.forEach(function(y,b){Sr(y),s[y]=m[b[0]]}):v.forEach(function(y,b){Sr(y),i(s[y],d,m[b[0]],p,x+1)})}t.prototype.resize=function(s,d,m){if(!Wr(s))throw new TypeError("Array or Matrix expected");var p=s.valueOf().map(c=>Array.isArray(c)&&c.length===1?c[0]:c),x=m?this.clone():this;return u(x,p,d)};function u(s,d,m){if(d.length===0){for(var p=s._data;fr(p);)p=p[0];return p}return s._size=d.slice(0),s._data=_o(s._data,s._size,m),s}t.prototype.reshape=function(s,d){var m=d?this.clone():this;m._data=af(m._data,s);var p=m._size.reduce((x,c)=>x*c);return m._size=nf(s,p),m};function l(s,d,m){for(var p=s._size.slice(0),x=!1;p.length<d.length;)p.push(0),x=!0;for(var c=0,v=d.length;c<v;c++)d[c]>p[c]&&(p[c]=d[c],x=!0);x&&u(s,p,m)}t.prototype.clone=function(){var s=new t({data:Pe(this._data),size:Pe(this._size),datatype:this._datatype});return s},t.prototype.size=function(){return this._size.slice(0)},t.prototype._forEach=function(s){var d=this,m=d.size();if(m.length===1){for(var p=0;p<m[0];p++)s(d._data,p,[p]);return}var x=Array(m.length).fill(0),c=Array(m.length-1),v=c.length-1;c[0]=d._data[0];for(var y=0;y<v;y++)c[y+1]=c[y][0];for(x[v]=-1;;){var b=void 0;for(b=v;b>=0;b--){if(x[b]++,x[b]===m[b]){x[b]=0;continue}c[b]=b===0?d._data[x[b]]:c[b-1][x[b]];for(var h=b;h<v;h++)c[h+1]=c[h][0];for(var S=0;S<m[c.length];S++)x[c.length]=S,s(c[v],S,x.slice(0));break}if(b===-1)break}},t.prototype.map=function(s){var d=this,m=new t(d),p=co(s,d._data,"map");return m._forEach(function(x,c,v){x[c]=p(x[c],v,d)}),m},t.prototype.forEach=function(s){var d=this,m=co(s,d._data,"map");d._forEach(function(p,x,c){m(p[x],c,d)})},t.prototype[Symbol.iterator]=function*(){var s=function*(m,p){if(fr(m))for(var x=0;x<m.length;x++)yield*s(m[x],p.concat(x));else yield{value:m,index:p}};yield*s(this._data,[])},t.prototype.rows=function(){var s=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var m=this._data;for(var p of m)s.push(new t([p],this._datatype));return s},t.prototype.columns=function(){var s=this,d=[],m=this.size();if(m.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var p=this._data,x=function(y){var b=p.map(h=>[h[y]]);d.push(new t(b,s._datatype))},c=0;c<m[1];c++)x(c);return d},t.prototype.toArray=function(){return Pe(this._data)},t.prototype.valueOf=function(){return this._data},t.prototype.format=function(s){return Ie(this._data,s)},t.prototype.toString=function(){return Ie(this._data)},t.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},t.prototype.diagonal=function(s){if(s){if(Fe(s)&&(s=s.toNumber()),!ke(s)||!be(s))throw new TypeError("The parameter k must be an integer number")}else s=0;for(var d=s>0?s:0,m=s<0?-s:0,p=this._size[0],x=this._size[1],c=Math.min(p-m,x-d),v=[],y=0;y<c;y++)v[y]=this._data[y+m][y+d];return new t({data:v,size:[c],datatype:this._datatype})},t.diagonal=function(s,d,m,p){if(!fr(s))throw new TypeError("Array expected, size parameter");if(s.length!==2)throw new Error("Only two dimensions matrix are supported");if(s=s.map(function(A){if(Fe(A)&&(A=A.toNumber()),!ke(A)||!be(A)||A<1)throw new Error("Size values must be positive integers");return A}),m){if(Fe(m)&&(m=m.toNumber()),!ke(m)||!be(m))throw new TypeError("The parameter k must be an integer number")}else m=0;var x=m>0?m:0,c=m<0?-m:0,v=s[0],y=s[1],b=Math.min(v-c,y-x),h;if(fr(d)){if(d.length!==b)throw new Error("Invalid value array length");h=function(C){return d[C]}}else if(Ae(d)){var S=d.size();if(S.length!==1||S[0]!==b)throw new Error("Invalid matrix length");h=function(C){return d.get([C])}}else h=function(){return d};p||(p=Fe(h(0))?h(0).mul(0):0);var w=[];if(s.length>0){w=_o(w,s,p);for(var g=0;g<b;g++)w[g+c][g+x]=h(g)}return new t({data:w,size:[v,y]})},t.fromJSON=function(s){return new t(s)},t.prototype.swapRows=function(s,d){if(!ke(s)||!be(s)||!ke(d)||!be(d))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Sr(s,this._size[0]),Sr(d,this._size[0]),t._swapRows(s,d,this._data),this},t._swapRows=function(s,d,m){var p=m[s];m[s]=m[d],m[d]=p};function f(s){return Ae(s)?f(s.valueOf()):fr(s)?s.map(f):s}return t},{isClass:!0})});var I1,TK,ep,z1=T(()=>{lr();U();I1="clone",TK=["typed"],ep=O(I1,TK,e=>{var{typed:r}=e;return r(I1,{any:Pe})})});function es(e){var r=e.length,t=e[0].length,o,a,n=[];for(a=0;a<t;a++){var i=[];for(o=0;o<r;o++)i.push(e[o][a]);n.push(i)}return n}var rp=T(()=>{});function xo(e){for(var r=0;r<e.length;r++)if(Wr(e[r]))return!0;return!1}function Ct(e,r){Ae(e)&&(e=e.valueOf());for(var t=0,o=e.length;t<o;t++){var a=e[t];Array.isArray(a)?Ct(a,r):r(a)}}function Oe(e,r,t){return e&&typeof e.map=="function"?e.map(function(o){return Oe(o,r,t)}):r(e)}function Ia(e,r,t){var o=Array.isArray(e)?_e(e):e.size();if(r<0||r>=o.length)throw new St(r,o.length);return Ae(e)?e.create(rs(e.valueOf(),r,t),e.datatype()):rs(e,r,t)}function rs(e,r,t){var o,a,n,i;if(r<=0)if(Array.isArray(e[0])){for(i=es(e),a=[],o=0;o<i.length;o++)a[o]=rs(i[o],r-1,t);return a}else{for(n=e[0],o=1;o<e.length;o++)n=t(n,e[o]);return n}else{for(a=[],o=0;o<e.length;o++)a[o]=rs(e[o],r-1,t);return a}}function tp(e,r,t,o,a,n,i,u,l,f,s){var d=e._values,m=e._index,p=e._ptr,x,c,v,y;if(o)for(c=p[r],v=p[r+1],x=c;x<v;x++)y=m[x],t[y]!==n?(t[y]=n,i.push(y),f?(o[y]=l?u(d[x],s):u(s,d[x]),a[y]=n):o[y]=d[x]):(o[y]=l?u(d[x],o[y]):u(o[y],d[x]),a[y]=n);else for(c=p[r],v=p[r+1],x=c;x<v;x++)y=m[x],t[y]!==n?(t[y]=n,i.push(y)):a[y]=n}var je=T(()=>{Se();xn();ze();rp()});var q1,bK,op,U1=T(()=>{je();He();U();q1="isInteger",bK=["typed"],op=O(q1,bK,e=>{var{typed:r}=e;return r(q1,{number:be,BigNumber:function(o){return o.isInt()},bigint:function(o){return!0},Fraction:function(o){return o.d===1n},"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t))})})});function ap(e){return Math.abs(e)}function np(e,r){return e+r}function ip(e,r){return e-r}function fp(e,r){return e*r}function DK(e,r){return e/r}function up(e){return-e}function sp(e){return e}function jn(e){return Hb(e)}function lp(e){return e*e*e}function dp(e){return Math.exp(e)}function pp(e){return Wb(e)}function AK(e,r){if(!be(e)||!be(r))throw new Error("Parameters in function gcd must be integer numbers");for(var t;r!==0;)t=e%r,e=r,r=t;return e<0?-e:e}function mp(e,r){if(!be(e)||!be(r))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||r===0)return 0;for(var t,o=e*r;r!==0;)t=r,r=e%t,e=t;return Math.abs(o/e)}function cp(e,r){return r?Math.log(e)/Math.log(r):Math.log(e)}function sf(e){return Ub(e)}function ts(e){return qb(e)}function OK(e){return Pu(e)}function CK(e,r){return r===0?e:e-r*Math.floor(e/r)}function xp(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,t=r<0;if(t&&(r=-r),r===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(r)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return t?1/0:0;if(!isFinite(e))return t?0:e;var o=Math.pow(Math.abs(e),1/r);return o=e<0?-o:o,t?1/o:o}function os(e){return lo(e)}function RK(e){return Math.sqrt(e)}function hp(e){return e*e}function vp(e,r){var t,o,a,n=0,i=1,u=1,l=0;if(!be(e)||!be(r))throw new Error("Parameters in function xgcd must be integer numbers");for(;r;)o=Math.floor(e/r),a=e-o*r,t=n,n=i-o*n,i=t,t=u,u=l-o*u,l=t,e=r,r=a;var f;return e<0?f=[-e,-i,-l]:f=[e,e?i:0,l],f}function gp(e,r){return e*e<1&&r===1/0||e*e>1&&r===-1/0?0:Math.pow(e,r)}function ei(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!be(r)||r<0||r>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(Rd(e,r))}function NK(e){return Math.abs(e)}var Yt,fa,H1=T(()=>{He();Yt="number",fa="number, number";ap.signature=Yt;np.signature=fa;ip.signature=fa;fp.signature=fa;DK.signature=fa;up.signature=Yt;sp.signature=Yt;jn.signature=Yt;lp.signature=Yt;dp.signature=Yt;pp.signature=Yt;AK.signature=fa;mp.signature=fa;sf.signature=Yt;ts.signature=Yt;OK.signature=Yt;CK.signature=fa;os.signature=Yt;RK.signature=Yt;hp.signature=Yt;vp.signature=fa;gp.signature=fa;NK.signature=Yt});function yp(e,r){if(!be(e)||!be(r))throw new Error("Integers expected in function bitAnd");return e&r}function Sp(e){if(!be(e))throw new Error("Integer expected in function bitNot");return~e}function wp(e,r){if(!be(e)||!be(r))throw new Error("Integers expected in function bitOr");return e|r}function Tp(e,r){if(!be(e)||!be(r))throw new Error("Integers expected in function bitXor");return e^r}function bp(e,r){if(!be(e)||!be(r))throw new Error("Integers expected in function leftShift");return e<<r}function Dp(e,r){if(!be(e)||!be(r))throw new Error("Integers expected in function rightArithShift");return e>>r}function Ap(e,r){if(!be(e)||!be(r))throw new Error("Integers expected in function rightLogShift");return e>>>r}var MK,ri,W1=T(()=>{He();MK="number",ri="number, number";yp.signature=ri;Sp.signature=MK;wp.signature=ri;Tp.signature=ri;bp.signature=ri;Dp.signature=ri;Ap.signature=ri});function to(e,r){if(r<e)return 1;if(r===e)return r;var t=r+e>>1;return to(e,t)*to(t+1,r)}var lf=T(()=>{});function Op(e,r){if(!be(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!be(r)||r<0)throw new TypeError("Positive integer value expected in function combinations");if(r>e)throw new TypeError("k must be less than or equal to n");for(var t=e-r,o=1,a=r<t?t+1:r+1,n=2,i=r<t?r:t,u=a;u<=e;++u)for(o*=u;n<=i&&o%n===0;)o/=n,++n;return n<=i&&(o/=to(n,i)),o}var Cp=T(()=>{He();lf();Op.signature="number, number"});var V1,G1,$1,K1,Q1=T(()=>{V1=Math.PI,G1=2*Math.PI,$1=Math.E,K1=1.618033988749895});function Np(e){return!e}function as(e,r){return!!(e||r)}function ns(e,r){return!!e!=!!r}function is(e,r){return!!(e&&r)}var EK,Rp,Z1=T(()=>{EK="number",Rp="number, number";Np.signature=EK;as.signature=Rp;ns.signature=Rp;is.signature=Rp});var Y1=T(()=>{});function df(e){var r;if(be(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:to(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*df(1-e));if(e>=171.35)return 1/0;if(e>85){var t=e*e,o=t*e,a=o*e,n=a*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*t)-139/(51840*o)-571/(2488320*a)+163879/(209018880*n)+5246819/(75246796800*n*e))}--e,r=gn[0];for(var i=1;i<gn.length;++i)r+=gn[i]/(e+i);var u=e+Mp+.5;return Math.sqrt(2*Math.PI)*Math.pow(u,e+.5)*Math.exp(-u)*r}function pf(e){if(e<0)return NaN;if(e===0)return 1/0;if(!isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-pf(1-e);e=e-1;for(var r=e+FK+.5,t=X1[0],o=BK-1;o>=1;o--)t+=X1[o]/(e+o);return Ep+(e+.5)*Math.log(r)-r+Math.log(t)}var Mp,gn,Ep,FK,BK,X1,J1=T(()=>{He();lf();df.signature="number";Mp=4.7421875,gn=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],Ep=.9189385332046728,FK=5,BK=7,X1=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];pf.signature="number"});function PK(e){return Math.acos(e)}function Fp(e){return $b(e)}function Bp(e){return Math.atan(1/e)}function _p(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function Pp(e){return Math.asin(1/e)}function kp(e){var r=1/e;return Math.log(r+Math.sqrt(r*r+1))}function Lp(e){return Math.acos(1/e)}function Ip(e){var r=1/e,t=Math.sqrt(r*r-1);return Math.log(t+r)}function kK(e){return Math.asin(e)}function zp(e){return Kb(e)}function LK(e){return Math.atan(e)}function IK(e,r){return Math.atan2(e,r)}function qp(e){return Qb(e)}function zK(e){return Math.cos(e)}function qK(e){return Lu(e)}function Up(e){return 1/Math.tan(e)}function Hp(e){var r=Math.exp(2*e);return(r+1)/(r-1)}function Wp(e){return 1/Math.sin(e)}function Vp(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*lo(e)}function Gp(e){return 1/Math.cos(e)}function $p(e){return 2/(Math.exp(e)+Math.exp(-e))}function UK(e){return Math.sin(e)}function Kp(e){return Zb(e)}function HK(e){return Math.tan(e)}function WK(e){return Iu(e)}var Ur,_K,j1=T(()=>{He();Ur="number",_K="number, number";PK.signature=Ur;Fp.signature=Ur;Bp.signature=Ur;_p.signature=Ur;Pp.signature=Ur;kp.signature=Ur;Lp.signature=Ur;Ip.signature=Ur;kK.signature=Ur;zp.signature=Ur;LK.signature=Ur;IK.signature=_K;qp.signature=Ur;zK.signature=Ur;qK.signature=Ur;Up.signature=Ur;Hp.signature=Ur;Wp.signature=Ur;Vp.signature=Ur;Gp.signature=Ur;$p.signature=Ur;UK.signature=Ur;Kp.signature=Ur;HK.signature=Ur;WK.signature=Ur});function VK(e){return be(e)}function Qp(e){return e<0}function Zp(e){return e>0}function GK(e){return e===0}function Yp(e){return Number.isNaN(e)}var mf,eD=T(()=>{He();mf="number";VK.signature=mf;Qp.signature=mf;Zp.signature=mf;GK.signature=mf;Yp.signature=mf});var $e=T(()=>{H1();W1();Cp();Q1();Z1();Y1();J1();j1();eD()});function Vr(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-9,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(t<=0)throw new Error("Relative tolerance must be greater than 0");if(o<0)throw new Error("Absolute tolerance must be at least 0");return e.isNaN()||r.isNaN()?!1:!e.isFinite()||!r.isFinite()?e.eq(r):e.eq(r)?!0:e.minus(r).abs().lte(e.constructor.max(e.constructor.max(e.abs(),r.abs()).mul(t),o))}var ho=T(()=>{});var rD,$K,Xp,tD=T(()=>{je();U();$e();ho();He();rD="isNegative",$K=["typed","config"],Xp=O(rD,$K,e=>{var{typed:r,config:t}=e;return r(rD,{number:o=>Rr(o,0,t.relTol,t.absTol)?!1:Qp(o),BigNumber:o=>Vr(o,new o.constructor(0),t.relTol,t.absTol)?!1:o.isNeg()&&!o.isZero()&&!o.isNaN(),bigint:o=>o<0n,Fraction:o=>o.s<0n,Unit:r.referToSelf(o=>a=>r.find(o,a.valueType())(a.value)),"Array | Matrix":r.referToSelf(o=>a=>Oe(a,o))})})});var oD,KK,Jp,aD=T(()=>{je();U();oD="isNumeric",KK=["typed"],Jp=O(oD,KK,e=>{var{typed:r}=e;return r(oD,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t))})})});var nD,QK,jp,iD=T(()=>{U();nD="hasNumericValue",QK=["typed","isNumeric"],jp=O(nD,QK,e=>{var{typed:r,isNumeric:t}=e;return r(nD,{boolean:()=>!0,string:function(a){return a.trim().length>0&&!isNaN(Number(a))},any:function(a){return t(a)}})})});var fD,ZK,em,uD=T(()=>{je();U();$e();ho();He();fD="isPositive",ZK=["typed","config"],em=O(fD,ZK,e=>{var{typed:r,config:t}=e;return r(fD,{number:o=>Rr(o,0,t.relTol,t.absTol)?!1:Zp(o),BigNumber:o=>Vr(o,new o.constructor(0),t.relTol,t.absTol)?!1:!o.isNeg()&&!o.isZero()&&!o.isNaN(),bigint:o=>o>0n,Fraction:o=>o.s>0n&&o.n>0n,Unit:r.referToSelf(o=>a=>r.find(o,a.valueType())(a.value)),"Array | Matrix":r.referToSelf(o=>a=>Oe(a,o))})})});var sD,YK,rm,lD=T(()=>{je();U();sD="isZero",YK=["typed","equalScalar"],rm=O(sD,YK,e=>{var{typed:r,equalScalar:t}=e;return r(sD,{"number | BigNumber | Complex | Fraction":o=>t(o,0),bigint:o=>o===0n,Unit:r.referToSelf(o=>a=>r.find(o,a.valueType())(a.value)),"Array | Matrix":r.referToSelf(o=>a=>Oe(a,o))})})});var dD,XK,tm,pD=T(()=>{je();U();$e();dD="isNaN",XK=["typed"],tm=O(dD,XK,e=>{var{typed:r}=e;return r(dD,{number:Yp,BigNumber:function(o){return o.isNaN()},bigint:function(o){return!1},Fraction:function(o){return!1},Complex:function(o){return o.isNaN()},Unit:function(o){return Number.isNaN(o.value)},"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t))})})});var mD,JK,om,cD=T(()=>{U();Se();mD="typeOf",JK=["typed"],om=O(mD,JK,e=>{var{typed:r}=e;return r(mD,{any:ar})})});function xD(e,r,t,o){return Rr(e.re,r.re,t,o)&&Rr(e.im,r.im,t,o)}var hD=T(()=>{He()});var vo,yn=T(()=>{U();vo=O("compareUnits",["typed"],e=>{var{typed:r}=e;return{"Unit, Unit":r.referToSelf(t=>(o,a)=>{if(!o.equalBase(a))throw new Error("Cannot compare units with different base");return r.find(t,[o.valueType(),a.valueType()])(o.value,a.value)})}})});var fs,jK,am,Xue,vD=T(()=>{ho();He();U();hD();yn();fs="equalScalar",jK=["typed","config"],am=O(fs,jK,e=>{var{typed:r,config:t}=e,o=vo({typed:r});return r(fs,{"boolean, boolean":function(n,i){return n===i},"number, number":function(n,i){return Rr(n,i,t.relTol,t.absTol)},"BigNumber, BigNumber":function(n,i){return n.eq(i)||Vr(n,i,t.relTol,t.absTol)},"bigint, bigint":function(n,i){return n===i},"Fraction, Fraction":function(n,i){return n.equals(i)},"Complex, Complex":function(n,i){return xD(n,i,t.relTol,t.absTol)}},o)}),Xue=O(fs,["typed","config"],e=>{var{typed:r,config:t}=e;return r(fs,{"number, number":function(a,n){return Rr(a,n,t.relTol,t.absTol)}})})});var eQ,rQ,nm,gD=T(()=>{Se();He();Er();lr();ze();U();yt();Jn();eQ="SparseMatrix",rQ=["typed","equalScalar","Matrix"],nm=O(eQ,rQ,e=>{var{typed:r,equalScalar:t,Matrix:o}=e;function a(c,v){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(v&&!zr(v))throw new Error("Invalid datatype: "+v);if(Ae(c))n(this,c,v);else if(c&&fr(c.index)&&fr(c.ptr)&&fr(c.size))this._values=c.values,this._index=c.index,this._ptr=c.ptr,this._size=c.size,this._datatype=v||c.datatype;else if(fr(c))i(this,c,v);else{if(c)throw new TypeError("Unsupported type of data ("+ar(c)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=v}}function n(c,v,y){v.type==="SparseMatrix"?(c._values=v._values?Pe(v._values):void 0,c._index=Pe(v._index),c._ptr=Pe(v._ptr),c._size=Pe(v._size),c._datatype=y||v._datatype):i(c,v.valueOf(),y||v._datatype)}function i(c,v,y){c._values=[],c._index=[],c._ptr=[],c._datatype=y;var b=v.length,h=0,S=t,w=0;if(zr(y)&&(S=r.find(t,[y,y])||t,w=r.convert(0,y)),b>0){var g=0;do{c._ptr.push(c._index.length);for(var A=0;A<b;A++){var C=v[A];if(fr(C)){if(g===0&&h<C.length&&(h=C.length),g<C.length){var D=C[g];S(D,w)||(c._values.push(D),c._index.push(A))}}else g===0&&h<1&&(h=1),S(C,w)||(c._values.push(C),c._index.push(A))}g++}while(g<h)}c._ptr.push(c._index.length),c._size=[b,h]}a.prototype=new o,a.prototype.createSparseMatrix=function(c,v){return new a(c,v)},Object.defineProperty(a,"name",{value:"SparseMatrix"}),a.prototype.constructor=a,a.prototype.type="SparseMatrix",a.prototype.isSparseMatrix=!0,a.prototype.getDataType=function(){return vn(this._values,ar)},a.prototype.storage=function(){return"sparse"},a.prototype.datatype=function(){return this._datatype},a.prototype.create=function(c,v){return new a(c,v)},a.prototype.density=function(){var c=this._size[0],v=this._size[1];return c!==0&&v!==0?this._index.length/(c*v):0},a.prototype.subset=function(c,v,y){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return u(this,c);case 2:case 3:return l(this,c,v,y);default:throw new SyntaxError("Wrong number of arguments")}};function u(c,v){if(!Ea(v))throw new TypeError("Invalid index");var y=v.isScalar();if(y)return c.get(v.min());var b=v.size();if(b.length!==c._size.length)throw new Ue(b.length,c._size.length);var h,S,w,g,A=v.min(),C=v.max();for(h=0,S=c._size.length;h<S;h++)Sr(A[h],c._size[h]),Sr(C[h],c._size[h]);var D=c._values,N=c._index,E=c._ptr,_=v.dimension(0),L=v.dimension(1),P=[],k=[];_.forEach(function(B,V){k[B]=V[0],P[B]=!0});var R=D?[]:void 0,F=[],I=[];return L.forEach(function(B){for(I.push(F.length),w=E[B],g=E[B+1];w<g;w++)h=N[w],P[h]===!0&&(F.push(k[h]),R&&R.push(D[w]))}),I.push(F.length),new a({values:R,index:F,ptr:I,size:b,datatype:c._datatype})}function l(c,v,y,b){if(!v||v.isIndex!==!0)throw new TypeError("Invalid index");var h=v.size(),S=v.isScalar(),w;if(Ae(y)?(w=y.size(),y=y.toArray()):w=_e(y),S){if(w.length!==0)throw new TypeError("Scalar expected");c.set(v.min(),y,b)}else{if(h.length!==1&&h.length!==2)throw new Ue(h.length,c._size.length,"<");if(w.length<h.length){for(var g=0,A=0;h[g]===1&&w[g]===1;)g++;for(;h[g]===1;)A++,g++;y=Ju(y,h.length,A,w)}if(!Kt(h,w))throw new Ue(h,w,">");if(h.length===1){var C=v.dimension(0);C.forEach(function(E,_){Sr(E),c.set([E,0],y[_[0]],b)})}else{var D=v.dimension(0),N=v.dimension(1);D.forEach(function(E,_){Sr(E),N.forEach(function(L,P){Sr(L),c.set([E,L],y[_[0]][P[0]],b)})})}}return c}a.prototype.get=function(c){if(!fr(c))throw new TypeError("Array expected");if(c.length!==this._size.length)throw new Ue(c.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var v=c[0],y=c[1];Sr(v,this._size[0]),Sr(y,this._size[1]);var b=f(v,this._ptr[y],this._ptr[y+1],this._index);return b<this._ptr[y+1]&&this._index[b]===v?this._values[b]:0},a.prototype.set=function(c,v,y){if(!fr(c))throw new TypeError("Array expected");if(c.length!==this._size.length)throw new Ue(c.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var b=c[0],h=c[1],S=this._size[0],w=this._size[1],g=t,A=0;zr(this._datatype)&&(g=r.find(t,[this._datatype,this._datatype])||t,A=r.convert(0,this._datatype)),(b>S-1||h>w-1)&&(m(this,Math.max(b+1,S),Math.max(h+1,w),y),S=this._size[0],w=this._size[1]),Sr(b,S),Sr(h,w);var C=f(b,this._ptr[h],this._ptr[h+1],this._index);return C<this._ptr[h+1]&&this._index[C]===b?g(v,A)?s(C,h,this._values,this._index,this._ptr):this._values[C]=v:g(v,A)||d(C,b,h,v,this._values,this._index,this._ptr),this};function f(c,v,y,b){if(y-v===0)return y;for(var h=v;h<y;h++)if(b[h]===c)return h;return v}function s(c,v,y,b,h){y.splice(c,1),b.splice(c,1);for(var S=v+1;S<h.length;S++)h[S]--}function d(c,v,y,b,h,S,w){h.splice(c,0,b),S.splice(c,0,v);for(var g=y+1;g<w.length;g++)w[g]++}a.prototype.resize=function(c,v,y){if(!Wr(c))throw new TypeError("Array or Matrix expected");var b=c.valueOf().map(S=>Array.isArray(S)&&S.length===1?S[0]:S);if(b.length!==2)throw new Error("Only two dimensions matrix are supported");b.forEach(function(S){if(!ke(S)||!be(S)||S<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ie(b)+")")});var h=y?this.clone():this;return m(h,b[0],b[1],v)};function m(c,v,y,b){var h=b||0,S=t,w=0;zr(c._datatype)&&(S=r.find(t,[c._datatype,c._datatype])||t,w=r.convert(0,c._datatype),h=r.convert(h,c._datatype));var g=!S(h,w),A=c._size[0],C=c._size[1],D,N,E;if(y>C){for(N=C;N<y;N++)if(c._ptr[N]=c._values.length,g)for(D=0;D<A;D++)c._values.push(h),c._index.push(D);c._ptr[y]=c._values.length}else y<C&&(c._ptr.splice(y+1,C-y),c._values.splice(c._ptr[y],c._values.length),c._index.splice(c._ptr[y],c._index.length));if(C=y,v>A){if(g){var _=0;for(N=0;N<C;N++){c._ptr[N]=c._ptr[N]+_,E=c._ptr[N+1]+_;var L=0;for(D=A;D<v;D++,L++)c._values.splice(E+L,0,h),c._index.splice(E+L,0,D),_++}c._ptr[C]=c._values.length}}else if(v<A){var P=0;for(N=0;N<C;N++){c._ptr[N]=c._ptr[N]-P;var k=c._ptr[N],R=c._ptr[N+1]-P;for(E=k;E<R;E++)D=c._index[E],D>v-1&&(c._values.splice(E,1),c._index.splice(E,1),P++)}c._ptr[N]=c._values.length}return c._size[0]=v,c._size[1]=y,c}a.prototype.reshape=function(c,v){if(!fr(c))throw new TypeError("Array expected");if(c.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");c.forEach(function(B){if(!ke(B)||!be(B)||B<=-2||B===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Ie(c)+")")});var y=this._size[0]*this._size[1];c=nf(c,y);var b=c[0]*c[1];if(y!==b)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var h=v?this.clone():this;if(this._size[0]===c[0]&&this._size[1]===c[1])return h;for(var S=[],w=0;w<h._ptr.length;w++)for(var g=0;g<h._ptr[w+1]-h._ptr[w];g++)S.push(w);for(var A=h._values.slice(),C=h._index.slice(),D=0;D<h._index.length;D++){var N=C[D],E=S[D],_=N*h._size[1]+E;S[D]=_%c[1],C[D]=Math.floor(_/c[1])}h._values.length=0,h._index.length=0,h._ptr.length=c[1]+1,h._size=c.slice();for(var L=0;L<h._ptr.length;L++)h._ptr[L]=0;for(var P=0;P<A.length;P++){var k=C[P],R=S[P],F=A[P],I=f(k,h._ptr[R],h._ptr[R+1],h._index);d(I,k,R,F,h._values,h._index,h._ptr)}return h},a.prototype.clone=function(){var c=new a({values:this._values?Pe(this._values):void 0,index:Pe(this._index),ptr:Pe(this._ptr),size:Pe(this._size),datatype:this._datatype});return c},a.prototype.size=function(){return this._size.slice(0)},a.prototype.map=function(c,v){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var y=this,b=this._size[0],h=this._size[1],S=co(c,y,"map"),w=function(A,C,D){return S(A,[C,D],y)};return p(this,0,b-1,0,h-1,w,v)};function p(c,v,y,b,h,S,w){var g=[],A=[],C=[],D=t,N=0;zr(c._datatype)&&(D=r.find(t,[c._datatype,c._datatype])||t,N=r.convert(0,c._datatype));for(var E=function(z,j,ue){var ee=S(z,j,ue);D(ee,N)||(g.push(ee),A.push(j))},_=b;_<=h;_++){C.push(g.length);var L=c._ptr[_],P=c._ptr[_+1];if(w)for(var k=L;k<P;k++){var R=c._index[k];R>=v&&R<=y&&E(c._values[k],R-v,_-b)}else{for(var F={},I=L;I<P;I++){var B=c._index[I];F[B]=c._values[I]}for(var V=v;V<=y;V++){var J=V in F?F[V]:0;E(J,V-v,_-b)}}}return C.push(g.length),new a({values:g,index:A,ptr:C,size:[y-v+1,h-b+1]})}a.prototype.forEach=function(c,v){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var y=this,b=this._size[0],h=this._size[1],S=co(c,y,"forEach"),w=0;w<h;w++){var g=this._ptr[w],A=this._ptr[w+1];if(v)for(var C=g;C<A;C++){var D=this._index[C];S(this._values[C],[D,w],y)}else{for(var N={},E=g;E<A;E++){var _=this._index[E];N[_]=this._values[E]}for(var L=0;L<b;L++){var P=L in N?N[L]:0;S(P,[L,w],y)}}}},a.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var c=this._size[1],v=0;v<c;v++)for(var y=this._ptr[v],b=this._ptr[v+1],h=y;h<b;h++){var S=this._index[h];yield{value:this._values[h],index:[S,v]}}},a.prototype.toArray=function(){return x(this._values,this._index,this._ptr,this._size,!0)},a.prototype.valueOf=function(){return x(this._values,this._index,this._ptr,this._size,!1)};function x(c,v,y,b,h){var S=b[0],w=b[1],g=[],A,C;for(A=0;A<S;A++)for(g[A]=[],C=0;C<w;C++)g[A][C]=0;for(C=0;C<w;C++)for(var D=y[C],N=y[C+1],E=D;E<N;E++)A=v[E],g[A][C]=c?h?Pe(c[E]):c[E]:1;return g}return a.prototype.format=function(c){for(var v=this._size[0],y=this._size[1],b=this.density(),h="Sparse Matrix ["+Ie(v,c)+" x "+Ie(y,c)+"] density: "+Ie(b,c)+`
10
+ `,S=0;S<y;S++)for(var w=this._ptr[S],g=this._ptr[S+1],A=w;A<g;A++){var C=this._index[A];h+=`
11
+ (`+Ie(C,c)+", "+Ie(S,c)+") ==> "+(this._values?Ie(this._values[A],c):"X")}return h},a.prototype.toString=function(){return Ie(this.toArray())},a.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},a.prototype.diagonal=function(c){if(c){if(Fe(c)&&(c=c.toNumber()),!ke(c)||!be(c))throw new TypeError("The parameter k must be an integer number")}else c=0;var v=c>0?c:0,y=c<0?-c:0,b=this._size[0],h=this._size[1],S=Math.min(b-y,h-v),w=[],g=[],A=[];A[0]=0;for(var C=v;C<h&&w.length<S;C++)for(var D=this._ptr[C],N=this._ptr[C+1],E=D;E<N;E++){var _=this._index[E];if(_===C-v+y){w.push(this._values[E]),g[w.length-1]=_-y;break}}return A.push(w.length),new a({values:w,index:g,ptr:A,size:[S,1]})},a.fromJSON=function(c){return new a(c)},a.diagonal=function(c,v,y,b,h){if(!fr(c))throw new TypeError("Array expected, size parameter");if(c.length!==2)throw new Error("Only two dimensions matrix are supported");if(c=c.map(function(B){if(Fe(B)&&(B=B.toNumber()),!ke(B)||!be(B)||B<1)throw new Error("Size values must be positive integers");return B}),y){if(Fe(y)&&(y=y.toNumber()),!ke(y)||!be(y))throw new TypeError("The parameter k must be an integer number")}else y=0;var S=t,w=0;zr(h)&&(S=r.find(t,[h,h])||t,w=r.convert(0,h));var g=y>0?y:0,A=y<0?-y:0,C=c[0],D=c[1],N=Math.min(C-A,D-g),E;if(fr(v)){if(v.length!==N)throw new Error("Invalid value array length");E=function(V){return v[V]}}else if(Ae(v)){var _=v.size();if(_.length!==1||_[0]!==N)throw new Error("Invalid matrix length");E=function(V){return v.get([V])}}else E=function(){return v};for(var L=[],P=[],k=[],R=0;R<D;R++){k.push(L.length);var F=R-g;if(F>=0&&F<N){var I=E(F);S(I,w)||(P.push(F+A),L.push(I))}}return k.push(L.length),new a({values:L,index:P,ptr:k,size:[C,D]})},a.prototype.swapRows=function(c,v){if(!ke(c)||!be(c)||!ke(v)||!be(v))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Sr(c,this._size[0]),Sr(v,this._size[0]),a._swapRows(c,v,this._size[1],this._values,this._index,this._ptr),this},a._forEachRow=function(c,v,y,b,h){for(var S=b[c],w=b[c+1],g=S;g<w;g++)h(y[g],v[g])},a._swapRows=function(c,v,y,b,h,S){for(var w=0;w<y;w++){var g=S[w],A=S[w+1],C=f(c,g,A,h),D=f(v,g,A,h);if(C<A&&D<A&&h[C]===c&&h[D]===v){if(b){var N=b[C];b[C]=b[D],b[D]=N}continue}if(C<A&&h[C]===c&&(D>=A||h[D]!==v)){var E=b?b[C]:void 0;h.splice(D,0,v),b&&b.splice(D,0,E),h.splice(D<=C?C+1:C,1),b&&b.splice(D<=C?C+1:C,1);continue}if(D<A&&h[D]===v&&(C>=A||h[C]!==c)){var _=b?b[D]:void 0;h.splice(C,0,c),b&&b.splice(C,0,_),h.splice(C<=D?D+1:D,1),b&&b.splice(C<=D?D+1:D,1)}}},a},{isClass:!0})});function aQ(e){var r=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(r){var t={"0b":2,"0o":8,"0x":16}[r[1]],o=r[2],a=r[3];return{input:e,radix:t,integerPart:o,fractionalPart:a}}else return null}function nQ(e){for(var r=parseInt(e.integerPart,e.radix),t=0,o=0;o<e.fractionalPart.length;o++){var a=parseInt(e.fractionalPart[o],e.radix);t+=a/Math.pow(e.radix,o+1)}var n=r+t;if(isNaN(n))throw new SyntaxError('String "'+e.input+'" is not a valid number');return n}var tQ,oQ,im,yD=T(()=>{U();je();tQ="number",oQ=["typed"];im=O(tQ,oQ,e=>{var{typed:r}=e,t=r("number",{"":function(){return 0},number:function(a){return a},string:function(a){if(a==="NaN")return NaN;var n=aQ(a);if(n)return nQ(n);var i=0,u=a.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);u&&(i=Number(u[2]),a=u[1]);var l=Number(a);if(isNaN(l))throw new SyntaxError('String "'+a+'" is not a valid number');if(u){if(l>2**i-1)throw new SyntaxError('String "'.concat(a,'" is out of range'));l>=2**(i-1)&&(l=l-2**i)}return l},BigNumber:function(a){return a.toNumber()},bigint:function(a){return Number(a)},Fraction:function(a){return a.valueOf()},Unit:r.referToSelf(o=>a=>{var n=a.clone();return n.value=o(a.value),n}),null:function(a){return 0},"Unit, string | Unit":function(a,n){return a.toNumber(n)},"Array | Matrix":r.referToSelf(o=>a=>Oe(a,o))});return t.fromJSON=function(o){return parseFloat(o.value)},t})});var iQ,fQ,fm,SD=T(()=>{U();je();iQ="bigint",fQ=["typed"],fm=O(iQ,fQ,e=>{var{typed:r}=e,t=r("bigint",{"":function(){return 0n},bigint:function(a){return a},number:function(a){return BigInt(a.toFixed())},BigNumber:function(a){return BigInt(a.round().toString())},Fraction:function(a){return BigInt(a.valueOf().toFixed())},"string | boolean":function(a){return BigInt(a)},null:function(a){return 0n},"Array | Matrix":r.referToSelf(o=>a=>Oe(a,o))});return t.fromJSON=function(o){return BigInt(o.value)},t})});var wD,uQ,um,TD=T(()=>{U();je();He();wD="string",uQ=["typed"],um=O(wD,uQ,e=>{var{typed:r}=e;return r(wD,{"":function(){return""},number:Eo,null:function(o){return"null"},boolean:function(o){return o+""},string:function(o){return o},"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t)),any:function(o){return String(o)}})})});var bD,sQ,sm,DD=T(()=>{U();je();bD="boolean",sQ=["typed"],sm=O(bD,sQ,e=>{var{typed:r}=e;return r(bD,{"":function(){return!1},boolean:function(o){return o},number:function(o){return!!o},null:function(o){return!1},BigNumber:function(o){return!o.isZero()},string:function(o){var a=o.toLowerCase();if(a==="true")return!0;if(a==="false")return!1;var n=Number(o);if(o!==""&&!isNaN(n))return!!n;throw new Error('Cannot convert "'+o+'" to a boolean')},"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t))})})});var lQ,dQ,lm,AD=T(()=>{U();je();lQ="bignumber",dQ=["typed","BigNumber"],lm=O(lQ,dQ,e=>{var{typed:r,BigNumber:t}=e;return r("bignumber",{"":function(){return new t(0)},number:function(a){return new t(a+"")},string:function(a){var n=a.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(n){var i=n[2],u=t(n[1]),l=new t(2).pow(Number(i));if(u.gt(l.sub(1)))throw new SyntaxError('String "'.concat(a,'" is out of range'));var f=new t(2).pow(Number(i)-1);return u.gte(f)?u.sub(l):u}return new t(a)},BigNumber:function(a){return a},bigint:function(a){return new t(a.toString())},Unit:r.referToSelf(o=>a=>{var n=a.clone();return n.value=o(a.value),n}),Fraction:function(a){return new t(String(a.n)).div(String(a.d)).times(String(a.s))},null:function(a){return new t(0)},"Array | Matrix":r.referToSelf(o=>a=>Oe(a,o))})})});var pQ,mQ,dm,OD=T(()=>{U();je();pQ="complex",mQ=["typed","Complex"],dm=O(pQ,mQ,e=>{var{typed:r,Complex:t}=e;return r("complex",{"":function(){return t.ZERO},number:function(a){return new t(a,0)},"number, number":function(a,n){return new t(a,n)},"BigNumber, BigNumber":function(a,n){return new t(a.toNumber(),n.toNumber())},Fraction:function(a){return new t(a.valueOf(),0)},Complex:function(a){return a.clone()},string:function(a){return t(a)},null:function(a){return t(0)},Object:function(a){if("re"in a&&"im"in a)return new t(a.re,a.im);if("r"in a&&"phi"in a||"abs"in a&&"arg"in a)return new t(a);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":r.referToSelf(o=>a=>Oe(a,o))})})});var cQ,xQ,pm,CD=T(()=>{U();je();cQ="fraction",xQ=["typed","Fraction"],pm=O(cQ,xQ,e=>{var{typed:r,Fraction:t}=e;return r("fraction",{number:function(a){if(!isFinite(a)||isNaN(a))throw new Error(a+" cannot be represented as a fraction");return new t(a)},string:function(a){return new t(a)},"number, number":function(a,n){return new t(a,n)},"bigint, bigint":function(a,n){return new t(a,n)},null:function(a){return new t(0)},BigNumber:function(a){return new t(a.toString())},bigint:function(a){return new t(a.toString())},Fraction:function(a){return a},Unit:r.referToSelf(o=>a=>{var n=a.clone();return n.value=o(a.value),n}),Object:function(a){return new t(a)},"Array | Matrix":r.referToSelf(o=>a=>Oe(a,o))})})});var RD,hQ,mm,ND=T(()=>{U();RD="matrix",hQ=["typed","Matrix","DenseMatrix","SparseMatrix"],mm=O(RD,hQ,e=>{var{typed:r,Matrix:t,DenseMatrix:o,SparseMatrix:a}=e;return r(RD,{"":function(){return n([])},string:function(u){return n([],u)},"string, string":function(u,l){return n([],u,l)},Array:function(u){return n(u)},Matrix:function(u){return n(u,u.storage())},"Array | Matrix, string":n,"Array | Matrix, string, string":n});function n(i,u,l){if(u==="dense"||u==="default"||u===void 0)return new o(i,l);if(u==="sparse")return new a(i,l);throw new TypeError("Unknown matrix type "+JSON.stringify(u)+".")}})});var MD,vQ,cm,ED=T(()=>{U();MD="matrixFromFunction",vQ=["typed","matrix","isZero"],cm=O(MD,vQ,e=>{var{typed:r,matrix:t,isZero:o}=e;return r(MD,{"Array | Matrix, function, string, string":function(i,u,l,f){return a(i,u,l,f)},"Array | Matrix, function, string":function(i,u,l){return a(i,u,l)},"Matrix, function":function(i,u){return a(i,u,"dense")},"Array, function":function(i,u){return a(i,u,"dense").toArray()},"Array | Matrix, string, function":function(i,u,l){return a(i,l,u)},"Array | Matrix, string, string, function":function(i,u,l,f){return a(i,f,u,l)}});function a(n,i,u,l){var f;return l!==void 0?f=t(u,l):f=t(u),f.resize(n),f.forEach(function(s,d){var m=i(d);o(m)||f.set(d,m)}),f}})});var FD,gQ,xm,BD=T(()=>{U();FD="matrixFromRows",gQ=["typed","matrix","flatten","size"],xm=O(FD,gQ,e=>{var{typed:r,matrix:t,flatten:o,size:a}=e;return r(FD,{"...Array":function(l){return n(l)},"...Matrix":function(l){return t(n(l.map(f=>f.toArray())))}});function n(u){if(u.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var l=i(u[0]),f=[];for(var s of u){var d=i(s);if(d!==l)throw new TypeError("The vectors had different length: "+(l|0)+" \u2260 "+(d|0));f.push(o(s))}return f}function i(u){var l=a(u);if(l.length===1)return l[0];if(l.length===2){if(l[0]===1)return l[1];if(l[1]===1)return l[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}})});var _D,yQ,hm,PD=T(()=>{U();_D="matrixFromColumns",yQ=["typed","matrix","flatten","size"],hm=O(_D,yQ,e=>{var{typed:r,matrix:t,flatten:o,size:a}=e;return r(_D,{"...Array":function(l){return n(l)},"...Matrix":function(l){return t(n(l.map(f=>f.toArray())))}});function n(u){if(u.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var l=i(u[0]),f=[],s=0;s<l;s++)f[s]=[];for(var d of u){var m=i(d);if(m!==l)throw new TypeError("The vectors had different length: "+(l|0)+" \u2260 "+(m|0));for(var p=o(d),x=0;x<l;x++)f[x].push(p[x])}return f}function i(u){var l=a(u);if(l.length===1)return l[0];if(l.length===2){if(l[0]===1)return l[1];if(l[1]===1)return l[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}})});var kD,SQ,vm,LD=T(()=>{U();kD="splitUnit",SQ=["typed"],vm=O(kD,SQ,e=>{var{typed:r}=e;return r(kD,{"Unit, Array":function(o,a){return o.splitUnit(a)}})})});var ID,wQ,gm,zD=T(()=>{U();je();$e();ID="unaryMinus",wQ=["typed"],gm=O(ID,wQ,e=>{var{typed:r}=e;return r(ID,{number:up,"Complex | BigNumber | Fraction":t=>t.neg(),bigint:t=>-t,Unit:r.referToSelf(t=>o=>{var a=o.clone();return a.value=r.find(t,a.valueType())(o.value),a}),"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t,!0))})})});var qD,TQ,ym,UD=T(()=>{U();je();$e();He();qD="unaryPlus",TQ=["typed","config","numeric"],ym=O(qD,TQ,e=>{var{typed:r,config:t,numeric:o}=e;return r(qD,{number:sp,Complex:function(n){return n},BigNumber:function(n){return n},bigint:function(n){return n},Fraction:function(n){return n},Unit:function(n){return n.clone()},"Array | Matrix":r.referToSelf(a=>n=>Oe(n,a,!0)),boolean:function(n){return o(n?1:0,t.number)},string:function(n){return o(n,Dt(n,t))}})})});var HD,bQ,Sm,WD=T(()=>{U();je();$e();HD="abs",bQ=["typed"],Sm=O(HD,bQ,e=>{var{typed:r}=e;return r(HD,{number:ap,"Complex | BigNumber | Fraction | Unit":t=>t.abs(),bigint:t=>t<0n?-t:t,"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t,!0))})})});function us(e,r,t){var o,a,n;if(r<=0)if(Array.isArray(e[0])){for(n=AQ(e),a=[],o=0;o<n.length;o++)a[o]=us(n[o],r-1,t);return a}else return t(e);else{for(a=[],o=0;o<e.length;o++)a[o]=us(e[o],r-1,t);return a}}function AQ(e){var r=e.length,t=e[0].length,o,a,n=[];for(a=0;a<t;a++){var i=[];for(o=0;o<r;o++)i.push(e[o][a]);n.push(i)}return n}var VD,DQ,ti,wm=T(()=>{U();ze();Se();xn();VD="mapSlices",DQ=["typed","isInteger"],ti=O(VD,DQ,e=>{var{typed:r,isInteger:t}=e;return r(VD,{"Array | Matrix, number | BigNumber, function":function(a,n,i){if(!t(n))throw new TypeError("Integer number expected for dimension");var u=Array.isArray(a)?_e(a):a.size();if(n<0||n>=u.length)throw new St(n,u.length);return Ae(a)?a.create(us(a.valueOf(),n,i),a.datatype()):us(a,n,i)}})},{formerly:"apply"})});var GD,OQ,Tm,$D=T(()=>{U();$e();GD="addScalar",OQ=["typed"],Tm=O(GD,OQ,e=>{var{typed:r}=e;return r(GD,{"number, number":np,"Complex, Complex":function(o,a){return o.add(a)},"BigNumber, BigNumber":function(o,a){return o.plus(a)},"bigint, bigint":function(o,a){return o+a},"Fraction, Fraction":function(o,a){return o.add(a)},"Unit, Unit":r.referToSelf(t=>(o,a)=>{if(o.value===null||o.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(a.value===null||a.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!o.equalBase(a))throw new Error("Units do not match");var n=o.clone();return n.value=r.find(t,[n.valueType(),a.valueType()])(n.value,a.value),n.fixPrefix=!1,n})})})});var KD,CQ,bm,QD=T(()=>{U();$e();KD="subtractScalar",CQ=["typed"],bm=O(KD,CQ,e=>{var{typed:r}=e;return r(KD,{"number, number":ip,"Complex, Complex":function(o,a){return o.sub(a)},"BigNumber, BigNumber":function(o,a){return o.minus(a)},"bigint, bigint":function(o,a){return o-a},"Fraction, Fraction":function(o,a){return o.sub(a)},"Unit, Unit":r.referToSelf(t=>(o,a)=>{if(o.value===null||o.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(a.value===null||a.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!o.equalBase(a))throw new Error("Units do not match");var n=o.clone();return n.value=r.find(t,[n.valueType(),a.valueType()])(n.value,a.value),n.fixPrefix=!1,n})})})});var ZD,RQ,Dm,YD=T(()=>{U();Se();$e();ZD="cbrt",RQ=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],Dm=O(ZD,RQ,e=>{var{config:r,typed:t,isNegative:o,unaryMinus:a,matrix:n,Complex:i,BigNumber:u,Fraction:l}=e;return t(ZD,{number:jn,Complex:f,"Complex, boolean":f,BigNumber:function(m){return m.cbrt()},Unit:s});function f(d,m){var p=d.arg()/3,x=d.abs(),c=new i(jn(x),0).mul(new i(0,p).exp());if(m){var v=[c,new i(jn(x),0).mul(new i(0,p+Math.PI*2/3).exp()),new i(jn(x),0).mul(new i(0,p-Math.PI*2/3).exp())];return r.matrix==="Array"?v:n(v)}else return c}function s(d){if(d.value&&It(d.value)){var m=d.clone();return m.value=1,m=m.pow(1/3),m.value=f(d.value),m}else{var p=o(d.value);p&&(d.value=a(d.value));var x;Fe(d.value)?x=new u(1).div(3):oa(d.value)?x=new l(1,3):x=1/3;var c=d.pow(x);return p&&(c.value=a(c.value)),c}}})});var NQ,MQ,gr,ut=T(()=>{U();NQ="matAlgo11xS0s",MQ=["typed","equalScalar"],gr=O(NQ,MQ,e=>{var{typed:r,equalScalar:t}=e;return function(a,n,i,u){var l=a._values,f=a._index,s=a._ptr,d=a._size,m=a._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=d[0],x=d[1],c,v=t,y=0,b=i;typeof m=="string"&&(c=m,v=r.find(t,[c,c]),y=r.convert(0,c),n=r.convert(n,c),b=r.find(i,[c,c]));for(var h=[],S=[],w=[],g=0;g<x;g++){w[g]=S.length;for(var A=s[g],C=s[g+1],D=A;D<C;D++){var N=f[D],E=u?b(n,l[D]):b(l[D],n);v(E,y)||(S.push(N),h.push(E))}}return w[x]=S.length,a.createSparseMatrix({values:h,index:S,ptr:w,size:[p,x],datatype:c})}})});var EQ,FQ,dr,Xr=T(()=>{U();EQ="matAlgo12xSfs",FQ=["typed","DenseMatrix"],dr=O(EQ,FQ,e=>{var{typed:r,DenseMatrix:t}=e;return function(a,n,i,u){var l=a._values,f=a._index,s=a._ptr,d=a._size,m=a._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=d[0],x=d[1],c,v=i;typeof m=="string"&&(c=m,n=r.convert(n,c),v=r.find(i,[c,c]));for(var y=[],b=[],h=[],S=0;S<x;S++){for(var w=S+1,g=s[S],A=s[S+1],C=g;C<A;C++){var D=f[C];b[D]=l[C],h[D]=w}for(var N=0;N<p;N++)S===0&&(y[N]=[]),h[N]===w?y[N][S]=u?v(n,b[N]):v(b[N],n):y[N][S]=u?v(n,0):v(0,n)}return new t({data:y,size:[p,x],datatype:c})}})});var BQ,_Q,Kr,go=T(()=>{U();lr();BQ="matAlgo14xDs",_Q=["typed"],Kr=O(BQ,_Q,e=>{var{typed:r}=e;return function(a,n,i,u){var l=a._data,f=a._size,s=a._datatype,d,m=i;typeof s=="string"&&(d=s,n=r.convert(n,d),m=r.find(i,[d,d]));var p=f.length>0?t(m,0,f,f[0],l,n,u):[];return a.createDenseMatrix({data:p,size:Pe(f),datatype:d})};function t(o,a,n,i,u,l,f){var s=[];if(a===n.length-1)for(var d=0;d<i;d++)s[d]=f?o(l,u[d]):o(u[d],l);else for(var m=0;m<i;m++)s[m]=t(o,a+1,n,n[a+1],u[m],l,f);return s}})});var Am,PQ,kQ,LQ,Om,XD=T(()=>{Yu();U();je();He();ho();ut();Xr();go();Am="ceil",PQ=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],kQ=new dn(10),LQ=O(Am,["typed","config","round"],e=>{var{typed:r,config:t,round:o}=e;function a(n){var i=Math.ceil(n),u=o(n);return i===u?i:Rr(n,u,t.relTol,t.absTol)&&!Rr(n,i,t.relTol,t.absTol)?u:i}return r(Am,{number:a,"number, number":function(i,u){if(!be(u))throw new RangeError("number of decimals in function ceil must be an integer");if(u<0||u>15)throw new RangeError("number of decimals in ceil number must be in range 0-15");var l=10**u;return a(i*l)/l}})}),Om=O(Am,PQ,e=>{var{typed:r,config:t,round:o,matrix:a,equalScalar:n,zeros:i,DenseMatrix:u}=e,l=gr({typed:r,equalScalar:n}),f=dr({typed:r,DenseMatrix:u}),s=Kr({typed:r}),d=LQ({typed:r,config:t,round:o});function m(p){var x=(y,b)=>Vr(y,b,t.relTol,t.absTol),c=p.ceil(),v=o(p);return c.eq(v)?c:x(p,v)&&!x(p,c)?v:c}return r("ceil",{number:d.signatures.number,"number,number":d.signatures["number,number"],Complex:function(x){return x.ceil()},"Complex, number":function(x,c){return x.ceil(c)},"Complex, BigNumber":function(x,c){return x.ceil(c.toNumber())},BigNumber:m,"BigNumber, BigNumber":function(x,c){var v=kQ.pow(c);return m(x.mul(v)).div(v)},bigint:p=>p,"bigint, number":(p,x)=>p,"bigint, BigNumber":(p,x)=>p,Fraction:function(x){return x.ceil()},"Fraction, number":function(x,c){return x.ceil(c)},"Fraction, BigNumber":function(x,c){return x.ceil(c.toNumber())},"Unit, number, Unit":r.referToSelf(p=>function(x,c,v){var y=x.toNumeric(v);return v.multiply(p(y,c))}),"Unit, BigNumber, Unit":r.referToSelf(p=>(x,c,v)=>p(x,c.toNumber(),v)),"Array | Matrix, number | BigNumber, Unit":r.referToSelf(p=>(x,c,v)=>Oe(x,y=>p(y,c,v),!0)),"Array | Matrix | Unit, Unit":r.referToSelf(p=>(x,c)=>p(x,0,c)),"Array | Matrix":r.referToSelf(p=>x=>Oe(x,p,!0)),"Array, number | BigNumber":r.referToSelf(p=>(x,c)=>Oe(x,v=>p(v,c),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(p=>(x,c)=>l(x,c,p,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(p=>(x,c)=>s(x,c,p,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(p=>(x,c)=>s(a(c),x,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(p=>(x,c)=>n(x,0)?i(c.size(),c.storage()):c.storage()==="dense"?s(c,x,p,!0):f(c,x,p,!0))})})});var JD,IQ,Cm,jD=T(()=>{U();$e();JD="cube",IQ=["typed"],Cm=O(JD,IQ,e=>{var{typed:r}=e;return r(JD,{number:lp,Complex:function(o){return o.mul(o).mul(o)},BigNumber:function(o){return o.times(o).times(o)},bigint:function(o){return o*o*o},Fraction:function(o){return o.pow(3)},Unit:function(o){return o.pow(3)}})})});var eA,zQ,Rm,rA=T(()=>{U();$e();eA="exp",zQ=["typed"],Rm=O(eA,zQ,e=>{var{typed:r}=e;return r(eA,{number:dp,Complex:function(o){return o.exp()},BigNumber:function(o){return o.exp()}})})});var tA,qQ,Nm,oA=T(()=>{U();$e();tA="expm1",qQ=["typed","Complex"],Nm=O(tA,qQ,e=>{var{typed:r,Complex:t}=e;return r(tA,{number:pp,Complex:function(a){var n=Math.exp(a.re);return new t(n*Math.cos(a.im)-1,n*Math.sin(a.im))},BigNumber:function(a){return a.exp().minus(1)}})})});var Mm,UQ,HQ,Em,aA=T(()=>{U();je();Xr();go();Mm="fix",UQ=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],HQ=O(Mm,["typed","ceil","floor"],e=>{var{typed:r,ceil:t,floor:o}=e;return r(Mm,{number:function(n){return n>0?o(n):t(n)},"number, number":function(n,i){return n>0?o(n,i):t(n,i)}})}),Em=O(Mm,UQ,e=>{var{typed:r,Complex:t,matrix:o,ceil:a,floor:n,equalScalar:i,zeros:u,DenseMatrix:l}=e,f=dr({typed:r,DenseMatrix:l}),s=Kr({typed:r}),d=HQ({typed:r,ceil:a,floor:n});return r("fix",{number:d.signatures.number,"number, number | BigNumber":d.signatures["number,number"],Complex:function(p){return new t(p.re>0?Math.floor(p.re):Math.ceil(p.re),p.im>0?Math.floor(p.im):Math.ceil(p.im))},"Complex, number":function(p,x){return new t(p.re>0?n(p.re,x):a(p.re,x),p.im>0?n(p.im,x):a(p.im,x))},"Complex, BigNumber":function(p,x){var c=x.toNumber();return new t(p.re>0?n(p.re,c):a(p.re,c),p.im>0?n(p.im,c):a(p.im,c))},BigNumber:function(p){return p.isNegative()?a(p):n(p)},"BigNumber, number | BigNumber":function(p,x){return p.isNegative()?a(p,x):n(p,x)},bigint:m=>m,"bigint, number":(m,p)=>m,"bigint, BigNumber":(m,p)=>m,Fraction:function(p){return p.s<0n?p.ceil():p.floor()},"Fraction, number | BigNumber":function(p,x){return p.s<0n?a(p,x):n(p,x)},"Unit, number, Unit":r.referToSelf(m=>function(p,x,c){var v=p.toNumeric(c);return c.multiply(m(v,x))}),"Unit, BigNumber, Unit":r.referToSelf(m=>(p,x,c)=>m(p,x.toNumber(),c)),"Array | Matrix, number | BigNumber, Unit":r.referToSelf(m=>(p,x,c)=>Oe(p,v=>m(v,x,c),!0)),"Array | Matrix | Unit, Unit":r.referToSelf(m=>(p,x)=>m(p,0,x)),"Array | Matrix":r.referToSelf(m=>p=>Oe(p,m,!0)),"Array | Matrix, number | BigNumber":r.referToSelf(m=>(p,x)=>Oe(p,c=>m(c,x),!0)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(m=>(p,x)=>s(o(x),p,m,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(m=>(p,x)=>i(p,0)?u(x.size(),x.storage()):x.storage()==="dense"?s(x,p,m,!0):f(x,p,m,!0))})})});var Fm,WQ,VQ,GQ,cf,Bm=T(()=>{Yu();U();je();He();ho();ut();Xr();go();Fm="floor",WQ=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],VQ=new dn(10),GQ=O(Fm,["typed","config","round"],e=>{var{typed:r,config:t,round:o}=e;function a(n){var i=Math.floor(n),u=o(n);return i===u?i:Rr(n,u,t.relTol,t.absTol)&&!Rr(n,i,t.relTol,t.absTol)?u:i}return r(Fm,{number:a,"number, number":function(i,u){if(!be(u))throw new RangeError("number of decimals in function floor must be an integer");if(u<0||u>15)throw new RangeError("number of decimals in floor number must be in range 0 - 15");var l=10**u;return a(i*l)/l}})}),cf=O(Fm,WQ,e=>{var{typed:r,config:t,round:o,matrix:a,equalScalar:n,zeros:i,DenseMatrix:u}=e,l=gr({typed:r,equalScalar:n}),f=dr({typed:r,DenseMatrix:u}),s=Kr({typed:r}),d=GQ({typed:r,config:t,round:o});function m(p){var x=(y,b)=>Vr(y,b,t.relTol,t.absTol),c=p.floor(),v=o(p);return c.eq(v)?c:x(p,v)&&!x(p,c)?v:c}return r("floor",{number:d.signatures.number,"number,number":d.signatures["number,number"],Complex:function(x){return x.floor()},"Complex, number":function(x,c){return x.floor(c)},"Complex, BigNumber":function(x,c){return x.floor(c.toNumber())},BigNumber:m,"BigNumber, BigNumber":function(x,c){var v=VQ.pow(c);return m(x.mul(v)).div(v)},bigint:p=>p,"bigint, number":(p,x)=>p,"bigint, BigNumber":(p,x)=>p,Fraction:function(x){return x.floor()},"Fraction, number":function(x,c){return x.floor(c)},"Fraction, BigNumber":function(x,c){return x.floor(c.toNumber())},"Unit, number, Unit":r.referToSelf(p=>function(x,c,v){var y=x.toNumeric(v);return v.multiply(p(y,c))}),"Unit, BigNumber, Unit":r.referToSelf(p=>(x,c,v)=>p(x,c.toNumber(),v)),"Array | Matrix, number | BigNumber, Unit":r.referToSelf(p=>(x,c,v)=>Oe(x,y=>p(y,c,v),!0)),"Array | Matrix | Unit, Unit":r.referToSelf(p=>(x,c)=>p(x,0,c)),"Array | Matrix":r.referToSelf(p=>x=>Oe(x,p,!0)),"Array, number | BigNumber":r.referToSelf(p=>(x,c)=>Oe(x,v=>p(v,c),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(p=>(x,c)=>l(x,c,p,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(p=>(x,c)=>s(x,c,p,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(p=>(x,c)=>s(a(c),x,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(p=>(x,c)=>n(x,0)?i(c.size(),c.storage()):c.storage()==="dense"?s(c,x,p,!0):f(c,x,p,!0))})})});var $Q,KQ,Qr,yo=T(()=>{U();yt();$Q="matAlgo02xDS0",KQ=["typed","equalScalar"],Qr=O($Q,KQ,e=>{var{typed:r,equalScalar:t}=e;return function(a,n,i,u){var l=a._data,f=a._size,s=a._datatype||a.getDataType(),d=n._values,m=n._index,p=n._ptr,x=n._size,c=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(f.length!==x.length)throw new Ue(f.length,x.length);if(f[0]!==x[0]||f[1]!==x[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+x+")");if(!d)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=f[0],y=f[1],b,h=t,S=0,w=i;typeof s=="string"&&s===c&&s!=="mixed"&&(b=s,h=r.find(t,[b,b]),S=r.convert(0,b),w=r.find(i,[b,b]));for(var g=[],A=[],C=[],D=0;D<y;D++){C[D]=A.length;for(var N=p[D],E=p[D+1],_=N;_<E;_++){var L=m[_],P=u?w(d[_],l[L][D]):w(l[L][D],d[_]);h(P,S)||(A.push(L),g.push(P))}}return C[y]=A.length,n.createSparseMatrix({values:g,index:A,ptr:C,size:[v,y],datatype:s===a._datatype&&c===n._datatype?b:void 0})}})});var QQ,ZQ,br,Rt=T(()=>{U();yt();QQ="matAlgo03xDSf",ZQ=["typed"],br=O(QQ,ZQ,e=>{var{typed:r}=e;return function(o,a,n,i){var u=o._data,l=o._size,f=o._datatype||o.getDataType(),s=a._values,d=a._index,m=a._ptr,p=a._size,x=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(l.length!==p.length)throw new Ue(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var c=l[0],v=l[1],y,b=0,h=n;typeof f=="string"&&f===x&&f!=="mixed"&&(y=f,b=r.convert(0,y),h=r.find(n,[y,y]));for(var S=[],w=0;w<c;w++)S[w]=[];for(var g=[],A=[],C=0;C<v;C++){for(var D=C+1,N=m[C],E=m[C+1],_=N;_<E;_++){var L=d[_];g[L]=i?h(s[_],u[L][C]):h(u[L][C],s[_]),A[L]=D}for(var P=0;P<c;P++)A[P]===D?S[P][C]=g[P]:S[P][C]=i?h(b,u[P][C]):h(u[P][C],b)}return o.createDenseMatrix({data:S,size:[c,v],datatype:f===o._datatype&&x===a._datatype?y:void 0})}})});var YQ,XQ,za,xf=T(()=>{U();yt();YQ="matAlgo05xSfSf",XQ=["typed","equalScalar"],za=O(YQ,XQ,e=>{var{typed:r,equalScalar:t}=e;return function(a,n,i){var u=a._values,l=a._index,f=a._ptr,s=a._size,d=a._datatype||a._data===void 0?a._datatype:a.getDataType(),m=n._values,p=n._index,x=n._ptr,c=n._size,v=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(s.length!==c.length)throw new Ue(s.length,c.length);if(s[0]!==c[0]||s[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+c+")");var y=s[0],b=s[1],h,S=t,w=0,g=i;typeof d=="string"&&d===v&&d!=="mixed"&&(h=d,S=r.find(t,[h,h]),w=r.convert(0,h),g=r.find(i,[h,h]));var A=u&&m?[]:void 0,C=[],D=[],N=A?[]:void 0,E=A?[]:void 0,_=[],L=[],P,k,R,F;for(k=0;k<b;k++){D[k]=C.length;var I=k+1;for(R=f[k],F=f[k+1];R<F;R++)P=l[R],C.push(P),_[P]=I,N&&(N[P]=u[R]);for(R=x[k],F=x[k+1];R<F;R++)P=p[R],_[P]!==I&&C.push(P),L[P]=I,E&&(E[P]=m[R]);if(A)for(R=D[k];R<C.length;){P=C[R];var B=_[P],V=L[P];if(B===I||V===I){var J=B===I?N[P]:w,K=V===I?E[P]:w,z=g(J,K);S(z,w)?C.splice(R,1):(A.push(z),R++)}}}return D[b]=C.length,a.createSparseMatrix({values:A,index:C,ptr:D,size:[y,b],datatype:d===a._datatype&&v===n._datatype?h:void 0})}})});var JQ,jQ,nA,iA=T(()=>{U();yt();JQ="matAlgo13xDD",jQ=["typed"],nA=O(JQ,jQ,e=>{var{typed:r}=e;return function(a,n,i){var u=a._data,l=a._size,f=a._datatype,s=n._data,d=n._size,m=n._datatype,p=[];if(l.length!==d.length)throw new Ue(l.length,d.length);for(var x=0;x<l.length;x++){if(l[x]!==d[x])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");p[x]=l[x]}var c,v=i;typeof f=="string"&&f===m&&(c=f,v=r.find(i,[c,c]));var y=p.length>0?t(v,0,p,p[0],u,s):[];return a.createDenseMatrix({data:y,size:p,datatype:c})};function t(o,a,n,i,u,l){var f=[];if(a===n.length-1)for(var s=0;s<i;s++)f[s]=o(u[s],l[s]);else for(var d=0;d<i;d++)f[d]=t(o,a+1,n,n[a+1],u[d],l[d]);return f}})});function ot(e,r){if(Kt(e.size(),r.size()))return[e,r];var t=ff(e.size(),r.size());return[e,r].map(o=>eZ(o,t))}function eZ(e,r){return Kt(e.size(),r)?e:e.create(Ko(e.valueOf(),r),e.datatype())}var fA=T(()=>{ze();lr()});var rZ,tZ,Ge,Nr=T(()=>{U();lr();iA();go();fA();rZ="matrixAlgorithmSuite",tZ=["typed","matrix"],Ge=O(rZ,tZ,e=>{var{typed:r,matrix:t}=e,o=nA({typed:r}),a=Kr({typed:r});return function(i){var u=i.elop,l=i.SD||i.DS,f;u?(f={"DenseMatrix, DenseMatrix":(p,x)=>o(...ot(p,x),u),"Array, Array":(p,x)=>o(...ot(t(p),t(x)),u).valueOf(),"Array, DenseMatrix":(p,x)=>o(...ot(t(p),x),u),"DenseMatrix, Array":(p,x)=>o(...ot(p,t(x)),u)},i.SS&&(f["SparseMatrix, SparseMatrix"]=(p,x)=>i.SS(...ot(p,x),u,!1)),i.DS&&(f["DenseMatrix, SparseMatrix"]=(p,x)=>i.DS(...ot(p,x),u,!1),f["Array, SparseMatrix"]=(p,x)=>i.DS(...ot(t(p),x),u,!1)),l&&(f["SparseMatrix, DenseMatrix"]=(p,x)=>l(...ot(x,p),u,!0),f["SparseMatrix, Array"]=(p,x)=>l(...ot(t(x),p),u,!0))):(f={"DenseMatrix, DenseMatrix":r.referToSelf(p=>(x,c)=>o(...ot(x,c),p)),"Array, Array":r.referToSelf(p=>(x,c)=>o(...ot(t(x),t(c)),p).valueOf()),"Array, DenseMatrix":r.referToSelf(p=>(x,c)=>o(...ot(t(x),c),p)),"DenseMatrix, Array":r.referToSelf(p=>(x,c)=>o(...ot(x,t(c)),p))},i.SS&&(f["SparseMatrix, SparseMatrix"]=r.referToSelf(p=>(x,c)=>i.SS(...ot(x,c),p,!1))),i.DS&&(f["DenseMatrix, SparseMatrix"]=r.referToSelf(p=>(x,c)=>i.DS(...ot(x,c),p,!1)),f["Array, SparseMatrix"]=r.referToSelf(p=>(x,c)=>i.DS(...ot(t(x),c),p,!1))),l&&(f["SparseMatrix, DenseMatrix"]=r.referToSelf(p=>(x,c)=>l(...ot(c,x),p,!0)),f["SparseMatrix, Array"]=r.referToSelf(p=>(x,c)=>l(...ot(t(c),x),p,!0))));var s=i.scalar||"any",d=i.Ds||i.Ss;d&&(u?(f["DenseMatrix,"+s]=(p,x)=>a(p,x,u,!1),f[s+", DenseMatrix"]=(p,x)=>a(x,p,u,!0),f["Array,"+s]=(p,x)=>a(t(p),x,u,!1).valueOf(),f[s+", Array"]=(p,x)=>a(t(x),p,u,!0).valueOf()):(f["DenseMatrix,"+s]=r.referToSelf(p=>(x,c)=>a(x,c,p,!1)),f[s+", DenseMatrix"]=r.referToSelf(p=>(x,c)=>a(c,x,p,!0)),f["Array,"+s]=r.referToSelf(p=>(x,c)=>a(t(x),c,p,!1).valueOf()),f[s+", Array"]=r.referToSelf(p=>(x,c)=>a(t(c),x,p,!0).valueOf())));var m=i.sS!==void 0?i.sS:i.Ss;return u?(i.Ss&&(f["SparseMatrix,"+s]=(p,x)=>i.Ss(p,x,u,!1)),m&&(f[s+", SparseMatrix"]=(p,x)=>m(x,p,u,!0))):(i.Ss&&(f["SparseMatrix,"+s]=r.referToSelf(p=>(x,c)=>i.Ss(x,c,p,!1))),m&&(f[s+", SparseMatrix"]=r.referToSelf(p=>(x,c)=>m(c,x,p,!0)))),u&&u.signatures&&_u(f,u.signatures),f}})});var uA,oZ,hf,_m=T(()=>{U();Bm();yo();Rt();xf();ut();Xr();Nr();uA="mod",oZ=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],hf=O(uA,oZ,e=>{var{typed:r,config:t,round:o,matrix:a,equalScalar:n,zeros:i,DenseMatrix:u,concat:l}=e,f=cf({typed:r,config:t,round:o,matrix:a,equalScalar:n,zeros:i,DenseMatrix:u}),s=Qr({typed:r,equalScalar:n}),d=br({typed:r}),m=za({typed:r,equalScalar:n}),p=gr({typed:r,equalScalar:n}),x=dr({typed:r,DenseMatrix:u}),c=Ge({typed:r,matrix:a,concat:l});return r(uA,{"number, number":v,"BigNumber, BigNumber":function(b,h){return h.isZero()?b:b.sub(h.mul(f(b.div(h))))},"bigint, bigint":function(b,h){if(h===0n)return b;if(b<0){var S=b%h;return S===0n?S:S+h}return b%h},"Fraction, Fraction":function(b,h){return h.equals(0)?b:b.sub(h.mul(f(b.div(h))))}},c({SS:m,DS:d,SD:s,Ss:p,sS:x}));function v(y,b){return b===0?y:y-b*f(y/b)}})});var aZ,nZ,Nt,ua=T(()=>{U();yt();aZ="matAlgo01xDSid",nZ=["typed"],Nt=O(aZ,nZ,e=>{var{typed:r}=e;return function(o,a,n,i){var u=o._data,l=o._size,f=o._datatype||o.getDataType(),s=a._values,d=a._index,m=a._ptr,p=a._size,x=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(l.length!==p.length)throw new Ue(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var c=l[0],v=l[1],y=typeof f=="string"&&f!=="mixed"&&f===x?f:void 0,b=y?r.find(n,[y,y]):n,h,S,w=[];for(h=0;h<c;h++)w[h]=[];var g=[],A=[];for(S=0;S<v;S++){for(var C=S+1,D=m[S],N=m[S+1],E=D;E<N;E++)h=d[E],g[h]=i?b(s[E],u[h][S]):b(u[h][S],s[E]),A[h]=C;for(h=0;h<c;h++)A[h]===C?w[h][S]=g[h]:w[h][S]=u[h][S]}return o.createDenseMatrix({data:w,size:[c,v],datatype:f===o._datatype&&x===a._datatype?y:void 0})}})});var iZ,fZ,oi,ss=T(()=>{U();yt();iZ="matAlgo04xSidSid",fZ=["typed","equalScalar"],oi=O(iZ,fZ,e=>{var{typed:r,equalScalar:t}=e;return function(a,n,i){var u=a._values,l=a._index,f=a._ptr,s=a._size,d=a._datatype||a._data===void 0?a._datatype:a.getDataType(),m=n._values,p=n._index,x=n._ptr,c=n._size,v=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(s.length!==c.length)throw new Ue(s.length,c.length);if(s[0]!==c[0]||s[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+c+")");var y=s[0],b=s[1],h,S=t,w=0,g=i;typeof d=="string"&&d===v&&d!=="mixed"&&(h=d,S=r.find(t,[h,h]),w=r.convert(0,h),g=r.find(i,[h,h]));var A=u&&m?[]:void 0,C=[],D=[],N=u&&m?[]:void 0,E=u&&m?[]:void 0,_=[],L=[],P,k,R,F,I;for(k=0;k<b;k++){D[k]=C.length;var B=k+1;for(F=f[k],I=f[k+1],R=F;R<I;R++)P=l[R],C.push(P),_[P]=B,N&&(N[P]=u[R]);for(F=x[k],I=x[k+1],R=F;R<I;R++)if(P=p[R],_[P]===B){if(N){var V=g(N[P],m[R]);S(V,w)?_[P]=null:N[P]=V}}else C.push(P),L[P]=B,E&&(E[P]=m[R]);if(N&&E)for(R=D[k];R<C.length;)P=C[R],_[P]===B?(A[R]=N[P],R++):L[P]===B?(A[R]=E[P],R++):C.splice(R,1)}return D[b]=C.length,a.createSparseMatrix({values:A,index:C,ptr:D,size:[y,b],datatype:d===a._datatype&&v===n._datatype?h:void 0})}})});var uZ,sZ,Xt,qa=T(()=>{U();uZ="matAlgo10xSids",sZ=["typed","DenseMatrix"],Xt=O(uZ,sZ,e=>{var{typed:r,DenseMatrix:t}=e;return function(a,n,i,u){var l=a._values,f=a._index,s=a._ptr,d=a._size,m=a._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=d[0],x=d[1],c,v=i;typeof m=="string"&&(c=m,n=r.convert(n,c),v=r.find(i,[c,c]));for(var y=[],b=[],h=[],S=0;S<x;S++){for(var w=S+1,g=s[S],A=s[S+1],C=g;C<A;C++){var D=f[C];b[D]=l[C],h[D]=w}for(var N=0;N<p;N++)S===0&&(y[N]=[]),h[N]===w?y[N][S]=u?v(n,b[N]):v(b[N],n):y[N][S]=n}return new t({data:y,size:[p,x],datatype:c})}})});function sa(e,r,t,o){if(!(this instanceof sa))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=r,this.min=t,this.max=o,this.message="Wrong number of arguments in function "+e+" ("+r+" provided, "+t+(o!=null?"-"+o:"")+" expected)",this.stack=new Error().stack}var Pm=T(()=>{sa.prototype=new Error;sa.prototype.constructor=Error;sa.prototype.name="ArgumentsError";sa.prototype.isArgumentsError=!0});function lA(e){return!e.some(r=>Array.isArray(r))}var sA,lZ,km,dZ,Lm,dA=T(()=>{He();U();_m();ua();ss();qa();Nr();Pm();sA="gcd",lZ=["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],km="number | BigNumber | Fraction | Matrix | Array",dZ="".concat(km,", ").concat(km,", ...").concat(km);Lm=O(sA,lZ,e=>{var{typed:r,matrix:t,config:o,round:a,equalScalar:n,zeros:i,BigNumber:u,DenseMatrix:l,concat:f}=e,s=hf({typed:r,config:o,round:a,matrix:t,equalScalar:n,zeros:i,DenseMatrix:l,concat:f}),d=Nt({typed:r}),m=oi({typed:r,equalScalar:n}),p=Xt({typed:r,DenseMatrix:l}),x=Ge({typed:r,matrix:t,concat:f});return r(sA,{"number, number":c,"BigNumber, BigNumber":v,"Fraction, Fraction":(y,b)=>y.gcd(b)},x({SS:m,DS:d,Ss:p}),{[dZ]:r.referToSelf(y=>(b,h,S)=>{for(var w=y(b,h),g=0;g<S.length;g++)w=y(w,S[g]);return w}),Array:r.referToSelf(y=>b=>{if(b.length===1&&Array.isArray(b[0])&&lA(b[0]))return y(...b[0]);if(lA(b))return y(...b);throw new sa("gcd() supports only 1d matrices!")}),Matrix:r.referToSelf(y=>b=>y(b.toArray()))});function c(y,b){if(!be(y)||!be(b))throw new Error("Parameters in function gcd must be integer numbers");for(var h;b!==0;)h=s(y,b),y=b,b=h;return y<0?-y:y}function v(y,b){if(!y.isInt()||!b.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var h=new u(0);!b.isZero();){var S=s(y,b);y=b,b=S}return y.lt(h)?y.neg():y}})});var pZ,mZ,Ua,vf=T(()=>{U();yt();je();pZ="matAlgo06xS0S0",mZ=["typed","equalScalar"],Ua=O(pZ,mZ,e=>{var{typed:r,equalScalar:t}=e;return function(a,n,i){var u=a._values,l=a._size,f=a._datatype||a._data===void 0?a._datatype:a.getDataType(),s=n._values,d=n._size,m=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(l.length!==d.length)throw new Ue(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");var p=l[0],x=l[1],c,v=t,y=0,b=i;typeof f=="string"&&f===m&&f!=="mixed"&&(c=f,v=r.find(t,[c,c]),y=r.convert(0,c),b=r.find(i,[c,c]));for(var h=u&&s?[]:void 0,S=[],w=[],g=h?[]:void 0,A=[],C=[],D=0;D<x;D++){w[D]=S.length;var N=D+1;if(tp(a,D,A,g,C,N,S,b),tp(n,D,A,g,C,N,S,b),g)for(var E=w[D];E<S.length;){var _=S[E];if(C[_]===N){var L=g[_];v(L,y)?S.splice(E,1):(h.push(L),E++)}else S.splice(E,1)}else for(var P=w[D];P<S.length;){var k=S[P];C[k]!==N?S.splice(P,1):P++}}return w[x]=S.length,a.createSparseMatrix({values:h,index:S,ptr:w,size:[p,x],datatype:f===a._datatype&&m===n._datatype?c:void 0})}})});var pA,cZ,Im,mA=T(()=>{U();yo();vf();ut();Nr();$e();pA="lcm",cZ=["typed","matrix","equalScalar","concat"],Im=O(pA,cZ,e=>{var{typed:r,matrix:t,equalScalar:o,concat:a}=e,n=Qr({typed:r,equalScalar:o}),i=Ua({typed:r,equalScalar:o}),u=gr({typed:r,equalScalar:o}),l=Ge({typed:r,matrix:t,concat:a}),f="number | BigNumber | Fraction | Matrix | Array",s={};return s["".concat(f,", ").concat(f,", ...").concat(f)]=r.referToSelf(m=>(p,x,c)=>{for(var v=m(p,x),y=0;y<c.length;y++)v=m(v,c[y]);return v}),r(pA,{"number, number":mp,"BigNumber, BigNumber":d,"Fraction, Fraction":(m,p)=>m.lcm(p)},l({SS:i,DS:n,Ss:u}),s);function d(m,p){if(!m.isInt()||!p.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(m.isZero())return m;if(p.isZero())return p;for(var x=m.times(p);!p.isZero();){var c=p;p=m.mod(c),m=c}return x.div(m).abs()}})});function ai(e,r,t,o){return function(a){if(a>0||t.predictable){if(a<=0)return NaN;var n=a.toString(16),i=n.substring(0,15);return e*(n.length-i.length)+r(+("0x"+i))}return o(a.toNumber())}}var ls=T(()=>{});var cA,xZ,hZ,zm,xA=T(()=>{$e();ls();je();U();cA="log10",xZ=["typed","config","Complex"],hZ=sf(16),zm=O(cA,xZ,e=>{var{typed:r,config:t,Complex:o}=e;function a(i){return i.log().div(Math.LN10)}function n(i){return a(new o(i,0))}return r(cA,{number:function(u){return u>=0||t.predictable?sf(u):n(u)},bigint:ai(hZ,sf,t,n),Complex:a,BigNumber:function(u){return!u.isNegative()||t.predictable?u.log():n(u.toNumber())},"Array | Matrix":r.referToSelf(i=>u=>Oe(u,i))})})});var hA,vZ,qm,vA=T(()=>{$e();ls();je();U();hA="log2",vZ=["typed","config","Complex"],qm=O(hA,vZ,e=>{var{typed:r,config:t,Complex:o}=e;function a(i){return n(new o(i,0))}return r(hA,{number:function(u){return u>=0||t.predictable?ts(u):a(u)},bigint:ai(4,ts,t,a),Complex:n,BigNumber:function(u){return!u.isNegative()||t.predictable?u.log(2):a(u.toNumber())},"Array | Matrix":r.referToSelf(i=>u=>Oe(u,i))});function n(i){var u=Math.sqrt(i.re*i.re+i.im*i.im);return new o(Math.log2?Math.log2(u):Math.log(u)/Math.LN2,Math.atan2(i.im,i.re)/Math.LN2)}})});var gZ,yZ,Um,gA=T(()=>{U();$e();gZ="multiplyScalar",yZ=["typed"],Um=O(gZ,yZ,e=>{var{typed:r}=e;return r("multiplyScalar",{"number, number":fp,"Complex, Complex":function(o,a){return o.mul(a)},"BigNumber, BigNumber":function(o,a){return o.times(a)},"bigint, bigint":function(o,a){return o*a},"Fraction, Fraction":function(o,a){return o.mul(a)},"number | Fraction | BigNumber | Complex, Unit":(t,o)=>o.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,o)=>t.multiply(o)})})});var yA,SZ,Hm,SA=T(()=>{U();Se();ze();ut();go();yA="multiply",SZ=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],Hm=O(yA,SZ,e=>{var{typed:r,matrix:t,addScalar:o,multiplyScalar:a,equalScalar:n,dot:i}=e,u=gr({typed:r,equalScalar:n}),l=Kr({typed:r});function f(w,g){switch(w.length){case 1:switch(g.length){case 1:if(w[0]!==g[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(w[0]!==g[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+w[0]+") must match Matrix rows ("+g[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+g.length+" dimensions)")}break;case 2:switch(g.length){case 1:if(w[1]!==g[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+w[1]+") must match Vector length ("+g[0]+")");break;case 2:if(w[1]!==g[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+w[1]+") must match Matrix B rows ("+g[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+g.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+w.length+" dimensions)")}}function s(w,g,A){if(A===0)throw new Error("Cannot multiply two empty vectors");return i(w,g)}function d(w,g){if(g.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return m(w,g)}function m(w,g){var A=w._data,C=w._size,D=w._datatype||w.getDataType(),N=g._data,E=g._size,_=g._datatype||g.getDataType(),L=C[0],P=E[1],k,R=o,F=a;D&&_&&D===_&&typeof D=="string"&&D!=="mixed"&&(k=D,R=r.find(o,[k,k]),F=r.find(a,[k,k]));for(var I=[],B=0;B<P;B++){for(var V=F(A[0],N[0][B]),J=1;J<L;J++)V=R(V,F(A[J],N[J][B]));I[B]=V}return w.createDenseMatrix({data:I,size:[P],datatype:D===w._datatype&&_===g._datatype?k:void 0})}var p=r("_multiplyMatrixVector",{"DenseMatrix, any":c,"SparseMatrix, any":b}),x=r("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":v,"DenseMatrix, SparseMatrix":y,"SparseMatrix, DenseMatrix":h,"SparseMatrix, SparseMatrix":S});function c(w,g){var A=w._data,C=w._size,D=w._datatype||w.getDataType(),N=g._data,E=g._datatype||g.getDataType(),_=C[0],L=C[1],P,k=o,R=a;D&&E&&D===E&&typeof D=="string"&&D!=="mixed"&&(P=D,k=r.find(o,[P,P]),R=r.find(a,[P,P]));for(var F=[],I=0;I<_;I++){for(var B=A[I],V=R(B[0],N[0]),J=1;J<L;J++)V=k(V,R(B[J],N[J]));F[I]=V}return w.createDenseMatrix({data:F,size:[_],datatype:D===w._datatype&&E===g._datatype?P:void 0})}function v(w,g){var A=w._data,C=w._size,D=w._datatype||w.getDataType(),N=g._data,E=g._size,_=g._datatype||g.getDataType(),L=C[0],P=C[1],k=E[1],R,F=o,I=a;D&&_&&D===_&&typeof D=="string"&&D!=="mixed"&&D!=="mixed"&&(R=D,F=r.find(o,[R,R]),I=r.find(a,[R,R]));for(var B=[],V=0;V<L;V++){var J=A[V];B[V]=[];for(var K=0;K<k;K++){for(var z=I(J[0],N[0][K]),j=1;j<P;j++)z=F(z,I(J[j],N[j][K]));B[V][K]=z}}return w.createDenseMatrix({data:B,size:[L,k],datatype:D===w._datatype&&_===g._datatype?R:void 0})}function y(w,g){var A=w._data,C=w._size,D=w._datatype||w.getDataType(),N=g._values,E=g._index,_=g._ptr,L=g._size,P=g._datatype||g._data===void 0?g._datatype:g.getDataType();if(!N)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var k=C[0],R=L[1],F,I=o,B=a,V=n,J=0;D&&P&&D===P&&typeof D=="string"&&D!=="mixed"&&(F=D,I=r.find(o,[F,F]),B=r.find(a,[F,F]),V=r.find(n,[F,F]),J=r.convert(0,F));for(var K=[],z=[],j=[],ue=g.createSparseMatrix({values:K,index:z,ptr:j,size:[k,R],datatype:D===w._datatype&&P===g._datatype?F:void 0}),ee=0;ee<R;ee++){j[ee]=z.length;var ne=_[ee],$=_[ee+1];if($>ne)for(var W=0,Y=0;Y<k;Y++){for(var oe=Y+1,re=void 0,le=ne;le<$;le++){var se=E[le];W!==oe?(re=B(A[Y][se],N[le]),W=oe):re=I(re,B(A[Y][se],N[le]))}W===oe&&!V(re,J)&&(z.push(Y),K.push(re))}}return j[R]=z.length,ue}function b(w,g){var A=w._values,C=w._index,D=w._ptr,N=w._datatype||w._data===void 0?w._datatype:w.getDataType();if(!A)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var E=g._data,_=g._datatype||g.getDataType(),L=w._size[0],P=g._size[0],k=[],R=[],F=[],I,B=o,V=a,J=n,K=0;N&&_&&N===_&&typeof N=="string"&&N!=="mixed"&&(I=N,B=r.find(o,[I,I]),V=r.find(a,[I,I]),J=r.find(n,[I,I]),K=r.convert(0,I));var z=[],j=[];F[0]=0;for(var ue=0;ue<P;ue++){var ee=E[ue];if(!J(ee,K))for(var ne=D[ue],$=D[ue+1],W=ne;W<$;W++){var Y=C[W];j[Y]?z[Y]=B(z[Y],V(ee,A[W])):(j[Y]=!0,R.push(Y),z[Y]=V(ee,A[W]))}}for(var oe=R.length,re=0;re<oe;re++){var le=R[re];k[re]=z[le]}return F[1]=R.length,w.createSparseMatrix({values:k,index:R,ptr:F,size:[L,1],datatype:N===w._datatype&&_===g._datatype?I:void 0})}function h(w,g){var A=w._values,C=w._index,D=w._ptr,N=w._datatype||w._data===void 0?w._datatype:w.getDataType();if(!A)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var E=g._data,_=g._datatype||g.getDataType(),L=w._size[0],P=g._size[0],k=g._size[1],R,F=o,I=a,B=n,V=0;N&&_&&N===_&&typeof N=="string"&&N!=="mixed"&&(R=N,F=r.find(o,[R,R]),I=r.find(a,[R,R]),B=r.find(n,[R,R]),V=r.convert(0,R));for(var J=[],K=[],z=[],j=w.createSparseMatrix({values:J,index:K,ptr:z,size:[L,k],datatype:N===w._datatype&&_===g._datatype?R:void 0}),ue=[],ee=[],ne=0;ne<k;ne++){z[ne]=K.length;for(var $=ne+1,W=0;W<P;W++){var Y=E[W][ne];if(!B(Y,V))for(var oe=D[W],re=D[W+1],le=oe;le<re;le++){var se=C[le];ee[se]!==$?(ee[se]=$,K.push(se),ue[se]=I(Y,A[le])):ue[se]=F(ue[se],I(Y,A[le]))}}for(var q=z[ne],G=K.length,te=q;te<G;te++){var ie=K[te];J[te]=ue[ie]}}return z[k]=K.length,j}function S(w,g){var A=w._values,C=w._index,D=w._ptr,N=w._datatype||w._data===void 0?w._datatype:w.getDataType(),E=g._values,_=g._index,L=g._ptr,P=g._datatype||g._data===void 0?g._datatype:g.getDataType(),k=w._size[0],R=g._size[1],F=A&&E,I,B=o,V=a;N&&P&&N===P&&typeof N=="string"&&N!=="mixed"&&(I=N,B=r.find(o,[I,I]),V=r.find(a,[I,I]));for(var J=F?[]:void 0,K=[],z=[],j=w.createSparseMatrix({values:J,index:K,ptr:z,size:[k,R],datatype:N===w._datatype&&P===g._datatype?I:void 0}),ue=F?[]:void 0,ee=[],ne,$,W,Y,oe,re,le,se,q=0;q<R;q++){z[q]=K.length;var G=q+1;for(oe=L[q],re=L[q+1],Y=oe;Y<re;Y++)if(se=_[Y],F)for($=D[se],W=D[se+1],ne=$;ne<W;ne++)le=C[ne],ee[le]!==G?(ee[le]=G,K.push(le),ue[le]=V(E[Y],A[ne])):ue[le]=B(ue[le],V(E[Y],A[ne]));else for($=D[se],W=D[se+1],ne=$;ne<W;ne++)le=C[ne],ee[le]!==G&&(ee[le]=G,K.push(le));if(F)for(var te=z[q],ie=K.length,de=te;de<ie;de++){var he=K[de];J[de]=ue[he]}}return z[R]=K.length,j}return r(yA,a,{"Array, Array":r.referTo("Matrix, Matrix",w=>(g,A)=>{f(_e(g),_e(A));var C=w(t(g),t(A));return Ae(C)?C.valueOf():C}),"Matrix, Matrix":function(g,A){var C=g.size(),D=A.size();return f(C,D),C.length===1?D.length===1?s(g,A,C[0]):d(g,A):D.length===1?p(g,A):x(g,A)},"Matrix, Array":r.referTo("Matrix,Matrix",w=>(g,A)=>w(g,t(A))),"Array, Matrix":r.referToSelf(w=>(g,A)=>w(t(g,A.storage()),A)),"SparseMatrix, any":function(g,A){return u(g,A,a,!1)},"DenseMatrix, any":function(g,A){return l(g,A,a,!1)},"any, SparseMatrix":function(g,A){return u(A,g,a,!0)},"any, DenseMatrix":function(g,A){return l(A,g,a,!0)},"Array, any":function(g,A){return l(t(g),A,a,!1).valueOf()},"any, Array":function(g,A){return l(t(A),g,a,!0).valueOf()},"any, any":a,"any, any, ...any":r.referToSelf(w=>(g,A,C)=>{for(var D=w(g,A),N=0;N<C.length;N++)D=w(D,C[N]);return D})})})});var wA,wZ,Wm,TA=T(()=>{U();ua();yo();vf();ut();Nr();$e();wA="nthRoot",wZ=["typed","matrix","equalScalar","BigNumber","concat"],Wm=O(wA,wZ,e=>{var{typed:r,matrix:t,equalScalar:o,BigNumber:a,concat:n}=e,i=Nt({typed:r}),u=Qr({typed:r,equalScalar:o}),l=Ua({typed:r,equalScalar:o}),f=gr({typed:r,equalScalar:o}),s=Ge({typed:r,matrix:t,concat:n});function d(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return r(wA,{number:xp,"number, number":xp,BigNumber:p=>m(p,new a(2)),"BigNumber, BigNumber":m,Complex:d,"Complex, number":d,Array:r.referTo("DenseMatrix,number",p=>x=>p(t(x),2).valueOf()),DenseMatrix:r.referTo("DenseMatrix,number",p=>x=>p(x,2)),SparseMatrix:r.referTo("SparseMatrix,number",p=>x=>p(x,2)),"SparseMatrix, SparseMatrix":r.referToSelf(p=>(x,c)=>{if(c.density()===1)return l(x,c,p);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":r.referToSelf(p=>(x,c)=>{if(c.density()===1)return i(x,c,p,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":r.referTo("DenseMatrix,SparseMatrix",p=>(x,c)=>p(t(x),c)),"number | BigNumber, SparseMatrix":r.referToSelf(p=>(x,c)=>{if(c.density()===1)return f(c,x,p,!0);throw new Error("Root must be non-zero")})},s({scalar:"number | BigNumber",SD:u,Ss:f,sS:!1}));function m(p,x){var c=a.precision,v=a.clone({precision:c+2}),y=new a(0),b=new v(1),h=x.isNegative();if(h&&(x=x.neg()),x.isZero())throw new Error("Root must be non-zero");if(p.isNegative()&&!x.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(p.isZero())return h?new v(1/0):0;if(!p.isFinite())return h?y:p;var S=p.abs().pow(b.div(x));return S=p.isNeg()?S.neg():S,new a((h?b.div(S):S).toPrecision(c))}})});var bA,TZ,Vm,DA=T(()=>{U();je();$e();bA="sign",TZ=["typed","BigNumber","Fraction","complex"],Vm=O(bA,TZ,e=>{var{typed:r,BigNumber:t,complex:o,Fraction:a}=e;return r(bA,{number:os,Complex:function(i){return i.im===0?o(os(i.re)):i.sign()},BigNumber:function(i){return new t(i.cmp(0))},bigint:function(i){return i>0n?1n:i<0n?-1n:0n},Fraction:function(i){return new a(i.s)},"Array | Matrix":r.referToSelf(n=>i=>Oe(i,n,!0)),Unit:r.referToSelf(n=>i=>{if(!i._isDerived()&&i.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return r.find(n,i.valueType())(i.value)})})})});var bZ,DZ,Gm,AA=T(()=>{U();bZ="sqrt",DZ=["config","typed","Complex"],Gm=O(bZ,DZ,e=>{var{config:r,typed:t,Complex:o}=e;return t("sqrt",{number:a,Complex:function(i){return i.sqrt()},BigNumber:function(i){return!i.isNegative()||r.predictable?i.sqrt():a(i.toNumber())},Unit:function(i){return i.pow(.5)}});function a(n){return isNaN(n)?NaN:n>=0||r.predictable?Math.sqrt(n):new o(n,0).sqrt()}})});var OA,AZ,$m,CA=T(()=>{U();$e();OA="square",AZ=["typed"],$m=O(OA,AZ,e=>{var{typed:r}=e;return r(OA,{number:hp,Complex:function(o){return o.mul(o)},BigNumber:function(o){return o.times(o)},bigint:function(o){return o*o},Fraction:function(o){return o.mul(o)},Unit:function(o){return o.pow(2)}})})});var RA,OZ,Km,NA=T(()=>{U();ua();Rt();xf();qa();Xr();Nr();RA="subtract",OZ=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Km=O(RA,OZ,e=>{var{typed:r,matrix:t,equalScalar:o,subtractScalar:a,unaryMinus:n,DenseMatrix:i,concat:u}=e,l=Nt({typed:r}),f=br({typed:r}),s=za({typed:r,equalScalar:o}),d=Xt({typed:r,DenseMatrix:i}),m=dr({typed:r,DenseMatrix:i}),p=Ge({typed:r,matrix:t,concat:u});return r(RA,{"any, any":a},p({elop:a,SS:s,DS:l,SD:f,Ss:m,sS:d}))})});var MA,CZ,Qm,EA=T(()=>{U();$e();MA="xgcd",CZ=["typed","config","matrix","BigNumber"],Qm=O(MA,CZ,e=>{var{typed:r,config:t,matrix:o,BigNumber:a}=e;return r(MA,{"number, number":function(u,l){var f=vp(u,l);return t.matrix==="Array"?f:o(f)},"BigNumber, BigNumber":n});function n(i,u){var l,f,s,d=new a(0),m=new a(1),p=d,x=m,c=m,v=d;if(!i.isInt()||!u.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!u.isZero();)f=i.div(u).floor(),s=i.mod(u),l=p,p=x.minus(f.times(p)),x=l,l=c,c=v.minus(f.times(c)),v=l,i=u,u=s;var y;return i.lt(d)?y=[i.neg(),x.neg(),v.neg()]:y=[i,i.isZero()?0:x,v],t.matrix==="Array"?y:o(y)}})});var FA,RZ,Zm,BA=T(()=>{U();FA="invmod",RZ=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],Zm=O(FA,RZ,e=>{var{typed:r,config:t,BigNumber:o,xgcd:a,equal:n,smaller:i,mod:u,add:l,isInteger:f}=e;return r(FA,{"number, number":s,"BigNumber, BigNumber":s});function s(d,m){if(!f(d)||!f(m))throw new Error("Parameters in function invmod must be integer numbers");if(d=u(d,m),n(m,0))throw new Error("Divisor must be non zero");var p=a(d,m);p=p.valueOf();var[x,c]=p;return n(x,o(1))?(c=u(c,m),i(c,o(0))&&(c=l(c,m)),c):NaN}})});var NZ,MZ,ds,Ym=T(()=>{U();yt();NZ="matAlgo09xS0Sf",MZ=["typed","equalScalar"],ds=O(NZ,MZ,e=>{var{typed:r,equalScalar:t}=e;return function(a,n,i){var u=a._values,l=a._index,f=a._ptr,s=a._size,d=a._datatype||a._data===void 0?a._datatype:a.getDataType(),m=n._values,p=n._index,x=n._ptr,c=n._size,v=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(s.length!==c.length)throw new Ue(s.length,c.length);if(s[0]!==c[0]||s[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+c+")");var y=s[0],b=s[1],h,S=t,w=0,g=i;typeof d=="string"&&d===v&&d!=="mixed"&&(h=d,S=r.find(t,[h,h]),w=r.convert(0,h),g=r.find(i,[h,h]));var A=u&&m?[]:void 0,C=[],D=[],N=A?[]:void 0,E=[],_,L,P,k,R;for(L=0;L<b;L++){D[L]=C.length;var F=L+1;if(N)for(k=x[L],R=x[L+1],P=k;P<R;P++)_=p[P],E[_]=F,N[_]=m[P];for(k=f[L],R=f[L+1],P=k;P<R;P++)if(_=l[P],N){var I=E[_]===F?N[_]:w,B=g(u[P],I);S(B,w)||(C.push(_),A.push(B))}else C.push(_)}return D[b]=C.length,a.createSparseMatrix({values:A,index:C,ptr:D,size:[y,b],datatype:d===a._datatype&&v===n._datatype?h:void 0})}})});var _A,EZ,Xm,PA=T(()=>{U();yo();Ym();ut();Nr();_A="dotMultiply",EZ=["typed","matrix","equalScalar","multiplyScalar","concat"],Xm=O(_A,EZ,e=>{var{typed:r,matrix:t,equalScalar:o,multiplyScalar:a,concat:n}=e,i=Qr({typed:r,equalScalar:o}),u=ds({typed:r,equalScalar:o}),l=gr({typed:r,equalScalar:o}),f=Ge({typed:r,matrix:t,concat:n});return r(_A,f({elop:a,SS:u,DS:i,Ss:l}))})});function kA(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitAnd");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero()||r.eq(-1)||e.eq(r))return e;if(r.isZero()||e.eq(-1))return r;if(!e.isFinite()||!r.isFinite()){if(!e.isFinite()&&!r.isFinite())return e.isNegative()===r.isNegative()?e:new t(0);if(!e.isFinite())return r.isNegative()?e:e.isNegative()?new t(0):r;if(!r.isFinite())return e.isNegative()?r:r.isNegative()?new t(0):e}return Jm(e,r,function(o,a){return o&a})}function ni(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var r=e.constructor,t=r.precision;r.config({precision:1e9});var o=e.plus(new r(1));return o.s=-o.s||null,r.config({precision:t}),o}function LA(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitOr");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);var o=new t(-1);return e.isZero()||r.eq(o)||e.eq(r)?r:r.isZero()||e.eq(o)?e:!e.isFinite()||!r.isFinite()?!e.isFinite()&&!e.isNegative()&&r.isNegative()||e.isNegative()&&!r.isNegative()&&!r.isFinite()?o:e.isNegative()&&r.isNegative()?e.isFinite()?e:r:e.isFinite()?r:e:Jm(e,r,function(a,n){return a|n})}function Jm(e,r,t){var o=e.constructor,a,n,i=+(e.s<0),u=+(r.s<0);if(i){a=ps(ni(e));for(var l=0;l<a.length;++l)a[l]^=1}else a=ps(e);if(u){n=ps(ni(r));for(var f=0;f<n.length;++f)n[f]^=1}else n=ps(r);var s,d,m;a.length<=n.length?(s=a,d=n,m=i):(s=n,d=a,m=u);var p=s.length,x=d.length,c=t(i,u)^1,v=new o(c^1),y=new o(1),b=new o(2),h=o.precision;for(o.config({precision:1e9});p>0;)t(s[--p],d[--x])===c&&(v=v.plus(y)),y=y.times(b);for(;x>0;)t(m,d[--x])===c&&(v=v.plus(y)),y=y.times(b);return o.config({precision:h}),c===0&&(v.s=-v.s),v}function ps(e){for(var r=e.d,t=r[0]+"",o=1;o<r.length;++o){for(var a=r[o]+"",n=7-a.length;n--;)a="0"+a;t+=a}for(var i=t.length;t.charAt(i)==="0";)i--;var u=e.e,l=t.slice(0,i+1||1),f=l.length;if(u>0)if(++u>f)for(u-=f;u--;)l+="0";else u<f&&(l=l.slice(0,u)+"."+l.slice(u));for(var s=[0],d=0;d<l.length;){for(var m=s.length;m--;)s[m]*=10;s[0]+=parseInt(l.charAt(d++));for(var p=0;p<s.length;++p)s[p]>1&&((s[p+1]===null||s[p+1]===void 0)&&(s[p+1]=0),s[p+1]+=s[p]>>1,s[p]&=1)}return s.reverse()}function IA(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitXor");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero())return r;if(r.isZero())return e;if(e.eq(r))return new t(0);var o=new t(-1);return e.eq(o)?ni(r):r.eq(o)?ni(e):!e.isFinite()||!r.isFinite()?!e.isFinite()&&!r.isFinite()?o:new t(e.isNegative()===r.isNegative()?1/0:-1/0):Jm(e,r,function(a,n){return a^n})}function zA(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function leftShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:!e.isFinite()&&!r.isFinite()?new t(NaN):r.lt(55)?e.times(Math.pow(2,r.toNumber())+""):e.times(new t(2).pow(r))}function qA(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function rightArithShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:r.isFinite()?r.lt(55)?e.div(Math.pow(2,r.toNumber())+"").floor():e.div(new t(2).pow(r)).floor():e.isNegative()?new t(-1):e.isFinite()?new t(0):new t(NaN)}var Sn=T(()=>{});var UA,FZ,gf,jm=T(()=>{Sn();yo();ut();vf();U();Nr();$e();UA="bitAnd",FZ=["typed","matrix","equalScalar","concat"],gf=O(UA,FZ,e=>{var{typed:r,matrix:t,equalScalar:o,concat:a}=e,n=Qr({typed:r,equalScalar:o}),i=Ua({typed:r,equalScalar:o}),u=gr({typed:r,equalScalar:o}),l=Ge({typed:r,matrix:t,concat:a});return r(UA,{"number, number":yp,"BigNumber, BigNumber":kA,"bigint, bigint":(f,s)=>f&s},l({SS:i,DS:n,Ss:u}))})});var HA,BZ,ec,WA=T(()=>{Sn();je();U();$e();HA="bitNot",BZ=["typed"],ec=O(HA,BZ,e=>{var{typed:r}=e;return r(HA,{number:Sp,BigNumber:ni,bigint:t=>~t,"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t))})})});var VA,_Z,yf,rc=T(()=>{Sn();U();qa();ss();ua();Nr();$e();VA="bitOr",_Z=["typed","matrix","equalScalar","DenseMatrix","concat"],yf=O(VA,_Z,e=>{var{typed:r,matrix:t,equalScalar:o,DenseMatrix:a,concat:n}=e,i=Nt({typed:r}),u=oi({typed:r,equalScalar:o}),l=Xt({typed:r,DenseMatrix:a}),f=Ge({typed:r,matrix:t,concat:n});return r(VA,{"number, number":wp,"BigNumber, BigNumber":LA,"bigint, bigint":(s,d)=>s|d},f({SS:u,DS:i,Ss:l}))})});var PZ,kZ,Jr,Po=T(()=>{U();yt();PZ="matAlgo07xSSf",kZ=["typed","SparseMatrix"],Jr=O(PZ,kZ,e=>{var{typed:r,SparseMatrix:t}=e;return function(n,i,u){var l=n._size,f=n._datatype||n._data===void 0?n._datatype:n.getDataType(),s=i._size,d=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==s.length)throw new Ue(l.length,s.length);if(l[0]!==s[0]||l[1]!==s[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+s+")");var m=l[0],p=l[1],x,c=0,v=u;typeof f=="string"&&f===d&&f!=="mixed"&&(x=f,c=r.convert(0,x),v=r.find(u,[x,x]));for(var y=[],b=[],h=new Array(p+1).fill(0),S=[],w=[],g=[],A=[],C=0;C<p;C++){var D=C+1,N=0;o(n,C,g,S,D),o(i,C,A,w,D);for(var E=0;E<m;E++){var _=g[E]===D?S[E]:c,L=A[E]===D?w[E]:c,P=v(_,L);P!==0&&P!==!1&&(b.push(E),y.push(P),N++)}h[C+1]=h[C]+N}return new t({values:y,index:b,ptr:h,size:[m,p],datatype:f===n._datatype&&d===i._datatype?x:void 0})};function o(a,n,i,u,l){for(var f=a._values,s=a._index,d=a._ptr,m=d[n],p=d[n+1];m<p;m++){var x=s[m];i[x]=l,u[x]=f[m]}}})});var GA,LZ,tc,$A=T(()=>{Sn();Rt();Po();Xr();U();Nr();$e();GA="bitXor",LZ=["typed","matrix","DenseMatrix","concat","SparseMatrix"],tc=O(GA,LZ,e=>{var{typed:r,matrix:t,DenseMatrix:o,concat:a,SparseMatrix:n}=e,i=br({typed:r}),u=Jr({typed:r,SparseMatrix:n}),l=dr({typed:r,DenseMatrix:o}),f=Ge({typed:r,matrix:t,concat:a});return r(GA,{"number, number":Tp,"BigNumber, BigNumber":IA,"bigint, bigint":(s,d)=>s^d},f({SS:u,DS:i,Ss:l}))})});var KA,IZ,oc,QA=T(()=>{U();je();KA="arg",IZ=["typed"],oc=O(KA,IZ,e=>{var{typed:r}=e;return r(KA,{number:function(o){return Math.atan2(0,o)},BigNumber:function(o){return o.constructor.atan2(0,o)},Complex:function(o){return o.arg()},"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t))})})});var ZA,zZ,ac,YA=T(()=>{U();je();ZA="conj",zZ=["typed"],ac=O(ZA,zZ,e=>{var{typed:r}=e;return r(ZA,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t))})})});var XA,qZ,nc,JA=T(()=>{U();je();XA="im",qZ=["typed"],nc=O(XA,qZ,e=>{var{typed:r}=e;return r(XA,{number:()=>0,"BigNumber | Fraction":t=>t.mul(0),Complex:t=>t.im,"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t))})})});var jA,UZ,ic,eO=T(()=>{U();je();jA="re",UZ=["typed"],ic=O(jA,UZ,e=>{var{typed:r}=e;return r(jA,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.re,"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t))})})});var rO,HZ,fc,tO=T(()=>{je();U();$e();rO="not",HZ=["typed"],fc=O(rO,HZ,e=>{var{typed:r}=e;return r(rO,{"null | undefined":()=>!0,number:Np,Complex:function(o){return o.re===0&&o.im===0},BigNumber:function(o){return o.isZero()||o.isNaN()},bigint:t=>!t,Unit:r.referToSelf(t=>o=>r.find(t,o.valueType())(o.value)),"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t))})})});var oO,WZ,Sf,uc=T(()=>{Rt();Xr();xf();U();Nr();$e();oO="or",WZ=["typed","matrix","equalScalar","DenseMatrix","concat"],Sf=O(oO,WZ,e=>{var{typed:r,matrix:t,equalScalar:o,DenseMatrix:a,concat:n}=e,i=br({typed:r}),u=za({typed:r,equalScalar:o}),l=dr({typed:r,DenseMatrix:a}),f=Ge({typed:r,matrix:t,concat:n});return r(oO,{"number, number":as,"Complex, Complex":function(d,m){return d.re!==0||d.im!==0||m.re!==0||m.im!==0},"BigNumber, BigNumber":function(d,m){return!d.isZero()&&!d.isNaN()||!m.isZero()&&!m.isNaN()},"bigint, bigint":as,"Unit, Unit":r.referToSelf(s=>(d,m)=>s(d.value||0,m.value||0))},f({SS:u,DS:i,Ss:l}))})});var aO,VZ,sc,nO=T(()=>{Rt();Po();Xr();U();Nr();$e();aO="xor",VZ=["typed","matrix","DenseMatrix","concat","SparseMatrix"],sc=O(aO,VZ,e=>{var{typed:r,matrix:t,DenseMatrix:o,concat:a,SparseMatrix:n}=e,i=br({typed:r}),u=Jr({typed:r,SparseMatrix:n}),l=dr({typed:r,DenseMatrix:o}),f=Ge({typed:r,matrix:t,concat:a});return r(aO,{"number, number":ns,"Complex, Complex":function(d,m){return(d.re!==0||d.im!==0)!=(m.re!==0||m.im!==0)},"bigint, bigint":ns,"BigNumber, BigNumber":function(d,m){return(!d.isZero()&&!d.isNaN())!=(!m.isZero()&&!m.isNaN())},"Unit, Unit":r.referToSelf(s=>(d,m)=>s(d.value||0,m.value||0))},f({SS:u,DS:i,Ss:l}))})});var iO,GZ,wf,lc=T(()=>{Se();lr();ze();xn();yt();U();iO="concat",GZ=["typed","matrix","isInteger"],wf=O(iO,GZ,e=>{var{typed:r,matrix:t,isInteger:o}=e;return r(iO,{"...Array | Matrix | number | BigNumber":function(n){var i,u=n.length,l=-1,f,s=!1,d=[];for(i=0;i<u;i++){var m=n[i];if(Ae(m)&&(s=!0),ke(m)||Fe(m)){if(i!==u-1)throw new Error("Dimension must be specified as last argument");if(f=l,l=m.valueOf(),!o(l))throw new TypeError("Integer number expected for dimension");if(l<0||i>0&&l>f)throw new St(l,f+1)}else{var p=Pe(m).valueOf(),x=_e(p);if(d[i]=p,f=l,l=x.length-1,i>0&&l!==f)throw new Ue(f+1,l+1)}}if(d.length===0)throw new SyntaxError("At least one matrix expected");for(var c=d.shift();d.length;)c=Xd(c,d.shift(),l);return s?t(c):c},"...string":function(n){return n.join("")}})})});var fO,$Z,Tf,dc=T(()=>{U();Se();lr();ze();fO="column",$Z=["typed","Index","matrix","range"],Tf=O(fO,$Z,e=>{var{typed:r,Index:t,matrix:o,range:a}=e;return r(fO,{"Matrix, number":n,"Array, number":function(u,l){return n(o(Pe(u)),l).valueOf()}});function n(i,u){if(i.size().length!==2)throw new Error("Only two dimensional matrix is supported");Sr(u,i.size()[1]);var l=a(0,i.size()[0]),f=new t(l,u),s=i.subset(f);return Ae(s)?s:o([[s]])}})});var uO,KZ,pc,sO=T(()=>{U();uO="count",KZ=["typed","size","prod"],pc=O(uO,KZ,e=>{var{typed:r,size:t,prod:o}=e;return r(uO,{string:function(n){return n.length},"Matrix | Array":function(n){return o(t(n))}})})});var lO,QZ,mc,dO=T(()=>{ze();U();lO="cross",QZ=["typed","matrix","subtract","multiply"],mc=O(lO,QZ,e=>{var{typed:r,matrix:t,subtract:o,multiply:a}=e;return r(lO,{"Matrix, Matrix":function(u,l){return t(n(u.toArray(),l.toArray()))},"Matrix, Array":function(u,l){return t(n(u.toArray(),l))},"Array, Matrix":function(u,l){return t(n(u,l.toArray()))},"Array, Array":n});function n(i,u){var l=Math.max(_e(i).length,_e(u).length);i=Zn(i),u=Zn(u);var f=_e(i),s=_e(u);if(f.length!==1||s.length!==1||f[0]!==3||s[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+f.join(", ")+"], B = ["+s.join(", ")+"])");var d=[o(a(i[1],u[2]),a(i[2],u[1])),o(a(i[2],u[0]),a(i[0],u[2])),o(a(i[0],u[1]),a(i[1],u[0]))];return l>1?[d]:d}})});var pO,ZZ,cc,mO=T(()=>{Se();ze();He();U();pO="diag",ZZ=["typed","matrix","DenseMatrix","SparseMatrix"],cc=O(pO,ZZ,e=>{var{typed:r,matrix:t,DenseMatrix:o,SparseMatrix:a}=e;return r(pO,{Array:function(f){return n(f,0,_e(f),null)},"Array, number":function(f,s){return n(f,s,_e(f),null)},"Array, BigNumber":function(f,s){return n(f,s.toNumber(),_e(f),null)},"Array, string":function(f,s){return n(f,0,_e(f),s)},"Array, number, string":function(f,s,d){return n(f,s,_e(f),d)},"Array, BigNumber, string":function(f,s,d){return n(f,s.toNumber(),_e(f),d)},Matrix:function(f){return n(f,0,f.size(),f.storage())},"Matrix, number":function(f,s){return n(f,s,f.size(),f.storage())},"Matrix, BigNumber":function(f,s){return n(f,s.toNumber(),f.size(),f.storage())},"Matrix, string":function(f,s){return n(f,0,f.size(),s)},"Matrix, number, string":function(f,s,d){return n(f,s,f.size(),d)},"Matrix, BigNumber, string":function(f,s,d){return n(f,s.toNumber(),f.size(),d)}});function n(l,f,s,d){if(!be(f))throw new TypeError("Second parameter in function diag must be an integer");var m=f>0?f:0,p=f<0?-f:0;switch(s.length){case 1:return i(l,f,d,s[0],p,m);case 2:return u(l,f,d,s,p,m)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function i(l,f,s,d,m,p){var x=[d+m,d+p];if(s&&s!=="sparse"&&s!=="dense")throw new TypeError("Unknown matrix type ".concat(s,'"'));var c=s==="sparse"?a.diagonal(x,l,f):o.diagonal(x,l,f);return s!==null?c:c.valueOf()}function u(l,f,s,d,m,p){if(Ae(l)){var x=l.diagonal(f);return s!==null?s!==x.storage()?t(x,s):x:x.valueOf()}for(var c=Math.min(d[0]-m,d[1]-p),v=[],y=0;y<c;y++)v[y]=l[y+m][y+p];return s!==null?t(v):v}})});function cO(e,r){var t=co(r,e,"filter");return B1(e,function(o,a,n){return t(o,[a],n)})}var YZ,XZ,bf,xc=T(()=>{Jn();ze();U();YZ="filter",XZ=["typed"],bf=O(YZ,XZ,e=>{var{typed:r}=e;return r("filter",{"Array, function":cO,"Matrix, function":function(o,a){return o.create(cO(o.valueOf(),a),o.datatype())},"Array, RegExp":Zd,"Matrix, RegExp":function(o,a){return o.create(Zd(o.valueOf(),a),o.datatype())}})})});var xO,JZ,hc,hO=T(()=>{ze();U();xO="flatten",JZ=["typed"],hc=O(xO,JZ,e=>{var{typed:r}=e;return r(xO,{Array:function(o){return Qe(o)},Matrix:function(o){return o.create(Qe(o.toArray()),o.datatype())}})})});function eY(e,r){uf(e,[],e,co(r,e,vc))}var vc,jZ,Df,gc=T(()=>{Jn();U();ze();vc="forEach",jZ=["typed"],Df=O(vc,jZ,e=>{var{typed:r}=e;return r(vc,{"Array, function":eY,"Matrix, function":function(o,a){o.forEach(a)}})})});var vO,rY,yc,gO=T(()=>{U();ze();Se();vO="getMatrixDataType",rY=["typed"],yc=O(vO,rY,e=>{var{typed:r}=e;return r(vO,{Array:function(o){return vn(o,ar)},Matrix:function(o){return o.getDataType()}})})});var yO,tY,Sc,SO=T(()=>{Se();ze();He();U();yO="identity",tY=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],Sc=O(yO,tY,e=>{var{typed:r,config:t,matrix:o,BigNumber:a,DenseMatrix:n,SparseMatrix:i}=e;return r(yO,{"":function(){return t.matrix==="Matrix"?o([]):[]},string:function(s){return o(s)},"number | BigNumber":function(s){return l(s,s,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(s,d){return l(s,s,d)},"number | BigNumber, number | BigNumber":function(s,d){return l(s,d,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(s,d,m){return l(s,d,m)},Array:function(s){return u(s)},"Array, string":function(s,d){return u(s,d)},Matrix:function(s){return u(s.valueOf(),s.storage())},"Matrix, string":function(s,d){return u(s.valueOf(),d)}});function u(f,s){switch(f.length){case 0:return s?o(s):[];case 1:return l(f[0],f[0],s);case 2:return l(f[0],f[1],s);default:throw new Error("Vector containing two values expected")}}function l(f,s,d){var m=Fe(f)||Fe(s)?a:null;if(Fe(f)&&(f=f.toNumber()),Fe(s)&&(s=s.toNumber()),!be(f)||f<1)throw new Error("Parameters in function identity must be positive integers");if(!be(s)||s<1)throw new Error("Parameters in function identity must be positive integers");var p=m?new a(1):1,x=m?new m(0):0,c=[f,s];if(d){if(d==="sparse")return i.diagonal(c,p,0,x);if(d==="dense")return n.diagonal(c,p,0,x);throw new TypeError('Unknown matrix type "'.concat(d,'"'))}for(var v=_o([],c,x),y=f<s?f:s,b=0;b<y;b++)v[b][b]=p;return v}})});var wO,oY,wc,TO=T(()=>{ze();U();wO="kron",oY=["typed","matrix","multiplyScalar"],wc=O(wO,oY,e=>{var{typed:r,matrix:t,multiplyScalar:o}=e;return r(wO,{"Matrix, Matrix":function(i,u){return t(a(i.toArray(),u.toArray()))},"Matrix, Array":function(i,u){return t(a(i.toArray(),u))},"Array, Matrix":function(i,u){return t(a(i,u.toArray()))},"Array, Array":a});function a(n,i){if(_e(n).length===1&&(n=[n]),_e(i).length===1&&(i=[i]),_e(n).length>2||_e(i).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(n.length)+", y = "+JSON.stringify(i.length)+")");var u=[],l=[];return n.map(function(f){return i.map(function(s){return l=[],u.push(l),f.map(function(d){return s.map(function(m){return l.push(o(d,m))})})})})&&u}})});var Tc,aY,Af,bc=T(()=>{Jn();ze();U();Tc="map",aY=["typed"],Af=O(Tc,aY,e=>{var{typed:r}=e;return r(Tc,{"Array, function":o,"Matrix, function":function(n,i){return n.map(i)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(a,n,i)=>t([a,n,...i.slice(0,i.length-1)],i[i.length-1])});function t(a,n){if(typeof n!="function")throw new Error("Last argument must be a callback function");var i=a[0].isMatrix,u=ff(...a.map(S=>S.isMatrix?S.size():_e(S))),l=i?(S,w)=>S.get(w):Xn,f=i?a.map(S=>S.isMatrix?S.create(Ko(S.toArray(),u),S.datatype()):a[0].create(Ko(S.valueOf(),u))):a.map(S=>S.isMatrix?Ko(S.toArray(),u):Ko(S,u)),s;if(r.isTypedFunction(n)){var d=u.map(()=>0),m=f.map(S=>l(S,d)),p=h(n,m,d,f);s=y(p)}else{var x=a.length,c=b(n,x);s=y(c)}var v=(S,w)=>s([S,...f.slice(1).map(g=>l(g,w))],w);if(i)return f[0].map(v);return o(f[0],v);function y(S){switch(S){case 0:return w=>n(...w);case 1:return(w,g)=>n(...w,g);case 2:return(w,g)=>n(...w,g,...f)}}function b(S,w){return S.length>w+1?2:S.length===w+1?1:0}function h(S,w,g,A){return r.resolve(S,[...w,g,...A])!==null?2:r.resolve(S,[...w,g])!==null?1:(r.resolve(S,w)!==null,0)}}function o(a,n){return uf(a,[],a,co(n,a,Tc))}})});var bO,nY,Of,Dc=T(()=>{U();He();Se();bO="diff",nY=["typed","matrix","subtract","number"],Of=O(bO,nY,e=>{var{typed:r,matrix:t,subtract:o,number:a}=e;return r(bO,{"Array | Matrix":function(s){return Ae(s)?t(i(s.toArray())):i(s)},"Array | Matrix, number":function(s,d){if(!be(d))throw new RangeError("Dimension must be a whole number");return Ae(s)?t(n(s.toArray(),d)):n(s,d)},"Array, BigNumber":r.referTo("Array,number",f=>(s,d)=>f(s,a(d))),"Matrix, BigNumber":r.referTo("Matrix,number",f=>(s,d)=>f(s,a(d)))});function n(f,s){if(Ae(f)&&(f=f.toArray()),!Array.isArray(f))throw RangeError("Array/Matrix does not have that many dimensions");if(s>0){var d=[];return f.forEach(m=>{d.push(n(m,s-1))}),d}else{if(s===0)return i(f);throw RangeError("Cannot have negative dimension")}}function i(f){for(var s=[],d=f.length,m=1;m<d;m++)s.push(u(f[m-1],f[m]));return s}function u(f,s){Ae(f)&&(f=f.toArray()),Ae(s)&&(s=s.toArray());var d=Array.isArray(f),m=Array.isArray(s);if(d&&m)return l(f,s);if(!d&&!m)return o(s,f);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}function l(f,s){if(f.length!==s.length)throw RangeError("Not all sub-arrays have the same length");for(var d=[],m=f.length,p=0;p<m;p++)d.push(u(f[p],s[p]));return d}})});var iY,fY,Ac,DO=T(()=>{Se();He();ze();U();iY="ones",fY=["typed","config","matrix","BigNumber"],Ac=O(iY,fY,e=>{var{typed:r,config:t,matrix:o,BigNumber:a}=e;return r("ones",{"":function(){return t.matrix==="Array"?n([]):n([],"default")},"...number | BigNumber | string":function(f){var s=f[f.length-1];if(typeof s=="string"){var d=f.pop();return n(f,d)}else return t.matrix==="Array"?n(f):n(f,"default")},Array:n,Matrix:function(f){var s=f.storage();return n(f.valueOf(),s)},"Array | Matrix, string":function(f,s){return n(f.valueOf(),s)}});function n(l,f){var s=i(l),d=s?new a(1):1;if(u(l),f){var m=o(f);return l.length>0?m.resize(l,d):m}else{var p=[];return l.length>0?_o(p,l,d):p}}function i(l){var f=!1;return l.forEach(function(s,d,m){Fe(s)&&(f=!0,m[d]=s.toNumber())}),f}function u(l){l.forEach(function(f){if(typeof f!="number"||!be(f)||f<0)throw new Error("Parameters in function ones must be positive integers")})}})});function ii(){throw new Error('No "bignumber" implementation available')}function ms(){throw new Error('No "fraction" implementation available')}function cs(){throw new Error('No "matrix" implementation available')}var Cf=T(()=>{});var AO,uY,Rf,Oc=T(()=>{U();Cf();AO="range",uY=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Rf=O(AO,uY,e=>{var{typed:r,config:t,matrix:o,bignumber:a,smaller:n,smallerEq:i,larger:u,largerEq:l,add:f,isPositive:s}=e;return r(AO,{string:m,"string, boolean":m,number:function(v){throw new TypeError("Too few arguments to function range(): ".concat(v))},boolean:function(v){throw new TypeError("Unexpected type of argument 1 to function range(): ".concat(v,", number|bigint|BigNumber|Fraction"))},"number, number":function(v,y){return d(p(v,y,1,!1))},"number, number, number":function(v,y,b){return d(p(v,y,b,!1))},"number, number, boolean":function(v,y,b){return d(p(v,y,1,b))},"number, number, number, boolean":function(v,y,b,h){return d(p(v,y,b,h))},"bigint, bigint|number":function(v,y){return d(p(v,y,1n,!1))},"number, bigint":function(v,y){return d(p(BigInt(v),y,1n,!1))},"bigint, bigint|number, bigint|number":function(v,y,b){return d(p(v,y,BigInt(b),!1))},"number, bigint, bigint|number":function(v,y,b){return d(p(BigInt(v),y,BigInt(b),!1))},"bigint, bigint|number, boolean":function(v,y,b){return d(p(v,y,1n,b))},"number, bigint, boolean":function(v,y,b){return d(p(BigInt(v),y,1n,b))},"bigint, bigint|number, bigint|number, boolean":function(v,y,b,h){return d(p(v,y,BigInt(b),h))},"number, bigint, bigint|number, boolean":function(v,y,b,h){return d(p(BigInt(v),y,BigInt(b),h))},"BigNumber, BigNumber":function(v,y){var b=v.constructor;return d(p(v,y,new b(1),!1))},"BigNumber, BigNumber, BigNumber":function(v,y,b){return d(p(v,y,b,!1))},"BigNumber, BigNumber, boolean":function(v,y,b){var h=v.constructor;return d(p(v,y,new h(1),b))},"BigNumber, BigNumber, BigNumber, boolean":function(v,y,b,h){return d(p(v,y,b,h))},"Fraction, Fraction":function(v,y){return d(p(v,y,1,!1))},"Fraction, Fraction, Fraction":function(v,y,b){return d(p(v,y,b,!1))},"Fraction, Fraction, boolean":function(v,y,b){return d(p(v,y,1,b))},"Fraction, Fraction, Fraction, boolean":function(v,y,b,h){return d(p(v,y,b,h))},"Unit, Unit, Unit":function(v,y,b){return d(p(v,y,b,!1))},"Unit, Unit, Unit, boolean":function(v,y,b,h){return d(p(v,y,b,h))}});function d(c){return t.matrix==="Matrix"?o?o(c):cs():c}function m(c,v){var y=x(c);if(!y)throw new SyntaxError('String "'+c+'" is no valid range');return t.number==="BigNumber"?(a===void 0&&ii(),d(p(a(y.start),a(y.end),a(y.step)),v)):d(p(y.start,y.end,y.step,v))}function p(c,v,y,b){for(var h=[],S=s(y)?b?i:n:b?l:u,w=c;S(w,v);)h.push(w),w=f(w,y);return h}function x(c){var v=c.split(":"),y=v.map(function(h){return Number(h)}),b=y.some(function(h){return isNaN(h)});if(b)return null;switch(y.length){case 2:return{start:y[0],end:y[1],step:1};case 3:return{start:y[0],end:y[2],step:y[1]};default:return null}}})});var OO,sY,Cc,CO=T(()=>{ze();U();OO="reshape",sY=["typed","isInteger","matrix"],Cc=O(OO,sY,e=>{var{typed:r,isInteger:t}=e;return r(OO,{"Matrix, Array":function(a,n){return a.reshape(n,!0)},"Array, Array":function(a,n){return n.forEach(function(i){if(!t(i))throw new TypeError("Invalid size for dimension: "+i)}),af(a,n)}})})});var lY,dY,Rc,RO=T(()=>{Se();yt();Pm();He();Er();lr();ze();U();lY="resize",dY=["config","matrix"],Rc=O(lY,dY,e=>{var{config:r,matrix:t}=e;return function(n,i,u){if(arguments.length!==2&&arguments.length!==3)throw new sa("resize",arguments.length,2,3);if(Ae(i)&&(i=i.valueOf()),Fe(i[0])&&(i=i.map(function(s){return Fe(s)?s.toNumber():s})),Ae(n))return n.resize(i,u,!0);if(typeof n=="string")return o(n,i,u);var l=Array.isArray(n)?!1:r.matrix!=="Array";if(i.length===0){for(;Array.isArray(n);)n=n[0];return Pe(n)}else{Array.isArray(n)||(n=[n]),n=Pe(n);var f=_o(n,i,u);return l?t(f):f}};function o(a,n,i){if(i!==void 0){if(typeof i!="string"||i.length!==1)throw new TypeError("Single character expected as defaultValue")}else i=" ";if(n.length!==1)throw new Ue(n.length,1);var u=n[0];if(typeof u!="number"||!be(u))throw new TypeError("Invalid size, must contain positive integers (size: "+Ie(n)+")");if(a.length>u)return a.substring(0,u);if(a.length<u){for(var l=a,f=0,s=u-a.length;f<s;f++)l+=i;return l}else return a}})});var NO,pY,Nc,MO=T(()=>{U();ze();NO="rotate",pY=["typed","multiply","rotationMatrix"],Nc=O(NO,pY,e=>{var{typed:r,multiply:t,rotationMatrix:o}=e;return r(NO,{"Array , number | BigNumber | Complex | Unit":function(i,u){a(i,2);var l=t(o(u),i);return l.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(i,u){return a(i,2),t(o(u),i)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(i,u,l){a(i,3);var f=t(o(u,l),i);return f},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(i,u,l){return a(i,3),t(o(u,l),i)}});function a(n,i){var u=Array.isArray(n)?_e(n):n.size();if(u.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(i));if(u.length===2&&u[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(i));if(u[0]!==i)throw new RangeError("Vector must be of dimensions 1x".concat(i))}})});var EO,mY,Mc,FO=T(()=>{Se();U();EO="rotationMatrix",mY=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],Mc=O(EO,mY,e=>{var{typed:r,config:t,multiplyScalar:o,addScalar:a,unaryMinus:n,norm:i,BigNumber:u,matrix:l,DenseMatrix:f,SparseMatrix:s,cos:d,sin:m}=e;return r(EO,{"":function(){return t.matrix==="Matrix"?l([]):[]},string:function(h){return l(h)},"number | BigNumber | Complex | Unit":function(h){return p(h,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(h,S){return p(h,S)},"number | BigNumber | Complex | Unit, Array":function(h,S){var w=l(S);return x(w),y(h,w,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(h,S){x(S);var w=S.storage()||(t.matrix==="Matrix"?"dense":void 0);return y(h,S,w)},"number | BigNumber | Complex | Unit, Array, string":function(h,S,w){var g=l(S);return x(g),y(h,g,w)},"number | BigNumber | Complex | Unit, Matrix, string":function(h,S,w){return x(S),y(h,S,w)}});function p(b,h){var S=Fe(b),w=S?new u(-1):-1,g=d(b),A=m(b),C=[[g,o(w,A)],[A,g]];return v(C,h)}function x(b){var h=b.size();if(h.length<1||h[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function c(b){return b.reduce((h,S)=>o(h,S))}function v(b,h){if(h){if(h==="sparse")return new s(b);if(h==="dense")return new f(b);throw new TypeError('Unknown matrix type "'.concat(h,'"'))}return b}function y(b,h,S){var w=i(h);if(w===0)throw new RangeError("Rotation around zero vector");var g=Fe(b)?u:null,A=g?new g(1):1,C=g?new g(-1):-1,D=g?new g(h.get([0])/w):h.get([0])/w,N=g?new g(h.get([1])/w):h.get([1])/w,E=g?new g(h.get([2])/w):h.get([2])/w,_=d(b),L=a(A,n(_)),P=m(b),k=a(_,c([D,D,L])),R=a(c([D,N,L]),c([C,E,P])),F=a(c([D,E,L]),c([N,P])),I=a(c([D,N,L]),c([E,P])),B=a(_,c([N,N,L])),V=a(c([N,E,L]),c([C,D,P])),J=a(c([D,E,L]),c([C,N,P])),K=a(c([N,E,L]),c([D,P])),z=a(_,c([E,E,L])),j=[[k,R,F],[I,B,V],[J,K,z]];return v(j,S)}})});var BO,cY,Nf,Ec=T(()=>{U();Se();lr();ze();BO="row",cY=["typed","Index","matrix","range"],Nf=O(BO,cY,e=>{var{typed:r,Index:t,matrix:o,range:a}=e;return r(BO,{"Matrix, number":n,"Array, number":function(u,l){return n(o(Pe(u)),l).valueOf()}});function n(i,u){if(i.size().length!==2)throw new Error("Only two dimensional matrix is supported");Sr(u,i.size()[0]);var l=a(0,i.size()[1]),f=new t(u,l),s=i.subset(f);return Ae(s)?s:o([[s]])}})});var _O,xY,Fc,PO=T(()=>{ze();U();Cf();_O="size",xY=["typed","config","?matrix"],Fc=O(_O,xY,e=>{var{typed:r,config:t,matrix:o}=e;return r(_O,{Matrix:function(n){return n.create(n.size(),"number")},Array:_e,string:function(n){return t.matrix==="Array"?[n.length]:o([n.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(n){return t.matrix==="Array"?[]:o?o([],"dense","number"):cs()}})})});var kO,hY,Bc,LO=T(()=>{lr();ze();U();kO="squeeze",hY=["typed"],Bc=O(kO,hY,e=>{var{typed:r}=e;return r(kO,{Array:function(o){return Zn(Pe(o))},Matrix:function(o){var a=Zn(o.toArray());return Array.isArray(a)?o.create(a,o.datatype()):a},any:function(o){return Pe(o)}})})});function gY(e,r){if(!Ea(r))throw new TypeError("Index expected");if(hn(r))return"";if(of(Array.from(e),r),r.size().length!==1)throw new Ue(r.size().length,1);var t=e.length;Sr(r.min()[0],t),Sr(r.max()[0],t);var o=r.dimension(0),a="";return o.forEach(function(n){a+=e.charAt(n)}),a}function zO(e,r,t,o){if(!r||r.isIndex!==!0)throw new TypeError("Index expected");if(hn(r))return e;if(of(Array.from(e),r),r.size().length!==1)throw new Ue(r.size().length,1);if(o!==void 0){if(typeof o!="string"||o.length!==1)throw new TypeError("Single character expected as defaultValue")}else o=" ";var a=r.dimension(0),n=a.size()[0];if(n!==t.length)throw new Ue(a.size()[0],t.length);var i=e.length;Sr(r.min()[0]),Sr(r.max()[0]);for(var u=[],l=0;l<i;l++)u[l]=e.charAt(l);if(a.forEach(function(d,m){u[d]=t.charAt(m[0])}),u.length>i)for(var f=i-1,s=u.length;f<s;f++)u[f]||(u[f]=o);return u.join("")}function yY(e,r){if(!hn(r)){if(r.size().length!==1)throw new Ue(r.size(),1);var t=r.dimension(0);if(typeof t!="string")throw new TypeError("String expected as index to retrieve an object property");return Br(e,t)}}function SY(e,r,t){if(hn(r))return e;if(r.size().length!==1)throw new Ue(r.size(),1);var o=r.dimension(0);if(typeof o!="string")throw new TypeError("String expected as index to retrieve an object property");var a=Pe(e);return Wo(a,o,t),a}var IO,vY,Mf,_c=T(()=>{Se();lr();ze();$t();yt();U();IO="subset",vY=["typed","matrix","zeros","add"],Mf=O(IO,vY,e=>{var{typed:r,matrix:t,zeros:o,add:a}=e;return r(IO,{"Matrix, Index":function(u,l){return hn(l)?t():(of(u,l),u.subset(l))},"Array, Index":r.referTo("Matrix, Index",function(i){return function(u,l){var f=i(t(u),l);return l.isScalar()?f:f.valueOf()}}),"Object, Index":yY,"string, Index":gY,"Matrix, Index, any, any":function(u,l,f,s){return hn(l)?u:(of(u,l),u.clone().subset(l,n(f,l),s))},"Array, Index, any, any":r.referTo("Matrix, Index, any, any",function(i){return function(u,l,f,s){var d=i(t(u),l,f,s);return d.isMatrix?d.valueOf():d}}),"Array, Index, any":r.referTo("Matrix, Index, any, any",function(i){return function(u,l,f){return i(t(u),l,f,void 0).valueOf()}}),"Matrix, Index, any":r.referTo("Matrix, Index, any, any",function(i){return function(u,l,f){return i(u,l,f,void 0)}}),"string, Index, string":zO,"string, Index, string, string":zO,"Object, Index, any":SY});function n(i,u){if(typeof i=="string")throw new Error("can't boradcast a string");if(u._isScalar)return i;var l=u.size();if(l.every(f=>f>0))try{return a(i,o(l))}catch{return i}else return i}})});var qO,wY,Pc,UO=T(()=>{lr();Er();U();qO="transpose",wY=["typed","matrix"],Pc=O(qO,wY,e=>{var{typed:r,matrix:t}=e;return r(qO,{Array:i=>o(t(i)).valueOf(),Matrix:o,any:Pe});function o(i){var u=i.size(),l;switch(u.length){case 1:l=i.clone();break;case 2:{var f=u[0],s=u[1];if(s===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Ie(u)+")");switch(i.storage()){case"dense":l=a(i,f,s);break;case"sparse":l=n(i,f,s);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Ie(u)+")")}return l}function a(i,u,l){for(var f=i._data,s=[],d,m=0;m<l;m++){d=s[m]=[];for(var p=0;p<u;p++)d[p]=Pe(f[p][m])}return i.createDenseMatrix({data:s,size:[l,u],datatype:i._datatype})}function n(i,u,l){for(var f=i._values,s=i._index,d=i._ptr,m=f?[]:void 0,p=[],x=[],c=[],v=0;v<u;v++)c[v]=0;var y,b,h;for(y=0,b=s.length;y<b;y++)c[s[y]]++;for(var S=0,w=0;w<u;w++)x.push(S),S+=c[w],c[w]=x[w];for(x.push(S),h=0;h<l;h++)for(var g=d[h],A=d[h+1],C=g;C<A;C++){var D=c[s[C]]++;p[D]=h,f&&(m[D]=Pe(f[C]))}return i.createSparseMatrix({values:m,index:p,ptr:x,size:[l,u],datatype:i._datatype})}})});var HO,TY,kc,WO=T(()=>{U();HO="ctranspose",TY=["typed","transpose","conj"],kc=O(HO,TY,e=>{var{typed:r,transpose:t,conj:o}=e;return r(HO,{any:function(n){return o(t(n))}})})});var VO,bY,Lc,GO=T(()=>{Se();He();ze();U();VO="zeros",bY=["typed","config","matrix","BigNumber"],Lc=O(VO,bY,e=>{var{typed:r,config:t,matrix:o,BigNumber:a}=e;return r(VO,{"":function(){return t.matrix==="Array"?n([]):n([],"default")},"...number | BigNumber | string":function(f){var s=f[f.length-1];if(typeof s=="string"){var d=f.pop();return n(f,d)}else return t.matrix==="Array"?n(f):n(f,"default")},Array:n,Matrix:function(f){var s=f.storage();return n(f.valueOf(),s)},"Array | Matrix, string":function(f,s){return n(f.valueOf(),s)}});function n(l,f){var s=i(l),d=s?new a(0):0;if(u(l),f){var m=o(f);return l.length>0?m.resize(l,d):m}else{var p=[];return l.length>0?_o(p,l,d):p}}function i(l){var f=!1;return l.forEach(function(s,d,m){Fe(s)&&(f=!0,m[d]=s.toNumber())}),f}function u(l){l.forEach(function(f){if(typeof f!="number"||!be(f)||f<0)throw new Error("Parameters in function zeros must be positive integers")})}})});var $O,DY,Ic,KO=T(()=>{ze();U();$O="fft",DY=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],Ic=O($O,DY,e=>{var{typed:r,matrix:t,addScalar:o,multiplyScalar:a,divideScalar:n,exp:i,tau:u,i:l,dotDivide:f,conj:s,pow:d,ceil:m,log2:p}=e;return r($O,{Array:x,Matrix:function(h){return h.create(x(h.valueOf()),h.datatype())}});function x(b){var h=_e(b);return h.length===1?y(b,h[0]):c(b.map(S=>x(S,h.slice(1))),0)}function c(b,h){var S=_e(b);if(h!==0)return new Array(S[0]).fill(0).map((g,A)=>c(b[A],h-1));if(S.length===1)return y(b);function w(g){var A=_e(g);return new Array(A[1]).fill(0).map((C,D)=>new Array(A[0]).fill(0).map((N,E)=>g[E][D]))}return w(c(w(b),1))}function v(b){for(var h=b.length,S=i(n(a(-1,a(l,u)),h)),w=[],g=1-h;g<h;g++)w.push(d(S,n(d(g,2),2)));for(var A=d(2,m(p(h+h-1))),C=[...new Array(h).fill(0).map((R,F)=>a(b[F],w[h-1+F])),...new Array(A-h).fill(0)],D=[...new Array(h+h-1).fill(0).map((R,F)=>n(1,w[F])),...new Array(A-(h+h-1)).fill(0)],N=y(C),E=y(D),_=new Array(A).fill(0).map((R,F)=>a(N[F],E[F])),L=f(s(x(s(_))),A),P=[],k=h-1;k<h+h-1;k++)P.push(a(L[k],w[k]));return P}function y(b){var h=b.length;if(h===1)return[b[0]];if(h%2===0){for(var S=[...y(b.filter((C,D)=>D%2===0),h/2),...y(b.filter((C,D)=>D%2===1),h/2)],w=0;w<h/2;w++){var g=S[w],A=a(S[w+h/2],i(a(a(u,l),n(-w,h))));S[w]=o(g,A),S[w+h/2]=o(g,a(-1,A))}return S}else return v(b)}})});var QO,AY,zc,ZO=T(()=>{ze();U();Se();QO="ifft",AY=["typed","fft","dotDivide","conj"],zc=O(QO,AY,e=>{var{typed:r,fft:t,dotDivide:o,conj:a}=e;return r(QO,{"Array | Matrix":function(i){var u=Ae(i)?i.size():_e(i);return o(a(t(a(i))),u.reduce((l,f)=>l*f,1))}})})});function wn(e){"@babel/helpers - typeof";return wn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},wn(e)}var qc=T(()=>{});function YO(e,r){if(wn(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var o=t.call(e,r||"default");if(wn(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var XO=T(()=>{qc()});function JO(e){var r=YO(e,"string");return wn(r)=="symbol"?r:r+""}var jO=T(()=>{qc();XO()});function pr(e,r,t){return(r=JO(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var at=T(()=>{jO()});function eC(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,o)}return t}function OY(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?eC(Object(t),!0).forEach(function(o){pr(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):eC(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}var CY,RY,Uc,rC=T(()=>{at();Se();U();CY="solveODE",RY=["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],Uc=O(CY,RY,e=>{var{typed:r,add:t,subtract:o,multiply:a,divide:n,max:i,map:u,abs:l,isPositive:f,isNegative:s,larger:d,smaller:m,matrix:p,bignumber:x,unaryMinus:c}=e;function v(C){return function(D,N,E,_){var L=!(N.length===2&&(N.every(g)||N.every(xt)));if(L)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var P=N[0],k=N[1],R=d(k,P),F=_.firstStep;if(F!==void 0&&!f(F))throw new Error('"firstStep" must be positive');var I=_.maxStep;if(I!==void 0&&!f(I))throw new Error('"maxStep" must be positive');var B=_.minStep;if(B&&s(B))throw new Error('"minStep" must be positive or zero');var V=[P,k,F,B,I].filter(Xe=>Xe!==void 0);if(!(V.every(g)||V.every(xt)))throw new Error('Inconsistent type of "t" dependant variables');for(var J=1,K=_.tol?_.tol:1e-4,z=_.minDelta?_.minDelta:.2,j=_.maxDelta?_.maxDelta:5,ue=_.maxIter?_.maxIter:1e4,ee=[P,k,...E,I,B].some(Fe),[ne,$,W,Y]=ee?[x(C.a),x(C.c),x(C.b),x(C.bp)]:[C.a,C.c,C.b,C.bp],oe=F?R?F:c(F):n(o(k,P),J),re=[P],le=[E],se=o(W,Y),q=0,G=0,te=S(R),ie=w(R);te(re[q],k);){var de=[];oe=ie(re[q],k,oe),de.push(D(re[q],le[q]));for(var he=1;he<$.length;++he)de.push(D(t(re[q],a($[he],oe)),t(le[q],a(oe,ne[he],de))));var De=i(l(u(a(se,de),Xe=>xt(Xe)?Xe.value:Xe)));De<K&&K/De>1/4&&(re.push(t(re[q],oe)),le.push(t(le[q],a(oe,W,de))),q++);var Ne=.84*(K/De)**(1/5);if(m(Ne,z)?Ne=z:d(Ne,j)&&(Ne=j),Ne=ee?x(Ne):Ne,oe=a(oe,Ne),I&&d(l(oe),I)?oe=R?I:c(I):B&&m(l(oe),B)&&(oe=R?B:c(B)),G++,G>ue)throw new Error("Maximum number of iterations reached, try changing options")}return{t:re,y:le}}}function y(C,D,N,E){var _=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],L=[null,1/2,3/4,1],P=[2/9,1/3,4/9,0],k=[7/24,1/4,1/3,1/8],R={a:_,c:L,b:P,bp:k};return v(R)(C,D,N,E)}function b(C,D,N,E){var _=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],L=[null,1/5,3/10,4/5,8/9,1,1],P=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],k=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],R={a:_,c:L,b:P,bp:k};return v(R)(C,D,N,E)}function h(C,D,N,E){var _=E.method?E.method:"RK45",L={RK23:y,RK45:b};if(_.toUpperCase()in L){var P=OY({},E);return delete P.method,L[_.toUpperCase()](C,D,N,P)}else{var k=Object.keys(L).map(F=>'"'.concat(F,'"')),R="".concat(k.slice(0,-1).join(", ")," and ").concat(k.slice(-1));throw new Error('Unavailable method "'.concat(_,'". Available methods are ').concat(R))}}function S(C){return C?m:d}function w(C){var D=C?d:m;return function(N,E,_){var L=t(N,_);return D(L,E)?o(E,N):_}}function g(C){return Fe(C)||ke(C)}function A(C,D,N,E){var _=h(C,D.toArray(),N.toArray(),E);return{t:p(_.t),y:p(_.y)}}return r("solveODE",{"function, Array, Array, Object":h,"function, Matrix, Matrix, Object":A,"function, Array, Array":(C,D,N)=>h(C,D,N,{}),"function, Matrix, Matrix":(C,D,N)=>A(C,D,N,{}),"function, Array, number | BigNumber | Unit":(C,D,N)=>{var E=h(C,D,[N],{});return{t:E.t,y:E.y.map(_=>_[0])}},"function, Matrix, number | BigNumber | Unit":(C,D,N)=>{var E=h(C,D.toArray(),[N],{});return{t:p(E.t),y:p(E.y.map(_=>_[0]))}},"function, Array, number | BigNumber | Unit, Object":(C,D,N,E)=>{var _=h(C,D,[N],E);return{t:_.t,y:_.y.map(L=>L[0])}},"function, Matrix, number | BigNumber | Unit, Object":(C,D,N,E)=>{var _=h(C,D.toArray(),[N],E);return{t:p(_.t),y:p(_.y.map(L=>L[0]))}}})})});var NY,MY,Hc,EY,FY,la,fi,BY,tC=T(()=>{je();He();U();NY="erf",MY=["typed"],Hc=O(NY,MY,e=>{var{typed:r}=e;return r("name",{number:function(i){var u=Math.abs(i);return u>=BY?lo(i):u<=EY?lo(i)*t(u):u<=4?lo(i)*(1-o(u)):lo(i)*(1-a(u))},"Array | Matrix":r.referToSelf(n=>i=>Oe(i,n))});function t(n){var i=n*n,u=la[0][4]*i,l=i,f;for(f=0;f<3;f+=1)u=(u+la[0][f])*i,l=(l+fi[0][f])*i;return n*(u+la[0][3])/(l+fi[0][3])}function o(n){var i=la[1][8]*n,u=n,l;for(l=0;l<7;l+=1)i=(i+la[1][l])*n,u=(u+fi[1][l])*n;var f=(i+la[1][7])/(u+fi[1][7]),s=parseInt(n*16)/16,d=(n-s)*(n+s);return Math.exp(-s*s)*Math.exp(-d)*f}function a(n){var i=1/(n*n),u=la[2][5]*i,l=i,f;for(f=0;f<4;f+=1)u=(u+la[2][f])*i,l=(l+fi[2][f])*i;var s=i*(u+la[2][4])/(l+fi[2][4]);s=(FY-s)/n,i=parseInt(n*16)/16;var d=(n-i)*(n+i);return Math.exp(-i*i)*Math.exp(-d)*s}}),EY=.46875,FY=.5641895835477563,la=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],fi=[[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]],BY=Math.pow(2,53)});var oC,_Y,Wc,aC=T(()=>{U();oC="zeta",_Y=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],Wc=O(oC,_Y,e=>{var{typed:r,config:t,multiply:o,pow:a,divide:n,factorial:i,equal:u,smallerEq:l,isNegative:f,gamma:s,sin:d,subtract:m,add:p,Complex:x,BigNumber:c,pi:v}=e;return r(oC,{number:g=>y(g,A=>A,()=>20),BigNumber:g=>y(g,A=>new c(A),()=>Math.abs(Math.log10(t.relTol))),Complex:b});function y(g,A,C){return u(g,0)?A(-.5):u(g,1)?A(NaN):isFinite(g)?h(g,A,C,D=>D):f(g)?A(NaN):A(1)}function b(g){return g.re===0&&g.im===0?new x(-.5):g.re===1?new x(NaN,NaN):g.re===1/0&&g.im===0?new x(1):g.im===1/0||g.re===-1/0?new x(NaN,NaN):h(g,A=>A,A=>Math.round(1.3*15+.9*Math.abs(A.im)),A=>A.re)}function h(g,A,C,D){var N=C(g);if(D(g)>-(N-1)/2)return w(g,A(N),A);var E=o(a(2,g),a(A(v),m(g,1)));return E=o(E,d(o(n(A(v),2),g))),E=o(E,s(m(1,g))),o(E,h(m(1,g),A,C,D))}function S(g,A){for(var C=g,D=g;l(D,A);D=p(D,1)){var N=n(o(i(p(A,m(D,1))),a(4,D)),o(i(m(A,D)),i(o(2,D))));C=p(C,N)}return o(A,C)}function w(g,A,C){for(var D=n(1,o(S(C(0),A),m(1,a(2,m(1,g))))),N=C(0),E=C(1);l(E,A);E=p(E,1))N=p(N,n(o((-1)**(E-1),S(E,A)),a(E,g)));return o(D,N)}})});var nC,PY,Vc,iC=T(()=>{ze();U();nC="mode",PY=["typed","isNaN","isNumeric"],Vc=O(nC,PY,e=>{var{typed:r,isNaN:t,isNumeric:o}=e;return r(nC,{"Array | Matrix":a,"...":function(i){return a(i)}});function a(n){n=Qe(n.valueOf());var i=n.length;if(i===0)throw new Error("Cannot calculate mode of an empty array");for(var u={},l=[],f=0,s=0;s<n.length;s++){var d=n[s];if(o(d)&&t(d))throw new Error("Cannot calculate mode of an array containing NaN values");d in u||(u[d]=0),u[d]++,u[d]===f?l.push(d):u[d]>f&&(f=u[d],l=[d])}return l}})});function Hr(e,r,t){var o;return String(e).includes("Unexpected type")?(o=arguments.length>2?" (type: "+ar(t)+", value: "+JSON.stringify(t)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+r+", unexpected type of argument"+o)):String(e).includes("complex numbers")?(o=arguments.length>2?" (type: "+ar(t)+", value: "+JSON.stringify(t)+")":"",new TypeError("Cannot calculate "+r+", no ordering relation is defined for complex numbers"+o)):e}var Qo=T(()=>{Se()});var fC,kY,Gc,uC=T(()=>{je();U();He();Qo();fC="prod",kY=["typed","config","multiplyScalar","numeric"],Gc=O(fC,kY,e=>{var{typed:r,config:t,multiplyScalar:o,numeric:a}=e;return r(fC,{"Array | Matrix":n,"Array | Matrix, number | BigNumber":function(u,l){throw new Error("prod(A, dim) is not yet supported")},"...":function(u){return n(u)}});function n(i){var u;if(Ct(i,function(l){try{u=u===void 0?l:o(u,l)}catch(f){throw Hr(f,"prod",l)}}),typeof u=="string"&&(u=a(u,Dt(u,t))),u===void 0)throw new Error("Cannot calculate prod of an empty array");return u}})});var sC,LY,$c,lC=T(()=>{Er();U();sC="format",LY=["typed"],$c=O(sC,LY,e=>{var{typed:r}=e;return r(sC,{any:Ie,"any, Object | function | number | BigNumber":Ie})})});var dC,IY,Kc,pC=T(()=>{U();dC="bin",IY=["typed","format"],Kc=O(dC,IY,e=>{var{typed:r,format:t}=e;return r(dC,{"number | BigNumber":function(a){return t(a,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(a,n){return t(a,{notation:"bin",wordSize:n})}})})});var mC,zY,Qc,cC=T(()=>{U();mC="oct",zY=["typed","format"],Qc=O(mC,zY,e=>{var{typed:r,format:t}=e;return r(mC,{"number | BigNumber":function(a){return t(a,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(a,n){return t(a,{notation:"oct",wordSize:n})}})})});var xC,qY,Zc,hC=T(()=>{U();xC="hex",qY=["typed","format"],Zc=O(xC,qY,e=>{var{typed:r,format:t}=e;return r(xC,{"number | BigNumber":function(a){return t(a,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(a,n){return t(a,{notation:"hex",wordSize:n})}})})});var xs,Yc=T(()=>{xs=/\$([\w.]+)/g});function gC(e,r,t){return e.replace(xs,function(o,a){var n=a.split("."),i=r[n.shift()];for(i!==void 0&&i.isMatrix&&(i=i.toArray());n.length&&i!==void 0;){var u=n.shift();i=u?i[u]:i+"."}return i!==void 0?zr(i)?i:Ie(i,t):o})}var vC,UY,Ef,Xc=T(()=>{Er();Se();U();Yc();vC="print",UY=["typed"],Ef=O(vC,UY,e=>{var{typed:r}=e;return r(vC,{"string, Object | Array":gC,"string, Object | Array, number | Object":gC})})});var yC,HY,Jc,SC=T(()=>{U();Nr();yC="to",HY=["typed","matrix","concat"],Jc=O(yC,HY,e=>{var{typed:r,matrix:t,concat:o}=e,a=Ge({typed:r,matrix:t,concat:o});return r(yC,{"Unit, Unit | string":(n,i)=>n.to(i)},a({Ds:!0}))})});var wC,WY,jc,TC=T(()=>{je();U();wC="isPrime",WY=["typed"],jc=O(wC,WY,e=>{var{typed:r}=e;return r(wC,{number:function(o){if(o<=3)return o>1;if(o%2===0||o%3===0)return!1;for(var a=5;a*a<=o;a+=6)if(o%a===0||o%(a+2)===0)return!1;return!0},bigint:function(o){if(o<=3n)return o>1n;if(o%2n===0n||o%3n===0n)return!1;for(var a=5n;a*a<=o;a+=6n)if(o%a===0n||o%(a+2n)===0n)return!1;return!0},BigNumber:function(o){if(o.lte(3))return o.gt(1);if(o.mod(2).eq(0)||o.mod(3).eq(0))return!1;if(o.lt(Math.pow(2,32))){for(var a=o.toNumber(),n=5;n*n<=a;n+=6)if(a%n===0||a%(n+2)===0)return!1;return!0}function i(b,h,S){for(var w=1;!h.eq(0);)h.mod(2).eq(0)?(h=h.div(2),b=b.mul(b).mod(S)):(h=h.sub(1),w=b.mul(w).mod(S));return w}var u=o.constructor.clone({precision:o.toFixed(0).length*2});o=new u(o);for(var l=0,f=o.sub(1);f.mod(2).eq(0);)f=f.div(2),l+=1;var s=null;if(o.lt("3317044064679887385961981"))s=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(b=>b<o);else{var d=Math.min(o.toNumber()-2,Math.floor(2*Math.pow(o.toFixed(0).length*Math.log(10),2)));s=[];for(var m=2;m<=d;m+=1)s.push(d)}for(var p=0;p<s.length;p+=1){var x=s[p],c=i(o.sub(o).add(x),f,o);if(!c.eq(1)){for(var v=0,y=c;!y.eq(o.sub(1));v+=1,y=y.mul(y).mod(o))if(v===l-1)return!1}}return!0},"Array | Matrix":r.referToSelf(t=>o=>Oe(o,t))})})});var VY,GY,ex,bC=T(()=>{Se();U();Cf();VY="numeric",GY=["number","?bignumber","?fraction"],ex=O(VY,GY,e=>{var{number:r,bignumber:t,fraction:o}=e,a={string:!0,number:!0,BigNumber:!0,Fraction:!0},n={number:i=>r(i),BigNumber:t?i=>t(i):ii,bigint:i=>BigInt(i),Fraction:o?i=>o(i):ms};return function(u){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",f=arguments.length>2?arguments[2]:void 0;if(f!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var s=ar(u);if(!(s in a))throw new TypeError("Cannot convert "+u+' of type "'+s+'"; valid input types are '+Object.keys(a).join(", "));if(!(l in n))throw new TypeError("Cannot convert "+u+' to type "'+l+'"; valid output types are '+Object.keys(n).join(", "));return l===s?u:n[l](u)}})});var DC,$Y,rx,AC=T(()=>{U();DC="divideScalar",$Y=["typed","numeric"],rx=O(DC,$Y,e=>{var{typed:r,numeric:t}=e;return r(DC,{"number, number":function(a,n){return a/n},"Complex, Complex":function(a,n){return a.div(n)},"BigNumber, BigNumber":function(a,n){return a.div(n)},"bigint, bigint":function(a,n){return a/n},"Fraction, Fraction":function(a,n){return a.div(n)},"Unit, number | Complex | Fraction | BigNumber | Unit":(o,a)=>o.divide(a),"number | Fraction | Complex | BigNumber, Unit":(o,a)=>a.divideInto(o)})})});var OC,KY,tx,CC=T(()=>{U();He();ze();$e();OC="pow",KY=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],tx=O(OC,KY,e=>{var{typed:r,config:t,identity:o,multiply:a,matrix:n,inv:i,number:u,fraction:l,Complex:f}=e;return r(OC,{"number, number":s,"Complex, Complex":function(x,c){return x.pow(c)},"BigNumber, BigNumber":function(x,c){return c.isInteger()||x>=0||t.predictable?x.pow(c):new f(x.toNumber(),0).pow(c.toNumber(),0)},"bigint, bigint":(p,x)=>p**x,"Fraction, Fraction":function(x,c){var v=x.pow(c);if(v!=null)return v;if(t.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return s(x.valueOf(),c.valueOf())},"Array, number":d,"Array, BigNumber":function(x,c){return d(x,c.toNumber())},"Matrix, number":m,"Matrix, BigNumber":function(x,c){return m(x,c.toNumber())},"Unit, number | BigNumber":function(x,c){return x.pow(c)}});function s(p,x){if(t.predictable&&!be(x)&&p<0)try{var c=l(x),v=u(c);if((x===v||Math.abs((x-v)/x)<1e-14)&&c.d%2n===1n)return(c.n%2n===0n?1:-1)*Math.pow(-p,x)}catch{}return t.predictable&&(p<-1&&x===1/0||p>-1&&p<0&&x===-1/0)?NaN:be(x)||p>=0||t.predictable?gp(p,x):p*p<1&&x===1/0||p*p>1&&x===-1/0?0:new f(p,0).pow(x,0)}function d(p,x){if(!be(x))throw new TypeError("For A^b, b must be an integer (value is "+x+")");var c=_e(p);if(c.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+c.length+" dimensions)");if(c[0]!==c[1])throw new Error("For A^b, A must be square (size is "+c[0]+"x"+c[1]+")");if(x<0)try{return d(i(p),-x)}catch(b){throw b.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+x+")"):b}for(var v=o(c[0]).valueOf(),y=p;x>=1;)(x&1)===1&&(v=a(y,v)),x>>=1,y=a(y,y);return v}function m(p,x){return n(d(p.valueOf(),x))}})});var ui,RC,QY,ox,NC=T(()=>{U();je();He();ho();ut();Xr();go();$e();ui="Number of decimals in function round must be an integer",RC="round",QY=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],ox=O(RC,QY,e=>{var{typed:r,config:t,matrix:o,equalScalar:a,zeros:n,BigNumber:i,DenseMatrix:u}=e,l=gr({typed:r,equalScalar:a}),f=dr({typed:r,DenseMatrix:u}),s=Kr({typed:r});function d(m){return Math.abs(Vn(m).exponent)}return r(RC,{number:function(p){var x=ei(p,d(t.relTol)),c=Rr(p,x,t.relTol,t.absTol)?x:p;return ei(c)},"number, number":function(p,x){var c=d(t.relTol);if(x>=c)return ei(p,x);var v=ei(p,c),y=Rr(p,v,t.relTol,t.absTol)?v:p;return ei(y,x)},"number, BigNumber":function(p,x){if(!x.isInteger())throw new TypeError(ui);return new i(p).toDecimalPlaces(x.toNumber())},Complex:function(p){return p.round()},"Complex, number":function(p,x){if(x%1)throw new TypeError(ui);return p.round(x)},"Complex, BigNumber":function(p,x){if(!x.isInteger())throw new TypeError(ui);var c=x.toNumber();return p.round(c)},BigNumber:function(p){var x=new i(p).toDecimalPlaces(d(t.relTol)),c=Vr(p,x,t.relTol,t.absTol)?x:p;return c.toDecimalPlaces(0)},"BigNumber, BigNumber":function(p,x){if(!x.isInteger())throw new TypeError(ui);var c=d(t.relTol);if(x>=c)return p.toDecimalPlaces(x.toNumber());var v=p.toDecimalPlaces(c),y=Vr(p,v,t.relTol,t.absTol)?v:p;return y.toDecimalPlaces(x.toNumber())},bigint:m=>m,"bigint, number":(m,p)=>m,"bigint, BigNumber":(m,p)=>m,Fraction:function(p){return p.round()},"Fraction, number":function(p,x){if(x%1)throw new TypeError(ui);return p.round(x)},"Fraction, BigNumber":function(p,x){if(!x.isInteger())throw new TypeError(ui);return p.round(x.toNumber())},"Unit, number, Unit":r.referToSelf(m=>function(p,x,c){var v=p.toNumeric(c);return c.multiply(m(v,x))}),"Unit, BigNumber, Unit":r.referToSelf(m=>(p,x,c)=>m(p,x.toNumber(),c)),"Array | Matrix, number | BigNumber, Unit":r.referToSelf(m=>(p,x,c)=>Oe(p,v=>m(v,x,c),!0)),"Array | Matrix | Unit, Unit":r.referToSelf(m=>(p,x)=>m(p,0,x)),"Array | Matrix":r.referToSelf(m=>p=>Oe(p,m,!0)),"SparseMatrix, number | BigNumber":r.referToSelf(m=>(p,x)=>l(p,x,m,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(m=>(p,x)=>s(p,x,m,!1)),"Array, number | BigNumber":r.referToSelf(m=>(p,x)=>s(o(p),x,m,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":r.referToSelf(m=>(p,x)=>a(p,0)?n(x.size(),x.storage()):f(x,p,m,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":r.referToSelf(m=>(p,x)=>a(p,0)?n(x.size(),x.storage()):s(x,p,m,!0)),"number | Complex | BigNumber | Fraction, Array":r.referToSelf(m=>(p,x)=>s(o(x),p,m,!0).valueOf())})})});var MC,ZY,YY,ax,EC=T(()=>{U();ls();$e();MC="log",ZY=["config","typed","typeOf","divideScalar","Complex"],YY=Math.log(16),ax=O(MC,ZY,e=>{var{typed:r,typeOf:t,config:o,divideScalar:a,Complex:n}=e;function i(l){return l.log()}function u(l){return i(new n(l,0))}return r(MC,{number:function(f){return f>=0||o.predictable?cp(f):u(f)},bigint:ai(YY,cp,o,u),Complex:i,BigNumber:function(f){return!f.isNegative()||o.predictable?f.ln():u(f.toNumber())},"any, any":r.referToSelf(l=>(f,s)=>{if(t(f)==="Fraction"&&t(s)==="Fraction"){var d=f.log(s);if(d!==null)return d}return a(l(f),l(s))})})})});var FC,XY,nx,BC=T(()=>{U();je();He();FC="log1p",XY=["typed","config","divideScalar","log","Complex"],nx=O(FC,XY,e=>{var{typed:r,config:t,divideScalar:o,log:a,Complex:n}=e;return r(FC,{number:function(l){return l>=-1||t.predictable?Pu(l):i(new n(l,0))},Complex:i,BigNumber:function(l){var f=l.plus(1);return!f.isNegative()||t.predictable?f.ln():i(new n(l.toNumber(),0))},"Array | Matrix":r.referToSelf(u=>l=>Oe(l,u)),"any, any":r.referToSelf(u=>(l,f)=>o(u(l),a(f)))});function i(u){var l=u.re+1;return new n(Math.log(Math.sqrt(l*l+u.im*u.im)),Math.atan2(u.im,l))}})});var _C,JY,ix,PC=T(()=>{U();_C="nthRoots",JY=["config","typed","divideScalar","Complex"],ix=O(_C,JY,e=>{var{typed:r,config:t,divideScalar:o,Complex:a}=e,n=[function(l){return new a(l,0)},function(l){return new a(0,l)},function(l){return new a(-l,0)},function(l){return new a(0,-l)}];function i(u,l){if(l<0)throw new Error("Root must be greater than zero");if(l===0)throw new Error("Root must be non-zero");if(l%1!==0)throw new Error("Root must be an integer");if(u===0||u.abs()===0)return[new a(0,0)];var f=typeof u=="number",s;(f||u.re===0||u.im===0)&&(f?s=2*+(u<0):u.im===0?s=2*+(u.re<0):s=2*+(u.im<0)+1);for(var d=u.arg(),m=u.abs(),p=[],x=Math.pow(m,1/l),c=0;c<l;c++){var v=(s+4*c)/l;if(v===Math.round(v)){p.push(n[v%4](x));continue}p.push(new a({r:x,phi:(d+2*Math.PI*c)/l}))}return p}return r(_C,{Complex:function(l){return i(l,2)},"Complex, number":i})})});var kC,jY,fx,LC=T(()=>{U();Rt();Po();ut();Xr();Nr();kC="dotPow",jY=["typed","equalScalar","matrix","pow","DenseMatrix","concat","SparseMatrix"],fx=O(kC,jY,e=>{var{typed:r,equalScalar:t,matrix:o,pow:a,DenseMatrix:n,concat:i,SparseMatrix:u}=e,l=br({typed:r}),f=Jr({typed:r,SparseMatrix:u}),s=gr({typed:r,equalScalar:t}),d=dr({typed:r,DenseMatrix:n}),m=Ge({typed:r,matrix:o,concat:i}),p={};for(var x in a.signatures)Object.prototype.hasOwnProperty.call(a.signatures,x)&&!x.includes("Matrix")&&!x.includes("Array")&&(p[x]=a.signatures[x]);var c=r(p);return r(kC,m({elop:c,SS:f,DS:l,Ss:s,sS:d}))})});var IC,eX,ux,zC=T(()=>{U();yo();Rt();Po();ut();Xr();Nr();IC="dotDivide",eX=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat","SparseMatrix"],ux=O(IC,eX,e=>{var{typed:r,matrix:t,equalScalar:o,divideScalar:a,DenseMatrix:n,concat:i,SparseMatrix:u}=e,l=Qr({typed:r,equalScalar:o}),f=br({typed:r}),s=Jr({typed:r,SparseMatrix:u}),d=gr({typed:r,equalScalar:o}),m=dr({typed:r,DenseMatrix:n}),p=Ge({typed:r,matrix:t,concat:i});return r(IC,p({elop:a,SS:s,DS:f,SD:l,Ss:d,sS:m}))})});function Zo(e){var{DenseMatrix:r}=e;return function(o,a,n){var i=o.size();if(i.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+Ie(i)+")");var u=i[0],l=i[1];if(u!==l)throw new RangeError("Matrix must be square (size: "+Ie(i)+")");var f=[];if(Ae(a)){var s=a.size(),d=a._data;if(s.length===1){if(s[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var m=0;m<u;m++)f[m]=[d[m]];return new r({data:f,size:[u,1],datatype:a._datatype})}if(s.length===2){if(s[0]!==u||s[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(ln(a)){if(n){f=[];for(var p=0;p<u;p++)f[p]=[d[p][0]];return new r({data:f,size:[u,1],datatype:a._datatype})}return a}if(Mo(a)){for(var x=0;x<u;x++)f[x]=[0];for(var c=a._values,v=a._index,y=a._ptr,b=y[1],h=y[0];h<b;h++){var S=v[h];f[S][0]=c[h]}return new r({data:f,size:[u,1],datatype:a._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(fr(a)){var w=_e(a);if(w.length===1){if(w[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var g=0;g<u;g++)f[g]=[a[g]];return new r({data:f,size:[u,1]})}if(w.length===2){if(w[0]!==u||w[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var A=0;A<u;A++)f[A]=[a[A][0]];return new r({data:f,size:[u,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var si=T(()=>{Se();ze();Er()});var qC,rX,sx,UC=T(()=>{U();si();qC="lsolve",rX=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],sx=O(qC,rX,e=>{var{typed:r,matrix:t,divideScalar:o,multiplyScalar:a,subtractScalar:n,equalScalar:i,DenseMatrix:u}=e,l=Zo({DenseMatrix:u});return r(qC,{"SparseMatrix, Array | Matrix":function(m,p){return s(m,p)},"DenseMatrix, Array | Matrix":function(m,p){return f(m,p)},"Array, Array | Matrix":function(m,p){var x=t(m),c=f(x,p);return c.valueOf()}});function f(d,m){m=l(d,m,!0);for(var p=m._data,x=d._size[0],c=d._size[1],v=[],y=d._data,b=0;b<c;b++){var h=p[b][0]||0,S=void 0;if(i(h,0))S=0;else{var w=y[b][b];if(i(w,0))throw new Error("Linear system cannot be solved since matrix is singular");S=o(h,w);for(var g=b+1;g<x;g++)p[g]=[n(p[g][0]||0,a(S,y[g][b]))]}v[b]=[S]}return new u({data:v,size:[x,1]})}function s(d,m){m=l(d,m,!0);for(var p=m._data,x=d._size[0],c=d._size[1],v=d._values,y=d._index,b=d._ptr,h=[],S=0;S<c;S++){var w=p[S][0]||0;if(i(w,0))h[S]=[0];else{for(var g=0,A=[],C=[],D=b[S],N=b[S+1],E=D;E<N;E++){var _=y[E];_===S?g=v[E]:_>S&&(A.push(v[E]),C.push(_))}if(i(g,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var L=o(w,g),P=0,k=C.length;P<k;P++){var R=C[P];p[R]=[n(p[R][0]||0,a(L,A[P]))]}h[S]=[L]}}return new u({data:h,size:[x,1]})}})});var HC,tX,lx,WC=T(()=>{U();si();HC="usolve",tX=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],lx=O(HC,tX,e=>{var{typed:r,matrix:t,divideScalar:o,multiplyScalar:a,subtractScalar:n,equalScalar:i,DenseMatrix:u}=e,l=Zo({DenseMatrix:u});return r(HC,{"SparseMatrix, Array | Matrix":function(m,p){return s(m,p)},"DenseMatrix, Array | Matrix":function(m,p){return f(m,p)},"Array, Array | Matrix":function(m,p){var x=t(m),c=f(x,p);return c.valueOf()}});function f(d,m){m=l(d,m,!0);for(var p=m._data,x=d._size[0],c=d._size[1],v=[],y=d._data,b=c-1;b>=0;b--){var h=p[b][0]||0,S=void 0;if(i(h,0))S=0;else{var w=y[b][b];if(i(w,0))throw new Error("Linear system cannot be solved since matrix is singular");S=o(h,w);for(var g=b-1;g>=0;g--)p[g]=[n(p[g][0]||0,a(S,y[g][b]))]}v[b]=[S]}return new u({data:v,size:[x,1]})}function s(d,m){m=l(d,m,!0);for(var p=m._data,x=d._size[0],c=d._size[1],v=d._values,y=d._index,b=d._ptr,h=[],S=c-1;S>=0;S--){var w=p[S][0]||0;if(i(w,0))h[S]=[0];else{for(var g=0,A=[],C=[],D=b[S],N=b[S+1],E=N-1;E>=D;E--){var _=y[E];_===S?g=v[E]:_<S&&(A.push(v[E]),C.push(_))}if(i(g,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var L=o(w,g),P=0,k=C.length;P<k;P++){var R=C[P];p[R]=[n(p[R][0],a(L,A[P]))]}h[S]=[L]}}return new u({data:h,size:[x,1]})}})});var VC,oX,dx,GC=T(()=>{U();si();VC="lsolveAll",oX=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],dx=O(VC,oX,e=>{var{typed:r,matrix:t,divideScalar:o,multiplyScalar:a,subtractScalar:n,equalScalar:i,DenseMatrix:u}=e,l=Zo({DenseMatrix:u});return r(VC,{"SparseMatrix, Array | Matrix":function(m,p){return s(m,p)},"DenseMatrix, Array | Matrix":function(m,p){return f(m,p)},"Array, Array | Matrix":function(m,p){var x=t(m),c=f(x,p);return c.map(v=>v.valueOf())}});function f(d,m){for(var p=[l(d,m,!0)._data.map(C=>C[0])],x=d._data,c=d._size[0],v=d._size[1],y=0;y<v;y++)for(var b=p.length,h=0;h<b;h++){var S=p[h];if(i(x[y][y],0))if(i(S[y],0)){if(h===0){var g=[...S];g[y]=1;for(var A=y+1;A<v;A++)g[A]=n(g[A],x[A][y]);p.push(g)}}else{if(h===0)return[];p.splice(h,1),h-=1,b-=1}else{S[y]=o(S[y],x[y][y]);for(var w=y+1;w<v;w++)S[w]=n(S[w],a(S[y],x[w][y]))}}return p.map(C=>new u({data:C.map(D=>[D]),size:[c,1]}))}function s(d,m){for(var p=[l(d,m,!0)._data.map(J=>J[0])],x=d._size[0],c=d._size[1],v=d._values,y=d._index,b=d._ptr,h=0;h<c;h++)for(var S=p.length,w=0;w<S;w++){for(var g=p[w],A=[],C=[],D=b[h],N=b[h+1],E=0,_=D;_<N;_++){var L=y[_];L===h?E=v[_]:L>h&&(A.push(v[_]),C.push(L))}if(i(E,0))if(i(g[h],0)){if(w===0){var F=[...g];F[h]=1;for(var I=0,B=C.length;I<B;I++){var V=C[I];F[V]=n(F[V],A[I])}p.push(F)}}else{if(w===0)return[];p.splice(w,1),w-=1,S-=1}else{g[h]=o(g[h],E);for(var P=0,k=C.length;P<k;P++){var R=C[P];g[R]=n(g[R],a(g[h],A[P]))}}}return p.map(J=>new u({data:J.map(K=>[K]),size:[x,1]}))}})});var $C,aX,px,KC=T(()=>{U();si();$C="usolveAll",aX=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],px=O($C,aX,e=>{var{typed:r,matrix:t,divideScalar:o,multiplyScalar:a,subtractScalar:n,equalScalar:i,DenseMatrix:u}=e,l=Zo({DenseMatrix:u});return r($C,{"SparseMatrix, Array | Matrix":function(m,p){return s(m,p)},"DenseMatrix, Array | Matrix":function(m,p){return f(m,p)},"Array, Array | Matrix":function(m,p){var x=t(m),c=f(x,p);return c.map(v=>v.valueOf())}});function f(d,m){for(var p=[l(d,m,!0)._data.map(C=>C[0])],x=d._data,c=d._size[0],v=d._size[1],y=v-1;y>=0;y--)for(var b=p.length,h=0;h<b;h++){var S=p[h];if(i(x[y][y],0))if(i(S[y],0)){if(h===0){var g=[...S];g[y]=1;for(var A=y-1;A>=0;A--)g[A]=n(g[A],x[A][y]);p.push(g)}}else{if(h===0)return[];p.splice(h,1),h-=1,b-=1}else{S[y]=o(S[y],x[y][y]);for(var w=y-1;w>=0;w--)S[w]=n(S[w],a(S[y],x[w][y]))}}return p.map(C=>new u({data:C.map(D=>[D]),size:[c,1]}))}function s(d,m){for(var p=[l(d,m,!0)._data.map(J=>J[0])],x=d._size[0],c=d._size[1],v=d._values,y=d._index,b=d._ptr,h=c-1;h>=0;h--)for(var S=p.length,w=0;w<S;w++){for(var g=p[w],A=[],C=[],D=b[h],N=b[h+1],E=0,_=N-1;_>=D;_--){var L=y[_];L===h?E=v[_]:L<h&&(A.push(v[_]),C.push(L))}if(i(E,0))if(i(g[h],0)){if(w===0){var F=[...g];F[h]=1;for(var I=0,B=C.length;I<B;I++){var V=C[I];F[V]=n(F[V],A[I])}p.push(F)}}else{if(w===0)return[];p.splice(w,1),w-=1,S-=1}else{g[h]=o(g[h],E);for(var P=0,k=C.length;P<k;P++){var R=C[P];g[R]=n(g[R],a(g[h],A[P]))}}}return p.map(J=>new u({data:J.map(K=>[K]),size:[x,1]}))}})});var nX,iX,li,hs=T(()=>{U();yt();nX="matAlgo08xS0Sid",iX=["typed","equalScalar"],li=O(nX,iX,e=>{var{typed:r,equalScalar:t}=e;return function(a,n,i){var u=a._values,l=a._index,f=a._ptr,s=a._size,d=a._datatype||a._data===void 0?a._datatype:a.getDataType(),m=n._values,p=n._index,x=n._ptr,c=n._size,v=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(s.length!==c.length)throw new Ue(s.length,c.length);if(s[0]!==c[0]||s[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+c+")");if(!u||!m)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var y=s[0],b=s[1],h,S=t,w=0,g=i;typeof d=="string"&&d===v&&d!=="mixed"&&(h=d,S=r.find(t,[h,h]),w=r.convert(0,h),g=r.find(i,[h,h]));for(var A=[],C=[],D=[],N=[],E=[],_,L,P,k,R=0;R<b;R++){D[R]=C.length;var F=R+1;for(L=f[R],P=f[R+1],_=L;_<P;_++)k=l[_],E[k]=F,N[k]=u[_],C.push(k);for(L=x[R],P=x[R+1],_=L;_<P;_++)k=p[_],E[k]===F&&(N[k]=g(N[k],m[_]));for(_=D[R];_<C.length;){k=C[_];var I=N[k];S(I,w)?C.splice(_,1):(A.push(I),_++)}}return D[b]=C.length,a.createSparseMatrix({values:A,index:C,ptr:D,size:[y,b],datatype:d===a._datatype&&v===n._datatype?h:void 0})}})});var di,vs=T(()=>{U();di=O("useMatrixForArrayScalar",["typed","matrix"],e=>{var{typed:r,matrix:t}=e;return{"Array, number":r.referTo("DenseMatrix, number",o=>(a,n)=>o(t(a),n).valueOf()),"Array, BigNumber":r.referTo("DenseMatrix, BigNumber",o=>(a,n)=>o(t(a),n).valueOf()),"number, Array":r.referTo("number, DenseMatrix",o=>(a,n)=>o(a,t(n)).valueOf()),"BigNumber, Array":r.referTo("BigNumber, DenseMatrix",o=>(a,n)=>o(a,t(n)).valueOf())}})});var QC,fX,mx,ZC=T(()=>{yo();ut();go();ua();qa();hs();U();Nr();vs();$e();Sn();QC="leftShift",fX=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],mx=O(QC,fX,e=>{var{typed:r,matrix:t,equalScalar:o,zeros:a,DenseMatrix:n,concat:i}=e,u=Nt({typed:r}),l=Qr({typed:r,equalScalar:o}),f=li({typed:r,equalScalar:o}),s=Xt({typed:r,DenseMatrix:n}),d=gr({typed:r,equalScalar:o}),m=Kr({typed:r}),p=Ge({typed:r,matrix:t,concat:i}),x=di({typed:r,matrix:t});return r(QC,{"number, number":bp,"BigNumber, BigNumber":zA,"bigint, bigint":(c,v)=>c<<v,"SparseMatrix, number | BigNumber":r.referToSelf(c=>(v,y)=>o(y,0)?v.clone():d(v,y,c,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(c=>(v,y)=>o(y,0)?v.clone():m(v,y,c,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(c=>(v,y)=>o(v,0)?a(y.size(),y.storage()):s(y,v,c,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(c=>(v,y)=>o(v,0)?a(y.size(),y.storage()):m(y,v,c,!0))},x,p({SS:f,DS:u,SD:l}))})});var YC,uX,cx,XC=T(()=>{Sn();yo();ut();go();ua();qa();hs();U();Nr();vs();$e();YC="rightArithShift",uX=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],cx=O(YC,uX,e=>{var{typed:r,matrix:t,equalScalar:o,zeros:a,DenseMatrix:n,concat:i}=e,u=Nt({typed:r}),l=Qr({typed:r,equalScalar:o}),f=li({typed:r,equalScalar:o}),s=Xt({typed:r,DenseMatrix:n}),d=gr({typed:r,equalScalar:o}),m=Kr({typed:r}),p=Ge({typed:r,matrix:t,concat:i}),x=di({typed:r,matrix:t});return r(YC,{"number, number":Dp,"BigNumber, BigNumber":qA,"bigint, bigint":(c,v)=>c>>v,"SparseMatrix, number | BigNumber":r.referToSelf(c=>(v,y)=>o(y,0)?v.clone():d(v,y,c,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(c=>(v,y)=>o(y,0)?v.clone():m(v,y,c,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(c=>(v,y)=>o(v,0)?a(y.size(),y.storage()):s(y,v,c,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(c=>(v,y)=>o(v,0)?a(y.size(),y.storage()):m(y,v,c,!0))},x,p({SS:f,DS:u,SD:l}))})});var JC,sX,xx,jC=T(()=>{yo();ut();go();ua();qa();hs();U();Nr();$e();vs();JC="rightLogShift",sX=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],xx=O(JC,sX,e=>{var{typed:r,matrix:t,equalScalar:o,zeros:a,DenseMatrix:n,concat:i}=e,u=Nt({typed:r}),l=Qr({typed:r,equalScalar:o}),f=li({typed:r,equalScalar:o}),s=Xt({typed:r,DenseMatrix:n}),d=gr({typed:r,equalScalar:o}),m=Kr({typed:r}),p=Ge({typed:r,matrix:t,concat:i}),x=di({typed:r,matrix:t});return r(JC,{"number, number":Ap,"SparseMatrix, number | BigNumber":r.referToSelf(c=>(v,y)=>o(y,0)?v.clone():d(v,y,c,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(c=>(v,y)=>o(y,0)?v.clone():m(v,y,c,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(c=>(v,y)=>o(v,0)?a(y.size(),y.storage()):s(y,v,c,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(c=>(v,y)=>o(v,0)?a(y.size(),y.storage()):m(y,v,c,!0))},x,p({SS:f,DS:u,SD:l}))})});var eR,lX,Ff,hx=T(()=>{yo();ut();go();vf();U();Nr();$e();eR="and",lX=["typed","matrix","equalScalar","zeros","not","concat"],Ff=O(eR,lX,e=>{var{typed:r,matrix:t,equalScalar:o,zeros:a,not:n,concat:i}=e,u=Qr({typed:r,equalScalar:o}),l=Ua({typed:r,equalScalar:o}),f=gr({typed:r,equalScalar:o}),s=Kr({typed:r}),d=Ge({typed:r,matrix:t,concat:i});return r(eR,{"number, number":is,"Complex, Complex":function(p,x){return(p.re!==0||p.im!==0)&&(x.re!==0||x.im!==0)},"BigNumber, BigNumber":function(p,x){return!p.isZero()&&!x.isZero()&&!p.isNaN()&&!x.isNaN()},"bigint, bigint":is,"Unit, Unit":r.referToSelf(m=>(p,x)=>m(p.value||0,x.value||0)),"SparseMatrix, any":r.referToSelf(m=>(p,x)=>n(x)?a(p.size(),p.storage()):f(p,x,m,!1)),"DenseMatrix, any":r.referToSelf(m=>(p,x)=>n(x)?a(p.size(),p.storage()):s(p,x,m,!1)),"any, SparseMatrix":r.referToSelf(m=>(p,x)=>n(p)?a(p.size(),p.storage()):f(x,p,m,!0)),"any, DenseMatrix":r.referToSelf(m=>(p,x)=>n(p)?a(p.size(),p.storage()):s(x,p,m,!0)),"Array, any":r.referToSelf(m=>(p,x)=>m(t(p),x).valueOf()),"any, Array":r.referToSelf(m=>(p,x)=>m(p,t(x)).valueOf())},d({SS:l,DS:u}))})});var gs,dX,vx,pX,rR=T(()=>{ho();He();U();Rt();Xr();xf();Nr();yn();gs="compare",dX=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],vx=O(gs,dX,e=>{var{typed:r,config:t,equalScalar:o,matrix:a,BigNumber:n,Fraction:i,DenseMatrix:u,concat:l}=e,f=br({typed:r}),s=za({typed:r,equalScalar:o}),d=dr({typed:r,DenseMatrix:u}),m=Ge({typed:r,matrix:a,concat:l}),p=vo({typed:r});return r(gs,pX({typed:r,config:t}),{"boolean, boolean":function(c,v){return c===v?0:c>v?1:-1},"BigNumber, BigNumber":function(c,v){return Vr(c,v,t.relTol,t.absTol)?new n(0):new n(c.cmp(v))},"bigint, bigint":function(c,v){return c===v?0n:c>v?1n:-1n},"Fraction, Fraction":function(c,v){return new i(c.compare(v))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},p,m({SS:s,DS:f,Ss:d}))}),pX=O(gs,["typed","config"],e=>{var{typed:r,config:t}=e;return r(gs,{"number, number":function(a,n){return Rr(a,n,t.relTol,t.absTol)?0:a>n?1:-1}})})});var oR=Ir((B0e,tR)=>{tR.exports=function e(r,t){"use strict";var o=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,a=/(^[ ]*|[ ]*$)/g,n=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,i=/^0x[0-9a-f]+$/i,u=/^0/,l=function(h){return e.insensitive&&(""+h).toLowerCase()||""+h},f=l(r).replace(a,"")||"",s=l(t).replace(a,"")||"",d=f.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=s.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=parseInt(f.match(i),16)||d.length!==1&&f.match(n)&&Date.parse(f),x=parseInt(s.match(i),16)||p&&s.match(n)&&Date.parse(s)||null,c,v;if(x){if(p<x)return-1;if(p>x)return 1}for(var y=0,b=Math.max(d.length,m.length);y<b;y++){if(c=!(d[y]||"").match(u)&&parseFloat(d[y])||d[y]||0,v=!(m[y]||"").match(u)&&parseFloat(m[y])||m[y]||0,isNaN(c)!==isNaN(v))return isNaN(c)?1:-1;if(typeof c!=typeof v&&(c+="",v+=""),c<v)return-1;if(c>v)return 1}return 0}});function cX(e,r){return e.re>r.re?1:e.re<r.re?-1:e.im>r.im?1:e.im<r.im?-1:0}var Tn,aR,mX,gx,nR=T(()=>{Tn=hr(oR(),1);Se();U();aR="compareNatural",mX=["typed","compare"],gx=O(aR,mX,e=>{var{typed:r,compare:t}=e,o=t.signatures["boolean,boolean"];return r(aR,{"any, any":a});function a(l,f){var s=ar(l),d=ar(f),m;if((s==="number"||s==="BigNumber"||s==="Fraction")&&(d==="number"||d==="BigNumber"||d==="Fraction"))return m=t(l,f),m.toString()!=="0"?m>0?1:-1:(0,Tn.default)(s,d);var p=["Array","DenseMatrix","SparseMatrix"];if(p.includes(s)||p.includes(d))return m=n(a,l,f),m!==0?m:(0,Tn.default)(s,d);if(s!==d)return(0,Tn.default)(s,d);if(s==="Complex")return cX(l,f);if(s==="Unit")return l.equalBase(f)?a(l.value,f.value):i(a,l.formatUnits(),f.formatUnits());if(s==="boolean")return o(l,f);if(s==="string")return(0,Tn.default)(l,f);if(s==="Object")return u(a,l,f);if(s==="null"||s==="undefined")return 0;throw new TypeError('Unsupported type of value "'+s+'"')}function n(l,f,s){return Mo(f)&&Mo(s)?i(l,f.toJSON().values,s.toJSON().values):Mo(f)?n(l,f.toArray(),s):Mo(s)?n(l,f,s.toArray()):ln(f)?n(l,f.toJSON().data,s):ln(s)?n(l,f,s.toJSON().data):Array.isArray(f)?Array.isArray(s)?i(l,f,s):n(l,f,[s]):n(l,[f],s)}function i(l,f,s){for(var d=0,m=Math.min(f.length,s.length);d<m;d++){var p=l(f[d],s[d]);if(p!==0)return p}return f.length>s.length?1:f.length<s.length?-1:0}function u(l,f,s){var d=Object.keys(f),m=Object.keys(s);d.sort(Tn.default),m.sort(Tn.default);var p=i(l,d,m);if(p!==0)return p;for(var x=0;x<d.length;x++){var c=l(f[d[x]],s[m[x]]);if(c!==0)return c}return 0}})});var iR,xX,yx,fR=T(()=>{Er();U();Nr();iR="compareText",xX=["typed","matrix","concat"];Xu.signature="any, any";yx=O(iR,xX,e=>{var{typed:r,matrix:t,concat:o}=e,a=Ge({typed:r,matrix:t,concat:o});return r(iR,Xu,a({elop:Xu,Ds:!0}))})});var ys,hX,Sx,vX,uR=T(()=>{U();Rt();Po();Xr();Nr();ys="equal",hX=["typed","matrix","equalScalar","DenseMatrix","concat","SparseMatrix"],Sx=O(ys,hX,e=>{var{typed:r,matrix:t,equalScalar:o,DenseMatrix:a,concat:n,SparseMatrix:i}=e,u=br({typed:r}),l=Jr({typed:r,SparseMatrix:i}),f=dr({typed:r,DenseMatrix:a}),s=Ge({typed:r,matrix:t,concat:n});return r(ys,vX({typed:r,equalScalar:o}),s({elop:o,SS:l,DS:u,Ss:f}))}),vX=O(ys,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(ys,{"any, any":function(a,n){return a===null?n===null:n===null?a===null:a===void 0?n===void 0:n===void 0?a===void 0:t(a,n)}})})});var sR,gX,wx,lR=T(()=>{U();sR="equalText",gX=["typed","compareText","isZero"],wx=O(sR,gX,e=>{var{typed:r,compareText:t,isZero:o}=e;return r(sR,{"any, any":function(n,i){return o(t(n,i))}})})});var Ss,yX,Tx,SX,dR=T(()=>{ho();He();U();Rt();Po();Xr();Nr();yn();Ss="smaller",yX=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],Tx=O(Ss,yX,e=>{var{typed:r,config:t,bignumber:o,matrix:a,DenseMatrix:n,concat:i,SparseMatrix:u}=e,l=br({typed:r}),f=Jr({typed:r,SparseMatrix:u}),s=dr({typed:r,DenseMatrix:n}),d=Ge({typed:r,matrix:a,concat:i}),m=vo({typed:r});function p(x,c){return x.lt(c)&&!Vr(x,c,t.relTol,t.absTol)}return r(Ss,SX({typed:r,config:t}),{"boolean, boolean":(x,c)=>x<c,"BigNumber, BigNumber":p,"bigint, bigint":(x,c)=>x<c,"Fraction, Fraction":(x,c)=>x.compare(c)===-1,"Fraction, BigNumber":function(c,v){return p(o(c),v)},"BigNumber, Fraction":function(c,v){return p(c,o(v))},"Complex, Complex":function(c,v){throw new TypeError("No ordering relation is defined for complex numbers")}},m,d({SS:f,DS:l,Ss:s}))}),SX=O(Ss,["typed","config"],e=>{var{typed:r,config:t}=e;return r(Ss,{"number, number":function(a,n){return a<n&&!Rr(a,n,t.relTol,t.absTol)}})})});var ws,wX,bx,TX,pR=T(()=>{ho();He();U();Rt();Po();Xr();Nr();yn();ws="smallerEq",wX=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],bx=O(ws,wX,e=>{var{typed:r,config:t,matrix:o,DenseMatrix:a,concat:n,SparseMatrix:i}=e,u=br({typed:r}),l=Jr({typed:r,SparseMatrix:i}),f=dr({typed:r,DenseMatrix:a}),s=Ge({typed:r,matrix:o,concat:n}),d=vo({typed:r});return r(ws,TX({typed:r,config:t}),{"boolean, boolean":(m,p)=>m<=p,"BigNumber, BigNumber":function(p,x){return p.lte(x)||Vr(p,x,t.relTol,t.absTol)},"bigint, bigint":(m,p)=>m<=p,"Fraction, Fraction":(m,p)=>m.compare(p)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},d,s({SS:l,DS:u,Ss:f}))}),TX=O(ws,["typed","config"],e=>{var{typed:r,config:t}=e;return r(ws,{"number, number":function(a,n){return a<=n||Rr(a,n,t.relTol,t.absTol)}})})});var Ts,bX,Dx,DX,mR=T(()=>{ho();He();U();Rt();Po();Xr();Nr();yn();Ts="larger",bX=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],Dx=O(Ts,bX,e=>{var{typed:r,config:t,bignumber:o,matrix:a,DenseMatrix:n,concat:i,SparseMatrix:u}=e,l=br({typed:r}),f=Jr({typed:r,SparseMatrix:u}),s=dr({typed:r,DenseMatrix:n}),d=Ge({typed:r,matrix:a,concat:i}),m=vo({typed:r});function p(x,c){return x.gt(c)&&!Vr(x,c,t.relTol,t.absTol)}return r(Ts,DX({typed:r,config:t}),{"boolean, boolean":(x,c)=>x>c,"BigNumber, BigNumber":p,"bigint, bigint":(x,c)=>x>c,"Fraction, Fraction":(x,c)=>x.compare(c)===1,"Fraction, BigNumber":function(c,v){return p(o(c),v)},"BigNumber, Fraction":function(c,v){return p(c,o(v))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},m,d({SS:f,DS:l,Ss:s}))}),DX=O(Ts,["typed","config"],e=>{var{typed:r,config:t}=e;return r(Ts,{"number, number":function(a,n){return a>n&&!Rr(a,n,t.relTol,t.absTol)}})})});var bs,AX,Ax,OX,cR=T(()=>{ho();He();U();Rt();Po();Xr();Nr();yn();bs="largerEq",AX=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],Ax=O(bs,AX,e=>{var{typed:r,config:t,matrix:o,DenseMatrix:a,concat:n,SparseMatrix:i}=e,u=br({typed:r}),l=Jr({typed:r,SparseMatrix:i}),f=dr({typed:r,DenseMatrix:a}),s=Ge({typed:r,matrix:o,concat:n}),d=vo({typed:r});return r(bs,OX({typed:r,config:t}),{"boolean, boolean":(m,p)=>m>=p,"BigNumber, BigNumber":function(p,x){return p.gte(x)||Vr(p,x,t.relTol,t.absTol)},"bigint, bigint":function(p,x){return p>=x},"Fraction, Fraction":(m,p)=>m.compare(p)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},d,s({SS:l,DS:u,Ss:f}))}),OX=O(bs,["typed","config"],e=>{var{typed:r,config:t}=e;return r(bs,{"number, number":function(a,n){return a>=n||Rr(a,n,t.relTol,t.absTol)}})})});var xR,CX,Ox,hR=T(()=>{U();xR="deepEqual",CX=["typed","equal"],Ox=O(xR,CX,e=>{var{typed:r,equal:t}=e;return r(xR,{"any, any":function(n,i){return o(n.valueOf(),i.valueOf())}});function o(a,n){if(Array.isArray(a))if(Array.isArray(n)){var i=a.length;if(i!==n.length)return!1;for(var u=0;u<i;u++)if(!o(a[u],n[u]))return!1;return!0}else return!1;else return Array.isArray(n)?!1:t(a,n)}})});var Ds,RX,Cx,NX,vR=T(()=>{U();Rt();Po();Xr();Nr();Ds="unequal",RX=["typed","config","equalScalar","matrix","DenseMatrix","concat","SparseMatrix"],Cx=O(Ds,RX,e=>{var{typed:r,config:t,equalScalar:o,matrix:a,DenseMatrix:n,concat:i,SparseMatrix:u}=e,l=br({typed:r}),f=Jr({typed:r,SparseMatrix:u}),s=dr({typed:r,DenseMatrix:n}),d=Ge({typed:r,matrix:a,concat:i});return r(Ds,NX({typed:r,equalScalar:o}),d({elop:m,SS:f,DS:l,Ss:s}));function m(p,x){return!o(p,x)}}),NX=O(Ds,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(Ds,{"any, any":function(a,n){return a===null?n!==null:n===null?a!==null:a===void 0?n!==void 0:n===void 0?a!==void 0:!t(a,n)}})})});var gR,MX,Rx,yR=T(()=>{Se();He();U();gR="partitionSelect",MX=["typed","isNumeric","isNaN","compare"],Rx=O(gR,MX,e=>{var{typed:r,isNumeric:t,isNaN:o,compare:a}=e,n=a,i=(f,s)=>-a(f,s);return r(gR,{"Array | Matrix, number":function(s,d){return u(s,d,n)},"Array | Matrix, number, string":function(s,d,m){if(m==="asc")return u(s,d,n);if(m==="desc")return u(s,d,i);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(f,s,d){if(!be(s)||s<0)throw new Error("k must be a non-negative integer");if(Ae(f)){var m=f.size();if(m.length>1)throw new Error("Only one dimensional matrices supported");return l(f.valueOf(),s,d)}if(Array.isArray(f))return l(f,s,d)}function l(f,s,d){if(s>=f.length)throw new Error("k out of bounds");for(var m=0;m<f.length;m++)if(t(f[m])&&o(f[m]))return f[m];for(var p=0,x=f.length-1;p<x;){for(var c=p,v=x,y=f[Math.floor(Math.random()*(x-p+1))+p];c<v;)if(d(f[c],y)>=0){var b=f[v];f[v]=f[c],f[c]=b,--v}else++c;d(f[c],y)>0&&--c,s<=c?x=c:p=c+1}return f[s]}})});var SR,EX,Nx,wR=T(()=>{ze();U();SR="sort",EX=["typed","matrix","compare","compareNatural"],Nx=O(SR,EX,e=>{var{typed:r,matrix:t,compare:o,compareNatural:a}=e,n=o,i=(s,d)=>-o(s,d);return r(SR,{Array:function(d){return l(d),d.sort(n)},Matrix:function(d){return f(d),t(d.toArray().sort(n),d.storage())},"Array, function":function(d,m){return l(d),d.sort(m)},"Matrix, function":function(d,m){return f(d),t(d.toArray().sort(m),d.storage())},"Array, string":function(d,m){return l(d),d.sort(u(m))},"Matrix, string":function(d,m){return f(d),t(d.toArray().sort(u(m)),d.storage())}});function u(s){if(s==="asc")return n;if(s==="desc")return i;if(s==="natural")return a;throw new Error('String "asc", "desc", or "natural" expected')}function l(s){if(_e(s).length!==1)throw new Error("One dimensional array expected")}function f(s){if(s.size().length!==1)throw new Error("One dimensional matrix expected")}})});var TR,FX,Bf,Mx=T(()=>{je();U();He();Qo();TR="max",FX=["typed","config","numeric","larger"],Bf=O(TR,FX,e=>{var{typed:r,config:t,numeric:o,larger:a}=e;return r(TR,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(l,f){return Ia(l,f.valueOf(),n)},"...":function(l){if(xo(l))throw new TypeError("Scalar values expected in function max");return i(l)}});function n(u,l){try{return a(u,l)?u:l}catch(f){throw Hr(f,"max",l)}}function i(u){var l;if(Ct(u,function(f){try{typeof f=="number"&&isNaN(f)?l=NaN:(l===void 0||a(f,l))&&(l=f)}catch(s){throw Hr(s,"max",f)}}),l===void 0)throw new Error("Cannot calculate max of an empty array");return typeof l=="string"&&(l=o(l,Dt(l,t))),l}})});var bR,BX,_f,Ex=T(()=>{je();U();He();Qo();bR="min",BX=["typed","config","numeric","smaller"],_f=O(bR,BX,e=>{var{typed:r,config:t,numeric:o,smaller:a}=e;return r(bR,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(l,f){return Ia(l,f.valueOf(),n)},"...":function(l){if(xo(l))throw new TypeError("Scalar values expected in function min");return i(l)}});function n(u,l){try{return a(u,l)?u:l}catch(f){throw Hr(f,"min",l)}}function i(u){var l;if(Ct(u,function(f){try{typeof f=="number"&&isNaN(f)?l=NaN:(l===void 0||a(f,l))&&(l=f)}catch(s){throw Hr(s,"min",f)}}),l===void 0)throw new Error("Cannot calculate min of an empty array");return typeof l=="string"&&(l=o(l,Dt(l,t))),l}})});var _X,PX,Fx,DR=T(()=>{Se();lr();U();_X="ImmutableDenseMatrix",PX=["smaller","DenseMatrix"],Fx=O(_X,PX,e=>{var{smaller:r,DenseMatrix:t}=e;function o(a,n){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if(n&&!zr(n))throw new Error("Invalid datatype: "+n);if(Ae(a)||fr(a)){var i=new t(a,n);this._data=i._data,this._size=i._size,this._datatype=i._datatype,this._min=null,this._max=null}else if(a&&fr(a.data)&&fr(a.size))this._data=a.data,this._size=a.size,this._datatype=a.datatype,this._min=typeof a.min<"u"?a.min:null,this._max=typeof a.max<"u"?a.max:null;else{if(a)throw new TypeError("Unsupported type of data ("+ar(a)+")");this._data=[],this._size=[0],this._datatype=n,this._min=null,this._max=null}}return o.prototype=new t,o.prototype.type="ImmutableDenseMatrix",o.prototype.isImmutableDenseMatrix=!0,o.prototype.subset=function(a){switch(arguments.length){case 1:{var n=t.prototype.subset.call(this,a);return Ae(n)?new o({data:n._data,size:n._size,datatype:n._datatype}):n}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},o.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},o.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},o.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},o.prototype.clone=function(){return new o({data:Pe(this._data),size:Pe(this._size),datatype:this._datatype})},o.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},o.fromJSON=function(a){return new o(a)},o.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},o.prototype.min=function(){if(this._min===null){var a=null;this.forEach(function(n){(a===null||r(n,a))&&(a=n)}),this._min=a!==null?a:void 0}return this._min},o.prototype.max=function(){if(this._max===null){var a=null;this.forEach(function(n){(a===null||r(a,n))&&(a=n)}),this._max=a!==null?a:void 0}return this._max},o},{isClass:!0})});function AR(e){var r=[];return e.forEach((t,o)=>{t&&r.push(o)}),r}var kX,LX,Bx,OR=T(()=>{Se();lr();He();U();kX="Index",LX=["ImmutableDenseMatrix","getMatrixDataType"],Bx=O(kX,LX,e=>{var{ImmutableDenseMatrix:r,getMatrixDataType:t}=e;function o(n){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var i=0,u=arguments.length;i<u;i++){var l=arguments[i],f=fr(l),s=Ae(l),d=typeof l,m=null;if(Hn(l))this._dimensions.push(l),this._isScalar=!1;else if(f||s){var p=void 0;t(l)==="boolean"?(f&&(p=a(AR(l).valueOf())),s&&(p=a(AR(l._data).valueOf())),m=l.valueOf().length):p=a(l.valueOf()),this._dimensions.push(p);var x=p.size();(x.length!==1||x[0]!==1||m!==null)&&(this._isScalar=!1)}else if(d==="number")this._dimensions.push(a([l]));else if(d==="bigint")this._dimensions.push(a([Number(l)]));else if(d==="string")this._dimensions.push(l);else throw new TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");this._sourceSize.push(m)}}o.prototype.type="Index",o.prototype.isIndex=!0;function a(n){for(var i=0,u=n.length;i<u;i++)if(typeof n[i]!="number"||!be(n[i]))throw new TypeError("Index parameters must be positive integer numbers");return new r(n)}return o.prototype.clone=function(){var n=new o;return n._dimensions=Pe(this._dimensions),n._isScalar=this._isScalar,n._sourceSize=this._sourceSize,n},o.create=function(n){var i=new o;return o.apply(i,n),i},o.prototype.size=function(){for(var n=[],i=0,u=this._dimensions.length;i<u;i++){var l=this._dimensions[i];n[i]=typeof l=="string"?1:l.size()[0]}return n},o.prototype.max=function(){for(var n=[],i=0,u=this._dimensions.length;i<u;i++){var l=this._dimensions[i];n[i]=typeof l=="string"?l:l.max()}return n},o.prototype.min=function(){for(var n=[],i=0,u=this._dimensions.length;i<u;i++){var l=this._dimensions[i];n[i]=typeof l=="string"?l:l.min()}return n},o.prototype.forEach=function(n){for(var i=0,u=this._dimensions.length;i<u;i++)n(this._dimensions[i],i,this)},o.prototype.dimension=function(n){return typeof n!="number"?null:this._dimensions[n]||null},o.prototype.isObjectProperty=function(){return this._dimensions.length===1&&typeof this._dimensions[0]=="string"},o.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},o.prototype.isScalar=function(){return this._isScalar},o.prototype.toArray=function(){for(var n=[],i=0,u=this._dimensions.length;i<u;i++){var l=this._dimensions[i];n.push(typeof l=="string"?l:l.toArray())}return n},o.prototype.valueOf=o.prototype.toArray,o.prototype.toString=function(){for(var n=[],i=0,u=this._dimensions.length;i<u;i++){var l=this._dimensions[i];typeof l=="string"?n.push(JSON.stringify(l)):n.push(l.toString())}return"["+n.join(", ")+"]"},o.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},o.fromJSON=function(n){return o.create(n.dimensions)},o},{isClass:!0})});var IX,zX,_x,CR=T(()=>{U();IX="FibonacciHeap",zX=["smaller","larger"],_x=O(IX,zX,e=>{var{smaller:r,larger:t}=e,o=1/Math.log((1+Math.sqrt(5))/2);function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}a.prototype.type="FibonacciHeap",a.prototype.isFibonacciHeap=!0,a.prototype.insert=function(s,d){var m={key:s,value:d,degree:0};if(this._minimum){var p=this._minimum;m.left=p,m.right=p.right,p.right=m,m.right.left=m,r(s,p.key)&&(this._minimum=m)}else m.left=m,m.right=m,this._minimum=m;return this._size++,m},a.prototype.size=function(){return this._size},a.prototype.clear=function(){this._minimum=null,this._size=0},a.prototype.isEmpty=function(){return this._size===0},a.prototype.extractMinimum=function(){var s=this._minimum;if(s===null)return s;for(var d=this._minimum,m=s.degree,p=s.child;m>0;){var x=p.right;p.left.right=p.right,p.right.left=p.left,p.left=d,p.right=d.right,d.right=p,p.right.left=p,p.parent=null,p=x,m--}return s.left.right=s.right,s.right.left=s.left,s===s.right?d=null:(d=s.right,d=f(d,this._size)),this._size--,this._minimum=d,s},a.prototype.remove=function(s){this._minimum=n(this._minimum,s,-1),this.extractMinimum()};function n(s,d,m){d.key=m;var p=d.parent;return p&&r(d.key,p.key)&&(i(s,d,p),u(s,p)),r(d.key,s.key)&&(s=d),s}function i(s,d,m){d.left.right=d.right,d.right.left=d.left,m.degree--,m.child===d&&(m.child=d.right),m.degree===0&&(m.child=null),d.left=s,d.right=s.right,s.right=d,d.right.left=d,d.parent=null,d.mark=!1}function u(s,d){var m=d.parent;m&&(d.mark?(i(s,d,m),u(m)):d.mark=!0)}var l=function(d,m){d.left.right=d.right,d.right.left=d.left,d.parent=m,m.child?(d.left=m.child,d.right=m.child.right,m.child.right=d,d.right.left=d):(m.child=d,d.right=d,d.left=d),m.degree++,d.mark=!1};function f(s,d){var m=Math.floor(Math.log(d)*o)+1,p=new Array(m),x=0,c=s;if(c)for(x++,c=c.right;c!==s;)x++,c=c.right;for(var v;x>0;){for(var y=c.degree,b=c.right;v=p[y],!!v;){if(t(c.key,v.key)){var h=v;v=c,c=h}l(v,c),p[y]=null,y++}p[y]=c,c=b,x--}s=null;for(var S=0;S<m;S++)v=p[S],v&&(s?(v.left.right=v.right,v.right.left=v.left,v.left=s,v.right=s.right,s.right=v,v.right.left=v,r(v.key,s.key)&&(s=v)):s=v);return s}return a},{isClass:!0})});var qX,UX,Px,RR=T(()=>{U();qX="Spa",UX=["addScalar","equalScalar","FibonacciHeap"],Px=O(qX,UX,e=>{var{addScalar:r,equalScalar:t,FibonacciHeap:o}=e;function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new o}return a.prototype.type="Spa",a.prototype.isSpa=!0,a.prototype.set=function(n,i){if(this._values[n])this._values[n].value=i;else{var u=this._heap.insert(n,i);this._values[n]=u}},a.prototype.get=function(n){var i=this._values[n];return i?i.value:0},a.prototype.accumulate=function(n,i){var u=this._values[n];u?u.value=r(u.value,i):(u=this._heap.insert(n,i),this._values[n]=u)},a.prototype.forEach=function(n,i,u){var l=this._heap,f=this._values,s=[],d=l.extractMinimum();for(d&&s.push(d);d&&d.key<=i;)d.key>=n&&(t(d.value,0)||u(d.key,d.value,this)),d=l.extractMinimum(),d&&s.push(d);for(var m=0;m<s.length;m++){var p=s[m];d=l.insert(p.key,p.value),f[d.key]=d}},a.prototype.swap=function(n,i){var u=this._values[n],l=this._values[i];if(!u&&l)u=this._heap.insert(n,l.value),this._heap.remove(l),this._values[n]=u,this._values[i]=void 0;else if(u&&!l)l=this._heap.insert(i,u.value),this._heap.remove(u),this._values[i]=l,this._values[n]=void 0;else if(u&&l){var f=u.value;u.value=l.value,l.value=f}},a},{isClass:!0})});function NR(e){var r=0,t=1,o=Object.create(null),a=Object.create(null),n=0,i=function(l){var f=a[l];if(f&&(delete o[f],delete a[l],--r,t===f)){if(!r){n=0,t=1;return}for(;!Object.prototype.hasOwnProperty.call(o,++t););}};return e=Math.abs(e),{hit:function(l){var f=a[l],s=++n;if(o[s]=l,a[l]=s,!f)return++r,r<=e?void 0:(l=o[t],i(l),l);if(delete o[f],t===f)for(;!Object.prototype.hasOwnProperty.call(o,++t););},delete:i,clear:function(){r=n=0,t=1,o=Object.create(null),a=Object.create(null)}}}var MR=T(()=>{});function bn(e){var{hasher:r,limit:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t=t??Number.POSITIVE_INFINITY,r=r??JSON.stringify,function o(){typeof o.cache!="object"&&(o.cache={values:new Map,lru:NR(t||Number.POSITIVE_INFINITY)});for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];var i=r(a);if(o.cache.values.has(i))return o.cache.lru.hit(i),o.cache.values.get(i);var u=e.apply(e,a);return o.cache.values.set(i,u),o.cache.values.delete(o.cache.lru.hit(i)),u}}var kx=T(()=>{MR()});function As(e){return e[0].precision}var ER,FR,Pf,BR,Lx=T(()=>{kx();ER=bn(function(e){return new e(1).exp()},{hasher:As}),FR=bn(function(e){return new e(1).plus(new e(5).sqrt()).div(2)},{hasher:As}),Pf=bn(function(e){return e.acos(-1)},{hasher:As}),BR=bn(function(e){return Pf(e).times(2)},{hasher:As})});function _R(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,o)}return t}function Ix(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?_R(Object(t),!0).forEach(function(o){pr(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_R(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}var HX,WX,zx,PR=T(()=>{at();Oa();Se();U();kx();Er();lr();Lx();HX="Unit",WX=["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],zx=O(HX,WX,e=>{var{on:r,config:t,addScalar:o,subtractScalar:a,multiplyScalar:n,divideScalar:i,pow:u,abs:l,fix:f,round:s,equal:d,isNumeric:m,format:p,number:x,Complex:c,BigNumber:v,Fraction:y}=e,b=x;function h(q,G){if(!(this instanceof h))throw new Error("Constructor must be called with the new operator");if(!(q==null||m(q)||It(q)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,G===void 0)this.units=[],this.dimensions=I.map(ie=>0);else if(typeof G=="string"){var te=h.parse(G);this.units=te.units,this.dimensions=te.dimensions}else if(xt(G)&&G.value===null)this.fixPrefix=G.fixPrefix,this.skipAutomaticSimplification=G.skipAutomaticSimplification,this.dimensions=G.dimensions.slice(0),this.units=G.units.map(ie=>Pr({},ie));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(q)}Object.defineProperty(h,"name",{value:"Unit"}),h.prototype.constructor=h,h.prototype.type="Unit",h.prototype.isUnit=!0;var S,w,g;function A(){for(;g===" "||g===" ";)N()}function C(q){return q>="0"&&q<="9"||q==="."}function D(q){return q>="0"&&q<="9"}function N(){w++,g=S.charAt(w)}function E(q){w=q,g=S.charAt(w)}function _(){var q="",G=w;if(g==="+"?N():g==="-"&&(q+=g,N()),!C(g))return E(G),null;if(g==="."){if(q+=g,N(),!D(g))return E(G),null}else{for(;D(g);)q+=g,N();g==="."&&(q+=g,N())}for(;D(g);)q+=g,N();if(g==="E"||g==="e"){var te="",ie=w;if(te+=g,N(),(g==="+"||g==="-")&&(te+=g,N()),!D(g))return E(ie),q;for(q=q+te;D(g);)q+=g,N()}return q}function L(){for(var q="";D(g)||h.isValidAlpha(g);)q+=g,N();var G=q.charAt(0);return h.isValidAlpha(G)?q:null}function P(q){return g===q?(N(),q):null}h.parse=function(q,G){if(G=G||{},S=q,w=-1,g="",typeof S!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var te=new h;te.units=[];var ie=1,de=!1;N(),A();var he=_(),De=null;if(he){if(t.number==="BigNumber")De=new v(he);else if(t.number==="Fraction")try{De=new y(he)}catch{De=parseFloat(he)}else De=parseFloat(he);A(),P("*")?(ie=1,de=!0):P("/")&&(ie=-1,de=!0)}for(var Ne=[],Xe=1;;){for(A();g==="(";)Ne.push(ie),Xe*=ie,ie=1,N(),A();var qe=void 0;if(g){var yr=g;if(qe=L(),qe===null)throw new SyntaxError('Unexpected "'+yr+'" in "'+S+'" at index '+w.toString())}else break;var xr=k(qe);if(xr===null)throw new SyntaxError('Unit "'+qe+'" not found.');var kr=ie*Xe;if(A(),P("^")){A();var Yr=_();if(Yr===null)throw new SyntaxError('In "'+q+'", "^" must be followed by a floating-point number');kr*=Yr}te.units.push({unit:xr.unit,prefix:xr.prefix,power:kr});for(var Z=0;Z<I.length;Z++)te.dimensions[Z]+=(xr.unit.dimensions[Z]||0)*kr;for(A();g===")";){if(Ne.length===0)throw new SyntaxError('Unmatched ")" in "'+S+'" at index '+w.toString());Xe/=Ne.pop(),N(),A()}if(de=!1,P("*")?(ie=1,de=!0):P("/")?(ie=-1,de=!0):ie=1,xr.unit.base){var ae=xr.unit.base.key;ee.auto[ae]={unit:xr.unit,prefix:xr.prefix}}}if(A(),g)throw new SyntaxError('Could not parse: "'+q+'"');if(de)throw new SyntaxError('Trailing characters: "'+q+'"');if(Ne.length!==0)throw new SyntaxError('Unmatched "(" in "'+S+'"');if(te.units.length===0&&!G.allowNoUnits)throw new SyntaxError('"'+q+'" contains no units');return te.value=De!==void 0?te._normalize(De):null,te},h.prototype.clone=function(){var q=new h;q.fixPrefix=this.fixPrefix,q.skipAutomaticSimplification=this.skipAutomaticSimplification,q.value=Pe(this.value),q.dimensions=this.dimensions.slice(0),q.units=[];for(var G=0;G<this.units.length;G++){q.units[G]={};for(var te in this.units[G])Me(this.units[G],te)&&(q.units[G][te]=this.units[G][te])}return q},h.prototype.valueType=function(){return ar(this.value)},h.prototype._isDerived=function(){return this.units.length===0?!1:this.units.length>1||Math.abs(this.units[0].power-1)>1e-15},h.prototype._normalize=function(q){if(q==null||this.units.length===0)return q;for(var G=q,te=h._getNumberConverter(ar(q)),ie=0;ie<this.units.length;ie++){var de=te(this.units[ie].unit.value),he=te(this.units[ie].prefix.value),De=te(this.units[ie].power);G=n(G,u(n(de,he),De))}return G},h.prototype._denormalize=function(q,G){if(q==null||this.units.length===0)return q;for(var te=q,ie=h._getNumberConverter(ar(q)),de=0;de<this.units.length;de++){var he=ie(this.units[de].unit.value),De=ie(this.units[de].prefix.value),Ne=ie(this.units[de].power);te=i(te,u(n(he,De),Ne))}return te};var k=bn(q=>{if(Me(z,q)){var G=z[q],te=G.prefixes[""];return{unit:G,prefix:te}}for(var ie in z)if(Me(z,ie)&&C1(q,ie)){var de=z[ie],he=q.length-ie.length,De=q.substring(0,he),Ne=Me(de.prefixes,De)?de.prefixes[De]:void 0;if(Ne!==void 0)return{unit:de,prefix:Ne}}return null},{hasher:q=>q[0],limit:100});h.isValuelessUnit=function(q){return k(q)!==null},h.prototype.hasBase=function(q){if(typeof q=="string"&&(q=B[q]),!q)return!1;for(var G=0;G<I.length;G++)if(Math.abs((this.dimensions[G]||0)-(q.dimensions[G]||0))>1e-12)return!1;return!0},h.prototype.equalBase=function(q){for(var G=0;G<I.length;G++)if(Math.abs((this.dimensions[G]||0)-(q.dimensions[G]||0))>1e-12)return!1;return!0},h.prototype.equals=function(q){return this.equalBase(q)&&d(this.value,q.value)},h.prototype.multiply=function(q){for(var G=this.clone(),te=xt(q)?q:new h(q),ie=0;ie<I.length;ie++)G.dimensions[ie]=(this.dimensions[ie]||0)+(te.dimensions[ie]||0);for(var de=0;de<te.units.length;de++){var he=Ix({},te.units[de]);G.units.push(he)}if(this.value!==null||te.value!==null){var De=this.value===null?this._normalize(1):this.value,Ne=te.value===null?te._normalize(1):te.value;G.value=n(De,Ne)}else G.value=null;return xt(q)&&(G.skipAutomaticSimplification=!1),R(G)},h.prototype.divideInto=function(q){return new h(q).divide(this)},h.prototype.divide=function(q){for(var G=this.clone(),te=xt(q)?q:new h(q),ie=0;ie<I.length;ie++)G.dimensions[ie]=(this.dimensions[ie]||0)-(te.dimensions[ie]||0);for(var de=0;de<te.units.length;de++){var he=Ix(Ix({},te.units[de]),{},{power:-te.units[de].power});G.units.push(he)}if(this.value!==null||te.value!==null){var De=this.value===null?this._normalize(1):this.value,Ne=te.value===null?te._normalize(1):te.value;G.value=i(De,Ne)}else G.value=null;return xt(q)&&(G.skipAutomaticSimplification=!1),R(G)},h.prototype.pow=function(q){for(var G=this.clone(),te=0;te<I.length;te++)G.dimensions[te]=(this.dimensions[te]||0)*q;for(var ie=0;ie<G.units.length;ie++)G.units[ie].power*=q;return G.value!==null?G.value=u(G.value,q):G.value=null,G.skipAutomaticSimplification=!1,R(G)};function R(q){return q.equalBase(B.NONE)&&q.value!==null&&!t.predictable?q.value:q}h.prototype.abs=function(){var q=this.clone();if(q.value!==null)if(q._isDerived()||q.units.length===0||q.units[0].unit.offset===0)q.value=l(q.value);else{var G=q._numberConverter(),te=G(q.units[0].unit.value),ie=G(q.units[0].unit.offset),de=n(te,ie);q.value=a(l(o(q.value,de)),de)}for(var he in q.units)(q.units[he].unit.name==="VA"||q.units[he].unit.name==="VAR")&&(q.units[he].unit=z.W);return q},h.prototype.to=function(q){var G=this.value===null?this._normalize(1):this.value,te;if(typeof q=="string")te=h.parse(q);else if(xt(q))te=q.clone();else throw new Error("String or Unit expected as parameter");if(!this.equalBase(te))throw new Error("Units do not match ('".concat(te.toString(),"' != '").concat(this.toString(),"')"));if(te.value!==null)throw new Error("Cannot convert to a unit with a value");if(this.value===null||this._isDerived()||this.units.length===0||te.units.length===0||this.units[0].unit.offset===te.units[0].unit.offset)te.value=Pe(G);else{var ie=h._getNumberConverter(ar(G)),de=this.units[0].unit.value,he=this.units[0].unit.offset,De=n(de,he),Ne=te.units[0].unit.value,Xe=te.units[0].unit.offset,qe=n(Ne,Xe);te.value=o(G,ie(a(De,qe)))}return te.fixPrefix=!0,te.skipAutomaticSimplification=!0,te},h.prototype.toNumber=function(q){return b(this.toNumeric(q))},h.prototype.toNumeric=function(q){var G;return q?G=this.to(q):G=this.clone(),G._isDerived()||G.units.length===0?G._denormalize(G.value):G._denormalize(G.value,G.units[0].prefix.value)},h.prototype.toString=function(){return this.format()},h.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.units.length>0?this.formatUnits():null,fixPrefix:this.fixPrefix}},h.fromJSON=function(q){var G,te=new h(q.value,(G=q.unit)!==null&&G!==void 0?G:void 0);return te.fixPrefix=q.fixPrefix||!1,te},h.prototype.valueOf=h.prototype.toString,h.prototype.simplify=function(){var q=this.clone(),G=[],te;for(var ie in ne)if(Me(ne,ie)&&q.hasBase(B[ie])){te=ie;break}if(te==="NONE")q.units=[];else{var de;if(te&&Me(ne,te)&&(de=ne[te]),de)q.units=[{unit:de.unit,prefix:de.prefix,power:1}];else{for(var he=!1,De=0;De<I.length;De++){var Ne=I[De];Math.abs(q.dimensions[De]||0)>1e-12&&(Me(ne,Ne)?G.push({unit:ne[Ne].unit,prefix:ne[Ne].prefix,power:q.dimensions[De]||0}):he=!0)}G.length<q.units.length&&!he&&(q.units=G)}}return q},h.prototype.toSI=function(){for(var q=this.clone(),G=[],te=0;te<I.length;te++){var ie=I[te];if(Math.abs(q.dimensions[te]||0)>1e-12)if(Me(ee.si,ie))G.push({unit:ee.si[ie].unit,prefix:ee.si[ie].prefix,power:q.dimensions[te]||0});else throw new Error("Cannot express custom unit "+ie+" in SI units")}return q.units=G,q.fixPrefix=!0,q.skipAutomaticSimplification=!0,this.value!==null?(q.value=null,this.to(q)):q},h.prototype.formatUnits=function(){for(var q="",G="",te=0,ie=0,de=0;de<this.units.length;de++)this.units[de].power>0?(te++,q+=" "+this.units[de].prefix.name+this.units[de].unit.name,Math.abs(this.units[de].power-1)>1e-15&&(q+="^"+this.units[de].power)):this.units[de].power<0&&ie++;if(ie>0)for(var he=0;he<this.units.length;he++)this.units[he].power<0&&(te>0?(G+=" "+this.units[he].prefix.name+this.units[he].unit.name,Math.abs(this.units[he].power+1)>1e-15&&(G+="^"+-this.units[he].power)):(G+=" "+this.units[he].prefix.name+this.units[he].unit.name,G+="^"+this.units[he].power));q=q.substr(1),G=G.substr(1),te>1&&ie>0&&(q="("+q+")"),ie>1&&te>0&&(G="("+G+")");var De=q;return te>0&&ie>0&&(De+=" / "),De+=G,De},h.prototype.format=function(q){var G=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),te=!1;typeof G.value<"u"&&G.value!==null&&It(G.value)&&(te=Math.abs(G.value.re)<1e-14);for(var ie in G.units)Me(G.units,ie)&&G.units[ie].unit&&(G.units[ie].unit.name==="VA"&&te?G.units[ie].unit=z.VAR:G.units[ie].unit.name==="VAR"&&!te&&(G.units[ie].unit=z.VA));G.units.length===1&&!G.fixPrefix&&Math.abs(G.units[0].power-Math.round(G.units[0].power))<1e-14&&(G.units[0].prefix=G._bestPrefix());var de=G._denormalize(G.value),he=G.value!==null?p(de,q||{}):"",De=G.formatUnits();return G.value&&It(G.value)&&(he="("+he+")"),De.length>0&&he.length>0&&(he+=" "),he+=De,he},h.prototype._bestPrefix=function(){if(this.units.length!==1)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 q=this.value!==null?l(this.value):0,G=l(this.units[0].unit.value),te=this.units[0].prefix;if(q===0)return te;var ie=this.units[0].power,de=Math.log(q/Math.pow(te.value*G,ie))/Math.LN10-1.2;if(de>-2.200001&&de<1.800001)return te;de=Math.abs(de);var he=this.units[0].unit.prefixes;for(var De in he)if(Me(he,De)){var Ne=he[De];if(Ne.scientific){var Xe=Math.abs(Math.log(q/Math.pow(Ne.value*G,ie))/Math.LN10-1.2);(Xe<de||Xe===de&&Ne.name.length<te.name.length)&&(te=Ne,de=Xe)}}return te},h.prototype.splitUnit=function(q){for(var G=this.clone(),te=[],ie=0;ie<q.length&&(G=G.to(q[ie]),ie!==q.length-1);ie++){var de=G.toNumeric(),he=s(de),De=void 0,Ne=d(he,de);Ne?De=he:De=f(G.toNumeric());var Xe=new h(De,q[ie].toString());te.push(Xe),G=a(G,Xe)}for(var qe=0,yr=0;yr<te.length;yr++)qe=o(qe,te[yr].value);return d(qe,this.value)&&(G.value=0),te.push(G),te};var F={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!1},h:{name:"h",value:100,scientific:!1},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0},R:{name:"R",value:1e27,scientific:!0},Q:{name:"Q",value:1e30,scientific:!0},d:{name:"d",value:.1,scientific:!1},c:{name:"c",value:.01,scientific:!1},m:{name:"m",value:.001,scientific:!0},u:{name:"u",value:1e-6,scientific:!0},n:{name:"n",value:1e-9,scientific:!0},p:{name:"p",value:1e-12,scientific:!0},f:{name:"f",value:1e-15,scientific:!0},a:{name:"a",value:1e-18,scientific:!0},z:{name:"z",value:1e-21,scientific:!0},y:{name:"y",value:1e-24,scientific:!0},r:{name:"r",value:1e-27,scientific:!0},q:{name:"q",value:1e-30,scientific:!0}},LONG:{"":{name:"",value:1,scientific:!0},deca:{name:"deca",value:10,scientific:!1},hecto:{name:"hecto",value:100,scientific:!1},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0},ronna:{name:"ronna",value:1e27,scientific:!0},quetta:{name:"quetta",value:1e30,scientific:!0},deci:{name:"deci",value:.1,scientific:!1},centi:{name:"centi",value:.01,scientific:!1},milli:{name:"milli",value:.001,scientific:!0},micro:{name:"micro",value:1e-6,scientific:!0},nano:{name:"nano",value:1e-9,scientific:!0},pico:{name:"pico",value:1e-12,scientific:!0},femto:{name:"femto",value:1e-15,scientific:!0},atto:{name:"atto",value:1e-18,scientific:!0},zepto:{name:"zepto",value:1e-21,scientific:!0},yocto:{name:"yocto",value:1e-24,scientific:!0},ronto:{name:"ronto",value:1e-27,scientific:!0},quecto:{name:"quecto",value:1e-30,scientific:!0}},SQUARED:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:100,scientific:!1},h:{name:"h",value:1e4,scientific:!1},k:{name:"k",value:1e6,scientific:!0},M:{name:"M",value:1e12,scientific:!0},G:{name:"G",value:1e18,scientific:!0},T:{name:"T",value:1e24,scientific:!0},P:{name:"P",value:1e30,scientific:!0},E:{name:"E",value:1e36,scientific:!0},Z:{name:"Z",value:1e42,scientific:!0},Y:{name:"Y",value:1e48,scientific:!0},R:{name:"R",value:1e54,scientific:!0},Q:{name:"Q",value:1e60,scientific:!0},d:{name:"d",value:.01,scientific:!1},c:{name:"c",value:1e-4,scientific:!1},m:{name:"m",value:1e-6,scientific:!0},u:{name:"u",value:1e-12,scientific:!0},n:{name:"n",value:1e-18,scientific:!0},p:{name:"p",value:1e-24,scientific:!0},f:{name:"f",value:1e-30,scientific:!0},a:{name:"a",value:1e-36,scientific:!0},z:{name:"z",value:1e-42,scientific:!0},y:{name:"y",value:1e-48,scientific:!0},r:{name:"r",value:1e-54,scientific:!0},q:{name:"q",value:1e-60,scientific:!0}},CUBIC:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:1e3,scientific:!1},h:{name:"h",value:1e6,scientific:!1},k:{name:"k",value:1e9,scientific:!0},M:{name:"M",value:1e18,scientific:!0},G:{name:"G",value:1e27,scientific:!0},T:{name:"T",value:1e36,scientific:!0},P:{name:"P",value:1e45,scientific:!0},E:{name:"E",value:1e54,scientific:!0},Z:{name:"Z",value:1e63,scientific:!0},Y:{name:"Y",value:1e72,scientific:!0},R:{name:"R",value:1e81,scientific:!0},Q:{name:"Q",value:1e90,scientific:!0},d:{name:"d",value:.001,scientific:!1},c:{name:"c",value:1e-6,scientific:!1},m:{name:"m",value:1e-9,scientific:!0},u:{name:"u",value:1e-18,scientific:!0},n:{name:"n",value:1e-27,scientific:!0},p:{name:"p",value:1e-36,scientific:!0},f:{name:"f",value:1e-45,scientific:!0},a:{name:"a",value:1e-54,scientific:!0},z:{name:"z",value:1e-63,scientific:!0},y:{name:"y",value:1e-72,scientific:!0},r:{name:"r",value:1e-81,scientific:!0},q:{name:"q",value:1e-90,scientific:!0}},BINARY_SHORT_SI:{"":{name:"",value:1,scientific:!0},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:"",value:1,scientific:!0},Ki:{name:"Ki",value:1024,scientific:!0},Mi:{name:"Mi",value:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),scientific:!0}},BINARY_LONG_SI:{"":{name:"",value:1,scientific:!0},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:"",value:1,scientific:!0},kibi:{name:"kibi",value:1024,scientific:!0},mebi:{name:"mebi",value:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};F.SHORTLONG=Pr({},F.SHORT,F.LONG),F.BINARY_SHORT=Pr({},F.BINARY_SHORT_SI,F.BINARY_SHORT_IEC),F.BINARY_LONG=Pr({},F.BINARY_LONG_SI,F.BINARY_LONG_IEC);var I=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],B={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(var V in B)Me(B,V)&&(B[V].key=V);var J={},K={name:"",base:J,value:1,offset:0,dimensions:I.map(q=>0)},z={meter:{name:"meter",base:B.LENGTH,prefixes:F.LONG,value:1,offset:0},inch:{name:"inch",base:B.LENGTH,prefixes:F.NONE,value:.0254,offset:0},foot:{name:"foot",base:B.LENGTH,prefixes:F.NONE,value:.3048,offset:0},yard:{name:"yard",base:B.LENGTH,prefixes:F.NONE,value:.9144,offset:0},mile:{name:"mile",base:B.LENGTH,prefixes:F.NONE,value:1609.344,offset:0},link:{name:"link",base:B.LENGTH,prefixes:F.NONE,value:.201168,offset:0},rod:{name:"rod",base:B.LENGTH,prefixes:F.NONE,value:5.0292,offset:0},chain:{name:"chain",base:B.LENGTH,prefixes:F.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:B.LENGTH,prefixes:F.NONE,value:1e-10,offset:0},m:{name:"m",base:B.LENGTH,prefixes:F.SHORT,value:1,offset:0},in:{name:"in",base:B.LENGTH,prefixes:F.NONE,value:.0254,offset:0},ft:{name:"ft",base:B.LENGTH,prefixes:F.NONE,value:.3048,offset:0},yd:{name:"yd",base:B.LENGTH,prefixes:F.NONE,value:.9144,offset:0},mi:{name:"mi",base:B.LENGTH,prefixes:F.NONE,value:1609.344,offset:0},li:{name:"li",base:B.LENGTH,prefixes:F.NONE,value:.201168,offset:0},rd:{name:"rd",base:B.LENGTH,prefixes:F.NONE,value:5.02921,offset:0},ch:{name:"ch",base:B.LENGTH,prefixes:F.NONE,value:20.1168,offset:0},mil:{name:"mil",base:B.LENGTH,prefixes:F.NONE,value:254e-7,offset:0},m2:{name:"m2",base:B.SURFACE,prefixes:F.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:B.SURFACE,prefixes:F.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:B.SURFACE,prefixes:F.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:B.SURFACE,prefixes:F.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:B.SURFACE,prefixes:F.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:B.SURFACE,prefixes:F.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:B.SURFACE,prefixes:F.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:B.SURFACE,prefixes:F.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:B.SURFACE,prefixes:F.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:B.SURFACE,prefixes:F.NONE,value:1e4,offset:0},m3:{name:"m3",base:B.VOLUME,prefixes:F.CUBIC,value:1,offset:0},L:{name:"L",base:B.VOLUME,prefixes:F.SHORT,value:.001,offset:0},l:{name:"l",base:B.VOLUME,prefixes:F.SHORT,value:.001,offset:0},litre:{name:"litre",base:B.VOLUME,prefixes:F.LONG,value:.001,offset:0},cuin:{name:"cuin",base:B.VOLUME,prefixes:F.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:B.VOLUME,prefixes:F.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:B.VOLUME,prefixes:F.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:B.VOLUME,prefixes:F.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:B.VOLUME,prefixes:F.NONE,value:15e-6,offset:0},drop:{name:"drop",base:B.VOLUME,prefixes:F.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:B.VOLUME,prefixes:F.NONE,value:5e-8,offset:0},minim:{name:"minim",base:B.VOLUME,prefixes:F.NONE,value:61611519921875e-21,offset:0},fluiddram:{name:"fluiddram",base:B.VOLUME,prefixes:F.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:B.VOLUME,prefixes:F.NONE,value:295735295625e-16,offset:0},gill:{name:"gill",base:B.VOLUME,prefixes:F.NONE,value:.00011829411825,offset:0},cc:{name:"cc",base:B.VOLUME,prefixes:F.NONE,value:1e-6,offset:0},cup:{name:"cup",base:B.VOLUME,prefixes:F.NONE,value:.0002365882365,offset:0},pint:{name:"pint",base:B.VOLUME,prefixes:F.NONE,value:.000473176473,offset:0},quart:{name:"quart",base:B.VOLUME,prefixes:F.NONE,value:.000946352946,offset:0},gallon:{name:"gallon",base:B.VOLUME,prefixes:F.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:B.VOLUME,prefixes:F.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:B.VOLUME,prefixes:F.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:B.VOLUME,prefixes:F.NONE,value:.238480942392,offset:0},g:{name:"g",base:B.MASS,prefixes:F.SHORT,value:.001,offset:0},gram:{name:"gram",base:B.MASS,prefixes:F.LONG,value:.001,offset:0},ton:{name:"ton",base:B.MASS,prefixes:F.SHORT,value:907.18474,offset:0},t:{name:"t",base:B.MASS,prefixes:F.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:B.MASS,prefixes:F.LONG,value:1e3,offset:0},grain:{name:"grain",base:B.MASS,prefixes:F.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:B.MASS,prefixes:F.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:B.MASS,prefixes:F.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:B.MASS,prefixes:F.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:B.MASS,prefixes:F.NONE,value:45.359237,offset:0},stick:{name:"stick",base:B.MASS,prefixes:F.NONE,value:.115,offset:0},stone:{name:"stone",base:B.MASS,prefixes:F.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:B.MASS,prefixes:F.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:B.MASS,prefixes:F.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:B.MASS,prefixes:F.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:B.MASS,prefixes:F.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:B.MASS,prefixes:F.NONE,value:45.359237,offset:0},s:{name:"s",base:B.TIME,prefixes:F.SHORT,value:1,offset:0},min:{name:"min",base:B.TIME,prefixes:F.NONE,value:60,offset:0},h:{name:"h",base:B.TIME,prefixes:F.NONE,value:3600,offset:0},second:{name:"second",base:B.TIME,prefixes:F.LONG,value:1,offset:0},sec:{name:"sec",base:B.TIME,prefixes:F.LONG,value:1,offset:0},minute:{name:"minute",base:B.TIME,prefixes:F.NONE,value:60,offset:0},hour:{name:"hour",base:B.TIME,prefixes:F.NONE,value:3600,offset:0},day:{name:"day",base:B.TIME,prefixes:F.NONE,value:86400,offset:0},week:{name:"week",base:B.TIME,prefixes:F.NONE,value:7*86400,offset:0},month:{name:"month",base:B.TIME,prefixes:F.NONE,value:2629800,offset:0},year:{name:"year",base:B.TIME,prefixes:F.NONE,value:31557600,offset:0},decade:{name:"decade",base:B.TIME,prefixes:F.NONE,value:315576e3,offset:0},century:{name:"century",base:B.TIME,prefixes:F.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:B.TIME,prefixes:F.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:B.FREQUENCY,prefixes:F.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:B.FREQUENCY,prefixes:F.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:B.ANGLE,prefixes:F.SHORT,value:1,offset:0},radian:{name:"radian",base:B.ANGLE,prefixes:F.LONG,value:1,offset:0},deg:{name:"deg",base:B.ANGLE,prefixes:F.SHORT,value:null,offset:0},degree:{name:"degree",base:B.ANGLE,prefixes:F.LONG,value:null,offset:0},grad:{name:"grad",base:B.ANGLE,prefixes:F.SHORT,value:null,offset:0},gradian:{name:"gradian",base:B.ANGLE,prefixes:F.LONG,value:null,offset:0},cycle:{name:"cycle",base:B.ANGLE,prefixes:F.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:B.ANGLE,prefixes:F.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:B.ANGLE,prefixes:F.NONE,value:null,offset:0},A:{name:"A",base:B.CURRENT,prefixes:F.SHORT,value:1,offset:0},ampere:{name:"ampere",base:B.CURRENT,prefixes:F.LONG,value:1,offset:0},K:{name:"K",base:B.TEMPERATURE,prefixes:F.SHORT,value:1,offset:0},degC:{name:"degC",base:B.TEMPERATURE,prefixes:F.SHORT,value:1,offset:273.15},degF:{name:"degF",base:B.TEMPERATURE,prefixes:F.SHORT,value:new y(5,9),offset:459.67},degR:{name:"degR",base:B.TEMPERATURE,prefixes:F.SHORT,value:new y(5,9),offset:0},kelvin:{name:"kelvin",base:B.TEMPERATURE,prefixes:F.LONG,value:1,offset:0},celsius:{name:"celsius",base:B.TEMPERATURE,prefixes:F.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:B.TEMPERATURE,prefixes:F.LONG,value:new y(5,9),offset:459.67},rankine:{name:"rankine",base:B.TEMPERATURE,prefixes:F.LONG,value:new y(5,9),offset:0},mol:{name:"mol",base:B.AMOUNT_OF_SUBSTANCE,prefixes:F.SHORT,value:1,offset:0},mole:{name:"mole",base:B.AMOUNT_OF_SUBSTANCE,prefixes:F.LONG,value:1,offset:0},cd:{name:"cd",base:B.LUMINOUS_INTENSITY,prefixes:F.SHORT,value:1,offset:0},candela:{name:"candela",base:B.LUMINOUS_INTENSITY,prefixes:F.LONG,value:1,offset:0},N:{name:"N",base:B.FORCE,prefixes:F.SHORT,value:1,offset:0},newton:{name:"newton",base:B.FORCE,prefixes:F.LONG,value:1,offset:0},dyn:{name:"dyn",base:B.FORCE,prefixes:F.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:B.FORCE,prefixes:F.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:B.FORCE,prefixes:F.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:B.FORCE,prefixes:F.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:B.FORCE,prefixes:F.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:B.FORCE,prefixes:F.NONE,value:9.80665,offset:0},J:{name:"J",base:B.ENERGY,prefixes:F.SHORT,value:1,offset:0},joule:{name:"joule",base:B.ENERGY,prefixes:F.LONG,value:1,offset:0},erg:{name:"erg",base:B.ENERGY,prefixes:F.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:B.ENERGY,prefixes:F.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:B.ENERGY,prefixes:F.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:B.ENERGY,prefixes:F.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:B.ENERGY,prefixes:F.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:B.POWER,prefixes:F.SHORT,value:1,offset:0},watt:{name:"watt",base:B.POWER,prefixes:F.LONG,value:1,offset:0},hp:{name:"hp",base:B.POWER,prefixes:F.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:B.POWER,prefixes:F.SHORT,value:c.I,offset:0},VA:{name:"VA",base:B.POWER,prefixes:F.SHORT,value:1,offset:0},Pa:{name:"Pa",base:B.PRESSURE,prefixes:F.SHORT,value:1,offset:0},psi:{name:"psi",base:B.PRESSURE,prefixes:F.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:B.PRESSURE,prefixes:F.NONE,value:101325,offset:0},bar:{name:"bar",base:B.PRESSURE,prefixes:F.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:B.PRESSURE,prefixes:F.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:B.PRESSURE,prefixes:F.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:B.PRESSURE,prefixes:F.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:B.PRESSURE,prefixes:F.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:B.ELECTRIC_CHARGE,prefixes:F.LONG,value:1,offset:0},C:{name:"C",base:B.ELECTRIC_CHARGE,prefixes:F.SHORT,value:1,offset:0},farad:{name:"farad",base:B.ELECTRIC_CAPACITANCE,prefixes:F.LONG,value:1,offset:0},F:{name:"F",base:B.ELECTRIC_CAPACITANCE,prefixes:F.SHORT,value:1,offset:0},volt:{name:"volt",base:B.ELECTRIC_POTENTIAL,prefixes:F.LONG,value:1,offset:0},V:{name:"V",base:B.ELECTRIC_POTENTIAL,prefixes:F.SHORT,value:1,offset:0},ohm:{name:"ohm",base:B.ELECTRIC_RESISTANCE,prefixes:F.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:B.ELECTRIC_INDUCTANCE,prefixes:F.LONG,value:1,offset:0},H:{name:"H",base:B.ELECTRIC_INDUCTANCE,prefixes:F.SHORT,value:1,offset:0},siemens:{name:"siemens",base:B.ELECTRIC_CONDUCTANCE,prefixes:F.LONG,value:1,offset:0},S:{name:"S",base:B.ELECTRIC_CONDUCTANCE,prefixes:F.SHORT,value:1,offset:0},weber:{name:"weber",base:B.MAGNETIC_FLUX,prefixes:F.LONG,value:1,offset:0},Wb:{name:"Wb",base:B.MAGNETIC_FLUX,prefixes:F.SHORT,value:1,offset:0},tesla:{name:"tesla",base:B.MAGNETIC_FLUX_DENSITY,prefixes:F.LONG,value:1,offset:0},T:{name:"T",base:B.MAGNETIC_FLUX_DENSITY,prefixes:F.SHORT,value:1,offset:0},b:{name:"b",base:B.BIT,prefixes:F.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:B.BIT,prefixes:F.BINARY_LONG,value:1,offset:0},B:{name:"B",base:B.BIT,prefixes:F.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:B.BIT,prefixes:F.BINARY_LONG,value:8,offset:0}},j={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fldr:"fluiddram",fluiddrams:"fluiddram",floz:"fluidounce",fluidounces:"fluidounce",gi:"gill",gills:"gill",cp:"cup",cups:"cup",pt:"pint",pints:"pint",qt:"quart",quarts:"quart",gal:"gallon",gallons:"gallon",bbl:"beerbarrel",beerbarrels:"beerbarrel",obl:"oilbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function ue(q){if(q.number==="BigNumber"){var G=Pf(v);z.rad.value=new v(1),z.deg.value=G.div(180),z.grad.value=G.div(200),z.cycle.value=G.times(2),z.arcsec.value=G.div(648e3),z.arcmin.value=G.div(10800)}else z.rad.value=1,z.deg.value=Math.PI/180,z.grad.value=Math.PI/200,z.cycle.value=Math.PI*2,z.arcsec.value=Math.PI/648e3,z.arcmin.value=Math.PI/10800;z.radian.value=z.rad.value,z.degree.value=z.deg.value,z.gradian.value=z.grad.value}ue(t),r&&r("config",function(q,G){q.number!==G.number&&ue(q)});var ee={si:{NONE:{unit:K,prefix:F.NONE[""]},LENGTH:{unit:z.m,prefix:F.SHORT[""]},MASS:{unit:z.g,prefix:F.SHORT.k},TIME:{unit:z.s,prefix:F.SHORT[""]},CURRENT:{unit:z.A,prefix:F.SHORT[""]},TEMPERATURE:{unit:z.K,prefix:F.SHORT[""]},LUMINOUS_INTENSITY:{unit:z.cd,prefix:F.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:z.mol,prefix:F.SHORT[""]},ANGLE:{unit:z.rad,prefix:F.SHORT[""]},BIT:{unit:z.bits,prefix:F.SHORT[""]},FORCE:{unit:z.N,prefix:F.SHORT[""]},ENERGY:{unit:z.J,prefix:F.SHORT[""]},POWER:{unit:z.W,prefix:F.SHORT[""]},PRESSURE:{unit:z.Pa,prefix:F.SHORT[""]},ELECTRIC_CHARGE:{unit:z.C,prefix:F.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:z.F,prefix:F.SHORT[""]},ELECTRIC_POTENTIAL:{unit:z.V,prefix:F.SHORT[""]},ELECTRIC_RESISTANCE:{unit:z.ohm,prefix:F.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:z.H,prefix:F.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:z.S,prefix:F.SHORT[""]},MAGNETIC_FLUX:{unit:z.Wb,prefix:F.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:z.T,prefix:F.SHORT[""]},FREQUENCY:{unit:z.Hz,prefix:F.SHORT[""]}}};ee.cgs=JSON.parse(JSON.stringify(ee.si)),ee.cgs.LENGTH={unit:z.m,prefix:F.SHORT.c},ee.cgs.MASS={unit:z.g,prefix:F.SHORT[""]},ee.cgs.FORCE={unit:z.dyn,prefix:F.SHORT[""]},ee.cgs.ENERGY={unit:z.erg,prefix:F.NONE[""]},ee.us=JSON.parse(JSON.stringify(ee.si)),ee.us.LENGTH={unit:z.ft,prefix:F.NONE[""]},ee.us.MASS={unit:z.lbm,prefix:F.NONE[""]},ee.us.TEMPERATURE={unit:z.degF,prefix:F.NONE[""]},ee.us.FORCE={unit:z.lbf,prefix:F.NONE[""]},ee.us.ENERGY={unit:z.BTU,prefix:F.BTU[""]},ee.us.POWER={unit:z.hp,prefix:F.NONE[""]},ee.us.PRESSURE={unit:z.psi,prefix:F.NONE[""]},ee.auto=JSON.parse(JSON.stringify(ee.si));var ne=ee.auto;h.setUnitSystem=function(q){if(Me(ee,q))ne=ee[q];else throw new Error("Unit system "+q+" does not exist. Choices are: "+Object.keys(ee).join(", "))},h.getUnitSystem=function(){for(var q in ee)if(Me(ee,q)&&ee[q]===ne)return q},h.typeConverters={BigNumber:function(G){return G!=null&&G.isFraction?new v(String(G.n)).div(String(G.d)).times(String(G.s)):new v(G+"")},Fraction:function(G){return new y(G)},Complex:function(G){return G},number:function(G){return G!=null&&G.isFraction?x(G):G}},h.prototype._numberConverter=function(){var q=h.typeConverters[this.valueType()];if(q)return q;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},h._getNumberConverter=function(q){if(!h.typeConverters[q])throw new TypeError('Unsupported type "'+q+'"');return h.typeConverters[q]};for(var $ in z)if(Me(z,$)){var W=z[$];W.dimensions=W.base.dimensions}for(var Y in j)if(Me(j,Y)){var oe=z[j[Y]],re={};for(var le in oe)Me(oe,le)&&(re[le]=oe[le]);re.name=Y,z[Y]=re}h.isValidAlpha=function(G){return/^[a-zA-Z]$/.test(G)};function se(q){for(var G=0;G<q.length;G++){if(g=q.charAt(G),G===0&&!h.isValidAlpha(g))throw new Error('Invalid unit name (must begin with alpha character): "'+q+'"');if(G>0&&!(h.isValidAlpha(g)||D(g)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+q+'"')}}return h.createUnit=function(q,G){if(typeof q!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(G&&G.override){for(var te in q)if(Me(q,te)&&h.deleteUnit(te),q[te].aliases)for(var ie=0;ie<q[te].aliases.length;ie++)h.deleteUnit(q[te].aliases[ie])}var de;for(var he in q)Me(q,he)&&(de=h.createUnitSingle(he,q[he]));return de},h.createUnitSingle=function(q,G){if((typeof G>"u"||G===null)&&(G={}),typeof q!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(Me(z,q))throw new Error('Cannot create unit "'+q+'": a unit with that name already exists');se(q);var te=null,ie=[],de=0,he,De,Ne;if(G&&G.type==="Unit")te=G.clone();else if(typeof G=="string")G!==""&&(he=G);else if(typeof G=="object")he=G.definition,De=G.prefixes,de=G.offset,Ne=G.baseName,G.aliases&&(ie=G.aliases.valueOf());else throw new TypeError('Cannot create unit "'+q+'" from "'+G.toString()+'": expecting "string" or "Unit" or "Object"');if(ie){for(var Xe=0;Xe<ie.length;Xe++)if(Me(z,ie[Xe]))throw new Error('Cannot create alias "'+ie[Xe]+'": a unit with that name already exists')}if(he&&typeof he=="string"&&!te)try{te=h.parse(he,{allowNoUnits:!0})}catch(H){throw H.message='Could not create unit "'+q+'" from "'+he+'": '+H.message,H}else he&&he.type==="Unit"&&(te=he.clone());ie=ie||[],de=de||0,De&&De.toUpperCase?De=F[De.toUpperCase()]||F.NONE:De=F.NONE;var qe={};if(te){qe={name:q,value:te.value,dimensions:te.dimensions.slice(0),prefixes:De,offset:de};var Yr=!1;for(var Z in B)if(Me(B,Z)){for(var ae=!0,fe=0;fe<I.length;fe++)if(Math.abs((qe.dimensions[fe]||0)-(B[Z].dimensions[fe]||0))>1e-12){ae=!1;break}if(ae){Yr=!0,qe.base=B[Z];break}}if(!Yr){Ne=Ne||q+"_STUFF";var ve={dimensions:te.dimensions.slice(0)};ve.key=Ne,B[Ne]=ve,ne[Ne]={unit:qe,prefix:F.NONE[""]},qe.base=B[Ne]}}else{if(Ne=Ne||q+"_STUFF",I.indexOf(Ne)>=0)throw new Error('Cannot create new base unit "'+q+'": a base unit with that name already exists (and cannot be overridden)');I.push(Ne);for(var yr in B)Me(B,yr)&&(B[yr].dimensions[I.length-1]=0);for(var xr={dimensions:[]},kr=0;kr<I.length;kr++)xr.dimensions[kr]=0;xr.dimensions[I.length-1]=1,xr.key=Ne,B[Ne]=xr,qe={name:q,value:1,dimensions:B[Ne].dimensions.slice(0),prefixes:De,offset:de,base:B[Ne]},ne[Ne]={unit:qe,prefix:F.NONE[""]}}h.UNITS[q]=qe;for(var ge=0;ge<ie.length;ge++){var pe=ie[ge],Re={};for(var M in qe)Me(qe,M)&&(Re[M]=qe[M]);Re.name=pe,h.UNITS[pe]=Re}return delete k.cache,new h(null,q)},h.deleteUnit=function(q){delete h.UNITS[q],delete k.cache},h.PREFIXES=F,h.BASE_DIMENSIONS=I,h.BASE_UNITS=B,h.UNIT_SYSTEMS=ee,h.UNITS=z,h},{isClass:!0})});var kR,VX,qx,LR=T(()=>{U();je();kR="unit",VX=["typed","Unit"],qx=O(kR,VX,e=>{var{typed:r,Unit:t}=e;return r(kR,{Unit:function(a){return a.clone()},string:function(a){return t.isValuelessUnit(a)?new t(null,a):t.parse(a,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(a,n){return new t(a,n)},"number | BigNumber | Fraction":function(a){return new t(a)},"Array | Matrix":r.referToSelf(o=>a=>Oe(a,o))})})});var IR,GX,Ux,zR=T(()=>{U();IR="sparse",GX=["typed","SparseMatrix"],Ux=O(IR,GX,e=>{var{typed:r,SparseMatrix:t}=e;return r(IR,{"":function(){return new t([])},string:function(a){return new t([],a)},"Array | Matrix":function(a){return new t(a)},"Array | Matrix, string":function(a,n){return new t(a,n)}})})});var qR,$X,Hx,UR=T(()=>{U();qR="createUnit",$X=["typed","Unit"],Hx=O(qR,$X,e=>{var{typed:r,Unit:t}=e;return r(qR,{"Object, Object":function(a,n){return t.createUnit(a,n)},Object:function(a){return t.createUnit(a,{})},"string, Unit | string | Object, Object":function(a,n,i){var u={};return u[a]=n,t.createUnit(u,i)},"string, Unit | string | Object":function(a,n){var i={};return i[a]=n,t.createUnit(i,{})},string:function(a){var n={};return n[a]={},t.createUnit(n,{})}})})});var HR,KX,Wx,WR=T(()=>{U();HR="acos",KX=["typed","config","Complex"],Wx=O(HR,KX,e=>{var{typed:r,config:t,Complex:o}=e;return r(HR,{number:function(n){return n>=-1&&n<=1||t.predictable?Math.acos(n):new o(n,0).acos()},Complex:function(n){return n.acos()},BigNumber:function(n){return n.acos()}})})});var VR,QX,Vx,GR=T(()=>{U();$e();VR="acosh",QX=["typed","config","Complex"],Vx=O(VR,QX,e=>{var{typed:r,config:t,Complex:o}=e;return r(VR,{number:function(n){return n>=1||t.predictable?Fp(n):n<=-1?new o(Math.log(Math.sqrt(n*n-1)-n),Math.PI):new o(n,0).acosh()},Complex:function(n){return n.acosh()},BigNumber:function(n){return n.acosh()}})})});var $R,ZX,Gx,KR=T(()=>{U();$e();$R="acot",ZX=["typed","BigNumber"],Gx=O($R,ZX,e=>{var{typed:r,BigNumber:t}=e;return r($R,{number:Bp,Complex:function(a){return a.acot()},BigNumber:function(a){return new t(1).div(a).atan()}})})});var QR,YX,$x,ZR=T(()=>{U();$e();QR="acoth",YX=["typed","config","Complex","BigNumber"],$x=O(QR,YX,e=>{var{typed:r,config:t,Complex:o,BigNumber:a}=e;return r(QR,{number:function(i){return i>=1||i<=-1||t.predictable?_p(i):new o(i,0).acoth()},Complex:function(i){return i.acoth()},BigNumber:function(i){return new a(1).div(i).atanh()}})})});var YR,XX,Kx,XR=T(()=>{U();$e();YR="acsc",XX=["typed","config","Complex","BigNumber"],Kx=O(YR,XX,e=>{var{typed:r,config:t,Complex:o,BigNumber:a}=e;return r(YR,{number:function(i){return i<=-1||i>=1||t.predictable?Pp(i):new o(i,0).acsc()},Complex:function(i){return i.acsc()},BigNumber:function(i){return new a(1).div(i).asin()}})})});var JR,JX,Qx,jR=T(()=>{U();$e();JR="acsch",JX=["typed","BigNumber"],Qx=O(JR,JX,e=>{var{typed:r,BigNumber:t}=e;return r(JR,{number:kp,Complex:function(a){return a.acsch()},BigNumber:function(a){return new t(1).div(a).asinh()}})})});var e2,jX,Zx,r2=T(()=>{U();$e();e2="asec",jX=["typed","config","Complex","BigNumber"],Zx=O(e2,jX,e=>{var{typed:r,config:t,Complex:o,BigNumber:a}=e;return r(e2,{number:function(i){return i<=-1||i>=1||t.predictable?Lp(i):new o(i,0).asec()},Complex:function(i){return i.asec()},BigNumber:function(i){return new a(1).div(i).acos()}})})});var t2,eJ,Yx,o2=T(()=>{U();$e();t2="asech",eJ=["typed","config","Complex","BigNumber"],Yx=O(t2,eJ,e=>{var{typed:r,config:t,Complex:o,BigNumber:a}=e;return r(t2,{number:function(i){if(i<=1&&i>=-1||t.predictable){var u=1/i;if(u>0||t.predictable)return Ip(i);var l=Math.sqrt(u*u-1);return new o(Math.log(l-u),Math.PI)}return new o(i,0).asech()},Complex:function(i){return i.asech()},BigNumber:function(i){return new a(1).div(i).acosh()}})})});var a2,rJ,Xx,n2=T(()=>{U();a2="asin",rJ=["typed","config","Complex"],Xx=O(a2,rJ,e=>{var{typed:r,config:t,Complex:o}=e;return r(a2,{number:function(n){return n>=-1&&n<=1||t.predictable?Math.asin(n):new o(n,0).asin()},Complex:function(n){return n.asin()},BigNumber:function(n){return n.asin()}})})});var tJ,oJ,Jx,i2=T(()=>{U();$e();tJ="asinh",oJ=["typed"],Jx=O(tJ,oJ,e=>{var{typed:r}=e;return r("asinh",{number:zp,Complex:function(o){return o.asinh()},BigNumber:function(o){return o.asinh()}})})});var aJ,nJ,jx,f2=T(()=>{U();aJ="atan",nJ=["typed"],jx=O(aJ,nJ,e=>{var{typed:r}=e;return r("atan",{number:function(o){return Math.atan(o)},Complex:function(o){return o.atan()},BigNumber:function(o){return o.atan()}})})});var u2,iJ,eh,s2=T(()=>{U();yo();Rt();Ym();ut();Xr();Nr();u2="atan2",iJ=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],eh=O(u2,iJ,e=>{var{typed:r,matrix:t,equalScalar:o,BigNumber:a,DenseMatrix:n,concat:i}=e,u=Qr({typed:r,equalScalar:o}),l=br({typed:r}),f=ds({typed:r,equalScalar:o}),s=gr({typed:r,equalScalar:o}),d=dr({typed:r,DenseMatrix:n}),m=Ge({typed:r,matrix:t,concat:i});return r(u2,{"number, number":Math.atan2,"BigNumber, BigNumber":(p,x)=>a.atan2(p,x)},m({scalar:"number | BigNumber",SS:f,DS:l,SD:u,Ss:s,sS:d}))})});var l2,fJ,rh,d2=T(()=>{U();$e();l2="atanh",fJ=["typed","config","Complex"],rh=O(l2,fJ,e=>{var{typed:r,config:t,Complex:o}=e;return r(l2,{number:function(n){return n<=1&&n>=-1||t.predictable?qp(n):new o(n,0).atanh()},Complex:function(n){return n.atanh()},BigNumber:function(n){return n.atanh()}})})});var So,Dn=T(()=>{U();So=O("trigUnit",["typed"],e=>{var{typed:r}=e;return{Unit:r.referToSelf(t=>o=>{if(!o.hasBase(o.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return r.find(t,o.valueType())(o.value)})}})});var p2,uJ,th,m2=T(()=>{U();Dn();p2="cos",uJ=["typed"],th=O(p2,uJ,e=>{var{typed:r}=e,t=So({typed:r});return r(p2,{number:Math.cos,"Complex | BigNumber":o=>o.cos()},t)})});var c2,sJ,oh,x2=T(()=>{U();He();c2="cosh",sJ=["typed"],oh=O(c2,sJ,e=>{var{typed:r}=e;return r(c2,{number:Lu,"Complex | BigNumber":t=>t.cosh()})})});var h2,lJ,ah,v2=T(()=>{U();$e();Dn();h2="cot",lJ=["typed","BigNumber"],ah=O(h2,lJ,e=>{var{typed:r,BigNumber:t}=e,o=So({typed:r});return r(h2,{number:Up,Complex:a=>a.cot(),BigNumber:a=>new t(1).div(a.tan())},o)})});var g2,dJ,nh,y2=T(()=>{U();$e();g2="coth",dJ=["typed","BigNumber"],nh=O(g2,dJ,e=>{var{typed:r,BigNumber:t}=e;return r(g2,{number:Hp,Complex:o=>o.coth(),BigNumber:o=>new t(1).div(o.tanh())})})});var S2,pJ,ih,w2=T(()=>{U();$e();Dn();S2="csc",pJ=["typed","BigNumber"],ih=O(S2,pJ,e=>{var{typed:r,BigNumber:t}=e,o=So({typed:r});return r(S2,{number:Wp,Complex:a=>a.csc(),BigNumber:a=>new t(1).div(a.sin())},o)})});var T2,mJ,fh,b2=T(()=>{U();$e();T2="csch",mJ=["typed","BigNumber"],fh=O(T2,mJ,e=>{var{typed:r,BigNumber:t}=e;return r(T2,{number:Vp,Complex:o=>o.csch(),BigNumber:o=>new t(1).div(o.sinh())})})});var D2,cJ,uh,A2=T(()=>{U();$e();Dn();D2="sec",cJ=["typed","BigNumber"],uh=O(D2,cJ,e=>{var{typed:r,BigNumber:t}=e,o=So({typed:r});return r(D2,{number:Gp,Complex:a=>a.sec(),BigNumber:a=>new t(1).div(a.cos())},o)})});var O2,xJ,sh,C2=T(()=>{U();$e();O2="sech",xJ=["typed","BigNumber"],sh=O(O2,xJ,e=>{var{typed:r,BigNumber:t}=e;return r(O2,{number:$p,Complex:o=>o.sech(),BigNumber:o=>new t(1).div(o.cosh())})})});var R2,hJ,lh,N2=T(()=>{U();Dn();R2="sin",hJ=["typed"],lh=O(R2,hJ,e=>{var{typed:r}=e,t=So({typed:r});return r(R2,{number:Math.sin,"Complex | BigNumber":o=>o.sin()},t)})});var M2,vJ,dh,E2=T(()=>{U();$e();M2="sinh",vJ=["typed"],dh=O(M2,vJ,e=>{var{typed:r}=e;return r(M2,{number:Kp,"Complex | BigNumber":t=>t.sinh()})})});var F2,gJ,ph,B2=T(()=>{U();Dn();F2="tan",gJ=["typed"],ph=O(F2,gJ,e=>{var{typed:r}=e,t=So({typed:r});return r(F2,{number:Math.tan,"Complex | BigNumber":o=>o.tan()},t)})});var yJ,SJ,mh,_2=T(()=>{U();He();yJ="tanh",SJ=["typed"],mh=O(yJ,SJ,e=>{var{typed:r}=e;return r("tanh",{number:Iu,"Complex | BigNumber":t=>t.tanh()})})});var P2,wJ,ch,k2=T(()=>{ze();U();P2="setCartesian",wJ=["typed","size","subset","compareNatural","Index","DenseMatrix"],ch=O(P2,wJ,e=>{var{typed:r,size:t,subset:o,compareNatural:a,Index:n,DenseMatrix:i}=e;return r(P2,{"Array | Matrix, Array | Matrix":function(l,f){var s=[];if(o(t(l),new n(0))!==0&&o(t(f),new n(0))!==0){var d=Qe(Array.isArray(l)?l:l.toArray()).sort(a),m=Qe(Array.isArray(f)?f:f.toArray()).sort(a);s=[];for(var p=0;p<d.length;p++)for(var x=0;x<m.length;x++)s.push([d[p],m[x]])}return Array.isArray(l)&&Array.isArray(f)?s:new i(s)}})})});var L2,TJ,xh,I2=T(()=>{ze();U();L2="setDifference",TJ=["typed","size","subset","compareNatural","Index","DenseMatrix"],xh=O(L2,TJ,e=>{var{typed:r,size:t,subset:o,compareNatural:a,Index:n,DenseMatrix:i}=e;return r(L2,{"Array | Matrix, Array | Matrix":function(l,f){var s;if(o(t(l),new n(0))===0)s=[];else{if(o(t(f),new n(0))===0)return Qe(l.toArray());var d=ia(Qe(Array.isArray(l)?l:l.toArray()).sort(a)),m=ia(Qe(Array.isArray(f)?f:f.toArray()).sort(a));s=[];for(var p,x=0;x<d.length;x++){p=!1;for(var c=0;c<m.length;c++)if(a(d[x].value,m[c].value)===0&&d[x].identifier===m[c].identifier){p=!0;break}p||s.push(d[x])}}return Array.isArray(l)&&Array.isArray(f)?Yn(s):new i(Yn(s))}})})});var z2,bJ,hh,q2=T(()=>{ze();U();z2="setDistinct",bJ=["typed","size","subset","compareNatural","Index","DenseMatrix"],hh=O(z2,bJ,e=>{var{typed:r,size:t,subset:o,compareNatural:a,Index:n,DenseMatrix:i}=e;return r(z2,{"Array | Matrix":function(l){var f;if(o(t(l),new n(0))===0)f=[];else{var s=Qe(Array.isArray(l)?l:l.toArray()).sort(a);f=[],f.push(s[0]);for(var d=1;d<s.length;d++)a(s[d],s[d-1])!==0&&f.push(s[d])}return Array.isArray(l)?f:new i(f)}})})});var U2,DJ,vh,H2=T(()=>{ze();U();U2="setIntersect",DJ=["typed","size","subset","compareNatural","Index","DenseMatrix"],vh=O(U2,DJ,e=>{var{typed:r,size:t,subset:o,compareNatural:a,Index:n,DenseMatrix:i}=e;return r(U2,{"Array | Matrix, Array | Matrix":function(l,f){var s;if(o(t(l),new n(0))===0||o(t(f),new n(0))===0)s=[];else{var d=ia(Qe(Array.isArray(l)?l:l.toArray()).sort(a)),m=ia(Qe(Array.isArray(f)?f:f.toArray()).sort(a));s=[];for(var p=0;p<d.length;p++)for(var x=0;x<m.length;x++)if(a(d[p].value,m[x].value)===0&&d[p].identifier===m[x].identifier){s.push(d[p]);break}}return Array.isArray(l)&&Array.isArray(f)?Yn(s):new i(Yn(s))}})})});var W2,AJ,gh,V2=T(()=>{ze();U();W2="setIsSubset",AJ=["typed","size","subset","compareNatural","Index"],gh=O(W2,AJ,e=>{var{typed:r,size:t,subset:o,compareNatural:a,Index:n}=e;return r(W2,{"Array | Matrix, Array | Matrix":function(u,l){if(o(t(u),new n(0))===0)return!0;if(o(t(l),new n(0))===0)return!1;for(var f=ia(Qe(Array.isArray(u)?u:u.toArray()).sort(a)),s=ia(Qe(Array.isArray(l)?l:l.toArray()).sort(a)),d,m=0;m<f.length;m++){d=!1;for(var p=0;p<s.length;p++)if(a(f[m].value,s[p].value)===0&&f[m].identifier===s[p].identifier){d=!0;break}if(d===!1)return!1}return!0}})})});var G2,OJ,yh,$2=T(()=>{ze();U();G2="setMultiplicity",OJ=["typed","size","subset","compareNatural","Index"],yh=O(G2,OJ,e=>{var{typed:r,size:t,subset:o,compareNatural:a,Index:n}=e;return r(G2,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(u,l){if(o(t(l),new n(0))===0)return 0;for(var f=Qe(Array.isArray(l)?l:l.toArray()),s=0,d=0;d<f.length;d++)a(f[d],u)===0&&s++;return s}})})});var K2,CJ,Sh,Q2=T(()=>{ze();U();K2="setPowerset",CJ=["typed","size","subset","compareNatural","Index"],Sh=O(K2,CJ,e=>{var{typed:r,size:t,subset:o,compareNatural:a,Index:n}=e;return r(K2,{"Array | Matrix":function(f){if(o(t(f),new n(0))===0)return[];for(var s=Qe(Array.isArray(f)?f:f.toArray()).sort(a),d=[],m=0;m.toString(2).length<=s.length;)d.push(i(s,m.toString(2).split("").reverse())),m++;return u(d)}});function i(l,f){for(var s=[],d=0;d<f.length;d++)f[d]==="1"&&s.push(l[d]);return s}function u(l){for(var f=[],s=l.length-1;s>0;s--)for(var d=0;d<s;d++)l[d].length>l[d+1].length&&(f=l[d],l[d]=l[d+1],l[d+1]=f);return l}})});var Z2,RJ,wh,Y2=T(()=>{ze();U();Z2="setSize",RJ=["typed","compareNatural"],wh=O(Z2,RJ,e=>{var{typed:r,compareNatural:t}=e;return r(Z2,{"Array | Matrix":function(a){return Array.isArray(a)?Qe(a).length:Qe(a.toArray()).length},"Array | Matrix, boolean":function(a,n){if(n===!1||a.length===0)return Array.isArray(a)?Qe(a).length:Qe(a.toArray()).length;for(var i=Qe(Array.isArray(a)?a:a.toArray()).sort(t),u=1,l=1;l<i.length;l++)t(i[l],i[l-1])!==0&&u++;return u}})})});var X2,NJ,Th,J2=T(()=>{ze();U();X2="setSymDifference",NJ=["typed","size","concat","subset","setDifference","Index"],Th=O(X2,NJ,e=>{var{typed:r,size:t,concat:o,subset:a,setDifference:n,Index:i}=e;return r(X2,{"Array | Matrix, Array | Matrix":function(l,f){if(a(t(l),new i(0))===0)return Qe(f);if(a(t(f),new i(0))===0)return Qe(l);var s=Qe(l),d=Qe(f);return o(n(s,d),n(d,s))}})})});var j2,MJ,bh,eN=T(()=>{ze();U();j2="setUnion",MJ=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],bh=O(j2,MJ,e=>{var{typed:r,size:t,concat:o,subset:a,setIntersect:n,setSymDifference:i,Index:u}=e;return r(j2,{"Array | Matrix, Array | Matrix":function(f,s){if(a(t(f),new u(0))===0)return Qe(s);if(a(t(s),new u(0))===0)return Qe(f);var d=Qe(f),m=Qe(s);return o(i(d,m),n(d,m))}})})});var rN,EJ,Dh,tN=T(()=>{U();ua();ss();qa();Nr();rN="add",EJ=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],Dh=O(rN,EJ,e=>{var{typed:r,matrix:t,addScalar:o,equalScalar:a,DenseMatrix:n,SparseMatrix:i,concat:u}=e,l=Nt({typed:r}),f=oi({typed:r,equalScalar:a}),s=Xt({typed:r,DenseMatrix:n}),d=Ge({typed:r,matrix:t,concat:u});return r(rN,{"any, any":o,"any, any, ...any":r.referToSelf(m=>(p,x,c)=>{for(var v=m(p,x),y=0;y<c.length;y++)v=m(v,c[y]);return v})},d({elop:o,DS:l,SS:f,Ss:s}))})});var oN,FJ,Ah,aN=T(()=>{U();ze();Se();oN="hypot",FJ=["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],Ah=O(oN,FJ,e=>{var{typed:r,abs:t,addScalar:o,divideScalar:a,multiplyScalar:n,sqrt:i,smaller:u,isPositive:l}=e;return r(oN,{"... number | BigNumber":f,Array:f,Matrix:s=>f(Qe(s.toArray()))});function f(s){for(var d=0,m=0,p=0;p<s.length;p++){if(It(s[p]))throw new TypeError("Unexpected type of argument to hypot");var x=t(s[p]);u(m,x)?(d=n(d,n(a(m,x),a(m,x))),d=o(d,1),m=x):d=o(d,l(x)?n(a(x,m),a(x,m)):x)}return n(m,i(d))}})});var nN,BJ,Oh,iN=T(()=>{U();nN="norm",BJ=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],Oh=O(nN,BJ,e=>{var{typed:r,abs:t,add:o,pow:a,conj:n,sqrt:i,multiply:u,equalScalar:l,larger:f,smaller:s,matrix:d,ctranspose:m,eigs:p}=e;return r(nN,{number:Math.abs,Complex:function(C){return C.abs()},BigNumber:function(C){return C.abs()},boolean:function(C){return Math.abs(C)},Array:function(C){return g(d(C),2)},Matrix:function(C){return g(C,2)},"Array, number | BigNumber | string":function(C,D){return g(d(C),D)},"Matrix, number | BigNumber | string":function(C,D){return g(C,D)}});function x(A){var C=0;return A.forEach(function(D){var N=t(D);f(N,C)&&(C=N)},!0),C}function c(A){var C;return A.forEach(function(D){var N=t(D);(!C||s(N,C))&&(C=N)},!0),C||0}function v(A,C){if(C===Number.POSITIVE_INFINITY||C==="inf")return x(A);if(C===Number.NEGATIVE_INFINITY||C==="-inf")return c(A);if(C==="fro")return g(A,2);if(typeof C=="number"&&!isNaN(C)){if(!l(C,0)){var D=0;return A.forEach(function(N){D=o(a(t(N),C),D)},!0),a(D,1/C)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function y(A){var C=0;return A.forEach(function(D,N){C=o(C,u(D,n(D)))}),t(i(C))}function b(A){var C=[],D=0;return A.forEach(function(N,E){var _=E[1],L=o(C[_]||0,t(N));f(L,D)&&(D=L),C[_]=L},!0),D}function h(A){var C=A.size();if(C[0]!==C[1])throw new RangeError("Invalid matrix dimensions");var D=m(A),N=u(D,A),E=p(N).values.toArray(),_=E[E.length-1];return t(i(_))}function S(A){var C=[],D=0;return A.forEach(function(N,E){var _=E[0],L=o(C[_]||0,t(N));f(L,D)&&(D=L),C[_]=L},!0),D}function w(A,C){if(C===1)return b(A);if(C===Number.POSITIVE_INFINITY||C==="inf")return S(A);if(C==="fro")return y(A);if(C===2)return h(A);throw new Error("Unsupported parameter value "+C)}function g(A,C){var D=A.size();if(D.length===1)return v(A,C);if(D.length===2){if(D[0]&&D[1])return w(A,C);throw new RangeError("Invalid matrix dimensions")}}})});var fN,_J,Ch,uN=T(()=>{U();Se();fN="dot",_J=["typed","addScalar","multiplyScalar","conj","size"],Ch=O(fN,_J,e=>{var{typed:r,addScalar:t,multiplyScalar:o,conj:a,size:n}=e;return r(fN,{"Array | DenseMatrix, Array | DenseMatrix":u,"SparseMatrix, SparseMatrix":l});function i(s,d){var m=f(s),p=f(d),x,c;if(m.length===1)x=m[0];else if(m.length===2&&m[1]===1)x=m[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+m.join(", ")+")");if(p.length===1)c=p[0];else if(p.length===2&&p[1]===1)c=p[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+p.join(", ")+")");if(x!==c)throw new RangeError("Vectors must have equal length ("+x+" != "+c+")");if(x===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return x}function u(s,d){var m=i(s,d),p=Ae(s)?s._data:s,x=Ae(s)?s._datatype||s.getDataType():void 0,c=Ae(d)?d._data:d,v=Ae(d)?d._datatype||d.getDataType():void 0,y=f(s).length===2,b=f(d).length===2,h=t,S=o;if(x&&v&&x===v&&typeof x=="string"&&x!=="mixed"){var w=x;h=r.find(t,[w,w]),S=r.find(o,[w,w])}if(!y&&!b){for(var g=S(a(p[0]),c[0]),A=1;A<m;A++)g=h(g,S(a(p[A]),c[A]));return g}if(!y&&b){for(var C=S(a(p[0]),c[0][0]),D=1;D<m;D++)C=h(C,S(a(p[D]),c[D][0]));return C}if(y&&!b){for(var N=S(a(p[0][0]),c[0]),E=1;E<m;E++)N=h(N,S(a(p[E][0]),c[E]));return N}if(y&&b){for(var _=S(a(p[0][0]),c[0][0]),L=1;L<m;L++)_=h(_,S(a(p[L][0]),c[L][0]));return _}}function l(s,d){i(s,d);for(var m=s._index,p=s._values,x=d._index,c=d._values,v=0,y=t,b=o,h=0,S=0;h<m.length&&S<x.length;){var w=m[h],g=x[S];if(w<g){h++;continue}if(w>g){S++;continue}w===g&&(v=y(v,b(p[h],c[S])),h++,S++)}return v}function f(s){return Ae(s)?s.size():n(s)}})});var PJ,kJ,Rh,sN=T(()=>{lr();Er();U();PJ="trace",kJ=["typed","matrix","add"],Rh=O(PJ,kJ,e=>{var{typed:r,matrix:t,add:o}=e;return r("trace",{Array:function(u){return a(t(u))},SparseMatrix:n,DenseMatrix:a,any:Pe});function a(i){var u=i._size,l=i._data;switch(u.length){case 1:if(u[0]===1)return Pe(l[0]);throw new RangeError("Matrix must be square (size: "+Ie(u)+")");case 2:{var f=u[0],s=u[1];if(f===s){for(var d=0,m=0;m<f;m++)d=o(d,l[m][m]);return d}else throw new RangeError("Matrix must be square (size: "+Ie(u)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ie(u)+")")}}function n(i){var u=i._values,l=i._index,f=i._ptr,s=i._size,d=s[0],m=s[1];if(d===m){var p=0;if(u.length>0)for(var x=0;x<m;x++)for(var c=f[x],v=f[x+1],y=c;y<v;y++){var b=l[y];if(b===x){p=o(p,u[y]);break}if(b>x)break}return p}throw new RangeError("Matrix must be square (size: "+Ie(s)+")")}})});var lN,LJ,Nh,dN=T(()=>{Se();U();lN="index",LJ=["typed","Index"],Nh=O(lN,LJ,e=>{var{typed:r,Index:t}=e;return r(lN,{"...number | string | BigNumber | Range | Array | Matrix":function(a){var n=a.map(function(u){return Fe(u)?u.toNumber():fr(u)||Ae(u)?u.map(function(l){return Fe(l)?l.toNumber():l}):u}),i=new t;return t.apply(i,n),i}})})});var Os,Mh=T(()=>{Os=new Set(["end"])});var IJ,zJ,Eh,pN=T(()=>{Se();Mh();lr();U();ta();IJ="Node",zJ=["mathWithTransform"],Eh=O(IJ,zJ,e=>{var{mathWithTransform:r}=e;function t(a){for(var n of[...Os])if(a.has(n))throw new Error('Scope contains an illegal symbol, "'+n+'" is a reserved keyword')}class o{get type(){return"Node"}get isNode(){return!0}evaluate(n){return this.compile().evaluate(n)}compile(){var n=this._compile(r,{}),i={},u=null;function l(f){var s=ra(f);return t(s),n(s,i,u)}return{evaluate:l}}_compile(n,i){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(n){throw new Error("Cannot run forEach on a Node interface")}map(n){throw new Error("Cannot run map on a Node interface")}_ifNode(n){if(!er(n))throw new TypeError("Callback function must return a Node");return n}traverse(n){n(this,null,null);function i(u,l){u.forEach(function(f,s,d){l(f,s,d),i(f,l)})}i(this,n)}transform(n){function i(u,l,f){var s=n(u,l,f);return s!==u?s:u.map(i)}return i(this,null,null)}filter(n){var i=[];return this.traverse(function(u,l,f){n(u,l,f)&&i.push(u)}),i}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(n){return n.cloneDeep()})}equals(n){return n?this.type===n.type&&Kt(this,n):!1}toString(n){var i=this._getCustomString(n);return typeof i<"u"?i:this._toString(n)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(n){var i=this._getCustomString(n);return typeof i<"u"?i:this._toHTML(n)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(n){var i=this._getCustomString(n);return typeof i<"u"?i:this._toTex(n)}_toTex(n){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(n){if(n&&typeof n=="object")switch(typeof n.handler){case"object":case"undefined":return;case"function":return n.handler(this,n);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return o},{isClass:!0,isNode:!0})});function Dr(e){return e&&e.isIndexError?new St(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}var Mt=T(()=>{xn()});function Cs(e){var{subset:r}=e;return function(o,a){try{if(Array.isArray(o))return r(o,a);if(o&&typeof o.subset=="function")return o.subset(a);if(typeof o=="string")return r(o,a);if(typeof o=="object"){if(!a.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return Br(o,a.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(n){throw Dr(n)}}}var Fh=T(()=>{Mt();$t()});var Rs,qJ,Bh,mN=T(()=>{at();Se();$t();U();Fh();Rs="AccessorNode",qJ=["subset","Node"],Bh=O(Rs,qJ,e=>{var{subset:r,Node:t}=e,o=Cs({subset:r});function a(i){return!(eo(i)||ht(i)||Je(i)||zt(i)||Fa(i)||vt(i)||Tr(i))}class n extends t{constructor(u,l){if(super(),!er(u))throw new TypeError('Node expected for parameter "object"');if(!so(l))throw new TypeError('IndexNode expected for parameter "index"');this.object=u,this.index=l}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Rs}get isAccessorNode(){return!0}_compile(u,l){var f=this.object._compile(u,l),s=this.index._compile(u,l);if(this.index.isObjectProperty()){var d=this.index.getObjectProperty();return function(p,x,c){return Br(f(p,x,c),d)}}else return function(p,x,c){var v=f(p,x,c),y=s(p,x,v);return o(v,y)}}forEach(u){u(this.object,"object",this),u(this.index,"index",this)}map(u){return new n(this._ifNode(u(this.object,"object",this)),this._ifNode(u(this.index,"index",this)))}clone(){return new n(this.object,this.index)}_toString(u){var l=this.object.toString(u);return a(this.object)&&(l="("+l+")"),l+this.index.toString(u)}_toHTML(u){var l=this.object.toHTML(u);return a(this.object)&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l+this.index.toHTML(u)}_toTex(u){var l=this.object.toTex(u);return a(this.object)&&(l="\\left(' + object + '\\right)"),l+this.index.toTex(u)}toJSON(){return{mathjs:Rs,object:this.object,index:this.index}}static fromJSON(u){return new n(u.object,u.index)}}return pr(n,"name",Rs),n},{isClass:!0,isNode:!0})});var Ns,UJ,_h,cN=T(()=>{at();Se();ze();U();Ns="ArrayNode",UJ=["Node"],_h=O(Ns,UJ,e=>{var{Node:r}=e;class t extends r{constructor(a){if(super(),this.items=a||[],!Array.isArray(this.items)||!this.items.every(er))throw new TypeError("Array containing Nodes expected")}get type(){return Ns}get isArrayNode(){return!0}_compile(a,n){var i=mo(this.items,function(f){return f._compile(a,n)}),u=a.config.matrix!=="Array";if(u){var l=a.matrix;return function(s,d,m){return l(mo(i,function(p){return p(s,d,m)}))}}else return function(s,d,m){return mo(i,function(p){return p(s,d,m)})}}forEach(a){for(var n=0;n<this.items.length;n++){var i=this.items[n];a(i,"items["+n+"]",this)}}map(a){for(var n=[],i=0;i<this.items.length;i++)n[i]=this._ifNode(a(this.items[i],"items["+i+"]",this));return new t(n)}clone(){return new t(this.items.slice(0))}_toString(a){var n=this.items.map(function(i){return i.toString(a)});return"["+n.join(", ")+"]"}toJSON(){return{mathjs:Ns,items:this.items}}static fromJSON(a){return new t(a.items)}_toHTML(a){var n=this.items.map(function(i){return i.toHTML(a)});return'<span class="math-parenthesis math-square-parenthesis">[</span>'+n.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(a){function n(i,u){var l=i.some(ht)&&!i.every(ht),f=u||l,s=f?"&":"\\\\",d=i.map(function(m){return m.items?n(m.items,!u):m.toTex(a)}).join(s);return l||!f||f&&!u?"\\begin{bmatrix}"+d+"\\end{bmatrix}":d}return n(this.items,!1)}}return pr(t,"name",Ns),t},{isClass:!0,isNode:!0})});function xN(e){var{subset:r,matrix:t}=e;return function(a,n,i){try{if(Array.isArray(a)){var u=t(a).subset(n,i).valueOf();return u.forEach((l,f)=>{a[f]=l}),a}else{if(a&&typeof a.subset=="function")return a.subset(n,i);if(typeof a=="string")return r(a,n,i);if(typeof a=="object"){if(!n.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return Wo(a,n.getObjectProperty(),i),a}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(l){throw Dr(l)}}}var hN=T(()=>{Mt();$t()});function Ms(e,r){if(!r||r!=="auto")return e;for(var t=e;vt(t);)t=t.content;return t}function vr(e,r,t,o){var a=e;r!=="keep"&&(a=e.getContent());for(var n=a.getIdentifier(),i=null,u=0;u<wo.length;u++)if(n in wo[u]){i=u;break}if(n==="OperatorNode:multiply"&&a.implicit&&t!=="show"){var l=Ms(a.args[0],r);!(Je(l)&&o&&o.getIdentifier()==="OperatorNode:divide"&&ji(Ms(o.args[0],r)))&&!(l.getIdentifier()==="OperatorNode:divide"&&ji(Ms(l.args[0],r))&&Je(Ms(l.args[1])))&&(i+=1)}return i}function pi(e,r){var t=e;r!=="keep"&&(t=e.getContent());var o=t.getIdentifier(),a=vr(t,r);if(a===null)return null;var n=wo[a][o];if(Me(n,"associativity")){if(n.associativity==="left")return"left";if(n.associativity==="right")return"right";throw Error("'"+o+"' has the invalid associativity '"+n.associativity+"'.")}return null}function Es(e,r,t){var o=t!=="keep"?e.getContent():e,a=t!=="keep"?e.getContent():r,n=o.getIdentifier(),i=a.getIdentifier(),u=vr(o,t);if(u===null)return null;var l=wo[u][n];if(Me(l,"associativeWith")&&l.associativeWith instanceof Array){for(var f=0;f<l.associativeWith.length;f++)if(l.associativeWith[f]===i)return!0;return!1}return null}function vN(e){var r="OperatorNode:"+e;for(var t of wo)if(r in t)return t[r].op;return null}var wo,Ha=T(()=>{lr();Se();wo=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}]});var Fs,HJ,Ph,gN=T(()=>{at();Se();$t();U();Fh();hN();Ha();Fs="AssignmentNode",HJ=["subset","?matrix","Node"],Ph=O(Fs,HJ,e=>{var{subset:r,matrix:t,Node:o}=e,a=Cs({subset:r}),n=xN({subset:r,matrix:t});function i(l,f,s){f||(f="keep");var d=vr(l,f,s),m=vr(l.value,f,s);return f==="all"||m!==null&&m<=d}class u extends o{constructor(f,s,d){if(super(),this.object=f,this.index=d?s:null,this.value=d||s,!Tr(f)&&!eo(f))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(Tr(f)&&f.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!so(this.index))throw new TypeError('IndexNode expected as "index"');if(!er(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Fs}get isAssignmentNode(){return!0}_compile(f,s){var d=this.object._compile(f,s),m=this.index?this.index._compile(f,s):null,p=this.value._compile(f,s),x=this.object.name;if(this.index)if(this.index.isObjectProperty()){var c=this.index.getObjectProperty();return function(S,w,g){var A=d(S,w,g),C=p(S,w,g);return Wo(A,c,C),C}}else{if(Tr(this.object))return function(S,w,g){var A=d(S,w,g),C=p(S,w,g),D=m(S,w,A);return S.set(x,n(A,D,C)),C};var v=this.object.object._compile(f,s);if(this.object.index.isObjectProperty()){var y=this.object.index.getObjectProperty();return function(S,w,g){var A=v(S,w,g),C=Br(A,y),D=m(S,w,C),N=p(S,w,g);return Wo(A,y,n(C,D,N)),N}}else{var b=this.object.index._compile(f,s);return function(S,w,g){var A=v(S,w,g),C=b(S,w,A),D=a(A,C),N=m(S,w,D),E=p(S,w,g);return n(A,C,n(D,N,E)),E}}}else{if(!Tr(this.object))throw new TypeError("SymbolNode expected as object");return function(S,w,g){var A=p(S,w,g);return S.set(x,A),A}}}forEach(f){f(this.object,"object",this),this.index&&f(this.index,"index",this),f(this.value,"value",this)}map(f){var s=this._ifNode(f(this.object,"object",this)),d=this.index?this._ifNode(f(this.index,"index",this)):null,m=this._ifNode(f(this.value,"value",this));return new u(s,d,m)}clone(){return new u(this.object,this.index,this.value)}_toString(f){var s=this.object.toString(f),d=this.index?this.index.toString(f):"",m=this.value.toString(f);return i(this,f&&f.parenthesis,f&&f.implicit)&&(m="("+m+")"),s+d+" = "+m}toJSON(){return{mathjs:Fs,object:this.object,index:this.index,value:this.value}}static fromJSON(f){return new u(f.object,f.index,f.value)}_toHTML(f){var s=this.object.toHTML(f),d=this.index?this.index.toHTML(f):"",m=this.value.toHTML(f);return i(this,f&&f.parenthesis,f&&f.implicit)&&(m='<span class="math-paranthesis math-round-parenthesis">(</span>'+m+'<span class="math-paranthesis math-round-parenthesis">)</span>'),s+d+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+m}_toTex(f){var s=this.object.toTex(f),d=this.index?this.index.toTex(f):"",m=this.value.toTex(f);return i(this,f&&f.parenthesis,f&&f.implicit)&&(m="\\left(".concat(m,"\\right)")),s+d+"="+m}}return pr(u,"name",Fs),u},{isClass:!0,isNode:!0})});var Bs,WJ,kh,yN=T(()=>{at();Se();ze();U();Bs="BlockNode",WJ=["ResultSet","Node"],kh=O(Bs,WJ,e=>{var{ResultSet:r,Node:t}=e;class o extends t{constructor(n){if(super(),!Array.isArray(n))throw new Error("Array expected");this.blocks=n.map(function(i){var u=i&&i.node,l=i&&i.visible!==void 0?i.visible:!0;if(!er(u))throw new TypeError('Property "node" must be a Node');if(typeof l!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:u,visible:l}})}get type(){return Bs}get isBlockNode(){return!0}_compile(n,i){var u=mo(this.blocks,function(l){return{evaluate:l.node._compile(n,i),visible:l.visible}});return function(f,s,d){var m=[];return ju(u,function(x){var c=x.evaluate(f,s,d);x.visible&&m.push(c)}),new r(m)}}forEach(n){for(var i=0;i<this.blocks.length;i++)n(this.blocks[i].node,"blocks["+i+"].node",this)}map(n){for(var i=[],u=0;u<this.blocks.length;u++){var l=this.blocks[u],f=this._ifNode(n(l.node,"blocks["+u+"].node",this));i[u]={node:f,visible:l.visible}}return new o(i)}clone(){var n=this.blocks.map(function(i){return{node:i.node,visible:i.visible}});return new o(n)}_toString(n){return this.blocks.map(function(i){return i.node.toString(n)+(i.visible?"":";")}).join(`
12
+ `)}toJSON(){return{mathjs:Bs,blocks:this.blocks}}static fromJSON(n){return new o(n.blocks)}_toHTML(n){return this.blocks.map(function(i){return i.node.toHTML(n)+(i.visible?"":'<span class="math-separator">;</span>')}).join('<span class="math-separator"><br /></span>')}_toTex(n){return this.blocks.map(function(i){return i.node.toTex(n)+(i.visible?"":";")}).join(`\\;\\;
13
+ `)}}return pr(o,"name",Bs),o},{isClass:!0,isNode:!0})});var _s,VJ,Lh,SN=T(()=>{at();Se();U();Ha();_s="ConditionalNode",VJ=["Node"],Lh=O(_s,VJ,e=>{var{Node:r}=e;function t(a){if(typeof a=="number"||typeof a=="boolean"||typeof a=="string")return!!a;if(a){if(Fe(a))return!a.isZero();if(It(a))return!!(a.re||a.im);if(xt(a))return!!a.value}if(a==null)return!1;throw new TypeError('Unsupported type of condition "'+ar(a)+'"')}class o extends r{constructor(n,i,u){if(super(),!er(n))throw new TypeError("Parameter condition must be a Node");if(!er(i))throw new TypeError("Parameter trueExpr must be a Node");if(!er(u))throw new TypeError("Parameter falseExpr must be a Node");this.condition=n,this.trueExpr=i,this.falseExpr=u}get type(){return _s}get isConditionalNode(){return!0}_compile(n,i){var u=this.condition._compile(n,i),l=this.trueExpr._compile(n,i),f=this.falseExpr._compile(n,i);return function(d,m,p){return t(u(d,m,p))?l(d,m,p):f(d,m,p)}}forEach(n){n(this.condition,"condition",this),n(this.trueExpr,"trueExpr",this),n(this.falseExpr,"falseExpr",this)}map(n){return new o(this._ifNode(n(this.condition,"condition",this)),this._ifNode(n(this.trueExpr,"trueExpr",this)),this._ifNode(n(this.falseExpr,"falseExpr",this)))}clone(){return new o(this.condition,this.trueExpr,this.falseExpr)}_toString(n){var i=n&&n.parenthesis?n.parenthesis:"keep",u=vr(this,i,n&&n.implicit),l=this.condition.toString(n),f=vr(this.condition,i,n&&n.implicit);(i==="all"||this.condition.type==="OperatorNode"||f!==null&&f<=u)&&(l="("+l+")");var s=this.trueExpr.toString(n),d=vr(this.trueExpr,i,n&&n.implicit);(i==="all"||this.trueExpr.type==="OperatorNode"||d!==null&&d<=u)&&(s="("+s+")");var m=this.falseExpr.toString(n),p=vr(this.falseExpr,i,n&&n.implicit);return(i==="all"||this.falseExpr.type==="OperatorNode"||p!==null&&p<=u)&&(m="("+m+")"),l+" ? "+s+" : "+m}toJSON(){return{mathjs:_s,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(n){return new o(n.condition,n.trueExpr,n.falseExpr)}_toHTML(n){var i=n&&n.parenthesis?n.parenthesis:"keep",u=vr(this,i,n&&n.implicit),l=this.condition.toHTML(n),f=vr(this.condition,i,n&&n.implicit);(i==="all"||this.condition.type==="OperatorNode"||f!==null&&f<=u)&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>');var s=this.trueExpr.toHTML(n),d=vr(this.trueExpr,i,n&&n.implicit);(i==="all"||this.trueExpr.type==="OperatorNode"||d!==null&&d<=u)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>');var m=this.falseExpr.toHTML(n),p=vr(this.falseExpr,i,n&&n.implicit);return(i==="all"||this.falseExpr.type==="OperatorNode"||p!==null&&p<=u)&&(m='<span class="math-parenthesis math-round-parenthesis">(</span>'+m+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l+'<span class="math-operator math-conditional-operator">?</span>'+s+'<span class="math-operator math-conditional-operator">:</span>'+m}_toTex(n){return"\\begin{cases} {"+this.trueExpr.toTex(n)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(n)+"}\\\\{"+this.falseExpr.toTex(n)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return pr(o,"name",_s),o},{isClass:!0,isNode:!0})});var TN=Ir((r1e,wN)=>{"use strict";var Ih=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},GJ={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},$J={"\u2013":"\\--","\u2014":"\\---"," ":"~"," ":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},KJ=function(r,t){return Ih({},r,t)};wN.exports=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.preserveFormatting,o=t===void 0?!1:t,a=r.escapeMapFn,n=a===void 0?KJ:a,i=String(e),u="",l=n(Ih({},GJ),o?Ih({},$J):{}),f=Object.keys(l),s=function(){var m=!1;f.forEach(function(p,x){m||i.length>=p.length&&i.slice(0,p.length)===p&&(u+=l[f[x]],i=i.slice(p.length,i.length),m=!0)}),m||(u+=i.slice(0,1),i=i.slice(1,i.length))};i;)s();return u}});function Ps(e){return(0,DN.default)(e,{preserveFormatting:!0})}function ks(e,r){return r=typeof r>"u"?!1:r,r?Me(bN,e)?bN[e]:"\\mathrm{"+Ps(e)+"}":Me(zh,e)?zh[e]:Ps(e)}var DN,zh,mr,qh,AN,bN,An=T(()=>{DN=hr(TN(),1);lr();zh={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{?}"},mr={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"},qh={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(mr.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(mr.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(mr.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(mr.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(mr.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(mr.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(mr.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(mr.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(mr.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(mr.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(mr.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(mr.bitAnd,"${args[1]}\\right)")},bitNot:{1:mr.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(mr.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(mr.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(mr.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(mr.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(mr.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(mr.and,"${args[1]}\\right)")},not:{1:mr.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(mr.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(mr.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(mr.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:"{${args[0]}}".concat(mr.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(mr.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(mr.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(mr.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(mr.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(mr.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(mr.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(mr.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(mr.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(mr.to,"${args[1]}\\right)")},numeric:function(r,t){return r.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},bigint:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(zh.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},AN="\\mathrm{${name}}\\left(${args}\\right)",bN={deg:"^\\circ"}});var Ls,QJ,Uh,ON=T(()=>{at();Er();Se();An();U();Ls="ConstantNode",QJ=["Node"],Uh=O(Ls,QJ,e=>{var{Node:r}=e;class t extends r{constructor(a){super(),this.value=a}get type(){return Ls}get isConstantNode(){return!0}_compile(a,n){var i=this.value;return function(){return i}}forEach(a){}map(a){return this.clone()}clone(){return new t(this.value)}_toString(a){return Ie(this.value,a)}_toHTML(a){var n=this._toString(a);switch(ar(this.value)){case"number":case"bigint":case"BigNumber":case"Fraction":return'<span class="math-number">'+n+"</span>";case"string":return'<span class="math-string">'+n+"</span>";case"boolean":return'<span class="math-boolean">'+n+"</span>";case"null":return'<span class="math-null-symbol">'+n+"</span>";case"undefined":return'<span class="math-undefined">'+n+"</span>";default:return'<span class="math-symbol">'+n+"</span>"}}toJSON(){return{mathjs:Ls,value:this.value}}static fromJSON(a){return new t(a.value)}_toTex(a){var n=this._toString(a),i=ar(this.value);switch(i){case"string":return"\\mathtt{"+Ps(n)+"}";case"number":case"BigNumber":{var u=i==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!u)return this.value.valueOf()<0?"-\\infty":"\\infty";var l=n.toLowerCase().indexOf("e");return l!==-1?n.substring(0,l)+"\\cdot10^{"+n.substring(l+1)+"}":n}case"bigint":return n.toString();case"Fraction":return this.value.toLatex();default:return n}}}return pr(t,"name",Ls),t},{isClass:!0,isNode:!0})});var Is,ZJ,Hh,CN=T(()=>{at();Se();Mh();Er();ze();An();Ha();U();Is="FunctionAssignmentNode",ZJ=["typed","Node"],Hh=O(Is,ZJ,e=>{var{typed:r,Node:t}=e;function o(n,i,u){var l=vr(n,i,u),f=vr(n.expr,i,u);return i==="all"||f!==null&&f<=l}class a extends t{constructor(i,u,l){if(super(),typeof i!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(u))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!er(l))throw new TypeError('Node expected for parameter "expr"');if(Os.has(i))throw new Error('Illegal function name, "'+i+'" is a reserved keyword');var f=new Set;for(var s of u){var d=typeof s=="string"?s:s.name;if(f.has(d))throw new Error('Duplicate parameter name "'.concat(d,'"'));f.add(d)}this.name=i,this.params=u.map(function(m){return m&&m.name||m}),this.types=u.map(function(m){return m&&m.type||"any"}),this.expr=l}get type(){return Is}get isFunctionAssignmentNode(){return!0}_compile(i,u){var l=Object.create(u);ju(this.params,function(x){l[x]=!0});var f=this.expr._compile(i,l),s=this.name,d=this.params,m=Yd(this.types,","),p=s+"("+Yd(this.params,", ")+")";return function(c,v,y){var b={};b[m]=function(){for(var S=Object.create(v),w=0;w<d.length;w++)S[d[w]]=arguments[w];return f(c,S,y)};var h=r(s,b);return h.syntax=p,c.set(s,h),h}}forEach(i){i(this.expr,"expr",this)}map(i){var u=this._ifNode(i(this.expr,"expr",this));return new a(this.name,this.params.slice(0),u)}clone(){return new a(this.name,this.params.slice(0),this.expr)}_toString(i){var u=i&&i.parenthesis?i.parenthesis:"keep",l=this.expr.toString(i);return o(this,u,i&&i.implicit)&&(l="("+l+")"),this.name+"("+this.params.join(", ")+") = "+l}toJSON(){var i=this.types;return{mathjs:Is,name:this.name,params:this.params.map(function(u,l){return{name:u,type:i[l]}}),expr:this.expr}}static fromJSON(i){return new a(i.name,i.params,i.expr)}_toHTML(i){for(var u=i&&i.parenthesis?i.parenthesis:"keep",l=[],f=0;f<this.params.length;f++)l.push('<span class="math-symbol math-parameter">'+tt(this.params[f])+"</span>");var s=this.expr.toHTML(i);return o(this,u,i&&i.implicit)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+tt(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+l.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+s}_toTex(i){var u=i&&i.parenthesis?i.parenthesis:"keep",l=this.expr.toTex(i);return o(this,u,i&&i.implicit)&&(l="\\left(".concat(l,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(ks).join(",")+"\\right)="+l}}return pr(a,"name",Is),a},{isClass:!0,isNode:!0})});var zs,YJ,Wh,RN=T(()=>{at();ze();$t();U();Se();Er();zs="IndexNode",YJ=["Node","size"],Wh=O(zs,YJ,e=>{var{Node:r,size:t}=e;class o extends r{constructor(n,i){if(super(),this.dimensions=n,this.dotNotation=i||!1,!Array.isArray(n)||!n.every(er))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return zs}get isIndexNode(){return!0}_compile(n,i){var u=mo(this.dimensions,function(f,s){var d=f.filter(x=>x.isSymbolNode&&x.name==="end").length>0;if(d){var m=Object.create(i);m.end=!0;var p=f._compile(n,m);return function(c,v,y){if(!Ae(y)&&!fr(y)&&!zr(y))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+ar(y));var b=t(y).valueOf(),h=Object.create(v);return h.end=b[s],p(c,h,y)}}else return f._compile(n,i)}),l=Br(n,"index");return function(s,d,m){var p=mo(u,function(x){return x(s,d,m)});return l(...p)}}forEach(n){for(var i=0;i<this.dimensions.length;i++)n(this.dimensions[i],"dimensions["+i+"]",this)}map(n){for(var i=[],u=0;u<this.dimensions.length;u++)i[u]=this._ifNode(n(this.dimensions[u],"dimensions["+u+"]",this));return new o(i,this.dotNotation)}clone(){return new o(this.dimensions.slice(0),this.dotNotation)}isObjectProperty(){return this.dimensions.length===1&&Je(this.dimensions[0])&&typeof this.dimensions[0].value=="string"}getObjectProperty(){return this.isObjectProperty()?this.dimensions[0].value:null}_toString(n){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"}toJSON(){return{mathjs:zs,dimensions:this.dimensions,dotNotation:this.dotNotation}}static fromJSON(n){return new o(n.dimensions,n.dotNotation)}_toHTML(n){for(var i=[],u=0;u<this.dimensions.length;u++)i[u]=this.dimensions[u].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+tt(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+i.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(n){var i=this.dimensions.map(function(u){return u.toTex(n)});return this.dotNotation?"."+this.getObjectProperty():"_{"+i.join(",")+"}"}}return pr(o,"name",zs),o},{isClass:!0,isNode:!0})});var qs,XJ,Vh,NN=T(()=>{at();$t();U();Se();lr();Er();qs="ObjectNode",XJ=["Node"],Vh=O(qs,XJ,e=>{var{Node:r}=e;class t extends r{constructor(a){if(super(),this.properties=a||{},a&&(typeof a!="object"||!Object.keys(a).every(function(n){return er(a[n])})))throw new TypeError("Object containing Nodes expected")}get type(){return qs}get isObjectNode(){return!0}_compile(a,n){var i={};for(var u in this.properties)if(Me(this.properties,u)){var l=cn(u),f=JSON.parse(l),s=Br(this.properties,u);i[f]=s._compile(a,n)}return function(m,p,x){var c={};for(var v in i)Me(i,v)&&(c[v]=i[v](m,p,x));return c}}forEach(a){for(var n in this.properties)Me(this.properties,n)&&a(this.properties[n],"properties["+cn(n)+"]",this)}map(a){var n={};for(var i in this.properties)Me(this.properties,i)&&(n[i]=this._ifNode(a(this.properties[i],"properties["+cn(i)+"]",this)));return new t(n)}clone(){var a={};for(var n in this.properties)Me(this.properties,n)&&(a[n]=this.properties[n]);return new t(a)}_toString(a){var n=[];for(var i in this.properties)Me(this.properties,i)&&n.push(cn(i)+": "+this.properties[i].toString(a));return"{"+n.join(", ")+"}"}toJSON(){return{mathjs:qs,properties:this.properties}}static fromJSON(a){return new t(a.properties)}_toHTML(a){var n=[];for(var i in this.properties)Me(this.properties,i)&&n.push('<span class="math-symbol math-property">'+tt(i)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[i].toHTML(a));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+n.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'}_toTex(a){var n=[];for(var i in this.properties)Me(this.properties,i)&&n.push("\\mathbf{"+i+":} & "+this.properties[i].toTex(a)+"\\\\");var u="\\left\\{\\begin{array}{ll}"+n.join(`
14
+ `)+"\\end{array}\\right\\}";return u}}return pr(t,"name",qs),t},{isClass:!0,isNode:!0})});function On(e,r){return new Un(e,new Ca(r),new Set(Object.keys(r)))}var Gh=T(()=>{ta()});var Us,JJ,$h,MN=T(()=>{at();Se();ze();Gh();Er();$t();Ha();An();U();Us="OperatorNode",JJ=["Node"],$h=O(Us,JJ,e=>{var{Node:r}=e;function t(n,i){var u=n;if(i==="auto")for(;vt(u);)u=u.content;return Je(u)?!0:Cr(u)?t(u.args[0],i):!1}function o(n,i,u,l,f){var s=vr(n,i,u),d=pi(n,i);if(i==="all"||l.length>2&&n.getIdentifier()!=="OperatorNode:add"&&n.getIdentifier()!=="OperatorNode:multiply")return l.map(function(N){switch(N.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var m;switch(l.length){case 0:m=[];break;case 1:{var p=vr(l[0],i,u,n);if(f&&p!==null){var x,c;if(i==="keep"?(x=l[0].getIdentifier(),c=n.getIdentifier()):(x=l[0].getContent().getIdentifier(),c=n.getContent().getIdentifier()),wo[s][c].latexLeftParens===!1){m=[!1];break}if(wo[p][x].latexParens===!1){m=[!1];break}}if(p===null){m=[!1];break}if(p<=s){m=[!0];break}m=[!1]}break;case 2:{var v,y=vr(l[0],i,u,n),b=Es(n,l[0],i);y===null?v=!1:y===s&&d==="right"&&!b||y<s?v=!0:v=!1;var h,S=vr(l[1],i,u,n),w=Es(n,l[1],i);if(S===null?h=!1:S===s&&d==="left"&&!w||S<s?h=!0:h=!1,f){var g,A,C;i==="keep"?(g=n.getIdentifier(),A=n.args[0].getIdentifier(),C=n.args[1].getIdentifier()):(g=n.getContent().getIdentifier(),A=n.args[0].getContent().getIdentifier(),C=n.args[1].getContent().getIdentifier()),y!==null&&(wo[s][g].latexLeftParens===!1&&(v=!1),wo[y][A].latexParens===!1&&(v=!1)),S!==null&&(wo[s][g].latexRightParens===!1&&(h=!1),wo[S][C].latexParens===!1&&(h=!1))}m=[v,h]}break;default:(n.getIdentifier()==="OperatorNode:add"||n.getIdentifier()==="OperatorNode:multiply")&&(m=l.map(function(N){var E=vr(N,i,u,n),_=Es(n,N,i),L=pi(N,i);return E===null?!1:s===E&&d===L&&!_?!0:E<s}));break}if(l.length>=2&&n.getIdentifier()==="OperatorNode:multiply"&&n.implicit&&i!=="all"&&u==="hide")for(var D=1;D<m.length;++D)t(l[D],i)&&!m[D-1]&&(i!=="keep"||!vt(l[D-1]))&&(m[D]=!0);return m}class a extends r{constructor(i,u,l,f,s){if(super(),typeof i!="string")throw new TypeError('string expected for parameter "op"');if(typeof u!="string")throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(l)||!l.every(er))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=f===!0,this.isPercentage=s===!0,this.op=i,this.fn=u,this.args=l||[]}get type(){return Us}get isOperatorNode(){return!0}_compile(i,u){if(typeof this.fn!="string"||!Mu(i,this.fn))throw i[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var l=Br(i,this.fn),f=mo(this.args,function(x){return x._compile(i,u)});if(typeof l=="function"&&l.rawArgs===!0){var s=this.args;return function(c,v,y){return l(s,i,On(c,v))}}else if(f.length===1){var d=f[0];return function(c,v,y){return l(d(c,v,y))}}else if(f.length===2){var m=f[0],p=f[1];return function(c,v,y){return l(m(c,v,y),p(c,v,y))}}else return function(c,v,y){return l.apply(null,mo(f,function(b){return b(c,v,y)}))}}forEach(i){for(var u=0;u<this.args.length;u++)i(this.args[u],"args["+u+"]",this)}map(i){for(var u=[],l=0;l<this.args.length;l++)u[l]=this._ifNode(i(this.args[l],"args["+l+"]",this));return new a(this.op,this.fn,u,this.implicit,this.isPercentage)}clone(){return new a(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)}isUnary(){return this.args.length===1}isBinary(){return this.args.length===2}_toString(i){var u=i&&i.parenthesis?i.parenthesis:"keep",l=i&&i.implicit?i.implicit:"hide",f=this.args,s=o(this,u,l,f,!1);if(f.length===1){var d=pi(this,u),m=f[0].toString(i);s[0]&&(m="("+m+")");var p=/[a-zA-Z]+/.test(this.op);return d==="right"?this.op+(p?" ":"")+m:d==="left"?m+(p?" ":"")+this.op:m+this.op}else if(f.length===2){var x=f[0].toString(i),c=f[1].toString(i);return s[0]&&(x="("+x+")"),s[1]&&(c="("+c+")"),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&l==="hide"?x+" "+c:x+" "+this.op+" "+c}else if(f.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var v=f.map(function(y,b){return y=y.toString(i),s[b]&&(y="("+y+")"),y});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&l==="hide"?v.join(" "):v.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:Us,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(i){return new a(i.op,i.fn,i.args,i.implicit,i.isPercentage)}_toHTML(i){var u=i&&i.parenthesis?i.parenthesis:"keep",l=i&&i.implicit?i.implicit:"hide",f=this.args,s=o(this,u,l,f,!1);if(f.length===1){var d=pi(this,u),m=f[0].toHTML(i);return s[0]&&(m='<span class="math-parenthesis math-round-parenthesis">(</span>'+m+'<span class="math-parenthesis math-round-parenthesis">)</span>'),d==="right"?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+tt(this.op)+"</span>"+m:m+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+tt(this.op)+"</span>"}else if(f.length===2){var p=f[0].toHTML(i),x=f[1].toHTML(i);return s[0]&&(p='<span class="math-parenthesis math-round-parenthesis">(</span>'+p+'<span class="math-parenthesis math-round-parenthesis">)</span>'),s[1]&&(x='<span class="math-parenthesis math-round-parenthesis">(</span>'+x+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&l==="hide"?p+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+x:p+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+tt(this.op)+"</span>"+x}else{var c=f.map(function(v,y){return v=v.toHTML(i),s[y]&&(v='<span class="math-parenthesis math-round-parenthesis">(</span>'+v+'<span class="math-parenthesis math-round-parenthesis">)</span>'),v});return f.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&l==="hide"?c.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):c.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+tt(this.op)+"</span>"):'<span class="math-function">'+tt(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+c.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}}_toTex(i){var u=i&&i.parenthesis?i.parenthesis:"keep",l=i&&i.implicit?i.implicit:"hide",f=this.args,s=o(this,u,l,f,!0),d=mr[this.fn];if(d=typeof d>"u"?this.op:d,f.length===1){var m=pi(this,u),p=f[0].toTex(i);return s[0]&&(p="\\left(".concat(p,"\\right)")),m==="right"?d+p:p+d}else if(f.length===2){var x=f[0],c=x.toTex(i);s[0]&&(c="\\left(".concat(c,"\\right)"));var v=f[1],y=v.toTex(i);s[1]&&(y="\\left(".concat(y,"\\right)"));var b;switch(u==="keep"?b=x.getIdentifier():b=x.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return d+"{"+c+"}{"+y+"}";case"OperatorNode:pow":switch(c="{"+c+"}",y="{"+y+"}",b){case"ConditionalNode":case"OperatorNode:divide":c="\\left(".concat(c,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&l==="hide")return c+"~"+y}return c+d+y}else if(f.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var h=f.map(function(S,w){return S=S.toTex(i),s[w]&&(S="\\left(".concat(S,"\\right)")),S});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&l==="hide"?h.join("~"):h.join(d)}else return"\\mathrm{"+this.fn+"}\\left("+f.map(function(S){return S.toTex(i)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return pr(a,"name",Us),a},{isClass:!0,isNode:!0})});var Hs,jJ,Kh,EN=T(()=>{at();Se();U();Hs="ParenthesisNode",jJ=["Node"],Kh=O(Hs,jJ,e=>{var{Node:r}=e;class t extends r{constructor(a){if(super(),!er(a))throw new TypeError('Node expected for parameter "content"');this.content=a}get type(){return Hs}get isParenthesisNode(){return!0}_compile(a,n){return this.content._compile(a,n)}getContent(){return this.content.getContent()}forEach(a){a(this.content,"content",this)}map(a){var n=a(this.content,"content",this);return new t(n)}clone(){return new t(this.content)}_toString(a){return!a||a&&!a.parenthesis||a&&a.parenthesis==="keep"?"("+this.content.toString(a)+")":this.content.toString(a)}toJSON(){return{mathjs:Hs,content:this.content}}static fromJSON(a){return new t(a.content)}_toHTML(a){return!a||a&&!a.parenthesis||a&&a.parenthesis==="keep"?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(a)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(a)}_toTex(a){return!a||a&&!a.parenthesis||a&&a.parenthesis==="keep"?"\\left(".concat(this.content.toTex(a),"\\right)"):this.content.toTex(a)}}return pr(t,"name",Hs),t},{isClass:!0,isNode:!0})});var Ws,ej,Qh,FN=T(()=>{at();Se();U();Ha();Ws="RangeNode",ej=["Node"],Qh=O(Ws,ej,e=>{var{Node:r}=e;function t(a,n,i){var u=vr(a,n,i),l={},f=vr(a.start,n,i);if(l.start=f!==null&&f<=u||n==="all",a.step){var s=vr(a.step,n,i);l.step=s!==null&&s<=u||n==="all"}var d=vr(a.end,n,i);return l.end=d!==null&&d<=u||n==="all",l}class o extends r{constructor(n,i,u){if(super(),!er(n))throw new TypeError("Node expected");if(!er(i))throw new TypeError("Node expected");if(u&&!er(u))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=n,this.end=i,this.step=u||null}get type(){return Ws}get isRangeNode(){return!0}needsEnd(){var n=this.filter(function(i){return Tr(i)&&i.name==="end"});return n.length>0}_compile(n,i){var u=n.range,l=this.start._compile(n,i),f=this.end._compile(n,i);if(this.step){var s=this.step._compile(n,i);return function(m,p,x){return u(l(m,p,x),f(m,p,x),s(m,p,x))}}else return function(m,p,x){return u(l(m,p,x),f(m,p,x))}}forEach(n){n(this.start,"start",this),n(this.end,"end",this),this.step&&n(this.step,"step",this)}map(n){return new o(this._ifNode(n(this.start,"start",this)),this._ifNode(n(this.end,"end",this)),this.step&&this._ifNode(n(this.step,"step",this)))}clone(){return new o(this.start,this.end,this.step&&this.step)}_toString(n){var i=n&&n.parenthesis?n.parenthesis:"keep",u=t(this,i,n&&n.implicit),l,f=this.start.toString(n);if(u.start&&(f="("+f+")"),l=f,this.step){var s=this.step.toString(n);u.step&&(s="("+s+")"),l+=":"+s}var d=this.end.toString(n);return u.end&&(d="("+d+")"),l+=":"+d,l}toJSON(){return{mathjs:Ws,start:this.start,end:this.end,step:this.step}}static fromJSON(n){return new o(n.start,n.end,n.step)}_toHTML(n){var i=n&&n.parenthesis?n.parenthesis:"keep",u=t(this,i,n&&n.implicit),l,f=this.start.toHTML(n);if(u.start&&(f='<span class="math-parenthesis math-round-parenthesis">(</span>'+f+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l=f,this.step){var s=this.step.toHTML(n);u.step&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l+='<span class="math-operator math-range-operator">:</span>'+s}var d=this.end.toHTML(n);return u.end&&(d='<span class="math-parenthesis math-round-parenthesis">(</span>'+d+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l+='<span class="math-operator math-range-operator">:</span>'+d,l}_toTex(n){var i=n&&n.parenthesis?n.parenthesis:"keep",u=t(this,i,n&&n.implicit),l=this.start.toTex(n);if(u.start&&(l="\\left(".concat(l,"\\right)")),this.step){var f=this.step.toTex(n);u.step&&(f="\\left(".concat(f,"\\right)")),l+=":"+f}var s=this.end.toTex(n);return u.end&&(s="\\left(".concat(s,"\\right)")),l+=":"+s,l}}return pr(o,"name",Ws),o},{isClass:!0,isNode:!0})});var Vs,rj,Zh,BN=T(()=>{at();Ha();Er();$t();An();U();Vs="RelationalNode",rj=["Node"],Zh=O(Vs,rj,e=>{var{Node:r}=e,t={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class o extends r{constructor(n,i){if(super(),!Array.isArray(n))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(i))throw new TypeError("Parameter params must be an array");if(n.length!==i.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=n,this.params=i}get type(){return Vs}get isRelationalNode(){return!0}_compile(n,i){var u=this,l=this.params.map(f=>f._compile(n,i));return function(s,d,m){for(var p,x=l[0](s,d,m),c=0;c<u.conditionals.length;c++){p=x,x=l[c+1](s,d,m);var v=Br(n,u.conditionals[c]);if(!v(p,x))return!1}return!0}}forEach(n){this.params.forEach((i,u)=>n(i,"params["+u+"]",this),this)}map(n){return new o(this.conditionals.slice(),this.params.map((i,u)=>this._ifNode(n(i,"params["+u+"]",this)),this))}clone(){return new o(this.conditionals,this.params)}_toString(n){for(var i=n&&n.parenthesis?n.parenthesis:"keep",u=vr(this,i,n&&n.implicit),l=this.params.map(function(d,m){var p=vr(d,i,n&&n.implicit);return i==="all"||p!==null&&p<=u?"("+d.toString(n)+")":d.toString(n)}),f=l[0],s=0;s<this.conditionals.length;s++)f+=" "+t[this.conditionals[s]],f+=" "+l[s+1];return f}toJSON(){return{mathjs:Vs,conditionals:this.conditionals,params:this.params}}static fromJSON(n){return new o(n.conditionals,n.params)}_toHTML(n){for(var i=n&&n.parenthesis?n.parenthesis:"keep",u=vr(this,i,n&&n.implicit),l=this.params.map(function(d,m){var p=vr(d,i,n&&n.implicit);return i==="all"||p!==null&&p<=u?'<span class="math-parenthesis math-round-parenthesis">(</span>'+d.toHTML(n)+'<span class="math-parenthesis math-round-parenthesis">)</span>':d.toHTML(n)}),f=l[0],s=0;s<this.conditionals.length;s++)f+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+tt(t[this.conditionals[s]])+"</span>"+l[s+1];return f}_toTex(n){for(var i=n&&n.parenthesis?n.parenthesis:"keep",u=vr(this,i,n&&n.implicit),l=this.params.map(function(d,m){var p=vr(d,i,n&&n.implicit);return i==="all"||p!==null&&p<=u?"\\left("+d.toTex(n)+"\right)":d.toTex(n)}),f=l[0],s=0;s<this.conditionals.length;s++)f+=mr[this.conditionals[s]]+l[s+1];return f}}return pr(o,"name",Vs),o},{isClass:!0,isNode:!0})});var tj,oj,Yh,_N=T(()=>{Er();$t();U();An();tj="SymbolNode",oj=["math","?Unit","Node"],Yh=O(tj,oj,e=>{var{math:r,Unit:t,Node:o}=e;function a(i){return t?t.isValuelessUnit(i):!1}class n extends o{constructor(u){if(super(),typeof u!="string")throw new TypeError('String expected for parameter "name"');this.name=u}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(u,l){var f=this.name;if(l[f]===!0)return function(d,m,p){return Br(m,f)};if(f in u)return function(d,m,p){return d.has(f)?d.get(f):Br(u,f)};var s=a(f);return function(d,m,p){return d.has(f)?d.get(f):s?new t(null,f):n.onUndefinedSymbol(f)}}forEach(u){}map(u){return this.clone()}static onUndefinedSymbol(u){throw new Error("Undefined symbol "+u)}clone(){return new n(this.name)}_toString(u){return this.name}_toHTML(u){var l=tt(this.name);return l==="true"||l==="false"?'<span class="math-symbol math-boolean">'+l+"</span>":l==="i"?'<span class="math-symbol math-imaginary-symbol">'+l+"</span>":l==="Infinity"?'<span class="math-symbol math-infinity-symbol">'+l+"</span>":l==="NaN"?'<span class="math-symbol math-nan-symbol">'+l+"</span>":l==="null"?'<span class="math-symbol math-null-symbol">'+l+"</span>":l==="undefined"?'<span class="math-symbol math-undefined-symbol">'+l+"</span>":'<span class="math-symbol">'+l+"</span>"}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(u){return new n(u.name)}_toTex(u){var l=!1;typeof r[this.name]>"u"&&a(this.name)&&(l=!0);var f=ks(this.name,l);return f[0]==="\\"?f:" "+f}}return n},{isClass:!0,isNode:!0})});var Gs,aj,Xh,PN=T(()=>{at();Se();Er();lr();$t();Gh();U();An();Gs="FunctionNode",aj=["math","Node","SymbolNode"],Xh=O(Gs,aj,e=>{var r,{math:t,Node:o,SymbolNode:a}=e,n=l=>Ie(l,{truncate:78});function i(l,f,s){for(var d="",m=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,p=0,x;(x=m.exec(l))!==null;)if(d+=l.substring(p,x.index),p=x.index,x[0]==="$$")d+="$",p++;else{p+=x[0].length;var c=f[x[1]];if(!c)throw new ReferenceError("Template: Property "+x[1]+" does not exist.");if(x[2]===void 0)switch(typeof c){case"string":d+=c;break;case"object":if(er(c))d+=c.toTex(s);else if(Array.isArray(c))d+=c.map(function(v,y){if(er(v))return v.toTex(s);throw new TypeError("Template: "+x[1]+"["+y+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes")}else if(er(c[x[2]]&&c[x[2]]))d+=c[x[2]].toTex(s);else throw new TypeError("Template: "+x[1]+"["+x[2]+"] is not a Node.")}return d+=l.slice(p),d}class u extends o{constructor(f,s){if(super(),typeof f=="string"&&(f=new a(f)),!er(f))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(s)||!s.every(er))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=f,this.args=s||[]}get name(){return this.fn.name||""}get type(){return Gs}get isFunctionNode(){return!0}_compile(f,s){var d=this.args.map(C=>C._compile(f,s));if(Tr(this.fn)){var m=this.fn.name;if(s[m]){var y=this.args;return function(D,N,E){var _=Br(N,m);if(typeof _!="function")throw new TypeError("Argument '".concat(m,"' was not a function; received: ").concat(n(_)));if(_.rawArgs)return _(y,f,On(D,N));var L=d.map(P=>P(D,N,E));return _.apply(_,L)}}else{var p=m in f?Br(f,m):void 0,x=typeof p=="function"&&p.rawArgs===!0,c=C=>{var D;if(C.has(m))D=C.get(m);else if(m in f)D=Br(f,m);else return u.onUndefinedFunction(m);if(typeof D=="function")return D;throw new TypeError("'".concat(m,`' is not a function; its value is:
15
+ `).concat(n(D)))};if(x){var v=this.args;return function(D,N,E){var _=c(D);if(_.rawArgs===!0)return _(v,f,On(D,N));var L=d.map(P=>P(D,N,E));return _(...L)}}else switch(d.length){case 0:return function(D,N,E){var _=c(D);return _()};case 1:return function(D,N,E){var _=c(D),L=d[0];return _(L(D,N,E))};case 2:return function(D,N,E){var _=c(D),L=d[0],P=d[1];return _(L(D,N,E),P(D,N,E))};default:return function(D,N,E){var _=c(D),L=d.map(P=>P(D,N,E));return _(...L)}}}}else if(eo(this.fn)&&so(this.fn.index)&&this.fn.index.isObjectProperty()){var b=this.fn.object._compile(f,s),h=this.fn.index.getObjectProperty(),S=this.args;return function(D,N,E){var _=b(D,N,E),L=gb(_,h);if(L!=null&&L.rawArgs)return L(S,f,On(D,N));var P=d.map(k=>k(D,N,E));return L.apply(_,P)}}else{var w=this.fn.toString(),g=this.fn._compile(f,s),A=this.args;return function(D,N,E){var _=g(D,N,E);if(typeof _!="function")throw new TypeError("Expression '".concat(w,"' did not evaluate to a function; value is:")+`
16
+ `.concat(n(_)));if(_.rawArgs)return _(A,f,On(D,N));var L=d.map(P=>P(D,N,E));return _.apply(_,L)}}}forEach(f){f(this.fn,"fn",this);for(var s=0;s<this.args.length;s++)f(this.args[s],"args["+s+"]",this)}map(f){for(var s=this._ifNode(f(this.fn,"fn",this)),d=[],m=0;m<this.args.length;m++)d[m]=this._ifNode(f(this.args[m],"args["+m+"]",this));return new u(s,d)}clone(){return new u(this.fn,this.args.slice(0))}toString(f){var s,d=this.fn.toString(f);return f&&typeof f.handler=="object"&&Me(f.handler,d)&&(s=f.handler[d](this,f)),typeof s<"u"?s:super.toString(f)}_toString(f){var s=this.args.map(function(m){return m.toString(f)}),d=Vo(this.fn)?"("+this.fn.toString(f)+")":this.fn.toString(f);return d+"("+s.join(", ")+")"}toJSON(){return{mathjs:Gs,fn:this.fn,args:this.args}}_toHTML(f){var s=this.args.map(function(d){return d.toHTML(f)});return'<span class="math-function">'+tt(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+s.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}toTex(f){var s;return f&&typeof f.handler=="object"&&Me(f.handler,this.name)&&(s=f.handler[this.name](this,f)),typeof s<"u"?s:super.toTex(f)}_toTex(f){var s=this.args.map(function(p){return p.toTex(f)}),d;qh[this.name]&&(d=qh[this.name]),t[this.name]&&(typeof t[this.name].toTex=="function"||typeof t[this.name].toTex=="object"||typeof t[this.name].toTex=="string")&&(d=t[this.name].toTex);var m;switch(typeof d){case"function":m=d(this,f);break;case"string":m=i(d,this,f);break;case"object":switch(typeof d[s.length]){case"function":m=d[s.length](this,f);break;case"string":m=i(d[s.length],this,f);break}}return typeof m<"u"?m:i(AN,this,f)}getIdentifier(){return this.type+":"+this.name}}return r=u,pr(u,"name",Gs),pr(u,"onUndefinedFunction",function(l){throw new Error("Undefined function "+l)}),pr(u,"fromJSON",function(l){return new r(l.fn,l.args)}),u},{isClass:!0,isNode:!0})});var kN,nj,Jh,LN=T(()=>{Oa();U();Se();je();He();lr();kN="parse",nj=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],Jh=O(kN,nj,e=>{var{typed:r,numeric:t,config:o,AccessorNode:a,ArrayNode:n,AssignmentNode:i,BlockNode:u,ConditionalNode:l,ConstantNode:f,FunctionAssignmentNode:s,FunctionNode:d,IndexNode:m,ObjectNode:p,OperatorNode:x,ParenthesisNode:c,RangeNode:v,RelationalNode:y,SymbolNode:b}=e,h=r(kN,{string:function(H){return J(H,{})},"Array | Matrix":function(H){return S(H,{})},"string, Object":function(H,X){var xe=X.nodes!==void 0?X.nodes:{};return J(H,xe)},"Array | Matrix, Object":S});function S(M){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=H.nodes!==void 0?H.nodes:{};return Oe(M,function(xe){if(typeof xe!="string")throw new TypeError("String expected");return J(xe,X)})}var w={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},g={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},A={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},C={true:!0,false:!1,null:null,undefined:void 0},D=["NaN","Infinity"],N={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:`
17
+ `,r:"\r",t:" "};function E(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:w.NULL,nestingLevel:0,conditionalLevel:null}}function _(M,H){return M.expression.substr(M.index,H)}function L(M){return _(M,1)}function P(M){M.index++}function k(M){return M.expression.charAt(M.index-1)}function R(M){return M.expression.charAt(M.index+1)}function F(M){for(M.tokenType=w.NULL,M.token="",M.comment="";;){if(L(M)==="#")for(;L(M)!==`
18
+ `&&L(M)!=="";)M.comment+=L(M),P(M);if(h.isWhitespace(L(M),M.nestingLevel))P(M);else break}if(L(M)===""){M.tokenType=w.DELIMITER;return}if(L(M)===`
19
+ `&&!M.nestingLevel){M.tokenType=w.DELIMITER,M.token=L(M),P(M);return}var H=L(M),X=_(M,2),xe=_(M,3);if(xe.length===3&&g[xe]){M.tokenType=w.DELIMITER,M.token=xe,P(M),P(M),P(M);return}if(X.length===2&&g[X]){M.tokenType=w.DELIMITER,M.token=X,P(M),P(M);return}if(g[H]){M.tokenType=w.DELIMITER,M.token=H,P(M);return}if(h.isDigitDot(H)){M.tokenType=w.NUMBER;var Be=_(M,2);if(Be==="0b"||Be==="0o"||Be==="0x"){for(M.token+=L(M),P(M),M.token+=L(M),P(M);h.isHexDigit(L(M));)M.token+=L(M),P(M);if(L(M)===".")for(M.token+=".",P(M);h.isHexDigit(L(M));)M.token+=L(M),P(M);else if(L(M)==="i")for(M.token+="i",P(M);h.isDigit(L(M));)M.token+=L(M),P(M);return}if(L(M)==="."){if(M.token+=L(M),P(M),!h.isDigit(L(M))){M.tokenType=w.DELIMITER;return}}else{for(;h.isDigit(L(M));)M.token+=L(M),P(M);h.isDecimalMark(L(M),R(M))&&(M.token+=L(M),P(M))}for(;h.isDigit(L(M));)M.token+=L(M),P(M);if(L(M)==="E"||L(M)==="e"){if(h.isDigit(R(M))||R(M)==="-"||R(M)==="+"){if(M.token+=L(M),P(M),(L(M)==="+"||L(M)==="-")&&(M.token+=L(M),P(M)),!h.isDigit(L(M)))throw pe(M,'Digit expected, got "'+L(M)+'"');for(;h.isDigit(L(M));)M.token+=L(M),P(M);if(h.isDecimalMark(L(M),R(M)))throw pe(M,'Digit expected, got "'+L(M)+'"')}else if(R(M)===".")throw P(M),pe(M,'Digit expected, got "'+L(M)+'"')}return}if(h.isAlpha(L(M),k(M),R(M))){for(;h.isAlpha(L(M),k(M),R(M))||h.isDigit(L(M));)M.token+=L(M),P(M);Me(A,M.token)?M.tokenType=w.DELIMITER:M.tokenType=w.SYMBOL;return}for(M.tokenType=w.UNKNOWN;L(M)!=="";)M.token+=L(M),P(M);throw pe(M,'Syntax error in part "'+M.token+'"')}function I(M){do F(M);while(M.token===`
20
+ `)}function B(M){M.nestingLevel++}function V(M){M.nestingLevel--}h.isAlpha=function(H,X,xe){return h.isValidLatinOrGreek(H)||h.isValidMathSymbol(H,xe)||h.isValidMathSymbol(X,H)},h.isValidLatinOrGreek=function(H){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(H)},h.isValidMathSymbol=function(H,X){return/^[\uD835]$/.test(H)&&/^[\uDC00-\uDFFF]$/.test(X)&&/^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(X)},h.isWhitespace=function(H,X){return H===" "||H===" "||H===`
21
+ `&&X>0},h.isDecimalMark=function(H,X){return H==="."&&X!=="/"&&X!=="*"&&X!=="^"},h.isDigitDot=function(H){return H>="0"&&H<="9"||H==="."},h.isDigit=function(H){return H>="0"&&H<="9"},h.isHexDigit=function(H){return H>="0"&&H<="9"||H>="a"&&H<="f"||H>="A"&&H<="F"};function J(M,H){var X=E();Pr(X,{expression:M,extraNodes:H}),F(X);var xe=K(X);if(X.token!=="")throw X.tokenType===w.DELIMITER?Re(X,"Unexpected operator "+X.token):pe(X,'Unexpected part "'+X.token+'"');return xe}function K(M){var H,X=[],xe;for(M.token!==""&&M.token!==`
22
+ `&&M.token!==";"&&(H=z(M),M.comment&&(H.comment=M.comment));M.token===`
23
+ `||M.token===";";)X.length===0&&H&&(xe=M.token!==";",X.push({node:H,visible:xe})),F(M),M.token!==`
24
+ `&&M.token!==";"&&M.token!==""&&(H=z(M),M.comment&&(H.comment=M.comment),xe=M.token!==";",X.push({node:H,visible:xe}));return X.length>0?new u(X):(H||(H=new f(void 0),M.comment&&(H.comment=M.comment)),H)}function z(M){var H,X,xe,Be,Le=j(M);if(M.token==="="){if(Tr(Le))return H=Le.name,I(M),xe=z(M),new i(new b(H),xe);if(eo(Le))return I(M),xe=z(M),new i(Le.object,Le.index,xe);if(zt(Le)&&Tr(Le.fn)&&(Be=!0,X=[],H=Le.name,Le.args.forEach(function(Mr,mt){Tr(Mr)?X[mt]=Mr.name:Be=!1}),Be))return I(M),xe=z(M),new s(H,X,xe);throw pe(M,"Invalid left hand side of assignment operator =")}return Le}function j(M){for(var H=ue(M);M.token==="?";){var X=M.conditionalLevel;M.conditionalLevel=M.nestingLevel,I(M);var xe=H,Be=z(M);if(M.token!==":")throw pe(M,"False part of conditional expression expected");M.conditionalLevel=null,I(M);var Le=z(M);H=new l(xe,Be,Le),M.conditionalLevel=X}return H}function ue(M){for(var H=ee(M);M.token==="or";)I(M),H=new x("or","or",[H,ee(M)]);return H}function ee(M){for(var H=ne(M);M.token==="xor";)I(M),H=new x("xor","xor",[H,ne(M)]);return H}function ne(M){for(var H=$(M);M.token==="and";)I(M),H=new x("and","and",[H,$(M)]);return H}function $(M){for(var H=W(M);M.token==="|";)I(M),H=new x("|","bitOr",[H,W(M)]);return H}function W(M){for(var H=Y(M);M.token==="^|";)I(M),H=new x("^|","bitXor",[H,Y(M)]);return H}function Y(M){for(var H=oe(M);M.token==="&";)I(M),H=new x("&","bitAnd",[H,oe(M)]);return H}function oe(M){for(var H=[re(M)],X=[],xe={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Me(xe,M.token);){var Be={name:M.token,fn:xe[M.token]};X.push(Be),I(M),H.push(re(M))}return H.length===1?H[0]:H.length===2?new x(X[0].name,X[0].fn,H):new y(X.map(Le=>Le.fn),H)}function re(M){var H,X,xe,Be;H=le(M);for(var Le={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Me(Le,M.token);)X=M.token,xe=Le[X],I(M),Be=[H,le(M)],H=new x(X,xe,Be);return H}function le(M){var H,X,xe,Be;H=se(M);for(var Le={to:"to",in:"to"};Me(Le,M.token);)X=M.token,xe=Le[X],I(M),X==="in"&&M.token===""?H=new x("*","multiply",[H,new b("in")],!0):(Be=[H,se(M)],H=new x(X,xe,Be));return H}function se(M){var H,X=[];if(M.token===":"?H=new f(1):H=q(M),M.token===":"&&M.conditionalLevel!==M.nestingLevel){for(X.push(H);M.token===":"&&X.length<3;)I(M),M.token===")"||M.token==="]"||M.token===","||M.token===""?X.push(new b("end")):X.push(q(M));X.length===3?H=new v(X[0],X[2],X[1]):H=new v(X[0],X[1])}return H}function q(M){var H,X,xe,Be;H=G(M);for(var Le={"+":"add","-":"subtract"};Me(Le,M.token);){X=M.token,xe=Le[X],I(M);var Mr=G(M);Mr.isPercentage?Be=[H,new x("*","multiply",[H,Mr])]:Be=[H,Mr],H=new x(X,xe,Be)}return H}function G(M){var H,X,xe,Be;H=te(M),X=H;for(var Le={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide","%":"mod",mod:"mod"};Me(Le,M.token);)if(xe=M.token,Be=Le[xe],I(M),xe==="%"&&M.tokenType===w.DELIMITER&&M.token!=="(")if(M.token!==""&&Le[M.token]){var Mr=new x("/","divide",[H,new f(100)],!1,!0);xe=M.token,Be=Le[xe],I(M),X=te(M),H=new x(xe,Be,[Mr,X])}else H=new x("/","divide",[H,new f(100)],!1,!0);else X=te(M),H=new x(xe,Be,[H,X]);return H}function te(M){var H,X;for(H=ie(M),X=H;M.tokenType===w.SYMBOL||M.token==="in"&&Je(H)||M.token==="in"&&Cr(H)&&H.fn==="unaryMinus"&&Je(H.args[0])||M.tokenType===w.NUMBER&&!Je(X)&&(!Cr(X)||X.op==="!")||M.token==="(";)X=ie(M),H=new x("*","multiply",[H,X],!0);return H}function ie(M){for(var H=de(M),X=H,xe=[];M.token==="/"&&ji(X);)if(xe.push(Pr({},M)),I(M),M.tokenType===w.NUMBER)if(xe.push(Pr({},M)),I(M),M.tokenType===w.SYMBOL||M.token==="("||M.token==="in")Pr(M,xe.pop()),xe.pop(),X=de(M),H=new x("/","divide",[H,X]);else{xe.pop(),Pr(M,xe.pop());break}else{Pr(M,xe.pop());break}return H}function de(M){var H,X,xe,Be={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Me(Be,M.token)?(xe=Be[M.token],H=M.token,I(M),X=[de(M)],new x(H,xe,X)):he(M)}function he(M){var H,X,xe,Be;return H=De(M),(M.token==="^"||M.token===".^")&&(X=M.token,xe=X==="^"?"pow":"dotPow",I(M),Be=[H,de(M)],H=new x(X,xe,Be)),H}function De(M){var H,X,xe,Be;H=Ne(M);for(var Le={"!":"factorial","'":"ctranspose"};Me(Le,M.token);)X=M.token,xe=Le[X],F(M),Be=[H],H=new x(X,xe,Be),H=qe(M,H);return H}function Ne(M){var H=[];if(M.tokenType===w.SYMBOL&&Me(M.extraNodes,M.token)){var X=M.extraNodes[M.token];if(F(M),M.token==="("){if(H=[],B(M),F(M),M.token!==")")for(H.push(z(M));M.token===",";)F(M),H.push(z(M));if(M.token!==")")throw pe(M,"Parenthesis ) expected");V(M),F(M)}return new X(H)}return Xe(M)}function Xe(M){var H,X;return M.tokenType===w.SYMBOL||M.tokenType===w.DELIMITER&&M.token in A?(X=M.token,F(M),Me(C,X)?H=new f(C[X]):D.includes(X)?H=new f(t(X,"number")):H=new b(X),H=qe(M,H),H):yr(M)}function qe(M,H,X){for(var xe;(M.token==="("||M.token==="["||M.token===".")&&(!X||X.includes(M.token));)if(xe=[],M.token==="(")if(Tr(H)||eo(H)){if(B(M),F(M),M.token!==")")for(xe.push(z(M));M.token===",";)F(M),xe.push(z(M));if(M.token!==")")throw pe(M,"Parenthesis ) expected");V(M),F(M),H=new d(H,xe)}else return H;else if(M.token==="["){if(B(M),F(M),M.token!=="]")for(xe.push(z(M));M.token===",";)F(M),xe.push(z(M));if(M.token!=="]")throw pe(M,"Parenthesis ] expected");V(M),F(M),H=new a(H,new m(xe))}else{F(M);var Be=M.tokenType===w.SYMBOL||M.tokenType===w.DELIMITER&&M.token in A;if(!Be)throw pe(M,"Property name expected after dot");xe.push(new f(M.token)),F(M);var Le=!0;H=new a(H,new m(xe,Le))}return H}function yr(M){var H,X;return M.token==='"'||M.token==="'"?(X=xr(M,M.token),H=new f(X),H=qe(M,H),H):kr(M)}function xr(M,H){for(var X="";L(M)!==""&&L(M)!==H;)if(L(M)==="\\"){P(M);var xe=L(M),Be=N[xe];if(Be!==void 0)X+=Be,M.index+=1;else if(xe==="u"){var Le=M.expression.slice(M.index+1,M.index+5);if(/^[0-9A-Fa-f]{4}$/.test(Le))X+=String.fromCharCode(parseInt(Le,16)),M.index+=5;else throw pe(M,"Invalid unicode character \\u".concat(Le))}else throw pe(M,"Bad escape character \\".concat(xe))}else X+=L(M),P(M);if(F(M),M.token!==H)throw pe(M,"End of string ".concat(H," expected"));return F(M),X}function kr(M){var H,X,xe,Be;if(M.token==="["){if(B(M),F(M),M.token!=="]"){var Le=Yr(M);if(M.token===";"){for(xe=1,X=[Le];M.token===";";)F(M),M.token!=="]"&&(X[xe]=Yr(M),xe++);if(M.token!=="]")throw pe(M,"End of matrix ] expected");V(M),F(M),Be=X[0].items.length;for(var Mr=1;Mr<xe;Mr++)if(X[Mr].items.length!==Be)throw Re(M,"Column dimensions mismatch ("+X[Mr].items.length+" !== "+Be+")");H=new n(X)}else{if(M.token!=="]")throw pe(M,"End of matrix ] expected");V(M),F(M),H=Le}}else V(M),F(M),H=new n([]);return qe(M,H)}return Z(M)}function Yr(M){for(var H=[z(M)],X=1;M.token===",";)F(M),M.token!=="]"&&M.token!==";"&&(H[X]=z(M),X++);return new n(H)}function Z(M){if(M.token==="{"){B(M);var H,X={};do if(F(M),M.token!=="}"){if(M.token==='"'||M.token==="'")H=xr(M,M.token);else if(M.tokenType===w.SYMBOL||M.tokenType===w.DELIMITER&&M.token in A)H=M.token,F(M);else throw pe(M,"Symbol or string expected as object key");if(M.token!==":")throw pe(M,"Colon : expected after object key");F(M),X[H]=z(M)}while(M.token===",");if(M.token!=="}")throw pe(M,"Comma , or bracket } expected after object value");V(M),F(M);var xe=new p(X);return xe=qe(M,xe),xe}return ae(M)}function ae(M){var H;if(M.tokenType===w.NUMBER){H=M.token,F(M);var X=Dt(H,o),xe=t(H,X);return new f(xe)}return fe(M)}function fe(M){var H;if(M.token==="("){if(B(M),F(M),H=z(M),M.token!==")")throw pe(M,"Parenthesis ) expected");return V(M),F(M),H=new c(H),H=qe(M,H),H}return ve(M)}function ve(M){throw M.token===""?pe(M,"Unexpected end of expression"):pe(M,"Value expected")}function ge(M){return M.index-M.token.length+1}function pe(M,H){var X=ge(M),xe=new SyntaxError(H+" (char "+X+")");return xe.char=X,xe}function Re(M,H){var X=ge(M),xe=new SyntaxError(H+" (char "+X+")");return xe.char=X,xe}return r.addConversion({from:"string",to:"Node",convert:h}),h})});var IN,ij,jh,zN=T(()=>{je();U();IN="compile",ij=["typed","parse"],jh=O(IN,ij,e=>{var{typed:r,parse:t}=e;return r(IN,{string:function(a){return t(a).compile()},"Array | Matrix":function(a){return Oe(a,function(n){return t(n).compile()})}})})});var qN,fj,ev,UN=T(()=>{je();U();ta();qN="evaluate",fj=["typed","parse"],ev=O(qN,fj,e=>{var{typed:r,parse:t}=e;return r(qN,{string:function(a){var n=Ra();return t(a).compile().evaluate(n)},"string, Map | Object":function(a,n){return t(a).compile().evaluate(n)},"Array | Matrix":function(a){var n=Ra();return Oe(a,function(i){return t(i).compile().evaluate(n)})},"Array | Matrix, Map | Object":function(a,n){return Oe(a,function(i){return t(i).compile().evaluate(n)})}})})});var uj,sj,rv,HN=T(()=>{U();ta();uj="Parser",sj=["evaluate","parse"],rv=O(uj,sj,e=>{var{evaluate:r,parse:t}=e;function o(){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:Ra(),writable:!1})}o.prototype.type="Parser",o.prototype.isParser=!0,o.prototype.evaluate=function(n){return r(n,this.scope)},o.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},o.prototype.getAll=function(){return Sb(this.scope)},o.prototype.getAllAsMap=function(){return this.scope};function a(n){if(n.length===0)return!1;for(var i=0;i<n.length;i++){var u=n.charAt(i-1),l=n.charAt(i),f=n.charAt(i+1),s=t.isAlpha(l,u,f)||i>0&&t.isDigit(l);if(!s)return!1}return!0}return o.prototype.set=function(n,i){if(!a(n))throw new Error("Invalid variable name: '".concat(n,"'. Variable names must follow the specified rules."));return this.scope.set(n,i),i},o.prototype.remove=function(n){this.scope.delete(n)},o.prototype.clear=function(){this.scope.clear()},o},{isClass:!0})});var WN,lj,tv,VN=T(()=>{U();WN="parser",lj=["typed","Parser"],tv=O(WN,lj,e=>{var{typed:r,Parser:t}=e;return r(WN,{"":function(){return new t}})})});var GN,dj,ov,$N=T(()=>{lr();U();GN="lup",dj=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],ov=O(GN,dj,e=>{var{typed:r,matrix:t,abs:o,addScalar:a,divideScalar:n,multiplyScalar:i,subtractScalar:u,larger:l,equalScalar:f,unaryMinus:s,DenseMatrix:d,SparseMatrix:m,Spa:p}=e;return r(GN,{DenseMatrix:function(y){return x(y)},SparseMatrix:function(y){return c(y)},Array:function(y){var b=t(y),h=x(b);return{L:h.L.valueOf(),U:h.U.valueOf(),p:h.p}}});function x(v){var y=v._size[0],b=v._size[1],h=Math.min(y,b),S=Pe(v._data),w=[],g=[y,h],A=[],C=[h,b],D,N,E,_=[];for(D=0;D<y;D++)_[D]=D;for(N=0;N<b;N++){if(N>0)for(D=0;D<y;D++){var L=Math.min(D,N),P=0;for(E=0;E<L;E++)P=a(P,i(S[D][E],S[E][N]));S[D][N]=u(S[D][N],P)}var k=N,R=0,F=0;for(D=N;D<y;D++){var I=S[D][N],B=o(I);l(B,R)&&(k=D,R=B,F=I)}if(N!==k&&(_[N]=[_[k],_[k]=_[N]][0],d._swapRows(N,k,S)),N<y)for(D=N+1;D<y;D++){var V=S[D][N];f(V,0)||(S[D][N]=n(S[D][N],F))}}for(N=0;N<b;N++)for(D=0;D<y;D++){if(N===0&&(D<b&&(A[D]=[]),w[D]=[]),D<N){D<b&&(A[D][N]=S[D][N]),N<y&&(w[D][N]=0);continue}if(D===N){D<b&&(A[D][N]=S[D][N]),N<y&&(w[D][N]=1);continue}D<b&&(A[D][N]=0),N<y&&(w[D][N]=S[D][N])}var J=new d({data:w,size:g}),K=new d({data:A,size:C}),z=[];for(D=0,h=_.length;D<h;D++)z[_[D]]=D;return{L:J,U:K,p:z,toString:function(){return"L: "+this.L.toString()+`
25
+ U: `+this.U.toString()+`
26
+ P: `+this.p}}}function c(v){var y=v._size[0],b=v._size[1],h=Math.min(y,b),S=v._values,w=v._index,g=v._ptr,A=[],C=[],D=[],N=[y,h],E=[],_=[],L=[],P=[h,b],k,R,F,I=[],B=[];for(k=0;k<y;k++)I[k]=k,B[k]=k;var V=function(z,j){var ue=B[z],ee=B[j];I[ue]=j,I[ee]=z,B[z]=ee,B[j]=ue},J=function(){var z=new p;R<y&&(D.push(A.length),A.push(1),C.push(R)),L.push(E.length);var j=g[R],ue=g[R+1];for(F=j;F<ue;F++)k=w[F],z.set(I[k],S[F]);R>0&&z.forEach(0,R-1,function(W,Y){m._forEachRow(W,A,C,D,function(oe,re){oe>W&&z.accumulate(oe,s(i(re,Y)))})});var ee=R,ne=z.get(R),$=o(ne);z.forEach(R+1,y-1,function(W,Y){var oe=o(Y);l(oe,$)&&(ee=W,$=oe,ne=Y)}),R!==ee&&(m._swapRows(R,ee,N[1],A,C,D),m._swapRows(R,ee,P[1],E,_,L),z.swap(R,ee),V(R,ee)),z.forEach(0,y-1,function(W,Y){W<=R?(E.push(Y),_.push(W)):(Y=n(Y,ne),f(Y,0)||(A.push(Y),C.push(W)))})};for(R=0;R<b;R++)J();return L.push(E.length),D.push(A.length),{L:new m({values:A,index:C,ptr:D,size:N}),U:new m({values:E,index:_,ptr:L,size:P}),p:I,toString:function(){return"L: "+this.L.toString()+`
27
+ U: `+this.U.toString()+`
28
+ P: `+this.p}}}})});var KN,pj,av,QN=T(()=>{Oa();U();KN="qr",pj=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],av=O(KN,pj,e=>{var{typed:r,matrix:t,zeros:o,identity:a,isZero:n,equal:i,sign:u,sqrt:l,conj:f,unaryMinus:s,addScalar:d,divideScalar:m,multiplyScalar:p,subtractScalar:x,complex:c}=e;return Pr(r(KN,{DenseMatrix:function(S){return y(S)},SparseMatrix:function(S){return b(S)},Array:function(S){var w=t(S),g=y(w);return{Q:g.Q.valueOf(),R:g.R.valueOf()}}}),{_denseQRimpl:v});function v(h){var S=h._size[0],w=h._size[1],g=a([S],"dense"),A=g._data,C=h.clone(),D=C._data,N,E,_,L=o([S],"");for(_=0;_<Math.min(w,S);++_){var P=D[_][_],k=s(i(P,0)?1:u(P)),R=f(k),F=0;for(N=_;N<S;N++)F=d(F,p(D[N][_],f(D[N][_])));var I=p(k,l(F));if(!n(I)){var B=x(P,I);for(L[_]=1,N=_+1;N<S;N++)L[N]=m(D[N][_],B);var V=s(f(m(B,I))),J=void 0;for(E=_;E<w;E++){for(J=0,N=_;N<S;N++)J=d(J,p(f(L[N]),D[N][E]));for(J=p(J,V),N=_;N<S;N++)D[N][E]=p(x(D[N][E],p(L[N],J)),R)}for(N=0;N<S;N++){for(J=0,E=_;E<S;E++)J=d(J,p(A[N][E],L[E]));for(J=p(J,V),E=_;E<S;++E)A[N][E]=m(x(A[N][E],p(J,f(L[E]))),R)}}}return{Q:g,R:C,toString:function(){return"Q: "+this.Q.toString()+`
29
+ R: `+this.R.toString()}}}function y(h){var S=v(h),w=S.R._data;if(h._data.length>0)for(var g=w[0][0].type==="Complex"?c(0):0,A=0;A<w.length;++A)for(var C=0;C<A&&C<(w[0]||[]).length;++C)w[A][C]=g;return S}function b(h){throw new Error("qr not implemented for sparse matrices yet")}})});function ZN(e,r,t,o){for(var a=e._values,n=e._index,i=e._ptr,u=e._size,l=e._datatype,f=u[0],s=u[1],d=o&&e._values?[]:null,m=[],p=[],x=0,c=0;c<s;c++){p[c]=x;for(var v=t?t[c]:c,y=i[v],b=i[v+1],h=y;h<b;h++){var S=r?r[n[h]]:n[h];m[x]=S,d&&(d[x]=a[h]),x++}}return p[s]=x,e.createSparseMatrix({values:d,index:m,ptr:p,size:[f,s],datatype:l})}var YN=T(()=>{});function $s(e,r,t,o,a,n,i){var u=0;for(t[i]=e;u>=0;){var l=t[i+u],f=t[o+l];f===-1?(u--,n[r++]=l):(t[o+l]=t[a+f],++u,t[i+u]=f)}return r}var nv=T(()=>{});function XN(e,r){if(!e)return null;var t=0,o,a=[],n=[],i=0,u=r,l=2*r;for(o=0;o<r;o++)n[i+o]=-1;for(o=r-1;o>=0;o--)e[o]!==-1&&(n[u+o]=n[i+e[o]],n[i+e[o]]=o);for(o=0;o<r;o++)e[o]===-1&&(t=$s(o,t,n,i,u,a,l));return a}var JN=T(()=>{nv()});function jN(e,r){if(!e)return null;var t=e._index,o=e._ptr,a=e._size,n=a[0],i=a[1],u=[],l=[],f=0,s=i,d,m;if(r)for(d=0;d<n;d++)l[s+d]=-1;for(var p=0;p<i;p++){u[p]=-1,l[f+p]=-1;for(var x=o[p],c=o[p+1],v=x;v<c;v++){var y=t[v];for(d=r?l[s+y]:y;d!==-1&&d<p;d=m)m=l[f+d],l[f+d]=p,m===-1&&(u[d]=p);r&&(l[s+y]=p)}}return u}var eM=T(()=>{});function rM(e,r,t){for(var o=e._values,a=e._index,n=e._ptr,i=e._size,u=i[1],l=0,f=0;f<u;f++){var s=n[f];for(n[f]=l;s<n[f+1];s++)r(a[s],f,o?o[s]:1,t)&&(a[l]=a[s],o&&(o[l]=o[s]),l++)}return n[u]=l,a.splice(l,a.length-l),o&&o.splice(l,o.length-l),l}var tM=T(()=>{});function ko(e){return-e-2}var Ks=T(()=>{});var mj,cj,oM,aM=T(()=>{U();tM();Ks();nv();mj="csAmd",cj=["add","multiply","transpose"],oM=O(mj,cj,e=>{var{add:r,multiply:t,transpose:o}=e;return function(s,d){if(!d||s<=0||s>3)return null;var m=d._size,p=m[0],x=m[1],c=0,v=Math.max(16,10*Math.sqrt(x));v=Math.min(x-2,v);var y=a(s,d,p,x,v);rM(y,l,null);for(var b=y._index,h=y._ptr,S=h[x],w=[],g=[],A=0,C=x+1,D=2*(x+1),N=3*(x+1),E=4*(x+1),_=5*(x+1),L=6*(x+1),P=7*(x+1),k=w,R=n(x,h,g,A,N,k,D,P,C,L,E,_),F=i(x,h,g,_,E,L,v,C,N,k,D),I=0,B,V,J,K,z,j,ue,ee,ne,$,W,Y,oe,re,le,se;F<x;){for(J=-1;I<x&&(J=g[N+I])===-1;I++);g[D+J]!==-1&&(k[g[D+J]]=-1),g[N+I]=g[D+J];var q=g[E+J],G=g[C+J];F+=G;var te=0;g[C+J]=-G;var ie=h[J],de=q===0?ie:S,he=de;for(K=1;K<=q+1;K++){for(K>q?(j=J,ue=ie,ee=g[A+J]-q):(j=b[ie++],ue=h[j],ee=g[A+j]),z=1;z<=ee;z++)B=b[ue++],!((ne=g[C+B])<=0)&&(te+=ne,g[C+B]=-ne,b[he++]=B,g[D+B]!==-1&&(k[g[D+B]]=k[B]),k[B]!==-1?g[D+k[B]]=g[D+B]:g[N+g[_+B]]=g[D+B]);j!==J&&(h[j]=ko(J),g[L+j]=0)}for(q!==0&&(S=he),g[_+J]=te,h[J]=de,g[A+J]=he-de,g[E+J]=-2,R=u(R,c,g,L,x),$=de;$<he;$++)if(B=b[$],!((W=g[E+B])<=0)){ne=-g[C+B];var De=R-ne;for(ie=h[B],Y=h[B]+W-1;ie<=Y;ie++)j=b[ie],g[L+j]>=R?g[L+j]-=ne:g[L+j]!==0&&(g[L+j]=g[_+j]+De)}for($=de;$<he;$++){for(B=b[$],Y=h[B],oe=Y+g[E+B]-1,re=Y,le=0,se=0,ie=Y;ie<=oe;ie++)if(j=b[ie],g[L+j]!==0){var Ne=g[L+j]-R;Ne>0?(se+=Ne,b[re++]=j,le+=j):(h[j]=ko(J),g[L+j]=0)}g[E+B]=re-Y+1;var Xe=re,qe=Y+g[A+B];for(ie=oe+1;ie<qe;ie++){V=b[ie];var yr=g[C+V];yr<=0||(se+=yr,b[re++]=V,le+=V)}se===0?(h[B]=ko(J),ne=-g[C+B],te-=ne,G+=ne,F+=ne,g[C+B]=0,g[E+B]=-1):(g[_+B]=Math.min(g[_+B],se),b[re]=b[Xe],b[Xe]=b[Y],b[Y]=J,g[A+B]=re-Y+1,le=(le<0?-le:le)%x,g[D+B]=g[P+le],g[P+le]=B,k[B]=le)}for(g[_+J]=te,c=Math.max(c,te),R=u(R+c,c,g,L,x),$=de;$<he;$++)if(B=b[$],!(g[C+B]>=0))for(le=k[B],B=g[P+le],g[P+le]=-1;B!==-1&&g[D+B]!==-1;B=g[D+B],R++){for(ee=g[A+B],W=g[E+B],ie=h[B]+1;ie<=h[B]+ee-1;ie++)g[L+b[ie]]=R;var xr=B;for(V=g[D+B];V!==-1;){var kr=g[A+V]===ee&&g[E+V]===W;for(ie=h[V]+1;kr&&ie<=h[V]+ee-1;ie++)g[L+b[ie]]!==R&&(kr=0);kr?(h[V]=ko(B),g[C+B]+=g[C+V],g[C+V]=0,g[E+V]=-1,V=g[D+V],g[D+xr]=V):(xr=V,V=g[D+V])}}for(ie=de,$=de;$<he;$++)B=b[$],!((ne=-g[C+B])<=0)&&(g[C+B]=ne,se=g[_+B]+te-ne,se=Math.min(se,x-F-ne),g[N+se]!==-1&&(k[g[N+se]]=B),g[D+B]=g[N+se],k[B]=-1,g[N+se]=B,I=Math.min(I,se),g[_+B]=se,b[ie++]=B);g[C+J]=G,(g[A+J]=ie-de)===0&&(h[J]=-1,g[L+J]=0),q!==0&&(S=ie)}for(B=0;B<x;B++)h[B]=ko(h[B]);for(V=0;V<=x;V++)g[N+V]=-1;for(V=x;V>=0;V--)g[C+V]>0||(g[D+V]=g[N+h[V]],g[N+h[V]]=V);for(j=x;j>=0;j--)g[C+j]<=0||h[j]!==-1&&(g[D+j]=g[N+h[j]],g[N+h[j]]=j);for(J=0,B=0;B<=x;B++)h[B]===-1&&(J=$s(B,J,g,N,D,w,L));return w.splice(w.length-1,1),w};function a(f,s,d,m,p){var x=o(s);if(f===1&&m===d)return r(s,x);if(f===2){for(var c=x._index,v=x._ptr,y=0,b=0;b<d;b++){var h=v[b];if(v[b]=y,!(v[b+1]-h>p))for(var S=v[b+1];h<S;h++)c[y++]=c[h]}return v[d]=y,s=o(x),t(x,s)}return t(x,s)}function n(f,s,d,m,p,x,c,v,y,b,h,S){for(var w=0;w<f;w++)d[m+w]=s[w+1]-s[w];d[m+f]=0;for(var g=0;g<=f;g++)d[p+g]=-1,x[g]=-1,d[c+g]=-1,d[v+g]=-1,d[y+g]=1,d[b+g]=1,d[h+g]=0,d[S+g]=d[m+g];var A=u(0,0,d,b,f);return d[h+f]=-2,s[f]=-1,d[b+f]=0,A}function i(f,s,d,m,p,x,c,v,y,b,h){for(var S=0,w=0;w<f;w++){var g=d[m+w];if(g===0)d[p+w]=-2,S++,s[w]=-1,d[x+w]=0;else if(g>c)d[v+w]=0,d[p+w]=-1,S++,s[w]=ko(f),d[v+f]++;else{var A=d[y+g];A!==-1&&(b[A]=w),d[h+w]=d[y+g],d[y+g]=w}}return S}function u(f,s,d,m,p){if(f<2||f+s<0){for(var x=0;x<p;x++)d[m+x]!==0&&(d[m+x]=1);f=2}return f}function l(f,s){return f!==s}})});function nM(e,r,t,o,a,n,i){var u,l,f=0,s;if(e<=r||t[o+r]<=t[a+e])return-1;t[a+e]=t[o+r];var d=t[n+e];if(t[n+e]=r,d===-1)f=1,s=e;else{for(f=2,s=d;s!==t[i+s];s=t[i+s]);for(u=d;u!==s;u=l)l=t[i+u],t[i+u]=s}return{jleaf:f,q:s}}var iM=T(()=>{});var xj,hj,fM,uM=T(()=>{U();iM();xj="csCounts",hj=["transpose"],fM=O(xj,hj,e=>{var{transpose:r}=e;return function(t,o,a,n){if(!t||!o||!a)return null;var i=t._size,u=i[0],l=i[1],f,s,d,m,p,x,c,v=4*l+(n?l+u+1:0),y=[],b=0,h=l,S=2*l,w=3*l,g=4*l,A=5*l+1;for(d=0;d<v;d++)y[d]=-1;var C=[],D=r(t),N=D._index,E=D._ptr;for(d=0;d<l;d++)for(s=a[d],C[s]=y[w+s]===-1?1:0;s!==-1&&y[w+s]===-1;s=o[s])y[w+s]=d;if(n){for(d=0;d<l;d++)y[a[d]]=d;for(f=0;f<u;f++){for(d=l,x=E[f],c=E[f+1],p=x;p<c;p++)d=Math.min(d,y[N[p]]);y[A+f]=y[g+d],y[g+d]=f}}for(f=0;f<l;f++)y[b+f]=f;for(d=0;d<l;d++){for(s=a[d],o[s]!==-1&&C[o[s]]--,m=n?y[g+d]:s;m!==-1;m=n?y[A+m]:-1)for(p=E[m];p<E[m+1];p++){f=N[p];var _=nM(f,s,y,w,h,S,b);_.jleaf>=1&&C[s]++,_.jleaf===2&&C[_.q]--}o[s]!==-1&&(y[b+s]=o[s])}for(s=0;s<l;s++)o[s]!==-1&&(C[o[s]]+=C[s]);return C}})});var vj,gj,sM,lM=T(()=>{YN();JN();eM();aM();uM();U();vj="csSqr",gj=["add","multiply","transpose"],sM=O(vj,gj,e=>{var{add:r,multiply:t,transpose:o}=e,a=oM({add:r,multiply:t,transpose:o}),n=fM({transpose:o});return function(l,f,s){var d=f._ptr,m=f._size,p=m[1],x,c={};if(c.q=a(l,f),l&&!c.q)return null;if(s){var v=l?ZN(f,null,c.q,0):f;c.parent=jN(v,1);var y=XN(c.parent,p);if(c.cp=n(v,c.parent,y,1),v&&c.parent&&c.cp&&i(v,c))for(c.unz=0,x=0;x<p;x++)c.unz+=c.cp[x]}else c.unz=4*d[p]+p,c.lnz=c.unz;return c};function i(u,l){var f=u._ptr,s=u._index,d=u._size,m=d[0],p=d[1];l.pinv=[],l.leftmost=[];var x=l.parent,c=l.pinv,v=l.leftmost,y=[],b=0,h=m,S=m+p,w=m+2*p,g,A,C,D,N;for(A=0;A<p;A++)y[h+A]=-1,y[S+A]=-1,y[w+A]=0;for(g=0;g<m;g++)v[g]=-1;for(A=p-1;A>=0;A--)for(D=f[A],N=f[A+1],C=D;C<N;C++)v[s[C]]=A;for(g=m-1;g>=0;g--)c[g]=-1,A=v[g],A!==-1&&(y[w+A]++===0&&(y[S+A]=g),y[b+g]=y[h+A],y[h+A]=g);for(l.lnz=0,l.m2=m,A=0;A<p;A++)if(g=y[h+A],l.lnz++,g<0&&(g=l.m2++),c[g]=A,!(--w[A]<=0)){l.lnz+=y[w+A];var E=x[A];E!==-1&&(y[w+E]===0&&(y[S+E]=y[S+A]),y[b+y[S+A]]=y[h+E],y[h+E]=y[b+g],y[w+E]+=y[w+A])}for(g=0;g<m;g++)c[g]<0&&(c[g]=A++);return!0}})});function kf(e,r){return e[r]<0}var iv=T(()=>{});function Qs(e,r){e[r]=ko(e[r])}var fv=T(()=>{Ks()});function uv(e){return e<0?ko(e):e}var dM=T(()=>{Ks()});function pM(e,r,t,o,a){var n=r._index,i=r._ptr,u=r._size,l=u[1],f,s,d,m=0;for(o[0]=e;m>=0;){e=o[m];var p=a?a[e]:e;kf(i,e)||(Qs(i,e),o[l+m]=p<0?0:uv(i[p]));var x=1;for(s=o[l+m],d=p<0?0:uv(i[p+1]);s<d;s++)if(f=n[s],!kf(i,f)){o[l+m]=s,o[++m]=f,x=0;break}x&&(m--,o[--t]=e)}return t}var mM=T(()=>{iv();fv();dM()});function cM(e,r,t,o,a){var n=e._ptr,i=e._size,u=r._index,l=r._ptr,f=i[1],s,d,m,p=f;for(d=l[t],m=l[t+1],s=d;s<m;s++){var x=u[s];kf(n,x)||(p=pM(x,e,p,o,a))}for(s=p;s<f;s++)Qs(n,o[s]);return p}var xM=T(()=>{iv();fv();mM()});var yj,Sj,hM,vM=T(()=>{xM();U();yj="csSpsolve",Sj=["divideScalar","multiply","subtract"],hM=O(yj,Sj,e=>{var{divideScalar:r,multiply:t,subtract:o}=e;return function(n,i,u,l,f,s,d){var m=n._values,p=n._index,x=n._ptr,c=n._size,v=c[1],y=i._values,b=i._index,h=i._ptr,S,w,g,A,C=cM(n,i,u,l,s);for(S=C;S<v;S++)f[l[S]]=0;for(w=h[u],g=h[u+1],S=w;S<g;S++)f[b[S]]=y[S];for(var D=C;D<v;D++){var N=l[D],E=s?s[N]:N;if(!(E<0))for(w=x[E],g=x[E+1],f[N]=r(f[N],m[d?w:g-1]),S=d?w+1:w,A=d?g:g-1;S<A;S++){var _=p[S];f[_]=o(f[_],t(m[S],f[N]))}}return C}})});var wj,Tj,gM,yM=T(()=>{U();vM();wj="csLu",Tj=["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"],gM=O(wj,Tj,e=>{var{abs:r,divideScalar:t,multiply:o,subtract:a,larger:n,largerEq:i,SparseMatrix:u}=e,l=hM({divideScalar:t,multiply:o,subtract:a});return function(s,d,m){if(!s)return null;var p=s._size,x=p[1],c,v=100,y=100;d&&(c=d.q,v=d.lnz||v,y=d.unz||y);var b=[],h=[],S=[],w=new u({values:b,index:h,ptr:S,size:[x,x]}),g=[],A=[],C=[],D=new u({values:g,index:A,ptr:C,size:[x,x]}),N=[],E,_,L=[],P=[];for(E=0;E<x;E++)L[E]=0,N[E]=-1,S[E+1]=0;v=0,y=0;for(var k=0;k<x;k++){S[k]=v,C[k]=y;var R=c?c[k]:k,F=l(w,s,R,P,L,N,1),I=-1,B=-1;for(_=F;_<x;_++)if(E=P[_],N[E]<0){var V=r(L[E]);n(V,B)&&(B=V,I=E)}else A[y]=N[E],g[y++]=L[E];if(I===-1||B<=0)return null;N[R]<0&&i(r(L[R]),o(B,m))&&(I=R);var J=L[I];for(A[y]=k,g[y++]=J,N[I]=k,h[v]=I,b[v++]=1,_=F;_<x;_++)E=P[_],N[E]<0&&(h[v]=E,b[v++]=t(L[E],J)),L[E]=0}for(S[x]=v,C[x]=y,_=0;_<v;_++)h[_]=N[h[_]];return b.splice(v,b.length-v),h.splice(v,h.length-v),g.splice(y,g.length-y),A.splice(y,A.length-y),{L:w,U:D,pinv:N}}})});var SM,bj,sv,wM=T(()=>{He();U();lM();yM();SM="slu",bj=["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"],sv=O(SM,bj,e=>{var{typed:r,abs:t,add:o,multiply:a,transpose:n,divideScalar:i,subtract:u,larger:l,largerEq:f,SparseMatrix:s}=e,d=sM({add:o,multiply:a,transpose:n}),m=gM({abs:t,divideScalar:i,multiply:a,subtract:u,larger:l,largerEq:f,SparseMatrix:s});return r(SM,{"SparseMatrix, number, number":function(x,c,v){if(!be(c)||c<0||c>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(v<0||v>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var y=d(c,x,!1),b=m(x,y,v);return{L:b.L,U:b.U,p:b.pinv,q:y.q,toString:function(){return"L: "+this.L.toString()+`
30
+ U: `+this.U.toString()+`
31
+ p: `+this.p.toString()+(this.q?`
32
+ q: `+this.q.toString():"")+`
33
+ `}}}})})});function lv(e,r){var t,o=r.length,a=[];if(e)for(t=0;t<o;t++)a[e[t]]=r[t];else for(t=0;t<o;t++)a[t]=r[t];return a}var TM=T(()=>{});var bM,Dj,dv,DM=T(()=>{Se();U();si();TM();bM="lusolve",Dj=["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],dv=O(bM,Dj,e=>{var{typed:r,matrix:t,lup:o,slu:a,usolve:n,lsolve:i,DenseMatrix:u}=e,l=Zo({DenseMatrix:u});return r(bM,{"Array, Array | Matrix":function(m,p){m=t(m);var x=o(m),c=s(x.L,x.U,x.p,null,p);return c.valueOf()},"DenseMatrix, Array | Matrix":function(m,p){var x=o(m);return s(x.L,x.U,x.p,null,p)},"SparseMatrix, Array | Matrix":function(m,p){var x=o(m);return s(x.L,x.U,x.p,null,p)},"SparseMatrix, Array | Matrix, number, number":function(m,p,x,c){var v=a(m,x,c);return s(v.L,v.U,v.p,v.q,p)},"Object, Array | Matrix":function(m,p){return s(m.L,m.U,m.p,m.q,p)}});function f(d){if(Ae(d))return d;if(fr(d))return t(d);throw new TypeError("Invalid Matrix LU decomposition")}function s(d,m,p,x,c){d=f(d),m=f(m),p&&(c=l(d,c,!0),c._data=lv(p,c._data));var v=i(d,c),y=n(m,v);return x&&(y._data=lv(x,y._data)),y}})});var AM,Aj,pv,OM=T(()=>{U();AM="polynomialRoot",Aj=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],pv=O(AM,Aj,e=>{var{typed:r,isZero:t,equalScalar:o,add:a,subtract:n,multiply:i,divide:u,sqrt:l,unaryMinus:f,cbrt:s,typeOf:d,im:m,re:p}=e;return r(AM,{"number|Complex, ...number|Complex":(x,c)=>{for(var v=[x,...c];v.length>0&&t(v[v.length-1]);)v.pop();if(v.length<2)throw new RangeError("Polynomial [".concat(x,", ").concat(c,"] must have a non-zero non-constant coefficient"));switch(v.length){case 2:return[f(u(v[0],v[1]))];case 3:{var[y,b,h]=v,S=i(2,h),w=i(b,b),g=i(4,h,y);if(o(w,g))return[u(f(b),S)];var A=l(n(w,g));return[u(n(A,b),S),u(n(f(A),b),S)]}case 4:{var[C,D,N,E]=v,_=f(i(3,E)),L=i(N,N),P=i(3,E,D),k=a(i(2,N,N,N),i(27,E,E,C)),R=i(9,E,N,D);if(o(L,P)&&o(k,R))return[u(N,_)];var F=n(L,P),I=n(k,R),B=a(i(18,E,N,D,C),i(N,N,D,D)),V=a(i(4,N,N,N,C),i(4,E,D,D,D),i(27,E,E,C,C));if(o(B,V))return[u(n(i(4,E,N,D),a(i(9,E,E,C),i(N,N,N))),i(E,F)),u(n(i(9,E,C),i(N,D)),i(2,F))];var J;o(L,P)?J=I:J=u(a(I,l(n(i(I,I),i(4,F,F,F)))),2);var K=!0,z=s(J,K).toArray().map(j=>u(a(N,j,u(F,j)),_));return z.map(j=>d(j)==="Complex"&&o(p(j),p(j)+m(j))?p(j):j)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(v))}}})})});var Oj,Cj,mv,CM=T(()=>{Se();lr();Er();U();Oj="Help",Cj=["evaluate"],mv=O(Oj,Cj,e=>{var{evaluate:r}=e;function t(o){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(!o)throw new Error('Argument "doc" missing');this.doc=o}return t.prototype.type="Help",t.prototype.isHelp=!0,t.prototype.toString=function(){var o=this.doc||{},a=`
34
+ `;if(o.name&&(a+="Name: "+o.name+`
35
+
36
+ `),o.category&&(a+="Category: "+o.category+`
37
+
38
+ `),o.description&&(a+=`Description:
39
+ `+o.description+`
40
+
41
+ `),o.syntax&&(a+=`Syntax:
42
+ `+o.syntax.join(`
43
+ `)+`
44
+
45
+ `),o.examples){a+=`Examples:
46
+ `;for(var n=!1,i=r("config()"),u={config:d=>(n=!0,r("config(newConfig)",{newConfig:d}))},l=0;l<o.examples.length;l++){var f=o.examples[l];a+=" "+f+`
47
+ `;var s=void 0;try{s=r(f,u)}catch(d){s=d}s!==void 0&&!Fu(s)&&(a+=" "+Ie(s,{precision:14})+`
48
+ `)}a+=`
49
+ `,n&&r("config(originalConfig)",{originalConfig:i})}return o.mayThrow&&o.mayThrow.length&&(a+="Throws: "+o.mayThrow.join(", ")+`
50
+
51
+ `),o.seealso&&o.seealso.length&&(a+="See also: "+o.seealso.join(", ")+`
52
+ `),a},t.prototype.toJSON=function(){var o=Pe(this.doc);return o.mathjs="Help",o},t.fromJSON=function(o){var a={};return Object.keys(o).filter(n=>n!=="mathjs").forEach(n=>{a[n]=o[n]}),new t(a)},t.prototype.valueOf=t.prototype.toString,t},{isClass:!0})});var Rj,Nj,cv,RM=T(()=>{Se();Er();lr();U();Rj="Chain",Nj=["?on","math","typed"],cv=O(Rj,Nj,e=>{var{on:r,math:t,typed:o}=e;function a(f){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");Bu(f)?this.value=f.value:this.value=f}a.prototype.type="Chain",a.prototype.isChain=!0,a.prototype.done=function(){return this.value},a.prototype.valueOf=function(){return this.value},a.prototype.toString=function(){return Ie(this.value)},a.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},a.fromJSON=function(f){return new a(f.value)};function n(f,s){typeof s=="function"&&(a.prototype[f]=u(s))}function i(f,s){Bb(a.prototype,f,function(){var m=s();if(typeof m=="function")return u(m)})}function u(f){return function(){if(arguments.length===0)return new a(f(this.value));for(var s=[this.value],d=0;d<arguments.length;d++)s[d+1]=arguments[d];if(o.isTypedFunction(f)){var m=o.resolve(f,s);if(m.params.length===1)throw new Error("chain function "+f.name+" cannot match rest parameter between chain value and additional arguments.");return new a(m.implementation.apply(f,s))}return new a(f.apply(f,s))}}a.createProxy=function(f,s){if(typeof f=="string")n(f,s);else{var d=function(x){Me(f,x)&&l[x]===void 0&&i(x,()=>f[x])};for(var m in f)d(m)}};var l={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return a.createProxy(t),r&&r("import",function(f,s,d){d||i(f,s)}),a},{isClass:!0})});var xv,NM=T(()=>{xv={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"]}});var MM,EM=T(()=>{MM={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]}});var FM,BM=T(()=>{FM={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:[]}});var _M,PM=T(()=>{_M={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:[]}});var kM,LM=T(()=>{kM={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]}});var IM,zM=T(()=>{IM={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]}});var qM,UM=T(()=>{qM={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:[]}});var HM,WM=T(()=>{HM={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:[]}});var VM,GM=T(()=>{VM={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]}});var $M,KM=T(()=>{$M={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]}});var QM,ZM=T(()=>{QM={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:[]}});var hv,YM=T(()=>{hv={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"]}});var XM,JM=T(()=>{XM={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:[]}});var jM,eE=T(()=>{jM={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]}});var rE,tE=T(()=>{rE={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"]}});var oE,aE=T(()=>{oE={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]}});var nE,iE=T(()=>{nE={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]}});var fE,uE=T(()=>{fE={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","bigint","complex","fraction","index","matrix","string","unit"]}});var sE,lE=T(()=>{sE={name:"bigint",category:"Construction",syntax:["bigint(x)"],description:"Create a bigint, an integer with an arbitrary number of digits, from a number or string.",examples:["123123123123123123 # a large number will lose digits",'bigint("123123123123123123")','bignumber(["1", "3", "5"])'],seealso:["boolean","bignumber","number","complex","fraction","index","matrix","string","unit"]}});var dE,pE=T(()=>{dE={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"]}});var mE,cE=T(()=>{mE={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"]}});var xE,hE=T(()=>{xE={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"]}});var vE,gE=T(()=>{vE={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]}});var yE,SE=T(()=>{yE={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]}});var wE,TE=T(()=>{wE={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"]}});var bE,DE=T(()=>{bE={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","bigint","boolean","complex","fraction","index","matrix","string","unit"]}});var AE,OE=T(()=>{AE={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"]}});var CE,RE=T(()=>{CE={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"]}});var NE,ME=T(()=>{NE={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"]}});var EE,FE=T(()=>{EE={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"]}});var BE,_E=T(()=>{BE={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:[]}});var PE,kE=T(()=>{PE={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:[]}});var LE,IE=T(()=>{LE={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]}});var zE,qE=T(()=>{zE={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]}});var UE,HE=T(()=>{UE={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]}});var WE,VE=T(()=>{WE={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]}});var GE,$E=T(()=>{GE={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]}});var KE,QE=T(()=>{KE={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"]}});var ZE,YE=T(()=>{ZE={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"]}});var XE,JE=T(()=>{XE={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]}});var jE,eF=T(()=>{jE={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"]}});var rF,tF=T(()=>{rF={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"]}});var oF,aF=T(()=>{oF={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]}});var nF,iF=T(()=>{nF={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]}});var fF,uF=T(()=>{fF={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]}});var sF,lF=T(()=>{sF={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]}});var dF,pF=T(()=>{dF={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"]}});var mF,cF=T(()=>{mF={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]}});var xF,hF=T(()=>{xF={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]}});var vF,gF=T(()=>{vF={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]}});var yF,SF=T(()=>{yF={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]}});var wF,TF=T(()=>{wF={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"]}});var bF,DF=T(()=>{bF={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"]}});var AF,OF=T(()=>{AF={name:"ceil",category:"Arithmetic",syntax:["ceil(x)","ceil(x, n)","ceil(unit, valuelessUnit)","ceil(unit, n, valuelessUnit)"],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)","ceil(3.241cm, cm)","ceil(3.241cm, 2, cm)"],seealso:["floor","fix","round"]}});var CF,RF=T(()=>{CF={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"]}});var NF,MF=T(()=>{NF={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"]}});var EF,FF=T(()=>{EF={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"]}});var BF,_F=T(()=>{BF={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"]}});var PF,kF=T(()=>{PF={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"]}});var LF,IF=T(()=>{LF={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"]}});var zF,qF=T(()=>{zF={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"]}});var UF,HF=T(()=>{UF={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"]}});var WF,VF=T(()=>{WF={name:"fix",category:"Arithmetic",syntax:["fix(x)","fix(x, n)","fix(unit, valuelessUnit)","fix(unit, n, valuelessUnit)"],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)","fix(3.241cm, cm)","fix(3.241cm, 2, cm)"],seealso:["ceil","floor","round"]}});var GF,$F=T(()=>{GF={name:"floor",category:"Arithmetic",syntax:["floor(x)","floor(x, n)","floor(unit, valuelessUnit)","floor(unit, n, valuelessUnit)"],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)","floor(3.241cm, cm)","floor(3.241cm, 2, cm)"],seealso:["ceil","fix","round"]}});var KF,QF=T(()=>{KF={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"]}});var ZF,YF=T(()=>{ZF={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenuse of a list with values.",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]}});var XF,JF=T(()=>{XF={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \u2263 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]}});var jF,eB=T(()=>{jF={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"]}});var rB,tB=T(()=>{rB={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"]}});var oB,aB=T(()=>{oB={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"]}});var nB,iB=T(()=>{nB={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"]}});var fB,uB=T(()=>{fB={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"]}});var sB,lB=T(()=>{sB={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"]}});var dB,pB=T(()=>{dB={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"]}});var mB,cB=T(()=>{mB={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")']}});var xB,hB=T(()=>{xB={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"]}});var vB,gB=T(()=>{vB={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"]}});var yB,SB=T(()=>{yB={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]}});var wB,TB=T(()=>{wB={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]}});var bB,DB=T(()=>{bB={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>0, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]}});var AB,OB=T(()=>{AB={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"]}});var CB,RB=T(()=>{CB={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]}});var NB,MB=T(()=>{NB={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]}});var EB,FB=T(()=>{EB={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]}});var BB,_B=T(()=>{BB={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]}});var PB,kB=T(()=>{PB={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"]}});var LB,IB=T(()=>{LB={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"]}});var zB,qB=T(()=>{zB={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"]}});var UB,HB=T(()=>{UB={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]}});var WB,VB=T(()=>{WB={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"]}});var GB,$B=T(()=>{GB={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"]}});var KB,QB=T(()=>{KB={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"]}});var ZB,YB=T(()=>{ZB={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"]}});var XB,JB=T(()=>{XB={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"]}});var jB,e3=T(()=>{jB={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"]}});var r3,t3=T(()=>{r3={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"]}});var o3,a3=T(()=>{o3={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"]}});var n3,i3=T(()=>{n3={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"]}});var f3,u3=T(()=>{f3={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"]}});var s3,l3=T(()=>{s3={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"]}});var d3,p3=T(()=>{d3={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"]}});var m3,c3=T(()=>{m3={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"]}});var x3,h3=T(()=>{x3={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"]}});var v3,g3=T(()=>{v3={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"]}});var y3,S3=T(()=>{y3={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"]}});var w3,T3=T(()=>{w3={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]}});var b3,D3=T(()=>{b3={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]}});var A3,O3=T(()=>{A3={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:[]}});var C3,R3=T(()=>{C3={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:[]}});var N3,M3=T(()=>{N3={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"]}});var E3,F3=T(()=>{E3={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"]}});var B3,_3=T(()=>{B3={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"]}});var P3,k3=T(()=>{P3={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"]}});var L3,I3=T(()=>{L3={name:"mapSlices",category:"Matrix",syntax:["mapSlices(A, dim, callback)"],description:"Generate a matrix one dimension less than A by applying callback to each slice of A along dimension dim.",examples:["A = [[1, 2], [3, 4]]","mapSlices(A, 1, sum)","mapSlices(A, 2, product)"],seealso:["map","forEach"]}});var z3,q3=T(()=>{z3={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]}});var U3,H3=T(()=>{U3={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"]}});var W3,V3=T(()=>{W3={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]}});var G3,$3=T(()=>{G3={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"]}});var K3,Q3=T(()=>{K3={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]}});var Z3,Y3=T(()=>{Z3={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"]}});var X3,J3=T(()=>{X3={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"]}});var j3,e4=T(()=>{j3={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]}});var r4,t4=T(()=>{r4={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"]}});var o4,a4=T(()=>{o4={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]}});var n4,i4=T(()=>{n4={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"]}});var f4,u4=T(()=>{f4={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"]}});var s4,l4=T(()=>{s4={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]}});var d4,p4=T(()=>{d4={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"]}});var m4,c4=T(()=>{m4={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"]}});var x4,h4=T(()=>{x4={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"]}});var v4,g4=T(()=>{v4={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore\u2013Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]}});var y4,S4=T(()=>{y4={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"]}});var w4,T4=T(()=>{w4={name:"map",category:"Matrix",syntax:["map(x, callback)","map(x, y, ..., callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.",examples:["map([1, 2, 3], square)","map([1, 2], [3, 4], f(a,b) = a + b)"],seealso:["filter","forEach"]}});var b4,D4=T(()=>{b4={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]}});var A4,O4=T(()=>{A4={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]}});var C4,R4=T(()=>{C4={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]}});var N4,M4=T(()=>{N4={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"]}});var E4,F4=T(()=>{E4={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]}});var B4,_4=T(()=>{B4={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]}});var P4,k4=T(()=>{P4={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]}});var L4,I4=T(()=>{L4={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"]}});var z4,q4=T(()=>{z4={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]}});var U4,H4=T(()=>{U4={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]}});var W4,V4=T(()=>{W4={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]}});var G4,$4=T(()=>{G4={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]}});var K4,Q4=T(()=>{K4={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]}});var Z4,Y4=T(()=>{Z4={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"]}});var X4,J4=T(()=>{X4={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]}});var j4,e8=T(()=>{j4={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"]}});var r8,t8=T(()=>{r8={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"]}});var o8,a8=T(()=>{o8={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"]}});var n8,i8=T(()=>{n8={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional Fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]}});var f8,u8=T(()=>{f8={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse Fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]}});var s8,l8=T(()=>{s8={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]}});var d8,p8=T(()=>{d8={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]}});var m8,c8=T(()=>{m8={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]}});var x8,h8=T(()=>{x8={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"]}});var v8,g8=T(()=>{v8={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]}});var y8,S8=T(()=>{y8={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:[]}});var w8,T8=T(()=>{w8={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"]}});var b8,D8=T(()=>{b8={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]}});var A8,O8=T(()=>{A8={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"]}});var C8,R8=T(()=>{C8={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"]}});var N8,M8=T(()=>{N8={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"]}});var E8,F8=T(()=>{E8={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"]}});var B8,_8=T(()=>{B8={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"]}});var P8,k8=T(()=>{P8={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"]}});var L8,I8=T(()=>{L8={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"]}});var z8,q8=T(()=>{z8={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"]}});var U8,H8=T(()=>{U8={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"]}});var W8,V8=T(()=>{W8={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"]}});var G8,$8=T(()=>{G8={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"]}});var K8,Q8=T(()=>{K8={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"]}});var Z8,Y8=T(()=>{Z8={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"]}});var X8,J8=T(()=>{X8={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"]}});var j8,e5=T(()=>{j8={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]}});var r5,t5=T(()=>{r5={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"]}});var o5,a5=T(()=>{o5={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"]}});var n5,i5=T(()=>{n5={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"]}});var f5,u5=T(()=>{f5={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"]}});var s5,l5=T(()=>{s5={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"]}});var d5,p5=T(()=>{d5={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"]}});var m5,c5=T(()=>{m5={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"]}});var x5,h5=T(()=>{x5={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"]}});var v5,g5=T(()=>{v5={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"]}});var y5,S5=T(()=>{y5={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]}});var w5,T5=T(()=>{w5={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]}});var b5,D5=T(()=>{b5={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:[]}});var A5,O5=T(()=>{A5={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemann's Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]}});var C5,R5=T(()=>{C5={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"]}});var N5,M5=T(()=>{N5={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]}});var E5,F5=T(()=>{E5={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]}});var B5,_5=T(()=>{B5={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]}});var P5,k5=T(()=>{P5={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]}});var L5,I5=T(()=>{L5={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]}});var z5,q5=T(()=>{z5={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]}});var U5,H5=T(()=>{U5={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 probability are: Number, BigNumber.
53
+
54
+ In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]}});var W5,V5=T(()=>{W5={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]}});var G5,$5=T(()=>{G5={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]}});var K5,Q5=T(()=>{K5={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]}});var Z5,Y5=T(()=>{Z5={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]}});var X5,J5=T(()=>{X5={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]}});var j5,e_=T(()=>{j5={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"]}});var r_,t_=T(()=>{r_={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"]}});var o_,a_=T(()=>{o_={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"]}});var n_,i_=T(()=>{n_={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the inverse hyperbolic tangent 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"]}});var f_,u_=T(()=>{f_={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"]}});var s_,l_=T(()=>{s_={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]}});var d_,p_=T(()=>{d_={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"]}});var m_,c_=T(()=>{m_={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]}});var x_,h_=T(()=>{x_={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"]}});var v_,g_=T(()=>{v_={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"]}});var y_,S_=T(()=>{y_={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"]}});var w_,T_=T(()=>{w_={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"]}});var b_,D_=T(()=>{b_={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"]}});var A_,O_=T(()=>{A_={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"]}});var C_,R_=T(()=>{C_={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]}});var N_,M_=T(()=>{N_={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"]}});var E_,F_=T(()=>{E_={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"]}});var B_,__=T(()=>{B_={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"]}});var P_,k_=T(()=>{P_={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"]}});var L_,I_=T(()=>{L_={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"]}});var z_,q_=T(()=>{z_={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"]}});var U_,H_=T(()=>{U_={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"]}});var W_,V_=T(()=>{W_={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]}});var G_,$_=T(()=>{G_={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"]}});var K_,Q_=T(()=>{K_={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"]}});var Z_,Y_=T(()=>{Z_={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:[]}});var X_,J_=T(()=>{X_={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]}});var j_,eP=T(()=>{j_={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:[]}});var rP,tP=T(()=>{rP={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"]}});var oP,aP=T(()=>{oP={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"]}});var nP,iP=T(()=>{nP={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]}});var fP,uP=T(()=>{fP={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"]}});var sP,lP=T(()=>{sP={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"]}});var dP,pP=T(()=>{dP={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"]}});var mP,cP=T(()=>{mP={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"]}});var xP,hP=T(()=>{xP={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"]}});var vP,gP=T(()=>{vP={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"]}});var yP,SP=T(()=>{yP={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"]}});var wP,TP=T(()=>{wP={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "bigint")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","bigint","fraction","bignumber","string","format"]}});var bP,DP=T(()=>{bP={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]}});var AP,OP=T(()=>{AP={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]}});var CP,RP=T(()=>{CP={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"]}});var NP,MP=T(()=>{NP={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]}});var EP,FP=T(()=>{NM();EM();BM();PM();LM();zM();UM();WM();GM();KM();ZM();YM();JM();eE();tE();aE();iE();uE();lE();pE();cE();hE();gE();SE();TE();DE();OE();RE();ME();FE();_E();kE();IE();qE();HE();VE();$E();QE();YE();JE();eF();tF();aF();iF();uF();lF();pF();cF();hF();gF();SF();TF();DF();OF();RF();MF();FF();_F();kF();IF();qF();HF();VF();$F();QF();YF();JF();eB();tB();aB();iB();uB();lB();pB();cB();hB();gB();SB();TB();DB();OB();RB();MB();FB();_B();kB();IB();qB();HB();VB();$B();QB();YB();JB();e3();t3();a3();i3();u3();l3();p3();c3();h3();g3();S3();T3();D3();O3();R3();M3();F3();_3();k3();I3();q3();H3();V3();$3();Q3();Y3();J3();e4();t4();a4();i4();u4();l4();p4();c4();h4();g4();S4();T4();D4();O4();R4();M4();F4();_4();k4();I4();q4();H4();V4();$4();Q4();Y4();J4();e8();t8();a8();i8();u8();l8();p8();c8();h8();g8();S8();T8();D8();O8();R8();M8();F8();_8();k8();I8();q8();H8();V8();$8();Q8();Y8();J8();e5();t5();a5();i5();u5();l5();p5();c5();h5();g5();S5();T5();D5();O5();R5();M5();F5();_5();k5();I5();q5();H5();V5();$5();Q5();Y5();J5();e_();t_();a_();i_();u_();l_();p_();c_();h_();g_();S_();T_();D_();O_();R_();M_();F_();__();k_();I_();q_();H_();V_();$_();Q_();Y_();J_();eP();tP();aP();iP();uP();lP();pP();cP();hP();gP();SP();TP();DP();OP();RP();MP();EP={bignumber:fE,bigint:sE,boolean:dE,complex:mE,createUnit:xE,fraction:vE,index:yE,matrix:wE,number:bE,sparse:AE,splitUnit:CE,string:NE,unit:EE,e:xv,E:xv,false:MM,i:FM,Infinity:_M,LN2:IM,LN10:kM,LOG2E:HM,LOG10E:qM,NaN:VM,null:$M,pi:hv,PI:hv,phi:QM,SQRT1_2:XM,SQRT2:jM,tau:rE,true:oE,version:nE,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Bohr magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Bohr radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:zE,lsolve:WE,lsolveAll:GE,lup:KE,lusolve:ZE,leafCount:UE,polynomialRoot:XE,resolve:oF,simplify:nF,simplifyConstant:fF,simplifyCore:sF,symbolicEqual:mF,rationalize:rF,slu:dF,usolve:xF,usolveAll:vF,qr:jE,abs:yF,add:wF,cbrt:bF,ceil:AF,cube:CF,divide:NF,dotDivide:EF,dotMultiply:BF,dotPow:PF,exp:LF,expm:zF,expm1:UF,fix:WF,floor:GF,gcd:KF,hypot:ZF,lcm:jF,log:rB,log2:fB,log1p:nB,log10:oB,mod:sB,multiply:dB,norm:mB,nthRoot:xB,nthRoots:vB,pow:yB,round:wB,sign:bB,sqrt:AB,sqrtm:CB,square:PB,subtract:LB,unaryMinus:zB,unaryPlus:UB,xgcd:WB,invmod:XF,bitAnd:GB,bitNot:KB,bitOr:ZB,bitXor:XB,leftShift:jB,rightArithShift:r3,rightLogShift:o3,bellNumbers:n3,catalan:f3,composition:s3,stirlingS2:d3,config:BE,import:PE,typed:LE,arg:m3,conj:x3,re:y3,im:v3,evaluate:w3,help:b3,distance:A3,intersect:C3,and:N3,not:E3,or:B3,xor:P3,mapSlices:L3,concat:U3,count:W3,cross:G3,column:z3,ctranspose:K3,det:Z3,diag:X3,diff:j3,dot:r4,getMatrixDataType:d4,identity:m4,filter:n4,flatten:f4,forEach:s4,inv:x4,pinv:v4,eigs:o4,kron:y4,matrixFromFunction:A4,matrixFromRows:C4,matrixFromColumns:b4,map:w4,ones:N4,partitionSelect:E4,range:B4,resize:L4,reshape:P4,rotate:z4,rotationMatrix:U4,row:W4,size:G4,sort:K4,squeeze:Z4,subset:X4,trace:j4,transpose:r8,zeros:o8,fft:n8,ifft:f8,sylvester:NB,schur:EB,lyap:BB,solveODE:NP,combinations:s8,combinationsWithRep:d8,factorial:m8,gamma:x8,kldivergence:y8,lgamma:v8,multinomial:w8,permutations:b8,pickRandom:A8,random:C8,randomInt:N8,compare:E8,compareNatural:B8,compareText:P8,deepEqual:L8,equal:z8,equalText:U8,larger:W8,largerEq:G8,smaller:K8,smallerEq:Z8,unequal:X8,setCartesian:j8,setDifference:r5,setDistinct:o5,setIntersect:n5,setIsSubset:f5,setMultiplicity:s5,setPowerset:d5,setSize:m5,setSymDifference:x5,setUnion:v5,zpk2tf:y5,freqz:w5,erf:b5,zeta:A5,cumsum:G5,mad:C5,max:N5,mean:E5,median:B5,min:P5,mode:L5,prod:z5,quantileSeq:U5,std:W5,sum:K5,variance:Z5,corr:X5,acos:j5,acosh:r_,acot:o_,acoth:n_,acsc:f_,acsch:s_,asec:d_,asech:m_,asin:x_,asinh:v_,atan:y_,atanh:b_,atan2:w_,cos:A_,cosh:C_,cot:N_,coth:E_,csc:B_,csch:P_,sec:L_,sech:z_,sin:U_,sinh:W_,tan:G_,tanh:K_,to:Z_,clone:j_,format:rP,bin:X_,oct:bP,hex:nP,isNaN:sP,isInteger:fP,isNegative:dP,isNumeric:mP,hasNumericValue:oP,isPositive:xP,isPrime:vP,isZero:yP,print:AP,typeOf:CP,numeric:wP}});var BP,Mj,vv,_P=T(()=>{U();$t();FP();lr();BP="help",Mj=["typed","mathWithTransform","Help"],vv=O(BP,Mj,e=>{var{typed:r,mathWithTransform:t,Help:o}=e;return r(BP,{any:function(n){var i,u=n;if(typeof n!="string"){for(i in t)if(Me(t,i)&&n===t[i]){u=i;break}}var l=Br(EP,u);if(!l){var f=typeof u=="function"?u.name:u;throw new Error('No documentation found on "'+f+'"')}return new o(l)}})})});var PP,Ej,gv,kP=T(()=>{U();PP="chain",Ej=["typed","Chain"],gv=O(PP,Ej,e=>{var{typed:r,Chain:t}=e;return r(PP,{"":function(){return new t},any:function(a){return new t(a)}})})});var LP,Fj,yv,IP=T(()=>{Se();lr();Er();U();LP="det",Fj=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],yv=O(LP,Fj,e=>{var{typed:r,matrix:t,subtractScalar:o,multiply:a,divideScalar:n,isZero:i,unaryMinus:u}=e;return r(LP,{any:function(s){return Pe(s)},"Array | Matrix":function(s){var d;switch(Ae(s)?d=s.size():Array.isArray(s)?(s=t(s),d=s.size()):d=[],d.length){case 0:return Pe(s);case 1:if(d[0]===1)return Pe(s.valueOf()[0]);if(d[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Ie(d)+")");case 2:{var m=d[0],p=d[1];if(m===p)return l(s.clone().valueOf(),m,p);if(p===0)return 1;throw new RangeError("Matrix must be square (size: "+Ie(d)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ie(d)+")")}}});function l(f,s,d){if(s===1)return Pe(f[0][0]);if(s===2)return o(a(f[0][0],f[1][1]),a(f[1][0],f[0][1]));for(var m=!1,p=new Array(s).fill(0).map((A,C)=>C),x=0;x<s;x++){var c=p[x];if(i(f[c][x])){var v=void 0;for(v=x+1;v<s;v++)if(!i(f[p[v]][x])){c=p[v],p[v]=p[x],p[x]=c,m=!m;break}if(v===s)return f[c][x]}for(var y=f[c][x],b=x===0?1:f[p[x-1]][x-1],h=x+1;h<s;h++)for(var S=p[h],w=x+1;w<s;w++)f[S][w]=n(o(a(f[S][w],y),a(f[S][x],f[c][w])),b)}var g=f[p[s-1]][s-1];return m?u(g):g}})});var zP,Bj,Sv,qP=T(()=>{Se();ze();U();Er();zP="inv",Bj=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],Sv=O(zP,Bj,e=>{var{typed:r,matrix:t,divideScalar:o,addScalar:a,multiply:n,unaryMinus:i,det:u,identity:l,abs:f}=e;return r(zP,{"Array | Matrix":function(m){var p=Ae(m)?m.size():_e(m);switch(p.length){case 1:if(p[0]===1)return Ae(m)?t([o(1,m.valueOf()[0])]):[o(1,m[0])];throw new RangeError("Matrix must be square (size: "+Ie(p)+")");case 2:{var x=p[0],c=p[1];if(x===c)return Ae(m)?t(s(m.valueOf(),x,c),m.storage()):s(m,x,c);throw new RangeError("Matrix must be square (size: "+Ie(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ie(p)+")")}},any:function(m){return o(1,m)}});function s(d,m,p){var x,c,v,y,b;if(m===1){if(y=d[0][0],y===0)throw Error("Cannot calculate inverse, determinant is zero");return[[o(1,y)]]}else if(m===2){var h=u(d);if(h===0)throw Error("Cannot calculate inverse, determinant is zero");return[[o(d[1][1],h),o(i(d[0][1]),h)],[o(i(d[1][0]),h),o(d[0][0],h)]]}else{var S=d.concat();for(x=0;x<m;x++)S[x]=S[x].concat();for(var w=l(m).valueOf(),g=0;g<p;g++){var A=f(S[g][g]),C=g;for(x=g+1;x<m;)f(S[x][g])>A&&(A=f(S[x][g]),C=x),x++;if(A===0)throw Error("Cannot calculate inverse, determinant is zero");x=C,x!==g&&(b=S[g],S[g]=S[x],S[x]=b,b=w[g],w[g]=w[x],w[x]=b);var D=S[g],N=w[g];for(x=0;x<m;x++){var E=S[x],_=w[x];if(x!==g){if(E[g]!==0){for(v=o(i(E[g]),D[g]),c=g;c<p;c++)E[c]=a(E[c],n(v,D[c]));for(c=0;c<p;c++)_[c]=a(_[c],n(v,N[c]))}}else{for(v=D[g],c=g;c<p;c++)E[c]=o(E[c],v);for(c=0;c<p;c++)_[c]=o(_[c],v)}}}return w}}})});var UP,_j,wv,HP=T(()=>{Se();ze();U();Er();lr();UP="pinv",_j=["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],wv=O(UP,_j,e=>{var{typed:r,matrix:t,inv:o,deepEqual:a,equal:n,dotDivide:i,dot:u,ctranspose:l,divideScalar:f,multiply:s,add:d,Complex:m}=e;return r(UP,{"Array | Matrix":function(h){var S=Ae(h)?h.size():_e(h);switch(S.length){case 1:return y(h)?l(h):S[0]===1?o(h):i(l(h),u(h,h));case 2:{if(y(h))return l(h);var w=S[0],g=S[1];if(w===g)try{return o(h)}catch(A){if(!(A instanceof Error&&A.message.match(/Cannot calculate inverse, determinant is zero/)))throw A}return Ae(h)?t(p(h.valueOf(),w,g),h.storage()):p(h,w,g)}default:throw new RangeError("Matrix must be two dimensional (size: "+Ie(S)+")")}},any:function(h){return n(h,0)?Pe(h):f(1,h)}});function p(b,h,S){var{C:w,F:g}=c(b,h,S),A=s(o(s(l(w),w)),l(w)),C=s(l(g),o(s(g,l(g))));return s(C,A)}function x(b,h,S){for(var w=Pe(b),g=0,A=0;A<h;A++){if(S<=g)return w;for(var C=A;v(w[C][g]);)if(C++,h===C&&(C=A,g++,S===g))return w;[w[C],w[A]]=[w[A],w[C]];for(var D=w[A][g],N=0;N<S;N++)w[A][N]=i(w[A][N],D);for(var E=0;E<h;E++)if(E!==A){D=w[E][g];for(var _=0;_<S;_++)w[E][_]=d(w[E][_],s(-1,s(D,w[A][_])))}g++}return w}function c(b,h,S){var w=x(b,h,S),g=b.map((C,D)=>C.filter((N,E)=>E<h&&!v(u(w[E],w[E])))),A=w.filter((C,D)=>!v(u(w[D],w[D])));return{C:g,F:A}}function v(b){return n(d(b,m(1,1)),d(0,m(1,1)))}function y(b){return a(d(b,m(1,1)),d(s(b,0),m(1,1)))}})});function WP(e){var{addScalar:r,subtract:t,flatten:o,multiply:a,multiplyScalar:n,divideScalar:i,sqrt:u,abs:l,bignumber:f,diag:s,size:d,reshape:m,inv:p,qr:x,usolve:c,usolveAll:v,equal:y,complex:b,larger:h,smaller:S,matrixFromColumns:w,dot:g}=e;function A(K,z,j,ue){var ee=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ne=C(K,z,j,ue,ee);D(K,z,j,ue,ee,ne);var{values:$,C:W}=N(K,z,j,ue,ee);if(ee){var Y=E(K,z,W,ne,$,j,ue);return{values:$,eigenvectors:Y}}return{values:$}}function C(K,z,j,ue,ee){var ne=ue==="BigNumber",$=ue==="Complex",W=ne?f(0):0,Y=ne?f(1):$?b(1):1,oe=ne?f(1):1,re=ne?f(10):2,le=n(re,re),se;ee&&(se=Array(z).fill(Y));for(var q=!1;!q;){q=!0;for(var G=0;G<z;G++){for(var te=W,ie=W,de=0;de<z;de++)G!==de&&(te=r(te,l(K[de][G])),ie=r(ie,l(K[G][de])));if(!y(te,0)&&!y(ie,0)){for(var he=oe,De=te,Ne=i(ie,re),Xe=n(ie,re);S(De,Ne);)De=n(De,le),he=n(he,re);for(;h(De,Xe);)De=i(De,le),he=i(he,re);var qe=S(i(r(De,ie),he),n(r(te,ie),.95));if(qe){q=!1;for(var yr=i(1,he),xr=0;xr<z;xr++)G!==xr&&(K[G][xr]=n(K[G][xr],yr),K[xr][G]=n(K[xr][G],he));ee&&(se[G]=n(se[G],yr))}}}}return ee?s(se):null}function D(K,z,j,ue,ee,ne){var $=ue==="BigNumber",W=ue==="Complex",Y=$?f(0):W?b(0):0;$&&(j=f(j));for(var oe=0;oe<z-2;oe++){for(var re=0,le=Y,se=oe+1;se<z;se++){var q=K[se][oe];S(l(le),l(q))&&(le=q,re=se)}if(!S(l(le),j)){if(re!==oe+1){var G=K[re];K[re]=K[oe+1],K[oe+1]=G;for(var te=0;te<z;te++){var ie=K[te][re];K[te][re]=K[te][oe+1],K[te][oe+1]=ie}if(ee){var de=ne[re];ne[re]=ne[oe+1],ne[oe+1]=de}}for(var he=oe+2;he<z;he++){var De=i(K[he][oe],le);if(De!==0){for(var Ne=0;Ne<z;Ne++)K[he][Ne]=t(K[he][Ne],n(De,K[oe+1][Ne]));for(var Xe=0;Xe<z;Xe++)K[Xe][oe+1]=r(K[Xe][oe+1],n(De,K[Xe][he]));if(ee)for(var qe=0;qe<z;qe++)ne[he][qe]=t(ne[he][qe],n(De,ne[oe+1][qe]))}}}}return ne}function N(K,z,j,ue,ee){var ne=ue==="BigNumber",$=ue==="Complex",W=ne?f(1):$?b(1):1;ne&&(j=f(j));for(var Y=Pe(K),oe=[],re=z,le=[],se=ee?s(Array(z).fill(W)):void 0,q=ee?s(Array(re).fill(W)):void 0,G=0;G<=100;){G+=1;for(var te=Y[re-1][re-1],ie=0;ie<re;ie++)Y[ie][ie]=t(Y[ie][ie],te);var{Q:de,R:he}=x(Y);Y=a(he,de);for(var De=0;De<re;De++)Y[De][De]=r(Y[De][De],te);if(ee&&(q=a(q,de)),re===1||S(l(Y[re-1][re-2]),j)){G=0,oe.push(Y[re-1][re-1]),ee&&(le.unshift([[1]]),P(q,z),se=a(se,q),re>1&&(q=s(Array(re-1).fill(W)))),re-=1,Y.pop();for(var Ne=0;Ne<re;Ne++)Y[Ne].pop()}else if(re===2||S(l(Y[re-2][re-3]),j)){G=0;var Xe=_(Y[re-2][re-2],Y[re-2][re-1],Y[re-1][re-2],Y[re-1][re-1]);oe.push(...Xe),ee&&(le.unshift(L(Y[re-2][re-2],Y[re-2][re-1],Y[re-1][re-2],Y[re-1][re-1],Xe[0],Xe[1],j,ue)),P(q,z),se=a(se,q),re>2&&(q=s(Array(re-2).fill(W)))),re-=2,Y.pop(),Y.pop();for(var qe=0;qe<re;qe++)Y[qe].pop(),Y[qe].pop()}if(re===0)break}if(oe.sort((kr,Yr)=>+t(l(kr),l(Yr))),G>100){var yr=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+oe.join(", "));throw yr.values=oe,yr.vectors=[],yr}var xr=ee?a(se,k(le,z)):void 0;return{values:oe,C:xr}}function E(K,z,j,ue,ee,ne,$){var W=p(j),Y=a(W,K,j),oe=$==="BigNumber",re=$==="Complex",le=oe?f(0):re?b(0):0,se=oe?f(1):re?b(1):1,q=[],G=[];for(var te of ee){var ie=R(q,te,y);ie===-1?(q.push(te),G.push(1)):G[ie]+=1}for(var de=[],he=q.length,De=Array(z).fill(le),Ne=s(Array(z).fill(se)),Xe=function(){var xr=q[qe],kr=t(Y,a(xr,Ne)),Yr=v(kr,De);for(Yr.shift();Yr.length<G[qe];){var Z=F(kr,z,Yr,ne,$);if(Z===null)break;Yr.push(Z)}var ae=a(p(ue),j);Yr=Yr.map(fe=>a(ae,fe)),de.push(...Yr.map(fe=>({value:xr,vector:o(fe)})))},qe=0;qe<he;qe++)Xe();return de}function _(K,z,j,ue){var ee=r(K,ue),ne=t(n(K,ue),n(z,j)),$=n(ee,.5),W=n(u(t(n(ee,ee),n(4,ne))),.5);return[r($,W),t($,W)]}function L(K,z,j,ue,ee,ne,$,W){var Y=W==="BigNumber",oe=W==="Complex",re=Y?f(0):oe?b(0):0,le=Y?f(1):oe?b(1):1;if(S(l(j),$))return[[le,re],[re,le]];if(h(l(t(ee,ne)),$))return[[t(ee,ue),t(ne,ue)],[j,j]];var se=t(K,ee),q=t(ue,ee);return S(l(z),$)&&S(l(q),$)?[[se,le],[j,re]]:[[z,re],[q,le]]}function P(K,z){for(var j=0;j<K.length;j++)K[j].push(...Array(z-K[j].length).fill(0));for(var ue=K.length;ue<z;ue++)K.push(Array(z).fill(0)),K[ue][ue]=1;return K}function k(K,z){for(var j=[],ue=0;ue<z;ue++)j[ue]=Array(z).fill(0);var ee=0;for(var ne of K){for(var $=ne.length,W=0;W<$;W++)for(var Y=0;Y<$;Y++)j[ee+W][ee+Y]=ne[W][Y];ee+=$}return j}function R(K,z,j){for(var ue=0;ue<K.length;ue++)if(j(K[ue],z))return ue;return-1}function F(K,z,j,ue,ee){for(var ne=ee==="BigNumber"?f(1e3):1e3,$,W=0;W<5;++W){$=I(z,j,ee);try{$=c(K,$)}catch{continue}if(h(V($),ne))break}if(W>=5)return null;for(W=0;;){var Y=c(K,$);if(S(V(B($,[Y])),ue))break;if(++W>=10)return null;$=J(Y)}return $}function I(K,z,j){var ue=j==="BigNumber",ee=j==="Complex",ne=Array(K).fill(0).map($=>2*Math.random()-1);return ue&&(ne=ne.map($=>f($))),ee&&(ne=ne.map($=>b($))),ne=B(ne,z),J(ne,j)}function B(K,z){var j=d(K);for(var ue of z)ue=m(ue,j),K=t(K,a(i(g(ue,K),g(ue,ue)),ue));return K}function V(K){return l(u(g(K,K)))}function J(K,z){var j=z==="BigNumber",ue=z==="Complex",ee=j?f(1):ue?b(1):1;return a(i(ee,V(K)),K)}return A}var VP=T(()=>{lr()});function GP(e){var{config:r,addScalar:t,subtract:o,abs:a,atan:n,cos:i,sin:u,multiplyScalar:l,inv:f,bignumber:s,multiply:d,add:m}=e;function p(D,N){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.relTol,_=arguments.length>3?arguments[3]:void 0,L=arguments.length>4?arguments[4]:void 0;if(_==="number")return x(D,E,L);if(_==="BigNumber")return c(D,E,L);throw TypeError("Unsupported data type: "+_)}function x(D,N,E){var _=D.length,L=Math.abs(N/_),P,k;if(E){k=new Array(_);for(var R=0;R<_;R++)k[R]=Array(_).fill(0),k[R][R]=1}for(var F=g(D);Math.abs(F[1])>=Math.abs(L);){var I=F[0][0],B=F[0][1];P=v(D[I][I],D[B][B],D[I][B]),D=w(D,P,I,B),E&&(k=b(k,P,I,B)),F=g(D)}for(var V=Array(_).fill(0),J=0;J<_;J++)V[J]=D[J][J];return C(Pe(V),k,E)}function c(D,N,E){var _=D.length,L=a(N/_),P,k;if(E){k=new Array(_);for(var R=0;R<_;R++)k[R]=Array(_).fill(0),k[R][R]=1}for(var F=A(D);a(F[1])>=a(L);){var I=F[0][0],B=F[0][1];P=y(D[I][I],D[B][B],D[I][B]),D=S(D,P,I,B),E&&(k=h(k,P,I,B)),F=A(D)}for(var V=Array(_).fill(0),J=0;J<_;J++)V[J]=D[J][J];return C(Pe(V),k,E)}function v(D,N,E){var _=N-D;return Math.abs(_)<=r.relTol?Math.PI/4:.5*Math.atan(2*E/(N-D))}function y(D,N,E){var _=o(N,D);return a(_)<=r.relTol?s(-1).acos().div(4):l(.5,n(d(2,E,f(_))))}function b(D,N,E,_){for(var L=D.length,P=Math.cos(N),k=Math.sin(N),R=Array(L).fill(0),F=Array(L).fill(0),I=0;I<L;I++)R[I]=P*D[I][E]-k*D[I][_],F[I]=k*D[I][E]+P*D[I][_];for(var B=0;B<L;B++)D[B][E]=R[B],D[B][_]=F[B];return D}function h(D,N,E,_){for(var L=D.length,P=i(N),k=u(N),R=Array(L).fill(s(0)),F=Array(L).fill(s(0)),I=0;I<L;I++)R[I]=o(l(P,D[I][E]),l(k,D[I][_])),F[I]=t(l(k,D[I][E]),l(P,D[I][_]));for(var B=0;B<L;B++)D[B][E]=R[B],D[B][_]=F[B];return D}function S(D,N,E,_){for(var L=D.length,P=s(i(N)),k=s(u(N)),R=l(P,P),F=l(k,k),I=Array(L).fill(s(0)),B=Array(L).fill(s(0)),V=d(s(2),P,k,D[E][_]),J=t(o(l(R,D[E][E]),V),l(F,D[_][_])),K=m(l(F,D[E][E]),V,l(R,D[_][_])),z=0;z<L;z++)I[z]=o(l(P,D[E][z]),l(k,D[_][z])),B[z]=t(l(k,D[E][z]),l(P,D[_][z]));D[E][E]=J,D[_][_]=K,D[E][_]=s(0),D[_][E]=s(0);for(var j=0;j<L;j++)j!==E&&j!==_&&(D[E][j]=I[j],D[j][E]=I[j],D[_][j]=B[j],D[j][_]=B[j]);return D}function w(D,N,E,_){for(var L=D.length,P=Math.cos(N),k=Math.sin(N),R=P*P,F=k*k,I=Array(L).fill(0),B=Array(L).fill(0),V=R*D[E][E]-2*P*k*D[E][_]+F*D[_][_],J=F*D[E][E]+2*P*k*D[E][_]+R*D[_][_],K=0;K<L;K++)I[K]=P*D[E][K]-k*D[_][K],B[K]=k*D[E][K]+P*D[_][K];D[E][E]=V,D[_][_]=J,D[E][_]=0,D[_][E]=0;for(var z=0;z<L;z++)z!==E&&z!==_&&(D[E][z]=I[z],D[z][E]=I[z],D[_][z]=B[z],D[z][_]=B[z]);return D}function g(D){for(var N=D.length,E=0,_=[0,1],L=0;L<N;L++)for(var P=L+1;P<N;P++)Math.abs(E)<Math.abs(D[L][P])&&(E=Math.abs(D[L][P]),_=[L,P]);return[_,E]}function A(D){for(var N=D.length,E=0,_=[0,1],L=0;L<N;L++)for(var P=L+1;P<N;P++)a(E)<a(D[L][P])&&(E=a(D[L][P]),_=[L,P]);return[_,E]}function C(D,N,E){var _=D.length,L=Array(_),P;if(E){P=Array(_);for(var k=0;k<_;k++)P[k]=Array(_)}for(var R=0;R<_;R++){for(var F=0,I=D[0],B=0;B<D.length;B++)a(D[B])<a(I)&&(F=B,I=D[F]);if(L[R]=D.splice(F,1)[0],E)for(var V=0;V<_;V++)P[R][V]=N[V][F],N[V].splice(F,1)}if(!E)return{values:L};var J=P.map((K,z)=>({value:L[z],vector:K}));return{values:L,eigenvectors:J}}return p}var $P=T(()=>{lr()});var Pj,kj,Tv,KP=T(()=>{Oa();U();Er();VP();$P();Se();Pj="eigs",kj=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],Tv=O(Pj,kj,e=>{var{config:r,typed:t,matrix:o,addScalar:a,subtract:n,equal:i,abs:u,atan:l,cos:f,sin:s,multiplyScalar:d,divideScalar:m,inv:p,bignumber:x,multiply:c,add:v,larger:y,column:b,flatten:h,number:S,complex:w,sqrt:g,diag:A,size:C,reshape:D,qr:N,usolve:E,usolveAll:_,im:L,re:P,smaller:k,matrixFromColumns:R,dot:F}=e,I=GP({config:r,addScalar:a,subtract:n,column:b,flatten:h,equal:i,abs:u,atan:l,cos:f,sin:s,multiplyScalar:d,inv:p,bignumber:x,complex:w,multiply:c,add:v}),B=WP({config:r,addScalar:a,subtract:n,multiply:c,multiplyScalar:d,flatten:h,divideScalar:m,sqrt:g,abs:u,bignumber:x,diag:A,size:C,reshape:D,qr:N,inv:p,usolve:E,usolveAll:_,equal:i,complex:w,larger:y,smaller:k,matrixFromColumns:R,dot:F});return t("eigs",{Array:function(ne){return V(o(ne))},"Array, number|BigNumber":function(ne,$){return V(o(ne),{precision:$})},"Array, Object"(ee,ne){return V(o(ee),ne)},Matrix:function(ne){return V(ne,{matricize:!0})},"Matrix, number|BigNumber":function(ne,$){return V(ne,{precision:$,matricize:!0})},"Matrix, Object":function(ne,$){var W={matricize:!0};return Pr(W,$),V(ne,W)}});function V(ee){var ne,$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W="eigenvectors"in $?$.eigenvectors:!0,Y=(ne=$.precision)!==null&&ne!==void 0?ne:r.relTol,oe=J(ee,Y,W);return $.matricize&&(oe.values=o(oe.values),W&&(oe.eigenvectors=oe.eigenvectors.map(re=>{var{value:le,vector:se}=re;return{value:le,vector:o(se)}}))),W&&Object.defineProperty(oe,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),oe}function J(ee,ne,$){var W=ee.toArray(),Y=ee.size();if(Y.length!==2||Y[0]!==Y[1])throw new RangeError("Matrix must be square (size: ".concat(Ie(Y),")"));var oe=Y[0];if(z(W,oe,ne)&&(j(W,oe),K(W,oe,ne))){var re=ue(ee,W,oe);return I(W,oe,ne,re,$)}var le=ue(ee,W,oe);return B(W,oe,ne,le,$)}function K(ee,ne,$){for(var W=0;W<ne;W++)for(var Y=W;Y<ne;Y++)if(y(x(u(n(ee[W][Y],ee[Y][W]))),$))return!1;return!0}function z(ee,ne,$){for(var W=0;W<ne;W++)for(var Y=0;Y<ne;Y++)if(y(x(u(L(ee[W][Y]))),$))return!1;return!0}function j(ee,ne){for(var $=0;$<ne;$++)for(var W=0;W<ne;W++)ee[$][W]=P(ee[$][W])}function ue(ee,ne,$){var W=ee.datatype();if(W==="number"||W==="BigNumber"||W==="Complex")return W;for(var Y=!1,oe=!1,re=!1,le=0;le<$;le++)for(var se=0;se<$;se++){var q=ne[le][se];if(ke(q)||oa(q))Y=!0;else if(Fe(q))oe=!0;else if(It(q))re=!0;else throw TypeError("Unsupported type in Matrix: "+ar(q))}if(oe&&re&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),re){for(var G=0;G<$;G++)for(var te=0;te<$;te++)ne[G][te]=w(ne[G][te]);return"Complex"}if(oe){for(var ie=0;ie<$;ie++)for(var de=0;de<$;de++)ne[ie][de]=x(ne[ie][de]);return"BigNumber"}if(Y){for(var he=0;he<$;he++)for(var De=0;De<$;De++)ne[he][De]=S(ne[he][De]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}})});var QP,Lj,bv,ZP=T(()=>{Se();Er();U();QP="expm",Lj=["typed","abs","add","identity","inv","multiply"],bv=O(QP,Lj,e=>{var{typed:r,abs:t,add:o,identity:a,inv:n,multiply:i}=e;return r(QP,{Matrix:function(d){var m=d.size();if(m.length!==2||m[0]!==m[1])throw new RangeError("Matrix must be square (size: "+Ie(m)+")");for(var p=m[0],x=1e-15,c=u(d),v=l(c,x),y=v.q,b=v.j,h=i(d,Math.pow(2,-b)),S=a(p),w=a(p),g=1,A=h,C=-1,D=1;D<=y;D++)D>1&&(A=i(A,h),C=-C),g=g*(y-D+1)/((2*y-D+1)*D),S=o(S,i(g,A)),w=o(w,i(g*C,A));for(var N=i(n(w),S),E=0;E<b;E++)N=i(N,N);return Mo(d)?d.createSparseMatrix(N):N}});function u(s){for(var d=s.size()[0],m=0,p=0;p<d;p++){for(var x=0,c=0;c<d;c++)x+=t(s.get([p,c]));m=Math.max(x,m)}return m}function l(s,d){for(var m=30,p=0;p<m;p++)for(var x=0;x<=p;x++){var c=p-x;if(f(s,x,c)<d)return{q:x,j:c}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}function f(s,d,m){for(var p=1,x=2;x<=d;x++)p*=x;for(var c=p,v=d+1;v<=2*d;v++)c*=v;var y=c*(2*d+1);return 8*Math.pow(s/Math.pow(2,m),2*d)*p*p/(c*y)}})});var YP,Ij,Dv,XP=T(()=>{Se();Er();ze();U();YP="sqrtm",Ij=["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],Dv=O(YP,Ij,e=>{var{typed:r,abs:t,add:o,multiply:a,map:n,sqrt:i,subtract:u,inv:l,size:f,max:s,identity:d}=e,m=1e3,p=1e-6;function x(c){var v,y=0,b=c,h=d(f(c));do{var S=b;if(b=a(.5,o(S,l(h))),h=a(.5,o(h,l(S))),v=s(t(u(b,S))),v>p&&++y>m)throw new Error("computing square root of matrix: iterative method could not converge")}while(v>p);return b}return r(YP,{"Array | Matrix":function(v){var y=Ae(v)?v.size():_e(v);switch(y.length){case 1:if(y[0]===1)return n(v,i);throw new RangeError("Matrix must be square (size: "+Ie(y)+")");case 2:{var b=y[0],h=y[1];if(b===h)return x(v);throw new RangeError("Matrix must be square (size: "+Ie(y)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Ie(y)+")")}}})})});var JP,zj,Av,jP=T(()=>{U();JP="sylvester",zj=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],Av=O(JP,zj,e=>{var{typed:r,schur:t,matrixFromColumns:o,matrix:a,multiply:n,range:i,concat:u,transpose:l,index:f,subset:s,add:d,subtract:m,identity:p,lusolve:x,abs:c}=e;return r(JP,{"Matrix, Matrix, Matrix":v,"Array, Matrix, Matrix":function(b,h,S){return v(a(b),h,S)},"Array, Array, Matrix":function(b,h,S){return v(a(b),a(h),S)},"Array, Matrix, Array":function(b,h,S){return v(a(b),h,a(S))},"Matrix, Array, Matrix":function(b,h,S){return v(b,a(h),S)},"Matrix, Array, Array":function(b,h,S){return v(b,a(h),a(S))},"Matrix, Matrix, Array":function(b,h,S){return v(b,h,a(S))},"Array, Array, Array":function(b,h,S){return v(a(b),a(h),a(S)).toArray()}});function v(y,b,h){for(var S=b.size()[0],w=y.size()[0],g=t(y),A=g.T,C=g.U,D=t(n(-1,b)),N=D.T,E=D.U,_=n(n(l(C),h),E),L=i(0,w),P=[],k=(re,le)=>u(re,le,1),R=(re,le)=>u(re,le,0),F=0;F<S;F++)if(F<S-1&&c(s(N,f(F+1,F)))>1e-5){for(var I=R(s(_,f(L,F)),s(_,f(L,F+1))),B=0;B<F;B++)I=d(I,R(n(P[B],s(N,f(B,F))),n(P[B],s(N,f(B,F+1)))));var V=n(p(w),n(-1,s(N,f(F,F)))),J=n(p(w),n(-1,s(N,f(F+1,F)))),K=n(p(w),n(-1,s(N,f(F,F+1)))),z=n(p(w),n(-1,s(N,f(F+1,F+1)))),j=R(k(d(A,V),J),k(K,d(A,z))),ue=x(j,I);P[F]=ue.subset(f(i(0,w),0)),P[F+1]=ue.subset(f(i(w,2*w),0)),F++}else{for(var ee=s(_,f(L,F)),ne=0;ne<F;ne++)ee=d(ee,n(P[ne],s(N,f(ne,F))));var $=s(N,f(F,F)),W=m(A,n($,p(w)));P[F]=x(W,ee)}var Y=a(o(...P)),oe=n(C,n(Y,l(E)));return oe}})});var e6,qj,Ov,r6=T(()=>{U();e6="schur",qj=["typed","matrix","identity","multiply","qr","norm","subtract"],Ov=O(e6,qj,e=>{var{typed:r,matrix:t,identity:o,multiply:a,qr:n,norm:i,subtract:u}=e;return r(e6,{Array:function(s){var d=l(t(s));return{U:d.U.valueOf(),T:d.T.valueOf()}},Matrix:function(s){return l(s)}});function l(f){var s=f.size()[0],d=f,m=o(s),p=0,x;do{x=d;var c=n(d),v=c.Q,y=c.R;if(d=a(y,v),m=a(m,v),p++>100)break}while(i(u(d,x))>1e-4);return{U:m,T:d}}})});var t6,Uj,Cv,o6=T(()=>{U();t6="lyap",Uj=["typed","matrix","sylvester","multiply","transpose"],Cv=O(t6,Uj,e=>{var{typed:r,matrix:t,sylvester:o,multiply:a,transpose:n}=e;return r(t6,{"Matrix, Matrix":function(u,l){return o(u,n(u),a(-1,l))},"Array, Matrix":function(u,l){return o(t(u),n(t(u)),a(-1,l))},"Matrix, Array":function(u,l){return o(u,n(t(u)),t(a(-1,l)))},"Array, Array":function(u,l){return o(t(u),n(t(u)),t(a(-1,l))).toArray()}})})});var Hj,Wj,Rv,a6=T(()=>{U();lr();ut();go();Hj="divide",Wj=["typed","matrix","multiply","equalScalar","divideScalar","inv"],Rv=O(Hj,Wj,e=>{var{typed:r,matrix:t,multiply:o,equalScalar:a,divideScalar:n,inv:i}=e,u=gr({typed:r,equalScalar:a}),l=Kr({typed:r});return r("divide",_u({"Array | Matrix, Array | Matrix":function(s,d){return o(s,i(d))},"DenseMatrix, any":function(s,d){return l(s,d,n,!1)},"SparseMatrix, any":function(s,d){return u(s,d,n,!1)},"Array, any":function(s,d){return l(t(s),d,n,!1).valueOf()},"any, Array | Matrix":function(s,d){return o(s,i(d))}},n.signatures))})});var n6,Vj,Nv,i6=T(()=>{Se();U();n6="distance",Vj=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],Nv=O(n6,Vj,e=>{var{typed:r,addScalar:t,subtractScalar:o,multiplyScalar:a,divideScalar:n,deepEqual:i,sqrt:u,abs:l}=e;return r(n6,{"Array, Array, Array":function(w,g,A){if(w.length===2&&g.length===2&&A.length===2){if(!s(w))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!s(g))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!s(A))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(i(g,A))throw new TypeError("LinePoint1 should not be same with LinePoint2");var C=o(A[1],g[1]),D=o(g[0],A[0]),N=o(a(A[0],g[1]),a(g[0],A[1]));return v(w[0],w[1],C,D,N)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(w,g,A){if(Object.keys(w).length===2&&Object.keys(g).length===2&&Object.keys(A).length===2){if(!s(w))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!s(g))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!s(A))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(i(x(g),x(A)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in w&&"pointY"in w&&"lineOnePtX"in g&&"lineOnePtY"in g&&"lineTwoPtX"in A&&"lineTwoPtY"in A){var C=o(A.lineTwoPtY,g.lineOnePtY),D=o(g.lineOnePtX,A.lineTwoPtX),N=o(a(A.lineTwoPtX,g.lineOnePtY),a(g.lineOnePtX,A.lineTwoPtY));return v(w.pointX,w.pointY,C,D,N)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(w,g){if(w.length===2&&g.length===3){if(!s(w))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!d(g))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return v(w[0],w[1],g[0],g[1],g[2])}else if(w.length===3&&g.length===6){if(!d(w))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!p(g))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return y(w[0],w[1],w[2],g[0],g[1],g[2],g[3],g[4],g[5])}else if(w.length===g.length&&w.length>0){if(!m(w))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!m(g))throw new TypeError("All values of an array should be numbers or BigNumbers");return b(w,g)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(w,g){if(Object.keys(w).length===2&&Object.keys(g).length===3){if(!s(w))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!d(g))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in w&&"pointY"in w&&"xCoeffLine"in g&&"yCoeffLine"in g&&"constant"in g)return v(w.pointX,w.pointY,g.xCoeffLine,g.yCoeffLine,g.constant);throw new TypeError("Key names do not match")}else if(Object.keys(w).length===3&&Object.keys(g).length===6){if(!d(w))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!p(g))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in w&&"pointY"in w&&"x0"in g&&"y0"in g&&"z0"in g&&"a"in g&&"b"in g&&"c"in g)return y(w.pointX,w.pointY,w.pointZ,g.x0,g.y0,g.z0,g.a,g.b,g.c);throw new TypeError("Key names do not match")}else if(Object.keys(w).length===2&&Object.keys(g).length===2){if(!s(w))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!s(g))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in w&&"pointOneY"in w&&"pointTwoX"in g&&"pointTwoY"in g)return b([w.pointOneX,w.pointOneY],[g.pointTwoX,g.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(w).length===3&&Object.keys(g).length===3){if(!d(w))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!d(g))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in w&&"pointOneY"in w&&"pointOneZ"in w&&"pointTwoX"in g&&"pointTwoY"in g&&"pointTwoZ"in g)return b([w.pointOneX,w.pointOneY,w.pointOneZ],[g.pointTwoX,g.pointTwoY,g.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(w){if(!c(w))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return h(w)}});function f(S){return typeof S=="number"||Fe(S)}function s(S){return S.constructor!==Array&&(S=x(S)),f(S[0])&&f(S[1])}function d(S){return S.constructor!==Array&&(S=x(S)),f(S[0])&&f(S[1])&&f(S[2])}function m(S){return Array.isArray(S)||(S=x(S)),S.every(f)}function p(S){return S.constructor!==Array&&(S=x(S)),f(S[0])&&f(S[1])&&f(S[2])&&f(S[3])&&f(S[4])&&f(S[5])}function x(S){for(var w=Object.keys(S),g=[],A=0;A<w.length;A++)g.push(S[w[A]]);return g}function c(S){if(S[0].length===2&&f(S[0][0])&&f(S[0][1])){if(S.some(w=>w.length!==2||!f(w[0])||!f(w[1])))return!1}else if(S[0].length===3&&f(S[0][0])&&f(S[0][1])&&f(S[0][2])){if(S.some(w=>w.length!==3||!f(w[0])||!f(w[1])||!f(w[2])))return!1}else return!1;return!0}function v(S,w,g,A,C){var D=l(t(t(a(g,S),a(A,w)),C)),N=u(t(a(g,g),a(A,A)));return n(D,N)}function y(S,w,g,A,C,D,N,E,_){var L=[o(a(o(C,w),_),a(o(D,g),E)),o(a(o(D,g),N),a(o(A,S),_)),o(a(o(A,S),E),a(o(C,w),N))];L=u(t(t(a(L[0],L[0]),a(L[1],L[1])),a(L[2],L[2])));var P=u(t(t(a(N,N),a(E,E)),a(_,_)));return n(L,P)}function b(S,w){for(var g=S.length,A=0,C=0,D=0;D<g;D++)C=o(S[D],w[D]),A=t(a(C,C),A);return u(A)}function h(S){for(var w=[],g=[],A=[],C=0;C<S.length-1;C++)for(var D=C+1;D<S.length;D++)S[0].length===2?(g=[S[C][0],S[C][1]],A=[S[D][0],S[D][1]]):S[0].length===3&&(g=[S[C][0],S[C][1],S[C][2]],A=[S[D][0],S[D][1],S[D][2]]),w.push(b(g,A));return w}})});var Gj,$j,Mv,f6=T(()=>{U();Gj="intersect",$j=["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],Mv=O(Gj,$j,e=>{var{typed:r,config:t,abs:o,add:a,addScalar:n,matrix:i,multiply:u,multiplyScalar:l,divideScalar:f,subtract:s,smaller:d,equalScalar:m,flatten:p,isZero:x,isNumeric:c}=e;return r("intersect",{"Array, Array, Array":v,"Array, Array, Array, Array":y,"Matrix, Matrix, Matrix":function(E,_,L){var P=v(E.valueOf(),_.valueOf(),L.valueOf());return P===null?null:i(P)},"Matrix, Matrix, Matrix, Matrix":function(E,_,L,P){var k=y(E.valueOf(),_.valueOf(),L.valueOf(),P.valueOf());return k===null?null:i(k)}});function v(N,E,_){if(N=b(N),E=b(E),_=b(_),!S(N))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!S(E))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!w(_))throw new TypeError("Array with 4 numbers expected as third argument");return D(N[0],N[1],N[2],E[0],E[1],E[2],_[0],_[1],_[2],_[3])}function y(N,E,_,L){if(N=b(N),E=b(E),_=b(_),L=b(L),N.length===2){if(!h(N))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!h(E))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!h(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!h(L))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return g(N,E,_,L)}else if(N.length===3){if(!S(N))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!S(E))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!S(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!S(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return C(N[0],N[1],N[2],E[0],E[1],E[2],_[0],_[1],_[2],L[0],L[1],L[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function b(N){return N.length===1?N[0]:N.length>1&&Array.isArray(N[0])&&N.every(E=>Array.isArray(E)&&E.length===1)?p(N):N}function h(N){return N.length===2&&c(N[0])&&c(N[1])}function S(N){return N.length===3&&c(N[0])&&c(N[1])&&c(N[2])}function w(N){return N.length===4&&c(N[0])&&c(N[1])&&c(N[2])&&c(N[3])}function g(N,E,_,L){var P=N,k=_,R=s(P,E),F=s(k,L),I=s(l(R[0],F[1]),l(F[0],R[1]));if(x(I)||d(o(I),t.relTol))return null;var B=l(F[0],P[1]),V=l(F[1],P[0]),J=l(F[0],k[1]),K=l(F[1],k[0]),z=f(n(s(s(B,V),J),K),I);return a(u(R,z),P)}function A(N,E,_,L,P,k,R,F,I,B,V,J){var K=l(s(N,E),s(_,L)),z=l(s(P,k),s(R,F)),j=l(s(I,B),s(V,J));return n(n(K,z),j)}function C(N,E,_,L,P,k,R,F,I,B,V,J){var K=A(N,R,B,R,E,F,V,F,_,I,J,I),z=A(B,R,L,N,V,F,P,E,J,I,k,_),j=A(N,R,L,N,E,F,P,E,_,I,k,_),ue=A(B,R,B,R,V,F,V,F,J,I,J,I),ee=A(L,N,L,N,P,E,P,E,k,_,k,_),ne=s(l(K,z),l(j,ue)),$=s(l(ee,ue),l(z,z));if(x($))return null;var W=f(ne,$),Y=f(n(K,l(W,z)),ue),oe=n(N,l(W,s(L,N))),re=n(E,l(W,s(P,E))),le=n(_,l(W,s(k,_))),se=n(R,l(Y,s(B,R))),q=n(F,l(Y,s(V,F))),G=n(I,l(Y,s(J,I)));return m(oe,se)&&m(re,q)&&m(le,G)?[oe,re,le]:null}function D(N,E,_,L,P,k,R,F,I,B){var V=l(N,R),J=l(L,R),K=l(E,F),z=l(P,F),j=l(_,I),ue=l(k,I),ee=s(s(s(B,V),K),j),ne=s(s(s(n(n(J,z),ue),V),K),j),$=f(ee,ne),W=n(N,l($,s(L,N))),Y=n(E,l($,s(P,E))),oe=n(_,l($,s(k,_)));return[W,Y,oe]}})});var u6,Kj,Lf,Ev=T(()=>{je();U();He();Qo();u6="sum",Kj=["typed","config","add","numeric"],Lf=O(u6,Kj,e=>{var{typed:r,config:t,add:o,numeric:a}=e;return r(u6,{"Array | Matrix":n,"Array | Matrix, number | BigNumber":i,"...":function(l){if(xo(l))throw new TypeError("Scalar values expected in function sum");return n(l)}});function n(u){var l;return Ct(u,function(f){try{l=l===void 0?f:o(l,f)}catch(s){throw Hr(s,"sum",f)}}),l===void 0&&(l=a(0,t.number)),typeof l=="string"&&(l=a(l,Dt(l,t))),l}function i(u,l){try{var f=Ia(u,l,o);return f}catch(s){throw Hr(s,"sum")}}})});var Zs,Qj,If,Fv=T(()=>{je();U();rp();Qo();ze();xn();Zs="cumsum",Qj=["typed","add","unaryPlus"],If=O(Zs,Qj,e=>{var{typed:r,add:t,unaryPlus:o}=e;return r(Zs,{Array:a,Matrix:function(f){return f.create(a(f.valueOf(),f.datatype()))},"Array, number | BigNumber":i,"Matrix, number | BigNumber":function(f,s){return f.create(i(f.valueOf(),s),f.datatype())},"...":function(f){if(xo(f))throw new TypeError("All values expected to be scalar in function cumsum");return a(f)}});function a(l){try{return n(l)}catch(f){throw Hr(f,Zs)}}function n(l){if(l.length===0)return[];for(var f=[o(l[0])],s=1;s<l.length;++s)f.push(t(f[s-1],l[s]));return f}function i(l,f){var s=_e(l);if(f<0||f>=s.length)throw new St(f,s.length);try{return u(l,f)}catch(d){throw Hr(d,Zs)}}function u(l,f){var s,d,m;if(f<=0){var p=l[0][0];if(Array.isArray(p)){for(m=es(l),d=[],s=0;s<m.length;s++)d[s]=u(m[s],f-1);return d}else return n(l)}else{for(d=[],s=0;s<l.length;s++)d[s]=u(l[s],f-1);return d}}})});var s6,Zj,zf,Bv=T(()=>{je();ze();U();Qo();s6="mean",Zj=["typed","add","divide"],zf=O(s6,Zj,e=>{var{typed:r,add:t,divide:o}=e;return r(s6,{"Array | Matrix":n,"Array | Matrix, number | BigNumber":a,"...":function(u){if(xo(u))throw new TypeError("Scalar values expected in function mean");return n(u)}});function a(i,u){try{var l=Ia(i,u,t),f=Array.isArray(i)?_e(i):i.size();return o(l,f[u])}catch(s){throw Hr(s,"mean")}}function n(i){var u,l=0;if(Ct(i,function(f){try{u=u===void 0?f:t(u,f),l++}catch(s){throw Hr(s,"mean",f)}}),l===0)throw new Error("Cannot calculate the mean of an empty array");return o(u,l)}})});var l6,Yj,_v,d6=T(()=>{je();ze();U();Qo();l6="median",Yj=["typed","add","divide","compare","partitionSelect"],_v=O(l6,Yj,e=>{var{typed:r,add:t,divide:o,compare:a,partitionSelect:n}=e;function i(f){try{f=Qe(f.valueOf());var s=f.length;if(s===0)throw new Error("Cannot calculate median of an empty array");if(s%2===0){for(var d=s/2-1,m=n(f,d+1),p=f[d],x=0;x<d;++x)a(f[x],p)>0&&(p=f[x]);return l(p,m)}else{var c=n(f,(s-1)/2);return u(c)}}catch(v){throw Hr(v,"median")}}var u=r({"number | BigNumber | Complex | Unit":function(s){return s}}),l=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(s,d){return o(t(s,d),2)}});return r(l6,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(s,d){throw new Error("median(A, dim) is not yet supported")},"...":function(s){if(xo(s))throw new TypeError("Scalar values expected in function median");return i(s)}})})});var p6,Xj,Pv,m6=T(()=>{ze();U();Qo();p6="mad",Xj=["typed","abs","map","median","subtract"],Pv=O(p6,Xj,e=>{var{typed:r,abs:t,map:o,median:a,subtract:n}=e;return r(p6,{"Array | Matrix":i,"...":function(l){return i(l)}});function i(u){if(u=Qe(u.valueOf()),u.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var l=a(u);return a(o(u,function(f){return t(n(f,l))}))}catch(f){throw f instanceof TypeError&&f.message.includes("median")?new TypeError(f.message.replace("median","mad")):Hr(f,"mad")}}})});var kv,c6,Jj,qf,Lv=T(()=>{je();Se();U();Qo();kv="unbiased",c6="variance",Jj=["typed","add","subtract","multiply","divide","mapSlices","isNaN"],qf=O(c6,Jj,e=>{var{typed:r,add:t,subtract:o,multiply:a,divide:n,mapSlices:i,isNaN:u}=e;return r(c6,{"Array | Matrix":function(d){return l(d,kv)},"Array | Matrix, string":l,"Array | Matrix, number | BigNumber":function(d,m){return f(d,m,kv)},"Array | Matrix, number | BigNumber, string":f,"...":function(d){return l(d,kv)}});function l(s,d){var m,p=0;if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Ct(s,function(v){try{m=m===void 0?v:t(m,v),p++}catch(y){throw Hr(y,"variance",v)}}),p===0)throw new Error("Cannot calculate variance of an empty array");var x=n(m,p);if(m=void 0,Ct(s,function(v){var y=o(v,x);m=m===void 0?a(y,y):t(m,a(y,y))}),u(m))return m;switch(d){case"uncorrected":return n(m,p);case"biased":return n(m,p+1);case"unbiased":{var c=Fe(m)?m.mul(0):0;return p===1?c:n(m,p-1)}default:throw new Error('Unknown normalization "'+d+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function f(s,d,m){try{if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return i(s,d,p=>l(p,m))}catch(p){throw Hr(p,"variance")}}})});var x6,jj,Uf,Iv=T(()=>{Se();ze();U();x6="quantileSeq",jj=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],Uf=O(x6,jj,e=>{var{typed:r,bignumber:t,add:o,subtract:a,divide:n,multiply:i,partitionSelect:u,compare:l,isInteger:f,smaller:s,smallerEq:d,larger:m,mapSlices:p}=e;return r(x6,{"Array | Matrix, number | BigNumber":(b,h)=>c(b,h,!1),"Array | Matrix, number | BigNumber, number":(b,h,S)=>x(b,h,!1,S,c),"Array | Matrix, number | BigNumber, boolean":c,"Array | Matrix, number | BigNumber, boolean, number":(b,h,S,w)=>x(b,h,S,w,c),"Array | Matrix, Array | Matrix":(b,h)=>v(b,h,!1),"Array | Matrix, Array | Matrix, number":(b,h,S)=>x(b,h,!1,S,v),"Array | Matrix, Array | Matrix, boolean":v,"Array | Matrix, Array | Matrix, boolean, number":(b,h,S,w)=>x(b,h,S,w,v)});function x(b,h,S,w,g){return p(b,w,A=>g(A,h,S))}function c(b,h,S){var w,g=b.valueOf();if(s(h,0))throw new Error("N/prob must be non-negative");if(d(h,1))return ke(h)?y(g,h,S):t(y(g,h,S));if(m(h,1)){if(!f(h))throw new Error("N must be a positive integer");if(m(h,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var A=o(h,1);w=[];for(var C=0;s(C,h);C++){var D=n(C+1,A);w.push(y(g,D,S))}return ke(h)?w:t(w)}}function v(b,h,S){for(var w=b.valueOf(),g=h.valueOf(),A=[],C=0;C<g.length;++C)A.push(y(w,g[C],S));return A}function y(b,h,S){var w=Qe(b),g=w.length;if(g===0)throw new Error("Cannot calculate quantile of an empty sequence");var A=ke(h)?h*(g-1):h.times(g-1),C=ke(h)?Math.floor(A):A.floor().toNumber(),D=ke(h)?A%1:A.minus(C);if(f(A))return S?w[A]:u(w,ke(h)?A:A.valueOf());var N,E;if(S)N=w[C],E=w[C+1];else{E=u(w,C+1),N=w[C];for(var _=0;_<C;++_)l(w[_],N)>0&&(N=w[_])}return o(i(N,a(1,D)),i(E,D))}})});var h6,eee,Hf,zv=T(()=>{U();Se();h6="std",eee=["typed","map","sqrt","variance"],Hf=O(h6,eee,e=>{var{typed:r,map:t,sqrt:o,variance:a}=e;return r(h6,{"Array | Matrix":n,"Array | Matrix, string":n,"Array | Matrix, number | BigNumber":n,"Array | Matrix, number | BigNumber, string":n,"...":function(u){return n(u)}});function n(i,u){if(i.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var l=a.apply(null,arguments);return Wr(l)?t(l,o):o(l)}catch(f){throw f instanceof TypeError&&f.message.includes(" variance")?new TypeError(f.message.replace(" variance"," std")):f}}})});var v6,ree,qv,g6=T(()=>{U();v6="corr",ree=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],qv=O(v6,ree,e=>{var{typed:r,matrix:t,sqrt:o,sum:a,add:n,subtract:i,multiply:u,pow:l,divide:f}=e;return r(v6,{"Array, Array":function(p,x){return s(p,x)},"Matrix, Matrix":function(p,x){var c=s(p.toArray(),x.toArray());return Array.isArray(c)?t(c):c}});function s(m,p){var x=[];if(Array.isArray(m[0])&&Array.isArray(p[0])){if(m.length!==p.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var c=0;c<m.length;c++){if(m[c].length!==p[c].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");x.push(d(m[c],p[c]))}return x}else{if(m.length!==p.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return d(m,p)}}function d(m,p){var x=m.length,c=a(m),v=a(p),y=m.reduce((g,A,C)=>n(g,u(A,p[C])),0),b=a(m.map(g=>l(g,2))),h=a(p.map(g=>l(g,2))),S=i(u(x,y),u(c,v)),w=o(u(i(u(x,b),l(c,2)),i(u(x,h),l(v,2))));return f(S,w)}})});function S6(e){return e.isInteger()&&e.gte(0)}var y6,tee,Uv,w6=T(()=>{U();Cp();y6="combinations",tee=["typed"],Uv=O(y6,tee,e=>{var{typed:r}=e;return r(y6,{"number, number":Op,"BigNumber, BigNumber":function(o,a){var n=o.constructor,i,u,l=o.minus(a),f=new n(1);if(!S6(o)||!S6(a))throw new TypeError("Positive integer value expected in function combinations");if(a.gt(o))throw new TypeError("k must be less than n in function combinations");if(i=f,a.lt(l))for(u=f;u.lte(l);u=u.plus(f))i=i.times(a.plus(u)).dividedBy(u);else for(u=f;u.lte(a);u=u.plus(f))i=i.times(l.plus(u)).dividedBy(u);return i}})})});function b6(e){return e.isInteger()&&e.gte(0)}var T6,oee,Hv,D6=T(()=>{U();He();lf();T6="combinationsWithRep",oee=["typed"],Hv=O(T6,oee,e=>{var{typed:r}=e;return r(T6,{"number, number":function(o,a){if(!be(o)||o<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!be(a)||a<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(o<1)throw new TypeError("k must be less than or equal to n + k - 1");if(a<o-1){var n=to(o,o+a-1);return n/to(1,a)}var i=to(a+1,o+a-1);return i/to(1,o-1)},"BigNumber, BigNumber":function(o,a){var n=o.constructor,i,u,l=new n(1),f=o.minus(l);if(!b6(o)||!b6(a))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(o.lt(l))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(i=l,a.lt(f))for(u=l;u.lte(f);u=u.plus(l))i=i.times(a.plus(u)).dividedBy(u);else for(u=l;u.lte(a);u=u.plus(l))i=i.times(f.plus(u)).dividedBy(u);return i}})})});var A6,aee,Wv,O6=T(()=>{U();$e();A6="gamma",aee=["typed","config","multiplyScalar","pow","BigNumber","Complex"],Wv=O(A6,aee,e=>{var{typed:r,config:t,multiplyScalar:o,pow:a,BigNumber:n,Complex:i}=e;function u(f){if(f.im===0)return df(f.re);if(f.re<.5){var s=new i(1-f.re,-f.im),d=new i(Math.PI*f.re,Math.PI*f.im);return new i(Math.PI).div(d.sin()).div(u(s))}f=new i(f.re-1,f.im);for(var m=new i(gn[0],0),p=1;p<gn.length;++p){var x=new i(gn[p],0);m=m.add(x.div(f.add(p)))}var c=new i(f.re+Mp+.5,f.im),v=Math.sqrt(2*Math.PI),y=c.pow(f.add(.5)),b=c.neg().exp();return m.mul(v).mul(y).mul(b)}return r(A6,{number:df,Complex:u,BigNumber:function(s){if(s.isInteger())return s.isNegative()||s.isZero()?new n(1/0):l(s.minus(1));if(!s.isFinite())return new n(s.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function l(f){if(f<8)return new n([1,1,2,6,24,120,720,5040][f]);var s=t.precision+(Math.log(f.toNumber())|0),d=n.clone({precision:s});if(f%2===1)return f.times(l(new n(f-1)));for(var m=f,p=new d(f),x=f.toNumber();m>2;)m-=2,x+=m,p=p.times(x);return new n(p.toPrecision(n.precision))}})});var C6,nee,Vv,R6=T(()=>{$e();U();He();C6="lgamma",nee=["Complex","typed"],Vv=O(C6,nee,e=>{var{Complex:r,typed:t}=e,o=7,a=7,n=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(C6,{number:pf,Complex:i,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function i(f){var s=6.283185307179586,d=1.1447298858494002,m=.1;if(f.isNaN())return new r(NaN,NaN);if(f.im===0)return new r(pf(f.re),0);if(f.re>=o||Math.abs(f.im)>=a)return u(f);if(f.re<=m){var p=Yb(s,f.im)*Math.floor(.5*f.re+.25),x=f.mul(Math.PI).sin().log(),c=i(new r(1-f.re,-f.im));return new r(d,p).sub(x).sub(c)}else return f.im>=0?l(f):l(f.conjugate()).conjugate()}function u(f){for(var s=f.sub(.5).mul(f.log()).sub(f).add(Ep),d=new r(1,0).div(f),m=d.div(f),p=n[0],x=n[1],c=2*m.re,v=m.re*m.re+m.im*m.im,y=2;y<8;y++){var b=x;x=-v*p+n[y],p=c*p+b}var h=d.mul(m.mul(p).add(x));return s.add(h)}function l(f){var s=0,d=0,m=f;for(f=f.add(1);f.re<=o;){m=m.mul(f);var p=m.im<0?1:0;p!==0&&d===0&&s++,d=p,f=f.add(1)}return u(f).sub(m.log()).sub(new r(0,s*2*Math.PI*1))}})});var N6,iee,Gv,M6=T(()=>{je();U();N6="factorial",iee=["typed","gamma"],Gv=O(N6,iee,e=>{var{typed:r,gamma:t}=e;return r(N6,{number:function(a){if(a<0)throw new Error("Value must be non-negative");return t(a+1)},BigNumber:function(a){if(a.isNegative())throw new Error("Value must be non-negative");return t(a.plus(1))},"Array | Matrix":r.referToSelf(o=>a=>Oe(a,o))})})});var E6,fee,$v,F6=T(()=>{U();E6="kldivergence",fee=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],$v=O(E6,fee,e=>{var{typed:r,matrix:t,divide:o,sum:a,multiply:n,map:i,dotDivide:u,log:l,isNumeric:f}=e;return r(E6,{"Array, Array":function(m,p){return s(t(m),t(p))},"Matrix, Array":function(m,p){return s(m,t(p))},"Array, Matrix":function(m,p){return s(t(m),p)},"Matrix, Matrix":function(m,p){return s(m,p)}});function s(d,m){var p=m.size().length,x=d.size().length;if(p>1)throw new Error("first object must be one dimensional");if(x>1)throw new Error("second object must be one dimensional");if(p!==x)throw new Error("Length of two vectors must be equal");var c=a(d);if(c===0)throw new Error("Sum of elements in first object must be non zero");var v=a(m);if(v===0)throw new Error("Sum of elements in second object must be non zero");var y=o(d,a(d)),b=o(m,a(m)),h=a(n(y,i(u(y,b),S=>l(S))));return f(h)?h:Number.NaN}})});var B6,uee,Kv,_6=T(()=>{je();U();B6="multinomial",uee=["typed","add","divide","multiply","factorial","isInteger","isPositive"],Kv=O(B6,uee,e=>{var{typed:r,add:t,divide:o,multiply:a,factorial:n,isInteger:i,isPositive:u}=e;return r(B6,{"Array | Matrix":function(f){var s=0,d=1;return Ct(f,function(m){if(!i(m)||!u(m))throw new TypeError("Positive integer value expected in function multinomial");s=t(s,m),d=a(d,n(m))}),o(n(s),d)}})})});function k6(e){return e.isInteger()&&e.gte(0)}var P6,see,Qv,L6=T(()=>{He();lf();U();P6="permutations",see=["typed","factorial"],Qv=O(P6,see,e=>{var{typed:r,factorial:t}=e;return r(P6,{"number | BigNumber":t,"number, number":function(a,n){if(!be(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(!be(n)||n<0)throw new TypeError("Positive integer value expected in function permutations");if(n>a)throw new TypeError("second argument k must be less than or equal to first argument n");return to(a-n+1,a)},"BigNumber, BigNumber":function(a,n){var i,u;if(!k6(a)||!k6(n))throw new TypeError("Positive integer value expected in function permutations");if(n.gt(a))throw new TypeError("second argument k must be less than or equal to first argument n");var l=a.mul(0).add(1);for(i=l,u=a.minus(n).plus(1);u.lte(a);u=u.plus(1))i=i.times(u);return i}})})});var z6=Ir((I6,Zv)=>{(function(e,r,t){function o(u){var l=this,f=i();l.next=function(){var s=2091639*l.s0+l.c*23283064365386963e-26;return l.s0=l.s1,l.s1=l.s2,l.s2=s-(l.c=s|0)},l.c=1,l.s0=f(" "),l.s1=f(" "),l.s2=f(" "),l.s0-=f(u),l.s0<0&&(l.s0+=1),l.s1-=f(u),l.s1<0&&(l.s1+=1),l.s2-=f(u),l.s2<0&&(l.s2+=1),f=null}function a(u,l){return l.c=u.c,l.s0=u.s0,l.s1=u.s1,l.s2=u.s2,l}function n(u,l){var f=new o(u),s=l&&l.state,d=f.next;return d.int32=function(){return f.next()*4294967296|0},d.double=function(){return d()+(d()*2097152|0)*11102230246251565e-32},d.quick=d,s&&(typeof s=="object"&&a(s,f),d.state=function(){return a(f,{})}),d}function i(){var u=4022871197,l=function(f){f=String(f);for(var s=0;s<f.length;s++){u+=f.charCodeAt(s);var d=.02519603282416938*u;u=d>>>0,d-=u,d*=u,u=d>>>0,d-=u,u+=d*4294967296}return(u>>>0)*23283064365386963e-26};return l}r&&r.exports?r.exports=n:t&&t.amd?t(function(){return n}):this.alea=n})(I6,typeof Zv=="object"&&Zv,typeof define=="function"&&define)});var U6=Ir((q6,Yv)=>{(function(e,r,t){function o(i){var u=this,l="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var s=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^s^s>>>8},i===(i|0)?u.x=i:l+=i;for(var f=0;f<l.length+64;f++)u.x^=l.charCodeAt(f)|0,u.next()}function a(i,u){return u.x=i.x,u.y=i.y,u.z=i.z,u.w=i.w,u}function n(i,u){var l=new o(i),f=u&&u.state,s=function(){return(l.next()>>>0)/4294967296};return s.double=function(){do var d=l.next()>>>11,m=(l.next()>>>0)/4294967296,p=(d+m)/(1<<21);while(p===0);return p},s.int32=l.next,s.quick=s,f&&(typeof f=="object"&&a(f,l),s.state=function(){return a(l,{})}),s}r&&r.exports?r.exports=n:t&&t.amd?t(function(){return n}):this.xor128=n})(q6,typeof Yv=="object"&&Yv,typeof define=="function"&&define)});var W6=Ir((H6,Xv)=>{(function(e,r,t){function o(i){var u=this,l="";u.next=function(){var s=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(s^s<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,i===(i|0)?u.x=i:l+=i;for(var f=0;f<l.length+64;f++)u.x^=l.charCodeAt(f)|0,f==l.length&&(u.d=u.x<<10^u.x>>>4),u.next()}function a(i,u){return u.x=i.x,u.y=i.y,u.z=i.z,u.w=i.w,u.v=i.v,u.d=i.d,u}function n(i,u){var l=new o(i),f=u&&u.state,s=function(){return(l.next()>>>0)/4294967296};return s.double=function(){do var d=l.next()>>>11,m=(l.next()>>>0)/4294967296,p=(d+m)/(1<<21);while(p===0);return p},s.int32=l.next,s.quick=s,f&&(typeof f=="object"&&a(f,l),s.state=function(){return a(l,{})}),s}r&&r.exports?r.exports=n:t&&t.amd?t(function(){return n}):this.xorwow=n})(H6,typeof Xv=="object"&&Xv,typeof define=="function"&&define)});var G6=Ir((V6,Jv)=>{(function(e,r,t){function o(i){var u=this;u.next=function(){var f=u.x,s=u.i,d,m,p;return d=f[s],d^=d>>>7,m=d^d<<24,d=f[s+1&7],m^=d^d>>>10,d=f[s+3&7],m^=d^d>>>3,d=f[s+4&7],m^=d^d<<7,d=f[s+7&7],d=d^d<<13,m^=d^d<<9,f[s]=m,u.i=s+1&7,m};function l(f,s){var d,m,p=[];if(s===(s|0))m=p[0]=s;else for(s=""+s,d=0;d<s.length;++d)p[d&7]=p[d&7]<<15^s.charCodeAt(d)+p[d+1&7]<<13;for(;p.length<8;)p.push(0);for(d=0;d<8&&p[d]===0;++d);for(d==8?m=p[7]=-1:m=p[d],f.x=p,f.i=0,d=256;d>0;--d)f.next()}l(u,i)}function a(i,u){return u.x=i.x.slice(),u.i=i.i,u}function n(i,u){i==null&&(i=+new Date);var l=new o(i),f=u&&u.state,s=function(){return(l.next()>>>0)/4294967296};return s.double=function(){do var d=l.next()>>>11,m=(l.next()>>>0)/4294967296,p=(d+m)/(1<<21);while(p===0);return p},s.int32=l.next,s.quick=s,f&&(f.x&&a(f,l),s.state=function(){return a(l,{})}),s}r&&r.exports?r.exports=n:t&&t.amd?t(function(){return n}):this.xorshift7=n})(V6,typeof Jv=="object"&&Jv,typeof define=="function"&&define)});var K6=Ir(($6,jv)=>{(function(e,r,t){function o(i){var u=this;u.next=function(){var f=u.w,s=u.X,d=u.i,m,p;return u.w=f=f+1640531527|0,p=s[d+34&127],m=s[d=d+1&127],p^=p<<13,m^=m<<17,p^=p>>>15,m^=m>>>12,p=s[d]=p^m,u.i=d,p+(f^f>>>16)|0};function l(f,s){var d,m,p,x,c,v=[],y=128;for(s===(s|0)?(m=s,s=null):(s=s+"\0",m=0,y=Math.max(y,s.length)),p=0,x=-32;x<y;++x)s&&(m^=s.charCodeAt((x+32)%s.length)),x===0&&(c=m),m^=m<<10,m^=m>>>15,m^=m<<4,m^=m>>>13,x>=0&&(c=c+1640531527|0,d=v[x&127]^=m+c,p=d==0?p+1:0);for(p>=128&&(v[(s&&s.length||0)&127]=-1),p=127,x=4*128;x>0;--x)m=v[p+34&127],d=v[p=p+1&127],m^=m<<13,d^=d<<17,m^=m>>>15,d^=d>>>12,v[p]=m^d;f.w=c,f.X=v,f.i=p}l(u,i)}function a(i,u){return u.i=i.i,u.w=i.w,u.X=i.X.slice(),u}function n(i,u){i==null&&(i=+new Date);var l=new o(i),f=u&&u.state,s=function(){return(l.next()>>>0)/4294967296};return s.double=function(){do var d=l.next()>>>11,m=(l.next()>>>0)/4294967296,p=(d+m)/(1<<21);while(p===0);return p},s.int32=l.next,s.quick=s,f&&(f.X&&a(f,l),s.state=function(){return a(l,{})}),s}r&&r.exports?r.exports=n:t&&t.amd?t(function(){return n}):this.xor4096=n})($6,typeof jv=="object"&&jv,typeof define=="function"&&define)});var Z6=Ir((Q6,eg)=>{(function(e,r,t){function o(i){var u=this,l="";u.next=function(){var s=u.b,d=u.c,m=u.d,p=u.a;return s=s<<25^s>>>7^d,d=d-m|0,m=m<<24^m>>>8^p,p=p-s|0,u.b=s=s<<20^s>>>12^d,u.c=d=d-m|0,u.d=m<<16^d>>>16^p,u.a=p-s|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,i===Math.floor(i)?(u.a=i/4294967296|0,u.b=i|0):l+=i;for(var f=0;f<l.length+20;f++)u.b^=l.charCodeAt(f)|0,u.next()}function a(i,u){return u.a=i.a,u.b=i.b,u.c=i.c,u.d=i.d,u}function n(i,u){var l=new o(i),f=u&&u.state,s=function(){return(l.next()>>>0)/4294967296};return s.double=function(){do var d=l.next()>>>11,m=(l.next()>>>0)/4294967296,p=(d+m)/(1<<21);while(p===0);return p},s.int32=l.next,s.quick=s,f&&(typeof f=="object"&&a(f,l),s.state=function(){return a(l,{})}),s}r&&r.exports?r.exports=n:t&&t.amd?t(function(){return n}):this.tychei=n})(Q6,typeof eg=="object"&&eg,typeof define=="function"&&define)});var Y6=Ir(()=>{});var J6=Ir((X6,Ys)=>{(function(e,r,t){var o=256,a=6,n=52,i="random",u=t.pow(o,a),l=t.pow(2,n),f=l*2,s=o-1,d;function m(h,S,w){var g=[];S=S==!0?{entropy:!0}:S||{};var A=v(c(S.entropy?[h,b(r)]:h??y(),3),g),C=new p(g),D=function(){for(var N=C.g(a),E=u,_=0;N<l;)N=(N+_)*o,E*=o,_=C.g(1);for(;N>=f;)N/=2,E/=2,_>>>=1;return(N+_)/E};return D.int32=function(){return C.g(4)|0},D.quick=function(){return C.g(4)/4294967296},D.double=D,v(b(C.S),r),(S.pass||w||function(N,E,_,L){return L&&(L.S&&x(L,C),N.state=function(){return x(C,{})}),_?(t[i]=N,E):N})(D,A,"global"in S?S.global:this==t,S.state)}function p(h){var S,w=h.length,g=this,A=0,C=g.i=g.j=0,D=g.S=[];for(w||(h=[w++]);A<o;)D[A]=A++;for(A=0;A<o;A++)D[A]=D[C=s&C+h[A%w]+(S=D[A])],D[C]=S;(g.g=function(N){for(var E,_=0,L=g.i,P=g.j,k=g.S;N--;)E=k[L=s&L+1],_=_*o+k[s&(k[L]=k[P=s&P+E])+(k[P]=E)];return g.i=L,g.j=P,_})(o)}function x(h,S){return S.i=h.i,S.j=h.j,S.S=h.S.slice(),S}function c(h,S){var w=[],g=typeof h,A;if(S&&g=="object")for(A in h)try{w.push(c(h[A],S-1))}catch{}return w.length?w:g=="string"?h:h+"\0"}function v(h,S){for(var w=h+"",g,A=0;A<w.length;)S[s&A]=s&(g^=S[s&A]*19)+w.charCodeAt(A++);return b(S)}function y(){try{var h;return d&&(h=d.randomBytes)?h=h(o):(h=new Uint8Array(o),(e.crypto||e.msCrypto).getRandomValues(h)),b(h)}catch{var S=e.navigator,w=S&&S.plugins;return[+new Date,e,w,e.screen,b(r)]}}function b(h){return String.fromCharCode.apply(0,h)}if(v(t.random(),r),typeof Ys=="object"&&Ys.exports){Ys.exports=m;try{d=Y6()}catch{}}else typeof define=="function"&&define.amd?define(function(){return m}):t["seed"+i]=m})(typeof self<"u"?self:X6,[],Math)});var e7=Ir((C8e,j6)=>{var lee=z6(),dee=U6(),pee=W6(),mee=G6(),cee=K6(),xee=Z6(),Cn=J6();Cn.alea=lee;Cn.xor128=dee;Cn.xorwow=pee;Cn.xorshift7=mee;Cn.xor4096=cee;Cn.tychei=xee;j6.exports=Cn});function da(e){var r;function t(a){r=a===null?hee:(0,rg.default)(String(a))}t(e);function o(){return r()}return o}var rg,hee,Xs=T(()=>{rg=hr(e7(),1),hee=(0,rg.default)(Date.now())});var r7,vee,tg,t7=T(()=>{ze();U();Se();Xs();r7="pickRandom",vee=["typed","config","?on"],tg=O(r7,vee,e=>{var{typed:r,config:t,on:o}=e,a=da(t.randomSeed);return o&&o("config",function(i,u){i.randomSeed!==u.randomSeed&&(a=da(i.randomSeed))}),r(r7,{"Array | Matrix":function(u){return n(u,{})},"Array | Matrix, Object":function(u,l){return n(u,l)},"Array | Matrix, number":function(u,l){return n(u,{number:l})},"Array | Matrix, Array | Matrix":function(u,l){return n(u,{weights:l})},"Array | Matrix, Array | Matrix, number":function(u,l,f){return n(u,{number:f,weights:l})},"Array | Matrix, number, Array | Matrix":function(u,l,f){return n(u,{number:l,weights:f})}});function n(i,u){var{number:l,weights:f,elementWise:s=!0}=u,d=typeof l>"u";d&&(l=1);var m=Ae(i)?i.create:Ae(f)?f.create:null;i=i.valueOf(),f&&(f=f.valueOf()),s===!0&&(i=Qe(i),f=Qe(f));var p=0;if(typeof f<"u"){if(f.length!==i.length)throw new Error("Weights must have the same length as possibles");for(var x=0,c=f.length;x<c;x++){if(!ke(f[x])||f[x]<0)throw new Error("Weights must be an array of positive numbers");p+=f[x]}}for(var v=i.length,y=[],b;y.length<l;){if(typeof f>"u")b=i[Math.floor(a()*v)];else for(var h=a()*p,S=0,w=i.length;S<w;S++)if(h-=f[S],h<0){b=i[S];break}y.push(b)}return d?y[0]:m?m(y):y}})});function Wf(e,r){var t=[];if(e=e.slice(0),e.length>1)for(var o=0,a=e.shift();o<a;o++)t.push(Wf(e,r));else for(var n=0,i=e.shift();n<i;n++)t.push(r());return t}var og=T(()=>{});var o7,gee,ag,a7=T(()=>{U();Se();Xs();og();o7="random",gee=["typed","config","?on"],ag=O(o7,gee,e=>{var{typed:r,config:t,on:o}=e,a=da(t.randomSeed);return o&&o("config",function(u,l){u.randomSeed!==l.randomSeed&&(a=da(u.randomSeed))}),r(o7,{"":()=>i(0,1),number:u=>i(0,u),"number, number":(u,l)=>i(u,l),"Array | Matrix":u=>n(u,0,1),"Array | Matrix, number":(u,l)=>n(u,0,l),"Array | Matrix, number, number":(u,l,f)=>n(u,l,f)});function n(u,l,f){var s=Wf(u.valueOf(),()=>i(l,f));return Ae(u)?u.create(s,"number"):s}function i(u,l){return u+a()*(l-u)}})});var n7,yee,See,ng,i7=T(()=>{U();og();Xs();Se();n7="randomInt",yee=["typed","config","log2","?on"],See=2n**30n,ng=O(n7,yee,e=>{var{typed:r,config:t,log2:o,on:a}=e,n=da(t.randomSeed);return a&&a("config",function(f,s){f.randomSeed!==s.randomSeed&&(n=da(f.randomSeed))}),r(n7,{"":()=>u(0,2),number:f=>u(0,f),"number, number":(f,s)=>u(f,s),bigint:f=>l(0n,f),"bigint, bigint":l,"Array | Matrix":f=>i(f,0,1),"Array | Matrix, number":(f,s)=>i(f,0,s),"Array | Matrix, number, number":(f,s,d)=>i(f,s,d)});function i(f,s,d){var m=Wf(f.valueOf(),()=>u(s,d));return Ae(f)?f.create(m,"number"):m}function u(f,s){return Math.floor(f+n()*(s-f))}function l(f,s){var d=s-f;if(d<=See)return f+BigInt(u(0,Number(d)));for(var m=o(d),p=d;p>=d;){p=0n;for(var x=0;x<m;++x)p=2n*p+(n()<.5?0n:1n)}return f+p}})});var f7,wee,ig,u7=T(()=>{U();Se();f7="stirlingS2",wee=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],ig=O(f7,wee,e=>{var{typed:r,addScalar:t,subtractScalar:o,multiplyScalar:a,divideScalar:n,pow:i,factorial:u,combinations:l,isNegative:f,isInteger:s,number:d,bignumber:m,larger:p}=e,x=[],c=[];return r(f7,{"number | BigNumber, number | BigNumber":function(y,b){if(!s(y)||f(y)||!s(b)||f(b))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(p(b,y))throw new TypeError("k must be less than or equal to n in function stirlingS2");var h=!(ke(y)&&ke(b)),S=h?c:x,w=h?m:d,g=d(y),A=d(b);if(S[g]&&S[g].length>A)return S[g][A];for(var C=0;C<=g;++C)if(S[C]||(S[C]=[w(C===0?1:0)]),C!==0)for(var D=S[C],N=S[C-1],E=D.length;E<=C&&E<=A;++E)E===C?D[E]=1:D[E]=t(a(w(E),N[E]),N[E-1]);return S[g][A]}})})});var s7,Tee,fg,l7=T(()=>{U();s7="bellNumbers",Tee=["typed","addScalar","isNegative","isInteger","stirlingS2"],fg=O(s7,Tee,e=>{var{typed:r,addScalar:t,isNegative:o,isInteger:a,stirlingS2:n}=e;return r(s7,{"number | BigNumber":function(u){if(!a(u)||o(u))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var l=0,f=0;f<=u;f++)l=t(l,n(u,f));return l}})})});var d7,bee,ug,p7=T(()=>{U();d7="catalan",bee=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],ug=O(d7,bee,e=>{var{typed:r,addScalar:t,divideScalar:o,multiplyScalar:a,combinations:n,isNegative:i,isInteger:u}=e;return r(d7,{"number | BigNumber":function(f){if(!u(f)||i(f))throw new TypeError("Non-negative integer value expected in function catalan");return o(n(a(f,2),f),t(f,1))}})})});var m7,Dee,sg,c7=T(()=>{U();m7="composition",Dee=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],sg=O(m7,Dee,e=>{var{typed:r,addScalar:t,combinations:o,isPositive:a,isNegative:n,isInteger:i,larger:u}=e;return r(m7,{"number | BigNumber, number | BigNumber":function(f,s){if(!i(f)||!a(f)||!i(s)||!a(s))throw new TypeError("Positive integer value expected in function composition");if(u(s,f))throw new TypeError("k must be less than or equal to n in function composition");return o(t(f,-1),t(s,-1))}})})});var x7,Aee,lg,h7=T(()=>{U();x7="leafCount",Aee=["parse","typed"],lg=O(x7,Aee,e=>{var{parse:r,typed:t}=e;function o(a){var n=0;return a.forEach(i=>{n+=o(i)}),n||1}return t(x7,{Node:function(n){return o(n)}})})});function dg(e){return Je(e)||Cr(e)&&e.isUnary()&&Je(e.args[0])}function Vf(e){return!!(Je(e)||(zt(e)||Cr(e))&&e.args.every(Vf)||vt(e)&&Vf(e.content))}var v7=T(()=>{Se();Se()});function g7(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,o)}return t}function pg(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?g7(Object(t),!0).forEach(function(o){pr(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):g7(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}var Oee,Cee,mi,Js=T(()=>{at();Se();U();lr();Oee="simplifyUtil",Cee=["FunctionNode","OperatorNode","SymbolNode"],mi=O(Oee,Cee,e=>{var{FunctionNode:r,OperatorNode:t,SymbolNode:o}=e,a=!0,n=!1,i="defaultF",u={add:{trivial:a,total:a,commutative:a,associative:a},unaryPlus:{trivial:a,total:a,commutative:a,associative:a},subtract:{trivial:n,total:a,commutative:n,associative:n},multiply:{trivial:a,total:a,commutative:a,associative:a},divide:{trivial:n,total:a,commutative:n,associative:n},paren:{trivial:a,total:a,commutative:a,associative:n},defaultF:{trivial:n,total:a,commutative:n,associative:n}},l={divide:{total:n},log:{total:n}},f={subtract:{total:n},abs:{trivial:a},log:{total:a}};function s(h,S){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:u,g=i;if(typeof h=="string"?g=h:Cr(h)?g=h.fn.toString():zt(h)?g=h.name:vt(h)&&(g="paren"),Me(w,g)){var A=w[g];if(Me(A,S))return A[S];if(Me(u,g))return u[g][S]}if(Me(w,i)){var C=w[i];return Me(C,S)?C[S]:u[i][S]}if(Me(u,g)){var D=u[g];if(Me(D,S))return D[S]}return u[i][S]}function d(h){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return s(h,"commutative",S)}function m(h){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return s(h,"associative",S)}function p(h,S){var w=pg({},h);for(var g in S)Me(h,g)?w[g]=pg(pg({},S[g]),h[g]):w[g]=S[g];return w}function x(h,S){if(!h.args||h.args.length===0)return h;h.args=c(h,S);for(var w=0;w<h.args.length;w++)x(h.args[w],S)}function c(h,S){var w,g=[],A=function(D){for(var N=0;N<D.args.length;N++){var E=D.args[N];Cr(E)&&w===E.op?A(E):g.push(E)}};return m(h,S)?(w=h.op,A(h),g):h.args}function v(h,S){if(!(!h.args||h.args.length===0)){for(var w=b(h),g=h.args.length,A=0;A<g;A++)v(h.args[A],S);if(g>2&&m(h,S)){for(var C=h.args.pop();h.args.length>0;)C=w([h.args.pop(),C]);h.args=C.args}}}function y(h,S){if(!(!h.args||h.args.length===0)){for(var w=b(h),g=h.args.length,A=0;A<g;A++)y(h.args[A],S);if(g>2&&m(h,S)){for(var C=h.args.shift();h.args.length>0;)C=w([C,h.args.shift()]);h.args=C.args}}}function b(h){return Cr(h)?function(S){try{return new t(h.op,h.fn,S,h.implicit)}catch(w){return console.error(w),[]}}:function(S){return new r(new o(h.name),S)}}return{createMakeNodeFunction:b,hasProperty:s,isCommutative:d,isAssociative:m,mergeContext:p,flatten:x,allChildren:c,unflattenr:v,unflattenl:y,defaultContext:u,realContext:l,positiveContext:f}})});var Ree,Nee,mg,y7=T(()=>{Se();v7();U();Js();lr();ta();Ree="simplify",Nee=["typed","parse","equal","resolve","simplifyConstant","simplifyCore","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode","replacer"],mg=O(Ree,Nee,e=>{var{typed:r,parse:t,equal:o,resolve:a,simplifyConstant:n,simplifyCore:i,AccessorNode:u,ArrayNode:l,ConstantNode:f,FunctionNode:s,IndexNode:d,ObjectNode:m,OperatorNode:p,ParenthesisNode:x,SymbolNode:c,replacer:v}=e,{hasProperty:y,isCommutative:b,isAssociative:h,mergeContext:S,flatten:w,unflattenr:g,unflattenl:A,createMakeNodeFunction:C,defaultContext:D,realContext:N,positiveContext:E}=mi({FunctionNode:s,OperatorNode:p,SymbolNode:c});r.addConversion({from:"Object",to:"Map",convert:ra});var _=r("simplify",{Node:B,"Node, Map":($,W)=>B($,!1,W),"Node, Map, Object":($,W,Y)=>B($,!1,W,Y),"Node, Array":B,"Node, Array, Map":B,"Node, Array, Map, Object":B});r.removeConversion({from:"Object",to:"Map",convert:ra}),_.defaultContext=D,_.realContext=N,_.positiveContext=E;function L($){return $.transform(function(W){return vt(W)?L(W.content):W})}var P={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};_.rules=[i,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},n,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},n,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function k($,W){var Y={};if($.s){var oe=$.s.split("->");if(oe.length===2)Y.l=oe[0],Y.r=oe[1];else throw SyntaxError("Could not parse rule: "+$.s)}else Y.l=$.l,Y.r=$.r;Y.l=L(t(Y.l)),Y.r=L(t(Y.r));for(var re of["imposeContext","repeat","assuming"])re in $&&(Y[re]=$[re]);if($.evaluate&&(Y.evaluate=t($.evaluate)),h(Y.l,W)){var le=!b(Y.l,W),se;le&&(se=I());var q=C(Y.l),G=I();Y.expanded={},Y.expanded.l=q([Y.l,G]),w(Y.expanded.l,W),g(Y.expanded.l,W),Y.expanded.r=q([Y.r,G]),le&&(Y.expandedNC1={},Y.expandedNC1.l=q([se,Y.l]),Y.expandedNC1.r=q([se,Y.r]),Y.expandedNC2={},Y.expandedNC2.l=q([se,Y.expanded.l]),Y.expandedNC2.r=q([se,Y.expanded.r]))}return Y}function R($,W){for(var Y=[],oe=0;oe<$.length;oe++){var re=$[oe],le=void 0,se=typeof re;switch(se){case"string":re={s:re};case"object":le=k(re,W);break;case"function":le=re;break;default:throw TypeError("Unsupported type of rule: "+se)}Y.push(le)}return Y}var F=0;function I(){return new c("_p"+F++)}function B($,W){var Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ra(),oe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},re=oe.consoleDebug;W=R(W||_.rules,oe.context);var le=a($,Y);le=L(le);for(var se={},q=le.toString({parenthesis:"all"});!se[q];){se[q]=!0,F=0;var G=q;re&&console.log("Working on: ",q);for(var te=0;te<W.length;te++){var ie="";if(typeof W[te]=="function"?(le=W[te](le,oe),re&&(ie=W[te].name)):(w(le,oe.context),le=J(le,W[te],oe.context),re&&(ie="".concat(W[te].l.toString()," -> ").concat(W[te].r.toString()))),re){var de=le.toString({parenthesis:"all"});de!==G&&(console.log("Applying",ie,"produced",de),G=de)}A(le,oe.context)}q=le.toString({parenthesis:"all"})}return le}function V($,W,Y){var oe=$;if($)for(var re=0;re<$.length;++re){var le=J($[re],W,Y);le!==$[re]&&(oe===$&&(oe=$.slice()),oe[re]=le)}return oe}function J($,W,Y){if(W.assuming){for(var oe in W.assuming)for(var re in W.assuming[oe])if(y(oe,re,Y)!==W.assuming[oe][re])return $}var le=S(W.imposeContext,Y),se=$;if(se instanceof p||se instanceof s){var q=V(se.args,W,Y);q!==se.args&&(se=se.clone(),se.args=q)}else if(se instanceof x){if(se.content){var G=J(se.content,W,Y);G!==se.content&&(se=new x(G))}}else if(se instanceof l){var te=V(se.items,W,Y);te!==se.items&&(se=new l(te))}else if(se instanceof u){var ie=se.object;se.object&&(ie=J(se.object,W,Y));var de=se.index;se.index&&(de=J(se.index,W,Y)),(ie!==se.object||de!==se.index)&&(se=new u(ie,de))}else if(se instanceof d){var he=V(se.dimensions,W,Y);he!==se.dimensions&&(se=new d(he))}else if(se instanceof m){var De=!1,Ne={};for(var Xe in se.properties)Ne[Xe]=J(se.properties[Xe],W,Y),Ne[Xe]!==se.properties[Xe]&&(De=!0);De&&(se=new m(Ne))}var qe=W.r,yr=ee(W.l,se,le)[0];if(!yr&&W.expanded&&(qe=W.expanded.r,yr=ee(W.expanded.l,se,le)[0]),!yr&&W.expandedNC1&&(qe=W.expandedNC1.r,yr=ee(W.expandedNC1.l,se,le)[0],yr||(qe=W.expandedNC2.r,yr=ee(W.expandedNC2.l,se,le)[0])),yr){var xr=se.implicit;se=qe.clone(),xr&&"implicit"in qe&&(se.implicit=!0),se=se.transform(function(kr){return kr.isSymbolNode&&Me(yr.placeholders,kr.name)?yr.placeholders[kr.name].clone():kr})}return W.repeat&&se!==$&&(se=J(se,W,Y)),se}function K($,W){var Y=[],oe,re,le=C($);if(b($,W))for(var se=0;se<$.args.length;se++)re=$.args.slice(0),re.splice(se,1),oe=re.length===1?re[0]:le(re),Y.push(le([$.args[se],oe]));else for(var q=1;q<$.args.length;q++){var G=$.args[0];q>1&&(G=le($.args.slice(0,q))),re=$.args.slice(q),oe=re.length===1?re[0]:le(re),Y.push(le([G,oe]))}return Y}function z($,W){var Y={placeholders:{}};if(!$.placeholders&&!W.placeholders)return Y;if($.placeholders){if(!W.placeholders)return $}else return W;for(var oe in $.placeholders)if(Me($.placeholders,oe)&&(Y.placeholders[oe]=$.placeholders[oe],Me(W.placeholders,oe)&&!ne($.placeholders[oe],W.placeholders[oe])))return null;for(var re in W.placeholders)Me(W.placeholders,re)&&(Y.placeholders[re]=W.placeholders[re]);return Y}function j($,W){var Y=[];if($.length===0||W.length===0)return Y;for(var oe,re=0;re<$.length;re++)for(var le=0;le<W.length;le++)oe=z($[re],W[le]),oe&&Y.push(oe);return Y}function ue($){if($.length===0)return $;for(var W=$.reduce(j),Y=[],oe={},re=0;re<W.length;re++){var le=JSON.stringify(W[re],v);oe[le]||(oe[le]=!0,Y.push(W[re]))}return Y}function ee($,W,Y,oe){var re=[{placeholders:{}}];if($ instanceof p&&W instanceof p||$ instanceof s&&W instanceof s){if($ instanceof p){if($.op!==W.op||$.fn!==W.fn)return[]}else if($ instanceof s&&$.name!==W.name)return[];if(W.args.length===1&&$.args.length===1||!h(W,Y)&&W.args.length===$.args.length||oe){for(var le=[],se=0;se<$.args.length;se++){var q=ee($.args[se],W.args[se],Y);if(q.length===0)break;le.push(q)}if(le.length!==$.args.length){if(!b(W,Y)||$.args.length===1)return[];if($.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var G=ee($.args[0],W.args[1],Y);if(G.length===0)return[];var te=ee($.args[1],W.args[0],Y);if(te.length===0)return[];le=[G,te]}re=ue(le)}else if(W.args.length>=2&&$.args.length===2){for(var ie=K(W,Y),de=[],he=0;he<ie.length;he++){var De=ee($,ie[he],Y,!0);de=de.concat(De)}return de}else{if($.args.length>2)throw Error("Unexpected non-binary associative function: "+$.toString());return[]}}else if($ instanceof c){if($.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(P[$.name]){if($.name!==W.name)return[]}else switch($.name[1]>="a"&&$.name[1]<="z"?$.name.substring(0,2):$.name[0]){case"n":case"_p":re[0].placeholders[$.name]=W;break;case"c":case"cl":if(Je(W))re[0].placeholders[$.name]=W;else return[];break;case"v":if(!Je(W))re[0].placeholders[$.name]=W;else return[];break;case"vl":if(Tr(W))re[0].placeholders[$.name]=W;else return[];break;case"cd":if(dg(W))re[0].placeholders[$.name]=W;else return[];break;case"vd":if(!dg(W))re[0].placeholders[$.name]=W;else return[];break;case"ce":if(Vf(W))re[0].placeholders[$.name]=W;else return[];break;case"ve":if(!Vf(W))re[0].placeholders[$.name]=W;else return[];break;default:throw new Error("Invalid symbol in rule: "+$.name)}}else if($ instanceof f){if(!o($.value,W.value))return[]}else return[];return re}function ne($,W){if($ instanceof f&&W instanceof f){if(!o($.value,W.value))return!1}else if($ instanceof c&&W instanceof c){if($.name!==W.name)return!1}else if($ instanceof p&&W instanceof p||$ instanceof s&&W instanceof s){if($ instanceof p){if($.op!==W.op||$.fn!==W.fn)return!1}else if($ instanceof s&&$.name!==W.name)return!1;if($.args.length!==W.args.length)return!1;for(var Y=0;Y<$.args.length;Y++)if(!ne($.args[Y],W.args[Y]))return!1}else return!1;return!0}return _})});var Mee,Eee,cg,S7=T(()=>{Se();U();He();Js();Cf();Mee="simplifyConstant",Eee=["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],cg=O(Mee,Eee,e=>{var{typed:r,config:t,mathWithTransform:o,matrix:a,fraction:n,bignumber:i,AccessorNode:u,ArrayNode:l,ConstantNode:f,FunctionNode:s,IndexNode:d,ObjectNode:m,OperatorNode:p,SymbolNode:x}=e,{isCommutative:c,isAssociative:v,allChildren:y,createMakeNodeFunction:b}=mi({FunctionNode:s,OperatorNode:p,SymbolNode:x}),h=r("simplifyConstant",{Node:k=>A(P(k,{})),"Node, Object":function(R,F){return A(P(R,F))}});function S(k){return oa(k)?k.valueOf():k instanceof Array?k.map(S):Ae(k)?a(S(k.valueOf())):k}function w(k,R,F){try{return o[k].apply(null,R)}catch{return R=R.map(S),D(o[k].apply(null,R),F)}}var g=r({Fraction:E,number:function(R){return R<0?N(new f(-R)):new f(R)},BigNumber:function(R){return R<0?N(new f(-R)):new f(R)},bigint:function(R){return R<0n?N(new f(-R)):new f(R)},Complex:function(R){throw new Error("Cannot convert Complex number to Node")},string:function(R){return new f(R)},Matrix:function(R){return new l(R.valueOf().map(F=>g(F)))}});function A(k){return er(k)?k:g(k)}function C(k,R){var F=R&&R.exactFractions!==!1;if(F&&isFinite(k)&&n){var I=n(k),B=R&&typeof R.fractionsLimit=="number"?R.fractionsLimit:1/0;if(I.valueOf()===k&&I.n<B&&I.d<B)return I}return k}var D=r({"string, Object":function(R,F){var I=Dt(R,t);if(I==="BigNumber")return i===void 0&&ii(),i(R);if(I==="bigint")return BigInt(R);if(I==="Fraction")return n===void 0&&ms(),n(R);var B=parseFloat(R);return C(B,F)},"Fraction, Object":function(R,F){return R},"BigNumber, Object":function(R,F){return R},"number, Object":function(R,F){return C(R,F)},"bigint, Object":function(R,F){return R},"Complex, Object":function(R,F){return R.im!==0?R:C(R.re,F)},"Matrix, Object":function(R,F){return a(C(R.valueOf()))},"Array, Object":function(R,F){return R.map(C)}});function N(k){return new p("-","unaryMinus",[k])}function E(k){var R=B=>t.number==="BigNumber"&&i?i(B):Number(B),F=k.s*k.n,I=F<0n?new p("-","unaryMinus",[new f(-R(F))]):new f(R(F));return k.d===1n?I:new p("/","divide",[I,new f(R(k.d))])}function _(k,R,F){if(!so(R))return new u(A(k),A(R));if(ht(k)||Ae(k)){for(var I=Array.from(R.dimensions);I.length>0;)if(Je(I[0])&&typeof I[0].value!="string"){var B=D(I.shift().value,F);ht(k)?k=k.items[B-1]:(k=k.valueOf()[B-1],k instanceof Array&&(k=a(k)))}else if(I.length>1&&Je(I[1])&&typeof I[1].value!="string"){var V=D(I[1].value,F),J=[],K=ht(k)?k.items:k.valueOf();for(var z of K)if(ht(z))J.push(z.items[V-1]);else if(Ae(k))J.push(z[V-1]);else break;if(J.length===K.length)ht(k)?k=new l(J):k=a(J),I.splice(1,1);else break}else break;return I.length===R.dimensions.length?new u(A(k),R):I.length>0?(R=new d(I),new u(A(k),R)):k}if(Fa(k)&&R.dimensions.length===1&&Je(R.dimensions[0])){var j=R.dimensions[0].value;return j in k.properties?k.properties[j]:new f}return new u(A(k),R)}function L(k,R,F,I){var B=R.shift(),V=R.reduce((J,K)=>{if(!er(K)){var z=J.pop();if(er(z))return[z,K];try{return J.push(w(k,[z,K],I)),J}catch{J.push(z)}}J.push(A(J.pop()));var j=J.length===1?J[0]:F(J);return[F([j,A(K)])]},[B]);return V.length===1?V[0]:F([V[0],g(V[1])])}function P(k,R){switch(k.type){case"SymbolNode":return k;case"ConstantNode":switch(typeof k.value){case"number":return D(k.value,R);case"bigint":return D(k.value,R);case"string":return k.value;default:if(!isNaN(k.value))return D(k.value,R)}return k;case"FunctionNode":if(o[k.name]&&o[k.name].rawArgs)return k;{var F=["add","multiply"];if(!F.includes(k.name)){var I=k.args.map(oe=>P(oe,R));if(!I.some(er))try{return w(k.name,I,R)}catch{}if(k.name==="size"&&I.length===1&&ht(I[0])){for(var B=[],V=I[0];ht(V);)B.push(V.items.length),V=V.items[0];return a(B)}return new s(k.name,I.map(A))}}case"OperatorNode":{var J=k.fn.toString(),K,z,j=b(k);if(Cr(k)&&k.isUnary())K=[P(k.args[0],R)],er(K[0])?z=j(K):z=w(J,K,R);else if(v(k,R.context))if(K=y(k,R.context),K=K.map(oe=>P(oe,R)),c(J,R.context)){for(var ue=[],ee=[],ne=0;ne<K.length;ne++)er(K[ne])?ee.push(K[ne]):ue.push(K[ne]);ue.length>1?(z=L(J,ue,j,R),ee.unshift(z),z=L(J,ee,j,R)):z=L(J,K,j,R)}else z=L(J,K,j,R);else K=k.args.map(oe=>P(oe,R)),z=L(J,K,j,R);return z}case"ParenthesisNode":return P(k.content,R);case"AccessorNode":return _(P(k.object,R),P(k.index,R),R);case"ArrayNode":{var $=k.items.map(oe=>P(oe,R));return $.some(er)?new l($.map(A)):a($)}case"IndexNode":return new d(k.dimensions.map(oe=>h(oe,R)));case"ObjectNode":{var W={};for(var Y in k.properties)W[Y]=h(k.properties[Y],R);return new m(W)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(k.type))}}return h})});var w7,Fee,xg,T7=T(()=>{Se();Ha();Js();U();w7="simplifyCore",Fee=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],xg=O(w7,Fee,e=>{var{typed:r,parse:t,equal:o,isZero:a,add:n,subtract:i,multiply:u,divide:l,pow:f,AccessorNode:s,ArrayNode:d,ConstantNode:m,FunctionNode:p,IndexNode:x,ObjectNode:c,OperatorNode:v,ParenthesisNode:y,SymbolNode:b}=e,h=new m(0),S=new m(1),w=new m(!0),g=new m(!1);function A(E){return Cr(E)&&["and","not","or"].includes(E.op)}var{hasProperty:C,isCommutative:D}=mi({FunctionNode:p,OperatorNode:v,SymbolNode:b});function N(E){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=_?_.context:void 0;if(C(E,"trivial",L)){if(zt(E)&&E.args.length===1)return N(E.args[0],_);var P=!1,k=0;if(E.forEach(ee=>{++k,k===1&&(P=N(ee,_))}),k===1)return P}var R=E;if(zt(R)){var F=vN(R.name);if(F){if(R.args.length>2&&C(R,"associative",L))for(;R.args.length>2;){var I=R.args.pop(),B=R.args.pop();R.args.push(new v(F,R.name,[I,B]))}R=new v(F,R.name,R.args)}else return new p(N(R.fn),R.args.map(ee=>N(ee,_)))}if(Cr(R)&&R.isUnary()){var V=N(R.args[0],_);if(R.op==="~"&&Cr(V)&&V.isUnary()&&V.op==="~"||R.op==="not"&&Cr(V)&&V.isUnary()&&V.op==="not"&&A(V.args[0]))return V.args[0];var J=!0;if(R.op==="-"&&Cr(V)&&(V.isBinary()&&V.fn==="subtract"&&(R=new v("-","subtract",[V.args[1],V.args[0]]),J=!1),V.isUnary()&&V.op==="-"))return V.args[0];if(J)return new v(R.op,R.fn,[V])}if(Cr(R)&&R.isBinary()){var K=N(R.args[0],_),z=N(R.args[1],_);if(R.op==="+"){if(Je(K)&&a(K.value))return z;if(Je(z)&&a(z.value))return K;Cr(z)&&z.isUnary()&&z.op==="-"&&(z=z.args[0],R=new v("-","subtract",[K,z]))}if(R.op==="-")return Cr(z)&&z.isUnary()&&z.op==="-"?N(new v("+","add",[K,z.args[0]]),_):Je(K)&&a(K.value)?N(new v("-","unaryMinus",[z])):Je(z)&&a(z.value)?K:new v(R.op,R.fn,[K,z]);if(R.op==="*"){if(Je(K)){if(a(K.value))return h;if(o(K.value,1))return z}if(Je(z)){if(a(z.value))return h;if(o(z.value,1))return K;if(D(R,L))return new v(R.op,R.fn,[z,K],R.implicit)}return new v(R.op,R.fn,[K,z],R.implicit)}if(R.op==="/")return Je(K)&&a(K.value)?h:Je(z)&&o(z.value,1)?K:new v(R.op,R.fn,[K,z]);if(R.op==="^"&&Je(z)){if(a(z.value))return S;if(o(z.value,1))return K}if(R.op==="and"){if(Je(K))if(K.value){if(A(z))return z;if(Je(z))return z.value?w:g}else return g;if(Je(z))if(z.value){if(A(K))return K}else return g}if(R.op==="or"){if(Je(K)){if(K.value)return w;if(A(z))return z}if(Je(z)){if(z.value)return w;if(A(K))return K}}return new v(R.op,R.fn,[K,z])}if(Cr(R))return new v(R.op,R.fn,R.args.map(ee=>N(ee,_)));if(ht(R))return new d(R.items.map(ee=>N(ee,_)));if(eo(R))return new s(N(R.object,_),N(R.index,_));if(so(R))return new x(R.dimensions.map(ee=>N(ee,_)));if(Fa(R)){var j={};for(var ue in R.properties)j[ue]=N(R.properties[ue],_);return new c(j)}return R}return r(w7,{Node:N,"Node,Object":N})})});var Bee,_ee,hg,b7=T(()=>{ta();Se();U();Bee="resolve",_ee=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],hg=O(Bee,_ee,e=>{var{typed:r,parse:t,ConstantNode:o,FunctionNode:a,OperatorNode:n,ParenthesisNode:i}=e;function u(l,f){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!f)return l;if(Tr(l)){if(s.has(l.name)){var d=Array.from(s).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(d,"}"))}var m=f.get(l.name);if(er(m)){var p=new Set(s);return p.add(l.name),u(m,f,p)}else return typeof m=="number"?t(String(m)):m!==void 0?new o(m):l}else if(Cr(l)){var x=l.args.map(function(v){return u(v,f,s)});return new n(l.op,l.fn,x,l.implicit)}else{if(vt(l))return new i(u(l.content,f,s));if(zt(l)){var c=l.args.map(function(v){return u(v,f,s)});return new a(l.name,c)}}return l.map(v=>u(v,f,s))}return r("resolve",{Node:u,"Node, Map | null | undefined":u,"Node, Object":(l,f)=>u(l,ra(f)),"Array | Matrix":r.referToSelf(l=>f=>f.map(s=>l(s))),"Array | Matrix, null | undefined":r.referToSelf(l=>f=>f.map(s=>l(s))),"Array, Object":r.referTo("Array,Map",l=>(f,s)=>l(f,ra(s))),"Matrix, Object":r.referTo("Matrix,Map",l=>(f,s)=>l(f,ra(s))),"Array | Matrix, Map":r.referToSelf(l=>(f,s)=>f.map(d=>l(d,s)))})})});var D7,Pee,vg,A7=T(()=>{Se();U();D7="symbolicEqual",Pee=["parse","simplify","typed","OperatorNode"],vg=O(D7,Pee,e=>{var{parse:r,simplify:t,typed:o,OperatorNode:a}=e;function n(i,u){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},f=new a("-","subtract",[i,u]),s=t(f,{},l);return Je(s)&&!s.value}return o(D7,{"Node, Node":n,"Node, Node, Object":n})})});var O7,kee,gg,C7=T(()=>{Se();U();He();O7="derivative",kee=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],gg=O(O7,kee,e=>{var{typed:r,config:t,parse:o,simplify:a,equal:n,isZero:i,numeric:u,ConstantNode:l,FunctionNode:f,OperatorNode:s,ParenthesisNode:d,SymbolNode:m}=e;function p(S,w){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},A=new Map,C=w.name;function D(E){var _=A.get(E);if(_!==void 0)return _;var L=y(D,E,C);return A.set(E,L),L}var N=b(S,D);return g.simplify?a(N):N}function x(S){var w=o(S);if(!w.isSymbolNode)throw new TypeError("Invalid variable. "+"Cannot parse ".concat(JSON.stringify(S)," into a variable in function derivative"));return w}var c=r(O7,{"Node, SymbolNode":p,"Node, SymbolNode, Object":p,"Node, string":(S,w)=>p(S,x(w)),"Node, string, Object":(S,w,g)=>p(S,x(w),g)});c._simplify=!0,c.toTex=function(S){return v.apply(null,S.args)};var v=r("_derivTex",{"Node, SymbolNode":function(w,g){return Je(w)&&ar(w.value)==="string"?v(o(w.value).toString(),g.toString(),1):v(w.toTex(),g.toString(),1)},"Node, ConstantNode":function(w,g){if(ar(g.value)==="string")return v(w,o(g.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(w,g,A){return v(w.toString(),g.name,A.value)},"string, string, number":function(w,g,A){var C;return A===1?C="{d\\over d"+g+"}":C="{d^{"+A+"}\\over d"+g+"^{"+A+"}}",C+"\\left[".concat(w,"\\right]")}}),y=r("_isConst",{"function, ConstantNode, string":function(){return!0},"function, SymbolNode, string":function(w,g,A){return g.name!==A},"function, ParenthesisNode, string":function(w,g,A){return w(g.content,A)},"function, FunctionAssignmentNode, string":function(w,g,A){return g.params.includes(A)?w(g.expr,A):!0},"function, FunctionNode | OperatorNode, string":function(w,g,A){return g.args.every(C=>w(C,A))}}),b=r("_derivative",{"ConstantNode, function":function(){return h(0)},"SymbolNode, function":function(w,g){return g(w)?h(0):h(1)},"ParenthesisNode, function":function(w,g){return new d(b(w.content,g))},"FunctionAssignmentNode, function":function(w,g){return g(w)?h(0):b(w.expr,g)},"FunctionNode, function":function(w,g){if(g(w))return h(0);var A=w.args[0],C,D=!1,N=!1,E;switch(w.name){case"cbrt":D=!0,E=new s("*","multiply",[h(3),new s("^","pow",[A,new s("/","divide",[h(2),h(3)])])]);break;case"sqrt":case"nthRoot":if(w.args.length===1)D=!0,E=new s("*","multiply",[h(2),new f("sqrt",[A])]);else if(w.args.length===2)return C=new s("/","divide",[h(1),w.args[1]]),b(new s("^","pow",[A,C]),g);break;case"log10":C=h(10);case"log":if(!C&&w.args.length===1)E=A.clone(),D=!0;else if(w.args.length===1&&C||w.args.length===2&&g(w.args[1]))E=new s("*","multiply",[A.clone(),new f("log",[C||w.args[1]])]),D=!0;else if(w.args.length===2)return b(new s("/","divide",[new f("log",[A]),new f("log",[w.args[1]])]),g);break;case"pow":if(w.args.length===2)return b(new s("^","pow",[A,w.args[1]]),g);break;case"exp":E=new f("exp",[A.clone()]);break;case"sin":E=new f("cos",[A.clone()]);break;case"cos":E=new s("-","unaryMinus",[new f("sin",[A.clone()])]);break;case"tan":E=new s("^","pow",[new f("sec",[A.clone()]),h(2)]);break;case"sec":E=new s("*","multiply",[w,new f("tan",[A.clone()])]);break;case"csc":N=!0,E=new s("*","multiply",[w,new f("cot",[A.clone()])]);break;case"cot":N=!0,E=new s("^","pow",[new f("csc",[A.clone()]),h(2)]);break;case"asin":D=!0,E=new f("sqrt",[new s("-","subtract",[h(1),new s("^","pow",[A.clone(),h(2)])])]);break;case"acos":D=!0,N=!0,E=new f("sqrt",[new s("-","subtract",[h(1),new s("^","pow",[A.clone(),h(2)])])]);break;case"atan":D=!0,E=new s("+","add",[new s("^","pow",[A.clone(),h(2)]),h(1)]);break;case"asec":D=!0,E=new s("*","multiply",[new f("abs",[A.clone()]),new f("sqrt",[new s("-","subtract",[new s("^","pow",[A.clone(),h(2)]),h(1)])])]);break;case"acsc":D=!0,N=!0,E=new s("*","multiply",[new f("abs",[A.clone()]),new f("sqrt",[new s("-","subtract",[new s("^","pow",[A.clone(),h(2)]),h(1)])])]);break;case"acot":D=!0,N=!0,E=new s("+","add",[new s("^","pow",[A.clone(),h(2)]),h(1)]);break;case"sinh":E=new f("cosh",[A.clone()]);break;case"cosh":E=new f("sinh",[A.clone()]);break;case"tanh":E=new s("^","pow",[new f("sech",[A.clone()]),h(2)]);break;case"sech":N=!0,E=new s("*","multiply",[w,new f("tanh",[A.clone()])]);break;case"csch":N=!0,E=new s("*","multiply",[w,new f("coth",[A.clone()])]);break;case"coth":N=!0,E=new s("^","pow",[new f("csch",[A.clone()]),h(2)]);break;case"asinh":D=!0,E=new f("sqrt",[new s("+","add",[new s("^","pow",[A.clone(),h(2)]),h(1)])]);break;case"acosh":D=!0,E=new f("sqrt",[new s("-","subtract",[new s("^","pow",[A.clone(),h(2)]),h(1)])]);break;case"atanh":D=!0,E=new s("-","subtract",[h(1),new s("^","pow",[A.clone(),h(2)])]);break;case"asech":D=!0,N=!0,E=new s("*","multiply",[A.clone(),new f("sqrt",[new s("-","subtract",[h(1),new s("^","pow",[A.clone(),h(2)])])])]);break;case"acsch":D=!0,N=!0,E=new s("*","multiply",[new f("abs",[A.clone()]),new f("sqrt",[new s("+","add",[new s("^","pow",[A.clone(),h(2)]),h(1)])])]);break;case"acoth":D=!0,N=!0,E=new s("-","subtract",[h(1),new s("^","pow",[A.clone(),h(2)])]);break;case"abs":E=new s("/","divide",[new f(new m("abs"),[A.clone()]),A.clone()]);break;case"gamma":default:throw new Error('Cannot process function "'+w.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}var _,L;D?(_="/",L="divide"):(_="*",L="multiply");var P=b(A,g);return N&&(P=new s("-","unaryMinus",[P])),new s(_,L,[P,E])},"OperatorNode, function":function(w,g){if(g(w))return h(0);if(w.op==="+")return new s(w.op,w.fn,w.args.map(function(R){return b(R,g)}));if(w.op==="-"){if(w.isUnary())return new s(w.op,w.fn,[b(w.args[0],g)]);if(w.isBinary())return new s(w.op,w.fn,[b(w.args[0],g),b(w.args[1],g)])}if(w.op==="*"){var A=w.args.filter(function(R){return g(R)});if(A.length>0){var C=w.args.filter(function(R){return!g(R)}),D=C.length===1?C[0]:new s("*","multiply",C),N=A.concat(b(D,g));return new s("*","multiply",N)}return new s("+","add",w.args.map(function(R){return new s("*","multiply",w.args.map(function(F){return F===R?b(F,g):F.clone()}))}))}if(w.op==="/"&&w.isBinary()){var E=w.args[0],_=w.args[1];return g(_)?new s("/","divide",[b(E,g),_]):g(E)?new s("*","multiply",[new s("-","unaryMinus",[E]),new s("/","divide",[b(_,g),new s("^","pow",[_.clone(),h(2)])])]):new s("/","divide",[new s("-","subtract",[new s("*","multiply",[b(E,g),_.clone()]),new s("*","multiply",[E.clone(),b(_,g)])]),new s("^","pow",[_.clone(),h(2)])])}if(w.op==="^"&&w.isBinary()){var L=w.args[0],P=w.args[1];if(g(L))return Je(L)&&(i(L.value)||n(L.value,1))?h(0):new s("*","multiply",[w,new s("*","multiply",[new f("log",[L.clone()]),b(P.clone(),g)])]);if(g(P)){if(Je(P)){if(i(P.value))return h(0);if(n(P.value,1))return b(L,g)}var k=new s("^","pow",[L.clone(),new s("-","subtract",[P,h(1)])]);return new s("*","multiply",[P.clone(),new s("*","multiply",[b(L,g),k])])}return new s("*","multiply",[new s("^","pow",[L.clone(),P.clone()]),new s("+","add",[new s("*","multiply",[b(L,g),new s("/","divide",[P.clone(),L.clone()])]),new s("*","multiply",[b(P,g),new f("log",[L.clone()])])])])}throw new Error('Cannot process operator "'+w.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function h(S,w){return new l(u(S,w||Dt(String(S),t)))}return c})});var R7,Lee,yg,N7=T(()=>{He();U();R7="rationalize",Lee=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],yg=O(R7,Lee,e=>{var{config:r,typed:t,equal:o,isZero:a,add:n,subtract:i,multiply:u,divide:l,pow:f,parse:s,simplifyConstant:d,simplifyCore:m,simplify:p,fraction:x,bignumber:c,mathWithTransform:v,matrix:y,AccessorNode:b,ArrayNode:h,ConstantNode:S,FunctionNode:w,IndexNode:g,ObjectNode:A,OperatorNode:C,SymbolNode:D,ParenthesisNode:N}=e;function E(R){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,B=L(),V=_(R,F,!0,B.firstRules),J=V.variables.length,K={exactFractions:!1},z={exactFractions:!0};if(R=V.expression,J>=1){R=P(R);var j,ue,ee=!0,ne=!1;R=p(R,B.firstRules,{},K);for(var $;ue=ee?B.distrDivRules:B.sucDivRules,R=p(R,ue,{},z),ee=!ee,$=R.toString(),$!==j;)ne=!0,j=$;ne&&(R=p(R,B.firstRulesAgain,{},K)),R=p(R,B.finalRules,{},K)}var W=[],Y={};return R.type==="OperatorNode"&&R.isBinary()&&R.op==="/"?(J===1&&(R.args[0]=k(R.args[0],W),R.args[1]=k(R.args[1])),I&&(Y.numerator=R.args[0],Y.denominator=R.args[1])):(J===1&&(R=k(R,W)),I&&(Y.numerator=R,Y.denominator=null)),I?(Y.coefficients=W,Y.variables=V.variables,Y.expression=R,Y):R}return t(R7,{Node:E,"Node, boolean":(R,F)=>E(R,{},F),"Node, Object":E,"Node, Object, boolean":E});function _(R,F,I,B){var V=[],J=p(R,B,F,{exactFractions:!1});I=!!I;var K="+-*"+(I?"/":"");j(J);var z={};return z.expression=J,z.variables=V,z;function j(ue){var ee=ue.type;if(ee==="FunctionNode")throw new Error("There is an unsolved function call");if(ee==="OperatorNode")if(ue.op==="^"){if(ue.args[1].type!=="ConstantNode"||!be(parseFloat(ue.args[1].value)))throw new Error("There is a non-integer exponent");j(ue.args[0])}else{if(!K.includes(ue.op))throw new Error("Operator "+ue.op+" invalid in polynomial expression");for(var ne=0;ne<ue.args.length;ne++)j(ue.args[ne])}else if(ee==="SymbolNode"){var $=ue.name,W=V.indexOf($);W===-1&&V.push($)}else if(ee==="ParenthesisNode")j(ue.content);else if(ee!=="ConstantNode")throw new Error("type "+ee+" is not allowed in polynomial expression")}}function L(){var R=[m,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},d,{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"}],F=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],I=[{l:"(n1/n2 + n3/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)"}],B=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],V={};return V.firstRules=R.concat(F,B),V.distrDivRules=I,V.sucDivRules=B,V.firstRulesAgain=R.concat(F),V.finalRules=[m,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},d,{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))"}],V}function P(R,F,I){var B=R.type,V=arguments.length>1;if(B==="OperatorNode"&&R.isBinary()){var J=!1,K;if(R.op==="^"&&(R.args[0].type==="ParenthesisNode"||R.args[0].type==="OperatorNode")&&R.args[1].type==="ConstantNode"&&(K=parseFloat(R.args[1].value),J=K>=2&&be(K)),J){if(K>2){var z=R.args[0],j=new C("^","pow",[R.args[0].cloneDeep(),new S(K-1)]);R=new C("*","multiply",[z,j])}else R=new C("*","multiply",[R.args[0],R.args[0].cloneDeep()]);V&&(I==="content"?F.content=R:F.args[I]=R)}}if(B==="ParenthesisNode")P(R.content,R,"content");else if(B!=="ConstantNode"&&B!=="SymbolNode")for(var ue=0;ue<R.args.length;ue++)P(R.args[ue],R,ue);if(!V)return R}function k(R,F){F===void 0&&(F=[]),F[0]=0;var I={};I.cte=1,I.oper="+",I.fire="";var B=0,V="";$(R,null,I),B=F.length-1;for(var J=!0,K,z=B;z>=0;z--)if(F[z]!==0){var j=new S(J?F[z]:Math.abs(F[z])),ue=F[z]<0?"-":"+";if(z>0){var ee=new D(V);if(z>1){var ne=new S(z);ee=new C("^","pow",[ee,ne])}F[z]===-1&&J?j=new C("-","unaryMinus",[ee]):Math.abs(F[z])===1?j=ee:j=new C("*","multiply",[j,ee])}J?K=j:ue==="+"?K=new C("+","add",[K,j]):K=new C("-","subtract",[K,j]),J=!1}if(J)return new S(0);return K;function $(W,Y,oe){var re=W.type;if(re==="FunctionNode")throw new Error("There is an unsolved function call");if(re==="OperatorNode"){if(!"+-*^".includes(W.op))throw new Error("Operator "+W.op+" invalid");if(Y!==null){if((W.fn==="unaryMinus"||W.fn==="pow")&&Y.fn!=="add"&&Y.fn!=="subtract"&&Y.fn!=="multiply")throw new Error("Invalid "+W.op+" placing");if((W.fn==="subtract"||W.fn==="add"||W.fn==="multiply")&&Y.fn!=="add"&&Y.fn!=="subtract")throw new Error("Invalid "+W.op+" placing");if((W.fn==="subtract"||W.fn==="add"||W.fn==="unaryMinus")&&oe.noFil!==0)throw new Error("Invalid "+W.op+" placing")}(W.op==="^"||W.op==="*")&&(oe.fire=W.op);for(var le=0;le<W.args.length;le++)W.fn==="unaryMinus"&&(oe.oper="-"),(W.op==="+"||W.fn==="subtract")&&(oe.fire="",oe.cte=1,oe.oper=le===0?"+":W.op),oe.noFil=le,$(W.args[le],W,oe)}else if(re==="SymbolNode"){if(W.name!==V&&V!=="")throw new Error("There is more than one variable");if(V=W.name,Y===null){F[1]=1;return}if(Y.op==="^"&&oe.noFil!==0)throw new Error("In power the variable should be the first parameter");if(Y.op==="*"&&oe.noFil!==1)throw new Error("In multiply the variable should be the second parameter");(oe.fire===""||oe.fire==="*")&&(B<1&&(F[1]=0),F[1]+=oe.cte*(oe.oper==="+"?1:-1),B=Math.max(1,B))}else if(re==="ConstantNode"){var se=parseFloat(W.value);if(Y===null){F[0]=se;return}if(Y.op==="^"){if(oe.noFil!==1)throw new Error("Constant cannot be powered");if(!be(se)||se<=0)throw new Error("Non-integer exponent is not allowed");for(var q=B+1;q<se;q++)F[q]=0;se>B&&(F[se]=0),F[se]+=oe.cte*(oe.oper==="+"?1:-1),B=Math.max(se,B);return}oe.cte=se,oe.fire===""&&(F[0]+=oe.cte*(oe.oper==="+"?1:-1))}else throw new Error("Type "+re+" is not allowed")}}})});var M7,Iee,Sg,E7=T(()=>{U();M7="zpk2tf",Iee=["typed","add","multiply","Complex","number"],Sg=O(M7,Iee,e=>{var{typed:r,add:t,multiply:o,Complex:a,number:n}=e;return r(M7,{"Array,Array,number":function(f,s,d){return i(f,s,d)},"Array,Array":function(f,s){return i(f,s,1)},"Matrix,Matrix,number":function(f,s,d){return i(f.valueOf(),s.valueOf(),d)},"Matrix,Matrix":function(f,s){return i(f.valueOf(),s.valueOf(),1)}});function i(l,f,s){l.some(b=>b.type==="BigNumber")&&(l=l.map(b=>n(b))),f.some(b=>b.type==="BigNumber")&&(f=f.map(b=>n(b)));for(var d=[a(1,0)],m=[a(1,0)],p=0;p<l.length;p++){var x=l[p];typeof x=="number"&&(x=a(x,0)),d=u(d,[a(1,0),a(-x.re,-x.im)])}for(var c=0;c<f.length;c++){var v=f[c];typeof v=="number"&&(v=a(v,0)),m=u(m,[a(1,0),a(-v.re,-v.im)])}for(var y=0;y<d.length;y++)d[y]=o(d[y],s);return[d,m]}function u(l,f){for(var s=[],d=0;d<l.length+f.length-1;d++){s[d]=a(0,0);for(var m=0;m<l.length;m++)d-m>=0&&d-m<f.length&&(s[d]=t(s[d],o(l[m],f[d-m])))}return s}})});var F7,zee,wg,B7=T(()=>{U();F7="freqz",zee=["typed","add","multiply","Complex","divide","matrix"],wg=O(F7,zee,e=>{var{typed:r,add:t,multiply:o,Complex:a,divide:n,matrix:i}=e;return r(F7,{"Array, Array":function(s,d){var m=l(512);return u(s,d,m)},"Array, Array, Array":function(s,d,m){return u(s,d,m)},"Array, Array, number":function(s,d,m){if(m<0)throw new Error("w must be a positive number");var p=l(m);return u(s,d,p)},"Matrix, Matrix":function(s,d){var m=l(512),{w:p,h:x}=u(s.valueOf(),d.valueOf(),m);return{w:i(p),h:i(x)}},"Matrix, Matrix, Matrix":function(s,d,m){var{h:p}=u(s.valueOf(),d.valueOf(),m.valueOf());return{h:i(p),w:i(m)}},"Matrix, Matrix, number":function(s,d,m){if(m<0)throw new Error("w must be a positive number");var p=l(m),{h:x}=u(s.valueOf(),d.valueOf(),p);return{h:i(x),w:i(p)}}});function u(f,s,d){for(var m=[],p=[],x=0;x<d.length;x++){for(var c=a(0,0),v=a(0,0),y=0;y<f.length;y++)c=t(c,o(f[y],a(Math.cos(-y*d[x]),Math.sin(-y*d[x]))));for(var b=0;b<s.length;b++)v=t(v,o(s[b],a(Math.cos(-b*d[x]),Math.sin(-b*d[x]))));m.push(c),p.push(v)}for(var h=[],S=0;S<m.length;S++)h.push(n(m[S],p[S]));return{h,w:d}}function l(f){for(var s=[],d=0;d<f;d++)s.push(d/f*Math.PI);return s}})});var qee,Uee,Tg,_7=T(()=>{U();qee="reviver",Uee=["classes"],Tg=O(qee,Uee,e=>{var{classes:r}=e;return function(o,a){var n=r[a&&a.mathjs];return n&&typeof n.fromJSON=="function"?n.fromJSON(a):a}})});var Hee,Wee,bg,P7=T(()=>{U();Hee="replacer",Wee=[],bg=O(Hee,Wee,()=>function(r,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:typeof t=="bigint"?{mathjs:"bigint",value:String(t)}:t})});var k7,L7=T(()=>{k7="14.2.1"});function oo(e,r,t){return O(e,r,t,{recreateOnConfigChange:!0})}var Dg,Ag,Og,Cg,Rg,Ng,Mg,Eg,Fg,Bg,_g,Pg,kg,Lg,Ig,zg,qg,I7=T(()=>{U();L7();Lx();$e();Dg=O("true",[],()=>!0),Ag=O("false",[],()=>!1),Og=O("null",[],()=>null),Cg=oo("Infinity",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1/0):1/0}),Rg=oo("NaN",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(NaN):NaN}),Ng=oo("pi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?Pf(t):V1}),Mg=oo("tau",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?BR(t):G1}),Eg=oo("e",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?ER(t):$1}),Fg=oo("phi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?FR(t):K1}),Bg=oo("LN2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).ln():Math.LN2}),_g=oo("LN10",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(10).ln():Math.LN10}),Pg=oo("LOG2E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),kg=oo("LOG10E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),Lg=oo("SQRT1_2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),Ig=oo("SQRT2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),zg=oo("i",["Complex"],e=>{var{Complex:r}=e;return r.I}),qg=O("version",[],()=>k7)});function tr(e,r,t){var o=["config","Unit","BigNumber"];return O(e,o,a=>{var{config:n,Unit:i,BigNumber:u}=a,l=n.number==="BigNumber"?new u(r):parseFloat(r),f=new i(l,t);return f.fixPrefix=!0,f})}function js(e,r){var t=["config","BigNumber"];return O(e,t,o=>{var{config:a,BigNumber:n}=o;return a.number==="BigNumber"?new n(r):r})}var Ug,Hg,Wg,Vg,Gg,$g,Kg,Qg,Zg,Yg,Xg,Jg,jg,e0,r0,t0,o0,a0,n0,i0,f0,u0,s0,l0,d0,p0,m0,c0,x0,h0,v0,g0,y0,S0,w0,T0,b0,D0,A0,O0,C0,R0,N0,M0,E0,F0,B0,_0,P0,k0,z7=T(()=>{U();Ug=tr("speedOfLight","299792458","m s^-1"),Hg=tr("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),Wg=tr("planckConstant","6.62607015e-34","J s"),Vg=tr("reducedPlanckConstant","1.0545718176461565e-34","J s"),Gg=tr("magneticConstant","1.25663706212e-6","N A^-2"),$g=tr("electricConstant","8.8541878128e-12","F m^-1"),Kg=tr("vacuumImpedance","376.730313667","ohm"),Qg=tr("coulomb","8.987551792261171e9","N m^2 C^-2"),Zg=tr("elementaryCharge","1.602176634e-19","C"),Yg=tr("bohrMagneton","9.2740100783e-24","J T^-1"),Xg=tr("conductanceQuantum","7.748091729863649e-5","S"),Jg=tr("inverseConductanceQuantum","12906.403729652257","ohm"),jg=tr("magneticFluxQuantum","2.0678338484619295e-15","Wb"),e0=tr("nuclearMagneton","5.0507837461e-27","J T^-1"),r0=tr("klitzing","25812.807459304513","ohm"),t0=tr("bohrRadius","5.29177210903e-11","m"),o0=tr("classicalElectronRadius","2.8179403262e-15","m"),a0=tr("electronMass","9.1093837015e-31","kg"),n0=tr("fermiCoupling","1.1663787e-5","GeV^-2"),i0=js("fineStructure",.0072973525693),f0=tr("hartreeEnergy","4.3597447222071e-18","J"),u0=tr("protonMass","1.67262192369e-27","kg"),s0=tr("deuteronMass","3.3435830926e-27","kg"),l0=tr("neutronMass","1.6749271613e-27","kg"),d0=tr("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),p0=tr("rydberg","10973731.568160","m^-1"),m0=tr("thomsonCrossSection","6.6524587321e-29","m^2"),c0=js("weakMixingAngle",.2229),x0=js("efimovFactor",22.7),h0=tr("atomicMass","1.66053906660e-27","kg"),v0=tr("avogadro","6.02214076e23","mol^-1"),g0=tr("boltzmann","1.380649e-23","J K^-1"),y0=tr("faraday","96485.33212331001","C mol^-1"),S0=tr("firstRadiation","3.7417718521927573e-16","W m^2"),w0=tr("loschmidt","2.686780111798444e25","m^-3"),T0=tr("gasConstant","8.31446261815324","J K^-1 mol^-1"),b0=tr("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),D0=tr("molarVolume","0.022413969545014137","m^3 mol^-1"),A0=js("sackurTetrode",-1.16487052358),O0=tr("secondRadiation","0.014387768775039337","m K"),C0=tr("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),R0=tr("wienDisplacement","2.897771955e-3","m K"),N0=tr("molarMass","0.99999999965e-3","kg mol^-1"),M0=tr("molarMassC12","11.9999999958e-3","kg mol^-1"),E0=tr("gravity","9.80665","m s^-2"),F0=tr("planckLength","1.616255e-35","m"),B0=tr("planckMass","2.176435e-8","kg"),_0=tr("planckTime","5.391245e-44","s"),P0=tr("planckCharge","1.87554603778e-18","C"),k0=tr("planckTemperature","1.416785e+32","K")});function q7(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,o)}return t}function Vee(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?q7(Object(t),!0).forEach(function(o){pr(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):q7(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}var Gee,$ee,L0,U7=T(()=>{at();Mt();U();wm();Se();Gee="mapSlices",$ee=["typed","isInteger"],L0=O(Gee,$ee,e=>{var{typed:r,isInteger:t}=e,o=ti({typed:r,isInteger:t});return r("mapSlices",{"...any":function(n){var i=n[1];ke(i)?n[1]=i-1:Fe(i)&&(n[1]=i.minus(1));try{return o.apply(null,n)}catch(u){throw Dr(u)}}})},Vee({isTransformFunction:!0},ti.meta))});var Kee,Qee,I0,H7=T(()=>{Mt();U();dc();Se();Kee="column",Qee=["typed","Index","matrix","range"],I0=O(Kee,Qee,e=>{var{typed:r,Index:t,matrix:o,range:a}=e,n=Tf({typed:r,Index:t,matrix:o,range:a});return r("column",{"...any":function(u){var l=u.length-1,f=u[l];ke(f)&&(u[l]=f-1);try{return n.apply(null,u)}catch(s){throw Dr(s)}}})},{isTransformFunction:!0})});function ci(e,r,t){var o=e.filter(function(l){return Tr(l)&&!(l.name in r)&&!t.has(l.name)})[0];if(!o)throw new Error('No undefined variable found in inline expression "'+e+'"');var a=o.name,n=new Map,i=new Un(t,n,new Set([a])),u=e.compile();return function(f){return n.set(a,f),u.evaluate(i)}}var el=T(()=>{Se();ta()});function W7(e,r,t){return r===t?e:r===t+1?function(){for(var o=arguments.length,a=new Array(o),n=0;n<o;n++)a[n]=arguments[n];var i=a.slice(0,t),u=V7(a[t]);return e(...i,u)}:r>t+1?function(){for(var o=arguments.length,a=new Array(o),n=0;n<o;n++)a[n]=arguments[n];var i=a.slice(0,t),u=V7(a[t]),l=a.slice(t+1);return e(...i,u,...l)}:e}function V7(e){return e.map(r=>r+1)}var Zee,Yee,xi,rl=T(()=>{U();Zee="transformCallback",Yee=["typed"],xi=O(Zee,Yee,e=>{var{typed:r}=e;return function(o,a){return r.isTypedFunction(o)?t(o,a):W7(o,o.length,a)};function t(o,a){var n=Object.fromEntries(Object.entries(o.signatures).map(i=>{var[u,l]=i,f=u.split(",").length;return r.isTypedFunction(l)?[u,t(l,a)]:[u,W7(l,f,a)]}));return typeof o.name=="string"?r(o.name,n):r(n)}})});var Xee,Jee,z0,G7=T(()=>{xc();U();Se();el();rl();Xee="filter",Jee=["typed"],z0=O(Xee,Jee,e=>{var{typed:r}=e;function t(a,n,i){var u=bf({typed:r}),l=xi({typed:r});if(a.length===0)return u();var f=a[0];if(a.length===1)return u(f);var s=a.length-1,d=a[s];return f&&(f=o(f,i)),d&&(Tr(d)||Vo(d)?d=o(d,i):d=ci(d,n,i)),u(f,l(d,s))}t.rawArgs=!0;function o(a,n){return a.compile().evaluate(n)}return t},{isTransformFunction:!0})});var jee,ere,q0,$7=T(()=>{gc();rl();U();Se();el();jee="forEach",ere=["typed"],q0=O(jee,ere,e=>{var{typed:r}=e,t=Df({typed:r}),o=xi({typed:r});function a(i,u,l){if(i.length===0)return t();var f=i[0];if(i.length===1)return t(f);var s=i.length-1,d=i[s];return f&&(f=n(f,l)),d&&(Tr(d)||Vo(d)?d=n(d,l):d=ci(d,u,l)),t(f,o(d,s))}a.rawArgs=!0;function n(i,u){return i.compile().evaluate(u)}return a},{isTransformFunction:!0})});var rre,tre,U0,K7=T(()=>{Se();U();rre="index",tre=["Index","getMatrixDataType"],U0=O(rre,tre,e=>{var{Index:r,getMatrixDataType:t}=e;return function(){for(var a=[],n=0,i=arguments.length;n<i;n++){var u=arguments[n];if(Hn(u))u.start--,u.end-=u.step>0?0:2;else if(u&&u.isSet===!0)u=u.map(function(f){return f-1});else if(fr(u)||Ae(u))t(u)!=="boolean"&&(u=u.map(function(f){return f-1}));else if(ke(u)||Ma(u))u--;else if(Fe(u))u=u.toNumber()-1;else if(typeof u!="string")throw new TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");a[n]=u}var l=new r;return r.apply(l,a),l}},{isTransformFunction:!0})});var ore,are,H0,Q7=T(()=>{U();Se();bc();el();rl();ore="map",are=["typed"],H0=O(ore,are,e=>{var{typed:r}=e,t=Af({typed:r}),o=xi({typed:r});function a(n,i,u){if(n.length===0)return t();if(n.length===1)return t(n[0]);var l=n.length-1,f=n.slice(0,l),s=n[l];return f=f.map(m=>d(m,u)),s&&(Tr(s)||Vo(s)?s=d(s,u):s=ci(s,i,u)),t(...f,o(s,l));function d(m,p){return m.compile().evaluate(p)}}return a.rawArgs=!0,a},{isTransformFunction:!0})});function Z7(e){return ke(e)?e-1:Fe(e)?e.minus(1):e}function Y7(e){return ke(e)||Fe(e)}var X7=T(()=>{Se()});function Et(e){if(e.length===2&&Wr(e[0])){e=e.slice();var r=e[1];Y7(r)&&(e[1]=Z7(r))}return e}var pa=T(()=>{Se();X7()});var nre,ire,W0,J7=T(()=>{U();Mt();Mx();pa();nre="max",ire=["typed","config","numeric","larger"],W0=O(nre,ire,e=>{var{typed:r,config:t,numeric:o,larger:a}=e,n=Bf({typed:r,config:t,numeric:o,larger:a});return r("max",{"...any":function(u){u=Et(u);try{return n.apply(null,u)}catch(l){throw Dr(l)}}})},{isTransformFunction:!0})});var fre,ure,V0,j7=T(()=>{U();Mt();Bv();pa();fre="mean",ure=["typed","add","divide"],V0=O(fre,ure,e=>{var{typed:r,add:t,divide:o}=e,a=zf({typed:r,add:t,divide:o});return r("mean",{"...any":function(i){i=Et(i);try{return a.apply(null,i)}catch(u){throw Dr(u)}}})},{isTransformFunction:!0})});var sre,lre,G0,e9=T(()=>{U();Mt();Ex();pa();sre="min",lre=["typed","config","numeric","smaller"],G0=O(sre,lre,e=>{var{typed:r,config:t,numeric:o,smaller:a}=e,n=_f({typed:r,config:t,numeric:o,smaller:a});return r("min",{"...any":function(u){u=Et(u);try{return n.apply(null,u)}catch(l){throw Dr(l)}}})},{isTransformFunction:!0})});var dre,pre,$0,r9=T(()=>{U();Oc();dre="range",pre=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],$0=O(dre,pre,e=>{var{typed:r,config:t,matrix:o,bignumber:a,smaller:n,smallerEq:i,larger:u,largerEq:l,add:f,isPositive:s}=e,d=Rf({typed:r,config:t,matrix:o,bignumber:a,smaller:n,smallerEq:i,larger:u,largerEq:l,add:f,isPositive:s});return r("range",{"...any":function(p){var x=p.length-1,c=p[x];return typeof c!="boolean"&&p.push(!0),d.apply(null,p)}})},{isTransformFunction:!0})});var mre,cre,K0,t9=T(()=>{U();Ec();Mt();Se();mre="row",cre=["typed","Index","matrix","range"],K0=O(mre,cre,e=>{var{typed:r,Index:t,matrix:o,range:a}=e,n=Nf({typed:r,Index:t,matrix:o,range:a});return r("row",{"...any":function(u){var l=u.length-1,f=u[l];ke(f)&&(u[l]=f-1);try{return n.apply(null,u)}catch(s){throw Dr(s)}}})},{isTransformFunction:!0})});var xre,hre,Q0,o9=T(()=>{U();Mt();_c();xre="subset",hre=["typed","matrix","zeros","add"],Q0=O(xre,hre,e=>{var{typed:r,matrix:t,zeros:o,add:a}=e,n=Mf({typed:r,matrix:t,zeros:o,add:a});return r("subset",{"...any":function(u){try{return n.apply(null,u)}catch(l){throw Dr(l)}}})},{isTransformFunction:!0})});var vre,gre,Z0,a9=T(()=>{Se();Mt();U();lc();vre="concat",gre=["typed","matrix","isInteger"],Z0=O(vre,gre,e=>{var{typed:r,matrix:t,isInteger:o}=e,a=wf({typed:r,matrix:t,isInteger:o});return r("concat",{"...any":function(i){var u=i.length-1,l=i[u];ke(l)?i[u]=l-1:Fe(l)&&(i[u]=l.minus(1));try{return a.apply(null,i)}catch(f){throw Dr(f)}}})},{isTransformFunction:!0})});var n9,yre,Y0,i9=T(()=>{U();Mt();Dc();pa();n9="diff",yre=["typed","matrix","subtract","number","bignumber"],Y0=O(n9,yre,e=>{var{typed:r,matrix:t,subtract:o,number:a,bignumber:n}=e,i=Of({typed:r,matrix:t,subtract:o,number:a,bignumber:n});return r(n9,{"...any":function(l){l=Et(l);try{return i.apply(null,l)}catch(f){throw Dr(f)}}})},{isTransformFunction:!0})});var Sre,wre,X0,f9=T(()=>{U();zv();Mt();pa();Sre="std",wre=["typed","map","sqrt","variance"],X0=O(Sre,wre,e=>{var{typed:r,map:t,sqrt:o,variance:a}=e,n=Hf({typed:r,map:t,sqrt:o,variance:a});return r("std",{"...any":function(u){u=Et(u);try{return n.apply(null,u)}catch(l){throw Dr(l)}}})},{isTransformFunction:!0})});var u9,Tre,J0,s9=T(()=>{U();Mt();Ev();pa();u9="sum",Tre=["typed","config","add","numeric"],J0=O(u9,Tre,e=>{var{typed:r,config:t,add:o,numeric:a}=e,n=Lf({typed:r,config:t,add:o,numeric:a});return r(u9,{"...any":function(u){u=Et(u);try{return n.apply(null,u)}catch(l){throw Dr(l)}}})},{isTransformFunction:!0})});var bre,Dre,j0,l9=T(()=>{U();Iv();pa();bre="quantileSeq",Dre=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],j0=O(bre,Dre,e=>{var{typed:r,bignumber:t,add:o,subtract:a,divide:n,multiply:i,partitionSelect:u,compare:l,isInteger:f,smaller:s,smallerEq:d,larger:m,mapSlices:p}=e,x=Uf({typed:r,bignumber:t,add:o,subtract:a,divide:n,multiply:i,partitionSelect:u,compare:l,isInteger:f,smaller:s,smallerEq:d,larger:m,mapSlices:p});return r("quantileSeq",{"Array | Matrix, number | BigNumber":x,"Array | Matrix, number | BigNumber, number":(v,y,b)=>x(v,y,c(b)),"Array | Matrix, number | BigNumber, boolean":x,"Array | Matrix, number | BigNumber, boolean, number":(v,y,b,h)=>x(v,y,b,c(h)),"Array | Matrix, Array | Matrix":x,"Array | Matrix, Array | Matrix, number":(v,y,b)=>x(v,y,c(b)),"Array | Matrix, Array | Matrix, boolean":x,"Array | Matrix, Array | Matrix, boolean, number":(v,y,b,h)=>x(v,y,b,c(h))});function c(v){return Et([[],v])[1]}},{isTransformFunction:!0})});var d9,Are,ey,p9=T(()=>{Se();U();Mt();Fv();d9="cumsum",Are=["typed","add","unaryPlus"],ey=O(d9,Are,e=>{var{typed:r,add:t,unaryPlus:o}=e,a=If({typed:r,add:t,unaryPlus:o});return r(d9,{"...any":function(i){if(i.length===2&&Wr(i[0])){var u=i[1];ke(u)?i[1]=u-1:Fe(u)&&(i[1]=u.minus(1))}try{return a.apply(null,i)}catch(l){throw Dr(l)}}})},{isTransformFunction:!0})});var m9,Ore,ry,c9=T(()=>{U();Mt();Lv();pa();m9="variance",Ore=["typed","add","subtract","multiply","divide","mapSlices","isNaN"],ry=O(m9,Ore,e=>{var{typed:r,add:t,subtract:o,multiply:a,divide:n,mapSlices:i,isNaN:u}=e,l=qf({typed:r,add:t,subtract:o,multiply:a,divide:n,mapSlices:i,isNaN:u});return r(m9,{"...any":function(s){s=Et(s);try{return l.apply(null,s)}catch(d){throw Dr(d)}}})},{isTransformFunction:!0})});var x9,Cre,ty,h9=T(()=>{Xc();U();Yc();x9="print",Cre=["typed","matrix","zeros","add"],ty=O(x9,Cre,e=>{var{typed:r,matrix:t,zeros:o,add:a}=e,n=Ef({typed:r,matrix:t,zeros:o,add:a});return r(x9,{"string, Object | Array":function(l,f){return n(i(l),f)},"string, Object | Array, number | Object":function(l,f,s){return n(i(l),f,s)}});function i(u){return u.replace(xs,l=>{var f=l.slice(1).split("."),s=f.map(function(d){return!isNaN(d)&&d.length>0?parseInt(d)-1:d});return"$"+s.join(".")})}},{isTransformFunction:!0})});var Rre,Nre,oy,v9=T(()=>{hx();U();Se();Rre="and",Nre=["typed","matrix","zeros","add","equalScalar","not","concat"],oy=O(Rre,Nre,e=>{var{typed:r,matrix:t,equalScalar:o,zeros:a,not:n,concat:i}=e,u=Ff({typed:r,matrix:t,equalScalar:o,zeros:a,not:n,concat:i});function l(f,s,d){var m=f[0].compile().evaluate(d);if(!Wr(m)&&!u(m,!0))return!1;var p=f[1].compile().evaluate(d);return u(m,p)}return l.rawArgs=!0,l},{isTransformFunction:!0})});var Mre,Ere,ay,g9=T(()=>{uc();U();Se();Mre="or",Ere=["typed","matrix","equalScalar","DenseMatrix","concat"],ay=O(Mre,Ere,e=>{var{typed:r,matrix:t,equalScalar:o,DenseMatrix:a,concat:n}=e,i=Sf({typed:r,matrix:t,equalScalar:o,DenseMatrix:a,concat:n});function u(l,f,s){var d=l[0].compile().evaluate(s);if(!Wr(d)&&i(d,!1))return!0;var m=l[1].compile().evaluate(s);return i(d,m)}return u.rawArgs=!0,u},{isTransformFunction:!0})});var Fre,Bre,ny,y9=T(()=>{jm();U();Se();Fre="bitAnd",Bre=["typed","matrix","zeros","add","equalScalar","not","concat"],ny=O(Fre,Bre,e=>{var{typed:r,matrix:t,equalScalar:o,zeros:a,not:n,concat:i}=e,u=gf({typed:r,matrix:t,equalScalar:o,zeros:a,not:n,concat:i});function l(f,s,d){var m=f[0].compile().evaluate(d);if(!Wr(m)){if(isNaN(m))return NaN;if(m===0||m===!1)return 0}var p=f[1].compile().evaluate(d);return u(m,p)}return l.rawArgs=!0,l},{isTransformFunction:!0})});var _re,Pre,iy,S9=T(()=>{rc();U();Se();_re="bitOr",Pre=["typed","matrix","equalScalar","DenseMatrix","concat"],iy=O(_re,Pre,e=>{var{typed:r,matrix:t,equalScalar:o,DenseMatrix:a,concat:n}=e,i=yf({typed:r,matrix:t,equalScalar:o,DenseMatrix:a,concat:n});function u(l,f,s){var d=l[0].compile().evaluate(s);if(!Wr(d)){if(isNaN(d))return NaN;if(d===-1)return-1;if(d===!0)return 1}var m=l[1].compile().evaluate(s);return i(d,m)}return u.rawArgs=!0,u},{isTransformFunction:!0})});var tl=T(()=>{Jb();jb();c1();h1();y1();S1();w1();L1();z1();U1();tD();aD();iD();uD();lD();pD();cD();vD();gD();yD();SD();TD();DD();AD();OD();CD();ND();ED();BD();PD();LD();zD();UD();WD();wm();$D();QD();YD();XD();jD();rA();oA();aA();Bm();dA();mA();xA();vA();_m();gA();SA();TA();DA();AA();CA();NA();EA();BA();PA();jm();WA();rc();$A();QA();YA();JA();eO();tO();uc();nO();lc();dc();sO();dO();mO();xc();hO();gc();gO();SO();TO();bc();Dc();DO();Oc();CO();RO();MO();FO();Ec();PO();LO();_c();UO();WO();GO();KO();ZO();rC();tC();aC();iC();uC();lC();pC();cC();hC();Xc();SC();TC();bC();AC();CC();NC();EC();BC();PC();LC();zC();UC();WC();GC();KC();ZC();XC();jC();hx();rR();nR();fR();uR();lR();dR();pR();mR();cR();hR();vR();yR();wR();Mx();Ex();DR();OR();CR();RR();PR();LR();zR();UR();WR();GR();KR();ZR();XR();jR();r2();o2();n2();i2();f2();s2();d2();m2();x2();v2();y2();w2();b2();A2();C2();N2();E2();B2();_2();k2();I2();q2();H2();V2();$2();Q2();Y2();J2();eN();tN();aN();iN();uN();sN();dN();pN();mN();cN();gN();yN();SN();ON();CN();RN();NN();MN();EN();FN();BN();_N();PN();LN();zN();UN();HN();VN();$N();QN();wM();DM();OM();CM();RM();_P();kP();IP();qP();HP();KP();ZP();XP();jP();r6();o6();a6();i6();f6();Ev();Fv();Bv();d6();m6();Lv();Iv();zv();g6();w6();D6();O6();R6();M6();F6();_6();L6();t7();a7();i7();u7();l7();p7();c7();h7();y7();S7();T7();b7();A7();C7();N7();E7();B7();_7();P7();I7();z7();U7();H7();G7();$7();K7();Q7();J7();j7();e9();r9();t9();o9();a9();i9();f9();s9();l9();p9();c9();h9();v9();g9();y9();S9()});var Te,Ar,fy,w9,T9,Wa,uy,b9,D9,A9,Gf,O9,C9,R9,N9,sy,M9,E9,ly,F9,B9,or,_9,P9,ol,dy,k9,Q,L9,Ft,I9,z9,q9,jr,U9,H9,W9,py,V9,G9,$9,K9,Q9,$f,Kf,Va,al,Z9,Y9,X9,nr,J9,my,j9,ek,hi,rk,vi,nl,tk,il,qt,ma,Ga,Lo,ok,ak,nk,fl,$a,Gr,Qf,Yo,ik,fk,uk,sk,ul,lk,cy,Zf,et,dk,pk,mk,ao,ck,sl,xk,hk,vk,Ut,gk,yk,Sk,gi,wk,yi,we,Tk,bk,Dk,xy,Ak,Ok,Ck,To,Rk,Nk,Si,hy,st,Mk,Ek,Fk,cr,Bk,ll,vy,_k,no,wi,ca,Ka,Pk,Yf,kk,Lk,Ik,io,gy,zk,qk,Rn,lt,Bt,Uk,Io,Hk,Wk,sr,Vk,Gk,$k,Kk,yy,Qa,Sy,Qk,dl,Lr,Ti,Zk,wy,Yk,Xk,Jk,Ty,wt,_t,pl,by,ml,cl,jk,Dy,eL,rL,Xf,xl,tL,Nn,Jt,Zr,oL,hl,aL,zo,nL,iL,fL,Mn,Ay,Oy,uL,sL,lL,dL,pL,wr,En,mL,cL,xL,hL,vL,Cy,gL,vl,Ry,yL,SL,gl,Ny,wL,My,Ey,Za,TL,bo,Fy,bL,By,_y,DL,yl,Ye,AL,OL,CL,RL,NL,ML,EL,FL,BL,_L,PL,kL,LL,IL,Py,Sl,zL,qL,UL,HL,WL,VL,GL,$L,KL,QL,ZL,YL,XL,JL,jL,eI,rI,tI,oI,aI,nI,iI,fI,uI,sI,lI,dt,dI,bi,pI,mI,cI,ky,xI,hI,vI,gI,yI,SI,Ly,wI,Iy,TI,bI,zy,DI,AI,OI,qy,Uy,CI,RI,NI,MI,wl,EI,Hy,FI,BI,_I,PI,kI,Tl,Wy,LI,Vy,II,Gy,zI,$y=T(()=>{Td();tl();Te=Ld({config:me}),Ar=qd({}),fy=Eg({BigNumber:Te,config:me}),w9=Ag({}),T9=i0({BigNumber:Te,config:me}),Wa=Wd({}),uy=zg({Complex:Ar}),b9=Cg({BigNumber:Te,config:me}),D9=_g({BigNumber:Te,config:me}),A9=kg({BigNumber:Te,config:me}),Gf=Gd({}),O9=Rg({BigNumber:Te,config:me}),C9=Og({}),R9=Fg({BigNumber:Te,config:me}),N9=Vd({}),sy=Ed({}),M9=Lg({BigNumber:Te,config:me}),E9=A0({BigNumber:Te,config:me}),ly=Mg({BigNumber:Te,config:me}),F9=Dg({}),B9=qg({}),or=jd({Matrix:Gf}),_9=x0({BigNumber:Te,config:me}),P9=Bg({BigNumber:Te,config:me}),ol=Ng({BigNumber:Te,config:me}),dy=bg({}),k9=Ig({BigNumber:Te,config:me}),Q=Md({BigNumber:Te,Complex:Ar,DenseMatrix:or,Fraction:Wa}),L9=c0({BigNumber:Te,config:me}),Ft=Sm({typed:Q}),I9=Wx({Complex:Ar,config:me,typed:Q}),z9=Gx({BigNumber:Te,typed:Q}),q9=Kx({BigNumber:Te,Complex:Ar,config:me,typed:Q}),jr=Tm({typed:Q}),U9=oc({typed:Q}),H9=Yx({BigNumber:Te,Complex:Ar,config:me,typed:Q}),W9=Jx({typed:Q}),py=jx({typed:Q}),V9=rh({Complex:Ar,config:me,typed:Q}),G9=fm({typed:Q}),$9=ec({typed:Q}),K9=sm({typed:Q}),Q9=ep({typed:Q}),$f=Uv({typed:Q}),Kf=dm({Complex:Ar,typed:Q}),Va=ac({typed:Q}),al=th({typed:Q}),Z9=ah({BigNumber:Te,typed:Q}),Y9=ih({BigNumber:Te,typed:Q}),X9=Cm({typed:Q}),nr=am({config:me,typed:Q}),J9=Hc({typed:Q}),my=Rm({typed:Q}),j9=Nm({Complex:Ar,typed:Q}),ek=bf({typed:Q}),hi=hc({typed:Q}),rk=Df({typed:Q}),vi=$c({typed:Q}),nl=yc({typed:Q}),tk=Zc({format:vi,typed:Q}),il=nc({typed:Q}),qt=op({typed:Q}),ma=Xp({config:me,typed:Q}),Ga=em({config:me,typed:Q}),Lo=rm({equalScalar:nr,typed:Q}),ok=Pg({BigNumber:Te,config:me}),ak=Vv({Complex:Ar,typed:Q}),nk=zm({Complex:Ar,config:me,typed:Q}),fl=qm({Complex:Ar,config:me,typed:Q}),$a=Af({typed:Q}),Gr=Um({typed:Q}),Qf=fc({typed:Q}),Yo=im({typed:Q}),ik=Qc({format:vi,typed:Q}),fk=tg({config:me,typed:Q}),uk=Ef({typed:Q}),sk=ag({config:me,typed:Q}),ul=ic({typed:Q}),lk=uh({BigNumber:Te,typed:Q}),cy=Vm({BigNumber:Te,Fraction:Wa,complex:Kf,typed:Q}),Zf=lh({typed:Q}),et=nm({Matrix:Gf,equalScalar:nr,typed:Q}),dk=vm({typed:Q}),pk=$m({typed:Q}),mk=um({typed:Q}),ao=bm({typed:Q}),ck=ph({typed:Q}),sl=om({typed:Q}),xk=Vx({Complex:Ar,config:me,typed:Q}),hk=Qx({BigNumber:Te,typed:Q}),vk=Zx({BigNumber:Te,Complex:Ar,config:me,typed:Q}),Ut=lm({BigNumber:Te,typed:Q}),gk=Hv({typed:Q}),yk=oh({typed:Q}),Sk=fh({BigNumber:Te,typed:Q}),gi=tm({typed:Q}),wk=jc({typed:Q}),yi=ti({isInteger:qt,typed:Q}),we=mm({DenseMatrix:or,Matrix:Gf,SparseMatrix:et,typed:Q}),Tk=cm({isZero:Lo,matrix:we,typed:Q}),bk=Ac({BigNumber:Te,config:me,matrix:we,typed:Q}),Dk=ng({config:me,log2:fl,typed:Q}),xy=Cc({isInteger:qt,matrix:we,typed:Q}),Ak=sh({BigNumber:Te,typed:Q}),Ok=dh({typed:Q}),Ck=Ux({SparseMatrix:et,typed:Q}),To=Gm({Complex:Ar,config:me,typed:Q}),Rk=Bc({typed:Q}),Nk=mh({typed:Q}),Si=Pc({matrix:we,typed:Q}),hy=Qm({BigNumber:Te,config:me,matrix:we,typed:Q}),st=Lc({BigNumber:Te,config:me,matrix:we,typed:Q}),Mk=$x({BigNumber:Te,Complex:Ar,config:me,typed:Q}),Ek=Xx({Complex:Ar,config:me,typed:Q}),Fk=Kc({format:vi,typed:Q}),cr=wf({isInteger:qt,matrix:we,typed:Q}),Bk=nh({BigNumber:Te,typed:Q}),ll=kc({conj:Va,transpose:Si,typed:Q}),vy=cc({DenseMatrix:or,SparseMatrix:et,matrix:we,typed:Q}),_k=Xm({concat:cr,equalScalar:nr,matrix:we,multiplyScalar:Gr,typed:Q}),no=Sx({DenseMatrix:or,SparseMatrix:et,concat:cr,equalScalar:nr,matrix:we,typed:Q}),wi=pm({Fraction:Wa,typed:Q}),ca=Sc({BigNumber:Te,DenseMatrix:or,SparseMatrix:et,config:me,matrix:we,typed:Q}),Ka=Jp({typed:Q}),Pk=wc({matrix:we,multiplyScalar:Gr,typed:Q}),Yf=Ax({DenseMatrix:or,SparseMatrix:et,concat:cr,config:me,matrix:we,typed:Q}),kk=mx({DenseMatrix:or,concat:cr,equalScalar:nr,matrix:we,typed:Q,zeros:st}),Lk=Vc({isNaN:gi,isNumeric:Ka,typed:Q}),Ik=Wm({BigNumber:Te,concat:cr,equalScalar:nr,matrix:we,typed:Q}),io=ex({bignumber:Ut,fraction:wi,number:Yo}),gy=Gc({config:me,multiplyScalar:Gr,numeric:io,typed:Q}),zk=Rc({config:me,matrix:we}),qk=cx({DenseMatrix:or,concat:cr,equalScalar:nr,matrix:we,typed:Q,zeros:st}),Rn=ox({BigNumber:Te,DenseMatrix:or,config:me,equalScalar:nr,matrix:we,typed:Q,zeros:st}),lt=Fc({matrix:we,config:me,typed:Q}),Bt=Tx({DenseMatrix:or,SparseMatrix:et,bignumber:Ut,concat:cr,config:me,matrix:we,typed:Q}),Uk=Jc({concat:cr,matrix:we,typed:Q}),Io=gm({typed:Q}),Hk=Cx({DenseMatrix:or,SparseMatrix:et,concat:cr,config:me,equalScalar:nr,matrix:we,typed:Q}),Wk=sc({DenseMatrix:or,SparseMatrix:et,concat:cr,matrix:we,typed:Q}),sr=Dh({DenseMatrix:or,SparseMatrix:et,addScalar:jr,concat:cr,equalScalar:nr,matrix:we,typed:Q}),Vk=eh({BigNumber:Te,DenseMatrix:or,concat:cr,equalScalar:nr,matrix:we,typed:Q}),Gk=gf({concat:cr,equalScalar:nr,matrix:we,typed:Q}),$k=yf({DenseMatrix:or,concat:cr,equalScalar:nr,matrix:we,typed:Q}),Kk=tc({DenseMatrix:or,SparseMatrix:et,concat:cr,matrix:we,typed:Q}),yy=Dm({BigNumber:Te,Complex:Ar,Fraction:Wa,config:me,isNegative:ma,matrix:we,typed:Q,unaryMinus:Io}),Qa=vx({BigNumber:Te,DenseMatrix:or,Fraction:Wa,concat:cr,config:me,equalScalar:nr,matrix:we,typed:Q}),Sy=yx({concat:cr,matrix:we,typed:Q}),Qk=pc({prod:gy,size:lt,typed:Q}),dl=Ox({equal:no,typed:Q}),Lr=rx({numeric:io,typed:Q}),Ti=ux({DenseMatrix:or,SparseMatrix:et,concat:cr,divideScalar:Lr,equalScalar:nr,matrix:we,typed:Q}),Zk=wx({compareText:Sy,isZero:Lo,typed:Q}),wy=cf({DenseMatrix:or,config:me,equalScalar:nr,matrix:we,round:Rn,typed:Q,zeros:st}),Yk=Lm({BigNumber:Te,DenseMatrix:or,concat:cr,config:me,equalScalar:nr,matrix:we,round:Rn,typed:Q,zeros:st}),Xk=jp({isNumeric:Ka,typed:Q}),Jk=Ah({abs:Ft,addScalar:jr,divideScalar:Lr,isPositive:Ga,multiplyScalar:Gr,smaller:Bt,sqrt:To,typed:Q}),Ty=Fx({DenseMatrix:or,smaller:Bt}),wt=Bx({ImmutableDenseMatrix:Ty,getMatrixDataType:nl}),_t=Dx({DenseMatrix:or,SparseMatrix:et,bignumber:Ut,concat:cr,config:me,matrix:we,typed:Q}),pl=ax({Complex:Ar,config:me,divideScalar:Lr,typeOf:sl,typed:Q}),by=sx({DenseMatrix:or,divideScalar:Lr,equalScalar:nr,matrix:we,multiplyScalar:Gr,subtractScalar:ao,typed:Q}),ml=hm({flatten:hi,matrix:we,size:lt,typed:Q}),cl=Bf({config:me,larger:_t,numeric:io,typed:Q}),jk=_f({config:me,numeric:io,smaller:Bt,typed:Q}),Dy=hf({DenseMatrix:or,concat:cr,config:me,equalScalar:nr,matrix:we,round:Rn,typed:Q,zeros:st}),eL=ix({Complex:Ar,config:me,divideScalar:Lr,typed:Q}),rL=Sf({DenseMatrix:or,concat:cr,equalScalar:nr,matrix:we,typed:Q}),Xf=Rx({compare:Qa,isNaN:gi,isNumeric:Ka,typed:Q}),xl=av({addScalar:jr,complex:Kf,conj:Va,divideScalar:Lr,equal:no,identity:ca,isZero:Lo,matrix:we,multiplyScalar:Gr,sign:cy,sqrt:To,subtractScalar:ao,typed:Q,unaryMinus:Io,zeros:st}),tL=xx({DenseMatrix:or,concat:cr,equalScalar:nr,matrix:we,typed:Q,zeros:st}),Nn=bx({DenseMatrix:or,SparseMatrix:et,concat:cr,config:me,matrix:we,typed:Q}),Jt=Mf({add:sr,matrix:we,typed:Q,zeros:st}),Zr=Km({DenseMatrix:or,concat:cr,equalScalar:nr,matrix:we,subtractScalar:ao,typed:Q,unaryMinus:Io}),oL=Rh({add:sr,matrix:we,typed:Q}),hl=lx({DenseMatrix:or,divideScalar:Lr,equalScalar:nr,matrix:we,multiplyScalar:Gr,subtractScalar:ao,typed:Q}),aL=ug({addScalar:jr,combinations:$f,divideScalar:Lr,isInteger:qt,isNegative:ma,multiplyScalar:Gr,typed:Q}),zo=gx({compare:Qa,typed:Q}),nL=sg({addScalar:jr,combinations:$f,isInteger:qt,isNegative:ma,isPositive:Ga,larger:_t,typed:Q}),iL=Of({matrix:we,number:Yo,subtract:Zr,typed:Q}),fL=Nv({abs:Ft,addScalar:jr,deepEqual:dl,divideScalar:Lr,multiplyScalar:Gr,sqrt:To,subtractScalar:ao,typed:Q}),Mn=Ch({addScalar:jr,conj:Va,multiplyScalar:Gr,size:lt,typed:Q}),Ay=_x({larger:_t,smaller:Bt}),Oy=Nh({Index:wt,typed:Q}),uL=Zm({BigNumber:Te,add:sr,config:me,equal:no,isInteger:qt,mod:Dy,smaller:Bt,typed:Q,xgcd:hy}),sL=Im({concat:cr,equalScalar:nr,matrix:we,typed:Q}),lL=nx({Complex:Ar,config:me,divideScalar:Lr,log:pl,typed:Q}),dL=dx({DenseMatrix:or,divideScalar:Lr,equalScalar:nr,matrix:we,multiplyScalar:Gr,subtractScalar:ao,typed:Q}),pL=xm({flatten:hi,matrix:we,size:lt,typed:Q}),wr=Hm({addScalar:jr,dot:Mn,equalScalar:nr,matrix:we,multiplyScalar:Gr,typed:Q}),En=Rf({bignumber:Ut,matrix:we,add:sr,config:me,isPositive:Ga,larger:_t,largerEq:Yf,smaller:Bt,smallerEq:Nn,typed:Q}),mL=Nf({Index:wt,matrix:we,range:En,typed:Q}),cL=ch({DenseMatrix:or,Index:wt,compareNatural:zo,size:lt,subset:Jt,typed:Q}),xL=hh({DenseMatrix:or,Index:wt,compareNatural:zo,size:lt,subset:Jt,typed:Q}),hL=gh({Index:wt,compareNatural:zo,size:lt,subset:Jt,typed:Q}),vL=Sh({Index:wt,compareNatural:zo,size:lt,subset:Jt,typed:Q}),Cy=sv({SparseMatrix:et,abs:Ft,add:sr,divideScalar:Lr,larger:_t,largerEq:Yf,multiply:wr,subtract:Zr,transpose:Si,typed:Q}),gL=Nx({compare:Qa,compareNatural:zo,matrix:we,typed:Q}),vl=ym({config:me,numeric:io,typed:Q}),Ry=px({DenseMatrix:or,divideScalar:Lr,equalScalar:nr,matrix:we,multiplyScalar:Gr,subtractScalar:ao,typed:Q}),yL=Sg({Complex:Ar,add:sr,multiply:wr,number:Yo,typed:Q}),SL=Ff({concat:cr,equalScalar:nr,matrix:we,not:Qf,typed:Q,zeros:st}),gl=Om({DenseMatrix:or,config:me,equalScalar:nr,matrix:we,round:Rn,typed:Q,zeros:st}),Ny=Tf({Index:wt,matrix:we,range:En,typed:Q}),wL=mc({matrix:we,multiply:wr,subtract:Zr,typed:Q}),My=yv({divideScalar:Lr,isZero:Lo,matrix:we,multiply:wr,subtractScalar:ao,typed:Q,unaryMinus:Io}),Ey=Em({Complex:Ar,DenseMatrix:or,ceil:gl,equalScalar:nr,floor:wy,matrix:we,typed:Q,zeros:st}),Za=Sv({abs:Ft,addScalar:jr,det:My,divideScalar:Lr,identity:ca,matrix:we,multiply:wr,typed:Q,unaryMinus:Io}),TL=wv({Complex:Ar,add:sr,ctranspose:ll,deepEqual:dl,divideScalar:Lr,dot:Mn,dotDivide:Ti,equal:no,inv:Za,matrix:we,multiply:wr,typed:Q}),bo=tx({Complex:Ar,config:me,fraction:wi,identity:ca,inv:Za,matrix:we,multiply:wr,number:Yo,typed:Q}),Fy=xh({DenseMatrix:or,Index:wt,compareNatural:zo,size:lt,subset:Jt,typed:Q}),bL=yh({Index:wt,compareNatural:zo,size:lt,subset:Jt,typed:Q}),By=Th({Index:wt,concat:cr,setDifference:Fy,size:lt,subset:Jt,typed:Q}),_y=Px({FibonacciHeap:Ay,addScalar:jr,equalScalar:nr}),DL=Dv({abs:Ft,add:sr,identity:ca,inv:Za,map:$a,max:cl,multiply:wr,size:lt,sqrt:To,subtract:Zr,typed:Q}),yl=Lf({add:sr,config:me,numeric:io,typed:Q}),Ye=zx({BigNumber:Te,Complex:Ar,Fraction:Wa,abs:Ft,addScalar:jr,config:me,divideScalar:Lr,equal:no,fix:Ey,format:vi,isNumeric:Ka,multiplyScalar:Gr,number:Yo,pow:bo,round:Rn,subtractScalar:ao}),AL=Kg({BigNumber:Te,Unit:Ye,config:me}),OL=R0({BigNumber:Te,Unit:Ye,config:me}),CL=h0({BigNumber:Te,Unit:Ye,config:me}),RL=Yg({BigNumber:Te,Unit:Ye,config:me}),NL=g0({BigNumber:Te,Unit:Ye,config:me}),ML=Xg({BigNumber:Te,Unit:Ye,config:me}),EL=Qg({BigNumber:Te,Unit:Ye,config:me}),FL=If({add:sr,typed:Q,unaryPlus:vl}),BL=s0({BigNumber:Te,Unit:Ye,config:me}),_L=fx({DenseMatrix:or,SparseMatrix:et,concat:cr,equalScalar:nr,matrix:we,pow:bo,typed:Q}),PL=$g({BigNumber:Te,Unit:Ye,config:me}),kL=Zg({BigNumber:Te,Unit:Ye,config:me}),LL=bv({abs:Ft,add:sr,identity:ca,inv:Za,multiply:wr,typed:Q}),IL=y0({BigNumber:Te,Unit:Ye,config:me}),Py=Ic({addScalar:jr,ceil:gl,conj:Va,divideScalar:Lr,dotDivide:Ti,exp:my,i:uy,log2:fl,matrix:we,multiplyScalar:Gr,pow:bo,tau:ly,typed:Q}),Sl=Wv({BigNumber:Te,Complex:Ar,config:me,multiplyScalar:Gr,pow:bo,typed:Q}),zL=Hg({BigNumber:Te,Unit:Ye,config:me}),qL=f0({BigNumber:Te,Unit:Ye,config:me}),UL=zc({conj:Va,dotDivide:Ti,fft:Py,typed:Q}),HL=Jg({BigNumber:Te,Unit:Ye,config:me}),WL=r0({BigNumber:Te,Unit:Ye,config:me}),VL=w0({BigNumber:Te,Unit:Ye,config:me}),GL=Gg({BigNumber:Te,Unit:Ye,config:me}),$L=N0({BigNumber:Te,Unit:Ye,config:me}),KL=b0({BigNumber:Te,Unit:Ye,config:me}),QL=l0({BigNumber:Te,Unit:Ye,config:me}),ZL=e0({BigNumber:Te,Unit:Ye,config:me}),YL=P0({BigNumber:Te,Unit:Ye,config:me}),XL=F0({BigNumber:Te,Unit:Ye,config:me}),JL=k0({BigNumber:Te,Unit:Ye,config:me}),jL=u0({BigNumber:Te,Unit:Ye,config:me}),eI=d0({BigNumber:Te,Unit:Ye,config:me}),rI=Vg({BigNumber:Te,Unit:Ye,config:me}),tI=p0({BigNumber:Te,Unit:Ye,config:me}),oI=O0({BigNumber:Te,Unit:Ye,config:me}),aI=wh({compareNatural:zo,typed:Q}),nI=Ug({BigNumber:Te,Unit:Ye,config:me}),iI=C0({BigNumber:Te,Unit:Ye,config:me}),fI=m0({BigNumber:Te,Unit:Ye,config:me}),uI=v0({BigNumber:Te,Unit:Ye,config:me}),sI=t0({BigNumber:Te,Unit:Ye,config:me}),lI=Hx({Unit:Ye,typed:Q}),dt=Rv({divideScalar:Lr,equalScalar:nr,inv:Za,matrix:we,multiply:wr,typed:Q}),dI=a0({BigNumber:Te,Unit:Ye,config:me}),bi=Gv({gamma:Sl,typed:Q}),pI=S0({BigNumber:Te,Unit:Ye,config:me}),mI=E0({BigNumber:Te,Unit:Ye,config:me}),cI=Mv({abs:Ft,add:sr,addScalar:jr,config:me,divideScalar:Lr,equalScalar:nr,flatten:hi,isNumeric:Ka,isZero:Lo,matrix:we,multiply:wr,multiplyScalar:Gr,smaller:Bt,subtract:Zr,typed:Q}),ky=ov({DenseMatrix:or,Spa:_y,SparseMatrix:et,abs:Ft,addScalar:jr,divideScalar:Lr,equalScalar:nr,larger:_t,matrix:we,multiplyScalar:Gr,subtractScalar:ao,typed:Q,unaryMinus:Io}),xI=jg({BigNumber:Te,Unit:Ye,config:me}),hI=M0({BigNumber:Te,Unit:Ye,config:me}),vI=Kv({add:sr,divide:dt,factorial:bi,isInteger:qt,isPositive:Ga,multiply:wr,typed:Q}),gI=Qv({factorial:bi,typed:Q}),yI=B0({BigNumber:Te,Unit:Ye,config:me}),SI=pv({add:sr,cbrt:yy,divide:dt,equalScalar:nr,im:il,isZero:Lo,multiply:wr,re:ul,sqrt:To,subtract:Zr,typeOf:sl,typed:Q,unaryMinus:Io}),Ly=vh({DenseMatrix:or,Index:wt,compareNatural:zo,size:lt,subset:Jt,typed:Q}),wI=Uc({abs:Ft,add:sr,bignumber:Ut,divide:dt,isNegative:ma,isPositive:Ga,larger:_t,map:$a,matrix:we,max:cl,multiply:wr,smaller:Bt,subtract:Zr,typed:Q,unaryMinus:Io}),Iy=ig({bignumber:Ut,addScalar:jr,combinations:$f,divideScalar:Lr,factorial:bi,isInteger:qt,isNegative:ma,larger:_t,multiplyScalar:Gr,number:Yo,pow:bo,subtractScalar:ao,typed:Q}),TI=qx({Unit:Ye,typed:Q}),bI=fg({addScalar:jr,isInteger:qt,isNegative:ma,stirlingS2:Iy,typed:Q}),zy=Tv({abs:Ft,add:sr,addScalar:jr,atan:py,bignumber:Ut,column:Ny,complex:Kf,config:me,cos:al,diag:vy,divideScalar:Lr,dot:Mn,equal:no,flatten:hi,im:il,inv:Za,larger:_t,matrix:we,matrixFromColumns:ml,multiply:wr,multiplyScalar:Gr,number:Yo,qr:xl,re:ul,reshape:xy,sin:Zf,size:lt,smaller:Bt,sqrt:To,subtract:Zr,typed:Q,usolve:hl,usolveAll:Ry}),DI=n0({BigNumber:Te,Unit:Ye,config:me}),AI=T0({BigNumber:Te,Unit:Ye,config:me}),OI=$v({divide:dt,dotDivide:Ti,isNumeric:Ka,log:pl,map:$a,matrix:we,multiply:wr,sum:yl,typed:Q}),qy=dv({DenseMatrix:or,lsolve:by,lup:ky,matrix:we,slu:Cy,typed:Q,usolve:hl}),Uy=zf({add:sr,divide:dt,typed:Q}),CI=D0({BigNumber:Te,Unit:Ye,config:me}),RI=Wg({BigNumber:Te,Unit:Ye,config:me}),NI=Uf({bignumber:Ut,add:sr,compare:Qa,divide:dt,isInteger:qt,larger:_t,mapSlices:yi,multiply:wr,partitionSelect:Xf,smaller:Bt,smallerEq:Nn,subtract:Zr,typed:Q}),MI=bh({Index:wt,concat:cr,setIntersect:Ly,setSymDifference:By,size:lt,subset:Jt,typed:Q}),wl=qf({add:sr,divide:dt,isNaN:gi,mapSlices:yi,multiply:wr,subtract:Zr,typed:Q}),EI=o0({BigNumber:Te,Unit:Ye,config:me}),Hy=_v({add:sr,compare:Qa,divide:dt,partitionSelect:Xf,typed:Q}),FI=qv({add:sr,divide:dt,matrix:we,mean:Uy,multiply:wr,pow:bo,sqrt:To,subtract:Zr,sum:yl,typed:Q}),BI=wg({Complex:Ar,add:sr,divide:dt,matrix:we,multiply:wr,typed:Q}),_I=Pv({abs:Ft,map:$a,median:Hy,subtract:Zr,typed:Q}),PI=Hf({map:$a,sqrt:To,typed:Q,variance:wl}),kI=Wc({BigNumber:Te,Complex:Ar,add:sr,config:me,divide:dt,equal:no,factorial:bi,gamma:Sl,isNegative:ma,multiply:wr,pi:ol,pow:bo,sin:Zf,smallerEq:Nn,subtract:Zr,typed:Q}),Tl=Oh({abs:Ft,add:sr,conj:Va,ctranspose:ll,eigs:zy,equalScalar:nr,larger:_t,matrix:we,multiply:wr,pow:bo,smaller:Bt,sqrt:To,typed:Q}),Wy=Mc({BigNumber:Te,DenseMatrix:or,SparseMatrix:et,addScalar:jr,config:me,cos:al,matrix:we,multiplyScalar:Gr,norm:Tl,sin:Zf,typed:Q,unaryMinus:Io}),LI=_0({BigNumber:Te,Unit:Ye,config:me}),Vy=Ov({identity:ca,matrix:we,multiply:wr,norm:Tl,qr:xl,subtract:Zr,typed:Q}),II=Nc({multiply:wr,rotationMatrix:Wy,typed:Q}),Gy=Av({abs:Ft,add:sr,concat:cr,identity:ca,index:Oy,lusolve:qy,matrix:we,matrixFromColumns:ml,multiply:wr,range:En,schur:Vy,subset:Jt,subtract:Zr,transpose:Si,typed:Q}),zI=Cv({matrix:we,multiply:wr,sylvester:Gy,transpose:Si,typed:Q})});var Di,Jf,qI,Pt,Ai,xa,Fn,UI,Oi,HI,WI,Ya,VI,kre,Ky,GI,Lre,Ci,$I,Ri,Xa,Ja,qo,KI,Qy,Ire,Zy,Yy,QI,ZI,bl,zre,qre,Ure,Hre,Wre,Vre,YI=T(()=>{Oa();Td();tl();$y();Di={},Jf={},qI={},Pt=Eh({mathWithTransform:Jf}),Ai=Vh({Node:Pt}),xa=$h({Node:Pt}),Fn=Kh({Node:Pt}),UI=Zh({Node:Pt}),Oi=_h({Node:Pt}),HI=kh({Node:Pt,ResultSet:sy}),WI=Lh({Node:Pt}),Ya=Uh({Node:Pt}),VI=Qh({Node:Pt}),kre=Tg({classes:qI}),Ky=cv({math:Di,typed:Q}),GI=Hh({Node:Pt,typed:Q}),Lre=gv({Chain:Ky,typed:Q}),Ci=Bh({Node:Pt,subset:Jt}),$I=Ph({matrix:we,Node:Pt,subset:Jt}),Ri=Wh({Node:Pt,size:lt}),Xa=Yh({Unit:Ye,Node:Pt,math:Di}),Ja=Xh({Node:Pt,SymbolNode:Xa,math:Di}),qo=Jh({AccessorNode:Ci,ArrayNode:Oi,AssignmentNode:$I,BlockNode:HI,ConditionalNode:WI,ConstantNode:Ya,FunctionAssignmentNode:GI,FunctionNode:Ja,IndexNode:Ri,ObjectNode:Ai,OperatorNode:xa,ParenthesisNode:Fn,RangeNode:VI,RelationalNode:UI,SymbolNode:Xa,config:me,numeric:io,typed:Q}),KI=hg({ConstantNode:Ya,FunctionNode:Ja,OperatorNode:xa,ParenthesisNode:Fn,parse:qo,typed:Q}),Qy=cg({bignumber:Ut,fraction:wi,AccessorNode:Ci,ArrayNode:Oi,ConstantNode:Ya,FunctionNode:Ja,IndexNode:Ri,ObjectNode:Ai,OperatorNode:xa,SymbolNode:Xa,config:me,mathWithTransform:Jf,matrix:we,typed:Q}),Ire=jh({parse:qo,typed:Q}),Zy=xg({AccessorNode:Ci,ArrayNode:Oi,ConstantNode:Ya,FunctionNode:Ja,IndexNode:Ri,ObjectNode:Ai,OperatorNode:xa,ParenthesisNode:Fn,SymbolNode:Xa,add:sr,divide:dt,equal:no,isZero:Lo,multiply:wr,parse:qo,pow:bo,subtract:Zr,typed:Q}),Yy=ev({parse:qo,typed:Q}),QI=mv({evaluate:Yy}),ZI=rv({evaluate:Yy,parse:qo}),bl=mg({AccessorNode:Ci,ArrayNode:Oi,ConstantNode:Ya,FunctionNode:Ja,IndexNode:Ri,ObjectNode:Ai,OperatorNode:xa,ParenthesisNode:Fn,SymbolNode:Xa,equal:no,parse:qo,replacer:dy,resolve:KI,simplifyConstant:Qy,simplifyCore:Zy,typed:Q}),zre=vg({OperatorNode:xa,parse:qo,simplify:bl,typed:Q}),qre=lg({parse:qo,typed:Q}),Ure=tv({Parser:ZI,typed:Q}),Hre=yg({bignumber:Ut,fraction:wi,AccessorNode:Ci,ArrayNode:Oi,ConstantNode:Ya,FunctionNode:Ja,IndexNode:Ri,ObjectNode:Ai,OperatorNode:xa,ParenthesisNode:Fn,SymbolNode:Xa,add:sr,config:me,divide:dt,equal:no,isZero:Lo,mathWithTransform:Jf,matrix:we,multiply:wr,parse:qo,pow:bo,simplify:bl,simplifyConstant:Qy,simplifyCore:Zy,subtract:Zr,typed:Q}),Wre=gg({ConstantNode:Ya,FunctionNode:Ja,OperatorNode:xa,ParenthesisNode:Fn,SymbolNode:Xa,config:me,equal:no,isZero:Lo,numeric:io,parse:qo,simplify:bl,typed:Q}),Vre=vv({Help:QI,mathWithTransform:Jf,typed:Q});Pr(Di,{e:fy,false:w9,fineStructure:T9,i:uy,Infinity:b9,LN10:D9,LOG10E:A9,NaN:O9,null:C9,phi:R9,SQRT1_2:M9,sackurTetrode:E9,tau:ly,true:F9,E:fy,version:B9,efimovFactor:_9,LN2:P9,pi:ol,replacer:dy,reviver:kre,SQRT2:k9,typed:Q,PI:ol,weakMixingAngle:L9,abs:Ft,acos:I9,acot:z9,acsc:q9,addScalar:jr,arg:U9,asech:H9,asinh:W9,atan:py,atanh:V9,bigint:G9,bitNot:$9,boolean:K9,clone:Q9,combinations:$f,complex:Kf,conj:Va,cos:al,cot:Z9,csc:Y9,cube:X9,equalScalar:nr,erf:J9,exp:my,expm1:j9,filter:ek,flatten:hi,forEach:rk,format:vi,getMatrixDataType:nl,hex:tk,im:il,isInteger:qt,isNegative:ma,isPositive:Ga,isZero:Lo,LOG2E:ok,lgamma:ak,log10:nk,log2:fl,map:$a,multiplyScalar:Gr,not:Qf,number:Yo,oct:ik,pickRandom:fk,print:uk,random:sk,re:ul,sec:lk,sign:cy,sin:Zf,splitUnit:dk,square:pk,string:mk,subtractScalar:ao,tan:ck,typeOf:sl,acosh:xk,acsch:hk,asec:vk,bignumber:Ut,chain:Lre,combinationsWithRep:gk,cosh:yk,csch:Sk,isNaN:gi,isPrime:wk,mapSlices:yi,matrix:we,matrixFromFunction:Tk,ones:bk,randomInt:Dk,reshape:xy,sech:Ak,sinh:Ok,sparse:Ck,sqrt:To,squeeze:Rk,tanh:Nk,transpose:Si,xgcd:hy,zeros:st,acoth:Mk,asin:Ek,bin:Fk,concat:cr,coth:Bk,ctranspose:ll,diag:vy,dotMultiply:_k,equal:no,fraction:wi,identity:ca,isNumeric:Ka,kron:Pk,largerEq:Yf,leftShift:kk,mode:Lk,nthRoot:Ik,numeric:io,prod:gy,resize:zk,rightArithShift:qk,round:Rn,size:lt,smaller:Bt,to:Uk,unaryMinus:Io,unequal:Hk,xor:Wk,add:sr,atan2:Vk,bitAnd:Gk,bitOr:$k,bitXor:Kk,cbrt:yy,compare:Qa,compareText:Sy,count:Qk,deepEqual:dl,divideScalar:Lr,dotDivide:Ti,equalText:Zk,floor:wy,gcd:Yk,hasNumericValue:Xk,hypot:Jk,larger:_t,log:pl,lsolve:by,matrixFromColumns:ml,max:cl,min:jk,mod:Dy,nthRoots:eL,or:rL,partitionSelect:Xf,qr:xl,rightLogShift:tL,smallerEq:Nn,subset:Jt,subtract:Zr,trace:oL,usolve:hl,catalan:aL,compareNatural:zo,composition:nL,diff:iL,distance:fL,dot:Mn,index:Oy,invmod:uL,lcm:sL,log1p:lL,lsolveAll:dL,matrixFromRows:pL,multiply:wr,range:En,row:mL,setCartesian:cL,setDistinct:xL,setIsSubset:hL,setPowerset:vL,slu:Cy,sort:gL,unaryPlus:vl,usolveAll:Ry,zpk2tf:yL,and:SL,ceil:gl,column:Ny,cross:wL,det:My,fix:Ey,inv:Za,pinv:TL,pow:bo,setDifference:Fy,setMultiplicity:bL,setSymDifference:By,sqrtm:DL,sum:yl,vacuumImpedance:AL,wienDisplacement:OL,atomicMass:CL,bohrMagneton:RL,boltzmann:NL,conductanceQuantum:ML,coulomb:EL,cumsum:FL,deuteronMass:BL,dotPow:_L,electricConstant:PL,elementaryCharge:kL,expm:LL,faraday:IL,fft:Py,gamma:Sl,gravitationConstant:zL,hartreeEnergy:qL,ifft:UL,inverseConductanceQuantum:HL,klitzing:WL,loschmidt:VL,magneticConstant:GL,molarMass:$L,molarPlanckConstant:KL,neutronMass:QL,nuclearMagneton:ZL,planckCharge:YL,planckLength:XL,planckTemperature:JL,protonMass:jL,quantumOfCirculation:eI,reducedPlanckConstant:rI,rydberg:tI,secondRadiation:oI,setSize:aI,speedOfLight:nI,stefanBoltzmann:iI,thomsonCrossSection:fI,avogadro:uI,bohrRadius:sI,createUnit:lI,divide:dt,electronMass:dI,factorial:bi,firstRadiation:pI,gravity:mI,intersect:cI,lup:ky,magneticFluxQuantum:xI,molarMassC12:hI,multinomial:vI,parse:qo,permutations:gI,planckMass:yI,polynomialRoot:SI,resolve:KI,setIntersect:Ly,simplifyConstant:Qy,solveODE:wI,stirlingS2:Iy,unit:TI,bellNumbers:bI,compile:Ire,eigs:zy,fermiCoupling:DI,gasConstant:AI,kldivergence:OI,lusolve:qy,mean:Uy,molarVolume:CI,planckConstant:RI,quantileSeq:NI,setUnion:MI,simplifyCore:Zy,variance:wl,classicalElectronRadius:EI,evaluate:Yy,median:Hy,simplify:bl,symbolicEqual:zre,corr:FI,freqz:BI,leafCount:qre,mad:_I,parser:Ure,rationalize:Hre,std:PI,zeta:kI,derivative:Wre,norm:Tl,rotationMatrix:Wy,help:Vre,planckTime:LI,schur:Vy,rotate:II,sylvester:Gy,lyap:zI,config:me});Pr(Jf,Di,{mapSlices:L0({isInteger:qt,typed:Q}),filter:z0({typed:Q}),forEach:q0({typed:Q}),map:H0({typed:Q}),or:ay({DenseMatrix:or,concat:cr,equalScalar:nr,matrix:we,typed:Q}),and:oy({add:sr,concat:cr,equalScalar:nr,matrix:we,not:Qf,typed:Q,zeros:st}),concat:Z0({isInteger:qt,matrix:we,typed:Q}),index:U0({Index:wt,getMatrixDataType:nl}),print:ty({add:sr,matrix:we,typed:Q,zeros:st}),sum:J0({add:sr,config:me,numeric:io,typed:Q}),bitAnd:ny({add:sr,concat:cr,equalScalar:nr,matrix:we,not:Qf,typed:Q,zeros:st}),min:G0({config:me,numeric:io,smaller:Bt,typed:Q}),subset:Q0({add:sr,matrix:we,typed:Q,zeros:st}),bitOr:iy({DenseMatrix:or,concat:cr,equalScalar:nr,matrix:we,typed:Q}),cumsum:ey({add:sr,typed:Q,unaryPlus:vl}),diff:Y0({bignumber:Ut,matrix:we,number:Yo,subtract:Zr,typed:Q}),max:W0({config:me,larger:_t,numeric:io,typed:Q}),range:$0({bignumber:Ut,matrix:we,add:sr,config:me,isPositive:Ga,larger:_t,largerEq:Yf,smaller:Bt,smallerEq:Nn,typed:Q}),row:K0({Index:wt,matrix:we,range:En,typed:Q}),column:I0({Index:wt,matrix:we,range:En,typed:Q}),mean:V0({add:sr,divide:dt,typed:Q}),quantileSeq:j0({add:sr,bignumber:Ut,compare:Qa,divide:dt,isInteger:qt,larger:_t,mapSlices:yi,multiply:wr,partitionSelect:Xf,smaller:Bt,smallerEq:Nn,subtract:Zr,typed:Q}),variance:ry({add:sr,divide:dt,isNaN:gi,mapSlices:yi,multiply:wr,subtract:Zr,typed:Q}),std:X0({map:$a,sqrt:To,typed:Q,variance:wl})});Pr(qI,{BigNumber:Te,Complex:Ar,Fraction:Wa,Matrix:Gf,Node:Pt,ObjectNode:Ai,OperatorNode:xa,ParenthesisNode:Fn,Range:N9,RelationalNode:UI,ResultSet:sy,ArrayNode:Oi,BlockNode:HI,ConditionalNode:WI,ConstantNode:Ya,DenseMatrix:or,RangeNode:VI,Chain:Ky,FunctionAssignmentNode:GI,SparseMatrix:et,ImmutableDenseMatrix:Ty,Index:wt,AccessorNode:Ci,AssignmentNode:$I,FibonacciHeap:Ay,IndexNode:Ri,Spa:_y,Unit:Ye,SymbolNode:Xa,FunctionNode:Ja,Help:QI,Parser:ZI});Ky.createProxy(Di)});var XI=T(()=>{});var JI=T(()=>{});var jI=T(()=>{$y();YI();XI();JI();tl()});var ez=T(()=>{jI()});function Xy(e,r){var t,o=1;e==null&&(e=0),r==null&&(r=0);function a(){var n,i=t.length,u,l=0,f=0;for(n=0;n<i;++n)u=t[n],l+=u.x,f+=u.y;for(l=(l/i-e)*o,f=(f/i-r)*o,n=0;n<i;++n)u=t[n],u.x-=l,u.y-=f}return a.initialize=function(n){t=n},a.x=function(n){return arguments.length?(e=+n,a):e},a.y=function(n){return arguments.length?(r=+n,a):r},a.strength=function(n){return arguments.length?(o=+n,a):o},a}var rz=T(()=>{});function tz(e){let r=+this._x.call(null,e),t=+this._y.call(null,e);return oz(this.cover(r,t),r,t,e)}function oz(e,r,t,o){if(isNaN(r)||isNaN(t))return e;var a,n=e._root,i={data:o},u=e._x0,l=e._y0,f=e._x1,s=e._y1,d,m,p,x,c,v,y,b;if(!n)return e._root=i,e;for(;n.length;)if((c=r>=(d=(u+f)/2))?u=d:f=d,(v=t>=(m=(l+s)/2))?l=m:s=m,a=n,!(n=n[y=v<<1|c]))return a[y]=i,e;if(p=+e._x.call(null,n.data),x=+e._y.call(null,n.data),r===p&&t===x)return i.next=n,a?a[y]=i:e._root=i,e;do a=a?a[y]=new Array(4):e._root=new Array(4),(c=r>=(d=(u+f)/2))?u=d:f=d,(v=t>=(m=(l+s)/2))?l=m:s=m;while((y=v<<1|c)===(b=(x>=m)<<1|p>=d));return a[b]=n,a[y]=i,e}function az(e){var r,t,o=e.length,a,n,i=new Array(o),u=new Array(o),l=1/0,f=1/0,s=-1/0,d=-1/0;for(t=0;t<o;++t)isNaN(a=+this._x.call(null,r=e[t]))||isNaN(n=+this._y.call(null,r))||(i[t]=a,u[t]=n,a<l&&(l=a),a>s&&(s=a),n<f&&(f=n),n>d&&(d=n));if(l>s||f>d)return this;for(this.cover(l,f).cover(s,d),t=0;t<o;++t)oz(this,i[t],u[t],e[t]);return this}var nz=T(()=>{});function iz(e,r){if(isNaN(e=+e)||isNaN(r=+r))return this;var t=this._x0,o=this._y0,a=this._x1,n=this._y1;if(isNaN(t))a=(t=Math.floor(e))+1,n=(o=Math.floor(r))+1;else{for(var i=a-t||1,u=this._root,l,f;t>e||e>=a||o>r||r>=n;)switch(f=(r<o)<<1|e<t,l=new Array(4),l[f]=u,u=l,i*=2,f){case 0:a=t+i,n=o+i;break;case 1:t=a-i,n=o+i;break;case 2:a=t+i,o=n-i;break;case 3:t=a-i,o=n-i;break}this._root&&this._root.length&&(this._root=u)}return this._x0=t,this._y0=o,this._x1=a,this._y1=n,this}var fz=T(()=>{});function uz(){var e=[];return this.visit(function(r){if(!r.length)do e.push(r.data);while(r=r.next)}),e}var sz=T(()=>{});function lz(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}var dz=T(()=>{});function pt(e,r,t,o,a){this.node=e,this.x0=r,this.y0=t,this.x1=o,this.y1=a}var Dl=T(()=>{});function pz(e,r,t){var o,a=this._x0,n=this._y0,i,u,l,f,s=this._x1,d=this._y1,m=[],p=this._root,x,c;for(p&&m.push(new pt(p,a,n,s,d)),t==null?t=1/0:(a=e-t,n=r-t,s=e+t,d=r+t,t*=t);x=m.pop();)if(!(!(p=x.node)||(i=x.x0)>s||(u=x.y0)>d||(l=x.x1)<a||(f=x.y1)<n))if(p.length){var v=(i+l)/2,y=(u+f)/2;m.push(new pt(p[3],v,y,l,f),new pt(p[2],i,y,v,f),new pt(p[1],v,u,l,y),new pt(p[0],i,u,v,y)),(c=(r>=y)<<1|e>=v)&&(x=m[m.length-1],m[m.length-1]=m[m.length-1-c],m[m.length-1-c]=x)}else{var b=e-+this._x.call(null,p.data),h=r-+this._y.call(null,p.data),S=b*b+h*h;if(S<t){var w=Math.sqrt(t=S);a=e-w,n=r-w,s=e+w,d=r+w,o=p.data}}return o}var mz=T(()=>{Dl()});function cz(e){if(isNaN(s=+this._x.call(null,e))||isNaN(d=+this._y.call(null,e)))return this;var r,t=this._root,o,a,n,i=this._x0,u=this._y0,l=this._x1,f=this._y1,s,d,m,p,x,c,v,y;if(!t)return this;if(t.length)for(;;){if((x=s>=(m=(i+l)/2))?i=m:l=m,(c=d>=(p=(u+f)/2))?u=p:f=p,r=t,!(t=t[v=c<<1|x]))return this;if(!t.length)break;(r[v+1&3]||r[v+2&3]||r[v+3&3])&&(o=r,y=v)}for(;t.data!==e;)if(a=t,!(t=t.next))return this;return(n=t.next)&&delete t.next,a?(n?a.next=n:delete a.next,this):r?(n?r[v]=n:delete r[v],(t=r[0]||r[1]||r[2]||r[3])&&t===(r[3]||r[2]||r[1]||r[0])&&!t.length&&(o?o[y]=t:this._root=t),this):(this._root=n,this)}function xz(e){for(var r=0,t=e.length;r<t;++r)this.remove(e[r]);return this}var hz=T(()=>{});function vz(){return this._root}var gz=T(()=>{});function yz(){var e=0;return this.visit(function(r){if(!r.length)do++e;while(r=r.next)}),e}var Sz=T(()=>{});function wz(e){var r=[],t,o=this._root,a,n,i,u,l;for(o&&r.push(new pt(o,this._x0,this._y0,this._x1,this._y1));t=r.pop();)if(!e(o=t.node,n=t.x0,i=t.y0,u=t.x1,l=t.y1)&&o.length){var f=(n+u)/2,s=(i+l)/2;(a=o[3])&&r.push(new pt(a,f,s,u,l)),(a=o[2])&&r.push(new pt(a,n,s,f,l)),(a=o[1])&&r.push(new pt(a,f,i,u,s)),(a=o[0])&&r.push(new pt(a,n,i,f,s))}return this}var Tz=T(()=>{Dl()});function bz(e){var r=[],t=[],o;for(this._root&&r.push(new pt(this._root,this._x0,this._y0,this._x1,this._y1));o=r.pop();){var a=o.node;if(a.length){var n,i=o.x0,u=o.y0,l=o.x1,f=o.y1,s=(i+l)/2,d=(u+f)/2;(n=a[0])&&r.push(new pt(n,i,u,s,d)),(n=a[1])&&r.push(new pt(n,s,u,l,d)),(n=a[2])&&r.push(new pt(n,i,d,s,f)),(n=a[3])&&r.push(new pt(n,s,d,l,f))}t.push(o)}for(;o=t.pop();)e(o.node,o.x0,o.y0,o.x1,o.y1);return this}var Dz=T(()=>{Dl()});function Az(e){return e[0]}function Oz(e){return arguments.length?(this._x=e,this):this._x}var Cz=T(()=>{});function Rz(e){return e[1]}function Nz(e){return arguments.length?(this._y=e,this):this._y}var Mz=T(()=>{});function jf(e,r,t){var o=new Jy(r??Az,t??Rz,NaN,NaN,NaN,NaN);return e==null?o:o.addAll(e)}function Jy(e,r,t,o,a,n){this._x=e,this._y=r,this._x0=t,this._y0=o,this._x1=a,this._y1=n,this._root=void 0}function Ez(e){for(var r={data:e.data},t=r;e=e.next;)t=t.next={data:e.data};return r}var Ht,Fz=T(()=>{nz();fz();sz();dz();mz();hz();gz();Sz();Tz();Dz();Cz();Mz();Ht=jf.prototype=Jy.prototype;Ht.copy=function(){var e=new Jy(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root,t,o;if(!r)return e;if(!r.length)return e._root=Ez(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var a=0;a<4;++a)(o=r.source[a])&&(o.length?t.push({source:o,target:r.target[a]=new Array(4)}):r.target[a]=Ez(o));return e};Ht.add=tz;Ht.addAll=az;Ht.cover=iz;Ht.data=uz;Ht.extent=lz;Ht.find=pz;Ht.remove=cz;Ht.removeAll=xz;Ht.root=vz;Ht.size=yz;Ht.visit=wz;Ht.visitAfter=bz;Ht.x=Oz;Ht.y=Nz});var Bz=T(()=>{Fz()});function Bn(e){return function(){return e}}var jy=T(()=>{});function ja(e){return(e()-.5)*1e-6}var eS=T(()=>{});function Gre(e){return e.index}function _z(e,r){var t=e.get(r);if(!t)throw new Error("node not found: "+r);return t}function rS(e){var r=Gre,t=d,o,a=Bn(30),n,i,u,l,f,s=1;e==null&&(e=[]);function d(v){return 1/Math.min(u[v.source.index],u[v.target.index])}function m(v){for(var y=0,b=e.length;y<s;++y)for(var h=0,S,w,g,A,C,D,N;h<b;++h)S=e[h],w=S.source,g=S.target,A=g.x+g.vx-w.x-w.vx||ja(f),C=g.y+g.vy-w.y-w.vy||ja(f),D=Math.sqrt(A*A+C*C),D=(D-n[h])/D*v*o[h],A*=D,C*=D,g.vx-=A*(N=l[h]),g.vy-=C*N,w.vx+=A*(N=1-N),w.vy+=C*N}function p(){if(i){var v,y=i.length,b=e.length,h=new Map(i.map((w,g)=>[r(w,g,i),w])),S;for(v=0,u=new Array(y);v<b;++v)S=e[v],S.index=v,typeof S.source!="object"&&(S.source=_z(h,S.source)),typeof S.target!="object"&&(S.target=_z(h,S.target)),u[S.source.index]=(u[S.source.index]||0)+1,u[S.target.index]=(u[S.target.index]||0)+1;for(v=0,l=new Array(b);v<b;++v)S=e[v],l[v]=u[S.source.index]/(u[S.source.index]+u[S.target.index]);o=new Array(b),x(),n=new Array(b),c()}}function x(){if(i)for(var v=0,y=e.length;v<y;++v)o[v]=+t(e[v],v,e)}function c(){if(i)for(var v=0,y=e.length;v<y;++v)n[v]=+a(e[v],v,e)}return m.initialize=function(v,y){i=v,f=y,p()},m.links=function(v){return arguments.length?(e=v,p(),m):e},m.id=function(v){return arguments.length?(r=v,m):r},m.iterations=function(v){return arguments.length?(s=+v,m):s},m.strength=function(v){return arguments.length?(t=typeof v=="function"?v:Bn(+v),x(),m):t},m.distance=function(v){return arguments.length?(a=typeof v=="function"?v:Bn(+v),c(),m):a},m}var Pz=T(()=>{jy();eS()});function nu(){return _n||(Iz($re),_n=ou.now()+Cl)}function $re(){_n=0}function au(){this._call=this._time=this._next=null}function Mi(e,r,t){var o=new au;return o.restart(e,r,t),o}function zz(){nu(),++Ni;for(var e=Al,r;e;)(r=_n-e._time)>=0&&e._call.call(void 0,r),e=e._next;--Ni}function kz(){_n=(Ol=ou.now())+Cl,Ni=ru=0;try{zz()}finally{Ni=0,Qre(),_n=0}}function Kre(){var e=ou.now(),r=e-Ol;r>Lz&&(Cl-=r,Ol=e)}function Qre(){for(var e,r=Al,t,o=1/0;r;)r._call?(o>r._time&&(o=r._time),e=r,r=r._next):(t=r._next,r._next=null,r=e?e._next=t:Al=t);tu=e,tS(o)}function tS(e){if(!Ni){ru&&(ru=clearTimeout(ru));var r=e-_n;r>24?(e<1/0&&(ru=setTimeout(kz,e-ou.now()-Cl)),eu&&(eu=clearInterval(eu))):(eu||(Ol=ou.now(),eu=setInterval(Kre,Lz)),Ni=1,Iz(kz))}}var Ni,ru,eu,Lz,Al,tu,Ol,_n,Cl,ou,Iz,oS=T(()=>{Ni=0,ru=0,eu=0,Lz=1e3,Ol=0,_n=0,Cl=0,ou=typeof performance=="object"&&performance.now?performance:Date,Iz=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};au.prototype=Mi.prototype={constructor:au,restart:function(e,r,t){if(typeof e!="function")throw new TypeError("callback is not a function");t=(t==null?nu():+t)+(r==null?0:+r),!this._next&&tu!==this&&(tu?tu._next=this:Al=this,tu=this),this._call=e,this._time=t,tS()},stop:function(){this._call&&(this._call=null,this._time=1/0,tS())}}});function Rl(e,r,t){var o=new au;return r=r==null?0:+r,o.restart(a=>{o.stop(),e(a+r)},r,t),o}var qz=T(()=>{oS()});var Nl=T(()=>{oS();qz()});function Uz(){let e=1;return()=>(e=(1664525*e+1013904223)%4294967296)/4294967296}var Hz=T(()=>{});function Wz(e){return e.x}function Vz(e){return e.y}function aS(e){var r,t=1,o=.001,a=1-Math.pow(o,1/300),n=0,i=.6,u=new Map,l=Mi(d),f=Jo("tick","end"),s=Uz();e==null&&(e=[]);function d(){m(),f.call("tick",r),t<o&&(l.stop(),f.call("end",r))}function m(c){var v,y=e.length,b;c===void 0&&(c=1);for(var h=0;h<c;++h)for(t+=(n-t)*a,u.forEach(function(S){S(t)}),v=0;v<y;++v)b=e[v],b.fx==null?b.x+=b.vx*=i:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=i:(b.y=b.fy,b.vy=0);return r}function p(){for(var c=0,v=e.length,y;c<v;++c){if(y=e[c],y.index=c,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=Zre*Math.sqrt(.5+c),h=c*Yre;y.x=b*Math.cos(h),y.y=b*Math.sin(h)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function x(c){return c.initialize&&c.initialize(e,s),c}return p(),r={tick:m,restart:function(){return l.restart(d),r},stop:function(){return l.stop(),r},nodes:function(c){return arguments.length?(e=c,p(),u.forEach(x),r):e},alpha:function(c){return arguments.length?(t=+c,r):t},alphaMin:function(c){return arguments.length?(o=+c,r):o},alphaDecay:function(c){return arguments.length?(a=+c,r):+a},alphaTarget:function(c){return arguments.length?(n=+c,r):n},velocityDecay:function(c){return arguments.length?(i=1-c,r):1-i},randomSource:function(c){return arguments.length?(s=c,u.forEach(x),r):s},force:function(c,v){return arguments.length>1?(v==null?u.delete(c):u.set(c,x(v)),r):u.get(c)},find:function(c,v,y){var b=0,h=e.length,S,w,g,A,C;for(y==null?y=1/0:y*=y,b=0;b<h;++b)A=e[b],S=c-A.x,w=v-A.y,g=S*S+w*w,g<y&&(C=A,y=g);return C},on:function(c,v){return arguments.length>1?(f.on(c,v),r):f.on(c)}}}var Zre,Yre,nS=T(()=>{Wi();Nl();Hz();Zre=10,Yre=Math.PI*(3-Math.sqrt(5))});function iS(){var e,r,t,o,a=Bn(-30),n,i=1,u=1/0,l=.81;function f(p){var x,c=e.length,v=jf(e,Wz,Vz).visitAfter(d);for(o=p,x=0;x<c;++x)r=e[x],v.visit(m)}function s(){if(e){var p,x=e.length,c;for(n=new Array(x),p=0;p<x;++p)c=e[p],n[c.index]=+a(c,p,e)}}function d(p){var x=0,c,v,y=0,b,h,S;if(p.length){for(b=h=S=0;S<4;++S)(c=p[S])&&(v=Math.abs(c.value))&&(x+=c.value,y+=v,b+=v*c.x,h+=v*c.y);p.x=b/y,p.y=h/y}else{c=p,c.x=c.data.x,c.y=c.data.y;do x+=n[c.data.index];while(c=c.next)}p.value=x}function m(p,x,c,v){if(!p.value)return!0;var y=p.x-r.x,b=p.y-r.y,h=v-x,S=y*y+b*b;if(h*h/l<S)return S<u&&(y===0&&(y=ja(t),S+=y*y),b===0&&(b=ja(t),S+=b*b),S<i&&(S=Math.sqrt(i*S)),r.vx+=y*p.value*o/S,r.vy+=b*p.value*o/S),!0;if(p.length||S>=u)return;(p.data!==r||p.next)&&(y===0&&(y=ja(t),S+=y*y),b===0&&(b=ja(t),S+=b*b),S<i&&(S=Math.sqrt(i*S)));do p.data!==r&&(h=n[p.data.index]*o/S,r.vx+=y*h,r.vy+=b*h);while(p=p.next)}return f.initialize=function(p,x){e=p,t=x,s()},f.strength=function(p){return arguments.length?(a=typeof p=="function"?p:Bn(+p),s(),f):a},f.distanceMin=function(p){return arguments.length?(i=p*p,f):Math.sqrt(i)},f.distanceMax=function(p){return arguments.length?(u=p*p,f):Math.sqrt(u)},f.theta=function(p){return arguments.length?(l=p*p,f):Math.sqrt(l)},f}var Gz=T(()=>{Bz();jy();eS();nS()});var $z=T(()=>{rz();Pz();Gz();nS()});function Ce(e){for(var r=e.length/6|0,t=new Array(r),o=0;o<r;)t[o]="#"+e.slice(o*6,++o*6);return t}var ur=T(()=>{});var Kz,Qz=T(()=>{ur();Kz=Ce("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf")});var Zz,Yz=T(()=>{ur();Zz=Ce("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666")});var Xz,Jz=T(()=>{ur();Xz=Ce("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666")});var jz,eq=T(()=>{ur();jz=Ce("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0")});var rq,tq=T(()=>{ur();rq=Ce("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928")});var oq,aq=T(()=>{ur();oq=Ce("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2")});var nq,iq=T(()=>{ur();nq=Ce("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc")});var fq,uq=T(()=>{ur();fq=Ce("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999")});var sq,lq=T(()=>{ur();sq=Ce("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3")});var dq,pq=T(()=>{ur();dq=Ce("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f")});var mq,cq=T(()=>{ur();mq=Ce("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab")});function fS(e,r,t,o,a){var n=e*e,i=n*e;return((1-3*e+3*n-i)*r+(4-6*n+3*i)*t+(1+3*e+3*n-3*i)*o+i*a)/6}function xq(e){var r=e.length-1;return function(t){var o=t<=0?t=0:t>=1?(t=1,r-1):Math.floor(t*r),a=e[o],n=e[o+1],i=o>0?e[o-1]:2*a-n,u=o<r-1?e[o+2]:2*n-a;return fS((t-o/r)*r,i,a,n,u)}}var uS=T(()=>{});function hq(e){var r=e.length;return function(t){var o=Math.floor(((t%=1)<0?++t:t)*r),a=e[(o+r-1)%r],n=e[o%r],i=e[(o+1)%r],u=e[(o+2)%r];return fS((t-o/r)*r,a,n,i,u)}}var vq=T(()=>{uS()});var Ml,gq=T(()=>{Ml=e=>()=>e});function yq(e,r){return function(t){return e+t*r}}function Xre(e,r,t){return e=Math.pow(e,t),r=Math.pow(r,t)-e,t=1/t,function(o){return Math.pow(e+o*r,t)}}function Sq(e,r){var t=r-e;return t?yq(e,t>180||t<-180?t-360*Math.round(t/360):t):Ml(isNaN(e)?r:e)}function wq(e){return(e=+e)==1?ha:function(r,t){return t-r?Xre(r,t,e):Ml(isNaN(r)?t:r)}}function ha(e,r){var t=r-e;return t?yq(e,t):Ml(isNaN(e)?r:e)}var sS=T(()=>{gq()});function Tq(e){return function(r){var t=r.length,o=new Array(t),a=new Array(t),n=new Array(t),i,u;for(i=0;i<t;++i)u=Ta(r[i]),o[i]=u.r||0,a[i]=u.g||0,n[i]=u.b||0;return o=e(o),a=e(a),n=e(n),u.opacity=1,function(l){return u.r=o(l),u.g=a(l),u.b=n(l),u+""}}}var El,lS,Jre,bq=T(()=>{ba();uS();vq();sS();El=function e(r){var t=wq(r);function o(a,n){var i=t((a=Ta(a)).r,(n=Ta(n)).r),u=t(a.g,n.g),l=t(a.b,n.b),f=ha(a.opacity,n.opacity);return function(s){return a.r=i(s),a.g=u(s),a.b=l(s),a.opacity=f(s),a+""}}return o.gamma=e,o}(1);lS=Tq(xq),Jre=Tq(hq)});function Do(e,r){return e=+e,r=+r,function(t){return e*(1-t)+r*t}}var Fl=T(()=>{});function jre(e){return function(){return e}}function ete(e){return function(r){return e(r)+""}}function mS(e,r){var t=pS.lastIndex=dS.lastIndex=0,o,a,n,i=-1,u=[],l=[];for(e=e+"",r=r+"";(o=pS.exec(e))&&(a=dS.exec(r));)(n=a.index)>t&&(n=r.slice(t,n),u[i]?u[i]+=n:u[++i]=n),(o=o[0])===(a=a[0])?u[i]?u[i]+=a:u[++i]=a:(u[++i]=null,l.push({i,x:Do(o,a)})),t=dS.lastIndex;return t<r.length&&(n=r.slice(t),u[i]?u[i]+=n:u[++i]=n),u.length<2?l[0]?ete(l[0].x):jre(r):(r=l.length,function(f){for(var s=0,d;s<r;++s)u[(d=l[s]).i]=d.x(f);return u.join("")})}var pS,dS,Dq=T(()=>{Fl();pS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dS=new RegExp(pS.source,"g")});function cS(e,r,t,o,a,n){var i,u,l;return(i=Math.sqrt(e*e+r*r))&&(e/=i,r/=i),(l=e*t+r*o)&&(t-=e*l,o-=r*l),(u=Math.sqrt(t*t+o*o))&&(t/=u,o/=u,l/=u),e*o<r*t&&(e=-e,r=-r,l=-l,i=-i),{translateX:a,translateY:n,rotate:Math.atan2(r,e)*Aq,skewX:Math.atan(l)*Aq,scaleX:i,scaleY:u}}var Aq,Bl,Oq=T(()=>{Aq=180/Math.PI,Bl={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function Cq(e){let r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return r.isIdentity?Bl:cS(r.a,r.b,r.c,r.d,r.e,r.f)}function Rq(e){return e==null?Bl:(_l||(_l=document.createElementNS("http://www.w3.org/2000/svg","g")),_l.setAttribute("transform",e),(e=_l.transform.baseVal.consolidate())?(e=e.matrix,cS(e.a,e.b,e.c,e.d,e.e,e.f)):Bl)}var _l,Nq=T(()=>{Oq()});function Mq(e,r,t,o){function a(f){return f.length?f.pop()+" ":""}function n(f,s,d,m,p,x){if(f!==d||s!==m){var c=p.push("translate(",null,r,null,t);x.push({i:c-4,x:Do(f,d)},{i:c-2,x:Do(s,m)})}else(d||m)&&p.push("translate("+d+r+m+t)}function i(f,s,d,m){f!==s?(f-s>180?s+=360:s-f>180&&(f+=360),m.push({i:d.push(a(d)+"rotate(",null,o)-2,x:Do(f,s)})):s&&d.push(a(d)+"rotate("+s+o)}function u(f,s,d,m){f!==s?m.push({i:d.push(a(d)+"skewX(",null,o)-2,x:Do(f,s)}):s&&d.push(a(d)+"skewX("+s+o)}function l(f,s,d,m,p,x){if(f!==d||s!==m){var c=p.push(a(p)+"scale(",null,",",null,")");x.push({i:c-4,x:Do(f,d)},{i:c-2,x:Do(s,m)})}else(d!==1||m!==1)&&p.push(a(p)+"scale("+d+","+m+")")}return function(f,s){var d=[],m=[];return f=e(f),s=e(s),n(f.translateX,f.translateY,s.translateX,s.translateY,d,m),i(f.rotate,s.rotate,d,m),u(f.skewX,s.skewX,d,m),l(f.scaleX,f.scaleY,s.scaleX,s.scaleY,d,m),f=s=null,function(p){for(var x=-1,c=m.length,v;++x<c;)d[(v=m[x]).i]=v.x(p);return d.join("")}}}var xS,hS,Eq=T(()=>{Fl();Nq();xS=Mq(Cq,"px, ","px)","deg)"),hS=Mq(Rq,", ",")",")")});function Fq(e){return((e=Math.exp(e))+1/e)/2}function tte(e){return((e=Math.exp(e))-1/e)/2}function ote(e){return((e=Math.exp(2*e))-1)/(e+1)}var rte,vS,Bq=T(()=>{rte=1e-12;vS=function e(r,t,o){function a(n,i){var u=n[0],l=n[1],f=n[2],s=i[0],d=i[1],m=i[2],p=s-u,x=d-l,c=p*p+x*x,v,y;if(c<rte)y=Math.log(m/f)/r,v=function(A){return[u+A*p,l+A*x,f*Math.exp(r*A*y)]};else{var b=Math.sqrt(c),h=(m*m-f*f+o*c)/(2*f*t*b),S=(m*m-f*f-o*c)/(2*m*t*b),w=Math.log(Math.sqrt(h*h+1)-h),g=Math.log(Math.sqrt(S*S+1)-S);y=(g-w)/r,v=function(A){var C=A*y,D=Fq(w),N=f/(t*b)*(D*ote(r*C+w)-tte(w));return[u+N*p,l+N*x,f*D/Fq(r*C+w)]}}return v.duration=y*1e3*r/Math.SQRT2,v}return a.rho=function(n){var i=Math.max(.001,+n),u=i*i,l=u*u;return e(i,u,l)},a}(Math.SQRT2,2,4)});function _q(e){return function r(t){t=+t;function o(a,n){var i=e((a=Lt(a)).h,(n=Lt(n)).h),u=ha(a.s,n.s),l=ha(a.l,n.l),f=ha(a.opacity,n.opacity);return function(s){return a.h=i(s),a.s=u(s),a.l=l(Math.pow(s,t)),a.opacity=f(s),a+""}}return o.gamma=r,o}(1)}var ate,Ei,Pq=T(()=>{ba();sS();ate=_q(Sq),Ei=_q(ha)});var en=T(()=>{Fl();Dq();Eq();Bq();bq();Pq()});var Ke,Fr=T(()=>{en();Ke=e=>lS(e[e.length-1])});var gS,kq,Lq=T(()=>{ur();Fr();gS=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Ce),kq=Ke(gS)});var yS,Iq,zq=T(()=>{ur();Fr();yS=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Ce),Iq=Ke(yS)});var SS,qq,Uq=T(()=>{ur();Fr();SS=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Ce),qq=Ke(SS)});var wS,Hq,Wq=T(()=>{ur();Fr();wS=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Ce),Hq=Ke(wS)});var TS,Vq,Gq=T(()=>{ur();Fr();TS=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Ce),Vq=Ke(TS)});var bS,$q,Kq=T(()=>{ur();Fr();bS=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Ce),$q=Ke(bS)});var DS,Qq,Zq=T(()=>{ur();Fr();DS=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Ce),Qq=Ke(DS)});var AS,Yq,Xq=T(()=>{ur();Fr();AS=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Ce),Yq=Ke(AS)});var OS,Jq,jq=T(()=>{ur();Fr();OS=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Ce),Jq=Ke(OS)});var CS,eU,rU=T(()=>{ur();Fr();CS=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Ce),eU=Ke(CS)});var RS,tU,oU=T(()=>{ur();Fr();RS=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Ce),tU=Ke(RS)});var NS,aU,nU=T(()=>{ur();Fr();NS=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Ce),aU=Ke(NS)});var MS,iU,fU=T(()=>{ur();Fr();MS=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Ce),iU=Ke(MS)});var ES,uU,sU=T(()=>{ur();Fr();ES=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Ce),uU=Ke(ES)});var FS,lU,dU=T(()=>{ur();Fr();FS=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Ce),lU=Ke(FS)});var BS,pU,mU=T(()=>{ur();Fr();BS=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Ce),pU=Ke(BS)});var _S,cU,xU=T(()=>{ur();Fr();_S=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Ce),cU=Ke(_S)});var PS,hU,vU=T(()=>{ur();Fr();PS=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Ce),hU=Ke(PS)});var kS,gU,yU=T(()=>{ur();Fr();kS=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Ce),gU=Ke(kS)});var LS,SU,wU=T(()=>{ur();Fr();LS=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Ce),SU=Ke(LS)});var IS,TU,bU=T(()=>{ur();Fr();IS=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Ce),TU=Ke(IS)});var zS,DU,AU=T(()=>{ur();Fr();zS=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Ce),DU=Ke(zS)});var qS,OU,CU=T(()=>{ur();Fr();qS=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Ce),OU=Ke(qS)});var US,RU,NU=T(()=>{ur();Fr();US=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Ce),RU=Ke(US)});var HS,MU,EU=T(()=>{ur();Fr();HS=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Ce),MU=Ke(HS)});var WS,FU,BU=T(()=>{ur();Fr();WS=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Ce),FU=Ke(WS)});var VS,_U,PU=T(()=>{ur();Fr();VS=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Ce),_U=Ke(VS)});function kU(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}var LU=T(()=>{});var IU,zU=T(()=>{ba();en();IU=Ei(Lt(300,.5,0),Lt(-240,.5,1))});function HU(e){(e<0||e>1)&&(e-=Math.floor(e));var r=Math.abs(e-.5);return Pl.h=360*e-100,Pl.s=1.5-1.5*r,Pl.l=.8-.9*r,Pl+""}var qU,UU,Pl,WU=T(()=>{ba();en();qU=Ei(Lt(-100,.75,.35),Lt(80,1.5,.8)),UU=Ei(Lt(260,.75,.35),Lt(80,1.5,.8)),Pl=Lt()});function VU(e){var r;return e=(.5-e)*Math.PI,kl.r=255*(r=Math.sin(e))*r,kl.g=255*(r=Math.sin(e+nte))*r,kl.b=255*(r=Math.sin(e+ite))*r,kl+""}var kl,nte,ite,GU=T(()=>{ba();kl=Ta(),nte=Math.PI/3,ite=Math.PI*2/3});function $U(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}var KU=T(()=>{});function Ll(e){var r=e.length;return function(t){return e[Math.max(0,Math.min(r-1,Math.floor(t*r)))]}}var QU,ZU,YU,XU,JU=T(()=>{ur();QU=Ll(Ce("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),ZU=Ll(Ce("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),YU=Ll(Ce("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),XU=Ll(Ce("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"))});var Il={};Yl(Il,{interpolateBlues:()=>DU,interpolateBrBG:()=>kq,interpolateBuGn:()=>eU,interpolateBuPu:()=>tU,interpolateCividis:()=>kU,interpolateCool:()=>UU,interpolateCubehelixDefault:()=>IU,interpolateGnBu:()=>aU,interpolateGreens:()=>OU,interpolateGreys:()=>RU,interpolateInferno:()=>YU,interpolateMagma:()=>ZU,interpolateOrRd:()=>iU,interpolateOranges:()=>_U,interpolatePRGn:()=>Iq,interpolatePiYG:()=>qq,interpolatePlasma:()=>XU,interpolatePuBu:()=>lU,interpolatePuBuGn:()=>uU,interpolatePuOr:()=>Hq,interpolatePuRd:()=>pU,interpolatePurples:()=>MU,interpolateRainbow:()=>HU,interpolateRdBu:()=>Vq,interpolateRdGy:()=>$q,interpolateRdPu:()=>cU,interpolateRdYlBu:()=>Qq,interpolateRdYlGn:()=>Yq,interpolateReds:()=>FU,interpolateSinebow:()=>VU,interpolateSpectral:()=>Jq,interpolateTurbo:()=>$U,interpolateViridis:()=>QU,interpolateWarm:()=>qU,interpolateYlGn:()=>gU,interpolateYlGnBu:()=>hU,interpolateYlOrBr:()=>SU,interpolateYlOrRd:()=>TU,schemeAccent:()=>Zz,schemeBlues:()=>zS,schemeBrBG:()=>gS,schemeBuGn:()=>CS,schemeBuPu:()=>RS,schemeCategory10:()=>Kz,schemeDark2:()=>Xz,schemeGnBu:()=>NS,schemeGreens:()=>qS,schemeGreys:()=>US,schemeObservable10:()=>jz,schemeOrRd:()=>MS,schemeOranges:()=>VS,schemePRGn:()=>yS,schemePaired:()=>rq,schemePastel1:()=>oq,schemePastel2:()=>nq,schemePiYG:()=>SS,schemePuBu:()=>FS,schemePuBuGn:()=>ES,schemePuOr:()=>wS,schemePuRd:()=>BS,schemePurples:()=>HS,schemeRdBu:()=>TS,schemeRdGy:()=>bS,schemeRdPu:()=>_S,schemeRdYlBu:()=>DS,schemeRdYlGn:()=>AS,schemeReds:()=>WS,schemeSet1:()=>fq,schemeSet2:()=>sq,schemeSet3:()=>dq,schemeSpectral:()=>OS,schemeTableau10:()=>mq,schemeYlGn:()=>kS,schemeYlGnBu:()=>PS,schemeYlOrBr:()=>LS,schemeYlOrRd:()=>IS});var jU=T(()=>{Qz();Yz();Jz();eq();tq();aq();iq();uq();lq();pq();cq();Lq();zq();Uq();Wq();Gq();Kq();Zq();Xq();jq();rU();oU();nU();fU();sU();dU();mU();xU();vU();yU();wU();bU();AU();CU();NU();EU();BU();PU();LU();zU();WU();GU();KU();JU()});function rn(e,r,t,o,a,n){var i=e.__transition;if(!i)e.__transition={};else if(t in i)return;ste(e,t,{name:r,index:o,group:a,on:fte,tween:ute,time:n.time,delay:n.delay,duration:n.duration,ease:n.ease,timer:null,state:tH})}function fu(e,r){var t=nt(e,r);if(t.state>tH)throw new Error("too late; already scheduled");return t}function Tt(e,r){var t=nt(e,r);if(t.state>zl)throw new Error("too late; already running");return t}function nt(e,r){var t=e.__transition;if(!t||!(t=t[r]))throw new Error("transition not found");return t}function ste(e,r,t){var o=e.__transition,a;o[r]=t,t.timer=Mi(n,0,t.time);function n(f){t.state=eH,t.timer.restart(i,t.delay,t.time),t.delay<=f&&i(f-t.delay)}function i(f){var s,d,m,p;if(t.state!==eH)return l();for(s in o)if(p=o[s],p.name===t.name){if(p.state===zl)return Rl(i);p.state===rH?(p.state=iu,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete o[s]):+s<r&&(p.state=iu,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete o[s])}if(Rl(function(){t.state===zl&&(t.state=rH,t.timer.restart(u,t.delay,t.time),u(f))}),t.state=ql,t.on.call("start",e,e.__data__,t.index,t.group),t.state===ql){for(t.state=zl,a=new Array(m=t.tween.length),s=0,d=-1;s<m;++s)(p=t.tween[s].value.call(e,e.__data__,t.index,t.group))&&(a[++d]=p);a.length=d+1}}function u(f){for(var s=f<t.duration?t.ease.call(null,f/t.duration):(t.timer.restart(l),t.state=Ul,1),d=-1,m=a.length;++d<m;)a[d].call(e,s);t.state===Ul&&(t.on.call("end",e,e.__data__,t.index,t.group),l())}function l(){t.state=iu,t.timer.stop(),delete o[r];for(var f in o)return;delete e.__transition}}var fte,ute,tH,eH,ql,zl,rH,Ul,iu,jt=T(()=>{Wi();Nl();fte=Jo("start","end","cancel","interrupt"),ute=[],tH=0,eH=1,ql=2,zl=3,rH=4,Ul=5,iu=6});function Pn(e,r){var t=e.__transition,o,a,n=!0,i;if(t){r=r==null?null:r+"";for(i in t){if((o=t[i]).name!==r){n=!1;continue}a=o.state>ql&&o.state<Ul,o.state=iu,o.timer.stop(),o.on.call(a?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete t[i]}n&&delete e.__transition}}var GS=T(()=>{jt()});function oH(e){return this.each(function(){Pn(this,e)})}var aH=T(()=>{GS()});function lte(e,r){var t,o;return function(){var a=Tt(this,e),n=a.tween;if(n!==t){o=t=n;for(var i=0,u=o.length;i<u;++i)if(o[i].name===r){o=o.slice(),o.splice(i,1);break}}a.tween=o}}function dte(e,r,t){var o,a;if(typeof t!="function")throw new Error;return function(){var n=Tt(this,e),i=n.tween;if(i!==o){a=(o=i).slice();for(var u={name:r,value:t},l=0,f=a.length;l<f;++l)if(a[l].name===r){a[l]=u;break}l===f&&a.push(u)}n.tween=a}}function nH(e,r){var t=this._id;if(e+="",arguments.length<2){for(var o=nt(this.node(),t).tween,a=0,n=o.length,i;a<n;++a)if((i=o[a]).name===e)return i.value;return null}return this.each((r==null?lte:dte)(t,e,r))}function Fi(e,r,t){var o=e._id;return e.each(function(){var a=Tt(this,o);(a.value||(a.value={}))[r]=t.apply(this,arguments)}),function(a){return nt(a,o).value[r]}}var uu=T(()=>{jt()});function Hl(e,r){var t;return(typeof r=="number"?Do:r instanceof wa?El:(t=wa(r))?(r=t,El):mS)(e,r)}var $S=T(()=>{ba();en()});function pte(e){return function(){this.removeAttribute(e)}}function mte(e){return function(){this.removeAttributeNS(e.space,e.local)}}function cte(e,r,t){var o,a=t+"",n;return function(){var i=this.getAttribute(e);return i===a?null:i===o?n:n=r(o=i,t)}}function xte(e,r,t){var o,a=t+"",n;return function(){var i=this.getAttributeNS(e.space,e.local);return i===a?null:i===o?n:n=r(o=i,t)}}function hte(e,r,t){var o,a,n;return function(){var i,u=t(this),l;return u==null?void this.removeAttribute(e):(i=this.getAttribute(e),l=u+"",i===l?null:i===o&&l===a?n:(a=l,n=r(o=i,u)))}}function vte(e,r,t){var o,a,n;return function(){var i,u=t(this),l;return u==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),l=u+"",i===l?null:i===o&&l===a?n:(a=l,n=r(o=i,u)))}}function iH(e,r){var t=jo(e),o=t==="transform"?hS:Hl;return this.attrTween(e,typeof r=="function"?(t.local?vte:hte)(t,o,Fi(this,"attr."+e,r)):r==null?(t.local?mte:pte)(t):(t.local?xte:cte)(t,o,r))}var fH=T(()=>{en();Gt();uu();$S()});function gte(e,r){return function(t){this.setAttribute(e,r.call(this,t))}}function yte(e,r){return function(t){this.setAttributeNS(e.space,e.local,r.call(this,t))}}function Ste(e,r){var t,o;function a(){var n=r.apply(this,arguments);return n!==o&&(t=(o=n)&&yte(e,n)),t}return a._value=r,a}function wte(e,r){var t,o;function a(){var n=r.apply(this,arguments);return n!==o&&(t=(o=n)&&gte(e,n)),t}return a._value=r,a}function uH(e,r){var t="attr."+e;if(arguments.length<2)return(t=this.tween(t))&&t._value;if(r==null)return this.tween(t,null);if(typeof r!="function")throw new Error;var o=jo(e);return this.tween(t,(o.local?Ste:wte)(o,r))}var sH=T(()=>{Gt()});function Tte(e,r){return function(){fu(this,e).delay=+r.apply(this,arguments)}}function bte(e,r){return r=+r,function(){fu(this,e).delay=r}}function lH(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?Tte:bte)(r,e)):nt(this.node(),r).delay}var dH=T(()=>{jt()});function Dte(e,r){return function(){Tt(this,e).duration=+r.apply(this,arguments)}}function Ate(e,r){return r=+r,function(){Tt(this,e).duration=r}}function pH(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?Dte:Ate)(r,e)):nt(this.node(),r).duration}var mH=T(()=>{jt()});function Ote(e,r){if(typeof r!="function")throw new Error;return function(){Tt(this,e).ease=r}}function cH(e){var r=this._id;return arguments.length?this.each(Ote(r,e)):nt(this.node(),r).ease}var xH=T(()=>{jt()});function Cte(e,r){return function(){var t=r.apply(this,arguments);if(typeof t!="function")throw new Error;Tt(this,e).ease=t}}function hH(e){if(typeof e!="function")throw new Error;return this.each(Cte(this._id,e))}var vH=T(()=>{jt()});function gH(e){typeof e!="function"&&(e=Gi(e));for(var r=this._groups,t=r.length,o=new Array(t),a=0;a<t;++a)for(var n=r[a],i=n.length,u=o[a]=[],l,f=0;f<i;++f)(l=n[f])&&e.call(l,l.__data__,f,n)&&u.push(l);return new Wt(o,this._parents,this._name,this._id)}var yH=T(()=>{Gt();kn()});function SH(e){if(e._id!==this._id)throw new Error;for(var r=this._groups,t=e._groups,o=r.length,a=t.length,n=Math.min(o,a),i=new Array(o),u=0;u<n;++u)for(var l=r[u],f=t[u],s=l.length,d=i[u]=new Array(s),m,p=0;p<s;++p)(m=l[p]||f[p])&&(d[p]=m);for(;u<o;++u)i[u]=r[u];return new Wt(i,this._parents,this._name,this._id)}var wH=T(()=>{kn()});function Rte(e){return(e+"").trim().split(/^|\s+/).every(function(r){var t=r.indexOf(".");return t>=0&&(r=r.slice(0,t)),!r||r==="start"})}function Nte(e,r,t){var o,a,n=Rte(r)?fu:Tt;return function(){var i=n(this,e),u=i.on;u!==o&&(a=(o=u).copy()).on(r,t),i.on=a}}function TH(e,r){var t=this._id;return arguments.length<2?nt(this.node(),t).on.on(e):this.each(Nte(t,e,r))}var bH=T(()=>{jt()});function Mte(e){return function(){var r=this.parentNode;for(var t in this.__transition)if(+t!==e)return;r&&r.removeChild(this)}}function DH(){return this.on("end.remove",Mte(this._id))}var AH=T(()=>{});function OH(e){var r=this._name,t=this._id;typeof e!="function"&&(e=un(e));for(var o=this._groups,a=o.length,n=new Array(a),i=0;i<a;++i)for(var u=o[i],l=u.length,f=n[i]=new Array(l),s,d,m=0;m<l;++m)(s=u[m])&&(d=e.call(s,s.__data__,m,u))&&("__data__"in s&&(d.__data__=s.__data__),f[m]=d,rn(f[m],r,t,m,f,nt(s,t)));return new Wt(n,this._parents,r,t)}var CH=T(()=>{Gt();kn();jt()});function RH(e){var r=this._name,t=this._id;typeof e!="function"&&(e=Vi(e));for(var o=this._groups,a=o.length,n=[],i=[],u=0;u<a;++u)for(var l=o[u],f=l.length,s,d=0;d<f;++d)if(s=l[d]){for(var m=e.call(s,s.__data__,d,l),p,x=nt(s,t),c=0,v=m.length;c<v;++c)(p=m[c])&&rn(p,r,t,c,m,x);n.push(m),i.push(s)}return new Wt(n,i,r,t)}var NH=T(()=>{Gt();kn();jt()});function MH(){return new Ete(this._groups,this._parents)}var Ete,EH=T(()=>{Gt();Ete=ea.prototype.constructor});function Fte(e,r){var t,o,a;return function(){var n=Da(this,e),i=(this.style.removeProperty(e),Da(this,e));return n===i?null:n===t&&i===o?a:a=r(t=n,o=i)}}function FH(e){return function(){this.style.removeProperty(e)}}function Bte(e,r,t){var o,a=t+"",n;return function(){var i=Da(this,e);return i===a?null:i===o?n:n=r(o=i,t)}}function _te(e,r,t){var o,a,n;return function(){var i=Da(this,e),u=t(this),l=u+"";return u==null&&(l=u=(this.style.removeProperty(e),Da(this,e))),i===l?null:i===o&&l===a?n:(a=l,n=r(o=i,u))}}function Pte(e,r){var t,o,a,n="style."+r,i="end."+n,u;return function(){var l=Tt(this,e),f=l.on,s=l.value[n]==null?u||(u=FH(r)):void 0;(f!==t||a!==s)&&(o=(t=f).copy()).on(i,a=s),l.on=o}}function BH(e,r,t){var o=(e+="")=="transform"?xS:Hl;return r==null?this.styleTween(e,Fte(e,o)).on("end.style."+e,FH(e)):typeof r=="function"?this.styleTween(e,_te(e,o,Fi(this,"style."+e,r))).each(Pte(this._id,e)):this.styleTween(e,Bte(e,o,r),t).on("end.style."+e,null)}var _H=T(()=>{en();Gt();jt();uu();$S()});function kte(e,r,t){return function(o){this.style.setProperty(e,r.call(this,o),t)}}function Lte(e,r,t){var o,a;function n(){var i=r.apply(this,arguments);return i!==a&&(o=(a=i)&&kte(e,i,t)),o}return n._value=r,n}function PH(e,r,t){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;return this.tween(o,Lte(e,r,t??""))}var kH=T(()=>{});function Ite(e){return function(){this.textContent=e}}function zte(e){return function(){var r=e(this);this.textContent=r??""}}function LH(e){return this.tween("text",typeof e=="function"?zte(Fi(this,"text",e)):Ite(e==null?"":e+""))}var IH=T(()=>{uu()});function qte(e){return function(r){this.textContent=e.call(this,r)}}function Ute(e){var r,t;function o(){var a=e.apply(this,arguments);return a!==t&&(r=(t=a)&&qte(a)),r}return o._value=e,o}function zH(e){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,Ute(e))}var qH=T(()=>{});function UH(){for(var e=this._name,r=this._id,t=Wl(),o=this._groups,a=o.length,n=0;n<a;++n)for(var i=o[n],u=i.length,l,f=0;f<u;++f)if(l=i[f]){var s=nt(l,r);rn(l,e,t,f,i,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new Wt(o,this._parents,e,t)}var HH=T(()=>{kn();jt()});function WH(){var e,r,t=this,o=t._id,a=t.size();return new Promise(function(n,i){var u={value:i},l={value:function(){--a===0&&n()}};t.each(function(){var f=Tt(this,o),s=f.on;s!==e&&(r=(e=s).copy(),r._.cancel.push(u),r._.interrupt.push(u),r._.end.push(l)),f.on=r}),a===0&&n()})}var VH=T(()=>{jt()});function Wt(e,r,t,o){this._groups=e,this._parents=r,this._name=t,this._id=o}function GH(e){return ea().transition(e)}function Wl(){return++Hte}var Hte,va,kn=T(()=>{Gt();fH();sH();dH();mH();xH();vH();yH();wH();bH();AH();CH();NH();EH();_H();kH();IH();qH();HH();uu();VH();Hte=0;va=ea.prototype;Wt.prototype=GH.prototype={constructor:Wt,select:OH,selectAll:RH,selectChild:va.selectChild,selectChildren:va.selectChildren,filter:gH,merge:SH,selection:MH,transition:UH,call:va.call,nodes:va.nodes,node:va.node,size:va.size,empty:va.empty,each:va.each,on:TH,attr:iH,attrTween:uH,style:BH,styleTween:PH,text:LH,textTween:zH,remove:DH,tween:nH,delay:lH,duration:pH,ease:cH,easeVarying:hH,end:WH,[Symbol.iterator]:va[Symbol.iterator]}});function Vl(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $H=T(()=>{});var KH=T(()=>{$H()});function Vte(e,r){for(var t;!(t=e.__transition)||!(t=t[r]);)if(!(e=e.parentNode))throw new Error(`transition ${r} not found`);return t}function QH(e){var r,t;e instanceof Wt?(r=e._id,e=e._name):(r=Wl(),(t=Wte).time=nu(),e=e==null?null:e+"");for(var o=this._groups,a=o.length,n=0;n<a;++n)for(var i=o[n],u=i.length,l,f=0;f<u;++f)(l=i[f])&&rn(l,e,r,f,i,t||Vte(l,r));return new Wt(o,this._parents,e,r)}var Wte,ZH=T(()=>{kn();jt();KH();Nl();Wte={time:null,delay:0,duration:250,ease:Vl}});var YH=T(()=>{Gt();aH();ZH();ea.prototype.interrupt=oH;ea.prototype.transition=QH});var XH=T(()=>{YH();GS()});var su,JH=T(()=>{su=e=>()=>e});function KS(e,{sourceEvent:r,target:t,transform:o,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:a}})}var jH=T(()=>{});function Uo(e,r,t){this.k=e,this.x=r,this.y=t}function QS(e){for(;!e.__zoom;)if(!(e=e.parentNode))return lu;return e.__zoom}var lu,ZS=T(()=>{Uo.prototype={constructor:Uo,scale:function(e){return e===1?this:new Uo(this.k*e,this.x,this.y)},translate:function(e,r){return e===0&r===0?this:new Uo(this.k,this.x+this.k*e,this.y+this.k*r)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};lu=new Uo(1,0,0);QS.prototype=Uo.prototype});function Gl(e){e.stopImmediatePropagation()}function Bi(e){e.preventDefault(),e.stopImmediatePropagation()}var eW=T(()=>{});function Gte(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function $te(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function rW(){return this.__zoom||lu}function Kte(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Qte(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zte(e,r,t){var o=e.invertX(r[0][0])-t[0][0],a=e.invertX(r[1][0])-t[1][0],n=e.invertY(r[0][1])-t[0][1],i=e.invertY(r[1][1])-t[1][1];return e.translate(a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a),i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i))}function YS(){var e=Gte,r=$te,t=Zte,o=Kte,a=Qte,n=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],u=250,l=vS,f=Jo("start","zoom","end"),s,d,m,p=500,x=150,c=0,v=10;function y(P){P.property("__zoom",rW).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",N).filter(a).on("touchstart.zoom",E).on("touchmove.zoom",_).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(P,k,R,F){var I=P.selection?P.selection():P;I.property("__zoom",rW),P!==I?w(P,k,R,F):I.interrupt().each(function(){g(this,arguments).event(F).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},y.scaleBy=function(P,k,R,F){y.scaleTo(P,function(){var I=this.__zoom.k,B=typeof k=="function"?k.apply(this,arguments):k;return I*B},R,F)},y.scaleTo=function(P,k,R,F){y.transform(P,function(){var I=r.apply(this,arguments),B=this.__zoom,V=R==null?S(I):typeof R=="function"?R.apply(this,arguments):R,J=B.invert(V),K=typeof k=="function"?k.apply(this,arguments):k;return t(h(b(B,K),V,J),I,i)},R,F)},y.translateBy=function(P,k,R,F){y.transform(P,function(){return t(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof R=="function"?R.apply(this,arguments):R),r.apply(this,arguments),i)},null,F)},y.translateTo=function(P,k,R,F,I){y.transform(P,function(){var B=r.apply(this,arguments),V=this.__zoom,J=F==null?S(B):typeof F=="function"?F.apply(this,arguments):F;return t(lu.translate(J[0],J[1]).scale(V.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof R=="function"?-R.apply(this,arguments):-R),B,i)},F,I)};function b(P,k){return k=Math.max(n[0],Math.min(n[1],k)),k===P.k?P:new Uo(k,P.x,P.y)}function h(P,k,R){var F=k[0]-R[0]*P.k,I=k[1]-R[1]*P.k;return F===P.x&&I===P.y?P:new Uo(P.k,F,I)}function S(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function w(P,k,R,F){P.on("start.zoom",function(){g(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){g(this,arguments).event(F).end()}).tween("zoom",function(){var I=this,B=arguments,V=g(I,B).event(F),J=r.apply(I,B),K=R==null?S(J):typeof R=="function"?R.apply(I,B):R,z=Math.max(J[1][0]-J[0][0],J[1][1]-J[0][1]),j=I.__zoom,ue=typeof k=="function"?k.apply(I,B):k,ee=l(j.invert(K).concat(z/j.k),ue.invert(K).concat(z/ue.k));return function(ne){if(ne===1)ne=ue;else{var $=ee(ne),W=z/$[2];ne=new Uo(W,K[0]-$[0]*W,K[1]-$[1]*W)}V.zoom(null,ne)}})}function g(P,k,R){return!R&&P.__zooming||new A(P,k)}function A(P,k){this.that=P,this.args=k,this.active=0,this.sourceEvent=null,this.extent=r.apply(P,k),this.taps=0}A.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,k){return this.mouse&&P!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var k=it(this.that).datum();f.call(P,this.that,new KS(P,{sourceEvent:this.sourceEvent,target:y,type:P,transform:this.that.__zoom,dispatch:f}),k)}};function C(P,...k){if(!e.apply(this,arguments))return;var R=g(this,k).event(P),F=this.__zoom,I=Math.max(n[0],Math.min(n[1],F.k*Math.pow(2,o.apply(this,arguments)))),B=uo(P);if(R.wheel)(R.mouse[0][0]!==B[0]||R.mouse[0][1]!==B[1])&&(R.mouse[1]=F.invert(R.mouse[0]=B)),clearTimeout(R.wheel);else{if(F.k===I)return;R.mouse=[B,F.invert(B)],Pn(this),R.start()}Bi(P),R.wheel=setTimeout(V,x),R.zoom("mouse",t(h(b(F,I),R.mouse[0],R.mouse[1]),R.extent,i));function V(){R.wheel=null,R.end()}}function D(P,...k){if(m||!e.apply(this,arguments))return;var R=P.currentTarget,F=g(this,k,!0).event(P),I=it(P.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",z,!0),B=uo(P,R),V=P.clientX,J=P.clientY;Qi(P.view),Gl(P),F.mouse=[B,this.__zoom.invert(B)],Pn(this),F.start();function K(j){if(Bi(j),!F.moved){var ue=j.clientX-V,ee=j.clientY-J;F.moved=ue*ue+ee*ee>c}F.event(j).zoom("mouse",t(h(F.that.__zoom,F.mouse[0]=uo(j,R),F.mouse[1]),F.extent,i))}function z(j){I.on("mousemove.zoom mouseup.zoom",null),Zi(j.view,F.moved),Bi(j),F.event(j).end()}}function N(P,...k){if(e.apply(this,arguments)){var R=this.__zoom,F=uo(P.changedTouches?P.changedTouches[0]:P,this),I=R.invert(F),B=R.k*(P.shiftKey?.5:2),V=t(h(b(R,B),F,I),r.apply(this,k),i);Bi(P),u>0?it(this).transition().duration(u).call(w,V,F,P):it(this).call(y.transform,V,F,P)}}function E(P,...k){if(e.apply(this,arguments)){var R=P.touches,F=R.length,I=g(this,k,P.changedTouches.length===F).event(P),B,V,J,K;for(Gl(P),V=0;V<F;++V)J=R[V],K=uo(J,this),K=[K,this.__zoom.invert(K),J.identifier],I.touch0?!I.touch1&&I.touch0[2]!==K[2]&&(I.touch1=K,I.taps=0):(I.touch0=K,B=!0,I.taps=1+!!s);s&&(s=clearTimeout(s)),B&&(I.taps<2&&(d=K[0],s=setTimeout(function(){s=null},p)),Pn(this),I.start())}}function _(P,...k){if(this.__zooming){var R=g(this,k).event(P),F=P.changedTouches,I=F.length,B,V,J,K;for(Bi(P),B=0;B<I;++B)V=F[B],J=uo(V,this),R.touch0&&R.touch0[2]===V.identifier?R.touch0[0]=J:R.touch1&&R.touch1[2]===V.identifier&&(R.touch1[0]=J);if(V=R.that.__zoom,R.touch1){var z=R.touch0[0],j=R.touch0[1],ue=R.touch1[0],ee=R.touch1[1],ne=(ne=ue[0]-z[0])*ne+(ne=ue[1]-z[1])*ne,$=($=ee[0]-j[0])*$+($=ee[1]-j[1])*$;V=b(V,Math.sqrt(ne/$)),J=[(z[0]+ue[0])/2,(z[1]+ue[1])/2],K=[(j[0]+ee[0])/2,(j[1]+ee[1])/2]}else if(R.touch0)J=R.touch0[0],K=R.touch0[1];else return;R.zoom("touch",t(h(V,J,K),R.extent,i))}}function L(P,...k){if(this.__zooming){var R=g(this,k).event(P),F=P.changedTouches,I=F.length,B,V;for(Gl(P),m&&clearTimeout(m),m=setTimeout(function(){m=null},p),B=0;B<I;++B)V=F[B],R.touch0&&R.touch0[2]===V.identifier?delete R.touch0:R.touch1&&R.touch1[2]===V.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(V=uo(V,this),Math.hypot(d[0]-V[0],d[1]-V[1])<v)){var J=it(this).on("dblclick.zoom");J&&J.apply(this,arguments)}}}return y.wheelDelta=function(P){return arguments.length?(o=typeof P=="function"?P:su(+P),y):o},y.filter=function(P){return arguments.length?(e=typeof P=="function"?P:su(!!P),y):e},y.touchable=function(P){return arguments.length?(a=typeof P=="function"?P:su(!!P),y):a},y.extent=function(P){return arguments.length?(r=typeof P=="function"?P:su([[+P[0][0],+P[0][1]],[+P[1][0],+P[1][1]]]),y):r},y.scaleExtent=function(P){return arguments.length?(n[0]=+P[0],n[1]=+P[1],y):[n[0],n[1]]},y.translateExtent=function(P){return arguments.length?(i[0][0]=+P[0][0],i[1][0]=+P[1][0],i[0][1]=+P[0][1],i[1][1]=+P[1][1],y):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},y.constrain=function(P){return arguments.length?(t=P,y):t},y.duration=function(P){return arguments.length?(u=+P,y):u},y.interpolate=function(P){return arguments.length?(l=P,y):l},y.on=function(){var P=f.on.apply(f,arguments);return P===f?y:P},y.clickDistance=function(P){return arguments.length?(c=(P=+P)*P,y):Math.sqrt(c)},y.tapDistance=function(P){return arguments.length?(v=+P,y):v},y}var tW=T(()=>{Wi();Sd();en();Gt();XH();JH();jH();ZS();eW()});var oW=T(()=>{tW();ZS()});function aW(e,r){var t;let o={nodes:[],links:[]},a={};if(e.paths)for(let n of e.paths){let i=n.path.split(",");for(let u=0;u<i.length-1;u++){let l=`${i[u]}_${i[u+1]}`;a[l]?a[l].push(n.name):a[l]=[n.name]}}for(let n=0;n<e.nodes.length;n++){let{id:i,sequence:u,length:l,...f}=e.nodes[n],s=[];if(l){s.push({...f,id:`${i}-start`});for(let d=r;d<l-r;d+=r)s.push({...f,id:`${i}-${d}`});s.push({...f,id:`${i}-end`})}for(let d=0;d<s.length-1;d++){let m=s[d].id,p=s[d+1].id;o.links.push({...f,source:m,target:p,id:i,length:l,sequence:u,linkNum:n})}o.nodes=[...o.nodes,...s]}for(let{strand1:n,strand2:i,source:u,target:l,...f}of e.links){let s=(t=a[`${u}${n}_${l}${i}`])!==null&&t!==void 0?t:[],d=u===l;o.links.push({source:`${u}-${n==="+"?"end":"start"}`,target:`${l}-${i==="+"?"start":"end"}`,loop:d,paths:s.length>0?s:void 0,...f})}return o}function Yte(e,r){let t={};for(let o of e){let a=r(o);a&&(t[a]||(t[a]=[]),t[a].push(o))}return t}function Xte(e){let r=[],t=0;for(;t<e.length;t++){let a=e[t];r.push([a.source.x,a.source.y])}let o=e[t-1];return r.push([o.target.x,o.target.y]),r}function XS(e,r){return Object.entries(Yte(e,t=>t.linkNum===void 0?void 0:`${t.linkNum}`)).map(([t,o])=>({links:Xte(o),original:r[t]}))}function JS(e,r,t,o,a){let n=Math.hypot(o-r,t-e),i=(t-e)/n,u=(o-r)/n;return[t+a*i,o+a*u]}var nW=T(()=>{});function jte(e){let r=[],t=new Map;for(let{paths:o,...a}of e)if(o)for(let n of o)t.has(n)||t.set(n,t.size),r.push({...a,pathId:n,pathIndex:t.get(n)});else r.push(a);return r}function eoe({graph:e,drawPaths:r=!1,drawLabels:t=!1,drawNodeHandles:o=!1,colorScheme:a="Rainbow",chunkSize:n=1e3,linkSteps:i=10,sequenceThickness:u=10,linkThickness:l=2,theta:f=.9,strengthCenter:s=-50,width:d=2e3,height:m=1e3,onFeatureClick:p=()=>{}}){let x=(0,ga.useRef)(null),c=(0,ga.useId)().replaceAll(":","_"),v=`nodearea-${c}`,y=`edgelabel-${c}`,b=`edgelabel-${c}`,{colors:h,links:S,nodes:w}=(0,ga.useMemo)(()=>{var g,A;let C=aW(e,n),D=C.links.map(_=>({..._})),N=C.nodes.map(_=>({..._})),E=Object.fromEntries((A=(g=e.paths)===null||g===void 0?void 0:g.map((_,L)=>[_.name,Jte[L]]))!==null&&A!==void 0?A:[]);return{data:C,links:D,nodes:N,colors:E}},[n,e]);return(0,ga.useEffect)(()=>{if(!x.current)return;it(x.current).append("defs").append("marker").attr("id","arrowhead").attr("viewBox","-0 -5 10 10").attr("refX",10).attr("refY",0).attr("orient","auto").attr("markerWidth",4).attr("markerHeight",4).attr("xoverflow","visible").append("svg:path").attr("d","M 0,-5 L 10 ,0 L 0,5").attr("fill","rgba(120,120,120,0.9)").style("stroke","none")},[]),(0,ga.useEffect)(()=>{if(!x.current)return;let g=aS().nodes(w),A=iS().strength(s).theta(f),C=Xy(d/3,m/3),D=rS(S).id(k=>k.id).distance(k=>(k.sequence,10)).iterations(i);g.force("charge",A).force("center",C).force("links",D),g.on("tick",()=>{P.attr("cx",B=>B.x).attr("cy",B=>B.y);let k={},R=XS(S,e.nodes);for(let B of R){let V=B.links.length;k[`${B.original.id}-start`]=[B.links[1],B.links[0]],k[`${B.original.id}-end`]=[B.links[V-2],B.links[V-1]]}let F=Il[`interpolate${a}`],I={};it(`#${v}`).selectAll("path").data(r?jte(S):S).join("path").attr("marker-end",B=>B.id?"":"url(#arrowhead)").attr("stroke",B=>{var V;if(B.linkNum!==void 0){let K=R.findIndex(z=>z.original.id===B.id);return a.startsWith("Just")?a.replace("Just","").toLowerCase():yu(F(K/R.length)).darker().toString()}else return r?h[(V=B.pathId)!==null&&V!==void 0?V:""]:"rgba(120,120,120,0.8)"}).attr("fill","none").attr("stroke-width",B=>B.linkNum===void 0?l:u).on("click",(B,V)=>{p(V)}).attr("d",B=>{var V,J;let K=B.source.x,z=B.source.y,j=B.target.x,ue=B.target.y;I[`${K}_${z}_${j}_${ue}`]||(I[`${K}_${z}_${j}_${ue}`]=0);let ee=I[`${K}_${z}_${j}_${ue}`]++;if(B.pathIndex===void 0){let ne=0,$=0,W=0,Y=0,oe=0,re=B.source.id||"",le=B.target.id||"",se=re.slice(0,re.lastIndexOf("-")),q=le.slice(0,le.lastIndexOf("-")),G=se===q&&!B.id,[te=[0,0],ie=[0,0]]=(V=k[re])!==null&&V!==void 0?V:[],[,de=[0,0]]=(J=k[le])!==null&&J!==void 0?J:[],he=Mn([ie[0]-te[0],ie[1]-te[1]],[ie[0]-de[0],ie[1]-de[1]]);return G&&!Number.isNaN(he)&&he>0&&(W=-45,Y=1,ne=25,$=20),`M${K},${z}A${ne},${$},${W},${Y},${oe} ${j},${ue}`}else{let ne=B.source.id||"",$=B.target.id||"",[W,Y]=k[ne],[oe,re]=k[$],le=(ue-z)/(j-K),se=(W[1]-Y[1])/(W[0]-Y[0]),q=(oe[1]-re[1])/(oe[0]-re[0]);if(Math.abs(le-se)<.2||Math.abs(le-q)<.2){let G=j-K,te=ue-z,ie=Math.hypot(G,te)+Math.random()*40,de=ee%2;return`M${K},${z}A${ie},${ie} 0 0,${de} ${j},${ue}`}else{let G=20+ee*30,[te,ie]=JS(W[0],W[1],Y[0],Y[1],G),[de,he]=JS(oe[0],oe[1],re[0],re[1],G);return`M ${K} ${z} C ${te} ${ie}, ${de} ${he}, ${j}, ${ue}`}}}).attr("id",(B,V)=>`${b}-${V}`)});let N=it(x.current),E=it(`#${v}`),_=XS(S,e.nodes),L={};for(let k of _){let R=k.links.length;L[`${k.original.id}-start`]=[k.links[1],k.links[0]],L[`${k.original.id}-end`]=[k.links[R-2],k.links[R-1]]}E.selectAll(`.${y}`).data(S).enter().append("text").attr("dy",12).attr("id",(k,R)=>`label-${y}-${R}`).append("textPath").attr("href",(k,R)=>`#${b}-${R}`).attr("startOffset","50%").attr("text-anchor","middle").text(k=>{let R=k.source.id.slice(0,k.source.id.lastIndexOf("-")),F=k.target.id.slice(0,k.target.id.lastIndexOf("-"));return R===F&&k.id?R:""});let P=E.selectAll("circle").data(w).join("circle").attr("r",12).attr("fill",o?"rgb(255,255,0)":"rgba(255,255,255,0.0)");yd().on("start",(k,R)=>{k.active||g.alphaTarget(.3).restart(),R.fx=k.x,R.fy=k.y}).on("drag",(k,R)=>{R.fx=k.x,R.fy=k.y}).on("end",(k,R)=>{k.active||g.alphaTarget(0),R.fx=null,R.fy=null})(P),YS().on("zoom",k=>{E.attr("transform",k.transform)})(N)},[c,v,y,b,r,o,i,f,a,u,l,s,t,d,m,p,h,w,S,e.nodes]),(0,jS.jsx)("svg",{width:d,height:m,ref:x,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",style:{fontSize:t?8:0},viewBox:[0,0,d,m].toString(),children:(0,jS.jsx)("g",{id:v})})}var jS,ga,Jte,$l,ew=T(()=>{jS=hr(zi()),ga=hr(Xo());ba();Sd();Gt();ez();$z();jU();oW();nW();({schemeCategory10:Jte}=Il);$l=eoe});function Kl(e,r){let[t,o,a]=e.split(":");o==="i"?r[t]=+a:o==="Z"&&(r[t]=a)}function Ql(e){let r={nodes:[],links:[],paths:[],header:[],id:""};for(let t of e.split(`
55
+ `)){if(t.startsWith("H")){let o={},[,...a]=t.split(" ");for(let n of a)Kl(n,o);r.header.push(o)}if(t.startsWith("S")){let[,o,...a]=t.split(" "),n=0,i="",u,l=!1;+a[0]?(n=+a[0],i=a[1],u=a.slice(2)):(l=!0,i=a[0],n=i.length,u=a.slice(1));let f={};for(let s=0;s<u.length;s++)Kl(a[s],f);l&&f.LN&&(n=+f.LN),r.nodes.push({id:o,length:n,sequence:i,tags:f})}else if(t.startsWith("E")){let[,,o,a,,,,,n,...i]=t.split(" "),u=o.slice(0,-1),l=a.slice(0,-1),f=o.at(-1),s=o.at(-1),d={};for(let m of i)Kl(m,d);r.links.push({source:u,target:l,strand1:f,strand2:s,cigar:n,tags:d})}else if(t.startsWith("L")){let[,o,a,n,i,u,...l]=t.split(" "),f={};for(let s of l)Kl(s,f);r.links.push({source:o,target:n,strand1:a,strand2:i,cigar:u,tags:f})}else if(t.startsWith("P")){let[,o,a,...n]=t.split(" ");r.paths.push({name:o,path:a,rest:n})}}return r}var rw=T(()=>{});var roe,tw,iW=T(()=>{roe=hr(zi()),tw=hr(Xo());ew();rw()});var ow=T(()=>{ew();iW();rw()});var uW=Ir((h$e,fW)=>{fW.exports=JBrowseExports.mobx});var lW=Ir((v$e,sW)=>{sW.exports=JBrowseExports["mobx-state-tree"]});var du=Ir((T$e,cW)=>{cW.exports=JBrowseExports["@jbrowse/core/ui"]});var pu=Ir((b$e,xW)=>{xW.exports=JBrowseExports["mobx-react"]});function nw({data:e,onClose:r}){return fo.default.createElement(hW.Dialog,{open:!0,title:"Feature details",onClose:r},fo.default.createElement("div",null,"Attributes"),Object.entries(e).filter(t=>!["source","target","linkNum","tags"].includes(t[0])).map(([t,o])=>fo.default.createElement("div",{key:`${t}_${o}`,style:{display:"flex",maxHeight:150,margin:3}},fo.default.createElement("div",{style:{backgroundColor:"#dda",minWidth:100}},t),fo.default.createElement("div",{style:{wordBreak:"break-word",overflow:"auto"}},String(o)))),fo.default.createElement("hr",null),e.tags&&Object.keys(e.tags).length>0?fo.default.createElement(fo.default.Fragment,null,fo.default.createElement("div",null,"Tags"),Object.entries(e.tags).map(([t,o])=>fo.default.createElement("div",{key:`${t}_${o}`,style:{display:"flex",maxHeight:150,margin:3}},fo.default.createElement("div",{style:{backgroundColor:"#dda",minWidth:100}},t),fo.default.createElement("div",{style:{wordBreak:"break-word",overflow:"auto"}},String(o))))):null)}var fo,hW,vW=T(()=>{"use strict";fo=hr(Xo()),hW=hr(du())});var Ln,gW,toe,yW,SW=T(()=>{"use strict";Ln=hr(Xo());ow();gW=hr(pu());vW();toe=(0,gW.observer)(function({model:e}){let{graph:r}=e,[t,o]=(0,Ln.useState)();return r?Ln.default.createElement(Ln.default.Fragment,null,t?Ln.default.createElement(nw,{data:t,onClose:()=>{o(void 0)}}):null,Ln.default.createElement($l,{graph:r,onFeatureClick:a=>{o(a)}})):null}),yW=toe});var TW=Ir((R$e,wW)=>{wW.exports=JBrowseExports["@jbrowse/core/util/io"]});var iw=Ir((N$e,bW)=>{bW.exports=JBrowseExports["@mui/material"]});var DW,fw,AW=T(()=>{"use client";Jl();DW=hr(zi()),fw=(0,Ii.createSvgIcon)((0,DW.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings")});var OW=T(()=>{AW()});var Ao,CW,bt,RW,ooe,NW,MW=T(()=>{"use strict";Ao=hr(Xo()),CW=hr(du()),bt=hr(iw()),RW=hr(pu()),ooe=(0,RW.observer)(function({model:e,handleClose:r}){let{mode:t}=e;return Ao.default.createElement(CW.Dialog,{open:!0,maxWidth:"xl",title:"Settings",onClose:r},Ao.default.createElement(bt.DialogContent,{style:{minWidth:800}},Ao.default.createElement(bt.FormControl,{component:"fieldset"},Ao.default.createElement(bt.RadioGroup,{value:t,onChange:o=>{e.setMode(o.target.value)}},Ao.default.createElement(bt.FormControlLabel,{value:"files",control:Ao.default.createElement(bt.Radio,null),label:"Use GFA files"}),Ao.default.createElement(bt.FormControlLabel,{value:"server",control:Ao.default.createElement(bt.Radio,null),label:"Use GFA server"})))),Ao.default.createElement(bt.DialogActions,null,Ao.default.createElement(bt.Button,{variant:"contained",onClick:()=>{r()}},"Submit"),Ao.default.createElement(bt.Button,{variant:"contained",color:"secondary",onClick:()=>{r()}},"Cancel")))}),NW=ooe});var kt,EW,FW,BW,_i,_W,aoe,PW,kW=T(()=>{"use strict";kt=hr(Xo()),EW=hr(du()),FW=hr(Xl()),BW=hr(TW()),_i=hr(iw()),_W=hr(pu());OW();MW();aoe=(0,_W.observer)(function({model:e}){let{mode:r}=e,[t,o]=(0,kt.useState)("GRCh38#chr21:1000-2000"),[a,n]=(0,kt.useState)();return(0,kt.useEffect)(()=>{a&&("uri"in a&&a.uri?e.setGfaUrl(a.uri):(async()=>{try{e.setError(void 0);let i=await(0,BW.openLocation)(a).readFile("utf8");e.setResultData(i)}catch(i){console.error(i),e.setError(i)}})())}),kt.default.createElement("div",{style:{display:"flex"}},r==="files"?kt.default.createElement("div",{style:{maxWidth:500}},kt.default.createElement(EW.FileSelector,{name:"GFA path",inline:!0,location:a,setLocation:i=>{n(i)}})):kt.default.createElement("div",null,kt.default.createElement(_i.TextField,{type:"text",variant:"outlined",margin:"normal",size:"small",value:t,style:{minWidth:500},onChange:i=>{o(i.target.value)}}),kt.default.createElement(_i.Button,{variant:"contained",type:"submit"},"Submit")),kt.default.createElement("div",{style:{flexGrow:1}}),kt.default.createElement("div",null,kt.default.createElement(_i.IconButton,{onClick:()=>{(0,FW.getSession)(e).queueDialog(i=>[NW,{handleClose:i,model:e}])}},kt.default.createElement(fw,null))))}),PW=aoe});var zW={};Yl(zW,{default:()=>ioe});var Pi,LW,IW,noe,ioe,qW=T(()=>{"use strict";Pi=hr(Xo()),LW=hr(du()),IW=hr(pu());SW();kW();noe=(0,IW.observer)(function({model:e}){let{error:r}=e;return Pi.default.createElement("div",{style:{padding:10}},Pi.default.createElement(PW,{model:e}),Pi.default.createElement("div",null,r?Pi.default.createElement(LW.ErrorMessage,{error:r}):null,Pi.default.createElement(yW,{model:e})))}),ioe=noe});var uoe={};Yl(uoe,{default:()=>Zl});var WW=hr(dw()),VW=hr(Xl());gw();var yw="1.0.0";var UW=hr(Xo()),HW=hr(jl());var pW=hr(jl());ow();var mW=hr(uW()),ya=hr(lW());async function dW(e){let r=await fetch(e);if(!r.ok)throw new Error(`HTTP ${r.status} fetching ${e}`);return r.text()}function aw(){return ya.types.compose("GraphGenomeView",pW.BaseViewModel,ya.types.model({type:"GraphGenomeView",genomicRegionLocString:ya.types.maybe(ya.types.string),gfaUrl:ya.types.maybe(ya.types.string),mode:"files"}).volatile(()=>({resultData:void 0,error:void 0})).views(e=>({get graph(){return e.resultData?Ql(e.resultData):void 0}})).actions(e=>({setMode(r){e.mode=r},setError(r){e.error=r},setResultData(r){e.resultData=r},setGenomicRegionLocString(r){e.genomicRegionLocString=r},setGfaUrl(r){e.gfaUrl=r}})).actions(e=>({afterAttach(){(0,ya.addDisposer)(e,(0,mW.autorun)(async()=>{if(e.gfaUrl)try{e.setError(void 0);let r=e.gfaUrl,t=await dW(r);e.setResultData(t)}catch(r){e.setError(r),console.error(r)}}))}})))}var foe=(0,UW.lazy)(()=>Promise.resolve().then(()=>(qW(),zW)));function uw(e){e.addViewType(()=>new HW.ViewType({name:"GraphGenomeView",displayName:"Graph genome view",stateModel:aw(),ReactComponent:foe}))}var Zl=class extends WW.default{name="GraphGenomeViewer";version=yw;install(r){uw(r)}configure(r){(0,VW.isAbstractMenuManager)(r.rootModel)&&r.rootModel.appendToSubMenu(["Add"],{label:"Graph genome viewer",icon:vw,onClick:t=>{t.addView("GraphGenomeView",{})}})}};return OV(uoe);})();
56
+ /*! Bundled license information:
57
+
58
+ decimal.js/decimal.mjs:
59
+ (*!
60
+ * decimal.js v10.5.0
61
+ * An arbitrary-precision Decimal type for JavaScript.
62
+ * https://github.com/MikeMcl/decimal.js
63
+ * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
64
+ * MIT Licence
65
+ *)
66
+ */
67
+ //# sourceMappingURL=jbrowse-plugin-graphgenomeviewer.umd.production.min.js.map