var DvtCanvasImplFactory=function(a){this.Init(a)};DvtObj.createSubclass(DvtCanvasImplFactory,DvtHtmlImplFactory,"DvtCanvasImplFactory");DvtCanvasImplFactory.prototype.newStage=function(a,b){return new DvtCanvasStage(this.GetContext(),a,b)};DvtCanvasImplFactory.prototype.newContainer=function(a){return new DvtCanvasContainer(this.GetContext(),a,"g")};DvtCanvasImplFactory.prototype.newArc=function(a,b,d,e,g,h,k,m){return new DvtCanvasArc(this.GetContext(),a,b,d,e,g,h,k,m)};
DvtCanvasImplFactory.prototype.newCircle=function(a,b,d,e){return new DvtCanvasCircle(this.GetContext(),a,b,d,e)};DvtCanvasImplFactory.prototype.newImage=function(a,b,d,e,g,h){return new DvtCanvasImage(this.GetContext(),a,b,d,e,g,h)};DvtCanvasImplFactory.prototype.newLine=function(a,b,d,e,g){return new DvtCanvasLine(this.GetContext(),a,b,d,e,g)};DvtCanvasImplFactory.prototype.newMarker=function(a,b,d){return new DvtCanvasMarker(this.GetContext(),a,b,d)};
DvtCanvasImplFactory.prototype.newOval=function(a,b,d,e,g){return new DvtCanvasOval(this.GetContext(),a,b,d,e,g)};DvtCanvasImplFactory.prototype.newPath=function(a,b){return new DvtCanvasPath(this.GetContext(),a,b)};DvtCanvasImplFactory.prototype.newPolygon=function(a,b){return new DvtCanvasPolygon(this.GetContext(),a,b)};DvtCanvasImplFactory.prototype.newPolyline=function(a,b){return new DvtCanvasPolyline(this.GetContext(),a,b)};
DvtCanvasImplFactory.prototype.newRect=function(a,b,d,e,g){return new DvtCanvasRect(this.GetContext(),a,b,d,e,g)};DvtCanvasImplFactory.prototype.newText=function(a,b,d,e){return new DvtCanvasText(this.GetContext(),a,b,d,e)};DvtCanvasImplFactory.prototype.Init=function(a){DvtCanvasImplFactory.superclass.Init.call(this,a)};DvtCanvasImplFactory.prototype.newTextArea=function(a,b,d){return new DvtCanvasTextArea(this.GetContext(),a,b,d)};
DvtCanvasImplFactory.prototype.newTextFormatted=function(a,b,d){return new DvtCanvasTextFormatted(a,b,d)};DvtCanvasImplFactory.prototype.getImageLoader=function(){return DvtCanvasImageLoader};DvtCanvasImplFactory.prototype.getDocumentUtils=function(){return DvtCanvasDocumentUtils};var DvtCanvasJsExt=function(){};DvtObj.createSubclass(DvtCanvasJsExt,DvtJsExt,"DvtCanvasJsExt");DvtCanvasJsExt.prototype.sendPPRProperty=function(a,b,d){try{AdfPage.PAGE.findComponent(a).getPeer().setDVTPPRAttribute(b,d)}catch(e){}};
DvtCanvasJsExt.prototype.sendPPR=function(a){try{AdfPage.PAGE.findComponent(a).getPeer().sendToServerPPR({source:a})}catch(b){}};DvtCanvasJsExt.prototype.sendPPRNonBlocking=function(a){try{AdfPage.PAGE.findComponent(a).getPeer().sendToServerPPR3({source:a})}catch(b){}};DvtCanvasJsExt.prototype.callJs=function(a){return eval(a)};DvtCanvasJsExt.prototype.callJsWithParam=function(a,b){return eval(a)(b)};DvtCanvasJsExt.prototype.getLogLevel=function(){return adf_dvt_fpGetLogLevel()};
DvtCanvasJsExt.prototype.log=function(a,b){adf_dvt_fpLogger(a,void 0===b?DvtJsExt.LOG_INFO:b)};DvtCanvasJsExt.prototype.msg=function(a){adf_dvt_fpMsg(a)};DvtCanvasJsExt.prototype.perf=function(a,b){adf_dvt_fpPerfLogger(""+b+a)};DvtCanvasJsExt.prototype.requestRefresh=function(){adf_dvt_fpRefresh()};DvtCanvasJsExt.prototype.dispatchEvent=function(a,b,d,e){DvtEventDispatcher.dispatchEvent(a,b,d,e)};var DvtCanvasDisplayable=function(a,b){this._Init(a,b)};
DvtObj.createSubclass(DvtCanvasDisplayable,DvtObj,"DvtCanvasDisplayable");DvtCanvasDisplayable.prototype.applyDrawAttrs=function(){return DvtCanvasDrawUtils.applyDrawAttrs(this._ctx,this)};DvtCanvasDisplayable.prototype._Init=function(a,b){b&&(this._id=b);this._Parent=null;this._elem=a._root;this._ctx=this._elem.getContext("2d");this._bVisible=!0;this._filter=null;this._pixelHinting=!1;this._cursor=null;this._bMouseEnabled=!0;this._alpha=1;this._matrix=null};
DvtCanvasDisplayable.prototype.getCtx=function(){return this._ctx};DvtCanvasDisplayable.prototype.getElem=function(){return this._elem};DvtCanvasDisplayable.prototype.getId=function(){return this._id};DvtCanvasDisplayable.prototype.setId=function(a){this._id!==a&&(a&&0===a.length&&(a=null),this._id=a)};DvtCanvasDisplayable.prototype.getObj=function(){return this._obj};DvtCanvasDisplayable.prototype.setObj=function(a){this._obj=a};DvtCanvasDisplayable.prototype.getParent=function(){return this._obj.getParent()};
DvtCanvasDisplayable.prototype.setParent=function(a){this._obj.setParent(a)};DvtCanvasDisplayable.prototype.getPixelHinting=function(){return this._pixelHinting};DvtCanvasDisplayable.prototype.setPixelHinting=function(a){this._pixelHinting=a};DvtCanvasDisplayable.prototype.getVisible=function(){return this._bVisible};DvtCanvasDisplayable.prototype.setVisible=function(a){this._bVisible!==a&&(this._bVisible=a)};
DvtCanvasDisplayable.prototype.localToStage=function(a){for(var b=this.getObj(),d=b.getPathToStage(),e=a,g=0;g<d.length;g++)b=d[g],b=b.getMatrix(),e=b.transformPoint(e);return a};DvtCanvasDisplayable.prototype.stageToLocal=function(a){for(var b=this.getObj(),d=b.getPathToStage(),e=d.length-1;0<=e;e--)b=d[e],b=b.getMatrix().clone(),b.invert(),a=b.transformPoint(a);return a};DvtCanvasDisplayable.prototype.setClipPath=function(a){this._clipRegion=a};
DvtCanvasDisplayable.prototype.Render=function(){this.BeginRender();this.RenderSelf();this.RenderChildren();this.EndRender()};DvtCanvasDisplayable.prototype.BeginRender=function(){var a=this._ctx;if(this instanceof DvtCanvasStage){var b=this.getElem();b.width=b.width}a.save();this.PrepareContext()};
DvtCanvasDisplayable.prototype.PrepareContext=function(){var a=this._ctx;a.globalAlpha=this.getAlpha();this._clipRegion&&DvtCanvasDrawUtils.applyClipRegion(a,this._clipRegion);this._matrix&&a.transform(this._matrix.getA(),this._matrix.getC(),this._matrix.getB(),this._matrix.getD(),this._matrix.getTx(),this._matrix.getTy())};DvtCanvasDisplayable.prototype.EndRender=function(){this._ctx.restore()};DvtCanvasDisplayable.prototype.RenderSelf=function(){};DvtCanvasDisplayable.prototype.RenderChildren=function(){};
DvtCanvasDisplayable.TransferAttributes=function(){};DvtCanvasDisplayable.prototype.addListener=function(){};DvtCanvasDisplayable.prototype.removeListener=function(){};DvtCanvasDisplayable.prototype.getCSSStyle=function(){return this._cssStyle};DvtCanvasDisplayable.prototype.setCSSStyle=function(a){this._cssStyle=a};DvtCanvasDisplayable.prototype.setCursor=function(a){this._cursor=a};DvtCanvasDisplayable.prototype.getCursor=function(){return this._cursor};
DvtCanvasDisplayable.prototype.setMouseEnabled=function(a){this._bMouseEnabled=a};DvtCanvasDisplayable.prototype.isMouseEnabled=function(){return this._bMouseEnabled};DvtCanvasDisplayable.prototype.getAlpha=function(){return this._alpha};DvtCanvasDisplayable.prototype.setAlpha=function(a){1.0E-5>a&&(a=0);a!==this._alpha&&(this._alpha=a)};DvtCanvasDisplayable.prototype.setMatrix=function(a){a!==this._matrix&&(this._matrix=a)};
DvtCanvasDisplayable.prototype.applyDrawEffects=function(a){for(var b,d=a.length,e=0;e<d;e++)b=a[e],b instanceof DvtShadow&&(this._shadow=b)};var DvtCanvasContainer=function(a,b){this._Init(a,b)};DvtObj.createSubclass(DvtCanvasContainer,DvtCanvasDisplayable,"DvtCanvasContainer");DvtCanvasContainer.prototype.addChild=function(a){this._children||(this._children=[]);this._children.push(a)};
DvtCanvasContainer.prototype.addChildAt=function(a,b){this._children||(this._children=[]);0<=b&&b<=this._children.length&&this._children.splice(b,0,a)};DvtCanvasContainer.prototype.addChildAfter=function(){};DvtCanvasContainer.prototype.addChildBefore=function(){};DvtCanvasContainer.prototype._findChild=function(a){var b=-1;if(this._children)for(var d=this._children.length,e=0;e<d;e++)if(this._children[e]===a){b=e;break}return b};
DvtCanvasContainer.prototype.getDimensions=function(a){return DvtObjDimUtils.getDimensions(this,a)};DvtCanvasContainer.prototype.getDimensionsWithStroke=function(a){return DvtObjDimUtils.getDimensionsWithStroke(this,a)};DvtCanvasContainer.prototype.getElem=function(){return this._elem};DvtCanvasContainer.prototype._Init=function(a,b){this._bShapeContainer=this instanceof DvtCanvasShape;DvtCanvasContainer.superclass._Init.call(this,a,b)};DvtCanvasContainer.prototype.isShapeContainer=function(){return this._bShapeContainer};
DvtCanvasContainer.prototype.removeChild=function(a){this._children&&(a=this._findChild(a),0<=a&&a<this._children.length&&this._children.splice(a,1))};DvtCanvasContainer.prototype.RenderSelf=function(){DvtCanvasContainer.superclass.RenderSelf.call(this);this._bShapeContainer||this.applyDrawAttrs()};DvtCanvasContainer.prototype.RenderChildren=function(){var a,b;if(this._children){b=this._children.length;for(var d=0;d<b;d++)a=this._children[d],a.Render()}};
DvtCanvasContainer.prototype.swap=function(a,b){var d=a.getElem(),e=objw.getElem(),g=a.getParent(),h=e.nextSibling;g&&d&&e&&(g.replaceChild(d,e),g.insertBefore(d,h),d=a.getIndex(),e=b.getIndex(),this._arList[d]=b,this._arList[e]=a)};DvtCanvasContainer.prototype.CreateChildGroupElem=function(){};DvtCanvasContainer.prototype.setHyperlink=function(){};var DvtCanvasStage=function(a,b,d){this._Init(a,b,d)};DvtObj.createSubclass(DvtCanvasStage,DvtCanvasContainer,"DvtCanvasStage");
DvtCanvasStage.prototype.getCanvasRoot=function(){return this._canvasRoot};DvtCanvasStage.prototype._Init=function(a,b,d){this._canvasRoot=b;this._bAppended=!0;this._obj=null;DvtCanvasStage.superclass._Init.call(this,a,d,"stage")};DvtCanvasStage.prototype.render=function(){this.Render()};var DvtCanvasShape=function(a){this._Init(a)};DvtObj.createSubclass(DvtCanvasShape,DvtCanvasContainer,"DvtCanvasShape");
DvtCanvasShape.prototype._Init=function(a,b){DvtCanvasShape.superclass._Init.call(this,a,b);this._origStroke=this._origFill=this._fill=this._stroke=null;this._bHollow=!1};DvtCanvasShape.prototype.getFill=function(){return this._fill};
DvtCanvasShape.prototype.setFill=function(a){if(a){if(this._fill!==a){if(a instanceof DvtLinearGradientFill&&!a.getBounds())var b=DvtObjDimUtils.getDimensionsSelf(this),b=[b.x,b.y,b.w,b.h],a=new DvtLinearGradientFill(a.getAngle(),a.getColors(),a.getAlphas(),a.getStops(),b);this._fill=a}}else this._fill=null};DvtCanvasShape.prototype.getStroke=function(){return this._stroke};DvtCanvasShape.prototype.setStroke=function(a){this._stroke=a};DvtCanvasShape.prototype.isHollow=function(){return this._bHollow};
var DvtCanvasArc=function(a,b,d,e,g,h,k,m,n){this._Init(a,b,d,e,g,h,k,m,n)};DvtObj.createSubclass(DvtCanvasArc,DvtCanvasShape,"DvtCanvasArc");DvtCanvasArc.prototype._addClosure=function(a){this._ct===DvtArc.CHORD?a+=" z":this._ct===DvtArc.PIE?a+=" L "+this._cx+","+this._cy+" z":this._ct===DvtArc.OPEN&&this.setFill(null);return a};
DvtCanvasArc.prototype._createArc=function(){if(!this._bInInit){var a=this._sa*DvtMath.RADS_PER_DEGREE,b=this._ae*DvtMath.RADS_PER_DEGREE,d=this._cx+this._rx*Math.cos(a),e=this._cy-this._ry*Math.sin(a),g=this._cx+this._rx*Math.cos(a+b),a=this._cy-this._ry*Math.sin(a+b),b=180<Math.abs(this._ae)?"1":"0";this._addClosure("M "+d+" "+e+" A "+this._rx+","+this._ry+" 0 "+b+","+(0<this._ae?"0":"1")+" "+g+","+a);null!==this._stroke&&this.setStroke(this._stroke)}};DvtCanvasArc.prototype.getAngleExtent=function(){return this._ae};
DvtCanvasArc.prototype.setAngleExtent=function(a){a=null===a||isNaN(a)?0:a;this._ae!==a&&(360===a&&(a=359.99),this._ae=a,this._createArc())};DvtCanvasArc.prototype.getAngleStart=function(){return this._sa};DvtCanvasArc.prototype.setAngleStart=function(a){a=null===a||isNaN(a)?0:a;this._sa!==a&&(this._sa=a,this._createArc())};DvtCanvasArc.prototype.getClosure=function(){return this._ct};DvtCanvasArc.prototype.setClosure=function(a){a!==this._ct&&(this._ct=a,this._createArc())};
DvtCanvasArc.prototype._Init=function(a,b,d,e,g,h,k,m,n){DvtCanvasArc.superclass._Init.call(this,a,n,"path");this._ae=this._sa=0;g=null===g||isNaN(g)?e:g;this._bInInit=!0;this.setCx(b);this.setCy(d);this.setRx(e);this.setRy(g);this.setAngleStart(h);this.setAngleExtent(k);this.setClosure(m?m:DvtArc.OPEN);this._bInInit=!1;this._createArc()};DvtCanvasArc.prototype.setArc=function(a,b){this.setAngleStart(a);this.setAngleExtentStart(b)};DvtCanvasArc.prototype.getCx=function(){return this._cx};
DvtCanvasArc.prototype.setCx=function(a){a!==this._cx&&(this._cx=a)};DvtCanvasArc.prototype.getCy=function(){return this._cy};DvtCanvasArc.prototype.setCy=function(a){a!==this._cy&&(this._cy=a)};DvtCanvasArc.prototype.getRx=function(){return this._rx};DvtCanvasArc.prototype.setRx=function(a){a!==this._rx&&(this._rx=a)};DvtCanvasArc.prototype.getRy=function(){return this._ry};DvtCanvasArc.prototype.setRy=function(a){a!==this._ry&&(this._ry=a)};
DvtCanvasArc.prototype.RenderSelf=function(){DvtCanvasArc.superclass.RenderSelf.call(this);var a=this.getCtx();a.save();var b=this.applyDrawAttrs();b!==DvtCanvasDrawUtils.NOACTION&&(a.beginPath(),DvtCanvasDrawUtils.drawArc(a,this._cx,this._cy,this._rx?this._rx:this._r,this._ry,this._sa,this._ae,this._ct),b&DvtCanvasDrawUtils.FILL&&a.fill(),b&DvtCanvasDrawUtils.STROKE&&a.stroke(),a.closePath());a.restore()};var DvtCanvasCircle=function(a,b,d,e,g){this._Init(a,b,d,e,g)};
DvtObj.createSubclass(DvtCanvasCircle,DvtCanvasShape,"DvtCanvasCircle");DvtCanvasCircle.prototype._Init=function(a,b,d,e,g,h){DvtCanvasCircle.superclass._Init.call(this,a,g,h?h:"circle");this.setCx(b);this.setCy(d);this.setRadius(e)};DvtCanvasCircle.prototype.getCx=function(){return this._cx};DvtCanvasCircle.prototype.setCx=function(a){a!==this._cx&&(this._cx=a)};DvtCanvasCircle.prototype.getCy=function(){return this._cy};DvtCanvasCircle.prototype.setCy=function(a){a!==this._cy&&(this._cy=a)};
DvtCanvasCircle.prototype.getRadius=function(){return this._r};DvtCanvasCircle.prototype.setRadius=function(a){a!==this._r&&(this._r=a)};
DvtCanvasCircle.prototype.RenderSelf=function(){DvtCanvasCircle.superclass.RenderSelf.call(this);var a=this.getCtx();a.save();var b=this.applyDrawAttrs();b!==DvtCanvasDrawUtils.NOACTION&&(a.beginPath(),DvtCanvasDrawUtils.drawEllipse(a,this._cx,this._cy,this._rx?this._rx:this._r,this._ry),b&DvtCanvasDrawUtils.FILL&&a.fill(),b&DvtCanvasDrawUtils.STROKE&&a.stroke(),a.closePath());a.restore()};var DvtCanvasImage=function(a,b,d,e,g,h,k){this._Init(a,b,d,e,g,h,k)};
DvtObj.createSubclass(DvtCanvasImage,DvtCanvasShape,"DvtCanvasImage");DvtCanvasImage.XLINK_NS="http://www.w3.org/1999/xlink";DvtCanvasImage.prototype._Init=function(a,b,d,e,g,h,k){DvtCanvasImage.superclass._Init.call(this,a,k,"image");this.setImage(b,d,e,g,h)};DvtCanvasImage.prototype.getHeight=function(){return this._h};DvtCanvasImage.prototype.setHeight=function(a){a!==this._h&&(this._h=a)};DvtCanvasImage.prototype.getPos=function(){return new DvtPoint(this._x,this._y)};
DvtCanvasImage.prototype.setPos=function(a,b){this.setX(a);this.setY(b)};DvtCanvasImage.prototype.getX=function(){return this._x};DvtCanvasImage.prototype.setX=function(a){a!==this._x&&(this._x=a)};DvtCanvasImage.prototype.getY=function(){return this._y};DvtCanvasImage.prototype.setY=function(a){a!==this._y&&(this._y=a)};DvtCanvasImage.prototype.getWidth=function(){return this._w};DvtCanvasImage.prototype.setWidth=function(a){a!==this._w&&(this._w=a)};
DvtCanvasImage.prototype._imgLoaded=function(){var a=this._DvtObj;this._DvtObj=null;a._imgLoading.removeEventListener("load",this._imgLoaded,!1);a._img=a._imgLoading;a._imgLoading=null;a.getObj().getContext().decAsyncLoadCount()};
DvtCanvasImage.prototype.RenderSelf=function(){DvtCanvasImage.superclass.RenderSelf.call(this);var a=this.getCtx();this._img?a.drawImage(this._img,this._x,this._y,this._w,this._h):this._imgLoading||(this._imgLoading=new Image,this._imgLoading.src=this._src,this._imgLoading._DvtObj=this,this._imgLoading.addEventListener("load",this._imgLoaded,!1),this.getObj().getContext().incAsyncLoadCount())};DvtCanvasImage.prototype.getSrc=function(){return this._src};
DvtCanvasImage.prototype.setSrc=function(a){a!==this._src&&(this._src=a)};DvtCanvasImage.prototype.setImage=function(a,b,d,e,g){a instanceof DvtImage?(this.setSrc(a.src),this.setPos(a.x,a.y),this.setWidth(a.w),this.setHeight(a.h)):(this.setSrc(a),this.setPos(b,d),this.setWidth(e),this.setHeight(g))};DvtCanvasImage.prototype.loadImage=function(){if(this._src){var a=DvtCanvasImageLoader.loadImage(this._src);if(a)return this.setWidth(a.width),this.setHeight(a.height),this.getDimensions()}return null};
var DvtCanvasLine=function(a,b,d,e,g,h){this._Init(a,b,d,e,g,h)};DvtObj.createSubclass(DvtCanvasLine,DvtCanvasShape,"DvtCanvasLine");DvtCanvasLine.prototype._Init=function(a,b,d,e,g,h){DvtCanvasLine.superclass._Init.call(this,a,h,"line");this.setX1(b);this.setY1(d);this.setX2(e);this.setY2(g);this._bHollow=!1};DvtCanvasLine.prototype.getX1=function(){return this._x1};DvtCanvasLine.prototype.setX1=function(a){a!==this._x1&&(this._x1=a)};DvtCanvasLine.prototype.getY1=function(){return this._y1};
DvtCanvasLine.prototype.setY1=function(a){a!==this._y1&&(this._y1=a)};DvtCanvasLine.prototype.getX2=function(){return this._x2};DvtCanvasLine.prototype.setX2=function(a){a!==this._x2&&(this._x2=a)};DvtCanvasLine.prototype.getY2=function(){return this._y2};DvtCanvasLine.prototype.setY2=function(a){a!==this._y2&&(this._y2=a)};
DvtCanvasLine.prototype.setHollow=function(){var a=this._elem.parentNode;if(this._bHollow)this._origElem&&(a.replaceChild(this._origElem,this._elem),this._origElem.setAttributeNS(null,"opacity",this._alpha),this._elem=this._origElem,this._origElem=null,this._bHollow=!1);else{this._origElem=this._elem;var b,d=this.getX2()-this.getX1(),e=this.getY1()-d/2,g=this.getStroke();b=DvtCanvasShapeUtils.createElement("rect");b.setAttributeNS(null,"x",this.getX1());b.setAttributeNS(null,"y",e);b.setAttributeNS(null,
"width",this.getX2()-this.getX1());b.setAttributeNS(null,"height",d);if(d=g.getColor())g=g.getAlpha(),DvtAgent.getAgent().isSafari()&&-1!==d.indexOf("rgba")?(b.setAttributeNS(null,"stroke",DvtColorUtils.getRGB(d)),null!=g?b.setAttributeNS(null,"stroke-opacity",DvtColorUtils.getAlpha(d)*g):b.setAttributeNS(null,"stroke-opacity",DvtColorUtils.getAlpha(d))):(b.setAttributeNS(null,"stroke",d),null!=g&&b.setAttributeNS(null,"stroke-opacity",g));b.setAttributeNS(null,"fill","#ffffff");b.setAttributeNS(null,
"fill-opacity","0.001");b.setAttributeNS(null,"shape-rendering","crispEdges");b._obj=this;a.replaceChild(b,this._elem);this._elem=b;this._elem.setAttributeNS(null,"opacity",this._alpha);this._bHollow=!0}};DvtCanvasShape.prototype.isHollow=function(){return this._bHollow};
DvtCanvasLine.prototype.RenderSelf=function(){DvtCanvasLine.superclass.RenderSelf.call(this);var a=this.getCtx(),b=this.getStroke();if(b){a.save();a.beginPath();DvtCanvasDrawUtils.applyStroke(a,b);var d=this._x1,e=this._y1,g=d!==this._x2&&e===this._y2,h=0,k=0;e!==this._y2&&d===this._x2?h=0.5:g&&(k=0.5);d+=h;e+=k;(b=b.getDash())?DvtCanvasDrawUtils.drawDashedLine(a,d,e,this._x2,this._y2,b):(a.moveTo(d,e),a.lineTo(h+this._x2,k+this._y2));a.stroke();a.restore()}};
var DvtCanvasMarker=function(a,b,d,e){this._Init(a,b,d,e)};DvtObj.createSubclass(DvtCanvasMarker,DvtCanvasShape,"DvtCanvasMarker");DvtCanvasMarker.prototype._Init=function(a,b,d){DvtCanvasMarker.superclass._Init.call(this,a,d);this._type=b;this._underlay=null;this._defaultScale=1};DvtCanvasMarker.prototype.getBounds=function(){return this._dims};DvtCanvasMarker.prototype.setBounds=function(a,b,d,e,g){this._shapeInitialized||this._initShape(this._type,g,a,b,d,e)};
DvtCanvasMarker.prototype._initShape=function(a,b,d,e,g,h){this._shapeInitialized=!0;if(a===DvtMarker.CUSTOM||a===DvtMarker.HUMAN){var k=DvtDisplayableUtils._getDimForced(this.getObj().getContext(),b),m=Math.max(k.w,k.h),n=b=1;a===DvtMarker.CUSTOM?(this.getObj().getMaintainAspect(),this.getObj().getMaintainAspect()):a===DvtMarker.HUMAN&&(b=g/m,n=h/m,d=d+-k.x*b+(g-k.w*b)/2,e=e+-k.y*n+(h-k.h*n)/2,this._setCmds(DvtPathUtils.transformPath(DvtMarkerDef.HUMAN_CMDS,d,e,b,n)),this._dims=DvtPathUtils.getDimensions(this._aCmds))}else{if(a===
DvtMarker.IMAGE)this._setSrc(this.getObj().GetMarkerImage(DvtMarker.IMAGE_SOURCE)),this._setX(d),this._setY(e),this._setWidth(g),this._setHeight(h);else if(a===DvtMarker.SQUARE)this._setX(d),this._setY(e),this._setWidth(g),this._setHeight(h);else if(a===DvtMarker.CIRCLE)this._setCx(d+g/2),this._setCy(e+h/2),this._setRadius(g/2);else if(a===DvtMarker.ROUNDED_RECTANGLE){this._setX(d);this._setY(e);this._setWidth(g);this._setHeight(h);b=a=6;if(g/4<a||h/4<b)b=a=Math.min(g,h)/4;this._setRx(a);this._setRy(b)}else b=
[],n=g/2,a===DvtMarker.TRIANGLE_UP?(b.push(d),b.push(e+g),b.push(d+g),b.push(e+g),b.push(d+n),b.push(e),this._setPolygon(b)):a===DvtMarker.TRIANGLE_DOWN?(b.push(d),b.push(e),b.push(d+g),b.push(e),b.push(d+n),b.push(e+g),this._setPolygon(b)):a===DvtMarker.DIAMOND?(b.push(d+n),b.push(e),b.push(d+g),b.push(e+n),b.push(d+n),b.push(e+g),b.push(d),b.push(e+n),this._setPolygon(b)):a===DvtMarker.PLUS&&(a=g/3,n=2*a,b.push(d+a),b.push(e),b.push(d+n),b.push(e),b.push(d+n),b.push(e+a),b.push(d+g),b.push(e+a),
b.push(d+g),b.push(e+n),b.push(d+n),b.push(e+n),b.push(d+n),b.push(e+g),b.push(d+a),b.push(e+g),b.push(d+a),b.push(e+n),b.push(d),b.push(e+n),b.push(d),b.push(e+a),b.push(d+a),b.push(e+a),b.push(d+a),b.push(e),this._setPolygon(b));this._dims=new DvtRectangle(d,e,g,h)}};DvtCanvasMarker.prototype.getDefaultScale=function(){return this._defaultScale};DvtCanvasMarker.prototype.getCx=function(){return this._cx};DvtCanvasMarker.prototype.getCy=function(){return this._cy};
DvtCanvasMarker.prototype.getCmds=function(){return this._aCmds};DvtCanvasMarker.prototype.getPoints=function(){return this._arPoints};DvtCanvasMarker.prototype.getRadius=function(){return this._r};DvtCanvasMarker.prototype.getRect=function(){return new DvtRectangle(this._x,this._y,this._w,this._h)};DvtCanvasMarker.prototype.getType=function(){return this._type};
DvtCanvasMarker.prototype.RenderSelf=function(){DvtCanvasMarker.superclass.RenderSelf.call(this);var a=this.getCtx();a.save();var b=this.applyDrawAttrs();b!==DvtCanvasDrawUtils.NOACTION&&(a.beginPath(),this._type===DvtMarker.SQUARE?DvtCanvasDrawUtils.drawRect(a,this._x,this._y,this._w,this._h):this._type===DvtMarker.ROUNDED_RECTANGLE?DvtCanvasDrawUtils.drawRect(a,this._x,this._y,this._w,this._h,this._rx,this._ry):this._type===DvtMarker.CIRCLE?DvtCanvasDrawUtils.drawEllipse(a,this._cx,this._cy,this._r):
this._type===DvtMarker.TRIANGLE_UP||this._type===DvtMarker.TRIANGLE_DOWN||this._type===DvtMarker.DIAMOND||this._type===DvtMarker.PLUS?DvtCanvasDrawUtils.drawPolygon(a,this._arPoints):this._type===DvtMarker.HUMAN?DvtCanvasDrawUtils.drawPath(a,this._aCmds):this._type===DvtMarker.IMAGE?a.drawImage(this._src,this._x,this._y,this._w,this._h):this._type===DvtMarker.CUSTOM?console.log("Custom Marker - to do"):console.log("Unknown Marker (type = "+this._type+" ???"),a.closePath(),b&DvtCanvasDrawUtils.FILL&&
a.fill(),b&DvtCanvasDrawUtils.STROKE&&a.stroke());a.restore()};DvtCanvasMarker.prototype._setCx=function(a){this._cx=a};DvtCanvasMarker.prototype._setCy=function(a){this._cy=a};DvtCanvasMarker.prototype._setX=function(a){this._x=a};DvtCanvasMarker.prototype._setY=function(a){this._y=a};DvtCanvasMarker.prototype._setWidth=function(a){this._w=a};DvtCanvasMarker.prototype._setHeight=function(a){this._h=a};DvtCanvasMarker.prototype._setRadius=function(a){this._r=a};
DvtCanvasMarker.prototype._setRx=function(a){a!==this._rx&&(this._rx=a)};DvtCanvasMarker.prototype._setRy=function(a){a!==this._ry&&(this._ry=a)};DvtCanvasMarker.prototype._setPolygon=function(a){this._arPoints=a};DvtCanvasMarker.prototype._setCmds=function(a){a!==this._cmds&&(this._cmds=a,this._aCmds=DvtPathUtils.createPathArray(a))};DvtCanvasMarker.prototype.setMatrix=function(a){DvtCanvasMarker.superclass.setMatrix.call(this,a)};
DvtCanvasMarker.prototype.setAlpha=function(a){DvtCanvasMarker.superclass.setAlpha.call(this,a)};DvtCanvasMarker.prototype.setFill=function(a){DvtCanvasMarker.superclass.setFill.call(this,a)};DvtCanvasMarker.prototype.setStroke=function(a){DvtCanvasMarker.superclass.setStroke.call(this,a)};DvtCanvasMarker.prototype.getUnderlay=function(){return this._underlay};DvtCanvasMarker.prototype.setMouseEnabled=function(a){DvtCanvasMarker.superclass.setMouseEnabled.call(this,a)};
DvtCanvasMarker.prototype.setHollow=function(a,b){DvtCanvasMarker.superclass.setHollow.call(this,a,b)};DvtCanvasMarker.prototype._setPoints=function(a){a!==this._points&&(this._points=a)};DvtCanvasMarker.prototype._setX1=function(a){this._x1=a};DvtCanvasMarker.prototype._setY1=function(a){this._y1=a};DvtCanvasMarker.prototype._setX2=function(a){this._x2=a};DvtCanvasMarker.prototype._setY2=function(a){this._y2=a};DvtCanvasMarker.prototype._isMultiPaths=function(){return!1};
DvtCanvasMarker.prototype._setSrc=function(a){a!==this._src&&(this._src=a)};DvtCanvasMarker.prototype.UpdateMarkerImage=function(){this.getObj().isHoverEffectShown()?this.getObj().isSelected()?this._setSrc(this.getObj().GetMarkerImage(DvtMarker.IMAGE_SOURCE_HOVER_SELECTED)):this._setSrc(this.getObj().GetMarkerImage(DvtMarker.IMAGE_SOURCE_HOVER)):this.getObj().isSelected()?this._setSrc(this.getObj().GetMarkerImage(DvtMarker.IMAGE_SOURCE_SELECTED)):this._setSrc(this.getObj().GetMarkerImage(DvtMarker.IMAGE_SOURCE))};
var DvtCanvasOval=function(a,b,d,e,g){this._Init(a,b,d,e,g)};DvtObj.createSubclass(DvtCanvasOval,DvtCanvasCircle,"DvtCanvasOval");DvtCanvasOval.prototype._Init=function(a,b,d,e,g,h){DvtCanvasOval.superclass._Init.call(this,a,b,d,e,h,"ellipse");this.setRx(e);this.setRy(g);this.setRadius(null)};DvtCanvasOval.prototype.getRx=function(){return this._rx};DvtCanvasOval.prototype.setRx=function(a){a!==this._rx&&(this._rx=a)};DvtCanvasOval.prototype.getRy=function(){return this._ry};
DvtCanvasOval.prototype.setRy=function(a){a!==this._ry&&(this._ry=a)};var DvtCanvasPath=function(a,b,d){this._Init(a,b,d)};DvtObj.createSubclass(DvtCanvasPath,DvtCanvasShape,"DvtCanvasPath");DvtCanvasPath.prototype._Init=function(a,b,d){DvtCanvasPath.superclass._Init.call(this,a,d,"path");DvtArrayUtils.isArray(b)?this.setCmds(DvtPathUtils.getPathString(b)):this.setCmds(b)};
DvtCanvasPath.prototype.RenderSelf=function(){DvtCanvasPath.superclass.RenderSelf.call(this);var a=this.getCtx();a.save();var b=this.applyDrawAttrs();b!==DvtCanvasDrawUtils.NOACTION&&(a.beginPath(),DvtCanvasDrawUtils.drawPath(a,this._aCmds),a.closePath(),b&DvtCanvasDrawUtils.FILL&&a.fill(),b&DvtCanvasDrawUtils.STROKE&&(this._shadow&&b&DvtCanvasDrawUtils.FILL&&(a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowColor="rgba(0,0,0,0)",a.shadowBlur=0),a.stroke()));a.restore()};
DvtCanvasPath.prototype.getCmds=function(){return DvtPathUtils.getPathString(this._aCmds)};DvtCanvasPath.prototype.setCmds=function(a){var b=null;a&&(b=DvtPathUtils.createPathArray(a));this._aCmds=b};DvtCanvasPath.prototype.getCommands=function(){var a=this._aCmds;!a&&this._sCmds&&(this._aCmds=a=DvtPathUtils.createPathArray(this._sCmds));return a};DvtCanvasPath.prototype.setCommands=function(a){this._aCmds=a;this._sCmds=this.getCmds()};
DvtCanvasPath.prototype.setMatrix=function(a){DvtCanvasPath.superclass.setMatrix.call(this,a)};DvtCanvasPath.prototype.setAlpha=function(a){DvtCanvasPath.superclass.setAlpha.call(this,a)};DvtCanvasPath.prototype.setFill=function(a){DvtCanvasPath.superclass.setFill.call(this,a)};DvtCanvasPath.prototype.setStroke=function(a){DvtCanvasPath.superclass.setStroke.call(this,a)};var DvtCanvasPolygon=function(a,b,d){this._Init(a,b,d)};DvtObj.createSubclass(DvtCanvasPolygon,DvtCanvasShape,"DvtCanvasPolygon");
DvtCanvasPolygon.prototype._Init=function(a,b,d){DvtCanvasPolygon.superclass._Init.call(this,a,d,"polygon");this.setPoints(b)};DvtCanvasPolygon.prototype.getPoints=function(){return this._arPoints};DvtCanvasPolygon.prototype.setPoints=function(a){this._arPoints=a};
DvtCanvasPolygon.prototype.RenderSelf=function(){DvtCanvasPolygon.superclass.RenderSelf.call(this);if(!(this._arPoints&&2>=this._arPoints.length)){var a=this.getCtx();a.save();var b=this.applyDrawAttrs();if(b!==DvtCanvasDrawUtils.NOACTION){a.beginPath();var d=this.getStroke(),d=d?d.getDash():null;DvtCanvasDrawUtils.drawPolygon(a,this._arPoints,d);a.closePath();b&DvtCanvasDrawUtils.FILL&&a.fill();b&DvtCanvasDrawUtils.STROKE&&a.stroke()}a.restore()}};
var DvtCanvasPolyline=function(a,b,d){this._Init(a,b,d)};DvtObj.createSubclass(DvtCanvasPolyline,DvtCanvasShape,"DvtCanvasPolyline");DvtCanvasPolyline.prototype._Init=function(a,b,d){DvtCanvasPolyline.superclass._Init.call(this,a,d,"polyline");this.setPoints(b)};DvtCanvasPolyline.prototype.getPoints=function(){return this._arPoints};DvtCanvasPolyline.prototype.setPoints=function(a){this._arPoints=a};
DvtCanvasPolyline.prototype.RenderSelf=function(){DvtCanvasPolyline.superclass.RenderSelf.call(this);if(this._arPoints){var a=this._arPoints.length;if(!(2>=a)){var b=this.getCtx();b.save();var d=this.applyDrawAttrs();if(d!==DvtCanvasDrawUtils.NOACTION){var e=this.getStroke().getDash();b.beginPath();if(e)for(var a=a-2,g=0;g<a;g+=2)DvtCanvasDrawUtils.drawDashedLine(b,this._arPoints[g],this._arPoints[g+1],this._arPoints[g+2],this._arPoints[g+3],e);else{b.moveTo(this._arPoints[0],this._arPoints[1]);for(g=
2;g<a;g+=2)b.lineTo(this._arPoints[g],this._arPoints[g+1])}d&DvtCanvasDrawUtils.FILL&&b.fill();d&DvtCanvasDrawUtils.STROKE&&b.stroke();b.closePath()}b.restore()}}};var DvtCanvasRect=function(a,b,d,e,g,h){this._Init(a,b,d,e,g,h)};DvtObj.createSubclass(DvtCanvasRect,DvtCanvasShape,"DvtCanvasRect");DvtCanvasRect._cssAttrs=["background-color","border-color","border-width"];
DvtCanvasRect.prototype._Init=function(a,b,d,e,g,h){DvtCanvasRect.superclass._Init.call(this,a,h,"rect");this.setX(b);this.setY(d);this.setWidth(e);this.setHeight(g)};DvtCanvasRect.prototype.getX=function(){return this._x};DvtCanvasRect.prototype.setX=function(a){a!==this._x&&(this._x=a)};DvtCanvasRect.prototype.getY=function(){return this._y};DvtCanvasRect.prototype.setY=function(a){a!==this._y&&(this._y=a)};DvtCanvasRect.prototype.getWidth=function(){return this._w};
DvtCanvasRect.prototype.setWidth=function(a){a!==this._w&&(this._w=a)};DvtCanvasRect.prototype.getHeight=function(){return this._h};DvtCanvasRect.prototype.setHeight=function(a){a!==this._h&&(this._h=a)};DvtCanvasRect.prototype.getRx=function(){return this._rx};DvtCanvasRect.prototype.setRx=function(a){a!==this._rx&&(this._rx=a)};DvtCanvasRect.prototype.getRy=function(){return this._ry};DvtCanvasRect.prototype.setRy=function(a){a!==this._ry&&(this._ry=a)};
DvtCanvasRect.prototype.setCSSStyle=function(a){DvtCanvasRect.superclass.setCSSStyle.call(this,a);var b=this._elem;if(a){var d=a["background-color"];d&&b.setAttributeNS(null,"fill",d);(d=a["border-color"])&&b.setAttributeNS(null,"stroke",d);(d=a["border-width"])&&b.setAttributeNS(null,"stroke-width",d)}else this._elem.removeAttributeNS(null,"style")};DvtCanvasRect._removeDefaultAttributes=function(){};
DvtCanvasRect.prototype.RenderSelf=function(){DvtCanvasRect.superclass.RenderSelf.call(this);var a=this.getCtx(),b=this.getStroke(),b=b?b.getDash():null;a.save();var d=this.applyDrawAttrs();d!==DvtCanvasDrawUtils.NOACTION&&(a.beginPath(),DvtCanvasDrawUtils.drawRect(a,this._x,this._y,this._w,this._h,this._rx,this._ry,b),a.closePath(),this._rx&&d&DvtCanvasDrawUtils.FILL&&a.fill(),d&DvtCanvasDrawUtils.STROKE&&a.stroke());a.restore()};var DvtCanvasText=function(a,b,d,e,g){this._Init(a,b,d,e,g)};
DvtObj.createSubclass(DvtCanvasText,DvtCanvasShape,"DvtCanvasText");DvtCanvasText.prototype._Init=function(a,b,d,e,g){DvtCanvasText.superclass._Init.call(this,a,g,"text");this.setTextString(b);this.setX(d);this.setY(e);this._angle=0;this.setFontFamily("tahoma, sans-serif");this.setCursor("default")};DvtCanvasText.prototype.getTextString=function(){return this._text};DvtCanvasText.prototype.setTextString=function(a){this._text=""+a};DvtCanvasText.prototype.getAngle=function(){return this._angle};
DvtCanvasText.prototype.setAngle=function(a){a%=360;0<a&&(a=360-a);this._angle!==a&&(this._angle=a)};DvtCanvasText.prototype.getRotatePoint=function(){var a;this._cx&&(a=new DvtPoint(this._cx,this._cy));return a};DvtCanvasText.prototype.setRotatePoint=function(a,b){this._cx=a;this._cy=b};DvtCanvasText.prototype.getX=function(){return this._x};DvtCanvasText.prototype.setX=function(a){a!==this._x&&(this._x=a)};DvtCanvasText.prototype.getY=function(){return this._y};
DvtCanvasText.prototype.setY=function(a){a!==this._y&&(this._y=a)};DvtCanvasText.prototype.getAnchor=function(){return this._anchor};DvtCanvasText.prototype.getBaseline=function(){return this._baseline};DvtCanvasText.prototype.getFontFamily=function(){return this._fontFamily};DvtCanvasText.prototype.setFontFamily=function(a){var b=this.getCSSStyle();b&&b.setFontFamily(a);this._fontFamily=a};DvtCanvasText.prototype.setFontSize=function(a){this._fontSize=a;var b=this.getCSSStyle();b&&b.setFontSize(a)};
DvtCanvasText.prototype.alignStart=function(){this._anchor="start"};DvtCanvasText.prototype.alignMiddle=function(){this._anchor="center"};DvtCanvasText.prototype.alignEnd=function(){this._anchor="right"};DvtCanvasText.prototype.alignTop=function(){this._baseLine="top"};DvtCanvasText.prototype.alignCenter=function(){this._baseLine="middle"};DvtCanvasText.prototype.alignBottom=function(){this._baseLine="alphabetic"};DvtCanvasText.prototype.alignBaseline=function(){this._baseLine=void 0};
DvtCanvasText.prototype.setText=function(a){this._text=""+a};DvtCanvasText.prototype.getText=function(){return this._text};
DvtCanvasText.prototype.setCSSStyle=function(a){DvtCanvasText.superclass.setCSSStyle.call(this,a);if(a){a.color&&this.setFill(new DvtSolidFill(a.color));(val=a["font-family"])?this._fontFamily=val:this._fontFamily&&a.setCSSStyle("font-family",this._fontFamily);if(val=a["font-size"])this._fontSize=val;if(val=a["font-style"])this._fontStyle=val;if(val=a["font-weight"])this._fontWeight=val;if(val=a["text-align"])this._textAlign=val;if(val=a["text-decoration"])this._text_decoration=val;color=a.color}};
DvtCanvasText.prototype.getEditMode=function(){return null};DvtCanvasText.prototype.setEditMode=function(){};DvtCanvasText.prototype.getEditWdith=function(){return 0};DvtCanvasText.prototype.setEditWidth=function(){};DvtCanvasText.prototype.setEditTooltip=function(){};
DvtCanvasText.prototype.RenderSelf=function(){DvtCanvasText.superclass.RenderSelf.call(this);var a=this.getCtx();a.save();var b=this.applyDrawAttrs();a.beginPath();DvtCanvasDrawUtils.drawText(a,this._text,this._x,this._y,this._angle,this._cx,this._cy,this._fontFamily,this._fontSize,this._fontStyle,this._fontWeight,this._baseLine,this._anchor);a.closePath();b&DvtCanvasDrawUtils.FILL&&a.fill();b&DvtCanvasDrawUtils.STROKE&&a.stroke();a.restore()};
var DvtCanvasTextArea=function(a,b,d,e){this._Init.call(this,a,b,d,e)};DvtObj.createSubclass(DvtCanvasTextArea,DvtCanvasText,"DvtCanvasTextArea");DvtCanvasTextArea.prototype._Init=function(a,b,d,e){void 0===b&&void 0===d&&(d=b=0,this._notGraph=!0);DvtCanvasTextArea.superclass._Init.call(this,a,"",b,d,e);this._leading=0};
DvtCanvasTextArea.prototype.setText=function(a){var b,d=1;DvtArrayUtils.isArray(a)?(d=a.length,1==d&&(b=a[0])):b=a;var e=this.getObj();if(0===e.getNumChildren()&&b)DvtCanvasTextArea.superclass.setText.call(this,b);else{var g,h,k,m,n;for(b=0;b<d;b++)if(0===b)DvtCanvasTextArea.superclass.setText.call(this,a[0]),g=e.getCSSStyle(),h=e.getFill(),k=e.getX(),m=e.getY(),n=e.getDimensions().h;else{m+=n;var o=new DvtText(e.getContext(),a[b],k,m);o.setCSSStyle(g);o.setFill(h);e.addChild(o)}}};
DvtCanvasTextArea.prototype.getText=function(){var a=this.getObj(),b=a.getNumChildren();if(0==b)return DvtCanvasTextArea.superclass.getText.call(this);for(var d,e="",g=0;g<b;g++)d=a.getChildAt(g),e+=d.getText();return e};DvtCanvasTextArea.prototype.getLeading=function(){return this._leading};DvtCanvasTextArea.prototype.setLeading=function(a){this._leading=a};DvtCanvasTextArea.prototype._addLine=function(a,b,d,e){a=this._createTSpan(b);a.setAttributeNS(null,"x",d);a.setAttributeNS(null,"dy",e+this.getLeading())};
DvtCanvasTextArea.prototype._addTextLine=function(a,b,d,e,g){a=new DvtSvgText(b,d,e,null);b=this.getElem().firstChild;null==b&&(b=this.getElem());(d=b.getAttributeNS(null,"dominant-baseline"))&&a.getElem().setAttributeNS(null,"dominant-baseline",d);(d=g?g:b.getAttributeNS(null,"text-anchor"))&&a.getElem().setAttributeNS(null,"text-anchor",d);(d=b.getAttributeNS(null,"font-family"))&&a.getElem().setAttributeNS(null,"font-family",d);(d=b.getAttributeNS(null,"font-size"))&&a.getElem().setAttributeNS(null,
"font-size",d);(d=b.getAttributeNS(null,"fill"))&&a.getElem().setAttributeNS(null,"fill",d);(d=b.getAttributeNS(null,"unicode-bidi"))&&DvtStyleUtils.isLocaleR2L()&&a.getElem().setAttributeNS(null,"unicode-bidi",d);this.addChild(a)};var DvtCanvasDrawUtils={};DvtObj.createSubclass(DvtCanvasDrawUtils,DvtObj,"DvtCanvasDrawUtils");DvtCanvasDrawUtils.NOACTION=0;DvtCanvasDrawUtils.FILL=1;DvtCanvasDrawUtils.STROKE=2;
DvtCanvasDrawUtils.applyClipRegion=function(a,b){var d=b._regions,e;if(d){if(DvtArrayUtils.isArray(d))for(var g=d.length,h=0;h<g&&!(e=d[h],e.type===DvtClipPath.RECT);h++);else e=d;e&&e.type===DvtClipPath.RECT&&(a.rect(e.x,e.y,e.w,e.h),a.clip())}};
DvtCanvasDrawUtils.applyDrawAttrs=function(a,b){var d,e,g=DvtCanvasDrawUtils.NOACTION;b.getFill&&(d=b.getFill());b.getStroke&&(e=b.getStroke());if(d||e)g=DvtCanvasDrawUtils.applyFill(a,d,b)|DvtCanvasDrawUtils.applyStroke(a,e);b._shadow&&(d=b._shadow,a.shadowOffsetX=0.7*d._distance,a.shadowOffsetY=0.7*d._distance,a.shadowBlur=1.2*d._blurX,a.shadowColor=d._rgba);return g};
DvtCanvasDrawUtils.applyFill=function(a,b,d){if(!b)return a.fillStyle="rgba(0,0,0,0)",DvtCanvasDrawUtils.NOACTION;if(b instanceof DvtSolidFill){d=b.getColor();if("none"===d)return a.fillStyle="rgba(0,0,0,0)",DvtCanvasDrawUtils.NOACTION;var b=b.getAlpha(),e=DvtColorUtils.getAlpha(d);b!==e&&(DvtColorUtils.isColor(d,!1)||(d=DvtColorUtils.getColorFromName(d)),d=DvtColorUtils.setAlpha(d,b*e));a.fillStyle=d}else b instanceof DvtGradientFill?DvtCanvasDrawUtils._applyGradientFill(a,b,d):a.fillStyle="rgba(0,0,0,0)";
return DvtCanvasDrawUtils.FILL};DvtCanvasDrawUtils.applyStroke=function(a,b){var d=DvtCanvasDrawUtils.NOACTION;if(b instanceof DvtSolidStroke){a.lineWidth=b.getWidth();var d=b.getColor(),e=b.getAlpha(),g=DvtColorUtils.getAlpha(d);e!==g&&(DvtColorUtils.isColor(d,!1)||(d=DvtColorUtils.getColorFromName(d)),d=DvtColorUtils.setAlpha(d,e*g));a.strokeStyle=d;d=b.getLineEnd();d||(d=DvtStroke.SQUARE);a.lineEnd=d;if(d=b.getLineJoin())d===DvtStroke.SQUARE&&(d=null),d&&(a.lineJoin=d);d=DvtCanvasDrawUtils.STROKE}return d};
DvtCanvasDrawUtils._applyGradientFill=function(a,b,d){var e,g=b.getColors(),h=b.getAlphas(),k=b.getStops(),m=b.getBounds(),n=m?m[2]:0,o=m?m[3]:0;if(b instanceof DvtLinearGradientFill)if(angle=Math.floor(b.getAngle()+360)%360,0===angle%90)0===angle?e=a.createLinearGradient(m[0],m[1],m[0]+n,m[1]):90==angle?e=a.createLinearGradient(m[0],m[1]+o,m[0],m[1]):180===angle?e=a.createLinearGradient(m[0]+n,m[1],m[0],m[1]):270===angle&&(e=a.createLinearGradient(m[0],m[1],m[0],m[1]+o));else{var b=90>angle,d=90<
angle&&180>angle,q=180<angle&&270>angle,s=270<angle&&360>angle;if(q||s)angle-=180;var n=m[2],o=m[3],t=Math.tan(angle*DvtMath.RADS_PER_DEGREE),u;b||q?(u=(n+o*t)/(1+t*t),t*=u):(u=(o*t+n*t*t)/(1+t*t),t*=u-n);u+=m[0];t=m[1]+o-t;b?e=a.createLinearGradient(m[0],m[1]+o,u,t):q?e=a.createLinearGradient(u,t,m[0],m[1]+o):d?e=a.createLinearGradient(m[0]+n,m[1]+o,u,t):s&&(e=a.createLinearGradient(u,t,m[0]+n,m[1]+o))}else b instanceof DvtRadialGradientFill&&(b.getCx()?e=a.createRadialGradient(b.getCx(),b.getCy(),
0,b.getCx(),b.getCy(),b.getRadius()):(e=!m||m&&0===m[2]&&0===m[3]?d.getDimensions():new DvtRectangle(m[0],m[1],m[2],m[3]),n=e.w,o=e.h,m=Math.max(n,o)/2,n/=2,o/=2,e=a.createRadialGradient(e.x+n,e.y+o,0,e.x+n,e.y+o,m)));if(e){n=k.length;for(o=0;o<n;o++)e.addColorStop(k[o],DvtColorUtils.setAlpha(g[o],h[o]));a.fillStyle=e}};
DvtCanvasDrawUtils.drawDashedLine=function(a,b,d,e,g,h){h=h.split(",");DvtArrayUtils.toFloat(h);var k=h.length,e=e-b,m=g-d,g=m/e,e=Math.sqrt(e*e+m*m),m=0,n=!0;for(a.moveTo(b,d);0.1<=e;){var o=h[m%k];o>e&&(o=e);var q=Math.sqrt(o*o/(1+g*g)),b=b+q,d=d+g*q;n?a.lineTo(b,d):a.moveTo(b,d);e-=o;n=!n;m++}};
DvtCanvasDrawUtils.drawArc=function(a,b,d,e,g,h,k,m){var n=!1,g=null===g||isNaN(g)?0:g;e!==g&&(a.save(),n=!0,g/=e,a.scale(1,g),d/=g);h=-h*DvtMath.RADS_PER_DEGREE;k=-k*DvtMath.RADS_PER_DEGREE;a.arc(b,d,e,h,h+k,h+k<h);m&&m!==DvtArc.CHORD&&m===DvtArc.PIE&&a.lineTo(b,d);n&&a.restore()};DvtCanvasDrawUtils.drawEllipse=function(a,b,d,e,g){var h=!1,g=null===g||isNaN(g)?0:g;0<g&&(a.save(),h=!0,g/=e,a.scale(1,g),d/=g);a.arc(b,d,e,0,2*Math.PI,!1);h&&a.restore()};
DvtCanvasDrawUtils.continueLine=function(a,b,d,e,g,h){var k=0,m=0;d!==g&&b===e?k=0.5:b!==e&&d===g&&(m=0.5);h?DvtCanvasDrawUtils.drawDashedLine(a,b,d,e,g,h):a.lineTo(k+e,m+g)};DvtCanvasDrawUtils.drawLine=function(a,b,d,e,g,h){var k=b,m=d,n=0,o=0;m!==g&&k===e?n=0.5:k!==e&&m===g&&(o=0.5);k+=n;m+=o;h?DvtCanvasDrawUtils.drawDashedLine(a,b,d,e,g,h):(a.moveTo(k,m),a.lineTo(n+e,o+g))};
DvtCanvasDrawUtils.drawPath=function(a,b){for(var d=b.length,e,g,h,k=!0,m=!1,n,o,q,s,t,u,v=0;v<d;v++)switch(n=!1,e=b[v],e){case "m":n=!0;case "M":do e=b[v+1],o=b[v+2],k?k=!1:n&&(e+=g,o+=h),m?a.lineTo(e,o):(a.moveTo(e,o),m=!0),g=e,h=o,v+=2;while(!isNaN(b[v+1]));m=!1;break;case "c":n=!0;case "C":do e=b[v+1],o=b[v+2],q=b[v+3],s=b[v+4],t=b[v+5],u=b[v+6],n&&(e+=g,o+=h,q+=g,s+=h,t+=g,u+=h),a.bezierCurveTo(e,o,q,s,t,u),g=t,h=u,v+=6;while(!isNaN(b[v+1]));break;case "q":n=!0;case "Q":do e=b[v+1],o=b[v+2],
q=b[v+3],s=b[v+4],n&&(e+=g,o+=h,q+=g,s+=h),a.quadraticCurveTo(e,o,q,s),g=q,h=s,v+=4;while(!isNaN(b[v+1]));break;case "l":n=!0;case "L":do e=b[v+1],o=b[v+2],n&&(e+=g,o+=h),a.lineTo(e,o),g=e,h=o,v+=2;while(!isNaN(b[v+1]));break;case "h":n=!0;case "H":do e=b[v+1],n&&(e+=g),a.lineTo(e,h),g=e,v+=1;while(!isNaN(b[v+1]));break;case "v":n=!0;case "V":do o=b[v+1],n&&(o+=h),a.lineTo(g,o),h=o,v+=1;while(!isNaN(b[v+1]));break;case "z":case "Z":a.lineTo(g,h);break;default:console.log("Unknown path cmd="+e+"  i="+
v)}};DvtCanvasDrawUtils.drawPolygon=function(a,b){var d=b.length;a.moveTo(b[0],b[1]);for(var e=2;e<d;e+=2)a.lineTo(b[e],b[e+1]);e=d-2;b[0]===b[e]&&b[1]===b[e+1]||a.lineTo(b[e],b[e+1],b[0],b[1])};DvtCanvasDrawUtils.drawPolyline=function(a,b){if(b){var d=b.length;if(!(2>=d))for(var e=2;e<d;e+=2)DvtCanvasDrawUtils.drawLine(a,b[e],b[e+1],b[e+2],b[e+3],arGaps)}};
DvtCanvasDrawUtils.drawRect=function(a,b,d,e,g,h,k,m){h=null===h||isNaN(h)?0:h;k=null===k||isNaN(k)?0:k;h=Math.max(h,k);0===h?(a.moveTo(b+1+0.5,d+0.5),a.lineTo(b+e+0.5,d+0.5),a.lineTo(b+e+0.5,d+g+0.5),a.lineTo(b+0.5,d+g+0.5),a.lineTo(b+0.5,d+0.5),a.lineTo(b+1+0.5,d+0.5),h=!0,"string"===typeof a.fillStyle&&(h=0<DvtColorUtils.getAlpha(a.fillStyle)),h&&a.fillRect(b,d,e,g)):DvtCanvasDrawUtils.drawRoundRect(a,b,d,e,g,h,m)};
DvtCanvasDrawUtils.drawRoundRect=function(a,b,d,e,g,h){a.moveTo(b,d+h);a.lineTo(b,d+g-h);a.quadraticCurveTo(b,d+g,b+h,d+g);a.lineTo(b+e-h,d+g);a.quadraticCurveTo(b+e,d+g,b+e,d+g-h);a.lineTo(b+e,d+h);a.quadraticCurveTo(b+e,d,b+e-h,d);a.lineTo(b+h,d);a.quadraticCurveTo(b,d,b,d+h)};
DvtCanvasDrawUtils.drawText=function(a,b,d,e,g,h,k,m,n,o,q,s,t){var d=null===d||isNaN(d)?0:d,e=null===e||isNaN(e)?0:e,u=(n=n?n:"11")&&n.indexOf&&0<n.indexOf("px")?"":"px";a.font=(o?o+" ":"")+(q?q+" ":"")+n+u+" "+m;a.textBaseline=s?s:"alphabetic";t&&(a.textAlign=t);0!==g&&(a.translate(h,k),a.rotate(g*Math.PI/180),a.translate(-h,-k));a.fillText(b,d,e)};var DvtCanvasTextUtils={};DvtObj.createSubclass(DvtCanvasTextUtils,DvtObj,"DvtCanvasTextUtils");
DvtCanvasTextUtils.measureText=function(a,b,d,e,g){var d=d?d:11,h=DvtCanvasUtils.createCanvasDocument(400,400).getContext("2d"),k="";d&&d.indexOf&&(k=0<d.indexOf("px")?"":"px");h.font=(e?e+" ":"")+(g?g+" ":"")+d+k+" "+b;b=h.measureText(a);a=b.width;b=h.measureText("e");h=2*b.width;h++;return new DvtRectangle(0,0,a,h)};var DvtCanvasDocumentUtils=function(){};DvtObj.createSubclass(DvtCanvasDocumentUtils,DvtDocumentUtils,"DvtCanvasDocumentUtils");
DvtCanvasDocumentUtils.isFilterSupported=function(){var a=DvtAgent.getAgent(),b=a.getPlatform(),a=-1!=a.getName().indexOf("chrome/");return!(b===DvtAgent.IE_PLATFORM||b===DvtAgent.WEBKIT_PLATFORM&&!a)};DvtCanvasDocumentUtils.isStrokeTimeoutRequired=function(){return DvtAgent.getAgent().isChrome()};