var DvtGauge=function(){};DvtObj.createSubclass(DvtGauge,DvtContainer,"DvtGauge");DvtGauge._DEFAULT_MIN_VALUE=0;DvtGauge._DEFAULT_MAX_VALUE=100;
DvtGauge.prototype.Init=function(a,b,d,e){DvtGauge.superclass.Init.call(this,a);this._callback=b;this._callbackObj=d;this.setOptions(e);this.Bundle=new DvtGaugeBundle;this._eventHandler=new DvtGaugeEventManager(this);this._eventHandler.addListeners(this);this.setId("gauge1000"+Math.floor(1E4*Math.random()));this._editingOverlay=new DvtRect(a,0,0);this._editingOverlay.setFill(new DvtSolidFill("#000000",0.0010));this.addChild(this._editingOverlay);this._bEditing=!1;this._oldValue=null};
DvtGauge.prototype.setOptions=function(a){this.Options=a;if(this.getContext()instanceof DvtXmlContext||this.getContext()instanceof DvtCanvasContext)this.Options.animationOnDisplay="none",this.Options.animationOnDataChange="none"};
DvtGauge.prototype.render=function(a,b,d){this.Data=a?DvtJSONUtils.clone(a):this.Data;this.Data||(this.Data={});isNaN(this.Data.minValue)&&(this.Data.minValue=DvtGauge._DEFAULT_MIN_VALUE);isNaN(this.Data.maxValue)&&(this.Data.maxValue=DvtGauge._DEFAULT_MAX_VALUE);!isNaN(b)&&!isNaN(d)&&(this.Width=b,this.Height=d);this.Data.thresholds&&(this.Data.thresholds=this.Data.thresholds.sort(DvtGauge._thresholdComparator));b=this.__shapes;this.__shapes=[];d=new DvtContainer(this.getContext());this.addChildAt(d,
0);this.Render(d,this.Width,this.Height);this._setAnimation(d,a,b,this.Width,this.Height);!1===this.Options.readOnly&&DvtAgent.getAgent().isTouchDevice()?(this._editingOverlay.setWidth(this.Width),this._editingOverlay.setHeight(this.Height)):(this._editingOverlay.setWidth(0),this._editingOverlay.setHeight(0));d.setAriaRole("img");d.setAriaProperty("label",this.Data.shortDesc?this.Data.shortDesc:this.Data.tooltip);this.getContext().queueRender()};DvtGauge.prototype.Render=function(){};
DvtGauge.prototype._setAnimation=function(a,b,d,e,g){this._animation&&this._animation.stop();var h=!1,k=this._bEditing?"none":this.Options.animationOnDataChange,m=this._bEditing?"none":this.Options.animationOnDisplay,n=this.Options.animationDuration/1E3;if(m||k)e=new DvtRectangle(0,0,e,g),g=this.getContext(),!this._container&&"none"!==m?(this._animation=DvtBlackBoxAnimationHandler.getInAnimation(g,m,a,e,n),this._animation||(this._animation=this.CreateAnimationOnDisplay(this.__shapes,m,n))):this._container&&
"none"!=k&&b&&((this._animation=DvtBlackBoxAnimationHandler.getCombinedAnimation(g,k,this._container,a,e,n))?h=!0:this._animation=this.CreateAnimationOnDataChange(d,this.__shapes,m,n)),h||this.removeChild(this._container),this._animation&&(this._animation.play(),this._animation.setOnEnd(this._onAnimationEnd,this)),h&&(this._oldContainer=this._container),this._container=a};DvtGauge.prototype.CreateAnimationOnDisplay=function(){return null};
DvtGauge.prototype.CreateAnimationOnDataChange=function(a,b,d,e){for(var d=[],g=0;g<a.length;g++){var h=b[g],k=a[g].getAnimationParams(),m=h.getAnimationParams();h.setAnimationParams(k);k=new DvtCustomAnimation(this.getContext(),h,e);k.getAnimator().addProp(DvtAnimator.TYPE_NUMBER_ARRAY,h,h.getAnimationParams,h.setAnimationParams,m);d.push(k)}return new DvtParallelPlayable(this.getContext(),d)};DvtGauge.prototype.GetValueAt=function(){return null};
DvtGauge.prototype._onAnimationEnd=function(){this._oldContainer&&(this.removeChild(this._oldContainer),this._oldContainer=null);this._animation=null};DvtGauge.prototype.__dispatchEvent=function(a){DvtEventDispatcher.dispatchEvent(this._callback,this._callbackObj,this,a)};DvtGauge.prototype.__getBundle=function(){return this.Bundle};DvtGauge.prototype.__getData=function(){return this.Data?this.Data:{}};DvtGauge.prototype.__getOptions=function(){return this.Options};
DvtGauge.prototype.__getEventManager=function(){return this._eventHandler};DvtGauge.prototype.__processValueChangeStart=function(a,b){this._bEditing=!0;this._oldValue=this.Data.value;this.__processValueChangeMove(a,b)};DvtGauge.prototype.__processValueChangeMove=function(a,b){this.Data.value=this.GetValueAt(a,b);this.render()};
DvtGauge.prototype.__processValueChangeEnd=function(a,b){this.__processValueChangeMove(a,b);this.__dispatchEvent(new DvtValueChangeEvent(this._oldValue,this.Data.value));this._bEditing=!1;this._oldValue=null};DvtGauge._thresholdComparator=function(a,b){return a.maxValue&&b.maxValue?Math.abs(a.maxValue)-Math.abs(b.maxValue):a.maxValue?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY};var DvtGaugeBundle=function(){};DvtObj.createSubclass(DvtGaugeBundle,DvtBundle,"DvtGaugeBundle");
DvtGaugeBundle.prototype.EMPTY_TEXT="No data to display";DvtGaugeBundle.prototype.SCALING_SUFFIX_THOUSAND="K";DvtGaugeBundle.prototype.SCALING_SUFFIX_MILLION="M";DvtGaugeBundle.prototype.SCALING_SUFFIX_BILLION="B";DvtGaugeBundle.prototype.SCALING_SUFFIX_TRILLION="T";DvtGaugeBundle.prototype.SCALING_SUFFIX_QUADRILLION="Q";var DvtGaugeDefaults={};DvtObj.createSubclass(DvtGaugeDefaults,DvtObj,"DvtGaugeDefaults");
DvtGaugeDefaults.VERSION_1={color:"#313842",borderColor:null,visualEffects:"auto",emptyText:null,animationOnDataChange:"none",animationOnDisplay:"none",animationDuration:1E3,readOnly:"true",metricLabel:{autoPrecision:"on",rendered:!1,labelStyle:"font-size: 13px; color: #333333;",scaling:"none"},__layout:{outerGap:1,labelGap:3}};DvtGaugeDefaults.getDefaults=function(){return DvtJSONUtils.clone(DvtGaugeDefaults.VERSION_1)};var DvtGaugeDataUtils={};DvtObj.createSubclass(DvtGaugeDataUtils,DvtObj,"DvtGaugeDataUtils");
DvtGaugeDataUtils.hasData=function(a){a=a.__getData();return!a||isNaN(a.value)||null===a.value?!1:!0};DvtGaugeDataUtils.getValueThresholdIndex=function(a){var b=a.__getData(),a=b.value,b=b?b.thresholds:null;if(!b)return-1;for(var d=0;d<b.length;d++)if(a<=b[d].maxValue)return d;return b.length-1};DvtGaugeDataUtils.getThreshold=function(a,b){var d=a.__getData();return(d=d?d.thresholds:null)&&0<=b&&b<d.length?d[b]:null};
DvtGaugeDataUtils.getReferenceObject=function(a,b){var d=a.__getData();return(d=d?d.referenceObjects:null)&&0<=b&&b<d.length?d[b]:null};var DvtGaugeEventManager=function(a){this.Init(a.getContext(),a.__dispatchEvent,a);this._gauge=a;this._bEditing=!1};DvtObj.createSubclass(DvtGaugeEventManager,DvtEventManager,"DvtGaugeEventManager");
DvtGaugeEventManager.prototype.OnMouseDown=function(a){!1===this._gauge.__getOptions().readOnly?(this._bEditing=!0,this.hideTooltip(),a=this.getContext().getRelativePosition(a.pageX,a.pageY),this._gauge.__processValueChangeStart(a.x,a.y)):DvtGaugeEventManager.superclass.OnMouseDown.call(this,a)};
DvtGaugeEventManager.prototype.OnMouseUp=function(a){this._bEditing?(this._bEditing=!1,a=this.getContext().getRelativePosition(a.pageX,a.pageY),this._gauge.__processValueChangeEnd(a.x,a.y)):DvtGaugeEventManager.superclass.OnMouseUp.call(this,a)};
DvtGaugeEventManager.prototype.OnMouseMove=function(a){if(this._bEditing){var b=this.getContext().getRelativePosition(a.pageX,a.pageY);this._gauge.__processValueChangeMove(b.x,b.y)}(this.IsShowingTooltipWhileEditing()||!this._bEditing)&&DvtGaugeEventManager.superclass.OnMouseMove.call(this,a)};DvtGaugeEventManager.prototype.IsShowingTooltipWhileEditing=function(){return!1};
DvtGaugeEventManager.prototype.PreEventBubble=function(a){if("touchstart"===a.type&&!1===this._gauge.__getOptions().readOnly){this._bEditing=!0;var b=this.getContext().getRelativePosition(a.touches[0].pageX,a.touches[0].pageY);this._gauge.__processValueChangeStart(b.x,b.y);a.preventDefault()}else"touchmove"===a.type&&this._bEditing?(b=this.getContext().getRelativePosition(a.touches[0].pageX,a.touches[0].pageY),this._gauge.__processValueChangeMove(b.x,b.y),a.preventDefault()):"touchend"===a.type&&
this._bEditing?(this._bEditing=!1,b=this.getContext().getRelativePosition(a.changedTouches[0].pageX,a.changedTouches[0].pageY),this._gauge.__processValueChangeEnd(b.x,b.y),a.preventDefault()):DvtGaugeEventManager.superclass.PreEventBubble.call(this,a)};var DvtGaugeStyleUtils={};DvtObj.createSubclass(DvtGaugeStyleUtils,DvtObj,"DvtGaugeStyleUtils");DvtGaugeStyleUtils._THRESHOLD_COLOR_RAMP=["#D62800","#FFCF21","#84AE31"];
DvtGaugeStyleUtils.getColor=function(a){var b=a.__getOptions(),d=DvtGaugeDataUtils.getValueThresholdIndex(a),e=DvtGaugeDataUtils.getThreshold(a,d);return e&&(!(a instanceof DvtStatusMeterGauge)||a instanceof DvtStatusMeterGauge&&"onIndicator"==b.thresholdDisplay)?DvtGaugeStyleUtils.getThresholdColor(e,d):b.color};
DvtGaugeStyleUtils.getBorderColor=function(a){var b=a.__getOptions(),d=DvtGaugeDataUtils.getValueThresholdIndex(a);return(d=DvtGaugeDataUtils.getThreshold(a,d))&&d.borderColor&&(!(a instanceof DvtStatusMeterGauge)||a instanceof DvtStatusMeterGauge&&"onIndicator"==b.thresholdDisplay)?d.borderColor:b.borderColor};
DvtGaugeStyleUtils.getPlotAreaColor=function(a){var b=a.__getOptions(),d=DvtGaugeDataUtils.getValueThresholdIndex(a),e=DvtGaugeDataUtils.getThreshold(a,d);return e&&(!(a instanceof DvtStatusMeterGauge)||a instanceof DvtStatusMeterGauge&&"onIndicator"!=b.thresholdDisplay)?DvtGaugeStyleUtils.getThresholdColor(e,d):b.plotArea.color};DvtGaugeStyleUtils.getThresholdColor=function(a,b){if(a.color)return a.color;if(b<DvtGaugeStyleUtils._THRESHOLD_COLOR_RAMP.length)return DvtGaugeStyleUtils._THRESHOLD_COLOR_RAMP[b]};
var DvtGaugeRenderer={};DvtObj.createSubclass(DvtGaugeRenderer,DvtObj,"DvtGaugeRenderer");DvtGaugeRenderer._EMPTY_TEXT_GAP_WIDTH=2;DvtGaugeRenderer._EMPTY_TEXT_GAP_HEIGHT=1;
DvtGaugeRenderer.renderEmptyText=function(a,b,d){var e=a.__getOptions(),g=e.emptyText;g||(g=a.__getBundle().getRBString(DvtGaugeBundle.EMPTY_TEXT,null,"DvtChartBundle.EMPTY_TEXT"));var h=d.x+d.w/2,k=d.y+d.h/2,m=d.w-2*DvtGaugeRenderer._EMPTY_TEXT_GAP_WIDTH,d=d.h-2*DvtGaugeRenderer._EMPTY_TEXT_GAP_HEIGHT,h=new DvtText(a.getContext(),g,h,k);h.setCSSStyle(new DvtCSSStyle(e.metricLabel.labelStyle));h.alignMiddle();h.alignCenter();if(h=h.truncateToSpace(b,m,d))h.getTextString()!=g&&a.__getEventManager().associate(h,
new DvtSimpleObjPeer(g)),b.addChild(h)};DvtGaugeRenderer.formatLabelValue=function(a,b){var d=b.__getOptions(),e=null;d.metricLabel.rendered&&d.metricLabel.converter&&(e=d.metricLabel.converter);var g=null;d.metricLabel.rendered&&d.metricLabel.scaling&&(g=d.metricLabel.scaling);return DvtGaugeRenderer._formatLabelValue(a,b,e,g,d.metricLabel.autoPrecision?d.metricLabel.autoPrecision:"on")};
DvtGaugeRenderer.formatTickLabelValue=function(a,b){var d=b.__getOptions(),e=null;d.tickLabel.rendered&&d.tickLabel.converter&&(e=d.tickLabel.converter);var g=null;d.tickLabel.rendered&&d.tickLabel.scaling&&(g=d.tickLabel.scaling);return DvtGaugeRenderer._formatLabelValue(a,b,e,g,d.tickLabel.autoPrecision?d.tickLabel.autoPrecision:"on")};
DvtGaugeRenderer._formatLabelValue=function(a,b,d,e){var g=b.__getData();if(d&&d.getAsString&&d.getAsObject)return d.getAsString(a);if(e){var d=g.minValue,g=g.maxValue,h=g-d,k=1E3>h?100:1E3,m=null;isNaN(h)||(m=h/k);return(new DvtLinearScaleAxisValueFormatter(b.__getBundle(),d,g,m,e,"on")).format(a)}return a};
DvtGaugeRenderer.renderLabel=function(a,b,d,e){var g=a.__getData(),h=a.__getOptions();if(h.metricLabel.rendered){var g=""+DvtGaugeRenderer.formatLabelValue(g.value,a),k=d.w,m=d.h,d=new DvtText(a.getContext(),g,d.x+d.w/2,d.y+d.h/2);d.setCSSStyle(new DvtCSSStyle(h.metricLabel.labelStyle));d.alignCenter();d.alignMiddle();d=d.truncateToSpace(b,k,m);null==e&&(e="black");d.setFill(new DvtSolidFill(e));d&&(d.getTextString()!=g&&a.__getEventManager().associate(d,new DvtSimpleObjPeer(g)),b.addChild(d))}};
var DvtLedGauge=function(){};DvtObj.createSubclass(DvtLedGauge,DvtGauge,"DvtLedGauge");DvtLedGauge.newInstance=function(a,b,d,e){var g=new DvtLedGauge;g.Init(a,b,d,e);return g};DvtLedGauge.prototype.setOptions=function(a){DvtLedGauge.superclass.setOptions.call(this,DvtLedGaugeDefaults.calcOptions(a));"auto"==this.Options.animationOnDisplay&&(this.Options.animationOnDisplay="zoom");"auto"==this.Options.animationOnDataChange&&(this.Options.animationOnDataChange="alphaFade");this.Options.readOnly=!0};
DvtLedGauge.prototype.Render=function(a,b,d){DvtLedGaugeRenderer.render(this,a,b,d)};var DvtLedGaugeDefaults={};DvtObj.createSubclass(DvtLedGaugeDefaults,DvtObj,"DvtLedGaugeDefaults");DvtLedGaugeDefaults.VERSION_1={type:"circle",metricLabel:{labelStyle:"font-size: 13px;"}};DvtLedGaugeDefaults.calcOptions=function(a){var b=DvtLedGaugeDefaults._getDefaults(a);return a?DvtJSONUtils.merge(a,b):b};
DvtLedGaugeDefaults._getDefaults=function(a){var a=DvtGaugeDefaults.getDefaults(a),b=DvtJSONUtils.clone(DvtLedGaugeDefaults.VERSION_1);return DvtJSONUtils.merge(b,a)};var DvtLedGaugeRenderer={};DvtObj.createSubclass(DvtLedGaugeRenderer,DvtObj,"DvtLedGaugeRenderer");DvtLedGaugeRenderer.__RECTANGLE_CORNER_RADIUS=1/6;
DvtLedGaugeRenderer._SHAPE_TRIANGLE_CMDS=DvtPathUtils.moveTo(8,86.6)+DvtPathUtils.quadTo(0,86.6,3.46,78.6)+DvtPathUtils.lineTo(46,6.93)+DvtPathUtils.quadTo(50,0,54,6.93)+DvtPathUtils.lineTo(96.54,78.6)+DvtPathUtils.quadTo(100,86.6,92,86.6)+DvtPathUtils.closePath();DvtLedGaugeRenderer._SHAPE_TRIANGLE_INNER_CMDS=DvtPathUtils.moveTo(0,86.6)+DvtPathUtils.lineTo(50,0)+DvtPathUtils.lineTo(100,86.6)+DvtPathUtils.closePath();DvtLedGaugeRenderer._SHAPE_STAR_CMDS="M26.72,48.82L28.094,20.746L45.594,42.738L72.714,35.382L57.2,58.812L72.59,82.328L45.504,74.816L27.894,96.722L26.666,68.652L.398,58.688Z";
DvtLedGaugeRenderer._SHAPE_ARROW_CMDS=DvtPathUtils.moveTo(50,95)+DvtPathUtils.lineTo(71,95)+DvtPathUtils.quadTo(74.414,94.414,75,91)+DvtPathUtils.lineTo(75,60)+DvtPathUtils.lineTo(92,60)+DvtPathUtils.quadTo(98.5,59.1,95,54)+DvtPathUtils.lineTo(52,12)+DvtPathUtils.quadTo(50,11,48,12)+DvtPathUtils.lineTo(5,54)+DvtPathUtils.quadTo(1.5,59.1,8,60)+DvtPathUtils.lineTo(25,60)+DvtPathUtils.lineTo(25,91)+DvtPathUtils.quadTo(25.586,94.414,29,95)+DvtPathUtils.closePath();
DvtLedGaugeRenderer._SHAPE_ARROW_INNER_CMDS=DvtPathUtils.moveTo(75,98)+DvtPathUtils.lineTo(75,58)+DvtPathUtils.lineTo(97.5,58)+DvtPathUtils.lineTo(50,11)+DvtPathUtils.lineTo(2.5,58)+DvtPathUtils.lineTo(25,58)+DvtPathUtils.lineTo(25,98)+DvtPathUtils.closePath();
DvtLedGaugeRenderer.render=function(a,b,d,e){if(DvtGaugeDataUtils.hasData(a)){var g=a.__getOptions(),h=a.__getData(),g=g.__layout.outerGap,h=h&&(0<=h.size||1>h.size)?Math.sqrt(h.size):1,d=new DvtRectangle(g+(d-2*g)*(1-h)/2,g+(e-2*g)*(1-h)/2,(d-2*g)*h,(e-2*g)*h);DvtLedGaugeRenderer._renderShape(a,b,d);DvtLedGaugeRenderer._renderVisualEffects(a,b,d);g=DvtGaugeStyleUtils.getColor(a);e=DvtColorUtils.getRed(g);h=DvtColorUtils.getGreen(g);g=DvtColorUtils.getBlue(g);DvtGaugeRenderer.renderLabel(a,b,DvtLedGaugeRenderer._getLabelBounds(a,
b,d),128<=(299*e+587*h+114*g)/1E3?"#000000":"#FFFFFF")}else DvtGaugeRenderer.renderEmptyText(a,b,new DvtRectangle(0,0,d,e))};
DvtLedGaugeRenderer._renderShape=function(a,b,d){var e=a.getContext(),g=a.__getData(),h=a.__getOptions().type,k=DvtGaugeStyleUtils.getColor(a),m=DvtGaugeStyleUtils.getBorderColor(a),n=d.x+d.w/2,o=d.y+d.h/2,q=Math.min(d.w,d.h)/2,e="rectangle"==h?new DvtRect(e,d.x,d.y,d.w,d.h):"diamond"==h?new DvtPolygon(e,[n-q,o,n,o-q,n+q,o,n,o+q]):"triangle"==h?new DvtPath(e,DvtLedGaugeRenderer._SHAPE_TRIANGLE_CMDS):"star"==h?new DvtPath(e,DvtLedGaugeRenderer._SHAPE_STAR_CMDS):"arrow"==h?new DvtPath(e,DvtLedGaugeRenderer._SHAPE_ARROW_CMDS):
new DvtCircle(e,n,o,q);e.setFill(new DvtSolidFill(k));m&&e.setStroke(new DvtSolidStroke(m));g.tooltip&&a.__getEventManager().associate(e,new DvtSimpleObjPeer(null,g.tooltip,k));e=DvtLedGaugeRenderer._scaleAndRotate(a,b,e,d);b.addChild(e)};
DvtLedGaugeRenderer._scaleAndRotate=function(a,b,d,e){var g=a.__getData(),h=a.__getOptions().type;if(!("triangle"==h||"arrow"==h||"star"==h))return d;var h=new DvtContainer(a.getContext()),k=new DvtContainer(a.getContext());b.addChild(h);h.addChild(k);k.addChild(d);var g=g&&0==g.rotation%90?g.rotation:0,m=new DvtMatrix(a.getContext());m.rotate(Math.PI*(90-g)/180);d.setMatrix(m);g=k.getDimensions();g=Math.min(e.w/g.w,e.h/g.h);m=new DvtMatrix(a.getContext());m.scale(g,g);k.setMatrix(m);m=h.getDimensions();
k=e.x+e.w/2-(m.x+m.w/2);e=e.y+e.h/2-(m.y+m.h/2);a=new DvtMatrix(a.getContext());a.translate(k,e);h.setMatrix(a);b.removeChild(h);if(b=d.getStroke())b=b.clone(),b.setWidth(b.getWidth()/g),d.setStroke(b);return h};
DvtLedGaugeRenderer._renderVisualEffects=function(a,b,d){var e=a.__getOptions(),g=e.type;"none"!=e.visualEffects&&("rectangle"==g?DvtLedGaugeRenderer._renderOverlayRectangle(a,b,d):"diamond"==g?DvtLedGaugeRenderer._renderOverlayDiamond(a,b,d):"triangle"==g?DvtLedGaugeRenderer._renderOverlayTriangle(a,b,d):"star"==g?DvtLedGaugeRenderer._renderOverlayStar(a,b,d):"arrow"==g?DvtLedGaugeRenderer._renderOverlayArrow(a,b,d):DvtLedGaugeRenderer._renderOverlayCircle(a,b,d))};
DvtLedGaugeRenderer._renderOverlayRectangle=function(a,b,d){var e=0.05*d.w,g=0.05*d.h,d=new DvtRectangle(d.x+e,d.y+g,d.w-2*e,d.h-2*g),a=new DvtRect(a.getContext(),d.x,d.y,d.w,d.h);a.setMouseEnabled(!1);b.addChild(a);b=new DvtLinearGradientFill(270,"#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF".split(","),[0.75,0.5,0.15,0,0.2,0.4,0.2],[0,0.05,0.4,0.6,0.8,0.9,1]);a.setFill(b)};
DvtLedGaugeRenderer._renderOverlayDiamond=function(a,b,d){var e=0.05*d.w,g=0.05*d.h,g=new DvtRectangle(d.x+e,d.y+g,d.w-2*e,d.h-2*g),d=g.x+g.w/2,e=g.y+g.h/2,g=Math.min(g.w,g.h)/2,a=new DvtPolygon(a.getContext(),[d-g,e,d,e-g,d+g,e,d,e+g]);a.setMouseEnabled(!1);b.addChild(a);b=new DvtLinearGradientFill(270,"#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF".split(","),[0.75,0.5,0.15,0,0.2,0.4,0.2],[0,0.05,0.4,0.6,0.8,0.9,1]);a.setFill(b)};
DvtLedGaugeRenderer._renderOverlayTriangle=function(a,b,d){var e=0.05*d.w,g=0.05*d.h,d=new DvtRectangle(d.x+e,d.y+g,d.w-2*e,d.h-2*g),e=new DvtPath(a.getContext(),DvtLedGaugeRenderer._SHAPE_TRIANGLE_INNER_CMDS),g=a.__getData(),g=new DvtLinearGradientFill(360-(g&&0==g.rotation%90?g.rotation:0),["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF"],[0.3,0.55,0,0.25,0.1],[0,0.05,0.4,0.9,1]);e.setFill(g);e=DvtLedGaugeRenderer._scaleAndRotate(a,b,e,d);e.setMouseEnabled(!1);b.addChild(e)};
DvtLedGaugeRenderer._renderOverlayArrow=function(a,b,d){var e=0.05*d.w,g=0.05*d.h,d=new DvtRectangle(d.x+e,d.y+g,d.w-2*e,d.h-2*g),e=new DvtPath(a.getContext(),DvtLedGaugeRenderer._SHAPE_ARROW_INNER_CMDS),g=a.__getData(),g=new DvtLinearGradientFill(360-(g&&0==g.rotation%90?g.rotation:0),["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF"],[0.3,0.55,0,0.25,0.1],[0,0.05,0.4,0.9,1]);e.setFill(g);e=DvtLedGaugeRenderer._scaleAndRotate(a,b,e,d);e.setMouseEnabled(!1);b.addChild(e)};
DvtLedGaugeRenderer._renderOverlayStar=function(a,b,d){var e=0.05*d.w,g=0.05*d.h,d=new DvtRectangle(d.x+e,d.y+g,d.w-2*e,d.h-2*g),e=new DvtPath(a.getContext(),DvtLedGaugeRenderer._SHAPE_STAR_CMDS),g=a.__getData(),g=360-(g&&0==g.rotation%90?g.rotation:0),h=DvtGaugeStyleUtils.getColor(a),h=[DvtColorUtils.getDarker(h,0.9),h,DvtColorUtils.getBrighter(h,0.7)],g=new DvtLinearGradientFill(g,h,[1,1,1],[0.1,0.4,0.8]);e.setFill(g);e=DvtLedGaugeRenderer._scaleAndRotate(a,b,e,d);e.setMouseEnabled(!1);b.addChild(e)};
DvtLedGaugeRenderer._renderOverlayCircle=function(a,b,d){var e=0.05*d.w,g=0.05*d.h,d=new DvtRectangle(d.x+e,d.y+g,d.w-2*e,d.h-2*g),e=d.x+d.w/2,g=d.y+d.h/2,h=Math.min(d.w,d.h)/2,k=new DvtCircle(a.getContext(),e,g,h);k.setMouseEnabled(!1);b.addChild(k);var m=new DvtRadialGradientFill(["#FFFFFF","#FFFFFF","#FFFFFF"],[0,0.25,0.5],[0.15,0.7,0.95],e,g-0.6*h,1.5*h,[d.x,d.y,d.w,d.h]);k.setFill(m);k=0.6*h;h*=0.4;g-=0.3*h;a=new DvtOval(a.getContext(),e,g-h,k,h);a.setMouseEnabled(!1);b.addChild(a);b=new DvtRadialGradientFill(["#FFFFFF",
"#FFFFFF","#FFFFFF"],[0,0.2,0.5],[0.6,0.8,1],e,g,k,[d.x,d.y,d.w,d.h]);a.setFill(b)};DvtLedGaugeRenderer._getLabelBounds=function(a,b,d){var b=a.__getOptions().type,a=(a=a.__getData())&&0==a.rotation%90?a.rotation:0,e=Math.min(d.w,d.h),g=d.x,h=d.y;"triangle"==b?0==a?g-=0.12*e:90==a?h+=0.15*e:180==a?g+=0.12*e:270==a&&(h-=0.15*e):"arrow"==b?0==a?g-=0.14*e:180==a&&(g+=0.14*e):"star"==b&&(h+=0.06*e);return new DvtRectangle(g,h,d.w,d.h)};var DvtStatusMeterGauge=function(){};
DvtObj.createSubclass(DvtStatusMeterGauge,DvtGauge,"DvtStatusMeterGauge");DvtStatusMeterGauge.newInstance=function(a,b,d,e){var g=new DvtStatusMeterGauge;g.Init(a,b,d,e);return g};DvtStatusMeterGauge.prototype.Init=function(a,b,d,e){DvtStatusMeterGauge.superclass.Init.call(this,a,b,d,e);this.__axisInfo=null};DvtStatusMeterGauge.prototype.setOptions=function(a){DvtStatusMeterGauge.superclass.setOptions.call(this,DvtStatusMeterGaugeDefaults.calcOptions(a))};
DvtStatusMeterGauge.prototype.Render=function(a,b,d){DvtStatusMeterGaugeRenderer.render(this,a,b,d)};
DvtStatusMeterGauge.prototype.CreateAnimationOnDisplay=function(a,b,d){for(var b=[],e=0;e<a.length;e++){var g=a[e],h=g.getAnimationParams();g.setAnimationParams([h[0],h[0],h[2],h[3]]);var k=new DvtCustomAnimation(this.getContext(),g,d);k.getAnimator().addProp(DvtAnimator.TYPE_NUMBER_ARRAY,g,g.getAnimationParams,g.setAnimationParams,h);k.getAnimator().setEasing(function(a){return DvtEasing.backOut(a,0.7)});b.push(k)}return new DvtParallelPlayable(this.getContext(),b)};
DvtStatusMeterGauge.prototype.GetValueAt=function(a){return this.__axisInfo.getBoundedValueAt(a)};var DvtStatusMeterGaugeDefaults={};DvtObj.createSubclass(DvtStatusMeterGaugeDefaults,DvtObj,"DvtStatusMeterGaugeDefaults");DvtStatusMeterGaugeDefaults.VERSION_1={color:"#313842",plotArea:{color:"#AAAAAA",borderColor:"#C6C6C6",rendered:"auto"},thresholdDisplay:"onIndicator",indicatorSize:1};
DvtStatusMeterGaugeDefaults.calcOptions=function(a){var b=DvtStatusMeterGaugeDefaults._getDefaults(a);return a?DvtJSONUtils.merge(a,b):b};DvtStatusMeterGaugeDefaults._getDefaults=function(a){var a=DvtGaugeDefaults.getDefaults(a),b=DvtJSONUtils.clone(DvtStatusMeterGaugeDefaults.VERSION_1);return DvtJSONUtils.merge(b,a)};var DvtStatusMeterGaugeRenderer={};DvtObj.createSubclass(DvtStatusMeterGaugeRenderer,DvtObj,"DvtStatusMeterGaugeRenderer");
DvtStatusMeterGaugeRenderer.render=function(a,b,d,e){if(DvtGaugeDataUtils.hasData(a)){var g=a.__getOptions().__layout.outerGap,d=new DvtRectangle(g,g,d-2*g,e-2*g);DvtStatusMeterGaugeRenderer._renderLabel(a,b,d);DvtStatusMeterGaugeRenderer._renderShape(a,b,d)}else DvtGaugeRenderer.renderEmptyText(a,b,new DvtRectangle(0,0,d,e))};
DvtStatusMeterGaugeRenderer._renderShape=function(a,b,d){var e=a.__getData(),g=a.__getOptions(),h=DvtStyleUtils.isLocaleR2L(),k={layout:{}};k.layout.gapRatio=0;k.timeAxisType="disabled";k.position="bottom";k.minValue=e.minValue;k.maxValue=e.maxValue;var m={};m.minDataValue=e.minValue;m.maxDataValue=e.maxValue;k=DvtAxisInfo.newInstance(m,k,d);a.__axisInfo=k;var n=0;0>e.maxValue?n=e.maxValue:0<e.minValue&&(n=e.minValue);var o=k.getCoordAt(n),q=k.getUnboundedCoordAt(e.value),q=Math.max(d.x,Math.min(d.x+
d.w,q)),s=0,s=0>e.minValue&&0>e.value?k.getUnboundedCoordAt(e.minValue):k.getUnboundedCoordAt(e.maxValue),s=Math.max(d.x,Math.min(d.x+d.w,s)),t=d.y,u=d.y+d.h,v=d.y+(1-g.indicatorSize)/2*d.h,w=d.y+d.h*(1-(1-g.indicatorSize)/2),x=!0;q==o&&(x=!1);var y=DvtGaugeStyleUtils.getBorderColor(a),z=g.plotArea.borderColor,A=e?e.thresholds:null;if(A&&"off"!=g.plotArea.rendered&&"all"==g.thresholdDisplay)for(m=A.length-1;0<=m;m--){var F=m,C=DvtStatusMeterGaugeRenderer._createShape(a.getContext(),o,s,t,u,!0),E=
new DvtClipPath("pacp"+a.getId()+m);F==A.length-1?E.addRect(0,0,d.w+2,u-t+2,0,0):h?E.addRect(0,0,1*(e.maxValue-A[A.length-2-F].maxValue)/Math.abs(n-e.maxValue)*d.w,u-t+2,0,0):E.addRect(0,0,1*A[F].maxValue/Math.abs(n-e.maxValue)*d.w,u-t+2,0,0);C.setClipPath(E);h&&(currentTresholdIndex=A.length-1-m);C.setFill(new DvtSolidFill(DvtGaugeStyleUtils.getThresholdColor(A[F],F)));C.setStroke(new DvtSolidStroke(z));DvtStatusMeterGaugeRenderer._renderPlotAreaVisualEffects(a,b,C,DvtGaugeStyleUtils.getThresholdColor(A[F],
F))}else"off"!=g.plotArea.rendered&&!("auto"==g.plotArea.rendered&&"onIndicator"==g.thresholdDisplay)&&"all"!=g.thresholdDisplay&&(C=DvtStatusMeterGaugeRenderer._createShape(a.getContext(),k.getUnboundedCoordAt(e.minValue),k.getUnboundedCoordAt(e.maxValue),t,u,!0),m=DvtGaugeStyleUtils.getPlotAreaColor(a),C.setFill(new DvtSolidFill(m)),C.setStroke(new DvtSolidStroke(z)),DvtStatusMeterGaugeRenderer._renderPlotAreaVisualEffects(a,b,C,m));"off"!=g.plotArea.rendered&&!("auto"==g.plotArea.rendered&&"onIndicator"==
g.thresholdDisplay)&&(o=k.getUnboundedCoordAt(e.minValue));m=DvtStatusMeterGaugeRenderer._createShape(a.getContext(),o,q,v,w,!0);a.__shapes.push(m);h=DvtGaugeStyleUtils.getColor(a);m.setFill(new DvtSolidFill(h));y&&m.setStroke(new DvtSolidStroke(y));x&&b.addChild(m);m=DvtStatusMeterGaugeRenderer._createShape(a.getContext(),o,q,v,w,!0);DvtStatusMeterGaugeRenderer._renderVisualEffects(a,b,m,x);if(x=e?e.referenceObjects:null)for(m=0;m<x.length;m++)h=x[m].color?x[m].color:"black",o=x[m].value,q=g.indicatorSize,
v=((1-q)/2+q)*d.h,o=new DvtRect(a.getContext(),k.getUnboundedCoordAt(o)-1,d.y+(1-q)/4*d.h,2,v),o.setFill(new DvtSolidFill(h)),b.addChild(o),q=DvtColorUtils.makeRGBA(0,0,0,0.8),q=new DvtShadow(q,0.75,3,3,50,1,2,!1,!1,!1),b.addChild(o),o.addDrawEffect(q);d=new DvtRect(a.getContext(),d.x,d.y,d.w,d.h);d.setFill(new DvtSolidFill("#000000",0.0010));b.addChild(d);((b=e.shortDesc?e.shortDesc:e.tooltip)||!1===a.__getOptions().readOnly)&&a.__getEventManager().associate(d,new DvtSimpleObjPeer(null,b,h))};
DvtStatusMeterGaugeRenderer._createShape=function(a,b,d,e,g,h){return new DvtStatusMeterGaugeIndicator(a,b,d,e,g,h)};DvtStatusMeterGaugeRenderer._renderVisualEffects=function(a,b,d,e){"none"!=a.__getOptions().visualEffects&&(d.setMouseEnabled(!1),e&&b.addChild(d),b=new DvtLinearGradientFill(270,["#FFFFFF","#FFFFFF","#FFFFFF"],[0.5,0.3125,0],[0,0.3,1]),d.setFill(b),a.__shapes.push(d))};
DvtStatusMeterGaugeRenderer._renderPlotAreaVisualEffects=function(a,b,d,e){d.setMouseEnabled(!1);b.addChild(d);a=[DvtColorUtils.getDarker(e,0.9),e,DvtColorUtils.getBrighter(e,0.7)];a=new DvtLinearGradientFill(270,a,[1,1,1],[0,0.04,0.73]);d.setFill(a)};
DvtStatusMeterGaugeRenderer._renderLabel=function(a,b,d){var e=a.__getData(),g=a.__getOptions(),h=DvtStyleUtils.isLocaleR2L();if(g.metricLabel.rendered){var k=g.__layout.labelGap,m,n;if(0<e.maxValue||"off"!=g.plotArea.rendered||!("auto"==g.plotArea.rendered&&"onIndicator"==g.thresholdDisplay))n=DvtGaugeRenderer.formatLabelValue(0<e.maxValue?e.maxValue:e.minValue,a),n=new DvtText(a.getContext(),n),n.setCSSStyle(new DvtCSSStyle(g.metricLabel.labelStyle)),b.addChild(n),m=n.getDimensions(),b.removeChild(n),
n=h?d.x+m.w:d.x+d.w,labelSpace=m.w,h&&(d.x+=m.w+k),d.w-=m.w+k;if(0>e.minValue&&!g.plotArea.rendered){m=DvtGaugeRenderer.formatLabelValue(e.minValue,a);var o=new DvtText(a.getContext(),m);o.setCSSStyle(new DvtCSSStyle(g.metricLabel.labelStyle));b.addChild(o);m=o.getDimensions();b.removeChild(o);if(0>e.value||0>=e.maxValue)n=h?d.x+d.w:d.x+m.w,labelSpace=m.w;h||(d.x+=m.w+k);d.w-=m.w+k}e=""+DvtGaugeRenderer.formatLabelValue(e.value,a);h=new DvtText(a.getContext(),e,n,d.y+d.h/2);h.setCSSStyle(new DvtCSSStyle(g.metricLabel.labelStyle));
h.alignCenter();DvtAgent.getAgent().isGecko()||!DvtStyleUtils.isLocaleR2L()?h.alignEnd():h.alignStart();if(h=h.truncateToSpace(b,labelSpace,d.h))h.getTextString()!=e&&a.__getEventManager().associate(h,new DvtSimpleObjPeer(e)),b.addChild(h)}};DvtStatusMeterGaugeIndicator=function(a,b,d,e,g,h){this.Init(a,b,d,e,g,h)};DvtObj.createSubclass(DvtStatusMeterGaugeIndicator,DvtRect,"DvtStatusMeterGaugeIndicator");DvtStatusMeterGaugeIndicator._CORNER_RADIUS_SIZE=0.25;
DvtStatusMeterGaugeIndicator._MIN_CORNER_RADIUS=2.5;DvtStatusMeterGaugeIndicator.prototype.Init=function(a,b,d,e,g,h){DvtStatusMeterGaugeIndicator.superclass.Init.call(this,a);this.setCoords(b,d,e,g,h)};
DvtStatusMeterGaugeIndicator.prototype.setCoords=function(a,b,d,e,g){this._baselineCoord=a;this._endCoord=b;this._y1=d;this._y2=e;var h=Math.min(a,b),a=Math.abs(a-b),e=e-d;this.setRect(h,d,a,e);g&&(d=e*DvtStatusMeterGaugeIndicator._CORNER_RADIUS_SIZE,d>=DvtStatusMeterGaugeIndicator._MIN_CORNER_RADIUS&&this.setCornerRadius(d,d))};DvtStatusMeterGaugeIndicator.prototype.getAnimationParams=function(){return[this._baselineCoord,this._endCoord,this._y1,this._y2]};
DvtStatusMeterGaugeIndicator.prototype.setAnimationParams=function(a){a&&4==a.length&&this.setCoords(a[0],a[1],a[2],a[3])};var DvtDialGauge=function(){};DvtObj.createSubclass(DvtDialGauge,DvtGauge,"DvtDialGauge");DvtDialGauge.newInstance=function(a,b,d,e){var g=new DvtDialGauge;g.Init(a,b,d,e);return g};DvtDialGauge.prototype.Init=function(a,b,d,e){DvtDialGauge.superclass.Init.call(this,a,b,d,e);this.__anchorPt=null};
DvtDialGauge.prototype.setOptions=function(a){DvtDialGauge.superclass.setOptions.call(this,DvtDialGaugeDefaults.calcOptions(a))};DvtDialGauge.prototype.Render=function(a,b,d){DvtDialGaugeRenderer.render(this,a,b,d)};
DvtDialGauge.prototype.CreateAnimationOnDisplay=function(a,b,d){for(var b=[],e=0;e<a.length;e++){var g=a[e],h=g.getAnimationParams(),k=DvtDialGaugeRenderer.__getStartAngle(this);g.setAngle(k);k=new DvtCustomAnimation(this.getContext(),g,d);k.getAnimator().addProp(DvtAnimator.TYPE_NUMBER_ARRAY,g,g.getAnimationParams,g.setAnimationParams,h);k.getAnimator().setEasing(function(a){return DvtEasing.backOut(a,0.7)});b.push(k)}return new DvtParallelPlayable(this.getContext(),b)};
DvtDialGauge.prototype.GetValueAt=function(a,b){var d=Math.atan2(b-this.__anchorPt.y,a-this.__anchorPt.x),e=DvtMath.radsToDegrees(d);0>=e&&(e+=360);var d=DvtStyleUtils.isLocaleR2L(),g=this.Options.background,h=d?180+g.startAngle:360-g.startAngle,g=g.angleExtent,k=h+g;if(d){k=h;for(h-=g;0>h;)h+=360,k+=360}e+360>=h&&e+360<=k?e+=360:e>=h&&e<=k||(e=e>k?h+360-e<e-k?h:k:h-e<e+360-k?h:k);e=(e-h)/g;d&&(e=1-e);d=this.Data.minValue;return e*(this.Data.maxValue-d)+d};var DvtDialGaugeDefaults={};
DvtObj.createSubclass(DvtDialGaugeDefaults,DvtObj,"DvtDialGaugeDefaults");DvtDialGaugeDefaults.VERSION_1={background:{startAngle:180,angleExtent:180,indicatorLength:0.7},indicator:{}};DvtDialGaugeDefaults.calcOptions=function(a){var b=DvtDialGaugeDefaults._getDefaults(a);return a?DvtJSONUtils.merge(a,b):b};DvtDialGaugeDefaults._getDefaults=function(a){var a=DvtGaugeDefaults.getDefaults(a),b=DvtJSONUtils.clone(DvtDialGaugeDefaults.VERSION_1);return DvtJSONUtils.merge(b,a)};
var DvtDialGaugeRenderer={};DvtObj.createSubclass(DvtDialGaugeRenderer,DvtObj,"DvtDialGaugeRenderer");DvtDialGaugeRenderer.render=function(a,b,d,e){DvtGaugeDataUtils.hasData(a)?(d=new DvtRectangle(0,0,d,e),DvtDialGaugeRenderer._renderShape(a,b,d),DvtDialGaugeRenderer._renderLabel(a,b,d)):DvtGaugeRenderer.renderEmptyText(a,b,new DvtRectangle(0,0,d,e))};
DvtDialGaugeRenderer._renderShape=function(a,b,d){var e=a.__getData(),g=a.__getOptions(),h=DvtDialGaugeRenderer._createBackground(a,d);b.addChild(h);g.background.majorTickCount&&g.background.radius&&DvtDialGaugeRenderer._renderTickLabels(a,b,d);var h=DvtDialGaugeRenderer._createIndicator(a,d),k=new DvtContainer(a.getContext()),m=new DvtDialGaugeIndicator(a.getContext());b.addChild(k);k.addChild(m);m.addChild(h);var n=h.getDimensions(),o=DvtDialGaugeRenderer._getRotation(a,e.value),g=DvtDialGaugeRenderer._getBackgroundAnchorPoint(a,
d),q=DvtDialGaugeRenderer._getIndicatorAnchorPoint(a,d,n),d=DvtDialGaugeRenderer._getIndicatorScaleFactor(a,d,n),n=new DvtMatrix(a.getContext());n.translate(-q.x,-q.y);n.scale(d,d);h.setMatrix(n);m.setAngle(o);n=new DvtMatrix(a.getContext());n.translate(g.x,g.y);k.setMatrix(n);a.__shapes.push(m);((e=e.shortDesc?e.shortDesc:e.tooltip)||!1===a.__getOptions().readOnly)&&a.__getEventManager().associate(b,new DvtSimpleObjPeer(null,e));a.__anchorPt=g};
DvtDialGaugeRenderer._createBackground=function(a,b){var d=a.__getOptions().background,e=DvtStyleUtils.isLocaleR2L(),g=DvtAgent.getAgent().isTouchDevice(),h=g?2*b.w:b.w,k=g?2*b.h:b.h,m=d.images;if(m&&0<m.length){var n,o,q,g=[];for(n=0;n<m.length;n++)e&&!0===m[n].bidi?g.push(m[n]):!e&&!0!==m[n].bidi&&g.push(m[n]);m=0<g.length?g:m;for(n=0;n<m.length;n++){var s=m[n],t=s.source,g=s.width,s=s.height,u=t&&-1<t.search(".svg");0==n&&(o=g,q=s);if(u||g>=h&&s>=k||n==m.length-1){var h=new DvtImage(a.getContext(),
t,0,0,g,s),v=new DvtMatrix(a.getContext()),k=Math.min(b.w/g,b.h/s),m=(b.w-k*g)/2;n=(b.h-k*s)/2;v.scale(k,k);v.translate(m,n);h.setMatrix(v);v=Math.min(b.w/o,b.h/q);d._radius=d.radius*v;u&&DvtAgent.getAgent().isWebkit()&&(t=DvtImageLoader.loadImage(a.getContext(),t,DvtObj.createCallback(h,h.__setDimensions)))&&h.__setDimensions(t);b.x+=m;b.y+=n;b.w=k*g;b.h=k*s;!isNaN(d.anchorX)&&!isNaN(d.anchorY)&&(d._anchorX=e?b.x+b.w-b.w*d.anchorX/o:b.x+b.w*d.anchorX/o,d._anchorY=b.y+b.h*d.anchorY/q);d.metricLabelBounds&&
(g={},g.width=b.w*d.metricLabelBounds.width/o,g.height=b.h*d.metricLabelBounds.height/q,g.y=b.y+b.h*d.metricLabelBounds.y/q,g.x=e?b.x+b.w-b.w*d.metricLabelBounds.x/o-g.width:b.x+b.w*d.metricLabelBounds.x/o,d._metricLabelBounds=g);return h}}}return null};
DvtDialGaugeRenderer._createIndicator=function(a,b){var d=a.__getOptions().indicator,e=DvtDialGaugeRenderer._getIndicatorLength(a,b),g=DvtAgent.getAgent().isTouchDevice()?2*e:e,h,k,m=d.images;if(m&&0<m.length)for(var n=0;n<m.length;n++){var o=m[n],e=o.source,q=o.width,o=o.height,s=e&&-1<e.search(".svg");0==n&&(h=q,k=o);if(s||o>=g||n==m.length-1)return g=new DvtImage(a.getContext(),e,0,0,q,o),s&&DvtAgent.getAgent().isWebkit()&&DvtImageLoader.loadImage(a.getContext(),e,DvtObj.createCallback(g,g.__setDimensions))&&
(g.setWidth(q),g.setHeight(o)),!isNaN(d.anchorX)&&!isNaN(d.anchorY)&&(d._anchorX=d.anchorX*q/h,d._anchorY=d.anchorY*o/k),g}return null};DvtDialGaugeRenderer.__getStartAngle=function(a){a=a.__getOptions().background;a=DvtStyleUtils.isLocaleR2L()?180-a.startAngle:a.startAngle;return Math.PI*(90-a)/180};
DvtDialGaugeRenderer._getRotation=function(a,b){var d=a.__getData(),e=a.__getOptions().background,g=d.minValue,d=d.maxValue,b=Math.max(Math.min(b,d),g),g=(b-g)/(d-g),d=DvtStyleUtils.isLocaleR2L();return Math.PI*(90-((d?180-e.startAngle:e.startAngle)-g*(d?-e.angleExtent:e.angleExtent)))/180};DvtDialGaugeRenderer._getBackgroundAnchorPoint=function(a,b){var d=a.__getOptions().background,e=d._anchorX,d=d._anchorY;return!isNaN(e)&&!isNaN(d)?new DvtPoint(e,d):new DvtPoint(b.x+b.w/2,b.y+b.h/2)};
DvtDialGaugeRenderer._getIndicatorLength=function(a,b){var d=Math.min(b.w,b.h)/2;return a.__getOptions().background.indicatorLength*d};DvtDialGaugeRenderer._getIndicatorAnchorPoint=function(a,b,d){b=a.__getOptions().indicator;a=b._anchorX;b=b._anchorY;return!isNaN(a)&&!isNaN(b)?new DvtPoint(a,b):new DvtPoint(d.x+d.w/2,d.y+d.h)};DvtDialGaugeRenderer._getIndicatorScaleFactor=function(a,b,d){return DvtDialGaugeRenderer._getIndicatorLength(a,b)/d.h};
DvtDialGaugeRenderer._renderLabel=function(a,b,d){var e=a.__getData(),g=a.__getOptions();if(g.metricLabel.rendered){var e=""+DvtGaugeRenderer.formatLabelValue(e.value,a),h=d.x+d.w/2,k=d.y+d.h/2,m=d.w,d=d.h,n=g.background._metricLabelBounds;n&&(h=n.x+n.width/2,k=n.y+n.height/2,m=n.width,d=n.height);h=new DvtText(a.getContext(),e,h,k);h.setCSSStyle(new DvtCSSStyle(g.metricLabel.labelStyle));h.alignCenter();h.alignMiddle();if(h=h.truncateToSpace(b,m,d))h.getTextString()!=e&&a.__getEventManager().associate(h,
new DvtSimpleObjPeer(e)),b.addChild(h)}};
DvtDialGaugeRenderer._renderTickLabels=function(a,b,d){var e=a.__getData(),g=a.__getOptions(),h=DvtStyleUtils.isLocaleR2L();if(g.background.radius&&g.background.majorTickCount)for(var k=g.background._radius,m=e.minValue,e=e.maxValue,n=g.background.majorTickCount,o=0;o<n;o++){var q=m+Math.abs(e-m)*o/(n-1);h&&(q=m+Math.abs(e-m)*(n-1-o)/(n-1));var s=DvtGaugeRenderer.formatTickLabelValue(q,a),t=DvtDialGaugeRenderer._getRotation(a,q),u=DvtDialGaugeRenderer._getBackgroundAnchorPoint(a,d),q=u.x+k*Math.cos(t-
Math.PI/2),v=u.y+k*Math.sin(t-Math.PI/2),t=d.w,u=d.h,q=new DvtText(a.getContext(),s,q,v);q.setCSSStyle(new DvtCSSStyle(g.tickLabel.labelStyle));q.alignCenter();q.alignMiddle();if(q=q.truncateToSpace(b,t,u))q.getTextString()!=s&&a.__getEventManager().associate(q,new DvtSimpleObjPeer(s)),b.addChild(q)}};var DvtDialGaugeIndicator=function(a){this.Init(a)};DvtObj.createSubclass(DvtDialGaugeIndicator,DvtContainer,"DvtDialGaugeIndicator");
DvtDialGaugeIndicator.prototype.setAngle=function(a){var b=new DvtMatrix(this.getContext());b.rotate(a);this.setMatrix(b);this._angleRads=a};DvtDialGaugeIndicator.prototype.getAnimationParams=function(){return[this._angleRads]};DvtDialGaugeIndicator.prototype.setAnimationParams=function(a){a&&1==a.length&&this.setAngle(a[0])};var DvtRatingGauge=function(){};DvtObj.createSubclass(DvtRatingGauge,DvtGauge,"DvtRatingGauge");DvtRatingGauge._DEFAULT_MAX_VALUE=5;DvtRatingGauge._DEFAULT_MIN_VALUE=0;
DvtRatingGauge.newInstance=function(a,b,d,e){var g=new DvtRatingGauge;g.Init(a,b,d,e);g._eventHandler=new DvtRatingGaugeEventManager(g);g._eventHandler.addListeners(g);return g};DvtRatingGauge.prototype.setOptions=function(a){DvtRatingGauge.superclass.setOptions.call(this,DvtRatingGaugeDefaults.calcOptions(a))};
DvtRatingGauge.prototype.render=function(a,b,d){this.Data=a?DvtJSONUtils.clone(a):this.Data;this.Data||(this.Data={});isNaN(this.Data.maxValue)&&(this.Data.maxValue=DvtRatingGauge._DEFAULT_MAX_VALUE);isNaN(this.Data.minValue)&&(this.Data.minValue=DvtRatingGauge._DEFAULT_MIN_VALUE);DvtRatingGauge.superclass.render.call(this,this.Data,b,d)};
DvtRatingGauge.prototype.Render=function(a,b,d){var e=this.Options.__layout.outerGap,g=this.Data.maxValue;this._size=Math.min(d-2*e,(b-2*e)/g);this._bounds=new DvtRectangle((this.Width-this._size*g)/2,e,this._size*g,this.Height-2*e);this._counter=0;DvtRatingGaugeRenderer.render(this,a,b,d)};
DvtRatingGauge.prototype.GetValueAt=function(a){if(DvtGaugeDataUtils.hasData(this)){var a=Math.max(Math.min(a,this._bounds.x+this._bounds.w),this._bounds.x),b=this.Options.inputIncrement,d=0,d=DvtStyleUtils.isLocaleR2L()?Math.max((this._bounds.x+this._bounds.w-a)/this._size,this.Data.minValue):Math.max((a-this._bounds.x)/this._size,this.Data.minValue);return 0.25>d?0:"half"==b?Math.ceil(2*d)/2:Math.ceil(d)}return null};
DvtRatingGauge.prototype.__processHoverStart=function(a,b){this.__updateClipRects(this.GetValueAt(a,b),"hover")};DvtRatingGauge.prototype.__processHoverEnd=function(){this.__updateClipRects(this.Data.value,"render")};DvtRatingGauge.prototype.__processValueChangeStart=function(a,b){this.__processHoverStart(a,b)};DvtRatingGauge.prototype.__processValueChangeMove=function(a,b){this.__updateClipRects(this.GetValueAt(a,b),"hover")};
DvtRatingGauge.prototype.__processValueChangeEnd=function(a,b){var d=this.Data.value;this.Data.value=this.GetValueAt(a,b);this.Data.changed=!0;this.render();this.__dispatchEvent(new DvtValueChangeEvent(d,this.Data.value))};
DvtRatingGauge.prototype.__updateClipRects=function(a,b,d){if(DvtGaugeDataUtils.hasData(this)){d||(d=this._container);var e=DvtStyleUtils.isLocaleR2L(),a=Math.max(Math.min(a,this.Data.maxValue),0),g=0,h=a*this._size,k=a*this._size;"render"==b&&(g=a*this._size,h=0);e?(a=d.getChildAt(0),b=new DvtClipPath("unsel"+this.getId()+this._counter),b.addRect(this._bounds.x,this._bounds.y,this._bounds.w-k,this._bounds.h),a.setClipPath(b),a=d.getChildAt(1),b=new DvtClipPath("sel"+this.getId()+this._counter),b.addRect(this._bounds.x+
this._bounds.w-k,this._bounds.y,g,this._bounds.h),a.setClipPath(b),d=d.getChildAt(2),g=new DvtClipPath("hover"+this.getId()+this._counter),g.addRect(this._bounds.x+this._bounds.w-k,this._bounds.y,h,this._bounds.h)):(a=d.getChildAt(0),b=new DvtClipPath("unsel"+this.getId()+this._counter),b.addRect(this._bounds.x+k,this._bounds.y,this._bounds.w-k,this._bounds.h),a.setClipPath(b),a=d.getChildAt(1),b=new DvtClipPath("sel"+this.getId()+this._counter),b.addRect(this._bounds.x,this._bounds.y,g,this._bounds.h),
a.setClipPath(b),d=d.getChildAt(2),g=new DvtClipPath("hover"+this.getId()+this._counter),g.addRect(this._bounds.x,this._bounds.y,h,this._bounds.h));d.setClipPath(g);this._counter=(this._counter+1)%2}};var DvtRatingGaugeDefaults={};DvtObj.createSubclass(DvtRatingGaugeDefaults,DvtObj,"DvtRatingGaugeDefaults");
DvtRatingGaugeDefaults.VERSION_1={unselected:{shape:"star",color:"#F2F2F2",borderColor:"#B6B6B6"},selected:{shape:"star",color:"#F8C15A",borderColor:"#F5A700"},hover:{shape:"star",color:"#66A7DA",borderColor:"#4A86C5"},changed:{shape:"star",color:"#F8C15A",borderColor:"#959595"}};DvtRatingGaugeDefaults.calcOptions=function(a){var b=DvtRatingGaugeDefaults._getDefaults(a);return a?DvtJSONUtils.merge(a,b):b};
DvtRatingGaugeDefaults._getDefaults=function(a){var a=DvtGaugeDefaults.getDefaults(a),b=DvtJSONUtils.clone(DvtRatingGaugeDefaults.VERSION_1);return DvtJSONUtils.merge(b,a)};var DvtRatingGaugeEventManager=function(a){this.Init(a.getContext(),a.__dispatchEvent,a);this._gauge=a;this._bEditing=!1};DvtObj.createSubclass(DvtRatingGaugeEventManager,DvtGaugeEventManager,"DvtRatingGaugeEventManager");
DvtRatingGaugeEventManager.prototype.OnMouseOver=function(a){if(!1===this._gauge.__getOptions().readOnly){var b=this.getContext().getRelativePosition(a.pageX,a.pageY);this._gauge.__processHoverStart(b.x,b.y);this._bEditing=!0}DvtGaugeEventManager.superclass.OnMouseOver.call(this,a)};
DvtRatingGaugeEventManager.prototype.OnMouseOut=function(a){if(!1===this._gauge.__getOptions().readOnly){var b=this.getContext().getRelativePosition(a.pageX,a.pageY);this._gauge.__processHoverEnd(b.x,b.y)}DvtGaugeEventManager.superclass.OnMouseOut.call(this,a)};DvtRatingGaugeEventManager.prototype.IsShowingTooltipWhileEditing=function(){return!0};var DvtRatingGaugeRenderer={};DvtObj.createSubclass(DvtRatingGaugeRenderer,DvtObj,"DvtRatingGaugeRenderer");
DvtRatingGaugeRenderer.render=function(a,b,d,e){if(DvtGaugeDataUtils.hasData(a)){var g=a.__getOptions(),h=a.__getData(),k=g.__layout.outerGap,m=h.maxValue,n=Math.min(e-2*k,(d-2*k)/m),d=new DvtRectangle((d-n*m)/2,k,n*m,e-2*k),e={type:g.unselected.shape,color:g.unselected.color,borderColor:g.unselected.borderColor,visualEffects:g.visualEffects},k={type:g.selected.shape,color:g.selected.color,borderColor:g.selected.borderColor,visualEffects:g.visualEffects},o={type:g.changed.shape,color:g.changed.color,
borderColor:g.changed.borderColor,visualEffects:g.visualEffects},q={type:g.hover.shape,color:g.hover.color,borderColor:g.hover.borderColor,visualEffects:g.visualEffects},s={value:0},t={value:0};"dot"==g.unselected.shape&&(e.type="circle",e.visualEffects="none",t.size=0.05);var u=new DvtContainer(a.getContext());b.addChild(u);var v=new DvtContainer(a.getContext());b.addChild(v);var w=new DvtContainer(a.getContext());b.addChild(w);a.__updateClipRects(h.value,"render",b);for(var x=0;x<m;x++){if("none"!=
g.unselected.shape){var y=DvtLedGauge.newInstance(a.getContext(),null,null,e);u.addChild(y);y.setTranslateX(d.x+x*n);y.setTranslateY(d.y);y.render(t,n,n)}y=h.changed?DvtLedGauge.newInstance(a.getContext(),null,null,o):DvtLedGauge.newInstance(a.getContext(),null,null,k);v.addChild(y);y.setTranslateX(d.x+x*n);y.setTranslateY(d.y);y.render(s,n,n);y=DvtLedGauge.newInstance(a.getContext(),null,null,q);w.addChild(y);y.setTranslateX(d.x+x*n);y.setTranslateY(d.y);y.render(s,n,n)}g=new DvtRect(a.getContext(),
d.x,d.y,d.w,d.h);g.setFill(new DvtSolidFill("#000000",0.0010));b.addChild(g);h.tooltip&&a.__getEventManager().associate(g,new DvtSimpleObjPeer(null,h.tooltip))}else DvtGaugeRenderer.renderEmptyText(a,b,new DvtRectangle(0,0,d,e))};