@progress/kendo-charts 1.19.0 → 1.19.1-dev.202110081424
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.KendoCharts=e():t.KendoCharts=e()}(window,(function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(o,r,function(e){return t[e]}.bind(null,r));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=3)}({3:function(t,e,i){"use strict";i.r(e),i.d(e,"autoMajorUnit",(function(){return wn})),i.d(e,"Point",(function(){return An})),i.d(e,"Box",(function(){return kn})),i.d(e,"Ring",(function(){return Pn})),i.d(e,"Sector",(function(){return Tn})),i.d(e,"ShapeBuilder",(function(){return On})),i.d(e,"ShapeElement",(function(){return zn})),i.d(e,"ChartElement",(function(){return Bn})),i.d(e,"BoxElement",(function(){return In})),i.d(e,"RootElement",(function(){return Dn})),i.d(e,"FloatElement",(function(){return Hn})),i.d(e,"Text",(function(){return Wn})),i.d(e,"TextBox",(function(){return Yn})),i.d(e,"Title",(function(){return Kn})),i.d(e,"AxisLabel",(function(){return $n})),i.d(e,"Axis",(function(){return rs})),i.d(e,"Note",(function(){return ts})),i.d(e,"CategoryAxis",(function(){return Cs})),i.d(e,"DateCategoryAxis",(function(){return Ls})),i.d(e,"DateValueAxis",(function(){return Ns})),i.d(e,"NumericAxis",(function(){return Hs})),i.d(e,"LogarithmicAxis",(function(){return Ys})),i.d(e,"PolarAxis",(function(){return Qs})),i.d(e,"RadarCategoryAxis",(function(){return Js})),i.d(e,"RadarNumericAxis",(function(){return oa})),i.d(e,"RadarLogarithmicAxis",(function(){return na})),i.d(e,"CurveProcessor",(function(){return aa})),i.d(e,"Gradients",(function(){return En})),i.d(e,"rectToBox",(function(){return qn})),i.d(e,"ChartAxis",(function(){return pa})),i.d(e,"ChartPane",(function(){return la})),i.d(e,"ChartPlotArea",(function(){return ua})),i.d(e,"findAxisByName",(function(){return ha})),i.d(e,"Aggregates",(function(){return ya})),i.d(e,"AreaChart",(function(){return ap})),i.d(e,"AreaSegment",(function(){return op})),i.d(e,"AxisGroupRangeTracker",(function(){return pp})),i.d(e,"Bar",(function(){return fp})),i.d(e,"BarChart",(function(){return _p})),i.d(e,"BarLabel",(function(){return cp})),i.d(e,"BoxPlotChart",(function(){return Op})),i.d(e,"BoxPlot",(function(){return Tp})),i.d(e,"BubbleChart",(function(){return Vp})),i.d(e,"Bullet",(function(){return Hp})),i.d(e,"BulletChart",(function(){return Np})),i.d(e,"CandlestickChart",(function(){return Cp})),i.d(e,"Candlestick",(function(){return Ap})),i.d(e,"CategoricalChart",(function(){return Va})),i.d(e,"CategoricalErrorBar",(function(){return Ia})),i.d(e,"CategoricalPlotArea",(function(){return Yh})),i.d(e,"Chart",(function(){return El})),i.d(e,"ChartContainer",(function(){return $p})),i.d(e,"ClipAnimation",(function(){return $a})),i.d(e,"ClusterLayout",(function(){return gp})),i.d(e,"Crosshair",(function(){return Kp})),i.d(e,"CrosshairTooltip",(function(){return Yp})),i.d(e,"DefaultAggregates",(function(){return Sh})),i.d(e,"DonutChart",(function(){return Dc})),i.d(e,"DonutPlotArea",(function(){return Uc})),i.d(e,"DonutSegment",(function(){return Vc})),i.d(e,"ErrorBarBase",(function(){return ja})),i.d(e,"ErrorRangeCalculator",(function(){return _a})),i.d(e,"Highlight",(function(){return Kh})),i.d(e,"SharedTooltip",(function(){return vc})),i.d(e,"Legend",(function(){return ac})),i.d(e,"LegendItem",(function(){return nc})),i.d(e,"LegendLayout",(function(){return rc})),i.d(e,"LineChart",(function(){return ip})),i.d(e,"LinePoint",(function(){return Ha})),i.d(e,"LineSegment",(function(){return Na})),i.d(e,"Pane",(function(){return eh})),i.d(e,"PieAnimation",(function(){return _c})),i.d(e,"PieChart",(function(){return Lc})),i.d(e,"PieChartMixin",(function(){return Bc})),i.d(e,"PiePlotArea",(function(){return zc})),i.d(e,"PieSegment",(function(){return Rc})),i.d(e,"PlotAreaBase",(function(){return xh})),i.d(e,"PlotAreaEventsMixin",(function(){return bh})),i.d(e,"PlotAreaFactory",(function(){return hc})),i.d(e,"PointEventsMixin",(function(){return Fa})),i.d(e,"RangeBar",(function(){return Ch})),i.d(e,"RangeBarChart",(function(){return Th})),i.d(e,"RangeAreaPoint",(function(){return Rh})),i.d(e,"RangeAreaChart",(function(){return Eh})),i.d(e,"ScatterChart",(function(){return Ip})),i.d(e,"ScatterErrorBar",(function(){return Rp})),i.d(e,"ScatterLineChart",(function(){return Ac})),i.d(e,"Selection",(function(){return fc})),i.d(e,"SeriesAggregator",(function(){return wh})),i.d(e,"SeriesBinder",(function(){return ma})),i.d(e,"SplineSegment",(function(){return Za})),i.d(e,"SplineAreaSegment",(function(){return sp})),i.d(e,"StackWrap",(function(){return xp})),i.d(e,"Tooltip",(function(){return dc})),i.d(e,"OHLCChart",(function(){return Fh})),i.d(e,"OHLCPoint",(function(){return Vh})),i.d(e,"WaterfallChart",(function(){return Hh})),i.d(e,"WaterfallSegment",(function(){return Uh})),i.d(e,"XYPlotArea",(function(){return Cc})),i.d(e,"MousewheelZoom",(function(){return oc})),i.d(e,"ZoomSelection",(function(){return ic})),i.d(e,"Pannable",(function(){return tc})),i.d(e,"anyHasZIndex",(function(){return Qa})),i.d(e,"appendIfNotNull",(function(){return ih})),i.d(e,"areNumbers",(function(){return Sp})),i.d(e,"bindSegments",(function(){return rh})),i.d(e,"categoriesCount",(function(){return za})),i.d(e,"countNumbers",(function(){return fa})),i.d(e,"equalsIgnoreCase",(function(){return nh})),i.d(e,"evalOptions",(function(){return La})),i.d(e,"filterSeriesByType",(function(){return sh})),i.d(e,"getDateField",(function(){return ah})),i.d(e,"getField",(function(){return va})),i.d(e,"hasGradientOverlay",(function(){return lp})),i.d(e,"hasValue",(function(){return Bp})),i.d(e,"isDateAxis",(function(){return ph})),i.d(e,"segmentVisible",(function(){return oh})),i.d(e,"singleItemOrArray",(function(){return hh})),i.d(e,"createOutOfRangePoints",(function(){return fh})),i.d(e,"ChartService",(function(){return _r})),i.d(e,"DomEventsBuilder",(function(){return Ar})),i.d(e,"FormatService",(function(){return gr})),i.d(e,"IntlService",(function(){return fr})),i.d(e,"TemplateService",(function(){return Cr})),i.d(e,"Sparkline",(function(){return Nl})),i.d(e,"Navigator",(function(){return $l})),i.d(e,"NavigatorHint",(function(){return Yl})),i.d(e,"StockChart",(function(){return tu})),i.d(e,"constants",(function(){return h})),i.d(e,"Gauge",(function(){return uu})),i.d(e,"LinearGauge",(function(){return zu})),i.d(e,"LinearPointer",(function(){return Au})),i.d(e,"ArrowLinearPointer",(function(){return Tu})),i.d(e,"BarLinearPointer",(function(){return ju})),i.d(e,"LinearScale",(function(){return xu})),i.d(e,"RadialGauge",(function(){return Qu})),i.d(e,"RadialPointer",(function(){return Ku})),i.d(e,"RadialScale",(function(){return Gu})),i.d(e,"ArcGauge",(function(){return af})),i.d(e,"RangePointer",(function(){return sf})),i.d(e,"ArcScale",(function(){return ef})),i.d(e,"CircularGauge",(function(){return pf})),i.d(e,"Barcode",(function(){return Zf})),i.d(e,"addClass",(function(){return P})),i.d(e,"removeClass",(function(){return M})),i.d(e,"alignPathToPixel",(function(){return Ko})),i.d(e,"clockwise",(function(){return Jo})),i.d(e,"convertableToNumber",(function(){return tr})),i.d(e,"deepExtend",(function(){return or})),i.d(e,"elementStyles",(function(){return pr})),i.d(e,"getSpacing",(function(){return hr})),i.d(e,"getTemplate",(function(){return Pr})),i.d(e,"getter",(function(){return Or})),i.d(e,"grep",(function(){return Rr})),i.d(e,"hasClasses",(function(){return Br})),i.d(e,"HashMap",(function(){return Ir})),i.d(e,"inArray",(function(){return Lr})),i.d(e,"interpolateValue",(function(){return zr})),i.d(e,"InstanceObserver",(function(){return Vr})),i.d(e,"isArray",(function(){return C})),i.d(e,"isFunction",(function(){return er})),i.d(e,"isNumber",(function(){return $o})),i.d(e,"isObject",(function(){return rr})),i.d(e,"isString",(function(){return Qo})),i.d(e,"map",(function(){return Fr})),i.d(e,"mousewheelDelta",(function(){return Dr})),i.d(e,"FontLoader",(function(){return nn})),i.d(e,"setDefaultOptions",(function(){return sn})),i.d(e,"sparseArrayLimits",(function(){return an})),i.d(e,"styleValue",(function(){return nr})),i.d(e,"find",(function(){return pn})),i.d(e,"elementScale",(function(){return un})),i.d(e,"autoTextColor",(function(){return yn})),i.d(e,"createHashSet",(function(){return _n})),i.d(e,"append",(function(){return Hr})),i.d(e,"bindEvents",(function(){return Gr})),i.d(e,"Class",(function(){return O})),i.d(e,"defined",(function(){return Nr})),i.d(e,"deg",(function(){return Wr})),i.d(e,"elementOffset",(function(){return qr})),i.d(e,"elementSize",(function(){return Xr})),i.d(e,"eventElement",(function(){return Yr})),i.d(e,"eventCoordinates",(function(){return Zr})),i.d(e,"last",(function(){return Kr})),i.d(e,"limitValue",(function(){return Jr})),i.d(e,"logToConsole",(function(){return fi})),i.d(e,"objectKey",(function(){return $r})),i.d(e,"rad",(function(){return Qr})),i.d(e,"round",(function(){return tn})),i.d(e,"unbindEvents",(function(){return en})),i.d(e,"valueOrDefault",(function(){return on})),i.d(e,"chartBaseTheme",(function(){return ed}));var o={};i.r(o),i.d(o,"swing",(function(){return Ve})),i.d(o,"linear",(function(){return Fe})),i.d(o,"easeOutElastic",(function(){return De}));var r={};i.r(r),i.d(r,"Surface",(function(){return eo})),i.d(r,"RootNode",(function(){return Ii})),i.d(r,"Node",(function(){return Pi})),i.d(r,"GroupNode",(function(){return Hi})),i.d(r,"ArcNode",(function(){return Di})),i.d(r,"CircleNode",(function(){return Ui})),i.d(r,"RectNode",(function(){return Ji})),i.d(r,"ImageNode",(function(){return Zi})),i.d(r,"TextNode",(function(){return to})),i.d(r,"PathNode",(function(){return Fi})),i.d(r,"MultiPathNode",(function(){return Ki})),i.d(r,"DefinitionNode",(function(){return ji})),i.d(r,"ClipNode",(function(){return Bi})),i.d(r,"GradientStopNode",(function(){return Ti})),i.d(r,"LinearGradientNode",(function(){return Oi})),i.d(r,"RadialGradientNode",(function(){return Ri})),i.d(r,"exportGroup",(function(){return Uo}));var n={};i.r(n),i.d(n,"Surface",(function(){return Eo})),i.d(n,"RootNode",(function(){return ho})),i.d(n,"Node",(function(){return so})),i.d(n,"GroupNode",(function(){return ao})),i.d(n,"ArcNode",(function(){return Mo})),i.d(n,"CircleNode",(function(){return Oo})),i.d(n,"RectNode",(function(){return jo})),i.d(n,"ImageNode",(function(){return Ro})),i.d(n,"TextNode",(function(){return Io})),i.d(n,"PathNode",(function(){return To})),i.d(n,"MultiPathNode",(function(){return Bo}));var s={};i.r(s),i.d(s,"append",(function(){return le})),i.d(s,"arabicToRoman",(function(){return Go})),i.d(s,"createPromise",(function(){return io})),i.d(s,"defined",(function(){return B})),i.d(s,"definitionId",(function(){return $})),i.d(s,"deg",(function(){return lt})),i.d(s,"encodeBase64",(function(){return qo})),i.d(s,"eventCoordinates",(function(){return ai})),i.d(s,"eventElement",(function(){return ri})),i.d(s,"isTransparent",(function(){return tt})),i.d(s,"last",(function(){return Vt})),i.d(s,"limitValue",(function(){return Yt})),i.d(s,"mergeSort",(function(){return Xo})),i.d(s,"now",(function(){return Ge})),i.d(s,"promiseAll",(function(){return oo})),i.d(s,"rad",(function(){return H})),i.d(s,"round",(function(){return V})),i.d(s,"valueOrDefault",(function(){return Q})),i.d(s,"bindEvents",(function(){return Li})),i.d(s,"elementOffset",(function(){return si})),i.d(s,"elementSize",(function(){return oi})),i.d(s,"elementStyles",(function(){return ei})),i.d(s,"unbindEvents",(function(){return zi})),i.d(s,"elementPadding",(function(){return ni})),i.d(s,"elementScale",(function(){return ci})),i.d(s,"DEG_TO_RAD",(function(){return F})),i.d(s,"MAX_NUM",(function(){return D})),i.d(s,"MIN_NUM",(function(){return U})),i.d(s,"LRUCache",(function(){return $t})),i.d(s,"TextMetrics",(function(){return se})),i.d(s,"measureText",(function(){return ae})),i.d(s,"objectKey",(function(){return ee})),i.d(s,"hashKey",(function(){return ie})),i.d(s,"normalizeText",(function(){return te}));var a={};i.r(a),i.d(a,"HasObservers",(function(){return R})),i.d(a,"Element",(function(){return et})),i.d(a,"Circle",(function(){return ct})),i.d(a,"Arc",(function(){return Jt})),i.d(a,"Path",(function(){return Zt})),i.d(a,"MultiPath",(function(){return Kt})),i.d(a,"Text",(function(){return pe})),i.d(a,"Image",(function(){return he})),i.d(a,"Group",(function(){return ue})),i.d(a,"Layout",(function(){return xe})),i.d(a,"Rect",(function(){return be})),i.d(a,"align",(function(){return we})),i.d(a,"vAlign",(function(){return Ae})),i.d(a,"stack",(function(){return Ce})),i.d(a,"vStack",(function(){return Pe})),i.d(a,"wrap",(function(){return Me})),i.d(a,"vWrap",(function(){return Oe})),i.d(a,"fit",(function(){return Re})),i.d(a,"LinearGradient",(function(){return ze})),i.d(a,"RadialGradient",(function(){return Ee})),i.d(a,"GradientStop",(function(){return Ie})),i.d(a,"Gradient",(function(){return Le})),i.d(a,"Animation",(function(){return Xe})),i.d(a,"AnimationFactory",(function(){return qe})),i.d(a,"PathParser",(function(){return Ye})),i.d(a,"parsePath",(function(){return Wt})),i.d(a,"BaseNode",(function(){return Ze})),i.d(a,"OptionsStore",(function(){return I})),i.d(a,"Surface",(function(){return Do})),i.d(a,"SurfaceFactory",(function(){return Fo})),i.d(a,"exportImage",(function(){return Yo})),i.d(a,"exportSVG",(function(){return Zo})),i.d(a,"QuadNode",(function(){return lo})),i.d(a,"ShapesQuadTree",(function(){return fo})),i.d(a,"svg",(function(){return r})),i.d(a,"canvas",(function(){return n})),i.d(a,"util",(function(){return s}));var p={};i.r(p),i.d(p,"Circle",(function(){return rt})),i.d(p,"Arc",(function(){return gt})),i.d(p,"Rect",(function(){return Y})),i.d(p,"Point",(function(){return q})),i.d(p,"Segment",(function(){return Et})),i.d(p,"Matrix",(function(){return N})),i.d(p,"Size",(function(){return X})),i.d(p,"toMatrix",(function(){return W})),i.d(p,"Transformation",(function(){return Z})),i.d(p,"transform",(function(){return K}));var h={};i.r(h),i.d(h,"NAVIGATOR_AXIS",(function(){return Kl})),i.d(h,"NAVIGATOR_PANE",(function(){return Zl}));var c="arc",l="#000",u="bottom",f="center",d="circle",y="date",v=/\{\d+:?/,g="left",m=Number.MAX_VALUE,x=-Number.MAX_VALUE,b="right",_="top",w="value",A="#fff",S="x",k="y";function C(t){return Array.isArray(t)}function P(t,e){for(var i=C(e)?e:[e],o=0;o<i.length;o++){var r=i[o];-1===t.className.indexOf(r)&&(t.className+=" "+r)}}var T=/\s+/g;function M(t,e){t&&t.className&&(t.className=t.className.replace(e,"").replace(T," "))}var O=function(){},R=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.observers=function(){return this._observers=this._observers||[],this._observers},e.prototype.addObserver=function(t){return this._observers?this._observers.push(t):this._observers=[t],this},e.prototype.removeObserver=function(t){var e=this.observers(),i=e.indexOf(t);return-1!==i&&e.splice(i,1),this},e.prototype.trigger=function(t,e){var i=this._observers;if(i&&!this._suspended)for(var o=0;o<i.length;o++){var r=i[o];r[t]&&r[t](e)}return this},e.prototype.optionsChange=function(t){void 0===t&&(t={}),t.element=this,this.trigger("optionsChange",t)},e.prototype.geometryChange=function(){this.trigger("geometryChange",{element:this})},e.prototype.suspend=function(){return this._suspended=(this._suspended||0)+1,this},e.prototype.resume=function(){return this._suspended=Math.max((this._suspended||0)-1,0),this},e.prototype._observerField=function(t,e){this[t]&&this[t].removeObserver(this),this[t]=e,e.addObserver(this)},e}(O);function B(t){return void 0!==t}var j={}.toString,I=function(t){function e(e,i){for(var o in void 0===i&&(i=""),t.call(this),this.prefix=i,e){var r=e[o];r=this._wrap(r,o),this[o]=r}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){for(var e=t.split("."),i=this;e.length&&i;){i=i[e.shift()]}return i},e.prototype.set=function(t,e){this.get(t)!==e&&(this._set(t,this._wrap(e,t)),this.optionsChange({field:this.prefix+t,value:e}))},e.prototype._set=function(t,i){var o=t.indexOf(".")>=0,r=this,n=t;if(o){for(var s=n.split("."),a=this.prefix;s.length>1;){a+=(n=s.shift())+".";var p=r[n];p||((p=new e({},a)).addObserver(this),r[n]=p),r=p}n=s[0]}r._clear(n),r[n]=i},e.prototype._clear=function(t){var e=this[t];e&&e.removeObserver&&e.removeObserver(this)},e.prototype._wrap=function(t,i){var o=j.call(t),r=t;return null!==r&&B(r)&&"[object Object]"===o&&(t instanceof e||t instanceof O||(r=new e(r,this.prefix+i+".")),r.addObserver(this)),r},e}(R);function L(t){return function(e){return this[t]!==e&&(this[t]=e,this.geometryChange()),this}}function z(t){return function(){return this[t]}}var E=function(t,e){var i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t);return function(t,e){for(var i=0;i<e.length;i++){var o=e[i],r=o.charAt(0).toUpperCase()+o.substring(1,o.length);t["set"+r]=L(o),t["get"+r]=z(o)}}(i.prototype,e),i};function V(t,e){var i,o=(i=e)?Math.pow(10,i):1;return Math.round(t*o)/o}var F=Math.PI/180,D=Number.MAX_VALUE,U=-Number.MAX_VALUE;function H(t){return t*F}var G=function(t){function e(e,i,o,r,n,s){void 0===e&&(e=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===s&&(s=0),t.call(this),this.a=e,this.b=i,this.c=o,this.d=r,this.e=n,this.f=s}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.multiplyCopy=function(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)},e.prototype.invert=function(){var t=this.a,i=this.b,o=this.c,r=this.d,n=this.e,s=this.f,a=t*r-i*o;return 0===a?null:new e(r/a,-i/a,-o/a,t/a,(o*s-r*n)/a,(i*n-t*s)/a)},e.prototype.clone=function(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)},e.prototype.equals=function(t){return!!t&&(this.a===t.a&&this.b===t.b&&this.c===t.c&&this.d===t.d&&this.e===t.e&&this.f===t.f)},e.prototype.round=function(t){return this.a=V(this.a,t),this.b=V(this.b,t),this.c=V(this.c,t),this.d=V(this.d,t),this.e=V(this.e,t),this.f=V(this.f,t),this},e.prototype.toArray=function(t){var e=[this.a,this.b,this.c,this.d,this.e,this.f];if(B(t))for(var i=0;i<e.length;i++)e[i]=V(e[i],t);return e},e.prototype.toString=function(t,e){return void 0===e&&(e=","),this.toArray(t).join(e)},e.translate=function(t,i){return new e(1,0,0,1,t,i)},e.unit=function(){return new e(1,0,0,1,0,0)},e.rotate=function(t,i,o){var r=new e;return r.a=Math.cos(H(t)),r.b=Math.sin(H(t)),r.c=-r.b,r.d=r.a,r.e=i-i*r.a+o*r.b||0,r.f=o-o*r.a-i*r.b||0,r},e.scale=function(t,i){return new e(t,0,0,i,0,0)},e}(O);G.IDENTITY=G.unit();var N=G;function W(t){return t&&"function"==typeof t.matrix?t.matrix():t}var q=function(t){function e(e,i){t.call(this),this.x=e||0,this.y=i||0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={ZERO:{configurable:!0}};return e.prototype.equals=function(t){return t&&t.x===this.x&&t.y===this.y},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.rotate=function(t,i){var o=e.create(i)||e.ZERO;return this.transform(N.rotate(t,o.x,o.y))},e.prototype.translate=function(t,e){return this.x+=t,this.y+=e,this.geometryChange(),this},e.prototype.translateWith=function(t){return this.translate(t.x,t.y)},e.prototype.move=function(t,e){return this.x=this.y=0,this.translate(t,e)},e.prototype.scale=function(t,e){return void 0===e&&(e=t),this.x*=t,this.y*=e,this.geometryChange(),this},e.prototype.scaleCopy=function(t,e){return this.clone().scale(t,e)},e.prototype.transform=function(t){var e=W(t),i=this.x,o=this.y;return this.x=e.a*i+e.c*o+e.e,this.y=e.b*i+e.d*o+e.f,this.geometryChange(),this},e.prototype.transformCopy=function(t){var e=this.clone();return t&&e.transform(t),e},e.prototype.distanceTo=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},e.prototype.round=function(t){return this.x=V(this.x,t),this.y=V(this.y,t),this.geometryChange(),this},e.prototype.toArray=function(t){var e=B(t);return[e?V(this.x,t):this.x,e?V(this.y,t):this.y]},e.prototype.toString=function(t,e){void 0===e&&(e=" ");var i=this.x,o=this.y;return B(t)&&(i=V(i,t),o=V(o,t)),i+e+o},e.create=function(t,i){if(B(t))return t instanceof e?t:1===arguments.length&&2===t.length?new e(t[0],t[1]):new e(t,i)},e.min=function(){for(var t=arguments,i=D,o=D,r=0;r<arguments.length;r++){var n=t[r];i=Math.min(n.x,i),o=Math.min(n.y,o)}return new e(i,o)},e.max=function(){for(var t=arguments,i=U,o=U,r=0;r<arguments.length;r++){var n=t[r];i=Math.max(n.x,i),o=Math.max(n.y,o)}return new e(i,o)},e.minPoint=function(){return new e(U,U)},e.maxPoint=function(){return new e(D,D)},i.ZERO.get=function(){return new e(0,0)},Object.defineProperties(e,i),e}(E(R,["x","y"])),X=function(t){function e(e,i){t.call(this),this.width=e||0,this.height=i||0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={ZERO:{configurable:!0}};return e.prototype.equals=function(t){return t&&t.width===this.width&&t.height===this.height},e.prototype.clone=function(){return new e(this.width,this.height)},e.prototype.toArray=function(t){var e=B(t);return[e?V(this.width,t):this.width,e?V(this.height,t):this.height]},e.create=function(t,i){if(B(t))return t instanceof e?t:1===arguments.length&&2===t.length?new e(t[0],t[1]):new e(t,i)},i.ZERO.get=function(){return new e(0,0)},Object.defineProperties(e,i),e}(E(R,["width","height"])),Y=function(t){function e(e,i,o){void 0===e&&(e=new q),void 0===i&&(i=new X),void 0===o&&(o=0),t.call(this),this.setOrigin(e),this.setSize(i),this.setCornerRadius(o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.origin.clone(),this.size.clone())},e.prototype.equals=function(t){return t&&t.origin.equals(this.origin)&&t.size.equals(this.size)},e.prototype.setOrigin=function(t){return this._observerField("origin",q.create(t)),this.geometryChange(),this},e.prototype.getOrigin=function(){return this.origin},e.prototype.setCornerRadius=function(t){return this.cornerRadius=Array.isArray(t)?t:[t,t],this.geometryChange(),this},e.prototype.getCornerRadius=function(){return this.cornerRadius},e.prototype.setSize=function(t){return this._observerField("size",X.create(t)),this.geometryChange(),this},e.prototype.getSize=function(){return this.size},e.prototype.width=function(){return this.size.width},e.prototype.height=function(){return this.size.height},e.prototype.topLeft=function(){return this.origin.clone()},e.prototype.bottomRight=function(){return this.origin.clone().translate(this.width(),this.height())},e.prototype.topRight=function(){return this.origin.clone().translate(this.width(),0)},e.prototype.bottomLeft=function(){return this.origin.clone().translate(0,this.height())},e.prototype.center=function(){return this.origin.clone().translate(this.width()/2,this.height()/2)},e.prototype.bbox=function(t){var i=this.topLeft().transformCopy(t),o=this.topRight().transformCopy(t),r=this.bottomRight().transformCopy(t),n=this.bottomLeft().transformCopy(t);return e.fromPoints(i,o,r,n)},e.prototype.transformCopy=function(t){return e.fromPoints(this.topLeft().transform(t),this.bottomRight().transform(t))},e.prototype.expand=function(t,e){return void 0===e&&(e=t),this.size.width+=2*t,this.size.height+=2*e,this.origin.translate(-t,-e),this},e.prototype.expandCopy=function(t,e){return this.clone().expand(t,e)},e.prototype.containsPoint=function(t){var e=this.origin,i=this.bottomRight();return!(t.x<e.x||t.y<e.y||i.x<t.x||i.y<t.y)},e.prototype._isOnPath=function(t,e){var i=this.expandCopy(e,e),o=this.expandCopy(-e,-e);return i.containsPoint(t)&&!o.containsPoint(t)},e.fromPoints=function(){var t=q.min.apply(null,arguments),i=q.max.apply(null,arguments),o=new X(i.x-t.x,i.y-t.y);return new e(t,o)},e.union=function(t,i){return e.fromPoints(q.min(t.topLeft(),i.topLeft()),q.max(t.bottomRight(),i.bottomRight()))},e.intersect=function(t,i){var o={left:t.topLeft().x,top:t.topLeft().y,right:t.bottomRight().x,bottom:t.bottomRight().y},r={left:i.topLeft().x,top:i.topLeft().y,right:i.bottomRight().x,bottom:i.bottomRight().y};if(o.left<=r.right&&r.left<=o.right&&o.top<=r.bottom&&r.top<=o.bottom)return e.fromPoints(new q(Math.max(o.left,r.left),Math.max(o.top,r.top)),new q(Math.min(o.right,r.right),Math.min(o.bottom,r.bottom)))},e}(R),Z=function(t){function e(e){void 0===e&&(e=N.unit()),t.call(this),this._matrix=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this._matrix.clone())},e.prototype.equals=function(t){return t&&t._matrix.equals(this._matrix)},e.prototype.translate=function(t,e){return this._matrix=this._matrix.multiplyCopy(N.translate(t,e)),this._optionsChange(),this},e.prototype.scale=function(t,e,i){void 0===e&&(e=t),void 0===i&&(i=null);var o=i;return o&&(o=q.create(o),this._matrix=this._matrix.multiplyCopy(N.translate(o.x,o.y))),this._matrix=this._matrix.multiplyCopy(N.scale(t,e)),o&&(this._matrix=this._matrix.multiplyCopy(N.translate(-o.x,-o.y))),this._optionsChange(),this},e.prototype.rotate=function(t,e){var i=q.create(e)||q.ZERO;return this._matrix=this._matrix.multiplyCopy(N.rotate(t,i.x,i.y)),this._optionsChange(),this},e.prototype.multiply=function(t){var e=W(t);return this._matrix=this._matrix.multiplyCopy(e),this._optionsChange(),this},e.prototype.matrix=function(t){return t?(this._matrix=t,this._optionsChange(),this):this._matrix},e.prototype._optionsChange=function(){this.optionsChange({field:"transform",value:this})},e}(R);function K(t){return null===t?null:t instanceof Z?t:new Z(t)}var J=1;function $(){return"kdef"+J++}function Q(t,e){return B(t)?t:e}function tt(t){return""===t||null===t||"none"===t||"transparent"===t||!B(t)}var et=function(t){function e(e){t.call(this),this._initOptions(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Rect"},e.prototype._initOptions=function(t){void 0===t&&(t={});var e=t.clip,i=t.transform;i&&(t.transform=K(i)),e&&!e.id&&(e.id=$()),this.options=new I(t),this.options.addObserver(this)},e.prototype.transform=function(t){if(!B(t))return this.options.get("transform");this.options.set("transform",K(t))},e.prototype.parentTransform=function(){for(var t,e=this;e.parent;){var i=(e=e.parent).transform();i&&(t=i.matrix().multiplyCopy(t||N.unit()))}if(t)return K(t)},e.prototype.currentTransform=function(t){void 0===t&&(t=this.parentTransform());var e,i=W(this.transform()),o=W(t);if(e=i&&o?o.multiplyCopy(i):i||o)return K(e)},e.prototype.visible=function(t){return B(t)?(this.options.set("visible",t),this):!1!==this.options.get("visible")},e.prototype.clip=function(t){var e=this.options;return B(t)?(t&&!t.id&&(t.id=$()),e.set("clip",t),this):e.get("clip")},e.prototype.opacity=function(t){return B(t)?(this.options.set("opacity",t),this):Q(this.options.get("opacity"),1)},e.prototype.clippedBBox=function(t){var e=this._clippedBBox(t);if(e){var i=this.clip();return i?Y.intersect(e,i.bbox(t)):e}},e.prototype.containsPoint=function(t,e){if(this.visible()){var i=this.currentTransform(e),o=t;return i&&(o=t.transformCopy(i.matrix().invert())),this._hasFill()&&this._containsPoint(o)||this._isOnPath&&this._hasStroke()&&this._isOnPath(o)}return!1},e.prototype._hasFill=function(){var t=this.options.fill;return t&&!tt(t.color)},e.prototype._hasStroke=function(){var t=this.options.stroke;return t&&t.width>0&&!tt(t.color)},e.prototype._clippedBBox=function(t){return this.bbox(t)},Object.defineProperties(e.prototype,i),e}(R);function it(t,e,i,o){var r=0,n=0;return o&&(r=Math.atan2(o.c*i,o.a*e),0!==o.b&&(n=Math.atan2(o.d*i,o.b*e))),{x:r,y:n}}var ot=Math.PI/2,rt=function(t){function e(e,i){void 0===e&&(e=new q),void 0===i&&(i=0),t.call(this),this.setCenter(e),this.setRadius(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setCenter=function(t){return this._observerField("center",q.create(t)),this.geometryChange(),this},e.prototype.getCenter=function(){return this.center},e.prototype.equals=function(t){return t&&t.center.equals(this.center)&&t.radius===this.radius},e.prototype.clone=function(){return new e(this.center.clone(),this.radius)},e.prototype.pointAt=function(t){return this._pointAt(H(t))},e.prototype.bbox=function(t){for(var e=it(this.center,this.radius,this.radius,t),i=q.maxPoint(),o=q.minPoint(),r=0;r<4;r++){var n=this._pointAt(e.x+r*ot).transformCopy(t),s=this._pointAt(e.y+r*ot).transformCopy(t),a=new q(n.x,s.y);i=q.min(i,a),o=q.max(o,a)}return Y.fromPoints(i,o)},e.prototype._pointAt=function(t){var e=this.center,i=this.radius;return new q(e.x+i*Math.cos(t),e.y+i*Math.sin(t))},e.prototype.containsPoint=function(t){var e=this.center,i=this.radius;return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<=Math.pow(i,2)},e.prototype._isOnPath=function(t,e){var i=this.center,o=this.radius,r=i.distanceTo(t);return o-e<=r&&r<=o+e},e}(E(R,["radius"])),nt=function(t){return function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.fill=function(t,e){var i=this.options;if(B(t)){if(t&&"Gradient"!==t.nodeType){var o={color:t};B(e)&&(o.opacity=e),i.set("fill",o)}else i.set("fill",t);return this}return i.get("fill")},e.prototype.stroke=function(t,e,i){return B(t)?(this.options.set("stroke.color",t),B(e)&&this.options.set("stroke.width",e),B(i)&&this.options.set("stroke.opacity",i),this):this.options.get("stroke")},e}(t)},st=N.IDENTITY.toString(),at=function(t){return function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bbox=function(t){var e,i=W(this.currentTransform(t)),o=i?i.toString():st;this._bboxCache&&this._matrixHash===o?e=this._bboxCache.clone():(e=this._bbox(i),this._bboxCache=e?e.clone():null,this._matrixHash=o);var r=this.options.get("stroke.width");return r&&e&&e.expand(r/2),e},e.prototype.geometryChange=function(){delete this._bboxCache,this.trigger("geometryChange",{element:this})},e}(t)};function pt(t){var e="_"+t;return function(t){return B(t)?(this._observerField(e,t),this.geometryChange(),this):this[e]}}var ht=function(t,e){void 0===e&&(e=["geometry"]);var i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t);return function(t,e){for(var i=0;i<e.length;i++)t[e[i]]=pt(e[i])}(i.prototype,e),i},ct=function(t){function e(e,i){void 0===e&&(e=new rt),void 0===i&&(i={}),t.call(this,i),this.geometry(e),B(this.options.stroke)||this.stroke("#000")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Circle"},e.prototype.rawBBox=function(){return this._geometry.bbox()},e.prototype._bbox=function(t){return this._geometry.bbox(t)},e.prototype._containsPoint=function(t){return this.geometry().containsPoint(t)},e.prototype._isOnPath=function(t){return this.geometry()._isOnPath(t,this.options.stroke.width/2)},Object.defineProperties(e.prototype,i),e}(nt(at(ht(et))));function lt(t){return t/F}function ut(t,e,i){return void 0===i&&(i=10),0===V(Math.abs(t-e),i)}function ft(t,e,i){return t<e||ut(t,e,i)}var dt=Math.pow;function yt(t,e,i,o,r,n){var s=V((r-t)/i,3),a=V((n-e)/o,3);return V(lt(Math.atan2(a,s)))}function vt(t,e){for(var i=t;i<e;)i+=90;return i}var gt=function(t){function e(e,i){void 0===e&&(e=new q),void 0===i&&(i={}),t.call(this),this.setCenter(e),this.radiusX=i.radiusX,this.radiusY=i.radiusY||i.radiusX,this.startAngle=i.startAngle,this.endAngle=i.endAngle,this.anticlockwise=i.anticlockwise||!1,this.xRotation=i.xRotation}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.center,{radiusX:this.radiusX,radiusY:this.radiusY,startAngle:this.startAngle,endAngle:this.endAngle,anticlockwise:this.anticlockwise})},e.prototype.setCenter=function(t){return this._observerField("center",q.create(t)),this.geometryChange(),this},e.prototype.getCenter=function(){return this.center},e.prototype.pointAt=function(t){var e=this.center,i=H(t);return new q(e.x+this.radiusX*Math.cos(i),e.y+this.radiusY*Math.sin(i))},e.prototype.curvePoints=function(){var t,e=this.startAngle,i=this.anticlockwise?-1:1,o=[this.pointAt(e)],r=this._arcInterval(),n=r.endAngle-r.startAngle,s=Math.ceil(n/45),a=n/s,p=e;this.xRotation&&(t=K().rotate(this.xRotation,this.center));for(var h=1;h<=s;h++){var c=p+i*a,l=this._intervalCurvePoints(p,c,t);o.push(l.cp1,l.cp2,l.p2),p=c}return o},e.prototype.bbox=function(t){for(var e=this._arcInterval(),i=e.startAngle,o=e.endAngle,r=it(this.center,this.radiusX,this.radiusY,t),n=lt(r.x),s=lt(r.y),a=this.pointAt(o).transformCopy(t),p=vt(n,i),h=vt(s,i),c=this.pointAt(i).transformCopy(t),l=q.min(c,a),u=q.max(c,a);p<o||h<o;){var f=void 0;p<o&&(f=this.pointAt(p).transformCopy(t),p+=90);var d=void 0;h<o&&(d=this.pointAt(h).transformCopy(t),h+=90),c=new q(f.x,d.y),l=q.min(l,c),u=q.max(u,c)}return Y.fromPoints(l,u)},e.prototype._arcInterval=function(){var t=this.startAngle,e=this.endAngle,i=this.anticlockwise;if(i){var o=t;t=e,e=o}return(t>e||i&&t===e)&&(e+=360),{startAngle:t,endAngle:e}},e.prototype._intervalCurvePoints=function(t,e,i){var o=this.pointAt(t),r=this.pointAt(e),n=this._derivativeAt(t),s=this._derivativeAt(e),a=(H(e)-H(t))/3,p=new q(o.x+a*n.x,o.y+a*n.y),h=new q(r.x-a*s.x,r.y-a*s.y);return i&&(o.transform(i),r.transform(i),p.transform(i),h.transform(i)),{p1:o,cp1:p,cp2:h,p2:r}},e.prototype._derivativeAt=function(t){var e=H(t);return new q(-this.radiusX*Math.sin(e),this.radiusY*Math.cos(e))},e.prototype.containsPoint=function(t){var e,i=this._arcInterval(),o=i.endAngle-i.startAngle,r=this.center,n=this.radiusX,s=this.radiusY,a=r.distanceTo(t),p=Math.atan2(t.y-r.y,t.x-r.x),h=n*s/Math.sqrt(dt(n,2)*dt(Math.sin(p),2)+dt(s,2)*dt(Math.cos(p),2)),c=this.pointAt(this.startAngle).round(10),l=this.pointAt(this.endAngle).round(10),u=function(t,e,i,o){var r=e.x-t.x,n=o.x-i.x,s=e.y-t.y,a=o.y-i.y,p=t.x-i.x,h=t.y-i.y,c=r*a-n*s,l=(r*h-s*p)/c,u=(n*h-a*p)/c;if(l>=0&&l<=1&&u>=0&&u<=1)return new q(t.x+u*r,t.y+u*s)}(r,t.round(10),c,l);if(o<180)e=u&&ft(r.distanceTo(u),a)&&ft(a,h);else{var f=yt(r.x,r.y,n,s,t.x,t.y);360!==f&&(f=(360+f)%360);var d=i.startAngle<=f&&f<=i.endAngle;e=d&&ft(a,h)||!d&&(!u||u.equals(t))}return e},e.prototype._isOnPath=function(t,e){var i=this._arcInterval(),o=this.center,r=yt(o.x,o.y,this.radiusX,this.radiusY,t.x,t.y);return 360!==r&&(r=(360+r)%360),i.startAngle<=r&&r<=i.endAngle&&this.pointAt(r).distanceTo(t)<=e},e.fromPoints=function(t,i,o,r,n,s,a){var p=function(t){var e=t.x1,i=t.y1,o=t.x2,r=t.y2,n=t.rx,s=t.ry,a=t.largeArc,p=t.swipe,h=t.rotation;void 0===h&&(h=0);var c=H(h),l=Math.cos(c),u=Math.sin(c),f=l*(e-o)/2+u*(i-r)/2,d=-u*(e-o)/2+l*(i-r)/2,y=a!==p?1:-1,v=Math.pow(f,2),g=Math.pow(d,2),m=Math.pow(n,2),x=Math.pow(s,2),b=v/m+g/x;b>1&&(b=Math.sqrt(v/m+g/x),n*=b,m=Math.pow(n,2),s*=b,x=Math.pow(s,2));var _=y*Math.sqrt((m*x-m*g-x*v)/(m*g+x*v));isNaN(_)&&(_=0);var w=_*(n*d)/s,A=s*f*-_/n,S=l*w-u*A+(e+o)/2,k=u*w+l*A+(i+r)/2,C=(f-w)/n,P=(d-A)/s,T=-(f+w)/n,M=-(d+A)/s,O=(P>=0?1:-1)*lt(Math.acos(C/Math.sqrt(C*C+P*P))),R=V((C*T+P*M)/(Math.sqrt(C*C+P*P)*Math.sqrt(T*T+M*M)),10),B=(C*M-P*T>=0?1:-1)*lt(Math.acos(R));!p&&B>0&&(B-=360);p&&B<0&&(B+=360);var j=O+B,I=j>=0?1:-1;return j=Math.abs(j)%360*I,{center:new q(S,k),startAngle:O,endAngle:j,radiusX:n,radiusY:s,xRotation:h}}({x1:t.x,y1:t.y,x2:i.x,y2:i.y,rx:o,ry:r,largeArc:n,swipe:s,rotation:a});return new e(p.center,{startAngle:p.startAngle,endAngle:p.endAngle,radiusX:p.radiusX,radiusY:p.radiusY,xRotation:p.xRotation,anticlockwise:0===s})},e}(E(R,["radiusX","radiusY","startAngle","endAngle","anticlockwise"])),mt=[].push,xt=[].pop,bt=[].splice,_t=[].shift,wt=[].slice,At=[].unshift,St=function(t){function e(e){void 0===e&&(e=[]),t.call(this),this.length=0,this._splice(0,e.length,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.elements=function(t){return t?(this._splice(0,this.length,t),this._change(),this):this.slice(0)},e.prototype.push=function(){var t=arguments,e=mt.apply(this,t);return this._add(t),e},e.prototype.slice=function(){return wt.call(this)},e.prototype.pop=function(){var t=this.length,e=xt.apply(this);return t&&this._remove([e]),e},e.prototype.splice=function(t,e){var i=wt.call(arguments,2),o=this._splice(t,e,i);return this._change(),o},e.prototype.shift=function(){var t=this.length,e=_t.apply(this);return t&&this._remove([e]),e},e.prototype.unshift=function(){var t=arguments,e=At.apply(this,t);return this._add(t),e},e.prototype.indexOf=function(t){for(var e=this.length,i=0;i<e;i++)if(this[i]===t)return i;return-1},e.prototype._splice=function(t,e,i){var o=bt.apply(this,[t,e].concat(i));return this._clearObserver(o),this._setObserver(i),o},e.prototype._add=function(t){this._setObserver(t),this._change()},e.prototype._remove=function(t){this._clearObserver(t),this._change()},e.prototype._setObserver=function(t){for(var e=0;e<t.length;e++)t[e].addObserver(this)},e.prototype._clearObserver=function(t){for(var e=0;e<t.length;e++)t[e].removeObserver(this)},e.prototype._change=function(){},e}(R),kt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._change=function(){this.geometryChange()},e}(St);function Ct(t,e,i){var o=lt(Math.atan2(e.y-t.y,e.x-t.x));return i.transformCopy(K().rotate(-o,t)).x<t.x}function Pt(t,e,i){var o=1-t;return Math.pow(o,3)*i[0][e]+3*Math.pow(o,2)*t*i[1][e]+3*Math.pow(t,2)*o*i[2][e]+Math.pow(t,3)*i[3][e]}function Tt(t,e){return[-t[0][e]+3*t[1][e]-3*t[2][e]+t[3][e],3*(t[0][e]-2*t[1][e]+t[2][e]),3*(-t[0][e]+t[1][e]),t[0][e]]}var Mt=function(t){function e(e,i){void 0===e&&(e=0),void 0===i&&(i=0),t.call(this),this.real=e,this.img=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.add=function(t){return new e(V(this.real+t.real,10),V(this.img+t.img,10))},e.prototype.addConstant=function(t){return new e(this.real+t,this.img)},e.prototype.negate=function(){return new e(-this.real,-this.img)},e.prototype.multiply=function(t){return new e(this.real*t.real-this.img*t.img,this.real*t.img+this.img*t.real)},e.prototype.multiplyConstant=function(t){return new e(this.real*t,this.img*t)},e.prototype.nthRoot=function(t){var i=Math.atan2(this.img,this.real),o=Math.sqrt(Math.pow(this.img,2)+Math.pow(this.real,2)),r=Math.pow(o,1/t);return new e(r*Math.cos(i/t),r*Math.sin(i/t))},e.prototype.equals=function(t){return this.real===t.real&&this.img===t.img},e.prototype.isReal=function(){return 0===this.img},e}(O);function Ot(t){return t<0?-1:1}function Rt(t,e,i,o){if(0===t)return function(t,e,i){var o=Math.sqrt(Math.pow(e,2)-4*t*i);return[(-e+o)/(2*t),(-e-o)/(2*t)]}(e,i,o);var r,n,s,a,p,h,c,l=(3*t*i-Math.pow(e,2))/(3*Math.pow(t,2)),u=(2*Math.pow(e,3)-9*t*e*i+27*Math.pow(t,2)*o)/(27*Math.pow(t,3)),f=Math.pow(l/3,3)+Math.pow(u/2,2),d=new Mt(0,1),y=-e/(3*t);f<0?(r=new Mt(-u/2,Math.sqrt(-f)).nthRoot(3),n=new Mt(-u/2,-Math.sqrt(-f)).nthRoot(3)):(r=-u/2+Math.sqrt(f),r=new Mt(Ot(r)*Math.pow(Math.abs(r),1/3)),n=-u/2-Math.sqrt(f),n=new Mt(Ot(n)*Math.pow(Math.abs(n),1/3))),s=r.add(n),h=r.add(n).multiplyConstant(-.5),c=r.add(n.negate()).multiplyConstant(Math.sqrt(3)/2),a=h.add(d.multiply(c)),p=h.add(d.negate().multiply(c));var v=[];return s.isReal()&&v.push(V(s.real+y,10)),a.isReal()&&v.push(V(a.real+y,10)),p.isReal()&&v.push(V(p.real+y,10)),v}function Bt(t,e,i,o,r){for(var n,s=Tt(t,o),a=Rt(s[0],s[1],s[2],s[3]-e[o]),p=0;p<a.length;p++)if(0<=a[p]&&a[p]<=1&&(n=Pt(a[p],i,t),Math.abs(n-e[i])<=r))return!0}function jt(t,e,i){var o;if(t.x!==e.x){var r=Math.min(t.x,e.x),n=Math.max(t.x,e.x),s=Math.min(t.y,e.y),a=Math.max(t.y,e.y),p=r<=i.x&&i.x<n;o=s===a?i.y<=s&&p:p&&(a-s)*((t.x-e.x)*(t.y-e.y)>0?i.x-r:n-i.x)/(n-r)+s-i.y>=0}return o?1:0}function It(t){var e="_"+t;return function(t){return B(t)?(this._observerField(e,q.create(t)),this.geometryChange(),this):this[e]}}var Lt=function(t,e){var i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t);return function(t,e){for(var i=0;i<e.length;i++)t[e[i]]=It(e[i])}(i.prototype,e),i};function zt(t){for(var e=t.length,i=D,o=U,r=0;r<e;r++)o=Math.max(o,t[r]),i=Math.min(i,t[r]);return{min:i,max:o}}var Et=function(t){function e(e,i,o){t.call(this),this.anchor(e||new q),this.controlIn(i),this.controlOut(o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bboxTo=function(t,e){var i=this.anchor().transformCopy(e),o=t.anchor().transformCopy(e);return this.controlOut()&&t.controlIn()?this._curveBoundingBox(i,this.controlOut().transformCopy(e),t.controlIn().transformCopy(e),o):this._lineBoundingBox(i,o)},e.prototype._lineBoundingBox=function(t,e){return Y.fromPoints(t,e)},e.prototype._curveBoundingBox=function(t,e,i,o){var r=[t,e,i,o],n=this._curveExtremesFor(r,"x"),s=this._curveExtremesFor(r,"y"),a=zt([n.min,n.max,t.x,o.x]),p=zt([s.min,s.max,t.y,o.y]);return Y.fromPoints(new q(a.min,p.min),new q(a.max,p.max))},e.prototype._curveExtremesFor=function(t,e){var i=this._curveExtremes(t[0][e],t[1][e],t[2][e],t[3][e]);return{min:Pt(i.min,e,t),max:Pt(i.max,e,t)}},e.prototype._curveExtremes=function(t,e,i,o){var r=t-3*e+3*i-o,n=-2*(t-2*e+i),s=t-e,a=Math.sqrt(n*n-4*r*s),p=0,h=1;0===r?0!==n&&(p=h=-s/n):isNaN(a)||(p=(-n+a)/(2*r),h=(-n-a)/(2*r));var c=Math.max(Math.min(p,h),0);(c<0||c>1)&&(c=0);var l=Math.min(Math.max(p,h),1);return(l>1||l<0)&&(l=1),{min:c,max:l}},e.prototype._intersectionsTo=function(t,e){return this.controlOut()&&t.controlIn()?function(t,e,i){for(var o,r=Tt(t,"x"),n=Rt(r[0],r[1],r[2],r[3]-e.x),s=0,a=0;a<n.length;a++)(ut(o=Pt(n[a],"y",t),e.y)||o>e.y)&&((0===n[a]||1===n[a])&&i.bottomRight().x>e.x||0<n[a]&&n[a]<1)&&s++;return s}([this.anchor(),this.controlOut(),t.controlIn(),t.anchor()],e,this.bboxTo(t)):jt(this.anchor(),t.anchor(),e)},e.prototype._isOnCurveTo=function(t,e,i,o){if(this.bboxTo(t).expand(i,i).containsPoint(e)){var r=this.anchor(),n=this.controlOut(),s=t.controlIn(),a=t.anchor();if("start"===o&&r.distanceTo(e)<=i)return!Ct(r,n,e);if("end"===o&&a.distanceTo(e)<=i)return!Ct(a,s,e);var p=[r,n,s,a];if(Bt(p,e,"x","y",i)||Bt(p,e,"y","x",i))return!0;var h=K().rotate(45,e),c=[r.transformCopy(h),n.transformCopy(h),s.transformCopy(h),a.transformCopy(h)];return Bt(c,e,"x","y",i)||Bt(c,e,"y","x",i)}},e.prototype._isOnLineTo=function(t,e,i){var o=this.anchor(),r=t.anchor(),n=lt(Math.atan2(r.y-o.y,r.x-o.x));return new Y([o.x,o.y-i/2],[o.distanceTo(r),i]).containsPoint(e.transformCopy(K().rotate(-n,o)))},e.prototype._isOnPathTo=function(t,e,i,o){return this.controlOut()&&t.controlIn()?this._isOnCurveTo(t,e,i/2,o):this._isOnLineTo(t,e,i)},e}(Lt(R,["anchor","controlIn","controlOut"]));function Vt(t){if(t)return t[t.length-1]}function Ft(t,e,i){for(var o=e?0:1,r=0;r<t.length;r+=2)t.splice(r+o,0,i)}function Dt(t,e){if(t&&e)return e.scaleCopy(2).translate(-t.x,-t.y)}function Ut(t,e,i){var o=e.clone().scale(2/3);return{controlOut:o.clone().translateWith(t.scaleCopy(1/3)),controlIn:o.translateWith(i.scaleCopy(1/3))}}var Ht={l:function(t,e){for(var i=e.parameters,o=e.position,r=0;r<i.length;r+=2){var n=new q(i[r],i[r+1]);e.isRelative&&n.translateWith(o),t.lineTo(n.x,n.y),o.x=n.x,o.y=n.y}},c:function(t,e){for(var i=e.parameters,o=e.position,r=0;r<i.length;r+=6){var n=new q(i[r],i[r+1]),s=new q(i[r+2],i[r+3]),a=new q(i[r+4],i[r+5]);e.isRelative&&(s.translateWith(o),n.translateWith(o),a.translateWith(o)),t.curveTo(n,s,a),o.x=a.x,o.y=a.y}},v:function(t,e){var i=e.isRelative?0:e.position.x;Ft(e.parameters,!0,i),this.l(t,e)},h:function(t,e){var i=e.isRelative?0:e.position.y;Ft(e.parameters,!1,i),this.l(t,e)},a:function(t,e){for(var i=e.parameters,o=e.position,r=0;r<i.length;r+=7){var n=i[r],s=i[r+1],a=i[r+2],p=i[r+3],h=i[r+4],c=new q(i[r+5],i[r+6]);e.isRelative&&c.translateWith(o),o.x===c.x&&o.y===c.y||(t.arcTo(c,n,s,p,h,a),o.x=c.x,o.y=c.y)}},s:function(t,e){var i,o=e.parameters,r=e.position,n=e.previousCommand;"s"!==n&&"c"!==n||(i=Vt(Vt(t.paths).segments).controlIn());for(var s=0;s<o.length;s+=4){var a=new q(o[s],o[s+1]),p=new q(o[s+2],o[s+3]),h=void 0;e.isRelative&&(a.translateWith(r),p.translateWith(r)),h=i?Dt(i,r):r.clone(),i=a,t.curveTo(h,a,p),r.x=p.x,r.y=p.y}},q:function(t,e){for(var i=e.parameters,o=e.position,r=0;r<i.length;r+=4){var n=new q(i[r],i[r+1]),s=new q(i[r+2],i[r+3]);e.isRelative&&(n.translateWith(o),s.translateWith(o));var a=Ut(o,n,s);t.curveTo(a.controlOut,a.controlIn,s),o.x=s.x,o.y=s.y}},t:function(t,e){var i,o=e.parameters,r=e.position,n=e.previousCommand;"q"!==n&&"t"!==n||(i=Vt(Vt(t.paths).segments).controlIn().clone().translateWith(r.scaleCopy(-1/3)).scale(1.5));for(var s=0;s<o.length;s+=2){var a=new q(o[s],o[s+1]);e.isRelative&&a.translateWith(r),i=i?Dt(i,r):r.clone();var p=Ut(r,i,a);t.curveTo(p.controlOut,p.controlIn,a),r.x=a.x,r.y=a.y}}},Gt=/([a-df-z]{1})([^a-df-z]*)(z)?/gi,Nt=/[,\s]?([+\-]?(?:\d*\.\d+|\d+)(?:[eE][+\-]?\d+)?)/g;var Wt=function(t,e){var i,o=new q;return e.replace(Gt,(function(e,r,n,s){var a=r.toLowerCase(),p=a===r,h=function(t){var e=[];return t.replace(Nt,(function(t,i){e.push(parseFloat(i))})),e}(n.trim());if("m"===a&&(p?(o.x+=h[0],o.y+=h[1]):(o.x=h[0],o.y=h[1]),t.moveTo(o.x,o.y),h.length>2&&(a="l",h.splice(0,2))),Ht[a])Ht[a](t,{parameters:h,position:o,isRelative:p,previousCommand:i}),s&&"z"===s.toLowerCase()&&t.close();else if("m"!==a)throw new Error("Error while parsing SVG path. Unsupported command: "+a);i=a})),t};function qt(t,e,i){for(var o,r=0;r<t.length;r++){var n=t[r];if(n.visible()){var s=e?n.bbox(i):n.rawBBox();s&&(o=o?Y.union(o,s):s)}}return o}function Xt(t,e){for(var i,o=0;o<t.length;o++){var r=t[o];if(r.visible()){var n=r.clippedBBox(e);n&&(i=i?Y.union(i,n):n)}}return i}function Yt(t,e,i){return Math.max(Math.min(t,i),e)}var Zt=function(t){function e(e){t.call(this,e),this.segments=new kt,this.segments.addObserver(this),B(this.options.stroke)||(this.stroke("#000"),B(this.options.stroke.lineJoin)||this.options.set("stroke.lineJoin","miter"))}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return e.parse=function(t,e){return Kt.parse(t,e)},i.nodeType.get=function(){return"Path"},e.prototype.moveTo=function(t,e){return this.suspend(),this.segments.elements([]),this.resume(),this.lineTo(t,e),this},e.prototype.lineTo=function(t,e){var i=B(e)?new q(t,e):t,o=new Et(i);return this.segments.push(o),this},e.prototype.curveTo=function(t,e,i){if(this.segments.length>0){var o=Vt(this.segments),r=new Et(i,e);this.suspend(),o.controlOut(t),this.resume(),this.segments.push(r)}return this},e.prototype.arc=function(t,e,i,o,r){if(this.segments.length>0){var n=Vt(this.segments).anchor(),s=H(t),a=new q(n.x-i*Math.cos(s),n.y-o*Math.sin(s)),p=new gt(a,{startAngle:t,endAngle:e,radiusX:i,radiusY:o,anticlockwise:r});this._addArcSegments(p)}return this},e.prototype.arcTo=function(t,e,i,o,r,n){if(this.segments.length>0){var s=Vt(this.segments).anchor(),a=gt.fromPoints(s,q.create(t),e,i,o,r,n);this._addArcSegments(a)}return this},e.prototype._addArcSegments=function(t){this.suspend();for(var e=t.curvePoints(),i=1;i<e.length;i+=3)this.curveTo(e[i],e[i+1],e[i+2]);this.resume(),this.geometryChange()},e.prototype.close=function(){return this.options.closed=!0,this.geometryChange(),this},e.prototype.rawBBox=function(){return this._bbox()},e.prototype._containsPoint=function(t){for(var e,i,o=this.segments,r=o.length,n=0,s=1;s<r;s++)e=o[s-1],i=o[s],n+=e._intersectionsTo(i,t);return!this.options.closed&&o[0].anchor().equals(o[r-1].anchor())||(n+=jt(o[0].anchor(),o[r-1].anchor(),t)),n%2!=0},e.prototype._isOnPath=function(t,e){var i=this.segments,o=i.length,r=e||this.options.stroke.width;if(o>1){if(i[0]._isOnPathTo(i[1],t,r,"start"))return!0;for(var n=2;n<=o-2;n++)if(i[n-1]._isOnPathTo(i[n],t,r))return!0;if(i[o-2]._isOnPathTo(i[o-1],t,r,"end"))return!0}return!1},e.prototype._bbox=function(t){var e,i=this.segments,o=i.length;if(1===o){var r=i[0].anchor().transformCopy(t);e=new Y(r,X.ZERO)}else if(o>0)for(var n=1;n<o;n++){var s=i[n-1].bboxTo(i[n],t);e=e?Y.union(e,s):s}return e},e.fromRect=function(t,i){var o=new e(i),r=t.cornerRadius,n=r[0],s=r[1];if(0===n&&0===s)o.moveTo(t.topLeft()).lineTo(t.topRight()).lineTo(t.bottomRight()).lineTo(t.bottomLeft()).close();else{var a=t.origin,p=a.x,h=a.y,c=t.width(),l=t.height();n=Yt(n,0,c/2),s=Yt(s,0,l/2),o.moveTo(p+n,h).lineTo(p+c-n,h).arcTo([p+c,h+s],n,s,!1).lineTo(p+c,h+l-s).arcTo([p+c-n,h+l],n,s,!1).lineTo(p+n,h+l).arcTo([p,h+l-s],n,s,!1).lineTo(p,h+s).arcTo([p+n,h],n,s,!1)}return o},e.fromPoints=function(t,i){if(t){for(var o=new e(i),r=0;r<t.length;r++){var n=q.create(t[r]);n&&(0===r?o.moveTo(n):o.lineTo(n))}return o}},e.fromArc=function(t,i){var o=new e(i),r=t.startAngle,n=t.pointAt(r);return o.moveTo(n.x,n.y),o.arc(r,t.endAngle,t.radiusX,t.radiusY,t.anticlockwise),o},Object.defineProperties(e.prototype,i),e}(nt(at(et))),Kt=function(t){function e(e){t.call(this,e),this.paths=new kt,this.paths.addObserver(this),B(this.options.stroke)||this.stroke("#000")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return e.parse=function(t,i){var o=new e(i);return Wt(o,t)},i.nodeType.get=function(){return"MultiPath"},e.prototype.moveTo=function(t,e){var i=new Zt;return i.moveTo(t,e),this.paths.push(i),this},e.prototype.lineTo=function(t,e){return this.paths.length>0&&Vt(this.paths).lineTo(t,e),this},e.prototype.curveTo=function(t,e,i){return this.paths.length>0&&Vt(this.paths).curveTo(t,e,i),this},e.prototype.arc=function(t,e,i,o,r){return this.paths.length>0&&Vt(this.paths).arc(t,e,i,o,r),this},e.prototype.arcTo=function(t,e,i,o,r,n){return this.paths.length>0&&Vt(this.paths).arcTo(t,e,i,o,r,n),this},e.prototype.close=function(){return this.paths.length>0&&Vt(this.paths).close(),this},e.prototype._bbox=function(t){return qt(this.paths,!0,t)},e.prototype.rawBBox=function(){return qt(this.paths,!1)},e.prototype._containsPoint=function(t){for(var e=this.paths,i=0;i<e.length;i++)if(e[i]._containsPoint(t))return!0;return!1},e.prototype._isOnPath=function(t){for(var e=this.paths,i=this.options.stroke.width,o=0;o<e.length;o++)if(e[o]._isOnPath(t,i))return!0;return!1},e.prototype._clippedBBox=function(t){return Xt(this.paths,this.currentTransform(t))},Object.defineProperties(e.prototype,i),e}(nt(at(et))),Jt=function(t){function e(e,i){void 0===e&&(e=new gt),void 0===i&&(i={}),t.call(this,i),this.geometry(e),B(this.options.stroke)||this.stroke("#000")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Arc"},e.prototype._bbox=function(t){return this._geometry.bbox(t)},e.prototype.rawBBox=function(){return this.geometry().bbox()},e.prototype.toPath=function(){var t=new Zt,e=this.geometry().curvePoints();if(e.length>0){t.moveTo(e[0].x,e[0].y);for(var i=1;i<e.length;i+=3)t.curveTo(e[i],e[i+1],e[i+2])}return t},e.prototype._containsPoint=function(t){return this.geometry().containsPoint(t)},e.prototype._isOnPath=function(t){return this.geometry()._isOnPath(t,this.options.stroke.width/2)},Object.defineProperties(e.prototype,i),e}(nt(at(ht(et)))),$t=function(t){function e(e){t.call(this),this._size=e,this._length=0,this._map={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.put=function(t,e){var i=this._map,o={key:t,value:e};i[t]=o,this._head?(this._tail.newer=o,o.older=this._tail,this._tail=o):this._head=this._tail=o,this._length>=this._size?(i[this._head.key]=null,this._head=this._head.newer,this._head.older=null):this._length++},e.prototype.get=function(t){var e=this._map[t];if(e)return e===this._head&&e!==this._tail&&(this._head=e.newer,this._head.older=null),e!==this._tail&&(e.older&&(e.older.newer=e.newer,e.newer.older=e.older),e.older=this._tail,e.newer=null,this._tail.newer=e,this._tail=e),e.value},e}(O),Qt=/\r?\n|\r|\t/g;function te(t){return String(t).replace(Qt," ")}function ee(t){var e=[];for(var i in t)e.push(i+t[i]);return e.sort().join("")}function ie(t){for(var e=2166136261,i=0;i<t.length;++i)e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24),e^=t.charCodeAt(i);return e>>>0}var oe,re={baselineMarkerSize:1};"undefined"!=typeof document&&((oe=document.createElement("div")).style.cssText="position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: pre!important;");var ne=function(t){function e(e){t.call(this),this._cache=new $t(1e3),this.options=Object.assign({},re,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.measure=function(t,e,i){if(void 0===i&&(i={}),null==t)return{width:0,height:0,baseline:0};var o=ie(t+ee(e)),r=this._cache.get(o);if(r)return r;var n={width:0,height:0,baseline:0},s=i.box||oe,a=this._baselineMarker().cloneNode(!1);for(var p in e){var h=e[p];void 0!==h&&(s.style[p]=h)}var c=!1!==i.normalizeText?te(t):String(t);return s.textContent=c,s.appendChild(a),document.body.appendChild(s),c.length&&(n.width=s.offsetWidth-this.options.baselineMarkerSize,n.height=s.offsetHeight,n.baseline=a.offsetTop+this.options.baselineMarkerSize),n.width>0&&n.height>0&&this._cache.put(o,n),s.parentNode.removeChild(s),n},e.prototype._baselineMarker=function(){var t=document.createElement("div");return t.style.cssText="display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;",t},e}(O);ne.current=new ne;var se=ne;function ae(t,e,i){return se.current.measure(t,e,i)}var pe=function(t){function e(e,i,o){void 0===i&&(i=new q),void 0===o&&(o={}),t.call(this,o),this.content(e),this.position(i),this.options.font||(this.options.font="12px sans-serif"),B(this.options.fill)||this.fill("#000")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Text"},e.prototype.content=function(t){return B(t)?(this.options.set("content",t),this):this.options.get("content")},e.prototype.measure=function(){return ae(this.content(),{font:this.options.get("font")})},e.prototype.rect=function(){var t=this.measure(),e=this.position().clone();return new Y(e,[t.width,t.height])},e.prototype.bbox=function(t){var e=W(this.currentTransform(t));return this.rect().bbox(e)},e.prototype.rawBBox=function(){return this.rect().bbox()},e.prototype._containsPoint=function(t){return this.rect().containsPoint(t)},Object.defineProperties(e.prototype,i),e}(nt(Lt(et,["position"]))),he=function(t){function e(e,i,o){void 0===i&&(i=new Y),void 0===o&&(o={}),t.call(this,o),this.src(e),this.rect(i)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Image"},e.prototype.src=function(t){return B(t)?(this.options.set("src",t),this):this.options.get("src")},e.prototype.bbox=function(t){var e=W(this.currentTransform(t));return this._rect.bbox(e)},e.prototype.rawBBox=function(){return this._rect.bbox()},e.prototype._containsPoint=function(t){return this._rect.containsPoint(t)},e.prototype._hasFill=function(){return this.src()},Object.defineProperties(e.prototype,i),e}(ht(et,["rect"])),ce=function(t,e){return function(t){function i(){t.apply(this,arguments)}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.traverse=function(t){for(var i=this[e],o=0;o<i.length;o++){var r=i[o];r.traverse?r.traverse(t):t(r)}return this},i}(t)};function le(t,e){return t.push.apply(t,e),t}var ue=function(t){function e(e){t.call(this,e),this.children=[]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Group"},e.prototype.childrenChange=function(t,e,i){this.trigger("childrenChange",{action:t,items:e,index:i})},e.prototype.append=function(){return le(this.children,arguments),this._reparent(arguments,this),this.childrenChange("add",arguments),this},e.prototype.insert=function(t,e){return this.children.splice(t,0,e),e.parent=this,this.childrenChange("add",[e],t),this},e.prototype.insertAt=function(t,e){return this.insert(e,t)},e.prototype.remove=function(t){var e=this.children.indexOf(t);return e>=0&&(this.children.splice(e,1),t.parent=null,this.childrenChange("remove",[t],e)),this},e.prototype.removeAt=function(t){if(0<=t&&t<this.children.length){var e=this.children[t];this.children.splice(t,1),e.parent=null,this.childrenChange("remove",[e],t)}return this},e.prototype.clear=function(){var t=this.children;return this.children=[],this._reparent(t,null),this.childrenChange("remove",t,0),this},e.prototype.bbox=function(t){return qt(this.children,!0,this.currentTransform(t))},e.prototype.rawBBox=function(){return qt(this.children,!1)},e.prototype._clippedBBox=function(t){return Xt(this.children,this.currentTransform(t))},e.prototype.currentTransform=function(t){return et.prototype.currentTransform.call(this,t)||null},e.prototype.containsPoint=function(t,e){if(this.visible())for(var i=this.children,o=this.currentTransform(e),r=0;r<i.length;r++)if(i[r].containsPoint(t,o))return!0;return!1},e.prototype._reparent=function(t,e){for(var i=0;i<t.length;i++){var o=t[i],r=o.parent;r&&r!==this&&r.remove&&r.remove(o),o.parent=e}},Object.defineProperties(e.prototype,i),e}(ce(et,"children"));function fe(t,e,i){var o=i.transform()||K(),r=o.matrix();r.e+=t.x-e.origin.x,r.f+=t.y-e.origin.y,o.matrix(r),i.transform(o)}function de(t,e,i,o,r){return"start"===i?e.origin[o]:"end"===i?e.origin[o]+e.size[r]-t:e.origin[o]+(e.size[r]-t)/2}function ye(t,e,i,o,r){return"start"===i?e.origin[o]+e.size[r]-t:"end"===i?e.origin[o]:e.origin[o]+(e.size[r]-t)/2}var ve={alignContent:"start",justifyContent:"start",alignItems:"start",spacing:0,orientation:"horizontal",lineSpacing:0,wrap:!0,revers:!1},ge=function(t,e){t.forEach(e)},me=function(t,e){for(var i=t.length-1;i>=0;i--)e(t[i],i)},xe=function(t){function e(e,i){t.call(this,Object.assign({},ve,i)),this._rect=e,this._fieldMap={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.rect=function(t){return t?(this._rect=t,this):this._rect},e.prototype._initMap=function(){var t=this.options,e=this._fieldMap;"horizontal"===t.orientation?(e.sizeField="width",e.groupsSizeField="height",e.groupAxis="x",e.groupsAxis="y"):(e.sizeField="height",e.groupsSizeField="width",e.groupAxis="y",e.groupsAxis="x"),t.reverse?(this.forEach=me,this.justifyAlign=ye):(this.forEach=ge,this.justifyAlign=de)},e.prototype.reflow=function(){if(this._rect&&0!==this.children.length){this._initMap(),this.options.transform&&this.transform(null);for(var t,e,i,o=this.options,r=this._rect,n=this._initGroups(),s=n.groups,a=n.groupsSize,p=this._fieldMap,h=p.sizeField,c=p.groupsSizeField,l=p.groupAxis,u=p.groupsAxis,f=new q,d=new q,y=new X,v=de(a,r,o.alignContent,u,c),g=function(r,n){var s=e.elements[n];d[l]=t,d[u]=de(r.size[c],i,o.alignItems,u,c),fe(d,r,s),t+=r.size[h]+o.spacing},m=0;m<s.length;m++)e=s[m],f[l]=t=this.justifyAlign(e.size,r,o.justifyContent,l,h),f[u]=v,y[h]=e.size,y[c]=e.lineSize,i=new Y(f,y),this.forEach(e.bboxes,g),v+=e.lineSize+o.lineSpacing;if(!o.wrap&&e.size>r.size[h]){var x=r.size[h]/i.size[h],b=i.topLeft().scale(x,x),_=de(i.size[c]*x,r,o.alignContent,u,c),w=K();"x"===l?w.translate(r.origin.x-b.x,_-b.y):w.translate(_-b.x,r.origin.y-b.y),w.scale(x,x),this.transform(w)}}},e.prototype._initGroups=function(){for(var t=this.options,e=this.children,i=t.lineSpacing,o=t.wrap,r=t.spacing,n=this._fieldMap.sizeField,s=this._newGroup(),a=[],p=function(){a.push(s),h+=s.lineSize+i},h=-i,c=0;c<e.length;c++){var l=e[c],u=e[c].clippedBBox();l.visible()&&u&&(o&&s.size+u.size[n]+r>this._rect.size[n]?0===s.bboxes.length?(this._addToGroup(s,u,l),p(),s=this._newGroup()):(p(),s=this._newGroup(),this._addToGroup(s,u,l)):this._addToGroup(s,u,l))}return s.bboxes.length&&p(),{groups:a,groupsSize:h}},e.prototype._addToGroup=function(t,e,i){t.size+=e.size[this._fieldMap.sizeField]+this.options.spacing,t.lineSize=Math.max(e.size[this._fieldMap.groupsSizeField],t.lineSize),t.bboxes.push(e),t.elements.push(i)},e.prototype._newGroup=function(){return{lineSize:0,size:-this.options.spacing,bboxes:[],elements:[]}},e}(ue),be=function(t){function e(e,i){void 0===e&&(e=new Y),void 0===i&&(i={}),t.call(this,i),this.geometry(e),B(this.options.stroke)||this.stroke("#000")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Rect"},e.prototype._bbox=function(t){return this._geometry.bbox(t)},e.prototype.rawBBox=function(){return this._geometry.bbox()},e.prototype._containsPoint=function(t){return this._geometry.containsPoint(t)},e.prototype._isOnPath=function(t){return this.geometry()._isOnPath(t,this.options.stroke.width/2)},Object.defineProperties(e.prototype,i),e}(nt(at(ht(et))));function _e(t,e,i,o,r){for(var n=0;n<t.length;n++){var s=t[n].clippedBBox();if(s){var a=s.origin.clone();a[o]=de(s.size[r],e,i||"start",o,r),fe(a,s,t[n])}}}function we(t,e,i){_e(t,e,i,"x","width")}function Ae(t,e,i){_e(t,e,i,"y","height")}function Se(t,e,i,o){if(t.length>1)for(var r=new q,n=t[0].bbox,s=1;s<t.length;s++){var a=t[s].element,p=t[s].bbox;r[e]=n.origin[e]+n.size[o],r[i]=p.origin[i],fe(r,p,a),p.origin[e]=r[e],n=p}}function ke(t){for(var e=[],i=0;i<t.length;i++){var o=t[i],r=o.clippedBBox();r&&e.push({element:o,bbox:r})}return e}function Ce(t){Se(ke(t),"x","y","width")}function Pe(t){Se(ke(t),"y","x","height")}function Te(t,e,i,o,r){for(var n=function(t,e,i){for(var o,r,n=e.size[i],s=[],a=[],p=0,h=function(){a.push({element:o,bbox:r})},c=0;c<t.length;c++)if(o=t[c],r=o.clippedBBox()){var l=r.size[i];p+l>n?a.length?(s.push(a),a=[],h(),p=l):(h(),s.push(a),a=[],p=0):(h(),p+=l)}return a.length&&s.push(a),s}(t,e,r),s=e.origin.clone(),a=[],p=0;p<n.length;p++){var h=n[p],c=h[0];s[o]=c.bbox.origin[o],fe(s,c.bbox,c.element),c.bbox.origin[i]=s[i],Se(h,i,o,r),a.push([]);for(var l=0;l<h.length;l++)a[p].push(h[l].element)}return a}function Me(t,e){return Te(t,e,"x","y","width")}function Oe(t,e){return Te(t,e,"y","x","height")}function Re(t,e){var i=t.clippedBBox();if(i){var o=i.size,r=e.size;if(r.width<o.width||r.height<o.height){var n=Math.min(r.width/o.width,r.height/o.height),s=t.transform()||K();s.scale(n,n),t.transform(s)}}}var Be=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._change=function(){this.optionsChange({field:"stops"})},e}(St);function je(t){return function(e){return B(e)?(this.options.set(t,e),this):this.options.get(t)}}var Ie=function(t){function e(e,i,o){t.call(this),this.options=new I({offset:e,color:i,opacity:B(o)?o:1}),this.options.addObserver(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(B(t))return t instanceof e?t:t.length>1?new e(t[0],t[1],t[2]):new e(t.offset,t.color,t.opacity)},e}(function(t,e){var i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t);return function(t,e){for(var i=0;i<e.length;i++)t[e[i]]=je(e[i])}(i.prototype,e),i}(R,["offset","color","opacity"])),Le=function(t){function e(e){void 0===e&&(e={}),t.call(this),this.stops=new Be(this._createStops(e.stops)),this.stops.addObserver(this),this._userSpace=e.userSpace,this.id=$()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Gradient"},e.prototype.userSpace=function(t){return B(t)?(this._userSpace=t,this.optionsChange(),this):this._userSpace},e.prototype._createStops=function(t){void 0===t&&(t=[]);for(var e=[],i=0;i<t.length;i++)e.push(Ie.create(t[i]));return e},e.prototype.addStop=function(t,e,i){this.stops.push(new Ie(t,e,i))},e.prototype.removeStop=function(t){var e=this.stops.indexOf(t);e>=0&&this.stops.splice(e,1)},e.prototype.optionsChange=function(t){this.trigger("optionsChange",{field:"gradient"+(t?"."+t.field:""),value:this})},e.prototype.geometryChange=function(){this.optionsChange()},Object.defineProperties(e.prototype,i),e}(R),ze=function(t){function e(e){void 0===e&&(e={}),t.call(this,e),this.start(e.start||new q),this.end(e.end||new q(1,0))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Lt(Le,["start","end"])),Ee=function(t){function e(e){void 0===e&&(e={}),t.call(this,e),this.center(e.center||new q),this._radius=B(e.radius)?e.radius:1,this._fallbackFill=e.fallbackFill}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.radius=function(t){return B(t)?(this._radius=t,this.geometryChange(),this):this._radius},e.prototype.fallbackFill=function(t){return B(t)?(this._fallbackFill=t,this.optionsChange(),this):this._fallbackFill},e}(Lt(Le,["center"]));function Ve(t){return.5-Math.cos(t*Math.PI)/2}function Fe(t){return t}function De(t,e,i,o){var r=1.70158,n=0,s=o;return 0===t?i:1===t?i+o:(n||(n=.5),s<Math.abs(o)?(s=o,r=n/4):r=n/(2*Math.PI)*Math.asin(o/s),s*Math.pow(2,-10*t)*Math.sin((Number(t)-r)*(1.1*Math.PI)/n)+o+i)}var Ue,He,Ge=Date.now||function(){return(new Date).getTime()},Ne=function(t){var e="undefined"!=typeof window?window:{},i=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t){setTimeout(t,1e3/60)};(Ne=function(t){return i.call(e,t)})(t)},We=Ne,qe=function(t){function e(){t.call(this),this._items=[]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={current:{configurable:!0}};return i.current.get=function(){return Ue||(Ue=new e),Ue},e.prototype.register=function(t,e){this._items.push({name:t,type:e})},e.prototype.create=function(t,e){var i,o=this._items;if(e&&e.type)for(var r=e.type.toLowerCase(),n=0;n<o.length;n++)if(o[n].name.toLowerCase()===r){i=o[n];break}if(i)return new i.type(t,e)},Object.defineProperties(e,i),e}(O),Xe=function(t){function e(e,i){t.call(this),this.options=Object.assign({},this.options,i),this.element=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={options:{configurable:!0}};return e.create=function(t,e,i){return qe.current.create(t,e,i)},i.options.get=function(){return this._options||{duration:500,easing:"swing"}},i.options.set=function(t){this._options=t},e.prototype.setup=function(){},e.prototype.step=function(){},e.prototype.play=function(){var t=this,e=this.options,i=e.duration,r=e.delay;void 0===r&&(r=0);var n=o[e.easing],s=Ge()+r,a=s+i;0===i?(this.step(1),this.abort()):setTimeout((function(){var e=function(){if(!t._stopped){var o=Ge(),r=Yt(o-s,0,i),p=n(r/i,r,0,1,i);t.step(p),o<a?We(e):t.abort()}};e()}),r)},e.prototype.abort=function(){this._stopped=!0},e.prototype.destroy=function(){this.abort()},Object.defineProperties(e.prototype,i),e}(O),Ye=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={current:{configurable:!0}};return i.current.get=function(){return He||(He=new e),He},e.prototype.parse=function(t,e){var i=new Kt(e);return Wt(i,t)},Object.defineProperties(e,i),e}(O),Ze=function(t){function e(e){t.call(this),this.childNodes=[],this.parent=null,e&&(this.srcElement=e,this.observe())}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){this.srcElement&&this.srcElement.removeObserver(this);for(var t=this.childNodes,e=0;e<t.length;e++)this.childNodes[e].destroy();this.parent=null},e.prototype.load=function(){},e.prototype.observe=function(){this.srcElement&&this.srcElement.addObserver(this)},e.prototype.append=function(t){this.childNodes.push(t),t.parent=this},e.prototype.insertAt=function(t,e){this.childNodes.splice(e,0,t),t.parent=this},e.prototype.remove=function(t,e){for(var i=t+e,o=t;o<i;o++)this.childNodes[o].removeSelf();this.childNodes.splice(t,e)},e.prototype.removeSelf=function(){this.clear(),this.destroy()},e.prototype.clear=function(){this.remove(0,this.childNodes.length)},e.prototype.invalidate=function(){this.parent&&this.parent.invalidate()},e.prototype.geometryChange=function(){this.invalidate()},e.prototype.optionsChange=function(){this.invalidate()},e.prototype.childrenChange=function(t){"add"===t.action?this.load(t.items,t.index):"remove"===t.action&&this.remove(t.index,t.items.length),this.invalidate()},e}(O),Ke=function(t){function e(){t.call(this),this._events={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bind=function(t,e,i){var o=arguments,r=this,n=$e(t),s=Je(e),a=n.length;if(void 0===e){for(var p in t)r.bind(p,t[p]);return this}for(var h=function(t){var a=n[t],p=s?e:e[a];if(p){if(i){var h=p;(p=function(){r.unbind(a,p),h.apply(r,o)}).original=h}(r._events[a]=r._events[a]||[]).push(p)}},c=0;c<a;c++)h(c);return this},e.prototype.one=function(t,e){return this.bind(t,e,!0)},e.prototype.first=function(t,e){for(var i=$e(t),o=Je(e),r=0,n=i.length;r<n;r++){var s=i[r],a=o?e:e[s];if(a)(this._events[s]=this._events[s]||[]).unshift(a)}return this},e.prototype.trigger=function(t,e){void 0===e&&(e={});var i=this._events[t];if(i){var o=i.length;e.sender=this,e._defaultPrevented=!1,e.preventDefault=Qe,e.isDefaultPrevented=ti,i=i.slice();for(var r=0;r<o;r++)i[r].call(this,e);return!0===e._defaultPrevented}return!1},e.prototype.unbind=function(t,e){var i=this._events[t];if(void 0===t)this._events={};else if(i)if(e)for(var o=i.length-1;o>=0;o--)i[o]!==e&&i[o].original!==e||i.splice(o,1);else this._events[t]=[];return this},e}(O);function Je(t){return"function"==typeof t}function $e(t){return"string"==typeof t?[t]:t}function Qe(){this._defaultPrevented=!0}function ti(){return!0===this._defaultPrevented}function ei(t,e){for(var i={},o=window.getComputedStyle(t)||{},r=Array.isArray(e)?e:[e],n=0;n<r.length;n++){var s=r[n];i[s]=o[s]}return i}function ii(t){return isNaN(t)?t:t+"px"}function oi(t,e){if(!e){var i=ei(t,["width","height"]);return{width:parseInt(i.width,10),height:parseInt(i.height,10)}}var o=e.width,r=e.height;B(o)&&(t.style.width=ii(o)),B(r)&&(t.style.height=ii(r))}function ri(t){return void 0===t&&(t={}),t.touch?t.touch.initialTouch:t.target}function ni(t){var e=ei(t,["paddingLeft","paddingTop"]),i=e.paddingLeft,o=e.paddingTop;return{top:parseFloat(o),left:parseFloat(i)}}function si(t){var e=t.getBoundingClientRect(),i=document.documentElement;return{top:e.top+(window.pageYOffset||i.scrollTop)-(i.clientTop||0),left:e.left+(window.pageXOffset||i.scrollLeft)-(i.clientLeft||0)}}function ai(t){return B((t.x||{}).location)?{x:t.x.location,y:t.y.location}:{x:t.pageX||t.clientX||0,y:t.pageY||t.clientY||0}}var pi=/matrix\((.*)\)/;function hi(t){var e=getComputedStyle(t).transform;return"none"===e?N.unit():function(t){var e=t.match(pi);if(null===e||2!==e.length)return N.unit();var i=e[1].split(",").map((function(t){return parseFloat(t)}));return new(Function.prototype.bind.apply(N,[null].concat(i)))}(e)}function ci(t){if(!t)return N.unit();for(var e=hi(t),i=t.parentElement;i;){var o=hi(i);e=e.multiplyCopy(o),i=i.parentElement}return e.b=e.c=e.e=e.f=0,e}var li=["click","mouseenter","mouseleave","mousemove","resize"],ui=function(t){function e(e,i){t.call(this),this.options=Object.assign({},i),this.element=e,this.element._kendoExportVisual=this.exportVisual.bind(this),this._click=this._handler("click"),this._mouseenter=this._handler("mouseenter"),this._mouseleave=this._handler("mouseleave"),this._mousemove=this._handler("mousemove"),this._visual=new ue,oi(e,this.options),this.bind(li,this.options),this._enableTracking()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.draw=function(t){this._visual.children.push(t)},e.prototype.clear=function(){this._visual.children=[]},e.prototype.destroy=function(){this._visual=null,this.element._kendoExportVisual=null,this.unbind()},e.prototype.eventTarget=function(t){for(var e,i=ri(t);!e&&i&&(e=i._kendoNode,i!==this.element);)i=i.parentElement;if(e)return e.srcElement},e.prototype.exportVisual=function(){return this._visual},e.prototype.getSize=function(){return oi(this.element)},e.prototype.currentSize=function(t){if(!t)return this._size;this._size=t},e.prototype.setSize=function(t){oi(this.element,t),this.currentSize(t),this._resize()},e.prototype.resize=function(t){var e=this.getSize(),i=this.currentSize();(t||(e.width>0||e.height>0)&&(!i||e.width!==i.width||e.height!==i.height))&&(this.currentSize(e),this._resize(e,t),this.trigger("resize",e))},e.prototype.size=function(t){if(!t)return this.getSize();this.setSize(t)},e.prototype.suspendTracking=function(){this._suspendedTracking=!0},e.prototype.resumeTracking=function(){this._suspendedTracking=!1},e.prototype._enableTracking=function(){},e.prototype._resize=function(){},e.prototype._handler=function(t){var e=this;return function(i){var o=e.eventTarget(i);o&&!e._suspendedTracking&&e.trigger(t,{element:o,originalEvent:i,type:t})}},e.prototype._elementOffset=function(){var t=this.element,e=ni(t),i=si(t),o=i.left,r=i.top;return{left:o+e.left,top:r+e.top}},e.prototype._surfacePoint=function(t){var e=this._elementOffset(),i=ai(t),o=i.x-e.left,r=i.y-e.top,n=ci(this.element).invert();return new q(o,r).transform(n)},e}(Ke);function fi(t){var e=window.console;void 0!==e&&e.log&&e.log(t)}function di(t,e){return B(e)&&null!==e?" "+t+'="'+e+'" ':""}function yi(t){for(var e="",i=0;i<t.length;i++)e+=di(t[i][0],t[i][1]);return e}function vi(t){for(var e="",i=0;i<t.length;i++){var o=t[i][1];B(o)&&(e+=t[i][0]+":"+o+";")}if(""!==e)return e}var gi={},mi="http://www.w3.org/2000/svg",xi=function(t,e){t.innerHTML=e};if("undefined"!=typeof document){var bi=document.createElement("div"),_i="undefined"!=typeof DOMParser;bi.innerHTML="<svg xmlns='http://www.w3.org/2000/svg'></svg>",_i&&bi.firstChild.namespaceURI!==mi&&(xi=function(t,e){var i=(new DOMParser).parseFromString(e,"text/xml"),o=document.adoptNode(i.documentElement);t.innerHTML="",t.appendChild(o)})}var wi=xi;var Ai={},Si={get browser(){return"undefined"==typeof window||Ai?Ai:Ai=function(t){var e,i={edge:/(edge)[ \/]([\w.]+)/i,webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+)|)/i};for(var o in i)if(i.hasOwnProperty(o)){var r=t.match(i[o]);if(r){(e={})[o]=!0,e[r[1].toLowerCase().split(" ")[0].split("/")[0]]=!0,e.version=parseInt(document.documentMode||r[2],10);break}}return e}(window.navigator.userAgent)}},ki={clip:"clip-path",fill:"fill"};function Ci(t,e){return"clip"===t||"fill"===t&&(!e||"Gradient"===e.nodeType)}var Pi=function(t){function e(e,i){t.call(this,e),this.definitions={},this.options=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){this.element&&(this.element._kendoNode=null,this.element=null),this.clearDefinitions(),t.prototype.destroy.call(this)},e.prototype.load=function(t,e){for(var i=0;i<t.length;i++){var o=t[i],r=o.children,n=new gi[o.nodeType](o,this.options);B(e)?this.insertAt(n,e):this.append(n),n.createDefinitions(),r&&r.length>0&&n.load(r);var s=this.element;s&&n.attachTo(s,e)}},e.prototype.root=function(){for(var t=this;t.parent;)t=t.parent;return t},e.prototype.attachTo=function(t,e){var i=document.createElement("div");wi(i,"<svg xmlns='"+mi+"' version='1.1'>"+this.render()+"</svg>");var o=i.firstChild.firstChild;o&&(B(e)?t.insertBefore(o,t.childNodes[e]||null):t.appendChild(o),this.setElement(o))},e.prototype.setElement=function(t){this.element&&(this.element._kendoNode=null),this.element=t,this.element._kendoNode=this;for(var e=this.childNodes,i=0;i<e.length;i++){var o=t.childNodes[i];e[i].setElement(o)}},e.prototype.clear=function(){this.clearDefinitions(),this.element&&(this.element.innerHTML="");for(var t=this.childNodes,e=0;e<t.length;e++)t[e].destroy();this.childNodes=[]},e.prototype.removeSelf=function(){if(this.element){var e=this.element.parentNode;e&&e.removeChild(this.element),this.element=null}t.prototype.removeSelf.call(this)},e.prototype.template=function(){return this.renderChildren()},e.prototype.render=function(){return this.template()},e.prototype.renderChildren=function(){for(var t=this.childNodes,e="",i=0;i<t.length;i++)e+=t[i].render();return e},e.prototype.optionsChange=function(e){var i=e.field,o=e.value;"visible"===i?this.css("display",o?"":"none"):ki[i]&&Ci(i,o)?this.updateDefinition(i,o):"opacity"===i?this.attr("opacity",o):"cursor"===i?this.css("cursor",o):"id"===i&&(o?this.attr("id",o):this.removeAttr("id")),t.prototype.optionsChange.call(this,e)},e.prototype.attr=function(t,e){this.element&&this.element.setAttribute(t,e)},e.prototype.allAttr=function(t){for(var e=0;e<t.length;e++)this.attr(t[e][0],t[e][1])},e.prototype.css=function(t,e){this.element&&(this.element.style[t]=e)},e.prototype.allCss=function(t){for(var e=0;e<t.length;e++)this.css(t[e][0],t[e][1])},e.prototype.removeAttr=function(t){this.element&&this.element.removeAttribute(t)},e.prototype.mapTransform=function(t){var e=[];return t&&e.push(["transform","matrix("+t.matrix().toString(6)+")"]),e},e.prototype.renderTransform=function(){return yi(this.mapTransform(this.srcElement.transform()))},e.prototype.transformChange=function(t){t?this.allAttr(this.mapTransform(t)):this.removeAttr("transform")},e.prototype.mapStyle=function(){var t=this.srcElement.options,e=[["cursor",t.cursor]];return!1===t.visible&&e.push(["display","none"]),e},e.prototype.renderStyle=function(){return di("style",vi(this.mapStyle(!0)))},e.prototype.renderOpacity=function(){return di("opacity",this.srcElement.options.opacity)},e.prototype.renderId=function(){return di("id",this.srcElement.options.id)},e.prototype.createDefinitions=function(){var t=this.srcElement,e=this.definitions;if(t){var i,o=t.options;for(var r in ki){var n=o.get(r);n&&Ci(r,n)&&(e[r]=n,i=!0)}i&&this.definitionChange({action:"add",definitions:e})}},e.prototype.definitionChange=function(t){this.parent&&this.parent.definitionChange(t)},e.prototype.updateDefinition=function(t,e){var i=this.definitions,o=i[t],r=ki[t],n={};o&&(n[t]=o,this.definitionChange({action:"remove",definitions:n}),delete i[t]),e?(n[t]=e,this.definitionChange({action:"add",definitions:n}),i[t]=e,this.attr(r,this.refUrl(e.id))):o&&this.removeAttr(r)},e.prototype.clearDefinitions=function(){var t=this.definitions;this.definitionChange({action:"remove",definitions:t}),this.definitions={}},e.prototype.renderDefinitions=function(){return yi(this.mapDefinitions())},e.prototype.mapDefinitions=function(){var t=this.definitions,e=[];for(var i in t)e.push([ki[i],this.refUrl(t[i].id)]);return e},e.prototype.refUrl=function(t){var e=(this.options||{}).skipBaseHref,i=this.baseUrl().replace(/'/g,"\\'");return"url("+(e?"":i)+"#"+t+")"},e.prototype.baseUrl=function(){return function(){var t=document.getElementsByTagName("base")[0],e=document.location.href,i="";if(t&&!(Si.browser||{}).msie){var o=e.indexOf("#");-1!==o&&(e=e.substring(0,o)),i=e}return i}()},e}(Ze),Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.template=function(){return"<stop "+this.renderOffset()+" "+this.renderStyle()+" />"},e.prototype.renderOffset=function(){return di("offset",this.srcElement.offset())},e.prototype.mapStyle=function(){var t=this.srcElement;return[["stop-color",t.color()],["stop-opacity",t.opacity()]]},e.prototype.optionsChange=function(t){"offset"===t.field?this.attr(t.field,t.value):"color"!==t.field&&"opacity"!==t.field||this.css("stop-"+t.field,t.value)},e}(Pi),Mi=function(t){function e(e){t.call(this,e),this.id=e.id,this.loadStops()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.loadStops=function(){for(var t=this.srcElement.stops,e=this.element,i=0;i<t.length;i++){var o=new Ti(t[i]);this.append(o),e&&o.attachTo(e)}},e.prototype.optionsChange=function(t){"gradient.stops"===t.field?(Ze.prototype.clear.call(this),this.loadStops()):"gradient"===t.field&&this.allAttr(this.mapCoordinates())},e.prototype.renderCoordinates=function(){return yi(this.mapCoordinates())},e.prototype.mapSpace=function(){return["gradientUnits",this.srcElement.userSpace()?"userSpaceOnUse":"objectBoundingBox"]},e}(Pi),Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.template=function(){return"<linearGradient id='"+this.id+"' "+this.renderCoordinates()+">"+this.renderChildren()+"</linearGradient>"},e.prototype.mapCoordinates=function(){var t=this.srcElement,e=t.start(),i=t.end();return[["x1",e.x],["y1",e.y],["x2",i.x],["y2",i.y],this.mapSpace()]},e}(Mi),Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.template=function(){return"<radialGradient id='"+this.id+"' "+this.renderCoordinates()+">"+this.renderChildren()+"</radialGradient>"},e.prototype.mapCoordinates=function(){var t=this.srcElement,e=t.center(),i=t.radius();return[["cx",e.x],["cy",e.y],["r",i],this.mapSpace()]},e}(Mi),Bi=function(t){function e(e){t.call(this),this.srcElement=e,this.id=e.id,this.load([e])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.template=function(){return"<clipPath id='"+this.id+"'>"+this.renderChildren()+"</clipPath>"},e}(Pi),ji=function(t){function e(){t.call(this),this.definitionMap={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.attachTo=function(t){this.element=t},e.prototype.template=function(){return"<defs>"+this.renderChildren()+"</defs>"},e.prototype.definitionChange=function(t){var e=t.definitions,i=t.action;"add"===i?this.addDefinitions(e):"remove"===i&&this.removeDefinitions(e)},e.prototype.createDefinition=function(t,e){var i;return"clip"===t?i=Bi:"fill"===t&&(e instanceof ze?i=Oi:e instanceof Ee&&(i=Ri)),new i(e)},e.prototype.addDefinitions=function(t){for(var e in t)this.addDefinition(e,t[e])},e.prototype.addDefinition=function(t,e){var i=this.element,o=this.definitionMap,r=e.id,n=o[r];if(n)n.count++;else{var s=this.createDefinition(t,e);o[r]={element:s,count:1},this.append(s),i&&s.attachTo(this.element)}},e.prototype.removeDefinitions=function(t){for(var e in t)this.removeDefinition(t[e])},e.prototype.removeDefinition=function(t){var e=this.definitionMap,i=t.id,o=e[i];o&&(o.count--,0===o.count&&(this.remove(this.childNodes.indexOf(o.element),1),delete e[i]))},e}(Pi),Ii=function(t){function e(e){t.call(this),this.options=e,this.defs=new ji}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.attachTo=function(t){this.element=t,this.defs.attachTo(t.firstElementChild)},e.prototype.clear=function(){Ze.prototype.clear.call(this)},e.prototype.template=function(){return this.defs.render()+this.renderChildren()},e.prototype.definitionChange=function(t){this.defs.definitionChange(t)},e}(Pi);function Li(t,e){for(var i in e)for(var o=i.trim().split(" "),r=0;r<o.length;r++)t.addEventListener(o[r],e[i],!1)}function zi(t,e){for(var i in void 0===e&&(e={}),e)for(var o=i.trim().split(" "),r=0;r<o.length;r++)t.removeEventListener(o[r],e[i],!1)}var Ei={dot:[1.5,3.5],dash:[4,3.5],longdash:[8,3.5],dashdot:[3.5,3.5,1.5,3.5],longdashdot:[8,3.5,1.5,3.5],longdashdotdot:[8,3.5,1.5,3.5,1.5,3.5]},Vi={"fill.opacity":"fill-opacity","stroke.color":"stroke","stroke.width":"stroke-width","stroke.opacity":"stroke-opacity"},Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.geometryChange=function(){this.attr("d",this.renderData()),this.invalidate()},e.prototype.optionsChange=function(e){switch(e.field){case"fill":e.value?this.allAttr(this.mapFill(e.value)):this.removeAttr("fill");break;case"fill.color":this.allAttr(this.mapFill({color:e.value}));break;case"stroke":e.value?this.allAttr(this.mapStroke(e.value)):this.removeAttr("stroke");break;case"transform":this.transformChange(e.value);break;default:var i=Vi[e.field];i&&this.attr(i,e.value)}t.prototype.optionsChange.call(this,e)},e.prototype.content=function(){this.element&&(this.element.textContent=this.srcElement.content())},e.prototype.renderData=function(){return this.printPath(this.srcElement)},e.prototype.printPath=function(t){var e=t.segments,i=e.length;if(i>0){for(var o,r,n=[],s=1;s<i;s++){var a=this.segmentType(e[s-1],e[s]);a!==r&&(r=a,n.push(a)),"L"===a?n.push(this.printPoints(e[s].anchor())):n.push(this.printPoints(e[s-1].controlOut(),e[s].controlIn(),e[s].anchor()))}return o="M"+this.printPoints(e[0].anchor())+" "+n.join(" "),t.options.closed&&(o+="Z"),o}},e.prototype.printPoints=function(){for(var t=arguments,e=t.length,i=[],o=0;o<e;o++)i.push(t[o].toString(3));return i.join(" ")},e.prototype.segmentType=function(t,e){return t.controlOut()&&e.controlIn()?"C":"L"},e.prototype.mapStroke=function(t){var e=[];return t&&!tt(t.color)?(e.push(["stroke",t.color]),e.push(["stroke-width",t.width]),e.push(["stroke-linecap",this.renderLinecap(t)]),e.push(["stroke-linejoin",t.lineJoin]),B(t.opacity)&&e.push(["stroke-opacity",t.opacity]),B(t.dashType)&&e.push(["stroke-dasharray",this.renderDashType(t)])):e.push(["stroke","none"]),e},e.prototype.renderStroke=function(){return yi(this.mapStroke(this.srcElement.options.stroke))},e.prototype.renderDashType=function(t){var e=t.dashType,i=t.width;if(void 0===i&&(i=1),e&&"solid"!==e){for(var o=Ei[e.toLowerCase()],r=[],n=0;n<o.length;n++)r.push(o[n]*i);return r.join(" ")}},e.prototype.renderLinecap=function(t){var e=t.dashType,i=t.lineCap;return e&&"solid"!==e?"butt":i},e.prototype.mapFill=function(t){var e=[];return t&&"Gradient"===t.nodeType||(t&&!tt(t.color)?(e.push(["fill",t.color]),B(t.opacity)&&e.push(["fill-opacity",t.opacity])):e.push(["fill","none"])),e},e.prototype.renderFill=function(){return yi(this.mapFill(this.srcElement.options.fill))},e.prototype.template=function(){return"<path "+this.renderId()+" "+this.renderStyle()+" "+this.renderOpacity()+" "+di("d",this.renderData())+this.renderStroke()+this.renderFill()+this.renderDefinitions()+this.renderTransform()+"></path>"},e}(Pi),Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderData=function(){return this.printPath(this.srcElement.toPath())},e}(Fi),Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.geometryChange=function(){var t=this.center();this.attr("cx",t.x),this.attr("cy",t.y),this.attr("r",this.radius()),this.invalidate()},e.prototype.center=function(){return this.srcElement.geometry().center},e.prototype.radius=function(){return this.srcElement.geometry().radius},e.prototype.template=function(){return"<circle "+this.renderId()+" "+this.renderStyle()+" "+this.renderOpacity()+"cx='"+this.center().x+"' cy='"+this.center().y+"' r='"+this.radius()+"'"+this.renderStroke()+" "+this.renderFill()+" "+this.renderDefinitions()+this.renderTransform()+" ></circle>"},e}(Fi),Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.template=function(){return"<g"+(this.renderId()+this.renderTransform()+this.renderStyle()+this.renderOpacity()+this.renderDefinitions())+">"+this.renderChildren()+"</g>"},e.prototype.optionsChange=function(e){"transform"===e.field&&this.transformChange(e.value),t.prototype.optionsChange.call(this,e)},e}(Pi),Gi=/&/g,Ni=/</g,Wi=/"/g,qi=/'/g,Xi=/>/g;function Yi(t){return String(t).replace(Gi,"&").replace(Ni,"<").replace(Xi,">").replace(Wi,""").replace(qi,"'")}var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.geometryChange=function(){this.allAttr(this.mapPosition()),this.invalidate()},e.prototype.optionsChange=function(e){"src"===e.field&&this.allAttr(this.mapSource()),t.prototype.optionsChange.call(this,e)},e.prototype.mapPosition=function(){var t=this.srcElement.rect(),e=t.topLeft();return[["x",e.x],["y",e.y],["width",t.width()+"px"],["height",t.height()+"px"]]},e.prototype.renderPosition=function(){return yi(this.mapPosition())},e.prototype.mapSource=function(t){var e=this.srcElement.src();return t&&(e=Yi(e)),[["xlink:href",e]]},e.prototype.renderSource=function(){return yi(this.mapSource(!0))},e.prototype.template=function(){return"<image preserveAspectRatio='none' "+this.renderId()+" "+this.renderStyle()+" "+this.renderTransform()+" "+this.renderOpacity()+this.renderPosition()+" "+this.renderSource()+" "+this.renderDefinitions()+"></image>"},e}(Fi),Ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderData=function(){var t=this.srcElement.paths;if(t.length>0){for(var e=[],i=0;i<t.length;i++)e.push(this.printPath(t[i]));return e.join(" ")}},e}(Fi),Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.geometryChange=function(){var t=this.srcElement.geometry();this.attr("x",t.origin.x),this.attr("y",t.origin.y),this.attr("width",t.size.width),this.attr("height",t.size.height),this.attr("rx",t.cornerRadius[0]),this.attr("ry",t.cornerRadius[1]),this.invalidate()},e.prototype.size=function(){return this.srcElement.geometry().size},e.prototype.origin=function(){return this.srcElement.geometry().origin},e.prototype.rx=function(){return this.srcElement.geometry().cornerRadius[0]},e.prototype.ry=function(){return this.srcElement.geometry().cornerRadius[1]},e.prototype.template=function(){return"<rect "+this.renderId()+" "+this.renderStyle()+" "+this.renderOpacity()+" x='"+this.origin().x+"' y='"+this.origin().y+"' rx='"+this.rx()+"' ry='"+this.ry()+"' width='"+this.size().width+"' height='"+this.size().height+"' "+this.renderStroke()+" "+this.renderFill()+" "+this.renderDefinitions()+" "+this.renderTransform()+" />"},e}(Fi),$i=/&(?:[a-zA-Z]+|#\d+);/g;function Qi(t){if(!t||"string"!=typeof t||!$i.test(t))return t;var e=Qi._element;return $i.lastIndex=0,t.replace($i,(function(t){return e.innerHTML=t,e.textContent||e.innerText}))}"undefined"!=typeof document&&(Qi._element=document.createElement("span"));var to=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.geometryChange=function(){var t=this.pos();this.attr("x",t.x),this.attr("y",t.y),this.invalidate()},e.prototype.optionsChange=function(e){"font"===e.field?(this.attr("style",vi(this.mapStyle())),this.geometryChange()):"content"===e.field&&t.prototype.content.call(this,this.srcElement.content()),t.prototype.optionsChange.call(this,e)},e.prototype.mapStyle=function(e){var i=t.prototype.mapStyle.call(this,e),o=this.srcElement.options.font;return e&&(o=Yi(o)),i.push(["font",o],["white-space","pre"]),i},e.prototype.pos=function(){var t=this.srcElement.position(),e=this.srcElement.measure();return t.clone().setY(t.y+e.baseline)},e.prototype.renderContent=function(){var t=this.srcElement.content();return te(t=Yi(t=Qi(t)))},e.prototype.renderTextAnchor=function(){var t;return!(this.options||{}).rtl||Si.browser.msie||Si.browser.edge||(t="end"),di("text-anchor",t)},e.prototype.template=function(){return"<text "+this.renderId()+" "+this.renderTextAnchor()+" "+this.renderStyle()+" "+this.renderOpacity()+"x='"+this.pos().x+"' y='"+this.pos().y+"' "+this.renderStroke()+" "+this.renderTransform()+" "+this.renderDefinitions()+this.renderFill()+">"+this.renderContent()+"</text>"},e}(Fi);gi.Arc=Di,gi.Circle=Ui,gi.Group=Hi,gi.Image=Zi,gi.MultiPath=Ki,gi.Path=Fi,gi.Rect=Ji,gi.Text=to;var eo=function(t){function e(e,i){t.call(this,e,i),this._root=new Ii(Object.assign({rtl:"rtl"===ei(e,"direction").direction},this.options)),wi(this.element,this._template()),this._rootElement=this.element.firstElementChild,function(t){var e;try{e=t.getScreenCTM?t.getScreenCTM():null}catch(t){}if(e){var i=-e.e%1,o=-e.f%1,r=t.style;0===i&&0===o||(r.left=i+"px",r.top=o+"px")}}(this._rootElement),this._root.attachTo(this._rootElement),Li(this.element,{click:this._click,mouseover:this._mouseenter,mouseout:this._mouseleave,mousemove:this._mousemove}),this.resize()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{configurable:!0}};return i.type.get=function(){return"svg"},e.prototype.destroy=function(){this._root&&(this._root.destroy(),this._root=null,this._rootElement=null,zi(this.element,{click:this._click,mouseover:this._mouseenter,mouseout:this._mouseleave,mousemove:this._mousemove})),t.prototype.destroy.call(this)},e.prototype.translate=function(t){var e=Math.round(t.x)+" "+Math.round(t.y)+" "+this._size.width+" "+this._size.height;this._offset=t,this._rootElement.setAttribute("viewBox",e)},e.prototype.draw=function(e){t.prototype.draw.call(this,e),this._root.load([e])},e.prototype.clear=function(){t.prototype.clear.call(this),this._root.clear()},e.prototype.svg=function(){return"<?xml version='1.0' ?>"+this._template()},e.prototype.exportVisual=function(){var t=this._visual,e=this._offset;if(e){var i=new ue;i.children.push(t),i.transform(K().translate(-e.x,-e.y)),t=i}return t},e.prototype._resize=function(){this._offset&&this.translate(this._offset)},e.prototype._template=function(){return"<svg style='width: 100%; height: 100%; overflow: hidden;' xmlns='"+mi+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>"+this._root.render()+"</svg>"},Object.defineProperties(e.prototype,i),e}(ui);function io(){var t,e,i=new Promise((function(o,r){t=function(t){return i._state="resolved",o(t),i},e=function(t){return i._state="rejected",r(t),i}}));return i._state="pending",i.resolve=t,i.reject=e,i.state=function(){return i._state},i}function oo(t){return Promise.all(t)}var ro={};function no(t,e){var i=e.segments;if(0!==i.length){var o=i[0],r=o.anchor();t.moveTo(r.x,r.y);for(var n=1;n<i.length;n++){r=(o=i[n]).anchor();var s=i[n-1].controlOut(),a=o.controlIn();s&&a?t.bezierCurveTo(s.x,s.y,a.x,a.y,r.x,r.y):t.lineTo(r.x,r.y)}e.options.closed&&t.closePath()}}var so=function(t){function e(e){t.call(this,e),e&&this.initClip()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initClip=function(){var t=this.srcElement.clip();t&&(this.clip=t,t.addObserver(this))},e.prototype.clear=function(){this.srcElement&&this.srcElement.removeObserver(this),this.clearClip(),t.prototype.clear.call(this)},e.prototype.clearClip=function(){this.clip&&(this.clip.removeObserver(this),delete this.clip)},e.prototype.setClip=function(t){this.clip&&(t.beginPath(),no(t,this.clip),t.clip())},e.prototype.optionsChange=function(e){"clip"===e.field&&(this.clearClip(),this.initClip()),t.prototype.optionsChange.call(this,e)},e.prototype.setTransform=function(t){if(this.srcElement){var e=this.srcElement.transform();e&&t.transform.apply(t,e.matrix().toArray(6))}},e.prototype.loadElements=function(t,e,i){for(var o=0;o<t.length;o++){var r=t[o],n=r.children,s=new ro[r.nodeType](r,i);n&&n.length>0&&s.load(n,e,i),B(e)?this.insertAt(s,e):this.append(s)}},e.prototype.load=function(t,e,i){this.loadElements(t,e,i),this.invalidate()},e.prototype.setOpacity=function(t){if(this.srcElement){var e=this.srcElement.opacity();B(e)&&this.globalAlpha(t,e)}},e.prototype.globalAlpha=function(t,e){var i=e;i&&t.globalAlpha&&(i*=t.globalAlpha),t.globalAlpha=i},e.prototype.visible=function(){var t=this.srcElement;return!t||t&&!1!==t.options.visible},e}(Ze),ao=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderTo=function(t){if(this.visible()){t.save(),this.setTransform(t),this.setClip(t),this.setOpacity(t);for(var e=this.childNodes,i=0;i<e.length;i++){var o=e[i];o.visible()&&o.renderTo(t)}t.restore()}},e}(ce(so,"childNodes"));function po(t,e){var i,o=0;if(!e||e<=0)return t;var r=function(){var r=Ge()-o,n=arguments,s=function(){t.apply(null,n),o=Ge()};if(!o)return s();i&&clearTimeout(i),r>e?s():i=setTimeout(s,e-r)};return r.cancel=function(){clearTimeout(i)},r}var ho=function(t){function e(e,i){t.call(this),this.canvas=e,this.size=i,this.ctx=e.getContext("2d");var o=this._invalidate.bind(this);this.invalidate=po((function(){We(o)}),1e3/60)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.canvas=null,this.ctx=null},e.prototype.load=function(t,e,i){this.loadElements(t,e,i),this._invalidate()},e.prototype._rescale=function(t){var e=this.canvas,i=this.size;e.width=i.width*t,e.height=i.height*t,this.ctx.scale(t,t)},e.prototype._devicePixelRatio=function(){return"number"==typeof window.devicePixelRatio?window.devicePixelRatio:1},e.prototype._invalidate=function(t){if(this.ctx){var e=t&&t.fixedScale?1:this._devicePixelRatio();this._rescale(e),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderTo(this.ctx)}},e}(ce(ao,"childNodes")),co=function(t){function e(){t.call(this),this.shapes=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._add=function(t,e){this.shapes.push({bbox:e,shape:t}),t._quadNode=this},e.prototype.pointShapes=function(t){for(var e=this.shapes,i=e.length,o=[],r=0;r<i;r++)e[r].bbox.containsPoint(t)&&o.push(e[r].shape);return o},e.prototype.insert=function(t,e){this._add(t,e)},e.prototype.remove=function(t){for(var e=this.shapes,i=e.length,o=0;o<i;o++)if(e[o].shape===t){e.splice(o,1);break}},e}(O),lo=function(t){function e(e){t.call(this),this.children=[],this.rect=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.inBounds=function(t){var e=this.rect,i=e.bottomRight(),o=t.bottomRight(),r=e.origin.x<=t.origin.x&&e.origin.y<=t.origin.y&&o.x<=i.x&&o.y<=i.y;return r},e.prototype.pointShapes=function(e){for(var i=this.children,o=i.length,r=t.prototype.pointShapes.call(this,e),n=0;n<o;n++)le(r,i[n].pointShapes(e));return r},e.prototype.insert=function(t,e){var i=this.children,o=!1;if(this.inBounds(e)){if(this.shapes.length<4)this._add(t,e);else{i.length||this._initChildren();for(var r=0;r<i.length;r++)if(i[r].insert(t,e)){o=!0;break}o||this._add(t,e)}o=!0}return o},e.prototype._initChildren=function(){var t=this.rect,i=this.children,o=t.center(),r=t.width()/2,n=t.height()/2;i.push(new e(new Y([t.origin.x,t.origin.y],[r,n])),new e(new Y([o.x,t.origin.y],[r,n])),new e(new Y([t.origin.x,o.y],[r,n])),new e(new Y([o.x,o.y],[r,n])))},e}(co);function uo(t,e){return t._zIndex<e._zIndex?1:t._zIndex>e._zIndex?-1:0}var fo=function(t){function e(){t.call(this),this.initRoots()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initRoots=function(){this.rootMap={},this.root=new co,this.rootElements=[]},e.prototype.clear=function(){for(var t=this.rootElements,e=0;e<t.length;e++)this.remove(t[e]);this.initRoots()},e.prototype.pointShape=function(t){var e=(this.rootMap[Math.floor(t.x/3e3)]||{})[Math.floor(t.y/3e3)],i=this.root.pointShapes(t);e&&(i=i.concat(e.pointShapes(t))),this.assignZindex(i),i.sort(uo);for(var o=0;o<i.length;o++)if(i[o].containsPoint(t))return i[o]},e.prototype.assignZindex=function(t){for(var e=0;e<t.length;e++){for(var i=t[e],o=0,r=Math.pow(1e4,75),n=[];i;)n.push(i),i=i.parent;for(;n.length;)o+=(((i=n.pop()).parent?i.parent.children:this.rootElements).indexOf(i)+1)*r,r/=1e4;t[e]._zIndex=o}},e.prototype.optionsChange=function(t){"transform"!==t.field&&"stroke.width"!==t.field||this.bboxChange(t.element)},e.prototype.geometryChange=function(t){this.bboxChange(t.element)},e.prototype.bboxChange=function(t){if("Group"===t.nodeType)for(var e=0;e<t.children.length;e++)this.bboxChange(t.children[e]);else t._quadNode&&t._quadNode.remove(t),this._insertShape(t)},e.prototype.add=function(t){var e=Array.isArray(t)?t.slice(0):[t];le(this.rootElements,e),this._insert(e)},e.prototype.childrenChange=function(t){if("remove"===t.action)for(var e=0;e<t.items.length;e++)this.remove(t.items[e]);else this._insert(Array.prototype.slice.call(t.items,0))},e.prototype._insert=function(t){for(var e;t.length>0;)(e=t.pop()).addObserver(this),"Group"===e.nodeType?le(t,e.children):this._insertShape(e)},e.prototype._insertShape=function(t){var e=t.bbox();if(e){var i=this.getSectors(e),o=i[0][0],r=i[1][0];if(this.inRoot(i))this.root.insert(t,e);else{var n=this.rootMap;n[o]||(n[o]={}),n[o][r]||(n[o][r]=new lo(new Y([3e3*o,3e3*r],[3e3,3e3]))),n[o][r].insert(t,e)}}},e.prototype.remove=function(t){if(t.removeObserver(this),"Group"===t.nodeType)for(var e=t.children,i=0;i<e.length;i++)this.remove(e[i]);else t._quadNode&&(t._quadNode.remove(t),delete t._quadNode)},e.prototype.inRoot=function(t){return t[0].length>1||t[1].length>1},e.prototype.getSectors=function(t){for(var e=t.bottomRight(),i=Math.floor(e.x/3e3),o=Math.floor(e.y/3e3),r=[[],[]],n=Math.floor(t.origin.x/3e3);n<=i;n++)r[0].push(n);for(var s=Math.floor(t.origin.y/3e3);s<=o;s++)r[1].push(s);return r},e}(O),yo=function(t){t.bind("mouseenter",this._mouseenter.bind(this)),t.bind("mouseleave",this._mouseleave.bind(this)),this.element=t.element};yo.prototype.clear=function(){this._resetCursor()},yo.prototype.destroy=function(){this._resetCursor(),delete this.element},yo.prototype._mouseenter=function(t){var e=this._shapeCursor(t);e?(this._current||(this._defaultCursor=this._getCursor()),this._setCursor(e)):this._resetCursor()},yo.prototype._mouseleave=function(){this._resetCursor()},yo.prototype._shapeCursor=function(t){for(var e=t.element;e&&!B(e.options.cursor);)e=e.parent;if(e)return e.options.cursor},yo.prototype._getCursor=function(){if(this.element)return this.element.style.cursor},yo.prototype._setCursor=function(t){this.element&&(this.element.style.cursor=t,this._current=t)},yo.prototype._resetCursor=function(){this._current&&(this._setCursor(this._defaultCursor||""),delete this._current)};var vo=yo,go={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},mo=Si.browser,xo=function(t){var e=Object.keys(go);e.push("transparent");var i=new RegExp("^("+e.join("|")+")(\\W|$)","i");return xo=function(t){return i.exec(t)},i.exec(t)},bo=function(t){function e(){t.call(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toHSV=function(){return this},e.prototype.toRGB=function(){return this},e.prototype.toHex=function(){return this.toBytes().toHex()},e.prototype.toBytes=function(){return this},e.prototype.toCss=function(){return"#"+this.toHex()},e.prototype.toCssRgba=function(){var t=this.toBytes();return"rgba("+t.r+", "+t.g+", "+t.b+", "+parseFloat(Number(this.a).toFixed(3))+")"},e.prototype.toDisplay=function(){return mo.msie&&mo.version<9?this.toCss():this.toCssRgba()},e.prototype.equals=function(t){return t===this||null!==t&&this.toCssRgba()===Po(t).toCssRgba()},e.prototype.diff=function(t){if(null===t)return NaN;var e=this.toBytes(),i=t.toBytes();return Math.sqrt(Math.pow(.3*(e.r-i.r),2)+Math.pow(.59*(e.g-i.g),2)+Math.pow(.11*(e.b-i.b),2))},e.prototype.clone=function(){var t=this.toBytes();return t===this&&(t=new wo(t.r,t.g,t.b,t.a)),t},e}(O),_o=function(t){function e(e,i,o,r){t.call(this),this.r=e,this.g=i,this.b=o,this.a=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toHSV=function(){var t,e,i=this.r,o=this.g,r=this.b,n=Math.min(i,o,r),s=Math.max(i,o,r),a=s-n,p=s;return 0===a?new So(0,0,p,this.a):(0!==s?(e=a/s,t=i===s?(o-r)/a:o===s?2+(r-i)/a:4+(i-o)/a,(t*=60)<0&&(t+=360)):(e=0,t=-1),new So(t,e,p,this.a))},e.prototype.toHSL=function(){var t,e,i=this.r,o=this.g,r=this.b,n=Math.max(i,o,r),s=Math.min(i,o,r),a=(n+s)/2;if(n===s)t=e=0;else{var p=n-s;switch(e=a>.5?p/(2-n-s):p/(n+s),n){case i:t=(o-r)/p+(o<r?6:0);break;case o:t=(r-i)/p+2;break;case r:t=(i-o)/p+4}}return new ko(60*t,100*e,100*a,this.a)},e.prototype.toBytes=function(){return new wo(255*this.r,255*this.g,255*this.b,this.a)},e}(bo),wo=function(t){function e(e,i,o,r){t.call(this,Math.round(e),Math.round(i),Math.round(o),r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toRGB=function(){return new t(this.r/255,this.g/255,this.b/255,this.a)},e.prototype.toHSV=function(){return this.toRGB().toHSV()},e.prototype.toHSL=function(){return this.toRGB().toHSL()},e.prototype.toHex=function(){return Ao(this.r,2)+Ao(this.g,2)+Ao(this.b,2)},e.prototype.toBytes=function(){return this},e}(_o);function Ao(t,e,i){void 0===i&&(i="0");for(var o=t.toString(16);e>o.length;)o=i+o;return o}var So=function(t){function e(e,i,o,r){t.call(this),this.h=e,this.s=i,this.v=o,this.a=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toRGB=function(){var t,e,i,o=this.h,r=this.s,n=this.v;if(0===r)t=e=i=n;else{o/=60;var s=Math.floor(o),a=o-s,p=n*(1-r),h=n*(1-r*a),c=n*(1-r*(1-a));switch(s){case 0:t=n,e=c,i=p;break;case 1:t=h,e=n,i=p;break;case 2:t=p,e=n,i=c;break;case 3:t=p,e=h,i=n;break;case 4:t=c,e=p,i=n;break;default:t=n,e=p,i=h}}return new _o(t,e,i,this.a)},e.prototype.toHSL=function(){return this.toRGB().toHSL()},e.prototype.toBytes=function(){return this.toRGB().toBytes()},e}(bo),ko=function(t){function e(e,i,o,r){t.call(this),this.h=e,this.s=i,this.l=o,this.a=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toRGB=function(){var t,e,i,o=this.h/360,r=this.s/100,n=this.l/100;if(0===r)t=e=i=n;else{var s=n<.5?n*(1+r):n+r-n*r,a=2*n-s;t=Co(a,s,o+1/3),e=Co(a,s,o),i=Co(a,s,o-1/3)}return new _o(t,e,i,this.a)},e.prototype.toHSV=function(){return this.toRGB().toHSV()},e.prototype.toBytes=function(){return this.toRGB().toBytes()},e}(bo);function Co(t,e,i){var o=i;return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+6*(e-t)*o:o<.5?e:o<2/3?t+(e-t)*(2/3-o)*6:t}function Po(t,e){var i,o;if(null==t||"none"===t)return null;if(t instanceof bo)return t;var r=t.toLowerCase();if(i=xo(r))return(r="transparent"===i[1]?new _o(1,1,1,0):Po(go[i[1]],e)).match=[i[1]],r;if((i=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/i.exec(r))?o=new wo(parseInt(i[1],16),parseInt(i[2],16),parseInt(i[3],16),1):(i=/^#?([0-9a-f])([0-9a-f])([0-9a-f])\b/i.exec(r))?o=new wo(parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16),parseInt(i[3]+i[3],16),1):(i=/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(r))?o=new wo(parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10),1):(i=/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(r))?o=new wo(parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10),parseFloat(i[4])):(i=/^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(r))?o=new _o(parseFloat(i[1])/100,parseFloat(i[2])/100,parseFloat(i[3])/100,1):(i=/^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(r))&&(o=new _o(parseFloat(i[1])/100,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(i[4]))),o)o.match=i;else if(!e)throw new Error("Cannot parse color: "+r);return o}var To=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderTo=function(t){t.save(),this.setTransform(t),this.setClip(t),this.setOpacity(t),t.beginPath(),this.renderPoints(t,this.srcElement),this.setLineDash(t),this.setLineCap(t),this.setLineJoin(t),this.setFill(t),this.setStroke(t),t.restore()},e.prototype.setFill=function(t){var e=this.srcElement.options.fill,i=!1;return e&&("Gradient"===e.nodeType?(this.setGradientFill(t,e),i=!0):tt(e.color)||(t.fillStyle=e.color,t.save(),this.globalAlpha(t,e.opacity),t.fill(),t.restore(),i=!0)),i},e.prototype.setGradientFill=function(t,e){var i,o=this.srcElement.rawBBox();if(e instanceof ze){var r=e.start(),n=e.end();i=t.createLinearGradient(r.x,r.y,n.x,n.y)}else if(e instanceof Ee){var s=e.center();i=t.createRadialGradient(s.x,s.y,0,s.x,s.y,e.radius())}!function(t,e){for(var i=0;i<e.length;i++){var o=e[i],r=Po(o.color());r.a*=o.opacity(),t.addColorStop(o.offset(),r.toCssRgba())}}(i,e.stops),t.save(),e.userSpace()||t.transform(o.width(),0,0,o.height(),o.origin.x,o.origin.y),t.fillStyle=i,t.fill(),t.restore()},e.prototype.setStroke=function(t){var e=this.srcElement.options.stroke;if(e&&!tt(e.color)&&e.width>0)return t.strokeStyle=e.color,t.lineWidth=Q(e.width,1),t.save(),this.globalAlpha(t,e.opacity),t.stroke(),t.restore(),!0},e.prototype.dashType=function(){var t=this.srcElement.options.stroke;if(t&&t.dashType)return t.dashType.toLowerCase()},e.prototype.setLineDash=function(t){var e=this.dashType();if(e&&"solid"!==e){var i=Ei[e];t.setLineDash?t.setLineDash(i):(t.mozDash=i,t.webkitLineDash=i)}},e.prototype.setLineCap=function(t){var e=this.dashType(),i=this.srcElement.options.stroke;e&&"solid"!==e?t.lineCap="butt":i&&i.lineCap&&(t.lineCap=i.lineCap)},e.prototype.setLineJoin=function(t){var e=this.srcElement.options.stroke;e&&e.lineJoin&&(t.lineJoin=e.lineJoin)},e.prototype.renderPoints=function(t,e){no(t,e)},e}(so),Mo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderPoints=function(t){no(t,this.srcElement.toPath())},e}(To),Oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderPoints=function(t){var e=this.srcElement.geometry(),i=e.center,o=e.radius;t.arc(i.x,i.y,o,0,2*Math.PI)},e}(To),Ro=function(t){function e(e,i){t.call(this,e),this.onLoad=this.onLoad.bind(this),this.onError=this.onError.bind(this),this.loading=io();var o=this.img=new Image;i&&!/^data:/i.test(e.src())&&(o.crossOrigin=i),o.src=e.src(),o.complete?this.onLoad():(o.onload=this.onLoad,o.onerror=this.onError)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderTo=function(t){"resolved"===this.loading.state()&&(t.save(),this.setTransform(t),this.setClip(t),this.drawImage(t),t.restore())},e.prototype.optionsChange=function(e){"src"===e.field?(this.loading=io(),this.img.src=this.srcElement.src()):t.prototype.optionsChange.call(this,e)},e.prototype.onLoad=function(){this.loading.resolve(),this.invalidate()},e.prototype.onError=function(){this.loading.reject(new Error("Unable to load image '"+this.img.src+"'. Check for connectivity and verify CORS headers."))},e.prototype.drawImage=function(t){var e=this.srcElement.rect(),i=e.topLeft();t.drawImage(this.img,i.x,i.y,e.width(),e.height())},e}(To),Bo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderPoints=function(t){for(var e=this.srcElement.paths,i=0;i<e.length;i++)no(t,e[i])},e}(To),jo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderPoints=function(e){var i=this.srcElement.geometry(),o=i.cornerRadius,r=o[0],n=o[1];if(0===r&&0===n){var s=i.origin,a=i.size;e.rect(s.x,s.y,a.width,a.height)}else t.prototype.renderPoints.call(this,e,Zt.fromRect(i))},e}(To),Io=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderTo=function(t){var e=this.srcElement,i=e.position(),o=e.measure();t.save(),this.setTransform(t),this.setClip(t),this.setOpacity(t),t.beginPath(),t.font=e.options.font,t.textAlign="left",this.setFill(t)&&t.fillText(e.content(),i.x,i.y+o.baseline),this.setStroke(t)&&(this.setLineDash(t),t.strokeText(e.content(),i.x,i.y+o.baseline)),t.restore()},e}(To);ro.Arc=Mo,ro.Circle=Oo,ro.Group=ao,ro.Image=Ro,ro.MultiPath=Bo,ro.Path=To,ro.Rect=jo,ro.Text=Io;var Lo,zo,Eo=function(t){function e(e,i){t.call(this,e,i),this.element.innerHTML=this._template(this);var o=this.element.firstElementChild,r=oi(e);o.width=r.width,o.height=r.height,this._rootElement=o,this._root=new ho(o,r),this._mouseTrackHandler=this._trackMouse.bind(this),Li(this.element,{click:this._mouseTrackHandler,mousemove:this._mouseTrackHandler})}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{configurable:!0}};return i.type.get=function(){return"canvas"},e.prototype.destroy=function(){t.prototype.destroy.call(this),this._root&&(this._root.destroy(),this._root=null),this._searchTree&&(this._searchTree.clear(),delete this._searchTree),this._cursor&&(this._cursor.destroy(),delete this._cursor),zi(this.element,{click:this._mouseTrackHandler,mousemove:this._mouseTrackHandler})},e.prototype.draw=function(e){t.prototype.draw.call(this,e),this._root.load([e],void 0,this.options.cors),this._searchTree&&this._searchTree.add([e])},e.prototype.clear=function(){t.prototype.clear.call(this),this._root.clear(),this._searchTree&&this._searchTree.clear(),this._cursor&&this._cursor.clear()},e.prototype.eventTarget=function(t){if(this._searchTree){var e=this._surfacePoint(t);return this._searchTree.pointShape(e)}},e.prototype.image=function(){var t=this._root,e=this._rootElement,i=[];t.traverse((function(t){t.loading&&i.push(t.loading)}));var o=io(),r=function(){t._invalidate({fixedScale:!0});try{var i=e.toDataURL();o.resolve(i)}catch(t){o.reject(t)}};return oo(i).then(r,r),o},e.prototype.suspendTracking=function(){t.prototype.suspendTracking.call(this),this._searchTree&&(this._searchTree.clear(),delete this._searchTree)},e.prototype.resumeTracking=function(){if(t.prototype.resumeTracking.call(this),!this._searchTree){this._searchTree=new fo;for(var e=this._root.childNodes,i=[],o=0;o<e.length;o++)i.push(e[o].srcElement);this._searchTree.add(i)}},e.prototype._resize=function(){this._rootElement.width=this._size.width,this._rootElement.height=this._size.height,this._root.size=this._size,this._root.invalidate()},e.prototype._template=function(){return"<canvas style='width: 100%; height: 100%;'></canvas>"},e.prototype._enableTracking=function(){this._searchTree=new fo,this._cursor=new vo(this),t.prototype._enableTracking.call(this)},e.prototype._trackMouse=function(t){if(!this._suspendedTracking){var e=this.eventTarget(t);if("click"!==t.type){var i=this._currentShape;i&&i!==e&&this.trigger("mouseleave",{element:i,originalEvent:t,type:"mouseleave"}),e&&i!==e&&this.trigger("mouseenter",{element:e,originalEvent:t,type:"mouseenter"}),this.trigger("mousemove",{element:e,originalEvent:t,type:"mousemove"}),this._currentShape=e}else e&&this.trigger("click",{element:e,originalEvent:t,type:"click"})}},Object.defineProperties(e.prototype,i),e}(ui),Vo=function(){return"undefined"!=typeof document},Fo=function(t){function e(){t.call(this),this._items=[{name:"svg",type:eo},{name:"canvas",type:Eo}]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={support:{configurable:!0},current:{configurable:!0}};return i.support.get=function(){return zo||(zo={canvas:Vo()&&document.createElement("canvas").getContext,svg:Vo()&&document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}),zo},i.current.get=function(){return Lo||(Lo=new e),Lo},e.prototype.create=function(t,e){var i=this._items,o=i[0];if(e&&e.type)for(var r=e.type.toLowerCase(),n=0;n<i.length;n++)if(i[n].name===r){o=i[n];break}if(o)return new o.type(t,e);fi("Warning: Unable to create Kendo UI Drawing Surface. Possible causes:\n- The browser does not support SVG and Canvas. User agent: "+navigator.userAgent)},Object.defineProperties(e,i),e}(O),Do=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={support:{configurable:!0}};return i.support.get=function(){return Fo.support},e.create=function(t,e){return Fo.current.create(t,e)},Object.defineProperties(e,i),e}(ui);function Uo(t){var e=new Ii({skipBaseHref:!0}),i=t.clippedBBox(),o=t;if(i){var r=i.getOrigin(),n=new ue;n.transform(K().translate(-r.x,-r.y)),n.children.push(t),o=n}e.load([o]);var s="<?xml version='1.0' ?><svg xmlns='"+mi+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>"+e.render()+"</svg>";return e.destroy(),s}var Ho={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"};function Go(t){for(var e=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],i="";t>0;)t<e[0]?e.shift():(i+=Ho[e[0]],t-=e[0]);return i}var No=String.fromCharCode;var Wo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function qo(t){for(var e="",i=0,o=function(t){for(var e="",i=0;i<t.length;i++){var o=t.charCodeAt(i);if(55296<=o&&o<=56319){var r=o,n=t.charCodeAt(++i);isNaN(n)||(o=1024*(r-55296)+(n-56320)+65536)}o<128?e+=No(o):o<2048?(e+=No(192|o>>>6),e+=No(128|63&o)):o<65536?(e+=No(224|o>>>12),e+=No(128|o>>>6&63),e+=No(128|63&o)):o<1114111&&(e+=No(240|o>>>18),e+=No(128|o>>>12&63),e+=No(128|o>>>6&63),e+=No(128|63&o))}return e}(t);i<o.length;){var r=o.charCodeAt(i++),n=o.charCodeAt(i++),s=o.charCodeAt(i++),a=r>>2,p=(3&r)<<4|n>>4,h=(15&n)<<2|s>>6,c=63&s;isNaN(n)?h=c=64:isNaN(s)&&(c=64),e=e+Wo.charAt(a)+Wo.charAt(p)+Wo.charAt(h)+Wo.charAt(c)}return e}function Xo(t,e){if(t.length<2)return t.slice();return function t(i){if(i.length<=1)return i;var o=Math.floor(i.length/2),r=i.slice(0,o),n=i.slice(o);return function(t,i){for(var o=[],r=0,n=0,s=0;r<t.length&&n<i.length;)e(t[r],i[n])<=0?o[s++]=t[r++]:o[s++]=i[n++];return r<t.length&&o.push.apply(o,t.slice(r)),n<i.length&&o.push.apply(o,i.slice(n)),o}(r=t(r),n=t(n))}(t)}function Yo(t,e){var i={width:"800px",height:"600px",cors:"Anonymous"},o=t,r=t.clippedBBox();if(r){var n=r.getOrigin();(o=new ue).transform(K().translate(-n.x,-n.y)),o.children.push(t);var s=r.getSize();i.width=s.width+"px",i.height=s.height+"px"}var a=Object.assign(i,e),p=document.createElement("div"),h=p.style;h.display="none",h.width=a.width,h.height=a.height,document.body.appendChild(p);var c=new Eo(p,a);c.suspendTracking(),c.draw(o);var l=c.image(),u=function(){c.destroy(),document.body.removeChild(p)};return l.then(u,u),l}function Zo(t,e){var i=Uo(t);return e&&e.raw||(i="data:image/svg+xml;base64,"+qo(i)),io().resolve(i)}function Ko(t){var e=.5;t.options.stroke&&a.util.defined(t.options.stroke.width)&&t.options.stroke.width%2==0&&(e=0);for(var i=0;i<t.segments.length;i++)t.segments[i].anchor().round(0).translate(e,e);return t}function Jo(t,e){return-t.x*e.y+t.y*e.x<0}function $o(t){return"number"==typeof t&&!isNaN(t)}function Qo(t){return"string"==typeof t}function tr(t){return $o(t)||Qo(t)&&isFinite(t)}function er(t){return"function"==typeof t}function ir(t,e){for(var i in e){var o=e[i],r=typeof o,n=void 0;if((n="object"===r&&null!==o?o.constructor:null)&&n!==Array)if(o instanceof Date)t[i]=new Date(o.getTime());else if(er(o.clone))t[i]=o.clone();else{var s=t[i];t[i]="object"==typeof s&&s||{},ir(t[i],o)}else"undefined"!==r&&(t[i]=o)}return t}function or(t){for(var e=arguments,i=arguments.length,o=1;o<i;o++)ir(t,e[o]);return t}function rr(t){return"object"==typeof t}function nr(t){return $o(t)?t+"px":t}var sr=/width|height|top|left|bottom|right/i;function ar(t){return sr.test(t)}function pr(t,e){var i=Qo(e)?[e]:e;if(C(i)){for(var o={},r=window.getComputedStyle(t),n=0;n<i.length;n++){var s=i[n];o[s]=ar(s)?parseFloat(r[s]):r[s]}return o}if(rr(e))for(var a in e)t.style[a]=nr(e[a])}function hr(t,e){void 0===e&&(e=0);var i={top:0,right:0,bottom:0,left:0};return"number"==typeof t?i.top=i[b]=i[u]=i[g]=t:(i.top=t.top||e,i[b]=t[b]||e,i[u]=t[u]||e,i[g]=t[g]||e),i}var cr={format:function(t,e){return e},toString:function(t){return t},parseDate:function(t){return new Date(t)},firstDay:function(){return 0}},lr=function(){},ur={implementation:{configurable:!0}};lr.register=function(t){cr=t},ur.implementation.get=function(){return cr},Object.defineProperties(lr,ur);var fr=lr,dr=/\{(\d+)(:[^\}]+)?\}/g,yr=function(t){this._intlService=t},vr={intl:{configurable:!0}};vr.intl.get=function(){return this._intlService||fr.implementation},vr.intl.set=function(t){this._intlService=t},yr.prototype.auto=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];var o=this.intl;return Qo(t)&&t.match(v)?o.format.apply(o,[t].concat(e)):o.toString(e[0],t)},yr.prototype.localeAuto=function(t,e,i){var o=this.intl;return Qo(t)&&t.match(v)?t.replace(dr,(function(t,r,n){var s=e[parseInt(r,10)];return o.toString(s,n?n.substring(1):"",i)})):o.toString(e[0],t,i)},Object.defineProperties(yr.prototype,vr);var gr=yr,mr=function(t,e){void 0===e&&(e={}),this._intlService=e.intlService,this.sender=e.sender||t,this.format=new gr(e.intlService),this.chart=t,this.rtl=Boolean(e.rtl)},xr={intl:{configurable:!0}};xr.intl.get=function(){return this._intlService||fr.implementation},xr.intl.set=function(t){this._intlService=t,this.format.intl=t},mr.prototype.notify=function(t,e){this.chart&&this.chart.trigger(t,e)},mr.prototype.isPannable=function(t){var e=((this.chart||{}).options||{}).pannable;return e&&e.lock!==t},Object.defineProperties(mr.prototype,xr);var br,_r=mr,wr=function(){};wr.register=function(t){br=t},wr.create=function(t,e){if(br)return br.create(t,e)};var Ar=wr,Sr={compile:function(t){return t}},kr=function(){};kr.register=function(t){Sr=t},kr.compile=function(t){return Sr.compile(t)};var Cr=kr;function Pr(t){var e;return void 0===t&&(t={}),t.template?t.template=e=Cr.compile(t.template):er(t.content)&&(e=t.content),e}var Tr=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g,Mr={};function Or(t){if(Mr[t])return Mr[t];var e=[];return t.replace(Tr,(function(t,i,o,r){e.push(a.util.defined(i)?i:o||r)})),Mr[t]=function(t){for(var i=t,o=0;o<e.length&&i;o++)i=i[e[o]];return i},Mr[t]}function Rr(t,e){for(var i=t.length,o=[],r=0;r<i;r++)e(t[r])&&o.push(t[r]);return o}function Br(t,e){if(t.className)for(var i=e.split(" "),o=0;o<i.length;o++)if(-1!==t.className.indexOf(i[o]))return!0}Mr[void 0]=function(t){return t};var jr=function(){this._map={}};jr.prototype.get=function(t){return this._map[this._key(t)]},jr.prototype.set=function(t,e){this._map[this._key(t)]=e},jr.prototype._key=function(t){return t instanceof Date?t.getTime():t};var Ir=jr;function Lr(t,e){if(e)return-1!==e.indexOf(t)}function zr(t,e,i){return a.util.round(t+(e-t)*i,3)}var Er=function(t,e){this.observer=t,this.handlerMap=or({},this.handlerMap,e)};Er.prototype.trigger=function(t,e){var i,o=this.observer,r=this.handlerMap;return r[t]?i=this.callObserver(r[t],e):o.trigger&&(i=this.callObserver("trigger",t,e)),i},Er.prototype.callObserver=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return this.observer[t].apply(this.observer,e)},Er.prototype.requiresHandlers=function(t){if(this.observer.requiresHandlers)return this.observer.requiresHandlers(t);for(var e=0;e<t.length;e++)if(this.handlerMap[t[e]])return!0};var Vr=Er;function Fr(t,e){for(var i=t.length,o=[],r=0;r<i;r++){var n=e(t[r]);a.util.defined(n)&&o.push(n)}return o}function Dr(t){var e=0;return t.wheelDelta&&(e=(e=-t.wheelDelta/120)>0?Math.ceil(e):Math.floor(e)),t.detail&&(e=a.util.round(t.detail/3)),e}var Ur=a.util,Hr=Ur.append,Gr=Ur.bindEvents,Nr=Ur.defined,Wr=Ur.deg,qr=Ur.elementOffset,Xr=Ur.elementSize,Yr=Ur.eventElement,Zr=Ur.eventCoordinates,Kr=Ur.last,Jr=Ur.limitValue,$r=Ur.objectKey,Qr=Ur.rad,tn=Ur.round,en=Ur.unbindEvents,on=Ur.valueOrDefault,rn=function(){};rn.fetchFonts=function(t,e,i){void 0===i&&(i={depth:0});!t||i.depth>5||!document.fonts||Object.keys(t).forEach((function(o){var r=t[o];"dataSource"!==o&&"$"!==o[0]&&r&&("font"===o?e.push(r):"object"==typeof r&&(i.depth++,rn.fetchFonts(r,e,i),i.depth--))}))},rn.loadFonts=function(t,e){var i=[];if(t.length>0&&document.fonts){try{i=t.map((function(t){return document.fonts.load(t)}))}catch(t){fi(t)}Promise.all(i).then(e,e)}else e()},rn.preloadFonts=function(t,e){var i=[];rn.fetchFonts(t,i),rn.loadFonts(i,e)};var nn=rn;function sn(t,e){var i=t.prototype;i.options?i.options=or({},i.options,e):i.options=e}function an(t){for(var e=m,i=x,o=0,r=t.length;o<r;o++){var n=t[o];null!==n&&isFinite(n)&&(e=Math.min(e,n),i=Math.max(i,n))}return{min:e===m?void 0:e,max:i===x?void 0:i}}function pn(t,e){for(var i=0;i<t.length;i++){var o=t[i];if(e(o,i,t))return o}}var hn=p.Matrix,cn=/matrix\((.*)\)/;function ln(t){var e=getComputedStyle(t).transform;return"none"===e?hn.unit():function(t){var e=t.match(cn);if(null===e||2!==e.length)return hn.unit();var i=e[1].split(",").map((function(t){return parseFloat(t)}));return new(Function.prototype.bind.apply(hn,[null].concat(i)))}(e)}function un(t){if(!t)return hn.unit();for(var e=ln(t),i=t.parentElement;i;){var o=ln(i);e=e.multiplyCopy(o),i=i.parentElement}return e.b=e.c=e.e=e.f=0,e}var fn=function(t){function e(i){var o=this;if(t.call(this),1===arguments.length)for(var r=e.formats,n=this.resolveColor(i),s=0;s<r.length;s++){var a=r[s].re,p=r[s].process,h=a.exec(n);if(h){var c=p(h);o.r=c[0],o.g=c[1],o.b=c[2]}}else this.r=arguments[0],this.g=arguments[1],this.b=arguments[2];this.r=this.normalizeByte(this.r),this.g=this.normalizeByte(this.g),this.b=this.normalizeByte(this.b)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toHex=function(){var t=this.padDigit,e=this.r.toString(16),i=this.g.toString(16),o=this.b.toString(16);return"#"+t(e)+t(i)+t(o)},e.prototype.resolveColor=function(t){var i=t||"black";return"#"===i.charAt(0)&&(i=i.substr(1,6)),i=(i=i.replace(/ /g,"")).toLowerCase(),i=e.namedColors[i]||i},e.prototype.normalizeByte=function(t){return t<0||isNaN(t)?0:t>255?255:t},e.prototype.padDigit=function(t){return 1===t.length?"0"+t:t},e.prototype.brightness=function(t){var e=Math.round;return this.r=e(this.normalizeByte(this.r*t)),this.g=e(this.normalizeByte(this.g*t)),this.b=e(this.normalizeByte(this.b*t)),this},e.prototype.percBrightness=function(){return Math.sqrt(.241*this.r*this.r+.691*this.g*this.g+.068*this.b*this.b)},e.prototype.isDark=function(){return this.percBrightness()<180},e.fromBytes=function(t,e,i,o){return new wo(t,e,i,null!=o?o:1)},e.fromRGB=function(t,e,i,o){return new _o(t,e,i,null!=o?o:1)},e.fromHSV=function(t,e,i,o){return new So(t,e,i,null!=o?o:1)},e.fromHSL=function(t,e,i,o){return new ko(t,e,i,null!=o?o:1)},e}(O);fn.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(t){return[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],fn.namedColors=go;var dn=fn;var yn=function(t){return new dn(t).isDark()?A:l},vn={},gn=function(t){this._index={},this._values=t?t.slice(0):[];for(var e=0;e<this._values.length;e++)this._index[this._values[e]]=e},mn={size:{configurable:!0}};gn.prototype.values=function(){return this._values.filter((function(t){return t!==vn}))},gn.prototype.has=function(t){return void 0!==this._index[t]},gn.prototype.add=function(t){this.has(t)||(this._index[t]=this._values.length,this._values.push(t))},gn.prototype.delete=function(t){var e=this._index[t];void 0!==e&&(this._values[e]=vn,delete this._index[t])},gn.prototype.clear=function(){this._index={},this._values=[]},mn.size.get=function(){return this._values.length},Object.defineProperties(gn.prototype,mn);var xn=function(t){this._set=new Set(t)},bn={size:{configurable:!0}};function _n(t){return"function"==typeof Set?new xn(t):new gn(t)}function wn(t,e){var i=tn(e-t,9);if(0===i){if(0===e)return.1;i=Math.abs(e)}var o=Math.pow(10,Math.floor(Math.log(i)/Math.log(10))),r=tn(i/o,10);return tn(o*(r<1.904762?.2:r<4.761904?.5:r<9.523809?1:2),10)}xn.prototype.values=function(){return Array.from(this._set)},xn.prototype.has=function(t){return this._set.has(t)},xn.prototype.add=function(t){this._set.add(t)},xn.prototype.delete=function(t){this._set.delete(t)},xn.prototype.clear=function(){this._set.clear()},bn.size.get=function(){return this._set.size},Object.defineProperties(xn.prototype,bn);var An=function(t){function e(e,i){t.call(this),this.x=e||0,this.y=i||0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.equals=function(t){return t&&this.x===t.x&&this.y===t.y},e.prototype.rotate=function(t,e){var i=Qr(e),o=Math.cos(i),r=Math.sin(i),n=t.x,s=t.y,a=this.x,p=this.y;return this.x=tn(n+(a-n)*o+(p-s)*r,3),this.y=tn(s+(p-s)*o-(a-n)*r,3),this},e.prototype.multiply=function(t){return this.x*=t,this.y*=t,this},e.prototype.distanceTo=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},e.onCircle=function(t,i,o){var r=Qr(i);return new e(t.x-o*Math.cos(r),t.y-o*Math.sin(r))},e}(O);function Sn(t,e,i,o,r){var n=Qr(r);return new An(i+(t-i)*Math.cos(n)+(e-o)*Math.sin(n),o-(t-i)*Math.sin(n)+(e-o)*Math.cos(n))}var kn=function(t){function e(e,i,o,r){t.call(this),this.x1=e||0,this.y1=i||0,this.x2=o||0,this.y2=r||0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.equals=function(t){return this.x1===t.x1&&this.x2===t.x2&&this.y1===t.y1&&this.y2===t.y2},e.prototype.width=function(){return this.x2-this.x1},e.prototype.height=function(){return this.y2-this.y1},e.prototype.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},e.prototype.move=function(t,e){var i=this.height(),o=this.width();return Nr(t)&&(this.x1=t,this.x2=this.x1+o),Nr(e)&&(this.y1=e,this.y2=this.y1+i),this},e.prototype.wrap=function(t){return this.x1=Math.min(this.x1,t.x1),this.y1=Math.min(this.y1,t.y1),this.x2=Math.max(this.x2,t.x2),this.y2=Math.max(this.y2,t.y2),this},e.prototype.wrapPoint=function(t){var i=C(t),o=i?t[0]:t.x,r=i?t[1]:t.y;return this.wrap(new e(o,r,o,r)),this},e.prototype.snapTo=function(t,e){return e!==S&&e||(this.x1=t.x1,this.x2=t.x2),e!==k&&e||(this.y1=t.y1,this.y2=t.y2),this},e.prototype.alignTo=function(t,e){var i=this.height(),o=this.width(),r=e===_||e===u?k:S,n=r===k?i:o;if(e===f){var s=t.center(),a=this.center();this.x1+=s.x-a.x,this.y1+=s.y-a.y}else this[r+1]=e===_||e===g?t[r+1]-n:t[r+2];return this.x2=this.x1+o,this.y2=this.y1+i,this},e.prototype.shrink=function(t,e){return this.x2-=t,this.y2-=e,this},e.prototype.expand=function(t,e){return this.shrink(-t,-e),this},e.prototype.pad=function(t){var e=hr(t);return this.x1-=e.left,this.x2+=e.right,this.y1-=e.top,this.y2+=e.bottom,this},e.prototype.unpad=function(t){var e=hr(t);return e.left=-e.left,e.top=-e.top,e.right=-e.right,e.bottom=-e.bottom,this.pad(e)},e.prototype.clone=function(){return new e(this.x1,this.y1,this.x2,this.y2)},e.prototype.center=function(){return new An(this.x1+this.width()/2,this.y1+this.height()/2)},e.prototype.containsPoint=function(t){return t.x>=this.x1&&t.x<=this.x2&&t.y>=this.y1&&t.y<=this.y2},e.prototype.points=function(){return[new An(this.x1,this.y1),new An(this.x2,this.y1),new An(this.x2,this.y2),new An(this.x1,this.y2)]},e.prototype.getHash=function(){return[this.x1,this.y1,this.x2,this.y2].join(",")},e.prototype.overlaps=function(t){return!(t.y2<this.y1||this.y2<t.y1||t.x2<this.x1||this.x2<t.x1)},e.prototype.rotate=function(t){var e=this.width(),i=this.height(),o=this.center(),r=o.x,n=o.y,s=Sn(0,0,r,n,t),a=Sn(e,0,r,n,t),p=Sn(e,i,r,n,t),h=Sn(0,i,r,n,t);return e=Math.max(s.x,a.x,p.x,h.x)-Math.min(s.x,a.x,p.x,h.x),i=Math.max(s.y,a.y,p.y,h.y)-Math.min(s.y,a.y,p.y,h.y),this.x2=this.x1+e,this.y2=this.y1+i,this},e.prototype.toRect=function(){return new p.Rect([this.x1,this.y1],[this.width(),this.height()])},e.prototype.hasSize=function(){return 0!==this.width()&&0!==this.height()},e.prototype.align=function(t,e,i){var o=e+1,r=e+2,n=e===S?"width":"height",s=this[n]();Lr(i,[g,_])?(this[o]=t[o],this[r]=this[o]+s):Lr(i,[b,u])?(this[r]=t[r],this[o]=this[r]-s):i===f&&(this[o]=t[o]+(t[n]()-s)/2,this[r]=this[o]+s)},e}(O);function Cn(t,e){return t-e}var Pn=function(t){function e(e,i,o,r,n){t.call(this),this.center=e,this.innerRadius=i,this.radius=o,this.startAngle=r,this.angle=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.center,this.innerRadius,this.radius,this.startAngle,this.angle)},e.prototype.middle=function(){return this.startAngle+this.angle/2},e.prototype.setRadius=function(t,e){return e?this.innerRadius=t:this.radius=t,this},e.prototype.point=function(t,e){var i=Qr(t),o=Math.cos(i),r=Math.sin(i),n=e?this.innerRadius:this.radius,s=tn(this.center.x-o*n,3),a=tn(this.center.y-r*n,3);return new An(s,a)},e.prototype.adjacentBox=function(t,e,i){var o=this.clone().expand(t),r=o.middle(),n=o.point(r),s=e/2,a=i/2,p=Math.sin(Qr(r)),h=Math.cos(Qr(r)),c=n.x-s,l=n.y-a;return Math.abs(p)<.9&&(c+=s*-h/Math.abs(h)),Math.abs(h)<.9&&(l+=a*-p/Math.abs(p)),new kn(c,l,c+e,l+i)},e.prototype.containsPoint=function(t){var e=this.center,i=this.innerRadius,o=this.radius,r=this.startAngle,n=this.startAngle+this.angle,s=t.x-e.x,a=t.y-e.y,p=new An(s,a),h=this.point(r),c=new An(h.x-e.x,h.y-e.y),l=this.point(n),u=new An(l.x-e.x,l.y-e.y),f=tn(s*s+a*a,3);return(c.equals(p)||Jo(c,p))&&!Jo(u,p)&&f>=i*i&&f<=o*o},e.prototype.getBBox=function(){var t,e=new kn(m,m,x,x),i=tn(this.startAngle%360),o=tn((i+this.angle)%360),r=this.innerRadius,n=[0,90,180,270,i,o].sort(Cn),s=n.indexOf(i),a=n.indexOf(o);t=i===o?n:s<a?n.slice(s,a+1):[].concat(n.slice(0,a+1),n.slice(s,n.length));for(var p=0;p<t.length;p++){var h=this.point(t[p]);e.wrapPoint(h),e.wrapPoint(h,r)}return r||e.wrapPoint(this.center),e},e.prototype.expand=function(t){return this.radius+=t,this},e}(O),Tn=function(t){function e(e,i,o,r){t.call(this,e,0,i,o,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.expand=function(e){return t.prototype.expand.call(this,e)},e.prototype.clone=function(){return new e(this.center,this.radius,this.startAngle,this.angle)},e.prototype.setRadius=function(t){return this.radius=t,this},e}(Pn),Mn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createRing=function(t,e){var i=t.startAngle+180,o=t.angle+i;t.angle>0&&i===o&&(o+=.001);var r=new p.Point(t.center.x,t.center.y),n=Math.max(t.radius,0),s=Math.max(t.innerRadius,0),h=new p.Arc(r,{startAngle:i,endAngle:o,radiusX:n,radiusY:n}),c=a.Path.fromArc(h,e).close();if(s){h.radiusX=h.radiusY=s;var l=h.pointAt(o);c.lineTo(l.x,l.y),c.arc(o,i,s,s,!0)}else c.lineTo(r.x,r.y);return c},e}(O);Mn.current=new Mn;var On=Mn,Rn=function(t){function e(e){t.call(this),this.children=[],this.options=or({},this.options,this.initUserOptions(e))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initUserOptions=function(t){return t},e.prototype.reflow=function(t){for(var e,i=this.children,o=0;o<i.length;o++){var r=i[o];r.reflow(t),e=e?e.wrap(r.box):r.box.clone()}this.box=e||t},e.prototype.destroy=function(){var t=this.children;this.animation&&this.animation.destroy();for(var e=0;e<t.length;e++)t[e].destroy()},e.prototype.getRoot=function(){var t=this.parent;return t?t.getRoot():null},e.prototype.getSender=function(){var t=this.getService();if(t)return t.sender},e.prototype.getService=function(){for(var t=this;t;){if(t.chartService)return t.chartService;t=t.parent}},e.prototype.translateChildren=function(t,e){for(var i=this.children,o=i.length,r=0;r<o;r++)i[r].box.translate(t,e)},e.prototype.append=function(){for(var t=arguments,e=0;e<arguments.length;e++){var i=t[e];this.children.push(i),i.parent=this}},e.prototype.renderVisual=function(){!1!==this.options.visible&&(this.createVisual(),this.addVisual(),this.renderChildren(),this.createAnimation(),this.renderComplete())},e.prototype.addVisual=function(){this.visual&&(this.visual.chartElement=this,this.parent&&this.parent.appendVisual(this.visual))},e.prototype.renderChildren=function(){for(var t=this.children,e=t.length,i=0;i<e;i++)t[i].renderVisual()},e.prototype.createVisual=function(){this.visual=new a.Group({zIndex:this.options.zIndex,visible:on(this.options.visible,!0)})},e.prototype.createAnimation=function(){this.visual&&this.options.animation&&(this.animation=a.Animation.create(this.visual,this.options.animation))},e.prototype.appendVisual=function(t){t.chartElement||(t.chartElement=this),t.options.noclip?this.clipRoot().visual.append(t):Nr(t.options.zIndex)?this.stackRoot().stackVisual(t):this.isStackRoot?this.stackVisual(t):this.visual?this.visual.append(t):this.parent.appendVisual(t)},e.prototype.clipRoot=function(){return this.parent?this.parent.clipRoot():this},e.prototype.stackRoot=function(){return this.parent?this.parent.stackRoot():this},e.prototype.stackVisual=function(t){var e,i=t.options.zIndex||0,o=this.visual.children,r=o.length;for(e=0;e<r;e++){var n=o[e];if(on(n.options.zIndex,0)>i)break}this.visual.insert(e,t)},e.prototype.traverse=function(t){for(var e=this.children,i=e.length,o=0;o<i;o++){var r=e[o];t(r),r.traverse&&r.traverse(t)}},e.prototype.closest=function(t){for(var e=this,i=!1;e&&!i;)(i=t(e))||(e=e.parent);if(i)return e},e.prototype.renderComplete=function(){},e.prototype.hasHighlight=function(){var t=(this.options||{}).highlight;return!(!this.createHighlight||t&&!1===t.visible)},e.prototype.toggleHighlight=function(t,e){var i=this,o=(this.options||{}).highlight||{},r=o.visual,n=this._highlight;if(!n){var s={fill:{color:A,opacity:e||.2},stroke:{color:A,width:1,opacity:e||.2}};if(r){if(!(n=this._highlight=r(Object.assign(this.highlightVisualArgs(),{createVisual:function(){return i.createHighlight(s)},sender:this.getSender(),series:this.series,dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total}))))return}else n=this._highlight=this.createHighlight(s);Nr(n.options.zIndex)||(n.options.zIndex=on(o.zIndex,this.options.zIndex)),this.appendVisual(n)}n.visible(t)},e.prototype.createGradientOverlay=function(t,e,i){var o=new a.Path(Object.assign({stroke:{color:"none"},fill:this.createGradient(i),closed:t.options.closed},e));return o.segments.elements(t.segments.elements()),o},e.prototype.createGradient=function(t){if(this.parent)return this.parent.createGradient(t)},e.prototype.supportsPointInactiveOpacity=function(){return!0},e}(O);Rn.prototype.options={};var Bn=Rn,jn=function(t){function e(e){t.call(this,e),this.options.margin=hr(this.options.margin),this.options.padding=hr(this.options.padding)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(e){var i,o=this,r=this.options,n=r.width,s=r.height,a=r.shrinkToFit,p=n&&s,h=r.margin,c=r.padding,l=r.border.width,u=function(){o.align(e,S,r.align),o.align(e,k,r.vAlign),o.paddingBox=i.clone().unpad(h).unpad(l)},f=e.clone();p&&(f.x2=f.x1+n,f.y2=f.y1+s),a&&f.unpad(h).unpad(l).unpad(c),t.prototype.reflow.call(this,f),i=p?this.box=new kn(0,0,n,s):this.box,a&&p?(u(),f=this.contentBox=this.paddingBox.clone().unpad(c)):(f=this.contentBox=i.clone(),i.pad(c).pad(l).pad(h),u()),this.translateChildren(i.x1-f.x1+h.left+l+c.left,i.y1-f.y1+h.top+l+c.top);for(var d=this.children,y=0;y<d.length;y++){var v=d[y];v.reflow(v.box)}},e.prototype.align=function(t,e,i){this.box.align(t,e,i)},e.prototype.hasBox=function(){var t=this.options;return t.border.width||t.background},e.prototype.createVisual=function(){t.prototype.createVisual.call(this),this.options.visible&&this.hasBox()&&this.visual.append(a.Path.fromRect(this.paddingBox.toRect(),this.visualStyle()))},e.prototype.visualStyle=function(){var t=this.options,e=t.border||{};return{stroke:{width:e.width,color:e.color,opacity:on(e.opacity,t.opacity),dashType:e.dashType},fill:{color:t.background,opacity:t.opacity},cursor:t.cursor}},e}(Bn);sn(jn,{align:g,vAlign:_,margin:{},padding:{},border:{color:l,width:0},background:"",shrinkToFit:!1,width:0,height:0,visible:!0});var In=jn,Ln=function(t){function e(e,i){t.call(this,e),this.pointData=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getElement=function(){var t=this.options,e=this.paddingBox,i=t.type,o=t.rotation,r=e.center(),n=e.width()/2,s=e.height()/2;if(!t.visible||!this.hasBox())return null;var h,c=this.visualStyle();if(i===d)h=new a.Circle(new p.Circle([tn(e.x1+n,3),tn(e.y1+s,3)],Math.min(n,s)),c);else if("triangle"===i)h=a.Path.fromPoints([[e.x1+n,e.y1],[e.x1,e.y2],[e.x2,e.y2]],c).close();else if("cross"===i)(h=new a.MultiPath(c)).moveTo(e.x1,e.y1).lineTo(e.x2,e.y2),h.moveTo(e.x1,e.y2).lineTo(e.x2,e.y1);else{var l=e.toRect();if("roundedRect"===i){var u=on(t.borderRadius,l.width()/5);l.setCornerRadius(u)}h=a.Path.fromRect(l,c)}return o&&h.transform(p.transform().rotate(-o,[r.x,r.y])),h.options.zIndex=t.zIndex,h},e.prototype.createElement=function(){var t=this,e=this.options.visual,i=this.pointData||{};return e?e({value:i.value,dataItem:i.dataItem,sender:this.getSender(),series:i.series,category:i.category,rect:this.paddingBox.toRect(),options:this.visualOptions(),createVisual:function(){return t.getElement()}}):this.getElement()},e.prototype.visualOptions=function(){var t=this.options;return{background:t.background,border:t.border,margin:t.margin,padding:t.padding,type:t.type,size:t.width,visible:t.visible}},e.prototype.createVisual=function(){this.visual=this.createElement()},e}(In);sn(Ln,{type:d,align:f,vAlign:f});var zn=Ln,En={glass:{type:"linear",rotation:0,stops:[{offset:0,color:A,opacity:0},{offset:.25,color:A,opacity:.3},{offset:1,color:A,opacity:0}]},sharpBevel:{type:"radial",stops:[{offset:0,color:A,opacity:.55},{offset:.65,color:A,opacity:0},{offset:.95,color:A,opacity:.25}]},roundedBevel:{type:"radial",stops:[{offset:.33,color:A,opacity:.06},{offset:.83,color:A,opacity:.2},{offset:.95,color:A,opacity:0}]},roundedGlass:{type:"radial",supportVML:!1,stops:[{offset:0,color:A,opacity:0},{offset:.5,color:A,opacity:.3},{offset:.99,color:A,opacity:0}]},sharpGlass:{type:"radial",supportVML:!1,stops:[{offset:0,color:A,opacity:.2},{offset:.15,color:A,opacity:.15},{offset:.17,color:A,opacity:.35},{offset:.85,color:A,opacity:.05},{offset:.87,color:A,opacity:.15},{offset:.99,color:A,opacity:0}]},bubbleShadow:{type:"radial",center:[.5,.5],radius:.5}};function Vn(t,e){if(t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2)return e;var i=Math.min(t.x1,e.x1),o=Math.max(t.x1,e.x1),r=Math.min(t.x2,e.x2),n=Math.max(t.x2,e.x2),s=Math.min(t.y1,e.y1),a=Math.max(t.y1,e.y1),p=Math.min(t.y2,e.y2),h=Math.max(t.y2,e.y2),c=[];return c[0]=new kn(o,s,r,a),c[1]=new kn(i,a,o,p),c[2]=new kn(r,a,n,p),c[3]=new kn(o,p,r,h),t.x1===i&&t.y1===s||e.x1===i&&e.y1===s?(c[4]=new kn(i,s,o,a),c[5]=new kn(r,p,n,h)):(c[4]=new kn(r,s,n,a),c[5]=new kn(i,p,o,h)),Rr(c,(function(t){return t.height()>0&&t.width()>0}))[0]}var Fn=function(t){function e(e){t.call(this,e);var i=this.options;i.width=parseInt(i.width,10),i.height=parseInt(i.height,10),this.gradients={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(){var t=this.options,e=this.children,i=new kn(0,0,t.width,t.height);this.box=i.unpad(t.margin);for(var o=0;o<e.length;o++)e[o].reflow(i),i=Vn(i,e[o].box)||new kn},e.prototype.createVisual=function(){this.visual=new a.Group,this.createBackground()},e.prototype.createBackground=function(){var t=this.options,e=t.border||{},i=this.box.clone().pad(t.margin).unpad(e.width),o=a.Path.fromRect(i.toRect(),{stroke:{color:e.width?e.color:"",width:e.width,dashType:e.dashType},fill:{color:t.background,opacity:t.opacity},zIndex:-10});this.visual.append(o)},e.prototype.getRoot=function(){return this},e.prototype.createGradient=function(t){var e,i=this.gradients,o=$r(t),r=En[t.gradient];if(i[o])e=i[o];else{var n=Object.assign({},r,t);"linear"===r.type?e=new a.LinearGradient(n):(t.innerRadius&&(n.stops=function(t){for(var e=t.stops,i=t.innerRadius/t.radius*100,o=e.length,r=[],n=0;n<o;n++){var s=Object.assign({},e[n]);s.offset=(s.offset*(100-i)+i)/100,r.push(s)}return r}(n)),(e=new a.RadialGradient(n)).supportVML=!1!==r.supportVML),i[o]=e}return e},e.prototype.cleanGradients=function(){var t=this.gradients;for(var e in t)t[e]._observers=[]},e.prototype.size=function(){var t=this.options;return new kn(0,0,t.width,t.height)},e}(Bn);sn(Fn,{width:600,height:400,background:A,border:{color:l,width:0},margin:hr(5),zIndex:-2});var Dn=Fn,Un=function(t){function e(e){t.call(this,e),this._initDirection()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initDirection=function(){var t=this.options;t.vertical?(this.groupAxis=S,this.elementAxis=k,this.groupSizeField="width",this.elementSizeField="height",this.groupSpacing=t.spacing,this.elementSpacing=t.vSpacing):(this.groupAxis=k,this.elementAxis=S,this.groupSizeField="height",this.elementSizeField="width",this.groupSpacing=t.vSpacing,this.elementSpacing=t.spacing)},e.prototype.reflow=function(t){this.box=t.clone(),this.reflowChildren()},e.prototype.reflowChildren=function(){var t=this.box,e=this.elementAxis,i=this.groupAxis,o=this.elementSizeField,r=this.groupSizeField,n=this.groupOptions(),s=n.groups,a=n.groupsSize,p=n.maxGroupElementsSize,h=s.length,c=t[i+1]+this.alignStart(a,t[r]());if(h){for(var l=c,u=0;u<h;u++){for(var f=s[u],d=f.groupElements,y=t[e+1],v=d.length,g=0;g<v;g++){var m=d[g],x=this.elementSize(m),b=l+this.alignStart(x[r],f.groupSize),_=new kn;_[i+1]=b,_[i+2]=b+x[r],_[e+1]=y,_[e+2]=y+x[o],m.reflow(_),y+=x[o]+this.elementSpacing}l+=f.groupSize+this.groupSpacing}t[i+1]=c,t[i+2]=c+a,t[e+2]=t[e+1]+p}},e.prototype.alignStart=function(t,e){var i=0,o=this.options.align;return o===b||o===u?i=e-t:o===f&&(i=(e-t)/2),i},e.prototype.groupOptions=function(){for(var t=this.box,e=this.children,i=this.elementSizeField,o=this.groupSizeField,r=this.elementSpacing,n=this.groupSpacing,s=tn(t[i]()),a=e.length,p=[],h=0,c=0,l=0,u=0,f=[],d=0;d<a;d++){var y=e[d];y.box||y.reflow(t);var v=this.elementSize(y);this.options.wrap&&tn(c+r+v[i])>s&&(p.push({groupElements:f,groupSize:h,groupElementsSize:c}),u=Math.max(u,c),l+=n+h,h=0,c=0,f=[]),h=Math.max(h,v[o]),c>0&&(c+=r),c+=v[i],f.push(y)}return p.push({groupElements:f,groupSize:h,groupElementsSize:c}),{groups:p,groupsSize:l+=h,maxGroupElementsSize:u=Math.max(u,c)}},e.prototype.elementSize=function(t){return{width:t.box.width(),height:t.box.height()}},e.prototype.createVisual=function(){},e}(Bn);sn(Un,{vertical:!0,wrap:!0,vSpacing:0,spacing:0});var Hn=Un,Gn=a.Text,Nn=function(t){function e(e,i){t.call(this,i),this.content=e,this.reflow(new kn)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.options,i=e.size=a.util.measureText(this.content,{font:e.font});this.baseline=i.baseline,this.box=new kn(t.x1,t.y1,t.x1+i.width,t.y1+i.height)},e.prototype.createVisual=function(){var t=this.options,e=t.font,i=t.color,o=t.opacity,r=t.cursor;this.visual=new Gn(this.content,this.box.toRect().topLeft(),{font:e,fill:{color:i,opacity:o},cursor:r})},e}(Bn);sn(Nn,{font:"12px sans-serif",color:l});var Wn=Nn;function qn(t){var e=t.origin,i=t.bottomRight();return new kn(e.x,e.y,i.x,i.y)}var Xn=/\n/m,Yn=function(t){function e(e,i,o){t.call(this,i),this.content=e,this.data=o,this._initContainer(),!1!==this.options._autoReflow&&this.reflow(new kn)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initContainer=function(){var t=this.options,e=String(this.content).split(Xn),i=new Hn({vertical:!0,align:t.align,wrap:!1}),o=or({},t,{opacity:1,animation:null});this.container=i,this.append(i);for(var r=0;r<e.length;r++){var n=new Wn(e[r].trim(),o);i.append(n)}},e.prototype.reflow=function(e){var i=this.options,o=i.visual;if(this.container.options.align=i.align,o&&!this._boxReflow){var r=e;r.hasSize()||(this._boxReflow=!0,this.reflow(r),this._boxReflow=!1,r=this.box);var n=this.visual=o(this.visualContext(r));n&&(r=qn(n.clippedBBox()||new p.Rect),n.options.zIndex=i.zIndex),this.box=this.contentBox=this.paddingBox=r}else if(t.prototype.reflow.call(this,e),i.rotation){var s=hr(i.margin),a=this.box.unpad(s);this.targetBox=e,this.normalBox=a.clone(),(a=this.rotate()).translate(s.left-s.right,s.top-s.bottom),this.rotatedBox=a.clone(),a.pad(s)}},e.prototype.createVisual=function(){var t=this.options;if(this.visual=new a.Group({transform:this.rotationTransform(),zIndex:t.zIndex,noclip:t.noclip}),this.hasBox()){var e=a.Path.fromRect(this.paddingBox.toRect(),this.visualStyle());this.visual.append(e)}},e.prototype.renderVisual=function(){if(this.options.visible)if(this.options.visual){var e=this.visual;e&&!Nr(e.options.noclip)&&(e.options.noclip=this.options.noclip),this.addVisual(),this.createAnimation()}else t.prototype.renderVisual.call(this)},e.prototype.visualContext=function(t){var e=this,i={text:this.content,rect:t.toRect(),sender:this.getSender(),options:this.options,createVisual:function(){return e._boxReflow=!0,e.reflow(t),e._boxReflow=!1,e.getDefaultVisual()}};return this.data&&Object.assign(i,this.data),i},e.prototype.getDefaultVisual=function(){this.createVisual(),this.renderChildren();var t=this.visual;return delete this.visual,t},e.prototype.rotate=function(){var t=this.options;return this.box.rotate(t.rotation),this.align(this.targetBox,S,t.align),this.align(this.targetBox,k,t.vAlign),this.box},e.prototype.rotationTransform=function(){var t=this.options.rotation;if(!t)return null;var e=this.normalBox.center(),i=e.x,o=e.y,r=this.rotatedBox.center();return p.transform().translate(r.x-i,r.y-o).rotate(t,[i,o])},e}(In),Zn=function(t){function e(e){t.call(this,e),this.append(new Yn(this.options.text,Object.assign({},this.options,{vAlign:this.options.position})))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(e){t.prototype.reflow.call(this,e),this.box.snapTo(e,S)},e.buildTitle=function(t,i,o){var r,n=t;return"string"==typeof t&&(n={text:t}),(n=Object.assign({visible:!0},o,n))&&n.visible&&n.text&&(r=new e(n),i.append(r)),r},e}(Bn);sn(Zn,{color:l,position:_,align:f,margin:hr(5),padding:hr(5)});var Kn=Zn,Jn=function(t){function e(e,i,o,r,n){t.call(this,i,n),this.text=i,this.value=e,this.index=o,this.dataItem=r,this.reflow(new kn)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.visualContext=function(e){var i=t.prototype.visualContext.call(this,e);return i.value=this.value,i.dataItem=this.dataItem,i.format=this.options.format,i.culture=this.options.culture,i},e.prototype.click=function(t,e){t.trigger("axisLabelClick",{element:Yr(e),value:this.value,text:this.text,index:this.index,dataItem:this.dataItem,axis:this.parent.options})},e.prototype.rotate=function(){if(this.options.alignRotation!==f){var e=this.normalBox.toRect(),i=this.rotationTransform();this.box=qn(e.bbox(i.matrix()))}else t.prototype.rotate.call(this);return this.box},e.prototype.rotationTransform=function(){var e=this.options,i=e.rotation;if(!i)return null;if(e.alignRotation===f)return t.prototype.rotationTransform.call(this);var o=p.transform().rotate(i).matrix(),r=this.normalBox.toRect(),n=this.targetBox.toRect(),s=e.rotationOrigin||_,a=s===_||s===u?S:k,h=s===_||s===u?k:S,c=s===_||s===g?n.origin:n.bottomRight(),l=r.topLeft().transformCopy(o),d=r.topRight().transformCopy(o),y=r.bottomRight().transformCopy(o),v=r.bottomLeft().transformCopy(o),m=p.Rect.fromPoints(l,d,y,v),x={};x[h]=n.origin[h]-m.origin[h];var b,w,A=Math.abs(l[h]+x[h]-c[h]),C=Math.abs(d[h]+x[h]-c[h]);tn(A,10)===tn(C,10)?(b=l,w=d):C<A?(b=d,w=y):(b=l,w=v);var P=b[a]+(w[a]-b[a])/2;return x[a]=n.center()[a]-P,p.transform().translate(x.x,x.y).rotate(i)},e}(Yn);sn(Jn,{_autoReflow:!1});var $n=Jn,Qn=function(t){function e(e,i,o){t.call(this,i),this.fields=e,this.chartService=o,this.render()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hide=function(){this.options.visible=!1},e.prototype.show=function(){this.options.visible=!0},e.prototype.render=function(){var t=this,e=this.options;if(e.visible){var i,o,r=e.label,n=e.icon,s=new kn,a=function(){return t},p=n.size,h=this.fields.text;if(Nr(r)&&r.visible){var c=Pr(r);c?h=c(this.fields):r.format&&(h=this.chartService.format.auto(r.format,h)),r.color||(r.color="inside"===r.position?"#fff":n.background),this.label=new Yn(h,or({},r)),this.label.aliasFor=a,"inside"!==r.position||Nr(p)||(n.type===d?p=Math.max(this.label.box.width(),this.label.box.height()):(i=this.label.box.width(),o=this.label.box.height()),s.wrap(this.label.box))}n.width=i||p||7,n.height=o||p||7;var l=new zn(or({},n));l.aliasFor=a,this.marker=l,this.append(l),this.label&&this.append(this.label),l.reflow(new kn),this.wrapperBox=s.wrap(l.box)}},e.prototype.reflow=function(t){var e,i,o,r=this.options,n=this.label,s=this.marker,a=this.wrapperBox,p=t.center(),h=r.line.length,c=r.position;r.visible&&(Lr(c,[g,b])?c===g?(o=a.alignTo(t,c).translate(-h,t.center().y-a.center().y),r.line.visible&&(e=[t.x1,p.y],this.linePoints=[e,[o.x2,p.y]],i=o.clone().wrapPoint(e))):(o=a.alignTo(t,c).translate(h,t.center().y-a.center().y),r.line.visible&&(e=[t.x2,p.y],this.linePoints=[e,[o.x1,p.y]],i=o.clone().wrapPoint(e))):c===u?(o=a.alignTo(t,c).translate(t.center().x-a.center().x,h),r.line.visible&&(e=[p.x,t.y2],this.linePoints=[e,[p.x,o.y1]],i=o.clone().wrapPoint(e))):(o=a.alignTo(t,c).translate(t.center().x-a.center().x,-h),r.line.visible&&(e=[p.x,t.y1],this.linePoints=[e,[p.x,o.y2]],i=o.clone().wrapPoint(e))),s&&s.reflow(o),n&&(n.reflow(o),s&&("outside"===r.label.position&&n.box.alignTo(s.box,c),n.reflow(n.box))),this.contentBox=o,this.targetBox=t,this.box=i||o)},e.prototype.createVisual=function(){t.prototype.createVisual.call(this),this.visual.options.noclip=this.options.noclip,this.options.visible&&this.createLine()},e.prototype.renderVisual=function(){var e=this,i=this.options,o=i.visual;i.visible&&o?(this.visual=o(Object.assign(this.fields,{sender:this.getSender(),rect:this.targetBox.toRect(),options:{background:i.background,border:i.background,icon:i.icon,label:i.label,line:i.line,position:i.position,visible:i.visible},createVisual:function(){e.createVisual(),e.renderChildren();var t=e.visual;return delete e.visual,t}})),this.addVisual()):t.prototype.renderVisual.call(this)},e.prototype.createLine=function(){var t=this.options.line;if(this.linePoints){var e=a.Path.fromPoints(this.linePoints,{stroke:{color:t.color,width:t.width,dashType:t.dashType}});Ko(e),this.visual.append(e)}},e.prototype.click=function(t,e){var i=this.eventArgs(e);t.trigger("noteClick",i)||e.preventDefault()},e.prototype.over=function(t,e){var i=this.eventArgs(e);t.trigger("noteHover",i)||e.preventDefault()},e.prototype.out=function(t,e){var i=this.eventArgs(e);t.trigger("noteLeave",i)},e.prototype.eventArgs=function(t){var e=this.options;return Object.assign(this.fields,{element:Yr(t),text:Nr(e.label)?e.label.text:"",visual:this.visual})},e}(In);sn(Qn,{icon:{visible:!0,type:d},label:{position:"inside",visible:!0,align:f,vAlign:f},line:{visible:!0},visible:!0,position:_,zIndex:2});var ts=Qn;function es(t,e){var i=t.tickX,o=t.tickY,r=t.position,n=new a.Path({stroke:{width:e.width,color:e.color}});return t.vertical?n.moveTo(i,r).lineTo(i+e.size,r):n.moveTo(r,o).lineTo(r,o+e.size),Ko(n),n}function is(t,e){var i=t.lineStart,o=t.lineEnd,r=t.position,n=new a.Path({stroke:{width:e.width,color:e.color,dashType:e.dashType}});return t.vertical?n.moveTo(i,r).lineTo(o,r):n.moveTo(r,i).lineTo(r,o),Ko(n),n}var os=function(t){function e(e,i){void 0===i&&(i=new _r),t.call(this,e),this.chartService=i,this.options.visible||(this.options=or({},this.options,{labels:{visible:!1},line:{visible:!1},margin:0,majorTickSize:0,minorTickSize:0})),this.options.minorTicks=or({},{color:this.options.line.color,width:this.options.line.width,visible:"none"!==this.options.minorTickType},this.options.minorTicks,{size:this.options.minorTickSize,align:this.options.minorTickType}),this.options.majorTicks=or({},{color:this.options.line.color,width:this.options.line.width,visible:"none"!==this.options.majorTickType},this.options.majorTicks,{size:this.options.majorTickSize,align:this.options.majorTickType}),this.initFields(),this.options._deferLabels||this.createLabels(),this.createTitle(),this.createNotes()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(){},e.prototype.labelsRange=function(){return{min:this.options.labels.skip,max:this.labelsCount()}},e.prototype.normalizeLabelRotation=function(t){var e=t.rotation;rr(e)&&(t.alignRotation=e.align,t.rotation=e.angle)},e.prototype.createLabels=function(){var t=this.options,e=t.vertical?b:f,i=or({},t.labels,{align:e,zIndex:t.zIndex}),o=Math.max(1,i.step);if(this.clearLabels(),i.visible){this.normalizeLabelRotation(i),"auto"===i.rotation&&(i.rotation=0,t.autoRotateLabels=!0);for(var r=this.labelsRange(),n=r.min;n<r.max;n+=o){var s={index:n,count:r.max},a=this.createAxisLabel(n,i,s);a&&(this.append(a),this.labels.push(a))}}},e.prototype.clearLabels=function(){this.children=Rr(this.children,(function(t){return!(t instanceof $n)})),this.labels=[]},e.prototype.clearTitle=function(){var t=this;this.title&&(this.children=Rr(this.children,(function(e){return e!==t.title})),this.title=void 0)},e.prototype.clear=function(){this.clearLabels(),this.clearTitle()},e.prototype.lineBox=function(){var t=this.options,e=this.box,i=t.vertical,o=t.labels.mirror,r=o?e.x1:e.x2,n=o?e.y2:e.y1,s=t.line.width||0;return i?new kn(r,e.y1,r,e.y2-s):new kn(e.x1,n,e.x2-s,n)},e.prototype.createTitle=function(){var t=this.options,e=or({rotation:t.vertical?-90:0,text:"",zIndex:1,visualSize:!0},t.title);if(e.visible&&e.text){var i=new Yn(e.text,e);this.append(i),this.title=i}},e.prototype.createNotes=function(){var t=this.options,e=t.notes,i=e.data||[];this.notes=[];for(var o=0;o<i.length;o++){var r=or({},e,i[o]);r.value=this.parseNoteValue(r.value);var n=new ts({value:r.value,text:r.label.text,dataItem:r},r,this.chartService);n.options.visible&&(Nr(n.options.position)?t.vertical&&!Lr(n.options.position,[g,b])?n.options.position=t.reverse?g:b:t.vertical||Lr(n.options.position,[_,u])||(n.options.position=t.reverse?u:_):t.vertical?n.options.position=t.reverse?g:b:n.options.position=t.reverse?u:_,this.append(n),this.notes.push(n))}},e.prototype.parseNoteValue=function(t){return t},e.prototype.renderVisual=function(){t.prototype.renderVisual.call(this),this.createPlotBands()},e.prototype.createVisual=function(){t.prototype.createVisual.call(this),this.createBackground(),this.createLine()},e.prototype.gridLinesVisual=function(){var t=this._gridLines;return t||(t=this._gridLines=new a.Group({zIndex:-2}),this.appendVisual(this._gridLines)),t},e.prototype.createTicks=function(t){var e=this.options,i=this.lineBox(),o=e.labels.mirror,r=e.majorTicks.visible?e.majorUnit:0,n={vertical:e.vertical};function s(e,r,s){var a=e.length,p=Math.max(1,r.step);if(r.visible)for(var h=r.skip;h<a;h+=p)Nr(s)&&h%s==0||(n.tickX=o?i.x2:i.x2-r.size,n.tickY=o?i.y1-r.size:i.y1,n.position=e[h],t.append(es(n,r)))}s(this.getMajorTickPositions(),e.majorTicks),s(this.getMinorTickPositions(),e.minorTicks,r/e.minorUnit)},e.prototype.createLine=function(){var t=this.options,e=t.line,i=this.lineBox();if(e.width>0&&e.visible){var o=new a.Path({stroke:{width:e.width,color:e.color,dashType:e.dashType}});o.moveTo(i.x1,i.y1).lineTo(i.x2,i.y2),t._alignLines&&Ko(o);var r=this._lineGroup=new a.Group;r.append(o),this.visual.append(r),this.createTicks(r)}},e.prototype.getActualTickSize=function(){var t=this.options,e=0;return t.majorTicks.visible&&t.minorTicks.visible?e=Math.max(t.majorTicks.size,t.minorTicks.size):t.majorTicks.visible?e=t.majorTicks.size:t.minorTicks.visible&&(e=t.minorTicks.size),e},e.prototype.createBackground=function(){var t=this.options,e=this.box,i=t.background;i&&(this._backgroundPath=a.Path.fromRect(e.toRect(),{fill:{color:i},stroke:null}),this.visual.append(this._backgroundPath))},e.prototype.createPlotBands=function(){var t=this,e=this.options,i=e.plotBands||[],o=e.vertical,r=this.plotArea;if(0!==i.length){for(var n=this._plotbandGroup=new a.Group({zIndex:-1}),s=Rr(this.pane.axes,(function(e){return e.options.vertical!==t.options.vertical}))[0],h=0;h<i.length;h++){var c=i[h],l=void 0,u=void 0,f=c.label,d=void 0;if(o?(l=(s||r.axisX).lineBox(),u=this.getSlot(c.from,c.to,!0)):(l=this.getSlot(c.from,c.to,!0),u=(s||r.axisY).lineBox()),f&&(f.vAlign=f.position||g,d=this.createPlotBandLabel(f,c,new kn(l.x1,u.y1,l.x2,u.y2))),0!==l.width()&&0!==u.height()){var y=new p.Rect([l.x1,u.y1],[l.width(),u.height()]),v=a.Path.fromRect(y,{fill:{color:c.color,opacity:c.opacity},stroke:null});n.append(v),d&&n.append(d)}}this.appendVisual(n)}},e.prototype.createPlotBandLabel=function(t,e,i){if(!1===t.visible)return null;var o,r=t.text;if(Nr(t)&&t.visible){var n=Pr(t);n?r=n({text:r,item:e}):t.format&&(r=this.chartService.format.auto(t.format,r)),t.color||(t.color=this.options.labels.color)}return(o=new Yn(r,t)).reflow(i),o.renderVisual(),o.visual},e.prototype.createGridLines=function(t){var e=this.options,i=e.minorGridLines,o=e.majorGridLines,r=e.minorUnit,n=e.vertical,s=t.options.line.visible,a=o.visible?e.majorUnit:0,p=t.lineBox(),h=p[n?"y1":"x1"],c={lineStart:p[n?"x1":"y1"],lineEnd:p[n?"x2":"y2"],vertical:n},l=[],u=this.gridLinesVisual();function f(t,e,i){var o=t.length,r=Math.max(1,e.step);if(e.visible)for(var n=e.skip;n<o;n+=r){var a=tn(t[n]);Lr(a,l)||n%i==0||s&&h===a||(c.position=a,u.append(is(c,e)),l.push(a))}}return f(this.getMajorTickPositions(),o),f(this.getMinorTickPositions(),i,a/r),u.children},e.prototype.reflow=function(t){for(var e=this.options,i=this.labels,o=this.title,r=e.vertical,n=i.length,s=r?"width":"height",a=o?o.box[s]():0,p=this.getActualTickSize()+e.margin+a,h=((this.getRoot()||{}).box||t)[s](),c=0,l=0;l<n;l++){var u=i[l].box[s]();u+p<=h&&(c=Math.max(c,u))}this.box=r?new kn(t.x1,t.y1,t.x1+c+p,t.y2):new kn(t.x1,t.y1,t.x2,t.y1+c+p),this.arrangeTitle(),this.arrangeLabels(),this.arrangeNotes()},e.prototype.getLabelsTickPositions=function(){return this.getMajorTickPositions()},e.prototype.labelTickIndex=function(t){return t.index},e.prototype.arrangeLabels=function(){for(var t=this.options,e=this.labels,i=this.labelsBetweenTicks(),o=t.vertical,r=t.labels.mirror,n=this.getLabelsTickPositions(),s=0;s<e.length;s++){var a=e[s],p=this.labelTickIndex(a),h=o?a.box.height():a.box.width(),c=n[p],l=n[p+1],u=void 0,f=void 0;if(o){if(i)u=c+(l-c)/2-h/2;else u=c-h/2;f=u}else i?(u=c,f=l):f=(u=c-h/2)+h;this.positionLabel(a,r,u,f)}},e.prototype.positionLabel=function(t,e,i,o){void 0===o&&(o=i);var r,n=this.options,s=n.vertical,a=this.lineBox(),p=this.getActualTickSize()+n.margin;if(s){var h=a.x2;e?(h+=p,t.options.rotationOrigin=g):(h-=p+t.box.width(),t.options.rotationOrigin=b),r=t.box.move(h,i)}else{var c=a.y1;e?(c-=p+t.box.height(),t.options.rotationOrigin=u):(c+=p,t.options.rotationOrigin=_),r=new kn(i,c,o,c+t.box.height())}t.reflow(r)},e.prototype.autoRotateLabelAngle=function(t,e){return t.width()<e?0:t.height()>e?-90:-45},e.prototype.autoRotateLabels=function(){if(!this.options.autoRotateLabels||this.options.vertical)return!1;for(var t=this.getMajorTickPositions(),e=this.labels,i=Math.min(e.length,t.length-1),o=0,r=0;r<i;r++){var n=Math.abs(t[r+1]-t[r]),s=e[r].box,a=this.autoRotateLabelAngle(s,n);if(0!==a&&(o=a),-90===o)break}if(0!==o){for(var p=0;p<e.length;p++)e[p].options.rotation=o,e[p].reflow(new kn);return!0}},e.prototype.arrangeTitle=function(){var t=this.options,e=this.title,i=t.labels.mirror,o=t.vertical;e&&(o?(e.options.align=i?b:g,e.options.vAlign=e.options.position):(e.options.align=e.options.position,e.options.vAlign=i?_:u),e.reflow(this.box))},e.prototype.arrangeNotes=function(){for(var t=0;t<this.notes.length;t++){var e=this.notes[t],i=e.options.value,o=void 0;Nr(i)?(this.shouldRenderNote(i)?e.show():e.hide(),o=this.noteSlot(i)):e.hide(),e.reflow(o||this.lineBox())}},e.prototype.noteSlot=function(t){return this.getSlot(t)},e.prototype.alignTo=function(t){var e=t.lineBox(),i=this.options.vertical,o=i?k:S;this.box.snapTo(e,o),i?this.box.shrink(0,this.lineBox().height()-e.height()):this.box.shrink(this.lineBox().width()-e.width(),0),this.box[o+1]-=this.lineBox()[o+1]-e[o+1],this.box[o+2]-=this.lineBox()[o+2]-e[o+2]},e.prototype.axisLabelText=function(t,e,i){var o,r=this,n=Pr(e),s=function(){return e.format?r.chartService.format.localeAuto(e.format,[t],e.culture):t};n?o=n(Object.assign({},i,{get text(){return s()},value:t,format:e.format,culture:e.culture})):o=s();return o},e.prototype.slot=function(t,e,i){var o=this.getSlot(t,e,i);if(o)return o.toRect()},e.prototype.contentBox=function(){var t=this.box.clone(),e=this.labels;if(e.length){var i=this.options.vertical?k:S;if(this.chartService.isPannable(i)){var o=this.maxLabelOffset();t[i+1]-=o.start,t[i+2]+=o.end}else{e[0].options.visible&&t.wrap(e[0].box);var r=e[e.length-1];r.options.visible&&t.wrap(r.box)}}return t},e.prototype.maxLabelOffset=function(){for(var t=this.options,e=t.vertical,i=t.reverse,o=this.labelsBetweenTicks(),r=this.getLabelsTickPositions(),n=e?k:S,s=this.labels,a=i?1:0,p=i?0:1,h=0,c=0,l=0;l<s.length;l++){var u=s[l],f=this.labelTickIndex(u),d=void 0,y=void 0;o?(d=r[f+a],y=r[f+p]):d=y=r[f],h=Math.max(h,d-u.box[n+1]),c=Math.max(c,u.box[n+2]-y)}return{start:h,end:c}},e.prototype.limitRange=function(t,e,i,o,r){var n=this.options;if(t<i&&r<0&&(!Nr(n.min)||n.min<=i)||o<e&&r>0&&(!Nr(n.max)||o<=n.max))return null;if(e<i&&r>0||o<t&&r<0)return{min:t,max:e};var s=e-t,a=t,p=e;return t<i&&r<0?(a=Jr(t,i,o),p=Jr(t+s,i+s,o)):e>o&&r>0&&(p=Jr(e,i,o),a=Jr(e-s,i,o-s)),{min:a,max:p}},e.prototype.valueRange=function(){return{min:this.seriesMin,max:this.seriesMax}},e.prototype.labelsBetweenTicks=function(){return!this.options.justified},e.prototype.prepareUserOptions=function(){},e}(Bn);sn(os,{labels:{visible:!0,rotation:0,mirror:!1,step:1,skip:0},line:{width:1,color:l,visible:!0},title:{visible:!0,position:f},majorTicks:{align:"outside",size:4,skip:0,step:1},minorTicks:{align:"outside",size:3,skip:0,step:1},axisCrossingValue:0,majorTickType:"outside",minorTickType:"none",majorGridLines:{skip:0,step:1},minorGridLines:{visible:!1,width:1,color:l,skip:0,step:1},margin:5,visible:!0,reverse:!1,justified:!0,notes:{label:{text:""}},_alignLines:!0,_deferLabels:!1});var rs=os,ns="days",ss="years",as={years:31536e6,months:26784e5,weeks:6048e5,days:864e5,hours:36e5,minutes:6e4,seconds:1e3,milliseconds:1};function ps(t,e){return t.getTime()-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset())}function hs(t,e){return new Date(t.getTime()+e)}function cs(t){var e;return t instanceof Date?e=t:t&&(e=new Date(t)),e}function ls(t,e){return 0===e&&23===t.getHours()&&(t.setHours(t.getHours()+2),!0)}function us(t,e,i,o){var r=t;if(t){var n=cs(t),s=n.getHours();i===ss?ls(r=new Date(n.getFullYear()+e,0,1),0):"months"===i?ls(r=new Date(n.getFullYear(),n.getMonth()+e,1),s):"weeks"===i?ls(r=us(function(t,e){void 0===e&&(e=0);var i=0,o=t.getDay();if(!isNaN(o))for(;o!==e;)0===o?o=6:o--,i++;return hs(t,864e5*-i)}(n,o),7*e,ns),s):i===ns?ls(r=new Date(n.getFullYear(),n.getMonth(),n.getDate()+e),s):"hours"===i?r=function(t,e){var i=new Date(t);i.setMinutes(0,0,0);var o=6e4*(t.getTimezoneOffset()-i.getTimezoneOffset());return hs(i,o+36e5*e)}(n,e):"minutes"===i?(r=hs(n,6e4*e)).getSeconds()>0&&r.setSeconds(0):"seconds"===i?r=hs(n,1e3*e):"milliseconds"===i&&(r=hs(n,e)),"milliseconds"!==i&&r.getMilliseconds()>0&&r.setMilliseconds(0)}return r}function fs(t,e,i){return us(cs(t),0,e,i)}function ds(t,e,i){var o=cs(t);return o&&fs(o,e,i).getTime()===o.getTime()?o:us(o,1,e,i)}function ys(t,e){return t&&e?t.getTime()-e.getTime():-1}function vs(t,e){return t.getTime()-e}function gs(t){if(C(t)){for(var e=[],i=0;i<t.length;i++)e.push(gs(t[i]));return e}if(t)return cs(t).getTime()}function ms(t,e){return t&&e?gs(t)===gs(e):t===e}function xs(t,e,i){return ps(t,e)/as[i]}function bs(t,e,i,o){var r=cs(t),n=cs(e);return("months"===i?r.getMonth()-n.getMonth()+12*(r.getFullYear()-n.getFullYear())+xs(r,new Date(r.getFullYear(),r.getMonth()),ns)/new Date(r.getFullYear(),r.getMonth()+1,0).getDate():i===ss?r.getFullYear()-n.getFullYear()+bs(r,new Date(r.getFullYear(),0),"months",1)/12:i===ns||"weeks"===i?xs(r,n,i):vs(r,e)/as[i])/o}function _s(t,e,i){return i===ss?e.getFullYear()-t.getFullYear():"months"===i?12*_s(t,e,ss)+e.getMonth()-t.getMonth():i===ns?Math.floor(vs(e,t)/864e5):Math.floor(vs(e,t)/as[i])}function ws(t,e){return Qo(e)&&t.parseDate(e)||cs(e)}function As(t,e){if(C(e)){for(var i=[],o=0;o<e.length;o++)i.push(ws(t,e[o]));return i}return ws(t,e)}function Ss(t,e){return $o(t.weekStartDay)?t.weekStartDay:e&&e.firstDay?e.firstDay():0}var ks=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(){this._ticks={}},e.prototype.categoriesHash=function(){return""},e.prototype.clone=function(){var t=new e(Object.assign({},this.options,{categories:this.options.srcCategories}),this.chartService);return t.createLabels(),t},e.prototype.initUserOptions=function(t){var e=t.categories||[],i=Nr(t.min),o=Nr(t.max);if(t.srcCategories=t.categories=e,(i||o)&&e.length){var r,n=i?Math.floor(t.min):0;r=o?t.justified?Math.floor(t.max)+1:Math.ceil(t.max):e.length,t.categories=t.categories.slice(n,r)}return t},e.prototype.rangeIndices=function(){var t=this.options,e=t.categories.length||1;return{min:$o(t.min)?t.min%1:0,max:$o(t.max)&&t.max%1!=0&&t.max<this.totalRange().max?e-(1-t.max%1):e-(t.justified?1:0)}},e.prototype.totalRangeIndices=function(t){var e,i=this.options,o=$o(i.min)?i.min:0;if(e=$o(i.max)?i.max:$o(i.min)?o+i.categories.length:this.totalRange().max||1,t){var r=this.totalRange();o=Jr(o,0,r.max),e=Jr(e,0,r.max)}return{min:o,max:e}},e.prototype.range=function(){var t=this.options;return{min:$o(t.min)?t.min:0,max:$o(t.max)?t.max:this.totalRange().max}},e.prototype.roundedRange=function(){return this.range()},e.prototype.totalRange=function(){var t=this.options;return{min:0,max:Math.max(this._seriesMax||0,t.srcCategories.length)-(t.justified?1:0)}},e.prototype.scaleOptions=function(){var t=this.rangeIndices(),e=t.min,i=t.max,o=this.lineBox();return{scale:(this.options.vertical?o.height():o.width())/(i-e||1)*(this.options.reverse?-1:1),box:o,min:e,max:i}},e.prototype.arrangeLabels=function(){t.prototype.arrangeLabels.call(this),this.hideOutOfRangeLabels()},e.prototype.hideOutOfRangeLabels=function(){var t=this.box,e=this.labels;if(e.length>0){var i=this.options.vertical?k:S,o=t[i+1],r=t[i+2],n=e[0],s=Kr(e);(n.box[i+1]>r||n.box[i+2]<o)&&(n.options.visible=!1),(s.box[i+1]>r||s.box[i+2]<o)&&(s.options.visible=!1)}},e.prototype.getMajorTickPositions=function(){return this.getTicks().majorTicks},e.prototype.getMinorTickPositions=function(){return this.getTicks().minorTicks},e.prototype.getLabelsTickPositions=function(){return this.getTicks().labelTicks},e.prototype.tickIndices=function(t){for(var e=this.rangeIndices(),i=e.min,o=e.max,r=Math.ceil(o),n=Math.floor(i),s=[];n<=r;)s.push(n),n+=t;return s},e.prototype.getTickPositions=function(t){for(var e=this.options,i=e.vertical,o=e.reverse,r=this.scaleOptions(),n=r.scale,s=r.box,a=r.min,p=s[(i?k:S)+(o?2:1)],h=this.tickIndices(t),c=[],l=0;l<h.length;l++)c.push(p+tn(n*(h[l]-a),3));return c},e.prototype.getTicks=function(){var t=this.options,e=this._ticks,i=this.rangeIndices(),o=this.lineBox(),r=o.getHash()+i.min+","+i.max+t.reverse+t.justified;if(e._hash!==r){var n=t.minorTicks.visible||t.minorGridLines.visible;e._hash=r,e.labelTicks=this.getTickPositions(1),e.majorTicks=this.filterOutOfRangePositions(e.labelTicks,o),e.minorTicks=n?this.filterOutOfRangePositions(this.getTickPositions(.5),o):[]}return e},e.prototype.filterOutOfRangePositions=function(t,e){if(!t.length)return t;for(var i=this.options.vertical?k:S,o=function(t){return e[i+1]<=t&&t<=e[i+2]},r=t.length-1,n=0;!o(t[n])&&n<=r;)n++;for(var s=r;!o(t[s])&&s>=0;)s--;return t.slice(n,s+1)},e.prototype.getSlot=function(t,e,i){var o=this.options,r=o.reverse,n=o.justified,s=o.vertical,a=this.scaleOptions(),p=a.scale,h=a.box,c=a.min,l=s?k:S,u=h[l+(r?2:1)],f=h.clone(),d=!Nr(e),y=on(t,0),v=on(e,y);v=Math.max(v-1,y);var g=u+(y-c)*p,m=u+((v=Math.max(y,v))+1-c)*p;return d&&n&&(m=g),i&&(g=Jr(g,h[l+1],h[l+2]),m=Jr(m,h[l+1],h[l+2])),f[l+1]=r?m:g,f[l+2]=r?g:m,f},e.prototype.limitSlot=function(t){var e=this.options.vertical?k:S,i=this.lineBox(),o=t.clone();return o[e+1]=Jr(t[e+1],i[e+1],i[e+2]),o[e+2]=Jr(t[e+2],i[e+1],i[e+2]),o},e.prototype.slot=function(e,i,o){var r=Math.floor(this.options.min||0),n=e,s=i;return"string"==typeof n?n=this.categoryIndex(n):$o(n)&&(n-=r),"string"==typeof s?s=this.categoryIndex(s):$o(s)&&(s-=r),t.prototype.slot.call(this,n,s,o)},e.prototype.pointCategoryIndex=function(t){var e=this.options,i=e.reverse,o=e.justified,r=e.vertical?k:S,n=this.scaleOptions(),s=n.scale,a=n.box,p=n.min,h=n.max,c=i?h:p,l=a[r+1],u=a[r+2],f=t[r];if(f<l||f>u)return null;var d=c+(f-l)/s,y=d%1;return o?d=Math.round(d):0===y&&d>0&&d--,Math.floor(d)},e.prototype.getCategory=function(t){var e=this.pointCategoryIndex(t);return null===e?null:this.options.categories[e]},e.prototype.categoryIndex=function(t){return this.totalIndex(t)-Math.floor(this.options.min||0)},e.prototype.categoryAt=function(t,e){var i=this.options;return(e?i.srcCategories:i.categories)[t]},e.prototype.categoriesCount=function(){return(this.options.categories||[]).length},e.prototype.translateRange=function(t){var e=this.options,i=this.lineBox(),o=e.vertical?i.height():i.width(),r=e.categories.length,n=tn(t/(o/r),10);return{min:n,max:r+n}},e.prototype.zoomRange=function(t){var e=this.totalRangeIndices(),i=this.totalRange(),o=i.min,r=i.max,n=Jr(e.min+t,o,r),s=Jr(e.max-t,o,r);if(s-n>0)return{min:n,max:s}},e.prototype.scaleRange=function(t){var e=this.options.categories.length,i=t*e;return{min:-i,max:e+i}},e.prototype.labelsCount=function(){var t=this.labelsRange();return t.max-t.min},e.prototype.labelsRange=function(){var t=this.options,e=t.justified,i=t.labels,o=this.totalRangeIndices(!0),r=o.min,n=o.max,s=Math.floor(r);return e?(r=Math.ceil(r),n=Math.floor(n)):(r=Math.floor(r),n=Math.ceil(n)),{min:(r>i.skip?i.skip+i.step*Math.ceil((r-i.skip)/i.step):i.skip)-s,max:(t.categories.length?n+(e?1:0):0)-s}},e.prototype.createAxisLabel=function(t,e,i){var o=this.options,r=o.dataItems?o.dataItems[t]:null,n=on(o.categories[t],"");i.dataItem=r;var s=this.axisLabelText(n,e,i);return new $n(n,s,t,r,e)},e.prototype.shouldRenderNote=function(t){var e=this.totalRangeIndices();return Math.floor(e.min)<=t&&t<=Math.ceil(e.max)},e.prototype.noteSlot=function(t){var e=this.options,i=t-Math.floor(e.min||0);return this.getSlot(i)},e.prototype.arrangeNotes=function(){t.prototype.arrangeNotes.call(this),this.hideOutOfRangeNotes()},e.prototype.hideOutOfRangeNotes=function(){var t=this.notes,e=this.box;if(t&&t.length)for(var i=this.options.vertical?k:S,o=e[i+1],r=e[i+2],n=0;n<t.length;n++){var s=t[n];s.box&&(r<s.box[i+1]||s.box[i+2]<o)&&s.hide()}},e.prototype.pan=function(t){var e=this.totalRangeIndices(!0),i=this.scaleOptions().scale,o=tn(t/i,10),r=this.totalRange(),n=e.min+o,s=e.max+o;return this.limitRange(n,s,0,r.max,o)},e.prototype.pointsRange=function(t,e){var i=this.options,o=i.reverse,r=i.vertical?k:S,n=this.totalRangeIndices(!0),s=this.scaleOptions(),a=s.scale,p=s.box[r+(o?2:1)],h=t[r]-p,c=e[r]-p,l=n.min+h/a,u=n.min+c/a,f=Math.min(l,u),d=Math.max(l,u);if(d-f>=.01)return{min:f,max:d}},e.prototype.valueRange=function(){return this.range()},e.prototype.totalIndex=function(t){var e=this.options;return this._categoriesMap?this._categoriesMap.get(t):function(t,e){if(t instanceof Date){for(var i=e.length,o=0;o<i;o++)if(ms(e[o],t))return o;return-1}return e.indexOf(t)}(t,e.srcCategories)},e.prototype.currentRangeIndices=function(){var t=this.options,e=0;return $o(t.min)&&(e=Math.floor(t.min)),{min:e,max:$o(t.max)?t.justified?Math.floor(t.max):Math.ceil(t.max)-1:this.totalCount()-1}},e.prototype.mapCategories=function(){if(!this._categoriesMap)for(var t=this._categoriesMap=new Ir,e=this.options.srcCategories,i=0;i<e.length;i++)t.set(e[i],i)},e.prototype.totalCount=function(){return Math.max(this.options.srcCategories.length,this._seriesMax||0)},e}(rs);sn(ks,{type:"category",vertical:!1,majorGridLines:{visible:!1,width:1,color:l},labels:{zIndex:1},justified:!1,_deferLabels:!0});var Cs=ks,Ps={milliseconds:"HH:mm:ss.fff",seconds:"HH:mm:ss",minutes:"HH:mm",hours:"HH:mm",days:"M/d",weeks:"M/d",months:"MMM 'yy",years:"yyyy"},Ts=["milliseconds","seconds","minutes","hours",ns,"weeks","months",ss];function Ms(t){var e=t._range;return e||((e=t._range=an(t)).min=cs(e.min),e.max=cs(e.max)),e}var Os=function(t){this.options=t};Os.prototype.displayIndices=function(){return{min:0,max:1}},Os.prototype.displayRange=function(){return{}},Os.prototype.total=function(){return{}},Os.prototype.valueRange=function(){return{}},Os.prototype.valueIndex=function(){return-1},Os.prototype.values=function(){return[]},Os.prototype.totalIndex=function(){return-1},Os.prototype.valuesCount=function(){return 0},Os.prototype.totalCount=function(){return 0},Os.prototype.dateAt=function(){return null};var Rs=function(t,e,i){this.options=i,i.baseUnitStep=i.baseUnitStep||1;var o=i.roundToBaseUnit,r=i.justified;this.start=us(t,0,i.baseUnit,i.weekStartDay);var n=this.roundToTotalStep(e),s=!r&&ms(e,n)&&!i.justifyEnd;this.end=this.roundToTotalStep(e,!r,s?1:0);var a=i.min||t;this.valueStart=this.roundToTotalStep(a),this.displayStart=o?this.valueStart:a;var p=i.max;if(p){var h=!r&&ms(p,this.roundToTotalStep(p))?-1:0;this.valueEnd=this.roundToTotalStep(p,!1,h),this.displayEnd=o?this.roundToTotalStep(p,!r):i.max}else this.valueEnd=n,this.displayEnd=o||s?this.end:e;this.valueEnd<this.valueStart&&(this.valueEnd=this.valueStart),this.displayEnd<=this.displayStart&&(this.displayEnd=this.roundToTotalStep(this.displayStart,!1,1))};function Bs(t,e,i){for(var o,r,n,s=Ms(t.categories),a=(t.max||s.max)-(t.min||s.min),p=t.autoBaseUnitSteps,h=t.maxDateGroups,c="fit"===t.baseUnit,l=e?Ts.indexOf(e):0,u=c?Ts[l++]:t.baseUnit,f=a/as[u],d=f;!r||f>=h;){o=o||p[u].slice(0);do{n=o.shift()}while(n&&e===u&&n<i);if(n)f=d/(r=n);else{if(u===Kr(Ts)){r=Math.ceil(d/h);break}if(!c){f>h&&(r=Math.ceil(d/h));break}u=Ts[l++]||Kr(Ts),d=a/as[u],o=null}}t.baseUnitStep=r,t.baseUnit=u}function js(t){var e=(t.baseUnit||"").toLowerCase();return"fit"!==e&&!Lr(e,Ts)&&function(t){for(var e,i,o=t.categories,r=Nr(o)?o.length:0,n=m,s=0;s<r;s++){var a=o[s];if(a&&e){var p=ps(a,e);p>0&&(i=(n=Math.min(n,p))>=31536e6?ss:n>=24192e5?"months":n>=6048e5?"weeks":n>=864e5?ns:n>=36e5?"hours":n>=6e4?"minutes":"seconds")}e=a}t.baseUnit=i||ns}(t),"fit"!==e&&"auto"!==t.baseUnitStep||Bs(t),t}Rs.prototype.displayRange=function(){return{min:this.displayStart,max:this.displayEnd}},Rs.prototype.displayIndices=function(){if(!this._indices){var t=this.options,e=t.baseUnit,i=t.baseUnitStep,o=bs(this.displayStart,this.valueStart,e,i),r=bs(this.displayEnd,this.valueStart,e,i);this._indices={min:o,max:r}}return this._indices},Rs.prototype.total=function(){return{min:this.start,max:this.end}},Rs.prototype.totalCount=function(){return this.totalIndex(this.end)+(this.options.justified?1:0)},Rs.prototype.valueRange=function(){return{min:this.valueStart,max:this.valueEnd}},Rs.prototype.valueIndex=function(t){var e=this.options;return Math.floor(bs(t,this.valueStart,e.baseUnit,e.baseUnitStep))},Rs.prototype.totalIndex=function(t){var e=this.options;return Math.floor(bs(t,this.start,e.baseUnit,e.baseUnitStep))},Rs.prototype.dateIndex=function(t){var e=this.options;return bs(t,this.valueStart,e.baseUnit,e.baseUnitStep)},Rs.prototype.valuesCount=function(){return this.valueIndex(this.valueEnd)+1},Rs.prototype.values=function(){var t=this._values;if(!t){var e=this.options,i=this.valueRange();this._values=t=[];for(var o=i.min;o<=i.max;)t.push(o),o=us(o,e.baseUnitStep,e.baseUnit,e.weekStartDay)}return t},Rs.prototype.dateAt=function(t,e){var i=this.options;return us(e?this.start:this.valueStart,i.baseUnitStep*t,i.baseUnit,i.weekStartDay)},Rs.prototype.roundToTotalStep=function(t,e,i){var o=this.options,r=o.baseUnit,n=o.baseUnitStep,s=o.weekStartDay,a=this.start,p=bs(t,a,r,n),h=e?Math.ceil(p):Math.floor(p);return i&&(h+=i),us(a,h*n,r,s)};var Is=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){var t=new e(Object.assign({},this.options),this.chartService);return t.createLabels(),t},e.prototype.categoriesHash=function(){var t=this.dataRange.total().min;return this.options.baseUnit+this.options.baseUnitStep+t},e.prototype.initUserOptions=function(t){return t},e.prototype.initFields=function(){t.prototype.initFields.call(this);var e=this.chartService,i=e.intl,o=this.options,r=o.categories||[];if(r._parsed||((r=As(i,r))._parsed=!0),o=or({roundToBaseUnit:!0},o,{categories:r,min:ws(i,o.min),max:ws(i,o.max),weekStartDay:Ss(o,i)}),e.panning&&e.isPannable(o.vertical?k:S)&&(o.roundToBaseUnit=!1),o.userSetBaseUnit=o.userSetBaseUnit||o.baseUnit,o.userSetBaseUnitStep=o.userSetBaseUnitStep||o.baseUnitStep,this.options=o,o.srcCategories=r,r.length>0){var n=Ms(r),s=o.maxDivisions;if(this.dataRange=new Rs(n.min,n.max,js(o)),s){var a=this.dataRange.displayRange(),p=Object.assign({},o,{justified:!0,roundToBaseUnit:!1,baseUnit:"fit",min:a.min,max:a.max,maxDateGroups:s}),h=this.dataRange.options;Bs(p,h.baseUnit,h.baseUnitStep),this.divisionRange=new Rs(n.min,n.max,p)}else this.divisionRange=this.dataRange}else o.baseUnit=o.baseUnit||ns,this.dataRange=this.divisionRange=new Os(o);this.rangeLabels=[]},e.prototype.tickIndices=function(e){var i=this.dataRange,o=this.divisionRange,r=o.valuesCount();if(!this.options.maxDivisions||!r)return t.prototype.tickIndices.call(this,e);var n=[],s=o.values(),a=0;this.options.justified||(s=s.concat(o.dateAt(r)),a=.5);for(var p=0;p<s.length;p++)if(n.push(i.dateIndex(s[p])+a),1!==e&&p>=1){var h=n.length-1;n.splice(p,0,n[h-1]+(n[h]-n[h-1])*e)}return n},e.prototype.shouldRenderNote=function(t){var e=this.range(),i=this.options.categories||[];return ys(t,e.min)>=0&&ys(t,e.max)<=0&&i.length},e.prototype.parseNoteValue=function(t){return ws(this.chartService.intl,t)},e.prototype.noteSlot=function(t){return this.getSlot(t)},e.prototype.translateRange=function(t){var e=this.options,i=e.baseUnit,o=e.weekStartDay,r=e.vertical,n=this.lineBox(),s=r?n.height():n.width(),a=this.range(),p=s/(a.max-a.min),h=tn(t/p,10);if(a.min&&a.max){var c=hs(e.min||a.min,h),l=hs(e.max||a.max,h);a={min:us(c,0,i,o),max:us(l,0,i,o)}}return a},e.prototype.scaleRange=function(t){var e=Math.abs(t),i=this.range(),o=i.min,r=i.max;if(o&&r){for(;e--;){var n=vs(o,r),s=Math.round(.1*n);t<0?(o=hs(o,s),r=hs(r,-s)):(o=hs(o,-s),r=hs(r,s))}i={min:o,max:r}}return i},e.prototype.labelsRange=function(){return{min:this.options.labels.skip,max:this.divisionRange.valuesCount()}},e.prototype.pan=function(t){if(this.isEmpty())return null;var e=this.options,i=this.lineBox(),o=e.vertical?i.height():i.width(),r=this.dataRange.displayRange(),n=r.min,s=r.max,a=this.dataRange.total(),p=tn(t/(o/(s-n)),10)*(e.reverse?-1:1),h=hs(n,p),c=hs(s,p),l=this.limitRange(gs(h),gs(c),gs(a.min),gs(a.max),p);return l?(l.min=cs(l.min),l.max=cs(l.max),l.baseUnit=e.baseUnit,l.baseUnitStep=e.baseUnitStep||1,l.userSetBaseUnit=e.userSetBaseUnit,l.userSetBaseUnitStep=e.userSetBaseUnitStep,l):void 0},e.prototype.pointsRange=function(e,i){if(this.isEmpty())return null;var o=t.prototype.pointsRange.call(this,e,i),r=this.dataRange.displayRange(),n=this.dataRange.displayIndices(),s=vs(r.max,r.min)/(n.max-n.min),a=this.options;return{min:hs(r.min,o.min*s),max:hs(r.min,o.max*s),baseUnit:a.userSetBaseUnit||a.baseUnit,baseUnitStep:a.userSetBaseUnitStep||a.baseUnitStep}},e.prototype.zoomRange=function(t){if(this.isEmpty())return null;var e=this.options,i="fit"===e.userSetBaseUnit,o=this.dataRange.total(),r=this.dataRange.displayRange(),n=r.min,s=r.max,a=this.dataRange.options,p=a.weekStartDay,h=a.baseUnit,c=a.baseUnitStep,l=us(n,t*c,h,p),u=us(s,-t*c,h,p);if(i){var f,d,y=e.autoBaseUnitSteps,v=e.maxDateGroups,g=Kr(y[h])*v*as[h],m=vs(s,n),x=vs(u,l),b=Ts.indexOf(h);if(x<as[h]&&"milliseconds"!==h)h=Ts[b-1],l=hs(n,d=(m-(v-1)*(f=Kr(y[h]))*as[h])/2),u=hs(s,-d);else if(x>g&&h!==ss){var _=0;do{b++,h=Ts[b],_=0,d=2*as[h];do{f=y[h][_],_++}while(_<y[h].length&&d*f<m)}while(h!==ss&&d*f<m);(d=(d*f-m)/2)>0&&(l=hs(n,-d),u=hs(s,d),l=hs(l,Jr(u,o.min,o.max)-u),u=hs(u,Jr(l,o.min,o.max)-l))}}return l<o.min&&(l=o.min),u>o.max&&(u=o.max),l&&u&&vs(u,l)>0?{min:l,max:u,baseUnit:e.userSetBaseUnit||e.baseUnit,baseUnitStep:e.userSetBaseUnitStep||e.baseUnitStep}:void 0},e.prototype.range=function(){return this.dataRange.displayRange()},e.prototype.createLabels=function(){t.prototype.createLabels.call(this),this.createRangeLabels()},e.prototype.clearLabels=function(){t.prototype.clearLabels.call(this),this.rangeLabels=[]},e.prototype.arrangeLabels=function(){this.arrangeRangeLabels(),t.prototype.arrangeLabels.call(this)},e.prototype.arrangeRangeLabels=function(){var t=this.options,e=this.rangeLabels;if(0!==e.length){var i=this.lineBox(),o=t.vertical,r=t.rangeLabels.mirror||t.labels.mirror,n=e[0];if(n){var s=o?i.y1-n.box.height()/2:i.x1;this.positionLabel(n,r,s)}var a=e[1];if(a){var p=o?i.y2-a.box.height()/2:i.x2;this.positionLabel(a,r,p)}}},e.prototype.autoRotateLabels=function(){t.prototype.autoRotateLabels.call(this),this.autoRotateRangeLabels()},e.prototype.hideOutOfRangeLabels=function(){t.prototype.hideOutOfRangeLabels.call(this),this.hideOverlappingLabels()},e.prototype.hideOverlappingLabels=function(){var t=this.rangeLabels,e=this.labels;if(0!==t.length){var i=t[0];if(i&&i.options.visible)for(var o=0;o<e.length;o++){if(!s(i,e[o]))break}var r=t[1];if(r&&r.options.visible)for(var n=e.length-1;n>0;--n){if(!s(r,e[n]))break}}function s(t,e){return!(e.options.visible&&!e.box.overlaps(t.box))&&(e.options.visible=!1,!0)}},e.prototype.contentBox=function(){for(var e=t.prototype.contentBox.call(this),i=this.rangeLabels,o=0;o<i.length;o++){var r=i[o];r.options.visible&&e.wrap(r.box)}return e},e.prototype.createAxisLabel=function(t,e,i){void 0===i&&(i={});var o=this.options,r=o.dataItems&&!o.maxDivisions?o.dataItems[t]:null,n=this.divisionRange.dateAt(t),s=e.dateFormats[this.divisionRange.options.baseUnit];e.format=e.format||s,i.dataItem=r;var a=this.axisLabelText(n,e,i);if(a)return new $n(n,a,t,r,e)},e.prototype.createRangeLabels=function(){var t=this,e=this.divisionRange,i=e.displayStart,o=e.displayEnd,r=this.options,n=Object.assign({},r.labels,r.rangeLabels,{align:f,zIndex:r.zIndex});if(!0===n.visible){this.normalizeLabelRotation(n),n.alignRotation=f,"auto"===n.rotation&&(n.rotation=0,r.autoRotateRangeLabels=!0);var s=n.dateFormats[this.divisionRange.options.baseUnit];n.format=n.format||s;var a=function(e,i,o){if(o){var r=new $n(i,o,e,null,n);t.append(r),t.rangeLabels.push(r)}};a(0,i,this.axisLabelText(i,n,{index:0,count:2})),a(1,o,this.axisLabelText(o,n,{index:1,count:2}))}},e.prototype.autoRotateRangeLabels=function(){var t=this,e=this.rangeLabels;if(this.options.autoRotateRangeLabels&&!this.options.vertical&&2===e.length){var i=function(e,i,o){var r=2*Math.abs(i[o+1]-i[o]),n=t.autoRotateLabelAngle(e.box,r);0!==n&&(e.options.rotation=n,e.reflow(new kn))},o=this.getMajorTickPositions();i(e[0],o,0),i(e[1],o,o.length-2)}},e.prototype.categoryIndex=function(t){return this.dataRange.valueIndex(t)},e.prototype.slot=function(t,e,i){var o=this.dataRange,r=t,n=e;r instanceof Date&&(r=o.dateIndex(r)),n instanceof Date&&(n=o.dateIndex(n));var s=this.getSlot(r,n,i);if(s)return s.toRect()},e.prototype.getSlot=function(e,i,o){var r=e,n=i;return"object"==typeof r&&(r=this.categoryIndex(r)),"object"==typeof n&&(n=this.categoryIndex(n)),t.prototype.getSlot.call(this,r,n,o)},e.prototype.valueRange=function(){var t=Ms(this.options.srcCategories);return{min:cs(t.min),max:cs(t.max)}},e.prototype.categoryAt=function(t,e){return this.dataRange.dateAt(t,e)},e.prototype.categoriesCount=function(){return this.dataRange.valuesCount()},e.prototype.rangeIndices=function(){return this.dataRange.displayIndices()},e.prototype.labelsBetweenTicks=function(){return!this.divisionRange.options.justified},e.prototype.prepareUserOptions=function(){this.isEmpty()||(this.options.categories=this.dataRange.values())},e.prototype.getCategory=function(t){var e=this.pointCategoryIndex(t);return null===e?null:this.dataRange.dateAt(e)},e.prototype.totalIndex=function(t){return this.dataRange.totalIndex(t)},e.prototype.currentRangeIndices=function(){var t=this.dataRange.valueRange();return{min:this.dataRange.totalIndex(t.min),max:this.dataRange.totalIndex(t.max)}},e.prototype.totalRange=function(){return this.dataRange.total()},e.prototype.totalCount=function(){return this.dataRange.totalCount()},e.prototype.isEmpty=function(){return!this.options.srcCategories.length},e.prototype.roundedRange=function(){if(!1!==this.options.roundToBaseUnit||this.isEmpty())return this.range();var t=this.options,e=Ms(t.srcCategories);return new Rs(e.min,e.max,Object.assign({},t,{justified:!1,roundToBaseUnit:!0,justifyEnd:t.justified})).displayRange()},e}(Cs);sn(Is,{type:y,labels:{dateFormats:Ps},rangeLabels:{visible:!1},autoBaseUnitSteps:{milliseconds:[1,10,100],seconds:[1,2,5,15,30],minutes:[1,2,5,15,30],hours:[1,2,3],days:[1,2,3],weeks:[1,2],months:[1,2,3,6],years:[1,2,3,5,10,25,50]},maxDateGroups:10});var Ls=Is;function zs(t,e){return tn(Math.floor(t/e)*e,10)}function Es(t,e){return tn(Math.ceil(t/e)*e,10)}function Vs(t){return Math.max(Math.min(t,3e5),-3e5)}var Fs=Math.pow(10,-9),Ds=function(t){function e(e,i,o,r){t.call(this,Object.assign({},o,{seriesMin:e,seriesMax:i}),r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initUserOptions=function(t){var e=function(t,e,i){var o=i.narrowRange,r=function(t,e,i){if(!t&&!e)return 0;var o;if(t>=0&&e>=0){var r=t===e?0:t;if(!1===i||!i&&(e-r)/e>.2)return 0;o=Math.max(0,r-(e-r)/2)}else o=t;return o}(t,e,o),n=function(t,e,i){if(!t&&!e)return 1;var o;if(t<=0&&e<=0){var r=t===e?0:e,n=Math.abs((r-t)/r);if(!1===i||!i&&n>.2)return 0;o=Math.min(0,r-(t-r)/2)}else o=e;return o}(t,e,o),s=wn(r,n),a={majorUnit:s};!1!==i.roundToMajorUnit&&(r<0&&Us(r,s,1/3)&&(r-=s),n>0&&Us(n,s,1/3)&&(n+=s));return a.min=zs(r,s),a.max=Es(n,s),a}(t.seriesMin,t.seriesMax,t);return this.totalOptions=function(t,e){return{min:Nr(e.min)?Math.min(t.min,e.min):t.min,max:Nr(e.max)?Math.max(t.max,e.max):t.max,majorUnit:t.majorUnit}}(e,t),function(t,e){var i,o,r=e;if(e){!function(t,e){for(var i=0;i<e.length;i++){var o=e[i];null===t[o]&&(t[o]=void 0)}}(e,["min","max"]),i=Nr(e.min),o=Nr(e.max);var n=i||o;n&&e.min===e.max&&(e.min>0?e.min=0:e.max=1),e.majorUnit?(t.min=zs(t.min,e.majorUnit),t.max=Es(t.max,e.majorUnit)):n&&(r=or(t,e),t.majorUnit=wn(r.min,r.max))}t.minorUnit=(r.majorUnit||t.majorUnit)/5;var s=or(t,r);s.min>=s.max&&(i&&!o?s.max=s.min+s.majorUnit:!i&&o&&(s.min=s.max-s.majorUnit));return s}(e,t)},e.prototype.initFields=function(){this.totalMin=this.totalOptions.min,this.totalMax=this.totalOptions.max,this.totalMajorUnit=this.totalOptions.majorUnit,this.seriesMin=this.options.seriesMin,this.seriesMax=this.options.seriesMax},e.prototype.clone=function(){return new e(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)},e.prototype.startValue=function(){return 0},e.prototype.range=function(){var t=this.options;return{min:t.min,max:t.max}},e.prototype.getDivisions=function(t){if(0===t)return 1;var e=this.options,i=e.max-e.min;return Math.floor(tn(i/t,3))+1},e.prototype.getTickPositions=function(t,e){var i=this.options,o=i.vertical,r=i.reverse,n=this.lineBox(),s=t*((o?n.height():n.width())/(i.max-i.min)),a=this.getDivisions(t),p=(o?-1:1)*(r?-1:1),h=[],c=n[(o?k:S)+(1===p?1:2)],l=0;e&&(l=e/t);for(var u=0;u<a;u++)u%l!=0&&h.push(tn(c,3)),c+=s*p;return h},e.prototype.getMajorTickPositions=function(){return this.getTickPositions(this.options.majorUnit)},e.prototype.getMinorTickPositions=function(){return this.getTickPositions(this.options.minorUnit)},e.prototype.getSlot=function(t,e,i){void 0===i&&(i=!1);var o,r,n=this.options,s=n.vertical,a=n.reverse,p=s?k:S,h=this.lineBox(),c=h[p+(a?2:1)],l=(a?-1:1)*((s?h.height():h.width())/(n.max-n.min)),u=new kn(h.x1,h.y1,h.x1,h.y1),f=t,d=e;return Nr(f)||(f=d||0),Nr(d)||(d=f||0),i&&(f=Math.max(Math.min(f,n.max),n.min),d=Math.max(Math.min(d,n.max),n.min)),s?(o=n.max-Math.max(f,d),r=n.max-Math.min(f,d)):(o=Math.min(f,d)-n.min,r=Math.max(f,d)-n.min),u[p+1]=Vs(c+l*(a?r:o)),u[p+2]=Vs(c+l*(a?o:r)),u},e.prototype.getValue=function(t){var e=this.options,i=e.vertical,o=e.reverse,r=Number(e.max),n=Number(e.min),s=i?k:S,a=this.lineBox(),p=a[s+(o?2:1)],h=i?a.height():a.width(),c=(o?-1:1)*(t[s]-p),l=c*((r-n)/h);return c<0||c>h?null:tn(i?r-l:n+l,10)},e.prototype.translateRange=function(t){var e=this.options,i=e.vertical,o=e.reverse,r=e.max,n=e.min,s=this.lineBox(),a=i?s.height():s.width(),p=tn(t/(a/(r-n)),10);return!i&&!o||i&&o||(p=-p),{min:n+p,max:r+p,offset:p}},e.prototype.scaleRange=function(t){var e=this.options,i=-t*e.majorUnit;return{min:e.min-i,max:e.max+i}},e.prototype.labelsCount=function(){return this.getDivisions(this.options.majorUnit)},e.prototype.createAxisLabel=function(t,e,i){var o=this.options,r=tn(o.min+t*o.majorUnit,10),n=this.axisLabelText(r,e,i);return new $n(r,n,t,null,e)},e.prototype.shouldRenderNote=function(t){var e=this.range();return e.min<=t&&t<=e.max},e.prototype.pan=function(t){var e=this.translateRange(t);return this.limitRange(e.min,e.max,this.totalMin,this.totalMax,e.offset)},e.prototype.pointsRange=function(t,e){var i=this.getValue(t),o=this.getValue(e),r=Math.min(i,o),n=Math.max(i,o);if(this.isValidRange(r,n))return{min:r,max:n}},e.prototype.zoomRange=function(t){var e=this.totalMin,i=this.totalMax,o=this.scaleRange(t),r=Jr(o.min,e,i),n=Jr(o.max,e,i);if(this.isValidRange(r,n))return{min:r,max:n}},e.prototype.isValidRange=function(t,e){return e-t>Fs},e}(rs);function Us(t,e,i){var o=tn(Math.abs(t%e),10);return 0===o||o>e*(1-i)}sn(Ds,{type:"numeric",min:0,max:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:l},labels:{format:"#.####################"},zIndex:1});var Hs=Ds,Gs=function(t){function e(e,i,o,r){var n=cs(e),s=cs(i),a=r.intl,p=o||{};p=function(t,e,i){var o=i.min||t,r=i.max||e,n=i.baseUnit||(r&&o?function(t){var e="hours";t>=31536e6?e=ss:t>=26784e5?e="months":t>=6048e5?e="weeks":t>=864e5&&(e=ns);return e}(ps(r,o)):"hours"),s=as[n],a=i.weekStartDay||0,p=fs(gs(o)-1,n,a)||cs(r),h=ds(gs(r)+1,n,a),c=(i.majorUnit?i.majorUnit:void 0)||Es(wn(p.getTime(),h.getTime()),s)/s,l=_s(p,h,n),u=Es(l,c)-l,f=Math.floor(u/2),d=u-f;i.baseUnit||delete i.baseUnit;return i.baseUnit=i.baseUnit||n,i.min=i.min||us(p,-f,n,a),i.max=i.max||us(h,d,n,a),i.minorUnit=i.minorUnit||c/5,i.majorUnit=c,i}(n,s,p=or(p||{},{min:ws(a,p.min),max:ws(a,p.max),axisCrossingValue:As(a,p.axisCrossingValues||p.axisCrossingValue),weekStartDay:Ss(p,a)})),t.call(this,p,r),this.intlService=a,this.seriesMin=n,this.seriesMax=s;var h=p.weekStartDay||0;this.totalMin=gs(fs(gs(n)-1,p.baseUnit,h)),this.totalMax=gs(ds(gs(s)+1,p.baseUnit,h))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)},e.prototype.range=function(){var t=this.options;return{min:t.min,max:t.max}},e.prototype.getDivisions=function(t){var e=this.options;return Math.floor(_s(e.min,e.max,e.baseUnit)/t+1)},e.prototype.getTickPositions=function(t){for(var e=this.options,i=e.vertical,o=this.lineBox(),r=(i?-1:1)*(e.reverse?-1:1),n=o[(i?k:S)+(1===r?1:2)],s=this.getDivisions(t),a=vs(e.max,e.min),p=(i?o.height():o.width())/a,h=e.weekStartDay||0,c=[n],l=1;l<s;l++){var u=n+vs(us(e.min,l*t,e.baseUnit,h),e.min)*p*r;c.push(tn(u,3))}return c},e.prototype.getMajorTickPositions=function(){return this.getTickPositions(this.options.majorUnit)},e.prototype.getMinorTickPositions=function(){return this.getTickPositions(this.options.minorUnit)},e.prototype.getSlot=function(t,e,i){return Hs.prototype.getSlot.call(this,ws(this.intlService,t),ws(this.intlService,e),i)},e.prototype.getValue=function(t){var e=Hs.prototype.getValue.call(this,t);return null!==e?cs(e):null},e.prototype.labelsCount=function(){return this.getDivisions(this.options.majorUnit)},e.prototype.createAxisLabel=function(t,e,i){var o=this.options,r=t*o.majorUnit,n=o.weekStartDay||0,s=o.min;r>0&&(s=us(s,r,o.baseUnit,n));var a=e.dateFormats[o.baseUnit];e.format=e.format||a;var p=this.axisLabelText(s,e,i);return new $n(s,p,t,null,e)},e.prototype.translateRange=function(t,e){var i=this.options,o=i.baseUnit,r=i.weekStartDay||0,n=this.lineBox(),s=i.vertical?n.height():n.width(),a=this.range(),p=s/vs(a.max,a.min),h=tn(t/p,10)*(i.reverse?-1:1),c=hs(i.min,h),l=hs(i.max,h);return e||(c=us(c,0,o,r),l=us(l,0,o,r)),{min:c,max:l,offset:h}},e.prototype.scaleRange=function(t){for(var e=this.options,i=e.min,o=e.max,r=Math.abs(t);r--;){var n=vs(i,o),s=Math.round(.1*n);t<0?(i=hs(i,s),o=hs(o,-s)):(i=hs(i,-s),o=hs(o,s))}return{min:i,max:o}},e.prototype.shouldRenderNote=function(t){var e=this.range();return ys(t,e.min)>=0&&ys(t,e.max)<=0},e.prototype.pan=function(t){var e=this.translateRange(t,!0),i=this.limitRange(gs(e.min),gs(e.max),this.totalMin,this.totalMax,e.offset);if(i)return{min:cs(i.min),max:cs(i.max)}},e.prototype.pointsRange=function(t,e){var i=this.getValue(t),o=this.getValue(e),r=Math.min(i,o),n=Math.max(i,o);return{min:cs(r),max:cs(n)}},e.prototype.zoomRange=function(t){var e=this.scaleRange(t);return{min:cs(Jr(gs(e.min),this.totalMin,this.totalMax)),max:cs(Jr(gs(e.max),this.totalMin,this.totalMax))}},e}(rs);sn(Gs,{type:y,majorGridLines:{visible:!0,width:1,color:l},labels:{dateFormats:Ps}});var Ns=Gs,Ws=function(t){function e(e,i,o,r){var n=or({majorUnit:10,min:e,max:i},o),s=n.majorUnit,a=function(t,e){var i,o=tn(Xs(t,e),10)%1;i=t<=0?e:0!==o&&(o<.3||o>.9)?Math.pow(e,Xs(t,e)+.2):Math.pow(e,Math.ceil(Xs(t,e)));return i}(i,s),p=function(t,e,i){var o=i.majorUnit,r=t;t<=0?r=e<=1?Math.pow(o,-2):1:i.narrowRange||(r=Math.pow(o,Math.floor(Xs(t,o))));return r}(e,i,n),h=function(t,e,i,o){var r=i.min,n=i.max;Nr(i.axisCrossingValue)&&i.axisCrossingValue<=0&&qs();Nr(o.max)?o.max<=0&&qs():n=e;Nr(o.min)?o.min<=0&&qs():r=t;return{min:r,max:n}}(p,a,n,o);n.max=h.max,n.min=h.min,n.minorUnit=o.minorUnit||tn(s-1,10),t.call(this,n,r),this.totalMin=Nr(o.min)?Math.min(p,o.min):p,this.totalMax=Nr(o.max)?Math.max(a,o.max):a,this.logMin=tn(Xs(h.min,s),10),this.logMax=tn(Xs(h.max,s),10),this.seriesMin=e,this.seriesMax=i,this.createLabels()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)},e.prototype.startValue=function(){return this.options.min},e.prototype.getSlot=function(t,e,i){var o,r,n=this.options,s=this.logMin,a=this.logMax,p=n.reverse,h=n.vertical,c=n.majorUnit,l=h?k:S,u=this.lineBox(),f=u[l+(p?2:1)],d=(p?-1:1)*((h?u.height():u.width())/(a-s)),y=new kn(u.x1,u.y1,u.x1,u.y1),v=t,g=e;return Nr(v)||(v=g||1),Nr(g)||(g=v||1),v<=0||g<=0?null:(i&&(v=Math.max(Math.min(v,n.max),n.min),g=Math.max(Math.min(g,n.max),n.min)),v=Xs(v,c),g=Xs(g,c),h?(o=a-Math.max(v,g),r=a-Math.min(v,g)):(o=Math.min(v,g)-s,r=Math.max(v,g)-s),y[l+1]=Vs(f+d*(p?r:o)),y[l+2]=Vs(f+d*(p?o:r)),y)},e.prototype.getValue=function(t){var e=this.options,i=this.logMin,o=this.logMax,r=e.reverse,n=e.vertical,s=e.majorUnit,a=this.lineBox(),p=n===r?1:-1,h=1===p?1:2,c=n?a.height():a.width(),l=(o-i)/c,u=n?k:S,f=a[u+h],d=p*(t[u]-f);if(d<0||d>c)return null;var y=i+d*l;return tn(Math.pow(s,y),10)},e.prototype.range=function(){var t=this.options;return{min:t.min,max:t.max}},e.prototype.scaleRange=function(t){var e=this.options.majorUnit,i=-t;return{min:Math.pow(e,this.logMin-i),max:Math.pow(e,this.logMax+i)}},e.prototype.translateRange=function(t){var e=this.options,i=this.logMin,o=this.logMax,r=e.reverse,n=e.vertical,s=e.majorUnit,a=this.lineBox(),p=n?a.height():a.width(),h=tn(t/(p/(o-i)),10);return!n&&!r||n&&r||(h=-h),{min:Math.pow(s,i+h),max:Math.pow(s,o+h),offset:h}},e.prototype.labelsCount=function(){var t=Math.floor(this.logMax);return Math.floor(t-this.logMin)+1},e.prototype.getMajorTickPositions=function(){var t=[];return this.traverseMajorTicksPositions((function(e){t.push(e)}),{step:1,skip:0}),t},e.prototype.createTicks=function(t){var e=this.options,i=e.majorTicks,o=e.minorTicks,r=e.vertical,n=e.labels.mirror,s=this.lineBox(),a={vertical:r};function p(e,i){a.tickX=n?s.x2:s.x2-i.size,a.tickY=n?s.y1-i.size:s.y1,a.position=e,t.append(es(a,i))}return i.visible&&this.traverseMajorTicksPositions(p,i),o.visible&&this.traverseMinorTicksPositions(p,o),[]},e.prototype.createGridLines=function(t){var e=this.options,i=e.minorGridLines,o=e.majorGridLines,r=e.vertical,n=t.lineBox(),s={lineStart:n[r?"x1":"y1"],lineEnd:n[r?"x2":"y2"],vertical:r},a=[],p=this.gridLinesVisual();function h(t,e){Lr(t,a)||(s.position=t,p.append(is(s,e)),a.push(t))}return o.visible&&this.traverseMajorTicksPositions(h,o),i.visible&&this.traverseMinorTicksPositions(h,i),p.children},e.prototype.traverseMajorTicksPositions=function(t,e){for(var i=this._lineOptions(),o=i.lineStart,r=i.step,n=this.logMin,s=this.logMax,a=Math.ceil(n)+e.skip;a<=s;a+=e.step){t(tn(o+r*(a-n),10),e)}},e.prototype.traverseMinorTicksPositions=function(t,e){for(var i=this.options,o=i.min,r=i.max,n=i.minorUnit,s=i.majorUnit,a=this._lineOptions(),p=a.lineStart,h=a.step,c=this.logMin,l=this.logMax,u=Math.floor(c);u<l;u++)for(var f=this._minorIntervalOptions(u),d=e.skip;d<n;d+=e.step){var y=f.value+d*f.minorStep;if(y>r)break;if(y>=o)t(tn(p+h*(Xs(y,s)-c),10),e)}},e.prototype.createAxisLabel=function(t,e,i){var o=Math.ceil(this.logMin+t),r=Math.pow(this.options.majorUnit,o),n=this.axisLabelText(r,e,i);return new $n(r,n,t,null,e)},e.prototype.shouldRenderNote=function(t){var e=this.range();return e.min<=t&&t<=e.max},e.prototype.pan=function(t){var e=this.translateRange(t);return this.limitRange(e.min,e.max,this.totalMin,this.totalMax,e.offset)},e.prototype.pointsRange=function(t,e){var i=this.getValue(t),o=this.getValue(e);return{min:Math.min(i,o),max:Math.max(i,o)}},e.prototype.zoomRange=function(t){var e=this.options,i=this.totalMin,o=this.totalMax,r=this.scaleRange(t),n=Jr(r.min,i,o),s=Jr(r.max,i,o),a=e.majorUnit,p=s>n&&e.min&&e.max&&tn(Xs(e.max,a)-Xs(e.min,a),10)<1,h=!(e.min===i&&e.max===o)&&tn(Xs(s,a)-Xs(n,a),10)>=1;if(p||h)return{min:n,max:s}},e.prototype._minorIntervalOptions=function(t){var e=this.options,i=e.minorUnit,o=e.majorUnit,r=Math.pow(o,t);return{value:r,minorStep:(Math.pow(o,t+1)-r)/i}},e.prototype._lineOptions=function(){var t=this.options,e=t.reverse,i=t.vertical,o=i?k:S,r=this.lineBox(),n=i===e?1:-1,s=1===n?1:2;return{step:n*((i?r.height():r.width())/(this.logMax-this.logMin)),lineStart:r[o+s],lineBox:r}},e}(rs);function qs(){throw new Error("Non positive values cannot be used for a logarithmic axis")}function Xs(t,e){return Math.log(t)/Math.log(e)}sn(Ws,{type:"log",majorUnit:10,minorUnit:1,axisCrossingValue:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:l},zIndex:1,_deferLabels:!0});var Ys=Ws,Zs={createGridLines:function(t){var e,i,o=this.options,r=Math.abs(this.box.center().y-t.lineBox().y1),n=[],s=!1;return o.majorGridLines.visible&&(e=this.majorGridLineAngles(t),s=!0,n=this.renderMajorGridLines(e,r,o.majorGridLines)),o.minorGridLines.visible&&(i=this.minorGridLineAngles(t,s),Hr(n,this.renderMinorGridLines(i,r,o.minorGridLines,t,s))),n},renderMajorGridLines:function(t,e,i){return this.renderGridLines(t,e,i)},renderMinorGridLines:function(t,e,i,o,r){var n=this.radiusCallback&&this.radiusCallback(e,o,r);return this.renderGridLines(t,e,i,n)},renderGridLines:function(t,e,i,o){for(var r={stroke:{width:i.width,color:i.color,dashType:i.dashType}},n=this.box.center(),s=new p.Circle([n.x,n.y],e),h=this.gridLinesVisual(),c=0;c<t.length;c++){var l=new a.Path(r);o&&(s.radius=o(t[c])),l.moveTo(s.center).lineTo(s.pointAt(t[c]+180)),h.append(l)}return h.children},gridLineAngles:function(t,e,i,o,r){var n=this,s=this.intervals(e,i,o,r),a=t.options,p=a.visible&&!1!==(a.line||{}).visible;return Fr(s,(function(t){var e=n.intervalAngle(t);if(!p||90!==e)return e}))}},Ks=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.range=function(){return{min:0,max:this.options.categories.length}},e.prototype.reflow=function(t){this.box=t,this.reflowLabels()},e.prototype.lineBox=function(){return this.box},e.prototype.reflowLabels=function(){for(var t=this.labels,e=this.options.labels,i=e.skip||0,o=e.step||1,r=new kn,n=0;n<t.length;n++){t[n].reflow(r);var s=t[n].box;t[n].reflow(this.getSlot(i+n*o).adjacentBox(0,s.width(),s.height()))}},e.prototype.intervals=function(t,e,i,o){void 0===o&&(o=!1);for(var r=this.options,n=r.categories.length/t||1,s=360/n,a=i||1,p=[],h=0,c=e||0;c<n;c+=a)h=r.reverse?360-c*s:c*s,h=tn(h,3)%360,o&&Lr(h,o)||p.push(h);return p},e.prototype.majorIntervals=function(){return this.intervals(1)},e.prototype.minorIntervals=function(){return this.intervals(.5)},e.prototype.intervalAngle=function(t){return(360+t+this.options.startAngle)%360},e.prototype.majorAngles=function(){var t=this;return Fr(this.majorIntervals(),(function(e){return t.intervalAngle(e)}))},e.prototype.createLine=function(){return[]},e.prototype.majorGridLineAngles=function(t){var e=this.options.majorGridLines;return this.gridLineAngles(t,1,e.skip,e.step)},e.prototype.minorGridLineAngles=function(t,e){var i=this.options,o=i.minorGridLines,r=i.majorGridLines,n=e?this.intervals(1,r.skip,r.step):null;return this.gridLineAngles(t,.5,o.skip,o.step,n)},e.prototype.radiusCallback=function(t,e,i){if(e.options.type!==c){var o=Qr(360/(2*this.options.categories.length)),r=Math.cos(o)*t,n=this.majorAngles(),s=function(e){return!i&&Lr(e,n)?t:r};return s}},e.prototype.createPlotBands=function(){for(var t=this.options.plotBands||[],e=this._plotbandGroup=new a.Group({zIndex:-1}),i=0;i<t.length;i++){var o=t[i],r=this.plotBandSlot(o),n=this.getSlot(o.from),s=o.from-Math.floor(o.from);r.startAngle+=s*n.angle;var p=Math.ceil(o.to)-o.to;r.angle-=(p+s)*n.angle;var h=On.current.createRing(r,{fill:{color:o.color,opacity:o.opacity},stroke:{opacity:o.opacity}});e.append(h)}this.appendVisual(e)},e.prototype.plotBandSlot=function(t){return this.getSlot(t.from,t.to-1)},e.prototype.getSlot=function(t,e){var i=this.options,o=i.justified,r=this.box,n=this.majorAngles(),s=n.length,a=360/s,p=t;i.reverse&&!o&&(p=(p+1)%s);var h=n[p=Jr(Math.floor(p),0,s-1)];o&&(h-=a/2)<0&&(h+=360);var c=a*(Jr(Math.ceil(e||p),p,s-1)-p+1);return new Pn(r.center(),0,r.height()/2,h,c)},e.prototype.slot=function(t,e){var i=this.getSlot(t,e),o=i.startAngle+180,r=o+i.angle;return new p.Arc([i.center.x,i.center.y],{startAngle:o,endAngle:r,radiusX:i.radius,radiusY:i.radius})},e.prototype.pointCategoryIndex=function(t){for(var e=this.options.categories.length,i=null,o=0;o<e;o++){if(this.getSlot(o).containsPoint(t)){i=o;break}}return i},e}(Cs);sn(Ks,{startAngle:90,labels:{margin:hr(10)},majorGridLines:{visible:!0},justified:!0}),or(Ks.prototype,Zs);var Js=Ks,$s=function(t){function e(e,i){t.call(this,e,i);var o=this.options;o.minorUnit=o.minorUnit||o.majorUnit/2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDivisions=function(t){return Hs.prototype.getDivisions.call(this,t)-1},e.prototype.reflow=function(t){this.box=t,this.reflowLabels()},e.prototype.reflowLabels=function(){for(var t=this.options,e=this.labels,i=this.options.labels,o=i.skip||0,r=i.step||1,n=new kn,s=this.intervals(t.majorUnit,o,r),a=0;a<e.length;a++){e[a].reflow(n);var p=e[a].box;e[a].reflow(this.getSlot(s[a]).adjacentBox(0,p.width(),p.height()))}},e.prototype.lineBox=function(){return this.box},e.prototype.intervals=function(t,e,i,o){void 0===o&&(o=!1);for(var r=this.options.min,n=this.getDivisions(t),s=[],a=i||1,p=e||0;p<n;p+=a){var h=(360+r+p*t)%360;o&&Lr(h,o)||s.push(h)}return s},e.prototype.majorIntervals=function(){return this.intervals(this.options.majorUnit)},e.prototype.minorIntervals=function(){return this.intervals(this.options.minorUnit)},e.prototype.intervalAngle=function(t){return(540-t-this.options.startAngle)%360},e.prototype.createLine=function(){return[]},e.prototype.majorGridLineAngles=function(t){var e=this.options.majorGridLines;return this.gridLineAngles(t,this.options.majorUnit,e.skip,e.step)},e.prototype.minorGridLineAngles=function(t,e){var i=this.options,o=i.minorGridLines,r=i.majorGridLines,n=e?this.intervals(i.majorUnit,r.skip,r.step):null;return this.gridLineAngles(t,i.minorUnit,o.skip,o.step,n)},e.prototype.plotBandSlot=function(t){return this.getSlot(t.from,t.to)},e.prototype.getSlot=function(t,e){var i=this.options,o=this.box,r=i.startAngle,n=Jr(t,i.min,i.max),s=Jr(e||n,n,i.max);if(i.reverse&&(n*=-1,s*=-1),(s=(540-s-r)%360)<(n=(540-n-r)%360)){var a=n;n=s,s=a}return new Pn(o.center(),0,o.height()/2,n,s-n)},e.prototype.slot=function(t,e){void 0===e&&(e=t);var i,o,r=this.options,n=360-r.startAngle,s=this.getSlot(t,e),a=Math.min(t,e),h=Math.max(t,e);return r.reverse?(i=a,o=h):(i=360-h,o=360-a),i=(i+n)%360,o=(o+n)%360,new p.Arc([s.center.x,s.center.y],{startAngle:i,endAngle:o,radiusX:s.radius,radiusY:s.radius})},e.prototype.getValue=function(t){var e=this.options,i=this.box.center(),o=t.x-i.x,r=t.y-i.y,n=Math.round(Wr(Math.atan2(r,o))),s=e.startAngle;return e.reverse||(n*=-1,s*=-1),(n+s+360)%360},e.prototype.valueRange=function(){return{min:0,max:2*Math.PI}},e}(rs);sn($s,{type:"polar",startAngle:0,reverse:!1,majorUnit:60,min:0,max:360,labels:{margin:hr(10)},majorGridLines:{color:l,visible:!0,width:1},minorGridLines:{color:"#aaa"}}),or($s.prototype,Zs,{createPlotBands:Js.prototype.createPlotBands,majorAngles:Js.prototype.majorAngles,range:Hs.prototype.range,labelsCount:Hs.prototype.labelsCount,createAxisLabel:Hs.prototype.createAxisLabel});var Qs=$s;function ta(t,e){return 180-Math.abs(Math.abs(t-e)-180)}var ea={options:{majorGridLines:{visible:!0}},createPlotBands:function(){var t=this.options,e=t.majorGridLines.type,i=t.plotBands;void 0===i&&(i=[]);for(var o=this.plotArea.polarAxis,r=o.majorAngles(),n=o.box.center(),s=this._plotbandGroup=new a.Group({zIndex:-1}),p=0;p<i.length;p++){var h=i[p],l={fill:{color:h.color,opacity:h.opacity},stroke:{opacity:h.opacity}},u=this.getSlot(h.from,h.to,!0),f=new Pn(n,n.y-u.y2,n.y-u.y1,0,360),d=void 0;d=e===c?On.current.createRing(f,l):a.Path.fromPoints(this.plotBandPoints(f,r),l).close(),s.append(d)}this.appendVisual(s)},plotBandPoints:function(t,e){for(var i=[],o=[],r=[t.center.x,t.center.y],n=new p.Circle(r,t.innerRadius),s=new p.Circle(r,t.radius),a=0;a<e.length;a++)i.push(n.pointAt(e[a]+180)),o.push(s.pointAt(e[a]+180));return i.reverse(),i.push(i[0]),o.push(o[0]),o.concat(i)},createGridLines:function(t){var e=this.options,i=this.radarMajorGridLinePositions(),o=t.majorAngles(),r=t.box.center(),n=[];if(e.majorGridLines.visible&&(n=this.renderGridLines(r,i,o,e.majorGridLines)),e.minorGridLines.visible){var s=this.radarMinorGridLinePositions();Hr(n,this.renderGridLines(r,s,o,e.minorGridLines))}return n},renderGridLines:function(t,e,i,o){var r={stroke:{width:o.width,color:o.color,dashType:o.dashType}},n=o.skip;void 0===n&&(n=0);var s=o.step;void 0===s&&(s=0);for(var h=this.gridLinesVisual(),l=n;l<e.length;l+=s){var u=t.y-e[l];if(u>0){var f=new p.Circle([t.x,t.y],u);if(o.type===c)h.append(new a.Circle(f,r));else{for(var d=new a.Path(r),y=0;y<i.length;y++)d.lineTo(f.pointAt(i[y]+180));d.close(),h.append(d)}}}return h.children},getValue:function(t){var e=this.lineBox(),i=this.plotArea.polarAxis,o=i.majorAngles(),r=i.box.center(),n=t.distanceTo(r),s=n;if(this.options.majorGridLines.type!==c&&o.length>1){var a=t.x-r.x,p=t.y-r.y,h=(Wr(Math.atan2(p,a))+540)%360;o.sort((function(t,e){return ta(t,h)-ta(e,h)}));var l=90-ta(o[0],o[1])/2,u=180-ta(h,o[0])-l;s=n*(Math.sin(Qr(u))/Math.sin(Qr(l)))}return this.axisType().prototype.getValue.call(this,new An(e.x1,e.y2-s))}},ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.radarMajorGridLinePositions=function(){return this.getTickPositions(this.options.majorUnit)},e.prototype.radarMinorGridLinePositions=function(){var t=this.options,e=0;return t.majorGridLines.visible&&(e=t.majorUnit),this.getTickPositions(t.minorUnit,e)},e.prototype.axisType=function(){return t},e}(Hs);or(ia.prototype,ea);var oa=ia,ra=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.radarMajorGridLinePositions=function(){var t=[];return this.traverseMajorTicksPositions((function(e){t.push(e)}),this.options.majorGridLines),t},e.prototype.radarMinorGridLinePositions=function(){var t=[];return this.traverseMinorTicksPositions((function(e){t.push(e)}),this.options.minorGridLines),t},e.prototype.axisType=function(){return t},e}(Ys);or(ra.prototype,ea);var na=ra;function sa(t){return t<=0?-1:1}var aa=function(t){function e(e){t.call(this),this.closed=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.process=function(t){var e=t.slice(0),i=[],o=this.closed,r=e.length;if(r>2&&(this.removeDuplicates(0,e),r=e.length),r<2||2===r&&e[0].equals(e[1]))return i;var n,s,a=e[0],h=e[1],c=e[2];for(i.push(new p.Segment(a));a.equals(e[r-1]);)o=!0,e.pop(),r--;if(2===r){var l=this.tangent(a,h,S,k);return Kr(i).controlOut(this.firstControlPoint(l,a,h,S,k)),i.push(new p.Segment(h,this.secondControlPoint(l,a,h,S,k))),i}if(o){a=e[r-1],h=e[0],c=e[1];var u=this.controlPoints(a,h,c);n=u[1],s=u[0]}else{var f=this.tangent(a,h,S,k);n=this.firstControlPoint(f,a,h,S,k)}for(var d=n,y=0;y<=r-3;y++)if(this.removeDuplicates(y,e),y+3<=(r=e.length)){a=e[y],h=e[y+1],c=e[y+2];var v=this.controlPoints(a,h,c);Kr(i).controlOut(d),d=v[1];var g=v[0];i.push(new p.Segment(h,g))}if(o){a=e[r-2],h=e[r-1],c=e[0];var m=this.controlPoints(a,h,c);Kr(i).controlOut(d),i.push(new p.Segment(h,m[0])),Kr(i).controlOut(m[1]),i.push(new p.Segment(c,s))}else{var x=this.tangent(h,c,S,k);Kr(i).controlOut(d),i.push(new p.Segment(c,this.secondControlPoint(x,h,c,S,k)))}return i},e.prototype.removeDuplicates=function(t,e){for(;e[t+1]&&(e[t].equals(e[t+1])||e[t+1].equals(e[t+2]));)e.splice(t+1,1)},e.prototype.invertAxis=function(t,e,i){var o=!1;if(t.x===e.x)o=!0;else if(e.x===i.x)(e.y<i.y&&t.y<=e.y||i.y<e.y&&e.y<=t.y)&&(o=!0);else{var r=this.lineFunction(t,e),n=this.calculateFunction(r,i.x);t.y<=e.y&&i.y<=n||e.y<=t.y&&i.y>=n||(o=!0)}return o},e.prototype.isLine=function(t,e,i){var o=this.lineFunction(t,e),r=this.calculateFunction(o,i.x);return t.x===e.x&&e.x===i.x||tn(r,1)===tn(i.y,1)},e.prototype.lineFunction=function(t,e){var i=(e.y-t.y)/(e.x-t.x);return[t.y-i*t.x,i]},e.prototype.controlPoints=function(t,e,i){var o,r=S,n=k,s=!1,a=!1;if(this.isLine(t,e,i))o=this.tangent(t,e,S,k);else{var p={x:this.isMonotonicByField(t,e,i,S),y:this.isMonotonicByField(t,e,i,k)};if(p.x&&p.y)o=this.tangent(t,i,S,k),s=!0;else if(this.invertAxis(t,e,i)&&(r=k,n=S),p[r])o=0;else o=.01*(i[n]<t[n]&&t[n]<=e[n]||t[n]<i[n]&&e[n]<=t[n]?sa((i[n]-t[n])*(e[r]-t[r])):-sa((i[r]-t[r])*(e[n]-t[n]))),a=!0}var h=this.secondControlPoint(o,t,e,r,n);if(a){var c=r;r=n,n=c}var l=this.firstControlPoint(o,e,i,r,n);return s&&(this.restrictControlPoint(t,e,h,o),this.restrictControlPoint(e,i,l,o)),[h,l]},e.prototype.restrictControlPoint=function(t,e,i,o){t.y<e.y?e.y<i.y?(i.x=t.x+(e.y-t.y)/o,i.y=e.y):i.y<t.y&&(i.x=e.x-(e.y-t.y)/o,i.y=t.y):i.y<e.y?(i.x=t.x-(t.y-e.y)/o,i.y=e.y):t.y<i.y&&(i.x=e.x+(t.y-e.y)/o,i.y=t.y)},e.prototype.tangent=function(t,e,i,o){var r,n=e[i]-t[i],s=e[o]-t[o];return r=0===n?0:s/n,r},e.prototype.isMonotonicByField=function(t,e,i,o){return i[o]>e[o]&&e[o]>t[o]||i[o]<e[o]&&e[o]<t[o]},e.prototype.firstControlPoint=function(t,e,i,o,r){var n=e[o],s=.333*(i[o]-n);return this.point(n+s,e[r]+s*t,o,r)},e.prototype.secondControlPoint=function(t,e,i,o,r){var n=e[o],s=i[o],a=.333*(s-n);return this.point(s-a,i[r]-a*t,o,r)},e.prototype.point=function(t,e,i,o){var r=new p.Point;return r[i]=t,r[o]=e,r},e.prototype.calculateFunction=function(t,e){for(var i=t.length,o=0,r=0;r<i;r++)o+=Math.pow(e,r)*t[r];return o},e}(O),pa=function(t){function e(e){t.call(this),this._axis=e,this.options=e.options}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.value=function(t){var e=this._axis,i=e.getCategory?e.getCategory(t):e.getValue(t);return i},e.prototype.slot=function(t,e,i){return void 0===i&&(i=!0),this._axis.slot(t,e,i)},e.prototype.range=function(){return this._axis.range()},e.prototype.valueRange=function(){return this._axis.valueRange()},e}(O);function ha(t,e){for(var i=0;i<e.length;i++)if(e[i].options.name===t)return e[i].prepareUserOptions(),new pa(e[i])}var ca=function(t){this.visual=t.visual,this.chartsVisual=t.chartContainer.visual,this._pane=t};ca.prototype.findAxisByName=function(t){return ha(t,this._pane.axes)};var la=ca,ua=function(t){function e(e){t.call(this),this._plotArea=e,this.visual=e.visual,this.backgroundVisual=e._bgVisual}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(O);function fa(t){for(var e=t.length,i=0,o=0;o<e;o++){$o(t[o])&&i++}return i}var da={min:function(t){for(var e=t.length,i=m,o=0;o<e;o++){var r=t[o];$o(r)&&(i=Math.min(i,r))}return i===m?t[0]:i},max:function(t){for(var e=t.length,i=x,o=0;o<e;o++){var r=t[o];$o(r)&&(i=Math.max(i,r))}return i===x?t[0]:i},sum:function(t){for(var e=t.length,i=0,o=0;o<e;o++){var r=t[o];$o(r)&&(i+=r)}return i},sumOrNull:function(t){var e=null;return fa(t)&&(e=da.sum(t)),e},count:function(t){for(var e=t.length,i=0,o=0;o<e;o++){var r=t[o];null!==r&&Nr(r)&&i++}return i},avg:function(t){var e=fa(t),i=t[0];return e>0&&(i=da.sum(t)/e),i},first:function(t){for(var e=t.length,i=0;i<e;i++){var o=t[i];if(null!==o&&Nr(o))return o}return t[0]}},ya=da;function va(t,e){return null===e?e:Or(t)(e)}var ga=function(t){function e(){t.call(this),this._valueFields={},this._otherFields={},this._nullValue={},this._undefinedValue={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.register=function(t,e,i){void 0===e&&(e=[w]),void 0===i&&(i={});for(var o=0;o<t.length;o++){var r=t[o];this._valueFields[r]=e,this._otherFields[r]=i,this._nullValue[r]=this._makeValue(e,null),this._undefinedValue[r]=this._makeValue(e,void 0)}},e.prototype.canonicalFields=function(t){return this.valueFields(t).concat(this.otherFields(t))},e.prototype.valueFields=function(t){return this._valueFields[t.type]||[w]},e.prototype.otherFields=function(t){return this._otherFields[t.type]||[w]},e.prototype.bindPoint=function(t,e,i){var o,r,n=t.data,s=Nr(i)?i:n[e],a={valueFields:{value:s}},p=this.valueFields(t),h=this._otherFields[t.type];if(null===s)r=this._nullValue[t.type];else if(Nr(s)){if(Array.isArray(s)){var c=s.slice(p.length);r=this._bindFromArray(s,p),o=this._bindFromArray(c,h)}else if("object"==typeof s){var l=this.sourceFields(t,p),u=this.sourceFields(t,h);r=this._bindFromObject(s,p,l),o=this._bindFromObject(s,h,u)}}else r=this._undefinedValue[t.type];return Nr(r)&&(1===p.length?a.valueFields.value=r[p[0]]:a.valueFields=r),a.fields=o||{},a},e.prototype._makeValue=function(t,e){for(var i={},o=t.length,r=0;r<o;r++){i[t[r]]=e}return i},e.prototype._bindFromArray=function(t,e){var i={};if(e)for(var o=Math.min(e.length,t.length),r=0;r<o;r++)i[e[r]]=t[r];return i},e.prototype._bindFromObject=function(t,e,i){void 0===i&&(i=e);var o={};if(e)for(var r=e.length,n=0;n<r;n++){var s=e[n],a=i[n];null!==a&&(o[s]=va(a,t))}return o},e.prototype.sourceFields=function(t,e){var i=[];if(e)for(var o=e.length,r=0;r<o;r++){var n=e[r],s=n===w?"field":n+"Field";i.push(null!==t[s]?t[s]||n:null)}return i},e}(O);ga.current=new ga;var ma=ga,xa=/percent(?:\w*)\((\d+)\)/,ba=new RegExp("^stddev(?:\\((\\d+(?:\\.\\d+)?)\\))?$"),_a=function(t){function e(e,i,o){t.call(this),this.initGlobalRanges(e,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initGlobalRanges=function(t,e,i){var o=e.data,r=ba.exec(t);if(r){this.valueGetter=this.createValueGetter(e,i);var n=this.getAverage(o),s=this.getStandardDeviation(o,n,!1),a=r[1]?parseFloat(r[1]):1,p={low:n.value-s*a,high:n.value+s*a};this.globalRange=function(){return p}}else if(t.indexOf&&t.indexOf("stderr")>=0){this.valueGetter=this.createValueGetter(e,i);var h=this.getStandardError(o,this.getAverage(o));this.globalRange=function(t){return{low:t-h,high:t+h}}}},e.prototype.createValueGetter=function(t,e){var i,o=t.data,r=ma.current,n=r.valueFields(t),s=Nr(o[0])?o[0]:{};if(C(s))i=Or("["+(e?n.indexOf(e):0)+"]");else if($o(s))i=Or();else if("object"==typeof s){i=Or(r.sourceFields(t,n)[n.indexOf(e)])}return i},e.prototype.getErrorRange=function(t,e){var i,o,r;if(!Nr(e))return null;if(this.globalRange)return this.globalRange(t);if(C(e))i=t-e[0],o=t+e[1];else if($o(r=parseFloat(e)))i=t-r,o=t+r;else{if(!(r=xa.exec(e)))throw new Error("Invalid ErrorBar value: "+e);var n=t*(parseFloat(r[1])/100);i=t-Math.abs(n),o=t+Math.abs(n)}return{low:i,high:o}},e.prototype.getStandardError=function(t,e){return this.getStandardDeviation(t,e,!0)/Math.sqrt(e.count)},e.prototype.getStandardDeviation=function(t,e,i){for(var o=t.length,r=i?e.count-1:e.count,n=0,s=0;s<o;s++){var a=this.valueGetter(t[s]);$o(a)&&(n+=Math.pow(a-e.value,2))}return Math.sqrt(n/r)},e.prototype.getAverage=function(t){for(var e=t.length,i=0,o=0,r=0;r<e;r++){var n=this.valueGetter(t[r]);$o(n)&&(i+=n,o++)}return{value:i/o,count:o}},e}(O),wa=Si.browser||{},Aa=wa.msie?.001:0,Sa="zero",ka="bar",Ca="column",Pa="line",Ta="pie",Ma="verticalLine",Oa=[ka,Ca,"ohlc","candlestick","boxPlot","verticalBoxPlot","bullet","rangeColumn","rangeBar","waterfall","horizontalWaterfall"],Ra="DOMMouseScroll mousewheel",Ba=function(t){function e(e,i,o,r,n,s){t.call(this,s),this.low=e,this.high=i,this.isVertical=o,this.chart=r,this.series=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e,i=this.options.endCaps,o=this.isVertical,r=this.getAxis().getSlot(this.low,this.high),n=t.center(),s=this.getCapsWidth(t,o),a=o?n.x:n.y,p=a-s,h=a+s;o?(e=[new An(n.x,r.y1),new An(n.x,r.y2)],i&&e.push(new An(p,r.y1),new An(h,r.y1),new An(p,r.y2),new An(h,r.y2)),this.box=new kn(p,r.y1,h,r.y2)):(e=[new An(r.x1,n.y),new An(r.x2,n.y)],i&&e.push(new An(r.x1,p),new An(r.x1,h),new An(r.x2,p),new An(r.x2,h)),this.box=new kn(r.x1,p,r.x2,h)),this.linePoints=e},e.prototype.getCapsWidth=function(t,e){var i=e?t.width():t.height();return Math.min(Math.floor(i/2),4)||4},e.prototype.createVisual=function(){var t=this,e=this.options,i=e.visual;i?this.visual=i({low:this.low,high:this.high,rect:this.box.toRect(),sender:this.getSender(),options:{endCaps:e.endCaps,color:e.color,line:e.line},createVisual:function(){t.createDefaultVisual();var e=t.visual;return delete t.visual,e}}):this.createDefaultVisual()},e.prototype.createDefaultVisual=function(){var e=this.options,i=this.linePoints,o={stroke:{color:e.color,width:e.line.width,dashType:e.line.dashType}};t.prototype.createVisual.call(this);for(var r=0;r<i.length;r+=2){var n=new a.Path(o).moveTo(i[r].x,i[r].y).lineTo(i[r+1].x,i[r+1].y);Ko(n),this.visual.append(n)}},e}(Bn);sn(Ba,{animation:{type:"fadeIn",delay:600},endCaps:!0,line:{width:2},zIndex:1});var ja=Ba,Ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getAxis=function(){return this.chart.seriesValueAxis(this.series)},e}(ja);function La(t,e,i,o){void 0===i&&(i={}),void 0===o&&(o=!1);var r=i.defaults=i.defaults||{},n=i.depth=i.depth||0,s=!1;if(i.excluded=i.excluded||[],n>5)return null;for(var a in t)if(!Lr(a,i.excluded)&&t.hasOwnProperty(a)){var p=t[a];er(p)?(s=!0,o||(t[a]=on(p(e),r[a]))):rr(p)&&(o||(i.defaults=r[a]),i.depth++,s=La(p,e,i,o)||s,i.depth--)}return s}function za(t){for(var e=t.length,i=0,o=0;o<e;o++)i=Math.max(i,t[o].data.length);return i}var Ea=function(t){function e(e,i){t.call(this,i),this.plotArea=e,this.chartService=e.chartService,this.categoryAxis=e.seriesCategoryAxis(i.series[0]),this.valueAxisRanges={},this.points=[],this.categoryPoints=[],this.seriesPoints=[],this.seriesOptions=[],this._evalSeries=[],this.render()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this.traverseDataPoints(this.addValue.bind(this))},e.prototype.pointOptions=function(t,e){var i=this.seriesOptions[e];if(!i){var o=this.pointType().prototype.defaults;this.seriesOptions[e]=i=or({},o,{vertical:!this.options.invertAxes},t)}return i},e.prototype.plotValue=function(t){if(!t)return 0;if(this.options.isStacked100&&$o(t.value)){for(var e=t.categoryIx,i=this.categoryPoints[e],o=[],r=0,n=0;n<i.length;n++){var s=i[n];if(s){var a=t.series.stack,p=s.series.stack;if(a&&p&&a.group!==p.group)continue;$o(s.value)&&(r+=Math.abs(s.value),o.push(Math.abs(s.value)))}}if(r>0)return t.value/r}return t.value},e.prototype.plotRange=function(t,e){void 0===e&&(e=0);var i=this.categoryPoints[t.categoryIx];if(this.options.isStacked){for(var o=this.plotValue(t),r=o>=0,n=e,s=!1,a=0;a<i.length;a++){var p=i[a];if(t===p)break;var h=t.series.stack,c=p.series.stack;if(h&&c){if("string"==typeof h&&h!==c)continue;if(h.group&&h.group!==c.group)continue}var l=this.plotValue(p);(l>=0&&r||l<0&&!r)&&(n+=l,o+=l,s=!0,this.options.isStacked100&&(o=Math.min(o,1)))}return s&&(n-=e),[n,o]}var u=t.series,f=this.seriesValueAxis(u),d=this.categoryAxisCrossingValue(f);return[d,tr(t.value)?t.value:d]},e.prototype.stackLimits=function(t,e){for(var i=m,o=x,r=0;r<this.categoryPoints.length;r++){var n=this.categoryPoints[r];if(n)for(var s=0;s<n.length;s++){var a=n[s];if(a&&(a.series.stack===e||a.series.axis===t)){var p=this.plotRange(a,0)[1];Nr(p)&&isFinite(p)&&(o=Math.max(o,p),i=Math.min(i,p))}}}return{min:i,max:o}},e.prototype.updateStackRange=function(){var t=this.options,e=t.isStacked,i=t.series,o={};if(e)for(var r=0;r<i.length;r++){var n=i[r],s=n.axis,a=s+n.stack,p=o[a];if(!p){p=this.stackLimits(s,n.stack);var h=this.errorTotals;h&&(h.negative.length&&(p.min=Math.min(p.min,an(h.negative).min)),h.positive.length&&(p.max=Math.max(p.max,an(h.positive).max))),p.min!==m||p.max!==x?o[a]=p:p=null}p&&(this.valueAxisRanges[s]=p)}},e.prototype.addErrorBar=function(t,e,i){var o,r=t.value,n=t.series,s=t.seriesIx,a=t.options.errorBars,p=e.fields.errorLow,h=e.fields.errorHigh;$o(p)&&$o(h)?o={low:p,high:h}:a&&Nr(a.value)&&(this.seriesErrorRanges=this.seriesErrorRanges||[],this.seriesErrorRanges[s]=this.seriesErrorRanges[s]||new _a(a.value,n,w),o=this.seriesErrorRanges[s].getErrorRange(r,a.value)),o&&(t.low=o.low,t.high=o.high,this.addPointErrorBar(t,i))},e.prototype.addPointErrorBar=function(t,e){var i=!this.options.invertAxes,o=t.options.errorBars,r=t.series,n=t.low,s=t.high;if(this.options.isStacked){var a=this.stackedErrorRange(t,e);n=a.low,s=a.high}else{var p={categoryIx:e,series:r};this.updateRange({value:n},p),this.updateRange({value:s},p)}var h=new Ia(n,s,i,this,r,o);t.errorBars=[h],t.append(h)},e.prototype.stackedErrorRange=function(t,e){var i=this.plotRange(t,0)[1]-t.value,o=t.low+i,r=t.high+i;return this.errorTotals=this.errorTotals||{positive:[],negative:[]},o<0&&(this.errorTotals.negative[e]=Math.min(this.errorTotals.negative[e]||0,o)),r>0&&(this.errorTotals.positive[e]=Math.max(this.errorTotals.positive[e]||0,r)),{low:o,high:r}},e.prototype.addValue=function(t,e){var i=e.categoryIx,o=e.series,r=e.seriesIx,n=this.categoryPoints[i];n||(this.categoryPoints[i]=n=[]);var s=this.seriesPoints[r];s||(this.seriesPoints[r]=s=[]);var a=this.createPoint(t,e);a&&(Object.assign(a,e),a.owner=this,a.noteText=t.fields.noteText,Nr(a.dataItem)||(a.dataItem=o.data[i]),this.addErrorBar(a,t,i)),this.points.push(a),s.push(a),n.push(a),this.updateRange(t.valueFields,e)},e.prototype.evalPointOptions=function(t,e,i,o,r,n){var s={defaults:r._defaults,excluded:["data","aggregate","_events","tooltip","content","template","visual","toggle","_outOfRangeMinPoint","_outOfRangeMaxPoint"]},a=this._evalSeries[n];Nr(a)||(this._evalSeries[n]=a=La(t,{},s,!0));var p=t;return a&&La(p=or({},p),{value:e,category:i,index:o,series:r,dataItem:r.data[o]},s),p},e.prototype.updateRange=function(t,e){var i=e.series.axis,o=t.value,r=this.valueAxisRanges[i];isFinite(o)&&null!==o&&((r=this.valueAxisRanges[i]=r||{min:m,max:x}).min=Math.min(r.min,o),r.max=Math.max(r.max,o))},e.prototype.seriesValueAxis=function(t){var e=this.plotArea,i=t.axis,o=i?e.namedValueAxes[i]:e.valueAxis;if(!o)throw new Error("Unable to locate value axis with name "+i);return o},e.prototype.reflow=function(t){var e=this,i=this.categorySlots=[],o=this.points,r=this.categoryAxis,n=0;this.traverseDataPoints((function(t,s){var a=s.categoryIx,p=s.series,h=e.seriesValueAxis(p),c=o[n++],l=i[a];if(l||(i[a]=l=e.categorySlot(r,a,h)),c){var u=e.plotRange(c,h.startValue()),f=e.valueSlot(h,u);if(f){var d=e.pointSlot(l,f);c.aboveAxis=e.aboveAxis(c,h),c.stackValue=u[1],e.options.isStacked100&&(c.percentage=e.plotValue(c)),e.reflowPoint(c,d)}else c.visible=!1}})),this.reflowCategories(i),!this.options.clip&&this.options.limitPoints&&this.points.length&&this.limitPoints(),this.box=t},e.prototype.valueSlot=function(t,e){return t.getSlot(e[0],e[1],!this.options.clip)},e.prototype.limitPoints=function(){for(var t=this.categoryPoints,e=t[0].concat(Kr(t)),i=0;i<e.length;i++)e[i]&&this.limitPoint(e[i])},e.prototype.limitPoint=function(t){var e=this.categoryAxis.limitSlot(t.box);e.equals(t.box)||t.reflow(e)},e.prototype.aboveAxis=function(t,e){var i=this.categoryAxisCrossingValue(e),o=t.value;return e.options.reverse?o<i:o>=i},e.prototype.categoryAxisCrossingValue=function(t){var e=this.categoryAxis,i=t.options;return[].concat(i.axisCrossingValues||i.axisCrossingValue)[e.axisIndex||0]||0},e.prototype.reflowPoint=function(t,e){t.reflow(e)},e.prototype.reflowCategories=function(){},e.prototype.pointSlot=function(t,e){var i=this.options.invertAxes,o=i?e:t,r=i?t:e;return new kn(o.x1,r.y1,o.x2,r.y2)},e.prototype.categorySlot=function(t,e){return t.getSlot(e)},e.prototype.traverseDataPoints=function(t){for(var e=this.options.series,i=za(e),o=e.length,r=0;r<o;r++)this._outOfRangeCallback(e[r],"_outOfRangeMinPoint",r,t);for(var n=0;n<i;n++)for(var s=0;s<o;s++){var a=e[s],p=this.categoryAxis.categoryAt(n);t(this._bindPoint(a,s,n),{category:p,categoryIx:n,categoriesCount:i,series:a,seriesIx:s})}for(var h=0;h<o;h++)this._outOfRangeCallback(e[h],"_outOfRangeMaxPoint",h,t)},e.prototype._outOfRangeCallback=function(t,e,i,o){var r=t[e];if(r){var n=r.categoryIx;o(this._bindPoint(t,i,n,r.item),{category:r.category,categoryIx:n,series:t,seriesIx:i,dataItem:r.item})}},e.prototype._bindPoint=function(t,e,i,o){this._bindCache||(this._bindCache=[]);var r=this._bindCache[e];r||(r=this._bindCache[e]=[]);var n=r[i];return n||(n=r[i]=ma.current.bindPoint(t,i,o)),n},e.prototype.formatPointValue=function(t,e){return null===t.value?"":this.chartService.format.auto(e,t.value)},e.prototype.pointValue=function(t){return t.valueFields.value},e}(Bn);sn(Ea,{series:[],invertAxes:!1,isStacked:!1,clip:!0,limitPoints:!0});var Va=Ea,Fa={click:function(t,e){return t.trigger("seriesClick",this.eventArgs(e))},hover:function(t,e){return t.trigger("seriesHover",this.eventArgs(e))},over:function(t,e){return t.trigger("seriesOver",this.eventArgs(e))},out:function(t,e){return t.trigger("seriesLeave",this.eventArgs(e))},eventArgs:function(t){return{value:this.value,percentage:this.percentage,stackValue:this.stackValue,category:this.category,series:this.series,dataItem:this.dataItem,runningTotal:this.runningTotal,total:this.total,element:Yr(t),originalEvent:t,point:this}}},Da={createNote:function(){var t=this.options.notes,e=this.noteText||t.label.text;!1!==t.visible&&Nr(e)&&null!==e&&(this.note=new ts({value:this.value,text:e,dataItem:this.dataItem,category:this.category,series:this.series},this.options.notes,this.owner.chartService),this.append(this.note))}},Ua=function(t){function e(e,i){t.call(this),this.value=e,this.options=i,this.aboveAxis=on(this.options.aboveAxis,!0),this.tooltipTracking=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=this.options,e=t.markers,i=t.labels;if(!this._rendered){if(this._rendered=!0,e.visible&&e.size&&(this.marker=this.createMarker(),this.append(this.marker)),i.visible){var o=Pr(i),r=this.pointData(),n=this.value;o?n=o(r):i.format&&(n=this.formatValue(i.format)),this.label=new Yn(n,or({align:f,vAlign:f,margin:{left:5,right:5},zIndex:on(i.zIndex,this.series.zIndex)},i),r),this.append(this.label)}this.createNote(),this.errorBar&&this.append(this.errorBar)}},e.prototype.markerBorder=function(){var t=this.options.markers,e=t.background,i=or({color:this.color},t.border);return Nr(i.color)||(i.color=new dn(e).brightness(.8).toHex()),i},e.prototype.createVisual=function(){},e.prototype.createMarker=function(){var t=this.options.markers;return new zn({type:t.type,width:t.size,height:t.size,rotation:t.rotation,background:t.background,border:this.markerBorder(),opacity:this.series.opacity||t.opacity,zIndex:on(t.zIndex,this.series.zIndex),animation:t.animation,visual:t.visual},{dataItem:this.dataItem,value:this.value,series:this.series,category:this.category})},e.prototype.markerBox=function(){return this.marker||(this.marker=this.createMarker(),this.marker.reflow(this._childBox)),this.marker.box},e.prototype.reflow=function(t){var e=this.options,i=this.aboveAxis,o=e.vertical;this.render(),this.box=t;var r=t.clone();if(o?i?r.y1-=r.height():r.y2+=r.height():i?r.x1+=r.width():r.x2-=r.width(),this._childBox=r,this.marker&&this.marker.reflow(r),this.reflowLabel(r),this.errorBars)for(var n=0;n<this.errorBars.length;n++)this.errorBars[n].reflow(r);if(this.note){var s=this.markerBox();if(!e.markers.visible||!e.markers.size){var a=s.center();s=new kn(a.x,a.y,a.x,a.y)}this.note.reflow(s)}},e.prototype.reflowLabel=function(t){var e=this.options,i=this.label,o=e.labels.position;i&&(o="below"===(o="above"===o?_:o)?u:o,i.reflow(t),i.box.alignTo(this.markerBox(),o),i.reflow(i.box))},e.prototype.createHighlight=function(){var t=this.options.highlight.markers,e=this.markerBorder().color,i=this.options.markers,o=i.size+(i.border.width||0)+(t.border.width||0),r=new zn({type:i.type,width:o,height:o,rotation:i.rotation,background:t.color||e,border:{color:t.border.color,width:t.border.width,opacity:on(t.border.opacity,1)},opacity:on(t.opacity,1)});return r.reflow(this._childBox),r.getElement()},e.prototype.highlightVisual=function(){return(this.marker||{}).visual},e.prototype.highlightVisualArgs=function(){var t,e,i=this.marker;if(i)e=i.paddingBox.toRect(),t=i.visual;else{var o=this.options.markers.size,r=o/2,n=this.box.center();e=new p.Rect([n.x-r,n.y-r],[o,o])}return{options:this.options,rect:e,visual:t}},e.prototype.tooltipAnchor=function(){var t=this.markerBox(),e=this.owner.pane.clipBox();if(!e||e.overlaps(t)){var i,o,r=t.x2+5;return this.aboveAxis?(i=t.y1,o=u):(i=t.y2,o=_),{point:new An(r,i),align:{horizontal:"left",vertical:o}}}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e.prototype.overlapsBox=function(t){return this.markerBox().overlaps(t)},e.prototype.unclipElements=function(){this.label&&(this.label.options.noclip=!0),this.note&&(this.note.options.noclip=!0)},e.prototype.pointData=function(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,series:this.series}},e}(Bn);Ua.prototype.defaults={vertical:!0,markers:{visible:!0,background:A,size:8,type:d,border:{width:2},opacity:1},labels:{visible:!1,position:"above",margin:hr(3),padding:hr(4),animation:{type:"fadeIn",delay:600}},notes:{label:{}},highlight:{markers:{border:{color:"#fff",width:2}},zIndex:100},errorBars:{line:{width:1}}},or(Ua.prototype,Fa),or(Ua.prototype,Da);var Ha=Ua,Ga=function(t){function e(e,i,o){t.call(this),this.linePoints=e,this.series=i,this.seriesIx=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.points=function(){return this.toGeometryPoints(this.linePoints)},e.prototype.toGeometryPoints=function(t){for(var e=[],i=0,o=t.length;i<o;i++)t[i]&&!1!==t[i].visible&&e.push(t[i]._childBox.toRect().center());return e},e.prototype.createVisual=function(){var t=this,e=this.series.visual;e?(this.visual=e({points:this.toGeometryPoints(this.linePoints),series:this.series,sender:this.getSender(),createVisual:function(){return t.segmentVisual(),t.visual}}),this.visual&&!Nr(this.visual.options.zIndex)&&(this.visual.options.zIndex=this.series.zIndex)):this.segmentVisual()},e.prototype.segmentVisual=function(){var t=this.options,e=this.series,i=e.color,o=e._defaults;er(i)&&o&&(i=o.color);var r=a.Path.fromPoints(this.points(),{stroke:{color:i,width:e.width,opacity:e.opacity,dashType:e.dashType},zIndex:e.zIndex});t.closed&&r.close(),this.visual=r},e.prototype.aliasFor=function(t,e){return this.parent.getNearestPoint(e.x,e.y,this.seriesIx)},e}(Bn);sn(Ga,{closed:!1});var Na=Ga;function Wa(t,e,i,o,r){var n=t.box,s=new p.Point;return s[e]=n[e+i],s[o]=n[o+r],s}var qa={calculateStepPoints:function(t){for(var e=this.parent.plotArea.seriesCategoryAxis(this.series).options,i=e.justified,o=e.vertical,r=e.reverse,n=o?S:k,s=o?k:S,a=r?2:1,h=a,c=Wa(t[0],n,a,s,h),l=[c],u=1;u<t.length;u++){var f=Wa(t[u],n,a,s,h);if(c[n]!==f[n]){var d=new p.Point;d[n]=c[n],d[s]=f[s],l.push(d,f)}c=f}return i?c!==Kr(l)&&l.push(c):l.push(Wa(Kr(t),n,a,s,r?1:2)),l}},Xa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.points=function(){return this.calculateStepPoints(this.linePoints)},e}(Na);or(Xa.prototype,qa);var Ya=Xa,Za=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.segmentVisual=function(){var t=this.series,e=t._defaults,i=t.color;er(i)&&e&&(i=e.color);var o=new aa(this.options.closed).process(this.points()),r=new a.Path({stroke:{color:i,width:t.width,opacity:t.opacity,dashType:t.dashType},zIndex:t.zIndex});r.segments.push.apply(r.segments,o),this.visual=r},e}(Na),Ka={renderSegments:function(){var t,e=this.options,i=this.seriesPoints,o=e.series,r=i.length;this._segments=[];for(var n=0;n<r;n++){for(var s=o[n],a=this.sortPoints(i[n]),p=a.length,h=[],c=0;c<p;c++){var l=a[c];l?h.push(l):"interpolate"!==this.seriesMissingValues(s)&&(h.length>1&&(t=this.createSegment(h,s,n,t),this._addSegment(t)),h=[])}h.length>1&&(t=this.createSegment(h,s,n,t),this._addSegment(t))}this.children.unshift.apply(this.children,this._segments)},_addSegment:function(t){this._segments.push(t),t.parent=this},sortPoints:function(t){return t},seriesMissingValues:function(t){var e=t.missingValues;return!e&&this.options.isStacked?Sa:e||"interpolate"},getNearestPoint:function(t,e,i){for(var o,r=new An(t,e),n=this.seriesPoints[i],s=m,a=0;a<n.length;a++){var p=n[a];if(p&&Nr(p.value)&&null!==p.value&&!1!==p.visible){var h=p.box.center().distanceTo(r);h<s&&(o=p,s=h)}}return o}},Ja=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){this._setEnd(this.options.box.x1)},e.prototype.step=function(t){var e=this.options.box;this._setEnd(zr(e.x1,e.x2,t))},e.prototype._setEnd=function(t){var e=this.element,i=e.segments,o=i[1].anchor(),r=i[2].anchor();e.suspend(),o.setX(t),e.resume(),r.setX(t)},e}(a.Animation);sn(Ja,{duration:600}),a.AnimationFactory.current.register("clip",Ja);var $a=Ja;function Qa(t){for(var e=0;e<t.length;e++)if(Nr(t[e].zIndex))return!0}var tp={createAnimation:function(){var t=this.getRoot();if(t&&!1!==(t.options||{}).transitions){var e=t.size(),i=a.Path.fromRect(e.toRect());this.visual.clip(i),this.animation=new $a(i,{box:e}),Qa(this.options.series)&&this._setChildrenAnimation(i)}},_setChildrenAnimation:function(t){for(var e=this.animationPoints(),i=0;i<e.length;i++){var o=e[i];o&&o.visual&&Nr(o.visual.options.zIndex)&&o.visual.clip(t)}}},ep=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){t.prototype.render.call(this),this.updateStackRange(),this.renderSegments()},e.prototype.pointType=function(){return Ha},e.prototype.createPoint=function(t,e){var i=e.categoryIx,o=e.category,r=e.series,n=e.seriesIx,s=this.seriesMissingValues(r),a=t.valueFields.value;if(!Nr(a)||null===a){if(s!==Sa)return null;a=0}var p=this.pointOptions(r,n);p=this.evalPointOptions(p,a,o,i,r,n);var h=t.fields.color||r.color;er(r.color)&&(h=p.color);var c=new Ha(a,p);return c.color=h,this.append(c),c},e.prototype.plotRange=function(t){var e=this.plotValue(t);if(this.options.isStacked)for(var i=t.categoryIx,o=this.categoryPoints[i],r=0;r<o.length;r++){var n=o[r];if(t===n)break;e+=this.plotValue(n),this.options.isStacked100&&(e=Math.min(e,1))}return[e,e]},e.prototype.createSegment=function(t,e,i){var o=e.style;return new("step"===o?Ya:"smooth"===o?Za:Na)(t,e,i)},e.prototype.animationPoints=function(){for(var t=this.points,e=[],i=0;i<t.length;i++)e.push((t[i]||{}).marker);return e.concat(this._segments)},e.prototype.supportsPointInactiveOpacity=function(){return!1},e}(Va);or(ep.prototype,Ka,tp);var ip=ep,op=function(t){function e(e,i,o,r,n){t.call(this,e,i,o),this.prevSegment=r,this.stackPoints=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createVisual=function(){var t=this.series,e=t._defaults,i=t.line||{},o=t.color;er(o)&&e&&(o=e.color),this.visual=new a.Group({zIndex:t.zIndex}),this.createFill({fill:{color:o,opacity:t.opacity},stroke:null}),i.width>0&&!1!==i.visible&&this.createStroke({stroke:or({color:o,opacity:t.opacity,lineCap:"butt"},i)})},e.prototype.strokeSegments=function(){var t=this._strokeSegments;return t||(t=this._strokeSegments=this.createStrokeSegments()),t},e.prototype.createStrokeSegments=function(){return this.segmentsFromPoints(this.points())},e.prototype.stackSegments=function(){return this.prevSegment?this.prevSegment.createStackSegments(this.stackPoints):this.createStackSegments(this.stackPoints)},e.prototype.createStackSegments=function(t){return this.segmentsFromPoints(this.toGeometryPoints(t)).reverse()},e.prototype.segmentsFromPoints=function(t){return t.map((function(t){return new p.Segment(t)}))},e.prototype.createStroke=function(t){var e=new a.Path(t);e.segments.push.apply(e.segments,this.strokeSegments()),this.visual.append(e)},e.prototype.hasStackSegment=function(){return this.prevSegment||this.stackPoints&&this.stackPoints.length},e.prototype.createFill=function(t){var e=this.strokeSegments(),i=e.slice(0),o=this.hasStackSegment();if(o){var r=this.stackSegments();Hr(i,r)}var n=new a.Path(t);n.segments.push.apply(n.segments,i),!o&&e.length>1&&this.fillToAxes(n),this.visual.append(n)},e.prototype.fillToAxes=function(t){var e=this.parent,i=e.options.invertAxes,o=e.seriesValueAxis(this.series),r=e.categoryAxisCrossingValue(o),n=o.getSlot(r,r,!0),s=this.strokeSegments(),a=s[0].anchor(),p=Kr(s).anchor(),h=i?n.x1:n.y1;i?t.lineTo(h,p.y).lineTo(h,a.y):t.lineTo(p.x,h).lineTo(a.x,h)},e}(Na),rp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createStrokeSegments=function(){return this.segmentsFromPoints(this.calculateStepPoints(this.linePoints))},e.prototype.createStackSegments=function(t){return this.segmentsFromPoints(this.calculateStepPoints(t)).reverse()},e}(op);or(rp.prototype,qa);var np=rp,sp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createStrokeSegments=function(){var t=new aa(this.options.closed),e=this.points();return t.process(e)},e.prototype.createStackSegments=function(){for(var t=this.strokeSegments(),e=[],i=t.length-1;i>=0;i--){var o=t[i];e.push(new p.Segment(o.anchor(),o.controlOut(),o.controlIn()))}return e},e}(op),ap=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createSegment=function(t,e,i,o){var r,n,s=this.options.isStacked,a=(e.line||{}).style;s&&i>0&&o&&("gap"!==this.seriesMissingValues(e)?(n=o.linePoints,r=o):n=this._gapStackPoints(t,i,a));return new("step"===a?np:"smooth"===a?sp:op)(t,e,i,r,n)},e.prototype.reflow=function(e){t.prototype.reflow.call(this,e);var i=this._stackPoints;if(i)for(var o=0;o<i.length;o++){var r=i[o],n=this.categoryAxis.getSlot(r.categoryIx);r.reflow(n)}},e.prototype._gapStackPoints=function(t,e,i){var o=this.seriesPoints,r=t[0].categoryIx,n=t.length;r<0&&(r=0,n--);var s=r+n,a=this.seriesOptions[0]._outOfRangeMinPoint?1:0,p=[];this._stackPoints=this._stackPoints||[];for(var h=r;h<s;h++){var c=h+a,l=e,u=void 0;do{u=o[--l][c]}while(l>0&&!u);if(u)"step"!==i&&h>r&&!o[l][c-1]&&p.push(this._previousSegmentPoint(h,c,c-1,l)),p.push(u),"step"!==i&&h+1<s&&!o[l][c+1]&&p.push(this._previousSegmentPoint(h,c,c+1,l));else{var f=this._createGapStackPoint(h);this._stackPoints.push(f),p.push(f)}}return p},e.prototype._previousSegmentPoint=function(t,e,i,o){for(var r,n=this.seriesPoints,s=o;s>0&&!r;)r=n[--s][i];return r?r=n[s][e]:(r=this._createGapStackPoint(t),this._stackPoints.push(r)),r},e.prototype._createGapStackPoint=function(t){var e=this.pointOptions({},0),i=new Ha(0,e);return i.categoryIx=t,i.series={},i},e.prototype.seriesMissingValues=function(t){return t.missingValues||Sa},e.prototype.supportsPointInactiveOpacity=function(){return!1},e}(ip),pp=function(t){function e(){t.call(this),this.axisRanges={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(t){var e=this.axisRanges;for(var i in t){var o=t[i],r=e[i];e[i]=r=r||{min:m,max:x},r.min=Math.min(r.min,o.min),r.max=Math.max(r.max,o.max)}},e.prototype.reset=function(t){this.axisRanges[t]=void 0},e.prototype.query=function(t){return this.axisRanges[t]},e}(O),hp=function(t){function e(e,i,o){t.call(this,i),this.textBox=new Yn(e,this.options,o),this.append(this.textBox)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createVisual=function(){this.textBox.options.noclip=this.options.noclip},e.prototype.reflow=function(t){var e=this.options,i=e.vertical,o=e.aboveAxis,r=this.children[0],n=r.options,s=r.box,a=r.options.padding,p=t;n.align=i?f:g,n.vAlign=i?_:f,"insideEnd"===e.position?i?(n.vAlign=_,!o&&s.height()<t.height()&&(n.vAlign=u)):n.align=o?b:g:e.position===f?(n.vAlign=f,n.align=f):"insideBase"===e.position?i?n.vAlign=o?u:_:n.align=o?g:b:"outsideEnd"===e.position&&(i?p=o?new kn(t.x1,t.y1-s.height(),t.x2,t.y1):new kn(t.x1,t.y2,t.x2,t.y2+s.height()):(n.align=f,p=o?new kn(t.x2,t.y1,t.x2+s.width(),t.y2):new kn(t.x1-s.width(),t.y1,t.x1,t.y2))),e.rotation||(i?a.left=a.right=(p.width()-r.contentBox.width())/2:a.top=a.bottom=(p.height()-r.contentBox.height())/2),r.reflow(p)},e.prototype.alignToClipBox=function(t){var e=this.options.vertical?k:S,i=e+"1",o=e+"2",r=this.children[0],n=this.parent.box;if(n[i]<t[i]||t[o]<n[o]){var s=r.paddingBox.clone();s[i]=Math.max(n[i],t[i]),s[o]=Math.min(n[o],t[o]),this.reflow(s)}},e}(Bn);sn(hp,{position:"outsideEnd",margin:hr(3),padding:hr(4),color:l,background:"",border:{width:1,color:""},aboveAxis:!0,vertical:!1,animation:{type:"fadeIn",delay:600},zIndex:2});var cp=hp;function lp(t){var e=t.overlay;return e&&e.gradient&&"none"!==e.gradient}var up=function(t){function e(e,i){t.call(this),this.options=i,this.color=i.color||A,this.aboveAxis=on(this.options.aboveAxis,!0),this.value=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this._rendered||(this._rendered=!0,this.createLabel(),this.createNote(),this.errorBar&&this.append(this.errorBar))},e.prototype.createLabel=function(){var t=this.options,e=t.labels;if(e.visible){var i,o=this.pointData(),r=Pr(e);i=r?r(o):this.formatValue(e.format),this.label=new cp(i,or({vertical:t.vertical},e),o),this.append(this.label)}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e.prototype.reflow=function(t){this.render();var e=this.label;if(this.box=t,e&&(e.options.aboveAxis=this.aboveAxis,e.reflow(t)),this.note&&this.note.reflow(t),this.errorBars)for(var i=0;i<this.errorBars.length;i++)this.errorBars[i].reflow(t)},e.prototype.createVisual=function(){var e=this,i=this.box,o=this.options,r=o.visual;if(!1!==this.visible)if(t.prototype.createVisual.call(this),r){var n=this.rectVisual=r({category:this.category,dataItem:this.dataItem,value:this.value,sender:this.getSender(),series:this.series,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,rect:i.toRect(),createVisual:function(){var t=new a.Group;return e.createRect(t),t},options:o});n&&this.visual.append(n)}else i.width()>0&&i.height()>0&&this.createRect(this.visual)},e.prototype.createRect=function(t){var e=this.options,i=e.border,o=Nr(i.opacity)?i.opacity:e.opacity,r=this.box.toRect();r.size.width=Math.round(r.size.width);var n=this.rectVisual=a.Path.fromRect(r,{fill:{color:this.color,opacity:e.opacity},stroke:{color:this.getBorderColor(),width:i.width,opacity:o,dashType:i.dashType}}),s=this.box.width(),p=this.box.height();if((e.vertical?s:p)>6&&(Ko(n),(s<1||p<1)&&(n.options.stroke.lineJoin="round")),t.append(n),lp(e)){var h=this.createGradientOverlay(n,{baseColor:this.color},or({end:e.vertical?void 0:[0,1]},e.overlay));t.append(h)}},e.prototype.createHighlight=function(t){return Ko(a.Path.fromRect(this.box.toRect(),t))},e.prototype.highlightVisual=function(){return this.rectVisual},e.prototype.highlightVisualArgs=function(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}},e.prototype.getBorderColor=function(){var t=this.color,e=this.options.border,i=e._brightness||.8,o=e.color;return Nr(o)||(o=new dn(t).brightness(i).toHex()),o},e.prototype.tooltipAnchor=function(){var t,e,i=this.options,o=this.box,r=this.aboveAxis,n=this.owner.pane.clipBox()||o,s=g,a=_;if(i.vertical)t=Math.min(o.x2,n.x2)+5,r?e=Math.max(o.y1,n.y1):(e=Math.min(o.y2,n.y2),a=u);else{var p=Math.max(o.x1,n.x1),h=Math.min(o.x2,n.x2);i.isStacked?(a=u,r?(s=b,t=h):t=p,e=Math.max(o.y1,n.y1)-5):(r?t=h+5:(t=p-5,s=b),e=Math.max(o.y1,n.y1))}return{point:new An(t,e),align:{horizontal:s,vertical:a}}},e.prototype.overlapsBox=function(t){return this.box.overlaps(t)},e.prototype.pointData=function(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,series:this.series}},e}(Bn);or(up.prototype,Fa),or(up.prototype,Da),up.prototype.defaults={border:{width:1},vertical:!0,overlay:{gradient:"glass"},labels:{visible:!1,format:"{0}"},opacity:1,notes:{label:{}}};var fp=up;function dp(t,e){t.forEach(e)}function yp(t,e){for(var i=t.length,o=i-1;o>=0;o--)e(t[o],o-i-1)}var vp=function(t){function e(e){t.call(this,e),this.forEach=e.rtl?yp:dp}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.options,i=e.vertical,o=e.gap,r=e.spacing,n=this.children,s=n.length,a=i?k:S,p=s+o+r*(s-1),h=(i?t.height():t.width())/p,c=t[a+1]+h*(o/2);this.forEach(n,(function(e,i){var o=(e.box||t).clone();o[a+1]=c,o[a+2]=c+h,e.reflow(o),i<s-1&&(c+=h*r),c+=h}))},e}(Bn);sn(vp,{vertical:!1,gap:0,spacing:0});var gp=vp,mp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){for(var e=this.options.vertical?S:k,i=this.children,o=i.length,r=this.box=new kn,n=0;n<o;n++){var s=i[n];if(!1!==s.visible){var a=s.box.clone();a.snapTo(t,e),0===n&&(r=this.box=a.clone()),s.reflow(a),r.wrap(a)}}},e}(Bn);sn(mp,{vertical:!0});var xp=mp,bp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){t.prototype.render.call(this),this.updateStackRange()},e.prototype.pointType=function(){return fp},e.prototype.clusterType=function(){return gp},e.prototype.stackType=function(){return xp},e.prototype.stackLimits=function(e,i){return t.prototype.stackLimits.call(this,e,i)},e.prototype.createPoint=function(t,e){var i=e.categoryIx,o=e.category,r=e.series,n=e.seriesIx,s=this.options,a=this.children,p=s.isStacked,h=this.pointValue(t),c=this.pointOptions(r,n),l=c.labels;p&&"outsideEnd"===l.position&&(l.position="insideEnd"),c.isStacked=p;var u=t.fields.color||r.color;h<0&&c.negativeColor&&(u=c.negativeColor),c=this.evalPointOptions(c,h,o,i,r,n),er(r.color)&&(u=c.color);var f=new(this.pointType())(h,c);f.color=u;var d=a[i];d||(d=new(this.clusterType())({vertical:s.invertAxes,gap:s.gap,spacing:s.spacing,rtl:!s.invertAxes&&(this.chartService||{}).rtl}),this.append(d));p?this.getStackWrap(r,d).append(f):d.append(f);return f},e.prototype.getStackWrap=function(t,e){var i,o=t.stack,r=o&&o.group||o,n=e.children;if("string"==typeof r){for(var s=0;s<n.length;s++)if(n[s]._stackGroup===r){i=n[s];break}}else i=n[0];i||((i=new(this.stackType())({vertical:!this.options.invertAxes}))._stackGroup=r,e.append(i));return i},e.prototype.categorySlot=function(t,e,i){var o=this.options,r=t.getSlot(e),n=i.startValue();if(o.isStacked){var s=i.getSlot(n,n,!0),a=o.invertAxes?S:k;r[a+1]=r[a+2]=s[a+1]}return r},e.prototype.reflowCategories=function(t){for(var e=this.children,i=e.length,o=0;o<i;o++)e[o].reflow(t[o])},e.prototype.createAnimation=function(){this._setAnimationOptions(),t.prototype.createAnimation.call(this),Qa(this.options.series)&&this._setChildrenAnimation()},e.prototype._setChildrenAnimation=function(){for(var t=this.points,e=0;e<t.length;e++){var i=t[e],o=i.visual;o&&Nr(o.options.zIndex)&&(i.options.animation=this.options.animation,i.createAnimation())}},e.prototype._setAnimationOptions=function(){var t,e=this.options,i=e.animation||{};if(e.isStacked){var o=this.seriesValueAxis(e.series[0]);t=o.getSlot(o.startValue())}else t=this.categoryAxis.getSlot(0);i.origin=new p.Point(t.x1,t.y1),i.vertical=!e.invertAxes},e}(Va);sn(bp,{animation:{type:ka}});var _p=bp,wp=function(t){function e(e,i){t.call(this,i),this.value=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.options,i=this.value,o=this.owner.seriesValueAxis(e),r=o.getSlot(i.open,i.close),n=o.getSlot(i.low,i.high);r.x1=n.x1=t.x1,r.x2=n.x2=t.x2,this.realBody=r;var s=n.center().x,a=[];a.push([[s,n.y1],[s,r.y1]]),a.push([[s,r.y2],[s,n.y2]]),this.lines=a,this.box=n.clone().wrap(r),this._rendered||(this._rendered=!0,this.createNote()),this.reflowNote()},e.prototype.reflowNote=function(){this.note&&this.note.reflow(this.box)},e.prototype.createVisual=function(){t.prototype.createVisual.call(this),this._mainVisual=this.mainVisual(this.options),this.visual.append(this._mainVisual),this.createOverlay()},e.prototype.mainVisual=function(t){var e=new a.Group;return this.createBody(e,t),this.createLines(e,t),e},e.prototype.createBody=function(t,e){var i=a.Path.fromRect(this.realBody.toRect(),{fill:{color:this.color,opacity:e.opacity},stroke:null});e.border.width>0&&i.options.set("stroke",{color:this.getBorderColor(),width:e.border.width,dashType:e.border.dashType,opacity:on(e.border.opacity,e.opacity)}),Ko(i),t.append(i),lp(e)&&t.append(this.createGradientOverlay(i,{baseColor:this.color},or({end:e.vertical?void 0:[0,1]},e.overlay)))},e.prototype.createLines=function(t,e){this.drawLines(t,e,this.lines,e.line)},e.prototype.drawLines=function(t,e,i,o){if(i)for(var r={stroke:{color:o.color||this.color,opacity:on(o.opacity,e.opacity),width:o.width,dashType:o.dashType,lineCap:"butt"}},n=0;n<i.length;n++){var s=a.Path.fromPoints(i[n],r);Ko(s),t.append(s)}},e.prototype.getBorderColor=function(){var t=this.options.border,e=t.color;return Nr(e)||(e=new dn(this.color).brightness(t._brightness).toHex()),e},e.prototype.createOverlay=function(){var t=a.Path.fromRect(this.box.toRect(),{fill:{color:A,opacity:0},stroke:null});this.visual.append(t)},e.prototype.createHighlight=function(){var t=this.options.highlight,e=this.color;this.color=t.color||this.color;var i=this.mainVisual(or({},this.options,{line:{color:this.getBorderColor()}},t));return this.color=e,i},e.prototype.highlightVisual=function(){return this._mainVisual},e.prototype.highlightVisualArgs=function(){return{options:this.options,rect:this.box.toRect(),visual:this._mainVisual}},e.prototype.tooltipAnchor=function(){var t=this.box,e=this.owner.pane.clipBox()||t;return{point:new An(t.x2+5,Math.max(t.y1,e.y1)+5),align:{horizontal:g,vertical:_}}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e.prototype.overlapsBox=function(t){return this.box.overlaps(t)},e}(Bn);sn(wp,{vertical:!0,border:{_brightness:.8},line:{width:2},overlay:{gradient:"glass"},tooltip:{format:"<table><tr><th colspan='2'>{4:d}</th></tr><tr><td>Open:</td><td>{0:C}</td></tr><tr><td>High:</td><td>{1:C}</td></tr><tr><td>Low:</td><td>{2:C}</td></tr><tr><td>Close:</td><td>{3:C}</td></tr></table>"},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}}}),or(wp.prototype,Fa),or(wp.prototype,Da);var Ap=wp;function Sp(t){return fa(t)===t.length}var kp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflowCategories=function(t){for(var e=this.children,i=e.length,o=0;o<i;o++)e[o].reflow(t[o])},e.prototype.addValue=function(t,e){var i,o=e.categoryIx,r=e.category,n=e.series,s=e.seriesIx,a=this.children,p=this.options,h=t.valueFields,c=Sp(this.splitValue(h)),l=n.data[o],u=this.categoryPoints[o];u||(this.categoryPoints[o]=u=[]),c&&(i=this.createPoint(t,e));var f=a[o];f||(f=new gp({vertical:p.invertAxes,gap:p.gap,spacing:p.spacing,rtl:!p.invertAxes&&(this.chartService||{}).rtl}),this.append(f)),i&&(this.updateRange(h,e),f.append(i),i.categoryIx=o,i.category=r,i.series=n,i.seriesIx=s,i.owner=this,i.dataItem=l,i.noteText=t.fields.noteText),this.points.push(i),u.push(i)},e.prototype.pointType=function(){return Ap},e.prototype.createPoint=function(t,e){var i=e.categoryIx,o=e.category,r=e.series,n=e.seriesIx,s=this.pointType(),a=t.valueFields,p=or({},r),h=t.fields.color||r.color;p=this.evalPointOptions(p,a,o,i,r,n),"candlestick"===r.type&&a.open>a.close&&(h=t.fields.downColor||r.downColor||r.color),er(r.color)&&(h=p.color),p.vertical=!this.options.invertAxes;var c=new s(a,p);return c.color=h,c},e.prototype.splitValue=function(t){return[t.low,t.open,t.close,t.high]},e.prototype.updateRange=function(t,e){var i=e.series.axis,o=this.splitValue(t),r=this.valueAxisRanges[i];r=this.valueAxisRanges[i]=r||{min:m,max:x},r=this.valueAxisRanges[i]={min:Math.min.apply(Math,o.concat([r.min])),max:Math.max.apply(Math,o.concat([r.max]))}},e.prototype.formatPointValue=function(t,e){var i=t.value;return this.chartService.format.auto(e,i.open,i.high,i.low,i.close,t.category)},e.prototype.animationPoints=function(){return this.points},e}(Va);or(kp.prototype,tp);var Cp=kp,Pp=function(t){function e(e,i){t.call(this,e,i),this.createNote()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e,i,o=this.options,r=this.value,n=this.owner.seriesValueAxis(o);this.boxSlot=i=n.getSlot(r.q1,r.q3),this.realBody=i,this.reflowBoxSlot(t),this.whiskerSlot=e=n.getSlot(r.lower,r.upper),this.reflowWhiskerSlot(t);var s=n.getSlot(r.median);if(r.mean){var a=n.getSlot(r.mean);this.meanPoints=this.calcMeanPoints(t,a)}this.whiskerPoints=this.calcWhiskerPoints(i,e),this.medianPoints=this.calcMedianPoints(t,s),this.box=e.clone().wrap(i),this.reflowNote()},e.prototype.reflowBoxSlot=function(t){this.boxSlot.x1=t.x1,this.boxSlot.x2=t.x2},e.prototype.reflowWhiskerSlot=function(t){this.whiskerSlot.x1=t.x1,this.whiskerSlot.x2=t.x2},e.prototype.calcMeanPoints=function(t,e){return[[[t.x1,e.y1],[t.x2,e.y1]]]},e.prototype.calcWhiskerPoints=function(t,e){var i=e.center().x;return[[[i-5,e.y1],[i+5,e.y1],[i,e.y1],[i,t.y1]],[[i-5,e.y2],[i+5,e.y2],[i,e.y2],[i,t.y2]]]},e.prototype.calcMedianPoints=function(t,e){return[[[t.x1,e.y1],[t.x2,e.y1]]]},e.prototype.renderOutliers=function(t){for(var e=this.value,i=e.outliers||[],o=3*Math.abs(e.q3-e.q1),r=[],n=t.markers||{},s=0;s<i.length;s++){var a=i[s],p=or({},(n=a<e.q3+o&&a>e.q1-o?t.outliers:t.extremes).border);Nr(p.color)||(Nr(this.color)?p.color=this.color:p.color=new dn(n.background).brightness(.8).toHex());var h=new zn({type:n.type,width:n.size,height:n.size,rotation:n.rotation,background:n.background,border:p,opacity:n.opacity});h.value=a,r.push(h)}return this.reflowOutliers(r),r},e.prototype.reflowOutliers=function(t){for(var e=this.owner.seriesValueAxis(this.options),i=this.box.center(),o=0;o<t.length;o++){var r=t[o].value,n=e.getSlot(r);this.options.vertical?n.move(i.x):n.move(void 0,i.y),this.box=this.box.wrap(n),t[o].reflow(n)}},e.prototype.mainVisual=function(e){for(var i=t.prototype.mainVisual.call(this,e),o=this.renderOutliers(e),r=0;r<o.length;r++){var n=o[r].getElement();n&&i.append(n)}return i},e.prototype.createLines=function(t,e){this.drawLines(t,e,this.whiskerPoints,e.whiskers),this.drawLines(t,e,this.medianPoints,e.median),this.drawLines(t,e,this.meanPoints,e.mean)},e.prototype.getBorderColor=function(){return(this.options.border||{}).color?this.options.border.color:this.color?this.color:t.prototype.getBorderColor.call(this)},e}(Ap);sn(Pp,{border:{_brightness:.8},line:{width:2},median:{color:"#f6f6f6"},mean:{width:2,dashType:"dash",color:"#f6f6f6"},overlay:{gradient:"glass"},tooltip:{format:"<table><tr><th colspan='2'>{6:d}</th></tr><tr><td>Lower:</td><td>{0:C}</td></tr><tr><td>Q1:</td><td>{1:C}</td></tr><tr><td>Median:</td><td>{2:C}</td></tr><tr><td>Mean:</td><td>{5:C}</td></tr><tr><td>Q3:</td><td>{3:C}</td></tr><tr><td>Upper:</td><td>{4:C}</td></tr></table>"},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}},outliers:{visible:!0,size:8,type:"cross",background:A,border:{width:2,opacity:1},opacity:0},extremes:{visible:!0,size:8,type:d,background:A,border:{width:2,opacity:1},opacity:0}}),or(Pp.prototype,Fa);var Tp=Pp,Mp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflowBoxSlot=function(t){this.boxSlot.y1=t.y1,this.boxSlot.y2=t.y2},e.prototype.reflowWhiskerSlot=function(t){this.whiskerSlot.y1=t.y1,this.whiskerSlot.y2=t.y2},e.prototype.calcMeanPoints=function(t,e){return[[[e.x1,t.y1],[e.x1,t.y2]]]},e.prototype.calcWhiskerPoints=function(t,e){var i=e.center().y;return[[[e.x1,i-5],[e.x1,i+5],[e.x1,i],[t.x1,i]],[[e.x2,i-5],[e.x2,i+5],[e.x2,i],[t.x2,i]]]},e.prototype.calcMedianPoints=function(t,e){return[[[e.x1,t.y1],[e.x1,t.y2]]]},e}(Tp),Op=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addValue=function(t,e){var i,o=e.categoryIx,r=e.category,n=e.series,s=e.seriesIx,a=this.children,p=this.options,h=t.valueFields,c=Sp(this.splitValue(h)),l=n.data[o],u=this.categoryPoints[o];u||(this.categoryPoints[o]=u=[]),c&&(i=this.createPoint(t,e));var f=a[o];f||(f=new gp({vertical:p.invertAxes,gap:p.gap,spacing:p.spacing,rtl:!p.invertAxes&&(this.chartService||{}).rtl}),this.append(f)),i&&(this.updateRange(h,e),f.append(i),i.categoryIx=o,i.category=r,i.series=n,i.seriesIx=s,i.owner=this,i.dataItem=l),this.points.push(i),u.push(i)},e.prototype.pointType=function(){return this.options.invertAxes?Mp:Tp},e.prototype.splitValue=function(t){return[t.lower,t.q1,t.median,t.q3,t.upper]},e.prototype.updateRange=function(t,e){var i=e.series.axis,o=this.valueAxisRanges[i],r=this.splitValue(t).concat(this.filterOutliers(t.outliers));Nr(t.mean)&&(r=r.concat(t.mean)),o=this.valueAxisRanges[i]=o||{min:m,max:x},o=this.valueAxisRanges[i]={min:Math.min.apply(Math,r.concat([o.min])),max:Math.max.apply(Math,r.concat([o.max]))}},e.prototype.formatPointValue=function(t,e){var i=t.value;return this.chartService.format.auto(e,i.lower,i.q1,i.median,i.q3,i.upper,i.mean,t.category)},e.prototype.filterOutliers=function(t){for(var e=(t||[]).length,i=[],o=0;o<e;o++){var r=t[o];Nr(r)&&null!==r&&i.push(r)}return i},e.prototype.supportsPointInactiveOpacity=function(){return!1},e}(Cp),Rp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getAxis=function(){var t=this.chart.seriesAxes(this.series);return this.isVertical?t.y:t.x},e}(ja);function Bp(t){return Nr(t)&&null!==t}var jp=function(t){function e(e,i){t.call(this,i),this.plotArea=e,this.chartService=e.chartService,this._initFields(),this.render()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initFields=function(){this.xAxisRanges={},this.yAxisRanges={},this.points=[],this.seriesPoints=[],this.seriesOptions=[],this._evalSeries=[]},e.prototype.render=function(){this.traverseDataPoints(this.addValue.bind(this))},e.prototype.addErrorBar=function(t,e,i){var o,r=t.value[e],n=e+"Value",s=e+"ErrorLow",a=e+"ErrorHigh",p=i.seriesIx,h=i.series,c=t.options.errorBars,l=i[s],u=i[a];$o(r)&&($o(l)&&$o(u)&&(o={low:l,high:u}),c&&Nr(c[n])&&(this.seriesErrorRanges=this.seriesErrorRanges||{x:[],y:[]},this.seriesErrorRanges[e][p]=this.seriesErrorRanges[e][p]||new _a(c[n],h,e),o=this.seriesErrorRanges[e][p].getErrorRange(r,c[n])),o&&this.addPointErrorBar(o,t,e))},e.prototype.addPointErrorBar=function(t,e,i){var o=t.low,r=t.high,n=e.series,s=e.options.errorBars,a=i===k,p={};e[i+"Low"]=o,e[i+"High"]=r,e.errorBars=e.errorBars||[];var h=new Rp(o,r,a,this,n,s);e.errorBars.push(h),e.append(h),p[i]=o,this.updateRange(p,n),p[i]=r,this.updateRange(p,n)},e.prototype.addValue=function(t,e){var i,o=t.x,r=t.y,n=e.seriesIx,s=this.options.series[n],a=this.seriesMissingValues(s),p=this.seriesPoints[n],h=t;Bp(o)&&Bp(r)||(h=this.createMissingValue(h,a)),h&&((i=this.createPoint(h,e))&&(Object.assign(i,e),this.addErrorBar(i,S,e),this.addErrorBar(i,k,e)),this.updateRange(h,e.series)),this.points.push(i),p.push(i)},e.prototype.seriesMissingValues=function(t){return t.missingValues},e.prototype.createMissingValue=function(){},e.prototype.updateRange=function(t,e){var i=this.chartService.intl,o=e.xAxis,r=e.yAxis,n=t.x,s=t.y,a=this.xAxisRanges[o],p=this.yAxisRanges[r];Bp(n)&&(a=this.xAxisRanges[o]=a||{min:m,max:x},Qo(n)&&(n=ws(i,n)),a.min=Math.min(a.min,n),a.max=Math.max(a.max,n)),Bp(s)&&(p=this.yAxisRanges[r]=p||{min:m,max:x},Qo(s)&&(s=ws(i,s)),p.min=Math.min(p.min,s),p.max=Math.max(p.max,s))},e.prototype.evalPointOptions=function(t,e,i){var o=i.series,r=i.seriesIx,n={defaults:o._defaults,excluded:["data","tooltip","content","template","visual","toggle","_outOfRangeMinPoint","_outOfRangeMaxPoint"]},s=this._evalSeries[r];Nr(s)||(this._evalSeries[r]=s=La(t,{},n,!0));var a=t;return s&&La(a=or({},t),{value:e,series:o,dataItem:i.dataItem},n),a},e.prototype.pointType=function(){return Ha},e.prototype.pointOptions=function(t,e){var i=this.seriesOptions[e];if(!i){var o=this.pointType().prototype.defaults;this.seriesOptions[e]=i=or({},o,{markers:{opacity:t.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},t)}return i},e.prototype.createPoint=function(t,e){var i=e.series,o=this.pointOptions(i,e.seriesIx),r=e.color||i.color;o=this.evalPointOptions(o,t,e),er(i.color)&&(r=o.color);var n=new Ha(t,o);return n.color=r,this.append(n),n},e.prototype.seriesAxes=function(t){var e=t.xAxis,i=t.yAxis,o=this.plotArea,r=e?o.namedXAxes[e]:o.axisX,n=i?o.namedYAxes[i]:o.axisY;if(!r)throw new Error("Unable to locate X axis with name "+e);if(!n)throw new Error("Unable to locate Y axis with name "+i);return{x:r,y:n}},e.prototype.reflow=function(t){var e=this,i=this.points,o=!this.options.clip,r=0;this.traverseDataPoints((function(t,n){var s=i[r++],a=e.seriesAxes(n.series),p=a.x.getSlot(t.x,t.x,o),h=a.y.getSlot(t.y,t.y,o);if(s)if(p&&h){var c=e.pointSlot(p,h);s.reflow(c)}else s.visible=!1})),this.box=t},e.prototype.pointSlot=function(t,e){return new kn(t.x1,e.y1,t.x2,e.y2)},e.prototype.traverseDataPoints=function(t){for(var e=this.options.series,i=this.seriesPoints,o=0;o<e.length;o++){var r=e[o];i[o]||(i[o]=[]);for(var n=0;n<r.data.length;n++){var s=this._bindPoint(r,o,n),a=s.valueFields,p=s.fields;t(a,or({pointIx:n,series:r,seriesIx:o,dataItem:r.data[n],owner:this},p))}}},e.prototype.formatPointValue=function(t,e){var i=t.value;return this.chartService.format.auto(e,i.x,i.y)},e.prototype.animationPoints=function(){for(var t=this.points,e=[],i=0;i<t.length;i++)e.push((t[i]||{}).marker);return e},e}(Bn);sn(jp,{series:[],tooltip:{format:"{0}, {1}"},labels:{format:"{0}, {1}"},clip:!0}),or(jp.prototype,tp,{_bindPoint:Va.prototype._bindPoint});var Ip=jp,Lp=function(t){function e(e,i){t.call(this,e,i),this.category=e.category}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createHighlight=function(){var t=this.options.highlight,e=t.border,i=this.options.markers,o=this.box.center(),r=(i.size+i.border.width+e.width)/2,n=new a.Group,s=new a.Circle(new p.Circle([o.x,o.y+r/5+e.width/2],r+e.width/2),{stroke:{color:"none"},fill:this.createGradient({gradient:"bubbleShadow",color:i.background,stops:[{offset:0,color:i.background,opacity:.3},{offset:1,color:i.background,opacity:0}]})}),h=new a.Circle(new p.Circle([o.x,o.y],r),{stroke:{color:e.color||new dn(i.background).brightness(.8).toHex(),width:e.width,opacity:e.opacity},fill:{color:i.background,opacity:t.opacity}});return n.append(s,h),n},e}(Ha);Lp.prototype.defaults=or({},Lp.prototype.defaults,{labels:{position:f},highlight:{opacity:1,border:{color:"#fff",width:2,opacity:1}}}),Lp.prototype.defaults.highlight.zIndex=void 0;var zp=Lp,Ep=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initFields=function(){this._maxSize=x,t.prototype._initFields.call(this)},e.prototype.addValue=function(e,i){null!==e.size&&(e.size>0||e.size<0&&i.series.negativeValues.visible)?(this._maxSize=Math.max(this._maxSize,Math.abs(e.size)),t.prototype.addValue.call(this,e,i)):(this.points.push(null),this.seriesPoints[i.seriesIx].push(null))},e.prototype.reflow=function(e){this.updateBubblesSize(e),t.prototype.reflow.call(this,e)},e.prototype.pointType=function(){return zp},e.prototype.createPoint=function(t,e){var i=e.series,o=i.data.length,r=e.pointIx*(600/o),n={delay:r,duration:600-r,type:"bubble"},s=e.color||i.color;t.size<0&&i.negativeValues.visible&&(s=on(i.negativeValues.color,s));var a=or({labels:{animation:{delay:r,duration:600-r}}},this.pointOptions(i,e.seriesIx),{markers:{type:d,border:i.border,opacity:i.opacity,animation:n}});a=this.evalPointOptions(a,t,e),er(i.color)&&(s=a.color),a.markers.background=s;var p=new zp(t,a);return p.color=s,this.append(p),p},e.prototype.updateBubblesSize=function(t){for(var e=this.options.series,i=Math.min(t.width(),t.height()),o=0;o<e.length;o++)for(var r=e[o],n=this.seriesPoints[o],s=(r.minSize||Math.max(.02*i,10))/2,a=(r.maxSize||.2*i)/2,p=Math.PI*s*s,h=(Math.PI*a*a-p)/this._maxSize,c=0;c<n.length;c++){var l=n[c];if(l){var u=Math.abs(l.value.size)*h,f=Math.sqrt((p+u)/Math.PI),d=on(l.options.zIndex,0)+(1-f/a);or(l.options,{zIndex:d,markers:{size:2*f,zIndex:d},labels:{zIndex:d+1}})}}},e.prototype.formatPointValue=function(t,e){var i=t.value;return this.chartService.format.auto(e,i.x,i.y,i.size,t.category)},e.prototype.createAnimation=function(){},e.prototype.createVisual=function(){},e}(Ip);sn(Ep,{tooltip:{format:"{3}"},labels:{format:"{3}"}});var Vp=Ep,Fp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(zn);or(Fp.prototype,Fa);var Dp=Fp,Up=function(t){function e(e,i){t.call(this,i),this.aboveAxis=this.options.aboveAxis,this.color=i.color||A,this.value=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=this.options;this._rendered||(this._rendered=!0,Nr(this.value.target)&&(this.target=new Dp({type:t.target.shape,background:t.target.color||this.color,opacity:t.opacity,zIndex:t.zIndex,border:t.target.border,vAlign:_,align:b}),this.target.value=this.value,this.target.dataItem=this.dataItem,this.target.series=this.series,this.append(this.target)),this.createNote())},e.prototype.reflow=function(t){this.render();var e=this.options,i=this.target,o=this.owner,r=e.invertAxes,n=o.seriesValueAxis(this.options),s=o.categorySlot(o.categoryAxis,e.categoryIx,n),a=n.getSlot(this.value.target),p=r?a:s,h=r?s:a;if(i){var c=new kn(p.x1,h.y1,p.x2,h.y2);i.options.height=r?c.height():e.target.line.width,i.options.width=r?e.target.line.width:c.width(),i.reflow(c)}this.note&&this.note.reflow(t),this.box=t},e.prototype.createVisual=function(){t.prototype.createVisual.call(this);var e=this.options,i=a.Path.fromRect(this.box.toRect(),{fill:{color:this.color,opacity:e.opacity},stroke:null});e.border.width>0&&i.options.set("stroke",{color:e.border.color||this.color,width:e.border.width,dashType:e.border.dashType,opacity:on(e.border.opacity,e.opacity)}),this.bodyVisual=i,Ko(i),this.visual.append(i)},e.prototype.createAnimation=function(){this.bodyVisual&&(this.animation=a.Animation.create(this.bodyVisual,this.options.animation))},e.prototype.createHighlight=function(t){return a.Path.fromRect(this.box.toRect(),t)},e.prototype.highlightVisual=function(){return this.bodyVisual},e.prototype.highlightVisualArgs=function(){return{rect:this.box.toRect(),visual:this.bodyVisual,options:this.options}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e}(Bn);Up.prototype.tooltipAnchor=fp.prototype.tooltipAnchor,sn(Up,{border:{width:1},vertical:!1,opacity:1,target:{shape:"",border:{width:0,color:"green"},line:{width:2}},tooltip:{format:"Current: {0}<br />Target: {1}"}}),or(Up.prototype,Fa),or(Up.prototype,Da);var Hp=Up,Gp=function(t){function e(e,i){!function(t){for(var e=t.series,i=0;i<e.length;i++){var o=e[i],r=o.data;!r||C(r[0])||rr(r[0])||(o.data=[r])}}(i),t.call(this,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflowCategories=function(t){for(var e=this.children,i=e.length,o=0;o<i;o++)e[o].reflow(t[o])},e.prototype.plotRange=function(t){var e=t.series,i=this.seriesValueAxis(e),o=this.categoryAxisCrossingValue(i);return[o,t.value.current||o]},e.prototype.createPoint=function(t,e){var i=e.categoryIx,o=e.category,r=e.series,n=e.seriesIx,s=this.options,a=this.children,p=t.valueFields,h=or({vertical:!s.invertAxes,overlay:r.overlay,categoryIx:i,invertAxes:s.invertAxes},r),c=t.fields.color||r.color;h=this.evalPointOptions(h,p,o,i,r,n),er(r.color)&&(c=h.color);var l=new Hp(p,h);l.color=c;var u=a[i];return u||(u=new gp({vertical:s.invertAxes,gap:s.gap,spacing:s.spacing,rtl:!s.invertAxes&&(this.chartService||{}).rtl}),this.append(u)),u.append(l),l},e.prototype.updateRange=function(t,e){var i=t.current,o=t.target,r=e.series.axis,n=this.valueAxisRanges[r];Nr(i)&&!isNaN(i)&&Nr(o&&!isNaN(o))&&((n=this.valueAxisRanges[r]=n||{min:m,max:x}).min=Math.min(n.min,i,o),n.max=Math.max(n.max,i,o))},e.prototype.formatPointValue=function(t,e){return this.chartService.format.auto(e,t.value.current,t.value.target)},e.prototype.pointValue=function(t){return t.valueFields.current},e.prototype.aboveAxis=function(t){return t.value.current>0},e.prototype.createAnimation=function(){var t=this.points;this._setAnimationOptions();for(var e=0;e<t.length;e++){var i=t[e];i.options.animation=this.options.animation,i.createAnimation()}},e}(Va);Gp.prototype._setAnimationOptions=_p.prototype._setAnimationOptions,sn(Gp,{animation:{type:ka}});var Np=Gp,Wp=function(t){function e(e,i){t.call(this),this.chartService=e,this.options=or({},this.options,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getStyle=function(t,e){var i=t.background,o=t.border.color;if(e){var r=e.color||e.options.color;i=on(i,r),o=on(o,r)}var n=hr(t.padding||{},"auto");return{backgroundColor:i,borderColor:o,font:t.font,color:t.color,opacity:t.opacity,borderWidth:nr(t.border.width),paddingTop:nr(n.top),paddingBottom:nr(n.bottom),paddingLeft:nr(n.left),paddingRight:nr(n.right)}},e.prototype.show=function(t,e,i){t.format=e.format;var o=this.getStyle(e,i);t.style=o;var r=new dn(o.backgroundColor);Nr(e.color)||r.isDark()||(t.className="k-chart-tooltip-inverse"),this.chartService.notify("showTooltip",t),this.visible=!0},e.prototype.hide=function(){this.chartService&&this.chartService.notify("hideTooltip"),this.visible=!1},e.prototype.destroy=function(){delete this.chartService},e}(O);sn(Wp,{border:{width:1},opacity:1});var qp=Wp,Xp=function(t){function e(e,i,o){t.call(this,e,o),this.crosshair=i,this.formatService=e.format,this.initAxisName()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initAxisName=function(){var t,e=this.crosshair.axis;t=e.plotArea.categoryAxis?e.getCategory?"categoryAxis":"valueAxis":e.options.vertical?"yAxis":"xAxis",this.axisName=t},e.prototype.showAt=function(t){var e=this.crosshair.axis,i=this.options,o=e[i.stickyMode?"getCategory":"getValue"](t),r=o;i.format?r=this.formatService.auto(i.format,o):e.options.type===y&&(r=this.formatService.auto(e.options.labels.dateFormats[e.options.baseUnit],o)),this.show({point:t,anchor:this.getAnchor(),crosshair:this.crosshair,value:r,axisName:this.axisName,axisIndex:this.crosshair.axis.axisIndex},this.options)},e.prototype.hide=function(){this.chartService.notify("hideTooltip",{crosshair:this.crosshair,axisName:this.axisName,axisIndex:this.crosshair.axis.axisIndex})},e.prototype.getAnchor=function(){var t,e,i,o=this.crosshair,r=this.options,n=r.position,s=r.padding,a=!o.axis.options.vertical,p=o.line.bbox();return a?(t=f,n===u?(e=_,i=p.bottomLeft().translate(0,s)):(e=u,i=p.topLeft().translate(0,-s))):(e=f,n===g?(t=b,i=p.topLeft().translate(-s,0)):(t=g,i=p.topRight().translate(s,0))),{point:i,align:{horizontal:t,vertical:e}}},e}(qp);sn(Xp,{padding:10});var Yp=Xp,Zp=function(t){function e(e,i,o){t.call(this,o),this.axis=i,this.stickyMode=i instanceof Cs;var r=this.options.tooltip;r.visible&&(this.tooltip=new Yp(e,this,or({},r,{stickyMode:this.stickyMode})))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.showAt=function(t){this.point=t,this.moveLine(),this.line.visible(!0),this.tooltip&&this.tooltip.showAt(t)},e.prototype.hide=function(){this.line.visible(!1),this.tooltip&&this.tooltip.hide()},e.prototype.moveLine=function(){var t,e=this.axis,i=this.point,o=e.options.vertical,r=this.getBox(),n=o?k:S,s=new p.Point(r.x1,r.y1);if(t=o?new p.Point(r.x2,r.y1):new p.Point(r.x1,r.y2),i)if(this.stickyMode){var a=e.getSlot(e.pointCategoryIndex(i));s[n]=t[n]=a.center()[n]}else s[n]=t[n]=i[n];this.box=r,this.line.moveTo(s).lineTo(t)},e.prototype.getBox=function(){for(var t,e=this.axis,i=e.pane.axes,o=i.length,r=e.options.vertical,n=e.lineBox().clone(),s=r?S:k,a=0;a<o;a++){var p=i[a];p.options.vertical!==r&&(t?t.wrap(p.lineBox()):t=p.lineBox().clone())}return n[s+1]=t[s+1],n[s+2]=t[s+2],n},e.prototype.createVisual=function(){t.prototype.createVisual.call(this);var e=this.options;this.line=new a.Path({stroke:{color:e.color,width:e.width,opacity:e.opacity,dashType:e.dashType},visible:!1}),this.moveLine(),this.visual.append(this.line)},e.prototype.destroy=function(){this.tooltip&&this.tooltip.destroy(),t.prototype.destroy.call(this)},e}(Bn);sn(Zp,{color:l,width:2,zIndex:-1,tooltip:{visible:!1}});var Kp=Zp,Jp=function(t){function e(e,i){t.call(this,e),this.pane=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.shouldClip=function(){for(var t=this.children,e=t.length,i=0;i<e;i++)if(!0===t[i].options.clip)return!0;return!1},e.prototype._clipBox=function(){return this.pane.chartsBox()},e.prototype.createVisual=function(){if(this.visual=new a.Group({zIndex:0}),this.shouldClip()){var t=(this.clipBox=this._clipBox()).toRect(),e=a.Path.fromRect(t);Ko(e),this.visual.clip(e),this.unclipLabels()}},e.prototype.stackRoot=function(){return this},e.prototype.unclipLabels=function(){for(var t=this.children,e=this.clipBox,i=0;i<t.length;i++)for(var o=t[i].points||{},r=o.length,n=0;n<r;n++){var s=o[n];if(s&&!1!==s.visible&&s.overlapsBox&&s.overlapsBox(e))if(s.unclipElements)s.unclipElements();else{var a=s.label,p=s.note;a&&a.options.visible&&(a.alignToClipBox&&a.alignToClipBox(e),a.options.noclip=!0),p&&p.options.visible&&(p.options.noclip=!0)}}},e.prototype.destroy=function(){t.prototype.destroy.call(this),delete this.parent},e}(Bn);Jp.prototype.isStackRoot=!0;var $p=Jp,Qp=function(t){function e(e){t.call(this,e),this.id="pane"+th++,this.createTitle(),this.content=new Bn,this.chartContainer=new $p({},this),this.append(this.content),this.axes=[],this.charts=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createTitle=function(){var t=this.options.title;rr(t)&&(t=or({},t,{align:t.position,position:_})),this.title=Kn.buildTitle(t,this,e.prototype.options.title)},e.prototype.appendAxis=function(t){this.content.append(t),this.axes.push(t),t.pane=this},e.prototype.appendAxisAt=function(t,e){this.content.append(t),this.axes.splice(e,0,t),t.pane=this},e.prototype.appendChart=function(t){this.chartContainer.parent!==this.content&&this.content.append(this.chartContainer),this.charts.push(t),this.chartContainer.append(t),t.pane=this},e.prototype.empty=function(){var t=this.parent;if(t){for(var e=0;e<this.axes.length;e++)t.removeAxis(this.axes[e]);for(var i=0;i<this.charts.length;i++)t.removeChart(this.charts[i])}this.axes=[],this.charts=[],this.content.destroy(),this.content.children=[],this.chartContainer.children=[]},e.prototype.reflow=function(e){var i;Kr(this.children)===this.content&&(i=this.children.pop()),t.prototype.reflow.call(this,e),i&&this.children.push(i),this.title&&(this.contentBox.y1+=this.title.box.height())},e.prototype.visualStyle=function(){var e=t.prototype.visualStyle.call(this);return e.zIndex=-10,e},e.prototype.renderComplete=function(){this.options.visible&&this.createGridLines()},e.prototype.stackRoot=function(){return this},e.prototype.clipRoot=function(){return this},e.prototype.createGridLines=function(){for(var t=this.axes,e=t.concat(this.parent.axes),i=[],o=[],r=0;r<t.length;r++)for(var n=t[r],s=n.options.vertical,a=s?i:o,p=0;p<e.length;p++)if(0===a.length){var h=e[p];s!==h.options.vertical&&Hr(a,n.createGridLines(h))}},e.prototype.refresh=function(){this.visual.clear(),this.content.parent=null,this.content.createGradient=this.createGradient.bind(this),this.content.renderVisual(),this.content.parent=this,this.title&&this.visual.append(this.title.visual),this.visual.append(this.content.visual),this.renderComplete(),this.notifyRender()},e.prototype.chartsBox=function(){for(var t=this.axes,e=t.length,i=new kn,o=0;o<e;o++){var r=t[o],n=r.options.vertical?k:S,s=r.lineBox();i[n+1]=s[n+1],i[n+2]=s[n+2]}if(0===i.x2)for(var a=this.parent.axes,p=a.length,h=0;h<p;h++){var c=a[h];if(!c.options.vertical){var l=c.lineBox();i.x1=l.x1,i.x2=l.x2}}return i},e.prototype.clipBox=function(){return this.chartContainer.clipBox},e.prototype.notifyRender=function(){var t=this.getService();t&&t.notify("paneRender",{pane:new la(this),index:this.paneIndex,name:this.options.name})},e}(In),th=1;Qp.prototype.isStackRoot=!0,sn(Qp,{zIndex:-1,shrinkToFit:!0,title:{align:g},visible:!0});var eh=Qp;function ih(t,e){null!==e&&t.push(e)}function oh(t,e,i){var o=e.visible;if(Nr(o))return o;var r=t.pointVisibility;return r?r[i]:void 0}function rh(t){for(var e=t.data,i=[],o=0,r=0,n=0;n<e.length;n++){var s=ma.current.bindPoint(t,n),a=s.valueFields.value;Qo(a)&&(a=parseFloat(a)),$o(a)?(s.visible=!1!==oh(t,s.fields,n),s.value=Math.abs(a),i.push(s),s.visible&&(o+=s.value),0!==a&&r++):i.push(null)}return{total:o,points:i,count:r}}function nh(t,e){return t&&e?t.toLowerCase()===e.toLowerCase():t===e}function sh(t,e){for(var i=[],o=[].concat(e),r=0;r<t.length;r++){var n=t[r];Lr(n.type,o)&&i.push(n)}return i}function ah(t,e,i){if(null===e)return e;var o="_date_"+t,r=e[o];return r||(r=ws(i,Or(t)(e)),e[o]=r),r}function ph(t,e){var i=t.type,o=e instanceof Date;return!i&&o||nh(i,y)}function hh(t){return 1===t.length?t[0]:t}var ch=/area/i;function lh(t,e){var i=ma.current.bindPoint(t,null,e).valueFields;for(var o in i)if(tr(i[o]))return!0}function uh(t){var e,i,o=t.start,r=t.dir,n=t.min,s=t.max,a=t.getter,p=t.hasItem,h=t.series,c=o;do{p(c+=r)&&(e=lh(h,(i=a(c)).item))}while(n<=c&&c<=s&&!e);if(e)return i}function fh(t,e,i,o,r){var n=e.min,s=e.max,a=n>0&&n<i,p=s+1<i;if(a||p){var h,c,l;if("interpolate"!==function(t){return t.missingValues?t.missingValues:ch.test(t.type)||t.stack?Sa:"interpolate"}(t))a&&(h=o(n-1)),p&&(c=o(s+1));else a&&(h=lh(t,(l=o(n-1)).item)?l:uh({start:n,dir:-1,min:0,max:i-1,getter:o,hasItem:r,series:t})),p&&(c=lh(t,(l=o(s+1)).item)?l:uh({start:s,dir:1,min:0,max:i-1,getter:o,hasItem:r,series:t}));h&&(t._outOfRangeMinPoint=h),c&&(t._outOfRangeMaxPoint=c)}}var dh=function(t){function e(e,i,o){t.call(this,i),this.initFields(e,i),this.series=e,this.initSeries(),this.charts=[],this.options.legend=this.options.legend||{},this.options.legend.items=[],this.axes=[],this.crosshairs=[],this.chartService=o,this.originalOptions=i,this.createPanes(),this.render(),this.createCrosshairs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(){},e.prototype.initSeries=function(){for(var t=this.series,e=0;e<t.length;e++)t[e].index=e},e.prototype.createPanes=function(){for(var t=this.options.title||{},e=this.options.paneDefaults,i=this.options.panes||[],o=Math.max(i.length,1),r=[],n=or({title:{color:t.color}},e),s=0;s<o;s++){var a=or({},n,i[s]);Qo(a.title)&&(a.title=or({text:a.title},n.title));var p=new eh(a);p.paneIndex=s,r.push(p),this.append(p)}this.panes=r},e.prototype.crosshairOptions=function(t){return t.options.crosshair},e.prototype.createCrosshairs=function(t){void 0===t&&(t=this.panes);for(var e=0;e<t.length;e++)for(var i=t[e],o=0;o<i.axes.length;o++){var r=i.axes[o],n=this.crosshairOptions(r);if(n&&n.visible){var s=new Kp(this.chartService,r,n);this.crosshairs.push(s),i.content.append(s)}}},e.prototype.removeCrosshairs=function(t){for(var e=this.crosshairs,i=t.axes,o=e.length-1;o>=0;o--)for(var r=0;r<i.length;r++)if(e[o].axis===i[r]){e.splice(o,1);break}},e.prototype.hideCrosshairs=function(){for(var t=this.crosshairs,e=0;e<t.length;e++)t[e].hide()},e.prototype.findPane=function(t){for(var e,i=this.panes,o=0;o<i.length;o++)if(i[o].options.name===t){e=i[o];break}return e||i[0]},e.prototype.findPointPane=function(t){for(var e,i=this.panes,o=0;o<i.length;o++)if(i[o].box.containsPoint(t)){e=i[o];break}return e},e.prototype.appendAxis=function(t){this.findPane(t.options.pane).appendAxis(t),this.axes.push(t),t.plotArea=this},e.prototype.removeAxis=function(t){for(var e=[],i=0;i<this.axes.length;i++){var o=this.axes[i];t!==o?e.push(o):o.destroy()}this.axes=e},e.prototype.appendChart=function(t,e){this.charts.push(t),e?e.appendChart(t):this.append(t)},e.prototype.removeChart=function(t){for(var e=[],i=0;i<this.charts.length;i++){var o=this.charts[i];o!==t?e.push(o):o.destroy()}this.charts=e},e.prototype.addToLegend=function(t){for(var e=t.length,i=this.options.legend,o=i.labels||{},r=i.inactiveItems||{},n=r.labels||{},s=[],a=0;a<e;a++){var p=t[a],h=!1!==p.visible;if(!1!==p.visibleInLegend){var c=p.name,l=h?Pr(o):Pr(n)||Pr(o);l&&(c=l({text:Bp(c)?c:"",series:p}));var u=p._defaults,f=p.color;er(f)&&u&&(f=u.color);var d=void 0,y=void 0;h?(d={},y=f):(d={color:n.color,font:n.font},y=r.markers.color),Bp(c)&&""!==c&&s.push({text:c,labels:d,markerColor:y,series:p,active:h})}}Hr(i.items,s)},e.prototype.groupAxes=function(t){for(var e=[],i=[],o=0;o<t.length;o++)for(var r=t[o].axes,n=0;n<r.length;n++){var s=r[n];s.options.vertical?i.push(s):e.push(s)}return{x:e,y:i,any:e.concat(i)}},e.prototype.groupSeriesByPane=function(){for(var t=this.series,e={},i=0;i<t.length;i++){var o=t[i],r=this.seriesPaneName(o);e[r]?e[r].push(o):e[r]=[o]}return e},e.prototype.filterVisibleSeries=function(t){for(var e=[],i=0;i<t.length;i++){var o=t[i];!1!==o.visible&&e.push(o)}return e},e.prototype.reflow=function(t){var e=this.options.plotArea,i=this.panes,o=hr(e.margin);this.box=t.clone().unpad(o),this.reflowPanes(),this.detachLabels(),this.reflowAxes(i),this.reflowCharts(i)},e.prototype.redraw=function(t){var e=[].concat(t);this.initSeries();var i=this.getRoot();i&&i.cleanGradients();for(var o=0;o<e.length;o++)this.removeCrosshairs(e[o]),e[o].empty();this.render(e),this.detachLabels(),this.reflowAxes(this.panes),this.reflowCharts(e),this.createCrosshairs(e);for(var r=0;r<e.length;r++)e[r].refresh()},e.prototype.axisCrossingValues=function(t,e){for(var i=t.options,o=[].concat(i.axisCrossingValues||i.axisCrossingValue),r=e.length-o.length,n=o[0]||0,s=0;s<r;s++)o.push(n);return o},e.prototype.alignAxisTo=function(t,e,i,o){var r=t.getSlot(i,i,!0),n=t.options.reverse?2:1,s=e.getSlot(o,o,!0),a=e.options.reverse?2:1,p=t.box.translate(s[S+a]-r[S+n],s[k+a]-r[k+n]);t.pane!==e.pane&&p.translate(0,t.pane.box.y1-e.pane.box.y1),t.reflow(p)},e.prototype.alignAxes=function(t,e){for(var i=t[0],o=e[0],r=this.axisCrossingValues(i,e),n=this.axisCrossingValues(o,t),s={},a={},p={},h={},c=0;c<e.length;c++){var l=e[c],f=l.pane,d=f.id,y=!1!==l.options.visible,v=gh(t,f)||i,m=r;v!==i&&(m=this.axisCrossingValues(v,e)),this.alignAxisTo(l,v,n[c],m[c]),l.options._overlap||(tn(l.lineBox().x1)===tn(v.lineBox().x1)&&(s[d]&&l.reflow(l.box.alignTo(s[d].box,g).translate(-l.options.margin,0)),y&&(s[d]=l)),tn(l.lineBox().x2)===tn(v.lineBox().x2)&&(l._mirrored||(l.options.labels.mirror=!l.options.labels.mirror,l._mirrored=!0),this.alignAxisTo(l,v,n[c],m[c]),a[d]&&l.reflow(l.box.alignTo(a[d].box,b).translate(l.options.margin,0)),y&&(a[d]=l)),0!==c&&o.pane===l.pane&&(l.alignTo(o),l.reflow(l.box)))}for(var x=0;x<t.length;x++){var w=t[x],A=w.pane,S=A.id,k=!1!==w.options.visible,C=gh(e,A)||o,P=n;C!==o&&(P=this.axisCrossingValues(C,t)),this.alignAxisTo(w,C,r[x],P[x]),w.options._overlap||(tn(w.lineBox().y1)===tn(C.lineBox().y1)&&(w._mirrored||(w.options.labels.mirror=!w.options.labels.mirror,w._mirrored=!0),this.alignAxisTo(w,C,r[x],P[x]),p[S]&&w.reflow(w.box.alignTo(p[S].box,_).translate(0,-w.options.margin)),k&&(p[S]=w)),tn(w.lineBox().y2,3)===tn(C.lineBox().y2,3)&&(h[S]&&w.reflow(w.box.alignTo(h[S].box,u).translate(0,w.options.margin)),k&&(h[S]=w)),0!==x&&(w.alignTo(i),w.reflow(w.box)))}},e.prototype.shrinkAxisWidth=function(t){for(var e=this.groupAxes(t).any,i=vh(e),o=0,r=0;r<t.length;r++){var n=t[r];n.axes.length>0&&(o=Math.max(o,i.width()-n.contentBox.width()))}if(0!==o)for(var s=0;s<e.length;s++){var a=e[s];a.options.vertical||a.reflow(a.box.shrink(o,0))}},e.prototype.shrinkAxisHeight=function(t){for(var e,i=0;i<t.length;i++){var o=t[i],r=o.axes,n=Math.max(0,vh(r).height()-o.contentBox.height());if(0!==n){for(var s=0;s<r.length;s++){var a=r[s];a.options.vertical&&a.reflow(a.box.shrink(0,n))}e=!0}}return e},e.prototype.fitAxes=function(t){for(var e=this.groupAxes(t).any,i=0,o=0;o<t.length;o++){var r=t[o],n=r.axes,s=r.contentBox;if(n.length>0){var a=vh(n),p=Math.max(s.y1-a.y1,s.y2-a.y2);i=Math.max(i,s.x1-a.x1);for(var h=0;h<n.length;h++){var c=n[h];c.reflow(c.box.translate(0,p))}}}for(var l=0;l<e.length;l++){var u=e[l];u.reflow(u.box.translate(i,0))}},e.prototype.reflowAxes=function(t){for(var e=this.groupAxes(t),i=0;i<t.length;i++)this.reflowPaneAxes(t[i]);e.x.length>0&&e.y.length>0&&(this.alignAxes(e.x,e.y),this.shrinkAxisWidth(t),this.autoRotateAxisLabels(e),this.alignAxes(e.x,e.y),this.shrinkAxisWidth(t)&&this.alignAxes(e.x,e.y),this.shrinkAxisHeight(t),this.alignAxes(e.x,e.y),this.shrinkAxisHeight(t)&&this.alignAxes(e.x,e.y),this.fitAxes(t))},e.prototype.autoRotateAxisLabels=function(t){for(var e,i=this.panes,o=mh(i),r=0;r<o.length;r++){o[r].autoRotateLabels()&&(e=!0)}if(e){for(var n=0;n<i.length;n++)this.reflowPaneAxes(i[n]);t.x.length>0&&t.y.length>0&&(this.alignAxes(t.x,t.y),this.shrinkAxisWidth(i))}},e.prototype.reflowPaneAxes=function(t){var e=t.axes,i=e.length;if(i>0)for(var o=0;o<i;o++)e[o].reflow(t.contentBox)},e.prototype.reflowCharts=function(t){for(var e=this.charts,i=e.length,o=this.box,r=0;r<i;r++){var n=e[r].pane;n&&!Lr(n,t)||e[r].reflow(o)}},e.prototype.reflowPanes=function(){for(var t=this.box,e=this.panes,i=e.length,o=t.height(),r=0,n=t.y1,s=0;s<i;s++){var a=e[s],p=a.options.height;if(a.options.width=t.width(),a.options.height){if(p.indexOf&&p.indexOf("%")){var h=parseInt(p,10)/100;a.options.height=h*t.height()}a.reflow(t.clone()),o-=a.options.height}else r++}for(var c=0;c<i;c++){var l=e[c];l.options.height||(l.options.height=o/r)}for(var u=0;u<i;u++){var f=e[u],d=t.clone().move(t.x1,n);f.reflow(d),n+=f.options.height}},e.prototype.backgroundBox=function(){for(var t,e=this.axes,i=e.length,o=0;o<i;o++)for(var r=e[o],n=0;n<i;n++){var s=e[n];if(r.options.vertical!==s.options.vertical){var a=r.lineBox().clone().wrap(s.lineBox());t=t?t.wrap(a):a}}return t||this.box},e.prototype.chartsBoxes=function(){for(var t=this.panes,e=[],i=0;i<t.length;i++)e.push(t[i].chartsBox());return e},e.prototype.addBackgroundPaths=function(t){for(var e=this.chartsBoxes(),i=0;i<e.length;i++)t.paths.push(a.Path.fromRect(e[i].toRect()))},e.prototype.backgroundContainsPoint=function(t){for(var e=this.chartsBoxes(),i=0;i<e.length;i++)if(e[i].containsPoint(t))return!0},e.prototype.createVisual=function(){t.prototype.createVisual.call(this);var e,i=this.options.plotArea,o=i.opacity,r=i.background,n=i.border;void 0===n&&(n={}),""!==(e=r)&&null!==e&&"none"!==e&&"transparent"!==e&&Nr(e)||(r=A,o=0);var s=this._bgVisual=new a.MultiPath({fill:{color:r,opacity:o},stroke:{color:n.width?n.color:"",width:n.width,dashType:n.dashType},zIndex:-1});this.addBackgroundPaths(s),this.appendVisual(s)},e.prototype.pointsByCategoryIndex=function(t){var e=this.charts,i=[];if(null!==t)for(var o=0;o<e.length;o++){if("_navigator"!==e[o].pane.options.name){var r=e[o].categoryPoints[t];if(r&&r.length)for(var n=0;n<r.length;n++){var s=r[n];s&&Nr(s.value)&&null!==s.value&&i.push(s)}}}return i},e.prototype.pointsBySeriesIndex=function(t){return this.filterPoints((function(e){return e.series.index===t}))},e.prototype.pointsBySeriesName=function(t){return this.filterPoints((function(e){return e.series.name===t}))},e.prototype.filterPoints=function(t){for(var e=this.charts,i=[],o=0;o<e.length;o++)for(var r=e[o].points,n=0;n<r.length;n++){var s=r[n];s&&!1!==s.visible&&t(s)&&i.push(s)}return i},e.prototype.findPoint=function(t){for(var e=this.charts,i=0;i<e.length;i++)for(var o=e[i].points,r=0;r<o.length;r++){var n=o[r];if(n&&!1!==n.visible&&t(n))return n}},e.prototype.paneByPoint=function(t){for(var e=this.panes,i=0;i<e.length;i++){var o=e[i];if(o.box.containsPoint(t))return o}},e.prototype.detachLabels=function(){var t=this.groupAxes(this.panes),e=t.x,i=t.y;this.detachAxisGroupLabels(i,e),this.detachAxisGroupLabels(e,i)},e.prototype.detachAxisGroupLabels=function(t,e){for(var i=0,o=0;o<t.length;o++){var r=t[o],n=r.pane,s=gh(e,n)||e[0],a=o+i,p=this.createLabelAxis(r,a,s);if(p){i++;var h=n.axes.indexOf(r)+i;n.appendAxisAt(p,h)}}},e.prototype.createLabelAxis=function(t,e,i){var o=t.options.labels,r=o.position,n="end"!==r&&"start"!==r,s=o.visible;if(n||!1===s)return null;var a=this.groupAxes(this.panes),p=i.options.vertical?a.x:a.y,h=this.axisCrossingValues(i,p),c="end"===r,l=i.range(),u=c?l.max:l.min;if(Jr(h[e],l.min,l.max)-u==0)return null;h.splice(e+1,0,u),i.options.axisCrossingValues=h;var f=t.clone();return t.clear(),f.options.name=void 0,f.options.line.visible=!1,f.options.crosshair=void 0,f.options.notes=void 0,f.options.plotBands=void 0,f},e}(Bn);function yh(t){return!t.pane.axes.some((function(e){return e.options.vertical===t.options.vertical&&e!==t&&!1!==e.options.visible}))}function vh(t){for(var e,i=t.length,o=0;o<i;o++){var r=t[o],n=!1!==r.options.visible;if(n||yh(r)){var s=n?r.contentBox():r.lineBox();e?e.wrap(s):e=s.clone()}}return e||new kn}function gh(t,e){for(var i=0;i<t.length;i++){var o=t[i];if(o&&o.pane===e)return o}}var mh=function(t){return t.reduce((function(t,e){return t.concat(e.axes)}),[])};sn(dh,{series:[],plotArea:{margin:{}},background:"",border:{color:l,width:0},paneDefaults:{title:{}},legend:{inactiveItems:{labels:{color:"#919191"},markers:{color:"#919191"}}}});var xh=dh,bh={hover:function(t,e){this._dispatchEvent(t,e,"plotAreaHover")},click:function(t,e){this._dispatchEvent(t,e,"plotAreaClick")}};function _h(t,e,i){var o=e,r=t;if(t.indexOf(".")>-1){for(var n=t.split(".");n.length>1;)r=n.shift(),Nr(o[r])||(o[r]={}),o=o[r];r=n.shift()}o[r]=i}var wh=function(t){function e(e,i,o){t.call(this);var r=i.canonicalFields(e),n=i.valueFields(e),s=i.sourceFields(e,r),a=this._seriesFields=[],p=o.query(e.type),h=e.aggregate||p;this._series=e,this._binder=i;for(var c=0;c<r.length;c++){var l=r[c],u=void 0;if(rr(h))u=h[l];else{if(0!==c&&!Lr(l,n))break;u=h}u&&a.push({canonicalName:l,name:s[c],transform:er(u)?u:ya[u]})}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.aggregatePoints=function(t,e){var i=this._series,o=this._seriesFields,r=this._bindPoints(t||[]),n=r.dataItems[0],s={};if(n&&!$o(n)&&!C(n)){var a=function(){};a.prototype=n,s=new a}for(var p=0;p<o.length;p++){var h=o[p],c=this._bindField(r.values,h.canonicalName),l=h.transform(c,i,r.dataItems,e);if(!(null===l||!rr(l)||Nr(l.length)||l instanceof Date)){s=l;break}Nr(l)&&_h(h.name,s,l)}return s},e.prototype._bindPoints=function(t){for(var e=this._binder,i=this._series,o=[],r=[],n=0;n<t.length;n++){var s=t[n];o.push(e.bindPoint(i,s)),r.push(i.data[s])}return{values:o,dataItems:r}},e.prototype._bindField=function(t,e){for(var i=[],o=t.length,r=0;r<o;r++){var n=t[r],s=n.valueFields,a=void 0;a=Nr(s[e])?s[e]:n.fields[e],i.push(a)}return i},e}(O),Ah=function(t){function e(){t.call(this),this._defaults={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.register=function(t,e){for(var i=0;i<t.length;i++)this._defaults[t[i]]=e},e.prototype.query=function(t){return this._defaults[t]},e}(O);Ah.current=new Ah;var Sh=Ah,kh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createLabel=function(){var t=this.options.labels,e=or({},t,t.from),i=or({},t,t.to);e.visible&&(this.labelFrom=this._createLabel(e),this.append(this.labelFrom)),i.visible&&(this.labelTo=this._createLabel(i),this.append(this.labelTo))},e.prototype._createLabel=function(t){var e,i=Pr(t),o=this.pointData();return e=i?i(o):this.formatValue(t.format),new cp(e,or({vertical:this.options.vertical},t),o)},e.prototype.reflow=function(t){this.render();var e=this.labelFrom,i=this.labelTo,o=this.value;this.box=t,e&&(e.options.aboveAxis=o.from>o.to,e.reflow(t)),i&&(i.options.aboveAxis=o.to>o.from,i.reflow(t)),this.note&&this.note.reflow(t)},e}(fp);kh.prototype.defaults=or({},kh.prototype.defaults,{labels:{format:"{0} - {1}"},tooltip:{format:"{1}"}});var Ch=kh,Ph=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointType=function(){return Ch},e.prototype.pointValue=function(t){return t.valueFields},e.prototype.formatPointValue=function(t,e){return null===t.value.from&&null===t.value.to?"":this.chartService.format.auto(e,t.value.from,t.value.to)},e.prototype.plotRange=function(t){return t?[t.value.from,t.value.to]:0},e.prototype.updateRange=function(t,e){var i=e.series.axis,o=t.from,r=t.to,n=this.valueAxisRanges[i];null!==t&&$o(o)&&$o(r)&&((n=this.valueAxisRanges[i]=n||{min:m,max:x}).min=Math.min(n.min,o),n.max=Math.max(n.max,o),n.min=Math.min(n.min,r),n.max=Math.max(n.max,r))},e.prototype.aboveAxis=function(t){var e=t.value;return e.from<e.to},e}(_p);Ph.prototype.plotLimits=Va.prototype.plotLimits;var Th=Ph,Mh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.aliasFor=function(){return this.parent},e}(Ha),Oh=function(t){function e(e,i){t.call(this),this.value=e,this.options=i,this.aboveAxis=on(this.options.aboveAxis,!0),this.tooltipTracking=!0,this.initLabelsFormat()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){if(!this._rendered){this._rendered=!0;var t=this.options,e=t.markers,i=t.labels,o=this.value,r=this.fromPoint=new Mh(o,or({},this.options,{labels:i.from,markers:e.from})),n=this.toPoint=new Mh(o,or({},this.options,{labels:i.to,markers:e.to}));this.copyFields(r),this.copyFields(n),this.append(r),this.append(n)}},e.prototype.reflow=function(t){this.render();var e=t.from,i=t.to;this.positionLabels(e,i),this.fromPoint.reflow(e),this.toPoint.reflow(i),this.box=this.fromPoint.markerBox().clone().wrap(this.toPoint.markerBox())},e.prototype.createHighlight=function(){var t=new a.Group;return t.append(this.fromPoint.createHighlight()),t.append(this.toPoint.createHighlight()),t},e.prototype.highlightVisual=function(){return this.visual},e.prototype.highlightVisualArgs=function(){return{options:this.options,from:this.fromPoint.highlightVisualArgs(),to:this.toPoint.highlightVisualArgs()}},e.prototype.tooltipAnchor=function(){var t=this.owner.pane.clipBox();if(!t||t.overlaps(this.box)){var e,i,o,r=this.box,n=r.center();return this.options.vertical?(e=n.x,i=r.y1-5,o=u):(e=r.x2+5,i=n.y,o=f),{point:new An(e,i),align:{horizontal:"left",vertical:o}}}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e.prototype.overlapsBox=function(t){return this.box.overlaps(t)},e.prototype.unclipElements=function(){this.fromPoint.unclipElements(),this.toPoint.unclipElements()},e.prototype.initLabelsFormat=function(){var t=this.options.labels;t.format||(t.from&&t.from.format||(t.from=Object.assign({},t.from,{format:"{0}"})),t.to&&t.to.format||(t.to=Object.assign({},t.to,{format:"{1}"})))},e.prototype.positionLabels=function(t,e){var i,o,r=this.options,n=r.labels,s=r.vertical;"auto"===n.position&&(s?e.y1<=t.y1?(o="above",i="below"):(o="below",i="above"):e.x1<=t.x1?(o=g,i=b):(o=b,i=g),n.from&&n.from.position||(this.fromPoint.options.labels.position=i),n.to&&n.to.position||(this.toPoint.options.labels.position=o))},e.prototype.copyFields=function(t){t.dataItem=this.dataItem,t.category=this.category,t.series=this.series,t.color=this.color,t.owner=this.owner},e}(Bn);or(Oh.prototype,Fa),or(Oh.prototype,Da),Oh.prototype.defaults={markers:{visible:!1,background:A,size:8,type:d,border:{width:2},opacity:1},labels:{visible:!1,margin:hr(3),padding:hr(4),animation:{type:"fadeIn",delay:600},position:"auto"},notes:{label:{}},highlight:{markers:{border:{color:A,width:2}},zIndex:100},tooltip:{format:"{0} - {1}"}};var Rh=Oh,Bh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createStrokeSegments=function(){return this.segmentsFromPoints(this.toGeometryPoints(this.toPoints()))},e.prototype.stackSegments=function(){var t=this.fromSegments;return this.fromSegments||(t=this.fromSegments=this.segmentsFromPoints(this.toGeometryPoints(this.fromPoints().reverse()))),t},e.prototype.createStroke=function(t){var e=new a.Path(t),i=new a.Path(t);e.segments.push.apply(e.segments,this.strokeSegments()),i.segments.push.apply(i.segments,this.stackSegments()),this.visual.append(e),this.visual.append(i)},e.prototype.hasStackSegment=function(){return!0},e.prototype.fromPoints=function(){return this.linePoints.map((function(t){return t.fromPoint}))},e.prototype.toPoints=function(){return this.linePoints.map((function(t){return t.toPoint}))},e}(op),jh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createStrokeSegments=function(){return this.createCurveSegments(this.toPoints())},e.prototype.stackSegments=function(){var t=this.fromSegments;return this.fromSegments||(t=this.fromSegments=this.createCurveSegments(this.fromPoints().reverse())),t},e.prototype.createCurveSegments=function(t){return(new aa).process(this.toGeometryPoints(t))},e}(Bh),Ih=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createStrokeSegments=function(){return this.segmentsFromPoints(this.calculateStepPoints(this.toPoints()))},e.prototype.stackSegments=function(){var t=this.fromSegments;return this.fromSegments||(t=this.fromSegments=this.segmentsFromPoints(this.calculateStepPoints(this.fromPoints()))).reverse(),t},e}(Bh);or(Ih.prototype,qa);var Lh=Ih,zh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){t.prototype.render.call(this),this.renderSegments()},e.prototype.pointType=function(){return Rh},e.prototype.createPoint=function(t,e){var i=e.categoryIx,o=e.category,r=e.series,n=e.seriesIx,s=t.valueFields;if(!Bp(s.from)&&!Bp(s.to)){if(this.seriesMissingValues(r)!==Sa)return null;s={from:0,to:0}}var a=this.pointOptions(r,n);a=this.evalPointOptions(a,s,o,i,r,n);var p=t.fields.color||r.color;er(r.color)&&(p=a.color);var h=new Rh(s,a);return h.color=p,this.append(h),h},e.prototype.createSegment=function(t,e,i){var o=(e.line||{}).style;return new("smooth"===o?jh:"step"===o?Lh:Bh)(t,e,i)},e.prototype.plotRange=function(t,e){return t?[t.value.from,t.value.to]:[e,e]},e.prototype.valueSlot=function(t,e){var i=t.getSlot(e[0],e[0],!this.options.clip),o=t.getSlot(e[1],e[1],!this.options.clip);if(i&&o)return{from:i,to:o}},e.prototype.pointSlot=function(t,e){var i,o,r=e.from,n=e.to;return this.options.invertAxes?(i=new kn(r.x1,t.y1,r.x2,t.y2),o=new kn(n.x1,t.y1,n.x2,t.y2)):(i=new kn(t.x1,r.y1,t.x2,r.y2),o=new kn(t.x1,n.y1,t.x2,n.y2)),{from:i,to:o}},e.prototype.addValue=function(e,i){var o=e.valueFields;$o(o.from)||(o.from=o.to),$o(o.to)||(o.to=o.from),t.prototype.addValue.call(this,e,i)},e.prototype.updateRange=function(t,e){if(null!==t&&$o(t.from)&&$o(t.to)){var i=e.series.axis,o=this.valueAxisRanges[i]=this.valueAxisRanges[i]||{min:m,max:x},r=t.from,n=t.to;o.min=Math.min(o.min,r,n),o.max=Math.max(o.max,r,n)}},e.prototype.formatPointValue=function(t,e){var i=t.value;return this.chartService.format.auto(e,i.from,i.to)},e.prototype.animationPoints=function(){for(var t=this.points,e=[],i=0;i<t.length;i++){var o=t[i];o&&(e.push((o.fromPoint||{}).marker),e.push((o.toPoint||{}).marker))}return e.concat(this._segments)},e}(Va);or(zh.prototype,Ka,tp);var Eh=zh,Vh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.options,i=this.value,o=this.owner.seriesValueAxis(e),r=[],n=[],s=[],a=o.getSlot(i.low,i.high),p=o.getSlot(i.open,i.open),h=o.getSlot(i.close,i.close);p.x1=h.x1=a.x1=t.x1,p.x2=h.x2=a.x2=t.x2;var c=a.center().x;r.push([p.x1,p.y1]),r.push([c,p.y1]),n.push([c,h.y1]),n.push([h.x2,h.y1]),s.push([c,a.y1]),s.push([c,a.y2]),this.lines=[r,n,s],this.box=a.clone().wrap(p.clone().wrap(h)),this.reflowNote()},e.prototype.createBody=function(){},e}(Ap),Fh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointType=function(){return Vh},e}(Cp),Dh=function(t){function e(e,i,o){t.call(this),this.from=e,this.to=i,this.series=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linePoints=function(){var t=this.from,e=this.from.box,i=this.to.box,o=[];if(t.isVertical){var r=t.aboveAxis?e.y1:e.y2;o.push([e.x1,r],[i.x2,r])}else{var n=t.aboveAxis?e.x2:e.x1;o.push([n,e.y1],[n,i.y2])}return o},e.prototype.createVisual=function(){t.prototype.createVisual.call(this);var e=this.series.line||{},i=a.Path.fromPoints(this.linePoints(),{stroke:{color:e.color,width:e.width,opacity:e.opacity,dashType:e.dashType}});Ko(i),this.visual.append(i)},e}(Bn);sn(Dh,{animation:{type:"fadeIn",delay:600}});var Uh=Dh,Hh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){t.prototype.render.call(this),this.createSegments()},e.prototype.traverseDataPoints=function(t){for(var e=this.options.series,i=za(e),o=!this.options.invertAxes,r=0;r<e.length;r++)for(var n=e[r],s=0,a=0,p=0;p<i;p++){var h=ma.current.bindPoint(n,p),c=h.valueFields.value,l=h.fields.summary,u=s,f=void 0;l?"total"===l.toLowerCase()?(h.valueFields.value=s,u=0,f=s):(h.valueFields.value=a,f=u-a,a=0):$o(c)&&(a+=c,f=s+=c),t(h,{category:this.categoryAxis.categoryAt(p),categoryIx:p,series:n,seriesIx:r,total:s,runningTotal:a,from:u,to:f,isVertical:o})}},e.prototype.updateRange=function(e,i){t.prototype.updateRange.call(this,{value:i.to},i)},e.prototype.aboveAxis=function(t){return t.value>=0},e.prototype.plotRange=function(t){return[t.from,t.to]},e.prototype.createSegments=function(){for(var t=this.options.series,e=this.seriesPoints,i=this.segments=[],o=0;o<t.length;o++){var r=t[o],n=e[o];if(n)for(var s=void 0,a=0;a<n.length;a++){var p=n[a];if(p&&s){var h=new Uh(s,p,r);i.push(h),this.append(h)}s=p}}},e}(_p),Gh=["area","verticalArea","rangeArea","verticalRangeArea"],Nh=[Pa,Ma].concat(Gh),Wh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(t){if(this.namedCategoryAxes={},this.namedValueAxes={},this.valueAxisRangeTracker=new pp,t.length>0){this.invertAxes=Lr(t[0].type,[ka,"bullet",Ma,"verticalArea","verticalRangeArea","rangeBar","horizontalWaterfall","verticalBoxPlot"]);for(var e=0;e<t.length;e++){var i=t[e].stack;if(i&&"100%"===i.type){this.stack100=!0;break}}}},e.prototype.render=function(t){void 0===t&&(t=this.panes),this.createCategoryAxes(t),this.aggregateCategories(t),this.createCategoryAxesLabels(t),this.createCharts(t),this.createValueAxes(t)},e.prototype.removeAxis=function(e){var i=e.options.name;t.prototype.removeAxis.call(this,e),e instanceof Cs?delete this.namedCategoryAxes[i]:(this.valueAxisRangeTracker.reset(i),delete this.namedValueAxes[i]),e===this.categoryAxis&&delete this.categoryAxis,e===this.valueAxis&&delete this.valueAxis},e.prototype.createCharts=function(t){for(var e=this.groupSeriesByPane(),i=0;i<t.length;i++){var o=t[i],r=e[o.options.name||"default"]||[];this.addToLegend(r);var n=this.filterVisibleSeries(r);if(n)for(var s=this.groupSeriesByCategoryAxis(n),a=0;a<s.length;a++)this.createChartGroup(s[a],o)}},e.prototype.createChartGroup=function(t,e){this.createAreaChart(sh(t,["area","verticalArea"]),e),this.createRangeAreaChart(sh(t,["rangeArea","verticalRangeArea"]),e),this.createBarChart(sh(t,[Ca,ka]),e),this.createRangeBarChart(sh(t,["rangeColumn","rangeBar"]),e),this.createBulletChart(sh(t,["bullet","verticalBullet"]),e),this.createCandlestickChart(sh(t,"candlestick"),e),this.createBoxPlotChart(sh(t,["boxPlot","verticalBoxPlot"]),e),this.createOHLCChart(sh(t,"ohlc"),e),this.createWaterfallChart(sh(t,["waterfall","horizontalWaterfall"]),e),this.createLineChart(sh(t,[Pa,Ma]),e)},e.prototype.aggregateCategories=function(t){var e=this.srcSeries||this.series,i=[];this._currentPointsCache={},this._seriesPointsCache=this._seriesPointsCache||{};for(var o=0;o<e.length;o++){var r=e[o],n=this.seriesCategoryAxis(r),s=this.findPane(n.options.pane);r=(nh(n.options.type,y)||r.categoryField)&&Lr(s,t)?this.aggregateSeries(r,n):this.filterSeries(r,n),i.push(r)}this._seriesPointsCache=this._currentPointsCache,this._currentPointsCache=null,this.srcSeries=e,this.series=i},e.prototype.filterSeries=function(t,e){var i=(t.data||{}).length;if(e._seriesMax=Math.max(e._seriesMax||0,i),!$o(e.options.min)&&!$o(e.options.max))return t;var o=e.currentRangeIndices(),r=Lr(t.type,Nh),n=or({},t);return n.data=(n.data||[]).slice(o.min,o.max+1),r&&fh(n,o,i,(function(i){return{item:t.data[i],category:e.categoryAt(i,!0),categoryIx:i-o.min}}),(function(e){return Nr(t.data[e])})),n},e.prototype.clearSeriesPointsCache=function(){this._seriesPointsCache={}},e.prototype.seriesSourcePoints=function(t,e){var i=t.index+";"+e.categoriesHash();if(this._seriesPointsCache[i])return this._currentPointsCache[i]=this._seriesPointsCache[i],this._seriesPointsCache[i];var o=e.options,r=o.srcCategories,n=nh(o.type,y),s=t.data,a=n?ah:va,p=[];n||e.mapCategories();for(var h=0;h<s.length;h++){var c=void 0;if(c=t.categoryField?a(t.categoryField,s[h],this.chartService.intl):r[h],Nr(c)&&null!==c){var l=e.totalIndex(c);p[l]=p[l]||{items:[],category:c},p[l].items.push(h)}}return this._currentPointsCache[i]=p,p},e.prototype.aggregateSeries=function(t,e){if(!t.data.length)return t;for(var i=this.seriesSourcePoints(t,e),o=or({},t),r=new wh(or({},t),ma.current,Sh.current),n=o.data=[],s=e.options.dataItems||[],a=e.currentRangeIndices(),p=function(t){var o=t-a.min,n=i[t];if(n||(n=i[t]={}),n.categoryIx=o,!n.item){var s=e.categoryAt(t,!0);n.category=s,n.item=r.aggregatePoints(n.items,s)}return n},h=a.min;h<=a.max;h++){var c=p(h);n[c.categoryIx]=c.item,c.items&&c.items.length&&(s[c.categoryIx]=c.item)}return Lr(o.type,Nh)&&fh(o,a,e.totalCount(),p,(function(t){return i[t]})),e.options.dataItems=s,o},e.prototype.appendChart=function(e,i){var o=e.options.series,r=this.seriesCategoryAxis(o[0]),n=r.options.categories,s=Math.max(0,za(o)-n.length);if(s>0)for(n=r.options.categories=r.options.categories.slice(0);s--;)n.push("");this.valueAxisRangeTracker.update(e.valueAxisRanges),t.prototype.appendChart.call(this,e,i)},e.prototype.seriesPaneName=function(t){var e=this.options,i=t.axis,o=Rr([].concat(e.valueAxis),(function(t){return t.name===i}))[0],r=((e.panes||[{}])[0]||{}).name||"default";return(o||{}).pane||r},e.prototype.seriesCategoryAxis=function(t){var e=t.categoryAxis,i=e?this.namedCategoryAxes[e]:this.categoryAxis;if(!i)throw new Error("Unable to locate category axis with name "+e);return i},e.prototype.stackableChartOptions=function(t,e){var i=t.stack;return{isStacked:i,isStacked100:i&&"100%"===i.type,clip:e.options.clip}},e.prototype.groupSeriesByCategoryAxis=function(t){for(var e=[],i={},o=0;o<t.length;o++){var r=t[o].categoryAxis||"$$default$$";i.hasOwnProperty(r)||(i[r]=!0,e.push(r))}for(var n=[],s=0;s<e.length;s++){var a=Xh(t,e[s],s);0!==a.length&&n.push(a)}return n},e.prototype.createBarChart=function(t,e){if(0!==t.length){var i=t[0],o=new _p(this,Object.assign({series:t,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing},this.stackableChartOptions(i,e)));this.appendChart(o,e)}},e.prototype.createRangeBarChart=function(t,e){if(0!==t.length){var i=t[0],o=new Th(this,{series:t,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing});this.appendChart(o,e)}},e.prototype.createBulletChart=function(t,e){if(0!==t.length){var i=t[0],o=new Np(this,{series:t,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing,clip:e.options.clip});this.appendChart(o,e)}},e.prototype.createLineChart=function(t,e){if(0!==t.length){var i=t[0],o=new ip(this,Object.assign({invertAxes:this.invertAxes,series:t},this.stackableChartOptions(i,e)));this.appendChart(o,e)}},e.prototype.createAreaChart=function(t,e){if(0!==t.length){var i=t[0],o=new ap(this,Object.assign({invertAxes:this.invertAxes,series:t},this.stackableChartOptions(i,e)));this.appendChart(o,e)}},e.prototype.createRangeAreaChart=function(t,e){if(0!==t.length){var i=new Eh(this,{invertAxes:this.invertAxes,series:t,clip:e.options.clip});this.appendChart(i,e)}},e.prototype.createOHLCChart=function(t,e){if(0!==t.length){var i=t[0],o=new Fh(this,{invertAxes:this.invertAxes,gap:i.gap,series:t,spacing:i.spacing,clip:e.options.clip});this.appendChart(o,e)}},e.prototype.createCandlestickChart=function(t,e){if(0!==t.length){var i=t[0],o=new Cp(this,{invertAxes:this.invertAxes,gap:i.gap,series:t,spacing:i.spacing,clip:e.options.clip});this.appendChart(o,e)}},e.prototype.createBoxPlotChart=function(t,e){if(0!==t.length){var i=t[0],o=new Op(this,{invertAxes:this.invertAxes,gap:i.gap,series:t,spacing:i.spacing,clip:e.options.clip});this.appendChart(o,e)}},e.prototype.createWaterfallChart=function(t,e){if(0!==t.length){var i=t[0],o=new Hh(this,{series:t,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing});this.appendChart(o,e)}},e.prototype.axisRequiresRounding=function(t,e){for(var i=sh(this.series,Oa),o=0;o<this.series.length;o++){var r=this.series[o];if(Lr(r.type,Gh)){var n=r.line;n&&"step"===n.style&&i.push(r)}}for(var s=0;s<i.length;s++){var a=i[s].categoryAxis||"";if(a===t||!a&&0===e)return!0}},e.prototype.aggregatedAxis=function(t,e){for(var i=this.series,o=0;o<i.length;o++){var r=i[o].categoryAxis||"";if((r===t||!r&&0===e)&&i[o].categoryField)return!0}},e.prototype.createCategoryAxesLabels=function(){for(var t=this.axes,e=0;e<t.length;e++)t[e]instanceof Cs&&t[e].createLabels()},e.prototype.createCategoryAxes=function(t){for(var e=this.invertAxes,i=[].concat(this.options.categoryAxis),o=[],r=0;r<i.length;r++){var n=i[r];if(Lr(this.findPane(n.pane),t)){var s=n.name,a=n.categories;void 0===a&&(a=[]),n=or({vertical:e,reverse:!e&&this.chartService.rtl,axisCrossingValue:e?m:0},n),Nr(n.justified)||(n.justified=this.isJustified()),this.axisRequiresRounding(s,r)&&(n.justified=!1);var p=void 0;if(p=ph(n,a[0])?new Ls(n,this.chartService):new Cs(n,this.chartService),i[r].categories=p.options.srcCategories,s){if(this.namedCategoryAxes[s])throw new Error("Category axis with name "+s+" is already defined");this.namedCategoryAxes[s]=p}p.axisIndex=r,o.push(p),this.appendAxis(p)}}var h=this.categoryAxis||o[0];this.categoryAxis=h,e?this.axisY=h:this.axisX=h},e.prototype.isJustified=function(){for(var t=this.series,e=0;e<t.length;e++){if(!Lr(t[e].type,Gh))return!1}return!0},e.prototype.createValueAxes=function(t){var e=this.valueAxisRangeTracker,i=e.query(),o=[].concat(this.options.valueAxis),r=this.invertAxes,n={vertical:!r,reverse:r&&this.chartService.rtl},s=[];this.stack100&&(n.roundToMajorUnit=!1,n.labels={format:"P0"});for(var a=0;a<o.length;a++){var p=o[a];if(Lr(this.findPane(p.pane),t)){var h=p.name,c=nh(p.type,"log")?{min:.1,max:1}:{min:0,max:1},l=e.query(h)||i||c;0===a&&l&&i&&(l.min=Math.min(l.min,i.min),l.max=Math.max(l.max,i.max));var u=new(nh(p.type,"log")?Ys:Hs)(l.min,l.max,or({},n,p),this.chartService);if(h){if(this.namedValueAxes[h])throw new Error("Value axis with name "+h+" is already defined");this.namedValueAxes[h]=u}u.axisIndex=a,s.push(u),this.appendAxis(u)}}var f=this.valueAxis||s[0];this.valueAxis=f,r?this.axisX=f:this.axisY=f},e.prototype._dispatchEvent=function(t,e,i){var o=t._eventCoordinates(e),r=new An(o.x,o.y),n=this.pointPane(r),s=[],a=[];if(n){for(var p=n.axes,h=0;h<p.length;h++){var c=p[h];c.getValue?ih(a,c.getValue(r)):ih(s,c.getCategory(r))}0===s.length&&ih(s,this.categoryAxis.getCategory(r)),s.length>0&&a.length>0&&t.trigger(i,{element:Yr(e),originalEvent:e,category:hh(s),value:hh(a)})}},e.prototype.pointPane=function(t){for(var e=this.panes,i=0;i<e.length;i++){var o=e[i];if(o.contentBox.containsPoint(t))return o}},e.prototype.updateAxisOptions=function(t,e){qh(this.options,t,e),qh(this.originalOptions,t,e)},e}(xh);function qh(t,e,i){or([].concat(e instanceof Cs?t.categoryAxis:t.valueAxis)[e.axisIndex],i)}function Xh(t,e,i){return Rr(t,(function(t){return 0===i&&!t.categoryAxis||t.categoryAxis===e}))}sn(Wh,{categoryAxis:{},valueAxis:{}}),or(Wh.prototype,bh);var Yh=Wh;function Zh(){this._defaultPrevented=!0}var Kh=function(t){function e(){t.call(this),this._points=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){this._points=[]},e.prototype.show=function(t,e){var i=[].concat(t);this.hide();for(var o=0;o<i.length;o++){var r=i[o];r&&r.toggleHighlight&&r.hasHighlight()&&(this.togglePointHighlight(r,!0,e),this._points.push(r))}},e.prototype.togglePointHighlight=function(t,e,i){var o=(t.options.highlight||{}).toggle;if(o){var r={category:t.category,series:t.series,dataItem:t.dataItem,value:t.value,stackValue:t.stackValue,preventDefault:Zh,visual:t.highlightVisual(),show:e};o(r),r._defaultPrevented||t.toggleHighlight(e,i)}else t.toggleHighlight(e,i)},e.prototype.hide=function(){for(var t=this._points;t.length;)this.togglePointHighlight(t.pop(),!1)},e.prototype.isHighlighted=function(t){for(var e=this._points,i=0;i<e.length;i++){if(t===e[i])return!0}return!1},e}(O);function Jh(t,e){var i=(e||"").toLowerCase(),o=t.event;return"none"===i&&!(o.ctrlKey||o.shiftKey||o.altKey)||o[i+"Key"]}function $h(t){for(var e={},i=0;i<t.length;i++){var o=t[i];o.axis.options.name&&(e[o.axis.options.name]={min:o.range.min,max:o.range.max})}return e}var Qh=function(t){function e(e,i){t.call(this),this.plotArea=e,this.options=or({},this.options,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.start=function(t){return this._active=Jh(t,this.options.key),this._active},e.prototype.move=function(t){if(this._active){var e=this.axisRanges=this._panAxes(t,S).concat(this._panAxes(t,k));if(e.length)return this.axisRanges=e,$h(e)}},e.prototype.end=function(){var t=this._active;return this._active=!1,t},e.prototype.pan=function(){var t=this.plotArea,e=this.axisRanges;if(e.length){for(var i=0;i<e.length;i++){var o=e[i];t.updateAxisOptions(o.axis,o.range)}t.redraw(t.panes)}},e.prototype.destroy=function(){delete this.plotArea},e.prototype._panAxes=function(t,e){var i=this.plotArea,o=-t[e].delta,r=(this.options.lock||"").toLowerCase(),n=[];if(0!==o&&(r||"").toLowerCase()!==e)for(var s=i.axes,a=0;a<s.length;a++){var p=s[a];if(e===S&&!p.options.vertical||e===k&&p.options.vertical){var h=p.pan(o);h&&(h.limitRange=!0,n.push({axis:p,range:h}))}}return n},e}(O);Qh.prototype.options={key:"none",lock:"none"};var tc=Qh,ec=function(t){function e(e,i){t.call(this),this.chart=e,this.options=or({},this.options,i),this.createElement()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createElement=function(){var t=this._marquee=document.createElement("div");t.className="k-marquee";var e=document.createElement("div");e.className="k-marquee-color",t.appendChild(e)},e.prototype.removeElement=function(){this._marquee.parentNode&&this._marquee.parentNode.removeChild(this._marquee)},e.prototype.setStyles=function(t){pr(this._marquee,t)},e.prototype.start=function(t){if(Jh(t,this.options.key)){var e=this.chart,i=e._eventCoordinates(t),o=this._zoomPane=e._plotArea.paneByPoint(i),r=o?o.chartsBox().clone():null;if(o&&r){var n=this._elementOffset();return r.translate(n.left,n.top),this._zoomPaneClipBox=r,document.body.appendChild(this._marquee),this.setStyles({left:t.pageX+1,top:t.pageY+1,width:0,height:0}),!0}}return!1},e.prototype._elementOffset=function(){var t=this.chart.element,e=pr(t,["paddingLeft","paddingTop"]),i=e.paddingLeft,o=e.paddingTop,r=qr(t);return{left:i+r.left,top:o+r.top}},e.prototype.move=function(t){this._zoomPane&&this.setStyles(this._selectionPosition(t))},e.prototype.end=function(t){if(this._zoomPane){var e=this._elementOffset(),i=this._selectionPosition(t);i.left-=e.left,i.top-=e.top;var o={x:i.left,y:i.top},r={x:i.left+i.width,y:i.top+i.height};return this._updateAxisRanges(o,r),this.removeElement(),delete this._zoomPane,$h(this.axisRanges)}},e.prototype.zoom=function(){var t=this.axisRanges;if(t&&t.length){for(var e=this.chart._plotArea,i=0;i<t.length;i++){var o=t[i];e.updateAxisOptions(o.axis,o.range)}e.redraw(e.panes)}},e.prototype.destroy=function(){this.removeElement(),delete this._marquee,delete this.chart},e.prototype._updateAxisRanges=function(t,e){for(var i=(this.options.lock||"").toLowerCase(),o=[],r=this._zoomPane.axes,n=0;n<r.length;n++){var s=r[n],a=s.options.vertical;if((i!==S||a)&&(i!==k||!a)&&Nr(s.axisIndex)){var p=s.pointsRange(t,e);p&&o.push({axis:s,range:p})}}this.axisRanges=o},e.prototype._selectionPosition=function(t){var e=this._zoomPaneClipBox,i={x:t.x.startLocation,y:t.y.startLocation},o=t.x.location,r=t.y.location,n=(this.options.lock||"").toLowerCase(),s=Math.min(i.x,o),a=Math.min(i.y,r),p=Math.abs(i.x-o),h=Math.abs(i.y-r);return n===S&&(s=e.x1,p=e.width()),n===k&&(a=e.y1,h=e.height()),o>e.x2&&(p=e.x2-i.x),o<e.x1&&(p=i.x-e.x1),r>e.y2&&(h=e.y2-i.y),r<e.y1&&(h=i.y-e.y1),{left:Math.max(s,e.x1),top:Math.max(a,e.y1),width:p,height:h}},e}(O);ec.prototype.options={key:"shift",lock:"none"};var ic=ec,oc=function(t){function e(e,i){t.call(this),this.chart=e,this.options=or({},this.options,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.updateRanges=function(t){for(var e=(this.options.lock||"").toLowerCase(),i=[],o=this.chart._plotArea.axes,r=0;r<o.length;r++){var n=o[r],s=n.options.vertical;if((e!==S||s)&&(e!==k||!s)&&n.zoomRange){var a=n.zoomRange(-t);a&&i.push({axis:n,range:a})}}return this.axisRanges=i,$h(i)},e.prototype.zoom=function(){var t=this.axisRanges,e=this.chart._plotArea;if(t&&t.length&&e.updateAxisOptions){for(var i=0;i<t.length;i++){var o=t[i];e.updateAxisOptions(o.axis,o.range)}e.redraw(e.panes)}},e.prototype.destroy=function(){delete this.chart},e}(O),rc=function(t){function e(e,i){t.call(this,e),this.chartService=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=this.children,e=this.options,i=e.vertical;this.visual=new a.Layout(null,{spacing:i?0:e.spacing,lineSpacing:i?e.spacing:0,orientation:i?"vertical":"horizontal",reverse:e.rtl,alignItems:i?"start":"center"});for(var o=0;o<t.length;o++){var r=t[o];r.reflow(new kn),r.renderVisual()}},e.prototype.reflow=function(t){this.visual.rect(t.toRect()),this.visual.reflow();var e=this.visual.clippedBBox();this.box=e?qn(e):new kn},e.prototype.renderVisual=function(){this.addVisual()},e.prototype.createVisual=function(){},e}(Bn),nc=function(t){function e(e){t.call(this,e),this.createContainer(),e.rtl?(this.createLabel(),this.createMarker()):(this.createMarker(),this.createLabel())}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createContainer=function(){this.container=new Hn({vertical:!1,wrap:!1,align:f,spacing:this.options.spacing}),this.append(this.container)},e.prototype.createMarker=function(){this.container.append(new zn(this.markerOptions()))},e.prototype.markerOptions=function(){var t=this.options,e=t.markerColor;return or({},t.markers,{background:e,border:{color:e}})},e.prototype.createLabel=function(){var t=this.options,e=or({},t.labels);this.container.append(new Yn(t.text,e))},e.prototype.renderComplete=function(){t.prototype.renderComplete.call(this);var e=this.options.cursor||{},i=this._itemOverlay=a.Path.fromRect(this.container.box.toRect(),{fill:{color:A,opacity:0},stroke:null,cursor:e.style||e});this.appendVisual(i)},e.prototype.click=function(t,e){var i=this.eventArgs(e);!t.trigger("legendItemClick",i)&&e&&"contextmenu"===e.type&&e.preventDefault()},e.prototype.over=function(t,e){var i=this.eventArgs(e);return t.trigger("legendItemHover",i)||t._legendItemHover(i.seriesIndex,i.pointIndex),!0},e.prototype.out=function(t,e){t._unsetActivePoint(),t.trigger("legendItemLeave",this.eventArgs(e))},e.prototype.eventArgs=function(t){var e=this.options;return{element:Yr(t),text:e.text,series:e.series,seriesIndex:e.series.index,pointIndex:e.pointIndex}},e.prototype.renderVisual=function(){var e=this,i=this.options,o=i.visual;o?(this.visual=o({active:i.active,series:i.series,sender:this.getSender(),pointIndex:i.pointIndex,options:{markers:this.markerOptions(),labels:i.labels},createVisual:function(){e.createVisual(),e.renderChildren(),e.renderComplete();var t=e.visual;return delete e.visual,t}}),this.addVisual()):t.prototype.renderVisual.call(this)},e}(In),sc=function(t){function e(e,i){void 0===i&&(i={}),t.call(this,e),this.chartService=i,Lr(this.options.position,[_,b,u,g,"custom"])||(this.options.position=b),this.createContainers(),this.createLegendTitle(e.title),this.createItems()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createContainers=function(){var t=this.options,e=t.position,i=t.align,o=e,r=f;"custom"===e?o=g:Lr(e,[_,u])?(o="start"===i?g:"end"===i?b:f,r=e):i&&("start"===i?r=_:"end"===i&&(r=u)),this.container=new In({margin:t.margin,padding:t.padding,background:t.background,border:t.border,vAlign:r,align:o,zIndex:t.zIndex,shrinkToFit:!0}),this.hasTitle()?this.itemsContainer=new In({vAlign:r,align:o,zIndex:t.zIndex,shrinkToFit:!0}):this.itemsContainer=this.container,this.append(this.container)},e.prototype.createItems=function(){var t=this.getService(),e=this.options,i=this.isVertical(),o=new rc({vertical:i,spacing:e.spacing,rtl:t.rtl},t),r=e.items;e.reverse&&(r=r.slice(0).reverse());for(var n=r.length,s=0;s<n;s++){var a=r[s];o.append(new nc(or({},{markers:e.markers,labels:e.labels,rtl:t.rtl},e.item,a)))}o.render(),this.itemsContainer.append(o)},e.prototype.isVertical=function(){var t=this.options,e=t.orientation,i=t.position;return"custom"===i&&"horizontal"!==e||(Nr(e)?"horizontal"!==e:Lr(i,[g,b]))},e.prototype.hasItems=function(){return this.container.children[0].children.length>0},e.prototype.reflow=function(t){var e=this.options,i=t.clone();this.hasItems()?("custom"===e.position?(this.containerCustomReflow(i),this.box=i):this.containerReflow(i),this.hasTitle()&&this.title.reflow(new kn(this.container.box.x1,this.title.box.y1,this.container.box.x2,this.title.box.y2))):this.box=i},e.prototype.containerReflow=function(t){var e=this.options,i=this.container,o=e.position,r=e.width,n=e.height,s=o===_||o===u?S:k,a=this.isVertical(),p=t.clone(),h=t.clone();o!==g&&o!==b||(h.y1=p.y1=0),a&&n?(h.y2=h.y1+n,h.align(p,k,i.options.vAlign)):!a&&r&&(h.x2=h.x1+r,h.align(p,S,i.options.align)),i.reflow(h);var c=(h=i.box).clone();(e.offsetX||e.offsetY)&&(h.translate(e.offsetX,e.offsetY),i.reflow(h)),c[s+1]=t[s+1],c[s+2]=t[s+2],this.box=c},e.prototype.containerCustomReflow=function(t){var e=this.options,i=this.container,o=e.offsetX,r=e.offsetY,n=e.width,s=e.height,a=this.isVertical(),p=t.clone();a&&s?p.y2=p.y1+s:!a&&n&&(p.x2=p.x1+n),i.reflow(p),p=i.box,i.reflow(new kn(o,r,o+p.width(),r+p.height()))},e.prototype.renderVisual=function(){this.hasItems()&&t.prototype.renderVisual.call(this)},e.prototype.createLegendTitle=function(t){var e=or({},{color:l,position:_,align:f},t),i=e.text;if(t&&!1!==t.visible){if(Nr(e)&&e.visible){var o=Pr(e);o?i=o({text:i}):e.format&&(i=this.chartService.format.auto(e.format,i))}this.title=new Yn(i,e),this.createTitleLayout(),this.appendTitleLayoutContent()}},e.prototype.createTitleLayout=function(){this.layout=new Hn({vertical:!0,wrap:!1}),this.container.append(this.layout)},e.prototype.hasTitle=function(){return Boolean(this.options.title&&!1!==this.options.title.visible)},e.prototype.appendTitleLayoutContent=function(){this.options.title.position===u?(this.layout.append(this.itemsContainer),this.layout.append(this.title)):(this.layout.append(this.title),this.layout.append(this.itemsContainer))},e}(Bn);sn(sc,{position:b,items:[],offsetX:0,offsetY:0,margin:hr(5),padding:hr(5),border:{color:l,width:0},item:{cursor:"pointer",spacing:6},spacing:6,background:"",zIndex:1,markers:{border:{width:0},width:15,height:3,type:"rect",align:g,vAlign:f}});var ac=sc,pc=function(t){function e(){t.call(this),this._registry=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.register=function(t,e){this._registry.push({type:t,seriesTypes:e})},e.prototype.create=function(t,e,i){for(var o,r=this._registry,n=r[0],s=0;s<r.length;s++){var a=r[s];if((o=sh(t,a.seriesTypes)).length>0){n=a;break}}return new n.type(o,e,i)},e}(O);pc.current=new pc;var hc=pc;function cc(t){var e=document.createElement("div");return t&&(e.className=t),e}function lc(t){for(var e=t;e&&!Br(e,"k-handle");)e=e.parentNode;return e}var uc=function(t){function e(e,i,o,r){t.call(this);var n=e.element;this.options=or({},this.options,o),this.chart=e,this.observer=r,this.chartElement=n,this.categoryAxis=i,this._dateAxis=this.categoryAxis instanceof Ls,this.initOptions(),this.visible=this.options.visible&&n.offsetHeight,this.visible&&(this.createElements(),this.set(this._index(this.options.from),this._index(this.options.to)),this.bindEvents())}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onPane=function(t){return this.categoryAxis.pane===t},e.prototype.createElements=function(){var t=this.options,e=this.wrapper=cc("k-selector");pr(e,{top:t.offset.top,left:t.offset.left,width:t.width,height:t.height,direction:"ltr"});var i=this.selection=cc("k-selection");this.leftMask=cc("k-mask"),this.rightMask=cc("k-mask"),e.appendChild(this.leftMask),e.appendChild(this.rightMask),e.appendChild(i),i.appendChild(cc("k-selection-bg"));var o=this.leftHandle=cc("k-handle k-left-handle"),r=this.rightHandle=cc("k-handle k-right-handle");o.appendChild(cc()),r.appendChild(cc()),i.appendChild(o),i.appendChild(r),this.chartElement.appendChild(e);var n=pr(i,["borderLeftWidth","borderRightWidth","height"]),s=pr(o,"height").height,a=pr(r,"height").height;t.selection={border:{left:n.borderLeftWidth,right:n.borderRightWidth}},pr(o,{top:(n.height-s)/2}),pr(r,{top:(n.height-a)/2}),e.style.cssText=e.style.cssText},e.prototype.bindEvents=function(){var t;!1!==this.options.mousewheel&&(this._mousewheelHandler=this._mousewheel.bind(this),Gr(this.wrapper,((t={})[Ra]=this._mousewheelHandler,t))),this._domEvents=Ar.create(this.wrapper,{stopPropagation:!0,start:this._start.bind(this),move:this._move.bind(this),end:this._end.bind(this),tap:this._tap.bind(this),press:this._press.bind(this),gesturestart:this._gesturestart.bind(this),gesturechange:this._gesturechange.bind(this),gestureend:this._gestureend.bind(this)})},e.prototype.initOptions=function(){var t=this.options,e=this.categoryAxis.pane.chartsBox(),i=this.chart.chartService.intl;this._dateAxis&&or(t,{min:ws(i,t.min),max:ws(i,t.max),from:ws(i,t.from),to:ws(i,t.to)});var o=pr(this.chartElement,["paddingLeft","paddingTop"]),r=o.paddingLeft,n=o.paddingTop;this.options=or({},{width:e.width(),height:e.height()+.1,padding:{left:r,top:n},offset:{left:e.x1+r,top:e.y1+n},from:t.min,to:t.max},t)},e.prototype.destroy=function(){var t;this._domEvents&&(this._domEvents.destroy(),delete this._domEvents),clearTimeout(this._mwTimeout),this._state=null,this.wrapper&&(this._mousewheelHandler&&(en(this.wrapper,((t={})[Ra]=this._mousewheelHandler,t)),this._mousewheelHandler=null),this.chartElement.removeChild(this.wrapper),this.wrapper=null)},e.prototype._rangeEventArgs=function(t){return{axis:this.categoryAxis.options,from:this._value(t.from),to:this._value(t.to)}},e.prototype._start=function(t){var e=this.options,i=Yr(t);if(!this._state&&i){this.chart._unsetActivePoint(),this._state={moveTarget:lc(i)||i,startLocation:t.x?t.x.location:0,range:{from:this._index(e.from),to:this._index(e.to)}};var o=this._rangeEventArgs({from:this._index(e.from),to:this._index(e.to)});this.trigger("selectStart",o)&&(this._state=null)}},e.prototype._press=function(t){var e;(e=this._state?this._state.moveTarget:lc(Yr(t)))&&P(e,"k-handle-active")},e.prototype._move=function(t){if(this._state){var e=this._state,i=this.options,o=this.categoryAxis,r=e.range,n=e.moveTarget,s=o.options.reverse,a=this._index(i.from),p=this._index(i.to),h=this._index(i.min),c=this._index(i.max),l=e.startLocation-t.x.location,u=r.from,f=r.to,d=r.to-r.from,y=pr(this.wrapper,"width").width/(o.categoriesCount()-1),v=Math.round(l/y)*(s?-1:1);if(n){var g=Br(n,"k-left-handle"),m=Br(n,"k-right-handle");Br(n,"k-selection k-selection-bg")?(r.from=Math.min(Math.max(h,a-v),c-d),r.to=Math.min(r.from+d,c)):g&&!s||m&&s?(r.from=Math.min(Math.max(h,a-v),c-1),r.to=Math.max(r.from+1,r.to)):(g&&s||m&&!s)&&(r.to=Math.min(Math.max(h+1,p-v),c),r.from=Math.min(r.to-1,r.from)),r.from===u&&r.to===f||(this.move(r.from,r.to),this.trigger("select",this._rangeEventArgs(r)))}}},e.prototype._end=function(){if(this._state){var t=this._state.moveTarget;t&&M(t,"k-handle-active");var e=this._state.range;this.set(e.from,e.to),this.trigger("selectEnd",this._rangeEventArgs(e)),delete this._state}},e.prototype._tap=function(t){var e=this.options,i=this.categoryAxis,o=this.chart._eventCoordinates(t),r=i.pointCategoryIndex(new An(o.x,i.box.y1)),n=this._index(e.from),s=this._index(e.to),a=this._index(e.min),p=this._index(e.max),h=s-n,c=n+h/2,l={},u=3===t.event.which,f=Math.round(c-r);this._state||u||(this.chart._unsetActivePoint(),i.options.justified||f--,l.from=Math.min(Math.max(a,n-f),p-h),l.to=Math.min(l.from+h,p),this._start(t),this._state&&(this._state.range=l,this.trigger("select",this._rangeEventArgs(l)),this._end()))},e.prototype._mousewheel=function(t){var e=this,i=Dr(t);if(this._start({target:this.selection}),this._state){var o=this._state.range;t.preventDefault(),t.stopPropagation(),Math.abs(i)>1&&(i*=3),this.options.mousewheel.reverse&&(i*=-1),this.expand(i)&&this.trigger("select",{axis:this.categoryAxis.options,delta:i,originalEvent:t,from:this._value(o.from),to:this._value(o.to)}),this._mwTimeout&&clearTimeout(this._mwTimeout),this._mwTimeout=setTimeout((function(){e._end()}),150)}},e.prototype._gesturestart=function(t){var e=this.options;this._state={range:{from:this._index(e.from),to:this._index(e.to)}};var i=this._rangeEventArgs(this._state.range);this.trigger("selectStart",i)?this._state=null:t.preventDefault()},e.prototype._gestureend=function(){this._state&&(this.trigger("selectEnd",this._rangeEventArgs(this._state.range)),delete this._state)},e.prototype._gesturechange=function(t){var e=this.chart,i=this._state,o=this.options,r=this.categoryAxis,n=i.range,s=e._toModelCoordinates(t.touches[0].x.location).x,a=e._toModelCoordinates(t.touches[1].x.location).x,p=Math.min(s,a),h=Math.max(s,a);t.preventDefault(),n.from=r.pointCategoryIndex(new An(p))||o.min,n.to=r.pointCategoryIndex(new An(h))||o.max,this.move(n.from,n.to),this.trigger("select",this._rangeEventArgs(n))},e.prototype._index=function(t){var e=t;return t instanceof Date&&(e=this.categoryAxis.categoryIndex(t)),e},e.prototype._value=function(t){var e=t;return this._dateAxis&&(e=this.categoryAxis.categoryAt(t))>this.options.max&&(e=this.options.max),e},e.prototype._slot=function(t){var e=this.categoryAxis,i=this._index(t);return e.getSlot(i,i,!0)},e.prototype.move=function(t,e){var i=this.options,o=this.categoryAxis.options.reverse,r=i.offset,n=i.padding,s=i.selection.border,a=o?e:t,p=o?t:e,h="x"+(o?2:1),c=this._slot(a),l=tn(c[h]-r.left+n.left);pr(this.leftMask,{width:l}),pr(this.selection,{left:l}),c=this._slot(p);var u=tn(i.width-(c[h]-r.left+n.left));pr(this.rightMask,{width:u});var f=i.width-u;f!==i.width&&(f+=s.right),pr(this.rightMask,{left:f}),pr(this.selection,{width:Math.max(i.width-(l+u)-s.right,0)})},e.prototype.set=function(t,e){var i=this.options,o=this._index(i.min),r=this._index(i.max),n=Jr(this._index(t),o,r),s=Jr(this._index(e),n+1,r);i.visible&&this.move(n,s),i.from=this._value(n),i.to=this._value(s)},e.prototype.expand=function(t){var e=this.options,i=this._index(e.min),o=this._index(e.max),r=e.mousewheel.zoom,n=this._index(e.from),s=this._index(e.to),a={from:n,to:s},p=or({},a);if(this._state&&(a=this._state.range),r!==b&&(a.from=Jr(Jr(n-t,0,s-1),i,o)),r!==g&&(a.to=Jr(Jr(s+t,a.from+1,o),i,o)),a.from!==p.from||a.to!==p.to)return this.set(a.from,a.to),!0},e.prototype.trigger=function(t,e){return(this.observer||this.chart).trigger(t,e)},e}(O);sn(uc,{visible:!0,mousewheel:{zoom:"both"},min:x,max:m});var fc=uc,dc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.show=function(e){if(e&&e.tooltipAnchor&&(!this._current||this._current!==e)){var i=or({},this.options,e.options.tooltip),o=e.tooltipAnchor();o?(this._current=e,t.prototype.show.call(this,{point:e,anchor:o},i,e)):this.hide()}},e.prototype.hide=function(){delete this._current,t.prototype.hide.call(this)},e}(qp),yc=function(t){function e(e,i){t.call(this,e.chartService,i),this.plotArea=e,this.formatService=e.chartService.format}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.showAt=function(t,e){var i=Rr(t,(function(t){var e=t.series.tooltip;return!(e&&!1===e.visible)}));if(i.length>0){var o=i[0],r=this.plotArea.categoryAxis.getSlot(o.categoryIx),n=e?this._slotAnchor(e,r):this._defaultAnchor(o,r);this.show({anchor:n,shared:!0,points:t,category:o.category,categoryText:this.formatService.auto(this.options.categoryFormat,o.category),series:this.plotArea.series},this.options)}},e.prototype._slotAnchor=function(t,e){return this.plotArea.categoryAxis.options.vertical||(t.x=e.center().x),{point:t,align:{horizontal:"left",vertical:"center"}}},e.prototype._defaultAnchor=function(t,e){var i=t.owner.pane.chartsBox(),o=this.plotArea.categoryAxis.options.vertical,r=i.center(),n=e.center();return{point:o?new An(r.x,n.y):new An(n.x,r.y),align:{horizontal:"center",vertical:"center"}}},e}(qp);sn(yc,{categoryFormat:"{0:d}"});var vc=yc,gc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){var t=this.element,e=this.options;if(t.bbox()){this.origin=e.origin;var i=e.vertical?k:S,o=this.fromScale=new p.Point(1,1);o[i]=Aa,t.transform(p.transform().scale(o.x,o.y))}else this.abort()},e.prototype.step=function(t){var e=zr(this.fromScale.x,1,t),i=zr(this.fromScale.y,1,t);this.element.transform(p.transform().scale(e,i,this.origin))},e.prototype.abort=function(){t.prototype.abort.call(this),this.element.transform(null)},e}(a.Animation);sn(gc,{duration:600}),a.AnimationFactory.current.register(ka,gc);var mc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){var t=this.center=this.element.bbox().center();this.element.transform(p.transform().scale(Aa,Aa,t))},e.prototype.step=function(t){this.element.transform(p.transform().scale(t,t,this.center))},e}(a.Animation);sn(mc,{easing:"easeOutElastic"}),a.AnimationFactory.current.register("bubble",mc);var xc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){this.fadeTo=this.element.opacity(),this.element.opacity(0)},e.prototype.step=function(t){this.element.opacity(t*this.fadeTo)},e}(a.Animation);sn(xc,{duration:200,easing:"linear"}),a.AnimationFactory.current.register("fadeIn",xc);var bc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){this.element.transform(p.transform().scale(Aa,Aa,this.options.center))},e.prototype.step=function(t){this.element.transform(p.transform().scale(t,t,this.options.center))},e}(a.Animation);sn(bc,{easing:"easeOutElastic",duration:600}),a.AnimationFactory.current.register(Ta,bc);var _c=bc,wc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){t.prototype.render.call(this),this.renderSegments()},e.prototype.createSegment=function(t,e,i){return new("smooth"===e.style?Za:Na)(t,e,i)},e.prototype.animationPoints=function(){return t.prototype.animationPoints.call(this).concat(this._segments)},e.prototype.createMissingValue=function(t,e){if(e===Sa){var i={x:t.x,y:t.y};return Bp(i.x)||(i.x=0),Bp(i.y)||(i.y=0),i}},e}(Ip);or(wc.prototype,Ka);var Ac=wc,Sc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(){this.namedXAxes={},this.namedYAxes={},this.xAxisRangeTracker=new pp,this.yAxisRangeTracker=new pp},e.prototype.render=function(t){void 0===t&&(t=this.panes);for(var e=this.groupSeriesByPane(),i=0;i<t.length;i++){var o=t[i],r=e[o.options.name||"default"]||[];this.addToLegend(r);var n=this.filterVisibleSeries(r);n&&(this.createScatterChart(sh(n,"scatter"),o),this.createScatterLineChart(sh(n,"scatterLine"),o),this.createBubbleChart(sh(n,"bubble"),o))}this.createAxes(t)},e.prototype.appendChart=function(e,i){this.xAxisRangeTracker.update(e.xAxisRanges),this.yAxisRangeTracker.update(e.yAxisRanges),t.prototype.appendChart.call(this,e,i)},e.prototype.removeAxis=function(e){var i=e.options.name;t.prototype.removeAxis.call(this,e),e.options.vertical?(this.yAxisRangeTracker.reset(i),delete this.namedYAxes[i]):(this.xAxisRangeTracker.reset(i),delete this.namedXAxes[i]),e===this.axisX&&delete this.axisX,e===this.axisY&&delete this.axisY},e.prototype.seriesPaneName=function(t){var e=this.options,i=t.xAxis,o=Rr([].concat(e.xAxis),(function(t){return t.name===i}))[0],r=t.yAxis,n=Rr([].concat(e.yAxis),(function(t){return t.name===r}))[0],s=(e.panes||[{}])[0].name||"default";return(o||{}).pane||(n||{}).pane||s},e.prototype.createScatterChart=function(t,e){t.length>0&&this.appendChart(new Ip(this,{series:t,clip:e.options.clip}),e)},e.prototype.createScatterLineChart=function(t,e){t.length>0&&this.appendChart(new Ac(this,{series:t,clip:e.options.clip}),e)},e.prototype.createBubbleChart=function(t,e){t.length>0&&this.appendChart(new Vp(this,{series:t,clip:e.options.clip}),e)},e.prototype.createXYAxis=function(t,e,i){for(var o,r=t.name,n=e?this.namedYAxes:this.namedXAxes,s=e?this.yAxisRangeTracker:this.xAxisRangeTracker,a=or({reverse:!e&&this.chartService.rtl},t,{vertical:e}),p=nh(a.type,"log"),h=s.query(),c=p?{min:.1,max:1}:{min:0,max:1},l=s.query(r)||h||c,u=[a.min,a.max],f=this.series,d=0;d<f.length;d++){var v=f[d],g=v[e?"yAxis":"xAxis"];if(g===a.name||0===i&&!g){var m=ma.current.bindPoint(v,0).valueFields;u.push(m[e?"y":"x"]);break}}0===i&&h&&(l.min=Math.min(l.min,h.min),l.max=Math.max(l.max,h.max));for(var x=0;x<u.length;x++)if(u[x]instanceof Date){o=!0;break}var b=new(nh(a.type,y)||!a.type&&o?Ns:p?Ys:Hs)(l.min,l.max,a,this.chartService);if(b.axisIndex=i,r){if(n[r])throw new Error((e?"Y":"X")+" axis with name "+r+" is already defined");n[r]=b}return this.appendAxis(b),b},e.prototype.createAxes=function(t){for(var e=this.options,i=[].concat(e.xAxis),o=[],r=[].concat(e.yAxis),n=[],s=0;s<i.length;s++){Lr(this.findPane(i[s].pane),t)&&o.push(this.createXYAxis(i[s],!1,s))}for(var a=0;a<r.length;a++){Lr(this.findPane(r[a].pane),t)&&n.push(this.createXYAxis(r[a],!0,a))}this.axisX=this.axisX||o[0],this.axisY=this.axisY||n[0]},e.prototype._dispatchEvent=function(t,e,i){for(var o=t._eventCoordinates(e),r=new An(o.x,o.y),n=this.axes,s=n.length,a=[],p=[],h=0;h<s;h++){var c=n[h],l=c.options.vertical?p:a,u=c.getValue(r);null!==u&&l.push(u)}a.length>0&&p.length>0&&t.trigger(i,{element:Yr(e),originalEvent:e,x:hh(a),y:hh(p)})},e.prototype.updateAxisOptions=function(t,e){var i=t.options.vertical,o=this.groupAxes(this.panes),r=(i?o.y:o.x).indexOf(t);kc(this.options,r,i,e),kc(this.originalOptions,r,i,e)},e}(xh);function kc(t,e,i,o){or([].concat(i?t.yAxis:t.xAxis)[e],o)}sn(Sc,{xAxis:{},yAxis:{}}),or(Sc.prototype,bh);var Cc=Sc,Pc=function(t){function e(e,i,o){t.call(this,o),this.value=e,this.sector=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=this.options.labels,e=this.owner.chartService,i=this.value;if(!this._rendered&&!1!==this.visible){this._rendered=!0;var o=Pr(t),r=this.pointData();if(o?i=o(r):t.format&&(i=e.format.auto(t.format,i)),t.visible&&(i||0===i)){if(t.position===f||"insideEnd"===t.position)t.color||(t.color=yn(this.options.color)),t.background||(t.background=this.options.color);else{var n=e.theme.seriesDefaults.labels;t.color=t.color||n.color,t.background=t.background||n.background}this.label=new Yn(i,or({},t,{align:f,vAlign:"",animation:{type:"fadeIn",delay:this.animationDelay}}),r),this.append(this.label)}}},e.prototype.reflow=function(t){this.render(),this.box=t,this.reflowLabel()},e.prototype.reflowLabel=function(){var t=this.options.labels,e=this.label,i=this.sector.clone(),o=t.distance,r=i.middle();if(e){var n,s=e.box.height(),a=e.box.width();if(t.position===f)i.radius=Math.abs((i.radius-s)/2)+s,n=i.point(r),e.reflow(new kn(n.x,n.y-s/2,n.x,n.y));else if("insideEnd"===t.position)i.radius=i.radius-s/2,n=i.point(r),e.reflow(new kn(n.x,n.y-s/2,n.x,n.y));else{var p;(n=i.clone().expand(o).point(r)).x>=i.center.x?(p=n.x+a,e.orientation=b):(p=n.x-a,e.orientation=g),e.reflow(new kn(p,n.y-s,n.x,n.y))}}},e.prototype.createVisual=function(){var e=this,i=this.sector,o=this.options;if(t.prototype.createVisual.call(this),this.value)if(o.visual){var r=(i.startAngle+180)%360,n=o.visual({category:this.category,dataItem:this.dataItem,value:this.value,series:this.series,percentage:this.percentage,center:new p.Point(i.center.x,i.center.y),radius:i.radius,innerRadius:i.innerRadius,startAngle:r,endAngle:r+i.angle,options:o,sender:this.getSender(),createVisual:function(){var t=new a.Group;return e.createSegmentVisual(t),t}});n&&this.visual.append(n)}else this.createSegmentVisual(this.visual)},e.prototype.createSegmentVisual=function(t){var e=this.sector,i=this.options,o=i.border||{},r=o.width>0?{stroke:{color:o.color,width:o.width,opacity:o.opacity,dashType:o.dashType}}:{},n=i.color,s={color:n,opacity:i.opacity},a=this.createSegment(e,or({fill:s,stroke:{opacity:i.opacity},zIndex:i.zIndex},r));t.append(a),lp(i)&&t.append(this.createGradientOverlay(a,{baseColor:n,fallbackFill:s},or({center:[e.center.x,e.center.y],innerRadius:e.innerRadius,radius:e.radius,userSpace:!0},i.overlay)))},e.prototype.createSegment=function(t,e){return e.singleSegment?new a.Circle(new p.Circle(new p.Point(t.center.x,t.center.y),t.radius),e):On.current.createRing(t,e)},e.prototype.createAnimation=function(){var e=this.options,i=this.sector.center;or(e,{animation:{center:[i.x,i.y],delay:this.animationDelay}}),t.prototype.createAnimation.call(this)},e.prototype.createHighlight=function(t){var e=this.options.highlight||{},i=e.border||{};return this.createSegment(this.sector,or({},t,{fill:{color:e.color,opacity:e.opacity},stroke:{opacity:i.opacity,width:i.width,color:i.color}}))},e.prototype.highlightVisual=function(){return this.visual.children[0]},e.prototype.highlightVisualArgs=function(){var t=this.sector;return{options:this.options,radius:t.radius,innerRadius:t.innerRadius,center:new p.Point(t.center.x,t.center.y),startAngle:t.startAngle,endAngle:t.angle+t.startAngle,visual:this.visual}},e.prototype.tooltipAnchor=function(){var t=this.sector.clone().expand(5),e=t.middle();return{point:t.point(e),align:Oc(e+180)}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e.prototype.pointData=function(){return{dataItem:this.dataItem,category:this.category,value:this.value,series:this.series,percentage:this.percentage}},e}(Bn),Tc=tn(Qr(30),10),Mc=tn(Qr(60),10);function Oc(t){var e=Qr(t),i=tn(Math.sin(e),10),o=tn(Math.cos(e),10);return{horizontal:Math.abs(i)>Mc?f:o<0?b:g,vertical:Math.abs(i)<Tc?f:i<0?u:_}}sn(Pc,{color:A,overlay:{gradient:"roundedBevel"},border:{width:.5},labels:{visible:!1,distance:35,font:"12px sans-serif",margin:hr(.5),align:d,zIndex:1,position:"outsideEnd"},animation:{type:Ta},highlight:{visible:!0,border:{width:1}},visible:!0}),or(Pc.prototype,Fa);var Rc=Pc,Bc={createLegendItem:function(t,e,i){var o=this.options.legend||{},r=o.labels||{},n=o.inactiveItems||{},s=n.labels||{};if(i&&!1!==i.visibleInLegend){var a,p,h=!1!==i.visible,c=h?Pr(r):Pr(s)||Pr(r),l=i.category;c&&(l=c({text:l,series:i.series,dataItem:i.dataItem,percentage:i.percentage,value:t})),h?(a={},p=e.color):(a={color:s.color,font:s.font},p=(n.markers||{}).color),Bp(l)&&""!==l&&this.legendItems.push({active:h,pointIndex:i.index,text:l,series:i.series,markerColor:p,labels:a})}}},jc=function(t){function e(e,i){t.call(this,i),this.plotArea=e,this.chartService=e.chartService,this.points=[],this.legendItems=[],this.render()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this.traverseDataPoints(this.addValue.bind(this))},e.prototype.traverseDataPoints=function(t){var e=this.options,i=this.plotArea.options.seriesColors;void 0===i&&(i=[]);for(var o=i.length,r=e.series,n=r.length,s=0;s<n;s++){var a=r[s],p=a.data,h=rh(a),c=h.total,l=h.points,u=h.count,d=360/c,y=void 0;isFinite(d)||(y=360/u);var v=void 0;v=Nr(a.startAngle)?a.startAngle:e.startAngle,s!==n-1&&"outsideEnd"===a.labels.position&&(a.labels.position=f);for(var g=0;g<l.length;g++){var m=l[g];if(m){var x=m.fields,b=m.value,_=m.visible,w=0!==b?y||b*d:0,A=1!==p.length&&Boolean(x.explode);er(a.color)||(a.color=x.color||i[g%o]),t(m.valueFields.value,new Pn(null,0,0,v,w),{owner:this,category:Nr(x.category)?x.category:"",index:g,series:a,seriesIx:s,dataItem:p[g],percentage:0!==c?b/c:0,explode:A,visibleInLegend:x.visibleInLegend,visible:_,zIndex:n-s,animationDelay:this.animationDelay(g,s,n)}),!1!==_&&(v+=w)}}}},e.prototype.evalSegmentOptions=function(t,e,i){var o=i.series;La(t,{value:e,series:o,dataItem:i.dataItem,category:i.category,percentage:i.percentage},{defaults:o._defaults,excluded:["data","content","template","visual","toggle"]})},e.prototype.addValue=function(t,e,i){var o=or({},i.series,{index:i.index});if(this.evalSegmentOptions(o,t,i),this.createLegendItem(t,o,i),!1!==i.visible){var r=new Rc(t,e,o);Object.assign(r,i),this.append(r),this.points.push(r)}},e.prototype.reflow=function(t){var e=this.options,i=this.points,o=this.seriesConfigs;void 0===o&&(o=[]);var r=i.length,n=t.clone(),s=Math.min(n.width(),n.height()),a=s/2,p=s-.85*s,h=new kn(n.x1,n.y1,n.x1+s,n.y1+s),c=h.center(),l=n.center(),u=e.series.length,f=[],d=[],y=on(e.padding,p);this.targetBox=t,y=y>a-5?a-5:y,h.translate(l.x-c.x,l.y-c.y);for(var v=a-y,g=new An(v+h.x1+y,v+h.y1+y),m=0;m<r;m++){var x=i[m],_=x.sector,w=x.seriesIx;if(_.radius=v,_.center=g,o.length){var A=o[w];_.innerRadius=A.innerRadius,_.radius=A.radius}w===u-1&&x.explode&&(_.center=_.clone().setRadius(.15*_.radius).point(_.middle())),x.reflow(h);var S=x.label;S&&"outsideEnd"===S.options.position&&w===u-1&&(S.orientation===b?d.push(S):f.push(S))}f.length>0&&(f.sort(this.labelComparator(!0)),this.leftLabelsReflow(f)),d.length>0&&(d.sort(this.labelComparator(!1)),this.rightLabelsReflow(d)),this.box=h},e.prototype.leftLabelsReflow=function(t){var e=this.distanceBetweenLabels(t);this.distributeLabels(e,t)},e.prototype.rightLabelsReflow=function(t){var e=this.distanceBetweenLabels(t);this.distributeLabels(e,t)},e.prototype.distanceBetweenLabels=function(t){var e=Kr(this.points),i=e.sector,o=t.length-1,r=i.radius+e.options.labels.distance,n=[],s=t[0].box,a=tn(s.y1-(i.center.y-r-s.height()-s.height()/2));n.push(a);for(var p=0;p<o;p++){var h=t[p+1].box;s=t[p].box,a=tn(h.y1-s.y2),n.push(a)}return a=tn(i.center.y+r-t[o].box.y2-t[o].box.height()/2),n.push(a),n},e.prototype.distributeLabels=function(t,e){for(var i,o,r,n=t.length,s=0;s<n;s++)for(r=-t[s],i=o=s;r>0&&(i>=0||o<n);)r=this._takeDistance(t,s,--i,r),r=this._takeDistance(t,s,++o,r);this.reflowLabels(t,e)},e.prototype._takeDistance=function(t,e,i,o){var r=o;if(t[i]>0){var n=Math.min(t[i],r);r-=n,t[i]-=n,t[e]+=n}return r},e.prototype.reflowLabels=function(t,e){var i,o=Kr(this.points),r=o.sector,n=o.options.labels,s=e.length,a=n.distance,p=r.center.y-(r.radius+a)-e[0].box.height();t[0]+=2;for(var h=0;h<s;h++){var c=e[h],l=c.box;p+=t[h],i=this.hAlignLabel(l.x2,r.clone().expand(a),p,p+l.height(),c.orientation===b),c.orientation===b?(n.align!==d&&(i=r.radius+r.center.x+a),c.reflow(new kn(i+l.width(),p,i,p))):(n.align!==d&&(i=r.center.x-r.radius-a),c.reflow(new kn(i-l.width(),p,i,p))),p+=l.height()}},e.prototype.createVisual=function(){var e=this.options.connectors,i=this.points,o=i.length;t.prototype.createVisual.call(this),this._connectorLines=[];for(var r=0;r<o;r++){var n=i[r],s=n.sector,p=n.label,h=s.middle(),c=(n.options.connectors||{}).color||e.color;if(p){var l=new a.Path({stroke:{color:c,width:e.width},animation:{type:"fadeIn",delay:n.animationDelay}});if("outsideEnd"===p.options.position){var u=p.box,f=s.center,d=s.point(h),y=new An(u.x1,u.center().y),v=void 0,g=void 0,m=void 0;d=s.clone().expand(e.padding).point(h),l.moveTo(d.x,d.y),p.orientation===b?(m=Ic(f,d,y,g=new An(u.x1-e.padding,u.center().y)),y=new An(g.x-4,g.y),(m=m||y).x=Math.min(m.x,y.x),this.pointInCircle(m,s.center,s.radius+4)||m.x<s.center.x?(v=s.center.x+s.radius+4,n.options.labels.align!==Ca?v<y.x?l.lineTo(v,d.y):l.lineTo(d.x+8,d.y):l.lineTo(v,d.y),l.lineTo(y.x,g.y)):(m.y=g.y,l.lineTo(m.x,m.y))):(m=Ic(f,d,y,g=new An(u.x2+e.padding,u.center().y)),y=new An(g.x+4,g.y),(m=m||y).x=Math.max(m.x,y.x),this.pointInCircle(m,s.center,s.radius+4)||m.x>s.center.x?(v=s.center.x-s.radius-4,n.options.labels.align!==Ca?v>y.x?l.lineTo(v,d.y):l.lineTo(d.x-8,d.y):l.lineTo(v,d.y),l.lineTo(y.x,g.y)):(m.y=g.y,l.lineTo(m.x,m.y))),l.lineTo(g.x,g.y),this._connectorLines.push(l),this.visual.append(l)}}}},e.prototype.renderVisual=function(){if(t.prototype.renderVisual.call(this),pn(this.options.series,(function(t){return t.autoFit}))){var e=this.targetBox,i=this.box.center(),o=this.visual.bbox();if(!o)return;var r=o.bottomRight(),n=Math.min((i.y-e.y1)/(i.y-o.origin.y),(e.y2-i.y)/(r.y-i.y),(i.x-e.x1)/(i.x-o.origin.x),(e.x2-i.x)/(r.x-i.x));n<1&&this.visual.transform(p.transform().scale(n,n,[i.x,i.y]))}},e.prototype.labelComparator=function(t){var e=t?-1:1;return function(t,i){return((t.parent.sector.middle()+270)%360-(i.parent.sector.middle()+270)%360)*e}},e.prototype.hAlignLabel=function(t,e,i,o,r){var n=e.radius,s=e.center,a=s.x,p=s.y,h=Math.min(Math.abs(p-i),Math.abs(p-o));return h>n?t:a+Math.sqrt(n*n-h*h)*(r?1:-1)},e.prototype.pointInCircle=function(t,e,i){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<Math.pow(i,2)},e.prototype.formatPointValue=function(t,e){return this.chartService.format.auto(e,t.value)},e.prototype.animationDelay=function(t){return 70*t},e.prototype.stackRoot=function(){return this},e}(Bn);function Ic(t,e,i,o){var r,n=(o.x-i.x)*(t.y-i.y)-(o.y-i.y)*(t.x-i.x),s=(o.y-i.y)*(e.x-t.x)-(o.x-i.x)*(e.y-t.y);if(0!==s){var a=n/s;r=new An(t.x+a*(e.x-t.x),t.y+a*(e.y-t.y))}return r}sn(jc,{startAngle:90,connectors:{width:2,color:"#939393",padding:8},inactiveItems:{markers:{},labels:{}}}),or(jc.prototype,Bc),jc.prototype.isStackRoot=!0;var Lc=jc,zc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this.createPieChart(this.series)},e.prototype.createPieChart=function(t){var e=t[0],i=new Lc(this,{series:t,padding:e.padding,startAngle:e.startAngle,connectors:e.connectors,legend:this.options.legend});this.appendChart(i)},e.prototype.appendChart=function(e,i){t.prototype.appendChart.call(this,e,i),Hr(this.options.legend.items,e.legendItems)},e}(xh),Ec=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflowLabel=function(){var e=this.options.labels,i=this.label,o=this.sector.clone(),r=o.middle();if(i){var n=i.box.height();if(e.position===f){o.radius-=(o.radius-o.innerRadius)/2;var s=o.point(r);i.reflow(new kn(s.x,s.y-n/2,s.x,s.y))}else t.prototype.reflowLabel.call(this)}},e.prototype.createSegment=function(t,e){return On.current.createRing(t,e)},e}(Rc);sn(Ec,{overlay:{gradient:"roundedGlass"},labels:{position:f},animation:{type:Ta}}),or(Ec.prototype,Fa);var Vc=Ec,Fc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addValue=function(t,e,i){var o=or({},i.series,{index:i.index});if(this.evalSegmentOptions(o,t,i),this.createLegendItem(t,o,i),t&&!1!==i.visible){var r=new Vc(t,e,o);Object.assign(r,i),this.append(r),this.points.push(r)}},e.prototype.reflow=function(e){for(var i,o=this.options,r=e.clone(),n=Math.min(r.width(),r.height()),s=n/2,a=n-.85*n,p=o.series,h=p.length,c=on(o.padding,a),l=s-(c=c>s-5?s-5:c),u=0,f=0;f<h;f++){var d=p[f];0===f&&Nr(d.holeSize)&&(i=d.holeSize,l-=d.holeSize),Nr(d.size)?l-=d.size:u++,Nr(d.margin)&&f!==h-1&&(l-=d.margin)}Nr(i)||(l-=i=.75*((s-c)/(h+.75)));var y,v=i,g=0;this.seriesConfigs=[];for(var m=0;m<h;m++){var x=p[m];y=(v+=g)+on(x.size,l/u),this.seriesConfigs.push({innerRadius:v,radius:y}),g=x.margin||0,v=y}t.prototype.reflow.call(this,e)},e.prototype.animationDelay=function(t,e,i){return 50*t+600*(e+1)/(i+1)},e}(Lc);sn(Fc,{startAngle:90,connectors:{width:2,color:"#939393",padding:8}});var Dc=Fc,Uc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this.createDonutChart(this.series)},e.prototype.createDonutChart=function(t){var e=t[0],i=new Dc(this,{series:t,padding:e.padding,connectors:e.connectors,legend:this.options.legend});this.appendChart(i)},e}(zc),Hc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(){this.valueAxisRangeTracker=new pp},e.prototype.render=function(){this.addToLegend(this.series),this.createPolarAxis(),this.createCharts(),this.createValueAxis()},e.prototype.alignAxes=function(){var t=this.valueAxis,e=t.range(),i=t.options.reverse?e.max:e.min,o=t.getSlot(i),r=this.polarAxis.getSlot(0).center,n=t.box.translate(r.x-o.x1,r.y-o.y1);t.reflow(n)},e.prototype.createValueAxis=function(){var t,e,i=this.valueAxisRangeTracker,o=i.query(),r=this.valueAxisOptions({roundToMajorUnit:!1,zIndex:-1});"log"===r.type?(t=na,e={min:.1,max:1}):(t=oa,e={min:0,max:1});var n=i.query(name)||o||e;n&&o&&(n.min=Math.min(n.min,o.min),n.max=Math.max(n.max,o.max));var s=new t(n.min,n.max,r,this.chartService);this.valueAxis=s,this.appendAxis(s)},e.prototype.reflowAxes=function(){var t=this.options.plotArea,e=this.valueAxis,i=this.polarAxis,o=this.box,r=.15*Math.min(o.width(),o.height()),n=hr(t.padding||{},r),s=o.clone().unpad(n),a=s.clone();a.y2=a.y1+Math.min(a.width(),a.height()),a.align(s,k,f);var p=a.clone().shrink(0,a.height()/2);i.reflow(a),e.reflow(p);var h=e.lineBox().height()-e.box.height();e.reflow(e.box.unpad({top:h})),this.axisBox=a,this.alignAxes(a)},e.prototype.backgroundBox=function(){return this.box},e.prototype.detachLabels=function(){},e}(xh),Gc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointSlot=function(t,e){var i=t.center.y-e.y1,o=An.onCircle(t.center,t.startAngle,i);return new kn(o.x,o.y,o.x,o.y)},e}(Ip);sn(Gc,{clip:!1});var Nc=Gc,Wc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ac);Wc.prototype.pointSlot=Nc.prototype.pointSlot,sn(Wc,{clip:!1});var qc=Wc,Xc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.fillToAxes=function(t){var e=this._polarAxisCenter();t.lineTo(e.x,e.y)},e.prototype._polarAxisCenter=function(){return this.parent.plotArea.polarAxis.box.center()},e.prototype.strokeSegments=function(){var t=this._strokeSegments;if(!t){var e=this._polarAxisCenter(),i=new aa(!1),o=this.points();o.push(e),(t=this._strokeSegments=i.process(o)).pop()}return t},e}(sp),Yc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.fillToAxes=function(t){var e=this.parent.plotArea.polarAxis.box.center(),i=new p.Segment([e.x,e.y]);t.segments.unshift(i),t.segments.push(i)},e}(op);function Zc(t,e){return t.value.x-e.value.x}var Kc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createSegment=function(t,e,i){return"smooth"===(e.line||{}).style?new Xc(t,e,i):new Yc(t,e,i)},e.prototype.createMissingValue=function(t,e){var i;return Bp(t.x)&&"interpolate"!==e&&(i={x:t.x,y:t.y},e===Sa&&(i.y=0)),i},e.prototype.seriesMissingValues=function(t){return t.missingValues||Sa},e.prototype._hasMissingValuesGap=function(){for(var t=this.options.series,e=0;e<t.length;e++)if("gap"===this.seriesMissingValues(t[e]))return!0},e.prototype.sortPoints=function(t){if(t.sort(Zc),this._hasMissingValuesGap())for(var e=0;e<t.length;e++){var i=t[e];if(i)Bp(i.value.y)||"gap"!==this.seriesMissingValues(i.series)||delete t[e]}return t},e}(qc),Jc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createPolarAxis=function(){var t=new Qs(this.options.xAxis,this.chartService);this.polarAxis=t,this.axisX=t,this.appendAxis(t)},e.prototype.valueAxisOptions=function(t){return or(t,{majorGridLines:{type:c},minorGridLines:{type:c}},this.options.yAxis)},e.prototype.createValueAxis=function(){t.prototype.createValueAxis.call(this),this.axisY=this.valueAxis},e.prototype.appendChart=function(t,e){this.valueAxisRangeTracker.update(t.yAxisRanges),xh.prototype.appendChart.call(this,t,e)},e.prototype.createCharts=function(){var t=this.filterVisibleSeries(this.series),e=this.panes[0];this.createLineChart(sh(t,["polarLine"]),e),this.createScatterChart(sh(t,["polarScatter"]),e),this.createAreaChart(sh(t,["polarArea"]),e)},e.prototype.createLineChart=function(t,e){if(0!==t.length){var i=new qc(this,{series:t});this.appendChart(i,e)}},e.prototype.createScatterChart=function(t,e){if(0!==t.length){var i=new Nc(this,{series:t});this.appendChart(i,e)}},e.prototype.createAreaChart=function(t,e){if(0!==t.length){var i=new Kc(this,{series:t});this.appendChart(i,e)}},e.prototype._dispatchEvent=function(t,e,i){var o=t._eventCoordinates(e),r=new An(o.x,o.y),n=this.axisX.getValue(r),s=this.axisY.getValue(r);null!==n&&null!==s&&t.trigger(i,{element:Yr(e),x:n,y:s})},e.prototype.createCrosshairs=function(){},e}(Hc);sn(Jc,{xAxis:{},yAxis:{}}),or(Jc.prototype,bh);var $c=Jc;var Qc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointSlot=function(t,e){var i=t.center.y-e.y1,o=An.onCircle(t.center,t.middle(),i);return new kn(o.x,o.y,o.x,o.y)},e.prototype.renderSegments=function(){if(t.prototype.renderSegments.call(this),this._segments&&this._segments.length>1)for(var e=function(t){for(var e=[],i=0;i<t.length;i++){var o=t[i];e[o.seriesIx]=e[o.seriesIx]||[],e[o.seriesIx].push(o)}return e}(this._segments),i=0;i<e.length;i++){var o=e[i];if(o&&o.length>1){var r=o[0].linePoints[0],n=Kr(o),s=Kr(n.linePoints),a=0===r.categoryIx,p=s.categoryIx===s.categoriesCount-1;a&&p&&Kr(o).linePoints.push(r)}}},e.prototype.createSegment=function(t,e,i){var o=new("smooth"===e.style?Za:Na)(t,e,i),r=this.seriesMissingValues(e);return t.length!==e.data.length&&"interpolate"!==r||(o.options.closed=!0),o},e}(ip);sn(Qc,{clip:!1,limitPoints:!1});var tl=Qc,el=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.fillToAxes=function(){},e}(sp),il=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.fillToAxes=function(){},e}(op),ol=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createSegment=function(t,e,i,o){var r,n,s,a=this.options.isStacked,p=(e.line||{}).style;return a&&i>0&&o&&(n=o.linePoints.slice(0),r=o),"smooth"===p?(s=new el(t,e,i,r,n)).options.closed=!0:(t.push(t[0]),s=new il(t,e,i,r,n)),s},e.prototype.seriesMissingValues=function(t){return t.missingValues||Sa},e}(tl),rl=function(t){function e(e,i){t.call(this,e,null,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Vc);sn(rl,{overlay:{gradient:"none"},labels:{distance:10}});var nl=rl,sl=function(t){function e(e){t.call(this,e),this.forEach=e.rtl?yp:dp}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.options,i=this.children,o=e.gap,r=e.spacing,n=i.length,s=n+o+r*(n-1),a=t.angle/s,p=t.startAngle+a*(o/2);this.forEach(i,(function(e){var i=t.clone();i.startAngle=p,i.angle=a,e.sector&&(i.radius=e.sector.radius),e.reflow(i),e.sector=i,p+=a+a*r}))},e}(Bn);sn(sl,{gap:1,spacing:0});var al=sl,pl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.options.reverse,i=this.children,o=i.length,r=e?o-1:0,n=e?-1:1;this.box=new kn;for(var s=r;s>=0&&s<o;s+=n){var a=i[s].sector;a.startAngle=t.startAngle,a.angle=t.angle}},e}(Bn),hl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointType=function(){return nl},e.prototype.clusterType=function(){return al},e.prototype.stackType=function(){return pl},e.prototype.categorySlot=function(t,e){return t.getSlot(e)},e.prototype.pointSlot=function(t,e){var i=t.clone(),o=t.center.y;return i.radius=o-e.y1,i.innerRadius=o-e.y2,i},e.prototype.reflowPoint=function(t,e){t.sector=e,t.reflow()},e.prototype.createAnimation=function(){this.options.animation.center=this.box.toRect().center(),t.prototype.createAnimation.call(this)},e}(_p);hl.prototype.reflow=Va.prototype.reflow,sn(hl,{clip:!1,limitPoints:!1,animation:{type:"pie"}});var cl=hl,ll=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createPolarAxis=function(){var t=new Js(this.options.categoryAxis,this.chartService);this.polarAxis=t,this.categoryAxis=t,this.appendAxis(t),this.aggregateCategories(),this.createCategoryAxesLabels()},e.prototype.valueAxisOptions=function(t){return this._hasBarCharts&&or(t,{majorGridLines:{type:c},minorGridLines:{type:c}}),this._isStacked100&&or(t,{roundToMajorUnit:!1,labels:{format:"P0"}}),or(t,this.options.valueAxis)},e.prototype.aggregateCategories=function(){Yh.prototype.aggregateCategories.call(this,this.panes)},e.prototype.createCategoryAxesLabels=function(){Yh.prototype.createCategoryAxesLabels.call(this,this.panes)},e.prototype.filterSeries=function(t){return t},e.prototype.createCharts=function(){var t=this.filterVisibleSeries(this.series),e=this.panes[0];this.createAreaChart(sh(t,["radarArea"]),e),this.createLineChart(sh(t,["radarLine"]),e),this.createBarChart(sh(t,["radarColumn"]),e)},e.prototype.chartOptions=function(t){var e={series:t},i=t[0];if(i){var o=this.filterVisibleSeries(t),r=i.stack;e.isStacked=r&&o.length>1,e.isStacked100=r&&"100%"===r.type&&o.length>1,e.isStacked100&&(this._isStacked100=!0)}return e},e.prototype.createAreaChart=function(t,e){if(0!==t.length){var i=new ol(this,this.chartOptions(t));this.appendChart(i,e)}},e.prototype.createLineChart=function(t,e){if(0!==t.length){var i=new tl(this,this.chartOptions(t));this.appendChart(i,e)}},e.prototype.createBarChart=function(t,e){if(0!==t.length){var i=t[0],o=this.chartOptions(t);o.gap=i.gap,o.spacing=i.spacing;var r=new cl(this,o);this.appendChart(r,e),this._hasBarCharts=!0}},e.prototype.seriesCategoryAxis=function(){return this.categoryAxis},e.prototype._dispatchEvent=function(t,e,i){var o=t._eventCoordinates(e),r=new An(o.x,o.y),n=this.categoryAxis.getCategory(r),s=this.valueAxis.getValue(r);null!==n&&null!==s&&t.trigger(i,{element:Yr(e),category:n,value:s})},e.prototype.createCrosshairs=function(){},e}(Hc);or(ll.prototype,bh,{appendChart:Yh.prototype.appendChart,aggregateSeries:Yh.prototype.aggregateSeries,seriesSourcePoints:Yh.prototype.seriesSourcePoints}),sn(ll,{categoryAxis:{categories:[]},valueAxis:{}});var ul=ll,fl=function(t){function e(e,i,o){t.call(this,i),this.value=e,this.options.index=o.index}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.points,i=this.children[0];this.box=new kn(e[0].x,e[0].y,e[1].x,e[2].y),i&&i.reflow(new kn(t.x1,e[0].y,t.x2,e[2].y))},e.prototype.createVisual=function(){var e,i=this,o=this.options;t.prototype.createVisual.call(this),(e=o.visual?o.visual({category:this.category,dataItem:this.dataItem,value:this.value,series:this.series,percentage:this.percentage,points:this.points,options:o,sender:this.getSender(),createVisual:function(){return i.createPath()}}):this.createPath())&&this.visual.append(e)},e.prototype.createPath=function(){var t=this.options,e=t.border;return a.Path.fromPoints(this.points,{fill:{color:t.color,opacity:t.opacity},stroke:{color:e.color,opacity:e.opacity,width:e.width}}).close()},e.prototype.createHighlight=function(t){return a.Path.fromPoints(this.points,t)},e.prototype.highlightVisual=function(){return this.visual.children[0]},e.prototype.highlightVisualArgs=function(){var t=a.Path.fromPoints(this.points).close();return{options:this.options,path:t}},e.prototype.tooltipAnchor=function(){var t=this.box;return{point:new An(t.center().x,t.y1),align:{horizontal:"center",vertical:"top"}}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e}(Bn);sn(fl,{color:A,border:{width:1}}),or(fl.prototype,Fa);var dl=fl,yl=function(t){function e(e,i){t.call(this,i),this.plotArea=e,this.points=[],this.labels=[],this.legendItems=[],this.render()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.formatPointValue=function(t,e){return this.chartService.format.auto(e,t.value)},e.prototype.render=function(){var t=this.options,e=this.plotArea.options.seriesColors;void 0===e&&(e=[]);var i=t.series[0],o=i.data;if(o)for(var r=rh(i),n=r.total,s=r.points,a=0;a<s.length;a++){var p=s[a];if(p){var h=p.fields;er(i.color)||(i.color=h.color||e[a%e.length]),h=or({index:a,owner:this,series:i,dataItem:o[a],percentage:p.value/n},h,{visible:p.visible});var c=p.valueFields.value,l=this.createSegment(c,h),u=this.createLabel(c,h);l&&u&&l.append(u)}}},e.prototype.evalSegmentOptions=function(t,e,i){var o=i.series;La(t,{value:e,series:o,dataItem:i.dataItem,index:i.index},{defaults:o._defaults,excluded:["data","content","template","toggle","visual"]})},e.prototype.createSegment=function(t,e){var i=or({},e.series);if(this.evalSegmentOptions(i,t,e),this.createLegendItem(t,i,e),!1!==e.visible){var o=new dl(t,i,e);return Object.assign(o,e),this.append(o),this.points.push(o),o}},e.prototype.createLabel=function(t,e){var i=e.series,o=e.dataItem,r=or({},this.options.labels,i.labels),n=t;if(r.visible){var s=Pr(r),a={dataItem:o,value:t,percentage:e.percentage,category:e.category,series:i};s?n=s(a):r.format&&(n=this.plotArea.chartService.format.auto(r.format,n)),r.color||(r.color=yn(i.color),r.background||(r.background=i.color)),this.evalSegmentOptions(r,t,e);var p=new Yn(n,or({vAlign:r.position},r),a);return this.labels.push(p),p}},e.prototype.labelPadding=function(){for(var t=this.labels,e={left:0,right:0},i=0;i<t.length;i++){var o=t[i].options.align;if(o!==f){var r=t[i].box.width();o===g?e.left=Math.max(e.left,r):e.right=Math.max(e.right,r)}}return e},e.prototype.dynamicSlopeReflow=function(t,e,i){for(var o=this.options,r=this.points,n=r.length,s=r[0],a=s,h=0;h<r.length;h++)r[h].percentage>a.percentage&&(a=r[h]);for(var c=s.percentage/a.percentage*e,l=(e-c)/2,u=0,f=0;f<n;f++){var d=r[f].percentage,y=r[f+1],v=y?y.percentage:d,g=r[f].points=[],m=o.dynamicHeight?i*d:i/n,x=void 0;x=Jr(x=d?(e-c*(v/d))/2:v?0:e/2,0,e),g.push(new p.Point(t.x1+l,t.y1+u)),g.push(new p.Point(t.x1+e-l,t.y1+u)),g.push(new p.Point(t.x1+e-x,t.y1+m+u)),g.push(new p.Point(t.x1+x,t.y1+m+u)),l=x,u+=m+o.segmentSpacing,c=Jr(e-2*x,0,e)}},e.prototype.constantSlopeReflow=function(t,e,i){for(var o=this.options,r=this.points,n=r.length,s=o.neckRatio<=1,a=s?o.neckRatio*e:e,h=s?0:(e-e/o.neckRatio)/2,c=((s?e:e-2*h)-a)/2,l=0,u=0;u<n;u++){var f=r[u].points=[],d=r[u].percentage,y=o.dynamicHeight?c*d:c/n,v=o.dynamicHeight?i*d:i/n;f.push(new p.Point(t.x1+h,t.y1+l)),f.push(new p.Point(t.x1+e-h,t.y1+l)),f.push(new p.Point(t.x1+e-h-y,t.y1+v+l)),f.push(new p.Point(t.x1+h+y,t.y1+v+l)),h+=y,l+=v+o.segmentSpacing}},e.prototype.reflow=function(t){var e=this.points,i=e.length;if(i){var o=this.options,r=t.clone().unpad(this.labelPadding()),n=r.height()-o.segmentSpacing*(i-1),s=r.width();o.dynamicSlope?this.dynamicSlopeReflow(r,s,n):this.constantSlopeReflow(r,s,n);for(var a=0;a<i;a++)e[a].reflow(t)}},e}(Bn);sn(yl,{neckRatio:.3,width:300,dynamicSlope:!1,dynamicHeight:!0,segmentSpacing:0,labels:{visible:!1,align:f,position:f,zIndex:1}}),or(yl.prototype,Bc);var vl=yl,gl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this.createFunnelChart(this.series)},e.prototype.createFunnelChart=function(t){var e=t[0],i=new vl(this,{series:t,legend:this.options.legend,neckRatio:e.neckRatio,dynamicHeight:e.dynamicHeight,dynamicSlope:e.dynamicSlope,segmentSpacing:e.segmentSpacing,highlight:e.highlight});this.appendChart(i)},e.prototype.appendChart=function(e,i){t.prototype.appendChart.call(this,e,i),Hr(this.options.legend.items,e.legendItems)},e}(xh),ml=function(t,e){void 0===e&&(e=.05);var i=Po(t),o=1-e;return function(t){var e=i.toHSL(),r=100-e.l,n=o-t;return e.l+=Math.min(n*r,r),e.toCss()}},xl=function(t){function e(e,i){t.call(this),this.options=i,this.color=i.color||A,this.value=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this._rendered||(this._rendered=!0,this.createMarker(),this.createLabel(),this.createNote())},e.prototype.createLabel=function(){var t=this.options.labels;if(t.visible){var e,i=this.pointData(),o=Pr(t),r=t.color;e=o?o(i):this.formatValue(t.format),r||(r=yn(this.color)),this.label=new Yn(e,or({align:f,vAlign:f,margin:{left:5,right:5},zIndex:on(t.zIndex,this.series.zIndex)},t,{color:r}),i),this.append(this.label)}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e.prototype.reflow=function(t){this.render();var e=this.label;this.box=t,e&&e.reflow(this.markerBox()),this.note&&this.note.reflow(t),this.marker.reflow(this.markerBox())},e.prototype.markerBox=function(){var t=this.options.markers,e=t.border,i=this.box.toRect(),o="roundedRect"===on(t.type,"rect"),r=on(e.width,o?1:0),n=Math.round(r/2);if(t.size){var s=i.center();i.size.width=i.size.height=t.size,i.origin.x=Math.round(s.x-i.size.width/2),i.origin.y=Math.round(s.y-i.size.height/2)}return i.size.width-=r,i.size.height-=r,i.origin.y+=n+.5,i.origin.x+=n+.5,qn(i)},e.prototype.markerBorder=function(){var t=this.options,e=t.markers.border,i=on(e.opacity,t.opacity);return{color:e.color||this.color,width:e.width,opacity:i,dashType:e.dashType}},e.prototype.createMarker=function(){var t=this.options,e=t.markers,i=new zn({type:on(e.type,"rect"),width:e.size,height:e.size,rotation:e.rotation,background:this.color,border:this.markerBorder(),borderRadius:e.borderRadius,opacity:this.series.opacity||t.opacity,zIndex:on(t.zIndex,this.series.zIndex),animation:t.animation,visual:t.visual},{dataItem:this.dataItem,value:this.value,series:this.series,category:this.category});this.marker=i,this.append(i)},e.prototype.createHighlight=function(t){var e=this.options,i=this.options.highlight.markers||this.options.markers,o=new zn({type:on(i.type,"rect"),width:i.size,height:i.size,rotation:i.rotation,background:i.color||this.color,border:this.markerBorder(),borderRadius:i.borderRadius,opacity:this.series.opacity||e.opacity,zIndex:on(e.zIndex,this.series.zIndex)});o.reflow(this.markerBox());var r=o.getElement();return r.options.fill=t.fill,r.options.stroke=t.stroke,r},e.prototype.highlightVisual=function(){return this.rectVisual},e.prototype.highlightVisualArgs=function(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}},e.prototype.tooltipAnchor=function(){var t=this.box.center().x,e=this.box.y1-5;return{point:new An(t,e),align:{horizontal:f,vertical:u}}},e.prototype.overlapsBox=function(t){return this.box.overlaps(t)},e.prototype.unclipElements=function(){},e.prototype.pointData=function(){return{x:this.value.x,y:this.value.y,value:this.value.value,dataItem:this.dataItem,series:this.series}},e}(Bn);or(xl.prototype,Fa),or(xl.prototype,Da),xl.prototype.defaults={markers:{type:"rect",borderRadius:4,border:{color:"transparent"}},padding:{top:1},labels:{visible:!1,padding:3},opacity:1,notes:{label:{}}};var bl=xl,_l=function(t){function e(e,i){t.call(this,i),this.plotArea=e,this.chartService=e.chartService,this._initFields(),this.render()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initFields=function(){this.points=[],this.seriesOptions=[],this.valueRange={min:m,max:x},this._evalSeries=[]},e.prototype.render=function(){this.setRange(),this.traverseDataPoints(this.addValue.bind(this))},e.prototype.setRange=function(){for(var t=this.options.series,e=0;e<t.length;e++)for(var i=t[e],o=0;o<i.data.length;o++){var r=this._bindPoint(i,e,o).valueFields;this.valueRange.min=Math.min(this.valueRange.min,r.value),this.valueRange.max=Math.max(this.valueRange.max,r.value)}},e.prototype.addValue=function(t,e){var i;t&&(i=this.createPoint(t,e))&&Object.assign(i,e),this.points.push(i)},e.prototype.evalPointOptions=function(t,e,i){var o=i.series,r=i.seriesIx,n={defaults:o._defaults,excluded:["data","tooltip","content","template","visual","toggle"]},s=this._evalSeries[r];Nr(s)||(this._evalSeries[r]=s=La(t,{},n,!0));var a=t;return s&&La(a=or({},t),{value:e,series:o,dataItem:i.dataItem,min:this.valueRange.min,max:this.valueRange.max},n),a},e.prototype.pointType=function(){return bl},e.prototype.pointOptions=function(t,e){var i=this.seriesOptions[e];if(!i){var o=this.pointType().prototype.defaults;this.seriesOptions[e]=i=or({},o,{markers:{opacity:t.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},t)}return i},e.prototype.createPoint=function(t,e){var i=e.series,o=this.pointOptions(i,e.seriesIx),r=e.color||i.color;(o=this.evalPointOptions(o,t,e),er(i.color))?r=o.color:r=ml(r)(t.value/this.valueRange.max);var n=new bl(t,o);return n.color=r,this.append(n),n},e.prototype.seriesAxes=function(t){var e=t.xAxis,i=t.yAxis,o=this.plotArea,r=e?o.namedXAxes[e]:o.axisX,n=i?o.namedYAxes[i]:o.axisY;if(!r)throw new Error("Unable to locate X axis with name "+e);if(!n)throw new Error("Unable to locate Y axis with name "+i);return{xAxis:r,yAxis:n}},e.prototype.reflow=function(t){var e=this,i=this.points,o=!this.options.clip,r=0;this.traverseDataPoints((function(t,n){var s=i[r++],a=e.seriesAxes(n.series),p=a.xAxis,h=a.yAxis,c=p.categoryIndex(t.x),l=h.categoryIndex(t.y),u=p.getSlot(c,c,o),f=h.getSlot(l,l,o);if(s)if(u&&f){var d=e.pointSlot(u,f);s.reflow(d)}else s.visible=!1})),this.box=t},e.prototype.pointSlot=function(t,e){return new kn(t.x1,e.y1,t.x2,e.y2)},e.prototype.traverseDataPoints=function(t){for(var e=this.options.series,i=0;i<e.length;i++)for(var o=e[i],r=this.seriesAxes(o),n=r.xAxis,s=r.yAxis,a=n.currentRangeIndices(),p=s.currentRangeIndices(),h=0;h<o.data.length;h++){var c=this._bindPoint(o,i,h),l=c.valueFields,u=c.fields,f=n.totalIndex(l.x),d=s.totalIndex(l.y),y=a.min<=f&&f<=a.max,v=p.min<=d&&d<=p.max;y&&v&&t(l,or({pointIx:h,series:o,seriesIx:i,dataItem:o.data[h],owner:this},u))}},e.prototype.formatPointValue=function(t,e){var i=t.value;return this.chartService.format.auto(e,i.x,i.y,i.value)},e.prototype.animationPoints=function(){for(var t=this.points,e=[],i=0;i<t.length;i++)e.push((t[i]||{}).marker);return e},e}(Bn);sn(_l,{series:[],tooltip:{format:"{0}, {1}: {2}"},labels:{format:"{2}"},clip:!0}),or(_l.prototype,{_bindPoint:Va.prototype._bindPoint});var wl=_l,Al=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(){this.namedXAxes={},this.namedYAxes={}},e.prototype.render=function(t){void 0===t&&(t=this.panes),this.bindCategories(),this.createAxes(t),this.createCharts(t),this.createAxisLabels()},e.prototype.bindCategories=function(){for(var t=this.srcSeries||this.series,e=0;e<t.length;e++){for(var i=t[e],o=i.data||[],r=this.seriesAxes(i),n=r.xAxis,s=r.yAxis,a=_n(n.categories||[]),p=_n(s.categories||[]),h=0;h<o.length;h++){var c=ma.current.bindPoint(i,h).valueFields,l=c.x,u=c.y;a.has(l)||a.add(l),p.has(u)||p.add(u)}n.categories=a.values(),s.categories=p.values()}},e.prototype.createCharts=function(t){for(var e=this.groupSeriesByPane(),i=0;i<t.length;i++){var o=t[i],r=e[o.options.name||"default"]||[];this.addToLegend(r);var n=this.filterVisibleSeries(r);n&&this.createHeatmapChart(sh(n,["heatmap"]),o)}},e.prototype.createHeatmapChart=function(t,e){var i=new wl(this,{series:t});this.appendChart(i,e)},e.prototype.seriesPaneName=function(t){var e=this.options,i=t.xAxis,o=Rr([].concat(e.xAxis),(function(t){return t.name===i}))[0],r=t.yAxis,n=Rr([].concat(e.yAxis),(function(t){return t.name===r}))[0],s=(e.panes||[{}])[0].name||"default";return(o||{}).pane||(n||{}).pane||s},e.prototype.seriesAxes=function(t){var e,i,o=this.options,r=[].concat(o.xAxis),n=t.xAxis;e=n?r.find((function(t){return t.name===n})):r[0];var s=[].concat(o.yAxis),a=t.yAxis;if(i=a?s.find((function(t){return t.name===a})):s[0],!e)throw new Error("Unable to locate X axis with name "+n);if(!i)throw new Error("Unable to locate Y axis with name "+a);return{xAxis:e,yAxis:i}},e.prototype.createAxisLabels=function(){for(var t=this.axes,e=0;e<t.length;e++)t[e].createLabels()},e.prototype.createXYAxis=function(t,e,i){for(var o,r=t.name,n=e?this.namedYAxes:this.namedXAxes,s=Object.assign({axisCrossingValue:0},t,{vertical:e,reverse:e||this.chartService.rtl?!t.reverse:t.reverse,justified:!1}),a=s.categories?s.categories[0]:null,p=[s.min,s.max,a],h=this.series,c=0;c<h.length;c++){var l=h[c],u=l[e?"yAxis":"xAxis"];if(u===s.name||0===i&&!u){var f=ma.current.bindPoint(l,0).valueFields;p.push(f[e?"y":"x"]);break}}for(var d=0;d<p.length;d++)if(p[d]instanceof Date){o=!0;break}var v=new(nh(s.type,y)||!s.type&&o?Ls:Cs)(s,this.chartService);if(v.axisIndex=i,r){if(n[r])throw new Error((e?"Y":"X")+" axis with name "+r+" is already defined");n[r]=v}return this.appendAxis(v),v.mapCategories(),v},e.prototype.createAxes=function(t){for(var e=this.options,i=[].concat(e.xAxis),o=[],r=[].concat(e.yAxis),n=[],s=0;s<i.length;s++){Lr(this.findPane(i[s].pane),t)&&o.push(this.createXYAxis(i[s],!1,s))}for(var a=0;a<r.length;a++){Lr(this.findPane(r[a].pane),t)&&n.push(this.createXYAxis(r[a],!0,a))}this.axisX=this.axisX||o[0],this.axisY=this.axisY||n[0]},e.prototype.removeAxis=function(e){var i=e.options.name;t.prototype.removeAxis.call(this,e),e.options.vertical?delete this.namedYAxes[i]:delete this.namedXAxes[i],e===this.axisX&&delete this.axisX,e===this.axisY&&delete this.axisY},e.prototype._dispatchEvent=function(t,e,i){for(var o=t._eventCoordinates(e),r=new An(o.x,o.y),n=this.axes,s=n.length,a=[],p=[],h=0;h<s;h++){var c=n[h];ih(c.options.vertical?p:a,c.getCategory(r))}a.length>0&&p.length>0&&t.trigger(i,{element:Yr(e),originalEvent:e,x:hh(a),y:hh(p)})},e.prototype.updateAxisOptions=function(t,e){var i=t.options.vertical,o=this.groupAxes(this.panes),r=(i?o.y:o.x).indexOf(t);Sl(this.options,r,i,e),Sl(this.originalOptions,r,i,e)},e.prototype.crosshairOptions=function(t){return Object.assign({},t.options.crosshair,{zIndex:0})},e}(xh);function Sl(t,e,i,o){or([].concat(i?t.yAxis:t.xAxis)[e],o)}sn(Al,{xAxis:{},yAxis:{}}),or(Al.prototype,bh);var kl=Al,Cl="color",Pl="first",Tl="max";hc.current.register(Yh,[ka,Ca,Pa,Ma,"area","verticalArea","candlestick","ohlc","bullet","verticalBullet","boxPlot","verticalBoxPlot","rangeColumn","rangeBar","waterfall","horizontalWaterfall","rangeArea","verticalRangeArea"]),hc.current.register(Cc,["scatter","scatterLine","bubble"]),hc.current.register(zc,[Ta]),hc.current.register(Uc,["donut"]),hc.current.register(gl,["funnel"]),hc.current.register($c,["polarArea","polarLine","polarScatter"]),hc.current.register(ul,["radarArea","radarColumn","radarLine"]),hc.current.register(kl,["heatmap"]),ma.current.register([ka,Ca,Pa,Ma,"area","verticalArea"],[w],["category",Cl,"noteText","errorLow","errorHigh"]),ma.current.register(["rangeColumn","rangeBar","rangeArea","verticalRangeArea"],["from","to"],["category",Cl,"noteText"]),ma.current.register(["waterfall","horizontalWaterfall"],[w],["category",Cl,"noteText","summary"]),ma.current.register(["polarArea","polarLine","polarScatter"],[S,k],[Cl]),ma.current.register(["radarArea","radarColumn","radarLine"],[w],[Cl]),ma.current.register(["funnel"],[w],["category",Cl,"visibleInLegend","visible"]),Sh.current.register([ka,Ca,Pa,Ma,"area","verticalArea","waterfall","horizontalWaterfall"],{value:Tl,color:Pl,noteText:Pl,errorLow:"min",errorHigh:Tl}),Sh.current.register(["rangeColumn","rangeBar","rangeArea","verticalRangeArea"],{from:"min",to:Tl,color:Pl,noteText:Pl}),Sh.current.register(["radarArea","radarColumn","radarLine"],{value:Tl,color:Pl}),ma.current.register(["scatter","scatterLine","bubble"],[S,k],[Cl,"noteText","xErrorLow","xErrorHigh","yErrorLow","yErrorHigh"]),ma.current.register(["bubble"],[S,k,"size"],[Cl,"category","noteText"]),ma.current.register(["heatmap"],[S,k,w],[Cl,"noteText"]),ma.current.register(["candlestick","ohlc"],["open","high","low","close"],["category",Cl,"downColor","noteText"]),Sh.current.register(["candlestick","ohlc"],{open:Tl,high:Tl,low:"min",close:Tl,color:Pl,downColor:Pl,noteText:Pl}),ma.current.register(["boxPlot","verticalBoxPlot"],["lower","q1","median","q3","upper","mean","outliers"],["category",Cl,"noteText"]),Sh.current.register(["boxPlot","verticalBoxPlot"],{lower:Tl,q1:Tl,median:Tl,q3:Tl,upper:Tl,mean:Tl,outliers:Pl,color:Pl,noteText:Pl}),ma.current.register(["bullet","verticalBullet"],["current","target"],["category",Cl,"visibleInLegend","noteText"]),Sh.current.register(["bullet","verticalBullet"],{current:Tl,target:Tl,color:Pl,noteText:Pl}),ma.current.register([Ta,"donut"],[w],["category",Cl,"explode","visibleInLegend","visible"]);var Ml=["category",w,S,k],Ol=function(t){function e(e,i,o,r){var n=this;void 0===r&&(r={}),t.call(this),this.observers=[],this.addObserver(r.observer),this.chartService=new _r(this,r),this.chartService.theme=o,this._initElement(e);var s=or({},this.options,i);this._originalOptions=or({},s),this._theme=o,this._initTheme(s,o),this._initHandlers(),this._initSurface(),this.bindCategories(),nn.preloadFonts(i,(function(){n.fontLoaded=!0,n._destroyed||(n.trigger("init"),n._redraw(),n._attachEvents())}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initElement=function(t){for(this._setElementClass(t),t.style.position="relative";t.firstChild;)t.removeChild(t.firstChild);this.element=t},e.prototype._setElementClass=function(t){P(t,"k-chart")},e.prototype._initTheme=function(t,e){for(var i=[],o=t.series||[],r=0;r<o.length;r++)i.push(Object.assign({},o[r]));t.series=i,function(t){for(var e=Ml,i=0;i<e.length;i++){var o=e[i]+"Axes";t[o]&&(t[e[i]+"Axis"]=t[o],delete t[o])}}(t),this.applyDefaults(t,e),null===t.seriesColors&&delete t.seriesColors,this.options=or({},e,t),this.applySeriesColors()},e.prototype.getSize=function(){var t=this.options.chartArea||{};return{width:t.width?parseInt(t.width,10):Math.floor(this.element.offsetWidth),height:t.height?parseInt(t.height,10):Math.floor(this.element.offsetHeight)}},e.prototype.resize=function(t){var e=this.getSize(),i=this._size,o=e.width>0||e.height>0;t||o&&(!i||e.width!==i.width||e.height!==i.height)?(this._size=e,this._resize(e,t),this.trigger("resize",e)):o&&this._selections&&pn(this._selections,(function(t){return!t.visible}))&&(this._destroySelections(),this._setupSelection())},e.prototype._resize=function(){this._noTransitionsRedraw()},e.prototype.redraw=function(t){if(this.applyDefaults(this.options),this.applySeriesColors(),t){var e=this._model._plotArea,i=e.findPane(t);e.redraw(i)}else this._redraw()},e.prototype.getAxis=function(t){return ha(t,this._plotArea.axes)},e.prototype.findAxisByName=function(t){return this.getAxis(t)},e.prototype.findPaneByName=function(t){for(var e=this._plotArea.panes,i=0;i<e.length;i++)if(e[i].options.name===t)return new la(e[i])},e.prototype.findPaneByIndex=function(t){var e=this._plotArea.panes;if(e[t])return new la(e[t])},e.prototype.plotArea=function(){return new ua(this._plotArea)},e.prototype.toggleHighlight=function(t,e){var i,o,r,n=this._plotArea,s=(n.srcSeries||n.series||[])[0];er(e)?i=n.filterPoints(e):(rr(e)?(o=e.series,r=e.category):o=r=e,i="donut"===s.type?Rl(n.pointsBySeriesName(o),r):s.type===Ta||"funnel"===s.type?Rl((n.charts[0]||{}).points,r):n.pointsBySeriesName(o));i&&this.togglePointsHighlight(t,i)},e.prototype.togglePointsHighlight=function(t,e){for(var i=this._highlight,o=0;o<e.length;o++)i.togglePointHighlight(e[o],t)},e.prototype.showTooltip=function(t){var e,i,o=this._sharedTooltip(),r=this._tooltip,n=this._plotArea;if(er(t)?(e=n.findPoint(t))&&o&&(i=e.categoryIx):o&&Nr(t)&&(i=n.categoryAxis.categoryIndex(t)),o){if(i>=0){var s=this._plotArea.pointsByCategoryIndex(i);r.showAt(s)}}else e&&r.show(e)},e.prototype.hideTooltip=function(){this._tooltip.hide()},e.prototype._initSurface=function(){var t=this.surface,e=this._surfaceWrap(),i=this.options.chartArea||{};i.width&&Xr(e,{width:i.width}),i.height&&Xr(e,{height:i.height}),t&&t.options.type===this.options.renderAs?(this.surface.clear(),this.surface.resize()):(this._destroySurface(),this.surface=a.Surface.create(e,{type:this.options.renderAs}),this.surface.bind("mouseenter",this._surfaceMouseenterHandler),this.surface.bind("mouseleave",this._surfaceMouseleaveHandler))},e.prototype._surfaceWrap=function(){return this.element},e.prototype._redraw=function(){var t=this._getModel();this._size={width:t.options.width,height:t.options.height},this._destroyView(),this._model=t,this._plotArea=t._plotArea,t.renderVisual(),!1!==this.options.transitions&&t.traverse((function(t){t.animation&&t.animation.setup()})),this._initSurface(),this.surface.draw(t.visual),!1!==this.options.transitions&&t.traverse((function(t){t.animation&&t.animation.play()})),this._tooltip=this._createTooltip(),this._highlight=new Kh,this._setupSelection(),this._createPannable(),this._createZoomSelection(),this._createMousewheelZoom(),this.trigger("render"),zl(this._plotArea.panes),this._navState||this._cancelDomEvents()},e.prototype.exportVisual=function(t){var e;if(t&&(t.width||t.height||t.options)){var i=this.options,o=or({},t.options,{chartArea:{width:t.width,height:t.height}});Ll(this._originalOptions,o),this.options=or({},this._originalOptions,o),this._initTheme(this.options,this._theme),this.bindCategories();var r=this._getModel();r.renderVisual(),zl(r._plotArea.panes),e=r.visual,this.options=i}else e=this.surface.exportVisual();return e},e.prototype._sharedTooltip=function(){return this._plotArea instanceof Yh&&this.options.tooltip&&this.options.tooltip.shared},e.prototype._createPannable=function(){var t=this.options;!1!==t.pannable&&(this._pannable=new tc(this._plotArea,t.pannable))},e.prototype._createZoomSelection=function(){var t=this.options.zoomable,e=(t||{}).selection;!1!==t&&!1!==e&&(this._zoomSelection=new ic(this,e))},e.prototype._createMousewheelZoom=function(){var t=this.options.zoomable,e=(t||{}).mousewheel;!1!==t&&!1!==e&&(this._mousewheelZoom=new oc(this,e))},e.prototype._toggleDragZoomEvents=function(){var t=this.options.pannable,e=this.options.zoomable,i=(e||{}).selection,o=(e||{}).mousewheel,r=!(t||!1!==e&&!1!==i||this.requiresHandlers(["dragStart","drag","dragEnd"])),n=(!1===e||!1===o)&&!this.requiresHandlers(["zoomStart","zoom","zoomEnd"]),s=this.element;this._dragZoomEnabled&&r&&n?(s.style.touchAction=this._touchAction||"",this._dragZoomEnabled=!1):this._dragZoomEnabled||r&&n||(s.style.touchAction="none",this._dragZoomEnabled=!0),this._toggleDomEvents(!r,!n)},e.prototype._toggleDomEvents=function(t,e){var i=this.domEvents;i&&(i.toggleDrag&&i.toggleDrag(t),i.toggleZoom&&i.toggleZoom(e))},e.prototype._createTooltip=function(){var t=this.options.tooltip;return this._sharedTooltip()?this._createSharedTooltip(t):new dc(this.chartService,t)},e.prototype._createSharedTooltip=function(t){return new vc(this._plotArea,t)},e.prototype.applyDefaults=function(t,e){!function(t,e){var i,o,r,n=(e||{}).axisDefaults||{};function s(t){var e=(t||{}).color||o.color,r=or({},n,n[i],o,o[i],{line:{color:e},labels:{color:e},title:{color:e}},t);return delete r[i],r}for(var a=0;a<Ml.length;a++)i=Ml[a]+"Axis",o=t.axisDefaults||{},r=(r=[].concat(t[i])).map(s),t[i]=r.length>1?r:r[0]}(t,e),function(t,e){var i=t.series,o=i.length,r=t.seriesDefaults,n=or({},t.seriesDefaults),s=e?or({},e.seriesDefaults):{},a=or({},s);Bl(n),Bl(a);for(var p=0;p<o;p++){var h=i[p].type||t.seriesDefaults.type,c=or({data:[]},a,s[h],{tooltip:t.tooltip},n,r[h]);i[p]._defaults=c,i[p]=or({},c,i[p]),i[p].data=i[p].data||[]}}(t,e)},e.prototype.applySeriesColors=function(){for(var t=this.options,e=t.series,i=t.seriesColors||[],o=0;o<e.length;o++){var r=e[o],n=i[o%i.length],s=r._defaults;r.color=r.color||n,s&&(s.color=s.color||n)}},e.prototype._getModel=function(){var t=this.options,e=this._createPlotArea(),i=new Dn(this._modelOptions());return i.chart=this,i._plotArea=e,Kn.buildTitle(t.title,i),t.legend&&t.legend.visible&&i.append(new ac(e.options.legend,this.chartService)),i.append(e),i.reflow(),i},e.prototype._modelOptions=function(){var t=this.options,e=this.getSize();return or({transitions:t.transitions,width:e.width||600,height:e.height||400},t.chartArea)},e.prototype._createPlotArea=function(t){var e=this.options;return hc.current.create(t?[]:e.series,e,this.chartService)},e.prototype._setupSelection=function(){for(var t=this._plotArea.axes,e=this._selections=[],i=0;i<t.length;i++){var o=t[i],r=o.options;if(o instanceof Cs&&r.select&&!r.vertical){var n=o.range(),s=new fc(this,o,or({min:n.min,max:n.max},r.select));e.push(s)}}},e.prototype._selectStart=function(t){return this.trigger("selectStart",t)},e.prototype._select=function(t){return this.trigger("select",t)},e.prototype._selectEnd=function(t){return this.trigger("selectEnd",t)},e.prototype._initHandlers=function(){this._clickHandler=this._click.bind(this),this._mousewheelHandler=this._mousewheel.bind(this),this._mouseleaveHandler=this._mouseleave.bind(this),this._surfaceMouseenterHandler=this._mouseover.bind(this),this._surfaceMouseleaveHandler=this._mouseout.bind(this),this._mousemove=po(this._mousemove.bind(this),20)},e.prototype.addObserver=function(t){t&&this.observers.push(t)},e.prototype.removeObserver=function(t){var e=this.observers.indexOf(t);e>=0&&this.observers.splice(e,1)},e.prototype.requiresHandlers=function(t){for(var e=this.observers,i=0;i<e.length;i++)if(e[i].requiresHandlers(t))return!0},e.prototype.trigger=function(t,e){void 0===e&&(e={}),"showTooltip"===t&&(e.anchor.point=this._toDocumentCoordinates(e.anchor.point)),e.sender=this;for(var i=this.observers,o=!1,r=0;r<i.length;r++)i[r].trigger(t,e)&&(o=!0);return o},e.prototype._attachEvents=function(){var t,e,i=this.element;this._touchAction=i.style.touchAction,Gr(i,((t={}).contextmenu=this._clickHandler,t[Ra]=this._mousewheelHandler,t.mouseleave=this._mouseleaveHandler,t)),this._shouldAttachMouseMove()&&Gr(i,((e={}).mousemove=this._mousemove,e)),this.domEvents=Ar.create(this.element,{start:this._start.bind(this),move:this._move.bind(this),end:this._end.bind(this),tap:this._tap.bind(this),gesturestart:this._gesturestart.bind(this),gesturechange:this._gesturechange.bind(this),gestureend:this._gestureend.bind(this)}),this._toggleDragZoomEvents()},e.prototype._mouseleave=function(t){this._hoveredPoint&&(this._hoveredPoint.out(this,t),this._hoveredPoint=null),this._plotArea.hovered&&(this.trigger("plotAreaLeave"),this._plotArea.hovered=!1)},e.prototype._cancelDomEvents=function(){this.domEvents&&this.domEvents.cancel&&this.domEvents.cancel()},e.prototype._gesturestart=function(t){this._mousewheelZoom&&!this._stopChartHandlers(t)&&(this._gestureDistance=t.distance,this._unsetActivePoint(),this.surface.suspendTracking())},e.prototype._gestureend=function(t){this._zooming&&!this._stopChartHandlers(t)&&(this.surface&&this.surface.resumeTracking(),this._zooming=!1,this.trigger("zoomEnd",{}))},e.prototype._gesturechange=function(t){var e=this._mousewheelZoom;if(e&&!this._stopChartHandlers(t)){t.preventDefault();var i=this._gestureDistance,o=-t.distance/i+1;if(Math.abs(o)>=.1){o=Math.round(10*o),this._gestureDistance=t.distance;var r={delta:o,axisRanges:jl(this._plotArea.axes),originalEvent:t};if(this._zooming||!this.trigger("zoomStart",r))this._zooming||(this._zooming=!0),(r.axisRanges=e.updateRanges(o))&&!this.trigger("zoom",r)&&e.zoom()}}},e.prototype._mouseout=function(t){if(t.element){var e=this._drawingChartElement(t.element,t);e&&e.leave&&e.leave(this,t.originalEvent)}},e.prototype._start=function(t){var e=this._eventCoordinates(t);!this._stopChartHandlers(t)&&this._plotArea.backgroundContainsPoint(e)&&(this.requiresHandlers(["dragStart","drag","dragEnd"])&&this._startNavigation(t,e,"dragStart"),this._pannable&&this._pannable.start(t)&&(this.surface.suspendTracking(),this._unsetActivePoint(),this._suppressHover=!0,this.chartService.panning=!0),this._zoomSelection&&this._zoomSelection.start(t)&&this.trigger("zoomStart",{axisRanges:jl(this._plotArea.axes),originalEvent:t}))},e.prototype._move=function(t){var e=this._navState,i=this._pannable;if(!this._stopChartHandlers(t)){if(i){var o=i.move(t);o&&!this.trigger("drag",{axisRanges:o,originalEvent:t})&&i.pan()}else if(e){for(var r={},n=e.axes,s=0;s<n.length;s++){var a=n[s];if(a.options.name){var p=a.options.vertical?t.y:t.x,h=p.startLocation-p.location;0!==h&&(r[a.options.name]=a.translateRange(h))}}e.axisRanges=r,this.trigger("drag",{axisRanges:r,originalEvent:t})}this._zoomSelection&&this._zoomSelection.move(t)}},e.prototype._end=function(t){if(!this._stopChartHandlers(t)){var e=this._pannable;if(e&&e.end(t)?(this.surface.resumeTracking(),this.trigger("dragEnd",{axisRanges:jl(this._plotArea.axes),originalEvent:t}),this._suppressHover=!1,this.chartService.panning=!1):this._endNavigation(t,"dragEnd"),this._zoomSelection){var i=this._zoomSelection.end(t);i&&!this.trigger("zoom",{axisRanges:i,originalEvent:t})&&(this._zoomSelection.zoom(),this.trigger("zoomEnd",{axisRanges:i,originalEvent:t}))}}},e.prototype._stopChartHandlers=function(t){var e=this._selections||[];if(!e.length)return!1;var i=this._eventCoordinates(t),o=this._plotArea.paneByPoint(i);if(o)for(var r=0;r<e.length;r++)if(e[r].onPane(o))return!0},e.prototype._mousewheel=function(t){var e=this,i=Dr(t),o=this._mousewheelZoom,r=this._eventCoordinates(t);if(!this._stopChartHandlers(t)&&this._plotArea.backgroundContainsPoint(r))if(o){var n={delta:i,axisRanges:jl(this._plotArea.axes),originalEvent:t};!this._zooming&&this.trigger("zoomStart",n)||(t.preventDefault(),this._zooming||(this._unsetActivePoint(),this.surface.suspendTracking(),this._zooming=!0),this._mwTimeout&&clearTimeout(this._mwTimeout),n.axisRanges=o.updateRanges(i),n.axisRanges&&!this.trigger("zoom",n)&&o.zoom(),this._mwTimeout=setTimeout((function(){e.trigger("zoomEnd",n),e._zooming=!1,e.surface&&e.surface.resumeTracking()}),150))}else{var s=this._navState;if(!s)this._startNavigation(t,r,"zoomStart")||(s=this._navState);if(s){var a=s.totalDelta||i;s.totalDelta=a+i;for(var p=this._navState.axes,h={},c=0;c<p.length;c++){var l=p[c],u=l.options.name;u&&(h[u]=l.scaleRange(-a))}this.trigger("zoom",{delta:i,axisRanges:h,originalEvent:t}),this._mwTimeout&&clearTimeout(this._mwTimeout),this._mwTimeout=setTimeout((function(){e._endNavigation(t,"zoomEnd")}),150)}}},e.prototype._startNavigation=function(t,e,i){var o=this._model._plotArea,r=o.findPointPane(e),n=o.axes.slice(0);if(r){var s=jl(n);this.trigger(i,{axisRanges:s,originalEvent:t})?this._cancelDomEvents():(this._suppressHover=!0,this._unsetActivePoint(),this._navState={axisRanges:s,pane:r,axes:n})}},e.prototype._endNavigation=function(t,e){this._navState&&(this.trigger(e,{axisRanges:this._navState.axisRanges,originalEvent:t}),this._suppressHover=!1,this._navState=null)},e.prototype._getChartElement=function(t,e){var i=this.surface.eventTarget(t);if(i)return this._drawingChartElement(i,t,e)},e.prototype._drawingChartElement=function(t,e,i){for(var o,r=t;r&&!o;)o=r.chartElement,r=r.parent;if(o)return o.aliasFor&&(o=o.aliasFor(e,this._eventCoordinates(e))),i&&(o=o.closest(i))&&o.aliasFor&&(o=o.aliasFor()),o},e.prototype._eventCoordinates=function(t){var e=Zr(t);return this._toModelCoordinates(e.x,e.y)},e.prototype._elementPadding=function(){if(!this._padding){var t=pr(this.element,["paddingLeft","paddingTop"]),e=t.paddingLeft,i=t.paddingTop;this._padding={top:i,left:e}}return this._padding},e.prototype._toDocumentCoordinates=function(t){var e=this._elementPadding(),i=qr(this.element);return{left:tn(t.x+e.left+i.left),top:tn(t.y+e.top+i.top)}},e.prototype._toModelCoordinates=function(t,e){var i=this.element,o=qr(i),r=this._elementPadding(),n=un(i).invert(),s=new p.Point(t-o.left-r.left,e-o.top-r.top).transform(n);return new An(s.x,s.y)},e.prototype._tap=function(t){var e=this,i=this.surface.eventTarget(t),o=this._drawingChartElement(i,t),r=this._sharedTooltip();this._startHover(i,t)||r||this._unsetActivePoint(),r&&this._trackSharedTooltip(this._eventCoordinates(t),t,!0),this._propagateClick(o,t),this.handlingTap=!0,setTimeout((function(){e.handlingTap=!1}),0)},e.prototype._click=function(t){var e=this._getChartElement(t);this._propagateClick(e,t)},e.prototype._propagateClick=function(t,e){for(var i=t;i;)i.click&&i.click(this,e),i=i.parent},e.prototype._startHover=function(t,e){if(this._suppressHover)return!1;var i=this._drawingChartElement(t,e,(function(t){return(t.hover||t.over)&&!(t instanceof xh)})),o=this._activePoint,r=this._plotArea.series.length>1,n=this._hasInactiveOpacity();return this._updateHoveredPoint(i,e),i&&o!==i&&i.hover?(this._activePoint=i,this._sharedTooltip()||i.hover(this,e)||(this._displayTooltip(i),n?this._displayInactiveOpacity(i,r):this._highlight.show(i))):!i&&n&&(r&&this._activeChartInstance&&(this._updateSeriesOpacity(i,!0),this._applySeriesOpacity(this._activeChartInstance.children,null,!0),this._activeChartInstance=null),this._highlight&&this._highlight.hide(),this._activePoint=null),i},e.prototype._displayTooltip=function(t){or({},this.options.tooltip,t.options.tooltip).visible&&this._tooltip.show(t)},e.prototype._displayInactiveOpacity=function(t,e,i){var o=this._activeChartInstance=this._chartInstanceFromPoint(t);if(o)if(e)this._updateSeriesOpacity(t),this._applySeriesOpacity(o.children,null,!0),this._applySeriesOpacity(o.children,t.series),this._highlight.show(i||t);else{var r;if(!o.supportsPointInactiveOpacity())return void this._highlight.show(t);(r=this._getInactivePoints(t,o))&&r.length&&this._highlight.show(r,1-this._getInactiveOpacityForSeries(t.series))}},e.prototype._getInactivePoints=function(t,e){return this._getAllPointsOfType(e,t.constructor).filter((function(e){return e!==t}))},e.prototype._getAllPointsOfType=function(t,e){for(var i=[],o=0;o<t.children.length;o++){var r=t.children[o];r.constructor===e?i.push(r):r.children&&r.children.length&&(i=i.concat(this._getAllPointsOfType(r,e)))}return i},e.prototype._updateHoveredPoint=function(t,e){var i=this._hoveredPoint;i&&i!==t&&(i.out(this,e),this._hoveredPoint=null),t&&i!==t&&t.over&&(this._hoveredPoint=t,t.over(this,e))},e.prototype._updateSeriesOpacity=function(t,e){for(var i=this._plotArea,o=i.series.length,r=0;r<o;r++){var n=i.series[r],s=this._getDefaultOpacityForSeries(n),a=this._getInactiveOpacityForSeries(n);e||n===t.series?(n.opacity=s,n.line&&(n.line.opacity=s)):(n.defaultOpacity=s,n.opacity=a,n.line&&(n.line.opacity=a))}},e.prototype._applySeriesOpacity=function(t,e,i,o){for(var r=0;r<t.length;r++){var n=t[r],s=n.series||o;if(s&&n.visual){var a=o?o.opacity:n.series.opacity;(s!==e||i)&&n.visual.opacity(i?1:a)}n.children&&n.children.length&&this._applySeriesOpacity(n.children,e,i,n.series)}},e.prototype._chartInstanceFromPoint=function(t){for(var e=t.parent;e&&!e.plotArea;)e=e.parent;return e},e.prototype._hasInactiveOpacity=function(){var t=void 0!==this.options.seriesDefaults.highlight.inactiveOpacity,e=this.options.series.filter((function(t){return void 0!==t.highlight.inactiveOpacity})).length>0;return t||e},e.prototype._getInactiveOpacityForSeries=function(t){var e=this.options.seriesDefaults.highlight.inactiveOpacity;return t.highlight.inactiveOpacity||e||t.opacity||1},e.prototype._getDefaultOpacityForSeries=function(t){return t.defaultOpacity||t.opacity||1},e.prototype._mouseover=function(t){var e,i=this._startHover(t.element,t.originalEvent);i&&i.tooltipTracking&&!this._mouseMoveTrackHandler&&!this._sharedTooltip()&&(this._mouseMoveTrackHandler=this._mouseMoveTracking.bind(this),Gr(document,((e={}).mousemove=this._mouseMoveTrackHandler,e)))},e.prototype._mouseMoveTracking=function(t){var e,i=this.options,o=this._tooltip,r=this._highlight,n=this._activePoint,s=this._eventCoordinates(t);if(this._plotArea.box.containsPoint(s)){if(n&&n.tooltipTracking&&n.series&&n.parent.getNearestPoint){var a=n.parent.getNearestPoint(s.x,s.y,n.seriesIx);if(a&&a!==n)if(this._activePoint=a,!a.hover(this,t))or({},i.tooltip,a.options.tooltip).visible&&o.show(a),r.show(a)}}else en(document,((e={}).mousemove=this._mouseMoveTrackHandler,e)),this._unsetActivePoint(),this._mouseMoveTrackHandler=null},e.prototype._mousemove=function(t){var e=this._eventCoordinates(t),i=this._plotArea;if(this._trackCrosshairs(e),i.hover){var o=i.backgroundContainsPoint(e);o?(i.hovered=!0,this._plotArea.hover(this,t)):i.hovered&&!o&&(this.trigger("plotAreaLeave"),i.hovered=!1)}this._sharedTooltip()&&this._trackSharedTooltip(e,t)},e.prototype._trackCrosshairs=function(t){for(var e=this._plotArea.crosshairs,i=0;i<e.length;i++){var o=e[i];o.box.containsPoint(t)?o.showAt(t):o.hide()}},e.prototype._trackSharedTooltip=function(t,e,i){if(!this._suppressHover){var o=this.options.tooltip,r=this._plotArea,n=this._plotArea.categoryAxis,s=this._tooltip,a=this._highlight;if(r.backgroundContainsPoint(t)){var p=n.pointCategoryIndex(t);if(p!==this._tooltipCategoryIx||!this._sharedHighlight&&i){var h=r.pointsByCategoryIndex(p),c=h.map((function(t){return t.eventArgs(e)})),l=c[0]||{};l.categoryPoints=c,h.length>0&&!this.trigger("seriesHover",l)?(o.visible&&s.showAt(h,t),a.show(h),this._sharedHighlight=!0):s.hide(),this._tooltipCategoryIx=p}else i&&this._sharedHighlight&&(a.hide(),s.hide(),this._sharedHighlight=!1)}else this._sharedHighlight&&(a.hide(),s.hide(),this._tooltipCategoryIx=null,this._sharedHighlight=!1)}},e.prototype.hideElements=function(t){var e=this._plotArea;this._mousemove.cancel(),e.hideCrosshairs(),this._unsetActivePoint(t)},e.prototype._unsetActivePoint=function(t){var e=this._tooltip,i=this._highlight;this._activePoint=null,this._hoveredPoint=null,!e||t&&t.keepTooltipOpen||e.hide(),this._tooltipCategoryIx=null,this._sharedHighlight=!1,i&&i.hide()},e.prototype._deferRedraw=function(){this._redraw()},e.prototype._clearRedrawTimeout=function(){this._redrawTimeout&&(clearInterval(this._redrawTimeout),this._redrawTimeout=null)},e.prototype.bindCategories=function(){for(var t=this.options,e=[].concat(t.categoryAxis),i=0;i<e.length;i++){var o=e[i];!1!==o.autoBind&&this.bindCategoryAxisFromSeries(o,i)}},e.prototype.bindCategoryAxisFromSeries=function(t,e){for(var i,o=this.options.series,r=o.length,n=new Ir,s=[],a=!1,p=0;p<r;p++){var h=o[p],c=h.categoryAxis===t.name||!h.categoryAxis&&0===e,l=h.data,u=l.length,f=h.categoryField&&c;if(a=f||a,f&&u>0)for(var d=(i=ph(t,va(h.categoryField,l[0])))?ah:va,y=0;y<u;y++){var v=l[y],g=d(h.categoryField,v,this.chartService.intl);!i&&n.get(g)||(s.push([g,v]),i||n.set(g,!0))}}if(s.length>0){i&&(s=function(t,e){void 0===e&&(e=ys);for(var i=function(t,e){void 0===e&&(e=ys);for(var i=1,o=t.length;i<o;i++)if(e(t[i],t[i-1])<0){t.sort(e);break}return t}(t,e),o=i.length,r=o>0?[i[0]]:[],n=1;n<o;n++)0!==e(i[n],Kr(r))&&r.push(i[n]);return r}(s,(function(t,e){return ys(t[0],e[0])})));var m=function(t){for(var e=t.length,i=[],o=0;o<e;o++)for(var r=t[o],n=r.length,s=0;s<n;s++)i[s]=i[s]||[],i[s].push(r[s]);return i}(s);t.categories=m[0]}else a&&(t.categories=[])},e.prototype._isBindable=function(t){for(var e=ma.current.valueFields(t),i=!0,o=0;o<e.length;o++){var r=e[o];if(r===w?r="field":r+="Field",!Nr(t[r])){i=!1;break}}return i},e.prototype._noTransitionsRedraw=function(){var t,e=this.options;!1!==e.transitions&&(e.transitions=!1,t=!0),this._redraw(),t&&(e.transitions=!0)},e.prototype._legendItemHover=function(t,e){var i,o=this._plotArea,r=this._highlight,n=(o.srcSeries||o.series)[t];if(i=Lr(n.type,[Ta,"donut","funnel"])?o.findPoint((function(i){return i.series.index===t&&i.index===e})):o.pointsBySeriesIndex(t),this._hasInactiveOpacity()&&n.visible&&i){var s=o.series.length>1,a=i.length?i[0]:i;this._displayInactiveOpacity(a,s,i)}else r.show(i)},e.prototype._shouldAttachMouseMove=function(){return this._plotArea.crosshairs.length||this._tooltip&&this._sharedTooltip()||this.requiresHandlers(["plotAreaHover","plotAreaLeave"])},e.prototype.updateMouseMoveHandler=function(){var t,e;en(this.element,((t={}).mousemove=this._mousemove,t)),this._shouldAttachMouseMove()&&Gr(this.element,((e={}).mousemove=this._mousemove,e))},e.prototype.applyOptions=function(t,e){Ll(this._originalOptions,t),this._originalOptions=or(this._originalOptions,t),this.options=or({},this._originalOptions),e&&(this._theme=e,this.chartService.theme=e),this._initTheme(this.options,this._theme),this._toggleDragZoomEvents()},e.prototype.setOptions=function(t,e){this.applyOptions(t,e),this.bindCategories(),this.redraw(),this.updateMouseMoveHandler()},e.prototype.setDirection=function(t){this.chartService.rtl=Boolean(t),this.surface&&"svg"===this.surface.type&&this._destroySurface()},e.prototype.setIntlService=function(t){this.chartService.intl=t},e.prototype.noTransitionsRedraw=function(){this._noTransitionsRedraw()},e.prototype.destroy=function(){var t,e;this._destroyed=!0,en(this.element,((t={}).contextmenu=this._clickHandler,t[Ra]=this._mousewheelHandler,t.mousemove=this._mousemove,t.mouseleave=this._mouseleaveHandler,t)),this.domEvents&&(this.domEvents.destroy(),delete this.domEvents),this._mouseMoveTrackHandler&&en(document,((e={}).mousemove=this._mouseMoveTrackHandler,e)),this._destroyView(),this._destroySurface(),this._clearRedrawTimeout()},e.prototype._destroySurface=function(){var t=this.surface;t&&(t.unbind("mouseenter",this._surfaceMouseenterHandler),t.unbind("mouseleave",this._surfaceMouseleaveHandler),t.destroy(),this.surface=null)},e.prototype._destroySelections=function(){var t=this._selections;if(t)for(;t.length>0;)t.shift().destroy()},e.prototype._destroyView=function(){var t=this._model;t&&(t.destroy(),this._model=null),this._unsetActivePoint(),this._destroySelections(),this._tooltip&&this._tooltip.destroy(),this._highlight&&this._highlight.destroy(),this._zoomSelection&&(this._zoomSelection.destroy(),delete this._zoomSelection),this._pannable&&(this._pannable.destroy(),delete this._pannable),this._mousewheelZoom&&(this._mousewheelZoom.destroy(),delete this._mousewheelZoom)},e}(O);function Rl(t,e){if(t)for(var i=0;i<t.length;i++)if(t[i].category===e)return[t[i]]}function Bl(t){delete t.bar,delete t.column,delete t.rangeColumn,delete t.line,delete t.verticalLine,delete t.pie,delete t.donut,delete t.area,delete t.verticalArea,delete t.scatter,delete t.scatterLine,delete t.bubble,delete t.candlestick,delete t.ohlc,delete t.boxPlot,delete t.bullet,delete t.verticalBullet,delete t.polarArea,delete t.polarLine,delete t.radarArea,delete t.radarLine,delete t.waterfall}function jl(t){for(var e={},i=0;i<t.length;i++){var o=t[i],r=o.options.name;r&&(e[r]=o.range())}return e}var Il=["data","categories"];function Ll(t,e){for(var i in e)if(!Lr(i,Il)&&e.hasOwnProperty(i)){var o=e[i],r=t[i];if(Nr(r)){var n=null===o;n||!Nr(o)?(delete t[i],n&&delete e[i]):r&&rr(o)&&rr(r)&&Ll(r,o)}}}function zl(t){for(var e=0;e<t.length;e++)t[e].notifyRender()}sn(Ol,{renderAs:"",chartArea:{},legend:{visible:!0,labels:{}},categoryAxis:{},seriesDefaults:{type:Ca,data:[],highlight:{visible:!0},labels:{},negativeValues:{visible:!1}},series:[],seriesColors:null,tooltip:{visible:!1},transitions:!0,valueAxis:{},plotArea:{},title:{},xAxis:{},yAxis:{},panes:[{}],pannable:!1,zoomable:!1});var El=Ol,Vl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._slotAnchor=function(t,e){var i=this.plotArea.categoryAxis.options.vertical,o=i?{horizontal:"left",vertical:"center"}:{horizontal:"center",vertical:"bottom"};return{point:i?new An(this.plotArea.box.x2,e.center().y):new An(e.center().x,-2),align:o}},e.prototype._defaultAnchor=function(t,e){return this._slotAnchor({},e)},e}(vc),Fl=[ka,"bullet"];function Dl(t){for(var e=[],i=0;i<t.length;i++){var o=t[i];e[i]=o.style.display,o.style.display="none"}return e}function Ul(t,e){for(var i=0;i<t.length;i++)t[i].style.display=e[i]}function Hl(t){return $o(t)?[t]:t}var Gl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._setElementClass=function(t){P(t,"k-sparkline")},e.prototype._initElement=function(e){t.prototype._initElement.call(this,e),this._initialWidth=Math.floor(Xr(e).width)},e.prototype._resize=function(){var e=this.element,i=Dl(e.childNodes);this._initialWidth=Math.floor(Xr(e).width),Ul(e.childNodes,i),t.prototype._resize.call(this)},e.prototype._modelOptions=function(){var t=this.options,e=this._surfaceWrap(),i=Dl(e.childNodes),o=document.createElement("span");o.innerHTML=" ",e.appendChild(o);var r=or({width:this._autoWidth,height:Xr(e).height,transitions:t.transitions},t.chartArea,{inline:!0,align:!1});return Xr(e,{width:r.width,height:r.height}),e.removeChild(o),Ul(e.childNodes,i),this.surface&&this.surface.resize(),r},e.prototype._surfaceWrap=function(){if(!this.stage){var t=this.stage=document.createElement("span");this.element.appendChild(t)}return this.stage},e.prototype._createPlotArea=function(e){var i=t.prototype._createPlotArea.call(this,e);return this._autoWidth=this._initialWidth||this._calculateWidth(i),i},e.prototype._calculateWidth=function(t){for(var e=this.options,i=hr(e.chartArea.margin),o=t.charts,r=this._surfaceWrap(),n=0,s=0;s<o.length;s++){var a=o[s],p=(a.options.series||[])[0];if(p){if(p.type===ka)return 150;if("bullet"===p.type)return 150;if(p.type===Ta)return Xr(r).height;var h=a.categoryAxis;if(h){var c=h.categoriesCount()*(!a.options.isStacked&&Lr(p.type,[Ca,"verticalBullet"])?a.seriesOptions.length:1);n=Math.max(n,c)}}}var l=n*e.pointWidth;return l>0&&(l+=i.left+i.right),l},e.prototype._createSharedTooltip=function(t){return new Vl(this._plotArea,t)},e.normalizeOptions=function(t){var e=Hl(t);return(e=C(e)?{seriesDefaults:{data:e}}:or({},e)).series||(e.series=[{data:Hl(e.data)}]),or(e,{seriesDefaults:{type:e.type}}),(Lr(e.series[0].type,Fl)||Lr(e.seriesDefaults.type,Fl))&&(e=or({},{categoryAxis:{crosshair:{visible:!1}}},e)),e},e}(El);sn(Gl,{chartArea:{margin:2},axisDefaults:{visible:!1,majorGridLines:{visible:!1},valueAxis:{narrowRange:!0}},seriesDefaults:{type:"line",area:{line:{width:.5}},bar:{stack:!0},padding:2,width:.5,overlay:{gradient:null},highlight:{visible:!1},border:{width:0},markers:{size:2,visible:!1}},tooltip:{visible:!0,shared:!0},categoryAxis:{crosshair:{visible:!0,tooltip:{visible:!1}}},legend:{visible:!1},transitions:!1,pointWidth:5,panes:[{clip:!1}]});var Nl=Gl,Wl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){this._initialOpacity=parseFloat(pr(this.element,"opacity").opacity)},e.prototype.step=function(t){pr(this.element,{opacity:String(zr(this._initialOpacity,0,t))})},e.prototype.abort=function(){t.prototype.abort.call(this),pr(this.element,{display:"none",opacity:String(this._initialOpacity)})},e.prototype.cancel=function(){t.prototype.abort.call(this),pr(this.element,{opacity:String(this._initialOpacity)})},e}(a.Animation);function ql(t,e){var i=document.createElement("div");return i.className=t,e&&(i.style.cssText=e),i}var Xl=function(t){function e(e,i,o){t.call(this),this.options=or({},this.options,o),this.container=e,this.chartService=i;var r=pr(e,["paddingLeft","paddingTop"]);this.chartPadding={top:r.paddingTop,left:r.paddingLeft},this.createElements(),e.appendChild(this.element)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createElements=function(){var t=this.element=ql("k-navigator-hint","display: none; position: absolute; top: 1px; left: 1px;"),e=this.tooltip=ql("k-tooltip k-chart-tooltip"),i=this.scroll=ql("k-scroll");e.innerHTML=" ",t.appendChild(e),t.appendChild(i)},e.prototype.show=function(t,e,i){var o=this.element,r=this.options,n=this.scroll,s=this.tooltip,a=cs(gs(t)+gs(e-t)/2),p=.4*i.width(),h=i.center().x-p,c=(i.center().x-h)/(r.max-r.min),l=a-r.min,u=this.chartService.intl.format(r.format,t,e),f=Pr(r);this.clearHideTimeout(),this._visible||(pr(o,{visibility:"hidden",display:"block"}),this._visible=!0),f&&(u=f({from:t,to:e})),s.innerHTML=u,pr(s,{left:i.center().x-s.offsetWidth/2,top:i.y1});var d=pr(s,["marginTop","borderTopWidth","height"]);pr(n,{width:p,left:h+l*c,top:i.y1+d.marginTop+d.borderTopWidth+d.height/2}),pr(o,{visibility:"visible"})},e.prototype.clearHideTimeout=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this._hideAnimation&&this._hideAnimation.cancel()},e.prototype.hide=function(){var t=this;this.clearHideTimeout(),this._hideTimeout=setTimeout((function(){t._visible=!1,t._hideAnimation=new Wl(t.element),t._hideAnimation.setup(),t._hideAnimation.play()}),this.options.hideDelay)},e.prototype.destroy=function(){this.clearHideTimeout(),this.container&&this.container.removeChild(this.element),delete this.container,delete this.chartService,delete this.element,delete this.tooltip,delete this.scroll},e}(O);sn(Xl,{format:"{0:d} - {1:d}",hideDelay:500});var Yl=Xl,Zl="_navigator",Kl=Zl;function Jl(){}var $l=function(t){function e(e){var i;t.call(this),this.chart=e;var o=this.options=or({},this.options,e.options.navigator),r=o.select;r&&(r.from=this.parseDate(r.from),r.to=this.parseDate(r.to)),Nr(o.hint.visible)||(o.hint.visible=o.visible),this.chartObserver=new Vr(this,((i={}).drag="_drag",i.dragEnd="_dragEnd",i.zoom="_zoom",i.zoomEnd="_zoomEnd",i)),e.addObserver(this.chartObserver)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.parseDate=function(t){return ws(this.chart.chartService.intl,t)},e.prototype.clean=function(){this.selection&&(this.selection.destroy(),this.selection=null),this.hint&&(this.hint.destroy(),this.hint=null)},e.prototype.destroy=function(){this.chart&&(this.chart.removeObserver(this.chartObserver),delete this.chart),this.clean()},e.prototype.redraw=function(){this._redrawSelf(),this.initSelection()},e.prototype.initSelection=function(){var t,e=this.chart,i=this.options,o=this.mainAxis(),r=o.roundedRange(),n=r.min,s=r.max,a=i.select,p=a.from,h=a.to,c=a.mousewheel,l=(t=o,Jl.prototype=t,new Jl);0!==o.categoriesCount()&&(this.clean(),l.box=o.box,this.selection=new fc(e,l,{min:n,max:s,from:p||n,to:h||s,mousewheel:on(c,{zoom:"left"}),visible:i.visible},new Vr(this,{selectStart:"_selectStart",select:"_select",selectEnd:"_selectEnd"})),i.hint.visible&&(this.hint=new Yl(e.element,e.chartService,{min:n,max:s,template:Pr(i.hint),format:i.hint.format})))},e.prototype.setRange=function(){var t=this.chart._createPlotArea(!0).namedCategoryAxes[Kl].roundedRange(),e=t.min,i=t.max,o=this.options.select||{},r=o.from||e;r<e&&(r=e);var n=o.to||i;n>i&&(n=i),this.options.select=or({},o,{from:r,to:n}),this.filterAxes()},e.prototype._redrawSelf=function(t){var e=this.chart._plotArea;e&&e.redraw(Kr(e.panes),t)},e.prototype.redrawSlaves=function(){var t=this.chart,e=t._plotArea,i=e.panes.slice(0,-1);e.srcSeries=t.options.series,e.options.categoryAxis=t.options.categoryAxis,e.clearSeriesPointsCache(),e.redraw(i)},e.prototype._drag=function(t){var e,i=this.chart,o=this.selection,r=i._eventCoordinates(t.originalEvent),n=this.mainAxis(),s=n.roundedRange(),a=n.pane.box.containsPoint(r),p=i._plotArea.categoryAxis,h=t.axisRanges[p.options.name],c=this.options.select;if(h&&!a&&o){e=c.from&&c.to?gs(c.to)-gs(c.from):gs(o.options.to)-gs(o.options.from);var l=cs(Jr(gs(h.min),s.min,gs(s.max)-e)),u=cs(Jr(gs(l)+e,gs(s.min)+e,s.max));this.options.select={from:l,to:u},this.options.liveDrag&&(this.filterAxes(),this.redrawSlaves()),o.set(l,u),this.showHint(l,u)}},e.prototype._dragEnd=function(){this.filterAxes(),this.filter(),this.redrawSlaves(),this.hint&&this.hint.hide()},e.prototype.readSelection=function(){var t=this.selection.options,e=t.from,i=t.to,o=this.options.select;o.from=e,o.to=i},e.prototype.filterAxes=function(){var t=this.options.select;void 0===t&&(t={});for(var e=this.chart.options.categoryAxis,i=t.from,o=t.to,r=0;r<e.length;r++){var n=e[r];n.pane!==Zl&&(n.min=i,n.max=o)}},e.prototype.filter=function(){var t=this.chart,e=this.options.select;if(t.requiresHandlers(["navigatorFilter"])){var i=this.mainAxis(),o={from:e.from,to:e.to};if("category"!==i.options.type){var r=new Ls(or({baseUnit:"fit"},t.options.categoryAxis[0],{categories:[e.from,e.to]}),t.chartService).options;o.from=us(r.min,-r.baseUnitStep,r.baseUnit),o.to=us(r.max,r.baseUnitStep,r.baseUnit)}this.chart.trigger("navigatorFilter",o)}},e.prototype._zoom=function(t){var e=this.chart._plotArea.categoryAxis,i=this.selection,o=this.options,r=o.select,n=o.liveDrag,s=this.mainAxis(),a=t.delta;if(i){var p=s.categoryIndex(i.options.from),h=s.categoryIndex(i.options.to);t.originalEvent.preventDefault(),Math.abs(a)>1&&(a*=3),h-p>1?(i.expand(a),this.readSelection()):(e.options.min=r.from,r.from=e.scaleRange(-t.delta).min),n&&(this.filterAxes(),this.redrawSlaves()),i.set(r.from,r.to),this.showHint(this.options.select.from,this.options.select.to)}},e.prototype._zoomEnd=function(t){this._dragEnd(t)},e.prototype.showHint=function(t,e){var i=this.chart._plotArea;this.hint&&this.hint.show(t,e,i.backgroundBox())},e.prototype._selectStart=function(t){return this.chart._selectStart(t)},e.prototype._select=function(t){return this.showHint(t.from,t.to),this.chart._select(t)},e.prototype._selectEnd=function(t){return this.hint&&this.hint.hide(),this.readSelection(),this.filterAxes(),this.filter(),this.redrawSlaves(),this.chart._selectEnd(t)},e.prototype.mainAxis=function(){var t=this.chart._plotArea;if(t)return t.namedCategoryAxes[Kl]},e.prototype.select=function(t,e){var i=this.options.select;return t&&e&&(i.from=this.parseDate(t),i.to=this.parseDate(e),this.filterAxes(),this.filter(),this.redrawSlaves(),this.selection.set(t,e)),{from:i.from,to:i.to}},e.setup=function(t,i){if(void 0===t&&(t={}),void 0===i&&(i={}),!t.__navi){t.__navi=!0;var o=or({},i.navigator,t.navigator),r=t.panes=[].concat(t.panes),n=or({},o.pane,{name:Zl});o.visible||(n.visible=!1,n.height=.1),r.push(n),e.attachAxes(t,o),e.attachSeries(t,o,i)}},e.attachAxes=function(t,e){var i=e.series||[],o=t.categoryAxis=[].concat(t.categoryAxis),r=t.valueAxis=[].concat(t.valueAxis),n=0===sh(i,Oa).length,s=or({type:"date",pane:Zl,roundToBaseUnit:!n,justified:n,_collapse:!1,majorTicks:{visible:!0},tooltip:{visible:!1},labels:{step:1},autoBind:e.autoBindElements,autoBaseUnitSteps:{minutes:[1],hours:[1,2],days:[1,2],weeks:[],months:[1],years:[1]}}),a=e.categoryAxis;o.push(or({},s,{maxDateGroups:200},a,{name:Kl,title:null,baseUnit:"fit",baseUnitStep:"auto",labels:{visible:!1},majorTicks:{visible:!1}}),or({},s,a,{name:Kl+"_labels",maxDateGroups:20,baseUnitStep:"auto",labels:{position:""},plotBands:[],autoBaseUnitSteps:{minutes:[]},_overlap:!0}),or({},s,a,{name:Kl+"_ticks",maxDateGroups:200,majorTicks:{width:.5},plotBands:[],title:null,labels:{visible:!1,mirror:!0},_overlap:!0})),r.push(or({name:Kl,pane:Zl,majorGridLines:{visible:!1},visible:!1},e.valueAxis))},e.attachSeries=function(t,e,i){for(var o=t.series=t.series||[],r=[].concat(e.series||[]),n=i.seriesColors,s=e.seriesDefaults,a=0;a<r.length;a++)o.push(or({color:n[a%n.length],categoryField:e.dateField,visibleInLegend:!1,tooltip:{visible:!1}},s,r[a],{axis:Kl,categoryAxis:Kl,autoBind:e.autoBindElements}))},e}(O),Ql=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.applyDefaults=function(e,i){var o=Xr(this.element).width||600,r=i,n={seriesDefaults:{categoryField:e.dateField},axisDefaults:{categoryAxis:{name:"default",majorGridLines:{visible:!1},labels:{step:2},majorTicks:{visible:!1},maxDateGroups:Math.floor(o/28)}}};r&&(r=or({},r,n)),$l.setup(e,r),t.prototype.applyDefaults.call(this,e,r)},e.prototype._setElementClass=function(t){P(t,"k-chart k-stockchart")},e.prototype.setOptions=function(e){this.destroyNavigator(),t.prototype.setOptions.call(this,e)},e.prototype.noTransitionsRedraw=function(){var t=this.options.transitions;this.options.transitions=!1,this._fullRedraw(),this.options.transitions=t},e.prototype._resize=function(){this.noTransitionsRedraw()},e.prototype._redraw=function(){var t=this.navigator;!this._dirty()&&t&&t.options.partialRedraw?t.redrawSlaves():this._fullRedraw()},e.prototype._dirty=function(){var t=this.options,e=Rr([].concat(t.series,t.navigator.series),(function(t){return t&&t.visible})).length,i=this._seriesCount!==e;return this._seriesCount=e,i},e.prototype._fullRedraw=function(){var e=this.navigator;e||(e=this.navigator=new $l(this),this.trigger("navigatorCreated",{navigator:e})),e.clean(),e.setRange(),t.prototype._redraw.call(this),e.initSelection()},e.prototype._trackSharedTooltip=function(e){var i=this._plotArea.paneByPoint(e);i&&i.options.name===Zl?this._unsetActivePoint():t.prototype._trackSharedTooltip.call(this,e)},e.prototype.bindCategories=function(){t.prototype.bindCategories.call(this),this.copyNavigatorCategories()},e.prototype.copyNavigatorCategories=function(){for(var t,e=[].concat(this.options.categoryAxis),i=0;i<e.length;i++){var o=e[i];o.name===Kl?t=o.categories:t&&o.pane===Zl&&(o.categories=t)}},e.prototype.destroyNavigator=function(){this.navigator&&(this.navigator.destroy(),this.navigator=null)},e.prototype.destroy=function(){this.destroyNavigator(),t.prototype.destroy.call(this)},e.prototype._stopChartHandlers=function(e){var i=this._eventCoordinates(e),o=this._plotArea.paneByPoint(i);return t.prototype._stopChartHandlers.call(this,e)||o&&o.options.name===Zl},e.prototype._toggleDragZoomEvents=function(){this._dragZoomEnabled||(this.element.style.touchAction="none",this._dragZoomEnabled=!0)},e}(El);sn(Ql,{dateField:"date",axisDefaults:{categoryAxis:{type:"date",baseUnit:"fit",justified:!0},valueAxis:{narrowRange:!0,labels:{format:"C"}}},navigator:{select:{},seriesDefaults:{markers:{visible:!1},tooltip:{visible:!0},line:{width:2}},hint:{},visible:!0},tooltip:{visible:!0},legend:{visible:!1}});var tu=Ql,eu=Math.PI/180;function iu(t,e){var i=t.getOrigin(),o=t.getSize(),r=hr(e);return t.setOrigin([i.x-r.left,i.y-r.top]),t.setSize([o.width+(r.left+r.right),o.height+(r.top+r.bottom)]),t}var ou=a.Group,ru=a.Path,nu=a.Text;function su(t,e){var i=t.box,o=t.children[0].box,r=e.border||{},n=e.background||"",s=ru.fromRect(new p.Rect([i.x1,i.y1],[i.width(),i.height()]),{stroke:{}}),a=new nu(t.text,new p.Point(o.x1,o.y1),{font:e.font,fill:{color:e.color}}),h=iu(a.bbox().clone(),e.padding),c=ru.fromRect(h,{stroke:{color:r.width?r.color:"",width:r.width,opacity:r.opacity,dashType:r.dashType,lineJoin:"round",lineCap:"round"},fill:{color:n}}),l=new ou;return l.append(s),l.append(c),l.append(a),l}function au(t,e,i){var o=Nr(t.from)?t.from:x,r=Nr(t.to)?t.to:m;return t.from=Math.max(Math.min(r,o),e),t.to=Math.min(Math.max(r,o),i),t}function pu(t,e){var i=hr(e);return i.left=-i.left,i.top=-i.top,i.right=-i.right,i.bottom=-i.bottom,iu(t,i)}var hu=a.Path,cu=a.Surface,lu=function(t){function e(e,i,o,r){void 0===r&&(r={}),t.call(this),this.element=e,this.theme=o,this.contextService=new _r(this,r),this._originalOptions=or({},this.options,i),this.options=or({},this._originalOptions),this._initTheme(o),this.redraw()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){this.surface&&(this.surface.destroy(),this.surface=null),delete this.element,delete this.surfaceElement},e.prototype.value=function(t){var e=this.pointers[0];if(0===arguments.length)return e.value();e.value(t),this._setValueOptions(t)},e.prototype._draw=function(){var t=this.surface;t.clear(),t.draw(this._visuals)},e.prototype.exportVisual=function(){return this._visuals},e.prototype.allValues=function(t){var e=this.pointers,i=[];if(0===arguments.length){for(var o=0;o<e.length;o++)i.push(e[o].value());return i}if(C(t))for(var r=0;r<t.length;r++)$o(t[r])&&e[r].value(t[r]);this._setValueOptions(t)},e.prototype._setValueOptions=function(t){for(var e=[].concat(this.options.pointer),i=[].concat(t),o=0;o<i.length;o++)e[o].value=i[o]},e.prototype.resize=function(){this.noTransitionsRedraw()},e.prototype.noTransitionsRedraw=function(){var t=this.options.transitions;this._toggleTransitions(!1),this.redraw(),this._toggleTransitions(t)},e.prototype.redraw=function(){var t=this._surfaceSize(),e=new p.Rect([0,0],[t.width,t.height]);this._initSurface(),this.gaugeArea=this._createGaugeArea(),this._createModel();var i=pu(e.bbox(),this._gaugeAreaMargin);this.reflow(i)},e.prototype.setOptions=function(t,e){this._originalOptions=or(this._originalOptions,t),this.options=or({},this._originalOptions),this._initTheme(e),this.redraw()},e.prototype.setDirection=function(t){this.contextService.rtl=Boolean(t),this.surface&&"svg"===this.surface.type&&(this.surface.destroy(),this.surface=null)},e.prototype.setIntlService=function(t){this.contextService.intl=t},e.prototype._initTheme=function(t){var e=t||this.theme||{};this.theme=e,this.options=or({},e,this.options);var i=this.options,o=i.pointer;if(C(o)){for(var r=[],n=0;n<o.length;n++)r.push(or({},e.pointer,o[n]));i.pointer=r}},e.prototype._createGaugeArea=function(){var t=this.options.gaugeArea,e=this.surface.size(),i=t.border||{},o=new p.Rect([0,0],[e.width,e.height]);return this._gaugeAreaMargin=t.margin||5,i.width>0&&(o=pu(o,i.width)),hu.fromRect(o,{stroke:{color:i.width?i.color:"",width:i.width,dashType:i.dashType,lineJoin:"round",lineCap:"round"},fill:{color:t.background}})},e.prototype._initSurface=function(){var t=this.options,e=this.surface,i=this._surfaceElement(),o=this._surfaceSize();Xr(i,o),e&&e.options.type===t.renderAs?(this.surface.clear(),this.surface.resize()):(e&&e.destroy(),this.surface=cu.create(i,{type:t.renderAs}))},e.prototype._surfaceSize=function(){var t=this.options,e=this._getSize();return t.gaugeArea&&or(e,t.gaugeArea),e},e.prototype._surfaceElement=function(){return this.surfaceElement||(this.surfaceElement=document.createElement("div"),this.element.appendChild(this.surfaceElement)),this.surfaceElement},e.prototype.getSize=function(){return this._getSize()},e.prototype._getSize=function(){var t=this.element,e=this._defaultSize(),i=t.offsetWidth,o=t.offsetHeight;return i||(i=e.width),o||(o=e.height),{width:i,height:o}},e.prototype._defaultSize=function(){return{width:200,height:200}},e.prototype._toggleTransitions=function(t){this.options.transitions=t;for(var e=0;e<this.pointers.length;e++)this.pointers[e].options.animation.transitions=t},e}(O);sn(lu,{plotArea:{},theme:"default",renderAs:"",pointer:{},scale:{},gaugeArea:{}});var uu=lu,fu=a.Path,du=a.Group,yu=p.Point;function vu(t,e){var i,o,r=t.position,n=t.tickX,s=t.tickY;return t.vertical?(i=new yu(n,r),o=new yu(n+e.size,r)):(i=new yu(r,s),o=new yu(r,s+e.size)),new fu({stroke:{color:e.color,width:e.width}}).moveTo(i).lineTo(o)}function gu(t,e,i,o){var r=e.length;if(o.visible)for(var n=i.mirror,s=i.lineBox,a=o.skip;a<r;a+=o.step)a%o.skipUnit!=0&&(i.tickX=n?s.x2:s.x2-o.size,i.tickY=n?s.y1-o.size:s.y1,i.position=e[a],t.append(vu(i,o)))}var mu=function(t){function e(e,i){var o=e||{};!Nr(o.reverse)&&!1===o.vertical&&(i||{}).rtl&&(o=Object.assign({},o,{reverse:!0})),t.call(this,0,1,o,i),this.options.minorUnit=this.options.minorUnit||this.options.majorUnit/10}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initUserOptions=function(t){var e=or({},this.options,t);return(e=or({},e,{labels:{mirror:e.mirror}})).majorUnit=e.majorUnit||wn(e.min,e.max),e},e.prototype.initFields=function(){},e.prototype.render=function(){var t=this.elements=new du,e=this.renderLabels(),i=this.renderLine(),o=this.renderTicks(),r=this.renderRanges();return t.append(i,e,o,r),t},e.prototype.renderRanges=function(){for(var t=this.options,e=t.min,i=t.max,o=t.vertical,r=t.labels.mirror,n=t.ranges||[],s=new du,a=n.length,h=t.rangeSize||t.minorTicks.size/2,c=0;c<a;c++){var l=au(n[c],e,i),u=this.getSlot(l.from,l.to),f=o?this.lineBox():u,d=o?u:this.lineBox();o?f.x1-=h*(r?-1:1):d.y2+=h*(r?-1:1),s.append(fu.fromRect(new p.Rect([f.x1,d.y1],[f.x2-f.x1,d.y2-d.y1]),{fill:{color:l.color,opacity:l.opacity},stroke:{}}))}return s},e.prototype.renderLabels=function(){for(var t=this.labels,e=this.options,i=new du,o=0;o<t.length;o++)i.append(su(t[o],e.labels));return i},e.prototype.renderLine=function(){var t=this.options.line,e=this.lineBox(),i=new du;if(t.width>0&&t.visible){var o=new fu({stroke:{color:t.color,dashType:t.dashType,width:t.width}});o.moveTo(e.x1,e.y1).lineTo(e.x2,e.y2),i.append(o)}return i},e.prototype.renderTicks=function(){var t=new du,e=this.options,i=e.majorTicks.visible?e.majorUnit:0,o={vertical:e.vertical,mirror:e.labels.mirror,lineBox:this.lineBox()};return gu(t,this.getMajorTickPositions(),o,e.majorTicks),gu(t,this.getMinorTickPositions(),o,or({},{skipUnit:i/e.minorUnit},e.minorTicks)),t},e}(Hs);sn(mu,{min:0,max:50,majorTicks:{size:15,align:"inside",color:l,width:.5,visible:!0},minorTicks:{size:10,align:"inside",color:l,width:.5,visible:!0},line:{width:.5},labels:{position:"inside",padding:2},mirror:!1,_alignLines:!1});var xu=mu,bu=function(t){function e(e,i){t.call(this);var o=e.options,r=o.min,n=o.max,s=this.options=or({},this.options,i);s.fill=s.color,this.scale=e,Nr(s.value)?s.value=Jr(s.value,r,n):s.value=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.value=function(t){var e=this.options,i=e.value;if(0===arguments.length)return i;var o=this.scale.options,r=o.min,n=o.max;e._oldValue=Nr(e._oldValue)?e.value:r,e.value=Jr(t,r,n),this.elements&&this.repaint()},e}(O);sn(bu,{color:l});var _u=bu,wu=function(t){function e(e,i){t.call(this,e,i),this.options=or({track:{visible:Nr(i.track)}},this.options)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(){var t,e,i,o=this.options,r=this.scale,n=r.options,s=n.mirror,a=n.vertical,p=r.lineBox(),h=o.track.size||o.size,c=o.size/2,l=hr(o.margin),u=a?l[s?"left":"right"]:l[s?"bottom":"top"];u=s?-u:u,a?(i=new kn(p.x1+u,p.y1,p.x1+u,p.y2),s?i.x1-=h:i.x2+=h,"barPointer"!==o.shape&&(t=e=new kn(p.x2+u,p.y1-c,p.x2+u,p.y2+c))):(i=new kn(p.x1,p.y1-u,p.x2,p.y1-u),s?i.y2+=h:i.y1-=h,"barPointer"!==o.shape&&(t=e=new kn(p.x1-c,p.y1-u,p.x2+c,p.y1-u))),this.trackBox=i,this.pointerRangeBox=e,this.box=t||i.clone().pad(o.border.width)},e.prototype.getElementOptions=function(){var t=this.options;return{fill:{color:t.color,opacity:t.opacity},stroke:Nr(t.border)?{color:t.border.width?t.border.color||t.color:"",width:t.border.width,dashType:t.border.dashType,opacity:t.opacity}:null}},e.prototype._margin=function(){var t=this.scale,e=this.options,i=t.options,o=i.mirror,r=i.vertical,n=hr(e.margin);return r?n[o?"left":"right"]:n[o?"bottom":"top"]},e}(_u);sn(wu,{shape:"barPointer",track:{border:{width:1}},color:l,border:{width:1},opacity:1,margin:hr(3),animation:{type:"barPointer"},visible:!0});var Au=wu,Su=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){var t=this.options,e=t.margin,i=t.from,o=t.to,r=t.vertical,n=r?"x1":"y1";t.mirror===r?(i[n]-=e,o[n]-=e):(i[n]+=e,o[n]+=e);var s=this.fromScale=new p.Point(i.x1,i.y1),a=this.toScale=new p.Point(o.x1,o.y1);0!==t.duration&&(t.duration=Math.max(s.distanceTo(a)/t.duration*1e3,1))},e.prototype.step=function(t){var e=zr(this.fromScale.x,this.toScale.x,t),i=zr(this.fromScale.y,this.toScale.y,t);this.element.transform(p.transform().translate(e,i))},e}(a.Animation);sn(Su,{easing:"linear",duration:250}),a.AnimationFactory.current.register("arrowPointer",Su);var ku=Su,Cu=p.Point,Pu=a.Path,Tu=function(t){function e(e,i){t.call(this,e,i),Nr(this.options.size)||(this.options.size=.6*this.scale.options.majorTicks.size)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointerShape=function(){var t=this.scale,e=this.options.size,i=e/2,o=t.options.mirror?-1:1;return t.options.vertical?[new Cu(0,0-i),new Cu(0-o*e,0),new Cu(0,0+i)]:[new Cu(0-i,0),new Cu(0,0+o*e),new Cu(0+i,0)]},e.prototype.repaint=function(){var t=this.scale,e=this.options,i=new ku(this.elements,or(e.animation,{vertical:t.options.vertical,mirror:t.options.mirror,margin:this._margin(e.margin),from:t.getSlot(e._oldValue),to:t.getSlot(e.value)}));!1===e.animation.transitions&&(i.options.duration=0),i.setup(),i.play()},e.prototype.render=function(){var t=this.scale,e=this.options,i=this.getElementOptions(),o=this.pointerShape(e.value);e.animation.type="arrowPointer";var r=new Pu({stroke:i.stroke,fill:i.fill}).moveTo(o[0]).lineTo(o[1]).lineTo(o[2]).close(),n=t.getSlot(e.value);return r.transform(p.transform().translate(n.x1,n.y1)),this.elements=r,r},e}(Au),Mu=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){var t=this.options,e=this.axis=t.vertical?k:S,i=this.to=t.newPoints[0][e],o=this.from=t.oldPoints[0][e];0!==t.duration&&(t.duration=Math.max(Math.abs(i-o)/t.speed*1e3,1)),this._set(o)},e.prototype.step=function(t){var e=zr(this.from,this.to,t);this._set(e)},e.prototype._set=function(t){var e="set"+this.axis.toUpperCase(),i=this.options.newPoints;i[0][e](t),i[1][e](t)},e}(a.Animation);sn(Mu,{easing:"linear",speed:250}),a.AnimationFactory.current.register("barPointer",Mu);var Ou=Mu,Ru=a.Group,Bu=a.Path,ju=function(t){function e(e,i){t.call(this,e,i),Nr(this.options.size)||(this.options.size=.3*this.scale.options.majorTicks.size)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointerShape=function(t){var e=this.scale,i=this.options,o=e.options,r=o.mirror,n=o.vertical,s=r===n?-1:1,a=i.size*s,h=e.getSlot(e.options.min),c=e.getSlot(t),l=n?k:S,u=n?S:k,f=this._margin()*s,d=new p.Point;d[l]=h[l+"1"],d[u]=h[u+"1"];var y=new p.Point;y[l]=c[l+"1"],y[u]=c[u+"1"],n?(d.translate(f,0),y.translate(f,0)):(d.translate(0,f),y.translate(0,f));var v=y.clone(),g=d.clone();return n?(v.translate(a,0),g.translate(a,0)):(v.translate(0,a),g.translate(0,a)),[d,y,v,g]},e.prototype.repaint=function(){var t=this.scale,e=this.options,i=this.pointerShape(e.value),o=this.pointerPath,r=this.pointerShape(e._oldValue);o.moveTo(i[0]).lineTo(i[1]).lineTo(i[2]).lineTo(i[3]).close();var n=new Ou(o,or(e.animation,{reverse:t.options.reverse,vertical:t.options.vertical,oldPoints:[r[1],r[2]],newPoints:[i[1],i[2]]}));!1===e.animation.transitions&&(n.options.duration=0),n.setup(),n.play()},e.prototype.render=function(){var t=new Ru,e=this.getElementOptions();this.options.track.visible&&t.append(this.renderTrack());var i=this.pointerPath=new Bu({stroke:e.stroke,fill:e.fill});return t.append(i),this.elements=t,t},e.prototype.renderTrack=function(){var t=this.options.track,e=t.border||{},i=this.trackBox.clone().pad(e.width||0);return new Bu.fromRect(i.toRect(),{fill:{color:t.color,opacity:t.opacity},stroke:{color:e.width?e.color||t.color:"",width:e.width,dashType:e.dashType}})},e}(Au),Iu=a.Group,Lu=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.pointers,i=t.origin.x,o=t.origin.y,r=new kn(i,o,i+t.width(),o+t.height());this.scale.reflow(r),this._shrinkScaleWidth(r);for(var n=0;n<e.length;n++)e[n].reflow();this.bbox=this._getBox(r),this._alignElements(),this._shrinkElements(),this._buildVisual(),this._draw()},e.prototype._buildVisual=function(){var t=new Iu,e=this.scale.render(),i=this.pointers;t.append(this.gaugeArea),t.append(e);for(var o=0;o<i.length;o++){var r=i[o];t.append(r.render()),r.value(r.options.value)}this._visuals=t},e.prototype._createModel=function(){var t=this.options,e=this.scale=new xu(t.scale,this.contextService);this.pointers=[];var i=t.pointer;i=C(i)?i:[i];for(var o=0;o<i.length;o++){var r=or({},i[o],{animation:{transitions:t.transitions}}),n="arrow"===r.shape?Tu:ju;this.pointers.push(new n(e,r))}},e.prototype._defaultSize=function(){var t=this.options.scale.vertical;return{width:t?60:200,height:t?200:60}},e.prototype._getBox=function(t){for(var e,i=this.scale,o=this.pointers,r=t.center(),n=o[0].box.clone().wrap(i.box),s=0;s<o.length;s++)n.wrap(o[s].box.clone());return i.options.vertical?(e=n.width()/2,n=new kn(r.x-e,t.y1,r.x+e,t.y2)):(e=n.height()/2,n=new kn(t.x1,r.y-e,t.x2,r.y+e)),n},e.prototype._alignElements=function(){for(var t,e=this.scale,i=this.pointers,o=e.box,r=i[0].box.clone().wrap(e.box),n=this.bbox,s=0;s<i.length;s++)r.wrap(i[s].box.clone());e.options.vertical?(t=n.center().x-r.center().x,e.reflow(new kn(o.x1+t,n.y1,o.x2+t,n.y2))):(t=n.center().y-r.center().y,e.reflow(new kn(o.x1,o.y1+t,o.x2,o.y2+t)));for(var a=0;a<i.length;a++)i[a].reflow(this.bbox)},e.prototype._shrinkScaleWidth=function(t){var e=this.scale;if(!e.options.vertical){var i=e.contentBox().width()-t.width();i>0&&(e.box.shrink(i,0),e.box.alignTo(t,"center"),e.reflow(e.box))}},e.prototype._shrinkElements=function(){for(var t=this.scale,e=this.pointers,i=t.box.clone(),o=t.options.vertical?"y":"x",r=e[0].box,n=0;n<e.length;n++)r.wrap(e[n].box.clone());i[o+1]+=Math.max(i[o+1]-r[o+1],0),i[o+2]-=Math.max(r[o+2]-i[o+2],0),t.reflow(i);for(var s=0;s<e.length;s++)e[s].reflow(this.bbox)},e}(uu);sn(Lu,{transitions:!0,gaugeArea:{background:""},scale:{vertical:!0}});var zu=Lu,Eu=a.Arc,Vu=a.Path,Fu=a.Group;function Du(t,e,i,o){var r=new Fu,n=t.center,s=t.getRadiusX();if(o.visible)for(var a=0;a<e.length;a++){var h=t.pointAt(e[a]),c=new p.Point(n.x+s-o.size,n.y).rotate(e[a],n);r.append(new Vu({stroke:{color:o.color,width:o.width}}).moveTo(h).lineTo(c))}return r}function Uu(t,e,i,o){return{from:t,to:e,color:i,opacity:o}}var Hu=function(t){function e(e,i){t.call(this,0,1,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initUserOptions=function(t){var e=or({},this.options,t);return e.majorUnit=e.majorUnit||wn(e.min,e.max),e.minorUnit=e.minorUnit||e.majorUnit/10,e},e.prototype.initFields=function(){},e.prototype.render=function(t,e){var i=this.renderArc(t,e);this.bbox=i.bbox(),this.labelElements=this.renderLabels(),this.ticks=this.renderTicks(),this.ranges=this.renderRanges()},e.prototype.reflow=function(t){var e=t.center(),i=Math.min(t.height(),t.width())/2;if(!Nr(this.bbox))return this.render(e,i);this.bbox=this.arc.bbox(),this.radius(this.arc.getRadiusX()),this.repositionRanges(),this.renderLabels()},e.prototype.slotAngle=function(t){var e=this.options,i=e.min,o=e.max,r=e.reverse,n=e.startAngle,s=e.endAngle,a=s-n;return(r?s-(t-i)/(o-i)*a:(t-i)/(o-i)*a+n)+180},e.prototype.hasRanges=function(){var t=this.options.ranges;return t&&t.length},e.prototype.ticksSize=function(){var t=this.options,e=t.majorTicks,i=t.minorTicks,o=0;return e.visible&&(o=e.size),i.visible&&(o=Math.max(i.size,o)),o},e.prototype.labelsCount=function(){var e=t.prototype.labelsCount.call(this),i=this.options;return i.endAngle-i.startAngle>=360&&i.max%i.majorUnit==0&&(e-=1),e},e.prototype.renderLabels=function(){var t=this.options,e=this.arc.clone(),i=e.getRadiusX(),o=this.tickAngles(e,t.majorUnit),r=t.rangeSize=t.rangeSize||.1*i,n=new Fu,s=.05*i;Nr(t.rangeDistance)?s=t.rangeDistance:t.rangeDistance=s;var a=t.labels,h="inside"===a.position,c=Nr(this.labelElements);h&&(i-=this.ticksSize(),this.hasRanges()&&!c&&(i-=r+s),e.setRadiusX(i).setRadiusY(i));for(var l=this.labels,u=l.length,f=hr(a.padding),d=(f.left+f.right)/2,y=(f.top+f.bottom)/2,v=0;v<u;v++){var g=l[v],m=g.box.width()/2,x=g.box.height()/2,b=o[v],_=(b-180)*eu,w=e.pointAt(b),A=w.x+Math.cos(_)*(m+d)*(h?1:-1),S=w.y+Math.sin(_)*(x+y)*(h?1:-1);g.reflow(new kn(A-m,S-x,A+m,S+x));var k=new p.Point(g.box.x1,g.box.y1),C=void 0;if(c){var P=(C=this.labelElements.children[v]).bbox().origin,T=C.transform()||p.transform();T.translate(k.x-P.x,k.y-P.y),C.transform(T)}else C=su(g,t.labels),n.append(C);this.bbox=p.Rect.union(this.bbox,C.bbox())}return n},e.prototype.repositionRanges=function(){var t=this.ranges.children;if(t.length>0){var e=this.options,i=e.rangeDistance,o=e.rangeSize,r=this.getRangeRadius();"inside"===this.options.labels.position&&(r+=o+i);for(var n=r+o/2,s=0;s<t.length;s++)t[s]._geometry.setRadiusX(n).setRadiusY(n);this.bbox=p.Rect.union(this.bbox,this.ranges.bbox())}},e.prototype.renderRanges=function(){var t=this.rangeSegments(),e=t.length,i=new Fu;if(e){var o=this.options,r=o.rangeSize,n=o.reverse,s=o.rangeDistance,a=this.getRangeRadius();this.radius(this.radius()-r-s);for(var p=0;p<e;p++){var h=t[p],c=this.slotAngle(h[n?"to":"from"]),l=this.slotAngle(h[n?"from":"to"]);l-c!=0&&i.append(this.createRange(c,l,a,h))}}return i},e.prototype.createRange=function(t,e,i,o){var r=this.options.rangeSize,n=new p.Arc(this.arc.center,{radiusX:i+r/2,radiusY:i+r/2,startAngle:t,endAngle:e});return new Eu(n,{stroke:{width:r,color:o.color,opacity:o.opacity,lineCap:o.lineCap}})},e.prototype.rangeSegments=function(){var t=this.options,e=t.ranges||[],i=e.length,o=[];if(i){var r=t.min,n=t.max,s=t.rangePlaceholderColor;o.push(Uu(r,n,s));for(var a=0;a<i;a++)for(var p=au(e[a],r,n),h=o.length,c=0;c<h;c++){var l=o[c];if(l.from<=p.from&&p.from<=l.to){o.push(Uu(p.from,p.to,p.color,p.opacity)),l.from<=p.to&&p.to<=l.to&&o.push(Uu(p.to,l.to,s,p.opacity)),l.to=p.from;break}}}return o},e.prototype.getRangeRadius=function(){var t=this.arc,e=this.options,i=e.rangeSize,o=e.rangeDistance,r=e.majorTicks.size;return"outside"===e.labels.position?t.getRadiusX()-r-o-i:t.getRadiusX()-i},e.prototype.renderArc=function(t,e){var i=this.options;return this.arc=new p.Arc(t,{radiusX:e,radiusY:e,startAngle:i.startAngle+180,endAngle:i.endAngle+180})},e.prototype.renderTicks=function(){var t=this.arc,e=this.options,i=t.clone();this.majorTickAngles=this.tickAngles(t,e.majorUnit),this.majorTicks=Du(i,this.majorTickAngles,e.majorUnit,e.majorTicks);var o=new Fu;o.append(this.majorTicks);var r=e.majorTicks.size,n=e.minorTicks.size;if(this._tickDifference=r-n,"outside"===e.labels.position){var s=i.getRadiusX();i.setRadiusX(s-r+n).setRadiusY(s-r+n)}return this.minorTickAngles=this.normalizeTickAngles(this.tickAngles(t,e.minorUnit)),this.minorTicks=Du(i,this.minorTickAngles,e.minorUnit,e.minorTicks),o.append(this.minorTicks),o},e.prototype.normalizeTickAngles=function(t){for(var e=this.options,i=e.majorUnit/e.minorUnit,o=t.length-1;o>=0;o--)o%i==0&&t.splice(o,1);return t},e.prototype.tickAngles=function(t,e){var i=this.options,o=i.reverse,r=i.max-i.min,n=t.endAngle-t.startAngle,s=r/e,a=t.startAngle,p=n/s;o&&(a+=n,p=-p),n>=360&&i.max%e==0&&(s-=1);for(var h=[],c=0;c<s;c++)h.push(tn(a,3)),a+=p;return tn(a)<=t.endAngle&&h.push(a),h},e.prototype.radius=function(t){if(!t)return this.arc.getRadiusX();this.arc.setRadiusX(t).setRadiusY(t),this.repositionTicks(this.majorTicks.children,this.majorTickAngles),this.repositionTicks(this.minorTicks.children,this.minorTickAngles,!0)},e.prototype.repositionTicks=function(t,e,i){var o=i&&this._tickDifference||0,r=this.arc,n=r.getRadiusX();i&&"outside"===this.options.labels.position&&0!==o&&(r=this.arc.clone()).setRadiusX(n-o).setRadiusY(n-o);for(var s=0;s<t.length;s++){var a=r.pointAt(e[s]),h=t[s].segments,c=a.x-h[0].anchor().x,l=a.y-h[0].anchor().y;t[s].transform((new p.transform).translate(c,l))}},e}(Hs);sn(Hu,{min:0,max:100,majorTicks:{size:15,align:"inside",color:l,width:.5,visible:!0},minorTicks:{size:10,align:"inside",color:l,width:.5,visible:!0},startAngle:-30,endAngle:210,labels:{position:"inside",padding:2}});var Gu=Hu,Nu=function(t){function e(e,i){t.call(this,e,i);var o=this.options;o.duration=Math.max(Math.abs(o.newAngle-o.oldAngle)/o.duration*1e3,1)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.step=function(t){var e=this.options,i=zr(e.oldAngle,e.newAngle,t);this.element.transform(p.transform().rotate(i,e.center))},e}(a.Animation);sn(Nu,{easing:"linear",duration:150}),a.AnimationFactory.current.register("radialPointer",Nu);var Wu=Nu,qu=a.Circle,Xu=a.Group,Yu=a.Path,Zu=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setAngle=function(t){this.elements.transform(p.transform().rotate(t,this.center))},e.prototype.repaint=function(){var t=this.scale,e=this.options,i=t.slotAngle(e._oldValue),o=t.slotAngle(e.value);!1===e.animation.transitions?this.setAngle(o):new Wu(this.elements,or(e.animation,{oldAngle:i,newAngle:o})).play()},e.prototype.render=function(){var t=this.scale,e=this.options,i=new Xu;return!1!==e.animation&&or(e.animation,{startAngle:0,center:t.arc.center,reverse:t.options.reverse}),i.append(this._renderNeedle(),this._renderCap()),this.elements=i,this.setAngle(eu),i},e.prototype.reflow=function(t){var e=this.center=t.center,i=Jr(this.options.length||1,.1,1.5),o=this.radius=t.getRadiusX()*i,r=this.capSize=Math.round(o*this.options.cap.size);this.bbox=p.Rect.fromPoints(new p.Point(e.x-r,e.y-r),new p.Point(e.x+r,e.y+r))},e.prototype._renderNeedle=function(){var t=this.scale.options.minorTicks.size,e=this.center,i=this.options.color,o=new Yu({fill:{color:i},stroke:{color:i,width:.5}});return o.moveTo(e.x+this.radius-t,e.y).lineTo(e.x,e.y-this.capSize/2).lineTo(e.x,e.y+this.capSize/2).close(),o},e.prototype._renderCap=function(){var t=this.options,e=t.cap.color||t.color,i=new p.Circle(this.center,this.capSize);return new qu(i,{fill:{color:e},stroke:{color:e}})},e}(_u);sn(Zu,{cap:{size:.05},arrow:{width:16,height:14},animation:{type:"radialPointer",duration:150}});var Ku=Zu,Ju=a.Group,$u=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.pointers;this.scale.reflow(t),this._initialPlotArea=this.scale.bbox;for(var i=0;i<e.length;i++)e[i].reflow(this.scale.arc),this._initialPlotArea=p.Rect.union(this._initialPlotArea,e[i].bbox);this.fitScale(t),this.alignScale(t),this._buildVisual(this.gaugeArea,e,this.scale),this._draw()},e.prototype._buildVisual=function(t,e,i){var o=this._visuals=new Ju;o.append(t),o.append(i.ticks),o.append(i.ranges),this._buildPointers(e),o.append(i.labelElements)},e.prototype._buildPointers=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.render(),this._visuals.append(i.elements),i.value(i.options.value)}},e.prototype.fitScale=function(t){for(var e,i,o,r,n,s=this.scale.arc,a=this._initialPlotArea,p=Math.abs(this.getDiff(a,t)),h=tn(p,3),c=tn(-p,3),l=0,u=0;!(!(u++<100)||(l=n===o?l+1:0)>5||h!==r&&0<=(e=this.getPlotBox(h,t,s))&&e<=2||c!==r&&0<=(o=this.getPlotBox(c,t,s))&&o<=2||(r=e>0&&o>0?2*h:e<0&&o<0?2*c:tn((h+c)/2||1,3),0<=(i=this.getPlotBox(r,t,s))&&i<=2));)n=o,i>0?(c=r,o=i):(h=r,e=i)},e.prototype.getPlotBox=function(t,e,i){var o=this.scale,r=this.pointers,n=i.getRadiusX(),s=i.clone();s.setRadiusX(n+t).setRadiusY(n+t),o.arc=s,o.reflow(e),this.plotBbox=o.bbox;for(var a=0;a<r.length;a++)r[a].reflow(s),this.plotBbox=p.Rect.union(this.plotBbox,r[a].bbox);return this.getDiff(this.plotBbox,e)},e.prototype.getDiff=function(t,e){return Math.min(e.width()-t.width(),e.height()-t.height())},e.prototype.alignScale=function(t){var e=this.plotBbox.center(),i=t.center(),o=e.x-i.x,r=e.y-i.y,n=this.scale,s=this.pointers;n.arc.center.x-=o,n.arc.center.y-=r,n.reflow(t);for(var a=0;a<s.length;a++)s[a].reflow(n.arc),this.plotBbox=p.Rect.union(n.bbox,s[a].bbox)},e.prototype._createModel=function(){var t=this.options,e=t.pointer,i=this.scale=new Gu(t.scale,this.contextService);this.pointers=[];for(var o=C(e)?e:[e],r=0;r<o.length;r++){var n=new Ku(i,or({},o[r],{animation:{transitions:t.transitions}}));this.pointers.push(n)}},e}(uu);sn($u,{transitions:!0,gaugeArea:{background:""}});var Qu=$u,tf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.rangeSegments=function(){var t=this.options;return[{from:t.min,to:t.max,color:t.rangePlaceholderColor,lineCap:t.rangeLineCap}]},e.prototype.hasRanges=function(){return!0},e.prototype.placeholderRangeAngle=function(t){var e=this.ranges.children[0].geometry();this.options.reverse?e.setEndAngle(t):e.setStartAngle(t)},e.prototype.addRange=function(t,e,i){var o=this.options.reverse,r=this.slotAngle(o?e:t),n=this.slotAngle(o?t:e),s=this.createRange(r,n,this.getRangeRadius(),i);return this.ranges.append(s),s},e}(Gu);sn(tf,{min:0,max:100,majorTicks:{visible:!1},minorTicks:{visible:!1},labels:{visible:!1},startAngle:0,endAngle:180,rangeLineCap:"round"});var ef=tf,of=function(t){function e(e,i){t.call(this,e,i);var o=this.options,r=Math.abs(o.newAngle-o.oldAngle)/o.duration*1e3;o.duration=Jr(r,150,800);var n=e.elements.options.get("stroke.color"),s=e.currentColor();n!==s&&(this.startColor=new dn(n),this.color=new dn(s))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.step=function(t){var e=this.options,i=this.startColor,o=this.color,r=zr(e.oldAngle,e.newAngle,t);if(this.element.angle(r),o){var n=tn(zr(i.r,o.r,t)),s=tn(zr(i.g,o.g,t)),a=tn(zr(i.b,o.b,t));this.element.stroke(new dn(n,s,a).toHex())}},e}(a.Animation);sn(of,{easing:"linear",duration:150}),a.AnimationFactory.current.register("radialRangePointer",of);var rf=of,nf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.repaint=function(){var t=this.scale,e=this.options,i=t.slotAngle(e._oldValue),o=t.slotAngle(e.value);this.animation&&this.animation.abort(),!1===e.animation.transitions?(this.angle(o),this.stroke(this.currentColor())):(this.animation=new rf(this,or(e.animation,{oldAngle:i,newAngle:o})),this.animation.play())},e.prototype.angle=function(t){var e=this.elements.geometry();this.scale.options.reverse?e.setStartAngle(t):e.setEndAngle(t),this.scale.placeholderRangeAngle(t)},e.prototype.stroke=function(t){this.elements.stroke(t)},e.prototype.render=function(){if(!this.elements){var t=this.scale,e=this.options;!1!==e.animation&&or(e.animation,{startAngle:0,center:t.arc.center,reverse:t.options.reverse}),this.elements=t.addRange(t.options.min,this.options.value,{color:this.currentColor(),opacity:e.opacity,lineCap:t.options.rangeLineCap})}},e.prototype.currentColor=function(){var t=this.scale.options,e=t.min,i=t.max,o=this.options,r=o.colors,n=o.color,s=o.value,a=$o(s)?s:e;if(r)for(var p=0;p<r.length;p++){var h=r[p],c=h.color,l=h.from;void 0===l&&(l=e);var u=h.to;if(void 0===u&&(u=i),l<=a&&a<=u)return c}return n},e.prototype.reflow=function(){this.render(),this.bbox=this.elements.bbox()},e}(_u);sn(nf,{animation:{type:"radialRangePointer",duration:150}});var sf=nf,af=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initTheme=function(e){t.prototype._initTheme.call(this,e),this.options.color=this.options.color||(this.theme.pointer||{}).color},e.prototype._createModel=function(){var t=this.options,e=this.scale=new ef(t.scale,this.contextService),i=new sf(e,or({},{colors:t.colors,color:t.color,value:t.value,opacity:t.opacity,animation:{transitions:t.transitions}}));this.pointers=[i]},e.prototype._buildPointers=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.render(),i.value(i.options.value)}},e.prototype._setValueOptions=function(t){this.options.value=t},e.prototype.currentColor=function(){var t=this.pointers[0];if(t)return t.currentColor()},e.prototype.centerLabelPosition=function(t,e){var i=this.getSize(),o=this.scale.arc.center,r=o.x-t/2,n=o.y-e/2;if(t<i.width){var s=r+t;r=Math.max(r,0),s>i.width&&(r-=s-i.width)}if(e<i.height){var a=this.scale.bbox,p=a.bottomRight().y,h=n+e;n=Math.max(n,a.origin.y),h>p&&(n-=h-p)}return{left:r,top:n}},e}(Qu),pf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._createModel=function(){var e=this.options.scale;"number"!=typeof e.startAngle&&(e.startAngle=90),e.endAngle=e.startAngle+360,t.prototype._createModel.call(this)},e}(af),hf=function(t){function e(e){t.call(this),this.setOptions(e),this.initProperties()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){},e.prototype.setOptions=function(t){this.options=Object.assign({},this.options,t),this.quietZoneLength=this.options.addQuietZone?2*this.options.quietZoneLength:0},e.prototype.encode=function(t,e,i){var o=Nr(t)?String(t):t;return this.initValue(o,e,i),this.options.addQuietZone&&this.addQuietZone(),this.addData(),this.options.addQuietZone&&this.addQuietZone(),{baseUnit:this.baseUnit,pattern:this.pattern}},e.prototype.initValue=function(){},e.prototype.addQuietZone=function(){this.pattern.push(this.options.quietZoneLength||10)},e.prototype.addData=function(){},e.prototype.invalidCharacterError=function(t){throw new Error("Character '"+t+"' is not valid for symbology "+this.name)},e}(O);sn(hf,{quietZoneLength:10,addQuietZone:!0,addCheckSum:!0});var cf=Object.assign,lf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),cf(this,{name:"Code 11",characterMap:["111121","211121","121121","221111","112121","212111","122111","111221","211211","211111","112111"],cCheckSumTotal:10,kCheckSumTotal:9,kCheckSumMinLength:10,checkSumMod:11,DASH_VALUE:10,DASH:"-",START:"112211",STOP:"11221"})},e.prototype.initValue=function(t,e){this.pattern=[],this.value=t,this.width=e,this.totalUnits=0},e.prototype.addData=function(){var t=this.value;this.addPattern(this.START);for(var e=0;e<t.length;e++)this.addCharacter(t.charAt(e));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.STOP),this.setBaseUnit()},e.prototype.setBaseUnit=function(){this.baseUnit=this.width/(this.totalUnits+this.quietZoneLength)},e.prototype.addCheckSum=function(){var t=this.value,e=t.length,i=this.getWeightedSum(t,e,this.cCheckSumTotal)%this.checkSumMod;if(this.checksum=String(i),this.addPattern(this.characterMap[i]),++e>=this.kCheckSumMinLength){var o=(i+this.getWeightedSum(t,e,this.kCheckSumTotal))%this.checkSumMod;this.checksum+=o,this.addPattern(this.characterMap[o])}},e.prototype.getWeightedSum=function(t,e,i){for(var o=0,r=0;r<t.length;r++)o+=this.weightedValue(this.getValue(t.charAt(r)),e,r,i);return o},e.prototype.weightedValue=function(t,e,i,o){return((e-i)%o||o)*t},e.prototype.getValue=function(t){return isNaN(t)?(t!==this.DASH&&this.invalidCharacterError(t),this.DASH_VALUE):parseInt(t,10)},e.prototype.addCharacter=function(t){var e=this.getValue(t),i=this.characterMap[e];this.addPattern(i)},e.prototype.addPattern=function(t){for(var e,i=0;i<t.length;i++)e=parseInt(t.charAt(i),10),this.pattern.push(e),this.totalUnits+=e},e}(hf);sn(lf,{addCheckSum:!0});var uf=Object.assign,ff=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),uf(this,{minBaseUnitLength:.7})},e.prototype.addData=function(){var t=this.value;this.addStart();for(var e=0;e<t.length;e++)this.addCharacter(t.charAt(e));this.options.addCheckSum&&this.pushCheckSum(),this.addStop(),this.prepareValues()},e.prototype.addCharacter=function(t){var e=this.characterMap[t];e||this.invalidCharacterError(t),this.addBase(e)},e.prototype.addBase=function(){},e}(hf),df=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),uf(this,{name:"Code 39",checkSumMod:43,minRatio:2.5,maxRatio:3,gapWidth:1,splitCharacter:"|",patternMappings:{b:"1|",w:"1|",B:"ratio|",W:"ratio|"},characterMap:{0:{pattern:"bwbWBwBwb",value:0},1:{pattern:"BwbWbwbwB",value:1},2:{pattern:"bwBWbwbwB",value:2},3:{pattern:"BwBWbwbwb",value:3},4:{pattern:"bwbWBwbwB",value:4},5:{pattern:"BwbWBwbwb",value:5},6:{pattern:"bwBWBwbwb",value:6},7:{pattern:"bwbWbwBwB",value:7},8:{pattern:"BwbWbwBwb",value:8},9:{pattern:"bwBWbwBwb",value:9},A:{pattern:"BwbwbWbwB",value:10},B:{pattern:"bwBwbWbwB",value:11},C:{pattern:"BwBwbWbwb",value:12},D:{pattern:"bwbwBWbwB",value:13},E:{pattern:"BwbwBWbwb",value:14},F:{pattern:"bwBwBWbwb",value:15},G:{pattern:"bwbwbWBwB",value:16},H:{pattern:"BwbwbWBwb",value:17},I:{pattern:"bwBwbWBwb",value:18},J:{pattern:"bwbwBWBwb",value:19},K:{pattern:"BwbwbwbWB",value:20},L:{pattern:"bwBwbwbWB",value:21},M:{pattern:"BwBwbwbWb",value:22},N:{pattern:"bwbwBwbWB",value:23},O:{pattern:"BwbwBwbWb",value:24},P:{pattern:"bwBwBwbWb",value:25},Q:{pattern:"bwbwbwBWB",value:26},R:{pattern:"BwbwbwBWb",value:27},S:{pattern:"bwBwbwBWb",value:28},T:{pattern:"bwbwBwBWb",value:29},U:{pattern:"BWbwbwbwB",value:30},V:{pattern:"bWBwbwbwB",value:31},W:{pattern:"BWBwbwbwb",value:32},X:{pattern:"bWbwBwbwB",value:33},Y:{pattern:"BWbwBwbwb",value:34},Z:{pattern:"bWBwBwbwb",value:35},"-":{pattern:"bWbwbwBwB",value:36},".":{pattern:"BWbwbwBwb",value:37}," ":{pattern:"bWBwbwBwb",value:38},$:{pattern:"bWbWbWbwb",value:39},"/":{pattern:"bWbWbwbWb",value:40},"+":{pattern:"bWbwbWbWb",value:41},"%":{pattern:"bwbWbWbWb",value:42},START:{pattern:"bWbwBwBwb"}}})},e.prototype.initValue=function(t,e,i){this.width=e,this.height=i,this.value=t,this.dataLength=t.length,this.pattern=[],this.patternString=""},e.prototype.prepareValues=function(){var t,e=this.minBaseUnitLength,i=this.minRatio,o=Math.max(.15*this.width,24),r=this.maxRatio;if(this.height<o)throw new Error("Insufficient Height. The minimum height for value: "+this.value+" is: "+o);for(t=this.getBaseUnit(r);t<e&&r>i;)r=parseFloat((r-.1).toFixed(1)),t=this.getBaseUnit(r);if(t<e){var n=Math.ceil(this.getBaseWidth(i)*e);throw new Error("Insufficient width. The minimum width for value: "+this.value+" is: "+n)}this.ratio=r,this.baseUnit=t,this.patternString=this.patternString.substring(0,this.patternString.length-1),this.pattern=this.pattern.concat(this.patternString.replace(/ratio/g,r).split(this.splitCharacter))},e.prototype.getBaseUnit=function(t){return this.width/this.getBaseWidth(t)},e.prototype.getBaseWidth=function(t){var e=3*(t+2);return this.quietZoneLength+e*(this.dataLength+2)+this.gapWidth*(this.dataLength+1)},e.prototype.addStart=function(){this.addPattern(this.characterMap.START.pattern),this.addCharacterGap()},e.prototype.addBase=function(t){this.addPattern(t.pattern),this.addCharacterGap()},e.prototype.addStop=function(){this.addPattern(this.characterMap.START.pattern)},e.prototype.addPattern=function(t){for(var e=0;e<t.length;e++)this.patternString+=this.patternMappings[t.charAt(e)]},e.prototype.addCharacterGap=function(){this.patternString+=this.gapWidth+this.splitCharacter},e}(ff);sn(df,{addCheckSum:!1});var yf={addCharacter:function(t){this.characterMap[t]?this.addBase(this.characterMap[t]):t.charCodeAt(0)>127?this.invalidCharacterError(t):this.addExtended(t.charCodeAt(0))},addExtended:function(t){for(var e,i=0;i<this.extendedMappings.length;i++)if(e=this.extendedMappings[i].call(this,t)){for(var o=0;o<e.length;o++){var r=e[o];this.addBase(r)}return void(this.dataLength+=e.length-1)}},extendedMappings:[function(t){if(97<=t&&t<=122)return[this.characterMap[this.shiftCharacters[0]],this.characterMap[String.fromCharCode(t-32)]]},function(t){if(33<=t&&t<=58)return[this.characterMap[this.shiftCharacters[1]],this.characterMap[String.fromCharCode(t+32)]]},function(t){if(1<=t&&t<=26)return[this.characterMap[this.shiftCharacters[2]],this.characterMap[String.fromCharCode(t+64)]]},function(t){var e,i;if(this.specialAsciiCodes[t]){e=[];for(var o=0;o<this.specialAsciiCodes[t].length;o++)e.push(this.characterMap[this.shiftCharacters[3]]),e.push(this.characterMap[this.specialAsciiCodes[t][o]])}else i=6*Math.floor(t/32)+(t-27)%32+64,e=[this.characterMap[this.shiftCharacters[3]],this.characterMap[String.fromCharCode(i)]];return e}],specialAsciiCodes:{0:["U"],64:["V"],96:["W"],127:["T","X","Y","Z"]},shiftValuesAsciiCodes:{39:36,40:47,41:43,42:37},characterMap:{"+":!1,"/":!1,$:!1,"%":!1},shiftCharacters:["SHIFT0","SHIFT1","SHIFT2","SHIFT3"]},vf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),or(this,yf,{name:"Code 39 extended",characterMap:{SHIFT0:{pattern:"bWbwbWbWb",value:41},SHIFT1:{pattern:"bWbWbwbWb",value:40},SHIFT2:{pattern:"bWbWbWbwb",value:39},SHIFT3:{pattern:"bwbWbWbWb",value:42}}})},e}(df),gf=Object.assign,mf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),gf(this,{name:"Code 93",cCheckSumTotal:20,kCheckSumTotal:15,checkSumMod:47,characterMap:{0:{pattern:"131112",value:0},1:{pattern:"111213",value:1},2:{pattern:"111312",value:2},3:{pattern:"111411",value:3},4:{pattern:"121113",value:4},5:{pattern:"121212",value:5},6:{pattern:"121311",value:6},7:{pattern:"111114",value:7},8:{pattern:"131211",value:8},9:{pattern:"141111",value:9},A:{pattern:"211113",value:10},B:{pattern:"211212",value:11},C:{pattern:"211311",value:12},D:{pattern:"221112",value:13},E:{pattern:"221211",value:14},F:{pattern:"231111",value:15},G:{pattern:"112113",value:16},H:{pattern:"112212",value:17},I:{pattern:"112311",value:18},J:{pattern:"122112",value:19},K:{pattern:"132111",value:20},L:{pattern:"111123",value:21},M:{pattern:"111222",value:22},N:{pattern:"111321",value:23},O:{pattern:"121122",value:24},P:{pattern:"131121",value:25},Q:{pattern:"212112",value:26},R:{pattern:"212211",value:27},S:{pattern:"211122",value:28},T:{pattern:"211221",value:29},U:{pattern:"221121",value:30},V:{pattern:"222111",value:31},W:{pattern:"112122",value:32},X:{pattern:"112221",value:33},Y:{pattern:"122121",value:34},Z:{pattern:"123111",value:35},"-":{pattern:"121131",value:36},".":{pattern:"311112",value:37}," ":{pattern:"311211",value:38},$:{pattern:"321111",value:39},"/":{pattern:"112131",value:40},"+":{pattern:"113121",value:41},"%":{pattern:"211131",value:42},SHIFT0:{pattern:"122211",value:46},SHIFT1:{pattern:"311121",value:45},SHIFT2:{pattern:"121221",value:43},SHIFT3:{pattern:"312111",value:44},START:{pattern:"111141"},TERMINATION_BAR:"1"}})},e.prototype.initValue=function(t,e,i){this.value=t,this.width=e,this.height=i,this.pattern=[],this.values=[],this.dataLength=t.length},e.prototype.prepareValues=function(){var t=Math.max(.15*this.width,24);if(this.height<t)throw new Error("Insufficient Height");if(this.setBaseUnit(),this.baseUnit<this.minBaseUnitLength)throw new Error("Insufficient Width")},e.prototype.setBaseUnit=function(){this.baseUnit=this.width/(9*(this.dataLength+2+2)+this.quietZoneLength+1)},e.prototype.addStart=function(){var t=this.characterMap.START.pattern;this.addPattern(t)},e.prototype.addStop=function(){this.addStart(),this.pattern.push(this.characterMap.TERMINATION_BAR)},e.prototype.addBase=function(t){this.addPattern(t.pattern),this.values.push(t.value)},e.prototype.pushCheckSum=function(){var t,e=this._getCheckValues();this.checksum=e.join("");for(var i=0;i<e.length;i++)t=this.characterMap[this._findCharacterByValue(e[i])],this.addPattern(t.pattern)},e.prototype._getCheckValues=function(){var t,e,i=this.values,o=i.length,r=0;for(e=o-1;e>=0;e--)r+=this.weightedValue(i[e],o-e,this.cCheckSumTotal);for(t=r%this.checkSumMod,r=this.weightedValue(t,1,this.kCheckSumTotal),e=o-1;e>=0;e--)r+=this.weightedValue(i[e],o-e+1,this.kCheckSumTotal);return[t,r%this.checkSumMod]},e.prototype._findCharacterByValue=function(t){for(var e in this.characterMap)if(this.characterMap[e].value===t)return e},e.prototype.weightedValue=function(t,e,i){return(e%i||i)*t},e.prototype.addPattern=function(t){for(var e,i=0;i<t.length;i++)e=parseInt(t.charAt(i),10),this.pattern.push(e)},e}(ff),xf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),or(this,yf,{name:"Code 93 extended",pushCheckSum:function(){var t,e=this._getCheckValues();this.checksum=e.join("");for(var i=0;i<e.length;i++)if(t=e[i],this.shiftValuesAsciiCodes[t])this.addExtended(this.shiftValuesAsciiCodes[t]);else{var o=this._findCharacterByValue(t);this.addPattern(this.characterMap[o].pattern)}}})},e}(mf),bf=/^\d+$/,_f=Object.assign,wf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),_f(this,{name:"Postnet",START:"2",VALID_CODE_LENGTHS:[5,9,11],DIGIT_SEPARATOR:"-",characterMap:["22111","11122","11212","11221","12112","12121","12211","21112","21121","21211"]})},e.prototype.initValue=function(t,e,i){this.height=i,this.width=e,this.baseHeight=i/2,this.value=t.replace(new RegExp(this.DIGIT_SEPARATOR,"g"),""),this.pattern=[],this.validate(this.value),this.checkSum=0,this.setBaseUnit()},e.prototype.addData=function(){var t=this.value;this.addPattern(this.START);for(var e=0;e<t.length;e++)this.addCharacter(t.charAt(e));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.START),this.pattern.pop()},e.prototype.addCharacter=function(t){var e=this.characterMap[t];this.checkSum+=parseInt(t,10),this.addPattern(e)},e.prototype.addCheckSum=function(){this.checksum=(10-this.checkSum%10)%10,this.addCharacter(this.checksum)},e.prototype.setBaseUnit=function(){this.baseUnit=this.width/(10*(this.value.length+1)+3+this.quietZoneLength)},e.prototype.validate=function(t){if(bf.test(t)||this.invalidCharacterError(t.match(/[^0-9]/)[0]),!Lr(t.length,this.VALID_CODE_LENGTHS))throw new Error("Invalid value length. Valid lengths for the Postnet symbology are "+this.VALID_CODE_LENGTHS.join(","))},e.prototype.addPattern=function(t){for(var e,i=0;i<t.length;i++)e=this.height-this.baseHeight*t.charAt(i),this.pattern.push({width:1,y1:e,y2:this.height}),this.pattern.push(1)},e}(hf),Af=/^\d+$/,Sf=/^[a-z0-9]+$/i,kf=Object.assign,Cf=function(t){function e(e){t.call(this),this.encoding=e,this.initProperties()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){},e.prototype.addStart=function(){},e.prototype.is=function(){},e.prototype.isCode=function(){return!1},e.prototype.move=function(){},e.prototype.pushState=function(){},e}(O),Pf=function(t){function e(e,i){t.call(this,e),this.states=i,this._initMoves(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),or(this,{FNC4:"FNC4",SHIFT:98})},e.prototype.addStart=function(){this.encoding.addPattern(this.START)},e.prototype.is=function(t,e){var i=t.charCodeAt(e);return this.isCode(i)},e.prototype.move=function(t){for(var e=0;!this._moves[e].call(this,t)&&e<this._moves.length;)e++},e.prototype.pushState=function(t){var e,i=this.states,o=t.value,r=o.length;if(Lr("C",i)){var n=o.substr(t.index).match(/\d{4,}/g);n&&(r=o.indexOf(n[0],t.index))}for(;(e=t.value.charCodeAt(t.index))>=0&&this.isCode(e)&&t.index<r;)this.encoding.addPattern(this.getValue(e)),t.index++},e.prototype._initMoves=function(t){this._moves=[],Lr(this.FNC4,t)&&this._moves.push(this._moveFNC),Lr(this.shiftKey,t)&&this._moves.push(this._shiftState),this._moves.push(this._moveState)},e.prototype._moveFNC=function(t){if(t.fnc)return t.fnc=!1,t.previousState===this.key},e.prototype._shiftState=function(t){if(t.previousState===this.shiftKey&&(t.index+1>=t.value.length||this.encoding[this.shiftKey].is(t.value,t.index+1)))return this.encoding.addPattern(this.SHIFT),t.shifted=!0,!0},e.prototype._moveState=function(){return this.encoding.addPattern(this.MOVE),!0},e}(Cf),Tf={};Tf.A=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{key:"A",shiftKey:"B",MOVE:101,START:103})},e.prototype.isCode=function(t){return 0<=t&&t<96},e.prototype.getValue=function(t){return t<32?t+64:t-32},e}(Pf),Tf.B=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{key:"B",shiftKey:"A",MOVE:100,START:104})},e.prototype.isCode=function(t){return 32<=t&&t<128},e.prototype.getValue=function(t){return t-32},e}(Pf),Tf.C=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{key:"C",MOVE:99,START:105})},e.prototype.addStart=function(){this.encoding.addPattern(this.START)},e.prototype.is=function(t,e){var i=Lf(t,e,4);return(e+4<=t.length||2===t.length)&&Af.test(i)},e.prototype.move=function(){this.encoding.addPattern(this.MOVE)},e.prototype.pushState=function(t){for(var e;(e=Lf(t.value,t.index,2))&&Af.test(e)&&2===e.length;)this.encoding.addPattern(parseInt(e,10)),t.index+=2},e.prototype.getValue=function(t){return t},e}(Cf),Tf.FNC4=function(t){function e(e,i){t.call(this,e),this._initSubStates(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{key:"FNC4",dependentStates:["A","B"]})},e.prototype.addStart=function(t){var e=t.value.charCodeAt(0)-128,i=this._getSubState(e);this.encoding[i].addStart()},e.prototype.is=function(t,e){var i=t.charCodeAt(e);return this.isCode(i)},e.prototype.isCode=function(t){return 128<=t&&t<256},e.prototype.pushState=function(t){var e,i=this._initSubState(t),o=this.encoding,r=i.value.length;if(t.index+=r,r<3)for(;i.index<r;i.index++)e=i.value.charCodeAt(i.index),i.state=this._getSubState(e),i.previousState!==i.state&&(i.previousState=i.state,o[i.state].move(i)),o.addPattern(o[i.state].MOVE),o.addPattern(o[i.state].getValue(e));else i.state!==i.previousState&&o[i.state].move(i),this._pushStart(i),o.pushData(i,this.subStates),t.index<t.value.length&&this._pushStart(i);t.fnc=!0,t.state=i.state},e.prototype._pushStart=function(t){this.encoding.addPattern(this.encoding[t.state].MOVE),this.encoding.addPattern(this.encoding[t.state].MOVE)},e.prototype._initSubState=function(t){var e={value:this._getAll(t.value,t.index),index:0};return e.state=this._getSubState(e.value.charCodeAt(0)),e.previousState=t.previousState===this.key?e.state:t.previousState,e},e.prototype._initSubStates=function(t){this.subStates=[];for(var e=0;e<t.length;e++)Lr(t[e],this.dependentStates)&&this.subStates.push(t[e])},e.prototype._getSubState=function(t){for(var e=0;e<this.subStates.length;e++)if(this.encoding[this.subStates[e]].isCode(t))return this.subStates[e]},e.prototype._getAll=function(t,e){for(var i,o="",r=e;(i=t.charCodeAt(r++))&&this.isCode(i);)o+=String.fromCharCode(i-128);return o},e}(Cf),Tf.FNC1=function(t){function e(e,i){t.call(this,e),this.states=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{key:"FNC1",startState:"C",startAI:"(",endAI:")",dependentStates:["C","B"],applicationIdentifiers:{22:{max:29,type:"alphanumeric"},402:{length:17},7004:{max:4,type:"alphanumeric"},242:{max:6,type:"alphanumeric"},8020:{max:25,type:"alphanumeric"},703:{min:3,max:30,type:"alphanumeric"},8008:{min:8,max:12,type:"alphanumeric"},253:{min:13,max:17,type:"alphanumeric"},8003:{min:14,max:30,type:"alphanumeric"},multiKey:[{ids:["15","17","8005","8100"],ranges:[[11,13],[310,316],[320,336],[340,369]],type:{length:6}},{ids:["240","241","250","251","400","401","403","7002","8004","8007","8110"],ranges:[[-9]],type:{max:30,type:"alphanumeric"}},{ids:["7001"],ranges:[[410,414]],type:{length:13}},{ids:["10","21","254","420","8002"],type:{max:20,type:"alphanumeric"}},{ids:["00","8006","8017","8018"],type:{length:18}},{ids:["01","02","8001"],type:{length:14}},{ids:["422"],ranges:[[424,426]],type:{length:3}},{ids:["20","8102"],type:{length:2}},{ids:["30","37"],type:{max:8,type:"alphanumeric"}},{ids:["390","392"],type:{max:15,type:"alphanumeric"}},{ids:["421","423"],type:{min:3,max:15,type:"alphanumeric"}},{ids:["391","393"],type:{min:3,max:18,type:"alphanumeric"}},{ids:["7003","8101"],type:{length:10}}]},START:102})},e.prototype.addStart=function(){this.encoding[this.startState].addStart()},e.prototype.is=function(){return Lr(this.key,this.states)},e.prototype.pushState=function(t){var e,i,o,r=this.encoding,n=t.value.replace(/\s/g,""),s=new RegExp("["+this.startAI+this.endAI+"]","g"),a=t.index,p={state:this.startState};r.addPattern(this.START);for(;;){if(p.index=0,(e=(o=n.charAt(a)===this.startAI?2:0)>0?this.getBySeparator(n,a):this.getByLength(n,a)).ai.length)i=a+o+e.id.length+e.ai.length;else if((i=n.indexOf(this.startAI,a+1))<0){if(a+e.ai.max+e.id.length+o<n.length)throw new Error("Separators are required after variable length identifiers");i=n.length}if(p.value=n.substring(a,i).replace(s,""),this.validate(e,p.value),r.pushData(p,this.dependentStates),i>=n.length)break;a=i,p.state!==this.startState&&(r[this.startState].move(p),p.state=this.startState),e.ai.length||r.addPattern(this.START)}t.index=t.value.length},e.prototype.validate=function(t,e){var i=e.substr(t.id.length),o=t.ai;if(!o.type&&!Af.test(i))throw new Error("Application identifier "+t.id+" is numeric only but contains non numeric character(s).");if("alphanumeric"===o.type&&!Sf.test(i))throw new Error("Application identifier "+t.id+" is alphanumeric only but contains non alphanumeric character(s).");if(o.length&&o.length!==i.length)throw new Error("Application identifier "+t.id+" must be "+o.length+" characters long.");if(o.min&&o.min>i.length)throw new Error("Application identifier "+t.id+" must be at least "+o.min+" characters long.");if(o.max&&o.max<i.length)throw new Error("Application identifier "+t.id+" must be at most "+o.max+" characters long.")},e.prototype.getByLength=function(t,e){for(var i,o,r=2;r<=4;r++)if(i=Lf(t,e,r),o=this.getApplicationIdentifier(i)||this.getApplicationIdentifier(i.substring(0,i.length-1)))return{id:i,ai:o};this.unsupportedAIError(i)},e.prototype.unsupportedAIError=function(t){throw new Error("'"+t+"' is not a supported Application Identifier")},e.prototype.getBySeparator=function(t,e){var i=t.indexOf(this.startAI,e),o=t.indexOf(this.endAI,i),r=t.substring(i+1,o),n=this.getApplicationIdentifier(r)||this.getApplicationIdentifier(r.substr(r.length-1));return n||this.unsupportedAIError(r),{ai:n,id:r}},e.prototype.getApplicationIdentifier=function(t){var e=this.applicationIdentifiers,i=e.multiKey;if(e[t])return e[t];for(var o=0;o<i.length;o++){if(i[o].ids&&Lr(t,i[o].ids))return i[o].type;if(i[o].ranges)for(var r=i[o].ranges,n=0;n<r.length;n++)if(r[n][0]<=t&&t<=r[n][1])return i[o].type}},e}(Cf);var Mf=function(t){function e(e){t.call(this,e),this._initStates()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{characterMap:[212222,222122,222221,121223,121322,131222,122213,122312,132212,221213,221312,231212,112232,122132,122231,113222,123122,123221,223211,221132,221231,213212,223112,312131,311222,321122,321221,312212,322112,322211,212123,212321,232121,111323,131123,131321,112313,132113,132311,211313,231113,231311,112133,112331,132131,113123,113321,133121,313121,211331,231131,213113,213311,213131,311123,311321,331121,312113,312311,332111,314111,221411,431111,111224,111422,121124,121421,141122,141221,112214,112412,122114,122411,142112,142211,241211,221114,413111,241112,134111,111242,121142,121241,114212,124112,124211,411212,421112,421211,212141,214121,412121,111143,111341,131141,114113,114311,411113,411311,113141,114131,311141,411131,211412,211214,211232,2331112],STOP:106})},e.prototype._initStates=function(){for(var t=0;t<this.states.length;t++)this[this.states[t]]=new Tf[this.states[t]](this,this.states)},e.prototype.initValue=function(t,e,i){this.pattern=[],this.value=t,this.width=e,this.height=i,this.checkSum=0,this.totalUnits=0,this.index=0,this.position=1},e.prototype.addData=function(){var t={value:this.value,index:0,state:""};0!==this.value.length&&(t.state=t.previousState=this.getNextState(t,this.states),this.addStart(t),this.pushData(t,this.states),this.addCheckSum(),this.addStop(),this.setBaseUnit())},e.prototype.pushData=function(t,e){for(;this[t.state].pushState(t),!(t.index>=t.value.length);)if(t.shifted){var i=t.state;t.state=t.previousState,t.previousState=i,t.shifted=!1}else t.previousState=t.state,t.state=this.getNextState(t,e),this[t.state].move(t)},e.prototype.addStart=function(t){this[t.state].addStart(t),this.position=1},e.prototype.addCheckSum=function(){this.checksum=this.checkSum%103,this.addPattern(this.checksum)},e.prototype.addStop=function(){this.addPattern(this.STOP)},e.prototype.setBaseUnit=function(){this.baseUnit=this.width/(this.totalUnits+this.quietZoneLength)},e.prototype.addPattern=function(t){for(var e,i=this.characterMap[t].toString(),o=0;o<i.length;o++)e=parseInt(i.charAt(o),10),this.pattern.push(e),this.totalUnits+=e;this.checkSum+=t*this.position++},e.prototype.getNextState=function(t,e){for(var i=0;i<e.length;i++)if(this[e[i]].is(t.value,t.index))return e[i];this.invalidCharacterError(t.value.charAt(t.index))},e}(hf),Of=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{name:"Code 128 A",states:["A"]})},e}(Mf),Rf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{name:"Code 128 B",states:["B"]})},e}(Mf),Bf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{name:"Code 128 C",states:["C"]})},e}(Mf),jf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{name:"Code 128",states:["C","B","A","FNC4"]})},e}(Mf),If=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{name:"Code GS1-128",states:["FNC1","C","B"]})},e}(Mf);function Lf(t,e,i){return t.substring(e,e+i)}var zf=Object.assign,Ef=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),zf(this,{characterMap:["12121212","12121221","12122112","12122121","12211212","12211221","12212112","12212121","21121212","21121221"],START:"21",STOP:"121",checkSumType:"",checkSums:Hf})},e.prototype.initValue=function(t,e){this.pattern=[],this.value=t,this.checkSumLength=0,this.width=e},e.prototype.setBaseUnit=function(){this.baseUnit=this.width/(12*(this.value.length+this.checkSumLength)+this.quietZoneLength+7)},e.prototype.addData=function(){var t=this.value;this.addPattern(this.START);for(var e=0;e<t.length;e++)this.addCharacter(t.charAt(e));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.STOP),this.setBaseUnit()},e.prototype.addCharacter=function(t){var e=this.characterMap[t];e||this.invalidCharacterError(t),this.addPattern(e)},e.prototype.addPattern=function(t){for(var e=0;e<t.length;e++)this.pattern.push(parseInt(t.charAt(e),10))},e.prototype.addCheckSum=function(){var t=this.checkSums[this.checkSumType].call(this.checkSums,this.value);this.checksum=t.join("");for(var e=0;e<t.length;e++)this.checkSumLength++,this.addPattern(this.characterMap[t[e]])},e}(hf),Vf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),zf(this,{name:"MSI Modulo10",checkSumType:"Modulo10"})},e}(Ef),Ff=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),zf(this,{name:"MSI Modulo11",checkSumType:"Modulo11"})},e}(Ef),Df=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),zf(this,{name:"MSI Modulo10 Modulo10",checkSumType:"Modulo10Modulo10"})},e}(Ef),Uf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),zf(this,{name:"MSI Modulo11 Modulo10",checkSumType:"Modulo11Modulo10"})},e}(Ef),Hf={Modulo10:function(t){var e,i,o,r=[0,""],n=t.length%2;for(e=0;e<t.length;e++)r[(e+n)%2]+=parseInt(t.charAt(e),10);for(o=r[0],i=(2*r[1]).toString(),e=0;e<i.length;e++)o+=parseInt(i.charAt(e),10);return[(10-o%10)%10]},Modulo11:function(t){for(var e,i=0,o=t.length,r=0;r<o;r++)i+=(((o-r)%6||6)+1)*t.charAt(r);return 10!==(e=(11-i%11)%11)?[e]:[1,0]},Modulo11Modulo10:function(t){var e,i=this.Modulo11(t);return e=t+i[0],i.concat(this.Modulo10(e))},Modulo10Modulo10:function(t){var e,i=this.Modulo10(t);return e=t+i[0],i.concat(this.Modulo10(e))}},Gf=Object.assign,Nf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),Gf(this,{name:"EAN 13",keyTable:["000000","001011","001101","001110","010011","011001","011100","010101","010110","011010"],characterMap:{digits:[[3,2,1,1],[2,2,2,1],[2,1,2,2],[1,4,1,1],[1,1,3,2],[1,2,3,1],[1,1,1,4],[1,3,1,2],[1,2,1,3],[3,1,1,2]],start:[1,1,1],middle:[1,1,1,1,1]}})},e.prototype.initValue=function(t,e,i){var o=String(t);if(12!==o.length||/\D/.test(o))throw new Error('The value of the "EAN13" encoding should be 12 symbols');this.pattern=[],this.options.height=i,this.baseUnit=e/(95+this.quietZoneLength),this.value=o,this.checksum=this.calculateChecksum(),this.leftKey=o[0],this.leftPart=o.substr(1,6),this.rightPart=o.substr(7)+this.checksum},e.prototype.addData=function(){this.addPieces(this.characterMap.start),this.addSide(this.leftPart,this.leftKey),this.addPieces(this.characterMap.middle),this.addSide(this.rightPart),this.addPieces(this.characterMap.start)},e.prototype.addSide=function(t,e){for(var i=0;i<t.length;i++)e&&parseInt(this.keyTable[e].charAt(i),10)?this.addPieces(Array.prototype.slice.call(this.characterMap.digits[t.charAt(i)]).reverse(),!0):this.addPieces(this.characterMap.digits[t.charAt(i)],!0)},e.prototype.addPieces=function(t,e){for(var i=0;i<t.length;i++)e?this.pattern.push({y1:0,y2:.95*this.options.height,width:t[i]}):this.pattern.push(t[i])},e.prototype.calculateChecksum=function(){for(var t=0,e=0,i=this.value.split("").reverse().join(""),o=0;o<i.length;o++)o%2?e+=parseInt(i.charAt(o),10):t+=parseInt(i.charAt(o),10);return(10-(3*t+e)%10)%10},e}(hf),Wf=Object.assign,qf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),Wf(this,{name:"EAN 8"})},e.prototype.initValue=function(t,e,i){if(7!==t.length||/\D/.test(t))throw new Error("Invalid value provided");this.value=t,this.options.height=i,this.checksum=this.calculateChecksum(this.value),this.leftPart=this.value.substr(0,4),this.rightPart=this.value.substr(4)+this.checksum,this.pattern=[],this.baseUnit=e/(67+this.quietZoneLength)},e}(Nf),Xf={code11:lf,code39:df,code39extended:vf,code93:mf,code93extended:xf,code128:jf,code128a:Of,code128b:Rf,code128c:Bf};Xf["gs1-128"]=If,Xf.msimod10=Vf,Xf.msimod11=Ff,Xf.msimod1010=Df,Xf.msimod1110=Uf,Xf.postnet=wf,Xf.ean8=qf,Xf.ean13=Nf;var Yf=function(t){function e(e,i){t.call(this),this.options=or({},this.options,i),this.element=e,this._initElement(),this._initSurface(),this._setOptions(i),i&&Nr(i.value)&&this.redraw()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){this._destroySurface()},e.prototype._initElement=function(){P(this.element,"k-barcode"),this.element.style.display="block"},e.prototype._initSurface=function(){var t=this.options,e=this.surface;e&&e.options.type===t.renderAs||(this._destroySurface(),this._initSurfaceElement(),this.surface=this._createSurface())},e.prototype._createSurface=function(){return a.Surface.create(this.surfaceElement,{type:this.options.renderAs})},e.prototype._destroySurface=function(){this.surface&&(this.surface.destroy(),this.surface=null,this._destroySurfaceElement())},e.prototype._initSurfaceElement=function(){this.surfaceElement||(this.surfaceElement=document.createElement("div"),this.surfaceElement.style.position="relative",this.element.appendChild(this.surfaceElement))},e.prototype._destroySurfaceElement=function(){this.surfaceElement&&this.surfaceElement.parentNode&&(this.surfaceElement.parentNode.removeChild(this.surfaceElement),this.surfaceElement=null)},e.prototype.setOptions=function(t){this._setOptions(t),this.redraw()},e.prototype.redraw=function(){var t=this._getSize();this.surface.clear(),this.surface.setSize({width:t.width,height:t.height}),this.createVisual(),this.surface.draw(this.visual)},e.prototype.getSize=function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},e.prototype._resize=function(){this.redraw()},e.prototype.createVisual=function(){this.visual=this._render()},e.prototype._render=function(){var t,e,i=this.options,o=i.value,r=i.text,n=hr(r.margin),s=this._getSize(),p=i.border||{},h=this.encoding,c=new kn(0,0,s.width,s.height).unpad(p.width).unpad(i.padding),l=c.height(),u=new a.Group;return this.contentBox=c,u.append(this._getBackground(s)),r.visible&&(l-=a.util.measureText(o,{font:r.font}).height+n.top+n.bottom),t=h.encode(o,c.width(),l),r.visible&&(e=o,i.checksum&&Nr(h.checksum)&&(e+=" "+h.checksum),u.append(this._getText(e))),this.barHeight=l,this._bandsGroup=this._getBands(t.pattern,t.baseUnit),u.append(this._bandsGroup),u},e.prototype.exportVisual=function(){return this._render()},e.prototype._getSize=function(){var t=this.element,e=t.clientWidth,i=t.clientHeight,o=new p.Size(300,100);return e>0&&(o.width=e),i&&(o.height=i),this.options.width&&(o.width=this.options.width),this.options.height&&(o.height=this.options.height),o},e.prototype.value=function(t){if(!Nr(t))return this.options.value;this.options.value=String(t),this.redraw()},e.prototype._getBands=function(t,e){for(var i,o,r=this.contentBox,n=r.x1,s=new a.Group,h=0;h<t.length;h++){if(i=(o=rr(t[h])?t[h]:{width:t[h],y1:0,y2:this.barHeight}).width*e,h%2){var c=p.Rect.fromPoints(new p.Point(n,o.y1+r.y1),new p.Point(n+i,o.y2+r.y1)),l=a.Path.fromRect(c,{fill:{color:this.options.color},stroke:null});s.append(l)}n+=i}return s},e.prototype._getBackground=function(t){var e=this.options,i=e.border||{},o=new kn(0,0,t.width,t.height).unpad(i.width/2);return a.Path.fromRect(o.toRect(),{fill:{color:e.background},stroke:{color:i.width?i.color:"",width:i.width,dashType:i.dashType}})},e.prototype._getText=function(t){var e=this.options.text,i=this._textbox=new Yn(t,{font:e.font,color:e.color,align:"center",vAlign:"bottom",margin:e.margin});return i.reflow(this.contentBox),i.renderVisual(),i.visual},e.prototype._setOptions=function(t){if(this.type=(t.type||this.options.type).toLowerCase(),"upca"===this.type&&(this.type="ean13",t.value="0"+t.value),"upce"===this.type&&(this.type="ean8",t.value="0"+t.value),!Xf[this.type])throw new Error("Encoding "+this.type+" is not supported.");this.encoding=new Xf[this.type],this.options=or({},this.options,t)},e}(O);sn(Yf,{name:"Barcode",renderAs:"svg",value:"",type:"code39",checksum:!1,width:0,height:0,color:"black",background:"white",text:{visible:!0,font:"16px Consolas, Monaco, Sans Mono, monospace, sans-serif",color:"black",margin:{top:0,bottom:0,left:0,right:0}},border:{width:0,dashType:"solid",color:"black"},padding:{top:0,bottom:0,left:0,right:0}});var Zf=Yf,Kf="Arial, Helvetica, sans-serif",Jf="12px "+Kf,$f="16px "+Kf,Qf=function(){return{icon:{border:{width:1}},label:{font:Jf,padding:3},line:{length:10,width:2},visible:!0}},td=function(t){return{visible:!0,labels:{font:"11px Arial, Helvetica, sans-serif"},overlay:t.gradients?{}:{gradient:"none"},area:{highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.4},rangeArea:{highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.4},verticalRangeArea:{highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.4},bar:{gap:1.5,spacing:.4},boxPlot:{outliersField:"",meanField:"",border:{_brightness:.8,width:1},downColor:"#fff",gap:1,highlight:{border:{opacity:1,width:2},whiskers:{width:3},mean:{width:2},median:{width:2}},mean:{width:2},median:{width:2},spacing:.3,whiskers:{width:2}},bubble:{border:{width:0},labels:{background:"transparent"},opacity:.6},bullet:{gap:1.5,spacing:.4,target:{color:"#ff0000"}},candlestick:{border:{_brightness:.8,width:1},downColor:"#fff",gap:1,highlight:{border:{opacity:1,width:2},line:{width:2}},line:{color:"#000",width:1},spacing:.3},column:{gap:1.5,spacing:.4},heatmap:{labels:{color:"",background:"transparent",visible:!0},highlight:{border:{width:0}}},pie:{labels:{background:"",color:"",padding:{top:5,bottom:5,left:7,right:7}}},donut:{margin:1},funnel:{labels:{background:"",color:"",padding:{top:5,bottom:5,left:7,right:7}}},horizontalWaterfall:{gap:.5,line:{color:"#000",width:1},spacing:.4},line:{width:2},notes:Qf(),ohlc:{gap:1,highlight:{line:{opacity:1,width:3}},line:{width:1},spacing:.3},radarArea:{line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.5},radarLine:{markers:{visible:!1},width:2},polarArea:{line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.5},polarLine:{markers:{visible:!1},width:2},rangeBar:{gap:1.5,spacing:.4},rangeColumn:{gap:1.5,spacing:.4},scatterLine:{width:1},verticalArea:{highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.4},verticalBoxPlot:{outliersField:"",meanField:"",border:{_brightness:.8,width:1},downColor:"#fff",gap:1,highlight:{border:{opacity:1,width:2},whiskers:{width:3},mean:{width:2},median:{width:2}},mean:{width:2},median:{width:2},spacing:.3,whiskers:{width:2}},verticalBullet:{gap:1.5,spacing:.4,target:{color:"#ff0000"}},verticalLine:{width:2},waterfall:{gap:.5,line:{color:"#000",width:1},spacing:.4}}},ed=function(t){return void 0===t&&(t={}),{axisDefaults:{labels:{font:Jf},notes:Qf(),title:{font:$f,margin:5}},categoryAxis:{majorGridLines:{visible:!0}},navigator:{pane:{height:90,margin:{top:10}}},seriesDefaults:td(t),title:{font:$f},legend:{labels:{font:Jf}}}}}})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.KendoCharts=e():t.KendoCharts=e()}(window,(function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(o,r,function(e){return t[e]}.bind(null,r));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=3)}({3:function(t,e,i){"use strict";i.r(e),i.d(e,"autoMajorUnit",(function(){return wn})),i.d(e,"Point",(function(){return An})),i.d(e,"Box",(function(){return kn})),i.d(e,"Ring",(function(){return Pn})),i.d(e,"Sector",(function(){return Tn})),i.d(e,"ShapeBuilder",(function(){return On})),i.d(e,"ShapeElement",(function(){return zn})),i.d(e,"ChartElement",(function(){return Bn})),i.d(e,"BoxElement",(function(){return In})),i.d(e,"RootElement",(function(){return Dn})),i.d(e,"FloatElement",(function(){return Hn})),i.d(e,"Text",(function(){return Wn})),i.d(e,"TextBox",(function(){return Yn})),i.d(e,"Title",(function(){return Kn})),i.d(e,"AxisLabel",(function(){return $n})),i.d(e,"Axis",(function(){return rs})),i.d(e,"Note",(function(){return ts})),i.d(e,"CategoryAxis",(function(){return Cs})),i.d(e,"DateCategoryAxis",(function(){return Ls})),i.d(e,"DateValueAxis",(function(){return Ns})),i.d(e,"NumericAxis",(function(){return Hs})),i.d(e,"LogarithmicAxis",(function(){return Ys})),i.d(e,"PolarAxis",(function(){return Qs})),i.d(e,"RadarCategoryAxis",(function(){return Js})),i.d(e,"RadarNumericAxis",(function(){return oa})),i.d(e,"RadarLogarithmicAxis",(function(){return na})),i.d(e,"CurveProcessor",(function(){return aa})),i.d(e,"Gradients",(function(){return En})),i.d(e,"rectToBox",(function(){return qn})),i.d(e,"ChartAxis",(function(){return pa})),i.d(e,"ChartPane",(function(){return la})),i.d(e,"ChartPlotArea",(function(){return ua})),i.d(e,"findAxisByName",(function(){return ha})),i.d(e,"Aggregates",(function(){return ya})),i.d(e,"AreaChart",(function(){return ap})),i.d(e,"AreaSegment",(function(){return op})),i.d(e,"AxisGroupRangeTracker",(function(){return pp})),i.d(e,"Bar",(function(){return fp})),i.d(e,"BarChart",(function(){return _p})),i.d(e,"BarLabel",(function(){return cp})),i.d(e,"BoxPlotChart",(function(){return Op})),i.d(e,"BoxPlot",(function(){return Tp})),i.d(e,"BubbleChart",(function(){return Vp})),i.d(e,"Bullet",(function(){return Hp})),i.d(e,"BulletChart",(function(){return Np})),i.d(e,"CandlestickChart",(function(){return Cp})),i.d(e,"Candlestick",(function(){return Ap})),i.d(e,"CategoricalChart",(function(){return Va})),i.d(e,"CategoricalErrorBar",(function(){return Ia})),i.d(e,"CategoricalPlotArea",(function(){return Yh})),i.d(e,"Chart",(function(){return El})),i.d(e,"ChartContainer",(function(){return $p})),i.d(e,"ClipAnimation",(function(){return $a})),i.d(e,"ClusterLayout",(function(){return gp})),i.d(e,"Crosshair",(function(){return Kp})),i.d(e,"CrosshairTooltip",(function(){return Yp})),i.d(e,"DefaultAggregates",(function(){return Sh})),i.d(e,"DonutChart",(function(){return Dc})),i.d(e,"DonutPlotArea",(function(){return Uc})),i.d(e,"DonutSegment",(function(){return Vc})),i.d(e,"ErrorBarBase",(function(){return ja})),i.d(e,"ErrorRangeCalculator",(function(){return _a})),i.d(e,"Highlight",(function(){return Kh})),i.d(e,"SharedTooltip",(function(){return vc})),i.d(e,"Legend",(function(){return ac})),i.d(e,"LegendItem",(function(){return nc})),i.d(e,"LegendLayout",(function(){return rc})),i.d(e,"LineChart",(function(){return ip})),i.d(e,"LinePoint",(function(){return Ha})),i.d(e,"LineSegment",(function(){return Na})),i.d(e,"Pane",(function(){return eh})),i.d(e,"PieAnimation",(function(){return _c})),i.d(e,"PieChart",(function(){return Lc})),i.d(e,"PieChartMixin",(function(){return Bc})),i.d(e,"PiePlotArea",(function(){return zc})),i.d(e,"PieSegment",(function(){return Rc})),i.d(e,"PlotAreaBase",(function(){return xh})),i.d(e,"PlotAreaEventsMixin",(function(){return bh})),i.d(e,"PlotAreaFactory",(function(){return hc})),i.d(e,"PointEventsMixin",(function(){return Fa})),i.d(e,"RangeBar",(function(){return Ch})),i.d(e,"RangeBarChart",(function(){return Th})),i.d(e,"RangeAreaPoint",(function(){return Rh})),i.d(e,"RangeAreaChart",(function(){return Eh})),i.d(e,"ScatterChart",(function(){return Ip})),i.d(e,"ScatterErrorBar",(function(){return Rp})),i.d(e,"ScatterLineChart",(function(){return Ac})),i.d(e,"Selection",(function(){return fc})),i.d(e,"SeriesAggregator",(function(){return wh})),i.d(e,"SeriesBinder",(function(){return ma})),i.d(e,"SplineSegment",(function(){return Za})),i.d(e,"SplineAreaSegment",(function(){return sp})),i.d(e,"StackWrap",(function(){return xp})),i.d(e,"Tooltip",(function(){return dc})),i.d(e,"OHLCChart",(function(){return Fh})),i.d(e,"OHLCPoint",(function(){return Vh})),i.d(e,"WaterfallChart",(function(){return Hh})),i.d(e,"WaterfallSegment",(function(){return Uh})),i.d(e,"XYPlotArea",(function(){return Cc})),i.d(e,"MousewheelZoom",(function(){return oc})),i.d(e,"ZoomSelection",(function(){return ic})),i.d(e,"Pannable",(function(){return tc})),i.d(e,"anyHasZIndex",(function(){return Qa})),i.d(e,"appendIfNotNull",(function(){return ih})),i.d(e,"areNumbers",(function(){return Sp})),i.d(e,"bindSegments",(function(){return rh})),i.d(e,"categoriesCount",(function(){return za})),i.d(e,"countNumbers",(function(){return fa})),i.d(e,"equalsIgnoreCase",(function(){return nh})),i.d(e,"evalOptions",(function(){return La})),i.d(e,"filterSeriesByType",(function(){return sh})),i.d(e,"getDateField",(function(){return ah})),i.d(e,"getField",(function(){return va})),i.d(e,"hasGradientOverlay",(function(){return lp})),i.d(e,"hasValue",(function(){return Bp})),i.d(e,"isDateAxis",(function(){return ph})),i.d(e,"segmentVisible",(function(){return oh})),i.d(e,"singleItemOrArray",(function(){return hh})),i.d(e,"createOutOfRangePoints",(function(){return fh})),i.d(e,"ChartService",(function(){return _r})),i.d(e,"DomEventsBuilder",(function(){return Ar})),i.d(e,"FormatService",(function(){return gr})),i.d(e,"IntlService",(function(){return fr})),i.d(e,"TemplateService",(function(){return Cr})),i.d(e,"Sparkline",(function(){return Nl})),i.d(e,"Navigator",(function(){return $l})),i.d(e,"NavigatorHint",(function(){return Yl})),i.d(e,"StockChart",(function(){return tu})),i.d(e,"constants",(function(){return h})),i.d(e,"Gauge",(function(){return uu})),i.d(e,"LinearGauge",(function(){return zu})),i.d(e,"LinearPointer",(function(){return Au})),i.d(e,"ArrowLinearPointer",(function(){return Tu})),i.d(e,"BarLinearPointer",(function(){return ju})),i.d(e,"LinearScale",(function(){return xu})),i.d(e,"RadialGauge",(function(){return Qu})),i.d(e,"RadialPointer",(function(){return Ku})),i.d(e,"RadialScale",(function(){return Gu})),i.d(e,"ArcGauge",(function(){return af})),i.d(e,"RangePointer",(function(){return sf})),i.d(e,"ArcScale",(function(){return ef})),i.d(e,"CircularGauge",(function(){return pf})),i.d(e,"Barcode",(function(){return Zf})),i.d(e,"addClass",(function(){return P})),i.d(e,"removeClass",(function(){return M})),i.d(e,"alignPathToPixel",(function(){return Ko})),i.d(e,"clockwise",(function(){return Jo})),i.d(e,"convertableToNumber",(function(){return tr})),i.d(e,"deepExtend",(function(){return or})),i.d(e,"elementStyles",(function(){return pr})),i.d(e,"getSpacing",(function(){return hr})),i.d(e,"getTemplate",(function(){return Pr})),i.d(e,"getter",(function(){return Or})),i.d(e,"grep",(function(){return Rr})),i.d(e,"hasClasses",(function(){return Br})),i.d(e,"HashMap",(function(){return Ir})),i.d(e,"inArray",(function(){return Lr})),i.d(e,"interpolateValue",(function(){return zr})),i.d(e,"InstanceObserver",(function(){return Vr})),i.d(e,"isArray",(function(){return C})),i.d(e,"isFunction",(function(){return er})),i.d(e,"isNumber",(function(){return $o})),i.d(e,"isObject",(function(){return rr})),i.d(e,"isString",(function(){return Qo})),i.d(e,"map",(function(){return Fr})),i.d(e,"mousewheelDelta",(function(){return Dr})),i.d(e,"FontLoader",(function(){return nn})),i.d(e,"setDefaultOptions",(function(){return sn})),i.d(e,"sparseArrayLimits",(function(){return an})),i.d(e,"styleValue",(function(){return nr})),i.d(e,"find",(function(){return pn})),i.d(e,"elementScale",(function(){return un})),i.d(e,"autoTextColor",(function(){return yn})),i.d(e,"createHashSet",(function(){return _n})),i.d(e,"append",(function(){return Hr})),i.d(e,"bindEvents",(function(){return Gr})),i.d(e,"Class",(function(){return O})),i.d(e,"defined",(function(){return Nr})),i.d(e,"deg",(function(){return Wr})),i.d(e,"elementOffset",(function(){return qr})),i.d(e,"elementSize",(function(){return Xr})),i.d(e,"eventElement",(function(){return Yr})),i.d(e,"eventCoordinates",(function(){return Zr})),i.d(e,"last",(function(){return Kr})),i.d(e,"limitValue",(function(){return Jr})),i.d(e,"logToConsole",(function(){return fi})),i.d(e,"objectKey",(function(){return $r})),i.d(e,"rad",(function(){return Qr})),i.d(e,"round",(function(){return tn})),i.d(e,"unbindEvents",(function(){return en})),i.d(e,"valueOrDefault",(function(){return on})),i.d(e,"chartBaseTheme",(function(){return ed}));var o={};i.r(o),i.d(o,"swing",(function(){return Ve})),i.d(o,"linear",(function(){return Fe})),i.d(o,"easeOutElastic",(function(){return De}));var r={};i.r(r),i.d(r,"Surface",(function(){return eo})),i.d(r,"RootNode",(function(){return Ii})),i.d(r,"Node",(function(){return Pi})),i.d(r,"GroupNode",(function(){return Hi})),i.d(r,"ArcNode",(function(){return Di})),i.d(r,"CircleNode",(function(){return Ui})),i.d(r,"RectNode",(function(){return Ji})),i.d(r,"ImageNode",(function(){return Zi})),i.d(r,"TextNode",(function(){return to})),i.d(r,"PathNode",(function(){return Fi})),i.d(r,"MultiPathNode",(function(){return Ki})),i.d(r,"DefinitionNode",(function(){return ji})),i.d(r,"ClipNode",(function(){return Bi})),i.d(r,"GradientStopNode",(function(){return Ti})),i.d(r,"LinearGradientNode",(function(){return Oi})),i.d(r,"RadialGradientNode",(function(){return Ri})),i.d(r,"exportGroup",(function(){return Uo}));var n={};i.r(n),i.d(n,"Surface",(function(){return Eo})),i.d(n,"RootNode",(function(){return ho})),i.d(n,"Node",(function(){return so})),i.d(n,"GroupNode",(function(){return ao})),i.d(n,"ArcNode",(function(){return Mo})),i.d(n,"CircleNode",(function(){return Oo})),i.d(n,"RectNode",(function(){return jo})),i.d(n,"ImageNode",(function(){return Ro})),i.d(n,"TextNode",(function(){return Io})),i.d(n,"PathNode",(function(){return To})),i.d(n,"MultiPathNode",(function(){return Bo}));var s={};i.r(s),i.d(s,"append",(function(){return le})),i.d(s,"arabicToRoman",(function(){return Go})),i.d(s,"createPromise",(function(){return io})),i.d(s,"defined",(function(){return B})),i.d(s,"definitionId",(function(){return $})),i.d(s,"deg",(function(){return lt})),i.d(s,"encodeBase64",(function(){return qo})),i.d(s,"eventCoordinates",(function(){return ai})),i.d(s,"eventElement",(function(){return ri})),i.d(s,"isTransparent",(function(){return tt})),i.d(s,"last",(function(){return Vt})),i.d(s,"limitValue",(function(){return Yt})),i.d(s,"mergeSort",(function(){return Xo})),i.d(s,"now",(function(){return Ge})),i.d(s,"promiseAll",(function(){return oo})),i.d(s,"rad",(function(){return H})),i.d(s,"round",(function(){return V})),i.d(s,"valueOrDefault",(function(){return Q})),i.d(s,"bindEvents",(function(){return Li})),i.d(s,"elementOffset",(function(){return si})),i.d(s,"elementSize",(function(){return oi})),i.d(s,"elementStyles",(function(){return ei})),i.d(s,"unbindEvents",(function(){return zi})),i.d(s,"elementPadding",(function(){return ni})),i.d(s,"elementScale",(function(){return ci})),i.d(s,"DEG_TO_RAD",(function(){return F})),i.d(s,"MAX_NUM",(function(){return D})),i.d(s,"MIN_NUM",(function(){return U})),i.d(s,"LRUCache",(function(){return $t})),i.d(s,"TextMetrics",(function(){return se})),i.d(s,"measureText",(function(){return ae})),i.d(s,"objectKey",(function(){return ee})),i.d(s,"hashKey",(function(){return ie})),i.d(s,"normalizeText",(function(){return te}));var a={};i.r(a),i.d(a,"HasObservers",(function(){return R})),i.d(a,"Element",(function(){return et})),i.d(a,"Circle",(function(){return ct})),i.d(a,"Arc",(function(){return Jt})),i.d(a,"Path",(function(){return Zt})),i.d(a,"MultiPath",(function(){return Kt})),i.d(a,"Text",(function(){return pe})),i.d(a,"Image",(function(){return he})),i.d(a,"Group",(function(){return ue})),i.d(a,"Layout",(function(){return xe})),i.d(a,"Rect",(function(){return be})),i.d(a,"align",(function(){return we})),i.d(a,"vAlign",(function(){return Ae})),i.d(a,"stack",(function(){return Ce})),i.d(a,"vStack",(function(){return Pe})),i.d(a,"wrap",(function(){return Me})),i.d(a,"vWrap",(function(){return Oe})),i.d(a,"fit",(function(){return Re})),i.d(a,"LinearGradient",(function(){return ze})),i.d(a,"RadialGradient",(function(){return Ee})),i.d(a,"GradientStop",(function(){return Ie})),i.d(a,"Gradient",(function(){return Le})),i.d(a,"Animation",(function(){return Xe})),i.d(a,"AnimationFactory",(function(){return qe})),i.d(a,"PathParser",(function(){return Ye})),i.d(a,"parsePath",(function(){return Wt})),i.d(a,"BaseNode",(function(){return Ze})),i.d(a,"OptionsStore",(function(){return I})),i.d(a,"Surface",(function(){return Do})),i.d(a,"SurfaceFactory",(function(){return Fo})),i.d(a,"exportImage",(function(){return Yo})),i.d(a,"exportSVG",(function(){return Zo})),i.d(a,"QuadNode",(function(){return lo})),i.d(a,"ShapesQuadTree",(function(){return fo})),i.d(a,"svg",(function(){return r})),i.d(a,"canvas",(function(){return n})),i.d(a,"util",(function(){return s}));var p={};i.r(p),i.d(p,"Circle",(function(){return rt})),i.d(p,"Arc",(function(){return gt})),i.d(p,"Rect",(function(){return Y})),i.d(p,"Point",(function(){return q})),i.d(p,"Segment",(function(){return Et})),i.d(p,"Matrix",(function(){return N})),i.d(p,"Size",(function(){return X})),i.d(p,"toMatrix",(function(){return W})),i.d(p,"Transformation",(function(){return Z})),i.d(p,"transform",(function(){return K}));var h={};i.r(h),i.d(h,"NAVIGATOR_AXIS",(function(){return Kl})),i.d(h,"NAVIGATOR_PANE",(function(){return Zl}));var c="arc",l="#000",u="bottom",f="center",d="circle",y="date",v=/\{\d+:?/,g="left",m=Number.MAX_VALUE,x=-Number.MAX_VALUE,b="right",_="top",w="value",A="#fff",S="x",k="y";function C(t){return Array.isArray(t)}function P(t,e){for(var i=C(e)?e:[e],o=0;o<i.length;o++){var r=i[o];-1===t.className.indexOf(r)&&(t.className+=" "+r)}}var T=/\s+/g;function M(t,e){t&&t.className&&(t.className=t.className.replace(e,"").replace(T," "))}var O=function(){},R=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.observers=function(){return this._observers=this._observers||[],this._observers},e.prototype.addObserver=function(t){return this._observers?this._observers.push(t):this._observers=[t],this},e.prototype.removeObserver=function(t){var e=this.observers(),i=e.indexOf(t);return-1!==i&&e.splice(i,1),this},e.prototype.trigger=function(t,e){var i=this._observers;if(i&&!this._suspended)for(var o=0;o<i.length;o++){var r=i[o];r[t]&&r[t](e)}return this},e.prototype.optionsChange=function(t){void 0===t&&(t={}),t.element=this,this.trigger("optionsChange",t)},e.prototype.geometryChange=function(){this.trigger("geometryChange",{element:this})},e.prototype.suspend=function(){return this._suspended=(this._suspended||0)+1,this},e.prototype.resume=function(){return this._suspended=Math.max((this._suspended||0)-1,0),this},e.prototype._observerField=function(t,e){this[t]&&this[t].removeObserver(this),this[t]=e,e.addObserver(this)},e}(O);function B(t){return void 0!==t}var j={}.toString,I=function(t){function e(e,i){for(var o in void 0===i&&(i=""),t.call(this),this.prefix=i,e){var r=e[o];r=this._wrap(r,o),this[o]=r}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){for(var e=t.split("."),i=this;e.length&&i;){i=i[e.shift()]}return i},e.prototype.set=function(t,e){this.get(t)!==e&&(this._set(t,this._wrap(e,t)),this.optionsChange({field:this.prefix+t,value:e}))},e.prototype._set=function(t,i){var o=t.indexOf(".")>=0,r=this,n=t;if(o){for(var s=n.split("."),a=this.prefix;s.length>1;){a+=(n=s.shift())+".";var p=r[n];p||((p=new e({},a)).addObserver(this),r[n]=p),r=p}n=s[0]}r._clear(n),r[n]=i},e.prototype._clear=function(t){var e=this[t];e&&e.removeObserver&&e.removeObserver(this)},e.prototype._wrap=function(t,i){var o=j.call(t),r=t;return null!==r&&B(r)&&"[object Object]"===o&&(t instanceof e||t instanceof O||(r=new e(r,this.prefix+i+".")),r.addObserver(this)),r},e}(R);function L(t){return function(e){return this[t]!==e&&(this[t]=e,this.geometryChange()),this}}function z(t){return function(){return this[t]}}var E=function(t,e){var i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t);return function(t,e){for(var i=0;i<e.length;i++){var o=e[i],r=o.charAt(0).toUpperCase()+o.substring(1,o.length);t["set"+r]=L(o),t["get"+r]=z(o)}}(i.prototype,e),i};function V(t,e){var i,o=(i=e)?Math.pow(10,i):1;return Math.round(t*o)/o}var F=Math.PI/180,D=Number.MAX_VALUE,U=-Number.MAX_VALUE;function H(t){return t*F}var G=function(t){function e(e,i,o,r,n,s){void 0===e&&(e=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===s&&(s=0),t.call(this),this.a=e,this.b=i,this.c=o,this.d=r,this.e=n,this.f=s}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.multiplyCopy=function(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)},e.prototype.invert=function(){var t=this.a,i=this.b,o=this.c,r=this.d,n=this.e,s=this.f,a=t*r-i*o;return 0===a?null:new e(r/a,-i/a,-o/a,t/a,(o*s-r*n)/a,(i*n-t*s)/a)},e.prototype.clone=function(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)},e.prototype.equals=function(t){return!!t&&(this.a===t.a&&this.b===t.b&&this.c===t.c&&this.d===t.d&&this.e===t.e&&this.f===t.f)},e.prototype.round=function(t){return this.a=V(this.a,t),this.b=V(this.b,t),this.c=V(this.c,t),this.d=V(this.d,t),this.e=V(this.e,t),this.f=V(this.f,t),this},e.prototype.toArray=function(t){var e=[this.a,this.b,this.c,this.d,this.e,this.f];if(B(t))for(var i=0;i<e.length;i++)e[i]=V(e[i],t);return e},e.prototype.toString=function(t,e){return void 0===e&&(e=","),this.toArray(t).join(e)},e.translate=function(t,i){return new e(1,0,0,1,t,i)},e.unit=function(){return new e(1,0,0,1,0,0)},e.rotate=function(t,i,o){var r=new e;return r.a=Math.cos(H(t)),r.b=Math.sin(H(t)),r.c=-r.b,r.d=r.a,r.e=i-i*r.a+o*r.b||0,r.f=o-o*r.a-i*r.b||0,r},e.scale=function(t,i){return new e(t,0,0,i,0,0)},e}(O);G.IDENTITY=G.unit();var N=G;function W(t){return t&&"function"==typeof t.matrix?t.matrix():t}var q=function(t){function e(e,i){t.call(this),this.x=e||0,this.y=i||0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={ZERO:{configurable:!0}};return e.prototype.equals=function(t){return t&&t.x===this.x&&t.y===this.y},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.rotate=function(t,i){var o=e.create(i)||e.ZERO;return this.transform(N.rotate(t,o.x,o.y))},e.prototype.translate=function(t,e){return this.x+=t,this.y+=e,this.geometryChange(),this},e.prototype.translateWith=function(t){return this.translate(t.x,t.y)},e.prototype.move=function(t,e){return this.x=this.y=0,this.translate(t,e)},e.prototype.scale=function(t,e){return void 0===e&&(e=t),this.x*=t,this.y*=e,this.geometryChange(),this},e.prototype.scaleCopy=function(t,e){return this.clone().scale(t,e)},e.prototype.transform=function(t){var e=W(t),i=this.x,o=this.y;return this.x=e.a*i+e.c*o+e.e,this.y=e.b*i+e.d*o+e.f,this.geometryChange(),this},e.prototype.transformCopy=function(t){var e=this.clone();return t&&e.transform(t),e},e.prototype.distanceTo=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},e.prototype.round=function(t){return this.x=V(this.x,t),this.y=V(this.y,t),this.geometryChange(),this},e.prototype.toArray=function(t){var e=B(t);return[e?V(this.x,t):this.x,e?V(this.y,t):this.y]},e.prototype.toString=function(t,e){void 0===e&&(e=" ");var i=this.x,o=this.y;return B(t)&&(i=V(i,t),o=V(o,t)),i+e+o},e.create=function(t,i){if(B(t))return t instanceof e?t:1===arguments.length&&2===t.length?new e(t[0],t[1]):new e(t,i)},e.min=function(){for(var t=arguments,i=D,o=D,r=0;r<arguments.length;r++){var n=t[r];i=Math.min(n.x,i),o=Math.min(n.y,o)}return new e(i,o)},e.max=function(){for(var t=arguments,i=U,o=U,r=0;r<arguments.length;r++){var n=t[r];i=Math.max(n.x,i),o=Math.max(n.y,o)}return new e(i,o)},e.minPoint=function(){return new e(U,U)},e.maxPoint=function(){return new e(D,D)},i.ZERO.get=function(){return new e(0,0)},Object.defineProperties(e,i),e}(E(R,["x","y"])),X=function(t){function e(e,i){t.call(this),this.width=e||0,this.height=i||0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={ZERO:{configurable:!0}};return e.prototype.equals=function(t){return t&&t.width===this.width&&t.height===this.height},e.prototype.clone=function(){return new e(this.width,this.height)},e.prototype.toArray=function(t){var e=B(t);return[e?V(this.width,t):this.width,e?V(this.height,t):this.height]},e.create=function(t,i){if(B(t))return t instanceof e?t:1===arguments.length&&2===t.length?new e(t[0],t[1]):new e(t,i)},i.ZERO.get=function(){return new e(0,0)},Object.defineProperties(e,i),e}(E(R,["width","height"])),Y=function(t){function e(e,i,o){void 0===e&&(e=new q),void 0===i&&(i=new X),void 0===o&&(o=0),t.call(this),this.setOrigin(e),this.setSize(i),this.setCornerRadius(o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.origin.clone(),this.size.clone())},e.prototype.equals=function(t){return t&&t.origin.equals(this.origin)&&t.size.equals(this.size)},e.prototype.setOrigin=function(t){return this._observerField("origin",q.create(t)),this.geometryChange(),this},e.prototype.getOrigin=function(){return this.origin},e.prototype.setCornerRadius=function(t){return this.cornerRadius=Array.isArray(t)?t:[t,t],this.geometryChange(),this},e.prototype.getCornerRadius=function(){return this.cornerRadius},e.prototype.setSize=function(t){return this._observerField("size",X.create(t)),this.geometryChange(),this},e.prototype.getSize=function(){return this.size},e.prototype.width=function(){return this.size.width},e.prototype.height=function(){return this.size.height},e.prototype.topLeft=function(){return this.origin.clone()},e.prototype.bottomRight=function(){return this.origin.clone().translate(this.width(),this.height())},e.prototype.topRight=function(){return this.origin.clone().translate(this.width(),0)},e.prototype.bottomLeft=function(){return this.origin.clone().translate(0,this.height())},e.prototype.center=function(){return this.origin.clone().translate(this.width()/2,this.height()/2)},e.prototype.bbox=function(t){var i=this.topLeft().transformCopy(t),o=this.topRight().transformCopy(t),r=this.bottomRight().transformCopy(t),n=this.bottomLeft().transformCopy(t);return e.fromPoints(i,o,r,n)},e.prototype.transformCopy=function(t){return e.fromPoints(this.topLeft().transform(t),this.bottomRight().transform(t))},e.prototype.expand=function(t,e){return void 0===e&&(e=t),this.size.width+=2*t,this.size.height+=2*e,this.origin.translate(-t,-e),this},e.prototype.expandCopy=function(t,e){return this.clone().expand(t,e)},e.prototype.containsPoint=function(t){var e=this.origin,i=this.bottomRight();return!(t.x<e.x||t.y<e.y||i.x<t.x||i.y<t.y)},e.prototype._isOnPath=function(t,e){var i=this.expandCopy(e,e),o=this.expandCopy(-e,-e);return i.containsPoint(t)&&!o.containsPoint(t)},e.fromPoints=function(){var t=q.min.apply(null,arguments),i=q.max.apply(null,arguments),o=new X(i.x-t.x,i.y-t.y);return new e(t,o)},e.union=function(t,i){return e.fromPoints(q.min(t.topLeft(),i.topLeft()),q.max(t.bottomRight(),i.bottomRight()))},e.intersect=function(t,i){var o={left:t.topLeft().x,top:t.topLeft().y,right:t.bottomRight().x,bottom:t.bottomRight().y},r={left:i.topLeft().x,top:i.topLeft().y,right:i.bottomRight().x,bottom:i.bottomRight().y};if(o.left<=r.right&&r.left<=o.right&&o.top<=r.bottom&&r.top<=o.bottom)return e.fromPoints(new q(Math.max(o.left,r.left),Math.max(o.top,r.top)),new q(Math.min(o.right,r.right),Math.min(o.bottom,r.bottom)))},e}(R),Z=function(t){function e(e){void 0===e&&(e=N.unit()),t.call(this),this._matrix=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this._matrix.clone())},e.prototype.equals=function(t){return t&&t._matrix.equals(this._matrix)},e.prototype.translate=function(t,e){return this._matrix=this._matrix.multiplyCopy(N.translate(t,e)),this._optionsChange(),this},e.prototype.scale=function(t,e,i){void 0===e&&(e=t),void 0===i&&(i=null);var o=i;return o&&(o=q.create(o),this._matrix=this._matrix.multiplyCopy(N.translate(o.x,o.y))),this._matrix=this._matrix.multiplyCopy(N.scale(t,e)),o&&(this._matrix=this._matrix.multiplyCopy(N.translate(-o.x,-o.y))),this._optionsChange(),this},e.prototype.rotate=function(t,e){var i=q.create(e)||q.ZERO;return this._matrix=this._matrix.multiplyCopy(N.rotate(t,i.x,i.y)),this._optionsChange(),this},e.prototype.multiply=function(t){var e=W(t);return this._matrix=this._matrix.multiplyCopy(e),this._optionsChange(),this},e.prototype.matrix=function(t){return t?(this._matrix=t,this._optionsChange(),this):this._matrix},e.prototype._optionsChange=function(){this.optionsChange({field:"transform",value:this})},e}(R);function K(t){return null===t?null:t instanceof Z?t:new Z(t)}var J=1;function $(){return"kdef"+J++}function Q(t,e){return B(t)?t:e}function tt(t){return""===t||null===t||"none"===t||"transparent"===t||!B(t)}var et=function(t){function e(e){t.call(this),this._initOptions(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Rect"},e.prototype._initOptions=function(t){void 0===t&&(t={});var e=t.clip,i=t.transform;i&&(t.transform=K(i)),e&&!e.id&&(e.id=$()),this.options=new I(t),this.options.addObserver(this)},e.prototype.transform=function(t){if(!B(t))return this.options.get("transform");this.options.set("transform",K(t))},e.prototype.parentTransform=function(){for(var t,e=this;e.parent;){var i=(e=e.parent).transform();i&&(t=i.matrix().multiplyCopy(t||N.unit()))}if(t)return K(t)},e.prototype.currentTransform=function(t){void 0===t&&(t=this.parentTransform());var e,i=W(this.transform()),o=W(t);if(e=i&&o?o.multiplyCopy(i):i||o)return K(e)},e.prototype.visible=function(t){return B(t)?(this.options.set("visible",t),this):!1!==this.options.get("visible")},e.prototype.clip=function(t){var e=this.options;return B(t)?(t&&!t.id&&(t.id=$()),e.set("clip",t),this):e.get("clip")},e.prototype.opacity=function(t){return B(t)?(this.options.set("opacity",t),this):Q(this.options.get("opacity"),1)},e.prototype.clippedBBox=function(t){var e=this._clippedBBox(t);if(e){var i=this.clip();return i?Y.intersect(e,i.bbox(t)):e}},e.prototype.containsPoint=function(t,e){if(this.visible()){var i=this.currentTransform(e),o=t;return i&&(o=t.transformCopy(i.matrix().invert())),this._hasFill()&&this._containsPoint(o)||this._isOnPath&&this._hasStroke()&&this._isOnPath(o)}return!1},e.prototype._hasFill=function(){var t=this.options.fill;return t&&!tt(t.color)},e.prototype._hasStroke=function(){var t=this.options.stroke;return t&&t.width>0&&!tt(t.color)},e.prototype._clippedBBox=function(t){return this.bbox(t)},Object.defineProperties(e.prototype,i),e}(R);function it(t,e,i,o){var r=0,n=0;return o&&(r=Math.atan2(o.c*i,o.a*e),0!==o.b&&(n=Math.atan2(o.d*i,o.b*e))),{x:r,y:n}}var ot=Math.PI/2,rt=function(t){function e(e,i){void 0===e&&(e=new q),void 0===i&&(i=0),t.call(this),this.setCenter(e),this.setRadius(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setCenter=function(t){return this._observerField("center",q.create(t)),this.geometryChange(),this},e.prototype.getCenter=function(){return this.center},e.prototype.equals=function(t){return t&&t.center.equals(this.center)&&t.radius===this.radius},e.prototype.clone=function(){return new e(this.center.clone(),this.radius)},e.prototype.pointAt=function(t){return this._pointAt(H(t))},e.prototype.bbox=function(t){for(var e=it(this.center,this.radius,this.radius,t),i=q.maxPoint(),o=q.minPoint(),r=0;r<4;r++){var n=this._pointAt(e.x+r*ot).transformCopy(t),s=this._pointAt(e.y+r*ot).transformCopy(t),a=new q(n.x,s.y);i=q.min(i,a),o=q.max(o,a)}return Y.fromPoints(i,o)},e.prototype._pointAt=function(t){var e=this.center,i=this.radius;return new q(e.x+i*Math.cos(t),e.y+i*Math.sin(t))},e.prototype.containsPoint=function(t){var e=this.center,i=this.radius;return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<=Math.pow(i,2)},e.prototype._isOnPath=function(t,e){var i=this.center,o=this.radius,r=i.distanceTo(t);return o-e<=r&&r<=o+e},e}(E(R,["radius"])),nt=function(t){return function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.fill=function(t,e){var i=this.options;if(B(t)){if(t&&"Gradient"!==t.nodeType){var o={color:t};B(e)&&(o.opacity=e),i.set("fill",o)}else i.set("fill",t);return this}return i.get("fill")},e.prototype.stroke=function(t,e,i){return B(t)?(this.options.set("stroke.color",t),B(e)&&this.options.set("stroke.width",e),B(i)&&this.options.set("stroke.opacity",i),this):this.options.get("stroke")},e}(t)},st=N.IDENTITY.toString(),at=function(t){return function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bbox=function(t){var e,i=W(this.currentTransform(t)),o=i?i.toString():st;this._bboxCache&&this._matrixHash===o?e=this._bboxCache.clone():(e=this._bbox(i),this._bboxCache=e?e.clone():null,this._matrixHash=o);var r=this.options.get("stroke.width");return r&&e&&e.expand(r/2),e},e.prototype.geometryChange=function(){delete this._bboxCache,this.trigger("geometryChange",{element:this})},e}(t)};function pt(t){var e="_"+t;return function(t){return B(t)?(this._observerField(e,t),this.geometryChange(),this):this[e]}}var ht=function(t,e){void 0===e&&(e=["geometry"]);var i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t);return function(t,e){for(var i=0;i<e.length;i++)t[e[i]]=pt(e[i])}(i.prototype,e),i},ct=function(t){function e(e,i){void 0===e&&(e=new rt),void 0===i&&(i={}),t.call(this,i),this.geometry(e),B(this.options.stroke)||this.stroke("#000")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Circle"},e.prototype.rawBBox=function(){return this._geometry.bbox()},e.prototype._bbox=function(t){return this._geometry.bbox(t)},e.prototype._containsPoint=function(t){return this.geometry().containsPoint(t)},e.prototype._isOnPath=function(t){return this.geometry()._isOnPath(t,this.options.stroke.width/2)},Object.defineProperties(e.prototype,i),e}(nt(at(ht(et))));function lt(t){return t/F}function ut(t,e,i){return void 0===i&&(i=10),0===V(Math.abs(t-e),i)}function ft(t,e,i){return t<e||ut(t,e,i)}var dt=Math.pow;function yt(t,e,i,o,r,n){var s=V((r-t)/i,3),a=V((n-e)/o,3);return V(lt(Math.atan2(a,s)))}function vt(t,e){for(var i=t;i<e;)i+=90;return i}var gt=function(t){function e(e,i){void 0===e&&(e=new q),void 0===i&&(i={}),t.call(this),this.setCenter(e),this.radiusX=i.radiusX,this.radiusY=i.radiusY||i.radiusX,this.startAngle=i.startAngle,this.endAngle=i.endAngle,this.anticlockwise=i.anticlockwise||!1,this.xRotation=i.xRotation}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.center,{radiusX:this.radiusX,radiusY:this.radiusY,startAngle:this.startAngle,endAngle:this.endAngle,anticlockwise:this.anticlockwise})},e.prototype.setCenter=function(t){return this._observerField("center",q.create(t)),this.geometryChange(),this},e.prototype.getCenter=function(){return this.center},e.prototype.pointAt=function(t){var e=this.center,i=H(t);return new q(e.x+this.radiusX*Math.cos(i),e.y+this.radiusY*Math.sin(i))},e.prototype.curvePoints=function(){var t,e=this.startAngle,i=this.anticlockwise?-1:1,o=[this.pointAt(e)],r=this._arcInterval(),n=r.endAngle-r.startAngle,s=Math.ceil(n/45),a=n/s,p=e;this.xRotation&&(t=K().rotate(this.xRotation,this.center));for(var h=1;h<=s;h++){var c=p+i*a,l=this._intervalCurvePoints(p,c,t);o.push(l.cp1,l.cp2,l.p2),p=c}return o},e.prototype.bbox=function(t){for(var e=this._arcInterval(),i=e.startAngle,o=e.endAngle,r=it(this.center,this.radiusX,this.radiusY,t),n=lt(r.x),s=lt(r.y),a=this.pointAt(o).transformCopy(t),p=vt(n,i),h=vt(s,i),c=this.pointAt(i).transformCopy(t),l=q.min(c,a),u=q.max(c,a);p<o||h<o;){var f=void 0;p<o&&(f=this.pointAt(p).transformCopy(t),p+=90);var d=void 0;h<o&&(d=this.pointAt(h).transformCopy(t),h+=90),c=new q(f.x,d.y),l=q.min(l,c),u=q.max(u,c)}return Y.fromPoints(l,u)},e.prototype._arcInterval=function(){var t=this.startAngle,e=this.endAngle,i=this.anticlockwise;if(i){var o=t;t=e,e=o}return(t>e||i&&t===e)&&(e+=360),{startAngle:t,endAngle:e}},e.prototype._intervalCurvePoints=function(t,e,i){var o=this.pointAt(t),r=this.pointAt(e),n=this._derivativeAt(t),s=this._derivativeAt(e),a=(H(e)-H(t))/3,p=new q(o.x+a*n.x,o.y+a*n.y),h=new q(r.x-a*s.x,r.y-a*s.y);return i&&(o.transform(i),r.transform(i),p.transform(i),h.transform(i)),{p1:o,cp1:p,cp2:h,p2:r}},e.prototype._derivativeAt=function(t){var e=H(t);return new q(-this.radiusX*Math.sin(e),this.radiusY*Math.cos(e))},e.prototype.containsPoint=function(t){var e,i=this._arcInterval(),o=i.endAngle-i.startAngle,r=this.center,n=this.radiusX,s=this.radiusY,a=r.distanceTo(t),p=Math.atan2(t.y-r.y,t.x-r.x),h=n*s/Math.sqrt(dt(n,2)*dt(Math.sin(p),2)+dt(s,2)*dt(Math.cos(p),2)),c=this.pointAt(this.startAngle).round(10),l=this.pointAt(this.endAngle).round(10),u=function(t,e,i,o){var r=e.x-t.x,n=o.x-i.x,s=e.y-t.y,a=o.y-i.y,p=t.x-i.x,h=t.y-i.y,c=r*a-n*s,l=(r*h-s*p)/c,u=(n*h-a*p)/c;if(l>=0&&l<=1&&u>=0&&u<=1)return new q(t.x+u*r,t.y+u*s)}(r,t.round(10),c,l);if(o<180)e=u&&ft(r.distanceTo(u),a)&&ft(a,h);else{var f=yt(r.x,r.y,n,s,t.x,t.y);360!==f&&(f=(360+f)%360);var d=i.startAngle<=f&&f<=i.endAngle;e=d&&ft(a,h)||!d&&(!u||u.equals(t))}return e},e.prototype._isOnPath=function(t,e){var i=this._arcInterval(),o=this.center,r=yt(o.x,o.y,this.radiusX,this.radiusY,t.x,t.y);return 360!==r&&(r=(360+r)%360),i.startAngle<=r&&r<=i.endAngle&&this.pointAt(r).distanceTo(t)<=e},e.fromPoints=function(t,i,o,r,n,s,a){var p=function(t){var e=t.x1,i=t.y1,o=t.x2,r=t.y2,n=t.rx,s=t.ry,a=t.largeArc,p=t.swipe,h=t.rotation;void 0===h&&(h=0);var c=H(h),l=Math.cos(c),u=Math.sin(c),f=l*(e-o)/2+u*(i-r)/2,d=-u*(e-o)/2+l*(i-r)/2,y=a!==p?1:-1,v=Math.pow(f,2),g=Math.pow(d,2),m=Math.pow(n,2),x=Math.pow(s,2),b=v/m+g/x;b>1&&(b=Math.sqrt(v/m+g/x),n*=b,m=Math.pow(n,2),s*=b,x=Math.pow(s,2));var _=y*Math.sqrt((m*x-m*g-x*v)/(m*g+x*v));isNaN(_)&&(_=0);var w=_*(n*d)/s,A=s*f*-_/n,S=l*w-u*A+(e+o)/2,k=u*w+l*A+(i+r)/2,C=(f-w)/n,P=(d-A)/s,T=-(f+w)/n,M=-(d+A)/s,O=(P>=0?1:-1)*lt(Math.acos(C/Math.sqrt(C*C+P*P))),R=V((C*T+P*M)/(Math.sqrt(C*C+P*P)*Math.sqrt(T*T+M*M)),10),B=(C*M-P*T>=0?1:-1)*lt(Math.acos(R));!p&&B>0&&(B-=360);p&&B<0&&(B+=360);var j=O+B,I=j>=0?1:-1;return j=Math.abs(j)%360*I,{center:new q(S,k),startAngle:O,endAngle:j,radiusX:n,radiusY:s,xRotation:h}}({x1:t.x,y1:t.y,x2:i.x,y2:i.y,rx:o,ry:r,largeArc:n,swipe:s,rotation:a});return new e(p.center,{startAngle:p.startAngle,endAngle:p.endAngle,radiusX:p.radiusX,radiusY:p.radiusY,xRotation:p.xRotation,anticlockwise:0===s})},e}(E(R,["radiusX","radiusY","startAngle","endAngle","anticlockwise"])),mt=[].push,xt=[].pop,bt=[].splice,_t=[].shift,wt=[].slice,At=[].unshift,St=function(t){function e(e){void 0===e&&(e=[]),t.call(this),this.length=0,this._splice(0,e.length,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.elements=function(t){return t?(this._splice(0,this.length,t),this._change(),this):this.slice(0)},e.prototype.push=function(){var t=arguments,e=mt.apply(this,t);return this._add(t),e},e.prototype.slice=function(){return wt.call(this)},e.prototype.pop=function(){var t=this.length,e=xt.apply(this);return t&&this._remove([e]),e},e.prototype.splice=function(t,e){var i=wt.call(arguments,2),o=this._splice(t,e,i);return this._change(),o},e.prototype.shift=function(){var t=this.length,e=_t.apply(this);return t&&this._remove([e]),e},e.prototype.unshift=function(){var t=arguments,e=At.apply(this,t);return this._add(t),e},e.prototype.indexOf=function(t){for(var e=this.length,i=0;i<e;i++)if(this[i]===t)return i;return-1},e.prototype._splice=function(t,e,i){var o=bt.apply(this,[t,e].concat(i));return this._clearObserver(o),this._setObserver(i),o},e.prototype._add=function(t){this._setObserver(t),this._change()},e.prototype._remove=function(t){this._clearObserver(t),this._change()},e.prototype._setObserver=function(t){for(var e=0;e<t.length;e++)t[e].addObserver(this)},e.prototype._clearObserver=function(t){for(var e=0;e<t.length;e++)t[e].removeObserver(this)},e.prototype._change=function(){},e}(R),kt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._change=function(){this.geometryChange()},e}(St);function Ct(t,e,i){var o=lt(Math.atan2(e.y-t.y,e.x-t.x));return i.transformCopy(K().rotate(-o,t)).x<t.x}function Pt(t,e,i){var o=1-t;return Math.pow(o,3)*i[0][e]+3*Math.pow(o,2)*t*i[1][e]+3*Math.pow(t,2)*o*i[2][e]+Math.pow(t,3)*i[3][e]}function Tt(t,e){return[-t[0][e]+3*t[1][e]-3*t[2][e]+t[3][e],3*(t[0][e]-2*t[1][e]+t[2][e]),3*(-t[0][e]+t[1][e]),t[0][e]]}var Mt=function(t){function e(e,i){void 0===e&&(e=0),void 0===i&&(i=0),t.call(this),this.real=e,this.img=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.add=function(t){return new e(V(this.real+t.real,10),V(this.img+t.img,10))},e.prototype.addConstant=function(t){return new e(this.real+t,this.img)},e.prototype.negate=function(){return new e(-this.real,-this.img)},e.prototype.multiply=function(t){return new e(this.real*t.real-this.img*t.img,this.real*t.img+this.img*t.real)},e.prototype.multiplyConstant=function(t){return new e(this.real*t,this.img*t)},e.prototype.nthRoot=function(t){var i=Math.atan2(this.img,this.real),o=Math.sqrt(Math.pow(this.img,2)+Math.pow(this.real,2)),r=Math.pow(o,1/t);return new e(r*Math.cos(i/t),r*Math.sin(i/t))},e.prototype.equals=function(t){return this.real===t.real&&this.img===t.img},e.prototype.isReal=function(){return 0===this.img},e}(O);function Ot(t){return t<0?-1:1}function Rt(t,e,i,o){if(0===t)return function(t,e,i){var o=Math.sqrt(Math.pow(e,2)-4*t*i);return[(-e+o)/(2*t),(-e-o)/(2*t)]}(e,i,o);var r,n,s,a,p,h,c,l=(3*t*i-Math.pow(e,2))/(3*Math.pow(t,2)),u=(2*Math.pow(e,3)-9*t*e*i+27*Math.pow(t,2)*o)/(27*Math.pow(t,3)),f=Math.pow(l/3,3)+Math.pow(u/2,2),d=new Mt(0,1),y=-e/(3*t);f<0?(r=new Mt(-u/2,Math.sqrt(-f)).nthRoot(3),n=new Mt(-u/2,-Math.sqrt(-f)).nthRoot(3)):(r=-u/2+Math.sqrt(f),r=new Mt(Ot(r)*Math.pow(Math.abs(r),1/3)),n=-u/2-Math.sqrt(f),n=new Mt(Ot(n)*Math.pow(Math.abs(n),1/3))),s=r.add(n),h=r.add(n).multiplyConstant(-.5),c=r.add(n.negate()).multiplyConstant(Math.sqrt(3)/2),a=h.add(d.multiply(c)),p=h.add(d.negate().multiply(c));var v=[];return s.isReal()&&v.push(V(s.real+y,10)),a.isReal()&&v.push(V(a.real+y,10)),p.isReal()&&v.push(V(p.real+y,10)),v}function Bt(t,e,i,o,r){for(var n,s=Tt(t,o),a=Rt(s[0],s[1],s[2],s[3]-e[o]),p=0;p<a.length;p++)if(0<=a[p]&&a[p]<=1&&(n=Pt(a[p],i,t),Math.abs(n-e[i])<=r))return!0}function jt(t,e,i){var o;if(t.x!==e.x){var r=Math.min(t.x,e.x),n=Math.max(t.x,e.x),s=Math.min(t.y,e.y),a=Math.max(t.y,e.y),p=r<=i.x&&i.x<n;o=s===a?i.y<=s&&p:p&&(a-s)*((t.x-e.x)*(t.y-e.y)>0?i.x-r:n-i.x)/(n-r)+s-i.y>=0}return o?1:0}function It(t){var e="_"+t;return function(t){return B(t)?(this._observerField(e,q.create(t)),this.geometryChange(),this):this[e]}}var Lt=function(t,e){var i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t);return function(t,e){for(var i=0;i<e.length;i++)t[e[i]]=It(e[i])}(i.prototype,e),i};function zt(t){for(var e=t.length,i=D,o=U,r=0;r<e;r++)o=Math.max(o,t[r]),i=Math.min(i,t[r]);return{min:i,max:o}}var Et=function(t){function e(e,i,o){t.call(this),this.anchor(e||new q),this.controlIn(i),this.controlOut(o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bboxTo=function(t,e){var i=this.anchor().transformCopy(e),o=t.anchor().transformCopy(e);return this.controlOut()&&t.controlIn()?this._curveBoundingBox(i,this.controlOut().transformCopy(e),t.controlIn().transformCopy(e),o):this._lineBoundingBox(i,o)},e.prototype._lineBoundingBox=function(t,e){return Y.fromPoints(t,e)},e.prototype._curveBoundingBox=function(t,e,i,o){var r=[t,e,i,o],n=this._curveExtremesFor(r,"x"),s=this._curveExtremesFor(r,"y"),a=zt([n.min,n.max,t.x,o.x]),p=zt([s.min,s.max,t.y,o.y]);return Y.fromPoints(new q(a.min,p.min),new q(a.max,p.max))},e.prototype._curveExtremesFor=function(t,e){var i=this._curveExtremes(t[0][e],t[1][e],t[2][e],t[3][e]);return{min:Pt(i.min,e,t),max:Pt(i.max,e,t)}},e.prototype._curveExtremes=function(t,e,i,o){var r=t-3*e+3*i-o,n=-2*(t-2*e+i),s=t-e,a=Math.sqrt(n*n-4*r*s),p=0,h=1;0===r?0!==n&&(p=h=-s/n):isNaN(a)||(p=(-n+a)/(2*r),h=(-n-a)/(2*r));var c=Math.max(Math.min(p,h),0);(c<0||c>1)&&(c=0);var l=Math.min(Math.max(p,h),1);return(l>1||l<0)&&(l=1),{min:c,max:l}},e.prototype._intersectionsTo=function(t,e){return this.controlOut()&&t.controlIn()?function(t,e,i){for(var o,r=Tt(t,"x"),n=Rt(r[0],r[1],r[2],r[3]-e.x),s=0,a=0;a<n.length;a++)(ut(o=Pt(n[a],"y",t),e.y)||o>e.y)&&((0===n[a]||1===n[a])&&i.bottomRight().x>e.x||0<n[a]&&n[a]<1)&&s++;return s}([this.anchor(),this.controlOut(),t.controlIn(),t.anchor()],e,this.bboxTo(t)):jt(this.anchor(),t.anchor(),e)},e.prototype._isOnCurveTo=function(t,e,i,o){if(this.bboxTo(t).expand(i,i).containsPoint(e)){var r=this.anchor(),n=this.controlOut(),s=t.controlIn(),a=t.anchor();if("start"===o&&r.distanceTo(e)<=i)return!Ct(r,n,e);if("end"===o&&a.distanceTo(e)<=i)return!Ct(a,s,e);var p=[r,n,s,a];if(Bt(p,e,"x","y",i)||Bt(p,e,"y","x",i))return!0;var h=K().rotate(45,e),c=[r.transformCopy(h),n.transformCopy(h),s.transformCopy(h),a.transformCopy(h)];return Bt(c,e,"x","y",i)||Bt(c,e,"y","x",i)}},e.prototype._isOnLineTo=function(t,e,i){var o=this.anchor(),r=t.anchor(),n=lt(Math.atan2(r.y-o.y,r.x-o.x));return new Y([o.x,o.y-i/2],[o.distanceTo(r),i]).containsPoint(e.transformCopy(K().rotate(-n,o)))},e.prototype._isOnPathTo=function(t,e,i,o){return this.controlOut()&&t.controlIn()?this._isOnCurveTo(t,e,i/2,o):this._isOnLineTo(t,e,i)},e}(Lt(R,["anchor","controlIn","controlOut"]));function Vt(t){if(t)return t[t.length-1]}function Ft(t,e,i){for(var o=e?0:1,r=0;r<t.length;r+=2)t.splice(r+o,0,i)}function Dt(t,e){if(t&&e)return e.scaleCopy(2).translate(-t.x,-t.y)}function Ut(t,e,i){var o=e.clone().scale(2/3);return{controlOut:o.clone().translateWith(t.scaleCopy(1/3)),controlIn:o.translateWith(i.scaleCopy(1/3))}}var Ht={l:function(t,e){for(var i=e.parameters,o=e.position,r=0;r<i.length;r+=2){var n=new q(i[r],i[r+1]);e.isRelative&&n.translateWith(o),t.lineTo(n.x,n.y),o.x=n.x,o.y=n.y}},c:function(t,e){for(var i=e.parameters,o=e.position,r=0;r<i.length;r+=6){var n=new q(i[r],i[r+1]),s=new q(i[r+2],i[r+3]),a=new q(i[r+4],i[r+5]);e.isRelative&&(s.translateWith(o),n.translateWith(o),a.translateWith(o)),t.curveTo(n,s,a),o.x=a.x,o.y=a.y}},v:function(t,e){var i=e.isRelative?0:e.position.x;Ft(e.parameters,!0,i),this.l(t,e)},h:function(t,e){var i=e.isRelative?0:e.position.y;Ft(e.parameters,!1,i),this.l(t,e)},a:function(t,e){for(var i=e.parameters,o=e.position,r=0;r<i.length;r+=7){var n=i[r],s=i[r+1],a=i[r+2],p=i[r+3],h=i[r+4],c=new q(i[r+5],i[r+6]);e.isRelative&&c.translateWith(o),o.x===c.x&&o.y===c.y||(t.arcTo(c,n,s,p,h,a),o.x=c.x,o.y=c.y)}},s:function(t,e){var i,o=e.parameters,r=e.position,n=e.previousCommand;"s"!==n&&"c"!==n||(i=Vt(Vt(t.paths).segments).controlIn());for(var s=0;s<o.length;s+=4){var a=new q(o[s],o[s+1]),p=new q(o[s+2],o[s+3]),h=void 0;e.isRelative&&(a.translateWith(r),p.translateWith(r)),h=i?Dt(i,r):r.clone(),i=a,t.curveTo(h,a,p),r.x=p.x,r.y=p.y}},q:function(t,e){for(var i=e.parameters,o=e.position,r=0;r<i.length;r+=4){var n=new q(i[r],i[r+1]),s=new q(i[r+2],i[r+3]);e.isRelative&&(n.translateWith(o),s.translateWith(o));var a=Ut(o,n,s);t.curveTo(a.controlOut,a.controlIn,s),o.x=s.x,o.y=s.y}},t:function(t,e){var i,o=e.parameters,r=e.position,n=e.previousCommand;"q"!==n&&"t"!==n||(i=Vt(Vt(t.paths).segments).controlIn().clone().translateWith(r.scaleCopy(-1/3)).scale(1.5));for(var s=0;s<o.length;s+=2){var a=new q(o[s],o[s+1]);e.isRelative&&a.translateWith(r),i=i?Dt(i,r):r.clone();var p=Ut(r,i,a);t.curveTo(p.controlOut,p.controlIn,a),r.x=a.x,r.y=a.y}}},Gt=/([a-df-z]{1})([^a-df-z]*)(z)?/gi,Nt=/[,\s]?([+\-]?(?:\d*\.\d+|\d+)(?:[eE][+\-]?\d+)?)/g;var Wt=function(t,e){var i,o=new q;return e.replace(Gt,(function(e,r,n,s){var a=r.toLowerCase(),p=a===r,h=function(t){var e=[];return t.replace(Nt,(function(t,i){e.push(parseFloat(i))})),e}(n.trim());if("m"===a&&(p?(o.x+=h[0],o.y+=h[1]):(o.x=h[0],o.y=h[1]),t.moveTo(o.x,o.y),h.length>2&&(a="l",h.splice(0,2))),Ht[a])Ht[a](t,{parameters:h,position:o,isRelative:p,previousCommand:i}),s&&"z"===s.toLowerCase()&&t.close();else if("m"!==a)throw new Error("Error while parsing SVG path. Unsupported command: "+a);i=a})),t};function qt(t,e,i){for(var o,r=0;r<t.length;r++){var n=t[r];if(n.visible()){var s=e?n.bbox(i):n.rawBBox();s&&(o=o?Y.union(o,s):s)}}return o}function Xt(t,e){for(var i,o=0;o<t.length;o++){var r=t[o];if(r.visible()){var n=r.clippedBBox(e);n&&(i=i?Y.union(i,n):n)}}return i}function Yt(t,e,i){return Math.max(Math.min(t,i),e)}var Zt=function(t){function e(e){t.call(this,e),this.segments=new kt,this.segments.addObserver(this),B(this.options.stroke)||(this.stroke("#000"),B(this.options.stroke.lineJoin)||this.options.set("stroke.lineJoin","miter"))}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return e.parse=function(t,e){return Kt.parse(t,e)},i.nodeType.get=function(){return"Path"},e.prototype.moveTo=function(t,e){return this.suspend(),this.segments.elements([]),this.resume(),this.lineTo(t,e),this},e.prototype.lineTo=function(t,e){var i=B(e)?new q(t,e):t,o=new Et(i);return this.segments.push(o),this},e.prototype.curveTo=function(t,e,i){if(this.segments.length>0){var o=Vt(this.segments),r=new Et(i,e);this.suspend(),o.controlOut(t),this.resume(),this.segments.push(r)}return this},e.prototype.arc=function(t,e,i,o,r){if(this.segments.length>0){var n=Vt(this.segments).anchor(),s=H(t),a=new q(n.x-i*Math.cos(s),n.y-o*Math.sin(s)),p=new gt(a,{startAngle:t,endAngle:e,radiusX:i,radiusY:o,anticlockwise:r});this._addArcSegments(p)}return this},e.prototype.arcTo=function(t,e,i,o,r,n){if(this.segments.length>0){var s=Vt(this.segments).anchor(),a=gt.fromPoints(s,q.create(t),e,i,o,r,n);this._addArcSegments(a)}return this},e.prototype._addArcSegments=function(t){this.suspend();for(var e=t.curvePoints(),i=1;i<e.length;i+=3)this.curveTo(e[i],e[i+1],e[i+2]);this.resume(),this.geometryChange()},e.prototype.close=function(){return this.options.closed=!0,this.geometryChange(),this},e.prototype.rawBBox=function(){return this._bbox()},e.prototype._containsPoint=function(t){for(var e,i,o=this.segments,r=o.length,n=0,s=1;s<r;s++)e=o[s-1],i=o[s],n+=e._intersectionsTo(i,t);return!this.options.closed&&o[0].anchor().equals(o[r-1].anchor())||(n+=jt(o[0].anchor(),o[r-1].anchor(),t)),n%2!=0},e.prototype._isOnPath=function(t,e){var i=this.segments,o=i.length,r=e||this.options.stroke.width;if(o>1){if(i[0]._isOnPathTo(i[1],t,r,"start"))return!0;for(var n=2;n<=o-2;n++)if(i[n-1]._isOnPathTo(i[n],t,r))return!0;if(i[o-2]._isOnPathTo(i[o-1],t,r,"end"))return!0}return!1},e.prototype._bbox=function(t){var e,i=this.segments,o=i.length;if(1===o){var r=i[0].anchor().transformCopy(t);e=new Y(r,X.ZERO)}else if(o>0)for(var n=1;n<o;n++){var s=i[n-1].bboxTo(i[n],t);e=e?Y.union(e,s):s}return e},e.fromRect=function(t,i){var o=new e(i),r=t.cornerRadius,n=r[0],s=r[1];if(0===n&&0===s)o.moveTo(t.topLeft()).lineTo(t.topRight()).lineTo(t.bottomRight()).lineTo(t.bottomLeft()).close();else{var a=t.origin,p=a.x,h=a.y,c=t.width(),l=t.height();n=Yt(n,0,c/2),s=Yt(s,0,l/2),o.moveTo(p+n,h).lineTo(p+c-n,h).arcTo([p+c,h+s],n,s,!1).lineTo(p+c,h+l-s).arcTo([p+c-n,h+l],n,s,!1).lineTo(p+n,h+l).arcTo([p,h+l-s],n,s,!1).lineTo(p,h+s).arcTo([p+n,h],n,s,!1)}return o},e.fromPoints=function(t,i){if(t){for(var o=new e(i),r=0;r<t.length;r++){var n=q.create(t[r]);n&&(0===r?o.moveTo(n):o.lineTo(n))}return o}},e.fromArc=function(t,i){var o=new e(i),r=t.startAngle,n=t.pointAt(r);return o.moveTo(n.x,n.y),o.arc(r,t.endAngle,t.radiusX,t.radiusY,t.anticlockwise),o},Object.defineProperties(e.prototype,i),e}(nt(at(et))),Kt=function(t){function e(e){t.call(this,e),this.paths=new kt,this.paths.addObserver(this),B(this.options.stroke)||this.stroke("#000")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return e.parse=function(t,i){var o=new e(i);return Wt(o,t)},i.nodeType.get=function(){return"MultiPath"},e.prototype.moveTo=function(t,e){var i=new Zt;return i.moveTo(t,e),this.paths.push(i),this},e.prototype.lineTo=function(t,e){return this.paths.length>0&&Vt(this.paths).lineTo(t,e),this},e.prototype.curveTo=function(t,e,i){return this.paths.length>0&&Vt(this.paths).curveTo(t,e,i),this},e.prototype.arc=function(t,e,i,o,r){return this.paths.length>0&&Vt(this.paths).arc(t,e,i,o,r),this},e.prototype.arcTo=function(t,e,i,o,r,n){return this.paths.length>0&&Vt(this.paths).arcTo(t,e,i,o,r,n),this},e.prototype.close=function(){return this.paths.length>0&&Vt(this.paths).close(),this},e.prototype._bbox=function(t){return qt(this.paths,!0,t)},e.prototype.rawBBox=function(){return qt(this.paths,!1)},e.prototype._containsPoint=function(t){for(var e=this.paths,i=0;i<e.length;i++)if(e[i]._containsPoint(t))return!0;return!1},e.prototype._isOnPath=function(t){for(var e=this.paths,i=this.options.stroke.width,o=0;o<e.length;o++)if(e[o]._isOnPath(t,i))return!0;return!1},e.prototype._clippedBBox=function(t){return Xt(this.paths,this.currentTransform(t))},Object.defineProperties(e.prototype,i),e}(nt(at(et))),Jt=function(t){function e(e,i){void 0===e&&(e=new gt),void 0===i&&(i={}),t.call(this,i),this.geometry(e),B(this.options.stroke)||this.stroke("#000")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Arc"},e.prototype._bbox=function(t){return this._geometry.bbox(t)},e.prototype.rawBBox=function(){return this.geometry().bbox()},e.prototype.toPath=function(){var t=new Zt,e=this.geometry().curvePoints();if(e.length>0){t.moveTo(e[0].x,e[0].y);for(var i=1;i<e.length;i+=3)t.curveTo(e[i],e[i+1],e[i+2])}return t},e.prototype._containsPoint=function(t){return this.geometry().containsPoint(t)},e.prototype._isOnPath=function(t){return this.geometry()._isOnPath(t,this.options.stroke.width/2)},Object.defineProperties(e.prototype,i),e}(nt(at(ht(et)))),$t=function(t){function e(e){t.call(this),this._size=e,this._length=0,this._map={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.put=function(t,e){var i=this._map,o={key:t,value:e};i[t]=o,this._head?(this._tail.newer=o,o.older=this._tail,this._tail=o):this._head=this._tail=o,this._length>=this._size?(i[this._head.key]=null,this._head=this._head.newer,this._head.older=null):this._length++},e.prototype.get=function(t){var e=this._map[t];if(e)return e===this._head&&e!==this._tail&&(this._head=e.newer,this._head.older=null),e!==this._tail&&(e.older&&(e.older.newer=e.newer,e.newer.older=e.older),e.older=this._tail,e.newer=null,this._tail.newer=e,this._tail=e),e.value},e}(O),Qt=/\r?\n|\r|\t/g;function te(t){return String(t).replace(Qt," ")}function ee(t){var e=[];for(var i in t)e.push(i+t[i]);return e.sort().join("")}function ie(t){for(var e=2166136261,i=0;i<t.length;++i)e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24),e^=t.charCodeAt(i);return e>>>0}var oe,re={baselineMarkerSize:1};"undefined"!=typeof document&&((oe=document.createElement("div")).style.cssText="position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: pre!important;");var ne=function(t){function e(e){t.call(this),this._cache=new $t(1e3),this.options=Object.assign({},re,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.measure=function(t,e,i){if(void 0===i&&(i={}),null==t)return{width:0,height:0,baseline:0};var o=ie(t+ee(e)),r=this._cache.get(o);if(r)return r;var n={width:0,height:0,baseline:0},s=i.box||oe,a=this._baselineMarker().cloneNode(!1);for(var p in e){var h=e[p];void 0!==h&&(s.style[p]=h)}var c=!1!==i.normalizeText?te(t):String(t);return s.textContent=c,s.appendChild(a),document.body.appendChild(s),c.length&&(n.width=s.offsetWidth-this.options.baselineMarkerSize,n.height=s.offsetHeight,n.baseline=a.offsetTop+this.options.baselineMarkerSize),n.width>0&&n.height>0&&this._cache.put(o,n),s.parentNode.removeChild(s),n},e.prototype._baselineMarker=function(){var t=document.createElement("div");return t.style.cssText="display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;",t},e}(O);ne.current=new ne;var se=ne;function ae(t,e,i){return se.current.measure(t,e,i)}var pe=function(t){function e(e,i,o){void 0===i&&(i=new q),void 0===o&&(o={}),t.call(this,o),this.content(e),this.position(i),this.options.font||(this.options.font="12px sans-serif"),B(this.options.fill)||this.fill("#000")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Text"},e.prototype.content=function(t){return B(t)?(this.options.set("content",t),this):this.options.get("content")},e.prototype.measure=function(){return ae(this.content(),{font:this.options.get("font")})},e.prototype.rect=function(){var t=this.measure(),e=this.position().clone();return new Y(e,[t.width,t.height])},e.prototype.bbox=function(t){var e=W(this.currentTransform(t));return this.rect().bbox(e)},e.prototype.rawBBox=function(){return this.rect().bbox()},e.prototype._containsPoint=function(t){return this.rect().containsPoint(t)},Object.defineProperties(e.prototype,i),e}(nt(Lt(et,["position"]))),he=function(t){function e(e,i,o){void 0===i&&(i=new Y),void 0===o&&(o={}),t.call(this,o),this.src(e),this.rect(i)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Image"},e.prototype.src=function(t){return B(t)?(this.options.set("src",t),this):this.options.get("src")},e.prototype.bbox=function(t){var e=W(this.currentTransform(t));return this._rect.bbox(e)},e.prototype.rawBBox=function(){return this._rect.bbox()},e.prototype._containsPoint=function(t){return this._rect.containsPoint(t)},e.prototype._hasFill=function(){return this.src()},Object.defineProperties(e.prototype,i),e}(ht(et,["rect"])),ce=function(t,e){return function(t){function i(){t.apply(this,arguments)}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.traverse=function(t){for(var i=this[e],o=0;o<i.length;o++){var r=i[o];r.traverse?r.traverse(t):t(r)}return this},i}(t)};function le(t,e){return t.push.apply(t,e),t}var ue=function(t){function e(e){t.call(this,e),this.children=[]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Group"},e.prototype.childrenChange=function(t,e,i){this.trigger("childrenChange",{action:t,items:e,index:i})},e.prototype.append=function(){return le(this.children,arguments),this._reparent(arguments,this),this.childrenChange("add",arguments),this},e.prototype.insert=function(t,e){return this.children.splice(t,0,e),e.parent=this,this.childrenChange("add",[e],t),this},e.prototype.insertAt=function(t,e){return this.insert(e,t)},e.prototype.remove=function(t){var e=this.children.indexOf(t);return e>=0&&(this.children.splice(e,1),t.parent=null,this.childrenChange("remove",[t],e)),this},e.prototype.removeAt=function(t){if(0<=t&&t<this.children.length){var e=this.children[t];this.children.splice(t,1),e.parent=null,this.childrenChange("remove",[e],t)}return this},e.prototype.clear=function(){var t=this.children;return this.children=[],this._reparent(t,null),this.childrenChange("remove",t,0),this},e.prototype.bbox=function(t){return qt(this.children,!0,this.currentTransform(t))},e.prototype.rawBBox=function(){return qt(this.children,!1)},e.prototype._clippedBBox=function(t){return Xt(this.children,this.currentTransform(t))},e.prototype.currentTransform=function(t){return et.prototype.currentTransform.call(this,t)||null},e.prototype.containsPoint=function(t,e){if(this.visible())for(var i=this.children,o=this.currentTransform(e),r=0;r<i.length;r++)if(i[r].containsPoint(t,o))return!0;return!1},e.prototype._reparent=function(t,e){for(var i=0;i<t.length;i++){var o=t[i],r=o.parent;r&&r!==this&&r.remove&&r.remove(o),o.parent=e}},Object.defineProperties(e.prototype,i),e}(ce(et,"children"));function fe(t,e,i){var o=i.transform()||K(),r=o.matrix();r.e+=t.x-e.origin.x,r.f+=t.y-e.origin.y,o.matrix(r),i.transform(o)}function de(t,e,i,o,r){return"start"===i?e.origin[o]:"end"===i?e.origin[o]+e.size[r]-t:e.origin[o]+(e.size[r]-t)/2}function ye(t,e,i,o,r){return"start"===i?e.origin[o]+e.size[r]-t:"end"===i?e.origin[o]:e.origin[o]+(e.size[r]-t)/2}var ve={alignContent:"start",justifyContent:"start",alignItems:"start",spacing:0,orientation:"horizontal",lineSpacing:0,wrap:!0,revers:!1},ge=function(t,e){t.forEach(e)},me=function(t,e){for(var i=t.length-1;i>=0;i--)e(t[i],i)},xe=function(t){function e(e,i){t.call(this,Object.assign({},ve,i)),this._rect=e,this._fieldMap={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.rect=function(t){return t?(this._rect=t,this):this._rect},e.prototype._initMap=function(){var t=this.options,e=this._fieldMap;"horizontal"===t.orientation?(e.sizeField="width",e.groupsSizeField="height",e.groupAxis="x",e.groupsAxis="y"):(e.sizeField="height",e.groupsSizeField="width",e.groupAxis="y",e.groupsAxis="x"),t.reverse?(this.forEach=me,this.justifyAlign=ye):(this.forEach=ge,this.justifyAlign=de)},e.prototype.reflow=function(){if(this._rect&&0!==this.children.length){this._initMap(),this.options.transform&&this.transform(null);for(var t,e,i,o=this.options,r=this._rect,n=this._initGroups(),s=n.groups,a=n.groupsSize,p=this._fieldMap,h=p.sizeField,c=p.groupsSizeField,l=p.groupAxis,u=p.groupsAxis,f=new q,d=new q,y=new X,v=de(a,r,o.alignContent,u,c),g=function(r,n){var s=e.elements[n];d[l]=t,d[u]=de(r.size[c],i,o.alignItems,u,c),fe(d,r,s),t+=r.size[h]+o.spacing},m=0;m<s.length;m++)e=s[m],f[l]=t=this.justifyAlign(e.size,r,o.justifyContent,l,h),f[u]=v,y[h]=e.size,y[c]=e.lineSize,i=new Y(f,y),this.forEach(e.bboxes,g),v+=e.lineSize+o.lineSpacing;if(!o.wrap&&e.size>r.size[h]){var x=r.size[h]/i.size[h],b=i.topLeft().scale(x,x),_=de(i.size[c]*x,r,o.alignContent,u,c),w=K();"x"===l?w.translate(r.origin.x-b.x,_-b.y):w.translate(_-b.x,r.origin.y-b.y),w.scale(x,x),this.transform(w)}}},e.prototype._initGroups=function(){for(var t=this.options,e=this.children,i=t.lineSpacing,o=t.wrap,r=t.spacing,n=this._fieldMap.sizeField,s=this._newGroup(),a=[],p=function(){a.push(s),h+=s.lineSize+i},h=-i,c=0;c<e.length;c++){var l=e[c],u=e[c].clippedBBox();l.visible()&&u&&(o&&s.size+u.size[n]+r>this._rect.size[n]?0===s.bboxes.length?(this._addToGroup(s,u,l),p(),s=this._newGroup()):(p(),s=this._newGroup(),this._addToGroup(s,u,l)):this._addToGroup(s,u,l))}return s.bboxes.length&&p(),{groups:a,groupsSize:h}},e.prototype._addToGroup=function(t,e,i){t.size+=e.size[this._fieldMap.sizeField]+this.options.spacing,t.lineSize=Math.max(e.size[this._fieldMap.groupsSizeField],t.lineSize),t.bboxes.push(e),t.elements.push(i)},e.prototype._newGroup=function(){return{lineSize:0,size:-this.options.spacing,bboxes:[],elements:[]}},e}(ue),be=function(t){function e(e,i){void 0===e&&(e=new Y),void 0===i&&(i={}),t.call(this,i),this.geometry(e),B(this.options.stroke)||this.stroke("#000")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Rect"},e.prototype._bbox=function(t){return this._geometry.bbox(t)},e.prototype.rawBBox=function(){return this._geometry.bbox()},e.prototype._containsPoint=function(t){return this._geometry.containsPoint(t)},e.prototype._isOnPath=function(t){return this.geometry()._isOnPath(t,this.options.stroke.width/2)},Object.defineProperties(e.prototype,i),e}(nt(at(ht(et))));function _e(t,e,i,o,r){for(var n=0;n<t.length;n++){var s=t[n].clippedBBox();if(s){var a=s.origin.clone();a[o]=de(s.size[r],e,i||"start",o,r),fe(a,s,t[n])}}}function we(t,e,i){_e(t,e,i,"x","width")}function Ae(t,e,i){_e(t,e,i,"y","height")}function Se(t,e,i,o){if(t.length>1)for(var r=new q,n=t[0].bbox,s=1;s<t.length;s++){var a=t[s].element,p=t[s].bbox;r[e]=n.origin[e]+n.size[o],r[i]=p.origin[i],fe(r,p,a),p.origin[e]=r[e],n=p}}function ke(t){for(var e=[],i=0;i<t.length;i++){var o=t[i],r=o.clippedBBox();r&&e.push({element:o,bbox:r})}return e}function Ce(t){Se(ke(t),"x","y","width")}function Pe(t){Se(ke(t),"y","x","height")}function Te(t,e,i,o,r){for(var n=function(t,e,i){for(var o,r,n=e.size[i],s=[],a=[],p=0,h=function(){a.push({element:o,bbox:r})},c=0;c<t.length;c++)if(o=t[c],r=o.clippedBBox()){var l=r.size[i];p+l>n?a.length?(s.push(a),a=[],h(),p=l):(h(),s.push(a),a=[],p=0):(h(),p+=l)}return a.length&&s.push(a),s}(t,e,r),s=e.origin.clone(),a=[],p=0;p<n.length;p++){var h=n[p],c=h[0];s[o]=c.bbox.origin[o],fe(s,c.bbox,c.element),c.bbox.origin[i]=s[i],Se(h,i,o,r),a.push([]);for(var l=0;l<h.length;l++)a[p].push(h[l].element)}return a}function Me(t,e){return Te(t,e,"x","y","width")}function Oe(t,e){return Te(t,e,"y","x","height")}function Re(t,e){var i=t.clippedBBox();if(i){var o=i.size,r=e.size;if(r.width<o.width||r.height<o.height){var n=Math.min(r.width/o.width,r.height/o.height),s=t.transform()||K();s.scale(n,n),t.transform(s)}}}var Be=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._change=function(){this.optionsChange({field:"stops"})},e}(St);function je(t){return function(e){return B(e)?(this.options.set(t,e),this):this.options.get(t)}}var Ie=function(t){function e(e,i,o){t.call(this),this.options=new I({offset:e,color:i,opacity:B(o)?o:1}),this.options.addObserver(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(B(t))return t instanceof e?t:t.length>1?new e(t[0],t[1],t[2]):new e(t.offset,t.color,t.opacity)},e}(function(t,e){var i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t);return function(t,e){for(var i=0;i<e.length;i++)t[e[i]]=je(e[i])}(i.prototype,e),i}(R,["offset","color","opacity"])),Le=function(t){function e(e){void 0===e&&(e={}),t.call(this),this.stops=new Be(this._createStops(e.stops)),this.stops.addObserver(this),this._userSpace=e.userSpace,this.id=$()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={nodeType:{configurable:!0}};return i.nodeType.get=function(){return"Gradient"},e.prototype.userSpace=function(t){return B(t)?(this._userSpace=t,this.optionsChange(),this):this._userSpace},e.prototype._createStops=function(t){void 0===t&&(t=[]);for(var e=[],i=0;i<t.length;i++)e.push(Ie.create(t[i]));return e},e.prototype.addStop=function(t,e,i){this.stops.push(new Ie(t,e,i))},e.prototype.removeStop=function(t){var e=this.stops.indexOf(t);e>=0&&this.stops.splice(e,1)},e.prototype.optionsChange=function(t){this.trigger("optionsChange",{field:"gradient"+(t?"."+t.field:""),value:this})},e.prototype.geometryChange=function(){this.optionsChange()},Object.defineProperties(e.prototype,i),e}(R),ze=function(t){function e(e){void 0===e&&(e={}),t.call(this,e),this.start(e.start||new q),this.end(e.end||new q(1,0))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Lt(Le,["start","end"])),Ee=function(t){function e(e){void 0===e&&(e={}),t.call(this,e),this.center(e.center||new q),this._radius=B(e.radius)?e.radius:1,this._fallbackFill=e.fallbackFill}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.radius=function(t){return B(t)?(this._radius=t,this.geometryChange(),this):this._radius},e.prototype.fallbackFill=function(t){return B(t)?(this._fallbackFill=t,this.optionsChange(),this):this._fallbackFill},e}(Lt(Le,["center"]));function Ve(t){return.5-Math.cos(t*Math.PI)/2}function Fe(t){return t}function De(t,e,i,o){var r=1.70158,n=0,s=o;return 0===t?i:1===t?i+o:(n||(n=.5),s<Math.abs(o)?(s=o,r=n/4):r=n/(2*Math.PI)*Math.asin(o/s),s*Math.pow(2,-10*t)*Math.sin((Number(t)-r)*(1.1*Math.PI)/n)+o+i)}var Ue,He,Ge=Date.now||function(){return(new Date).getTime()},Ne=function(t){var e="undefined"!=typeof window?window:{},i=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t){setTimeout(t,1e3/60)};(Ne=function(t){return i.call(e,t)})(t)},We=Ne,qe=function(t){function e(){t.call(this),this._items=[]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={current:{configurable:!0}};return i.current.get=function(){return Ue||(Ue=new e),Ue},e.prototype.register=function(t,e){this._items.push({name:t,type:e})},e.prototype.create=function(t,e){var i,o=this._items;if(e&&e.type)for(var r=e.type.toLowerCase(),n=0;n<o.length;n++)if(o[n].name.toLowerCase()===r){i=o[n];break}if(i)return new i.type(t,e)},Object.defineProperties(e,i),e}(O),Xe=function(t){function e(e,i){t.call(this),this.options=Object.assign({},this.options,i),this.element=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={options:{configurable:!0}};return e.create=function(t,e,i){return qe.current.create(t,e,i)},i.options.get=function(){return this._options||{duration:500,easing:"swing"}},i.options.set=function(t){this._options=t},e.prototype.setup=function(){},e.prototype.step=function(){},e.prototype.play=function(){var t=this,e=this.options,i=e.duration,r=e.delay;void 0===r&&(r=0);var n=o[e.easing],s=Ge()+r,a=s+i;0===i?(this.step(1),this.abort()):setTimeout((function(){var e=function(){if(!t._stopped){var o=Ge(),r=Yt(o-s,0,i),p=n(r/i,r,0,1,i);t.step(p),o<a?We(e):t.abort()}};e()}),r)},e.prototype.abort=function(){this._stopped=!0},e.prototype.destroy=function(){this.abort()},Object.defineProperties(e.prototype,i),e}(O),Ye=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={current:{configurable:!0}};return i.current.get=function(){return He||(He=new e),He},e.prototype.parse=function(t,e){var i=new Kt(e);return Wt(i,t)},Object.defineProperties(e,i),e}(O),Ze=function(t){function e(e){t.call(this),this.childNodes=[],this.parent=null,e&&(this.srcElement=e,this.observe())}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){this.srcElement&&this.srcElement.removeObserver(this);for(var t=this.childNodes,e=0;e<t.length;e++)this.childNodes[e].destroy();this.parent=null},e.prototype.load=function(){},e.prototype.observe=function(){this.srcElement&&this.srcElement.addObserver(this)},e.prototype.append=function(t){this.childNodes.push(t),t.parent=this},e.prototype.insertAt=function(t,e){this.childNodes.splice(e,0,t),t.parent=this},e.prototype.remove=function(t,e){for(var i=t+e,o=t;o<i;o++)this.childNodes[o].removeSelf();this.childNodes.splice(t,e)},e.prototype.removeSelf=function(){this.clear(),this.destroy()},e.prototype.clear=function(){this.remove(0,this.childNodes.length)},e.prototype.invalidate=function(){this.parent&&this.parent.invalidate()},e.prototype.geometryChange=function(){this.invalidate()},e.prototype.optionsChange=function(){this.invalidate()},e.prototype.childrenChange=function(t){"add"===t.action?this.load(t.items,t.index):"remove"===t.action&&this.remove(t.index,t.items.length),this.invalidate()},e}(O),Ke=function(t){function e(){t.call(this),this._events={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bind=function(t,e,i){var o=arguments,r=this,n=$e(t),s=Je(e),a=n.length;if(void 0===e){for(var p in t)r.bind(p,t[p]);return this}for(var h=function(t){var a=n[t],p=s?e:e[a];if(p){if(i){var h=p;(p=function(){r.unbind(a,p),h.apply(r,o)}).original=h}(r._events[a]=r._events[a]||[]).push(p)}},c=0;c<a;c++)h(c);return this},e.prototype.one=function(t,e){return this.bind(t,e,!0)},e.prototype.first=function(t,e){for(var i=$e(t),o=Je(e),r=0,n=i.length;r<n;r++){var s=i[r],a=o?e:e[s];if(a)(this._events[s]=this._events[s]||[]).unshift(a)}return this},e.prototype.trigger=function(t,e){void 0===e&&(e={});var i=this._events[t];if(i){var o=i.length;e.sender=this,e._defaultPrevented=!1,e.preventDefault=Qe,e.isDefaultPrevented=ti,i=i.slice();for(var r=0;r<o;r++)i[r].call(this,e);return!0===e._defaultPrevented}return!1},e.prototype.unbind=function(t,e){var i=this._events[t];if(void 0===t)this._events={};else if(i)if(e)for(var o=i.length-1;o>=0;o--)i[o]!==e&&i[o].original!==e||i.splice(o,1);else this._events[t]=[];return this},e}(O);function Je(t){return"function"==typeof t}function $e(t){return"string"==typeof t?[t]:t}function Qe(){this._defaultPrevented=!0}function ti(){return!0===this._defaultPrevented}function ei(t,e){for(var i={},o=window.getComputedStyle(t)||{},r=Array.isArray(e)?e:[e],n=0;n<r.length;n++){var s=r[n];i[s]=o[s]}return i}function ii(t){return isNaN(t)?t:t+"px"}function oi(t,e){if(!e){var i=ei(t,["width","height"]);return{width:parseInt(i.width,10),height:parseInt(i.height,10)}}var o=e.width,r=e.height;B(o)&&(t.style.width=ii(o)),B(r)&&(t.style.height=ii(r))}function ri(t){return void 0===t&&(t={}),t.touch?t.touch.initialTouch:t.target}function ni(t){var e=ei(t,["paddingLeft","paddingTop"]),i=e.paddingLeft,o=e.paddingTop;return{top:parseFloat(o),left:parseFloat(i)}}function si(t){var e=t.getBoundingClientRect(),i=document.documentElement;return{top:e.top+(window.pageYOffset||i.scrollTop)-(i.clientTop||0),left:e.left+(window.pageXOffset||i.scrollLeft)-(i.clientLeft||0)}}function ai(t){return B((t.x||{}).location)?{x:t.x.location,y:t.y.location}:{x:t.pageX||t.clientX||0,y:t.pageY||t.clientY||0}}var pi=/matrix\((.*)\)/;function hi(t){var e=getComputedStyle(t).transform;return"none"===e?N.unit():function(t){var e=t.match(pi);if(null===e||2!==e.length)return N.unit();var i=e[1].split(",").map((function(t){return parseFloat(t)}));return new(Function.prototype.bind.apply(N,[null].concat(i)))}(e)}function ci(t){if(!t)return N.unit();for(var e=hi(t),i=t.parentElement;i;){var o=hi(i);e=e.multiplyCopy(o),i=i.parentElement}return e.b=e.c=e.e=e.f=0,e}var li=["click","mouseenter","mouseleave","mousemove","resize"],ui=function(t){function e(e,i){t.call(this),this.options=Object.assign({},i),this.element=e,this.element._kendoExportVisual=this.exportVisual.bind(this),this._click=this._handler("click"),this._mouseenter=this._handler("mouseenter"),this._mouseleave=this._handler("mouseleave"),this._mousemove=this._handler("mousemove"),this._visual=new ue,oi(e,this.options),this.bind(li,this.options),this._enableTracking()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.draw=function(t){this._visual.children.push(t)},e.prototype.clear=function(){this._visual.children=[]},e.prototype.destroy=function(){this._visual=null,this.element._kendoExportVisual=null,this.unbind()},e.prototype.eventTarget=function(t){for(var e,i=ri(t);!e&&i&&(e=i._kendoNode,i!==this.element);)i=i.parentElement;if(e)return e.srcElement},e.prototype.exportVisual=function(){return this._visual},e.prototype.getSize=function(){return oi(this.element)},e.prototype.currentSize=function(t){if(!t)return this._size;this._size=t},e.prototype.setSize=function(t){oi(this.element,t),this.currentSize(t),this._resize()},e.prototype.resize=function(t){var e=this.getSize(),i=this.currentSize();(t||(e.width>0||e.height>0)&&(!i||e.width!==i.width||e.height!==i.height))&&(this.currentSize(e),this._resize(e,t),this.trigger("resize",e))},e.prototype.size=function(t){if(!t)return this.getSize();this.setSize(t)},e.prototype.suspendTracking=function(){this._suspendedTracking=!0},e.prototype.resumeTracking=function(){this._suspendedTracking=!1},e.prototype._enableTracking=function(){},e.prototype._resize=function(){},e.prototype._handler=function(t){var e=this;return function(i){var o=e.eventTarget(i);o&&!e._suspendedTracking&&e.trigger(t,{element:o,originalEvent:i,type:t})}},e.prototype._elementOffset=function(){var t=this.element,e=ni(t),i=si(t),o=i.left,r=i.top;return{left:o+e.left,top:r+e.top}},e.prototype._surfacePoint=function(t){var e=this._elementOffset(),i=ai(t),o=i.x-e.left,r=i.y-e.top,n=ci(this.element).invert();return new q(o,r).transform(n)},e}(Ke);function fi(t){var e=window.console;void 0!==e&&e.log&&e.log(t)}function di(t,e){return B(e)&&null!==e?" "+t+'="'+e+'" ':""}function yi(t){for(var e="",i=0;i<t.length;i++)e+=di(t[i][0],t[i][1]);return e}function vi(t){for(var e="",i=0;i<t.length;i++){var o=t[i][1];B(o)&&(e+=t[i][0]+":"+o+";")}if(""!==e)return e}var gi={},mi="http://www.w3.org/2000/svg",xi=function(t,e){t.innerHTML=e};if("undefined"!=typeof document){var bi=document.createElement("div"),_i="undefined"!=typeof DOMParser;bi.innerHTML="<svg xmlns='http://www.w3.org/2000/svg'></svg>",_i&&bi.firstChild.namespaceURI!==mi&&(xi=function(t,e){var i=(new DOMParser).parseFromString(e,"text/xml"),o=document.adoptNode(i.documentElement);t.innerHTML="",t.appendChild(o)})}var wi=xi;var Ai={},Si={get browser(){return"undefined"==typeof window||Ai?Ai:Ai=function(t){var e,i={edge:/(edge)[ \/]([\w.]+)/i,webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+)|)/i};for(var o in i)if(i.hasOwnProperty(o)){var r=t.match(i[o]);if(r){(e={})[o]=!0,e[r[1].toLowerCase().split(" ")[0].split("/")[0]]=!0,e.version=parseInt(document.documentMode||r[2],10);break}}return e}(window.navigator.userAgent)}},ki={clip:"clip-path",fill:"fill"};function Ci(t,e){return"clip"===t||"fill"===t&&(!e||"Gradient"===e.nodeType)}var Pi=function(t){function e(e,i){t.call(this,e),this.definitions={},this.options=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){this.element&&(this.element._kendoNode=null,this.element=null),this.clearDefinitions(),t.prototype.destroy.call(this)},e.prototype.load=function(t,e){for(var i=0;i<t.length;i++){var o=t[i],r=o.children,n=new gi[o.nodeType](o,this.options);B(e)?this.insertAt(n,e):this.append(n),n.createDefinitions(),r&&r.length>0&&n.load(r);var s=this.element;s&&n.attachTo(s,e)}},e.prototype.root=function(){for(var t=this;t.parent;)t=t.parent;return t},e.prototype.attachTo=function(t,e){var i=document.createElement("div");wi(i,"<svg xmlns='"+mi+"' version='1.1'>"+this.render()+"</svg>");var o=i.firstChild.firstChild;o&&(B(e)?t.insertBefore(o,t.childNodes[e]||null):t.appendChild(o),this.setElement(o))},e.prototype.setElement=function(t){this.element&&(this.element._kendoNode=null),this.element=t,this.element._kendoNode=this;for(var e=this.childNodes,i=0;i<e.length;i++){var o=t.childNodes[i];e[i].setElement(o)}},e.prototype.clear=function(){this.clearDefinitions(),this.element&&(this.element.innerHTML="");for(var t=this.childNodes,e=0;e<t.length;e++)t[e].destroy();this.childNodes=[]},e.prototype.removeSelf=function(){if(this.element){var e=this.element.parentNode;e&&e.removeChild(this.element),this.element=null}t.prototype.removeSelf.call(this)},e.prototype.template=function(){return this.renderChildren()},e.prototype.render=function(){return this.template()},e.prototype.renderChildren=function(){for(var t=this.childNodes,e="",i=0;i<t.length;i++)e+=t[i].render();return e},e.prototype.optionsChange=function(e){var i=e.field,o=e.value;"visible"===i?this.css("display",o?"":"none"):ki[i]&&Ci(i,o)?this.updateDefinition(i,o):"opacity"===i?this.attr("opacity",o):"cursor"===i?this.css("cursor",o):"id"===i&&(o?this.attr("id",o):this.removeAttr("id")),t.prototype.optionsChange.call(this,e)},e.prototype.attr=function(t,e){this.element&&this.element.setAttribute(t,e)},e.prototype.allAttr=function(t){for(var e=0;e<t.length;e++)this.attr(t[e][0],t[e][1])},e.prototype.css=function(t,e){this.element&&(this.element.style[t]=e)},e.prototype.allCss=function(t){for(var e=0;e<t.length;e++)this.css(t[e][0],t[e][1])},e.prototype.removeAttr=function(t){this.element&&this.element.removeAttribute(t)},e.prototype.mapTransform=function(t){var e=[];return t&&e.push(["transform","matrix("+t.matrix().toString(6)+")"]),e},e.prototype.renderTransform=function(){return yi(this.mapTransform(this.srcElement.transform()))},e.prototype.transformChange=function(t){t?this.allAttr(this.mapTransform(t)):this.removeAttr("transform")},e.prototype.mapStyle=function(){var t=this.srcElement.options,e=[["cursor",t.cursor]];return!1===t.visible&&e.push(["display","none"]),e},e.prototype.renderStyle=function(){return di("style",vi(this.mapStyle(!0)))},e.prototype.renderOpacity=function(){return di("opacity",this.srcElement.options.opacity)},e.prototype.renderId=function(){return di("id",this.srcElement.options.id)},e.prototype.createDefinitions=function(){var t=this.srcElement,e=this.definitions;if(t){var i,o=t.options;for(var r in ki){var n=o.get(r);n&&Ci(r,n)&&(e[r]=n,i=!0)}i&&this.definitionChange({action:"add",definitions:e})}},e.prototype.definitionChange=function(t){this.parent&&this.parent.definitionChange(t)},e.prototype.updateDefinition=function(t,e){var i=this.definitions,o=i[t],r=ki[t],n={};o&&(n[t]=o,this.definitionChange({action:"remove",definitions:n}),delete i[t]),e?(n[t]=e,this.definitionChange({action:"add",definitions:n}),i[t]=e,this.attr(r,this.refUrl(e.id))):o&&this.removeAttr(r)},e.prototype.clearDefinitions=function(){var t=this.definitions;this.definitionChange({action:"remove",definitions:t}),this.definitions={}},e.prototype.renderDefinitions=function(){return yi(this.mapDefinitions())},e.prototype.mapDefinitions=function(){var t=this.definitions,e=[];for(var i in t)e.push([ki[i],this.refUrl(t[i].id)]);return e},e.prototype.refUrl=function(t){var e=(this.options||{}).skipBaseHref,i=this.baseUrl().replace(/'/g,"\\'");return"url("+(e?"":i)+"#"+t+")"},e.prototype.baseUrl=function(){return function(){var t=document.getElementsByTagName("base")[0],e=document.location.href,i="";if(t&&!(Si.browser||{}).msie){var o=e.indexOf("#");-1!==o&&(e=e.substring(0,o)),i=e}return i}()},e}(Ze),Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.template=function(){return"<stop "+this.renderOffset()+" "+this.renderStyle()+" />"},e.prototype.renderOffset=function(){return di("offset",this.srcElement.offset())},e.prototype.mapStyle=function(){var t=this.srcElement;return[["stop-color",t.color()],["stop-opacity",t.opacity()]]},e.prototype.optionsChange=function(t){"offset"===t.field?this.attr(t.field,t.value):"color"!==t.field&&"opacity"!==t.field||this.css("stop-"+t.field,t.value)},e}(Pi),Mi=function(t){function e(e){t.call(this,e),this.id=e.id,this.loadStops()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.loadStops=function(){for(var t=this.srcElement.stops,e=this.element,i=0;i<t.length;i++){var o=new Ti(t[i]);this.append(o),e&&o.attachTo(e)}},e.prototype.optionsChange=function(t){"gradient.stops"===t.field?(Ze.prototype.clear.call(this),this.loadStops()):"gradient"===t.field&&this.allAttr(this.mapCoordinates())},e.prototype.renderCoordinates=function(){return yi(this.mapCoordinates())},e.prototype.mapSpace=function(){return["gradientUnits",this.srcElement.userSpace()?"userSpaceOnUse":"objectBoundingBox"]},e}(Pi),Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.template=function(){return"<linearGradient id='"+this.id+"' "+this.renderCoordinates()+">"+this.renderChildren()+"</linearGradient>"},e.prototype.mapCoordinates=function(){var t=this.srcElement,e=t.start(),i=t.end();return[["x1",e.x],["y1",e.y],["x2",i.x],["y2",i.y],this.mapSpace()]},e}(Mi),Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.template=function(){return"<radialGradient id='"+this.id+"' "+this.renderCoordinates()+">"+this.renderChildren()+"</radialGradient>"},e.prototype.mapCoordinates=function(){var t=this.srcElement,e=t.center(),i=t.radius();return[["cx",e.x],["cy",e.y],["r",i],this.mapSpace()]},e}(Mi),Bi=function(t){function e(e){t.call(this),this.srcElement=e,this.id=e.id,this.load([e])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.template=function(){return"<clipPath id='"+this.id+"'>"+this.renderChildren()+"</clipPath>"},e}(Pi),ji=function(t){function e(){t.call(this),this.definitionMap={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.attachTo=function(t){this.element=t},e.prototype.template=function(){return"<defs>"+this.renderChildren()+"</defs>"},e.prototype.definitionChange=function(t){var e=t.definitions,i=t.action;"add"===i?this.addDefinitions(e):"remove"===i&&this.removeDefinitions(e)},e.prototype.createDefinition=function(t,e){var i;return"clip"===t?i=Bi:"fill"===t&&(e instanceof ze?i=Oi:e instanceof Ee&&(i=Ri)),new i(e)},e.prototype.addDefinitions=function(t){for(var e in t)this.addDefinition(e,t[e])},e.prototype.addDefinition=function(t,e){var i=this.element,o=this.definitionMap,r=e.id,n=o[r];if(n)n.count++;else{var s=this.createDefinition(t,e);o[r]={element:s,count:1},this.append(s),i&&s.attachTo(this.element)}},e.prototype.removeDefinitions=function(t){for(var e in t)this.removeDefinition(t[e])},e.prototype.removeDefinition=function(t){var e=this.definitionMap,i=t.id,o=e[i];o&&(o.count--,0===o.count&&(this.remove(this.childNodes.indexOf(o.element),1),delete e[i]))},e}(Pi),Ii=function(t){function e(e){t.call(this),this.options=e,this.defs=new ji}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.attachTo=function(t){this.element=t,this.defs.attachTo(t.firstElementChild)},e.prototype.clear=function(){Ze.prototype.clear.call(this)},e.prototype.template=function(){return this.defs.render()+this.renderChildren()},e.prototype.definitionChange=function(t){this.defs.definitionChange(t)},e}(Pi);function Li(t,e){for(var i in e)for(var o=i.trim().split(" "),r=0;r<o.length;r++)t.addEventListener(o[r],e[i],!1)}function zi(t,e){for(var i in void 0===e&&(e={}),e)for(var o=i.trim().split(" "),r=0;r<o.length;r++)t.removeEventListener(o[r],e[i],!1)}var Ei={dot:[1.5,3.5],dash:[4,3.5],longdash:[8,3.5],dashdot:[3.5,3.5,1.5,3.5],longdashdot:[8,3.5,1.5,3.5],longdashdotdot:[8,3.5,1.5,3.5,1.5,3.5]},Vi={"fill.opacity":"fill-opacity","stroke.color":"stroke","stroke.width":"stroke-width","stroke.opacity":"stroke-opacity"},Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.geometryChange=function(){this.attr("d",this.renderData()),this.invalidate()},e.prototype.optionsChange=function(e){switch(e.field){case"fill":e.value?this.allAttr(this.mapFill(e.value)):this.removeAttr("fill");break;case"fill.color":this.allAttr(this.mapFill({color:e.value}));break;case"stroke":e.value?this.allAttr(this.mapStroke(e.value)):this.removeAttr("stroke");break;case"transform":this.transformChange(e.value);break;default:var i=Vi[e.field];i&&this.attr(i,e.value)}t.prototype.optionsChange.call(this,e)},e.prototype.content=function(){this.element&&(this.element.textContent=this.srcElement.content())},e.prototype.renderData=function(){return this.printPath(this.srcElement)},e.prototype.printPath=function(t){var e=t.segments,i=e.length;if(i>0){for(var o,r,n=[],s=1;s<i;s++){var a=this.segmentType(e[s-1],e[s]);a!==r&&(r=a,n.push(a)),"L"===a?n.push(this.printPoints(e[s].anchor())):n.push(this.printPoints(e[s-1].controlOut(),e[s].controlIn(),e[s].anchor()))}return o="M"+this.printPoints(e[0].anchor())+" "+n.join(" "),t.options.closed&&(o+="Z"),o}},e.prototype.printPoints=function(){for(var t=arguments,e=t.length,i=[],o=0;o<e;o++)i.push(t[o].toString(3));return i.join(" ")},e.prototype.segmentType=function(t,e){return t.controlOut()&&e.controlIn()?"C":"L"},e.prototype.mapStroke=function(t){var e=[];return t&&!tt(t.color)?(e.push(["stroke",t.color]),e.push(["stroke-width",t.width]),e.push(["stroke-linecap",this.renderLinecap(t)]),e.push(["stroke-linejoin",t.lineJoin]),B(t.opacity)&&e.push(["stroke-opacity",t.opacity]),B(t.dashType)&&e.push(["stroke-dasharray",this.renderDashType(t)])):e.push(["stroke","none"]),e},e.prototype.renderStroke=function(){return yi(this.mapStroke(this.srcElement.options.stroke))},e.prototype.renderDashType=function(t){var e=t.dashType,i=t.width;if(void 0===i&&(i=1),e&&"solid"!==e){for(var o=Ei[e.toLowerCase()],r=[],n=0;n<o.length;n++)r.push(o[n]*i);return r.join(" ")}},e.prototype.renderLinecap=function(t){var e=t.dashType,i=t.lineCap;return e&&"solid"!==e?"butt":i},e.prototype.mapFill=function(t){var e=[];return t&&"Gradient"===t.nodeType||(t&&!tt(t.color)?(e.push(["fill",t.color]),B(t.opacity)&&e.push(["fill-opacity",t.opacity])):e.push(["fill","none"])),e},e.prototype.renderFill=function(){return yi(this.mapFill(this.srcElement.options.fill))},e.prototype.template=function(){return"<path "+this.renderId()+" "+this.renderStyle()+" "+this.renderOpacity()+" "+di("d",this.renderData())+this.renderStroke()+this.renderFill()+this.renderDefinitions()+this.renderTransform()+"></path>"},e}(Pi),Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderData=function(){return this.printPath(this.srcElement.toPath())},e}(Fi),Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.geometryChange=function(){var t=this.center();this.attr("cx",t.x),this.attr("cy",t.y),this.attr("r",this.radius()),this.invalidate()},e.prototype.center=function(){return this.srcElement.geometry().center},e.prototype.radius=function(){return this.srcElement.geometry().radius},e.prototype.template=function(){return"<circle "+this.renderId()+" "+this.renderStyle()+" "+this.renderOpacity()+"cx='"+this.center().x+"' cy='"+this.center().y+"' r='"+this.radius()+"'"+this.renderStroke()+" "+this.renderFill()+" "+this.renderDefinitions()+this.renderTransform()+" ></circle>"},e}(Fi),Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.template=function(){return"<g"+(this.renderId()+this.renderTransform()+this.renderStyle()+this.renderOpacity()+this.renderDefinitions())+">"+this.renderChildren()+"</g>"},e.prototype.optionsChange=function(e){"transform"===e.field&&this.transformChange(e.value),t.prototype.optionsChange.call(this,e)},e}(Pi),Gi=/&/g,Ni=/</g,Wi=/"/g,qi=/'/g,Xi=/>/g;function Yi(t){return String(t).replace(Gi,"&").replace(Ni,"<").replace(Xi,">").replace(Wi,""").replace(qi,"'")}var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.geometryChange=function(){this.allAttr(this.mapPosition()),this.invalidate()},e.prototype.optionsChange=function(e){"src"===e.field&&this.allAttr(this.mapSource()),t.prototype.optionsChange.call(this,e)},e.prototype.mapPosition=function(){var t=this.srcElement.rect(),e=t.topLeft();return[["x",e.x],["y",e.y],["width",t.width()+"px"],["height",t.height()+"px"]]},e.prototype.renderPosition=function(){return yi(this.mapPosition())},e.prototype.mapSource=function(t){var e=this.srcElement.src();return t&&(e=Yi(e)),[["xlink:href",e]]},e.prototype.renderSource=function(){return yi(this.mapSource(!0))},e.prototype.template=function(){return"<image preserveAspectRatio='none' "+this.renderId()+" "+this.renderStyle()+" "+this.renderTransform()+" "+this.renderOpacity()+this.renderPosition()+" "+this.renderSource()+" "+this.renderDefinitions()+"></image>"},e}(Fi),Ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderData=function(){var t=this.srcElement.paths;if(t.length>0){for(var e=[],i=0;i<t.length;i++)e.push(this.printPath(t[i]));return e.join(" ")}},e}(Fi),Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.geometryChange=function(){var t=this.srcElement.geometry();this.attr("x",t.origin.x),this.attr("y",t.origin.y),this.attr("width",t.size.width),this.attr("height",t.size.height),this.attr("rx",t.cornerRadius[0]),this.attr("ry",t.cornerRadius[1]),this.invalidate()},e.prototype.size=function(){return this.srcElement.geometry().size},e.prototype.origin=function(){return this.srcElement.geometry().origin},e.prototype.rx=function(){return this.srcElement.geometry().cornerRadius[0]},e.prototype.ry=function(){return this.srcElement.geometry().cornerRadius[1]},e.prototype.template=function(){return"<rect "+this.renderId()+" "+this.renderStyle()+" "+this.renderOpacity()+" x='"+this.origin().x+"' y='"+this.origin().y+"' rx='"+this.rx()+"' ry='"+this.ry()+"' width='"+this.size().width+"' height='"+this.size().height+"' "+this.renderStroke()+" "+this.renderFill()+" "+this.renderDefinitions()+" "+this.renderTransform()+" />"},e}(Fi),$i=/&(?:[a-zA-Z]+|#\d+);/g;function Qi(t){if(!t||"string"!=typeof t||!$i.test(t))return t;var e=Qi._element;return $i.lastIndex=0,t.replace($i,(function(t){return e.innerHTML=t,e.textContent||e.innerText}))}"undefined"!=typeof document&&(Qi._element=document.createElement("span"));var to=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.geometryChange=function(){var t=this.pos();this.attr("x",t.x),this.attr("y",t.y),this.invalidate()},e.prototype.optionsChange=function(e){"font"===e.field?(this.attr("style",vi(this.mapStyle())),this.geometryChange()):"content"===e.field&&t.prototype.content.call(this,this.srcElement.content()),t.prototype.optionsChange.call(this,e)},e.prototype.mapStyle=function(e){var i=t.prototype.mapStyle.call(this,e),o=this.srcElement.options.font;return e&&(o=Yi(o)),i.push(["font",o],["white-space","pre"]),i},e.prototype.pos=function(){var t=this.srcElement.position(),e=this.srcElement.measure();return t.clone().setY(t.y+e.baseline)},e.prototype.renderContent=function(){var t=this.srcElement.content();return te(t=Yi(t=Qi(t)))},e.prototype.renderTextAnchor=function(){var t;return!(this.options||{}).rtl||Si.browser.msie||Si.browser.edge||(t="end"),di("text-anchor",t)},e.prototype.template=function(){return"<text "+this.renderId()+" "+this.renderTextAnchor()+" "+this.renderStyle()+" "+this.renderOpacity()+"x='"+this.pos().x+"' y='"+this.pos().y+"' "+this.renderStroke()+" "+this.renderTransform()+" "+this.renderDefinitions()+this.renderFill()+">"+this.renderContent()+"</text>"},e}(Fi);gi.Arc=Di,gi.Circle=Ui,gi.Group=Hi,gi.Image=Zi,gi.MultiPath=Ki,gi.Path=Fi,gi.Rect=Ji,gi.Text=to;var eo=function(t){function e(e,i){t.call(this,e,i),this._root=new Ii(Object.assign({rtl:"rtl"===ei(e,"direction").direction},this.options)),wi(this.element,this._template()),this._rootElement=this.element.firstElementChild,function(t){var e;try{e=t.getScreenCTM?t.getScreenCTM():null}catch(t){}if(e){var i=-e.e%1,o=-e.f%1,r=t.style;0===i&&0===o||(r.left=i+"px",r.top=o+"px")}}(this._rootElement),this._root.attachTo(this._rootElement),Li(this.element,{click:this._click,mouseover:this._mouseenter,mouseout:this._mouseleave,mousemove:this._mousemove}),this.resize()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{configurable:!0}};return i.type.get=function(){return"svg"},e.prototype.destroy=function(){this._root&&(this._root.destroy(),this._root=null,this._rootElement=null,zi(this.element,{click:this._click,mouseover:this._mouseenter,mouseout:this._mouseleave,mousemove:this._mousemove})),t.prototype.destroy.call(this)},e.prototype.translate=function(t){var e=Math.round(t.x)+" "+Math.round(t.y)+" "+this._size.width+" "+this._size.height;this._offset=t,this._rootElement.setAttribute("viewBox",e)},e.prototype.draw=function(e){t.prototype.draw.call(this,e),this._root.load([e])},e.prototype.clear=function(){t.prototype.clear.call(this),this._root.clear()},e.prototype.svg=function(){return"<?xml version='1.0' ?>"+this._template()},e.prototype.exportVisual=function(){var t=this._visual,e=this._offset;if(e){var i=new ue;i.children.push(t),i.transform(K().translate(-e.x,-e.y)),t=i}return t},e.prototype._resize=function(){this._offset&&this.translate(this._offset)},e.prototype._template=function(){return"<svg style='width: 100%; height: 100%; overflow: hidden;' xmlns='"+mi+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>"+this._root.render()+"</svg>"},Object.defineProperties(e.prototype,i),e}(ui);function io(){var t,e,i=new Promise((function(o,r){t=function(t){return i._state="resolved",o(t),i},e=function(t){return i._state="rejected",r(t),i}}));return i._state="pending",i.resolve=t,i.reject=e,i.state=function(){return i._state},i}function oo(t){return Promise.all(t)}var ro={};function no(t,e){var i=e.segments;if(0!==i.length){var o=i[0],r=o.anchor();t.moveTo(r.x,r.y);for(var n=1;n<i.length;n++){r=(o=i[n]).anchor();var s=i[n-1].controlOut(),a=o.controlIn();s&&a?t.bezierCurveTo(s.x,s.y,a.x,a.y,r.x,r.y):t.lineTo(r.x,r.y)}e.options.closed&&t.closePath()}}var so=function(t){function e(e){t.call(this,e),e&&this.initClip()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initClip=function(){var t=this.srcElement.clip();t&&(this.clip=t,t.addObserver(this))},e.prototype.clear=function(){this.srcElement&&this.srcElement.removeObserver(this),this.clearClip(),t.prototype.clear.call(this)},e.prototype.clearClip=function(){this.clip&&(this.clip.removeObserver(this),delete this.clip)},e.prototype.setClip=function(t){this.clip&&(t.beginPath(),no(t,this.clip),t.clip())},e.prototype.optionsChange=function(e){"clip"===e.field&&(this.clearClip(),this.initClip()),t.prototype.optionsChange.call(this,e)},e.prototype.setTransform=function(t){if(this.srcElement){var e=this.srcElement.transform();e&&t.transform.apply(t,e.matrix().toArray(6))}},e.prototype.loadElements=function(t,e,i){for(var o=0;o<t.length;o++){var r=t[o],n=r.children,s=new ro[r.nodeType](r,i);n&&n.length>0&&s.load(n,e,i),B(e)?this.insertAt(s,e):this.append(s)}},e.prototype.load=function(t,e,i){this.loadElements(t,e,i),this.invalidate()},e.prototype.setOpacity=function(t){if(this.srcElement){var e=this.srcElement.opacity();B(e)&&this.globalAlpha(t,e)}},e.prototype.globalAlpha=function(t,e){var i=e;i&&t.globalAlpha&&(i*=t.globalAlpha),t.globalAlpha=i},e.prototype.visible=function(){var t=this.srcElement;return!t||t&&!1!==t.options.visible},e}(Ze),ao=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderTo=function(t){if(this.visible()){t.save(),this.setTransform(t),this.setClip(t),this.setOpacity(t);for(var e=this.childNodes,i=0;i<e.length;i++){var o=e[i];o.visible()&&o.renderTo(t)}t.restore()}},e}(ce(so,"childNodes"));function po(t,e){var i,o=0;if(!e||e<=0)return t;var r=function(){var r=Ge()-o,n=arguments,s=function(){t.apply(null,n),o=Ge()};if(!o)return s();i&&clearTimeout(i),r>e?s():i=setTimeout(s,e-r)};return r.cancel=function(){clearTimeout(i)},r}var ho=function(t){function e(e,i){t.call(this),this.canvas=e,this.size=i,this.ctx=e.getContext("2d");var o=this._invalidate.bind(this);this.invalidate=po((function(){We(o)}),1e3/60)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.canvas=null,this.ctx=null},e.prototype.load=function(t,e,i){this.loadElements(t,e,i),this._invalidate()},e.prototype._rescale=function(t){var e=this.canvas,i=this.size;e.width=i.width*t,e.height=i.height*t,this.ctx.scale(t,t)},e.prototype._devicePixelRatio=function(){return"number"==typeof window.devicePixelRatio?window.devicePixelRatio:1},e.prototype._invalidate=function(t){if(this.ctx){var e=t&&t.fixedScale?1:this._devicePixelRatio();this._rescale(e),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderTo(this.ctx)}},e}(ce(ao,"childNodes")),co=function(t){function e(){t.call(this),this.shapes=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._add=function(t,e){this.shapes.push({bbox:e,shape:t}),t._quadNode=this},e.prototype.pointShapes=function(t){for(var e=this.shapes,i=e.length,o=[],r=0;r<i;r++)e[r].bbox.containsPoint(t)&&o.push(e[r].shape);return o},e.prototype.insert=function(t,e){this._add(t,e)},e.prototype.remove=function(t){for(var e=this.shapes,i=e.length,o=0;o<i;o++)if(e[o].shape===t){e.splice(o,1);break}},e}(O),lo=function(t){function e(e){t.call(this),this.children=[],this.rect=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.inBounds=function(t){var e=this.rect,i=e.bottomRight(),o=t.bottomRight(),r=e.origin.x<=t.origin.x&&e.origin.y<=t.origin.y&&o.x<=i.x&&o.y<=i.y;return r},e.prototype.pointShapes=function(e){for(var i=this.children,o=i.length,r=t.prototype.pointShapes.call(this,e),n=0;n<o;n++)le(r,i[n].pointShapes(e));return r},e.prototype.insert=function(t,e){var i=this.children,o=!1;if(this.inBounds(e)){if(this.shapes.length<4)this._add(t,e);else{i.length||this._initChildren();for(var r=0;r<i.length;r++)if(i[r].insert(t,e)){o=!0;break}o||this._add(t,e)}o=!0}return o},e.prototype._initChildren=function(){var t=this.rect,i=this.children,o=t.center(),r=t.width()/2,n=t.height()/2;i.push(new e(new Y([t.origin.x,t.origin.y],[r,n])),new e(new Y([o.x,t.origin.y],[r,n])),new e(new Y([t.origin.x,o.y],[r,n])),new e(new Y([o.x,o.y],[r,n])))},e}(co);function uo(t,e){return t._zIndex<e._zIndex?1:t._zIndex>e._zIndex?-1:0}var fo=function(t){function e(){t.call(this),this.initRoots()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initRoots=function(){this.rootMap={},this.root=new co,this.rootElements=[]},e.prototype.clear=function(){for(var t=this.rootElements,e=0;e<t.length;e++)this.remove(t[e]);this.initRoots()},e.prototype.pointShape=function(t){var e=(this.rootMap[Math.floor(t.x/3e3)]||{})[Math.floor(t.y/3e3)],i=this.root.pointShapes(t);e&&(i=i.concat(e.pointShapes(t))),this.assignZindex(i),i.sort(uo);for(var o=0;o<i.length;o++)if(i[o].containsPoint(t))return i[o]},e.prototype.assignZindex=function(t){for(var e=0;e<t.length;e++){for(var i=t[e],o=0,r=Math.pow(1e4,75),n=[];i;)n.push(i),i=i.parent;for(;n.length;)o+=(((i=n.pop()).parent?i.parent.children:this.rootElements).indexOf(i)+1)*r,r/=1e4;t[e]._zIndex=o}},e.prototype.optionsChange=function(t){"transform"!==t.field&&"stroke.width"!==t.field||this.bboxChange(t.element)},e.prototype.geometryChange=function(t){this.bboxChange(t.element)},e.prototype.bboxChange=function(t){if("Group"===t.nodeType)for(var e=0;e<t.children.length;e++)this.bboxChange(t.children[e]);else t._quadNode&&t._quadNode.remove(t),this._insertShape(t)},e.prototype.add=function(t){var e=Array.isArray(t)?t.slice(0):[t];le(this.rootElements,e),this._insert(e)},e.prototype.childrenChange=function(t){if("remove"===t.action)for(var e=0;e<t.items.length;e++)this.remove(t.items[e]);else this._insert(Array.prototype.slice.call(t.items,0))},e.prototype._insert=function(t){for(var e;t.length>0;)(e=t.pop()).addObserver(this),"Group"===e.nodeType?le(t,e.children):this._insertShape(e)},e.prototype._insertShape=function(t){var e=t.bbox();if(e){var i=this.getSectors(e),o=i[0][0],r=i[1][0];if(this.inRoot(i))this.root.insert(t,e);else{var n=this.rootMap;n[o]||(n[o]={}),n[o][r]||(n[o][r]=new lo(new Y([3e3*o,3e3*r],[3e3,3e3]))),n[o][r].insert(t,e)}}},e.prototype.remove=function(t){if(t.removeObserver(this),"Group"===t.nodeType)for(var e=t.children,i=0;i<e.length;i++)this.remove(e[i]);else t._quadNode&&(t._quadNode.remove(t),delete t._quadNode)},e.prototype.inRoot=function(t){return t[0].length>1||t[1].length>1},e.prototype.getSectors=function(t){for(var e=t.bottomRight(),i=Math.floor(e.x/3e3),o=Math.floor(e.y/3e3),r=[[],[]],n=Math.floor(t.origin.x/3e3);n<=i;n++)r[0].push(n);for(var s=Math.floor(t.origin.y/3e3);s<=o;s++)r[1].push(s);return r},e}(O),yo=function(t){t.bind("mouseenter",this._mouseenter.bind(this)),t.bind("mouseleave",this._mouseleave.bind(this)),this.element=t.element};yo.prototype.clear=function(){this._resetCursor()},yo.prototype.destroy=function(){this._resetCursor(),delete this.element},yo.prototype._mouseenter=function(t){var e=this._shapeCursor(t);e?(this._current||(this._defaultCursor=this._getCursor()),this._setCursor(e)):this._resetCursor()},yo.prototype._mouseleave=function(){this._resetCursor()},yo.prototype._shapeCursor=function(t){for(var e=t.element;e&&!B(e.options.cursor);)e=e.parent;if(e)return e.options.cursor},yo.prototype._getCursor=function(){if(this.element)return this.element.style.cursor},yo.prototype._setCursor=function(t){this.element&&(this.element.style.cursor=t,this._current=t)},yo.prototype._resetCursor=function(){this._current&&(this._setCursor(this._defaultCursor||""),delete this._current)};var vo=yo,go={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},mo=Si.browser,xo=function(t){var e=Object.keys(go);e.push("transparent");var i=new RegExp("^("+e.join("|")+")(\\W|$)","i");return xo=function(t){return i.exec(t)},i.exec(t)},bo=function(t){function e(){t.call(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toHSV=function(){return this},e.prototype.toRGB=function(){return this},e.prototype.toHex=function(){return this.toBytes().toHex()},e.prototype.toBytes=function(){return this},e.prototype.toCss=function(){return"#"+this.toHex()},e.prototype.toCssRgba=function(){var t=this.toBytes();return"rgba("+t.r+", "+t.g+", "+t.b+", "+parseFloat(Number(this.a).toFixed(3))+")"},e.prototype.toDisplay=function(){return mo.msie&&mo.version<9?this.toCss():this.toCssRgba()},e.prototype.equals=function(t){return t===this||null!==t&&this.toCssRgba()===Po(t).toCssRgba()},e.prototype.diff=function(t){if(null===t)return NaN;var e=this.toBytes(),i=t.toBytes();return Math.sqrt(Math.pow(.3*(e.r-i.r),2)+Math.pow(.59*(e.g-i.g),2)+Math.pow(.11*(e.b-i.b),2))},e.prototype.clone=function(){var t=this.toBytes();return t===this&&(t=new wo(t.r,t.g,t.b,t.a)),t},e}(O),_o=function(t){function e(e,i,o,r){t.call(this),this.r=e,this.g=i,this.b=o,this.a=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toHSV=function(){var t,e,i=this.r,o=this.g,r=this.b,n=Math.min(i,o,r),s=Math.max(i,o,r),a=s-n,p=s;return 0===a?new So(0,0,p,this.a):(0!==s?(e=a/s,t=i===s?(o-r)/a:o===s?2+(r-i)/a:4+(i-o)/a,(t*=60)<0&&(t+=360)):(e=0,t=-1),new So(t,e,p,this.a))},e.prototype.toHSL=function(){var t,e,i=this.r,o=this.g,r=this.b,n=Math.max(i,o,r),s=Math.min(i,o,r),a=(n+s)/2;if(n===s)t=e=0;else{var p=n-s;switch(e=a>.5?p/(2-n-s):p/(n+s),n){case i:t=(o-r)/p+(o<r?6:0);break;case o:t=(r-i)/p+2;break;case r:t=(i-o)/p+4}}return new ko(60*t,100*e,100*a,this.a)},e.prototype.toBytes=function(){return new wo(255*this.r,255*this.g,255*this.b,this.a)},e}(bo),wo=function(t){function e(e,i,o,r){t.call(this,Math.round(e),Math.round(i),Math.round(o),r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toRGB=function(){return new t(this.r/255,this.g/255,this.b/255,this.a)},e.prototype.toHSV=function(){return this.toRGB().toHSV()},e.prototype.toHSL=function(){return this.toRGB().toHSL()},e.prototype.toHex=function(){return Ao(this.r,2)+Ao(this.g,2)+Ao(this.b,2)},e.prototype.toBytes=function(){return this},e}(_o);function Ao(t,e,i){void 0===i&&(i="0");for(var o=t.toString(16);e>o.length;)o=i+o;return o}var So=function(t){function e(e,i,o,r){t.call(this),this.h=e,this.s=i,this.v=o,this.a=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toRGB=function(){var t,e,i,o=this.h,r=this.s,n=this.v;if(0===r)t=e=i=n;else{o/=60;var s=Math.floor(o),a=o-s,p=n*(1-r),h=n*(1-r*a),c=n*(1-r*(1-a));switch(s){case 0:t=n,e=c,i=p;break;case 1:t=h,e=n,i=p;break;case 2:t=p,e=n,i=c;break;case 3:t=p,e=h,i=n;break;case 4:t=c,e=p,i=n;break;default:t=n,e=p,i=h}}return new _o(t,e,i,this.a)},e.prototype.toHSL=function(){return this.toRGB().toHSL()},e.prototype.toBytes=function(){return this.toRGB().toBytes()},e}(bo),ko=function(t){function e(e,i,o,r){t.call(this),this.h=e,this.s=i,this.l=o,this.a=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toRGB=function(){var t,e,i,o=this.h/360,r=this.s/100,n=this.l/100;if(0===r)t=e=i=n;else{var s=n<.5?n*(1+r):n+r-n*r,a=2*n-s;t=Co(a,s,o+1/3),e=Co(a,s,o),i=Co(a,s,o-1/3)}return new _o(t,e,i,this.a)},e.prototype.toHSV=function(){return this.toRGB().toHSV()},e.prototype.toBytes=function(){return this.toRGB().toBytes()},e}(bo);function Co(t,e,i){var o=i;return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+6*(e-t)*o:o<.5?e:o<2/3?t+(e-t)*(2/3-o)*6:t}function Po(t,e){var i,o;if(null==t||"none"===t)return null;if(t instanceof bo)return t;var r=t.toLowerCase();if(i=xo(r))return(r="transparent"===i[1]?new _o(1,1,1,0):Po(go[i[1]],e)).match=[i[1]],r;if((i=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/i.exec(r))?o=new wo(parseInt(i[1],16),parseInt(i[2],16),parseInt(i[3],16),1):(i=/^#?([0-9a-f])([0-9a-f])([0-9a-f])\b/i.exec(r))?o=new wo(parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16),parseInt(i[3]+i[3],16),1):(i=/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(r))?o=new wo(parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10),1):(i=/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(r))?o=new wo(parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10),parseFloat(i[4])):(i=/^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(r))?o=new _o(parseFloat(i[1])/100,parseFloat(i[2])/100,parseFloat(i[3])/100,1):(i=/^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(r))&&(o=new _o(parseFloat(i[1])/100,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(i[4]))),o)o.match=i;else if(!e)throw new Error("Cannot parse color: "+r);return o}var To=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderTo=function(t){t.save(),this.setTransform(t),this.setClip(t),this.setOpacity(t),t.beginPath(),this.renderPoints(t,this.srcElement),this.setLineDash(t),this.setLineCap(t),this.setLineJoin(t),this.setFill(t),this.setStroke(t),t.restore()},e.prototype.setFill=function(t){var e=this.srcElement.options.fill,i=!1;return e&&("Gradient"===e.nodeType?(this.setGradientFill(t,e),i=!0):tt(e.color)||(t.fillStyle=e.color,t.save(),this.globalAlpha(t,e.opacity),t.fill(),t.restore(),i=!0)),i},e.prototype.setGradientFill=function(t,e){var i,o=this.srcElement.rawBBox();if(e instanceof ze){var r=e.start(),n=e.end();i=t.createLinearGradient(r.x,r.y,n.x,n.y)}else if(e instanceof Ee){var s=e.center();i=t.createRadialGradient(s.x,s.y,0,s.x,s.y,e.radius())}!function(t,e){for(var i=0;i<e.length;i++){var o=e[i],r=Po(o.color());r.a*=o.opacity(),t.addColorStop(o.offset(),r.toCssRgba())}}(i,e.stops),t.save(),e.userSpace()||t.transform(o.width(),0,0,o.height(),o.origin.x,o.origin.y),t.fillStyle=i,t.fill(),t.restore()},e.prototype.setStroke=function(t){var e=this.srcElement.options.stroke;if(e&&!tt(e.color)&&e.width>0)return t.strokeStyle=e.color,t.lineWidth=Q(e.width,1),t.save(),this.globalAlpha(t,e.opacity),t.stroke(),t.restore(),!0},e.prototype.dashType=function(){var t=this.srcElement.options.stroke;if(t&&t.dashType)return t.dashType.toLowerCase()},e.prototype.setLineDash=function(t){var e=this.dashType();if(e&&"solid"!==e){var i=Ei[e];t.setLineDash?t.setLineDash(i):(t.mozDash=i,t.webkitLineDash=i)}},e.prototype.setLineCap=function(t){var e=this.dashType(),i=this.srcElement.options.stroke;e&&"solid"!==e?t.lineCap="butt":i&&i.lineCap&&(t.lineCap=i.lineCap)},e.prototype.setLineJoin=function(t){var e=this.srcElement.options.stroke;e&&e.lineJoin&&(t.lineJoin=e.lineJoin)},e.prototype.renderPoints=function(t,e){no(t,e)},e}(so),Mo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderPoints=function(t){no(t,this.srcElement.toPath())},e}(To),Oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderPoints=function(t){var e=this.srcElement.geometry(),i=e.center,o=e.radius;t.arc(i.x,i.y,o,0,2*Math.PI)},e}(To),Ro=function(t){function e(e,i){t.call(this,e),this.onLoad=this.onLoad.bind(this),this.onError=this.onError.bind(this),this.loading=io();var o=this.img=new Image;i&&!/^data:/i.test(e.src())&&(o.crossOrigin=i),o.src=e.src(),o.complete?this.onLoad():(o.onload=this.onLoad,o.onerror=this.onError)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderTo=function(t){"resolved"===this.loading.state()&&(t.save(),this.setTransform(t),this.setClip(t),this.drawImage(t),t.restore())},e.prototype.optionsChange=function(e){"src"===e.field?(this.loading=io(),this.img.src=this.srcElement.src()):t.prototype.optionsChange.call(this,e)},e.prototype.onLoad=function(){this.loading.resolve(),this.invalidate()},e.prototype.onError=function(){this.loading.reject(new Error("Unable to load image '"+this.img.src+"'. Check for connectivity and verify CORS headers."))},e.prototype.drawImage=function(t){var e=this.srcElement.rect(),i=e.topLeft();t.drawImage(this.img,i.x,i.y,e.width(),e.height())},e}(To),Bo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderPoints=function(t){for(var e=this.srcElement.paths,i=0;i<e.length;i++)no(t,e[i])},e}(To),jo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderPoints=function(e){var i=this.srcElement.geometry(),o=i.cornerRadius,r=o[0],n=o[1];if(0===r&&0===n){var s=i.origin,a=i.size;e.rect(s.x,s.y,a.width,a.height)}else t.prototype.renderPoints.call(this,e,Zt.fromRect(i))},e}(To),Io=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.renderTo=function(t){var e=this.srcElement,i=e.position(),o=e.measure();t.save(),this.setTransform(t),this.setClip(t),this.setOpacity(t),t.beginPath(),t.font=e.options.font,t.textAlign="left",this.setFill(t)&&t.fillText(e.content(),i.x,i.y+o.baseline),this.setStroke(t)&&(this.setLineDash(t),t.strokeText(e.content(),i.x,i.y+o.baseline)),t.restore()},e}(To);ro.Arc=Mo,ro.Circle=Oo,ro.Group=ao,ro.Image=Ro,ro.MultiPath=Bo,ro.Path=To,ro.Rect=jo,ro.Text=Io;var Lo,zo,Eo=function(t){function e(e,i){t.call(this,e,i),this.element.innerHTML=this._template(this);var o=this.element.firstElementChild,r=oi(e);o.width=r.width,o.height=r.height,this._rootElement=o,this._root=new ho(o,r),this._mouseTrackHandler=this._trackMouse.bind(this),Li(this.element,{click:this._mouseTrackHandler,mousemove:this._mouseTrackHandler})}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{configurable:!0}};return i.type.get=function(){return"canvas"},e.prototype.destroy=function(){t.prototype.destroy.call(this),this._root&&(this._root.destroy(),this._root=null),this._searchTree&&(this._searchTree.clear(),delete this._searchTree),this._cursor&&(this._cursor.destroy(),delete this._cursor),zi(this.element,{click:this._mouseTrackHandler,mousemove:this._mouseTrackHandler})},e.prototype.draw=function(e){t.prototype.draw.call(this,e),this._root.load([e],void 0,this.options.cors),this._searchTree&&this._searchTree.add([e])},e.prototype.clear=function(){t.prototype.clear.call(this),this._root.clear(),this._searchTree&&this._searchTree.clear(),this._cursor&&this._cursor.clear()},e.prototype.eventTarget=function(t){if(this._searchTree){var e=this._surfacePoint(t);return this._searchTree.pointShape(e)}},e.prototype.image=function(){var t=this._root,e=this._rootElement,i=[];t.traverse((function(t){t.loading&&i.push(t.loading)}));var o=io(),r=function(){t._invalidate({fixedScale:!0});try{var i=e.toDataURL();o.resolve(i)}catch(t){o.reject(t)}};return oo(i).then(r,r),o},e.prototype.suspendTracking=function(){t.prototype.suspendTracking.call(this),this._searchTree&&(this._searchTree.clear(),delete this._searchTree)},e.prototype.resumeTracking=function(){if(t.prototype.resumeTracking.call(this),!this._searchTree){this._searchTree=new fo;for(var e=this._root.childNodes,i=[],o=0;o<e.length;o++)i.push(e[o].srcElement);this._searchTree.add(i)}},e.prototype._resize=function(){this._rootElement.width=this._size.width,this._rootElement.height=this._size.height,this._root.size=this._size,this._root.invalidate()},e.prototype._template=function(){return"<canvas style='width: 100%; height: 100%;'></canvas>"},e.prototype._enableTracking=function(){this._searchTree=new fo,this._cursor=new vo(this),t.prototype._enableTracking.call(this)},e.prototype._trackMouse=function(t){if(!this._suspendedTracking){var e=this.eventTarget(t);if("click"!==t.type){var i=this._currentShape;i&&i!==e&&this.trigger("mouseleave",{element:i,originalEvent:t,type:"mouseleave"}),e&&i!==e&&this.trigger("mouseenter",{element:e,originalEvent:t,type:"mouseenter"}),this.trigger("mousemove",{element:e,originalEvent:t,type:"mousemove"}),this._currentShape=e}else e&&this.trigger("click",{element:e,originalEvent:t,type:"click"})}},Object.defineProperties(e.prototype,i),e}(ui),Vo=function(){return"undefined"!=typeof document},Fo=function(t){function e(){t.call(this),this._items=[{name:"svg",type:eo},{name:"canvas",type:Eo}]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={support:{configurable:!0},current:{configurable:!0}};return i.support.get=function(){return zo||(zo={canvas:Vo()&&document.createElement("canvas").getContext,svg:Vo()&&document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}),zo},i.current.get=function(){return Lo||(Lo=new e),Lo},e.prototype.create=function(t,e){var i=this._items,o=i[0];if(e&&e.type)for(var r=e.type.toLowerCase(),n=0;n<i.length;n++)if(i[n].name===r){o=i[n];break}if(o)return new o.type(t,e);fi("Warning: Unable to create Kendo UI Drawing Surface. Possible causes:\n- The browser does not support SVG and Canvas. User agent: "+navigator.userAgent)},Object.defineProperties(e,i),e}(O),Do=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={support:{configurable:!0}};return i.support.get=function(){return Fo.support},e.create=function(t,e){return Fo.current.create(t,e)},Object.defineProperties(e,i),e}(ui);function Uo(t){var e=new Ii({skipBaseHref:!0}),i=t.clippedBBox(),o=t;if(i){var r=i.getOrigin(),n=new ue;n.transform(K().translate(-r.x,-r.y)),n.children.push(t),o=n}e.load([o]);var s="<?xml version='1.0' ?><svg xmlns='"+mi+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>"+e.render()+"</svg>";return e.destroy(),s}var Ho={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"};function Go(t){for(var e=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],i="";t>0;)t<e[0]?e.shift():(i+=Ho[e[0]],t-=e[0]);return i}var No=String.fromCharCode;var Wo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function qo(t){for(var e="",i=0,o=function(t){for(var e="",i=0;i<t.length;i++){var o=t.charCodeAt(i);if(55296<=o&&o<=56319){var r=o,n=t.charCodeAt(++i);isNaN(n)||(o=1024*(r-55296)+(n-56320)+65536)}o<128?e+=No(o):o<2048?(e+=No(192|o>>>6),e+=No(128|63&o)):o<65536?(e+=No(224|o>>>12),e+=No(128|o>>>6&63),e+=No(128|63&o)):o<1114111&&(e+=No(240|o>>>18),e+=No(128|o>>>12&63),e+=No(128|o>>>6&63),e+=No(128|63&o))}return e}(t);i<o.length;){var r=o.charCodeAt(i++),n=o.charCodeAt(i++),s=o.charCodeAt(i++),a=r>>2,p=(3&r)<<4|n>>4,h=(15&n)<<2|s>>6,c=63&s;isNaN(n)?h=c=64:isNaN(s)&&(c=64),e=e+Wo.charAt(a)+Wo.charAt(p)+Wo.charAt(h)+Wo.charAt(c)}return e}function Xo(t,e){if(t.length<2)return t.slice();return function t(i){if(i.length<=1)return i;var o=Math.floor(i.length/2),r=i.slice(0,o),n=i.slice(o);return function(t,i){for(var o=[],r=0,n=0,s=0;r<t.length&&n<i.length;)e(t[r],i[n])<=0?o[s++]=t[r++]:o[s++]=i[n++];return r<t.length&&o.push.apply(o,t.slice(r)),n<i.length&&o.push.apply(o,i.slice(n)),o}(r=t(r),n=t(n))}(t)}function Yo(t,e){var i={width:"800px",height:"600px",cors:"Anonymous"},o=t,r=t.clippedBBox();if(r){var n=r.getOrigin();(o=new ue).transform(K().translate(-n.x,-n.y)),o.children.push(t);var s=r.getSize();i.width=s.width+"px",i.height=s.height+"px"}var a=Object.assign(i,e),p=document.createElement("div"),h=p.style;h.display="none",h.width=a.width,h.height=a.height,document.body.appendChild(p);var c=new Eo(p,a);c.suspendTracking(),c.draw(o);var l=c.image(),u=function(){c.destroy(),document.body.removeChild(p)};return l.then(u,u),l}function Zo(t,e){var i=Uo(t);return e&&e.raw||(i="data:image/svg+xml;base64,"+qo(i)),io().resolve(i)}function Ko(t){var e=.5;t.options.stroke&&a.util.defined(t.options.stroke.width)&&t.options.stroke.width%2==0&&(e=0);for(var i=0;i<t.segments.length;i++)t.segments[i].anchor().round(0).translate(e,e);return t}function Jo(t,e){return-t.x*e.y+t.y*e.x<0}function $o(t){return"number"==typeof t&&!isNaN(t)}function Qo(t){return"string"==typeof t}function tr(t){return $o(t)||Qo(t)&&isFinite(t)}function er(t){return"function"==typeof t}function ir(t,e){for(var i in e){var o=e[i],r=typeof o,n=void 0;if((n="object"===r&&null!==o?o.constructor:null)&&n!==Array)if(o instanceof Date)t[i]=new Date(o.getTime());else if(er(o.clone))t[i]=o.clone();else{var s=t[i];t[i]="object"==typeof s&&s||{},ir(t[i],o)}else"undefined"!==r&&(t[i]=o)}return t}function or(t){for(var e=arguments,i=arguments.length,o=1;o<i;o++)ir(t,e[o]);return t}function rr(t){return"object"==typeof t}function nr(t){return $o(t)?t+"px":t}var sr=/width|height|top|left|bottom|right/i;function ar(t){return sr.test(t)}function pr(t,e){var i=Qo(e)?[e]:e;if(C(i)){for(var o={},r=window.getComputedStyle(t),n=0;n<i.length;n++){var s=i[n];o[s]=ar(s)?parseFloat(r[s]):r[s]}return o}if(rr(e))for(var a in e)t.style[a]=nr(e[a])}function hr(t,e){void 0===e&&(e=0);var i={top:0,right:0,bottom:0,left:0};return"number"==typeof t?i.top=i[b]=i[u]=i[g]=t:(i.top=t.top||e,i[b]=t[b]||e,i[u]=t[u]||e,i[g]=t[g]||e),i}var cr={format:function(t,e){return e},toString:function(t){return t},parseDate:function(t){return new Date(t)},firstDay:function(){return 0}},lr=function(){},ur={implementation:{configurable:!0}};lr.register=function(t){cr=t},ur.implementation.get=function(){return cr},Object.defineProperties(lr,ur);var fr=lr,dr=/\{(\d+)(:[^\}]+)?\}/g,yr=function(t){this._intlService=t},vr={intl:{configurable:!0}};vr.intl.get=function(){return this._intlService||fr.implementation},vr.intl.set=function(t){this._intlService=t},yr.prototype.auto=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];var o=this.intl;return Qo(t)&&t.match(v)?o.format.apply(o,[t].concat(e)):o.toString(e[0],t)},yr.prototype.localeAuto=function(t,e,i){var o=this.intl;return Qo(t)&&t.match(v)?t.replace(dr,(function(t,r,n){var s=e[parseInt(r,10)];return o.toString(s,n?n.substring(1):"",i)})):o.toString(e[0],t,i)},Object.defineProperties(yr.prototype,vr);var gr=yr,mr=function(t,e){void 0===e&&(e={}),this._intlService=e.intlService,this.sender=e.sender||t,this.format=new gr(e.intlService),this.chart=t,this.rtl=Boolean(e.rtl)},xr={intl:{configurable:!0}};xr.intl.get=function(){return this._intlService||fr.implementation},xr.intl.set=function(t){this._intlService=t,this.format.intl=t},mr.prototype.notify=function(t,e){this.chart&&this.chart.trigger(t,e)},mr.prototype.isPannable=function(t){var e=((this.chart||{}).options||{}).pannable;return e&&e.lock!==t},Object.defineProperties(mr.prototype,xr);var br,_r=mr,wr=function(){};wr.register=function(t){br=t},wr.create=function(t,e){if(br)return br.create(t,e)};var Ar=wr,Sr={compile:function(t){return t}},kr=function(){};kr.register=function(t){Sr=t},kr.compile=function(t){return Sr.compile(t)};var Cr=kr;function Pr(t){var e;return void 0===t&&(t={}),t.template?t.template=e=Cr.compile(t.template):er(t.content)&&(e=t.content),e}var Tr=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g,Mr={};function Or(t){if(Mr[t])return Mr[t];var e=[];return t.replace(Tr,(function(t,i,o,r){e.push(a.util.defined(i)?i:o||r)})),Mr[t]=function(t){for(var i=t,o=0;o<e.length&&i;o++)i=i[e[o]];return i},Mr[t]}function Rr(t,e){for(var i=t.length,o=[],r=0;r<i;r++)e(t[r])&&o.push(t[r]);return o}function Br(t,e){if(t.className)for(var i=e.split(" "),o=0;o<i.length;o++)if(-1!==t.className.indexOf(i[o]))return!0}Mr[void 0]=function(t){return t};var jr=function(){this._map={}};jr.prototype.get=function(t){return this._map[this._key(t)]},jr.prototype.set=function(t,e){this._map[this._key(t)]=e},jr.prototype._key=function(t){return t instanceof Date?t.getTime():t};var Ir=jr;function Lr(t,e){if(e)return-1!==e.indexOf(t)}function zr(t,e,i){return a.util.round(t+(e-t)*i,3)}var Er=function(t,e){this.observer=t,this.handlerMap=or({},this.handlerMap,e)};Er.prototype.trigger=function(t,e){var i,o=this.observer,r=this.handlerMap;return r[t]?i=this.callObserver(r[t],e):o.trigger&&(i=this.callObserver("trigger",t,e)),i},Er.prototype.callObserver=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return this.observer[t].apply(this.observer,e)},Er.prototype.requiresHandlers=function(t){if(this.observer.requiresHandlers)return this.observer.requiresHandlers(t);for(var e=0;e<t.length;e++)if(this.handlerMap[t[e]])return!0};var Vr=Er;function Fr(t,e){for(var i=t.length,o=[],r=0;r<i;r++){var n=e(t[r]);a.util.defined(n)&&o.push(n)}return o}function Dr(t){var e=0;return t.wheelDelta&&(e=(e=-t.wheelDelta/120)>0?Math.ceil(e):Math.floor(e)),t.detail&&(e=a.util.round(t.detail/3)),e}var Ur=a.util,Hr=Ur.append,Gr=Ur.bindEvents,Nr=Ur.defined,Wr=Ur.deg,qr=Ur.elementOffset,Xr=Ur.elementSize,Yr=Ur.eventElement,Zr=Ur.eventCoordinates,Kr=Ur.last,Jr=Ur.limitValue,$r=Ur.objectKey,Qr=Ur.rad,tn=Ur.round,en=Ur.unbindEvents,on=Ur.valueOrDefault,rn=function(){};rn.fetchFonts=function(t,e,i){void 0===i&&(i={depth:0});!t||i.depth>5||!document.fonts||Object.keys(t).forEach((function(o){var r=t[o];"dataSource"!==o&&"$"!==o[0]&&r&&("font"===o?e.push(r):"object"==typeof r&&(i.depth++,rn.fetchFonts(r,e,i),i.depth--))}))},rn.loadFonts=function(t,e){var i=[];if(t.length>0&&document.fonts){try{i=t.map((function(t){return document.fonts.load(t)}))}catch(t){fi(t)}Promise.all(i).then(e,e)}else e()},rn.preloadFonts=function(t,e){var i=[];rn.fetchFonts(t,i),rn.loadFonts(i,e)};var nn=rn;function sn(t,e){var i=t.prototype;i.options?i.options=or({},i.options,e):i.options=e}function an(t){for(var e=m,i=x,o=0,r=t.length;o<r;o++){var n=t[o];null!==n&&isFinite(n)&&(e=Math.min(e,n),i=Math.max(i,n))}return{min:e===m?void 0:e,max:i===x?void 0:i}}function pn(t,e){for(var i=0;i<t.length;i++){var o=t[i];if(e(o,i,t))return o}}var hn=p.Matrix,cn=/matrix\((.*)\)/;function ln(t){var e=getComputedStyle(t).transform;return"none"===e?hn.unit():function(t){var e=t.match(cn);if(null===e||2!==e.length)return hn.unit();var i=e[1].split(",").map((function(t){return parseFloat(t)}));return new(Function.prototype.bind.apply(hn,[null].concat(i)))}(e)}function un(t){if(!t)return hn.unit();for(var e=ln(t),i=t.parentElement;i;){var o=ln(i);e=e.multiplyCopy(o),i=i.parentElement}return e.b=e.c=e.e=e.f=0,e}var fn=function(t){function e(i){var o=this;if(t.call(this),1===arguments.length)for(var r=e.formats,n=this.resolveColor(i),s=0;s<r.length;s++){var a=r[s].re,p=r[s].process,h=a.exec(n);if(h){var c=p(h);o.r=c[0],o.g=c[1],o.b=c[2]}}else this.r=arguments[0],this.g=arguments[1],this.b=arguments[2];this.r=this.normalizeByte(this.r),this.g=this.normalizeByte(this.g),this.b=this.normalizeByte(this.b)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toHex=function(){var t=this.padDigit,e=this.r.toString(16),i=this.g.toString(16),o=this.b.toString(16);return"#"+t(e)+t(i)+t(o)},e.prototype.resolveColor=function(t){var i=t||"black";return"#"===i.charAt(0)&&(i=i.substr(1,6)),i=(i=i.replace(/ /g,"")).toLowerCase(),i=e.namedColors[i]||i},e.prototype.normalizeByte=function(t){return t<0||isNaN(t)?0:t>255?255:t},e.prototype.padDigit=function(t){return 1===t.length?"0"+t:t},e.prototype.brightness=function(t){var e=Math.round;return this.r=e(this.normalizeByte(this.r*t)),this.g=e(this.normalizeByte(this.g*t)),this.b=e(this.normalizeByte(this.b*t)),this},e.prototype.percBrightness=function(){return Math.sqrt(.241*this.r*this.r+.691*this.g*this.g+.068*this.b*this.b)},e.prototype.isDark=function(){return this.percBrightness()<180},e.fromBytes=function(t,e,i,o){return new wo(t,e,i,null!=o?o:1)},e.fromRGB=function(t,e,i,o){return new _o(t,e,i,null!=o?o:1)},e.fromHSV=function(t,e,i,o){return new So(t,e,i,null!=o?o:1)},e.fromHSL=function(t,e,i,o){return new ko(t,e,i,null!=o?o:1)},e}(O);fn.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(t){return[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],fn.namedColors=go;var dn=fn;var yn=function(t){return new dn(t).isDark()?A:l},vn={},gn=function(t){this._index={},this._values=t?t.slice(0):[];for(var e=0;e<this._values.length;e++)this._index[this._values[e]]=e},mn={size:{configurable:!0}};gn.prototype.values=function(){return this._values.filter((function(t){return t!==vn}))},gn.prototype.has=function(t){return void 0!==this._index[t]},gn.prototype.add=function(t){this.has(t)||(this._index[t]=this._values.length,this._values.push(t))},gn.prototype.delete=function(t){var e=this._index[t];void 0!==e&&(this._values[e]=vn,delete this._index[t])},gn.prototype.clear=function(){this._index={},this._values=[]},mn.size.get=function(){return this._values.length},Object.defineProperties(gn.prototype,mn);var xn=function(t){this._set=new Set(t)},bn={size:{configurable:!0}};xn.prototype.values=function(){return Array.from(this._set)},xn.prototype.has=function(t){return this._set.has(t)},xn.prototype.add=function(t){this._set.add(t)},xn.prototype.delete=function(t){this._set.delete(t)},xn.prototype.clear=function(){this._set.clear()},bn.size.get=function(){return this._set.size},Object.defineProperties(xn.prototype,bn);function _n(t){return function(){var t=!1;"function"==typeof Set&&(t=new Set([1]).has(1));return t}()?new xn(t):new gn(t)}function wn(t,e){var i=tn(e-t,9);if(0===i){if(0===e)return.1;i=Math.abs(e)}var o=Math.pow(10,Math.floor(Math.log(i)/Math.log(10))),r=tn(i/o,10);return tn(o*(r<1.904762?.2:r<4.761904?.5:r<9.523809?1:2),10)}var An=function(t){function e(e,i){t.call(this),this.x=e||0,this.y=i||0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.equals=function(t){return t&&this.x===t.x&&this.y===t.y},e.prototype.rotate=function(t,e){var i=Qr(e),o=Math.cos(i),r=Math.sin(i),n=t.x,s=t.y,a=this.x,p=this.y;return this.x=tn(n+(a-n)*o+(p-s)*r,3),this.y=tn(s+(p-s)*o-(a-n)*r,3),this},e.prototype.multiply=function(t){return this.x*=t,this.y*=t,this},e.prototype.distanceTo=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},e.onCircle=function(t,i,o){var r=Qr(i);return new e(t.x-o*Math.cos(r),t.y-o*Math.sin(r))},e}(O);function Sn(t,e,i,o,r){var n=Qr(r);return new An(i+(t-i)*Math.cos(n)+(e-o)*Math.sin(n),o-(t-i)*Math.sin(n)+(e-o)*Math.cos(n))}var kn=function(t){function e(e,i,o,r){t.call(this),this.x1=e||0,this.y1=i||0,this.x2=o||0,this.y2=r||0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.equals=function(t){return this.x1===t.x1&&this.x2===t.x2&&this.y1===t.y1&&this.y2===t.y2},e.prototype.width=function(){return this.x2-this.x1},e.prototype.height=function(){return this.y2-this.y1},e.prototype.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},e.prototype.move=function(t,e){var i=this.height(),o=this.width();return Nr(t)&&(this.x1=t,this.x2=this.x1+o),Nr(e)&&(this.y1=e,this.y2=this.y1+i),this},e.prototype.wrap=function(t){return this.x1=Math.min(this.x1,t.x1),this.y1=Math.min(this.y1,t.y1),this.x2=Math.max(this.x2,t.x2),this.y2=Math.max(this.y2,t.y2),this},e.prototype.wrapPoint=function(t){var i=C(t),o=i?t[0]:t.x,r=i?t[1]:t.y;return this.wrap(new e(o,r,o,r)),this},e.prototype.snapTo=function(t,e){return e!==S&&e||(this.x1=t.x1,this.x2=t.x2),e!==k&&e||(this.y1=t.y1,this.y2=t.y2),this},e.prototype.alignTo=function(t,e){var i=this.height(),o=this.width(),r=e===_||e===u?k:S,n=r===k?i:o;if(e===f){var s=t.center(),a=this.center();this.x1+=s.x-a.x,this.y1+=s.y-a.y}else this[r+1]=e===_||e===g?t[r+1]-n:t[r+2];return this.x2=this.x1+o,this.y2=this.y1+i,this},e.prototype.shrink=function(t,e){return this.x2-=t,this.y2-=e,this},e.prototype.expand=function(t,e){return this.shrink(-t,-e),this},e.prototype.pad=function(t){var e=hr(t);return this.x1-=e.left,this.x2+=e.right,this.y1-=e.top,this.y2+=e.bottom,this},e.prototype.unpad=function(t){var e=hr(t);return e.left=-e.left,e.top=-e.top,e.right=-e.right,e.bottom=-e.bottom,this.pad(e)},e.prototype.clone=function(){return new e(this.x1,this.y1,this.x2,this.y2)},e.prototype.center=function(){return new An(this.x1+this.width()/2,this.y1+this.height()/2)},e.prototype.containsPoint=function(t){return t.x>=this.x1&&t.x<=this.x2&&t.y>=this.y1&&t.y<=this.y2},e.prototype.points=function(){return[new An(this.x1,this.y1),new An(this.x2,this.y1),new An(this.x2,this.y2),new An(this.x1,this.y2)]},e.prototype.getHash=function(){return[this.x1,this.y1,this.x2,this.y2].join(",")},e.prototype.overlaps=function(t){return!(t.y2<this.y1||this.y2<t.y1||t.x2<this.x1||this.x2<t.x1)},e.prototype.rotate=function(t){var e=this.width(),i=this.height(),o=this.center(),r=o.x,n=o.y,s=Sn(0,0,r,n,t),a=Sn(e,0,r,n,t),p=Sn(e,i,r,n,t),h=Sn(0,i,r,n,t);return e=Math.max(s.x,a.x,p.x,h.x)-Math.min(s.x,a.x,p.x,h.x),i=Math.max(s.y,a.y,p.y,h.y)-Math.min(s.y,a.y,p.y,h.y),this.x2=this.x1+e,this.y2=this.y1+i,this},e.prototype.toRect=function(){return new p.Rect([this.x1,this.y1],[this.width(),this.height()])},e.prototype.hasSize=function(){return 0!==this.width()&&0!==this.height()},e.prototype.align=function(t,e,i){var o=e+1,r=e+2,n=e===S?"width":"height",s=this[n]();Lr(i,[g,_])?(this[o]=t[o],this[r]=this[o]+s):Lr(i,[b,u])?(this[r]=t[r],this[o]=this[r]-s):i===f&&(this[o]=t[o]+(t[n]()-s)/2,this[r]=this[o]+s)},e}(O);function Cn(t,e){return t-e}var Pn=function(t){function e(e,i,o,r,n){t.call(this),this.center=e,this.innerRadius=i,this.radius=o,this.startAngle=r,this.angle=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.center,this.innerRadius,this.radius,this.startAngle,this.angle)},e.prototype.middle=function(){return this.startAngle+this.angle/2},e.prototype.setRadius=function(t,e){return e?this.innerRadius=t:this.radius=t,this},e.prototype.point=function(t,e){var i=Qr(t),o=Math.cos(i),r=Math.sin(i),n=e?this.innerRadius:this.radius,s=tn(this.center.x-o*n,3),a=tn(this.center.y-r*n,3);return new An(s,a)},e.prototype.adjacentBox=function(t,e,i){var o=this.clone().expand(t),r=o.middle(),n=o.point(r),s=e/2,a=i/2,p=Math.sin(Qr(r)),h=Math.cos(Qr(r)),c=n.x-s,l=n.y-a;return Math.abs(p)<.9&&(c+=s*-h/Math.abs(h)),Math.abs(h)<.9&&(l+=a*-p/Math.abs(p)),new kn(c,l,c+e,l+i)},e.prototype.containsPoint=function(t){var e=this.center,i=this.innerRadius,o=this.radius,r=this.startAngle,n=this.startAngle+this.angle,s=t.x-e.x,a=t.y-e.y,p=new An(s,a),h=this.point(r),c=new An(h.x-e.x,h.y-e.y),l=this.point(n),u=new An(l.x-e.x,l.y-e.y),f=tn(s*s+a*a,3);return(c.equals(p)||Jo(c,p))&&!Jo(u,p)&&f>=i*i&&f<=o*o},e.prototype.getBBox=function(){var t,e=new kn(m,m,x,x),i=tn(this.startAngle%360),o=tn((i+this.angle)%360),r=this.innerRadius,n=[0,90,180,270,i,o].sort(Cn),s=n.indexOf(i),a=n.indexOf(o);t=i===o?n:s<a?n.slice(s,a+1):[].concat(n.slice(0,a+1),n.slice(s,n.length));for(var p=0;p<t.length;p++){var h=this.point(t[p]);e.wrapPoint(h),e.wrapPoint(h,r)}return r||e.wrapPoint(this.center),e},e.prototype.expand=function(t){return this.radius+=t,this},e}(O),Tn=function(t){function e(e,i,o,r){t.call(this,e,0,i,o,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.expand=function(e){return t.prototype.expand.call(this,e)},e.prototype.clone=function(){return new e(this.center,this.radius,this.startAngle,this.angle)},e.prototype.setRadius=function(t){return this.radius=t,this},e}(Pn),Mn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createRing=function(t,e){var i=t.startAngle+180,o=t.angle+i;t.angle>0&&i===o&&(o+=.001);var r=new p.Point(t.center.x,t.center.y),n=Math.max(t.radius,0),s=Math.max(t.innerRadius,0),h=new p.Arc(r,{startAngle:i,endAngle:o,radiusX:n,radiusY:n}),c=a.Path.fromArc(h,e).close();if(s){h.radiusX=h.radiusY=s;var l=h.pointAt(o);c.lineTo(l.x,l.y),c.arc(o,i,s,s,!0)}else c.lineTo(r.x,r.y);return c},e}(O);Mn.current=new Mn;var On=Mn,Rn=function(t){function e(e){t.call(this),this.children=[],this.options=or({},this.options,this.initUserOptions(e))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initUserOptions=function(t){return t},e.prototype.reflow=function(t){for(var e,i=this.children,o=0;o<i.length;o++){var r=i[o];r.reflow(t),e=e?e.wrap(r.box):r.box.clone()}this.box=e||t},e.prototype.destroy=function(){var t=this.children;this.animation&&this.animation.destroy();for(var e=0;e<t.length;e++)t[e].destroy()},e.prototype.getRoot=function(){var t=this.parent;return t?t.getRoot():null},e.prototype.getSender=function(){var t=this.getService();if(t)return t.sender},e.prototype.getService=function(){for(var t=this;t;){if(t.chartService)return t.chartService;t=t.parent}},e.prototype.translateChildren=function(t,e){for(var i=this.children,o=i.length,r=0;r<o;r++)i[r].box.translate(t,e)},e.prototype.append=function(){for(var t=arguments,e=0;e<arguments.length;e++){var i=t[e];this.children.push(i),i.parent=this}},e.prototype.renderVisual=function(){!1!==this.options.visible&&(this.createVisual(),this.addVisual(),this.renderChildren(),this.createAnimation(),this.renderComplete())},e.prototype.addVisual=function(){this.visual&&(this.visual.chartElement=this,this.parent&&this.parent.appendVisual(this.visual))},e.prototype.renderChildren=function(){for(var t=this.children,e=t.length,i=0;i<e;i++)t[i].renderVisual()},e.prototype.createVisual=function(){this.visual=new a.Group({zIndex:this.options.zIndex,visible:on(this.options.visible,!0)})},e.prototype.createAnimation=function(){this.visual&&this.options.animation&&(this.animation=a.Animation.create(this.visual,this.options.animation))},e.prototype.appendVisual=function(t){t.chartElement||(t.chartElement=this),t.options.noclip?this.clipRoot().visual.append(t):Nr(t.options.zIndex)?this.stackRoot().stackVisual(t):this.isStackRoot?this.stackVisual(t):this.visual?this.visual.append(t):this.parent.appendVisual(t)},e.prototype.clipRoot=function(){return this.parent?this.parent.clipRoot():this},e.prototype.stackRoot=function(){return this.parent?this.parent.stackRoot():this},e.prototype.stackVisual=function(t){var e,i=t.options.zIndex||0,o=this.visual.children,r=o.length;for(e=0;e<r;e++){var n=o[e];if(on(n.options.zIndex,0)>i)break}this.visual.insert(e,t)},e.prototype.traverse=function(t){for(var e=this.children,i=e.length,o=0;o<i;o++){var r=e[o];t(r),r.traverse&&r.traverse(t)}},e.prototype.closest=function(t){for(var e=this,i=!1;e&&!i;)(i=t(e))||(e=e.parent);if(i)return e},e.prototype.renderComplete=function(){},e.prototype.hasHighlight=function(){var t=(this.options||{}).highlight;return!(!this.createHighlight||t&&!1===t.visible)},e.prototype.toggleHighlight=function(t,e){var i=this,o=(this.options||{}).highlight||{},r=o.visual,n=this._highlight;if(!n){var s={fill:{color:A,opacity:e||.2},stroke:{color:A,width:1,opacity:e||.2}};if(r){if(!(n=this._highlight=r(Object.assign(this.highlightVisualArgs(),{createVisual:function(){return i.createHighlight(s)},sender:this.getSender(),series:this.series,dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total}))))return}else n=this._highlight=this.createHighlight(s);Nr(n.options.zIndex)||(n.options.zIndex=on(o.zIndex,this.options.zIndex)),this.appendVisual(n)}n.visible(t)},e.prototype.createGradientOverlay=function(t,e,i){var o=new a.Path(Object.assign({stroke:{color:"none"},fill:this.createGradient(i),closed:t.options.closed},e));return o.segments.elements(t.segments.elements()),o},e.prototype.createGradient=function(t){if(this.parent)return this.parent.createGradient(t)},e.prototype.supportsPointInactiveOpacity=function(){return!0},e}(O);Rn.prototype.options={};var Bn=Rn,jn=function(t){function e(e){t.call(this,e),this.options.margin=hr(this.options.margin),this.options.padding=hr(this.options.padding)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(e){var i,o=this,r=this.options,n=r.width,s=r.height,a=r.shrinkToFit,p=n&&s,h=r.margin,c=r.padding,l=r.border.width,u=function(){o.align(e,S,r.align),o.align(e,k,r.vAlign),o.paddingBox=i.clone().unpad(h).unpad(l)},f=e.clone();p&&(f.x2=f.x1+n,f.y2=f.y1+s),a&&f.unpad(h).unpad(l).unpad(c),t.prototype.reflow.call(this,f),i=p?this.box=new kn(0,0,n,s):this.box,a&&p?(u(),f=this.contentBox=this.paddingBox.clone().unpad(c)):(f=this.contentBox=i.clone(),i.pad(c).pad(l).pad(h),u()),this.translateChildren(i.x1-f.x1+h.left+l+c.left,i.y1-f.y1+h.top+l+c.top);for(var d=this.children,y=0;y<d.length;y++){var v=d[y];v.reflow(v.box)}},e.prototype.align=function(t,e,i){this.box.align(t,e,i)},e.prototype.hasBox=function(){var t=this.options;return t.border.width||t.background},e.prototype.createVisual=function(){t.prototype.createVisual.call(this),this.options.visible&&this.hasBox()&&this.visual.append(a.Path.fromRect(this.paddingBox.toRect(),this.visualStyle()))},e.prototype.visualStyle=function(){var t=this.options,e=t.border||{};return{stroke:{width:e.width,color:e.color,opacity:on(e.opacity,t.opacity),dashType:e.dashType},fill:{color:t.background,opacity:t.opacity},cursor:t.cursor}},e}(Bn);sn(jn,{align:g,vAlign:_,margin:{},padding:{},border:{color:l,width:0},background:"",shrinkToFit:!1,width:0,height:0,visible:!0});var In=jn,Ln=function(t){function e(e,i){t.call(this,e),this.pointData=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getElement=function(){var t=this.options,e=this.paddingBox,i=t.type,o=t.rotation,r=e.center(),n=e.width()/2,s=e.height()/2;if(!t.visible||!this.hasBox())return null;var h,c=this.visualStyle();if(i===d)h=new a.Circle(new p.Circle([tn(e.x1+n,3),tn(e.y1+s,3)],Math.min(n,s)),c);else if("triangle"===i)h=a.Path.fromPoints([[e.x1+n,e.y1],[e.x1,e.y2],[e.x2,e.y2]],c).close();else if("cross"===i)(h=new a.MultiPath(c)).moveTo(e.x1,e.y1).lineTo(e.x2,e.y2),h.moveTo(e.x1,e.y2).lineTo(e.x2,e.y1);else{var l=e.toRect();if("roundedRect"===i){var u=on(t.borderRadius,l.width()/5);l.setCornerRadius(u)}h=a.Path.fromRect(l,c)}return o&&h.transform(p.transform().rotate(-o,[r.x,r.y])),h.options.zIndex=t.zIndex,h},e.prototype.createElement=function(){var t=this,e=this.options.visual,i=this.pointData||{};return e?e({value:i.value,dataItem:i.dataItem,sender:this.getSender(),series:i.series,category:i.category,rect:this.paddingBox.toRect(),options:this.visualOptions(),createVisual:function(){return t.getElement()}}):this.getElement()},e.prototype.visualOptions=function(){var t=this.options;return{background:t.background,border:t.border,margin:t.margin,padding:t.padding,type:t.type,size:t.width,visible:t.visible}},e.prototype.createVisual=function(){this.visual=this.createElement()},e}(In);sn(Ln,{type:d,align:f,vAlign:f});var zn=Ln,En={glass:{type:"linear",rotation:0,stops:[{offset:0,color:A,opacity:0},{offset:.25,color:A,opacity:.3},{offset:1,color:A,opacity:0}]},sharpBevel:{type:"radial",stops:[{offset:0,color:A,opacity:.55},{offset:.65,color:A,opacity:0},{offset:.95,color:A,opacity:.25}]},roundedBevel:{type:"radial",stops:[{offset:.33,color:A,opacity:.06},{offset:.83,color:A,opacity:.2},{offset:.95,color:A,opacity:0}]},roundedGlass:{type:"radial",supportVML:!1,stops:[{offset:0,color:A,opacity:0},{offset:.5,color:A,opacity:.3},{offset:.99,color:A,opacity:0}]},sharpGlass:{type:"radial",supportVML:!1,stops:[{offset:0,color:A,opacity:.2},{offset:.15,color:A,opacity:.15},{offset:.17,color:A,opacity:.35},{offset:.85,color:A,opacity:.05},{offset:.87,color:A,opacity:.15},{offset:.99,color:A,opacity:0}]},bubbleShadow:{type:"radial",center:[.5,.5],radius:.5}};function Vn(t,e){if(t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2)return e;var i=Math.min(t.x1,e.x1),o=Math.max(t.x1,e.x1),r=Math.min(t.x2,e.x2),n=Math.max(t.x2,e.x2),s=Math.min(t.y1,e.y1),a=Math.max(t.y1,e.y1),p=Math.min(t.y2,e.y2),h=Math.max(t.y2,e.y2),c=[];return c[0]=new kn(o,s,r,a),c[1]=new kn(i,a,o,p),c[2]=new kn(r,a,n,p),c[3]=new kn(o,p,r,h),t.x1===i&&t.y1===s||e.x1===i&&e.y1===s?(c[4]=new kn(i,s,o,a),c[5]=new kn(r,p,n,h)):(c[4]=new kn(r,s,n,a),c[5]=new kn(i,p,o,h)),Rr(c,(function(t){return t.height()>0&&t.width()>0}))[0]}var Fn=function(t){function e(e){t.call(this,e);var i=this.options;i.width=parseInt(i.width,10),i.height=parseInt(i.height,10),this.gradients={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(){var t=this.options,e=this.children,i=new kn(0,0,t.width,t.height);this.box=i.unpad(t.margin);for(var o=0;o<e.length;o++)e[o].reflow(i),i=Vn(i,e[o].box)||new kn},e.prototype.createVisual=function(){this.visual=new a.Group,this.createBackground()},e.prototype.createBackground=function(){var t=this.options,e=t.border||{},i=this.box.clone().pad(t.margin).unpad(e.width),o=a.Path.fromRect(i.toRect(),{stroke:{color:e.width?e.color:"",width:e.width,dashType:e.dashType},fill:{color:t.background,opacity:t.opacity},zIndex:-10});this.visual.append(o)},e.prototype.getRoot=function(){return this},e.prototype.createGradient=function(t){var e,i=this.gradients,o=$r(t),r=En[t.gradient];if(i[o])e=i[o];else{var n=Object.assign({},r,t);"linear"===r.type?e=new a.LinearGradient(n):(t.innerRadius&&(n.stops=function(t){for(var e=t.stops,i=t.innerRadius/t.radius*100,o=e.length,r=[],n=0;n<o;n++){var s=Object.assign({},e[n]);s.offset=(s.offset*(100-i)+i)/100,r.push(s)}return r}(n)),(e=new a.RadialGradient(n)).supportVML=!1!==r.supportVML),i[o]=e}return e},e.prototype.cleanGradients=function(){var t=this.gradients;for(var e in t)t[e]._observers=[]},e.prototype.size=function(){var t=this.options;return new kn(0,0,t.width,t.height)},e}(Bn);sn(Fn,{width:600,height:400,background:A,border:{color:l,width:0},margin:hr(5),zIndex:-2});var Dn=Fn,Un=function(t){function e(e){t.call(this,e),this._initDirection()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initDirection=function(){var t=this.options;t.vertical?(this.groupAxis=S,this.elementAxis=k,this.groupSizeField="width",this.elementSizeField="height",this.groupSpacing=t.spacing,this.elementSpacing=t.vSpacing):(this.groupAxis=k,this.elementAxis=S,this.groupSizeField="height",this.elementSizeField="width",this.groupSpacing=t.vSpacing,this.elementSpacing=t.spacing)},e.prototype.reflow=function(t){this.box=t.clone(),this.reflowChildren()},e.prototype.reflowChildren=function(){var t=this.box,e=this.elementAxis,i=this.groupAxis,o=this.elementSizeField,r=this.groupSizeField,n=this.groupOptions(),s=n.groups,a=n.groupsSize,p=n.maxGroupElementsSize,h=s.length,c=t[i+1]+this.alignStart(a,t[r]());if(h){for(var l=c,u=0;u<h;u++){for(var f=s[u],d=f.groupElements,y=t[e+1],v=d.length,g=0;g<v;g++){var m=d[g],x=this.elementSize(m),b=l+this.alignStart(x[r],f.groupSize),_=new kn;_[i+1]=b,_[i+2]=b+x[r],_[e+1]=y,_[e+2]=y+x[o],m.reflow(_),y+=x[o]+this.elementSpacing}l+=f.groupSize+this.groupSpacing}t[i+1]=c,t[i+2]=c+a,t[e+2]=t[e+1]+p}},e.prototype.alignStart=function(t,e){var i=0,o=this.options.align;return o===b||o===u?i=e-t:o===f&&(i=(e-t)/2),i},e.prototype.groupOptions=function(){for(var t=this.box,e=this.children,i=this.elementSizeField,o=this.groupSizeField,r=this.elementSpacing,n=this.groupSpacing,s=tn(t[i]()),a=e.length,p=[],h=0,c=0,l=0,u=0,f=[],d=0;d<a;d++){var y=e[d];y.box||y.reflow(t);var v=this.elementSize(y);this.options.wrap&&tn(c+r+v[i])>s&&(p.push({groupElements:f,groupSize:h,groupElementsSize:c}),u=Math.max(u,c),l+=n+h,h=0,c=0,f=[]),h=Math.max(h,v[o]),c>0&&(c+=r),c+=v[i],f.push(y)}return p.push({groupElements:f,groupSize:h,groupElementsSize:c}),{groups:p,groupsSize:l+=h,maxGroupElementsSize:u=Math.max(u,c)}},e.prototype.elementSize=function(t){return{width:t.box.width(),height:t.box.height()}},e.prototype.createVisual=function(){},e}(Bn);sn(Un,{vertical:!0,wrap:!0,vSpacing:0,spacing:0});var Hn=Un,Gn=a.Text,Nn=function(t){function e(e,i){t.call(this,i),this.content=e,this.reflow(new kn)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.options,i=e.size=a.util.measureText(this.content,{font:e.font});this.baseline=i.baseline,this.box=new kn(t.x1,t.y1,t.x1+i.width,t.y1+i.height)},e.prototype.createVisual=function(){var t=this.options,e=t.font,i=t.color,o=t.opacity,r=t.cursor;this.visual=new Gn(this.content,this.box.toRect().topLeft(),{font:e,fill:{color:i,opacity:o},cursor:r})},e}(Bn);sn(Nn,{font:"12px sans-serif",color:l});var Wn=Nn;function qn(t){var e=t.origin,i=t.bottomRight();return new kn(e.x,e.y,i.x,i.y)}var Xn=/\n/m,Yn=function(t){function e(e,i,o){t.call(this,i),this.content=e,this.data=o,this._initContainer(),!1!==this.options._autoReflow&&this.reflow(new kn)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initContainer=function(){var t=this.options,e=String(this.content).split(Xn),i=new Hn({vertical:!0,align:t.align,wrap:!1}),o=or({},t,{opacity:1,animation:null});this.container=i,this.append(i);for(var r=0;r<e.length;r++){var n=new Wn(e[r].trim(),o);i.append(n)}},e.prototype.reflow=function(e){var i=this.options,o=i.visual;if(this.container.options.align=i.align,o&&!this._boxReflow){var r=e;r.hasSize()||(this._boxReflow=!0,this.reflow(r),this._boxReflow=!1,r=this.box);var n=this.visual=o(this.visualContext(r));n&&(r=qn(n.clippedBBox()||new p.Rect),n.options.zIndex=i.zIndex),this.box=this.contentBox=this.paddingBox=r}else if(t.prototype.reflow.call(this,e),i.rotation){var s=hr(i.margin),a=this.box.unpad(s);this.targetBox=e,this.normalBox=a.clone(),(a=this.rotate()).translate(s.left-s.right,s.top-s.bottom),this.rotatedBox=a.clone(),a.pad(s)}},e.prototype.createVisual=function(){var t=this.options;if(this.visual=new a.Group({transform:this.rotationTransform(),zIndex:t.zIndex,noclip:t.noclip}),this.hasBox()){var e=a.Path.fromRect(this.paddingBox.toRect(),this.visualStyle());this.visual.append(e)}},e.prototype.renderVisual=function(){if(this.options.visible)if(this.options.visual){var e=this.visual;e&&!Nr(e.options.noclip)&&(e.options.noclip=this.options.noclip),this.addVisual(),this.createAnimation()}else t.prototype.renderVisual.call(this)},e.prototype.visualContext=function(t){var e=this,i={text:this.content,rect:t.toRect(),sender:this.getSender(),options:this.options,createVisual:function(){return e._boxReflow=!0,e.reflow(t),e._boxReflow=!1,e.getDefaultVisual()}};return this.data&&Object.assign(i,this.data),i},e.prototype.getDefaultVisual=function(){this.createVisual(),this.renderChildren();var t=this.visual;return delete this.visual,t},e.prototype.rotate=function(){var t=this.options;return this.box.rotate(t.rotation),this.align(this.targetBox,S,t.align),this.align(this.targetBox,k,t.vAlign),this.box},e.prototype.rotationTransform=function(){var t=this.options.rotation;if(!t)return null;var e=this.normalBox.center(),i=e.x,o=e.y,r=this.rotatedBox.center();return p.transform().translate(r.x-i,r.y-o).rotate(t,[i,o])},e}(In),Zn=function(t){function e(e){t.call(this,e),this.append(new Yn(this.options.text,Object.assign({},this.options,{vAlign:this.options.position})))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(e){t.prototype.reflow.call(this,e),this.box.snapTo(e,S)},e.buildTitle=function(t,i,o){var r,n=t;return"string"==typeof t&&(n={text:t}),(n=Object.assign({visible:!0},o,n))&&n.visible&&n.text&&(r=new e(n),i.append(r)),r},e}(Bn);sn(Zn,{color:l,position:_,align:f,margin:hr(5),padding:hr(5)});var Kn=Zn,Jn=function(t){function e(e,i,o,r,n){t.call(this,i,n),this.text=i,this.value=e,this.index=o,this.dataItem=r,this.reflow(new kn)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.visualContext=function(e){var i=t.prototype.visualContext.call(this,e);return i.value=this.value,i.dataItem=this.dataItem,i.format=this.options.format,i.culture=this.options.culture,i},e.prototype.click=function(t,e){t.trigger("axisLabelClick",{element:Yr(e),value:this.value,text:this.text,index:this.index,dataItem:this.dataItem,axis:this.parent.options})},e.prototype.rotate=function(){if(this.options.alignRotation!==f){var e=this.normalBox.toRect(),i=this.rotationTransform();this.box=qn(e.bbox(i.matrix()))}else t.prototype.rotate.call(this);return this.box},e.prototype.rotationTransform=function(){var e=this.options,i=e.rotation;if(!i)return null;if(e.alignRotation===f)return t.prototype.rotationTransform.call(this);var o=p.transform().rotate(i).matrix(),r=this.normalBox.toRect(),n=this.targetBox.toRect(),s=e.rotationOrigin||_,a=s===_||s===u?S:k,h=s===_||s===u?k:S,c=s===_||s===g?n.origin:n.bottomRight(),l=r.topLeft().transformCopy(o),d=r.topRight().transformCopy(o),y=r.bottomRight().transformCopy(o),v=r.bottomLeft().transformCopy(o),m=p.Rect.fromPoints(l,d,y,v),x={};x[h]=n.origin[h]-m.origin[h];var b,w,A=Math.abs(l[h]+x[h]-c[h]),C=Math.abs(d[h]+x[h]-c[h]);tn(A,10)===tn(C,10)?(b=l,w=d):C<A?(b=d,w=y):(b=l,w=v);var P=b[a]+(w[a]-b[a])/2;return x[a]=n.center()[a]-P,p.transform().translate(x.x,x.y).rotate(i)},e}(Yn);sn(Jn,{_autoReflow:!1});var $n=Jn,Qn=function(t){function e(e,i,o){t.call(this,i),this.fields=e,this.chartService=o,this.render()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hide=function(){this.options.visible=!1},e.prototype.show=function(){this.options.visible=!0},e.prototype.render=function(){var t=this,e=this.options;if(e.visible){var i,o,r=e.label,n=e.icon,s=new kn,a=function(){return t},p=n.size,h=this.fields.text;if(Nr(r)&&r.visible){var c=Pr(r);c?h=c(this.fields):r.format&&(h=this.chartService.format.auto(r.format,h)),r.color||(r.color="inside"===r.position?"#fff":n.background),this.label=new Yn(h,or({},r)),this.label.aliasFor=a,"inside"!==r.position||Nr(p)||(n.type===d?p=Math.max(this.label.box.width(),this.label.box.height()):(i=this.label.box.width(),o=this.label.box.height()),s.wrap(this.label.box))}n.width=i||p||7,n.height=o||p||7;var l=new zn(or({},n));l.aliasFor=a,this.marker=l,this.append(l),this.label&&this.append(this.label),l.reflow(new kn),this.wrapperBox=s.wrap(l.box)}},e.prototype.reflow=function(t){var e,i,o,r=this.options,n=this.label,s=this.marker,a=this.wrapperBox,p=t.center(),h=r.line.length,c=r.position;r.visible&&(Lr(c,[g,b])?c===g?(o=a.alignTo(t,c).translate(-h,t.center().y-a.center().y),r.line.visible&&(e=[t.x1,p.y],this.linePoints=[e,[o.x2,p.y]],i=o.clone().wrapPoint(e))):(o=a.alignTo(t,c).translate(h,t.center().y-a.center().y),r.line.visible&&(e=[t.x2,p.y],this.linePoints=[e,[o.x1,p.y]],i=o.clone().wrapPoint(e))):c===u?(o=a.alignTo(t,c).translate(t.center().x-a.center().x,h),r.line.visible&&(e=[p.x,t.y2],this.linePoints=[e,[p.x,o.y1]],i=o.clone().wrapPoint(e))):(o=a.alignTo(t,c).translate(t.center().x-a.center().x,-h),r.line.visible&&(e=[p.x,t.y1],this.linePoints=[e,[p.x,o.y2]],i=o.clone().wrapPoint(e))),s&&s.reflow(o),n&&(n.reflow(o),s&&("outside"===r.label.position&&n.box.alignTo(s.box,c),n.reflow(n.box))),this.contentBox=o,this.targetBox=t,this.box=i||o)},e.prototype.createVisual=function(){t.prototype.createVisual.call(this),this.visual.options.noclip=this.options.noclip,this.options.visible&&this.createLine()},e.prototype.renderVisual=function(){var e=this,i=this.options,o=i.visual;i.visible&&o?(this.visual=o(Object.assign(this.fields,{sender:this.getSender(),rect:this.targetBox.toRect(),options:{background:i.background,border:i.background,icon:i.icon,label:i.label,line:i.line,position:i.position,visible:i.visible},createVisual:function(){e.createVisual(),e.renderChildren();var t=e.visual;return delete e.visual,t}})),this.addVisual()):t.prototype.renderVisual.call(this)},e.prototype.createLine=function(){var t=this.options.line;if(this.linePoints){var e=a.Path.fromPoints(this.linePoints,{stroke:{color:t.color,width:t.width,dashType:t.dashType}});Ko(e),this.visual.append(e)}},e.prototype.click=function(t,e){var i=this.eventArgs(e);t.trigger("noteClick",i)||e.preventDefault()},e.prototype.over=function(t,e){var i=this.eventArgs(e);t.trigger("noteHover",i)||e.preventDefault()},e.prototype.out=function(t,e){var i=this.eventArgs(e);t.trigger("noteLeave",i)},e.prototype.eventArgs=function(t){var e=this.options;return Object.assign(this.fields,{element:Yr(t),text:Nr(e.label)?e.label.text:"",visual:this.visual})},e}(In);sn(Qn,{icon:{visible:!0,type:d},label:{position:"inside",visible:!0,align:f,vAlign:f},line:{visible:!0},visible:!0,position:_,zIndex:2});var ts=Qn;function es(t,e){var i=t.tickX,o=t.tickY,r=t.position,n=new a.Path({stroke:{width:e.width,color:e.color}});return t.vertical?n.moveTo(i,r).lineTo(i+e.size,r):n.moveTo(r,o).lineTo(r,o+e.size),Ko(n),n}function is(t,e){var i=t.lineStart,o=t.lineEnd,r=t.position,n=new a.Path({stroke:{width:e.width,color:e.color,dashType:e.dashType}});return t.vertical?n.moveTo(i,r).lineTo(o,r):n.moveTo(r,i).lineTo(r,o),Ko(n),n}var os=function(t){function e(e,i){void 0===i&&(i=new _r),t.call(this,e),this.chartService=i,this.options.visible||(this.options=or({},this.options,{labels:{visible:!1},line:{visible:!1},margin:0,majorTickSize:0,minorTickSize:0})),this.options.minorTicks=or({},{color:this.options.line.color,width:this.options.line.width,visible:"none"!==this.options.minorTickType},this.options.minorTicks,{size:this.options.minorTickSize,align:this.options.minorTickType}),this.options.majorTicks=or({},{color:this.options.line.color,width:this.options.line.width,visible:"none"!==this.options.majorTickType},this.options.majorTicks,{size:this.options.majorTickSize,align:this.options.majorTickType}),this.initFields(),this.options._deferLabels||this.createLabels(),this.createTitle(),this.createNotes()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(){},e.prototype.labelsRange=function(){return{min:this.options.labels.skip,max:this.labelsCount()}},e.prototype.normalizeLabelRotation=function(t){var e=t.rotation;rr(e)&&(t.alignRotation=e.align,t.rotation=e.angle)},e.prototype.createLabels=function(){var t=this.options,e=t.vertical?b:f,i=or({},t.labels,{align:e,zIndex:t.zIndex}),o=Math.max(1,i.step);if(this.clearLabels(),i.visible){this.normalizeLabelRotation(i),"auto"===i.rotation&&(i.rotation=0,t.autoRotateLabels=!0);for(var r=this.labelsRange(),n=r.min;n<r.max;n+=o){var s={index:n,count:r.max},a=this.createAxisLabel(n,i,s);a&&(this.append(a),this.labels.push(a))}}},e.prototype.clearLabels=function(){this.children=Rr(this.children,(function(t){return!(t instanceof $n)})),this.labels=[]},e.prototype.clearTitle=function(){var t=this;this.title&&(this.children=Rr(this.children,(function(e){return e!==t.title})),this.title=void 0)},e.prototype.clear=function(){this.clearLabels(),this.clearTitle()},e.prototype.lineBox=function(){var t=this.options,e=this.box,i=t.vertical,o=t.labels.mirror,r=o?e.x1:e.x2,n=o?e.y2:e.y1,s=t.line.width||0;return i?new kn(r,e.y1,r,e.y2-s):new kn(e.x1,n,e.x2-s,n)},e.prototype.createTitle=function(){var t=this.options,e=or({rotation:t.vertical?-90:0,text:"",zIndex:1,visualSize:!0},t.title);if(e.visible&&e.text){var i=new Yn(e.text,e);this.append(i),this.title=i}},e.prototype.createNotes=function(){var t=this.options,e=t.notes,i=e.data||[];this.notes=[];for(var o=0;o<i.length;o++){var r=or({},e,i[o]);r.value=this.parseNoteValue(r.value);var n=new ts({value:r.value,text:r.label.text,dataItem:r},r,this.chartService);n.options.visible&&(Nr(n.options.position)?t.vertical&&!Lr(n.options.position,[g,b])?n.options.position=t.reverse?g:b:t.vertical||Lr(n.options.position,[_,u])||(n.options.position=t.reverse?u:_):t.vertical?n.options.position=t.reverse?g:b:n.options.position=t.reverse?u:_,this.append(n),this.notes.push(n))}},e.prototype.parseNoteValue=function(t){return t},e.prototype.renderVisual=function(){t.prototype.renderVisual.call(this),this.createPlotBands()},e.prototype.createVisual=function(){t.prototype.createVisual.call(this),this.createBackground(),this.createLine()},e.prototype.gridLinesVisual=function(){var t=this._gridLines;return t||(t=this._gridLines=new a.Group({zIndex:-2}),this.appendVisual(this._gridLines)),t},e.prototype.createTicks=function(t){var e=this.options,i=this.lineBox(),o=e.labels.mirror,r=e.majorTicks.visible?e.majorUnit:0,n={vertical:e.vertical};function s(e,r,s){var a=e.length,p=Math.max(1,r.step);if(r.visible)for(var h=r.skip;h<a;h+=p)Nr(s)&&h%s==0||(n.tickX=o?i.x2:i.x2-r.size,n.tickY=o?i.y1-r.size:i.y1,n.position=e[h],t.append(es(n,r)))}s(this.getMajorTickPositions(),e.majorTicks),s(this.getMinorTickPositions(),e.minorTicks,r/e.minorUnit)},e.prototype.createLine=function(){var t=this.options,e=t.line,i=this.lineBox();if(e.width>0&&e.visible){var o=new a.Path({stroke:{width:e.width,color:e.color,dashType:e.dashType}});o.moveTo(i.x1,i.y1).lineTo(i.x2,i.y2),t._alignLines&&Ko(o);var r=this._lineGroup=new a.Group;r.append(o),this.visual.append(r),this.createTicks(r)}},e.prototype.getActualTickSize=function(){var t=this.options,e=0;return t.majorTicks.visible&&t.minorTicks.visible?e=Math.max(t.majorTicks.size,t.minorTicks.size):t.majorTicks.visible?e=t.majorTicks.size:t.minorTicks.visible&&(e=t.minorTicks.size),e},e.prototype.createBackground=function(){var t=this.options,e=this.box,i=t.background;i&&(this._backgroundPath=a.Path.fromRect(e.toRect(),{fill:{color:i},stroke:null}),this.visual.append(this._backgroundPath))},e.prototype.createPlotBands=function(){var t=this,e=this.options,i=e.plotBands||[],o=e.vertical,r=this.plotArea;if(0!==i.length){for(var n=this._plotbandGroup=new a.Group({zIndex:-1}),s=Rr(this.pane.axes,(function(e){return e.options.vertical!==t.options.vertical}))[0],h=0;h<i.length;h++){var c=i[h],l=void 0,u=void 0,f=c.label,d=void 0;if(o?(l=(s||r.axisX).lineBox(),u=this.getSlot(c.from,c.to,!0)):(l=this.getSlot(c.from,c.to,!0),u=(s||r.axisY).lineBox()),f&&(f.vAlign=f.position||g,d=this.createPlotBandLabel(f,c,new kn(l.x1,u.y1,l.x2,u.y2))),0!==l.width()&&0!==u.height()){var y=new p.Rect([l.x1,u.y1],[l.width(),u.height()]),v=a.Path.fromRect(y,{fill:{color:c.color,opacity:c.opacity},stroke:null});n.append(v),d&&n.append(d)}}this.appendVisual(n)}},e.prototype.createPlotBandLabel=function(t,e,i){if(!1===t.visible)return null;var o,r=t.text;if(Nr(t)&&t.visible){var n=Pr(t);n?r=n({text:r,item:e}):t.format&&(r=this.chartService.format.auto(t.format,r)),t.color||(t.color=this.options.labels.color)}return(o=new Yn(r,t)).reflow(i),o.renderVisual(),o.visual},e.prototype.createGridLines=function(t){var e=this.options,i=e.minorGridLines,o=e.majorGridLines,r=e.minorUnit,n=e.vertical,s=t.options.line.visible,a=o.visible?e.majorUnit:0,p=t.lineBox(),h=p[n?"y1":"x1"],c={lineStart:p[n?"x1":"y1"],lineEnd:p[n?"x2":"y2"],vertical:n},l=[],u=this.gridLinesVisual();function f(t,e,i){var o=t.length,r=Math.max(1,e.step);if(e.visible)for(var n=e.skip;n<o;n+=r){var a=tn(t[n]);Lr(a,l)||n%i==0||s&&h===a||(c.position=a,u.append(is(c,e)),l.push(a))}}return f(this.getMajorTickPositions(),o),f(this.getMinorTickPositions(),i,a/r),u.children},e.prototype.reflow=function(t){for(var e=this.options,i=this.labels,o=this.title,r=e.vertical,n=i.length,s=r?"width":"height",a=o?o.box[s]():0,p=this.getActualTickSize()+e.margin+a,h=((this.getRoot()||{}).box||t)[s](),c=0,l=0;l<n;l++){var u=i[l].box[s]();u+p<=h&&(c=Math.max(c,u))}this.box=r?new kn(t.x1,t.y1,t.x1+c+p,t.y2):new kn(t.x1,t.y1,t.x2,t.y1+c+p),this.arrangeTitle(),this.arrangeLabels(),this.arrangeNotes()},e.prototype.getLabelsTickPositions=function(){return this.getMajorTickPositions()},e.prototype.labelTickIndex=function(t){return t.index},e.prototype.arrangeLabels=function(){for(var t=this.options,e=this.labels,i=this.labelsBetweenTicks(),o=t.vertical,r=t.labels.mirror,n=this.getLabelsTickPositions(),s=0;s<e.length;s++){var a=e[s],p=this.labelTickIndex(a),h=o?a.box.height():a.box.width(),c=n[p],l=n[p+1],u=void 0,f=void 0;if(o){if(i)u=c+(l-c)/2-h/2;else u=c-h/2;f=u}else i?(u=c,f=l):f=(u=c-h/2)+h;this.positionLabel(a,r,u,f)}},e.prototype.positionLabel=function(t,e,i,o){void 0===o&&(o=i);var r,n=this.options,s=n.vertical,a=this.lineBox(),p=this.getActualTickSize()+n.margin;if(s){var h=a.x2;e?(h+=p,t.options.rotationOrigin=g):(h-=p+t.box.width(),t.options.rotationOrigin=b),r=t.box.move(h,i)}else{var c=a.y1;e?(c-=p+t.box.height(),t.options.rotationOrigin=u):(c+=p,t.options.rotationOrigin=_),r=new kn(i,c,o,c+t.box.height())}t.reflow(r)},e.prototype.autoRotateLabelAngle=function(t,e){return t.width()<e?0:t.height()>e?-90:-45},e.prototype.autoRotateLabels=function(){if(!this.options.autoRotateLabels||this.options.vertical)return!1;for(var t=this.getMajorTickPositions(),e=this.labels,i=Math.min(e.length,t.length-1),o=0,r=0;r<i;r++){var n=Math.abs(t[r+1]-t[r]),s=e[r].box,a=this.autoRotateLabelAngle(s,n);if(0!==a&&(o=a),-90===o)break}if(0!==o){for(var p=0;p<e.length;p++)e[p].options.rotation=o,e[p].reflow(new kn);return!0}},e.prototype.arrangeTitle=function(){var t=this.options,e=this.title,i=t.labels.mirror,o=t.vertical;e&&(o?(e.options.align=i?b:g,e.options.vAlign=e.options.position):(e.options.align=e.options.position,e.options.vAlign=i?_:u),e.reflow(this.box))},e.prototype.arrangeNotes=function(){for(var t=0;t<this.notes.length;t++){var e=this.notes[t],i=e.options.value,o=void 0;Nr(i)?(this.shouldRenderNote(i)?e.show():e.hide(),o=this.noteSlot(i)):e.hide(),e.reflow(o||this.lineBox())}},e.prototype.noteSlot=function(t){return this.getSlot(t)},e.prototype.alignTo=function(t){var e=t.lineBox(),i=this.options.vertical,o=i?k:S;this.box.snapTo(e,o),i?this.box.shrink(0,this.lineBox().height()-e.height()):this.box.shrink(this.lineBox().width()-e.width(),0),this.box[o+1]-=this.lineBox()[o+1]-e[o+1],this.box[o+2]-=this.lineBox()[o+2]-e[o+2]},e.prototype.axisLabelText=function(t,e,i){var o,r=this,n=Pr(e),s=function(){return e.format?r.chartService.format.localeAuto(e.format,[t],e.culture):t};n?o=n(Object.assign({},i,{get text(){return s()},value:t,format:e.format,culture:e.culture})):o=s();return o},e.prototype.slot=function(t,e,i){var o=this.getSlot(t,e,i);if(o)return o.toRect()},e.prototype.contentBox=function(){var t=this.box.clone(),e=this.labels;if(e.length){var i=this.options.vertical?k:S;if(this.chartService.isPannable(i)){var o=this.maxLabelOffset();t[i+1]-=o.start,t[i+2]+=o.end}else{e[0].options.visible&&t.wrap(e[0].box);var r=e[e.length-1];r.options.visible&&t.wrap(r.box)}}return t},e.prototype.maxLabelOffset=function(){for(var t=this.options,e=t.vertical,i=t.reverse,o=this.labelsBetweenTicks(),r=this.getLabelsTickPositions(),n=e?k:S,s=this.labels,a=i?1:0,p=i?0:1,h=0,c=0,l=0;l<s.length;l++){var u=s[l],f=this.labelTickIndex(u),d=void 0,y=void 0;o?(d=r[f+a],y=r[f+p]):d=y=r[f],h=Math.max(h,d-u.box[n+1]),c=Math.max(c,u.box[n+2]-y)}return{start:h,end:c}},e.prototype.limitRange=function(t,e,i,o,r){var n=this.options;if(t<i&&r<0&&(!Nr(n.min)||n.min<=i)||o<e&&r>0&&(!Nr(n.max)||o<=n.max))return null;if(e<i&&r>0||o<t&&r<0)return{min:t,max:e};var s=e-t,a=t,p=e;return t<i&&r<0?(a=Jr(t,i,o),p=Jr(t+s,i+s,o)):e>o&&r>0&&(p=Jr(e,i,o),a=Jr(e-s,i,o-s)),{min:a,max:p}},e.prototype.valueRange=function(){return{min:this.seriesMin,max:this.seriesMax}},e.prototype.labelsBetweenTicks=function(){return!this.options.justified},e.prototype.prepareUserOptions=function(){},e}(Bn);sn(os,{labels:{visible:!0,rotation:0,mirror:!1,step:1,skip:0},line:{width:1,color:l,visible:!0},title:{visible:!0,position:f},majorTicks:{align:"outside",size:4,skip:0,step:1},minorTicks:{align:"outside",size:3,skip:0,step:1},axisCrossingValue:0,majorTickType:"outside",minorTickType:"none",majorGridLines:{skip:0,step:1},minorGridLines:{visible:!1,width:1,color:l,skip:0,step:1},margin:5,visible:!0,reverse:!1,justified:!0,notes:{label:{text:""}},_alignLines:!0,_deferLabels:!1});var rs=os,ns="days",ss="years",as={years:31536e6,months:26784e5,weeks:6048e5,days:864e5,hours:36e5,minutes:6e4,seconds:1e3,milliseconds:1};function ps(t,e){return t.getTime()-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset())}function hs(t,e){return new Date(t.getTime()+e)}function cs(t){var e;return t instanceof Date?e=t:t&&(e=new Date(t)),e}function ls(t,e){return 0===e&&23===t.getHours()&&(t.setHours(t.getHours()+2),!0)}function us(t,e,i,o){var r=t;if(t){var n=cs(t),s=n.getHours();i===ss?ls(r=new Date(n.getFullYear()+e,0,1),0):"months"===i?ls(r=new Date(n.getFullYear(),n.getMonth()+e,1),s):"weeks"===i?ls(r=us(function(t,e){void 0===e&&(e=0);var i=0,o=t.getDay();if(!isNaN(o))for(;o!==e;)0===o?o=6:o--,i++;return hs(t,864e5*-i)}(n,o),7*e,ns),s):i===ns?ls(r=new Date(n.getFullYear(),n.getMonth(),n.getDate()+e),s):"hours"===i?r=function(t,e){var i=new Date(t);i.setMinutes(0,0,0);var o=6e4*(t.getTimezoneOffset()-i.getTimezoneOffset());return hs(i,o+36e5*e)}(n,e):"minutes"===i?(r=hs(n,6e4*e)).getSeconds()>0&&r.setSeconds(0):"seconds"===i?r=hs(n,1e3*e):"milliseconds"===i&&(r=hs(n,e)),"milliseconds"!==i&&r.getMilliseconds()>0&&r.setMilliseconds(0)}return r}function fs(t,e,i){return us(cs(t),0,e,i)}function ds(t,e,i){var o=cs(t);return o&&fs(o,e,i).getTime()===o.getTime()?o:us(o,1,e,i)}function ys(t,e){return t&&e?t.getTime()-e.getTime():-1}function vs(t,e){return t.getTime()-e}function gs(t){if(C(t)){for(var e=[],i=0;i<t.length;i++)e.push(gs(t[i]));return e}if(t)return cs(t).getTime()}function ms(t,e){return t&&e?gs(t)===gs(e):t===e}function xs(t,e,i){return ps(t,e)/as[i]}function bs(t,e,i,o){var r=cs(t),n=cs(e);return("months"===i?r.getMonth()-n.getMonth()+12*(r.getFullYear()-n.getFullYear())+xs(r,new Date(r.getFullYear(),r.getMonth()),ns)/new Date(r.getFullYear(),r.getMonth()+1,0).getDate():i===ss?r.getFullYear()-n.getFullYear()+bs(r,new Date(r.getFullYear(),0),"months",1)/12:i===ns||"weeks"===i?xs(r,n,i):vs(r,e)/as[i])/o}function _s(t,e,i){return i===ss?e.getFullYear()-t.getFullYear():"months"===i?12*_s(t,e,ss)+e.getMonth()-t.getMonth():i===ns?Math.floor(vs(e,t)/864e5):Math.floor(vs(e,t)/as[i])}function ws(t,e){return Qo(e)&&t.parseDate(e)||cs(e)}function As(t,e){if(C(e)){for(var i=[],o=0;o<e.length;o++)i.push(ws(t,e[o]));return i}return ws(t,e)}function Ss(t,e){return $o(t.weekStartDay)?t.weekStartDay:e&&e.firstDay?e.firstDay():0}var ks=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(){this._ticks={}},e.prototype.categoriesHash=function(){return""},e.prototype.clone=function(){var t=new e(Object.assign({},this.options,{categories:this.options.srcCategories}),this.chartService);return t.createLabels(),t},e.prototype.initUserOptions=function(t){var e=t.categories||[],i=Nr(t.min),o=Nr(t.max);if(t.srcCategories=t.categories=e,(i||o)&&e.length){var r,n=i?Math.floor(t.min):0;r=o?t.justified?Math.floor(t.max)+1:Math.ceil(t.max):e.length,t.categories=t.categories.slice(n,r)}return t},e.prototype.rangeIndices=function(){var t=this.options,e=t.categories.length||1;return{min:$o(t.min)?t.min%1:0,max:$o(t.max)&&t.max%1!=0&&t.max<this.totalRange().max?e-(1-t.max%1):e-(t.justified?1:0)}},e.prototype.totalRangeIndices=function(t){var e,i=this.options,o=$o(i.min)?i.min:0;if(e=$o(i.max)?i.max:$o(i.min)?o+i.categories.length:this.totalRange().max||1,t){var r=this.totalRange();o=Jr(o,0,r.max),e=Jr(e,0,r.max)}return{min:o,max:e}},e.prototype.range=function(){var t=this.options;return{min:$o(t.min)?t.min:0,max:$o(t.max)?t.max:this.totalRange().max}},e.prototype.roundedRange=function(){return this.range()},e.prototype.totalRange=function(){var t=this.options;return{min:0,max:Math.max(this._seriesMax||0,t.srcCategories.length)-(t.justified?1:0)}},e.prototype.scaleOptions=function(){var t=this.rangeIndices(),e=t.min,i=t.max,o=this.lineBox();return{scale:(this.options.vertical?o.height():o.width())/(i-e||1)*(this.options.reverse?-1:1),box:o,min:e,max:i}},e.prototype.arrangeLabels=function(){t.prototype.arrangeLabels.call(this),this.hideOutOfRangeLabels()},e.prototype.hideOutOfRangeLabels=function(){var t=this.box,e=this.labels;if(e.length>0){var i=this.options.vertical?k:S,o=t[i+1],r=t[i+2],n=e[0],s=Kr(e);(n.box[i+1]>r||n.box[i+2]<o)&&(n.options.visible=!1),(s.box[i+1]>r||s.box[i+2]<o)&&(s.options.visible=!1)}},e.prototype.getMajorTickPositions=function(){return this.getTicks().majorTicks},e.prototype.getMinorTickPositions=function(){return this.getTicks().minorTicks},e.prototype.getLabelsTickPositions=function(){return this.getTicks().labelTicks},e.prototype.tickIndices=function(t){for(var e=this.rangeIndices(),i=e.min,o=e.max,r=Math.ceil(o),n=Math.floor(i),s=[];n<=r;)s.push(n),n+=t;return s},e.prototype.getTickPositions=function(t){for(var e=this.options,i=e.vertical,o=e.reverse,r=this.scaleOptions(),n=r.scale,s=r.box,a=r.min,p=s[(i?k:S)+(o?2:1)],h=this.tickIndices(t),c=[],l=0;l<h.length;l++)c.push(p+tn(n*(h[l]-a),3));return c},e.prototype.getTicks=function(){var t=this.options,e=this._ticks,i=this.rangeIndices(),o=this.lineBox(),r=o.getHash()+i.min+","+i.max+t.reverse+t.justified;if(e._hash!==r){var n=t.minorTicks.visible||t.minorGridLines.visible;e._hash=r,e.labelTicks=this.getTickPositions(1),e.majorTicks=this.filterOutOfRangePositions(e.labelTicks,o),e.minorTicks=n?this.filterOutOfRangePositions(this.getTickPositions(.5),o):[]}return e},e.prototype.filterOutOfRangePositions=function(t,e){if(!t.length)return t;for(var i=this.options.vertical?k:S,o=function(t){return e[i+1]<=t&&t<=e[i+2]},r=t.length-1,n=0;!o(t[n])&&n<=r;)n++;for(var s=r;!o(t[s])&&s>=0;)s--;return t.slice(n,s+1)},e.prototype.getSlot=function(t,e,i){var o=this.options,r=o.reverse,n=o.justified,s=o.vertical,a=this.scaleOptions(),p=a.scale,h=a.box,c=a.min,l=s?k:S,u=h[l+(r?2:1)],f=h.clone(),d=!Nr(e),y=on(t,0),v=on(e,y);v=Math.max(v-1,y);var g=u+(y-c)*p,m=u+((v=Math.max(y,v))+1-c)*p;return d&&n&&(m=g),i&&(g=Jr(g,h[l+1],h[l+2]),m=Jr(m,h[l+1],h[l+2])),f[l+1]=r?m:g,f[l+2]=r?g:m,f},e.prototype.limitSlot=function(t){var e=this.options.vertical?k:S,i=this.lineBox(),o=t.clone();return o[e+1]=Jr(t[e+1],i[e+1],i[e+2]),o[e+2]=Jr(t[e+2],i[e+1],i[e+2]),o},e.prototype.slot=function(e,i,o){var r=Math.floor(this.options.min||0),n=e,s=i;return"string"==typeof n?n=this.categoryIndex(n):$o(n)&&(n-=r),"string"==typeof s?s=this.categoryIndex(s):$o(s)&&(s-=r),t.prototype.slot.call(this,n,s,o)},e.prototype.pointCategoryIndex=function(t){var e=this.options,i=e.reverse,o=e.justified,r=e.vertical?k:S,n=this.scaleOptions(),s=n.scale,a=n.box,p=n.min,h=n.max,c=i?h:p,l=a[r+1],u=a[r+2],f=t[r];if(f<l||f>u)return null;var d=c+(f-l)/s,y=d%1;return o?d=Math.round(d):0===y&&d>0&&d--,Math.floor(d)},e.prototype.getCategory=function(t){var e=this.pointCategoryIndex(t);return null===e?null:this.options.categories[e]},e.prototype.categoryIndex=function(t){return this.totalIndex(t)-Math.floor(this.options.min||0)},e.prototype.categoryAt=function(t,e){var i=this.options;return(e?i.srcCategories:i.categories)[t]},e.prototype.categoriesCount=function(){return(this.options.categories||[]).length},e.prototype.translateRange=function(t){var e=this.options,i=this.lineBox(),o=e.vertical?i.height():i.width(),r=e.categories.length,n=tn(t/(o/r),10);return{min:n,max:r+n}},e.prototype.zoomRange=function(t){var e=this.totalRangeIndices(),i=this.totalRange(),o=i.min,r=i.max,n=Jr(e.min+t,o,r),s=Jr(e.max-t,o,r);if(s-n>0)return{min:n,max:s}},e.prototype.scaleRange=function(t){var e=this.options.categories.length,i=t*e;return{min:-i,max:e+i}},e.prototype.labelsCount=function(){var t=this.labelsRange();return t.max-t.min},e.prototype.labelsRange=function(){var t=this.options,e=t.justified,i=t.labels,o=this.totalRangeIndices(!0),r=o.min,n=o.max,s=Math.floor(r);return e?(r=Math.ceil(r),n=Math.floor(n)):(r=Math.floor(r),n=Math.ceil(n)),{min:(r>i.skip?i.skip+i.step*Math.ceil((r-i.skip)/i.step):i.skip)-s,max:(t.categories.length?n+(e?1:0):0)-s}},e.prototype.createAxisLabel=function(t,e,i){var o=this.options,r=o.dataItems?o.dataItems[t]:null,n=on(o.categories[t],"");i.dataItem=r;var s=this.axisLabelText(n,e,i);return new $n(n,s,t,r,e)},e.prototype.shouldRenderNote=function(t){var e=this.totalRangeIndices();return Math.floor(e.min)<=t&&t<=Math.ceil(e.max)},e.prototype.noteSlot=function(t){var e=this.options,i=t-Math.floor(e.min||0);return this.getSlot(i)},e.prototype.arrangeNotes=function(){t.prototype.arrangeNotes.call(this),this.hideOutOfRangeNotes()},e.prototype.hideOutOfRangeNotes=function(){var t=this.notes,e=this.box;if(t&&t.length)for(var i=this.options.vertical?k:S,o=e[i+1],r=e[i+2],n=0;n<t.length;n++){var s=t[n];s.box&&(r<s.box[i+1]||s.box[i+2]<o)&&s.hide()}},e.prototype.pan=function(t){var e=this.totalRangeIndices(!0),i=this.scaleOptions().scale,o=tn(t/i,10),r=this.totalRange(),n=e.min+o,s=e.max+o;return this.limitRange(n,s,0,r.max,o)},e.prototype.pointsRange=function(t,e){var i=this.options,o=i.reverse,r=i.vertical?k:S,n=this.totalRangeIndices(!0),s=this.scaleOptions(),a=s.scale,p=s.box[r+(o?2:1)],h=t[r]-p,c=e[r]-p,l=n.min+h/a,u=n.min+c/a,f=Math.min(l,u),d=Math.max(l,u);if(d-f>=.01)return{min:f,max:d}},e.prototype.valueRange=function(){return this.range()},e.prototype.totalIndex=function(t){var e=this.options;return this._categoriesMap?this._categoriesMap.get(t):function(t,e){if(t instanceof Date){for(var i=e.length,o=0;o<i;o++)if(ms(e[o],t))return o;return-1}return e.indexOf(t)}(t,e.srcCategories)},e.prototype.currentRangeIndices=function(){var t=this.options,e=0;return $o(t.min)&&(e=Math.floor(t.min)),{min:e,max:$o(t.max)?t.justified?Math.floor(t.max):Math.ceil(t.max)-1:this.totalCount()-1}},e.prototype.mapCategories=function(){if(!this._categoriesMap)for(var t=this._categoriesMap=new Ir,e=this.options.srcCategories,i=0;i<e.length;i++)t.set(e[i],i)},e.prototype.totalCount=function(){return Math.max(this.options.srcCategories.length,this._seriesMax||0)},e}(rs);sn(ks,{type:"category",vertical:!1,majorGridLines:{visible:!1,width:1,color:l},labels:{zIndex:1},justified:!1,_deferLabels:!0});var Cs=ks,Ps={milliseconds:"HH:mm:ss.fff",seconds:"HH:mm:ss",minutes:"HH:mm",hours:"HH:mm",days:"M/d",weeks:"M/d",months:"MMM 'yy",years:"yyyy"},Ts=["milliseconds","seconds","minutes","hours",ns,"weeks","months",ss];function Ms(t){var e=t._range;return e||((e=t._range=an(t)).min=cs(e.min),e.max=cs(e.max)),e}var Os=function(t){this.options=t};Os.prototype.displayIndices=function(){return{min:0,max:1}},Os.prototype.displayRange=function(){return{}},Os.prototype.total=function(){return{}},Os.prototype.valueRange=function(){return{}},Os.prototype.valueIndex=function(){return-1},Os.prototype.values=function(){return[]},Os.prototype.totalIndex=function(){return-1},Os.prototype.valuesCount=function(){return 0},Os.prototype.totalCount=function(){return 0},Os.prototype.dateAt=function(){return null};var Rs=function(t,e,i){this.options=i,i.baseUnitStep=i.baseUnitStep||1;var o=i.roundToBaseUnit,r=i.justified;this.start=us(t,0,i.baseUnit,i.weekStartDay);var n=this.roundToTotalStep(e),s=!r&&ms(e,n)&&!i.justifyEnd;this.end=this.roundToTotalStep(e,!r,s?1:0);var a=i.min||t;this.valueStart=this.roundToTotalStep(a),this.displayStart=o?this.valueStart:a;var p=i.max;if(p){var h=!r&&ms(p,this.roundToTotalStep(p))?-1:0;this.valueEnd=this.roundToTotalStep(p,!1,h),this.displayEnd=o?this.roundToTotalStep(p,!r):i.max}else this.valueEnd=n,this.displayEnd=o||s?this.end:e;this.valueEnd<this.valueStart&&(this.valueEnd=this.valueStart),this.displayEnd<=this.displayStart&&(this.displayEnd=this.roundToTotalStep(this.displayStart,!1,1))};function Bs(t,e,i){for(var o,r,n,s=Ms(t.categories),a=(t.max||s.max)-(t.min||s.min),p=t.autoBaseUnitSteps,h=t.maxDateGroups,c="fit"===t.baseUnit,l=e?Ts.indexOf(e):0,u=c?Ts[l++]:t.baseUnit,f=a/as[u],d=f;!r||f>=h;){o=o||p[u].slice(0);do{n=o.shift()}while(n&&e===u&&n<i);if(n)f=d/(r=n);else{if(u===Kr(Ts)){r=Math.ceil(d/h);break}if(!c){f>h&&(r=Math.ceil(d/h));break}u=Ts[l++]||Kr(Ts),d=a/as[u],o=null}}t.baseUnitStep=r,t.baseUnit=u}function js(t){var e=(t.baseUnit||"").toLowerCase();return"fit"!==e&&!Lr(e,Ts)&&function(t){for(var e,i,o=t.categories,r=Nr(o)?o.length:0,n=m,s=0;s<r;s++){var a=o[s];if(a&&e){var p=ps(a,e);p>0&&(i=(n=Math.min(n,p))>=31536e6?ss:n>=24192e5?"months":n>=6048e5?"weeks":n>=864e5?ns:n>=36e5?"hours":n>=6e4?"minutes":"seconds")}e=a}t.baseUnit=i||ns}(t),"fit"!==e&&"auto"!==t.baseUnitStep||Bs(t),t}Rs.prototype.displayRange=function(){return{min:this.displayStart,max:this.displayEnd}},Rs.prototype.displayIndices=function(){if(!this._indices){var t=this.options,e=t.baseUnit,i=t.baseUnitStep,o=bs(this.displayStart,this.valueStart,e,i),r=bs(this.displayEnd,this.valueStart,e,i);this._indices={min:o,max:r}}return this._indices},Rs.prototype.total=function(){return{min:this.start,max:this.end}},Rs.prototype.totalCount=function(){return this.totalIndex(this.end)+(this.options.justified?1:0)},Rs.prototype.valueRange=function(){return{min:this.valueStart,max:this.valueEnd}},Rs.prototype.valueIndex=function(t){var e=this.options;return Math.floor(bs(t,this.valueStart,e.baseUnit,e.baseUnitStep))},Rs.prototype.totalIndex=function(t){var e=this.options;return Math.floor(bs(t,this.start,e.baseUnit,e.baseUnitStep))},Rs.prototype.dateIndex=function(t){var e=this.options;return bs(t,this.valueStart,e.baseUnit,e.baseUnitStep)},Rs.prototype.valuesCount=function(){return this.valueIndex(this.valueEnd)+1},Rs.prototype.values=function(){var t=this._values;if(!t){var e=this.options,i=this.valueRange();this._values=t=[];for(var o=i.min;o<=i.max;)t.push(o),o=us(o,e.baseUnitStep,e.baseUnit,e.weekStartDay)}return t},Rs.prototype.dateAt=function(t,e){var i=this.options;return us(e?this.start:this.valueStart,i.baseUnitStep*t,i.baseUnit,i.weekStartDay)},Rs.prototype.roundToTotalStep=function(t,e,i){var o=this.options,r=o.baseUnit,n=o.baseUnitStep,s=o.weekStartDay,a=this.start,p=bs(t,a,r,n),h=e?Math.ceil(p):Math.floor(p);return i&&(h+=i),us(a,h*n,r,s)};var Is=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){var t=new e(Object.assign({},this.options),this.chartService);return t.createLabels(),t},e.prototype.categoriesHash=function(){var t=this.dataRange.total().min;return this.options.baseUnit+this.options.baseUnitStep+t},e.prototype.initUserOptions=function(t){return t},e.prototype.initFields=function(){t.prototype.initFields.call(this);var e=this.chartService,i=e.intl,o=this.options,r=o.categories||[];if(r._parsed||((r=As(i,r))._parsed=!0),o=or({roundToBaseUnit:!0},o,{categories:r,min:ws(i,o.min),max:ws(i,o.max),weekStartDay:Ss(o,i)}),e.panning&&e.isPannable(o.vertical?k:S)&&(o.roundToBaseUnit=!1),o.userSetBaseUnit=o.userSetBaseUnit||o.baseUnit,o.userSetBaseUnitStep=o.userSetBaseUnitStep||o.baseUnitStep,this.options=o,o.srcCategories=r,r.length>0){var n=Ms(r),s=o.maxDivisions;if(this.dataRange=new Rs(n.min,n.max,js(o)),s){var a=this.dataRange.displayRange(),p=Object.assign({},o,{justified:!0,roundToBaseUnit:!1,baseUnit:"fit",min:a.min,max:a.max,maxDateGroups:s}),h=this.dataRange.options;Bs(p,h.baseUnit,h.baseUnitStep),this.divisionRange=new Rs(n.min,n.max,p)}else this.divisionRange=this.dataRange}else o.baseUnit=o.baseUnit||ns,this.dataRange=this.divisionRange=new Os(o);this.rangeLabels=[]},e.prototype.tickIndices=function(e){var i=this.dataRange,o=this.divisionRange,r=o.valuesCount();if(!this.options.maxDivisions||!r)return t.prototype.tickIndices.call(this,e);var n=[],s=o.values(),a=0;this.options.justified||(s=s.concat(o.dateAt(r)),a=.5);for(var p=0;p<s.length;p++)if(n.push(i.dateIndex(s[p])+a),1!==e&&p>=1){var h=n.length-1;n.splice(p,0,n[h-1]+(n[h]-n[h-1])*e)}return n},e.prototype.shouldRenderNote=function(t){var e=this.range(),i=this.options.categories||[];return ys(t,e.min)>=0&&ys(t,e.max)<=0&&i.length},e.prototype.parseNoteValue=function(t){return ws(this.chartService.intl,t)},e.prototype.noteSlot=function(t){return this.getSlot(t)},e.prototype.translateRange=function(t){var e=this.options,i=e.baseUnit,o=e.weekStartDay,r=e.vertical,n=this.lineBox(),s=r?n.height():n.width(),a=this.range(),p=s/(a.max-a.min),h=tn(t/p,10);if(a.min&&a.max){var c=hs(e.min||a.min,h),l=hs(e.max||a.max,h);a={min:us(c,0,i,o),max:us(l,0,i,o)}}return a},e.prototype.scaleRange=function(t){var e=Math.abs(t),i=this.range(),o=i.min,r=i.max;if(o&&r){for(;e--;){var n=vs(o,r),s=Math.round(.1*n);t<0?(o=hs(o,s),r=hs(r,-s)):(o=hs(o,-s),r=hs(r,s))}i={min:o,max:r}}return i},e.prototype.labelsRange=function(){return{min:this.options.labels.skip,max:this.divisionRange.valuesCount()}},e.prototype.pan=function(t){if(this.isEmpty())return null;var e=this.options,i=this.lineBox(),o=e.vertical?i.height():i.width(),r=this.dataRange.displayRange(),n=r.min,s=r.max,a=this.dataRange.total(),p=tn(t/(o/(s-n)),10)*(e.reverse?-1:1),h=hs(n,p),c=hs(s,p),l=this.limitRange(gs(h),gs(c),gs(a.min),gs(a.max),p);return l?(l.min=cs(l.min),l.max=cs(l.max),l.baseUnit=e.baseUnit,l.baseUnitStep=e.baseUnitStep||1,l.userSetBaseUnit=e.userSetBaseUnit,l.userSetBaseUnitStep=e.userSetBaseUnitStep,l):void 0},e.prototype.pointsRange=function(e,i){if(this.isEmpty())return null;var o=t.prototype.pointsRange.call(this,e,i),r=this.dataRange.displayRange(),n=this.dataRange.displayIndices(),s=vs(r.max,r.min)/(n.max-n.min),a=this.options;return{min:hs(r.min,o.min*s),max:hs(r.min,o.max*s),baseUnit:a.userSetBaseUnit||a.baseUnit,baseUnitStep:a.userSetBaseUnitStep||a.baseUnitStep}},e.prototype.zoomRange=function(t){if(this.isEmpty())return null;var e=this.options,i="fit"===e.userSetBaseUnit,o=this.dataRange.total(),r=this.dataRange.displayRange(),n=r.min,s=r.max,a=this.dataRange.options,p=a.weekStartDay,h=a.baseUnit,c=a.baseUnitStep,l=us(n,t*c,h,p),u=us(s,-t*c,h,p);if(i){var f,d,y=e.autoBaseUnitSteps,v=e.maxDateGroups,g=Kr(y[h])*v*as[h],m=vs(s,n),x=vs(u,l),b=Ts.indexOf(h);if(x<as[h]&&"milliseconds"!==h)h=Ts[b-1],l=hs(n,d=(m-(v-1)*(f=Kr(y[h]))*as[h])/2),u=hs(s,-d);else if(x>g&&h!==ss){var _=0;do{b++,h=Ts[b],_=0,d=2*as[h];do{f=y[h][_],_++}while(_<y[h].length&&d*f<m)}while(h!==ss&&d*f<m);(d=(d*f-m)/2)>0&&(l=hs(n,-d),u=hs(s,d),l=hs(l,Jr(u,o.min,o.max)-u),u=hs(u,Jr(l,o.min,o.max)-l))}}return l<o.min&&(l=o.min),u>o.max&&(u=o.max),l&&u&&vs(u,l)>0?{min:l,max:u,baseUnit:e.userSetBaseUnit||e.baseUnit,baseUnitStep:e.userSetBaseUnitStep||e.baseUnitStep}:void 0},e.prototype.range=function(){return this.dataRange.displayRange()},e.prototype.createLabels=function(){t.prototype.createLabels.call(this),this.createRangeLabels()},e.prototype.clearLabels=function(){t.prototype.clearLabels.call(this),this.rangeLabels=[]},e.prototype.arrangeLabels=function(){this.arrangeRangeLabels(),t.prototype.arrangeLabels.call(this)},e.prototype.arrangeRangeLabels=function(){var t=this.options,e=this.rangeLabels;if(0!==e.length){var i=this.lineBox(),o=t.vertical,r=t.rangeLabels.mirror||t.labels.mirror,n=e[0];if(n){var s=o?i.y1-n.box.height()/2:i.x1;this.positionLabel(n,r,s)}var a=e[1];if(a){var p=o?i.y2-a.box.height()/2:i.x2;this.positionLabel(a,r,p)}}},e.prototype.autoRotateLabels=function(){t.prototype.autoRotateLabels.call(this),this.autoRotateRangeLabels()},e.prototype.hideOutOfRangeLabels=function(){t.prototype.hideOutOfRangeLabels.call(this),this.hideOverlappingLabels()},e.prototype.hideOverlappingLabels=function(){var t=this.rangeLabels,e=this.labels;if(0!==t.length){var i=t[0];if(i&&i.options.visible)for(var o=0;o<e.length;o++){if(!s(i,e[o]))break}var r=t[1];if(r&&r.options.visible)for(var n=e.length-1;n>0;--n){if(!s(r,e[n]))break}}function s(t,e){return!(e.options.visible&&!e.box.overlaps(t.box))&&(e.options.visible=!1,!0)}},e.prototype.contentBox=function(){for(var e=t.prototype.contentBox.call(this),i=this.rangeLabels,o=0;o<i.length;o++){var r=i[o];r.options.visible&&e.wrap(r.box)}return e},e.prototype.createAxisLabel=function(t,e,i){void 0===i&&(i={});var o=this.options,r=o.dataItems&&!o.maxDivisions?o.dataItems[t]:null,n=this.divisionRange.dateAt(t),s=e.dateFormats[this.divisionRange.options.baseUnit];e.format=e.format||s,i.dataItem=r;var a=this.axisLabelText(n,e,i);if(a)return new $n(n,a,t,r,e)},e.prototype.createRangeLabels=function(){var t=this,e=this.divisionRange,i=e.displayStart,o=e.displayEnd,r=this.options,n=Object.assign({},r.labels,r.rangeLabels,{align:f,zIndex:r.zIndex});if(!0===n.visible){this.normalizeLabelRotation(n),n.alignRotation=f,"auto"===n.rotation&&(n.rotation=0,r.autoRotateRangeLabels=!0);var s=n.dateFormats[this.divisionRange.options.baseUnit];n.format=n.format||s;var a=function(e,i,o){if(o){var r=new $n(i,o,e,null,n);t.append(r),t.rangeLabels.push(r)}};a(0,i,this.axisLabelText(i,n,{index:0,count:2})),a(1,o,this.axisLabelText(o,n,{index:1,count:2}))}},e.prototype.autoRotateRangeLabels=function(){var t=this,e=this.rangeLabels;if(this.options.autoRotateRangeLabels&&!this.options.vertical&&2===e.length){var i=function(e,i,o){var r=2*Math.abs(i[o+1]-i[o]),n=t.autoRotateLabelAngle(e.box,r);0!==n&&(e.options.rotation=n,e.reflow(new kn))},o=this.getMajorTickPositions();i(e[0],o,0),i(e[1],o,o.length-2)}},e.prototype.categoryIndex=function(t){return this.dataRange.valueIndex(t)},e.prototype.slot=function(t,e,i){var o=this.dataRange,r=t,n=e;r instanceof Date&&(r=o.dateIndex(r)),n instanceof Date&&(n=o.dateIndex(n));var s=this.getSlot(r,n,i);if(s)return s.toRect()},e.prototype.getSlot=function(e,i,o){var r=e,n=i;return"object"==typeof r&&(r=this.categoryIndex(r)),"object"==typeof n&&(n=this.categoryIndex(n)),t.prototype.getSlot.call(this,r,n,o)},e.prototype.valueRange=function(){var t=Ms(this.options.srcCategories);return{min:cs(t.min),max:cs(t.max)}},e.prototype.categoryAt=function(t,e){return this.dataRange.dateAt(t,e)},e.prototype.categoriesCount=function(){return this.dataRange.valuesCount()},e.prototype.rangeIndices=function(){return this.dataRange.displayIndices()},e.prototype.labelsBetweenTicks=function(){return!this.divisionRange.options.justified},e.prototype.prepareUserOptions=function(){this.isEmpty()||(this.options.categories=this.dataRange.values())},e.prototype.getCategory=function(t){var e=this.pointCategoryIndex(t);return null===e?null:this.dataRange.dateAt(e)},e.prototype.totalIndex=function(t){return this.dataRange.totalIndex(t)},e.prototype.currentRangeIndices=function(){var t=this.dataRange.valueRange();return{min:this.dataRange.totalIndex(t.min),max:this.dataRange.totalIndex(t.max)}},e.prototype.totalRange=function(){return this.dataRange.total()},e.prototype.totalCount=function(){return this.dataRange.totalCount()},e.prototype.isEmpty=function(){return!this.options.srcCategories.length},e.prototype.roundedRange=function(){if(!1!==this.options.roundToBaseUnit||this.isEmpty())return this.range();var t=this.options,e=Ms(t.srcCategories);return new Rs(e.min,e.max,Object.assign({},t,{justified:!1,roundToBaseUnit:!0,justifyEnd:t.justified})).displayRange()},e}(Cs);sn(Is,{type:y,labels:{dateFormats:Ps},rangeLabels:{visible:!1},autoBaseUnitSteps:{milliseconds:[1,10,100],seconds:[1,2,5,15,30],minutes:[1,2,5,15,30],hours:[1,2,3],days:[1,2,3],weeks:[1,2],months:[1,2,3,6],years:[1,2,3,5,10,25,50]},maxDateGroups:10});var Ls=Is;function zs(t,e){return tn(Math.floor(t/e)*e,10)}function Es(t,e){return tn(Math.ceil(t/e)*e,10)}function Vs(t){return Math.max(Math.min(t,3e5),-3e5)}var Fs=Math.pow(10,-9),Ds=function(t){function e(e,i,o,r){t.call(this,Object.assign({},o,{seriesMin:e,seriesMax:i}),r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initUserOptions=function(t){var e=function(t,e,i){var o=i.narrowRange,r=function(t,e,i){if(!t&&!e)return 0;var o;if(t>=0&&e>=0){var r=t===e?0:t;if(!1===i||!i&&(e-r)/e>.2)return 0;o=Math.max(0,r-(e-r)/2)}else o=t;return o}(t,e,o),n=function(t,e,i){if(!t&&!e)return 1;var o;if(t<=0&&e<=0){var r=t===e?0:e,n=Math.abs((r-t)/r);if(!1===i||!i&&n>.2)return 0;o=Math.min(0,r-(t-r)/2)}else o=e;return o}(t,e,o),s=wn(r,n),a={majorUnit:s};!1!==i.roundToMajorUnit&&(r<0&&Us(r,s,1/3)&&(r-=s),n>0&&Us(n,s,1/3)&&(n+=s));return a.min=zs(r,s),a.max=Es(n,s),a}(t.seriesMin,t.seriesMax,t);return this.totalOptions=function(t,e){return{min:Nr(e.min)?Math.min(t.min,e.min):t.min,max:Nr(e.max)?Math.max(t.max,e.max):t.max,majorUnit:t.majorUnit}}(e,t),function(t,e){var i,o,r=e;if(e){!function(t,e){for(var i=0;i<e.length;i++){var o=e[i];null===t[o]&&(t[o]=void 0)}}(e,["min","max"]),i=Nr(e.min),o=Nr(e.max);var n=i||o;n&&e.min===e.max&&(e.min>0?e.min=0:e.max=1),e.majorUnit?(t.min=zs(t.min,e.majorUnit),t.max=Es(t.max,e.majorUnit)):n&&(r=or(t,e),t.majorUnit=wn(r.min,r.max))}t.minorUnit=(r.majorUnit||t.majorUnit)/5;var s=or(t,r);s.min>=s.max&&(i&&!o?s.max=s.min+s.majorUnit:!i&&o&&(s.min=s.max-s.majorUnit));return s}(e,t)},e.prototype.initFields=function(){this.totalMin=this.totalOptions.min,this.totalMax=this.totalOptions.max,this.totalMajorUnit=this.totalOptions.majorUnit,this.seriesMin=this.options.seriesMin,this.seriesMax=this.options.seriesMax},e.prototype.clone=function(){return new e(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)},e.prototype.startValue=function(){return 0},e.prototype.range=function(){var t=this.options;return{min:t.min,max:t.max}},e.prototype.getDivisions=function(t){if(0===t)return 1;var e=this.options,i=e.max-e.min;return Math.floor(tn(i/t,3))+1},e.prototype.getTickPositions=function(t,e){var i=this.options,o=i.vertical,r=i.reverse,n=this.lineBox(),s=t*((o?n.height():n.width())/(i.max-i.min)),a=this.getDivisions(t),p=(o?-1:1)*(r?-1:1),h=[],c=n[(o?k:S)+(1===p?1:2)],l=0;e&&(l=e/t);for(var u=0;u<a;u++)u%l!=0&&h.push(tn(c,3)),c+=s*p;return h},e.prototype.getMajorTickPositions=function(){return this.getTickPositions(this.options.majorUnit)},e.prototype.getMinorTickPositions=function(){return this.getTickPositions(this.options.minorUnit)},e.prototype.getSlot=function(t,e,i){void 0===i&&(i=!1);var o,r,n=this.options,s=n.vertical,a=n.reverse,p=s?k:S,h=this.lineBox(),c=h[p+(a?2:1)],l=(a?-1:1)*((s?h.height():h.width())/(n.max-n.min)),u=new kn(h.x1,h.y1,h.x1,h.y1),f=t,d=e;return Nr(f)||(f=d||0),Nr(d)||(d=f||0),i&&(f=Math.max(Math.min(f,n.max),n.min),d=Math.max(Math.min(d,n.max),n.min)),s?(o=n.max-Math.max(f,d),r=n.max-Math.min(f,d)):(o=Math.min(f,d)-n.min,r=Math.max(f,d)-n.min),u[p+1]=Vs(c+l*(a?r:o)),u[p+2]=Vs(c+l*(a?o:r)),u},e.prototype.getValue=function(t){var e=this.options,i=e.vertical,o=e.reverse,r=Number(e.max),n=Number(e.min),s=i?k:S,a=this.lineBox(),p=a[s+(o?2:1)],h=i?a.height():a.width(),c=(o?-1:1)*(t[s]-p),l=c*((r-n)/h);return c<0||c>h?null:tn(i?r-l:n+l,10)},e.prototype.translateRange=function(t){var e=this.options,i=e.vertical,o=e.reverse,r=e.max,n=e.min,s=this.lineBox(),a=i?s.height():s.width(),p=tn(t/(a/(r-n)),10);return!i&&!o||i&&o||(p=-p),{min:n+p,max:r+p,offset:p}},e.prototype.scaleRange=function(t){var e=this.options,i=-t*e.majorUnit;return{min:e.min-i,max:e.max+i}},e.prototype.labelsCount=function(){return this.getDivisions(this.options.majorUnit)},e.prototype.createAxisLabel=function(t,e,i){var o=this.options,r=tn(o.min+t*o.majorUnit,10),n=this.axisLabelText(r,e,i);return new $n(r,n,t,null,e)},e.prototype.shouldRenderNote=function(t){var e=this.range();return e.min<=t&&t<=e.max},e.prototype.pan=function(t){var e=this.translateRange(t);return this.limitRange(e.min,e.max,this.totalMin,this.totalMax,e.offset)},e.prototype.pointsRange=function(t,e){var i=this.getValue(t),o=this.getValue(e),r=Math.min(i,o),n=Math.max(i,o);if(this.isValidRange(r,n))return{min:r,max:n}},e.prototype.zoomRange=function(t){var e=this.totalMin,i=this.totalMax,o=this.scaleRange(t),r=Jr(o.min,e,i),n=Jr(o.max,e,i);if(this.isValidRange(r,n))return{min:r,max:n}},e.prototype.isValidRange=function(t,e){return e-t>Fs},e}(rs);function Us(t,e,i){var o=tn(Math.abs(t%e),10);return 0===o||o>e*(1-i)}sn(Ds,{type:"numeric",min:0,max:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:l},labels:{format:"#.####################"},zIndex:1});var Hs=Ds,Gs=function(t){function e(e,i,o,r){var n=cs(e),s=cs(i),a=r.intl,p=o||{};p=function(t,e,i){var o=i.min||t,r=i.max||e,n=i.baseUnit||(r&&o?function(t){var e="hours";t>=31536e6?e=ss:t>=26784e5?e="months":t>=6048e5?e="weeks":t>=864e5&&(e=ns);return e}(ps(r,o)):"hours"),s=as[n],a=i.weekStartDay||0,p=fs(gs(o)-1,n,a)||cs(r),h=ds(gs(r)+1,n,a),c=(i.majorUnit?i.majorUnit:void 0)||Es(wn(p.getTime(),h.getTime()),s)/s,l=_s(p,h,n),u=Es(l,c)-l,f=Math.floor(u/2),d=u-f;i.baseUnit||delete i.baseUnit;return i.baseUnit=i.baseUnit||n,i.min=i.min||us(p,-f,n,a),i.max=i.max||us(h,d,n,a),i.minorUnit=i.minorUnit||c/5,i.majorUnit=c,i}(n,s,p=or(p||{},{min:ws(a,p.min),max:ws(a,p.max),axisCrossingValue:As(a,p.axisCrossingValues||p.axisCrossingValue),weekStartDay:Ss(p,a)})),t.call(this,p,r),this.intlService=a,this.seriesMin=n,this.seriesMax=s;var h=p.weekStartDay||0;this.totalMin=gs(fs(gs(n)-1,p.baseUnit,h)),this.totalMax=gs(ds(gs(s)+1,p.baseUnit,h))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)},e.prototype.range=function(){var t=this.options;return{min:t.min,max:t.max}},e.prototype.getDivisions=function(t){var e=this.options;return Math.floor(_s(e.min,e.max,e.baseUnit)/t+1)},e.prototype.getTickPositions=function(t){for(var e=this.options,i=e.vertical,o=this.lineBox(),r=(i?-1:1)*(e.reverse?-1:1),n=o[(i?k:S)+(1===r?1:2)],s=this.getDivisions(t),a=vs(e.max,e.min),p=(i?o.height():o.width())/a,h=e.weekStartDay||0,c=[n],l=1;l<s;l++){var u=n+vs(us(e.min,l*t,e.baseUnit,h),e.min)*p*r;c.push(tn(u,3))}return c},e.prototype.getMajorTickPositions=function(){return this.getTickPositions(this.options.majorUnit)},e.prototype.getMinorTickPositions=function(){return this.getTickPositions(this.options.minorUnit)},e.prototype.getSlot=function(t,e,i){return Hs.prototype.getSlot.call(this,ws(this.intlService,t),ws(this.intlService,e),i)},e.prototype.getValue=function(t){var e=Hs.prototype.getValue.call(this,t);return null!==e?cs(e):null},e.prototype.labelsCount=function(){return this.getDivisions(this.options.majorUnit)},e.prototype.createAxisLabel=function(t,e,i){var o=this.options,r=t*o.majorUnit,n=o.weekStartDay||0,s=o.min;r>0&&(s=us(s,r,o.baseUnit,n));var a=e.dateFormats[o.baseUnit];e.format=e.format||a;var p=this.axisLabelText(s,e,i);return new $n(s,p,t,null,e)},e.prototype.translateRange=function(t,e){var i=this.options,o=i.baseUnit,r=i.weekStartDay||0,n=this.lineBox(),s=i.vertical?n.height():n.width(),a=this.range(),p=s/vs(a.max,a.min),h=tn(t/p,10)*(i.reverse?-1:1),c=hs(i.min,h),l=hs(i.max,h);return e||(c=us(c,0,o,r),l=us(l,0,o,r)),{min:c,max:l,offset:h}},e.prototype.scaleRange=function(t){for(var e=this.options,i=e.min,o=e.max,r=Math.abs(t);r--;){var n=vs(i,o),s=Math.round(.1*n);t<0?(i=hs(i,s),o=hs(o,-s)):(i=hs(i,-s),o=hs(o,s))}return{min:i,max:o}},e.prototype.shouldRenderNote=function(t){var e=this.range();return ys(t,e.min)>=0&&ys(t,e.max)<=0},e.prototype.pan=function(t){var e=this.translateRange(t,!0),i=this.limitRange(gs(e.min),gs(e.max),this.totalMin,this.totalMax,e.offset);if(i)return{min:cs(i.min),max:cs(i.max)}},e.prototype.pointsRange=function(t,e){var i=this.getValue(t),o=this.getValue(e),r=Math.min(i,o),n=Math.max(i,o);return{min:cs(r),max:cs(n)}},e.prototype.zoomRange=function(t){var e=this.scaleRange(t);return{min:cs(Jr(gs(e.min),this.totalMin,this.totalMax)),max:cs(Jr(gs(e.max),this.totalMin,this.totalMax))}},e}(rs);sn(Gs,{type:y,majorGridLines:{visible:!0,width:1,color:l},labels:{dateFormats:Ps}});var Ns=Gs,Ws=function(t){function e(e,i,o,r){var n=or({majorUnit:10,min:e,max:i},o),s=n.majorUnit,a=function(t,e){var i,o=tn(Xs(t,e),10)%1;i=t<=0?e:0!==o&&(o<.3||o>.9)?Math.pow(e,Xs(t,e)+.2):Math.pow(e,Math.ceil(Xs(t,e)));return i}(i,s),p=function(t,e,i){var o=i.majorUnit,r=t;t<=0?r=e<=1?Math.pow(o,-2):1:i.narrowRange||(r=Math.pow(o,Math.floor(Xs(t,o))));return r}(e,i,n),h=function(t,e,i,o){var r=i.min,n=i.max;Nr(i.axisCrossingValue)&&i.axisCrossingValue<=0&&qs();Nr(o.max)?o.max<=0&&qs():n=e;Nr(o.min)?o.min<=0&&qs():r=t;return{min:r,max:n}}(p,a,n,o);n.max=h.max,n.min=h.min,n.minorUnit=o.minorUnit||tn(s-1,10),t.call(this,n,r),this.totalMin=Nr(o.min)?Math.min(p,o.min):p,this.totalMax=Nr(o.max)?Math.max(a,o.max):a,this.logMin=tn(Xs(h.min,s),10),this.logMax=tn(Xs(h.max,s),10),this.seriesMin=e,this.seriesMax=i,this.createLabels()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)},e.prototype.startValue=function(){return this.options.min},e.prototype.getSlot=function(t,e,i){var o,r,n=this.options,s=this.logMin,a=this.logMax,p=n.reverse,h=n.vertical,c=n.majorUnit,l=h?k:S,u=this.lineBox(),f=u[l+(p?2:1)],d=(p?-1:1)*((h?u.height():u.width())/(a-s)),y=new kn(u.x1,u.y1,u.x1,u.y1),v=t,g=e;return Nr(v)||(v=g||1),Nr(g)||(g=v||1),v<=0||g<=0?null:(i&&(v=Math.max(Math.min(v,n.max),n.min),g=Math.max(Math.min(g,n.max),n.min)),v=Xs(v,c),g=Xs(g,c),h?(o=a-Math.max(v,g),r=a-Math.min(v,g)):(o=Math.min(v,g)-s,r=Math.max(v,g)-s),y[l+1]=Vs(f+d*(p?r:o)),y[l+2]=Vs(f+d*(p?o:r)),y)},e.prototype.getValue=function(t){var e=this.options,i=this.logMin,o=this.logMax,r=e.reverse,n=e.vertical,s=e.majorUnit,a=this.lineBox(),p=n===r?1:-1,h=1===p?1:2,c=n?a.height():a.width(),l=(o-i)/c,u=n?k:S,f=a[u+h],d=p*(t[u]-f);if(d<0||d>c)return null;var y=i+d*l;return tn(Math.pow(s,y),10)},e.prototype.range=function(){var t=this.options;return{min:t.min,max:t.max}},e.prototype.scaleRange=function(t){var e=this.options.majorUnit,i=-t;return{min:Math.pow(e,this.logMin-i),max:Math.pow(e,this.logMax+i)}},e.prototype.translateRange=function(t){var e=this.options,i=this.logMin,o=this.logMax,r=e.reverse,n=e.vertical,s=e.majorUnit,a=this.lineBox(),p=n?a.height():a.width(),h=tn(t/(p/(o-i)),10);return!n&&!r||n&&r||(h=-h),{min:Math.pow(s,i+h),max:Math.pow(s,o+h),offset:h}},e.prototype.labelsCount=function(){var t=Math.floor(this.logMax);return Math.floor(t-this.logMin)+1},e.prototype.getMajorTickPositions=function(){var t=[];return this.traverseMajorTicksPositions((function(e){t.push(e)}),{step:1,skip:0}),t},e.prototype.createTicks=function(t){var e=this.options,i=e.majorTicks,o=e.minorTicks,r=e.vertical,n=e.labels.mirror,s=this.lineBox(),a={vertical:r};function p(e,i){a.tickX=n?s.x2:s.x2-i.size,a.tickY=n?s.y1-i.size:s.y1,a.position=e,t.append(es(a,i))}return i.visible&&this.traverseMajorTicksPositions(p,i),o.visible&&this.traverseMinorTicksPositions(p,o),[]},e.prototype.createGridLines=function(t){var e=this.options,i=e.minorGridLines,o=e.majorGridLines,r=e.vertical,n=t.lineBox(),s={lineStart:n[r?"x1":"y1"],lineEnd:n[r?"x2":"y2"],vertical:r},a=[],p=this.gridLinesVisual();function h(t,e){Lr(t,a)||(s.position=t,p.append(is(s,e)),a.push(t))}return o.visible&&this.traverseMajorTicksPositions(h,o),i.visible&&this.traverseMinorTicksPositions(h,i),p.children},e.prototype.traverseMajorTicksPositions=function(t,e){for(var i=this._lineOptions(),o=i.lineStart,r=i.step,n=this.logMin,s=this.logMax,a=Math.ceil(n)+e.skip;a<=s;a+=e.step){t(tn(o+r*(a-n),10),e)}},e.prototype.traverseMinorTicksPositions=function(t,e){for(var i=this.options,o=i.min,r=i.max,n=i.minorUnit,s=i.majorUnit,a=this._lineOptions(),p=a.lineStart,h=a.step,c=this.logMin,l=this.logMax,u=Math.floor(c);u<l;u++)for(var f=this._minorIntervalOptions(u),d=e.skip;d<n;d+=e.step){var y=f.value+d*f.minorStep;if(y>r)break;if(y>=o)t(tn(p+h*(Xs(y,s)-c),10),e)}},e.prototype.createAxisLabel=function(t,e,i){var o=Math.ceil(this.logMin+t),r=Math.pow(this.options.majorUnit,o),n=this.axisLabelText(r,e,i);return new $n(r,n,t,null,e)},e.prototype.shouldRenderNote=function(t){var e=this.range();return e.min<=t&&t<=e.max},e.prototype.pan=function(t){var e=this.translateRange(t);return this.limitRange(e.min,e.max,this.totalMin,this.totalMax,e.offset)},e.prototype.pointsRange=function(t,e){var i=this.getValue(t),o=this.getValue(e);return{min:Math.min(i,o),max:Math.max(i,o)}},e.prototype.zoomRange=function(t){var e=this.options,i=this.totalMin,o=this.totalMax,r=this.scaleRange(t),n=Jr(r.min,i,o),s=Jr(r.max,i,o),a=e.majorUnit,p=s>n&&e.min&&e.max&&tn(Xs(e.max,a)-Xs(e.min,a),10)<1,h=!(e.min===i&&e.max===o)&&tn(Xs(s,a)-Xs(n,a),10)>=1;if(p||h)return{min:n,max:s}},e.prototype._minorIntervalOptions=function(t){var e=this.options,i=e.minorUnit,o=e.majorUnit,r=Math.pow(o,t);return{value:r,minorStep:(Math.pow(o,t+1)-r)/i}},e.prototype._lineOptions=function(){var t=this.options,e=t.reverse,i=t.vertical,o=i?k:S,r=this.lineBox(),n=i===e?1:-1,s=1===n?1:2;return{step:n*((i?r.height():r.width())/(this.logMax-this.logMin)),lineStart:r[o+s],lineBox:r}},e}(rs);function qs(){throw new Error("Non positive values cannot be used for a logarithmic axis")}function Xs(t,e){return Math.log(t)/Math.log(e)}sn(Ws,{type:"log",majorUnit:10,minorUnit:1,axisCrossingValue:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:l},zIndex:1,_deferLabels:!0});var Ys=Ws,Zs={createGridLines:function(t){var e,i,o=this.options,r=Math.abs(this.box.center().y-t.lineBox().y1),n=[],s=!1;return o.majorGridLines.visible&&(e=this.majorGridLineAngles(t),s=!0,n=this.renderMajorGridLines(e,r,o.majorGridLines)),o.minorGridLines.visible&&(i=this.minorGridLineAngles(t,s),Hr(n,this.renderMinorGridLines(i,r,o.minorGridLines,t,s))),n},renderMajorGridLines:function(t,e,i){return this.renderGridLines(t,e,i)},renderMinorGridLines:function(t,e,i,o,r){var n=this.radiusCallback&&this.radiusCallback(e,o,r);return this.renderGridLines(t,e,i,n)},renderGridLines:function(t,e,i,o){for(var r={stroke:{width:i.width,color:i.color,dashType:i.dashType}},n=this.box.center(),s=new p.Circle([n.x,n.y],e),h=this.gridLinesVisual(),c=0;c<t.length;c++){var l=new a.Path(r);o&&(s.radius=o(t[c])),l.moveTo(s.center).lineTo(s.pointAt(t[c]+180)),h.append(l)}return h.children},gridLineAngles:function(t,e,i,o,r){var n=this,s=this.intervals(e,i,o,r),a=t.options,p=a.visible&&!1!==(a.line||{}).visible;return Fr(s,(function(t){var e=n.intervalAngle(t);if(!p||90!==e)return e}))}},Ks=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.range=function(){return{min:0,max:this.options.categories.length}},e.prototype.reflow=function(t){this.box=t,this.reflowLabels()},e.prototype.lineBox=function(){return this.box},e.prototype.reflowLabels=function(){for(var t=this.labels,e=this.options.labels,i=e.skip||0,o=e.step||1,r=new kn,n=0;n<t.length;n++){t[n].reflow(r);var s=t[n].box;t[n].reflow(this.getSlot(i+n*o).adjacentBox(0,s.width(),s.height()))}},e.prototype.intervals=function(t,e,i,o){void 0===o&&(o=!1);for(var r=this.options,n=r.categories.length/t||1,s=360/n,a=i||1,p=[],h=0,c=e||0;c<n;c+=a)h=r.reverse?360-c*s:c*s,h=tn(h,3)%360,o&&Lr(h,o)||p.push(h);return p},e.prototype.majorIntervals=function(){return this.intervals(1)},e.prototype.minorIntervals=function(){return this.intervals(.5)},e.prototype.intervalAngle=function(t){return(360+t+this.options.startAngle)%360},e.prototype.majorAngles=function(){var t=this;return Fr(this.majorIntervals(),(function(e){return t.intervalAngle(e)}))},e.prototype.createLine=function(){return[]},e.prototype.majorGridLineAngles=function(t){var e=this.options.majorGridLines;return this.gridLineAngles(t,1,e.skip,e.step)},e.prototype.minorGridLineAngles=function(t,e){var i=this.options,o=i.minorGridLines,r=i.majorGridLines,n=e?this.intervals(1,r.skip,r.step):null;return this.gridLineAngles(t,.5,o.skip,o.step,n)},e.prototype.radiusCallback=function(t,e,i){if(e.options.type!==c){var o=Qr(360/(2*this.options.categories.length)),r=Math.cos(o)*t,n=this.majorAngles(),s=function(e){return!i&&Lr(e,n)?t:r};return s}},e.prototype.createPlotBands=function(){for(var t=this.options.plotBands||[],e=this._plotbandGroup=new a.Group({zIndex:-1}),i=0;i<t.length;i++){var o=t[i],r=this.plotBandSlot(o),n=this.getSlot(o.from),s=o.from-Math.floor(o.from);r.startAngle+=s*n.angle;var p=Math.ceil(o.to)-o.to;r.angle-=(p+s)*n.angle;var h=On.current.createRing(r,{fill:{color:o.color,opacity:o.opacity},stroke:{opacity:o.opacity}});e.append(h)}this.appendVisual(e)},e.prototype.plotBandSlot=function(t){return this.getSlot(t.from,t.to-1)},e.prototype.getSlot=function(t,e){var i=this.options,o=i.justified,r=this.box,n=this.majorAngles(),s=n.length,a=360/s,p=t;i.reverse&&!o&&(p=(p+1)%s);var h=n[p=Jr(Math.floor(p),0,s-1)];o&&(h-=a/2)<0&&(h+=360);var c=a*(Jr(Math.ceil(e||p),p,s-1)-p+1);return new Pn(r.center(),0,r.height()/2,h,c)},e.prototype.slot=function(t,e){var i=this.getSlot(t,e),o=i.startAngle+180,r=o+i.angle;return new p.Arc([i.center.x,i.center.y],{startAngle:o,endAngle:r,radiusX:i.radius,radiusY:i.radius})},e.prototype.pointCategoryIndex=function(t){for(var e=this.options.categories.length,i=null,o=0;o<e;o++){if(this.getSlot(o).containsPoint(t)){i=o;break}}return i},e}(Cs);sn(Ks,{startAngle:90,labels:{margin:hr(10)},majorGridLines:{visible:!0},justified:!0}),or(Ks.prototype,Zs);var Js=Ks,$s=function(t){function e(e,i){t.call(this,e,i);var o=this.options;o.minorUnit=o.minorUnit||o.majorUnit/2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDivisions=function(t){return Hs.prototype.getDivisions.call(this,t)-1},e.prototype.reflow=function(t){this.box=t,this.reflowLabels()},e.prototype.reflowLabels=function(){for(var t=this.options,e=this.labels,i=this.options.labels,o=i.skip||0,r=i.step||1,n=new kn,s=this.intervals(t.majorUnit,o,r),a=0;a<e.length;a++){e[a].reflow(n);var p=e[a].box;e[a].reflow(this.getSlot(s[a]).adjacentBox(0,p.width(),p.height()))}},e.prototype.lineBox=function(){return this.box},e.prototype.intervals=function(t,e,i,o){void 0===o&&(o=!1);for(var r=this.options.min,n=this.getDivisions(t),s=[],a=i||1,p=e||0;p<n;p+=a){var h=(360+r+p*t)%360;o&&Lr(h,o)||s.push(h)}return s},e.prototype.majorIntervals=function(){return this.intervals(this.options.majorUnit)},e.prototype.minorIntervals=function(){return this.intervals(this.options.minorUnit)},e.prototype.intervalAngle=function(t){return(540-t-this.options.startAngle)%360},e.prototype.createLine=function(){return[]},e.prototype.majorGridLineAngles=function(t){var e=this.options.majorGridLines;return this.gridLineAngles(t,this.options.majorUnit,e.skip,e.step)},e.prototype.minorGridLineAngles=function(t,e){var i=this.options,o=i.minorGridLines,r=i.majorGridLines,n=e?this.intervals(i.majorUnit,r.skip,r.step):null;return this.gridLineAngles(t,i.minorUnit,o.skip,o.step,n)},e.prototype.plotBandSlot=function(t){return this.getSlot(t.from,t.to)},e.prototype.getSlot=function(t,e){var i=this.options,o=this.box,r=i.startAngle,n=Jr(t,i.min,i.max),s=Jr(e||n,n,i.max);if(i.reverse&&(n*=-1,s*=-1),(s=(540-s-r)%360)<(n=(540-n-r)%360)){var a=n;n=s,s=a}return new Pn(o.center(),0,o.height()/2,n,s-n)},e.prototype.slot=function(t,e){void 0===e&&(e=t);var i,o,r=this.options,n=360-r.startAngle,s=this.getSlot(t,e),a=Math.min(t,e),h=Math.max(t,e);return r.reverse?(i=a,o=h):(i=360-h,o=360-a),i=(i+n)%360,o=(o+n)%360,new p.Arc([s.center.x,s.center.y],{startAngle:i,endAngle:o,radiusX:s.radius,radiusY:s.radius})},e.prototype.getValue=function(t){var e=this.options,i=this.box.center(),o=t.x-i.x,r=t.y-i.y,n=Math.round(Wr(Math.atan2(r,o))),s=e.startAngle;return e.reverse||(n*=-1,s*=-1),(n+s+360)%360},e.prototype.valueRange=function(){return{min:0,max:2*Math.PI}},e}(rs);sn($s,{type:"polar",startAngle:0,reverse:!1,majorUnit:60,min:0,max:360,labels:{margin:hr(10)},majorGridLines:{color:l,visible:!0,width:1},minorGridLines:{color:"#aaa"}}),or($s.prototype,Zs,{createPlotBands:Js.prototype.createPlotBands,majorAngles:Js.prototype.majorAngles,range:Hs.prototype.range,labelsCount:Hs.prototype.labelsCount,createAxisLabel:Hs.prototype.createAxisLabel});var Qs=$s;function ta(t,e){return 180-Math.abs(Math.abs(t-e)-180)}var ea={options:{majorGridLines:{visible:!0}},createPlotBands:function(){var t=this.options,e=t.majorGridLines.type,i=t.plotBands;void 0===i&&(i=[]);for(var o=this.plotArea.polarAxis,r=o.majorAngles(),n=o.box.center(),s=this._plotbandGroup=new a.Group({zIndex:-1}),p=0;p<i.length;p++){var h=i[p],l={fill:{color:h.color,opacity:h.opacity},stroke:{opacity:h.opacity}},u=this.getSlot(h.from,h.to,!0),f=new Pn(n,n.y-u.y2,n.y-u.y1,0,360),d=void 0;d=e===c?On.current.createRing(f,l):a.Path.fromPoints(this.plotBandPoints(f,r),l).close(),s.append(d)}this.appendVisual(s)},plotBandPoints:function(t,e){for(var i=[],o=[],r=[t.center.x,t.center.y],n=new p.Circle(r,t.innerRadius),s=new p.Circle(r,t.radius),a=0;a<e.length;a++)i.push(n.pointAt(e[a]+180)),o.push(s.pointAt(e[a]+180));return i.reverse(),i.push(i[0]),o.push(o[0]),o.concat(i)},createGridLines:function(t){var e=this.options,i=this.radarMajorGridLinePositions(),o=t.majorAngles(),r=t.box.center(),n=[];if(e.majorGridLines.visible&&(n=this.renderGridLines(r,i,o,e.majorGridLines)),e.minorGridLines.visible){var s=this.radarMinorGridLinePositions();Hr(n,this.renderGridLines(r,s,o,e.minorGridLines))}return n},renderGridLines:function(t,e,i,o){var r={stroke:{width:o.width,color:o.color,dashType:o.dashType}},n=o.skip;void 0===n&&(n=0);var s=o.step;void 0===s&&(s=0);for(var h=this.gridLinesVisual(),l=n;l<e.length;l+=s){var u=t.y-e[l];if(u>0){var f=new p.Circle([t.x,t.y],u);if(o.type===c)h.append(new a.Circle(f,r));else{for(var d=new a.Path(r),y=0;y<i.length;y++)d.lineTo(f.pointAt(i[y]+180));d.close(),h.append(d)}}}return h.children},getValue:function(t){var e=this.lineBox(),i=this.plotArea.polarAxis,o=i.majorAngles(),r=i.box.center(),n=t.distanceTo(r),s=n;if(this.options.majorGridLines.type!==c&&o.length>1){var a=t.x-r.x,p=t.y-r.y,h=(Wr(Math.atan2(p,a))+540)%360;o.sort((function(t,e){return ta(t,h)-ta(e,h)}));var l=90-ta(o[0],o[1])/2,u=180-ta(h,o[0])-l;s=n*(Math.sin(Qr(u))/Math.sin(Qr(l)))}return this.axisType().prototype.getValue.call(this,new An(e.x1,e.y2-s))}},ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.radarMajorGridLinePositions=function(){return this.getTickPositions(this.options.majorUnit)},e.prototype.radarMinorGridLinePositions=function(){var t=this.options,e=0;return t.majorGridLines.visible&&(e=t.majorUnit),this.getTickPositions(t.minorUnit,e)},e.prototype.axisType=function(){return t},e}(Hs);or(ia.prototype,ea);var oa=ia,ra=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.radarMajorGridLinePositions=function(){var t=[];return this.traverseMajorTicksPositions((function(e){t.push(e)}),this.options.majorGridLines),t},e.prototype.radarMinorGridLinePositions=function(){var t=[];return this.traverseMinorTicksPositions((function(e){t.push(e)}),this.options.minorGridLines),t},e.prototype.axisType=function(){return t},e}(Ys);or(ra.prototype,ea);var na=ra;function sa(t){return t<=0?-1:1}var aa=function(t){function e(e){t.call(this),this.closed=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.process=function(t){var e=t.slice(0),i=[],o=this.closed,r=e.length;if(r>2&&(this.removeDuplicates(0,e),r=e.length),r<2||2===r&&e[0].equals(e[1]))return i;var n,s,a=e[0],h=e[1],c=e[2];for(i.push(new p.Segment(a));a.equals(e[r-1]);)o=!0,e.pop(),r--;if(2===r){var l=this.tangent(a,h,S,k);return Kr(i).controlOut(this.firstControlPoint(l,a,h,S,k)),i.push(new p.Segment(h,this.secondControlPoint(l,a,h,S,k))),i}if(o){a=e[r-1],h=e[0],c=e[1];var u=this.controlPoints(a,h,c);n=u[1],s=u[0]}else{var f=this.tangent(a,h,S,k);n=this.firstControlPoint(f,a,h,S,k)}for(var d=n,y=0;y<=r-3;y++)if(this.removeDuplicates(y,e),y+3<=(r=e.length)){a=e[y],h=e[y+1],c=e[y+2];var v=this.controlPoints(a,h,c);Kr(i).controlOut(d),d=v[1];var g=v[0];i.push(new p.Segment(h,g))}if(o){a=e[r-2],h=e[r-1],c=e[0];var m=this.controlPoints(a,h,c);Kr(i).controlOut(d),i.push(new p.Segment(h,m[0])),Kr(i).controlOut(m[1]),i.push(new p.Segment(c,s))}else{var x=this.tangent(h,c,S,k);Kr(i).controlOut(d),i.push(new p.Segment(c,this.secondControlPoint(x,h,c,S,k)))}return i},e.prototype.removeDuplicates=function(t,e){for(;e[t+1]&&(e[t].equals(e[t+1])||e[t+1].equals(e[t+2]));)e.splice(t+1,1)},e.prototype.invertAxis=function(t,e,i){var o=!1;if(t.x===e.x)o=!0;else if(e.x===i.x)(e.y<i.y&&t.y<=e.y||i.y<e.y&&e.y<=t.y)&&(o=!0);else{var r=this.lineFunction(t,e),n=this.calculateFunction(r,i.x);t.y<=e.y&&i.y<=n||e.y<=t.y&&i.y>=n||(o=!0)}return o},e.prototype.isLine=function(t,e,i){var o=this.lineFunction(t,e),r=this.calculateFunction(o,i.x);return t.x===e.x&&e.x===i.x||tn(r,1)===tn(i.y,1)},e.prototype.lineFunction=function(t,e){var i=(e.y-t.y)/(e.x-t.x);return[t.y-i*t.x,i]},e.prototype.controlPoints=function(t,e,i){var o,r=S,n=k,s=!1,a=!1;if(this.isLine(t,e,i))o=this.tangent(t,e,S,k);else{var p={x:this.isMonotonicByField(t,e,i,S),y:this.isMonotonicByField(t,e,i,k)};if(p.x&&p.y)o=this.tangent(t,i,S,k),s=!0;else if(this.invertAxis(t,e,i)&&(r=k,n=S),p[r])o=0;else o=.01*(i[n]<t[n]&&t[n]<=e[n]||t[n]<i[n]&&e[n]<=t[n]?sa((i[n]-t[n])*(e[r]-t[r])):-sa((i[r]-t[r])*(e[n]-t[n]))),a=!0}var h=this.secondControlPoint(o,t,e,r,n);if(a){var c=r;r=n,n=c}var l=this.firstControlPoint(o,e,i,r,n);return s&&(this.restrictControlPoint(t,e,h,o),this.restrictControlPoint(e,i,l,o)),[h,l]},e.prototype.restrictControlPoint=function(t,e,i,o){t.y<e.y?e.y<i.y?(i.x=t.x+(e.y-t.y)/o,i.y=e.y):i.y<t.y&&(i.x=e.x-(e.y-t.y)/o,i.y=t.y):i.y<e.y?(i.x=t.x-(t.y-e.y)/o,i.y=e.y):t.y<i.y&&(i.x=e.x+(t.y-e.y)/o,i.y=t.y)},e.prototype.tangent=function(t,e,i,o){var r,n=e[i]-t[i],s=e[o]-t[o];return r=0===n?0:s/n,r},e.prototype.isMonotonicByField=function(t,e,i,o){return i[o]>e[o]&&e[o]>t[o]||i[o]<e[o]&&e[o]<t[o]},e.prototype.firstControlPoint=function(t,e,i,o,r){var n=e[o],s=.333*(i[o]-n);return this.point(n+s,e[r]+s*t,o,r)},e.prototype.secondControlPoint=function(t,e,i,o,r){var n=e[o],s=i[o],a=.333*(s-n);return this.point(s-a,i[r]-a*t,o,r)},e.prototype.point=function(t,e,i,o){var r=new p.Point;return r[i]=t,r[o]=e,r},e.prototype.calculateFunction=function(t,e){for(var i=t.length,o=0,r=0;r<i;r++)o+=Math.pow(e,r)*t[r];return o},e}(O),pa=function(t){function e(e){t.call(this),this._axis=e,this.options=e.options}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.value=function(t){var e=this._axis,i=e.getCategory?e.getCategory(t):e.getValue(t);return i},e.prototype.slot=function(t,e,i){return void 0===i&&(i=!0),this._axis.slot(t,e,i)},e.prototype.range=function(){return this._axis.range()},e.prototype.valueRange=function(){return this._axis.valueRange()},e}(O);function ha(t,e){for(var i=0;i<e.length;i++)if(e[i].options.name===t)return e[i].prepareUserOptions(),new pa(e[i])}var ca=function(t){this.visual=t.visual,this.chartsVisual=t.chartContainer.visual,this._pane=t};ca.prototype.findAxisByName=function(t){return ha(t,this._pane.axes)};var la=ca,ua=function(t){function e(e){t.call(this),this._plotArea=e,this.visual=e.visual,this.backgroundVisual=e._bgVisual}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(O);function fa(t){for(var e=t.length,i=0,o=0;o<e;o++){$o(t[o])&&i++}return i}var da={min:function(t){for(var e=t.length,i=m,o=0;o<e;o++){var r=t[o];$o(r)&&(i=Math.min(i,r))}return i===m?t[0]:i},max:function(t){for(var e=t.length,i=x,o=0;o<e;o++){var r=t[o];$o(r)&&(i=Math.max(i,r))}return i===x?t[0]:i},sum:function(t){for(var e=t.length,i=0,o=0;o<e;o++){var r=t[o];$o(r)&&(i+=r)}return i},sumOrNull:function(t){var e=null;return fa(t)&&(e=da.sum(t)),e},count:function(t){for(var e=t.length,i=0,o=0;o<e;o++){var r=t[o];null!==r&&Nr(r)&&i++}return i},avg:function(t){var e=fa(t),i=t[0];return e>0&&(i=da.sum(t)/e),i},first:function(t){for(var e=t.length,i=0;i<e;i++){var o=t[i];if(null!==o&&Nr(o))return o}return t[0]}},ya=da;function va(t,e){return null===e?e:Or(t)(e)}var ga=function(t){function e(){t.call(this),this._valueFields={},this._otherFields={},this._nullValue={},this._undefinedValue={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.register=function(t,e,i){void 0===e&&(e=[w]),void 0===i&&(i={});for(var o=0;o<t.length;o++){var r=t[o];this._valueFields[r]=e,this._otherFields[r]=i,this._nullValue[r]=this._makeValue(e,null),this._undefinedValue[r]=this._makeValue(e,void 0)}},e.prototype.canonicalFields=function(t){return this.valueFields(t).concat(this.otherFields(t))},e.prototype.valueFields=function(t){return this._valueFields[t.type]||[w]},e.prototype.otherFields=function(t){return this._otherFields[t.type]||[w]},e.prototype.bindPoint=function(t,e,i){var o,r,n=t.data,s=Nr(i)?i:n[e],a={valueFields:{value:s}},p=this.valueFields(t),h=this._otherFields[t.type];if(null===s)r=this._nullValue[t.type];else if(Nr(s)){if(Array.isArray(s)){var c=s.slice(p.length);r=this._bindFromArray(s,p),o=this._bindFromArray(c,h)}else if("object"==typeof s){var l=this.sourceFields(t,p),u=this.sourceFields(t,h);r=this._bindFromObject(s,p,l),o=this._bindFromObject(s,h,u)}}else r=this._undefinedValue[t.type];return Nr(r)&&(1===p.length?a.valueFields.value=r[p[0]]:a.valueFields=r),a.fields=o||{},a},e.prototype._makeValue=function(t,e){for(var i={},o=t.length,r=0;r<o;r++){i[t[r]]=e}return i},e.prototype._bindFromArray=function(t,e){var i={};if(e)for(var o=Math.min(e.length,t.length),r=0;r<o;r++)i[e[r]]=t[r];return i},e.prototype._bindFromObject=function(t,e,i){void 0===i&&(i=e);var o={};if(e)for(var r=e.length,n=0;n<r;n++){var s=e[n],a=i[n];null!==a&&(o[s]=va(a,t))}return o},e.prototype.sourceFields=function(t,e){var i=[];if(e)for(var o=e.length,r=0;r<o;r++){var n=e[r],s=n===w?"field":n+"Field";i.push(null!==t[s]?t[s]||n:null)}return i},e}(O);ga.current=new ga;var ma=ga,xa=/percent(?:\w*)\((\d+)\)/,ba=new RegExp("^stddev(?:\\((\\d+(?:\\.\\d+)?)\\))?$"),_a=function(t){function e(e,i,o){t.call(this),this.initGlobalRanges(e,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initGlobalRanges=function(t,e,i){var o=e.data,r=ba.exec(t);if(r){this.valueGetter=this.createValueGetter(e,i);var n=this.getAverage(o),s=this.getStandardDeviation(o,n,!1),a=r[1]?parseFloat(r[1]):1,p={low:n.value-s*a,high:n.value+s*a};this.globalRange=function(){return p}}else if(t.indexOf&&t.indexOf("stderr")>=0){this.valueGetter=this.createValueGetter(e,i);var h=this.getStandardError(o,this.getAverage(o));this.globalRange=function(t){return{low:t-h,high:t+h}}}},e.prototype.createValueGetter=function(t,e){var i,o=t.data,r=ma.current,n=r.valueFields(t),s=Nr(o[0])?o[0]:{};if(C(s))i=Or("["+(e?n.indexOf(e):0)+"]");else if($o(s))i=Or();else if("object"==typeof s){i=Or(r.sourceFields(t,n)[n.indexOf(e)])}return i},e.prototype.getErrorRange=function(t,e){var i,o,r;if(!Nr(e))return null;if(this.globalRange)return this.globalRange(t);if(C(e))i=t-e[0],o=t+e[1];else if($o(r=parseFloat(e)))i=t-r,o=t+r;else{if(!(r=xa.exec(e)))throw new Error("Invalid ErrorBar value: "+e);var n=t*(parseFloat(r[1])/100);i=t-Math.abs(n),o=t+Math.abs(n)}return{low:i,high:o}},e.prototype.getStandardError=function(t,e){return this.getStandardDeviation(t,e,!0)/Math.sqrt(e.count)},e.prototype.getStandardDeviation=function(t,e,i){for(var o=t.length,r=i?e.count-1:e.count,n=0,s=0;s<o;s++){var a=this.valueGetter(t[s]);$o(a)&&(n+=Math.pow(a-e.value,2))}return Math.sqrt(n/r)},e.prototype.getAverage=function(t){for(var e=t.length,i=0,o=0,r=0;r<e;r++){var n=this.valueGetter(t[r]);$o(n)&&(i+=n,o++)}return{value:i/o,count:o}},e}(O),wa=Si.browser||{},Aa=wa.msie?.001:0,Sa="zero",ka="bar",Ca="column",Pa="line",Ta="pie",Ma="verticalLine",Oa=[ka,Ca,"ohlc","candlestick","boxPlot","verticalBoxPlot","bullet","rangeColumn","rangeBar","waterfall","horizontalWaterfall"],Ra="DOMMouseScroll mousewheel",Ba=function(t){function e(e,i,o,r,n,s){t.call(this,s),this.low=e,this.high=i,this.isVertical=o,this.chart=r,this.series=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e,i=this.options.endCaps,o=this.isVertical,r=this.getAxis().getSlot(this.low,this.high),n=t.center(),s=this.getCapsWidth(t,o),a=o?n.x:n.y,p=a-s,h=a+s;o?(e=[new An(n.x,r.y1),new An(n.x,r.y2)],i&&e.push(new An(p,r.y1),new An(h,r.y1),new An(p,r.y2),new An(h,r.y2)),this.box=new kn(p,r.y1,h,r.y2)):(e=[new An(r.x1,n.y),new An(r.x2,n.y)],i&&e.push(new An(r.x1,p),new An(r.x1,h),new An(r.x2,p),new An(r.x2,h)),this.box=new kn(r.x1,p,r.x2,h)),this.linePoints=e},e.prototype.getCapsWidth=function(t,e){var i=e?t.width():t.height();return Math.min(Math.floor(i/2),4)||4},e.prototype.createVisual=function(){var t=this,e=this.options,i=e.visual;i?this.visual=i({low:this.low,high:this.high,rect:this.box.toRect(),sender:this.getSender(),options:{endCaps:e.endCaps,color:e.color,line:e.line},createVisual:function(){t.createDefaultVisual();var e=t.visual;return delete t.visual,e}}):this.createDefaultVisual()},e.prototype.createDefaultVisual=function(){var e=this.options,i=this.linePoints,o={stroke:{color:e.color,width:e.line.width,dashType:e.line.dashType}};t.prototype.createVisual.call(this);for(var r=0;r<i.length;r+=2){var n=new a.Path(o).moveTo(i[r].x,i[r].y).lineTo(i[r+1].x,i[r+1].y);Ko(n),this.visual.append(n)}},e}(Bn);sn(Ba,{animation:{type:"fadeIn",delay:600},endCaps:!0,line:{width:2},zIndex:1});var ja=Ba,Ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getAxis=function(){return this.chart.seriesValueAxis(this.series)},e}(ja);function La(t,e,i,o){void 0===i&&(i={}),void 0===o&&(o=!1);var r=i.defaults=i.defaults||{},n=i.depth=i.depth||0,s=!1;if(i.excluded=i.excluded||[],n>5)return null;for(var a in t)if(!Lr(a,i.excluded)&&t.hasOwnProperty(a)){var p=t[a];er(p)?(s=!0,o||(t[a]=on(p(e),r[a]))):rr(p)&&(o||(i.defaults=r[a]),i.depth++,s=La(p,e,i,o)||s,i.depth--)}return s}function za(t){for(var e=t.length,i=0,o=0;o<e;o++)i=Math.max(i,t[o].data.length);return i}var Ea=function(t){function e(e,i){t.call(this,i),this.plotArea=e,this.chartService=e.chartService,this.categoryAxis=e.seriesCategoryAxis(i.series[0]),this.valueAxisRanges={},this.points=[],this.categoryPoints=[],this.seriesPoints=[],this.seriesOptions=[],this._evalSeries=[],this.render()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this.traverseDataPoints(this.addValue.bind(this))},e.prototype.pointOptions=function(t,e){var i=this.seriesOptions[e];if(!i){var o=this.pointType().prototype.defaults;this.seriesOptions[e]=i=or({},o,{vertical:!this.options.invertAxes},t)}return i},e.prototype.plotValue=function(t){if(!t)return 0;if(this.options.isStacked100&&$o(t.value)){for(var e=t.categoryIx,i=this.categoryPoints[e],o=[],r=0,n=0;n<i.length;n++){var s=i[n];if(s){var a=t.series.stack,p=s.series.stack;if(a&&p&&a.group!==p.group)continue;$o(s.value)&&(r+=Math.abs(s.value),o.push(Math.abs(s.value)))}}if(r>0)return t.value/r}return t.value},e.prototype.plotRange=function(t,e){void 0===e&&(e=0);var i=this.categoryPoints[t.categoryIx];if(this.options.isStacked){for(var o=this.plotValue(t),r=o>=0,n=e,s=!1,a=0;a<i.length;a++){var p=i[a];if(t===p)break;var h=t.series.stack,c=p.series.stack;if(h&&c){if("string"==typeof h&&h!==c)continue;if(h.group&&h.group!==c.group)continue}var l=this.plotValue(p);(l>=0&&r||l<0&&!r)&&(n+=l,o+=l,s=!0,this.options.isStacked100&&(o=Math.min(o,1)))}return s&&(n-=e),[n,o]}var u=t.series,f=this.seriesValueAxis(u),d=this.categoryAxisCrossingValue(f);return[d,tr(t.value)?t.value:d]},e.prototype.stackLimits=function(t,e){for(var i=m,o=x,r=0;r<this.categoryPoints.length;r++){var n=this.categoryPoints[r];if(n)for(var s=0;s<n.length;s++){var a=n[s];if(a&&(a.series.stack===e||a.series.axis===t)){var p=this.plotRange(a,0)[1];Nr(p)&&isFinite(p)&&(o=Math.max(o,p),i=Math.min(i,p))}}}return{min:i,max:o}},e.prototype.updateStackRange=function(){var t=this.options,e=t.isStacked,i=t.series,o={};if(e)for(var r=0;r<i.length;r++){var n=i[r],s=n.axis,a=s+n.stack,p=o[a];if(!p){p=this.stackLimits(s,n.stack);var h=this.errorTotals;h&&(h.negative.length&&(p.min=Math.min(p.min,an(h.negative).min)),h.positive.length&&(p.max=Math.max(p.max,an(h.positive).max))),p.min!==m||p.max!==x?o[a]=p:p=null}p&&(this.valueAxisRanges[s]=p)}},e.prototype.addErrorBar=function(t,e,i){var o,r=t.value,n=t.series,s=t.seriesIx,a=t.options.errorBars,p=e.fields.errorLow,h=e.fields.errorHigh;$o(p)&&$o(h)?o={low:p,high:h}:a&&Nr(a.value)&&(this.seriesErrorRanges=this.seriesErrorRanges||[],this.seriesErrorRanges[s]=this.seriesErrorRanges[s]||new _a(a.value,n,w),o=this.seriesErrorRanges[s].getErrorRange(r,a.value)),o&&(t.low=o.low,t.high=o.high,this.addPointErrorBar(t,i))},e.prototype.addPointErrorBar=function(t,e){var i=!this.options.invertAxes,o=t.options.errorBars,r=t.series,n=t.low,s=t.high;if(this.options.isStacked){var a=this.stackedErrorRange(t,e);n=a.low,s=a.high}else{var p={categoryIx:e,series:r};this.updateRange({value:n},p),this.updateRange({value:s},p)}var h=new Ia(n,s,i,this,r,o);t.errorBars=[h],t.append(h)},e.prototype.stackedErrorRange=function(t,e){var i=this.plotRange(t,0)[1]-t.value,o=t.low+i,r=t.high+i;return this.errorTotals=this.errorTotals||{positive:[],negative:[]},o<0&&(this.errorTotals.negative[e]=Math.min(this.errorTotals.negative[e]||0,o)),r>0&&(this.errorTotals.positive[e]=Math.max(this.errorTotals.positive[e]||0,r)),{low:o,high:r}},e.prototype.addValue=function(t,e){var i=e.categoryIx,o=e.series,r=e.seriesIx,n=this.categoryPoints[i];n||(this.categoryPoints[i]=n=[]);var s=this.seriesPoints[r];s||(this.seriesPoints[r]=s=[]);var a=this.createPoint(t,e);a&&(Object.assign(a,e),a.owner=this,a.noteText=t.fields.noteText,Nr(a.dataItem)||(a.dataItem=o.data[i]),this.addErrorBar(a,t,i)),this.points.push(a),s.push(a),n.push(a),this.updateRange(t.valueFields,e)},e.prototype.evalPointOptions=function(t,e,i,o,r,n){var s={defaults:r._defaults,excluded:["data","aggregate","_events","tooltip","content","template","visual","toggle","_outOfRangeMinPoint","_outOfRangeMaxPoint"]},a=this._evalSeries[n];Nr(a)||(this._evalSeries[n]=a=La(t,{},s,!0));var p=t;return a&&La(p=or({},p),{value:e,category:i,index:o,series:r,dataItem:r.data[o]},s),p},e.prototype.updateRange=function(t,e){var i=e.series.axis,o=t.value,r=this.valueAxisRanges[i];isFinite(o)&&null!==o&&((r=this.valueAxisRanges[i]=r||{min:m,max:x}).min=Math.min(r.min,o),r.max=Math.max(r.max,o))},e.prototype.seriesValueAxis=function(t){var e=this.plotArea,i=t.axis,o=i?e.namedValueAxes[i]:e.valueAxis;if(!o)throw new Error("Unable to locate value axis with name "+i);return o},e.prototype.reflow=function(t){var e=this,i=this.categorySlots=[],o=this.points,r=this.categoryAxis,n=0;this.traverseDataPoints((function(t,s){var a=s.categoryIx,p=s.series,h=e.seriesValueAxis(p),c=o[n++],l=i[a];if(l||(i[a]=l=e.categorySlot(r,a,h)),c){var u=e.plotRange(c,h.startValue()),f=e.valueSlot(h,u);if(f){var d=e.pointSlot(l,f);c.aboveAxis=e.aboveAxis(c,h),c.stackValue=u[1],e.options.isStacked100&&(c.percentage=e.plotValue(c)),e.reflowPoint(c,d)}else c.visible=!1}})),this.reflowCategories(i),!this.options.clip&&this.options.limitPoints&&this.points.length&&this.limitPoints(),this.box=t},e.prototype.valueSlot=function(t,e){return t.getSlot(e[0],e[1],!this.options.clip)},e.prototype.limitPoints=function(){for(var t=this.categoryPoints,e=t[0].concat(Kr(t)),i=0;i<e.length;i++)e[i]&&this.limitPoint(e[i])},e.prototype.limitPoint=function(t){var e=this.categoryAxis.limitSlot(t.box);e.equals(t.box)||t.reflow(e)},e.prototype.aboveAxis=function(t,e){var i=this.categoryAxisCrossingValue(e),o=t.value;return e.options.reverse?o<i:o>=i},e.prototype.categoryAxisCrossingValue=function(t){var e=this.categoryAxis,i=t.options;return[].concat(i.axisCrossingValues||i.axisCrossingValue)[e.axisIndex||0]||0},e.prototype.reflowPoint=function(t,e){t.reflow(e)},e.prototype.reflowCategories=function(){},e.prototype.pointSlot=function(t,e){var i=this.options.invertAxes,o=i?e:t,r=i?t:e;return new kn(o.x1,r.y1,o.x2,r.y2)},e.prototype.categorySlot=function(t,e){return t.getSlot(e)},e.prototype.traverseDataPoints=function(t){for(var e=this.options.series,i=za(e),o=e.length,r=0;r<o;r++)this._outOfRangeCallback(e[r],"_outOfRangeMinPoint",r,t);for(var n=0;n<i;n++)for(var s=0;s<o;s++){var a=e[s],p=this.categoryAxis.categoryAt(n);t(this._bindPoint(a,s,n),{category:p,categoryIx:n,categoriesCount:i,series:a,seriesIx:s})}for(var h=0;h<o;h++)this._outOfRangeCallback(e[h],"_outOfRangeMaxPoint",h,t)},e.prototype._outOfRangeCallback=function(t,e,i,o){var r=t[e];if(r){var n=r.categoryIx;o(this._bindPoint(t,i,n,r.item),{category:r.category,categoryIx:n,series:t,seriesIx:i,dataItem:r.item})}},e.prototype._bindPoint=function(t,e,i,o){this._bindCache||(this._bindCache=[]);var r=this._bindCache[e];r||(r=this._bindCache[e]=[]);var n=r[i];return n||(n=r[i]=ma.current.bindPoint(t,i,o)),n},e.prototype.formatPointValue=function(t,e){return null===t.value?"":this.chartService.format.auto(e,t.value)},e.prototype.pointValue=function(t){return t.valueFields.value},e}(Bn);sn(Ea,{series:[],invertAxes:!1,isStacked:!1,clip:!0,limitPoints:!0});var Va=Ea,Fa={click:function(t,e){return t.trigger("seriesClick",this.eventArgs(e))},hover:function(t,e){return t.trigger("seriesHover",this.eventArgs(e))},over:function(t,e){return t.trigger("seriesOver",this.eventArgs(e))},out:function(t,e){return t.trigger("seriesLeave",this.eventArgs(e))},eventArgs:function(t){return{value:this.value,percentage:this.percentage,stackValue:this.stackValue,category:this.category,series:this.series,dataItem:this.dataItem,runningTotal:this.runningTotal,total:this.total,element:Yr(t),originalEvent:t,point:this}}},Da={createNote:function(){var t=this.options.notes,e=this.noteText||t.label.text;!1!==t.visible&&Nr(e)&&null!==e&&(this.note=new ts({value:this.value,text:e,dataItem:this.dataItem,category:this.category,series:this.series},this.options.notes,this.owner.chartService),this.append(this.note))}},Ua=function(t){function e(e,i){t.call(this),this.value=e,this.options=i,this.aboveAxis=on(this.options.aboveAxis,!0),this.tooltipTracking=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=this.options,e=t.markers,i=t.labels;if(!this._rendered){if(this._rendered=!0,e.visible&&e.size&&(this.marker=this.createMarker(),this.append(this.marker)),i.visible){var o=Pr(i),r=this.pointData(),n=this.value;o?n=o(r):i.format&&(n=this.formatValue(i.format)),this.label=new Yn(n,or({align:f,vAlign:f,margin:{left:5,right:5},zIndex:on(i.zIndex,this.series.zIndex)},i),r),this.append(this.label)}this.createNote(),this.errorBar&&this.append(this.errorBar)}},e.prototype.markerBorder=function(){var t=this.options.markers,e=t.background,i=or({color:this.color},t.border);return Nr(i.color)||(i.color=new dn(e).brightness(.8).toHex()),i},e.prototype.createVisual=function(){},e.prototype.createMarker=function(){var t=this.options.markers;return new zn({type:t.type,width:t.size,height:t.size,rotation:t.rotation,background:t.background,border:this.markerBorder(),opacity:this.series.opacity||t.opacity,zIndex:on(t.zIndex,this.series.zIndex),animation:t.animation,visual:t.visual},{dataItem:this.dataItem,value:this.value,series:this.series,category:this.category})},e.prototype.markerBox=function(){return this.marker||(this.marker=this.createMarker(),this.marker.reflow(this._childBox)),this.marker.box},e.prototype.reflow=function(t){var e=this.options,i=this.aboveAxis,o=e.vertical;this.render(),this.box=t;var r=t.clone();if(o?i?r.y1-=r.height():r.y2+=r.height():i?r.x1+=r.width():r.x2-=r.width(),this._childBox=r,this.marker&&this.marker.reflow(r),this.reflowLabel(r),this.errorBars)for(var n=0;n<this.errorBars.length;n++)this.errorBars[n].reflow(r);if(this.note){var s=this.markerBox();if(!e.markers.visible||!e.markers.size){var a=s.center();s=new kn(a.x,a.y,a.x,a.y)}this.note.reflow(s)}},e.prototype.reflowLabel=function(t){var e=this.options,i=this.label,o=e.labels.position;i&&(o="below"===(o="above"===o?_:o)?u:o,i.reflow(t),i.box.alignTo(this.markerBox(),o),i.reflow(i.box))},e.prototype.createHighlight=function(){var t=this.options.highlight.markers,e=this.markerBorder().color,i=this.options.markers,o=i.size+(i.border.width||0)+(t.border.width||0),r=new zn({type:i.type,width:o,height:o,rotation:i.rotation,background:t.color||e,border:{color:t.border.color,width:t.border.width,opacity:on(t.border.opacity,1)},opacity:on(t.opacity,1)});return r.reflow(this._childBox),r.getElement()},e.prototype.highlightVisual=function(){return(this.marker||{}).visual},e.prototype.highlightVisualArgs=function(){var t,e,i=this.marker;if(i)e=i.paddingBox.toRect(),t=i.visual;else{var o=this.options.markers.size,r=o/2,n=this.box.center();e=new p.Rect([n.x-r,n.y-r],[o,o])}return{options:this.options,rect:e,visual:t}},e.prototype.tooltipAnchor=function(){var t=this.markerBox(),e=this.owner.pane.clipBox();if(!e||e.overlaps(t)){var i,o,r=t.x2+5;return this.aboveAxis?(i=t.y1,o=u):(i=t.y2,o=_),{point:new An(r,i),align:{horizontal:"left",vertical:o}}}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e.prototype.overlapsBox=function(t){return this.markerBox().overlaps(t)},e.prototype.unclipElements=function(){this.label&&(this.label.options.noclip=!0),this.note&&(this.note.options.noclip=!0)},e.prototype.pointData=function(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,series:this.series}},e}(Bn);Ua.prototype.defaults={vertical:!0,markers:{visible:!0,background:A,size:8,type:d,border:{width:2},opacity:1},labels:{visible:!1,position:"above",margin:hr(3),padding:hr(4),animation:{type:"fadeIn",delay:600}},notes:{label:{}},highlight:{markers:{border:{color:"#fff",width:2}},zIndex:100},errorBars:{line:{width:1}}},or(Ua.prototype,Fa),or(Ua.prototype,Da);var Ha=Ua,Ga=function(t){function e(e,i,o){t.call(this),this.linePoints=e,this.series=i,this.seriesIx=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.points=function(){return this.toGeometryPoints(this.linePoints)},e.prototype.toGeometryPoints=function(t){for(var e=[],i=0,o=t.length;i<o;i++)t[i]&&!1!==t[i].visible&&e.push(t[i]._childBox.toRect().center());return e},e.prototype.createVisual=function(){var t=this,e=this.series.visual;e?(this.visual=e({points:this.toGeometryPoints(this.linePoints),series:this.series,sender:this.getSender(),createVisual:function(){return t.segmentVisual(),t.visual}}),this.visual&&!Nr(this.visual.options.zIndex)&&(this.visual.options.zIndex=this.series.zIndex)):this.segmentVisual()},e.prototype.segmentVisual=function(){var t=this.options,e=this.series,i=e.color,o=e._defaults;er(i)&&o&&(i=o.color);var r=a.Path.fromPoints(this.points(),{stroke:{color:i,width:e.width,opacity:e.opacity,dashType:e.dashType},zIndex:e.zIndex});t.closed&&r.close(),this.visual=r},e.prototype.aliasFor=function(t,e){return this.parent.getNearestPoint(e.x,e.y,this.seriesIx)},e}(Bn);sn(Ga,{closed:!1});var Na=Ga;function Wa(t,e,i,o,r){var n=t.box,s=new p.Point;return s[e]=n[e+i],s[o]=n[o+r],s}var qa={calculateStepPoints:function(t){for(var e=this.parent.plotArea.seriesCategoryAxis(this.series).options,i=e.justified,o=e.vertical,r=e.reverse,n=o?S:k,s=o?k:S,a=r?2:1,h=a,c=Wa(t[0],n,a,s,h),l=[c],u=1;u<t.length;u++){var f=Wa(t[u],n,a,s,h);if(c[n]!==f[n]){var d=new p.Point;d[n]=c[n],d[s]=f[s],l.push(d,f)}c=f}return i?c!==Kr(l)&&l.push(c):l.push(Wa(Kr(t),n,a,s,r?1:2)),l}},Xa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.points=function(){return this.calculateStepPoints(this.linePoints)},e}(Na);or(Xa.prototype,qa);var Ya=Xa,Za=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.segmentVisual=function(){var t=this.series,e=t._defaults,i=t.color;er(i)&&e&&(i=e.color);var o=new aa(this.options.closed).process(this.points()),r=new a.Path({stroke:{color:i,width:t.width,opacity:t.opacity,dashType:t.dashType},zIndex:t.zIndex});r.segments.push.apply(r.segments,o),this.visual=r},e}(Na),Ka={renderSegments:function(){var t,e=this.options,i=this.seriesPoints,o=e.series,r=i.length;this._segments=[];for(var n=0;n<r;n++){for(var s=o[n],a=this.sortPoints(i[n]),p=a.length,h=[],c=0;c<p;c++){var l=a[c];l?h.push(l):"interpolate"!==this.seriesMissingValues(s)&&(h.length>1&&(t=this.createSegment(h,s,n,t),this._addSegment(t)),h=[])}h.length>1&&(t=this.createSegment(h,s,n,t),this._addSegment(t))}this.children.unshift.apply(this.children,this._segments)},_addSegment:function(t){this._segments.push(t),t.parent=this},sortPoints:function(t){return t},seriesMissingValues:function(t){var e=t.missingValues;return!e&&this.options.isStacked?Sa:e||"interpolate"},getNearestPoint:function(t,e,i){for(var o,r=new An(t,e),n=this.seriesPoints[i],s=m,a=0;a<n.length;a++){var p=n[a];if(p&&Nr(p.value)&&null!==p.value&&!1!==p.visible){var h=p.box.center().distanceTo(r);h<s&&(o=p,s=h)}}return o}},Ja=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){this._setEnd(this.options.box.x1)},e.prototype.step=function(t){var e=this.options.box;this._setEnd(zr(e.x1,e.x2,t))},e.prototype._setEnd=function(t){var e=this.element,i=e.segments,o=i[1].anchor(),r=i[2].anchor();e.suspend(),o.setX(t),e.resume(),r.setX(t)},e}(a.Animation);sn(Ja,{duration:600}),a.AnimationFactory.current.register("clip",Ja);var $a=Ja;function Qa(t){for(var e=0;e<t.length;e++)if(Nr(t[e].zIndex))return!0}var tp={createAnimation:function(){var t=this.getRoot();if(t&&!1!==(t.options||{}).transitions){var e=t.size(),i=a.Path.fromRect(e.toRect());this.visual.clip(i),this.animation=new $a(i,{box:e}),Qa(this.options.series)&&this._setChildrenAnimation(i)}},_setChildrenAnimation:function(t){for(var e=this.animationPoints(),i=0;i<e.length;i++){var o=e[i];o&&o.visual&&Nr(o.visual.options.zIndex)&&o.visual.clip(t)}}},ep=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){t.prototype.render.call(this),this.updateStackRange(),this.renderSegments()},e.prototype.pointType=function(){return Ha},e.prototype.createPoint=function(t,e){var i=e.categoryIx,o=e.category,r=e.series,n=e.seriesIx,s=this.seriesMissingValues(r),a=t.valueFields.value;if(!Nr(a)||null===a){if(s!==Sa)return null;a=0}var p=this.pointOptions(r,n);p=this.evalPointOptions(p,a,o,i,r,n);var h=t.fields.color||r.color;er(r.color)&&(h=p.color);var c=new Ha(a,p);return c.color=h,this.append(c),c},e.prototype.plotRange=function(t){var e=this.plotValue(t);if(this.options.isStacked)for(var i=t.categoryIx,o=this.categoryPoints[i],r=0;r<o.length;r++){var n=o[r];if(t===n)break;e+=this.plotValue(n),this.options.isStacked100&&(e=Math.min(e,1))}return[e,e]},e.prototype.createSegment=function(t,e,i){var o=e.style;return new("step"===o?Ya:"smooth"===o?Za:Na)(t,e,i)},e.prototype.animationPoints=function(){for(var t=this.points,e=[],i=0;i<t.length;i++)e.push((t[i]||{}).marker);return e.concat(this._segments)},e.prototype.supportsPointInactiveOpacity=function(){return!1},e}(Va);or(ep.prototype,Ka,tp);var ip=ep,op=function(t){function e(e,i,o,r,n){t.call(this,e,i,o),this.prevSegment=r,this.stackPoints=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createVisual=function(){var t=this.series,e=t._defaults,i=t.line||{},o=t.color;er(o)&&e&&(o=e.color),this.visual=new a.Group({zIndex:t.zIndex}),this.createFill({fill:{color:o,opacity:t.opacity},stroke:null}),i.width>0&&!1!==i.visible&&this.createStroke({stroke:or({color:o,opacity:t.opacity,lineCap:"butt"},i)})},e.prototype.strokeSegments=function(){var t=this._strokeSegments;return t||(t=this._strokeSegments=this.createStrokeSegments()),t},e.prototype.createStrokeSegments=function(){return this.segmentsFromPoints(this.points())},e.prototype.stackSegments=function(){return this.prevSegment?this.prevSegment.createStackSegments(this.stackPoints):this.createStackSegments(this.stackPoints)},e.prototype.createStackSegments=function(t){return this.segmentsFromPoints(this.toGeometryPoints(t)).reverse()},e.prototype.segmentsFromPoints=function(t){return t.map((function(t){return new p.Segment(t)}))},e.prototype.createStroke=function(t){var e=new a.Path(t);e.segments.push.apply(e.segments,this.strokeSegments()),this.visual.append(e)},e.prototype.hasStackSegment=function(){return this.prevSegment||this.stackPoints&&this.stackPoints.length},e.prototype.createFill=function(t){var e=this.strokeSegments(),i=e.slice(0),o=this.hasStackSegment();if(o){var r=this.stackSegments();Hr(i,r)}var n=new a.Path(t);n.segments.push.apply(n.segments,i),!o&&e.length>1&&this.fillToAxes(n),this.visual.append(n)},e.prototype.fillToAxes=function(t){var e=this.parent,i=e.options.invertAxes,o=e.seriesValueAxis(this.series),r=e.categoryAxisCrossingValue(o),n=o.getSlot(r,r,!0),s=this.strokeSegments(),a=s[0].anchor(),p=Kr(s).anchor(),h=i?n.x1:n.y1;i?t.lineTo(h,p.y).lineTo(h,a.y):t.lineTo(p.x,h).lineTo(a.x,h)},e}(Na),rp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createStrokeSegments=function(){return this.segmentsFromPoints(this.calculateStepPoints(this.linePoints))},e.prototype.createStackSegments=function(t){return this.segmentsFromPoints(this.calculateStepPoints(t)).reverse()},e}(op);or(rp.prototype,qa);var np=rp,sp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createStrokeSegments=function(){var t=new aa(this.options.closed),e=this.points();return t.process(e)},e.prototype.createStackSegments=function(){for(var t=this.strokeSegments(),e=[],i=t.length-1;i>=0;i--){var o=t[i];e.push(new p.Segment(o.anchor(),o.controlOut(),o.controlIn()))}return e},e}(op),ap=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createSegment=function(t,e,i,o){var r,n,s=this.options.isStacked,a=(e.line||{}).style;s&&i>0&&o&&("gap"!==this.seriesMissingValues(e)?(n=o.linePoints,r=o):n=this._gapStackPoints(t,i,a));return new("step"===a?np:"smooth"===a?sp:op)(t,e,i,r,n)},e.prototype.reflow=function(e){t.prototype.reflow.call(this,e);var i=this._stackPoints;if(i)for(var o=0;o<i.length;o++){var r=i[o],n=this.categoryAxis.getSlot(r.categoryIx);r.reflow(n)}},e.prototype._gapStackPoints=function(t,e,i){var o=this.seriesPoints,r=t[0].categoryIx,n=t.length;r<0&&(r=0,n--);var s=r+n,a=this.seriesOptions[0]._outOfRangeMinPoint?1:0,p=[];this._stackPoints=this._stackPoints||[];for(var h=r;h<s;h++){var c=h+a,l=e,u=void 0;do{u=o[--l][c]}while(l>0&&!u);if(u)"step"!==i&&h>r&&!o[l][c-1]&&p.push(this._previousSegmentPoint(h,c,c-1,l)),p.push(u),"step"!==i&&h+1<s&&!o[l][c+1]&&p.push(this._previousSegmentPoint(h,c,c+1,l));else{var f=this._createGapStackPoint(h);this._stackPoints.push(f),p.push(f)}}return p},e.prototype._previousSegmentPoint=function(t,e,i,o){for(var r,n=this.seriesPoints,s=o;s>0&&!r;)r=n[--s][i];return r?r=n[s][e]:(r=this._createGapStackPoint(t),this._stackPoints.push(r)),r},e.prototype._createGapStackPoint=function(t){var e=this.pointOptions({},0),i=new Ha(0,e);return i.categoryIx=t,i.series={},i},e.prototype.seriesMissingValues=function(t){return t.missingValues||Sa},e.prototype.supportsPointInactiveOpacity=function(){return!1},e}(ip),pp=function(t){function e(){t.call(this),this.axisRanges={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(t){var e=this.axisRanges;for(var i in t){var o=t[i],r=e[i];e[i]=r=r||{min:m,max:x},r.min=Math.min(r.min,o.min),r.max=Math.max(r.max,o.max)}},e.prototype.reset=function(t){this.axisRanges[t]=void 0},e.prototype.query=function(t){return this.axisRanges[t]},e}(O),hp=function(t){function e(e,i,o){t.call(this,i),this.textBox=new Yn(e,this.options,o),this.append(this.textBox)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createVisual=function(){this.textBox.options.noclip=this.options.noclip},e.prototype.reflow=function(t){var e=this.options,i=e.vertical,o=e.aboveAxis,r=this.children[0],n=r.options,s=r.box,a=r.options.padding,p=t;n.align=i?f:g,n.vAlign=i?_:f,"insideEnd"===e.position?i?(n.vAlign=_,!o&&s.height()<t.height()&&(n.vAlign=u)):n.align=o?b:g:e.position===f?(n.vAlign=f,n.align=f):"insideBase"===e.position?i?n.vAlign=o?u:_:n.align=o?g:b:"outsideEnd"===e.position&&(i?p=o?new kn(t.x1,t.y1-s.height(),t.x2,t.y1):new kn(t.x1,t.y2,t.x2,t.y2+s.height()):(n.align=f,p=o?new kn(t.x2,t.y1,t.x2+s.width(),t.y2):new kn(t.x1-s.width(),t.y1,t.x1,t.y2))),e.rotation||(i?a.left=a.right=(p.width()-r.contentBox.width())/2:a.top=a.bottom=(p.height()-r.contentBox.height())/2),r.reflow(p)},e.prototype.alignToClipBox=function(t){var e=this.options.vertical?k:S,i=e+"1",o=e+"2",r=this.children[0],n=this.parent.box;if(n[i]<t[i]||t[o]<n[o]){var s=r.paddingBox.clone();s[i]=Math.max(n[i],t[i]),s[o]=Math.min(n[o],t[o]),this.reflow(s)}},e}(Bn);sn(hp,{position:"outsideEnd",margin:hr(3),padding:hr(4),color:l,background:"",border:{width:1,color:""},aboveAxis:!0,vertical:!1,animation:{type:"fadeIn",delay:600},zIndex:2});var cp=hp;function lp(t){var e=t.overlay;return e&&e.gradient&&"none"!==e.gradient}var up=function(t){function e(e,i){t.call(this),this.options=i,this.color=i.color||A,this.aboveAxis=on(this.options.aboveAxis,!0),this.value=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this._rendered||(this._rendered=!0,this.createLabel(),this.createNote(),this.errorBar&&this.append(this.errorBar))},e.prototype.createLabel=function(){var t=this.options,e=t.labels;if(e.visible){var i,o=this.pointData(),r=Pr(e);i=r?r(o):this.formatValue(e.format),this.label=new cp(i,or({vertical:t.vertical},e),o),this.append(this.label)}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e.prototype.reflow=function(t){this.render();var e=this.label;if(this.box=t,e&&(e.options.aboveAxis=this.aboveAxis,e.reflow(t)),this.note&&this.note.reflow(t),this.errorBars)for(var i=0;i<this.errorBars.length;i++)this.errorBars[i].reflow(t)},e.prototype.createVisual=function(){var e=this,i=this.box,o=this.options,r=o.visual;if(!1!==this.visible)if(t.prototype.createVisual.call(this),r){var n=this.rectVisual=r({category:this.category,dataItem:this.dataItem,value:this.value,sender:this.getSender(),series:this.series,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,rect:i.toRect(),createVisual:function(){var t=new a.Group;return e.createRect(t),t},options:o});n&&this.visual.append(n)}else i.width()>0&&i.height()>0&&this.createRect(this.visual)},e.prototype.createRect=function(t){var e=this.options,i=e.border,o=Nr(i.opacity)?i.opacity:e.opacity,r=this.box.toRect();r.size.width=Math.round(r.size.width);var n=this.rectVisual=a.Path.fromRect(r,{fill:{color:this.color,opacity:e.opacity},stroke:{color:this.getBorderColor(),width:i.width,opacity:o,dashType:i.dashType}}),s=this.box.width(),p=this.box.height();if((e.vertical?s:p)>6&&(Ko(n),(s<1||p<1)&&(n.options.stroke.lineJoin="round")),t.append(n),lp(e)){var h=this.createGradientOverlay(n,{baseColor:this.color},or({end:e.vertical?void 0:[0,1]},e.overlay));t.append(h)}},e.prototype.createHighlight=function(t){return Ko(a.Path.fromRect(this.box.toRect(),t))},e.prototype.highlightVisual=function(){return this.rectVisual},e.prototype.highlightVisualArgs=function(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}},e.prototype.getBorderColor=function(){var t=this.color,e=this.options.border,i=e._brightness||.8,o=e.color;return Nr(o)||(o=new dn(t).brightness(i).toHex()),o},e.prototype.tooltipAnchor=function(){var t,e,i=this.options,o=this.box,r=this.aboveAxis,n=this.owner.pane.clipBox()||o,s=g,a=_;if(i.vertical)t=Math.min(o.x2,n.x2)+5,r?e=Math.max(o.y1,n.y1):(e=Math.min(o.y2,n.y2),a=u);else{var p=Math.max(o.x1,n.x1),h=Math.min(o.x2,n.x2);i.isStacked?(a=u,r?(s=b,t=h):t=p,e=Math.max(o.y1,n.y1)-5):(r?t=h+5:(t=p-5,s=b),e=Math.max(o.y1,n.y1))}return{point:new An(t,e),align:{horizontal:s,vertical:a}}},e.prototype.overlapsBox=function(t){return this.box.overlaps(t)},e.prototype.pointData=function(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,series:this.series}},e}(Bn);or(up.prototype,Fa),or(up.prototype,Da),up.prototype.defaults={border:{width:1},vertical:!0,overlay:{gradient:"glass"},labels:{visible:!1,format:"{0}"},opacity:1,notes:{label:{}}};var fp=up;function dp(t,e){t.forEach(e)}function yp(t,e){for(var i=t.length,o=i-1;o>=0;o--)e(t[o],o-i-1)}var vp=function(t){function e(e){t.call(this,e),this.forEach=e.rtl?yp:dp}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.options,i=e.vertical,o=e.gap,r=e.spacing,n=this.children,s=n.length,a=i?k:S,p=s+o+r*(s-1),h=(i?t.height():t.width())/p,c=t[a+1]+h*(o/2);this.forEach(n,(function(e,i){var o=(e.box||t).clone();o[a+1]=c,o[a+2]=c+h,e.reflow(o),i<s-1&&(c+=h*r),c+=h}))},e}(Bn);sn(vp,{vertical:!1,gap:0,spacing:0});var gp=vp,mp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){for(var e=this.options.vertical?S:k,i=this.children,o=i.length,r=this.box=new kn,n=0;n<o;n++){var s=i[n];if(!1!==s.visible){var a=s.box.clone();a.snapTo(t,e),0===n&&(r=this.box=a.clone()),s.reflow(a),r.wrap(a)}}},e}(Bn);sn(mp,{vertical:!0});var xp=mp,bp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){t.prototype.render.call(this),this.updateStackRange()},e.prototype.pointType=function(){return fp},e.prototype.clusterType=function(){return gp},e.prototype.stackType=function(){return xp},e.prototype.stackLimits=function(e,i){return t.prototype.stackLimits.call(this,e,i)},e.prototype.createPoint=function(t,e){var i=e.categoryIx,o=e.category,r=e.series,n=e.seriesIx,s=this.options,a=this.children,p=s.isStacked,h=this.pointValue(t),c=this.pointOptions(r,n),l=c.labels;p&&"outsideEnd"===l.position&&(l.position="insideEnd"),c.isStacked=p;var u=t.fields.color||r.color;h<0&&c.negativeColor&&(u=c.negativeColor),c=this.evalPointOptions(c,h,o,i,r,n),er(r.color)&&(u=c.color);var f=new(this.pointType())(h,c);f.color=u;var d=a[i];d||(d=new(this.clusterType())({vertical:s.invertAxes,gap:s.gap,spacing:s.spacing,rtl:!s.invertAxes&&(this.chartService||{}).rtl}),this.append(d));p?this.getStackWrap(r,d).append(f):d.append(f);return f},e.prototype.getStackWrap=function(t,e){var i,o=t.stack,r=o&&o.group||o,n=e.children;if("string"==typeof r){for(var s=0;s<n.length;s++)if(n[s]._stackGroup===r){i=n[s];break}}else i=n[0];i||((i=new(this.stackType())({vertical:!this.options.invertAxes}))._stackGroup=r,e.append(i));return i},e.prototype.categorySlot=function(t,e,i){var o=this.options,r=t.getSlot(e),n=i.startValue();if(o.isStacked){var s=i.getSlot(n,n,!0),a=o.invertAxes?S:k;r[a+1]=r[a+2]=s[a+1]}return r},e.prototype.reflowCategories=function(t){for(var e=this.children,i=e.length,o=0;o<i;o++)e[o].reflow(t[o])},e.prototype.createAnimation=function(){this._setAnimationOptions(),t.prototype.createAnimation.call(this),Qa(this.options.series)&&this._setChildrenAnimation()},e.prototype._setChildrenAnimation=function(){for(var t=this.points,e=0;e<t.length;e++){var i=t[e],o=i.visual;o&&Nr(o.options.zIndex)&&(i.options.animation=this.options.animation,i.createAnimation())}},e.prototype._setAnimationOptions=function(){var t,e=this.options,i=e.animation||{};if(e.isStacked){var o=this.seriesValueAxis(e.series[0]);t=o.getSlot(o.startValue())}else t=this.categoryAxis.getSlot(0);i.origin=new p.Point(t.x1,t.y1),i.vertical=!e.invertAxes},e}(Va);sn(bp,{animation:{type:ka}});var _p=bp,wp=function(t){function e(e,i){t.call(this,i),this.value=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.options,i=this.value,o=this.owner.seriesValueAxis(e),r=o.getSlot(i.open,i.close),n=o.getSlot(i.low,i.high);r.x1=n.x1=t.x1,r.x2=n.x2=t.x2,this.realBody=r;var s=n.center().x,a=[];a.push([[s,n.y1],[s,r.y1]]),a.push([[s,r.y2],[s,n.y2]]),this.lines=a,this.box=n.clone().wrap(r),this._rendered||(this._rendered=!0,this.createNote()),this.reflowNote()},e.prototype.reflowNote=function(){this.note&&this.note.reflow(this.box)},e.prototype.createVisual=function(){t.prototype.createVisual.call(this),this._mainVisual=this.mainVisual(this.options),this.visual.append(this._mainVisual),this.createOverlay()},e.prototype.mainVisual=function(t){var e=new a.Group;return this.createBody(e,t),this.createLines(e,t),e},e.prototype.createBody=function(t,e){var i=a.Path.fromRect(this.realBody.toRect(),{fill:{color:this.color,opacity:e.opacity},stroke:null});e.border.width>0&&i.options.set("stroke",{color:this.getBorderColor(),width:e.border.width,dashType:e.border.dashType,opacity:on(e.border.opacity,e.opacity)}),Ko(i),t.append(i),lp(e)&&t.append(this.createGradientOverlay(i,{baseColor:this.color},or({end:e.vertical?void 0:[0,1]},e.overlay)))},e.prototype.createLines=function(t,e){this.drawLines(t,e,this.lines,e.line)},e.prototype.drawLines=function(t,e,i,o){if(i)for(var r={stroke:{color:o.color||this.color,opacity:on(o.opacity,e.opacity),width:o.width,dashType:o.dashType,lineCap:"butt"}},n=0;n<i.length;n++){var s=a.Path.fromPoints(i[n],r);Ko(s),t.append(s)}},e.prototype.getBorderColor=function(){var t=this.options.border,e=t.color;return Nr(e)||(e=new dn(this.color).brightness(t._brightness).toHex()),e},e.prototype.createOverlay=function(){var t=a.Path.fromRect(this.box.toRect(),{fill:{color:A,opacity:0},stroke:null});this.visual.append(t)},e.prototype.createHighlight=function(){var t=this.options.highlight,e=this.color;this.color=t.color||this.color;var i=this.mainVisual(or({},this.options,{line:{color:this.getBorderColor()}},t));return this.color=e,i},e.prototype.highlightVisual=function(){return this._mainVisual},e.prototype.highlightVisualArgs=function(){return{options:this.options,rect:this.box.toRect(),visual:this._mainVisual}},e.prototype.tooltipAnchor=function(){var t=this.box,e=this.owner.pane.clipBox()||t;return{point:new An(t.x2+5,Math.max(t.y1,e.y1)+5),align:{horizontal:g,vertical:_}}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e.prototype.overlapsBox=function(t){return this.box.overlaps(t)},e}(Bn);sn(wp,{vertical:!0,border:{_brightness:.8},line:{width:2},overlay:{gradient:"glass"},tooltip:{format:"<table><tr><th colspan='2'>{4:d}</th></tr><tr><td>Open:</td><td>{0:C}</td></tr><tr><td>High:</td><td>{1:C}</td></tr><tr><td>Low:</td><td>{2:C}</td></tr><tr><td>Close:</td><td>{3:C}</td></tr></table>"},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}}}),or(wp.prototype,Fa),or(wp.prototype,Da);var Ap=wp;function Sp(t){return fa(t)===t.length}var kp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflowCategories=function(t){for(var e=this.children,i=e.length,o=0;o<i;o++)e[o].reflow(t[o])},e.prototype.addValue=function(t,e){var i,o=e.categoryIx,r=e.category,n=e.series,s=e.seriesIx,a=this.children,p=this.options,h=t.valueFields,c=Sp(this.splitValue(h)),l=n.data[o],u=this.categoryPoints[o];u||(this.categoryPoints[o]=u=[]),c&&(i=this.createPoint(t,e));var f=a[o];f||(f=new gp({vertical:p.invertAxes,gap:p.gap,spacing:p.spacing,rtl:!p.invertAxes&&(this.chartService||{}).rtl}),this.append(f)),i&&(this.updateRange(h,e),f.append(i),i.categoryIx=o,i.category=r,i.series=n,i.seriesIx=s,i.owner=this,i.dataItem=l,i.noteText=t.fields.noteText),this.points.push(i),u.push(i)},e.prototype.pointType=function(){return Ap},e.prototype.createPoint=function(t,e){var i=e.categoryIx,o=e.category,r=e.series,n=e.seriesIx,s=this.pointType(),a=t.valueFields,p=or({},r),h=t.fields.color||r.color;p=this.evalPointOptions(p,a,o,i,r,n),"candlestick"===r.type&&a.open>a.close&&(h=t.fields.downColor||r.downColor||r.color),er(r.color)&&(h=p.color),p.vertical=!this.options.invertAxes;var c=new s(a,p);return c.color=h,c},e.prototype.splitValue=function(t){return[t.low,t.open,t.close,t.high]},e.prototype.updateRange=function(t,e){var i=e.series.axis,o=this.splitValue(t),r=this.valueAxisRanges[i];r=this.valueAxisRanges[i]=r||{min:m,max:x},r=this.valueAxisRanges[i]={min:Math.min.apply(Math,o.concat([r.min])),max:Math.max.apply(Math,o.concat([r.max]))}},e.prototype.formatPointValue=function(t,e){var i=t.value;return this.chartService.format.auto(e,i.open,i.high,i.low,i.close,t.category)},e.prototype.animationPoints=function(){return this.points},e}(Va);or(kp.prototype,tp);var Cp=kp,Pp=function(t){function e(e,i){t.call(this,e,i),this.createNote()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e,i,o=this.options,r=this.value,n=this.owner.seriesValueAxis(o);this.boxSlot=i=n.getSlot(r.q1,r.q3),this.realBody=i,this.reflowBoxSlot(t),this.whiskerSlot=e=n.getSlot(r.lower,r.upper),this.reflowWhiskerSlot(t);var s=n.getSlot(r.median);if(r.mean){var a=n.getSlot(r.mean);this.meanPoints=this.calcMeanPoints(t,a)}this.whiskerPoints=this.calcWhiskerPoints(i,e),this.medianPoints=this.calcMedianPoints(t,s),this.box=e.clone().wrap(i),this.reflowNote()},e.prototype.reflowBoxSlot=function(t){this.boxSlot.x1=t.x1,this.boxSlot.x2=t.x2},e.prototype.reflowWhiskerSlot=function(t){this.whiskerSlot.x1=t.x1,this.whiskerSlot.x2=t.x2},e.prototype.calcMeanPoints=function(t,e){return[[[t.x1,e.y1],[t.x2,e.y1]]]},e.prototype.calcWhiskerPoints=function(t,e){var i=e.center().x;return[[[i-5,e.y1],[i+5,e.y1],[i,e.y1],[i,t.y1]],[[i-5,e.y2],[i+5,e.y2],[i,e.y2],[i,t.y2]]]},e.prototype.calcMedianPoints=function(t,e){return[[[t.x1,e.y1],[t.x2,e.y1]]]},e.prototype.renderOutliers=function(t){for(var e=this.value,i=e.outliers||[],o=3*Math.abs(e.q3-e.q1),r=[],n=t.markers||{},s=0;s<i.length;s++){var a=i[s],p=or({},(n=a<e.q3+o&&a>e.q1-o?t.outliers:t.extremes).border);Nr(p.color)||(Nr(this.color)?p.color=this.color:p.color=new dn(n.background).brightness(.8).toHex());var h=new zn({type:n.type,width:n.size,height:n.size,rotation:n.rotation,background:n.background,border:p,opacity:n.opacity});h.value=a,r.push(h)}return this.reflowOutliers(r),r},e.prototype.reflowOutliers=function(t){for(var e=this.owner.seriesValueAxis(this.options),i=this.box.center(),o=0;o<t.length;o++){var r=t[o].value,n=e.getSlot(r);this.options.vertical?n.move(i.x):n.move(void 0,i.y),this.box=this.box.wrap(n),t[o].reflow(n)}},e.prototype.mainVisual=function(e){for(var i=t.prototype.mainVisual.call(this,e),o=this.renderOutliers(e),r=0;r<o.length;r++){var n=o[r].getElement();n&&i.append(n)}return i},e.prototype.createLines=function(t,e){this.drawLines(t,e,this.whiskerPoints,e.whiskers),this.drawLines(t,e,this.medianPoints,e.median),this.drawLines(t,e,this.meanPoints,e.mean)},e.prototype.getBorderColor=function(){return(this.options.border||{}).color?this.options.border.color:this.color?this.color:t.prototype.getBorderColor.call(this)},e}(Ap);sn(Pp,{border:{_brightness:.8},line:{width:2},median:{color:"#f6f6f6"},mean:{width:2,dashType:"dash",color:"#f6f6f6"},overlay:{gradient:"glass"},tooltip:{format:"<table><tr><th colspan='2'>{6:d}</th></tr><tr><td>Lower:</td><td>{0:C}</td></tr><tr><td>Q1:</td><td>{1:C}</td></tr><tr><td>Median:</td><td>{2:C}</td></tr><tr><td>Mean:</td><td>{5:C}</td></tr><tr><td>Q3:</td><td>{3:C}</td></tr><tr><td>Upper:</td><td>{4:C}</td></tr></table>"},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}},outliers:{visible:!0,size:8,type:"cross",background:A,border:{width:2,opacity:1},opacity:0},extremes:{visible:!0,size:8,type:d,background:A,border:{width:2,opacity:1},opacity:0}}),or(Pp.prototype,Fa);var Tp=Pp,Mp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflowBoxSlot=function(t){this.boxSlot.y1=t.y1,this.boxSlot.y2=t.y2},e.prototype.reflowWhiskerSlot=function(t){this.whiskerSlot.y1=t.y1,this.whiskerSlot.y2=t.y2},e.prototype.calcMeanPoints=function(t,e){return[[[e.x1,t.y1],[e.x1,t.y2]]]},e.prototype.calcWhiskerPoints=function(t,e){var i=e.center().y;return[[[e.x1,i-5],[e.x1,i+5],[e.x1,i],[t.x1,i]],[[e.x2,i-5],[e.x2,i+5],[e.x2,i],[t.x2,i]]]},e.prototype.calcMedianPoints=function(t,e){return[[[e.x1,t.y1],[e.x1,t.y2]]]},e}(Tp),Op=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addValue=function(t,e){var i,o=e.categoryIx,r=e.category,n=e.series,s=e.seriesIx,a=this.children,p=this.options,h=t.valueFields,c=Sp(this.splitValue(h)),l=n.data[o],u=this.categoryPoints[o];u||(this.categoryPoints[o]=u=[]),c&&(i=this.createPoint(t,e));var f=a[o];f||(f=new gp({vertical:p.invertAxes,gap:p.gap,spacing:p.spacing,rtl:!p.invertAxes&&(this.chartService||{}).rtl}),this.append(f)),i&&(this.updateRange(h,e),f.append(i),i.categoryIx=o,i.category=r,i.series=n,i.seriesIx=s,i.owner=this,i.dataItem=l),this.points.push(i),u.push(i)},e.prototype.pointType=function(){return this.options.invertAxes?Mp:Tp},e.prototype.splitValue=function(t){return[t.lower,t.q1,t.median,t.q3,t.upper]},e.prototype.updateRange=function(t,e){var i=e.series.axis,o=this.valueAxisRanges[i],r=this.splitValue(t).concat(this.filterOutliers(t.outliers));Nr(t.mean)&&(r=r.concat(t.mean)),o=this.valueAxisRanges[i]=o||{min:m,max:x},o=this.valueAxisRanges[i]={min:Math.min.apply(Math,r.concat([o.min])),max:Math.max.apply(Math,r.concat([o.max]))}},e.prototype.formatPointValue=function(t,e){var i=t.value;return this.chartService.format.auto(e,i.lower,i.q1,i.median,i.q3,i.upper,i.mean,t.category)},e.prototype.filterOutliers=function(t){for(var e=(t||[]).length,i=[],o=0;o<e;o++){var r=t[o];Nr(r)&&null!==r&&i.push(r)}return i},e.prototype.supportsPointInactiveOpacity=function(){return!1},e}(Cp),Rp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getAxis=function(){var t=this.chart.seriesAxes(this.series);return this.isVertical?t.y:t.x},e}(ja);function Bp(t){return Nr(t)&&null!==t}var jp=function(t){function e(e,i){t.call(this,i),this.plotArea=e,this.chartService=e.chartService,this._initFields(),this.render()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initFields=function(){this.xAxisRanges={},this.yAxisRanges={},this.points=[],this.seriesPoints=[],this.seriesOptions=[],this._evalSeries=[]},e.prototype.render=function(){this.traverseDataPoints(this.addValue.bind(this))},e.prototype.addErrorBar=function(t,e,i){var o,r=t.value[e],n=e+"Value",s=e+"ErrorLow",a=e+"ErrorHigh",p=i.seriesIx,h=i.series,c=t.options.errorBars,l=i[s],u=i[a];$o(r)&&($o(l)&&$o(u)&&(o={low:l,high:u}),c&&Nr(c[n])&&(this.seriesErrorRanges=this.seriesErrorRanges||{x:[],y:[]},this.seriesErrorRanges[e][p]=this.seriesErrorRanges[e][p]||new _a(c[n],h,e),o=this.seriesErrorRanges[e][p].getErrorRange(r,c[n])),o&&this.addPointErrorBar(o,t,e))},e.prototype.addPointErrorBar=function(t,e,i){var o=t.low,r=t.high,n=e.series,s=e.options.errorBars,a=i===k,p={};e[i+"Low"]=o,e[i+"High"]=r,e.errorBars=e.errorBars||[];var h=new Rp(o,r,a,this,n,s);e.errorBars.push(h),e.append(h),p[i]=o,this.updateRange(p,n),p[i]=r,this.updateRange(p,n)},e.prototype.addValue=function(t,e){var i,o=t.x,r=t.y,n=e.seriesIx,s=this.options.series[n],a=this.seriesMissingValues(s),p=this.seriesPoints[n],h=t;Bp(o)&&Bp(r)||(h=this.createMissingValue(h,a)),h&&((i=this.createPoint(h,e))&&(Object.assign(i,e),this.addErrorBar(i,S,e),this.addErrorBar(i,k,e)),this.updateRange(h,e.series)),this.points.push(i),p.push(i)},e.prototype.seriesMissingValues=function(t){return t.missingValues},e.prototype.createMissingValue=function(){},e.prototype.updateRange=function(t,e){var i=this.chartService.intl,o=e.xAxis,r=e.yAxis,n=t.x,s=t.y,a=this.xAxisRanges[o],p=this.yAxisRanges[r];Bp(n)&&(a=this.xAxisRanges[o]=a||{min:m,max:x},Qo(n)&&(n=ws(i,n)),a.min=Math.min(a.min,n),a.max=Math.max(a.max,n)),Bp(s)&&(p=this.yAxisRanges[r]=p||{min:m,max:x},Qo(s)&&(s=ws(i,s)),p.min=Math.min(p.min,s),p.max=Math.max(p.max,s))},e.prototype.evalPointOptions=function(t,e,i){var o=i.series,r=i.seriesIx,n={defaults:o._defaults,excluded:["data","tooltip","content","template","visual","toggle","_outOfRangeMinPoint","_outOfRangeMaxPoint"]},s=this._evalSeries[r];Nr(s)||(this._evalSeries[r]=s=La(t,{},n,!0));var a=t;return s&&La(a=or({},t),{value:e,series:o,dataItem:i.dataItem},n),a},e.prototype.pointType=function(){return Ha},e.prototype.pointOptions=function(t,e){var i=this.seriesOptions[e];if(!i){var o=this.pointType().prototype.defaults;this.seriesOptions[e]=i=or({},o,{markers:{opacity:t.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},t)}return i},e.prototype.createPoint=function(t,e){var i=e.series,o=this.pointOptions(i,e.seriesIx),r=e.color||i.color;o=this.evalPointOptions(o,t,e),er(i.color)&&(r=o.color);var n=new Ha(t,o);return n.color=r,this.append(n),n},e.prototype.seriesAxes=function(t){var e=t.xAxis,i=t.yAxis,o=this.plotArea,r=e?o.namedXAxes[e]:o.axisX,n=i?o.namedYAxes[i]:o.axisY;if(!r)throw new Error("Unable to locate X axis with name "+e);if(!n)throw new Error("Unable to locate Y axis with name "+i);return{x:r,y:n}},e.prototype.reflow=function(t){var e=this,i=this.points,o=!this.options.clip,r=0;this.traverseDataPoints((function(t,n){var s=i[r++],a=e.seriesAxes(n.series),p=a.x.getSlot(t.x,t.x,o),h=a.y.getSlot(t.y,t.y,o);if(s)if(p&&h){var c=e.pointSlot(p,h);s.reflow(c)}else s.visible=!1})),this.box=t},e.prototype.pointSlot=function(t,e){return new kn(t.x1,e.y1,t.x2,e.y2)},e.prototype.traverseDataPoints=function(t){for(var e=this.options.series,i=this.seriesPoints,o=0;o<e.length;o++){var r=e[o];i[o]||(i[o]=[]);for(var n=0;n<r.data.length;n++){var s=this._bindPoint(r,o,n),a=s.valueFields,p=s.fields;t(a,or({pointIx:n,series:r,seriesIx:o,dataItem:r.data[n],owner:this},p))}}},e.prototype.formatPointValue=function(t,e){var i=t.value;return this.chartService.format.auto(e,i.x,i.y)},e.prototype.animationPoints=function(){for(var t=this.points,e=[],i=0;i<t.length;i++)e.push((t[i]||{}).marker);return e},e}(Bn);sn(jp,{series:[],tooltip:{format:"{0}, {1}"},labels:{format:"{0}, {1}"},clip:!0}),or(jp.prototype,tp,{_bindPoint:Va.prototype._bindPoint});var Ip=jp,Lp=function(t){function e(e,i){t.call(this,e,i),this.category=e.category}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createHighlight=function(){var t=this.options.highlight,e=t.border,i=this.options.markers,o=this.box.center(),r=(i.size+i.border.width+e.width)/2,n=new a.Group,s=new a.Circle(new p.Circle([o.x,o.y+r/5+e.width/2],r+e.width/2),{stroke:{color:"none"},fill:this.createGradient({gradient:"bubbleShadow",color:i.background,stops:[{offset:0,color:i.background,opacity:.3},{offset:1,color:i.background,opacity:0}]})}),h=new a.Circle(new p.Circle([o.x,o.y],r),{stroke:{color:e.color||new dn(i.background).brightness(.8).toHex(),width:e.width,opacity:e.opacity},fill:{color:i.background,opacity:t.opacity}});return n.append(s,h),n},e}(Ha);Lp.prototype.defaults=or({},Lp.prototype.defaults,{labels:{position:f},highlight:{opacity:1,border:{color:"#fff",width:2,opacity:1}}}),Lp.prototype.defaults.highlight.zIndex=void 0;var zp=Lp,Ep=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initFields=function(){this._maxSize=x,t.prototype._initFields.call(this)},e.prototype.addValue=function(e,i){null!==e.size&&(e.size>0||e.size<0&&i.series.negativeValues.visible)?(this._maxSize=Math.max(this._maxSize,Math.abs(e.size)),t.prototype.addValue.call(this,e,i)):(this.points.push(null),this.seriesPoints[i.seriesIx].push(null))},e.prototype.reflow=function(e){this.updateBubblesSize(e),t.prototype.reflow.call(this,e)},e.prototype.pointType=function(){return zp},e.prototype.createPoint=function(t,e){var i=e.series,o=i.data.length,r=e.pointIx*(600/o),n={delay:r,duration:600-r,type:"bubble"},s=e.color||i.color;t.size<0&&i.negativeValues.visible&&(s=on(i.negativeValues.color,s));var a=or({labels:{animation:{delay:r,duration:600-r}}},this.pointOptions(i,e.seriesIx),{markers:{type:d,border:i.border,opacity:i.opacity,animation:n}});a=this.evalPointOptions(a,t,e),er(i.color)&&(s=a.color),a.markers.background=s;var p=new zp(t,a);return p.color=s,this.append(p),p},e.prototype.updateBubblesSize=function(t){for(var e=this.options.series,i=Math.min(t.width(),t.height()),o=0;o<e.length;o++)for(var r=e[o],n=this.seriesPoints[o],s=(r.minSize||Math.max(.02*i,10))/2,a=(r.maxSize||.2*i)/2,p=Math.PI*s*s,h=(Math.PI*a*a-p)/this._maxSize,c=0;c<n.length;c++){var l=n[c];if(l){var u=Math.abs(l.value.size)*h,f=Math.sqrt((p+u)/Math.PI),d=on(l.options.zIndex,0)+(1-f/a);or(l.options,{zIndex:d,markers:{size:2*f,zIndex:d},labels:{zIndex:d+1}})}}},e.prototype.formatPointValue=function(t,e){var i=t.value;return this.chartService.format.auto(e,i.x,i.y,i.size,t.category)},e.prototype.createAnimation=function(){},e.prototype.createVisual=function(){},e}(Ip);sn(Ep,{tooltip:{format:"{3}"},labels:{format:"{3}"}});var Vp=Ep,Fp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(zn);or(Fp.prototype,Fa);var Dp=Fp,Up=function(t){function e(e,i){t.call(this,i),this.aboveAxis=this.options.aboveAxis,this.color=i.color||A,this.value=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=this.options;this._rendered||(this._rendered=!0,Nr(this.value.target)&&(this.target=new Dp({type:t.target.shape,background:t.target.color||this.color,opacity:t.opacity,zIndex:t.zIndex,border:t.target.border,vAlign:_,align:b}),this.target.value=this.value,this.target.dataItem=this.dataItem,this.target.series=this.series,this.append(this.target)),this.createNote())},e.prototype.reflow=function(t){this.render();var e=this.options,i=this.target,o=this.owner,r=e.invertAxes,n=o.seriesValueAxis(this.options),s=o.categorySlot(o.categoryAxis,e.categoryIx,n),a=n.getSlot(this.value.target),p=r?a:s,h=r?s:a;if(i){var c=new kn(p.x1,h.y1,p.x2,h.y2);i.options.height=r?c.height():e.target.line.width,i.options.width=r?e.target.line.width:c.width(),i.reflow(c)}this.note&&this.note.reflow(t),this.box=t},e.prototype.createVisual=function(){t.prototype.createVisual.call(this);var e=this.options,i=a.Path.fromRect(this.box.toRect(),{fill:{color:this.color,opacity:e.opacity},stroke:null});e.border.width>0&&i.options.set("stroke",{color:e.border.color||this.color,width:e.border.width,dashType:e.border.dashType,opacity:on(e.border.opacity,e.opacity)}),this.bodyVisual=i,Ko(i),this.visual.append(i)},e.prototype.createAnimation=function(){this.bodyVisual&&(this.animation=a.Animation.create(this.bodyVisual,this.options.animation))},e.prototype.createHighlight=function(t){return a.Path.fromRect(this.box.toRect(),t)},e.prototype.highlightVisual=function(){return this.bodyVisual},e.prototype.highlightVisualArgs=function(){return{rect:this.box.toRect(),visual:this.bodyVisual,options:this.options}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e}(Bn);Up.prototype.tooltipAnchor=fp.prototype.tooltipAnchor,sn(Up,{border:{width:1},vertical:!1,opacity:1,target:{shape:"",border:{width:0,color:"green"},line:{width:2}},tooltip:{format:"Current: {0}<br />Target: {1}"}}),or(Up.prototype,Fa),or(Up.prototype,Da);var Hp=Up,Gp=function(t){function e(e,i){!function(t){for(var e=t.series,i=0;i<e.length;i++){var o=e[i],r=o.data;!r||C(r[0])||rr(r[0])||(o.data=[r])}}(i),t.call(this,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflowCategories=function(t){for(var e=this.children,i=e.length,o=0;o<i;o++)e[o].reflow(t[o])},e.prototype.plotRange=function(t){var e=t.series,i=this.seriesValueAxis(e),o=this.categoryAxisCrossingValue(i);return[o,t.value.current||o]},e.prototype.createPoint=function(t,e){var i=e.categoryIx,o=e.category,r=e.series,n=e.seriesIx,s=this.options,a=this.children,p=t.valueFields,h=or({vertical:!s.invertAxes,overlay:r.overlay,categoryIx:i,invertAxes:s.invertAxes},r),c=t.fields.color||r.color;h=this.evalPointOptions(h,p,o,i,r,n),er(r.color)&&(c=h.color);var l=new Hp(p,h);l.color=c;var u=a[i];return u||(u=new gp({vertical:s.invertAxes,gap:s.gap,spacing:s.spacing,rtl:!s.invertAxes&&(this.chartService||{}).rtl}),this.append(u)),u.append(l),l},e.prototype.updateRange=function(t,e){var i=t.current,o=t.target,r=e.series.axis,n=this.valueAxisRanges[r];Nr(i)&&!isNaN(i)&&Nr(o&&!isNaN(o))&&((n=this.valueAxisRanges[r]=n||{min:m,max:x}).min=Math.min(n.min,i,o),n.max=Math.max(n.max,i,o))},e.prototype.formatPointValue=function(t,e){return this.chartService.format.auto(e,t.value.current,t.value.target)},e.prototype.pointValue=function(t){return t.valueFields.current},e.prototype.aboveAxis=function(t){return t.value.current>0},e.prototype.createAnimation=function(){var t=this.points;this._setAnimationOptions();for(var e=0;e<t.length;e++){var i=t[e];i.options.animation=this.options.animation,i.createAnimation()}},e}(Va);Gp.prototype._setAnimationOptions=_p.prototype._setAnimationOptions,sn(Gp,{animation:{type:ka}});var Np=Gp,Wp=function(t){function e(e,i){t.call(this),this.chartService=e,this.options=or({},this.options,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getStyle=function(t,e){var i=t.background,o=t.border.color;if(e){var r=e.color||e.options.color;i=on(i,r),o=on(o,r)}var n=hr(t.padding||{},"auto");return{backgroundColor:i,borderColor:o,font:t.font,color:t.color,opacity:t.opacity,borderWidth:nr(t.border.width),paddingTop:nr(n.top),paddingBottom:nr(n.bottom),paddingLeft:nr(n.left),paddingRight:nr(n.right)}},e.prototype.show=function(t,e,i){t.format=e.format;var o=this.getStyle(e,i);t.style=o;var r=new dn(o.backgroundColor);Nr(e.color)||r.isDark()||(t.className="k-chart-tooltip-inverse"),this.chartService.notify("showTooltip",t),this.visible=!0},e.prototype.hide=function(){this.chartService&&this.chartService.notify("hideTooltip"),this.visible=!1},e.prototype.destroy=function(){delete this.chartService},e}(O);sn(Wp,{border:{width:1},opacity:1});var qp=Wp,Xp=function(t){function e(e,i,o){t.call(this,e,o),this.crosshair=i,this.formatService=e.format,this.initAxisName()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initAxisName=function(){var t,e=this.crosshair.axis;t=e.plotArea.categoryAxis?e.getCategory?"categoryAxis":"valueAxis":e.options.vertical?"yAxis":"xAxis",this.axisName=t},e.prototype.showAt=function(t){var e=this.crosshair.axis,i=this.options,o=e[i.stickyMode?"getCategory":"getValue"](t),r=o;i.format?r=this.formatService.auto(i.format,o):e.options.type===y&&(r=this.formatService.auto(e.options.labels.dateFormats[e.options.baseUnit],o)),this.show({point:t,anchor:this.getAnchor(),crosshair:this.crosshair,value:r,axisName:this.axisName,axisIndex:this.crosshair.axis.axisIndex},this.options)},e.prototype.hide=function(){this.chartService.notify("hideTooltip",{crosshair:this.crosshair,axisName:this.axisName,axisIndex:this.crosshair.axis.axisIndex})},e.prototype.getAnchor=function(){var t,e,i,o=this.crosshair,r=this.options,n=r.position,s=r.padding,a=!o.axis.options.vertical,p=o.line.bbox();return a?(t=f,n===u?(e=_,i=p.bottomLeft().translate(0,s)):(e=u,i=p.topLeft().translate(0,-s))):(e=f,n===g?(t=b,i=p.topLeft().translate(-s,0)):(t=g,i=p.topRight().translate(s,0))),{point:i,align:{horizontal:t,vertical:e}}},e}(qp);sn(Xp,{padding:10});var Yp=Xp,Zp=function(t){function e(e,i,o){t.call(this,o),this.axis=i,this.stickyMode=i instanceof Cs;var r=this.options.tooltip;r.visible&&(this.tooltip=new Yp(e,this,or({},r,{stickyMode:this.stickyMode})))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.showAt=function(t){this.point=t,this.moveLine(),this.line.visible(!0),this.tooltip&&this.tooltip.showAt(t)},e.prototype.hide=function(){this.line.visible(!1),this.tooltip&&this.tooltip.hide()},e.prototype.moveLine=function(){var t,e=this.axis,i=this.point,o=e.options.vertical,r=this.getBox(),n=o?k:S,s=new p.Point(r.x1,r.y1);if(t=o?new p.Point(r.x2,r.y1):new p.Point(r.x1,r.y2),i)if(this.stickyMode){var a=e.getSlot(e.pointCategoryIndex(i));s[n]=t[n]=a.center()[n]}else s[n]=t[n]=i[n];this.box=r,this.line.moveTo(s).lineTo(t)},e.prototype.getBox=function(){for(var t,e=this.axis,i=e.pane.axes,o=i.length,r=e.options.vertical,n=e.lineBox().clone(),s=r?S:k,a=0;a<o;a++){var p=i[a];p.options.vertical!==r&&(t?t.wrap(p.lineBox()):t=p.lineBox().clone())}return n[s+1]=t[s+1],n[s+2]=t[s+2],n},e.prototype.createVisual=function(){t.prototype.createVisual.call(this);var e=this.options;this.line=new a.Path({stroke:{color:e.color,width:e.width,opacity:e.opacity,dashType:e.dashType},visible:!1}),this.moveLine(),this.visual.append(this.line)},e.prototype.destroy=function(){this.tooltip&&this.tooltip.destroy(),t.prototype.destroy.call(this)},e}(Bn);sn(Zp,{color:l,width:2,zIndex:-1,tooltip:{visible:!1}});var Kp=Zp,Jp=function(t){function e(e,i){t.call(this,e),this.pane=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.shouldClip=function(){for(var t=this.children,e=t.length,i=0;i<e;i++)if(!0===t[i].options.clip)return!0;return!1},e.prototype._clipBox=function(){return this.pane.chartsBox()},e.prototype.createVisual=function(){if(this.visual=new a.Group({zIndex:0}),this.shouldClip()){var t=(this.clipBox=this._clipBox()).toRect(),e=a.Path.fromRect(t);Ko(e),this.visual.clip(e),this.unclipLabels()}},e.prototype.stackRoot=function(){return this},e.prototype.unclipLabels=function(){for(var t=this.children,e=this.clipBox,i=0;i<t.length;i++)for(var o=t[i].points||{},r=o.length,n=0;n<r;n++){var s=o[n];if(s&&!1!==s.visible&&s.overlapsBox&&s.overlapsBox(e))if(s.unclipElements)s.unclipElements();else{var a=s.label,p=s.note;a&&a.options.visible&&(a.alignToClipBox&&a.alignToClipBox(e),a.options.noclip=!0),p&&p.options.visible&&(p.options.noclip=!0)}}},e.prototype.destroy=function(){t.prototype.destroy.call(this),delete this.parent},e}(Bn);Jp.prototype.isStackRoot=!0;var $p=Jp,Qp=function(t){function e(e){t.call(this,e),this.id="pane"+th++,this.createTitle(),this.content=new Bn,this.chartContainer=new $p({},this),this.append(this.content),this.axes=[],this.charts=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createTitle=function(){var t=this.options.title;rr(t)&&(t=or({},t,{align:t.position,position:_})),this.title=Kn.buildTitle(t,this,e.prototype.options.title)},e.prototype.appendAxis=function(t){this.content.append(t),this.axes.push(t),t.pane=this},e.prototype.appendAxisAt=function(t,e){this.content.append(t),this.axes.splice(e,0,t),t.pane=this},e.prototype.appendChart=function(t){this.chartContainer.parent!==this.content&&this.content.append(this.chartContainer),this.charts.push(t),this.chartContainer.append(t),t.pane=this},e.prototype.empty=function(){var t=this.parent;if(t){for(var e=0;e<this.axes.length;e++)t.removeAxis(this.axes[e]);for(var i=0;i<this.charts.length;i++)t.removeChart(this.charts[i])}this.axes=[],this.charts=[],this.content.destroy(),this.content.children=[],this.chartContainer.children=[]},e.prototype.reflow=function(e){var i;Kr(this.children)===this.content&&(i=this.children.pop()),t.prototype.reflow.call(this,e),i&&this.children.push(i),this.title&&(this.contentBox.y1+=this.title.box.height())},e.prototype.visualStyle=function(){var e=t.prototype.visualStyle.call(this);return e.zIndex=-10,e},e.prototype.renderComplete=function(){this.options.visible&&this.createGridLines()},e.prototype.stackRoot=function(){return this},e.prototype.clipRoot=function(){return this},e.prototype.createGridLines=function(){for(var t=this.axes,e=t.concat(this.parent.axes),i=[],o=[],r=0;r<t.length;r++)for(var n=t[r],s=n.options.vertical,a=s?i:o,p=0;p<e.length;p++)if(0===a.length){var h=e[p];s!==h.options.vertical&&Hr(a,n.createGridLines(h))}},e.prototype.refresh=function(){this.visual.clear(),this.content.parent=null,this.content.createGradient=this.createGradient.bind(this),this.content.renderVisual(),this.content.parent=this,this.title&&this.visual.append(this.title.visual),this.visual.append(this.content.visual),this.renderComplete(),this.notifyRender()},e.prototype.chartsBox=function(){for(var t=this.axes,e=t.length,i=new kn,o=0;o<e;o++){var r=t[o],n=r.options.vertical?k:S,s=r.lineBox();i[n+1]=s[n+1],i[n+2]=s[n+2]}if(0===i.x2)for(var a=this.parent.axes,p=a.length,h=0;h<p;h++){var c=a[h];if(!c.options.vertical){var l=c.lineBox();i.x1=l.x1,i.x2=l.x2}}return i},e.prototype.clipBox=function(){return this.chartContainer.clipBox},e.prototype.notifyRender=function(){var t=this.getService();t&&t.notify("paneRender",{pane:new la(this),index:this.paneIndex,name:this.options.name})},e}(In),th=1;Qp.prototype.isStackRoot=!0,sn(Qp,{zIndex:-1,shrinkToFit:!0,title:{align:g},visible:!0});var eh=Qp;function ih(t,e){null!==e&&t.push(e)}function oh(t,e,i){var o=e.visible;if(Nr(o))return o;var r=t.pointVisibility;return r?r[i]:void 0}function rh(t){for(var e=t.data,i=[],o=0,r=0,n=0;n<e.length;n++){var s=ma.current.bindPoint(t,n),a=s.valueFields.value;Qo(a)&&(a=parseFloat(a)),$o(a)?(s.visible=!1!==oh(t,s.fields,n),s.value=Math.abs(a),i.push(s),s.visible&&(o+=s.value),0!==a&&r++):i.push(null)}return{total:o,points:i,count:r}}function nh(t,e){return t&&e?t.toLowerCase()===e.toLowerCase():t===e}function sh(t,e){for(var i=[],o=[].concat(e),r=0;r<t.length;r++){var n=t[r];Lr(n.type,o)&&i.push(n)}return i}function ah(t,e,i){if(null===e)return e;var o="_date_"+t,r=e[o];return r||(r=ws(i,Or(t)(e)),e[o]=r),r}function ph(t,e){var i=t.type,o=e instanceof Date;return!i&&o||nh(i,y)}function hh(t){return 1===t.length?t[0]:t}var ch=/area/i;function lh(t,e){var i=ma.current.bindPoint(t,null,e).valueFields;for(var o in i)if(tr(i[o]))return!0}function uh(t){var e,i,o=t.start,r=t.dir,n=t.min,s=t.max,a=t.getter,p=t.hasItem,h=t.series,c=o;do{p(c+=r)&&(e=lh(h,(i=a(c)).item))}while(n<=c&&c<=s&&!e);if(e)return i}function fh(t,e,i,o,r){var n=e.min,s=e.max,a=n>0&&n<i,p=s+1<i;if(a||p){var h,c,l;if("interpolate"!==function(t){return t.missingValues?t.missingValues:ch.test(t.type)||t.stack?Sa:"interpolate"}(t))a&&(h=o(n-1)),p&&(c=o(s+1));else a&&(h=lh(t,(l=o(n-1)).item)?l:uh({start:n,dir:-1,min:0,max:i-1,getter:o,hasItem:r,series:t})),p&&(c=lh(t,(l=o(s+1)).item)?l:uh({start:s,dir:1,min:0,max:i-1,getter:o,hasItem:r,series:t}));h&&(t._outOfRangeMinPoint=h),c&&(t._outOfRangeMaxPoint=c)}}var dh=function(t){function e(e,i,o){t.call(this,i),this.initFields(e,i),this.series=e,this.initSeries(),this.charts=[],this.options.legend=this.options.legend||{},this.options.legend.items=[],this.axes=[],this.crosshairs=[],this.chartService=o,this.originalOptions=i,this.createPanes(),this.render(),this.createCrosshairs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(){},e.prototype.initSeries=function(){for(var t=this.series,e=0;e<t.length;e++)t[e].index=e},e.prototype.createPanes=function(){for(var t=this.options.title||{},e=this.options.paneDefaults,i=this.options.panes||[],o=Math.max(i.length,1),r=[],n=or({title:{color:t.color}},e),s=0;s<o;s++){var a=or({},n,i[s]);Qo(a.title)&&(a.title=or({text:a.title},n.title));var p=new eh(a);p.paneIndex=s,r.push(p),this.append(p)}this.panes=r},e.prototype.crosshairOptions=function(t){return t.options.crosshair},e.prototype.createCrosshairs=function(t){void 0===t&&(t=this.panes);for(var e=0;e<t.length;e++)for(var i=t[e],o=0;o<i.axes.length;o++){var r=i.axes[o],n=this.crosshairOptions(r);if(n&&n.visible){var s=new Kp(this.chartService,r,n);this.crosshairs.push(s),i.content.append(s)}}},e.prototype.removeCrosshairs=function(t){for(var e=this.crosshairs,i=t.axes,o=e.length-1;o>=0;o--)for(var r=0;r<i.length;r++)if(e[o].axis===i[r]){e.splice(o,1);break}},e.prototype.hideCrosshairs=function(){for(var t=this.crosshairs,e=0;e<t.length;e++)t[e].hide()},e.prototype.findPane=function(t){for(var e,i=this.panes,o=0;o<i.length;o++)if(i[o].options.name===t){e=i[o];break}return e||i[0]},e.prototype.findPointPane=function(t){for(var e,i=this.panes,o=0;o<i.length;o++)if(i[o].box.containsPoint(t)){e=i[o];break}return e},e.prototype.appendAxis=function(t){this.findPane(t.options.pane).appendAxis(t),this.axes.push(t),t.plotArea=this},e.prototype.removeAxis=function(t){for(var e=[],i=0;i<this.axes.length;i++){var o=this.axes[i];t!==o?e.push(o):o.destroy()}this.axes=e},e.prototype.appendChart=function(t,e){this.charts.push(t),e?e.appendChart(t):this.append(t)},e.prototype.removeChart=function(t){for(var e=[],i=0;i<this.charts.length;i++){var o=this.charts[i];o!==t?e.push(o):o.destroy()}this.charts=e},e.prototype.addToLegend=function(t){for(var e=t.length,i=this.options.legend,o=i.labels||{},r=i.inactiveItems||{},n=r.labels||{},s=[],a=0;a<e;a++){var p=t[a],h=!1!==p.visible;if(!1!==p.visibleInLegend){var c=p.name,l=h?Pr(o):Pr(n)||Pr(o);l&&(c=l({text:Bp(c)?c:"",series:p}));var u=p._defaults,f=p.color;er(f)&&u&&(f=u.color);var d=void 0,y=void 0;h?(d={},y=f):(d={color:n.color,font:n.font},y=r.markers.color),Bp(c)&&""!==c&&s.push({text:c,labels:d,markerColor:y,series:p,active:h})}}Hr(i.items,s)},e.prototype.groupAxes=function(t){for(var e=[],i=[],o=0;o<t.length;o++)for(var r=t[o].axes,n=0;n<r.length;n++){var s=r[n];s.options.vertical?i.push(s):e.push(s)}return{x:e,y:i,any:e.concat(i)}},e.prototype.groupSeriesByPane=function(){for(var t=this.series,e={},i=0;i<t.length;i++){var o=t[i],r=this.seriesPaneName(o);e[r]?e[r].push(o):e[r]=[o]}return e},e.prototype.filterVisibleSeries=function(t){for(var e=[],i=0;i<t.length;i++){var o=t[i];!1!==o.visible&&e.push(o)}return e},e.prototype.reflow=function(t){var e=this.options.plotArea,i=this.panes,o=hr(e.margin);this.box=t.clone().unpad(o),this.reflowPanes(),this.detachLabels(),this.reflowAxes(i),this.reflowCharts(i)},e.prototype.redraw=function(t){var e=[].concat(t);this.initSeries();var i=this.getRoot();i&&i.cleanGradients();for(var o=0;o<e.length;o++)this.removeCrosshairs(e[o]),e[o].empty();this.render(e),this.detachLabels(),this.reflowAxes(this.panes),this.reflowCharts(e),this.createCrosshairs(e);for(var r=0;r<e.length;r++)e[r].refresh()},e.prototype.axisCrossingValues=function(t,e){for(var i=t.options,o=[].concat(i.axisCrossingValues||i.axisCrossingValue),r=e.length-o.length,n=o[0]||0,s=0;s<r;s++)o.push(n);return o},e.prototype.alignAxisTo=function(t,e,i,o){var r=t.getSlot(i,i,!0),n=t.options.reverse?2:1,s=e.getSlot(o,o,!0),a=e.options.reverse?2:1,p=t.box.translate(s[S+a]-r[S+n],s[k+a]-r[k+n]);t.pane!==e.pane&&p.translate(0,t.pane.box.y1-e.pane.box.y1),t.reflow(p)},e.prototype.alignAxes=function(t,e){for(var i=t[0],o=e[0],r=this.axisCrossingValues(i,e),n=this.axisCrossingValues(o,t),s={},a={},p={},h={},c=0;c<e.length;c++){var l=e[c],f=l.pane,d=f.id,y=!1!==l.options.visible,v=gh(t,f)||i,m=r;v!==i&&(m=this.axisCrossingValues(v,e)),this.alignAxisTo(l,v,n[c],m[c]),l.options._overlap||(tn(l.lineBox().x1)===tn(v.lineBox().x1)&&(s[d]&&l.reflow(l.box.alignTo(s[d].box,g).translate(-l.options.margin,0)),y&&(s[d]=l)),tn(l.lineBox().x2)===tn(v.lineBox().x2)&&(l._mirrored||(l.options.labels.mirror=!l.options.labels.mirror,l._mirrored=!0),this.alignAxisTo(l,v,n[c],m[c]),a[d]&&l.reflow(l.box.alignTo(a[d].box,b).translate(l.options.margin,0)),y&&(a[d]=l)),0!==c&&o.pane===l.pane&&(l.alignTo(o),l.reflow(l.box)))}for(var x=0;x<t.length;x++){var w=t[x],A=w.pane,S=A.id,k=!1!==w.options.visible,C=gh(e,A)||o,P=n;C!==o&&(P=this.axisCrossingValues(C,t)),this.alignAxisTo(w,C,r[x],P[x]),w.options._overlap||(tn(w.lineBox().y1)===tn(C.lineBox().y1)&&(w._mirrored||(w.options.labels.mirror=!w.options.labels.mirror,w._mirrored=!0),this.alignAxisTo(w,C,r[x],P[x]),p[S]&&w.reflow(w.box.alignTo(p[S].box,_).translate(0,-w.options.margin)),k&&(p[S]=w)),tn(w.lineBox().y2,3)===tn(C.lineBox().y2,3)&&(h[S]&&w.reflow(w.box.alignTo(h[S].box,u).translate(0,w.options.margin)),k&&(h[S]=w)),0!==x&&(w.alignTo(i),w.reflow(w.box)))}},e.prototype.shrinkAxisWidth=function(t){for(var e=this.groupAxes(t).any,i=vh(e),o=0,r=0;r<t.length;r++){var n=t[r];n.axes.length>0&&(o=Math.max(o,i.width()-n.contentBox.width()))}if(0!==o)for(var s=0;s<e.length;s++){var a=e[s];a.options.vertical||a.reflow(a.box.shrink(o,0))}},e.prototype.shrinkAxisHeight=function(t){for(var e,i=0;i<t.length;i++){var o=t[i],r=o.axes,n=Math.max(0,vh(r).height()-o.contentBox.height());if(0!==n){for(var s=0;s<r.length;s++){var a=r[s];a.options.vertical&&a.reflow(a.box.shrink(0,n))}e=!0}}return e},e.prototype.fitAxes=function(t){for(var e=this.groupAxes(t).any,i=0,o=0;o<t.length;o++){var r=t[o],n=r.axes,s=r.contentBox;if(n.length>0){var a=vh(n),p=Math.max(s.y1-a.y1,s.y2-a.y2);i=Math.max(i,s.x1-a.x1);for(var h=0;h<n.length;h++){var c=n[h];c.reflow(c.box.translate(0,p))}}}for(var l=0;l<e.length;l++){var u=e[l];u.reflow(u.box.translate(i,0))}},e.prototype.reflowAxes=function(t){for(var e=this.groupAxes(t),i=0;i<t.length;i++)this.reflowPaneAxes(t[i]);e.x.length>0&&e.y.length>0&&(this.alignAxes(e.x,e.y),this.shrinkAxisWidth(t),this.autoRotateAxisLabels(e),this.alignAxes(e.x,e.y),this.shrinkAxisWidth(t)&&this.alignAxes(e.x,e.y),this.shrinkAxisHeight(t),this.alignAxes(e.x,e.y),this.shrinkAxisHeight(t)&&this.alignAxes(e.x,e.y),this.fitAxes(t))},e.prototype.autoRotateAxisLabels=function(t){for(var e,i=this.panes,o=mh(i),r=0;r<o.length;r++){o[r].autoRotateLabels()&&(e=!0)}if(e){for(var n=0;n<i.length;n++)this.reflowPaneAxes(i[n]);t.x.length>0&&t.y.length>0&&(this.alignAxes(t.x,t.y),this.shrinkAxisWidth(i))}},e.prototype.reflowPaneAxes=function(t){var e=t.axes,i=e.length;if(i>0)for(var o=0;o<i;o++)e[o].reflow(t.contentBox)},e.prototype.reflowCharts=function(t){for(var e=this.charts,i=e.length,o=this.box,r=0;r<i;r++){var n=e[r].pane;n&&!Lr(n,t)||e[r].reflow(o)}},e.prototype.reflowPanes=function(){for(var t=this.box,e=this.panes,i=e.length,o=t.height(),r=0,n=t.y1,s=0;s<i;s++){var a=e[s],p=a.options.height;if(a.options.width=t.width(),a.options.height){if(p.indexOf&&p.indexOf("%")){var h=parseInt(p,10)/100;a.options.height=h*t.height()}a.reflow(t.clone()),o-=a.options.height}else r++}for(var c=0;c<i;c++){var l=e[c];l.options.height||(l.options.height=o/r)}for(var u=0;u<i;u++){var f=e[u],d=t.clone().move(t.x1,n);f.reflow(d),n+=f.options.height}},e.prototype.backgroundBox=function(){for(var t,e=this.axes,i=e.length,o=0;o<i;o++)for(var r=e[o],n=0;n<i;n++){var s=e[n];if(r.options.vertical!==s.options.vertical){var a=r.lineBox().clone().wrap(s.lineBox());t=t?t.wrap(a):a}}return t||this.box},e.prototype.chartsBoxes=function(){for(var t=this.panes,e=[],i=0;i<t.length;i++)e.push(t[i].chartsBox());return e},e.prototype.addBackgroundPaths=function(t){for(var e=this.chartsBoxes(),i=0;i<e.length;i++)t.paths.push(a.Path.fromRect(e[i].toRect()))},e.prototype.backgroundContainsPoint=function(t){for(var e=this.chartsBoxes(),i=0;i<e.length;i++)if(e[i].containsPoint(t))return!0},e.prototype.createVisual=function(){t.prototype.createVisual.call(this);var e,i=this.options.plotArea,o=i.opacity,r=i.background,n=i.border;void 0===n&&(n={}),""!==(e=r)&&null!==e&&"none"!==e&&"transparent"!==e&&Nr(e)||(r=A,o=0);var s=this._bgVisual=new a.MultiPath({fill:{color:r,opacity:o},stroke:{color:n.width?n.color:"",width:n.width,dashType:n.dashType},zIndex:-1});this.addBackgroundPaths(s),this.appendVisual(s)},e.prototype.pointsByCategoryIndex=function(t){var e=this.charts,i=[];if(null!==t)for(var o=0;o<e.length;o++){if("_navigator"!==e[o].pane.options.name){var r=e[o].categoryPoints[t];if(r&&r.length)for(var n=0;n<r.length;n++){var s=r[n];s&&Nr(s.value)&&null!==s.value&&i.push(s)}}}return i},e.prototype.pointsBySeriesIndex=function(t){return this.filterPoints((function(e){return e.series.index===t}))},e.prototype.pointsBySeriesName=function(t){return this.filterPoints((function(e){return e.series.name===t}))},e.prototype.filterPoints=function(t){for(var e=this.charts,i=[],o=0;o<e.length;o++)for(var r=e[o].points,n=0;n<r.length;n++){var s=r[n];s&&!1!==s.visible&&t(s)&&i.push(s)}return i},e.prototype.findPoint=function(t){for(var e=this.charts,i=0;i<e.length;i++)for(var o=e[i].points,r=0;r<o.length;r++){var n=o[r];if(n&&!1!==n.visible&&t(n))return n}},e.prototype.paneByPoint=function(t){for(var e=this.panes,i=0;i<e.length;i++){var o=e[i];if(o.box.containsPoint(t))return o}},e.prototype.detachLabels=function(){var t=this.groupAxes(this.panes),e=t.x,i=t.y;this.detachAxisGroupLabels(i,e),this.detachAxisGroupLabels(e,i)},e.prototype.detachAxisGroupLabels=function(t,e){for(var i=0,o=0;o<t.length;o++){var r=t[o],n=r.pane,s=gh(e,n)||e[0],a=o+i,p=this.createLabelAxis(r,a,s);if(p){i++;var h=n.axes.indexOf(r)+i;n.appendAxisAt(p,h)}}},e.prototype.createLabelAxis=function(t,e,i){var o=t.options.labels,r=o.position,n="end"!==r&&"start"!==r,s=o.visible;if(n||!1===s)return null;var a=this.groupAxes(this.panes),p=i.options.vertical?a.x:a.y,h=this.axisCrossingValues(i,p),c="end"===r,l=i.range(),u=c?l.max:l.min;if(Jr(h[e],l.min,l.max)-u==0)return null;h.splice(e+1,0,u),i.options.axisCrossingValues=h;var f=t.clone();return t.clear(),f.options.name=void 0,f.options.line.visible=!1,f.options.crosshair=void 0,f.options.notes=void 0,f.options.plotBands=void 0,f},e}(Bn);function yh(t){return!t.pane.axes.some((function(e){return e.options.vertical===t.options.vertical&&e!==t&&!1!==e.options.visible}))}function vh(t){for(var e,i=t.length,o=0;o<i;o++){var r=t[o],n=!1!==r.options.visible;if(n||yh(r)){var s=n?r.contentBox():r.lineBox();e?e.wrap(s):e=s.clone()}}return e||new kn}function gh(t,e){for(var i=0;i<t.length;i++){var o=t[i];if(o&&o.pane===e)return o}}var mh=function(t){return t.reduce((function(t,e){return t.concat(e.axes)}),[])};sn(dh,{series:[],plotArea:{margin:{}},background:"",border:{color:l,width:0},paneDefaults:{title:{}},legend:{inactiveItems:{labels:{color:"#919191"},markers:{color:"#919191"}}}});var xh=dh,bh={hover:function(t,e){this._dispatchEvent(t,e,"plotAreaHover")},click:function(t,e){this._dispatchEvent(t,e,"plotAreaClick")}};function _h(t,e,i){var o=e,r=t;if(t.indexOf(".")>-1){for(var n=t.split(".");n.length>1;)r=n.shift(),Nr(o[r])||(o[r]={}),o=o[r];r=n.shift()}o[r]=i}var wh=function(t){function e(e,i,o){t.call(this);var r=i.canonicalFields(e),n=i.valueFields(e),s=i.sourceFields(e,r),a=this._seriesFields=[],p=o.query(e.type),h=e.aggregate||p;this._series=e,this._binder=i;for(var c=0;c<r.length;c++){var l=r[c],u=void 0;if(rr(h))u=h[l];else{if(0!==c&&!Lr(l,n))break;u=h}u&&a.push({canonicalName:l,name:s[c],transform:er(u)?u:ya[u]})}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.aggregatePoints=function(t,e){var i=this._series,o=this._seriesFields,r=this._bindPoints(t||[]),n=r.dataItems[0],s={};if(n&&!$o(n)&&!C(n)){var a=function(){};a.prototype=n,s=new a}for(var p=0;p<o.length;p++){var h=o[p],c=this._bindField(r.values,h.canonicalName),l=h.transform(c,i,r.dataItems,e);if(!(null===l||!rr(l)||Nr(l.length)||l instanceof Date)){s=l;break}Nr(l)&&_h(h.name,s,l)}return s},e.prototype._bindPoints=function(t){for(var e=this._binder,i=this._series,o=[],r=[],n=0;n<t.length;n++){var s=t[n];o.push(e.bindPoint(i,s)),r.push(i.data[s])}return{values:o,dataItems:r}},e.prototype._bindField=function(t,e){for(var i=[],o=t.length,r=0;r<o;r++){var n=t[r],s=n.valueFields,a=void 0;a=Nr(s[e])?s[e]:n.fields[e],i.push(a)}return i},e}(O),Ah=function(t){function e(){t.call(this),this._defaults={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.register=function(t,e){for(var i=0;i<t.length;i++)this._defaults[t[i]]=e},e.prototype.query=function(t){return this._defaults[t]},e}(O);Ah.current=new Ah;var Sh=Ah,kh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createLabel=function(){var t=this.options.labels,e=or({},t,t.from),i=or({},t,t.to);e.visible&&(this.labelFrom=this._createLabel(e),this.append(this.labelFrom)),i.visible&&(this.labelTo=this._createLabel(i),this.append(this.labelTo))},e.prototype._createLabel=function(t){var e,i=Pr(t),o=this.pointData();return e=i?i(o):this.formatValue(t.format),new cp(e,or({vertical:this.options.vertical},t),o)},e.prototype.reflow=function(t){this.render();var e=this.labelFrom,i=this.labelTo,o=this.value;this.box=t,e&&(e.options.aboveAxis=o.from>o.to,e.reflow(t)),i&&(i.options.aboveAxis=o.to>o.from,i.reflow(t)),this.note&&this.note.reflow(t)},e}(fp);kh.prototype.defaults=or({},kh.prototype.defaults,{labels:{format:"{0} - {1}"},tooltip:{format:"{1}"}});var Ch=kh,Ph=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointType=function(){return Ch},e.prototype.pointValue=function(t){return t.valueFields},e.prototype.formatPointValue=function(t,e){return null===t.value.from&&null===t.value.to?"":this.chartService.format.auto(e,t.value.from,t.value.to)},e.prototype.plotRange=function(t){return t?[t.value.from,t.value.to]:0},e.prototype.updateRange=function(t,e){var i=e.series.axis,o=t.from,r=t.to,n=this.valueAxisRanges[i];null!==t&&$o(o)&&$o(r)&&((n=this.valueAxisRanges[i]=n||{min:m,max:x}).min=Math.min(n.min,o),n.max=Math.max(n.max,o),n.min=Math.min(n.min,r),n.max=Math.max(n.max,r))},e.prototype.aboveAxis=function(t){var e=t.value;return e.from<e.to},e}(_p);Ph.prototype.plotLimits=Va.prototype.plotLimits;var Th=Ph,Mh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.aliasFor=function(){return this.parent},e}(Ha),Oh=function(t){function e(e,i){t.call(this),this.value=e,this.options=i,this.aboveAxis=on(this.options.aboveAxis,!0),this.tooltipTracking=!0,this.initLabelsFormat()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){if(!this._rendered){this._rendered=!0;var t=this.options,e=t.markers,i=t.labels,o=this.value,r=this.fromPoint=new Mh(o,or({},this.options,{labels:i.from,markers:e.from})),n=this.toPoint=new Mh(o,or({},this.options,{labels:i.to,markers:e.to}));this.copyFields(r),this.copyFields(n),this.append(r),this.append(n)}},e.prototype.reflow=function(t){this.render();var e=t.from,i=t.to;this.positionLabels(e,i),this.fromPoint.reflow(e),this.toPoint.reflow(i),this.box=this.fromPoint.markerBox().clone().wrap(this.toPoint.markerBox())},e.prototype.createHighlight=function(){var t=new a.Group;return t.append(this.fromPoint.createHighlight()),t.append(this.toPoint.createHighlight()),t},e.prototype.highlightVisual=function(){return this.visual},e.prototype.highlightVisualArgs=function(){return{options:this.options,from:this.fromPoint.highlightVisualArgs(),to:this.toPoint.highlightVisualArgs()}},e.prototype.tooltipAnchor=function(){var t=this.owner.pane.clipBox();if(!t||t.overlaps(this.box)){var e,i,o,r=this.box,n=r.center();return this.options.vertical?(e=n.x,i=r.y1-5,o=u):(e=r.x2+5,i=n.y,o=f),{point:new An(e,i),align:{horizontal:"left",vertical:o}}}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e.prototype.overlapsBox=function(t){return this.box.overlaps(t)},e.prototype.unclipElements=function(){this.fromPoint.unclipElements(),this.toPoint.unclipElements()},e.prototype.initLabelsFormat=function(){var t=this.options.labels;t.format||(t.from&&t.from.format||(t.from=Object.assign({},t.from,{format:"{0}"})),t.to&&t.to.format||(t.to=Object.assign({},t.to,{format:"{1}"})))},e.prototype.positionLabels=function(t,e){var i,o,r=this.options,n=r.labels,s=r.vertical;"auto"===n.position&&(s?e.y1<=t.y1?(o="above",i="below"):(o="below",i="above"):e.x1<=t.x1?(o=g,i=b):(o=b,i=g),n.from&&n.from.position||(this.fromPoint.options.labels.position=i),n.to&&n.to.position||(this.toPoint.options.labels.position=o))},e.prototype.copyFields=function(t){t.dataItem=this.dataItem,t.category=this.category,t.series=this.series,t.color=this.color,t.owner=this.owner},e}(Bn);or(Oh.prototype,Fa),or(Oh.prototype,Da),Oh.prototype.defaults={markers:{visible:!1,background:A,size:8,type:d,border:{width:2},opacity:1},labels:{visible:!1,margin:hr(3),padding:hr(4),animation:{type:"fadeIn",delay:600},position:"auto"},notes:{label:{}},highlight:{markers:{border:{color:A,width:2}},zIndex:100},tooltip:{format:"{0} - {1}"}};var Rh=Oh,Bh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createStrokeSegments=function(){return this.segmentsFromPoints(this.toGeometryPoints(this.toPoints()))},e.prototype.stackSegments=function(){var t=this.fromSegments;return this.fromSegments||(t=this.fromSegments=this.segmentsFromPoints(this.toGeometryPoints(this.fromPoints().reverse()))),t},e.prototype.createStroke=function(t){var e=new a.Path(t),i=new a.Path(t);e.segments.push.apply(e.segments,this.strokeSegments()),i.segments.push.apply(i.segments,this.stackSegments()),this.visual.append(e),this.visual.append(i)},e.prototype.hasStackSegment=function(){return!0},e.prototype.fromPoints=function(){return this.linePoints.map((function(t){return t.fromPoint}))},e.prototype.toPoints=function(){return this.linePoints.map((function(t){return t.toPoint}))},e}(op),jh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createStrokeSegments=function(){return this.createCurveSegments(this.toPoints())},e.prototype.stackSegments=function(){var t=this.fromSegments;return this.fromSegments||(t=this.fromSegments=this.createCurveSegments(this.fromPoints().reverse())),t},e.prototype.createCurveSegments=function(t){return(new aa).process(this.toGeometryPoints(t))},e}(Bh),Ih=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createStrokeSegments=function(){return this.segmentsFromPoints(this.calculateStepPoints(this.toPoints()))},e.prototype.stackSegments=function(){var t=this.fromSegments;return this.fromSegments||(t=this.fromSegments=this.segmentsFromPoints(this.calculateStepPoints(this.fromPoints()))).reverse(),t},e}(Bh);or(Ih.prototype,qa);var Lh=Ih,zh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){t.prototype.render.call(this),this.renderSegments()},e.prototype.pointType=function(){return Rh},e.prototype.createPoint=function(t,e){var i=e.categoryIx,o=e.category,r=e.series,n=e.seriesIx,s=t.valueFields;if(!Bp(s.from)&&!Bp(s.to)){if(this.seriesMissingValues(r)!==Sa)return null;s={from:0,to:0}}var a=this.pointOptions(r,n);a=this.evalPointOptions(a,s,o,i,r,n);var p=t.fields.color||r.color;er(r.color)&&(p=a.color);var h=new Rh(s,a);return h.color=p,this.append(h),h},e.prototype.createSegment=function(t,e,i){var o=(e.line||{}).style;return new("smooth"===o?jh:"step"===o?Lh:Bh)(t,e,i)},e.prototype.plotRange=function(t,e){return t?[t.value.from,t.value.to]:[e,e]},e.prototype.valueSlot=function(t,e){var i=t.getSlot(e[0],e[0],!this.options.clip),o=t.getSlot(e[1],e[1],!this.options.clip);if(i&&o)return{from:i,to:o}},e.prototype.pointSlot=function(t,e){var i,o,r=e.from,n=e.to;return this.options.invertAxes?(i=new kn(r.x1,t.y1,r.x2,t.y2),o=new kn(n.x1,t.y1,n.x2,t.y2)):(i=new kn(t.x1,r.y1,t.x2,r.y2),o=new kn(t.x1,n.y1,t.x2,n.y2)),{from:i,to:o}},e.prototype.addValue=function(e,i){var o=e.valueFields;$o(o.from)||(o.from=o.to),$o(o.to)||(o.to=o.from),t.prototype.addValue.call(this,e,i)},e.prototype.updateRange=function(t,e){if(null!==t&&$o(t.from)&&$o(t.to)){var i=e.series.axis,o=this.valueAxisRanges[i]=this.valueAxisRanges[i]||{min:m,max:x},r=t.from,n=t.to;o.min=Math.min(o.min,r,n),o.max=Math.max(o.max,r,n)}},e.prototype.formatPointValue=function(t,e){var i=t.value;return this.chartService.format.auto(e,i.from,i.to)},e.prototype.animationPoints=function(){for(var t=this.points,e=[],i=0;i<t.length;i++){var o=t[i];o&&(e.push((o.fromPoint||{}).marker),e.push((o.toPoint||{}).marker))}return e.concat(this._segments)},e}(Va);or(zh.prototype,Ka,tp);var Eh=zh,Vh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.options,i=this.value,o=this.owner.seriesValueAxis(e),r=[],n=[],s=[],a=o.getSlot(i.low,i.high),p=o.getSlot(i.open,i.open),h=o.getSlot(i.close,i.close);p.x1=h.x1=a.x1=t.x1,p.x2=h.x2=a.x2=t.x2;var c=a.center().x;r.push([p.x1,p.y1]),r.push([c,p.y1]),n.push([c,h.y1]),n.push([h.x2,h.y1]),s.push([c,a.y1]),s.push([c,a.y2]),this.lines=[r,n,s],this.box=a.clone().wrap(p.clone().wrap(h)),this.reflowNote()},e.prototype.createBody=function(){},e}(Ap),Fh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointType=function(){return Vh},e}(Cp),Dh=function(t){function e(e,i,o){t.call(this),this.from=e,this.to=i,this.series=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linePoints=function(){var t=this.from,e=this.from.box,i=this.to.box,o=[];if(t.isVertical){var r=t.aboveAxis?e.y1:e.y2;o.push([e.x1,r],[i.x2,r])}else{var n=t.aboveAxis?e.x2:e.x1;o.push([n,e.y1],[n,i.y2])}return o},e.prototype.createVisual=function(){t.prototype.createVisual.call(this);var e=this.series.line||{},i=a.Path.fromPoints(this.linePoints(),{stroke:{color:e.color,width:e.width,opacity:e.opacity,dashType:e.dashType}});Ko(i),this.visual.append(i)},e}(Bn);sn(Dh,{animation:{type:"fadeIn",delay:600}});var Uh=Dh,Hh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){t.prototype.render.call(this),this.createSegments()},e.prototype.traverseDataPoints=function(t){for(var e=this.options.series,i=za(e),o=!this.options.invertAxes,r=0;r<e.length;r++)for(var n=e[r],s=0,a=0,p=0;p<i;p++){var h=ma.current.bindPoint(n,p),c=h.valueFields.value,l=h.fields.summary,u=s,f=void 0;l?"total"===l.toLowerCase()?(h.valueFields.value=s,u=0,f=s):(h.valueFields.value=a,f=u-a,a=0):$o(c)&&(a+=c,f=s+=c),t(h,{category:this.categoryAxis.categoryAt(p),categoryIx:p,series:n,seriesIx:r,total:s,runningTotal:a,from:u,to:f,isVertical:o})}},e.prototype.updateRange=function(e,i){t.prototype.updateRange.call(this,{value:i.to},i)},e.prototype.aboveAxis=function(t){return t.value>=0},e.prototype.plotRange=function(t){return[t.from,t.to]},e.prototype.createSegments=function(){for(var t=this.options.series,e=this.seriesPoints,i=this.segments=[],o=0;o<t.length;o++){var r=t[o],n=e[o];if(n)for(var s=void 0,a=0;a<n.length;a++){var p=n[a];if(p&&s){var h=new Uh(s,p,r);i.push(h),this.append(h)}s=p}}},e}(_p),Gh=["area","verticalArea","rangeArea","verticalRangeArea"],Nh=[Pa,Ma].concat(Gh),Wh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(t){if(this.namedCategoryAxes={},this.namedValueAxes={},this.valueAxisRangeTracker=new pp,t.length>0){this.invertAxes=Lr(t[0].type,[ka,"bullet",Ma,"verticalArea","verticalRangeArea","rangeBar","horizontalWaterfall","verticalBoxPlot"]);for(var e=0;e<t.length;e++){var i=t[e].stack;if(i&&"100%"===i.type){this.stack100=!0;break}}}},e.prototype.render=function(t){void 0===t&&(t=this.panes),this.createCategoryAxes(t),this.aggregateCategories(t),this.createCategoryAxesLabels(t),this.createCharts(t),this.createValueAxes(t)},e.prototype.removeAxis=function(e){var i=e.options.name;t.prototype.removeAxis.call(this,e),e instanceof Cs?delete this.namedCategoryAxes[i]:(this.valueAxisRangeTracker.reset(i),delete this.namedValueAxes[i]),e===this.categoryAxis&&delete this.categoryAxis,e===this.valueAxis&&delete this.valueAxis},e.prototype.createCharts=function(t){for(var e=this.groupSeriesByPane(),i=0;i<t.length;i++){var o=t[i],r=e[o.options.name||"default"]||[];this.addToLegend(r);var n=this.filterVisibleSeries(r);if(n)for(var s=this.groupSeriesByCategoryAxis(n),a=0;a<s.length;a++)this.createChartGroup(s[a],o)}},e.prototype.createChartGroup=function(t,e){this.createAreaChart(sh(t,["area","verticalArea"]),e),this.createRangeAreaChart(sh(t,["rangeArea","verticalRangeArea"]),e),this.createBarChart(sh(t,[Ca,ka]),e),this.createRangeBarChart(sh(t,["rangeColumn","rangeBar"]),e),this.createBulletChart(sh(t,["bullet","verticalBullet"]),e),this.createCandlestickChart(sh(t,"candlestick"),e),this.createBoxPlotChart(sh(t,["boxPlot","verticalBoxPlot"]),e),this.createOHLCChart(sh(t,"ohlc"),e),this.createWaterfallChart(sh(t,["waterfall","horizontalWaterfall"]),e),this.createLineChart(sh(t,[Pa,Ma]),e)},e.prototype.aggregateCategories=function(t){var e=this.srcSeries||this.series,i=[];this._currentPointsCache={},this._seriesPointsCache=this._seriesPointsCache||{};for(var o=0;o<e.length;o++){var r=e[o],n=this.seriesCategoryAxis(r),s=this.findPane(n.options.pane);r=(nh(n.options.type,y)||r.categoryField)&&Lr(s,t)?this.aggregateSeries(r,n):this.filterSeries(r,n),i.push(r)}this._seriesPointsCache=this._currentPointsCache,this._currentPointsCache=null,this.srcSeries=e,this.series=i},e.prototype.filterSeries=function(t,e){var i=(t.data||{}).length;if(e._seriesMax=Math.max(e._seriesMax||0,i),!$o(e.options.min)&&!$o(e.options.max))return t;var o=e.currentRangeIndices(),r=Lr(t.type,Nh),n=or({},t);return n.data=(n.data||[]).slice(o.min,o.max+1),r&&fh(n,o,i,(function(i){return{item:t.data[i],category:e.categoryAt(i,!0),categoryIx:i-o.min}}),(function(e){return Nr(t.data[e])})),n},e.prototype.clearSeriesPointsCache=function(){this._seriesPointsCache={}},e.prototype.seriesSourcePoints=function(t,e){var i=t.index+";"+e.categoriesHash();if(this._seriesPointsCache[i])return this._currentPointsCache[i]=this._seriesPointsCache[i],this._seriesPointsCache[i];var o=e.options,r=o.srcCategories,n=nh(o.type,y),s=t.data,a=n?ah:va,p=[];n||e.mapCategories();for(var h=0;h<s.length;h++){var c=void 0;if(c=t.categoryField?a(t.categoryField,s[h],this.chartService.intl):r[h],Nr(c)&&null!==c){var l=e.totalIndex(c);p[l]=p[l]||{items:[],category:c},p[l].items.push(h)}}return this._currentPointsCache[i]=p,p},e.prototype.aggregateSeries=function(t,e){if(!t.data.length)return t;for(var i=this.seriesSourcePoints(t,e),o=or({},t),r=new wh(or({},t),ma.current,Sh.current),n=o.data=[],s=e.options.dataItems||[],a=e.currentRangeIndices(),p=function(t){var o=t-a.min,n=i[t];if(n||(n=i[t]={}),n.categoryIx=o,!n.item){var s=e.categoryAt(t,!0);n.category=s,n.item=r.aggregatePoints(n.items,s)}return n},h=a.min;h<=a.max;h++){var c=p(h);n[c.categoryIx]=c.item,c.items&&c.items.length&&(s[c.categoryIx]=c.item)}return Lr(o.type,Nh)&&fh(o,a,e.totalCount(),p,(function(t){return i[t]})),e.options.dataItems=s,o},e.prototype.appendChart=function(e,i){var o=e.options.series,r=this.seriesCategoryAxis(o[0]),n=r.options.categories,s=Math.max(0,za(o)-n.length);if(s>0)for(n=r.options.categories=r.options.categories.slice(0);s--;)n.push("");this.valueAxisRangeTracker.update(e.valueAxisRanges),t.prototype.appendChart.call(this,e,i)},e.prototype.seriesPaneName=function(t){var e=this.options,i=t.axis,o=Rr([].concat(e.valueAxis),(function(t){return t.name===i}))[0],r=((e.panes||[{}])[0]||{}).name||"default";return(o||{}).pane||r},e.prototype.seriesCategoryAxis=function(t){var e=t.categoryAxis,i=e?this.namedCategoryAxes[e]:this.categoryAxis;if(!i)throw new Error("Unable to locate category axis with name "+e);return i},e.prototype.stackableChartOptions=function(t,e){var i=t.stack;return{isStacked:i,isStacked100:i&&"100%"===i.type,clip:e.options.clip}},e.prototype.groupSeriesByCategoryAxis=function(t){for(var e=[],i={},o=0;o<t.length;o++){var r=t[o].categoryAxis||"$$default$$";i.hasOwnProperty(r)||(i[r]=!0,e.push(r))}for(var n=[],s=0;s<e.length;s++){var a=Xh(t,e[s],s);0!==a.length&&n.push(a)}return n},e.prototype.createBarChart=function(t,e){if(0!==t.length){var i=t[0],o=new _p(this,Object.assign({series:t,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing},this.stackableChartOptions(i,e)));this.appendChart(o,e)}},e.prototype.createRangeBarChart=function(t,e){if(0!==t.length){var i=t[0],o=new Th(this,{series:t,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing});this.appendChart(o,e)}},e.prototype.createBulletChart=function(t,e){if(0!==t.length){var i=t[0],o=new Np(this,{series:t,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing,clip:e.options.clip});this.appendChart(o,e)}},e.prototype.createLineChart=function(t,e){if(0!==t.length){var i=t[0],o=new ip(this,Object.assign({invertAxes:this.invertAxes,series:t},this.stackableChartOptions(i,e)));this.appendChart(o,e)}},e.prototype.createAreaChart=function(t,e){if(0!==t.length){var i=t[0],o=new ap(this,Object.assign({invertAxes:this.invertAxes,series:t},this.stackableChartOptions(i,e)));this.appendChart(o,e)}},e.prototype.createRangeAreaChart=function(t,e){if(0!==t.length){var i=new Eh(this,{invertAxes:this.invertAxes,series:t,clip:e.options.clip});this.appendChart(i,e)}},e.prototype.createOHLCChart=function(t,e){if(0!==t.length){var i=t[0],o=new Fh(this,{invertAxes:this.invertAxes,gap:i.gap,series:t,spacing:i.spacing,clip:e.options.clip});this.appendChart(o,e)}},e.prototype.createCandlestickChart=function(t,e){if(0!==t.length){var i=t[0],o=new Cp(this,{invertAxes:this.invertAxes,gap:i.gap,series:t,spacing:i.spacing,clip:e.options.clip});this.appendChart(o,e)}},e.prototype.createBoxPlotChart=function(t,e){if(0!==t.length){var i=t[0],o=new Op(this,{invertAxes:this.invertAxes,gap:i.gap,series:t,spacing:i.spacing,clip:e.options.clip});this.appendChart(o,e)}},e.prototype.createWaterfallChart=function(t,e){if(0!==t.length){var i=t[0],o=new Hh(this,{series:t,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing});this.appendChart(o,e)}},e.prototype.axisRequiresRounding=function(t,e){for(var i=sh(this.series,Oa),o=0;o<this.series.length;o++){var r=this.series[o];if(Lr(r.type,Gh)){var n=r.line;n&&"step"===n.style&&i.push(r)}}for(var s=0;s<i.length;s++){var a=i[s].categoryAxis||"";if(a===t||!a&&0===e)return!0}},e.prototype.aggregatedAxis=function(t,e){for(var i=this.series,o=0;o<i.length;o++){var r=i[o].categoryAxis||"";if((r===t||!r&&0===e)&&i[o].categoryField)return!0}},e.prototype.createCategoryAxesLabels=function(){for(var t=this.axes,e=0;e<t.length;e++)t[e]instanceof Cs&&t[e].createLabels()},e.prototype.createCategoryAxes=function(t){for(var e=this.invertAxes,i=[].concat(this.options.categoryAxis),o=[],r=0;r<i.length;r++){var n=i[r];if(Lr(this.findPane(n.pane),t)){var s=n.name,a=n.categories;void 0===a&&(a=[]),n=or({vertical:e,reverse:!e&&this.chartService.rtl,axisCrossingValue:e?m:0},n),Nr(n.justified)||(n.justified=this.isJustified()),this.axisRequiresRounding(s,r)&&(n.justified=!1);var p=void 0;if(p=ph(n,a[0])?new Ls(n,this.chartService):new Cs(n,this.chartService),i[r].categories=p.options.srcCategories,s){if(this.namedCategoryAxes[s])throw new Error("Category axis with name "+s+" is already defined");this.namedCategoryAxes[s]=p}p.axisIndex=r,o.push(p),this.appendAxis(p)}}var h=this.categoryAxis||o[0];this.categoryAxis=h,e?this.axisY=h:this.axisX=h},e.prototype.isJustified=function(){for(var t=this.series,e=0;e<t.length;e++){if(!Lr(t[e].type,Gh))return!1}return!0},e.prototype.createValueAxes=function(t){var e=this.valueAxisRangeTracker,i=e.query(),o=[].concat(this.options.valueAxis),r=this.invertAxes,n={vertical:!r,reverse:r&&this.chartService.rtl},s=[];this.stack100&&(n.roundToMajorUnit=!1,n.labels={format:"P0"});for(var a=0;a<o.length;a++){var p=o[a];if(Lr(this.findPane(p.pane),t)){var h=p.name,c=nh(p.type,"log")?{min:.1,max:1}:{min:0,max:1},l=e.query(h)||i||c;0===a&&l&&i&&(l.min=Math.min(l.min,i.min),l.max=Math.max(l.max,i.max));var u=new(nh(p.type,"log")?Ys:Hs)(l.min,l.max,or({},n,p),this.chartService);if(h){if(this.namedValueAxes[h])throw new Error("Value axis with name "+h+" is already defined");this.namedValueAxes[h]=u}u.axisIndex=a,s.push(u),this.appendAxis(u)}}var f=this.valueAxis||s[0];this.valueAxis=f,r?this.axisX=f:this.axisY=f},e.prototype._dispatchEvent=function(t,e,i){var o=t._eventCoordinates(e),r=new An(o.x,o.y),n=this.pointPane(r),s=[],a=[];if(n){for(var p=n.axes,h=0;h<p.length;h++){var c=p[h];c.getValue?ih(a,c.getValue(r)):ih(s,c.getCategory(r))}0===s.length&&ih(s,this.categoryAxis.getCategory(r)),s.length>0&&a.length>0&&t.trigger(i,{element:Yr(e),originalEvent:e,category:hh(s),value:hh(a)})}},e.prototype.pointPane=function(t){for(var e=this.panes,i=0;i<e.length;i++){var o=e[i];if(o.contentBox.containsPoint(t))return o}},e.prototype.updateAxisOptions=function(t,e){qh(this.options,t,e),qh(this.originalOptions,t,e)},e}(xh);function qh(t,e,i){or([].concat(e instanceof Cs?t.categoryAxis:t.valueAxis)[e.axisIndex],i)}function Xh(t,e,i){return Rr(t,(function(t){return 0===i&&!t.categoryAxis||t.categoryAxis===e}))}sn(Wh,{categoryAxis:{},valueAxis:{}}),or(Wh.prototype,bh);var Yh=Wh;function Zh(){this._defaultPrevented=!0}var Kh=function(t){function e(){t.call(this),this._points=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){this._points=[]},e.prototype.show=function(t,e){var i=[].concat(t);this.hide();for(var o=0;o<i.length;o++){var r=i[o];r&&r.toggleHighlight&&r.hasHighlight()&&(this.togglePointHighlight(r,!0,e),this._points.push(r))}},e.prototype.togglePointHighlight=function(t,e,i){var o=(t.options.highlight||{}).toggle;if(o){var r={category:t.category,series:t.series,dataItem:t.dataItem,value:t.value,stackValue:t.stackValue,preventDefault:Zh,visual:t.highlightVisual(),show:e};o(r),r._defaultPrevented||t.toggleHighlight(e,i)}else t.toggleHighlight(e,i)},e.prototype.hide=function(){for(var t=this._points;t.length;)this.togglePointHighlight(t.pop(),!1)},e.prototype.isHighlighted=function(t){for(var e=this._points,i=0;i<e.length;i++){if(t===e[i])return!0}return!1},e}(O);function Jh(t,e){var i=(e||"").toLowerCase(),o=t.event;return"none"===i&&!(o.ctrlKey||o.shiftKey||o.altKey)||o[i+"Key"]}function $h(t){for(var e={},i=0;i<t.length;i++){var o=t[i];o.axis.options.name&&(e[o.axis.options.name]={min:o.range.min,max:o.range.max})}return e}var Qh=function(t){function e(e,i){t.call(this),this.plotArea=e,this.options=or({},this.options,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.start=function(t){return this._active=Jh(t,this.options.key),this._active},e.prototype.move=function(t){if(this._active){var e=this.axisRanges=this._panAxes(t,S).concat(this._panAxes(t,k));if(e.length)return this.axisRanges=e,$h(e)}},e.prototype.end=function(){var t=this._active;return this._active=!1,t},e.prototype.pan=function(){var t=this.plotArea,e=this.axisRanges;if(e.length){for(var i=0;i<e.length;i++){var o=e[i];t.updateAxisOptions(o.axis,o.range)}t.redraw(t.panes)}},e.prototype.destroy=function(){delete this.plotArea},e.prototype._panAxes=function(t,e){var i=this.plotArea,o=-t[e].delta,r=(this.options.lock||"").toLowerCase(),n=[];if(0!==o&&(r||"").toLowerCase()!==e)for(var s=i.axes,a=0;a<s.length;a++){var p=s[a];if(e===S&&!p.options.vertical||e===k&&p.options.vertical){var h=p.pan(o);h&&(h.limitRange=!0,n.push({axis:p,range:h}))}}return n},e}(O);Qh.prototype.options={key:"none",lock:"none"};var tc=Qh,ec=function(t){function e(e,i){t.call(this),this.chart=e,this.options=or({},this.options,i),this.createElement()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createElement=function(){var t=this._marquee=document.createElement("div");t.className="k-marquee";var e=document.createElement("div");e.className="k-marquee-color",t.appendChild(e)},e.prototype.removeElement=function(){this._marquee.parentNode&&this._marquee.parentNode.removeChild(this._marquee)},e.prototype.setStyles=function(t){pr(this._marquee,t)},e.prototype.start=function(t){if(Jh(t,this.options.key)){var e=this.chart,i=e._eventCoordinates(t),o=this._zoomPane=e._plotArea.paneByPoint(i),r=o?o.chartsBox().clone():null;if(o&&r){var n=this._elementOffset();return r.translate(n.left,n.top),this._zoomPaneClipBox=r,document.body.appendChild(this._marquee),this.setStyles({left:t.pageX+1,top:t.pageY+1,width:0,height:0}),!0}}return!1},e.prototype._elementOffset=function(){var t=this.chart.element,e=pr(t,["paddingLeft","paddingTop"]),i=e.paddingLeft,o=e.paddingTop,r=qr(t);return{left:i+r.left,top:o+r.top}},e.prototype.move=function(t){this._zoomPane&&this.setStyles(this._selectionPosition(t))},e.prototype.end=function(t){if(this._zoomPane){var e=this._elementOffset(),i=this._selectionPosition(t);i.left-=e.left,i.top-=e.top;var o={x:i.left,y:i.top},r={x:i.left+i.width,y:i.top+i.height};return this._updateAxisRanges(o,r),this.removeElement(),delete this._zoomPane,$h(this.axisRanges)}},e.prototype.zoom=function(){var t=this.axisRanges;if(t&&t.length){for(var e=this.chart._plotArea,i=0;i<t.length;i++){var o=t[i];e.updateAxisOptions(o.axis,o.range)}e.redraw(e.panes)}},e.prototype.destroy=function(){this.removeElement(),delete this._marquee,delete this.chart},e.prototype._updateAxisRanges=function(t,e){for(var i=(this.options.lock||"").toLowerCase(),o=[],r=this._zoomPane.axes,n=0;n<r.length;n++){var s=r[n],a=s.options.vertical;if((i!==S||a)&&(i!==k||!a)&&Nr(s.axisIndex)){var p=s.pointsRange(t,e);p&&o.push({axis:s,range:p})}}this.axisRanges=o},e.prototype._selectionPosition=function(t){var e=this._zoomPaneClipBox,i={x:t.x.startLocation,y:t.y.startLocation},o=t.x.location,r=t.y.location,n=(this.options.lock||"").toLowerCase(),s=Math.min(i.x,o),a=Math.min(i.y,r),p=Math.abs(i.x-o),h=Math.abs(i.y-r);return n===S&&(s=e.x1,p=e.width()),n===k&&(a=e.y1,h=e.height()),o>e.x2&&(p=e.x2-i.x),o<e.x1&&(p=i.x-e.x1),r>e.y2&&(h=e.y2-i.y),r<e.y1&&(h=i.y-e.y1),{left:Math.max(s,e.x1),top:Math.max(a,e.y1),width:p,height:h}},e}(O);ec.prototype.options={key:"shift",lock:"none"};var ic=ec,oc=function(t){function e(e,i){t.call(this),this.chart=e,this.options=or({},this.options,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.updateRanges=function(t){for(var e=(this.options.lock||"").toLowerCase(),i=[],o=this.chart._plotArea.axes,r=0;r<o.length;r++){var n=o[r],s=n.options.vertical;if((e!==S||s)&&(e!==k||!s)&&n.zoomRange){var a=n.zoomRange(-t);a&&i.push({axis:n,range:a})}}return this.axisRanges=i,$h(i)},e.prototype.zoom=function(){var t=this.axisRanges,e=this.chart._plotArea;if(t&&t.length&&e.updateAxisOptions){for(var i=0;i<t.length;i++){var o=t[i];e.updateAxisOptions(o.axis,o.range)}e.redraw(e.panes)}},e.prototype.destroy=function(){delete this.chart},e}(O),rc=function(t){function e(e,i){t.call(this,e),this.chartService=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=this.children,e=this.options,i=e.vertical;this.visual=new a.Layout(null,{spacing:i?0:e.spacing,lineSpacing:i?e.spacing:0,orientation:i?"vertical":"horizontal",reverse:e.rtl,alignItems:i?"start":"center"});for(var o=0;o<t.length;o++){var r=t[o];r.reflow(new kn),r.renderVisual()}},e.prototype.reflow=function(t){this.visual.rect(t.toRect()),this.visual.reflow();var e=this.visual.clippedBBox();this.box=e?qn(e):new kn},e.prototype.renderVisual=function(){this.addVisual()},e.prototype.createVisual=function(){},e}(Bn),nc=function(t){function e(e){t.call(this,e),this.createContainer(),e.rtl?(this.createLabel(),this.createMarker()):(this.createMarker(),this.createLabel())}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createContainer=function(){this.container=new Hn({vertical:!1,wrap:!1,align:f,spacing:this.options.spacing}),this.append(this.container)},e.prototype.createMarker=function(){this.container.append(new zn(this.markerOptions()))},e.prototype.markerOptions=function(){var t=this.options,e=t.markerColor;return or({},t.markers,{background:e,border:{color:e}})},e.prototype.createLabel=function(){var t=this.options,e=or({},t.labels);this.container.append(new Yn(t.text,e))},e.prototype.renderComplete=function(){t.prototype.renderComplete.call(this);var e=this.options.cursor||{},i=this._itemOverlay=a.Path.fromRect(this.container.box.toRect(),{fill:{color:A,opacity:0},stroke:null,cursor:e.style||e});this.appendVisual(i)},e.prototype.click=function(t,e){var i=this.eventArgs(e);!t.trigger("legendItemClick",i)&&e&&"contextmenu"===e.type&&e.preventDefault()},e.prototype.over=function(t,e){var i=this.eventArgs(e);return t.trigger("legendItemHover",i)||t._legendItemHover(i.seriesIndex,i.pointIndex),!0},e.prototype.out=function(t,e){t._unsetActivePoint(),t.trigger("legendItemLeave",this.eventArgs(e))},e.prototype.eventArgs=function(t){var e=this.options;return{element:Yr(t),text:e.text,series:e.series,seriesIndex:e.series.index,pointIndex:e.pointIndex}},e.prototype.renderVisual=function(){var e=this,i=this.options,o=i.visual;o?(this.visual=o({active:i.active,series:i.series,sender:this.getSender(),pointIndex:i.pointIndex,options:{markers:this.markerOptions(),labels:i.labels},createVisual:function(){e.createVisual(),e.renderChildren(),e.renderComplete();var t=e.visual;return delete e.visual,t}}),this.addVisual()):t.prototype.renderVisual.call(this)},e}(In),sc=function(t){function e(e,i){void 0===i&&(i={}),t.call(this,e),this.chartService=i,Lr(this.options.position,[_,b,u,g,"custom"])||(this.options.position=b),this.createContainers(),this.createLegendTitle(e.title),this.createItems()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createContainers=function(){var t=this.options,e=t.position,i=t.align,o=e,r=f;"custom"===e?o=g:Lr(e,[_,u])?(o="start"===i?g:"end"===i?b:f,r=e):i&&("start"===i?r=_:"end"===i&&(r=u)),this.container=new In({margin:t.margin,padding:t.padding,background:t.background,border:t.border,vAlign:r,align:o,zIndex:t.zIndex,shrinkToFit:!0}),this.hasTitle()?this.itemsContainer=new In({vAlign:r,align:o,zIndex:t.zIndex,shrinkToFit:!0}):this.itemsContainer=this.container,this.append(this.container)},e.prototype.createItems=function(){var t=this.getService(),e=this.options,i=this.isVertical(),o=new rc({vertical:i,spacing:e.spacing,rtl:t.rtl},t),r=e.items;e.reverse&&(r=r.slice(0).reverse());for(var n=r.length,s=0;s<n;s++){var a=r[s];o.append(new nc(or({},{markers:e.markers,labels:e.labels,rtl:t.rtl},e.item,a)))}o.render(),this.itemsContainer.append(o)},e.prototype.isVertical=function(){var t=this.options,e=t.orientation,i=t.position;return"custom"===i&&"horizontal"!==e||(Nr(e)?"horizontal"!==e:Lr(i,[g,b]))},e.prototype.hasItems=function(){return this.container.children[0].children.length>0},e.prototype.reflow=function(t){var e=this.options,i=t.clone();this.hasItems()?("custom"===e.position?(this.containerCustomReflow(i),this.box=i):this.containerReflow(i),this.hasTitle()&&this.title.reflow(new kn(this.container.box.x1,this.title.box.y1,this.container.box.x2,this.title.box.y2))):this.box=i},e.prototype.containerReflow=function(t){var e=this.options,i=this.container,o=e.position,r=e.width,n=e.height,s=o===_||o===u?S:k,a=this.isVertical(),p=t.clone(),h=t.clone();o!==g&&o!==b||(h.y1=p.y1=0),a&&n?(h.y2=h.y1+n,h.align(p,k,i.options.vAlign)):!a&&r&&(h.x2=h.x1+r,h.align(p,S,i.options.align)),i.reflow(h);var c=(h=i.box).clone();(e.offsetX||e.offsetY)&&(h.translate(e.offsetX,e.offsetY),i.reflow(h)),c[s+1]=t[s+1],c[s+2]=t[s+2],this.box=c},e.prototype.containerCustomReflow=function(t){var e=this.options,i=this.container,o=e.offsetX,r=e.offsetY,n=e.width,s=e.height,a=this.isVertical(),p=t.clone();a&&s?p.y2=p.y1+s:!a&&n&&(p.x2=p.x1+n),i.reflow(p),p=i.box,i.reflow(new kn(o,r,o+p.width(),r+p.height()))},e.prototype.renderVisual=function(){this.hasItems()&&t.prototype.renderVisual.call(this)},e.prototype.createLegendTitle=function(t){var e=or({},{color:l,position:_,align:f},t),i=e.text;if(t&&!1!==t.visible){if(Nr(e)&&e.visible){var o=Pr(e);o?i=o({text:i}):e.format&&(i=this.chartService.format.auto(e.format,i))}this.title=new Yn(i,e),this.createTitleLayout(),this.appendTitleLayoutContent()}},e.prototype.createTitleLayout=function(){this.layout=new Hn({vertical:!0,wrap:!1}),this.container.append(this.layout)},e.prototype.hasTitle=function(){return Boolean(this.options.title&&!1!==this.options.title.visible)},e.prototype.appendTitleLayoutContent=function(){this.options.title.position===u?(this.layout.append(this.itemsContainer),this.layout.append(this.title)):(this.layout.append(this.title),this.layout.append(this.itemsContainer))},e}(Bn);sn(sc,{position:b,items:[],offsetX:0,offsetY:0,margin:hr(5),padding:hr(5),border:{color:l,width:0},item:{cursor:"pointer",spacing:6},spacing:6,background:"",zIndex:1,markers:{border:{width:0},width:15,height:3,type:"rect",align:g,vAlign:f}});var ac=sc,pc=function(t){function e(){t.call(this),this._registry=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.register=function(t,e){this._registry.push({type:t,seriesTypes:e})},e.prototype.create=function(t,e,i){for(var o,r=this._registry,n=r[0],s=0;s<r.length;s++){var a=r[s];if((o=sh(t,a.seriesTypes)).length>0){n=a;break}}return new n.type(o,e,i)},e}(O);pc.current=new pc;var hc=pc;function cc(t){var e=document.createElement("div");return t&&(e.className=t),e}function lc(t){for(var e=t;e&&!Br(e,"k-handle");)e=e.parentNode;return e}var uc=function(t){function e(e,i,o,r){t.call(this);var n=e.element;this.options=or({},this.options,o),this.chart=e,this.observer=r,this.chartElement=n,this.categoryAxis=i,this._dateAxis=this.categoryAxis instanceof Ls,this.initOptions(),this.visible=this.options.visible&&n.offsetHeight,this.visible&&(this.createElements(),this.set(this._index(this.options.from),this._index(this.options.to)),this.bindEvents())}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onPane=function(t){return this.categoryAxis.pane===t},e.prototype.createElements=function(){var t=this.options,e=this.wrapper=cc("k-selector");pr(e,{top:t.offset.top,left:t.offset.left,width:t.width,height:t.height,direction:"ltr"});var i=this.selection=cc("k-selection");this.leftMask=cc("k-mask"),this.rightMask=cc("k-mask"),e.appendChild(this.leftMask),e.appendChild(this.rightMask),e.appendChild(i),i.appendChild(cc("k-selection-bg"));var o=this.leftHandle=cc("k-handle k-left-handle"),r=this.rightHandle=cc("k-handle k-right-handle");o.appendChild(cc()),r.appendChild(cc()),i.appendChild(o),i.appendChild(r),this.chartElement.appendChild(e);var n=pr(i,["borderLeftWidth","borderRightWidth","height"]),s=pr(o,"height").height,a=pr(r,"height").height;t.selection={border:{left:n.borderLeftWidth,right:n.borderRightWidth}},pr(o,{top:(n.height-s)/2}),pr(r,{top:(n.height-a)/2}),e.style.cssText=e.style.cssText},e.prototype.bindEvents=function(){var t;!1!==this.options.mousewheel&&(this._mousewheelHandler=this._mousewheel.bind(this),Gr(this.wrapper,((t={})[Ra]=this._mousewheelHandler,t))),this._domEvents=Ar.create(this.wrapper,{stopPropagation:!0,start:this._start.bind(this),move:this._move.bind(this),end:this._end.bind(this),tap:this._tap.bind(this),press:this._press.bind(this),gesturestart:this._gesturestart.bind(this),gesturechange:this._gesturechange.bind(this),gestureend:this._gestureend.bind(this)})},e.prototype.initOptions=function(){var t=this.options,e=this.categoryAxis.pane.chartsBox(),i=this.chart.chartService.intl;this._dateAxis&&or(t,{min:ws(i,t.min),max:ws(i,t.max),from:ws(i,t.from),to:ws(i,t.to)});var o=pr(this.chartElement,["paddingLeft","paddingTop"]),r=o.paddingLeft,n=o.paddingTop;this.options=or({},{width:e.width(),height:e.height()+.1,padding:{left:r,top:n},offset:{left:e.x1+r,top:e.y1+n},from:t.min,to:t.max},t)},e.prototype.destroy=function(){var t;this._domEvents&&(this._domEvents.destroy(),delete this._domEvents),clearTimeout(this._mwTimeout),this._state=null,this.wrapper&&(this._mousewheelHandler&&(en(this.wrapper,((t={})[Ra]=this._mousewheelHandler,t)),this._mousewheelHandler=null),this.chartElement.removeChild(this.wrapper),this.wrapper=null)},e.prototype._rangeEventArgs=function(t){return{axis:this.categoryAxis.options,from:this._value(t.from),to:this._value(t.to)}},e.prototype._start=function(t){var e=this.options,i=Yr(t);if(!this._state&&i){this.chart._unsetActivePoint(),this._state={moveTarget:lc(i)||i,startLocation:t.x?t.x.location:0,range:{from:this._index(e.from),to:this._index(e.to)}};var o=this._rangeEventArgs({from:this._index(e.from),to:this._index(e.to)});this.trigger("selectStart",o)&&(this._state=null)}},e.prototype._press=function(t){var e;(e=this._state?this._state.moveTarget:lc(Yr(t)))&&P(e,"k-handle-active")},e.prototype._move=function(t){if(this._state){var e=this._state,i=this.options,o=this.categoryAxis,r=e.range,n=e.moveTarget,s=o.options.reverse,a=this._index(i.from),p=this._index(i.to),h=this._index(i.min),c=this._index(i.max),l=e.startLocation-t.x.location,u=r.from,f=r.to,d=r.to-r.from,y=pr(this.wrapper,"width").width/(o.categoriesCount()-1),v=Math.round(l/y)*(s?-1:1);if(n){var g=Br(n,"k-left-handle"),m=Br(n,"k-right-handle");Br(n,"k-selection k-selection-bg")?(r.from=Math.min(Math.max(h,a-v),c-d),r.to=Math.min(r.from+d,c)):g&&!s||m&&s?(r.from=Math.min(Math.max(h,a-v),c-1),r.to=Math.max(r.from+1,r.to)):(g&&s||m&&!s)&&(r.to=Math.min(Math.max(h+1,p-v),c),r.from=Math.min(r.to-1,r.from)),r.from===u&&r.to===f||(this.move(r.from,r.to),this.trigger("select",this._rangeEventArgs(r)))}}},e.prototype._end=function(){if(this._state){var t=this._state.moveTarget;t&&M(t,"k-handle-active");var e=this._state.range;this.set(e.from,e.to),this.trigger("selectEnd",this._rangeEventArgs(e)),delete this._state}},e.prototype._tap=function(t){var e=this.options,i=this.categoryAxis,o=this.chart._eventCoordinates(t),r=i.pointCategoryIndex(new An(o.x,i.box.y1)),n=this._index(e.from),s=this._index(e.to),a=this._index(e.min),p=this._index(e.max),h=s-n,c=n+h/2,l={},u=3===t.event.which,f=Math.round(c-r);this._state||u||(this.chart._unsetActivePoint(),i.options.justified||f--,l.from=Math.min(Math.max(a,n-f),p-h),l.to=Math.min(l.from+h,p),this._start(t),this._state&&(this._state.range=l,this.trigger("select",this._rangeEventArgs(l)),this._end()))},e.prototype._mousewheel=function(t){var e=this,i=Dr(t);if(this._start({target:this.selection}),this._state){var o=this._state.range;t.preventDefault(),t.stopPropagation(),Math.abs(i)>1&&(i*=3),this.options.mousewheel.reverse&&(i*=-1),this.expand(i)&&this.trigger("select",{axis:this.categoryAxis.options,delta:i,originalEvent:t,from:this._value(o.from),to:this._value(o.to)}),this._mwTimeout&&clearTimeout(this._mwTimeout),this._mwTimeout=setTimeout((function(){e._end()}),150)}},e.prototype._gesturestart=function(t){var e=this.options;this._state={range:{from:this._index(e.from),to:this._index(e.to)}};var i=this._rangeEventArgs(this._state.range);this.trigger("selectStart",i)?this._state=null:t.preventDefault()},e.prototype._gestureend=function(){this._state&&(this.trigger("selectEnd",this._rangeEventArgs(this._state.range)),delete this._state)},e.prototype._gesturechange=function(t){var e=this.chart,i=this._state,o=this.options,r=this.categoryAxis,n=i.range,s=e._toModelCoordinates(t.touches[0].x.location).x,a=e._toModelCoordinates(t.touches[1].x.location).x,p=Math.min(s,a),h=Math.max(s,a);t.preventDefault(),n.from=r.pointCategoryIndex(new An(p))||o.min,n.to=r.pointCategoryIndex(new An(h))||o.max,this.move(n.from,n.to),this.trigger("select",this._rangeEventArgs(n))},e.prototype._index=function(t){var e=t;return t instanceof Date&&(e=this.categoryAxis.categoryIndex(t)),e},e.prototype._value=function(t){var e=t;return this._dateAxis&&(e=this.categoryAxis.categoryAt(t))>this.options.max&&(e=this.options.max),e},e.prototype._slot=function(t){var e=this.categoryAxis,i=this._index(t);return e.getSlot(i,i,!0)},e.prototype.move=function(t,e){var i=this.options,o=this.categoryAxis.options.reverse,r=i.offset,n=i.padding,s=i.selection.border,a=o?e:t,p=o?t:e,h="x"+(o?2:1),c=this._slot(a),l=tn(c[h]-r.left+n.left);pr(this.leftMask,{width:l}),pr(this.selection,{left:l}),c=this._slot(p);var u=tn(i.width-(c[h]-r.left+n.left));pr(this.rightMask,{width:u});var f=i.width-u;f!==i.width&&(f+=s.right),pr(this.rightMask,{left:f}),pr(this.selection,{width:Math.max(i.width-(l+u)-s.right,0)})},e.prototype.set=function(t,e){var i=this.options,o=this._index(i.min),r=this._index(i.max),n=Jr(this._index(t),o,r),s=Jr(this._index(e),n+1,r);i.visible&&this.move(n,s),i.from=this._value(n),i.to=this._value(s)},e.prototype.expand=function(t){var e=this.options,i=this._index(e.min),o=this._index(e.max),r=e.mousewheel.zoom,n=this._index(e.from),s=this._index(e.to),a={from:n,to:s},p=or({},a);if(this._state&&(a=this._state.range),r!==b&&(a.from=Jr(Jr(n-t,0,s-1),i,o)),r!==g&&(a.to=Jr(Jr(s+t,a.from+1,o),i,o)),a.from!==p.from||a.to!==p.to)return this.set(a.from,a.to),!0},e.prototype.trigger=function(t,e){return(this.observer||this.chart).trigger(t,e)},e}(O);sn(uc,{visible:!0,mousewheel:{zoom:"both"},min:x,max:m});var fc=uc,dc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.show=function(e){if(e&&e.tooltipAnchor&&(!this._current||this._current!==e)){var i=or({},this.options,e.options.tooltip),o=e.tooltipAnchor();o?(this._current=e,t.prototype.show.call(this,{point:e,anchor:o},i,e)):this.hide()}},e.prototype.hide=function(){delete this._current,t.prototype.hide.call(this)},e}(qp),yc=function(t){function e(e,i){t.call(this,e.chartService,i),this.plotArea=e,this.formatService=e.chartService.format}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.showAt=function(t,e){var i=Rr(t,(function(t){var e=t.series.tooltip;return!(e&&!1===e.visible)}));if(i.length>0){var o=i[0],r=this.plotArea.categoryAxis.getSlot(o.categoryIx),n=e?this._slotAnchor(e,r):this._defaultAnchor(o,r);this.show({anchor:n,shared:!0,points:t,category:o.category,categoryText:this.formatService.auto(this.options.categoryFormat,o.category),series:this.plotArea.series},this.options)}},e.prototype._slotAnchor=function(t,e){return this.plotArea.categoryAxis.options.vertical||(t.x=e.center().x),{point:t,align:{horizontal:"left",vertical:"center"}}},e.prototype._defaultAnchor=function(t,e){var i=t.owner.pane.chartsBox(),o=this.plotArea.categoryAxis.options.vertical,r=i.center(),n=e.center();return{point:o?new An(r.x,n.y):new An(n.x,r.y),align:{horizontal:"center",vertical:"center"}}},e}(qp);sn(yc,{categoryFormat:"{0:d}"});var vc=yc,gc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){var t=this.element,e=this.options;if(t.bbox()){this.origin=e.origin;var i=e.vertical?k:S,o=this.fromScale=new p.Point(1,1);o[i]=Aa,t.transform(p.transform().scale(o.x,o.y))}else this.abort()},e.prototype.step=function(t){var e=zr(this.fromScale.x,1,t),i=zr(this.fromScale.y,1,t);this.element.transform(p.transform().scale(e,i,this.origin))},e.prototype.abort=function(){t.prototype.abort.call(this),this.element.transform(null)},e}(a.Animation);sn(gc,{duration:600}),a.AnimationFactory.current.register(ka,gc);var mc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){var t=this.center=this.element.bbox().center();this.element.transform(p.transform().scale(Aa,Aa,t))},e.prototype.step=function(t){this.element.transform(p.transform().scale(t,t,this.center))},e}(a.Animation);sn(mc,{easing:"easeOutElastic"}),a.AnimationFactory.current.register("bubble",mc);var xc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){this.fadeTo=this.element.opacity(),this.element.opacity(0)},e.prototype.step=function(t){this.element.opacity(t*this.fadeTo)},e}(a.Animation);sn(xc,{duration:200,easing:"linear"}),a.AnimationFactory.current.register("fadeIn",xc);var bc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){this.element.transform(p.transform().scale(Aa,Aa,this.options.center))},e.prototype.step=function(t){this.element.transform(p.transform().scale(t,t,this.options.center))},e}(a.Animation);sn(bc,{easing:"easeOutElastic",duration:600}),a.AnimationFactory.current.register(Ta,bc);var _c=bc,wc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){t.prototype.render.call(this),this.renderSegments()},e.prototype.createSegment=function(t,e,i){return new("smooth"===e.style?Za:Na)(t,e,i)},e.prototype.animationPoints=function(){return t.prototype.animationPoints.call(this).concat(this._segments)},e.prototype.createMissingValue=function(t,e){if(e===Sa){var i={x:t.x,y:t.y};return Bp(i.x)||(i.x=0),Bp(i.y)||(i.y=0),i}},e}(Ip);or(wc.prototype,Ka);var Ac=wc,Sc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(){this.namedXAxes={},this.namedYAxes={},this.xAxisRangeTracker=new pp,this.yAxisRangeTracker=new pp},e.prototype.render=function(t){void 0===t&&(t=this.panes);for(var e=this.groupSeriesByPane(),i=0;i<t.length;i++){var o=t[i],r=e[o.options.name||"default"]||[];this.addToLegend(r);var n=this.filterVisibleSeries(r);n&&(this.createScatterChart(sh(n,"scatter"),o),this.createScatterLineChart(sh(n,"scatterLine"),o),this.createBubbleChart(sh(n,"bubble"),o))}this.createAxes(t)},e.prototype.appendChart=function(e,i){this.xAxisRangeTracker.update(e.xAxisRanges),this.yAxisRangeTracker.update(e.yAxisRanges),t.prototype.appendChart.call(this,e,i)},e.prototype.removeAxis=function(e){var i=e.options.name;t.prototype.removeAxis.call(this,e),e.options.vertical?(this.yAxisRangeTracker.reset(i),delete this.namedYAxes[i]):(this.xAxisRangeTracker.reset(i),delete this.namedXAxes[i]),e===this.axisX&&delete this.axisX,e===this.axisY&&delete this.axisY},e.prototype.seriesPaneName=function(t){var e=this.options,i=t.xAxis,o=Rr([].concat(e.xAxis),(function(t){return t.name===i}))[0],r=t.yAxis,n=Rr([].concat(e.yAxis),(function(t){return t.name===r}))[0],s=(e.panes||[{}])[0].name||"default";return(o||{}).pane||(n||{}).pane||s},e.prototype.createScatterChart=function(t,e){t.length>0&&this.appendChart(new Ip(this,{series:t,clip:e.options.clip}),e)},e.prototype.createScatterLineChart=function(t,e){t.length>0&&this.appendChart(new Ac(this,{series:t,clip:e.options.clip}),e)},e.prototype.createBubbleChart=function(t,e){t.length>0&&this.appendChart(new Vp(this,{series:t,clip:e.options.clip}),e)},e.prototype.createXYAxis=function(t,e,i){for(var o,r=t.name,n=e?this.namedYAxes:this.namedXAxes,s=e?this.yAxisRangeTracker:this.xAxisRangeTracker,a=or({reverse:!e&&this.chartService.rtl},t,{vertical:e}),p=nh(a.type,"log"),h=s.query(),c=p?{min:.1,max:1}:{min:0,max:1},l=s.query(r)||h||c,u=[a.min,a.max],f=this.series,d=0;d<f.length;d++){var v=f[d],g=v[e?"yAxis":"xAxis"];if(g===a.name||0===i&&!g){var m=ma.current.bindPoint(v,0).valueFields;u.push(m[e?"y":"x"]);break}}0===i&&h&&(l.min=Math.min(l.min,h.min),l.max=Math.max(l.max,h.max));for(var x=0;x<u.length;x++)if(u[x]instanceof Date){o=!0;break}var b=new(nh(a.type,y)||!a.type&&o?Ns:p?Ys:Hs)(l.min,l.max,a,this.chartService);if(b.axisIndex=i,r){if(n[r])throw new Error((e?"Y":"X")+" axis with name "+r+" is already defined");n[r]=b}return this.appendAxis(b),b},e.prototype.createAxes=function(t){for(var e=this.options,i=[].concat(e.xAxis),o=[],r=[].concat(e.yAxis),n=[],s=0;s<i.length;s++){Lr(this.findPane(i[s].pane),t)&&o.push(this.createXYAxis(i[s],!1,s))}for(var a=0;a<r.length;a++){Lr(this.findPane(r[a].pane),t)&&n.push(this.createXYAxis(r[a],!0,a))}this.axisX=this.axisX||o[0],this.axisY=this.axisY||n[0]},e.prototype._dispatchEvent=function(t,e,i){for(var o=t._eventCoordinates(e),r=new An(o.x,o.y),n=this.axes,s=n.length,a=[],p=[],h=0;h<s;h++){var c=n[h],l=c.options.vertical?p:a,u=c.getValue(r);null!==u&&l.push(u)}a.length>0&&p.length>0&&t.trigger(i,{element:Yr(e),originalEvent:e,x:hh(a),y:hh(p)})},e.prototype.updateAxisOptions=function(t,e){var i=t.options.vertical,o=this.groupAxes(this.panes),r=(i?o.y:o.x).indexOf(t);kc(this.options,r,i,e),kc(this.originalOptions,r,i,e)},e}(xh);function kc(t,e,i,o){or([].concat(i?t.yAxis:t.xAxis)[e],o)}sn(Sc,{xAxis:{},yAxis:{}}),or(Sc.prototype,bh);var Cc=Sc,Pc=function(t){function e(e,i,o){t.call(this,o),this.value=e,this.sector=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=this.options.labels,e=this.owner.chartService,i=this.value;if(!this._rendered&&!1!==this.visible){this._rendered=!0;var o=Pr(t),r=this.pointData();if(o?i=o(r):t.format&&(i=e.format.auto(t.format,i)),t.visible&&(i||0===i)){if(t.position===f||"insideEnd"===t.position)t.color||(t.color=yn(this.options.color)),t.background||(t.background=this.options.color);else{var n=e.theme.seriesDefaults.labels;t.color=t.color||n.color,t.background=t.background||n.background}this.label=new Yn(i,or({},t,{align:f,vAlign:"",animation:{type:"fadeIn",delay:this.animationDelay}}),r),this.append(this.label)}}},e.prototype.reflow=function(t){this.render(),this.box=t,this.reflowLabel()},e.prototype.reflowLabel=function(){var t=this.options.labels,e=this.label,i=this.sector.clone(),o=t.distance,r=i.middle();if(e){var n,s=e.box.height(),a=e.box.width();if(t.position===f)i.radius=Math.abs((i.radius-s)/2)+s,n=i.point(r),e.reflow(new kn(n.x,n.y-s/2,n.x,n.y));else if("insideEnd"===t.position)i.radius=i.radius-s/2,n=i.point(r),e.reflow(new kn(n.x,n.y-s/2,n.x,n.y));else{var p;(n=i.clone().expand(o).point(r)).x>=i.center.x?(p=n.x+a,e.orientation=b):(p=n.x-a,e.orientation=g),e.reflow(new kn(p,n.y-s,n.x,n.y))}}},e.prototype.createVisual=function(){var e=this,i=this.sector,o=this.options;if(t.prototype.createVisual.call(this),this.value)if(o.visual){var r=(i.startAngle+180)%360,n=o.visual({category:this.category,dataItem:this.dataItem,value:this.value,series:this.series,percentage:this.percentage,center:new p.Point(i.center.x,i.center.y),radius:i.radius,innerRadius:i.innerRadius,startAngle:r,endAngle:r+i.angle,options:o,sender:this.getSender(),createVisual:function(){var t=new a.Group;return e.createSegmentVisual(t),t}});n&&this.visual.append(n)}else this.createSegmentVisual(this.visual)},e.prototype.createSegmentVisual=function(t){var e=this.sector,i=this.options,o=i.border||{},r=o.width>0?{stroke:{color:o.color,width:o.width,opacity:o.opacity,dashType:o.dashType}}:{},n=i.color,s={color:n,opacity:i.opacity},a=this.createSegment(e,or({fill:s,stroke:{opacity:i.opacity},zIndex:i.zIndex},r));t.append(a),lp(i)&&t.append(this.createGradientOverlay(a,{baseColor:n,fallbackFill:s},or({center:[e.center.x,e.center.y],innerRadius:e.innerRadius,radius:e.radius,userSpace:!0},i.overlay)))},e.prototype.createSegment=function(t,e){return e.singleSegment?new a.Circle(new p.Circle(new p.Point(t.center.x,t.center.y),t.radius),e):On.current.createRing(t,e)},e.prototype.createAnimation=function(){var e=this.options,i=this.sector.center;or(e,{animation:{center:[i.x,i.y],delay:this.animationDelay}}),t.prototype.createAnimation.call(this)},e.prototype.createHighlight=function(t){var e=this.options.highlight||{},i=e.border||{};return this.createSegment(this.sector,or({},t,{fill:{color:e.color,opacity:e.opacity},stroke:{opacity:i.opacity,width:i.width,color:i.color}}))},e.prototype.highlightVisual=function(){return this.visual.children[0]},e.prototype.highlightVisualArgs=function(){var t=this.sector;return{options:this.options,radius:t.radius,innerRadius:t.innerRadius,center:new p.Point(t.center.x,t.center.y),startAngle:t.startAngle,endAngle:t.angle+t.startAngle,visual:this.visual}},e.prototype.tooltipAnchor=function(){var t=this.sector.clone().expand(5),e=t.middle();return{point:t.point(e),align:Oc(e+180)}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e.prototype.pointData=function(){return{dataItem:this.dataItem,category:this.category,value:this.value,series:this.series,percentage:this.percentage}},e}(Bn),Tc=tn(Qr(30),10),Mc=tn(Qr(60),10);function Oc(t){var e=Qr(t),i=tn(Math.sin(e),10),o=tn(Math.cos(e),10);return{horizontal:Math.abs(i)>Mc?f:o<0?b:g,vertical:Math.abs(i)<Tc?f:i<0?u:_}}sn(Pc,{color:A,overlay:{gradient:"roundedBevel"},border:{width:.5},labels:{visible:!1,distance:35,font:"12px sans-serif",margin:hr(.5),align:d,zIndex:1,position:"outsideEnd"},animation:{type:Ta},highlight:{visible:!0,border:{width:1}},visible:!0}),or(Pc.prototype,Fa);var Rc=Pc,Bc={createLegendItem:function(t,e,i){var o=this.options.legend||{},r=o.labels||{},n=o.inactiveItems||{},s=n.labels||{};if(i&&!1!==i.visibleInLegend){var a,p,h=!1!==i.visible,c=h?Pr(r):Pr(s)||Pr(r),l=i.category;c&&(l=c({text:l,series:i.series,dataItem:i.dataItem,percentage:i.percentage,value:t})),h?(a={},p=e.color):(a={color:s.color,font:s.font},p=(n.markers||{}).color),Bp(l)&&""!==l&&this.legendItems.push({active:h,pointIndex:i.index,text:l,series:i.series,markerColor:p,labels:a})}}},jc=function(t){function e(e,i){t.call(this,i),this.plotArea=e,this.chartService=e.chartService,this.points=[],this.legendItems=[],this.render()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this.traverseDataPoints(this.addValue.bind(this))},e.prototype.traverseDataPoints=function(t){var e=this.options,i=this.plotArea.options.seriesColors;void 0===i&&(i=[]);for(var o=i.length,r=e.series,n=r.length,s=0;s<n;s++){var a=r[s],p=a.data,h=rh(a),c=h.total,l=h.points,u=h.count,d=360/c,y=void 0;isFinite(d)||(y=360/u);var v=void 0;v=Nr(a.startAngle)?a.startAngle:e.startAngle,s!==n-1&&"outsideEnd"===a.labels.position&&(a.labels.position=f);for(var g=0;g<l.length;g++){var m=l[g];if(m){var x=m.fields,b=m.value,_=m.visible,w=0!==b?y||b*d:0,A=1!==p.length&&Boolean(x.explode);er(a.color)||(a.color=x.color||i[g%o]),t(m.valueFields.value,new Pn(null,0,0,v,w),{owner:this,category:Nr(x.category)?x.category:"",index:g,series:a,seriesIx:s,dataItem:p[g],percentage:0!==c?b/c:0,explode:A,visibleInLegend:x.visibleInLegend,visible:_,zIndex:n-s,animationDelay:this.animationDelay(g,s,n)}),!1!==_&&(v+=w)}}}},e.prototype.evalSegmentOptions=function(t,e,i){var o=i.series;La(t,{value:e,series:o,dataItem:i.dataItem,category:i.category,percentage:i.percentage},{defaults:o._defaults,excluded:["data","content","template","visual","toggle"]})},e.prototype.addValue=function(t,e,i){var o=or({},i.series,{index:i.index});if(this.evalSegmentOptions(o,t,i),this.createLegendItem(t,o,i),!1!==i.visible){var r=new Rc(t,e,o);Object.assign(r,i),this.append(r),this.points.push(r)}},e.prototype.reflow=function(t){var e=this.options,i=this.points,o=this.seriesConfigs;void 0===o&&(o=[]);var r=i.length,n=t.clone(),s=Math.min(n.width(),n.height()),a=s/2,p=s-.85*s,h=new kn(n.x1,n.y1,n.x1+s,n.y1+s),c=h.center(),l=n.center(),u=e.series.length,f=[],d=[],y=on(e.padding,p);this.targetBox=t,y=y>a-5?a-5:y,h.translate(l.x-c.x,l.y-c.y);for(var v=a-y,g=new An(v+h.x1+y,v+h.y1+y),m=0;m<r;m++){var x=i[m],_=x.sector,w=x.seriesIx;if(_.radius=v,_.center=g,o.length){var A=o[w];_.innerRadius=A.innerRadius,_.radius=A.radius}w===u-1&&x.explode&&(_.center=_.clone().setRadius(.15*_.radius).point(_.middle())),x.reflow(h);var S=x.label;S&&"outsideEnd"===S.options.position&&w===u-1&&(S.orientation===b?d.push(S):f.push(S))}f.length>0&&(f.sort(this.labelComparator(!0)),this.leftLabelsReflow(f)),d.length>0&&(d.sort(this.labelComparator(!1)),this.rightLabelsReflow(d)),this.box=h},e.prototype.leftLabelsReflow=function(t){var e=this.distanceBetweenLabels(t);this.distributeLabels(e,t)},e.prototype.rightLabelsReflow=function(t){var e=this.distanceBetweenLabels(t);this.distributeLabels(e,t)},e.prototype.distanceBetweenLabels=function(t){var e=Kr(this.points),i=e.sector,o=t.length-1,r=i.radius+e.options.labels.distance,n=[],s=t[0].box,a=tn(s.y1-(i.center.y-r-s.height()-s.height()/2));n.push(a);for(var p=0;p<o;p++){var h=t[p+1].box;s=t[p].box,a=tn(h.y1-s.y2),n.push(a)}return a=tn(i.center.y+r-t[o].box.y2-t[o].box.height()/2),n.push(a),n},e.prototype.distributeLabels=function(t,e){for(var i,o,r,n=t.length,s=0;s<n;s++)for(r=-t[s],i=o=s;r>0&&(i>=0||o<n);)r=this._takeDistance(t,s,--i,r),r=this._takeDistance(t,s,++o,r);this.reflowLabels(t,e)},e.prototype._takeDistance=function(t,e,i,o){var r=o;if(t[i]>0){var n=Math.min(t[i],r);r-=n,t[i]-=n,t[e]+=n}return r},e.prototype.reflowLabels=function(t,e){var i,o=Kr(this.points),r=o.sector,n=o.options.labels,s=e.length,a=n.distance,p=r.center.y-(r.radius+a)-e[0].box.height();t[0]+=2;for(var h=0;h<s;h++){var c=e[h],l=c.box;p+=t[h],i=this.hAlignLabel(l.x2,r.clone().expand(a),p,p+l.height(),c.orientation===b),c.orientation===b?(n.align!==d&&(i=r.radius+r.center.x+a),c.reflow(new kn(i+l.width(),p,i,p))):(n.align!==d&&(i=r.center.x-r.radius-a),c.reflow(new kn(i-l.width(),p,i,p))),p+=l.height()}},e.prototype.createVisual=function(){var e=this.options.connectors,i=this.points,o=i.length;t.prototype.createVisual.call(this),this._connectorLines=[];for(var r=0;r<o;r++){var n=i[r],s=n.sector,p=n.label,h=s.middle(),c=(n.options.connectors||{}).color||e.color;if(p){var l=new a.Path({stroke:{color:c,width:e.width},animation:{type:"fadeIn",delay:n.animationDelay}});if("outsideEnd"===p.options.position){var u=p.box,f=s.center,d=s.point(h),y=new An(u.x1,u.center().y),v=void 0,g=void 0,m=void 0;d=s.clone().expand(e.padding).point(h),l.moveTo(d.x,d.y),p.orientation===b?(m=Ic(f,d,y,g=new An(u.x1-e.padding,u.center().y)),y=new An(g.x-4,g.y),(m=m||y).x=Math.min(m.x,y.x),this.pointInCircle(m,s.center,s.radius+4)||m.x<s.center.x?(v=s.center.x+s.radius+4,n.options.labels.align!==Ca?v<y.x?l.lineTo(v,d.y):l.lineTo(d.x+8,d.y):l.lineTo(v,d.y),l.lineTo(y.x,g.y)):(m.y=g.y,l.lineTo(m.x,m.y))):(m=Ic(f,d,y,g=new An(u.x2+e.padding,u.center().y)),y=new An(g.x+4,g.y),(m=m||y).x=Math.max(m.x,y.x),this.pointInCircle(m,s.center,s.radius+4)||m.x>s.center.x?(v=s.center.x-s.radius-4,n.options.labels.align!==Ca?v>y.x?l.lineTo(v,d.y):l.lineTo(d.x-8,d.y):l.lineTo(v,d.y),l.lineTo(y.x,g.y)):(m.y=g.y,l.lineTo(m.x,m.y))),l.lineTo(g.x,g.y),this._connectorLines.push(l),this.visual.append(l)}}}},e.prototype.renderVisual=function(){if(t.prototype.renderVisual.call(this),pn(this.options.series,(function(t){return t.autoFit}))){var e=this.targetBox,i=this.box.center(),o=this.visual.bbox();if(!o)return;var r=o.bottomRight(),n=Math.min((i.y-e.y1)/(i.y-o.origin.y),(e.y2-i.y)/(r.y-i.y),(i.x-e.x1)/(i.x-o.origin.x),(e.x2-i.x)/(r.x-i.x));n<1&&this.visual.transform(p.transform().scale(n,n,[i.x,i.y]))}},e.prototype.labelComparator=function(t){var e=t?-1:1;return function(t,i){return((t.parent.sector.middle()+270)%360-(i.parent.sector.middle()+270)%360)*e}},e.prototype.hAlignLabel=function(t,e,i,o,r){var n=e.radius,s=e.center,a=s.x,p=s.y,h=Math.min(Math.abs(p-i),Math.abs(p-o));return h>n?t:a+Math.sqrt(n*n-h*h)*(r?1:-1)},e.prototype.pointInCircle=function(t,e,i){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<Math.pow(i,2)},e.prototype.formatPointValue=function(t,e){return this.chartService.format.auto(e,t.value)},e.prototype.animationDelay=function(t){return 70*t},e.prototype.stackRoot=function(){return this},e}(Bn);function Ic(t,e,i,o){var r,n=(o.x-i.x)*(t.y-i.y)-(o.y-i.y)*(t.x-i.x),s=(o.y-i.y)*(e.x-t.x)-(o.x-i.x)*(e.y-t.y);if(0!==s){var a=n/s;r=new An(t.x+a*(e.x-t.x),t.y+a*(e.y-t.y))}return r}sn(jc,{startAngle:90,connectors:{width:2,color:"#939393",padding:8},inactiveItems:{markers:{},labels:{}}}),or(jc.prototype,Bc),jc.prototype.isStackRoot=!0;var Lc=jc,zc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this.createPieChart(this.series)},e.prototype.createPieChart=function(t){var e=t[0],i=new Lc(this,{series:t,padding:e.padding,startAngle:e.startAngle,connectors:e.connectors,legend:this.options.legend});this.appendChart(i)},e.prototype.appendChart=function(e,i){t.prototype.appendChart.call(this,e,i),Hr(this.options.legend.items,e.legendItems)},e}(xh),Ec=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflowLabel=function(){var e=this.options.labels,i=this.label,o=this.sector.clone(),r=o.middle();if(i){var n=i.box.height();if(e.position===f){o.radius-=(o.radius-o.innerRadius)/2;var s=o.point(r);i.reflow(new kn(s.x,s.y-n/2,s.x,s.y))}else t.prototype.reflowLabel.call(this)}},e.prototype.createSegment=function(t,e){return On.current.createRing(t,e)},e}(Rc);sn(Ec,{overlay:{gradient:"roundedGlass"},labels:{position:f},animation:{type:Ta}}),or(Ec.prototype,Fa);var Vc=Ec,Fc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addValue=function(t,e,i){var o=or({},i.series,{index:i.index});if(this.evalSegmentOptions(o,t,i),this.createLegendItem(t,o,i),t&&!1!==i.visible){var r=new Vc(t,e,o);Object.assign(r,i),this.append(r),this.points.push(r)}},e.prototype.reflow=function(e){for(var i,o=this.options,r=e.clone(),n=Math.min(r.width(),r.height()),s=n/2,a=n-.85*n,p=o.series,h=p.length,c=on(o.padding,a),l=s-(c=c>s-5?s-5:c),u=0,f=0;f<h;f++){var d=p[f];0===f&&Nr(d.holeSize)&&(i=d.holeSize,l-=d.holeSize),Nr(d.size)?l-=d.size:u++,Nr(d.margin)&&f!==h-1&&(l-=d.margin)}Nr(i)||(l-=i=.75*((s-c)/(h+.75)));var y,v=i,g=0;this.seriesConfigs=[];for(var m=0;m<h;m++){var x=p[m];y=(v+=g)+on(x.size,l/u),this.seriesConfigs.push({innerRadius:v,radius:y}),g=x.margin||0,v=y}t.prototype.reflow.call(this,e)},e.prototype.animationDelay=function(t,e,i){return 50*t+600*(e+1)/(i+1)},e}(Lc);sn(Fc,{startAngle:90,connectors:{width:2,color:"#939393",padding:8}});var Dc=Fc,Uc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this.createDonutChart(this.series)},e.prototype.createDonutChart=function(t){var e=t[0],i=new Dc(this,{series:t,padding:e.padding,connectors:e.connectors,legend:this.options.legend});this.appendChart(i)},e}(zc),Hc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(){this.valueAxisRangeTracker=new pp},e.prototype.render=function(){this.addToLegend(this.series),this.createPolarAxis(),this.createCharts(),this.createValueAxis()},e.prototype.alignAxes=function(){var t=this.valueAxis,e=t.range(),i=t.options.reverse?e.max:e.min,o=t.getSlot(i),r=this.polarAxis.getSlot(0).center,n=t.box.translate(r.x-o.x1,r.y-o.y1);t.reflow(n)},e.prototype.createValueAxis=function(){var t,e,i=this.valueAxisRangeTracker,o=i.query(),r=this.valueAxisOptions({roundToMajorUnit:!1,zIndex:-1});"log"===r.type?(t=na,e={min:.1,max:1}):(t=oa,e={min:0,max:1});var n=i.query(name)||o||e;n&&o&&(n.min=Math.min(n.min,o.min),n.max=Math.max(n.max,o.max));var s=new t(n.min,n.max,r,this.chartService);this.valueAxis=s,this.appendAxis(s)},e.prototype.reflowAxes=function(){var t=this.options.plotArea,e=this.valueAxis,i=this.polarAxis,o=this.box,r=.15*Math.min(o.width(),o.height()),n=hr(t.padding||{},r),s=o.clone().unpad(n),a=s.clone();a.y2=a.y1+Math.min(a.width(),a.height()),a.align(s,k,f);var p=a.clone().shrink(0,a.height()/2);i.reflow(a),e.reflow(p);var h=e.lineBox().height()-e.box.height();e.reflow(e.box.unpad({top:h})),this.axisBox=a,this.alignAxes(a)},e.prototype.backgroundBox=function(){return this.box},e.prototype.detachLabels=function(){},e}(xh),Gc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointSlot=function(t,e){var i=t.center.y-e.y1,o=An.onCircle(t.center,t.startAngle,i);return new kn(o.x,o.y,o.x,o.y)},e}(Ip);sn(Gc,{clip:!1});var Nc=Gc,Wc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ac);Wc.prototype.pointSlot=Nc.prototype.pointSlot,sn(Wc,{clip:!1});var qc=Wc,Xc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.fillToAxes=function(t){var e=this._polarAxisCenter();t.lineTo(e.x,e.y)},e.prototype._polarAxisCenter=function(){return this.parent.plotArea.polarAxis.box.center()},e.prototype.strokeSegments=function(){var t=this._strokeSegments;if(!t){var e=this._polarAxisCenter(),i=new aa(!1),o=this.points();o.push(e),(t=this._strokeSegments=i.process(o)).pop()}return t},e}(sp),Yc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.fillToAxes=function(t){var e=this.parent.plotArea.polarAxis.box.center(),i=new p.Segment([e.x,e.y]);t.segments.unshift(i),t.segments.push(i)},e}(op);function Zc(t,e){return t.value.x-e.value.x}var Kc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createSegment=function(t,e,i){return"smooth"===(e.line||{}).style?new Xc(t,e,i):new Yc(t,e,i)},e.prototype.createMissingValue=function(t,e){var i;return Bp(t.x)&&"interpolate"!==e&&(i={x:t.x,y:t.y},e===Sa&&(i.y=0)),i},e.prototype.seriesMissingValues=function(t){return t.missingValues||Sa},e.prototype._hasMissingValuesGap=function(){for(var t=this.options.series,e=0;e<t.length;e++)if("gap"===this.seriesMissingValues(t[e]))return!0},e.prototype.sortPoints=function(t){if(t.sort(Zc),this._hasMissingValuesGap())for(var e=0;e<t.length;e++){var i=t[e];if(i)Bp(i.value.y)||"gap"!==this.seriesMissingValues(i.series)||delete t[e]}return t},e}(qc),Jc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createPolarAxis=function(){var t=new Qs(this.options.xAxis,this.chartService);this.polarAxis=t,this.axisX=t,this.appendAxis(t)},e.prototype.valueAxisOptions=function(t){return or(t,{majorGridLines:{type:c},minorGridLines:{type:c}},this.options.yAxis)},e.prototype.createValueAxis=function(){t.prototype.createValueAxis.call(this),this.axisY=this.valueAxis},e.prototype.appendChart=function(t,e){this.valueAxisRangeTracker.update(t.yAxisRanges),xh.prototype.appendChart.call(this,t,e)},e.prototype.createCharts=function(){var t=this.filterVisibleSeries(this.series),e=this.panes[0];this.createLineChart(sh(t,["polarLine"]),e),this.createScatterChart(sh(t,["polarScatter"]),e),this.createAreaChart(sh(t,["polarArea"]),e)},e.prototype.createLineChart=function(t,e){if(0!==t.length){var i=new qc(this,{series:t});this.appendChart(i,e)}},e.prototype.createScatterChart=function(t,e){if(0!==t.length){var i=new Nc(this,{series:t});this.appendChart(i,e)}},e.prototype.createAreaChart=function(t,e){if(0!==t.length){var i=new Kc(this,{series:t});this.appendChart(i,e)}},e.prototype._dispatchEvent=function(t,e,i){var o=t._eventCoordinates(e),r=new An(o.x,o.y),n=this.axisX.getValue(r),s=this.axisY.getValue(r);null!==n&&null!==s&&t.trigger(i,{element:Yr(e),x:n,y:s})},e.prototype.createCrosshairs=function(){},e}(Hc);sn(Jc,{xAxis:{},yAxis:{}}),or(Jc.prototype,bh);var $c=Jc;var Qc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointSlot=function(t,e){var i=t.center.y-e.y1,o=An.onCircle(t.center,t.middle(),i);return new kn(o.x,o.y,o.x,o.y)},e.prototype.renderSegments=function(){if(t.prototype.renderSegments.call(this),this._segments&&this._segments.length>1)for(var e=function(t){for(var e=[],i=0;i<t.length;i++){var o=t[i];e[o.seriesIx]=e[o.seriesIx]||[],e[o.seriesIx].push(o)}return e}(this._segments),i=0;i<e.length;i++){var o=e[i];if(o&&o.length>1){var r=o[0].linePoints[0],n=Kr(o),s=Kr(n.linePoints),a=0===r.categoryIx,p=s.categoryIx===s.categoriesCount-1;a&&p&&Kr(o).linePoints.push(r)}}},e.prototype.createSegment=function(t,e,i){var o=new("smooth"===e.style?Za:Na)(t,e,i),r=this.seriesMissingValues(e);return t.length!==e.data.length&&"interpolate"!==r||(o.options.closed=!0),o},e}(ip);sn(Qc,{clip:!1,limitPoints:!1});var tl=Qc,el=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.fillToAxes=function(){},e}(sp),il=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.fillToAxes=function(){},e}(op),ol=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createSegment=function(t,e,i,o){var r,n,s,a=this.options.isStacked,p=(e.line||{}).style;return a&&i>0&&o&&(n=o.linePoints.slice(0),r=o),"smooth"===p?(s=new el(t,e,i,r,n)).options.closed=!0:(t.push(t[0]),s=new il(t,e,i,r,n)),s},e.prototype.seriesMissingValues=function(t){return t.missingValues||Sa},e}(tl),rl=function(t){function e(e,i){t.call(this,e,null,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Vc);sn(rl,{overlay:{gradient:"none"},labels:{distance:10}});var nl=rl,sl=function(t){function e(e){t.call(this,e),this.forEach=e.rtl?yp:dp}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.options,i=this.children,o=e.gap,r=e.spacing,n=i.length,s=n+o+r*(n-1),a=t.angle/s,p=t.startAngle+a*(o/2);this.forEach(i,(function(e){var i=t.clone();i.startAngle=p,i.angle=a,e.sector&&(i.radius=e.sector.radius),e.reflow(i),e.sector=i,p+=a+a*r}))},e}(Bn);sn(sl,{gap:1,spacing:0});var al=sl,pl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.options.reverse,i=this.children,o=i.length,r=e?o-1:0,n=e?-1:1;this.box=new kn;for(var s=r;s>=0&&s<o;s+=n){var a=i[s].sector;a.startAngle=t.startAngle,a.angle=t.angle}},e}(Bn),hl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointType=function(){return nl},e.prototype.clusterType=function(){return al},e.prototype.stackType=function(){return pl},e.prototype.categorySlot=function(t,e){return t.getSlot(e)},e.prototype.pointSlot=function(t,e){var i=t.clone(),o=t.center.y;return i.radius=o-e.y1,i.innerRadius=o-e.y2,i},e.prototype.reflowPoint=function(t,e){t.sector=e,t.reflow()},e.prototype.createAnimation=function(){this.options.animation.center=this.box.toRect().center(),t.prototype.createAnimation.call(this)},e}(_p);hl.prototype.reflow=Va.prototype.reflow,sn(hl,{clip:!1,limitPoints:!1,animation:{type:"pie"}});var cl=hl,ll=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createPolarAxis=function(){var t=new Js(this.options.categoryAxis,this.chartService);this.polarAxis=t,this.categoryAxis=t,this.appendAxis(t),this.aggregateCategories(),this.createCategoryAxesLabels()},e.prototype.valueAxisOptions=function(t){return this._hasBarCharts&&or(t,{majorGridLines:{type:c},minorGridLines:{type:c}}),this._isStacked100&&or(t,{roundToMajorUnit:!1,labels:{format:"P0"}}),or(t,this.options.valueAxis)},e.prototype.aggregateCategories=function(){Yh.prototype.aggregateCategories.call(this,this.panes)},e.prototype.createCategoryAxesLabels=function(){Yh.prototype.createCategoryAxesLabels.call(this,this.panes)},e.prototype.filterSeries=function(t){return t},e.prototype.createCharts=function(){var t=this.filterVisibleSeries(this.series),e=this.panes[0];this.createAreaChart(sh(t,["radarArea"]),e),this.createLineChart(sh(t,["radarLine"]),e),this.createBarChart(sh(t,["radarColumn"]),e)},e.prototype.chartOptions=function(t){var e={series:t},i=t[0];if(i){var o=this.filterVisibleSeries(t),r=i.stack;e.isStacked=r&&o.length>1,e.isStacked100=r&&"100%"===r.type&&o.length>1,e.isStacked100&&(this._isStacked100=!0)}return e},e.prototype.createAreaChart=function(t,e){if(0!==t.length){var i=new ol(this,this.chartOptions(t));this.appendChart(i,e)}},e.prototype.createLineChart=function(t,e){if(0!==t.length){var i=new tl(this,this.chartOptions(t));this.appendChart(i,e)}},e.prototype.createBarChart=function(t,e){if(0!==t.length){var i=t[0],o=this.chartOptions(t);o.gap=i.gap,o.spacing=i.spacing;var r=new cl(this,o);this.appendChart(r,e),this._hasBarCharts=!0}},e.prototype.seriesCategoryAxis=function(){return this.categoryAxis},e.prototype._dispatchEvent=function(t,e,i){var o=t._eventCoordinates(e),r=new An(o.x,o.y),n=this.categoryAxis.getCategory(r),s=this.valueAxis.getValue(r);null!==n&&null!==s&&t.trigger(i,{element:Yr(e),category:n,value:s})},e.prototype.createCrosshairs=function(){},e}(Hc);or(ll.prototype,bh,{appendChart:Yh.prototype.appendChart,aggregateSeries:Yh.prototype.aggregateSeries,seriesSourcePoints:Yh.prototype.seriesSourcePoints}),sn(ll,{categoryAxis:{categories:[]},valueAxis:{}});var ul=ll,fl=function(t){function e(e,i,o){t.call(this,i),this.value=e,this.options.index=o.index}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.points,i=this.children[0];this.box=new kn(e[0].x,e[0].y,e[1].x,e[2].y),i&&i.reflow(new kn(t.x1,e[0].y,t.x2,e[2].y))},e.prototype.createVisual=function(){var e,i=this,o=this.options;t.prototype.createVisual.call(this),(e=o.visual?o.visual({category:this.category,dataItem:this.dataItem,value:this.value,series:this.series,percentage:this.percentage,points:this.points,options:o,sender:this.getSender(),createVisual:function(){return i.createPath()}}):this.createPath())&&this.visual.append(e)},e.prototype.createPath=function(){var t=this.options,e=t.border;return a.Path.fromPoints(this.points,{fill:{color:t.color,opacity:t.opacity},stroke:{color:e.color,opacity:e.opacity,width:e.width}}).close()},e.prototype.createHighlight=function(t){return a.Path.fromPoints(this.points,t)},e.prototype.highlightVisual=function(){return this.visual.children[0]},e.prototype.highlightVisualArgs=function(){var t=a.Path.fromPoints(this.points).close();return{options:this.options,path:t}},e.prototype.tooltipAnchor=function(){var t=this.box;return{point:new An(t.center().x,t.y1),align:{horizontal:"center",vertical:"top"}}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e}(Bn);sn(fl,{color:A,border:{width:1}}),or(fl.prototype,Fa);var dl=fl,yl=function(t){function e(e,i){t.call(this,i),this.plotArea=e,this.points=[],this.labels=[],this.legendItems=[],this.render()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.formatPointValue=function(t,e){return this.chartService.format.auto(e,t.value)},e.prototype.render=function(){var t=this.options,e=this.plotArea.options.seriesColors;void 0===e&&(e=[]);var i=t.series[0],o=i.data;if(o)for(var r=rh(i),n=r.total,s=r.points,a=0;a<s.length;a++){var p=s[a];if(p){var h=p.fields;er(i.color)||(i.color=h.color||e[a%e.length]),h=or({index:a,owner:this,series:i,dataItem:o[a],percentage:p.value/n},h,{visible:p.visible});var c=p.valueFields.value,l=this.createSegment(c,h),u=this.createLabel(c,h);l&&u&&l.append(u)}}},e.prototype.evalSegmentOptions=function(t,e,i){var o=i.series;La(t,{value:e,series:o,dataItem:i.dataItem,index:i.index},{defaults:o._defaults,excluded:["data","content","template","toggle","visual"]})},e.prototype.createSegment=function(t,e){var i=or({},e.series);if(this.evalSegmentOptions(i,t,e),this.createLegendItem(t,i,e),!1!==e.visible){var o=new dl(t,i,e);return Object.assign(o,e),this.append(o),this.points.push(o),o}},e.prototype.createLabel=function(t,e){var i=e.series,o=e.dataItem,r=or({},this.options.labels,i.labels),n=t;if(r.visible){var s=Pr(r),a={dataItem:o,value:t,percentage:e.percentage,category:e.category,series:i};s?n=s(a):r.format&&(n=this.plotArea.chartService.format.auto(r.format,n)),r.color||(r.color=yn(i.color),r.background||(r.background=i.color)),this.evalSegmentOptions(r,t,e);var p=new Yn(n,or({vAlign:r.position},r),a);return this.labels.push(p),p}},e.prototype.labelPadding=function(){for(var t=this.labels,e={left:0,right:0},i=0;i<t.length;i++){var o=t[i].options.align;if(o!==f){var r=t[i].box.width();o===g?e.left=Math.max(e.left,r):e.right=Math.max(e.right,r)}}return e},e.prototype.dynamicSlopeReflow=function(t,e,i){for(var o=this.options,r=this.points,n=r.length,s=r[0],a=s,h=0;h<r.length;h++)r[h].percentage>a.percentage&&(a=r[h]);for(var c=s.percentage/a.percentage*e,l=(e-c)/2,u=0,f=0;f<n;f++){var d=r[f].percentage,y=r[f+1],v=y?y.percentage:d,g=r[f].points=[],m=o.dynamicHeight?i*d:i/n,x=void 0;x=Jr(x=d?(e-c*(v/d))/2:v?0:e/2,0,e),g.push(new p.Point(t.x1+l,t.y1+u)),g.push(new p.Point(t.x1+e-l,t.y1+u)),g.push(new p.Point(t.x1+e-x,t.y1+m+u)),g.push(new p.Point(t.x1+x,t.y1+m+u)),l=x,u+=m+o.segmentSpacing,c=Jr(e-2*x,0,e)}},e.prototype.constantSlopeReflow=function(t,e,i){for(var o=this.options,r=this.points,n=r.length,s=o.neckRatio<=1,a=s?o.neckRatio*e:e,h=s?0:(e-e/o.neckRatio)/2,c=((s?e:e-2*h)-a)/2,l=0,u=0;u<n;u++){var f=r[u].points=[],d=r[u].percentage,y=o.dynamicHeight?c*d:c/n,v=o.dynamicHeight?i*d:i/n;f.push(new p.Point(t.x1+h,t.y1+l)),f.push(new p.Point(t.x1+e-h,t.y1+l)),f.push(new p.Point(t.x1+e-h-y,t.y1+v+l)),f.push(new p.Point(t.x1+h+y,t.y1+v+l)),h+=y,l+=v+o.segmentSpacing}},e.prototype.reflow=function(t){var e=this.points,i=e.length;if(i){var o=this.options,r=t.clone().unpad(this.labelPadding()),n=r.height()-o.segmentSpacing*(i-1),s=r.width();o.dynamicSlope?this.dynamicSlopeReflow(r,s,n):this.constantSlopeReflow(r,s,n);for(var a=0;a<i;a++)e[a].reflow(t)}},e}(Bn);sn(yl,{neckRatio:.3,width:300,dynamicSlope:!1,dynamicHeight:!0,segmentSpacing:0,labels:{visible:!1,align:f,position:f,zIndex:1}}),or(yl.prototype,Bc);var vl=yl,gl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this.createFunnelChart(this.series)},e.prototype.createFunnelChart=function(t){var e=t[0],i=new vl(this,{series:t,legend:this.options.legend,neckRatio:e.neckRatio,dynamicHeight:e.dynamicHeight,dynamicSlope:e.dynamicSlope,segmentSpacing:e.segmentSpacing,highlight:e.highlight});this.appendChart(i)},e.prototype.appendChart=function(e,i){t.prototype.appendChart.call(this,e,i),Hr(this.options.legend.items,e.legendItems)},e}(xh),ml=function(t,e){void 0===e&&(e=.05);var i=Po(t),o=1-e;return function(t){var e=i.toHSL(),r=100-e.l,n=o-t;return e.l+=Math.min(n*r,r),e.toCss()}},xl=function(t){function e(e,i){t.call(this),this.options=i,this.color=i.color||A,this.value=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){this._rendered||(this._rendered=!0,this.createMarker(),this.createLabel(),this.createNote())},e.prototype.createLabel=function(){var t=this.options.labels;if(t.visible){var e,i=this.pointData(),o=Pr(t),r=t.color;e=o?o(i):this.formatValue(t.format),r||(r=yn(this.color)),this.label=new Yn(e,or({align:f,vAlign:f,margin:{left:5,right:5},zIndex:on(t.zIndex,this.series.zIndex)},t,{color:r}),i),this.append(this.label)}},e.prototype.formatValue=function(t){return this.owner.formatPointValue(this,t)},e.prototype.reflow=function(t){this.render();var e=this.label;this.box=t,e&&e.reflow(this.markerBox()),this.note&&this.note.reflow(t),this.marker.reflow(this.markerBox())},e.prototype.markerBox=function(){var t=this.options.markers,e=t.border,i=this.box.toRect(),o="roundedRect"===on(t.type,"rect"),r=on(e.width,o?1:0),n=Math.round(r/2);if(t.size){var s=i.center();i.size.width=i.size.height=t.size,i.origin.x=Math.round(s.x-i.size.width/2),i.origin.y=Math.round(s.y-i.size.height/2)}return i.size.width-=r,i.size.height-=r,i.origin.y+=n+.5,i.origin.x+=n+.5,qn(i)},e.prototype.markerBorder=function(){var t=this.options,e=t.markers.border,i=on(e.opacity,t.opacity);return{color:e.color||this.color,width:e.width,opacity:i,dashType:e.dashType}},e.prototype.createMarker=function(){var t=this.options,e=t.markers,i=new zn({type:on(e.type,"rect"),width:e.size,height:e.size,rotation:e.rotation,background:this.color,border:this.markerBorder(),borderRadius:e.borderRadius,opacity:this.series.opacity||t.opacity,zIndex:on(t.zIndex,this.series.zIndex),animation:t.animation,visual:t.visual},{dataItem:this.dataItem,value:this.value,series:this.series,category:this.category});this.marker=i,this.append(i)},e.prototype.createHighlight=function(t){var e=this.options,i=this.options.highlight.markers||this.options.markers,o=new zn({type:on(i.type,"rect"),width:i.size,height:i.size,rotation:i.rotation,background:i.color||this.color,border:this.markerBorder(),borderRadius:i.borderRadius,opacity:this.series.opacity||e.opacity,zIndex:on(e.zIndex,this.series.zIndex)});o.reflow(this.markerBox());var r=o.getElement();return r.options.fill=t.fill,r.options.stroke=t.stroke,r},e.prototype.highlightVisual=function(){return this.rectVisual},e.prototype.highlightVisualArgs=function(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}},e.prototype.tooltipAnchor=function(){var t=this.box.center().x,e=this.box.y1-5;return{point:new An(t,e),align:{horizontal:f,vertical:u}}},e.prototype.overlapsBox=function(t){return this.box.overlaps(t)},e.prototype.unclipElements=function(){},e.prototype.pointData=function(){return{x:this.value.x,y:this.value.y,value:this.value.value,dataItem:this.dataItem,series:this.series}},e}(Bn);or(xl.prototype,Fa),or(xl.prototype,Da),xl.prototype.defaults={markers:{type:"rect",borderRadius:4,border:{color:"transparent"}},padding:{top:1},labels:{visible:!1,padding:3},opacity:1,notes:{label:{}}};var bl=xl,_l=function(t){function e(e,i){t.call(this,i),this.plotArea=e,this.chartService=e.chartService,this._initFields(),this.render()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initFields=function(){this.points=[],this.seriesOptions=[],this.valueRange={min:m,max:x},this._evalSeries=[]},e.prototype.render=function(){this.setRange(),this.traverseDataPoints(this.addValue.bind(this))},e.prototype.setRange=function(){for(var t=this.options.series,e=0;e<t.length;e++)for(var i=t[e],o=0;o<i.data.length;o++){var r=this._bindPoint(i,e,o).valueFields;this.valueRange.min=Math.min(this.valueRange.min,r.value),this.valueRange.max=Math.max(this.valueRange.max,r.value)}},e.prototype.addValue=function(t,e){var i;t&&(i=this.createPoint(t,e))&&Object.assign(i,e),this.points.push(i)},e.prototype.evalPointOptions=function(t,e,i){var o=i.series,r=i.seriesIx,n={defaults:o._defaults,excluded:["data","tooltip","content","template","visual","toggle"]},s=this._evalSeries[r];Nr(s)||(this._evalSeries[r]=s=La(t,{},n,!0));var a=t;return s&&La(a=or({},t),{value:e,series:o,dataItem:i.dataItem,min:this.valueRange.min,max:this.valueRange.max},n),a},e.prototype.pointType=function(){return bl},e.prototype.pointOptions=function(t,e){var i=this.seriesOptions[e];if(!i){var o=this.pointType().prototype.defaults;this.seriesOptions[e]=i=or({},o,{markers:{opacity:t.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},t)}return i},e.prototype.createPoint=function(t,e){var i=e.series,o=this.pointOptions(i,e.seriesIx),r=e.color||i.color;(o=this.evalPointOptions(o,t,e),er(i.color))?r=o.color:r=ml(r)(t.value/this.valueRange.max);var n=new bl(t,o);return n.color=r,this.append(n),n},e.prototype.seriesAxes=function(t){var e=t.xAxis,i=t.yAxis,o=this.plotArea,r=e?o.namedXAxes[e]:o.axisX,n=i?o.namedYAxes[i]:o.axisY;if(!r)throw new Error("Unable to locate X axis with name "+e);if(!n)throw new Error("Unable to locate Y axis with name "+i);return{xAxis:r,yAxis:n}},e.prototype.reflow=function(t){var e=this,i=this.points,o=!this.options.clip,r=0;this.traverseDataPoints((function(t,n){var s=i[r++],a=e.seriesAxes(n.series),p=a.xAxis,h=a.yAxis,c=p.categoryIndex(t.x),l=h.categoryIndex(t.y),u=p.getSlot(c,c,o),f=h.getSlot(l,l,o);if(s)if(u&&f){var d=e.pointSlot(u,f);s.reflow(d)}else s.visible=!1})),this.box=t},e.prototype.pointSlot=function(t,e){return new kn(t.x1,e.y1,t.x2,e.y2)},e.prototype.traverseDataPoints=function(t){for(var e=this.options.series,i=0;i<e.length;i++)for(var o=e[i],r=this.seriesAxes(o),n=r.xAxis,s=r.yAxis,a=n.currentRangeIndices(),p=s.currentRangeIndices(),h=0;h<o.data.length;h++){var c=this._bindPoint(o,i,h),l=c.valueFields,u=c.fields,f=n.totalIndex(l.x),d=s.totalIndex(l.y),y=a.min<=f&&f<=a.max,v=p.min<=d&&d<=p.max;y&&v&&t(l,or({pointIx:h,series:o,seriesIx:i,dataItem:o.data[h],owner:this},u))}},e.prototype.formatPointValue=function(t,e){var i=t.value;return this.chartService.format.auto(e,i.x,i.y,i.value)},e.prototype.animationPoints=function(){for(var t=this.points,e=[],i=0;i<t.length;i++)e.push((t[i]||{}).marker);return e},e}(Bn);sn(_l,{series:[],tooltip:{format:"{0}, {1}: {2}"},labels:{format:"{2}"},clip:!0}),or(_l.prototype,{_bindPoint:Va.prototype._bindPoint});var wl=_l,Al=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initFields=function(){this.namedXAxes={},this.namedYAxes={}},e.prototype.render=function(t){void 0===t&&(t=this.panes),this.bindCategories(),this.createAxes(t),this.createCharts(t),this.createAxisLabels()},e.prototype.bindCategories=function(){for(var t=this.srcSeries||this.series,e=0;e<t.length;e++){for(var i=t[e],o=i.data||[],r=this.seriesAxes(i),n=r.xAxis,s=r.yAxis,a=_n(n.categories||[]),p=_n(s.categories||[]),h=0;h<o.length;h++){var c=ma.current.bindPoint(i,h).valueFields,l=c.x,u=c.y;a.has(l)||a.add(l),p.has(u)||p.add(u)}n.categories=a.values(),s.categories=p.values()}},e.prototype.createCharts=function(t){for(var e=this.groupSeriesByPane(),i=0;i<t.length;i++){var o=t[i],r=e[o.options.name||"default"]||[];this.addToLegend(r);var n=this.filterVisibleSeries(r);n&&this.createHeatmapChart(sh(n,["heatmap"]),o)}},e.prototype.createHeatmapChart=function(t,e){var i=new wl(this,{series:t});this.appendChart(i,e)},e.prototype.seriesPaneName=function(t){var e=this.options,i=t.xAxis,o=Rr([].concat(e.xAxis),(function(t){return t.name===i}))[0],r=t.yAxis,n=Rr([].concat(e.yAxis),(function(t){return t.name===r}))[0],s=(e.panes||[{}])[0].name||"default";return(o||{}).pane||(n||{}).pane||s},e.prototype.seriesAxes=function(t){var e,i,o=this.options,r=[].concat(o.xAxis),n=t.xAxis;e=n?r.find((function(t){return t.name===n})):r[0];var s=[].concat(o.yAxis),a=t.yAxis;if(i=a?s.find((function(t){return t.name===a})):s[0],!e)throw new Error("Unable to locate X axis with name "+n);if(!i)throw new Error("Unable to locate Y axis with name "+a);return{xAxis:e,yAxis:i}},e.prototype.createAxisLabels=function(){for(var t=this.axes,e=0;e<t.length;e++)t[e].createLabels()},e.prototype.createXYAxis=function(t,e,i){for(var o,r=t.name,n=e?this.namedYAxes:this.namedXAxes,s=Object.assign({axisCrossingValue:0},t,{vertical:e,reverse:e||this.chartService.rtl?!t.reverse:t.reverse,justified:!1}),a=s.categories?s.categories[0]:null,p=[s.min,s.max,a],h=this.series,c=0;c<h.length;c++){var l=h[c],u=l[e?"yAxis":"xAxis"];if(u===s.name||0===i&&!u){var f=ma.current.bindPoint(l,0).valueFields;p.push(f[e?"y":"x"]);break}}for(var d=0;d<p.length;d++)if(p[d]instanceof Date){o=!0;break}var v=new(nh(s.type,y)||!s.type&&o?Ls:Cs)(s,this.chartService);if(v.axisIndex=i,r){if(n[r])throw new Error((e?"Y":"X")+" axis with name "+r+" is already defined");n[r]=v}return this.appendAxis(v),v.mapCategories(),v},e.prototype.createAxes=function(t){for(var e=this.options,i=[].concat(e.xAxis),o=[],r=[].concat(e.yAxis),n=[],s=0;s<i.length;s++){Lr(this.findPane(i[s].pane),t)&&o.push(this.createXYAxis(i[s],!1,s))}for(var a=0;a<r.length;a++){Lr(this.findPane(r[a].pane),t)&&n.push(this.createXYAxis(r[a],!0,a))}this.axisX=this.axisX||o[0],this.axisY=this.axisY||n[0]},e.prototype.removeAxis=function(e){var i=e.options.name;t.prototype.removeAxis.call(this,e),e.options.vertical?delete this.namedYAxes[i]:delete this.namedXAxes[i],e===this.axisX&&delete this.axisX,e===this.axisY&&delete this.axisY},e.prototype._dispatchEvent=function(t,e,i){for(var o=t._eventCoordinates(e),r=new An(o.x,o.y),n=this.axes,s=n.length,a=[],p=[],h=0;h<s;h++){var c=n[h];ih(c.options.vertical?p:a,c.getCategory(r))}a.length>0&&p.length>0&&t.trigger(i,{element:Yr(e),originalEvent:e,x:hh(a),y:hh(p)})},e.prototype.updateAxisOptions=function(t,e){var i=t.options.vertical,o=this.groupAxes(this.panes),r=(i?o.y:o.x).indexOf(t);Sl(this.options,r,i,e),Sl(this.originalOptions,r,i,e)},e.prototype.crosshairOptions=function(t){return Object.assign({},t.options.crosshair,{zIndex:0})},e}(xh);function Sl(t,e,i,o){or([].concat(i?t.yAxis:t.xAxis)[e],o)}sn(Al,{xAxis:{},yAxis:{}}),or(Al.prototype,bh);var kl=Al,Cl="color",Pl="first",Tl="max";hc.current.register(Yh,[ka,Ca,Pa,Ma,"area","verticalArea","candlestick","ohlc","bullet","verticalBullet","boxPlot","verticalBoxPlot","rangeColumn","rangeBar","waterfall","horizontalWaterfall","rangeArea","verticalRangeArea"]),hc.current.register(Cc,["scatter","scatterLine","bubble"]),hc.current.register(zc,[Ta]),hc.current.register(Uc,["donut"]),hc.current.register(gl,["funnel"]),hc.current.register($c,["polarArea","polarLine","polarScatter"]),hc.current.register(ul,["radarArea","radarColumn","radarLine"]),hc.current.register(kl,["heatmap"]),ma.current.register([ka,Ca,Pa,Ma,"area","verticalArea"],[w],["category",Cl,"noteText","errorLow","errorHigh"]),ma.current.register(["rangeColumn","rangeBar","rangeArea","verticalRangeArea"],["from","to"],["category",Cl,"noteText"]),ma.current.register(["waterfall","horizontalWaterfall"],[w],["category",Cl,"noteText","summary"]),ma.current.register(["polarArea","polarLine","polarScatter"],[S,k],[Cl]),ma.current.register(["radarArea","radarColumn","radarLine"],[w],[Cl]),ma.current.register(["funnel"],[w],["category",Cl,"visibleInLegend","visible"]),Sh.current.register([ka,Ca,Pa,Ma,"area","verticalArea","waterfall","horizontalWaterfall"],{value:Tl,color:Pl,noteText:Pl,errorLow:"min",errorHigh:Tl}),Sh.current.register(["rangeColumn","rangeBar","rangeArea","verticalRangeArea"],{from:"min",to:Tl,color:Pl,noteText:Pl}),Sh.current.register(["radarArea","radarColumn","radarLine"],{value:Tl,color:Pl}),ma.current.register(["scatter","scatterLine","bubble"],[S,k],[Cl,"noteText","xErrorLow","xErrorHigh","yErrorLow","yErrorHigh"]),ma.current.register(["bubble"],[S,k,"size"],[Cl,"category","noteText"]),ma.current.register(["heatmap"],[S,k,w],[Cl,"noteText"]),ma.current.register(["candlestick","ohlc"],["open","high","low","close"],["category",Cl,"downColor","noteText"]),Sh.current.register(["candlestick","ohlc"],{open:Tl,high:Tl,low:"min",close:Tl,color:Pl,downColor:Pl,noteText:Pl}),ma.current.register(["boxPlot","verticalBoxPlot"],["lower","q1","median","q3","upper","mean","outliers"],["category",Cl,"noteText"]),Sh.current.register(["boxPlot","verticalBoxPlot"],{lower:Tl,q1:Tl,median:Tl,q3:Tl,upper:Tl,mean:Tl,outliers:Pl,color:Pl,noteText:Pl}),ma.current.register(["bullet","verticalBullet"],["current","target"],["category",Cl,"visibleInLegend","noteText"]),Sh.current.register(["bullet","verticalBullet"],{current:Tl,target:Tl,color:Pl,noteText:Pl}),ma.current.register([Ta,"donut"],[w],["category",Cl,"explode","visibleInLegend","visible"]);var Ml=["category",w,S,k],Ol=function(t){function e(e,i,o,r){var n=this;void 0===r&&(r={}),t.call(this),this.observers=[],this.addObserver(r.observer),this.chartService=new _r(this,r),this.chartService.theme=o,this._initElement(e);var s=or({},this.options,i);this._originalOptions=or({},s),this._theme=o,this._initTheme(s,o),this._initHandlers(),this._initSurface(),this.bindCategories(),nn.preloadFonts(i,(function(){n.fontLoaded=!0,n._destroyed||(n.trigger("init"),n._redraw(),n._attachEvents())}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initElement=function(t){for(this._setElementClass(t),t.style.position="relative";t.firstChild;)t.removeChild(t.firstChild);this.element=t},e.prototype._setElementClass=function(t){P(t,"k-chart")},e.prototype._initTheme=function(t,e){for(var i=[],o=t.series||[],r=0;r<o.length;r++)i.push(Object.assign({},o[r]));t.series=i,function(t){for(var e=Ml,i=0;i<e.length;i++){var o=e[i]+"Axes";t[o]&&(t[e[i]+"Axis"]=t[o],delete t[o])}}(t),this.applyDefaults(t,e),null===t.seriesColors&&delete t.seriesColors,this.options=or({},e,t),this.applySeriesColors()},e.prototype.getSize=function(){var t=this.options.chartArea||{};return{width:t.width?parseInt(t.width,10):Math.floor(this.element.offsetWidth),height:t.height?parseInt(t.height,10):Math.floor(this.element.offsetHeight)}},e.prototype.resize=function(t){var e=this.getSize(),i=this._size,o=e.width>0||e.height>0;t||o&&(!i||e.width!==i.width||e.height!==i.height)?(this._size=e,this._resize(e,t),this.trigger("resize",e)):o&&this._selections&&pn(this._selections,(function(t){return!t.visible}))&&(this._destroySelections(),this._setupSelection())},e.prototype._resize=function(){this._noTransitionsRedraw()},e.prototype.redraw=function(t){if(this.applyDefaults(this.options),this.applySeriesColors(),t){var e=this._model._plotArea,i=e.findPane(t);e.redraw(i)}else this._redraw()},e.prototype.getAxis=function(t){return ha(t,this._plotArea.axes)},e.prototype.findAxisByName=function(t){return this.getAxis(t)},e.prototype.findPaneByName=function(t){for(var e=this._plotArea.panes,i=0;i<e.length;i++)if(e[i].options.name===t)return new la(e[i])},e.prototype.findPaneByIndex=function(t){var e=this._plotArea.panes;if(e[t])return new la(e[t])},e.prototype.plotArea=function(){return new ua(this._plotArea)},e.prototype.toggleHighlight=function(t,e){var i,o,r,n=this._plotArea,s=(n.srcSeries||n.series||[])[0];er(e)?i=n.filterPoints(e):(rr(e)?(o=e.series,r=e.category):o=r=e,i="donut"===s.type?Rl(n.pointsBySeriesName(o),r):s.type===Ta||"funnel"===s.type?Rl((n.charts[0]||{}).points,r):n.pointsBySeriesName(o));i&&this.togglePointsHighlight(t,i)},e.prototype.togglePointsHighlight=function(t,e){for(var i=this._highlight,o=0;o<e.length;o++)i.togglePointHighlight(e[o],t)},e.prototype.showTooltip=function(t){var e,i,o=this._sharedTooltip(),r=this._tooltip,n=this._plotArea;if(er(t)?(e=n.findPoint(t))&&o&&(i=e.categoryIx):o&&Nr(t)&&(i=n.categoryAxis.categoryIndex(t)),o){if(i>=0){var s=this._plotArea.pointsByCategoryIndex(i);r.showAt(s)}}else e&&r.show(e)},e.prototype.hideTooltip=function(){this._tooltip.hide()},e.prototype._initSurface=function(){var t=this.surface,e=this._surfaceWrap(),i=this.options.chartArea||{};i.width&&Xr(e,{width:i.width}),i.height&&Xr(e,{height:i.height}),t&&t.options.type===this.options.renderAs?(this.surface.clear(),this.surface.resize()):(this._destroySurface(),this.surface=a.Surface.create(e,{type:this.options.renderAs}),this.surface.bind("mouseenter",this._surfaceMouseenterHandler),this.surface.bind("mouseleave",this._surfaceMouseleaveHandler))},e.prototype._surfaceWrap=function(){return this.element},e.prototype._redraw=function(){var t=this._getModel();this._size={width:t.options.width,height:t.options.height},this._destroyView(),this._model=t,this._plotArea=t._plotArea,t.renderVisual(),!1!==this.options.transitions&&t.traverse((function(t){t.animation&&t.animation.setup()})),this._initSurface(),this.surface.draw(t.visual),!1!==this.options.transitions&&t.traverse((function(t){t.animation&&t.animation.play()})),this._tooltip=this._createTooltip(),this._highlight=new Kh,this._setupSelection(),this._createPannable(),this._createZoomSelection(),this._createMousewheelZoom(),this.trigger("render"),zl(this._plotArea.panes),this._navState||this._cancelDomEvents()},e.prototype.exportVisual=function(t){var e;if(t&&(t.width||t.height||t.options)){var i=this.options,o=or({},t.options,{chartArea:{width:t.width,height:t.height}});Ll(this._originalOptions,o),this.options=or({},this._originalOptions,o),this._initTheme(this.options,this._theme),this.bindCategories();var r=this._getModel();r.renderVisual(),zl(r._plotArea.panes),e=r.visual,this.options=i}else e=this.surface.exportVisual();return e},e.prototype._sharedTooltip=function(){return this._plotArea instanceof Yh&&this.options.tooltip&&this.options.tooltip.shared},e.prototype._createPannable=function(){var t=this.options;!1!==t.pannable&&(this._pannable=new tc(this._plotArea,t.pannable))},e.prototype._createZoomSelection=function(){var t=this.options.zoomable,e=(t||{}).selection;!1!==t&&!1!==e&&(this._zoomSelection=new ic(this,e))},e.prototype._createMousewheelZoom=function(){var t=this.options.zoomable,e=(t||{}).mousewheel;!1!==t&&!1!==e&&(this._mousewheelZoom=new oc(this,e))},e.prototype._toggleDragZoomEvents=function(){var t=this.options.pannable,e=this.options.zoomable,i=(e||{}).selection,o=(e||{}).mousewheel,r=!(t||!1!==e&&!1!==i||this.requiresHandlers(["dragStart","drag","dragEnd"])),n=(!1===e||!1===o)&&!this.requiresHandlers(["zoomStart","zoom","zoomEnd"]),s=this.element;this._dragZoomEnabled&&r&&n?(s.style.touchAction=this._touchAction||"",this._dragZoomEnabled=!1):this._dragZoomEnabled||r&&n||(s.style.touchAction="none",this._dragZoomEnabled=!0),this._toggleDomEvents(!r,!n)},e.prototype._toggleDomEvents=function(t,e){var i=this.domEvents;i&&(i.toggleDrag&&i.toggleDrag(t),i.toggleZoom&&i.toggleZoom(e))},e.prototype._createTooltip=function(){var t=this.options.tooltip;return this._sharedTooltip()?this._createSharedTooltip(t):new dc(this.chartService,t)},e.prototype._createSharedTooltip=function(t){return new vc(this._plotArea,t)},e.prototype.applyDefaults=function(t,e){!function(t,e){var i,o,r,n=(e||{}).axisDefaults||{};function s(t){var e=(t||{}).color||o.color,r=or({},n,n[i],o,o[i],{line:{color:e},labels:{color:e},title:{color:e}},t);return delete r[i],r}for(var a=0;a<Ml.length;a++)i=Ml[a]+"Axis",o=t.axisDefaults||{},r=(r=[].concat(t[i])).map(s),t[i]=r.length>1?r:r[0]}(t,e),function(t,e){var i=t.series,o=i.length,r=t.seriesDefaults,n=or({},t.seriesDefaults),s=e?or({},e.seriesDefaults):{},a=or({},s);Bl(n),Bl(a);for(var p=0;p<o;p++){var h=i[p].type||t.seriesDefaults.type,c=or({data:[]},a,s[h],{tooltip:t.tooltip},n,r[h]);i[p]._defaults=c,i[p]=or({},c,i[p]),i[p].data=i[p].data||[]}}(t,e)},e.prototype.applySeriesColors=function(){for(var t=this.options,e=t.series,i=t.seriesColors||[],o=0;o<e.length;o++){var r=e[o],n=i[o%i.length],s=r._defaults;r.color=r.color||n,s&&(s.color=s.color||n)}},e.prototype._getModel=function(){var t=this.options,e=this._createPlotArea(),i=new Dn(this._modelOptions());return i.chart=this,i._plotArea=e,Kn.buildTitle(t.title,i),t.legend&&t.legend.visible&&i.append(new ac(e.options.legend,this.chartService)),i.append(e),i.reflow(),i},e.prototype._modelOptions=function(){var t=this.options,e=this.getSize();return or({transitions:t.transitions,width:e.width||600,height:e.height||400},t.chartArea)},e.prototype._createPlotArea=function(t){var e=this.options;return hc.current.create(t?[]:e.series,e,this.chartService)},e.prototype._setupSelection=function(){for(var t=this._plotArea.axes,e=this._selections=[],i=0;i<t.length;i++){var o=t[i],r=o.options;if(o instanceof Cs&&r.select&&!r.vertical){var n=o.range(),s=new fc(this,o,or({min:n.min,max:n.max},r.select));e.push(s)}}},e.prototype._selectStart=function(t){return this.trigger("selectStart",t)},e.prototype._select=function(t){return this.trigger("select",t)},e.prototype._selectEnd=function(t){return this.trigger("selectEnd",t)},e.prototype._initHandlers=function(){this._clickHandler=this._click.bind(this),this._mousewheelHandler=this._mousewheel.bind(this),this._mouseleaveHandler=this._mouseleave.bind(this),this._surfaceMouseenterHandler=this._mouseover.bind(this),this._surfaceMouseleaveHandler=this._mouseout.bind(this),this._mousemove=po(this._mousemove.bind(this),20)},e.prototype.addObserver=function(t){t&&this.observers.push(t)},e.prototype.removeObserver=function(t){var e=this.observers.indexOf(t);e>=0&&this.observers.splice(e,1)},e.prototype.requiresHandlers=function(t){for(var e=this.observers,i=0;i<e.length;i++)if(e[i].requiresHandlers(t))return!0},e.prototype.trigger=function(t,e){void 0===e&&(e={}),"showTooltip"===t&&(e.anchor.point=this._toDocumentCoordinates(e.anchor.point)),e.sender=this;for(var i=this.observers,o=!1,r=0;r<i.length;r++)i[r].trigger(t,e)&&(o=!0);return o},e.prototype._attachEvents=function(){var t,e,i=this.element;this._touchAction=i.style.touchAction,Gr(i,((t={}).contextmenu=this._clickHandler,t[Ra]=this._mousewheelHandler,t.mouseleave=this._mouseleaveHandler,t)),this._shouldAttachMouseMove()&&Gr(i,((e={}).mousemove=this._mousemove,e)),this.domEvents=Ar.create(this.element,{start:this._start.bind(this),move:this._move.bind(this),end:this._end.bind(this),tap:this._tap.bind(this),gesturestart:this._gesturestart.bind(this),gesturechange:this._gesturechange.bind(this),gestureend:this._gestureend.bind(this)}),this._toggleDragZoomEvents()},e.prototype._mouseleave=function(t){this._hoveredPoint&&(this._hoveredPoint.out(this,t),this._hoveredPoint=null),this._plotArea.hovered&&(this.trigger("plotAreaLeave"),this._plotArea.hovered=!1)},e.prototype._cancelDomEvents=function(){this.domEvents&&this.domEvents.cancel&&this.domEvents.cancel()},e.prototype._gesturestart=function(t){this._mousewheelZoom&&!this._stopChartHandlers(t)&&(this._gestureDistance=t.distance,this._unsetActivePoint(),this.surface.suspendTracking())},e.prototype._gestureend=function(t){this._zooming&&!this._stopChartHandlers(t)&&(this.surface&&this.surface.resumeTracking(),this._zooming=!1,this.trigger("zoomEnd",{}))},e.prototype._gesturechange=function(t){var e=this._mousewheelZoom;if(e&&!this._stopChartHandlers(t)){t.preventDefault();var i=this._gestureDistance,o=-t.distance/i+1;if(Math.abs(o)>=.1){o=Math.round(10*o),this._gestureDistance=t.distance;var r={delta:o,axisRanges:jl(this._plotArea.axes),originalEvent:t};if(this._zooming||!this.trigger("zoomStart",r))this._zooming||(this._zooming=!0),(r.axisRanges=e.updateRanges(o))&&!this.trigger("zoom",r)&&e.zoom()}}},e.prototype._mouseout=function(t){if(t.element){var e=this._drawingChartElement(t.element,t);e&&e.leave&&e.leave(this,t.originalEvent)}},e.prototype._start=function(t){var e=this._eventCoordinates(t);!this._stopChartHandlers(t)&&this._plotArea.backgroundContainsPoint(e)&&(this.requiresHandlers(["dragStart","drag","dragEnd"])&&this._startNavigation(t,e,"dragStart"),this._pannable&&this._pannable.start(t)&&(this.surface.suspendTracking(),this._unsetActivePoint(),this._suppressHover=!0,this.chartService.panning=!0),this._zoomSelection&&this._zoomSelection.start(t)&&this.trigger("zoomStart",{axisRanges:jl(this._plotArea.axes),originalEvent:t}))},e.prototype._move=function(t){var e=this._navState,i=this._pannable;if(!this._stopChartHandlers(t)){if(i){var o=i.move(t);o&&!this.trigger("drag",{axisRanges:o,originalEvent:t})&&i.pan()}else if(e){for(var r={},n=e.axes,s=0;s<n.length;s++){var a=n[s];if(a.options.name){var p=a.options.vertical?t.y:t.x,h=p.startLocation-p.location;0!==h&&(r[a.options.name]=a.translateRange(h))}}e.axisRanges=r,this.trigger("drag",{axisRanges:r,originalEvent:t})}this._zoomSelection&&this._zoomSelection.move(t)}},e.prototype._end=function(t){if(!this._stopChartHandlers(t)){var e=this._pannable;if(e&&e.end(t)?(this.surface.resumeTracking(),this.trigger("dragEnd",{axisRanges:jl(this._plotArea.axes),originalEvent:t}),this._suppressHover=!1,this.chartService.panning=!1):this._endNavigation(t,"dragEnd"),this._zoomSelection){var i=this._zoomSelection.end(t);i&&!this.trigger("zoom",{axisRanges:i,originalEvent:t})&&(this._zoomSelection.zoom(),this.trigger("zoomEnd",{axisRanges:i,originalEvent:t}))}}},e.prototype._stopChartHandlers=function(t){var e=this._selections||[];if(!e.length)return!1;var i=this._eventCoordinates(t),o=this._plotArea.paneByPoint(i);if(o)for(var r=0;r<e.length;r++)if(e[r].onPane(o))return!0},e.prototype._mousewheel=function(t){var e=this,i=Dr(t),o=this._mousewheelZoom,r=this._eventCoordinates(t);if(!this._stopChartHandlers(t)&&this._plotArea.backgroundContainsPoint(r))if(o){var n={delta:i,axisRanges:jl(this._plotArea.axes),originalEvent:t};!this._zooming&&this.trigger("zoomStart",n)||(t.preventDefault(),this._zooming||(this._unsetActivePoint(),this.surface.suspendTracking(),this._zooming=!0),this._mwTimeout&&clearTimeout(this._mwTimeout),n.axisRanges=o.updateRanges(i),n.axisRanges&&!this.trigger("zoom",n)&&o.zoom(),this._mwTimeout=setTimeout((function(){e.trigger("zoomEnd",n),e._zooming=!1,e.surface&&e.surface.resumeTracking()}),150))}else{var s=this._navState;if(!s)this._startNavigation(t,r,"zoomStart")||(s=this._navState);if(s){var a=s.totalDelta||i;s.totalDelta=a+i;for(var p=this._navState.axes,h={},c=0;c<p.length;c++){var l=p[c],u=l.options.name;u&&(h[u]=l.scaleRange(-a))}this.trigger("zoom",{delta:i,axisRanges:h,originalEvent:t}),this._mwTimeout&&clearTimeout(this._mwTimeout),this._mwTimeout=setTimeout((function(){e._endNavigation(t,"zoomEnd")}),150)}}},e.prototype._startNavigation=function(t,e,i){var o=this._model._plotArea,r=o.findPointPane(e),n=o.axes.slice(0);if(r){var s=jl(n);this.trigger(i,{axisRanges:s,originalEvent:t})?this._cancelDomEvents():(this._suppressHover=!0,this._unsetActivePoint(),this._navState={axisRanges:s,pane:r,axes:n})}},e.prototype._endNavigation=function(t,e){this._navState&&(this.trigger(e,{axisRanges:this._navState.axisRanges,originalEvent:t}),this._suppressHover=!1,this._navState=null)},e.prototype._getChartElement=function(t,e){var i=this.surface.eventTarget(t);if(i)return this._drawingChartElement(i,t,e)},e.prototype._drawingChartElement=function(t,e,i){for(var o,r=t;r&&!o;)o=r.chartElement,r=r.parent;if(o)return o.aliasFor&&(o=o.aliasFor(e,this._eventCoordinates(e))),i&&(o=o.closest(i))&&o.aliasFor&&(o=o.aliasFor()),o},e.prototype._eventCoordinates=function(t){var e=Zr(t);return this._toModelCoordinates(e.x,e.y)},e.prototype._elementPadding=function(){if(!this._padding){var t=pr(this.element,["paddingLeft","paddingTop"]),e=t.paddingLeft,i=t.paddingTop;this._padding={top:i,left:e}}return this._padding},e.prototype._toDocumentCoordinates=function(t){var e=this._elementPadding(),i=qr(this.element);return{left:tn(t.x+e.left+i.left),top:tn(t.y+e.top+i.top)}},e.prototype._toModelCoordinates=function(t,e){var i=this.element,o=qr(i),r=this._elementPadding(),n=un(i).invert(),s=new p.Point(t-o.left-r.left,e-o.top-r.top).transform(n);return new An(s.x,s.y)},e.prototype._tap=function(t){var e=this,i=this.surface.eventTarget(t),o=this._drawingChartElement(i,t),r=this._sharedTooltip();this._startHover(i,t)||r||this._unsetActivePoint(),r&&this._trackSharedTooltip(this._eventCoordinates(t),t,!0),this._propagateClick(o,t),this.handlingTap=!0,setTimeout((function(){e.handlingTap=!1}),0)},e.prototype._click=function(t){var e=this._getChartElement(t);this._propagateClick(e,t)},e.prototype._propagateClick=function(t,e){for(var i=t;i;)i.click&&i.click(this,e),i=i.parent},e.prototype._startHover=function(t,e){if(this._suppressHover)return!1;var i=this._drawingChartElement(t,e,(function(t){return(t.hover||t.over)&&!(t instanceof xh)})),o=this._activePoint,r=this._plotArea.series.length>1,n=this._hasInactiveOpacity();return this._updateHoveredPoint(i,e),i&&o!==i&&i.hover?(this._activePoint=i,this._sharedTooltip()||i.hover(this,e)||(this._displayTooltip(i),n?this._displayInactiveOpacity(i,r):this._highlight.show(i))):!i&&n&&(r&&this._activeChartInstance&&(this._updateSeriesOpacity(i,!0),this._applySeriesOpacity(this._activeChartInstance.children,null,!0),this._activeChartInstance=null),this._highlight&&this._highlight.hide(),this._activePoint=null),i},e.prototype._displayTooltip=function(t){or({},this.options.tooltip,t.options.tooltip).visible&&this._tooltip.show(t)},e.prototype._displayInactiveOpacity=function(t,e,i){var o=this._activeChartInstance=this._chartInstanceFromPoint(t);if(o)if(e)this._updateSeriesOpacity(t),this._applySeriesOpacity(o.children,null,!0),this._applySeriesOpacity(o.children,t.series),this._highlight.show(i||t);else{var r;if(!o.supportsPointInactiveOpacity())return void this._highlight.show(t);(r=this._getInactivePoints(t,o))&&r.length&&this._highlight.show(r,1-this._getInactiveOpacityForSeries(t.series))}},e.prototype._getInactivePoints=function(t,e){return this._getAllPointsOfType(e,t.constructor).filter((function(e){return e!==t}))},e.prototype._getAllPointsOfType=function(t,e){for(var i=[],o=0;o<t.children.length;o++){var r=t.children[o];r.constructor===e?i.push(r):r.children&&r.children.length&&(i=i.concat(this._getAllPointsOfType(r,e)))}return i},e.prototype._updateHoveredPoint=function(t,e){var i=this._hoveredPoint;i&&i!==t&&(i.out(this,e),this._hoveredPoint=null),t&&i!==t&&t.over&&(this._hoveredPoint=t,t.over(this,e))},e.prototype._updateSeriesOpacity=function(t,e){for(var i=this._plotArea,o=i.series.length,r=0;r<o;r++){var n=i.series[r],s=this._getDefaultOpacityForSeries(n),a=this._getInactiveOpacityForSeries(n);e||n===t.series?(n.opacity=s,n.line&&(n.line.opacity=s)):(n.defaultOpacity=s,n.opacity=a,n.line&&(n.line.opacity=a))}},e.prototype._applySeriesOpacity=function(t,e,i,o){for(var r=0;r<t.length;r++){var n=t[r],s=n.series||o;if(s&&n.visual){var a=o?o.opacity:n.series.opacity;(s!==e||i)&&n.visual.opacity(i?1:a)}n.children&&n.children.length&&this._applySeriesOpacity(n.children,e,i,n.series)}},e.prototype._chartInstanceFromPoint=function(t){for(var e=t.parent;e&&!e.plotArea;)e=e.parent;return e},e.prototype._hasInactiveOpacity=function(){var t=void 0!==this.options.seriesDefaults.highlight.inactiveOpacity,e=this.options.series.filter((function(t){return void 0!==t.highlight.inactiveOpacity})).length>0;return t||e},e.prototype._getInactiveOpacityForSeries=function(t){var e=this.options.seriesDefaults.highlight.inactiveOpacity;return t.highlight.inactiveOpacity||e||t.opacity||1},e.prototype._getDefaultOpacityForSeries=function(t){return t.defaultOpacity||t.opacity||1},e.prototype._mouseover=function(t){var e,i=this._startHover(t.element,t.originalEvent);i&&i.tooltipTracking&&!this._mouseMoveTrackHandler&&!this._sharedTooltip()&&(this._mouseMoveTrackHandler=this._mouseMoveTracking.bind(this),Gr(document,((e={}).mousemove=this._mouseMoveTrackHandler,e)))},e.prototype._mouseMoveTracking=function(t){var e,i=this.options,o=this._tooltip,r=this._highlight,n=this._activePoint,s=this._eventCoordinates(t);if(this._plotArea.box.containsPoint(s)){if(n&&n.tooltipTracking&&n.series&&n.parent.getNearestPoint){var a=n.parent.getNearestPoint(s.x,s.y,n.seriesIx);if(a&&a!==n)if(this._activePoint=a,!a.hover(this,t))or({},i.tooltip,a.options.tooltip).visible&&o.show(a),r.show(a)}}else en(document,((e={}).mousemove=this._mouseMoveTrackHandler,e)),this._unsetActivePoint(),this._mouseMoveTrackHandler=null},e.prototype._mousemove=function(t){var e=this._eventCoordinates(t),i=this._plotArea;if(this._trackCrosshairs(e),i.hover){var o=i.backgroundContainsPoint(e);o?(i.hovered=!0,this._plotArea.hover(this,t)):i.hovered&&!o&&(this.trigger("plotAreaLeave"),i.hovered=!1)}this._sharedTooltip()&&this._trackSharedTooltip(e,t)},e.prototype._trackCrosshairs=function(t){for(var e=this._plotArea.crosshairs,i=0;i<e.length;i++){var o=e[i];o.box.containsPoint(t)?o.showAt(t):o.hide()}},e.prototype._trackSharedTooltip=function(t,e,i){if(!this._suppressHover){var o=this.options.tooltip,r=this._plotArea,n=this._plotArea.categoryAxis,s=this._tooltip,a=this._highlight;if(r.backgroundContainsPoint(t)){var p=n.pointCategoryIndex(t);if(p!==this._tooltipCategoryIx||!this._sharedHighlight&&i){var h=r.pointsByCategoryIndex(p),c=h.map((function(t){return t.eventArgs(e)})),l=c[0]||{};l.categoryPoints=c,h.length>0&&!this.trigger("seriesHover",l)?(o.visible&&s.showAt(h,t),a.show(h),this._sharedHighlight=!0):s.hide(),this._tooltipCategoryIx=p}else i&&this._sharedHighlight&&(a.hide(),s.hide(),this._sharedHighlight=!1)}else this._sharedHighlight&&(a.hide(),s.hide(),this._tooltipCategoryIx=null,this._sharedHighlight=!1)}},e.prototype.hideElements=function(t){var e=this._plotArea;this._mousemove.cancel(),e.hideCrosshairs(),this._unsetActivePoint(t)},e.prototype._unsetActivePoint=function(t){var e=this._tooltip,i=this._highlight;this._activePoint=null,this._hoveredPoint=null,!e||t&&t.keepTooltipOpen||e.hide(),this._tooltipCategoryIx=null,this._sharedHighlight=!1,i&&i.hide()},e.prototype._deferRedraw=function(){this._redraw()},e.prototype._clearRedrawTimeout=function(){this._redrawTimeout&&(clearInterval(this._redrawTimeout),this._redrawTimeout=null)},e.prototype.bindCategories=function(){for(var t=this.options,e=[].concat(t.categoryAxis),i=0;i<e.length;i++){var o=e[i];!1!==o.autoBind&&this.bindCategoryAxisFromSeries(o,i)}},e.prototype.bindCategoryAxisFromSeries=function(t,e){for(var i,o=this.options.series,r=o.length,n=new Ir,s=[],a=!1,p=0;p<r;p++){var h=o[p],c=h.categoryAxis===t.name||!h.categoryAxis&&0===e,l=h.data,u=l.length,f=h.categoryField&&c;if(a=f||a,f&&u>0)for(var d=(i=ph(t,va(h.categoryField,l[0])))?ah:va,y=0;y<u;y++){var v=l[y],g=d(h.categoryField,v,this.chartService.intl);!i&&n.get(g)||(s.push([g,v]),i||n.set(g,!0))}}if(s.length>0){i&&(s=function(t,e){void 0===e&&(e=ys);for(var i=function(t,e){void 0===e&&(e=ys);for(var i=1,o=t.length;i<o;i++)if(e(t[i],t[i-1])<0){t.sort(e);break}return t}(t,e),o=i.length,r=o>0?[i[0]]:[],n=1;n<o;n++)0!==e(i[n],Kr(r))&&r.push(i[n]);return r}(s,(function(t,e){return ys(t[0],e[0])})));var m=function(t){for(var e=t.length,i=[],o=0;o<e;o++)for(var r=t[o],n=r.length,s=0;s<n;s++)i[s]=i[s]||[],i[s].push(r[s]);return i}(s);t.categories=m[0]}else a&&(t.categories=[])},e.prototype._isBindable=function(t){for(var e=ma.current.valueFields(t),i=!0,o=0;o<e.length;o++){var r=e[o];if(r===w?r="field":r+="Field",!Nr(t[r])){i=!1;break}}return i},e.prototype._noTransitionsRedraw=function(){var t,e=this.options;!1!==e.transitions&&(e.transitions=!1,t=!0),this._redraw(),t&&(e.transitions=!0)},e.prototype._legendItemHover=function(t,e){var i,o=this._plotArea,r=this._highlight,n=(o.srcSeries||o.series)[t];if(i=Lr(n.type,[Ta,"donut","funnel"])?o.findPoint((function(i){return i.series.index===t&&i.index===e})):o.pointsBySeriesIndex(t),this._hasInactiveOpacity()&&n.visible&&i){var s=o.series.length>1,a=i.length?i[0]:i;this._displayInactiveOpacity(a,s,i)}else r.show(i)},e.prototype._shouldAttachMouseMove=function(){return this._plotArea.crosshairs.length||this._tooltip&&this._sharedTooltip()||this.requiresHandlers(["plotAreaHover","plotAreaLeave"])},e.prototype.updateMouseMoveHandler=function(){var t,e;en(this.element,((t={}).mousemove=this._mousemove,t)),this._shouldAttachMouseMove()&&Gr(this.element,((e={}).mousemove=this._mousemove,e))},e.prototype.applyOptions=function(t,e){Ll(this._originalOptions,t),this._originalOptions=or(this._originalOptions,t),this.options=or({},this._originalOptions),e&&(this._theme=e,this.chartService.theme=e),this._initTheme(this.options,this._theme),this._toggleDragZoomEvents()},e.prototype.setOptions=function(t,e){this.applyOptions(t,e),this.bindCategories(),this.redraw(),this.updateMouseMoveHandler()},e.prototype.setDirection=function(t){this.chartService.rtl=Boolean(t),this.surface&&"svg"===this.surface.type&&this._destroySurface()},e.prototype.setIntlService=function(t){this.chartService.intl=t},e.prototype.noTransitionsRedraw=function(){this._noTransitionsRedraw()},e.prototype.destroy=function(){var t,e;this._destroyed=!0,en(this.element,((t={}).contextmenu=this._clickHandler,t[Ra]=this._mousewheelHandler,t.mousemove=this._mousemove,t.mouseleave=this._mouseleaveHandler,t)),this.domEvents&&(this.domEvents.destroy(),delete this.domEvents),this._mouseMoveTrackHandler&&en(document,((e={}).mousemove=this._mouseMoveTrackHandler,e)),this._destroyView(),this._destroySurface(),this._clearRedrawTimeout()},e.prototype._destroySurface=function(){var t=this.surface;t&&(t.unbind("mouseenter",this._surfaceMouseenterHandler),t.unbind("mouseleave",this._surfaceMouseleaveHandler),t.destroy(),this.surface=null)},e.prototype._destroySelections=function(){var t=this._selections;if(t)for(;t.length>0;)t.shift().destroy()},e.prototype._destroyView=function(){var t=this._model;t&&(t.destroy(),this._model=null),this._unsetActivePoint(),this._destroySelections(),this._tooltip&&this._tooltip.destroy(),this._highlight&&this._highlight.destroy(),this._zoomSelection&&(this._zoomSelection.destroy(),delete this._zoomSelection),this._pannable&&(this._pannable.destroy(),delete this._pannable),this._mousewheelZoom&&(this._mousewheelZoom.destroy(),delete this._mousewheelZoom)},e}(O);function Rl(t,e){if(t)for(var i=0;i<t.length;i++)if(t[i].category===e)return[t[i]]}function Bl(t){delete t.bar,delete t.column,delete t.rangeColumn,delete t.line,delete t.verticalLine,delete t.pie,delete t.donut,delete t.area,delete t.verticalArea,delete t.scatter,delete t.scatterLine,delete t.bubble,delete t.candlestick,delete t.ohlc,delete t.boxPlot,delete t.bullet,delete t.verticalBullet,delete t.polarArea,delete t.polarLine,delete t.radarArea,delete t.radarLine,delete t.waterfall}function jl(t){for(var e={},i=0;i<t.length;i++){var o=t[i],r=o.options.name;r&&(e[r]=o.range())}return e}var Il=["data","categories"];function Ll(t,e){for(var i in e)if(!Lr(i,Il)&&e.hasOwnProperty(i)){var o=e[i],r=t[i];if(Nr(r)){var n=null===o;n||!Nr(o)?(delete t[i],n&&delete e[i]):r&&rr(o)&&rr(r)&&Ll(r,o)}}}function zl(t){for(var e=0;e<t.length;e++)t[e].notifyRender()}sn(Ol,{renderAs:"",chartArea:{},legend:{visible:!0,labels:{}},categoryAxis:{},seriesDefaults:{type:Ca,data:[],highlight:{visible:!0},labels:{},negativeValues:{visible:!1}},series:[],seriesColors:null,tooltip:{visible:!1},transitions:!0,valueAxis:{},plotArea:{},title:{},xAxis:{},yAxis:{},panes:[{}],pannable:!1,zoomable:!1});var El=Ol,Vl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._slotAnchor=function(t,e){var i=this.plotArea.categoryAxis.options.vertical,o=i?{horizontal:"left",vertical:"center"}:{horizontal:"center",vertical:"bottom"};return{point:i?new An(this.plotArea.box.x2,e.center().y):new An(e.center().x,-2),align:o}},e.prototype._defaultAnchor=function(t,e){return this._slotAnchor({},e)},e}(vc),Fl=[ka,"bullet"];function Dl(t){for(var e=[],i=0;i<t.length;i++){var o=t[i];e[i]=o.style.display,o.style.display="none"}return e}function Ul(t,e){for(var i=0;i<t.length;i++)t[i].style.display=e[i]}function Hl(t){return $o(t)?[t]:t}var Gl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._setElementClass=function(t){P(t,"k-sparkline")},e.prototype._initElement=function(e){t.prototype._initElement.call(this,e),this._initialWidth=Math.floor(Xr(e).width)},e.prototype._resize=function(){var e=this.element,i=Dl(e.childNodes);this._initialWidth=Math.floor(Xr(e).width),Ul(e.childNodes,i),t.prototype._resize.call(this)},e.prototype._modelOptions=function(){var t=this.options,e=this._surfaceWrap(),i=Dl(e.childNodes),o=document.createElement("span");o.innerHTML=" ",e.appendChild(o);var r=or({width:this._autoWidth,height:Xr(e).height,transitions:t.transitions},t.chartArea,{inline:!0,align:!1});return Xr(e,{width:r.width,height:r.height}),e.removeChild(o),Ul(e.childNodes,i),this.surface&&this.surface.resize(),r},e.prototype._surfaceWrap=function(){if(!this.stage){var t=this.stage=document.createElement("span");this.element.appendChild(t)}return this.stage},e.prototype._createPlotArea=function(e){var i=t.prototype._createPlotArea.call(this,e);return this._autoWidth=this._initialWidth||this._calculateWidth(i),i},e.prototype._calculateWidth=function(t){for(var e=this.options,i=hr(e.chartArea.margin),o=t.charts,r=this._surfaceWrap(),n=0,s=0;s<o.length;s++){var a=o[s],p=(a.options.series||[])[0];if(p){if(p.type===ka)return 150;if("bullet"===p.type)return 150;if(p.type===Ta)return Xr(r).height;var h=a.categoryAxis;if(h){var c=h.categoriesCount()*(!a.options.isStacked&&Lr(p.type,[Ca,"verticalBullet"])?a.seriesOptions.length:1);n=Math.max(n,c)}}}var l=n*e.pointWidth;return l>0&&(l+=i.left+i.right),l},e.prototype._createSharedTooltip=function(t){return new Vl(this._plotArea,t)},e.normalizeOptions=function(t){var e=Hl(t);return(e=C(e)?{seriesDefaults:{data:e}}:or({},e)).series||(e.series=[{data:Hl(e.data)}]),or(e,{seriesDefaults:{type:e.type}}),(Lr(e.series[0].type,Fl)||Lr(e.seriesDefaults.type,Fl))&&(e=or({},{categoryAxis:{crosshair:{visible:!1}}},e)),e},e}(El);sn(Gl,{chartArea:{margin:2},axisDefaults:{visible:!1,majorGridLines:{visible:!1},valueAxis:{narrowRange:!0}},seriesDefaults:{type:"line",area:{line:{width:.5}},bar:{stack:!0},padding:2,width:.5,overlay:{gradient:null},highlight:{visible:!1},border:{width:0},markers:{size:2,visible:!1}},tooltip:{visible:!0,shared:!0},categoryAxis:{crosshair:{visible:!0,tooltip:{visible:!1}}},legend:{visible:!1},transitions:!1,pointWidth:5,panes:[{clip:!1}]});var Nl=Gl,Wl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){this._initialOpacity=parseFloat(pr(this.element,"opacity").opacity)},e.prototype.step=function(t){pr(this.element,{opacity:String(zr(this._initialOpacity,0,t))})},e.prototype.abort=function(){t.prototype.abort.call(this),pr(this.element,{display:"none",opacity:String(this._initialOpacity)})},e.prototype.cancel=function(){t.prototype.abort.call(this),pr(this.element,{opacity:String(this._initialOpacity)})},e}(a.Animation);function ql(t,e){var i=document.createElement("div");return i.className=t,e&&(i.style.cssText=e),i}var Xl=function(t){function e(e,i,o){t.call(this),this.options=or({},this.options,o),this.container=e,this.chartService=i;var r=pr(e,["paddingLeft","paddingTop"]);this.chartPadding={top:r.paddingTop,left:r.paddingLeft},this.createElements(),e.appendChild(this.element)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createElements=function(){var t=this.element=ql("k-navigator-hint","display: none; position: absolute; top: 1px; left: 1px;"),e=this.tooltip=ql("k-tooltip k-chart-tooltip"),i=this.scroll=ql("k-scroll");e.innerHTML=" ",t.appendChild(e),t.appendChild(i)},e.prototype.show=function(t,e,i){var o=this.element,r=this.options,n=this.scroll,s=this.tooltip,a=cs(gs(t)+gs(e-t)/2),p=.4*i.width(),h=i.center().x-p,c=(i.center().x-h)/(r.max-r.min),l=a-r.min,u=this.chartService.intl.format(r.format,t,e),f=Pr(r);this.clearHideTimeout(),this._visible||(pr(o,{visibility:"hidden",display:"block"}),this._visible=!0),f&&(u=f({from:t,to:e})),s.innerHTML=u,pr(s,{left:i.center().x-s.offsetWidth/2,top:i.y1});var d=pr(s,["marginTop","borderTopWidth","height"]);pr(n,{width:p,left:h+l*c,top:i.y1+d.marginTop+d.borderTopWidth+d.height/2}),pr(o,{visibility:"visible"})},e.prototype.clearHideTimeout=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this._hideAnimation&&this._hideAnimation.cancel()},e.prototype.hide=function(){var t=this;this.clearHideTimeout(),this._hideTimeout=setTimeout((function(){t._visible=!1,t._hideAnimation=new Wl(t.element),t._hideAnimation.setup(),t._hideAnimation.play()}),this.options.hideDelay)},e.prototype.destroy=function(){this.clearHideTimeout(),this.container&&this.container.removeChild(this.element),delete this.container,delete this.chartService,delete this.element,delete this.tooltip,delete this.scroll},e}(O);sn(Xl,{format:"{0:d} - {1:d}",hideDelay:500});var Yl=Xl,Zl="_navigator",Kl=Zl;function Jl(){}var $l=function(t){function e(e){var i;t.call(this),this.chart=e;var o=this.options=or({},this.options,e.options.navigator),r=o.select;r&&(r.from=this.parseDate(r.from),r.to=this.parseDate(r.to)),Nr(o.hint.visible)||(o.hint.visible=o.visible),this.chartObserver=new Vr(this,((i={}).drag="_drag",i.dragEnd="_dragEnd",i.zoom="_zoom",i.zoomEnd="_zoomEnd",i)),e.addObserver(this.chartObserver)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.parseDate=function(t){return ws(this.chart.chartService.intl,t)},e.prototype.clean=function(){this.selection&&(this.selection.destroy(),this.selection=null),this.hint&&(this.hint.destroy(),this.hint=null)},e.prototype.destroy=function(){this.chart&&(this.chart.removeObserver(this.chartObserver),delete this.chart),this.clean()},e.prototype.redraw=function(){this._redrawSelf(),this.initSelection()},e.prototype.initSelection=function(){var t,e=this.chart,i=this.options,o=this.mainAxis(),r=o.roundedRange(),n=r.min,s=r.max,a=i.select,p=a.from,h=a.to,c=a.mousewheel,l=(t=o,Jl.prototype=t,new Jl);0!==o.categoriesCount()&&(this.clean(),l.box=o.box,this.selection=new fc(e,l,{min:n,max:s,from:p||n,to:h||s,mousewheel:on(c,{zoom:"left"}),visible:i.visible},new Vr(this,{selectStart:"_selectStart",select:"_select",selectEnd:"_selectEnd"})),i.hint.visible&&(this.hint=new Yl(e.element,e.chartService,{min:n,max:s,template:Pr(i.hint),format:i.hint.format})))},e.prototype.setRange=function(){var t=this.chart._createPlotArea(!0).namedCategoryAxes[Kl].roundedRange(),e=t.min,i=t.max,o=this.options.select||{},r=o.from||e;r<e&&(r=e);var n=o.to||i;n>i&&(n=i),this.options.select=or({},o,{from:r,to:n}),this.filterAxes()},e.prototype._redrawSelf=function(t){var e=this.chart._plotArea;e&&e.redraw(Kr(e.panes),t)},e.prototype.redrawSlaves=function(){var t=this.chart,e=t._plotArea,i=e.panes.slice(0,-1);e.srcSeries=t.options.series,e.options.categoryAxis=t.options.categoryAxis,e.clearSeriesPointsCache(),e.redraw(i)},e.prototype._drag=function(t){var e,i=this.chart,o=this.selection,r=i._eventCoordinates(t.originalEvent),n=this.mainAxis(),s=n.roundedRange(),a=n.pane.box.containsPoint(r),p=i._plotArea.categoryAxis,h=t.axisRanges[p.options.name],c=this.options.select;if(h&&!a&&o){e=c.from&&c.to?gs(c.to)-gs(c.from):gs(o.options.to)-gs(o.options.from);var l=cs(Jr(gs(h.min),s.min,gs(s.max)-e)),u=cs(Jr(gs(l)+e,gs(s.min)+e,s.max));this.options.select={from:l,to:u},this.options.liveDrag&&(this.filterAxes(),this.redrawSlaves()),o.set(l,u),this.showHint(l,u)}},e.prototype._dragEnd=function(){this.filterAxes(),this.filter(),this.redrawSlaves(),this.hint&&this.hint.hide()},e.prototype.readSelection=function(){var t=this.selection.options,e=t.from,i=t.to,o=this.options.select;o.from=e,o.to=i},e.prototype.filterAxes=function(){var t=this.options.select;void 0===t&&(t={});for(var e=this.chart.options.categoryAxis,i=t.from,o=t.to,r=0;r<e.length;r++){var n=e[r];n.pane!==Zl&&(n.min=i,n.max=o)}},e.prototype.filter=function(){var t=this.chart,e=this.options.select;if(t.requiresHandlers(["navigatorFilter"])){var i=this.mainAxis(),o={from:e.from,to:e.to};if("category"!==i.options.type){var r=new Ls(or({baseUnit:"fit"},t.options.categoryAxis[0],{categories:[e.from,e.to]}),t.chartService).options;o.from=us(r.min,-r.baseUnitStep,r.baseUnit),o.to=us(r.max,r.baseUnitStep,r.baseUnit)}this.chart.trigger("navigatorFilter",o)}},e.prototype._zoom=function(t){var e=this.chart._plotArea.categoryAxis,i=this.selection,o=this.options,r=o.select,n=o.liveDrag,s=this.mainAxis(),a=t.delta;if(i){var p=s.categoryIndex(i.options.from),h=s.categoryIndex(i.options.to);t.originalEvent.preventDefault(),Math.abs(a)>1&&(a*=3),h-p>1?(i.expand(a),this.readSelection()):(e.options.min=r.from,r.from=e.scaleRange(-t.delta).min),n&&(this.filterAxes(),this.redrawSlaves()),i.set(r.from,r.to),this.showHint(this.options.select.from,this.options.select.to)}},e.prototype._zoomEnd=function(t){this._dragEnd(t)},e.prototype.showHint=function(t,e){var i=this.chart._plotArea;this.hint&&this.hint.show(t,e,i.backgroundBox())},e.prototype._selectStart=function(t){return this.chart._selectStart(t)},e.prototype._select=function(t){return this.showHint(t.from,t.to),this.chart._select(t)},e.prototype._selectEnd=function(t){return this.hint&&this.hint.hide(),this.readSelection(),this.filterAxes(),this.filter(),this.redrawSlaves(),this.chart._selectEnd(t)},e.prototype.mainAxis=function(){var t=this.chart._plotArea;if(t)return t.namedCategoryAxes[Kl]},e.prototype.select=function(t,e){var i=this.options.select;return t&&e&&(i.from=this.parseDate(t),i.to=this.parseDate(e),this.filterAxes(),this.filter(),this.redrawSlaves(),this.selection.set(t,e)),{from:i.from,to:i.to}},e.setup=function(t,i){if(void 0===t&&(t={}),void 0===i&&(i={}),!t.__navi){t.__navi=!0;var o=or({},i.navigator,t.navigator),r=t.panes=[].concat(t.panes),n=or({},o.pane,{name:Zl});o.visible||(n.visible=!1,n.height=.1),r.push(n),e.attachAxes(t,o),e.attachSeries(t,o,i)}},e.attachAxes=function(t,e){var i=e.series||[],o=t.categoryAxis=[].concat(t.categoryAxis),r=t.valueAxis=[].concat(t.valueAxis),n=0===sh(i,Oa).length,s=or({type:"date",pane:Zl,roundToBaseUnit:!n,justified:n,_collapse:!1,majorTicks:{visible:!0},tooltip:{visible:!1},labels:{step:1},autoBind:e.autoBindElements,autoBaseUnitSteps:{minutes:[1],hours:[1,2],days:[1,2],weeks:[],months:[1],years:[1]}}),a=e.categoryAxis;o.push(or({},s,{maxDateGroups:200},a,{name:Kl,title:null,baseUnit:"fit",baseUnitStep:"auto",labels:{visible:!1},majorTicks:{visible:!1}}),or({},s,a,{name:Kl+"_labels",maxDateGroups:20,baseUnitStep:"auto",labels:{position:""},plotBands:[],autoBaseUnitSteps:{minutes:[]},_overlap:!0}),or({},s,a,{name:Kl+"_ticks",maxDateGroups:200,majorTicks:{width:.5},plotBands:[],title:null,labels:{visible:!1,mirror:!0},_overlap:!0})),r.push(or({name:Kl,pane:Zl,majorGridLines:{visible:!1},visible:!1},e.valueAxis))},e.attachSeries=function(t,e,i){for(var o=t.series=t.series||[],r=[].concat(e.series||[]),n=i.seriesColors,s=e.seriesDefaults,a=0;a<r.length;a++)o.push(or({color:n[a%n.length],categoryField:e.dateField,visibleInLegend:!1,tooltip:{visible:!1}},s,r[a],{axis:Kl,categoryAxis:Kl,autoBind:e.autoBindElements}))},e}(O),Ql=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.applyDefaults=function(e,i){var o=Xr(this.element).width||600,r=i,n={seriesDefaults:{categoryField:e.dateField},axisDefaults:{categoryAxis:{name:"default",majorGridLines:{visible:!1},labels:{step:2},majorTicks:{visible:!1},maxDateGroups:Math.floor(o/28)}}};r&&(r=or({},r,n)),$l.setup(e,r),t.prototype.applyDefaults.call(this,e,r)},e.prototype._setElementClass=function(t){P(t,"k-chart k-stockchart")},e.prototype.setOptions=function(e){this.destroyNavigator(),t.prototype.setOptions.call(this,e)},e.prototype.noTransitionsRedraw=function(){var t=this.options.transitions;this.options.transitions=!1,this._fullRedraw(),this.options.transitions=t},e.prototype._resize=function(){this.noTransitionsRedraw()},e.prototype._redraw=function(){var t=this.navigator;!this._dirty()&&t&&t.options.partialRedraw?t.redrawSlaves():this._fullRedraw()},e.prototype._dirty=function(){var t=this.options,e=Rr([].concat(t.series,t.navigator.series),(function(t){return t&&t.visible})).length,i=this._seriesCount!==e;return this._seriesCount=e,i},e.prototype._fullRedraw=function(){var e=this.navigator;e||(e=this.navigator=new $l(this),this.trigger("navigatorCreated",{navigator:e})),e.clean(),e.setRange(),t.prototype._redraw.call(this),e.initSelection()},e.prototype._trackSharedTooltip=function(e){var i=this._plotArea.paneByPoint(e);i&&i.options.name===Zl?this._unsetActivePoint():t.prototype._trackSharedTooltip.call(this,e)},e.prototype.bindCategories=function(){t.prototype.bindCategories.call(this),this.copyNavigatorCategories()},e.prototype.copyNavigatorCategories=function(){for(var t,e=[].concat(this.options.categoryAxis),i=0;i<e.length;i++){var o=e[i];o.name===Kl?t=o.categories:t&&o.pane===Zl&&(o.categories=t)}},e.prototype.destroyNavigator=function(){this.navigator&&(this.navigator.destroy(),this.navigator=null)},e.prototype.destroy=function(){this.destroyNavigator(),t.prototype.destroy.call(this)},e.prototype._stopChartHandlers=function(e){var i=this._eventCoordinates(e),o=this._plotArea.paneByPoint(i);return t.prototype._stopChartHandlers.call(this,e)||o&&o.options.name===Zl},e.prototype._toggleDragZoomEvents=function(){this._dragZoomEnabled||(this.element.style.touchAction="none",this._dragZoomEnabled=!0)},e}(El);sn(Ql,{dateField:"date",axisDefaults:{categoryAxis:{type:"date",baseUnit:"fit",justified:!0},valueAxis:{narrowRange:!0,labels:{format:"C"}}},navigator:{select:{},seriesDefaults:{markers:{visible:!1},tooltip:{visible:!0},line:{width:2}},hint:{},visible:!0},tooltip:{visible:!0},legend:{visible:!1}});var tu=Ql,eu=Math.PI/180;function iu(t,e){var i=t.getOrigin(),o=t.getSize(),r=hr(e);return t.setOrigin([i.x-r.left,i.y-r.top]),t.setSize([o.width+(r.left+r.right),o.height+(r.top+r.bottom)]),t}var ou=a.Group,ru=a.Path,nu=a.Text;function su(t,e){var i=t.box,o=t.children[0].box,r=e.border||{},n=e.background||"",s=ru.fromRect(new p.Rect([i.x1,i.y1],[i.width(),i.height()]),{stroke:{}}),a=new nu(t.text,new p.Point(o.x1,o.y1),{font:e.font,fill:{color:e.color}}),h=iu(a.bbox().clone(),e.padding),c=ru.fromRect(h,{stroke:{color:r.width?r.color:"",width:r.width,opacity:r.opacity,dashType:r.dashType,lineJoin:"round",lineCap:"round"},fill:{color:n}}),l=new ou;return l.append(s),l.append(c),l.append(a),l}function au(t,e,i){var o=Nr(t.from)?t.from:x,r=Nr(t.to)?t.to:m;return t.from=Math.max(Math.min(r,o),e),t.to=Math.min(Math.max(r,o),i),t}function pu(t,e){var i=hr(e);return i.left=-i.left,i.top=-i.top,i.right=-i.right,i.bottom=-i.bottom,iu(t,i)}var hu=a.Path,cu=a.Surface,lu=function(t){function e(e,i,o,r){void 0===r&&(r={}),t.call(this),this.element=e,this.theme=o,this.contextService=new _r(this,r),this._originalOptions=or({},this.options,i),this.options=or({},this._originalOptions),this._initTheme(o),this.redraw()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){this.surface&&(this.surface.destroy(),this.surface=null),delete this.element,delete this.surfaceElement},e.prototype.value=function(t){var e=this.pointers[0];if(0===arguments.length)return e.value();e.value(t),this._setValueOptions(t)},e.prototype._draw=function(){var t=this.surface;t.clear(),t.draw(this._visuals)},e.prototype.exportVisual=function(){return this._visuals},e.prototype.allValues=function(t){var e=this.pointers,i=[];if(0===arguments.length){for(var o=0;o<e.length;o++)i.push(e[o].value());return i}if(C(t))for(var r=0;r<t.length;r++)$o(t[r])&&e[r].value(t[r]);this._setValueOptions(t)},e.prototype._setValueOptions=function(t){for(var e=[].concat(this.options.pointer),i=[].concat(t),o=0;o<i.length;o++)e[o].value=i[o]},e.prototype.resize=function(){this.noTransitionsRedraw()},e.prototype.noTransitionsRedraw=function(){var t=this.options.transitions;this._toggleTransitions(!1),this.redraw(),this._toggleTransitions(t)},e.prototype.redraw=function(){var t=this._surfaceSize(),e=new p.Rect([0,0],[t.width,t.height]);this._initSurface(),this.gaugeArea=this._createGaugeArea(),this._createModel();var i=pu(e.bbox(),this._gaugeAreaMargin);this.reflow(i)},e.prototype.setOptions=function(t,e){this._originalOptions=or(this._originalOptions,t),this.options=or({},this._originalOptions),this._initTheme(e),this.redraw()},e.prototype.setDirection=function(t){this.contextService.rtl=Boolean(t),this.surface&&"svg"===this.surface.type&&(this.surface.destroy(),this.surface=null)},e.prototype.setIntlService=function(t){this.contextService.intl=t},e.prototype._initTheme=function(t){var e=t||this.theme||{};this.theme=e,this.options=or({},e,this.options);var i=this.options,o=i.pointer;if(C(o)){for(var r=[],n=0;n<o.length;n++)r.push(or({},e.pointer,o[n]));i.pointer=r}},e.prototype._createGaugeArea=function(){var t=this.options.gaugeArea,e=this.surface.size(),i=t.border||{},o=new p.Rect([0,0],[e.width,e.height]);return this._gaugeAreaMargin=t.margin||5,i.width>0&&(o=pu(o,i.width)),hu.fromRect(o,{stroke:{color:i.width?i.color:"",width:i.width,dashType:i.dashType,lineJoin:"round",lineCap:"round"},fill:{color:t.background}})},e.prototype._initSurface=function(){var t=this.options,e=this.surface,i=this._surfaceElement(),o=this._surfaceSize();Xr(i,o),e&&e.options.type===t.renderAs?(this.surface.clear(),this.surface.resize()):(e&&e.destroy(),this.surface=cu.create(i,{type:t.renderAs}))},e.prototype._surfaceSize=function(){var t=this.options,e=this._getSize();return t.gaugeArea&&or(e,t.gaugeArea),e},e.prototype._surfaceElement=function(){return this.surfaceElement||(this.surfaceElement=document.createElement("div"),this.element.appendChild(this.surfaceElement)),this.surfaceElement},e.prototype.getSize=function(){return this._getSize()},e.prototype._getSize=function(){var t=this.element,e=this._defaultSize(),i=t.offsetWidth,o=t.offsetHeight;return i||(i=e.width),o||(o=e.height),{width:i,height:o}},e.prototype._defaultSize=function(){return{width:200,height:200}},e.prototype._toggleTransitions=function(t){this.options.transitions=t;for(var e=0;e<this.pointers.length;e++)this.pointers[e].options.animation.transitions=t},e}(O);sn(lu,{plotArea:{},theme:"default",renderAs:"",pointer:{},scale:{},gaugeArea:{}});var uu=lu,fu=a.Path,du=a.Group,yu=p.Point;function vu(t,e){var i,o,r=t.position,n=t.tickX,s=t.tickY;return t.vertical?(i=new yu(n,r),o=new yu(n+e.size,r)):(i=new yu(r,s),o=new yu(r,s+e.size)),new fu({stroke:{color:e.color,width:e.width}}).moveTo(i).lineTo(o)}function gu(t,e,i,o){var r=e.length;if(o.visible)for(var n=i.mirror,s=i.lineBox,a=o.skip;a<r;a+=o.step)a%o.skipUnit!=0&&(i.tickX=n?s.x2:s.x2-o.size,i.tickY=n?s.y1-o.size:s.y1,i.position=e[a],t.append(vu(i,o)))}var mu=function(t){function e(e,i){var o=e||{};!Nr(o.reverse)&&!1===o.vertical&&(i||{}).rtl&&(o=Object.assign({},o,{reverse:!0})),t.call(this,0,1,o,i),this.options.minorUnit=this.options.minorUnit||this.options.majorUnit/10}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initUserOptions=function(t){var e=or({},this.options,t);return(e=or({},e,{labels:{mirror:e.mirror}})).majorUnit=e.majorUnit||wn(e.min,e.max),e},e.prototype.initFields=function(){},e.prototype.render=function(){var t=this.elements=new du,e=this.renderLabels(),i=this.renderLine(),o=this.renderTicks(),r=this.renderRanges();return t.append(i,e,o,r),t},e.prototype.renderRanges=function(){for(var t=this.options,e=t.min,i=t.max,o=t.vertical,r=t.labels.mirror,n=t.ranges||[],s=new du,a=n.length,h=t.rangeSize||t.minorTicks.size/2,c=0;c<a;c++){var l=au(n[c],e,i),u=this.getSlot(l.from,l.to),f=o?this.lineBox():u,d=o?u:this.lineBox();o?f.x1-=h*(r?-1:1):d.y2+=h*(r?-1:1),s.append(fu.fromRect(new p.Rect([f.x1,d.y1],[f.x2-f.x1,d.y2-d.y1]),{fill:{color:l.color,opacity:l.opacity},stroke:{}}))}return s},e.prototype.renderLabels=function(){for(var t=this.labels,e=this.options,i=new du,o=0;o<t.length;o++)i.append(su(t[o],e.labels));return i},e.prototype.renderLine=function(){var t=this.options.line,e=this.lineBox(),i=new du;if(t.width>0&&t.visible){var o=new fu({stroke:{color:t.color,dashType:t.dashType,width:t.width}});o.moveTo(e.x1,e.y1).lineTo(e.x2,e.y2),i.append(o)}return i},e.prototype.renderTicks=function(){var t=new du,e=this.options,i=e.majorTicks.visible?e.majorUnit:0,o={vertical:e.vertical,mirror:e.labels.mirror,lineBox:this.lineBox()};return gu(t,this.getMajorTickPositions(),o,e.majorTicks),gu(t,this.getMinorTickPositions(),o,or({},{skipUnit:i/e.minorUnit},e.minorTicks)),t},e}(Hs);sn(mu,{min:0,max:50,majorTicks:{size:15,align:"inside",color:l,width:.5,visible:!0},minorTicks:{size:10,align:"inside",color:l,width:.5,visible:!0},line:{width:.5},labels:{position:"inside",padding:2},mirror:!1,_alignLines:!1});var xu=mu,bu=function(t){function e(e,i){t.call(this);var o=e.options,r=o.min,n=o.max,s=this.options=or({},this.options,i);s.fill=s.color,this.scale=e,Nr(s.value)?s.value=Jr(s.value,r,n):s.value=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.value=function(t){var e=this.options,i=e.value;if(0===arguments.length)return i;var o=this.scale.options,r=o.min,n=o.max;e._oldValue=Nr(e._oldValue)?e.value:r,e.value=Jr(t,r,n),this.elements&&this.repaint()},e}(O);sn(bu,{color:l});var _u=bu,wu=function(t){function e(e,i){t.call(this,e,i),this.options=or({track:{visible:Nr(i.track)}},this.options)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(){var t,e,i,o=this.options,r=this.scale,n=r.options,s=n.mirror,a=n.vertical,p=r.lineBox(),h=o.track.size||o.size,c=o.size/2,l=hr(o.margin),u=a?l[s?"left":"right"]:l[s?"bottom":"top"];u=s?-u:u,a?(i=new kn(p.x1+u,p.y1,p.x1+u,p.y2),s?i.x1-=h:i.x2+=h,"barPointer"!==o.shape&&(t=e=new kn(p.x2+u,p.y1-c,p.x2+u,p.y2+c))):(i=new kn(p.x1,p.y1-u,p.x2,p.y1-u),s?i.y2+=h:i.y1-=h,"barPointer"!==o.shape&&(t=e=new kn(p.x1-c,p.y1-u,p.x2+c,p.y1-u))),this.trackBox=i,this.pointerRangeBox=e,this.box=t||i.clone().pad(o.border.width)},e.prototype.getElementOptions=function(){var t=this.options;return{fill:{color:t.color,opacity:t.opacity},stroke:Nr(t.border)?{color:t.border.width?t.border.color||t.color:"",width:t.border.width,dashType:t.border.dashType,opacity:t.opacity}:null}},e.prototype._margin=function(){var t=this.scale,e=this.options,i=t.options,o=i.mirror,r=i.vertical,n=hr(e.margin);return r?n[o?"left":"right"]:n[o?"bottom":"top"]},e}(_u);sn(wu,{shape:"barPointer",track:{border:{width:1}},color:l,border:{width:1},opacity:1,margin:hr(3),animation:{type:"barPointer"},visible:!0});var Au=wu,Su=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){var t=this.options,e=t.margin,i=t.from,o=t.to,r=t.vertical,n=r?"x1":"y1";t.mirror===r?(i[n]-=e,o[n]-=e):(i[n]+=e,o[n]+=e);var s=this.fromScale=new p.Point(i.x1,i.y1),a=this.toScale=new p.Point(o.x1,o.y1);0!==t.duration&&(t.duration=Math.max(s.distanceTo(a)/t.duration*1e3,1))},e.prototype.step=function(t){var e=zr(this.fromScale.x,this.toScale.x,t),i=zr(this.fromScale.y,this.toScale.y,t);this.element.transform(p.transform().translate(e,i))},e}(a.Animation);sn(Su,{easing:"linear",duration:250}),a.AnimationFactory.current.register("arrowPointer",Su);var ku=Su,Cu=p.Point,Pu=a.Path,Tu=function(t){function e(e,i){t.call(this,e,i),Nr(this.options.size)||(this.options.size=.6*this.scale.options.majorTicks.size)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointerShape=function(){var t=this.scale,e=this.options.size,i=e/2,o=t.options.mirror?-1:1;return t.options.vertical?[new Cu(0,0-i),new Cu(0-o*e,0),new Cu(0,0+i)]:[new Cu(0-i,0),new Cu(0,0+o*e),new Cu(0+i,0)]},e.prototype.repaint=function(){var t=this.scale,e=this.options,i=new ku(this.elements,or(e.animation,{vertical:t.options.vertical,mirror:t.options.mirror,margin:this._margin(e.margin),from:t.getSlot(e._oldValue),to:t.getSlot(e.value)}));!1===e.animation.transitions&&(i.options.duration=0),i.setup(),i.play()},e.prototype.render=function(){var t=this.scale,e=this.options,i=this.getElementOptions(),o=this.pointerShape(e.value);e.animation.type="arrowPointer";var r=new Pu({stroke:i.stroke,fill:i.fill}).moveTo(o[0]).lineTo(o[1]).lineTo(o[2]).close(),n=t.getSlot(e.value);return r.transform(p.transform().translate(n.x1,n.y1)),this.elements=r,r},e}(Au),Mu=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setup=function(){var t=this.options,e=this.axis=t.vertical?k:S,i=this.to=t.newPoints[0][e],o=this.from=t.oldPoints[0][e];0!==t.duration&&(t.duration=Math.max(Math.abs(i-o)/t.speed*1e3,1)),this._set(o)},e.prototype.step=function(t){var e=zr(this.from,this.to,t);this._set(e)},e.prototype._set=function(t){var e="set"+this.axis.toUpperCase(),i=this.options.newPoints;i[0][e](t),i[1][e](t)},e}(a.Animation);sn(Mu,{easing:"linear",speed:250}),a.AnimationFactory.current.register("barPointer",Mu);var Ou=Mu,Ru=a.Group,Bu=a.Path,ju=function(t){function e(e,i){t.call(this,e,i),Nr(this.options.size)||(this.options.size=.3*this.scale.options.majorTicks.size)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.pointerShape=function(t){var e=this.scale,i=this.options,o=e.options,r=o.mirror,n=o.vertical,s=r===n?-1:1,a=i.size*s,h=e.getSlot(e.options.min),c=e.getSlot(t),l=n?k:S,u=n?S:k,f=this._margin()*s,d=new p.Point;d[l]=h[l+"1"],d[u]=h[u+"1"];var y=new p.Point;y[l]=c[l+"1"],y[u]=c[u+"1"],n?(d.translate(f,0),y.translate(f,0)):(d.translate(0,f),y.translate(0,f));var v=y.clone(),g=d.clone();return n?(v.translate(a,0),g.translate(a,0)):(v.translate(0,a),g.translate(0,a)),[d,y,v,g]},e.prototype.repaint=function(){var t=this.scale,e=this.options,i=this.pointerShape(e.value),o=this.pointerPath,r=this.pointerShape(e._oldValue);o.moveTo(i[0]).lineTo(i[1]).lineTo(i[2]).lineTo(i[3]).close();var n=new Ou(o,or(e.animation,{reverse:t.options.reverse,vertical:t.options.vertical,oldPoints:[r[1],r[2]],newPoints:[i[1],i[2]]}));!1===e.animation.transitions&&(n.options.duration=0),n.setup(),n.play()},e.prototype.render=function(){var t=new Ru,e=this.getElementOptions();this.options.track.visible&&t.append(this.renderTrack());var i=this.pointerPath=new Bu({stroke:e.stroke,fill:e.fill});return t.append(i),this.elements=t,t},e.prototype.renderTrack=function(){var t=this.options.track,e=t.border||{},i=this.trackBox.clone().pad(e.width||0);return new Bu.fromRect(i.toRect(),{fill:{color:t.color,opacity:t.opacity},stroke:{color:e.width?e.color||t.color:"",width:e.width,dashType:e.dashType}})},e}(Au),Iu=a.Group,Lu=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.pointers,i=t.origin.x,o=t.origin.y,r=new kn(i,o,i+t.width(),o+t.height());this.scale.reflow(r),this._shrinkScaleWidth(r);for(var n=0;n<e.length;n++)e[n].reflow();this.bbox=this._getBox(r),this._alignElements(),this._shrinkElements(),this._buildVisual(),this._draw()},e.prototype._buildVisual=function(){var t=new Iu,e=this.scale.render(),i=this.pointers;t.append(this.gaugeArea),t.append(e);for(var o=0;o<i.length;o++){var r=i[o];t.append(r.render()),r.value(r.options.value)}this._visuals=t},e.prototype._createModel=function(){var t=this.options,e=this.scale=new xu(t.scale,this.contextService);this.pointers=[];var i=t.pointer;i=C(i)?i:[i];for(var o=0;o<i.length;o++){var r=or({},i[o],{animation:{transitions:t.transitions}}),n="arrow"===r.shape?Tu:ju;this.pointers.push(new n(e,r))}},e.prototype._defaultSize=function(){var t=this.options.scale.vertical;return{width:t?60:200,height:t?200:60}},e.prototype._getBox=function(t){for(var e,i=this.scale,o=this.pointers,r=t.center(),n=o[0].box.clone().wrap(i.box),s=0;s<o.length;s++)n.wrap(o[s].box.clone());return i.options.vertical?(e=n.width()/2,n=new kn(r.x-e,t.y1,r.x+e,t.y2)):(e=n.height()/2,n=new kn(t.x1,r.y-e,t.x2,r.y+e)),n},e.prototype._alignElements=function(){for(var t,e=this.scale,i=this.pointers,o=e.box,r=i[0].box.clone().wrap(e.box),n=this.bbox,s=0;s<i.length;s++)r.wrap(i[s].box.clone());e.options.vertical?(t=n.center().x-r.center().x,e.reflow(new kn(o.x1+t,n.y1,o.x2+t,n.y2))):(t=n.center().y-r.center().y,e.reflow(new kn(o.x1,o.y1+t,o.x2,o.y2+t)));for(var a=0;a<i.length;a++)i[a].reflow(this.bbox)},e.prototype._shrinkScaleWidth=function(t){var e=this.scale;if(!e.options.vertical){var i=e.contentBox().width()-t.width();i>0&&(e.box.shrink(i,0),e.box.alignTo(t,"center"),e.reflow(e.box))}},e.prototype._shrinkElements=function(){for(var t=this.scale,e=this.pointers,i=t.box.clone(),o=t.options.vertical?"y":"x",r=e[0].box,n=0;n<e.length;n++)r.wrap(e[n].box.clone());i[o+1]+=Math.max(i[o+1]-r[o+1],0),i[o+2]-=Math.max(r[o+2]-i[o+2],0),t.reflow(i);for(var s=0;s<e.length;s++)e[s].reflow(this.bbox)},e}(uu);sn(Lu,{transitions:!0,gaugeArea:{background:""},scale:{vertical:!0}});var zu=Lu,Eu=a.Arc,Vu=a.Path,Fu=a.Group;function Du(t,e,i,o){var r=new Fu,n=t.center,s=t.getRadiusX();if(o.visible)for(var a=0;a<e.length;a++){var h=t.pointAt(e[a]),c=new p.Point(n.x+s-o.size,n.y).rotate(e[a],n);r.append(new Vu({stroke:{color:o.color,width:o.width}}).moveTo(h).lineTo(c))}return r}function Uu(t,e,i,o){return{from:t,to:e,color:i,opacity:o}}var Hu=function(t){function e(e,i){t.call(this,0,1,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initUserOptions=function(t){var e=or({},this.options,t);return e.majorUnit=e.majorUnit||wn(e.min,e.max),e.minorUnit=e.minorUnit||e.majorUnit/10,e},e.prototype.initFields=function(){},e.prototype.render=function(t,e){var i=this.renderArc(t,e);this.bbox=i.bbox(),this.labelElements=this.renderLabels(),this.ticks=this.renderTicks(),this.ranges=this.renderRanges()},e.prototype.reflow=function(t){var e=t.center(),i=Math.min(t.height(),t.width())/2;if(!Nr(this.bbox))return this.render(e,i);this.bbox=this.arc.bbox(),this.radius(this.arc.getRadiusX()),this.repositionRanges(),this.renderLabels()},e.prototype.slotAngle=function(t){var e=this.options,i=e.min,o=e.max,r=e.reverse,n=e.startAngle,s=e.endAngle,a=s-n;return(r?s-(t-i)/(o-i)*a:(t-i)/(o-i)*a+n)+180},e.prototype.hasRanges=function(){var t=this.options.ranges;return t&&t.length},e.prototype.ticksSize=function(){var t=this.options,e=t.majorTicks,i=t.minorTicks,o=0;return e.visible&&(o=e.size),i.visible&&(o=Math.max(i.size,o)),o},e.prototype.labelsCount=function(){var e=t.prototype.labelsCount.call(this),i=this.options;return i.endAngle-i.startAngle>=360&&i.max%i.majorUnit==0&&(e-=1),e},e.prototype.renderLabels=function(){var t=this.options,e=this.arc.clone(),i=e.getRadiusX(),o=this.tickAngles(e,t.majorUnit),r=t.rangeSize=t.rangeSize||.1*i,n=new Fu,s=.05*i;Nr(t.rangeDistance)?s=t.rangeDistance:t.rangeDistance=s;var a=t.labels,h="inside"===a.position,c=Nr(this.labelElements);h&&(i-=this.ticksSize(),this.hasRanges()&&!c&&(i-=r+s),e.setRadiusX(i).setRadiusY(i));for(var l=this.labels,u=l.length,f=hr(a.padding),d=(f.left+f.right)/2,y=(f.top+f.bottom)/2,v=0;v<u;v++){var g=l[v],m=g.box.width()/2,x=g.box.height()/2,b=o[v],_=(b-180)*eu,w=e.pointAt(b),A=w.x+Math.cos(_)*(m+d)*(h?1:-1),S=w.y+Math.sin(_)*(x+y)*(h?1:-1);g.reflow(new kn(A-m,S-x,A+m,S+x));var k=new p.Point(g.box.x1,g.box.y1),C=void 0;if(c){var P=(C=this.labelElements.children[v]).bbox().origin,T=C.transform()||p.transform();T.translate(k.x-P.x,k.y-P.y),C.transform(T)}else C=su(g,t.labels),n.append(C);this.bbox=p.Rect.union(this.bbox,C.bbox())}return n},e.prototype.repositionRanges=function(){var t=this.ranges.children;if(t.length>0){var e=this.options,i=e.rangeDistance,o=e.rangeSize,r=this.getRangeRadius();"inside"===this.options.labels.position&&(r+=o+i);for(var n=r+o/2,s=0;s<t.length;s++)t[s]._geometry.setRadiusX(n).setRadiusY(n);this.bbox=p.Rect.union(this.bbox,this.ranges.bbox())}},e.prototype.renderRanges=function(){var t=this.rangeSegments(),e=t.length,i=new Fu;if(e){var o=this.options,r=o.rangeSize,n=o.reverse,s=o.rangeDistance,a=this.getRangeRadius();this.radius(this.radius()-r-s);for(var p=0;p<e;p++){var h=t[p],c=this.slotAngle(h[n?"to":"from"]),l=this.slotAngle(h[n?"from":"to"]);l-c!=0&&i.append(this.createRange(c,l,a,h))}}return i},e.prototype.createRange=function(t,e,i,o){var r=this.options.rangeSize,n=new p.Arc(this.arc.center,{radiusX:i+r/2,radiusY:i+r/2,startAngle:t,endAngle:e});return new Eu(n,{stroke:{width:r,color:o.color,opacity:o.opacity,lineCap:o.lineCap}})},e.prototype.rangeSegments=function(){var t=this.options,e=t.ranges||[],i=e.length,o=[];if(i){var r=t.min,n=t.max,s=t.rangePlaceholderColor;o.push(Uu(r,n,s));for(var a=0;a<i;a++)for(var p=au(e[a],r,n),h=o.length,c=0;c<h;c++){var l=o[c];if(l.from<=p.from&&p.from<=l.to){o.push(Uu(p.from,p.to,p.color,p.opacity)),l.from<=p.to&&p.to<=l.to&&o.push(Uu(p.to,l.to,s,p.opacity)),l.to=p.from;break}}}return o},e.prototype.getRangeRadius=function(){var t=this.arc,e=this.options,i=e.rangeSize,o=e.rangeDistance,r=e.majorTicks.size;return"outside"===e.labels.position?t.getRadiusX()-r-o-i:t.getRadiusX()-i},e.prototype.renderArc=function(t,e){var i=this.options;return this.arc=new p.Arc(t,{radiusX:e,radiusY:e,startAngle:i.startAngle+180,endAngle:i.endAngle+180})},e.prototype.renderTicks=function(){var t=this.arc,e=this.options,i=t.clone();this.majorTickAngles=this.tickAngles(t,e.majorUnit),this.majorTicks=Du(i,this.majorTickAngles,e.majorUnit,e.majorTicks);var o=new Fu;o.append(this.majorTicks);var r=e.majorTicks.size,n=e.minorTicks.size;if(this._tickDifference=r-n,"outside"===e.labels.position){var s=i.getRadiusX();i.setRadiusX(s-r+n).setRadiusY(s-r+n)}return this.minorTickAngles=this.normalizeTickAngles(this.tickAngles(t,e.minorUnit)),this.minorTicks=Du(i,this.minorTickAngles,e.minorUnit,e.minorTicks),o.append(this.minorTicks),o},e.prototype.normalizeTickAngles=function(t){for(var e=this.options,i=e.majorUnit/e.minorUnit,o=t.length-1;o>=0;o--)o%i==0&&t.splice(o,1);return t},e.prototype.tickAngles=function(t,e){var i=this.options,o=i.reverse,r=i.max-i.min,n=t.endAngle-t.startAngle,s=r/e,a=t.startAngle,p=n/s;o&&(a+=n,p=-p),n>=360&&i.max%e==0&&(s-=1);for(var h=[],c=0;c<s;c++)h.push(tn(a,3)),a+=p;return tn(a)<=t.endAngle&&h.push(a),h},e.prototype.radius=function(t){if(!t)return this.arc.getRadiusX();this.arc.setRadiusX(t).setRadiusY(t),this.repositionTicks(this.majorTicks.children,this.majorTickAngles),this.repositionTicks(this.minorTicks.children,this.minorTickAngles,!0)},e.prototype.repositionTicks=function(t,e,i){var o=i&&this._tickDifference||0,r=this.arc,n=r.getRadiusX();i&&"outside"===this.options.labels.position&&0!==o&&(r=this.arc.clone()).setRadiusX(n-o).setRadiusY(n-o);for(var s=0;s<t.length;s++){var a=r.pointAt(e[s]),h=t[s].segments,c=a.x-h[0].anchor().x,l=a.y-h[0].anchor().y;t[s].transform((new p.transform).translate(c,l))}},e}(Hs);sn(Hu,{min:0,max:100,majorTicks:{size:15,align:"inside",color:l,width:.5,visible:!0},minorTicks:{size:10,align:"inside",color:l,width:.5,visible:!0},startAngle:-30,endAngle:210,labels:{position:"inside",padding:2}});var Gu=Hu,Nu=function(t){function e(e,i){t.call(this,e,i);var o=this.options;o.duration=Math.max(Math.abs(o.newAngle-o.oldAngle)/o.duration*1e3,1)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.step=function(t){var e=this.options,i=zr(e.oldAngle,e.newAngle,t);this.element.transform(p.transform().rotate(i,e.center))},e}(a.Animation);sn(Nu,{easing:"linear",duration:150}),a.AnimationFactory.current.register("radialPointer",Nu);var Wu=Nu,qu=a.Circle,Xu=a.Group,Yu=a.Path,Zu=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setAngle=function(t){this.elements.transform(p.transform().rotate(t,this.center))},e.prototype.repaint=function(){var t=this.scale,e=this.options,i=t.slotAngle(e._oldValue),o=t.slotAngle(e.value);!1===e.animation.transitions?this.setAngle(o):new Wu(this.elements,or(e.animation,{oldAngle:i,newAngle:o})).play()},e.prototype.render=function(){var t=this.scale,e=this.options,i=new Xu;return!1!==e.animation&&or(e.animation,{startAngle:0,center:t.arc.center,reverse:t.options.reverse}),i.append(this._renderNeedle(),this._renderCap()),this.elements=i,this.setAngle(eu),i},e.prototype.reflow=function(t){var e=this.center=t.center,i=Jr(this.options.length||1,.1,1.5),o=this.radius=t.getRadiusX()*i,r=this.capSize=Math.round(o*this.options.cap.size);this.bbox=p.Rect.fromPoints(new p.Point(e.x-r,e.y-r),new p.Point(e.x+r,e.y+r))},e.prototype._renderNeedle=function(){var t=this.scale.options.minorTicks.size,e=this.center,i=this.options.color,o=new Yu({fill:{color:i},stroke:{color:i,width:.5}});return o.moveTo(e.x+this.radius-t,e.y).lineTo(e.x,e.y-this.capSize/2).lineTo(e.x,e.y+this.capSize/2).close(),o},e.prototype._renderCap=function(){var t=this.options,e=t.cap.color||t.color,i=new p.Circle(this.center,this.capSize);return new qu(i,{fill:{color:e},stroke:{color:e}})},e}(_u);sn(Zu,{cap:{size:.05},arrow:{width:16,height:14},animation:{type:"radialPointer",duration:150}});var Ku=Zu,Ju=a.Group,$u=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reflow=function(t){var e=this.pointers;this.scale.reflow(t),this._initialPlotArea=this.scale.bbox;for(var i=0;i<e.length;i++)e[i].reflow(this.scale.arc),this._initialPlotArea=p.Rect.union(this._initialPlotArea,e[i].bbox);this.fitScale(t),this.alignScale(t),this._buildVisual(this.gaugeArea,e,this.scale),this._draw()},e.prototype._buildVisual=function(t,e,i){var o=this._visuals=new Ju;o.append(t),o.append(i.ticks),o.append(i.ranges),this._buildPointers(e),o.append(i.labelElements)},e.prototype._buildPointers=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.render(),this._visuals.append(i.elements),i.value(i.options.value)}},e.prototype.fitScale=function(t){for(var e,i,o,r,n,s=this.scale.arc,a=this._initialPlotArea,p=Math.abs(this.getDiff(a,t)),h=tn(p,3),c=tn(-p,3),l=0,u=0;!(!(u++<100)||(l=n===o?l+1:0)>5||h!==r&&0<=(e=this.getPlotBox(h,t,s))&&e<=2||c!==r&&0<=(o=this.getPlotBox(c,t,s))&&o<=2||(r=e>0&&o>0?2*h:e<0&&o<0?2*c:tn((h+c)/2||1,3),0<=(i=this.getPlotBox(r,t,s))&&i<=2));)n=o,i>0?(c=r,o=i):(h=r,e=i)},e.prototype.getPlotBox=function(t,e,i){var o=this.scale,r=this.pointers,n=i.getRadiusX(),s=i.clone();s.setRadiusX(n+t).setRadiusY(n+t),o.arc=s,o.reflow(e),this.plotBbox=o.bbox;for(var a=0;a<r.length;a++)r[a].reflow(s),this.plotBbox=p.Rect.union(this.plotBbox,r[a].bbox);return this.getDiff(this.plotBbox,e)},e.prototype.getDiff=function(t,e){return Math.min(e.width()-t.width(),e.height()-t.height())},e.prototype.alignScale=function(t){var e=this.plotBbox.center(),i=t.center(),o=e.x-i.x,r=e.y-i.y,n=this.scale,s=this.pointers;n.arc.center.x-=o,n.arc.center.y-=r,n.reflow(t);for(var a=0;a<s.length;a++)s[a].reflow(n.arc),this.plotBbox=p.Rect.union(n.bbox,s[a].bbox)},e.prototype._createModel=function(){var t=this.options,e=t.pointer,i=this.scale=new Gu(t.scale,this.contextService);this.pointers=[];for(var o=C(e)?e:[e],r=0;r<o.length;r++){var n=new Ku(i,or({},o[r],{animation:{transitions:t.transitions}}));this.pointers.push(n)}},e}(uu);sn($u,{transitions:!0,gaugeArea:{background:""}});var Qu=$u,tf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.rangeSegments=function(){var t=this.options;return[{from:t.min,to:t.max,color:t.rangePlaceholderColor,lineCap:t.rangeLineCap}]},e.prototype.hasRanges=function(){return!0},e.prototype.placeholderRangeAngle=function(t){var e=this.ranges.children[0].geometry();this.options.reverse?e.setEndAngle(t):e.setStartAngle(t)},e.prototype.addRange=function(t,e,i){var o=this.options.reverse,r=this.slotAngle(o?e:t),n=this.slotAngle(o?t:e),s=this.createRange(r,n,this.getRangeRadius(),i);return this.ranges.append(s),s},e}(Gu);sn(tf,{min:0,max:100,majorTicks:{visible:!1},minorTicks:{visible:!1},labels:{visible:!1},startAngle:0,endAngle:180,rangeLineCap:"round"});var ef=tf,of=function(t){function e(e,i){t.call(this,e,i);var o=this.options,r=Math.abs(o.newAngle-o.oldAngle)/o.duration*1e3;o.duration=Jr(r,150,800);var n=e.elements.options.get("stroke.color"),s=e.currentColor();n!==s&&(this.startColor=new dn(n),this.color=new dn(s))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.step=function(t){var e=this.options,i=this.startColor,o=this.color,r=zr(e.oldAngle,e.newAngle,t);if(this.element.angle(r),o){var n=tn(zr(i.r,o.r,t)),s=tn(zr(i.g,o.g,t)),a=tn(zr(i.b,o.b,t));this.element.stroke(new dn(n,s,a).toHex())}},e}(a.Animation);sn(of,{easing:"linear",duration:150}),a.AnimationFactory.current.register("radialRangePointer",of);var rf=of,nf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.repaint=function(){var t=this.scale,e=this.options,i=t.slotAngle(e._oldValue),o=t.slotAngle(e.value);this.animation&&this.animation.abort(),!1===e.animation.transitions?(this.angle(o),this.stroke(this.currentColor())):(this.animation=new rf(this,or(e.animation,{oldAngle:i,newAngle:o})),this.animation.play())},e.prototype.angle=function(t){var e=this.elements.geometry();this.scale.options.reverse?e.setStartAngle(t):e.setEndAngle(t),this.scale.placeholderRangeAngle(t)},e.prototype.stroke=function(t){this.elements.stroke(t)},e.prototype.render=function(){if(!this.elements){var t=this.scale,e=this.options;!1!==e.animation&&or(e.animation,{startAngle:0,center:t.arc.center,reverse:t.options.reverse}),this.elements=t.addRange(t.options.min,this.options.value,{color:this.currentColor(),opacity:e.opacity,lineCap:t.options.rangeLineCap})}},e.prototype.currentColor=function(){var t=this.scale.options,e=t.min,i=t.max,o=this.options,r=o.colors,n=o.color,s=o.value,a=$o(s)?s:e;if(r)for(var p=0;p<r.length;p++){var h=r[p],c=h.color,l=h.from;void 0===l&&(l=e);var u=h.to;if(void 0===u&&(u=i),l<=a&&a<=u)return c}return n},e.prototype.reflow=function(){this.render(),this.bbox=this.elements.bbox()},e}(_u);sn(nf,{animation:{type:"radialRangePointer",duration:150}});var sf=nf,af=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._initTheme=function(e){t.prototype._initTheme.call(this,e),this.options.color=this.options.color||(this.theme.pointer||{}).color},e.prototype._createModel=function(){var t=this.options,e=this.scale=new ef(t.scale,this.contextService),i=new sf(e,or({},{colors:t.colors,color:t.color,value:t.value,opacity:t.opacity,animation:{transitions:t.transitions}}));this.pointers=[i]},e.prototype._buildPointers=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.render(),i.value(i.options.value)}},e.prototype._setValueOptions=function(t){this.options.value=t},e.prototype.currentColor=function(){var t=this.pointers[0];if(t)return t.currentColor()},e.prototype.centerLabelPosition=function(t,e){var i=this.getSize(),o=this.scale.arc.center,r=o.x-t/2,n=o.y-e/2;if(t<i.width){var s=r+t;r=Math.max(r,0),s>i.width&&(r-=s-i.width)}if(e<i.height){var a=this.scale.bbox,p=a.bottomRight().y,h=n+e;n=Math.max(n,a.origin.y),h>p&&(n-=h-p)}return{left:r,top:n}},e}(Qu),pf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._createModel=function(){var e=this.options.scale;"number"!=typeof e.startAngle&&(e.startAngle=90),e.endAngle=e.startAngle+360,t.prototype._createModel.call(this)},e}(af),hf=function(t){function e(e){t.call(this),this.setOptions(e),this.initProperties()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){},e.prototype.setOptions=function(t){this.options=Object.assign({},this.options,t),this.quietZoneLength=this.options.addQuietZone?2*this.options.quietZoneLength:0},e.prototype.encode=function(t,e,i){var o=Nr(t)?String(t):t;return this.initValue(o,e,i),this.options.addQuietZone&&this.addQuietZone(),this.addData(),this.options.addQuietZone&&this.addQuietZone(),{baseUnit:this.baseUnit,pattern:this.pattern}},e.prototype.initValue=function(){},e.prototype.addQuietZone=function(){this.pattern.push(this.options.quietZoneLength||10)},e.prototype.addData=function(){},e.prototype.invalidCharacterError=function(t){throw new Error("Character '"+t+"' is not valid for symbology "+this.name)},e}(O);sn(hf,{quietZoneLength:10,addQuietZone:!0,addCheckSum:!0});var cf=Object.assign,lf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),cf(this,{name:"Code 11",characterMap:["111121","211121","121121","221111","112121","212111","122111","111221","211211","211111","112111"],cCheckSumTotal:10,kCheckSumTotal:9,kCheckSumMinLength:10,checkSumMod:11,DASH_VALUE:10,DASH:"-",START:"112211",STOP:"11221"})},e.prototype.initValue=function(t,e){this.pattern=[],this.value=t,this.width=e,this.totalUnits=0},e.prototype.addData=function(){var t=this.value;this.addPattern(this.START);for(var e=0;e<t.length;e++)this.addCharacter(t.charAt(e));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.STOP),this.setBaseUnit()},e.prototype.setBaseUnit=function(){this.baseUnit=this.width/(this.totalUnits+this.quietZoneLength)},e.prototype.addCheckSum=function(){var t=this.value,e=t.length,i=this.getWeightedSum(t,e,this.cCheckSumTotal)%this.checkSumMod;if(this.checksum=String(i),this.addPattern(this.characterMap[i]),++e>=this.kCheckSumMinLength){var o=(i+this.getWeightedSum(t,e,this.kCheckSumTotal))%this.checkSumMod;this.checksum+=o,this.addPattern(this.characterMap[o])}},e.prototype.getWeightedSum=function(t,e,i){for(var o=0,r=0;r<t.length;r++)o+=this.weightedValue(this.getValue(t.charAt(r)),e,r,i);return o},e.prototype.weightedValue=function(t,e,i,o){return((e-i)%o||o)*t},e.prototype.getValue=function(t){return isNaN(t)?(t!==this.DASH&&this.invalidCharacterError(t),this.DASH_VALUE):parseInt(t,10)},e.prototype.addCharacter=function(t){var e=this.getValue(t),i=this.characterMap[e];this.addPattern(i)},e.prototype.addPattern=function(t){for(var e,i=0;i<t.length;i++)e=parseInt(t.charAt(i),10),this.pattern.push(e),this.totalUnits+=e},e}(hf);sn(lf,{addCheckSum:!0});var uf=Object.assign,ff=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),uf(this,{minBaseUnitLength:.7})},e.prototype.addData=function(){var t=this.value;this.addStart();for(var e=0;e<t.length;e++)this.addCharacter(t.charAt(e));this.options.addCheckSum&&this.pushCheckSum(),this.addStop(),this.prepareValues()},e.prototype.addCharacter=function(t){var e=this.characterMap[t];e||this.invalidCharacterError(t),this.addBase(e)},e.prototype.addBase=function(){},e}(hf),df=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),uf(this,{name:"Code 39",checkSumMod:43,minRatio:2.5,maxRatio:3,gapWidth:1,splitCharacter:"|",patternMappings:{b:"1|",w:"1|",B:"ratio|",W:"ratio|"},characterMap:{0:{pattern:"bwbWBwBwb",value:0},1:{pattern:"BwbWbwbwB",value:1},2:{pattern:"bwBWbwbwB",value:2},3:{pattern:"BwBWbwbwb",value:3},4:{pattern:"bwbWBwbwB",value:4},5:{pattern:"BwbWBwbwb",value:5},6:{pattern:"bwBWBwbwb",value:6},7:{pattern:"bwbWbwBwB",value:7},8:{pattern:"BwbWbwBwb",value:8},9:{pattern:"bwBWbwBwb",value:9},A:{pattern:"BwbwbWbwB",value:10},B:{pattern:"bwBwbWbwB",value:11},C:{pattern:"BwBwbWbwb",value:12},D:{pattern:"bwbwBWbwB",value:13},E:{pattern:"BwbwBWbwb",value:14},F:{pattern:"bwBwBWbwb",value:15},G:{pattern:"bwbwbWBwB",value:16},H:{pattern:"BwbwbWBwb",value:17},I:{pattern:"bwBwbWBwb",value:18},J:{pattern:"bwbwBWBwb",value:19},K:{pattern:"BwbwbwbWB",value:20},L:{pattern:"bwBwbwbWB",value:21},M:{pattern:"BwBwbwbWb",value:22},N:{pattern:"bwbwBwbWB",value:23},O:{pattern:"BwbwBwbWb",value:24},P:{pattern:"bwBwBwbWb",value:25},Q:{pattern:"bwbwbwBWB",value:26},R:{pattern:"BwbwbwBWb",value:27},S:{pattern:"bwBwbwBWb",value:28},T:{pattern:"bwbwBwBWb",value:29},U:{pattern:"BWbwbwbwB",value:30},V:{pattern:"bWBwbwbwB",value:31},W:{pattern:"BWBwbwbwb",value:32},X:{pattern:"bWbwBwbwB",value:33},Y:{pattern:"BWbwBwbwb",value:34},Z:{pattern:"bWBwBwbwb",value:35},"-":{pattern:"bWbwbwBwB",value:36},".":{pattern:"BWbwbwBwb",value:37}," ":{pattern:"bWBwbwBwb",value:38},$:{pattern:"bWbWbWbwb",value:39},"/":{pattern:"bWbWbwbWb",value:40},"+":{pattern:"bWbwbWbWb",value:41},"%":{pattern:"bwbWbWbWb",value:42},START:{pattern:"bWbwBwBwb"}}})},e.prototype.initValue=function(t,e,i){this.width=e,this.height=i,this.value=t,this.dataLength=t.length,this.pattern=[],this.patternString=""},e.prototype.prepareValues=function(){var t,e=this.minBaseUnitLength,i=this.minRatio,o=Math.max(.15*this.width,24),r=this.maxRatio;if(this.height<o)throw new Error("Insufficient Height. The minimum height for value: "+this.value+" is: "+o);for(t=this.getBaseUnit(r);t<e&&r>i;)r=parseFloat((r-.1).toFixed(1)),t=this.getBaseUnit(r);if(t<e){var n=Math.ceil(this.getBaseWidth(i)*e);throw new Error("Insufficient width. The minimum width for value: "+this.value+" is: "+n)}this.ratio=r,this.baseUnit=t,this.patternString=this.patternString.substring(0,this.patternString.length-1),this.pattern=this.pattern.concat(this.patternString.replace(/ratio/g,r).split(this.splitCharacter))},e.prototype.getBaseUnit=function(t){return this.width/this.getBaseWidth(t)},e.prototype.getBaseWidth=function(t){var e=3*(t+2);return this.quietZoneLength+e*(this.dataLength+2)+this.gapWidth*(this.dataLength+1)},e.prototype.addStart=function(){this.addPattern(this.characterMap.START.pattern),this.addCharacterGap()},e.prototype.addBase=function(t){this.addPattern(t.pattern),this.addCharacterGap()},e.prototype.addStop=function(){this.addPattern(this.characterMap.START.pattern)},e.prototype.addPattern=function(t){for(var e=0;e<t.length;e++)this.patternString+=this.patternMappings[t.charAt(e)]},e.prototype.addCharacterGap=function(){this.patternString+=this.gapWidth+this.splitCharacter},e}(ff);sn(df,{addCheckSum:!1});var yf={addCharacter:function(t){this.characterMap[t]?this.addBase(this.characterMap[t]):t.charCodeAt(0)>127?this.invalidCharacterError(t):this.addExtended(t.charCodeAt(0))},addExtended:function(t){for(var e,i=0;i<this.extendedMappings.length;i++)if(e=this.extendedMappings[i].call(this,t)){for(var o=0;o<e.length;o++){var r=e[o];this.addBase(r)}return void(this.dataLength+=e.length-1)}},extendedMappings:[function(t){if(97<=t&&t<=122)return[this.characterMap[this.shiftCharacters[0]],this.characterMap[String.fromCharCode(t-32)]]},function(t){if(33<=t&&t<=58)return[this.characterMap[this.shiftCharacters[1]],this.characterMap[String.fromCharCode(t+32)]]},function(t){if(1<=t&&t<=26)return[this.characterMap[this.shiftCharacters[2]],this.characterMap[String.fromCharCode(t+64)]]},function(t){var e,i;if(this.specialAsciiCodes[t]){e=[];for(var o=0;o<this.specialAsciiCodes[t].length;o++)e.push(this.characterMap[this.shiftCharacters[3]]),e.push(this.characterMap[this.specialAsciiCodes[t][o]])}else i=6*Math.floor(t/32)+(t-27)%32+64,e=[this.characterMap[this.shiftCharacters[3]],this.characterMap[String.fromCharCode(i)]];return e}],specialAsciiCodes:{0:["U"],64:["V"],96:["W"],127:["T","X","Y","Z"]},shiftValuesAsciiCodes:{39:36,40:47,41:43,42:37},characterMap:{"+":!1,"/":!1,$:!1,"%":!1},shiftCharacters:["SHIFT0","SHIFT1","SHIFT2","SHIFT3"]},vf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),or(this,yf,{name:"Code 39 extended",characterMap:{SHIFT0:{pattern:"bWbwbWbWb",value:41},SHIFT1:{pattern:"bWbWbwbWb",value:40},SHIFT2:{pattern:"bWbWbWbwb",value:39},SHIFT3:{pattern:"bwbWbWbWb",value:42}}})},e}(df),gf=Object.assign,mf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),gf(this,{name:"Code 93",cCheckSumTotal:20,kCheckSumTotal:15,checkSumMod:47,characterMap:{0:{pattern:"131112",value:0},1:{pattern:"111213",value:1},2:{pattern:"111312",value:2},3:{pattern:"111411",value:3},4:{pattern:"121113",value:4},5:{pattern:"121212",value:5},6:{pattern:"121311",value:6},7:{pattern:"111114",value:7},8:{pattern:"131211",value:8},9:{pattern:"141111",value:9},A:{pattern:"211113",value:10},B:{pattern:"211212",value:11},C:{pattern:"211311",value:12},D:{pattern:"221112",value:13},E:{pattern:"221211",value:14},F:{pattern:"231111",value:15},G:{pattern:"112113",value:16},H:{pattern:"112212",value:17},I:{pattern:"112311",value:18},J:{pattern:"122112",value:19},K:{pattern:"132111",value:20},L:{pattern:"111123",value:21},M:{pattern:"111222",value:22},N:{pattern:"111321",value:23},O:{pattern:"121122",value:24},P:{pattern:"131121",value:25},Q:{pattern:"212112",value:26},R:{pattern:"212211",value:27},S:{pattern:"211122",value:28},T:{pattern:"211221",value:29},U:{pattern:"221121",value:30},V:{pattern:"222111",value:31},W:{pattern:"112122",value:32},X:{pattern:"112221",value:33},Y:{pattern:"122121",value:34},Z:{pattern:"123111",value:35},"-":{pattern:"121131",value:36},".":{pattern:"311112",value:37}," ":{pattern:"311211",value:38},$:{pattern:"321111",value:39},"/":{pattern:"112131",value:40},"+":{pattern:"113121",value:41},"%":{pattern:"211131",value:42},SHIFT0:{pattern:"122211",value:46},SHIFT1:{pattern:"311121",value:45},SHIFT2:{pattern:"121221",value:43},SHIFT3:{pattern:"312111",value:44},START:{pattern:"111141"},TERMINATION_BAR:"1"}})},e.prototype.initValue=function(t,e,i){this.value=t,this.width=e,this.height=i,this.pattern=[],this.values=[],this.dataLength=t.length},e.prototype.prepareValues=function(){var t=Math.max(.15*this.width,24);if(this.height<t)throw new Error("Insufficient Height");if(this.setBaseUnit(),this.baseUnit<this.minBaseUnitLength)throw new Error("Insufficient Width")},e.prototype.setBaseUnit=function(){this.baseUnit=this.width/(9*(this.dataLength+2+2)+this.quietZoneLength+1)},e.prototype.addStart=function(){var t=this.characterMap.START.pattern;this.addPattern(t)},e.prototype.addStop=function(){this.addStart(),this.pattern.push(this.characterMap.TERMINATION_BAR)},e.prototype.addBase=function(t){this.addPattern(t.pattern),this.values.push(t.value)},e.prototype.pushCheckSum=function(){var t,e=this._getCheckValues();this.checksum=e.join("");for(var i=0;i<e.length;i++)t=this.characterMap[this._findCharacterByValue(e[i])],this.addPattern(t.pattern)},e.prototype._getCheckValues=function(){var t,e,i=this.values,o=i.length,r=0;for(e=o-1;e>=0;e--)r+=this.weightedValue(i[e],o-e,this.cCheckSumTotal);for(t=r%this.checkSumMod,r=this.weightedValue(t,1,this.kCheckSumTotal),e=o-1;e>=0;e--)r+=this.weightedValue(i[e],o-e+1,this.kCheckSumTotal);return[t,r%this.checkSumMod]},e.prototype._findCharacterByValue=function(t){for(var e in this.characterMap)if(this.characterMap[e].value===t)return e},e.prototype.weightedValue=function(t,e,i){return(e%i||i)*t},e.prototype.addPattern=function(t){for(var e,i=0;i<t.length;i++)e=parseInt(t.charAt(i),10),this.pattern.push(e)},e}(ff),xf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),or(this,yf,{name:"Code 93 extended",pushCheckSum:function(){var t,e=this._getCheckValues();this.checksum=e.join("");for(var i=0;i<e.length;i++)if(t=e[i],this.shiftValuesAsciiCodes[t])this.addExtended(this.shiftValuesAsciiCodes[t]);else{var o=this._findCharacterByValue(t);this.addPattern(this.characterMap[o].pattern)}}})},e}(mf),bf=/^\d+$/,_f=Object.assign,wf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),_f(this,{name:"Postnet",START:"2",VALID_CODE_LENGTHS:[5,9,11],DIGIT_SEPARATOR:"-",characterMap:["22111","11122","11212","11221","12112","12121","12211","21112","21121","21211"]})},e.prototype.initValue=function(t,e,i){this.height=i,this.width=e,this.baseHeight=i/2,this.value=t.replace(new RegExp(this.DIGIT_SEPARATOR,"g"),""),this.pattern=[],this.validate(this.value),this.checkSum=0,this.setBaseUnit()},e.prototype.addData=function(){var t=this.value;this.addPattern(this.START);for(var e=0;e<t.length;e++)this.addCharacter(t.charAt(e));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.START),this.pattern.pop()},e.prototype.addCharacter=function(t){var e=this.characterMap[t];this.checkSum+=parseInt(t,10),this.addPattern(e)},e.prototype.addCheckSum=function(){this.checksum=(10-this.checkSum%10)%10,this.addCharacter(this.checksum)},e.prototype.setBaseUnit=function(){this.baseUnit=this.width/(10*(this.value.length+1)+3+this.quietZoneLength)},e.prototype.validate=function(t){if(bf.test(t)||this.invalidCharacterError(t.match(/[^0-9]/)[0]),!Lr(t.length,this.VALID_CODE_LENGTHS))throw new Error("Invalid value length. Valid lengths for the Postnet symbology are "+this.VALID_CODE_LENGTHS.join(","))},e.prototype.addPattern=function(t){for(var e,i=0;i<t.length;i++)e=this.height-this.baseHeight*t.charAt(i),this.pattern.push({width:1,y1:e,y2:this.height}),this.pattern.push(1)},e}(hf),Af=/^\d+$/,Sf=/^[a-z0-9]+$/i,kf=Object.assign,Cf=function(t){function e(e){t.call(this),this.encoding=e,this.initProperties()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){},e.prototype.addStart=function(){},e.prototype.is=function(){},e.prototype.isCode=function(){return!1},e.prototype.move=function(){},e.prototype.pushState=function(){},e}(O),Pf=function(t){function e(e,i){t.call(this,e),this.states=i,this._initMoves(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),or(this,{FNC4:"FNC4",SHIFT:98})},e.prototype.addStart=function(){this.encoding.addPattern(this.START)},e.prototype.is=function(t,e){var i=t.charCodeAt(e);return this.isCode(i)},e.prototype.move=function(t){for(var e=0;!this._moves[e].call(this,t)&&e<this._moves.length;)e++},e.prototype.pushState=function(t){var e,i=this.states,o=t.value,r=o.length;if(Lr("C",i)){var n=o.substr(t.index).match(/\d{4,}/g);n&&(r=o.indexOf(n[0],t.index))}for(;(e=t.value.charCodeAt(t.index))>=0&&this.isCode(e)&&t.index<r;)this.encoding.addPattern(this.getValue(e)),t.index++},e.prototype._initMoves=function(t){this._moves=[],Lr(this.FNC4,t)&&this._moves.push(this._moveFNC),Lr(this.shiftKey,t)&&this._moves.push(this._shiftState),this._moves.push(this._moveState)},e.prototype._moveFNC=function(t){if(t.fnc)return t.fnc=!1,t.previousState===this.key},e.prototype._shiftState=function(t){if(t.previousState===this.shiftKey&&(t.index+1>=t.value.length||this.encoding[this.shiftKey].is(t.value,t.index+1)))return this.encoding.addPattern(this.SHIFT),t.shifted=!0,!0},e.prototype._moveState=function(){return this.encoding.addPattern(this.MOVE),!0},e}(Cf),Tf={};Tf.A=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{key:"A",shiftKey:"B",MOVE:101,START:103})},e.prototype.isCode=function(t){return 0<=t&&t<96},e.prototype.getValue=function(t){return t<32?t+64:t-32},e}(Pf),Tf.B=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{key:"B",shiftKey:"A",MOVE:100,START:104})},e.prototype.isCode=function(t){return 32<=t&&t<128},e.prototype.getValue=function(t){return t-32},e}(Pf),Tf.C=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{key:"C",MOVE:99,START:105})},e.prototype.addStart=function(){this.encoding.addPattern(this.START)},e.prototype.is=function(t,e){var i=Lf(t,e,4);return(e+4<=t.length||2===t.length)&&Af.test(i)},e.prototype.move=function(){this.encoding.addPattern(this.MOVE)},e.prototype.pushState=function(t){for(var e;(e=Lf(t.value,t.index,2))&&Af.test(e)&&2===e.length;)this.encoding.addPattern(parseInt(e,10)),t.index+=2},e.prototype.getValue=function(t){return t},e}(Cf),Tf.FNC4=function(t){function e(e,i){t.call(this,e),this._initSubStates(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{key:"FNC4",dependentStates:["A","B"]})},e.prototype.addStart=function(t){var e=t.value.charCodeAt(0)-128,i=this._getSubState(e);this.encoding[i].addStart()},e.prototype.is=function(t,e){var i=t.charCodeAt(e);return this.isCode(i)},e.prototype.isCode=function(t){return 128<=t&&t<256},e.prototype.pushState=function(t){var e,i=this._initSubState(t),o=this.encoding,r=i.value.length;if(t.index+=r,r<3)for(;i.index<r;i.index++)e=i.value.charCodeAt(i.index),i.state=this._getSubState(e),i.previousState!==i.state&&(i.previousState=i.state,o[i.state].move(i)),o.addPattern(o[i.state].MOVE),o.addPattern(o[i.state].getValue(e));else i.state!==i.previousState&&o[i.state].move(i),this._pushStart(i),o.pushData(i,this.subStates),t.index<t.value.length&&this._pushStart(i);t.fnc=!0,t.state=i.state},e.prototype._pushStart=function(t){this.encoding.addPattern(this.encoding[t.state].MOVE),this.encoding.addPattern(this.encoding[t.state].MOVE)},e.prototype._initSubState=function(t){var e={value:this._getAll(t.value,t.index),index:0};return e.state=this._getSubState(e.value.charCodeAt(0)),e.previousState=t.previousState===this.key?e.state:t.previousState,e},e.prototype._initSubStates=function(t){this.subStates=[];for(var e=0;e<t.length;e++)Lr(t[e],this.dependentStates)&&this.subStates.push(t[e])},e.prototype._getSubState=function(t){for(var e=0;e<this.subStates.length;e++)if(this.encoding[this.subStates[e]].isCode(t))return this.subStates[e]},e.prototype._getAll=function(t,e){for(var i,o="",r=e;(i=t.charCodeAt(r++))&&this.isCode(i);)o+=String.fromCharCode(i-128);return o},e}(Cf),Tf.FNC1=function(t){function e(e,i){t.call(this,e),this.states=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{key:"FNC1",startState:"C",startAI:"(",endAI:")",dependentStates:["C","B"],applicationIdentifiers:{22:{max:29,type:"alphanumeric"},402:{length:17},7004:{max:4,type:"alphanumeric"},242:{max:6,type:"alphanumeric"},8020:{max:25,type:"alphanumeric"},703:{min:3,max:30,type:"alphanumeric"},8008:{min:8,max:12,type:"alphanumeric"},253:{min:13,max:17,type:"alphanumeric"},8003:{min:14,max:30,type:"alphanumeric"},multiKey:[{ids:["15","17","8005","8100"],ranges:[[11,13],[310,316],[320,336],[340,369]],type:{length:6}},{ids:["240","241","250","251","400","401","403","7002","8004","8007","8110"],ranges:[[-9]],type:{max:30,type:"alphanumeric"}},{ids:["7001"],ranges:[[410,414]],type:{length:13}},{ids:["10","21","254","420","8002"],type:{max:20,type:"alphanumeric"}},{ids:["00","8006","8017","8018"],type:{length:18}},{ids:["01","02","8001"],type:{length:14}},{ids:["422"],ranges:[[424,426]],type:{length:3}},{ids:["20","8102"],type:{length:2}},{ids:["30","37"],type:{max:8,type:"alphanumeric"}},{ids:["390","392"],type:{max:15,type:"alphanumeric"}},{ids:["421","423"],type:{min:3,max:15,type:"alphanumeric"}},{ids:["391","393"],type:{min:3,max:18,type:"alphanumeric"}},{ids:["7003","8101"],type:{length:10}}]},START:102})},e.prototype.addStart=function(){this.encoding[this.startState].addStart()},e.prototype.is=function(){return Lr(this.key,this.states)},e.prototype.pushState=function(t){var e,i,o,r=this.encoding,n=t.value.replace(/\s/g,""),s=new RegExp("["+this.startAI+this.endAI+"]","g"),a=t.index,p={state:this.startState};r.addPattern(this.START);for(;;){if(p.index=0,(e=(o=n.charAt(a)===this.startAI?2:0)>0?this.getBySeparator(n,a):this.getByLength(n,a)).ai.length)i=a+o+e.id.length+e.ai.length;else if((i=n.indexOf(this.startAI,a+1))<0){if(a+e.ai.max+e.id.length+o<n.length)throw new Error("Separators are required after variable length identifiers");i=n.length}if(p.value=n.substring(a,i).replace(s,""),this.validate(e,p.value),r.pushData(p,this.dependentStates),i>=n.length)break;a=i,p.state!==this.startState&&(r[this.startState].move(p),p.state=this.startState),e.ai.length||r.addPattern(this.START)}t.index=t.value.length},e.prototype.validate=function(t,e){var i=e.substr(t.id.length),o=t.ai;if(!o.type&&!Af.test(i))throw new Error("Application identifier "+t.id+" is numeric only but contains non numeric character(s).");if("alphanumeric"===o.type&&!Sf.test(i))throw new Error("Application identifier "+t.id+" is alphanumeric only but contains non alphanumeric character(s).");if(o.length&&o.length!==i.length)throw new Error("Application identifier "+t.id+" must be "+o.length+" characters long.");if(o.min&&o.min>i.length)throw new Error("Application identifier "+t.id+" must be at least "+o.min+" characters long.");if(o.max&&o.max<i.length)throw new Error("Application identifier "+t.id+" must be at most "+o.max+" characters long.")},e.prototype.getByLength=function(t,e){for(var i,o,r=2;r<=4;r++)if(i=Lf(t,e,r),o=this.getApplicationIdentifier(i)||this.getApplicationIdentifier(i.substring(0,i.length-1)))return{id:i,ai:o};this.unsupportedAIError(i)},e.prototype.unsupportedAIError=function(t){throw new Error("'"+t+"' is not a supported Application Identifier")},e.prototype.getBySeparator=function(t,e){var i=t.indexOf(this.startAI,e),o=t.indexOf(this.endAI,i),r=t.substring(i+1,o),n=this.getApplicationIdentifier(r)||this.getApplicationIdentifier(r.substr(r.length-1));return n||this.unsupportedAIError(r),{ai:n,id:r}},e.prototype.getApplicationIdentifier=function(t){var e=this.applicationIdentifiers,i=e.multiKey;if(e[t])return e[t];for(var o=0;o<i.length;o++){if(i[o].ids&&Lr(t,i[o].ids))return i[o].type;if(i[o].ranges)for(var r=i[o].ranges,n=0;n<r.length;n++)if(r[n][0]<=t&&t<=r[n][1])return i[o].type}},e}(Cf);var Mf=function(t){function e(e){t.call(this,e),this._initStates()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{characterMap:[212222,222122,222221,121223,121322,131222,122213,122312,132212,221213,221312,231212,112232,122132,122231,113222,123122,123221,223211,221132,221231,213212,223112,312131,311222,321122,321221,312212,322112,322211,212123,212321,232121,111323,131123,131321,112313,132113,132311,211313,231113,231311,112133,112331,132131,113123,113321,133121,313121,211331,231131,213113,213311,213131,311123,311321,331121,312113,312311,332111,314111,221411,431111,111224,111422,121124,121421,141122,141221,112214,112412,122114,122411,142112,142211,241211,221114,413111,241112,134111,111242,121142,121241,114212,124112,124211,411212,421112,421211,212141,214121,412121,111143,111341,131141,114113,114311,411113,411311,113141,114131,311141,411131,211412,211214,211232,2331112],STOP:106})},e.prototype._initStates=function(){for(var t=0;t<this.states.length;t++)this[this.states[t]]=new Tf[this.states[t]](this,this.states)},e.prototype.initValue=function(t,e,i){this.pattern=[],this.value=t,this.width=e,this.height=i,this.checkSum=0,this.totalUnits=0,this.index=0,this.position=1},e.prototype.addData=function(){var t={value:this.value,index:0,state:""};0!==this.value.length&&(t.state=t.previousState=this.getNextState(t,this.states),this.addStart(t),this.pushData(t,this.states),this.addCheckSum(),this.addStop(),this.setBaseUnit())},e.prototype.pushData=function(t,e){for(;this[t.state].pushState(t),!(t.index>=t.value.length);)if(t.shifted){var i=t.state;t.state=t.previousState,t.previousState=i,t.shifted=!1}else t.previousState=t.state,t.state=this.getNextState(t,e),this[t.state].move(t)},e.prototype.addStart=function(t){this[t.state].addStart(t),this.position=1},e.prototype.addCheckSum=function(){this.checksum=this.checkSum%103,this.addPattern(this.checksum)},e.prototype.addStop=function(){this.addPattern(this.STOP)},e.prototype.setBaseUnit=function(){this.baseUnit=this.width/(this.totalUnits+this.quietZoneLength)},e.prototype.addPattern=function(t){for(var e,i=this.characterMap[t].toString(),o=0;o<i.length;o++)e=parseInt(i.charAt(o),10),this.pattern.push(e),this.totalUnits+=e;this.checkSum+=t*this.position++},e.prototype.getNextState=function(t,e){for(var i=0;i<e.length;i++)if(this[e[i]].is(t.value,t.index))return e[i];this.invalidCharacterError(t.value.charAt(t.index))},e}(hf),Of=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{name:"Code 128 A",states:["A"]})},e}(Mf),Rf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{name:"Code 128 B",states:["B"]})},e}(Mf),Bf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{name:"Code 128 C",states:["C"]})},e}(Mf),jf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{name:"Code 128",states:["C","B","A","FNC4"]})},e}(Mf),If=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),kf(this,{name:"Code GS1-128",states:["FNC1","C","B"]})},e}(Mf);function Lf(t,e,i){return t.substring(e,e+i)}var zf=Object.assign,Ef=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),zf(this,{characterMap:["12121212","12121221","12122112","12122121","12211212","12211221","12212112","12212121","21121212","21121221"],START:"21",STOP:"121",checkSumType:"",checkSums:Hf})},e.prototype.initValue=function(t,e){this.pattern=[],this.value=t,this.checkSumLength=0,this.width=e},e.prototype.setBaseUnit=function(){this.baseUnit=this.width/(12*(this.value.length+this.checkSumLength)+this.quietZoneLength+7)},e.prototype.addData=function(){var t=this.value;this.addPattern(this.START);for(var e=0;e<t.length;e++)this.addCharacter(t.charAt(e));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.STOP),this.setBaseUnit()},e.prototype.addCharacter=function(t){var e=this.characterMap[t];e||this.invalidCharacterError(t),this.addPattern(e)},e.prototype.addPattern=function(t){for(var e=0;e<t.length;e++)this.pattern.push(parseInt(t.charAt(e),10))},e.prototype.addCheckSum=function(){var t=this.checkSums[this.checkSumType].call(this.checkSums,this.value);this.checksum=t.join("");for(var e=0;e<t.length;e++)this.checkSumLength++,this.addPattern(this.characterMap[t[e]])},e}(hf),Vf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),zf(this,{name:"MSI Modulo10",checkSumType:"Modulo10"})},e}(Ef),Ff=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),zf(this,{name:"MSI Modulo11",checkSumType:"Modulo11"})},e}(Ef),Df=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),zf(this,{name:"MSI Modulo10 Modulo10",checkSumType:"Modulo10Modulo10"})},e}(Ef),Uf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),zf(this,{name:"MSI Modulo11 Modulo10",checkSumType:"Modulo11Modulo10"})},e}(Ef),Hf={Modulo10:function(t){var e,i,o,r=[0,""],n=t.length%2;for(e=0;e<t.length;e++)r[(e+n)%2]+=parseInt(t.charAt(e),10);for(o=r[0],i=(2*r[1]).toString(),e=0;e<i.length;e++)o+=parseInt(i.charAt(e),10);return[(10-o%10)%10]},Modulo11:function(t){for(var e,i=0,o=t.length,r=0;r<o;r++)i+=(((o-r)%6||6)+1)*t.charAt(r);return 10!==(e=(11-i%11)%11)?[e]:[1,0]},Modulo11Modulo10:function(t){var e,i=this.Modulo11(t);return e=t+i[0],i.concat(this.Modulo10(e))},Modulo10Modulo10:function(t){var e,i=this.Modulo10(t);return e=t+i[0],i.concat(this.Modulo10(e))}},Gf=Object.assign,Nf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),Gf(this,{name:"EAN 13",keyTable:["000000","001011","001101","001110","010011","011001","011100","010101","010110","011010"],characterMap:{digits:[[3,2,1,1],[2,2,2,1],[2,1,2,2],[1,4,1,1],[1,1,3,2],[1,2,3,1],[1,1,1,4],[1,3,1,2],[1,2,1,3],[3,1,1,2]],start:[1,1,1],middle:[1,1,1,1,1]}})},e.prototype.initValue=function(t,e,i){var o=String(t);if(12!==o.length||/\D/.test(o))throw new Error('The value of the "EAN13" encoding should be 12 symbols');this.pattern=[],this.options.height=i,this.baseUnit=e/(95+this.quietZoneLength),this.value=o,this.checksum=this.calculateChecksum(),this.leftKey=o[0],this.leftPart=o.substr(1,6),this.rightPart=o.substr(7)+this.checksum},e.prototype.addData=function(){this.addPieces(this.characterMap.start),this.addSide(this.leftPart,this.leftKey),this.addPieces(this.characterMap.middle),this.addSide(this.rightPart),this.addPieces(this.characterMap.start)},e.prototype.addSide=function(t,e){for(var i=0;i<t.length;i++)e&&parseInt(this.keyTable[e].charAt(i),10)?this.addPieces(Array.prototype.slice.call(this.characterMap.digits[t.charAt(i)]).reverse(),!0):this.addPieces(this.characterMap.digits[t.charAt(i)],!0)},e.prototype.addPieces=function(t,e){for(var i=0;i<t.length;i++)e?this.pattern.push({y1:0,y2:.95*this.options.height,width:t[i]}):this.pattern.push(t[i])},e.prototype.calculateChecksum=function(){for(var t=0,e=0,i=this.value.split("").reverse().join(""),o=0;o<i.length;o++)o%2?e+=parseInt(i.charAt(o),10):t+=parseInt(i.charAt(o),10);return(10-(3*t+e)%10)%10},e}(hf),Wf=Object.assign,qf=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.initProperties=function(){t.prototype.initProperties.call(this),Wf(this,{name:"EAN 8"})},e.prototype.initValue=function(t,e,i){if(7!==t.length||/\D/.test(t))throw new Error("Invalid value provided");this.value=t,this.options.height=i,this.checksum=this.calculateChecksum(this.value),this.leftPart=this.value.substr(0,4),this.rightPart=this.value.substr(4)+this.checksum,this.pattern=[],this.baseUnit=e/(67+this.quietZoneLength)},e}(Nf),Xf={code11:lf,code39:df,code39extended:vf,code93:mf,code93extended:xf,code128:jf,code128a:Of,code128b:Rf,code128c:Bf};Xf["gs1-128"]=If,Xf.msimod10=Vf,Xf.msimod11=Ff,Xf.msimod1010=Df,Xf.msimod1110=Uf,Xf.postnet=wf,Xf.ean8=qf,Xf.ean13=Nf;var Yf=function(t){function e(e,i){t.call(this),this.options=or({},this.options,i),this.element=e,this._initElement(),this._initSurface(),this._setOptions(i),i&&Nr(i.value)&&this.redraw()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){this._destroySurface()},e.prototype._initElement=function(){P(this.element,"k-barcode"),this.element.style.display="block"},e.prototype._initSurface=function(){var t=this.options,e=this.surface;e&&e.options.type===t.renderAs||(this._destroySurface(),this._initSurfaceElement(),this.surface=this._createSurface())},e.prototype._createSurface=function(){return a.Surface.create(this.surfaceElement,{type:this.options.renderAs})},e.prototype._destroySurface=function(){this.surface&&(this.surface.destroy(),this.surface=null,this._destroySurfaceElement())},e.prototype._initSurfaceElement=function(){this.surfaceElement||(this.surfaceElement=document.createElement("div"),this.surfaceElement.style.position="relative",this.element.appendChild(this.surfaceElement))},e.prototype._destroySurfaceElement=function(){this.surfaceElement&&this.surfaceElement.parentNode&&(this.surfaceElement.parentNode.removeChild(this.surfaceElement),this.surfaceElement=null)},e.prototype.setOptions=function(t){this._setOptions(t),this.redraw()},e.prototype.redraw=function(){var t=this._getSize();this.surface.clear(),this.surface.setSize({width:t.width,height:t.height}),this.createVisual(),this.surface.draw(this.visual)},e.prototype.getSize=function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},e.prototype._resize=function(){this.redraw()},e.prototype.createVisual=function(){this.visual=this._render()},e.prototype._render=function(){var t,e,i=this.options,o=i.value,r=i.text,n=hr(r.margin),s=this._getSize(),p=i.border||{},h=this.encoding,c=new kn(0,0,s.width,s.height).unpad(p.width).unpad(i.padding),l=c.height(),u=new a.Group;return this.contentBox=c,u.append(this._getBackground(s)),r.visible&&(l-=a.util.measureText(o,{font:r.font}).height+n.top+n.bottom),t=h.encode(o,c.width(),l),r.visible&&(e=o,i.checksum&&Nr(h.checksum)&&(e+=" "+h.checksum),u.append(this._getText(e))),this.barHeight=l,this._bandsGroup=this._getBands(t.pattern,t.baseUnit),u.append(this._bandsGroup),u},e.prototype.exportVisual=function(){return this._render()},e.prototype._getSize=function(){var t=this.element,e=t.clientWidth,i=t.clientHeight,o=new p.Size(300,100);return e>0&&(o.width=e),i&&(o.height=i),this.options.width&&(o.width=this.options.width),this.options.height&&(o.height=this.options.height),o},e.prototype.value=function(t){if(!Nr(t))return this.options.value;this.options.value=String(t),this.redraw()},e.prototype._getBands=function(t,e){for(var i,o,r=this.contentBox,n=r.x1,s=new a.Group,h=0;h<t.length;h++){if(i=(o=rr(t[h])?t[h]:{width:t[h],y1:0,y2:this.barHeight}).width*e,h%2){var c=p.Rect.fromPoints(new p.Point(n,o.y1+r.y1),new p.Point(n+i,o.y2+r.y1)),l=a.Path.fromRect(c,{fill:{color:this.options.color},stroke:null});s.append(l)}n+=i}return s},e.prototype._getBackground=function(t){var e=this.options,i=e.border||{},o=new kn(0,0,t.width,t.height).unpad(i.width/2);return a.Path.fromRect(o.toRect(),{fill:{color:e.background},stroke:{color:i.width?i.color:"",width:i.width,dashType:i.dashType}})},e.prototype._getText=function(t){var e=this.options.text,i=this._textbox=new Yn(t,{font:e.font,color:e.color,align:"center",vAlign:"bottom",margin:e.margin});return i.reflow(this.contentBox),i.renderVisual(),i.visual},e.prototype._setOptions=function(t){if(this.type=(t.type||this.options.type).toLowerCase(),"upca"===this.type&&(this.type="ean13",t.value="0"+t.value),"upce"===this.type&&(this.type="ean8",t.value="0"+t.value),!Xf[this.type])throw new Error("Encoding "+this.type+" is not supported.");this.encoding=new Xf[this.type],this.options=or({},this.options,t)},e}(O);sn(Yf,{name:"Barcode",renderAs:"svg",value:"",type:"code39",checksum:!1,width:0,height:0,color:"black",background:"white",text:{visible:!0,font:"16px Consolas, Monaco, Sans Mono, monospace, sans-serif",color:"black",margin:{top:0,bottom:0,left:0,right:0}},border:{width:0,dashType:"solid",color:"black"},padding:{top:0,bottom:0,left:0,right:0}});var Zf=Yf,Kf="Arial, Helvetica, sans-serif",Jf="12px "+Kf,$f="16px "+Kf,Qf=function(){return{icon:{border:{width:1}},label:{font:Jf,padding:3},line:{length:10,width:2},visible:!0}},td=function(t){return{visible:!0,labels:{font:"11px Arial, Helvetica, sans-serif"},overlay:t.gradients?{}:{gradient:"none"},area:{highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.4},rangeArea:{highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.4},verticalRangeArea:{highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.4},bar:{gap:1.5,spacing:.4},boxPlot:{outliersField:"",meanField:"",border:{_brightness:.8,width:1},downColor:"#fff",gap:1,highlight:{border:{opacity:1,width:2},whiskers:{width:3},mean:{width:2},median:{width:2}},mean:{width:2},median:{width:2},spacing:.3,whiskers:{width:2}},bubble:{border:{width:0},labels:{background:"transparent"},opacity:.6},bullet:{gap:1.5,spacing:.4,target:{color:"#ff0000"}},candlestick:{border:{_brightness:.8,width:1},downColor:"#fff",gap:1,highlight:{border:{opacity:1,width:2},line:{width:2}},line:{color:"#000",width:1},spacing:.3},column:{gap:1.5,spacing:.4},heatmap:{labels:{color:"",background:"transparent",visible:!0},highlight:{border:{width:0}}},pie:{labels:{background:"",color:"",padding:{top:5,bottom:5,left:7,right:7}}},donut:{margin:1},funnel:{labels:{background:"",color:"",padding:{top:5,bottom:5,left:7,right:7}}},horizontalWaterfall:{gap:.5,line:{color:"#000",width:1},spacing:.4},line:{width:2},notes:Qf(),ohlc:{gap:1,highlight:{line:{opacity:1,width:3}},line:{width:1},spacing:.3},radarArea:{line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.5},radarLine:{markers:{visible:!1},width:2},polarArea:{line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.5},polarLine:{markers:{visible:!1},width:2},rangeBar:{gap:1.5,spacing:.4},rangeColumn:{gap:1.5,spacing:.4},scatterLine:{width:1},verticalArea:{highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.4},verticalBoxPlot:{outliersField:"",meanField:"",border:{_brightness:.8,width:1},downColor:"#fff",gap:1,highlight:{border:{opacity:1,width:2},whiskers:{width:3},mean:{width:2},median:{width:2}},mean:{width:2},median:{width:2},spacing:.3,whiskers:{width:2}},verticalBullet:{gap:1.5,spacing:.4,target:{color:"#ff0000"}},verticalLine:{width:2},waterfall:{gap:.5,line:{color:"#000",width:1},spacing:.4}}},ed=function(t){return void 0===t&&(t={}),{axisDefaults:{labels:{font:Jf},notes:Qf(),title:{font:$f,margin:5}},categoryAxis:{majorGridLines:{visible:!0}},navigator:{pane:{height:90,margin:{top:10}}},seriesDefaults:td(t),title:{font:$f},legend:{labels:{font:Jf}}}}}})}));
|