@byteluck-fe/model-driven-engine 2.7.0-alpha.39 → 2.7.0-alpha.40

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.
@@ -196,9 +196,11 @@ export var CalcPlugin = /*#__PURE__*/ function() {
196
196
  * */ function allCalcControlComputed() {
197
197
  var _this = this;
198
198
  this.calcControls.forEach(function(item) {
199
- if (item.props.dataBind.result.fieldCode === null || item.props.dataBind.result.fieldCode === undefined) {
200
- _this.computedCalcValue(item);
201
- }
199
+ // this.engine.getState(item.id)
200
+ // if (item.props.dataBind.result.fieldCode === null || item.props.dataBind.result.fieldCode === undefined) {
201
+ // formEngineModel在custom:beforeEngineMounted时调用二开赋值,导致表单值 set 了却没有做计算。
202
+ _this.computedCalcValue(item);
203
+ // }
202
204
  });
203
205
  }
204
206
  },
package/dist/index.umd.js CHANGED
@@ -24,4 +24,4 @@ Example:
24
24
  *
25
25
  * Copyright (c) 2023, Robert Eisele (robert@raw.org)
26
26
  * Dual licensed under the MIT or GPL Version 2 licenses.
27
- **/(function(e,t){(function(n){var r=2e3,u={s:1,n:0,d:1};function i(p,v){if(isNaN(p=parseInt(p,10)))throw m();return p*v}function o(p,v){if(v===0)throw D();var y=Object.create(d.prototype);y.s=p<0?-1:1,p=p<0?-p:p;var C=h(p,v);return y.n=p/C,y.d=v/C,y}function s(p){for(var v={},y=p,C=2,w=4;w<=y;){for(;y%C===0;)y/=C,v[C]=(v[C]||0)+1;w+=1+2*C++}return y!==p?y>1&&(v[y]=(v[y]||0)+1):v[p]=(v[p]||0)+1,v}var f=function(p,v){var y=0,C=1,w=1,M=0,N=0,L=0,U=1,H=1,O=0,P=1,Z=1,W=1,X=1e7,q;if(p!=null)if(v!==void 0){if(y=p,C=v,w=y*C,y%1!==0||C%1!==0)throw A()}else switch(typeof p){case"object":{if("d"in p&&"n"in p)y=p.n,C=p.d,"s"in p&&(y*=p.s);else if(0 in p)y=p[0],1 in p&&(C=p[1]);else throw m();w=y*C;break}case"number":{if(p<0&&(w=p,p=-p),p%1===0)y=p;else if(p>0){for(p>=1&&(H=Math.pow(10,Math.floor(1+Math.log(p)/Math.LN10)),p/=H);P<=X&&W<=X;)if(q=(O+Z)/(P+W),p===q){P+W<=X?(y=O+Z,C=P+W):W>P?(y=Z,C=W):(y=O,C=P);break}else p>q?(O+=Z,P+=W):(Z+=O,W+=P),P>X?(y=Z,C=W):(y=O,C=P);y*=H}else(isNaN(p)||isNaN(v))&&(C=y=NaN);break}case"string":{if(P=p.match(/\d+|./g),P===null)throw m();if(P[O]==="-"?(w=-1,O++):P[O]==="+"&&O++,P.length===O+1?N=i(P[O++],w):P[O+1]==="."||P[O]==="."?(P[O]!=="."&&(M=i(P[O++],w)),O++,(O+1===P.length||P[O+1]==="("&&P[O+3]===")"||P[O+1]==="'"&&P[O+3]==="'")&&(N=i(P[O],w),U=Math.pow(10,P[O].length),O++),(P[O]==="("&&P[O+2]===")"||P[O]==="'"&&P[O+2]==="'")&&(L=i(P[O+1],w),H=Math.pow(10,P[O+1].length)-1,O+=3)):P[O+1]==="/"||P[O+1]===":"?(N=i(P[O],w),U=i(P[O+2],1),O+=3):P[O+3]==="/"&&P[O+1]===" "&&(M=i(P[O],w),N=i(P[O+2],w),U=i(P[O+4],1),O+=5),P.length<=O){C=U*H,w=y=L+C*M+H*N;break}}default:throw m()}if(C===0)throw D();u.s=w<0?-1:1,u.n=Math.abs(y),u.d=Math.abs(C)};function l(p,v,y){for(var C=1;v>0;p=p*p%y,v>>=1)v&1&&(C=C*p%y);return C}function c(p,v){for(;v%2===0;v/=2);for(;v%5===0;v/=5);if(v===1)return 0;for(var y=10%v,C=1;y!==1;C++)if(y=y*10%v,C>r)return 0;return C}function a(p,v,y){for(var C=1,w=l(10,y,v),M=0;M<300;M++){if(C===w)return M;C=C*10%v,w=w*10%v}return 0}function h(p,v){if(!p)return v;if(!v)return p;for(;;){if(p%=v,!p)return v;if(v%=p,!v)return p}}function d(p,v){if(f(p,v),this instanceof d)p=h(u.d,u.n),this.s=u.s,this.n=u.n/p,this.d=u.d/p;else return o(u.s*u.n,u.d)}var D=function(){return new Error("Division by Zero")},m=function(){return new Error("Invalid argument")},A=function(){return new Error("Parameters must be integer")};d.prototype={s:1,n:0,d:1,abs:function(){return o(this.n,this.d)},neg:function(){return o(-this.s*this.n,this.d)},add:function(p,v){return f(p,v),o(this.s*this.n*u.d+u.s*this.d*u.n,this.d*u.d)},sub:function(p,v){return f(p,v),o(this.s*this.n*u.d-u.s*this.d*u.n,this.d*u.d)},mul:function(p,v){return f(p,v),o(this.s*u.s*this.n*u.n,this.d*u.d)},div:function(p,v){return f(p,v),o(this.s*u.s*this.n*u.d,this.d*u.n)},clone:function(){return o(this.s*this.n,this.d)},mod:function(p,v){if(isNaN(this.n)||isNaN(this.d))return new d(NaN);if(p===void 0)return o(this.s*this.n%this.d,1);if(f(p,v),u.n===0&&this.d===0)throw D();return o(this.s*(u.d*this.n)%(u.n*this.d),u.d*this.d)},gcd:function(p,v){return f(p,v),o(h(u.n,this.n)*h(u.d,this.d),u.d*this.d)},lcm:function(p,v){return f(p,v),u.n===0&&this.n===0?o(0,1):o(u.n*this.n,h(u.n,this.n)*h(u.d,this.d))},ceil:function(p){return p=Math.pow(10,p||0),isNaN(this.n)||isNaN(this.d)?new d(NaN):o(Math.ceil(p*this.s*this.n/this.d),p)},floor:function(p){return p=Math.pow(10,p||0),isNaN(this.n)||isNaN(this.d)?new d(NaN):o(Math.floor(p*this.s*this.n/this.d),p)},round:function(p){return p=Math.pow(10,p||0),isNaN(this.n)||isNaN(this.d)?new d(NaN):o(Math.round(p*this.s*this.n/this.d),p)},inverse:function(){return o(this.s*this.d,this.n)},pow:function(p,v){if(f(p,v),u.d===1)return u.s<0?o(Math.pow(this.s*this.d,u.n),Math.pow(this.n,u.n)):o(Math.pow(this.s*this.n,u.n),Math.pow(this.d,u.n));if(this.s<0)return null;var y=s(this.n),C=s(this.d),w=1,M=1;for(var N in y)if(N!=="1"){if(N==="0"){w=0;break}if(y[N]*=u.n,y[N]%u.d===0)y[N]/=u.d;else return null;w*=Math.pow(N,y[N])}for(var N in C)if(N!=="1"){if(C[N]*=u.n,C[N]%u.d===0)C[N]/=u.d;else return null;M*=Math.pow(N,C[N])}return u.s<0?o(M,w):o(w,M)},equals:function(p,v){return f(p,v),this.s*this.n*u.d===u.s*u.n*this.d},compare:function(p,v){f(p,v);var y=this.s*this.n*u.d-u.s*u.n*this.d;return(0<y)-(y<0)},simplify:function(p){if(isNaN(this.n)||isNaN(this.d))return this;p=p||.001;for(var v=this.abs(),y=v.toContinued(),C=1;C<y.length;C++){for(var w=o(y[C-1],1),M=C-2;M>=0;M--)w=w.inverse().add(y[M]);if(Math.abs(w.sub(v).valueOf())<p)return w.mul(this.s)}return this},divisible:function(p,v){return f(p,v),!(!(u.n*this.d)||this.n*u.d%(u.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(p){var v,y="",C=this.n,w=this.d;return this.s<0&&(y+="-"),w===1?y+=C:(p&&(v=Math.floor(C/w))>0&&(y+=v,y+=" ",C%=w),y+=C,y+="/",y+=w),y},toLatex:function(p){var v,y="",C=this.n,w=this.d;return this.s<0&&(y+="-"),w===1?y+=C:(p&&(v=Math.floor(C/w))>0&&(y+=v,C%=w),y+="\\frac{",y+=C,y+="}{",y+=w,y+="}"),y},toContinued:function(){var p,v=this.n,y=this.d,C=[];if(isNaN(v)||isNaN(y))return C;do C.push(Math.floor(v/y)),p=v%y,v=y,y=p;while(v!==1);return C},toString:function(p){var v=this.n,y=this.d;if(isNaN(v)||isNaN(y))return"NaN";p=p||15;var C=c(v,y),w=a(v,y,C),M=this.s<0?"-":"";if(M+=v/y|0,v%=y,v*=10,v&&(M+="."),C){for(var N=w;N--;)M+=v/y|0,v%=y,v*=10;M+="(";for(var N=C;N--;)M+=v/y|0,v%=y,v*=10;M+=")"}else for(var N=p;v&&N--;)M+=v/y|0,v%=y,v*=10;return M}},Object.defineProperty(d,"__esModule",{value:!0}),d.default=d,d.Fraction=d,e.exports=d})()})(so);var Qe=hu(so.exports),dD="Fraction",pD=[],DD=Ae(dD,pD,()=>(Object.defineProperty(Qe,"name",{value:"Fraction"}),Qe.prototype.constructor=Qe,Qe.prototype.type="Fraction",Qe.prototype.isFraction=!0,Qe.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Qe.fromJSON=function(e){return new Qe(e)},Qe),{isClass:!0}),gD="Matrix",mD=[],vD=Ae(gD,mD,()=>{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(t,n){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,n,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,n,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,n){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(t,n){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){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(t){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 yD(e){return Object.keys(e.signatures||{}).reduce(function(t,n){var r=(n.match(/,/g)||[]).length+1;return Math.max(t,r)},-1)}var ED="DenseMatrix",AD=["Matrix"],CD=Ae(ED,AD,e=>{var{Matrix:t}=e;function n(c,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!En(a))throw new Error("Invalid datatype: "+a);if(Bt(c))c.type==="DenseMatrix"?(this._data=gt(c._data),this._size=gt(c._size),this._datatype=a||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=a||c._datatype);else if(c&&Ie(c.data)&&Ie(c.size))this._data=c.data,this._size=c.size,$i(this._data,this._size),this._datatype=a||c.datatype;else if(Ie(c))this._data=l(c),this._size=vt(this._data),$i(this._data,this._size),this._datatype=a;else{if(c)throw new TypeError("Unsupported type of data ("+Lr(c)+")");this._data=[],this._size=[0],this._datatype=a}}n.prototype=new t,n.prototype.createDenseMatrix=function(c,a){return new n(c,a)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Hr(this._data,Lr)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(c,a){return new n(c,a)},n.prototype.subset=function(c,a,h){switch(arguments.length){case 1:return r(this,c);case 2:case 3:return i(this,c,a,h);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(c){if(!Ie(c))throw new TypeError("Array expected");if(c.length!==this._size.length)throw new le(c.length,this._size.length);for(var a=0;a<c.length;a++)Re(c[a],this._size[a]);for(var h=this._data,d=0,D=c.length;d<D;d++){var m=c[d];Re(m,h.length),h=h[m]}return h},n.prototype.set=function(c,a,h){if(!Ie(c))throw new TypeError("Array expected");if(c.length<this._size.length)throw new le(c.length,this._size.length,"<");var d,D,m,A=c.map(function(v){return v+1});f(this,A,h);var p=this._data;for(d=0,D=c.length-1;d<D;d++)m=c[d],Re(m,p.length),p=p[m];return m=c[c.length-1],Re(m,p.length),p[m]=a,this};function r(c,a){if(!bi(a))throw new TypeError("Invalid index");var h=a.isScalar();if(h)return c.get(a.min());var d=a.size();if(d.length!==c._size.length)throw new le(d.length,c._size.length);for(var D=a.min(),m=a.max(),A=0,p=c._size.length;A<p;A++)Re(D[A],c._size[A]),Re(m[A],c._size[A]);return new n(u(c._data,a,d.length,0),c._datatype)}function u(c,a,h,d){var D=d===h-1,m=a.dimension(d);return D?m.map(function(A){return Re(A,c.length),c[A]}).valueOf():m.map(function(A){Re(A,c.length);var p=c[A];return u(p,a,h,d+1)}).valueOf()}function i(c,a,h,d){if(!a||a.isIndex!==!0)throw new TypeError("Invalid index");var D=a.size(),m=a.isScalar(),A;if(Bt(h)?(A=h.size(),h=h.valueOf()):A=vt(h),m){if(A.length!==0)throw new TypeError("Scalar expected");c.set(a.min(),h,d)}else{if(!Zt(A,D))try{A.length===0?h=Ui([h],D):h=Ui(h,D),A=vt(h)}catch(M){}if(D.length<c._size.length)throw new le(D.length,c._size.length,"<");if(A.length<D.length){for(var p=0,v=0;D[p]===1&&A[p]===1;)p++;for(;D[p]===1;)v++,p++;h=Jd(h,D.length,v,A)}if(!Zt(D,A))throw new le(D,A,">");var y=a.max().map(function(M){return M+1});f(c,y,d);var C=D.length,w=0;o(c._data,a,h,C,w)}return c}function o(c,a,h,d,D){var m=D===d-1,A=a.dimension(D);m?A.forEach(function(p,v){Re(p),c[p]=h[v[0]]}):A.forEach(function(p,v){Re(p),o(c[p],a,h[v[0]],d,D+1)})}n.prototype.resize=function(c,a,h){if(!jr(c))throw new TypeError("Array or Matrix expected");var d=c.valueOf().map(m=>Array.isArray(m)&&m.length===1?m[0]:m),D=h?this.clone():this;return s(D,d,a)};function s(c,a,h){if(a.length===0){for(var d=c._data;Ie(d);)d=d[0];return d}return c._size=a.slice(0),c._data=Pi(c._data,c._size,h),c}n.prototype.reshape=function(c,a){var h=a?this.clone():this;h._data=Ti(h._data,c);var d=h._size.reduce((D,m)=>D*m);return h._size=ji(c,d),h};function f(c,a,h){for(var d=c._size.slice(0),D=!1;d.length<a.length;)d.push(0),D=!0;for(var m=0,A=a.length;m<A;m++)a[m]>d[m]&&(d[m]=a[m],D=!0);D&&s(c,d,h)}n.prototype.clone=function(){var c=new n({data:gt(this._data),size:gt(this._size),datatype:this._datatype});return c},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(c){var a=this,h=yD(c),d=function A(p,v){return Ie(p)?p.map(function(y,C){return A(y,v.concat(C))}):h===1?c(p):h===2?c(p,v):c(p,v,a)},D=d(this._data,[]),m=this._datatype!==void 0?Hr(D,Lr):void 0;return new n(D,m)},n.prototype.forEach=function(c){var a=this,h=function d(D,m){Ie(D)?D.forEach(function(A,p){d(A,m.concat(p))}):c(D,m,a)};h(this._data,[])},n.prototype[Symbol.iterator]=function*(){var c=function*a(h,d){if(Ie(h))for(var D=0;D<h.length;D++)yield*a(h[D],d.concat(D));else yield{value:h,index:d}};yield*c(this._data,[])},n.prototype.rows=function(){var c=[],a=this.size();if(a.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var h=this._data;for(var d of h)c.push(new n([d],this._datatype));return c},n.prototype.columns=function(){var c=this,a=[],h=this.size();if(h.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var d=this._data,D=function(p){var v=d.map(y=>[y[p]]);a.push(new n(v,c._datatype))},m=0;m<h[1];m++)D(m);return a},n.prototype.toArray=function(){return gt(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(c){return mt(this._data,c)},n.prototype.toString=function(){return mt(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(c){if(c){if(Ge(c)&&(c=c.toNumber()),!ge(c)||!He(c))throw new TypeError("The parameter k must be an integer number")}else c=0;for(var a=c>0?c:0,h=c<0?-c:0,d=this._size[0],D=this._size[1],m=Math.min(d-h,D-a),A=[],p=0;p<m;p++)A[p]=this._data[p+h][p+a];return new n({data:A,size:[m],datatype:this._datatype})},n.diagonal=function(c,a,h,d){if(!Ie(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(N){if(Ge(N)&&(N=N.toNumber()),!ge(N)||!He(N)||N<1)throw new Error("Size values must be positive integers");return N}),h){if(Ge(h)&&(h=h.toNumber()),!ge(h)||!He(h))throw new TypeError("The parameter k must be an integer number")}else h=0;var D=h>0?h:0,m=h<0?-h:0,A=c[0],p=c[1],v=Math.min(A-m,p-D),y;if(Ie(a)){if(a.length!==v)throw new Error("Invalid value array length");y=function(L){return a[L]}}else if(Bt(a)){var C=a.size();if(C.length!==1||C[0]!==v)throw new Error("Invalid matrix length");y=function(L){return a.get([L])}}else y=function(){return a};d||(d=Ge(y(0))?y(0).mul(0):0);var w=[];if(c.length>0){w=Pi(w,c,d);for(var M=0;M<v;M++)w[M+m][M+D]=y(M)}return new n({data:w,size:[A,p]})},n.fromJSON=function(c){return new n(c)},n.prototype.swapRows=function(c,a){if(!ge(c)||!He(c)||!ge(a)||!He(a))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Re(c,this._size[0]),Re(a,this._size[0]),n._swapRows(c,a,this._data),this},n._swapRows=function(c,a,h){var d=h[c];h[c]=h[a],h[a]=d};function l(c){return Bt(c)?l(c.valueOf()):Ie(c)?c.map(l):c}return n},{isClass:!0}),co="equalScalar";Ae(co,["typed","config"],e=>{var{typed:t,config:n}=e;return t(co,{"number, number":function(u,i){return qd(u,i,n.epsilon)}})});function Xt(e,t,n,r){if(!(this instanceof Xt))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(r!=null?"-"+r:"")+" expected)",this.stack=new Error().stack}Xt.prototype=new Error,Xt.prototype.constructor=Error,Xt.prototype.name="ArgumentsError",Xt.prototype.isArgumentsError=!0;var fo="format",FD=["typed"],wD=Ae(fo,FD,e=>{var{typed:t}=e;return t(fo,{any:mt,"any, Object | function | number":mt})}),lo="bin",bD=["typed","format"];Ae(lo,bD,e=>{var{typed:t,format:n}=e;return t(lo,{"number | BigNumber":function(u){return n(u,{notation:"bin"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"bin",wordSize:i})}})});var ho="oct",BD=["typed","format"];Ae(ho,BD,e=>{var{typed:t,format:n}=e;return t(ho,{"number | BigNumber":function(u){return n(u,{notation:"oct"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"oct",wordSize:i})}})});var po="hex",_D=["typed","format"];Ae(po,_D,e=>{var{typed:t,format:n}=e;return t(po,{"number | BigNumber":function(u){return n(u,{notation:"hex"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"hex",wordSize:i})}})});var Do="equal";Ae(Do,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(Do,{"any, any":function(u,i){return u===null?i===null:i===null?u===null:u===void 0?i===void 0:i===void 0?u===void 0:n(u,i)}})});var go="unequal";Ae(go,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(go,{"any, any":function(u,i){return u===null?i!==null:i===null?u!==null:u===void 0?i!==void 0:i===void 0?u!==void 0:!n(u,i)}})});var mo={exports:{}};(function(e){(function(t,n,r){function u(f){var l=this,c=s();l.next=function(){var a=2091639*l.s0+l.c*23283064365386963e-26;return l.s0=l.s1,l.s1=l.s2,l.s2=a-(l.c=a|0)},l.c=1,l.s0=c(" "),l.s1=c(" "),l.s2=c(" "),l.s0-=c(f),l.s0<0&&(l.s0+=1),l.s1-=c(f),l.s1<0&&(l.s1+=1),l.s2-=c(f),l.s2<0&&(l.s2+=1),c=null}function i(f,l){return l.c=f.c,l.s0=f.s0,l.s1=f.s1,l.s2=f.s2,l}function o(f,l){var c=new u(f),a=l&&l.state,h=c.next;return h.int32=function(){return c.next()*4294967296|0},h.double=function(){return h()+(h()*2097152|0)*11102230246251565e-32},h.quick=h,a&&(typeof a=="object"&&i(a,c),h.state=function(){return i(c,{})}),h}function s(){var f=4022871197,l=function(c){c=String(c);for(var a=0;a<c.length;a++){f+=c.charCodeAt(a);var h=.02519603282416938*f;f=h>>>0,h-=f,h*=f,f=h>>>0,h-=f,f+=h*4294967296}return(f>>>0)*23283064365386963e-26};return l}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(tt,e,!1)})(mo);var vo={exports:{}};(function(e){(function(t,n,r){function u(s){var f=this,l="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var a=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^a^a>>>8},s===(s|0)?f.x=s:l+=s;for(var c=0;c<l.length+64;c++)f.x^=l.charCodeAt(c)|0,f.next()}function i(s,f){return f.x=s.x,f.y=s.y,f.z=s.z,f.w=s.w,f}function o(s,f){var l=new u(s),c=f&&f.state,a=function(){return(l.next()>>>0)/4294967296};return a.double=function(){do var h=l.next()>>>11,d=(l.next()>>>0)/4294967296,D=(h+d)/(1<<21);while(D===0);return D},a.int32=l.next,a.quick=a,c&&(typeof c=="object"&&i(c,l),a.state=function(){return i(l,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(tt,e,!1)})(vo);var yo={exports:{}};(function(e){(function(t,n,r){function u(s){var f=this,l="";f.next=function(){var a=f.x^f.x>>>2;return f.x=f.y,f.y=f.z,f.z=f.w,f.w=f.v,(f.d=f.d+362437|0)+(f.v=f.v^f.v<<4^(a^a<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,s===(s|0)?f.x=s:l+=s;for(var c=0;c<l.length+64;c++)f.x^=l.charCodeAt(c)|0,c==l.length&&(f.d=f.x<<10^f.x>>>4),f.next()}function i(s,f){return f.x=s.x,f.y=s.y,f.z=s.z,f.w=s.w,f.v=s.v,f.d=s.d,f}function o(s,f){var l=new u(s),c=f&&f.state,a=function(){return(l.next()>>>0)/4294967296};return a.double=function(){do var h=l.next()>>>11,d=(l.next()>>>0)/4294967296,D=(h+d)/(1<<21);while(D===0);return D},a.int32=l.next,a.quick=a,c&&(typeof c=="object"&&i(c,l),a.state=function(){return i(l,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(tt,e,!1)})(yo);var Eo={exports:{}};(function(e){(function(t,n,r){function u(s){var f=this;f.next=function(){var c=f.x,a=f.i,h,d;return h=c[a],h^=h>>>7,d=h^h<<24,h=c[a+1&7],d^=h^h>>>10,h=c[a+3&7],d^=h^h>>>3,h=c[a+4&7],d^=h^h<<7,h=c[a+7&7],h=h^h<<13,d^=h^h<<9,c[a]=d,f.i=a+1&7,d};function l(c,a){var h,d=[];if(a===(a|0))d[0]=a;else for(a=""+a,h=0;h<a.length;++h)d[h&7]=d[h&7]<<15^a.charCodeAt(h)+d[h+1&7]<<13;for(;d.length<8;)d.push(0);for(h=0;h<8&&d[h]===0;++h);for(h==8?d[7]=-1:d[h],c.x=d,c.i=0,h=256;h>0;--h)c.next()}l(f,s)}function i(s,f){return f.x=s.x.slice(),f.i=s.i,f}function o(s,f){s==null&&(s=+new Date);var l=new u(s),c=f&&f.state,a=function(){return(l.next()>>>0)/4294967296};return a.double=function(){do var h=l.next()>>>11,d=(l.next()>>>0)/4294967296,D=(h+d)/(1<<21);while(D===0);return D},a.int32=l.next,a.quick=a,c&&(c.x&&i(c,l),a.state=function(){return i(l,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(tt,e,!1)})(Eo);var Ao={exports:{}};(function(e){(function(t,n,r){function u(s){var f=this;f.next=function(){var c=f.w,a=f.X,h=f.i,d,D;return f.w=c=c+1640531527|0,D=a[h+34&127],d=a[h=h+1&127],D^=D<<13,d^=d<<17,D^=D>>>15,d^=d>>>12,D=a[h]=D^d,f.i=h,D+(c^c>>>16)|0};function l(c,a){var h,d,D,m,A,p=[],v=128;for(a===(a|0)?(d=a,a=null):(a=a+"\0",d=0,v=Math.max(v,a.length)),D=0,m=-32;m<v;++m)a&&(d^=a.charCodeAt((m+32)%a.length)),m===0&&(A=d),d^=d<<10,d^=d>>>15,d^=d<<4,d^=d>>>13,m>=0&&(A=A+1640531527|0,h=p[m&127]^=d+A,D=h==0?D+1:0);for(D>=128&&(p[(a&&a.length||0)&127]=-1),D=127,m=4*128;m>0;--m)d=p[D+34&127],h=p[D=D+1&127],d^=d<<13,h^=h<<17,d^=d>>>15,h^=h>>>12,p[D]=d^h;c.w=A,c.X=p,c.i=D}l(f,s)}function i(s,f){return f.i=s.i,f.w=s.w,f.X=s.X.slice(),f}function o(s,f){s==null&&(s=+new Date);var l=new u(s),c=f&&f.state,a=function(){return(l.next()>>>0)/4294967296};return a.double=function(){do var h=l.next()>>>11,d=(l.next()>>>0)/4294967296,D=(h+d)/(1<<21);while(D===0);return D},a.int32=l.next,a.quick=a,c&&(c.X&&i(c,l),a.state=function(){return i(l,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(tt,e,!1)})(Ao);var Co={exports:{}};(function(e){(function(t,n,r){function u(s){var f=this,l="";f.next=function(){var a=f.b,h=f.c,d=f.d,D=f.a;return a=a<<25^a>>>7^h,h=h-d|0,d=d<<24^d>>>8^D,D=D-a|0,f.b=a=a<<20^a>>>12^h,f.c=h=h-d|0,f.d=d<<16^h>>>16^D,f.a=D-a|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,s===Math.floor(s)?(f.a=s/4294967296|0,f.b=s|0):l+=s;for(var c=0;c<l.length+20;c++)f.b^=l.charCodeAt(c)|0,f.next()}function i(s,f){return f.a=s.a,f.b=s.b,f.c=s.c,f.d=s.d,f}function o(s,f){var l=new u(s),c=f&&f.state,a=function(){return(l.next()>>>0)/4294967296};return a.double=function(){do var h=l.next()>>>11,d=(l.next()>>>0)/4294967296,D=(h+d)/(1<<21);while(D===0);return D},a.int32=l.next,a.quick=a,c&&(typeof c=="object"&&i(c,l),a.state=function(){return i(l,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(tt,e,!1)})(Co);var Fo={exports:{}};(function(e){(function(t,n,r){var u=256,i=6,o=52,s="random",f=r.pow(u,i),l=r.pow(2,o),c=l*2,a=u-1,h;function d(C,w,M){var N=[];w=w==!0?{entropy:!0}:w||{};var L=p(A(w.entropy?[C,y(n)]:C==null?v():C,3),N),U=new D(N),H=function(){for(var O=U.g(i),P=f,Z=0;O<l;)O=(O+Z)*u,P*=u,Z=U.g(1);for(;O>=c;)O/=2,P/=2,Z>>>=1;return(O+Z)/P};return H.int32=function(){return U.g(4)|0},H.quick=function(){return U.g(4)/4294967296},H.double=H,p(y(U.S),n),(w.pass||M||function(O,P,Z,W){return W&&(W.S&&m(W,U),O.state=function(){return m(U,{})}),Z?(r[s]=O,P):O})(H,L,"global"in w?w.global:this==r,w.state)}function D(C){var w,M=C.length,N=this,L=0,U=N.i=N.j=0,H=N.S=[];for(M||(C=[M++]);L<u;)H[L]=L++;for(L=0;L<u;L++)H[L]=H[U=a&U+C[L%M]+(w=H[L])],H[U]=w;(N.g=function(O){for(var P,Z=0,W=N.i,X=N.j,q=N.S;O--;)P=q[W=a&W+1],Z=Z*u+q[a&(q[W]=q[X=a&X+P])+(q[X]=P)];return N.i=W,N.j=X,Z})(u)}function m(C,w){return w.i=C.i,w.j=C.j,w.S=C.S.slice(),w}function A(C,w){var M=[],N=typeof C,L;if(w&&N=="object")for(L in C)try{M.push(A(C[L],w-1))}catch(U){}return M.length?M:N=="string"?C:C+"\0"}function p(C,w){for(var M=C+"",N,L=0;L<M.length;)w[a&L]=a&(N^=w[a&L]*19)+M.charCodeAt(L++);return y(w)}function v(){try{var C;return h&&(C=h.randomBytes)?C=C(u):(C=new Uint8Array(u),(t.crypto||t.msCrypto).getRandomValues(C)),y(C)}catch(N){var w=t.navigator,M=w&&w.plugins;return[+new Date,t,M,t.screen,y(n)]}}function y(C){return String.fromCharCode.apply(0,C)}if(p(r.random(),n),e.exports){e.exports=d;try{h=Pn.default}catch(C){}}else r["seed"+s]=d})(typeof self!="undefined"?self:tt,[],Math)})(Fo);var SD=mo.exports,MD=vo.exports,ND=yo.exports,ID=Eo.exports,xD=Ao.exports,OD=Co.exports,Ot=Fo.exports;Ot.alea=SD,Ot.xor128=MD,Ot.xorwow=ND,Ot.xorshift7=ID,Ot.xor4096=xD,Ot.tychei=OD,xn("fineStructure",.0072973525693),xn("weakMixingAngle",.2229),xn("efimovFactor",22.7),xn("sackurTetrode",-1.16487052358);function xn(e,t){var n=["config","BigNumber"];return Ae(e,n,r=>{var{config:u,BigNumber:i}=r;return u.number==="BigNumber"?new i(t):t})}var RD=cD({config:Bi}),$D=hD({}),PD=DD({}),TD=vD({}),jD=CD({Matrix:TD}),LD=hp({BigNumber:RD,Complex:$D,DenseMatrix:jD,Fraction:PD}),kD=wD({typed:LD});class qD{constructor(t){this.calcControls=[],this.dependenciesTriggerMap=new Map,this.hideNotRememberControlIds=[],this.dontHasPermissionControlIds=[],this.cacheComputedResult={},this.options=t,this.getDontHasPermissionControlIds(),this.getNeedHideRememberControlIds()}getNeedHideRememberControlIds(){var t;!((t=this.options)!=null&&t.displayBoList)||(this.hideNotRememberControlIds=this.options.displayBoList.reduce((n,r)=>(r.is_remember||n.push(...r.hide_controls),n),[]))}getDontHasPermissionControlIds(){var t;!((t=this.options)!=null&&t.behavior)||(this.dontHasPermissionControlIds=this.options.behavior.reduce((n,r)=>(r.ctrlBehavior===1&&n.push(r.ctrlId),n),[]))}controlNeedComputedValue(t){if(!t)return!1;const n=this.getControlIsHide(t);return!(this.dontHasPermissionControlIds.includes(t.id)&&n||this.hideNotRememberControlIds.includes(t.id)&&n)}getControlIsHide(t){return t.props.isHide?!0:t.parent===null||t.parent===void 0?!1:this.getControlIsHide(t.parent)}apply(t){this.engine=t,this.watchControlChange(),this.watchSubtableChange(),this.watchSchemaHideChange(),this.engine.on("engine-mounted",()=>{requestAnimationFrame(()=>{this.resetDependencies(),this.allCalcControlComputed()})})}resetDependencies(){this.calcControls=[],this.dependenciesTriggerMap.clear(),this.getAllCalcControl(),this.getCalcDependencies()}allCalcControlComputed(){this.calcControls.forEach(t=>{(t.props.dataBind.result.fieldCode===null||t.props.dataBind.result.fieldCode===void 0)&&this.computedCalcValue(t)})}getAllCalcControl(){this.calcControls=this.engine.runtime.flatInstances.filter(t=>t.type===de.CALC)}getCalcDependencies(){this.calcControls.forEach(t=>{const{scriptEcho:n}=t.props;n.forEach(r=>{(r.type===$e.VariableInMainTable||r.type===$e.VariableInCurrentSubTable||r.type===$e.VariableInOtherSubTable)&&this.setDependenciesTriggerMapItem(r.id,t),r.type===$e.VariableInOtherSubTable&&r.subTableId&&this.setDependenciesTriggerMapItem(r.subTableId,t)})})}setDependenciesTriggerMapItem(t,n){this.dependenciesTriggerMap.has(t)||this.dependenciesTriggerMap.set(t,[]);const r=this.dependenciesTriggerMap.get(t);r.includes(n)||r.push(n)}getCalcControlsFromSubtableRows(t){return t.reduce((n,r)=>(r.children.forEach(u=>{const i=u.children[0];i&&this.engine.assertInstance(i,de.CALC)&&n.push(i)}),n),[])}watchSchemaHideChange(){this.engine.on("schema-change",t=>{var n;t.props==="isHide"&&((n=this.dependenciesTriggerMap.get(t.instance.id))!=null?n:[]).forEach(u=>{this.computedCalcValue(u)})})}watchSubtableChange(){this.engine.on("list-change",t=>{var i,o,s;if(this.engine.isMounted===!1)return;this.resetDependencies();const n=(o=(i=t.options)==null?void 0:i.changed)!=null?o:[];this.getCalcControlsFromSubtableRows(n).forEach(f=>{this.computedCalcValue(f)}),((s=this.dependenciesTriggerMap.get(t.instance.id))!=null?s:[]).forEach(f=>{this.computedCalcValue(f)})})}watchControlChange(){this.engine.on("change",t=>{var u;if(this.engine.isMounted===!1)return;const{instance:n}=t;if(!this.dependenciesTriggerMap.has(n.id))return;const r=(u=this.dependenciesTriggerMap.get(n.id))!=null?u:[];t.rowIndex!==void 0&&t.rowIndex>-1?r.forEach(i=>{this.controlInSubtable(i)&&this.engine.getInstanceRowIndex(i)!==t.rowIndex||this.computedCalcValue(i)}):r.forEach(i=>{this.computedCalcValue(i)})})}controlInSubtable(t){var n;return((n=t.parent)==null?void 0:n.type)===de.SUBTABLE_COLUMN}computedCalcValue(t){var f;const n=t.props.scriptEcho;if(!n||n.length===0)return;let r;this.controlInSubtable(t)&&(r=this.engine.getInstanceRowIndex(t));const u=n.reduce((l,c)=>{if(c.type===$e.Operator||c.type===$e.Number)return l+c.name;let a=0,h;switch(c.type){case $e.VariableInMainTable:{const d=this.getNumberValue(this.engine.getState(c.id));h=this.engine.getInstance(c.id),a=Number(d);break}case $e.VariableInCurrentSubTable:{h=this.engine.getInstance(c.id,r);const d=this.engine.getState(c.id,r),D=this.getNumberValue(d);a=Number(D);break}case $e.VariableInOtherSubTable:{const d=this.engine.getState(c.id),D=Array.isArray(d)?d.map(A=>this.getNumberValue(A)):[],m=this.getAggregateTypeValue(D,c.aggregateType);h=this.engine.getInstance(c.subTableId),a=Number(m);break}}return!Number.isNaN(a)&&this.controlNeedComputedValue(h)?l+=`(${a})`:l+=0,l},"");let i;if(this.cacheComputedResult[u]!==void 0?i=this.cacheComputedResult[u]:(i=Number(kD(new Function(`return ${u}`)(),{precision:16})),this.cacheComputedResult[u]=i),this.controlInSubtable(t)&&r===void 0)return;const o=this.engine.getState(t.id,r),s=!i||i===1/0||i===-1/0?0:t.props.precision===""?i:Number(i.toFixed(t.props.precision));s!==(o==null?void 0:o.result)&&this.engine.setState(t.id,{result:s,unit:(f=o==null?void 0:o.unit)!=null?f:""},r)}getNumberValue(t){if(typeof t=="object"&&t){if("result"in t)return t.result;if("amount"in t)return t.amount}return typeof t=="number"?t:0}getAggregateTypeValue(t,n){if(!n||!t||!t.length)return 0;switch(n){case yt.MAX:return Math.max(...t);case yt.MIN:return Math.min(...t);case yt.SUM:return t.reduce((r,u)=>r+u);case yt.AVG:return t.reduce((r,u)=>r+u)/t.length}}}class VD{constructor(t){this.config=t}apply(t){var i,o;this.engine=t;const n=(o=(i=this.config)==null?void 0:i.source)!=null?o:"";let r=document.createElement("style");r.className="edit-css",r.type="text/css",r.innerHTML=n,document.querySelector("head").appendChild(r)}}z.CalcPlugin=qD,z.ControlsEventPlugin=nd,z.ES6ModulePlugin=Yh,z.Engine=Tr,z.LifecycleEventPlugin=td,z.Plugin=Qh,z.StylePlugin=VD,z.buildUUID=Nr,z.hasChildrenControl=mn,z.loopDataViewControl=bt,z.loopFormControl=wt,z.parseModule=Ei,Object.defineProperty(z,"__esModule",{value:!0})});
27
+ **/(function(e,t){(function(n){var r=2e3,u={s:1,n:0,d:1};function i(p,v){if(isNaN(p=parseInt(p,10)))throw m();return p*v}function o(p,v){if(v===0)throw D();var y=Object.create(d.prototype);y.s=p<0?-1:1,p=p<0?-p:p;var C=h(p,v);return y.n=p/C,y.d=v/C,y}function s(p){for(var v={},y=p,C=2,w=4;w<=y;){for(;y%C===0;)y/=C,v[C]=(v[C]||0)+1;w+=1+2*C++}return y!==p?y>1&&(v[y]=(v[y]||0)+1):v[p]=(v[p]||0)+1,v}var f=function(p,v){var y=0,C=1,w=1,M=0,N=0,L=0,U=1,H=1,O=0,P=1,Z=1,W=1,X=1e7,q;if(p!=null)if(v!==void 0){if(y=p,C=v,w=y*C,y%1!==0||C%1!==0)throw A()}else switch(typeof p){case"object":{if("d"in p&&"n"in p)y=p.n,C=p.d,"s"in p&&(y*=p.s);else if(0 in p)y=p[0],1 in p&&(C=p[1]);else throw m();w=y*C;break}case"number":{if(p<0&&(w=p,p=-p),p%1===0)y=p;else if(p>0){for(p>=1&&(H=Math.pow(10,Math.floor(1+Math.log(p)/Math.LN10)),p/=H);P<=X&&W<=X;)if(q=(O+Z)/(P+W),p===q){P+W<=X?(y=O+Z,C=P+W):W>P?(y=Z,C=W):(y=O,C=P);break}else p>q?(O+=Z,P+=W):(Z+=O,W+=P),P>X?(y=Z,C=W):(y=O,C=P);y*=H}else(isNaN(p)||isNaN(v))&&(C=y=NaN);break}case"string":{if(P=p.match(/\d+|./g),P===null)throw m();if(P[O]==="-"?(w=-1,O++):P[O]==="+"&&O++,P.length===O+1?N=i(P[O++],w):P[O+1]==="."||P[O]==="."?(P[O]!=="."&&(M=i(P[O++],w)),O++,(O+1===P.length||P[O+1]==="("&&P[O+3]===")"||P[O+1]==="'"&&P[O+3]==="'")&&(N=i(P[O],w),U=Math.pow(10,P[O].length),O++),(P[O]==="("&&P[O+2]===")"||P[O]==="'"&&P[O+2]==="'")&&(L=i(P[O+1],w),H=Math.pow(10,P[O+1].length)-1,O+=3)):P[O+1]==="/"||P[O+1]===":"?(N=i(P[O],w),U=i(P[O+2],1),O+=3):P[O+3]==="/"&&P[O+1]===" "&&(M=i(P[O],w),N=i(P[O+2],w),U=i(P[O+4],1),O+=5),P.length<=O){C=U*H,w=y=L+C*M+H*N;break}}default:throw m()}if(C===0)throw D();u.s=w<0?-1:1,u.n=Math.abs(y),u.d=Math.abs(C)};function l(p,v,y){for(var C=1;v>0;p=p*p%y,v>>=1)v&1&&(C=C*p%y);return C}function c(p,v){for(;v%2===0;v/=2);for(;v%5===0;v/=5);if(v===1)return 0;for(var y=10%v,C=1;y!==1;C++)if(y=y*10%v,C>r)return 0;return C}function a(p,v,y){for(var C=1,w=l(10,y,v),M=0;M<300;M++){if(C===w)return M;C=C*10%v,w=w*10%v}return 0}function h(p,v){if(!p)return v;if(!v)return p;for(;;){if(p%=v,!p)return v;if(v%=p,!v)return p}}function d(p,v){if(f(p,v),this instanceof d)p=h(u.d,u.n),this.s=u.s,this.n=u.n/p,this.d=u.d/p;else return o(u.s*u.n,u.d)}var D=function(){return new Error("Division by Zero")},m=function(){return new Error("Invalid argument")},A=function(){return new Error("Parameters must be integer")};d.prototype={s:1,n:0,d:1,abs:function(){return o(this.n,this.d)},neg:function(){return o(-this.s*this.n,this.d)},add:function(p,v){return f(p,v),o(this.s*this.n*u.d+u.s*this.d*u.n,this.d*u.d)},sub:function(p,v){return f(p,v),o(this.s*this.n*u.d-u.s*this.d*u.n,this.d*u.d)},mul:function(p,v){return f(p,v),o(this.s*u.s*this.n*u.n,this.d*u.d)},div:function(p,v){return f(p,v),o(this.s*u.s*this.n*u.d,this.d*u.n)},clone:function(){return o(this.s*this.n,this.d)},mod:function(p,v){if(isNaN(this.n)||isNaN(this.d))return new d(NaN);if(p===void 0)return o(this.s*this.n%this.d,1);if(f(p,v),u.n===0&&this.d===0)throw D();return o(this.s*(u.d*this.n)%(u.n*this.d),u.d*this.d)},gcd:function(p,v){return f(p,v),o(h(u.n,this.n)*h(u.d,this.d),u.d*this.d)},lcm:function(p,v){return f(p,v),u.n===0&&this.n===0?o(0,1):o(u.n*this.n,h(u.n,this.n)*h(u.d,this.d))},ceil:function(p){return p=Math.pow(10,p||0),isNaN(this.n)||isNaN(this.d)?new d(NaN):o(Math.ceil(p*this.s*this.n/this.d),p)},floor:function(p){return p=Math.pow(10,p||0),isNaN(this.n)||isNaN(this.d)?new d(NaN):o(Math.floor(p*this.s*this.n/this.d),p)},round:function(p){return p=Math.pow(10,p||0),isNaN(this.n)||isNaN(this.d)?new d(NaN):o(Math.round(p*this.s*this.n/this.d),p)},inverse:function(){return o(this.s*this.d,this.n)},pow:function(p,v){if(f(p,v),u.d===1)return u.s<0?o(Math.pow(this.s*this.d,u.n),Math.pow(this.n,u.n)):o(Math.pow(this.s*this.n,u.n),Math.pow(this.d,u.n));if(this.s<0)return null;var y=s(this.n),C=s(this.d),w=1,M=1;for(var N in y)if(N!=="1"){if(N==="0"){w=0;break}if(y[N]*=u.n,y[N]%u.d===0)y[N]/=u.d;else return null;w*=Math.pow(N,y[N])}for(var N in C)if(N!=="1"){if(C[N]*=u.n,C[N]%u.d===0)C[N]/=u.d;else return null;M*=Math.pow(N,C[N])}return u.s<0?o(M,w):o(w,M)},equals:function(p,v){return f(p,v),this.s*this.n*u.d===u.s*u.n*this.d},compare:function(p,v){f(p,v);var y=this.s*this.n*u.d-u.s*u.n*this.d;return(0<y)-(y<0)},simplify:function(p){if(isNaN(this.n)||isNaN(this.d))return this;p=p||.001;for(var v=this.abs(),y=v.toContinued(),C=1;C<y.length;C++){for(var w=o(y[C-1],1),M=C-2;M>=0;M--)w=w.inverse().add(y[M]);if(Math.abs(w.sub(v).valueOf())<p)return w.mul(this.s)}return this},divisible:function(p,v){return f(p,v),!(!(u.n*this.d)||this.n*u.d%(u.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(p){var v,y="",C=this.n,w=this.d;return this.s<0&&(y+="-"),w===1?y+=C:(p&&(v=Math.floor(C/w))>0&&(y+=v,y+=" ",C%=w),y+=C,y+="/",y+=w),y},toLatex:function(p){var v,y="",C=this.n,w=this.d;return this.s<0&&(y+="-"),w===1?y+=C:(p&&(v=Math.floor(C/w))>0&&(y+=v,C%=w),y+="\\frac{",y+=C,y+="}{",y+=w,y+="}"),y},toContinued:function(){var p,v=this.n,y=this.d,C=[];if(isNaN(v)||isNaN(y))return C;do C.push(Math.floor(v/y)),p=v%y,v=y,y=p;while(v!==1);return C},toString:function(p){var v=this.n,y=this.d;if(isNaN(v)||isNaN(y))return"NaN";p=p||15;var C=c(v,y),w=a(v,y,C),M=this.s<0?"-":"";if(M+=v/y|0,v%=y,v*=10,v&&(M+="."),C){for(var N=w;N--;)M+=v/y|0,v%=y,v*=10;M+="(";for(var N=C;N--;)M+=v/y|0,v%=y,v*=10;M+=")"}else for(var N=p;v&&N--;)M+=v/y|0,v%=y,v*=10;return M}},Object.defineProperty(d,"__esModule",{value:!0}),d.default=d,d.Fraction=d,e.exports=d})()})(so);var Qe=hu(so.exports),dD="Fraction",pD=[],DD=Ae(dD,pD,()=>(Object.defineProperty(Qe,"name",{value:"Fraction"}),Qe.prototype.constructor=Qe,Qe.prototype.type="Fraction",Qe.prototype.isFraction=!0,Qe.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Qe.fromJSON=function(e){return new Qe(e)},Qe),{isClass:!0}),gD="Matrix",mD=[],vD=Ae(gD,mD,()=>{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(t,n){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,n,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,n,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,n){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(t,n){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){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(t){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 yD(e){return Object.keys(e.signatures||{}).reduce(function(t,n){var r=(n.match(/,/g)||[]).length+1;return Math.max(t,r)},-1)}var ED="DenseMatrix",AD=["Matrix"],CD=Ae(ED,AD,e=>{var{Matrix:t}=e;function n(c,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!En(a))throw new Error("Invalid datatype: "+a);if(Bt(c))c.type==="DenseMatrix"?(this._data=gt(c._data),this._size=gt(c._size),this._datatype=a||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=a||c._datatype);else if(c&&Ie(c.data)&&Ie(c.size))this._data=c.data,this._size=c.size,$i(this._data,this._size),this._datatype=a||c.datatype;else if(Ie(c))this._data=l(c),this._size=vt(this._data),$i(this._data,this._size),this._datatype=a;else{if(c)throw new TypeError("Unsupported type of data ("+Lr(c)+")");this._data=[],this._size=[0],this._datatype=a}}n.prototype=new t,n.prototype.createDenseMatrix=function(c,a){return new n(c,a)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Hr(this._data,Lr)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(c,a){return new n(c,a)},n.prototype.subset=function(c,a,h){switch(arguments.length){case 1:return r(this,c);case 2:case 3:return i(this,c,a,h);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(c){if(!Ie(c))throw new TypeError("Array expected");if(c.length!==this._size.length)throw new le(c.length,this._size.length);for(var a=0;a<c.length;a++)Re(c[a],this._size[a]);for(var h=this._data,d=0,D=c.length;d<D;d++){var m=c[d];Re(m,h.length),h=h[m]}return h},n.prototype.set=function(c,a,h){if(!Ie(c))throw new TypeError("Array expected");if(c.length<this._size.length)throw new le(c.length,this._size.length,"<");var d,D,m,A=c.map(function(v){return v+1});f(this,A,h);var p=this._data;for(d=0,D=c.length-1;d<D;d++)m=c[d],Re(m,p.length),p=p[m];return m=c[c.length-1],Re(m,p.length),p[m]=a,this};function r(c,a){if(!bi(a))throw new TypeError("Invalid index");var h=a.isScalar();if(h)return c.get(a.min());var d=a.size();if(d.length!==c._size.length)throw new le(d.length,c._size.length);for(var D=a.min(),m=a.max(),A=0,p=c._size.length;A<p;A++)Re(D[A],c._size[A]),Re(m[A],c._size[A]);return new n(u(c._data,a,d.length,0),c._datatype)}function u(c,a,h,d){var D=d===h-1,m=a.dimension(d);return D?m.map(function(A){return Re(A,c.length),c[A]}).valueOf():m.map(function(A){Re(A,c.length);var p=c[A];return u(p,a,h,d+1)}).valueOf()}function i(c,a,h,d){if(!a||a.isIndex!==!0)throw new TypeError("Invalid index");var D=a.size(),m=a.isScalar(),A;if(Bt(h)?(A=h.size(),h=h.valueOf()):A=vt(h),m){if(A.length!==0)throw new TypeError("Scalar expected");c.set(a.min(),h,d)}else{if(!Zt(A,D))try{A.length===0?h=Ui([h],D):h=Ui(h,D),A=vt(h)}catch(M){}if(D.length<c._size.length)throw new le(D.length,c._size.length,"<");if(A.length<D.length){for(var p=0,v=0;D[p]===1&&A[p]===1;)p++;for(;D[p]===1;)v++,p++;h=Jd(h,D.length,v,A)}if(!Zt(D,A))throw new le(D,A,">");var y=a.max().map(function(M){return M+1});f(c,y,d);var C=D.length,w=0;o(c._data,a,h,C,w)}return c}function o(c,a,h,d,D){var m=D===d-1,A=a.dimension(D);m?A.forEach(function(p,v){Re(p),c[p]=h[v[0]]}):A.forEach(function(p,v){Re(p),o(c[p],a,h[v[0]],d,D+1)})}n.prototype.resize=function(c,a,h){if(!jr(c))throw new TypeError("Array or Matrix expected");var d=c.valueOf().map(m=>Array.isArray(m)&&m.length===1?m[0]:m),D=h?this.clone():this;return s(D,d,a)};function s(c,a,h){if(a.length===0){for(var d=c._data;Ie(d);)d=d[0];return d}return c._size=a.slice(0),c._data=Pi(c._data,c._size,h),c}n.prototype.reshape=function(c,a){var h=a?this.clone():this;h._data=Ti(h._data,c);var d=h._size.reduce((D,m)=>D*m);return h._size=ji(c,d),h};function f(c,a,h){for(var d=c._size.slice(0),D=!1;d.length<a.length;)d.push(0),D=!0;for(var m=0,A=a.length;m<A;m++)a[m]>d[m]&&(d[m]=a[m],D=!0);D&&s(c,d,h)}n.prototype.clone=function(){var c=new n({data:gt(this._data),size:gt(this._size),datatype:this._datatype});return c},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(c){var a=this,h=yD(c),d=function A(p,v){return Ie(p)?p.map(function(y,C){return A(y,v.concat(C))}):h===1?c(p):h===2?c(p,v):c(p,v,a)},D=d(this._data,[]),m=this._datatype!==void 0?Hr(D,Lr):void 0;return new n(D,m)},n.prototype.forEach=function(c){var a=this,h=function d(D,m){Ie(D)?D.forEach(function(A,p){d(A,m.concat(p))}):c(D,m,a)};h(this._data,[])},n.prototype[Symbol.iterator]=function*(){var c=function*a(h,d){if(Ie(h))for(var D=0;D<h.length;D++)yield*a(h[D],d.concat(D));else yield{value:h,index:d}};yield*c(this._data,[])},n.prototype.rows=function(){var c=[],a=this.size();if(a.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var h=this._data;for(var d of h)c.push(new n([d],this._datatype));return c},n.prototype.columns=function(){var c=this,a=[],h=this.size();if(h.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var d=this._data,D=function(p){var v=d.map(y=>[y[p]]);a.push(new n(v,c._datatype))},m=0;m<h[1];m++)D(m);return a},n.prototype.toArray=function(){return gt(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(c){return mt(this._data,c)},n.prototype.toString=function(){return mt(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(c){if(c){if(Ge(c)&&(c=c.toNumber()),!ge(c)||!He(c))throw new TypeError("The parameter k must be an integer number")}else c=0;for(var a=c>0?c:0,h=c<0?-c:0,d=this._size[0],D=this._size[1],m=Math.min(d-h,D-a),A=[],p=0;p<m;p++)A[p]=this._data[p+h][p+a];return new n({data:A,size:[m],datatype:this._datatype})},n.diagonal=function(c,a,h,d){if(!Ie(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(N){if(Ge(N)&&(N=N.toNumber()),!ge(N)||!He(N)||N<1)throw new Error("Size values must be positive integers");return N}),h){if(Ge(h)&&(h=h.toNumber()),!ge(h)||!He(h))throw new TypeError("The parameter k must be an integer number")}else h=0;var D=h>0?h:0,m=h<0?-h:0,A=c[0],p=c[1],v=Math.min(A-m,p-D),y;if(Ie(a)){if(a.length!==v)throw new Error("Invalid value array length");y=function(L){return a[L]}}else if(Bt(a)){var C=a.size();if(C.length!==1||C[0]!==v)throw new Error("Invalid matrix length");y=function(L){return a.get([L])}}else y=function(){return a};d||(d=Ge(y(0))?y(0).mul(0):0);var w=[];if(c.length>0){w=Pi(w,c,d);for(var M=0;M<v;M++)w[M+m][M+D]=y(M)}return new n({data:w,size:[A,p]})},n.fromJSON=function(c){return new n(c)},n.prototype.swapRows=function(c,a){if(!ge(c)||!He(c)||!ge(a)||!He(a))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Re(c,this._size[0]),Re(a,this._size[0]),n._swapRows(c,a,this._data),this},n._swapRows=function(c,a,h){var d=h[c];h[c]=h[a],h[a]=d};function l(c){return Bt(c)?l(c.valueOf()):Ie(c)?c.map(l):c}return n},{isClass:!0}),co="equalScalar";Ae(co,["typed","config"],e=>{var{typed:t,config:n}=e;return t(co,{"number, number":function(u,i){return qd(u,i,n.epsilon)}})});function Xt(e,t,n,r){if(!(this instanceof Xt))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(r!=null?"-"+r:"")+" expected)",this.stack=new Error().stack}Xt.prototype=new Error,Xt.prototype.constructor=Error,Xt.prototype.name="ArgumentsError",Xt.prototype.isArgumentsError=!0;var fo="format",FD=["typed"],wD=Ae(fo,FD,e=>{var{typed:t}=e;return t(fo,{any:mt,"any, Object | function | number":mt})}),lo="bin",bD=["typed","format"];Ae(lo,bD,e=>{var{typed:t,format:n}=e;return t(lo,{"number | BigNumber":function(u){return n(u,{notation:"bin"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"bin",wordSize:i})}})});var ho="oct",BD=["typed","format"];Ae(ho,BD,e=>{var{typed:t,format:n}=e;return t(ho,{"number | BigNumber":function(u){return n(u,{notation:"oct"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"oct",wordSize:i})}})});var po="hex",_D=["typed","format"];Ae(po,_D,e=>{var{typed:t,format:n}=e;return t(po,{"number | BigNumber":function(u){return n(u,{notation:"hex"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"hex",wordSize:i})}})});var Do="equal";Ae(Do,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(Do,{"any, any":function(u,i){return u===null?i===null:i===null?u===null:u===void 0?i===void 0:i===void 0?u===void 0:n(u,i)}})});var go="unequal";Ae(go,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(go,{"any, any":function(u,i){return u===null?i!==null:i===null?u!==null:u===void 0?i!==void 0:i===void 0?u!==void 0:!n(u,i)}})});var mo={exports:{}};(function(e){(function(t,n,r){function u(f){var l=this,c=s();l.next=function(){var a=2091639*l.s0+l.c*23283064365386963e-26;return l.s0=l.s1,l.s1=l.s2,l.s2=a-(l.c=a|0)},l.c=1,l.s0=c(" "),l.s1=c(" "),l.s2=c(" "),l.s0-=c(f),l.s0<0&&(l.s0+=1),l.s1-=c(f),l.s1<0&&(l.s1+=1),l.s2-=c(f),l.s2<0&&(l.s2+=1),c=null}function i(f,l){return l.c=f.c,l.s0=f.s0,l.s1=f.s1,l.s2=f.s2,l}function o(f,l){var c=new u(f),a=l&&l.state,h=c.next;return h.int32=function(){return c.next()*4294967296|0},h.double=function(){return h()+(h()*2097152|0)*11102230246251565e-32},h.quick=h,a&&(typeof a=="object"&&i(a,c),h.state=function(){return i(c,{})}),h}function s(){var f=4022871197,l=function(c){c=String(c);for(var a=0;a<c.length;a++){f+=c.charCodeAt(a);var h=.02519603282416938*f;f=h>>>0,h-=f,h*=f,f=h>>>0,h-=f,f+=h*4294967296}return(f>>>0)*23283064365386963e-26};return l}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(tt,e,!1)})(mo);var vo={exports:{}};(function(e){(function(t,n,r){function u(s){var f=this,l="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var a=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^a^a>>>8},s===(s|0)?f.x=s:l+=s;for(var c=0;c<l.length+64;c++)f.x^=l.charCodeAt(c)|0,f.next()}function i(s,f){return f.x=s.x,f.y=s.y,f.z=s.z,f.w=s.w,f}function o(s,f){var l=new u(s),c=f&&f.state,a=function(){return(l.next()>>>0)/4294967296};return a.double=function(){do var h=l.next()>>>11,d=(l.next()>>>0)/4294967296,D=(h+d)/(1<<21);while(D===0);return D},a.int32=l.next,a.quick=a,c&&(typeof c=="object"&&i(c,l),a.state=function(){return i(l,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(tt,e,!1)})(vo);var yo={exports:{}};(function(e){(function(t,n,r){function u(s){var f=this,l="";f.next=function(){var a=f.x^f.x>>>2;return f.x=f.y,f.y=f.z,f.z=f.w,f.w=f.v,(f.d=f.d+362437|0)+(f.v=f.v^f.v<<4^(a^a<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,s===(s|0)?f.x=s:l+=s;for(var c=0;c<l.length+64;c++)f.x^=l.charCodeAt(c)|0,c==l.length&&(f.d=f.x<<10^f.x>>>4),f.next()}function i(s,f){return f.x=s.x,f.y=s.y,f.z=s.z,f.w=s.w,f.v=s.v,f.d=s.d,f}function o(s,f){var l=new u(s),c=f&&f.state,a=function(){return(l.next()>>>0)/4294967296};return a.double=function(){do var h=l.next()>>>11,d=(l.next()>>>0)/4294967296,D=(h+d)/(1<<21);while(D===0);return D},a.int32=l.next,a.quick=a,c&&(typeof c=="object"&&i(c,l),a.state=function(){return i(l,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(tt,e,!1)})(yo);var Eo={exports:{}};(function(e){(function(t,n,r){function u(s){var f=this;f.next=function(){var c=f.x,a=f.i,h,d;return h=c[a],h^=h>>>7,d=h^h<<24,h=c[a+1&7],d^=h^h>>>10,h=c[a+3&7],d^=h^h>>>3,h=c[a+4&7],d^=h^h<<7,h=c[a+7&7],h=h^h<<13,d^=h^h<<9,c[a]=d,f.i=a+1&7,d};function l(c,a){var h,d=[];if(a===(a|0))d[0]=a;else for(a=""+a,h=0;h<a.length;++h)d[h&7]=d[h&7]<<15^a.charCodeAt(h)+d[h+1&7]<<13;for(;d.length<8;)d.push(0);for(h=0;h<8&&d[h]===0;++h);for(h==8?d[7]=-1:d[h],c.x=d,c.i=0,h=256;h>0;--h)c.next()}l(f,s)}function i(s,f){return f.x=s.x.slice(),f.i=s.i,f}function o(s,f){s==null&&(s=+new Date);var l=new u(s),c=f&&f.state,a=function(){return(l.next()>>>0)/4294967296};return a.double=function(){do var h=l.next()>>>11,d=(l.next()>>>0)/4294967296,D=(h+d)/(1<<21);while(D===0);return D},a.int32=l.next,a.quick=a,c&&(c.x&&i(c,l),a.state=function(){return i(l,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(tt,e,!1)})(Eo);var Ao={exports:{}};(function(e){(function(t,n,r){function u(s){var f=this;f.next=function(){var c=f.w,a=f.X,h=f.i,d,D;return f.w=c=c+1640531527|0,D=a[h+34&127],d=a[h=h+1&127],D^=D<<13,d^=d<<17,D^=D>>>15,d^=d>>>12,D=a[h]=D^d,f.i=h,D+(c^c>>>16)|0};function l(c,a){var h,d,D,m,A,p=[],v=128;for(a===(a|0)?(d=a,a=null):(a=a+"\0",d=0,v=Math.max(v,a.length)),D=0,m=-32;m<v;++m)a&&(d^=a.charCodeAt((m+32)%a.length)),m===0&&(A=d),d^=d<<10,d^=d>>>15,d^=d<<4,d^=d>>>13,m>=0&&(A=A+1640531527|0,h=p[m&127]^=d+A,D=h==0?D+1:0);for(D>=128&&(p[(a&&a.length||0)&127]=-1),D=127,m=4*128;m>0;--m)d=p[D+34&127],h=p[D=D+1&127],d^=d<<13,h^=h<<17,d^=d>>>15,h^=h>>>12,p[D]=d^h;c.w=A,c.X=p,c.i=D}l(f,s)}function i(s,f){return f.i=s.i,f.w=s.w,f.X=s.X.slice(),f}function o(s,f){s==null&&(s=+new Date);var l=new u(s),c=f&&f.state,a=function(){return(l.next()>>>0)/4294967296};return a.double=function(){do var h=l.next()>>>11,d=(l.next()>>>0)/4294967296,D=(h+d)/(1<<21);while(D===0);return D},a.int32=l.next,a.quick=a,c&&(c.X&&i(c,l),a.state=function(){return i(l,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(tt,e,!1)})(Ao);var Co={exports:{}};(function(e){(function(t,n,r){function u(s){var f=this,l="";f.next=function(){var a=f.b,h=f.c,d=f.d,D=f.a;return a=a<<25^a>>>7^h,h=h-d|0,d=d<<24^d>>>8^D,D=D-a|0,f.b=a=a<<20^a>>>12^h,f.c=h=h-d|0,f.d=d<<16^h>>>16^D,f.a=D-a|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,s===Math.floor(s)?(f.a=s/4294967296|0,f.b=s|0):l+=s;for(var c=0;c<l.length+20;c++)f.b^=l.charCodeAt(c)|0,f.next()}function i(s,f){return f.a=s.a,f.b=s.b,f.c=s.c,f.d=s.d,f}function o(s,f){var l=new u(s),c=f&&f.state,a=function(){return(l.next()>>>0)/4294967296};return a.double=function(){do var h=l.next()>>>11,d=(l.next()>>>0)/4294967296,D=(h+d)/(1<<21);while(D===0);return D},a.int32=l.next,a.quick=a,c&&(typeof c=="object"&&i(c,l),a.state=function(){return i(l,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(tt,e,!1)})(Co);var Fo={exports:{}};(function(e){(function(t,n,r){var u=256,i=6,o=52,s="random",f=r.pow(u,i),l=r.pow(2,o),c=l*2,a=u-1,h;function d(C,w,M){var N=[];w=w==!0?{entropy:!0}:w||{};var L=p(A(w.entropy?[C,y(n)]:C==null?v():C,3),N),U=new D(N),H=function(){for(var O=U.g(i),P=f,Z=0;O<l;)O=(O+Z)*u,P*=u,Z=U.g(1);for(;O>=c;)O/=2,P/=2,Z>>>=1;return(O+Z)/P};return H.int32=function(){return U.g(4)|0},H.quick=function(){return U.g(4)/4294967296},H.double=H,p(y(U.S),n),(w.pass||M||function(O,P,Z,W){return W&&(W.S&&m(W,U),O.state=function(){return m(U,{})}),Z?(r[s]=O,P):O})(H,L,"global"in w?w.global:this==r,w.state)}function D(C){var w,M=C.length,N=this,L=0,U=N.i=N.j=0,H=N.S=[];for(M||(C=[M++]);L<u;)H[L]=L++;for(L=0;L<u;L++)H[L]=H[U=a&U+C[L%M]+(w=H[L])],H[U]=w;(N.g=function(O){for(var P,Z=0,W=N.i,X=N.j,q=N.S;O--;)P=q[W=a&W+1],Z=Z*u+q[a&(q[W]=q[X=a&X+P])+(q[X]=P)];return N.i=W,N.j=X,Z})(u)}function m(C,w){return w.i=C.i,w.j=C.j,w.S=C.S.slice(),w}function A(C,w){var M=[],N=typeof C,L;if(w&&N=="object")for(L in C)try{M.push(A(C[L],w-1))}catch(U){}return M.length?M:N=="string"?C:C+"\0"}function p(C,w){for(var M=C+"",N,L=0;L<M.length;)w[a&L]=a&(N^=w[a&L]*19)+M.charCodeAt(L++);return y(w)}function v(){try{var C;return h&&(C=h.randomBytes)?C=C(u):(C=new Uint8Array(u),(t.crypto||t.msCrypto).getRandomValues(C)),y(C)}catch(N){var w=t.navigator,M=w&&w.plugins;return[+new Date,t,M,t.screen,y(n)]}}function y(C){return String.fromCharCode.apply(0,C)}if(p(r.random(),n),e.exports){e.exports=d;try{h=Pn.default}catch(C){}}else r["seed"+s]=d})(typeof self!="undefined"?self:tt,[],Math)})(Fo);var SD=mo.exports,MD=vo.exports,ND=yo.exports,ID=Eo.exports,xD=Ao.exports,OD=Co.exports,Ot=Fo.exports;Ot.alea=SD,Ot.xor128=MD,Ot.xorwow=ND,Ot.xorshift7=ID,Ot.xor4096=xD,Ot.tychei=OD,xn("fineStructure",.0072973525693),xn("weakMixingAngle",.2229),xn("efimovFactor",22.7),xn("sackurTetrode",-1.16487052358);function xn(e,t){var n=["config","BigNumber"];return Ae(e,n,r=>{var{config:u,BigNumber:i}=r;return u.number==="BigNumber"?new i(t):t})}var RD=cD({config:Bi}),$D=hD({}),PD=DD({}),TD=vD({}),jD=CD({Matrix:TD}),LD=hp({BigNumber:RD,Complex:$D,DenseMatrix:jD,Fraction:PD}),kD=wD({typed:LD});class qD{constructor(t){this.calcControls=[],this.dependenciesTriggerMap=new Map,this.hideNotRememberControlIds=[],this.dontHasPermissionControlIds=[],this.cacheComputedResult={},this.options=t,this.getDontHasPermissionControlIds(),this.getNeedHideRememberControlIds()}getNeedHideRememberControlIds(){var t;!((t=this.options)!=null&&t.displayBoList)||(this.hideNotRememberControlIds=this.options.displayBoList.reduce((n,r)=>(r.is_remember||n.push(...r.hide_controls),n),[]))}getDontHasPermissionControlIds(){var t;!((t=this.options)!=null&&t.behavior)||(this.dontHasPermissionControlIds=this.options.behavior.reduce((n,r)=>(r.ctrlBehavior===1&&n.push(r.ctrlId),n),[]))}controlNeedComputedValue(t){if(!t)return!1;const n=this.getControlIsHide(t);return!(this.dontHasPermissionControlIds.includes(t.id)&&n||this.hideNotRememberControlIds.includes(t.id)&&n)}getControlIsHide(t){return t.props.isHide?!0:t.parent===null||t.parent===void 0?!1:this.getControlIsHide(t.parent)}apply(t){this.engine=t,this.watchControlChange(),this.watchSubtableChange(),this.watchSchemaHideChange(),this.engine.on("engine-mounted",()=>{requestAnimationFrame(()=>{this.resetDependencies(),this.allCalcControlComputed()})})}resetDependencies(){this.calcControls=[],this.dependenciesTriggerMap.clear(),this.getAllCalcControl(),this.getCalcDependencies()}allCalcControlComputed(){this.calcControls.forEach(t=>{this.computedCalcValue(t)})}getAllCalcControl(){this.calcControls=this.engine.runtime.flatInstances.filter(t=>t.type===de.CALC)}getCalcDependencies(){this.calcControls.forEach(t=>{const{scriptEcho:n}=t.props;n.forEach(r=>{(r.type===$e.VariableInMainTable||r.type===$e.VariableInCurrentSubTable||r.type===$e.VariableInOtherSubTable)&&this.setDependenciesTriggerMapItem(r.id,t),r.type===$e.VariableInOtherSubTable&&r.subTableId&&this.setDependenciesTriggerMapItem(r.subTableId,t)})})}setDependenciesTriggerMapItem(t,n){this.dependenciesTriggerMap.has(t)||this.dependenciesTriggerMap.set(t,[]);const r=this.dependenciesTriggerMap.get(t);r.includes(n)||r.push(n)}getCalcControlsFromSubtableRows(t){return t.reduce((n,r)=>(r.children.forEach(u=>{const i=u.children[0];i&&this.engine.assertInstance(i,de.CALC)&&n.push(i)}),n),[])}watchSchemaHideChange(){this.engine.on("schema-change",t=>{var n;t.props==="isHide"&&((n=this.dependenciesTriggerMap.get(t.instance.id))!=null?n:[]).forEach(u=>{this.computedCalcValue(u)})})}watchSubtableChange(){this.engine.on("list-change",t=>{var i,o,s;if(this.engine.isMounted===!1)return;this.resetDependencies();const n=(o=(i=t.options)==null?void 0:i.changed)!=null?o:[];this.getCalcControlsFromSubtableRows(n).forEach(f=>{this.computedCalcValue(f)}),((s=this.dependenciesTriggerMap.get(t.instance.id))!=null?s:[]).forEach(f=>{this.computedCalcValue(f)})})}watchControlChange(){this.engine.on("change",t=>{var u;if(this.engine.isMounted===!1)return;const{instance:n}=t;if(!this.dependenciesTriggerMap.has(n.id))return;const r=(u=this.dependenciesTriggerMap.get(n.id))!=null?u:[];t.rowIndex!==void 0&&t.rowIndex>-1?r.forEach(i=>{this.controlInSubtable(i)&&this.engine.getInstanceRowIndex(i)!==t.rowIndex||this.computedCalcValue(i)}):r.forEach(i=>{this.computedCalcValue(i)})})}controlInSubtable(t){var n;return((n=t.parent)==null?void 0:n.type)===de.SUBTABLE_COLUMN}computedCalcValue(t){var f;const n=t.props.scriptEcho;if(!n||n.length===0)return;let r;this.controlInSubtable(t)&&(r=this.engine.getInstanceRowIndex(t));const u=n.reduce((l,c)=>{if(c.type===$e.Operator||c.type===$e.Number)return l+c.name;let a=0,h;switch(c.type){case $e.VariableInMainTable:{const d=this.getNumberValue(this.engine.getState(c.id));h=this.engine.getInstance(c.id),a=Number(d);break}case $e.VariableInCurrentSubTable:{h=this.engine.getInstance(c.id,r);const d=this.engine.getState(c.id,r),D=this.getNumberValue(d);a=Number(D);break}case $e.VariableInOtherSubTable:{const d=this.engine.getState(c.id),D=Array.isArray(d)?d.map(A=>this.getNumberValue(A)):[],m=this.getAggregateTypeValue(D,c.aggregateType);h=this.engine.getInstance(c.subTableId),a=Number(m);break}}return!Number.isNaN(a)&&this.controlNeedComputedValue(h)?l+=`(${a})`:l+=0,l},"");let i;if(this.cacheComputedResult[u]!==void 0?i=this.cacheComputedResult[u]:(i=Number(kD(new Function(`return ${u}`)(),{precision:16})),this.cacheComputedResult[u]=i),this.controlInSubtable(t)&&r===void 0)return;const o=this.engine.getState(t.id,r),s=!i||i===1/0||i===-1/0?0:t.props.precision===""?i:Number(i.toFixed(t.props.precision));s!==(o==null?void 0:o.result)&&this.engine.setState(t.id,{result:s,unit:(f=o==null?void 0:o.unit)!=null?f:""},r)}getNumberValue(t){if(typeof t=="object"&&t){if("result"in t)return t.result;if("amount"in t)return t.amount}return typeof t=="number"?t:0}getAggregateTypeValue(t,n){if(!n||!t||!t.length)return 0;switch(n){case yt.MAX:return Math.max(...t);case yt.MIN:return Math.min(...t);case yt.SUM:return t.reduce((r,u)=>r+u);case yt.AVG:return t.reduce((r,u)=>r+u)/t.length}}}class VD{constructor(t){this.config=t}apply(t){var i,o;this.engine=t;const n=(o=(i=this.config)==null?void 0:i.source)!=null?o:"";let r=document.createElement("style");r.className="edit-css",r.type="text/css",r.innerHTML=n,document.querySelector("head").appendChild(r)}}z.CalcPlugin=qD,z.ControlsEventPlugin=nd,z.ES6ModulePlugin=Yh,z.Engine=Tr,z.LifecycleEventPlugin=td,z.Plugin=Qh,z.StylePlugin=VD,z.buildUUID=Nr,z.hasChildrenControl=mn,z.loopDataViewControl=bt,z.loopFormControl=wt,z.parseModule=Ei,Object.defineProperty(z,"__esModule",{value:!0})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byteluck-fe/model-driven-engine",
3
- "version": "2.7.0-alpha.39",
3
+ "version": "2.7.0-alpha.40",
4
4
  "description": "> TODO: description",
5
5
  "author": "郝晨光 <2293885211@qq.com>",
6
6
  "homepage": "",
@@ -34,5 +34,5 @@
34
34
  "devDependencies": {
35
35
  "@types/node": "~18.0.6"
36
36
  },
37
- "gitHead": "a1cdc7947aeb857ebbcf1cb76058f1faf3a17727"
37
+ "gitHead": "1575157b2e0918c2c01b2b67e9ac01620f7a0ca4"
38
38
  }