it-tools/dist/client/assets/chunks/chunk-cad3ef29.js

72 lines
609 KiB
JavaScript
Raw Normal View History

2024-04-28 00:48:29 +08:00
import{g as Xn,e as Vt,b as Sp}from"./chunk-a740628f.js";import{_ as Cp}from"./chunk-6deddc2e.js";import{w as Mp}from"./chunk-4d6daddf.js";import{r as Fp}from"./chunk-44692048.js";import{d as Bp,r as Tp,c as Op,j as qo,D as $p,m as _p,q as hi,S as Ip,k as Rp,l as qp,z as zp,M as Pp,L as Up}from"./chunk-449c23a2.js";import"./chunk-9a43cce8.js";import"./chunk-340feaf0.js";function wr(){return wr=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},wr.apply(this,arguments)}var tf={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function Ve(e){return typeof e=="number"}function ke(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 wt(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function Jn(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function Zr(e){return e&&e.constructor.prototype.isUnit===!0||!1}function Br(e){return typeof e=="string"}var je=Array.isArray;function Be(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function st(e){return Array.isArray(e)||Be(e)}function Ma(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function kt(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function ki(e){return e&&e.constructor.prototype.isRange===!0||!1}function Wa(e){return e&&e.constructor.prototype.isIndex===!0||!1}function Lp(e){return typeof e=="boolean"}function kp(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function nf(e){return e&&e.constructor.prototype.isHelp===!0||!1}function Hp(e){return typeof e=="function"}function Gp(e){return e instanceof Date}function Vp(e){return e instanceof RegExp}function Hi(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!wt(e)&&!Jn(e))}function Zp(e){return e===null}function Yp(e){return e===void 0}function Gt(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function Vr(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function Wp(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Xp(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function Jp(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function We(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function Si(e){return We(e)||mr(e)&&e.args.length===1&&We(e.args[0])&&"-+~".includes(e.op)}function Qn(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ot(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function An(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 Xa(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function mr(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function Dt(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function Qp(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function Kp(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function yr(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function af(e){return e&&e.constructor.prototype.isChain===!0||!1}function nr(e){var r=typeof e;return r==="object"?e===null?"null":ke(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":r}function $e(e){var r=typeof e;if(r==="number"||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(i){return $e(
Please create a mathjs instance if you want to change the default configuration.
Example:
import { create, all } from 'mathjs';
const mathjs = create(all);
mathjs.config({ number: 'BigNumber' });
`);return Object.freeze(tf)};wr(me,tf,{MATRIX_OPTIONS:td,NUMBER_OPTIONS:nd});function Xr(e,r){var i=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=ad(e))||r&&e&&typeof e.length=="number"){i&&(e=i);var a=0,t=function(){};return{s:t,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(l){throw l},f:t}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,u=!1,f;return{s:function(){i=i.call(e)},n:function(){var l=i.next();return n=l.done,l},e:function(l){u=!0,f=l},f:function(){try{!n&&i.return!=null&&i.return()}finally{if(u)throw f}}}}function ad(e,r){if(e){if(typeof e=="string")return zo(e,r);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return zo(e,r)}}function zo(e,r){(r==null||r>e.length)&&(r=e.length);for(var i=0,a=new Array(r);i<r;i++)a[i]=e[i];return a}function fn(e){"@babel/helpers - typeof";return fn=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},fn(e)}function Po(){return!0}function Gr(){return!1}function un(){}var Uo="Argument is not a typed-function.";function uf(){function e(R){return fn(R)==="object"&&R!==null&&R.constructor===Object}var r=[{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:e},{name:"null",test:function(z){return z===null}},{name:"undefined",test:function(z){return z===void 0}}],i={name:"any",test:Po,isAny:!0},a,t,n=0,u={createCount:0};function f(R){var z=a.get(R);if(z)return z;var Q='Unknown type "'+R+'"',ae=R.toLowerCase(),le,ve=Xr(t),de;try{for(ve.s();!(de=ve.n()).done;)if(le=de.value,le.toLowerCase()===ae){Q+='. Did you mean "'+le+'" ?';break}}catch(ce){ve.e(ce)}finally{ve.f()}throw new TypeError(Q)}function c(R){for(var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",Q=z?f(z).index:t.length,ae=[],le=0;le<R.length;++le){if(!R[le]||typeof R[le].name!="string"||typeof R[le].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");var ve=R[le].name;if(a.has(ve))throw new TypeError('Duplicate type name "'+ve+'"');ae.push(ve),a.set(ve,{name:ve,test:R[le].test,isAny:R[le].isAny,index:Q+le,conversionsTo:[]})}var de=t.slice(Q);t=t.slice(0,Q).concat(ae).concat(de);for(var ce=Q+ae.length;ce<t.length;++ce)a.get(t[ce]).index=ce}function l(){a=new Map,t=[],n=0,c([i],!1)}l(),c(r);function o(){var R,z=Xr(t),Q;try{for(z.s();!(Q=z.n()).done;)R=Q.value,a.get(R).conversionsTo=[]}catch(ae){z.e(ae)}finally{z.f()}n=0}function s(R){var z=t.filter(function(Q){var ae=a.get(Q);return!ae.isAny&&ae.test(R)});return z.length?z:["any"]}function m(R){return R&&typeof R=="function"&&"_typedFunctionData"in R}function v(R,z,Q){if(!m(R))throw new TypeError(Uo);var ae=Q&&Q.exact,le=Array.isArray(z)?z.join(","):z,ve=w(le),de=h(ve);if(!ae||de in R.signatures){var ce=R._typedFunctionData.signatureMap.get(de);if(ce)return ce}var ge=ve.length,Se;if(ae){Se=[];var Ie;for(Ie in R.signatures)Se.push(R._typedFunctionData.signatureMap.get(Ie))}else Se=R._typedFunctionData.signatures;for(var De=0;De<ge;++De){var Je=ve[De],ze=[],ir=void 0,M=Xr(Se),Z;try{for(M.s();!(Z=M.n()).done;){ir=Z.value;var ne=D(ir.params,De);if(!(!ne||Je.restParam&&!ne.restParam)){if(!ne.hasAny){var ye=function(){var Ar=g(ne);if(Je.types.some(function(Lt){return!Ar.has(Lt.name)}))return"continue"}();if(ye==="continue")continue}ze.push(ir)}}}catch(Ar){M.e(Ar)}finally{M.f()}if(Se=ze,Se.length===0)break}var Me,Te=Xr(Se),pr;try{for(Te.s();!(pr=Te.n()).done;)if(Me=pr.value,Me.params.length<=ge)return Me}catch(Ar){Te.e(Ar)}finally{Te.f()}throw new TypeError("Signature not found (signature: "+(R.name||"unnamed")+"("+h(ve,", ")+"))")}function d(R,z,Q){return v(R,z,Q).implementation}function p(R,z){var Q=f(z);if(Q.test(R))return R;var ae=Q.conversionsTo;if(ae.length===0)throw new Error(
* decimal.js v10.4.3
* An arbitrary-precision Decimal type for JavaScript.
* https://github.com/MikeMcl/decimal.js
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
* MIT Licence
*/var vn=9e15,It=1e9,Fi="0123456789abcdef",Oa="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",$a="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Bi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-vn,maxE:vn,crypto:!1},wf,bt,Re=!0,ja="[DecimalError] ",$t=ja+"Invalid argument: ",Nf=ja+"Precision limit exceeded",Df=ja+"crypto unavailable",Af="[object Decimal]",Sr=Math.floor,dr=Math.pow,kd=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Hd=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Gd=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ef=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Kr=1e7,Oe=7,Vd=9007199254740991,Zd=Oa.length-1,Ti=$a.length-1,he={toStringTag:Af};he.absoluteValue=he.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Fe(e)};he.ceil=function(){return Fe(new this.constructor(this),this.e+1,2)};he.clampedTo=he.clamp=function(e,r){var i,a=this,t=a.constructor;if(e=new t(e),r=new t(r),!e.s||!r.s)return new t(NaN);if(e.gt(r))throw Error($t+r);return i=a.cmp(e),i<0?e:a.cmp(r)>0?r:new t(a)};he.comparedTo=he.cmp=function(e){var r,i,a,t,n=this,u=n.d,f=(e=new n.constructor(e)).d,c=n.s,l=e.s;if(!u||!f)return!c||!l?NaN:c!==l?c:u===f?0:!u^c<0?1:-1;if(!u[0]||!f[0])return u[0]?c:f[0]?-l:0;if(c!==l)return c;if(n.e!==e.e)return n.e>e.e^c<0?1:-1;for(a=u.length,t=f.length,r=0,i=a<t?a:t;r<i;++r)if(u[r]!==f[r])return u[r]>f[r]^c<0?1:-1;return a===t?0:a>t^c<0?1:-1};he.cosine=he.cos=function(){var e,r,i=this,a=i.constructor;return i.d?i.d[0]?(e=a.precision,r=a.rounding,a.precision=e+Math.max(i.e,i.sd())+Oe,a.rounding=1,i=Yd(a,Bf(a,i)),a.precision=e,a.rounding=r,Fe(bt==2||bt==3?i.neg():i,e,r,!0)):new a(1):new a(NaN)};he.cubeRoot=he.cbrt=function(){var e,r,i,a,t,n,u,f,c,l,o=this,s=o.constructor;if(!o.isFinite()||o.isZero())return new s(o);for(Re=!1,n=o.s*dr(o.s*o,1/3),!n||Math.abs(n)==1/0?(i=Nr(o.d),e=o.e,(n=(e-i.length+1)%3)&&(i+=n==1||n==-2?"0":"00"),n=dr(i,1/3),e=Sr((e+1)/3)-(e%3==(e<0?-1:2)),n==1/0?i="5e"+e:(i=n.toExponential(),i=i.slice(0,i.indexOf("e")+1)+e),a=new s(i),a.s=o.s):a=new s(n.toString()),u=(e=s.precision)+3;;)if(f=a,c=f.times(f).times(f),l=c.plus(o),a=lr(l.p
* @license Complex.js v2.1.1 12/05/2020
*
* Copyright (c) 2020, Robert Eisele (robert@xarg.org)
* Dual licensed under the MIT or GPL Version 2 licenses.
**/(function(e,r){(function(i){var a=Math.cosh||function(s){return Math.abs(s)<1e-9?1-s:(Math.exp(s)+Math.exp(-s))*.5},t=Math.sinh||function(s){return Math.abs(s)<1e-9?s:(Math.exp(s)-Math.exp(-s))*.5},n=function(s){var m=Math.PI/4;if(-m>s||s>m)return Math.cos(s)-1;var v=s*s;return v*(v*(v*(v*(v*(v*(v*(v/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},u=function(s,m){var v=Math.abs(s),d=Math.abs(m);return v<3e3&&d<3e3?Math.sqrt(v*v+d*d):(v<d?(v=d,d=s/m):d=m/s,v*Math.sqrt(1+d*d))},f=function(){throw SyntaxError("Invalid Param")};function c(s,m){var v=Math.abs(s),d=Math.abs(m);return s===0?Math.log(d):m===0?Math.log(v):v<3e3&&d<3e3?Math.log(s*s+m*m)*.5:(s=s/2,m=m/2,.5*Math.log(s*s+m*m)+Math.LN2)}var l=function(s,m){var v={re:0,im:0};if(s==null)v.re=v.im=0;else if(m!==void 0)v.re=s,v.im=m;else switch(typeof s){case"object":if("im"in s&&"re"in s)v.re=s.re,v.im=s.im;else if("abs"in s&&"arg"in s){if(!Number.isFinite(s.abs)&&Number.isFinite(s.arg))return o.INFINITY;v.re=s.abs*Math.cos(s.arg),v.im=s.abs*Math.sin(s.arg)}else if("r"in s&&"phi"in s){if(!Number.isFinite(s.r)&&Number.isFinite(s.phi))return o.INFINITY;v.re=s.r*Math.cos(s.phi),v.im=s.r*Math.sin(s.phi)}else s.length===2?(v.re=s[0],v.im=s[1]):f();break;case"string":v.im=v.re=0;var d=s.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),p=1,h=0;d===null&&f();for(var y=0;y<d.length;y++){var E=d[y];E===" "||E===" "||E===`
`||(E==="+"?p++:E==="-"?h++:E==="i"||E==="I"?(p+h===0&&f(),d[y+1]!==" "&&!isNaN(d[y+1])?(v.im+=parseFloat((h%2?"-":"")+d[y+1]),y++):v.im+=parseFloat((h%2?"-":"")+"1"),p=h=0):((p+h===0||isNaN(E))&&f(),d[y+1]==="i"||d[y+1]==="I"?(v.im+=parseFloat((h%2?"-":"")+E),y++):v.re+=parseFloat((h%2?"-":"")+E),p=h=0))}p+h>0&&f();break;case"number":v.im=0,v.re=s;break;default:f()}return isNaN(v.re)||isNaN(v.im),v};function o(s,m){if(!(this instanceof o))return new o(s,m);var v=l(s,m);this.re=v.re,this.im=v.im}o.prototype={re:0,im:0,sign:function(){var s=this.abs();return new o(this.re/s,this.im/s)},add:function(s,m){var v=new o(s,m);return this.isInfinite()&&v.isInfinite()?o.NAN:this.isInfinite()||v.isInfinite()?o.INFINITY:new o(this.re+v.re,this.im+v.im)},sub:function(s,m){var v=new o(s,m);return this.isInfinite()&&v.isInfinite()?o.NAN:this.isInfinite()||v.isInfinite()?o.INFINITY:new o(this.re-v.re,this.im-v.im)},mul:function(s,m){var v=new o(s,m);return this.isInfinite()&&v.isZero()||this.isZero()&&v.isInfinite()?o.NAN:this.isInfinite()||v.isInfinite()?o.INFINITY:v.im===0&&this.im===0?new o(this.re*v.re,0):new o(this.re*v.re-this.im*v.im,this.re*v.im+this.im*v.re)},div:function(s,m){var v=new o(s,m);if(this.isZero()&&v.isZero()||this.isInfinite()&&v.isInfinite())return o.NAN;if(this.isInfinite()||v.isZero())return o.INFINITY;if(this.isZero()||v.isInfinite())return o.ZERO;s=this.re,m=this.im;var d=v.re,p=v.im,h,y;return p===0?new o(s/d,m/d):Math.abs(d)<Math.abs(p)?(y=d/p,h=d*y+p,new o((s*y+m)/h,(m*y-s)/h)):(y=p/d,h=p*y+d,new o((s+m*y)/h,(m-s*y)/h))},pow:function(s,m){var v=new o(s,m);if(s=this.re,m=this.im,v.isZero())return o.ONE;if(v.im===0){if(m===0&&s>0)return new o(Math.pow(s,v.re),0);if(s===0)switch((v.re%4+4)%4){case 0:return new o(Math.pow(m,v.re),0);case 1:return new o(0,Math.pow(m,v.re));case 2:return new o(-Math.pow(m,v.re),0);case 3:return new o(0,-Math.pow(m,v.re))}}if(s===0&&m===0&&v.re>0&&v.im>=0)return o.ZERO;var d=Math.atan2(m,s),p=c(s,m);return s=Math.exp(v.re*p-v.im*d),m=v.im*p+v.re*d,new o(s*Math.cos(m),s*Math.sin(m))},sqrt:function(){var s=this.re,m=this.im,v=this.abs(),d,p;if(s>=0){if(m===0)return new o(Math.sqrt(s),0);d=.5*Math.sqrt(2*(v+s))}else d=Math.abs(m)/Math.sqrt(2*(v-s));return s<=0?p=.5*Math.sqrt(2*(v-s)):p=Math.abs(m)/Math.sqrt(2*(v+s)),new o(d,m<0?-p:p)},exp:function(){var s=Math.exp(this.re);return this.im,new o(s*Math.cos(this.im),s*Math.sin(this.im))},expm1:function(){var s=this.re,m=this.im;return new o(Math.expm1(s)*Math.cos(m)+n(m),Math.exp(s)*Math.sin(m))},log:function(){var s=this.re,m=this.im;return new o(c(s,m),Math.atan2(m,s))},abs:function(){return u(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var s=this.re,m=this.im;return new o(Math.sin(s)*a(m),Math.cos(s)*t(m))},cos:function(){var s=this.re,m=this.im;return new o(Math.cos(s)*a(m),-Math.sin(s)*t(m))},tan:function(){var s=2*this.re,m=2*this.im,v=Math.cos(s)+a(m);return new o(Math.sin(s)/v,t(m)/v)},cot:function(){var s=2*this.re,m=2*this.im,v=Math.cos(s)-a(m);return new o(-Math.sin(s)/v,t(m)/v)},sec:function(){var s=this.re,m=this.im,v=.5*a(2*m)+.5*Math.cos(2*s);return new o(Math.cos(s)*a(m)/v,Math.sin(s)*t(m)/v)},csc:function(){var s=this.re,m=this.im,v=.5*a(2*m)-.5*Math.cos(2*s);return new o(Math.sin(s)*a(m)/v,-Math.cos(s)*t(m)/v)},asin:function(){var s=this.re,m=this.im,v=new o(m*m-s*s+1,-2*s*m).sqrt(),d=new o(v.re-m,v.im+s).log();return new o(d.im,-d.re)},acos:function(){var s=this.re,m=this.im,v=new o(m*m-s*s+1,-2*s*m).sqrt(),d=new o(v.re-m,v.im+s).log();return new o(Math.PI/2-d.im,d.re)},atan:function(){var s=this.re,m=this.im;if(s===0){if(m===1)return new o(0,1/0);if(m===-1)return new o(0,-1/0)}var v=s*s+(1-m)*(1-m),d=new o((1-m*m-s*s)/v,-2*s/v).log();return new o(-.5*d.im,.5*d.re)},acot:function(){var s=this.re,m=this.im;if(m===0)return new o(Math.atan2(1,s),0);var v=s*s+m*m;return v!==0?new o(s/v,-m/v).atan():new o(s!==0?s/0:0,m!==0?-m/0:0).atan()},asec:function(){var s=this.re,m=this.im;if(s===0&&m===0)return new o(0,1/0);var v=s*s+m*m;return v!==0?new o(s/v,-m/v).acos():new o(s!==0?s/0:0,
* @license Fraction.js v4.2.0 05/03/2022
* https://www.xarg.org/2014/03/rational-numbers-in-javascript/
*
* Copyright (c) 2021, Robert Eisele (robert@xarg.org)
* Dual licensed under the MIT or GPL Version 2 licenses.
**/(function(e,r){(function(i){var a=2e3,t={s:1,n:0,d:1};function n(d,p){if(isNaN(d=parseInt(d,10)))throw v.InvalidParameter;return d*p}function u(d,p){if(p===0)throw v.DivisionByZero;var h=Object.create(v.prototype);h.s=d<0?-1:1,d=d<0?-d:d;var y=m(d,p);return h.n=d/y,h.d=p/y,h}function f(d){for(var p={},h=d,y=2,E=4;E<=h;){for(;h%y===0;)h/=y,p[y]=(p[y]||0)+1;E+=1+2*y++}return h!==d?h>1&&(p[h]=(p[h]||0)+1):p[d]=(p[d]||0)+1,p}var c=function(d,p){var h=0,y=1,E=1,g=0,w=0,x=0,b=1,A=1,D=0,S=1,N=1,B=1,F=1e7,$;if(d!=null)if(p!==void 0){if(h=d,y=p,E=h*y,h%1!==0||y%1!==0)throw v.NonIntegerParameter}else switch(typeof d){case"object":{if("d"in d&&"n"in d)h=d.n,y=d.d,"s"in d&&(h*=d.s);else if(0 in d)h=d[0],1 in d&&(y=d[1]);else throw v.InvalidParameter;E=h*y;break}case"number":{if(d<0&&(E=d,d=-d),d%1===0)h=d;else if(d>0){for(d>=1&&(A=Math.pow(10,Math.floor(1+Math.log(d)/Math.LN10)),d/=A);S<=F&&B<=F;)if($=(D+N)/(S+B),d===$){S+B<=F?(h=D+N,y=S+B):B>S?(h=N,y=B):(h=D,y=S);break}else d>$?(D+=N,S+=B):(N+=D,B+=S),S>F?(h=N,y=B):(h=D,y=S);h*=A}else(isNaN(d)||isNaN(p))&&(y=h=NaN);break}case"string":{if(S=d.match(/\d+|./g),S===null)throw v.InvalidParameter;if(S[D]==="-"?(E=-1,D++):S[D]==="+"&&D++,S.length===D+1?w=n(S[D++],E):S[D+1]==="."||S[D]==="."?(S[D]!=="."&&(g=n(S[D++],E)),D++,(D+1===S.length||S[D+1]==="("&&S[D+3]===")"||S[D+1]==="'"&&S[D+3]==="'")&&(w=n(S[D],E),b=Math.pow(10,S[D].length),D++),(S[D]==="("&&S[D+2]===")"||S[D]==="'"&&S[D+2]==="'")&&(x=n(S[D+1],E),A=Math.pow(10,S[D+1].length)-1,D+=3)):S[D+1]==="/"||S[D+1]===":"?(w=n(S[D],E),b=n(S[D+2],1),D+=3):S[D+3]==="/"&&S[D+1]===" "&&(g=n(S[D],E),w=n(S[D+2],E),b=n(S[D+4],1),D+=5),S.length<=D){y=b*A,E=h=x+y*g+A*w;break}}default:throw v.InvalidParameter}if(y===0)throw v.DivisionByZero;t.s=E<0?-1:1,t.n=Math.abs(h),t.d=Math.abs(y)};function l(d,p,h){for(var y=1;p>0;d=d*d%h,p>>=1)p&1&&(y=y*d%h);return y}function o(d,p){for(;p%2===0;p/=2);for(;p%5===0;p/=5);if(p===1)return 0;for(var h=10%p,y=1;h!==1;y++)if(h=h*10%p,y>a)return 0;return y}function s(d,p,h){for(var y=1,E=l(10,h,p),g=0;g<300;g++){if(y===E)return g;y=y*10%p,E=E*10%p}return 0}function m(d,p){if(!d)return p;if(!p)return d;for(;;){if(d%=p,!d)return p;if(p%=d,!p)return d}}function v(d,p){if(c(d,p),this instanceof v)d=m(t.d,t.n),this.s=t.s,this.n=t.n/d,this.d=t.d/d;else return u(t.s*t.n,t.d)}v.DivisionByZero=new Error("Division by Zero"),v.InvalidParameter=new Error("Invalid argument"),v.NonIntegerParameter=new Error("Parameters must be integer"),v.prototype={s:1,n:0,d:1,abs:function(){return u(this.n,this.d)},neg:function(){return u(-this.s*this.n,this.d)},add:function(d,p){return c(d,p),u(this.s*this.n*t.d+t.s*this.d*t.n,this.d*t.d)},sub:function(d,p){return c(d,p),u(this.s*this.n*t.d-t.s*this.d*t.n,this.d*t.d)},mul:function(d,p){return c(d,p),u(this.s*t.s*this.n*t.n,this.d*t.d)},div:function(d,p){return c(d,p),u(this.s*t.s*this.n*t.d,this.d*t.n)},clone:function(){return u(this.s*this.n,this.d)},mod:function(d,p){if(isNaN(this.n)||isNaN(this.d))return new v(NaN);if(d===void 0)return u(this.s*this.n%this.d,1);if(c(d,p),t.n===0&&this.d===0)throw v.DivisionByZero;return u(this.s*(t.d*this.n)%(t.n*this.d),t.d*this.d)},gcd:function(d,p){return c(d,p),u(m(t.n,this.n)*m(t.d,this.d),t.d*this.d)},lcm:function(d,p){return c(d,p),t.n===0&&this.n===0?u(0,1):u(t.n*this.n,m(t.n,this.n)*m(t.d,this.d))},ceil:function(d){return d=Math.pow(10,d||0),isNaN(this.n)||isNaN(this.d)?new v(NaN):u(Math.ceil(d*this.s*this.n/this.d),d)},floor:function(d){return d=Math.pow(10,d||0),isNaN(this.n)||isNaN(this.d)?new v(NaN):u(Math.floor(d*this.s*this.n/this.d),d)},round:function(d){return d=Math.pow(10,d||0),isNaN(this.n)||isNaN(this.d)?new v(NaN):u(Math.round(d*this.s*this.n/this.d),d)},inverse:function(){return u(this.s*this.d,this.n)},pow:function(d,p){if(c(d,p),t.d===1)return t.s<0?u(Math.pow(this.s*this.d,t.n),Math.pow(this.n,t.n)):u(Math.pow(this.s*this.n,t.n),Math.pow(this.d,t.n));if(this.s<0)return null;var h=f(this.n),y=f(this.d),E=1,g=1;for(var w in h)if(w!=="1"){if(w==="0"){E=0;break}if(h[w]*=t.n,h[w]%t.d===0)h[w]/=t.d;else return null;E*=Math.pow(w,h[w]
`,w=0;w<y;w++)for(var x=this._ptr[w],b=this._ptr[w+1],A=x;A<b;A++){var D=this._index[A];g+=`
(`+Pe(D,p)+", "+Pe(w,p)+") ==> "+(this._values?Pe(this._values[A],p):"X")}return g},t.prototype.toString=function(){return Pe(this.toArray())},t.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},t.prototype.diagonal=function(p){if(p){if(ke(p)&&(p=p.toNumber()),!Ve(p)||!Ce(p))throw new TypeError("The parameter k must be an integer number")}else p=0;var h=p>0?p:0,y=p<0?-p:0,E=this._size[0],g=this._size[1],w=Math.min(E-y,g-h),x=[],b=[],A=[];A[0]=0;for(var D=h;D<g&&x.length<w;D++)for(var S=this._ptr[D],N=this._ptr[D+1],B=S;B<N;B++){var F=this._index[B];if(F===D-h+y){x.push(this._values[B]),b[x.length-1]=F-y;break}}return A.push(x.length),new t({values:x,index:b,ptr:A,size:[w,1]})},t.fromJSON=function(p){return new t(p)},t.diagonal=function(p,h,y,E,g){if(!je(p))throw new TypeError("Array expected, size parameter");if(p.length!==2)throw new Error("Only two dimensions matrix are supported");if(p=p.map(function(O){if(ke(O)&&(O=O.toNumber()),!Ve(O)||!Ce(O)||O<1)throw new Error("Size values must be positive integers");return O}),y){if(ke(y)&&(y=y.toNumber()),!Ve(y)||!Ce(y))throw new TypeError("The parameter k must be an integer number")}else y=0;var w=i,x=0;Br(g)&&(w=r.find(i,[g,g])||i,x=r.convert(0,g));var b=y>0?y:0,A=y<0?-y:0,D=p[0],S=p[1],N=Math.min(D-A,S-b),B;if(je(h)){if(h.length!==N)throw new Error("Invalid value array length");B=function(L){return h[L]}}else if(Be(h)){var F=h.size();if(F.length!==1||F[0]!==N)throw new Error("Invalid matrix length");B=function(L){return h.get([L])}}else B=function(){return h};for(var $=[],q=[],_=[],C=0;C<S;C++){_.push($.length);var T=C-b;if(T>=0&&T<N){var H=B(T);w(H,x)||(q.push(T+A),$.push(H))}}return _.push($.length),new t({values:$,index:q,ptr:_,size:[D,S]})},t.prototype.swapRows=function(p,h){if(!Ve(p)||!Ce(p)||!Ve(h)||!Ce(h))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return rr(p,this._size[0]),rr(h,this._size[0]),t._swapRows(p,h,this._size[1],this._values,this._index,this._ptr),this},t._forEachRow=function(p,h,y,E,g){for(var w=E[p],x=E[p+1],b=w;b<x;b++)g(y[b],h[b])},t._swapRows=function(p,h,y,E,g,w){for(var x=0;x<y;x++){var b=w[x],A=w[x+1],D=l(p,b,A,g),S=l(h,b,A,g);if(D<A&&S<A&&g[D]===p&&g[S]===h){if(E){var N=E[D];E[D]=E[S],E[S]=N}continue}if(D<A&&g[D]===p&&(S>=A||g[S]!==h)){var B=E?E[D]:void 0;g.splice(S,0,h),E&&E.splice(S,0,B),g.splice(S<=D?D+1:D,1),E&&E.splice(S<=D?D+1:D,1);continue}if(S<A&&g[S]===h&&(D>=A||g[D]!==p)){var F=E?E[S]:void 0;g.splice(D,0,p),E&&E.splice(D,0,F),g.splice(D<=S?S+1:S,1),E&&E.splice(D<=S?S+1:S,1)}}},t},{isClass:!0}),I0="number",R0=["typed"];function q0(e){var r=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(r){var i={"0b":2,"0o":8,"0x":16}[r[1]],a=r[2],t=r[3];return{input:e,radix:i,integerPart:a,fractionalPart:t}}else return null}function z0(e){for(var r=parseInt(e.integerPart,e.radix),i=0,a=0;a<e.fractionalPart.length;a++){var t=parseInt(e.fractionalPart[a],e.radix);i+=t/Math.pow(e.radix,a+1)}var n=r+i;if(isNaN(n))throw new SyntaxError('String "'+e.input+'" is no valid number');return n}var P0=I(I0,R0,e=>{var{typed:r}=e,i=r("number",{"":function(){return 0},number:function(t){return t},string:function(t){if(t==="NaN")return NaN;var n=q0(t);if(n)return z0(n);var u=0,f=t.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);f&&(u=Number(f[2]),t=f[1]);var c=Number(t);if(isNaN(c))throw new SyntaxError('String "'+t+'" is no valid number');if(f){if(c>2**u-1)throw new SyntaxError('String "'.concat(t,'" is out of range'));c>=2**(u-1)&&(c=c-2**u)}return c},BigNumber:function(t){return t.toNumber()},Fraction:function(t){return t.valueOf()},Unit:r.referToSelf(a=>t=>{var n=t.clone();return n.value=a(t.value),n}),null:function(t){return 0},"Unit, string | Unit":function(t,n){return t.toNumber(n)},"Array | Matrix":r.referToSelf(a=>t=>He(t,a))});return i.fromJSON=function(a){return parseFloat(a.value)},i}),uu="string",U0=["typed"],L0=I(uu,U0,e=>{var{typed:r}=e;return r(uu,{"":function
`)}toJSON(){return{mathjs:da,blocks:this.blocks}}static fromJSON(n){return new a(n.blocks)}toHTML(n){return this.blocks.map(function(u){return u.node.toHTML(n)+(u.visible?"":'<span class="math-separator">;</span>')}).join('<span class="math-separator"><br /></span>')}_toTex(n){return this.blocks.map(function(u){return u.node.toTex(n)+(u.visible?"":";")}).join(`\\;\\;
`)}}return hr(a,"name",da),a},{isClass:!0,isNode:!0}),ha="ConditionalNode",I2=["Node"],R2=I(ha,I2,e=>{var{Node:r}=e;function i(t){if(typeof t=="number"||typeof t=="boolean"||typeof t=="string")return!!t;if(t){if(ke(t))return!t.isZero();if(wt(t))return!!(t.re||t.im);if(Zr(t))return!!t.value}if(t==null)return!1;throw new TypeError('Unsupported type of condition "'+nr(t)+'"')}class a extends r{constructor(n,u,f){if(super(),!er(n))throw new TypeError("Parameter condition must be a Node");if(!er(u))throw new TypeError("Parameter trueExpr must be a Node");if(!er(f))throw new TypeError("Parameter falseExpr must be a Node");this.condition=n,this.trueExpr=u,this.falseExpr=f}get type(){return ha}get isConditionalNode(){return!0}_compile(n,u){var f=this.condition._compile(n,u),c=this.trueExpr._compile(n,u),l=this.falseExpr._compile(n,u);return function(s,m,v){return i(f(s,m,v))?c(s,m,v):l(s,m,v)}}forEach(n){n(this.condition,"condition",this),n(this.trueExpr,"trueExpr",this),n(this.falseExpr,"falseExpr",this)}map(n){return new a(this._ifNode(n(this.condition,"condition",this)),this._ifNode(n(this.trueExpr,"trueExpr",this)),this._ifNode(n(this.falseExpr,"falseExpr",this)))}clone(){return new a(this.condition,this.trueExpr,this.falseExpr)}_toString(n){var u=n&&n.parenthesis?n.parenthesis:"keep",f=tr(this,u,n&&n.implicit),c=this.condition.toString(n),l=tr(this.condition,u,n&&n.implicit);(u==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=f)&&(c="("+c+")");var o=this.trueExpr.toString(n),s=tr(this.trueExpr,u,n&&n.implicit);(u==="all"||this.trueExpr.type==="OperatorNode"||s!==null&&s<=f)&&(o="("+o+")");var m=this.falseExpr.toString(n),v=tr(this.falseExpr,u,n&&n.implicit);return(u==="all"||this.falseExpr.type==="OperatorNode"||v!==null&&v<=f)&&(m="("+m+")"),c+" ? "+o+" : "+m}toJSON(){return{mathjs:ha,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(n){return new a(n.condition,n.trueExpr,n.falseExpr)}toHTML(n){var u=n&&n.parenthesis?n.parenthesis:"keep",f=tr(this,u,n&&n.implicit),c=this.condition.toHTML(n),l=tr(this.condition,u,n&&n.implicit);(u==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=f)&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>');var o=this.trueExpr.toHTML(n),s=tr(this.trueExpr,u,n&&n.implicit);(u==="all"||this.trueExpr.type==="OperatorNode"||s!==null&&s<=f)&&(o='<span class="math-parenthesis math-round-parenthesis">(</span>'+o+'<span class="math-parenthesis math-round-parenthesis">)</span>');var m=this.falseExpr.toHTML(n),v=tr(this.falseExpr,u,n&&n.implicit);return(u==="all"||this.falseExpr.type==="OperatorNode"||v!==null&&v<=f)&&(m='<span class="math-parenthesis math-round-parenthesis">(</span>'+m+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+'<span class="math-operator math-conditional-operator">?</span>'+o+'<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 hr(a,"name",ha),a},{isClass:!0,isNode:!0}),zi=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},q2={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},z2={"":"\\--","—":"\\---"," ":"~"," ":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},P2=function(r,i){return zi({},r,i)},U2=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.preserveFormatting,a=i===void 0?!1:i,t=r.escapeMapFn,n=t===void 0?P2:t,u=String(e),f="",c=n(zi({},q2),a?zi({},z2):{}),l=Object.keys(c),o=function(){var m=!1;l.forEach(function(v,d){m||u.length>=v.length&&u.slice(0,v.length)===v&&(f+=c[l[d]],u=u.slice(v.length,u.length),m=!0)}),m||(f+=u.slice(0,1),u=u.slice(1,u.length))};u;)o();r
`)+"\\end{array}\\right\\}";return f}}return hr(i,"name",xa),i},{isClass:!0,isNode:!0}),wa="OperatorNode",Q2=["Node"],K2=I(wa,Q2,e=>{var{Node:r}=e;function i(n,u){var f=n;if(u==="auto")for(;Dt(f);)f=f.content;return We(f)?!0:mr(f)?i(f.args[0],u):!1}function a(n,u,f,c,l){var o=tr(n,u,f),s=Ln(n,u);if(u==="all"||c.length>2&&n.getIdentifier()!=="OperatorNode:add"&&n.getIdentifier()!=="OperatorNode:multiply")return c.map(function(N){switch(N.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var m;switch(c.length){case 0:m=[];break;case 1:{var v=tr(c[0],u,f,n);if(l&&v!==null){var d,p;if(u==="keep"?(d=c[0].getIdentifier(),p=n.getIdentifier()):(d=c[0].getContent().getIdentifier(),p=n.getContent().getIdentifier()),Jr[o][p].latexLeftParens===!1){m=[!1];break}if(Jr[v][d].latexParens===!1){m=[!1];break}}if(v===null){m=[!1];break}if(v<=o){m=[!0];break}m=[!1]}break;case 2:{var h,y=tr(c[0],u,f,n),E=Di(n,c[0],u);y===null?h=!1:y===o&&s==="right"&&!E||y<o?h=!0:h=!1;var g,w=tr(c[1],u,f,n),x=Di(n,c[1],u);if(w===null?g=!1:w===o&&s==="left"&&!x||w<o?g=!0:g=!1,l){var b,A,D;u==="keep"?(b=n.getIdentifier(),A=n.args[0].getIdentifier(),D=n.args[1].getIdentifier()):(b=n.getContent().getIdentifier(),A=n.args[0].getContent().getIdentifier(),D=n.args[1].getContent().getIdentifier()),y!==null&&(Jr[o][b].latexLeftParens===!1&&(h=!1),Jr[y][A].latexParens===!1&&(h=!1)),w!==null&&(Jr[o][b].latexRightParens===!1&&(g=!1),Jr[w][D].latexParens===!1&&(g=!1))}m=[h,g]}break;default:(n.getIdentifier()==="OperatorNode:add"||n.getIdentifier()==="OperatorNode:multiply")&&(m=c.map(function(N){var B=tr(N,u,f,n),F=Di(n,N,u),$=Ln(N,u);return B===null?!1:o===B&&s===$&&!F?!0:B<o}));break}if(c.length>=2&&n.getIdentifier()==="OperatorNode:multiply"&&n.implicit&&u!=="all"&&f==="hide")for(var S=1;S<m.length;++S)i(c[S],u)&&!m[S-1]&&(u!=="keep"||!Dt(c[S-1]))&&(m[S]=!0);return m}class t extends r{constructor(u,f,c,l,o){if(super(),typeof u!="string")throw new TypeError('string expected for parameter "op"');if(typeof f!="string")throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(c)||!c.every(er))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=l===!0,this.isPercentage=o===!0,this.op=u,this.fn=f,this.args=c||[]}get type(){return wa}get isOperatorNode(){return!0}_compile(u,f){if(typeof this.fn!="string"||!Vi(u,this.fn))throw u[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var c=Tr(u,this.fn),l=Nt(this.args,function(v){return v._compile(u,f)});if(l.length===1){var o=l[0];return function(d,p,h){return c(o(d,p,h))}}else if(l.length===2){var s=l[0],m=l[1];return function(d,p,h){return c(s(d,p,h),m(d,p,h))}}else return function(d,p,h){return c.apply(null,Nt(l,function(y){return y(d,p,h)}))}}forEach(u){for(var f=0;f<this.args.length;f++)u(this.args[f],"args["+f+"]",this)}map(u){for(var f=[],c=0;c<this.args.length;c++)f[c]=this._ifNode(u(this.args[c],"args["+c+"]",this));return new t(this.op,this.fn,f,this.implicit,this.isPercentage)}clone(){return new t(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(u){var f=u&&u.parenthesis?u.parenthesis:"keep",c=u&&u.implicit?u.implicit:"hide",l=this.args,o=a(this,f,c,l,!1);if(l.length===1){var s=Ln(this,f),m=l[0].toString(u);o[0]&&(m="("+m+")");var v=/[a-zA-Z]+/.test(this.op);return s==="right"?this.op+(v?" ":"")+m:s==="left"?m+(v?" ":"")+this.op:m+this.op}else if(l.length===2){var d=l[0].toString(u),p=l[1].toString(u);return o[0]&&(d="("+d+")"),o[1]&&(p="("+p+")"),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?d+" "+p:d+" "+this.op+" "+p}else if(l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var h=l.map(function(y,E){return y=y.toString(u),o[E]&&(y="("+y+")"),y});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?h.
`).concat(t(D)))};if(v){var p=this.args;return function(D,S,N){var B=d(D);return B(p,c,Hn(D,S),D)}}else switch(o.length){case 0:return function(D,S,N){var B=d(D);return B()};case 1:return function(D,S,N){var B=d(D),F=o[0];return B(F(D,S,N))};case 2:return function(D,S,N){var B=d(D),F=o[0],$=o[1];return B(F(D,S,N),$(D,S,N))};default:return function(D,S,N){var B=d(D),F=o.map($=>$(D,S,N));return B(...F)}}}}else if(Gt(this.fn)&&An(this.fn.index)&&this.fn.index.isObjectProperty()){var y=this.fn.object._compile(c,l),E=this.fn.index.getObjectProperty(),g=this.args;return function(D,S,N){var B=y(D,S,N),F=Od(B,E);if(F!=null&&F.rawArgs)return F(g,c,Hn(D,S),D);var $=o.map(q=>q(D,S,N));return F.apply(B,$)}}else{var w=this.fn.toString(),x=this.fn._compile(c,l),b=this.args;return function(D,S,N){var B=x(D,S,N);if(typeof B!="function")throw new TypeError("Expression '".concat(w,"' did not evaluate to a function; value is:")+`
`.concat(t(B)));if(B.rawArgs)return B(b,c,Hn(D,S),D);var F=o.map($=>$(D,S,N));return B.apply(B,F)}}}forEach(c){c(this.fn,"fn",this);for(var l=0;l<this.args.length;l++)c(this.args[l],"args["+l+"]",this)}map(c){for(var l=this._ifNode(c(this.fn,"fn",this)),o=[],s=0;s<this.args.length;s++)o[s]=this._ifNode(c(this.args[s],"args["+s+"]",this));return new u(l,o)}clone(){return new u(this.fn,this.args.slice(0))}toString(c){var l,o=this.fn.toString(c);return c&&typeof c.handler=="object"&&Ee(c.handler,o)&&(l=c.handler[o](this,c)),typeof l<"u"?l:super.toString(c)}_toString(c){var l=this.args.map(function(s){return s.toString(c)}),o=Qn(this.fn)?"("+this.fn.toString(c)+")":this.fn.toString(c);return o+"("+l.join(", ")+")"}toJSON(){return{mathjs:Ea,fn:this.fn,args:this.args}}toHTML(c){var l=this.args.map(function(o){return o.toHTML(c)});return'<span class="math-function">'+Yr(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+l.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}toTex(c){var l;return c&&typeof c.handler=="object"&&Ee(c.handler,this.name)&&(l=c.handler[this.name](this,c)),typeof l<"u"?l:super.toTex(c)}_toTex(c){var l=this.args.map(function(m){return m.toTex(c)}),o;Hl[this.name]&&(o=Hl[this.name]),r[this.name]&&(typeof r[this.name].toTex=="function"||typeof r[this.name].toTex=="object"||typeof r[this.name].toTex=="string")&&(o=r[this.name].toTex);var s;switch(typeof o){case"function":s=o(this,c);break;case"string":s=n(o,this,c);break;case"object":switch(typeof o[l.length]){case"function":s=o[l.length](this,c);break;case"string":s=n(o[l.length],this,c);break}}return typeof s<"u"?s:n(k2,this,c)}getIdentifier(){return this.type+":"+this.name}}return hr(u,"name",Ea),hr(u,"onUndefinedFunction",function(f){throw new Error("Undefined function "+f)}),hr(u,"fromJSON",function(f){return new u(f.fn,f.args)}),u},{isClass:!0,isNode:!0}),Vl="parse",cD=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],fD=I(Vl,cD,e=>{var{typed:r,numeric:i,config:a,AccessorNode:t,ArrayNode:n,AssignmentNode:u,BlockNode:f,ConditionalNode:c,ConstantNode:l,FunctionAssignmentNode:o,FunctionNode:s,IndexNode:m,ObjectNode:v,OperatorNode:d,ParenthesisNode:p,RangeNode:h,RelationalNode:y,SymbolNode:E}=e,g=r(Vl,{string:function(Z){return L(Z,{})},"Array | Matrix":function(Z){return w(Z,{})},"string, Object":function(Z,ne){var ye=ne.nodes!==void 0?ne.nodes:{};return L(Z,ye)},"Array | Matrix, Object":w});function w(M){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ne=Z.nodes!==void 0?Z.nodes:{};return He(M,function(ye){if(typeof ye!="string")throw new TypeError("String expected");return L(ye,ne)})}var x={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},b={",":!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},D={true:!0,false:!1,null:null,undefined:void 0},S=["NaN","Infinity"];function N(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:x.NULL,nestingLevel:0,conditionalLevel:null}}function B(M,Z){return M.expression.substr(M.index,Z)}function F(M){return B(M,1)}function $(M){M.index++}function q(M){return M.expression.charAt(M.index-1)}function _(M){return M.expression.charAt(M.index+1)}function C(M){for(M.tokenType=x.NULL,M.token="",M.comment="";;){if(F(M)==="#")for(;F(M)!==`
`&&F(M)!=="";)M.comment+=F(M),$(M);if(g.isWhitespace(F(M),M.nestingLevel))$(M);else break}if(F(M)===""){M.tokenType=x.DELIMITER;return}if(F(M)===`
`&&!M.nestingLevel){M.tokenType=x.DELIMITER,M.token=F(M),$(M);return}var Z=F(M),ne=B(M,2),ye=B(M,3);if(ye.length===3&&b[ye]){M.tokenType=x.DELIMITER,M.token=ye,$(M),$(M),$(M);return}if(ne.length===2&&b[ne]){M.tokenType=x.DELIMITER,M.token=ne,$(M),$(M);return}if(b[Z]){M.tokenType=x.DELIMITER,M.token=Z,$(M);return}if(g.isDigitDot(Z)){M.tokenType=x.NUMBER;var Me=B(M,2);if(Me==="0b"||Me==="0o"||Me==="0x"){for(M.token+=F(M),$(M),M.token+=F(M),$(M);g.isHexDigit(F(M));)M.token+=F(M),$(M);if(F(M)===".")for(M.token+=".",$(M);g.isHexDigit(F(M));)M.token+=F(M),$(M);else if(F(M)==="i")for(M.token+="i",$(M);g.isDigit(F(M));)M.token+=F(M),$(M);return}if(F(M)==="."){if(M.token+=F(M),$(M),!g.isDigit(F(M))){M.tokenType=x.DELIMITER;return}}else{for(;g.isDigit(F(M));)M.token+=F(M),$(M);g.isDecimalMark(F(M),_(M))&&(M.token+=F(M),$(M))}for(;g.isDigit(F(M));)M.token+=F(M),$(M);if(F(M)==="E"||F(M)==="e"){if(g.isDigit(_(M))||_(M)==="-"||_(M)==="+"){if(M.token+=F(M),$(M),(F(M)==="+"||F(M)==="-")&&(M.token+=F(M),$(M)),!g.isDigit(F(M)))throw ze(M,'Digit expected, got "'+F(M)+'"');for(;g.isDigit(F(M));)M.token+=F(M),$(M);if(g.isDecimalMark(F(M),_(M)))throw ze(M,'Digit expected, got "'+F(M)+'"')}else if(_(M)===".")throw $(M),ze(M,'Digit expected, got "'+F(M)+'"')}return}if(g.isAlpha(F(M),q(M),_(M))){for(;g.isAlpha(F(M),q(M),_(M))||g.isDigit(F(M));)M.token+=F(M),$(M);Ee(A,M.token)?M.tokenType=x.DELIMITER:M.tokenType=x.SYMBOL;return}for(M.tokenType=x.UNKNOWN;F(M)!=="";)M.token+=F(M),$(M);throw ze(M,'Syntax error in part "'+M.token+'"')}function T(M){do C(M);while(M.token===`
`)}function H(M){M.nestingLevel++}function O(M){M.nestingLevel--}g.isAlpha=function(Z,ne,ye){return g.isValidLatinOrGreek(Z)||g.isValidMathSymbol(Z,ye)||g.isValidMathSymbol(ne,Z)},g.isValidLatinOrGreek=function(Z){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(Z)},g.isValidMathSymbol=function(Z,ne){return/^[\uD835]$/.test(Z)&&/^[\uDC00-\uDFFF]$/.test(ne)&&/^[^\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(ne)},g.isWhitespace=function(Z,ne){return Z===" "||Z===" "||Z===`
`&&ne>0},g.isDecimalMark=function(Z,ne){return Z==="."&&ne!=="/"&&ne!=="*"&&ne!=="^"},g.isDigitDot=function(Z){return Z>="0"&&Z<="9"||Z==="."},g.isDigit=function(Z){return Z>="0"&&Z<="9"},g.isHexDigit=function(Z){return Z>="0"&&Z<="9"||Z>="a"&&Z<="f"||Z>="A"&&Z<="F"};function L(M,Z){var ne=N();wr(ne,{expression:M,extraNodes:Z}),C(ne);var ye=W(ne);if(ne.token!=="")throw ne.tokenType===x.DELIMITER?ir(ne,"Unexpected operator "+ne.token):ze(ne,'Unexpected part "'+ne.token+'"');return ye}function W(M){var Z,ne=[],ye;for(M.token!==""&&M.token!==`
`&&M.token!==";"&&(Z=X(M),M.comment&&(Z.comment=M.comment));M.token===`
`||M.token===";";)ne.length===0&&Z&&(ye=M.token!==";",ne.push({node:Z,visible:ye})),C(M),M.token!==`
`&&M.token!==";"&&M.token!==""&&(Z=X(M),M.comment&&(Z.comment=M.comment),ye=M.token!==";",ne.push({node:Z,visible:ye}));return ne.length>0?new f(ne):(Z||(Z=new l(void 0),M.comment&&(Z.comment=M.comment)),Z)}function X(M){var Z,ne,ye,Me,Te=P(M);if(M.token==="="){if(yr(Te))return Z=Te.name,T(M),ye=X(M),new u(new E(Z),ye);if(Gt(Te))return T(M),ye=X(M),new u(Te.object,Te.index,ye);if(Ot(Te)&&yr(Te.fn)&&(Me=!0,ne=[],Z=Te.name,Te.args.forEach(function(pr,Ar){yr(pr)?ne[Ar]=pr.name:Me=!1}),Me))return T(M),ye=X(M),new o(Z,ne,ye);throw ze(M,"Invalid left hand side of assignment operator =")}return Te}function P(M){for(var Z=J(M);M.token==="?";){var ne=M.conditionalLevel;M.conditionalLevel=M.nestingLevel,T(M);var ye=Z,Me=X(M);if(M.token!==":")throw ze(M,"False part of conditional expression expected");M.conditionalLevel=null,T(M);var Te=X(M);Z=new c(ye,Me,Te),M.conditionalLevel=ne}return Z}function J(M){for(var Z=ee(M);M.token==="or";)T(M),Z=new d("or","or",[Z,ee(M)]);return Z}function ee(M){for(var Z=K(M);M.token==="xor";)T(M),Z=new d("xor","xor",[Z,K(M)]);return Z}function K(M){for(var Z=oe(M);M.token==="and";)T(M),Z=new d("and","and",[Z,oe(M)]);return Z}function oe(M){for(var Z=se(M);M.token==="|";)T(M),Z=new d("|","bitOr",[Z,se(M)]);return Z}function se(M){for(var Z=ie(M);M.token==="^|";)T(M),Z=new d("^|","bitXor",[Z,ie(M)]);return Z}function ie(M){for(var Z=re(M);M.token==="&";)T(M),Z=new d("&","bitAnd",[Z,re(M)]);return Z}function re(M){for(var Z=[pe(M)],ne=[],ye={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Ee(ye,M.token);){var Me={name:M.token,fn:ye[M.token]};ne.push(Me),T(M),Z.push(pe(M))}return Z.length===1?Z[0]:Z.length===2?new d(ne[0].name,ne[0].fn,Z):new y(ne.map(Te=>Te.fn),Z)}function pe(M){var Z,ne,ye,Me;Z=Ae(M);for(var Te={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Ee(Te,M.token);)ne=M.token,ye=Te[ne],T(M),Me=[Z,Ae(M)],Z=new d(ne,ye,Me);return Z}function Ae(M){var Z,ne,ye,Me;Z=be(M);for(var Te={to:"to",in:"to"};Ee(Te,M.token);)ne=M.token,ye=Te[ne],T(M),ne==="in"&&M.token===""?Z=new d("*","multiply",[Z,new E("in")],!0):(Me=[Z,be(M)],Z=new d(ne,ye,Me));return Z}function be(M){var Z,ne=[];if(M.token===":"?Z=new l(1):Z=Ne(M),M.token===":"&&M.conditionalLevel!==M.nestingLevel){for(ne.push(Z);M.token===":"&&ne.length<3;)T(M),M.token===")"||M.token==="]"||M.token===","||M.token===""?ne.push(new E("end")):ne.push(Ne(M));ne.length===3?Z=new h(ne[0],ne[2],ne[1]):Z=new h(ne[0],ne[1])}return Z}function Ne(M){var Z,ne,ye,Me;Z=U(M);for(var Te={"+":"add","-":"subtract"};Ee(Te,M.token);){ne=M.token,ye=Te[ne],T(M);var pr=U(M);pr.isPercentage?Me=[Z,new d("*","multiply",[Z,pr])]:Me=[Z,pr],Z=new d(ne,ye,Me)}return Z}function U(M){var Z,ne,ye,Me;Z=G(M),ne=Z;for(var Te={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};Ee(Te,M.token);)ye=M.token,Me=Te[ye],T(M),ne=G(M),Z=new d(ye,Me,[Z,ne]);return Z}function G(M){var Z,ne;for(Z=te(M),ne=Z;M.tokenType===x.SYMBOL||M.token==="in"&&We(Z)||M.tokenType===x.NUMBER&&!We(ne)&&(!mr(ne)||ne.op==="!")||M.token==="(";)ne=te(M),Z=new d("*","multiply",[Z,ne],!0);return Z}function te(M){for(var Z=k(M),ne=Z,ye=[];M.token==="/"&&Si(ne);)if(ye.push(wr({},M)),T(M),M.tokenType===x.NUMBER)if(ye.push(wr({},M)),T(M),M.tokenType===x.SYMBOL||M.token==="(")wr(M,ye.pop()),ye.pop(),ne=k(M),Z=new d("/","divide",[Z,ne]);else{ye.pop(),wr(M,ye.pop());break}else{wr(M,ye.pop());break}return Z}function k(M){var Z,ne,ye,Me;Z=Y(M);for(var Te={"%":"mod",mod:"mod"};Ee(Te,M.token);)ne=M.token,ye=Te[ne],T(M),ne==="%"&&M.tokenType===x.DELIMITER&&M.token!=="("?Z=new d("/","divide",[Z,new l(100)],!1,!0):(Me=[Z,Y(M)],Z=new d(ne,ye,Me));return Z}function Y(M){var Z,ne,ye,Me={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Ee(Me,M.token)?(ye=Me[M.token],Z=M.token,T(M),ne=[Y(M)],new d(Z,ye,ne)):j(M)}function j(M){var Z,ne,ye,Me;return Z=fe(M),(M.token==="^"||M.token===".^")&&(ne=M.token,ye=ne==="^"?"pow":"dotPow",T(M),Me=[Z,Y(M)],Z=new d(ne,ye,Me)),Z}function fe(M){var Z,ne,ye,Me;Z=ue(M);for(var Te={"!":"factorial","'":"ctranspose"};Ee(Te,M.t
U: `+this.U.toString()+`
P: `+this.p}}}function p(h){var y=h._size[0],E=h._size[1],g=Math.min(y,E),w=h._values,x=h._index,b=h._ptr,A=[],D=[],S=[],N=[y,g],B=[],F=[],$=[],q=[g,E],_,C,T,H=[],O=[];for(_=0;_<y;_++)H[_]=_,O[_]=_;var L=function(P,J){var ee=O[P],K=O[J];H[ee]=J,H[K]=P,O[P]=K,O[J]=ee},W=function(){var P=new v;C<y&&(S.push(A.length),A.push(1),D.push(C)),$.push(B.length);var J=b[C],ee=b[C+1];for(T=J;T<ee;T++)_=x[T],P.set(H[_],w[T]);C>0&&P.forEach(0,C-1,function(ie,re){m._forEachRow(ie,A,D,S,function(pe,Ae){pe>ie&&P.accumulate(pe,o(u(Ae,re)))})});var K=C,oe=P.get(C),se=a(oe);P.forEach(C+1,y-1,function(ie,re){var pe=a(re);c(pe,se)&&(K=ie,se=pe,oe=re)}),C!==K&&(m._swapRows(C,K,N[1],A,D,S),m._swapRows(C,K,q[1],B,F,$),P.swap(C,K),L(C,K)),P.forEach(0,y-1,function(ie,re){ie<=C?(B.push(re),F.push(ie)):(re=n(re,oe),l(re,0)||(A.push(re),D.push(ie)))})};for(C=0;C<E;C++)W();return $.push(B.length),S.push(A.length),{L:new m({values:A,index:D,ptr:S,size:N}),U:new m({values:B,index:F,ptr:$,size:q}),p:H,toString:function(){return"L: "+this.L.toString()+`
U: `+this.U.toString()+`
P: `+this.p}}}}),Jl="qr",DD=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtract","complex"],AD=I(Jl,DD,e=>{var{typed:r,matrix:i,zeros:a,identity:t,isZero:n,equal:u,sign:f,sqrt:c,conj:l,unaryMinus:o,addScalar:s,divideScalar:m,multiplyScalar:v,subtract:d,complex:p}=e;return wr(r(Jl,{DenseMatrix:function(w){return y(w)},SparseMatrix:function(w){return E()},Array:function(w){var x=i(w),b=y(x);return{Q:b.Q.valueOf(),R:b.R.valueOf()}}}),{_denseQRimpl:h});function h(g){var w=g._size[0],x=g._size[1],b=t([w],"dense"),A=b._data,D=g.clone(),S=D._data,N,B,F,$=a([w],"");for(F=0;F<Math.min(x,w);++F){var q=S[F][F],_=o(u(q,0)?1:f(q)),C=l(_),T=0;for(N=F;N<w;N++)T=s(T,v(S[N][F],l(S[N][F])));var H=v(_,c(T));if(!n(H)){var O=d(q,H);for($[F]=1,N=F+1;N<w;N++)$[N]=m(S[N][F],O);var L=o(l(m(O,H))),W=void 0;for(B=F;B<x;B++){for(W=0,N=F;N<w;N++)W=s(W,v(l($[N]),S[N][B]));for(W=v(W,L),N=F;N<w;N++)S[N][B]=v(d(S[N][B],v($[N],W)),C)}for(N=0;N<w;N++){for(W=0,B=F;B<w;B++)W=s(W,v(A[N][B],$[B]));for(W=v(W,L),B=F;B<w;++B)A[N][B]=m(d(A[N][B],v(W,l($[B]))),C)}}}return{Q:b,R:D,toString:function(){return"Q: "+this.Q.toString()+`
R: `+this.R.toString()}}}function y(g){var w=h(g),x=w.R._data;if(g._data.length>0)for(var b=x[0][0].type==="Complex"?p(0):0,A=0;A<x.length;++A)for(var D=0;D<A&&D<(x[0]||[]).length;++D)x[A][D]=b;return w}function E(g){throw new Error("qr not implemented for sparse matrices yet")}});function ED(e,r,i,a){for(var t=e._values,n=e._index,u=e._ptr,f=e._size,c=e._datatype,l=f[0],o=f[1],s=a&&e._values?[]:null,m=[],v=[],d=0,p=0;p<o;p++){v[p]=d;for(var h=i?i[p]:p,y=u[h],E=u[h+1],g=y;g<E;g++){var w=r?r[n[g]]:n[g];m[d]=w,s&&(s[d]=t[g]),d++}}return v[o]=d,e.createSparseMatrix({values:s,index:m,ptr:v,size:[l,o],datatype:c})}function Wm(e,r,i,a,t,n,u){var f=0;for(i[u]=e;f>=0;){var c=i[u+f],l=i[a+c];l===-1?(f--,n[r++]=c):(i[a+c]=i[t+l],++f,i[u+f]=l)}return r}function SD(e,r){if(!e)return null;var i=0,a,t=[],n=[],u=0,f=r,c=2*r;for(a=0;a<r;a++)n[u+a]=-1;for(a=r-1;a>=0;a--)e[a]!==-1&&(n[f+a]=n[u+e[a]],n[u+e[a]]=a);for(a=0;a<r;a++)e[a]===-1&&(i=Wm(a,i,n,u,f,t,c));return t}function CD(e,r){if(!e)return null;var i=e._index,a=e._ptr,t=e._size,n=t[0],u=t[1],f=[],c=[],l=0,o=u,s,m;if(r)for(s=0;s<n;s++)c[o+s]=-1;for(var v=0;v<u;v++){f[v]=-1,c[l+v]=-1;for(var d=a[v],p=a[v+1],h=d;h<p;h++){var y=i[h];for(s=r?c[o+y]:y;s!==-1&&s<v;s=m)m=c[l+s],c[l+s]=v,m===-1&&(f[s]=v);r&&(c[o+y]=v)}}return f}function MD(e,r,i){for(var a=e._values,t=e._index,n=e._ptr,u=e._size,f=u[1],c=0,l=0;l<f;l++){var o=n[l];for(n[l]=c;o<n[l+1];o++)r(t[o],l,a?a[o]:1,i)&&(t[c]=t[o],a&&(a[c]=a[o]),c++)}return n[f]=c,t.splice(c,t.length-c),a&&a.splice(c,a.length-c),c}function Ft(e){return-e-2}var FD="csAmd",BD=["add","multiply","transpose"],TD=I(FD,BD,e=>{var{add:r,multiply:i,transpose:a}=e;return function(o,s){if(!s||o<=0||o>3)return null;var m=s._size,v=m[0],d=m[1],p=0,h=Math.max(16,10*Math.sqrt(d));h=Math.min(d-2,h);var y=t(o,s,v,d,h);MD(y,c,null);for(var E=y._index,g=y._ptr,w=g[d],x=[],b=[],A=0,D=d+1,S=2*(d+1),N=3*(d+1),B=4*(d+1),F=5*(d+1),$=6*(d+1),q=7*(d+1),_=x,C=n(d,g,b,A,N,_,S,q,D,$,B,F),T=u(d,g,b,F,B,$,h,D,N,_,S),H=0,O,L,W,X,P,J,ee,K,oe,se,ie,re,pe,Ae,be,Ne;T<d;){for(W=-1;H<d&&(W=b[N+H])===-1;H++);b[S+W]!==-1&&(_[b[S+W]]=-1),b[N+H]=b[S+W];var U=b[B+W],G=b[D+W];T+=G;var te=0;b[D+W]=-G;var k=g[W],Y=U===0?k:w,j=Y;for(X=1;X<=U+1;X++){for(X>U?(J=W,ee=k,K=b[A+W]-U):(J=E[k++],ee=g[J],K=b[A+J]),P=1;P<=K;P++)O=E[ee++],!((oe=b[D+O])<=0)&&(te+=oe,b[D+O]=-oe,E[j++]=O,b[S+O]!==-1&&(_[b[S+O]]=_[O]),_[O]!==-1?b[S+_[O]]=b[S+O]:b[N+b[F+O]]=b[S+O]);J!==W&&(g[J]=Ft(W),b[$+J]=0)}for(U!==0&&(w=j),b[F+W]=te,g[W]=Y,b[A+W]=j-Y,b[B+W]=-2,C=f(C,p,b,$,d),se=Y;se<j;se++)if(O=E[se],!((ie=b[B+O])<=0)){oe=-b[D+O];var fe=C-oe;for(k=g[O],re=g[O]+ie-1;k<=re;k++)J=E[k],b[$+J]>=C?b[$+J]-=oe:b[$+J]!==0&&(b[$+J]=b[F+J]+fe)}for(se=Y;se<j;se++){for(O=E[se],re=g[O],pe=re+b[B+O]-1,Ae=re,be=0,Ne=0,k=re;k<=pe;k++)if(J=E[k],b[$+J]!==0){var ue=b[$+J]-C;ue>0?(Ne+=ue,E[Ae++]=J,be+=J):(g[J]=Ft(W),b[$+J]=0)}b[B+O]=Ae-re+1;var R=Ae,z=re+b[A+O];for(k=pe+1;k<z;k++){L=E[k];var Q=b[D+L];Q<=0||(Ne+=Q,E[Ae++]=L,be+=L)}Ne===0?(g[O]=Ft(W),oe=-b[D+O],te-=oe,G+=oe,T+=oe,b[D+O]=0,b[B+O]=-1):(b[F+O]=Math.min(b[F+O],Ne),E[Ae]=E[R],E[R]=E[re],E[re]=W,b[A+O]=Ae-re+1,be=(be<0?-be:be)%d,b[S+O]=b[q+be],b[q+be]=O,_[O]=be)}for(b[F+W]=te,p=Math.max(p,te),C=f(C+p,p,b,$,d),se=Y;se<j;se++)if(O=E[se],!(b[D+O]>=0))for(be=_[O],O=b[q+be],b[q+be]=-1;O!==-1&&b[S+O]!==-1;O=b[S+O],C++){for(K=b[A+O],ie=b[B+O],k=g[O]+1;k<=g[O]+K-1;k++)b[$+E[k]]=C;var ae=O;for(L=b[S+O];L!==-1;){var le=b[A+L]===K&&b[B+L]===ie;for(k=g[L]+1;le&&k<=g[L]+K-1;k++)b[$+E[k]]!==C&&(le=0);le?(g[L]=Ft(O),b[D+O]+=b[D+L],b[D+L]=0,b[B+L]=-1,L=b[S+L],b[S+ae]=L):(ae=L,L=b[S+L])}}for(k=Y,se=Y;se<j;se++)O=E[se],!((oe=-b[D+O])<=0)&&(b[D+O]=oe,Ne=b[F+O]+te-oe,Ne=Math.min(Ne,d-T-oe),b[N+Ne]!==-1&&(_[b[N+Ne]]=O),b[S+O]=b[N+Ne],_[O]=-1,b[N+Ne]=O,H=Math.min(H,Ne),b[F+O]=Ne,E[k++]=O);b[D+W]=G,(b[A+W]=k-Y)===0&&(g[W]=-1,b[$+W]=0),U!==0&&(w=k)}for(O=0;O<d;O++)g[O]=Ft(g[O]);for(L=0;L<=d;L++)b[N+L]=-1;for(L=d;L>=0;L--)b[D+L]>0||(b[S+L]=b[N+g[L]],b[N+g[L]]=L);for(J=d;J>=0;J--)b[D+J]<=0||g[J]!==-1&&(b[S+J]=b[N+g[J]],b[N+g[J]]=J);for(W=0,O=0;O<=d;O++)g[O]===-1&&(W=Wm(O,W,b,N,S,x,$));return x.splice(x.length-1
U: `+this.U.toString()+`
p: `+this.p.toString()+(this.q?`
q: `+this.q.toString():"")+`
`}}}})});function jl(e,r){var i,a=r.length,t=[];if(e)for(i=0;i<a;i++)t[e[i]]=r[i];else for(i=0;i<a;i++)t[i]=r[i];return t}var ec="lusolve",XD=["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],JD=I(ec,XD,e=>{var{typed:r,matrix:i,lup:a,slu:t,usolve:n,lsolve:u,DenseMatrix:f}=e,c=jn({DenseMatrix:f});return r(ec,{"Array, Array | Matrix":function(m,v){m=i(m);var d=a(m),p=o(d.L,d.U,d.p,null,v);return p.valueOf()},"DenseMatrix, Array | Matrix":function(m,v){var d=a(m);return o(d.L,d.U,d.p,null,v)},"SparseMatrix, Array | Matrix":function(m,v){var d=a(m);return o(d.L,d.U,d.p,null,v)},"SparseMatrix, Array | Matrix, number, number":function(m,v,d,p){var h=t(m,d,p);return o(h.L,h.U,h.p,h.q,v)},"Object, Array | Matrix":function(m,v){return o(m.L,m.U,m.p,m.q,v)}});function l(s){if(Be(s))return s;if(je(s))return i(s);throw new TypeError("Invalid Matrix LU decomposition")}function o(s,m,v,d,p){s=l(s),m=l(m),v&&(p=c(s,p,!0),p._data=jl(v,p._data));var h=u(s,p),y=n(m,h);return d&&(y._data=jl(d,y._data)),y}}),rc="polynomialRoot",QD=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],KD=I(rc,QD,e=>{var{typed:r,isZero:i,equalScalar:a,add:t,subtract:n,multiply:u,divide:f,sqrt:c,unaryMinus:l,cbrt:o,typeOf:s,im:m,re:v}=e;return r(rc,{"number|Complex, ...number|Complex":(d,p)=>{for(var h=[d,...p];h.length>0&&i(h[h.length-1]);)h.pop();if(h.length<2)throw new RangeError("Polynomial [".concat(d,", ").concat(p,"] must have a non-zero non-constant coefficient"));switch(h.length){case 2:return[l(f(h[0],h[1]))];case 3:{var[y,E,g]=h,w=u(2,g),x=u(E,E),b=u(4,g,y);if(a(x,b))return[f(l(E),w)];var A=c(n(x,b));return[f(n(A,E),w),f(n(l(A),E),w)]}case 4:{var[D,S,N,B]=h,F=l(u(3,B)),$=u(N,N),q=u(3,B,S),_=t(u(2,N,N,N),u(27,B,B,D)),C=u(9,B,N,S);if(a($,q)&&a(_,C))return[f(N,F)];var T=n($,q),H=n(_,C),O=t(u(18,B,N,S,D),u(N,N,S,S)),L=t(u(4,N,N,N,D),u(4,B,S,S,S),u(27,B,B,D,D));if(a(O,L))return[f(n(u(4,B,N,S),t(u(9,B,B,D),u(N,N,N))),u(B,T)),f(n(u(9,B,D),u(N,S)),u(2,T))];var W;a($,q)?W=H:W=f(t(H,c(n(u(H,H),u(4,T,T,T)))),2);var X=!0,P=o(W,X).toArray().map(J=>f(t(N,J,f(T,J)),F));return P.map(J=>s(J)==="Complex"&&a(v(J),v(J)+m(J))?v(J):J)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(h))}}})}),jD="Help",eA=["parse"],rA=I(jD,eA,e=>{var{parse:r}=e;function i(a){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(!a)throw new Error('Argument "doc" missing');this.doc=a}return i.prototype.type="Help",i.prototype.isHelp=!0,i.prototype.toString=function(){var a=this.doc||{},t=`
`;if(a.name&&(t+="Name: "+a.name+`
`),a.category&&(t+="Category: "+a.category+`
`),a.description&&(t+=`Description:
`+a.description+`
`),a.syntax&&(t+=`Syntax:
`+a.syntax.join(`
`)+`
`),a.examples){t+=`Examples:
`;for(var n={},u=0;u<a.examples.length;u++){var f=a.examples[u];t+=" "+f+`
`;var c=void 0;try{c=r(f).compile().evaluate(n)}catch(l){c=l}c!==void 0&&!nf(c)&&(t+=" "+Pe(c,{precision:14})+`
`)}t+=`
`}return a.mayThrow&&a.mayThrow.length&&(t+="Throws: "+a.mayThrow.join(", ")+`
`),a.seealso&&a.seealso.length&&(t+="See also: "+a.seealso.join(", ")+`
`),t},i.prototype.toJSON=function(){var a=$e(this.doc);return a.mathjs="Help",a},i.fromJSON=function(a){var t={};return Object.keys(a).filter(n=>n!=="mathjs").forEach(n=>{t[n]=a[n]}),new i(t)},i.prototype.valueOf=i.prototype.toString,i},{isClass:!0}),tA="Chain",nA=["?on","math","typed"],aA=I(tA,nA,e=>{var{on:r,math:i,typed:a}=e;function t(l){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");af(l)?this.value=l.value:this.value=l}t.prototype.type="Chain",t.prototype.isChain=!0,t.prototype.done=function(){return this.value},t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(){return Pe(this.value)},t.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},t.fromJSON=function(l){return new t(l.value)};function n(l,o){typeof o=="function"&&(t.prototype[l]=f(o))}function u(l,o){ed(t.prototype,l,function(){var m=o();if(typeof m=="function")return f(m)})}function f(l){return function(){if(arguments.length===0)return new t(l(this.value));for(var o=[this.value],s=0;s<arguments.length;s++)o[s+1]=arguments[s];if(a.isTypedFunction(l)){var m=a.resolve(l,o);if(m.params.length===1)throw new Error("chain function "+l.name+" cannot match rest parameter between chain value and additional arguments.");return new t(m.implementation.apply(l,o))}return new t(l.apply(l,o))}}t.createProxy=function(l,o){if(typeof l=="string")n(l,o);else{var s=function(d){Ee(l,d)&&c[d]===void 0&&u(d,()=>l[d])};for(var m in l)s(m)}};var c={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return t.createProxy(i),r&&r("import",function(l,o,s){s||u(l,o)}),t},{isClass:!0}),tc={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"]},iA={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},oA={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:[]},uA={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:[]},sA={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},lA={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},cA={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:[]},fA={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:[]},mA={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},vA={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},pA={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:[]},nc={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"]},dA={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examp
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"]},IC={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"]},RC={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"]},qC={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"]},zC={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"]},PC={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"]},UC={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"]},LC={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"]},kC={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},HC={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"]},GC={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},VC={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"]},ZC={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},YC={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"]},WC={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"