!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Graph=e():t.Graph=e()}(self,function(){return t={22:function(t,e,i){var s,r,a;r=[e,i(2688),i(2458),i(9211)],void 0===(a="function"==typeof(s=function(i,s,r,a){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=n(s),r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(r),a=n(a);const o={name:void 0,lineAt:!1,display:!0,flipped:!1,axisDataSpacing:{min:.1,max:.1},unitModification:!1,primaryGrid:!0,secondaryGrid:!0,primaryGridWidth:1,primaryGridColor:"#f0f0f0",primaryGridDasharray:void 0,primaryGridOpacity:void 0,primaryTicksColor:"black",secondaryGridWidth:1,secondaryGridColor:"#f0f0f0",secondaryGridDasharray:void 0,secondaryGridOpacity:void 0,secondaryTicksColor:"black",hideWhenNoSeriesShown:!1,shiftToZero:!1,tickPosition:1,tickLabels:!0,nbTicksPrimary:3,nbTicksSecondary:10,ticklabelratio:1,exponentialFactor:0,exponentialLabelFactor:0,logScale:!1,forcedMin:!1,forcedMax:!1,span:[0,1],marginMin:0,marginMax:0,scientificScale:!1,scientificScaleExponent:!1,engineeringScale:!1,unitInTicks:!1,unit:!1,unitWrapperBefore:"",unitWrapperAfter:"",tickLabelOffset:0,useKatexForLabel:!1,highestMax:void 0,lowestMin:void 0,labelValue:""};class h{constructor(){}init(t,e,i){this.unitModificationTimeTicks=[[1,[1,2,5,10,20,30]],[60,[1,2,5,10,20,30]],[3600,[1,2,6,12]],[86400,[1,2,3,4,5,10,20,40]]],this.graph=t,this.options=r.extend(!0,{},o,i,e),this.group=document.createElementNS(this.graph.ns,"g"),this.hasChanged=!0,this.rectEvent=document.createElementNS(this.graph.ns,"rect"),this.rectEvent.setAttribute("pointer-events","fill"),this.rectEvent.setAttribute("fill","transparent"),this.group.appendChild(this.rectEvent),this.graph.axisGroup.appendChild(this.group),this._lines=[],this.line=document.createElementNS(this.graph.ns,"line"),this.line.setAttribute("stroke","black"),this.line.setAttribute("shape-rendering","crispEdges"),this.line.setAttribute("stroke-linecap","square"),this.groupTicks=document.createElementNS(this.graph.ns,"g"),this.groupTickLabels=document.createElementNS(this.graph.ns,"g"),this.group.appendChild(this.groupTicks),this.group.appendChild(this.groupTickLabels),this.group.appendChild(this.line),this.label=document.createElementNS(this.graph.ns,"text"),this.labelTspan=document.createElementNS(this.graph.ns,"tspan"),this.preunit="",this.unitTspan=document.createElementNS(this.graph.ns,"tspan"),this.expTspan=document.createElementNS(this.graph.ns,"tspan"),this.expTspanExp=document.createElementNS(this.graph.ns,"tspan"),this.label.appendChild(this.labelTspan),this.label.appendChild(this.unitTspan),this.label.appendChild(this.expTspan),this.label.appendChild(this.expTspanExp),this.expTspan.setAttribute("dx",6),this.expTspanExp.setAttribute("dy",-5),this.expTspanExp.setAttribute("font-size","0.8em"),this.label.setAttribute("text-anchor","middle"),this.setTickPosition(this.options.tickPosition),this.gridLinePath={primary:"",secondary:""},this.gridPrimary=document.createElementNS(this.graph.ns,"path"),this.gridSecondary=document.createElementNS(this.graph.ns,"path"),this.graph.groupPrimaryGrids.appendChild(this.gridPrimary),this.graph.groupSecondaryGrids.appendChild(this.gridSecondary),this.setGridLinesStyle(),this.group.appendChild(this.label),this.groupSeries=document.createElementNS(this.graph.ns,"g"),this.group.appendChild(this.groupSeries),this.widthHeightTick=0,this.ticks={},this.ticksLabels=[],this.tickScaling={1:3,2:2,3:1,4:.5},this.currentTick={},this.lastCurrentTick={},this.series=[],this.totalDelta=0,this.currentAction=!1,this.group.addEventListener("mousemove",t=>{t.preventDefault();var e=this.graph._getXY(t);this.handleMouseMoveLocal(e.x,e.y,t);for(var i=0,s=this.series.length;i{t.preventDefault();var e=this.graph._getXY(t);this.addLabel(this.getVal(e.x-this.graph.getPaddingLeft()))}),this.gridPrimary.setAttribute("clip-path",`url(#_clipplot${this.graph._creation})`),this.gridSecondary.setAttribute("clip-path",`url(#_clipplot${this.graph._creation})`),this.graph._axisHasChanged(this),this.cache()}handleMouseMoveLocal(){}hide(){return this.options.display=!1,this}show(){return this.options.display=!0,this}setDisplay(t){return this.options.display=!!t,this}isDisplayed(){return this.options.hideWhenNoSeriesShown?this.graph.getSeriesFromAxis(this).reduce((t,e)=>t||e.isShown(),!1):this.options.display}isShown(){return this.isDisplayed(...arguments)}hideGroup(){this._hidden||(this._hidden=!0,this.group.setAttribute("display","none"))}showGroup(){this._hidden&&(this._hidden=!1,this.group.setAttribute("display","initial"))}kill(t,e){this.graph.killAxis(this,t,e)}setLineAt(t){return this.options.lineAt=t,this}adaptTo(t,e,i,s){return t?(this.options.adaptTo={axis:t,thisValue:e,foreignValue:i,preference:s},this.adapt(),this):(this.options.adaptTo=!1,this)}adapt(){if(this.options.adaptTo){var t=this.options.adaptTo.axis,e=this.options.adaptTo.thisValue,i=this.options.adaptTo.foreignValue;if(void 0!==t.options.currentAxisMin&&void 0!==t.options.currentAxisMax||t.setMinMaxToFitSeries(),!1!==this.options.forcedMin&&0==this.options.forcedMax||"max"!==this.options.adaptTo.preference){this.options.currentAxisMin=!1===this.options.forcedMin?this._zoomed?this.getCurrentMin():this.getMinValue()-(e-this.getMinValue())*(this.options.axisDataSpacing.min*(t.getCurrentMax()-t.getCurrentMin())/(i-t.getCurrentMin())):this.options.forcedMin;var s=!1===this.options.forcedMin?this.options.currentAxisMin:this.options.forcedMin;this.options.currentAxisMax=(e-s)*(t.getCurrentMax()-t.getCurrentMin())/(i-t.getCurrentMin())+s}else this.options.currentAxisMax=!1===this.options.forcedMax?this._zoomed?this.getCurrentMax():this.getMaxValue()+(this.getMaxValue()-e)*(this.options.axisDataSpacing.max*(t.getCurrentMax()-t.getCurrentMin())/(t.getCurrentMax()-i)):this.options.forcedMax,this.options.currentAxisMax==e&&(this.options.currentAxisMax+=this.options.axisDataSpacing.max*this.getInterval()),s=!1===this.options.forcedMax?this.options.currentAxisMax:this.options.forcedMax,this.options.currentAxisMin=(e-s)*(t.getCurrentMin()-t.getCurrentMax())/(i-t.getCurrentMax())+s;this.graph._axisHasChanged(this)}}setFloating(t,e){return this.floating=!0,this.floatingAxis=t,this.floatingValue=e,this}getFloatingAxis(){return this.floatingAxis}getFloatingValue(){return this.floatingValue}setAxisDataSpacing(t,e){return this.options.axisDataSpacing.min=t,this.options.axisDataSpacing.max=e||t,this}dataSpacing(){return this.setAxisDataSpacing(...arguments)}setAxisDataSpacingMin(t){this.options.axisDataSpacing.min=t}setAxisDataSpacingMax(t){this.options.axisDataSpacing.max=t}setMinPx(t){this.minPx=t,this.setMinMaxFlipped()}setMaxPx(t){this.maxPx=t,this.setMinMaxFlipped()}getMinPx(){return this.minPxFlipped}getMaxPx(){return this.maxPxFlipped}getMathMaxPx(){return this.maxPx}getMathMinPx(){return this.minPx}getMinValue(){return!1===this.options.forcedMin?isNaN(this.options.lowestMin)?this.dataMin:Math.max(this.options.lowestMin,this.dataMin):this.options.forcedMin}getMaxValue(){return!1===this.options.forcedMax?isNaN(this.options.highestMax)?this.dataMax:Math.min(this.options.highestMax,this.dataMax):this.options.forcedMax}setMinValueData(t){this.dataMin=t,isNaN(this.getCurrentMin())}setMaxValueData(t){this.dataMax=t,isNaN(this.getCurrentMax())}getDataMax(){return this.dataMax}getDataMin(){return this.dataMin}setLowestMin(t){this.options.lowestMin=t,this.graph._axisHasChanged(this)}forceMin(t,e=!1){return this.options.forcedMin=t,this.setCurrentMin(e?this.getCurrentMin():void 0),this.graph._axisHasChanged(this),this}setHighestMax(t){this.options.highestMax=t,this.graph._axisHasChanged(this)}forceMax(t,e=!1){return this.options.forcedMax=t,this.setCurrentMax(e?this.getCurrentMax():void 0),this.graph._axisHasChanged(this),this}getForcedMin(){return this.options.forcedMin}getForcedMax(){return this.options.forcedMax}forceToAxis(t){return t.getMaxValue&&t.getMinValue&&(this.options.forcedMin=t.getMinValue(),this.options.forcedMax=t.getMaxValue()),this}getNbTicksPrimary(){return this.options.nbTicksPrimary}setNbTicksPrimary(t){this.options.nbTicksPrimary=t}getNbTicksSecondary(){return this.options.nbTicksSecondary}setNbTicksSecondary(t){return this.options.nbTicksSecondary=t,this}handleMouseMove(t){this.mouseVal=this.getVal(t)}handleMouseWheel(t,e,i){t=Math.min(.2,Math.max(-.2,t)),"min"==i?i=this.getMinValue():"max"==i?i=this.getMaxValue():i||(i=0),this._doZoomVal((this.getCurrentMax()-i)*(1+t)+i,(this.getCurrentMin()-i)*(1+t)+i),this.graph.draw()}set zoomLock(t){this._zoomLocked=t}get zoomLock(){return this._zoomLocked||!1}zoom(t,e,i){if(i||!this.zoomLock)return this._doZoomVal(t,e,!0)}_doZoomVal(t,e,i){return this._doZoom(this.getPx(t),this.getPx(e),t,e,i)}_doZoom(t,e,i,s,r){return i=void 0===i?this.getVal(t):i,s=void 0===s?this.getVal(e):s,this.setCurrentMin(Math.min(i,s)),this.setCurrentMax(Math.max(i,s)),this.cacheCurrentMin(),this.cacheCurrentMax(),this.cacheInterval(),this._zoomed=!0,this.adapt(),this._hasChanged=!0,r||this.emit("zoom",[this.options.currentAxisMin,this.options.currentAxisMax,this]),this}getSerieShift(){return this._serieShift}getSerieScale(){return this._serieScale}getMouseVal(){return this.mouseVal}getUnitPerTick(t,e,i){var s=i/(e=e?Math.min(e,t/10):t/10);switch(this.options.unitModification){case"time":case"time:min.sec":case"time:min_dec":{let t,e,i,r,a=!1;for(t=0,e=this.unitModificationTimeTicks.length;tthis.getForcedMax()||t>this.options.highestMax||void 0===t))&&(t=this.getMaxValue()),this.options.currentAxisMax=t,this.options.logScale&&(this.options.currentAxisMax=Math.max(1e-50,t)),this.cacheCurrentMax(),this.cacheInterval(),this.graph._axisHasChanged(this)}flip(t){return this.options.flipped=t,this.setMinMaxFlipped(),this}isFlipped(){return this.options.flipped}_draw(){var t=this;void 0!==this.options.currentAxisMin&&void 0!==this.options.currentAxisMax||this.setMinMaxToFitSeries(!0);var e=Math.abs(this.getMaxPx()-this.getMinPx()),i=this.getCurrentInterval();if(!this.isShown())return this.line.setAttribute("display","none"),0;let s;if(this.line.setAttribute("display","block"),this.scientificExponent=1==this.options.scientificScale?this.options.scientificScaleExponent?this.options.scientificScaleExponent:Math.floor(Math.log(Math.max(Math.abs(this.getCurrentMax()),Math.abs(this.getCurrentMin())))/Math.log(10)):0,this.gridLinePath.primary="",this.gridLinePath.secondary="",this.options.useKatexForLabel&&this.graph.hasKatexRenderer()){let t=this.getLabel();this.options.unitDecade&&this.options.unit&&0!==this.scientificExponent&&(this.scientificExponent=this.getEngineeringExponent(this.scientificExponent))&&(s=this.getExponentGreekLetter(this.scientificExponent))?(t+=s,this.preunitTspan.innerHTML=s,this.preunitTspan.setAttribute("display","visible"),this.unitTspan.setAttribute("dx",0),t+=` ${s} ${this.options.unit}`):0===this.scientificExponent||isNaN(this.scientificExponent)||(this.options.engineeringScale&&(this.scientificExponent=this.getEngineeringExponent(this.scientificExponent)),t+=` \\cdot 10^${this.scientificExponent} ${this.options.unit}`),this.katexElement=this.graph.renderWithKatex(t,this.katexElement)}else this.options.unitDecade&&this.options.unit&&0!==this.scientificExponent&&(this.scientificExponent=this.getEngineeringExponent(this.scientificExponent))&&(s=this.getExponentGreekLetter(this.scientificExponent))?(this.preunit=s,this.unitTspan.setAttribute("dx",0)):0===this.scientificExponent||isNaN(this.scientificExponent)?(this.options.unit||this.unitTspan.setAttribute("display","none"),this.preunit="",this.expTspan.setAttribute("display","none"),this.expTspanExp.setAttribute("display","none")):(this.options.engineeringScale&&(this.scientificExponent=this.getEngineeringExponent(this.scientificExponent)),this.preunit="",this.expTspan.setAttribute("display","visible"),this.expTspanExp.setAttribute("display","visible"),this.expTspan.textContent="x10",this.expTspanExp.textContent=this.scientificExponent),this.writeUnit();if(this.options.hideTicks)r=0;else if(this.resetTicksLength(),this.linkedToAxis){this.linkedToAxis.deltaPx=10;var r=this.drawLinkedToAxisTicksWrapper(e,i)}else r=this.options.logScale?this.drawLogTicks():this.drawLinearTicksWrapper(e,i);return this.removeUselessTicks(),this.removeUselessTickLabels(),this.gridPrimary.setAttribute("d",this.gridLinePath.primary),this.gridSecondary.setAttribute("d",this.gridLinePath.secondary),this.graph.findAxesLinkedTo(this).forEach(function(e){e.linkedToAxis&&(e.setMinPx(t.getMinPx()),e.setMaxPx(t.getMaxPx()),e.draw())}),r}drawLines(){this.options.lineAt&&Array.isArray(this.options.lineAt)&&this.options.lineAt.forEach((t,e)=>{!isNaN(t)&&this.getCurrentMin()<=t&&this.getCurrentMax()>=t?this._lines[e]=this._drawLine(t,this._lines[e]):this._hideLine(this._lines[e])})}writeUnit(){this.options.unit?(this.unitTspan.setAttribute("display","visible"),this.unitTspan.setAttribute("dx",5),this.unitTspan.innerHTML=(this.options.unitWrapperBefore+this.preunit+this.options.unit+this.options.unitWrapperAfter).replace(/\^([-+0-9]*)(.*)/g,"$1$2")):this.unitTspan.setAttribute("display","none")}getExponentGreekLetter(t){return 3===t?"k":6===t?"M":9===t?"G":12===t?"T":15===t?"E":-3===t?"m":-6===t?"μ":-9===t?"n":-12===t?"p":-15===t?"f":""}drawLinearTicksWrapper(t,e){let i;return this.options.primaryTickUnit?i=this.options.primaryTickUnit:(i=this.getUnitPerTick(t,this.getNbTicksPrimary(),e)[0],this.options.maxPrimaryTickUnit&&this.options.maxPrimaryTickUniti&&(i=this.options.minPrimaryTickUnit)),this.drawTicks(i,this.secondaryTicks())}forcePrimaryTickUnit(t){this.options.primaryTickUnit=t,this.decimals=Math.max(0,Math.round(-Math.log(t)/Math.log(10)))}forcePrimaryTickUnitMax(t){this.options.maxPrimaryTickUnit=t}forcePrimaryTickUnitMin(t){this.options.minPrimaryTickUnit=t}getPrimaryTickUnit(){return this.incrTick}setTickLabelRatio(t){return this.options.ticklabelratio=t,this}setTickLabelRotation(t){return this.options.tickLabelRotation=t,this}doesHideWhenNoSeriesShown(){return this.options.hideWhenNoSeriesShown}draw(){this._widthLabels=0;var t=this._draw();return this._widthLabels+=t,t}drawTicks(t,e){var i,s,r,a=t,n=this.getCurrentMin(),o=this.getCurrentMax(),h=0;for(e&&(i=a/e),s=this.options.shiftToZero?this.dataMin-Math.ceil((this.dataMin-n)/a)*a:Math.floor(n/a)*a,this.incrTick=t;s<=o&&!(1e3<++h);){if(e){r=s+i,this.subIncrTick=r;for(var l=0;ro||this.drawTickWrapper(r,!1,1e-4>Math.abs(r-s-a/2)?2:3),r+=i}so||this.drawTickWrapper(s,!0,1),s+=t}return this.widthHeightTick=this.getMaxSizeTick(),this.widthHeightTick}nextTick(t,e){if(this.ticks[t]=this.ticks[t]||[],this.lastCurrentTick[t]=this.lastCurrentTick[t]||0,this.currentTick[t]=this.currentTick[t]||0,this.currentTick[t]>=this.ticks[t].length){var i=document.createElementNS(this.graph.ns,"line");this.groupTicks.appendChild(i),this.ticks[t].push(i),e(i)}return i=this.ticks[t][this.currentTick[t]],this.currentTick[t]>=this.lastCurrentTick[t]&&i.setAttribute("display","visible"),this.currentTick[t]++,i}nextTickLabel(t){if(this.ticksLabels=this.ticksLabels||[],this.lastCurrentTickLabel=this.lastCurrentTickLabel||0,this.currentTickLabel=this.currentTickLabel||0,this.currentTickLabel>=this.ticksLabels.length){var e=document.createElementNS(this.graph.ns,"text");this.groupTickLabels.appendChild(e),this.ticksLabels.push(e),t(e)}return e=this.ticksLabels[this.currentTickLabel],this.currentTickLabel>=this.lastCurrentTickLabel&&e.setAttribute("display","visible"),this.currentTickLabel++,e}removeUselessTicks(){for(var t in this.currentTick){for(var e=this.currentTick[t];ei&&(i=1e-50),20i&&(i=0);var r,a=0==i?0:Math.floor(Math.log(i)/Math.log(10));for(i=1;(r=i*Math.pow(10,a))t&&this.drawTickWrapper(r,!0,1,s),10==i?(i=1,a++):(1!=i&&r>t&&this.drawTickWrapper(r,!1,2,{overwrite:"",fontSize:"0.6em"}),i++);return this.widthHeightTick=this.getMaxSizeTick(),this.widthHeightTick}drawTickWrapper(t,e,i,s){this.drawTick(t,i,s)}linkToAxis(t,e,i){this.linkedToAxis={axis:t,scalingFunction:e,decimals:i||1}}drawLinkedToAxisTicksWrapper(t,e){var i,s,r,a,n=this.linkedToAxis,o=0;n.deltaPx||(n.deltaPx=10);do{if(i=n.scalingFunction(n.axis.getVal(o+this.getMinPx())),n.decimals&&(this.decimals=n.decimals),!(s=this.drawTick(i,1,{},o+this.getMinPx())))throw console.error(i,o,this.getMinPx()),new Error("Unable to draw tick. Please report the test-case");if(r=8*(s[1].textContent+"").length,(a=5*Math.round(r/5))>n.deltaPx)return n.deltaPx=a,void this.drawLinkedToAxisTicksWrapper(t,e);o+=n.deltaPx}while(ot?void 0:(Math.log(t)-Math.log(this.getCurrentMin()))/(Math.log(this.getCurrentMax())-Math.log(this.getCurrentMin()))*(this.getMaxPx()-this.getMinPx())+this.getMinPx():(t-this.getCurrentMin())/this.getCurrentInterval()*(this.getMaxPx()-this.getMinPx())+this.getMinPx()}getRoundedPx(t){return Math.round(10*this.getPx(t))/10}getVal(t){return this.options.logScale?Math.exp((t-this.getMinPx())/(this.getMaxPx()-this.getMinPx())*(Math.log(this.getCurrentMax())-Math.log(this.getCurrentMin()))+Math.log(this.getCurrentMin())):(t-this.getMinPx())/(this.getMaxPx()-this.getMinPx())*this.getCurrentInterval()+this.getCurrentMin()}getRelPx(t){return t/this.getCurrentInterval()*(this.getMaxPx()-this.getMinPx())}getRelVal(t){return t/(this.getMaxPx()-this.getMinPx())*this.getCurrentInterval()}setFormatTickLabel(t){return this.options.formatTickLabel=t,this}valueToText(t,e){if(this.scientificExponent)return(t/=Math.pow(10,this.scientificExponent)).toFixed(1);if(this.options.formatTickLabel)return this.options.formatTickLabel(t);if(t=t*Math.pow(10,this.getExponentialFactor())*Math.pow(10,this.getExponentialLabelFactor()),this.options.shiftToZero&&(t-=this.dataMin),this.options.ticklabelratio&&(t*=this.options.ticklabelratio),this.options.unitModification)return this.modifyUnit(t,this.options.unitModification);var i=this.decimals-this.getExponentialFactor()-this.getExponentialLabelFactor();return isNaN(t)?"":(t=0${this.scientificExponent}`),this.options.unit&&!i&&(a+=this.options.unit.replace(/\^([-+0-9]*)/g,"$1")),a}getModifiedValue(t){return this.options.ticklabelratio&&(t*=this.options.ticklabelratio),this.options.shiftToZero&&(t-=this.getMinValue()*(this.options.ticklabelratio||1)),t}modifyUnit(t,e){var i,s="",r=this.incrTick;switch(e){case"time":var a=this.getModifiedValue(this.getMaxValue()),n=[[60,"min"],[3600,"h"],[86400,"d"]];if(3600>a?i=0:86400>a?i=1:2592e3>a&&(i=2),!n[i])return!1;for(t/=n[i][0],s=(o=Math.floor(t))+n[i][1],i--;r<1*n[i+1][0]&&-1{e.setAttribute("fill",t)}),this}getTicksLabelColor(){return this.options.ticksLabelColor||"black"}setPrimaryGridColor(t){return this.options.primaryGridColor=t,this.setGridLinesStyle(),this}getPrimaryGridColor(){return this.options.primaryGridColor}setSecondaryGridColor(t){return this.options.secondaryGridColor=t,this.setGridLinesStyle(),this}getSecondaryGridColor(){return this.options.secondaryGridColor}setPrimaryGridWidth(t){return this.options.primaryGridWidth=t,this.setGridLinesStyle(),this}getPrimaryGridWidth(){return this.options.primaryGridWidth}setSecondaryGridWidth(t){return this.options.secondaryGridWidth=t,this.setGridLinesStyle(),this}getSecondaryGridWidth(){return this.options.secondaryGridWidth}setPrimaryGridOpacity(t){return this.options.primaryGridOpacity=t,this}getPrimaryGridOpacity(){return this.options.primaryGridOpacity}setSecondaryGridOpacity(t){return this.options.secondaryGridOpacity=t,this}getSecondaryGridOpacity(){return this.options.secondaryGridOpacity}setPrimaryGridDasharray(t){return this.options.primaryGridDasharray=t,this}getPrimaryGridDasharray(){return this.options.primaryGridDasharray}setSecondaryGridDasharray(t){return this.options.secondaryGridDasharray=t,this}getSecondaryGridDasharray(){return this.options.secondaryGridDasharray}setLabelColor(t){return this.options.labelColor=t,this}getLabelColor(){return this.options.labelColor}setTickContent(t,e,i){if(i||(i={}),i.overwrite||!i.exponential)t.textContent=i.overwrite||this.valueToText(e);else{var s=Math.round(Math.log(e)/Math.log(10)),r=Math.floor(e*Math.pow(10,-s));t.textContent=1==r?"10":r+"x10";var a=document.createElementNS(this.graph.ns,"tspan");a.textContent=s,a.setAttribute("font-size","0.7em"),a.setAttribute("dy",-5),t.appendChild(a)}i.fontSize&&t.setAttribute("font-size",i.fontSize)}isX(){return!1}isY(){return!1}setUnit(t){return this.options.unit=t,this}setUnitInTicks(t){return this.options.unitInTicks=t,this}setUnitWrapper(t,e){return this.options.unitWrapperBefore=t,this.options.unitWrapperAfter=e,this}setUnitDecade(t){return this.options.unitDecade=t,this}setScientific(t=!0){return this.options.scientificScale=t,this}setScientificScaleExponent(t){return this.options.scientificScaleExponent=t,this}setEngineering(t){return this.options.scientificScale=t,this.options.engineeringScale=t,this}getEngineeringExponent(t){return t-(0{let s=i.getUsedCategories();for(let i of s)t.hasOwnProperty(i)||(t[i]=1,e+=1),t[i]++,e++});let i=0;for(let e in t){let s=t[e];t[e]=i,i+=s}let s={};Array.prototype.map.call(this.series,i=>{let r=i.getUsedCategories(),a={};r.forEach(i=>{s[i]=s[i]||.5,a[i]=(t[i]+s[i])/e,s[i]++}),i.setDataIndices(a,e)})}getType(){return"category"}}i.default=a,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},1127:function(t,e,i){var s,r,a;r=[e,i(22)],void 0===(a="function"==typeof(s=function(i,s){"use strict";var r;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=(r=s)&&r.__esModule?r:{default:r};class a extends s.default{constructor(t,e,i={}){super(t,e,i),this.top="top"==e}getAxisPosition(){if(!this.options.display)return 0;let t;return 0==this.options.tickLabelOffset?(t=1==this.options.tickPosition?8:20,t+=this.graph.options.fontSize):t=1==this.options.tickPosition?0:12,this.getLabel()&&(t+=this.graph.options.fontSize),t}isX(){return!0}isY(){return!1}forceHeight(t){return this.options.forcedHeight=t,this}setShift(t){this.shift=t,void 0===t||isNaN(t)||!this.graph.getDrawingHeight()||isNaN(this.graph.getDrawingHeight())||this.group.setAttribute("transform",`translate(0 ${this.floating?this.getShift():this.top?this.shift:this.graph.getDrawingHeight()-this.shift})`)}getMaxSizeTick(){return(this.top?-1:1)*(this.options.tickPosition,10)}drawTick(t,e,i,s){var r,a=this;if(null==(r=s||this.getPos(t))||isNaN(r))return;var n=this.nextTick(e,t=>{t.setAttribute("y1",(a.top?1:-1)*a.tickPx1*a.tickScaling[e]),t.setAttribute("y2",(a.top?1:-1)*a.tickPx2*a.tickScaling[e]),1==e?t.setAttribute("stroke",a.getPrimaryTicksColor()):t.setAttribute("stroke",a.getSecondaryTicksColor())});n.setAttribute("x1",r),n.setAttribute("x2",r),this.nextGridLine(1==e,r,r,0,this.graph.getDrawingHeight());const o=(a.top?-1:1)*((1==a.options.tickPosition?8:20)+(a.top?10:0))+this.options.tickLabelOffset;if(1==e&&this.options.tickLabels){var h=this.nextTickLabel(t=>{t.setAttribute("y",o),t.setAttribute("text-anchor","middle"),"black"!==a.getTicksLabelColor()&&t.setAttribute("fill",a.getTicksLabelColor())});h.setAttribute("x",r),this.options.tickLabelRotation?(0>this.options.tickLabelRotation?h.setAttribute("text-anchor","end"):h.setAttribute("text-anchor","start"),h.setAttribute("dominant-baseline","middle"),h.setAttribute("transform",`translate( ${r}, ${o} ) rotate(${this.options.tickLabelRotation}) translate( ${-r}, ${-o} )`)):h.setAttribute("dominant-baseline","hanging"),this.setTickContent(h,t,i)}return[n,h]}drawLabel(){"black"!==this.getLabelColor()&&this.label.setAttribute("fill",this.getLabelColor()),this.options.labelFont&&this.label.setAttribute("font-family",this.options.labelFont),this.label.setAttribute("text-anchor","middle"),this.label.setAttribute("style","display: initial;"),this.label.setAttribute("x",Math.abs(this.getMaxPx()+this.getMinPx())/2),this.label.setAttribute("y",(this.top?-1:1)*((1==this.options.tickPosition?10:25)+this.graph.options.fontSize)),this.labelTspan.textContent=this.getLabel()}draw(){var t=super.draw(...arguments);return this.drawSpecifics(),t}drawSpecifics(){this.drawLabel(),this.line.setAttribute("x1",this.getMinPx()),this.line.setAttribute("x2",this.getMaxPx()),this.line.setAttribute("y1",0),this.line.setAttribute("y2",0),this.line.setAttribute("stroke",this.getAxisColor()),this.top||(this.labelTspan.style.dominantBaseline="hanging",this.expTspan.style.dominantBaseline="hanging",this.expTspanExp.style.dominantBaseline="hanging",this.unitTspan.style.dominantBaseline="hanging");var t=this.getSpan();this.line.setAttribute("marker-start",this.options.splitMarks&&0!=t[0]?`url(#horionzalsplit_${this.graph.getId()})`:""),this.line.setAttribute("marker-end",this.options.splitMarks&&1!=t[1]?`url(#horionzalsplit_${this.graph.getId()})`:"")}_drawLine(t,e){let i=this.getPx(t);return e?e.setAttribute("display","initial"):e=document.createElementNS(this.graph.ns,"line"),e.setAttribute("x1",i),e.setAttribute("x2",i),e.setAttribute("y1",0),e.setAttribute("y2",this.graph.drawingSpaceHeight),e.setAttribute("stroke","black"),this.group.appendChild(e),e}_hideLine(t){t&&t.setAttribute("display","none")}handleMouseMoveLocal(t){t-=this.graph.getPaddingLeft(),this.mouseVal=this.getVal(t)}setMinMaxFlipped(){var t=this.maxPx-this.minPx;if(!isNaN(t)){var e=t*this.options.span[1]+this.minPx-this.options.marginMax,i=t*this.options.span[0]+this.minPx+this.options.marginMin;this.minPxFlipped=this.isFlipped()?e:i,this.maxPxFlipped=this.isFlipped()?i:e}}getZProj(t){return t*this.graph.options.zAxis.shiftX}}i.default=a,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},4477:function(t,e,i){var s,r,a;r=[e,i(22),i(2458)],void 0===(a="function"==typeof(s=function(i,s,r){"use strict";function g(t,e){return Math.round(t/e)*e}function c(t,e){switch(e.unit){case"s":t.setSeconds(g(t.getSeconds(),e.increment)),t.setMilliseconds(0);break;case"i":t.setMinutes(g(t.getMinutes(),e.increment)),t.setSeconds(0),t.setMilliseconds(0);break;case"h":t.setHours(g(t.getHours(),e.increment)),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0);break;case"d":t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t.setHours(0),t.setDate(g(t.getDate(),e.increment));break;case"m":t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t.setHours(0),t.setDate(1),t.setMonth(g(t.getMonth(),e.increment));break;case"y":t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t.setHours(0),t.setDate(1),t.setMonth(0);break;default:throw new Error("Date format not recognized");}return t}function f(t,e){switch(e.unit){case"s":t.setSeconds(t.getSeconds()+e.increment),t.setMilliseconds(0);break;case"i":t.setMinutes(t.getMinutes()+e.increment),t.setSeconds(0),t.setMilliseconds(0);break;case"h":t.setHours(t.getHours()+e.increment),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0);break;case"d":t.setDate(t.getDate()+e.increment),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t.setHours(0);break;case"m":t.setMonth(t.getMonth()+e.increment),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t.setHours(0),t.setDate(1);break;case"y":t.setFullYear(t.getFullYear()+e.increment),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t.setHours(0),t.setDate(1),t.setMonth(0);break;default:throw new Error("Date format not recognized");}return t}function x(t,e,i){if(t.groups[e][i])return t.groups[e][i].group.setAttribute("display","block"),t.groups[e][i];var s={group:document.createElementNS(t.graph.ns,"g"),text:document.createElementNS(t.graph.ns,"text")},r=document.createElementNS(t.graph.ns,"line");switch(r.setAttribute("stroke","black"),r.setAttribute("y1",0),e){case 2:r.setAttribute("y2",6),s.text.setAttribute("y",15),s.line=r,s.group.appendChild(s.line);break;default:case 1:r.setAttribute("y2",20),s.text.setAttribute("y",10),s.line1=r,s.line2=r.cloneNode(),s.group.appendChild(s.line1),s.group.appendChild(s.line2);}return s.text.setAttribute("text-anchor","middle"),s.text.setAttribute("dominant-baseline","middle"),s.group.appendChild(s.text),t.getWrapper(e).appendChild(s.group),t.groups[e][i]=s}function m(t,e,i){for(;ir)return void y(e);e.line.setAttribute("x1",a),e.line.setAttribute("x2",a),e.text.setAttribute("x",a),e.text.textContent=i;break;default:case 1:var o=Math.max(s,Math.min(r,a)),h=Math.max(s,Math.min(r,n));if(isNaN(h)||isNaN(o))return;for(e.line1.setAttribute("x1",o),e.line2.setAttribute("x1",h),e.line1.setAttribute("x2",o),e.line2.setAttribute("x2",h),e.text.setAttribute("x",(o+h)/2);8*i.length>h-o;)if(1==(i=i.substr(0,i.length-2)+".").length){i="";break}e.text.textContent=i;}}var a;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=(a=s)&&a.__esModule?a:{default:a},r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(r);var n,o,h,l,u,d=[{threshold:20,increments:{1:{increment:1,unit:"i",format:"HH\"h\"MM (dd/mm/yy)"},2:{increment:1,unit:"s",format:"MM:ss\"s\""}}},{threshold:50,increments:{1:{increment:1,unit:"i",format:"HH\"h\"MM (dd/mm/yy)"},2:{increment:2,unit:"s",format:"MM:ss\"s\""}}},{threshold:100,increments:{1:{increment:1,unit:"i",format:"HH\"h\"MM (dd/mm/yy)"},2:{increment:5,unit:"s",format:"MM:ss\"s\""}}},{threshold:600,increments:{1:{increment:10,unit:"i",format:"HH\"h\"MM (dd/mm/yy)"},2:{increment:30,unit:"s",format:"MM:ss\"s\""}}},{threshold:1e3,increments:{1:{increment:1,unit:"h",format:"HH\"h\"MM (dd/mm/yy)"},2:{increment:10,unit:"i",format:"MM\"min\""}}},{threshold:1500,increments:{1:{increment:1,unit:"d",format:"dd/mm/yyyy"},2:{increment:1,unit:"i",format:"H\"h\"MM"}}},{threshold:3e3,increments:{1:{increment:1,unit:"d",format:"dd/mm/yyyy"},2:{increment:2,unit:"i",format:"H\"h\"MM"}}},{threshold:8e3,increments:{1:{increment:1,unit:"d",format:"dd/mm/yyyy"},2:{increment:10,unit:"i",format:"H\"h\"MM"}}},{threshold:26400,increments:{1:{increment:1,unit:"d",format:"dd/mm/yyyy"},2:{increment:20,unit:"i",format:"H\"h\"MM"}}},{threshold:86400,increments:{1:{increment:1,unit:"d",format:"dd/mm/yyyy"},2:{increment:1,unit:"h",format:"H\"h\"MM"}}},{threshold:2e5,increments:{1:{increment:1,unit:"d",format:"dd/mm/yyyy"},2:{increment:2,unit:"h",format:"H\"h\"MM"}}},{threshold:4e5,increments:{1:{increment:1,unit:"d",format:"dd/mm/yyyy"},2:{increment:6,unit:"h",format:"H\"h\"MM"}}},{threshold:14e5,increments:{1:{increment:1,unit:"d",format:"dd/mm/yyyy"},2:{increment:12,unit:"h",format:"HH\"h\"MM"}}},{threshold:64e5,increments:{1:{increment:1,unit:"m",format:"mmmm yyyy"},2:{increment:1,unit:"d",format:"dd"}}},{threshold:124e5,increments:{1:{increment:1,unit:"m",format:"mmmm yyyy"},2:{increment:2,unit:"d",format:"dd"}}},{threshold:432e5,increments:{1:{increment:1,unit:"m",format:"mmmm yyyy"},2:{increment:7,unit:"d",format:"dd"}}},{threshold:6912e4,increments:{1:{increment:1,unit:"m",format:"mmmm yyyy"},2:{increment:15,unit:"d",format:"dd"}}},{threshold:864e5,increments:{1:{increment:1,unit:"y",format:"yyyy"},2:{increment:3,unit:"m",format:"mm/yyyy"}}},{threshold:1728e5,increments:{1:{increment:1,unit:"y",format:"yyyy"},2:{increment:4,unit:"m",format:"mm/yyyy"}}},{threshold:864e6,increments:{1:{increment:1,unit:"y",format:"yyyy"},2:{increment:6,unit:"m",format:"mm/yyyy"}}},{threshold:10368e5,increments:{1:{increment:1,unit:"y",format:"yyyy"},2:{increment:1,unit:"y",format:"yyyy"}}}],p=(n=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[WLloSZ]|"[^"]*"|'[^']*'/g,o=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,h=/[^-+\dA-Z]/g,l=function(t,e){for(t=t+"",e=e||2;t.lengthf?"a":"p",tt:12>f?"am":"pm",T:12>f?"A":"P",TT:12>f?"AM":"PM",Z:i?"UTC":((t+"").match(o)||[""]).pop().replace(h,""),o:(0i){t=d[g];break}t||(t=d[d.length-1]);var n,o,h,l,u,g,y,v,M=0;for(M=1;2>=M;M++){if(!r.isNumeric(a)){m(this,M,0);break}h=c(new Date(a),t.increments[M]),g=0;do if(y=h,v=t.increments[M].format,l=p(y,v),u=x(this,M,g),n=this.getPx(h.getTime()),h=f(h,t.increments[M]),o=this.getPx(h.getTime()),b(M,u,l,this.getMinPx(),this.getMaxPx(),n,o),100<++g)break;while(h.getTime(){t.setAttribute("x1",(this.left?1:-1)*this.tickPx1*this.tickScaling[e]),t.setAttribute("x2",(this.left?1:-1)*this.tickPx2*this.tickScaling[e]),1==e?t.setAttribute("stroke",this.getPrimaryTicksColor()):t.setAttribute("stroke",this.getSecondaryTicksColor())}),a.setAttribute("y1",r),a.setAttribute("y2",r),this.nextGridLine(1==e,0,this.graph.getDrawingWidth(),r,r),1==e&&this.options.tickLabel&&(n=this.nextTickLabel(t=>{t.setAttribute("x",this.tickMargin+this.options.tickLabelOffset),"black"!==this.getTicksLabelColor()&&t.setAttribute("fill",this.getTicksLabelColor()),this.left?t.setAttribute("text-anchor","end"):t.setAttribute("text-anchor","start"),t.style.dominantBaseline="central"}),n.setAttribute("y",r),this.setTickContent(n,t,i),(n.textContent+"").length>=this.longestTick[1]&&(this.longestTick[0]=n,this.longestTick[1]=(n.textContent+"").length)))}drawLabel(){"black"!==this.getLabelColor()&&this.label.setAttribute("fill",this.getLabelColor()),this.label.setAttribute("dominant-baseline",(this.left,"auto")),this.labelTspan.textContent=this.getLabel()}placeLabel(t){this.label.setAttribute("transform",`translate(${t}, ${Math.abs(this.getMaxPx()+this.getMinPx())/2}) rotate(-90)`)}drawSpecifics(){this.line.setAttribute("y1",this.getMinPx()),this.line.setAttribute("y2",this.getMaxPx()),this.line.setAttribute("x1",0),this.line.setAttribute("x2",0),this.line.setAttribute("stroke",this.getAxisColor());var t=this.getSpan();this.line.setAttribute("marker-start",this.options.splitMarks&&0!=t[0]?`url(#verticalsplit_${this.graph.getId()})`:""),this.line.setAttribute("marker-end",this.options.splitMarks&&1!=t[1]?`url(#verticalsplit_${this.graph.getId()})`:"")}setShift(t){if(this.shift=t,!this.shift||!this.graph.getWidth())return;let e=this.shift;e=this.floating||this.isLeft()?e:this.graph.getWidth()-this.graph.getPaddingRight()-this.graph.getPaddingLeft()-e,this.group.setAttribute("transform",`translate( ${e} 0 )`),this.drawLabel()}isLeft(){return this.left}isRight(){return!this.left}isFlipped(){return!this.options.flipped}_drawLine(t,e){let i=this.getPx(t);return e?e.setAttribute("display","initial"):e=document.createElementNS(this.graph.ns,"line"),e.setAttribute("y1",i),e.setAttribute("y2",i),e.setAttribute("x1",0),e.setAttribute("x2",this.graph.drawingSpaceWidth),e.setAttribute("stroke","black"),this.group.appendChild(e),e}_hideLine(t){t&&t.setAttribute("display","none")}handleMouseMoveLocal(t,e){e-=this.graph.getPaddingTop(),this.mouseVal=this.getVal(e)}scaleToFitAxis(t,e,i,s,r,a){t&&t.isX()||(t=this.graph.getXAxis()),isNaN(i)&&(i=t.getCurrentMin()),isNaN(s)&&(s=t.getCurrentMax()),void 0===r&&(r=!0),void 0===a&&(a=!0),"number"==typeof e&&(s=i,i=e,e=!1);for(var n=-1/0,o=1/0,h=0,l=0,u=this.graph.series.length;le[i][a][1]&&t[1]>e[i][a][1]||(r=!1);if(r)return e[i].push(t),i}return e.push([t]),e.length-1}function g(t,e,i){return t.forcedPlugin?(t.activePlugin=t.forcedPlugin,void t._pluginExecute(t.activePlugin,i,[t,e])):void!function(t,e,i,s){var r,a,n=t.options.keyActions;for(r=0,a=n.length;r{t.kill(n[r].keepInDom)}))}}(t,e,[t,e],i)}function c(){this.dom=document.createElementNS(d.ns,"svg"),this.dom.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),r.setAttributeTo(this.dom,{xmlns:d.ns,"font-family":this.options.fontFamily,"font-size":this.options.fontSize});try{r.setAttributeTo(this.dom,{"data-jsgraph-version":"v2.4.5"})}catch(t){}this.defs=document.createElementNS(d.ns,"defs"),this.dom.appendChild(this.defs),this.groupEvent=document.createElementNS(d.ns,"g"),this.rectEvent=document.createElementNS(d.ns,"rect"),r.setAttributeTo(this.rectEvent,{"pointer-events":"fill",fill:"transparent"}),this.groupEvent.appendChild(this.rectEvent),this.dom.appendChild(this.groupEvent),this.domTitle=document.createElementNS(d.ns,"text"),this.setTitle(this.options.title),this.options.titleFontSize&&this.setTitleFontSize(this.options.titleFontSize),this.options.titleFontColor&&this.setTitleFontSize(this.options.titleFontColor),this.options.titleFontFamily&&this.setTitleFontFamily(this.options.titleFontFamily),r.setAttributeTo(this.domTitle,{"text-anchor":"middle",y:20}),this.groupEvent.appendChild(this.domTitle),this.graphingZone=document.createElementNS(d.ns,"g"),this.updateGraphingZone(),this.groupEvent.appendChild(this.graphingZone),this.axisGroup=document.createElementNS(d.ns,"g"),this.graphingZone.appendChild(this.axisGroup),this.groupGrids=document.createElementNS(d.ns,"g"),this.groupPrimaryGrids=document.createElementNS(d.ns,"g"),this.groupSecondaryGrids=document.createElementNS(d.ns,"g"),this.axisGroup.appendChild(this.groupGrids),this.groupGrids.appendChild(this.groupSecondaryGrids),this.groupGrids.appendChild(this.groupPrimaryGrids),this.plotGroup=document.createElementNS(d.ns,"g"),this.graphingZone.appendChild(this.plotGroup),this.layers=[],this._makeClosingLines(),this.clip=document.createElementNS(d.ns,"clipPath"),this.clip.setAttribute("id","_clipplot"+this._creation),this.defs.appendChild(this.clip),this.clipRect=document.createElementNS(d.ns,"rect"),this.clip.appendChild(this.clipRect),this.clip.setAttribute("clipPathUnits","userSpaceOnUse"),this.markerArrow=document.createElementNS(this.ns,"marker"),this.markerArrow.setAttribute("viewBox","0 0 10 10"),this.markerArrow.setAttribute("id","arrow"+this._creation),this.markerArrow.setAttribute("refX","6"),this.markerArrow.setAttribute("refY","5"),this.markerArrow.setAttribute("markerUnits","strokeWidth"),this.markerArrow.setAttribute("markerWidth","8"),this.markerArrow.setAttribute("markerHeight","6"),this.markerArrow.setAttribute("orient","auto");var t,e=document.createElementNS(d.ns,"path");e.setAttribute("d","M 0 0 L 10 5 L 0 10 z"),this.markerArrow.appendChild(e),this.defs.appendChild(this.markerArrow),this.markerHorizontalSplit=document.createElementNS(d.ns,"marker"),this.markerHorizontalSplit.setAttribute("viewBox","0 0 6 8"),this.markerHorizontalSplit.setAttribute("id","horionzalsplit_"+this.getId()),this.markerHorizontalSplit.setAttribute("refX","3"),this.markerHorizontalSplit.setAttribute("refY","4"),this.markerHorizontalSplit.setAttribute("markerUnits","strokeWidth"),this.markerHorizontalSplit.setAttribute("markerWidth","6"),this.markerHorizontalSplit.setAttribute("markerHeight","8"),(t=document.createElementNS(d.ns,"line")).setAttribute("x1","0"),t.setAttribute("y1","8"),t.setAttribute("x2","6"),t.setAttribute("y2","0"),t.setAttribute("stroke","black"),this.markerHorizontalSplit.appendChild(t),this.defs.appendChild(this.markerHorizontalSplit),this.markerVerticalSplit=document.createElementNS(d.ns,"marker"),this.markerVerticalSplit.setAttribute("viewBox","0 0 8 6"),this.markerVerticalSplit.setAttribute("id","verticalsplit_"+this.getId()),this.markerVerticalSplit.setAttribute("refX","4"),this.markerVerticalSplit.setAttribute("refY","3"),this.markerVerticalSplit.setAttribute("markerUnits","strokeWidth"),this.markerVerticalSplit.setAttribute("markerWidth","8"),this.markerVerticalSplit.setAttribute("markerHeight","6"),(t=document.createElementNS(d.ns,"line")).setAttribute("x1","0"),t.setAttribute("y1","0"),t.setAttribute("x2","8"),t.setAttribute("y2","6"),t.setAttribute("stroke","black"),this.markerVerticalSplit.appendChild(t),this.defs.appendChild(this.markerVerticalSplit),this.vertLineArrow=document.createElementNS(d.ns,"marker"),this.vertLineArrow.setAttribute("viewBox","0 0 10 10"),this.vertLineArrow.setAttribute("id","verticalline"+this._creation),this.vertLineArrow.setAttribute("refX","0"),this.vertLineArrow.setAttribute("refY","5"),this.vertLineArrow.setAttribute("markerUnits","strokeWidth"),this.vertLineArrow.setAttribute("markerWidth","20"),this.vertLineArrow.setAttribute("markerHeight","10"),this.vertLineArrow.setAttribute("orient","auto"),this.vertLineArrow.setAttribute("stroke-width","1px");var i=document.createElementNS(d.ns,"path");i.setAttribute("d","M 0 -10 L 0 10"),i.setAttribute("stroke","black"),this.vertLineArrow.appendChild(i),this.defs.appendChild(this.vertLineArrow),this.bypassHandleMouse=!1}function f(t,e,i,s){var r,a,n=t.options.mouseActions,o=!1;for(r=0,a=n.length;r{g(t,e,"keydown")}),t.dom.addEventListener("keypress",e=>{g(t,e,"keypress")}),t.dom.addEventListener("keyup",e=>{g(t,e,"keyup")}),t.dom.addEventListener("mousemove",e=>{var i=t._getXY(e);!function(t,e,i,s){if(t.bypassHandleMouse)return void t.bypassHandleMouse.handleMouseMove(s);if(t.activePlugin&&t._pluginExecute(t.activePlugin,"onMouseMove",[t,e,i,s]))return;let r,a=e;var n;if(t._applyToAxes("handleMouseMove",[e-t.options.paddingLeft,s],!0,!1),t._applyToAxes("handleMouseMove",[i-t.options.paddingTop,s],!1,!0),!t.activePlugin&&t.options.trackingLine&&t.options.trackingLine.enable)if("common"==t.options.trackingLine.mode&&t.options.trackingLine.snapToSerie){var o=t.options.trackingLine.snapToSerie;n=o.handleMouseMove(!1,!0),t.trackingLineShape&&(n?(t.trackingLineShape.show(),t.trackingLineShape.getPosition(0).x=n.xClosest,t.trackingLineShape.getPosition(1).x=n.xClosest,t.trackingLineShape.redraw(),r=n.xClosest,a=o.getXAxis().getPx(n.xClosest)+t.options.paddingLeft):t.trackingLineShape.hide());var h=t.options.trackingLine.series;if(!h)return;if(!n)return;t._trackingLegend=x(t,h,a,i,t._trackingLegend,t.options.trackingLine.textMethod?t.options.trackingLine.textMethod:b,r)}else if("individual"==t.options.trackingLine.mode){const r=[];t.options.trackingLine.series.forEach(a=>{if(a.options.tracking){const n=a.getClosestPointToXY(a.getXAxis().getMouseVal(),a.getYAxis().getMouseVal(),a.options.tracking.withinPx,a.options.tracking.withinPx,a.options.tracking.useAxis,!0);"common"==t.options.trackingLine.legendType&&(a._trackingLegend=x(t,[],!1,!1,a._trackingLegend)),n?a.trackingShape&&(a.trackingShape.show(),a.trackingShape.setPosition({x:n.xClosest,y:n.yClosest}),a.trackingShape.redraw(),"independent"==t.options.trackingLine.legendType&&(a._trackingLegend=x(t,[{serie:a,closestPoint:n}],e,i,a._trackingLegend)),a.emit("track",s,n)):a.trackingShape&&(a.trackingShape.hide(),"independent"==t.options.trackingLine.legendType&&(a._trackingLegend=x(t,[],!1,!1,a._trackingLegend))),n&&r.push({serie:a,closestPoint:n})}}),t._trackingLegend="common"==t.options.trackingLine.legendType?x(t,r,e,i,t._trackingLegend):x(t,[],!1,!1,t._trackingLegend)}if(t.options.mouseMoveData){const e={};for(let s,i=0;i{!function(t){t.options.handleMouseLeave&&t.options.handleMouseLeave.call(t)}(t)}),t.groupEvent.addEventListener("mousedown",e=>{if(t.focus(),3!=e.which&&!e.ctrlKey){var i=t._getXY(e);!function(t,e,i,s){return t.forcedPlugin?(t.activePlugin=t.forcedPlugin,void t._pluginExecute(t.activePlugin,"onMouseDown",[t,e,i,s])):void(t.activePlugin&&(t.activePlugin=!1),f(t,s,[t,e,i,s],"onMouseDown"))}(t,i.x,i.y,e)}}),t.dom.addEventListener("mouseup",e=>{t.emit("mouseUp",e);var i=t._getXY(e);!function(t,e,i,s){return t.bypassHandleMouse?(t.bypassHandleMouse.handleMouseUp(s),void(t.activePlugin=!1)):void(t._pluginExecute(t.activePlugin,"onMouseUp",[t,e,i,s]),t.activePlugin=!1)}(t,i.x,i.y,e)}),t.wrapper.addEventListener("mouseup",t=>{t.stopPropagation()}),t.dom.addEventListener("dblclick",e=>{t.emit("dblClick",e);var i=t._getXY(e);!function(t,e,i,s){f(t,s,[e,i,s],"onDblClick")}(t,i.x,i.y,e)}),t.groupEvent.addEventListener("click",e=>{if(3!=e.which&&!e.ctrlKey){var i=t._getXY(e);t.prevent(!1)||function(t,e,i,s){t.emit("click",[t,e,i,s]),f(t,s,[e,i,s],"onClick"),s.target.jsGraphIsShape||t.prevent(!1)||!t.options.shapesUnselectOnClick||t.unselectShapes()}(t,i.x,i.y,e)}}),t.groupEvent.addEventListener("mousewheel",e=>{var i=e.wheelDeltaY||e.wheelDelta||-e.deltaY,s=t._getXY(e);return A(t,i,s.x,s.y,e),!1}),t.groupEvent.addEventListener("wheel",e=>{var i=t._getXY(e),s=e.wheelDeltaY||e.wheelDelta||-e.deltaY;return A(t,s,i.x,i.y,e),!1})}(this)}getDom(){return this.dom}getId(){return this._creation}getWrapper(){return this.wrapper}setOption(t,e){return this.options[t]=e,this}setTitle(t){this.options.title=t,this.domTitle.textContent=t}setTitleFontSize(t){this.domTitle.setAttribute("font-size",t)}setTitleFontColor(t){this.domTitle.setAttribute("fill",t)}setTitleFontFamily(t){this.domTitle.setAttribute("font-family",t)}displayTitle(){this.domTitle.setAttribute("display","inline")}hideTitle(){this.domTitle.setAttribute("display","none")}hide(){"none"!==this.dom.style.display&&(this.dom.style.display="none")}show(){"none"==this.dom.style.display&&(this.dom.style.display="initial")}redraw(t,e){if(this.width&&this.height)return this.sizeSet?!t||e||(s=(i=this)._axesHaveChanged,i._axesHaveChanged=!1,s)||function(t){var e=t._sizeChanged;return t._sizeChanged=!1,e}(this)?(this.executeRedrawSlaves(),function(t){var e={top:[],bottom:[],left:[],right:[]},i={top:[],bottom:[],left:[],right:[]};t._painted=!0,t._applyToAxes(function(t,s){if(!t.isShown())t.hideGroup();else if(t.showGroup(),!t.floating){var r=p(t.getSpan(),i[s]);t.setLevel(r),e[s][r]=Math.max(t.getAxisPosition(),e[s][r]||0)}},!1,!0,!1);var s=e.top.reduce(function(t,e){return t+e},0),a=e.bottom.reduce(function(t,e){return t+e},0);t.drawingSpaceHeight=t.getDrawingHeight()-s-a,[e.top,e.bottom].map(function(t){t.reduce(function(e,i,s){return t[s]=e+i,e+i},0)}),t._applyToAxes(function(t,i){t.isShown()&&!t.floating&&t.setShift(e[i][t.getLevel()])},!1,!0,!1),t._applyToAxes(function(r,n){if(r.isShown()?r.showGroup():r.hideGroup(),r.setMinPx(s),r.setMaxPx(t.getDrawingHeight(!0)-a),!r.floating){let o=r.linkedToAxis?0:r.draw();if(r.isShown()){var h=p(r.getSpan(),i[n]);r.setLevel(h),r.options.forcedWidth?e[n][h]=r.options.forcedWidth:(e[n][h]=Math.max(o,e[n][h]||0),h{t.isShown()&&!t.floating&&t.setShift(e[i][t.getLevel()])},!1,!1,!0),t._applyToAxes(function(e){e.isShown(),e.setMinPx(o),e.setMaxPx(t.getDrawingWidth(!0)-h),e.floating||e.linkedToAxis||e.draw()},!1,!0,!1),t._applyToAxes(function(t){if(t.floating){var e=t.getFloatingAxis(),i=t.getFloatingValue(),s=e.getPx(i);t.setShift(s),t.linkedToAxis||t.draw()}},!1,!0,!0),M(t,"right",t.getDrawingWidth(!0),t.getDrawingWidth(!0),s,t.getDrawingHeight(!0)-a),M(t,"left",0,0,s,t.getDrawingHeight(!0)-a),M(t,"top",o,t.getDrawingWidth(!0)-h,0,0),M(t,"bottom",o,t.getDrawingWidth(!0)-h,t.getDrawingHeight(!0)-a,t.getDrawingHeight(!0)-a),t.clipRect.setAttribute("y",s),t.clipRect.setAttribute("x",o),t.clipRect.setAttribute("width",t.getDrawingWidth()-o-h),t.clipRect.setAttribute("height",t.getDrawingHeight()-s-a),t.rectEvent.setAttribute("y",s+t.getPaddingTop()),t.rectEvent.setAttribute("x",o+t.getPaddingLeft()),t.rectEvent.setAttribute("width",t.drawingSpaceWidth),t.rectEvent.setAttribute("height",t.drawingSpaceHeight),t.drawingSpaceMinX=o+t.getPaddingLeft(),t.drawingSpaceMinY=s+t.getPaddingTop(),t.drawingSpaceMaxX=t.getDrawingWidth()-h+t.getPaddingLeft(),t.drawingSpaceMaxY=t.getDrawingHeight()-a+t.getPaddingTop(),t._applyToAxes(function(t){t.isShown()&&t.drawLines()},!1,!0,!0),t.shift=e,t.redrawShapes()}(this),!0):(this.executeRedrawSlaves(!0),!1):(this._resize(),this.executeRedrawSlaves(),!0);var i,s}executeRedrawSlaves(){this._pluginsExecute("preDraw")}draw(t){this.drawn=!0,this.updateLegend(!0),this.drawSeries(this.redraw(!0,t)),this._pluginsExecute("postDraw")}delayUpdate(){return this._lockUpdate=!0,this}doUpdate(){return this.legend&&this.legend.update(),this.draw(),this.legend&&this.legend.update(),this}resumeUpdate(){return this._lockUpdate=!1,this}isDelayedUpdate(){return this._lockUpdate}setWidth(t,e){this.width=t,e||this._resize()}setHeight(t,e){this.height=t,e||this._resize()}resize(t,e){return t&&e&&this.setSize(t,e),this._resize(),this}setSize(t,e){this.setWidth(t,!0),this.setHeight(e,!0),this.getDrawingHeight(),this.getDrawingWidth()}getWidth(){return this.width}getHeight(){return this.height}getPaddingTop(){return this.options.paddingTop}getPaddingLeft(){return this.options.paddingLeft}getPaddingBottom(){return this.options.paddingBottom}getPaddingRight(){return this.options.paddingRight}getDrawingHeight(t){return t&&this.innerHeight?this.innerHeight:this.innerHeight=this.height-this.options.paddingTop-this.options.paddingBottom}getDrawingWidth(t){return t&&this.innerWidth?this.innerWidth:this.innerWidth=this.width-this.options.paddingLeft-this.options.paddingRight}cacheOffset(){this.offsetCached=r.getOffset(this.wrapper)}uncacheOffset(){this.offsetCached=!1}getNumAxes(t){return this.axis[t].length}getXAxis(t,e){return 0{e.getXAxis()==t&&e.kill()})),t.isY()&&(-1<(s=this.axis.left.indexOf(t))&&this.axis.left.splice(s,1),-1<(s=this.axis.right.indexOf(t))&&this.axis.right.splice(s,1),i||this.series.forEach(e=>{e.getYAxis()==t&&e.kill()})),this.axisGroup.removeChild(t.group),this.groupPrimaryGrids.removeChild(t.gridPrimary),this.groupSecondaryGrids.removeChild(t.gridSecondary),e||this.draw(!0)}hasXAxis(t){return this.hasTopAxis(t)||this.hasBottomAxis(t)}hasYAxis(t){return this.hasLeftAxis(t)||this.hasRightAxis(t)}hasTopAxis(t){return this.hasAxis(t,this.axis.top)}hasBottomAxis(t){return this.hasAxis(t,this.axis.bottom)}hasLeftAxis(t){return this.hasAxis(t,this.axis.left)}hasRightAxis(t){return this.hasAxis(t,this.axis.right)}hasAxis(t,e){for(var i=0,s=e.length;i{t.gridsOff()},void 0,!0,!0)}gridsOn(){this._applyToAxes(t=>{t.gridsOn()},void 0,!0,!0)}setBackgroundColor(t){return this.rectEvent.setAttribute("fill",t),this}getAxisState(){var t={};for(var e in this.axis)t[e]=this.axis[e].map(function(t){return[t.getCurrentMin(),t.getCurrentMax()]});return t}setAxisState(t){var e,i;for(var s in t)if(this.axis[s])for(e=0,i=t[s].length;et.include(e.getType()))}sortSeries(t){return"function"!=typeof t||this.series.sort(t),this}drawSerie(t,e){if(!t.draw)throw new Error("Serie has no method draw");t.draw(e)}drawSeries(t){if(this.width&&this.height)for(var e=this.series.length-1;0<=e;e--)this.series[e].isShown()&&this.drawSerie(this.series[e],t)}resetSeries(){this.removeSeries()}killSeries(){this.resetSeries()}killLegend(){this.legend&&this.legend.kill(),this.legend=void 0}killShapes(){this.shapes.forEach(t=>{t.kill(!1)})}removeSeries(){for(;this.series[0];)this.series[0].kill(!0);this.series=[],this.legend&&this.legend.update()}selectSerie(t,e){"object"!=typeof t&&(t=this.getSerie(t)),this.selectedSerie==t&&this.selectedSerie.selectionType==e||(this.selectedSerie!==t&&this.selectedSerie?this.unselectSerie(this.selectedSerie):(this.selectedSerie=t,this.triggerEvent("onSelectSerie",t),t.select(e||"selected")))}getSelectedSerie(){return this.selectedSerie}unselectSerie(t){t.unselect(),this.selectedSerie=!1,this.triggerEvent("onUnselectSerie",t)}getShapesOfSerie(t){for(var e=[],i=this.shapes.length-1;0<=i;i--)this.shapes[i].getSerie()==t&&e.push(this.shapes[i]);return e}makeToolbar(t){var e=this.getConstructor("graph.toolbar");return e?this.toolbar=new e(this,t):r.throwError("No constructor exists for toolbar")}getShapes(){return this.shapes||[]}newShape(t,e,i=!1,a){if(this.prevent(!1),!i&&(this.emit("beforeNewShape",e),this.prevent(!1)))return!1;var n;if("object"==typeof t&&(i=e,t=(e=t).type),(e=e||{})._id=r.guid(),!(n="function"==typeof t?t:this.getConstructor("graph.shape."+t)))return r.throwError("No constructor for this shape");var o=new n(this,e);if(!o)return r.throwError("Failed to construct shape.");if(o.type=t,o.graph=this,o._data=e,void 0!==e.properties&&o.setProperties(e.properties),o.init(this,a,!!a&&a.simplified),void 0!==e.props)for(var h in e.props)o.setProp(h,e.props[h]);if(e.position){h=0;for(var l=e.position.length;h{o.addTransform(t,e)}),void 0!==e.highlightOnMouseOver&&o.setProp("highlightOnMouseOver",!0),e.labelEditable&&o.setProp("labelEditable",e.labelEditable),e.labels&&!e.label&&(e.label=e.labels),void 0!==e.label)for(Array.isArray(e.label)||(e.label=[e.label]),h=0,l=e.label.length;he;e++)i=document.createElementNS(d.ns,"line"),i.setAttribute("stroke",this.options.closeColor),i.setAttribute("shape-rendering","crispEdges"),i.setAttribute("stroke-linecap","square"),i.setAttribute("display","none"),this.closingLines[t[e]]=i,this.graphingZone.appendChild(i)}isActionAllowed(t,e){if((e.type===t.type||void 0===e.type&&"mousedown"===t.type||("wheel"===t.type||"mousewheel"===t.type)&&"mousewheel"==e.type)&&(!e.enabled||("function"==typeof e.enabled?e.enabled(this):e.enabled)))return e.key&&e.key!==t.keyCode&&{backspace:8,enter:13,tab:9,shift:16,ctrl:17,alt:18,pause:19,escape:27,up:33,down:34,left:37,right:39}[e.key]!==t.keyCode?void 0:(void 0===e.shift&&(e.shift=!1),void 0===e.ctrl&&(e.ctrl=!1),void 0===e.meta&&(e.meta=!1),void 0===e.alt&&(e.alt=!1),t.shiftKey==e.shift&&t.ctrlKey==e.ctrl&&t.metaKey==e.meta&&t.altKey==e.alt)}forcePlugin(t){this.forcedPlugin=t}unforcePlugin(){this.forcedPlugin=!1}_pluginsExecute(t,...e){for(var i in this.plugins)this.plugins[i]&&this.plugins[i][t]&&this.plugins[i][t].apply(this.plugins[i],e)}_pluginExecute(t,e,i){if(t)return this.plugins[t]&&this.plugins[t][e]?(this.plugins[t][e].apply(this.plugins[t],i),!0):void 0}pluginYieldActiveState(){this.activePlugin=!1}_serieExecute(t,e,i){"object"!=typeof t&&(t=this.getSerie(t)),"function"==typeof t[e]&&t.apply(t,i)}_pluginsInit(){var t,e,i;for(var s in this.options.plugins)e=s,i=this.options.plugins[s],(t=this.getConstructor("graph.plugin."+e))?(this.plugins[e]=new t(i),r.mapEventEmission(this.plugins[e].options,this.plugins[e]),this.plugins[e].init(this,i)):r.throwError(`Plugin "${e}" has not been registered`)}getPlugin(t){return this.plugins[t]||r.throwError(`Plugin "${t}" has not been loaded or properly registered`)}hasPlugin(t){return!!this.plugins[t]}triggerEvent(){var t=arguments[0];if("function"==typeof this.options[t])return this.options[t].apply(this,arguments)}makeLegend(t){if(this.legend)return this.legend;var e=this.getConstructor("graph.legend");return e?(this.legend=new e(this,t),this.legend):r.throwError("Graph legend is not available as it has not been registered")}updateLegend(t=!1){if(this.legend)return this.legend.update(t),this}getLegend(){if(this.legend)return this.legend}requireLegendUpdate(){this.legend&&this.legend.requireDelayedUpdate()}orthogonalProjectionSetup(){this.options.zAxis=r.extend(!0,{maxZ:10,minZ:0,shiftX:-25,shiftY:-15,xAxis:this.getXAxis(),yAxis:this.getYAxis()})}orthogonalProjectionUpdate(){this.zAxis||(this.zAxis={g:document.createElementNS(d.ns,"g"),l:document.createElementNS(d.ns,"line")},this.zAxis.g.appendChild(this.zAxis.l),this.groupGrids.appendChild(this.zAxis.g));let t=this.options.zAxis.xAxis,e=this.options.zAxis.yAxis;var i=t.getMinPx(),s=e.getMinPx(),r=t.getZProj(this.options.zAxis.maxZ),a=e.getZProj(this.options.zAxis.maxZ);this.zAxis.l.setAttribute("stroke","black"),this.zAxis.l.setAttribute("x1",i),this.zAxis.l.setAttribute("x2",i+r),this.zAxis.l.setAttribute("y1",s),this.zAxis.l.setAttribute("y2",s+a),this.updateDataMinMaxAxes(!0);var n=this.series.map(t=>[t.getZPos(),t]);n.sort((t,e)=>e[0]-t[0]);let o=0;n.forEach(t=>{t[1].setLayer(o),this.appendSerieToDom(t[1]),o++}),this.drawSeries(!0)}kill(){this.wrapper.removeChild(this.dom)}_removeSerie(t){this.series.splice(this.series.indexOf(t),1),this._pluginsExecute("serieRemoved",t)}contextListen(t,e,i){if(this.options.onContextMenuListen)return this.options.onContextMenuListen(t,e,i)}lockShapes(){this.shapesLocked=!0;for(var t=0,e=this.shapes.length;tthis.drawingSpaceWidth}getDrawingSpaceHeight(){return()=>this.drawingSpaceHeight}getDrawingSpaceMinX(){return()=>this.drawingSpaceMinX}getDrawingSpaceMinY(){return()=>this.drawingSpaceMinY}getDrawingSpaceMaxX(){return()=>this.drawingSpaceMaxX}getDrawingSpaceMaxY(){return()=>this.drawingSpaceMaxY}tracking(t){return this.trackingLine(t)}trackingLine(t){var e=this;if("boolean"==typeof t)return void(this.options.trackingLine&&(this.options.trackingLine.enable=t));t&&(this.options.trackingLine=t),t.enable=void 0===t.enable||!!t.enable;const i=new Set;if(Array.isArray(t.series)?t.series.forEach(t=>{i.add(this.getSerie(t))}):"all"==t.series&&this.allSeries().forEach(t=>i.add(t)),t.series=i,"individual"==t.mode)i.forEach(i=>{e.addSerieToTrackingLine(i,t.serieOptions)});else{if(t.noLine)return;this.trackingLineShape||(this.trackingLineShape=this.newShape("line",r.extend(!0,{position:[{y:"min"},{y:"max"}],stroke:"black",layer:-1},t.trackingLineShapeOptions))),this.trackingLineShape.draw()}}addSerieToTrackingLine(t,e={}){let i;this.options.trackingLine||this.trackingLine({mode:"individual"}),this.options.trackingLine.series.add(t),i=this.options.trackingLine.serieShape?this.options.trackingLine.serieShape:{shape:"ellipse",properties:{rx:[3*t.getLineWidth()+"px"],ry:[3*t.getLineWidth()+"px"]}},t.options.tracking=Object.assign({},e),t.trackingShape||(t.trackingShape=this.newShape(i.shape,{fillColor:t.getLineColor(),strokeColor:"White",strokeWidth:t.getLineWidth()},!0,i.properties).setSerie(t).forceParentDom(t.groupMain).draw())}setKatexRenderer(t){this._katexRenderer=t}hasKatexRenderer(){return!!this._katexRenderer}renderWithKatex(t,e){if(this._katexRenderer){e?e.removeChild(e.firstChild):e=document.createElementNS(d.ns,"foreignObject");let i=document.createElement("div");return e.appendChild(i),this._katexRenderer(t,i),e}return!1}exportToSchema(){let t={title:this.options.title,width:this.getWidth(),height:this.getHeight()},e=[],i={x:[],y:[]};["top","bottom","left","right"].map(t=>this.axis[t]?void(e=e.concat(this.axis[t].map(e=>({type:t,label:e.options.label,unit:e.options.unit,min:e.options.forcedMin,max:e.options.forcedMax,flip:e.options.flipped}))),"top"==t||"bottom"==t?i.x=i.x.concat(this.axis[t]):i.y=i.y.concat(this.axis[t])):{}),t.axis=e;let s=t=>{switch(t){case d.SERIE_BAR:return"bar";case d.SERIE_LINE_COLORED:return"color";case d.SERIE_SCATTER:return"scatter";default:case d.SERIE_LINE:return"line";}},r=(t,e)=>{let i=[];switch(t.getType()){case d.SERIE_LINE:for(var s=0;s{let e=[],a=[];if(t.getType()==d.SERIE_LINE)for(var n in t.styles){a.push({styleName:n,color:t.styles[n].lineColor,lineWidth:t.styles[n].lineWidth,lineStyle:t.styles[n].lineStyle});let i={styleName:n,styles:[]};e.push(i),i.styles=i.styles.concat((t.styles[n].markers||[]).map(t=>({shape:t.type,zoom:t.zoom,lineWidth:t.strokeWidth,lineColor:t.strokeColor,color:t.fillColor,points:t.points})))}return{label:t.getLabel(),id:t.getName(),type:s(t.getType()),x:r(t,!0),y:r(t,!1),xAxis:i.x.indexOf(t.getXAxis()),yAxis:i.y.indexOf(t.getYAxis()),style:e,lineStyle:a}})),t}static registerConstructor(t,e){return u.has(t)?r.throwError(`Constructor ${e} already exists.`):void u.set(t,e)}static getConstructor(t,e=!1){return u.has(t)?u.get(t):!e&&r.throwError(`Constructor "${t}" doesn't exist`)}static newWaveform(){return new o.Waveform(...arguments)}static waveform(){return new o.Waveform(...arguments)}static newWaveformHash(){return new o.WaveformHash(...arguments)}static waveformHash(){return new o.WaveformHash(...arguments)}static saveStyle(t,e){return(d._styles||(d._styles={}),!e)?d._styles[t]:void(d._styles[t]=e)}static getStyle(t){return d._styles||(d._styles={}),d._styles[t]||{}}}d.prototype.getConstructor=d.getConstructor;var x=function(t,e,i,s,r){const a=t.options.trackingLine.textMethod||b;var n=!1;if(!r&&t.options.trackingLine.legend&&(n=!0,r=function(t){var e=document.createElement("div");return e.setAttribute("class","trackingLegend"),e.style.position="absolute",e.style.borderRadius="4px",e.style.boxShadow="1px 1px 3px 0px rgba(100,100,100,0.6)",e.style.border="2px solid #333333",e.style.backgroundColor="rgba(255, 255, 255, 0.5 )",e.style.pointerEvents="none",e.style.paddingTop="5px",e.style.paddingBottom="5px",e.style.paddingLeft="10px",e.style.paddingRight="10px",t.getWrapper().insertBefore(e,t.getDom()),e}(t)),t.options.trackingLine.legend){if(0==e.length)return r.style.display="none",r;"none"==r.style.display||n?m(t,r,i,s,!0):y(t,r,i,s),r.style.display="block";var o=a(e,void 0,i,s);return r.innerHTML=o,r}},m=function(t,e,i,s,r){var a=Date.now(),n=e.offsetHeight,o=parseInt(e.style.marginLeft.replace("px","")||0,10),h=parseInt(e.style.marginTop.replace("px","")||0,10);return(i=i>t.getWidth()/2?i-i%10-20-e.offsetWidth:i-i%10+30,s=s-s%10+n/2,r)?(e.style.marginLeft=i+"px",void(e.style.marginTop=s+"px")):void window.requestAnimationFrame(function t(){var r=(Date.now()-a)/200;1r&&window.requestAnimationFrame(t)})},y=(...t)=>{r.debounce(m,50)(...t)};const b=t=>{let e="";for(var i in t)t[i].closestPoint&&(e+=`${t[i].serie.getName()}: ${t[i].serie.getYAxis().valueToHtml(t[i].closestPoint.yClosest,void 0,void 0,2)}\n `);return e};d.SERIE_LINE=Symbol(),d.SERIE_SCATTER=Symbol(),d.SERIE_CONTOUR=Symbol(),d.SERIE_BAR=Symbol(),d.SERIE_BOX=Symbol(),d.SERIE_ZONE=Symbol(),d.SERIE_LINE_COLORED=Symbol(),d.SERIE_ZONE=Symbol(),d.SERIE_DENSITYMAP=Symbol(),d.SERIE_LINE_3D=Symbol(),d.SERIE_ZONE_3D=Symbol(),d.TICKS_OUTSIDE=Symbol(),d.TICKS_INSIDE=Symbol(),d.TICKS_CENTERED=Symbol(),d.ns="http://www.w3.org/2000/svg",d.nsxlink="http://www.w3.org/1999/xlink",(0,a.default)(d),(0,n.default)(d);i.default=d,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},9591:function(t,e,i){var s,r,a;r=[e,i(2688),i(5054),i(9802),i(1127),i(1572),i(4001),i(4477),i(6967),i(2443),i(6340),i(3380),i(9680),i(6144),i(9506),i(6814),i(594),i(4136),i(7282),i(4450),i(154),i(7359),i(4508),i(8682),i(196),i(8747),i(9589),i(8711),i(6879),i(5186),i(9301),i(8624),i(2474),i(5888),i(4510),i(967),i(9929),i(6672),i(9612),i(1059),i(3397),i(2946),i(5507),i(2734)],void 0===(a="function"==typeof(s=function(i,s,r,a,n,o,h,l,u,d,p,g,c,f,x,m,y,b,v,M,A,S,k,w,_,P,C,L,E,X,T,D,O,Y,N,I,B,H,F,W,j,z,R,V){"use strict";function U(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=U(s),r=U(r),a=U(a),n=U(n),o=U(o),h=U(h),l=U(l),u=U(u),d=U(d),p=U(p),g=U(g),c=U(c),f=U(f),x=U(x),m=U(m),y=U(y),b=U(b),v=U(v),M=U(M),A=U(A),S=U(S),k=U(k),w=U(w),_=U(_),P=U(P),C=U(C),L=U(L),E=U(E),X=U(X),T=U(T),D=U(D),O=U(O),Y=U(Y),N=U(N),I=U(I),B=U(B),H=U(H),F=U(F),W=U(W),j=U(j),z=U(z),V=U(V),s.default.registerConstructor("graph.position",r.default),s.default.registerConstructor("graph.axis.x",n.default),s.default.registerConstructor("graph.axis.y",o.default),s.default.registerConstructor("graph.axis.x.bar",h.default),s.default.registerConstructor("graph.axis.x.time",l.default),s.default.registerConstructor("graph.serie.line",u.default),s.default.registerConstructor("graph.serie.line.3d",d.default),s.default.registerConstructor("graph.serie.line.color",c.default),s.default.registerConstructor("graph.serie.contour",b.default),s.default.registerConstructor("graph.serie.bar",p.default),s.default.registerConstructor("graph.serie.box",g.default),s.default.registerConstructor("graph.serie.scatter",f.default),s.default.registerConstructor("graph.serie.zone",x.default),s.default.registerConstructor("graph.serie.zone.3d",m.default),s.default.registerConstructor("graph.serie.densitymap",y.default),s.default.registerConstructor(s.default.SERIE_LINE,u.default),s.default.registerConstructor(s.default.SERIE_LINE_3D,d.default),s.default.registerConstructor(s.default.SERIE_LINE_COLORED,c.default),s.default.registerConstructor(s.default.SERIE_CONTOUR,b.default),s.default.registerConstructor(s.default.SERIE_BAR,p.default),s.default.registerConstructor(s.default.SERIE_BOX,g.default),s.default.registerConstructor(s.default.SERIE_SCATTER,f.default),s.default.registerConstructor(s.default.SERIE_ZONE,x.default),s.default.registerConstructor(s.default.SERIE_ZONE_3D,m.default),s.default.registerConstructor(s.default.SERIE_DENSITYMAP,y.default),s.default.registerConstructor("graph.plugin.shape",N.default),s.default.registerConstructor("graph.plugin.drag",Y.default),s.default.registerConstructor("graph.plugin.zoom",B.default),s.default.registerConstructor("graph.plugin.selectScatter",I.default),s.default.registerConstructor("graph.plugin.timeSerieManager",H.default),s.default.registerConstructor("graph.plugin.serielinedifference",F.default),s.default.registerConstructor("graph.plugin.serieLineDifference",F.default),s.default.registerConstructor("graph.plugin.axissplitting",W.default),s.default.registerConstructor("graph.plugin.makeTracesDifferent",j.default),s.default.registerConstructor("graph.plugin.peakPicking",z.default),s.default.registerConstructor("graph.shape",v.default),s.default.registerConstructor("graph.shape.areaundercurve",M.default),s.default.registerConstructor("graph.shape.arrow",A.default),s.default.registerConstructor("graph.shape.ellipse",S.default),s.default.registerConstructor("graph.shape.polygon",_.default),s.default.registerConstructor("graph.shape.label",k.default),s.default.registerConstructor("graph.shape.polyline",w.default),s.default.registerConstructor("graph.shape.line",P.default),s.default.registerConstructor("graph.shape.nmrintegral",C.default),s.default.registerConstructor("graph.shape.html",D.default),s.default.registerConstructor("graph.shape.peakintegration2d",L.default),s.default.registerConstructor("graph.shape.rect",E.default),s.default.registerConstructor("graph.shape.rectangle",E.default),s.default.registerConstructor("graph.shape.cross",X.default),s.default.registerConstructor("graph.shape.peakboundariescenter",T.default),s.default.registerConstructor("graph.legend",a.default),s.default.registerConstructor("graph.waveform",R.Waveform);var G=s.default;i.default=G,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},9802:function(t,e,i){var s,r,a;r=[e,i(5054),i(2458)],void 0===(a="function"==typeof(s=function(i,s,r){"use strict";function o(t){try{return t.getBBox()}catch(t){return{height:0,width:0,x:0,y:0}}}var a;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=(a=s)&&a.__esModule?a:{default:a},r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(r);var n={backgroundColor:"rgba(255, 255, 255, 0.8)",frame:!0,frameWidth:1,frameColor:"black",paddingTop:10,paddingLeft:10,paddingBottom:10,paddingRight:10,color:"black",frameRounding:0,movable:!1,shapesToggleable:!0,isSerieHideable:!0,isSerieSelectable:!0},h=class{constructor(t,e){this.options=r.extend({},n,e),this.graph=t,this.svg=document.createElementNS(this.graph.ns,"g"),this.subG=document.createElementNS(this.graph.ns,"g"),this.groups=[],this.rect=document.createElementNS(this.graph.ns,"rect"),this.rectBottom=document.createElementNS(this.graph.ns,"rect"),this.autoPosition=void 0,this.rect.setAttribute("x",0),this.rect.setAttribute("y",0),this.rectBottom.setAttribute("x",0),this.rectBottom.setAttribute("y",0),this.series=!1,this.svg.setAttribute("display","none"),this.pos={x:void 0,y:void 0,transformX:0,transformY:0},this.setEvents(),this.eyeId=r.guid(),this.eyeCrossedId=r.guid();var i=r.SVGParser(``),s=r.SVGParser(``);this.svg.appendChild(document.adoptNode(s.documentElement.firstChild)),this.svg.appendChild(document.adoptNode(i.documentElement.firstChild)),this.svg.appendChild(this.subG),this.applyStyle()}setPosition(t,e,i){t&&(this.position=t,this.alignToX=e||"left",this.alignToY=i||"top")}setDraggable(t){this.options.movable=t}setAutoPosition(t){return-1<["bottom","left","top","right"].indexOf(t=t.toLowerCase())?(this.autoPosition=t,this):void(this.requireDelayedUpdate(),this.autoPosition=!1)}autoPosition(){return this.setAutoPosition(...arguments)}kill(){this.autoPosition?this.graph.getDom().removeChild(this.getDom()):this.graph.graphingZone.removeChild(this.getDom())}buildLegendBox(){var t=this.series||this.graph.getSeries(),e=0,i=this.options.paddingTop;this.autoPosition?this.graph.getDom().appendChild(this.getDom()):this.graph.graphingZone.appendChild(this.getDom());for(var s=0,r=t.length;sthis.graph.getDrawingWidth()-this.options.paddingRight&&(i+=16,e=0),this.groups[s].setAttribute("transform",`translate( ${e}, ${i})`),"bottom"==this.autoPosition||"top"==this.autoPosition?(e+=a.width+10,i+=0):(e=0,i+=16));var a=o(this.subG);switch(this.width=a.width+this.options.paddingRight+this.options.paddingLeft,this.height=a.height+this.options.paddingBottom+this.options.paddingTop,this.rect.setAttribute("width",this.width),this.rect.setAttribute("height",this.height),this.rect.setAttribute("fill","none"),this.rect.setAttribute("pointer-events","fill"),this.rect.setAttribute("display","none"),this.options.movable&&(this.rectBottom.style.cursor="move"),this.rectBottom.setAttribute("width",this.width),this.rectBottom.setAttribute("height",this.height),this.rectBottom.setAttribute("x",a.x-this.options.paddingLeft),this.rectBottom.setAttribute("y",a.y-this.options.paddingTop),this.position=this.position||{},this.autoPosition){case"bottom":this.position.y=this.graph.getHeight()+"px",this.position.x=(this.graph.drawingSpaceWidth-this.width)/2+this.graph.drawingSpaceMinX+"px",this.alignToY="bottom",this.alignToX=!1;break;case"left":this.position.x="6px",this.position.y=(this.graph.getHeight()-this.height)/2+"px",this.alignToX="left",this.alignToY=!1;break;case"right":this.position.x=this.graph.getWidth()+"px",this.position.y=(this.graph.getHeight()-this.height)/2+"px",this.alignToX="right",this.alignToY=!1;break;case"top":this.position.x=(this.graph.drawingSpaceWidth-this.width)/2+this.graph.drawingSpaceMinX+"px",this.position.y="10px",this.alignToY="top",this.alignToX=!1;break;case void 0:return;default:return void console.error("Position is not supported");}if(this.autoPosition){let t;switch(this.autoPosition){case"bottom":this.graph.options.paddingBottom=this.height+10,t=this.height!==this.previousHeight;break;case"top":this.graph.options.paddingTop=this.height+14,t=this.height!==this.previousHeight;break;case"left":this.graph.options.paddingLeft=this.width+5,t=this.width!==this.previousWidth;break;case"right":this.graph.options.paddingRight=this.width+10,t=this.width!==this.previousWidth;}t&&(this.graph.draw(!0),this.previousHeight=this.height,this.previousWidth=this.width)}this.bbox=a}calculatePosition(){var t=s.default.check(this.position);let e=t.compute(this.graph,this.graph.getXAxis(),this.graph.getYAxis());e&&(t.y,t.x,"right"==this.alignToX&&(e.x-=this.width),"bottom"==this.alignToY&&(e.y-=this.height),this.pos.transformX=e.x,this.pos.transformY=e.y,this._setPosition())}update(t){if(!(this.graph.isDelayedUpdate()||!this._requiredUpdate&&t)){this._requiredUpdate=!1;var e=this;for(this.applyStyle();this.subG.hasChildNodes();)this.subG.removeChild(this.subG.lastChild);this.svg.insertBefore(this.rectBottom,this.svg.firstChild);var i=this.series||this.graph.getSeries();if(0r[t]&&u&&(l=u.next,u.next.next.prev=u,u.next=u.next.next,l.next.next=void 0,l.next.prev=void 0,s[t]--))}(t,n,o),o},t.empty=function(t){!function(t){e[t]={},s[t]=0}(t)},t.exist=function(t){return e[t]},t.default=void 0;var e={},i={},s={},r={};t.default=n})?i.apply(e,[e]):i)||(t.exports=s)},5054:function(t,e){var i,s;void 0===(s="function"==typeof(i=function(i){"use strict";function s(t){return!!(t&&t.indexOf&&-1i&&(i+=1),1i?e:i<2/3?t+6*((e-t)*(2/3-i)):t}function i(t,e){return t._savedAttributes&&void 0!==t._savedAttributes[e]}function s(t,e){if(t&&t._savedAttributesIds){t._savedAttributesIds.splice(t._savedAttributesIds.indexOf(e),1),delete t._attributes[e];var i={};for(var s in t._savedAttributes)i[s]=t._savedAttributes[s];s=0;for(var r=t._savedAttributesIds.length;ss?s*(1+i):s+i-s*i,h=2*s-o;r=e(h,o,t+1/3),a=e(h,o,t),n=e(h,o,t-1/3)}return[Math.round(255*r),Math.round(255*a),Math.round(255*n)]},t.saveDomAttributes=function(t,e,i){if(t)for(var r in t._savedAttributesIds=t._savedAttributesIds||[],-1{t.dom=document.createElementNS(this.graph.ns,"path"),t.dom.setAttribute("fill",t.fillColor||"none"),t.dom.setAttribute("stroke",t.strokeColor||"black"),t.dom.setAttribute("stroke-opacity",t.strokeOpacity||1),t.dom.setAttribute("fill-opacity",t.fillOpacity||1),t.dom.setAttribute("stroke-width",t.strokeWidth||1),this.groupMain.appendChild(t.dom)};e={},"string"==typeof t&&(t={});for(var a=0,n=i.length;a=o;o++)t[i[a][o]]&&(e[i[a][o]]=t[i[a][o]],r(e[i[a][o]]))}return e},errorDrawInit:function(){this.errorboxStyle&&(this.errorboxStyle.paths={top:"",bottom:"",left:"",right:""}),this.errorbarStyle&&(this.errorbarStyle.paths={top:"",bottom:"",left:"",right:""})},errorAddPoint:function(t,e,i,s,r){let a;this.errorbarStyle&&((a=this.waveform.getErrorBarXBelow(t))&&(this.errorbarStyle.paths.left+=` M ${s} ${r}`,this.errorbarStyle.paths.left+=this.makeBarX(this.getX(e-a),s,this.errorbarStyle.left)),(a=this.waveform.getErrorBarXAbove(t))&&(this.errorbarStyle.paths.right+=` M ${s} ${r}`,this.errorbarStyle.paths.right+=this.makeBarX(this.getX(e+a),s,this.errorbarStyle.right)),(a=this.waveform.getErrorBarYBelow(t))&&(this.errorbarStyle.paths.bottom+=` M ${s} ${r}`,this.errorbarStyle.paths.bottom+=this.makeBarY(this.getY(i-a),r,this.errorbarStyle.bottom)),(a=this.waveform.getErrorBarYAbove(t))&&(this.errorbarStyle.paths.top+=` M ${s} ${r}`,this.errorbarStyle.paths.top+=this.makeBarY(this.getY(i+a),r,this.errorbarStyle.top))),this.errorboxStyle&&((a=this.waveform.getErrorBoxXBelow(t))&&(this.errorboxStyle.paths.left+=` M ${s} ${r}`,this.errorboxStyle.paths.left+=this.makeBoxX(this.getX(e-a),s,this.errorboxStyle.left)),(a=this.waveform.getErrorBoxXAbove(t))&&(this.errorboxStyle.paths.right+=` M ${s} ${r}`,this.errorboxStyle.paths.right+=this.makeBoxX(this.getX(e+a),s,this.errorboxStyle.right)),(a=this.waveform.getErrorBoxYBelow(t))&&(this.errorboxStyle.paths.bottom+=` M ${s} ${r}`,this.errorboxStyle.paths.bottom+=this.makeBoxY(this.getY(i-a),r,this.errorboxStyle.bottom)),(a=this.waveform.getErrorBoxYAbove(t))&&(this.errorboxStyle.paths.top+=` M ${s} ${r}`,this.errorboxStyle.paths.top+=this.makeBoxY(this.getY(i+a),r,this.errorboxStyle.top)))},errorAddPointBarChart:function(t,e,i,s){var r;this.error&&(r=this.error[t])&&this.doErrorDraw("y",r,e,s,i,s)},errorDraw:function(){if(this.errorbarStyle)for(var t in this.errorbarStyle.paths)this.errorbarStyle[t]&&this.errorbarStyle[t].dom&&this.errorbarStyle[t].dom.setAttribute("d",this.errorbarStyle.paths[t]);if(this.errorboxStyle)for(var t in this.errorboxStyle.paths)this.errorboxStyle[t]&&this.errorboxStyle[t].dom&&this.errorboxStyle[t].dom.setAttribute("d",this.errorboxStyle.paths[t])}};i.default=r,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},1864:function(t,e){var i,s;void 0===(s="function"==typeof(i=function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.EventMixin=t.trigger=void 0;const e=function(t,...e){var i,s;(null===(i=this.__eventHandlers)||void 0===i?void 0:i[t])&&this.__eventHandlers[t].forEach(t=>t.apply(this,e));const r=null===(s=this.__eventHandlers)||void 0===s?void 0:s.__all;r&&r.forEach(i=>i.apply(this,[t,...e]))};t.trigger=e;const i={on(t,e){return this.__eventHandlers||(this.__eventHandlers={}),this.__eventHandlers[t]||(this.__eventHandlers[t]=[]),this.__eventHandlers[t].push(e),this},off(t,e){var i;let s=null===(i=this.__eventHandlers)||void 0===i?void 0:i[t];if(s){if(e)for(let t=0,i=s.length;t{Object.assign(t.prototype,i)}})?i.apply(e,[e]):i)||(t.exports=s)},9211:function(t,e,i){var s,r,a;r=[e,i(1864)],void 0===(a="function"==typeof(s=function(i,s){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;let r=t=>Object.assign({},s.EventMixin,{trigger(e,...i){return s.trigger.call(this,e,...i),this.graph&&this.graph.trigger(t+"."+e,...i),this},emit(t,...e){return this.trigger(t,...e)}});i.default=(t,e="__")=>{Object.assign(t.prototype,r(e))},t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},8541:function(t,e){var i,s;void 0===(s="function"==typeof(i=function(i){"use strict";function s(t,e,i){let s,r,a,n,o,h=t.getWaveforms();for(let l of h)for(s=0,r=l.getLength(),a=l.getData();s{i[e](...t)})}))});var x=["getSymbolForLegend"];f=["_getSymbolForLegendContainer"],Object.getOwnPropertyNames(o.default.prototype).map(function(t){var e;-1!=x.indexOf(t)&&(p.prototype[t]=(e=t,function(){var t=arguments;return this.subSeries[0][e](...t)}),g.prototype[t]=function(t){return function(){var e=arguments;return this.subSeries[0][t](...e)}}(t))}),f.map(t=>{var e;p.prototype[t]=(e=t,function(){var t=arguments;return this.subSeries[0][e](...t)}),g.prototype[t]=function(t){return function(){var e=arguments;return this.subSeries[0][t](...e)}}(t)});class m extends u.default{constructor(){super(...arguments),this.series=new Map}static default(){return{axes:{margins:{high:5,low:5}}}}init(t){this.graph=t}newXAxis(t){return this.newBottomAxis(t)}newYAxis(t){return this.newLeftAxis(t)}newTopAxis(t){return t=this.getOptions(t),new v(this.graph,"top",t)}newBottomAxis(t){return t=this.getOptions(t),new v(this.graph,"bottom",t)}newLeftAxis(t){return t=this.getOptions(t),new M(this.graph,"left",t)}newRightAxis(t){return t=this.getOptions(t),new M(this.graph,"right",t)}getOptions(t){var e={marginMin:this.options.axes.margins.low,marginMax:this.options.axes.margins.high};return n.extend(!0,e,t)}preDraw(){var t,e;this.series.forEach(({serie:i})=>{t=i.getXAxis(),e=i.getYAxis();let r=1;for(t.splitNumber&&(r*=t.splitNumber),e.splitNumber&&(r*=e.splitNumber);i.subSeries.lengthr;){let t=this.graph.getSerie(`${i.getName()}_${i.subSeries.length-1}`);t&&t.kill&&t.kill(),i.subSeries.pop()}!i.getXAxis().splitNumber&&i.getXAxis().splitAxis&&i.getXAxis().splitAxis(),!i.getYAxis().splitNumber&&i.getYAxis().splitAxis&&i.getYAxis().splitAxis(),i.subSeries.map((e,s)=>{var r,a;if(i.getXAxis().getSubAxis){let e=s%(t.splitNumber||1);r=i.getXAxis().getSubAxis(e)}else r=i.getXAxis();if(e.setXAxis(r),i.getYAxis().getSubAxis){let e=Math.floor(s/(t.splitNumber||1));a=i.getYAxis().getSubAxis(e)}else a=i.getYAxis();e.setYAxis(a),e.draw(!0)})})}newSerie(t,e={},i){switch(i){case"line":return this.newLineSerie(t,e);case"scatter":return this.newScatterSerie(t,e);}throw"Cannot create a split serie of type "+i}newLineSerie(t,e){var i={type:"lineSerie",serie:new p(this.graph,t,e,"line")};return this.series.set(t,i),this.graph.series.push(i.serie),i.serie}newScatterSerie(t,e){var i={type:"scatterSerie",serie:new g(this.graph,t,e,"scatter")};return this.series.set(t,i),this.graph.series.push(i.serie),i.serie}}var y={splitMarks:!0},b=function(t){var e=class extends t{constructor(t,e,i={}){super(t,e,i),this.axes=[],this.position=e,this.constructorOptions=n.extend(!0,{},y,i),this._splitVal=[]}all(t){if("function"==typeof t)return this.axes.map(t),this}splitAxis(...t){t.push(1);let e=t.length;for(;this.axes.length>e;)this.axes.pop().kill(!0,!0);for(;this.axes.lengththis._splitVal.length)&&(super.setMinMaxToFitSeries(...arguments),this._splitVal[0]=this._splitVal[0]||[],this._splitVal[this._splitVal.length-1]=this._splitVal[this._splitVal.length-1]||[],this._splitVal[0][0]=this.getCurrentMin(),this._splitVal[this._splitVal.length-1][1]=this.getCurrentMax(),this.setChunkBoundaries(this._splitVal))}draw(){this.autoSpread&&this._splitSpread();let t,e,i,s=0;if(0<=this._baseWidthIndex&&(e=this.getSubAxis(this._baseWidthIndex))&&(i=e.getSpan()),e=void 0,0<=this.fixGridFor&&(e=this.getSubAxis(this.fixGridFor))){if(void 0!==e._mean){let t=(e.getSpan()[1]-e.getSpan()[0])/(i[1]-i[0])*this._baseWidthVal;e.forceMin(e._mean-t/2),e.forceMax(e._mean+t/2)}s=e.draw(),t=e.getPrimaryTickUnit()}return this.axes.map(r=>{if(e!==r){if(void 0!==r._mean){let t=(r.getSpan()[1]-r.getSpan()[0])/(i[1]-i[0])*this._baseWidthVal;r.forceMin(r._mean-t/2),r.forceMax(r._mean+t/2)}t&&r.forcePrimaryTickUnit(t),s=Math.max(s,r.draw())}}),this.writeUnit(),s}setMinPx(t){super.setMinPx(t);for(let e of this.axes)e.setMinPx(t)}setMaxPx(t){super.setMaxPx(t);for(let e of this.axes)e.setMaxPx(t)}setShift(){super.setShift(...arguments);for(let t of this.axes)t.setShift(...arguments)}init(){super.init(...arguments),this.splitAxis()}getAxisPosition(){var t=0;return this.axes.map(e=>{t=Math.max(t,e.getAxisPosition())}),t}getSubAxis(t){if(this.axes.length<=t)throw`Impossible to reach axis. Index ${t} is out of range`;return this.axes[t]}get splitNumber(){return this._splits.length}};return["turnGridsOff","turnGridsOn","gridsOff","gridsOn","setEngineering","setScientificScaleExponent","setScientific","setLabelColor","setSecondaryGridDasharray","setPrimaryGridDasharray","setSecondaryGridsOpacity","setPrimaryGridOpacity","setSecondaryGridWidth","setPrimaryGridWidth","setSecondaryGridColor","setPrimaryGridColor","setTicksLabelColor","setSecondaryTicksColor","setPrimaryTicksColor","setAxisColor","secondaryGridOn","secondaryGridOff","primaryGridOff","primaryGridOn","setSecondaryGrid","setPrimaryGrid","setGrids","setTickPosition","setExponentialFactor","setExponentialLabelFactor","setGridLinesStyle","forcePrimaryTickUnitMin","forcePrimaryTickUnitMax","forcePrimaryTickUnit","flip","show","hide","setDisplay"].map(t=>{var i;e.prototype[t]=(i=t,function(){return this.axes.map(t=>{t[i](...arguments)}),this})}),e};class v extends b(r.default){constructor(t,e){super(...arguments),this.topbottom=e}getConstructor(){return r.default}getAxisPosition(){var t=super.getAxisPosition(...arguments);return this.labelPosY=t,this.getLabel()&&(t+=this.graph.options.fontSize),t}drawLabel(){super.drawLabel(),this.label.setAttribute("y",(this.top?-1:1)*(this.graph.options.fontSize+this.labelPosY))}draw(){var t=super.draw(...arguments);return this.drawLabel(),t}}class M extends b(a.default){constructor(){super(...arguments)}getConstructor(){return a.default}drawLabel(){super.drawLabel()}equalizePosition(t){var e=t;if(this.getLabel()&&this.axes.map(i=>{e=Math.max(i.equalizePosition(t),e)}),this.getLabel())return this.placeLabel(this.left?-e:e),e+this.graph.options.fontSize}}n.mix(v,new r.default),n.mix(M,new a.default);i.default=m,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},5888:function(t,e,i){var s,r,a;r=[e,i(2474)],void 0===(a="function"==typeof(s=function(i,s){"use strict";var r;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=(r=s)&&r.__esModule?r:{default:r};class a extends s.default{static default(){return{dragX:!0,dragY:!0,persistanceX:!1,persistanceY:!1}}init(t){this.graph=t,this.time=null,this.totaltime=2e3}onMouseDown(t,e,i){return this._draggingX=e,this._draggingY=i,this._lastDraggingX=this._draggingX,this._lastDraggingY=this._draggingY,this.stopAnimation=!0,this.moved=!1,!0}onMouseMove(t,e,i){var a=e-this._draggingX,n=i-this._draggingY;this.options.dragX&&t._applyToAxes(function(t){t.setCurrentMin(t.getVal(t.getMinPx()-a)),t.setCurrentMax(t.getVal(t.getMaxPx()-a))},!1,!0,!1),this.options.dragY&&t._applyToAxes(function(t){t.setCurrentMin(t.getVal(t.getMinPx()-n)),t.setCurrentMax(t.getVal(t.getMaxPx()-n))},!1,!1,!0),this._lastDraggingX=this._draggingX,this._lastDraggingY=this._draggingY,this._draggingX=e,this._draggingY=i,this.moved=!0,this.time=Date.now(),this.emit("dragging"),t.draw(!0)}onMouseUp(t,e,i){var a=Date.now()-this.time;e!=this._lastDraggingX&&i!=this._lastDraggingY?(this.speedX=(e-this._lastDraggingX)/a,this.speedY=(i-this._lastDraggingY)/a,isNaN(this.speedX)||isNaN(this.speedY)?this.emit("dragged"):(t._applyToAxes(function(t){t._pluginDragMin=t.getCurrentMin(),t._pluginDragMax=t.getCurrentMax()},!1,!0,!0),this.stopAnimation=!1,this.accelerationX=-this.speedX/this.totaltime,this.accelerationY=-this.speedY/this.totaltime,this.options.persistanceX||this.options.persistanceY?this._persistanceMove(t):this.emit("dragged"))):this.moved&&this.emit("dragged")}_persistanceMove(t){var e=this;e.stopAnimation?e.emit("dragged"):window.requestAnimationFrame(function(){var i=Date.now()-e.time,s=(.5*e.accelerationX*i+e.speedX)*i,r=(.5*e.accelerationY*i+e.speedY)*i;e.options.persistanceX&&t._applyToAxes(function(t){t.setCurrentMin(-t.getRelVal(s)+t._pluginDragMin),t.setCurrentMax(-t.getRelVal(s)+t._pluginDragMax),t.cacheCurrentMin(),t.cacheCurrentMax(),t.cacheInterval()},!1,!0,!1),e.options.persistanceY&&t._applyToAxes(function(t){t.setCurrentMin(-t.getRelVal(r)+t._pluginDragMin),t.setCurrentMax(-t.getRelVal(r)+t._pluginDragMax),t.cacheCurrentMin(),t.cacheCurrentMax(),t.cacheInterval()},!1,!1,!0),t.draw(),ie&&(e=Math.round(360*e)),r.hue=e):r.h=0,(i=t.s||t.saturation)?(1{if(!i.setLineColor)throw`The serie ${i.getName()} does not implement the method \`startingColor\``;let a;return a=1==s?this.buildHSLString({h:t.startingColorHSL.h,s:t.startingColorHSL.s,l:t.startingColorHSL.l}):this.buildHSLString({h:t.startingColorHSL.h+r/(s-1)*(t.endingColorHSL.h-t.startingColorHSL.h),s:t.startingColorHSL.s+r/(s-1)*(t.endingColorHSL.s-t.startingColorHSL.s),l:t.startingColorHSL.l+r/(s-1)*(t.endingColorHSL.l-t.startingColorHSL.l)}),i.setLineColor(a),"function"==typeof e&&e(r,a),a})}}i.default=n,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},2946:function(t,e,i){var s,r,a;r=[e,i(2458),i(2474)],void 0===(a="function"==typeof(s=function(i,s,r){"use strict";var a;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(s),r=(a=r)&&a.__esModule?a:{default:a};class n extends r.default{constructor(){super(...arguments)}static default(){return{autoPeakPicking:!1,autoPeakPickingNb:4,autoPeakPickingMinDistance:10,autoPeakPickingFormat:!1,autoPeakPickingAllowAllY:!1}}init(t,e){super.init(t,e),this.picks=[];for(var r,i=0,s=this.options.autoPeakPickingNb;i{t.show()})}serieRemoved(t){this.serie==t&&this.picks.map(t=>{t.hide()})}preDraw(){this.serie&&(this.detectedPeaks=[],this.lastYPeakPicking=!1)}postDraw(){if(!this.serie)return;let t,e=!0,i=!1,s=[],r=this.serie.getWaveform();if(!r)throw"The serie must have a waveform for the peak picking to work";let a,n=r.getLength(),o=0;for(;o=t[1]&&e||a<=t[1]&&i?t=[r.getX(o),a]:(at[1]&&i)&&(i?(i=!1,e=!0):(i=!0,e=!1,s.push(t),t=!1),t=[r.getX(o),a]):t=[r.getX(o),a];var h,l,u,d,p=s,g=[],c=p.length;o=0;var f=this.graph.selectedShapes.map(function(t){return t.getProp("xval")});for(p.sort(function(t,e){return e[1]-t[1]}),d=0;othis.serie.getXAxis().getMaxPx())&&(this.options.autoPeakPickingAllowAllY||!(a>this.serie.getYAxis().getMinPx()||athis.serie.getYAxis().getPx(p[o][1])-20?(this.picks[d].setLabelPosition({x:h,y:"5px"}),this.picks[d].setLabelBaseline("hanging")):(this.picks[d].setLabelBaseline("no-change"),this.picks[d].setLabelPosition({x:h,y:p[o][1],dy:"-15px"})),this.picks[d].setProp("xval",h),this.options.autoPeakPickingFormat?this.picks[d].setLabelText(this.options.autoPeakPickingFormat.call(this.picks[d],h,d)):this.picks[d].setLabelText(Math.round(1e3*h)/1e3+""),this.picks[d].makeLabels(),d++;this.picks[d]&&this.picks[d].isSelected();)d++;if(g.length==this.options.autoPeakPickingNb)break}}}hidePeakPicking(t){if(this._hidePeakPickingLocked||(this._hidePeakPickingLocked=t),this.picks)for(var e=0;ei.getY(a)||this.ys[o]>i.getY(a)&&this.ys[e](i.getY(a)-this.ys[o])/(this.ys[e]-this.ys[o])*(this.xs[e]-this.xs[o])+this.xs[o]&&r++;1==r%2?(s.push(a),t.selectMarker(a,!0,"selected")):t.unselectMarker(a)}this.selected=s,this.emit("selectionProcess",s)}}onMouseUp(){this._path.setAttribute("display","none"),this.emit("selectionEnd",this.selected)}}i.default=n,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},9612:function(t,e,i){var s,r,a;r=[e,i(5507),i(2474)],void 0===(a="function"==typeof(s=function(i,s,r){"use strict";var a;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,r=(a=r)&&a.__esModule?a:{default:a};class n extends r.default{constructor(){super(...arguments)}static default(){return{positiveStyle:{fillColor:"green",fillOpacity:.2,strokeWidth:0},negativeStyle:{fillColor:"red",fillOpacity:.2,strokeWidth:0},from:0,to:0}}init(t){this.graph=t,this.series=[],this.pathsPositive=[],this.pathsNegative=[],this.positivePolyline=this.graph.newShape("polyline").draw(),this.positivePolyline.setFillColor(this.options.positiveStyle.fillColor).setFillOpacity(this.options.positiveStyle.fillOpacity).setStrokeWidth(this.options.positiveStyle.strokeWidth).applyStyle(),this.negativePolyline=this.graph.newShape("polyline").draw(),this.negativePolyline.setFillColor(this.options.negativeStyle.fillColor).setFillOpacity(this.options.negativeStyle.fillOpacity).setStrokeWidth(this.options.negativeStyle.strokeWidth).applyStyle()}setSeries(t,e){this.serie1=t,this.serie2=e}setBoundaries(t,e){this.options.from=t,this.options.to=e}getFrom(){return this.options.from}getTo(){return this.options.to}draw(){const t=this.serie1.getWaveform(),e=this.serie2.getWaveform(),i=t.duplicate(!0).subtract(e).add(e),r=t.duplicate(!0).subtract(t.duplicate(!0).subtract(e)),a=[];let n;var o=(t=!1)=>{(t||0!=n.wave1.length||0!=n.wave2.length)&&(n={above:void 0,wave1:[],wave2:[]},a.push(n))};o(!0);for(var h=0;hr.getY(h)&&!n.above){const t=this.computeCrossing(i.getX(h-1),i.getY(h-1),i.getX(h),i.getY(h),r.getX(h-1),r.getY(h-1),r.getX(h),r.getY(h));n.wave1.push([t.x,t.y]),o(),n.wave1.push([t.x,t.y]),n.above=!0}if(i.getY(h)r.getY(1)),n.wave1.push([i.getX(h),i.getY(h)]),n.wave2.push([r.getX(h),r.getY(h)])}this.series.forEach(t=>t.kill()),this.series=a.forEach((t,e)=>{const i=this.graph.newSerie(`__graph_serielinedifference_${this.serie1.getName()}_${this.serie2.getName()}_${e}`),r=new s.Waveform;r.setData(t.wave1.map(t=>t[1]).concat(t.wave2.reverse().map(t=>t[1])),t.wave1.map(t=>t[0]).concat(t.wave2.map(t=>t[0]))),t.wave1[0]&&r.append(t.wave1[0][0],t.wave1[0][1]),i.setWaveform(r),i.setXAxis(this.serie1.getXAxis()),i.setYAxis(this.serie1.getYAxis()),t.above?i.setFillColor(this.options.positiveStyle.fillColor):i.setFillColor(this.options.negativeStyle.fillColor)})}computeCrossing(t,e,i,s,r,a,n,o){var h=(s-e)/(i-t),l=(o-a)/(n-r),u=s-h*i;if(t==i||r==n)return!1;if(h==l)return{x:t,y1:e,y2:e,y:e};var d=(u-(o-l*n))/(l-h);return!(d>i||dn)&&{x:d,y:h*d+u}}getPositivePolyline(){return this.positivePolyline}getNegativePolyline(){return this.negativePolyline}}i.default=n,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},4510:function(t,e,i){var s,r,a;r=[e,i(2458),i(2474)],void 0===(a="function"==typeof(s=function(i,s,r){"use strict";var a;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(s),r=(a=r)&&a.__esModule?a:{default:a};class n extends r.default{constructor(){super(...arguments)}static default(){return{}}init(t,e){super.init(t,e),this.shapeType=e.type}setShape(t){this.shapeInfo.shapeType=t}onMouseDown(t,e,i,r){if(this.shapeType||this.options.url){var n,o,h=this;this.count=this.count||0,e-=t.getPaddingLeft(),i-=t.getPaddingTop();var l={position:[{x:n=t.getXAxis().getVal(e),y:o=t.getYAxis().getVal(i)},{x:n,y:o}],onChange:function(e){t.triggerEvent("onAnnotationChange",e)},locked:!1,selectable:!0,resizable:!0,movable:!0};let u=this.options.properties;if(s.extend(!0,l,this.options),this.emit("beforeNewShape",r,l),!this.graph.prevent(!1)){var d=t.newShape(l.type,l,!1,u);this.emit("createdShape",r,d),d&&(h.currentShape=d,h.currentShapeEvent=r),t.once("mouseUp",()=>{this.currentShape||h.emit("newShape",r,d)})}}}onMouseMove(t,e,i,s){if(this.currentShape){this.count++;var r=this.currentShape;this.currentShape=!1,t.selectedSerie&&!r.serie&&r.setSerie(t.selectedSerie),r.resizing=!0,r.options&&r.options.onCreate&&r.options.onCreate.call(r),r.draw(),t.selectShape(r),r.handleMouseDown(this.currentShapeEvent,!0),r.handleSelected=this.options.handleSelected||1,r.handleMouseMove(s,!0)}}onMouseUp(){this.currentShape&&(this.currentShape.kill(),this.currentShape=!1)}}i.default=n,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},6672:function(t,e,i){var s,r,a;r=[e,i(2688),i(7175),i(2458),i(2474)],void 0===(a="function"==typeof(s=function(i,s,r,a,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=o(s),r=o(r),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(a),n=o(n);class h extends n.default{constructor(){super(...arguments),this.series=[],this.plugins=[],this.currentSlots={},this.requestLevels=new Map,this.update=(t,e)=>{this.series.forEach(function(e){this.updateSerie(e,t)}),t||this.recalculateSeries(e)}}static default(){return{LRUName:"PluginTimeSerieManager",intervals:[1e3,15e3,6e4,9e5,36e5,864e4],maxParallelRequests:3,optimalPxPerPoint:2,nbPoints:1e3,url:""}}init(t){this.graph=t,r.default.create(this.options.LRUName,200),this.requestsRunning=0}setURL(t){return this.options.url=t,this}setAvailableIntervals(){this.options.intervals=arguments}newSerie(t,e,i,r,a){var n=this.graph.newSerie(t,e,i);return this.currentSlots[t]={min:0,max:0,interval:0},n.on("hide",function(){n._zoneSerie&&n._zoneSerie.hide()}),n.on("show",function(){n._zoneSerie&&n._zoneSerie.show()}),n.setInfo("timeSerieManagerDBElements",r),a||(n._zoneSerie=this.graph.newSerie(t+"_zone",{},s.default.SERIE_ZONE)),this.series.push(n),n}registerPlugin(t){if(-1Date.now());)s.register(t,h,i,i==n?r[1]:r[2],!0,e),h++})}this.processRequests()}cleanRegister(t){this.requestLevels&&this.requestLevels.forEach(e=>{e.forEach((i,s)=>{i[4]Date.now()&&h.timeout=this.options.maxParallelRequests)){for(var t,e=this,i=1;;){for(var s in this.requestLevels[i])if(1!=this.requestLevels[i][s][0]){t=this.requestLevels[i][s];break}if(t)break;if(10<++i)return}this.requestsRunning++,t&&(t[0]=1,a.ajaxGet({url:this.getURL(t),method:"GET",json:!0}).done(function(a){1==a.status&&(e.requestsRunning--,delete e.requestLevels[i][s],r.default.store(e.options.LRUName,t[1],a.data),e.processRequests(),1==t[5]&&0==Object.keys(e.requestLevels[1]).length&&e.recalculateSeries(!0))}))}}computeTimeMax(t,e){return(t+1)*(e*this.options.nbPoints)}computeTimeMin(t,e){return t*(e*this.options.nbPoints)}getURL(t){var e=this.options.url.replace("",t[2]).replace("",this.computeTimeMin(t[3],t[4])).replace("",this.computeTimeMax(t[3],t[4])).replace("",t[4]),i=t[6]||{};for(var s in i)e=e.replace(`<${s}>`,i[s]);return e}getOptimalInterval(t){var e,i=(this.options.optimalPxPerPoint||1)*t/this.graph.getDrawingWidth(),s=1/0;return this.options.intervals.forEach(function(t){var r=Math.min(s,Math.abs(t-i));s!==r&&(e=t,s=r)}),e||1e3}computeUniqueID(t,e,i){var s="",r=t.getInfo("timeSerieManagerDBElements");for(var a in r)s+=`;${a}:${r[a]}`;return`${t.getName()};${e};${i}${s}`}computeSlotID(t,e){return Math.floor(t/(e*this.options.nbPoints))}computeSlotTime(t,e){return t*(e*this.options.nbPoints)}getZoneSerie(t){return t._zoneSerie}updateZoneSerie(t){var e=this.graph.getSerie(t);e&&e._zoneSerie&&(e._zoneSerie.setXAxis(e.getXAxis()),e._zoneSerie.setYAxis(e.getYAxis()),e._zoneSerie.setFillColor(e.getLineColor()),e._zoneSerie.setLineColor(e.getLineColor()),e._zoneSerie.setFillOpacity(.2),e._zoneSerie.setLineOpacity(.3))}recalculateSeries(t){var e=this;this.locked||(this.changed=!1,this.series.map(function(i){e.recalculateSerie(i,t)}),this.changed=!1,e.graph.draw())}recalculateSerie(t,e){var i=t.getXAxis().getCurrentMin(),s=t.getXAxis().getCurrentMax(),a=this.getOptimalInterval(s-i),n=this.computeSlotID(i,a),o=this.computeSlotID(s,a),h=[],l=[];if(!(!e&&a==this.currentSlots[t.getName()].interval&&this.currentSlots[t.getName()].min<=n&&this.currentSlots[t.getName()].max>=o)){n-=2,o+=2,this.currentSlots[t.getName()].min=n,this.currentSlots[t.getName()].max=o,this.currentSlots[t.getName()].interval=a;for(var u=n;u<=o;){const e=r.default.get(this.options.LRUName,this.computeUniqueID(t,u,a));e?(h=h.concat(e.data.mean),l=l.concat(e.data.minmax)):this.recalculateSerieUpwards(t,u,a,h,l),u++}this.changed=!0,t.setData(h),t._zoneSerie&&t._zoneSerie.setData(l)}}setIntervalCheck(t){this.interval&&clearInterval(this.interval),this.update(!0,!0),this.interval=setInterval(()=>{this.update(!0,!1)},t)}recalculateSerieUpwards(t,e,i,s,a){var n=this.options.intervals.slice(0);n.sort();var o=n[n.indexOf(i)+1]||-1;if(0>o)return[];var h=this.computeSlotTime(e,i),l=this.computeSlotTime(e+1,i),u=this.computeSlotID(h,o),d=!1;const p=r.default.get(this.options.LRUName,this.computeUniqueID(t,u,o));if(p)for(var g=0,c=p.data.mean.length;g=l))return void(a=(s=s.concat(p.data.mean.slice(d,g))).concat(p.data.minmax.slice(d,g)));return this.recalculateSerieUpwards(t,u,o,s,a)}lockRedraw(){this.locked=!0}unlockRedraw(){this.locked=!1}isRedrawLocked(){return!!this.locked}}i.default=h,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},9929:function(t,e,i){var s,r,a;r=[e,i(2458),i(2474)],void 0===(a="function"==typeof(s=function(i,s,r){"use strict";var a;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(s),r=(a=r)&&a.__esModule?a:{default:a};class n extends r.default{constructor(){super(...arguments)}static default(){return{axes:"all"}}init(t){this._zoomingGroup=document.createElementNS(t.ns,"g"),this._zoomingSquare=document.createElementNS(t.ns,"rect"),this._zoomingSquare.setAttribute("display","none"),s.setAttributeTo(this._zoomingSquare,{display:"none",fill:"rgba(171,12,12,0.2)",stroke:"rgba(171,12,12,1)","shape-rendering":"crispEdges",x:0,y:0,height:0,width:0,"pointer-events":"none"}),this.graph=t,t.groupEvent.appendChild(this._zoomingGroup),this._zoomingGroup.appendChild(this._zoomingSquare)}onMouseDown(t,e,i,s,r){var a=this.options.zoomMode;if(a){switch(this._zoomingMode=a,void 0===e&&(this._backedUpZoomMode=this._zoomingMode,this._zoomingMode="y",e=0),void 0===i&&(this._backedUpZoomMode=this._zoomingMode,this._zoomingMode="x",i=0),this._zoomingXStart=e,this._zoomingYStart=i,this.x1=e-t.getPaddingLeft(),this.y1=i-t.getPaddingTop(),this._zoomingSquare.setAttribute("width",0),this._zoomingSquare.setAttribute("height",0),this._zoomingSquare.setAttribute("display","block"),this._zoomingMode){case"x":this._zoomingSquare.setAttribute("y",t.options.paddingTop),this._zoomingSquare.setAttribute("height",t.getDrawingHeight()-t.shift.bottom);break;case"y":this._zoomingSquare.setAttribute("x",t.options.paddingLeft),this._zoomingSquare.setAttribute("width",t.getDrawingWidth());break;case"forceY2":this.y2=t.getYAxis().getPx(this.options.forcedY)+t.options.paddingTop;}this.options.onZoomStart&&!r&&this.options.onZoomStart(t,e,i,s,r)}}onMouseMove(t,e,i,s,r){switch(this._zoomingMode){case"xy":this._zoomingSquare.setAttribute("x",Math.min(this._zoomingXStart,e)),this._zoomingSquare.setAttribute("y",Math.min(this._zoomingYStart,i)),this._zoomingSquare.setAttribute("width",Math.abs(this._zoomingXStart-e)),this._zoomingSquare.setAttribute("height",Math.abs(this._zoomingYStart-i));break;case"forceY2":this._zoomingSquare.setAttribute("y",Math.min(this._zoomingYStart,this.y2)),this._zoomingSquare.setAttribute("height",Math.abs(this._zoomingYStart-this.y2)),this._zoomingSquare.setAttribute("x",Math.min(this._zoomingXStart,e)),this._zoomingSquare.setAttribute("width",Math.abs(this._zoomingXStart-e));break;case"x":this._zoomingSquare.setAttribute("x",Math.min(this._zoomingXStart,e)),this._zoomingSquare.setAttribute("width",Math.abs(this._zoomingXStart-e));break;case"y":this._zoomingSquare.setAttribute("y",Math.min(this._zoomingYStart,i)),this._zoomingSquare.setAttribute("height",Math.abs(this._zoomingYStart-i));}this.options.onZoomMove&&!r&&this.options.onZoomMove(t,e,i,s,r)}onMouseUp(t,e,i,s,r){var a=this;this.removeZone();var n=e-t.options.paddingLeft,o=i-t.options.paddingTop;if(this.emit("beforeZoom",{graph:t,x:e,y:i,e:s,mute:r}),!t.prevent(!1)&&(0!=e-this._zoomingXStart||"y"==this._zoomingMode)&&(0!=i-this._zoomingYStart||"x"==this._zoomingMode))if(this.options.transition||this.options.smooth){let t=!1,e=!1;"x"!=this._zoomingMode&&"xy"!=this._zoomingMode&&"forceY2"!=this._zoomingMode||(this.fullX=!1,this.toAxes(function(t){t._pluginZoomMin=t.getCurrentMin(),t._pluginZoomMax=t.getCurrentMax(),t._pluginZoomMinFinal=Math.min(t.getVal(n),t.getVal(a.x1)),t._pluginZoomMaxFinal=Math.max(t.getVal(n),t.getVal(a.x1))},!1,!0,!1),t=!0),"y"!=this._zoomingMode&&"xy"!=this._zoomingMode||(this.fullY=!1,this.toAxes(function(t){t._pluginZoomMin=t.getCurrentMin(),t._pluginZoomMax=t.getCurrentMax(),t._pluginZoomMinFinal=Math.min(t.getVal(o),t.getVal(a.y1)),t._pluginZoomMaxFinal=Math.max(t.getVal(o),t.getVal(a.y1))},!1,!1,!0),e=!0),"forceY2"==this._zoomingMode&&(this.fullY=!1,this.toAxes(function(t){t._pluginZoomMin=t.getCurrentMin(),t._pluginZoomMax=t.getCurrentMax(),t._pluginZoomMinFinal=Math.min(t.getVal(a.y2),t.getVal(a.y1)),t._pluginZoomMaxFinal=Math.max(t.getVal(a.y2),t.getVal(a.y1))},!1,!1,!0),e=!0),this.transition(t,e,"zoomEnd")}else{switch(this._zoomingMode){case"x":this.fullX=!1,this.toAxes("_doZoom",[n,this.x1],!0,!1);break;case"y":this.fullY=!1,this.toAxes("_doZoom",[o,this.y1],!1,!0);break;case"xy":this.fullX=!1,this.fullY=!1,this.toAxes("_doZoom",[n,this.x1],!0,!1),this.toAxes("_doZoom",[o,this.y1],!1,!0);break;case"forceY2":this.fullX=!1,this.fullY=!1,this.toAxes("_doZoom",[n,this.x1],!0,!1),this.toAxes("_doZoom",[this.y1,this.y2],!1,!0);}t.draw(),this._backedUpZoomMode&&(this._zoomingMode=this._backedUpZoomMode),this.emit("zoomed"),t.pluginYieldActiveState()}}removeZone(){this._zoomingSquare.setAttribute("display","none")}onMouseWheel(t,e,i,s,r){r||(r={}),r.baseline||(r.baseline=0);let a=r.baseline;"mousePosition"==r.baseline&&(a=this.graph.getYAxis().getVal(s));var n="x"==r.direction,o="y"===r.direction;this.toAxes("handleMouseWheel",[t,e,a],n,o),this.graph.drawSeries()}onDblClick(t,e,i,s,r){var a=this.graph;if(this.emit("beforeDblClick",{graph:a,x:t,y:e,pref:s,e:i,mute:r}),!a.prevent(!1)){if(this.options.transition||this.options.smooth){var n=!1,o=!1;let t,e;return"xtotal"!=s.mode&&"total"!=s.mode||(this.toAxes(function(t){t._pluginZoomMin=t.getCurrentMin(),t._pluginZoomMax=t.getCurrentMax(),t._pluginZoomMinFinal=t.getDefaultMin(),t._pluginZoomMaxFinal=t.getDefaultMax()},!1,!0,!1),n=!0),"ytotal"!=s.mode&&"total"!=s.mode||(this.toAxes(function(t){t._pluginZoomMin=t.getCurrentMin(),t._pluginZoomMax=t.getCurrentMax(),t._pluginZoomMinFinal=t.getDefaultMin(),t._pluginZoomMaxFinal=t.getDefaultMax()},!1,!1,!0),o=!0),"gradualX"!=s.mode&&"gradualY"!=s.mode&&"gradual"!=s.mode&&"gradualXY"!=s.mode||(t=!1,e=!1,"gradualX"!=s.mode&&"gradual"!=s.mode&&"gradualXY"!=s.mode||(t=!0,n=!0),"gradualY"!=s.mode&&"gradual"!=s.mode&&"gradualXY"!=s.mode||(e=!0,o=!0),this.toAxes(function(t){t._pluginZoomMin=t.getCurrentMin(),t._pluginZoomMax=t.getCurrentMax(),t._pluginZoomMinFinal=t.getCurrentMin()-(t.getCurrentMax()-t.getCurrentMin()),t._pluginZoomMaxFinal=t.getCurrentMax()+(t.getCurrentMax()-t.getCurrentMin())},!1,t,e)),void this.transition(n,o,"dblClick")}var h=this.graph.getXAxis(),l=this.graph.getYAxis();if("xtotal"==s.mode)this.toAxes("setMinMaxToFitSeries",null,!0,!1),this.fullX=!0,this.fullY=!1;else if("ytotal"==s.mode)this.toAxes("setMinMaxToFitSeries",null,!1,!0),this.fullX=!1,this.fullY=!0;else if("total"==s.mode)this.toAxes("setMinMaxToFitSeries",null,!0,!0),this.fullX=!0,this.fullY=!0;else{t-=this.graph.options.paddingLeft,e-=this.graph.options.paddingTop;var u=h.getCurrentMin(),d=h.getCurrentMax(),p=h.getVal(t),g=d-u,c=l.getCurrentMin(),f=l.getCurrentMax(),x=l.getVal(e),m=f-c;if("gradualXY"==s.mode||"gradualX"==s.mode){var y=(p-u)/(d-u);u=Math.max(h.getMinValue()-h.getInterval()*h.options.axisDataSpacing.min,u-g*y),d=Math.min(h.getMaxValue()+h.getInterval()*h.options.axisDataSpacing.max,d+g*(1-y)),h.setCurrentMin(u),h.setCurrentMax(d),h.options.onZoom&&h.options.onZoom(u,d),h.cacheCurrentMin(),h.cacheCurrentMax(),h.cacheInterval()}"gradualXY"!=s.mode&&"gradualY"!=s.mode||(y=(x-c)/(f-c),c=Math.max(l.getMinValue()-l.getInterval()*l.options.axisDataSpacing.min,c-m*y),f=Math.min(l.getMaxValue()+l.getInterval()*l.options.axisDataSpacing.max,f+m*(1-y)),l.setCurrentMin(c),l.setCurrentMax(f),l.options.onZoom&&l.options.onZoom(c,f),l.cacheCurrentMin(),l.cacheCurrentMax(),l.cacheInterval())}a.pluginYieldActiveState(),this.graph.draw()}}transition(t,e,i){var s=this,r=500;s.gradualUnzoomStart||(s.gradualUnzoomStart=Date.now()),window.requestAnimationFrame(function(){var a=Date.now()-s.gradualUnzoomStart;a>r&&(a=r);var n=Math.sin(a/r*Math.PI/2);s.toAxes(function(t){t.setCurrentMin(t._pluginZoomMin+(t._pluginZoomMinFinal-t._pluginZoomMin)*n),t.setCurrentMax(t._pluginZoomMax+(t._pluginZoomMaxFinal-t._pluginZoomMax)*n),t.cacheCurrentMin(),t.cacheCurrentMax(),t.cacheInterval()},!1,t,e),s.graph.draw(),a{if(e.type){e.properties.label&&(Array.isArray(e.properties.label)||(e.properties.label=[e.properties.label]),e.properties.label.forEach((t,i)=>{for(let s in t){let r=`label${s.charAt(0).toUpperCase()}${s.slice(1)}`;e.properties[r]||(e.properties[r]=[]),e.properties[r][i]=t[s]}}));const r=t.newShape(e.type,{},!1,e.properties);e.serie&&r.setSerie(e.serie),i&&r.setSerie(i),e.layer&&r.setLayer(e.layer),e.xAxis&&r.setXAxis(s[e.xAxis]),e.yAxis&&r.setYAxis(s[e.yAxis]),r.draw(),r.redraw()}},t.exports=e.default})?i.apply(e,[e]):i)||(t.exports=s)},1854:function(t,e){var i,s;void 0===(s="function"==typeof(i=function(i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;const s=(t,e,i,s,r)=>{Array.isArray(s)||(s=[s]),s.forEach(s=>{let a;"x"==i?i="bottom":"y"==i&&(i="left"),"bottom"==i||"top"==i?(a="graph.axis.x","category"==s.type?a+=".bar":"time"==s.type&&(a+=".time")):a="graph.axis.y";var n=new(t.getConstructor(a))(e,i);n.init(e,s),"bottom"==i?e.setBottomAxis(n,e.getNumAxes("bottom")):"top"==i?e.setTopAxis(n,e.getNumAxes("top")):"left"==i?e.setLeftAxis(n,e.getNumAxes("left")):"right"==i&&e.setRightAxis(n,e.getNumAxes("right")),"category"==s.type&&(n.categories=s.categories),s.name&&(r[name]=n)})};i.default=(t,e,i)=>{const r=[];i.x&&s(t,e,"x",i.x,r),i.y&&s(t,e,"y",i.y,r),i.top&&s(t,e,"top",i.top,r),i.left&&s(t,e,"left",i.left,r),i.bottom&&s(t,e,"bottom",i.bottom,r),i.right&&s(t,e,"right",i.right,r)},t.exports=e.default})?i.apply(e,[e]):i)||(t.exports=s)},574:function(t,e,i){var s,r,a;r=[e,i(8085),i(1854),i(2301)],void 0===(a="function"==typeof(s=function(i,s,r,a){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=n(s),r=n(r),a=n(a),i.default=(t,e,i)=>{let n=[];if(e.resize(i.width||400,i.height||300),i.axes&&(0,r.default)(t,e,i.axes),i.legend){const t={};i.legend.seriesHideable&&(t.isSerieHideable=!0),i.legend.seriesSelectable&&(t.isSerieSelectable=!0);const s=e.makeLegend(t);if(i.legend.position)switch(i.legend.position){case"bottom":s.setAutoPosition("bottom");break;case"top":s.setAutoPosition("top");break;case"left":s.setAutoPosition("left");break;case"right":s.setAutoPosition("right");break;default:s.setPosition(i.legend.position);}}i.series&&(Array.isArray(i.series)||(i.series=[i.series]),i.series.forEach((i,r)=>{let o,h;switch(i.type){case"scatter":o=t.SERIE_SCATTER;break;case"bar":o=t.SERIE_BAR;break;case"box":o=t.SERIE_BOX;break;case"color":o=t.SERIE_LINE_COLORED;break;case"line":default:o=t.SERIE_LINE;}switch(i.type){case"bar":h=t.newWaveformHash(),i.data.errors?h.setData(i.data.values):h.setData(i.data);break;default:case"line":case"scatter":h=t.newWaveform(),h.setData(i.data.y,i.data.x);}i.data.errors&&(i.data.errors.xBar&&h.setErrorBarX(i.data.errors.xBar),i.data.errors.xBarAbove&&h.setErrorBarXAbove(i.data.errors.xBarAbove),i.data.errors.xBarBelow&&h.setErrorBarXBelow(i.data.errors.xBarBelow),i.data.errors.yBar&&h.setErrorBar(i.data.errors.yBar),i.data.errors.yBarAbove&&h.setErrorBarAbove(i.data.errors.yBarAbove),i.data.errors.yBarBelow&&h.setErrorBarBelow(i.data.errors.yBarBelow),i.data.errors.xBox&&h.setErrorBoxX(i.data.errors.xBox),i.data.errors.xBoxAbove&&h.setErrorBoxXAbove(i.data.errors.xBoxAbove),i.data.errors.xBoxBelow&&h.setErrorBoxXBelow(i.data.errors.xBoxBelow),i.data.errors.yBox&&h.setErrorBox(i.data.errors.yBox),i.data.errors.yBoxAbove&&h.setErrorBoxAbove(i.data.errors.yBoxAbove),i.data.errors.yBoxBelow&&h.setErrorBoxBelow(i.data.errors.yBoxBelow));const l=e.newSerie(i.name||"_serie_"+r,i.options||{},o);switch(i.type){case"color":i.data.color&&l.setColors(i.data.color);}l.autoAxis(),i.excludeFromLegend&&l.excludeFromLegend(!0),h.xAxis&&n[h.xAxis]&&l.setXAxis(n[h.xAxis]),h.yAxis&&n[h.yAxis]&&l.setYAxis(n[h.yAxis]),h&&l.setWaveform(h),i.style&&(0,s.default)(t,l,i,o),i.annotations&&i.annotations.forEach(t=>{(0,a.default)(e,t,l,n)})})),i.annotations&&i.annotations.forEach(t=>{(0,a.default)(e,t,void 0,n)})},t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},5502:function(t,e,i){var s,r,a;r=[e,i(574)],void 0===(a="function"==typeof(s=function(i,s){"use strict";var r;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=(r=s)&&r.__esModule?r:{default:r},i.default=t=>{t.fromJSON=(e,i,r)=>{const a=e.options||{},n=new t(void 0,a);return(0,s.default)(t,n,e,i),n.setWrapper(i),r&&n.onAll(function(t,...e){r(t,...e)}),n},t.prototype.setJSON=(e,i={})=>{(void 0).killSeries();const r={};i.keepState&&(void 0)._applyToAxes(t=>{t.options.name&&(r[t.options.name]={min:t.getCurrentMin(),max:t.getCurrentMax()})},void 0,!0,!0),(void 0)._applyToAxes(t=>{(void 0).killAxis(t,!0,!0)},void 0,!0,!0),(void 0).killLegend(),(void 0).killShapes(),(0,s.default)(t,void 0,e),i.keepState&&(void 0)._applyToAxes(t=>{t.options.name&&r[t.options.name]&&(t.setCurrentMin(r[t.options.name].min),t.setCurrentMax(r[t.options.name].max))},void 0,!0,!0),(void 0).draw()}},t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},8085:function(t,e){var i,s;void 0===(s="function"==typeof(i=function(i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,i.default=(t,e,i,s)=>{let r=i.style;Array.isArray(r)||(r=[{name:"unselected",style:r}]),r.map(({name:i,style:r})=>{r.line&&(s==t.SERIE_LINE||s==t.SERIE_BAR||s==t.SERIE_LINE_COLORED)&&(r.line.color&&s!=t.SERIE_LINE_COLORED&&e.setLineColor(r.line.color,i),r.line.width&&e.setLineWidth(r.line.width,i),(r.line.dash||r.line.style)&&e.setLineStyle(r.line.dash||r.line.style,i),r.line.fill&&e.setFillColor(r.line.fill,i),r.line.fillOpacity&&e.setFillOpacity&&e.setFillOpacity(r.line.fillOpacity,i)),r.errorBar&&e.setErrorBarStyle(r.errorBar),r.errorBox&&e.setErrorBoxStyle(r.errorBox),r.marker&&(s==t.SERIE_LINE||s==t.SERIE_SCATTER)&&((t,e,i)=>{t.showMarkers();let s={},r=[];e.default?(s=e.default,e.modifiers&&(r=e.modifiers)):(s=e,r=[]),t.setMarkerStyle(s,r,i)})(e,r.marker,i)})},t.exports=e.default})?i.apply(e,[e]):i)||(t.exports=s)},6340:function(t,e,i){var s,r,a;r=[e,i(2458),i(7648),i(6967)],void 0===(a="function"==typeof(s=function(i,s,r,a){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(s),r=n(r),a=n(a);class o extends a.default{constructor(){super(...arguments),this.pathDom=document.createElementNS(this.graph.ns,"path"),this.groupMain.appendChild(this.pathDom),this.styles={},this.styles.unselected={lineColor:this.options.lineColor,lineStyle:this.options.lineStyle,lineWidth:this.options.lineWidth,fillColor:this.options.fillColor,fillOpacity:this.options.fillOpacity,markers:this.options.markers}}setFillColor(t,e,i){return e=e||"unselected",this.styles[e]=this.styles[e]||{},this.styles[e].fillColor=t,i&&this.setFillColor(t,"selected"),this.styleHasChanged(e),this}getFillColor(t){return this.getStyle(t).fillColor}setFillOpacity(t,e,i){return e=e||"unselected",this.styles[e]=this.styles[e]||{},this.styles[e].fillOpacity=t,i&&this.setLineWidth(t,"selected"),this.styleHasChanged(e),this}getFillOpacity(t){return this.getStyle(t).fillOpacity||1}applyLineStyles(){this.applyLineStyle(this.pathDom)}applyLineStyle(t){t.setAttribute("stroke",this.getLineColor()),t.setAttribute("stroke-width",this.getLineWidth()),this.getLineDashArray()?t.setAttribute("stroke-dasharray",this.getLineDashArray()):t.removeAttribute("stroke-dasharray"),t.setAttribute("fill",this.getFillColor()),t.setAttribute("fill-opacity",this.getFillOpacity()||1)}draw(){var t="";this.hasErrors()&&this.errorDrawInit();for(var e=0;en(t)):this.data[h].outliers=[];return this.dataHasChanged(),this.graph.updateDataMinMaxAxes(),this}_style(t,e,i="unselected",s=!1){return this.styles[i]=this.styles[i]||{},this.styles[i][t]=e,s&&this._set(t,e,"selected"),this.styleHasChanged(i),this}_gstyle(t,e){return this.getStyle(e)[t]}getStyle(t="unselected"){return this.styles[t]||{}}setMeanLineColor(){return this._style("meanLineColor",...arguments)}getMeanLineColor(){return this._gstyle("meanLineColor",...arguments)}setStyle(t,e="unselected"){this.styles[e]=(0,s.extend)({},this.default().defaultStyle,this.styles.unselected,t),this.styleHasChanged(e)}setMeanLineWidth(){return this._style("meanLineWidth",...arguments)}getMeanLineWidth(){return this._gstyle("meanLineWidth",...arguments)}setBoxAboveLineColor(){return this._style("boxAboveLineColor",...arguments)}getBoxAboveLineColor(){return this._gstyle("boxAboveLineColor",...arguments)}setBoxBelowLineColor(){return this._style("boxBelowLineColor",...arguments)}getBoxBelowLineColor(){return this._gstyle("boxBelowLineColor",...arguments)}setBoxAboveLineWidth(){return this._style("boxAboveLineWidth",...arguments)}getBoxAboveLineWidth(){return this._gstyle("boxAboveLineWidth",...arguments)}setBoxBelowLineWidth(){return this._style("boxBelowLineWidth",...arguments)}getBoxBelowLineWidth(){return this._gstyle("boxBelowLineWidth",...arguments)}setBoxAboveFillColor(){return this._style("boxAboveFillColor",...arguments)}getBoxAboveFillColor(){return this._gstyle("boxAboveFillColor",...arguments)}setBoxBelowFillColor(){return this._style("boxBelowFillColor",...arguments)}getBoxBelowFillColor(){return this._gstyle("boxBelowFillColor",...arguments)}setBoxAboveFillOpacity(){return this._style("boxAboveFillOpacity",...arguments)}getBoxAboveFillOpacity(){return this._gstyle("boxAboveFillOpacity",...arguments)}setBoxBelowFillOpacity(){return this._style("boxBelowFillOpacity",...arguments)}getBoxBelowFillOpacity(){return this._gstyle("boxBelowFillOpacity",...arguments)}setBarAboveLineColor(){return this._style("barAboveLineColor",...arguments)}getBarAboveLineColor(){return this._gstyle("barAboveLineColor",...arguments)}setBarBelowLineColor(){return this._style("barBelowLineColor",...arguments)}getBarBelowLineColor(){return this._gstyle("barBelowLineColor",...arguments)}setBarAboveLineWidth(){return this._style("barAboveLineWidth",...arguments)}getBarAboveLineWidth(){return this._gstyle("barAboveLineWidth",...arguments)}setBarBelowLineWidth(){return this._style("barBelowLineWidth",...arguments)}getBarBelowLineWidth(){return this._gstyle("barBelowLineWidth",...arguments)}setOutlierLineColor(){return this._style("outlierLineColor",...arguments)}getOutlierLineColor(){return this._gstyle("outlierLineColor",...arguments)}setOutlierLineWidth(){return this._style("outlierLineWidth",...arguments)}getOutlierLineWidth(){return this._gstyle("outlierLineWidth",...arguments)}setOutlierFillColor(){return this._style("outlierFillColor",...arguments)}getOutlierFillColor(){return this._gstyle("outlierFillColor",...arguments)}setOutlierFillOpacity(){return this._style("outlierFillOpacity",...arguments)}getOutlierFillOpacity(){return this._gstyle("outlierFillOpacity",...arguments)}applyLineStyles(){this.applyLineStyle(this.pathDom)}applyLineStyle(t){t.setAttribute("stroke",this.getLineColor()),t.setAttribute("stroke-width",this.getLineWidth()),t.removeAttribute("stroke-dasharray"),t.setAttribute("fill",this.getFillColor()),t.setAttribute("fill-opacity",this.getFillOpacity()||1)}draw(){if(!this.data)return;let t,e,i,r,a,n,o,h,l="y"==this.options.orientation?this.getYAxis():this.getXAxis(),u="y"==this.options.orientation?this.getXAxis():this.getYAxis();if((0,s.emptyDom)(this.groupMain),"category"==u.getType())e=u.getRelPx(.8/this.nbCategories),!0;else{e=this.options.maxBoxWidth;for(var p=0,g=this.data.length;p{tl.getPos(t));var c=document.createElementNS(this.graph.ns,"line");this.applyMeanStyle(c);var f=document.createElementNS(this.graph.ns,"rect"),x=document.createElementNS(this.graph.ns,"rect");"y"==this.options.orientation?(f.setAttribute("width",e),f.setAttribute("x",t[0]-e/2),x.setAttribute("width",e),x.setAttribute("x",t[0]-e/2),c.setAttribute("x1",t[0]-e/2),c.setAttribute("x2",t[0]+e/2),c.setAttribute("y1",i),c.setAttribute("y2",i)):(f.setAttribute("height",e),f.setAttribute("y",t[0]-e/2),x.setAttribute("height",e),x.setAttribute("y",t[0]-e/2),c.setAttribute("y1",t[0]-e/2),c.setAttribute("y2",t[0]+e/2),c.setAttribute("x1",i),c.setAttribute("x2",i)),this.boxPos(f,i,r,"x"==this.options.orientation),this.boxPos(x,i,a,"x"==this.options.orientation),this.applyBoxStyle(f,x);var m=document.createElementNS(this.graph.ns,"line"),y=document.createElementNS(this.graph.ns,"line");"y"==this.options.orientation?(void 0!==n&&(m.setAttribute("y1",r),m.setAttribute("y2",n),m.setAttribute("x1",t[0]),m.setAttribute("x2",t[0])),void 0!==o&&(y.setAttribute("y1",a),y.setAttribute("y2",o),y.setAttribute("x1",t[0]),y.setAttribute("x2",t[0]))):(void 0!==n&&(m.setAttribute("x1",r),m.setAttribute("x2",n),m.setAttribute("y1",t[0]),m.setAttribute("y2",t[0])),void 0!==o&&(y.setAttribute("x1",a),y.setAttribute("x2",o),y.setAttribute("y1",t[0]),y.setAttribute("y2",t[0]))),h.map(e=>{let i=document.createElementNS(this.graph.ns,"circle");i.setAttribute("r",2),"y"==this.options.orientation?(i.setAttribute("cx",t[0]),i.setAttribute("cy",e)):(i.setAttribute("cy",t[0]),i.setAttribute("cx",e)),this.setOutlierStyle(i),this.groupMain.appendChild(i)}),void 0!==n&&this.groupMain.appendChild(m),void 0!==o&&this.groupMain.appendChild(y),void 0!==r&&this.groupMain.appendChild(f),void 0!==a&&this.groupMain.appendChild(x),this.groupMain.appendChild(c),this.applyWhiskerStyle(m,y)}}applyBoxStyle(t,e){t.setAttribute("stroke",this.getBoxAboveLineColor()),t.setAttribute("stroke-width",this.getBoxAboveLineWidth()),void 0!==this.getBoxAboveFillColor()&&t.setAttribute("fill",this.getBoxAboveFillColor()),void 0!==this.getBoxAboveFillOpacity()&&t.setAttribute("fill-opacity",this.getBoxAboveFillOpacity()),e.setAttribute("stroke",this.getBoxBelowLineColor()),e.setAttribute("stroke-width",this.getBoxBelowLineWidth()),void 0!==this.getBoxBelowFillColor()&&e.setAttribute("fill",this.getBoxBelowFillColor()),void 0!==this.getBoxAboveFillOpacity()&&e.setAttribute("fill-opacity",this.getBoxBelowFillOpacity())}applyWhiskerStyle(t,e){t.setAttribute("stroke",this.getBarAboveLineColor()),t.setAttribute("stroke-width",this.getBarAboveLineWidth()),e.setAttribute("stroke",this.getBarBelowLineColor()),e.setAttribute("stroke-width",this.getBarBelowLineWidth())}applyMeanStyle(t){t.setAttribute("stroke",this.getMeanLineColor()),t.setAttribute("stroke-width",this.getMeanLineWidth())}setOutlierStyle(t){t.setAttribute("stroke",this.getOutlierLineColor()),t.setAttribute("stroke-width",this.getOutlierLineWidth()),void 0!==this.getBoxBelowFillColor()&&t.setAttribute("fill",this.getOutlierFillColor()),void 0!==this.getBoxAboveFillOpacity()&&t.setAttribute("fill-opacity",this.getOutlierFillOpacity())}getCategoryIndex(t){if(!this.categories)throw new Error("No categories were defined. Probably axis.setSeries was not called");for(var e=0;ei?(t.setAttribute(s?"x":"y",i),t.setAttribute(s?"width":"height",e-i)):(t.setAttribute(s?"x":"y",e),t.setAttribute(s?"width":"height",i-e))}getUsedCategories(){let t="y"==this.options.orientation?"x":"y",e=this.data.map(e=>e[t]);return Array.isArray(this._linkedToScatterSeries)&&this._linkedToScatterSeries.map(t=>{t.getUsedCategories().map(t=>{let i;-1<(i=e.indexOf(t))&&e.splice(i,1)})}),e}linkToScatterSerie(...t){this._linkedToScatterSeries=t}}i.default=o,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},4136:function(t,e,i){var s,r,a;r=[e,i(2458),i(6967)],void 0===(a="function"==typeof(s=function(i,s,r){"use strict";var a;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(s),r=(a=r)&&a.__esModule?a:{default:a};class n extends r.default{constructor(t){super(...arguments),this.negativeDelta=0,this.positiveDelta=0,this.negativeThreshold=0,this.positiveThreshold=0,this.groupMain.setAttribute("clip-path",`url(#_clipplot${t._creation})`)}setData(t,e,i){i=i||"float";var s,r,a,n,o=t.length,h=[];for(t instanceof Array||"object"==typeof t&&(this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,o=(t=t.segments).length),s=0;sm&&o[u+2+g]>m||o[u+p]>x&&o[u+2+p]>x||(s=this.getX(o[u+p]),r=this.getY(o[u+g]),e=this.getX(o[u+2+p]),i=this.getY(o[u+2+g]),e==s&&i==r||(this.currentLine+="M ",this.currentLine+=s,this.currentLine+=" ",this.currentLine+=r,this.currentLine+="L ",this.currentLine+=e,this.currentLine+=" ",this.currentLine+=i,this.counter++));this.currentLine+=" z",(n=this._createLine()).setAttribute("data-zvalue",this.data[h].zValue),this.zValues[this.data[h].zValue]={dom:n},this.minZ=Math.min(this.minZ,this.data[h].zValue),this.maxZ=Math.max(this.maxZ,this.data[h].zValue)}for(h++,h=this.currentLine+1;h=this.positiveThreshold||0>=r&&r<=this.negativeThreshold?"block":"none");this._shapeZoom&&(this.options.hasNegative?(this._shapeZoom.setHandleNeg(-Math.pow(this.negativeDelta,3),this.minZ),this._shapeZoom.showHandleNeg()):this._shapeZoom.hideHandleNeg(),this._shapeZoom.setHandlePos(Math.pow(this.positiveDelta,3),this.maxZ))}handleMouseMove(t,e,i){var s=t||this.getXAxis().getMouseVal(),r=i||this.getYAxis().getMouseVal();return{trueX:s,interpolatedY:r,xClosest:s,yClosest:r}}setDynamicColor(t){this.lineColors=t,this.styleHasChanged()}setNegative(t){this.options.hasNegative=t,t&&(this.negativeThreshold=0)}setColorTo(t,e,i,r){if(this.lineColors){var a={h:0,s:0,l:0};for(var n in a)a[n]=0i||h>a||0>o||0>h||(l[o]=l[o]||[],l[o][h]=l[o][h]+1||1,d=l[o][h]p?l[o][h]:p);return this.maxIndexX=i,this.maxIndexY=a,this.binMin=d,this.binMax=p,this.deltaX=e,this.deltaY=r,this.fromX=t,this.fromY=s,this.numX=i,this.numY=a,this.densitymap=l,l}setDensityMap(t,e,i,s,r){var a,n,o=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(a=0;ah?t[a][n]:h;return this.maxIndexX=t.length,this.maxIndexY=t[0].length,this.binMin=o,this.binMax=h,this.deltaX=i,this.deltaY=r,this.fromX=e,this.fromY=s,this.numX=this.maxIndexX,this.numY=this.maxIndexY,this.densitymap=t,t}calculateDensityWeighted(t,e,i,s,r,a){var n,o,h,l,u,d,p,g,c,f,x,m=[],y=this.data.length,b=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY;for(n=0;ni||h>a||0>o||0>h||(m[g]=m[g]||[],m[c]=m[c]||[],m[g][f]=m[g][f]||0,m[c][f]=m[c][f]||0,m[g][x]=m[g][x]||0,m[c][x]=m[c][x]||0,m[g][f]+=l*u,m[c][f]+=(1-l)*u,m[g][x]+=l*(1-u),m[c][x]+=(1-l)*(1-u),b=m[g][f]v?m[g][f]:v,b=m[c][f]v?m[c][f]:v,b=m[g][x]v?m[g][x]:v,b=m[c][x]v?m[c][x]:v);return this.maxIndexX=i,this.maxIndexY=a,this.binMin=b,this.binMax=v,this.deltaX=e,this.deltaY=r,this.fromX=t,this.fromY=s,this.numX=i,this.numY=a,this.densitymap=m,m}autoBins(t,e){return this.numX=t||400,this.numY=e||this.numX,this.calculateDensity(this.minX,(this.maxX-this.minX)/t,t,this.minY,(this.maxY-this.minY)/e,e),this.recalculateBinsOnDraw=!1,this}setPxPerBin(t,e,i){return t&&this.calculationDensityMap({from:"min",to:"max",pxPerBin:t,weighted:i}),e&&this.calculationDensityMap(!1,{from:"min",to:"max",pxPerBin:e,weighted:i}),this}setBinsFromTo(t,e,i,s){return this.densityMapCalculation=this.densityMapCalculation||{},this.densityMapCalculation[t]={from:e,to:i,numBins:s},this.calculationDensityMap(),this}calculationDensityMap(t,e){this.method=this.calculateDensityAdvanced,this.densityMapCalculation=this.densityMapCalculation||{},t&&(this.densityMapCalculation.x=t),e&&(this.densityMapCalculation.y=e)}calculateDensityAdvanced(){var t={x:{from:0,num:0,delta:0,weighing:!1},y:{from:0,num:0,delta:0,weighing:!1}},e={x:this.graph.drawingSpaceWidth,y:this.graph.drawingSpaceHeight},i={x:this.getXAxis,y:this.getYAxis},s=!1;for(var r in this.densityMapCalculation)if(this.densityMapCalculation[r].weighted&&(s=!0,t[r].weighing=!0),this.densityMapCalculation[r].pxPerBin){var a="min"==this.densityMapCalculation[r].from?i[r].call(this).getCurrentMin():this.densityMapCalculation[r].from,n="max"==this.densityMapCalculation[r].to?i[r].call(this).getCurrentMax():this.densityMapCalculation[r].to,o=Math.abs(i[r].call(this).getRelPx(n-a));t[r].num=Math.ceil(e[r]/this.densityMapCalculation[r].pxPerBin),t[r].from=a-Math.abs(i[r].call(this).getRelVal((t[r].num*this.densityMapCalculation[r].pxPerBin-o)/2)),t[r].delta=Math.abs(i[r].call(this).getRelVal(this.densityMapCalculation[r].pxPerBin))}else t[r].num=this.densityMapCalculation[r].numBins||400,t[r].from="min"==this.densityMapCalculation[r].from?i[r].call(this).getCurrentMin():this.densityMapCalculation[r].from,t[r].delta=this.densityMapCalculation[r].to?(("max"==this.densityMapCalculation[r].to?i[r].call(this).getCurrentMax():this.densityMapCalculation[r].to)-t[r].from)/t[r].num:this.densityMapCalculate[r].delta;(s?this.calculateDensityWeighted:this.calculateDensity).call(this,t.x.from,t.x.delta,t.x.num,t.y.from,t.y.delta,t.y.num)}setColorMapBinBoundaries(t,e,i){return this.colorMapMin=t,this.colorMapMax=e,i||(this.callbackColorMapMinMax="manual"),this}autoColorMapBinBoundaries(){return this.colorMapMin=this.binMin,this.colorMapMax=this.binMax,this}onRedrawColorMapBinBoundaries(t){return this.callbackColorMapMinMax=t,this}colorMapHSL(t,e,i){i=i||"linear";for(var s,r,a={exp:function(t){return(Math.exp(1*(t/e))-Math.exp(0))/(Math.exp(1)-Math.exp(0))},log:function(t){return(Math.log(t+1)-Math.log(1))/(Math.log(e+1)-Math.log(1))},linear:function(t){return(t-0)/(e-0)}},n=0,o=[],h=[],l={h:null,s:null,l:null,a:null},u=t.length-1,d=0;d<=e;d++){for(var p in s=a[i](d),(r=Math.floor(s*u))==t.length-1&&(r=u-1),s=(s-r/u)/(1/u),l)l[p]=(t[r+1][p]-t[r][p])*s+t[r][p];o[n]=`hsl(${l.h}, ${Math.round(100*l.s)}%, ${Math.round(100*l.l)}%)`,h[n]=l.a,n++}return this.opacities=h,this.colorMap=o,this.colorMapNum=e,this}autoColorMapHSL(t,e="linear"){return this.colorMapHSL(t,100,e),this}getColorIndex(t){return Math.max(0,Math.min(this.colorMapNum,Math.floor((t-this.colorMapMin)/(this.colorMapMax-this.colorMapMin)*this.colorMapNum)))}draw(){var t;if(!(this.method&&this.method(),this.callbackColorMapMinMax&&null!=this.colorMapMin&&null!=this.colorMapMax&&"auto"!=this.callbackColorMapMinMax))this.autoColorMapBinBoundaries();else if("function"==typeof this.callbackColorMapMinMax){var e=this.callbackColorMapMinMax(this.binMin,this.binMax);this.setColorMapBinBoundaries(e[0],e[1],!0)}for(var i=this.getXAxis().getRelPx(this.deltaX),s=this.getYAxis().getRelPx(this.deltaY),r=0;r{t.redraw()}),this.emit("draw")}setData(t){if(t instanceof a.Waveform)return this.setWaveform(t);throw"Setting data other than waveforms in not supported by default. You must implemented this method in the inherited class."}_addData(){return[]}clearData(){return this.setData(new a.Waveform),this}getData(){return this.data}setOptions(t){this.options=t||{}}setOption(t,e){this.options[t]=e}kill(t){return this.graph.removeSerieFromDom(this),this.graph._removeSerie(this),this.graph.legend&&!t&&this.graph.legend.update(),this.graph=void 0,this}hide(t=this.options.bindShapesToDisplayState,e=!1){if(this.hidden=!0,this.groupMain.setAttribute("display","none"),this.getSymbolForLegend().setAttribute("opacity",.5),this.getTextForLegend().setAttribute("opacity",.5),this.hideImpl(),t)for(var i=this.graph.getShapesOfSerie(this),s=0,r=i.length;st;t++)arguments[t]&&this[arguments[t].isX()?"setXAxis":"setYAxis"](arguments[t]);return this.graph.updateDataMinMaxAxes(),this}getXAxis(){return this.xaxis}getYAxis(){return this.yaxis}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getWaveform(){return this.waveform||(this.waveform=Graph.newWaveform()),this.waveform}getWaveforms(){return[this.waveform]}setWaveform(t){if(!(t instanceof a.Waveform))throw console.trace(),console.error(t),new Error("Cannot assign waveform to serie. Waveform is not of the proper Waveform instance");return this.waveform=t,this.dataHasChanged(),this.graph.updateDataMinMaxAxes(),this}getSymbolForLegend(){if(!this.lineForLegend){var t=document.createElementNS(this.graph.ns,"line");this.applyLineStyle(t),t.setAttribute("x1",5),t.setAttribute("x2",25),t.setAttribute("y1",0),t.setAttribute("y2",0),t.setAttribute("cursor","pointer"),this.lineForLegend=t}return this.lineForLegend}_getSymbolForLegendContainer(){return this._symbolLegendContainer}setStyle(t,e="unselected",i="unselected"){return"unselected"==e&&(i=null),this.styles[e]={base:i,data:t},this.styleHasChanged(e),console.log(this.styles),this}getStyle(t){return this.styles[t]?this._buildStyle(this.styles[t]):this.graph.constructor.getStyle(t)}getRawStyles(){return this.styles}getRawStyle(t){return this.styles[t]=this.styles[t]||{data:{}},this.styles[t].data}activateStyle(t){this._activeStyle=t,this._unselectedStyleName=t,this.computeActiveStyle(),this.styleHasChanged(t)}setActiveStyle(t){return this.activateStyle(t)}getActiveStyle(){return this._activeStyle}getActiveStyleName(){return this.getActiveStyle()}computeStyles(){for(let t in this.styles)this.computeStyle(t)}computeStyle(t){this.computedStyle=this.computedStyle||{},this.computedStyle[t]=this.getStyle(t)}computeActiveStyle(){this.computedStyle=this.computedStyle||{},this.computedStyle[this.getActiveStyle()]=this.getStyle(this.getActiveStyle())}getComputedStyle(t=this.getActiveStyle()){return this.computedStyle[t]}getComputedStyles(){return this.computedStyle}_buildStyle(t){let e=t.base;return e?s.extend(!0,{},this.getStyle(e),t.data):s.extend(!0,{},t.data)}setLegendSymbolStyle(){this.applyLineStyle(this.getSymbolForLegend())}updateStyle(){this.setLegendSymbolStyle(),this.graph.updateLegend()}getTextForLegend(){if(!this.textForLegend){var t=document.createElementNS(this.graph.ns,"text");t.setAttribute("cursor","pointer"),t.textContent=this.getLabel(),this.textForLegend=t}return this.textForLegend}getIndex(){return this.graph.series.indexOf(this)}getLabel(){return this.options.label||this.name}setLabel(t){return this.options.label=t,this.textForLegend&&(this.textForLegend.textContent=t),this.graph.requireLegendUpdate(),this}setFlip(t){return this.options.flip=t,this}getFlip(){return this.options.flip}isFlipped(){return this.options.flip}setLayer(t){let e=parseInt(t)||1;return e!==this.options.layer&&(this.options.layer=e,this.graph.appendSerieToDom(this)),this}getLayer(){return this.options.layer||1}styleHasChanged(t="unselected"){if(this._changedStyles=this._changedStyles||{},!1===t)for(var e in this._changedStyles)this._changedStyles[e]=!1;else this._changedStyles[t||"unselected"]=!0;return this.graph.requireLegendUpdate(),this}hasStyleChanged(t="unselected"){let e;for(this._changedStyles=this._changedStyles||{};;){if(this._changedStyles[t])return!0;if(e=this.styles[t],!e)break;t=e.base}return!1}dataHasChanged(t){return this._dataHasChanged=void 0===t||t,this.waveform&&(this.minX=this.waveform.getXMin(),this.maxX=this.waveform.getXMax(),this.minY=this.waveform.getMin(),this.maxY=this.waveform.getMax()),this}hasDataChanged(){return this._dataHasChanged}setInfo(t,e){return this.infos=this.infos||{},this.infos[t]=e,this}getInfo(t){return(this.infos||{})[t]}setAdditionalData(t){return this.additionalData=t,this}getAdditionalData(){return this.additionalData}select(t){return"unselected"==t||(this._unselectedStyleName=this._activeStyle,this._activeStyle="selected",this.selected=!0,this.applyStyle()),this}unselect(){return this.selected=!1,this.activateStyle(this._unselectedStyleName),this.applyStyle(),this}applyStyle(){}enableTracking(){return this._tracker=!0,this}disableTracking(){return this._trackerDom&&(this._trackerDom.remove(),this._trackerDom=null),this._tracker=!1,this}allowTrackingLine(t){t=t||{},this.graph.addSerieToTrackingLine(this,t)}getMarkerForLegend(){return!1}get type(){return this._type}getType(){return this._type}excludeFromLegend(){return this._excludedFromLegend=!0,this}includeInLegend(){return this._excludedFromLegend=!1,this}setDataIndices(t,e){this.categoryIndices=t,this.nbCategories=e}hasErrors(){return!!this.waveform&&this.waveform.hasErrorBars()}}(0,r.default)(h,"serie");i.default=h,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},2443:function(t,e,i){var s,r,a;r=[e,i(8541),i(2458),i(6967)],void 0===(a="function"==typeof(s=function(i,s,r,a){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=n(s),r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(r),a=n(a);class o extends a.default{static defaults(){return{zpos:0}}constructor(){super(...arguments)}setZPos(t){return this.options.zpos=t,this}setz(){return this.setZPos(...arguments)}}r.mix(o,s.default);i.default=o,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},9680:function(t,e,i){var s,r,a;r=[e,i(2458),i(7648),i(6967)],void 0===(a="function"==typeof(s=function(i,s,r,a){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(s),r=n(r),a=n(a);class o extends a.default{constructor(){super(...arguments),this.lines=this.lines||{}}setColors(t){this.colors=t}_draw(){var t,e,i,s,r,a,n=this,o=(this._dataToUse,this.getWaveform()),h=!1,l=!1,u=this.getXAxis(),d=this.getYAxis(),p=u.getCurrentMin(),g=d.getCurrentMin(),c=u.getCurrentMax(),f=d.getCurrentMax(),x=!1;this.eraseLines(),this.isFlipped(),this.currentLine="";let{i:m,l:y}=this._getIterativeBounds(o,p,c);for(;mc&&h>c||(ef&&l>f)&&!this.options.lineToZero){h=t,l=e,x=!0;continue}if(this.counter2=m,r=this.getX(t),a=this.getY(e),r==i&&a==s)continue;if(isNaN(r)||isNaN(a)){this.counter;continue}var b=this.colors[m];let n=this.isPointOutside(t,e,p,c,g,f);if(this.options.lineToZero){if(n=tc,n)continue;}else if(n||x){if(!1!==h&&!1!==l||x){let o=this.calculateAxisCrossing(t,e,h,l,p,c,g,f);0{this.options.selectableOnClick&&(this.isSelected()?this.graph.unselectSerie(this):this.graph.selectSerie(this))})}applyStyle(){this.applyLineStyles(),this.applyLineStyle(this.getSymbolForLegend()),super.applyStyle()}postInit(){}setOptions(){return this}onMouseWheel(){}empty(){for(var t=0,e=this.lines.length;t{this.draw(t)}),!1;if(!1===s)return!1;this._dataToUse=this.waveform.getDataToUseFlat()}return!0}removeLinesGroup(){this._afterLinesGroup=this.groupLines.nextSibling,this.groupMain.removeChild(this.groupLines)}insertLinesGroup(){if(!this._afterLinesGroup)throw"Could not find group after lines to insertion.";this.groupMain.insertBefore(this.groupLines,this._afterLinesGroup),this._afterLinesGroup=!1}removeExtraLines(){for(var t=this.currentLineId,e=this.lines.length;tc&&h>c||(!this.options.overflowY&&if&&l>f)&&!this.options.lineToZero){h=e,l=i,y=!0;continue}if(this.counter2=b,this.options.lineToZero&&(i>f&&(i=f),ic,u)continue;}else if(u||y){if(!1!==h&&!1!==l||y){let t=this.calculateAxisCrossing(e,i,h,l,p,c,g,f);0{var e=this.graph._getXY(t),i=this.handleMouseMove(!1,!1);this._trackingCallback(this,i,e.x,e.y)}),this.groupMain.addEventListener("mouseleave",()=>{this._trackingOutCallback(this)})}return this}_getIterativeBounds(t,e,i){let s=0,r=t.getLength(),a=r;return t.isXMonotoneous()&&(t.isXMonotoneousAscending()?(s=t.getIndexFromX(e,!0),r=t.getIndexFromX(i,!0)):(s=t.getIndexFromX(i,!0),r=t.getIndexFromX(e,!0)),0==s?s=0:0a):!this.options.overflowX&&(ts)||!this.options.overflowY&&(ea)}calculateAxisCrossing(t,e,i,s,r,a,n,o){let h=[],l=(t-r)/(t-i),u=e-l*(e-s),d=(t-a)/(t-i),p=e-d*(e-s),g=(e-n)/(e-s),c=t-g*(t-i),f=(e-o)/(e-s),x=t-f*(t-i);return 1>l&&0=n&&h.push([r,u]),1>d&&0=n&&h.push([a,p]),1>g&&0=r&&h.push([c,n]),1>f&&0=r&&h.push([x,o]),h}_addPoint(t,e,i,s,r,a){t==t&&e==e&&(0==this.counter?this.currentLine="M ":this.options.lineToZero||a?this.currentLine+="M ":this.currentLine+="L ",this.currentLine+=t,this.currentLine+=" ",this.currentLine+=e,this.currentLine+=" ",this.options.lineToZero&&void 0!==this.pos0&&(this.currentLine+="L ",this.currentLine+=t,this.currentLine+=" ",this.currentLine+=this.pos0,this.currentLine+=" "),this.hasErrors()&&this.errorAddPoint(r,i,s,t,e),this.counter++)}_createLine(){var t,e=this.currentLineId++;return this.lines[e]?t=this.lines[e]:(t=document.createElementNS(this.graph.ns,"path"),this.applyLineStyle(t),this.groupLines.appendChild(t),this.lines[e]=t),0==this.counter?t.setAttribute("d",""):t.setAttribute("d",this.currentLine),this.currentLine="M ",this.counter=0,t}applyLineStyles(){for(var t=0;th)return!1;const l={indexBefore:h,indexAfter:h,xExact:t,indexClosest:h,interpolatedY:this.waveform.getY(h),xClosest:this.waveform.getX(h),yClosest:this.waveform.getY(h)};if(this.waveform.isMonotoneous()){let t=this.waveform.getX(h),e=this.waveform.getX(h),i=this.waveform.getY(h),s=this.waveform.getX(h);t{var e=parseInt(t.target.parentElement.getAttribute("data-shapeid"));isNaN(e)||(this.options.selectMarkerOnHover&&this.selectMarker(e,"selected"),this.emit("mouseOverMarker",e,this.waveform.getX(e),this.waveform.getY(e)))},!0),this.groupMarkers.addEventListener("mouseout",t=>{var e=parseInt(t.target.parentElement.getAttribute("data-shapeid"));isNaN(e)||(this.options.selectMarkerOnHover&&this.selectMarker(e,"unselected"),this.emit("mouseOutMarker",e,this.waveform.getX(e),this.waveform.getY(e)))})}setDataCategory(t){for(let e of t)this._checkY(e.y.getMaxY()),this._checkY(e.y.getMinY());return this.data=t,this.dataHasChanged(),this.graph.updateDataMinMaxAxes(),this}empty(){for(;this.groupMarkers.firstChild;)this.groupMarkers.removeChild(this.groupMarkers.firstChild)}getSymbolForLegend(){if(this.options.markers){const t=super._getSymbolForLegendContainer();var e=this.getMarkerStyle(-1,!0)[-1];if(e&&e.shape){for(var i in this.shapeLegend||(this.shapeLegend=this._makeMarker(t,e),t.appendChild(this.shapeLegend)),e)"shape"!=i&&this.shapeLegend.setAttribute(i,e[i]);return t}}}setMarkerStyle(t,e,i="unselected",s="unselected"){"string"==typeof e&&(i=e,e=!1);let r={markers:{all:t,modifiers:e}};return this.setStyle(r,i,s),this.styleHasChanged(i),this}setIndividualStyleNames(t){this.stylesNames=t}draw(t){if(!t&&!this.hasDataChanged()&&!this.hasStyleChanged("unselected")||!this.options.markers)return;let e,i,s,r;if(this.isCategory||this.waveform){const a="category"==this.getXAxis().getType(),n=[];if(this.dataHasChanged(!1),this.styleHasChanged(!1),this.groupMain.removeChild(this.groupMarkers),s=0,r=0,this.hasErrors()&&this.errorDrawInit(),a){for(let t=0;sthis.getXAxis().getCurrentMax()||this.waveform.getY(s)this.getYAxis().getCurrentMax()?this.shapes[s]&&(this.shapes[s].setAttribute("display","none"),this.shapes[s]._hidden=!0):(this.shapes[s]&&this.shapes[s]._hidden&&(this.shapes[s].setAttribute("display","initial"),this.shapes[s]._hidden=!1),e=this.getX(this.waveform.getX(s)),i=this.getY(this.waveform.getY(s)),isNaN(e)||isNaN(i)?this.shapes[s]&&(this.shapes[s].setAttribute("display","none"),this.shapes[s]._hidden=!0):(this.shapes[s]&&this.shapes[s]._hidden&&(this.shapes[s].setAttribute("display","initial"),this.shapes[s]._hidden=!1),this.hasErrors()&&this.errorAddPoint(s,this.waveform.getX(s),this.waveform.getY(s),e,i),this.shapesDetails[s]=this.shapesDetails[s]||[],this.shapesDetails[s][0]=e,this.shapesDetails[s][1]=i,n.push(s)));this.hasErrors()&&this.errorDraw(),this.applyMarkerStyle(n),this.keys=n,this.groupMain.appendChild(this.groupMarkers)}}_makeMarker(t,e){var i=document.createElementNS(this.graph.ns,e.shape);return t.appendChild(i),i}getMarkerStyle(t,e){this.computeStyles();const i=this.stylesNames,r=this.getComputedStyles();var a={};let n=Array.isArray(t)?t:[t];let o,h,l=[];for(let t in r)r[t].markers&&(l[t]="function"==typeof r[t].markers.all?r[t].markers.all():{...r[t].markers.all},r[t].markers.default&&(l[t]={...r[t].markers.default,...l[t]}));for(let t=0,r=n.length;tt.x):[]}getClosestPointToXY(t=this.getXAxis().getMouseVal(),e=this.getYAxis().getMouseVal(),i=0,s=0,r=!1,a=!0){const n=this.getXAxis().getRelVal(i),o=this.getYAxis().getRelVal(s),h=this.waveform.findWithShortestDistance({x:t,y:e,xMax:n,yMax:o,interpolation:!1,scaleX:a?1/this.getXAxis().getRelVal(1):1,scaleY:a?1/this.getYAxis().getRelVal(1):1});return{indexBefore:h,indexAfter:h,xBefore:this.waveform.getX(h),xAfter:this.waveform.getX(h),yBefore:this.waveform.getY(h),yAfter:this.waveform.getX(h),xExact:t,indexClosest:h,interpolatedY:this.waveform.getY(h),xClosest:this.waveform.getX(h),yClosest:this.waveform.getY(h)}}}s.mix(h,r.default);i.default=h,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},6814:function(t,e,i){var s,r,a;r=[e,i(8541),i(2458),i(9506)],void 0===(a="function"==typeof(s=function(i,s,r,a){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=n(s),r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(r),a=n(a);class o extends a.default{static default(){return{zpos:0}}constructor(){super(...arguments)}setZPos(t){return this.options.zpos=t,this}setz(){return this.setZPos(...arguments)}}r.mix(o,s.default);i.default=o,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},9506:function(t,e,i){var s,r,a;r=[e,i(5507),i(2458),i(1239)],void 0===(a="function"==typeof(s=function(i,s,r,a){"use strict";var n;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,a=(n=a)&&n.__esModule?n:{default:n};class o extends a.default{static default(){return{fillColor:"rgba( 0, 0, 0, 0.1 )",lineColor:"rgba( 0, 0, 0, 1 )",lineWidth:"1px"}}constructor(){super(...arguments),this.selectionType="unselected",this.id=(0,r.guid)(),this.groupZones=document.createElementNS(this.graph.ns,"g"),this.lineZone=document.createElementNS(this.graph.ns,"path"),this.lineZone.setAttribute("stroke","black"),this.lineZone.setAttribute("stroke-width","1px"),this.groupMain.appendChild(this.groupZones),this.groupZones.appendChild(this.lineZone),this.applyLineStyle(this.lineZone),this.styleHasChanged(),this.clip=document.createElementNS(this.graph.ns,"clipPath"),this.clipId=(0,r.guid)(),this.clip.setAttribute("id",this.clipId),this.graph.defs.appendChild(this.clip)}setWaveform(...t){return this.waveforms=t,this.waveforms=this.waveforms.map(t=>t instanceof s.Waveform?t:new s.Waveform(t)),this.minX=this.waveforms[0].getXMin(),this.maxX=this.waveforms[0].getXMax(),this.minY=this.waveforms[0].getMin(),this.maxY=this.waveforms[0].getMax(),this.waveforms.map(t=>{this.minX=Math.min(t.getXMin(),this.minX),this.maxX=Math.max(t.getXMin(),this.maxX),this.minY=Math.min(t.getMin(),this.minY),this.maxY=Math.max(t.getMax(),this.maxY)}),this.graph.updateDataMinMaxAxes(),this.dataHasChanged(),this}setWaveforms(){return this.setWaveform(...arguments)}getWaveforms(){return this.waveforms}setMinMaxWaveforms(t,e){return this.waveforms=[t,e.reverse()],this}empty(){for(;this.group.firstChild;)this.group.removeChild(this.group.firstChild)}draw(t){if(t||this.hasDataChanged()){if(!this.waveforms)return;let t,e=0,i=0,s=0,r=0,a=0,n="",o=!1;this.getXAxis().getMinPx(),this.getXAxis().getMaxPx(),this.getYAxis().getMinPx(),this.getYAxis().getMaxPx();const h=this.getXAxis().getCurrentMin(),l=this.getXAxis().getCurrentMax(),u=this.getYAxis().getCurrentMin(),d=this.getYAxis().getCurrentMax();this.groupMain.removeChild(this.groupZones);for(let p of this.waveforms)for(a=0;ad&&(r=this.getY(d)),e==e)if(i==i)r=this.getY(i),s=this.getX(e),el?t=[e,i[a],s,r]:(o&&(n+=` M ${s}, ${this.getY(p.getMinY())} `,o=!1),0i||0>s+i||s>this.graph.getDrawingWidth())return this.setDom("d",""),!1;var r,a,n,o,h,l,u,d=this.serie.getClosestPointToXY(this.getPosition(0).x),p=this.serie.getClosestPointToXY(this.getPosition(1).x),g=0,c=Number.MAX_VALUE;if(!d||!p)return!1;for(d.xBeforeIndex>p.xBeforeIndex&&(r=d,d=p,p=r),this.counter=0,a=d.dataIndex;a<=p.dataIndex;a++){for(this.currentLine="",l=0,(o=a==d.dataIndex?d.xBeforeIndexArr:0)==(h=a==p.dataIndex?p.xBeforeIndexArr:this.serie.data[a].length)&&h++,n=o;n<=h;n+=2)s=this.serie.getX(this.serie.data[a][n+0]),u=this.serie.getY(this.serie.data[a][n+1]),g=Math.max(this.serie.data[a][n+1],g),c=Math.min(this.serie.data[a][n+1],c),n==o&&(this.firstX=s,this.firstY=u),this.currentLine+=0{this.group.removeChild(t)}),this._labelsBackground.map(t=>{this.group.removeChild(t)}),this._labels=[],this._labelsBackground[t]=[];for(var t=0;void 0!==this.getProp("labelText",t);)this._labels[t]||(this._labels[t]=document.createElementNS(this.graph.ns,"text"),this._labels[t].setAttribute("data-label-i",t),this._labels[t].jsGraphIsShape=this,this._labelsBackground[t]=document.createElementNS(this.graph.ns,"rect"),this._labelsBackground[t].setAttribute("data-label-i",t),this._labelsBackground[t].jsGraphIsShape=this,this.group.appendChild(this._labelsBackground[t]),this.group.appendChild(this._labels[t]),this._labels[t].addEventListener("dblclick",t=>{t.stopPropagation(),this.labelDblClickListener(t)}),this._labelsBackground[t].addEventListener("dblclick",t=>{t.stopPropagation(),this.labelDblClickListener(t)})),Array.isArray(this.getProp("labelText",t)),t++;return this.updateLabels(),console.log(this._labels),this}}isLabelEditable(t){return this.getProp("labelEditable",t||0)}updateLabels(){this._labels=this._labels||[];for(var t=0,e=this._labels.length;t{var r=this,a=document.createElementNS(r.graph.ns,e);if(a.jsGraphIsShape=!0,i)for(var n in i)a.setAttribute(n,i[n]);a.addEventListener("mousedown",e=>{r.isResizable()&&(e.preventDefault(),e.stopPropagation(),r.graph.emit("beforeShapeResize",r),this.emit("beforeShapeResize"),r.graph.prevent(!1)||(r.resizing=!0,r.handleSelected=t,r.handleMouseDown(e)))}),s&&s(r.handles[t]),r.handles[t]=a}).call(this,r);return this.handles}}createHandles(){this.hasStaticHandles()&&(this.addHandles(),this.setHandles())}handleMouseDownImpl(){}handleMouseMoveImpl(){}handleMouseUpImpl(){}handleCreateImpl(){}handleMouseDown(t){if(!this.isLocked())return(this.isMovable()||this.isResizable())&&this.graph.elementMoving(this),this.getProp("selectOnMouseDown")&&this.graph.selectShape(this),this.isMovable()&&(this.resizing||(this.graph.emit("beforeShapeMove",self),this.graph.prevent(!1)||(this.moving=!0,this.moved=!1))),this._mouseCoords=this.graph._getXY(t),this.handleMouseDownImpl(t,this._mouseCoords)}handleClick(t){return(this.graph.emit("shapeClicked",this),this.emit("shapeClicked"),!!this.isSelectable())&&void(t.shiftKey||this.graph.unselectShapes(),this.getProp("selectOnClick")&&this.graph.selectShape(this))}handleMouseMove(t){if(!this.resizing&&!this.moving||this.isSelected()||this.graph.selectShape(this),this.graph.emit("beforeShapeMouseMove",this),this.emit("beforeShapeMouseMove"),this.graph.prevent(!1)||!this._mouseCoords)return!1;this.moved=!0;var e=this.graph._getXY(t),i=this.getXAxis().getRelVal(e.x-this._mouseCoords.x),s=this.getYAxis().getRelVal(e.y-this._mouseCoords.y);return 0==i&&0===s||(this.preventUnselect=!0),this._mouseCoords=e,this.handleMouseMoveImpl(t,i,s,e.x-this._mouseCoords.x,e.y-this._mouseCoords.y)}handleMouseUp(t){return this.moving&&this.moved&&(this.graph.emit("shapeMoved",this),this.emit("shapeMoved")),(this.handleSelected||this.resize)&&(this.graph.emit("shapeResized",this),this.emit("shapeResized")),this.moving=!1,this.resizing=!1,this.handleSelected=!1,this.graph.elementMoving(!1),this.handleMouseUpImpl(t)}handleDblClick(){}handleMouseOver(){this.getProp("highlightOnMouseOver")&&(this.moving||this.resizing||this.highlight()),this.graph.emit("shapeMouseOver",this)}handleMouseOut(){this.getProp("highlightOnMouseOver")&&this.unHighlight(),this.graph.emit("shapeMouseOut",this)}lock(){return this.setProp("locked",!0),this}unlock(){return this.setProp("locked",!1),this}isLocked(){return this.getProp("locked")||this.graph.shapesLocked}movable(){this.setProp("movable",!0)}unmovable(){return this.setProp("movable",!1),!1}isMovable(){return this.getProp("movable")}resizable(){this.setProp("resizable",!0)}unresizable(){this.setProp("resizable",!1)}isResizable(){return this.getProp("resizable")}selectable(){this.setProp("selectable",!0)}unselectable(){this.graph.unselectShape(this),this.setProp("selectable",!1)}isSelectable(){return this.getProp("selectable")}highlight(t,e){return t||(t=this.getHighlightAttributes()),e||(e="highlight"),r.saveDomAttributes(this._dom,t,e),this.highlightImpl(),this}unHighlight(t){return t||(t="highlight"),r.restoreDomAttributes(this._dom,t),this.unHighlightImpl(),this}highlightImpl(){}unHighlightImpl(){}getHighlightAttributes(){return this._highlightAttributes}setHighlightAttributes(t){return this._highlightAttributes=t,this}getMaskingID(){return this.maskingId}maskWith(t){const e=t.getMaskingID();e?this._dom.setAttribute("mask",`url(#${e})`):this._dom.removeAttribute("mask")}updateMask(){}labelDblClickListener(t){var e=parseInt(t.target.getAttribute("data-label-i")),i=this;if(isNaN(e))return;if(!this.isLabelEditable(e))return;t.preventDefault(),t.stopPropagation();var s=document.createElement("input");s.setAttribute("type","text"),s.setAttribute("value",i.getProp("labelText",e)),i.graph.wrapper.prepend(s),s.select(),r.setCSS(s,{position:"absolute",marginTop:parseInt(t.target.getAttribute("y").replace("px",""))+this.graph.getPaddingTop()-10+"px",marginLeft:parseInt(t.target.getAttribute("x").replace("px",""))+this.graph.getPaddingLeft()-50+"px",textAlign:"center",width:"100px"});const a=i.getLabelText(e),n=function(){i.setLabelText(s.value,e),i._labels[e].textContent=s.value;const t=s.value;s.remove(),s.removeEventListener("blur",n),s=!1,i.changed("shapeLabelChanged",{previousValue:a,nextValue:t})};s.addEventListener("blur",n),s.addEventListener("keyup",function(t){13===t.keyCode&&n()}),s.addEventListener("keypress",function(t){t.stopPropagation()}),s.addEventListener("keydown",function(t){t.stopPropagation()}),s.focus()}appendToDom(){return this._forcedParentDom?this._forcedParentDom.appendChild(this.group):this.graph.appendShapeToDom(this),this}forceParentDom(t){return this._forcedParentDom=t,this}isHTML(){return!1}}o.prototype.computePosition=o.prototype.calculatePosition,o.prototype.showLabel=o.prototype.displayLabel,o.prototype.remove=o.prototype.kill,(0,a.default)(o,"shape");i.default=o,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},4508:function(t,e,i){var s,r,a;r=[e,i(7282)],void 0===(a="function"==typeof(s=function(i,s){"use strict";var r;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=(r=s)&&r.__esModule?r:{default:r};class a extends s.default{constructor(t,e){super(t,e)}createDom(){return!1}applyPosition(){return!0}}i.default=a,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},8747:function(t,e,i){var s,r,a;r=[e,i(7282)],void 0===(a="function"==typeof(s=function(i,s){"use strict";var r;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=(r=s)&&r.__esModule?r:{default:r};class a extends s.default{constructor(t,e){super(t,e)}createDom(){this._dom=document.createElementNS(this.graph.ns,"line"),this.getStrokeColor()||this.setStrokeColor("black"),void 0===this.getStrokeWidth()&&this.setStrokeWidth(1)}createHandles(){this._createHandles(2,"rect",{transform:"translate(-3 -3)",width:6,height:6,stroke:"black",fill:"white",cursor:"nwse-resize"})}applyPosition(){var t=this.calculatePosition(0),e=this.calculatePosition(1);if(t&&t.x&&t.y)return this.setDom("x2",t.x),this.setDom("y2",t.y),this.setDom("y1",e.y),this.setDom("x1",e.x),this.currentPos2x=e.x,this.currentPos2y=e.y,this.currentPos1x=t.x,this.currentPos1y=t.y,!0}handleMouseMoveImpl(t,e,i){if(!this.isLocked()){var a,n=this.getPosition(0),o=this.getPosition(1);if(1==this.handleSelected?a=n:2==this.handleSelected&&(a=o),a&&(this._data.vertical||a.deltaPosition("x",e,this.getXAxis()),this._data.horizontal||a.deltaPosition("y",i,this.getYAxis())),this.moving&&(console.log(this._data),n.x&&!this._data.noX&&n.deltaPosition("x",e,this.getXAxis()),n.y&&!this._data.noY&&n.deltaPosition("y",i,this.getYAxis()),o.x&&!this._data.noX&&o.deltaPosition("x",e,this.getXAxis()),o.y&&!this._data.noY&&o.deltaPosition("y",i,this.getYAxis())),this._data.forcedCoords){var h=this._data.forcedCoords;void 0!==h.y&&("function"==typeof h.y?o.y=n.y=h.y(this):(o.y=h.y,n.y=h.y)),void 0!==h.x&&("function"==typeof h.x?o.x=n.x=h.x(this):(o.x=h.x,n.x=h.x))}return this.rectEvent&&this.setEventReceptacle(),this.redraw(),this.changed(),this.setHandles(),!0}}setHandles(){this.areHandlesInDom()&&(isNaN(this.currentPos1x)||(this.handles[1].setAttribute("x",this.currentPos1x),this.handles[1].setAttribute("y",this.currentPos1y),this.handles[2].setAttribute("x",this.currentPos2x),this.handles[2].setAttribute("y",this.currentPos2y)))}setEventReceptacle(){this.currentPos1x&&(this.rectEvent||(this.rectEvent=document.createElementNS(this.graph.ns,"line"),this.rectEvent.setAttribute("pointer-events","stroke"),this.rectEvent.setAttribute("stroke","transparent"),this.rectEvent.jsGraphIsShape=this,this.group.appendChild(this.rectEvent)),this.rectEvent.setAttribute("x1",this.currentPos1x),this.rectEvent.setAttribute("y1",this.currentPos1y),this.rectEvent.setAttribute("x2",this.currentPos2x),this.rectEvent.setAttribute("y2",this.currentPos2y),this.rectEvent.setAttribute("stroke-width",this.getProp("strokeWidth")+2))}}i.default=a,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},9589:function(t,e,i){var s,r,a;r=[e,i(5054),i(7282)],void 0===(a="function"==typeof(s=function(i,s,r){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=a(s),r=a(r);class n extends r.default{constructor(t,e){super(t,e),this.nbHandles=2}createDom(){this._dom=document.createElementNS(this.graph.ns,"path"),this._domShadow=document.createElementNS(this.graph.ns,"path"),this._domShadow.jsGraphIsShape=this,this._dom.setAttribute("pointer-events","stroke"),this._domShadow.setAttribute("pointer-events","stroke"),this._domShadow.setAttribute("stroke-width","12"),this._domShadow.setAttribute("fill","transparent"),this._domShadow.setAttribute("stroke","transparent"),this.group.appendChild(this._domShadow)}initImpl(){this.setFillColor("transparent"),this.setStrokeColor("black")}createHandles(){this._createHandles(2,"rect",{transform:"translate(-3 -3)",width:6,height:6,stroke:"black",fill:"white"}),this.handles[1].setAttribute("fill","red")}xor(t,e){return t&&!e||!t&&e}applyPosition(){let t,e,i,s,r,a=this.getAxis(),n=[],o="",h=this.getProp("baseLine",0)||300;if(!this.serie)throw"No serie exists for this shape";let l=this.getPosition(0),u=this.getPosition(1);if(l.xthis.serie.getXAxis().getCurrentMax()&&u.x>this.serie.getXAxis().getCurrentMax())return this.setDom("d",""),this._domShadow.setAttribute("d",""),this.hideLabel(0),!1;this.showLabel(0);let d,p=0,g=this.serie.getWaveform();if(!g)return;let c,f,x,m,y,b,v,M,A,S=g.getIndexFromX(l[a],!0,Math.floor),k=g.getIndexFromX(u[a],!0,Math.ceil),w=!1;S==k&&("aggregate"==g.getReductionType()?k+=4:k++),k=S:d<=k;d+=P)i=g.getX(d,!0),s=g.getY(d,!0),t=this.serie.getX(i),e=this.serie.getY(s),p+=g.getY(d,!0),f||(f=t,x=e,m=g.getX(d),y=g.getY(d)),null==b?(b=t,M=e,v=g.getX(d),A=g.getY(d)):(b=t,M=e,n.push([t,e,p]),v=i);if(v=!1,A=!1,b=!1,M=!1,0==p&&(p=1),this._sumVal=g.integrate(l.x,u.x),r=this.ratio?this.ratio*(this.sumVal/p):200/p,0!=n.length){for(var E=0,X=n.length;Ep/2&&n[E][2]<=p/2||n[E-1][2]

=p/2)){let t=h-(n[E-1][2]+n[E][2])/2*r;this.setPosition({x:n[E][0]+"px",y:t+"px"},3),this.setLabelPosition(this.getPosition(3),0)}o+=` L ${n[E][0]}, ${C} `,this.lastPointX=n[E][0],this.lastPointY=C}return this.points=n,this._sum=p,o=this.serie.isFlipped()?` M ${h}, ${f} ${o}`:` M ${f}, ${h} ${o}`,this.firstPointX=f,this.firstPointY=h,this.setDom("d",o),this._domShadow.setAttribute("d",o),this.firstX=f,this.firstY=x,this.serie.ratioLabel&&this.updateIntegralValue(this.serie.ratioLabel)||this.updateLabels(),this.changed(),this.handleCondition=!this.xor(-1==P,w),this.setHandles(),this.updateIntegralValue(),!0}}updateIntegralValue(t=this.serie.ratioLabel,e){return console.log(t),t&&(this.serie.ratioLabel=t),isNaN(e)||isNaN(this.sumVal)||!this.sumVal||(this.serie.ratioLabel=e/this.sumVal),this.setLabelText(t?(Math.round(100*this.sumVal*t)/100).toPrecision(3):"N/A",0),this.updateLabels(),this.serie.ratioLabel}getAxis(){return this._data.axis||"x"}set ratio(t){this._ratio=t}get ratio(){return this._ratio}get sum(){return this._sum}get sumVal(){return this._sumVal}selectStyle(){this.setDom("stroke-width","2px")}selectHandles(){}setHandles(){null!=this.points&&this.isSelected()&&(this.addHandles(),this.handleCondition?(this.handles[1].setAttribute("x",this.firstPointX),this.handles[1].setAttribute("y",this.firstPointY),this.handles[2].setAttribute("x",this.lastPointX),this.handles[2].setAttribute("y",this.lastPointY)):(this.handles[2].setAttribute("x",this.firstPointX),this.handles[2].setAttribute("y",this.firstPointY),this.handles[1].setAttribute("x",this.lastPointX),this.handles[1].setAttribute("y",this.lastPointY)))}handleMouseMoveImpl(t,e){if(!this.isLocked()){var a,n=this.getPosition(0),o=this.getPosition(1);return 1==this.handleSelected?a=n:2==this.handleSelected&&(a=o),a&&(this._data.vertical||a.deltaPosition("x",e,this.getXAxis())),this.moving&&(n.x&&n.deltaPosition("x",e,this.getXAxis()),o.x&&o.deltaPosition("x",e,this.getXAxis())),this.rectEvent&&this.setEventReceptacle(),this.redraw(),this.changed(),!0}}}i.default=n,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},9301:function(t,e,i){var s,r,a;r=[e,i(8747)],void 0===(a="function"==typeof(s=function(i,s){"use strict";var r;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=(r=s)&&r.__esModule?r:{default:r};class a extends s.default{constructor(t){super(t),this.lineHeight=6}createDom(){this._dom=document.createElementNS(this.graph.ns,"line"),this.line1=document.createElementNS(this.graph.ns,"line"),this.line2=document.createElementNS(this.graph.ns,"line"),this.line3=document.createElementNS(this.graph.ns,"line"),this.rectBoundary=document.createElementNS(this.graph.ns,"path"),this.rectBoundary.setAttribute("fill","transparent"),this.rectBoundary.setAttribute("stroke","none"),this.rectBoundary.setAttribute("pointer-events","fill"),this.rectBoundary.jsGraphIsShape=!0,this.group.appendChild(this.rectBoundary),this.group.appendChild(this.line1),this.group.appendChild(this.line2),this.group.appendChild(this.line3),this._dom.element=this}createHandles(){this._createHandles(3,"rect",{transform:"translate(-3 -3)",width:6,height:6,stroke:"black",fill:"white",cursor:"nwse-resize"})}redrawImpl(){this.line1.setAttribute("stroke",this.getStrokeColor()),this.line2.setAttribute("stroke",this.getStrokeColor()),this.line3.setAttribute("stroke",this.getStrokeColor()),this.line1.setAttribute("stroke-width",this.getStrokeWidth()),this.line2.setAttribute("stroke-width",this.getStrokeWidth()),this.line3.setAttribute("stroke-width",this.getStrokeWidth()),this.setHandles(),this.redrawLines()}redrawLines(){var t=this.computePosition(0),e=this.computePosition(1),i=this.computePosition(2);if(t.x&&e.x&&i.x&&this.posYPx){var s=this.lineHeight;this.rectBoundary.setAttribute("d",`M ${t.x} ${this.posYPx-s} v ${2*s} H ${e.x} v ${-2*s}z`),this.line1.setAttribute("x1",t.x),this.line1.setAttribute("x2",t.x),this.line2.setAttribute("x1",e.x),this.line2.setAttribute("x2",e.x),this.line3.setAttribute("x1",i.x),this.line3.setAttribute("x2",i.x),this._dom.setAttribute("x1",t.x),this._dom.setAttribute("x2",e.x),this.redrawY(s)}return this}redrawY(){if(!this.posYPx)return this;var t=this.lineHeight;return this.line1.setAttribute("y1",this.posYPx-t),this.line1.setAttribute("y2",this.posYPx+t),this.line2.setAttribute("y1",this.posYPx-t),this.line2.setAttribute("y2",this.posYPx+t),this.line3.setAttribute("y1",this.posYPx-t),this.line3.setAttribute("y2",this.posYPx+t),this._dom.setAttribute("y1",this.posYPx),this._dom.setAttribute("y2",this.posYPx),this}setHandles(){if(this.posYPx){var t=this.computePosition(0),e=this.computePosition(1),i=this.computePosition(2);t.x&&e.x&&i.x&&(this.handles[1].setAttribute("x",t.x),this.handles[1].setAttribute("y",this.posYPx),this.handles[2].setAttribute("x",e.x),this.handles[2].setAttribute("y",this.posYPx),this.handles[3].setAttribute("x",i.x),this.handles[3].setAttribute("y",this.posYPx))}}setY(t){return this.posYPx=t,this}setLineHeight(t){this.lineHeihgt=t}handleMouseMoveImpl(t,e){if(!this.isLocked()){var s=this.getPosition(0),r=this.getPosition(1),a=this.getPosition(2);switch(this.handleSelected){case 1:s.deltaPosition("x",e,this.getXAxis()),(Math.abs(a.x-r.x)>Math.abs(r.x-s.x)||Math.abs(a.x-s.x)>Math.abs(r.x-s.x))&&(a.x=s.x+.1*(r.x-s.x));break;case 2:r.deltaPosition("x",e,this.getXAxis()),(Math.abs(a.x-r.x)>Math.abs(r.x-s.x)||Math.abs(a.x-s.x)>Math.abs(r.x-s.x))&&(a.x=r.x+.1*(s.x-r.x));break;case 3:if(a.deltaPosition("x",e,this.getXAxis()),Math.abs(a.x-r.x)>Math.abs(r.x-s.x)||Math.abs(a.x-s.x)>Math.abs(r.x-s.x))return;}this.setLabelPosition({y:this.getLabelPosition(0).y,x:a.x}),this.updateLabels(),this.redrawLines(),this.setHandles()}}applyPosition(){return this.redrawLines(),!0}}i.default=a,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},8711:function(t,e,i){var s,r,a;r=[e,i(6879)],void 0===(a="function"==typeof(s=function(i,s){"use strict";var r;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=(r=s)&&r.__esModule?r:{default:r};class a extends s.default{constructor(t,e){super(t,e),this.nbHandles=4}createDom(){this._dom=document.createElementNS(this.graph.ns,"rect"),this._dom.element=this,this.createHandles(this.nbHandles,"rect",{transform:"translate(-3 -3)",width:6,height:6,stroke:"black",fill:"white",cursor:"nwse-resize"})}redrawImpl(){this.setPosition(),this.setHandles(),this.setBindableToDom(this._dom)}}i.default=a,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},196:function(t,e,i){var s,r,a;r=[e,i(7282)],void 0===(a="function"==typeof(s=function(i,s){"use strict";var r;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=(r=s)&&r.__esModule?r:{default:r};class a extends s.default{constructor(t,e){super(t,e)}createDom(){this._dom=document.createElementNS(this.graph.ns,"path"),this.getStrokeColor()||this.setStrokeColor("black"),void 0===this.getStrokeWidth()&&this.setStrokeWidth(1)}createHandles(){}setPointsPx(t){return this.setProp("pxPoints",t),this}applyPosition(){let t="",e=0;for(;;){let i,s=this.getPosition(e);if(void 0===s)break;if(i=this.serie?s.compute(this.graph,this.serie.getXAxis(),this.serie.getYAxis(),this.serie):s.compute(this.graph,this.getXAxis(),this.getYAxis()),isNaN(i.x)||isNaN(i.y))return;t+=0==e?" M ":" L ",t+=`${i.x} ${i.y}`,e++}return t+="z",this.setDom("d",t),this.changed(),!0}}i.default=a,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},8682:function(t,e,i){var s,r,a;r=[e,i(7282)],void 0===(a="function"==typeof(s=function(i,s){"use strict";var r;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=(r=s)&&r.__esModule?r:{default:r};class a extends s.default{constructor(t,e){super(t,e),this.setProp("fillColor","none")}createDom(){this._dom=document.createElementNS(this.graph.ns,"path"),this.getStrokeColor()||this.setStrokeColor("black"),void 0===this.getStrokeWidth()&&this.setStrokeWidth(1)}createHandles(){}setPointsPx(){return this}applyPosition(){let t="",e=0;for(;;){let i,s=this.getPosition(e);if(void 0===s)break;if(i=this.serie?s.compute(this.graph,this.serie.getXAxis(),this.serie.getYAxis(),this.serie):s.compute(this.graph,this.getXAxis(),this.getYAxis()),isNaN(i.x)||isNaN(i.y))return;t+=0==e?" M ":" L ",t+=`${i.x} ${i.y}`,e++}return this.setDom("d",t),this.changed(),!0}}i.default=a,t.exports=e.default})?s.apply(e,r):s)||(t.exports=a)},6879:function(t,e,i){var s,r,a;r=[e,i(2458),i(7282)],void 0===(a="function"==typeof(s=function(i,s,r){"use strict";var a;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(s),r=(a=r)&&a.__esModule?a:{default:a};class n extends r.default{constructor(t,e){super(t,e)}createDom(){return this._dom=document.createElementNS(this.graph.ns,"rect"),this.getStrokeColor()||this.setStrokeColor("black"),void 0===this.getStrokeWidth()&&this.setStrokeWidth(1),this.getFillColor()||this.setFillColor("transparent"),this}createHandles(){if(this.hasHandles()){var t=this.getProp("handles");switch("object"!=typeof t&&(t={}),t.type||(t.type="corners"),t.type){case"sides":s.extend(t,{sides:{top:!0,bottom:!0,left:!0,right:!0}});var e=0;for(var i in t.sides)t.sides[i]&&e++;for(var i in this._createHandles(e,"g").map(function(t){var e=document.createElementNS(self.graph.ns,"rect");e.setAttribute("x","-3"),e.setAttribute("width","6"),e.setAttribute("y","-6"),e.setAttribute("height","12"),e.setAttribute("stroke","black"),e.setAttribute("fill","white"),e.setAttribute("cursor","pointer"),t.appendChild(e)}),e=1,t.sides)t.sides[i]&&(this.handles[i]=this["handle"+e],this.sides[e]=i,e++);break;case"corners":this._createHandles(4,"rect",{transform:"translate(-3 -3)",width:6,height:6,stroke:"black",fill:"white"}),this.handles&&(this.handles[2].setAttribute("cursor","nesw-resize"),this.handles[4].setAttribute("cursor","nesw-resize"),this.handles[1].setAttribute("cursor","nwse-resize"),this.handles[3].setAttribute("cursor","nwse-resize"));break;case"seamlessX":this._createHandles(2,"rect",{transform:"translate(-3 -3)",stroke:"transparent",fill:"transparent",width:"20px",cursor:"ew-resize"});}return super.createHandles(),this}}applyPosition(){var t,e,i,s,r=this.computePosition(0),a=this.computePosition(1);if(r&&a)return r.x{};else{var r,a={};let t=function(){onmessage=function(t){const e=t.data.data,i=t.data.maxX,s=t.data.minX,r=t.data.maxY,a=t.data.minY,n=t.data.direction;let o,h,l,u,d,p,g,c=t.data.numPoints,f=e.length,x=0,m=-4,y=[],b=[],v=[],M=[];o=t.data.xdata?function(e){return t.data.xdata[e]}:function(e){return e*t.data.xScale+t.data.xOffset};let A={};if("x"==n)for(const t=c/(i-s);x{a[e]=t});return r.postMessage(t),i}}var o=s;i.default=o,t.exports=e.default})?i.apply(e,[e]):i)||(t.exports=s)},2734:function(t,e){var i,s;void 0===(s="function"==typeof(i=function(i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;class s{constructor(t,e,i,s){this.LMITER=100,this.LMBOOST=2,this.LMSHRINK=.1,this.LAMBDAZERO=.001,this.LAMBDAMAX=1e9,this.LMTOL=1e-12,this.BIGVAL=9e99,this.sos,this.sosprev,this.lambda,this.myH=null,this.nadj=0,this.npts=0,this.delta,this.beta,this.alpha,this.amatrix,this.myH=t,this.nadj=e,this.npts=i,this.delta=Array(this.nadj).fill(0),this.beta=Array(this.nadj).fill(0),this.alpha=Array(this.nadj).fill(0),this.amatrix=Array(this.nadj).fill(0),this.alpha=this.alpha.map(()=>Array(this.nadj)),this.amatrix=this.amatrix.map(()=>Array(this.nadj)),this.lambda=this.LAMBDAZERO;var r=0,a=!1;do a=this.bLMiter(),s&&s(this.myH.params),r++;while(!a&&r=(s=(this.sos-this.sosprev)/(1+this.sos))){this.lambda*=this.LMSHRINK;break}for(var r=0;r-this.LMTOL||this.lambda>this.LAMBDAMAX}gaussj(t,e){var i,s,r,a,n,o,h=1,l=Array(100),u=Array(100);for(n=0;nn)for(a=0;an)for(r=0;rn)for(r=0;rn)for(a=0;a"function"==typeof t?t(this.data,this.dataX):t),this.NPARMS=t.length}setSubset(t,e){void 0!==t&&void 0!==e&&(this._from=t,this._to=e)}hookIteration(t){this._hookIteration=e=>{let i=this.buildFit(e,200);t(i)}}setFunction(t){this._func=t}init(){if(void 0!==this._from&&void 0!==this._to){if(this._from>=this._to)throw"Impossible to fit negative subranges. The starting index must be lower than the ending index";if(this.NPTS=this._to-this._from+1,this.data&&this.data.getLength()<=this._to)throw`Wave Y has not enough point to be fitted to subrange [${this._from}, ${this._to}]`;if(0>this._from)throw"Impossible to fit a subrange with negative indices"}else this.NPTS=this.data.getLength(),this._from=0,this._to=this.data.getLength()-1;if(this.dataX&&this.dataX.getLength()<=this._to)throw`Wave X has not enough point to be fitted to subrange [${this._from}, ${this._to}]`;this.arrY=this.data.getDataY(),this.arrX=this.dataX?this.dataX.getDataY():this.data.getDataX(),this.resid=Array(this.NPTS).fill(0),this.jac=Array(this.NPTS).fill(0),this.jac=this.jac.map(()=>Array(this.NPARMS))}fit(){return this.log(`Starting the fit with initial parameter list {${this.parms.join()}};`),new s(this,this.NPARMS,this.NPTS,this._hookIteration),this.log(`Fit successful. Output parameters {${this.parms.join()}};`),this._result=this.buildFit(this.parms,200),this.options.done&&this.options.done(this.parms,this._result),this._result}func(t,e){return this._func(t,e)}computeResiduals(){for(var t=0,e=0;er*(s-t)/(e-1)+t)}else i=this.arrX;for(var s=Array(i.length),r=0,a=i.length;rt||e[n]t))throw new Error(`Target ${t} is not in the stack`);if(e[a]==t)return a;if(e[n]==t)return n;for(;;){if(o++,1e3=e.length-1)return e.length-1;if(0>=r)return 0;r+=h}if(e[r]==t)return r;if(r==a||r==n)return s?Math.abs(t-e[a])t))return!1;i?a=r:n=r}h*=-1}}function g(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)}Object.defineProperty(t,"__esModule",{value:!0}),t.WaveformHash=t.Waveform=void 0,e=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,i):{};s.get||s.set?Object.defineProperty(e,i,s):e[i]=t[i]}return e.default=t,e}(e),i=r(i),s=r(s);class a{constructor(t=[],e=0,i=1){this.xOffset=e,this.xScale=i,this.errors={nb:0,bars:{above:null,below:null},boxes:{above:null,below:null}},this.BELOW=a.BELOW,this.ABOVE=a.ABOVE,this.BOX=a.BOX,this.BAR=a.BAR,this.setData(t)}setData(t,e=null){return this._originalData=t,this._originalDataX=e,this.xdata=null,this.mutated(),this}mutated(){let t;if(Array.isArray(this._originalData[0])){let e=[],i=[];this._originalData.forEach(t=>{e.push(t[0]),i.push(t[1])}),this.setXWaveform(e),t=i}else t=this._originalData;const e=this.isNaNAllowed();let i,s=!1;return this.getTypedArrayClass()?(i=this._makeArray(t.length),t.forEach((t,r)=>{e||t[0]==t[0]&&t[1]==t[1]||(s=!0),i[r]=t}),s&&this.warn("Trying to assign NaN values to a typed array that does not support NaNs. 0's will be used instead")):(e||t.forEach(t=>{e||t[0]==t[0]&&t[1]==t[1]||(s=!0)}),i=t),this._originalDataX&&(this.xdata?this.xdata.mutated():this.setXWaveform(this._originalDataX)),this._setData(i),this}getY(t,e){return e&&this.dataInUse?this.dataInUse.y[t]*this.getScale()+this.getShift():this.data[t]*this.getScale()+this.getShift()}setXWaveform(t){if(!(t instanceof a)){if(!Array.isArray(t))throw"Cannot set X waveform. Data is not a valid array.";t=new a(t)}return this.xdata=t,this.computeXMinMax(),this}hasXWaveform(){return!!this.xdata}getXWaveform(){if(this.xdata)return this.xdata;for(var t=new a,e=0;ethis.maxX||void 0===this.maxX)&&(this.maxX=t),(ethis.maxY||void 0===this.maxY)&&(this.maxY=e)}prepend(t,e){return"function"==typeof t&&(t=t(this)),"function"==typeof e&&(e=e(this)),this.xdata?this.xdata.prepend(null,t):null===t?this.xOffset-=this.xScale:(this.xdata=this.getXWaveform(),this.xdata.prepend(null,t)),this.data.unshift(e),this.recalculateMinMaxNewPoint(t,e),this}append(t,e){return"function"==typeof t&&(t=t(this)),"function"==typeof e&&(e=e(this)),this.xdata?this.xdata.append(null,t):null!==t&&(this.xdata=this.getXWaveform(),this.xdata.append(null,t)),this.monotoneous&&(e>this.data[this.data.y]&&!1===this.getMonotoneousAscending()||ethis.data[0]),this.data.push(e),this.recalculateMinMaxNewPoint(t,e),this}concat(t){return this.xdata||(this.xdata=this.getXWaveform()),t.xdata||(t.xdata=t.getXWaveform()),this.data=this.data.concat(t.data),this.xdata.data=this.xdata.data.concat(t.xdata.data),this.checkMonotonicity(),this.xdata.checkMonotonicity(),this.computeXMinMax(),this}_makeArray(t){const e=this.getTypedArrayClass();return e?new e(t):Array(t)}_setData(t){const e=t.length;let i=1,s=t[1]>t[0],r=t[0],a=t[0];for(isNaN(r)&&(r=Number.MAX_VALUE),isNaN(a)&&(a=-Number.MAX_VALUE),this._monotoneous=!0;it[i-1]&&(this._monotoneous=!1),t[i]==t[i]&&(r=Math.min(t[i],r),a=Math.max(t[i],a));this._monotoneous&&(this._monotoneousAscending=t[1]>t[0]),this.data=t,this.minY=r,this.maxY=a,this.checkMinMaxErrorBars(),this.computeXMinMax()}checkMinMaxErrorBars(){let t=this.minY,e=this.maxY,i=0,s=this.getLength();if(this.hasErrorBars()){for(i=0;ithis.getDataMaxX())&&(e&&this.dataInUse?s=this.dataInUse.x:this.xdata&&(s=this.xdata.getData()),r=this.hasXWaveform()?this.isXMonotoneous()?this.xdata.getIndexFromMonotoneousData(t,s,this.xdata.getMonotoneousAscending(),i):d(t,void 0,s,void 0,1,void 0):Math.max(0,Math.min(this.getLength()-1,i((t-this.xOffset)/this.xScale))),e&&this.dataInUse&&"aggregateX"==this.dataInUseType?r-r%4:r)}getIndexFromY(t,e=!1,i=Math.round){let s,r;return t-=this.getShift(),!((t/=this.getScale())this.getDataMaxY())&&(s=e&&this.dataInUse?this.dataInUse.y:this.getData(),r=d(void 0,t,void 0,s,1,void 0),e&&this.dataInUse&&"aggregateX"==this.dataInUseType?r-r%4:r)}setAtIndex(t,e){this.data[t]=e}getIndexFromXY(t,e,i=!1,s=Math.round,r=1,a=1){let n,o,h;return i&&this.dataInUse?(n=this.dataInUse.x,o=this.dataInUse.y):this.xdata&&(n=this.xdata.data,o=this.data),h=this.getIndexFromDataXY(t,n,e,o,r,a),i&&this.dataInUse&&"aggregateX"==this.dataInUseType?h-h%4:h}getIndexFromDataXY(t,e,i,s,r=1,a=1){return t-=this.getXShift(),t/=this.getXScale(),i-=this.getShift(),d(t,i/=this.getScale(),e,s,r,a)}getIndexFromMonotoneousData(t,e,i){if(!this.isMonotoneous())throw console.trace(),"Impossible to get the index from a non-monotoneous wave !";return t-=this.getShift(),p(t/=this.getScale(),e,!i)}findWithShortestDistance(t){if(!t.axisRef){const e=this.getIndexFromXY(t.x,t.y,!0,void 0,t.scaleX,t.scaleY);return t.xMaxDistance&&Math.abs(t.x-this.getX(e))>Math.abs(t.xMaxDistance)||t.yMaxDistance&&Math.abs(t.y-this.getY(e))>Math.abs(t.yMaxDistance)?-1:e}if("x"==t.axisRef){const e=this.getIndexFromX(t.x,!0,void 0);return t.xMaxDistance&&Math.abs(t.x-this.getX(e))>Math.abs(t.xMaxDistance)?-1:e}if("y"==t.axisRef){const e=this.getIndexFromY(t.y,!0,void 0);return t.yMaxDistance&&Math.abs(t.y-this.getY(e))>Math.abs(t.yMaxDistance)?-1:e}}getShortestDistanceToPoint(t,e,i,s){let r,a,n,o,h,l,u,d;t-=this.getXShift(),t/=this.getXScale(),e-=this.getShift();const p={x:t,y:e/=this.getScale()};for(h=0;hi&&o-t>i||t-r>i&&t-o>i)||s&&(a-e>s&&n-e>s||e-a>s&&e-n>s)||(c=p,f={x:r,y:a},x={x:o,y:n},l=Math.pow(function(t,e,i){var s=g(e,i);if(0==s)return g(t,e);var r=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/s;return r=Math.max(0,Math.min(1,r)),g(t,{x:e.x+r*(i.x-e.x),y:e.y+r*(i.y-e.y)})}(c,f,x),.5),l(e=Math.round(e))){let i=t;t=e,e=i}var i=e-t+1,s=0;let r,a=0;for(var n=this.getData();t<=e;t++)n.length-1>t&&(r=this.getX(t+1)-this.getX(t),a+=r,s+=n[t]*r);return[s,i,a]}integrateP(t,e){return this._integrateP(t,e)[0]}integrate(t,e){return this.integrateP(this.getIndexFromX(t),this.getIndexFromX(e))}average(t=0,e=this.getLength()-1){return this.getAverageP(t,e)}mean(){return this.average()}stddev(){let t=0,e=0;const i=this.mean();for(var s=0;se[0];te[t-1])return this._monotoneous=!1;return this._monotoneousAscending=e[1]>e[0],this._monotoneous=!0}requireXMonotonicity(){this.xdata&&this.xdata.requireMonotonicity()}requireMonotonicity(){if(!this.isMonotoneous())throw"The wave must be monotonic"}isMonotoneous(){return!!this._monotoneous}isXMonotoneous(){return!this.xdata||this.xdata.isMonotoneous()}invert(t){return(t||this.data).reverse(),this.xdata&&this.xdata.invert(),this.isMonotoneous()&&(this._monotoneousAscending=!this._monotoneousAscending),this}resampleForDisplay(t){let e=0;this.requireXMonotonicity();let i,s,r,a,n,o,h,l,u=!1,d=this.getDataY(),p={x:[],y:[]},g=[],c=!1,f=0;const x=this.getLength();if(!t.xPosition)throw"No position calculation method provided";if(!t.resampleToPx)throw"No \"resampleToPx\" method was provided. Unit: px per point";if(t.minX>t.maxX){let e=t.minX;t.minX=t.maxX,t.maxX=e}for((this.xdata&&!this.xdata.getMonotoneousAscending()||!this.xdata&&-0>this.xScale)&&(u=!0,e=x);u?0l)f=e;else if(!(h=t.xPosition(l),c)){for(f?(p.x.push(l),p.y.push(d[f])):f=e;isNaN(d[e]);)u?e--:e++;i=s=r=d[f],a=1,o=h,n=l,f=0,c=!0}else if(Math.abs(h-o)>t.resampleToPx||e==x||0==e||isNaN(d[e])){let e=(n+l)/2;if(p.x.push(e),p.y.push(i/a),g.push(e,s,r),void 0!==t.maxX&&l>t.maxX)break;c=!1}else i+=d[e],a++,s=Math.min(s,d[e]),r=Math.max(r,d[e]);return this.dataInUseType="resampled",this.dataInUse=p,g}interpolate(t){let e,i=this.getDataY();if(this.xdata){let s=this.xdata.getData();try{e=p(t,s,!this.xdata.getMonotoneousAscending())}catch(t){return NaN}return s[e]==t?i[e]:(t-s[e])/(s[e+1]-s[e])*(i[e+1]-i[e])+i[e]}{e=(t-this.xOffset)/this.xScale;let s=Math.floor(e);return(e-s)*(i[s+1]-i[s])+i[s]}}interpolateIndex_X(t){if(this.getDataY(),this.xdata){let e=this.xdata.getData(),i=Math.floor(t);return(t-i)*(e[i+1]-e[i])+e[i]}}getMonotoneousAscending(){return this.isMonotoneous()?this._monotoneousAscending:"The waveform is not monotoneous"}getXMonotoneousAscending(){return this.xdata?this.xdata.getMonotoneousAscending():0Math.log(t)/e)}add(t){return this._arithmetic(t,o)}addBy(){return this.add(...arguments)}subtract(t){return this._arithmetic(t,h)}subtractBy(){return this.subtract(...arguments)}math(t){for(var e=0;et-e);const d=u.map(i=>e==n?this.interpolate(i)*t.interpolate(i):e==l?this.interpolate(i)/t.interpolate(i):e==o?this.interpolate(i)+t.interpolate(i):e==h?this.interpolate(i)-t.interpolate(i):void 0);this._setData(d),this.xdata._setData(u)}else{if(e==n)for(;s>=1;)e<<=1;return e}(this.getLength());this._dataAggregating=(0,i.default)({minX:this.minX,maxX:this.maxX,minY:this.minY,maxY:this.maxY,data:this.data,xdata:this.xdata?this.xdata.getData():void 0,xScale:this.xScale,xOffset:this.xOffset,numPoints:e,direction:t}).then(t=>{this._dataAggregated=t.aggregates,this._dataAggregating=!1})}hasAggregation(){return!!this._dataAggregated}selectAggregatedData(t){if(2>t)return!1;var e=function(t){t--;for(var e=2;t>>=1;)e<<=1;return e}(t);return this._dataAggregated[e]?(this.dataInUseType="aggregate"+this._dataAggregationDirection,void(this.dataInUse=this._dataAggregated[e])):this._dataAggregating?this._dataAggregating:(this.dataInUseType="none",void(this.dataInUse={y:this.data,x:this.getXWaveform().data}))}duplicate(t=!0){var e=new a;return e._setData(this.getDataY().slice()),e.rescaleX(this.xOffset,this.xShift),e.setShift(this.getShift()),e.setScale(this.getScale()),this.xdata?(t?e.setXWaveform(this.xdata.duplicate()):e.setXWaveform(this.xdata),e.setXShift(this.getXShift()),e.setXScale(this.getXScale())):(e.xOffset=this.xOffset,e.xScale=this.xScale),e}subrangeX(t,e){if(this.xdata){for(var i=new a,s=0,r=this.data.length;s=t&&this.data[s]r&&(r=this.getY(n),a=n)}else for(r=Number.POSITIVE_INFINITY,n=t;n<=e;n++)this.getY(n)o)break;if(!(ai.rangeP[1]-(l-1)/2)break;if(s=this.getAverageP(a-(l-1)/2,a+(l-1)/2),null==r)r=s=t&&r){if(r=!1,"ascending"==i.edge||"both"==i.edge)for(let e=a+(l-1)/2;e>=a-(l-1)/2;e--)if(this.data[e]>=t&&this.data[e-1]<=t)switch(i.rounding){case"before":return e-1;case"after":return e;case"interpolate":return u(t,this.data[e],this.data[e-1],e,e-1);}}else if(s<=t&&!r&&(r=!0,"descending"==i.edge||"both"==i.edge))for(n=a+(l-1)/2;n>=a-(l-1)/2;n--)if(this.data[n]<=t&&this.data[n-1]>=t)switch(i.rounding){case"before":return n-1;case"after":return n;case"interpolate":return u(t,this.data[n],this.data[n-1],n,n-1);}}}}normalize(t){let e,i,s,r,a,n;if("max1"==t||"max100"==t){for(e=1,"max100"==t&&(e=100),r=this.data[0],n=1;nr&&(r=this.data[n]);for(n=0;nr?r=this.data[n]:this.data[n]