@datagrok/curves 1.4.4 → 1.4.5
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.
- package/CHANGELOG.md +2 -0
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/package.json +4 -3
- package/src/fit/fit-grid-cell-handler.ts +1 -1
- package/src/fit/fit-renderer.ts +5 -0
- package/src/fit/multi-curve-viewer.ts +6 -0
- package/src/package.g.ts +21 -0
- package/src/package.ts +6 -20
- package/src/tests/curves-cell-renderer-tests.ts +3 -3
- package/tsconfig.json +2 -2
- package/webpack.config.js +4 -0
package/dist/package-test.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var curves_test;(()=>{var t={111:(t,e,n)=>{"use strict";function r(t){t.sort();const e=t[Math.trunc(t.length/4)],n=t.length%2==0?(t[Math.trunc(t.length/2)]+t[Math.trunc(t.length/2)-1])/2:t[Math.trunc(t.length/2)],r=t[Math.trunc(3*t.length/4)],i=1.5*(r-e);let s=o(t,r+i);s<0&&(s=~s);let a=t[Math.max(0,s-1)];a<r&&(a=r);let l=o(t,e-i);l<0&&(l=~l);let c=t[l];return c>e&&(c=e),{q1:e,q2:n,q3:r,lowerAdjacentValue:c,upperAdjacentValue:a}}function o(t,e,n=0,r){if(0===t.length)return-1;if(void 0===r&&(r=t.length-1),e<t[n])return-1;if(e>t[r])return-(r+1);for(;r-n>1;){const o=Math.trunc((r+n)/2);if(e===t[o])return o;e<t[o]?r=o:n=o}return t[n]===e?n:0===t[r]?r:e<t[n]?-(n+1):-(r+1)}n.d(e,{G:()=>r})},102:(t,e,n)=>{"use strict";n.d(e,{U5:()=>v,lI:()=>T,yB:()=>x,js:()=>f,kW:()=>y,iC:()=>_,K0:()=>g,ue:()=>I,hR:()=>E,ZY:()=>w,aC:()=>C,GE:()=>N,B2:()=>b,XD:()=>A,sw:()=>m});var r,o=n(976),i=n(162);class s extends Error{constructor(t){super(t)}}function a(t,e,n,r){for(let o=0;o<e;o++){let i=0;for(let t=0;t<e+1;t++)t!==n&&(i+=r[t][o]);t[o]=i/e}}function l(t,e,n,r,o,i,s,a){for(let l=0;l<i;l++)e[l]=t[l],e[l]+=o*(t[l]-r[n][l]),e[l]<s[l]?e[l]=s[l]:e[l]>a[l]&&(e[l]=a[l])}!function(t){t[t.TOLERANCE=.01]="TOLERANCE",t[t.MAX_ITER=20]="MAX_ITER",t[t.NON_ZERO_PARAM=1e-4]="NON_ZERO_PARAM",t[t.INITIAL_SCALE=.02]="INITIAL_SCALE",t[t.SCALE_REFLECTION=1]="SCALE_REFLECTION",t[t.SCALE_EXPANSION=2]="SCALE_EXPANSION",t[t.SCALE_CONTRACTION=-.5]="SCALE_CONTRACTION"}(r||(r={})),new Map([["tolerance","Tolerance"],["maxIter","Max iterations"],["nonZeroParam","Non-zero param"],["initialScale","Initial scale"],["scaleReflection","Scale reflection"],["scaleExpansion","Scale expansion"],["scaleContraction","Scale contraction"]]);const c=function(t,e,n,r,o){const i=n.tolerance,s=n.maxIter,c=n.scaleReflection,u=n.scaleExpansion,f=n.scaleContraction,d=e.length+1,h=e.length,[p,m]=function(t,e,n,r,o){const i=n.length+1,s=n.length,a=e.nonZeroParam,l=e.initialScale,c=new Array(i),u=new Array(i);for(let e=0;e<i;e++){c[e]=new Float32Array(s);for(let t=0;t<s;t++)c[e][t]=n[t],0!==e&&e-1===t&&(0===n[t]?c[e][t]=a:c[e][t]+=l*n[e-1],c[e][t]<r[t]?c[e][t]=r[t]:c[e][t]>o[t]&&(c[e][t]=o[t]));u[e]=t(c[e])}return[c,u]}(t,n,e,r,o),y=new Array(d);for(let t=0;t<d;t++)y[t]=t;const g=y.length-1;let x=0,v=0,T=0,w=0;const _=new Float32Array(h),E=new Float32Array(h),I=new Float32Array(h),C=new Float32Array(h),A=new Array(s);if(d>1){for(;y.sort(((t,e)=>m[t]-m[e])),!(x>s);){if(0===x&&(v=m[0],T=2*m[y[0]]),A[x]=v,++x,v=m[y[0]],T-v>i)w=0;else if(++w,w>2*d)break;T=v,a(_,h,y[g],p),l(_,E,y[g],p,c,h,r,o);const e=t(E);if(e<m[y[g]]){l(_,I,y[g],p,u,h,r,o);const n=t(I);if(n<e){m[y[g]]=n;for(let t=0;t<h;t++)p[y[g]][t]=I[t];continue}m[y[g]]=e;for(let t=0;t<h;t++)p[y[g]][t]=E[t];continue}l(_,C,y[g],p,f,h,r,o);const n=t(C);if(!(n<m[y[g]]))break;m[y[g]]=n;for(let t=0;t<h;t++)p[y[g]][t]=C[t]}for(let t=x;t<s;t++)A[t]=m[y[0]]}return{point:p[y[0]],cost:m[y[0]],iterCosts:A,iterCount:x-1}};function u(t,e,n){const r=e-n,o=new Array(t);for(let e=0;e<t;e++){const t=Math.random();o[e]=n+t*r}return o}const f={CONSTANT:"constant",PROPORTIONAL:"proportional",COMBINED:"combined"};class d{}class h extends d{constructor(t,e,n,r){super(),this._name=t,this._parameterNames=r,this.y=e,this.getInitialParameters=n}get name(){return this._name}get parameterNames(){return this._parameterNames}y(t,e){throw new Error("Not implemented")}getInitialParameters(t,e){throw new Error("Not implemented")}}const p={linear:new class extends d{get name(){return v}get parameterNames(){return["Slope","Intercept"]}y(t,e){return N(t,e)}getInitialParameters(t,e){let n=0,r=0;for(let e=1;e<t.length;e++)t[e]<t[n]&&(n=e),t[e]>t[r]&&(r=e);const o=t[r]-t[n],i=(e[r]-e[n])/o,s=e[r]-i*t[r],a=new Float32Array(2);return a.set([i,s]),a}},sigmoid:new class extends d{get name(){return x}get parameterNames(){return["Top","Bottom","Slope","IC50"]}y(t,e){return A(t,e)}getInitialParameters(t,e){const n=o.Rect.fromXYArrays(t,e),r=(n.bottom-n.top)/2+n.top;let i=n.bottom-n.top,s=0;for(let n=0;n<t.length;n++){const t=Math.abs(e[n]-r);t<i&&(i=t,s=n)}const a=t[s],l=e[0]>e[e.length-1]?1:-1,c=new Float32Array(4);return c.set([n.bottom,l,a,n.top]),c}},"log-linear":new class extends d{get name(){return T}get parameterNames(){return["Slope","Intercept"]}y(t,e){return b(t,e)}getInitialParameters(t,e){const n=new Float32Array(2);return n.set([-5,100]),n}}},m=[o.Property.js("rSquared",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("auc",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("interceptY",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("interceptX",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("slope",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("top",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("bottom",o.TYPE.FLOAT,{userEditable:!1})],y=[o.Property.js("minX",o.TYPE.FLOAT,{nullable:!0}),o.Property.js("minY",o.TYPE.FLOAT,{nullable:!0}),o.Property.js("maxX",o.TYPE.FLOAT,{nullable:!0}),o.Property.js("maxY",o.TYPE.FLOAT,{nullable:!0}),o.Property.js("title",o.TYPE.STRING,{nullable:!0}),o.Property.js("xAxisName",o.TYPE.STRING,{description:"Label to show on the X axis. If not specified, corresponding data column name is used",nullable:!0}),o.Property.js("yAxisName",o.TYPE.STRING,{description:"Label to show on the Y axis. If not specified, corresponding data column name is used",nullable:!0}),o.Property.js("logX",o.TYPE.BOOL,{description:"Whether the X axis should be logarithmic",defaultValue:!1}),o.Property.js("logY",o.TYPE.BOOL,{description:"Whether the Y axis should be logarithmic",defaultValue:!1}),o.Property.js("allowXZeroes",o.TYPE.BOOL,{description:"Whether x zeroes allowed for logarithmic data or not",defaultValue:!0}),o.Property.js("mergeSeries",o.TYPE.BOOL,{description:"Merges all series within one cell into one series",defaultValue:!1}),o.Property.js("showColumnLabel",o.TYPE.BOOL,{description:"Whether to show the column label in the legend or not",defaultValue:!1}),o.Property.js("showStatistics",o.TYPE.STRING_LIST,{description:"Whether specific statistics should be rendered",choices:m.map((t=>t.name)),inputType:"MultiChoice",friendlyName:"Statistics"})],g=[o.Property.js("fitFunction",o.TYPE.STRING,{category:"Fitting",choices:Object.keys(p),defaultValue:"sigmoid"}),o.Property.js("pointColor",o.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),o.Property.js("fitLineColor",o.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),o.Property.js("outlierColor",o.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),o.Property.js("errorModel",o.TYPE.STRING,{category:"Fitting",defaultValue:"constant",choices:["constant","proportional","combined"],nullable:!1}),o.Property.js("connectDots",o.TYPE.BOOL,{category:"Fitting",defaultValue:!1}),o.Property.js("clickToToggle",o.TYPE.BOOL,{category:"Fitting",description:"Click on a point to mark it as outlier and refit",nullable:!0,defaultValue:!1}),o.Property.js("showFitLine",o.TYPE.BOOL,{category:"Fitting",defaultValue:!0}),o.Property.js("showPoints",o.TYPE.STRING,{category:"Fitting",description:"Whether points/candlesticks/none should be rendered",defaultValue:"points",choices:["points","candlesticks","both"]}),o.Property.js("showCurveConfidenceInterval",o.TYPE.BOOL,{category:"Fitting",description:"Whether confidence intervals should be rendered",defaultValue:!1,friendlyName:"Confidence Interval"}),o.Property.js("markerType",o.TYPE.STRING,{category:"Rendering",defaultValue:"circle",choices:["asterisk","circle","cross border","diamond","square","star","triangle bottom","triangle left","triangle right","triangle top"],nullable:!1,friendlyName:"Marker"}),o.Property.js("outlierMarkerType",o.TYPE.STRING,{category:"Rendering",defaultValue:"outlier",choices:["asterisk","circle","cross border","diamond","outlier","square","star","triangle bottom","triangle left","triangle right","triangle top"],nullable:!1,friendlyName:"Outlier Marker"}),o.Property.js("lineStyle",o.TYPE.STRING,{category:"Rendering",defaultValue:"solid",choices:["solid","dotted","dashed","dashdotted"],nullable:!1}),o.Property.js("droplines",o.TYPE.STRING_LIST,{description:"Whether specific droplines should be rendered",choices:["IC50"],inputType:"MultiChoice"}),o.Property.js("columnName",o.TYPE.STRING,{description:"Column name where the series is stored",defaultValue:""})],x="sigmoid",v="linear",T="log-linear";function w(t){if("string"==typeof t)return p[t];if(!p[t.name]){const e=t.name,n=t.parameterNames,r=t.function.split("=>").map((t=>t.trim())),o=t.getInitialParameters.split("=>").map((t=>t.trim())),i=new Function(r[0].slice(1,r[0].length-1),`${r[1].includes(";")?"":"return "}${r[1]}`),s=new Function(o[0].slice(1,o[0].length-1),`return ${o[1]}`),a=new h(e,i,s,n);p[e]=a}return p[t.name]}function _(t,e,n,i){const a=e.y;let l=e.getInitialParameters(t.x,t.y);const d=function(t,e,n){return r=>{let o=0,i=0,s=0;const a=e.y,l=e.x.map((e=>t(r,e))),c=a.map(((t,e)=>t-l[e])).map((t=>Math.pow(t,2)));for(let t=0;t<c.length;t++)[f.CONSTANT,f.COMBINED].includes(n)?i+=c[t]:n===f.PROPORTIONAL&&(s+=c[t]/(l[t]*l[t]));i=Math.sqrt(i/c.length),s=Math.sqrt(s/c.length),n===f.COMBINED&&({sigmaA:i,sigmaB:s}=P(i,s,c,l));const u=[];for(let t=0;t<c.length;t++)u[t]=Math.pow(i+s*l[t],2),o+=c[t]/u[t]+Math.log(2*Math.PI*u[t]);return o}}(a,t,n);let h=new Float32Array(e.parameterNames.length),p=new Float32Array(e.parameterNames.length);for(let t=0;t<e.parameterNames.length;t++)h[t]=0===l[t]?-1:l[t]-Math.abs(.5*l[t]),p[t]=0===l[t]?1:l[t]+Math.abs(.5*l[t]);return i&&0!==i.length&&(h=new Float32Array(i.length),h.set(i.map((t=>t.min))),p=new Float32Array(i.length),p.set(i.map((t=>t.max)))),l=function(t,e,n,r,i=1,a=null,l=!0){const f=function(t,e,n){const r=e.length,o=new Array(t);for(let e=0;e<t;e++)o[e]=new Float32Array(r);for(let i=0;i<r;i++)if(e[i]===n[i])for(let n=0;n<t;n++)o[n][i]=e[i];else{const r=u(t,e[i],n[i]);for(let e=0;e<t;e++)o[e][i]=r[e]}return o}(i,n,e);null!==a&&(f[0]=a);const d=[],h=[],p=[];let m,y=0,g=null;for(m=0;m<i;++m)try{if(0===m&&l){const e=new Float32Array(a.length).map((t=>-1/0)),n=new Float32Array(a.length).map((t=>1/0));d.push(c(t,f[m],r,e,n))}else d.push(c(t,f[m],r,e,n))}catch(t){if(t instanceof s)throw new Error(`Inconsistent dataframes: ${t.message}`);++y,h.push(t instanceof Error?t.message:"Platform issue"),p.push(f[m])}if(y>0){const t=n.length,e=new Array(t);for(let n=0;n<t;++n)e[n]=new Float32Array(y);p.forEach(((t,n)=>t.forEach(((t,r)=>e[r][n]=t)))),g=o.DataFrame.fromColumns(e.map(((t,e)=>o.Column.fromFloat32Array(`arg${e}`,t)))),g.columns.add(o.Column.fromStrings("Issue",h))}return{extremums:d,fails:g}}(d,h,p,{tolerance:r.TOLERANCE,maxIter:r.MAX_ITER,nonZeroParam:r.NON_ZERO_PARAM,initialScale:r.INITIAL_SCALE,scaleReflection:r.SCALE_REFLECTION,scaleExpansion:r.SCALE_EXPANSION,scaleContraction:r.SCALE_CONTRACTION},1,l).extremums[0].point,{fittedCurve:E(a,l),parameters:l}}function E(t,e){return n=>t(e,n)}function I(t,e,n,r=.05,o){const s=function(t,e,n,r){let o=0,i=0;const s=e.y,a=e.x.map((e=>t(r,e))),l=s.map(((t,e)=>t-a[e])),c=l.map((t=>Math.pow(t,2)));for(let t=0;t<c.length;t++)[f.CONSTANT,f.COMBINED].includes(n)?o+=c[t]:n===f.PROPORTIONAL&&(i+=Math.pow(l[t]/Math.abs(a[t]),2));return o=Math.sqrt(o/c.length),i=Math.sqrt(i/c.length),n===f.COMBINED&&({sigmaA:o,sigmaB:i}=P(o,i,c,a)),{sigmaA:o,sigmaB:i}}(n,t,o,e),a=i.normal.inv(1-r/2,0,1);return{confidenceTop:t=>{const r=n(e,t);return r+a*(s.sigmaA+Math.abs(r)*s.sigmaB)},confidenceBottom:t=>{const r=n(e,t);return r-a*(s.sigmaA+Math.abs(r)*s.sigmaB)}}}function C(t,e,n,r=!0){const o=E(n,e);return{rSquared:r?S(o,t):void 0,auc:r?L(o,t):void 0,interceptX:e[2],interceptY:o(e[2]),slope:e[1],top:e[0],bottom:e[3]}}function A(t,e){const n=t[0],r=t[1],o=t[2],i=t[3];return i+(n-i)/(1+Math.pow(10,(e-o)*r))}function N(t,e){return t[0]*e+t[1]}function b(t,e){const n=t[0],r=t[1];return n*Math.log(e+1)+r}function L(t,e){let n=0;const r=Math.min(...e.x),o=Math.max(...e.x),i=(o-r)/1e3;for(let e=r;e<o;e+=i)n+=i*t(e);return n}function S(t,e){let n=0,r=0;const o=i.mean(e.y);for(let i=0;i<e.x.length;i++)n+=Math.pow(e.y[i]-t(e.x[i]),2),r+=Math.pow(e.y[i]-o,2);return 1-n/r}function P(t,e,n,r){let o=Number.MAX_VALUE,i=0;for(let e=0;e<=10;e++){let s=0;const a=e/10,l=t*a,c=t*(1-a),u=[];for(let t=0;t<n.length;t++)u[t]=Math.pow(l+c*r[t],2),s+=n[t]/u[t]+Math.log(2*Math.PI*u[t]);s<o&&(o=s,i=a)}return e=t*(1-i),{sigmaA:t*=i,sigmaB:e}}},416:(t,e,n)=>{"use strict";n.d(e,{LC:()=>h,PK:()=>d,TL:()=>s,Y6:()=>u,dU:()=>c,kG:()=>f,q_:()=>a,tq:()=>p});var r=n(976),o=n(102);function i(t){const e={};for(const n of t)null!==n.defaultValue&&(e[n.name]=n.defaultValue);return e}function s(){return{chartOptions:i(o.kW),seriesOptions:i(o.K0)}}function a(t){const e=[],n=[];for(let r=0;r<t.length;r++)e[r]=t[r].x,n[r]=t[r].y;return{xs:e,ys:n}}function l(t){const e=Math.floor(t.y.length/2),n=t.y.sort(((t,e)=>t-e));return n.length%2==0?(n[e-1]+n[e])/2:n[e]}function c(t){var e;const n=t.chartOptions;if((null===(e=t.series)||void 0===e?void 0:e.length)&&0!==t.series.length){const{xs:e,ys:o}=a(t.series[0].points);let i=r.Rect.fromXYArrays(e,o);for(let e=1;e<t.series.length;e++){const{xs:n,ys:o}=a(t.series[e].points);n.some((t=>void 0===t))||o.some((t=>void 0===t))||(i=i.union(r.Rect.fromXYArrays(n,o)))}return n?function(t,e){let n=t.x,o=t.y,i=t.width,s=t.height;return void 0!==e.minX&&null!==e.minX&&(!e.logX||e.logX&&e.minX>0)&&(i+=n-e.minX,n=e.minX),void 0!==e.maxX&&null!==e.maxX&&(!e.logX||e.logX&&e.maxX>0)&&(i+=e.maxX-(n+i)),void 0!==e.minY&&null!==e.minY&&(!e.logY||e.logY&&e.minY>0)&&(s+=o-e.minY,o=e.minY),void 0!==e.maxY&&null!==e.maxY&&(!e.logY||e.logY&&e.maxY>0)&&(s+=e.maxY-(o+s)),new r.Rect(n,o,i,s)}(i,n):i}return new r.Rect(0,0,1,1)}function u(t){return(0,o.ZY)(t.fitFunction)}function f(t,e){var n;const r=new Float32Array(null===(n=t.parameters)||void 0===n?void 0:n.length);return r.set(t.parameters),(0,o.hR)(e.y,r)}function d(t,e,n){var r;const i={x:t.points.filter((t=>!t.outlier)).map((t=>(null==n?void 0:n.logX)?Math.log10(t.x):t.x)),y:t.points.filter((t=>!t.outlier)).map((t=>(null==n?void 0:n.logY)?Math.log10(t.y):t.y))};var s;return t.parameterBounds&&(null==n?void 0:n.logX)&&(t.parameterBounds[2]=((s=t.parameterBounds[2])&&(void 0!==s.max&&(s.max=Math.log10(s.max)),void 0!==s.min&&(s.min=0===s.min?-Number.MAX_VALUE:Math.log10(s.min))),s)),(0,o.iC)(function(t){const e={x:[],y:[]},n={x:[t.x[0]],y:[t.y[0]]};for(let r=1;r<t.x.length;r++){if(t.x[r]===n.x[0]){n.x[n.x.length]=t.x[r],n.y[n.y.length]=t.y[r];continue}const o=l(n);e.x[e.x.length]=n.x[0],e.y[e.y.length]=o,n.x=[t.x[r]],n.y=[t.y[r]]}const r=l(n);return e.x[e.x.length]=n.x[0],e.y[e.y.length]=r,e}(i),e,null!==(r=t.errorModel)&&void 0!==r?r:o.js.CONSTANT,t.parameterBounds)}function h(t,e,n,r){var i,s;const a=n?{x:t.points.map((t=>(null==r?void 0:r.logX)?Math.log10(t.x):t.x)),y:t.points.map((t=>(null==r?void 0:r.logY)?Math.log10(t.y):t.y))}:{x:t.points.filter((t=>!t.outlier)).map((t=>(null==r?void 0:r.logX)?Math.log10(t.x):t.x)),y:t.points.filter((t=>!t.outlier)).map((t=>(null==r?void 0:r.logY)?Math.log10(t.y):t.y))};if(!t.parameters){const n=d(t,e).parameters;t.parameters=[...n]}const l=new Float32Array(null===(i=t.parameters)||void 0===i?void 0:i.length);return l.set(t.parameters),(0,o.ue)(a,l,e.y,.05,null!==(s=t.errorModel)&&void 0!==s?s:o.js.CONSTANT)}function p(t,e,n){var r;const i={x:t.points.filter((t=>!t.outlier)).map((t=>(null==n?void 0:n.logX)?Math.log10(t.x):t.x)),y:t.points.filter((t=>!t.outlier)).map((t=>(null==n?void 0:n.logY)?Math.log10(t.y):t.y))};if(!t.parameters){const n=d(t,e).parameters;t.parameters=[...n]}const s=new Float32Array(null===(r=t.parameters)||void 0===r?void 0:r.length);return s.set(t.parameters),(0,o.aC)(i,s,e.y,!0)}},766:(t,e,n)=>{"use strict";n.d(e,{l:()=>a});var r=n(976);const o=1e-30,i=new class{screenToWorld(t,e,n,r,o){return n+(o?1-t/e:t/e)*(r-n)}worldToScreen(t,e,n,r,o){return o?(1-(t-n)/(r-n))*e:(t-n)/(r-n)*e}},s=new class{screenToWorld(t,e,n,r,i){n=n<o?o:n;const s=Math.log(r),a=Math.log(n);return Math.exp(a+(s-a)*(i?e-t:t)/e)}worldToScreen(t,e,n,r,i){if(t<=0)return NaN;if(Math.abs(t-n)<o)return i?e:0;if(Math.abs(t-r)<o)return i?0:e;n=n<o?o:n,t=t<o?o:t;const s=e*Math.log(t/n)/Math.log(r/n);return i?e-s:s}};class a{get xt(){return this.logX?s:i}get yt(){return this.logY?s:i}constructor(t,e,n=!1,r=!1){this.logX=!1,this.logY=!1,this.inverseX=!1,this.inverseY=!1,this.world=t,this.screen=e,this.logX=n,this.logY=r}xToScreen(t){return this.screen.left+this.xt.worldToScreen(t,this.screen.width,this.world.minX,this.world.maxX,this.inverseX)}yToScreen(t){return this.screen.top+this.yt.worldToScreen(t,this.screen.height,this.world.minY,this.world.maxY,!this.inverseY)}xToWorld(t){return this.xt.screenToWorld(t-this.screen.left,this.screen.width,this.world.minX,this.world.maxX,this.inverseX)}yToWorld(t){return this.yt.screenToWorld(t-this.screen.top,this.screen.height,this.world.minY,this.world.maxY,!this.inverseY)}toScreen(t){return new r.Point(this.xToScreen(t.x),this.yToScreen(t.y))}toWorld(t){return new r.Point(this.xToWorld(t.x),this.yToWorld(t.y))}drawCoordinateGrid(t,e,n){e&&r.Paint.horzAxis(t,this.world.minX,this.world.maxX,e.x,e.y,e.width,e.height,this.logX,this.inverseX),n&&r.Paint.vertAxis(t,this.world.minY,this.world.maxY,n.x,n.y,n.width,n.height,this.logY,this.inverseY)}}},133:function(t,e,n){var r;!function(e,o){var i={};!function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(t,n,r,o,i){for(var s,a,l,c,u,f,d,h,p,m,y,g,x;i>=64;){for(s=n[0],a=n[1],l=n[2],c=n[3],u=n[4],f=n[5],d=n[6],h=n[7],m=0;m<16;m++)y=o+4*m,t[m]=(255&r[y])<<24|(255&r[y+1])<<16|(255&r[y+2])<<8|255&r[y+3];for(m=16;m<64;m++)g=((p=t[m-2])>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,x=((p=t[m-15])>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,t[m]=(g+t[m-7]|0)+(x+t[m-16]|0);for(m=0;m<64;m++)g=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&f^~u&d)|0)+(h+(e[m]+t[m]|0)|0)|0,x=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&a^s&l^a&l)|0,h=d,d=f,f=u,u=c+g|0,c=l,l=a,a=s,s=g+x|0;n[0]+=s,n[1]+=a,n[2]+=l,n[3]+=c,n[4]+=u,n[5]+=f,n[6]+=d,n[7]+=h,o+=64,i-=64}return o}var r=function(){function e(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return e.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},e.prototype.clean=function(){for(var t=0;t<this.buffer.length;t++)this.buffer[t]=0;for(t=0;t<this.temp.length;t++)this.temp[t]=0;this.reset()},e.prototype.update=function(t,e){if(void 0===e&&(e=t.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this.bytesHashed+=e,this.bufferLength>0){for(;this.bufferLength<64&&e>0;)this.buffer[this.bufferLength++]=t[r++],e--;64===this.bufferLength&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(e>=64&&(r=n(this.temp,this.state,t,r,e),e%=64);e>0;)this.buffer[this.bufferLength++]=t[r++],e--;return this},e.prototype.finish=function(t){if(!this.finished){var e=this.bytesHashed,r=this.bufferLength,o=e/536870912|0,i=e<<3,s=e%64<56?64:128;this.buffer[r]=128;for(var a=r+1;a<s-8;a++)this.buffer[a]=0;this.buffer[s-8]=o>>>24&255,this.buffer[s-7]=o>>>16&255,this.buffer[s-6]=o>>>8&255,this.buffer[s-5]=o>>>0&255,this.buffer[s-4]=i>>>24&255,this.buffer[s-3]=i>>>16&255,this.buffer[s-2]=i>>>8&255,this.buffer[s-1]=i>>>0&255,n(this.temp,this.state,this.buffer,0,s),this.finished=!0}for(a=0;a<8;a++)t[4*a+0]=this.state[a]>>>24&255,t[4*a+1]=this.state[a]>>>16&255,t[4*a+2]=this.state[a]>>>8&255,t[4*a+3]=this.state[a]>>>0&255;return this},e.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},e.prototype._saveState=function(t){for(var e=0;e<this.state.length;e++)t[e]=this.state[e]},e.prototype._restoreState=function(t,e){for(var n=0;n<this.state.length;n++)this.state[n]=t[n];this.bytesHashed=e,this.finished=!1,this.bufferLength=0},e}();t.Hash=r;var o=function(){function t(t){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var e=new Uint8Array(this.blockSize);if(t.length>this.blockSize)(new r).update(t).finish(e).clean();else for(var n=0;n<t.length;n++)e[n]=t[n];for(n=0;n<e.length;n++)e[n]^=54;for(this.inner.update(e),n=0;n<e.length;n++)e[n]^=106;for(this.outer.update(e),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate),n=0;n<e.length;n++)e[n]=0}return t.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},t.prototype.clean=function(){for(var t=0;t<this.istate.length;t++)this.ostate[t]=this.istate[t]=0;this.inner.clean(),this.outer.clean()},t.prototype.update=function(t){return this.inner.update(t),this},t.prototype.finish=function(t){return this.outer.finished?this.outer.finish(t):(this.inner.finish(t),this.outer.update(t,this.digestLength).finish(t)),this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t}();function i(t){var e=(new r).update(t),n=e.digest();return e.clean(),n}function s(t,e){var n=new o(t).update(e),r=n.digest();return n.clean(),r}function a(t,e,n,r){var o=r[0];if(0===o)throw new Error("hkdf: cannot expand more");e.reset(),o>1&&e.update(t),n&&e.update(n),e.update(r),e.finish(t),r[0]++}t.HMAC=o,t.hash=i,t.default=i,t.hmac=s;var l=new Uint8Array(t.digestLength);t.hkdf=function(t,e,n,r){void 0===e&&(e=l),void 0===r&&(r=32);for(var i=new Uint8Array([1]),c=s(e,t),u=new o(c),f=new Uint8Array(u.digestLength),d=f.length,h=new Uint8Array(r),p=0;p<r;p++)d===f.length&&(a(f,u,n,i),d=0),h[p]=f[d++];return u.clean(),f.fill(0),i.fill(0),h},t.pbkdf2=function(t,e,n,r){for(var i=new o(t),s=i.digestLength,a=new Uint8Array(4),l=new Uint8Array(s),c=new Uint8Array(s),u=new Uint8Array(r),f=0;f*s<r;f++){var d=f+1;a[0]=d>>>24&255,a[1]=d>>>16&255,a[2]=d>>>8&255,a[3]=d>>>0&255,i.reset(),i.update(e),i.update(a),i.finish(c);for(var h=0;h<s;h++)l[h]=c[h];for(h=2;h<=n;h++){i.reset(),i.update(c).finish(c);for(var p=0;p<s;p++)l[p]^=c[p]}for(h=0;h<s&&f*s+h<r;h++)u[f*s+h]=l[h]}for(f=0;f<s;f++)l[f]=c[f]=0;for(f=0;f<4;f++)a[f]=0;return i.clean(),u}}(i);var s=i.default;for(var a in i)s[a]=i[a];"object"==typeof t.exports?t.exports=s:void 0===(r=function(){return s}.call(i,n,i,t))||(t.exports=r)}()},162:function(t){var e;t.exports=(e=function(t,e){var n=Array.prototype.concat,r=Array.prototype.slice,o=Object.prototype.toString;function i(e,n){var r=e>n?e:n;return t.pow(10,17-~~(t.log(r>0?r:-r)*t.LOG10E))}var s=Array.isArray||function(t){return"[object Array]"===o.call(t)};function a(t){return"[object Function]"===o.call(t)}function l(t){return"number"==typeof t&&t-t==0}function c(){return new c._init(arguments)}function u(){return 0}function f(){return 1}function d(t,e){return t===e?1:0}c.fn=c.prototype,c._init=function(t){if(s(t[0]))if(s(t[0][0])){a(t[1])&&(t[0]=c.map(t[0],t[1]));for(var e=0;e<t[0].length;e++)this[e]=t[0][e];this.length=t[0].length}else this[0]=a(t[1])?c.map(t[0],t[1]):t[0],this.length=1;else if(l(t[0]))this[0]=c.seq.apply(null,t),this.length=1;else{if(t[0]instanceof c)return c(t[0].toArray());this[0]=[],this.length=1}return this},c._init.prototype=c.prototype,c._init.constructor=c,c.utils={calcRdx:i,isArray:s,isFunction:a,isNumber:l,toVector:function(t){return n.apply([],t)}},c._random_fn=t.random,c.setRandom=function(t){if("function"!=typeof t)throw new TypeError("fn is not a function");c._random_fn=t},c.extend=function(t){var e,n;if(1===arguments.length){for(n in t)c[n]=t[n];return this}for(e=1;e<arguments.length;e++)for(n in arguments[e])t[n]=arguments[e][n];return t},c.rows=function(t){return t.length||1},c.cols=function(t){return t[0].length||1},c.dimensions=function(t){return{rows:c.rows(t),cols:c.cols(t)}},c.row=function(t,e){return s(e)?e.map((function(e){return c.row(t,e)})):t[e]},c.rowa=function(t,e){return c.row(t,e)},c.col=function(t,e){if(s(e)){var n=c.arange(t.length).map((function(){return new Array(e.length)}));return e.forEach((function(e,r){c.arange(t.length).forEach((function(o){n[o][r]=t[o][e]}))})),n}for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=[t[o][e]];return r},c.cola=function(t,e){return c.col(t,e).map((function(t){return t[0]}))},c.diag=function(t){for(var e=c.rows(t),n=new Array(e),r=0;r<e;r++)n[r]=[t[r][r]];return n},c.antidiag=function(t){for(var e=c.rows(t)-1,n=new Array(e),r=0;e>=0;e--,r++)n[r]=[t[r][e]];return n},c.transpose=function(t){var e,n,r,o,i,a=[];for(s(t[0])||(t=[t]),n=t.length,r=t[0].length,i=0;i<r;i++){for(e=new Array(n),o=0;o<n;o++)e[o]=t[o][i];a.push(e)}return 1===a.length?a[0]:a},c.map=function(t,e,n){var r,o,i,a,l;for(s(t[0])||(t=[t]),o=t.length,i=t[0].length,a=n?t:new Array(o),r=0;r<o;r++)for(a[r]||(a[r]=new Array(i)),l=0;l<i;l++)a[r][l]=e(t[r][l],r,l);return 1===a.length?a[0]:a},c.cumreduce=function(t,e,n){var r,o,i,a,l;for(s(t[0])||(t=[t]),o=t.length,i=t[0].length,a=n?t:new Array(o),r=0;r<o;r++)for(a[r]||(a[r]=new Array(i)),i>0&&(a[r][0]=t[r][0]),l=1;l<i;l++)a[r][l]=e(a[r][l-1],t[r][l]);return 1===a.length?a[0]:a},c.alter=function(t,e){return c.map(t,e,!0)},c.create=function(t,e,n){var r,o,i=new Array(t);for(a(e)&&(n=e,e=t),r=0;r<t;r++)for(i[r]=new Array(e),o=0;o<e;o++)i[r][o]=n(r,o);return i},c.zeros=function(t,e){return l(e)||(e=t),c.create(t,e,u)},c.ones=function(t,e){return l(e)||(e=t),c.create(t,e,f)},c.rand=function(t,e){return l(e)||(e=t),c.create(t,e,c._random_fn)},c.identity=function(t,e){return l(e)||(e=t),c.create(t,e,d)},c.symmetric=function(t){var e,n,r=t.length;if(t.length!==t[0].length)return!1;for(e=0;e<r;e++)for(n=0;n<r;n++)if(t[n][e]!==t[e][n])return!1;return!0},c.clear=function(t){return c.alter(t,u)},c.seq=function(t,e,n,r){a(r)||(r=!1);var o,s=[],l=i(t,e),c=(e*l-t*l)/((n-1)*l),u=t;for(o=0;u<=e&&o<n;u=(t*l+c*l*++o)/l)s.push(r?r(u,o):u);return s},c.arange=function(t,n,r){var o,i=[];if(r=r||1,n===e&&(n=t,t=0),t===n||0===r)return[];if(t<n&&r<0)return[];if(t>n&&r>0)return[];if(r>0)for(o=t;o<n;o+=r)i.push(o);else for(o=t;o>n;o+=r)i.push(o);return i},c.slice=function(){function t(t,n,r,o){var i,s=[],a=t.length;if(n===e&&r===e&&o===e)return c.copy(t);if(o=o||1,(n=(n=n||0)>=0?n:a+n)===(r=(r=r||t.length)>=0?r:a+r)||0===o)return[];if(n<r&&o<0)return[];if(n>r&&o>0)return[];if(o>0)for(i=n;i<r;i+=o)s.push(t[i]);else for(i=n;i>r;i+=o)s.push(t[i]);return s}return function(e,n){var r,o;return l((n=n||{}).row)?l(n.col)?e[n.row][n.col]:t(c.rowa(e,n.row),(r=n.col||{}).start,r.end,r.step):l(n.col)?t(c.cola(e,n.col),(o=n.row||{}).start,o.end,o.step):(o=n.row||{},r=n.col||{},t(e,o.start,o.end,o.step).map((function(e){return t(e,r.start,r.end,r.step)})))}}(),c.sliceAssign=function(n,r,o){var i,s;if(l(r.row)){if(l(r.col))return n[r.row][r.col]=o;r.col=r.col||{},r.col.start=r.col.start||0,r.col.end=r.col.end||n[0].length,r.col.step=r.col.step||1,i=c.arange(r.col.start,t.min(n.length,r.col.end),r.col.step);var a=r.row;return i.forEach((function(t,e){n[a][t]=o[e]})),n}if(l(r.col)){r.row=r.row||{},r.row.start=r.row.start||0,r.row.end=r.row.end||n.length,r.row.step=r.row.step||1,s=c.arange(r.row.start,t.min(n[0].length,r.row.end),r.row.step);var u=r.col;return s.forEach((function(t,e){n[t][u]=o[e]})),n}return o[0].length===e&&(o=[o]),r.row.start=r.row.start||0,r.row.end=r.row.end||n.length,r.row.step=r.row.step||1,r.col.start=r.col.start||0,r.col.end=r.col.end||n[0].length,r.col.step=r.col.step||1,s=c.arange(r.row.start,t.min(n.length,r.row.end),r.row.step),i=c.arange(r.col.start,t.min(n[0].length,r.col.end),r.col.step),s.forEach((function(t,e){i.forEach((function(r,i){n[t][r]=o[e][i]}))})),n},c.diagonal=function(t){var e=c.zeros(t.length,t.length);return t.forEach((function(t,n){e[n][n]=t})),e},c.copy=function(t){return t.map((function(t){return l(t)?t:t.map((function(t){return t}))}))};var h=c.prototype;return h.length=0,h.push=Array.prototype.push,h.sort=Array.prototype.sort,h.splice=Array.prototype.splice,h.slice=Array.prototype.slice,h.toArray=function(){return this.length>1?r.call(this):r.call(this)[0]},h.map=function(t,e){return c(c.map(this,t,e))},h.cumreduce=function(t,e){return c(c.cumreduce(this,t,e))},h.alter=function(t){return c.alter(this,t),this},function(t){for(var e=0;e<t.length;e++)!function(t){h[t]=function(e){var n,r=this;return e?(setTimeout((function(){e.call(r,h[t].call(r))})),this):(n=c[t](this),s(n)?c(n):n)}}(t[e])}("transpose clear symmetric rows cols dimensions diag antidiag".split(" ")),function(t){for(var e=0;e<t.length;e++)!function(t){h[t]=function(e,n){var r=this;return n?(setTimeout((function(){n.call(r,h[t].call(r,e))})),this):c(c[t](this,e))}}(t[e])}("row col".split(" ")),function(t){for(var e=0;e<t.length;e++)!function(t){h[t]=function(){return c(c[t].apply(null,arguments))}}(t[e])}("create zeros ones rand identity".split(" ")),c}(Math),function(t,e){var n=t.utils.isFunction;function r(t,e){return t-e}function o(t,n,r){return e.max(n,e.min(t,r))}t.sum=function(t){for(var e=0,n=t.length;--n>=0;)e+=t[n];return e},t.sumsqrd=function(t){for(var e=0,n=t.length;--n>=0;)e+=t[n]*t[n];return e},t.sumsqerr=function(e){for(var n,r=t.mean(e),o=0,i=e.length;--i>=0;)o+=(n=e[i]-r)*n;return o},t.sumrow=function(t){for(var e=0,n=t.length;--n>=0;)e+=t[n];return e},t.product=function(t){for(var e=1,n=t.length;--n>=0;)e*=t[n];return e},t.min=function(t){for(var e=t[0],n=0;++n<t.length;)t[n]<e&&(e=t[n]);return e},t.max=function(t){for(var e=t[0],n=0;++n<t.length;)t[n]>e&&(e=t[n]);return e},t.unique=function(t){for(var e={},n=[],r=0;r<t.length;r++)e[t[r]]||(e[t[r]]=!0,n.push(t[r]));return n},t.mean=function(e){return t.sum(e)/e.length},t.meansqerr=function(e){return t.sumsqerr(e)/e.length},t.geomean=function(n){var r=n.map(e.log),o=t.mean(r);return e.exp(o)},t.median=function(t){var e=t.length,n=t.slice().sort(r);return 1&e?n[e/2|0]:(n[e/2-1]+n[e/2])/2},t.cumsum=function(e){return t.cumreduce(e,(function(t,e){return t+e}))},t.cumprod=function(e){return t.cumreduce(e,(function(t,e){return t*e}))},t.diff=function(t){var e,n=[],r=t.length;for(e=1;e<r;e++)n.push(t[e]-t[e-1]);return n},t.rank=function(t){var e,n=[],o={};for(e=0;e<t.length;e++)o[l=t[e]]?o[l]++:(o[l]=1,n.push(l));var i=n.sort(r),s={},a=1;for(e=0;e<i.length;e++){var l,c=o[l=i[e]],u=(a+(a+c-1))/2;s[l]=u,a+=c}return t.map((function(t){return s[t]}))},t.mode=function(t){var e,n=t.length,o=t.slice().sort(r),i=1,s=0,a=0,l=[];for(e=0;e<n;e++)o[e]===o[e+1]?i++:(i>s?(l=[o[e]],s=i,a=0):i===s&&(l.push(o[e]),a++),i=1);return 0===a?l[0]:l},t.range=function(e){return t.max(e)-t.min(e)},t.variance=function(e,n){return t.sumsqerr(e)/(e.length-(n?1:0))},t.pooledvariance=function(e){return e.reduce((function(e,n){return e+t.sumsqerr(n)}),0)/(e.reduce((function(t,e){return t+e.length}),0)-e.length)},t.deviation=function(e){for(var n=t.mean(e),r=e.length,o=new Array(r),i=0;i<r;i++)o[i]=e[i]-n;return o},t.stdev=function(n,r){return e.sqrt(t.variance(n,r))},t.pooledstdev=function(n){return e.sqrt(t.pooledvariance(n))},t.meandev=function(n){for(var r=t.mean(n),o=[],i=n.length-1;i>=0;i--)o.push(e.abs(n[i]-r));return t.mean(o)},t.meddev=function(n){for(var r=t.median(n),o=[],i=n.length-1;i>=0;i--)o.push(e.abs(n[i]-r));return t.median(o)},t.coeffvar=function(e){return t.stdev(e)/t.mean(e)},t.quartiles=function(t){var n=t.length,o=t.slice().sort(r);return[o[e.round(n/4)-1],o[e.round(n/2)-1],o[e.round(3*n/4)-1]]},t.quantiles=function(t,n,i,s){var a,l,c,u,f,d=t.slice().sort(r),h=[n.length],p=t.length;for(void 0===i&&(i=3/8),void 0===s&&(s=3/8),a=0;a<n.length;a++)c=p*(l=n[a])+(i+l*(1-i-s)),u=e.floor(o(c,1,p-1)),f=o(c-u,0,1),h[a]=(1-f)*d[u-1]+f*d[u];return h},t.percentile=function(t,e,n){var o=t.slice().sort(r),i=e*(o.length+(n?1:-1))+(n?0:1),s=parseInt(i),a=i-s;return s+1<o.length?o[s-1]+a*(o[s]-o[s-1]):o[s-1]},t.percentileOfScore=function(t,e,n){var r,o,i=0,s=t.length,a=!1;for("strict"===n&&(a=!0),o=0;o<s;o++)r=t[o],(a&&r<e||!a&&r<=e)&&i++;return i/s},t.histogram=function(n,r){r=r||4;var o,i=t.min(n),s=(t.max(n)-i)/r,a=n.length,l=[];for(o=0;o<r;o++)l[o]=0;for(o=0;o<a;o++)l[e.min(e.floor((n[o]-i)/s),r-1)]+=1;return l},t.covariance=function(e,n){var r,o=t.mean(e),i=t.mean(n),s=e.length,a=new Array(s);for(r=0;r<s;r++)a[r]=(e[r]-o)*(n[r]-i);return t.sum(a)/(s-1)},t.corrcoeff=function(e,n){return t.covariance(e,n)/t.stdev(e,1)/t.stdev(n,1)},t.spearmancoeff=function(e,n){return e=t.rank(e),n=t.rank(n),t.corrcoeff(e,n)},t.stanMoment=function(n,r){for(var o=t.mean(n),i=t.stdev(n),s=n.length,a=0,l=0;l<s;l++)a+=e.pow((n[l]-o)/i,r);return a/n.length},t.skewness=function(e){return t.stanMoment(e,3)},t.kurtosis=function(e){return t.stanMoment(e,4)-3};var i=t.prototype;!function(e){for(var r=0;r<e.length;r++)!function(e){i[e]=function(r,o){var s=[],a=0,l=this;if(n(r)&&(o=r,r=!1),o)return setTimeout((function(){o.call(l,i[e].call(l,r))})),this;if(this.length>1){for(l=!0===r?this:this.transpose();a<l.length;a++)s[a]=t[e](l[a]);return s}return t[e](this[0],r)}}(e[r])}("cumsum cumprod".split(" ")),function(e){for(var r=0;r<e.length;r++)!function(e){i[e]=function(r,o){var s=[],a=0,l=this;if(n(r)&&(o=r,r=!1),o)return setTimeout((function(){o.call(l,i[e].call(l,r))})),this;if(this.length>1){for("sumrow"!==e&&(l=!0===r?this:this.transpose());a<l.length;a++)s[a]=t[e](l[a]);return!0===r?t[e](t.utils.toVector(s)):s}return t[e](this[0],r)}}(e[r])}("sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr geomean median diff rank mode range variance deviation stdev meandev meddev coeffvar quartiles histogram skewness kurtosis".split(" ")),function(e){for(var r=0;r<e.length;r++)!function(e){i[e]=function(){var r,o=[],s=0,a=this,l=Array.prototype.slice.call(arguments);if(n(l[l.length-1])){r=l[l.length-1];var c=l.slice(0,l.length-1);return setTimeout((function(){r.call(a,i[e].apply(a,c))})),this}r=void 0;var u=function(n){return t[e].apply(a,[n].concat(l))};if(this.length>1){for(a=a.transpose();s<a.length;s++)o[s]=u(a[s]);return o}return u(this[0])}}(e[r])}("quantiles percentileOfScore".split(" "))}(e,Math),function(t,e){t.gammaln=function(t){var n,r,o,i=0,s=[76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],a=1.000000000190015;for(o=(r=n=t)+5.5,o-=(n+.5)*e.log(o);i<6;i++)a+=s[i]/++r;return e.log(2.5066282746310007*a/n)-o},t.loggam=function(t){var n,r,o,i,s,a,l,c=[.08333333333333333,-.002777777777777778,.0007936507936507937,-.0005952380952380952,.0008417508417508418,-.001917526917526918,.00641025641025641,-.02955065359477124,.1796443723688307,-1.3924322169059];if(n=t,l=0,1==t||2==t)return 0;for(t<=7&&(n=t+(l=e.floor(7-t))),r=1/(n*n),o=2*e.PI,s=c[9],a=8;a>=0;a--)s*=r,s+=c[a];if(i=s/n+.5*e.log(o)+(n-.5)*e.log(n)-n,t<=7)for(a=1;a<=l;a++)i-=e.log(n-1),n-=1;return i},t.gammafn=function(t){var n,r,o,i,s=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],a=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],l=!1,c=0,u=0,f=0,d=t;if(t>171.6243769536076)return 1/0;if(d<=0){if(!(i=d%1+36e-17))return 1/0;l=(1&d?-1:1)*e.PI/e.sin(e.PI*i),d=1-d}for(o=d,r=d<1?d++:(d-=c=(0|d)-1)-1,n=0;n<8;++n)f=(f+s[n])*r,u=u*r+a[n];if(i=f/u+1,o<d)i/=o;else if(o>d)for(n=0;n<c;++n)i*=d,d++;return l&&(i=l/i),i},t.gammap=function(e,n){return t.lowRegGamma(e,n)*t.gammafn(e)},t.lowRegGamma=function(n,r){var o,i=t.gammaln(n),s=n,a=1/n,l=a,c=r+1-n,u=1/1e-30,f=1/c,d=f,h=1,p=-~(8.5*e.log(n>=1?n:1/n)+.4*n+17);if(r<0||n<=0)return NaN;if(r<n+1){for(;h<=p;h++)a+=l*=r/++s;return a*e.exp(-r+n*e.log(r)-i)}for(;h<=p;h++)d*=(f=1/(f=(o=-h*(h-n))*f+(c+=2)))*(u=c+o/u);return 1-d*e.exp(-r+n*e.log(r)-i)},t.factorialln=function(e){return e<0?NaN:t.gammaln(e+1)},t.factorial=function(e){return e<0?NaN:t.gammafn(e+1)},t.combination=function(n,r){return n>170||r>170?e.exp(t.combinationln(n,r)):t.factorial(n)/t.factorial(r)/t.factorial(n-r)},t.combinationln=function(e,n){return t.factorialln(e)-t.factorialln(n)-t.factorialln(e-n)},t.permutation=function(e,n){return t.factorial(e)/t.factorial(e-n)},t.betafn=function(n,r){if(!(n<=0||r<=0))return n+r>170?e.exp(t.betaln(n,r)):t.gammafn(n)*t.gammafn(r)/t.gammafn(n+r)},t.betaln=function(e,n){return t.gammaln(e)+t.gammaln(n)-t.gammaln(e+n)},t.betacf=function(t,n,r){var o,i,s,a,l=1e-30,c=1,u=n+r,f=n+1,d=n-1,h=1,p=1-u*t/f;for(e.abs(p)<l&&(p=l),a=p=1/p;c<=100&&(p=1+(i=c*(r-c)*t/((d+(o=2*c))*(n+o)))*p,e.abs(p)<l&&(p=l),h=1+i/h,e.abs(h)<l&&(h=l),a*=(p=1/p)*h,p=1+(i=-(n+c)*(u+c)*t/((n+o)*(f+o)))*p,e.abs(p)<l&&(p=l),h=1+i/h,e.abs(h)<l&&(h=l),a*=s=(p=1/p)*h,!(e.abs(s-1)<3e-7));c++);return a},t.gammapinv=function(n,r){var o,i,s,a,l,c,u=0,f=r-1,d=t.gammaln(r);if(n>=1)return e.max(100,r+100*e.sqrt(r));if(n<=0)return 0;for(r>1?(l=e.log(f),c=e.exp(f*(l-1)-d),a=n<.5?n:1-n,o=(2.30753+.27061*(i=e.sqrt(-2*e.log(a))))/(1+i*(.99229+.04481*i))-i,n<.5&&(o=-o),o=e.max(.001,r*e.pow(1-1/(9*r)-o/(3*e.sqrt(r)),3))):o=n<(i=1-r*(.253+.12*r))?e.pow(n/i,1/r):1-e.log(1-(n-i)/(1-i));u<12;u++){if(o<=0)return 0;if((o-=i=(s=(t.lowRegGamma(r,o)-n)/(i=r>1?c*e.exp(-(o-f)+f*(e.log(o)-l)):e.exp(-o+f*e.log(o)-d)))/(1-.5*e.min(1,s*((r-1)/o-1))))<=0&&(o=.5*(o+i)),e.abs(i)<1e-8*o)break}return o},t.erf=function(t){var n,r,o,i,s=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-9.91364156e-10,-2.27365122e-10,96467911e-18,2394038e-18,-6886027e-18,894487e-18,313092e-18,-112708e-18,381e-18,7106e-18,-1523e-18,-94e-18,121e-18,-28e-18],a=s.length-1,l=!1,c=0,u=0;for(t<0&&(t=-t,l=!0),r=4*(n=2/(2+t))-2;a>0;a--)o=c,c=r*c-u+s[a],u=o;return i=n*e.exp(-t*t+.5*(s[0]+r*c)-u),l?i-1:1-i},t.erfc=function(e){return 1-t.erf(e)},t.erfcinv=function(n){var r,o,i,s,a=0;if(n>=2)return-100;if(n<=0)return 100;for(s=n<1?n:2-n,r=-.70711*((2.30753+.27061*(i=e.sqrt(-2*e.log(s/2))))/(1+i*(.99229+.04481*i))-i);a<2;a++)r+=(o=t.erfc(r)-s)/(1.1283791670955126*e.exp(-r*r)-r*o);return n<1?r:-r},t.ibetainv=function(n,r,o){var i,s,a,l,c,u,f,d,h,p,m=r-1,y=o-1,g=0;if(n<=0)return 0;if(n>=1)return 1;for(r>=1&&o>=1?(a=n<.5?n:1-n,u=(2.30753+.27061*(l=e.sqrt(-2*e.log(a))))/(1+l*(.99229+.04481*l))-l,n<.5&&(u=-u),f=(u*u-3)/6,d=2/(1/(2*r-1)+1/(2*o-1)),h=u*e.sqrt(f+d)/d-(1/(2*o-1)-1/(2*r-1))*(f+5/6-2/(3*d)),u=r/(r+o*e.exp(2*h))):(i=e.log(r/(r+o)),s=e.log(o/(r+o)),u=n<(l=e.exp(r*i)/r)/(h=l+(c=e.exp(o*s)/o))?e.pow(r*h*n,1/r):1-e.pow(o*h*(1-n),1/o)),p=-t.gammaln(r)-t.gammaln(o)+t.gammaln(r+o);g<10;g++){if(0===u||1===u)return u;if((u-=l=(c=(t.ibeta(u,r,o)-n)/(l=e.exp(m*e.log(u)+y*e.log(1-u)+p)))/(1-.5*e.min(1,c*(m/u-y/(1-u)))))<=0&&(u=.5*(u+l)),u>=1&&(u=.5*(u+l+1)),e.abs(l)<1e-8*u&&g>0)break}return u},t.ibeta=function(n,r,o){var i=0===n||1===n?0:e.exp(t.gammaln(r+o)-t.gammaln(r)-t.gammaln(o)+r*e.log(n)+o*e.log(1-n));return!(n<0||n>1)&&(n<(r+1)/(r+o+2)?i*t.betacf(n,r,o)/r:1-i*t.betacf(1-n,o,r)/o)},t.randn=function(n,r){var o,i,s,a,l;if(r||(r=n),n)return t.create(n,r,(function(){return t.randn()}));do{o=t._random_fn(),i=1.7156*(t._random_fn()-.5),l=(s=o-.449871)*s+(a=e.abs(i)+.386595)*(.196*a-.25472*s)}while(l>.27597&&(l>.27846||i*i>-4*e.log(o)*o*o));return i/o},t.randg=function(n,r,o){var i,s,a,l,c,u,f=n;if(o||(o=r),n||(n=1),r)return(u=t.zeros(r,o)).alter((function(){return t.randg(n)})),u;n<1&&(n+=1),i=n-1/3,s=1/e.sqrt(9*i);do{do{l=1+s*(c=t.randn())}while(l<=0);l*=l*l,a=t._random_fn()}while(a>1-.331*e.pow(c,4)&&e.log(a)>.5*c*c+i*(1-l+e.log(l)));if(n==f)return i*l;do{a=t._random_fn()}while(0===a);return e.pow(a,1/f)*i*l},function(e){for(var n=0;n<e.length;n++)!function(e){t.fn[e]=function(){return t(t.map(this,(function(n){return t[e](n)})))}}(e[n])}("gammaln gammafn factorial factorialln".split(" ")),function(e){for(var n=0;n<e.length;n++)!function(e){t.fn[e]=function(){return t(t[e].apply(null,arguments))}}(e[n])}("randn".split(" "))}(e,Math),function(t,e){function n(t,n,r,o){for(var i,s=0,a=1,l=1,c=1,u=0,f=0;e.abs((l-f)/l)>o;)f=l,a=c+(i=-(n+u)*(n+r+u)*t/(n+2*u)/(n+2*u+1))*a,l=(s=l+i*s)+(i=(u+=1)*(r-u)*t/(n+2*u-1)/(n+2*u))*l,s/=c=a+i*c,a/=c,l/=c,c=1;return l/n}function r(n,r,o){var i=[.9815606342467192,.9041172563704749,.7699026741943047,.5873179542866175,.3678314989981802,.1252334085114689],s=[.04717533638651183,.10693932599531843,.16007832854334622,.20316742672306592,.2334925365383548,.24914704581340277],a=.5*n;if(a>=8)return 1;var l,c=2*t.normal.cdf(a,0,1,1,0)-1;c=c>=e.exp(-50/o)?e.pow(c,o):0;for(var u=a,f=(8-a)/(l=n>3?2:3),d=u+f,h=0,p=o-1,m=1;m<=l;m++){for(var y=0,g=.5*(d+u),x=.5*(d-u),v=1;v<=12;v++){var T,w=g+x*(6<v?i[(T=12-v+1)-1]:-i[(T=v)-1]),_=w*w;if(_>60)break;var E=2*t.normal.cdf(w,0,1,1,0)*.5-2*t.normal.cdf(w,n,1,1,0)*.5;E>=e.exp(-30/p)&&(y+=E=s[T-1]*e.exp(-.5*_)*e.pow(E,p))}h+=y*=2*x*o/e.sqrt(2*e.PI),u=d,d+=f}return(c+=h)<=e.exp(-30/r)?0:(c=e.pow(c,r))>=1?1:c}!function(e){for(var n=0;n<e.length;n++)!function(e){t[e]=function t(e,n,r){return this instanceof t?(this._a=e,this._b=n,this._c=r,this):new t(e,n,r)},t.fn[e]=function(n,r,o){var i=t[e](n,r,o);return i.data=this,i},t[e].prototype.sample=function(n){var r=this._a,o=this._b,i=this._c;return n?t.alter(n,(function(){return t[e].sample(r,o,i)})):t[e].sample(r,o,i)},function(n){for(var r=0;r<n.length;r++)!function(n){t[e].prototype[n]=function(r){var o=this._a,i=this._b,s=this._c;return r||0===r||(r=this.data),"number"!=typeof r?t.fn.map.call(r,(function(r){return t[e][n](r,o,i,s)})):t[e][n](r,o,i,s)}}(n[r])}("pdf cdf inv".split(" ")),function(n){for(var r=0;r<n.length;r++)!function(n){t[e].prototype[n]=function(){return t[e][n](this._a,this._b,this._c)}}(n[r])}("mean median mode variance".split(" "))}(e[n])}("beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy laplace lognormal noncentralt normal pareto studentt weibull uniform binomial negbin hypgeom poisson triangular tukey arcsine".split(" ")),t.extend(t.beta,{pdf:function(n,r,o){return n>1||n<0?0:1==r&&1==o?1:r<512&&o<512?e.pow(n,r-1)*e.pow(1-n,o-1)/t.betafn(r,o):e.exp((r-1)*e.log(n)+(o-1)*e.log(1-n)-t.betaln(r,o))},cdf:function(e,n,r){return e>1||e<0?1*(e>1):t.ibeta(e,n,r)},inv:function(e,n,r){return t.ibetainv(e,n,r)},mean:function(t,e){return t/(t+e)},median:function(e,n){return t.ibetainv(.5,e,n)},mode:function(t,e){return(t-1)/(t+e-2)},sample:function(e,n){var r=t.randg(e);return r/(r+t.randg(n))},variance:function(t,n){return t*n/(e.pow(t+n,2)*(t+n+1))}}),t.extend(t.centralF,{pdf:function(n,r,o){var i;return n<0?0:r<=2?0===n&&r<2?1/0:0===n&&2===r?1:1/t.betafn(r/2,o/2)*e.pow(r/o,r/2)*e.pow(n,r/2-1)*e.pow(1+r/o*n,-(r+o)/2):(i=r*n/(o+n*r),r*(o/(o+n*r))/2*t.binomial.pdf((r-2)/2,(r+o-2)/2,i))},cdf:function(e,n,r){return e<0?0:t.ibeta(n*e/(n*e+r),n/2,r/2)},inv:function(e,n,r){return r/(n*(1/t.ibetainv(e,n/2,r/2)-1))},mean:function(t,e){return e>2?e/(e-2):void 0},mode:function(t,e){return t>2?e*(t-2)/(t*(e+2)):void 0},sample:function(e,n){return 2*t.randg(e/2)/e/(2*t.randg(n/2)/n)},variance:function(t,e){if(!(e<=4))return 2*e*e*(t+e-2)/(t*(e-2)*(e-2)*(e-4))}}),t.extend(t.cauchy,{pdf:function(t,n,r){return r<0?0:r/(e.pow(t-n,2)+e.pow(r,2))/e.PI},cdf:function(t,n,r){return e.atan((t-n)/r)/e.PI+.5},inv:function(t,n,r){return n+r*e.tan(e.PI*(t-.5))},median:function(t){return t},mode:function(t){return t},sample:function(n,r){return t.randn()*e.sqrt(1/(2*t.randg(.5)))*r+n}}),t.extend(t.chisquare,{pdf:function(n,r){return n<0?0:0===n&&2===r?.5:e.exp((r/2-1)*e.log(n)-n/2-r/2*e.log(2)-t.gammaln(r/2))},cdf:function(e,n){return e<0?0:t.lowRegGamma(n/2,e/2)},inv:function(e,n){return 2*t.gammapinv(e,.5*n)},mean:function(t){return t},median:function(t){return t*e.pow(1-2/(9*t),3)},mode:function(t){return t-2>0?t-2:0},sample:function(e){return 2*t.randg(e/2)},variance:function(t){return 2*t}}),t.extend(t.exponential,{pdf:function(t,n){return t<0?0:n*e.exp(-n*t)},cdf:function(t,n){return t<0?0:1-e.exp(-n*t)},inv:function(t,n){return-e.log(1-t)/n},mean:function(t){return 1/t},median:function(t){return 1/t*e.log(2)},mode:function(){return 0},sample:function(n){return-1/n*e.log(t._random_fn())},variance:function(t){return e.pow(t,-2)}}),t.extend(t.gamma,{pdf:function(n,r,o){return n<0?0:0===n&&1===r?1/o:e.exp((r-1)*e.log(n)-n/o-t.gammaln(r)-r*e.log(o))},cdf:function(e,n,r){return e<0?0:t.lowRegGamma(n,e/r)},inv:function(e,n,r){return t.gammapinv(e,n)*r},mean:function(t,e){return t*e},mode:function(t,e){if(t>1)return(t-1)*e},sample:function(e,n){return t.randg(e)*n},variance:function(t,e){return t*e*e}}),t.extend(t.invgamma,{pdf:function(n,r,o){return n<=0?0:e.exp(-(r+1)*e.log(n)-o/n-t.gammaln(r)+r*e.log(o))},cdf:function(e,n,r){return e<=0?0:1-t.lowRegGamma(n,r/e)},inv:function(e,n,r){return r/t.gammapinv(1-e,n)},mean:function(t,e){return t>1?e/(t-1):void 0},mode:function(t,e){return e/(t+1)},sample:function(e,n){return n/t.randg(e)},variance:function(t,e){if(!(t<=2))return e*e/((t-1)*(t-1)*(t-2))}}),t.extend(t.kumaraswamy,{pdf:function(t,n,r){return 0===t&&1===n?r:1===t&&1===r?n:e.exp(e.log(n)+e.log(r)+(n-1)*e.log(t)+(r-1)*e.log(1-e.pow(t,n)))},cdf:function(t,n,r){return t<0?0:t>1?1:1-e.pow(1-e.pow(t,n),r)},inv:function(t,n,r){return e.pow(1-e.pow(1-t,1/r),1/n)},mean:function(e,n){return n*t.gammafn(1+1/e)*t.gammafn(n)/t.gammafn(1+1/e+n)},median:function(t,n){return e.pow(1-e.pow(2,-1/n),1/t)},mode:function(t,n){if(t>=1&&n>=1&&1!==t&&1!==n)return e.pow((t-1)/(t*n-1),1/t)},variance:function(){throw new Error("variance not yet implemented")}}),t.extend(t.lognormal,{pdf:function(t,n,r){return t<=0?0:e.exp(-e.log(t)-.5*e.log(2*e.PI)-e.log(r)-e.pow(e.log(t)-n,2)/(2*r*r))},cdf:function(n,r,o){return n<0?0:.5+.5*t.erf((e.log(n)-r)/e.sqrt(2*o*o))},inv:function(n,r,o){return e.exp(-1.4142135623730951*o*t.erfcinv(2*n)+r)},mean:function(t,n){return e.exp(t+n*n/2)},median:function(t){return e.exp(t)},mode:function(t,n){return e.exp(t-n*n)},sample:function(n,r){return e.exp(t.randn()*r+n)},variance:function(t,n){return(e.exp(n*n)-1)*e.exp(2*t+n*n)}}),t.extend(t.noncentralt,{pdf:function(n,r,o){return e.abs(o)<1e-14?t.studentt.pdf(n,r):e.abs(n)<1e-14?e.exp(t.gammaln((r+1)/2)-o*o/2-.5*e.log(e.PI*r)-t.gammaln(r/2)):r/n*(t.noncentralt.cdf(n*e.sqrt(1+2/r),r+2,o)-t.noncentralt.cdf(n,r,o))},cdf:function(n,r,o){var i=1e-14;if(e.abs(o)<i)return t.studentt.cdf(n,r);var s=!1;n<0&&(s=!0,o=-o);for(var a=t.normal.cdf(-o,0,1),l=i+1,c=l,u=n*n/(n*n+r),f=0,d=e.exp(-o*o/2),h=e.exp(-o*o/2-.5*e.log(2)-t.gammaln(1.5))*o;f<200||c>i||l>i;)c=l,f>0&&(d*=o*o/(2*f),h*=o*o/(2*(f+.5))),a+=.5*(l=d*t.beta.cdf(u,f+.5,r/2)+h*t.beta.cdf(u,f+1,r/2)),f++;return s?1-a:a}}),t.extend(t.normal,{pdf:function(t,n,r){return e.exp(-.5*e.log(2*e.PI)-e.log(r)-e.pow(t-n,2)/(2*r*r))},cdf:function(n,r,o){return.5*(1+t.erf((n-r)/e.sqrt(2*o*o)))},inv:function(e,n,r){return-1.4142135623730951*r*t.erfcinv(2*e)+n},mean:function(t){return t},median:function(t){return t},mode:function(t){return t},sample:function(e,n){return t.randn()*n+e},variance:function(t,e){return e*e}}),t.extend(t.pareto,{pdf:function(t,n,r){return t<n?0:r*e.pow(n,r)/e.pow(t,r+1)},cdf:function(t,n,r){return t<n?0:1-e.pow(n/t,r)},inv:function(t,n,r){return n/e.pow(1-t,1/r)},mean:function(t,n){if(!(n<=1))return n*e.pow(t,n)/(n-1)},median:function(t,n){return t*(n*e.SQRT2)},mode:function(t){return t},variance:function(t,n){if(!(n<=2))return t*t*n/(e.pow(n-1,2)*(n-2))}}),t.extend(t.studentt,{pdf:function(n,r){return r=r>1e100?1e100:r,1/(e.sqrt(r)*t.betafn(.5,r/2))*e.pow(1+n*n/r,-(r+1)/2)},cdf:function(n,r){var o=r/2;return t.ibeta((n+e.sqrt(n*n+r))/(2*e.sqrt(n*n+r)),o,o)},inv:function(n,r){var o=t.ibetainv(2*e.min(n,1-n),.5*r,.5);return o=e.sqrt(r*(1-o)/o),n>.5?o:-o},mean:function(t){return t>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(n){return t.randn()*e.sqrt(n/(2*t.randg(n/2)))},variance:function(t){return t>2?t/(t-2):t>1?1/0:void 0}}),t.extend(t.weibull,{pdf:function(t,n,r){return t<0||n<0||r<0?0:r/n*e.pow(t/n,r-1)*e.exp(-e.pow(t/n,r))},cdf:function(t,n,r){return t<0?0:1-e.exp(-e.pow(t/n,r))},inv:function(t,n,r){return n*e.pow(-e.log(1-t),1/r)},mean:function(e,n){return e*t.gammafn(1+1/n)},median:function(t,n){return t*e.pow(e.log(2),1/n)},mode:function(t,n){return n<=1?0:t*e.pow((n-1)/n,1/n)},sample:function(n,r){return n*e.pow(-e.log(t._random_fn()),1/r)},variance:function(n,r){return n*n*t.gammafn(1+2/r)-e.pow(t.weibull.mean(n,r),2)}}),t.extend(t.uniform,{pdf:function(t,e,n){return t<e||t>n?0:1/(n-e)},cdf:function(t,e,n){return t<e?0:t<n?(t-e)/(n-e):1},inv:function(t,e,n){return e+t*(n-e)},mean:function(t,e){return.5*(t+e)},median:function(e,n){return t.mean(e,n)},mode:function(){throw new Error("mode is not yet implemented")},sample:function(e,n){return e/2+n/2+(n/2-e/2)*(2*t._random_fn()-1)},variance:function(t,n){return e.pow(n-t,2)/12}}),t.extend(t.binomial,{pdf:function(n,r,o){return 0===o||1===o?r*o===n?1:0:t.combination(r,n)*e.pow(o,n)*e.pow(1-o,r-n)},cdf:function(r,o,i){var s,a=1e-10;if(r<0)return 0;if(r>=o)return 1;if(i<0||i>1||o<=0)return NaN;var l=i,c=(r=e.floor(r))+1,u=o-r,f=c+u,d=e.exp(t.gammaln(f)-t.gammaln(u)-t.gammaln(c)+c*e.log(l)+u*e.log(1-l));return s=l<(c+1)/(f+2)?d*n(l,c,u,a):1-d*n(1-l,u,c,a),e.round(1/a*(1-s))/(1/a)}}),t.extend(t.negbin,{pdf:function(n,r,o){return n===n>>>0&&(n<0?0:t.combination(n+r-1,r-1)*e.pow(1-o,n)*e.pow(o,r))},cdf:function(e,n,r){var o=0,i=0;if(e<0)return 0;for(;i<=e;i++)o+=t.negbin.pdf(i,n,r);return o}}),t.extend(t.hypgeom,{pdf:function(n,r,o,i){if(n!=n|0)return!1;if(n<0||n<o-(r-i))return 0;if(n>i||n>o)return 0;if(2*o>r)return 2*i>r?t.hypgeom.pdf(r-o-i+n,r,r-o,r-i):t.hypgeom.pdf(i-n,r,r-o,i);if(2*i>r)return t.hypgeom.pdf(o-n,r,o,r-i);if(o<i)return t.hypgeom.pdf(n,r,i,o);for(var s=1,a=0,l=0;l<n;l++){for(;s>1&&a<i;)s*=1-o/(r-a),a++;s*=(i-l)*(o-l)/((l+1)*(r-o-i+l+1))}for(;a<i;a++)s*=1-o/(r-a);return e.min(1,e.max(0,s))},cdf:function(n,r,o,i){if(n<0||n<o-(r-i))return 0;if(n>=i||n>=o)return 1;if(2*o>r)return 2*i>r?t.hypgeom.cdf(r-o-i+n,r,r-o,r-i):1-t.hypgeom.cdf(i-n-1,r,r-o,i);if(2*i>r)return 1-t.hypgeom.cdf(o-n-1,r,o,r-i);if(o<i)return t.hypgeom.cdf(n,r,i,o);for(var s=1,a=1,l=0,c=0;c<n;c++){for(;s>1&&l<i;){var u=1-o/(r-l);a*=u,s*=u,l++}s+=a*=(i-c)*(o-c)/((c+1)*(r-o-i+c+1))}for(;l<i;l++)s*=1-o/(r-l);return e.min(1,e.max(0,s))}}),t.extend(t.poisson,{pdf:function(n,r){return r<0||n%1!=0||n<0?0:e.pow(r,n)*e.exp(-r)/t.factorial(n)},cdf:function(e,n){var r=[],o=0;if(e<0)return 0;for(;o<=e;o++)r.push(t.poisson.pdf(o,n));return t.sum(r)},mean:function(t){return t},variance:function(t){return t},sampleSmall:function(n){var r=1,o=0,i=e.exp(-n);do{o++,r*=t._random_fn()}while(r>i);return o-1},sampleLarge:function(n){var r,o,i,s,a,l,c,u,f,d,h=n;for(s=e.sqrt(h),a=e.log(h),l=.02483*(c=.931+2.53*s)-.059,u=1.1239+1.1328/(c-3.4),f=.9277-3.6224/(c-2);;){if(o=e.random()-.5,i=e.random(),d=.5-e.abs(o),r=e.floor((2*l/d+c)*o+h+.43),d>=.07&&i<=f)return r;if(!(r<0||d<.013&&i>d)&&e.log(i)+e.log(u)-e.log(l/(d*d)+c)<=r*a-h-t.loggam(r+1))return r}},sample:function(t){return t<10?this.sampleSmall(t):this.sampleLarge(t)}}),t.extend(t.triangular,{pdf:function(t,e,n,r){return n<=e||r<e||r>n?NaN:t<e||t>n?0:t<r?2*(t-e)/((n-e)*(r-e)):t===r?2/(n-e):2*(n-t)/((n-e)*(n-r))},cdf:function(t,n,r,o){return r<=n||o<n||o>r?NaN:t<=n?0:t>=r?1:t<=o?e.pow(t-n,2)/((r-n)*(o-n)):1-e.pow(r-t,2)/((r-n)*(r-o))},inv:function(t,n,r,o){return r<=n||o<n||o>r?NaN:t<=(o-n)/(r-n)?n+(r-n)*e.sqrt(t*((o-n)/(r-n))):n+(r-n)*(1-e.sqrt((1-t)*(1-(o-n)/(r-n))))},mean:function(t,e,n){return(t+e+n)/3},median:function(t,n,r){return r<=(t+n)/2?n-e.sqrt((n-t)*(n-r))/e.sqrt(2):r>(t+n)/2?t+e.sqrt((n-t)*(r-t))/e.sqrt(2):void 0},mode:function(t,e,n){return n},sample:function(n,r,o){var i=t._random_fn();return i<(o-n)/(r-n)?n+e.sqrt(i*(r-n)*(o-n)):r-e.sqrt((1-i)*(r-n)*(r-o))},variance:function(t,e,n){return(t*t+e*e+n*n-t*e-t*n-e*n)/18}}),t.extend(t.arcsine,{pdf:function(t,n,r){return r<=n?NaN:t<=n||t>=r?0:2/e.PI*e.pow(e.pow(r-n,2)-e.pow(2*t-n-r,2),-.5)},cdf:function(t,n,r){return t<n?0:t<r?2/e.PI*e.asin(e.sqrt((t-n)/(r-n))):1},inv:function(t,n,r){return n+(.5-.5*e.cos(e.PI*t))*(r-n)},mean:function(t,e){return e<=t?NaN:(t+e)/2},median:function(t,e){return e<=t?NaN:(t+e)/2},mode:function(){throw new Error("mode is not yet implemented")},sample:function(n,r){return(n+r)/2+(r-n)/2*e.sin(2*e.PI*t.uniform.sample(0,1))},variance:function(t,n){return n<=t?NaN:e.pow(n-t,2)/8}}),t.extend(t.laplace,{pdf:function(t,n,r){return r<=0?0:e.exp(-e.abs(t-n)/r)/(2*r)},cdf:function(t,n,r){return r<=0?0:t<n?.5*e.exp((t-n)/r):1-.5*e.exp(-(t-n)/r)},mean:function(t){return t},median:function(t){return t},mode:function(t){return t},variance:function(t,e){return 2*e*e},sample:function(n,r){var o,i=t._random_fn()-.5;return n-r*((o=i)/e.abs(o))*e.log(1-2*e.abs(i))}}),t.extend(t.tukey,{cdf:function(n,o,i){var s=o,a=[.9894009349916499,.9445750230732326,.8656312023878318,.755404408355003,.6178762444026438,.45801677765722737,.2816035507792589,.09501250983763744],l=[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685];if(n<=0)return 0;if(i<2||s<2)return NaN;if(!Number.isFinite(n))return 1;if(i>25e3)return r(n,1,s);var c,u=.5*i,f=u*e.log(i)-i*e.log(2)-t.gammaln(u),d=u-1,h=.25*i;c=i<=100?1:i<=800?.5:i<=5e3?.25:.125,f+=e.log(c);for(var p=0,m=1;m<=50;m++){for(var y=0,g=(2*m-1)*c,x=1;x<=16;x++){var v,T;8<x?(v=x-8-1,T=f+d*e.log(g+a[v]*c)-(a[v]*c+g)*h):(v=x-1,T=f+d*e.log(g-a[v]*c)+(a[v]*c-g)*h),T>=-30&&(y+=r(8<x?n*e.sqrt(.5*(a[v]*c+g)):n*e.sqrt(.5*(-a[v]*c+g)),1,s)*l[v]*e.exp(T))}if(m*c>=1&&y<=1e-14)break;p+=y}if(y>1e-14)throw new Error("tukey.cdf failed to converge");return p>1&&(p=1),p},inv:function(n,r,o){if(o<2||r<2)return NaN;if(n<0||n>1)return NaN;if(0===n)return 0;if(1===n)return 1/0;var i,s=function(t,n,r){var o=.5-.5*t,i=e.sqrt(e.log(1/(o*o))),s=i+((((-453642210148e-16*i-.204231210125)*i-.342242088547)*i-1)*i+.322232421088)/((((.0038560700634*i+.10353775285)*i+.531103462366)*i+.588581570495)*i+.099348462606);r<120&&(s+=(s*s*s+s)/r/4);var a=.8832-.2368*s;return r<120&&(a+=-1.214/r+1.208*s/r),s*(a*e.log(n-1)+1.4142)}(n,r,o),a=t.tukey.cdf(s,r,o)-n;i=a>0?e.max(0,s-1):s+1;for(var l,c=t.tukey.cdf(i,r,o)-n,u=1;u<50;u++)if(l=i-c*(i-s)/(c-a),a=c,s=i,l<0&&(l=0,c=-n),c=t.tukey.cdf(l,r,o)-n,i=l,e.abs(i-s)<1e-4)return l;throw new Error("tukey.inv failed to converge")}})}(e,Math),function(t,e){var n,r,o=Array.prototype.push,i=t.utils.isArray;function s(e){return i(e)||e instanceof t}t.extend({add:function(e,n){return s(n)?(s(n[0])||(n=[n]),t.map(e,(function(t,e,r){return t+n[e][r]}))):t.map(e,(function(t){return t+n}))},subtract:function(e,n){return s(n)?(s(n[0])||(n=[n]),t.map(e,(function(t,e,r){return t-n[e][r]||0}))):t.map(e,(function(t){return t-n}))},divide:function(e,n){return s(n)?(s(n[0])||(n=[n]),t.multiply(e,t.inv(n))):t.map(e,(function(t){return t/n}))},multiply:function(e,n){var r,o,i,a,l,c,u,f;if(void 0===e.length&&void 0===n.length)return e*n;if(l=e.length,c=e[0].length,u=t.zeros(l,i=s(n)?n[0].length:c),f=0,s(n)){for(;f<i;f++)for(r=0;r<l;r++){for(a=0,o=0;o<c;o++)a+=e[r][o]*n[o][f];u[r][f]=a}return 1===l&&1===f?u[0][0]:u}return t.map(e,(function(t){return t*n}))},outer:function(e,n){return t.multiply(e.map((function(t){return[t]})),[n])},dot:function(e,n){s(e[0])||(e=[e]),s(n[0])||(n=[n]);for(var r,o,i=1===e[0].length&&1!==e.length?t.transpose(e):e,a=1===n[0].length&&1!==n.length?t.transpose(n):n,l=[],c=0,u=i.length,f=i[0].length;c<u;c++){for(l[c]=[],r=0,o=0;o<f;o++)r+=i[c][o]*a[c][o];l[c]=r}return 1===l.length?l[0]:l},pow:function(n,r){return t.map(n,(function(t){return e.pow(t,r)}))},exp:function(n){return t.map(n,(function(t){return e.exp(t)}))},log:function(n){return t.map(n,(function(t){return e.log(t)}))},abs:function(n){return t.map(n,(function(t){return e.abs(t)}))},norm:function(t,n){var r=0,o=0;for(isNaN(n)&&(n=2),s(t[0])&&(t=t[0]);o<t.length;o++)r+=e.pow(e.abs(t[o]),n);return e.pow(r,1/n)},angle:function(n,r){return e.acos(t.dot(n,r)/(t.norm(n)*t.norm(r)))},aug:function(t,e){var n,r=[];for(n=0;n<t.length;n++)r.push(t[n].slice());for(n=0;n<r.length;n++)o.apply(r[n],e[n]);return r},inv:function(e){for(var n,r=e.length,o=e[0].length,i=t.identity(r,o),s=t.gauss_jordan(e,i),a=[],l=0;l<r;l++)for(a[l]=[],n=o;n<s[0].length;n++)a[l][n-o]=s[l][n];return a},det:function t(e){if(2===e.length)return e[0][0]*e[1][1]-e[0][1]*e[1][0];for(var n=0,r=0;r<e.length;r++){for(var o=[],i=1;i<e.length;i++){o[i-1]=[];for(var s=0;s<e.length;s++)s<r?o[i-1][s]=e[i][s]:s>r&&(o[i-1][s-1]=e[i][s])}var a=r%2?-1:1;n+=t(o)*e[0][r]*a}return n},gauss_elimination:function(n,r){var o,i,s,a,l=0,c=0,u=n.length,f=n[0].length,d=1,h=0,p=[];for(o=(n=t.aug(n,r))[0].length,l=0;l<u;l++){for(i=n[l][l],c=l,a=l+1;a<f;a++)i<e.abs(n[a][l])&&(i=n[a][l],c=a);if(c!=l)for(a=0;a<o;a++)s=n[l][a],n[l][a]=n[c][a],n[c][a]=s;for(c=l+1;c<u;c++)for(d=n[c][l]/n[l][l],a=l;a<o;a++)n[c][a]=n[c][a]-d*n[l][a]}for(l=u-1;l>=0;l--){for(h=0,c=l+1;c<=u-1;c++)h+=p[c]*n[l][c];p[l]=(n[l][o-1]-h)/n[l][l]}return p},gauss_jordan:function(n,r){var o,i,s,a=t.aug(n,r),l=a.length,c=a[0].length,u=0;for(i=0;i<l;i++){var f=i;for(s=i+1;s<l;s++)e.abs(a[s][i])>e.abs(a[f][i])&&(f=s);var d=a[i];for(a[i]=a[f],a[f]=d,s=i+1;s<l;s++)for(u=a[s][i]/a[i][i],o=i;o<c;o++)a[s][o]-=a[i][o]*u}for(i=l-1;i>=0;i--){for(u=a[i][i],s=0;s<i;s++)for(o=c-1;o>i-1;o--)a[s][o]-=a[i][o]*a[s][i]/u;for(a[i][i]/=u,o=l;o<c;o++)a[i][o]/=u}return a},triaUpSolve:function(e,n){var r,o=e[0].length,i=t.zeros(1,o)[0],s=!1;return null!=n[0].length&&(n=n.map((function(t){return t[0]})),s=!0),t.arange(o-1,-1,-1).forEach((function(s){r=t.arange(s+1,o).map((function(t){return i[t]*e[s][t]})),i[s]=(n[s]-t.sum(r))/e[s][s]})),s?i.map((function(t){return[t]})):i},triaLowSolve:function(e,n){var r,o=e[0].length,i=t.zeros(1,o)[0],s=!1;return null!=n[0].length&&(n=n.map((function(t){return t[0]})),s=!0),t.arange(o).forEach((function(o){r=t.arange(o).map((function(t){return e[o][t]*i[t]})),i[o]=(n[o]-t.sum(r))/e[o][o]})),s?i.map((function(t){return[t]})):i},lu:function(e){var n,r=e.length,o=t.identity(r),i=t.zeros(e.length,e[0].length);return t.arange(r).forEach((function(t){i[0][t]=e[0][t]})),t.arange(1,r).forEach((function(s){t.arange(s).forEach((function(r){n=t.arange(r).map((function(t){return o[s][t]*i[t][r]})),o[s][r]=(e[s][r]-t.sum(n))/i[r][r]})),t.arange(s,r).forEach((function(r){n=t.arange(s).map((function(t){return o[s][t]*i[t][r]})),i[s][r]=e[n.length][r]-t.sum(n)}))})),[o,i]},cholesky:function(n){var r,o=n.length,i=t.zeros(n.length,n[0].length);return t.arange(o).forEach((function(s){r=t.arange(s).map((function(t){return e.pow(i[s][t],2)})),i[s][s]=e.sqrt(n[s][s]-t.sum(r)),t.arange(s+1,o).forEach((function(e){r=t.arange(s).map((function(t){return i[s][t]*i[e][t]})),i[e][s]=(n[s][e]-t.sum(r))/i[s][s]}))})),i},gauss_jacobi:function(n,r,o,i){for(var s,a,l,c,u=0,f=0,d=n.length,h=[],p=[],m=[];u<d;u++)for(h[u]=[],p[u]=[],m[u]=[],f=0;f<d;f++)u>f?(h[u][f]=n[u][f],p[u][f]=m[u][f]=0):u<f?(p[u][f]=n[u][f],h[u][f]=m[u][f]=0):(m[u][f]=n[u][f],h[u][f]=p[u][f]=0);for(l=t.multiply(t.multiply(t.inv(m),t.add(h,p)),-1),a=t.multiply(t.inv(m),r),s=o,c=t.add(t.multiply(l,o),a),u=2;e.abs(t.norm(t.subtract(c,s)))>i;)s=c,c=t.add(t.multiply(l,s),a),u++;return c},gauss_seidel:function(n,r,o,i){for(var s,a,l,c,u,f=0,d=n.length,h=[],p=[],m=[];f<d;f++)for(h[f]=[],p[f]=[],m[f]=[],s=0;s<d;s++)f>s?(h[f][s]=n[f][s],p[f][s]=m[f][s]=0):f<s?(p[f][s]=n[f][s],h[f][s]=m[f][s]=0):(m[f][s]=n[f][s],h[f][s]=p[f][s]=0);for(c=t.multiply(t.multiply(t.inv(t.add(m,h)),p),-1),l=t.multiply(t.inv(t.add(m,h)),r),a=o,u=t.add(t.multiply(c,o),l),f=2;e.abs(t.norm(t.subtract(u,a)))>i;)a=u,u=t.add(t.multiply(c,a),l),f+=1;return u},SOR:function(n,r,o,i,s){for(var a,l,c,u,f,d=0,h=n.length,p=[],m=[],y=[];d<h;d++)for(p[d]=[],m[d]=[],y[d]=[],a=0;a<h;a++)d>a?(p[d][a]=n[d][a],m[d][a]=y[d][a]=0):d<a?(m[d][a]=n[d][a],p[d][a]=y[d][a]=0):(y[d][a]=n[d][a],p[d][a]=m[d][a]=0);for(u=t.multiply(t.inv(t.add(y,t.multiply(p,s))),t.subtract(t.multiply(y,1-s),t.multiply(m,s))),c=t.multiply(t.multiply(t.inv(t.add(y,t.multiply(p,s))),r),s),l=o,f=t.add(t.multiply(u,o),c),d=2;e.abs(t.norm(t.subtract(f,l)))>i;)l=f,f=t.add(t.multiply(u,l),c),d++;return f},householder:function(n){for(var r,o,i,s,a=n.length,l=n[0].length,c=0,u=[],f=[];c<a-1;c++){for(r=0,s=c+1;s<l;s++)r+=n[s][c]*n[s][c];for(r=(n[c+1][c]>0?-1:1)*e.sqrt(r),o=e.sqrt((r*r-n[c+1][c]*r)/2),(u=t.zeros(a,1))[c+1][0]=(n[c+1][c]-r)/(2*o),i=c+2;i<a;i++)u[i][0]=n[i][c]/(2*o);f=t.subtract(t.identity(a,l),t.multiply(t.multiply(u,t.transpose(u)),2)),n=t.multiply(f,t.multiply(n,f))}return n},QR:(n=t.sum,r=t.arange,function(o){var i,s,a,l=o.length,c=o[0].length,u=t.zeros(c,c);for(o=t.copy(o),s=0;s<c;s++){for(u[s][s]=e.sqrt(n(r(l).map((function(t){return o[t][s]*o[t][s]})))),i=0;i<l;i++)o[i][s]=o[i][s]/u[s][s];for(a=s+1;a<c;a++)for(u[s][a]=n(r(l).map((function(t){return o[t][s]*o[t][a]}))),i=0;i<l;i++)o[i][a]=o[i][a]-o[i][s]*u[s][a]}return[o,u]}),lstsq:function(e,n){var r=!1;void 0===n[0].length&&(n=n.map((function(t){return[t]})),r=!0);var o=t.QR(e),i=o[0],s=o[1],a=e[0].length,l=t.slice(i,{col:{end:a}}),c=function(e){var n=(e=t.copy(e)).length,r=t.identity(n);return t.arange(n-1,-1,-1).forEach((function(n){t.sliceAssign(r,{row:n},t.divide(t.slice(r,{row:n}),e[n][n])),t.sliceAssign(e,{row:n},t.divide(t.slice(e,{row:n}),e[n][n])),t.arange(n).forEach((function(o){var i=t.multiply(e[o][n],-1),s=t.slice(e,{row:o}),a=t.multiply(t.slice(e,{row:n}),i);t.sliceAssign(e,{row:o},t.add(s,a));var l=t.slice(r,{row:o}),c=t.multiply(t.slice(r,{row:n}),i);t.sliceAssign(r,{row:o},t.add(l,c))}))})),r}(t.slice(s,{row:{end:a}})),u=t.transpose(l);void 0===u[0].length&&(u=[u]);var f=t.multiply(t.multiply(c,u),n);return void 0===f.length&&(f=[[f]]),r?f.map((function(t){return t[0]})):f},jacobi:function(n){for(var r,o,i,s,a,l,c,u=1,f=n.length,d=t.identity(f,f),h=[];1===u;){for(a=n[0][1],i=0,s=1,r=0;r<f;r++)for(o=0;o<f;o++)r!=o&&a<e.abs(n[r][o])&&(a=e.abs(n[r][o]),i=r,s=o);for(l=n[i][i]===n[s][s]?n[i][s]>0?e.PI/4:-e.PI/4:e.atan(2*n[i][s]/(n[i][i]-n[s][s]))/2,(c=t.identity(f,f))[i][i]=e.cos(l),c[i][s]=-e.sin(l),c[s][i]=e.sin(l),c[s][s]=e.cos(l),d=t.multiply(d,c),n=t.multiply(t.multiply(t.inv(c),n),c),u=0,r=1;r<f;r++)for(o=1;o<f;o++)r!=o&&e.abs(n[r][o])>.001&&(u=1)}for(r=0;r<f;r++)h.push(n[r][r]);return[d,h]},rungekutta:function(t,e,n,r,o,i){var s,a,l;if(2===i)for(;r<=n;)o+=((s=e*t(r,o))+(a=e*t(r+e,o+s)))/2,r+=e;if(4===i)for(;r<=n;)o+=((s=e*t(r,o))+2*(a=e*t(r+e/2,o+s/2))+2*(l=e*t(r+e/2,o+a/2))+e*t(r+e,o+l))/6,r+=e;return o},romberg:function(t,n,r,o){for(var i,s,a,l,c,u=0,f=(r-n)/2,d=[],h=[],p=[];u<o/2;){for(c=t(n),a=n,l=0;a<=r;a+=f,l++)d[l]=a;for(i=d.length,a=1;a<i-1;a++)c+=(a%2!=0?4:2)*t(d[a]);c=f/3*(c+t(r)),p[u]=c,f/=2,u++}for(s=p.length,i=1;1!==s;){for(a=0;a<s-1;a++)h[a]=(e.pow(4,i)*p[a+1]-p[a])/(e.pow(4,i)-1);s=h.length,p=h,h=[],i++}return p},richardson:function(t,n,r,o){function i(t,e){for(var n,r=0,o=t.length;r<o;r++)t[r]===e&&(n=r);return n}for(var s,a,l,c,u,f=e.abs(r-t[i(t,r)+1]),d=0,h=[],p=[];o>=f;)s=i(t,r+o),a=i(t,r),h[d]=(n[s]-2*n[a]+n[2*a-s])/(o*o),o/=2,d++;for(c=h.length,l=1;1!=c;){for(u=0;u<c-1;u++)p[u]=(e.pow(4,l)*h[u+1]-h[u])/(e.pow(4,l)-1);c=p.length,h=p,p=[],l++}return h},simpson:function(t,e,n,r){for(var o,i=(n-e)/r,s=t(e),a=[],l=e,c=0,u=1;l<=n;l+=i,c++)a[c]=l;for(o=a.length;u<o-1;u++)s+=(u%2!=0?4:2)*t(a[u]);return i/3*(s+t(n))},hermite:function(t,e,n,r){for(var o,i=t.length,s=0,a=0,l=[],c=[],u=[],f=[];a<i;a++){for(l[a]=1,o=0;o<i;o++)a!=o&&(l[a]*=(r-t[o])/(t[a]-t[o]));for(c[a]=0,o=0;o<i;o++)a!=o&&(c[a]+=1/(t[a]-t[o]));u[a]=(1-2*(r-t[a])*c[a])*(l[a]*l[a]),f[a]=(r-t[a])*(l[a]*l[a]),s+=u[a]*e[a]+f[a]*n[a]}return s},lagrange:function(t,e,n){for(var r,o,i=0,s=0,a=t.length;s<a;s++){for(o=e[s],r=0;r<a;r++)s!=r&&(o*=(n-t[r])/(t[s]-t[r]));i+=o}return i},cubic_spline:function(e,n,r){for(var o,i,s=e.length,a=0,l=[],c=[],u=[],f=[],d=[],h=[];a<s-1;a++)f[a]=e[a+1]-e[a];for(u[0]=0,a=1;a<s-1;a++)u[a]=3/f[a]*(n[a+1]-n[a])-3/f[a-1]*(n[a]-n[a-1]);for(a=1;a<s-1;a++)l[a]=[],c[a]=[],l[a][a-1]=f[a-1],l[a][a]=2*(f[a-1]+f[a]),l[a][a+1]=f[a],c[a][0]=u[a];for(i=t.multiply(t.inv(l),c),o=0;o<s-1;o++)d[o]=(n[o+1]-n[o])/f[o]-f[o]*(i[o+1][0]+2*i[o][0])/3,h[o]=(i[o+1][0]-i[o][0])/(3*f[o]);for(o=0;o<s&&!(e[o]>r);o++);return n[o-=1]+(r-e[o])*d[o]+t.sq(r-e[o])*i[o]+(r-e[o])*t.sq(r-e[o])*h[o]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(e){var n,r,o,i,s,a=e.length,l=e[0].length,c=0,u=[],f=[],d=[],h=[],p=[],m=[],y=[];for(c=0;c<a;c++)u[c]=t.sum(e[c])/l;for(c=0;c<l;c++)for(p[c]=[],n=0;n<a;n++)p[c][n]=e[n][c]-u[n];for(p=t.transpose(p),c=0;c<a;c++)for(m[c]=[],n=0;n<a;n++)m[c][n]=t.dot([p[c]],[p[n]])/(l-1);for(s=(o=t.jacobi(m))[0],f=o[1],y=t.transpose(s),c=0;c<f.length;c++)for(n=c;n<f.length;n++)f[c]<f[n]&&(r=f[c],f[c]=f[n],f[n]=r,d=y[c],y[c]=y[n],y[n]=d);for(i=t.transpose(p),c=0;c<a;c++)for(h[c]=[],n=0;n<i.length;n++)h[c][n]=t.dot([y[c]],[i[n]]);return[e,f,y,h]}}),function(e){for(var n=0;n<e.length;n++)!function(e){t.fn[e]=function(n,r){var o=this;return r?(setTimeout((function(){r.call(o,t.fn[e].call(o,n))}),15),this):"number"==typeof t[e](this,n)?t[e](this,n):t(t[e](this,n))}}(e[n])}("add divide multiply subtract dot pow exp log abs norm angle".split(" "))}(e,Math),function(t,e){var n=[].slice,r=t.utils.isNumber,o=t.utils.isArray;function i(t,n,r,o){if(t>1||r>1||t<=0||r<=0)throw new Error("Proportions should be greater than 0 and less than 1");var i=(t*n+r*o)/(n+o);return(t-r)/e.sqrt(i*(1-i)*(1/n+1/o))}t.extend({zscore:function(){var e=n.call(arguments);return r(e[1])?(e[0]-e[1])/e[2]:(e[0]-t.mean(e[1]))/t.stdev(e[1],e[2])},ztest:function(){var r,i=n.call(arguments);return o(i[1])?(r=t.zscore(i[0],i[1],i[3]),1===i[2]?t.normal.cdf(-e.abs(r),0,1):2*t.normal.cdf(-e.abs(r),0,1)):i.length>2?(r=t.zscore(i[0],i[1],i[2]),1===i[3]?t.normal.cdf(-e.abs(r),0,1):2*t.normal.cdf(-e.abs(r),0,1)):(r=i[0],1===i[1]?t.normal.cdf(-e.abs(r),0,1):2*t.normal.cdf(-e.abs(r),0,1))}}),t.extend(t.fn,{zscore:function(t,e){return(t-this.mean())/this.stdev(e)},ztest:function(n,r,o){var i=e.abs(this.zscore(n,o));return 1===r?t.normal.cdf(-i,0,1):2*t.normal.cdf(-i,0,1)}}),t.extend({tscore:function(){var r=n.call(arguments);return 4===r.length?(r[0]-r[1])/(r[2]/e.sqrt(r[3])):(r[0]-t.mean(r[1]))/(t.stdev(r[1],!0)/e.sqrt(r[1].length))},ttest:function(){var o,i=n.call(arguments);return 5===i.length?(o=e.abs(t.tscore(i[0],i[1],i[2],i[3])),1===i[4]?t.studentt.cdf(-o,i[3]-1):2*t.studentt.cdf(-o,i[3]-1)):r(i[1])?(o=e.abs(i[0]),1==i[2]?t.studentt.cdf(-o,i[1]-1):2*t.studentt.cdf(-o,i[1]-1)):(o=e.abs(t.tscore(i[0],i[1])),1==i[2]?t.studentt.cdf(-o,i[1].length-1):2*t.studentt.cdf(-o,i[1].length-1))}}),t.extend(t.fn,{tscore:function(t){return(t-this.mean())/(this.stdev(!0)/e.sqrt(this.cols()))},ttest:function(n,r){return 1===r?1-t.studentt.cdf(e.abs(this.tscore(n)),this.cols()-1):2*t.studentt.cdf(-e.abs(this.tscore(n)),this.cols()-1)}}),t.extend({anovafscore:function(){var r,o,i,s,a,l,c,u,f=n.call(arguments);if(1===f.length){for(a=new Array(f[0].length),c=0;c<f[0].length;c++)a[c]=f[0][c];f=a}for(o=new Array,c=0;c<f.length;c++)o=o.concat(f[c]);for(i=t.mean(o),r=0,c=0;c<f.length;c++)r+=f[c].length*e.pow(t.mean(f[c])-i,2);for(r/=f.length-1,l=0,c=0;c<f.length;c++)for(s=t.mean(f[c]),u=0;u<f[c].length;u++)l+=e.pow(f[c][u]-s,2);return r/(l/(o.length-f.length))},anovaftest:function(){var e,o,i,s,a=n.call(arguments);if(r(a[0]))return 1-t.centralF.cdf(a[0],a[1],a[2]);var l=t.anovafscore(a);for(e=a.length-1,i=0,s=0;s<a.length;s++)i+=a[s].length;return o=i-e-1,1-t.centralF.cdf(l,e,o)},ftest:function(e,n,r){return 1-t.centralF.cdf(e,n,r)}}),t.extend(t.fn,{anovafscore:function(){return t.anovafscore(this.toArray())},anovaftes:function(){var e,n=0;for(e=0;e<this.length;e++)n+=this[e].length;return t.ftest(this.anovafscore(),this.length-1,n-this.length)}}),t.extend({qscore:function(){var o,i,s,a,l,c=n.call(arguments);return r(c[0])?(o=c[0],i=c[1],s=c[2],a=c[3],l=c[4]):(o=t.mean(c[0]),i=t.mean(c[1]),s=c[0].length,a=c[1].length,l=c[2]),e.abs(o-i)/(l*e.sqrt((1/s+1/a)/2))},qtest:function(){var e,r=n.call(arguments);3===r.length?(e=r[0],r=r.slice(1)):7===r.length?(e=t.qscore(r[0],r[1],r[2],r[3],r[4]),r=r.slice(5)):(e=t.qscore(r[0],r[1],r[2]),r=r.slice(3));var o=r[0],i=r[1];return 1-t.tukey.cdf(e,i,o-i)},tukeyhsd:function(e){for(var n=t.pooledstdev(e),r=e.map((function(e){return t.mean(e)})),o=e.reduce((function(t,e){return t+e.length}),0),i=[],s=0;s<e.length;++s)for(var a=s+1;a<e.length;++a){var l=t.qtest(r[s],r[a],e[s].length,e[a].length,n,o,e.length);i.push([[s,a],l])}return i}}),t.extend({normalci:function(){var r,o=n.call(arguments),i=new Array(2);return r=4===o.length?e.abs(t.normal.inv(o[1]/2,0,1)*o[2]/e.sqrt(o[3])):e.abs(t.normal.inv(o[1]/2,0,1)*t.stdev(o[2])/e.sqrt(o[2].length)),i[0]=o[0]-r,i[1]=o[0]+r,i},tci:function(){var r,o=n.call(arguments),i=new Array(2);return r=4===o.length?e.abs(t.studentt.inv(o[1]/2,o[3]-1)*o[2]/e.sqrt(o[3])):e.abs(t.studentt.inv(o[1]/2,o[2].length-1)*t.stdev(o[2],!0)/e.sqrt(o[2].length)),i[0]=o[0]-r,i[1]=o[0]+r,i},significant:function(t,e){return t<e}}),t.extend(t.fn,{normalci:function(e,n){return t.normalci(e,n,this.toArray())},tci:function(e,n){return t.tci(e,n,this.toArray())}}),t.extend(t.fn,{oneSidedDifferenceOfProportions:function(e,n,r,o){var s=i(e,n,r,o);return t.ztest(s,1)},twoSidedDifferenceOfProportions:function(e,n,r,o){var s=i(e,n,r,o);return t.ztest(s,2)}})}(e,Math),e.models=function(){function t(t,n){var r=t.length,o=n[0].length-1,i=r-o-1,s=e.lstsq(n,t),a=e.multiply(n,s.map((function(t){return[t]}))).map((function(t){return t[0]})),l=e.subtract(t,a),c=e.mean(t),u=e.sum(a.map((function(t){return Math.pow(t-c,2)}))),f=e.sum(t.map((function(t,e){return Math.pow(t-a[e],2)}))),d=u+f;return{exog:n,endog:t,nobs:r,df_model:o,df_resid:i,coef:s,predict:a,resid:l,ybar:c,SST:d,SSE:u,SSR:f,R2:u/d}}function n(n){var r,o,i=(r=n.exog,o=r[0].length,e.arange(o).map((function(n){var i=e.arange(o).filter((function(t){return t!==n}));return t(e.col(r,n).map((function(t){return t[0]})),e.col(r,i))}))),s=Math.sqrt(n.SSR/n.df_resid),a=i.map((function(t){var e=t.SST,n=t.R2;return s/Math.sqrt(e*(1-n))})),l=n.coef.map((function(t,e){return(t-0)/a[e]})),c=l.map((function(t){var r=e.studentt.cdf(t,n.df_resid);return 2*(r>.5?1-r:r)})),u=e.studentt.inv(.975,n.df_resid),f=n.coef.map((function(t,e){var n=u*a[e];return[t-n,t+n]}));return{se:a,t:l,p:c,sigmaHat:s,interval95:f}}return{ols:function(r,o){var i=t(r,o),s=n(i),a=function(t){var n,r,o,i=t.R2/t.df_model/((1-t.R2)/t.df_resid);return{F_statistic:i,pvalue:1-(n=i,r=t.df_model,o=t.df_resid,e.beta.cdf(n/(o/r+n),r/2,o/2))}}(i),l=1-(1-i.R2)*((i.nobs-1)/i.df_resid);return i.t=s,i.f=a,i.adjust_R2=l,i}}}(),e.extend({buildxmatrix:function(){for(var t=new Array(arguments.length),n=0;n<arguments.length;n++)t[n]=[1].concat(arguments[n]);return e(t)},builddxmatrix:function(){for(var t=new Array(arguments[0].length),n=0;n<arguments[0].length;n++)t[n]=[1].concat(arguments[0][n]);return e(t)},buildjxmatrix:function(t){for(var n=new Array(t.length),r=0;r<t.length;r++)n[r]=t[r];return e.builddxmatrix(n)},buildymatrix:function(t){return e(t).transpose()},buildjymatrix:function(t){return t.transpose()},matrixmult:function(t,n){var r,o,i,s,a;if(t.cols()==n.rows()){if(n.rows()>1){for(s=[],r=0;r<t.rows();r++)for(s[r]=[],o=0;o<n.cols();o++){for(a=0,i=0;i<t.cols();i++)a+=t.toArray()[r][i]*n.toArray()[i][o];s[r][o]=a}return e(s)}for(s=[],r=0;r<t.rows();r++)for(s[r]=[],o=0;o<n.cols();o++){for(a=0,i=0;i<t.cols();i++)a+=t.toArray()[r][i]*n.toArray()[o];s[r][o]=a}return e(s)}},regress:function(t,n){var r=e.xtranspxinv(t),o=t.transpose(),i=e.matrixmult(e(r),o);return e.matrixmult(i,n)},regresst:function(t,n,r){var o=e.regress(t,n),i={anova:{}},s=e.jMatYBar(t,o);i.yBar=s;var a=n.mean();i.anova.residuals=e.residuals(n,s),i.anova.ssr=e.ssr(s,a),i.anova.msr=i.anova.ssr/(t[0].length-1),i.anova.sse=e.sse(n,s),i.anova.mse=i.anova.sse/(n.length-(t[0].length-1)-1),i.anova.sst=e.sst(n,a),i.anova.mst=i.anova.sst/(n.length-1),i.anova.r2=1-i.anova.sse/i.anova.sst,i.anova.r2<0&&(i.anova.r2=0),i.anova.fratio=i.anova.msr/i.anova.mse,i.anova.pvalue=e.anovaftest(i.anova.fratio,t[0].length-1,n.length-(t[0].length-1)-1),i.anova.rmse=Math.sqrt(i.anova.mse),i.anova.r2adj=1-i.anova.mse/i.anova.mst,i.anova.r2adj<0&&(i.anova.r2adj=0),i.stats=new Array(t[0].length);for(var l,c,u,f=e.xtranspxinv(t),d=0;d<o.length;d++)l=Math.sqrt(i.anova.mse*Math.abs(f[d][d])),c=Math.abs(o[d]/l),u=e.ttest(c,n.length-t[0].length-1,r),i.stats[d]=[o[d],l,c,u];return i.regress=o,i},xtranspx:function(t){return e.matrixmult(t.transpose(),t)},xtranspxinv:function(t){var n=e.matrixmult(t.transpose(),t);return e.inv(n)},jMatYBar:function(t,n){var r=e.matrixmult(t,n);return new e(r)},residuals:function(t,n){return e.matrixsubtract(t,n)},ssr:function(t,e){for(var n=0,r=0;r<t.length;r++)n+=Math.pow(t[r]-e,2);return n},sse:function(t,e){for(var n=0,r=0;r<t.length;r++)n+=Math.pow(t[r]-e[r],2);return n},sst:function(t,e){for(var n=0,r=0;r<t.length;r++)n+=Math.pow(t[r]-e,2);return n},matrixsubtract:function(t,n){for(var r=new Array(t.length),o=0;o<t.length;o++){r[o]=new Array(t[o].length);for(var i=0;i<t[o].length;i++)r[o][i]=t[o][i]-n[o][i]}return e(r)}}),e.jStat=e,e)},184:(t,e,n)=>{"use strict";n.d(e,{$:()=>s});var r=n(976),o=n(870),i=n(874);class s extends r.JsViewer{constructor(t){super(),this.canvas=o.canvas(),this.gridCellStyle=r.GridCellStyle.create(),this.renderer=t,this.root.append(this.canvas),this.canvas.style.width="100%",this.canvas.style.height="100%",o.tools.handleResize(this.canvas,((t,e)=>{this.canvas.width=t,this.canvas.height=e,this.render()}));const e=t=>e=>{this.gridCell&&t(this.gridCell,e)};this.canvas.onmousemove=e(this.renderer.onMouseMove),this.canvas.onmouseenter=e(this.renderer.onMouseEnter),this.canvas.onmouseleave=e(this.renderer.onMouseLeave)}static fromGridCell(t){const e=new s(new i.cv);return e.gridCell=t,e.render(),e}render(){if(!this.gridCell)return;const t=this.canvas.getContext("2d");t.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderer.renderInternal(t,0,0,this.canvas.width,this.canvas.height,this.gridCell.dart,this.gridCellStyle)}}},638:(t,e,n)=>{"use strict";n.d(e,{d:()=>r});class r{}r.TAG_FIT_CHART_FORMAT=".fitChartFormat",r.TAG_FIT_CHART_FORMAT_3DX="3dx",r.FIT_SEM_TYPE="fit",r.FIT_CELL_TYPE="fit",r.TAG_FIT=".fit",r.CELL_DEFAULT_WIDTH=230,r.CELL_DEFAULT_HEIGHT=160,r.MIN_CELL_RENDERER_PX_WIDTH=20,r.MIN_CELL_RENDERER_PX_HEIGHT=10,r.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH=70,r.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT=45,r.MIN_AXES_CELL_PX_WIDTH=100,r.MIN_AXES_CELL_PX_HEIGHT=55,r.MIN_TITLE_PX_WIDTH=275,r.MIN_TITLE_PX_HEIGHT=225,r.MIN_X_AXIS_NAME_VISIBILITY_PX_WIDTH=180,r.MIN_Y_AXIS_NAME_VISIBILITY_PX_HEIGHT=140,r.MIN_LEGEND_PX_WIDTH=325,r.MIN_LEGEND_PX_HEIGHT=275,r.MIN_DROPLINES_VISIBILITY_PX_WIDTH=120,r.MIN_DROPLINES_VISIBILITY_PX_HEIGHT=110,r.AXES_LEFT_PX_MARGIN=38,r.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS=45,r.AXES_TOP_PX_MARGIN=5,r.AXES_TOP_PX_MARGIN_WITH_TITLE=25,r.AXES_RIGHT_PX_MARGIN=18,r.AXES_BOTTOM_PX_MARGIN=15,r.AXES_BOTTOM_PX_MARGIN_WITH_AXES_LABELS=30,r.X_AXIS_LABEL_BOTTOM_PX_MARGIN=4,r.LEGEND_TOP_PX_MARGIN=10,r.OUTLIER_PX_SIZE=12,r.POINT_PX_SIZE=4,r.OUTLIER_HITBOX_RADIUS=2,r.CANDLESTICK_BORDER_PX_SIZE=4,r.CANDLESTICK_MEDIAN_PX_SIZE=3.5,r.CANDLESTICK_OUTLIER_PX_SIZE=6,r.INFLATE_SIZE=-6,r.LEGEND_RECORD_PX_HEIGHT=18,r.LEGEND_RECORD_LINE_PX_WIDTH=20,r.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN=5,r.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN=4,r.LINE_STYLES={solid:[],dotted:[1,1],dashed:[5,5],dashdotted:[5,5,2,5]},r.CURVE_CONFIDENCE_INTERVAL_BOUNDS={TOP:"top",BOTTOM:"bottom"},r.CONFIDENCE_INTERVAL_STROKE_COLOR="rgba(255,191,63,0.4)",r.CONFIDENCE_INTERVAL_FILL_COLOR="rgba(255,238,204,0.3)",r.CONDITION_MAP={"No series to show":t=>void 0===t||0===(null==t?void 0:t.length),"There were series with no points":t=>t.some((t=>{var e;return 0===(null===(e=t.points)||void 0===e?void 0:e.length)})),"There were series with all x zeroes":t=>t.some((t=>{var e;return null===(e=t.points)||void 0===e?void 0:e.every((t=>0===t.x))})),"There were series with all y zeroes":t=>t.some((t=>{var e;return null===(e=t.points)||void 0===e?void 0:e.every((t=>0===t.y))}))}},840:(t,e,n)=>{"use strict";n.d(e,{YC:()=>c,lf:()=>u});var r=n(976),o=(n(469),n(363),n(102)),i=n(414),s=n.n(i),a=n(638);function l(t,e){return Math.random()*(e-t)+t}function c(t,e,n=1){const r=new Float32Array(t*n),i=new Float32Array(t*n),s=[l(1,2),l(1,2),l(1,2),l(-5,5)],a=0-Math.floor(t/2)*e,c=a+e*(t-1);for(let t=a,l=0;t<=c;t+=e,l++)for(let e=0;e<n;e++){r[l*n+e]=t-a+.1;const c=new Float32Array(4);c.set(s),i[l*n+e]=(0,o.XD)(c,t)}const u=(1===n?.2:.4)*(Math.max(...i)-Math.min(...i)),f=Math.min(...i);for(let t=0;t<r.length;t++)i[t]=-f+i[t]+l(0,u);return{x:r,y:i,params:s}}function u(t,e,n){var o;const i=r.DataFrame.create(t);for(let l=0;l<e;l++){const e=3===l?5:1,u=i.columns.addNewString(`json chart ${l}`);u.semType=a.d.FIT_SEM_TYPE;let f=l%2==0?n:1;for(let i=0;i<t;i++){const t={series:[],chartOptions:{showStatistics:1===f?["auc"]:[],xAxisName:"Conc.",yAxisName:"Activity",title:"Dose-Response curves"}};for(let i=0;i<f;i++){const a=c(15,.5,e);let u=r.Color.toHtml(r.Color.getCategoricalColor(l*n+i));null===(o=t.series)||void 0===o||o.push({parameters:void 0,fitLineColor:u,pointColor:u,showCurveConfidenceInterval:1===f,points:s().count().take(15*e).map((function(t){return{x:a.x[t],y:a.y[t]}})).toArray()})}u.set(i,JSON.stringify(t))}}return i}},188:(t,e,n)=>{"use strict";n.d(e,{No:()=>l,hS:()=>a});var r,o=n(976),i=(n(870),n(416));n(102),n(874),n(184),n(711),n(638),function(t){t.DATAFRAME="Dataframe",t.COLUMN="Column",t.CELL="Cell"}(r||(r={}));const s={count:"totalCount",nulls:"missingValueCount",unique:"uniqueCount",values:"valueCount",min:"min",max:"max",sum:"sum",avg:"avg",stdev:"stdev",variance:"variance",skew:"skew",kurt:"kurt",med:"med",q1:"q1",q2:"q2",q3:"q3"};function a(t,e){const n=(0,i.Y6)(t);if(t.parameters)e.logX&&t.parameters[2]>0&&(t.parameters[2]=Math.log10(t.parameters[2]));else{const r=(0,i.PK)(t,n,e).parameters;t.parameters=[...r]}return(0,i.tq)(t,n,e)}function l(t,e){var n,r,i;const l={logX:null===(n=t.chartOptions)||void 0===n?void 0:n.logX,logY:null===(r=t.chartOptions)||void 0===r?void 0:r.logY},c=[],u=[],f=[],d=[],h=[],p=[],m=[];for(let e=0,n=0;e<(null===(i=t.series)||void 0===i?void 0:i.length);e++){if(t.series[e].points.every((t=>t.outlier)))continue;const r=a(t.series[e],l);c[n]=r.rSquared,u[n]=r.auc,f[n]=r.interceptX,d[n]=r.interceptY,h[n]=r.slope,p[n]=r.top,m[n]=r.bottom,n++}return{rSquared:c.some((t=>null==t))?void 0:o.Stats.fromValues(c)[s[e]],auc:u.some((t=>null==t))?void 0:o.Stats.fromValues(u)[s[e]],interceptX:f.some((t=>null==t))?void 0:o.Stats.fromValues(f)[s[e]],interceptY:d.some((t=>null==t))?void 0:o.Stats.fromValues(d)[s[e]],slope:h.some((t=>null==t))?void 0:o.Stats.fromValues(h)[s[e]],top:p.some((t=>null==t))?void 0:o.Stats.fromValues(p)[s[e]],bottom:m.some((t=>null==t))?void 0:o.Stats.fromValues(m)[s[e]]}}o.ObjectHandler},711:(t,e,n)=>{"use strict";n.d(e,{f:()=>c});var r=n(976),o=n(102);const i={x:"xAxis",y:"yAxis"},s={min:"min",max:"max"};function a(t){var e,n,i;const s=null===(n=null===(e=t.getElementsByTagName("params")[0])||void 0===e?void 0:e.childNodes[0].nodeValue)||void 0===n?void 0:n.split(",").map(Number);let a=null===(i=t.getElementsByTagName("function")[0])||void 0===i?void 0:i.getAttribute("type");a=a&&"sigif"!==a?a:o.yB;const l=t.getElementsByTagName("settings")[0].getAttribute("markerColor"),c=t.getElementsByTagName("settings")[0].getAttribute("color"),u=!!t.getElementsByTagName("settings")[0].getAttribute("drawLine"),f={name:t.getAttribute("name"),fitFunction:a,markerType:r.MARKER_TYPE.CIRCLE,pointColor:l,fitLineColor:c,showFitLine:u,showPoints:"points",showCurveConfidenceInterval:!1,clickToToggle:!1};return s&&(f.parameters=[s[2],s[1],s[0],s[3]]),f}function l(t){const e=function(t){var e,n,r;const o=null===(e=t.getElementsByTagName("x")[0].childNodes[0].nodeValue)||void 0===e?void 0:e.split(","),i=null===(n=t.getElementsByTagName("y")[0].childNodes[0].nodeValue)||void 0===n?void 0:n.split(","),s=null===(r=t.getElementsByTagName("mask")[0].childNodes[0].nodeValue)||void 0===r?void 0:r.split(""),a=[];for(let t=0;t<o.length;t++)a[t]={x:+o[t],y:+i[t],outlier:!Boolean(s[t])};return a}(t),n=a(t),r={points:e};return Object.assign(r,n),r}function c(t){const e=(new DOMParser).parseFromString(t,"text/xml"),n=e.getElementsByTagName("grid")[0],r=(c=e.getElementsByTagName("settings")[0],{minX:+(o=n).getElementsByTagName(i.x)[0].getAttribute(s.min),minY:+o.getElementsByTagName(i.y)[0].getAttribute(s.min),maxX:+o.getElementsByTagName(i.x)[0].getAttribute(s.max),maxY:+o.getElementsByTagName(i.y)[0].getAttribute(s.max),xAxisName:c.getAttribute("xLabel"),yAxisName:c.getAttribute("yLabel"),logX:!!c.getAttribute("logX")});var o,c;const u=e.getElementsByTagName("seriesCollection")[0],f=a(u.getElementsByTagName("series")[0]),d=function(t){const e=[],n=t.getElementsByTagName("series").length;for(let r=0;r<n;r++){const n=t.getElementsByTagName("series")[r];e[r]=l(n)}return e}(u);return{chartOptions:r,seriesOptions:f,series:d}}},874:(t,e,n)=>{"use strict";n.d(e,{cv:()=>B,W$:()=>R,hq:()=>X,jG:()=>M,fi:()=>D,Ce:()=>F,BI:()=>P,kb:()=>G});var r=n(976),o=n(469),i=n(870),s=n(102),a=n(766),l=n(416),c=n(711),u=n(184),f=n(188),d=n(638),h=n(111);const p=window,m=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});class y{static getUniqueName(t,e,n){return p.grok_Utils_GetUniqueName(t,e,null==n?void 0:n.auto,null==n?void 0:n.idx,null==n?void 0:n.render,null==n?void 0:n.choices)}static isEmpty(t){return null==t||""==t}static formatNumber(t){return m.format(t)}}function g(t,e){const n=t.pointColor&&r.Color.fromHtml(t.pointColor)?t.pointColor:r.Color.toHtml(r.Color.getCategoricalColor(e)),o=t.outlierColor&&r.Color.fromHtml(t.outlierColor)?t.outlierColor:r.Color.toHtml(r.Color.red),i=t.fitLineColor&&r.Color.fromHtml(t.fitLineColor)?t.fitLineColor:r.Color.toHtml(r.Color.getCategoricalColor(e));t.pointColor=n,t.outlierColor=o,t.fitLineColor=i}function x(t,e,n){var r;if(null!==(r=e.connectDots)&&void 0!==r&&r){t.strokeStyle=e.pointColor,t.lineWidth=2*n.ratio,t.beginPath();for(let r=0;r<e.points.length;r++){const o=e.points[r].x,i=e.points[r].y,s=n.viewport.xToScreen(o),a=n.viewport.yToScreen(i);0===r?t.moveTo(s,a):t.lineTo(s,a)}t.stroke()}}function v(t,e,n){var o;(null===(o=e.showPoints)||void 0===o||o)&&(t.strokeStyle=e.pointColor,e.connectDots&&""!==e.showPoints||"points"===e.showPoints?function(t,e,n){for(let o=0;o<e.points.length;o++){const i=e.points[o],s=e.connectDots?e.pointColor:i.outlier?i.outlierColor&&r.Color.fromHtml(i.outlierColor)?i.outlierColor:e.outlierColor:i.color&&r.Color.fromHtml(i.color)?i.color:e.pointColor,a=i.marker?i.marker:e.markerType,l=i.outlierMarker?i.outlierMarker:e.outlierMarkerType,c=e.connectDots?d.d.POINT_PX_SIZE*n.ratio:i.outlier?d.d.OUTLIER_PX_SIZE*n.ratio:i.size?i.size:d.d.POINT_PX_SIZE*n.ratio;r.Paint.marker(t,e.connectDots?a:i.outlier?l:a,n.viewport.xToScreen(i.x),n.viewport.yToScreen(i.y),s,c),i.stdev&&!i.outlier&&(t.strokeStyle=s,t.beginPath(),t.moveTo(n.viewport.xToScreen(i.x),n.viewport.yToScreen(i.y+i.stdev)),t.lineTo(n.viewport.xToScreen(i.x),n.viewport.yToScreen(i.y-i.stdev)),t.stroke())}}(t,e,n):["candlesticks","both"].includes(e.showPoints)&&function(t,e,n){for(let o=0,i=null;o<e.points.length;o++){const s=e.points[o];if(s.outlier)continue;const a=o+1<e.points.length&&e.points[o+1].x===s.x;if(!i&&a)i=o;else if(null!==i&&!a){const a=[];for(let t=i,n=0;t<=o;t++,n++)a[n]=e.points[t].y;const l=(0,h.G)(a);if(t.beginPath(),T(t,{viewport:n.viewport,ratio:n.ratio,x:s.x,boxPlotStats:l,color:e.pointColor}),t.stroke(),"both"===e.showPoints)for(let o=0;o<a.length;o++)(a[o]<l.lowerAdjacentValue||a[o]>l.upperAdjacentValue)&&r.Paint.marker(t,r.MARKER_TYPE.OUTLIER,n.viewport.xToScreen(s.x),n.viewport.yToScreen(a[o]),e.pointColor,d.d.CANDLESTICK_OUTLIER_PX_SIZE*n.ratio);i=null}}}(t,e,n))}function T(t,e){w(t,e.x,e.boxPlotStats.lowerAdjacentValue,e.viewport),t.moveTo(e.viewport.xToScreen(e.x),e.viewport.yToScreen(e.boxPlotStats.lowerAdjacentValue)),t.lineTo(e.viewport.xToScreen(e.x),e.viewport.yToScreen(e.boxPlotStats.upperAdjacentValue)),w(t,e.x,e.boxPlotStats.upperAdjacentValue,e.viewport),r.Paint.marker(t,r.MARKER_TYPE.CIRCLE,e.viewport.xToScreen(e.x),e.viewport.yToScreen(e.boxPlotStats.q2),e.color,d.d.CANDLESTICK_MEDIAN_PX_SIZE*e.ratio)}function w(t,e,n,r){t.moveTo(r.xToScreen(e)-d.d.CANDLESTICK_BORDER_PX_SIZE/2,r.yToScreen(n)),t.lineTo(r.xToScreen(e)+d.d.CANDLESTICK_BORDER_PX_SIZE/2,r.yToScreen(n))}function _(t,e,n){var r;if(null===(r=e.showFitLine)||void 0===r||r){t.save(),t.strokeStyle=e.fitLineColor,t.lineWidth=2*n.ratio,t.beginPath(),e.lineStyle&&t.setLineDash(d.d.LINE_STYLES[e.lineStyle]);const r=n.showAxes?n.showAxesLabels?d.d.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:d.d.AXES_LEFT_PX_MARGIN:0,o=n.showAxes?d.d.AXES_RIGHT_PX_MARGIN:0;for(let e=r;e<=n.screenBounds.width-o;e++){const o=n.screenBounds.x+e,i=n.logOptions.logX?Math.log10(n.viewport.xToWorld(o)):n.viewport.xToWorld(o),s=n.logOptions.logY?n.viewport.yToScreen(Math.pow(10,n.curveFunc(i))):n.viewport.yToScreen(n.curveFunc(i));e===r?t.moveTo(o,s):t.lineTo(o,s)}t.stroke(),t.restore()}}function E(t,e,n){var r,o,i,s;if((null===(r=e.showFitLine)||void 0===r||r)&&null!==(o=e.showCurveConfidenceInterval)&&void 0!==o&&o){t.strokeStyle=null!==(i=e.confidenceIntervalColor)&&void 0!==i?i:d.d.CONFIDENCE_INTERVAL_STROKE_COLOR,t.fillStyle=null!==(s=e.confidenceIntervalColor)&&void 0!==s?s:d.d.CONFIDENCE_INTERVAL_FILL_COLOR;const r=(0,l.LC)(e,n.fitFunc,n.userParamsFlag,n.logOptions);I(t,{viewport:n.viewport,logOptions:n.logOptions,showAxes:n.showAxes,showAxesLabels:n.showAxesLabels,screenBounds:n.screenBounds,confidenceIntervals:r,confidenceType:d.d.CURVE_CONFIDENCE_INTERVAL_BOUNDS.TOP}),I(t,{viewport:n.viewport,logOptions:n.logOptions,showAxes:n.showAxes,showAxesLabels:n.showAxesLabels,screenBounds:n.screenBounds,confidenceIntervals:r,confidenceType:d.d.CURVE_CONFIDENCE_INTERVAL_BOUNDS.BOTTOM}),function(t,e){t.beginPath();const n=e.showAxes?e.showAxesLabels?d.d.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:d.d.AXES_LEFT_PX_MARGIN:0,r=e.showAxes?d.d.AXES_RIGHT_PX_MARGIN:0;for(let o=n;o<=e.screenBounds.width-r;o++){const r=e.screenBounds.x+o,i=e.logOptions.logX?Math.log10(e.viewport.xToWorld(r)):e.viewport.xToWorld(r),s=e.logOptions.logY?e.viewport.yToScreen(Math.pow(10,e.confidenceIntervals.confidenceTop(i))):e.viewport.yToScreen(e.confidenceIntervals.confidenceTop(i));o===n?t.moveTo(r,s):t.lineTo(r,s)}for(let o=e.screenBounds.width-r;o>=n;o--){const n=e.screenBounds.x+o,r=e.logOptions.logX?Math.log10(e.viewport.xToWorld(n)):e.viewport.xToWorld(n),i=e.logOptions.logY?e.viewport.yToScreen(Math.pow(10,e.confidenceIntervals.confidenceBottom(r))):e.viewport.yToScreen(e.confidenceIntervals.confidenceBottom(r));t.lineTo(n,i)}t.closePath(),t.fill()}(t,{viewport:n.viewport,logOptions:n.logOptions,showAxes:n.showAxes,showAxesLabels:n.showAxesLabels,screenBounds:n.screenBounds,confidenceIntervals:r})}}function I(t,e){t.beginPath();const n=e.showAxes?e.showAxesLabels?d.d.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:d.d.AXES_LEFT_PX_MARGIN:0,r=e.showAxes?d.d.AXES_RIGHT_PX_MARGIN:0,o=e.confidenceType===d.d.CURVE_CONFIDENCE_INTERVAL_BOUNDS.TOP?e.confidenceIntervals.confidenceTop:e.confidenceIntervals.confidenceBottom;for(let i=n;i<=e.screenBounds.width-r;i++){const r=e.screenBounds.x+i,s=e.logOptions.logX?Math.log10(e.viewport.xToWorld(r)):e.viewport.xToWorld(r),a=e.logOptions.logY?e.viewport.yToScreen(Math.pow(10,o(s))):e.viewport.yToScreen(o(s));i===n?t.moveTo(r,a):t.lineTo(r,a)}t.stroke()}function C(t,e,n){var r;if((null===(r=e.showFitLine)||void 0===r||r)&&e.droplines&&n.showDroplines){t.save(),t.strokeStyle="blue",t.lineWidth=n.ratio,t.beginPath(),t.setLineDash([5,5]);for(let r=0;r<e.droplines.length;r++)"IC50"===e.droplines[r]&&A(t,{viewport:n.viewport,xValue:e.parameters[2],dataBounds:n.dataBounds,curveFunc:n.curveFunc,logOptions:n.logOptions});t.stroke(),t.restore()}}function A(t,e){e.logOptions.logX&&(e.xValue=Math.pow(10,e.xValue));const n=e.logOptions.logX?Math.log10(e.xValue):e.xValue,r=e.logOptions.logY?Math.pow(10,e.curveFunc(n)):e.curveFunc(n);t.moveTo(e.viewport.xToScreen(e.dataBounds.minX),e.viewport.yToScreen(r)),t.lineTo(e.viewport.xToScreen(e.xValue),e.viewport.yToScreen(r)),t.lineTo(e.viewport.xToScreen(e.xValue),e.viewport.yToScreen(e.dataBounds.minY))}function N(t,e,n){var r;if((null===(r=e.showFitLine)||void 0===r||r)&&n.statistics){const r=(0,l.tq)(e,n.fitFunc,n.logOptions);for(let o=0;o<n.statistics.length;o++){const i=n.statistics[o],a=s.sw.find((t=>t.name===i));if(a){const i=y.formatNumber(a.get(r));t.fillStyle=e.fitLineColor,t.textAlign="left",t.fillText(a.name+": "+i,n.dataBox.x+5,n.dataBox.y+20+20*o)}}}}function b(t,e,n){t.beginPath(),t.fillStyle="black";const r=t.measureText(e).width;t.fillText(e,n.dataBox.maxX-r,n.dataBox.y+d.d.LEGEND_TOP_PX_MARGIN+(n.columnIdx*d.d.LEGEND_RECORD_PX_HEIGHT+d.d.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend))}function L(t,e,n){t.beginPath(),t.strokeStyle=e.fitLineColor,t.lineWidth=2*n.ratio;const o=t.measureText(e.name).width;t.moveTo(n.dataBox.maxX-o-d.d.LEGEND_RECORD_LINE_PX_WIDTH-d.d.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN,n.dataBox.y+d.d.LEGEND_TOP_PX_MARGIN-d.d.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(n.showColumnLabel?d.d.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+d.d.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend),t.lineTo(n.dataBox.maxX-o-d.d.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN,n.dataBox.y+d.d.LEGEND_TOP_PX_MARGIN-d.d.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(n.showColumnLabel?d.d.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+d.d.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend);const i=e.markerType?e.markerType:r.MARKER_TYPE.CIRCLE;r.Paint.marker(t,i,n.dataBox.maxX-o-d.d.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN-d.d.LEGEND_RECORD_LINE_PX_WIDTH/2,n.dataBox.y+d.d.LEGEND_TOP_PX_MARGIN-d.d.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(n.showColumnLabel?d.d.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+d.d.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend,e.pointColor,d.d.POINT_PX_SIZE*n.ratio),t.fillStyle=e.fitLineColor,t.fillText(e.name,n.dataBox.maxX-o,n.dataBox.y+d.d.LEGEND_TOP_PX_MARGIN+(n.showColumnLabel?d.d.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+d.d.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend),t.stroke()}function S(t,e){var n;r.Paint.marker(t,r.MARKER_TYPE.OUTLIER,e.midX,e.midY,r.Color.red,(n=.8*Math.min(e.width,e.height),0,30,Math.min(Math.max(n,0),30)))}function P(t,e,n){if(e&&n)for(const r of t)!(r.name in n)&&r.name in e&&(n[r.name]=e[r.name])}function O(t){if(0===t.length)return null;const e={points:[],name:t[0].name,fitFunction:t[0].fitFunction,markerType:t[0].markerType,lineStyle:t[0].lineStyle,pointColor:t[0].pointColor,fitLineColor:t[0].fitLineColor,confidenceIntervalColor:t[0].confidenceIntervalColor,outlierColor:t[0].outlierColor,connectDots:t[0].connectDots,showFitLine:t[0].showFitLine,showPoints:t[0].showPoints,showCurveConfidenceInterval:t[0].showCurveConfidenceInterval,errorModel:t[0].errorModel,clickToToggle:t[0].clickToToggle,labels:t[0].labels,droplines:t[0].droplines,columnName:t[0].columnName};for(const n of t)e.points=[...e.points,...n.points];return e}function R(t){var e,n,o,i,a;let u=t.cell.value;u.includes("|")&&(u=u.replaceAll("|",""));const f=(null===(n=null===(e=t.cell)||void 0===e?void 0:e.column)||void 0===n?void 0:n.type)===r.TYPE.STRING?t.cell.column.getTag(d.d.TAG_FIT_CHART_FORMAT)===d.d.TAG_FIT_CHART_FORMAT_3DX?(0,c.f)(u):null!==(o=JSON.parse(null!=u?u:"{}"))&&void 0!==o?o:{}:(0,l.TL)(),h=t.cell.column?X(t.cell.column):{},p=t.cell.column?M(t.cell.dataFrame):{};null!==(i=f.series)&&void 0!==i||(f.series=[]),null!==(a=f.chartOptions)&&void 0!==a||(f.chartOptions=h.chartOptions),P(s.kW,h.chartOptions,f.chartOptions),P(s.kW,p.chartOptions,f.chartOptions);for(const t of f.series)P(s.K0,f.seriesOptions,t),P(s.K0,h.seriesOptions,t),P(s.K0,p.seriesOptions,t);return f}function M(t){var e,n,r;return JSON.parse(null!==(e=(n=t.tags)[r=d.d.TAG_FIT])&&void 0!==e?e:n[r]=JSON.stringify((0,l.TL)()))}function X(t){var e,n,r;return JSON.parse(null!==(e=(n=t.tags)[r=d.d.TAG_FIT])&&void 0!==e?e:n[r]=JSON.stringify((0,l.TL)()))}function F(t,e,n){if(t.width<d.d.MIN_AXES_CELL_PX_WIDTH||t.height<d.d.MIN_AXES_CELL_PX_HEIGHT)return[t,void 0,void 0];const r=e?d.d.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:d.d.AXES_LEFT_PX_MARGIN,o=e?d.d.AXES_BOTTOM_PX_MARGIN_WITH_AXES_LABELS:d.d.AXES_BOTTOM_PX_MARGIN,i=n?d.d.AXES_TOP_PX_MARGIN_WITH_TITLE:d.d.AXES_TOP_PX_MARGIN;return[t.cutLeft(r).cutBottom(o).cutTop(i).cutRight(d.d.AXES_RIGHT_PX_MARGIN),t.getBottom(o).getTop(i).cutLeft(r).cutRight(d.d.AXES_RIGHT_PX_MARGIN),t.getLeft(r).getRight(d.d.AXES_RIGHT_PX_MARGIN).cutBottom(o).cutTop(i)]}function D(t){return null!=t&&""!==t&&void 0!==r.Color.fromHtml(t)}function G(t){var e;for(let n=0;n<(null===(e=t.series)||void 0===e?void 0:e.length);n++){const e=t.series[n];if(e.points.every((t=>0!==t.x)))continue;let r=Number.MAX_VALUE,o=0,i=0;const s=[];for(let t=0;t<e.points.length;t++)e.points[t].x<r&&0!==e.points[t].x&&(r=e.points[t].x),e.points[t].x>o&&0!==e.points[t].x&&(o=e.points[t].x),s.includes(e.points[t].x)||(s[s.length]=e.points[t].x,i++);const a=Math.pow(10,Math.log10(r)-(Math.log10(o)-Math.log10(r)/(i-1)));for(let t=0;t<e.points.length;t++)0===e.points[t].x&&(e.points[t].x=a)}}class B extends r.GridCellRenderer{get name(){return d.d.FIT_CELL_TYPE}get cellType(){return d.d.FIT_CELL_TYPE}getDefaultSize(t){return{width:d.d.CELL_DEFAULT_WIDTH,height:d.d.CELL_DEFAULT_HEIGHT}}onClick(t,e){var n,r,s,u,h,p,m;if(!t.cell.value)return;const y=t.cell.column.getTag(d.d.TAG_FIT_CHART_FORMAT)===d.d.TAG_FIT_CHART_FORMAT_3DX?(0,c.f)(t.cell.value):R(t);for(const[t,e]of Object.entries(d.d.CONDITION_MAP))if(e(y.series))return void(o.shell.o=i.divText(t,{style:{color:"red"}}));o.shell.o=t;const g=t.bounds.inflate(d.d.INFLATE_SIZE,d.d.INFLATE_SIZE),x=F(g,this.areAxesLabelsShown(g,y),this.isTitleShown(g,y))[0],v=(0,l.dU)(y),T=new a.l(v,x,null!==(r=null===(n=y.chartOptions)||void 0===n?void 0:n.logX)&&void 0!==r&&r,null!==(u=null===(s=y.chartOptions)||void 0===s?void 0:s.logY)&&void 0!==u&&u);for(let n=0;n<(null===(h=y.series)||void 0===h?void 0:h.length);n++)if(!(y.series[n].connectDots||!y.series[n].clickToToggle||"points"!==y.series[n].showPoints||g.width<d.d.MIN_AXES_CELL_PX_WIDTH||g.height<d.d.MIN_AXES_CELL_PX_HEIGHT))for(let r=0;r<y.series[n].points.length;r++){const o=y.series[n].points[r];if(this.hitTest(e,o,T)){o.outlier=!o.outlier;const e=t.grid.dataFrame.columns.byTags({".sourceColumn":t.cell.column.name});if(e)for(const r of e){const e={logX:null===(p=y.chartOptions)||void 0===p?void 0:p.logX,logY:null===(m=y.chartOptions)||void 0===m?void 0:m.logY},o=null!==r.tags[".seriesAggregation"]?(0,f.No)(y,r.tags[".seriesAggregation"]):r.tags[".seriesNumber"]===n?(0,f.hS)(y.series[n],e):null;null!==o&&r.set(t.cell.rowIndex,o[r.tags[".statistics"]])}if(t.cell.column.getTag(d.d.TAG_FIT_CHART_FORMAT)!==d.d.TAG_FIT_CHART_FORMAT_3DX){const e=JSON.parse(t.cell.value);e.series[n].points[r].outlier=o.outlier,t.cell.value=JSON.stringify(e)}return}}}onDoubleClick(t,e){if(!t.cell.value)return;const n=u.$.fromGridCell(t),r=i.dialog({title:"Edit chart"}).add(n.root).show({resizable:!0}).root.getElementsByClassName("d4-dialog-contents dlg-edit-chart")[0].firstChild;n.canvas.width=r.clientWidth,n.canvas.height=r.clientHeight,n.render(),r.style.width="100%",r.style.height="100%",i.tools.handleResize(r,((t,e)=>{n.canvas.width=t,n.canvas.height=e,n.render()}))}areAxesShown(t){return t.width>=d.d.MIN_AXES_CELL_PX_WIDTH&&t.height>=d.d.MIN_AXES_CELL_PX_HEIGHT}areAxesLabelsShown(t,e){var n;return t.width>=d.d.MIN_X_AXIS_NAME_VISIBILITY_PX_WIDTH&&t.height>=d.d.MIN_Y_AXIS_NAME_VISIBILITY_PX_HEIGHT&&!!(null===(n=e.chartOptions)||void 0===n?void 0:n.xAxisName)&&!!e.chartOptions.yAxisName}isTitleShown(t,e){var n;return t.width>=d.d.MIN_TITLE_PX_WIDTH&&t.height>=d.d.MIN_TITLE_PX_HEIGHT&&!!(null===(n=e.chartOptions)||void 0===n?void 0:n.title)}isLegendShown(t){return t.width>=d.d.MIN_LEGEND_PX_WIDTH&&t.height>=d.d.MIN_LEGEND_PX_HEIGHT}areDroplinesShown(t){return t.width>=d.d.MIN_DROPLINES_VISIBILITY_PX_WIDTH&&t.height>=d.d.MIN_DROPLINES_VISIBILITY_PX_HEIGHT}renderCurves(t,e,n){var r,o,i,s,c,u,f,h,p,m,y,T,w,I,A;t.save(),t.beginPath(),t.rect(e.x,e.y,e.width,e.height),t.clip(),(null===(r=n.chartOptions)||void 0===r?void 0:r.allowXZeroes)&&(null===(o=n.chartOptions)||void 0===o?void 0:o.logX)&&(null===(i=n.series)||void 0===i?void 0:i.some((t=>t.points.some((t=>0===t.x)))))&&G(n);const[S,P,O]=F(e,this.areAxesLabelsShown(e,n),this.isTitleShown(e,n)),R=(0,l.dU)(n);(R.x<0&&n.chartOptions||0===R.x&&n.chartOptions&&!n.chartOptions.allowXZeroes)&&(n.chartOptions.logX=!1),R.y<=0&&n.chartOptions&&(n.chartOptions.logY=!1);const M=new a.l(R,S,null!==(c=null===(s=n.chartOptions)||void 0===s?void 0:s.logX)&&void 0!==c&&c,null!==(f=null===(u=n.chartOptions)||void 0===u?void 0:u.logY)&&void 0!==f&&f),X=Math.min(S.width,S.height),D=X>100?1:.2+X/100*.8,B={logX:null===(h=n.chartOptions)||void 0===h?void 0:h.logX,logY:null===(p=n.chartOptions)||void 0===p?void 0:p.logY};t.save(),t.font='11px Roboto, "Roboto Local"',M.drawCoordinateGrid(t,P,O),t.restore();for(let r=0;r<(null===(m=n.series)||void 0===m?void 0:m.length);r++){const o=n.series[r];if(o.points.some((t=>void 0===t.x||void 0===t.y)))continue;(e.width<d.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH||e.height<d.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT)&&(o.showPoints="",n.chartOptions&&(n.chartOptions.showStatistics=[])),o.points.sort(((t,e)=>t.x-e.x));let i=!0;const s=(0,l.Y6)(o);let a=null;if(!o.connectDots||o.showFitLine)if(o.parameters)(null===(y=n.chartOptions)||void 0===y?void 0:y.logX)&&o.parameters[2]>0&&(o.parameters[2]=Math.log10(o.parameters[2])),a=(0,l.kG)(o,s);else{const t=(0,l.PK)(o,s,B);a=t.fittedCurve;const e=[...t.parameters];o.parameters=e,i=!1}g(o,r),x(t,o,{viewport:M,ratio:D}),v(t,o,{viewport:M,ratio:D}),_(t,o,{viewport:M,ratio:D,logOptions:B,showAxes:this.areAxesShown(e),showAxesLabels:this.areAxesLabelsShown(e,n),screenBounds:e,curveFunc:a}),E(t,o,{viewport:M,logOptions:B,showAxes:this.areAxesShown(e),showAxesLabels:this.areAxesLabelsShown(e,n),screenBounds:e,fitFunc:s,userParamsFlag:i}),o.parameters&&C(t,o,{viewport:M,ratio:D,showDroplines:this.areDroplinesShown(e),xValue:o.parameters[2],dataBounds:R,curveFunc:a,logOptions:B}),N(t,o,{statistics:null===(T=n.chartOptions)||void 0===T?void 0:T.showStatistics,fitFunc:s,logOptions:B,dataBox:S})}!function(t,e){e.showTitle&&(t.font='12px Roboto, "Roboto Local"',t.textAlign="center",t.fillStyle="black",t.fillText(e.title,e.dataBox.midX-5,e.screenBounds.y+15))}(t,{showTitle:this.isTitleShown(e,n),title:null===(w=n.chartOptions)||void 0===w?void 0:w.title,dataBox:S,screenBounds:e}),function(t,e){if(e.showAxesLabels){t.font='11px Roboto, "Roboto Local"',t.textAlign="center",t.fillStyle="black",t.fillText(e.xAxisName,e.dataBox.midX-5,e.screenBounds.maxY-d.d.X_AXIS_LABEL_BOTTOM_PX_MARGIN),t.translate(e.screenBounds.x,e.screenBounds.y),t.rotate(-Math.PI/2);const n=e.showTitle?d.d.AXES_TOP_PX_MARGIN_WITH_TITLE:d.d.AXES_TOP_PX_MARGIN;t.fillText(e.yAxisName,-(e.dataBox.height/2+n+15),15),t.restore()}}(t,{showTitle:this.isTitleShown(e,n),dataBox:S,screenBounds:e,showAxesLabels:this.areAxesLabelsShown(e,n),xAxisName:null===(I=n.chartOptions)||void 0===I?void 0:I.xAxisName,yAxisName:null===(A=n.chartOptions)||void 0===A?void 0:A.yAxisName}),function(t,e,n){var r,o,i,s;if(n.showLegend){t.font='11px Roboto, "Roboto Local"';const a=[...new Set(null===(r=e.series)||void 0===r?void 0:r.map((t=>t.columnName)))].filter((t=>null!=t));let l=0;for(let r=0;r<a.length;r++){const c=a[r];(null===(o=e.chartOptions)||void 0===o?void 0:o.showColumnLabel)&&b(t,c,{dataBox:n.dataBox,columnIdx:r,drawnCurvesInLegend:l});const u=null===(i=e.series)||void 0===i?void 0:i.filter((t=>t.columnName===c));for(let o=0;o<(null==u?void 0:u.length);o++){const i=u[o];""!==i.name&&null!==i.name&&void 0!==i.name&&(L(t,i,{dataBox:n.dataBox,ratio:n.ratio,columnIdx:r,drawnCurvesInLegend:l,showColumnLabel:null===(s=e.chartOptions)||void 0===s?void 0:s.showColumnLabel}),l++)}}t.restore()}}(t,n,{showLegend:this.isLegendShown(e),dataBox:S,ratio:D}),t.restore()}render(t,e,n,o,i,s,a){var l,u,f;if(!s.cell.value)return;if(o<d.d.MIN_CELL_RENDERER_PX_WIDTH||i<d.d.MIN_CELL_RENDERER_PX_HEIGHT)return;const h=(null===(l=s.cell.column)||void 0===l?void 0:l.getTag(d.d.TAG_FIT_CHART_FORMAT))===d.d.TAG_FIT_CHART_FORMAT_3DX?(0,c.f)(s.cell.value):R(s),p=new r.Rect(e,n,o,i).inflate(d.d.INFLATE_SIZE,d.d.INFLATE_SIZE);for(const[e,n]of Object.entries(d.d.CONDITION_MAP))if(n(h.series))return void S(t,p);null===(u=h.series)||void 0===u||u.forEach((t=>t.columnName=s.cell.column.name)),(null===(f=h.chartOptions)||void 0===f?void 0:f.mergeSeries)&&(h.series=[O(h.series)]),this.renderCurves(t,p,h)}hitTest(t,e,n){const o=n.xToScreen(e.x),i=n.yToScreen(e.y),s=(e.outlier?d.d.OUTLIER_PX_SIZE:d.d.POINT_PX_SIZE)/2+d.d.OUTLIER_HITBOX_RADIUS;return new r.Rect(o-s,i-s,2*s,2*s).containsPoint(new r.Point(t.offsetX,t.offsetY))}onMouseMove(t,e){var n,o,s,u,f;if(!t.cell.value)return;const h=t.bounds.inflate(d.d.INFLATE_SIZE,d.d.INFLATE_SIZE);if(h.width<d.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH||h.height<d.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT){const n=i.canvas(300,200);this.render(n.getContext("2d"),0,0,300,200,t,null);const r=i.divV([n]);i.tooltip.show(r,e.x,e.y)}const p=t.cell.column.getTag(d.d.TAG_FIT_CHART_FORMAT)===d.d.TAG_FIT_CHART_FORMAT_3DX?(0,c.f)(t.cell.value):R(t);if(h.width>=d.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH&&h.height>=d.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT){const t=F(h,this.areAxesLabelsShown(h,p),this.isTitleShown(h,p))[0],c=(0,l.dU)(p),m=new a.l(c,t,null!==(o=null===(n=p.chartOptions)||void 0===n?void 0:n.logX)&&void 0!==o&&o,null!==(u=null===(s=p.chartOptions)||void 0===s?void 0:s.logY)&&void 0!==u&&u);for(let t=0;t<(null===(f=p.series)||void 0===f?void 0:f.length);t++)if("points"===p.series[t].showPoints)for(let n=0;n<p.series[t].points.length;n++){const o=p.series[t].points[n];if(this.hitTest(e,o,m))return i.tooltip.show(i.divV([i.divText(`x: ${r.format(o.x,"#0.000")}`),i.divText(`y: ${r.format(o.y,"#0.000")}`)]),e.x+16,e.y+16),void(!p.series[t].connectDots&&p.series[t].clickToToggle&&h.width>=d.d.MIN_AXES_CELL_PX_WIDTH&&h.height>=d.d.MIN_AXES_CELL_PX_HEIGHT&&(document.body.style.cursor="pointer"))}i.tooltip.hide()}document.body.style.cursor="default"}}},363:(t,e,n)=>{"use strict";var r=n(976);n(188),n(874),n(870),n(184),n(102),rxjs.operators,rxjs,n(638),n(840),n(711),new r.Package},976:t=>{"use strict";t.exports=DG},469:t=>{"use strict";t.exports=grok},870:t=>{"use strict";t.exports=ui},414:t=>{"use strict";t.exports=wu}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{_package:()=>nt,test:()=>rt,tests:()=>d});var t=n(976),e=n(469);n(133);const o=t.DataFrame.fromCsv('countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,Questions,empty_number,empty_string\nBelgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,1,1,1QBS,1,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.497360340644872, 1.7058694986686864, 5.278052678195135, 0.16000320889028383],""points"":[{""x"":0.10000000149011612,""y"":2.374499797821045},{""x"":0.6000000238418579,""y"":2.6242473125457764},{""x"":1.100000023841858,""y"":2.367267608642578},{""x"":1.600000023841858,""y"":2.6723148822784424},{""x"":2.0999999046325684,""y"":2.6537344455718994},{""x"":2.5999999046325684,""y"":2.3651671409606934},{""x"":3.0999999046325684,""y"":2.5654284954071045},{""x"":3.5999999046325684,""y"":2.4160959720611572},{""x"":4.099999904632568,""y"":2.286726713180542},{""x"":4.599999904632568,""y"":2.5100042819976807},{""x"":5.099999904632568,""y"":1.6676985025405884},{""x"":5.599999904632568,""y"":0.680136501789093},{""x"":6.099999904632568,""y"":0.3391543924808502},{""x"":6.599999904632568,""y"":0.09038983285427094},{""x"":7.099999904632568,""y"":0.19802775979042053}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[7.525235855508179, 1.3186911876809984, 5.335672608564294, 0.7860743343958098],""points"":[{""x"":0.10000000149011612,""y"":7.988070487976074},{""x"":0.6000000238418579,""y"":7.018453121185303},{""x"":1.100000023841858,""y"":8.115279197692871},{""x"":1.600000023841858,""y"":7.486658096313477},{""x"":2.0999999046325684,""y"":7.396438121795654},{""x"":2.5999999046325684,""y"":7.477052211761475},{""x"":3.0999999046325684,""y"":6.913095474243164},{""x"":3.5999999046325684,""y"":8.01385498046875},{""x"":4.099999904632568,""y"":6.985900402069092},{""x"":4.599999904632568,""y"":6.970335960388184},{""x"":5.099999904632568,""y"":5.448817253112793},{""x"":5.599999904632568,""y"":2.5534818172454834},{""x"":6.099999904632568,""y"":1.893947958946228},{""x"":6.599999904632568,""y"":0.6340042352676392},{""x"":7.099999904632568,""y"":0.8403874039649963}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,100,abc\nBurundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,2,2,1ZP8,2,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.431460753103398, 2.1691498799246745, 5.266445597102774, 0.7825762827017926],""points"":[{""x"":0.10000000149011612,""y"":4.751083850860596},{""x"":0.6000000238418579,""y"":4.203000068664551},{""x"":1.100000023841858,""y"":4.415858745574951},{""x"":1.600000023841858,""y"":4.68414306640625},{""x"":2.0999999046325684,""y"":4.198400974273682},{""x"":2.5999999046325684,""y"":4.179222106933594},{""x"":3.0999999046325684,""y"":4.638473987579346},{""x"":3.5999999046325684,""y"":4.708553314208984},{""x"":4.099999904632568,""y"":4.291589260101318},{""x"":4.599999904632568,""y"":4.038082599639893},{""x"":5.099999904632568,""y"":3.4349939823150635},{""x"":5.599999904632568,""y"":1.2194708585739136},{""x"":6.099999904632568,""y"":1.1920831203460693},{""x"":6.599999904632568,""y"":0.5352635979652405},{""x"":7.099999904632568,""y"":0.3346920311450958}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.339458017970126, -1.0734184310171178, 4.746332950550934, 0.2482416857595658],""points"":[{""x"":0.10000000149011612,""y"":0.2139337658882141},{""x"":0.6000000238418579,""y"":0.4269562065601349},{""x"":1.100000023841858,""y"":0.2441573292016983},{""x"":1.600000023841858,""y"":0.146635964512825},{""x"":2.0999999046325684,""y"":0.08818462491035461},{""x"":2.5999999046325684,""y"":0.2560656666755676},{""x"":3.0999999046325684,""y"":0.42434045672416687},{""x"":3.5999999046325684,""y"":0.37111231684684753},{""x"":4.099999904632568,""y"":0.5581737160682678},{""x"":4.599999904632568,""y"":1.183590054512024},{""x"":5.099999904632568,""y"":1.5629843473434448},{""x"":5.599999904632568,""y"":2.3211288452148438},{""x"":6.099999904632568,""y"":2.229961633682251},{""x"":6.599999904632568,""y"":2.2560226917266846},{""x"":7.099999904632568,""y"":2.2142398357391357}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,3,3,2BDJ,3,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.6760652578642325, 0.9046956320756703, 5.651408971856738, 0.07738846012184185],""points"":[{""x"":0.10000000149011612,""y"":4.32425594329834},{""x"":0.6000000238418579,""y"":4.668442249298096},{""x"":1.100000023841858,""y"":4.379785060882568},{""x"":1.600000023841858,""y"":5.0345139503479},{""x"":2.0999999046325684,""y"":4.878653526306152},{""x"":2.5999999046325684,""y"":4.3451313972473145},{""x"":3.0999999046325684,""y"":4.336992263793945},{""x"":3.5999999046325684,""y"":5.037430286407471},{""x"":4.099999904632568,""y"":5.0092692375183105},{""x"":4.599999904632568,""y"":4.151902675628662},{""x"":5.099999904632568,""y"":3.4066951274871826},{""x"":5.599999904632568,""y"":2.3732759952545166},{""x"":6.099999904632568,""y"":1.673728108406067},{""x"":6.599999904632568,""y"":0.48574790358543396},{""x"":7.099999904632568,""y"":0.2783052325248718}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.938395863010111, -1.4658480661392117, 5.462702751996584, 0.3473139023615039],""points"":[{""x"":0.10000000149011612,""y"":0.4941710829734802},{""x"":0.6000000238418579,""y"":0.15323974192142487},{""x"":1.100000023841858,""y"":0.46373432874679565},{""x"":1.600000023841858,""y"":0.3370431363582611},{""x"":2.0999999046325684,""y"":0.5179030299186707},{""x"":2.5999999046325684,""y"":0.27899765968322754},{""x"":3.0999999046325684,""y"":0.22075064480304718},{""x"":3.5999999046325684,""y"":0.5789918899536133},{""x"":4.099999904632568,""y"":0.21169911324977875},{""x"":4.599999904632568,""y"":0.27857646346092224},{""x"":5.099999904632568,""y"":1.0906332731246948},{""x"":5.599999904632568,""y"":1.8520300388336182},{""x"":6.099999904632568,""y"":2.7177059650421143},{""x"":6.599999904632568,""y"":2.8680918216705322},{""x"":7.099999904632568,""y"":3.2413077354431152}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCanada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,4,4,1IAN,4,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[0.8597390975430008, 1.0957625732481946, 5.260537067987958, 0.07974187998177736],""points"":[{""x"":0.10000000149011612,""y"":0.8190152645111084},{""x"":0.6000000238418579,""y"":0.8421689867973328},{""x"":1.100000023841858,""y"":0.8740922212600708},{""x"":1.600000023841858,""y"":0.8924275040626526},{""x"":2.0999999046325684,""y"":0.8249067664146423},{""x"":2.5999999046325684,""y"":0.9327669143676758},{""x"":3.0999999046325684,""y"":0.8522974252700806},{""x"":3.5999999046325684,""y"":0.8174492716789246},{""x"":4.099999904632568,""y"":0.8394647240638733},{""x"":4.599999904632568,""y"":0.7139387726783752},{""x"":5.099999904632568,""y"":0.5561167597770691},{""x"":5.599999904632568,""y"":0.3276226818561554},{""x"":6.099999904632568,""y"":0.12479474395513535},{""x"":6.599999904632568,""y"":0.13006797432899475},{""x"":7.099999904632568,""y"":0.059702079743146896}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.760930219582546, 1.6591793293833013, 4.667155929720851, 0.7858109544121652],""points"":[{""x"":0.10000000149011612,""y"":6.156993389129639},{""x"":0.6000000238418579,""y"":5.236701965332031},{""x"":1.100000023841858,""y"":6.010560512542725},{""x"":1.600000023841858,""y"":5.495512962341309},{""x"":2.0999999046325684,""y"":6.087770462036133},{""x"":2.5999999046325684,""y"":5.79986572265625},{""x"":3.0999999046325684,""y"":5.597546577453613},{""x"":3.5999999046325684,""y"":5.520902156829834},{""x"":4.099999904632568,""y"":5.360654354095459},{""x"":4.599999904632568,""y"":3.5539746284484863},{""x"":5.099999904632568,""y"":1.577236294746399},{""x"":5.599999904632568,""y"":1.0001264810562134},{""x"":6.099999904632568,""y"":0.9305797815322876},{""x"":6.599999904632568,""y"":0.6033638715744019},{""x"":7.099999904632568,""y"":0.4203685522079468}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nColombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,5,5,4UJ1,5,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[6.4995088314153655, 2.4270351004539914, 5.178659535348579, 0.625653346241577],""points"":[{""x"":0.10000000149011612,""y"":6.496231555938721},{""x"":0.6000000238418579,""y"":6.42543363571167},{""x"":1.100000023841858,""y"":7.040063858032227},{""x"":1.600000023841858,""y"":6.1115403175354},{""x"":2.0999999046325684,""y"":6.680728435516357},{""x"":2.5999999046325684,""y"":6.406774520874023},{""x"":3.0999999046325684,""y"":6.611269474029541},{""x"":3.5999999046325684,""y"":5.889094352722168},{""x"":4.099999904632568,""y"":6.75344705581665},{""x"":4.599999904632568,""y"":6.361435890197754},{""x"":5.099999904632568,""y"":4.1666975021362305},{""x"":5.599999904632568,""y"":1.172118902206421},{""x"":6.099999904632568,""y"":0.801048994064331},{""x"":6.599999904632568,""y"":0.4640021026134491},{""x"":7.099999904632568,""y"":0.0010357667924836278}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[1.4734381347446401, 1.1649805188074196, 4.82958608866421, 0.09500545496710007],""points"":[{""x"":0.10000000149011612,""y"":1.5279096364974976},{""x"":0.6000000238418579,""y"":1.3559974431991577},{""x"":1.100000023841858,""y"":1.5246378183364868},{""x"":1.600000023841858,""y"":1.5567657947540283},{""x"":2.0999999046325684,""y"":1.4114240407943726},{""x"":2.5999999046325684,""y"":1.4045010805130005},{""x"":3.0999999046325684,""y"":1.4769829511642456},{""x"":3.5999999046325684,""y"":1.4875500202178955},{""x"":4.099999904632568,""y"":1.2991987466812134},{""x"":4.599999904632568,""y"":0.922961413860321},{""x"":5.099999904632568,""y"":0.6520044803619385},{""x"":5.599999904632568,""y"":0.15350978076457977},{""x"":6.099999904632568,""y"":0.1078903079032898},{""x"":6.599999904632568,""y"":0.17276449501514435},{""x"":7.099999904632568,""y"":0.14066608250141144}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCosta Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,6,6,2BPW,6,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.4833641843311227, -1.8945978742090062, 4.671127708092568, 0.24159861311815153],""points"":[{""x"":0.10000000149011612,""y"":0.0969524160027504},{""x"":0.6000000238418579,""y"":0.028483040630817413},{""x"":1.100000023841858,""y"":0.22087176144123077},{""x"":1.600000023841858,""y"":0.0068915546871721745},{""x"":2.0999999046325684,""y"":0.4305879771709442},{""x"":2.5999999046325684,""y"":0.44774115085601807},{""x"":3.0999999046325684,""y"":0.45346319675445557},{""x"":3.5999999046325684,""y"":0.2370593100786209},{""x"":4.099999904632568,""y"":0.4657953977584839},{""x"":4.599999904632568,""y"":1.155200719833374},{""x"":5.099999904632568,""y"":2.2294070720672607},{""x"":5.599999904632568,""y"":2.4311530590057373},{""x"":6.099999904632568,""y"":2.33846116065979},{""x"":6.599999904632568,""y"":2.608201026916504},{""x"":7.099999904632568,""y"":2.8136143684387207}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.224573521642033, 1.4454033924198528, 5.6014197746076535, 0.2823216054197577],""points"":[{""x"":0.10000000149011612,""y"":4.95027494430542},{""x"":0.6000000238418579,""y"":5.1754679679870605},{""x"":1.100000023841858,""y"":5.276752948760986},{""x"":1.600000023841858,""y"":5.589294910430908},{""x"":2.0999999046325684,""y"":5.616994857788086},{""x"":2.5999999046325684,""y"":5.120813846588135},{""x"":3.0999999046325684,""y"":5.340766906738281},{""x"":3.5999999046325684,""y"":4.876471042633057},{""x"":4.099999904632568,""y"":4.94999361038208},{""x"":4.599999904632568,""y"":5.162564754486084},{""x"":5.099999904632568,""y"":4.399557590484619},{""x"":5.599999904632568,""y"":2.7977969646453857},{""x"":6.099999904632568,""y"":1.0229872465133667},{""x"":6.599999904632568,""y"":0.48275601863861084},{""x"":7.099999904632568,""y"":0.10408931970596313}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,7,7,1QBS,7,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.320838679713925, -1.2421619987316728, 4.831325425225256, 0.3236011098403072],""points"":[{""x"":0.10000000149011612,""y"":0.3727470338344574},{""x"":0.6000000238418579,""y"":0.12365014106035233},{""x"":1.100000023841858,""y"":0.48422467708587646},{""x"":1.600000023841858,""y"":0.2264465093612671},{""x"":2.0999999046325684,""y"":0.16821794211864471},{""x"":2.5999999046325684,""y"":0.3879014551639557},{""x"":3.0999999046325684,""y"":0.5470244884490967},{""x"":3.5999999046325684,""y"":0.3419053554534912},{""x"":4.099999904632568,""y"":0.7655120491981506},{""x"":4.599999904632568,""y"":1.2346516847610474},{""x"":5.099999904632568,""y"":2.453336715698242},{""x"":5.599999904632568,""y"":2.9565491676330566},{""x"":6.099999904632568,""y"":3.335299491882324},{""x"":6.599999904632568,""y"":3.240290880203247},{""x"":7.099999904632568,""y"":3.1107218265533447}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.6401853521511094, 1.26211588875013, 5.399028074402744, 0.5089580830068091],""points"":[{""x"":0.10000000149011612,""y"":3.8585598468780518},{""x"":0.6000000238418579,""y"":3.6077206134796143},{""x"":1.100000023841858,""y"":3.855252265930176},{""x"":1.600000023841858,""y"":3.619039297103882},{""x"":2.0999999046325684,""y"":3.839388370513916},{""x"":2.5999999046325684,""y"":3.335283041000366},{""x"":3.0999999046325684,""y"":3.571141481399536},{""x"":3.5999999046325684,""y"":3.4155046939849854},{""x"":4.099999904632568,""y"":3.7316646575927734},{""x"":4.599999904632568,""y"":3.0680155754089355},{""x"":5.099999904632568,""y"":2.891066551208496},{""x"":5.599999904632568,""y"":1.6022753715515137},{""x"":6.099999904632568,""y"":0.7652576565742493},{""x"":6.599999904632568,""y"":0.6875326037406921},{""x"":7.099999904632568,""y"":0.5828871726989746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nItaly,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,8,8,1ZP8,8,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.293592105923809, 1.3781586549141835, 5.1025898038676605, 0.03493851245291291],""points"":[{""x"":0.10000000149011612,""y"":2.1287283897399902},{""x"":0.6000000238418579,""y"":2.267972230911255},{""x"":1.100000023841858,""y"":2.398442506790161},{""x"":1.600000023841858,""y"":2.5130622386932373},{""x"":2.0999999046325684,""y"":2.3255116939544678},{""x"":2.5999999046325684,""y"":2.127340793609619},{""x"":3.0999999046325684,""y"":2.47259783744812},{""x"":3.5999999046325684,""y"":2.131181478500366},{""x"":4.099999904632568,""y"":2.090421438217163},{""x"":4.599999904632568,""y"":2.02299165725708},{""x"":5.099999904632568,""y"":1.1105059385299683},{""x"":5.599999904632568,""y"":0.4494485855102539},{""x"":6.099999904632568,""y"":0.1375635862350464},{""x"":6.599999904632568,""y"":0.036351121962070465},{""x"":7.099999904632568,""y"":0.1619771122932434}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.953125499439879, 1.2528620255306528, 5.187637440149802, 0.3110348753260886],""points"":[{""x"":0.10000000149011612,""y"":5.6585283279418945},{""x"":0.6000000238418579,""y"":5.911152362823486},{""x"":1.100000023841858,""y"":5.924920082092285},{""x"":1.600000023841858,""y"":5.8469438552856445},{""x"":2.0999999046325684,""y"":5.929472923278809},{""x"":2.5999999046325684,""y"":6.190037727355957},{""x"":3.0999999046325684,""y"":6.236179828643799},{""x"":3.5999999046325684,""y"":6.141019344329834},{""x"":4.099999904632568,""y"":5.295210838317871},{""x"":4.599999904632568,""y"":5.265801906585693},{""x"":5.099999904632568,""y"":3.3722851276397705},{""x"":5.599999904632568,""y"":1.8299226760864258},{""x"":6.099999904632568,""y"":0.32690900564193726},{""x"":6.599999904632568,""y"":0.6274543404579163},{""x"":7.099999904632568,""y"":0.8441857099533081}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nRwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,9,2BDJ,9,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.8209972202654474, 1.3779216716448506, 5.299882228439686, 0.06040645519069608],""points"":[{""x"":0.10000000149011612,""y"":3.7821109294891357},{""x"":0.6000000238418579,""y"":3.542433023452759},{""x"":1.100000023841858,""y"":3.7008674144744873},{""x"":1.600000023841858,""y"":3.717301607131958},{""x"":2.0999999046325684,""y"":4.024452209472656},{""x"":2.5999999046325684,""y"":4.013899326324463},{""x"":3.0999999046325684,""y"":3.945094347000122},{""x"":3.5999999046325684,""y"":3.866621971130371},{""x"":4.099999904632568,""y"":3.7461626529693604},{""x"":4.599999904632568,""y"":3.3454740047454834},{""x"":5.099999904632568,""y"":2.61944317817688},{""x"":5.599999904632568,""y"":0.999405026435852},{""x"":6.099999904632568,""y"":0.46259793639183044},{""x"":6.599999904632568,""y"":0.054134611040353775},{""x"":7.099999904632568,""y"":0.05711187422275543}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.6318079657726035, 1.8495493770000595, 5.391793312471116, 0.17060707587348442],""points"":[{""x"":0.10000000149011612,""y"":5.458079814910889},{""x"":0.6000000238418579,""y"":5.554427146911621},{""x"":1.100000023841858,""y"":5.799983024597168},{""x"":1.600000023841858,""y"":5.364140033721924},{""x"":2.0999999046325684,""y"":5.864485740661621},{""x"":2.5999999046325684,""y"":5.4509806632995605},{""x"":3.0999999046325684,""y"":5.702574729919434},{""x"":3.5999999046325684,""y"":5.7314534187316895},{""x"":4.099999904632568,""y"":5.5123443603515625},{""x"":4.599999904632568,""y"":5.724395751953125},{""x"":5.099999904632568,""y"":4.354506969451904},{""x"":5.599999904632568,""y"":1.7307666540145874},{""x"":6.099999904632568,""y"":0.6305936574935913},{""x"":6.599999904632568,""y"":0.035183437168598175},{""x"":7.099999904632568,""y"":0.7575169205665588}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nSwitzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,10,1IAN,10,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[1.1190255865097471, 2.3163895161544437, 5.4968866182279195, 0.2035204047289052],""points"":[{""x"":0.10000000149011612,""y"":1.1057683229446411},{""x"":0.6000000238418579,""y"":1.1019697189331055},{""x"":1.100000023841858,""y"":1.0818607807159424},{""x"":1.600000023841858,""y"":1.062997817993164},{""x"":2.0999999046325684,""y"":1.046447515487671},{""x"":2.5999999046325684,""y"":1.1217249631881714},{""x"":3.0999999046325684,""y"":1.2166996002197266},{""x"":3.5999999046325684,""y"":1.215477705001831},{""x"":4.099999904632568,""y"":1.0581893920898438},{""x"":4.599999904632568,""y"":1.1747995615005493},{""x"":5.099999904632568,""y"":1.0181127786636353},{""x"":5.599999904632568,""y"":0.5344523191452026},{""x"":6.099999904632568,""y"":0.2569526433944702},{""x"":6.599999904632568,""y"":0.1912207305431366},{""x"":7.099999904632568,""y"":0.15060538053512573}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.1038581025805785, 2.0032224204185245, 5.087602825989163, 0.13277988512492753],""points"":[{""x"":0.10000000149011612,""y"":3.0498509407043457},{""x"":0.6000000238418579,""y"":2.805217742919922},{""x"":1.100000023841858,""y"":3.3415253162384033},{""x"":1.600000023841858,""y"":3.0549843311309814},{""x"":2.0999999046325684,""y"":3.250074863433838},{""x"":2.5999999046325684,""y"":3.0432586669921875},{""x"":3.0999999046325684,""y"":3.265852451324463},{""x"":3.5999999046325684,""y"":2.9475724697113037},{""x"":4.099999904632568,""y"":3.1929898262023926},{""x"":4.599999904632568,""y"":2.7460060119628906},{""x"":5.099999904632568,""y"":1.6175861358642578},{""x"":5.599999904632568,""y"":0.3006608486175537},{""x"":6.099999904632568,""y"":0.3444803059101105},{""x"":6.599999904632568,""y"":0.015537971630692482},{""x"":7.099999904632568,""y"":0.5527358055114746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\n,,,,,,,,,,,,,,,,,,,,,');o.columns.add(t.Column.fromList(t.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var i=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};const s=3e4,a=108e5,l=console.log.bind(console),c=console.info.bind(console),u=console.warn.bind(console),f=console.error.bind(console),d={},h="Auto Tests",p="Demo",m="Detectors",y="Core",g={};let x;var v;!function(t){t.notNull=function(t,e){if(null==t)throw new Error(`${null==e?"Value":e} not defined`)}}(v||(v={}));class T{constructor(t,e){this.catchUnhandled=!0,this.report=!1,void 0!==t&&(this.catchUnhandled=t),void 0!==e&&(this.report=e)}}class w{constructor(t,e,n,r){var o;this.category=t,this.name=e,null!=r||(r={}),null!==(o=r.timeout)&&void 0!==o||(r.timeout=s),this.options=r,this.test=()=>i(this,void 0,void 0,(function*(){return new Promise(((t,e)=>i(this,void 0,void 0,(function*(){let r="";try{r=yield n()}catch(t){e(t)}t(r)}))))}))}}function _(t,e,n){null==d[x]&&(d[x]={}),null==d[x].tests&&(d[x].tests=[]),d[x].tests.push(new w(x,t,e,n))}function E(t,e=!0,n){if(n=n?`${n}, `:"",t!==e)throw new Error(`${n}Expected "${e}", got "${t}"`)}function I(t,e,n=.001,r){if(t===Number.POSITIVE_INFINITY&&e===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY&&e===Number.NEGATIVE_INFINITY||t===Number.NaN&&e===Number.NaN||isNaN(t)&&isNaN(e))return;const o=Math.abs(t-e)<n;if(E(o,!0,`${null!=r?r:""} (tolerance = ${n})`),!o)throw new Error(`Expected ${e}, got ${t} (tolerance = ${n})`)}function C(t,e){for(const[n,r]of Object.entries(e)){if(!t.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const e=t[n];if(e instanceof Array&&r instanceof Array)A(e,r);else if(e instanceof Object&&r instanceof Object)C(e,r);else if(Number.isFinite(e)&&Number.isFinite(r))I(e,r);else if(e!=r)throw new Error(`Expected (${r}) for key '${n}', got (${e})`)}}function A(t,e){const n=t.length,r=e.length;if(n!=r)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${r}`);for(let r=0;r<n;r++)if(t[r]instanceof Array&&e[r]instanceof Array)A(t[r],e[r]);else if(t[r]instanceof Object&&e[r]instanceof Object)C(t[r],e[r]);else if(t[r]!=e[r])throw new Error(`Expected ${e[r]} at position ${r}, got ${t[r]}`)}function N(t,e,n){var r;x=t,e(),d[x]&&(d[x].clear=null===(r=null==n?void 0:n.clear)||void 0===r||r,d[x].timeout=null==n?void 0:n.timeout)}function b(t,e){return t.replace(new RegExp(e.name,"gi"),e.nqName)}function L(e){return i(this,void 0,void 0,(function*(){return`${e.toString()}\n${e.stack?yield t.Logger.translateStackTrace(e.stack):""}`}))}function S(n,r,o,c,u,d){var h,p,m,y,g,x;return i(this,void 0,void 0,(function*(){let i;o.length=0;let v="package";const T=null!=r&&n.name.toLowerCase()!==r.toLowerCase(),w=(null===(h=n.options)||void 0===h?void 0:h.skipReason)||T,_=T?"skipped":null===(p=n.options)||void 0===p?void 0:p.skipReason;w||l(`Started ${n.category} ${n.name}`);const E=Date.now();try{if(w)i={success:!0,result:_,ms:0,skipped:!0};else{let e=(null===(m=n.options)||void 0===m?void 0:m.timeout)===s&&c?c:null===(y=n.options)||void 0===y?void 0:y.timeout;e=t.Test.isInBenchmark&&e===s?a:e,i={success:!0,result:null!==(g=yield O(n.test,e))&&void 0!==g?g:"OK",ms:0,skipped:!1}}}catch(t){f(t),i={success:!1,result:yield L(t),ms:0,skipped:!1}}if((null===(x=n.options)||void 0===x?void 0:x.isAggregated)&&i.result.constructor===t.DataFrame){const t=i.result.col("success");if(t&&(i.success=t.stats.sum===t.length),!d){const t=i.result;t.columns.remove("stack"),t.rows.removeWhere((t=>t.get("success"))),i.result=t}i.result=i.result.toCsv()}if(i.logs=o.join("\n"),i.ms=Date.now()-E,w||l(`Finished ${n.category} ${n.name} for ${i.ms} ms`),i.category=n.category,i.name=n.name,!T){let t={success:i.success,result:i.result,ms:i.ms,skipped:i.skipped,package:u,category:n.category,name:n.name,logs:i.logs};if(i.result.constructor==Object){const e=Object.keys(i.result).reduce(((t,e)=>Object.assign(Object.assign({},t),{["result."+e]:i.result[e]})),{});t=Object.assign(Object.assign({},t),e)}null!=e.shell.reportTest?yield e.shell.reportTest(v,t):yield fetch(`${e.dapi.root}/log/tests/${v}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)})}return i}))}function P(t){return i(this,void 0,void 0,(function*(){yield new Promise((e=>setTimeout(e,t)))}))}function O(t,e,n="EXECUTION TIMEOUT"){return i(this,void 0,void 0,(function*(){let r=null;const o=new Promise(((t,o)=>{r=setTimeout((()=>{o(n)}),e)}));try{return yield Promise.race([t(),o])}finally{r&&clearTimeout(r)}}))}t.DataFrame.fromColumns([t.Column.fromStrings("col",["val1","val2","val3"])]);var R=n(638),M=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};N("detectors",(()=>{_("detectFitCurves",(()=>M(void 0,void 0,void 0,(function*(){const n=t.DataFrame.fromCsv('dataframes,json chart 0,json chart 1,json chart 2\n"null (15 rows, 2 columns)","{""series"":[{""parameters"":[1.4325498997897106,1.9857091601431633,1.1549088606928581,1.7111330488305754],""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":0.04513680189847946},{""x"":0.6000000238418579,""y"":0.05534003674983978},{""x"":1.100000023841858,""y"":0.041759949177503586},{""x"":1.600000023841858,""y"":0.019746985286474228},{""x"":2.0999999046325684,""y"":0.009008238092064857},{""x"":2.5999999046325684,""y"":0.00802786834537983},{""x"":3.0999999046325684,""y"":0.046114228665828705},{""x"":3.5999999046325684,""y"":0.0032935715280473232},{""x"":4.099999904632568,""y"":0.05305013433098793},{""x"":4.599999904632568,""y"":0.11946146935224533},{""x"":5.099999904632568,""y"":0.24304461479187012},{""x"":5.599999904632568,""y"":0.32507050037384033},{""x"":6.099999904632568,""y"":0.30492347478866577},{""x"":6.599999904632568,""y"":0.30675041675567627},{""x"":7.099999904632568,""y"":0.28282707929611206}]},{""fitFunction"":""sigmoid"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":0.027537694200873375},{""x"":0.6000000238418579,""y"":0.20163409411907196},{""x"":1.100000023841858,""y"":0.4537210166454315},{""x"":1.600000023841858,""y"":0.1709870994091034},{""x"":2.0999999046325684,""y"":0.35089364647865295},{""x"":2.5999999046325684,""y"":0.30297139286994934},{""x"":3.0999999046325684,""y"":0.3161645829677582},{""x"":3.5999999046325684,""y"":0.460237979888916},{""x"":4.099999904632568,""y"":0.5018354058265686},{""x"":4.599999904632568,""y"":1.2936394214630127},{""x"":5.099999904632568,""y"":2.336543321609497},{""x"":5.599999904632568,""y"":2.353417158126831},{""x"":6.099999904632568,""y"":2.5554966926574707},{""x"":6.599999904632568,""y"":2.7185072898864746},{""x"":7.099999904632568,""y"":2.8088953495025635}]}]}","{""series"":[{""parameters"":[1.4257157458000065,1.587135296876273,1.6780074048516793,4.72187609991688],""fitFunction"":""sigmoid"",""fitLineColor"":""#2ca02c"",""pointColor"":""#2ca02c"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":0.5346568822860718},{""x"":0.6000000238418579,""y"":0.6445727348327637},{""x"":1.100000023841858,""y"":0.08188246190547943},{""x"":1.600000023841858,""y"":0.0516531839966774},{""x"":2.0999999046325684,""y"":0.17018724977970123},{""x"":2.5999999046325684,""y"":0.618033766746521},{""x"":3.0999999046325684,""y"":0.16852399706840515},{""x"":3.5999999046325684,""y"":0.013230039738118649},{""x"":4.099999904632568,""y"":0.6706985831260681},{""x"":4.599999904632568,""y"":0.6293138861656189},{""x"":5.099999904632568,""y"":1.4058887958526611},{""x"":5.599999904632568,""y"":2.6412644386291504},{""x"":6.099999904632568,""y"":3.775967597961426},{""x"":6.599999904632568,""y"":3.3188939094543457},{""x"":7.099999904632568,""y"":3.793793201446533}]}],""chartOptions"":{""showStatistics"":[""auc""]}}","{""series"":[{""parameters"":[1.4518023469757255,1.051351211186544,1.6612723878444138,-0.9253134758193626],""fitFunction"":""sigmoid"",""fitLineColor"":""#9467bd"",""pointColor"":""#9467bd"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":2.5458569526672363},{""x"":0.10000000149011612,""y"":3.0017518997192383},{""x"":0.10000000149011612,""y"":2.4102466106414795},{""x"":0.10000000149011612,""y"":2.7017934322357178},{""x"":0.10000000149011612,""y"":2.8341686725616455},{""x"":0.6000000238418579,""y"":2.9751579761505127},{""x"":0.6000000238418579,""y"":2.8365142345428467},{""x"":0.6000000238418579,""y"":2.898362874984741},{""x"":0.6000000238418579,""y"":2.9964826107025146},{""x"":0.6000000238418579,""y"":2.6708292961120605},{""x"":1.100000023841858,""y"":3.263227939605713},{""x"":1.100000023841858,""y"":3.0655293464660645},{""x"":1.100000023841858,""y"":2.6620445251464844},{""x"":1.100000023841858,""y"":3.002741813659668},{""x"":1.100000023841858,""y"":3.1540098190307617},{""x"":1.600000023841858,""y"":2.8934433460235596},{""x"":1.600000023841858,""y"":2.7970690727233887},{""x"":1.600000023841858,""y"":3.0466723442077637},{""x"":1.600000023841858,""y"":3.179988145828247},{""x"":1.600000023841858,""y"":2.611898899078369},{""x"":2.0999999046325684,""y"":2.497966766357422},{""x"":2.0999999046325684,""y"":2.645627498626709},{""x"":2.0999999046325684,""y"":2.5474727153778076},{""x"":2.0999999046325684,""y"":2.530237913131714},{""x"":2.0999999046325684,""y"":2.9498236179351807},{""x"":2.5999999046325684,""y"":2.7639214992523193},{""x"":2.5999999046325684,""y"":3.007110595703125},{""x"":2.5999999046325684,""y"":2.71816086769104},{""x"":2.5999999046325684,""y"":3.050650119781494},{""x"":2.5999999046325684,""y"":2.591902017593384},{""x"":3.0999999046325684,""y"":2.79219388961792},{""x"":3.0999999046325684,""y"":2.380063056945801},{""x"":3.0999999046325684,""y"":3.2450575828552246},{""x"":3.0999999046325684,""y"":2.6954219341278076},{""x"":3.0999999046325684,""y"":2.368993043899536},{""x"":3.5999999046325684,""y"":3.2338552474975586},{""x"":3.5999999046325684,""y"":3.222881555557251},{""x"":3.5999999046325684,""y"":2.6137502193450928},{""x"":3.5999999046325684,""y"":2.3624353408813477},{""x"":3.5999999046325684,""y"":2.830970525741577},{""x"":4.099999904632568,""y"":2.8000826835632324},{""x"":4.099999904632568,""y"":2.8115334510803223},{""x"":4.099999904632568,""y"":2.8906726837158203},{""x"":4.099999904632568,""y"":2.5641937255859375},{""x"":4.099999904632568,""y"":2.3881938457489014},{""x"":4.599999904632568,""y"":2.076000928878784},{""x"":4.599999904632568,""y"":2.241201400756836},{""x"":4.599999904632568,""y"":2.018866777420044},{""x"":4.599999904632568,""y"":2.7197747230529785},{""x"":4.599999904632568,""y"":2.3649282455444336},{""x"":5.099999904632568,""y"":2.068617105484009},{""x"":5.099999904632568,""y"":2.0637989044189453},{""x"":5.099999904632568,""y"":1.5100634098052979},{""x"":5.099999904632568,""y"":1.9978814125061035},{""x"":5.099999904632568,""y"":2.1007437705993652},{""x"":5.599999904632568,""y"":0.7437329292297363},{""x"":5.599999904632568,""y"":0.8030821681022644},{""x"":5.599999904632568,""y"":1.0766953229904175},{""x"":5.599999904632568,""y"":1.5326048135757446},{""x"":5.599999904632568,""y"":1.5971065759658813},{""x"":6.099999904632568,""y"":0.31388434767723083},{""x"":6.099999904632568,""y"":0.6875622272491455},{""x"":6.099999904632568,""y"":0.855545163154602},{""x"":6.099999904632568,""y"":0.6559354662895203},{""x"":6.099999904632568,""y"":0.3100747764110565},{""x"":6.599999904632568,""y"":0.4792144000530243},{""x"":6.599999904632568,""y"":0.855309009552002},{""x"":6.599999904632568,""y"":0.18937373161315918},{""x"":6.599999904632568,""y"":0.3708323538303375},{""x"":6.599999904632568,""y"":0.08053481578826904},{""x"":7.099999904632568,""y"":0.7577306628227234},{""x"":7.099999904632568,""y"":0.3387751877307892},{""x"":7.099999904632568,""y"":0.1985611915588379},{""x"":7.099999904632568,""y"":0.172195702791214},{""x"":7.099999904632568,""y"":0.13258741796016693}]}],""chartOptions"":{""showStatistics"":[""auc""]}}"\n"null (15 rows, 2 columns)","{""series"":[{""parameters"":[1.4030933784862443,1.0245979562516274,1.7428150024861861,-3.5779850370795696],""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":5.7036309242248535},{""x"":0.6000000238418579,""y"":5.746265888214111},{""x"":1.100000023841858,""y"":5.299612045288086},{""x"":1.600000023841858,""y"":5.343863487243652},{""x"":2.0999999046325684,""y"":5.506134033203125},{""x"":2.5999999046325684,""y"":5.4817914962768555},{""x"":3.0999999046325684,""y"":5.3505539894104},{""x"":3.5999999046325684,""y"":5.151522159576416},{""x"":4.099999904632568,""y"":5.212680339813232},{""x"":4.599999904632568,""y"":4.80598783493042},{""x"":5.099999904632568,""y"":3.351301431655884},{""x"":5.599999904632568,""y"":2.108116865158081},{""x"":6.099999904632568,""y"":1.246281623840332},{""x"":6.599999904632568,""y"":0.5875148773193359},{""x"":7.099999904632568,""y"":0.6986792683601379}]},{""fitFunction"":""sigmoid"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":4.777379035949707},{""x"":0.6000000238418579,""y"":5.265642166137695},{""x"":1.100000023841858,""y"":5.713808059692383},{""x"":1.600000023841858,""y"":5.249830722808838},{""x"":2.0999999046325684,""y"":5.587547779083252},{""x"":2.5999999046325684,""y"":5.36907434463501},{""x"":3.0999999046325684,""y"":4.934175968170166},{""x"":3.5999999046325684,""y"":5.372972011566162},{""x"":4.099999904632568,""y"":5.017283916473389},{""x"":4.599999904632568,""y"":4.6751484870910645},{""x"":5.099999904632568,""y"":3.423663854598999},{""x"":5.599999904632568,""y"":1.594344973564148},{""x"":6.099999904632568,""y"":0.5661525130271912},{""x"":6.599999904632568,""y"":0.19819404184818268},{""x"":7.099999904632568,""y"":0.8421927690505981}]}]}","{""series"":[{""parameters"":[1.5400648543589148,1.7239324972922214,1.4063297934320662,0.33443731185267556],""fitFunction"":""sigmoid"",""fitLineColor"":""#2ca02c"",""pointColor"":""#2ca02c"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":1.27737557888031},{""x"":0.6000000238418579,""y"":1.2780145406723022},{""x"":1.100000023841858,""y"":1.3489571809768677},{""x"":1.600000023841858,""y"":1.3250025510787964},{""x"":2.0999999046325684,""y"":1.309158444404602},{""x"":2.5999999046325684,""y"":1.441296935081482},{""x"":3.0999999046325684,""y"":1.3621265888214111},{""x"":3.5999999046325684,""y"":1.3409022092819214},{""x"":4.099999904632568,""y"":1.2703818082809448},{""x"":4.599999904632568,""y"":1.2195014953613281},{""x"":5.099999904632568,""y"":0.585429310798645},{""x"":5.599999904632568,""y"":0.19421088695526123},{""x"":6.099999904632568,""y"":0.2276361584663391},{""x"":6.599999904632568,""y"":0.03259352594614029},{""x"":7.099999904632568,""y"":0.03811067342758179}]}],""chartOptions"":{""showStatistics"":[""auc""]}}","{""series"":[{""parameters"":[1.3987701446422334,1.0025589776619843,1.950431059109577,1.57489342486818],""fitFunction"":""sigmoid"",""fitLineColor"":""#9467bd"",""pointColor"":""#9467bd"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":0.03612012043595314},{""x"":0.10000000149011612,""y"":0.05706661567091942},{""x"":0.10000000149011612,""y"":0.007174440659582615},{""x"":0.10000000149011612,""y"":0.006656676065176725},{""x"":0.10000000149011612,""y"":0.03480849787592888},{""x"":0.6000000238418579,""y"":0.0665726289153099},{""x"":0.6000000238418579,""y"":0.054525356739759445},{""x"":0.6000000238418579,""y"":0.055943023413419724},{""x"":0.6000000238418579,""y"":0.0544852614402771},{""x"":0.6000000238418579,""y"":0.02734142541885376},{""x"":1.100000023841858,""y"":0.02047267183661461},{""x"":1.100000023841858,""y"":0.04814719781279564},{""x"":1.100000023841858,""y"":0.05629648640751839},{""x"":1.100000023841858,""y"":0.05200682207942009},{""x"":1.100000023841858,""y"":0.046626269817352295},{""x"":1.600000023841858,""y"":0.027950428426265717},{""x"":1.600000023841858,""y"":0.021106986328959465},{""x"":1.600000023841858,""y"":0.011796108447015285},{""x"":1.600000023841858,""y"":0.04013078659772873},{""x"":1.600000023841858,""y"":0.018657365813851357},{""x"":2.0999999046325684,""y"":0.010390376672148705},{""x"":2.0999999046325684,""y"":0.06717702001333237},{""x"":2.0999999046325684,""y"":0.015734216198325157},{""x"":2.0999999046325684,""y"":0.0005020603421144187},{""x"":2.0999999046325684,""y"":0.03601917624473572},{""x"":2.5999999046325684,""y"":0.04580968990921974},{""x"":2.5999999046325684,""y"":0.013811883516609669},{""x"":2.5999999046325684,""y"":0.0347907729446888},{""x"":2.5999999046325684,""y"":0.003400992602109909},{""x"":2.5999999046325684,""y"":0.0658077746629715},{""x"":3.0999999046325684,""y"":0.06470326334238052},{""x"":3.0999999046325684,""y"":0.040105774998664856},{""x"":3.0999999046325684,""y"":0.004536386113613844},{""x"":3.0999999046325684,""y"":0.028299888595938683},{""x"":3.0999999046325684,""y"":0.015297790057957172},{""x"":3.5999999046325684,""y"":0.010205036029219627},{""x"":3.5999999046325684,""y"":0.030351044610142708},{""x"":3.5999999046325684,""y"":0.02823905274271965},{""x"":3.5999999046325684,""y"":0.00543160829693079},{""x"":3.5999999046325684,""y"":0.03528806194663048},{""x"":4.099999904632568,""y"":0.024404611438512802},{""x"":4.099999904632568,""y"":0.021398605778813362},{""x"":4.099999904632568,""y"":0.01746137998998165},{""x"":4.099999904632568,""y"":0.06801135092973709},{""x"":4.099999904632568,""y"":0.02418249472975731},{""x"":4.599999904632568,""y"":0.08065827190876007},{""x"":4.599999904632568,""y"":0.03795705363154411},{""x"":4.599999904632568,""y"":0.03595327213406563},{""x"":4.599999904632568,""y"":0.019490951672196388},{""x"":4.599999904632568,""y"":0.0357535295188427},{""x"":5.099999904632568,""y"":0.06301134079694748},{""x"":5.099999904632568,""y"":0.04880264401435852},{""x"":5.099999904632568,""y"":0.046849530190229416},{""x"":5.099999904632568,""y"":0.046094998717308044},{""x"":5.099999904632568,""y"":0.07735799998044968},{""x"":5.599999904632568,""y"":0.10287926346063614},{""x"":5.599999904632568,""y"":0.15329882502555847},{""x"":5.599999904632568,""y"":0.09895746409893036},{""x"":5.599999904632568,""y"":0.10509312152862549},{""x"":5.599999904632568,""y"":0.10584071278572083},{""x"":6.099999904632568,""y"":0.19464170932769775},{""x"":6.099999904632568,""y"":0.1837087869644165},{""x"":6.099999904632568,""y"":0.19690236449241638},{""x"":6.099999904632568,""y"":0.14827826619148254},{""x"":6.099999904632568,""y"":0.15355728566646576},{""x"":6.599999904632568,""y"":0.21270307898521423},{""x"":6.599999904632568,""y"":0.19529509544372559},{""x"":6.599999904632568,""y"":0.20716492831707},{""x"":6.599999904632568,""y"":0.18739652633666992},{""x"":6.599999904632568,""y"":0.22446008026599884},{""x"":7.099999904632568,""y"":0.18822836875915527},{""x"":7.099999904632568,""y"":0.2324085384607315},{""x"":7.099999904632568,""y"":0.1877404898405075},{""x"":7.099999904632568,""y"":0.19784560799598694},{""x"":7.099999904632568,""y"":0.21554286777973175}]}],""chartOptions"":{""showStatistics"":[""auc""]}}"'),r=n.columns.byName("json chart 0"),o=n.columns.byName("json chart 1"),i=n.columns.byName("json chart 2");yield e.data.detectSemanticTypes(n),E(r.semType,R.d.FIT_SEM_TYPE),E(o.semType,R.d.FIT_SEM_TYPE),E(i.semType,R.d.FIT_SEM_TYPE)})))),_("detectXMLCurveChart",(()=>M(void 0,void 0,void 0,(function*(){const n=t.DataFrame.fromCsv('xmlCurveFitChart\n"<chart><grid><xAxis min=""0.0"" max=""5"" /><yAxis min=""-100"" max=""100"" /></grid><settings xLabel=""Concentration"" yLabel=""Activity"" logX=""true"" /><seriesCollection><series><x>7.2e-12,7.1e-12,7e-12,6e-8,6e-5,6e-4</x><y>112,115,116,100,123,124</y><fitLine><function type=""sigif""><params>2e-08,-1.5,125,-20</params></function></fitLine><settings color=""Green"" marker=""SquareBorder"" markerColor=""Yellow"" markerBorderColor=""Black"" errorBarColor=""Red"" showErrorBars=""True"" drawLine=""True"" bound=""True"" /></series></seriesCollection></chart>"'),r=n.columns.byName("xmlCurveFitChart");yield e.data.detectSemanticTypes(n),E(r.semType,R.d.FIT_SEM_TYPE),E(r.tags[R.d.TAG_FIT_CHART_FORMAT],R.d.TAG_FIT_CHART_FORMAT_3DX)}))))}));var X=n(870),F=n(414),D=n.n(F),G=n(840),B=n(874),k=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};function Y(e){const n={series:[],chartOptions:{showStatistics:["auc"]}},r=(0,G.YC)(e,.5),o=t.Color.toHtml(t.Color.scatterPlotMarker);return n.series[0]={fitLineColor:o,pointColor:o,markerType:t.MARKER_TYPE.CIRCLE,showFitLine:!0,showPoints:"points",showCurveConfidenceInterval:!0,fitFunction:"sigmoid",points:D().count().take(e).map((function(t){return{x:r.x[t],y:r.y[t]}})).toArray()},n}N("creation",(()=>{_("fit curve creation",(()=>k(void 0,void 0,void 0,(function*(){const n=Date.now(),r=(0,G.lf)(t.Test.isInBenchmark?1e3:100,5,2);e.shell.addTableView(r);const o=Date.now();return yield P(50),console.log(`Creation took ${o.valueOf()-n.valueOf()} ms`),`${t.Test.isInBenchmark?1e3:100} points, took ${o.valueOf()-n.valueOf()} ms`}))))})),N("rendering",(()=>{_("rendering same fitChartData on canvas",(()=>k(void 0,void 0,void 0,(function*(){const n=X.canvas(160,120);e.shell.newView("canvas",[n]);const r=n.getContext("2d"),o=new B.cv,i=Y(t.Test.isInBenchmark?50:15);for(let e=1;e<=1e3;e++)o.renderCurves(r,new t.Rect(n.clientLeft,n.clientTop,160,120).inflate(R.d.INFLATE_SIZE,R.d.INFLATE_SIZE),i),r.clearRect(0,0,160,120);return"rendering performed 1000 times"})))),_("rendering different fitChartData on canvas",(()=>k(void 0,void 0,void 0,(function*(){const n=X.canvas(160,120);e.shell.newView("canvas",[n]);const r=n.getContext("2d"),o=new B.cv;for(let e=1;e<=1e3;e++){const e=Y(t.Test.isInBenchmark?50:15);o.renderCurves(r,new t.Rect(n.clientLeft,n.clientTop,160,120).inflate(R.d.INFLATE_SIZE,R.d.INFLATE_SIZE),e),r.clearRect(0,0,160,120)}return"rendering performed 1000 times"})))),_("rendering in grid",(()=>k(void 0,void 0,void 0,(function*(){const t=(0,G.lf)(30,5,2),n=e.shell.addTableView(t);yield P(100);const r=n.grid.root.getElementsByTagName("canvas")[2],o=new Date;yield function(t,e,n,r){return k(this,void 0,void 0,(function*(){for(let e=0;e<10;e++)t.dispatchEvent(new WheelEvent("wheel",{deltaY:300})),yield P(10)}))}(r);const i=new Date;return console.log(`curves rendering took ${i.valueOf()-o.valueOf()} ms`),i.valueOf()-o.valueOf()+" ms"}))))}));var H=n(766);N("viewport",(()=>{_("viewportMethods",(()=>{return e=void 0,n=void 0,o=function*(){const e=new t.Rect(120,20,160,100).inflate(R.d.INFLATE_SIZE,R.d.INFLATE_SIZE),[n]=(0,B.Ce)(e,!1,!1),r=new t.Rect(.1,.06,7,5.94),o=new H.l(r,n,!1,!1);E(o.xToScreen(1.5),182.4),E(o.yToScreen(2.33),73.01346801346801),E(o.xToWorld(150),-.9652173913043479),E(o.yToWorld(67),2.855294117647059)},new((r=void 0)||(r=Promise))((function(t,i){function s(t){try{l(o.next(t))}catch(t){i(t)}}function a(t){try{l(o.throw(t))}catch(t){i(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(s,a)}l((o=o.apply(e,n||[])).next())}));var e,n,r,o}))}));var q=n(416),V=n(102),j=n(111),W=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};const U={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.7412786483764648},{x:.6000000238418579,y:1.8561450242996216},{x:1.100000023841858,y:1.6065685749053955},{x:1.600000023841858,y:1.70476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"sigmoid",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[1.6914372095641517,1.1536998642628853,5.410173358224149,.2089689354045083]},K={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.5412786483764649},{x:.6000000238418579,y:1.9261450242996216},{x:1.100000023841858,y:1.6065685749053955},{x:1.600000023841858,y:1.70476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"linear",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[-5.45641324,10.456486765]},$={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.7897127864837648},{x:.6000000238418579,y:1.2101614502429963},{x:1.100000023841858,y:1.7895685749053956},{x:1.600000023841858,y:1.82476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"log-linear",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[-8.45641324,90.4456456486765]},Z={fitLineColor:"#2ca02c",pointColor:"#2ca02c",showCurveConfidenceInterval:!0,fitFunction:{name:"Polynomial",function:"([p1, p2, p3, p4], x) => p1 * x * x * x + p2 * x * x + p3 * x + p4",getInitialParameters:"(xs, ys) => [0.1, -1, 4, 4]",parameterNames:["Slope","Intercept","Parameter3","Parameter4"]},points:[{x:.10000000149011612,y:7.365033149719238},{x:.6000000238418579,y:6.595034599304199},{x:1.100000023841858,y:7.05179500579834},{x:1.600000023841858,y:7.251461982727051},{x:2.0999999046325684,y:7.775498867034912},{x:2.5999999046325684,y:7.748039722442627},{x:3.0999999046325684,y:6.8391804695129395},{x:3.5999999046325684,y:7.570991516113281},{x:4.099999904632568,y:6.387666702270508},{x:4.599999904632568,y:6.464827537536621},{x:5.099999904632568,y:3.932436227798462},{x:5.599999904632568,y:1.4741199016571045},{x:6.099999904632568,y:.47604307532310486},{x:6.599999904632568,y:.5836760401725769},{x:7.099999904632568,y:1.0317600965499878}],clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[.07070206940832963,-1.138666933634074,3.947509109407932,3.9947960440506685]},z=(0,q.Y6)(U),Q=(0,q.Y6)(K),J=(0,q.Y6)($),tt=(0,q.Y6)(Z);N("fit",(()=>{_("getSeriesFitFunction",(()=>W(void 0,void 0,void 0,(function*(){var t;const{xs:e,ys:n}=(0,q.q_)(U.points),{xs:r,ys:o}=(0,q.q_)(K.points),{xs:i,ys:s}=(0,q.q_)($.points),{xs:a,ys:l}=(0,q.q_)(Z.points);E(z.name,V.yB),E(Q.name,V.U5),E(J.name,V.lI),E(tt.name,"Polynomial"),A(z.parameterNames,["Top","Bottom","Slope","IC50"]),A(Q.parameterNames,["Slope","Intercept"]),A(J.parameterNames,["Slope","Intercept"]),A(tt.parameterNames,["Slope","Intercept","Parameter3","Parameter4"]),A(z.getInitialParameters(e,n),[1.8561450242996216,1,5.099999904632568,.23361243307590485]),A(Q.getInitialParameters(r,o),[-.1868094652891159,1.5599596500396729]),A(J.getInitialParameters(i,s),[-5,100]),A(tt.getInitialParameters(a,l),[.1,-1,4,4]);const c=new Float32Array(null===(t=U.parameters)||void 0===t?void 0:t.length);c.set(U.parameters),E(z.y(c,1.1),1.6914214561555851),E(Q.y(Q.getInitialParameters(r,o),1.1),1.3544692382216454),E(J.y(J.getInitialParameters(i,s),1.1),96.29031327635312),E(tt.y(tt.getInitialParameters(a,l),1.1),7.3231)})))),_("getCurve",(()=>W(void 0,void 0,void 0,(function*(){const t=(0,q.kG)(U,z),e=(0,q.kG)(K,Q),n=(0,q.kG)($,J),r=(0,q.kG)(Z,tt);E(t(2.5),1.690786623428712),E(t(5.8858),.5356638447565519),E(e(2.5),-3.18454647064209),E(e(5.8858),-21.658870516967774),E(n(2.5),79.85176680360948),E(n(5.8858),74.12932588432805),E(r(1.56),7.650264639782428),E(r(3.99876),6.093284856699922)})))),_("fitSeries",(()=>W(void 0,void 0,void 0,(function*(){const t=Date.now(),e=(0,q.PK)(U,z),n=(0,q.PK)(K,Q),r=(0,q.PK)($,J),o=(0,q.PK)(Z,tt),i=Date.now();return E(e.fittedCurve(2.5),1.7023284700958918),E(n.fittedCurve(2.5),1.5181158855557442),E(r.fittedCurve(2.5),2.6375155762836133),E(o.fittedCurve(3.99876),4.793906282943224),A(e.parameters,[1.7039494514465332,1.030500888824463,5.367032051086426,.2426503598690033]),A(n.parameters,[-.2137794941663742,2.0525646209716797]),A(r.parameters,[-8.782659530639648,13.640106201171875]),A(o.parameters,[.09034820646047592,-1.148695945739746,3.3145318031311035,4.130721569061279]),i.valueOf()-t.valueOf()+" ms"})))),_("getSeriesConfidenceInterval",(()=>W(void 0,void 0,void 0,(function*(){const t=(0,q.LC)(U,z,!0),e=(0,q.LC)(K,Q,!0),n=(0,q.LC)($,J,!0),r=(0,q.LC)(Z,tt,!0);E(t.confidenceTop(2.578),1.8540855269320198),E(e.confidenceTop(2.578),26.645777275332037),E(n.confidenceTop(2.578),231.75768109324696),E(r.confidenceTop(2.3342),10.03522960294218),E(t.confidenceBottom(3.987),1.4949306416468298),E(e.confidenceBottom(3.987),-41.55415698266847),E(n.confidenceBottom(3.987),-75.23471085303483),E(r.confidenceBottom(3.8796),4.1686506915250385)})))),_("getSeriesStatistics",(()=>W(void 0,void 0,void 0,(function*(){const t=(0,q.tq)(U,z),e=(0,q.tq)(Z,tt);E(t.auc,9.335422628533761),E(e.auc,36.525538394763096),E(t.rSquared,.9781915962461156),E(e.rSquared,.846055768956569)})))),_("calculateBoxPlotStatistics",(()=>W(void 0,void 0,void 0,(function*(){const t=(0,j.G)([.7654603719711304,.8199243545532227,.8257747292518616,.9558155536651611,.9596694707870483]);E(t.q1,.8199243545532227),E(t.q2,.8257747292518616),E(t.q3,.9558155536651611),E(t.lowerAdjacentValue,.7654603719711304),E(t.upperAdjacentValue,.9558155536651611)})))),_("sigmoid",(()=>W(void 0,void 0,void 0,(function*(){const t=new Float32Array(4);t.set([2.612687371569039,-1.421800778574126,5.16688669906018,.341788492203575]),E((0,V.XD)(t,.5),.341789026340178),E((0,V.XD)(t,2.5),.34215523020636207),E((0,V.XD)(t,5.678976),2.2548815999597016)})))),_("linear",(()=>W(void 0,void 0,void 0,(function*(){const t=new Float32Array(2);t.set([-5.12346546,6.24654654]),E((0,V.GE)(t,.5),3.684813976287842),E((0,V.GE)(t,2.5),-6.562117099761963),E((0,V.GE)(t,5.678976),-22.849491081970214)})))),_("log-linear",(()=>W(void 0,void 0,void 0,(function*(){const t=new Float32Array(2);t.set([-5.12346546,91.5465454654]),E((0,V.B2)(t,.5),89.46916042777144),E((0,V.B2)(t,2.5),85.12805903963536),E((0,V.B2)(t,5.678976),81.81726682791052)}))))}));var et=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};const nt=new t.Package;function rt(n,r,a){return et(this,void 0,void 0,(function*(){const x=yield function(n){var r,a,x,v,_,I,C;return i(this,void 0,void 0,(function*(){const A=null===(a=null===(r=e.functions.getCurrentCall())||void 0===r?void 0:r.func)||void 0===a?void 0:a.package;yield function(t,n){var r;return i(this,void 0,void 0,(function*(){const n=t.id;if(g[n])return;const a=d;if(void 0!==a[h]||void 0!==a[p]||Object.keys(a).find((t=>t.startsWith(h)||t.startsWith(y))))return void(g[n]=!0);if("DevTools"===t.name)for(const t of window.dartTests){const e=t.name.split(/\s*\|\s*!/g),n=null!==(r=e.pop())&&void 0!==r?r:t.name,o=e.length?y+": "+e.join(": "):y;void 0===a[o]&&(a[o]={tests:[],clear:!0}),a[o].tests.push(new w(o,n,t.test,{isAggregated:!1,timeout:s}))}const l=[],c=[],u=[],f=yield e.dapi.functions.filter(`package.id = "${n}"`).list(),x=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const t of f){const n=t.options.test,r=t.options.demoPath;if(n&&Array.isArray(n)&&n.length)for(let r=0;r<n.length;r++){const o=n[r].matchAll(x),s={};Array.from(o).forEach((t=>{t[0].startsWith("skip")?s.skip=t[1]:t[0].startsWith("wait")?s.wait=parseInt(t[2]):t[0].startsWith("cat")?s.cat=t[3]:t[0].startsWith("timeout")&&(s.timeout=parseInt(t[4]))}));const c=new w(h,1===n.length?t.name:`${t.name} ${r+1}`,(()=>i(this,void 0,void 0,(function*(){const o=yield e.functions.eval(b(n[r],t));if(s.wait&&(yield P(s.wait)),"boolean"==typeof o&&!o)throw`Failed: ${n[r]}, expected true, got ${o}`}))),{skipReason:s.skip,timeout:s.timeout});if(s.cat){const t=h+": "+s.cat;c.category=t,void 0===a[t]&&(a[t]={tests:[],clear:!0}),a[t].tests.push(c)}else l.push(c)}if(r){const n=t.options.demoWait?parseInt(t.options.demoWait):void 0,r=new w(p,t.friendlyName,(()=>i(this,void 0,void 0,(function*(){yield t.apply(),yield P(n||2e3);const r=yield e.shell.lastError;if(r)throw new Error(r)}))),{skipReason:t.options.demoSkip});c.push(r)}if(t.hasTag("semTypeDetector")){const e=new w(m,t.friendlyName,(()=>i(this,void 0,void 0,(function*(){const e=[];for(const n of o.clone().columns){const r=yield t.apply([n]);e.push(r||n.semType)}E(e.filter((t=>t)).length,1)}))),{skipReason:t.options.skipTest});u.push(e)}}g[n]=!0,l.length&&(a[h]={tests:l,clear:!0}),c.length&&(a[p]={tests:c,clear:!0}),u.length&&(a[m]={tests:u,clear:!1})}))}(A);const N=[];console.log("Running tests"),null!=n||(n={}),null!==(x=(C=n).testContext)&&void 0!==x||(C.testContext=new T);const R=[],M=function(){const t=[];return console.log=(...e)=>{t.push(...e),l(...e)},console.info=(...e)=>{t.push(...e),c(...e)},console.warn=(...e)=>{t.push(...e),u(...e)},console.error=(...e)=>{t.push(...e),f(...e)},t}();try{for(const[r,o]of Object.entries(d)){if((null==n?void 0:n.category)&&!r.toLowerCase().startsWith(null==n?void 0:n.category.toLowerCase())||(null===(v=n.exclude)||void 0===v?void 0:v.some((t=>r.startsWith(t)))))continue;l(`Started ${r} category`),R.push(r);const s=null===(_=o.tests)||void 0===_?void 0:_.every((t=>{var e;return null===(e=t.options)||void 0===e?void 0:e.skipReason}));try{o.before&&!s&&(yield O((()=>i(this,void 0,void 0,(function*(){yield o.before()}))),1e5,`before ${n.category}: timeout error`))}catch(t){o.beforeStatus=yield L(t)}const a=null!==(I=o.tests)&&void 0!==I?I:[],c=[];if(o.clear)for(let r=0;r<a.length;r++)c.push(yield S(a[r],null==n?void 0:n.test,M,o.timeout,A.name,n.verbose)),e.shell.closeAll(),t.Balloon.closeAll();else for(let t=0;t<a.length;t++)c.push(yield S(a[t],null==n?void 0:n.test,M,o.timeout,A.name,n.verbose));const u=c.filter((t=>"skipped"!=t.result));try{o.after&&!s&&(yield O((()=>i(this,void 0,void 0,(function*(){yield o.after()}))),1e5,`After ${n.category}: timeout error`))}catch(t){o.afterStatus=yield L(t)}o.afterStatus&&u.push({category:r,name:"after",result:o.afterStatus,success:!1,ms:0,skipped:!1}),o.beforeStatus&&u.push({category:r,name:"before",result:o.beforeStatus,success:!1,ms:0,skipped:!1}),N.push(...u)}}finally{console.log=l,console.info=c,console.warn=u,console.error=f}if(n.testContext.catchUnhandled){yield P(1e3);const t=yield e.shell.lastError,n={category:"Unhandled exceptions",name:"Exception",result:null!=t?t:"",success:!t,ms:0,skipped:!1};N.push(n),n.package=A.name,null!=e.shell.reportTest?yield e.shell.reportTest("package",n):yield fetch(`${e.dapi.root}/log/tests/package`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(n)})}return N}))}({category:n,test:r,testContext:a});return t.DataFrame.fromObjects(x)}))}})(),curves_test=r})();
|
|
1
|
+
var curves_test;(()=>{var t={368:(t,e,n)=>{"use strict";function r(t){t.sort();const e=t[Math.trunc(t.length/4)],n=t.length%2==0?(t[Math.trunc(t.length/2)]+t[Math.trunc(t.length/2)-1])/2:t[Math.trunc(t.length/2)],r=t[Math.trunc(3*t.length/4)],i=1.5*(r-e);let s=o(t,r+i);s<0&&(s=~s);let a=t[Math.max(0,s-1)];a<r&&(a=r);let l=o(t,e-i);l<0&&(l=~l);let c=t[l];return c>e&&(c=e),{q1:e,q2:n,q3:r,lowerAdjacentValue:c,upperAdjacentValue:a}}function o(t,e,n=0,r){if(0===t.length)return-1;if(void 0===r&&(r=t.length-1),e<t[n])return-1;if(e>t[r])return-(r+1);for(;r-n>1;){const o=Math.trunc((r+n)/2);if(e===t[o])return o;e<t[o]?r=o:n=o}return t[n]===e?n:0===t[r]?r:e<t[n]?-(n+1):-(r+1)}n.d(e,{k:()=>r})},71:(t,e,n)=>{"use strict";n.d(e,{Ff:()=>w,kx:()=>T,G7:()=>v,oH:()=>h,dZ:()=>f,xs:()=>g,W6:()=>C,IL:()=>x,O8:()=>I,ah:()=>E,TV:()=>_,mW:()=>A,sn:()=>b,AJ:()=>L,ry:()=>N,nK:()=>y});var r,o=n(82),i=n(572);class s extends Error{constructor(t){super(t)}}function a(t,e,n,r){for(let o=0;o<e;o++){let i=0;for(let t=0;t<e+1;t++)t!==n&&(i+=r[t][o]);t[o]=i/e}}function l(t,e,n,r,o,i,s,a){for(let l=0;l<i;l++)e[l]=t[l],e[l]+=o*(t[l]-r[n][l]),e[l]<s[l]?e[l]=s[l]:e[l]>a[l]&&(e[l]=a[l])}!function(t){t[t.TOLERANCE=.01]="TOLERANCE",t[t.MAX_ITER=20]="MAX_ITER",t[t.NON_ZERO_PARAM=1e-4]="NON_ZERO_PARAM",t[t.INITIAL_SCALE=.02]="INITIAL_SCALE",t[t.SCALE_REFLECTION=1]="SCALE_REFLECTION",t[t.SCALE_EXPANSION=2]="SCALE_EXPANSION",t[t.SCALE_CONTRACTION=-.5]="SCALE_CONTRACTION"}(r||(r={})),new Map([["tolerance","Tolerance"],["maxIter","Max iterations"],["nonZeroParam","Non-zero param"],["initialScale","Initial scale"],["scaleReflection","Scale reflection"],["scaleExpansion","Scale expansion"],["scaleContraction","Scale contraction"]]);const c=function(t,e,n,r,o){const i=n.tolerance,s=n.maxIter,c=n.scaleReflection,u=n.scaleExpansion,f=n.scaleContraction,h=e.length+1,d=e.length,[m,p]=function(t,e,n,r,o){const i=n.length+1,s=n.length,a=e.nonZeroParam,l=e.initialScale,c=new Array(i),u=new Array(i);for(let e=0;e<i;e++){c[e]=new Float32Array(s);for(let t=0;t<s;t++)c[e][t]=n[t],0!==e&&e-1===t&&(0===n[t]?c[e][t]=a:c[e][t]+=l*n[e-1],c[e][t]<r[t]?c[e][t]=r[t]:c[e][t]>o[t]&&(c[e][t]=o[t]));u[e]=t(c[e])}return[c,u]}(t,n,e,r,o),y=new Array(h);for(let t=0;t<h;t++)y[t]=t;const g=y.length-1;let x=0,v=0,w=0,T=0;const _=new Float32Array(d),C=new Float32Array(d),E=new Float32Array(d),I=new Float32Array(d),A=new Array(s);if(h>1){for(;y.sort(((t,e)=>p[t]-p[e])),!(x>s);){if(0===x&&(v=p[0],w=2*p[y[0]]),A[x]=v,++x,v=p[y[0]],w-v>i)T=0;else if(++T,T>2*h)break;w=v,a(_,d,y[g],m),l(_,C,y[g],m,c,d,r,o);const e=t(C);if(e<p[y[g]]){l(_,E,y[g],m,u,d,r,o);const n=t(E);if(n<e){p[y[g]]=n;for(let t=0;t<d;t++)m[y[g]][t]=E[t];continue}p[y[g]]=e;for(let t=0;t<d;t++)m[y[g]][t]=C[t];continue}l(_,I,y[g],m,f,d,r,o);const n=t(I);if(!(n<p[y[g]]))break;p[y[g]]=n;for(let t=0;t<d;t++)m[y[g]][t]=I[t]}for(let t=x;t<s;t++)A[t]=p[y[0]]}return{point:m[y[0]],cost:p[y[0]],iterCosts:A,iterCount:x-1}};function u(t,e,n){const r=e-n,o=new Array(t);for(let e=0;e<t;e++){const t=Math.random();o[e]=n+t*r}return o}const f={CONSTANT:"constant",PROPORTIONAL:"proportional",COMBINED:"combined"};class h{constructor(){this.chartOptions={},this.seriesOptions={},this.series=[]}}class d{}class m extends d{constructor(t,e,n,r){super(),this._name=t,this._parameterNames=r,this.y=e,this.getInitialParameters=n}get name(){return this._name}get parameterNames(){return this._parameterNames}y(t,e){throw new Error("Not implemented")}getInitialParameters(t,e){throw new Error("Not implemented")}}const p={linear:new class extends d{get name(){return w}get parameterNames(){return["Slope","Intercept"]}y(t,e){return b(t,e)}getInitialParameters(t,e){let n=0,r=0;for(let e=1;e<t.length;e++)t[e]<t[n]&&(n=e),t[e]>t[r]&&(r=e);const o=t[r]-t[n],i=(e[r]-e[n])/o,s=e[r]-i*t[r],a=new Float32Array(2);return a.set([i,s]),a}},sigmoid:new class extends d{get name(){return v}get parameterNames(){return["Top","Bottom","Slope","IC50"]}y(t,e){return N(t,e)}getInitialParameters(t,e){const n=o.Rect.fromXYArrays(t,e),r=(n.bottom-n.top)/2+n.top;let i=n.bottom-n.top,s=0;for(let n=0;n<t.length;n++){const t=Math.abs(e[n]-r);t<i&&(i=t,s=n)}const a=t[s],l=e[0]>e[e.length-1]?1:-1,c=new Float32Array(4);return c.set([n.bottom,l,a,n.top]),c}},"log-linear":new class extends d{get name(){return T}get parameterNames(){return["Slope","Intercept"]}y(t,e){return L(t,e)}getInitialParameters(t,e){const n=new Float32Array(2);return n.set([-5,100]),n}}},y=[o.Property.js("rSquared",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("auc",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("interceptY",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("interceptX",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("slope",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("top",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("bottom",o.TYPE.FLOAT,{userEditable:!1})],g=[o.Property.js("minX",o.TYPE.FLOAT,{nullable:!0}),o.Property.js("minY",o.TYPE.FLOAT,{nullable:!0}),o.Property.js("maxX",o.TYPE.FLOAT,{nullable:!0}),o.Property.js("maxY",o.TYPE.FLOAT,{nullable:!0}),o.Property.js("title",o.TYPE.STRING,{nullable:!0}),o.Property.js("xAxisName",o.TYPE.STRING,{description:"Label to show on the X axis. If not specified, corresponding data column name is used",nullable:!0}),o.Property.js("yAxisName",o.TYPE.STRING,{description:"Label to show on the Y axis. If not specified, corresponding data column name is used",nullable:!0}),o.Property.js("logX",o.TYPE.BOOL,{description:"Whether the X axis should be logarithmic",defaultValue:!1}),o.Property.js("logY",o.TYPE.BOOL,{description:"Whether the Y axis should be logarithmic",defaultValue:!1}),o.Property.js("allowXZeroes",o.TYPE.BOOL,{description:"Whether x zeroes allowed for logarithmic data or not",defaultValue:!0}),o.Property.js("mergeSeries",o.TYPE.BOOL,{description:"Merges all series within one cell into one series",defaultValue:!1}),o.Property.js("showColumnLabel",o.TYPE.BOOL,{description:"Whether to show the column label in the legend or not",defaultValue:!1}),o.Property.js("showStatistics",o.TYPE.STRING_LIST,{description:"Whether specific statistics should be rendered",choices:y.map((t=>t.name)),inputType:"MultiChoice",friendlyName:"Statistics"})],x=[o.Property.js("fitFunction",o.TYPE.STRING,{category:"Fitting",choices:Object.keys(p),defaultValue:"sigmoid"}),o.Property.js("pointColor",o.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),o.Property.js("fitLineColor",o.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),o.Property.js("outlierColor",o.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),o.Property.js("errorModel",o.TYPE.STRING,{category:"Fitting",defaultValue:"constant",choices:["constant","proportional","combined"],nullable:!1}),o.Property.js("connectDots",o.TYPE.BOOL,{category:"Fitting",defaultValue:!1}),o.Property.js("clickToToggle",o.TYPE.BOOL,{category:"Fitting",description:"Click on a point to mark it as outlier and refit",nullable:!0,defaultValue:!1}),o.Property.js("showFitLine",o.TYPE.BOOL,{category:"Fitting",defaultValue:!0}),o.Property.js("showPoints",o.TYPE.STRING,{category:"Fitting",description:"Whether points/candlesticks/none should be rendered",defaultValue:"points",choices:["points","candlesticks","both"]}),o.Property.js("showCurveConfidenceInterval",o.TYPE.BOOL,{category:"Fitting",description:"Whether confidence intervals should be rendered",defaultValue:!1,friendlyName:"Confidence Interval"}),o.Property.js("markerType",o.TYPE.STRING,{category:"Rendering",defaultValue:"circle",choices:["asterisk","circle","cross border","diamond","square","star","triangle bottom","triangle left","triangle right","triangle top"],nullable:!1,friendlyName:"Marker"}),o.Property.js("outlierMarkerType",o.TYPE.STRING,{category:"Rendering",defaultValue:"outlier",choices:["asterisk","circle","cross border","diamond","outlier","square","star","triangle bottom","triangle left","triangle right","triangle top"],nullable:!1,friendlyName:"Outlier Marker"}),o.Property.js("lineStyle",o.TYPE.STRING,{category:"Rendering",defaultValue:"solid",choices:["solid","dotted","dashed","dashdotted"],nullable:!1}),o.Property.js("droplines",o.TYPE.STRING_LIST,{description:"Whether specific droplines should be rendered",choices:["IC50"],inputType:"MultiChoice"}),o.Property.js("columnName",o.TYPE.STRING,{description:"Column name where the series is stored",defaultValue:""})],v="sigmoid",w="linear",T="log-linear";function _(t){if("string"==typeof t)return p[t];if(!p[t.name]){const e=t.name,n=t.parameterNames,r=t.function.split("=>").map((t=>t.trim())),o=t.getInitialParameters.split("=>").map((t=>t.trim())),i=new Function(r[0].slice(1,r[0].length-1),`${r[1].includes(";")?"":"return "}${r[1]}`),s=new Function(o[0].slice(1,o[0].length-1),`return ${o[1]}`),a=new m(e,i,s,n);p[e]=a}return p[t.name]}function C(t,e,n,i){const a=e.y;let l=e.getInitialParameters(t.x,t.y);const h=function(t,e,n){return r=>{let o=0,i=0,s=0;const a=e.y,l=e.x.map((e=>t(r,e))),c=a.map(((t,e)=>t-l[e])).map((t=>Math.pow(t,2)));for(let t=0;t<c.length;t++)[f.CONSTANT,f.COMBINED].includes(n)?i+=c[t]:n===f.PROPORTIONAL&&(s+=c[t]/(l[t]*l[t]));i=Math.sqrt(i/c.length),s=Math.sqrt(s/c.length),n===f.COMBINED&&({sigmaA:i,sigmaB:s}=P(i,s,c,l));const u=[];for(let t=0;t<c.length;t++)u[t]=Math.pow(i+s*l[t],2),o+=c[t]/u[t]+Math.log(2*Math.PI*u[t]);return o}}(a,t,n);let d=new Float32Array(e.parameterNames.length),m=new Float32Array(e.parameterNames.length);for(let t=0;t<e.parameterNames.length;t++)d[t]=0===l[t]?-1:l[t]-Math.abs(.5*l[t]),m[t]=0===l[t]?1:l[t]+Math.abs(.5*l[t]);return i&&0!==i.length&&(d=new Float32Array(i.length),d.set(i.map((t=>t.min))),m=new Float32Array(i.length),m.set(i.map((t=>t.max)))),l=function(t,e,n,r,i=1,a=null,l=!0){const f=function(t,e,n){const r=e.length,o=new Array(t);for(let e=0;e<t;e++)o[e]=new Float32Array(r);for(let i=0;i<r;i++)if(e[i]===n[i])for(let n=0;n<t;n++)o[n][i]=e[i];else{const r=u(t,e[i],n[i]);for(let e=0;e<t;e++)o[e][i]=r[e]}return o}(i,n,e);null!==a&&(f[0]=a);const h=[],d=[],m=[];let p,y=0,g=null;for(p=0;p<i;++p)try{if(0===p&&l){const e=new Float32Array(a.length).map((t=>-1/0)),n=new Float32Array(a.length).map((t=>1/0));h.push(c(t,f[p],r,e,n))}else h.push(c(t,f[p],r,e,n))}catch(t){if(t instanceof s)throw new Error(`Inconsistent dataframes: ${t.message}`);++y,d.push(t instanceof Error?t.message:"Platform issue"),m.push(f[p])}if(y>0){const t=n.length,e=new Array(t);for(let n=0;n<t;++n)e[n]=new Float32Array(y);m.forEach(((t,n)=>t.forEach(((t,r)=>e[r][n]=t)))),g=o.DataFrame.fromColumns(e.map(((t,e)=>o.Column.fromFloat32Array(`arg${e}`,t)))),g.columns.add(o.Column.fromStrings("Issue",d))}return{extremums:h,fails:g}}(h,d,m,{tolerance:r.TOLERANCE,maxIter:r.MAX_ITER,nonZeroParam:r.NON_ZERO_PARAM,initialScale:r.INITIAL_SCALE,scaleReflection:r.SCALE_REFLECTION,scaleExpansion:r.SCALE_EXPANSION,scaleContraction:r.SCALE_CONTRACTION},1,l).extremums[0].point,{fittedCurve:E(a,l),parameters:l}}function E(t,e){return n=>t(e,n)}function I(t,e,n,r=.05,o){const s=function(t,e,n,r){let o=0,i=0;const s=e.y,a=e.x.map((e=>t(r,e))),l=s.map(((t,e)=>t-a[e])),c=l.map((t=>Math.pow(t,2)));for(let t=0;t<c.length;t++)[f.CONSTANT,f.COMBINED].includes(n)?o+=c[t]:n===f.PROPORTIONAL&&(i+=Math.pow(l[t]/Math.abs(a[t]),2));return o=Math.sqrt(o/c.length),i=Math.sqrt(i/c.length),n===f.COMBINED&&({sigmaA:o,sigmaB:i}=P(o,i,c,a)),{sigmaA:o,sigmaB:i}}(n,t,o,e),a=i.normal.inv(1-r/2,0,1);return{confidenceTop:t=>{const r=n(e,t);return r+a*(s.sigmaA+Math.abs(r)*s.sigmaB)},confidenceBottom:t=>{const r=n(e,t);return r-a*(s.sigmaA+Math.abs(r)*s.sigmaB)}}}function A(t,e,n,r=!0){const o=E(n,e);return{rSquared:r?O(o,t):void 0,auc:r?S(o,t):void 0,interceptX:e[2],interceptY:o(e[2]),slope:e[1],top:e[0],bottom:e[3]}}function N(t,e){const n=t[0],r=t[1],o=t[2],i=t[3];return i+(n-i)/(1+Math.pow(10,(e-o)*r))}function b(t,e){return t[0]*e+t[1]}function L(t,e){const n=t[0],r=t[1];return n*Math.log(e+1)+r}function S(t,e){let n=0;const r=Math.min(...e.x),o=Math.max(...e.x),i=(o-r)/1e3;for(let e=r;e<o;e+=i)n+=i*t(e);return n}function O(t,e){let n=0,r=0;const o=i.mean(e.y);for(let i=0;i<e.x.length;i++)n+=Math.pow(e.y[i]-t(e.x[i]),2),r+=Math.pow(e.y[i]-o,2);return 1-n/r}function P(t,e,n,r){let o=Number.MAX_VALUE,i=0;for(let e=0;e<=10;e++){let s=0;const a=e/10,l=t*a,c=t*(1-a),u=[];for(let t=0;t<n.length;t++)u[t]=Math.pow(l+c*r[t],2),s+=n[t]/u[t]+Math.log(2*Math.PI*u[t]);s<o&&(o=s,i=a)}return e=t*(1-i),{sigmaA:t*=i,sigmaB:e}}},999:(t,e,n)=>{"use strict";n.d(e,{Kh:()=>s,VA:()=>m,W$:()=>a,_T:()=>f,fY:()=>d,nT:()=>h,s$:()=>c,zB:()=>u});var r=n(82),o=n(71);function i(t){const e={};for(const n of t)null!==n.defaultValue&&(e[n.name]=n.defaultValue);return e}function s(){return{chartOptions:i(o.xs),seriesOptions:i(o.IL)}}function a(t){const e=[],n=[];for(let r=0;r<t.length;r++)e[r]=t[r].x,n[r]=t[r].y;return{xs:e,ys:n}}function l(t){const e=Math.floor(t.y.length/2),n=t.y.sort(((t,e)=>t-e));return n.length%2==0?(n[e-1]+n[e])/2:n[e]}function c(t){var e;const n=t.chartOptions;if((null===(e=t.series)||void 0===e?void 0:e.length)&&0!==t.series.length){const{xs:e,ys:o}=a(t.series[0].points);let i=r.Rect.fromXYArrays(e,o);for(let e=1;e<t.series.length;e++){const{xs:n,ys:o}=a(t.series[e].points);n.some((t=>void 0===t))||o.some((t=>void 0===t))||(i=i.union(r.Rect.fromXYArrays(n,o)))}return n?function(t,e){let n=t.x,o=t.y,i=t.width,s=t.height;return void 0!==e.minX&&null!==e.minX&&(!e.logX||e.logX&&e.minX>0)&&(i+=n-e.minX,n=e.minX),void 0!==e.maxX&&null!==e.maxX&&(!e.logX||e.logX&&e.maxX>0)&&(i+=e.maxX-(n+i)),void 0!==e.minY&&null!==e.minY&&(!e.logY||e.logY&&e.minY>0)&&(s+=o-e.minY,o=e.minY),void 0!==e.maxY&&null!==e.maxY&&(!e.logY||e.logY&&e.maxY>0)&&(s+=e.maxY-(o+s)),new r.Rect(n,o,i,s)}(i,n):i}return new r.Rect(0,0,1,1)}function u(t){return(0,o.TV)(t.fitFunction)}function f(t,e){var n;const r=new Float32Array(null===(n=t.parameters)||void 0===n?void 0:n.length);return r.set(t.parameters),(0,o.ah)(e.y,r)}function h(t,e,n){var r;const i={x:t.points.filter((t=>!t.outlier)).map((t=>(null==n?void 0:n.logX)?Math.log10(t.x):t.x)),y:t.points.filter((t=>!t.outlier)).map((t=>(null==n?void 0:n.logY)?Math.log10(t.y):t.y))};var s;return t.parameterBounds&&(null==n?void 0:n.logX)&&(t.parameterBounds[2]=((s=t.parameterBounds[2])&&(void 0!==s.max&&(s.max=Math.log10(s.max)),void 0!==s.min&&(s.min=0===s.min?-Number.MAX_VALUE:Math.log10(s.min))),s)),(0,o.W6)(function(t){const e={x:[],y:[]},n={x:[t.x[0]],y:[t.y[0]]};for(let r=1;r<t.x.length;r++){if(t.x[r]===n.x[0]){n.x[n.x.length]=t.x[r],n.y[n.y.length]=t.y[r];continue}const o=l(n);e.x[e.x.length]=n.x[0],e.y[e.y.length]=o,n.x=[t.x[r]],n.y=[t.y[r]]}const r=l(n);return e.x[e.x.length]=n.x[0],e.y[e.y.length]=r,e}(i),e,null!==(r=t.errorModel)&&void 0!==r?r:o.dZ.CONSTANT,t.parameterBounds)}function d(t,e,n,r){var i,s;const a=n?{x:t.points.map((t=>(null==r?void 0:r.logX)?Math.log10(t.x):t.x)),y:t.points.map((t=>(null==r?void 0:r.logY)?Math.log10(t.y):t.y))}:{x:t.points.filter((t=>!t.outlier)).map((t=>(null==r?void 0:r.logX)?Math.log10(t.x):t.x)),y:t.points.filter((t=>!t.outlier)).map((t=>(null==r?void 0:r.logY)?Math.log10(t.y):t.y))};if(!t.parameters){const n=h(t,e).parameters;t.parameters=[...n]}const l=new Float32Array(null===(i=t.parameters)||void 0===i?void 0:i.length);return l.set(t.parameters),(0,o.O8)(a,l,e.y,.05,null!==(s=t.errorModel)&&void 0!==s?s:o.dZ.CONSTANT)}function m(t,e,n){var r;const i={x:t.points.filter((t=>!t.outlier)).map((t=>(null==n?void 0:n.logX)?Math.log10(t.x):t.x)),y:t.points.filter((t=>!t.outlier)).map((t=>(null==n?void 0:n.logY)?Math.log10(t.y):t.y))};if(!t.parameters){const n=h(t,e).parameters;t.parameters=[...n]}const s=new Float32Array(null===(r=t.parameters)||void 0===r?void 0:r.length);return s.set(t.parameters),(0,o.mW)(i,s,e.y,!0)}},293:(t,e,n)=>{"use strict";n.d(e,{L:()=>a});var r=n(82);const o=1e-30,i=new class{screenToWorld(t,e,n,r,o){return n+(o?1-t/e:t/e)*(r-n)}worldToScreen(t,e,n,r,o){return o?(1-(t-n)/(r-n))*e:(t-n)/(r-n)*e}},s=new class{screenToWorld(t,e,n,r,i){n=n<o?o:n;const s=Math.log(r),a=Math.log(n);return Math.exp(a+(s-a)*(i?e-t:t)/e)}worldToScreen(t,e,n,r,i){if(t<=0)return NaN;if(Math.abs(t-n)<o)return i?e:0;if(Math.abs(t-r)<o)return i?0:e;n=n<o?o:n,t=t<o?o:t;const s=e*Math.log(t/n)/Math.log(r/n);return i?e-s:s}};class a{get xt(){return this.logX?s:i}get yt(){return this.logY?s:i}constructor(t,e,n=!1,r=!1){this.logX=!1,this.logY=!1,this.inverseX=!1,this.inverseY=!1,this.world=t,this.screen=e,this.logX=n,this.logY=r}xToScreen(t){return this.screen.left+this.xt.worldToScreen(t,this.screen.width,this.world.minX,this.world.maxX,this.inverseX)}yToScreen(t){return this.screen.top+this.yt.worldToScreen(t,this.screen.height,this.world.minY,this.world.maxY,!this.inverseY)}xToWorld(t){return this.xt.screenToWorld(t-this.screen.left,this.screen.width,this.world.minX,this.world.maxX,this.inverseX)}yToWorld(t){return this.yt.screenToWorld(t-this.screen.top,this.screen.height,this.world.minY,this.world.maxY,!this.inverseY)}toScreen(t){return new r.Point(this.xToScreen(t.x),this.yToScreen(t.y))}toWorld(t){return new r.Point(this.xToWorld(t.x),this.yToWorld(t.y))}drawCoordinateGrid(t,e,n){e&&r.Paint.horzAxis(t,this.world.minX,this.world.maxX,e.x,e.y,e.width,e.height,this.logX,this.inverseX),n&&r.Paint.vertAxis(t,this.world.minY,this.world.maxY,n.x,n.y,n.width,n.height,this.logY,this.inverseY)}}},982:function(t,e,n){var r;!function(){var e={};!function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(t,n,r,o,i){for(var s,a,l,c,u,f,h,d,m,p,y,g,x;i>=64;){for(s=n[0],a=n[1],l=n[2],c=n[3],u=n[4],f=n[5],h=n[6],d=n[7],p=0;p<16;p++)y=o+4*p,t[p]=(255&r[y])<<24|(255&r[y+1])<<16|(255&r[y+2])<<8|255&r[y+3];for(p=16;p<64;p++)g=((m=t[p-2])>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,x=((m=t[p-15])>>>7|m<<25)^(m>>>18|m<<14)^m>>>3,t[p]=(g+t[p-7]|0)+(x+t[p-16]|0);for(p=0;p<64;p++)g=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&f^~u&h)|0)+(d+(e[p]+t[p]|0)|0)|0,x=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&a^s&l^a&l)|0,d=h,h=f,f=u,u=c+g|0,c=l,l=a,a=s,s=g+x|0;n[0]+=s,n[1]+=a,n[2]+=l,n[3]+=c,n[4]+=u,n[5]+=f,n[6]+=h,n[7]+=d,o+=64,i-=64}return o}var r=function(){function e(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return e.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},e.prototype.clean=function(){for(var t=0;t<this.buffer.length;t++)this.buffer[t]=0;for(t=0;t<this.temp.length;t++)this.temp[t]=0;this.reset()},e.prototype.update=function(t,e){if(void 0===e&&(e=t.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this.bytesHashed+=e,this.bufferLength>0){for(;this.bufferLength<64&&e>0;)this.buffer[this.bufferLength++]=t[r++],e--;64===this.bufferLength&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(e>=64&&(r=n(this.temp,this.state,t,r,e),e%=64);e>0;)this.buffer[this.bufferLength++]=t[r++],e--;return this},e.prototype.finish=function(t){if(!this.finished){var e=this.bytesHashed,r=this.bufferLength,o=e/536870912|0,i=e<<3,s=e%64<56?64:128;this.buffer[r]=128;for(var a=r+1;a<s-8;a++)this.buffer[a]=0;this.buffer[s-8]=o>>>24&255,this.buffer[s-7]=o>>>16&255,this.buffer[s-6]=o>>>8&255,this.buffer[s-5]=o>>>0&255,this.buffer[s-4]=i>>>24&255,this.buffer[s-3]=i>>>16&255,this.buffer[s-2]=i>>>8&255,this.buffer[s-1]=i>>>0&255,n(this.temp,this.state,this.buffer,0,s),this.finished=!0}for(a=0;a<8;a++)t[4*a+0]=this.state[a]>>>24&255,t[4*a+1]=this.state[a]>>>16&255,t[4*a+2]=this.state[a]>>>8&255,t[4*a+3]=this.state[a]>>>0&255;return this},e.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},e.prototype._saveState=function(t){for(var e=0;e<this.state.length;e++)t[e]=this.state[e]},e.prototype._restoreState=function(t,e){for(var n=0;n<this.state.length;n++)this.state[n]=t[n];this.bytesHashed=e,this.finished=!1,this.bufferLength=0},e}();t.Hash=r;var o=function(){function t(t){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var e=new Uint8Array(this.blockSize);if(t.length>this.blockSize)(new r).update(t).finish(e).clean();else for(var n=0;n<t.length;n++)e[n]=t[n];for(n=0;n<e.length;n++)e[n]^=54;for(this.inner.update(e),n=0;n<e.length;n++)e[n]^=106;for(this.outer.update(e),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate),n=0;n<e.length;n++)e[n]=0}return t.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},t.prototype.clean=function(){for(var t=0;t<this.istate.length;t++)this.ostate[t]=this.istate[t]=0;this.inner.clean(),this.outer.clean()},t.prototype.update=function(t){return this.inner.update(t),this},t.prototype.finish=function(t){return this.outer.finished?this.outer.finish(t):(this.inner.finish(t),this.outer.update(t,this.digestLength).finish(t)),this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t}();function i(t){var e=(new r).update(t),n=e.digest();return e.clean(),n}function s(t,e){var n=new o(t).update(e),r=n.digest();return n.clean(),r}function a(t,e,n,r){var o=r[0];if(0===o)throw new Error("hkdf: cannot expand more");e.reset(),o>1&&e.update(t),n&&e.update(n),e.update(r),e.finish(t),r[0]++}t.HMAC=o,t.hash=i,t.default=i,t.hmac=s;var l=new Uint8Array(t.digestLength);t.hkdf=function(t,e,n,r){void 0===e&&(e=l),void 0===r&&(r=32);for(var i=new Uint8Array([1]),c=s(e,t),u=new o(c),f=new Uint8Array(u.digestLength),h=f.length,d=new Uint8Array(r),m=0;m<r;m++)h===f.length&&(a(f,u,n,i),h=0),d[m]=f[h++];return u.clean(),f.fill(0),i.fill(0),d},t.pbkdf2=function(t,e,n,r){for(var i=new o(t),s=i.digestLength,a=new Uint8Array(4),l=new Uint8Array(s),c=new Uint8Array(s),u=new Uint8Array(r),f=0;f*s<r;f++){var h=f+1;a[0]=h>>>24&255,a[1]=h>>>16&255,a[2]=h>>>8&255,a[3]=h>>>0&255,i.reset(),i.update(e),i.update(a),i.finish(c);for(var d=0;d<s;d++)l[d]=c[d];for(d=2;d<=n;d++){i.reset(),i.update(c).finish(c);for(var m=0;m<s;m++)l[m]^=c[m]}for(d=0;d<s&&f*s+d<r;d++)u[f*s+d]=l[d]}for(f=0;f<s;f++)l[f]=c[f]=0;for(f=0;f<4;f++)a[f]=0;return i.clean(),u}}(e);var o=e.default;for(var i in e)o[i]=e[i];"object"==typeof t.exports?t.exports=o:void 0===(r=function(){return o}.call(e,n,e,t))||(t.exports=r)}()},572:function(t){var e;t.exports=(e=function(t,e){var n=Array.prototype.concat,r=Array.prototype.slice,o=Object.prototype.toString;function i(e,n){var r=e>n?e:n;return t.pow(10,17-~~(t.log(r>0?r:-r)*t.LOG10E))}var s=Array.isArray||function(t){return"[object Array]"===o.call(t)};function a(t){return"[object Function]"===o.call(t)}function l(t){return"number"==typeof t&&t-t==0}function c(){return new c._init(arguments)}function u(){return 0}function f(){return 1}function h(t,e){return t===e?1:0}c.fn=c.prototype,c._init=function(t){if(s(t[0]))if(s(t[0][0])){a(t[1])&&(t[0]=c.map(t[0],t[1]));for(var e=0;e<t[0].length;e++)this[e]=t[0][e];this.length=t[0].length}else this[0]=a(t[1])?c.map(t[0],t[1]):t[0],this.length=1;else if(l(t[0]))this[0]=c.seq.apply(null,t),this.length=1;else{if(t[0]instanceof c)return c(t[0].toArray());this[0]=[],this.length=1}return this},c._init.prototype=c.prototype,c._init.constructor=c,c.utils={calcRdx:i,isArray:s,isFunction:a,isNumber:l,toVector:function(t){return n.apply([],t)}},c._random_fn=t.random,c.setRandom=function(t){if("function"!=typeof t)throw new TypeError("fn is not a function");c._random_fn=t},c.extend=function(t){var e,n;if(1===arguments.length){for(n in t)c[n]=t[n];return this}for(e=1;e<arguments.length;e++)for(n in arguments[e])t[n]=arguments[e][n];return t},c.rows=function(t){return t.length||1},c.cols=function(t){return t[0].length||1},c.dimensions=function(t){return{rows:c.rows(t),cols:c.cols(t)}},c.row=function(t,e){return s(e)?e.map((function(e){return c.row(t,e)})):t[e]},c.rowa=function(t,e){return c.row(t,e)},c.col=function(t,e){if(s(e)){var n=c.arange(t.length).map((function(){return new Array(e.length)}));return e.forEach((function(e,r){c.arange(t.length).forEach((function(o){n[o][r]=t[o][e]}))})),n}for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=[t[o][e]];return r},c.cola=function(t,e){return c.col(t,e).map((function(t){return t[0]}))},c.diag=function(t){for(var e=c.rows(t),n=new Array(e),r=0;r<e;r++)n[r]=[t[r][r]];return n},c.antidiag=function(t){for(var e=c.rows(t)-1,n=new Array(e),r=0;e>=0;e--,r++)n[r]=[t[r][e]];return n},c.transpose=function(t){var e,n,r,o,i,a=[];for(s(t[0])||(t=[t]),n=t.length,r=t[0].length,i=0;i<r;i++){for(e=new Array(n),o=0;o<n;o++)e[o]=t[o][i];a.push(e)}return 1===a.length?a[0]:a},c.map=function(t,e,n){var r,o,i,a,l;for(s(t[0])||(t=[t]),o=t.length,i=t[0].length,a=n?t:new Array(o),r=0;r<o;r++)for(a[r]||(a[r]=new Array(i)),l=0;l<i;l++)a[r][l]=e(t[r][l],r,l);return 1===a.length?a[0]:a},c.cumreduce=function(t,e,n){var r,o,i,a,l;for(s(t[0])||(t=[t]),o=t.length,i=t[0].length,a=n?t:new Array(o),r=0;r<o;r++)for(a[r]||(a[r]=new Array(i)),i>0&&(a[r][0]=t[r][0]),l=1;l<i;l++)a[r][l]=e(a[r][l-1],t[r][l]);return 1===a.length?a[0]:a},c.alter=function(t,e){return c.map(t,e,!0)},c.create=function(t,e,n){var r,o,i=new Array(t);for(a(e)&&(n=e,e=t),r=0;r<t;r++)for(i[r]=new Array(e),o=0;o<e;o++)i[r][o]=n(r,o);return i},c.zeros=function(t,e){return l(e)||(e=t),c.create(t,e,u)},c.ones=function(t,e){return l(e)||(e=t),c.create(t,e,f)},c.rand=function(t,e){return l(e)||(e=t),c.create(t,e,c._random_fn)},c.identity=function(t,e){return l(e)||(e=t),c.create(t,e,h)},c.symmetric=function(t){var e,n,r=t.length;if(t.length!==t[0].length)return!1;for(e=0;e<r;e++)for(n=0;n<r;n++)if(t[n][e]!==t[e][n])return!1;return!0},c.clear=function(t){return c.alter(t,u)},c.seq=function(t,e,n,r){a(r)||(r=!1);var o,s=[],l=i(t,e),c=(e*l-t*l)/((n-1)*l),u=t;for(o=0;u<=e&&o<n;u=(t*l+c*l*++o)/l)s.push(r?r(u,o):u);return s},c.arange=function(t,n,r){var o,i=[];if(r=r||1,n===e&&(n=t,t=0),t===n||0===r)return[];if(t<n&&r<0)return[];if(t>n&&r>0)return[];if(r>0)for(o=t;o<n;o+=r)i.push(o);else for(o=t;o>n;o+=r)i.push(o);return i},c.slice=function(){function t(t,n,r,o){var i,s=[],a=t.length;if(n===e&&r===e&&o===e)return c.copy(t);if(o=o||1,(n=(n=n||0)>=0?n:a+n)===(r=(r=r||t.length)>=0?r:a+r)||0===o)return[];if(n<r&&o<0)return[];if(n>r&&o>0)return[];if(o>0)for(i=n;i<r;i+=o)s.push(t[i]);else for(i=n;i>r;i+=o)s.push(t[i]);return s}return function(e,n){var r,o;return l((n=n||{}).row)?l(n.col)?e[n.row][n.col]:t(c.rowa(e,n.row),(r=n.col||{}).start,r.end,r.step):l(n.col)?t(c.cola(e,n.col),(o=n.row||{}).start,o.end,o.step):(o=n.row||{},r=n.col||{},t(e,o.start,o.end,o.step).map((function(e){return t(e,r.start,r.end,r.step)})))}}(),c.sliceAssign=function(n,r,o){var i,s;if(l(r.row)){if(l(r.col))return n[r.row][r.col]=o;r.col=r.col||{},r.col.start=r.col.start||0,r.col.end=r.col.end||n[0].length,r.col.step=r.col.step||1,i=c.arange(r.col.start,t.min(n.length,r.col.end),r.col.step);var a=r.row;return i.forEach((function(t,e){n[a][t]=o[e]})),n}if(l(r.col)){r.row=r.row||{},r.row.start=r.row.start||0,r.row.end=r.row.end||n.length,r.row.step=r.row.step||1,s=c.arange(r.row.start,t.min(n[0].length,r.row.end),r.row.step);var u=r.col;return s.forEach((function(t,e){n[t][u]=o[e]})),n}return o[0].length===e&&(o=[o]),r.row.start=r.row.start||0,r.row.end=r.row.end||n.length,r.row.step=r.row.step||1,r.col.start=r.col.start||0,r.col.end=r.col.end||n[0].length,r.col.step=r.col.step||1,s=c.arange(r.row.start,t.min(n.length,r.row.end),r.row.step),i=c.arange(r.col.start,t.min(n[0].length,r.col.end),r.col.step),s.forEach((function(t,e){i.forEach((function(r,i){n[t][r]=o[e][i]}))})),n},c.diagonal=function(t){var e=c.zeros(t.length,t.length);return t.forEach((function(t,n){e[n][n]=t})),e},c.copy=function(t){return t.map((function(t){return l(t)?t:t.map((function(t){return t}))}))};var d=c.prototype;return d.length=0,d.push=Array.prototype.push,d.sort=Array.prototype.sort,d.splice=Array.prototype.splice,d.slice=Array.prototype.slice,d.toArray=function(){return this.length>1?r.call(this):r.call(this)[0]},d.map=function(t,e){return c(c.map(this,t,e))},d.cumreduce=function(t,e){return c(c.cumreduce(this,t,e))},d.alter=function(t){return c.alter(this,t),this},function(t){for(var e=0;e<t.length;e++)!function(t){d[t]=function(e){var n,r=this;return e?(setTimeout((function(){e.call(r,d[t].call(r))})),this):(n=c[t](this),s(n)?c(n):n)}}(t[e])}("transpose clear symmetric rows cols dimensions diag antidiag".split(" ")),function(t){for(var e=0;e<t.length;e++)!function(t){d[t]=function(e,n){var r=this;return n?(setTimeout((function(){n.call(r,d[t].call(r,e))})),this):c(c[t](this,e))}}(t[e])}("row col".split(" ")),function(t){for(var e=0;e<t.length;e++)!function(t){d[t]=function(){return c(c[t].apply(null,arguments))}}(t[e])}("create zeros ones rand identity".split(" ")),c}(Math),function(t,e){var n=t.utils.isFunction;function r(t,e){return t-e}function o(t,n,r){return e.max(n,e.min(t,r))}t.sum=function(t){for(var e=0,n=t.length;--n>=0;)e+=t[n];return e},t.sumsqrd=function(t){for(var e=0,n=t.length;--n>=0;)e+=t[n]*t[n];return e},t.sumsqerr=function(e){for(var n,r=t.mean(e),o=0,i=e.length;--i>=0;)o+=(n=e[i]-r)*n;return o},t.sumrow=function(t){for(var e=0,n=t.length;--n>=0;)e+=t[n];return e},t.product=function(t){for(var e=1,n=t.length;--n>=0;)e*=t[n];return e},t.min=function(t){for(var e=t[0],n=0;++n<t.length;)t[n]<e&&(e=t[n]);return e},t.max=function(t){for(var e=t[0],n=0;++n<t.length;)t[n]>e&&(e=t[n]);return e},t.unique=function(t){for(var e={},n=[],r=0;r<t.length;r++)e[t[r]]||(e[t[r]]=!0,n.push(t[r]));return n},t.mean=function(e){return t.sum(e)/e.length},t.meansqerr=function(e){return t.sumsqerr(e)/e.length},t.geomean=function(n){var r=n.map(e.log),o=t.mean(r);return e.exp(o)},t.median=function(t){var e=t.length,n=t.slice().sort(r);return 1&e?n[e/2|0]:(n[e/2-1]+n[e/2])/2},t.cumsum=function(e){return t.cumreduce(e,(function(t,e){return t+e}))},t.cumprod=function(e){return t.cumreduce(e,(function(t,e){return t*e}))},t.diff=function(t){var e,n=[],r=t.length;for(e=1;e<r;e++)n.push(t[e]-t[e-1]);return n},t.rank=function(t){var e,n=[],o={};for(e=0;e<t.length;e++)o[l=t[e]]?o[l]++:(o[l]=1,n.push(l));var i=n.sort(r),s={},a=1;for(e=0;e<i.length;e++){var l,c=o[l=i[e]],u=(a+(a+c-1))/2;s[l]=u,a+=c}return t.map((function(t){return s[t]}))},t.mode=function(t){var e,n=t.length,o=t.slice().sort(r),i=1,s=0,a=0,l=[];for(e=0;e<n;e++)o[e]===o[e+1]?i++:(i>s?(l=[o[e]],s=i,a=0):i===s&&(l.push(o[e]),a++),i=1);return 0===a?l[0]:l},t.range=function(e){return t.max(e)-t.min(e)},t.variance=function(e,n){return t.sumsqerr(e)/(e.length-(n?1:0))},t.pooledvariance=function(e){return e.reduce((function(e,n){return e+t.sumsqerr(n)}),0)/(e.reduce((function(t,e){return t+e.length}),0)-e.length)},t.deviation=function(e){for(var n=t.mean(e),r=e.length,o=new Array(r),i=0;i<r;i++)o[i]=e[i]-n;return o},t.stdev=function(n,r){return e.sqrt(t.variance(n,r))},t.pooledstdev=function(n){return e.sqrt(t.pooledvariance(n))},t.meandev=function(n){for(var r=t.mean(n),o=[],i=n.length-1;i>=0;i--)o.push(e.abs(n[i]-r));return t.mean(o)},t.meddev=function(n){for(var r=t.median(n),o=[],i=n.length-1;i>=0;i--)o.push(e.abs(n[i]-r));return t.median(o)},t.coeffvar=function(e){return t.stdev(e)/t.mean(e)},t.quartiles=function(t){var n=t.length,o=t.slice().sort(r);return[o[e.round(n/4)-1],o[e.round(n/2)-1],o[e.round(3*n/4)-1]]},t.quantiles=function(t,n,i,s){var a,l,c,u,f,h=t.slice().sort(r),d=[n.length],m=t.length;for(void 0===i&&(i=3/8),void 0===s&&(s=3/8),a=0;a<n.length;a++)c=m*(l=n[a])+(i+l*(1-i-s)),u=e.floor(o(c,1,m-1)),f=o(c-u,0,1),d[a]=(1-f)*h[u-1]+f*h[u];return d},t.percentile=function(t,e,n){var o=t.slice().sort(r),i=e*(o.length+(n?1:-1))+(n?0:1),s=parseInt(i),a=i-s;return s+1<o.length?o[s-1]+a*(o[s]-o[s-1]):o[s-1]},t.percentileOfScore=function(t,e,n){var r,o,i=0,s=t.length,a=!1;for("strict"===n&&(a=!0),o=0;o<s;o++)r=t[o],(a&&r<e||!a&&r<=e)&&i++;return i/s},t.histogram=function(n,r){r=r||4;var o,i=t.min(n),s=(t.max(n)-i)/r,a=n.length,l=[];for(o=0;o<r;o++)l[o]=0;for(o=0;o<a;o++)l[e.min(e.floor((n[o]-i)/s),r-1)]+=1;return l},t.covariance=function(e,n){var r,o=t.mean(e),i=t.mean(n),s=e.length,a=new Array(s);for(r=0;r<s;r++)a[r]=(e[r]-o)*(n[r]-i);return t.sum(a)/(s-1)},t.corrcoeff=function(e,n){return t.covariance(e,n)/t.stdev(e,1)/t.stdev(n,1)},t.spearmancoeff=function(e,n){return e=t.rank(e),n=t.rank(n),t.corrcoeff(e,n)},t.stanMoment=function(n,r){for(var o=t.mean(n),i=t.stdev(n),s=n.length,a=0,l=0;l<s;l++)a+=e.pow((n[l]-o)/i,r);return a/n.length},t.skewness=function(e){return t.stanMoment(e,3)},t.kurtosis=function(e){return t.stanMoment(e,4)-3};var i=t.prototype;!function(e){for(var r=0;r<e.length;r++)!function(e){i[e]=function(r,o){var s=[],a=0,l=this;if(n(r)&&(o=r,r=!1),o)return setTimeout((function(){o.call(l,i[e].call(l,r))})),this;if(this.length>1){for(l=!0===r?this:this.transpose();a<l.length;a++)s[a]=t[e](l[a]);return s}return t[e](this[0],r)}}(e[r])}("cumsum cumprod".split(" ")),function(e){for(var r=0;r<e.length;r++)!function(e){i[e]=function(r,o){var s=[],a=0,l=this;if(n(r)&&(o=r,r=!1),o)return setTimeout((function(){o.call(l,i[e].call(l,r))})),this;if(this.length>1){for("sumrow"!==e&&(l=!0===r?this:this.transpose());a<l.length;a++)s[a]=t[e](l[a]);return!0===r?t[e](t.utils.toVector(s)):s}return t[e](this[0],r)}}(e[r])}("sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr geomean median diff rank mode range variance deviation stdev meandev meddev coeffvar quartiles histogram skewness kurtosis".split(" ")),function(e){for(var r=0;r<e.length;r++)!function(e){i[e]=function(){var r,o=[],s=0,a=this,l=Array.prototype.slice.call(arguments);if(n(l[l.length-1])){r=l[l.length-1];var c=l.slice(0,l.length-1);return setTimeout((function(){r.call(a,i[e].apply(a,c))})),this}r=void 0;var u=function(n){return t[e].apply(a,[n].concat(l))};if(this.length>1){for(a=a.transpose();s<a.length;s++)o[s]=u(a[s]);return o}return u(this[0])}}(e[r])}("quantiles percentileOfScore".split(" "))}(e,Math),function(t,e){t.gammaln=function(t){var n,r,o,i=0,s=[76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],a=1.000000000190015;for(o=(r=n=t)+5.5,o-=(n+.5)*e.log(o);i<6;i++)a+=s[i]/++r;return e.log(2.5066282746310007*a/n)-o},t.loggam=function(t){var n,r,o,i,s,a,l,c=[.08333333333333333,-.002777777777777778,.0007936507936507937,-.0005952380952380952,.0008417508417508418,-.001917526917526918,.00641025641025641,-.02955065359477124,.1796443723688307,-1.3924322169059];if(n=t,l=0,1==t||2==t)return 0;for(t<=7&&(n=t+(l=e.floor(7-t))),r=1/(n*n),o=2*e.PI,s=c[9],a=8;a>=0;a--)s*=r,s+=c[a];if(i=s/n+.5*e.log(o)+(n-.5)*e.log(n)-n,t<=7)for(a=1;a<=l;a++)i-=e.log(n-1),n-=1;return i},t.gammafn=function(t){var n,r,o,i,s=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],a=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],l=!1,c=0,u=0,f=0,h=t;if(t>171.6243769536076)return 1/0;if(h<=0){if(!(i=h%1+36e-17))return 1/0;l=(1&h?-1:1)*e.PI/e.sin(e.PI*i),h=1-h}for(o=h,r=h<1?h++:(h-=c=(0|h)-1)-1,n=0;n<8;++n)f=(f+s[n])*r,u=u*r+a[n];if(i=f/u+1,o<h)i/=o;else if(o>h)for(n=0;n<c;++n)i*=h,h++;return l&&(i=l/i),i},t.gammap=function(e,n){return t.lowRegGamma(e,n)*t.gammafn(e)},t.lowRegGamma=function(n,r){var o,i=t.gammaln(n),s=n,a=1/n,l=a,c=r+1-n,u=1/1e-30,f=1/c,h=f,d=1,m=-~(8.5*e.log(n>=1?n:1/n)+.4*n+17);if(r<0||n<=0)return NaN;if(r<n+1){for(;d<=m;d++)a+=l*=r/++s;return a*e.exp(-r+n*e.log(r)-i)}for(;d<=m;d++)h*=(f=1/(f=(o=-d*(d-n))*f+(c+=2)))*(u=c+o/u);return 1-h*e.exp(-r+n*e.log(r)-i)},t.factorialln=function(e){return e<0?NaN:t.gammaln(e+1)},t.factorial=function(e){return e<0?NaN:t.gammafn(e+1)},t.combination=function(n,r){return n>170||r>170?e.exp(t.combinationln(n,r)):t.factorial(n)/t.factorial(r)/t.factorial(n-r)},t.combinationln=function(e,n){return t.factorialln(e)-t.factorialln(n)-t.factorialln(e-n)},t.permutation=function(e,n){return t.factorial(e)/t.factorial(e-n)},t.betafn=function(n,r){if(!(n<=0||r<=0))return n+r>170?e.exp(t.betaln(n,r)):t.gammafn(n)*t.gammafn(r)/t.gammafn(n+r)},t.betaln=function(e,n){return t.gammaln(e)+t.gammaln(n)-t.gammaln(e+n)},t.betacf=function(t,n,r){var o,i,s,a,l=1e-30,c=1,u=n+r,f=n+1,h=n-1,d=1,m=1-u*t/f;for(e.abs(m)<l&&(m=l),a=m=1/m;c<=100&&(m=1+(i=c*(r-c)*t/((h+(o=2*c))*(n+o)))*m,e.abs(m)<l&&(m=l),d=1+i/d,e.abs(d)<l&&(d=l),a*=(m=1/m)*d,m=1+(i=-(n+c)*(u+c)*t/((n+o)*(f+o)))*m,e.abs(m)<l&&(m=l),d=1+i/d,e.abs(d)<l&&(d=l),a*=s=(m=1/m)*d,!(e.abs(s-1)<3e-7));c++);return a},t.gammapinv=function(n,r){var o,i,s,a,l,c,u=0,f=r-1,h=t.gammaln(r);if(n>=1)return e.max(100,r+100*e.sqrt(r));if(n<=0)return 0;for(r>1?(l=e.log(f),c=e.exp(f*(l-1)-h),a=n<.5?n:1-n,o=(2.30753+.27061*(i=e.sqrt(-2*e.log(a))))/(1+i*(.99229+.04481*i))-i,n<.5&&(o=-o),o=e.max(.001,r*e.pow(1-1/(9*r)-o/(3*e.sqrt(r)),3))):o=n<(i=1-r*(.253+.12*r))?e.pow(n/i,1/r):1-e.log(1-(n-i)/(1-i));u<12;u++){if(o<=0)return 0;if((o-=i=(s=(t.lowRegGamma(r,o)-n)/(i=r>1?c*e.exp(-(o-f)+f*(e.log(o)-l)):e.exp(-o+f*e.log(o)-h)))/(1-.5*e.min(1,s*((r-1)/o-1))))<=0&&(o=.5*(o+i)),e.abs(i)<1e-8*o)break}return o},t.erf=function(t){var n,r,o,i,s=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-9.91364156e-10,-2.27365122e-10,96467911e-18,2394038e-18,-6886027e-18,894487e-18,313092e-18,-112708e-18,381e-18,7106e-18,-1523e-18,-94e-18,121e-18,-28e-18],a=s.length-1,l=!1,c=0,u=0;for(t<0&&(t=-t,l=!0),r=4*(n=2/(2+t))-2;a>0;a--)o=c,c=r*c-u+s[a],u=o;return i=n*e.exp(-t*t+.5*(s[0]+r*c)-u),l?i-1:1-i},t.erfc=function(e){return 1-t.erf(e)},t.erfcinv=function(n){var r,o,i,s,a=0;if(n>=2)return-100;if(n<=0)return 100;for(s=n<1?n:2-n,r=-.70711*((2.30753+.27061*(i=e.sqrt(-2*e.log(s/2))))/(1+i*(.99229+.04481*i))-i);a<2;a++)r+=(o=t.erfc(r)-s)/(1.1283791670955126*e.exp(-r*r)-r*o);return n<1?r:-r},t.ibetainv=function(n,r,o){var i,s,a,l,c,u,f,h,d,m,p=r-1,y=o-1,g=0;if(n<=0)return 0;if(n>=1)return 1;for(r>=1&&o>=1?(a=n<.5?n:1-n,u=(2.30753+.27061*(l=e.sqrt(-2*e.log(a))))/(1+l*(.99229+.04481*l))-l,n<.5&&(u=-u),f=(u*u-3)/6,h=2/(1/(2*r-1)+1/(2*o-1)),d=u*e.sqrt(f+h)/h-(1/(2*o-1)-1/(2*r-1))*(f+5/6-2/(3*h)),u=r/(r+o*e.exp(2*d))):(i=e.log(r/(r+o)),s=e.log(o/(r+o)),u=n<(l=e.exp(r*i)/r)/(d=l+(c=e.exp(o*s)/o))?e.pow(r*d*n,1/r):1-e.pow(o*d*(1-n),1/o)),m=-t.gammaln(r)-t.gammaln(o)+t.gammaln(r+o);g<10;g++){if(0===u||1===u)return u;if((u-=l=(c=(t.ibeta(u,r,o)-n)/(l=e.exp(p*e.log(u)+y*e.log(1-u)+m)))/(1-.5*e.min(1,c*(p/u-y/(1-u)))))<=0&&(u=.5*(u+l)),u>=1&&(u=.5*(u+l+1)),e.abs(l)<1e-8*u&&g>0)break}return u},t.ibeta=function(n,r,o){var i=0===n||1===n?0:e.exp(t.gammaln(r+o)-t.gammaln(r)-t.gammaln(o)+r*e.log(n)+o*e.log(1-n));return!(n<0||n>1)&&(n<(r+1)/(r+o+2)?i*t.betacf(n,r,o)/r:1-i*t.betacf(1-n,o,r)/o)},t.randn=function(n,r){var o,i,s,a,l;if(r||(r=n),n)return t.create(n,r,(function(){return t.randn()}));do{o=t._random_fn(),i=1.7156*(t._random_fn()-.5),l=(s=o-.449871)*s+(a=e.abs(i)+.386595)*(.196*a-.25472*s)}while(l>.27597&&(l>.27846||i*i>-4*e.log(o)*o*o));return i/o},t.randg=function(n,r,o){var i,s,a,l,c,u,f=n;if(o||(o=r),n||(n=1),r)return(u=t.zeros(r,o)).alter((function(){return t.randg(n)})),u;n<1&&(n+=1),i=n-1/3,s=1/e.sqrt(9*i);do{do{l=1+s*(c=t.randn())}while(l<=0);l*=l*l,a=t._random_fn()}while(a>1-.331*e.pow(c,4)&&e.log(a)>.5*c*c+i*(1-l+e.log(l)));if(n==f)return i*l;do{a=t._random_fn()}while(0===a);return e.pow(a,1/f)*i*l},function(e){for(var n=0;n<e.length;n++)!function(e){t.fn[e]=function(){return t(t.map(this,(function(n){return t[e](n)})))}}(e[n])}("gammaln gammafn factorial factorialln".split(" ")),function(e){for(var n=0;n<e.length;n++)!function(e){t.fn[e]=function(){return t(t[e].apply(null,arguments))}}(e[n])}("randn".split(" "))}(e,Math),function(t,e){function n(t,n,r,o){for(var i,s=0,a=1,l=1,c=1,u=0,f=0;e.abs((l-f)/l)>o;)f=l,a=c+(i=-(n+u)*(n+r+u)*t/(n+2*u)/(n+2*u+1))*a,l=(s=l+i*s)+(i=(u+=1)*(r-u)*t/(n+2*u-1)/(n+2*u))*l,s/=c=a+i*c,a/=c,l/=c,c=1;return l/n}function r(n,r,o){var i=[.9815606342467192,.9041172563704749,.7699026741943047,.5873179542866175,.3678314989981802,.1252334085114689],s=[.04717533638651183,.10693932599531843,.16007832854334622,.20316742672306592,.2334925365383548,.24914704581340277],a=.5*n;if(a>=8)return 1;var l,c=2*t.normal.cdf(a,0,1,1,0)-1;c=c>=e.exp(-50/o)?e.pow(c,o):0;for(var u=a,f=(8-a)/(l=n>3?2:3),h=u+f,d=0,m=o-1,p=1;p<=l;p++){for(var y=0,g=.5*(h+u),x=.5*(h-u),v=1;v<=12;v++){var w,T=g+x*(6<v?i[(w=12-v+1)-1]:-i[(w=v)-1]),_=T*T;if(_>60)break;var C=2*t.normal.cdf(T,0,1,1,0)*.5-2*t.normal.cdf(T,n,1,1,0)*.5;C>=e.exp(-30/m)&&(y+=C=s[w-1]*e.exp(-.5*_)*e.pow(C,m))}d+=y*=2*x*o/e.sqrt(2*e.PI),u=h,h+=f}return(c+=d)<=e.exp(-30/r)?0:(c=e.pow(c,r))>=1?1:c}!function(e){for(var n=0;n<e.length;n++)!function(e){t[e]=function t(e,n,r){return this instanceof t?(this._a=e,this._b=n,this._c=r,this):new t(e,n,r)},t.fn[e]=function(n,r,o){var i=t[e](n,r,o);return i.data=this,i},t[e].prototype.sample=function(n){var r=this._a,o=this._b,i=this._c;return n?t.alter(n,(function(){return t[e].sample(r,o,i)})):t[e].sample(r,o,i)},function(n){for(var r=0;r<n.length;r++)!function(n){t[e].prototype[n]=function(r){var o=this._a,i=this._b,s=this._c;return r||0===r||(r=this.data),"number"!=typeof r?t.fn.map.call(r,(function(r){return t[e][n](r,o,i,s)})):t[e][n](r,o,i,s)}}(n[r])}("pdf cdf inv".split(" ")),function(n){for(var r=0;r<n.length;r++)!function(n){t[e].prototype[n]=function(){return t[e][n](this._a,this._b,this._c)}}(n[r])}("mean median mode variance".split(" "))}(e[n])}("beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy laplace lognormal noncentralt normal pareto studentt weibull uniform binomial negbin hypgeom poisson triangular tukey arcsine".split(" ")),t.extend(t.beta,{pdf:function(n,r,o){return n>1||n<0?0:1==r&&1==o?1:r<512&&o<512?e.pow(n,r-1)*e.pow(1-n,o-1)/t.betafn(r,o):e.exp((r-1)*e.log(n)+(o-1)*e.log(1-n)-t.betaln(r,o))},cdf:function(e,n,r){return e>1||e<0?1*(e>1):t.ibeta(e,n,r)},inv:function(e,n,r){return t.ibetainv(e,n,r)},mean:function(t,e){return t/(t+e)},median:function(e,n){return t.ibetainv(.5,e,n)},mode:function(t,e){return(t-1)/(t+e-2)},sample:function(e,n){var r=t.randg(e);return r/(r+t.randg(n))},variance:function(t,n){return t*n/(e.pow(t+n,2)*(t+n+1))}}),t.extend(t.centralF,{pdf:function(n,r,o){var i;return n<0?0:r<=2?0===n&&r<2?1/0:0===n&&2===r?1:1/t.betafn(r/2,o/2)*e.pow(r/o,r/2)*e.pow(n,r/2-1)*e.pow(1+r/o*n,-(r+o)/2):(i=r*n/(o+n*r),r*(o/(o+n*r))/2*t.binomial.pdf((r-2)/2,(r+o-2)/2,i))},cdf:function(e,n,r){return e<0?0:t.ibeta(n*e/(n*e+r),n/2,r/2)},inv:function(e,n,r){return r/(n*(1/t.ibetainv(e,n/2,r/2)-1))},mean:function(t,e){return e>2?e/(e-2):void 0},mode:function(t,e){return t>2?e*(t-2)/(t*(e+2)):void 0},sample:function(e,n){return 2*t.randg(e/2)/e/(2*t.randg(n/2)/n)},variance:function(t,e){if(!(e<=4))return 2*e*e*(t+e-2)/(t*(e-2)*(e-2)*(e-4))}}),t.extend(t.cauchy,{pdf:function(t,n,r){return r<0?0:r/(e.pow(t-n,2)+e.pow(r,2))/e.PI},cdf:function(t,n,r){return e.atan((t-n)/r)/e.PI+.5},inv:function(t,n,r){return n+r*e.tan(e.PI*(t-.5))},median:function(t){return t},mode:function(t){return t},sample:function(n,r){return t.randn()*e.sqrt(1/(2*t.randg(.5)))*r+n}}),t.extend(t.chisquare,{pdf:function(n,r){return n<0?0:0===n&&2===r?.5:e.exp((r/2-1)*e.log(n)-n/2-r/2*e.log(2)-t.gammaln(r/2))},cdf:function(e,n){return e<0?0:t.lowRegGamma(n/2,e/2)},inv:function(e,n){return 2*t.gammapinv(e,.5*n)},mean:function(t){return t},median:function(t){return t*e.pow(1-2/(9*t),3)},mode:function(t){return t-2>0?t-2:0},sample:function(e){return 2*t.randg(e/2)},variance:function(t){return 2*t}}),t.extend(t.exponential,{pdf:function(t,n){return t<0?0:n*e.exp(-n*t)},cdf:function(t,n){return t<0?0:1-e.exp(-n*t)},inv:function(t,n){return-e.log(1-t)/n},mean:function(t){return 1/t},median:function(t){return 1/t*e.log(2)},mode:function(){return 0},sample:function(n){return-1/n*e.log(t._random_fn())},variance:function(t){return e.pow(t,-2)}}),t.extend(t.gamma,{pdf:function(n,r,o){return n<0?0:0===n&&1===r?1/o:e.exp((r-1)*e.log(n)-n/o-t.gammaln(r)-r*e.log(o))},cdf:function(e,n,r){return e<0?0:t.lowRegGamma(n,e/r)},inv:function(e,n,r){return t.gammapinv(e,n)*r},mean:function(t,e){return t*e},mode:function(t,e){if(t>1)return(t-1)*e},sample:function(e,n){return t.randg(e)*n},variance:function(t,e){return t*e*e}}),t.extend(t.invgamma,{pdf:function(n,r,o){return n<=0?0:e.exp(-(r+1)*e.log(n)-o/n-t.gammaln(r)+r*e.log(o))},cdf:function(e,n,r){return e<=0?0:1-t.lowRegGamma(n,r/e)},inv:function(e,n,r){return r/t.gammapinv(1-e,n)},mean:function(t,e){return t>1?e/(t-1):void 0},mode:function(t,e){return e/(t+1)},sample:function(e,n){return n/t.randg(e)},variance:function(t,e){if(!(t<=2))return e*e/((t-1)*(t-1)*(t-2))}}),t.extend(t.kumaraswamy,{pdf:function(t,n,r){return 0===t&&1===n?r:1===t&&1===r?n:e.exp(e.log(n)+e.log(r)+(n-1)*e.log(t)+(r-1)*e.log(1-e.pow(t,n)))},cdf:function(t,n,r){return t<0?0:t>1?1:1-e.pow(1-e.pow(t,n),r)},inv:function(t,n,r){return e.pow(1-e.pow(1-t,1/r),1/n)},mean:function(e,n){return n*t.gammafn(1+1/e)*t.gammafn(n)/t.gammafn(1+1/e+n)},median:function(t,n){return e.pow(1-e.pow(2,-1/n),1/t)},mode:function(t,n){if(t>=1&&n>=1&&1!==t&&1!==n)return e.pow((t-1)/(t*n-1),1/t)},variance:function(){throw new Error("variance not yet implemented")}}),t.extend(t.lognormal,{pdf:function(t,n,r){return t<=0?0:e.exp(-e.log(t)-.5*e.log(2*e.PI)-e.log(r)-e.pow(e.log(t)-n,2)/(2*r*r))},cdf:function(n,r,o){return n<0?0:.5+.5*t.erf((e.log(n)-r)/e.sqrt(2*o*o))},inv:function(n,r,o){return e.exp(-1.4142135623730951*o*t.erfcinv(2*n)+r)},mean:function(t,n){return e.exp(t+n*n/2)},median:function(t){return e.exp(t)},mode:function(t,n){return e.exp(t-n*n)},sample:function(n,r){return e.exp(t.randn()*r+n)},variance:function(t,n){return(e.exp(n*n)-1)*e.exp(2*t+n*n)}}),t.extend(t.noncentralt,{pdf:function(n,r,o){return e.abs(o)<1e-14?t.studentt.pdf(n,r):e.abs(n)<1e-14?e.exp(t.gammaln((r+1)/2)-o*o/2-.5*e.log(e.PI*r)-t.gammaln(r/2)):r/n*(t.noncentralt.cdf(n*e.sqrt(1+2/r),r+2,o)-t.noncentralt.cdf(n,r,o))},cdf:function(n,r,o){var i=1e-14;if(e.abs(o)<i)return t.studentt.cdf(n,r);var s=!1;n<0&&(s=!0,o=-o);for(var a=t.normal.cdf(-o,0,1),l=i+1,c=l,u=n*n/(n*n+r),f=0,h=e.exp(-o*o/2),d=e.exp(-o*o/2-.5*e.log(2)-t.gammaln(1.5))*o;f<200||c>i||l>i;)c=l,f>0&&(h*=o*o/(2*f),d*=o*o/(2*(f+.5))),a+=.5*(l=h*t.beta.cdf(u,f+.5,r/2)+d*t.beta.cdf(u,f+1,r/2)),f++;return s?1-a:a}}),t.extend(t.normal,{pdf:function(t,n,r){return e.exp(-.5*e.log(2*e.PI)-e.log(r)-e.pow(t-n,2)/(2*r*r))},cdf:function(n,r,o){return.5*(1+t.erf((n-r)/e.sqrt(2*o*o)))},inv:function(e,n,r){return-1.4142135623730951*r*t.erfcinv(2*e)+n},mean:function(t){return t},median:function(t){return t},mode:function(t){return t},sample:function(e,n){return t.randn()*n+e},variance:function(t,e){return e*e}}),t.extend(t.pareto,{pdf:function(t,n,r){return t<n?0:r*e.pow(n,r)/e.pow(t,r+1)},cdf:function(t,n,r){return t<n?0:1-e.pow(n/t,r)},inv:function(t,n,r){return n/e.pow(1-t,1/r)},mean:function(t,n){if(!(n<=1))return n*e.pow(t,n)/(n-1)},median:function(t,n){return t*(n*e.SQRT2)},mode:function(t){return t},variance:function(t,n){if(!(n<=2))return t*t*n/(e.pow(n-1,2)*(n-2))}}),t.extend(t.studentt,{pdf:function(n,r){return r=r>1e100?1e100:r,1/(e.sqrt(r)*t.betafn(.5,r/2))*e.pow(1+n*n/r,-(r+1)/2)},cdf:function(n,r){var o=r/2;return t.ibeta((n+e.sqrt(n*n+r))/(2*e.sqrt(n*n+r)),o,o)},inv:function(n,r){var o=t.ibetainv(2*e.min(n,1-n),.5*r,.5);return o=e.sqrt(r*(1-o)/o),n>.5?o:-o},mean:function(t){return t>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(n){return t.randn()*e.sqrt(n/(2*t.randg(n/2)))},variance:function(t){return t>2?t/(t-2):t>1?1/0:void 0}}),t.extend(t.weibull,{pdf:function(t,n,r){return t<0||n<0||r<0?0:r/n*e.pow(t/n,r-1)*e.exp(-e.pow(t/n,r))},cdf:function(t,n,r){return t<0?0:1-e.exp(-e.pow(t/n,r))},inv:function(t,n,r){return n*e.pow(-e.log(1-t),1/r)},mean:function(e,n){return e*t.gammafn(1+1/n)},median:function(t,n){return t*e.pow(e.log(2),1/n)},mode:function(t,n){return n<=1?0:t*e.pow((n-1)/n,1/n)},sample:function(n,r){return n*e.pow(-e.log(t._random_fn()),1/r)},variance:function(n,r){return n*n*t.gammafn(1+2/r)-e.pow(t.weibull.mean(n,r),2)}}),t.extend(t.uniform,{pdf:function(t,e,n){return t<e||t>n?0:1/(n-e)},cdf:function(t,e,n){return t<e?0:t<n?(t-e)/(n-e):1},inv:function(t,e,n){return e+t*(n-e)},mean:function(t,e){return.5*(t+e)},median:function(e,n){return t.mean(e,n)},mode:function(){throw new Error("mode is not yet implemented")},sample:function(e,n){return e/2+n/2+(n/2-e/2)*(2*t._random_fn()-1)},variance:function(t,n){return e.pow(n-t,2)/12}}),t.extend(t.binomial,{pdf:function(n,r,o){return 0===o||1===o?r*o===n?1:0:t.combination(r,n)*e.pow(o,n)*e.pow(1-o,r-n)},cdf:function(r,o,i){var s,a=1e-10;if(r<0)return 0;if(r>=o)return 1;if(i<0||i>1||o<=0)return NaN;var l=i,c=(r=e.floor(r))+1,u=o-r,f=c+u,h=e.exp(t.gammaln(f)-t.gammaln(u)-t.gammaln(c)+c*e.log(l)+u*e.log(1-l));return s=l<(c+1)/(f+2)?h*n(l,c,u,a):1-h*n(1-l,u,c,a),e.round(1/a*(1-s))/(1/a)}}),t.extend(t.negbin,{pdf:function(n,r,o){return n===n>>>0&&(n<0?0:t.combination(n+r-1,r-1)*e.pow(1-o,n)*e.pow(o,r))},cdf:function(e,n,r){var o=0,i=0;if(e<0)return 0;for(;i<=e;i++)o+=t.negbin.pdf(i,n,r);return o}}),t.extend(t.hypgeom,{pdf:function(n,r,o,i){if(n!=n|0)return!1;if(n<0||n<o-(r-i))return 0;if(n>i||n>o)return 0;if(2*o>r)return 2*i>r?t.hypgeom.pdf(r-o-i+n,r,r-o,r-i):t.hypgeom.pdf(i-n,r,r-o,i);if(2*i>r)return t.hypgeom.pdf(o-n,r,o,r-i);if(o<i)return t.hypgeom.pdf(n,r,i,o);for(var s=1,a=0,l=0;l<n;l++){for(;s>1&&a<i;)s*=1-o/(r-a),a++;s*=(i-l)*(o-l)/((l+1)*(r-o-i+l+1))}for(;a<i;a++)s*=1-o/(r-a);return e.min(1,e.max(0,s))},cdf:function(n,r,o,i){if(n<0||n<o-(r-i))return 0;if(n>=i||n>=o)return 1;if(2*o>r)return 2*i>r?t.hypgeom.cdf(r-o-i+n,r,r-o,r-i):1-t.hypgeom.cdf(i-n-1,r,r-o,i);if(2*i>r)return 1-t.hypgeom.cdf(o-n-1,r,o,r-i);if(o<i)return t.hypgeom.cdf(n,r,i,o);for(var s=1,a=1,l=0,c=0;c<n;c++){for(;s>1&&l<i;){var u=1-o/(r-l);a*=u,s*=u,l++}s+=a*=(i-c)*(o-c)/((c+1)*(r-o-i+c+1))}for(;l<i;l++)s*=1-o/(r-l);return e.min(1,e.max(0,s))}}),t.extend(t.poisson,{pdf:function(n,r){return r<0||n%1!=0||n<0?0:e.pow(r,n)*e.exp(-r)/t.factorial(n)},cdf:function(e,n){var r=[],o=0;if(e<0)return 0;for(;o<=e;o++)r.push(t.poisson.pdf(o,n));return t.sum(r)},mean:function(t){return t},variance:function(t){return t},sampleSmall:function(n){var r=1,o=0,i=e.exp(-n);do{o++,r*=t._random_fn()}while(r>i);return o-1},sampleLarge:function(n){var r,o,i,s,a,l,c,u,f,h,d=n;for(s=e.sqrt(d),a=e.log(d),l=.02483*(c=.931+2.53*s)-.059,u=1.1239+1.1328/(c-3.4),f=.9277-3.6224/(c-2);;){if(o=e.random()-.5,i=e.random(),h=.5-e.abs(o),r=e.floor((2*l/h+c)*o+d+.43),h>=.07&&i<=f)return r;if(!(r<0||h<.013&&i>h)&&e.log(i)+e.log(u)-e.log(l/(h*h)+c)<=r*a-d-t.loggam(r+1))return r}},sample:function(t){return t<10?this.sampleSmall(t):this.sampleLarge(t)}}),t.extend(t.triangular,{pdf:function(t,e,n,r){return n<=e||r<e||r>n?NaN:t<e||t>n?0:t<r?2*(t-e)/((n-e)*(r-e)):t===r?2/(n-e):2*(n-t)/((n-e)*(n-r))},cdf:function(t,n,r,o){return r<=n||o<n||o>r?NaN:t<=n?0:t>=r?1:t<=o?e.pow(t-n,2)/((r-n)*(o-n)):1-e.pow(r-t,2)/((r-n)*(r-o))},inv:function(t,n,r,o){return r<=n||o<n||o>r?NaN:t<=(o-n)/(r-n)?n+(r-n)*e.sqrt(t*((o-n)/(r-n))):n+(r-n)*(1-e.sqrt((1-t)*(1-(o-n)/(r-n))))},mean:function(t,e,n){return(t+e+n)/3},median:function(t,n,r){return r<=(t+n)/2?n-e.sqrt((n-t)*(n-r))/e.sqrt(2):r>(t+n)/2?t+e.sqrt((n-t)*(r-t))/e.sqrt(2):void 0},mode:function(t,e,n){return n},sample:function(n,r,o){var i=t._random_fn();return i<(o-n)/(r-n)?n+e.sqrt(i*(r-n)*(o-n)):r-e.sqrt((1-i)*(r-n)*(r-o))},variance:function(t,e,n){return(t*t+e*e+n*n-t*e-t*n-e*n)/18}}),t.extend(t.arcsine,{pdf:function(t,n,r){return r<=n?NaN:t<=n||t>=r?0:2/e.PI*e.pow(e.pow(r-n,2)-e.pow(2*t-n-r,2),-.5)},cdf:function(t,n,r){return t<n?0:t<r?2/e.PI*e.asin(e.sqrt((t-n)/(r-n))):1},inv:function(t,n,r){return n+(.5-.5*e.cos(e.PI*t))*(r-n)},mean:function(t,e){return e<=t?NaN:(t+e)/2},median:function(t,e){return e<=t?NaN:(t+e)/2},mode:function(){throw new Error("mode is not yet implemented")},sample:function(n,r){return(n+r)/2+(r-n)/2*e.sin(2*e.PI*t.uniform.sample(0,1))},variance:function(t,n){return n<=t?NaN:e.pow(n-t,2)/8}}),t.extend(t.laplace,{pdf:function(t,n,r){return r<=0?0:e.exp(-e.abs(t-n)/r)/(2*r)},cdf:function(t,n,r){return r<=0?0:t<n?.5*e.exp((t-n)/r):1-.5*e.exp(-(t-n)/r)},mean:function(t){return t},median:function(t){return t},mode:function(t){return t},variance:function(t,e){return 2*e*e},sample:function(n,r){var o,i=t._random_fn()-.5;return n-r*((o=i)/e.abs(o))*e.log(1-2*e.abs(i))}}),t.extend(t.tukey,{cdf:function(n,o,i){var s=o,a=[.9894009349916499,.9445750230732326,.8656312023878318,.755404408355003,.6178762444026438,.45801677765722737,.2816035507792589,.09501250983763744],l=[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685];if(n<=0)return 0;if(i<2||s<2)return NaN;if(!Number.isFinite(n))return 1;if(i>25e3)return r(n,1,s);var c,u=.5*i,f=u*e.log(i)-i*e.log(2)-t.gammaln(u),h=u-1,d=.25*i;c=i<=100?1:i<=800?.5:i<=5e3?.25:.125,f+=e.log(c);for(var m=0,p=1;p<=50;p++){for(var y=0,g=(2*p-1)*c,x=1;x<=16;x++){var v,w;8<x?(v=x-8-1,w=f+h*e.log(g+a[v]*c)-(a[v]*c+g)*d):(v=x-1,w=f+h*e.log(g-a[v]*c)+(a[v]*c-g)*d),w>=-30&&(y+=r(8<x?n*e.sqrt(.5*(a[v]*c+g)):n*e.sqrt(.5*(-a[v]*c+g)),1,s)*l[v]*e.exp(w))}if(p*c>=1&&y<=1e-14)break;m+=y}if(y>1e-14)throw new Error("tukey.cdf failed to converge");return m>1&&(m=1),m},inv:function(n,r,o){if(o<2||r<2)return NaN;if(n<0||n>1)return NaN;if(0===n)return 0;if(1===n)return 1/0;var i,s=function(t,n,r){var o=.5-.5*t,i=e.sqrt(e.log(1/(o*o))),s=i+((((-453642210148e-16*i-.204231210125)*i-.342242088547)*i-1)*i+.322232421088)/((((.0038560700634*i+.10353775285)*i+.531103462366)*i+.588581570495)*i+.099348462606);r<120&&(s+=(s*s*s+s)/r/4);var a=.8832-.2368*s;return r<120&&(a+=-1.214/r+1.208*s/r),s*(a*e.log(n-1)+1.4142)}(n,r,o),a=t.tukey.cdf(s,r,o)-n;i=a>0?e.max(0,s-1):s+1;for(var l,c=t.tukey.cdf(i,r,o)-n,u=1;u<50;u++)if(l=i-c*(i-s)/(c-a),a=c,s=i,l<0&&(l=0,c=-n),c=t.tukey.cdf(l,r,o)-n,i=l,e.abs(i-s)<1e-4)return l;throw new Error("tukey.inv failed to converge")}})}(e,Math),function(t,e){var n,r,o=Array.prototype.push,i=t.utils.isArray;function s(e){return i(e)||e instanceof t}t.extend({add:function(e,n){return s(n)?(s(n[0])||(n=[n]),t.map(e,(function(t,e,r){return t+n[e][r]}))):t.map(e,(function(t){return t+n}))},subtract:function(e,n){return s(n)?(s(n[0])||(n=[n]),t.map(e,(function(t,e,r){return t-n[e][r]||0}))):t.map(e,(function(t){return t-n}))},divide:function(e,n){return s(n)?(s(n[0])||(n=[n]),t.multiply(e,t.inv(n))):t.map(e,(function(t){return t/n}))},multiply:function(e,n){var r,o,i,a,l,c,u,f;if(void 0===e.length&&void 0===n.length)return e*n;if(l=e.length,c=e[0].length,u=t.zeros(l,i=s(n)?n[0].length:c),f=0,s(n)){for(;f<i;f++)for(r=0;r<l;r++){for(a=0,o=0;o<c;o++)a+=e[r][o]*n[o][f];u[r][f]=a}return 1===l&&1===f?u[0][0]:u}return t.map(e,(function(t){return t*n}))},outer:function(e,n){return t.multiply(e.map((function(t){return[t]})),[n])},dot:function(e,n){s(e[0])||(e=[e]),s(n[0])||(n=[n]);for(var r,o,i=1===e[0].length&&1!==e.length?t.transpose(e):e,a=1===n[0].length&&1!==n.length?t.transpose(n):n,l=[],c=0,u=i.length,f=i[0].length;c<u;c++){for(l[c]=[],r=0,o=0;o<f;o++)r+=i[c][o]*a[c][o];l[c]=r}return 1===l.length?l[0]:l},pow:function(n,r){return t.map(n,(function(t){return e.pow(t,r)}))},exp:function(n){return t.map(n,(function(t){return e.exp(t)}))},log:function(n){return t.map(n,(function(t){return e.log(t)}))},abs:function(n){return t.map(n,(function(t){return e.abs(t)}))},norm:function(t,n){var r=0,o=0;for(isNaN(n)&&(n=2),s(t[0])&&(t=t[0]);o<t.length;o++)r+=e.pow(e.abs(t[o]),n);return e.pow(r,1/n)},angle:function(n,r){return e.acos(t.dot(n,r)/(t.norm(n)*t.norm(r)))},aug:function(t,e){var n,r=[];for(n=0;n<t.length;n++)r.push(t[n].slice());for(n=0;n<r.length;n++)o.apply(r[n],e[n]);return r},inv:function(e){for(var n,r=e.length,o=e[0].length,i=t.identity(r,o),s=t.gauss_jordan(e,i),a=[],l=0;l<r;l++)for(a[l]=[],n=o;n<s[0].length;n++)a[l][n-o]=s[l][n];return a},det:function t(e){if(2===e.length)return e[0][0]*e[1][1]-e[0][1]*e[1][0];for(var n=0,r=0;r<e.length;r++){for(var o=[],i=1;i<e.length;i++){o[i-1]=[];for(var s=0;s<e.length;s++)s<r?o[i-1][s]=e[i][s]:s>r&&(o[i-1][s-1]=e[i][s])}var a=r%2?-1:1;n+=t(o)*e[0][r]*a}return n},gauss_elimination:function(n,r){var o,i,s,a,l=0,c=0,u=n.length,f=n[0].length,h=1,d=0,m=[];for(o=(n=t.aug(n,r))[0].length,l=0;l<u;l++){for(i=n[l][l],c=l,a=l+1;a<f;a++)i<e.abs(n[a][l])&&(i=n[a][l],c=a);if(c!=l)for(a=0;a<o;a++)s=n[l][a],n[l][a]=n[c][a],n[c][a]=s;for(c=l+1;c<u;c++)for(h=n[c][l]/n[l][l],a=l;a<o;a++)n[c][a]=n[c][a]-h*n[l][a]}for(l=u-1;l>=0;l--){for(d=0,c=l+1;c<=u-1;c++)d+=m[c]*n[l][c];m[l]=(n[l][o-1]-d)/n[l][l]}return m},gauss_jordan:function(n,r){var o,i,s,a=t.aug(n,r),l=a.length,c=a[0].length,u=0;for(i=0;i<l;i++){var f=i;for(s=i+1;s<l;s++)e.abs(a[s][i])>e.abs(a[f][i])&&(f=s);var h=a[i];for(a[i]=a[f],a[f]=h,s=i+1;s<l;s++)for(u=a[s][i]/a[i][i],o=i;o<c;o++)a[s][o]-=a[i][o]*u}for(i=l-1;i>=0;i--){for(u=a[i][i],s=0;s<i;s++)for(o=c-1;o>i-1;o--)a[s][o]-=a[i][o]*a[s][i]/u;for(a[i][i]/=u,o=l;o<c;o++)a[i][o]/=u}return a},triaUpSolve:function(e,n){var r,o=e[0].length,i=t.zeros(1,o)[0],s=!1;return null!=n[0].length&&(n=n.map((function(t){return t[0]})),s=!0),t.arange(o-1,-1,-1).forEach((function(s){r=t.arange(s+1,o).map((function(t){return i[t]*e[s][t]})),i[s]=(n[s]-t.sum(r))/e[s][s]})),s?i.map((function(t){return[t]})):i},triaLowSolve:function(e,n){var r,o=e[0].length,i=t.zeros(1,o)[0],s=!1;return null!=n[0].length&&(n=n.map((function(t){return t[0]})),s=!0),t.arange(o).forEach((function(o){r=t.arange(o).map((function(t){return e[o][t]*i[t]})),i[o]=(n[o]-t.sum(r))/e[o][o]})),s?i.map((function(t){return[t]})):i},lu:function(e){var n,r=e.length,o=t.identity(r),i=t.zeros(e.length,e[0].length);return t.arange(r).forEach((function(t){i[0][t]=e[0][t]})),t.arange(1,r).forEach((function(s){t.arange(s).forEach((function(r){n=t.arange(r).map((function(t){return o[s][t]*i[t][r]})),o[s][r]=(e[s][r]-t.sum(n))/i[r][r]})),t.arange(s,r).forEach((function(r){n=t.arange(s).map((function(t){return o[s][t]*i[t][r]})),i[s][r]=e[n.length][r]-t.sum(n)}))})),[o,i]},cholesky:function(n){var r,o=n.length,i=t.zeros(n.length,n[0].length);return t.arange(o).forEach((function(s){r=t.arange(s).map((function(t){return e.pow(i[s][t],2)})),i[s][s]=e.sqrt(n[s][s]-t.sum(r)),t.arange(s+1,o).forEach((function(e){r=t.arange(s).map((function(t){return i[s][t]*i[e][t]})),i[e][s]=(n[s][e]-t.sum(r))/i[s][s]}))})),i},gauss_jacobi:function(n,r,o,i){for(var s,a,l,c,u=0,f=0,h=n.length,d=[],m=[],p=[];u<h;u++)for(d[u]=[],m[u]=[],p[u]=[],f=0;f<h;f++)u>f?(d[u][f]=n[u][f],m[u][f]=p[u][f]=0):u<f?(m[u][f]=n[u][f],d[u][f]=p[u][f]=0):(p[u][f]=n[u][f],d[u][f]=m[u][f]=0);for(l=t.multiply(t.multiply(t.inv(p),t.add(d,m)),-1),a=t.multiply(t.inv(p),r),s=o,c=t.add(t.multiply(l,o),a),u=2;e.abs(t.norm(t.subtract(c,s)))>i;)s=c,c=t.add(t.multiply(l,s),a),u++;return c},gauss_seidel:function(n,r,o,i){for(var s,a,l,c,u,f=0,h=n.length,d=[],m=[],p=[];f<h;f++)for(d[f]=[],m[f]=[],p[f]=[],s=0;s<h;s++)f>s?(d[f][s]=n[f][s],m[f][s]=p[f][s]=0):f<s?(m[f][s]=n[f][s],d[f][s]=p[f][s]=0):(p[f][s]=n[f][s],d[f][s]=m[f][s]=0);for(c=t.multiply(t.multiply(t.inv(t.add(p,d)),m),-1),l=t.multiply(t.inv(t.add(p,d)),r),a=o,u=t.add(t.multiply(c,o),l),f=2;e.abs(t.norm(t.subtract(u,a)))>i;)a=u,u=t.add(t.multiply(c,a),l),f+=1;return u},SOR:function(n,r,o,i,s){for(var a,l,c,u,f,h=0,d=n.length,m=[],p=[],y=[];h<d;h++)for(m[h]=[],p[h]=[],y[h]=[],a=0;a<d;a++)h>a?(m[h][a]=n[h][a],p[h][a]=y[h][a]=0):h<a?(p[h][a]=n[h][a],m[h][a]=y[h][a]=0):(y[h][a]=n[h][a],m[h][a]=p[h][a]=0);for(u=t.multiply(t.inv(t.add(y,t.multiply(m,s))),t.subtract(t.multiply(y,1-s),t.multiply(p,s))),c=t.multiply(t.multiply(t.inv(t.add(y,t.multiply(m,s))),r),s),l=o,f=t.add(t.multiply(u,o),c),h=2;e.abs(t.norm(t.subtract(f,l)))>i;)l=f,f=t.add(t.multiply(u,l),c),h++;return f},householder:function(n){for(var r,o,i,s,a=n.length,l=n[0].length,c=0,u=[],f=[];c<a-1;c++){for(r=0,s=c+1;s<l;s++)r+=n[s][c]*n[s][c];for(r=(n[c+1][c]>0?-1:1)*e.sqrt(r),o=e.sqrt((r*r-n[c+1][c]*r)/2),(u=t.zeros(a,1))[c+1][0]=(n[c+1][c]-r)/(2*o),i=c+2;i<a;i++)u[i][0]=n[i][c]/(2*o);f=t.subtract(t.identity(a,l),t.multiply(t.multiply(u,t.transpose(u)),2)),n=t.multiply(f,t.multiply(n,f))}return n},QR:(n=t.sum,r=t.arange,function(o){var i,s,a,l=o.length,c=o[0].length,u=t.zeros(c,c);for(o=t.copy(o),s=0;s<c;s++){for(u[s][s]=e.sqrt(n(r(l).map((function(t){return o[t][s]*o[t][s]})))),i=0;i<l;i++)o[i][s]=o[i][s]/u[s][s];for(a=s+1;a<c;a++)for(u[s][a]=n(r(l).map((function(t){return o[t][s]*o[t][a]}))),i=0;i<l;i++)o[i][a]=o[i][a]-o[i][s]*u[s][a]}return[o,u]}),lstsq:function(e,n){var r=!1;void 0===n[0].length&&(n=n.map((function(t){return[t]})),r=!0);var o=t.QR(e),i=o[0],s=o[1],a=e[0].length,l=t.slice(i,{col:{end:a}}),c=function(e){var n=(e=t.copy(e)).length,r=t.identity(n);return t.arange(n-1,-1,-1).forEach((function(n){t.sliceAssign(r,{row:n},t.divide(t.slice(r,{row:n}),e[n][n])),t.sliceAssign(e,{row:n},t.divide(t.slice(e,{row:n}),e[n][n])),t.arange(n).forEach((function(o){var i=t.multiply(e[o][n],-1),s=t.slice(e,{row:o}),a=t.multiply(t.slice(e,{row:n}),i);t.sliceAssign(e,{row:o},t.add(s,a));var l=t.slice(r,{row:o}),c=t.multiply(t.slice(r,{row:n}),i);t.sliceAssign(r,{row:o},t.add(l,c))}))})),r}(t.slice(s,{row:{end:a}})),u=t.transpose(l);void 0===u[0].length&&(u=[u]);var f=t.multiply(t.multiply(c,u),n);return void 0===f.length&&(f=[[f]]),r?f.map((function(t){return t[0]})):f},jacobi:function(n){for(var r,o,i,s,a,l,c,u=1,f=n.length,h=t.identity(f,f),d=[];1===u;){for(a=n[0][1],i=0,s=1,r=0;r<f;r++)for(o=0;o<f;o++)r!=o&&a<e.abs(n[r][o])&&(a=e.abs(n[r][o]),i=r,s=o);for(l=n[i][i]===n[s][s]?n[i][s]>0?e.PI/4:-e.PI/4:e.atan(2*n[i][s]/(n[i][i]-n[s][s]))/2,(c=t.identity(f,f))[i][i]=e.cos(l),c[i][s]=-e.sin(l),c[s][i]=e.sin(l),c[s][s]=e.cos(l),h=t.multiply(h,c),n=t.multiply(t.multiply(t.inv(c),n),c),u=0,r=1;r<f;r++)for(o=1;o<f;o++)r!=o&&e.abs(n[r][o])>.001&&(u=1)}for(r=0;r<f;r++)d.push(n[r][r]);return[h,d]},rungekutta:function(t,e,n,r,o,i){var s,a,l;if(2===i)for(;r<=n;)o+=((s=e*t(r,o))+(a=e*t(r+e,o+s)))/2,r+=e;if(4===i)for(;r<=n;)o+=((s=e*t(r,o))+2*(a=e*t(r+e/2,o+s/2))+2*(l=e*t(r+e/2,o+a/2))+e*t(r+e,o+l))/6,r+=e;return o},romberg:function(t,n,r,o){for(var i,s,a,l,c,u=0,f=(r-n)/2,h=[],d=[],m=[];u<o/2;){for(c=t(n),a=n,l=0;a<=r;a+=f,l++)h[l]=a;for(i=h.length,a=1;a<i-1;a++)c+=(a%2!=0?4:2)*t(h[a]);c=f/3*(c+t(r)),m[u]=c,f/=2,u++}for(s=m.length,i=1;1!==s;){for(a=0;a<s-1;a++)d[a]=(e.pow(4,i)*m[a+1]-m[a])/(e.pow(4,i)-1);s=d.length,m=d,d=[],i++}return m},richardson:function(t,n,r,o){function i(t,e){for(var n,r=0,o=t.length;r<o;r++)t[r]===e&&(n=r);return n}for(var s,a,l,c,u,f=e.abs(r-t[i(t,r)+1]),h=0,d=[],m=[];o>=f;)s=i(t,r+o),a=i(t,r),d[h]=(n[s]-2*n[a]+n[2*a-s])/(o*o),o/=2,h++;for(c=d.length,l=1;1!=c;){for(u=0;u<c-1;u++)m[u]=(e.pow(4,l)*d[u+1]-d[u])/(e.pow(4,l)-1);c=m.length,d=m,m=[],l++}return d},simpson:function(t,e,n,r){for(var o,i=(n-e)/r,s=t(e),a=[],l=e,c=0,u=1;l<=n;l+=i,c++)a[c]=l;for(o=a.length;u<o-1;u++)s+=(u%2!=0?4:2)*t(a[u]);return i/3*(s+t(n))},hermite:function(t,e,n,r){for(var o,i=t.length,s=0,a=0,l=[],c=[],u=[],f=[];a<i;a++){for(l[a]=1,o=0;o<i;o++)a!=o&&(l[a]*=(r-t[o])/(t[a]-t[o]));for(c[a]=0,o=0;o<i;o++)a!=o&&(c[a]+=1/(t[a]-t[o]));u[a]=(1-2*(r-t[a])*c[a])*(l[a]*l[a]),f[a]=(r-t[a])*(l[a]*l[a]),s+=u[a]*e[a]+f[a]*n[a]}return s},lagrange:function(t,e,n){for(var r,o,i=0,s=0,a=t.length;s<a;s++){for(o=e[s],r=0;r<a;r++)s!=r&&(o*=(n-t[r])/(t[s]-t[r]));i+=o}return i},cubic_spline:function(e,n,r){for(var o,i,s=e.length,a=0,l=[],c=[],u=[],f=[],h=[],d=[];a<s-1;a++)f[a]=e[a+1]-e[a];for(u[0]=0,a=1;a<s-1;a++)u[a]=3/f[a]*(n[a+1]-n[a])-3/f[a-1]*(n[a]-n[a-1]);for(a=1;a<s-1;a++)l[a]=[],c[a]=[],l[a][a-1]=f[a-1],l[a][a]=2*(f[a-1]+f[a]),l[a][a+1]=f[a],c[a][0]=u[a];for(i=t.multiply(t.inv(l),c),o=0;o<s-1;o++)h[o]=(n[o+1]-n[o])/f[o]-f[o]*(i[o+1][0]+2*i[o][0])/3,d[o]=(i[o+1][0]-i[o][0])/(3*f[o]);for(o=0;o<s&&!(e[o]>r);o++);return n[o-=1]+(r-e[o])*h[o]+t.sq(r-e[o])*i[o]+(r-e[o])*t.sq(r-e[o])*d[o]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(e){var n,r,o,i,s,a=e.length,l=e[0].length,c=0,u=[],f=[],h=[],d=[],m=[],p=[],y=[];for(c=0;c<a;c++)u[c]=t.sum(e[c])/l;for(c=0;c<l;c++)for(m[c]=[],n=0;n<a;n++)m[c][n]=e[n][c]-u[n];for(m=t.transpose(m),c=0;c<a;c++)for(p[c]=[],n=0;n<a;n++)p[c][n]=t.dot([m[c]],[m[n]])/(l-1);for(s=(o=t.jacobi(p))[0],f=o[1],y=t.transpose(s),c=0;c<f.length;c++)for(n=c;n<f.length;n++)f[c]<f[n]&&(r=f[c],f[c]=f[n],f[n]=r,h=y[c],y[c]=y[n],y[n]=h);for(i=t.transpose(m),c=0;c<a;c++)for(d[c]=[],n=0;n<i.length;n++)d[c][n]=t.dot([y[c]],[i[n]]);return[e,f,y,d]}}),function(e){for(var n=0;n<e.length;n++)!function(e){t.fn[e]=function(n,r){var o=this;return r?(setTimeout((function(){r.call(o,t.fn[e].call(o,n))}),15),this):"number"==typeof t[e](this,n)?t[e](this,n):t(t[e](this,n))}}(e[n])}("add divide multiply subtract dot pow exp log abs norm angle".split(" "))}(e,Math),function(t,e){var n=[].slice,r=t.utils.isNumber,o=t.utils.isArray;function i(t,n,r,o){if(t>1||r>1||t<=0||r<=0)throw new Error("Proportions should be greater than 0 and less than 1");var i=(t*n+r*o)/(n+o);return(t-r)/e.sqrt(i*(1-i)*(1/n+1/o))}t.extend({zscore:function(){var e=n.call(arguments);return r(e[1])?(e[0]-e[1])/e[2]:(e[0]-t.mean(e[1]))/t.stdev(e[1],e[2])},ztest:function(){var r,i=n.call(arguments);return o(i[1])?(r=t.zscore(i[0],i[1],i[3]),1===i[2]?t.normal.cdf(-e.abs(r),0,1):2*t.normal.cdf(-e.abs(r),0,1)):i.length>2?(r=t.zscore(i[0],i[1],i[2]),1===i[3]?t.normal.cdf(-e.abs(r),0,1):2*t.normal.cdf(-e.abs(r),0,1)):(r=i[0],1===i[1]?t.normal.cdf(-e.abs(r),0,1):2*t.normal.cdf(-e.abs(r),0,1))}}),t.extend(t.fn,{zscore:function(t,e){return(t-this.mean())/this.stdev(e)},ztest:function(n,r,o){var i=e.abs(this.zscore(n,o));return 1===r?t.normal.cdf(-i,0,1):2*t.normal.cdf(-i,0,1)}}),t.extend({tscore:function(){var r=n.call(arguments);return 4===r.length?(r[0]-r[1])/(r[2]/e.sqrt(r[3])):(r[0]-t.mean(r[1]))/(t.stdev(r[1],!0)/e.sqrt(r[1].length))},ttest:function(){var o,i=n.call(arguments);return 5===i.length?(o=e.abs(t.tscore(i[0],i[1],i[2],i[3])),1===i[4]?t.studentt.cdf(-o,i[3]-1):2*t.studentt.cdf(-o,i[3]-1)):r(i[1])?(o=e.abs(i[0]),1==i[2]?t.studentt.cdf(-o,i[1]-1):2*t.studentt.cdf(-o,i[1]-1)):(o=e.abs(t.tscore(i[0],i[1])),1==i[2]?t.studentt.cdf(-o,i[1].length-1):2*t.studentt.cdf(-o,i[1].length-1))}}),t.extend(t.fn,{tscore:function(t){return(t-this.mean())/(this.stdev(!0)/e.sqrt(this.cols()))},ttest:function(n,r){return 1===r?1-t.studentt.cdf(e.abs(this.tscore(n)),this.cols()-1):2*t.studentt.cdf(-e.abs(this.tscore(n)),this.cols()-1)}}),t.extend({anovafscore:function(){var r,o,i,s,a,l,c,u,f=n.call(arguments);if(1===f.length){for(a=new Array(f[0].length),c=0;c<f[0].length;c++)a[c]=f[0][c];f=a}for(o=new Array,c=0;c<f.length;c++)o=o.concat(f[c]);for(i=t.mean(o),r=0,c=0;c<f.length;c++)r+=f[c].length*e.pow(t.mean(f[c])-i,2);for(r/=f.length-1,l=0,c=0;c<f.length;c++)for(s=t.mean(f[c]),u=0;u<f[c].length;u++)l+=e.pow(f[c][u]-s,2);return r/(l/(o.length-f.length))},anovaftest:function(){var e,o,i,s,a=n.call(arguments);if(r(a[0]))return 1-t.centralF.cdf(a[0],a[1],a[2]);var l=t.anovafscore(a);for(e=a.length-1,i=0,s=0;s<a.length;s++)i+=a[s].length;return o=i-e-1,1-t.centralF.cdf(l,e,o)},ftest:function(e,n,r){return 1-t.centralF.cdf(e,n,r)}}),t.extend(t.fn,{anovafscore:function(){return t.anovafscore(this.toArray())},anovaftes:function(){var e,n=0;for(e=0;e<this.length;e++)n+=this[e].length;return t.ftest(this.anovafscore(),this.length-1,n-this.length)}}),t.extend({qscore:function(){var o,i,s,a,l,c=n.call(arguments);return r(c[0])?(o=c[0],i=c[1],s=c[2],a=c[3],l=c[4]):(o=t.mean(c[0]),i=t.mean(c[1]),s=c[0].length,a=c[1].length,l=c[2]),e.abs(o-i)/(l*e.sqrt((1/s+1/a)/2))},qtest:function(){var e,r=n.call(arguments);3===r.length?(e=r[0],r=r.slice(1)):7===r.length?(e=t.qscore(r[0],r[1],r[2],r[3],r[4]),r=r.slice(5)):(e=t.qscore(r[0],r[1],r[2]),r=r.slice(3));var o=r[0],i=r[1];return 1-t.tukey.cdf(e,i,o-i)},tukeyhsd:function(e){for(var n=t.pooledstdev(e),r=e.map((function(e){return t.mean(e)})),o=e.reduce((function(t,e){return t+e.length}),0),i=[],s=0;s<e.length;++s)for(var a=s+1;a<e.length;++a){var l=t.qtest(r[s],r[a],e[s].length,e[a].length,n,o,e.length);i.push([[s,a],l])}return i}}),t.extend({normalci:function(){var r,o=n.call(arguments),i=new Array(2);return r=4===o.length?e.abs(t.normal.inv(o[1]/2,0,1)*o[2]/e.sqrt(o[3])):e.abs(t.normal.inv(o[1]/2,0,1)*t.stdev(o[2])/e.sqrt(o[2].length)),i[0]=o[0]-r,i[1]=o[0]+r,i},tci:function(){var r,o=n.call(arguments),i=new Array(2);return r=4===o.length?e.abs(t.studentt.inv(o[1]/2,o[3]-1)*o[2]/e.sqrt(o[3])):e.abs(t.studentt.inv(o[1]/2,o[2].length-1)*t.stdev(o[2],!0)/e.sqrt(o[2].length)),i[0]=o[0]-r,i[1]=o[0]+r,i},significant:function(t,e){return t<e}}),t.extend(t.fn,{normalci:function(e,n){return t.normalci(e,n,this.toArray())},tci:function(e,n){return t.tci(e,n,this.toArray())}}),t.extend(t.fn,{oneSidedDifferenceOfProportions:function(e,n,r,o){var s=i(e,n,r,o);return t.ztest(s,1)},twoSidedDifferenceOfProportions:function(e,n,r,o){var s=i(e,n,r,o);return t.ztest(s,2)}})}(e,Math),e.models=function(){function t(t,n){var r=t.length,o=n[0].length-1,i=r-o-1,s=e.lstsq(n,t),a=e.multiply(n,s.map((function(t){return[t]}))).map((function(t){return t[0]})),l=e.subtract(t,a),c=e.mean(t),u=e.sum(a.map((function(t){return Math.pow(t-c,2)}))),f=e.sum(t.map((function(t,e){return Math.pow(t-a[e],2)}))),h=u+f;return{exog:n,endog:t,nobs:r,df_model:o,df_resid:i,coef:s,predict:a,resid:l,ybar:c,SST:h,SSE:u,SSR:f,R2:u/h}}function n(n){var r,o,i=(r=n.exog,o=r[0].length,e.arange(o).map((function(n){var i=e.arange(o).filter((function(t){return t!==n}));return t(e.col(r,n).map((function(t){return t[0]})),e.col(r,i))}))),s=Math.sqrt(n.SSR/n.df_resid),a=i.map((function(t){var e=t.SST,n=t.R2;return s/Math.sqrt(e*(1-n))})),l=n.coef.map((function(t,e){return(t-0)/a[e]})),c=l.map((function(t){var r=e.studentt.cdf(t,n.df_resid);return 2*(r>.5?1-r:r)})),u=e.studentt.inv(.975,n.df_resid),f=n.coef.map((function(t,e){var n=u*a[e];return[t-n,t+n]}));return{se:a,t:l,p:c,sigmaHat:s,interval95:f}}return{ols:function(r,o){var i=t(r,o),s=n(i),a=function(t){var n,r,o,i=t.R2/t.df_model/((1-t.R2)/t.df_resid);return{F_statistic:i,pvalue:1-(n=i,r=t.df_model,o=t.df_resid,e.beta.cdf(n/(o/r+n),r/2,o/2))}}(i),l=1-(1-i.R2)*((i.nobs-1)/i.df_resid);return i.t=s,i.f=a,i.adjust_R2=l,i}}}(),e.extend({buildxmatrix:function(){for(var t=new Array(arguments.length),n=0;n<arguments.length;n++)t[n]=[1].concat(arguments[n]);return e(t)},builddxmatrix:function(){for(var t=new Array(arguments[0].length),n=0;n<arguments[0].length;n++)t[n]=[1].concat(arguments[0][n]);return e(t)},buildjxmatrix:function(t){for(var n=new Array(t.length),r=0;r<t.length;r++)n[r]=t[r];return e.builddxmatrix(n)},buildymatrix:function(t){return e(t).transpose()},buildjymatrix:function(t){return t.transpose()},matrixmult:function(t,n){var r,o,i,s,a;if(t.cols()==n.rows()){if(n.rows()>1){for(s=[],r=0;r<t.rows();r++)for(s[r]=[],o=0;o<n.cols();o++){for(a=0,i=0;i<t.cols();i++)a+=t.toArray()[r][i]*n.toArray()[i][o];s[r][o]=a}return e(s)}for(s=[],r=0;r<t.rows();r++)for(s[r]=[],o=0;o<n.cols();o++){for(a=0,i=0;i<t.cols();i++)a+=t.toArray()[r][i]*n.toArray()[o];s[r][o]=a}return e(s)}},regress:function(t,n){var r=e.xtranspxinv(t),o=t.transpose(),i=e.matrixmult(e(r),o);return e.matrixmult(i,n)},regresst:function(t,n,r){var o=e.regress(t,n),i={anova:{}},s=e.jMatYBar(t,o);i.yBar=s;var a=n.mean();i.anova.residuals=e.residuals(n,s),i.anova.ssr=e.ssr(s,a),i.anova.msr=i.anova.ssr/(t[0].length-1),i.anova.sse=e.sse(n,s),i.anova.mse=i.anova.sse/(n.length-(t[0].length-1)-1),i.anova.sst=e.sst(n,a),i.anova.mst=i.anova.sst/(n.length-1),i.anova.r2=1-i.anova.sse/i.anova.sst,i.anova.r2<0&&(i.anova.r2=0),i.anova.fratio=i.anova.msr/i.anova.mse,i.anova.pvalue=e.anovaftest(i.anova.fratio,t[0].length-1,n.length-(t[0].length-1)-1),i.anova.rmse=Math.sqrt(i.anova.mse),i.anova.r2adj=1-i.anova.mse/i.anova.mst,i.anova.r2adj<0&&(i.anova.r2adj=0),i.stats=new Array(t[0].length);for(var l,c,u,f=e.xtranspxinv(t),h=0;h<o.length;h++)l=Math.sqrt(i.anova.mse*Math.abs(f[h][h])),c=Math.abs(o[h]/l),u=e.ttest(c,n.length-t[0].length-1,r),i.stats[h]=[o[h],l,c,u];return i.regress=o,i},xtranspx:function(t){return e.matrixmult(t.transpose(),t)},xtranspxinv:function(t){var n=e.matrixmult(t.transpose(),t);return e.inv(n)},jMatYBar:function(t,n){var r=e.matrixmult(t,n);return new e(r)},residuals:function(t,n){return e.matrixsubtract(t,n)},ssr:function(t,e){for(var n=0,r=0;r<t.length;r++)n+=Math.pow(t[r]-e,2);return n},sse:function(t,e){for(var n=0,r=0;r<t.length;r++)n+=Math.pow(t[r]-e[r],2);return n},sst:function(t,e){for(var n=0,r=0;r<t.length;r++)n+=Math.pow(t[r]-e,2);return n},matrixsubtract:function(t,n){for(var r=new Array(t.length),o=0;o<t.length;o++){r[o]=new Array(t[o].length);for(var i=0;i<t[o].length;i++)r[o][i]=t[o][i]-n[o][i]}return e(r)}}),e.jStat=e,e)},326:(t,e,n)=>{"use strict";n.d(e,{D:()=>s});var r=n(82),o=n(389),i=n(755);class s extends r.JsViewer{constructor(t){super(),this.canvas=o.canvas(),this.gridCellStyle=r.GridCellStyle.create(),this.renderer=t,this.root.append(this.canvas),this.canvas.style.width="100%",this.canvas.style.height="100%",o.tools.handleResize(this.canvas,((t,e)=>{this.canvas.width=t,this.canvas.height=e,this.render()}));const e=t=>e=>{this.gridCell&&t(this.gridCell,e)};this.canvas.onmousemove=e(this.renderer.onMouseMove),this.canvas.onmouseenter=e(this.renderer.onMouseEnter),this.canvas.onmouseleave=e(this.renderer.onMouseLeave)}static fromGridCell(t){const e=new s(new i.lR);return e.gridCell=t,e.render(),e}render(){if(!this.gridCell)return;const t=this.canvas.getContext("2d");t.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderer.renderInternal(t,0,0,this.canvas.width,this.canvas.height,this.gridCell.dart,this.gridCellStyle)}}},95:(t,e,n)=>{"use strict";n.d(e,{h:()=>r});class r{}r.TAG_FIT_CHART_FORMAT=".fitChartFormat",r.TAG_FIT_CHART_FORMAT_3DX="3dx",r.FIT_SEM_TYPE="fit",r.FIT_CELL_TYPE="fit",r.TAG_FIT=".fit",r.CELL_DEFAULT_WIDTH=230,r.CELL_DEFAULT_HEIGHT=160,r.MIN_CELL_RENDERER_PX_WIDTH=20,r.MIN_CELL_RENDERER_PX_HEIGHT=10,r.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH=70,r.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT=45,r.MIN_AXES_CELL_PX_WIDTH=100,r.MIN_AXES_CELL_PX_HEIGHT=55,r.MIN_TITLE_PX_WIDTH=275,r.MIN_TITLE_PX_HEIGHT=225,r.MIN_X_AXIS_NAME_VISIBILITY_PX_WIDTH=180,r.MIN_Y_AXIS_NAME_VISIBILITY_PX_HEIGHT=140,r.MIN_LEGEND_PX_WIDTH=325,r.MIN_LEGEND_PX_HEIGHT=275,r.MIN_DROPLINES_VISIBILITY_PX_WIDTH=120,r.MIN_DROPLINES_VISIBILITY_PX_HEIGHT=110,r.AXES_LEFT_PX_MARGIN=38,r.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS=45,r.AXES_TOP_PX_MARGIN=5,r.AXES_TOP_PX_MARGIN_WITH_TITLE=25,r.AXES_RIGHT_PX_MARGIN=18,r.AXES_BOTTOM_PX_MARGIN=15,r.AXES_BOTTOM_PX_MARGIN_WITH_AXES_LABELS=30,r.X_AXIS_LABEL_BOTTOM_PX_MARGIN=4,r.LEGEND_TOP_PX_MARGIN=10,r.OUTLIER_PX_SIZE=12,r.POINT_PX_SIZE=4,r.OUTLIER_HITBOX_RADIUS=2,r.CANDLESTICK_BORDER_PX_SIZE=4,r.CANDLESTICK_MEDIAN_PX_SIZE=3.5,r.CANDLESTICK_OUTLIER_PX_SIZE=6,r.INFLATE_SIZE=-6,r.LEGEND_RECORD_PX_HEIGHT=18,r.LEGEND_RECORD_LINE_PX_WIDTH=20,r.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN=5,r.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN=4,r.LINE_STYLES={solid:[],dotted:[1,1],dashed:[5,5],dashdotted:[5,5,2,5]},r.CURVE_CONFIDENCE_INTERVAL_BOUNDS={TOP:"top",BOTTOM:"bottom"},r.CONFIDENCE_INTERVAL_STROKE_COLOR="rgba(255,191,63,0.4)",r.CONFIDENCE_INTERVAL_FILL_COLOR="rgba(255,238,204,0.3)",r.CONDITION_MAP={"No series to show":t=>void 0===t||0===(null==t?void 0:t.length),"There were series with no points":t=>t.some((t=>{var e;return 0===(null===(e=t.points)||void 0===e?void 0:e.length)})),"There were series with all x zeroes":t=>t.some((t=>{var e;return null===(e=t.points)||void 0===e?void 0:e.every((t=>0===t.x))})),"There were series with all y zeroes":t=>t.some((t=>{var e;return null===(e=t.points)||void 0===e?void 0:e.every((t=>0===t.y))}))}},471:(t,e,n)=>{"use strict";n.d(e,{kL:()=>c,nO:()=>u});var r=n(82),o=(n(328),n(860),n(71)),i=n(991),s=n.n(i),a=n(95);function l(t,e){return Math.random()*(e-t)+t}function c(t,e,n=1){const r=new Float32Array(t*n),i=new Float32Array(t*n),s=[l(1,2),l(1,2),l(1,2),l(-5,5)],a=0-Math.floor(t/2)*e,c=a+e*(t-1);for(let t=a,l=0;t<=c;t+=e,l++)for(let e=0;e<n;e++){r[l*n+e]=t-a+.1;const c=new Float32Array(4);c.set(s),i[l*n+e]=(0,o.ry)(c,t)}const u=(1===n?.2:.4)*(Math.max(...i)-Math.min(...i)),f=Math.min(...i);for(let t=0;t<r.length;t++)i[t]=-f+i[t]+l(0,u);return{x:r,y:i,params:s}}function u(t,e,n){var o;const i=r.DataFrame.create(t);for(let l=0;l<e;l++){const e=3===l?5:1,u=i.columns.addNewString(`json chart ${l}`);u.semType=a.h.FIT_SEM_TYPE;let f=l%2==0?n:1;for(let i=0;i<t;i++){const t={series:[],chartOptions:{showStatistics:1===f?["auc"]:[],xAxisName:"Conc.",yAxisName:"Activity",title:"Dose-Response curves"}};for(let i=0;i<f;i++){const a=c(15,.5,e);let u=r.Color.toHtml(r.Color.getCategoricalColor(l*n+i));null===(o=t.series)||void 0===o||o.push({parameters:void 0,fitLineColor:u,pointColor:u,showCurveConfidenceInterval:1===f,points:s().count().take(15*e).map((function(t){return{x:a.x[t],y:a.y[t]}})).toArray()})}u.set(i,JSON.stringify(t))}}return i}},48:(t,e,n)=>{"use strict";n.d(e,{JR:()=>l,VK:()=>a});var r,o=n(82),i=(n(389),n(999));n(71),n(755),n(326),n(283),n(95),function(t){t.DATAFRAME="Dataframe",t.COLUMN="Column",t.CELL="Cell"}(r||(r={}));const s={count:"totalCount",nulls:"missingValueCount",unique:"uniqueCount",values:"valueCount",min:"min",max:"max",sum:"sum",avg:"avg",stdev:"stdev",variance:"variance",skew:"skew",kurt:"kurt",med:"med",q1:"q1",q2:"q2",q3:"q3"};function a(t,e){const n=(0,i.zB)(t);if(t.parameters)e.logX&&t.parameters[2]>0&&(t.parameters[2]=Math.log10(t.parameters[2]));else{const r=(0,i.nT)(t,n,e).parameters;t.parameters=[...r]}return(0,i.VA)(t,n,e)}function l(t,e){var n,r,i;const l={logX:null===(n=t.chartOptions)||void 0===n?void 0:n.logX,logY:null===(r=t.chartOptions)||void 0===r?void 0:r.logY},c=[],u=[],f=[],h=[],d=[],m=[],p=[];for(let e=0,n=0;e<(null===(i=t.series)||void 0===i?void 0:i.length);e++){if(t.series[e].points.every((t=>t.outlier)))continue;const r=a(t.series[e],l);c[n]=r.rSquared,u[n]=r.auc,f[n]=r.interceptX,h[n]=r.interceptY,d[n]=r.slope,m[n]=r.top,p[n]=r.bottom,n++}return{rSquared:c.some((t=>null==t))?void 0:o.Stats.fromValues(c)[s[e]],auc:u.some((t=>null==t))?void 0:o.Stats.fromValues(u)[s[e]],interceptX:f.some((t=>null==t))?void 0:o.Stats.fromValues(f)[s[e]],interceptY:h.some((t=>null==t))?void 0:o.Stats.fromValues(h)[s[e]],slope:d.some((t=>null==t))?void 0:o.Stats.fromValues(d)[s[e]],top:m.some((t=>null==t))?void 0:o.Stats.fromValues(m)[s[e]],bottom:p.some((t=>null==t))?void 0:o.Stats.fromValues(p)[s[e]]}}o.ObjectHandler},283:(t,e,n)=>{"use strict";n.d(e,{K:()=>c});var r=n(82),o=n(71);const i={x:"xAxis",y:"yAxis"},s={min:"min",max:"max"};function a(t){var e,n,i;const s=null===(n=null===(e=t.getElementsByTagName("params")[0])||void 0===e?void 0:e.childNodes[0].nodeValue)||void 0===n?void 0:n.split(",").map(Number);let a=null===(i=t.getElementsByTagName("function")[0])||void 0===i?void 0:i.getAttribute("type");a=a&&"sigif"!==a?a:o.G7;const l=t.getElementsByTagName("settings")[0].getAttribute("markerColor"),c=t.getElementsByTagName("settings")[0].getAttribute("color"),u=!!t.getElementsByTagName("settings")[0].getAttribute("drawLine"),f={name:t.getAttribute("name"),fitFunction:a,markerType:r.MARKER_TYPE.CIRCLE,pointColor:l,fitLineColor:c,showFitLine:u,showPoints:"points",showCurveConfidenceInterval:!1,clickToToggle:!1};return s&&(f.parameters=[s[2],s[1],s[0],s[3]]),f}function l(t){const e=function(t){var e,n,r;const o=null===(e=t.getElementsByTagName("x")[0].childNodes[0].nodeValue)||void 0===e?void 0:e.split(","),i=null===(n=t.getElementsByTagName("y")[0].childNodes[0].nodeValue)||void 0===n?void 0:n.split(","),s=null===(r=t.getElementsByTagName("mask")[0].childNodes[0].nodeValue)||void 0===r?void 0:r.split(""),a=[];for(let t=0;t<o.length;t++)a[t]={x:+o[t],y:+i[t],outlier:!Boolean(s[t])};return a}(t),n=a(t),r={points:e};return Object.assign(r,n),r}function c(t){const e=(new DOMParser).parseFromString(t,"text/xml"),n=e.getElementsByTagName("grid")[0],r=(c=e.getElementsByTagName("settings")[0],{minX:+(o=n).getElementsByTagName(i.x)[0].getAttribute(s.min),minY:+o.getElementsByTagName(i.y)[0].getAttribute(s.min),maxX:+o.getElementsByTagName(i.x)[0].getAttribute(s.max),maxY:+o.getElementsByTagName(i.y)[0].getAttribute(s.max),xAxisName:c.getAttribute("xLabel"),yAxisName:c.getAttribute("yLabel"),logX:!!c.getAttribute("logX")});var o,c;const u=e.getElementsByTagName("seriesCollection")[0],f=a(u.getElementsByTagName("series")[0]),h=function(t){const e=[],n=t.getElementsByTagName("series").length;for(let r=0;r<n;r++){const n=t.getElementsByTagName("series")[r];e[r]=l(n)}return e}(u);return{chartOptions:r,seriesOptions:f,series:h}}},755:(t,e,n)=>{"use strict";n.d(e,{lR:()=>k,j$:()=>M,bc:()=>F,Ig:()=>X,Yc:()=>G,Tv:()=>D,LX:()=>P,g2:()=>O,wU:()=>R,B3:()=>B});var r=n(82),o=n(328),i=n(389),s=n(71),a=n(293),l=n(999),c=n(283),u=n(326),f=n(48),h=n(95),d=n(368);const m=window,p=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});class y{static getUniqueName(t,e,n){return m.grok_Utils_GetUniqueName(t,e,null==n?void 0:n.auto,null==n?void 0:n.idx,null==n?void 0:n.render,null==n?void 0:n.choices)}static isEmpty(t){return null==t||""==t}static formatNumber(t){return p.format(t)}}function g(t,e){const n=t.pointColor&&r.Color.fromHtml(t.pointColor)?t.pointColor:r.Color.toHtml(r.Color.getCategoricalColor(e)),o=t.outlierColor&&r.Color.fromHtml(t.outlierColor)?t.outlierColor:r.Color.toHtml(r.Color.red),i=t.fitLineColor&&r.Color.fromHtml(t.fitLineColor)?t.fitLineColor:r.Color.toHtml(r.Color.getCategoricalColor(e));t.pointColor=n,t.outlierColor=o,t.fitLineColor=i}function x(t,e,n){var r;if(null!==(r=e.connectDots)&&void 0!==r&&r){t.strokeStyle=e.pointColor,t.lineWidth=2*n.ratio,t.beginPath();for(let r=0;r<e.points.length;r++){const o=e.points[r].x,i=e.points[r].y,s=n.viewport.xToScreen(o),a=n.viewport.yToScreen(i);0===r?t.moveTo(s,a):t.lineTo(s,a)}t.stroke()}}function v(t,e,n){var o;(null===(o=e.showPoints)||void 0===o||o)&&(t.strokeStyle=e.pointColor,e.connectDots&&""!==e.showPoints||"points"===e.showPoints?function(t,e,n){for(let o=0;o<e.points.length;o++){const i=e.points[o],s=e.connectDots?e.pointColor:i.outlier?i.outlierColor&&r.Color.fromHtml(i.outlierColor)?i.outlierColor:e.outlierColor:i.color&&r.Color.fromHtml(i.color)?i.color:e.pointColor,a=i.marker?i.marker:e.markerType,l=i.outlierMarker?i.outlierMarker:e.outlierMarkerType,c=e.connectDots?h.h.POINT_PX_SIZE*n.ratio:i.outlier?h.h.OUTLIER_PX_SIZE*n.ratio:i.size?i.size:h.h.POINT_PX_SIZE*n.ratio;r.Paint.marker(t,e.connectDots?a:i.outlier?l:a,n.viewport.xToScreen(i.x),n.viewport.yToScreen(i.y),s,c),i.stdev&&!i.outlier&&(t.strokeStyle=s,t.beginPath(),t.moveTo(n.viewport.xToScreen(i.x),n.viewport.yToScreen(i.y+i.stdev)),t.lineTo(n.viewport.xToScreen(i.x),n.viewport.yToScreen(i.y-i.stdev)),t.stroke())}}(t,e,n):["candlesticks","both"].includes(e.showPoints)&&function(t,e,n){for(let o=0,i=null;o<e.points.length;o++){const s=e.points[o];if(s.outlier)continue;const a=o+1<e.points.length&&e.points[o+1].x===s.x;if(!i&&a)i=o;else if(null!==i&&!a){const a=[];for(let t=i,n=0;t<=o;t++,n++)a[n]=e.points[t].y;const l=(0,d.k)(a);if(t.beginPath(),w(t,{viewport:n.viewport,ratio:n.ratio,x:s.x,boxPlotStats:l,color:e.pointColor}),t.stroke(),"both"===e.showPoints)for(let o=0;o<a.length;o++)(a[o]<l.lowerAdjacentValue||a[o]>l.upperAdjacentValue)&&r.Paint.marker(t,r.MARKER_TYPE.OUTLIER,n.viewport.xToScreen(s.x),n.viewport.yToScreen(a[o]),e.pointColor,h.h.CANDLESTICK_OUTLIER_PX_SIZE*n.ratio);i=null}}}(t,e,n))}function w(t,e){T(t,e.x,e.boxPlotStats.lowerAdjacentValue,e.viewport),t.moveTo(e.viewport.xToScreen(e.x),e.viewport.yToScreen(e.boxPlotStats.lowerAdjacentValue)),t.lineTo(e.viewport.xToScreen(e.x),e.viewport.yToScreen(e.boxPlotStats.upperAdjacentValue)),T(t,e.x,e.boxPlotStats.upperAdjacentValue,e.viewport),r.Paint.marker(t,r.MARKER_TYPE.CIRCLE,e.viewport.xToScreen(e.x),e.viewport.yToScreen(e.boxPlotStats.q2),e.color,h.h.CANDLESTICK_MEDIAN_PX_SIZE*e.ratio)}function T(t,e,n,r){t.moveTo(r.xToScreen(e)-h.h.CANDLESTICK_BORDER_PX_SIZE/2,r.yToScreen(n)),t.lineTo(r.xToScreen(e)+h.h.CANDLESTICK_BORDER_PX_SIZE/2,r.yToScreen(n))}function _(t,e,n){var r;if(null===(r=e.showFitLine)||void 0===r||r){t.save(),t.strokeStyle=e.fitLineColor,t.lineWidth=2*n.ratio,t.beginPath(),e.lineStyle&&t.setLineDash(h.h.LINE_STYLES[e.lineStyle]);const r=n.showAxes?n.showAxesLabels?h.h.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:h.h.AXES_LEFT_PX_MARGIN:0,o=n.showAxes?h.h.AXES_RIGHT_PX_MARGIN:0;for(let e=r;e<=n.screenBounds.width-o;e++){const o=n.screenBounds.x+e,i=n.logOptions.logX?Math.log10(n.viewport.xToWorld(o)):n.viewport.xToWorld(o),s=n.logOptions.logY?n.viewport.yToScreen(Math.pow(10,n.curveFunc(i))):n.viewport.yToScreen(n.curveFunc(i));e===r?t.moveTo(o,s):t.lineTo(o,s)}t.stroke(),t.restore()}}function C(t,e,n){var r,o,i,s;if((null===(r=e.showFitLine)||void 0===r||r)&&null!==(o=e.showCurveConfidenceInterval)&&void 0!==o&&o){t.strokeStyle=null!==(i=e.confidenceIntervalColor)&&void 0!==i?i:h.h.CONFIDENCE_INTERVAL_STROKE_COLOR,t.fillStyle=null!==(s=e.confidenceIntervalColor)&&void 0!==s?s:h.h.CONFIDENCE_INTERVAL_FILL_COLOR;const r=(0,l.fY)(e,n.fitFunc,n.userParamsFlag,n.logOptions);E(t,{viewport:n.viewport,logOptions:n.logOptions,showAxes:n.showAxes,showAxesLabels:n.showAxesLabels,screenBounds:n.screenBounds,confidenceIntervals:r,confidenceType:h.h.CURVE_CONFIDENCE_INTERVAL_BOUNDS.TOP}),E(t,{viewport:n.viewport,logOptions:n.logOptions,showAxes:n.showAxes,showAxesLabels:n.showAxesLabels,screenBounds:n.screenBounds,confidenceIntervals:r,confidenceType:h.h.CURVE_CONFIDENCE_INTERVAL_BOUNDS.BOTTOM}),function(t,e){t.beginPath();const n=e.showAxes?e.showAxesLabels?h.h.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:h.h.AXES_LEFT_PX_MARGIN:0,r=e.showAxes?h.h.AXES_RIGHT_PX_MARGIN:0;for(let o=n;o<=e.screenBounds.width-r;o++){const r=e.screenBounds.x+o,i=e.logOptions.logX?Math.log10(e.viewport.xToWorld(r)):e.viewport.xToWorld(r),s=e.logOptions.logY?e.viewport.yToScreen(Math.pow(10,e.confidenceIntervals.confidenceTop(i))):e.viewport.yToScreen(e.confidenceIntervals.confidenceTop(i));o===n?t.moveTo(r,s):t.lineTo(r,s)}for(let o=e.screenBounds.width-r;o>=n;o--){const n=e.screenBounds.x+o,r=e.logOptions.logX?Math.log10(e.viewport.xToWorld(n)):e.viewport.xToWorld(n),i=e.logOptions.logY?e.viewport.yToScreen(Math.pow(10,e.confidenceIntervals.confidenceBottom(r))):e.viewport.yToScreen(e.confidenceIntervals.confidenceBottom(r));t.lineTo(n,i)}t.closePath(),t.fill()}(t,{viewport:n.viewport,logOptions:n.logOptions,showAxes:n.showAxes,showAxesLabels:n.showAxesLabels,screenBounds:n.screenBounds,confidenceIntervals:r})}}function E(t,e){t.beginPath();const n=e.showAxes?e.showAxesLabels?h.h.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:h.h.AXES_LEFT_PX_MARGIN:0,r=e.showAxes?h.h.AXES_RIGHT_PX_MARGIN:0,o=e.confidenceType===h.h.CURVE_CONFIDENCE_INTERVAL_BOUNDS.TOP?e.confidenceIntervals.confidenceTop:e.confidenceIntervals.confidenceBottom;for(let i=n;i<=e.screenBounds.width-r;i++){const r=e.screenBounds.x+i,s=e.logOptions.logX?Math.log10(e.viewport.xToWorld(r)):e.viewport.xToWorld(r),a=e.logOptions.logY?e.viewport.yToScreen(Math.pow(10,o(s))):e.viewport.yToScreen(o(s));i===n?t.moveTo(r,a):t.lineTo(r,a)}t.stroke()}function I(t,e,n){var r;if((null===(r=e.showFitLine)||void 0===r||r)&&e.droplines&&n.showDroplines){t.save(),t.strokeStyle="blue",t.lineWidth=n.ratio,t.beginPath(),t.setLineDash([5,5]);for(let r=0;r<e.droplines.length;r++)"IC50"===e.droplines[r]&&A(t,{viewport:n.viewport,xValue:e.parameters[2],dataBounds:n.dataBounds,curveFunc:n.curveFunc,logOptions:n.logOptions});t.stroke(),t.restore()}}function A(t,e){e.logOptions.logX&&(e.xValue=Math.pow(10,e.xValue));const n=e.logOptions.logX?Math.log10(e.xValue):e.xValue,r=e.logOptions.logY?Math.pow(10,e.curveFunc(n)):e.curveFunc(n);t.moveTo(e.viewport.xToScreen(e.dataBounds.minX),e.viewport.yToScreen(r)),t.lineTo(e.viewport.xToScreen(e.xValue),e.viewport.yToScreen(r)),t.lineTo(e.viewport.xToScreen(e.xValue),e.viewport.yToScreen(e.dataBounds.minY))}function N(t,e,n){var r;if((null===(r=e.showFitLine)||void 0===r||r)&&n.statistics){const r=(0,l.VA)(e,n.fitFunc,n.logOptions);for(let o=0;o<n.statistics.length;o++){const i=n.statistics[o],a=s.nK.find((t=>t.name===i));if(a){const i=y.formatNumber(a.get(r));t.fillStyle=e.fitLineColor,t.textAlign="left",t.fillText(a.name+": "+i,n.dataBox.x+5,n.dataBox.y+20+20*o)}}}}function b(t,e,n){t.beginPath(),t.fillStyle="black";const r=t.measureText(e).width;t.fillText(e,n.dataBox.maxX-r,n.dataBox.y+h.h.LEGEND_TOP_PX_MARGIN+(n.columnIdx*h.h.LEGEND_RECORD_PX_HEIGHT+h.h.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend))}function L(t,e,n){t.beginPath(),t.strokeStyle=e.fitLineColor,t.lineWidth=2*n.ratio;const o=t.measureText(e.name).width;t.moveTo(n.dataBox.maxX-o-h.h.LEGEND_RECORD_LINE_PX_WIDTH-h.h.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN,n.dataBox.y+h.h.LEGEND_TOP_PX_MARGIN-h.h.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(n.showColumnLabel?h.h.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+h.h.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend),t.lineTo(n.dataBox.maxX-o-h.h.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN,n.dataBox.y+h.h.LEGEND_TOP_PX_MARGIN-h.h.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(n.showColumnLabel?h.h.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+h.h.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend);const i=e.markerType?e.markerType:r.MARKER_TYPE.CIRCLE;r.Paint.marker(t,i,n.dataBox.maxX-o-h.h.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN-h.h.LEGEND_RECORD_LINE_PX_WIDTH/2,n.dataBox.y+h.h.LEGEND_TOP_PX_MARGIN-h.h.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(n.showColumnLabel?h.h.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+h.h.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend,e.pointColor,h.h.POINT_PX_SIZE*n.ratio),t.fillStyle=e.fitLineColor,t.fillText(e.name,n.dataBox.maxX-o,n.dataBox.y+h.h.LEGEND_TOP_PX_MARGIN+(n.showColumnLabel?h.h.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+h.h.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend),t.stroke()}function S(t,e){var n;r.Paint.marker(t,r.MARKER_TYPE.OUTLIER,e.midX,e.midY,r.Color.red,(n=.8*Math.min(e.width,e.height),Math.min(Math.max(n,0),30)))}function O(t,e,n){if(e&&n)for(const r of t)!(r.name in n)&&r.name in e&&(n[r.name]=e[r.name])}function P(t){if(0===t.length)return{};let e,n,r,o=Number.MAX_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,a=Number.MIN_VALUE,l=!1,c=!1,u=!1;for(const f of t)null!==f.minX&&void 0!==f.minX&&(o=Math.min(o,f.minX)),null!==f.minY&&void 0!==f.minY&&(i=Math.min(i,f.minY)),null!==f.maxX&&void 0!==f.maxX&&(s=Math.max(s,f.maxX)),null!==f.maxY&&void 0!==f.maxY&&(a=Math.max(a,f.maxY)),null!==f.title&&void 0!==f.title&&(null!=r||(r=f.title)),null!==f.xAxisName&&void 0!==f.xAxisName&&(null!=e||(e=f.xAxisName)),null!==f.yAxisName&&void 0!==f.yAxisName&&(null!=n||(n=f.yAxisName)),null!==f.logX&&void 0!==f.logX&&f.logX&&(l=!0),null!==f.logY&&void 0!==f.logY&&f.logY&&(c=!0),null!==f.allowXZeroes&&void 0!==f.allowXZeroes&&f.allowXZeroes&&(u=!0);return{minX:o===Number.MAX_VALUE?void 0:o,minY:i===Number.MAX_VALUE?void 0:i,maxX:s===Number.MIN_VALUE?void 0:s,maxY:a===Number.MIN_VALUE?void 0:a,title:r,xAxisName:e,yAxisName:n,logX:l,logY:c,allowXZeroes:u}}function R(t){if(0===t.length)return null;const e={points:[],name:t[0].name,fitFunction:t[0].fitFunction,markerType:t[0].markerType,lineStyle:t[0].lineStyle,pointColor:t[0].pointColor,fitLineColor:t[0].fitLineColor,confidenceIntervalColor:t[0].confidenceIntervalColor,outlierColor:t[0].outlierColor,connectDots:t[0].connectDots,showFitLine:t[0].showFitLine,showPoints:t[0].showPoints,showCurveConfidenceInterval:t[0].showCurveConfidenceInterval,errorModel:t[0].errorModel,clickToToggle:t[0].clickToToggle,labels:t[0].labels,droplines:t[0].droplines,columnName:t[0].columnName};for(const n of t)e.points=[...e.points,...n.points];return e}function M(t){var e,n,o,i,a;let u=t.cell.value;u.includes("|")&&(u=u.replaceAll("|",""));const f=(null===(n=null===(e=t.cell)||void 0===e?void 0:e.column)||void 0===n?void 0:n.type)===r.TYPE.STRING?t.cell.column.getTag(h.h.TAG_FIT_CHART_FORMAT)===h.h.TAG_FIT_CHART_FORMAT_3DX?(0,c.K)(u):null!==(o=JSON.parse(null!=u?u:"{}"))&&void 0!==o?o:{}:(0,l.Kh)(),d=t.cell.column?F(t.cell.column):{},m=t.cell.column?X(t.cell.dataFrame):{};null!==(i=f.series)&&void 0!==i||(f.series=[]),null!==(a=f.chartOptions)&&void 0!==a||(f.chartOptions=d.chartOptions),O(s.xs,d.chartOptions,f.chartOptions),O(s.xs,m.chartOptions,f.chartOptions);for(const t of f.series)O(s.IL,f.seriesOptions,t),O(s.IL,d.seriesOptions,t),O(s.IL,m.seriesOptions,t);return f}function X(t){var e,n,r;return JSON.parse(null!==(e=(n=t.tags)[r=h.h.TAG_FIT])&&void 0!==e?e:n[r]=JSON.stringify((0,l.Kh)()))}function F(t){var e,n,r;return JSON.parse(null!==(e=(n=t.tags)[r=h.h.TAG_FIT])&&void 0!==e?e:n[r]=JSON.stringify((0,l.Kh)()))}function D(t,e,n){if(t.width<h.h.MIN_AXES_CELL_PX_WIDTH||t.height<h.h.MIN_AXES_CELL_PX_HEIGHT)return[t,void 0,void 0];const r=e?h.h.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:h.h.AXES_LEFT_PX_MARGIN,o=e?h.h.AXES_BOTTOM_PX_MARGIN_WITH_AXES_LABELS:h.h.AXES_BOTTOM_PX_MARGIN,i=n?h.h.AXES_TOP_PX_MARGIN_WITH_TITLE:h.h.AXES_TOP_PX_MARGIN;return[t.cutLeft(r).cutBottom(o).cutTop(i).cutRight(h.h.AXES_RIGHT_PX_MARGIN),t.getBottom(o).getTop(i).cutLeft(r).cutRight(h.h.AXES_RIGHT_PX_MARGIN),t.getLeft(r).getRight(h.h.AXES_RIGHT_PX_MARGIN).cutBottom(o).cutTop(i)]}function G(t){return null!=t&&""!==t&&void 0!==r.Color.fromHtml(t)}function B(t){var e;for(let n=0;n<(null===(e=t.series)||void 0===e?void 0:e.length);n++){const e=t.series[n];if(e.points.every((t=>0!==t.x)))continue;let r=Number.MAX_VALUE,o=0,i=0;const s=[];for(let t=0;t<e.points.length;t++)e.points[t].x<r&&0!==e.points[t].x&&(r=e.points[t].x),e.points[t].x>o&&0!==e.points[t].x&&(o=e.points[t].x),s.includes(e.points[t].x)||(s[s.length]=e.points[t].x,i++);const a=Math.pow(10,Math.log10(r)-(Math.log10(o)-Math.log10(r)/(i-1)));for(let t=0;t<e.points.length;t++)0===e.points[t].x&&(e.points[t].x=a)}}let k=class extends r.GridCellRenderer{get name(){return h.h.FIT_CELL_TYPE}get cellType(){return h.h.FIT_CELL_TYPE}getDefaultSize(t){return{width:h.h.CELL_DEFAULT_WIDTH,height:h.h.CELL_DEFAULT_HEIGHT}}onClick(t,e){var n,r,s,u,d,m,p;if(!t.cell.value)return;const y=t.cell.column.getTag(h.h.TAG_FIT_CHART_FORMAT)===h.h.TAG_FIT_CHART_FORMAT_3DX?(0,c.K)(t.cell.value):M(t);for(const[t,e]of Object.entries(h.h.CONDITION_MAP))if(e(y.series))return void(o.shell.o=i.divText(t,{style:{color:"red"}}));o.shell.o=t;const g=t.bounds.inflate(h.h.INFLATE_SIZE,h.h.INFLATE_SIZE),x=D(g,this.areAxesLabelsShown(g,y),this.isTitleShown(g,y))[0],v=(0,l.s$)(y),w=new a.L(v,x,null!==(r=null===(n=y.chartOptions)||void 0===n?void 0:n.logX)&&void 0!==r&&r,null!==(u=null===(s=y.chartOptions)||void 0===s?void 0:s.logY)&&void 0!==u&&u);for(let n=0;n<(null===(d=y.series)||void 0===d?void 0:d.length);n++)if(!(y.series[n].connectDots||!y.series[n].clickToToggle||"points"!==y.series[n].showPoints||g.width<h.h.MIN_AXES_CELL_PX_WIDTH||g.height<h.h.MIN_AXES_CELL_PX_HEIGHT))for(let r=0;r<y.series[n].points.length;r++){const o=y.series[n].points[r];if(this.hitTest(e,o,w)){o.outlier=!o.outlier;const e=t.grid.dataFrame.columns.byTags({".sourceColumn":t.cell.column.name});if(e)for(const r of e){const e={logX:null===(m=y.chartOptions)||void 0===m?void 0:m.logX,logY:null===(p=y.chartOptions)||void 0===p?void 0:p.logY},o=null!==r.tags[".seriesAggregation"]?(0,f.JR)(y,r.tags[".seriesAggregation"]):r.tags[".seriesNumber"]===n?(0,f.VK)(y.series[n],e):null;null!==o&&r.set(t.cell.rowIndex,o[r.tags[".statistics"]])}if(t.cell.column.getTag(h.h.TAG_FIT_CHART_FORMAT)!==h.h.TAG_FIT_CHART_FORMAT_3DX){const e=JSON.parse(t.cell.value);e.series[n].points[r].outlier=o.outlier,t.cell.value=JSON.stringify(e)}return}}}onDoubleClick(t,e){if(!t.cell.value)return;const n=u.D.fromGridCell(t),r=i.dialog({title:"Edit chart"}).add(n.root).show({resizable:!0}).root.getElementsByClassName("d4-dialog-contents dlg-edit-chart")[0].firstChild;n.canvas.width=r.clientWidth,n.canvas.height=r.clientHeight,n.render(),r.style.width="100%",r.style.height="100%",i.tools.handleResize(r,((t,e)=>{n.canvas.width=t,n.canvas.height=e,n.render()}))}areAxesShown(t){return t.width>=h.h.MIN_AXES_CELL_PX_WIDTH&&t.height>=h.h.MIN_AXES_CELL_PX_HEIGHT}areAxesLabelsShown(t,e){var n;return t.width>=h.h.MIN_X_AXIS_NAME_VISIBILITY_PX_WIDTH&&t.height>=h.h.MIN_Y_AXIS_NAME_VISIBILITY_PX_HEIGHT&&!!(null===(n=e.chartOptions)||void 0===n?void 0:n.xAxisName)&&!!e.chartOptions.yAxisName}isTitleShown(t,e){var n;return t.width>=h.h.MIN_TITLE_PX_WIDTH&&t.height>=h.h.MIN_TITLE_PX_HEIGHT&&!!(null===(n=e.chartOptions)||void 0===n?void 0:n.title)}isLegendShown(t){return t.width>=h.h.MIN_LEGEND_PX_WIDTH&&t.height>=h.h.MIN_LEGEND_PX_HEIGHT}areDroplinesShown(t){return t.width>=h.h.MIN_DROPLINES_VISIBILITY_PX_WIDTH&&t.height>=h.h.MIN_DROPLINES_VISIBILITY_PX_HEIGHT}renderCurves(t,e,n){var r,o,i,s,c,u,f,d,m,p,y,w,T,E,A;t.save(),t.beginPath(),t.rect(e.x,e.y,e.width,e.height),t.clip(),(null===(r=n.chartOptions)||void 0===r?void 0:r.allowXZeroes)&&(null===(o=n.chartOptions)||void 0===o?void 0:o.logX)&&(null===(i=n.series)||void 0===i?void 0:i.some((t=>t.points.some((t=>0===t.x)))))&&B(n);const[S,O,P]=D(e,this.areAxesLabelsShown(e,n),this.isTitleShown(e,n)),R=(0,l.s$)(n);(R.x<0&&n.chartOptions||0===R.x&&n.chartOptions&&!n.chartOptions.allowXZeroes)&&(n.chartOptions.logX=!1),R.y<=0&&n.chartOptions&&(n.chartOptions.logY=!1);const M=new a.L(R,S,null!==(c=null===(s=n.chartOptions)||void 0===s?void 0:s.logX)&&void 0!==c&&c,null!==(f=null===(u=n.chartOptions)||void 0===u?void 0:u.logY)&&void 0!==f&&f),X=Math.min(S.width,S.height),F=X>100?1:.2+X/100*.8,G={logX:null===(d=n.chartOptions)||void 0===d?void 0:d.logX,logY:null===(m=n.chartOptions)||void 0===m?void 0:m.logY};t.save(),t.font='11px Roboto, "Roboto Local"',M.drawCoordinateGrid(t,O,P),t.restore();for(let r=0;r<(null===(p=n.series)||void 0===p?void 0:p.length);r++){const o=n.series[r];if(o.points.some((t=>void 0===t.x||void 0===t.y)))continue;(e.width<h.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH||e.height<h.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT)&&(o.showPoints="",n.chartOptions&&(n.chartOptions.showStatistics=[])),o.points.sort(((t,e)=>t.x-e.x));let i=!0;const s=(0,l.zB)(o);let a=null;if(!o.connectDots||o.showFitLine)if(o.parameters)(null===(y=n.chartOptions)||void 0===y?void 0:y.logX)&&o.parameters[2]>0&&(o.parameters[2]=Math.log10(o.parameters[2])),a=(0,l._T)(o,s);else{const t=(0,l.nT)(o,s,G);a=t.fittedCurve;const e=[...t.parameters];o.parameters=e,i=!1}g(o,r),x(t,o,{viewport:M,ratio:F}),v(t,o,{viewport:M,ratio:F}),_(t,o,{viewport:M,ratio:F,logOptions:G,showAxes:this.areAxesShown(e),showAxesLabels:this.areAxesLabelsShown(e,n),screenBounds:e,curveFunc:a}),C(t,o,{viewport:M,logOptions:G,showAxes:this.areAxesShown(e),showAxesLabels:this.areAxesLabelsShown(e,n),screenBounds:e,fitFunc:s,userParamsFlag:i}),o.parameters&&I(t,o,{viewport:M,ratio:F,showDroplines:this.areDroplinesShown(e),xValue:o.parameters[2],dataBounds:R,curveFunc:a,logOptions:G}),N(t,o,{statistics:null===(w=n.chartOptions)||void 0===w?void 0:w.showStatistics,fitFunc:s,logOptions:G,dataBox:S})}!function(t,e){e.showTitle&&(t.font='12px Roboto, "Roboto Local"',t.textAlign="center",t.fillStyle="black",t.fillText(e.title,e.dataBox.midX-5,e.screenBounds.y+15))}(t,{showTitle:this.isTitleShown(e,n),title:null===(T=n.chartOptions)||void 0===T?void 0:T.title,dataBox:S,screenBounds:e}),function(t,e){if(e.showAxesLabels){t.font='11px Roboto, "Roboto Local"',t.textAlign="center",t.fillStyle="black",t.fillText(e.xAxisName,e.dataBox.midX-5,e.screenBounds.maxY-h.h.X_AXIS_LABEL_BOTTOM_PX_MARGIN),t.translate(e.screenBounds.x,e.screenBounds.y),t.rotate(-Math.PI/2);const n=e.showTitle?h.h.AXES_TOP_PX_MARGIN_WITH_TITLE:h.h.AXES_TOP_PX_MARGIN;t.fillText(e.yAxisName,-(e.dataBox.height/2+n+15),15),t.restore()}}(t,{showTitle:this.isTitleShown(e,n),dataBox:S,screenBounds:e,showAxesLabels:this.areAxesLabelsShown(e,n),xAxisName:null===(E=n.chartOptions)||void 0===E?void 0:E.xAxisName,yAxisName:null===(A=n.chartOptions)||void 0===A?void 0:A.yAxisName}),function(t,e,n){var r,o,i,s;if(n.showLegend){t.font='11px Roboto, "Roboto Local"';const a=[...new Set(null===(r=e.series)||void 0===r?void 0:r.map((t=>t.columnName)))].filter((t=>null!=t));let l=0;for(let r=0;r<a.length;r++){const c=a[r];(null===(o=e.chartOptions)||void 0===o?void 0:o.showColumnLabel)&&b(t,c,{dataBox:n.dataBox,columnIdx:r,drawnCurvesInLegend:l});const u=null===(i=e.series)||void 0===i?void 0:i.filter((t=>t.columnName===c));for(let o=0;o<(null==u?void 0:u.length);o++){const i=u[o];""!==i.name&&null!==i.name&&void 0!==i.name&&(L(t,i,{dataBox:n.dataBox,ratio:n.ratio,columnIdx:r,drawnCurvesInLegend:l,showColumnLabel:null===(s=e.chartOptions)||void 0===s?void 0:s.showColumnLabel}),l++)}}t.restore()}}(t,n,{showLegend:this.isLegendShown(e),dataBox:S,ratio:F}),t.restore()}render(t,e,n,o,i,s,a){var l,u,f;if(!s.cell.value)return;if(o<h.h.MIN_CELL_RENDERER_PX_WIDTH||i<h.h.MIN_CELL_RENDERER_PX_HEIGHT)return;const d=(null===(l=s.cell.column)||void 0===l?void 0:l.getTag(h.h.TAG_FIT_CHART_FORMAT))===h.h.TAG_FIT_CHART_FORMAT_3DX?(0,c.K)(s.cell.value):M(s),m=new r.Rect(e,n,o,i).inflate(h.h.INFLATE_SIZE,h.h.INFLATE_SIZE);for(const[e,n]of Object.entries(h.h.CONDITION_MAP))if(n(d.series))return void S(t,m);null===(u=d.series)||void 0===u||u.forEach((t=>t.columnName=s.cell.column.name)),(null===(f=d.chartOptions)||void 0===f?void 0:f.mergeSeries)&&(d.series=[R(d.series)]),this.renderCurves(t,m,d)}hitTest(t,e,n){const o=n.xToScreen(e.x),i=n.yToScreen(e.y),s=(e.outlier?h.h.OUTLIER_PX_SIZE:h.h.POINT_PX_SIZE)/2+h.h.OUTLIER_HITBOX_RADIUS;return new r.Rect(o-s,i-s,2*s,2*s).containsPoint(new r.Point(t.offsetX,t.offsetY))}onMouseMove(t,e){var n,o,s,u,f;if(!t.cell.value)return;const d=t.bounds.inflate(h.h.INFLATE_SIZE,h.h.INFLATE_SIZE);if(d.width<h.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH||d.height<h.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT){const n=i.canvas(300,200);this.render(n.getContext("2d"),0,0,300,200,t,null);const r=i.divV([n]);i.tooltip.show(r,e.x,e.y)}const m=t.cell.column.getTag(h.h.TAG_FIT_CHART_FORMAT)===h.h.TAG_FIT_CHART_FORMAT_3DX?(0,c.K)(t.cell.value):M(t);if(d.width>=h.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH&&d.height>=h.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT){const t=D(d,this.areAxesLabelsShown(d,m),this.isTitleShown(d,m))[0],c=(0,l.s$)(m),p=new a.L(c,t,null!==(o=null===(n=m.chartOptions)||void 0===n?void 0:n.logX)&&void 0!==o&&o,null!==(u=null===(s=m.chartOptions)||void 0===s?void 0:s.logY)&&void 0!==u&&u);for(let t=0;t<(null===(f=m.series)||void 0===f?void 0:f.length);t++)if("points"===m.series[t].showPoints)for(let n=0;n<m.series[t].points.length;n++){const o=m.series[t].points[n];if(this.hitTest(e,o,p))return i.tooltip.show(i.divV([i.divText(`x: ${r.format(o.x,"#0.000")}`),i.divText(`y: ${r.format(o.y,"#0.000")}`)]),e.x+16,e.y+16),void(!m.series[t].connectDots&&m.series[t].clickToToggle&&d.width>=h.h.MIN_AXES_CELL_PX_WIDTH&&d.height>=h.h.MIN_AXES_CELL_PX_HEIGHT&&(document.body.style.cursor="pointer"))}i.tooltip.hide()}document.body.style.cursor="default"}};k=function(t,e,n,r){var o,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}([o.decorators.cellRenderer({name:"Fit",cellType:"fit",virtual:!0})],k)},860:(t,e,n)=>{"use strict";var r=n(755),o=n(82),i=n(389),s=n(328),a=n(326),l=n(71);const c=rxjs.operators,u=rxjs;var f,h=n(95);let d=f=class extends a.D{constructor(){super(new r.lR),this.curvesColumnNames=[],this.showSelectedRowsCurves=!1,this.showCurrentRowCurve=!0,this.showMouseOverRowCurve=!0,this.mergeColumnSeries=!1,this.rows=[],this.data=new l.oH,this.curvesColumnNames=this.addProperty("curvesColumnNames",o.TYPE.COLUMN_LIST,[],{semType:h.h.FIT_SEM_TYPE}),this.showSelectedRowsCurves=this.bool("showSelectedRowsCurves",!1,{description:"Adds curves from the selected rows"}),this.showCurrentRowCurve=this.bool("showCurrentRowCurve",!0),this.showMouseOverRowCurve=this.bool("showMouseOverRowCurve",!0),this.mergeColumnSeries=this.bool("mergeColumnSeries",!1);for(const t of l.xs)this.addProperty("mergeSeries"===t.name?"mergeCellSeries":t.name,t.propertyType,t.defaultValue,t.options)}static fromChartData(t){let e=new f;return e.data=t,e.render(),e}applyViewerProperties(){(0,r.g2)(l.xs,this,this.data.chartOptions)}mergeViewerChartOptions(){for(const t of l.xs)if(["logX","logY","allowXZeroes","mergeCellSeries","showColumnLabel"].includes("mergeSeries"===t.name?"mergeCellSeries":t.name)?void 0!==this["mergeSeries"===t.name?"mergeCellSeries":t.name]:void 0!==this.props.get(t.name)&&this.props.get(t.name)!==t.defaultValue){if(["title","xAxisName","yAxisName"].includes(t.name)&&""===this.props.get(t.name))continue;["logX","logY","allowXZeroes","mergeCellSeries","showColumnLabel"].includes("mergeSeries"===t.name?"mergeCellSeries":t.name)?this.data.chartOptions[t.name]=this[t.name]:this.data.chartOptions[t.name]=this.props.get(t.name)}}createChartData(){var t,e,n,i,s,a;if(0===(null===(t=this.curvesColumnNames)||void 0===t?void 0:t.length))return;this.rows.length=0;let c=-1;this.showCurrentRowCurve&&-1!==this.dataFrame.currentRowIdx&&this.rows.push(this.dataFrame.currentRowIdx),this.showMouseOverRowCurve&&-1!==this.dataFrame.mouseOverRowIdx&&this.rows.push(this.dataFrame.mouseOverRowIdx),this.showSelectedRowsCurves&&-1!==this.dataFrame.mouseOverRowIdx&&(c=this.rows.length,this.rows.push(...this.dataFrame.selection.getSelectedIndexes())),this.data=new l.oH;const u=null===(e=this.tableView)||void 0===e?void 0:e.grid,f=this.props.get("mergeCellSeries"),h=[];for(const t of this.curvesColumnNames){const e=[];for(const o of new Set(this.rows)){const i=u.cell(t,u.tableRowToGrid(o));if(""===i.cell.value)continue;const s=(0,r.j$)(i);null===(n=s.series)||void 0===n||n.forEach((t=>t.columnName=i.cell.column.name));const a=s.chartOptions;if(null!=a&&(h[h.length]=a),f){const t=(0,r.wU)(s.series);void 0!==(null==a?void 0:a.title)&&""!==(null==a?void 0:a.title)&&(t.name=null==a?void 0:a.title),s.series=[t]}e.push(...s.series)}this.mergeColumnSeries?null===(i=this.data.series)||void 0===i||i.push((0,r.wU)(e)):null===(s=this.data.series)||void 0===s||s.push(...e)}this.data.chartOptions=(0,r.LX)(h),this.mergeViewerChartOptions(),null===(a=this.data.series)||void 0===a||a.forEach(((t,e)=>{var n,r,i,s,a;if(t.pointColor=o.Color.toHtml(o.Color.getCategoricalColor((null===(n=this.data.series)||void 0===n?void 0:n.length)>20?0:e)),t.fitLineColor=o.Color.toHtml(o.Color.getCategoricalColor((null===(r=this.data.series)||void 0===r?void 0:r.length)>20?0:e)),t.showCurveConfidenceInterval=!1,t.droplines=[],(null===(i=this.data.series)||void 0===i?void 0:i.length)>20&&(t.showPoints="",t.lineStyle="solid"),(null===(s=this.data.series)||void 0===s?void 0:s.length)>10&&(null===(a=this.data.series)||void 0===a?void 0:a.length)<100&&e>=c){const e=o.Color.fromHtml(t.fitLineColor);t.fitLineColor=`rgba(${o.Color.r(e)}, ${o.Color.g(e)}, ${o.Color.b(e)}, 0.2)`}}))}onPropertyChanged(t){var e,n,r,o,i;"curvesColumnNames"===(null==t?void 0:t.name)&&(this.props.set("showColumnLabel",(null===(e=this.curvesColumnNames)||void 0===e?void 0:e.length)>1),this.showColumnLabel=(null===(n=this.curvesColumnNames)||void 0===n?void 0:n.length)>1),["logX","logY","allowXZeroes","mergeCellSeries","showColumnLabel"].includes("mergeSeries"===(null==t?void 0:t.name)?"mergeCellSeries":null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"")&&(this["mergeSeries"===(null==t?void 0:t.name)?"mergeCellSeries":null!==(o=null==t?void 0:t.name)&&void 0!==o?o:""]=this[null!==(i=null==t?void 0:t.name)&&void 0!==i?i:""]),this.applyViewerProperties(),this.createChartData(),this.render()}onTableAttached(){var t;const e=null===(t=this.tableView)||void 0===t?void 0:t.grid,n=this.dataFrame.columns.bySemType(h.h.FIT_SEM_TYPE);null!==n&&(this.curvesColumnNames=[n.name]),(0,u.merge)(this.dataFrame.onCurrentCellChanged,e.onCellMouseEnter,this.dataFrame.onSelectionChanged).pipe((0,c.debounce)((t=>(0,u.interval)(50)))).subscribe((t=>{this.createChartData(),this.render()}))}_showErrorMessage(t){this.root.appendChild(i.divText(t,"d4-viewer-error"))}_removeErrorMessage(){const t=this.root.getElementsByClassName("d4-viewer-error")[0];t&&this.root.removeChild(t)}render(){var t;const e=this.canvas.getContext("2d");e.clearRect(0,0,this.canvas.width,this.canvas.height),0!==(null===(t=this.curvesColumnNames)||void 0===t?void 0:t.length)?(this._removeErrorMessage(),this.renderer.renderCurves(e,new o.Rect(0,0,this.canvas.width,this.canvas.height).inflate(h.h.INFLATE_SIZE,h.h.INFLATE_SIZE),this.data)):this._showErrorMessage("The MultiCurveViewer viewer requires a minimum of 1 curves column.")}};d=f=function(t,e,n,r){var o,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}([s.decorators.viewer({name:"MultiCurveViewer",description:"A viewer that superimposes multiple in-cell curves on one chart",icon:"icons/multi-curve-viewer.png"}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],d),n(48),n(471),n(283),new o.Package},82:t=>{"use strict";t.exports=DG},328:t=>{"use strict";t.exports=grok},389:t=>{"use strict";t.exports=ui},991:t=>{"use strict";t.exports=wu}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{_package:()=>nt,test:()=>rt,tests:()=>h});var t=n(82),e=n(328);n(982);const o=t.DataFrame.fromCsv('countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,Questions,empty_number,empty_string\nBelgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,1,1,1QBS,1,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.497360340644872, 1.7058694986686864, 5.278052678195135, 0.16000320889028383],""points"":[{""x"":0.10000000149011612,""y"":2.374499797821045},{""x"":0.6000000238418579,""y"":2.6242473125457764},{""x"":1.100000023841858,""y"":2.367267608642578},{""x"":1.600000023841858,""y"":2.6723148822784424},{""x"":2.0999999046325684,""y"":2.6537344455718994},{""x"":2.5999999046325684,""y"":2.3651671409606934},{""x"":3.0999999046325684,""y"":2.5654284954071045},{""x"":3.5999999046325684,""y"":2.4160959720611572},{""x"":4.099999904632568,""y"":2.286726713180542},{""x"":4.599999904632568,""y"":2.5100042819976807},{""x"":5.099999904632568,""y"":1.6676985025405884},{""x"":5.599999904632568,""y"":0.680136501789093},{""x"":6.099999904632568,""y"":0.3391543924808502},{""x"":6.599999904632568,""y"":0.09038983285427094},{""x"":7.099999904632568,""y"":0.19802775979042053}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[7.525235855508179, 1.3186911876809984, 5.335672608564294, 0.7860743343958098],""points"":[{""x"":0.10000000149011612,""y"":7.988070487976074},{""x"":0.6000000238418579,""y"":7.018453121185303},{""x"":1.100000023841858,""y"":8.115279197692871},{""x"":1.600000023841858,""y"":7.486658096313477},{""x"":2.0999999046325684,""y"":7.396438121795654},{""x"":2.5999999046325684,""y"":7.477052211761475},{""x"":3.0999999046325684,""y"":6.913095474243164},{""x"":3.5999999046325684,""y"":8.01385498046875},{""x"":4.099999904632568,""y"":6.985900402069092},{""x"":4.599999904632568,""y"":6.970335960388184},{""x"":5.099999904632568,""y"":5.448817253112793},{""x"":5.599999904632568,""y"":2.5534818172454834},{""x"":6.099999904632568,""y"":1.893947958946228},{""x"":6.599999904632568,""y"":0.6340042352676392},{""x"":7.099999904632568,""y"":0.8403874039649963}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,100,abc\nBurundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,2,2,1ZP8,2,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.431460753103398, 2.1691498799246745, 5.266445597102774, 0.7825762827017926],""points"":[{""x"":0.10000000149011612,""y"":4.751083850860596},{""x"":0.6000000238418579,""y"":4.203000068664551},{""x"":1.100000023841858,""y"":4.415858745574951},{""x"":1.600000023841858,""y"":4.68414306640625},{""x"":2.0999999046325684,""y"":4.198400974273682},{""x"":2.5999999046325684,""y"":4.179222106933594},{""x"":3.0999999046325684,""y"":4.638473987579346},{""x"":3.5999999046325684,""y"":4.708553314208984},{""x"":4.099999904632568,""y"":4.291589260101318},{""x"":4.599999904632568,""y"":4.038082599639893},{""x"":5.099999904632568,""y"":3.4349939823150635},{""x"":5.599999904632568,""y"":1.2194708585739136},{""x"":6.099999904632568,""y"":1.1920831203460693},{""x"":6.599999904632568,""y"":0.5352635979652405},{""x"":7.099999904632568,""y"":0.3346920311450958}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.339458017970126, -1.0734184310171178, 4.746332950550934, 0.2482416857595658],""points"":[{""x"":0.10000000149011612,""y"":0.2139337658882141},{""x"":0.6000000238418579,""y"":0.4269562065601349},{""x"":1.100000023841858,""y"":0.2441573292016983},{""x"":1.600000023841858,""y"":0.146635964512825},{""x"":2.0999999046325684,""y"":0.08818462491035461},{""x"":2.5999999046325684,""y"":0.2560656666755676},{""x"":3.0999999046325684,""y"":0.42434045672416687},{""x"":3.5999999046325684,""y"":0.37111231684684753},{""x"":4.099999904632568,""y"":0.5581737160682678},{""x"":4.599999904632568,""y"":1.183590054512024},{""x"":5.099999904632568,""y"":1.5629843473434448},{""x"":5.599999904632568,""y"":2.3211288452148438},{""x"":6.099999904632568,""y"":2.229961633682251},{""x"":6.599999904632568,""y"":2.2560226917266846},{""x"":7.099999904632568,""y"":2.2142398357391357}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,3,3,2BDJ,3,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.6760652578642325, 0.9046956320756703, 5.651408971856738, 0.07738846012184185],""points"":[{""x"":0.10000000149011612,""y"":4.32425594329834},{""x"":0.6000000238418579,""y"":4.668442249298096},{""x"":1.100000023841858,""y"":4.379785060882568},{""x"":1.600000023841858,""y"":5.0345139503479},{""x"":2.0999999046325684,""y"":4.878653526306152},{""x"":2.5999999046325684,""y"":4.3451313972473145},{""x"":3.0999999046325684,""y"":4.336992263793945},{""x"":3.5999999046325684,""y"":5.037430286407471},{""x"":4.099999904632568,""y"":5.0092692375183105},{""x"":4.599999904632568,""y"":4.151902675628662},{""x"":5.099999904632568,""y"":3.4066951274871826},{""x"":5.599999904632568,""y"":2.3732759952545166},{""x"":6.099999904632568,""y"":1.673728108406067},{""x"":6.599999904632568,""y"":0.48574790358543396},{""x"":7.099999904632568,""y"":0.2783052325248718}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.938395863010111, -1.4658480661392117, 5.462702751996584, 0.3473139023615039],""points"":[{""x"":0.10000000149011612,""y"":0.4941710829734802},{""x"":0.6000000238418579,""y"":0.15323974192142487},{""x"":1.100000023841858,""y"":0.46373432874679565},{""x"":1.600000023841858,""y"":0.3370431363582611},{""x"":2.0999999046325684,""y"":0.5179030299186707},{""x"":2.5999999046325684,""y"":0.27899765968322754},{""x"":3.0999999046325684,""y"":0.22075064480304718},{""x"":3.5999999046325684,""y"":0.5789918899536133},{""x"":4.099999904632568,""y"":0.21169911324977875},{""x"":4.599999904632568,""y"":0.27857646346092224},{""x"":5.099999904632568,""y"":1.0906332731246948},{""x"":5.599999904632568,""y"":1.8520300388336182},{""x"":6.099999904632568,""y"":2.7177059650421143},{""x"":6.599999904632568,""y"":2.8680918216705322},{""x"":7.099999904632568,""y"":3.2413077354431152}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCanada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,4,4,1IAN,4,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[0.8597390975430008, 1.0957625732481946, 5.260537067987958, 0.07974187998177736],""points"":[{""x"":0.10000000149011612,""y"":0.8190152645111084},{""x"":0.6000000238418579,""y"":0.8421689867973328},{""x"":1.100000023841858,""y"":0.8740922212600708},{""x"":1.600000023841858,""y"":0.8924275040626526},{""x"":2.0999999046325684,""y"":0.8249067664146423},{""x"":2.5999999046325684,""y"":0.9327669143676758},{""x"":3.0999999046325684,""y"":0.8522974252700806},{""x"":3.5999999046325684,""y"":0.8174492716789246},{""x"":4.099999904632568,""y"":0.8394647240638733},{""x"":4.599999904632568,""y"":0.7139387726783752},{""x"":5.099999904632568,""y"":0.5561167597770691},{""x"":5.599999904632568,""y"":0.3276226818561554},{""x"":6.099999904632568,""y"":0.12479474395513535},{""x"":6.599999904632568,""y"":0.13006797432899475},{""x"":7.099999904632568,""y"":0.059702079743146896}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.760930219582546, 1.6591793293833013, 4.667155929720851, 0.7858109544121652],""points"":[{""x"":0.10000000149011612,""y"":6.156993389129639},{""x"":0.6000000238418579,""y"":5.236701965332031},{""x"":1.100000023841858,""y"":6.010560512542725},{""x"":1.600000023841858,""y"":5.495512962341309},{""x"":2.0999999046325684,""y"":6.087770462036133},{""x"":2.5999999046325684,""y"":5.79986572265625},{""x"":3.0999999046325684,""y"":5.597546577453613},{""x"":3.5999999046325684,""y"":5.520902156829834},{""x"":4.099999904632568,""y"":5.360654354095459},{""x"":4.599999904632568,""y"":3.5539746284484863},{""x"":5.099999904632568,""y"":1.577236294746399},{""x"":5.599999904632568,""y"":1.0001264810562134},{""x"":6.099999904632568,""y"":0.9305797815322876},{""x"":6.599999904632568,""y"":0.6033638715744019},{""x"":7.099999904632568,""y"":0.4203685522079468}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nColombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,5,5,4UJ1,5,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[6.4995088314153655, 2.4270351004539914, 5.178659535348579, 0.625653346241577],""points"":[{""x"":0.10000000149011612,""y"":6.496231555938721},{""x"":0.6000000238418579,""y"":6.42543363571167},{""x"":1.100000023841858,""y"":7.040063858032227},{""x"":1.600000023841858,""y"":6.1115403175354},{""x"":2.0999999046325684,""y"":6.680728435516357},{""x"":2.5999999046325684,""y"":6.406774520874023},{""x"":3.0999999046325684,""y"":6.611269474029541},{""x"":3.5999999046325684,""y"":5.889094352722168},{""x"":4.099999904632568,""y"":6.75344705581665},{""x"":4.599999904632568,""y"":6.361435890197754},{""x"":5.099999904632568,""y"":4.1666975021362305},{""x"":5.599999904632568,""y"":1.172118902206421},{""x"":6.099999904632568,""y"":0.801048994064331},{""x"":6.599999904632568,""y"":0.4640021026134491},{""x"":7.099999904632568,""y"":0.0010357667924836278}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[1.4734381347446401, 1.1649805188074196, 4.82958608866421, 0.09500545496710007],""points"":[{""x"":0.10000000149011612,""y"":1.5279096364974976},{""x"":0.6000000238418579,""y"":1.3559974431991577},{""x"":1.100000023841858,""y"":1.5246378183364868},{""x"":1.600000023841858,""y"":1.5567657947540283},{""x"":2.0999999046325684,""y"":1.4114240407943726},{""x"":2.5999999046325684,""y"":1.4045010805130005},{""x"":3.0999999046325684,""y"":1.4769829511642456},{""x"":3.5999999046325684,""y"":1.4875500202178955},{""x"":4.099999904632568,""y"":1.2991987466812134},{""x"":4.599999904632568,""y"":0.922961413860321},{""x"":5.099999904632568,""y"":0.6520044803619385},{""x"":5.599999904632568,""y"":0.15350978076457977},{""x"":6.099999904632568,""y"":0.1078903079032898},{""x"":6.599999904632568,""y"":0.17276449501514435},{""x"":7.099999904632568,""y"":0.14066608250141144}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCosta Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,6,6,2BPW,6,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.4833641843311227, -1.8945978742090062, 4.671127708092568, 0.24159861311815153],""points"":[{""x"":0.10000000149011612,""y"":0.0969524160027504},{""x"":0.6000000238418579,""y"":0.028483040630817413},{""x"":1.100000023841858,""y"":0.22087176144123077},{""x"":1.600000023841858,""y"":0.0068915546871721745},{""x"":2.0999999046325684,""y"":0.4305879771709442},{""x"":2.5999999046325684,""y"":0.44774115085601807},{""x"":3.0999999046325684,""y"":0.45346319675445557},{""x"":3.5999999046325684,""y"":0.2370593100786209},{""x"":4.099999904632568,""y"":0.4657953977584839},{""x"":4.599999904632568,""y"":1.155200719833374},{""x"":5.099999904632568,""y"":2.2294070720672607},{""x"":5.599999904632568,""y"":2.4311530590057373},{""x"":6.099999904632568,""y"":2.33846116065979},{""x"":6.599999904632568,""y"":2.608201026916504},{""x"":7.099999904632568,""y"":2.8136143684387207}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.224573521642033, 1.4454033924198528, 5.6014197746076535, 0.2823216054197577],""points"":[{""x"":0.10000000149011612,""y"":4.95027494430542},{""x"":0.6000000238418579,""y"":5.1754679679870605},{""x"":1.100000023841858,""y"":5.276752948760986},{""x"":1.600000023841858,""y"":5.589294910430908},{""x"":2.0999999046325684,""y"":5.616994857788086},{""x"":2.5999999046325684,""y"":5.120813846588135},{""x"":3.0999999046325684,""y"":5.340766906738281},{""x"":3.5999999046325684,""y"":4.876471042633057},{""x"":4.099999904632568,""y"":4.94999361038208},{""x"":4.599999904632568,""y"":5.162564754486084},{""x"":5.099999904632568,""y"":4.399557590484619},{""x"":5.599999904632568,""y"":2.7977969646453857},{""x"":6.099999904632568,""y"":1.0229872465133667},{""x"":6.599999904632568,""y"":0.48275601863861084},{""x"":7.099999904632568,""y"":0.10408931970596313}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,7,7,1QBS,7,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.320838679713925, -1.2421619987316728, 4.831325425225256, 0.3236011098403072],""points"":[{""x"":0.10000000149011612,""y"":0.3727470338344574},{""x"":0.6000000238418579,""y"":0.12365014106035233},{""x"":1.100000023841858,""y"":0.48422467708587646},{""x"":1.600000023841858,""y"":0.2264465093612671},{""x"":2.0999999046325684,""y"":0.16821794211864471},{""x"":2.5999999046325684,""y"":0.3879014551639557},{""x"":3.0999999046325684,""y"":0.5470244884490967},{""x"":3.5999999046325684,""y"":0.3419053554534912},{""x"":4.099999904632568,""y"":0.7655120491981506},{""x"":4.599999904632568,""y"":1.2346516847610474},{""x"":5.099999904632568,""y"":2.453336715698242},{""x"":5.599999904632568,""y"":2.9565491676330566},{""x"":6.099999904632568,""y"":3.335299491882324},{""x"":6.599999904632568,""y"":3.240290880203247},{""x"":7.099999904632568,""y"":3.1107218265533447}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.6401853521511094, 1.26211588875013, 5.399028074402744, 0.5089580830068091],""points"":[{""x"":0.10000000149011612,""y"":3.8585598468780518},{""x"":0.6000000238418579,""y"":3.6077206134796143},{""x"":1.100000023841858,""y"":3.855252265930176},{""x"":1.600000023841858,""y"":3.619039297103882},{""x"":2.0999999046325684,""y"":3.839388370513916},{""x"":2.5999999046325684,""y"":3.335283041000366},{""x"":3.0999999046325684,""y"":3.571141481399536},{""x"":3.5999999046325684,""y"":3.4155046939849854},{""x"":4.099999904632568,""y"":3.7316646575927734},{""x"":4.599999904632568,""y"":3.0680155754089355},{""x"":5.099999904632568,""y"":2.891066551208496},{""x"":5.599999904632568,""y"":1.6022753715515137},{""x"":6.099999904632568,""y"":0.7652576565742493},{""x"":6.599999904632568,""y"":0.6875326037406921},{""x"":7.099999904632568,""y"":0.5828871726989746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nItaly,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,8,8,1ZP8,8,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.293592105923809, 1.3781586549141835, 5.1025898038676605, 0.03493851245291291],""points"":[{""x"":0.10000000149011612,""y"":2.1287283897399902},{""x"":0.6000000238418579,""y"":2.267972230911255},{""x"":1.100000023841858,""y"":2.398442506790161},{""x"":1.600000023841858,""y"":2.5130622386932373},{""x"":2.0999999046325684,""y"":2.3255116939544678},{""x"":2.5999999046325684,""y"":2.127340793609619},{""x"":3.0999999046325684,""y"":2.47259783744812},{""x"":3.5999999046325684,""y"":2.131181478500366},{""x"":4.099999904632568,""y"":2.090421438217163},{""x"":4.599999904632568,""y"":2.02299165725708},{""x"":5.099999904632568,""y"":1.1105059385299683},{""x"":5.599999904632568,""y"":0.4494485855102539},{""x"":6.099999904632568,""y"":0.1375635862350464},{""x"":6.599999904632568,""y"":0.036351121962070465},{""x"":7.099999904632568,""y"":0.1619771122932434}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.953125499439879, 1.2528620255306528, 5.187637440149802, 0.3110348753260886],""points"":[{""x"":0.10000000149011612,""y"":5.6585283279418945},{""x"":0.6000000238418579,""y"":5.911152362823486},{""x"":1.100000023841858,""y"":5.924920082092285},{""x"":1.600000023841858,""y"":5.8469438552856445},{""x"":2.0999999046325684,""y"":5.929472923278809},{""x"":2.5999999046325684,""y"":6.190037727355957},{""x"":3.0999999046325684,""y"":6.236179828643799},{""x"":3.5999999046325684,""y"":6.141019344329834},{""x"":4.099999904632568,""y"":5.295210838317871},{""x"":4.599999904632568,""y"":5.265801906585693},{""x"":5.099999904632568,""y"":3.3722851276397705},{""x"":5.599999904632568,""y"":1.8299226760864258},{""x"":6.099999904632568,""y"":0.32690900564193726},{""x"":6.599999904632568,""y"":0.6274543404579163},{""x"":7.099999904632568,""y"":0.8441857099533081}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nRwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,9,2BDJ,9,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.8209972202654474, 1.3779216716448506, 5.299882228439686, 0.06040645519069608],""points"":[{""x"":0.10000000149011612,""y"":3.7821109294891357},{""x"":0.6000000238418579,""y"":3.542433023452759},{""x"":1.100000023841858,""y"":3.7008674144744873},{""x"":1.600000023841858,""y"":3.717301607131958},{""x"":2.0999999046325684,""y"":4.024452209472656},{""x"":2.5999999046325684,""y"":4.013899326324463},{""x"":3.0999999046325684,""y"":3.945094347000122},{""x"":3.5999999046325684,""y"":3.866621971130371},{""x"":4.099999904632568,""y"":3.7461626529693604},{""x"":4.599999904632568,""y"":3.3454740047454834},{""x"":5.099999904632568,""y"":2.61944317817688},{""x"":5.599999904632568,""y"":0.999405026435852},{""x"":6.099999904632568,""y"":0.46259793639183044},{""x"":6.599999904632568,""y"":0.054134611040353775},{""x"":7.099999904632568,""y"":0.05711187422275543}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.6318079657726035, 1.8495493770000595, 5.391793312471116, 0.17060707587348442],""points"":[{""x"":0.10000000149011612,""y"":5.458079814910889},{""x"":0.6000000238418579,""y"":5.554427146911621},{""x"":1.100000023841858,""y"":5.799983024597168},{""x"":1.600000023841858,""y"":5.364140033721924},{""x"":2.0999999046325684,""y"":5.864485740661621},{""x"":2.5999999046325684,""y"":5.4509806632995605},{""x"":3.0999999046325684,""y"":5.702574729919434},{""x"":3.5999999046325684,""y"":5.7314534187316895},{""x"":4.099999904632568,""y"":5.5123443603515625},{""x"":4.599999904632568,""y"":5.724395751953125},{""x"":5.099999904632568,""y"":4.354506969451904},{""x"":5.599999904632568,""y"":1.7307666540145874},{""x"":6.099999904632568,""y"":0.6305936574935913},{""x"":6.599999904632568,""y"":0.035183437168598175},{""x"":7.099999904632568,""y"":0.7575169205665588}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nSwitzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,10,1IAN,10,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[1.1190255865097471, 2.3163895161544437, 5.4968866182279195, 0.2035204047289052],""points"":[{""x"":0.10000000149011612,""y"":1.1057683229446411},{""x"":0.6000000238418579,""y"":1.1019697189331055},{""x"":1.100000023841858,""y"":1.0818607807159424},{""x"":1.600000023841858,""y"":1.062997817993164},{""x"":2.0999999046325684,""y"":1.046447515487671},{""x"":2.5999999046325684,""y"":1.1217249631881714},{""x"":3.0999999046325684,""y"":1.2166996002197266},{""x"":3.5999999046325684,""y"":1.215477705001831},{""x"":4.099999904632568,""y"":1.0581893920898438},{""x"":4.599999904632568,""y"":1.1747995615005493},{""x"":5.099999904632568,""y"":1.0181127786636353},{""x"":5.599999904632568,""y"":0.5344523191452026},{""x"":6.099999904632568,""y"":0.2569526433944702},{""x"":6.599999904632568,""y"":0.1912207305431366},{""x"":7.099999904632568,""y"":0.15060538053512573}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.1038581025805785, 2.0032224204185245, 5.087602825989163, 0.13277988512492753],""points"":[{""x"":0.10000000149011612,""y"":3.0498509407043457},{""x"":0.6000000238418579,""y"":2.805217742919922},{""x"":1.100000023841858,""y"":3.3415253162384033},{""x"":1.600000023841858,""y"":3.0549843311309814},{""x"":2.0999999046325684,""y"":3.250074863433838},{""x"":2.5999999046325684,""y"":3.0432586669921875},{""x"":3.0999999046325684,""y"":3.265852451324463},{""x"":3.5999999046325684,""y"":2.9475724697113037},{""x"":4.099999904632568,""y"":3.1929898262023926},{""x"":4.599999904632568,""y"":2.7460060119628906},{""x"":5.099999904632568,""y"":1.6175861358642578},{""x"":5.599999904632568,""y"":0.3006608486175537},{""x"":6.099999904632568,""y"":0.3444803059101105},{""x"":6.599999904632568,""y"":0.015537971630692482},{""x"":7.099999904632568,""y"":0.5527358055114746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\n,,,,,,,,,,,,,,,,,,,,,');o.columns.add(t.Column.fromList(t.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var i=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};const s=3e4,a=108e5,l=console.log.bind(console),c=console.info.bind(console),u=console.warn.bind(console),f=console.error.bind(console),h={},d="Auto Tests",m="Demo",p="Detectors",y="Core",g={};let x;var v;!function(t){t.notNull=function(t,e){if(null==t)throw new Error(`${null==e?"Value":e} not defined`)}}(v||(v={}));class w{constructor(t,e){this.catchUnhandled=!0,this.report=!1,void 0!==t&&(this.catchUnhandled=t),void 0!==e&&(this.report=e)}}class T{constructor(t,e,n,r){var o;this.category=t,this.name=e,null!=r||(r={}),null!==(o=r.timeout)&&void 0!==o||(r.timeout=s),this.options=r,this.test=()=>i(this,void 0,void 0,(function*(){return new Promise(((t,e)=>i(this,void 0,void 0,(function*(){let r="";try{r=yield n()}catch(t){e(t)}t(r)}))))}))}}function _(t,e,n){null==h[x]&&(h[x]={}),null==h[x].tests&&(h[x].tests=[]),h[x].tests.push(new T(x,t,e,n))}function C(t,e=!0,n){if(n=n?`${n}, `:"",t!==e)throw new Error(`${n}Expected "${e}", got "${t}"`)}function E(t,e,n=.001,r){if(t===Number.POSITIVE_INFINITY&&e===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY&&e===Number.NEGATIVE_INFINITY||t===Number.NaN&&e===Number.NaN||isNaN(t)&&isNaN(e))return;const o=Math.abs(t-e)<n;if(C(o,!0,`${null!=r?r:""} (tolerance = ${n})`),!o)throw new Error(`Expected ${e}, got ${t} (tolerance = ${n})`)}function I(t,e){for(const[n,r]of Object.entries(e)){if(!t.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const e=t[n];if(e instanceof Array&&r instanceof Array)A(e,r);else if(e instanceof Object&&r instanceof Object)I(e,r);else if(Number.isFinite(e)&&Number.isFinite(r))E(e,r);else if(e!=r)throw new Error(`Expected (${r}) for key '${n}', got (${e})`)}}function A(t,e){const n=t.length,r=e.length;if(n!=r)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${r}`);for(let r=0;r<n;r++)if(t[r]instanceof Array&&e[r]instanceof Array)A(t[r],e[r]);else if(t[r]instanceof Object&&e[r]instanceof Object)I(t[r],e[r]);else if(t[r]!=e[r])throw new Error(`Expected ${e[r]} at position ${r}, got ${t[r]}`)}function N(t,e,n){var r;x=t,e(),h[x]&&(h[x].clear=null===(r=null==n?void 0:n.clear)||void 0===r||r,h[x].timeout=null==n?void 0:n.timeout,h[x].benchmarks=null==n?void 0:n.benchmarks)}function b(t,e){return t.replace(new RegExp(e.name,"gi"),e.nqName)}function L(e){return i(this,void 0,void 0,(function*(){return`${e.toString()}\n${e.stack?yield t.Logger.translateStackTrace(e.stack):""}`}))}function S(n,r,o,c,u,h){var d,m,p,y,g,x,v,w;return i(this,void 0,void 0,(function*(){let i;o.length=0;let T="package";const _=null!=r&&n.name.toLowerCase()!==r.toLowerCase();let C=(null===(d=n.options)||void 0===d?void 0:d.skipReason)||_,E=_?"skipped":null===(m=n.options)||void 0===m?void 0:m.skipReason;if(t.Test.isInBenchmark&&!(null===(p=n.options)||void 0===p?void 0:p.benchmark))return void l(`SKIPPED: ${n.category} ${n.name} doesnt available in benchmark mode`);C||l(`Started ${n.category} ${n.name}`);const I=Date.now();try{if(C)i={success:!0,result:E,ms:0,skipped:!0};else{let e=(null===(y=n.options)||void 0===y?void 0:y.timeout)===s&&c?c:null===(g=n.options)||void 0===g?void 0:g.timeout;e=t.Test.isInBenchmark?a:e,i={success:!0,result:null!==(x=yield P(n.test,e))&&void 0!==x?x:"OK",ms:0,skipped:!1}}}catch(t){f(t),i={success:!1,result:yield L(t),ms:0,skipped:!1}}if((null===(v=n.options)||void 0===v?void 0:v.isAggregated)&&i.result.constructor===t.DataFrame){const t=i.result.col("success");if(t&&(i.success=t.stats.sum===t.length),!h){const t=i.result;t.columns.remove("stack"),t.rows.removeWhere((t=>t.get("success"))),i.result=t}i.result=i.result.toCsv()}if(i.logs=o.join("\n"),i.ms=Date.now()-I,C||l(`Finished ${n.category} ${n.name} for ${i.ms} ms`),i.category=n.category,i.name=n.name,!_){let r={success:i.success,result:i.result,ms:i.ms,skipped:i.skipped,package:u,category:n.category,name:n.name,logs:i.logs};if(i.result.constructor==Object){const t=Object.keys(i.result).reduce(((t,e)=>Object.assign(Object.assign({},t),{["result."+e]:i.result[e]})),{});r=Object.assign(Object.assign({},r),t)}r.result instanceof t.DataFrame&&(r.result=JSON.stringify(null===(w=r.result)||void 0===w?void 0:w.toJson())||""),null!=e.shell.reportTest?yield e.shell.reportTest(T,r):yield fetch(`${e.dapi.root}/log/tests/${T}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(r)})}return i}))}function O(t){return i(this,void 0,void 0,(function*(){yield new Promise((e=>setTimeout(e,t)))}))}function P(t,e,n="EXECUTION TIMEOUT"){return i(this,void 0,void 0,(function*(){let r=null;const o=new Promise(((t,o)=>{r=setTimeout((()=>{o(n)}),e)}));try{return yield Promise.race([t(),o])}finally{r&&clearTimeout(r)}}))}t.DataFrame.fromColumns([t.Column.fromStrings("col",["val1","val2","val3"])]);var R=n(95),M=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};N("detectors",(()=>{_("detectFitCurves",(()=>M(void 0,void 0,void 0,(function*(){const n=t.DataFrame.fromCsv('dataframes,json chart 0,json chart 1,json chart 2\n"null (15 rows, 2 columns)","{""series"":[{""parameters"":[1.4325498997897106,1.9857091601431633,1.1549088606928581,1.7111330488305754],""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":0.04513680189847946},{""x"":0.6000000238418579,""y"":0.05534003674983978},{""x"":1.100000023841858,""y"":0.041759949177503586},{""x"":1.600000023841858,""y"":0.019746985286474228},{""x"":2.0999999046325684,""y"":0.009008238092064857},{""x"":2.5999999046325684,""y"":0.00802786834537983},{""x"":3.0999999046325684,""y"":0.046114228665828705},{""x"":3.5999999046325684,""y"":0.0032935715280473232},{""x"":4.099999904632568,""y"":0.05305013433098793},{""x"":4.599999904632568,""y"":0.11946146935224533},{""x"":5.099999904632568,""y"":0.24304461479187012},{""x"":5.599999904632568,""y"":0.32507050037384033},{""x"":6.099999904632568,""y"":0.30492347478866577},{""x"":6.599999904632568,""y"":0.30675041675567627},{""x"":7.099999904632568,""y"":0.28282707929611206}]},{""fitFunction"":""sigmoid"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":0.027537694200873375},{""x"":0.6000000238418579,""y"":0.20163409411907196},{""x"":1.100000023841858,""y"":0.4537210166454315},{""x"":1.600000023841858,""y"":0.1709870994091034},{""x"":2.0999999046325684,""y"":0.35089364647865295},{""x"":2.5999999046325684,""y"":0.30297139286994934},{""x"":3.0999999046325684,""y"":0.3161645829677582},{""x"":3.5999999046325684,""y"":0.460237979888916},{""x"":4.099999904632568,""y"":0.5018354058265686},{""x"":4.599999904632568,""y"":1.2936394214630127},{""x"":5.099999904632568,""y"":2.336543321609497},{""x"":5.599999904632568,""y"":2.353417158126831},{""x"":6.099999904632568,""y"":2.5554966926574707},{""x"":6.599999904632568,""y"":2.7185072898864746},{""x"":7.099999904632568,""y"":2.8088953495025635}]}]}","{""series"":[{""parameters"":[1.4257157458000065,1.587135296876273,1.6780074048516793,4.72187609991688],""fitFunction"":""sigmoid"",""fitLineColor"":""#2ca02c"",""pointColor"":""#2ca02c"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":0.5346568822860718},{""x"":0.6000000238418579,""y"":0.6445727348327637},{""x"":1.100000023841858,""y"":0.08188246190547943},{""x"":1.600000023841858,""y"":0.0516531839966774},{""x"":2.0999999046325684,""y"":0.17018724977970123},{""x"":2.5999999046325684,""y"":0.618033766746521},{""x"":3.0999999046325684,""y"":0.16852399706840515},{""x"":3.5999999046325684,""y"":0.013230039738118649},{""x"":4.099999904632568,""y"":0.6706985831260681},{""x"":4.599999904632568,""y"":0.6293138861656189},{""x"":5.099999904632568,""y"":1.4058887958526611},{""x"":5.599999904632568,""y"":2.6412644386291504},{""x"":6.099999904632568,""y"":3.775967597961426},{""x"":6.599999904632568,""y"":3.3188939094543457},{""x"":7.099999904632568,""y"":3.793793201446533}]}],""chartOptions"":{""showStatistics"":[""auc""]}}","{""series"":[{""parameters"":[1.4518023469757255,1.051351211186544,1.6612723878444138,-0.9253134758193626],""fitFunction"":""sigmoid"",""fitLineColor"":""#9467bd"",""pointColor"":""#9467bd"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":2.5458569526672363},{""x"":0.10000000149011612,""y"":3.0017518997192383},{""x"":0.10000000149011612,""y"":2.4102466106414795},{""x"":0.10000000149011612,""y"":2.7017934322357178},{""x"":0.10000000149011612,""y"":2.8341686725616455},{""x"":0.6000000238418579,""y"":2.9751579761505127},{""x"":0.6000000238418579,""y"":2.8365142345428467},{""x"":0.6000000238418579,""y"":2.898362874984741},{""x"":0.6000000238418579,""y"":2.9964826107025146},{""x"":0.6000000238418579,""y"":2.6708292961120605},{""x"":1.100000023841858,""y"":3.263227939605713},{""x"":1.100000023841858,""y"":3.0655293464660645},{""x"":1.100000023841858,""y"":2.6620445251464844},{""x"":1.100000023841858,""y"":3.002741813659668},{""x"":1.100000023841858,""y"":3.1540098190307617},{""x"":1.600000023841858,""y"":2.8934433460235596},{""x"":1.600000023841858,""y"":2.7970690727233887},{""x"":1.600000023841858,""y"":3.0466723442077637},{""x"":1.600000023841858,""y"":3.179988145828247},{""x"":1.600000023841858,""y"":2.611898899078369},{""x"":2.0999999046325684,""y"":2.497966766357422},{""x"":2.0999999046325684,""y"":2.645627498626709},{""x"":2.0999999046325684,""y"":2.5474727153778076},{""x"":2.0999999046325684,""y"":2.530237913131714},{""x"":2.0999999046325684,""y"":2.9498236179351807},{""x"":2.5999999046325684,""y"":2.7639214992523193},{""x"":2.5999999046325684,""y"":3.007110595703125},{""x"":2.5999999046325684,""y"":2.71816086769104},{""x"":2.5999999046325684,""y"":3.050650119781494},{""x"":2.5999999046325684,""y"":2.591902017593384},{""x"":3.0999999046325684,""y"":2.79219388961792},{""x"":3.0999999046325684,""y"":2.380063056945801},{""x"":3.0999999046325684,""y"":3.2450575828552246},{""x"":3.0999999046325684,""y"":2.6954219341278076},{""x"":3.0999999046325684,""y"":2.368993043899536},{""x"":3.5999999046325684,""y"":3.2338552474975586},{""x"":3.5999999046325684,""y"":3.222881555557251},{""x"":3.5999999046325684,""y"":2.6137502193450928},{""x"":3.5999999046325684,""y"":2.3624353408813477},{""x"":3.5999999046325684,""y"":2.830970525741577},{""x"":4.099999904632568,""y"":2.8000826835632324},{""x"":4.099999904632568,""y"":2.8115334510803223},{""x"":4.099999904632568,""y"":2.8906726837158203},{""x"":4.099999904632568,""y"":2.5641937255859375},{""x"":4.099999904632568,""y"":2.3881938457489014},{""x"":4.599999904632568,""y"":2.076000928878784},{""x"":4.599999904632568,""y"":2.241201400756836},{""x"":4.599999904632568,""y"":2.018866777420044},{""x"":4.599999904632568,""y"":2.7197747230529785},{""x"":4.599999904632568,""y"":2.3649282455444336},{""x"":5.099999904632568,""y"":2.068617105484009},{""x"":5.099999904632568,""y"":2.0637989044189453},{""x"":5.099999904632568,""y"":1.5100634098052979},{""x"":5.099999904632568,""y"":1.9978814125061035},{""x"":5.099999904632568,""y"":2.1007437705993652},{""x"":5.599999904632568,""y"":0.7437329292297363},{""x"":5.599999904632568,""y"":0.8030821681022644},{""x"":5.599999904632568,""y"":1.0766953229904175},{""x"":5.599999904632568,""y"":1.5326048135757446},{""x"":5.599999904632568,""y"":1.5971065759658813},{""x"":6.099999904632568,""y"":0.31388434767723083},{""x"":6.099999904632568,""y"":0.6875622272491455},{""x"":6.099999904632568,""y"":0.855545163154602},{""x"":6.099999904632568,""y"":0.6559354662895203},{""x"":6.099999904632568,""y"":0.3100747764110565},{""x"":6.599999904632568,""y"":0.4792144000530243},{""x"":6.599999904632568,""y"":0.855309009552002},{""x"":6.599999904632568,""y"":0.18937373161315918},{""x"":6.599999904632568,""y"":0.3708323538303375},{""x"":6.599999904632568,""y"":0.08053481578826904},{""x"":7.099999904632568,""y"":0.7577306628227234},{""x"":7.099999904632568,""y"":0.3387751877307892},{""x"":7.099999904632568,""y"":0.1985611915588379},{""x"":7.099999904632568,""y"":0.172195702791214},{""x"":7.099999904632568,""y"":0.13258741796016693}]}],""chartOptions"":{""showStatistics"":[""auc""]}}"\n"null (15 rows, 2 columns)","{""series"":[{""parameters"":[1.4030933784862443,1.0245979562516274,1.7428150024861861,-3.5779850370795696],""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":5.7036309242248535},{""x"":0.6000000238418579,""y"":5.746265888214111},{""x"":1.100000023841858,""y"":5.299612045288086},{""x"":1.600000023841858,""y"":5.343863487243652},{""x"":2.0999999046325684,""y"":5.506134033203125},{""x"":2.5999999046325684,""y"":5.4817914962768555},{""x"":3.0999999046325684,""y"":5.3505539894104},{""x"":3.5999999046325684,""y"":5.151522159576416},{""x"":4.099999904632568,""y"":5.212680339813232},{""x"":4.599999904632568,""y"":4.80598783493042},{""x"":5.099999904632568,""y"":3.351301431655884},{""x"":5.599999904632568,""y"":2.108116865158081},{""x"":6.099999904632568,""y"":1.246281623840332},{""x"":6.599999904632568,""y"":0.5875148773193359},{""x"":7.099999904632568,""y"":0.6986792683601379}]},{""fitFunction"":""sigmoid"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":4.777379035949707},{""x"":0.6000000238418579,""y"":5.265642166137695},{""x"":1.100000023841858,""y"":5.713808059692383},{""x"":1.600000023841858,""y"":5.249830722808838},{""x"":2.0999999046325684,""y"":5.587547779083252},{""x"":2.5999999046325684,""y"":5.36907434463501},{""x"":3.0999999046325684,""y"":4.934175968170166},{""x"":3.5999999046325684,""y"":5.372972011566162},{""x"":4.099999904632568,""y"":5.017283916473389},{""x"":4.599999904632568,""y"":4.6751484870910645},{""x"":5.099999904632568,""y"":3.423663854598999},{""x"":5.599999904632568,""y"":1.594344973564148},{""x"":6.099999904632568,""y"":0.5661525130271912},{""x"":6.599999904632568,""y"":0.19819404184818268},{""x"":7.099999904632568,""y"":0.8421927690505981}]}]}","{""series"":[{""parameters"":[1.5400648543589148,1.7239324972922214,1.4063297934320662,0.33443731185267556],""fitFunction"":""sigmoid"",""fitLineColor"":""#2ca02c"",""pointColor"":""#2ca02c"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":1.27737557888031},{""x"":0.6000000238418579,""y"":1.2780145406723022},{""x"":1.100000023841858,""y"":1.3489571809768677},{""x"":1.600000023841858,""y"":1.3250025510787964},{""x"":2.0999999046325684,""y"":1.309158444404602},{""x"":2.5999999046325684,""y"":1.441296935081482},{""x"":3.0999999046325684,""y"":1.3621265888214111},{""x"":3.5999999046325684,""y"":1.3409022092819214},{""x"":4.099999904632568,""y"":1.2703818082809448},{""x"":4.599999904632568,""y"":1.2195014953613281},{""x"":5.099999904632568,""y"":0.585429310798645},{""x"":5.599999904632568,""y"":0.19421088695526123},{""x"":6.099999904632568,""y"":0.2276361584663391},{""x"":6.599999904632568,""y"":0.03259352594614029},{""x"":7.099999904632568,""y"":0.03811067342758179}]}],""chartOptions"":{""showStatistics"":[""auc""]}}","{""series"":[{""parameters"":[1.3987701446422334,1.0025589776619843,1.950431059109577,1.57489342486818],""fitFunction"":""sigmoid"",""fitLineColor"":""#9467bd"",""pointColor"":""#9467bd"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":0.03612012043595314},{""x"":0.10000000149011612,""y"":0.05706661567091942},{""x"":0.10000000149011612,""y"":0.007174440659582615},{""x"":0.10000000149011612,""y"":0.006656676065176725},{""x"":0.10000000149011612,""y"":0.03480849787592888},{""x"":0.6000000238418579,""y"":0.0665726289153099},{""x"":0.6000000238418579,""y"":0.054525356739759445},{""x"":0.6000000238418579,""y"":0.055943023413419724},{""x"":0.6000000238418579,""y"":0.0544852614402771},{""x"":0.6000000238418579,""y"":0.02734142541885376},{""x"":1.100000023841858,""y"":0.02047267183661461},{""x"":1.100000023841858,""y"":0.04814719781279564},{""x"":1.100000023841858,""y"":0.05629648640751839},{""x"":1.100000023841858,""y"":0.05200682207942009},{""x"":1.100000023841858,""y"":0.046626269817352295},{""x"":1.600000023841858,""y"":0.027950428426265717},{""x"":1.600000023841858,""y"":0.021106986328959465},{""x"":1.600000023841858,""y"":0.011796108447015285},{""x"":1.600000023841858,""y"":0.04013078659772873},{""x"":1.600000023841858,""y"":0.018657365813851357},{""x"":2.0999999046325684,""y"":0.010390376672148705},{""x"":2.0999999046325684,""y"":0.06717702001333237},{""x"":2.0999999046325684,""y"":0.015734216198325157},{""x"":2.0999999046325684,""y"":0.0005020603421144187},{""x"":2.0999999046325684,""y"":0.03601917624473572},{""x"":2.5999999046325684,""y"":0.04580968990921974},{""x"":2.5999999046325684,""y"":0.013811883516609669},{""x"":2.5999999046325684,""y"":0.0347907729446888},{""x"":2.5999999046325684,""y"":0.003400992602109909},{""x"":2.5999999046325684,""y"":0.0658077746629715},{""x"":3.0999999046325684,""y"":0.06470326334238052},{""x"":3.0999999046325684,""y"":0.040105774998664856},{""x"":3.0999999046325684,""y"":0.004536386113613844},{""x"":3.0999999046325684,""y"":0.028299888595938683},{""x"":3.0999999046325684,""y"":0.015297790057957172},{""x"":3.5999999046325684,""y"":0.010205036029219627},{""x"":3.5999999046325684,""y"":0.030351044610142708},{""x"":3.5999999046325684,""y"":0.02823905274271965},{""x"":3.5999999046325684,""y"":0.00543160829693079},{""x"":3.5999999046325684,""y"":0.03528806194663048},{""x"":4.099999904632568,""y"":0.024404611438512802},{""x"":4.099999904632568,""y"":0.021398605778813362},{""x"":4.099999904632568,""y"":0.01746137998998165},{""x"":4.099999904632568,""y"":0.06801135092973709},{""x"":4.099999904632568,""y"":0.02418249472975731},{""x"":4.599999904632568,""y"":0.08065827190876007},{""x"":4.599999904632568,""y"":0.03795705363154411},{""x"":4.599999904632568,""y"":0.03595327213406563},{""x"":4.599999904632568,""y"":0.019490951672196388},{""x"":4.599999904632568,""y"":0.0357535295188427},{""x"":5.099999904632568,""y"":0.06301134079694748},{""x"":5.099999904632568,""y"":0.04880264401435852},{""x"":5.099999904632568,""y"":0.046849530190229416},{""x"":5.099999904632568,""y"":0.046094998717308044},{""x"":5.099999904632568,""y"":0.07735799998044968},{""x"":5.599999904632568,""y"":0.10287926346063614},{""x"":5.599999904632568,""y"":0.15329882502555847},{""x"":5.599999904632568,""y"":0.09895746409893036},{""x"":5.599999904632568,""y"":0.10509312152862549},{""x"":5.599999904632568,""y"":0.10584071278572083},{""x"":6.099999904632568,""y"":0.19464170932769775},{""x"":6.099999904632568,""y"":0.1837087869644165},{""x"":6.099999904632568,""y"":0.19690236449241638},{""x"":6.099999904632568,""y"":0.14827826619148254},{""x"":6.099999904632568,""y"":0.15355728566646576},{""x"":6.599999904632568,""y"":0.21270307898521423},{""x"":6.599999904632568,""y"":0.19529509544372559},{""x"":6.599999904632568,""y"":0.20716492831707},{""x"":6.599999904632568,""y"":0.18739652633666992},{""x"":6.599999904632568,""y"":0.22446008026599884},{""x"":7.099999904632568,""y"":0.18822836875915527},{""x"":7.099999904632568,""y"":0.2324085384607315},{""x"":7.099999904632568,""y"":0.1877404898405075},{""x"":7.099999904632568,""y"":0.19784560799598694},{""x"":7.099999904632568,""y"":0.21554286777973175}]}],""chartOptions"":{""showStatistics"":[""auc""]}}"'),r=n.columns.byName("json chart 0"),o=n.columns.byName("json chart 1"),i=n.columns.byName("json chart 2");yield e.data.detectSemanticTypes(n),C(r.semType,R.h.FIT_SEM_TYPE),C(o.semType,R.h.FIT_SEM_TYPE),C(i.semType,R.h.FIT_SEM_TYPE)})))),_("detectXMLCurveChart",(()=>M(void 0,void 0,void 0,(function*(){const n=t.DataFrame.fromCsv('xmlCurveFitChart\n"<chart><grid><xAxis min=""0.0"" max=""5"" /><yAxis min=""-100"" max=""100"" /></grid><settings xLabel=""Concentration"" yLabel=""Activity"" logX=""true"" /><seriesCollection><series><x>7.2e-12,7.1e-12,7e-12,6e-8,6e-5,6e-4</x><y>112,115,116,100,123,124</y><fitLine><function type=""sigif""><params>2e-08,-1.5,125,-20</params></function></fitLine><settings color=""Green"" marker=""SquareBorder"" markerColor=""Yellow"" markerBorderColor=""Black"" errorBarColor=""Red"" showErrorBars=""True"" drawLine=""True"" bound=""True"" /></series></seriesCollection></chart>"'),r=n.columns.byName("xmlCurveFitChart");yield e.data.detectSemanticTypes(n),C(r.semType,R.h.FIT_SEM_TYPE),C(r.tags[R.h.TAG_FIT_CHART_FORMAT],R.h.TAG_FIT_CHART_FORMAT_3DX)}))))}));var X=n(389),F=n(991),D=n.n(F),G=n(471),B=n(755),k=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};function Y(e){const n={series:[],chartOptions:{showStatistics:["auc"]}},r=(0,G.kL)(e,.5),o=t.Color.toHtml(t.Color.scatterPlotMarker);return n.series[0]={fitLineColor:o,pointColor:o,markerType:t.MARKER_TYPE.CIRCLE,showFitLine:!0,showPoints:"points",showCurveConfidenceInterval:!0,fitFunction:"sigmoid",points:D().count().take(e).map((function(t){return{x:r.x[t],y:r.y[t]}})).toArray()},n}N("creation",(()=>{_("fit curve creation",(()=>k(void 0,void 0,void 0,(function*(){const n=Date.now(),r=(0,G.nO)(t.Test.isInBenchmark?1e3:100,5,2);e.shell.addTableView(r);const o=Date.now();return yield O(50),console.log(`Creation took ${o.valueOf()-n.valueOf()} ms`),`${t.Test.isInBenchmark?1e3:100} points, took ${o.valueOf()-n.valueOf()} ms`}))),{benchmark:!0})})),N("rendering",(()=>{_("rendering same fitChartData on canvas",(()=>k(void 0,void 0,void 0,(function*(){const n=X.canvas(160,120);e.shell.newView("canvas",[n]);const r=n.getContext("2d"),o=new B.lR,i=Y(t.Test.isInBenchmark?50:15);for(let e=1;e<=1e3;e++)o.renderCurves(r,new t.Rect(n.clientLeft,n.clientTop,160,120).inflate(R.h.INFLATE_SIZE,R.h.INFLATE_SIZE),i),r.clearRect(0,0,160,120);return"rendering performed 1000 times"}))),{benchmark:!0}),_("rendering different fitChartData on canvas",(()=>k(void 0,void 0,void 0,(function*(){const n=X.canvas(160,120);e.shell.newView("canvas",[n]);const r=n.getContext("2d"),o=new B.lR;for(let e=1;e<=1e3;e++){const e=Y(t.Test.isInBenchmark?50:15);o.renderCurves(r,new t.Rect(n.clientLeft,n.clientTop,160,120).inflate(R.h.INFLATE_SIZE,R.h.INFLATE_SIZE),e),r.clearRect(0,0,160,120)}return"rendering performed 1000 times"}))),{benchmark:!0}),_("rendering in grid",(()=>k(void 0,void 0,void 0,(function*(){const t=(0,G.nO)(30,5,2),n=e.shell.addTableView(t);yield O(100);const r=n.grid.root.getElementsByTagName("canvas")[2],o=new Date;yield function(t){return k(this,void 0,void 0,(function*(){for(let e=0;e<10;e++)t.dispatchEvent(new WheelEvent("wheel",{deltaY:300})),yield O(10)}))}(r);const i=new Date;return console.log(`curves rendering took ${i.valueOf()-o.valueOf()} ms`),i.valueOf()-o.valueOf()+" ms"}))))}));var H=n(293);N("viewport",(()=>{_("viewportMethods",(()=>{return e=void 0,n=void 0,o=function*(){const e=new t.Rect(120,20,160,100).inflate(R.h.INFLATE_SIZE,R.h.INFLATE_SIZE),[n]=(0,B.Tv)(e,!1,!1),r=new t.Rect(.1,.06,7,5.94),o=new H.L(r,n,!1,!1);C(o.xToScreen(1.5),182.4),C(o.yToScreen(2.33),73.01346801346801),C(o.xToWorld(150),-.9652173913043479),C(o.yToWorld(67),2.855294117647059)},new((r=void 0)||(r=Promise))((function(t,i){function s(t){try{l(o.next(t))}catch(t){i(t)}}function a(t){try{l(o.throw(t))}catch(t){i(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(s,a)}l((o=o.apply(e,n||[])).next())}));var e,n,r,o}))}));var V=n(999),q=n(71),j=n(368),W=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};const U={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.7412786483764648},{x:.6000000238418579,y:1.8561450242996216},{x:1.100000023841858,y:1.6065685749053955},{x:1.600000023841858,y:1.70476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"sigmoid",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[1.6914372095641517,1.1536998642628853,5.410173358224149,.2089689354045083]},$={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.5412786483764649},{x:.6000000238418579,y:1.9261450242996216},{x:1.100000023841858,y:1.6065685749053955},{x:1.600000023841858,y:1.70476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"linear",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[-5.45641324,10.456486765]},K={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.7897127864837648},{x:.6000000238418579,y:1.2101614502429963},{x:1.100000023841858,y:1.7895685749053956},{x:1.600000023841858,y:1.82476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"log-linear",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[-8.45641324,90.4456456486765]},Z={fitLineColor:"#2ca02c",pointColor:"#2ca02c",showCurveConfidenceInterval:!0,fitFunction:{name:"Polynomial",function:"([p1, p2, p3, p4], x) => p1 * x * x * x + p2 * x * x + p3 * x + p4",getInitialParameters:"(xs, ys) => [0.1, -1, 4, 4]",parameterNames:["Slope","Intercept","Parameter3","Parameter4"]},points:[{x:.10000000149011612,y:7.365033149719238},{x:.6000000238418579,y:6.595034599304199},{x:1.100000023841858,y:7.05179500579834},{x:1.600000023841858,y:7.251461982727051},{x:2.0999999046325684,y:7.775498867034912},{x:2.5999999046325684,y:7.748039722442627},{x:3.0999999046325684,y:6.8391804695129395},{x:3.5999999046325684,y:7.570991516113281},{x:4.099999904632568,y:6.387666702270508},{x:4.599999904632568,y:6.464827537536621},{x:5.099999904632568,y:3.932436227798462},{x:5.599999904632568,y:1.4741199016571045},{x:6.099999904632568,y:.47604307532310486},{x:6.599999904632568,y:.5836760401725769},{x:7.099999904632568,y:1.0317600965499878}],clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[.07070206940832963,-1.138666933634074,3.947509109407932,3.9947960440506685]},z=(0,V.zB)(U),J=(0,V.zB)($),Q=(0,V.zB)(K),tt=(0,V.zB)(Z);N("fit",(()=>{_("getSeriesFitFunction",(()=>W(void 0,void 0,void 0,(function*(){var t;const{xs:e,ys:n}=(0,V.W$)(U.points),{xs:r,ys:o}=(0,V.W$)($.points),{xs:i,ys:s}=(0,V.W$)(K.points),{xs:a,ys:l}=(0,V.W$)(Z.points);C(z.name,q.G7),C(J.name,q.Ff),C(Q.name,q.kx),C(tt.name,"Polynomial"),A(z.parameterNames,["Top","Bottom","Slope","IC50"]),A(J.parameterNames,["Slope","Intercept"]),A(Q.parameterNames,["Slope","Intercept"]),A(tt.parameterNames,["Slope","Intercept","Parameter3","Parameter4"]),A(z.getInitialParameters(e,n),[1.8561450242996216,1,5.099999904632568,.23361243307590485]),A(J.getInitialParameters(r,o),[-.1868094652891159,1.5599596500396729]),A(Q.getInitialParameters(i,s),[-5,100]),A(tt.getInitialParameters(a,l),[.1,-1,4,4]);const c=new Float32Array(null===(t=U.parameters)||void 0===t?void 0:t.length);c.set(U.parameters),C(z.y(c,1.1),1.6914214561555851),C(J.y(J.getInitialParameters(r,o),1.1),1.3544692382216454),C(Q.y(Q.getInitialParameters(i,s),1.1),96.29031327635312),C(tt.y(tt.getInitialParameters(a,l),1.1),7.3231)})))),_("getCurve",(()=>W(void 0,void 0,void 0,(function*(){const t=(0,V._T)(U,z),e=(0,V._T)($,J),n=(0,V._T)(K,Q),r=(0,V._T)(Z,tt);C(t(2.5),1.690786623428712),C(t(5.8858),.5356638447565519),C(e(2.5),-3.18454647064209),C(e(5.8858),-21.658870516967774),C(n(2.5),79.85176680360948),C(n(5.8858),74.12932588432805),C(r(1.56),7.650264639782428),C(r(3.99876),6.093284856699922)})))),_("fitSeries",(()=>W(void 0,void 0,void 0,(function*(){const t=Date.now(),e=(0,V.nT)(U,z),n=(0,V.nT)($,J),r=(0,V.nT)(K,Q),o=(0,V.nT)(Z,tt),i=Date.now();return C(e.fittedCurve(2.5),1.7023284700958918),C(n.fittedCurve(2.5),1.5181158855557442),C(r.fittedCurve(2.5),2.6375155762836133),C(o.fittedCurve(3.99876),4.793906282943224),A(e.parameters,[1.7039494514465332,1.030500888824463,5.367032051086426,.2426503598690033]),A(n.parameters,[-.2137794941663742,2.0525646209716797]),A(r.parameters,[-8.782659530639648,13.640106201171875]),A(o.parameters,[.09034820646047592,-1.148695945739746,3.3145318031311035,4.130721569061279]),i.valueOf()-t.valueOf()+" ms"})))),_("getSeriesConfidenceInterval",(()=>W(void 0,void 0,void 0,(function*(){const t=(0,V.fY)(U,z,!0),e=(0,V.fY)($,J,!0),n=(0,V.fY)(K,Q,!0),r=(0,V.fY)(Z,tt,!0);C(t.confidenceTop(2.578),1.8540855269320198),C(e.confidenceTop(2.578),26.645777275332037),C(n.confidenceTop(2.578),231.75768109324696),C(r.confidenceTop(2.3342),10.03522960294218),C(t.confidenceBottom(3.987),1.4949306416468298),C(e.confidenceBottom(3.987),-41.55415698266847),C(n.confidenceBottom(3.987),-75.23471085303483),C(r.confidenceBottom(3.8796),4.1686506915250385)})))),_("getSeriesStatistics",(()=>W(void 0,void 0,void 0,(function*(){const t=(0,V.VA)(U,z),e=(0,V.VA)(Z,tt);C(t.auc,9.335422628533761),C(e.auc,36.525538394763096),C(t.rSquared,.9781915962461156),C(e.rSquared,.846055768956569)})))),_("calculateBoxPlotStatistics",(()=>W(void 0,void 0,void 0,(function*(){const t=(0,j.k)([.7654603719711304,.8199243545532227,.8257747292518616,.9558155536651611,.9596694707870483]);C(t.q1,.8199243545532227),C(t.q2,.8257747292518616),C(t.q3,.9558155536651611),C(t.lowerAdjacentValue,.7654603719711304),C(t.upperAdjacentValue,.9558155536651611)})))),_("sigmoid",(()=>W(void 0,void 0,void 0,(function*(){const t=new Float32Array(4);t.set([2.612687371569039,-1.421800778574126,5.16688669906018,.341788492203575]),C((0,q.ry)(t,.5),.341789026340178),C((0,q.ry)(t,2.5),.34215523020636207),C((0,q.ry)(t,5.678976),2.2548815999597016)})))),_("linear",(()=>W(void 0,void 0,void 0,(function*(){const t=new Float32Array(2);t.set([-5.12346546,6.24654654]),C((0,q.sn)(t,.5),3.684813976287842),C((0,q.sn)(t,2.5),-6.562117099761963),C((0,q.sn)(t,5.678976),-22.849491081970214)})))),_("log-linear",(()=>W(void 0,void 0,void 0,(function*(){const t=new Float32Array(2);t.set([-5.12346546,91.5465454654]),C((0,q.AJ)(t,.5),89.46916042777144),C((0,q.AJ)(t,2.5),85.12805903963536),C((0,q.AJ)(t,5.678976),81.81726682791052)}))))}));var et=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};const nt=new t.Package;function rt(n,r,a){return et(this,void 0,void 0,(function*(){const x=yield function(n){var r,a,x,v,_,E,I,A;return i(this,void 0,void 0,(function*(){const N=null===(a=null===(r=e.functions.getCurrentCall())||void 0===r?void 0:r.func)||void 0===a?void 0:a.package;yield function(t){var n;return i(this,void 0,void 0,(function*(){const r=t.id;if(g[r])return;const a=h;if(void 0!==a[d]||void 0!==a[m]||Object.keys(a).find((t=>t.startsWith(d)||t.startsWith(y))))return void(g[r]=!0);if("DevTools"===t.name)for(const t of window.dartTests){const e=t.name.split(/\s*\|\s*!/g),r=null!==(n=e.pop())&&void 0!==n?n:t.name,o=e.length?y+": "+e.join(": "):y;void 0===a[o]&&(a[o]={tests:[],clear:!0}),a[o].tests.push(new T(o,r,t.test,{isAggregated:!1,timeout:s}))}const l=[],c=[],u=[],f=yield e.dapi.functions.filter(`package.id = "${r}"`).list(),x=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const t of f){const n=t.options.test,r=t.options.demoPath;if(n&&Array.isArray(n)&&n.length)for(let r=0;r<n.length;r++){const o=n[r].matchAll(x),s={};Array.from(o).forEach((t=>{t[0].startsWith("skip")?s.skip=t[1]:t[0].startsWith("wait")?s.wait=parseInt(t[2]):t[0].startsWith("cat")?s.cat=t[3]:t[0].startsWith("timeout")&&(s.timeout=parseInt(t[4]))}));const c=new T(d,1===n.length?t.name:`${t.name} ${r+1}`,(()=>i(this,void 0,void 0,(function*(){const o=yield e.functions.eval(b(n[r],t));if(s.wait&&(yield O(s.wait)),"boolean"==typeof o&&!o)throw`Failed: ${n[r]}, expected true, got ${o}`}))),{skipReason:s.skip,timeout:s.timeout});if(s.cat){const t=d+": "+s.cat;c.category=t,void 0===a[t]&&(a[t]={tests:[],clear:!0}),a[t].tests.push(c)}else l.push(c)}if(r){const n=t.options.demoWait?parseInt(t.options.demoWait):void 0,r=new T(m,t.friendlyName,(()=>i(this,void 0,void 0,(function*(){e.shell.clearLastError(),yield t.apply(),yield O(n||2e3);const r=yield e.shell.lastError;if(r)throw new Error(r)}))),{skipReason:t.options.demoSkip});c.push(r)}if(t.hasTag("semTypeDetector")){const e=new T(p,t.friendlyName,(()=>i(this,void 0,void 0,(function*(){const e=[];for(const n of o.clone().columns){const r=yield t.apply([n]);e.push(r||n.semType)}C(e.filter((t=>t)).length,1)}))),{skipReason:t.options.skipTest});u.push(e)}}g[r]=!0,l.length&&(a[d]={tests:l,clear:!0}),c.length&&(a[m]={tests:c,clear:!0}),u.length&&(a[p]={tests:u,clear:!1})}))}(N);const R=[];console.log("Running tests"),null!=n||(n={}),null!==(x=(A=n).testContext)&&void 0!==x||(A.testContext=new w),e.shell.clearLastError();const M=[],X=function(){const t=[];return console.log=(...e)=>{t.push(...e),l(...e)},console.info=(...e)=>{t.push(...e),c(...e)},console.warn=(...e)=>{t.push(...e),u(...e)},console.error=(...e)=>{t.push(...e),f(...e)},t}();try{for(const[r,o]of Object.entries(h)){if((null==n?void 0:n.category)&&!r.toLowerCase().startsWith(null==n?void 0:n.category.toLowerCase())||(null===(v=n.exclude)||void 0===v?void 0:v.some((t=>r.startsWith(t)))))continue;l(`Started ${r} category`),M.push(r);const s=null===(_=o.tests)||void 0===_?void 0:_.every((t=>{var e;return null===(e=t.options)||void 0===e?void 0:e.skipReason}));try{o.before&&!s&&(yield P((()=>i(this,void 0,void 0,(function*(){yield o.before()}))),1e5,`before ${n.category}: timeout error`))}catch(t){o.beforeStatus=yield L(t)}const a=null!==(E=o.tests)&&void 0!==E?E:[],c=[];if(o.clear)for(let r=0;r<a.length;r++){a[r].options&&void 0===(null===(I=a[r].options)||void 0===I?void 0:I.benchmark)&&(a[r].options||(a[r].options={}),a[r].options.benchmark=o.isAllTestsEnabledBenchmarkMode||!1);let i=yield S(a[r],null==n?void 0:n.test,X,o.timeout,N.name,n.verbose);i&&c.push(i),e.shell.closeAll(),t.Balloon.closeAll()}else for(let t=0;t<a.length;t++){let e=yield S(a[t],null==n?void 0:n.test,X,o.timeout,N.name,n.verbose);e&&c.push(e)}const u=c.filter((t=>"skipped"!=t.result));try{o.after&&!s&&(yield P((()=>i(this,void 0,void 0,(function*(){yield o.after()}))),1e5,`After ${n.category}: timeout error`))}catch(t){o.afterStatus=yield L(t)}o.afterStatus&&u.push({category:r,name:"after",result:o.afterStatus,success:!1,ms:0,skipped:!1}),o.beforeStatus&&u.push({category:r,name:"before",result:o.beforeStatus,success:!1,ms:0,skipped:!1}),R.push(...u)}}finally{console.log=l,console.info=c,console.warn=u,console.error=f}if(n.testContext.catchUnhandled){yield O(1e3);const t=yield e.shell.lastError,n={category:"Unhandled exceptions",name:"Exception",result:null!=t?t:"",success:!t,ms:0,skipped:!1};R.push(n),n.package=N.name,null!=e.shell.reportTest?yield e.shell.reportTest("package",n):yield fetch(`${e.dapi.root}/log/tests/package`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(n)})}return R}))}({category:n,test:r,testContext:a});return t.DataFrame.fromObjects(x)}))}})(),curves_test=r})();
|
|
2
2
|
//# sourceMappingURL=package-test.js.map
|