@mescius/wijmo.chart 5.20232.939

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ /*!
2
+ *
3
+ * Wijmo Library 5.20232.939
4
+ * https://developer.mescius.com/wijmo
5
+ *
6
+ * Copyright(c) MESCIUS inc. All rights reserved.
7
+ *
8
+ * Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
9
+ * us.sales@mescius.com
10
+ * https://developer.mescius.com/wijmo/licensing
11
+ *
12
+ */
13
+
14
+ "use strict";var __importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);e.default=t;return e};Object.defineProperty(exports,"__esModule",{value:!0});const wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.chart"));class _VolumeHelper{constructor(t,e,i,s,r){this._volumes=wijmo_1.asArray(t);this._xVals=wijmo_1.asArray(e);this._xDataMin=wijmo_1.asNumber(i,!0,!1);this._xDataMax=wijmo_1.asNumber(s,!0,!1);this._xDataType=wijmo_1.asEnum(r,wijmo_1.DataType,!0);this._calcData=[];this._init()}convert(t,e,i){var s=void 0,r=this._calcData.length,a=-1;if(this._hasXs&&this._xDataType===wijmo_1.DataType.Date){if(-1===(a=this._xVals.indexOf(t)))for(var n=0;n<this._xVals.length;n++){if(n<this._xVals.length-1&&this._xVals[n]<=t&&t<=this._xVals[n+1]){a=n;break}if(0===n&&t<=this._xVals[n]){a=n;break}if(n===this._xVals.length-1&&this._xVals[n]<=t){a=n;break}}if(-1===a){a=this._xVals.indexOf(Math.floor(t));a=wijmo_1.clamp(a,0,r-1)}}else if(this._hasXs){if(-1===(a=this._xVals.indexOf(t))){a=this._xVals.indexOf(Math.floor(t));a=wijmo_1.clamp(a,0,r-1)}}else a=wijmo_1.clamp(Math.round(t),0,r-1);if(0<=a&&a<r){this._hasXs&&(t=_VolumeHelper.convertToRange(t,0,r-1,this._xDataMin,this._xDataMax));s=((s=this._calcData[a].value+(t-a)*this._calcData[a].width-.5*this._calcData[a].width)-(e=this._getXVolume(e)))/((i=this._getXVolume(i))-e)}return s}convertBack(t,e,i){var s,r=void 0,a=this._calcData.length,n=-1;for(s=0;s<a;s++)if(this._calcData[s].x1<=t&&t<=this._calcData[s].x2||0===s&&t<=this._calcData[s].x2||s===a-1&&this._calcData[s].x1<=t){n=s;break}if(0<=n&&n<a){r=t/this._calcData[n].width-this._calcData[n].value/this._calcData[n].width+.5+s;this._hasXs&&(r=_VolumeHelper.convertToRange(r,this._xDataMin,this._xDataMax,0,a-1))}return r}_init(){this._hasXs=null!==this._xVals&&this._xVals.length>0;this._hasXs&&!wijmo_1.isNumber(this._xDataMin)&&(this._xDataMin=Math.min.apply(null,this._xVals));this._hasXs&&!wijmo_1.isNumber(this._xDataMax)&&(this._xDataMax=Math.max.apply(null,this._xVals));this._hasXs&&(this._hasXs=wijmo_1.isNumber(this._xDataMin)&&wijmo_1.isNumber(this._xDataMax));this._hasXs&&this._xDataType===wijmo_1.DataType.Date&&this._fillGaps();var t=0,e=0,i=null!==this._volumes&&this._volumes.length>0?this._volumes.length:0;for(e=0;e<i;e++)t+=this._volumes[e]||0;var s,r,a=0;for(e=0;e<i;e++){s=a+(r=(this._volumes[e]||0)/t);this._calcData.push({value:s,width:r,x1:a,x2:s});a=this._calcData[e].value}}_getXVolume(t){var e=this._calcData.length,i=-1;if(this._hasXs){i=this._xVals.indexOf(t);for(var s=0;s<this._xVals.length;s++){if(s<this._xVals.length-1&&this._xVals[s]<=t&&t<=this._xVals[s+1]){i=s;break}if(0===s&&t<=this._xVals[s]){i=s;break}if(s===this._xVals.length-1&&this._xVals[s]<=t){i=s;break}}}this._hasXs&&(t=_VolumeHelper.convertToRange(t,0,e-1,this._xDataMin,this._xDataMax));-1===i&&(i=wijmo_1.clamp(Math.round(t),0,e-1));return this._calcData[i].value+(t-i)*this._calcData[i].width-.5*this._calcData[i].width}static convertToRange(t,e,i,s,r){return e===i||s===r?0:(t-s)*(i-e)/(r-s)+e}_fillGaps(){if(!(this._xDataType!==wijmo_1.DataType.Date||null===this._xVals||this._xVals.length<=0)){var t,e=this._xDataMin,i=this._xDataMax;for(t=1;e<i;t++){(e=new Date(e)).setDate(e.getDate()+1);if((e=e.valueOf())!==this._xVals[t]){this._xVals.splice(t,0,e);this._volumes.splice(t,0,0)}}}}}exports._VolumeHelper=_VolumeHelper;class _Spline{constructor(t,e,i){this.k=.002;this._a=[];this._b=[];this._c=[];this._d=[];this.m=[[-.5,1.5,-1.5,.5],[1,-2.5,2,-.5],[-.5,0,.5,0],[0,1,0,0]];this._x=t;this._y=e;var s=this._len=i||Math.min(t.length,e.length);if(s>3)for(var r=0;r<s-1;r++){var a=0==r?new wijmo_1.Point(t[r],e[r]):new wijmo_1.Point(t[r-1],e[r-1]),n=new wijmo_1.Point(t[r],e[r]),h=new wijmo_1.Point(t[r+1],e[r+1]),l=r==s-2?new wijmo_1.Point(t[r+1],e[r+1]):new wijmo_1.Point(t[r+2],e[r+2]),o=new wijmo_1.Point,_=new wijmo_1.Point,d=new wijmo_1.Point,c=new wijmo_1.Point;o.x=a.x*this.m[0][0]+n.x*this.m[0][1]+h.x*this.m[0][2]+l.x*this.m[0][3];_.x=a.x*this.m[1][0]+n.x*this.m[1][1]+h.x*this.m[1][2]+l.x*this.m[1][3];d.x=a.x*this.m[2][0]+n.x*this.m[2][1]+h.x*this.m[2][2]+l.x*this.m[2][3];c.x=a.x*this.m[3][0]+n.x*this.m[3][1]+h.x*this.m[3][2]+l.x*this.m[3][3];o.y=a.y*this.m[0][0]+n.y*this.m[0][1]+h.y*this.m[0][2]+l.y*this.m[0][3];_.y=a.y*this.m[1][0]+n.y*this.m[1][1]+h.y*this.m[1][2]+l.y*this.m[1][3];d.y=a.y*this.m[2][0]+n.y*this.m[2][1]+h.y*this.m[2][2]+l.y*this.m[2][3];c.y=a.y*this.m[3][0]+n.y*this.m[3][1]+h.y*this.m[3][2]+l.y*this.m[3][3];this._a.push(o);this._b.push(_);this._c.push(d);this._d.push(c)}}calculatePoint(t){var e=Math.floor(t);e<0&&(e=0);e>this._len-2&&(e=this._len-2);var i=t-e;return{x:((this._a[e].x*i+this._b[e].x)*i+this._c[e].x)*i+this._d[e].x,y:((this._a[e].y*i+this._b[e].y)*i+this._c[e].y)*i+this._d[e].y}}calculate(){if(this._len<=3)return{xs:this._x,ys:this._y};var t=[],e=[],i=this.calculatePoint(0);t.push(i.x);e.push(i.y);for(var s=this._len*this.k,r=s;r<=this._len-1;r+=s){var a=this.calculatePoint(r);if(Math.abs(i.x-a.x)>=3||Math.abs(i.y-a.y)>=3){t.push(a.x);e.push(a.y);i=a}}return{xs:t,ys:e}}}exports._Spline=_Spline;class Palettes{static _isExtended(t){return-1!==this._values(Palettes.Diverging).indexOf(t)||-1!==this._values(Palettes.Qualitative).indexOf(t)||-1!==this._values(Palettes.SequentialSingle).indexOf(t)||-1!==this._values(Palettes.SequentialMulti).indexOf(t)}static _values(t){return Object.keys(t).map(e=>t[e])}}Palettes.standard=["#88bde6","#fbb258","#90cd97","#f6aac9","#bfa554","#bc99c7","#eddd46","#f07e6e","#8c8c8c"];Palettes.cocoa=["#466bb0","#c8b422","#14886e","#b54836","#6e5944","#8b3872","#73b22b","#b87320","#141414"];Palettes.coral=["#84d0e0","#f48256","#95c78c","#efa5d6","#ba8452","#ab95c2","#ede9d0","#e96b7d","#888888"];Palettes.dark=["#005fad","#f06400","#009330","#e400b1","#b65800","#6a279c","#d5a211","#dc0127","#000000"];Palettes.highcontrast=["#ff82b0","#0dda2c","#0021ab","#bcf28c","#19c23b","#890d3a","#607efd","#1b7700","#000000"];Palettes.light=["#ddca9a","#778deb","#cb9fbb","#b5eae2","#7270be","#a6c7a7","#9e95c7","#95b0c7","#9b9b9b"];Palettes.midnight=["#83aaca","#e37849","#14a46a","#e097da","#a26d54","#a584b7","#d89c54","#e86996","#2c343b"];Palettes.modern=["#2d9fc7","#ec993c","#89c235","#e377a4","#a68931","#a672a6","#d0c041","#e35855","#68706a"];Palettes.organic=["#9c88d9","#a3d767","#8ec3c0","#e9c3a9","#91ab36","#d4ccc0","#61bbd8","#e2d76f","#80715a"];Palettes.slate=["#7493cd","#f99820","#71b486","#e4a491","#cb883b","#ae83a4","#bacc5c","#e5746a","#505d65"];Palettes.zen=["#7bb5ae","#e2d287","#92b8da","#eac4cb","#7b8bbd","#c7d189","#b9a0c8","#dfb397","#a9a9a9"];Palettes.cyborg=["#2a9fd6","#77b300","#9933cc","#ff8800","#cc0000","#00cca3","#3d6dcc","#525252","#000000"];Palettes.superhero=["#5cb85c","#f0ad4e","#5bc0de","#d9534f","#9f5bde","#46db8c","#b6b86e","#4e5d6c","#2b3e4b"];Palettes.flatly=["#18bc9c","#3498db","#f39c12","#6cc1be","#99a549","#8f54b5","#e74c3c","#8a9899","#2c3e50"];Palettes.darkly=["#375a7f","#00bc8c","#3498db","#f39c12","#e74c3c","#8f61b3","#b08725","#4a4949","#000000"];Palettes.cerulan=["#033e76","#87c048","#59822c","#53b3eb","#fc6506","#d42323","#e3bb00","#cccccc","#222222"];Palettes.Qualitative={Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"]};Palettes.Diverging={BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]};Palettes.SequentialSingle={Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]};Palettes.SequentialMulti={BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]};exports.Palettes=Palettes;exports.empty={};class PlotArea{constructor(t){this._row=0;this._col=0;this._rect=new wijmo_1.Rect(0,0,0,0);wijmo_1.copy(this,t)}get row(){return this._row}set row(t){if(t!=this._row){this._row=wijmo_1.asInt(t,!0,!0);this._invalidate()}}get column(){return this._col}set column(t){if(t!=this._col){this._col=wijmo_1.asInt(t,!0,!0);this._invalidate()}}get name(){return this._name}set name(t){t!=this._name&&(this._name=wijmo_1.asString(t,!0))}get width(){return this._width}set width(t){if(t!=this._width){this._width=t;this._invalidate()}}get height(){return this._height}set height(t){if(t!=this._height){this._height=t;this._invalidate()}}get style(){return this._style}set style(t){if(t!=this._style){this._style=t;this._invalidate()}}_invalidate(){this._chart&&this._chart.invalidate()}_render(t){t.drawRect(this._rect.left,this._rect.top,this._rect.width,this._rect.height,null,this.style)}_setPlotX(t,e){this._rect.left=t;this._rect.width=e}_setPlotY(t,e){this._rect.top=t;this._rect.height=e}}exports.PlotArea=PlotArea;class PlotAreaCollection extends wijmo_1.ObservableArray{getPlotArea(t){var e=this.indexOf(t);return e>-1?this[e]:null}indexOf(t){for(var e=0;e<this.length;e++)if(this[e].name==t)return e;return-1}_getWidth(t){for(var e=0;e<this.length;e++){var i=this[e];if(i.column==t&&0==i.row)return i.width}}_getHeight(t){for(var e=0;e<this.length;e++){var i=this[e];if(i.row==t&&0==i.column)return i.height}}_calculateWidths(t,e){if(e<=0)throw"ncols";for(var i=[],s=0;s<e;s++){var r=this._getWidth(s);i[s]=new _GridLength(r)}return this._calculateLengths(t,e,i)}_calculateHeights(t,e){if(e<=0)throw"nrows";for(var i=[],s=0;s<e;s++){var r=this._getHeight(s);i[s]=new _GridLength(r)}return this._calculateLengths(t,e,i)}_calculateLengths(t,e,i){for(var s=[e],r=0,a=0,n=0;n<e;n++)if(i[n].isAbsolute){s[n]=i[n].value;r+=s[n]}else i[n].isStar?a+=i[n].value:i[n].isAuto&&a++;var h=(t-r)/a;for(n=0;n<e;n++){i[n].isStar?s[n]=h*i[n].value:i[n].isAuto&&(s[n]=h);s[n]<0&&(s[n]=0)}return s}}exports.PlotAreaCollection=PlotAreaCollection;var _GridUnitType,ImageFormat,SelectionMode,Position,Orientation,ChartType,Stacking,LabelPosition,PieLabelPosition,AxisType,OverlappingLabels,TickMark,AxisGroupsDisplay,_tmInc,_MeasureOption,ChartElement,SeriesVisibility,Marker;!function(t){t[t.Auto=0]="Auto";t[t.Pixel=1]="Pixel";t[t.Star=2]="Star"}(_GridUnitType||(_GridUnitType={}));class _GridLength{constructor(t=null){this._unitType=_GridUnitType.Auto;if(t)if((t=t.toString()).indexOf("*")>=0){this._unitType=_GridUnitType.Star;t=t.replace("*","");this._value=parseFloat(t);isNaN(this._value)&&(this._value=1)}else{this._unitType=_GridUnitType.Pixel;this._value=parseFloat(t);if(isNaN(this._value)){this._unitType=_GridUnitType.Auto;this._value=1}}}get value(){return this._value}get isStar(){return this._unitType==_GridUnitType.Star}get isAbsolute(){return this._unitType==_GridUnitType.Pixel}get isAuto(){return this._unitType==_GridUnitType.Auto}}class _SvgRenderEngine{constructor(t){this._strokeWidth=1;this._fontSize=null;this._fontFamily=null;this._savedGradient={};this._bbCache={};this._baseUrl="";this._cssPriority=!0;this._readOnly=!1;this._isRtl=!1;this._precision=1;this._element=t;this._create();this._element&&this._element.appendChild(this._svg);let e=navigator.userAgent.toLowerCase();void 0===_SvgRenderEngine._isff&&(_SvgRenderEngine._isff=e.indexOf("firefox")>=0);void 0===_SvgRenderEngine._isSafari&&(_SvgRenderEngine._isSafari=e.indexOf("safari")>-1&&-1==e.indexOf("chrome"));this._baseUrl=window.location.pathname.replace(window.location.hash,"");"file:"==window.location.protocol&&(wijmo_1.isIE()||wijmo_1.isEdge())&&(this._baseUrl="file:"+this._baseUrl)}attach(t){this._element=t;if(t){t.insertBefore(this._svg,t.childNodes[0]);t.appendChild(this._svg)}}detach(){this._element&&this._element.removeChild(this._svg);for(;this._svg.firstChild;)wijmo_1.removeChild(this._svg.firstChild)}beginRender(){for(;this._svg.firstChild;)wijmo_1.removeChild(this._svg.firstChild);this._savedGradient={};this._bbCache={};this._svg.appendChild(this._defs);this._svg.appendChild(this._textGroup);this._isRtl=this._checkRtl()}endRender(){wijmo_1.removeChild(this._textGroup)}setViewportSize(t,e){this._svg.setAttribute("width",t.toString());this._svg.setAttribute("height",e.toString())}get element(){return this._svg}get fill(){return this._fill}set fill(t){this._fill=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get stroke(){return this._stroke}set stroke(t){this._stroke=t}get strokeWidth(){return this._strokeWidth}set strokeWidth(t){this._strokeWidth=void 0===t?null:t}get textFill(){return this._textFill}set textFill(t){this._textFill=t}get cssPriority(){return this._cssPriority}set cssPriority(t){this._cssPriority=t}get readOnly(){return this._readOnly}set readOnly(t){this._readOnly=t}get precision(){return this._precision}set precision(t){this._precision=wijmo_1.asNumber(t)}get group(){return this._group}addClipRect(t,e){if(t&&e){let r=this.precision;var i=document.createElementNS(_SvgRenderEngine.svgNS,"clipPath"),s=document.createElementNS(_SvgRenderEngine.svgNS,"rect");s.setAttribute("x",(t.left-1).toFixed(r));s.setAttribute("y",(t.top-1).toFixed(r));s.setAttribute("width",(t.width+2).toFixed(r));s.setAttribute("height",(t.height+2).toFixed(r));i.appendChild(s);i.setAttribute("id",e);this._svg.appendChild(i)}}drawEllipse(t,e,i,s,r,a){let n=document.createElementNS(_SvgRenderEngine.svgNS,"ellipse"),h=this.precision;this._applyColor(n,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(n,"stroke-width",this._strokeWidth.toString());this._applyColor(n,"fill",this._fill);n.setAttribute("cx",t.toFixed(h));n.setAttribute("cy",e.toFixed(h));n.setAttribute("rx",i.toFixed(h));n.setAttribute("ry",s.toFixed(h));r&&n.setAttribute("class",r);this._applyStyle(n,a);this._appendChild(n);return n}drawRect(t,e,i,s,r,a,n){let h=document.createElementNS(_SvgRenderEngine.svgNS,"rect"),l=this.precision;this._applyColor(h,"fill",this._fill);this._applyColor(h,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(h,"stroke-width",this._strokeWidth.toString());h.setAttribute("x",t.toFixed(l));isNaN(Number(e))||h.setAttribute("y",e.toFixed(l));i>0&&i<.05?h.setAttribute("width","0.1"):h.setAttribute("width",i.toFixed(l));s>0&&s<.05?h.setAttribute("height","0.1"):h.setAttribute("height",s.toFixed(l));n&&this._setClipPath(h,n);r&&h.setAttribute("class",r);this._applyStyle(h,a);this._appendChild(h);return h}drawLine(t,e,i,s,r,a){let n=document.createElementNS(_SvgRenderEngine.svgNS,"line"),h=this.precision;this._applyColor(n,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(n,"stroke-width",this._strokeWidth.toString());n.setAttribute("x1",t.toFixed(h));n.setAttribute("x2",i.toFixed(h));n.setAttribute("y1",e.toFixed(h));n.setAttribute("y2",s.toFixed(h));r&&n.setAttribute("class",r);this._applyStyle(n,a);this._appendChild(n);return n}drawLines(t,e,i,s,r,a){if(t&&e){var n=a||Math.min(t.length,e.length);if(n>0){let a=document.createElementNS(_SvgRenderEngine.svgNS,"polyline"),o=this.precision;this._applyColor(a,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(a,"stroke-width",this._strokeWidth.toString());a.setAttribute("fill","none");for(var h="",l=0;l<n;l++)h+=t[l].toFixed(o)+","+e[l].toFixed(o)+" ";a.setAttribute("points",h);i&&a.setAttribute("class",i);r&&this._setClipPath(a,r);this._applyStyle(a,s);this._appendChild(a);return a}}return null}drawSplines(t,e,i,s,r,a){if(t&&e){var n=new _Spline(t,e,a).calculate(),h=n.xs,l=n.ys,o=Math.min(h.length,l.length);if(o>0){let t=document.createElementNS(_SvgRenderEngine.svgNS,"polyline"),e=this.precision;this._applyColor(t,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(t,"stroke-width",this._strokeWidth.toString());t.setAttribute("fill","none");for(var _="",d=0;d<o;d++)_+=h[d].toFixed(e)+","+l[d].toFixed(e)+" ";t.setAttribute("points",_);i&&t.setAttribute("class",i);r&&this._setClipPath(t,r);this._applyStyle(t,s);this._appendChild(t);return t}}return null}drawPolygon(t,e,i,s,r){if(t&&e){var a=Math.min(t.length,e.length);if(a>0){let l=document.createElementNS(_SvgRenderEngine.svgNS,"polygon"),o=this.precision;this._applyColor(l,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(l,"stroke-width",this._strokeWidth.toString());this._applyColor(l,"fill",this._fill);for(var n="",h=0;h<a;h++)n+=t[h].toFixed(o)+","+e[h].toFixed(o)+" ";l.setAttribute("points",n);i&&l.setAttribute("class",i);r&&this._setClipPath(l,r);this._applyStyle(l,s);this._appendChild(l);return l}}return null}drawPieSegment(t,e,i,s,r,a,n,h){if(r>=2*Math.PI)return this.drawEllipse(t,e,i,i,a,n);let l=document.createElementNS(_SvgRenderEngine.svgNS,"path"),o=this.precision;this._applyColor(l,"fill",this._fill);this._applyColor(l,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(l,"stroke-width",this._strokeWidth.toString());var _=new wijmo_1.Point(t,e);_.x+=i*Math.cos(s);_.y+=i*Math.sin(s);var d=s+r,c=new wijmo_1.Point(t,e);c.x+=i*Math.cos(d);c.y+=i*Math.sin(d);var u=" 0 0,1 ";Math.abs(r)>Math.PI&&(u=" 0 1,1 ");var g="M "+_.x.toFixed(o)+","+_.y.toFixed(o);g+=" A "+i.toFixed(o)+","+i.toFixed(o)+u;g+=c.x.toFixed(o)+","+c.y.toFixed(o);g+=" L "+t.toFixed(o)+","+e.toFixed(o)+" z";l.setAttribute("d",g);h&&this._setClipPath(l,h);a&&l.setAttribute("class",a);this._applyStyle(l,n);this._appendChild(l);return l}drawDonutSegment(t,e,i,s,r,a,n,h,l){var o=!1;if(a>=2*Math.PI){o=!0;a-=.001}let _=document.createElementNS(_SvgRenderEngine.svgNS,"path"),d=this.precision+2;this._applyColor(_,"fill",this._fill);this._applyColor(_,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(_,"stroke-width",this._strokeWidth.toString());var c=new wijmo_1.Point(t,e);c.x+=i*Math.cos(r);c.y+=i*Math.sin(r);var u=r+a,g=new wijmo_1.Point(t,e);g.x+=i*Math.cos(u);g.y+=i*Math.sin(u);var m=new wijmo_1.Point(t,e);m.x+=s*Math.cos(u);m.y+=s*Math.sin(u);var f=new wijmo_1.Point(t,e);f.x+=s*Math.cos(r);f.y+=s*Math.sin(r);var p=" 0 0,1 ",x=" 0 0,0 ";if(Math.abs(a)>Math.PI){p=" 0 1,1 ";x=" 0 1,0 "}var w="M "+c.x.toFixed(d)+","+c.y.toFixed(d);w+=" A "+i.toFixed(d)+","+i.toFixed(d)+p;w+=g.x.toFixed(d)+","+g.y.toFixed(d);w+=o?" M "+m.x.toFixed(d)+","+m.y.toFixed(d):" L "+m.x.toFixed(d)+","+m.y.toFixed(d);w+=" A "+s.toFixed(d)+","+s.toFixed(d)+x;w+=f.x.toFixed(d)+","+f.y.toFixed(d);o||(w+=" z");_.setAttribute("d",w);l&&this._setClipPath(_,l);n&&_.setAttribute("class",n);this._applyStyle(_,h);this._appendChild(_);return _}drawString(t,e,i,s){let r=this._createText(e,t),a=this.precision;i&&r.setAttribute("class",i);this._applyStyle(r,s);this._appendChild(r);var n,h=this._getKey(t,i,this._groupCls);if(this._bbCache[h]){n=this._bbCache[h];r.setAttribute("y",(e.y-(n.y+n.height)).toFixed(a))}else{n=this._getBBox(r);r.setAttribute("y",(e.y-(n.y+n.height-e.y)).toFixed(a))}this._isRtl&&!wijmo_1.isIE()&&r.setAttribute("x",(e.x+n.width).toFixed(a));return r}drawStringRotated(t,e,i,s,r,a){let n=this._createText(e,t),h=this.precision;r&&n.setAttribute("class",r);this._applyStyle(n,a);var l=document.createElementNS(_SvgRenderEngine.svgNS,"g");l.setAttribute("transform","rotate("+s.toFixed(h)+","+i.x.toFixed(h)+","+i.y.toFixed(h)+")");l.appendChild(n);this._appendChild(l);var o=this._getBBox(n);n.setAttribute("y",(e.y-(o.y+o.height-e.y)).toFixed(h));this._isRtl&&!wijmo_1.isIE()&&n.setAttribute("x",(e.x+o.width).toFixed(h));return n}measureString(t,e,i,s){var r=new wijmo_1.Size(0,0);if(!this._fontFamily&&!this._fontSize){let s=this._getKey(t,e,i);if(this._bbCache[s])return this._bbCache[s]}if(this.cssPriority){this._fontSize&&this._text.setAttribute("font-size",this._fontSize);this._fontFamily&&this._text.setAttribute("font-family",this._fontFamily)}else{let t="";this._fontSize&&(t+="font-size:"+this._fontSize+";");this._fontFamily&&(t+="font-family:"+this._fontFamily+";");t.length>0&&this._text.setAttribute("style",t)}e&&this._text.setAttribute("class",e);i&&this._textGroup.setAttribute("class",i);this._applyStyle(this._text,s);this._setText(this._text,t);var a=this._getBBox(this._text);r.width=a.width;r.height=a.height;this._text.removeAttribute("font-size");this._text.removeAttribute("font-family");this._text.removeAttribute("class");this._text.removeAttribute("style");if(s)for(var n in s)this._text.removeAttribute(this._deCase(n));this._textGroup.removeAttribute("class");this._text.textContent=null;if(!this._fontFamily&&!this._fontSize){let s=this._getKey(t,e,i);this._bbCache[s]={x:a.x,y:a.y+1e3,width:a.width,height:a.height}}return r}startGroup(t,e,i=!1){var s=document.createElementNS(_SvgRenderEngine.svgNS,"g");if(t){s.setAttribute("class",t);this._groupCls=t}e&&this._setClipPath(s,e);this._appendChild(s);i&&s.transform.baseVal.appendItem(this._svg.createSVGTransform());this._group=s;return s}endGroup(){if(this._group){var t=this._group.parentNode;if(t==this._svg){this._group=null;this._groupCls=null}else{this._group=t;this._groupCls=this._getClass(this._group)}}}drawImage(t,e,i,s,r){let a=document.createElementNS(_SvgRenderEngine.svgNS,"image"),n=this.precision;a.setAttributeNS(_SvgRenderEngine.xlinkNS,"href",t);a.setAttribute("x",e.toFixed(n));a.setAttribute("y",i.toFixed(n));a.setAttribute("width",s.toFixed(n));a.setAttribute("height",r.toFixed(n));this._appendChild(a);return a}_setClipPath(t,e){t.setAttribute("clip-path","url(#"+e+")");_SvgRenderEngine._isSafari&&wijmo_1.setCss(t,{"-webkit-clip-path":"url(#"+e+")"})}_appendChild(t){if(!this.readOnly){var e=this._group;e||(e=this._svg);e.appendChild(t)}}_create(){this._svg=document.createElementNS(_SvgRenderEngine.svgNS,"svg");this._defs=document.createElementNS(_SvgRenderEngine.svgNS,"defs");this._svg.appendChild(this._defs);this._text=this._createText(new wijmo_1.Point(-1e3,-1e3),"");this._textGroup=document.createElementNS(_SvgRenderEngine.svgNS,"g");this._textGroup.appendChild(this._text);this._svg.appendChild(this._textGroup)}_setText(t,e){var i=e?e.toString():null;if(i&&i.indexOf("tspan")>=0)try{t.textContent=null;for(var s=new DOMParser,r='<svg xmlns="http://www.w3.org/2000/svg">'+i+"</svg>",a=s.parseFromString(r,"text/xml").documentElement.firstChild;a;){t.appendChild(t.ownerDocument.importNode(a,!0));a=a.nextSibling}}catch(t){throw new Error("Error parsing XML string.")}else t.textContent=i}_getKey(t,e,i){return t+(e||"")+(i||"")}_createText(t,e){let i=document.createElementNS(_SvgRenderEngine.svgNS,"text"),s=this.precision;this._setText(i,e);i.setAttribute("x",t.x.toFixed(s));i.setAttribute("y",t.y.toFixed(s));if(this.cssPriority){null!=this._textFill&&i.setAttribute("fill",this._textFill);this._fontSize&&i.setAttribute("font-size",this._fontSize);this._fontFamily&&i.setAttribute("font-family",this._fontFamily)}else{let t="";null!=this._textFill&&(t+="fill:"+this._textFill+";");this._fontSize&&(t+="font-size:"+this._fontSize+";");this._fontFamily&&(t+="font-family:"+this._fontFamily+";");t.length>0&&i.setAttribute("style",t)}return i}_applyStyle(t,e){if(e)for(var i in e)"fill"===i||"stroke"===i?this._applyColor(t,i,e[i]):t.setAttribute(this._deCase(i),e[i])}_deCase(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()}))}_getClass(t){let e;if(t)for(let i=t;i&&!(e=i.getAttribute("class"));i=i.parentNode);return e}_getBBox(t){if(!_SvgRenderEngine._isff)return t.getBBox();try{return t.getBBox()}catch(t){return{x:0,y:0,width:0,height:0}}}_applyColor(t,e,i){let s=_GradientColorUtil.tryParse(i);if(null!=s){if(!wijmo_1.isString(s)){if(null==this._savedGradient[i]){var r,a="gc"+(1e6*Math.random()).toFixed();if(null!=s.x1){r=document.createElementNS(_SvgRenderEngine.svgNS,"linearGradient");["x1","y1","x2","y2","gradientUnits"].forEach(t=>{null!=s[t]&&r.setAttribute(t,s[t])})}else if(null!=s.r){r=document.createElementNS(_SvgRenderEngine.svgNS,"radialGradient");["cx","cy","r","fx","fy","fr","gradientUnits"].forEach(t=>{null!=s[t]&&r.setAttribute(t,s[t])})}s.colors&&s.colors&&s.colors.length>0&&s.colors.forEach(t=>{var e=document.createElementNS(_SvgRenderEngine.svgNS,"stop");null!=t.color&&e.setAttribute("stop-color",t.color);null!=t.offset&&e.setAttribute("offset",t.offset);null!=t.opacity&&e.setAttribute("stop-opacity",t.opacity);r.appendChild(e)});r.setAttribute("id",a);this._defs.appendChild(r);this._savedGradient[i]=a}s=`url(${this._baseUrl}#${this._savedGradient[i]})`}this.cssPriority?t.setAttribute(e,s):this._addInlineStyle(t,e,s)}}_addInlineStyle(t,e,i){let s=t.getAttribute("style");s?t.setAttribute("style",s+e+":"+i+";"):t.setAttribute("style",e+":"+i+";")}_setAttribute(t,e,i){this.cssPriority?t.setAttribute(e,i):this._addInlineStyle(t,e,i)}_checkRtl(){return this._element&&wijmo_1.hasClass(this._element,"wj-rtl")}}_SvgRenderEngine.svgNS="http://www.w3.org/2000/svg";_SvgRenderEngine.xlinkNS="http://www.w3.org/1999/xlink";exports._SvgRenderEngine=_SvgRenderEngine;class _GradientColorUtil{static tryParse(t){if(_GradientColorUtil.parsedColor[t])return _GradientColorUtil.parsedColor[t];if(null==t||-1===t.indexOf("-")||-1!==t.indexOf("var("))return t;var e,i=t.replace(/\s+/g,"").split(/\-/g),s=i[0][0],r=!1,a=i[0].match(/\(\S+\)/);if(!a||0==a.length)return t;var n=a[0].replace(/[\(\\)]/g,"").split(/\,/g);if("l"===s||"L"===s){e={x1:"0",y1:"0",x2:"0",y2:"0",colors:[]};"l"===s&&(r=!0);["x1","y1","x2","y2"].forEach((t,i)=>{null!=n[i]&&(e[t]=r?100*+n[i]+"%":n[i]+"")})}else if("r"===s||"R"===s){e={cx:"0",cy:"0",r:"0",colors:[]};"r"===s&&(r=!0);["cx","cy","r","fx","fy","fr"].forEach((t,i)=>{null!=n[i]&&""!==n[i]&&(e[t]=r?100*+n[i]+"%":n[i]+"")})}r||(e.gradientUnits="userSpaceOnUse");_GradientColorUtil.parsedColor[t]=e;var h=i.length-1;i.forEach((t,i)=>{t.indexOf(")")>-1&&(t=t.match(/\)\S+/)[0].replace(")",""));var s=t.split(":"),a={color:"black"};null!=s[0]&&(a.color=s[0]);null!=s[1]?a.offset=r?100*+s[1]+"%":s[1]+"":a.offset=i/h*100+"%";null!=s[2]&&(a.opacity=s[2]);e.colors.push(a)});return e}}_GradientColorUtil.parsedColor={};class SvgRenderEngine extends _SvgRenderEngine{}exports.SvgRenderEngine=SvgRenderEngine;class Legend{constructor(t){this._position=Position.Right;this._title="";this._titleAlign="left";this._titlePadding=5;this._areas=new Array;this._sz=new wijmo_1.Size;this._colRowLens=[];this._orient=Orientation.Auto;this._scrollbar=!1;this._chart=t}get position(){return this._position}set position(t){if((t=wijmo_1.asEnum(t,Position))!=this._position){this._position=t;this._invalidate()}}get title(){return this._title}set title(t){if(t!=this._title){this._title=wijmo_1.asString(t,!1);this._invalidate()}}get titleAlign(){return this._titleAlign}set titleAlign(t){if(t!=this._titleAlign){var e=wijmo_1.asString(t,!1);this._titleAlign="right"===e?"right":"center"===e?"center":"left";this._invalidate()}}get orientation(){return this._orient}set orientation(t){if((t=wijmo_1.asEnum(t,Orientation))!=this._orient){this._orient=t;this._invalidate()}}get maxSize(){return this._maxSz}set maxSize(t){if(t!=this._maxSz){if(wijmo_1.isNumber(t))this._maxSz=t;else if(wijmo_1.isString(t)){let e=wijmo_1.asString(t);wijmo_1.assert(FlexChartBase._endsWith(e,"px")||FlexChartBase._endsWith(e,"%"),"number with unit (px or %) expected.");this._maxSz=e}else t&&wijmo_1.assert(!1,"number or string expected.");this._invalidate()}}get scrollbar(){return this._scrollbar}set scrollbar(t){if(t!=this._scrollbar){this._scrollbar=wijmo_1.asBoolean(t,!1);this._invalidate()}}_getDesiredSize(t,e,i,s){if(e==Position.None)return null;var r=this.orientation==Orientation.Auto?e==Position.Right||e==Position.Left:this.orientation==Orientation.Vertical,a=this._chart._getDesiredLegendSize(t,r,i,s);if(null!=a){if(this.title.length>0){var n=t.measureString(this.title,"wj-title","wj-legend");a.height+=n.height+this._titlePadding;n.width>a.width&&(a.width=n.width)}this._sz=a.clone();if(this.scrollbar&&a.height>s){r&&(a.width+=18);a.height=s}}return a}_getPosition(t,e){return this.position==Position.Auto?t>=e?Position.Right:Position.Bottom:this.position}_render(t,e,i,s,r){this._areas=[];var a=this.orientation==Orientation.Auto?i==Position.Right||i==Position.Left:this.orientation==Orientation.Vertical;t.fill="transparent";t.stroke=null;t.drawRect(e.x,e.y,s,r);if(this.title.length){let i=e.clone(),a=t.measureString(this.title,"wj-title`");i.y+=a.height;"right"===this.titleAlign?i.x=e.x+s-a.width:"center"===this.titleAlign&&(i.x=e.x+.5*(s-a.width));t.drawString(this.title,i,"wj-title");let n=a.height+this._titlePadding;e.y+=n;r-=n}let n=!1;this.scrollbar&&this._sz.height>r&&(n=!0);this._chart._renderLegend(t,e,this._areas,a,n?s-18:s,r);n&&this._addScrollbar(t,e,s,r,this._sz.height)}_hitTest(t){for(var e=this._areas,i=0;i<e.length;i++)if(e[i]&&FlexChartBase._contains(e[i],t))return i;return null}_addScrollbar(t,e,i,s,r){t.endGroup();const a=t.element,n=a.children.item(a.children.length-1);n.removeAttribute("clip-path");n.remove();Array.from(n.querySelectorAll("text,rect")).forEach(t=>{t.setAttribute("x",(+t.getAttribute("x")-e.x).toFixed(2));t.setAttribute("y",(+t.getAttribute("y")-e.y).toFixed(2))});Array.from(n.querySelectorAll("ellipse")).forEach(t=>{t.setAttribute("cx",(+t.getAttribute("cx")-e.x).toFixed(2));t.setAttribute("cy",(+t.getAttribute("cy")-e.y).toFixed(2))});const h=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");h.setAttribute("x",e.x.toFixed(2));h.setAttribute("y",e.y.toFixed(2));h.setAttribute("width",i.toFixed(2));h.setAttribute("height",s.toFixed(2));const l=document.createElement("div");l.setAttribute("style","height:100%;overflow-x:hidden;overflow-y:scroll;");const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width",i.toFixed(2));o.setAttribute("height",r.toFixed(2));o.appendChild(n);l.appendChild(o);h.appendChild(l);a.appendChild(h)}_invalidate(){this._chart&&this._chart.invalidate()}_getMaxSize(t){let e=this.maxSize;if(wijmo_1.isNumber(e)){let i=wijmo_1.asNumber(e,!0);if(i>0)return Math.min(i,t)}else{let i=wijmo_1.asString(e,!0);if(i)if(FlexChartBase._endsWith(i,"px")){let e=parseFloat(i.replace("px",""));if(e>0)return Math.min(e,t)}else if(FlexChartBase._endsWith(i,"%")){let e=parseFloat(i.replace("%",""));if(e>0)return t*Math.min(e,100)/100}}return.5*t}}exports.Legend=Legend;class DataPoint{constructor(t=0,e=0){this.x=t;this.y=e}}exports.DataPoint=DataPoint;class RenderEventArgs extends wijmo_1.CancelEventArgs{constructor(t){super();this._engine=t}get engine(){return this._engine}}exports.RenderEventArgs=RenderEventArgs;class SeriesRenderingEventArgs extends RenderEventArgs{constructor(t,e,i){super(t);this._index=e;this._count=i}get index(){return this._index}get count(){return this._count}}exports.SeriesRenderingEventArgs=SeriesRenderingEventArgs;!function(t){t[t.Png=0]="Png";t[t.Jpeg=1]="Jpeg";t[t.Svg=2]="Svg"}(ImageFormat=exports.ImageFormat||(exports.ImageFormat={}));!function(t){t[t.None=0]="None";t[t.Series=1]="Series";t[t.Point=2]="Point"}(SelectionMode=exports.SelectionMode||(exports.SelectionMode={}));!function(t){t[t.None=0]="None";t[t.Left=1]="Left";t[t.Top=2]="Top";t[t.Right=3]="Right";t[t.Bottom=4]="Bottom";t[t.Auto=5]="Auto"}(Position=exports.Position||(exports.Position={}));!function(t){t[t.Auto=0]="Auto";t[t.Vertical=1]="Vertical";t[t.Horizontal=2]="Horizontal"}(Orientation=exports.Orientation||(exports.Orientation={}));class FlexChartBase extends wijmo_1.Control{constructor(){super(...arguments);this._palette=null;this._selectionMode=SelectionMode.None;this._defPalette=Palettes.standard;this._notifyCurrentChanged=!0;this._legendHost=null;this._needBind=!1;this._skipLightClr=!1;this.rendering=new wijmo_1.Event;this.rendered=new wijmo_1.Event;this.itemsSourceChanging=new wijmo_1.Event;this.itemsSourceChanged=new wijmo_1.Event;this.selectionChanged=new wijmo_1.Event}get itemsSource(){return this._items}set itemsSource(t){if(this._items!=t){let e=new wijmo_1.CancelEventArgs;if(!this.onItemsSourceChanging(e))return;if(this._cv){this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._items=t;this._cv=wijmo_1.asCollectionView(t);if(null!=this._cv){this._cv.currentChanged.addHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)}this._clearCachedValues();this.onItemsSourceChanged(e);this._bindChart()}}get collectionView(){return this._cv}get palette(){return this._palette}set palette(t){if(t!=this._palette){this._palette=wijmo_1.asArray(t);this._skipLightClr=Palettes._isExtended(this._palette);this.invalidate()}}get plotMargin(){return this._plotMargin}set plotMargin(t){if(t!=this._plotMargin){this._plotMargin=t;this.invalidate()}}get legend(){return this._legend}set legend(t){if(t!=this._legend){this._legend=wijmo_1.asType(t,Legend);null!=this._legend&&(this._legend._chart=this)}}get header(){return this._header}set header(t){if(t!=this._header){this._header=wijmo_1.asString(t,!0);this.invalidate()}}get footer(){return this._footer}set footer(t){if(t!=this._footer){this._footer=wijmo_1.asString(t,!0);this.invalidate()}}get headerStyle(){return this._headerStyle}set headerStyle(t){if(t!=this._headerStyle){this._headerStyle=t;this.invalidate()}}get footerStyle(){return this._footerStyle}set footerStyle(t){if(t!=this._footerStyle){this._footerStyle=t;this.invalidate()}}get selectionMode(){return this._selectionMode}set selectionMode(t){if((t=wijmo_1.asEnum(t,SelectionMode))!=this._selectionMode){this._selectionMode=t;this.invalidate()}}get itemFormatter(){return this._itemFormatter}set itemFormatter(t){if(t!=this._itemFormatter){this._itemFormatter=wijmo_1.asFunction(t);this.invalidate()}}onRendering(t){this.rendering.raise(this,t)}onRendered(t){this.rendered.raise(this,t)}onItemsSourceChanging(t){this.itemsSourceChanging.raise(this,t);return!t.cancel}onItemsSourceChanged(t){this.itemsSourceChanged.raise(this,t)}saveImageToFile(t){var e,i,s,r;t&&0!==t.length&&-1!==t.indexOf(".")||(t="image.png");r=t.split(".");e=r[0];i=r[1].toLowerCase();s=ImageFormat[i[0].toUpperCase()+i.substring(1)];this.saveImageToDataUrl(s,t=>{ExportHelper.downloadImage(t,e,i)})}saveImageToDataUrl(t,e){var i=wijmo_1.asEnum(t,ImageFormat,!1),s=ImageFormat[i].toLowerCase();s&&s.length&&this._exportToImage(s,t=>{e.call(e,t)})}saveSvgToDataUrl(t,e=!0){this._exportToImage("svg",e=>{t.call(t,e)},{embedCss:e})}saveSvgToFile(t,e=!0){this.saveSvgToDataUrl(e=>{ExportHelper.downloadImage(e,t,"svg")},e)}_exportToImage(t,e,i=null){const s=this._currentRenderEngine.element;i&&!1===i.embedCss?ExportHelper.getDataUri2(s,this,i=>{this.prepareDataUri(s,t,i,e)}):ExportHelper.getDataUri(s,this,i=>{this.prepareDataUri(s,t,i,e)})}prepareDataUri(t,e,i,s){if("svg"===e)s.call(null,i);else{let r=new Image;r.onload=()=>{var i,a=document.createElement("canvas"),n=t.parentNode||t,h=wijmo_1.getElementRect(n);a.width=h.width;a.height=h.height;var l=a.getContext("2d");let o=this._bgColor(this.hostElement);this._isTransparent(o)&&(o="#ffffff");l.fillStyle=o;l.fillRect(0,0,h.width,h.height);var _=window.getComputedStyle(n,null).getPropertyValue("padding-left").replace("px",""),d=window.getComputedStyle(n,null).getPropertyValue("padding-top").replace("px","");l.drawImage(r,+_||0,+d||0);i=a.toDataURL("image/"+e);s.call(null,i);a=null};r.src=i}}refresh(t=!0){super.refresh(t);this.isUpdating||this._refreshChart()}onSelectionChanged(t){this.selectionChanged.raise(this,t)}onLostFocus(t){this._tooltip&&this._tooltip.isVisible&&!this.isTouching&&this._tooltip.hide();super.onLostFocus(t)}_cvCollectionChanged(t,e){this._clearCachedValues();this._bindChart()}_cvCurrentChanged(t,e){this._notifyCurrentChanged&&this._bindChart()}_bgColor(t){if(!t)return"transparent";let e=getComputedStyle(t).backgroundColor;return this._isTransparent(e)?this._bgColor(t.parentElement):e}_isTransparent(t){let e=new wijmo_1.Color(t);return 0==e.a&&0==e.b&&0==e.g&&0==e.r}_getColor(t){var e=this._defPalette;null!=this._palette&&this._palette.length>0&&(e=this._palette);return e[t%e.length]}_getColorLight(t){let e=this._getColor(t);this._skipLightClr||(e=this._getLightColor(e));return e}_getLightColor(t){var e=new wijmo_1.Color(t);if(null!=e&&-1===t.indexOf("-")){1==e.a&&-1==t.indexOf("rgba")&&-1==t.indexOf("hsla")&&(e.a*=.7);t=e.toString()}return t}_bindChart(){this._needBind=!0;this.invalidate()}_clearCachedValues(){}_renderEls(t,e,i=!0,s=null,r=!1){let a=e.width,n=e.height;if(0==a)return;(isNaN(a)||a<0)&&(a=FlexChartBase._WIDTH);(n<=0||isNaN(n))&&(n=FlexChartBase._HEIGHT);let h=a>0&&n>0;h&&t.setViewportSize(a,n);t.beginRender();t.cssPriority=!0;if(h){this._rectChart=new wijmo_1.Rect(0,0,a,n);this._prepareRender();if(s){let e=t.stroke,i=t.fill;t.fill=s;t.stroke=null;t.drawRect(0,0,a,n);t.fill=i;t.stroke=e}let e=new wijmo_1.Rect(0,0,a,n);this._chartRectId="chartRect"+(1e6*Math.random()).toFixed();t.addClipRect(e,this._chartRectId);this._renderHeader(t,e);this._renderFooter(t,e);this._renderLegends(t,e);this._renderChart(t,e,i)}t.endRender()}_render(t,e=!0,i=null){let s=this._getHostSize();if(this._h){let t=s.height-this._h;t>=4&&t<=6&&!1!==this._isPCUnit("height")&&(s.height=this._h)}this._h=s.height;this._renderEls(t,s,e,i)}_isPCUnit(t){let e=null,i=this.hostElement;if(i&&i.computedStyleMap){let s=i.computedStyleMap();if(s){let i=s.get(t);i&&(e="percent"==i.unit)}}return e}_renderHidden(t=null,e=null){let i=document.createElement("div");wijmo_1.addClass(i,this.hostElement.getAttribute("class")||"");i.style.visibility="hidden";let s=new _SvgRenderEngine(i);document.body.appendChild(i);if(!t){let e=this._getHostComputedStyle(),i=0,s=0;if(e){i=this._parsePx(e.width);s=this._parsePx(e.height);0==i&&(i=FlexChartBase._WIDTH);0==s&&(s=FlexChartBase._HEIGHT);i-=this._parsePx(e.paddingLeft);i-=this._parsePx(e.paddingRight);s-=this._parsePx(e.paddingTop);s-=this._parsePx(e.paddingBottom);i-=this._parsePx(e.borderLeftWidth);i-=this._parsePx(e.borderRightWidth);s-=this._parsePx(e.borderTopWidth);s-=this._parsePx(e.borderBottomWidth)}0==i&&(i=FlexChartBase._WIDTH);0==s&&(s=FlexChartBase._HEIGHT);t=new wijmo_1.Size(i,s)}this._renderEls(s,t,!0,e,!0);wijmo_1.removeChild(i);return s.element}_renderHeader(t,e){t.startGroup(FlexChartBase._CSS_HEADER,this._chartRectId);e=this._drawTitle(t,e,this.header,this.headerStyle,!1);t.endGroup()}_renderFooter(t,e){t.startGroup(FlexChartBase._CSS_FOOTER,this._chartRectId);e=this._drawTitle(t,e,this.footer,this.footerStyle,!0);t.endGroup()}_renderLegends(t,e){var i,s,r=this.legend,a=e.width,n=e.height,h=r._getPosition(a,n);let l=a,o=n;h==Position.Left||h==Position.Right?l=this._getLegendSize(a,l):o=this._getLegendSize(n,o);if(!(i=r._getDesiredSize(t,h,l,o))){this._legendHost=null;this._rectLegend=null;return}h==Position.Left||h==Position.Right?i.width=this._getLegendSize(a,i.width):i.height=this._getLegendSize(n,i.height);i.height>e.height&&(i.height=e.height);switch(h){case Position.Right:a-=i.width;s=new wijmo_1.Point(a,e.top+.5*(n-i.height));break;case Position.Left:e.left+=i.width;a-=i.width;s=new wijmo_1.Point(0,e.top+.5*(n-i.height));break;case Position.Top:n-=i.height;s=new wijmo_1.Point(.5*(a-i.width),e.top);e.top+=i.height;break;case Position.Bottom:n-=i.height;s=new wijmo_1.Point(.5*(a-i.width),e.top+n)}e.width=a;e.height=n;this._rectLegend=new wijmo_1.Rect(s.x,s.y,i.width,i.height);let _="legRect"+(1e6*Math.random()).toFixed();t.addClipRect(this._rectLegend,_);this._legendHost=t.startGroup(FlexChartBase._CSS_LEGEND,_);this.legend._render(t,s,h,i.width,i.height);t.endGroup()}_prepareRender(){}_renderChart(t,e,i){}_performBind(){}_getDesiredLegendSize(t,e,i,s){return null}_renderLegend(t,e,i,s,r,a){}_getHitTestItem(t){return null}_getHitTestValue(t,e){return null}_getHitTestLabel(t){return null}_refreshChart(){if(this._needBind){this._needBind=!1;this._performBind()}this.hostElement&&this._render(this._currentRenderEngine)}_drawTitle(t,e,i,s,r){var a=FlexChartBase._CSS_TITLE,n=r?FlexChartBase._CSS_FOOTER:FlexChartBase._CSS_HEADER,h=null;r?this._rectFooter=null:this._rectHeader=null;if(null!=i){var l=null,o=null,_=null,d=null;if(s){s.fontSize&&(l=s.fontSize);s.foreground&&(o=s.foreground);s.fill&&(o=s.fill);s.fontFamily&&(_=s.fontFamily);s.halign&&(d=s.halign)}t.fontSize=l;t.fontFamily=_;h=t.measureString(i,a,n,s);e.height-=h.height;o||(o=FlexChartBase._FG);t.textFill=o;if(r){"left"==d?FlexChartBase._renderText(t,i,new wijmo_1.Point(e.left,e.bottom),0,0,a,n,s):"right"==d?FlexChartBase._renderText(t,i,new wijmo_1.Point(e.left+e.width,e.bottom),2,0,a,n,s):FlexChartBase._renderText(t,i,new wijmo_1.Point(e.left+.5*e.width,e.bottom),1,0,a,n,s);this._rectFooter=new wijmo_1.Rect(e.left,e.bottom,e.width,h.height)}else{this._rectHeader=new wijmo_1.Rect(e.left,e.top,e.width,h.height);e.top+=h.height;"left"==d?FlexChartBase._renderText(t,i,new wijmo_1.Point(e.left,0),0,0,a,n,s):"right"==d?FlexChartBase._renderText(t,i,new wijmo_1.Point(e.left+e.width,0),2,0,a,n,s):FlexChartBase._renderText(t,i,new wijmo_1.Point(e.left+.5*e.width,0),1,0,a,n,s)}t.textFill=null;t.fontSize=null;t.fontFamily=null}return e}pageToControl(t,e){return this._toControl(t,e)}_toControl(t,e){wijmo_1.isNumber(t)&&wijmo_1.isNumber(e)?t=new wijmo_1.Point(t,e):t instanceof MouseEvent&&(t=wijmo_1.mouseToPage(t));wijmo_1.asType(t,wijmo_1.Point);var i=t.clone(),s=this._getHostOffset();i.x-=s.x;i.y-=s.y;let r=this._currentRenderEngine?this._currentRenderEngine.element:null;if(null!=r){let t=r.getBoundingClientRect(),e=parseFloat(r.getAttribute("width")),s=parseFloat(r.getAttribute("height"));t.width!=e&&(i.x*=e/t.width);t.height!=s&&(i.y*=s/t.height)}var a=this._getHostComputedStyle();if(a){var n=parseInt(a.paddingLeft.replace("px",""));n&&!isNaN(n)&&(i.x-=n);var h=parseInt(a.paddingTop.replace("px",""));h&&!isNaN(h)&&(i.y-=h)}return i}_highlightItems(t,e,i){if(i)for(var s=0;s<t.length;s++)wijmo_1.addClass(t[s],e);else for(s=0;s<t.length;s++)wijmo_1.removeClass(t[s],e)}_parseMargin(t){var e={};if(wijmo_1.isNumber(t)&&!isNaN(t))e.top=e.bottom=e.left=e.right=wijmo_1.asNumber(t);else if(wijmo_1.isString(t)){var i=wijmo_1.asString(t).split(" ",4),s=NaN,r=NaN,a=NaN,n=NaN;if(i){if(4==i.length){s=parseFloat(i[0]);n=parseFloat(i[1]);r=parseFloat(i[2]);a=parseFloat(i[3])}else if(2==i.length){s=r=parseFloat(i[0]);a=n=parseFloat(i[1])}else 1==i.length&&(s=r=a=n=parseFloat(i[1]));isNaN(s)||(e.top=s);isNaN(r)||(e.bottom=r);isNaN(a)||(e.left=a);isNaN(n)||(e.right=n)}}return e}_showToolTip(t,e){var i=this,s=this._tooltip.showDelay;i._clearTimeouts();if(!i.isDisabled){t||i._tooltip.hide();if(s>0)i._toShow=setTimeout((function(){i._tooltip.show(i.hostElement,t,e);i._tooltip.hideDelay>0&&(i._toHide=setTimeout((function(){i._tooltip.hide()}),i._tooltip.hideDelay))}),s);else{i._tooltip.show(i.hostElement,t,e);i._tooltip.hideDelay>0&&(i._toHide=setTimeout((function(){i._tooltip.hide()}),i._tooltip.hideDelay))}}}_hideToolTip(){this._clearTimeouts();this._tooltip.hide()}_clearTimeouts(){if(this._toShow){clearTimeout(this._toShow);this._toShow=null}if(this._toHide){clearTimeout(this._toHide);this._toHide=null}}_getHostOffset(){var t=wijmo_1.getElementRect(this.hostElement);return new wijmo_1.Point(t.left,t.top)}_getHostSize(){var t=new wijmo_1.Size,e=this.hostElement,i=this._getHostComputedStyle(),s=e.offsetWidth,r=e.offsetHeight;if(i){s-=this._parsePx(i.paddingLeft);s-=this._parsePx(i.paddingRight);r-=this._parsePx(i.paddingTop);r-=this._parsePx(i.paddingBottom);s-=this._parsePx(i.borderLeftWidth);s-=this._parsePx(i.borderRightWidth);r-=this._parsePx(i.borderTopWidth);r-=this._parsePx(i.borderBottomWidth);t.width=s;t.height=r}return t}_parsePx(t){let e=parseFloat(t.replace("px",""));return isNaN(e)?0:e}_getHostComputedStyle(){var t=this.hostElement;return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(this.hostElement):null}_find(t,e){for(var i=[],s=0;s<t.childElementCount;s++){var r=t.childNodes.item(s);if(e.indexOf(r.nodeName)>=0)i.push(r);else{var a=this._find(r,e);if(a.length>0)for(var n=0;n<a.length;n++)i.push(a[n])}}return i}_getLegendSize(t,e){return Math.min(e,this.legend._getMaxSize(t))}static _contains(t,e){return!(!t||!e)&&(e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom)}static _intersects(t,e){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)}static _toOADate(t){return t.valueOf()}static _fromOADate(t){return new Date(t)}static _renderText(t,e,i,s,r,a,n,h,l){var o=t.measureString(e,a,n,h),_=i.x,d=i.y;switch(s){case 1:_-=.5*o.width;break;case 2:_-=o.width}switch(r){case 1:d+=.5*o.height;break;case 0:d+=o.height}var c=new wijmo_1.Rect(_,d-o.height,o.width,o.height);if(l){if(l(c)){t.drawString(e,new wijmo_1.Point(_,d),a,h);return c}return null}t.drawString(e,new wijmo_1.Point(_,d),a,h);return c}static _renderRotatedText(t,e,i,s,r,a,n,h,l,o){var _=t.measureString(e,h,l,o),d=i.x,c=i.y;switch(s){case 1:d-=.5*_.width;break;case 2:d-=_.width}switch(r){case 1:c+=.5*_.height;break;case 0:c+=_.height}return t.drawStringRotated(e,new wijmo_1.Point(d,c),a,n,h,o)}static _endsWith(t,e){if(t&&e){let i=t.length-e.length;return i>=0&&t.indexOf(e,i)===i}return!1}}FlexChartBase._WIDTH=300;FlexChartBase._HEIGHT=200;FlexChartBase._SELECTION_THRESHOLD=15;FlexChartBase._CSS_LEGEND="wj-legend";FlexChartBase._CSS_HEADER="wj-header";FlexChartBase._CSS_FOOTER="wj-footer";FlexChartBase._CSS_TITLE="wj-title";FlexChartBase._CSS_LABEL="wj-label";FlexChartBase._CSS_SELECTION="wj-state-selected";FlexChartBase._CSS_PLOT_AREA="wj-plot-area";FlexChartBase._FG="#666";FlexChartBase._epoch=new Date(1899,11,30).getTime();FlexChartBase._msPerDay=864e5;exports.FlexChartBase=FlexChartBase;class _KeyWords{constructor(){this._keys={};this._keys.seriesName=null;this._keys.pointIndex=null;this._keys.x=null;this._keys.y=null;this._keys.value=null;this._keys.name=null}replace(t,e){var i=this;return wijmo_1.format(t,{},(function(t,s,r,a){return i.getValue(s,e,r)}))}getValue(t,e,i){switch(t){case"seriesName":return e.series?e.series.name:"";case"pointIndex":return null!=e.pointIndex?e.pointIndex.toFixed():"";case"x":return i?wijmo_1.Globalize.format(e.x,i):e._xfmt;case"y":return i?wijmo_1.Globalize.format(e.y,i):e._yfmt;case"value":return i?wijmo_1.Globalize.format(e.value,i):e._getValueFmt();case"name":return e.name}if(e.item){0==t.indexOf("item.")&&(t=t.substr(5));let s=e.item[t];if(!wijmo_1.isUndefined(s))return i?wijmo_1.Globalize.format(s,i):s}return""}}exports._KeyWords=_KeyWords;class ExportHelper{static downloadImage(t,e,i){var s=document.createElement("a"),r="image/"+i;if(navigator.msSaveOrOpenBlob){t=t.substring(t.indexOf(",")+1);var a,n,h,l=atob(t),o=[];for(a=0;a<l.length;a+=512){n=l.slice(a,a+512);for(var _=new Array(n.length),d=0;d<n.length;d++)_[d]=n.charCodeAt(d);var c=new Uint8Array(_);o.push(c)}h=new Blob(o,{type:r});navigator.msSaveOrOpenBlob(h,e+"."+i)}else{s.download=e+"."+i;s.href=t;document.body.appendChild(s);s.addEventListener("click",(function(t){wijmo_1.removeChild(s)}));s.click()}}static getDataUri(t,e,i){var s,r,a,n,h,l,o,_,d,c,u=document.createElement("div"),g=t.cloneNode(!0);let m=!1;if("svg"==t.tagName){r=(s=wijmo_1.getElementRect(t.parentNode||t)).width||0;a=s.height||0;0==r&&(m=!0);n=t.viewBox.baseVal&&0!==t.viewBox.baseVal.width?t.viewBox.baseVal.width:r;h=t.viewBox.baseVal&&0!==t.viewBox.baseVal.height?t.viewBox.baseVal.height:a}else{r=(l=t.getBBox()).x+l.width;a=l.y+l.height;g.setAttribute("transform",g.getAttribute("transform").replace(/translate\(.*?\)/,""));n=r;h=a;(_=document.createElementNS("http://www.w3.org/2000/svg","svg")).appendChild(g);g=_}if(m){let t=e._renderHidden(),i=e._getHostComputedStyle(),s=0,l=0;if(i){s=e._parsePx(i.width);l=e._parsePx(i.height)}0==s&&(s=FlexChartBase._WIDTH);0==l&&(l=FlexChartBase._HEIGHT);n=r=s;h=a=l;g=t.cloneNode(!0)}g.setAttribute("version","1.1");g.setAttributeNS(ExportHelper.xmlns,"xmlns","http://www.w3.org/2000/svg");g.setAttributeNS(ExportHelper.xmlns,"xmlns:xlink","http://www.w3.org/1999/xlink");g.setAttribute("width",r);g.setAttribute("height",a);g.setAttribute("viewBox","0 0 "+n+" "+h);wijmo_1.addClass(g,t.parentNode&&t.parentNode.getAttribute("class")||"");u.appendChild(g);o=ExportHelper.getStyles(t);o+=`.wj-flexchart{margin:0px;padding:0px;border:none;width:${r}px;height:${a}px;}\n`;(d=document.createElement("style")).setAttribute("type","text/css");d.innerHTML="<![CDATA[\n"+o+"\n]]>";(c=document.createElementNS("http://www.w3.org/2000/svg","defs")).appendChild(d);g.insertBefore(c,g.firstChild);wijmo_1.isIE()||g.querySelectorAll("foreignObject").forEach(t=>{g.removeChild(t)});let f=e._currentRenderEngine.canvas;if(f){let t=document.createElementNS("http://www.w3.org/2000/svg","image");t.setAttribute("width",f.width);t.setAttribute("height",f.height);t.setAttribute("href",f.toDataURL());g.insertBefore(t,g.firstChild);e.invalidate()}this.convertImagesToDataUrl(g,()=>{const t="data:image/svg+xml;base64,"+window.btoa(window.unescape(encodeURIComponent(ExportHelper.doctype+u.innerHTML)));i.call(null,t)})}static convertImagesToDataUrl(t,e){let i=t.querySelectorAll("image");if(0===i.length){e();return}let s=Array.from(i);Array.from(i).forEach(t=>{const i=new Image;i.onload=()=>{const r=document.createElement("canvas");r.width=+t.getAttribute("width");r.height=+t.getAttribute("height");const a=r.getContext("2d");let n=i.width/i.height;n<r.width/r.height?a.drawImage(i,0,0,i.width,i.height,.5*(r.width-n*r.height),0,n*r.height,r.height):a.drawImage(i,0,0,i.width,i.height,0,.5*(r.height-r.width/n),r.width,r.width/n);t.setAttribute("href",r.toDataURL());i.remove();s.splice(s.indexOf(t),1);0==s.length&&e()};i.src=t.getAttribute("href")})}static getDataUri2(t,e,i){var s,r,a,n,h,l,o,_=document.createElement("div"),d=this.cloneWithComputedStyles(t);let c=!1;if("svg"==t.tagName){r=(s=wijmo_1.getElementRect(t.parentNode||t)).width||0;a=s.height||0;0==r&&(c=!0);n=t.viewBox.baseVal&&0!==t.viewBox.baseVal.width?t.viewBox.baseVal.width:r;h=t.viewBox.baseVal&&0!==t.viewBox.baseVal.height?t.viewBox.baseVal.height:a}else{r=(l=t.getBBox()).x+l.width;a=l.y+l.height;d.setAttribute("transform",d.getAttribute("transform").replace(/translate\(.*?\)/,""));n=r;h=a;(o=document.createElementNS("http://www.w3.org/2000/svg","svg")).appendChild(d);d=o}if(c){let t=e._renderHidden(),i=e._getHostComputedStyle(),s=0,l=0;if(i){s=e._parsePx(i.width);l=e._parsePx(i.height)}0==s&&(s=FlexChartBase._WIDTH);0==l&&(l=FlexChartBase._HEIGHT);n=r=s;h=a=l;d=this.cloneWithComputedStyles(t)}d.setAttribute("version","1.1");d.setAttributeNS(ExportHelper.xmlns,"xmlns","http://www.w3.org/2000/svg");d.setAttributeNS(ExportHelper.xmlns,"xmlns:xlink","http://www.w3.org/1999/xlink");d.setAttribute("width",r);d.setAttribute("height",a);d.setAttribute("viewBox","0 0 "+n+" "+h);_.appendChild(d);let u=e._currentRenderEngine.canvas;if(u){let t=document.createElementNS("http://www.w3.org/2000/svg","image");t.setAttribute("width",u.width);t.setAttribute("height",u.height);t.setAttribute("href",u.toDataURL());d.insertBefore(t,d.firstChild);e.invalidate()}this.convertImagesToDataUrl(d,()=>{const t="data:image/svg+xml;base64,"+window.btoa(window.unescape(encodeURIComponent(ExportHelper.doctype+_.innerHTML)));i.call(null,t)})}static computeAttributes(t,e,i){let s=getComputedStyle(t);i.forEach(t=>{let i=s.getPropertyValue(t);i&&i.length>0&&e.setAttribute(t,i)})}static cloneWithComputedStyles(t){let e=t.cloneNode();Array.from(t.childNodes).forEach(t=>{let i=this.cloneWithComputedStyles(t);1===t.nodeType&&("text"===t.nodeName?this.computeAttributes(t,i,this.textAttrs):"line"===t.nodeName&&this.computeAttributes(t,i,this.lineAttrs));e.appendChild(i)});return e}static getStyles(t){var e="",i=document.styleSheets;if(null==i||0===i.length)return null;[].forEach.call(i,i=>{var s;try{if(null==i.cssRules||0===i.cssRules.length)return!0}catch(t){if("SecurityError"==t.name){console.log("SecurityError. Can't read: "+i.href);return!0}}s=i.cssRules;[].forEach.call(s,i=>{var s,r=i.style;if(null==r)return!0;let a=i.selectorText;if(wijmo_1.isIE()&&a){const t=a.match(/\[(.*?)\]/g);t&&t.forEach(t=>a=a.replace(t,t.replace(":","\\:")))}try{s=".wj-flexchart"==a||t.querySelector(a)}catch(t){console.warn('Invalid CSS selector "'+i.selectorText+'"',t)}s?e+=i.selectorText+" { "+r.cssText+" }\n":i.cssText.match(/^@font-face/)&&(e+=i.cssText+"\n")})});const s=getComputedStyle(t),r=s?s.getPropertyValue("font"):null;r&&(e+=`.wj-flexchart{font:${r}}\n`);return e}}ExportHelper.doctype='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';ExportHelper.xmlns="http://www.w3.org/2000/xmlns/";ExportHelper.textAttrs=["font-family","font-size","font-style","font-weight","fill"];ExportHelper.lineAttrs=["stroke","stroke-width","stroke-dasharray"];class ChartTooltip extends wijmo_1.Tooltip{constructor(){super();this._content="<b>{seriesName}</b><br/>{x} {y}";this._threshold=15}get content(){return this._content}set content(t){t!=this._content&&(this._content=t)}get threshold(){return this._threshold}set threshold(t){t!=this._threshold&&(this._threshold=wijmo_1.asNumber(t))}show(t,e,i){super.show(t,e,i);let s=ChartTooltip._eTip;s&&s.style&&(s.style.pointerEvents="none")}}exports.ChartTooltip=ChartTooltip;!function(t){t[t.Column=0]="Column";t[t.Bar=1]="Bar";t[t.Scatter=2]="Scatter";t[t.Line=3]="Line";t[t.LineSymbols=4]="LineSymbols";t[t.Area=5]="Area";t[t.Bubble=6]="Bubble";t[t.Candlestick=7]="Candlestick";t[t.HighLowOpenClose=8]="HighLowOpenClose";t[t.Spline=9]="Spline";t[t.SplineSymbols=10]="SplineSymbols";t[t.SplineArea=11]="SplineArea";t[t.Funnel=12]="Funnel";t[t.Step=13]="Step";t[t.StepSymbols=14]="StepSymbols";t[t.StepArea=15]="StepArea"}(ChartType=exports.ChartType||(exports.ChartType={}));!function(t){t[t.None=0]="None";t[t.Stacked=1]="Stacked";t[t.Stacked100pc=2]="Stacked100pc"}(Stacking=exports.Stacking||(exports.Stacking={}));class FlexChartCore extends FlexChartBase{constructor(t,e){super(t,null,!0);this._series=new wijmo_1.ObservableArray;this._axes=new AxisCollection;this._pareas=new PlotAreaCollection;this._interpolateNulls=!1;this._legendToggle=!1;this._symbolSize=10;this._dataInfo=new _DataInfo;this.__barPlotter=null;this.__linePlotter=null;this.__areaPlotter=null;this.__bubblePlotter=null;this.__financePlotter=null;this.__funnelPlotter=null;this._plotters=[];this._rotated=!1;this._stacking=Stacking.None;this._xlabels=[];this._xvals=[];this._lblAreas=[];this._colRowLens=[];this._selectedEls=[];this._markers=[];this._bindingSeparator=",";this.seriesVisibilityChanged=new wijmo_1.Event;this.applyTemplate("wj-control wj-flexchart",null,null);var i=this;i._series.collectionChanged.addHandler((function(){for(var t=i._series,e=0;e<t.length;e++){var s=wijmo_1.tryCast(t[e],SeriesBase);if(!s)throw"chartSeries array must contain SeriesBase objects.";s._chart=i;if(s.axisX&&null==s.axisX._chart){s.axisX._chart=i;i.axes.push(s.axisX)}if(s.axisY&&null==s.axisY._chart){s.axisY._chart=i;i.axes.push(s.axisY)}}i.invalidate()}));this._currentRenderEngine=new _SvgRenderEngine(this.hostElement);this._hitTester=new _HitTester(this);this._legend=new Legend(this);this._tooltip=new ChartTooltip;this._tooltip.showDelay=0;this._lbl=new DataLabel;this._lbl._chart=this;this._initAxes();i._axes.collectionChanged.addHandler((function(){for(var t=i._axes,e=0;e<t.length;e++){var s=wijmo_1.tryCast(t[e],Axis);if(!s)throw"axes array must contain Axis objects.";s._chart=i}i.invalidate()}));i._pareas.collectionChanged.addHandler((function(){for(var t=i._pareas,e=0;e<t.length;e++){var s=wijmo_1.tryCast(t[e],PlotArea);if(!s)throw"plotAreas array must contain PlotArea objects.";s._chart=i}i.invalidate()}));this._keywords=new _KeyWords;this.hostElement.addEventListener("click",(function(t){var e=i._tooltip;e.content&&i.isTouching&&i._updateTooltip(e,t)}));this.hostElement.addEventListener("mousemove",(function(t){var e=i._tooltip;e.content&&!i.isTouching&&i._updateTooltip(e,t)}));this.hostElement.addEventListener("mouseleave",(function(t){i._hideToolTip()}));this.hostElement.addEventListener("click",(function(t){if(i.selectionMode!=SelectionMode.None){var e=i._hitTestData(t),s=FlexChartCore._SELECTION_THRESHOLD;i.tooltip&&i.tooltip.threshold&&(s=i.tooltip.threshold);e.distance<=s&&e.series?i._select(e.series,e.pointIndex):i.selectionMode==SelectionMode.Series&&(e=i.hitTest(t)).chartElement==ChartElement.Legend&&e.series?i._select(e.series,null):i._select(null,null)}if(!0===i.legendToggle&&(e=i.hitTest(t)).chartElement==ChartElement.Legend&&e.series){e.series.visibility==SeriesVisibility.Legend?e.series.visibility=SeriesVisibility.Visible:e.series.visibility==SeriesVisibility.Visible&&(e.series.visibility=SeriesVisibility.Legend);i.focus()}}));this.deferUpdate(()=>this.initialize(e))}initialize(t){if(t&&t.renderEngine){let t=wijmo_1.asType(this._currentRenderEngine,_SvgRenderEngine,!0);t&&t.detach();this._currentRenderEngine=null}super.initialize(t)}_initAxes(){this._axisX=new Axis(Position.Bottom);this._axisY=new Axis(Position.Left);this._axisX.majorGrid=!1;this._axisX.name="axisX";this._axisY.majorGrid=!0;this._axisY.majorTickMarks=TickMark.None;this._axisY.name="axisY";this._axisX._chart=this;this._axisY._chart=this;this._axes.push(this._axisX);this._axes.push(this._axisY)}get series(){return this._series}get axes(){return this._axes}get axisX(){return this._axisX}set axisX(t){if(t!=this._axisX){var e=this._axisX=wijmo_1.asType(t,Axis);this.beginUpdate();if(e){void 0===e.majorGrid&&(e.majorGrid=!1);void 0===e.name&&(e.name="axisX");null==e.position&&(e.position=Position.Bottom);e._axisType=AxisType.X;e._chart=this}this.endUpdate()}}get axisY(){return this._axisY}set axisY(t){if(t!=this._axisY){var e=this._axisY=wijmo_1.asType(t,Axis);this.beginUpdate();if(e){void 0===e.majorGrid&&(e.majorGrid=!0);void 0===e.name&&(e.name="axisY");void 0===e.majorTickMarks&&(e.majorTickMarks=TickMark.None);null==e.position&&(e.position=Position.Left);e._axisType=AxisType.Y;e._chart=this}this.endUpdate()}}get plotAreas(){return this._pareas}get binding(){return this._binding}set binding(t){if(t!=this._binding){this._binding=wijmo_1.asString(t,!0);this.invalidate()}}get bindingX(){return this._bindingX}set bindingX(t){if(t!=this._bindingX){this._bindingX=wijmo_1.asString(t,!0);this._bindChart()}}get symbolSize(){return this._symbolSize}set symbolSize(t){if(t!=this._symbolSize){this._symbolSize=wijmo_1.asNumber(t,!1,!0);this.invalidate()}}get interpolateNulls(){return this._interpolateNulls}set interpolateNulls(t){if(t!=this._interpolateNulls){this._interpolateNulls=wijmo_1.asBoolean(t);this.invalidate()}}get legendToggle(){return this._legendToggle}set legendToggle(t){t!=this._legendToggle&&(this._legendToggle=wijmo_1.asBoolean(t))}get tooltip(){return this._tooltip}get dataLabel(){return this._lbl}set dataLabel(t){if(t!=this._lbl){this._lbl=wijmo_1.asType(t,DataLabel);this._lbl&&(this._lbl._chart=this)}}get selection(){return this._selection}set selection(t){if(t!=this._selection){this._selection=wijmo_1.asType(t,SeriesBase,!0);this.invalidate()}}get renderEngine(){return this._currentRenderEngine}set renderEngine(t){if(t!=this._currentRenderEngine){let e=wijmo_1.asType(this._currentRenderEngine,_SvgRenderEngine,!0);e&&e.detach();this._currentRenderEngine=t;let i=wijmo_1.asType(this._currentRenderEngine,_SvgRenderEngine,!0);i&&i.attach(this.hostElement);this.refresh()}}onSeriesVisibilityChanged(t){this.seriesVisibilityChanged.raise(this,t)}hitTest(t,e){var i=this._toControl(t,e),s=new HitTestInfo(this,i),r=null;if(FlexChartCore._contains(this._rectHeader,i))s._chartElement=ChartElement.Header;else if(FlexChartCore._contains(this._rectFooter,i))s._chartElement=ChartElement.Footer;else if(FlexChartCore._contains(this._rectLegend,i)){s._chartElement=ChartElement.Legend;null!==(r=this.legend._hitTest(i))&&r>=0&&r<this.series.length&&s._setData(this.series[r])}else if(FlexChartCore._contains(this._rectChart,i)){var a=this._hitTestLabels(i);if(a){s._chartElement=ChartElement.DataLabel;s._dist=0;s._setDataPoint(a.tag)}else{for(var n=this._hitTester.hitTest(i),h=null,l=null,o=this.series.length-1;o>=0;o--)if(this.series[o].hitTest!==Series.prototype.hitTest){var _=this.series[o].hitTest(t);if(_){if(!h||_.distance<h.distance){h=_;l=o}if(0===_.distance)break}}if(n&&n.area)if(h&&h.distance<n.distance)s=h;else if(h&&h.distance==n.distance&&l>n.area.tag.seriesIndex)s=h;else{s._setDataPoint(n.area.tag);s._dist=n.distance}else h&&(s=h);let e=!1;this.axes.some(t=>{if(FlexChartCore._contains(t._axrect,i)){let r;if(t.axisType===AxisType.X){s._chartElement=ChartElement.AxisX;r=t._hitTest(i)}else{s._chartElement=ChartElement.AxisY;r=t._hitTest(i)}r?s._setName(r.label):s._setName("");e=!0;return!0}});e||(FlexChartCore._contains(this._plotRect,i)?s._chartElement=ChartElement.PlotArea:FlexChartCore._contains(this._rectChart,i)&&(s._chartElement=ChartElement.ChartArea))}}else s._chartElement=ChartElement.None;return s}pointToData(t,e){wijmo_1.isNumber(t)&&wijmo_1.isNumber(e)&&(t=new wijmo_1.Point(t,e));if(t instanceof MouseEvent){t=new wijmo_1.Point(t.pageX,t.pageY);t=this._toControl(t)}else t=t.clone();t.x=this.axisX.convertBack(t.x);t.y=this.axisY.convertBack(t.y);return t}dataToPoint(t,e){wijmo_1.isNumber(t)&&wijmo_1.isNumber(e)&&(t=new wijmo_1.Point(t,e));wijmo_1.asType(t,wijmo_1.Point);var i=t.clone();i.x=this.axisX.convert(i.x);i.y=this.axisY.convert(i.y);return i}dispose(){this._markers.forEach(t=>t.remove());this._markers=[];super.dispose()}_copy(t,e){if("series"==t){this.series.clear();for(var i=wijmo_1.asArray(e),s=0;s<i.length;s++){var r=this._createSeries();wijmo_1.copy(r,i[s]);this.series.push(r)}return!0}return!1}_createSeries(){return new Series}_clearCachedValues(){for(var t=0;t<this._series.length;t++){var e=this._series[t];null==e.itemsSource&&e._clearValues()}}_performBind(){this._xDataType=null;this._xlabels.splice(0);this._xvals.splice(0);if(this._cv){var t=this._cv.items;if(t){var e=t.length;let a=this.bindingX?new wijmo_1.Binding(this.bindingX):null;for(var i=0;i<e;i++){var s=t[i];if(a){var r=a.getValue(s);if(wijmo_1.isNumber(r)){this._xvals.push(wijmo_1.asNumber(r));this._xDataType=wijmo_1.DataType.Number}else if(wijmo_1.isDate(r)){this._xvals.push(wijmo_1.asDate(r).valueOf());this._xDataType=wijmo_1.DataType.Date}this._xlabels.push(r)}}this._xvals.length==e?this._xlabels.splice(0):this._xvals.splice(0)}}}_hitTestSeries(t,e){var i=this._toControl(t),s=new HitTestInfo(this,i),r=this._hitTester.hitTestSeries(i,e);if(r&&r.area){s._setDataPoint(r.area.tag);s._chartElement=ChartElement.PlotArea;s._dist=r.distance}return s}_hitTestData(t){var e=this._toControl(t),i=new HitTestInfo(this,e),s=this._hitTester.hitTest(e,!0);if(s&&s.area){i._setDataPoint(s.area.tag);i._dist=s.distance}return i}_hitTestLabels(t){for(var e=null,i=this._lblAreas.length,s=0;s<i;s++)if(this._lblAreas[s].contains(t)){e=this._lblAreas[s];break}return e}static _dist2(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}static _dist(t,e,i){return Math.sqrt(FlexChartCore._distToSegmentSquared(t,e,i))}static _distToSegmentSquared(t,e,i){var s=FlexChartCore._dist2(e,i);if(0==s)return FlexChartCore._dist2(t,e);var r=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/s;return r<0?FlexChartCore._dist2(t,e):r>1?FlexChartCore._dist2(t,i):FlexChartCore._dist2(t,new wijmo_1.Point(e.x+r*(i.x-e.x),e.y+r*(i.y-e.y)))}_isRotated(){return this._getChartType()==ChartType.Bar?!this._rotated:this._rotated}_getChartType(){return null}_prepareRender(){this._hitTester.clear()}_renderChart(t,e,i){var s=this._rectChart.clone(),r=new wijmo_1.Size(s.width,s.height);e.width,e.height;this._selectedEls.length=0;(f=this._getPlotter(null)).stacking=this._stacking;if(this._curPlotter!=f){this._curPlotter&&this._curPlotter.unload();this._curPlotter=f}f.load();var a=this._isRotated();this._dataInfo.analyse(this._series,a,f.stacking,this._xvals.length>0?this._xvals:null,this.axisX._getLogBase()>0,this.axisY._getLogBase()>0);var n=f.adjustLimits(this._dataInfo,e.clone());if(a){var h=this._dataInfo.getDataTypeX();h||(h=this._xDataType);this.axisX._updateActualLimits(this._dataInfo.getDataTypeY(),n.left,n.right);this.axisY._updateActualLimits(h,n.top,n.bottom,this._xlabels,this._xvals)}else{var l=this._dataInfo.getDataTypeX();l||(l=this._xDataType);this.axisX._updateActualLimits(l,n.left,n.right,this._xlabels,this._xvals);this.axisY._updateActualLimits(this._dataInfo.getDataTypeY(),n.top,n.bottom)}var o=this._getAxes();this._updateAuxAxes(o,a);this._layout(e,r,t);t.startGroup(FlexChartCore._CSS_PLOT_AREA);t.fill="transparent";t.stroke=null;if(this.plotAreas.length>0)for(var _=0;_<this.plotAreas.length;_++){this.plotAreas[_]._render(t)}else{var d=this._plotRect;t.drawRect(d.left,d.top,d.width,d.height)}t.endGroup();var c=this._series.length;this._clearPlotters();var u={};for(_=0;_<c;_++){var g=this._series[_];if(((v=g.visibility)==SeriesVisibility.Visible||v==SeriesVisibility.Plot)&&g.getValues(0)){var m=g._getAxisY(),f=this._getPlotter(g);if(!m||m==this.axisY||f instanceof _BarPlotter)f.seriesCount++;else{var p=m._uniqueId;u[p]?u[p].count+=1:u[p]={count:1,index:0}}}}this.onRendering(new RenderEventArgs(t));if(this._getChartType()!==ChartType.Funnel)for(_=0;_<o.length;_++){var x=o[_];w=x.axisType==AxisType.X?t.startGroup(FlexChartCore._CSS_AXIS_X,this._chartRectId):t.startGroup(FlexChartCore._CSS_AXIS_Y,this._chartRectId);x._hostElement=i?w:x._hostElement;x._render(t);t.endGroup()}t.startGroup("wj-series-group");this._plotrectId="plotRect"+(1e6*Math.random()).toFixed();t.addClipRect(this._plotRect,this._plotrectId);for(_=0;_<c;_++){let e=this._series[_];e._pointIndexes=[];f=this._getPlotter(e);e._plotter=f;var w=t.startGroup(e.cssClass,f.clipping?this._plotrectId:null);e._hostElement=i?w:e._hostElement;var v=e.visibility,b=e.axisX,y=e.axisY;b||(b=this.axisX);y||(y=this.axisY);if(v==SeriesVisibility.Visible||v==SeriesVisibility.Plot){var S,C,T=u[y._uniqueId];if(!T||f instanceof _BarPlotter){S=f.seriesIndex;C=f.seriesCount;f.seriesIndex++;e.onRendering(t,S,C)||f.plotSeries(t,b,y,e,this,S,C)}else{S=T.index;C=T.count;T.index++;e.onRendering(t,S,C)||f.plotSeries(t,b,y,e,this,S,C)}e.onRendered(t)}t.endGroup()}t.endGroup();this._lblAreas=[];this.dataLabel.content&&this.dataLabel.position!=LabelPosition.None&&this._renderLabels(t);this._highlightCurrent();this.onRendered(new RenderEventArgs(t))}_getDesiredLegendSize(t,e,i,s){let r=new wijmo_1.Size;const a=this.series,n=a.length,h=this.legend.scrollbar?18:0;let l=0,o=0;this._colRowLens=[];for(var _=0;_<n;_++){var d=wijmo_1.tryCast(a[_],SeriesBase),c=d.visibility;if(d.name&&c!=SeriesVisibility.Hidden&&c!=SeriesVisibility.Plot)for(var u=d.legendItemLength(),g=0;g<u;g++){var m=d.measureLegendItem(t,g);if(e){if(l+m.height>s&&!this.legend.scrollbar){r.height=s;this._colRowLens.push(o);o=0;l=0}o<m.width&&(o=m.width);l+=m.height}else{if(o+m.width>i-h){r.width=i;this._colRowLens.push(l);l=0;o=0}l<m.height&&(l=m.height);o+=m.width}}}if(e){r.height<l&&(r.height=l);this._colRowLens.push(o);r.width=this._colRowLens.reduce((t,e)=>t+e,0)}else{r.width<o&&(r.width=o);this._colRowLens.push(l);r.height=this._colRowLens.reduce((t,e)=>t+e,0)}return r}_renderLegend(t,e,i,s,r,a){var n,h=this.series,l=h.length,o=e.clone(),_=0;if(this._legendReversed()){for(var d=l-1;d>=0;d--){n=wijmo_1.tryCast(h[d],SeriesBase);_=this._renderLegendElements(t,n,e,o,i,s,r,a,_)}i.reverse()}else for(d=0;d<l;d++){n=wijmo_1.tryCast(h[d],SeriesBase);_=this._renderLegendElements(t,n,e,o,i,s,r,a,_)}}_legendReversed(){var t=!1,e=this._getChartType();(e===ChartType.Bar||e===ChartType.Column&&this._rotated)&&(this._stacking!==Stacking.None||this.axisY.reversed||(t=!0));return t}_renderLegendElements(t,e,i,s,r,a,n,h,l){var o=new wijmo_1.Rect(i.x,i.y,n,h),_=l;if(!e)return _;var d=e.visibility;if(!e.name||d==SeriesVisibility.Hidden||d==SeriesVisibility.Plot){e._legendElement=null;r.push(null);return _}var c=e.legendItemLength(),u=t.startGroup(e.cssClass);if(d==SeriesVisibility.Legend){u.setAttribute("opacity","0.5");e._legendElement=u}else d==SeriesVisibility.Visible?e._legendElement=u:e._legendElement=null;for(var g=0;g<c;g++){var m=e.measureLegendItem(t,g);if(a){if(s.y+m.height>o.bottom+1&&!this.legend.scrollbar){s.x+=this._colRowLens[_];_++;s.y=i.y}}else if(s.x+m.width>o.right+1){s.y+=this._colRowLens[_];_++;s.x=i.x}var f=new wijmo_1.Rect(s.x,s.y,m.width,m.height);d!=SeriesVisibility.Legend&&d!=SeriesVisibility.Visible||e.drawLegendItem(t,f,g);r.push(f);a?s.y+=m.height:s.x+=m.width}t.endGroup();return _}_renderLabels(t){var e=this.series,i=e.length;t.stroke="null";t.fill="transparent";t.strokeWidth=1;var s=FlexChartCore._CSS_DATA_LABELS;t.startGroup(s);for(var r=0;r<i;r++){var a=e[r],n=this._hitTester._map[r];n&&a._renderLabels(t,n,this,this._lblAreas)}t.endGroup()}_getAxes(){for(var t=[this.axisX,this.axisY],e=this.series.length,i=0;i<e;i++){var s=this.series[i],r=s.axisX;r&&-1===t.indexOf(r)&&t.push(r);var a=s.axisY;a&&-1===t.indexOf(a)&&t.push(a)}return t}_clearPlotters(){for(var t=this._plotters.length,e=0;e<t;e++)this._plotters[e].clear()}_initPlotter(t){t.chart=this;t.dataInfo=this._dataInfo;t.hitTester=this._hitTester;this._plotters.push(t)}get _barPlotter(){if(null===this.__barPlotter){this.__barPlotter=new _BarPlotter;this._initPlotter(this.__barPlotter)}return this.__barPlotter}get _linePlotter(){if(null===this.__linePlotter){this.__linePlotter=new _LinePlotter;this._initPlotter(this.__linePlotter)}return this.__linePlotter}get _areaPlotter(){if(null===this.__areaPlotter){this.__areaPlotter=new _AreaPlotter;this._initPlotter(this.__areaPlotter)}return this.__areaPlotter}get _bubblePlotter(){if(null===this.__bubblePlotter){this.__bubblePlotter=new _BubblePlotter;this._initPlotter(this.__bubblePlotter)}return this.__bubblePlotter}get _financePlotter(){if(null===this.__financePlotter){this.__financePlotter=new _FinancePlotter;this._initPlotter(this.__financePlotter)}return this.__financePlotter}get _funnelPlotter(){if(null===this.__funnelPlotter){this.__funnelPlotter=new _FunnelPlotter;this._initPlotter(this.__funnelPlotter)}return this.__funnelPlotter}_getPlotter(t){var e,i=this._getChartType(),s=!1;if(t){var r=t._getChartType();if(null!=r&&r!=i){i=r;s=!0}}switch(i){case ChartType.Column:this._barPlotter.isVolume=!1;this._barPlotter.width=.7;e=this._barPlotter;break;case ChartType.Bar:this._barPlotter.rotated=!this._rotated;this._barPlotter.isVolume=!1;this._barPlotter.width=.7;e=this._barPlotter;break;case ChartType.Line:this._linePlotter.hasSymbols=!1;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.Scatter:this._linePlotter.hasSymbols=!0;this._linePlotter.hasLines=!1;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.LineSymbols:this._linePlotter.hasSymbols=!0;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.Area:this._areaPlotter.isSpline=!1;this._areaPlotter.isStep=!1;e=this._areaPlotter;break;case ChartType.Bubble:e=this._bubblePlotter;break;case ChartType.Candlestick:(a=this._financePlotter).isCandle=!0;a.isEqui=!1;a.isArms=!1;a.isVolume=!1;e=a;break;case ChartType.HighLowOpenClose:var a;(a=this._financePlotter).isCandle=!1;a.isEqui=!1;a.isArms=!1;a.isVolume=!1;e=a;break;case ChartType.Spline:this._linePlotter.hasSymbols=!1;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!0;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.SplineSymbols:this._linePlotter.hasSymbols=!0;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!0;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.SplineArea:this._areaPlotter.isSpline=!0;this._areaPlotter.isStep=!1;e=this._areaPlotter;break;case ChartType.Funnel:e=this._funnelPlotter;break;case ChartType.Step:this._linePlotter.hasSymbols=!1;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!0;e=this._linePlotter;break;case ChartType.StepSymbols:this._linePlotter.hasSymbols=!0;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!0;e=this._linePlotter;break;case ChartType.StepArea:this._areaPlotter.isSpline=!1;this._areaPlotter.isStep=!0;e=this._areaPlotter;break;default:throw"Invalid chart type."}e.rotated=this._rotated;i==ChartType.Bar&&(e.rotated=!e.rotated);s&&(e.rotated=this._isRotated());return e}_layout(t,e,i){this.plotAreas.length>0?this._layoutMultiple(t,e,i):this._layoutSingle(t,e,i)}_layoutSingle(t,e,i){var s=t.width,r=t.height,a=new wijmo_1.Size(s,.75*r),n=new wijmo_1.Size(r,.75*s),h=0,l=0,o=s,_=r,d=0,c=0,u=s,g=r;if(this.dataLabel.position===LabelPosition.Top?this.dataLabel.content:null){l=i.measureString(this.dataLabel.content,"wj-data-label").height}for(var m=this._getAxes(),f=this.axisY._getHeight(i,r),p=0;p<m.length;p++){var x=(M=m[p]).origin,w=M._getPosition();if(M.axisType==AxisType.X){(S=M._getHeight(i,Math.max(10,s-f)))>a.height&&(S=a.height);M._desiredSize=new wijmo_1.Size(a.width,S);var v=M._hasOrigin=wijmo_1.isNumber(x)&&x>this.axisY._getMinNum()&&x<this.axisY._getMaxNum(),b=Math.min(.25*s,M._annoSize.width);if(w==Position.Bottom){h=Math.max(h,.5*b);o=Math.min(o,s-.5*b);if(v){var y=this._convertY(x,c,g);g-=Math.max(0,y+S-g)}else g-=S}else if(w==Position.Top){h=Math.max(h,.5*b);o=Math.min(o,s-.5*b);if(v){y=this._convertY(x,c,g);c+=Math.max(0,c-(y-S))}else c+=S}}else if(M.axisType==AxisType.Y){var S;(S=M===this.axisX?f:M._getHeight(i,r))>n.height&&(S=n.height);M._desiredSize=new wijmo_1.Size(n.width,S);v=M._hasOrigin=wijmo_1.isNumber(x)&&x>this.axisX._getMinNum()&&x<this.axisX._getMaxNum();if(w==Position.Left){if(M._actualAngle<0)_=Math.min(_,r-M._annoSize.height);else if(M._actualAngle>0)l=Math.max(l,M._annoSize.height);else{l=Math.max(l,M._annoSize.height);_=Math.min(_,r-M._annoSize.height)}if(v){var C=this._convertX(x,d,u);d+=Math.max(0,d-(C-S))}else d+=S}else if(w==Position.Right){if(M._actualAngle>0)_=Math.min(_,r-M._annoSize.height);else if(M._actualAngle<0)l=Math.max(l,M._annoSize.height);else{l=Math.max(l,M._annoSize.height);_=Math.min(_,r-M._annoSize.height)}if(v){C=this._convertX(x,d,u);u-=Math.max(0,C+S-u)}else u-=S}}}var T=this._parseMargin(this.plotMargin);h=d=isNaN(T.left)?Math.max(h,d)+t.left:T.left;o=u=isNaN(T.right)?Math.min(o,u)+t.left:e.width-T.right;l=c=isNaN(T.top)?Math.max(l,c)+t.top:T.top;_=g=isNaN(T.bottom)?Math.min(_,g)+t.top:e.height-T.bottom;s=Math.max(1,o-h);r=Math.max(1,_-l);this._plotRect=new wijmo_1.Rect(h,l,s,r);_<=l&&(g=c+1);i.stroke=null;for(p=0;p<m.length;p++){var M;x=(M=m[p]).origin,w=M._getPosition();if(M.axisType==AxisType.X){var P;if(M._hasOrigin){y=this._convertY(x,this._plotRect.top,this._plotRect.bottom);if(w==Position.Bottom){P=new wijmo_1.Rect(h,y,s,M._desiredSize.height);g+=Math.max(0,P.bottom-this._plotRect.bottom)}else if(w==Position.Top){P=new wijmo_1.Rect(h,y-M._desiredSize.height,s,M._desiredSize.height);c-=Math.max(0,this._plotRect.top-P.top)}else P=new wijmo_1.Rect(h,y,s,1)}else if(w==Position.Bottom){P=new wijmo_1.Rect(h,g,s,M._desiredSize.height);g+=M._desiredSize.height}else if(w==Position.Top){P=new wijmo_1.Rect(h,c-M._desiredSize.height,s,M._desiredSize.height);c-=M._desiredSize.height}else P=new wijmo_1.Rect(h,c,s,1);M._layout(P,this._plotRect)}else if(M.axisType==AxisType.Y){var A;if(M._hasOrigin){C=this._convertX(x,this._plotRect.left,this._plotRect.right);if(w==Position.Left){A=new wijmo_1.Rect(C-M._desiredSize.height,l,r,M._desiredSize.height);d-=M._desiredSize.height}else if(w==Position.Right){A=new wijmo_1.Rect(C,l,r,M._desiredSize.height);u+=M._desiredSize.height}else A=new wijmo_1.Rect(C,l,r,1)}else if(w==Position.Left){A=new wijmo_1.Rect(d-M._desiredSize.height,l,r,M._desiredSize.height);d-=M._desiredSize.height}else if(w==Position.Right){A=new wijmo_1.Rect(u,l,r,M._desiredSize.height);u+=M._desiredSize.height}else A=new wijmo_1.Rect(d,l,r,1);M._layout(A,this._plotRect)}}}_layoutMultiple(t,e,i){for(var s=t.width,r=t.height,a=[],n=[],h=this._getAxes(),l=h.length,o=0;o<l;o++){(C=h[o])._plotrect=null;if(C.axisType==AxisType.X){for(var _=C.plotArea?C.plotArea.column:0;a.length<=_;)a.push(new _AreaDef);a[_].axes.push(C)}else if(C.axisType==AxisType.Y){for(var d=C.plotArea?C.plotArea.row:0;n.length<=d;)n.push(new _AreaDef);n[d].axes.push(C)}}for(var c=a.length,u=n.length,g=new wijmo_1.Size(s,.3*r),m=new wijmo_1.Size(r,.3*s),f=0,p=0,x=s,w=r,v=0;v<c;v++){(E=a[v]).right=s;E.bottom=r;for(o=0;o<E.axes.length;o++){var b=(C=E.axes[o])._getHeight(i,C.axisType==AxisType.X?s:r);b>g.height&&(b=g.height);var y=new wijmo_1.Size(g.width,b);C._desiredSize=y;0==v&&(E.left=Math.max(E.left,.5*C._annoSize.width));v==c-1&&(E.right=Math.min(E.right,s-.5*C._annoSize.width));(R=C._getPosition())==Position.Bottom?E.bottom-=y.height:R==Position.Top&&(E.top+=y.height)}}for(var S=0;S<u;S++){(E=n[S]).right=s;E.bottom=r;for(o=0;o<E.axes.length;o++){var C=E.axes[o],T=new wijmo_1.Size(m.width,C._getHeight(i,C.axisType==AxisType.X?s:r));T.height>m.height&&(T.height=m.height);C._desiredSize=T;0==S&&(E.top=Math.max(E.top,.5*C._annoSize.width));S==u-1&&(E.bottom=Math.min(E.bottom,r-.5*C._annoSize.width));(R=C._getPosition())==Position.Left?E.left+=T.height:R==Position.Right&&(E.right-=T.height)}}var M=0,P=0,A=s,L=r;for(v=0;v<c;v++){var E=a[v];M=Math.max(M,E.left);P=Math.max(P,E.top);A=Math.min(A,E.right);L=Math.min(L,E.bottom)}for(S=0;S<u;S++){E=n[S];M=Math.max(M,E.left);P=Math.max(P,E.top);A=Math.min(A,E.right);L=Math.min(L,E.bottom)}M=f=Math.max(f,M);A=x=Math.min(x,A);P=p=Math.max(p,P);L=w=Math.min(w,L);this._plotRect=new wijmo_1.Rect(f,p,x-f,w-p);var k=this._plotRect.clone(),j=f,N=this.plotAreas._calculateWidths(this._plotRect.width,c);for(v=0;v<c;v++){L=w;P=p;E=a[v];var I=N[v];for(o=0;o<E.axes.length;o++){var D,R=(C=E.axes[o])._getPosition(),F=new wijmo_1.Rect(j,k.top,I,k.height);if(R==Position.Bottom){D=new wijmo_1.Rect(j,L,I,C._desiredSize.height);L+=C._desiredSize.height}else if(R==Position.Top){D=new wijmo_1.Rect(j,P-C._desiredSize.height,I,C._desiredSize.height);P-=C._desiredSize.height}C._layout(D,F)}for(o=0;o<this.plotAreas.length;o++){(O=this.plotAreas[o]).column==v&&O._setPlotX(j,I)}j+=I}var B=p,V=this.plotAreas._calculateHeights(this._plotRect.height,u);for(S=0;S<u;S++){M=f;A=x;E=n[S];var z=V[S];for(o=0;o<E.axes.length;o++){var X;R=(C=E.axes[o])._getPosition(),F=new wijmo_1.Rect(k.left,B,k.width,z);if(C._plotrect){F.left=C._plotrect.left;F.width=C._plotrect.width}else N&&N.length>0&&(F.width=N[0]);if(R==Position.Left){X=new wijmo_1.Rect(M-C._desiredSize.height,B,z,C._desiredSize.height);M-=C._desiredSize.height}else if(R==Position.Right){X=new wijmo_1.Rect(A,B,z,C._desiredSize.height);A+=C._desiredSize.height}C._layout(X,F)}for(o=0;o<this.plotAreas.length;o++){var O;(O=this.plotAreas[o]).row==S&&O._setPlotY(B,z)}B+=z}}_convertX(t,e,i){var s=this.axisX;return s.reversed?i-(i-e)*(t-s._getMinNum())/(s._getMaxNum()-s._getMinNum()):e+(i-e)*(t-s._getMinNum())/(s._getMaxNum()-s._getMinNum())}_convertY(t,e,i){var s=this.axisY;return s.reversed?e+(i-e)*(t-s._getMinNum())/(s._getMaxNum()-s._getMinNum()):i-(i-e)*(t-s._getMinNum())/(s._getMaxNum()-s._getMinNum())}_getLabelContent(t,e){return t.chartElement===ChartElement.AxisX||t.chartElement===ChartElement.AxisY?t.name:wijmo_1.isString(e)?this._keywords.replace(e,t):wijmo_1.isFunction(e)?e(t):null}_select(t,e){const i=this.selectionMode;var s=!1;(t!=this._selection||i==SelectionMode.Point&&e!=this._selectionIndex)&&(s=!0);this._selection&&this._highlight(this._selection,!1,this._selectionIndex);this._selection=t;this._selectionIndex=e;this._selection&&this._highlight(this._selection,!0,this._selectionIndex);if(i==SelectionMode.Point){var r=t?t.collectionView:this._cv;if(r){this._notifyCurrentChanged=!1;r.moveCurrentToPosition(t?e:-1);this._notifyCurrentChanged=!0}}s&&this.onSelectionChanged()}_highlightCurrent(){if(this.selectionMode!=SelectionMode.None){var t=this._selection,e=-1;if(t){var i=t.collectionView;i||(i=this._cv);i&&(e=i.currentPosition);this._highlight(t,!0,e)}}}_highlight(t,e,i){t=wijmo_1.asType(t,SeriesBase,!0);if(this.selectionMode==SelectionMode.Series){var s=this.series.indexOf(t),r=t.hostElement;e?r.parentNode.appendChild(r):r.parentNode.insertBefore(r,r.parentNode.childNodes.item(s));var a=this._find(r,["rect","ellipse","polyline","polygon","line","path"]);this._highlightItems(a,FlexChartCore._CSS_SELECTION,e);t.legendElement&&this._highlightItems(this._find(t.legendElement,["rect","ellipse","line"]),FlexChartCore._CSS_SELECTION,e)}else if(this.selectionMode==SelectionMode.Point){s=this.series.indexOf(t),r=t.hostElement;if(e){r.parentNode.appendChild(r);var n=t.getPlotElement(i);if(n)if(n instanceof SVGElement){if("g"!=n.nodeName){this._highlightItems([n],FlexChartCore._CSS_SELECTION,e);this._selectedEls.push(n)}if((a=this._find(n,["line","rect","ellipse","path","polygon"])).length>0){this._highlightItems(a,FlexChartCore._CSS_SELECTION,e);for(let t=0;t<a.length;t++)this._selectedEls.push(a[t])}}else if(Array.isArray(n)){this._highlightItems(n,FlexChartCore._CSS_SELECTION,e);for(let t=0;t<n.length;t++)this._selectedEls.push(n[t])}}else{r.parentNode.insertBefore(r,r.parentNode.childNodes.item(s));if(this._selectedEls.length>0){this._highlightItems(this._selectedEls,FlexChartCore._CSS_SELECTION,e);this._selectedEls.length=0}}}}_updateTooltip(t,e){let i,s=this.hitTest(e);if(s.distance<=t.threshold){let e=t.content;if(s.series){let t=s.series.tooltipContent;(t||""===t)&&(e=t)}i=this._getLabelContent(s,e)}i?this._showToolTip(i,new wijmo_1.Rect(e.clientX,e.clientY,5,5)):this._hideToolTip()}_updateAuxAxes(t,e){for(var i=2;i<t.length;i++){var s=t[i];s._chart=this;for(var r,a,n=[],h=0;h<this.series.length;h++){var l=this.series[h];l.axisX!=s&&l.axisY!=s||n.push(l)}for(h=0;h<n.length;h++){var o=n[h].getDataRect()||n[h]._getDataRect();if(o)if(s.axisType==AxisType.X&&!e||s.axisType==AxisType.Y&&e){(void 0===r||o.left<r)&&(r=o.left);(void 0===a||o.right>a)&&(a=o.right)}else{(void 0===r||o.top<r)&&(r=o.top);(void 0===a||o.bottom>a)&&(a=o.bottom)}}var _=n[0].getDataType(0);null==_&&(_=wijmo_1.DataType.Number);t[i]._updateActualLimits(_,r,a)}}}FlexChartCore._CSS_AXIS_X="wj-axis-x";FlexChartCore._CSS_AXIS_Y="wj-axis-y";FlexChartCore._CSS_LINE="wj-line";FlexChartCore._CSS_GRIDLINE="wj-gridline";FlexChartCore._CSS_TICK="wj-tick";FlexChartCore._CSS_GRIDLINE_MINOR="wj-gridline-minor";FlexChartCore._CSS_TICK_MINOR="wj-tick-minor";FlexChartCore._CSS_DATA_LABELS="wj-data-labels";exports.FlexChartCore=FlexChartCore;class _AreaDef{constructor(){this._axes=new Array;this.left=0;this.right=0;this.top=0;this.bottom=0}get axes(){return this._axes}}class _DataInfo{constructor(){this.stackAbs={};this._xvals=null}analyse(t,e,i,s,r,a){this.minY=NaN;this.maxY=NaN;this.minX=NaN;this.maxX=NaN;this.minXp=NaN;this.minYp=NaN;this.dx=0;var n={},h={},l={};this.dataTypeX=null;this.dataTypeY=null;this._xvals=s;if(null!=s)for(var o=s.length,_=0;_<o;_++){var d=s[_];(isNaN(this.minX)||this.minX>d)&&(this.minX=d);(isNaN(this.maxX)||this.maxX<d)&&(this.maxX=d);d>0&&(isNaN(this.minXp)||this.minXp>d)&&(this.minXp=d);if(_>0){var c=Math.abs(d-s[_-1]);!isNaN(c)&&(c<this.dx||0==this.dx)&&(this.dx=c)}}for(_=0;_<t.length;_++){var u=t[_],g=u._getChartType(),m=void 0!==u.chartType,f=u.visibility;if(f!=SeriesVisibility.Hidden&&f!=SeriesVisibility.Legend){var p,x=u.getDataRect();if(x){if(!isNaN(this.minX)&&this.minX<x.left){p=x.right;x.left=this.minX;x.width=p-this.minX}!isNaN(this.maxX)&&this.maxX>x.right&&(x.width=this.maxX-x.left);if(!u._isCustomAxisY()){if(!isNaN(this.minY)&&this.minY<x.top){p=x.bottom;x.top=this.minY;x.height=p-this.minY}!isNaN(this.maxY)&&this.maxY>x.bottom&&(x.height=this.maxY-x.top)}}var w=null;e?u._isCustomAxisY()||(w=u.getValues(1)):u._isCustomAxisX()||(w=u.getValues(1));if(w){this.dataTypeX||(this.dataTypeX=u.getDataType(1));for(var v=0;v<w.length;v++){var b=w[v];if(isFinite(b)){(isNaN(this.minX)||this.minX>b)&&(this.minX=b);(isNaN(this.maxX)||this.maxX<b)&&(this.maxX=b);if(v>0&&(!g||g==ChartType.Column||g==ChartType.Bar)){c=Math.abs(b-w[v-1]);!isNaN(c)&&c>0&&(c<this.dx||0==this.dx)&&(this.dx=c)}}}}var y=null,S=!1;if(e){S=u._isCustomAxisX();y=u.getValues(0)}else{S=u._isCustomAxisY();y=u.getValues(0)}if(y){this.dataTypeY||S||(this.dataTypeY=u.getDataType(0));isNaN(this.minX)?this.minX=0:w||s||(this.minX=Math.min(this.minX,0));isNaN(this.maxX)?this.maxX=y.length-1:w||s||(this.maxX=Math.max(this.maxX,y.length-1));if(!S){let t=i==Stacking.None||m;for(let e=0;e<y.length;e++){let i=y[e],r=w?wijmo_1.asNumber(w[e],!0):s?wijmo_1.asNumber(s[e],!0):e;wijmo_1.isArray(i)?i.forEach(e=>{this._parseYVal(e,r,t,l,n,h)}):this._parseYVal(i,r,t,l,n,h)}}}var C=u.getDataRect(new wijmo_1.Rect(this.minX,this.minY,this.maxX-this.minX,this.maxY-this.minY),x);if(C){this.minX=C.left;this.maxX=C.right;if(!S){this.minY=C.top;this.maxY=C.bottom}}}}if(i==Stacking.Stacked){for(var T in n)n[T]>this.maxY&&(this.maxY=n[T]);for(var T in h)h[T]<this.minY&&(this.minY=h[T])}else if(i==Stacking.Stacked100pc){this.minY=0;this.maxY=0;for(var T in l){var M=l[T];if(isFinite(M)&&0!=M){var P=n[T],A=h[T];isFinite(P)&&(P=Math.max(P/M,this.maxY))>this.maxY&&(this.maxY=P);isFinite(A)&&(A=Math.min(A/M,this.minY))<this.minY&&(this.minY=A)}}if(this.minY==this.maxY){this.minY=0;this.maxY=1}}this.stackAbs=l;r&&(e?this.minY=isNaN(this.minYp)?1:this.minYp:this.minX=isNaN(this.minXp)?1:this.minXp);a&&(e?this.minX=isNaN(this.minXp)?1:this.minXp:this.minY=isNaN(this.minYp)?1:this.minYp)}_parseYVal(t,e,i,s,r,a){if(isFinite(t)){null!=t&&(isNaN(this.minY)||this.minY>t)&&(this.minY=t);null!=t&&(isNaN(this.maxY)||this.maxY<t)&&(this.maxY=t);t>0&&(isNaN(this.minYp)||this.minYp>t)&&(this.minYp=t);if(!i){t>0?isNaN(r[e])?r[e]=t:r[e]+=t:isNaN(a[e])?a[e]=t:a[e]+=t;isNaN(s[e])?s[e]=Math.abs(t):s[e]+=Math.abs(t)}}}getMinY(){return this.minY}getMaxY(){return this.maxY}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinXp(){return this.minXp}getMinYp(){return this.minYp}getDeltaX(){return this.dx}getDataTypeX(){return this.dataTypeX}getDataTypeY(){return this.dataTypeY}getStackedAbsSum(t){var e=this.stackAbs[t];return isFinite(e)?e:0}getXVals(){return this._xvals}static isValid(...t){let e=t.length;for(let i=0;i<e;i++)if(!isFinite(t[i]))return!1;return!0}}exports._DataInfo=_DataInfo;class FlexChart extends FlexChartCore{constructor(t,e){super(t,null);this._chartType=ChartType.Column;this.initialize(e)}_getChartType(){return this._chartType}get chartType(){return this._chartType}set chartType(t){if((t=wijmo_1.asEnum(t,ChartType))!=this._chartType){this._chartType=t;this.invalidate()}}get rotated(){return this._rotated}set rotated(t){if(t!=this._rotated){this._rotated=wijmo_1.asBoolean(t);this.invalidate()}}get stacking(){return this._stacking}set stacking(t){if((t=wijmo_1.asEnum(t,Stacking))!=this._stacking){this._stacking=t;this.invalidate()}}get options(){return this._options}set options(t){if(t!=this._options){this._options=t;this.invalidate()}}}exports.FlexChart=FlexChart;!function(t){t[t.None=0]="None";t[t.Left=1]="Left";t[t.Top=2]="Top";t[t.Right=3]="Right";t[t.Bottom=4]="Bottom";t[t.Center=5]="Center"}(LabelPosition=exports.LabelPosition||(exports.LabelPosition={}));!function(t){t[t.None=0]="None";t[t.Inside=1]="Inside";t[t.Center=2]="Center";t[t.Outside=3]="Outside";t[t.Radial=4]="Radial";t[t.Circular=5]="Circular"}(PieLabelPosition=exports.PieLabelPosition||(exports.PieLabelPosition={}));class DataLabelRenderEventArgs extends RenderEventArgs{constructor(t,e,i,s){super(t);this.cancel=!1;this._ht=e;this._pt=i;this._text=s}get point(){return this._pt}get text(){return this._text}set text(t){this._text=wijmo_1.asString(t)}get hitTestInfo(){return this._ht}}exports.DataLabelRenderEventArgs=DataLabelRenderEventArgs;class DataLabelBase{constructor(){this.rendering=new wijmo_1.Event}get content(){return this._content}set content(t){if(t!=this._content){this._content=t;this._invalidate()}}get border(){return this._bdr}set border(t){if(t!=this._bdr){this._bdr=wijmo_1.asBoolean(t,!0);this._invalidate()}}get offset(){return this._off}set offset(t){if(t!=this._off){this._off=wijmo_1.asNumber(t,!0);this._invalidate()}}get connectingLine(){return this._line}set connectingLine(t){if(t!=this._line){this._line=wijmo_1.asBoolean(t,!0);this._invalidate()}}onRendering(t){this.rendering.raise(this,t);return!t.cancel}_invalidate(){this._chart&&this._chart.invalidate()}}exports.DataLabelBase=DataLabelBase;class DataLabel extends DataLabelBase{constructor(){super(...arguments);this._pos=LabelPosition.Top}get position(){return this._pos}set position(t){if((t=wijmo_1.asEnum(t,LabelPosition))!=this._pos){this._pos=t;this._invalidate()}}}exports.DataLabel=DataLabel;class PieDataLabel extends DataLabelBase{constructor(){super(...arguments);this._pos=PieLabelPosition.Center}get position(){return this._pos}set position(t){if((t=wijmo_1.asEnum(t,PieLabelPosition))!=this._pos){this._pos=t;this._invalidate()}}}exports.PieDataLabel=PieDataLabel;!function(t){t[t.X=0]="X";t[t.Y=1]="Y"}(AxisType=exports.AxisType||(exports.AxisType={}));!function(t){t[t.Auto=0]="Auto";t[t.Show=1]="Show"}(OverlappingLabels=exports.OverlappingLabels||(exports.OverlappingLabels={}));!function(t){t[t.None=0]="None";t[t.Outside=1]="Outside";t[t.Inside=2]="Inside";t[t.Cross=3]="Cross"}(TickMark=exports.TickMark||(exports.TickMark={}));!function(t){t[t.None=0]="None";t[t.Show=1]="Show";t[t.ShowGrid=2]="ShowGrid"}(AxisGroupsDisplay=exports.AxisGroupsDisplay||(exports.AxisGroupsDisplay={}));class Axis{constructor(t){this._GRIDLINE_WIDTH=1;this._LINE_WIDTH=1;this._TICK_WIDTH=1;this._TICK_HEIGHT=4;this._TICK_OVERLAP=1;this._TICK_LABEL_DISTANCE=4;this._minorGrid=!1;this._labels=!0;this._isTimeAxis=!1;this._labelPadding=5;this._actualLabels=[];this._labelMin=!1;this._labelMax=!1;this.rangeChanged=new wijmo_1.Event;this._customConvert=null;this._customConvertBack=null;this.__uniqueId=Axis._id++;this._position=t;t==Position.Bottom||t==Position.Top?this._axisType=AxisType.X:this._axisType=AxisType.Y;this._minorTickMarks=TickMark.None;this._overlap=OverlappingLabels.Auto}get hostElement(){return this._hostElement}get actualMin(){return this._isTimeAxis?new Date(this._actualMin):this._actualMin}get actualMax(){return this._isTimeAxis?new Date(this._actualMax):this._actualMax}get min(){return this._min}set min(t){if(t!=this._min){wijmo_1.isDate(t)?this._min=wijmo_1.asDate(t,!0):this._min=wijmo_1.asNumber(t,!0);this._invalidate()}}get max(){return this._max}set max(t){if(t!=this._max){wijmo_1.isDate(t)?this._max=wijmo_1.asDate(t,!0):this._max=wijmo_1.asNumber(t,!0);this._invalidate()}}get reversed(){return this._reversed}set reversed(t){if(this._reversed!=t){this._reversed=wijmo_1.asBoolean(t);this._invalidate()}}get position(){return this._position}set position(t){if((t=wijmo_1.asEnum(t,Position,!1))!=this._position){this._position=t;this._position==Position.Bottom||this._position==Position.Top?this._axisType=AxisType.X:this._position!=Position.Left&&this._position!=Position.Right||(this._axisType=AxisType.Y);this._invalidate()}}get majorUnit(){return this._majorUnit}set majorUnit(t){if(t!=this._majorUnit){this._majorUnit=wijmo_1.asNumber(t,!0);this._invalidate()}}get minorUnit(){return this._minorUnit}set minorUnit(t){if(t!=this._minorUnit){this._minorUnit=wijmo_1.asNumber(t,!0);this._invalidate()}}get name(){return this._name}set name(t){t!=this._name&&(this._name=wijmo_1.asString(t,!0))}get title(){return this._title}set title(t){if(t!=this._title){this._title=wijmo_1.asString(t,!0);this._invalidate()}}get format(){return this._format}set format(t){if(t!=this._format){this._format=wijmo_1.asString(t,!0);this._invalidate()}}get majorGrid(){return this._majorGrid}set majorGrid(t){if(t!=this._majorGrid){this._majorGrid=wijmo_1.asBoolean(t,!0);this._invalidate()}}get majorTickMarks(){return this._majorTickMarks}set majorTickMarks(t){if((t=wijmo_1.asEnum(t,TickMark,!0))!=this._majorTickMarks){this._majorTickMarks=t;this._invalidate()}}get minorGrid(){return this._minorGrid}set minorGrid(t){if(t!=this._minorGrid){this._minorGrid=wijmo_1.asBoolean(t,!0);this._invalidate()}}get minorTickMarks(){return this._minorTickMarks}set minorTickMarks(t){if((t=wijmo_1.asEnum(t,TickMark,!0))!=this._minorTickMarks){this._minorTickMarks=t;this._invalidate()}}get axisLine(){return void 0===this._axisLine?this.axisType==AxisType.X:this._axisLine}set axisLine(t){if(t!=this._axisLine){this._axisLine=wijmo_1.asBoolean(t,!0);this._invalidate()}}get labels(){return this._labels}set labels(t){if(t!=this._labels){this._labels=wijmo_1.asBoolean(t,!0);this._invalidate()}}get labelAlign(){return this._labelAlign}set labelAlign(t){if(t!=this._labelAlign){this._labelAlign=wijmo_1.asString(t,!0);this._invalidate()}}get labelAngle(){return this._labelAngle}set labelAngle(t){if(t!=this._labelAngle){this._labelAngle=wijmo_1.asNumber(t,!0);this._invalidate()}}get labelMin(){return this._labelMin}set labelMin(t){if(t!=this._labelMin){this._labelMin=wijmo_1.asBoolean(t,!0);this._invalidate()}}get labelMax(){return this._labelMax}set labelMax(t){if(t!=this._labelMax){this._labelMax=wijmo_1.asBoolean(t,!0);this._invalidate()}}get origin(){return this._origin}set origin(t){if(t!=this._origin){this._origin=wijmo_1.asNumber(t,!0);this._invalidate()}}get overlappingLabels(){return this._overlap}set overlappingLabels(t){if((t=wijmo_1.asEnum(t,OverlappingLabels,!0))!=this._overlap){this._overlap=t;this._invalidate()}}get itemsSource(){return this._items}set itemsSource(t){if(this._items!=t){if(this._cv){this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._items=t;this._cv=wijmo_1.asCollectionView(t);null!=this._cv&&this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)}}get binding(){return this._binding}set binding(t){if(t!=this._binding){this._binding=wijmo_1.asString(t,!0);this._invalidate()}}get itemFormatter(){return this._ifmt}set itemFormatter(t){if(this._ifmt!=t){this._ifmt=wijmo_1.asFunction(t,!0);this._invalidate()}}get logBase(){return this._logBase}set logBase(t){if(t!=this._logBase){this._logBase=wijmo_1.asNumber(t,!0,!0);this._invalidate()}}get groupsOptions(){return this._groupsOptions}set groupsOptions(t){if(t!=this._groupsOptions){this._groupsOptions=t;this._invalidate()}}get axisLabels(){return this._actualLabels}_getLogBase(){return this._chart&&this._chart._stacking===Stacking.Stacked100pc?0:this.logBase}_isLogAxis(){let t=this._getLogBase();return null!=t&&t>0}get plotArea(){return this._parea}set plotArea(t){if(t!=this._parea){this._parea=wijmo_1.asType(t,PlotArea,!0);this._invalidate()}}get labelPadding(){return this._labelPadding}set labelPadding(t){if(t!=this._labelPadding){this._labelPadding=wijmo_1.asNumber(t,!0,!0);this._invalidate()}}get _groupClass(){return this.axisType===AxisType.X?FlexChartCore._CSS_AXIS_X:FlexChartCore._CSS_AXIS_Y}onRangeChanged(t){this.rangeChanged.raise(this,t)}_getPosition(){if(this.axisType==AxisType.X){if(this.position==Position.Auto)return Position.Bottom}else if(this.axisType==AxisType.Y&&this.position==Position.Auto)return Position.Left;return this.position}_isOverlapped(t,e,i,s){var r=this._lbls;if(null!=r&&r.length>1)for(var a=r.length,n=this._values&&this._values.length==a?this._values:null,h=0,l=0,o=0;o<a;o++){var _=n?n[o]:o;if(_>=this._actualMin&&_<=this._actualMax){var d=e*(_-this._actualMin)/(this._actualMax-this._actualMin),c=t.measureString(r[o],i,this._groupClass);if(this.axisType==AxisType.X){if(o>0&&Math.abs(d-h)<.5*(c.width+l))return!0;h=d;l=c.width}else this.axisType,AxisType.Y}}return!1}_getHeight(t,e){this._actualAngle=null;let i=FlexChartCore._CSS_LABEL,s=FlexChartCore._CSS_TITLE,r=.1*(this._actualMax-this._actualMin),a=this._lbls,n=this.labelAngle;if(this.labels&&this._chart._getChartType()!==ChartType.Funnel){r=this._updateAutoFormat(r);if(null!=a&&a.length>0){let s=a.length,r=this._values&&this._values.length==s?this._values:null;this._annoSize=new wijmo_1.Size;for(var h=0;h<s;h++){let e=r?r[h]:h;if(e>=this._actualMin&&e<=this._actualMax){let s=a[h],r=i;if(this.itemFormatter){let a=this._getFormattedItem(t,e,s,new wijmo_1.Point,i,!0);s=a.text;r=a.cls}let n=t.measureString(s,r,this._groupClass);this.axisType,AxisType.X,n.width>this._annoSize.width&&(this._annoSize.width=n.width);n.height>this._annoSize.height&&(this._annoSize.height=n.height)}}null==n&&this.axisType==AxisType.X&&(this._isOverlapped(t,Math.max(10,e-this._annoSize.width),i,this.axisType)?n=this._actualAngle=-45:this._actualAngle=0)}else{let e=this._actualMin-r,s=this._formatValue(e),a=i;if(this.itemFormatter){s=this._getFormattedItem(t,e,s,new wijmo_1.Point,i,!0).text;a=i}let n=t.measureString(s,a,this._groupClass);this._annoSize=n;e=this._actualMax+r;s=this._formatValue(e);a=i;if(this.itemFormatter){s=this._getFormattedItem(t,e,s,new wijmo_1.Point,i,!0).text;a=i}(n=t.measureString(s,a,this._groupClass)).width>this._annoSize.width&&(this._annoSize.width=n.width);n.height>this._annoSize.height&&(this._annoSize.height=n.height)}this._annoSizeBase=new wijmo_1.Size(this._annoSize.width,this._annoSize.height);if(n){n>90?n=90:n<-90&&(n=-90);let t=n*Math.PI/180,e=this._annoSize.width,i=this._annoSize.height;this._annoSize.width=e*Math.abs(Math.cos(t))+i*Math.abs(Math.sin(t));this._annoSize.height=e*Math.abs(Math.sin(t))+i*Math.abs(Math.cos(t));this._actualAngle=n}}else{this._annoSize=new wijmo_1.Size(8,8);this._annoSizeBase=new wijmo_1.Size(this._annoSize.width,this._annoSize.height)}let l=0;if(this.labels){l=2*(this._labelPadding||5);this._axisType==AxisType.X?l+=this._annoSize.height:l+=this._annoSize.width+this._TICK_LABEL_DISTANCE+2}let o=this._TICK_HEIGHT,_=this._TICK_OVERLAP,d=this.majorTickMarks;d==TickMark.Outside?_=1:d==TickMark.Inside?_=-1:d==TickMark.Cross&&(_=0);null==d&&(d=TickMark.Outside);d!=TickMark.None&&(l+=.5*(1+_)*o);if(this._title){let e=this._title;this._szTitle=t.measureString(e,s,this._groupClass);l+=this._szTitle.height}else this._szTitle=void 0;if(this._lbls&&this.groupsOptions&&this.groupsOptions.display!==AxisGroupsDisplay.None){this._groupsPanel||(this._groupsPanel=new _AxisGroups(this));this._groupsPanel.createGroups();l+=this._groupsPanel.getHeight(t)}t.fontSize=null;return l}_updateAutoFormat(t){if(this._isTimeAxis){var e=this.format,i=.001*this._getActualRange()/10,s=new _timeSpan(i*_timeSpan.TicksPerSecond),r=wijmo_1.isNumber(this._majorUnit)?_timeSpan.fromDays(this._majorUnit):_timeHelper.NiceTimeSpan(s,e);e||(this._tfmt=_timeHelper.GetTimeDefaultFormat(1e3*r.TotalSeconds,0));t=r.TotalSeconds}return t}_getActualRange(){return this._actualMax-this._actualMin}_updateActualLimitsByChartType(t,e,i){if(t&&t.length>0&&!this._isTimeAxis){var s=this._chart._getChartType();if(s!=ChartType.Column&&s!=ChartType.Bar){e-=.5;i+=.5}}return{min:e,max:i}}_updateActualLimits(t,e,i,s=null,r=null){var a=this._actualMin,n=this._actualMax;this._isTimeAxis=t==wijmo_1.DataType.Date;var h=this._updateActualLimitsByChartType(s,e,i);e=h.min;i=h.max;var l=this._min,o=this._max;wijmo_1.isDate(l)&&(l=l.valueOf());wijmo_1.isDate(o)&&(o=o.valueOf());let _=this._chart&&this._chart._stacking!==Stacking.Stacked100pc;_||(_=this._chart._isRotated()?this.axisType==AxisType.Y:this.axisType==AxisType.X);const d=this._actualMin=null!=l&&_?l:e;if(d==(this._actualMax=null!=o&&_?o:i))if(void 0!==l&&void 0===o)this._actualMax+=1;else if(void 0===l&&void 0!==o)this._actualMin-=1;else if(0===d)this._actualMax=1;else{const t=Math.abs(d);if(t<1){this._actualMin-=t;this._actualMax+=t}else{this._actualMin-=1;this._actualMax+=1}}if(this._getLogBase()>0){const t=this.logBase,e=Math.log(t);if(!this._max){var c=Math.ceil(Math.log(this._actualMax)/e);this._actualMax=Math.pow(t,c)}if(!this._min){var u=Math.floor(Math.log(this._actualMin)/e);this._actualMin=Math.pow(t,u)}(this._actualMin<=0||!wijmo_1.isNumber(this._actualMin))&&(this._actualMin=1);this._actualMax<this._actualMin?this._actualMax=this._actualMin+1:this._actualMax===this._actualMin&&(this._actualMin=.1*this._actualMax)}(a!=this._actualMin&&(wijmo_1.isNumber(a)||wijmo_1.isNumber(this._actualMin))||n!=this._actualMax&&(wijmo_1.isNumber(n)||wijmo_1.isNumber(this._actualMax)))&&this.onRangeChanged();if(this._items){this._values=[];this._lbls=[];var g=this._items.length,m="value",f="text";if(this.binding){var p=this.binding.split(",");if(2==p.length){m=p[0];f=p[1]}}for(var x=0;x<g;x++){var w=this._items[x],v=w[m];if(wijmo_1.isNumber(v)){this._values.push(v);this._lbls.push(w[f])}else if(wijmo_1.isDate(v)){this._values.push(v.getTime());this._lbls.push(w[f])}}}else{this._lbls=s;this._values=r}}_layout(t,e){var i=this.axisType==AxisType.Y;this._plotrect=e;this._axrect=i?new wijmo_1.Rect(t.left,t.top,t.height,t.width):t;this._groupsPanel&&this._groupsPanel.layout()}_hasVisibileSeries(){for(var t,e=this._chart.series,i=0,s=e.length;i<s;i++)if((t=e[i].visibility)==SeriesVisibility.Plot||t==SeriesVisibility.Visible)return!0;return!1}_render(t){if(this.position!=Position.None&&this._hasVisibileSeries()){this.axisLabels.length=0;this._vals={};var e=0;this.labelAngle&&((e=this.labelAngle)>90?e=90:e<-90&&(e=-90));null==this.labelAngle&&null!=this._actualAngle&&(e=this._actualAngle);var i=FlexChartCore._FG,s=this._actualMax-this._actualMin;if(wijmo_1.isNumber(s)){var r=this._calcMajorUnit();0==r&&(r=.1*this._niceTickNumber(s));var a=Math.min(Axis.MAX_MAJOR,Math.floor(s/r)+1),n=[],h=[];this._rects=[];this._vals.major=n;this._vals.hasLbls=[];var l=Math.floor(this._actualMin/r)*r;l<this._actualMin&&(l+=r);var o=!1;if(this._lbls&&this._lbls.length>0){h=this._lbls;if(0==this._values.length){o=!0;for(var _=0;_<h.length;_++)n.push(_)}else n=this._values}else if(this._isTimeAxis){this._createTimeLabels(l,a,n,h);this._addMinMaxLabels(n,h)}else if(this._getLogBase()){this._createLogarithmicLabels(this._actualMin,this._actualMax,this.majorUnit,n,h,!0);this._addMinMaxLabels(n,h)}else{this._createLabels(l,a,r,n,h);this._addMinMaxLabels(n,h)}a=Math.min(n.length,h.length);t.textFill=i;var d=this._TICK_HEIGHT,c=this._TICK_OVERLAP,u=this.majorTickMarks;null==u&&(u=TickMark.Outside);u==TickMark.Outside?c=1:u==TickMark.Inside?c=-1:u==TickMark.Cross&&(c=0);var g=.5*(c-1)*d,m=.5*(1+c)*d;for(_=0;_<a;_++){var f=!0,p=n[_],x=h[_],w=this.labels;w&&(o||this.itemsSource)&&this.majorUnit&&_%this.majorUnit!=0&&(w=!1);if(p>=this._actualMin&&p<=this._actualMax){var v=t.textFill;f=this._renderLabelsAndTicks(t,_,p,x,e,u,w,g,m);t.textFill=v}this._vals.hasLbls.push(f);f&&this.axisLabels.push(x)}}(this.minorGrid||this.minorTickMarks!=TickMark.None)&&this._renderMinor(t,n,o);t.stroke=i;t.fontSize=null;this._renderLineAndTitle(t);this._lbls&&this.groupsOptions&&this.groupsOptions.display!==AxisGroupsDisplay.None&&this._groupsPanel&&this._groupsPanel.render(t);t.stroke=null;t.fontSize=null;t.textFill=null;t.strokeWidth=null}}_renderLineAndTitle(t){var e=this._getPosition(),i=this.axisType==AxisType.Y,s=e!=Position.Top&&e!=Position.Right,r=FlexChartCore._CSS_TITLE,a=FlexChartCore._CSS_LINE;if(i)if(s){if(this._title){var n=new wijmo_1.Point(this._axrect.left+.5*this._szTitle.height,this._axrect.top+.5*this._axrect.height);FlexChartCore._renderRotatedText(t,this._title,n,1,1,n,-90,r,this._groupClass)}this.axisLine&&t.drawLine(this._axrect.right,this._axrect.top,this._axrect.right,this._axrect.bottom,a)}else{if(this._title){n=new wijmo_1.Point(this._axrect.right-.5*this._szTitle.height,this._axrect.top+.5*this._axrect.height);FlexChartCore._renderRotatedText(t,this._title,n,1,1,n,90,r,this._groupClass)}this.axisLine&&t.drawLine(this._axrect.left,this._axrect.top,this._axrect.left,this._axrect.bottom,a)}else if(s){this.axisLine&&t.drawLine(this._axrect.left,this._axrect.top,this._axrect.right,this._axrect.top,a);this._title&&FlexChartCore._renderText(t,this._title,new wijmo_1.Point(this._axrect.left+.5*this._axrect.width,this._axrect.bottom),1,2,r)}else{this.axisLine&&t.drawLine(this._axrect.left,this._axrect.bottom,this._axrect.right,this._axrect.bottom,a);this._title&&FlexChartCore._renderText(t,this._title,new wijmo_1.Point(this._axrect.left+.5*this._axrect.width,this._axrect.top),1,0,r)}}_renderMinor(t,e,i){var s=this._getPosition(),r=this.axisType==AxisType.Y,a=s!=Position.Top&&s!=Position.Right;if(this._getLogBase()){if(this.minorUnit>0){var n=[];this._createLogarithmicLabels(this._actualMin,this._actualMax,this.minorUnit,n,null,!1);for(var h=[],l=0;l<n.length;l++){var o=n[l];-1==e.indexOf(o)&&o>this._actualMin&&h.push(o)}this._renderMinors(t,h,r,a)}}else this._createMinors(t,e,r,a,i)}_renderRotatedText(t,e,i,s,r,a,n,h,l,o,_){if(this.itemFormatter){var d=this._getFormattedItem(t,e,i,s,l);if(d){i=d.text;l=d.cls}else i=null}FlexChartCore._renderRotatedText(t,i,s,r,a,n,h,l,o,_)}_getFormattedItem(t,e,i,s,r,a=!1){if(this.itemFormatter){let n=s.clone();this._plotrect&&(this.axisType==AxisType.X?this.position==Position.Top?n.y=this._plotrect.top:n.y=this._plotrect.bottom:this.position==Position.Right?n.x=this._plotrect.right:n.x=this._plotrect.left);let h={val:e,text:i,pos:n,cls:r};a&&(t.readOnly=!0);h=this.itemFormatter(t,h);a&&(t.readOnly=!1);return h}}_renderLabelsAndTicks(t,e,i,s,r,a,n,h,l){var o=this._getPosition(),_=!1,d=this.axisType==AxisType.Y,c=o!=Position.Top&&o!=Position.Right,u=this.labelPadding||5,g=this._TICK_WIDTH,m=this._getLabelAlign(d),f=FlexChartCore._CSS_LABEL,p=FlexChartCore._CSS_GRIDLINE,x=FlexChartCore._CSS_TICK,w=FlexChartCore._FG,v=FlexChartCore._FG,b=this._GRIDLINE_WIDTH,y=i!=this._actualMin&&this.majorGrid;if(d){var S=this.convert(i);if(y){t.stroke=w;t.strokeWidth=b;t.drawLine(this._plotrect.left,S,this._plotrect.right,S,p)}t.stroke=v;t.strokeWidth=g;if(c){if(n){_=!0;var C=new wijmo_1.Point(this._axrect.right-l-this._TICK_LABEL_DISTANCE-u,S);r>0?90==r?this._renderRotatedText(t,i,s,C,1,0,C,r,f,this._groupClass):this._renderRotatedText(t,i,s,C,2,1,C,r,f,this._groupClass):r<0?-90==r?this._renderRotatedText(t,i,s,C,1,2,C,r,f,this._groupClass):this._renderRotatedText(t,i,s,C,2,1,C,r,f,this._groupClass):_=this._renderLabel(t,i,s,C,2,m,f)}a!=TickMark.None&&_&&t.drawLine(this._axrect.right-h,S,this._axrect.right-l,S,x)}else{if(n){_=!0;C=new wijmo_1.Point(this._axrect.left+l+this._TICK_LABEL_DISTANCE+u,S);r>0?90==r?this._renderRotatedText(t,i,s,C,1,2,C,r,f,this._groupClass):this._renderRotatedText(t,i,s,C,0,1,C,r,f,this._groupClass):r<0?-90==r?this._renderRotatedText(t,i,s,C,1,0,C,r,f,this._groupClass):this._renderRotatedText(t,i,s,C,0,1,C,r,f,this._groupClass):_=this._renderLabel(t,i,s,C,0,m,f)}a!=TickMark.None&&_&&t.drawLine(this._axrect.left+h,S,this._axrect.left+l,S,x)}}else{var T=this.convert(i);if(y&&n){t.stroke=w;t.strokeWidth=b;t.drawLine(T,this._plotrect.top,T,this._plotrect.bottom,p)}this.overlappingLabels==OverlappingLabels.Auto&&this._xCross(T)&&(n=!1);t.stroke=v;t.strokeWidth=g;if(c){if(n){C=new wijmo_1.Point(T,this._axrect.top+l+u);_=0!=r?this._renderRotatedLabel(t,i,s,C,m,r,f,c):this._renderLabel(t,i,s,C,m,0,f)}if(a!=TickMark.None&&_){T=this.convert(i);t.drawLine(T,this._axrect.top+h,T,this._axrect.top+l,x)}}else{if(n){C=new wijmo_1.Point(T,this._axrect.bottom-l-u);_=0!=r?this._renderRotatedLabel(t,i,s,C,m,r,f,c):this._renderLabel(t,i,s,C,m,2,f)}if(a!=TickMark.None&&_){T=this.convert(i);t.drawLine(T,this._axrect.bottom-h,T,this._axrect.bottom-l,x)}}}return _}_xCross(t){for(var e=this._rects.length,i=0;i<e;i++){var s=this._rects[i];if(t>=s.left&&t<=s.right)return!0}return!1}_createMinors(t,e,i,s,r){if(e){for(var a=this.majorUnit?this._isTimeAxis?24*this.majorUnit*3600*1e3:this.majorUnit:e.length>1?e[1]-e[0]:e[0],n=wijmo_1.isNumber(this.minorUnit)?this._isTimeAxis?24*this.minorUnit*3600*1e3:this.minorUnit:.5*a,h=[],l=e[0];l>this._actualMin&&h.length<Axis.MAX_MINOR;l-=n)-1==e.indexOf(l)&&h.push(l);for(l=e[0]+n;l<this._actualMax&&h.length<Axis.MAX_MINOR;l+=n)-1==e.indexOf(l)?h.push(l):r&&this.majorUnit&&l%this.majorUnit!=0&&h.push(l);this._renderMinors(t,h,i,s)}}_renderMinors(t,e,i,s){var r=this._TICK_HEIGHT,a=this._TICK_WIDTH,n=this._TICK_OVERLAP,h=FlexChartCore._FG,l=this.minorTickMarks,o=!0;this._vals.minor=e;l==TickMark.Outside?n=1:l==TickMark.Inside?n=-1:l==TickMark.Cross?n=0:o=!1;for(var _=.5*(n-1)*r,d=.5*(1+n)*r,c=e?e.length:0,u=this.minorGrid,g=this._plotrect,m=this._GRIDLINE_WIDTH,f=FlexChartCore._FG,p=FlexChartCore._CSS_GRIDLINE_MINOR,x=FlexChartCore._CSS_TICK_MINOR,w=0;w<c;w++)if(e[w]>=this.actualMin&&e[w]<=this.actualMax)if(i){var v=this.convert(e[w]);if(o){t.stroke=h;t.strokeWidth=a;s?t.drawLine(this._axrect.right-_,v,this._axrect.right-d,v,x):t.drawLine(this._axrect.left+_,v,this._axrect.left+d,v,x)}if(u){t.stroke=f;t.strokeWidth=m;t.drawLine(g.left,v,g.right,v,p)}}else{var b=this.convert(e[w]);if(o){t.stroke=h;t.strokeWidth=a;s?t.drawLine(b,this._axrect.top+_,b,this._axrect.top+d,x):t.drawLine(b,this._axrect.bottom-_,b,this._axrect.bottom-d,x)}if(u){t.stroke=f;t.strokeWidth=m;t.drawLine(b,g.top,b,g.bottom,p)}}}_renderLabel(t,e,i,s,r,a,n){var h=!1;if(this.itemFormatter){var l=this._getFormattedItem(t,e,i,s,n);if(l){i=l.text;n=l.cls}else i=null}if(i){var o=this._rects,_=this.overlappingLabels==OverlappingLabels.Auto&&!wijmo_1.isNumber(this._actualAngle),d=FlexChartCore._renderText(t,i,s,r,a,n,this._groupClass,null,(function(t){if(_)for(var e=o.length,i=0;i<e;i++)if(FlexChartCore._intersects(o[i],t))return!1;return!0}));if(d){d.left+=4;d.width+=8;o.push(d);h=!0}}return h}_renderRotatedLabel(t,e,i,s,r,a,n,h){if(this.itemFormatter){var l=this._getFormattedItem(t,e,i,s,n);if(l){i=l.text;n=l.cls}else i=null}if(i){var o=t.measureString(i,n,this._groupClass),_=.5*o.height,d=.5*o.width*Math.abs(Math.sin(a*Math.PI/180)),c=.5*o.width,u=.5*(o.width*Math.abs(Math.cos(a*Math.PI/180))+o.height*Math.abs(Math.sin(a*Math.PI/180))),g=new wijmo_1.Point(s.x,s.y),m=new wijmo_1.Point(s.x,s.y);this.labelAlign||(r=90==a||-90==a?1:h?a>0?0:2:a>0?2:0);if(h){s.y+=_+d;g.y+=_+d-.5*o.height}else{s.y-=_+d-o.height;g.y-=_+d-.5*o.height}var f=0;if(2===r){g.x-=u;s.x-=c+u;f=g.x+u-o.height-2}else if(0===r){g.x+=u;s.x-=c-u;f=g.x-u}else{s.x-=c;f=g.x-o.height/2}var p=new wijmo_1.Rect(f,m.y,o.height+2,o.width),x=this._rects;if(this.overlappingLabels==OverlappingLabels.Auto)for(var w=x.length,v=0;v<w;v++)if(FlexChartCore._intersects(x[v],p))return!1;FlexChartCore._renderRotatedText(t,i,s,0,2,g,a,n,this._groupClass);this._rects.push(p);return!0}return!1}_getLabelAlign(t){var e=1;if(this.labelAlign){var i=this.labelAlign.toLowerCase();t?"top"==i?e=0:"bottom"==i&&(e=2):"left"==i?e=0:"right"==i&&(e=2)}return e}_addMinMaxLabels(t,e){if(this.labelMin){const i=this.actualMin;if(isFinite(i)){e.splice(0,0,this._formatValue(i));t.splice(0,0,i)}}if(this.labelMax){const i=this.actualMax;if(isFinite(i)){e.splice(0,0,this._formatValue(i));t.splice(0,0,i)}}}convert(t,e,i){var s=null==e?this._actualMax:e,r=null==i?this._actualMin:i;if(s==r||!this._axrect)return 0;var a=this._axrect.left,n=this._axrect.width,h=this._axrect.top,l=this._axrect.height;if(null!=this._customConvert){var o=this._customConvert(t,r,s);return this.axisType==AxisType.Y?h+o*l:a+o*n}if(this._getLogBase()){if(t<=0)return NaN;var _=Math.log(s/r);return this._reversed?this.axisType==AxisType.Y?h+Math.log(t/r)/_*l:a+n-Math.log(t/r)/_*n:this.axisType==AxisType.Y?h+l-Math.log(t/r)/_*l:a+Math.log(t/r)/_*n}return this._reversed?this.axisType==AxisType.Y?h+(t-r)/(s-r)*l:a+n-(t-r)/(s-r)*n:this.axisType==AxisType.Y?h+l-(t-r)/(s-r)*l:a+(t-r)/(s-r)*n}convertBack(t){if(this._actualMax==this._actualMin)return 0;var e=this._plotrect.left,i=this._plotrect.width,s=this._plotrect.top,r=this._plotrect.height,a=this._actualMax-this._actualMin,n=this._getLogBase();if(null!=this._customConvertBack)return this.axisType==AxisType.Y?this._customConvertBack((t-s)/r,this._actualMin,this._actualMax):this._customConvertBack((t-e)/i,this._actualMin,this._actualMax);if(n){var h=0;h=this._reversed?this.axisType==AxisType.Y?(t-s)/r:1-(t-e)/i:this.axisType==AxisType.Y?1-(t-s)/r:(t-e)/i;return Math.pow(n,(Math.log(this._actualMin)+(Math.log(this._actualMax)-Math.log(this._actualMin))*h)/Math.log(n))}return this._reversed?this.axisType==AxisType.Y?this._actualMin+(t-s)*a/r:this._actualMin+(e+i-t)*a/i:this.axisType==AxisType.Y?this._actualMax-(t-s)*a/r:this._actualMin+(t-e)*a/i}get axisType(){var t=this._chart;if(t){if(t.axisX==this)return AxisType.X;if(t.axisY==this)return AxisType.Y}return this._axisType}_getMinNum(){return this._actualMin}_getMaxNum(){return this._actualMax}_getTitleSize(){return this._szTitle?this._szTitle:new wijmo_1.Size}_invalidate(){this._chart&&this._chart.invalidate()}_cvCollectionChanged(t,e){this._invalidate()}_createLabels(t,e,i,s,r){for(var a=0;a<e;a++){var n=(t+i*a).toFixed(14),h=parseFloat(n),l=this._formatAxisValue(h);let e=r.indexOf(l);if(e>=0&&!wijmo_1.isNumber(this.majorUnit)&&!this._format){let t=parseFloat(l);Math.abs(t-h)<Math.abs(t-s[e])&&(s[e]=h)}else{s.push(h);r.push(l)}}}_createLogarithmicLabels(t,e,i,s,r,a){var n=this._getLogBase(),h=Math.log(n),l=Math.floor(Math.log(t)/h),o=Math.ceil(Math.log(e)/h),_=n,d=!0;if(i>0){d=!1;_=i}_<n&&(_=n);var c=(o-l+1)*n/_,u=1;if(a){var g=this._getPosition(),m=this._getAnnoNumber(g==Position.Left||g==Position.Right);c>m?u=Math.floor(c/m+1):d&&(c<=.2*m?_=.2*n:c<=.1*m&&(_=.1*n))}for(var f=l;f<=o;f+=u)if(d)for(var p=Math.pow(n,f),x=0;x*_<n-1;x++){if((w=p*(1+x*_))>=t&&w<=e)if(0==x){s.unshift(w);r&&r.unshift(this._formatValue(w))}else{s.push(w);r&&r.push(this._formatValue(w))}}else{var w;if((w=Math.pow(_,f))>=t&&w<=e){s.push(w);r&&r.push(this._formatValue(w))}}}_createTimeLabels(t,e,i,s){var r=this._actualMin,a=this._actualMax,n=new Date(r),h=new Date(a),l=this._format,o=this._getAnnoNumber(this._axisType==AxisType.Y);o>10&&(o=10);var _=.001*(this._actualMax-this._actualMin)/o,d=new _timeSpan(_*_timeSpan.TicksPerSecond),c=wijmo_1.isNumber(this._majorUnit)?_timeSpan.fromDays(this._majorUnit):_timeHelper.NiceTimeSpan(d,l);l||(this._tfmt=l=_timeHelper.GetTimeDefaultFormat(1e3*c.TotalSeconds,0));var u=c.Ticks,g=_timeHelper.RoundTime(r,c.TotalDays,!1);isFinite(g)&&(r=g);var m=_timeHelper.RoundTime(a,c.TotalDays,!0);isFinite(m)&&(a=m);var f=new Date(r);new Date(a);if(c.TotalDays>=365&&!wijmo_1.isNumber(this._majorUnit)){(f=new Date(n.getFullYear(),0,1))<n&&f.setFullYear(f.getFullYear()+1);var p=c.TotalDays/365;p-=p%1;for(var x=f;x<=h&&p;x.setFullYear(x.getFullYear()+p)){var w=x.valueOf();i.push(w);s.push(this._formatValue(w))}}else if(c.TotalDays>=30&&!wijmo_1.isNumber(this._majorUnit)){(f=new Date(n.getFullYear(),n.getMonth(),1))<n&&f.setMonth(f.getMonth()+1);var v=c.TotalDays/30;v-=v%1;for(x=f;x<=h;x.setMonth(x.getMonth()+v)){w=x.valueOf();i.push(w);s.push(this._formatValue(w))}}else{var b=1e3*u/_timeSpan.TicksPerSecond,y=(x=f,n.getTime()-x.getTime());y>b&&(x=new Date(x.getTime()+Math.floor(y/b)*b));for(;x<=h&&b;x=new Date(x.getTime()+b)){if((w=x.valueOf()+y)>=n.valueOf()){i.push(w);s.push(this._formatValue(w))}}}}_formatValue(t){if(this._isTimeAxis)return this._format?wijmo_1.Globalize.format(new Date(t),this._format):wijmo_1.Globalize.format(new Date(t),this._tfmt);if(this._format)return wijmo_1.Globalize.format(t,this._format);var e=t==Math.round(t)?"n0":"n";return wijmo_1.Globalize.format(t,e)}_hitTest(t){return this._groupsPanel?this._groupsPanel.hitTest(t):void 0}_formatAxisValue(t,e){if(this._isTimeAxis)return this._format?wijmo_1.Globalize.format(new Date(t),this._format):wijmo_1.Globalize.format(new Date(t),this._tfmt);if(this._format)return wijmo_1.Globalize.format(t,this._format);if(wijmo_1.isNumber(t)){let i=this._findFormat(t,e);return wijmo_1.Globalize.format(t,i)}return t}_findFormat(t,e){var i=t==Math.round(t)?"n0":"n";void 0!==e&&(i+=e.toString());if("n"==i){let s=t.toFixed(14),r=s.search(".");if(r>=0){e=1;for(let t=s.length-1;t>=r;t--)if("0"!=s[t]){e=t-r-1;break}i+=e.toString()}}return i}_calcMajorUnit(){var t=this._majorUnit;if(!wijmo_1.isNumber(t)){var e=this._actualMax-this._actualMin,i=this._nicePrecision(e),s=e/this._getAnnoNumber(this.axisType==AxisType.Y);(t=this._niceNumber(2*s,-i,!0))<s&&(t=this._niceNumber(s,1-i,!1));t<s&&(t=this._niceTickNumber(s))}return t}_getAnnoNumber(t){var e=t?this._annoSizeBase.height:this._annoSize.width,i=t?this._axrect.height:this._axrect.width;if(e>0&&i>0){var s=Math.floor(i/(e+6));s<=0&&(s=1);return s}return 10}_nicePrecision(t){if(!wijmo_1.isNumber(t)||t<=0)return 0;var e,i=Math.log(t)/Math.LN10;e=i>=0?Math.floor(i):Math.ceil(i);var s=t/Math.pow(10,e);if(s<3){e=1-e;(s=t/Math.pow(10,e))<3&&(e+=1)}return e}_niceTickNumber(t){if(0==t)return t;t<0&&(t=-t);var e=Math.log(t)/Math.LN10,i=Math.floor(e),s=t/Math.pow(10,i),r=10;s<=1?r=1:s<=2?r=2:s<=5&&(r=5);return r*Math.pow(10,i)}_niceNumber(t,e,i){if(0==t)return t;t<0&&(t=-t);var s=t/Math.pow(10,e),r=10;i?s<1.5?r=1:s<3?r=2:s<4.5?r=4:s<7&&(r=5):s<=1?r=1:s<=2?r=2:s<=5&&(r=5);return r*Math.pow(10,e)}get _uniqueId(){return this.__uniqueId}}Axis.MAX_MAJOR=1e3;Axis.MAX_MINOR=2e3;Axis._id=0;exports.Axis=Axis;class AxisCollection extends wijmo_1.ObservableArray{getAxis(t){var e=this.indexOf(t);return e>-1?this[e]:null}indexOf(t){for(var e=0;e<this.length;e++)if(this[e].name==t)return e;return-1}}exports.AxisCollection=AxisCollection;!function(t){t[t.tickf7=-7]="tickf7";t[t.tickf6=-6]="tickf6";t[t.tickf5=-5]="tickf5";t[t.tickf4=-4]="tickf4";t[t.tickf3=-3]="tickf3";t[t.tickf2=-2]="tickf2";t[t.tickf1=-1]="tickf1";t[t.second=1]="second";t[t.minute=60]="minute";t[t.hour=3600]="hour";t[t.day=86400]="day";t[t.week=604800]="week";t[t.month=2678400]="month";t[t.year=31536e3]="year";t[t.maxtime=Number.MAX_VALUE]="maxtime"}(_tmInc||(_tmInc={}));class _timeSpan{constructor(t){this.ticks=t}get Ticks(){return this.ticks}get TotalSeconds(){return this.ticks/1e7}get TotalDays(){return this.ticks/1e7/86400}static fromSeconds(t){return new _timeSpan(1e7*t)}static fromDays(t){return new _timeSpan(1e7*t*24*60*60)}}_timeSpan.TicksPerSecond=1e7;class _timeHelper{constructor(t){wijmo_1.isDate(t)?this.init(t):wijmo_1.isNumber(t)&&this.init(FlexChartCore._fromOADate(t))}init(t){this.year=t.getFullYear();this.month=t.getMonth();this.day=t.getDate();this.hour=t.getHours();this.minute=t.getMinutes();this.second=t.getSeconds()}getTimeAsDateTime(){if(this.hour>=24){this.hour-=24;this.day+=1}if(this.month<0){-1-this.day;this.month=1}else if(this.month>11){this.month-12;this.month=11}if(this.day<1){-1-this.day;this.day=1}else if(this.day>28&&1==this.month){this.day-28;this.day=28}else if(this.day>30&&(3==this.month||5==this.month||8==this.month||10==this.month)){this.day-30;this.day=30}else if(this.day>31){this.day-31;this.day=31}if(this.second>59){this.second-59;this.second=59}if(this.minute>59){this.minute-59;this.minute=59}return new Date(this.year,this.month,this.day,this.hour,this.minute,this.second)}getTimeAsDouble(){return this.getTimeAsDateTime().valueOf()}static tround(t,e,i){var s=t/e*e;s-=s%1;i&&s!=t&&(s+=e-=e%1);return s}static RoundTime(t,e,i){var s=24*e*60*60;if(s>0){var r=new _timeHelper(t);if(s<_tmInc.minute){r.second=this.tround(r.second,s,i);return r.getTimeAsDouble()}r.second=0;if(s<_tmInc.hour){s/=_tmInc.minute;r.minute=this.tround(r.minute,s,i);return r.getTimeAsDouble()}r.minute=0;if(s<_tmInc.day){s/=_tmInc.hour;r.hour=this.tround(r.hour,s,i);return r.getTimeAsDouble()}r.hour=0;if(s<_tmInc.month){s/=_tmInc.day;r.day=this.tround(r.day,s,i);return r.getTimeAsDouble()}r.day=1;if(s<_tmInc.year){s/=_tmInc.month;1!=r.month&&(r.month=this.tround(r.month,s,i));return r.getTimeAsDouble()}r.month=1;s/=_tmInc.year;r.year=this.tround(r.year,s,i);return r.getTimeAsDouble()}var a=t,n=a-s,h=n/e*e;i&&h!=n&&(h+=e);return a=s+h}static TimeSpanFromTmInc(t){var e=_timeSpan.fromSeconds(1);if(t!=_tmInc.maxtime)if(t>_tmInc.tickf1)e=_timeSpan.fromSeconds(t);else{var i=t,s=1;i+=7;for(;i>0;){s*=10;i--}e=new _timeSpan(s)}return e}static manualTimeInc(t){var e=_tmInc.second;if(null==t||0==t.length)return e;var i=t.indexOf("f");if(i>=0){var s=-1;if(i>0&&"%"==t.substr(i-1,1))s=-1;else for(var r=1;r<6&&!(i+r>=t.length);r++){if("f"!=t.substr(i+r,1))break;s--}e=s}else t.indexOf("s")>=0?e=_tmInc.second:t.indexOf("m")>=0?e=_tmInc.minute:t.indexOf("h")>=0||t.indexOf("H")?e=_tmInc.hour:t.indexOf("d")>=0?e=_tmInc.day:t.indexOf("M")>=0?e=_tmInc.month:t.indexOf("y")>=0&&(e=_tmInc.year);return e}static getNiceInc(t,e,i){for(var s=0;s<t.length;s++){var r=t[s]*i;if(e<=r)return r}return 0}static NiceTimeSpan(t,e){var i=_tmInc.second;null!=e&&e.length>0&&(i=_timeHelper.manualTimeInc(e));var s=0,r=0;if(i<_tmInc.second&&t.TotalSeconds<10){s=t.Ticks;r=_timeHelper.TimeSpanFromTmInc(i).Ticks;for(;s>10*r;)r*=10;var a=r;s>a&&(a*=2);s>a&&(a=5*r);s>a&&(a=10*r);return new _timeSpan(a)}if(0==(s=Math.ceil(t.TotalSeconds)))return _timeHelper.TimeSpanFromTmInc(i);r=1;if(i<_tmInc.minute){if(s<_tmInc.minute&&0!=(r=_timeHelper.getNiceInc([1,2,5,10,15,30],s,i)))return _timeSpan.fromSeconds(r);i=_tmInc.minute}if(i<_tmInc.hour){if(s<_tmInc.hour&&0!=(r=_timeHelper.getNiceInc([1,2,5,10,15,30],s,i)))return _timeSpan.fromSeconds(r);i=_tmInc.hour}if(i<_tmInc.day){if(s<_tmInc.day&&0!=(r=_timeHelper.getNiceInc([1,3,6,12],s,i)))return _timeSpan.fromSeconds(r);i=_tmInc.day}if(i<_tmInc.month){if(s<_tmInc.month&&0!=(r=_timeHelper.getNiceInc([1,2,7,14],s,i)))return _timeSpan.fromSeconds(r);i=_tmInc.month}if(i<_tmInc.year){if(s<_tmInc.year&&0!=(r=_timeHelper.getNiceInc([1,2,3,4,6],s,i)))return _timeSpan.fromSeconds(r);i=_tmInc.year}s<(r=100*_tmInc.year)&&0==(r=_timeHelper.getNiceInc([1,2,5,10,20,50],s,i))&&(r=100*_tmInc.year);return _timeSpan.fromSeconds(r)}static NiceTimeUnit(t,e){var i=_timeSpan.fromDays(t);return(i=_timeHelper.NiceTimeSpan(i,e)).TotalDays}static GetTimeDefaultFormat(t,e){if(!wijmo_1.isNumber(t)||!wijmo_1.isNumber(e))return"";var i="s",s=_timeSpan.fromSeconds(.001*(t-e)),r=s.TotalSeconds;if(r>=_tmInc.year)i="yyyy";else if(r>=_tmInc.month)i="MMM yyyy";else if(r>=_tmInc.day)i="MMM d";else if(r>=_tmInc.hour)i="ddd H:mm";else if(r>=.5*_tmInc.hour)i="H:mm";else if(r>=1)i="H:mm:ss";else if(r>0){var a=s.Ticks;i="s.";for(;a<_timeSpan.TicksPerSecond;){a*=10;i+="f"}}return i}}_timeHelper.secInYear=86400;class _AxisLabel{constructor(t,e,i){this._start=e-.5;this._end=e+i-.5;this._value=e+.5*(i-1);this._label=t}get value(){return this._value}get label(){return this._label}get start(){return this._start}get end(){return this._end}set rect(t){this._rect=t}get rect(){return this._rect}}exports._AxisLabel=_AxisLabel;class _AxisGroup{constructor(t,e){this._labels=[];this._index=0;this._size=new wijmo_1.Size;this._level=0;this._level=t;this._last=e}get labels(){return this._labels}set index(t){this._index=t}get index(){return this._index}set height(t){this._size.height=t}get height(){return this._size.height}set width(t){this._size.width=t}get width(){return this._size.width}get level(){return this._level}getSize(t,e,i){this._size=new wijmo_1.Size;this.labels.forEach(s=>{const r=t.measureString(s.label,e,i);this._size.width=Math.max(this._size.width,r.width);this._size.height=Math.max(this._size.height,r.height)});return this._size}render(t,e,i,s,r){const a=e._getPosition(),n=e.axisType===AxisType.X;this.labels.forEach(h=>{let l,o=h.label,_=!1;const d=n?Math.abs(e.convert(h.end)-e.convert(h.start)):this.width,c=t.measureString(o,s,r);if(c.width>d){o=this._trimText(o,c.width,d);_=!0}switch(a){case Position.Bottom:l=FlexChartCore._renderText(t,o,new wijmo_1.Point(e.convert(h.value),i),1,2,s,r);break;case Position.Top:l=FlexChartCore._renderText(t,o,new wijmo_1.Point(e.convert(h.value),i),1,0,s,r);break;case Position.Left:l=FlexChartCore._renderText(t,o,new wijmo_1.Point(i+this._size.width,e.convert(h.value)),2,1,s,r);break;case Position.Right:l=FlexChartCore._renderText(t,o,new wijmo_1.Point(i-this._size.width,e.convert(h.value)),0,1,s,r)}h.rect=_?l:void 0});a===Position.Bottom||a===Position.Top?this.renderLinesX(t,e,i):this.renderLinesY(t,e,i)}hitTest(t){let e;for(let i=0;i<this.labels.length;i++){const s=this.labels[i];if(s.rect&&s.rect.contains(t)){e=s;break}}return e}renderLinesX(t,e,i){const s=e.groupsOptions.display===AxisGroupsDisplay.ShowGrid,r=e._getPosition();let a=4,n=r===Position.Bottom?1:-1,h=i-n*(this.height+a);a*=n;if(s){let s=e.convert(e.actualMin),r=e.convert(e.actualMax);this.drawLine(t,s,i+a,r,i+a);this.drawLine(t,s,h,r,h);let l=e.convert(this.labels[0].start),o=0===this.level?1===n?e._axrect.top:e._axrect.bottom:h;this.drawLine(t,l,i+a,l,o);this.labels.forEach(s=>{let r=new wijmo_1.Point(e.convert(s.end),i);this._last?this.drawLine(t,r.x,r.y+a,r.x,1===n?e._axrect.top:e._axrect.bottom):this.drawLine(t,r.x,r.y+a,r.x,o)})}else this.labels.forEach(i=>{let s=e.convert(i.start)+Math.abs(a),r=e.convert(i.end)-Math.abs(a);this.drawLine(t,s,h,r,h);if(e.labels||!this._last){this.drawLine(t,s,h,s,h-2*a);this.drawLine(t,r,h,r,h-2*a)}let n=e.convert(i.value);this.drawLine(t,n,h,n,h+a)})}renderLinesY(t,e,i){const s=e.groupsOptions.display===AxisGroupsDisplay.ShowGrid,r=e._getPosition();let a=4,n=r===Position.Left?-1:1,h=i-n*(this.width+a);a*=n;if(s){let s=e.convert(e.actualMin),r=e.convert(e.actualMax);this.drawLine(t,i+a,s,i+a,r);this.drawLine(t,h,s,h,r);let l=e.convert(this.labels[0].start),o=0===this.level?1===n?e._axrect.left:e._axrect.right:h;this.drawLine(t,i+a,l,o,l);this.labels.forEach(s=>{let r=e.convert(s.end);this._last?this.drawLine(t,i+a,r,1===n?e._axrect.left:e._axrect.right,r):this.drawLine(t,i+a,r,o,r)})}else this.labels.forEach(i=>{let s=e.convert(i.start)-Math.abs(a),r=e.convert(i.end)+Math.abs(a);this.drawLine(t,h,s,h,r);this.drawLine(t,h,s,h-2*a,s);this.drawLine(t,h,r,h-2*a,r);let n=e.convert(i.value);this.drawLine(t,h,n,h+a,n)})}drawLine(t,e,i,s,r){t.drawLine(e,i,s,r,FlexChartCore._CSS_LINE)}_trimText(t,e,i){var s="",r=t.length,a=Math.floor((1-(e-i)/e)*r);t.length>0&&(s=t[0]+(a>1?t.substring(1,a-1)+"..":""));return s}}class _AxisGroups{constructor(t){this._groups=[];this._margin=8;this._axis=t}get groups(){return this._groups}get axis(){return this._axis}createGroups(){this._groups=[];const t=this.axis._chart.collectionView;t&&t.groups&&t.groups.length>0&&t.groups.forEach(t=>this.createGroup(t,0))}createGroup(t,e){this.groups[e]||(this.groups[e]=new _AxisGroup(e,t.isBottomLevel));let i=this.groups[e],s=t.items;i.labels.push(new _AxisLabel(t.name,i.index,s.length));i.index+=s.length;t.groups.forEach(t=>this.createGroup(t,e+1))}layoutGroups(t){this.groups.forEach(e=>{e.width*=t})}getHeight(t){const e=this._axis._getPosition();let i=0;e===Position.Bottom||e===Position.Top?this.groups.forEach(e=>i+=this._margin+e.getSize(t,FlexChartCore._CSS_LABEL,this._axis._groupClass).height):this.groups.forEach(e=>i+=this._margin+e.getSize(t,FlexChartCore._CSS_LABEL,this._axis._groupClass).width);if(i>0&&this._axis.labels){let t=this.groups.length;i+=this._margin*t}this._height=i;return i}layout(){const t=this._axis,e=t._axrect;if(t.axisType===AxisType.Y){let i=(t.labels?t._annoSize.width+t._TICK_LABEL_DISTANCE+12:4)+t._getTitleSize().height,s=e.width-i;if(s<this._height){const t=this._margin*this._groups.length;this.layoutGroups((s-t)/(this._height-t));this._height=s}}}render(t){const e=this._axis._getPosition(),i=this._axis._getTitleSize();if(e===Position.Bottom){let e=this.axis._axrect.bottom-i.height-this._margin;this.groups.forEach(i=>{i.render(t,this.axis,e,FlexChartCore._CSS_LABEL,this._axis._groupClass);e-=i.height+this._margin})}else if(e===Position.Top){let e=this.axis._axrect.top+i.height+this._margin;this.groups.forEach(i=>{i.render(t,this.axis,e,FlexChartCore._CSS_LABEL,this._axis._groupClass);e+=i.height+this._margin})}else if(e===Position.Left){let e=this.axis._axrect.left+i.height+this._margin;this.groups.forEach(i=>{i.render(t,this.axis,e,FlexChartCore._CSS_LABEL,this._axis._groupClass);e+=i.width+this._margin})}else if(e===Position.Right){let e=this.axis._axrect.right-i.height-this._margin;this.groups.forEach(i=>{i.render(t,this.axis,e,FlexChartCore._CSS_LABEL,this._axis._groupClass);e-=i.width+this._margin})}}hitTest(t){let e;for(let i=0;i<this._groups.length;i++){const s=this._groups[i].hitTest(t);if(s){e=s;break}}return e}}exports._AxisGroups=_AxisGroups;class _DataPoint{constructor(t,e,i,s){this._seriesIndex=t;this._pointIndex=e;this._dataX=i;this._dataY=s}get seriesIndex(){return this._seriesIndex}get pointIndex(){return this._pointIndex}get dataX(){return this._dataX}set dataX(t){t!==this._dataX&&(this._dataX=t)}get dataY(){return this._dataY}set dataY(t){t!==this._dataY&&(this._dataY=t)}}exports._DataPoint=_DataPoint;!function(t){t[t.X=0]="X";t[t.Y=1]="Y";t[t.XY=2]="XY"}(_MeasureOption=exports._MeasureOption||(exports._MeasureOption={}));class _RectArea{constructor(t){this._rect=t}get rect(){return this._rect}contains(t){var e=this._rect;return t.x>=e.left&&t.x<=e.right&&t.y>=e.top&&t.y<=e.bottom}pointDistance(t,e,i){var s=e.x-t.x,r=e.y-t.y;return i==_MeasureOption.X?Math.abs(s):i==_MeasureOption.Y?Math.abs(r):Math.sqrt(s*s+r*r)}distance(t){var e=_MeasureOption.XY;isNaN(t.x)||null===t.x?e=_MeasureOption.Y:(isNaN(t.y)||null===t.y)&&(e=_MeasureOption.X);var i=this._rect;return t.x<i.left?t.y<i.top?this.pointDistance(t,new wijmo_1.Point(i.left,i.top),e):t.y>i.bottom?this.pointDistance(t,new wijmo_1.Point(i.left,i.bottom),e):e==_MeasureOption.Y?0:i.left-t.x:t.x>i.right?t.y<i.top?this.pointDistance(t,new wijmo_1.Point(i.right,i.top),e):t.y>i.bottom?this.pointDistance(t,new wijmo_1.Point(i.right,i.bottom),e):e==_MeasureOption.Y?0:t.x-i.right:e==_MeasureOption.X?0:t.y<i.top?i.top-t.y:t.y>i.bottom?t.y-i.bottom:0}}exports._RectArea=_RectArea;class _CircleArea{constructor(t,e){this._center=t;this.setRadius(e)}setRadius(t){this._rad=t;this._rad2=t*t}get center(){return this._center}contains(t){var e=this._center.x-t.x,i=this._center.y-t.y;return e*e+i*i<=this._rad2}distance(t){var e=isNaN(t.x)?0:this._center.x-t.x,i=isNaN(t.y)?0:this._center.y-t.y,s=e*e+i*i;return s<=this._rad2?0:Math.sqrt(s)-this._rad}}exports._CircleArea=_CircleArea;class _LinesArea{constructor(t,e){this._x=[];this._y=[];this._x=t;this._y=e}contains(t){return!1}distance(t){for(var e=NaN,i=0;i<this._x.length-1;i++){var s=FlexChartCore._dist(t,new wijmo_1.Point(this._x[i],this._y[i]),new wijmo_1.Point(this._x[i+1],this._y[i+1]));(isNaN(e)||s<e)&&(e=s)}return e}}exports._LinesArea=_LinesArea;class _HitResult{}exports._HitResult=_HitResult;class _HitTester{constructor(t){this._map={};this._chart=t}add(t,e){if(this._map[e]){t.tag||(t.tag=new _DataPoint(e,NaN,NaN,NaN));this._map[e].push(t)}}clear(){this._map={};for(var t=this._chart.series,e=0;e<t.length;e++)t[e].hitTest===Series.prototype.hitTest&&(this._map[e]=new Array)}hitTest(t,e=!1){for(var i=null,s=Number.MAX_VALUE,r=this._chart.series.length-1;r>=0;r--){var a=this._map[r];if(a){for(var n=a.length-1;n>=0;n--){var h=a[n];if(!wijmo_1.tryCast(h,_LinesArea)||e){var l=h.distance(t);if(l<s){i=h;if(0==(s=l))break}}}if(0==s)break}}if(i){var o=new _HitResult;o.area=i;o.distance=s;return o}return null}hitTestSeries(t,e){var i=null,s=Number.MAX_VALUE,r=this._map[e];if(r)for(var a=r.length-1;a>=0;a--){var n=r[a],h=n.distance(t);if(h<s){i=n;if(0==(s=h))break}}if(i){var l=new _HitResult;l.area=i;l.distance=s;return l}return null}}exports._HitTester=_HitTester;!function(t){t[t.PlotArea=0]="PlotArea";t[t.AxisX=1]="AxisX";t[t.AxisY=2]="AxisY";t[t.ChartArea=3]="ChartArea";t[t.Legend=4]="Legend";t[t.Header=5]="Header";t[t.Footer=6]="Footer";t[t.Series=7]="Series";t[t.SeriesSymbol=8]="SeriesSymbol";t[t.DataLabel=9]="DataLabel";t[t.None=10]="None"}(ChartElement=exports.ChartElement||(exports.ChartElement={}));class HitTestInfo{constructor(t,e,i){this._pointIndex=null;this._chartElement=ChartElement.None;this._chart=t;this._pt=e;this._chartElement=i}get chart(){return this._chart}get point(){return this._pt}get series(){return this._series}get pointIndex(){return this._pointIndex}get chartElement(){return this._chartElement}get distance(){return this._dist}get item(){if(null==this._item&&null!==this.pointIndex)if(null!=this.series)this._item=this.series._getItem(this.pointIndex);else{var t=this._chart._getHitTestItem(this.pointIndex);t&&(this._item=t)}return this._item}get x(){void 0===this._x&&(this._x=this._getValue(1,!1));return this._x}get y(){void 0===this._y&&(this._y=this._getValue(0,!1));return this._y}get value(){var t=this._chart._getHitTestValue(this.pointIndex,this._groupIndex);return null!=t?t:this.series&&null!=this.series._getValue?this.series._getValue(this.pointIndex):this.y}get name(){if(void 0===this._name){var t=this._chart._getHitTestLabel(this.pointIndex);return null==t?this.series.name:t.toString()}return this._name}get groupIndex(){return this._groupIndex}get _xfmt(){void 0===this.__xfmt&&(this.__xfmt=this._getValue(1,!0));return this.__xfmt}get _yfmt(){void 0===this.__yfmt&&(this.__yfmt=this._getValue(0,!0));return this.__yfmt}_setData(t,e){this._series=t;this._pointIndex=e}_setDataGroup(t,e){this._groupIndex=t;this._pointIndex=e}_setName(t){this._name=t;this._dist=0}_setDataPoint(t){if(t=wijmo_1.asType(t,_DataPoint,!0)){this._pointIndex=t.pointIndex;var e=wijmo_1.asType(this._chart,FlexChartCore,!0),i=t.seriesIndex;null!==i&&i>=0&&i<e.series.length&&(this._series=e.series[i]);null!=t.item&&(this._item=t.item);null!=t.x&&(this._x=t.x);null!=t.y&&(this._y=t.y);null!=t.xfmt&&(this.__xfmt=t.xfmt);null!=t.yfmt&&(this.__yfmt=t.yfmt);null!=t.name&&(this._name=t.name)}}_getValueFmt(){let t=this.value;if(null!=t){if(null==this.series){var e=t==Math.round(t)?"{val:n0}":"{val:n}";return wijmo_1.format(e,{val:t})}t=this._chart._isRotated()?this.ax._formatValue(t):this.ay._formatValue(t)}return t}_getValue(t,e){var i=this._chart._getHitTestValue(this.pointIndex,this.groupIndex);if(null!==i)return i;var s=null,r=this._chart,a=this.pointIndex,n=r._isRotated();if(null!==this.series&&null!==a){var h=this.series.getValues(t),l=this.series.getDataType(t);if(h&&this.pointIndex<h.length){s=h[this.pointIndex];l!=wijmo_1.DataType.Date||e||(s=new Date(s))}else if(1==t)if(r._xlabels&&r._xlabels.length>0&&a<r._xlabels.length)s=r._xlabels[a];else if(r._xvals&&a<r._xvals.length){s=r._xvals[a];r._xDataType!=wijmo_1.DataType.Date||e||(s=new Date(s))}}null!==s&&e&&(n?0==t?s=this.ax._formatValue(s):1==t&&(s=this.ay._formatValue(s)):0==t?s=this.ay._formatValue(s):1==t&&(s=this.ax._formatValue(s)));return s}get ax(){return this.series.axisX?this.series.axisX:this._chart.axisX}get ay(){return this.series.axisY?this.series.axisY:this._chart.axisY}}exports.HitTestInfo=HitTestInfo;!function(t){t[t.Visible=0]="Visible";t[t.Plot=1]="Plot";t[t.Legend=2]="Legend";t[t.Hidden=3]="Hidden"}(SeriesVisibility=exports.SeriesVisibility||(exports.SeriesVisibility={}));!function(t){t[t.Dot=0]="Dot";t[t.Box=1]="Box"}(Marker=exports.Marker||(exports.Marker={}));class DataArray{}exports.DataArray=DataArray;class SeriesEventArgs extends wijmo_1.EventArgs{constructor(t){super();this._series=wijmo_1.asType(t,SeriesBase)}get series(){return this._series}}exports.SeriesEventArgs=SeriesEventArgs;class SeriesBase{constructor(t){this._altStyle=null;this._symbolMarker=Marker.Dot;this._visibility=SeriesVisibility.Visible;this._interpolateNulls=null;this._cache={};this.rendering=new wijmo_1.Event;this.rendered=new wijmo_1.Event;this.initialize(t)}get interpolateNulls(){return null==this._interpolateNulls?this._chart&&this._chart.interpolateNulls:this._interpolateNulls}set interpolateNulls(t){if(t!=this._interpolateNulls){this._interpolateNulls=wijmo_1.asBoolean(t,!0);this._invalidate()}}get style(){return this._style}set style(t){if(t!=this._style){this._style=t;this._invalidate()}}get altStyle(){return this._altStyle}set altStyle(t){if(t!=this._altStyle){this._altStyle=t;this._invalidate()}}get symbolStyle(){return this._symbolStyle}set symbolStyle(t){if(t!=this._symbolStyle){this._symbolStyle=t;this._invalidate()}}get symbolSize(){return this._symbolSize}set symbolSize(t){if(t!=this._symbolSize){this._symbolSize=wijmo_1.asNumber(t,!0,!0);this._invalidate()}}get symbolMarker(){return this._symbolMarker}set symbolMarker(t){if((t=wijmo_1.asEnum(t,Marker,!0))!=this._symbolMarker){this._symbolMarker=t;this._invalidate()}}get binding(){return this._binding?this._binding:this._chart?this._chart.binding:null}set binding(t){if(t!=this._binding){this._binding=wijmo_1.asString(t,!0);this._clearValues();this._invalidate()}}get bindingX(){return this._bindingX?this._bindingX:this._chart?this._chart.bindingX:null}set bindingX(t){if(t!=this._bindingX){this._bindingX=wijmo_1.asString(t,!0);this._clearValues();this._invalidate()}}get name(){return this._name}set name(t){this._name=t}get itemsSource(){return this._itemsSource}set itemsSource(t){if(t!=this._itemsSource){if(this._cv){this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._itemsSource=t;this._cv=wijmo_1.asCollectionView(t);if(null!=this._cv){this._cv.currentChanged.addHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)}this._clearValues();this._itemsSource=t;this._invalidate()}}get collectionView(){return this._cv?this._cv:this._chart?this._chart.collectionView:null}get chart(){return this._chart}get hostElement(){return this._hostElement}get legendElement(){return this._legendElement}get cssClass(){return this._cssClass}set cssClass(t){this._cssClass=wijmo_1.asString(t,!0)}get visibility(){return this._visibility}set visibility(t){if((t=wijmo_1.asEnum(t,SeriesVisibility))!=this._visibility){this._visibility=t;this._clearValues();this._invalidate();this._chart&&this._chart.onSeriesVisibilityChanged(new SeriesEventArgs(this))}}get tooltipContent(){return this._tooltipContent}set tooltipContent(t){t!=this._tooltipContent&&(this._tooltipContent=t)}get itemFormatter(){return this._itemFormatter}set itemFormatter(t){if(t!=this._itemFormatter){this._itemFormatter=wijmo_1.asFunction(t);this._invalidate()}}hitTest(t,e){wijmo_1.isNumber(t)&&wijmo_1.isNumber(e)?t=new wijmo_1.Point(t,e):t instanceof MouseEvent&&(t=new wijmo_1.Point(t.pageX,t.pageY));wijmo_1.asType(t,wijmo_1.Point);return this._chart?this._chart._hitTestSeries(t,this._chart.series.indexOf(this)):null}getPlotElement(t){if(this.hostElement&&t<this._pointIndexes.length){var e=this._pointIndexes[t];if(e<this.hostElement.childNodes.length)return this.hostElement.childNodes[e]}return null}get axisX(){return this._axisX}set axisX(t){if(t!=this._axisX){this._axisX=wijmo_1.asType(t,Axis,!0);if(this._axisX){var e=this._axisX._chart=this._chart;e&&-1==e.axes.indexOf(this._axisX)&&e.axes.push(this._axisX)}this._invalidate()}}get axisY(){return this._axisY}set axisY(t){if(t!=this._axisY){this._axisY=wijmo_1.asType(t,Axis,!0);if(this._axisY){var e=this._axisY._chart=this._chart;e&&-1==e.axes.indexOf(this._axisY)&&e.axes.push(this._axisY)}this._invalidate()}}initialize(t){wijmo_1.copy(this,t)}pointToData(t){wijmo_1.asType(t,wijmo_1.Point);(t=t.clone()).x=this._getAxisX().convertBack(t.x);t.y=this._getAxisY().convertBack(t.y);return t}dataToPoint(t){wijmo_1.asType(t,wijmo_1.Point);(t=t.clone()).x=this._getAxisX().convert(t.x);t.y=this._getAxisY().convert(t.y);return t}onRendering(t,e,i){var s=new SeriesRenderingEventArgs(t,e,i);this.rendering.raise(this,s);return s.cancel}onRendered(t){this.rendered.raise(this,new RenderEventArgs(t))}get _chart(){return this.__chart}set _chart(t){t!==this.__chart&&(this.__chart=t)}_getSymbolSize(){return null!=this.symbolSize?this.symbolSize:this.chart.symbolSize}get _plotter(){this.chart&&!this.__plotter&&(this.__plotter=this.chart._getPlotter(this));return this.__plotter}set _plotter(t){t!=this.__plotter&&(this.__plotter=t)}getDataType(t){return 0==t?this._valueDataType:1==t?this._xvalueDataType:null}getValues(t){if(0==t){if(null==this._values){this._valueDataType=null;if(null!=this._cv){var e=this._bindValues(this._cv.items,this._getBinding(0));this._values=e.values;this._valueDataType=e.dataType}else if(null!=this.binding&&null!=this._chart&&null!=this._chart.collectionView){e=this._bindValues(this._chart.collectionView.items,this._getBinding(0));this._values=e.values;this._valueDataType=e.dataType}}return this._values}if(1==t){if(null==this._xvalues){this._xvalueDataType=null;if(null!=this.bindingX)if(null!=this._cv){e=this._bindValues(this._cv.items,this.bindingX,!0);this._xvalueDataType=e.dataType;this._xvalues=e.values}else{if(null==this._bindingX)return null;if(null!=this._chart&&null!=this._chart.collectionView){e=this._bindValues(this._chart.collectionView.items,this.bindingX,!0);this._xvalueDataType=e.dataType;this._xvalues=e.values}}}return this._xvalues}return null}drawLegendItem(t,e,i){var s=this._getChartType();null==s&&(s=this._chart._getChartType());let r=this._getLegendStyle(this.style);s===ChartType.Funnel?this._drawFunnelLegendItem(t,e,i,r,this.symbolStyle):this._drawLegendItem(t,e,s,this.name,r,this.symbolStyle)}_getLegendStyle(t){if(!t)return;let e={};t.fill&&(e.fill=t.fill);t.stroke&&(e.stroke=t.stroke);return e}measureLegendItem(t,e){var i=this._getChartType();null==i&&(i=this._chart._getChartType());return i===ChartType.Funnel?this._measureLegendItem(t,this._getFunnelLegendName(e)):this._measureLegendItem(t,this.name)}legendItemLength(){var t=this._getChartType();null==t&&(t=this._chart._getChartType());return t===ChartType.Funnel?this._chart._xlabels&&this._chart._xlabels.length?this._chart._xlabels.length:this._chart._xvals&&this._chart._xvals.length?this._chart._xvals.length:1:1}getDataRect(t,e){return null}_getChartType(){return this._chartType}_clearValues(){this._values=null;this._xvalues=null;this.__plotter=null;this._cache={}}_getBinding(t){var e=this.binding;if(e){var i=this.chart?this.chart._bindingSeparator:",";if(i){var s=e.split(i);s&&s.length>t&&(e=s[t].trim())}}return e}_getBindingValues(t){if(this._cache[t])return this._cache[t];var e;null!=this._cv?e=this._cv.items:null!=this._chart&&null!=this._chart.collectionView&&(e=this._chart.collectionView.items);var i=this._bindValues(e,this._getBinding(t));return this._cache[t]=i.values}_getItem(t){var e=null,i=null;null!=this.itemsSource?i=null!=this._cv?this._cv.items:this.itemsSource:null!=this._chart.itemsSource&&(i=null!=this._chart.collectionView?this._chart.collectionView.items:this._chart.itemsSource);null!=i&&(e=i[t]);return e}_getLength(){var t=0,e=null;null!=this.itemsSource?e=null!=this._cv?this._cv.items:this.itemsSource:null!=this._chart.itemsSource&&(e=null!=this._chart.collectionView?this._chart.collectionView.items:this._chart.itemsSource);null!=e&&(t=e.length);return t}_setPointIndex(t,e){this._pointIndexes[t]=e}_getDataRect(){var t=this.getValues(0),e=this.getValues(1);if(t){for(var i=NaN,s=NaN,r=NaN,a=NaN,n=t.length,h=0;h<n;h++){var l=t[h];isFinite(l)&&(isNaN(s)?s=a=l:l<s?s=l:l>a&&(a=l));if(e){var o=e[h];isFinite(o)&&(isNaN(i)?i=r=o:o<i?i=o:l>a&&(r=o))}}if(!e){i=0;r=n-1}if(!isNaN(s))return new wijmo_1.Rect(i,s,r-i,a-s)}return null}_isCustomAxisX(){return!!this._axisX&&(!this._chart||this._axisX!=this.chart.axisX)}_isCustomAxisY(){return!!this._axisY&&(!this._chart||this._axisY!=this.chart.axisY)}_getAxisX(){var t=null;this.axisX?t=this.axisX:this.chart&&(t=this.chart.axisX);return t}_getAxisY(){var t=null;this.axisY?t=this.axisY:this.chart&&(t=this.chart.axisY);return t}_measureLegendItem(t,e){var i=new wijmo_1.Size;i.width=SeriesBase._LEGEND_ITEM_WIDTH;i.height=SeriesBase._LEGEND_ITEM_HEIGHT;if(this._name){var s=t.measureString(e,FlexChartCore._CSS_LABEL,FlexChartCore._CSS_LEGEND);i.width+=s.width;i.height<s.height&&(i.height=s.height)}i.width+=3*SeriesBase._LEGEND_ITEM_MARGIN;i.height+=2*SeriesBase._LEGEND_ITEM_MARGIN;return i}_drawFunnelLegendItem(t,e,i,s,r){t.strokeWidth=1;var a=SeriesBase._LEGEND_ITEM_MARGIN,n=null,h=null;null===n&&(n=this._chart._getColorLight(i));null===h&&(h=this._chart._getColor(i));t.fill=n;t.stroke=h;var l=e.top+.5*e.height,o=SeriesBase._LEGEND_ITEM_WIDTH,_=SeriesBase._LEGEND_ITEM_HEIGHT,d=this._getFunnelLegendName(i);t.drawRect(e.left+a,l-.5*_,o,_,null,r||s);null!=d&&FlexChartCore._renderText(t,d,new wijmo_1.Point(e.left+_+2*a,l),0,1,FlexChartCore._CSS_LABEL,FlexChartCore._CSS_LEGEND)}_getFunnelLegendName(t){var e,i=this._chart;if(i._xlabels&&i._xlabels.length&&t<i._xlabels.length)e=i._xlabels[t];else if(i._xvals&&i._xvals.length&&t<i._xvals.length){e=i._xvals[t];i._xDataType===wijmo_1.DataType.Date&&(e=FlexChartCore._fromOADate(e))}null==e&&(e=this.name);return e.toString()}_drawLegendItem(t,e,i,s,r,a){t.strokeWidth=1;var n=SeriesBase._LEGEND_ITEM_MARGIN,h=null,l=null;null===h&&(h=this._chart._getColorLight(this._chart.series.indexOf(this)));null===l&&(l=this._chart._getColor(this._chart.series.indexOf(this)));t.fill=h;t.stroke=l;var o=e.top+.5*e.height,_=SeriesBase._LEGEND_ITEM_WIDTH,d=SeriesBase._LEGEND_ITEM_HEIGHT;switch(i){case ChartType.Area:case ChartType.SplineArea:case ChartType.StepArea:t.drawRect(e.left+n,o-.5*d,_,d,null,r);break;case ChartType.Bar:case ChartType.Column:t.drawRect(e.left+n,o-.5*d,_,d,null,a||r);break;case ChartType.Scatter:case ChartType.Bubble:var c=.3*_,u=.3*d;this.symbolMarker==Marker.Box?t.drawRect(e.left+n+.5*_-c,o-u,2*c,2*u,null,a||r):t.drawEllipse(e.left+.5*_+n,o,c,u,null,a||r);break;case ChartType.Line:case ChartType.Spline:case ChartType.Step:t.drawLine(e.left+n,o,e.left+_+n,o,null,r);break;case ChartType.LineSymbols:case ChartType.SplineSymbols:case ChartType.StepSymbols:c=.3*_,u=.3*d;this.symbolMarker==Marker.Box?t.drawRect(e.left+n+.5*_-c,o-u,2*c,2*u,null,a||r):t.drawEllipse(e.left+.5*_+n,o,c,u,null,a||r);t.drawLine(e.left+n,o,e.left+_+n,o,null,r);break;case ChartType.Candlestick:case ChartType.HighLowOpenClose:t.drawLine(e.left+n,o,e.left+_+n,o,null,a||r)}this._name&&FlexChartCore._renderText(t,s,new wijmo_1.Point(e.left+d+2*n,o),0,1,FlexChartCore._CSS_LABEL,FlexChartCore._CSS_LEGEND)}_cvCollectionChanged(t,e){this._clearValues();this._invalidate()}_cvCurrentChanged(t,e){this._chart&&this._chart._notifyCurrentChanged&&this._invalidate()}_bindValues(t,e,i=!1){var s,r,a;if(null!=t){var n=t.length;s=new Array(t.length);let o=e?new wijmo_1.Binding(e):null;for(var h=0;h<n;h++){a=null;var l=t[h];null!=o&&(l=o.getValue(l));if(wijmo_1.isArray(l)&&l.length>0){a=l;l=l[0]}if(wijmo_1.isNumber(l)){s[h]=l;r=wijmo_1.DataType.Number}else if(wijmo_1.isDate(l)){s[h]=l.valueOf();r=wijmo_1.DataType.Date}else if(i&&l){s[h]=h;r=wijmo_1.DataType.Number}wijmo_1.isArray(a)&&a.length>0&&(s[h]=a)}}var o=new DataArray;o.values=s;o.dataType=r;return o}_invalidate(){this._chart&&this._chart.invalidate()}_indexToPoint(t){if(t>=0&&t<this._values.length){var e=this._values[t],i=this._xvalues?this._xvalues[t]:t;return new wijmo_1.Point(i,e)}return null}_getSymbolFill(t){var e=null;this.symbolStyle&&(e=this.symbolStyle.fill);!e&&this.style&&(e=this.style.fill);!e&&this.chart&&(e=this.chart._getColorLight(t));return e}_getSymbolStroke(t){var e=null;this.symbolStyle&&(e=this.symbolStyle.stroke);!e&&this.style&&(e=this.style.stroke);!e&&this.chart&&(e=this.chart._getColor(t));return e}_getAltSymbolStroke(t){var e=null;this.altStyle&&(e=this.altStyle.stroke);return e}_getAltSymbolFill(t){var e=null;this.altStyle&&(e=this.altStyle.fill);return e}_renderLabels(t,e,i,s){this._plotter&&this._plotter._renderLabels(t,this,e,i,s)}}SeriesBase._LEGEND_ITEM_WIDTH=10;SeriesBase._LEGEND_ITEM_HEIGHT=10;SeriesBase._LEGEND_ITEM_MARGIN=4;SeriesBase._DEFAULT_SYM_SIZE=10;exports.SeriesBase=SeriesBase;class Series extends SeriesBase{get chartType(){return this._chartType}set chartType(t){if((t=wijmo_1.asEnum(t,ChartType,!0))!=this._chartType){this._chartType=t;this._invalidate()}}}exports.Series=Series;class FlexPie extends FlexChartBase{constructor(t,e){super(t,null,!0);this._areas=[];this._keywords=new _KeyWords;this._startAngle=0;this._innerRadius=0;this._offset=0;this._reversed=!1;this._isAnimated=!1;this._selectedItemPosition=Position.None;this._selectedItemOffset=0;this._pieGroups=[];this._rotationAngles=[];this._centers=[new wijmo_1.Point];this._selectedOffset=new wijmo_1.Point;this._selectedIndex=-1;this._angles=[];this._colRowLens=[];this._titles=void 0;this._values=[];this._labels=[];this._pels=[];this._sum=0;this._sums=[];this._bindingSeparator=",";this.applyTemplate("wj-control wj-flexchart wj-flexpie",null,null);this._currentRenderEngine=new _SvgRenderEngine(this.hostElement);this._legend=new Legend(this);this._tooltip=new ChartTooltip;this._tooltip.content="<b>{name}</b><br/>{value}";this._tooltip.showDelay=0;this._lbl=new PieDataLabel;this._lbl._chart=this;var i=this;this.hostElement.addEventListener("mousemove",(function(t){var e=i._tooltip;if(e.content&&!i.isTouching){var s=i.hitTest(t);if(s.distance<=e.threshold){var r=i._getLabelContent(s,i.tooltip.content);i._showToolTip(r,new wijmo_1.Rect(t.clientX,t.clientY,5,5))}else i._hideToolTip()}}));this.hostElement.addEventListener("click",(function(t){var e=!0;if(i.selectionMode==SelectionMode.Point){var s=i.hitTest(t),r=FlexChartBase._SELECTION_THRESHOLD;i.tooltip&&i.tooltip.threshold&&(r=i.tooltip.threshold);if(s.distance<=r){s.pointIndex!=i._selectionIndex&&i.selectedItemPosition!=Position.None&&(e=!1);s.pointIndex!=i._selectionIndex&&i._select(s.pointIndex,!0)}else i._selectedIndex>=0&&i._select(null)}if(e&&i.isTouching){var a=i._tooltip;if(a.content){if((s=i.hitTest(t)).distance<=a.threshold){var n=i._getLabelContent(s,i.tooltip.content);i._showToolTip(n,new wijmo_1.Rect(t.clientX,t.clientY,5,5))}else i._hideToolTip()}}}));this.hostElement.addEventListener("mouseleave",(function(t){i._hideToolTip()}));this.deferUpdate(()=>this.initialize(e))}get binding(){return this._binding}set binding(t){if(t!=this._binding){this._binding=wijmo_1.asString(t,!0);this._bindChart()}}get bindingName(){return this._bindingName}set bindingName(t){if(t!=this._bindingName){this._bindingName=wijmo_1.asString(t,!0);this._bindChart()}}get startAngle(){return this._startAngle}set startAngle(t){if(t!=this._startAngle){this._startAngle=wijmo_1.asNumber(t,!0);this.invalidate()}}get offset(){return this._offset}set offset(t){if(t!=this._offset){this._offset=wijmo_1.asNumber(t,!0);this.invalidate()}}get innerRadius(){return this._innerRadius}set innerRadius(t){if(t!=this._innerRadius){this._innerRadius=wijmo_1.asNumber(t,!0);this.invalidate()}}get innerTextStyle(){return this._innerTextStyle}set innerTextStyle(t){if(t!=this._innerText){this._innerTextStyle=t;this.invalidate()}}get innerText(){return this._innerText}set innerText(t){if(t!=this._innerText){this._innerText=t;this.invalidate()}}get reversed(){return this._reversed}set reversed(t){if(t!=this._reversed){this._reversed=wijmo_1.asBoolean(t,!0);this.invalidate()}}get selectedItemPosition(){return this._selectedItemPosition}set selectedItemPosition(t){if((t=wijmo_1.asEnum(t,Position,!0))!=this._selectedItemPosition){this._selectedItemPosition=t;this.invalidate()}}get selectedItemOffset(){return this._selectedItemOffset}set selectedItemOffset(t){if(t!=this._selectedItemOffset){this._selectedItemOffset=wijmo_1.asNumber(t,!0);this.invalidate()}}get isAnimated(){return this._isAnimated}set isAnimated(t){t!=this._isAnimated&&(this._isAnimated=t)}get tooltip(){return this._tooltip}get dataLabel(){return this._lbl}set dataLabel(t){if(t!=this._lbl){this._lbl=t;this._lbl&&(this._lbl._chart=this)}}get selectedIndex(){return this._selectedIndex}set selectedIndex(t){if(t!=this._selectedIndex){var e=wijmo_1.asNumber(t,!0);this._select(e,!0)}}get titles(){return this._titles}set titles(t){if(t!==this._titles){this._titles=t;this.invalidate()}}get chartsPerLine(){return this._chartsPerLine}set chartsPerLine(t){if(t!=this._chartsPerLine){this._chartsPerLine=wijmo_1.asNumber(t,!0,!0);this.invalidate()}}_getLabelsForLegend(){return this._labels}hitTest(t,e){var i=this._toControl(t,e),s=new HitTestInfo(this,i),r=null;if(FlexChartBase._contains(this._rectHeader,i))s._chartElement=ChartElement.Header;else if(FlexChartBase._contains(this._rectFooter,i))s._chartElement=ChartElement.Footer;else if(FlexChartBase._contains(this._rectLegend,i)){s._chartElement=ChartElement.Legend;null!==(r=this.legend._hitTest(i))&&r>=0&&r<this._areas.length&&s._setData(null,r)}else if(FlexChartBase._contains(this._rectChart,i)){for(var a,n=this._areas.length,h=NaN,l=0;l<n;l++){var o=i.clone();let t=this._areas[l],e=this._rotationAngles[t.gi];if(0!=e){let i=this._centers[t.gi],s=i.x,r=i.y,a=-s+o.x,n=-r+o.y,h=Math.sqrt(a*a+n*n),l=Math.atan2(n,a)-e*Math.PI/180;o.x=s+h*Math.cos(l);o.y=r+h*Math.sin(l)}if(l==this._selectedIndex){o.x-=this._selectedOffset.x;o.y-=this._selectedOffset.y}var _=this._areas[l];if(_.contains(o)){s._setDataGroup(t.gi,_.tag);s._dist=0;if(l!=this._selectedIndex)break}var d=_.distance(o);if(void 0!==d&&(isNaN(h)||d<h)){h=d;a=_}}if(0!==s._dist&&null!=a){s._setDataGroup(a.gi,a.tag);s._dist=h}s._chartElement=ChartElement.ChartArea}else s._chartElement=ChartElement.None;return s}_performBind(){this._initData();if(this._cv){this._selectionIndex=this._cv.currentPosition;let e=this._cv.items;if(e){let i=e.length,s=this._getBindings();for(let t=0;t<s.length;t++){this._values[t]=[];this._sums[t]=0}for(var t=0;t<i;t++){let i=e[t];for(let t=0;t<s.length;t++)this._sums[t]+=Math.abs(this._getBindData(i,this._values[t],0==t?this._labels:null,s[t],this.bindingName))}}}}_getBindings(){let t=[],e=this.binding;if(e){var i=this._bindingSeparator;i&&(t=e.split(i))}return t}_initData(){this._sum=0;this._sums=[];this._values=[];this._labels=[]}_getBindData(t,e,i,s,r){var a,n=0;let h=s?new wijmo_1.Binding(s):null;h&&(a=h.getValue(t));n=0;wijmo_1.isNumber(a)?n=wijmo_1.asNumber(a):a&&(n=parseFloat(a.toString()));if(!isNaN(n)&&isFinite(n))e.push(n);else{n=0;e.push(n)}let l=r?new wijmo_1.Binding(r):null;if(i)if(l&&t){var o=l.getValue(t);o&&(o=o.toString());i.push(o)}else i.push(n.toString());return n}_render(t,e=!0,i=null){this._selectionAnimationID&&clearInterval(this._selectionAnimationID);this.onRendering(new RenderEventArgs(t));super._render(t,e,i)}_prepareRender(){this._areas=[]}_renderChart(t,e,i){var s=this._rectChart.clone(),r=(new wijmo_1.Size(s.width,s.height),e.width),a=e.height,n=this._parseMargin(this.plotMargin),h=this.dataLabel,l=h.content&&h.position==PieLabelPosition.Outside,o=l?(wijmo_1.isNumber(h.offset)?h.offset:0)+24:0;isNaN(n.left)&&(n.left=l?o:FlexPie._MARGIN);isNaN(n.right)&&(n.right=l?o:FlexPie._MARGIN);isNaN(n.top)&&(n.top=l?o:FlexPie._MARGIN);isNaN(n.bottom)&&(n.bottom=l?o:FlexPie._MARGIN);e.top+=n.top;a=e.height-(n.top+n.bottom);e.height=a>0?a:24;e.left+=n.left;r=e.width-(n.left+n.right);e.width=r>0?r:24;let _=this._getBindings(),d=this.titles;void 0===d&&_.length>1&&(d=_);let c=this._layout(t,e,d,_.length);this._angles=[];this._pels=[];this._pieGroups=[];this._rotationAngles=[];for(let e=0;e<_.length;e++){let i=c[e];d&&e<d.length&&d[e]&&FlexChartBase._renderText(t,d[e],new wijmo_1.Point(i.left+.5*i.width,i.top),1,2,FlexPie._CSS_GROUP_TITLE);let s=t.startGroup("wj-slice-group",null,!0);this._pieGroups.push(s);this._renderData(t,i,e,s);t.endGroup();this._rotationAngles.push(0)}this._highlightCurrent();this.innerText&&this._renderInnerText(t);this.dataLabel.content&&this.dataLabel.position!=PieLabelPosition.None&&this._renderLabels(t);this.onRendered(new RenderEventArgs(t))}_layout(t,e,i,s){let r=0,a=s,n=1,h=0;if(i)for(let e=0;e<i.length;e++)h=Math.max(h,t.measureString(i[e],FlexPie._CSS_GROUP_TITLE).height);let l=Math.floor(this.chartsPerLine);if(l>0){a=Math.min(s,l);n=Math.ceil(s/a);let t=Math.floor(e.width/a),i=Math.floor(e.height/n)-h;r=Math.min(t,i)}else for(let t=1;t<=s;t++){let i=Math.floor((s+(t-1))/t),l=Math.floor(e.width/t),o=Math.floor(e.height/i);(o-=h)<l&&(l=o);if(l>r){r=l;a=t;n=i}}let o=[],_=.5*(e.width-r*a),d=.5*(e.height-(r+h)*n);for(let t=0;t<n;t++)for(let i=0;i<a;i++)o.push(new wijmo_1.Rect(e.left+r*i+8+_,e.top+(r+h)*t+8+d+h,r-16,r-16));return o}_getDesiredLegendSize(t,e,i,s){var r=new wijmo_1.Size,a=(new wijmo_1.Size(i,s),this._getLabelsForLegend()),n=a.length,h=0,l=0;const o=this.legend.scrollbar?18:0;this._colRowLens=[];for(var _=0;_<n;_++){var d=this._measureLegendItem(t,a[_]);if(e){if(l+d.height>s&&!this.legend.scrollbar){r.height=s;this._colRowLens.push(h);h=0;l=0}h<d.width&&(h=d.width);l+=d.height}else{if(h+d.width>i-o){r.width=i;this._colRowLens.push(l);l=0;h=0}l<d.height&&(l=d.height);h+=d.width}}if(e){r.height<l&&(r.height=l);this._colRowLens.push(h);r.width=this._colRowLens.reduce((t,e)=>t+e,0)}else{r.width<h&&(r.width=h);this._colRowLens.push(l);r.height=this._colRowLens.reduce((t,e)=>t+e,0)}return r}_renderLegend(t,e,i,s,r,a){for(var n=new wijmo_1.Rect(e.x,e.y,r,a),h=this._getLabelsForLegend(),l=h.length,o=0,_=e.clone(),d=0;d<l;d++){var c=this._measureLegendItem(t,h[d]);if(s){if(_.y+c.height>n.top+n.height+1&&!this.legend.scrollbar){_.x+=this._colRowLens[o];o++;_.y=e.y}}else if(_.x+c.width>n.right){_.y+=this._colRowLens[o];o++;_.x=e.x}var u=new wijmo_1.Rect(_.x,_.y,c.width,c.height);this._drawLegendItem(t,u,d,h[d]);i.push(u);s?_.y+=c.height:_.x+=c.width}}_renderData(t,e,i,s){var r=this._sums[i],a=this.startAngle+180,n=this.innerRadius,h=this.offset;n>1&&(n=1);if(r>0){var l=a*Math.PI/180,o=e.left+.5*e.width,_=e.top+.5*e.height,d=Math.min(.5*e.width,.5*e.height);this._centers[i]=new wijmo_1.Point(o,_);var c=Math.max(h,this.selectedItemOffset);c>0&&(h*=d/=1+c);this._radius=d;var u=n*d;this._renderPie(t,i,d,u,l,h)}}_renderPie(t,e,i,s,r,a){this._renderSlices(t,this._values[e],this._sums[e],e,i,s,r,2*Math.PI,a)}_getCenter(){return this._centers[0]}_renderSlices(t,e,i,s,r,a,n,h,l){var o,_,d,c=e.length,u=0,g=n,m=1==this.reversed,f=this._centers[s];for(let t=0;t<c;t++)e[t]>0&&u++;var p=1===u?360:359.9/360;for(let n=0;n<c;n++){_=f.x;d=f.y;o=t.startGroup("wj-slice");t.fill=this._getColorLight(n);t.stroke=this._getColor(n);var x=Math.abs(e[n]),w=Math.abs(x-i)<1e-10?h:h*x/i;w=Math.min(w,h*p);var v=m?g-.5*w:g+.5*w;if(l>0&&w<h){_+=l*Math.cos(v);d+=l*Math.sin(v)}this._renderSlice(t,_,d,v,s,n,r,a,g,w,h);m?g-=w:g+=w;t.endGroup();this._pels.push(o)}}_renderSlice(t,e,i,s,r,a,n,h,l,o,_){var d=!!this.reversed;this._angles.push(s);if(this.itemFormatter){var c=new HitTestInfo(this,new wijmo_1.Point(e+n*Math.cos(s),i+n*Math.sin(s)),ChartElement.SeriesSymbol);c._setData(null,a);this.itemFormatter(t,c,()=>{this._drawSlice(t,r,a,d,e,i,n,h,l,o)});t.cssPriority=!0}else this._drawSlice(t,r,a,d,e,i,n,h,l,o)}_getSelectedItemOffset(t,e){var i=0,s=0,r=0;t==this._selectedIndex&&this.selectedItemOffset>0&&(r=this.selectedItemOffset);if(r>0){i=Math.cos(e)*r*this._radius;s=Math.sin(e)*r*this._radius}return{x:i,y:s}}_renderInnerText(t){let e=this.innerText,i=this.innerTextStyle;for(let s=0;s<this._centers.length;s++){let r,a=this._centers[s];if(r=wijmo_1.isFunction(e)?e(s):wijmo_1.isArray(e)?wijmo_1.asString(e[s]):wijmo_1.asString(e)){r=wijmo_1.format(r,{total:this._sums[s],binding:this._getBindings()[s]});i&&(t.cssPriority=!1);FlexPie._renderText(t,r,a,1,1,FlexChartBase._CSS_TITLE,null,i);t.cssPriority=!0}}}_renderLabels(t){var e=this._areas.length,i=this.dataLabel,s=i.position,r="wj-data-label",a=this._rotationAngles,n=i.connectingLine,h=i.offset?i.offset:0;t.stroke="null";t.fill="transparent";t.strokeWidth=1;t.startGroup("wj-data-labels");for(var l=0;l<e;l++){var o=this._areas[l];if(o){var _=o.radius,d=o.langle+a[o.gi],c=1,u=1;if(s==PieLabelPosition.Center||s===PieLabelPosition.Radial||s===PieLabelPosition.Circular)_*=.5*(1+(o.innerRadius||0)/o.radius);else{if((d=_Math.clampAngle(d))<=-170||d>=170){c=2;u=1}else if(d>=-100&&d<=-80){c=1;u=2}else if(d>=-10&&d<=10){c=0;u=1}else if(d>=80&&d<=100){c=1;u=0}else if(-180<d&&d<-90){c=2;u=2}else if(-90<=d&&d<0){c=0;u=2}else if(0<d&&d<90){c=0;u=0}else if(90<d&&d<180){c=2;u=0}if(s==PieLabelPosition.Inside){c=2-c;u=2-u}}d*=Math.PI/180;let e=o.gi?l-o.gi*this._values[0].length:l;var g=this._getSelectedItemOffset(e,d),m=g.x,f=g.y,p=_;s==PieLabelPosition.Outside?p+=h:s==PieLabelPosition.Inside&&(p-=h);var x=o.center.x,w=o.center.y;let k=this._centers[o.gi];var v=x-k.x,b=w-k.y;if(0!=this._rotationAngles[o.gi]){var y=Math.sqrt(v*v+b*b),S=Math.atan2(b,v)+this._rotationAngles[o.gi]*Math.PI/180;x=k.x+y*Math.cos(S);w=k.y+y*Math.sin(S)}var C=new wijmo_1.Point(x+m+p*Math.cos(d),w+f+p*Math.sin(d));if(i.border&&s!=PieLabelPosition.Center){0==c?C.x+=2:2==c&&(C.x-=2);0==u?C.y+=2:2==u&&(C.y-=2)}var T=new HitTestInfo(this,C);T._setDataGroup(o.gi,o.tag);var M=this._getLabelContent(T,i.content),P=new DataLabelRenderEventArgs(t,T,C,M);if(i.onRendering)if(i.onRendering(P)){M=P.text;C=P.point}else M=null;if(M){var A,L=180*Math.atan2(w-C.y,x-C.x)/Math.PI;L=(L+360)%360;if(s===PieLabelPosition.Radial||s===PieLabelPosition.Circular){if(s===PieLabelPosition.Radial)L>90&&L<270&&(L+=180);else{L>180&&L<360&&(L+=180);L-=90}(A=FlexChartBase._renderRotatedText(t,M,C,c,u,C,L,r).getBBox()).left=A.x;A.top=A.y}else A=FlexChartBase._renderText(t,M,C,c,u,r);i.border&&t.drawRect(A.left-2,A.top-2,A.width+4,A.height+4,"wj-data-label-border");if(n){var E=new wijmo_1.Point(x+m+_*Math.cos(d),w+f+_*Math.sin(d));t.drawLine(C.x,C.y,E.x,E.y,"wj-data-label-line")}}t.cssPriority=!0}}t.endGroup()}_drawSlice(t,e,i,s,r,a,n,h,l,o){var _;if(s)if(h>0){0!=o&&t.drawDonutSegment(r,a,n,h,l-o,o);(_=new _DonutSegment(new wijmo_1.Point(r,a),n,h,l-o,o,this.startAngle)).tag=i;this._areas.push(_)}else{0!=o&&t.drawPieSegment(r,a,n,l-o,o);(_=new _PieSegment(new wijmo_1.Point(r,a),n,l-o,o,this.startAngle)).tag=i;this._areas.push(_)}else{if(h>0){0!=o&&t.drawDonutSegment(r,a,n,h,l,o);(_=new _DonutSegment(new wijmo_1.Point(r,a),n,h,l,o,this.startAngle)).tag=i;this._areas.push(_)}else{0!=o&&t.drawPieSegment(r,a,n,l,o);(_=new _PieSegment(new wijmo_1.Point(r,a),n,l,o,this.startAngle)).tag=i;this._areas.push(_)}l+=o}_&&(_.gi=e)}_measureLegendItem(t,e){var i=new wijmo_1.Size;i.width=Series._LEGEND_ITEM_WIDTH;i.height=Series._LEGEND_ITEM_HEIGHT;if(e){var s=t.measureString(e,FlexChartBase._CSS_LABEL,FlexChartBase._CSS_LEGEND);i.width+=s.width;i.height<s.height&&(i.height=s.height)}i.width+=3*Series._LEGEND_ITEM_MARGIN;i.height+=2*Series._LEGEND_ITEM_MARGIN;return i}_drawLegendItem(t,e,i,s){t.strokeWidth=1;var r=Series._LEGEND_ITEM_MARGIN,a=null,n=null;null===a&&(a=this._getColorLight(i));null===n&&(n=this._getColor(i));t.fill=a;t.stroke=n;var h=e.top+.5*e.height,l=Series._LEGEND_ITEM_WIDTH,o=Series._LEGEND_ITEM_HEIGHT;t.drawRect(e.left+r,h-.5*o,l,o,null);null!=s&&FlexChartBase._renderText(t,s.toString(),new wijmo_1.Point(e.left+o+2*r,h),0,1,FlexChartBase._CSS_LABEL)}_getLabelContent(t,e){return wijmo_1.isString(e)?this._keywords.replace(e,t):wijmo_1.isFunction(e)?e(t):null}_select(t,e=!1){this._highlight(!1,this._selectionIndex);this._selectionIndex=t;if(this.selectionMode==SelectionMode.Point){var i=this._cv;if(i){this._notifyCurrentChanged=!1;i.moveCurrentToPosition(t);this._notifyCurrentChanged=!0}}if(null==t){this._selectedIndex=-1;this.invalidate()}else if(this.isAnimated&&this.selectedItemPosition!=Position.None||!(this.selectedItemOffset>0||this.selectedItemPosition!=Position.None))this._highlight(!0,this._selectionIndex,e);else{this._selectedIndex=t;this.invalidate()}this.onSelectionChanged()}_highlightCurrent(){if(this.selectionMode!=SelectionMode.None){var t=-1,e=this._cv;e&&(t=e.currentPosition);this._highlight(!0,t)}}_highlight(t,e,i=!1){if(this.selectionMode==SelectionMode.Point&&null!=e&&e>=0)if(t){let d=[];for(let c=0;c<this._pieGroups.length;c++){if(_=this._pels[e+c*this._values[0].length]){_.parentNode.appendChild(_);var s=this._find(_,["ellipse"]);this._highlightItems(this._find(_,["path","ellipse"]),FlexChartBase._CSS_SELECTION,t)}var r=this._angles[e+c*this._values[0].length];if(this.selectedItemPosition!=Position.None&&0!=r){var a=0;this.selectedItemPosition==Position.Left?a=180:this.selectedItemPosition==Position.Top?a=-90:this.selectedItemPosition==Position.Bottom&&(a=90);var n=a*Math.PI/180-r;n*=180/Math.PI;if(i&&this.isAnimated)d.push(n);else{this._rotationAngles[c]=n;this._pieGroups[c].transform.baseVal.getItem(0).setRotate(n,this._centers[c].x,this._centers[c].y)}}var h=this.selectedItemOffset;if(h>0&&s&&0==s.length){var l=this._selectedOffset.x=Math.cos(r)*h*this._radius,o=this._selectedOffset.y=Math.sin(r)*h*this._radius;_&&_.setAttribute("transform","translate("+l.toFixed()+","+o.toFixed()+")")}this._selectedIndex=e}d.length>0&&this._animateSelectionAngle(d,.5)}else{for(let i=0;i<this._pieGroups.length;i++){var _;if(_=this._pels[e+i*this._values[0].length]){_.parentNode.insertBefore(_,_.parentNode.childNodes.item(e));_.removeAttribute("transform");this._highlightItems(this._find(_,["path","ellipse"]),FlexChartBase._CSS_SELECTION,t)}}this._selectedIndex==e&&(this._selectedIndex=-1)}}_animateSelectionAngle(t,e){var i=this,s=i._pieGroups;i._selectionAnimationID&&clearInterval(this._selectionAnimationID);this._selectionAnimationID=wijmo_1.animate((function(e){if(s==i._pieGroups){for(let r=0;r<s.length;r++){let a=_Math.clampAngle(i._rotationAngles[r]),n=_Math.clampAngle(t[r])-a,h=a;i._rotationAngles[r]=a=h+n*e;s[r].transform.baseVal.getItem(0).setRotate(a,i._centers[r].x,i._centers[r].y)}1==e&&clearInterval(i._selectionAnimationID);e>.99&&(i.selectedItemOffset>0||i.selectedItemPosition!=Position.None)&&i.invalidate()}}),1e3*e)}_getHitTestItem(t){var e=null,i=null;(e=null!=this._cv?this._cv.items:this.itemsSource)&&t<e.length&&(i=e[t]);return i}_getHitTestValue(t,e){null==e&&(e=0);return this._values[e][t]}_getHitTestLabel(t){return this._labels[t]}}FlexPie._MARGIN=4;FlexPie._CSS_GROUP_TITLE="wj-label";exports.FlexPie=FlexPie;class _Math{static clampAngle(t,e=0){var i=(t+180)%360-180;i<-180+(e<0?e+360:e)&&(i+=360);return i}}class _PieSegment{constructor(t,e,i,s,r=0){this._isFull=!1;this._center=t;this._radius=e;this._originAngle=i;this._originSweep=s;s>=2*Math.PI&&(this._isFull=!0);this._sweep=.5*s*180/Math.PI;this._angle=_Math.clampAngle(180*i/Math.PI+this._sweep);this._radius2=e*e;this._startAngle=r}contains(t){var e=t.x-this._center.x,i=t.y-this._center.y;if(e*e+i*i<=this._radius2){var s=180*Math.atan2(i,e)/Math.PI,r=_Math.clampAngle(this._angle,this._startAngle)-_Math.clampAngle(s,this._startAngle);if(this._isFull||Math.abs(r)<=this._sweep)return!0}return!1}distance(t){if(this.contains(t))return 0;var e=t.x-this._center.x,i=t.y-this._center.y,s=e*e+i*i,r=180*Math.atan2(i,e)/Math.PI,a=_Math.clampAngle(this._angle,this._startAngle)-_Math.clampAngle(r,this._startAngle);return this._isFull||Math.abs(a)<=this._sweep?Math.sqrt(s)-this._radius:void 0}get center(){return this._center}get radius(){return this._radius}get langle(){return this._angle}get angle(){return this._originAngle}get sweep(){return this._originSweep}}exports._PieSegment=_PieSegment;class _DonutSegment{constructor(t,e,i,s,r,a=0){this._isFull=!1;this._center=t;this._radius=e;this._iradius=i;this._originAngle=s;this._originSweep=r;r>=2*Math.PI&&(this._isFull=!0);this._sweep=.5*r*180/Math.PI;this._angle=_Math.clampAngle(180*s/Math.PI+this._sweep);this._radius2=e*e;this._iradius2=i*i;this._startAngle=a}contains(t){var e=t.x-this._center.x,i=t.y-this._center.y,s=e*e+i*i;if(s>=this._iradius2&&s<=this._radius2){var r=180*Math.atan2(i,e)/Math.PI,a=_Math.clampAngle(this._angle,this._startAngle)-_Math.clampAngle(r,this._startAngle);if(this._isFull||Math.abs(a)<=this._sweep)return!0}return!1}distance(t){if(this.contains(t))return 0}get center(){return this._center}get radius(){return this._radius}get langle(){return this._angle}get angle(){return this._originAngle}get sweep(){return this._originSweep}get innerRadius(){return this._iradius}}exports._DonutSegment=_DonutSegment;class LineMarkers{constructor(){this._moveMarker=function(t){var e=t.currentTarget,i=this._markers,s=e.getAttribute("data-markerIndex");null!=s&&i[s].forEach((function(e){e._moveMarker(t)}))};this._markers=[];this._bindMoveMarker=this._moveMarker.bind(this)}attach(t){var e,i,s=t.chart.hostElement,r=this._markers,a=s.getAttribute("data-markerIndex");if(null!=a)if((i=r[a])&&wijmo_1.isArray(i))i.push(t);else{r[a]=[t];this._bindMoveEvent(s)}else{e=r.length,i=[t];r.push(i);s.setAttribute("data-markerIndex",e);this._bindMoveEvent(s)}}detach(t){var e,i,s=t.chart.hostElement,r=this._markers,a=s.getAttribute("data-markerIndex");if(null!=a){(e=(i=r[a]).indexOf(t))>-1&&i.splice(e,1);if(0===i.length){(e=r.indexOf(i))>-1&&(r[e]=void 0);this._unbindMoveEvent(s)}}}_unbindMoveEvent(t){var e=this._bindMoveMarker;t.removeEventListener("mousemove",e);"ontouchstart"in window&&t.removeEventListener("touchmove",e)}_bindMoveEvent(t){var e=this._bindMoveMarker;t.addEventListener("mousemove",e);"ontouchstart"in window&&t.addEventListener("touchmove",e)}}var LineMarkerLines,LineMarkerInteraction,LineMarkerAlignment,lineMarkers=new LineMarkers;!function(t){t[t.None=0]="None";t[t.Vertical=1]="Vertical";t[t.Horizontal=2]="Horizontal";t[t.Both=3]="Both"}(LineMarkerLines=exports.LineMarkerLines||(exports.LineMarkerLines={}));!function(t){t[t.None=0]="None";t[t.Move=1]="Move";t[t.Drag=2]="Drag"}(LineMarkerInteraction=exports.LineMarkerInteraction||(exports.LineMarkerInteraction={}));!function(t){t[t.Auto=2]="Auto";t[t.Right=0]="Right";t[t.Left=1]="Left";t[t.Bottom=4]="Bottom";t[t.Top=6]="Top"}(LineMarkerAlignment=exports.LineMarkerAlignment||(exports.LineMarkerAlignment={}));class LineMarker{constructor(t,e){this._wrapperMousedown=null;this._wrapperMouseup=null;this._savedPosition=new wijmo_1.Point;this.positionChanged=new wijmo_1.Event;this._chart=t;t._markers.push(this);t.rendered.addHandler(this._initialize,this);this._resetDefaultValue();wijmo_1.copy(this,e);this._initialize()}get chart(){return this._chart}get isVisible(){return this._isVisible}set isVisible(t){if(t!==this._isVisible){this._isVisible=wijmo_1.asBoolean(t);this._marker&&this._toggleVisibility()}}get seriesIndex(){return this._seriesIndex}set seriesIndex(t){t!==this._seriesIndex&&(this._seriesIndex=wijmo_1.asNumber(t,!0))}get horizontalPosition(){return this._horizontalPosition}set horizontalPosition(t){if(t!==this._horizontalPosition){this._horizontalPosition=wijmo_1.asNumber(t,!0);this._savedPosition.x=this._horizontalPosition;if(this._horizontalPosition<0||this._horizontalPosition>1)throw"horizontalPosition's value should be in (0, 1).";this._marker&&this._updateMarkerPosition()}}get x(){var t=this._chart.axisX;let e=this.chart.pageToControl(this._targetPoint);return t.convertBack(e.x)}get y(){var t=this._chart.axisY;let e=this.chart.pageToControl(this._targetPoint);return t.convertBack(e.y)}get content(){return this._content}set content(t){if(t!==this._content){this._content=wijmo_1.asFunction(t);this._updateMarkerPosition()}}get verticalPosition(){return this._verticalPosition}set verticalPosition(t){if(t!==this._verticalPosition){this._verticalPosition=wijmo_1.asNumber(t,!0);this._savedPosition.y=this._verticalPosition;if(this._verticalPosition<0||this._verticalPosition>1)throw"verticalPosition's value should be in (0, 1).";this._marker&&this._updateMarkerPosition()}}get alignment(){return this._alignment}set alignment(t){if(t!==this._alignment){this._alignment=t;this._marker&&this._updatePositionByAlignment()}}get lines(){return this._lines}set lines(t){if((t=wijmo_1.asEnum(t,LineMarkerLines))!=this._lines){this._lines=t;this._marker&&this._resetLinesVisibility()}}get interaction(){return this._interaction}set interaction(t){if((t=wijmo_1.asEnum(t,LineMarkerInteraction))!=this._interaction){this._marker&&this._detach();this._interaction=t;this._marker&&this._attach();this._toggleElesDraggableClass(this._interaction==LineMarkerInteraction.Drag)}}get dragThreshold(){return this._dragThreshold}set dragThreshold(t){t!=this._dragThreshold&&(this._dragThreshold=wijmo_1.asNumber(t))}get dragContent(){return this._dragContent}set dragContent(t){t!==this._dragContent&&(this._dragContent=wijmo_1.asBoolean(t));wijmo_1.toggleClass(this._dragEle,LineMarker._CSS_LINE_DRAGGABLE,this._interaction===LineMarkerInteraction.Drag&&this._dragContent&&this._lines!==LineMarkerLines.None)}get dragLines(){return this._dragLines}set dragLines(t){t!=this._dragLines&&(this._dragLines=wijmo_1.asBoolean(t))}onPositionChanged(t){this.positionChanged.raise(this,t)}remove(){var t=this._chart;if(this._marker){t.rendered.removeHandler(this._initialize,this);this._detach();this._removeMarker();this._wrapperMoveMarker=null;this._wrapperMousedown=null;this._wrapperMouseup=null}}_attach(){var t=this._chart.hostElement;this._interaction!==LineMarkerInteraction.None?wijmo_1.addClass(t,LineMarker._CSS_TOUCH_DISABLED):wijmo_1.removeClass(t,LineMarker._CSS_TOUCH_DISABLED);lineMarkers.attach(this);this._attachDrag()}_attachDrag(){if(this._interaction===LineMarkerInteraction.Drag){this._wrapperMousedown||(this._wrapperMousedown=this._onMousedown.bind(this));this._wrapperMouseup||(this._wrapperMouseup=this._onMouseup.bind(this));this._toggleDragEventAttach(!0)}}_detach(){wijmo_1.removeClass(this._chart.hostElement,LineMarker._CSS_TOUCH_DISABLED);lineMarkers.detach(this);this._detachDrag()}_detachDrag(){this._interaction===LineMarkerInteraction.Drag&&this._toggleDragEventAttach(!1)}_toggleDragEventAttach(t){var e=this._chart.hostElement,i=t?"addEventListener":"removeEventListener";e[i]("mousedown",this._wrapperMousedown);document[i]("mouseup",this._wrapperMouseup);"ontouchstart"in window&&e[i]("touchstart",this._wrapperMousedown);"ontouchend"in window&&document[i]("touchend",this._wrapperMouseup)}_onMousedown(t){var e,i,s,r,a,n=this._getEventPoint(t);if(this._interaction===LineMarkerInteraction.Drag){r=!(0===(e=wijmo_1.getElementRect(this._hLine)).width||0===e.height);a=!(0===(i=wijmo_1.getElementRect(this._vLine)).width||0===i.height);s=wijmo_1.getElementRect(this._markerContent);if(this._dragContent&&this._pointInRect(n,s)){this._capturedEle=this._markerContent;this._contentDragStartPoint=new wijmo_1.Point(n.x,n.y);this._mouseDownCrossPoint=new wijmo_1.Point(this._targetPoint.x,this._targetPoint.y)}else if(r&&(Math.abs(e.top-n.y)<=this._dragThreshold||Math.abs(n.y-e.top-e.height)<=this._dragThreshold||n.y>=e.top&&n.y<=e.top+e.height)){this._capturedEle=this._hLine;this._contentDragStartPoint=void 0;wijmo_1.addClass(this._chart.hostElement,LineMarker._CSS_LINE_DRAGGABLE)}else if(a&&(Math.abs(i.left-n.x)<=this._dragThreshold||Math.abs(n.x-i.left-i.width)<=this._dragThreshold||n.x>=i.left&&n.x<=i.left+i.width)){this._capturedEle=this._vLine;this._contentDragStartPoint=void 0;wijmo_1.addClass(this._chart.hostElement,LineMarker._CSS_LINE_DRAGGABLE)}t.preventDefault()}}_onMouseup(t){var e=this._alignment===LineMarkerAlignment.Auto&&this._capturedEle===this._markerContent&&this._lines!==LineMarkerLines.None;this._capturedEle=void 0;this._contentDragStartPoint=void 0;this._mouseDownCrossPoint=void 0;if(e){this._updatePositionByAlignment();this._updatePositionByAlignment()}wijmo_1.removeClass(this._chart.hostElement,LineMarker._CSS_LINE_DRAGGABLE)}_moveMarker(t){var e,i,s,r,a,n,h=this._chart,l=this._getEventPoint(t),o=this._plotRect,_=this._interaction===LineMarkerInteraction.Drag,d=this._lines===LineMarkerLines.Horizontal,c=this._lines===LineMarkerLines.Vertical,u=this._seriesIndex,g=wijmo_1.getElementRect(h.hostElement);if(o&&this._isVisible&&this._interaction!==LineMarkerInteraction.None&&(this._interaction!==LineMarkerInteraction.Drag||this._capturedEle&&this._lines!==LineMarkerLines.None)){if(_)if(this._contentDragStartPoint){l.x=d?this._targetPoint.x:this._mouseDownCrossPoint.x+l.x-this._contentDragStartPoint.x;l.y=c?this._targetPoint.y:this._mouseDownCrossPoint.y+l.y-this._contentDragStartPoint.y}else d||!this._dragLines&&this._capturedEle===this._hLine?l.x=this._targetPoint.x:(c||!this._dragLines&&this._capturedEle===this._vLine)&&(l.y=this._targetPoint.y);if(_&&this._lines===LineMarkerLines.Horizontal||!this._dragLines&&this._capturedEle===this._hLine){if(l.y<=o.top||l.y>=o.top+o.height)return}else if(_&&this._lines===LineMarkerLines.Vertical||!this._dragLines&&this._capturedEle===this._vLine){if(l.x<=o.left||l.x>=o.left+o.width)return}else{const t=this._getTop();if(l.x<=o.left||l.y<=t||l.x>=o.left+o.width||l.y>=t+o.height)return}if(null!=u&&u>=0&&u<h.series.length){if(null==(i=(e=h.series[u]).hitTest(new wijmo_1.Point(l.x,NaN)))||null==i.x||null==i.y)return;s=e.axisX||h.axisX;r=e._getAxisY();a=wijmo_1.isDate(i.x)?FlexChartCore._toOADate(i.x):i.x;a=wijmo_1.isString(a)?i.pointIndex:a;n=wijmo_1.isDate(i.y)?FlexChartCore._toOADate(i.y):i.y;let t=this._getElementPaddingValuee(h.hostElement,"padding-left"),o=this._getElementPaddingValuee(h.hostElement,"padding-top");l.x=s.convert(a)+t+g.left;this.chart._stacking!=Stacking.None&&(n=this._calcStackedValue(u,a,n));l.y=r.convert(n)+o+g.top}this._updateMarkerPosition(l);t.preventDefault()}}_calcStackedValue(t,e,i){let s=i,r=this.chart._stacking==Stacking.Stacked100pc;for(let a=0;a<t;a++){let t=this.chart.series[a],n=t.getValues(1),h=t.getValues(0);if(h)for(let t=0;t<h.length;t++){if(e===(n?n[t]:t)){isFinite(h[t])&&(r||this._sign(i)==this._sign(h[t]))&&(s+=h[t]);break}}}r&&s&&(s/=this.chart._dataInfo.getStackedAbsSum(e))>1&&(s=1);return s}_sign(t){return t>0?1:t<0?-1:0}_getElementPaddingValuee(t,e){return+window.getComputedStyle(t,null).getPropertyValue(e).replace("px","")}_show(t){(t||this._marker).style.display="block"}_hide(t){(t||this._marker).style.display="none"}_toggleVisibility(){this._isVisible?this._show():this._hide()}_resetDefaultValue(){this._isVisible=!0;this._alignment=LineMarkerAlignment.Auto;this._lines=LineMarkerLines.None;this._interaction=LineMarkerInteraction.None;this._horizontalPosition=null;this._verticalPosition=null;this._content=null;this._seriesIndex=null;this._dragThreshold=15;this._dragContent=!1;this._dragLines=!1;this._targetPoint=new wijmo_1.Point}_initialize(){var t,e=this._chart.hostElement.querySelector("."+FlexChartCore._CSS_PLOT_AREA);this._plot=e;this._marker||this._createMarker();if(e){this._plotRect=wijmo_1.getElementRect(e);t=e.getBBox();this._plotRect.width=t.width;this._plotRect.height=t.height;this._updateMarkerSize();this._updateLinesSize()}this._updateMarkerPosition();this._wrapperMoveMarker=this._moveMarker.bind(this);this._attach()}_createMarker(){var t,e;t=document.createElement("div");wijmo_1.addClass(t,LineMarker._CSS_MARKER);(e=this._getContainer()).appendChild(t);this._markerContainer=e;this._marker=t;this._createChildren()}_removeMarker(){var t=this._markerContainer;t.removeChild(this._marker);this._content=null;this._hLine=null;this._vLine=null;if(!t.hasChildNodes()){this._chart.hostElement.removeChild(this._markerContainer);this._markerContainer=null}this._marker=null}_getContainer(){var t=this._chart.hostElement.querySelector(LineMarker._CSS_MARKER_CONTAINER);t||(t=this._createContainer());return t}_createContainer(){var t=document.createElement("div"),e=this._chart.hostElement;wijmo_1.addClass(t,LineMarker._CSS_MARKER_CONTAINER);e.insertBefore(t,e.firstChild);return t}_createChildren(){var t,e,i,s,r=this._marker;(s=document.createElement("div")).style.position="absolute";s.style.height="100%";s.style.width="100%";r.appendChild(s);this._dragEle=s;t=document.createElement("div");wijmo_1.addClass(t,LineMarker._CSS_MARKER_CONTENT);r.appendChild(t);this._markerContent=t;e=document.createElement("div");wijmo_1.addClass(e,LineMarker._CSS_MARKER_HLINE);r.appendChild(e);this._hLine=e;i=document.createElement("div");wijmo_1.addClass(i,LineMarker._CSS_MARKER_VLINE);r.appendChild(i);this._vLine=i;this._toggleElesDraggableClass(this._interaction===LineMarkerInteraction.Drag);this._resetLinesVisibility()}_toggleElesDraggableClass(t){wijmo_1.toggleClass(this._hLine,LineMarker._CSS_LINE_DRAGGABLE,t);wijmo_1.toggleClass(this._vLine,LineMarker._CSS_LINE_DRAGGABLE,t);wijmo_1.toggleClass(this._dragEle,LineMarker._CSS_LINE_DRAGGABLE,t&&this._dragContent&&this._lines!==LineMarkerLines.None)}_updateMarkerSize(){var t=this._plotRect,e=this._chart.hostElement,i=window.getComputedStyle(e,null),s=wijmo_1.getElementRect(e);if(this._marker){this._marker.style.marginTop=t.top-s.top-(parseFloat(i.getPropertyValue("padding-top"))||0)+"px";this._marker.style.marginLeft=t.left-s.left-(parseFloat(i.getPropertyValue("padding-left"))||0)+"px"}}_updateLinesSize(){var t=this._plotRect;if(this._hLine&&this._vLine){this._hLine.style.width=t.width+"px";this._vLine.style.height=t.height+"px"}}_resetLinesVisibility(){if(this._hLine&&this._vLine){this._hide(this._hLine);this._hide(this._vLine);this._lines!==LineMarkerLines.Horizontal&&this._lines!==LineMarkerLines.Both||this._show(this._hLine);this._lines!==LineMarkerLines.Vertical&&this._lines!==LineMarkerLines.Both||this._show(this._vLine)}}_updateMarkerPosition(t){var e,i,s=this._plotRect,r=this._targetPoint,a=!1;this._interaction,LineMarkerInteraction.Drag;if(this._plot){e=s.left+s.width*(this._horizontalPosition||0);i=s.top+s.height*(this._verticalPosition||0);null==this._horizontalPosition&&t?e=t.x:this._savedPosition.x>0&&(e=s.left+s.width*this._savedPosition.x);null==this._verticalPosition&&t?i=t.y:this._savedPosition.y>0&&(i=s.top+s.height*this._savedPosition.y);e===r.x&&i===r.y||(a=!0);r.x=e;r.y=i;this._savedPosition.x=wijmo_1.clamp((e-s.left)/s.width,0,1);this._savedPosition.y=wijmo_1.clamp((i-s.top)/s.height,0,1);this._toggleVisibility();this._content&&this._updateContent();a&&this._raisePositionChanged(e,i);this._updatePositionByAlignment(!!t)}}_updateContent(){var t,e=this._chart,i=this._targetPoint,s=e.hitTest(i);t=this._content.call(null,s,i);this._markerContent.innerHTML=t||""}_raisePositionChanged(t,e){this._plotRect;this.onPositionChanged(new wijmo_1.Point(t,e))}_updatePositionByAlignment(t){var e=this._alignment,i=this._targetPoint,s=this._marker,r=0,a=0,n=s.clientWidth,h=s.clientHeight,l=this._plotRect;if(!this._plot)return;const o=this._getTop();if(!this._capturedEle||this._capturedEle&&this._capturedEle!==this._markerContent){if(e===LineMarkerAlignment.Auto){i.x+n+12>l.left+l.width&&i.x-n>=0&&(a=n);r=h;i.y-h<o&&(r=0)}else{1==(1&e)&&(a=n);2==(2&e)&&(r=h)}this._interaction===LineMarkerInteraction.Move&&0===r&&0===a&&null==this.verticalPosition&&(a=-12)}else{parseInt(this._hLine.style.top)>0&&(r=h);parseInt(this._vLine.style.left)>0&&(a=n)}s.style.left=i.x-a-l.left+"px";s.style.top=i.y-r-o+"px";this._hLine.style.top=r+"px";this._hLine.style.left=l.left-i.x+a+"px";this._vLine.style.top=o-i.y+r+"px";this._vLine.style.left=a+"px"}_getEventPoint(t){return t instanceof MouseEvent?new wijmo_1.Point(t.pageX,t.pageY):new wijmo_1.Point(t.changedTouches[0].pageX,t.changedTouches[0].pageY)}_pointInRect(t,e){return!(!t||!e)&&(t.x>=e.left&&t.x<=e.left+e.width&&t.y>=e.top&&t.y<=e.top+e.height)}_getTop(){let t=0,e=this.chart._getHostComputedStyle();if(e){t+=this.chart._parsePx(e.paddingTop);t+=this.chart._parsePx(e.borderTopWidth);t+=this.chart._parsePx(e.marginTop)}return this._chart._plotRect.top+this._plot.getBoundingClientRect().top-t}}LineMarker._CSS_MARKER="wj-chart-linemarker";LineMarker._CSS_MARKER_HLINE="wj-chart-linemarker-hline";LineMarker._CSS_MARKER_VLINE="wj-chart-linemarker-vline";LineMarker._CSS_MARKER_CONTENT="wj-chart-linemarker-content";LineMarker._CSS_MARKER_CONTAINER="wj-chart-linemarker-container";LineMarker._CSS_LINE_DRAGGABLE="wj-chart-linemarker-draggable";LineMarker._CSS_TOUCH_DISABLED="wj-flexchart-touch-disabled";exports.LineMarker=LineMarker;class _BasePlotter{constructor(){this._DEFAULT_WIDTH=2;this._DEFAULT_SYM_SIZE=10;this.clipping=!0}clear(){this.seriesCount=0;this.seriesIndex=0}_renderLabels(t,e,i,s,r){var a=i.length,n=s.dataLabel,h=n.border,l=n.offset,o=n.connectingLine;void 0===l&&(l=o?16:0);h&&(l-=2);for(var _=0;_<a;_++){var d=i[_],c=wijmo_1.asType(d.tag,_DataPoint,!0);c&&!d.ignoreLabel&&this._renderLabel(t,d,c,s,n,e,l,r)}}_renderLabel(t,e,i,s,r,a,n,h){var l=null==r.position?LabelPosition.Top:r.position,o=r.border,_=r.connectingLine,d=new HitTestInfo(s,u);d._setDataPoint(i);var c=s._getLabelContent(d,r.content),u=this._getLabelPoint(a,i);this._getPointAndPosition(u,l,e,s);if(s._plotRect.contains(u)){var g=new DataLabelRenderEventArgs(t,d,u,c);if(r.onRendering)if(r.onRendering(g)){c=g.text;u=g.point}else c=null;if(c){var m=this._renderLabelAndBorder(t,c,l,n,u,_,2,o);if(m){var f=new _RectArea(m);f.tag=i;h.push(f)}}t.cssPriority=!0}}_getPointAndPosition(t,e,i,s){if(i instanceof _RectArea){var r=i;s._isRotated()?t.y=r.rect.top+.5*r.rect.height:t.x=r.rect.left+.5*r.rect.width}}_getLabelPoint(t,e){var i=t._getAxisX(),s=t._getAxisY();return new wijmo_1.Point(i.convert(e.dataX),s.convert(e.dataY))}_renderLabelAndBorder(t,e,i,s,r,a,n,h){var l,o="wj-data-label",_="wj-data-label-line",d=FlexChartCore._CSS_DATA_LABELS;switch(i){case LabelPosition.Top:a&&t.drawLine(r.x,r.y,r.x,r.y-s,_);r.y-=n+s;l=FlexChartCore._renderText(t,e,r,1,2,o,d);break;case LabelPosition.Bottom:a&&t.drawLine(r.x,r.y,r.x,r.y+s,_);r.y+=n+s;l=FlexChartCore._renderText(t,e,r,1,0,o,d);break;case LabelPosition.Left:a&&t.drawLine(r.x,r.y,r.x-s,r.y,_);r.x-=n+s;l=FlexChartCore._renderText(t,e,r,2,1,o,d);break;case LabelPosition.Right:a&&t.drawLine(r.x,r.y,r.x+s,r.y,_);r.x+=n+s;l=FlexChartCore._renderText(t,e,r,0,1,o,d);break;case LabelPosition.Center:l=FlexChartCore._renderText(t,e,r,1,1,o,d)}h&&l&&t.drawRect(l.left-n,l.top-n,l.width+2*n,l.height+2*n,"wj-data-label-border");return l}getOption(t,e){var i=this.chart._options;e&&(i=i?i[e]:null);if(i&&!wijmo_1.isUndefined(i[t])&&null!==i[t])return i[t]}getNumOption(t,e){var i=this.chart._options;e&&(i=i?i[e]:null);if(i&&i[t])return wijmo_1.asNumber(i[t],!0)}getItemFormatter(t){if(t instanceof SeriesBase){var e=t;return e.itemFormatter?e.itemFormatter:this.chart.itemFormatter}return this.chart.itemFormatter}static cloneStyle(t,e){if(!t)return t;var i={};for(var s in t)e&&e.indexOf(s)>=0||(i[s]=t[s]);return i}isValid(t,e,i,s){return isFinite(t)&&isFinite(e)&&FlexChartCore._contains(this.chart._plotRect,new wijmo_1.Point(t,e))}load(){}unload(){}_createSteps(t,e,i){let s=this.getOption("position","step"),r=i||t.length,a=[],n=[],h=this.chart._isRotated();if("center"==s)if(h)for(let i=0;i<r;i++){let s=0==i?e[i+1]-e[i]:e[i]-e[i-1],h=i==r-1?e[i]-e[i-1]:e[i+1]-e[i];a.push(t[i]);n.push(e[i]-.5*s);a.push(t[i]);n.push(e[i]+.5*h)}else for(let i=0;i<r;i++){let s=0==i?t[i+1]-t[i]:t[i]-t[i-1],h=i==r-1?t[i]-t[i-1]:t[i+1]-t[i];a.push(t[i]-.5*s);n.push(e[i]);a.push(t[i]+.5*h);n.push(e[i])}else if("end"==s)for(let i=0;i<r;i++){if(i>0)if(h){a.push(t[i]);n.push(e[i-1])}else{a.push(t[i-1]);n.push(e[i])}a.push(t[i]);n.push(e[i])}else for(let i=0;i<r;i++){a.push(t[i]);n.push(e[i]);if(i<r-1)if(h){a.push(t[i]);n.push(e[i+1])}else{a.push(t[i+1]);n.push(e[i])}}return{x:a,y:n}}}exports._BasePlotter=_BasePlotter;class _AreaPlotter extends _BasePlotter{constructor(){super();this.stacking=Stacking.None;this.isSpline=!1;this.isStep=!1;this.stackPos={};this.stackNeg={}}adjustLimits(t,e){this.dataInfo=t;let i=t.getMinX(),s=t.getMinY(),r=t.getMaxX(),a=t.getMaxY();for(let t=0;t<this.chart.series.length;t++){let e=this.chart.series[t];if(this._isRange(e)){let t=e._getChartType();if(!t||t==ChartType.Area){let t=e._getBindingValues(1);for(let e=0;e<t.length;e++)t[e]>a?a=t[e]:t[e]<s&&(s=t[e])}}}if(this.isSpline){let t=.1*(a-s);this.chart.axisY._getLogBase()||(s-=t);a+=t}return this.rotated?new wijmo_1.Rect(s,i,a-s,r-i):new wijmo_1.Rect(i,s,r-i,a-s)}clear(){super.clear();this.stackNeg={};this.stackPos={}}plotSeries(t,e,i,s,r,a,n,h){let l=s;if(this._isRange(l)){this.plotSeriesRanged(t,e,i,s,r,a,n,h);return}let o=[],_=this.chart.series.indexOf(s),d=s.getValues(0),c=s.getValues(1);if(!d)return;let u=d.length;if(!u)return;c||(c=this.dataInfo.getXVals());let g=!0;if(c)c.length<u&&(u=c.length);else{g=!1;c=new Array(u)}let m=new Array,f=new Array,p=new Array,x=new Array,w=this.stacking!=Stacking.None&&!l._isCustomAxisY(),v=this.stacking==Stacking.Stacked100pc&&!l._isCustomAxisY();void 0!==l._getChartType()&&(w=v=!1);let b=this.rotated,y=!1,S=l.interpolateNulls,C=null,T=null,M=this.chart._plotRect;for(let t=0;t<u;t++){let s=g?c[t]:t,r=d[t];(null===C||s>C)&&(C=s);(null===T||s<T)&&(T=s);if(_DataInfo.isValid(s,r)){let a=b?i.convert(s):e.convert(s);if(w){if(v){r/=this.dataInfo.getStackedAbsSum(s)}let t=0;if(r>=0){t=isNaN(this.stackPos[s])?0:this.stackPos[s];r=this.stackPos[s]=t+r}else{t=isNaN(this.stackNeg[s])?0:this.stackNeg[s];r=this.stackNeg[s]=t+r}if(b){t<e.actualMin&&(t=e.actualMin);p.push(e.convert(t));x.push(a)}else{p.push(a);t<i.actualMin&&(t=i.actualMin);x.push(i.convert(t))}}if(b){let i=e.convert(r);if(isNaN(a)||isNaN(i)){y=!0;if(!w&&!0!==S){m.push(void 0);f.push(void 0)}}else{m.push(i);f.push(a);if(FlexChartCore._contains(M,new wijmo_1.Point(i,a))){let e=new _CircleArea(new wijmo_1.Point(i,a),this._DEFAULT_SYM_SIZE);e.tag=new _DataPoint(_,t,r,s);this.hitTester.add(e,_)}}}else{let e=i.convert(r);if(isNaN(a)||isNaN(e)){y=!0;if(!w&&!0!==S){m.push(void 0);f.push(void 0)}}else{m.push(a);f.push(e);if(FlexChartCore._contains(M,new wijmo_1.Point(a,e))){let i=new _CircleArea(new wijmo_1.Point(a,e),this._DEFAULT_SYM_SIZE);i.tag=new _DataPoint(_,t,s,r);this.hitTester.add(i,_)}}}}else{y=!0;if(!w&&!0!==S){m.push(void 0);f.push(void 0)}}}h&&m.forEach((t,e)=>{null!=t&&o.push(new wijmo_1.Point(t,f[e]))});let P=this._DEFAULT_WIDTH,A=r._getColorLight(_),L=r._getColor(_),E=_BasePlotter.cloneStyle(s.style,["fill"]),k=_BasePlotter.cloneStyle(s.style,["stroke"]);if(!w&&!0!==S&&y){let s=[],r=[];for(let a=0;a<u;a++)if(void 0===m[a]){if(s.length>1){let a=this._modifyPoints(s,r);s=a.x;r=a.y;t.stroke=L;t.strokeWidth=P;t.fill="none";t.drawLines(s,r,null,E);this.hitTester.add(new _LinesArea(s,r),_);if(b){s.push(e.convert(e.actualMin),e.convert(e.actualMin));r.push(i.convert(i.actualMax),i.convert(i.actualMin))}else{s.push(s[s.length-1],s[0]);r.push(i.convert(i.actualMin),i.convert(i.actualMin))}t.fill=A;t.stroke="none";t.drawPolygon(s,r,null,k,this.chart._plotrectId)}s=[];r=[]}else{s.push(m[a]);r.push(f[a])}if(s.length>1){let a=this._modifyPoints(s,r);s=a.x;r=a.y;t.stroke=L;t.strokeWidth=P;t.fill="none";t.drawLines(s,r,null,E);this.hitTester.add(new _LinesArea(s,r),_);if(b){s.push(e.convert(e.actualMin),e.convert(e.actualMin));r.push(i.convert(i.actualMax),i.convert(i.actualMin))}else{s.push(s[s.length-1],s[0]);r.push(i.convert(i.actualMin),i.convert(i.actualMin))}t.fill=A;t.stroke="none";t.drawPolygon(s,r,null,k,this.chart._plotrectId)}}else{let s=this._modifyPoints(m,f);m=s.x;f=s.y;if(w){let t=this._modifyPoints(p,x);p=t.x;x=t.y;m=m.concat(p.reverse());f=f.concat(x.reverse())}else if(b){m.push(e.convert(e.actualMin),e.convert(e.actualMin));f.push(f[f.length-1],f[0])}else{m.push(m[m.length-1],m[0]);f.push(i.convert(i.actualMin),i.convert(i.actualMin))}t.fill=A;t.stroke="none";t.drawPolygon(m,f,null,k,this.chart._plotrectId);if(w){m=m.slice(0,m.length-p.length);f=f.slice(0,f.length-x.length)}else{m=m.slice(0,m.length-2);f=f.slice(0,f.length-2)}t.stroke=L;t.strokeWidth=P;t.fill="none";t.drawLines(m,f,null,E,this.chart._plotrectId);this.hitTester.add(new _LinesArea(m,f),_)}this._drawSymbols(t,s,_);h&&o&&o.length&&h(o)}_isRange(t){let e=this.chart?this.chart._bindingSeparator:",",i=null==t.binding?null:t.binding.split(e);return null!=i&&2==i.length}_modifyPoints(t,e){let i={x:t,y:e};if(this.isSpline){let s=this._convertToSpline(t,e);i.x=s.xs;i.y=s.ys}else if(this.isStep){let s=this._createSteps(t,e);i.x=s.x;i.y=s.y}return i}plotSeriesRanged(t,e,i,s,r,a,n,h){let l=[],o=this.chart.series.indexOf(s),_=s,d=s.getValues(0),c=s.getValues(1),u=_._getBindingValues(1);if(!d)return;let g=d.length;if(!g)return;c||(c=this.dataInfo.getXVals());let m=!0;if(c)c.length<g&&(g=c.length);else{m=!1;c=new Array(g)}let f=new Array,p=new Array,x=new Array,w=this.rotated,v=!1,b=_.interpolateNulls,y=this.chart._plotRect;for(let t=0;t<g;t++){let s=m?c[t]:t,r=d[t],a=u[t];if(_DataInfo.isValid(s,r,a)){let n=w?i.convert(s):e.convert(s);if(w){let i=e.convert(r),h=e.convert(a);if(isNaN(n)||isNaN(i)){v=!0;if(!0!==b){f.push(void 0);p.push(void 0);x.push(void 0)}}else{f.push(i);p.push(n);x.push(h);if(FlexChartCore._contains(y,new wijmo_1.Point(i,n))){let e=new _CircleArea(new wijmo_1.Point(i,n),this._DEFAULT_SYM_SIZE);e.tag=new _DataPoint(o,t,r,s);this.hitTester.add(e,o)}if(FlexChartCore._contains(y,new wijmo_1.Point(h,n))){let e=new _CircleArea(new wijmo_1.Point(h,n),this._DEFAULT_SYM_SIZE);e.tag=new _DataPoint(o,t,a,s);this.hitTester.add(e,o)}}}else{let e=i.convert(r),h=i.convert(a);if(isNaN(n)||isNaN(e)){v=!0;if(!0!==b){f.push(void 0);p.push(void 0);x.push(void 0)}}else{f.push(n);p.push(e);x.push(h);if(FlexChartCore._contains(y,new wijmo_1.Point(n,e))){let i=new _CircleArea(new wijmo_1.Point(n,e),this._DEFAULT_SYM_SIZE);i.tag=new _DataPoint(o,t,s,r);this.hitTester.add(i,o)}if(FlexChartCore._contains(y,new wijmo_1.Point(n,h))){let e=new _CircleArea(new wijmo_1.Point(n,h),this._DEFAULT_SYM_SIZE);e.tag=new _DataPoint(o,t,s,a);this.hitTester.add(e,o)}}}}else{v=!0;if(!0!==b){f.push(void 0);p.push(void 0);x.push(void 0)}}}h&&f.forEach((t,e)=>{null!=t&&l.push(new wijmo_1.Point(t,p[e]))});let S=this._DEFAULT_WIDTH,C=r._getColorLight(o),T=r._getColor(o),M=_BasePlotter.cloneStyle(s.style,["fill"]),P=_BasePlotter.cloneStyle(s.style,["stroke"]);if(!0!==b&&v){let e=[],i=[],s=[];for(let r=0;r<g;r++)if(void 0===f[r]){if(e.length>1){let r=w?s.slice(0).reverse():e.slice(0).reverse(),a=w?i.slice(0).reverse():s.slice(0).reverse();this._drawRangedArea(t,e,i,r,a,C,T,S,P,M);this.hitTester.add(new _LinesArea(e,i),o);this.hitTester.add(new _LinesArea(r,a),o)}e=[];i=[];s=[]}else{e.push(f[r]);i.push(p[r]);s.push(x[r])}if(e.length>1){let r=w?s.slice(0).reverse():e.slice(0).reverse(),a=w?i.slice(0).reverse():s.slice(0).reverse();this._drawRangedArea(t,e,i,r,a,C,T,S,P,M);this.hitTester.add(new _LinesArea(e,i),o);this.hitTester.add(new _LinesArea(r,a),o)}}else{let e=w?x.slice(0).reverse():f.slice(0).reverse(),i=w?p.slice(0).reverse():x.slice(0).reverse();this._drawRangedArea(t,f,p,e,i,C,T,S,P,M);this.hitTester.add(new _LinesArea(f,p),o);this.hitTester.add(new _LinesArea(e,i),o)}this._drawSymbols(t,s,o);h&&l&&l.length&&h(l)}_drawRangedArea(t,e,i,s,r,a,n,h,l,o){if(this.isSpline){let t=this._convertToSpline(e,i),a=this._convertToSpline(s,r);e=t.xs;i=t.ys;s=a.xs;r=a.ys}e=e.concat(s);i=i.concat(r);t.fill=a;t.stroke="none";t.drawPolygon(e,i,null,l);e=e.slice(0,e.length-s.length);i=i.slice(0,i.length-r.length);t.stroke=n;t.strokeWidth=h;t.fill="none";t.drawLines(e,i,null,o);t.drawLines(s,r,null,o)}_convertToSpline(t,e){if(t&&e){var i=new _Spline(t,e).calculate();return{xs:i.xs,ys:i.ys}}return{xs:t,ys:e}}_drawSymbols(t,e,i){let s=this.getItemFormatter(e);if(null!=s){let e=this.hitTester._map[i];for(let i=0;i<e.length;i++){let r=wijmo_1.tryCast(e[i],_CircleArea);if(r){let e=r.tag;t.startGroup();let i=new HitTestInfo(this.chart,r.center,ChartElement.SeriesSymbol);i._setDataPoint(e);s(t,i,()=>{});t.endGroup()}}t.cssPriority=!0}}}exports._AreaPlotter=_AreaPlotter;class _BarPlotter extends _BasePlotter{constructor(){super(...arguments);this.origin=0;this.width=.7;this.isVolume=!1;this._volHelper=null;this.stackPosMap={};this.stackNegMap={};this.stacking=Stacking.None}clear(){super.clear();this.stackNegMap[this.chart.axisY._uniqueId]={};this.stackPosMap[this.chart.axisY._uniqueId]={};this._volHelper=null}load(){super.load();if(this.isVolume){var t,e,i,s,r,a,n,h,l=null,o=null;for(a=0;a<this.chart.series.length;a++){r=(t=this.chart.series[a]).getDataType(1)||t.chart._xDataType;e=t._getAxisX();if((i=null===(i=t._getChartType())||wijmo_1.isUndefined(i)?this.chart._getChartType():i)===ChartType.Column){let e=this.chart?this.chart._bindingSeparator:",",i=t.binding.split(e).length-1;s=t._getBindingValues(i)}else s=i===ChartType.Candlestick?t._getBindingValues(4):null;if(r===wijmo_1.DataType.Date){var _;n=[];h=[];for(a=0;a<t._getLength();a++){_=t._getItem(a)[t.bindingX].valueOf();n.push(_);h.push({value:_,text:wijmo_1.Globalize.format(new Date(_),e.format||"d")})}}else n=this.dataInfo.getXVals();l=this.dataInfo.getMinX();o=this.dataInfo.getMaxX();if(s&&s.length>0){this._volHelper=new _VolumeHelper(s,n,l,o,r);e._customConvert=this._volHelper.convert.bind(this._volHelper);e._customConvertBack=this._volHelper.convertBack.bind(this._volHelper);h&&h.length>0&&(this._itemsSource=e.itemsSource=h);break}}}}unload(){super.unload();for(var t,e=0;e<this.chart.series.length;e++)if(t=this.chart.series[e]._getAxisX()){t._customConvert=null;t._customConvertBack=null;t.itemsSource&&t.itemsSource==this._itemsSource&&(this._itemsSource=t.itemsSource=null)}}adjustLimits(t,e){this.dataInfo=t;var i=t.getMinX(),s=t.getMaxX(),r=t.getMinY(),a=t.getMaxY(),n=t.getDeltaX();n<=0&&(n=1);let h=!1;!this.isVolume||this.chart._getChartType()!==ChartType.Column&&this.chart._getChartType()!==ChartType.Candlestick?this.unload():this.load();for(let t=0;t<this.chart.series.length;t++){let e=this.chart.series[t],i=e._getChartType();if((i=null===i||wijmo_1.isUndefined(i)?this.chart._getChartType():i)===ChartType.Column||i===ChartType.Bar){if(this._isRange(e)){e._getBindingValues(1).forEach(t=>{t<r?r=t:t>a&&(a=t)})}}h||"BoxWhisker"==e.constructor.name||(h=!0)}if(this.rotated){!this.chart.axisY._getLogBase()&&t.getDataTypeY()!==wijmo_1.DataType.Date&&h&&(this.origin>a?a=this.origin:this.origin<r&&(r=this.origin));return new wijmo_1.Rect(r,i-.5*n,a-r,s-i+n)}!this.chart.axisY._getLogBase()&&t.getDataTypeY()!==wijmo_1.DataType.Date&&h&&(this.origin>a?a=this.origin:this.origin<r&&(r=this.origin));return new wijmo_1.Rect(i-.5*n,r,s-i+n,a-r)}_isRange(t){let e=this.chart?this.chart._bindingSeparator:",",i=(null==t.binding?"":t.binding.split(e)).length-1;return this.isVolume?2===i:1===i}plotSeries(t,e,i,s,r,a,n,h){var l=[],o=this.chart.series.indexOf(s),_=wijmo_1.asType(s,SeriesBase),d=this.chart._options,c=this.width,u=0;a=a||0;n=n||1;if(d&&d.groupWidth){var g=d.groupWidth;if(wijmo_1.isNumber(g)){var m=wijmo_1.asNumber(g);if(isFinite(m)&&m>0){u=m;c=1}}else if(wijmo_1.isString(g)){var f=wijmo_1.asString(g);if(f&&f.indexOf("%")>=0){f=f.replace("%","");m=parseFloat(f);if(isFinite(m)){m<0?m=0:m>100&&(m=100);u=0;c=m/100}}else{m=parseFloat(f);if(isFinite(m)&&m>0){u=m;c=1}}}}var p=c/n,x=_._getAxisY()._uniqueId,w=this.stackNegMap[x],v=this.stackPosMap[x],b=s.getValues(0),y=s.getValues(1);let S=this._isRange(_),C=_._bindValues(null==_._cv?null==this.chart.collectionView?null:this.chart.collectionView.items:_._cv.items,_._getBinding(1)).values;if(!b)return;y||(y=this.dataInfo.getXVals());if(y){var T=this.dataInfo.getDeltaX();if(T>0){c*=T;p*=T}}var M=_._getSymbolFill(o),P=_._getAltSymbolFill(o)||M,A=_._getSymbolStroke(o),L=_._getAltSymbolStroke(o)||A,E=b.length;null!=y&&(E=Math.min(E,y.length));var k,j,N=this.origin,I=0,D=this.stacking!=Stacking.None,R=this.stacking==Stacking.Stacked100pc;void 0!==_._getChartType()&&(D=R=!1);let F=this.getItemFormatter(s),B=e._actualMin,V=e._actualMax,z=i._actualMin,X=i._actualMax;if(this.rotated){N<B?N=B:N>V&&(N=V);_._isCustomAxisY()&&(D=R=!1);for(G=e.convert(N),H=0;H<E;H++){Y=y?y[H]:H,U=b[H];let r=G;this._getSymbolOrigin&&(r=i.convert(this._getSymbolOrigin(N,H)));if(S&&C&&C.length){let t=C[H];_DataInfo.isValid(t)&&(r=e.convert(t))}if(this._getSymbolStyles){M=(W=this._getSymbolStyles(H))&&W.fill?W.fill:M;P=W&&W.fill?W.fill:P;A=W&&W.stroke?W.fill:A;L=W&&W.stroke?W.fill:L}k=U>0?M:P;j=U>0?A:L;t.fill=k;t.stroke=j;if(_DataInfo.isValid(Y,U))if(D){K=Y+.5*c;if((q=Y-.5*c)<z&&K<z||q>X&&K>X)continue;q=i.convert(Math.max(q,z));K=i.convert(Math.min(K,X));if(R){U/=this.dataInfo.getStackedAbsSum(Y)}$=0;if(U>=0){$=isNaN(v[Y])?0:v[Y];et=e.convert($);Z=e.convert($+U);v[Y]=$+U}else{$=isNaN(w[Y])?0:w[Y];et=e.convert($);Z=e.convert($+U);w[Y]=$+U}h&&l.push(new wijmo_1.Point(Z,i.convert(Y)));if(!_DataInfo.isValid(et,Z))continue;J=new wijmo_1.Rect(Math.min(et,Z),Math.min(q,K),Math.abs(Z-et),Math.abs(K-q));if(u>0){(st=1-u/J.height)<0&&(st=0);var O=J.top+.5*J.height;J.top+=(O-J.top)*st;J.height=Math.min(u,J.height)}tt=new _RectArea(J);this.drawSymbol(t,J,s,H,new wijmo_1.Point(Z,J.top+.5*J.height),F);s._setPointIndex(H,I);I++;const r=R?Math.min($+U,1):$+U;tt.tag=new _DataPoint(o,H,r,Y);this.hitTester.add(tt,o)}else{K=Y-.5*c+(a+1)*p;if((q=Y-.5*c+a*p)<z&&K<z||q>X&&K>X)continue;q=i.convert(Math.max(q,z));K=i.convert(Math.min(K,X));let _=e.convert(U);if(!_DataInfo.isValid(_,q,K))continue;let d=new wijmo_1.Rect(Math.min(_,r),Math.min(q,K),Math.abs(r-_),Math.abs(K-q));h&&l.push(new wijmo_1.Point(_,(q+K)/2));if(u>0){(st=1-(it=u/n)/d.height)<0&&(st=0);O=i.convert(Y);d.top+=(O-d.top)*st;d.height=Math.min(it,d.height)}tt=new _RectArea(d);this.drawSymbol(t,d,s,H,new wijmo_1.Point(_,d.top+.5*d.height),F);s._setPointIndex(H,I);I++;tt.tag=new _DataPoint(o,H,U,Y);this.hitTester.add(tt,o)}else h&&l.push(null)}}else{N<z?N=z:N>X&&(N=X);var G=i.convert(N);_._isCustomAxisY()&&(D=R=!1);for(var H=0;H<E;H++){let r=G;var Y=y?y[H]:H,U=b[H];this._getSymbolOrigin&&(r=i.convert(this._getSymbolOrigin(N,H,E)));if(S&&C&&C.length){let t=C[H];_DataInfo.isValid(t)&&(r=i.convert(t))}if(this._getSymbolStyles){var W;M=(W=this._getSymbolStyles(H,E))&&W.fill?W.fill:M;P=W&&W.fill?W.fill:P;A=W&&W.stroke?W.stroke:A;L=W&&W.stroke?W.stroke:L}k=U>0?M:P;j=U>0?A:L;t.fill=k;t.stroke=j;t.strokeWidth=null;if(_DataInfo.isValid(Y,U))if(D){var q,K,Z=Y+.5*c;if((et=Y-.5*c)<B&&Z<B||et>V&&Z>V)continue;et=e.convert(et);Z=e.convert(Z);if(!_DataInfo.isValid(et,Z))continue;if(R){U/=this.dataInfo.getStackedAbsSum(Y)}var $=0;if(U>=0){$=isNaN(v[Y])?0:v[Y];q=i.convert(Math.max($,z));K=i.convert(Math.max($+U,z));v[Y]=$+U}else{$=isNaN(w[Y])?0:w[Y];q=i.convert($);K=i.convert($+U);w[Y]=$+U}h&&l.push(new wijmo_1.Point(e.convert(Y),K));if(!_DataInfo.isValid(q,K))continue;var J=new wijmo_1.Rect(Math.min(et,Z),Math.min(q,K),Math.abs(Z-et),Math.abs(K-q));if(u>0){(st=1-u/J.width)<0&&(st=0);var Q=J.left+.5*J.width;J.left+=(Q-J.left)*st;J.width=Math.min(u,J.width)}var tt=new _RectArea(J);this.drawSymbol(t,J,s,H,new wijmo_1.Point(J.left+.5*J.width,K),F);s._setPointIndex(H,I);I++;const r=R?Math.min($+U,1):$+U;tt.tag=new _DataPoint(o,H,Y,r);this.hitTester.add(tt,o)}else{var et,Z=Y-.5*c+(a+1)*p;if((et=Y-.5*c+a*p)<B&&Z<B||et>V&&Z>V)continue;et=e.convert(et);Z=e.convert(Z);let _=i.convert(U);if(!_DataInfo.isValid(_,et,Z))continue;let d=new wijmo_1.Rect(Math.min(et,Z),Math.min(_,r),Math.abs(Z-et),Math.abs(r-_));h&&l.push(new wijmo_1.Point((et+Z)/2,_));if(u>0){var it,st;(st=1-(it=u/n)/d.width)<0&&(st=0);Q=e.convert(Y);d.left+=(Q-d.left)*st;d.width=Math.min(it,d.width)}var tt=new _RectArea(d);this.drawSymbol(t,d,s,H,new wijmo_1.Point(d.left+.5*d.width,_),F);s._setPointIndex(H,I);I++;tt.tag=new _DataPoint(o,H,Y,U);this.hitTester.add(tt,o)}else h&&l.push(null)}}h&&l&&l.length&&h(l)}drawSymbol(t,e,i,s,r,a){if(a){t.startGroup();var n=new HitTestInfo(this.chart,r,ChartElement.SeriesSymbol);n._setData(i,s);a(t,n,()=>{this.drawDefaultSymbol(t,e,i)});t.cssPriority=!0;t.endGroup()}else this.drawDefaultSymbol(t,e,i)}drawDefaultSymbol(t,e,i){t.drawRect(e.left,e.top,e.width,e.height,null,i.symbolStyle)}}exports._BarPlotter=_BarPlotter;class _FunnelPlotter extends _BasePlotter{constructor(){super(...arguments);this.stacking=Stacking.None}adjustLimits(t,e){this.dataInfo=t;var i=t.getMinX(),s=t.getMinY(),r=t.getMaxX(),a=t.getMaxY();return new wijmo_1.Rect(i,s,r-i,a-s)}plotSeries(t,e,i,s,r,a,n,h){var l=this.chart.series.indexOf(s);if(l>0)return;var o,_,d,c,u,g=wijmo_1.asType(s,SeriesBase),m=this.chart._options,f=s.getValues(0),p=s.getValues(1),x=this.chart._plotRect,w=m&&m.funnel&&null!=m.funnel.neckWidth?m.funnel.neckWidth:.2,v=m&&m.funnel&&null!=m.funnel.neckHeight?m.funnel.neckHeight:0,b=w*x.width,y=0,S=0,C=0,T=0,M=x.left,P=x.top,A=x.width,L=x.height;if(!f)return;this.rotated&&(P+=x.height);b=b||1;p||(p=this.dataInfo.getXVals());var E=f.length;null!=p&&(E=Math.min(E,p.length));let k=0;for(y=0;y<E;y++)if(_DataInfo.isValid(f[y])){S+=f[y];f[y]>k&&(k=f[y])}var j,N,I=0;if(m&&m.funnel&&"rectangle"===m.funnel.type&&k>0){v=L/E;w=A;var D=A/k;for(y=0;y<E;y++){var R=p?p[y]:y,F=f[y],B=g._getSymbolFill(y),V=g._getAltSymbolFill(y)||B,z=g._getSymbolStroke(y),X=g._getAltSymbolStroke(y)||z;if(this._getSymbolStyles){B=(U=this._getSymbolStyles(y,E))&&U.fill?U.fill:B;V=U&&U.fill?U.fill:V;z=U&&U.stroke?U.stroke:z;X=U&&U.stroke?U.stroke:X}j=F>0?B:V;N=F>0?z:X;t.fill=j;t.stroke=N;if(_DataInfo.isValid(R)&&_DataInfo.isValid(F)){D||(D=A/F);var O=D*F;M+=(w-O)/2;this.rotated&&(P-=v);t.drawRect(M,P,O,v);G=new _FunnelSegment(new wijmo_1.Point(M,P),O,v,O,v);this.rotated||(P+=v);w=O;G.tag=new _DataPoint(l,y,R,F);this.hitTester.add(G,l);s._setPointIndex(y,I);I++}}}else{C=x.left+x.width*(1-w)/2;T=x.top+x.height*(this.rotated?v:1-v);_=(1-w)*x.width/2/(x.height*(1-v));if(isNaN(_)||!isFinite(_)){A=b;M=C;P=T}o=x.width*w*x.height+x.width*(1-w)/2*x.height*(1-v);for(y=0;y<E;y++){R=p?p[y]:y,F=f[y];var G,H=[],Y=[];B=g._getSymbolFill(y),V=g._getAltSymbolFill(y)||B,z=g._getSymbolStroke(y),X=g._getAltSymbolStroke(y)||z;if(this._getSymbolStyles){var U;B=(U=this._getSymbolStyles(y,E))&&U.fill?U.fill:B;V=U&&U.fill?U.fill:V;z=U&&U.stroke?U.stroke:z;X=U&&U.stroke?U.stroke:X}j=F>0?B:V;N=F>0?z:X;t.fill=j;t.stroke=N;if(_DataInfo.isValid(R)&&_DataInfo.isValid(F)){var W=o*F/S;if(A>b){c=this._getTrapezoidOffsetY(A,W,_);if(this.rotated)if(P-c>T){H=[M,M+(d=_*c),M+A-d,M+A];Y=[P,P-c,P-c,P];G=new _FunnelSegment(new wijmo_1.Point(M,P-c),A,c,A-2*d,0,!0);A-=2*d;M+=d;P-=c}else{d=_*(c=P-T);u=(W-=this._getTrapezoidArea(A,_,c))/b;H.push(M,M+d,M+d,M+d+b,M+d+b,M+A);Y.push(P,P-c,P-c-u,P-c-u,P-c,P);G=new _FunnelSegment(new wijmo_1.Point(M,P-c-u),A,c+u,b,u,!0);A=b;M+=d;P=P-c-u}else if(P+c<T){H=[M,M+(d=_*c),M+A-d,M+A];Y=[P,P+c,P+c,P];G=new _FunnelSegment(new wijmo_1.Point(M,P),A,c,A-2*d,0);A-=2*d;M+=d;P+=c}else{d=_*(c=T-P);u=(W-=this._getTrapezoidArea(A,_,c))/b;H.push(M,M+d,M+d,M+d+b,M+d+b,M+A);Y.push(P,P+c,P+c+u,P+c+u,P+c,P);G=new _FunnelSegment(new wijmo_1.Point(M,P),A,c+u,b,u);A=b;M+=d;P=P+c+u}t.drawPolygon(H,Y)}else{u=W/b;this.rotated&&(P-=u);t.drawRect(M,P,A,u);G=new _FunnelSegment(new wijmo_1.Point(M,P),b,u,b,u);this.rotated||(P+=u)}G.tag=new _DataPoint(l,y,R,F);this.hitTester.add(G,l);s._setPointIndex(y,I);I++}}}}_getTrapezoidArea(t,e,i){var s=i*e;return s*i+(t-2*s)*i}_getTrapezoidOffsetY(t,e,i){var s=Math.pow(t/2/i,2)-e/i;return t/2/i-Math.sqrt(s>=0?s:0)}drawDefaultSymbol(t,e,i){t.drawRect(e.left,e.top,e.width,e.height,null,i.symbolStyle)}_getPointAndPosition(t,e,i,s){var r=i;t.x=r.center.x;t.y=r.center.y;e=null==e?LabelPosition.Center:e}}exports._FunnelPlotter=_FunnelPlotter;class _FunnelSegment{constructor(t,e,i,s,r,a=!1){this._startPoint=t;this._width=e;this._height=i;this._neckWidth=s;this._neckHeight=r;this._center=new wijmo_1.Point(this._startPoint.x+e/2,this._startPoint.y+i/2);this._offsetX=(e-s)/2;this._offsetY=i-r;this._rotated=a}contains(t){var e=this._startPoint,i=this._offsetX,s=this._offsetY;if(this._rotated){if(t.x>=e.x&&t.x<=e.x+this._width&&t.y>=e.y&&t.y<=e.y+this._height){if(t.x>=e.x+i&&t.x<=e.x+this._width-i)return!0;if(t.y<e.y+this._neckHeight)return!1;if(t.x<this._center.x)return(e.y+this._height-t.y)/(t.x-e.x)<s/i;if(t.x>this._center.x)return(e.y+this._height-t.y)/(e.x+this._width-t.x)<s/i}}else if(t.x>=e.x&&t.x<=e.x+this._width&&t.y>=e.y&&t.y<=e.y+this._height){if(t.x>=e.x+i&&t.x<=e.x+this._width-i)return!0;if(t.y>e.y+s)return!1;if(t.x<this._center.x)return(t.y-e.y)/(t.x-e.x)<s/i;if(t.x>this._center.x)return(t.y-e.y)/(e.x+this._width-t.x)<s/i}return!1}distance(t){if(this.contains(t))return 0;var e=this._startPoint,i=this._width,s=this._height,r=this._offsetX,a=this._offsetY;if(this._rotated){if(t.y>e.y+s)return t.x<e.x?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y+s-t.y,2)):t.x>e.x+i?Math.sqrt(Math.pow(t.x-e.x-i,2)+Math.pow(e.y+s-t.y,2)):t.y-e.y-s;if(t.y<e.y)return t.x<e.x+r?Math.sqrt(Math.pow(e.x+r-t.x,2)+Math.pow(t.y-e.y-s,2)):t.x>e.x+i-r?Math.sqrt(Math.pow(t.x-e.x-i+r,2)+Math.pow(t.y-e.y-s,2)):e.y-t.y;if(!(t.y<e.y+s-a))return t.x<e.x+r?Math.min(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(t.y-e.y-s,2)),Math.sqrt(Math.pow(t.x-r/2-e.x,2)+Math.pow(t.y-s+a/2-e.y,2)),Math.sqrt(Math.pow(t.x-r-e.x,2)+Math.pow(t.y-s+a-e.y,2))):Math.min(Math.sqrt(Math.pow(t.x-i-e.x,2)+Math.pow(t.y-s-e.y,2)),Math.sqrt(Math.pow(t.x-i+r/2-e.x,2)+Math.pow(t.y-s+a/2-e.y,2)),Math.sqrt(Math.pow(t.x-i+r-e.x,2)+Math.pow(t.y-s+a-e.y,2)));if(t.x<e.x+r)return e.x+r-t.x;if(t.x>e.x+i-r)return t.x-e.x-i+r}else{if(t.y<e.y)return t.x<e.x?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):t.x>e.x+i?Math.sqrt(Math.pow(t.x-e.x-i,2)+Math.pow(e.y-t.y,2)):e.y-t.y;if(t.y>e.y+s)return t.x<e.x+r?Math.sqrt(Math.pow(e.x+r-t.x,2)+Math.pow(t.y-e.y-s,2)):t.x>e.x+i-r?Math.sqrt(Math.pow(t.x-e.x-i+r,2)+Math.pow(t.y-e.y-s,2)):t.y-e.y-s;if(!(t.y>e.y+a))return t.x<e.x+r?Math.min(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(t.y-e.y,2)),Math.sqrt(Math.pow(t.x-r/2-e.x,2)+Math.pow(t.y-a/2-e.y,2)),Math.sqrt(Math.pow(t.x-r-e.x,2)+Math.pow(t.y-a-e.y,2))):Math.min(Math.sqrt(Math.pow(t.x-i-e.x,2)+Math.pow(t.y-e.y,2)),Math.sqrt(Math.pow(t.x-i+r/2-e.x,2)+Math.pow(t.y-a/2-e.y,2)),Math.sqrt(Math.pow(t.x-i+r-e.x,2)+Math.pow(t.y-a-e.y,2)));if(t.x<e.x+r)return e.x+r-t.x;if(t.x>e.x+i-r)return t.x-e.x-i+r}}get center(){return this._center}}exports._FunnelSegment=_FunnelSegment;class _FinancePlotter extends _BasePlotter{constructor(){super(...arguments);this.isCandle=!0;this.isArms=!1;this.isEqui=!1;this.isVolume=!1;this._volHelper=null;this._symWidth=.7}clear(){super.clear();this._volHelper=null}load(){super.load();if(this.isVolume){var t,e,i,s,r,a,n,h,l=null,o=null;for(a=0;a<this.chart.series.length;a++){r=(t=this.chart.series[a]).getDataType(1)||t.chart._xDataType;e=t._getAxisX();s=(i=null===(i=t._getChartType())||wijmo_1.isUndefined(i)?this.chart._getChartType():i)===ChartType.Column?t._getBindingValues(1):i===ChartType.Candlestick?t._getBindingValues(4):null;if(r===wijmo_1.DataType.Date){var _;n=[];h=[];for(a=0;a<t._getLength();a++){_=t._getItem(a)[t.bindingX].valueOf();n.push(_);h.push({value:_,text:wijmo_1.Globalize.format(new Date(_),e.format||"d")})}}else n=this.dataInfo.getXVals();l=this.dataInfo.getMinX();o=this.dataInfo.getMaxX();if(s&&s.length>0){this._volHelper=new _VolumeHelper(s,n,l,o,r);e._customConvert=this._volHelper.convert.bind(this._volHelper);e._customConvertBack=this._volHelper.convertBack.bind(this._volHelper);h&&h.length>0&&(this._itemsSource=e.itemsSource=h);break}}}}unload(){super.unload();for(var t,e=0;e<this.chart.series.length;e++)if(t=this.chart.series[e]._getAxisX()){t._customConvert=null;t._customConvertBack=null;t.itemsSource&&t.itemsSource==this._itemsSource&&(this._itemsSource=t.itemsSource=null)}}parseSymbolWidth(t){this._isPixel=void 0;if(t)if(wijmo_1.isNumber(t)){var e=wijmo_1.asNumber(t);if(isFinite(e)&&e>0){this._symWidth=e;this._isPixel=!0}}else if(wijmo_1.isString(t)){var i=wijmo_1.asString(t);if(i&&i.indexOf("%")>=0){i=i.replace("%","");var s=parseFloat(i);if(isFinite(s)){s<0?s=0:s>100&&(s=100);this._symWidth=s/100;this._isPixel=!1}}else{s=parseFloat(t);if(isFinite(s)&&s>0){this._symWidth=s;this._isPixel=!0}}}}adjustLimits(t,e){this.dataInfo=t;var i=t.getMinX(),s=t.getMinY(),r=t.getMaxX(),a=t.getMaxY(),n=t.getDeltaX(),h=this.chart._xDataType;n<=0&&(n=1);var l=this.chart.series,o=l.length,_=0;this.parseSymbolWidth(this.symbolWidth);!this.isVolume||this.chart._getChartType()!==ChartType.Column&&this.chart._getChartType()!==ChartType.Candlestick?this.unload():this.load();for(var d=0;d<o;d++){var c=l[d];if(!c._isCustomAxisY()){var u=c._getBinding(1),g=c._getBinding(2),m=c._getBinding(3),f=c._getLength();if(f){var p=c._getSymbolSize();p>_&&(_=p);for(var x=0;x<f;x++){var w=c._getItem(x);if(w){[u?w[u]:null,g?w[g]:null,m?w[m]:null].forEach(t=>{if(_DataInfo.isValid(t)&&null!==t){(isNaN(s)||t<s)&&(s=t);(isNaN(a)||t>a)&&(a=t)}})}}}}}var v=r-i,b=this.chart._plotRect;if(b&&b.width&&!this.isVolume){isNaN(p)&&(p=c._getSymbolSize());p+=2;var y=b.width/(b.width-p)*v;i-=.5*(y-v);v=y}return!(h===wijmo_1.DataType.Date&&this.isVolume||h===wijmo_1.DataType.Number)||this.chart._getChartType()!==ChartType.Column&&this.chart._getChartType()!==ChartType.Candlestick?this.chart._isRotated()?new wijmo_1.Rect(s,i,a-s,v):new wijmo_1.Rect(i,s,v,a-s):new wijmo_1.Rect(i-.5*n,s,r-i+n,a-s)}plotSeries(t,e,i,s,r,a,n,h){var l=wijmo_1.asType(s,SeriesBase),o=this.chart.series.indexOf(s),_=s.getValues(0),d=s.getValues(1),c=this._symWidth,u=this.chart._isRotated();if(!_)return;d||(d=this.dataInfo.getXVals());if(d){var g=this.dataInfo.getDeltaX();g>0&&!1===this._isPixel&&(c*=g)}var m=_.length,f=!0;if(d)m=Math.min(m,d.length);else{f=!1;d=new Array(m)}var p=this._DEFAULT_WIDTH,x=l._getSymbolFill(o),w=l._getAltSymbolFill(o)||"transparent",v=l._getSymbolStroke(o),b=l._getAltSymbolStroke(o)||v,y=void 0===this._isPixel?l._getSymbolSize():c;t.stroke=v;t.strokeWidth=p;t.fill=x;var S,C,T=l._getBinding(1),M=l._getBinding(2),P=l._getBinding(3),A=u?i.actualMin:e.actualMin,L=u?i.actualMax:e.actualMax,E=0,k=null,j=null;let N=this.getItemFormatter(s);for(var I=0;I<m;I++)if(k=l._getItem(I)){var D=f?d[I]:I;if(_DataInfo.isValid(D)&&A<=D&&D<=L){var R=_[I],F=T?k[T]:null,B=M?k[M]:null,V=P?k[P]:null;t.startGroup();if(this.isEqui&&null!==j){if(j[P]!==k[P]){S=j[P]<k[P]?w:x;C=j[P]<k[P]?b:v}}else{S=B<V?w:x;C=B<V?b:v}t.fill=S;t.stroke=C;t.strokeWidth=p;if(N){var z=new HitTestInfo(this.chart,new wijmo_1.Point(e.convert(D),i.convert(R)),ChartElement.SeriesSymbol);z._setData(l,I);N(t,z,()=>{this._drawSymbol(t,e,i,o,I,S,y,D,R,F,B,V)});t.cssPriority=!0}else this._drawSymbol(t,e,i,o,I,S,y,D,R,F,B,V);t.endGroup();s._setPointIndex(I,E);E++}j=k}}_drawSymbol(t,e,i,s,r,a,n,h,l,o,_,d){var c,u=null,g=null,m=null,f=null,p=this.chart._isRotated(),x=p?new _DataPoint(s,r,l,h):new _DataPoint(s,r,h,l);if(p){var w=i;i=e;e=w}if(!1===this._isPixel&&(m=e.convert(h-.5*n))>(f=e.convert(h+.5*n))){var v=m;m=f;f=v}h=e.convert(h);if(!1!==this._isPixel){m=h-.5*n;f=h+.5*n}if(this.isCandle){if(_DataInfo.isValid(_)&&_DataInfo.isValid(d)){_=i.convert(_);d=i.convert(d);g=(u=Math.min(_,d))+Math.abs(_-d);if(p){t.drawRect(u,m,g-u||1,f-m||1);c=new _RectArea(new wijmo_1.Rect(u,m,g-u||1,f-m||1))}else{t.drawRect(m,u,f-m||1,g-u||1);c=new _RectArea(new wijmo_1.Rect(m,u,f-m||1,g-u||1))}c.tag=x;this.hitTester.add(c,s)}if(_DataInfo.isValid(l)){l=i.convert(l);if(null!==u)if(p){t.drawLine(g,h,l,h);c.rect.width=c.rect.width+l}else{t.drawLine(h,u,h,l);c.rect.top=l;c.rect.height=c.rect.height+l}}if(_DataInfo.isValid(o)){o=i.convert(o);if(null!==g)if(p){t.drawLine(u,h,o,h);c.rect.left=o;c.rect.width=c.rect.width+o}else{t.drawLine(h,g,h,o);c.rect.height=c.rect.height+o}}}else if(this.isEqui){if(_DataInfo.isValid(l)&&_DataInfo.isValid(o)){l=i.convert(l);o=i.convert(o);g=(u=Math.min(l,o))+Math.abs(l-o);t.drawRect(m,u,f-m||1,g-u||1);(c=new _RectArea(new wijmo_1.Rect(m,u,f-m||1,g-u||1))).tag=x;this.hitTester.add(c,s)}}else if(this.isArms){if(_DataInfo.isValid(_)&&_DataInfo.isValid(d)){_=i.convert(_);d=i.convert(d);g=(u=Math.min(_,d))+Math.abs(_-d);t.drawRect(m,u,f-m||1,g-u||1)}if(_DataInfo.isValid(l)&&null!==u){l=i.convert(l);t.drawLine(h,u,h,l)}if(_DataInfo.isValid(o)&&null!==g){o=i.convert(o);t.drawLine(h,g,h,o)}if(_DataInfo.isValid(l)&&_DataInfo.isValid(o)){t.fill="transparent";g=(u=Math.min(l,o))+Math.abs(l-o);t.drawRect(m,u,f-m||1,g-u||1);(c=new _RectArea(new wijmo_1.Rect(m,u,f-m||1,g-u||1))).tag=x;this.hitTester.add(c,s)}}else{if(_DataInfo.isValid(l)&&_DataInfo.isValid(o)){l=i.convert(l);o=i.convert(o);g=(u=Math.min(l,o))+Math.abs(l-o);if(p){t.drawLine(o,h,l,h);c=new _RectArea(new wijmo_1.Rect(u,m,g-u||1,f-m||1))}else{t.drawLine(h,o,h,l);c=new _RectArea(new wijmo_1.Rect(m,u,f-m||1,g-u||1))}c.tag=x;this.hitTester.add(c,s)}if(_DataInfo.isValid(_)){_=i.convert(_);p?t.drawLine(_,m,_,h):t.drawLine(m,_,h,_)}if(_DataInfo.isValid(d)){d=i.convert(d);p?t.drawLine(d,h,d,f):t.drawLine(h,d,f,d)}}}}exports._FinancePlotter=_FinancePlotter;class _LinePlotter extends _BasePlotter{constructor(){super();this.hasSymbols=!1;this.hasLines=!0;this.isSpline=!1;this.isStep=!1;this.hitTestSymbols=!0;this.stacking=Stacking.None;this.stackPos={};this.stackNeg={};this.clipping=!1}clear(){super.clear();this.stackNeg={};this.stackPos={}}adjustLimits(t,e){this.dataInfo=t;var i=t.getMinX(),s=t.getMinY(),r=t.getMaxX(),a=t.getMaxY();if(this.isSpline&&!this.chart.axisY._getLogBase()){var n=.1*(a-s);s-=n;a+=n}return this.rotated?new wijmo_1.Rect(s,i,a-s,r-i):new wijmo_1.Rect(i,s,r-i,a-s)}plotSeries(t,e,i,s,r,a,n,h){var l=[],o=wijmo_1.asType(s,SeriesBase),_=this.chart.series.indexOf(s),d=s.getValues(0),c=s.getValues(1);if(!d)return;c||(c=this.dataInfo.getXVals());var u=_BasePlotter.cloneStyle(s.style,["fill"]),g=d.length,m=!0;if(c)g=Math.min(g,c.length);else{m=!1;c=new Array(g)}var f=this._DEFAULT_WIDTH,p=o._getSymbolFill(_),x=o._getAltSymbolFill(_)||p,w=o._getSymbolStroke(_),v=o._getAltSymbolStroke(_)||w,b=o._getSymbolSize();t.stroke=w;t.strokeWidth=f;t.fill=p;let y=new Float64Array(g),S=new Float64Array(g),C=0,T=new Int8Array(g),M=0;var P=this.rotated,A=this.stacking!=Stacking.None&&!o._isCustomAxisY(),L=this.stacking==Stacking.Stacked100pc&&!o._isCustomAxisY();void 0!==o._getChartType()&&(A=L=!1);var E=o.interpolateNulls,k=!1;let j=this.getItemFormatter(s);for(var N=0;N<g;N++){var I=m?c[N]:N,D=d[N];if(isFinite(I)&&isFinite(D)){if(A){if(L){D/=this.dataInfo.getStackedAbsSum(I)}if(D>=0){var R=isNaN(this.stackPos[I])?0:this.stackPos[I];D=this.stackPos[I]=R+D}else{R=isNaN(this.stackNeg[I])?0:this.stackNeg[I];D=this.stackNeg[I]=R+D}}var F;if(P){F=new _DataPoint(_,N,D,I);var B=e.convert(D);D=i.convert(I);I=B}else{F=new _DataPoint(_,N,I,D);I=e.convert(I);D=i.convert(D)}if(isNaN(I)||isNaN(D)){k=!0;if(!0!==E){y[C]=NaN;S[C++]=NaN}T[M++]=1;h&&l.push(null)}else{y[C]=I;S[C++]=D;M++;h&&l.push(new wijmo_1.Point(I,D));if(this.hitTestSymbols){var V=new _CircleArea(new wijmo_1.Point(I,D),.5*b);V.tag=F;this.hitTester.add(V,_)}}}else{k=!0;if(!0!==E){y[C]=NaN;S[C++]=NaN}T[M++]=1;h&&l.push(null)}}var z=0;if(this.hasLines){t.fill=null;if(k&&!0!==E){var X=[],O=[];for(N=0;N<g;N++)if(isNaN(y[N])){if(X.length>1){this._drawLines(t,X,O,null,u,this.chart._plotrectId);this.hitTester.add(new _LinesArea(X,O),_);z++}X=[];O=[]}else{X.push(y[N]);O.push(S[N])}if(X.length>1){this._drawLines(t,X,O,null,u,this.chart._plotrectId);this.hitTester.add(new _LinesArea(X,O),_);z++}}else{this._drawLines(t,y,S,null,u,this.chart._plotrectId,C);this.hitTester.add(new _LinesArea(y,S),_);z++}}if(this.hasSymbols&&b>0||j){t.fill=p;var G=0;for(N=0;N<g;N++)if(!E||!T[N]){I=y[G],D=S[G];if(!1===this.hasLines||j){t.fill=d[N]>0?p:x;t.stroke=d[N]>0?w:v;t.strokeWidth=f}if(this.isValid(I,D,e,i)){this._drawSymbol(t,I,D,b,o,N,j);s._setPointIndex(N,z);z++}G++}}h&&l&&l.length&&h(l)}_drawLines(t,e,i,s,r,a,n){if(this.isSpline&&n>3)t.drawSplines(e,i,s,r,a,n);else if(this.isStep){let h=this._createSteps(e,i,n);e=h.x;i=h.y;t.drawLines(e,i,s,r,a)}else t.drawLines(e,i,s,r,a,n)}_drawSymbol(t,e,i,s,r,a,n){if(n){t.startGroup();var h=new HitTestInfo(this.chart,new wijmo_1.Point(e,i),ChartElement.SeriesSymbol);h._setData(r,a);n(t,h,()=>{this.hasSymbols&&s>0&&this._drawDefaultSymbol(t,e,i,s,r.symbolMarker,r.symbolStyle)});t.cssPriority=!0;t.endGroup()}else this._drawDefaultSymbol(t,e,i,s,r.symbolMarker,r.symbolStyle)}_drawDefaultSymbol(t,e,i,s,r,a){r==Marker.Dot?t.drawEllipse(e,i,.5*s,.5*s,null,a):r==Marker.Box&&t.drawRect(e-.5*s,i-.5*s,s,s,null,a)}}exports._LinePlotter=_LinePlotter;class _BubblePlotter extends _LinePlotter{constructor(){super();this._MIN_SIZE=5;this._MAX_SIZE=30;this.hasLines=!1;this.hasSymbols=!0;this.clipping=!0;this.hitTestSymbols=!1}adjustLimits(t,e){var i=this.getNumOption("minSize","bubble");this._minSize=i||this._MIN_SIZE;var s=this.getNumOption("maxSize","bubble");this._maxSize=s||this._MAX_SIZE;for(var r=this.chart.series,a=r.length,n=NaN,h=NaN,l=0;l<a;l++){if((f=r[l])._getChartType()==ChartType.Bubble||null==f._getChartType()&&f._chart._getChartType()==ChartType.Bubble){let t=f._getBindingValues(1);if(t)for(var o=t.length,_=0;_<o;_++)if(isFinite(t[_])){(isNaN(n)||t[_]<n)&&(n=t[_]);(isNaN(h)||t[_]>h)&&(h=t[_])}}}this._minValue=n;this._maxValue=h;let d=super.adjustLimits(t,e),c=e.left,u=e.right,g=e.top,m=e.bottom;for(l=0;l<a;l++){var f;if((f=r[l])._getChartType()==ChartType.Bubble||null==f._getChartType()&&f._chart._getChartType()==ChartType.Bubble){let t=f._getBindingValues(1),i=f.getValues(1),s=f.getValues(0);if(t&&i&&s){let r=t.length;for(_=0;_<r;_++){let r=i?i[_]:_,a=s[_],l=t[_];if(_DataInfo.isValid(r,a,l)){r=e.left+e.width*(r-d.left)/d.width;a=e.top+e.height*(a-d.top)/d.height;r-(l=this._minSize+(this._maxSize-this._minSize)*(l-n)/(h-n))<c&&(c=r-l);r+l>u&&(u=r+l);a-l<g&&(g=a-l);a+l>m&&(m=a+l)}}}}}c=e.left-c+5;u=u-e.right+5;g=e.top-g+5;m=m-e.bottom+5;var p=this.chart.axisX,x=this.chart.axisY;if(!p._isLogAxis())if(this.stacking==Stacking.Stacked100pc&&this.rotated){let t=(e.width-this._maxSize)/d.width;d.left-=.5*this._maxSize/t;d.width+=this._maxSize/t}else{let t=(e.width-(c+u))/d.width;d.left-=c/t;d.width+=(c+u)/t}if(!x._isLogAxis())if(this.stacking!=Stacking.Stacked100pc||this.rotated){let t=(e.height-(g+m))/d.height;d.top-=g/t;d.height+=(g+m)/t}else{let t=(e.height-this._maxSize)/d.height;d.top-=.5*this._maxSize/t;d.height+=this._maxSize/t}return d}_drawSymbol(t,e,i,s,r,a,n){if(null==this._minSize){var h=this.getNumOption("minSize","bubble");this._minSize=h||this._MIN_SIZE}if(null==this._maxSize){var l=this.getNumOption("maxSize","bubble");this._maxSize=l||this._MAX_SIZE}var o=r._getItem(a);if(o){var _=r._getBinding(1);if(_){s=o[_];if(isFinite(s)){null==s&&(s=this._minValue);var d=this._minValue==this._maxValue?1:Math.sqrt((s-this._minValue)/(this._maxValue-this._minValue));s=this._minSize+(this._maxSize-this._minSize)*d;if(n){var c=new HitTestInfo(this.chart,new wijmo_1.Point(e,i),ChartElement.SeriesSymbol);c._setData(r,a);t.startGroup();n(t,c,()=>{this._drawDefaultSymbol(t,e,i,s,r.symbolMarker,r.symbolStyle)});t.endGroup()}else this._drawDefaultSymbol(t,e,i,s,r.symbolMarker,r.symbolStyle);let h=r.getValues(1);h||(h=this.dataInfo.getXVals());const l=h?h[a]:a,o=r.getValues(0)[a],_=this.chart.series.indexOf(r);let u=new _CircleArea(new wijmo_1.Point(e,i),.5*s);u.tag=new _DataPoint(_,a,l,o);this.hitTester.add(u,_)}}}}}exports._BubblePlotter=_BubblePlotter;wijmo_1._registerModule("wijmo.chart",selfModule);