var DvtAbstractComponent=function(a){this.Init(a)};DvtObj.createSubclass(DvtAbstractComponent,DvtContainer,"DvtAbstractComponent");DvtAbstractComponent.LOAD_XML_INITIAL="initial";DvtAbstractComponent._DEFAULT_BACKGROUND_COLOR="#7396C8";DvtAbstractComponent._ELEM_ROOT="r";DvtAbstractComponent._ATTR_INLINE_STYLE="inlineStyle";DvtAbstractComponent._ATTR_SKIN_STYLE="skinStyle";DvtAbstractComponent._ATTR_SKIN_NAME="skin";DvtAbstractComponent._ATTR_CTRLPANEL_BACKGROUND_COLOR="cpBackgroundColor";
DvtAbstractComponent._ATTR_CTRLPANEL_BORDER_COLOR="cpBorderColor";DvtAbstractComponent._ATTR_CTRLPANEL_BOX_SHADOW="cpBoxShadow";DvtAbstractComponent._ATTR_CTRLPANEL_BORDER_RADIUS="cpBorderRadius";DvtAbstractComponent.BOX_SHADOW="box-shadow";DvtAbstractComponent.BG_ALPHA="background-alpha";DvtAbstractComponent._ATTR_TAB_BG_COLOR_INACTIVE="tabBorderColorInactive";DvtAbstractComponent._ATTR_TAB_BORDER_COLOR_INACTIVE="tabBgColorInactive";DvtAbstractComponent.TAB_BG_COLOR_INACTIVE="tab-color-inactive";
DvtAbstractComponent.TAB_BORDER_COLOR_INACTIVE="tab-border-color-inactive";DvtAbstractComponent.CP_BUTTON_WIDTH="button-width";DvtAbstractComponent.CP_BUTTON_HEIGHT="button-height";DvtAbstractComponent.CP_TAB_SIZE="tab-size";DvtAbstractComponent.CP_PADDING_TOP="padding-top";DvtAbstractComponent.CP_PADDING_SIDE="padding-side";DvtAbstractComponent.CP_PRIME="prime-style";DvtAbstractComponent.CP_IMAGE_WIDTH="image-width";DvtAbstractComponent.CP_IMAGE_HEIGHT="image-height";
DvtAbstractComponent.prototype.Init=function(a){DvtAbstractComponent.superclass.Init.call(this,a);this._backgroundPane=new DvtRect(a,0,0,0,0);this.addChild(this._backgroundPane);this._controlPanelStyleMap=this._compCSSStyle=this._resourcesMap=null;this._skinName="";this._bRenderNullXml=!1};DvtAbstractComponent.prototype.getBackgroundPane=function(){return this._backgroundPane};DvtAbstractComponent.prototype.renderComponent=function(){this.InitComponentInternal();this.RenderComponentInternal()};
DvtAbstractComponent.prototype.InitComponentInternal=function(){this._bAbsCompRendered=!1};DvtAbstractComponent.prototype.RenderComponentInternal=function(){this._bAbsCompRendered||this.RenderBackground();this._bAbsCompRendered=!0};DvtAbstractComponent.prototype.loadXml=function(a,b,d,e){var g=this.GetXmlStringParser();if(g&&(a=g.parse(a)))a.getName()===DvtAbstractComponent._ELEM_ROOT&&(a=a.getFirstChild()),a&&this.LoadXmlDom(b,a,d,e)};DvtAbstractComponent.prototype.GetXmlStringParser=function(){return new DvtXmlParser(this.getContext())};
DvtAbstractComponent.prototype.LoadXmlDom=function(a,b,d,e){switch(a){default:this.LoadXmlInitial(a,b,d,e)}};DvtAbstractComponent.prototype.LoadXmlInitial=function(){};DvtAbstractComponent.prototype.render=function(a,b,d){this._width=b;this._height=d;this._backgroundPane.setWidth(this._width);this._backgroundPane.setHeight(this._height);a||(this._bRenderNullXml=!0);this.loadXml(a);this.renderComponent();this._bRenderNullXml=!1;this.getContext().queueRender()};
DvtAbstractComponent.prototype.setBackgroundColor=function(a){this._backgroundColor=a};DvtAbstractComponent.prototype.RenderBackground=function(){if(this.getComponentStyle()){var a=this._getBackgroundFill();a&&this._backgroundPane.setFill(a)}else"none"!=this._backgroundColor?(a=this._getBackgroundGradient(this._backgroundColor),this._backgroundPane.setFill(a)):(this._backgroundPane.setFill(new DvtSolidFill("#FFFFFF",0)),this._backgroundPane.setStroke(new DvtSolidStroke("#FFFFFF",0)))};
DvtAbstractComponent.prototype._getBackgroundFill=function(){var a=this.getComponentStyle();if(a){var b=a[DvtCSSStyle.FILL_TYPE],a=a[DvtCSSStyle.BACKGROUND_COLOR];a||(a=DvtAbstractComponent._DEFAULT_BACKGROUND_COLOR);return"solid"==b?new DvtSolidFill(a):this._getBackgroundGradient(a)}};
DvtAbstractComponent.prototype._getBackgroundGradient=function(a){var b=DvtAbstractComponent._DEFAULT_BACKGROUND_COLOR,d=1;if(a&&a!=b)var d=DvtColorUtils.getAlpha(a),e=(DvtColorUtils.getRed("#AECDEA")-DvtColorUtils.getRed(b))/(255-DvtColorUtils.getRed(b)),g=(DvtColorUtils.getGreen("#AECDEA")-DvtColorUtils.getGreen(b))/(255-DvtColorUtils.getGreen(b)),b=(DvtColorUtils.getBlue("#AECDEA")-DvtColorUtils.getBlue(b))/(255-DvtColorUtils.getBlue(b)),h=DvtColorUtils.getRed(a),k=DvtColorUtils.getGreen(a),m=
DvtColorUtils.getBlue(a),e=Math.round(h+e*(255-h)),g=Math.round(k+g*(255-k)),b=Math.round(m+b*(255-m)),g=DvtColorUtils.makeRGB(e,g,b),a=DvtColorUtils.getRGB(a),a=["#FFFFFF","#FFFFFF",g,a];else a=["#FFFFFF","#FFFFFF","#AECDEA",b];var d=[d,d,d,d],g=[0,45/255,190/255,1],e=this._width,b=1.7*1.7*e,m=1.7*this._height,e=0+(e-b)/2,k=e+b/2,h=-35+m/2,n=1.5*Math.min(b/2,m/2);return new DvtRadialGradientFill(a,d,g,k,h,n,[e,-35,b,m])};DvtAbstractComponent.prototype.GetWidth=function(){return this._width};
DvtAbstractComponent.prototype.GetHeight=function(){return this._height};DvtAbstractComponent.prototype.getResourcesMap=function(){this._resourcesMap||(this._resourcesMap={});return this._resourcesMap};DvtAbstractComponent.prototype.setSkinName=function(a){this._skinName=a};DvtAbstractComponent.prototype.getSkinName=function(){return this._skinName};DvtAbstractComponent.prototype.setComponentStyle=function(a){this._compCSSStyle=a};DvtAbstractComponent.prototype.getComponentStyle=function(){return this._compCSSStyle};
DvtAbstractComponent.prototype.setControlPanelStyleMap=function(a){this._controlPanelStyleMap=a};DvtAbstractComponent.prototype.getControlPanelStyleMap=function(){return this._controlPanelStyleMap};
DvtAbstractComponent.prototype.parseComponentAttrs=function(a){var b;b=this.parseComponentStyle(a.getAttribute(DvtAbstractComponent._ATTR_SKIN_STYLE),null);(b=this.parseComponentStyle(a.getAttribute(DvtAbstractComponent._ATTR_INLINE_STYLE),b))&&this.setComponentStyle(b);(b=a.getAttribute(DvtAbstractComponent._ATTR_SKIN_NAME))&&this.setSkinName(b);var d={};this.UsePanelDrawer()?(d[DvtCSSStyle.BACKGROUND_COLOR]=DvtPanelDrawer._BACKGROUND_COLOR,d[DvtCSSStyle.BORDER_COLOR]=DvtPanelDrawer._BORDER_COLOR,
d[DvtCSSStyle.BORDER_RADIUS]=DvtPanelDrawer._TAB_CORNER_RADIUS,d[DvtAbstractComponent.BOX_SHADOW]="none",d[DvtAbstractComponent.BG_ALPHA]=DvtPanelDrawer._BACKGROUND_ALPHA,d[DvtCSSStyle.FILL_TYPE]="solid",d[DvtAbstractComponent.TAB_BG_COLOR_INACTIVE]=a.getAttribute(DvtAbstractComponent._ATTR_TAB_BG_COLOR_INACTIVE),d[DvtAbstractComponent.TAB_BORDER_COLOR_INACTIVE]=a.getAttribute(DvtAbstractComponent._ATTR_TAB_BORDER_COLOR_INACTIVE),d[DvtAbstractComponent.CP_BUTTON_WIDTH]=DvtPanelDrawer._TAB_SIZE,d[DvtAbstractComponent.CP_BUTTON_HEIGHT]=
DvtPanelDrawer._TAB_SIZE,d[DvtAbstractComponent.CP_TAB_SIZE]=DvtPanelDrawer._TAB_SIZE,d[DvtAbstractComponent.CP_PADDING_TOP]=15,d[DvtAbstractComponent.CP_PADDING_SIDE]=0,d[DvtAbstractComponent.CP_PRIME]="on",d[DvtAbstractComponent.CP_IMAGE_WIDTH]=24,d[DvtAbstractComponent.CP_IMAGE_HEIGHT]=24):(d[DvtCSSStyle.BACKGROUND_COLOR]=a.getAttribute(DvtAbstractComponent._ATTR_CTRLPANEL_BACKGROUND_COLOR),d[DvtCSSStyle.BORDER_COLOR]=a.getAttribute(DvtAbstractComponent._ATTR_CTRLPANEL_BORDER_COLOR),d[DvtCSSStyle.BORDER_RADIUS]=
a.getAttribute(DvtAbstractComponent._ATTR_CTRLPANEL_BORDER_RADIUS),d[DvtAbstractComponent.BOX_SHADOW]=a.getAttribute(DvtAbstractComponent._ATTR_CTRLPANEL_BOX_SHADOW),b&&"skyros"==b?(d[DvtAbstractComponent.BG_ALPHA]=1,d[DvtCSSStyle.FILL_TYPE]="solid"):d[DvtCSSStyle.FILL_TYPE]=DvtPanZoomControlPanelLAFUtils.CONTROL_PANEL_DFLT_BG_FILL_TYPE);this.setControlPanelStyleMap(d)};DvtAbstractComponent.prototype.parseComponentStyle=function(a,b){a&&(b?b.merge(new DvtCSSStyle(a)):b=new DvtCSSStyle(a));return b};
var DvtAbstractPanZoomComponent=function(a){this.Init(a)};DvtObj.createSubclass(DvtAbstractPanZoomComponent,DvtAbstractComponent,"DvtAbstractPanZoomComponent");DvtAbstractPanZoomComponent.CONTROL_PANEL_BEHAVIOR_INIT_COLLAPSED="initCollapsed";DvtAbstractPanZoomComponent.CONTROL_PANEL_BEHAVIOR_INIT_EXPANDED="initExpanded";DvtAbstractPanZoomComponent.CONTROL_PANEL_BEHAVIOR_HIDDEN="hidden";DvtAbstractPanZoomComponent._PANNING_OFF=1;DvtAbstractPanZoomComponent._ZOOMING_OFF=2;
DvtAbstractPanZoomComponent._ZOOM_TO_FIT_OFF=4;DvtAbstractPanZoomComponent.PAN_ZOOM_KEY="panZoomInfo";DvtAbstractPanZoomComponent._CHANGE_LAYOUT_OFF=536870912;DvtAbstractPanZoomComponent.prototype.Init=function(a){DvtAbstractPanZoomComponent.superclass.Init.call(this,a);this._featuresOff=0;this._controlPanelBehavior=DvtAbstractPanZoomComponent.CONTROL_PANEL_BEHAVIOR_INIT_COLLAPSED;this._displayedControls=DvtPanZoomCanvas.DEFAULT_DISPLAYED_CONTROLS};
DvtAbstractPanZoomComponent.prototype.InitComponentInternal=function(){DvtAbstractPanZoomComponent.superclass.InitComponentInternal.call(this);this._bRenderNullXml?this._panZoomCanvas.setSize(this.GetWidth(),this.GetHeight()):(this._panZoomCanvas&&(this.removeChild(this._panZoomCanvas),this._panZoomCanvas=null),this._panZoomCanvas=this.CreatePanZoomCanvas(this.GetWidth(),this.GetHeight()),this.addChildAt(this._panZoomCanvas,1),this._panZoomCanvas.renderComponent())};
DvtAbstractPanZoomComponent.prototype.ConvertControlPanelBehaviorStringToInt=function(a){switch(a){case DvtAbstractPanZoomComponent.CONTROL_PANEL_BEHAVIOR_INIT_COLLAPSED:return DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_INIT_COLLAPSED;case DvtAbstractPanZoomComponent.CONTROL_PANEL_BEHAVIOR_INIT_EXPANDED:return DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_INIT_EXPANDED;default:return DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_HIDDEN}};
DvtAbstractPanZoomComponent.prototype.CreatePanZoomCanvas=function(a,b){var d=new DvtPanZoomCanvas(this.getContext(),this._buttonImages,a,b,null,this.ConvertControlPanelBehaviorStringToInt(this._controlPanelBehavior),this._displayedControls,this);d.addEventListener(DvtPanEvent.TYPE,this.HandlePanEvent,!1,this);d.addEventListener(DvtZoomEvent.TYPE,this.HandleZoomEvent,!1,this);d.addEventListener(DvtMaximizeSizeEvent.TYPE,this.HandleMaximizeEvent,!1,this);d.addEventListener(DvtRestoreSizeEvent.TYPE,
this.HandleRestoreEvent,!1,this);var e=d.getControlPanel();e&&e.addEventListener(DvtControlPanelEvent.TYPE,this.HandleControlPanelEvent,!1,this);return d};DvtAbstractPanZoomComponent.prototype.HandleControlPanelEvent=function(){};DvtAbstractPanZoomComponent.prototype.HandlePanEvent=function(){};DvtAbstractPanZoomComponent.prototype.HandleZoomEvent=function(){};DvtAbstractPanZoomComponent.prototype.HandleMaximizeEvent=function(){};DvtAbstractPanZoomComponent.prototype.HandleRestoreEvent=function(){};
DvtAbstractPanZoomComponent.prototype.getPanZoomCanvas=function(){return this._panZoomCanvas};DvtAbstractPanZoomComponent.prototype.panBy=function(a,b,d){this.getPanZoomCanvas().panBy(a,b,d)};DvtAbstractPanZoomComponent.prototype.panTo=function(a,b,d){this.getPanZoomCanvas().panTo(a,b,d)};DvtAbstractPanZoomComponent.prototype.zoomBy=function(a,b,d,e){this.getPanZoomCanvas().zoomBy(a,b,d,e)};DvtAbstractPanZoomComponent.prototype.zoomTo=function(a,b,d,e){this.getPanZoomCanvas().zoomTo(a,b,d,e)};
DvtAbstractPanZoomComponent.prototype.zoomToFit=function(a){this.getPanZoomCanvas().zoomToFit(a)};DvtAbstractPanZoomComponent.prototype.getPanZoomResources=function(){return this._panZoomResources};DvtAbstractPanZoomComponent.prototype.setPanZoomResources=function(a){this._panZoomResources=a};DvtAbstractPanZoomComponent.prototype.getFeaturesOff=function(){return this._featuresOff};DvtAbstractPanZoomComponent.prototype.setFeaturesOff=function(a){this._featuresOff=a};
DvtAbstractPanZoomComponent.prototype.isPanningOff=function(){return 0!=(this._featuresOff&DvtAbstractPanZoomComponent._PANNING_OFF)};DvtAbstractPanZoomComponent.prototype.isZoomingOff=function(){return 0!=(this._featuresOff&DvtAbstractPanZoomComponent._ZOOMING_OFF)};DvtAbstractPanZoomComponent.prototype.isZoomToFitOff=function(){return 0!=(this._featuresOff&DvtAbstractPanZoomComponent._ZOOM_TO_FIT_OFF)};DvtAbstractPanZoomComponent.prototype.isChangeLayoutOff=function(){return!0};
DvtAbstractPanZoomComponent.prototype.getResources=function(){return this._resources};DvtAbstractPanZoomComponent.prototype.setResources=function(a){this._resources=a};DvtAbstractPanZoomComponent.prototype.setButtonImages=function(a){this._buttonImages=a};DvtAbstractPanZoomComponent.prototype.setControlPanelBehavior=function(a){this._controlPanelBehavior=a};DvtAbstractPanZoomComponent.prototype.getControlPanelBehavior=function(){return this._controlPanelBehavior};
DvtAbstractPanZoomComponent.prototype.setDisplayedControls=function(a){this._displayedControls=a};DvtAbstractPanZoomComponent.prototype.getDisplayedControls=function(){return this._displayedControls};var DvtPanZoomCanvas=function(a,b,d,e,g,h,k,m){this.Init(a,b,d,e,g,h,k,m)};DvtObj.createSubclass(DvtPanZoomCanvas,DvtContainer,"DvtPanZoomCanvas");DvtPanZoomCanvas.DEFAULT_PAN_INCREMENT=15;DvtPanZoomCanvas.DEFAULT_ZOOM_INCREMENT=0.05;DvtPanZoomCanvas.DEFAULT_ANIMATION_DURATION=0.5;
DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_INIT_COLLAPSED=0;DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_INIT_EXPANDED=1;DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_HIDDEN=2;DvtPanZoomCanvas.DEFAULT_DISPLAYED_CONTROLS=16711679;
DvtPanZoomCanvas.prototype.Init=function(a,b,d,e,g,h,k,m){DvtPanZoomCanvas.superclass.Init.call(this,a,g);this._view=m;this._ww=d;this._hh=e;this._buttonImages=b;this._my=this._mx=this._py=this._px=0;this._maxPanY=this._minPanY=this._maxPanX=this._minPanX=null;this._minZoom=0.1;this._maxZoom=1;this._panIncrement=DvtPanZoomCanvas.DEFAULT_PAN_INCREMENT;this._zoomIncrement=DvtPanZoomCanvas.DEFAULT_ZOOM_INCREMENT;this._bTiltPanningEnabled=!1;this._zoomToFitPadding=20;this._controlPanel=null;this._controlPanelState=
h?h:DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_INIT_COLLAPSED;this._displayedControls=k||0==k?k:DvtPanZoomCanvas.DEFAULT_DISPLAYED_CONTROLS;this._bZoomToFitEnabled=this._bZoomingEnabled=this._bPanningEnabled=!0;this._backgroundPane=new DvtRect(this.getContext(),0,0,this._ww,this._hh);this.addChild(this._backgroundPane);this._backgroundPane.setFill(new DvtSolidFill("white",0));this._contentPane=new DvtContainer(this.getContext());this.addChild(this._contentPane);this._contentPane.setMatrix(new DvtMatrix(this.getContext()));
this._animationDuration=DvtPanZoomCanvas.DEFAULT_ANIMATION_DURATION;this._eventManager=new DvtPanZoomCanvasEventManager(a,this.FireListener,this);this._eventManager.addListeners(this);this._clipIdSuffix=1;this.SetClipRect(d,e);this.RenderInternal()};DvtPanZoomCanvas.prototype.setSize=function(a,b){this._ww=a;this._hh=b;this._backgroundPane.setWidth(a);this._backgroundPane.setHeight(b);this._controlPanel&&this.PositionControlPanel();this.SetClipRect(a,b)};
DvtPanZoomCanvas.prototype.getSize=function(){return new DvtDimension(this._ww,this._hh)};DvtPanZoomCanvas.prototype.SetClipRect=function(a,b){var d=this.GetNextClipId(),d=new DvtClipPath(d);d.addRect(this.getTranslateX(),this.getTranslateY(),a,b);this.setClipPath(d)};DvtPanZoomCanvas.prototype.GetNextClipId=function(){this._clipIdSuffix=1==this._clipIdSuffix?0:1;return"pzcClip"+this._clipIdSuffix};DvtPanZoomCanvas.prototype.getContentPane=function(){return this._contentPane};
DvtPanZoomCanvas.prototype.setContentPane=function(a){this._contentPane=a};DvtPanZoomCanvas.prototype.getBackgroundPane=function(){return this._backgroundPane};DvtPanZoomCanvas.prototype.getZoom=function(){return this._contentPane.getMatrix().getA()};DvtPanZoomCanvas.prototype.getPanX=function(){return this._contentPane.getMatrix().getTx()};DvtPanZoomCanvas.prototype.getPanY=function(){return this._contentPane.getMatrix().getTy()};
DvtPanZoomCanvas.prototype.setZoomToFitPadding=function(a){this._zoomToFitPadding=a};DvtPanZoomCanvas.prototype.getZoomToFitPadding=function(){return this._zoomToFitPadding};
DvtPanZoomCanvas.prototype.panBy=function(a,b,d){if(this.isPanningEnabled()){var e=this.getPanX(),g=this.getPanY(),h=this.ConstrainPanX(e+a),k=this.ConstrainPanY(g+b),b=h-e,m=k-g;this.FirePanEvent(DvtPanEvent.SUBTYPE_PANNING,h,k,e,g,d);a=null;d&&(a=d.getDestVal(this._contentPane,this._contentPane.getMatrix))&&(a=a.clone());a||(a=this._contentPane.getMatrix().clone());a.translate(b,m);var n=this,b=function(){n.FirePanEvent(DvtPanEvent.SUBTYPE_PANNED,h,k,e,g,d)};d?(d.addProp(DvtAnimator.TYPE_MATRIX,
this._contentPane,this._contentPane.getMatrix,this._contentPane.setMatrix,a),DvtPlayable.appendOnEnd(d,b)):(this._contentPane.setMatrix(a),b())}};DvtPanZoomCanvas.prototype.panTo=function(a,b,d){this.isPanningEnabled()&&(a-=this._GetPanX(d),b-=this._GetPanY(d),this.panBy(a,b,d))};
DvtPanZoomCanvas.prototype.zoomBy=function(a,b,d,e){if(this.isZoomingEnabled()){!b&&0!==b&&(b=this._ww/2);!d&&0!==d&&(d=this._hh/2);var g=this.getZoom(),h=this.ConstrainZoom(g*a);if(DvtPanZoomCanvas.RoundFloatForCompare(g)!=DvtPanZoomCanvas.RoundFloatForCompare(h)){a=h/g;this.FireZoomEvent(DvtZoomEvent.SUBTYPE_ZOOMING,h,g,e,null,b,d);h=null;e&&(h=e.getDestVal(this._contentPane,this._contentPane.getMatrix))&&(h=h.clone());h||(h=this._contentPane.getMatrix().clone());h.translate(-b,-d);h.scale(a,a);
h.translate(b,d);var k=this,a=function(){k.FireZoomEvent(DvtZoomEvent.SUBTYPE_ZOOMED,k.getZoom(),g,e,null,b,d)};e?(e.addProp(DvtAnimator.TYPE_MATRIX,this._contentPane,this._contentPane.getMatrix,this._contentPane.setMatrix,h),DvtPlayable.appendOnEnd(e,a)):(this._contentPane.setMatrix(h),a())}}};DvtPanZoomCanvas.prototype.zoomTo=function(a,b,d,e){this.isZoomingEnabled()&&this.zoomBy(a/this._GetZoom(e),b,d,e)};
DvtPanZoomCanvas.prototype.zoomToFit=function(a,b){if(this.isZoomToFitEnabled()){var d=this.isPanningEnabled(),e=this.isZoomingEnabled();this.setPanningEnabled(!0);this.setZoomingEnabled(!0);try{var g=b;g||(g=this._contentPane.getDimensions());this.FireZoomEvent(DvtZoomEvent.SUBTYPE_ZOOM_TO_FIT_BEGIN,null,null,a,g);var h=Math.min((this._ww-2*this._zoomToFitPadding)/g.w,(this._hh-2*this._zoomToFitPadding)/g.h),h=this.ConstrainZoom(h),k=this._ww/2-(g.x+g.w/2)*h,m=this._hh/2-(g.y+g.h/2)*h;this.zoomTo(h,
0,0,a);this.panTo(k,m,a);var n=this,h=function(){n.FireZoomEvent(DvtZoomEvent.SUBTYPE_ZOOM_TO_FIT_END,null,null,a,g)};a?DvtPlayable.appendOnEnd(a,h):h()}finally{this.setPanningEnabled(d),this.setZoomingEnabled(e)}}};
DvtPanZoomCanvas.prototype.calcZoomToFitScale=function(a){a||(a=this._contentPane.getDimensions());a=this.FireZoomEvent(DvtZoomEvent.SUBTYPE_ZOOM_TO_FIT,null,null,null,a).getZoomToFitBounds();a=Math.min((this._ww-2*this._zoomToFitPadding)/a.w,(this._hh-2*this._zoomToFitPadding)/a.h);return a=this.ConstrainZoom(a)};
DvtPanZoomCanvas.prototype.calcZoomToFitBounds=function(){var a=this._contentPane.getDimensions(),a=this.FireZoomEvent(DvtZoomEvent.SUBTYPE_ZOOM_TO_FIT,null,null,null,a).getZoomToFitBounds();a.x-=this._zoomToFitPadding;a.y-=this._zoomToFitPadding;a.w+=2*this._zoomToFitPadding;a.h+=2*this._zoomToFitPadding;return a};
DvtPanZoomCanvas.prototype.getViewport=function(){var a=this.localToStage(new DvtPoint(0,0)),b=this.localToStage(new DvtPoint(this._ww,this._hh)),a=this.getContentPane().stageToLocal(a),b=this.getContentPane().stageToLocal(b);return new DvtRectangle(a.x,a.y,b.x-a.x,b.y-a.y)};DvtPanZoomCanvas.prototype._GetZoom=function(a){return a&&(a=a.getDestVal(this._contentPane,this._contentPane.getMatrix))?a.getA():this.getZoom()};
DvtPanZoomCanvas.prototype._GetPanX=function(a){return a&&(a=a.getDestVal(this._contentPane,this._contentPane.getMatrix))?a.getTx():this.getPanX()};DvtPanZoomCanvas.prototype._GetPanY=function(a){return a&&(a=a.getDestVal(this._contentPane,this._contentPane.getMatrix))?a.getTy():this.getPanY()};DvtPanZoomCanvas.prototype.ConstrainPanX=function(a){this._minPanX&&a<this._minPanX&&(a=this._minPanX);this._maxPanX&&a>this._maxPanX&&(a=this._maxPanX);return a};
DvtPanZoomCanvas.prototype.ConstrainPanY=function(a){this._minPanY&&a<this._minPanY&&(a=this._minPanY);this._maxPanY&&a>this._maxPanY&&(a=this._maxPanY);return a};DvtPanZoomCanvas.prototype.ConstrainZoom=function(a){this._minZoom&&a<this._minZoom&&(a=this._minZoom);this._maxZoom&&a>this._maxZoom&&(a=this._maxZoom);return a};DvtPanZoomCanvas.RoundFloatForCompare=function(a){return Math.round(1E5*a)};
DvtPanZoomCanvas.prototype.RenderInternal=function(){if(this._buttonImages&&this._controlPanelState!=DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_HIDDEN){var a=this.getControlPanel();a||(this._controlPanel=a=new DvtPanZoomControlPanel(this.getContext(),this,this._buttonImages,null,this._displayedControls,this._view));this.addChild(this._controlPanel);this._controlPanelState==DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_INIT_COLLAPSED?this._controlPanel.setState(DvtPanZoomControlPanel.STATE_COLLAPSED):this._controlPanelState==
DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_INIT_EXPANDED&&this._controlPanel.setState(DvtPanZoomControlPanel.STATE_EXPANDED);this.PositionControlPanel()}};DvtPanZoomCanvas.prototype.renderComponent=function(){this._controlPanel&&this._controlPanel.renderComponent()};DvtPanZoomCanvas.prototype.setControlPanelState=function(a){this._controlPanelState=a;this._controlPanelState==DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_HIDDEN&&this.removeChild(this._controlPanel)};
DvtPanZoomCanvas.prototype.setControlPanel=function(a){this._controlPanel&&this.removeChild(this._controlPanel);this._controlPanel=a;this._controlPanelState!=DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_HIDDEN&&(this.addChild(this._controlPanel),this._controlPanelState==DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_INIT_COLLAPSED?this._controlPanel.setState(DvtPanZoomControlPanel.STATE_COLLAPSED):this._controlPanelState==DvtPanZoomCanvas.CONTROL_PANEL_BEHAVIOR_INIT_EXPANDED&&this._controlPanel.setState(DvtPanZoomControlPanel.STATE_EXPANDED),
this.PositionControlPanel())};DvtPanZoomCanvas.prototype.getControlPanel=function(){return this._controlPanel};
DvtPanZoomCanvas.prototype.PositionControlPanel=function(){var a=this._view.getControlPanelStyleMap(),b=DvtPanZoomControlPanelLAFUtils.getControlPanelPositionX(a,DvtPanZoomControlPanelLAFUtils.CONTROL_PANEL_PADDING),d=DvtPanZoomControlPanelLAFUtils.getControlPanelPositionY(a,DvtPanZoomControlPanelLAFUtils.CONTROL_PANEL_PADDING),a=DvtPanZoomControlPanelLAFUtils.getControlPanelButtonWidth(a,DvtPanZoomControlPanelLAFUtils.EXPAND_COLLAPSE_BUTTON_WIDTH);DvtAgent.getAgent().isRightToLeft()?this._controlPanel.setTranslateX(this._ww-
a-b):this._controlPanel.setTranslateX(b);this._controlPanel.setTranslateY(d)};DvtPanZoomCanvas.prototype.GetRelativeMousePosition=function(a){var b=this.getContext().getDocumentUtils(),d=this.getContext().getStage();return b.getStageRelativePosition(d,a.pageX,a.pageY)};DvtPanZoomCanvas.prototype.FirePanEvent=function(a,b,d,e,g,h){this.FireListener(new DvtPanEvent(a,b,d,e,g,h))};
DvtPanZoomCanvas.prototype.FireZoomEvent=function(a,b,d,e,g,h,k){a=new DvtZoomEvent(a,b,d,e,g,new DvtPoint(h,k));this.FireListener(a);return a};DvtPanZoomCanvas.prototype.zoomAndCenter=function(){this.FireZoomEvent(DvtZoomEvent.SUBTYPE_ZOOM_AND_CENTER)};DvtPanZoomCanvas.prototype.getNextZoomLevel=function(a){a+=this.getZoomIncrement();a>this.getMaxZoom()&&(a=this.getMaxZoom());return a};
DvtPanZoomCanvas.prototype.getPrevZoomLevel=function(a){a-=this.getZoomIncrement();a<this.getMinZoom()&&(a=this.getMinZoom());return a};DvtPanZoomCanvas.prototype.setZoomIncrement=function(a){this._zoomIncrement=a};DvtPanZoomCanvas.prototype.getZoomIncrement=function(){return this._zoomIncrement};DvtPanZoomCanvas.prototype.setPanIncrement=function(a){this._panIncrement=a};DvtPanZoomCanvas.prototype.getPanIncrement=function(){return this._panIncrement};
DvtPanZoomCanvas.prototype.setMinZoom=function(a){this._minZoom=a};DvtPanZoomCanvas.prototype.getMinZoom=function(){return this._minZoom};DvtPanZoomCanvas.prototype.setMaxZoom=function(a){0>a&&(a=1);this._maxZoom=a};DvtPanZoomCanvas.prototype.getMaxZoom=function(){return this._maxZoom};DvtPanZoomCanvas.prototype.setMinPanX=function(a){this._minPanX=a};DvtPanZoomCanvas.prototype.getMinPanX=function(){return this._minPanX};DvtPanZoomCanvas.prototype.setMaxPanX=function(a){this._maxPanX=a};
DvtPanZoomCanvas.prototype.getMaxPanX=function(){return this._maxPanX};DvtPanZoomCanvas.prototype.setMinPanY=function(a){this._minPanY=a};DvtPanZoomCanvas.prototype.getMinPanY=function(){return this._minPanY};DvtPanZoomCanvas.prototype.setMaxPanY=function(a){this._maxPanY=a};DvtPanZoomCanvas.prototype.getMaxPanY=function(){return this._maxPanY};DvtPanZoomCanvas.prototype.setTiltPanningEnabled=function(a){this._bTiltPanningEnabled=a};DvtPanZoomCanvas.prototype.isTiltPanningEnabled=function(){return this._bTiltPanningEnabled};
DvtPanZoomCanvas.prototype.setAnimationDuration=function(a){this._animationDuration=a};DvtPanZoomCanvas.prototype.getAnimationDuration=function(){return this._animationDuration};DvtPanZoomCanvas.prototype.setPanningEnabled=function(a){this._bPanningEnabled=a};DvtPanZoomCanvas.prototype.isPanningEnabled=function(){return this._bPanningEnabled};DvtPanZoomCanvas.prototype.setZoomingEnabled=function(a){this._bZoomingEnabled=a};DvtPanZoomCanvas.prototype.isZoomingEnabled=function(){return this._bZoomingEnabled};
DvtPanZoomCanvas.prototype.setZoomToFitEnabled=function(a){this._bZoomToFitEnabled=a};DvtPanZoomCanvas.prototype.isZoomToFitEnabled=function(){return this._bZoomToFitEnabled};DvtPanZoomCanvas.prototype.MaximizeSize=function(){this.FireMaximizeEvent()};DvtPanZoomCanvas.prototype.RestoreSize=function(){this.FireRestoreEvent()};DvtPanZoomCanvas.prototype.FireMaximizeEvent=function(){this.FireListener(new DvtMaximizeSizeEvent)};DvtPanZoomCanvas.prototype.FireRestoreEvent=function(){this.FireListener(new DvtRestoreSizeEvent)};
var DvtPanZoomCanvasEventManager=function(a,b,d){this.Init(a,b,d)};DvtObj.createSubclass(DvtPanZoomCanvasEventManager,DvtEventManager,"DvtPanZoomCanvasEventManager");DvtPanZoomCanvasEventManager.prototype.Init=function(a,b,d){DvtPanZoomCanvasEventManager.superclass.Init.call(this,a,b,d);this._controlPanel=d.getControlPanel();this._zoomAnimator=null;this._bZooming=this._bPanning=!1};DvtPanZoomCanvasEventManager.PAN_TOUCH_KEY="panTouch";DvtPanZoomCanvasEventManager.ZOOM_TOUCH_KEY="zoomTouch";
DvtPanZoomCanvasEventManager.prototype.addListeners=function(a){DvtPanZoomCanvasEventManager.superclass.addListeners.call(this,a);DvtAgent.getAgent().isGecko()?a.addEventListener("DOMMouseScroll",this.OnMouseWheel,!1,this):a.addEventListener("mousewheel",this.OnMouseWheel,!1,this)};
DvtPanZoomCanvasEventManager.prototype.OnMouseDown=function(a){a.button!=DvtMouseEvent.RIGHT_CLICK_BUTTON&&(a=this._callbackObj.GetRelativeMousePosition(a),this._mx=a.x,this._my=a.y,this._px=this._mx,this._py=this._my,this._bDown=!0)};
DvtPanZoomCanvasEventManager.prototype.OnMouseMove=function(a){if(this._bDown){var b=this._callbackObj.GetRelativeMousePosition(a),d=b.x,b=b.y;a.ctrlKey?(this._bZooming||(this._callback.call(this._callbackObj,new DvtZoomEvent(DvtZoomEvent.SUBTYPE_DRAG_ZOOM_BEGIN)),this._bZooming=!0,this._controlPanel&&this._controlPanel.mouseDragPanningStarted()),a=1+(this._my-b)/100,this._callbackObj.isPanningEnabled()?this._callbackObj.zoomBy(a,this._px,this._py):this._callbackObj.zoomBy(a,null,null)):(this._bPanning||
(this._callback.call(this._callbackObj,new DvtPanEvent(DvtPanEvent.SUBTYPE_DRAG_PAN_BEGIN)),this._bPanning=!0,this._controlPanel&&this._controlPanel.mouseDragPanningStarted()),this._callbackObj.panBy(d-this._mx,b-this._my));this._mx=d;this._my=b}};
DvtPanZoomCanvasEventManager.prototype.OnMouseUp=function(){this._bDown=!1;this._bPanning&&(this._callback.call(this._callbackObj,new DvtPanEvent(DvtPanEvent.SUBTYPE_DRAG_PAN_END)),this._bPanning=!1,this._controlPanel&&this._controlPanel.mouseDragPanningEnded());this._bZooming&&(this._callback.call(this._callbackObj,new DvtZoomEvent(DvtZoomEvent.SUBTYPE_DRAG_ZOOM_END)),this._bZooming=!1,this._controlPanel&&this._controlPanel.mouseDragPanningEnded())};
DvtPanZoomCanvasEventManager.prototype.OnMouseOut=function(a){this._bDown&&this.OnMouseUp(a);DvtPanZoomCanvasEventManager.superclass.OnMouseOut.call(this,a)};
DvtPanZoomCanvasEventManager.prototype.OnMouseWheel=function(a){var b=this._callbackObj.getZoom();this._zoomAnimator&&(b=this._zoomAnimator,this._zoomAnimator.stop(),b=this._callbackObj._GetZoom(b),this._zoomAnimator=null);this._zoomAnimator=null;var d=0;null!=a.wheelDelta&&(d=a.wheelDelta,DvtAgent.getAgent().isGecko()&&(d=-d));b+=this._callbackObj.getZoomIncrement()*d;d=this._callbackObj.GetRelativeMousePosition(a);this.getContext().getDocumentUtils().cancelDomEvent(a);this._callbackObj.isPanningEnabled()?
this._callbackObj.zoomTo(b,d.x,d.y,this._zoomAnimator):this._callbackObj.zoomTo(b,null,null,this._zoomAnimator);this._zoomAnimator&&(DvtPlayable.appendOnEnd(this._zoomAnimator,this._clearZoomAnimator,this),this._zoomAnimator.play())};DvtPanZoomCanvasEventManager.prototype._clearZoomAnimator=function(){this._zoomAnimator=null};
DvtPanZoomCanvasEventManager.prototype.HandleImmediateTouchStartInternal=function(a){this._callbackObj.isZoomingEnabled()&&this.TouchManager.processAssociatedTouchAttempt(a,DvtPanZoomCanvasEventManager.ZOOM_TOUCH_KEY,this.ZoomStartTouch,this);this._callbackObj.isPanningEnabled()&&this.TouchManager.processAssociatedTouchAttempt(a,DvtPanZoomCanvasEventManager.PAN_TOUCH_KEY,this.PanStartTouch,this)};
DvtPanZoomCanvasEventManager.prototype.HandleImmediateTouchMoveInternal=function(a){this._callbackObj.isZoomingEnabled()&&this.TouchManager.processAssociatedTouchMove(a,DvtPanZoomCanvasEventManager.ZOOM_TOUCH_KEY);this._callbackObj.isPanningEnabled()&&this.TouchManager.processAssociatedTouchMove(a,DvtPanZoomCanvasEventManager.PAN_TOUCH_KEY)};
DvtPanZoomCanvasEventManager.prototype.HandleImmediateTouchEndInternal=function(a){this._callbackObj.isZoomingEnabled()&&this.TouchManager.processAssociatedTouchEnd(a,DvtPanZoomCanvasEventManager.ZOOM_TOUCH_KEY);this._callbackObj.isPanningEnabled()&&this.TouchManager.processAssociatedTouchEnd(a,DvtPanZoomCanvasEventManager.PAN_TOUCH_KEY)};
DvtPanZoomCanvasEventManager.prototype.ZoomStartTouch=function(a,b){1>=this.TouchManager.getTouchIdsForObj(DvtPanZoomCanvasEventManager.ZOOM_TOUCH_KEY).length&&this.TouchManager.saveProcessedTouch(b.identifier,DvtPanZoomCanvasEventManager.ZOOM_TOUCH_KEY,null,DvtPanZoomCanvasEventManager.ZOOM_TOUCH_KEY,DvtPanZoomCanvasEventManager.ZOOM_TOUCH_KEY,this.ZoomMoveTouch,this.ZoomEndTouch,this);a&&a.preventDefault()};
DvtPanZoomCanvasEventManager.prototype.ZoomMoveTouch=function(a){var b=this.TouchManager.getTouchIdsForObj(DvtPanZoomCanvasEventManager.ZOOM_TOUCH_KEY);if(2==b.length&&(b=this.TouchManager.getMultiTouchZoomDelta(b)))this._bZooming||(this._bZooming=!0,this._callback.call(this._callbackObj,new DvtZoomEvent(DvtZoomEvent.SUBTYPE_DRAG_ZOOM_BEGIN)),this._controlPanel&&this._controlPanel.mouseDragPanningStarted()),this._callbackObj.zoomBy(1+b/10,null,null),this.hideTooltip();a&&a.preventDefault()};
DvtPanZoomCanvasEventManager.prototype.ZoomEndTouch=function(a){this._callback.call(this._callbackObj,new DvtZoomEvent(DvtZoomEvent.SUBTYPE_DRAG_ZOOM_END));this._bZooming=!1;this._controlPanel&&this._controlPanel.mouseDragPanningEnded();a&&a.preventDefault()};
DvtPanZoomCanvasEventManager.prototype.PanStartTouch=function(a,b){!this._bZooming&&1>=this.TouchManager.getTouchIdsForObj(DvtPanZoomCanvasEventManager.PAN_TOUCH_KEY).length&&(this.TouchManager.saveProcessedTouch(b.identifier,DvtPanZoomCanvasEventManager.PAN_TOUCH_KEY,null,DvtPanZoomCanvasEventManager.PAN_TOUCH_KEY,DvtPanZoomCanvasEventManager.PAN_TOUCH_KEY,this.PanMoveTouch,this.PanEndTouch,this),this._oldPanX=b.pageX,this._oldPanY=b.pageY);a&&a.preventDefault()};
DvtPanZoomCanvasEventManager.prototype.PanMoveTouch=function(a,b){!this._bZooming&&1==this.TouchManager.getTouchIdsForObj(DvtPanZoomCanvasEventManager.ZOOM_TOUCH_KEY).length&&(this._bPanning||(this._callback.call(this._callbackObj,new DvtPanEvent(DvtPanEvent.SUBTYPE_DRAG_PAN_BEGIN)),this._bPanning=!0),this._controlPanel&&this._controlPanel.mouseDragPanningStarted(),this._callbackObj.panBy(b.pageX-this._oldPanX,b.pageY-this._oldPanY),this._oldPanX=b.pageX,this._oldPanY=b.pageY);a&&a.preventDefault()};
DvtPanZoomCanvasEventManager.prototype.PanEndTouch=function(a){!this._bZooming&&this._bPanning&&(this._bPanning=!1,this._callback.call(this._callbackObj,new DvtPanEvent(DvtPanEvent.SUBTYPE_DRAG_PAN_END)),this._controlPanel&&this._controlPanel.mouseDragPanningEnded());a&&a.preventDefault()};var DvtPanZoomCanvasKeyboardHandler=function(a,b){this.Init(a,b)};DvtObj.createSubclass(DvtPanZoomCanvasKeyboardHandler,DvtKeyboardHandler,"DvtPanZoomCanvasKeyboardHandler");
DvtPanZoomCanvasKeyboardHandler.prototype.Init=function(a,b){DvtPanZoomCanvasKeyboardHandler.superclass.Init(b);this._component=a};
DvtPanZoomCanvasKeyboardHandler.prototype.processKeyDown=function(a){var b=a.keyCode,d=this._component.getPanZoomCanvas();if(b==DvtKeyboardEvent.PAGE_UP)a.ctrlKey||a.shiftKey?d.panBy(d.getPanIncrement(),0):d.panBy(0,d.getPanIncrement());else if(b==DvtKeyboardEvent.PAGE_DOWN)a.ctrlKey||a.shiftKey?d.panBy(-d.getPanIncrement(),0):d.panBy(0,-d.getPanIncrement());else if(b==DvtKeyboardEvent.FORWARD_SLASH)(a=d.getControlPanel())&&a.toggleExpandCollapse();else if(DvtKeyboardEvent.isEquals(a)||DvtKeyboardEvent.isPlus(a))d.zoomTo(d.getZoom()+
d.getZoomIncrement());else if(DvtKeyboardEvent.isMinus(a)||DvtKeyboardEvent.isUnderscore(a))d.zoomTo(d.getZoom()-d.getZoomIncrement());else if((b==DvtKeyboardEvent.ZERO||b==DvtKeyboardEvent.NUMPAD_ZERO)&&!a.ctrlKey&&!a.shiftKey)d.zoomToFit();else return DvtPanZoomCanvasKeyboardHandler.superclass.processKeyDown.call(this,a)};var DvtThematicMapKeyboardHandler=function(a,b){this.Init(a,b)};DvtObj.createSubclass(DvtThematicMapKeyboardHandler,DvtPanZoomCanvasKeyboardHandler,"DvtThematicMapKeyboardHandler");
DvtThematicMapKeyboardHandler.prototype.Init=function(a,b){DvtThematicMapKeyboardHandler.superclass.Init(a,b);this._tmap=a};DvtThematicMapKeyboardHandler.prototype.isSelectionEvent=function(a){return this.isNavigationEvent(a)&&!a.ctrlKey};
DvtThematicMapKeyboardHandler.prototype.processKeyDown=function(a){var b=a.keyCode;if(b==DvtKeyboardEvent.CLOSE_BRACKET){var b=this._eventManager.getFocus(),d=this._eventManager.getCurrentCallbackObj().getDataObjects();b instanceof DvtMapDataArea&&0<d.length&&(b=DvtKeyboardHandler.getNextAdjacentNavigable(b,a,d));this._eventManager.setFocus(b);return b}return b==DvtKeyboardEvent.OPEN_BRACKET?(b=this._eventManager.getFocus(),d=this._tmap.getNavigableAreas(),!(b instanceof DvtMapDataArea)&&0<d.length&&
(b=DvtKeyboardHandler.getNextAdjacentNavigable(b,a,d)),this._eventManager.setFocus(b),b):DvtThematicMapKeyboardHandler.superclass.processKeyDown.call(this,a)};DvtThematicMapKeyboardHandler.prototype.isMultiSelectEvent=function(a){return a.keyCode==DvtKeyboardEvent.SPACE&&a.ctrlKey};
DvtThematicMapKeyboardHandler.prototype.isNavigationEvent=function(a){var b=DvtThematicMapKeyboardHandler.superclass.isNavigationEvent.call(this,a);if(!b&&(a=a.keyCode,a==DvtKeyboardEvent.OPEN_BRACKET||a==DvtKeyboardEvent.CLOSE_BRACKET))b=!0;return b};var DvtThematicMapDefaults={};DvtObj.createSubclass(DvtThematicMapDefaults,DvtObj,"DvtThematicMapDefaults");DvtThematicMapDefaults.VERSION_1={legend:{position:"auto",rendered:!0,layout:{gapRatio:1}},layout:{gapRatio:null,legendMaxSize:0.3,legendGap:10}};
DvtThematicMapDefaults.calcOptions=function(a){var b=DvtThematicMapDefaults._getDefaults(a);return a?DvtJSONUtils.merge(a,b):b};DvtThematicMapDefaults._getDefaults=function(){return DvtJSONUtils.clone(DvtThematicMapDefaults.VERSION_1)};DvtThematicMapDefaults.getGapSize=function(a,b){return Math.ceil(b*a.getGapRatio())};var DvtAmxThematicMap=function(a,b,d){this.Init(a,b,d)};DvtObj.createSubclass(DvtAmxThematicMap,DvtContainer,"DvtAmxThematicMap");DvtAmxThematicMap._LEGEND_COMPONET_GAP=10;
DvtAmxThematicMap.prototype.Init=function(a,b,d){DvtAmxThematicMap.superclass.Init.call(this,a);this._tmap=new DvtThematicMap(a,b,d);this._tmapContainer=new DvtContainer(a);this._tmapContainer.addChild(this._tmap);this.addChild(this._tmapContainer)};DvtAmxThematicMap.newInstance=function(a,b,d,e){a=new DvtAmxThematicMap(a,b,d);a.setOptions(e);return a};
DvtAmxThematicMap.prototype.setOptions=function(a){this.Options=DvtThematicMapDefaults.calcOptions(a);this.getContext()instanceof DvtCanvasContext&&(this.Options.animationOnDisplay="none",this.Options.animationOnMapChange="none")};
DvtAmxThematicMap.prototype.render=function(a,b,d){this.Data=a;this._width=b;this._height=d;a=new DvtRectangle(0,0,b,d);this._renderLegend(this,a);b=this.getContext()instanceof DvtCanvasContext;this._tmap.render(DvtThematicMapJsonToXmlConverter.convertJsonToXml(this.Data,this.Options,b,this._tmap.getContext()),a.w,a.h)};
DvtAmxThematicMap.prototype._renderLegend=function(a,b){var d=new DvtRectangle(DvtAmxThematicMap._LEGEND_COMPONET_GAP,DvtAmxThematicMap._LEGEND_COMPONET_GAP,b.w-2*DvtAmxThematicMap._LEGEND_COMPONET_GAP,b.h-2*DvtAmxThematicMap._LEGEND_COMPONET_GAP),e=this.Options,g=e.legend.rendered,h=e.legend.scrolling,k=this._getLegendData(this.Data);if(g&&!(k.sections&&0==k.sections.length)){var m=DvtJSONUtils.clone(e.legend),g=e.legend.position;delete m.position;m.layout.gapRatio=this.getGapRatio();m.hideAndShowBehavior=
"none";m.rolloverBehavior="none";m.scrolling=e.legend.scrolling;var n=DvtLegend.newInstance(this._tmap.getContext(),null,null,m);null!=this._tmap.getId()&&n.setId(this._tmap.getId()+"legend");a.addChild(n);"auto"==g&&"asNeeded"!==h?g="bottom":"auto"==g&&"asNeeded"==h&&(g="end");h=DvtStyleUtils.isLocaleR2L();"start"==g?g=h?"right":"left":"end"==g&&(g=h?"left":"right");m.orientation="left"==g||"right"==g?"vertical":"horizontal";n.setOptions(m);h="top"==g||"bottom"==g;h=n.getPreferredSize(k,h?d.w:e.layout.legendMaxSize*
d.w,h?e.layout.legendMaxSize*d.h:d.h);n.render(k,h.width,h.height);e=DvtThematicMapDefaults.getGapSize(this,e.layout.legendGap);DvtLayoutUtils.position(d,g,n,h.width,h.height,e);switch(g){case "top":this._tmapContainer.setTranslateY(h.height+DvtAmxThematicMap._LEGEND_COMPONET_GAP);case "bottom":b.h-=h.height+DvtAmxThematicMap._LEGEND_COMPONET_GAP;break;case "left":this._tmapContainer.setTranslateX(h.width+DvtAmxThematicMap._LEGEND_COMPONET_GAP);case "right":b.w-=h.width+DvtAmxThematicMap._LEGEND_COMPONET_GAP}}};
DvtAmxThematicMap.prototype.getGapRatio=function(){if(null!==this.Options.layout.gapRatio&&!isNaN(this.Options.layout.gapRatio))return this.Options.layout.gapRatio;var a=Math.min(this._width/400,1),b=Math.min(this._height/300,1);return Math.min(a,b)};
DvtAmxThematicMap.prototype._getLegendData=function(a){var b={};b.title=a.legend?a.legend.title:null;b.sections=[];if(a&&a.legend&&a.legend.sections)for(var d=0;d<a.legend.sections.length;d++){var e=a.legend.sections[d];e&&b.sections.push({title:e.title,items:e.items,sections:e.sections})}return b};var DvtThematicMap=function(a,b,d){this.Init(a,b,d)};DvtObj.createSubclass(DvtThematicMap,DvtAbstractPanZoomComponent,"DvtThematicMap");DvtThematicMap._EMPTY_TEXT_BUFFER=2;
DvtThematicMap._FEATURES_OFF_PAN=1;DvtThematicMap._FEATURES_OFF_ZOOM=2;DvtThematicMap._FEATURES_OFF_PAN_ZOOM=3;DvtThematicMap._FEATURES_OFF_ZOOMTOFIT=4;DvtThematicMap._FEATURES_OFF_PAN_ZOOMTOFIT=5;DvtThematicMap._FEATURES_OFF_ZOOM_ZOOMTOFIT=6;DvtThematicMap._FEATURES_OFF_ALL=7;DvtThematicMap._NONE="none";DvtThematicMap._ANIMATION_ON_DATA_CHANGE="animationOnDataChange";DvtThematicMap._ANIMATION_DURATION="animationDuration";DvtThematicMap._AREA_LAYER="area";DvtThematicMap._POINT_LAYER="marker";
DvtThematicMap._POINT_LAYER_CONTAINER_ID="pointLayer";DvtThematicMap._BASE_LAYER_CONTAINER_ID="baseLayer";DvtThematicMap._COLLAPSIBLE_PANEL_OFFSET=5;DvtThematicMap._ELEM_RESOURCES_CONTROLPANEL="controlPanelResources";DvtThematicMap._ELEM_RESOURCES_LEGEND="legendResources";DvtThematicMap._HOVER_LAYER_CONTAINER_ID="hoverLayer";DvtThematicMap._DRILL_LAYER_CONTAINER_ID="drillAnimLayer";DvtThematicMap._BASEMAP_SHADOW=new DvtShadow("#4A556A",5,3,3,45,191,3);DvtThematicMap._MOUSE_DRAG_ALPHA=0.3;
DvtThematicMap.prototype.Init=function(a,b,d){DvtThematicMap.superclass.Init.call(this,a);this._callback=b;this._callbackObj=d;this._isTouchDevice=DvtAgent.getAgent().isTouchDevice();this._eventHandler=new DvtThematicMapEventManager(a,this._dispatchEvent,this);this._eventHandler.addListeners(this);this._isTouchDevice?this._keyboardHandler=null:(this._keyboardHandler=new DvtThematicMapKeyboardHandler(this,this._eventHandler),this._eventHandler.setKeyboardHandler(this._keyboardHandler));this._layers=
[];this._drillHierarchy=[];this._drillAnimFadeOutObjs=[];this._legendButtonImages=this._legendPanel=this._legend=null;this._controls=16777215;this._bBaseMapChanged=!1;this._drilledRowKeys=[];this._initDrilled={};this._drillDataLayer={};this._childToParent={};this._drilled=[];this._areaLayers=new DvtContainer(this.getContext());this._dataAreaLayers=new DvtContainer(this.getContext());this._dataAreaSelectionLayers=new DvtContainer(this.getContext());this._dataPointLayers=new DvtContainer(this.getContext());
this._hoverLayer=new DvtContainer(this.getContext());this._labelLayers=new DvtContainer(this.getContext());this._initialZooming=!1;this._panning=this._zooming=!0;a.getDocumentUtils().isFilterSupported()||(DvtSelectionEffectUtils.DEFAULT_SEL_TYPE=DvtSelectionEffectUtils.SEL_TYPE_STROKE_NO_FILTERS)};DvtThematicMap.prototype.getEventHandler=function(){return this._eventHandler};DvtThematicMap.prototype.addPointLayer=function(a){this._layers.push(a)};
DvtThematicMap.prototype.addLayer=function(a){this._layers.unshift(a);this._drillHierarchy.unshift(a)};DvtThematicMap.prototype.getLayer=function(a){for(var b=0;b<this._layers.length;b++)if(this._layers[b].getLayerName()==a)return this._layers[b]};DvtThematicMap.prototype.getAreaLayerContainer=function(){return this._areaLayers};DvtThematicMap.prototype.getDataAreaContainer=function(){return this._dataAreaLayers};DvtThematicMap.prototype.getDataAreaSelectionContainer=function(){return this._dataAreaSelectionLayers};
DvtThematicMap.prototype.getDataPointContainer=function(){return this._dataPointLayers};DvtThematicMap.prototype.getHoverContainer=function(){return this._hoverLayer};DvtThematicMap.prototype.getLabelContainer=function(){return this._labelLayers};DvtThematicMap.prototype.setMapName=function(a){this._bBaseMapChanged=this._mapName&&this._mapName!=a;this._mapName=a};DvtThematicMap.prototype.setAnimationOnDisplay=function(a){this._animationOnDisplay=a};
DvtThematicMap.prototype.setAnimationOnMapChange=function(a){this._animationOnMapChange=a};DvtThematicMap.prototype.setAnimationDuration=function(a){this._animationDuration=parseFloat(a)};DvtThematicMap.prototype.setDisplayTooltips=function(a){this._displayTooltips=a};DvtThematicMap.prototype.getDisplayTooltips=function(){return this._displayTooltips};DvtThematicMap.prototype.setBackgroundStyle=function(a){this.setComponentStyle(new DvtCSSStyle(a))};
DvtThematicMap.prototype.setFeaturesOff=function(a){this._featuresOff=a;this._featuresOff==DvtThematicMap._FEATURES_OFF_PAN?this._controls=4352:this._featuresOff==DvtThematicMap._FEATURES_OFF_ZOOM?this._controls=272:this._featuresOff==DvtThematicMap._FEATURES_OFF_PAN_ZOOM?this._controls=256:this._featuresOff==DvtThematicMap._FEATURES_OFF_ZOOMTOFIT?this._controls=4112:this._featuresOff==DvtThematicMap._FEATURES_OFF_PAN_ZOOMTOFIT?this._controls=4096:this._featuresOff==DvtThematicMap._FEATURES_OFF_ZOOM_ZOOMTOFIT&&
(this._controls=16)};DvtThematicMap.prototype.setBiDi=function(a){this._isBiDi="false"==a};DvtThematicMap.prototype.setInitialCenterX=function(a){this._initialCenterX=parseFloat(a)};DvtThematicMap.prototype.setInitialCenterY=function(a){this._initialCenterY=parseFloat(a)};DvtThematicMap.prototype.setInitialZoom=function(a){this._initialZoom=parseFloat(a)};DvtThematicMap.prototype.setAnimationOnDrill=function(a){"alphaFade"==a&&(this._animationOnDrill=a)};
DvtThematicMap.prototype.setDrillMode=function(a){this._drillMode=a;this._eventHandler.setDrillMode(a)};DvtThematicMap.prototype.setInitialZooming=function(a){this._initialZooming=a};DvtThematicMap.prototype.setDrillZoomToFit=function(a){this._drillZoomToFit="true"==a};DvtThematicMap.prototype.setMenuNode=function(a){this._menuNode=a;this._contextMenuHandler=new DvtThematicMapContextMenuHandler(this.getContext(),this);this._contextMenuHandler.add(this._menuNode);this._eventHandler.setContextMenuHandler(this._contextMenuHandler)};
DvtThematicMap.prototype.setMenuResources=function(a){this._contextMenuHandler.setResources(a)};DvtThematicMap.prototype.getLegendPanel=function(){return this._legendPanel};
DvtThematicMap.prototype.LoadXmlInitial=function(a,b,d,e){this._pzcContainer&&(this._layers=[],this._drillHierarchy=[],this._drilledRowKeys=[],this._initDrilled={},this._drillDataLayer={},this._childToParent={},this._drilled=[],this.removeChild(this._legendPanel),this._legendButtonImages=this._legend=this._legendPanel=null,this._controls=16777215,this._oldPzcContainer=this._pzcContainer,this._pzcContainer=null,this._pzc.getContentPane().setMatrix(new DvtMatrix),this._oldAreaLayers=this._areaLayers,
this._oldDataAreaLayers=this._dataAreaLayers,this._oldDataAreaSelectionLayers=this._dataAreaSelectionLayers,this._oldDataPointLayers=this._dataPointLayers,this._oldHoverLayer=this._hoverLayer,this._oldLabelLayers=this._labelLayers,this._areaLayers=new DvtContainer(this.getContext()),this._dataAreaLayers=new DvtContainer(this.getContext()),this._dataAreaSelectionLayers=new DvtContainer(this.getContext()),this._dataPointLayers=new DvtContainer(this.getContext()),this._hoverLayer=new DvtContainer(this.getContext()),
this._labelLayers=new DvtContainer(this.getContext()),this._eventHandler=new DvtThematicMapEventManager(this.getContext(),this._dispatchEvent,this),this._eventHandler.addListeners(this),DvtAgent.getAgent().isTouchDevice()?this._keyboardHandler=null:(this._keyboardHandler=new DvtThematicMapKeyboardHandler(this,this._eventHandler),this._eventHandler.setKeyboardHandler(this._keyboardHandler)));this._eventHandler.hideTooltip();this.GetXmlDomParser().loadXmlInitial(b,d,e)};
DvtThematicMap.prototype.HandleLegendResize=function(a){DvtStyleUtils.isLocaleR2L()||this._legendPanel.setTranslateX(this.GetWidth()-5-a.getWidth())};DvtThematicMap.prototype._renderLegend=function(){if(this._legend){this.addChild(this._legendPanel);this.addChild(this._legend);this._legend.render();this._legendPanel.addContent(this._legend);var a=this._legendPanel.getDimensions();this._legendPanel.setTranslateX(DvtStyleUtils.isLocaleR2L()?5:this.GetWidth()-5-a.w-a.x);this._legendPanel.setTranslateY(5)}};
DvtThematicMap.prototype.InitComponentInternal=function(){DvtThematicMap.superclass.InitComponentInternal.call(this);var a=new DvtClipPath(this.getId()+"ClipPath");a.addRect(0,0,this.GetWidth(),this.GetHeight());this.setClipPath(a)};
DvtThematicMap.prototype.RenderComponentInternal=function(){DvtThematicMap.superclass.RenderComponentInternal.call(this);var a=new DvtContainer(this.getContext()),b=new DvtContainer(this.getContext());this._pzc.addChild(a);this._pzc.getContentPane().addChild(b);this._render(a,b);this._controlPanel&&this._pzc.addChild(this._controlPanel);this._animation&&(this._animationStopped=!0,this._animation.stop(!0));var d=!1,e=this._pzc.getContentPane().getMatrix(),g=new DvtRectangle(0,0,this.GetWidth()/e.getA(),
this.GetHeight()/e.getD()),e=new DvtRectangle(0,0,this.GetWidth(),this.GetHeight()),h=[this._areaLayers,this._dataAreaLayers],k=[this._dataAreaSelectionLayers,this._dataPointLayers,this._labelLayers,this._hoverLayer];if(this._oldPzcContainer){var m=null;if(this._bBaseMapChanged)m=this._animationOnMapChange;else if(this._topLayer&&this._topLayer.getLayerName()!=this._oldTopLayerName&&(m=this._topLayer.getAnimation(),!m)){var n=this._topLayer.getDataLayers(),o;for(o in n)if(n[o].getAnimation()){m=n[o].getAnimation();
break}}n=[this._oldAreaLayers,this._oldDataAreaLayers,this._oldHoverLayer];o=[this._oldDataAreaSelectionLayers,this._oldDataPointLayers,this._oldLabelLayers];m&&DvtBlackBoxAnimationHandler.isSupported(m)?(g=DvtBlackBoxAnimationHandler.getCombinedAnimation(this.getContext(),m,n,h,g,this._animationDuration),e=DvtBlackBoxAnimationHandler.getCombinedAnimation(this.getContext(),m,o,k,e,this._animationDuration),this._animation=new DvtParallelPlayable(this.getContext(),[g,e]),d=!0):(this._pzc.getContentPane().removeChild(this._cpContainer),
this._pzc.removeChild(this._oldPzcContainer))}else DvtBlackBoxAnimationHandler.isSupported(this._animationOnDisplay)&&(g=DvtBlackBoxAnimationHandler.getInAnimation(this.getContext(),this._animationOnDisplay,h,g,this._animationDuration),e=DvtBlackBoxAnimationHandler.getInAnimation(this.getContext(),this._animationOnDisplay,k,e,this._animationDuration),this._animation=new DvtParallelPlayable(this.getContext(),[g,e]));this._animation&&(this._eventHandler.hideTooltip(),this._eventHandler.removeListeners(this),
this._animation.setOnEnd(this.OnAnimationEnd,this),this._animation.play());d&&(this._oldCpContainer=this._cpContainer);this._pzcContainer=a;this._cpContainer=b;this._topLayer&&(this._oldTopLayerName=this._topLayer.getLayerName())};DvtThematicMap.prototype._calcMinZoom=function(){var a=this._pzc.getContentPane().getDimensions(),b=this._pzc.getZoomToFitPadding(),d=(this.GetWidth()-2*b)/a.w,a=(this.GetHeight()-2*b)/a.h;return Math.min(d,a)};
DvtThematicMap.prototype._render=function(a,b){if(this._layers[0]instanceof DvtMapAreaLayer){b.addChild(this._areaLayers);b.addChild(this._dataAreaLayers);a.addChild(this._dataAreaSelectionLayers);a.addChild(this._dataPointLayers);a.addChild(this._labelLayers);a.addChild(this._hoverLayer);var d=this._pzc.getContentPane().getMatrix(),e=[];this._topLayer=this._layers[0];for(var g=0;g<this._layers.length;g++){var h=this._layers[g];if(0==g||!(h instanceof DvtMapAreaLayer))if(h.render(d),h=h.getDataLayers())for(var k in h)e=
e.concat(h[k].getContainers())}d=this.getNavigableAreas();0==d.length&&(d=this.getNavigableObjects());this._keyboardHandler&&this._eventHandler.setInitialFocus(this._keyboardHandler.getDefaultNavigable(d));this._processInitialDrilled();this._pzc.setMinZoom(null);this._pzc.setMaxZoom(null);null!=this._initialZoom?(this._pzc.zoomBy(this._initialZoom),this._pzc.panTo(this._initialCenterX,this._initialCenterY)):this._initialZooming?this.fitRegion(e):this._pzc.zoomToFit();e=null==this._initialZoom?this._pzc.getZoom():
this._calcMinZoom();this._pzc.setMinZoom(e);this._pzc.setMaxZoom(10*e)}this._renderLegend()};DvtThematicMap.prototype.updateLayer=function(a){this._animation&&(this._animationStopped=!0,this._animation.stop(!0));this.GetXmlDomParser().ParseDataLayers(a,!0);this._renderLegend()};DvtThematicMap.prototype.getMapName=function(){return this._mapName};DvtThematicMap.prototype.getDrillMode=function(){return this._drillMode};
DvtThematicMap.prototype.setButtonImages=function(a){for(var a=a.getChildNodes(),b=0;b<a.length;b++){var d=a[b],e=d.getName();e==DvtThematicMap._ELEM_RESOURCES_CONTROLPANEL?DvtThematicMap.superclass.setButtonImages.call(this,d):e==DvtThematicMap._ELEM_RESOURCES_LEGEND&&(this._legendButtonImages=d)}};DvtThematicMap.prototype.getLegendButtonImages=function(){return this._legendButtonImages};
DvtThematicMap.prototype.setLegend=function(a,b){this._legend=a;this._legendPanel&&this.removeChild(this._legendPanel);this._legendPanel=b};DvtThematicMap.prototype.setRolloverBehavior=function(a){this._rolloverBehavior=a};DvtThematicMap.prototype.getRolloverBehavior=function(){return this._rolloverBehavior};DvtThematicMap.prototype.GetXmlDomParser=function(){return new DvtThematicMapParser(this)};
DvtThematicMap.prototype._transformContainers=function(a){for(var b=this._labelLayers.getNumChildren(),d=0;d<b;d++)for(var e=this._labelLayers.getChildAt(d),g=e.getNumChildren(),h=0;h<g;h++)e.getChildAt(h).update(a);this._hoverLayer.setMatrix(a.clone())};
DvtThematicMap.prototype.HandleControlPanelEvent=function(a){DvtThematicMap.superclass.HandleControlPanelEvent.call(this,a);var b=new DvtSetPropertyEvent;b.addParam(DvtPanZoomControlPanel.CONTROL_PANEL_BEHAVIOR_KEY,a.getSubType()==DvtControlPanelEvent.SUBTYPE_SHOW?DvtAbstractPanZoomComponent.CONTROL_PANEL_BEHAVIOR_INIT_EXPANDED:DvtAbstractPanZoomComponent.CONTROL_PANEL_BEHAVIOR_INIT_COLLAPSED);this._dispatchEvent(b)};
DvtThematicMap.prototype.HandleCollapsiblePanelEvent=function(a){var b=new DvtSetPropertyEvent;b.addParam(DvtCommonLegend.LEGEND_DISCLOSED_KEY,a.getSubType()==DvtCollapsiblePanelEvent.SUBTYPE_SHOW);this._dispatchEvent(b)};
DvtThematicMap.prototype.HandleZoomEvent=function(a){var b=a.getSubType();if(b==DvtZoomEvent.SUBTYPE_ZOOMING)this._removeForCPAnimationStart();else if(b==DvtZoomEvent.SUBTYPE_ZOOMED){this._addForCPAnimationEnd();if(null!=a.getNewZoom()){b=this._pzc.getContentPane().getMatrix();a.addParam("panX",b.getTx());a.addParam("panY",b.getTy());this.getContext().getJsExt().dispatchEvent(this._callback,this._callbackObj,this,a);this._transformContainers(b);for(a=0;a<this._layers.length;a++)this._layers[a].HandleZoomEvent(b)}this.getContext().queueRender()}};
DvtThematicMap.prototype.HandlePanEvent=function(a){var b=a.getSubType();if(b==DvtPanEvent.SUBTYPE_PANNING)this._removeForCPAnimationStart();else if(b==DvtPanEvent.SUBTYPE_PANNED){this._addForCPAnimationEnd();if(null!=a.getNewX()){var d=this._pzc.getContentPane().getMatrix();a.addParam("zoom",this._pzc.getZoom());a.addParam("panX",d.getTx());a.addParam("panY",d.getTy());this.getContext().getJsExt().dispatchEvent(this._callback,this._callbackObj,this,a);this._transformContainers(d);for(a=0;a<this._layers.length;a++)this._layers[a].HandlePanEvent(d)}this.getContext().queueRender()}this._legendPanel&&
(b===DvtPanEvent.SUBTYPE_DRAG_PAN_BEGIN?(this._oldLegendAlpha=this._legendPanel.getAlpha(),this._legendPanel.setAlpha(DvtThematicMap._MOUSE_DRAG_ALPHA),this._legendPanel.setMouseEnabled(!1)):b===DvtPanEvent.SUBTYPE_DRAG_PAN_END&&(this._legendPanel.setAlpha(this._oldLegendAlpha),this._legendPanel.setMouseEnabled(!0)))};
DvtThematicMap.prototype.CreatePanZoomCanvas=function(a,b){if(this._pzc)this._pzc.setSize(a,b);else{this._isTouchDevice&&this.setControlPanelBehavior("hidden");this._pzc=DvtThematicMap.superclass.CreatePanZoomCanvas.call(this,a,b);if("none"!=this._drillMode&&"hidden"!=this.getControlPanelBehavior()&&this._featuresOff!=DvtThematicMap._FEATURES_OFF_ALL){var d=[DvtObj.createCallback(this,this.drillUp),DvtObj.createCallback(this,this.drillDown),DvtObj.createCallback(this,this.resetMap)];this._controlPanel=
new DvtThematicMapControlPanel(this.getContext(),this._drillMode,this._buttonImages,d,this._pzc,this.getPanZoomResources(),this._controls);this._pzc.setControlPanel(this._controlPanel)}(this._featuresOff==DvtThematicMap._FEATURES_OFF_PAN||this._featuresOff==DvtThematicMap._FEATURES_OFF_PAN_ZOOM||this._featuresOff==DvtThematicMap._FEATURES_OFF_PAN_ZOOMTOFIT||this._featuresOff==DvtThematicMap._FEATURES_OFF_ALL)&&this.setPanning(!1);(this._featuresOff==DvtThematicMap._FEATURES_OFF_ZOOM||this._featuresOff==
DvtThematicMap._FEATURES_OFF_ZOOM_ZOOMTOFIT||this._featuresOff==DvtThematicMap._FEATURES_OFF_PAN_ZOOM||this._featuresOff==DvtThematicMap._FEATURES_OFF_ALL)&&this.setZooming(!1);this._pzc.setZoomingEnabled(this._zooming);this._pzc.setPanningEnabled(this._panning)}this._eventHandler.setPanZoomCanvas(this._pzc);return this._pzc};DvtThematicMap.prototype.setZooming=function(a){this._zooming=a};DvtThematicMap.prototype.setPanning=function(a){this._panning=a};
DvtThematicMap.prototype.addDisclosedRowKey=function(a){this._drilledRowKeys.push(a)};DvtThematicMap.prototype.addDrilledLayer=function(a,b){this._initDrilled[a]=b};DvtThematicMap.prototype._processInitialDrilled=function(){for(var a in this._initDrilled)this._selectedAreas=this._initDrilled[a][1],this._clickedLayerName=a,this._clickedDataLayerId=this._initDrilled[a][0],this.drillDown();this._initDrilled=null};
DvtThematicMap.prototype.resetMap=function(){for(var a=[],b=[],d=this._drillHierarchy.length-1;-1<d;d--)0==d?this._drillHierarchy[d].reset(b):this._drillHierarchy[d].reset(a);for(d=0;d<a.length;d++)a[d]&&a[d].getParent().removeChild(a[d]);for(d=0;d<b.length;d++)b[d]&&b[d].setAlpha(1);this._drilledRowKeys=[];this.fitMap();this._drilled=[];this._controlPanel&&"none"!=this._drillMode&&(this._controlPanel.setEnabledDrillDownButton(!1),this._controlPanel.setEnabledDrillUpButton(!1))};
DvtThematicMap.prototype.fitRegion=function(a){var b=new DvtAnimator(this.getContext(),0.3);a||(a=this._zoomToFitObject);a||(a=this._clickedObject);var d;if(DvtArrayUtils.isArray(a)){d=a[0].getDimensions();for(var e=1;e<a.length;e++)d=d.getUnion(a[e].getDimensions())}else d=a.getDimensions();this._pzc.zoomToFit(b,d);b.play()};DvtThematicMap.prototype.fitMap=function(){var a=new DvtAnimator(this.getContext(),0.3);this._pzc.zoomToFit(a);a.play()};
DvtThematicMap.prototype.getDrillParentLayer=function(a){for(var b=null,d=0;d<this._drillHierarchy.length;d++){if(this._drillHierarchy[d].getLayerName()==a)return b;b=this._drillHierarchy[d]}return null};DvtThematicMap.prototype.getDrillChildLayer=function(a){for(var b=0;b<this._drillHierarchy.length&&!(b==this._drillHierarchy.length-1);b++)if(this._drillHierarchy[b].getLayerName()==a)return this._drillHierarchy[b+1];return null};
DvtThematicMap.prototype.getNavigableAreas=function(){var a=[];if(this._topLayer)for(var b=0;b<this._layers.length;b++){var d=this._layers[b].getDataLayers(),e;for(e in d)a=this._topLayer.getLayerName()==this._layers[b].getLayerName()?a.concat(d[e].getNavigableAreaObjects()):a.concat(d[e].getNavigableDisclosedAreaObjects())}return a};
DvtThematicMap.prototype.getNavigableObjects=function(){var a=[];if(this._topLayer)for(var b=0;b<this._layers.length;b++){var d=this._layers[b].getDataLayers();if(this._topLayer.getLayerName()==this._layers[b].getLayerName()||!(this._layers[b]instanceof DvtMapAreaLayer))for(var e in d)a=a.concat(d[e].getDataObjects())}return a};
DvtThematicMap.prototype.drillDown=function(){var a=this.getDrillChildLayer(this._clickedLayerName),b=this.getLayer(this._clickedLayerName),d=[];if(a){this._drillDataLayer[this._clickedLayerName]=this._clickedDataLayerId;"single"==this._drillMode&&(this._drilled.pop(),b.reset(d,this._selectedAreas),a.reset(this._drillAnimFadeOutObjs));for(var e=[],g=0;g<this._selectedAreas.length;g++){var h=this._selectedAreas[g],k=b.getChildrenForArea(h);e.push(k[0]);for(var m=0;m<k.length;m++)this._childToParent[k[m]]=
this._selectedAreas[g];a.discloseAreas(k,d);(k=b.getDataLayer(this._clickedDataLayerId))&&k.drill(h,this._drillAnimFadeOutObjs);this._drilled.push(h)}this._handleDrillAnimations(this._drillAnimFadeOutObjs,d,!1);this._updateDrillButton(a.getLayerName());this._clickedLayerName=a.getLayerName();this._selectedAreas=e}};
DvtThematicMap.prototype.drillUp=function(){for(var a=this.getLayer(this._clickedLayerName),b=this.getDrillParentLayer(this._clickedLayerName),d=[],e=[],g=0;g<this._selectedAreas.length;g++){var h=this._childToParent[this._selectedAreas[g]];e.push(h);if(-1!=DvtArrayUtils.indexOf(this._drilled,h)){var k=b.getChildrenForArea(h);a.undiscloseAreas(k,this._drillAnimFadeOutObjs);b.getDataLayer(this._drillDataLayer[b.getLayerName()]).undrill(h,d);h=DvtArrayUtils.indexOf(this._drilled,h);-1!=h&&this._drilled.splice(h,
1)}}this._handleDrillAnimations(this._drillAnimFadeOutObjs,d,!0);this._clickedLayerName=b.getLayerName();this._clickedDataLayerId=this._drillDataLayer[this._clickedLayerName];this._selectedAreas=e;this._updateDrillButton(this._clickedLayerName)};DvtThematicMap.prototype.stopAnimation=function(){this._animation&&(this._animationStopped=!0,this._animation.stop(!0))};
DvtThematicMap.prototype._removeForCPAnimationStart=function(){!this._containersRemovedForAnimation&&this._pzcContainer&&(this._pzcContainer.removeChild(this._dataAreaSelectionLayers),this._pzcContainer.removeChild(this._dataPointLayers),this._pzcContainer.removeChild(this._labelLayers),this._pzcContainer.removeChild(this._hoverLayer),this._containersRemovedForAnimation=!0)};
DvtThematicMap.prototype._addForCPAnimationEnd=function(){this._containersRemovedForAnimation&&this._pzcContainer&&(this._pzcContainer.addChild(this._dataAreaSelectionLayers),this._pzcContainer.addChild(this._dataPointLayers),this._pzcContainer.addChild(this._labelLayers),this._pzcContainer.addChild(this._hoverLayer),this._containersRemovedForAnimation=!1)};
DvtThematicMap.prototype._handleDrillAnimations=function(a,b,d){var e,g=this._pzc.getContentPane().getMatrix();this._drillZoomToFit&&!this._initDrilled?(g=new DvtAnimator(this.getContext(),0.3),d?this._pzc.zoomToFit(g):(e=this._zoomToFitObject.getDimensions(),this._pzc.zoomToFit(g,e)),g.play()):e=new DvtRectangle(0,0,this.GetWidth()/g.getA(),this.GetHeight()/g.getD());if("alphaFade"==this._animationOnDrill&&(this._animation&&(this._animationStopped=!0,this._animation.stop(!0)),this._animation=DvtBlackBoxAnimationHandler.getCombinedAnimation(this.getContext(),
this._animationOnDrill,a,b,e,1)))this._eventHandler.hideTooltip(),this._eventHandler.removeListeners(this),this._animation.setOnEnd(this.OnDrillAnimationEnd,this),this._animation.play()};DvtThematicMap.prototype.setClickInfo=function(a,b,d){this._clickedLayerName=b;this._clickedDataLayerId=a;this._clickedObject=d};DvtThematicMap.prototype.setEventClientId=function(a){this._eventClientId=a};
DvtThematicMap.prototype._dispatchEvent=function(a){var b=a.getType();b==DvtContextMenuSelectEvent.TYPE?this._handleContextMenuSelectEvent(a):(b==DvtContextMenuEvent.TYPE?this._handleContextMenuEvent(a):b==DvtSelectionEvent.TYPE?this._handleSelectionEvent(a):b==DvtMapDrillEvent.TYPE?this._handleDrillEvent(a):(b==DvtShowPopupEvent.TYPE||b==DvtHidePopupEvent.TYPE)&&a.addParam("clientId",this._eventClientId),this.getContext().getJsExt().dispatchEvent(this._callback,this._callbackObj,this,a))};
DvtThematicMap.prototype._handleContextMenuSelectEvent=function(a){a=a.getParamValue("action");a==DvtThematicMapContextMenuHandler.RESET_MAP?this._handleDrillEvent(new DvtMapDrillEvent(DvtMapDrillEvent.RESET)):a==DvtThematicMapContextMenuHandler.FIT_MAP?this.fitMap():a==DvtThematicMapContextMenuHandler.FIT_REGION?(this._zoomToFitObject=this._selectedRowKeys&&1<this._selectedRowKeys.length?this.getLayer(this._clickedLayerName).getDataLayer(this._clickedDataLayerId).getAreaSelectionLayer():this._clickedObject,
this.fitRegion()):a==DvtThematicMapContextMenuHandler.DRILL_UP?this._handleDrillEvent(new DvtMapDrillEvent(DvtMapDrillEvent.DRILL_UP)):a==DvtThematicMapContextMenuHandler.DRILL_DOWN&&this._handleDrillEvent(new DvtMapDrillEvent(DvtMapDrillEvent.DRILL_DOWN))};
DvtThematicMap.prototype._handleContextMenuEvent=function(a){var b=this.getLayer(this._clickedLayerName);b&&b.getDataLayer(this._clickedDataLayerId);if("none"!=this._drillMode){var b=this.getDrillParentLayer(this._clickedLayerName),d=this.getDrillChildLayer(this._clickedLayerName);d&&b?a.addParam("state","fud"):d?a.addParam("state","fd"):b&&a.addParam("state","fu")}else this._clickedObject&&!(this._clickedObject instanceof DvtMarker)&&a.addParam("state","f")};
DvtThematicMap.prototype._handleSelectionEvent=function(a){if(this._clickedDataLayerId){this._selectedRowKeys=a.getSelection();var b=this.getLayer(this._clickedLayerName).getDataLayer(this._clickedDataLayerId);this._selectedAreas=b.getSelectedAreas(this._selectedRowKeys);this._updateDrillButton(this._clickedLayerName);a.addParam("clientId",this._clickedDataLayerId);b&&b.getAreaSelectionLayer()&&"single"!==this._drillMode?this._zoomToFitObject=b.getAreaSelectionLayer():this._clickedObject&&!(this._clickedObject instanceof
DvtMarker)&&(this._zoomToFitObject=this._clickedObject)}};DvtThematicMap.prototype._hideSelectionMenu=function(){this._selectionText&&(this.removeChild(this._selectionText),this._selectionText=null)};
DvtThematicMap.prototype._updateDrillButton=function(a){if(this._controlPanel&&this._drillMode&&"none"!=this._drillMode){var b=this.getDrillChildLayer(a),a=this.getDrillParentLayer(a);b?this._controlPanel.setEnabledDrillDownButton(!0):this._controlPanel.setEnabledDrillDownButton(!1);a?this._controlPanel.setEnabledDrillUpButton(!0):this._controlPanel.setEnabledDrillUpButton(!1)}};
DvtThematicMap.prototype._handleDrillEvent=function(a){a.addParam("clientId",this._eventClientId);this._drilledRowKeys="multiple"==this._drillMode?this._drilledRowKeys.concat(this._selectedRowKeys):this._selectedRowKeys;var b=a.getDrillType();b==DvtMapDrillEvent.DRILL_UP&&this.drillUp();b==DvtMapDrillEvent.DRILL_DOWN?this.drillDown():b==DvtMapDrillEvent.RESET&&this.resetMap();a.setDisclosed(this._drilledRowKeys)};
DvtThematicMap.prototype.destroy=function(){DvtThematicMap.superclass.destroy.call(this);this._eventHandler&&(this._eventHandler.destroy(),this._eventHandler=null)};DvtThematicMap.prototype.OnAnimationEnd=function(){this._oldPzcContainer&&this._oldCpContainer&&(this._pzc.getContentPane().removeChild(this._oldCpContainer),this._pzc.removeChild(this._oldPzcContainer),this._oldCpContainer=this._oldPzcContainer=null);this._animationStopped=!1;this._animation=null;this._eventHandler.addListeners(this)};
DvtThematicMap.prototype.OnDrillAnimationEnd=function(){if(0<this._drillAnimFadeOutObjs.length){for(var a=0;a<this._drillAnimFadeOutObjs.length;a++)if(this._drillAnimFadeOutObjs[a]){var b=this._drillAnimFadeOutObjs[a].getParent();b&&b.removeChild(this._drillAnimFadeOutObjs[a])}this._drillAnimFadeOutObjs=[]}this._animationStopped=!1;this._animation=null;this._eventHandler.addListeners(this)};
DvtThematicMap.prototype._rolloverCallback=function(a){var b=a.getHideAttributes();this._fireRolloverEvent(DvtLegendItemRollOverEvent.MOUSEOVER==a.getMouseState()?DvtCategoryRolloverEvent.TYPE_OVER:DvtCategoryRolloverEvent.TYPE_OUT,b)};
DvtThematicMap.prototype._fireRolloverEvent=function(a,b){var d=new DvtCategoryRolloverEvent(a,b),e=[],g;for(g in this._areas)for(var h in this._areas[g])e.push(this._areas[g][h]);for(g in this._markers)for(h in this._markers[g])e.push(this._markers[g][h]);g=this._legend._hideAttrsLookUp;for(var k in g)h=new DvtThematicMapCategoryWrapper(g[k].getContentShape(),k),e.push(h);DvtCategoryRolloverHandler.processEvent(d,e,0.1)};
DvtThematicMap.prototype._getCurrentDragSource=function(){for(var a=0;a<this._layers.length;a++){var b=this._layers[a].getDataLayers(),d;for(d in b){var e=b[d].getDragSource();if(e&&e.getDragCandidate())return e}}};DvtThematicMap.prototype.isDragAvailable=function(a,b,d){return(a=this._getCurrentDragSource())?a.isDragAvailable(d):!1};DvtThematicMap.prototype.getDragTransferable=function(a,b){return this._getCurrentDragSource().getDragTransferable(a,b)};
DvtThematicMap.prototype.getDragOverFeedback=function(a,b){return this._getCurrentDragSource().getDragOverFeedback(a,b)};DvtThematicMap.prototype.getDragContext=function(a,b){return this._getCurrentDragSource().getDragContext(a,b)};DvtThematicMap.prototype.getDragOffset=function(a,b){return this._getCurrentDragSource().getDragOffset(a,b)};DvtThematicMap.prototype.getPointerOffset=function(a,b){return this._getCurrentDragSource().getPointerOffset(a,b)};DvtThematicMap.prototype.initiateDrag=function(){this._getCurrentDragSource().initiateDrag()};
DvtThematicMap.prototype.dragDropEnd=function(){this._getCurrentDragSource().dragDropEnd()};DvtThematicMap.prototype._getCurrentDropTarget=function(a,b){for(var d=0;d<this._layers.length;d++){var e=this._layers[d].getDropTarget();if(e&&e.getDropSite(a,b))return e}return null};DvtThematicMap.prototype.acceptDrag=function(a,b,d){a=(a-this._panX)/this._zoom;b=(b-this._panY)/this._zoom;return(this._dropTarget=this._getCurrentDropTarget(a,b))?this._dropTarget.acceptDrag(a,b,d):null};
DvtThematicMap.prototype.dragEnter=function(){return this._dropTarget?this._dropTarget.dragEnter():null};DvtThematicMap.prototype.dragExit=function(){return this._dropTarget?this._dropTarget.dragExit():null};DvtThematicMap.prototype.getDropSite=function(a,b){a=(a-this._panX)/this._zoom;b=(b-this._panY)/this._zoom;return this._dropTarget?this._dropTarget.getDropSite(a,b):null};var DvtThematicMapDropTarget=function(a){this._areaLayer=a};DvtObj.createSubclass(DvtThematicMapDropTarget,DvtDropTarget,"DvtThematicMapDropTarget");
DvtThematicMapDropTarget.prototype.acceptDrag=function(a,b){var d=this._areaLayer.__getObjectUnderPoint(a,b);if(d)d!=this._dropSite&&(this._areaLayer.__showDropSiteFeedback(d),this._dropSite=d);else return this._areaLayer.__showDropSiteFeedback(null),null;return this._areaLayer.getClientId()};DvtThematicMapDropTarget.prototype.dragExit=function(){this._areaLayer.__showDropSiteFeedback(null);this._dropSite=null};
DvtThematicMapDropTarget.prototype.getDropSite=function(a,b){var d=this._areaLayer.__getObjectUnderPoint(a,b);return d?{regionId:d.getId()}:null};(DvtBaseMapManager=this.DvtBaseMapManager)||(DvtBaseMapManager={});DvtObj.createSubclass(DvtBaseMapManager,DvtObj,"DvtBaseMapManager");DvtBaseMapManager.TYPE_LABELS=0;DvtBaseMapManager.TYPE_PATH=1;DvtBaseMapManager.TYPE_PARENTREGION_CHILDREN=2;DvtBaseMapManager.TYPE_LABELINFO=3;DvtBaseMapManager._INDEX="__index";DvtBaseMapManager._GLOBAL_MAPS={};
DvtBaseMapManager.getAreaLabelInfo=function(a,b){DvtBaseMapManager._processUnprocessedMaps();var d=DvtBaseMapManager._GLOBAL_MAPS[a][b];return d?d[DvtBaseMapManager.TYPE_LABELINFO]:null};DvtBaseMapManager.getAreaNames=function(a,b){DvtBaseMapManager._processUnprocessedMaps();var d=DvtBaseMapManager._GLOBAL_MAPS[a][b];return d?d[DvtBaseMapManager.TYPE_LABELS]:null};
DvtBaseMapManager.getLongAreaLabel=function(a,b,d){DvtBaseMapManager._processUnprocessedMaps();var a=DvtBaseMapManager._GLOBAL_MAPS[a][b],e;a&&(e=a[DvtBaseMapManager.TYPE_LABELS]);return e&&e[d]?e[d][1]:null};DvtBaseMapManager.getCityCoordinates=function(a,b){DvtBaseMapManager._processUnprocessedMaps();var d=DvtBaseMapManager._GLOBAL_MAPS[a];if(d&&(d=d.cities))if(d=d[DvtBaseMapManager.TYPE_PATH][b])return new DvtPoint(d[0],d[1]);return null};
DvtBaseMapManager.getCityLabel=function(a,b){DvtBaseMapManager._processUnprocessedMaps();var d=DvtBaseMapManager._GLOBAL_MAPS[a];if(d&&(d=d.cities))if(d=d[DvtBaseMapManager.TYPE_LABELS][b])return d[1];return null};DvtBaseMapManager.getAreaCenter=function(a,b,d){DvtBaseMapManager._processUnprocessedMaps();if(a=DvtBaseMapManager._GLOBAL_MAPS[a])if(b=a[b])if((b=b[DvtBaseMapManager.TYPE_LABELINFO])&&b[d])return DvtRectangle.create(b[d][0]).getCenter();return null};
DvtBaseMapManager.getChildLayerName=function(a,b){DvtBaseMapManager._processUnprocessedMaps();return DvtBaseMapManager._GLOBAL_MAPS[a][DvtBaseMapManager._INDEX][DvtBaseMapManager._GLOBAL_MAPS[a][b].__index+1]};DvtBaseMapManager.getParentLayerName=function(a,b){DvtBaseMapManager._processUnprocessedMaps();return DvtBaseMapManager._GLOBAL_MAPS[a][DvtBaseMapManager._INDEX][DvtBaseMapManager._GLOBAL_MAPS[a][b].__index-1]};
DvtBaseMapManager.getAreaPaths=function(a,b){DvtBaseMapManager._processUnprocessedMaps();return DvtBaseMapManager._GLOBAL_MAPS[a][b][DvtBaseMapManager.TYPE_PATH]};DvtBaseMapManager.getChildrenForLayerAreas=function(a,b){DvtBaseMapManager._processUnprocessedMaps();var d=DvtBaseMapManager.getChildLayerName(a,b);return d&&(d=DvtBaseMapManager._GLOBAL_MAPS[a][d][DvtBaseMapManager.TYPE_PARENTREGION_CHILDREN])?d:[]};
DvtBaseMapManager.getMapLayerName=function(a,b){DvtBaseMapManager._processUnprocessedMaps();return DvtBaseMapManager._GLOBAL_MAPS[a][DvtBaseMapManager._INDEX][b]};
DvtBaseMapManager.registerBaseMapLayer=function(a,b,d,e,g,h,k){var m=DvtBaseMapManager._GLOBAL_MAPS[a];m||(m={__index:[]},DvtBaseMapManager._GLOBAL_MAPS[a]=m);a=m[b];a||(a={},m[b]=a,m[DvtBaseMapManager._INDEX][k]=b);a[DvtBaseMapManager.TYPE_LABELS]=d;a[DvtBaseMapManager.TYPE_PATH]=e;a[DvtBaseMapManager.TYPE_PARENTREGION_CHILDREN]=g;a[DvtBaseMapManager.TYPE_LABELINFO]=h;a[DvtBaseMapManager._INDEX]=k};
DvtBaseMapManager.registerResourceBundle=function(a,b,d){var e=DvtBaseMapManager._GLOBAL_MAPS[a];e||(e={},DvtBaseMapManager._GLOBAL_MAPS[a]=e);a=e[b];a||(a={},e[b]=a);(a=e[b])&&(a[DvtBaseMapManager.TYPE_LABELS]=d)};DvtBaseMapManager.updateResourceBundle=function(a,b,d){if(a=DvtBaseMapManager._GLOBAL_MAPS[a])if(b=a[b])for(var e in d)b[DvtBaseMapManager.TYPE_LABELS][e]=d[e]};
DvtBaseMapManager._processUnprocessedMaps=function(){if(DvtBaseMapManager._UNPROCESSED_MAPS){var a,b;for(a=0;a<DvtBaseMapManager._UNPROCESSED_MAPS[0].length;a++)b=DvtBaseMapManager._UNPROCESSED_MAPS[0][a],DvtBaseMapManager.registerBaseMapLayer(b[0],b[1],b[2],b[3],b[4],b[5],b[6]);for(a=0;a<DvtBaseMapManager._UNPROCESSED_MAPS[1].length;a++)b=DvtBaseMapManager._UNPROCESSED_MAPS[1][a],DvtBaseMapManager.registerResourceBundle(b[0],b[1],b[2]);for(a=0;a<DvtBaseMapManager._UNPROCESSED_MAPS[2].length;a++)b=
DvtBaseMapManager._UNPROCESSED_MAPS[2][a],DvtBaseMapManager.updateResourceBundle(b[0],b[1],b[2]);DvtBaseMapManager._UNPROCESSED_MAPS=null}};var DvtMapDrillEvent=function(a){this.Init(DvtMapDrillEvent.TYPE);this._drillType=a};DvtObj.createSubclass(DvtMapDrillEvent,DvtBaseComponentEvent,"DvtMapDrillEvent");DvtMapDrillEvent.TYPE="drill";DvtMapDrillEvent.DRILL_UP=0;DvtMapDrillEvent.DRILL_DOWN=1;DvtMapDrillEvent.RESET=2;DvtMapDrillEvent.prototype.getDisclosed=function(){return this._disclosed};
DvtMapDrillEvent.prototype.setDisclosed=function(a){this._disclosed=a};DvtMapDrillEvent.prototype.getDrillType=function(){return this._drillType};DvtMapActionEvent=function(a,b,d){this.Init(DvtMapActionEvent.TYPE);this._clientId=a;this._rowKey=b;this._action=d};DvtObj.createSubclass(DvtMapActionEvent,DvtBaseComponentEvent,"DvtMapActionEvent");DvtMapActionEvent.TYPE="action";DvtMapActionEvent.prototype.getClientId=function(){return this._clientId};DvtMapActionEvent.prototype.getRowKey=function(){return this._rowKey};
DvtMapActionEvent.prototype.getAction=function(){return this._action};var DvtMapLabel=function(a,b,d,e){this.Init(a,b,d,e)};DvtObj.createSubclass(DvtMapLabel,DvtText,"DvtMapLabel");
DvtMapLabel.prototype.Init=function(a,b,d,e){DvtMapLabel.superclass.Init.call(this,a,b,0,0);this._boundRectangle=[];this.setMouseEnabled(!1);this.setFontSize("11");this.alignTop();this._leaderLineLayer=e;this._center=null;if(d&&(this._boundRectangle.push(DvtRectangle.create(d[0])),1<d.length)){this._leaderLines=[];for(b=1;b<d.length;b++)e=d[b],this._boundRectangle.push(DvtRectangle.create(e[0])),e=new DvtPolyline(a,e[1]),e.setPixelHinting(!0),this._leaderLines.push(e)}};
DvtMapLabel.prototype.addBounds=function(a){this._boundRectangle.push(a)};DvtMapLabel.prototype.hasBounds=function(){return 0<this._boundRectangle.length};
DvtMapLabel.prototype.update=function(a){var b=this.getDimensions();null==this._center&&this.setCenter(this._boundRectangle[0].getCenter());if(this._leaderLines){for(var d=-1,e=0;e<this._boundRectangle.length;e++)if(b.w<=this._boundRectangle[e].w*a.getA()){d=e;this.setCenter(this._boundRectangle[e].getCenter());break}0<this._currentState&&(this._leaderLineLayer.removeChild(this._leaderLines[this._currentState-1]),this._leaderLine=null);-1==d?this.setVisible(!1):(this.setVisible(!0),0<d&&(this._leaderLine=
this._leaderLines[d-1],this._leaderLine.setStroke(new DvtSolidStroke("#000000",1,1/a.getA())),this._leaderLineLayer.addChild(this._leaderLine)));this._currentState=d}else b.w>this._boundRectangle[0].w*a.getA()?this.setVisible(!1):this.setVisible(!0);a=a.transformPoint(this._center);this.setTranslateX(a.x-this._center.x);this.setTranslateY(a.y-this._center.y)};DvtMapLabel.prototype.setCenter=function(a){this._center=a;var b=this.getDimensions();b&&(this.setX(a.x-b.w/2),this.setY(a.y-b.h/2))};
DvtMapLabel.prototype.getLeaderLine=function(){return this._leaderLine};DvtMapLabel.prototype.getCenter=function(){return this._center};DvtMapLabel.prototype.setCSSStyle=function(a){DvtMapLabel.superclass.setCSSStyle.call(this,a)};var DvtMapDataObject=function(a,b,d,e,g){this.Init(a,b,d,e,g)};DvtObj.createSubclass(DvtMapDataObject,DvtContainer,"DvtMapDataObject");
DvtMapDataObject.prototype.Init=function(a,b,d,e,g){DvtMapDataObject.superclass.Init.call(this,a,e);this._categories=[];this.Shape=null;this._id=d;this._clientId=e;this.AreaId=g;this._selectionLayer=null;this._datatipColor="#000000";this.Zoom=1;this._hasAction=!1;this._dataLayer=b};DvtMapDataObject.prototype.getId=function(){return this._id};DvtMapDataObject.prototype.getClientId=function(){return this._clientId};DvtMapDataObject.prototype.getAreaId=function(){return this.AreaId};
DvtMapDataObject.prototype.setDisplayable=function(a){(this.Shape=a)&&this.Shape.setAriaRole("img")};DvtMapDataObject.prototype.setCenter=function(a){this.Center=a};DvtMapDataObject.prototype.getDisplayable=function(){return this.Shape};DvtMapDataObject.prototype.setLabel=function(a){this.Label=a};DvtMapDataObject.prototype.getLabel=function(){return this.Label};DvtMapDataObject.prototype.setLabelPosition=function(a){this.LabelPos=a};
DvtMapDataObject.prototype.setHasAction=function(a){this._hasAction=a};DvtMapDataObject.prototype.hasAction=function(){return this._hasAction};DvtMapDataObject.prototype.setAction=function(a){this._action=a};DvtMapDataObject.prototype.getAction=function(){return this._action};DvtMapDataObject.prototype.setDestination=function(a){this._destination=a};DvtMapDataObject.prototype.getDestination=function(){return this._destination};
DvtMapDataObject.prototype.setVisible=function(a){DvtMapDataObject.superclass.setVisible.call(this,a);this.Label&&this.Label.setVisible(a)};DvtMapDataObject.prototype.getDisplayables=function(){return[this.Shape]};DvtMapDataObject.prototype.getCategories=function(){return this._categories};DvtMapDataObject.prototype.addCategory=function(a){this._categories.push(a)};DvtMapDataObject.prototype.getDatatip=function(){return this._datatip};DvtMapDataObject.prototype.getDatatipColor=function(){return this._datatipColor};
DvtMapDataObject.prototype.setDatatipColor=function(a){this._datatipColor=a;this.Shape&&this.Shape.setDataColor&&this.Shape.setDataColor(a)};DvtMapDataObject.prototype.setDatatip=function(a){this._datatip=a;this.Shape&&this.Shape.setAriaProperty("label",a)};DvtMapDataObject.prototype.isSelectable=function(){return this.Shape.isSelectable()};DvtMapDataObject.prototype.isSelected=function(){return this.Shape.isSelected()};DvtMapDataObject.prototype.showHoverEffect=function(){};
DvtMapDataObject.prototype.hideHoverEffect=function(){};DvtMapDataObject.prototype.setShowPopupBehaviors=function(a){this._showPopupBehaviors=a};DvtMapDataObject.prototype.getShowPopupBehaviors=function(){return this._showPopupBehaviors};DvtMapDataObject.prototype.getContextMenuId=function(){return"popupMenu"};DvtMapDataObject.prototype.isDragAvailable=function(a){for(var b=this._dataLayer.getClientId(),d=0;d<a.length&&!(a[d]==b);d++);return b};DvtMapDataObject.prototype.getDataLayer=function(){return this._dataLayer};
DvtMapDataObject.prototype.getDragTransferable=function(){return this._dataLayer.__getDragTransferable(this)};DvtMapDataObject.prototype.getDragFeedback=function(){return this._dataLayer.__getDragFeedback()};
DvtMapDataObject.prototype.getNextNavigable=function(a){if(a.type==DvtMouseEvent.CLICK||a.keyCode==DvtKeyboardEvent.SPACE&&a.ctrlKey)return this;var b=this.Shape instanceof DvtMapArea?this._dataLayer.getMap().getNavigableAreas():this._dataLayer.getDataObjects();return DvtKeyboardHandler.getNextAdjacentNavigable(this,a,b)};DvtMapDataObject.prototype.getKeyboardBoundingBox=function(){return this.Shape?this.Shape.getDimensions(this.getContext().getStage()):new DvtRectangle(0,0,0,0)};
DvtMapDataObject.prototype.showKeyboardFocusEffect=function(){this.showHoverEffect();this._isShowingKeyboardFocusEffect=!0};DvtMapDataObject.prototype.hideKeyboardFocusEffect=function(){this.hideHoverEffect();this._isShowingKeyboardFocusEffect=!1};DvtMapDataObject.prototype.isShowingKeyboardFocusEffect=function(){return this._isShowingKeyboardFocusEffect};DvtMapDataObject.prototype.HandleZoomEvent=function(a){this.Zoom=a.getA()};DvtMapDataObject.prototype.HandlePanEvent=function(){};
DvtMapDataObject.prototype.reCenter=function(a){var b=this.Shape.getWidth(),d=this.Shape.getHeight();null!=b&&null!=d&&(b=this.Shape.getDimensions(),a=a.transformPoint(new DvtPoint(b.x+b.w/2,b.y+b.h/2)),this.Shape.setTranslateX(a.x-this.Center.x),this.Shape.setTranslateY(a.y-this.Center.y))};var DvtMapDataArea=function(a,b,d,e,g,h,k){this.Init(a,b,d,e,g,h,k)};DvtMapDataArea._DEFAULT_SELECTED_STROKE_WIDTH=1;DvtMapDataArea._DEFAULT_SELECTED_STROKE_COLOR="#000000";
DvtMapDataArea._DEFAULT_DISCLOSED_STROKE_WIDTH=2;DvtMapDataArea._DEFAULT_DISCLOSED_STROKE_COLOR="#000000";DvtMapDataArea._DEFAULT_HOVER_STROKE_WIDTH=2;DvtMapDataArea._DEFAULT_HOVER_STROKE_COLOR="#FFFFFF";DvtMapDataArea._DEFAULT_SHADOW_COLOR="rgba(0,0,0,0.5)";DvtObj.createSubclass(DvtMapDataArea,DvtMapDataObject,"DvtMapDataArea");
DvtMapDataArea.prototype.Init=function(a,b,d,e,g,h,k){DvtMapDataArea.superclass.Init.call(this,a,b,d,e,g);a=DvtMapDataArea._DEFAULT_SELECTED_STROKE_COLOR;b=DvtMapDataArea._DEFAULT_SELECTED_STROKE_WIDTH;d=DvtMapDataArea._DEFAULT_HOVER_STROKE_COLOR;e=DvtMapDataArea._DEFAULT_HOVER_STROKE_WIDTH;g=DvtMapDataArea._DEFAULT_SHADOW_COLOR;k&&(DvtColorUtils.isColor(k["border-color"])&&(a=DvtColorUtils.getRGB(k["border-color"])),k["border-width"]&&(b=parseFloat(k["border-width"].substring(0,k["border-width"].indexOf("px")))),
k["shadow-color"]&&DvtColorUtils.isColor(k["shadow-color"])&&(g=DvtColorUtils.getRGB(k["shadow-color"]),g=g.substring(0,g.length-1)+",0.5)"));h&&(DvtColorUtils.isColor(h["border-color"])&&(d=DvtColorUtils.getRGB(h["border-color"])),h["border-width"]&&(e=parseFloat(h["border-width"].substring(0,h["border-width"].indexOf("px")))));this._selectedStroke=new DvtSolidStroke(a,1,b);this._disclosedStroke=new DvtSolidStroke("#000000",1,DvtMapDataArea._DEFAULT_DISCLOSED_STROKE_WIDTH);this._hoverStroke=new DvtSolidStroke(d,
1,e);this._selectedStrokeWidth=b;this._disclosedStrokeWidth=DvtMapDataArea._DEFAULT_DISCLOSED_STROKE_WIDTH;this._hoverStrokeWidth=e;this._shadow=new DvtShadow(g,5,5,5);this.ZoomedSelectedStrokeWidth=b;this.ZoomedDisclosedStrokeWidth=DvtMapDataArea._DEFAULT_DISCLOSED_STROKE_WIDTH;this.ZoomedHoverStrokeWidth=e};
DvtMapDataArea.prototype.setDisplayable=function(a){DvtMapDataArea.superclass.setDisplayable.call(this,a);this._borderStroke=this.Shape.getStroke();this.ZoomedBorderStrokeWidth=this._borderStrokeWidth=this._borderStroke.getWidth();this._hoverShape=this.Shape.getOutline()};DvtMapDataArea.prototype.setSelectionLayer=function(a){this._selectionLayer=a};DvtMapDataArea.prototype.getSelectionLayer=function(){return this._selectionLayer};
DvtMapDataArea.prototype.setAreaLayer=function(a){this._dataAreaLayer=a};DvtMapDataArea.prototype.setHoverLayer=function(a){this._hoverLayer=a};DvtMapDataArea.prototype.setSelected=function(a){if(a)this._setSelectionEffect();else{this._dataAreaLayer.addChild(this.Shape);var b=this.getContext();b instanceof DvtSvgContext&&b.getDocumentUtils().fixWebkitFilters(this._selectionLayer.getImpl().getElem());b=this._borderStroke.clone();b.setWidth(this.ZoomedBorderStrokeWidth);this.Shape.setStroke(b)}this.Shape.setSelected(a)};
DvtMapDataArea.prototype._setSelectionEffect=function(){this._selectionLayer.removeAllDrawEffects();this._selectionLayer.addChild(this.Shape);this._selectionLayer.addDrawEffect(this._shadow.clone());var a=this._selectedStroke.clone();a.setWidth(this.ZoomedSelectedStrokeWidth);this.Shape.setStroke(a)};DvtMapDataArea.prototype.showHoverEffect=function(){var a=this._hoverStroke.clone();a.setWidth(this.ZoomedHoverStrokeWidth);this._hoverShape.setStroke(a);this._hoverLayer.addChild(this._hoverShape)};
DvtMapDataArea.prototype.hideHoverEffect=function(){if(this.isDrilled()){var a=this._disclosedStroke.clone();a.setWidth(this.ZoomedDisclosedStrokeWidth);this._hoverShape.setStroke(a)}else this._hoverLayer.removeChild(this._hoverShape)};DvtMapDataArea.prototype.isDrilled=function(){return this._isDrilled};DvtMapDataArea.prototype.setDrilled=function(a){(this._isDrilled=a)?this._setDrilledEffect():this._hoverLayer.removeChild(this._hoverShape)};
DvtMapDataArea.prototype._setDrilledEffect=function(){var a=this._disclosedStroke.clone();a.setWidth(this.ZoomedDisclosedStrokeWidth);this._hoverShape.setStroke(a);this._hoverLayer.addChild(this._hoverShape)};
DvtMapDataArea.prototype.HandleZoomEvent=function(a){DvtMapDataArea.superclass.HandleZoomEvent.call(this,a);this.ZoomedSelectedStrokeWidth=this._selectedStrokeWidth/this.Zoom;this.ZoomedDisclosedStrokeWidth=this._disclosedStrokeWidth/this.Zoom;this.ZoomedHoverStrokeWidth=this._hoverStrokeWidth/this.Zoom;this.ZoomedBorderStrokeWidth=this._borderStrokeWidth/this.Zoom;this._hoverShape.getParent()&&this._hoverShape.getStroke()?(a=this._hoverShape.getStroke().clone(),a.setWidth(this.ZoomedHoverStrokeWidth),
this._hoverShape.setStroke(a)):this.isDrilled()&&(a=this._hoverShape.getStroke().clone(),a.setWidth(this.ZoomedDisclosedStrokeWidth),this._hoverShape.setStroke(a));this.isSelected()?(a=this.Shape.getStroke().clone(),a.setWidth(this.ZoomedSelectedStrokeWidth)):(a=this._borderStroke.clone(),a.setWidth(this.ZoomedBorderStrokeWidth));this.Shape.setStroke(a)};DvtMapDataArea.prototype.reCenter=function(a){DvtMapDataMarker.superclass.reCenter.call(this,a)};
var DvtMapDataMarker=function(a,b,d,e,g){this.Init(a,b,d,e,g)};DvtMapDataMarker.DEFAULT_MARKER_COLOR="#61719F";DvtMapDataMarker.DEFAULT_MARKER_STROKE_COLOR="#FFFFFF";DvtMapDataMarker.DEFAULT_MARKER_STROKE_WIDTH=0.5;DvtMapDataMarker.DEFAULT_MARKER_ALPHA=0.7;DvtMapDataMarker.DEFAULT_MARKER_SIZE=8;DvtMapDataMarker.DEFAULT_MARKER_SHAPE="c";DvtMapDataMarker.DEFAULT_MARKER_SCALE=1;DvtObj.createSubclass(DvtMapDataMarker,DvtMapDataObject,"DvtMapDataMarker");
DvtMapDataMarker.prototype.Init=function(a,b,d,e,g){DvtMapDataMarker.superclass.Init.call(this,a,b,d,e,g);this.InitCanvasZoom=1};DvtMapDataMarker.prototype.setSelected=function(a){this.Shape.setSelected(a)};DvtMapDataMarker.prototype.showHoverEffect=function(){this.Shape.showHoverEffect()};DvtMapDataMarker.prototype.hideHoverEffect=function(){this.Shape.hideHoverEffect()};DvtMapDataMarker.prototype.HandleZoomEvent=function(a){DvtMapDataMarker.superclass.HandleZoomEvent.call(this,a);this.reCenter(a)};
DvtMapDataMarker.prototype.HandlePanEvent=function(a){DvtMapDataMarker.superclass.HandlePanEvent.call(this,a);this.reCenter(a)};
DvtMapDataMarker.prototype.positionText=function(){if(this.Label){this.Shape.removeChild(this.Label);var a=this.Shape.getDimensions();this.Shape.addChild(this.Label);var b=this.Label.getDimensions(),d=a.x+a.w/2-b.w/2,e=this.Shape.getType();this.Label.alignTop();"top"==this.LabelPos?a=a.y-b.h:"bottom"==this.LabelPos?a=a.y+a.h:e==DvtMarker.TRIANGLE_UP?(a=a.y+2*a.h/3,this.Label.alignCenter()):a=e==DvtMarker.TRIANGLE_DOWN?a.y+a.h/3-b.h/2:a.y+a.h/2-b.h/2;this.Label.setX(d);this.Label.setY(a)}};
var DvtMapDataImage=function(a,b,d,e,g){this.Init(a,b,d,e,g)};DvtObj.createSubclass(DvtMapDataImage,DvtMapDataObject,"DvtMapDataImage");DvtMapDataImage.prototype.Init=function(a,b,d,e,g){DvtMapDataImage.superclass.Init.call(this,a,b,d,e,g)};DvtMapDataImage.prototype.HandleZoomEvent=function(a){DvtMapDataImage.superclass.HandleZoomEvent.call(this,a);this._pzcMatrix=a;this.reCenter(a)};
DvtMapDataImage.prototype.HandlePanEvent=function(a){DvtMapDataImage.superclass.HandlePanEvent.call(this,a);this._pzcMatrix=a;this.reCenter(a)};DvtMapDataImage.prototype.onImageLoaded=function(a){a&&a.width&&a.height&&(this.Shape.getWidth()||this.Shape.setWidth(a.width),this.Shape.getHeight()||this.Shape.setHeight(a.height),this.Shape.setX(this.Center.x-a.width/2),this.Shape.setY(this.Center.y-a.height/2),this.reCenter(this._pzcMatrix))};var DvtMapArea=function(a,b,d,e){this.Init(a,b,d,e)};
DvtObj.createSubclass(DvtMapArea,DvtContainer,"DvtMapArea");DvtMapArea._DEFAULT_FILL_COLOR="#B8CDEC";DvtMapArea._DEFAULT_STROKE_COLOR="#FFFFFF";DvtMapArea._DEFAULT_STROKE_ALPHA=1;DvtMapArea._DEFAULT_STROKE_WIDTH=0.5;
DvtMapArea.prototype.Init=function(a,b,d,e){DvtMapArea.superclass.Init.call(this,a);this._isSelected=this._bSelectable=!1;this._areaName=d;this._tooltip=e;this._shape=b;this.addChild(this._shape);if(b instanceof DvtShape&&(a=b.getStroke()))this._strokeWidth=a.getWidth();this._shape&&(this._shape.setAriaRole("img"),this._shape.setAriaProperty("label",e))};DvtMapArea.prototype.getAreaName=function(){return this._areaName};DvtMapArea.prototype.getTooltip=function(){return this._tooltip};
DvtMapArea.prototype.setTooltip=function(a){this._tooltip=a;this._shape&&this._shape.setAriaProperty("label",a)};DvtMapArea.prototype.isSelectable=function(){return this._bSelectable};DvtMapArea.prototype.setSelectable=function(a){(this._bSelectable=a)?this.setCursor(DvtSelectionEffectUtils.getSelectingCursor()):this.setCursor(null)};DvtMapArea.prototype.isSelected=function(){return this._isSelected};DvtMapArea.prototype.setSelected=function(a){this._isSelected=a};
DvtMapArea.prototype.getOutline=function(){return DvtShapeUtils.getShapeOutline(this._shape)};DvtMapArea.prototype.getStroke=function(){return this._shape instanceof DvtShape?this._shape.getStroke():null};DvtMapArea.prototype.getUnzoomedStrokeWidth=function(){return this._strokeWidth};DvtMapArea.prototype.setStroke=function(a){this._shape instanceof DvtShape&&this._shape.setStroke(a)};DvtMapArea.prototype.setFill=function(a){this._shape instanceof DvtShape&&this._shape.setFill(a)};
DvtMapArea.prototype.getFill=function(){return this._shape instanceof DvtShape?this._shape.getFill():null};DvtMapArea.prototype.setSrc=function(a){this._shape instanceof DvtImage&&this._shape.setSrc(a)};DvtMapArea.prototype.savePatternFill=function(a){this._ptFill=a};DvtMapArea.prototype.getSavedPatternFill=function(){return this._ptFill};DvtMapArea.prototype.getDropSiteFeedback=function(){return new DvtPath(this.getContext(),this.getCmds())};
DvtMapArea.prototype.contains=function(a,b){var d=this.getDimensions();return a>=d.x&&a<=d.x+d.w&&b>=d.y&&b<=d.y+d.h};DvtMapArea.prototype.HandleZoomEvent=function(a){a=a.getA();if(this._strokeWidth){var b=this.getStroke();b&&(b=b.clone(),b.setWidth(this._strokeWidth/a),this.setStroke(b))}};var DvtMapLayer=function(a,b,d,e,g){this.Init(a,b,d,e,g)};DvtObj.createSubclass(DvtMapLayer,DvtObj,"DvtMapLayer");
DvtMapLayer.prototype.Init=function(a,b,d,e,g){this._tmap=a;this._baseMapName=b;this._layerName=d;this._clientId=e;this.EventHandler=g;this.DataLayers={};this.PzcMatrix=new DvtMatrix};DvtMapLayer.prototype.addDataLayer=function(a){this.DataLayers[a.getClientId()]=a};
DvtMapLayer.prototype.updateDataLayer=function(a){this._oldDataLayer=this.getDataLayer(a.getClientId());this.addDataLayer(a);a.render(this.PzcMatrix);a.HandleZoomEvent(this.PzcMatrix);if(this._oldDataLayer){this._animation&&(this._animationStopped=!0,this._animation.stop());var b=a.getAnimation(),d=a.getAnimationDuration();if(DvtBlackBoxAnimationHandler.isSupported(b)){var e=new DvtRectangle(0,0,this._tmap.GetWidth(),this._tmap.GetHeight()),g=new DvtRectangle(0,0,this._tmap.GetWidth()/this.PzcMatrix.getA(),
this._tmap.GetHeight()/this.PzcMatrix.getA()),e=DvtBlackBoxAnimationHandler.getCombinedAnimation(this._tmap.getContext(),b,this._oldDataLayer.getNonScaledContainers(),a.getNonScaledContainers(),e,d),a=DvtBlackBoxAnimationHandler.getCombinedAnimation(this._tmap.getContext(),b,this._oldDataLayer.getScaledContainers(),a.getScaledContainers(),g,d);this._animation=new DvtParallelPlayable(this._tmap.getContext(),[e,a])}else{a=this._oldDataLayer.getContainers();for(b=0;b<a.length;b++)a[b].getParent().removeChild(a[b])}this._animation&&
(this.EventHandler.removeListeners(this._callbackObj),this._animation.setOnEnd(this.OnAnimationEnd,this),this._animation.play())}};DvtMapLayer.prototype.getDataLayers=function(){return this.DataLayers};DvtMapLayer.prototype.getDataLayer=function(a){return this.DataLayers?this.DataLayers[a]:null};DvtMapLayer.prototype.getClientId=function(){return this._clientId};DvtMapLayer.prototype.getLayerName=function(){return this._layerName};
DvtMapLayer.prototype.render=function(a){this.PzcMatrix=a;for(var b in this.DataLayers)this.DataLayers[b].render(a),this.DataLayers[b].HandleZoomEvent(a)};DvtMapLayer.prototype.reset=function(a,b){for(var d in this.DataLayers)this.DataLayers[d].reset(a,b)};DvtMapLayer.prototype.HandleZoomEvent=function(a){this._pzcMatrix=a;for(var b in this.DataLayers)this.DataLayers[b].HandleZoomEvent(a)};DvtMapLayer.prototype.HandlePanEvent=function(a){this.PzcMatrix=a;for(var b in this.DataLayers)this.DataLayers[b].HandlePanEvent(a)};
DvtMapLayer.prototype.OnAnimationEnd=function(){if(this._oldDataLayer)for(var a=this._oldDataLayer.getContainers(),b=0;b<a.length;b++)a[b].getParent().removeChild(a[b]);this._animationStopped=!1;this._animation=null;this.EventHandler.addListeners(this._callbackObj)};var DvtMapAreaLayer=function(a,b,d,e,g,h,k){this.Init(a,b,d,e,g,h,k)};DvtObj.createSubclass(DvtMapAreaLayer,DvtMapLayer,"DvtMapAreaLayer");DvtMapAreaLayer._SHORT_NAME=0;DvtMapAreaLayer._LONG_NAME=1;
DvtMapAreaLayer.prototype.Init=function(a,b,d,e,g,h,k){DvtMapAreaLayer.superclass.Init.call(this,a,b,d,e,k);this._displayLabels=g;this._labelType=h;this._areaLabels={};this.Areas={};this.AreaShapes=[];this._labelInfo=this.AreaNames=null;this._disclosed=[];this._doNotRenderList=[];this._doNotRenderLabelList=[];this.AreaContainer=new DvtContainer(this._tmap.getContext());this.LabelContainer=new DvtContainer(this._tmap.getContext());this.LeaderLineContainer=new DvtContainer(this._tmap.getContext());
this._tmap.getAreaLayerContainer().addChild(this.AreaContainer);this._tmap.getLabelContainer().addChild(this.LabelContainer);this._tmap.getHoverContainer().addChild(this.LeaderLineContainer);this._dropSiteFill=new DvtSolidFill("#6DA7FF");this._dropSiteStrokeColor="0098FF";this._dropTarget=new DvtThematicMapDropTarget(this)};DvtMapAreaLayer.prototype.setAnimation=function(a){this._animType=a};DvtMapAreaLayer.prototype.getAnimation=function(){return this._animType};
DvtMapAreaLayer.prototype.setAnimationDuration=function(a){this._animDur=a};DvtMapAreaLayer.prototype.getAnimationDuration=function(){return this._animDur};DvtMapAreaLayer.prototype.getDropTarget=function(){return this._dropTarget};DvtMapAreaLayer.prototype.getLabelType=function(){return this._labelType};DvtMapAreaLayer.prototype.setAreaShapes=function(a){this.AreaShapes=a};DvtMapAreaLayer.prototype.setAreaNames=function(a){this.AreaNames=a};DvtMapAreaLayer.prototype.getShortAreaName=function(a){return this.AreaNames[a][DvtMapAreaLayer._SHORT_NAME]};
DvtMapAreaLayer.prototype.getLongAreaName=function(a){return this.AreaNames[a][DvtMapAreaLayer._LONG_NAME]};DvtMapAreaLayer.prototype.setAreaLabelInfo=function(a){this._labelInfo=a};DvtMapAreaLayer.prototype.getLabelInfoForArea=function(a){return!this._labelInfo?null:this._labelInfo[a]};DvtMapAreaLayer.prototype.setAreaChildren=function(a){this._children=a};DvtMapAreaLayer.prototype.getChildrenForArea=function(a){return this._children[a]?this._children[a].split(","):[]};
DvtMapAreaLayer.prototype.getArea=function(a){return this.Areas[a]};DvtMapAreaLayer.prototype.getAreaShape=function(a){if(this.AreaShapes[a]){var b=DvtShapeUtils.getShapeOutline(this.AreaShapes[a]),d;this.Areas[a]?(d=this.Areas[a].getStroke().clone(),a=this.Areas[a].getUnzoomedStrokeWidth(),d.setWidth(a)):d=this.AreaShapes[a].getStroke().clone();b.setStroke(d);return b}return null};DvtMapAreaLayer.prototype.displayLabels=function(){return this._displayLabels};
DvtMapAreaLayer.prototype.setLayerCSSStyle=function(a){this._layerCSSStyle=a};DvtMapAreaLayer.prototype.getLayerCSSStyle=function(){return this._layerCSSStyle};DvtMapAreaLayer.prototype.doNotRenderArea=function(a){-1==DvtArrayUtils.indexOf(this._doNotRenderList,a)&&this._doNotRenderList.push(a)};DvtMapAreaLayer.prototype.doNotRenderLabel=function(a){-1==DvtArrayUtils.indexOf(this._doNotRenderLabelList,a)&&this._doNotRenderLabelList.push(a)};
DvtMapAreaLayer.prototype.isDoNotRenderLabel=function(a){return-1<DvtArrayUtils.indexOf(this._doNotRenderLabelList,a)};DvtMapAreaLayer.prototype.setIsolatedArea=function(a){for(var b in this.AreaShapes)b!=a&&this._doNotRenderList.push(b)};
DvtMapAreaLayer.prototype._createAreaAndLabel=function(a,b){if(this.AreaShapes[a]){if(!this.Areas[a]){var d=this._tmap.getContext(),e=new DvtMapArea(d,this.AreaShapes[a],a);this.Areas[a]=e;this.EventHandler.associate(this.AreaShapes[a],e);e.setTooltip(this.AreaNames&&this.AreaNames[a]?this.AreaNames[a][DvtMapAreaLayer._LONG_NAME]:null)}this.AreaContainer.addChild(this.Areas[a]);var g=this._areaLabels[a];if(!g&&"off"!=this._displayLabels&&this.AreaNames&&-1==DvtArrayUtils.indexOf(this._doNotRenderLabelList,
a)&&(d="short"==this._labelType?this.AreaNames[a][DvtMapAreaLayer._SHORT_NAME]:this.AreaNames[a][DvtMapAreaLayer._LONG_NAME]))this._labelInfo&&this._labelInfo[a]?g=new DvtMapLabel(this._tmap.getContext(),d,this._labelInfo[a],this.LeaderLineContainer):(e=e.getDimensions(),g=new DvtMapLabel(this._tmap.getContext(),d,[e.x,e.y,e.w,e.h],this.LeaderLineContainer)),this._areaLabels[a]=g,this._layerCSSStyle&&g.setCSSStyle(this._layerCSSStyle);g&&(this.LabelContainer.addChild(g),g.update(this.PzcMatrix));
b&&(b.push(this.Areas[a]),g&&(b.push(g),b.push(g.getLeaderLine())))}};
DvtMapAreaLayer.prototype.render=function(a){DvtMapAreaLayer.superclass.render.call(this,a);var a=this._tmap.getContext(),b;for(b in this.AreaShapes)if(-1==DvtArrayUtils.indexOf(this._doNotRenderList,b)){var d=this.AreaShapes[b].getParent();if(d)var e=d.getChildIndex(this.AreaShapes[b]);var g=new DvtMapArea(a,this.AreaShapes[b],b);d&&d.addChildAt(g,e);this.Areas[b]=g;this.EventHandler.associate(g,g);g.setTooltip(this.AreaNames&&this.AreaNames[b]?this.AreaNames[b][DvtMapAreaLayer._LONG_NAME]:null);
this.AreaContainer.addChild(g);d=null;if("off"!=this._displayLabels&&this.AreaNames&&-1==DvtArrayUtils.indexOf(this._doNotRenderLabelList,b)&&(d="short"==this._labelType?this.AreaNames[b][DvtMapAreaLayer._SHORT_NAME]:this.AreaNames[b][DvtMapAreaLayer._LONG_NAME]))this._labelInfo&&this._labelInfo[b]?d=new DvtMapLabel(this._tmap.getContext(),d,this._labelInfo[b],this.LeaderLineContainer):(g=g.getDimensions(),d=new DvtMapLabel(this._tmap.getContext(),d,[g.x,g.y,g.w,g.h],this.LeaderLineContainer)),this._areaLabels[b]=
d,this._layerCSSStyle&&d.setCSSStyle(this._layerCSSStyle),this.LabelContainer.addChild(d)}};DvtMapAreaLayer.prototype.updateDataLayer=function(a){this._renderAllAreas();DvtMapAreaLayer.superclass.updateDataLayer.call(this,a)};DvtMapAreaLayer.prototype._renderAllAreas=function(){for(var a=0;a<this._doNotRenderList.length;a++)this._createAreaAndLabel(this._doNotRenderList[a])};
DvtMapAreaLayer.prototype._renderSelectedAreasAndLabels=function(a,b){for(var d=0;d<a.length;d++)-1==DvtArrayUtils.indexOf(this._doNotRenderList,a[d])&&this._createAreaAndLabel(a[d],b)};DvtMapAreaLayer.prototype.discloseAreas=function(a,b){this._renderSelectedAreasAndLabels(a,b);for(var d in this.DataLayers)this.DataLayers[d].discloseAreas(a,b);this._disclosed="single"==this._tmap.getDrillMode()?a:this._disclosed.concat(a)};
DvtMapAreaLayer.prototype.undiscloseAreas=function(a,b){for(var d=this._tmap.getDrillChildLayer(this._layerName),e=0;e<a.length;e++){var g=a[e];if(this.Areas[g]){var h=DvtArrayUtils.getIndex(this._disclosed,g);-1!==h&&this._disclosed.splice(h,1);b.push(this.Areas[g])}d&&d.undiscloseAreas(this.getChildrenForArea(g),b)}for(var k in this.DataLayers)this.DataLayers[k].undiscloseAreas(a,b)};
DvtMapAreaLayer.prototype.reset=function(a,b){DvtMapAreaLayer.superclass.reset.call(this,a,b);this.undiscloseAreas(this._disclosed,a);this._disclosed=[]};DvtMapAreaLayer.prototype.__getObjectUnderPoint=function(a,b){for(var d in this.Areas)if(this.Areas[d].contains(a,b))return this.Areas[d];return null};
DvtMapAreaLayer.prototype.__showDropSiteFeedback=function(a){this._dropSiteFeedback&&(this.AreaContainer.removeChild(this._dropSiteFeedback),this._dropSiteFeedback=null);if(a&&(this._dropSiteFeedback=a.getDropSiteFeedback()))this._dropSiteFeedback.setFill(this._dropSiteFill),this._dropSiteFeedback.setStroke(new DvtSolidStroke(this._dropSiteStrokeColor,1,1/this.PzcMatrix.getA())),this.AreaContainer.addChild(this._dropSiteFeedback);return this._dropSiteFeedback};
DvtMapAreaLayer.prototype.HandleZoomEvent=function(a){DvtMapAreaLayer.superclass.HandleZoomEvent.call(this,a);for(var b in this.Areas)this.Areas[b].HandleZoomEvent(a)};DvtMapAreaLayer.prototype.OnAnimationEnd=function(){DvtMapAreaLayer.superclass.OnAnimationEnd.call(this);for(var a=0;a<this._doNotRenderList.length;a++){this.AreaContainer.removeChild(this.Areas[this._doNotRenderList[a]]);var b=this._areaLabels[this._doNotRenderList[a]];b&&(this.LabelContainer.removeChild(b),this.LeaderLineContainer.removeChild(b.getLeaderLine()))}};
var DvtMapCustomAreaLayer=function(a,b,d,e,g,h,k){this.Init(a,b,d,e,g,h,k)};DvtObj.createSubclass(DvtMapCustomAreaLayer,DvtMapAreaLayer,"DvtMapCustomAreaLayer");DvtMapCustomAreaLayer.prototype.Init=function(a,b,d,e,g,h,k){DvtMapCustomAreaLayer.superclass.Init.call(this,a,b,d,e,g,h,k)};
DvtMapCustomAreaLayer.prototype._selectImageBasedOnResolution=function(){var a=this._tmap.GetWidth(),b=this._tmap.GetHeight(),d=this._areaLayerImages;for(i=0;i<d.length;i++){var e=d[i],g=e.source,h=e.width,e=e.height;if(g&&-1<g.search(".svg")||h>=a&&e>=b||i==d.length-1)return g}};
DvtMapCustomAreaLayer.prototype.setAreaLayerImage=function(a){var b=null,d=DvtStyleUtils.isLocaleR2L();if(a&&0<a.length){for(var b=a[0].width,e=a[0].height,g=[],h=0;h<a.length;h++)d&&"rtl"==a[h].dir?g.push(a[h]):!d&&"ltr"==a[h].dir&&g.push(a[h]);this._areaLayerImages=0<g.length?g:a;this._imageSrc=this._selectImageBasedOnResolution();b=new DvtImage(this._tmap.getContext(),this._imageSrc,0,0,b,e)}b&&this.setAreaShapes({image:b})};
DvtMapCustomAreaLayer.prototype.HandleZoomEvent=function(a){DvtMapCustomAreaLayer.superclass.HandleZoomEvent.call(this,a);this.Areas.image&&(a=this._selectImageBasedOnResolution(),a!=this._imageSrc&&(this._imageSrc=a,this.Areas[areaName].setSrc(this._imageSrc)))};var DvtMapDataLayer=function(a,b,d,e){this.Init(a,b,d,e)};DvtObj.createSubclass(DvtMapDataLayer,DvtObj,"DvtMapDataLayer");
DvtMapDataLayer.prototype.Init=function(a,b,d,e){this._tmap=a;this._clientId=d;this._areaObjs=[];this._dataObjs=[];this._eventHandler=e;this._dragSource=new DvtDragSource(a.getContext());this._eventHandler.setDragSource(this._dragSource);this._dataAreaLayer=new DvtContainer(this._tmap.getContext());this._dataPointLayer=new DvtContainer(this._tmap.getContext());this._dataLeaderLineLayer=new DvtContainer(this._tmap.getContext());this._dataLabelLayer=new DvtContainer(this._tmap.getContext());this._tmap.getDataAreaContainer().addChild(this._dataAreaLayer);
this._tmap.getDataPointContainer().addChild(this._dataPointLayer);this._tmap.getLabelContainer().addChild(this._dataLabelLayer);this._tmap.getHoverContainer().addChild(this._dataLeaderLineLayer);this._parentLayer=b;this._disclosed=[];this._drilled=[]};DvtMapDataLayer.prototype.getDragSource=function(){return this._dragSource};
DvtMapDataLayer.prototype.getContainers=function(){var a=[this._dataAreaLayer,this._dataPointLayer,this._dataLabelLayer,this._dataLeaderLineLayer];this._dataAreaSelectionLayer&&a.push(this._dataAreaSelectionLayer);return a};DvtMapDataLayer.prototype.getScaledContainers=function(){var a=[this._dataAreaLayer,this._dataLeaderLineLayer];this._dataAreaSelectionLayer&&a.push(this._dataAreaSelectionLayer);return a};DvtMapDataLayer.prototype.getNonScaledContainers=function(){return[this._dataPointLayer,this._dataLabelLayer]};
DvtMapDataLayer.prototype.getLeaderLineContainer=function(){return this._dataLeaderLineLayer};DvtMapDataLayer.prototype.getMapLayer=function(){return this._parentLayer};DvtMapDataLayer.prototype.getMap=function(){return this._tmap};DvtMapDataLayer.prototype.getAllObjects=function(){return this._dataObjs.concat(this._areaObjs)};DvtMapDataLayer.prototype.getAreaObjects=function(){return this._areaObjs};DvtMapDataLayer.prototype.getDataObjects=function(){return this._dataObjs};
DvtMapDataLayer.prototype.getNavigableAreaObjects=function(){for(var a=[],b=0;b<this._areaObjs.length;b++)this._areaObjs[b].isDrilled()||a.push(this._areaObjs[b]);return a};DvtMapDataLayer.prototype.getNavigableDisclosedAreaObjects=function(){for(var a=[],b=0;b<this._areaObjs.length;b++)for(var d=0;d<this._disclosed.length;d++)this._areaObjs[b].getAreaId()==this._disclosed[d]&&(this._areaObjs[b].isDrilled()||a.push(this._areaObjs[b]));return a};
DvtMapDataLayer.prototype.addDataObject=function(a){this._dataObjs.push(a);this._eventHandler.associate(a.getDisplayable(),a)};DvtMapDataLayer.prototype.addAreaObject=function(a){this._areaObjs.push(a);this._eventHandler.associate(a.getDisplayable(),a);a.setAreaLayer(this._dataAreaLayer);a.setSelectionLayer(this._dataAreaSelectionLayer);a.setHoverLayer(this._tmap.getHoverContainer())};DvtMapDataLayer.prototype.getClientId=function(){return this._clientId};
DvtMapDataLayer.prototype.setAnimation=function(a){this._animType=a};DvtMapDataLayer.prototype.getAnimation=function(){return this._animType};DvtMapDataLayer.prototype.setAnimationDuration=function(a){this._animDur=a};DvtMapDataLayer.prototype.getAnimationDuration=function(){return this._animDur};
DvtMapDataLayer.prototype.setSelectionMode=function(a){if(this._selectionMode=a)this._selectionHandler=new DvtSelectionHandler(this._selectionMode),this._eventHandler.setSelectionHandler(this._clientId,this._selectionHandler),this._dataAreaSelectionLayer=new DvtContainer(this._tmap.getContext()),this._tmap.getDataAreaSelectionContainer().addChild(this._dataAreaSelectionLayer)};DvtMapDataLayer.prototype.getSelectionMode=function(){return this._selectionMode};
DvtMapDataLayer.prototype.setIsolatedAreaRowKey=function(a){this._isolatedAreaRowKey=a};DvtMapDataLayer.prototype.getAreaSelectionLayer=function(){return this._dataAreaSelectionLayer};
DvtMapDataLayer.prototype._renderAreaAndLabel=function(a){var b=this._areaObjs[a].getDisplayable();this._dataAreaLayer.addChild(b);var d=this._areaObjs[a].getLabel();d&&!this._parentLayer.isDoNotRenderLabel(this._areaObjs[a].getAreaId())&&(this._dataLabelLayer.addChild(d),d.hasBounds()||(a=b.getDimensions(),d.addBounds(a)),d.update(this._pzcMatrix))};
DvtMapDataLayer.prototype.render=function(a){this._pzcMatrix=a;if(this._isolatedAreaRowKey)this._areaObjs[0]&&this._renderAreaAndLabel(0);else{for(a=0;a<this._areaObjs.length;a++)this._renderAreaAndLabel(a);for(a=0;a<this._dataObjs.length;a++){var b=this._dataObjs[a].getDisplayable();this._dataPointLayer.addChild(b);var d=this._dataObjs[a].getLabel();d&&(b.addChild(d),this._dataObjs[a].positionText())}}};
DvtMapDataLayer.prototype.discloseAreas=function(a,b){for(var d=[],e=0;e<a.length;e++)for(var g=0;g<this._areaObjs.length;g++)if(this._areaObjs[g].getAreaId()==a[e]){d.push(this._areaObjs[g].getAreaId());var h=this._areaObjs[g].getDisplayable();this._dataAreaLayer.addChild(h);b.push(h);if((h=this._areaObjs[g].getLabel())&&!this._parentLayer.isDoNotRenderLabel(this._areaObjs[g].getAreaId()))this._dataLabelLayer.addChild(h),h.update(this._pzcMatrix),b.push(h),b.push(h.getLeaderLine());break}for(g=0;g<
this._dataObjs.length;g++)for(e=0;e<a.length;e++){var k=this._dataObjs[g].getAreaId(),h=this._dataObjs[g].getDisplayable();null!=k?k==a[e]&&(this._dataPointLayer.addChild(h),b.push(h)):(this._dataPointLayer.addChild(h),b.push(h))}this._disclosed="single"==this._tmap.getDrillMode()?d:this._disclosed.concat(d)};
DvtMapDataLayer.prototype.undiscloseAreas=function(a,b){for(var d=0;d<a.length;d++)for(var e=0;e<this._areaObjs.length;e++)if(this._areaObjs[e].getAreaId()==a[d]){this._areaObjs[e].isDrilled()&&this._areaObjs[e].setDrilled(!1);this._areaObjs[e].isSelected()&&this._selectionHandler.removeFromSelection(this._areaObjs[e]);this._disclosed.splice(DvtArrayUtils.indexOf(this._disclosed,a[d]),1);b.push(this._areaObjs[e].getDisplayable());var g=this._areaObjs[e].getLabel();g&&!this._parentLayer.isDoNotRenderLabel(this._areaObjs[e].getAreaId())&&
(b.push(g),b.push(g.getLeaderLine()));break}};DvtMapDataLayer.prototype.drill=function(a,b){for(var d=0;d<this._areaObjs.length;d++)if(this._areaObjs[d].getAreaId()==a){this._areaObjs[d].setDrilled(!0);this._drilled.push(a);b.push(this._areaObjs[d].getDisplayable());if(d=this._areaObjs[d].getLabel())b.push(d),(d=d.getLeaderLine())&&b.push(d);break}for(d=0;d<this._dataObjs.length;d++)if(this._dataObjs[d].getAreaId()==a){b.push(this._dataObjs[d].getDisplayable());break}};
DvtMapDataLayer.prototype.undrill=function(a,b){for(var d=0;d<this._areaObjs.length;d++)if(this._areaObjs[d].getAreaId()==a){this._drilled.splice(DvtArrayUtils.indexOf(this._drilled,a),1);this._areaObjs[d].setDrilled(!1);var e=this._areaObjs[d].getDisplayable();this._dataAreaLayer.addChild(e);b.push(e);if(d=this._areaObjs[d].getLabel())this._dataLabelLayer.addChild(d),d.update(this._pzcMatrix),b.push(d),b.push(d.getLeaderLine());break}for(d=0;d<this._dataObjs.length;d++)if(this._dataObjs[d].getAreaId()==
a){e=this._dataObjs[d].getDisplayable();this._dataPointLayer.addChild(e);b.push(e);break}};
DvtMapDataLayer.prototype.reset=function(a,b){if(this._selectionHandler)for(var d=this._selectionHandler.getSelection(),e=0;e<d.length;e++)(!b||b&&-1==DvtArrayUtils.indexOf(b,d[e].getAreaId()))&&this._selectionHandler.removeFromSelection(d[e]);for(d=0;d<this._drilled.length;d++){for(e=0;e<this._areaObjs.length;e++)if(this._areaObjs[e].getAreaId()==this._drilled[d]){this._areaObjs[e].setDrilled(!1);var g=this._areaObjs[e].getDisplayable();this._dataAreaLayer.addChild(g);a.push(g);if(e=this._areaObjs[e].getLabel())this._dataLabelLayer.addChild(e),
e.update(this._pzcMatrix),a.push(e),a.push(e.getLeaderLine());break}for(e=0;e<this._dataObjs.length;e++)if(this._dataObjs[e].getAreaId()==this._drilled[d]){g=this._dataObjs[e].getDisplayable();this._dataPointLayer.addChild(g);a.push(g);break}}this._drilled=[]};
DvtMapDataLayer.prototype.HandleZoomEvent=function(a){this._pzcMatrix=a;zoom=a.getA();if(null==this._tmap.getPanZoomCanvas().getMinZoom()&&1!=zoom)for(var b=0;b<this._areaObjs.length;b++){var d=this._areaObjs[b].getDisplayable(),e=d.getSavedPatternFill();if(e){var g=new DvtPatternFill;e.mergeProps(g);g.setMatrix(new DvtMatrix(null,1/zoom,null,null,1/zoom));d.setFill(g)}}b=this.getAllObjects();for(d=0;d<b.length;d++)b[d].HandleZoomEvent(a);this._dataAreaSelectionLayer&&this._dataAreaSelectionLayer.setMatrix(a.clone())};
DvtMapDataLayer.prototype.HandlePanEvent=function(a){this._pzcMatrix=a;for(var b=this.getAllObjects(),d=0;d<b.length;d++)b[d].HandlePanEvent(a);this._dataAreaSelectionLayer&&this._dataAreaSelectionLayer.setMatrix(a.clone());this._initSelections&&this._processInitialSelections()};DvtMapDataLayer.prototype.setInitialSelections=function(a){this._initSelections=a};
DvtMapDataLayer.prototype._processInitialSelections=function(){this._selectionHandler&&(this._selectionHandler.processInitialSelections(this._initSelections,this.getAllObjects()),this._initSelections=null)};DvtMapDataLayer.prototype.__getDragTransferable=function(a){if(this._selectionHandler){a.isSelected()||(this._selectionHandler.processClick(a,!1),this._eventHandler.fireSelectionEvent(a));for(var a=[],b=this._selectionHandler.getSelection(),d=0;d<b.length;d++)a.push(b[d].getId());return a}return null};
DvtMapDataLayer.prototype.__getDragFeedback=function(){for(var a=[],b=this._selectionHandler.getSelection(),d=0;d<b.length;d++)a.push(b[d].getDisplayable());return a};DvtMapDataLayer.prototype.getSelectedAreas=function(a){selectedAreas=[];for(var b=this.getAreaObjects(),d=0;d<a.length;d++)for(var e=0;e<b.length;e++)if(b[e].getId()==a[d]){selectedAreas.push(b[e].getAreaId());break}return selectedAreas};var DvtThematicMapEventManager=function(a,b,d){this.Init(a,b,d)};
DvtObj.createSubclass(DvtThematicMapEventManager,DvtEventManager,"DvtThematicMapEventManager");DvtThematicMapEventManager.prototype.Init=function(a,b,d){DvtThematicMapEventManager.superclass.Init.call(this,a,b,d);this._selectionHandlers={};this._tmap=d};DvtThematicMapEventManager.prototype.getSelectionHandler=function(a){if(a&&a.getDataLayer)return this._selectionHandlers[a.getDataLayer().getClientId()]};
DvtThematicMapEventManager.prototype.setSelectionHandler=function(a,b){this._selectionHandlers[a]=b};DvtThematicMapEventManager.prototype.setDrillMode=function(a){this._drillMode=a};DvtThematicMapEventManager.prototype.setPanZoomCanvas=function(a){this._pzc=a};DvtThematicMapEventManager.prototype.removeFromSelection=function(a,b){var d=this._selectionHandlers[a];d&&d.removeFromSelection(b)};DvtThematicMapEventManager.prototype.clearSelection=function(a){(a=this._selectionHandlers[a])&&a.clearSelection()};
DvtThematicMapEventManager.prototype.setInitialFocus=function(a){a&&DvtThematicMapEventManager.superclass.setFocus.call(this,a)};DvtThematicMapEventManager.prototype.OnMouseOver=function(a){var b=this.GetLogicalObject(a.target);this.getSelectionHandler(b)||b&&b.showHoverEffect&&b.showHoverEffect();b&&b.getShowPopupBehaviors&&b.getDataLayer&&this._tmap.setEventClientId(b.getDataLayer().getClientId());DvtThematicMapEventManager.superclass.OnMouseOver.call(this,a)};
DvtThematicMapEventManager.prototype.OnMouseOut=function(a){var b=this.GetLogicalObject(a.target);this.getSelectionHandler(b)||b&&b.hideHoverEffect&&b.hideHoverEffect();DvtThematicMapEventManager.superclass.OnMouseOut.call(this,a)};
DvtThematicMapEventManager.prototype.OnClick=function(a){var b=this.GetLogicalObject(a.target);if(b)this._setClickInfo(a.target),DvtThematicMapEventManager.superclass.OnClick.call(this,a),this._handleClick(b);else for(var d in this._selectionHandlers)if(this._selectionHandlers[d].processClick(null,a.ctrlKey)){for(var b=this._selectionHandlers[d].getSelection(),e=[],g=0;g<b.length;g++)e.push(b[g].getId());this._callback.call(this._callbackObj,new DvtSelectionEvent(e))}};
DvtThematicMapEventManager.prototype._handleClick=function(a){if(a instanceof DvtMapDataObject){var b=a.getDestination();b?window.location.href=b:a.hasAction()?(b=new DvtMapActionEvent(a.getClientId(),a.getId(),a.getAction()),b.addParam("clientId",a.getDataLayer().getClientId()),this.hideTooltip(),this._callback.call(this._callbackObj,b)):a.getShowPopupBehaviors()&&this._tmap.setEventClientId(a.getDataLayer().getClientId())}};
DvtThematicMapEventManager.prototype._setClickInfo=function(a){var b=null,d=null,e=null,g=this.GetLogicalObject(a);if(g){if(g instanceof DvtMapDataArea||g instanceof DvtMapArea)e=a;g.getDataLayer&&(a=g.getDataLayer(),b=a.getClientId(),d=a.getMapLayer().getLayerName())}this._tmap.setClickInfo(b,d,e)};
DvtThematicMapEventManager.prototype.OnDblClick=function(a){DvtThematicMapEventManager.superclass.OnDblClick.call(this,a);this.getSelectionHandler(this.GetLogicalObject(a.target))&&this._drillMode&&"none"!=this._drillMode&&this._callback.call(this._callbackObj,new DvtMapDrillEvent(DvtMapDrillEvent.DRILL_DOWN))};DvtThematicMapEventManager.prototype.OnContextMenu=function(a){this._setClickInfo(a.target);DvtThematicMapEventManager.superclass.OnContextMenu.call(this,a)};
DvtThematicMapEventManager.prototype.GetContextMenuType=function(){return DvtContextMenuHandler.TYPE_CONTEXT_MENU};
DvtThematicMapEventManager.prototype.ProcessTouchContextMenu=function(a,b){this._setClickInfo(a.targetObj);var d=this.ContextMenuHandler.getMenuItems(b);if(d)for(var e=0;e<d.length;e++){var g=d[e],h=this.CustomTooltipManager.getActionTooltip();h.setTooltipBorderColor(DvtCustomTooltip.DEFAULT_BORDER_COLOR);var k=this.ContextMenuItemListener,g=new DvtContextMenuTooltipItem(this.getContext(),"item"+e,k,this,g);h.addMenuItem(g)}};
DvtThematicMapEventManager.prototype.ProcessKeyboardEvent=function(a){var b=!0,d=a.keyCode;(d==DvtKeyboardEvent.ZERO||d==DvtKeyboardEvent.NUMPAD_ZERO)&&a.ctrlKey&&a.shiftKey?(this._tmap.resetMap(),a.preventDefault()):d==DvtKeyboardEvent.BACK_SLASH?((d=this._tmap.getLegendPanel())&&d.setCollapse(!d.isCollapse()),a.preventDefault()):d==DvtKeyboardEvent.ENTER?(a.shiftKey?this._tmap.drillUp():this._tmap.drillDown(),a.preventDefault()):d==DvtKeyboardEvent.SPACE&&a.ctrlKey?(this.ProcessSelectionEventHelper(this.getFocus(),
!0),a.preventDefault()):(d==DvtKeyboardEvent.ZERO||d==DvtKeyboardEvent.NUMPAD_ZERO)&&a.ctrlKey?(d=this.getFocus(),a.altKey?this._tmap.fitRegion(d.getDisplayable()):this._tmap.fitRegion(d.getDataLayer().getAreaSelectionLayer()),a.preventDefault()):b=DvtThematicMapEventManager.superclass.ProcessKeyboardEvent.call(this,a);return b};
DvtThematicMapEventManager.prototype.OnTouchClick=function(a){var b=this.GetLogicalObject(a.targetObj);if(!b||b.isClearSelection)for(var d in this._selectionHandlers){if(this._selectionHandlers[d].processClick(null,a.ctrlKey)){for(var b=this._selectionHandlers[d].getSelection(),e=[],g=0;g<b.length;g++)e.push(b[g].getId());this._callback.call(this._callbackObj,new DvtSelectionEvent(e))}}else this._setClickInfo(a.targetObj),DvtThematicMapEventManager.superclass.OnTouchClick.call(this,a),this._handleClick(b)};
DvtThematicMapEventManager.prototype.HandleTouchHoverOverInternal=function(a){a=this.GetLogicalObject(a.targetObj);this.getSelectionHandler(a)||a&&a.showHoverEffect&&a.showHoverEffect();a&&a.getShowPopupBehaviors&&a.getDataLayer&&this._tmap.setEventClientId(a.getDataLayer().getClientId())};DvtThematicMapEventManager.prototype.HandleTouchHoverOutInternal=function(a){var b=this.GetLogicalObject(a.targetObj);this.getSelectionHandler(b)||b&&b.hideHoverEffect&&b.hideHoverEffect();this._setClickInfo(a.targetObj)};
DvtThematicMapEventManager.prototype.HandleTouchHoverEndInternal=function(a){a=this.GetLogicalObject(a.targetObj);this.getSelectionHandler(a)||a&&a.hideHoverEffect&&a.hideHoverEffect()};DvtThematicMapEventManager.prototype.OnTouchDblClick=function(a){var b=this.GetLogicalObject(a.targetObj);b&&this.getSelectionHandler(b)&&this._drillMode&&"none"!=this._drillMode&&(this.ProcessSelectionEventHelper(b,a.ctrlKey),this._callback.call(this._callbackObj,new DvtMapDrillEvent(DvtMapDrillEvent.DRILL_DOWN)))};
var DvtThematicMapParser=function(a){this.Init(a)};DvtObj.createSubclass(DvtThematicMapParser,DvtObj,"DvtThematicMapParser");DvtThematicMapParser._ELEM_MAP_PROPERTIES="mapProperties";DvtThematicMapParser._ELEM_LAYERS="layers";DvtThematicMapParser._ELEM_LAYER="layer";DvtThematicMapParser._ELEM_POINTS="points";DvtThematicMapParser._ELEM_POINT="point";DvtThematicMapParser._ELEM_LEGEND="legend";DvtThematicMapParser._ELEM_RESOURCES="resources";DvtThematicMapParser._ELEM_MAP_HIERARCHY="mapHierarchy";
DvtThematicMapParser._ELEM_MENUS="menus";DvtThematicMapParser.ELEM_COLOR_STYLES="colorStyles";DvtThematicMapParser.ELEM_GRADUATED_SYMBOL="graduatedSymbol";DvtThematicMapParser.ELEM_IMAGE="image";DvtThematicMapParser._ELEM_MARKER_DEF="markerDef";DvtThematicMapParser._ELEM_ROW="row";DvtThematicMapParser._ELEM_CUSTOM_LAYER="customLayer";DvtThematicMapParser._ELEM_AREA_LAYER="areaLayer";DvtThematicMapParser._ELEM_POINT_LAYER="pointLayer";DvtThematicMapParser._ELEM_SPB="spb";
DvtThematicMapParser._ELEM_CUSTOM_REGION="customRegion";DvtThematicMapParser._ELEM_P="p";DvtThematicMapParser._ELEM_STYLES="styles";DvtThematicMapParser._ELEM_REGION_LAYER="regionLayer";DvtThematicMapParser._ELEM_MARKER_STYLE="markerStyle";DvtThematicMapParser._ELEM_TMAP_RESOURCES="tmapResources";DvtThematicMapParser._ATTR_ANIM_DATA_CHANGE="animationDataChange";DvtThematicMapParser._ATTR_ANIM_ON_LAYER_CHANGE="animationOnLayerChange";DvtThematicMapParser.ATTR_ID="id";
DvtThematicMapParser._ATTR_CLIENT_ID="clientId";DvtThematicMapParser._ATTR_SELECTION_MODE="selectionMode";DvtThematicMapParser._ATTR_STYLE_ID="styleId";DvtThematicMapParser._ATTR_LAYER_NAME="layerName";DvtThematicMapParser._ATTR_LABEL="label";DvtThematicMapParser._ATTR_LABEL_DISPLAY="labelDisplay";DvtThematicMapParser._ATTR_LABEL_TYPE="labelType";DvtThematicMapParser._ATTR_LABEL_POSITION="labelPosition";DvtThematicMapParser._ATTR_ROW_KEY="rowKey";DvtThematicMapParser._ATTR_GROUP_ID="groupID";
DvtThematicMapParser._ATTR_SHORT_NAME="shortName";DvtThematicMapParser._ATTR_LONG_NAME="longName";DvtThematicMapParser._ATTR_PATH="d";DvtThematicMapParser._ATTR_ALIGN_ID="alignId";DvtThematicMapParser._ATTR_SHOW_WITH="showWith";DvtThematicMapParser._ATTR_SUB_REGIONS="subRegions";DvtThematicMapParser._ATTR_INLINE_STYLE="inlineStyle";DvtThematicMapParser._ATTR_HOVER_STYLE="hoverStyle";DvtThematicMapParser._ATTR_SELECT_STYLE="selectStyle";DvtThematicMapParser._ATTR_LABEL_STYLE="labelStyle";
DvtThematicMapParser._ATTR_BASEMAP_NAME="baseMapName";DvtThematicMapParser._ATTR_ANIM_ON_DISP="animationOnDisplay";DvtThematicMapParser._ATTR_ANIM_ON_MAP_CHANGE="animationOnMapChange";DvtThematicMapParser._ATTR_ANIM_DUR="animationDuration";DvtThematicMapParser._ATTR_ANIM_ON_MAP_CHANGE="animationOnMapChange";DvtThematicMapParser._ATTR_ANIM_ON_DRILL="animationOnDrill";DvtThematicMapParser._ATTR_DRILL_ZOOM_TO_FIT="drillZoomToFit";DvtThematicMapParser._ATTR_DRILL_MODE="drillMode";
DvtThematicMapParser._ATTR_INITIAL_ZOOMING="initialZooming";DvtThematicMapParser._ATTR_CTRLPANEL_BEHAVIOR="controlPanelBehavior";DvtThematicMapParser._ATTR_TOOLTIP_DISPLAY="displayTooltips";DvtThematicMapParser._ATTR_FEATURES_OFF="featuresOff";DvtThematicMapParser._ATTR_LOCALE_L2R="localeL2R";DvtThematicMapParser._ATTR_CENTER_X="centerX";DvtThematicMapParser._ATTR_CENTER_Y="centerY";DvtThematicMapParser._ATTR_CUR_ZOOM="curZoom";DvtThematicMapParser._ATTR_INLINE_STYLE="inlineStyle";
DvtThematicMapParser._ATTR_ISOLATED_ROW_KEY="isolatedRowKey";DvtThematicMapParser._ATTR_SOURCE="source";DvtThematicMapParser._ATTR_ZOOMING="zooming";DvtThematicMapParser._ATTR_PANNING="panning";DvtThematicMapParser._SEMICOLON=";";DvtThematicMapParser.prototype.Init=function(a){this._tmap=a;this._customLayerNames=[];this._customMarkerDefs={};this._markerStyle=this._areaLayerStyle=null};
DvtThematicMapParser.prototype.loadXmlInitial=function(a){for(var a=a.getChildNodes(),b,d,e=0;e<a.length;e++)b=a[e],d=b.getName(),d==DvtThematicMapParser._ELEM_MAP_PROPERTIES?this.ParseMapProperties(b):d==DvtThematicMapParser._ELEM_CUSTOM_LAYER?this.ParseCustomRegionLayer(b):d==DvtThematicMapParser._ELEM_LAYERS?this.ParseDataLayers(b,!1):d==DvtThematicMapParser._ELEM_LEGEND?this.ParseLegend(b):"basemap"==d&&this._tmap.getMapName()==b.getAttribute(DvtThematicMapParser.ATTR_ID)&&this.ParseCustomBasemap(b)};
DvtThematicMapParser.prototype.ParseMapProperties=function(a){this._setMapProps(a);for(var a=a.getChildNodes(),b,d,e=0;e<a.length;e++)if(b=a[e],d=b.getName(),d==DvtThematicMapParser._ELEM_RESOURCES)this.ParseResources(b);else if(d==DvtThematicMapParser._ELEM_MAP_HIERARCHY)this.ParseMapHierarchy(b);else if(d==DvtThematicMapParser._ELEM_MENUS)this.ParseMenus(b);else if(d==DvtThematicMapParser._ELEM_TMAP_RESOURCES)this.ParseMenuResources(b);else if("panZoomCanvasProperties"==d)this.ParsePanZoomResources(b);
else if(d==DvtThematicMapParser._ELEM_REGION_LAYER){if(d=b.getAttribute(DvtThematicMapParser._ATTR_INLINE_STYLE))this._areaLayerStyle=new DvtCSSStyle(d);if(d=b.getAttribute(DvtThematicMapParser._ATTR_HOVER_STYLE))this._areaHoverStyle=new DvtCSSStyle(d);if(d=b.getAttribute(DvtThematicMapParser._ATTR_SELECT_STYLE))this._areaSelectStyle=new DvtCSSStyle(d)}else d==DvtThematicMapParser._ELEM_MARKER_STYLE&&(this._markerStyle=new DvtCSSStyle(b.getAttribute(DvtThematicMapParser._ATTR_INLINE_STYLE)))};
DvtThematicMapParser.prototype.ParseDataLayers=function(a,b){var d=a.getElementsByTagName(DvtThematicMapParser._ELEM_LAYER),e=a.getElementsByTagName(DvtThematicMapParser._ELEM_LEGEND);b&&e&&e[0]&&this.ParseLegend(e[0]);for(e=0;e<d.length;e++){var g=d[e].getAttribute(DvtThematicMapParser._ATTR_CLIENT_ID),h=d[e].getAttribute(DvtThematicMapParser.ATTR_ID),k=this._tmap.getLayer(h);k||((k=d[e].getAttribute(DvtThematicMapParser._ATTR_SHOW_WITH))?k=this._tmap.getLayer(k):(k=new DvtMapLayer(this._tmap,this._tmap.getMapName(),
h,DvtMapLayer.POINT,this._tmap.getEventHandler()),this._tmap.addPointLayer(k)));g=new DvtMapDataLayer(this._tmap,k,g,this._tmap.getEventHandler());h=d[e].getAttribute(DvtThematicMapParser._ATTR_SELECTION_MODE);"single"==h?g.setSelectionMode(DvtSelectionHandler.TYPE_SINGLE):"multiple"==h&&g.setSelectionMode(DvtSelectionHandler.TYPE_MULTIPLE);if(h=d[e].getAttribute(DvtThematicMapParser._ATTR_ANIM_DATA_CHANGE)){var m=d[e].getAttribute(DvtThematicMapParser._ATTR_ANIM_DUR);m&&(m=parseFloat(m));if(!m||
isNaN(m))m=1;g.setAnimation(h);g.setAnimationDuration(m)}h=null;k instanceof DvtMapAreaLayer&&(h=d[e].getAttribute(DvtThematicMapParser._ATTR_ISOLATED_ROW_KEY));for(var m=[],n=[],o=this._parseStyles(d[e].getElementsByTagName(DvtThematicMapParser._ELEM_STYLES)),q=d[e].getElementsByTagName(DvtThematicMapParser._ELEM_ROW),s=this._parseShowPopupBehavior(d[e],o),t=0;t<q.length;t++){var u=q[t].getAttribute(DvtThematicMapParser._ATTR_STYLE_ID);if(u=this._parseDataObject(k,g,q[t],u,o[u],m,n,h))g.getSelectionMode()&&
u.getDisplayable().setSelectable(!0),s&&u.setShowPopupBehaviors(s),u instanceof DvtMapDataArea?g.addAreaObject(u):g.addDataObject(u)}h&&this._isolatedArea&&(g.setIsolatedAreaRowKey(h),k.setIsolatedArea(this._isolatedArea));g.getSelectionMode()&&0<m.length&&g.setInitialSelections(m);0<n.length&&this._tmap.addDrilledLayer(k.getLayerName(),[g.getClientId(),n]);b||k.getDataLayer(g.getClientId())?k.updateDataLayer(g):k.addDataLayer(g)}};
DvtThematicMapParser.prototype.ParseLegend=function(a){var b="true"==a.getAttribute("disclosed"),d="fixed"==a.getAttribute("display"),e=a.getAttribute("maxWidth"),g=a.getAttribute("expandTooltip"),h=a.getAttribute("collapseTooltip"),k=DvtAgent.getAgent().isRightToLeft()?DvtCollapsiblePanel.COLLAPSE_NORTHWEST:DvtCollapsiblePanel.COLLAPSE_NORTHEAST,m=e.indexOf("%"),e=-1!=m?parseFloat(e.substring(0,m))/100*this._tmap.GetWidth():parseFloat(e),m=this._tmap.GetHeight()-2*DvtThematicMap._COLLAPSIBLE_PANEL_OFFSET,
b=new DvtCollapsiblePanel(this._tmap.getContext(),e,m,k,this._tmap.getLegendButtonImages(),null,b,d);b.addEventListener(DvtCollapsiblePanelEvent.TYPE,this._tmap.HandleCollapsiblePanelEvent,!1,this._tmap);b.addEventListener(DvtResizeEvent.RESIZE_EVENT,this._tmap.HandleLegendResize,!1,this._tmap);b.setButtonTooltips(g,h);g=new DvtCommonLegend(this._tmap.getContext(),b.getMaxContentWidth(),b.getMaxContentHeight());g.setXML(a);this._tmap.setLegend(g,b)};DvtThematicMapParser.prototype.ParseResources=function(a){this._tmap.setButtonImages(a)};
DvtThematicMapParser.prototype.ParseMapHierarchy=function(a){for(var a=a.getAllChildNodes(),b=this._tmap.getMapName(),d,e,g,h,k=0;k<a.length;k++){var m=a[k];d=m.getName();if(d==DvtThematicMapParser._ELEM_CUSTOM_LAYER)d=m.getAttribute(DvtThematicMapParser.ATTR_ID),this._customLayerNames.push(d);else if(d!=DvtThematicMapParser._ELEM_POINT_LAYER){d=m.getAttribute(DvtThematicMapParser._ATTR_LAYER_NAME);e=m.getAttribute(DvtThematicMapParser._ATTR_LABEL_DISPLAY);g=m.getAttribute(DvtThematicMapParser._ATTR_CLIENT_ID);
h=m.getAttribute(DvtThematicMapParser._ATTR_LABEL_TYPE);this._isCustomBasemap?e=new DvtMapCustomAreaLayer(this._tmap,b,d,g,e,h,this._tmap.getEventHandler()):(e=new DvtMapAreaLayer(this._tmap,b,d,g,e,h,this._tmap.getEventHandler()),-1==DvtArrayUtils.indexOf(this._customLayerNames,d)&&(e.setAreaNames(DvtBaseMapManager.getAreaNames(b,d)),e.setAreaShapes(this._createPathShapes(DvtBaseMapManager.getAreaPaths(b,d))),e.setAreaLabelInfo(DvtBaseMapManager.getAreaLabelInfo(b,d)),e.setAreaChildren(DvtBaseMapManager.getChildrenForLayerAreas(this._tmap.getMapName(),
d))));(d=m.getAttribute(DvtThematicMapParser._ATTR_LABEL_STYLE))?e.setLayerCSSStyle(new DvtCSSStyle(d)):this._areaLayerStyle&&e.setLayerCSSStyle(this._areaLayerStyle);if(d=m.getAttribute(DvtThematicMapParser._ATTR_ANIM_ON_LAYER_CHANGE)){(m=m.getAttribute(DvtThematicMapParser._ATTR_ANIM_DUR))&&(m=parseFloat(m));if(!m||isNaN(m))m=1;e.setAnimation(d);e.setAnimationDuration(m)}e&&this._tmap.addLayer(e)}}};
DvtThematicMapParser.prototype.ParseCustomRegionLayer=function(a){for(var b=a.getAllChildNodes(),d=a.getAttribute(DvtThematicMapParser.ATTR_ID),a={},e={},g={},h=0;h<b.length;h++){var k=b[h].getElementsByTagName(DvtThematicMapParser._ELEM_P)[0],m=b[h].getAttribute(DvtThematicMapParser._ATTR_SUB_REGIONS),n=k.getAttribute(DvtThematicMapParser._ATTR_GROUP_ID);g[n]=m;e[n]=k.getAttribute(DvtThematicMapParser._ATTR_PATH);a[n]=[];a[n][0]=k.getAttribute(DvtThematicMapParser._ATTR_SHORT_NAME);a[n][1]=k.getAttribute(DvtThematicMapParser._ATTR_LONG_NAME)}b=
this._tmap.getLayer(d);b.setAreaNames(a);b.setAreaShapes(this._createPathShapes(e));b.setAreaChildren(g);(k=k.getAttribute(DvtThematicMapParser._ATTR_LABEL_STYLE))?b.setLayerCSSStyle(new DvtCSSStyle(k)):this._areaLayerStyle&&b.setLayerCSSStyle(this._areaLayerStyle)};
DvtThematicMapParser.prototype.ParseCustomBasemap=function(a){for(var a=a.getAllChildNodes(),b,d,e=0;e<a.length;e++)b=a[e],d=b.getName(),d==DvtThematicMapParser._ELEM_LAYER?this._parseCustomLayer(b):d==DvtThematicMapParser._ELEM_POINTS&&this._parseCustomPoints(b)};
DvtThematicMapParser.prototype._parseCustomLayer=function(a){for(var b=a.getAllChildNodes(),a=a.getAttribute(DvtThematicMapParser.ATTR_ID),d,e,g=[],h=0;h<b.length;h++)if(d=b[h],e=d.getName(),e==DvtThematicMapParser.ELEM_IMAGE){e={};e.source=d.getAttribute("source");e.width=d.getAttribute("width");e.height=d.getAttribute("height");var k=d.getAttribute("bidi");d=d.getAttribute("dir");e.dir="true"==k||"rtl"==d?"rtl":"ltr";g.push(e)}this._tmap.getLayer(a).setAreaLayerImage(g)};
DvtThematicMapParser.prototype._parseCustomPoints=function(a){for(var a=a.getAllChildNodes(),b,d,e={},g={},h=0;h<a.length;h++)b=a[h],d=b.getName(),d==DvtThematicMapParser._ELEM_POINT&&(e[b.getAttribute("name")]=[b.getAttribute("x"),b.getAttribute("y")],g[b.getAttribute("name")]=[b.getAttribute("shortLabel"),b.getAttribute("longLabel")]);DvtBaseMapManager.registerBaseMapLayer(this._tmap.getMapName(),"cities",g,e,null,null,1)};DvtThematicMapParser.prototype.ParseMenus=function(a){this._tmap.setMenuNode(a)};
DvtThematicMapParser.prototype.ParseMenuResources=function(a){this._tmap.setMenuResources(a)};DvtThematicMapParser.prototype.ParsePanZoomResources=function(a){this._tmap.setPanZoomResources(a)};DvtThematicMapParser.prototype._createPathShapes=function(a){var b={},d=this._tmap.getContext(),e;for(e in a)b[e]=new DvtPath(d,a[e]),this._parseDataObjectFill(DvtThematicMapParser.ELEM_COLOR_STYLES,this._areaLayerStyle,b[e]);return b};
DvtThematicMapParser.prototype._setMapProps=function(a){var b;(b=a.getAttribute(DvtThematicMapParser._ATTR_BASEMAP_NAME))&&this._tmap.setMapName(b);if(b=a.getAttribute(DvtThematicMapParser._ATTR_SOURCE))this._isCustomBasemap=!0;(b=a.getAttribute(DvtThematicMapParser._ATTR_ANIM_ON_DISP))&&this._tmap.setAnimationOnDisplay(b);(b=a.getAttribute(DvtThematicMapParser._ATTR_ANIM_ON_MAP_CHANGE))&&this._tmap.setAnimationOnMapChange(b);(b=a.getAttribute(DvtThematicMapParser._ATTR_ANIM_DUR))&&this._tmap.setAnimationDuration(b);
(b=a.getAttribute(DvtThematicMapParser._ATTR_TOOLTIP_DISPLAY))&&this._tmap.setDisplayTooltips(b);(b=a.getAttribute(DvtThematicMapParser._ATTR_INLINE_STYLE))&&this._tmap.setBackgroundStyle(b);(b=a.getAttribute(DvtThematicMapParser._ATTR_CTRLPANEL_BEHAVIOR))&&this._tmap.setControlPanelBehavior(b);(b=a.getAttribute(DvtThematicMapParser._ATTR_FEATURES_OFF))&&this._tmap.setFeaturesOff(b);(b=a.getAttribute(DvtThematicMapParser._ATTR_LOCALE_L2R))&&this._tmap.setBiDi(b);(b=a.getAttribute(DvtThematicMapParser._ATTR_CENTER_X))&&
this._tmap.setInitialCenterX(b);(b=a.getAttribute(DvtThematicMapParser._ATTR_CENTER_Y))&&this._tmap.setInitialCenterY(b);(b=a.getAttribute(DvtThematicMapParser._ATTR_CUR_ZOOM))&&this._tmap.setInitialZoom(b);(b=a.getAttribute(DvtThematicMapParser._ATTR_ANIM_ON_DRILL))&&this._tmap.setAnimationOnDrill(b);(b=a.getAttribute(DvtThematicMapParser._ATTR_DRILL_MODE))&&this._tmap.setDrillMode(b);(b=a.getAttribute(DvtThematicMapParser._ATTR_DRILL_ZOOM_TO_FIT))&&this._tmap.setDrillZoomToFit(b);b=a.getAttribute(DvtThematicMapParser._ATTR_INITIAL_ZOOMING);
"auto"==b&&this._tmap.setInitialZooming(!0);b=a.getAttribute(DvtThematicMapParser._ATTR_ZOOMING);"none"==b&&this._tmap.setZooming(!1);b=a.getAttribute(DvtThematicMapParser._ATTR_PANNING);"none"==b&&this._tmap.setPanning(!1)};DvtThematicMapParser.prototype._parseStyles=function(a){var b={};if(a&&0<a.length)for(var a=a[0].getAllChildNodes(),d=0;d<a.length;d++){var e=a[d].getAttribute(DvtThematicMapParser.ATTR_ID);b[e]=a[d]}return b};
DvtThematicMapParser.prototype._parseShowPopupBehavior=function(a,b){for(var d=a.getElementsByTagName(DvtThematicMapParser._ELEM_SPB),e=[],g=0;g<d.length;g++){var h=d[g].getAttribute(DvtThematicMapParser._ATTR_ALIGN_ID),k=DvtShowPopupBehavior.newInstance(d[g]),m;for(m in b)if(h==m){k=new DvtShowPopupBehavior(k.getPopupId(),k.getTriggerType(),null,k.getAlign());break}e.push(k)}return e};
DvtThematicMapParser.prototype._parseDataObject=function(a,b,d,e,g,h,k,m){var n=this._tmap.getContext(),o=d.getAttribute(DvtThematicMapParser._ATTR_ROW_KEY),q=d.getAttribute(DvtThematicMapParser._ATTR_CLIENT_ID),s=d.getAttribute(DvtThematicMapParser.ATTR_ID),t=a.getLayerName(),u,v=g.getName();if(v==DvtThematicMapParser.ELEM_COLOR_STYLES){if(m){if(m!=o)return null;this._isolatedArea=s}a.doNotRenderArea(s);u=new DvtMapDataArea(n,b,o,q,s,this._areaHoverStyle,this._areaSelectStyle);this._parseMapArea(n,
s,a,d,u)}else v==DvtThematicMapParser.ELEM_GRADUATED_SYMBOL?(u=new DvtMapDataMarker(n,b,o,q,s),this._parseMapMarker(n,g,t,d,u)):v==DvtThematicMapParser.ELEM_IMAGE&&(u=new DvtMapDataImage(n,b,o,q,s),this._parseMapImage(n,t,d,u));if(!u.getDisplayable())return null;g="true"==d.getAttribute("hasAction");u.setHasAction(g);g&&u.setAction(d.getAttribute("action"));(g=d.getAttribute(e+"_destination"))&&u.setDestination(g);"true"==d.getAttribute("selected")&&h.push(o);"true"==d.getAttribute("drilled")&&(k.push(d.getAttribute(DvtThematicMapParser.ATTR_ID)),
this._tmap.addDisclosedRowKey(o));var w;"on"==d.getAttribute(e+"_"+DvtThematicMapParser._ATTR_LABEL_DISPLAY)&&(w=d.getAttribute(e+"_"+DvtThematicMapParser._ATTR_LABEL));!w&&v==DvtThematicMapParser.ELEM_COLOR_STYLES&&"off"!=a.displayLabels()&&(w="long"==a.getLabelType()?a.getLongAreaName(s):a.getShortAreaName(s));if(w){var x;a.getLabelInfoForArea&&(x=a.getLabelInfoForArea(s));var y;y=x?new DvtMapLabel(n,w,x,b.getLeaderLineContainer()):v!=DvtThematicMapParser.ELEM_COLOR_STYLES?new DvtText(n,w,0,0):
new DvtMapLabel(n,w,null,b.getLeaderLineContainer());(b=d.getAttribute(e+"_"+DvtThematicMapParser._ATTR_LABEL_POSITION))&&u.setLabelPosition(b);(b=d.getAttribute(e+"_"+DvtThematicMapParser._ATTR_LABEL_STYLE))?y.setCSSStyle(new DvtCSSStyle(b)):a.getLayerCSSStyle&&a.getLayerCSSStyle()&&y.setCSSStyle(a.getLayerCSSStyle())}u.setLabel(y);a=this._tmap.getDisplayTooltips();if("none"!=a){d=d.getAttribute(e+"_shortDesc");if("auto"==a){var z;s&&(z="cities"==t||this._isCustomBasemap?DvtBaseMapManager.getCityLabel(this._tmap.getMapName(),
s):DvtBaseMapManager.getLongAreaLabel(this._tmap.getMapName(),t,s));z&&(d=d?z+": "+d:z)}d&&u.setDatatip(d)}return u};DvtThematicMapParser.prototype._parseCenterAndDatatip=function(a,b){var d=this._tmap.getMapName(),e=b.getAttribute(DvtThematicMapParser.ATTR_ID);if(e){var g=DvtBaseMapManager.getCityCoordinates(d,e);return g?g:DvtBaseMapManager.getAreaCenter(d,a,e)}d=parseFloat(b.getAttribute("x"));e=parseFloat(b.getAttribute("y"));return new DvtPoint(d,e)};
DvtThematicMapParser.prototype._parseMapImage=function(a,b,d,e){var g=d.getAttribute(DvtThematicMapParser._ATTR_STYLE_ID),h=d.getAttribute(g+"_url"),k=null;if(b=this._parseCenterAndDatatip(b,d)){var k=new DvtImage(a,h),m,n;if(d=d.getAttribute(g+"_"+DvtThematicMapParser._ATTR_INLINE_STYLE))n=new DvtCSSStyle(d),(m=n.width)&&k.setWidth(n.width),(n=n.height)&&k.setHeight(n);(!m||!n)&&DvtImageLoader.loadImage(a,h,DvtObj.createCallback(e,e.onImageLoaded));e.setCenter(b);e.setDisplayable(k)}};
DvtThematicMapParser.prototype._parseMapArea=function(a,b,d,e,g){if(d=d.getAreaShape(b)){var h=e.getAttribute(DvtThematicMapParser._ATTR_STYLE_ID),e=new DvtCSSStyle(e.getAttribute(h+"_"+DvtThematicMapParser._ATTR_INLINE_STYLE)),a=new DvtMapArea(a,d,b);g.setDisplayable(a);this._parseDataObjectFill(DvtThematicMapParser.ELEM_COLOR_STYLES,e,a,g)}};
DvtThematicMapParser.prototype._parseMapMarker=function(a,b,d,e,g){var h=null,k=e.getAttribute(DvtThematicMapParser._ATTR_STYLE_ID),m=this._parseCenterAndDatatip(d,e);if(m){if(h=e.getAttribute(DvtThematicMapParser._ATTR_SOURCE))h=[h,e.getAttribute("sourceSelected"),e.getAttribute("sourceHover"),e.getAttribute("sourceHoverSelected")];else{var n=e.getAttribute(k+"_shapeType");n||(n=DvtMapDataMarker.DEFAULT_MARKER_SHAPE);h=DvtMarker.convertShapeString(n);if(h==DvtMarker.NONE)for(var h=n,b=b.getElementsByTagName(DvtThematicMapParser._ELEM_MARKER_DEF),
o=0;o<b.length;o++)!this._customMarkerDefs[n]&&b[o].getAttribute(DvtThematicMapParser.ATTR_ID)==n&&(this._customMarkerDefs[n]=DvtMarkerUtils.createMarkerDef(a,b[o]))}var b=e.getAttribute(k+"_scaleX"),b=isNaN(b)?DvtMapDataMarker.DEFAULT_MARKER_SCALE:parseFloat(b),n=e.getAttribute(k+"_scaleY"),n=isNaN(n)?DvtMapDataMarker.DEFAULT_MARKER_SCALE:parseFloat(n),o=e.getAttribute("width"),q=e.getAttribute("height"),o=!o||isNaN(o)?DvtMapDataMarker.DEFAULT_MARKER_SIZE:parseInt(o),q=!q||isNaN(q)?DvtMapDataMarker.DEFAULT_MARKER_SIZE:
parseInt(q),h=new DvtMarker(a,h,m.x-o*b/2,m.y-q*n/2,o,q,null,b,n);g.setCenter(m);g.setDisplayable(h);if(a=e.getAttribute(k+"_"+DvtThematicMapParser._ATTR_INLINE_STYLE))a=new DvtCSSStyle(a),this._parseDataObjectFill(DvtThematicMapParser.ELEM_GRADUATED_SYMBOL,a,h,g);d=this._tmap.getLayer(d);d.displayLabels&&"auto"==d.displayLabels()&&d.doNotRenderLabel(e.getAttribute(DvtThematicMapParser.ATTR_ID))}};
DvtThematicMapParser.prototype._parseDataObjectFill=function(a,b,d,e){b||(b={});var g=b.pattern,h=b["pattern-color"],k=b["background-color"],m=b.gradient;k&&e?e.addCategory(k):h&&e&&e.addCategory(h);var n;n=b.opacity?parseFloat(b.opacity):a==DvtThematicMapParser.ELEM_GRADUATED_SYMBOL?DvtMapDataMarker.DEFAULT_MARKER_ALPHA:1;e&&e.setDatatipColor(k?k:h);a==DvtThematicMapParser.ELEM_GRADUATED_SYMBOL&&DvtMarker.isBuiltInShape(d.getType())?(d.setStroke(new DvtSolidStroke(DvtMapDataMarker.DEFAULT_MARKER_STROKE_COLOR,
DvtMapDataMarker.DEFAULT_MARKER_ALPHA,DvtMapDataMarker.DEFAULT_MARKER_STROKE_WIDTH)),"true"==m&&k?d.setFill(new DvtMarkerGradient.createMarkerGradient(k,d,n)):g?d.setFill(new DvtPatternFill(g,h,k)):k?d.setFill(new DvtSolidFill(k,n)):d.setFill(new DvtSolidFill(DvtMapDataMarker.DEFAULT_MARKER_COLOR,n))):a==DvtThematicMapParser.ELEM_COLOR_STYLES&&(a=b["border-color"]?b["border-color"]:DvtMapArea._DEFAULT_STROKE_COLOR,b=b["border-width"]?parseFloat(b["border-width"].substring(0,b["border-width"].indexOf("px"))):
DvtMapArea._DEFAULT_STROKE_WIDTH,d.setStroke(new DvtSolidStroke(a,DvtMapArea._DEFAULT_STROKE_ALPHA,b)),g?d.savePatternFill(new DvtPatternFill(g,h,k)):k?d.setFill(new DvtSolidFill(k,n)):d.setFill(new DvtSolidFill(DvtMapArea._DEFAULT_FILL_COLOR,n)))};var DvtThematicMapJsonToXmlConverter={};DvtObj.createSubclass(DvtThematicMapJsonToXmlConverter,DvtObj,"DvtThematicMapJsonToXmlConverter");
DvtThematicMapJsonToXmlConverter.convertJsonToXml=function(a,b,d){var e;e="<md>"+this.getMapPropertiesElement(b,d);e+=this.getCustomBasemapMetadata(b);e+=this.getLayers(a,b,d);return e+"</md>"};
DvtThematicMapJsonToXmlConverter.getMapPropertiesElement=function(a,b){var d;d="<mapProperties "+this.getMapPropertiesAttributes(a);d+="<regionLayer ";a.areaLayerStyle&&(d+='inlineStyle="'+a.areaLayerStyle+'" ');a.hoverStyle&&(d+='hoverStyle="'+a.hoverStyle+'" ');a.selectStyle&&(d+='selectStyle="'+a.selectStyle+'" ');d=d+"/>"+('<markerStyle inlineStyle="'+a.markerStyle.textStyle+'"/>');d+=this.getMapHierarchyElement(a,b);return d+"</mapProperties>"};
DvtThematicMapJsonToXmlConverter.getMapPropertiesAttributes=function(a){var b="";a.animationDuration&&(b=b+'animationDuration="'+a.animationDuration/1E3+'"');a.animationOnDisplay&&(b=b+' animationOnDisplay="'+a.animationOnDisplay+'"');a.animationOnMapChange&&(b=b+' animationOnMapChange="'+a.animationOnMapChange+'"');a.basemap&&(b=b+' baseMapName="'+a.basemap+'"');a.source&&(b=b+' source="'+a.source+'"');a.tooltipDisplay&&(b=b+' displayTooltips="'+a.tooltipDisplay+'"');a.zooming&&(b=b+' zooming="'+
a.zooming+'"');a.panning&&(b=b+' panning="'+a.panning+'"');a.initialZooming&&(b=b+' initialZooming="'+a.initialZooming+'"');return b+' inlineStyle="background-color:transparent;fill-type:solid;" controlPanelBehavior="hidden">'};
DvtThematicMapJsonToXmlConverter.getMapHierarchyElement=function(a,b){var d="<mapHierarchy>",e=a.layers;if(e)for(var g=0;g<e.length;g++)d=d+"<"+e[g].type+"Layer ",e[g].layer&&(d=d+'layerName="'+e[g].layer+'"'),e[g].labelDisplay&&(d=d+' labelDisplay="'+e[g].labelDisplay+'"'),e[g].labelStyle&&(d=d+' labelStyle="'+e[g].labelStyle+'"'),e[g].labelType&&(d=d+' labelType="'+e[g].labelType+'"'),e[g].animationDuration&&!b&&(d=d+' animationDuration="'+e[g].animationDuration+'"'),d=e[g].animationOnLayerChange&&
!b?d+' animationOnLayerChange="'+e[g].animationOnLayerChange+'"':d+' animationOnLayerChange="none"',d+="/>";return d+"</mapHierarchy>"};DvtThematicMapJsonToXmlConverter.getCustomBasemapMetadata=function(a){return a.customBasemap?a.customBasemap:""};DvtThematicMapJsonToXmlConverter.getLayers=function(a,b,d){for(var e=[],g="<layers>",a=a.dataLayers,h=0;h<a.length;h++)g+=this.getLayerElement(e,0,a[h],b,b.basemap,d);return g+"</layers>"};
DvtThematicMapJsonToXmlConverter.getLayerElement=function(a,b,d,e,g,h){h="<layer"+this.getLayerAttributes(d,h);h=h+">"+this.getDataAndStyleElements(a,b,d,e,g);return h+"</layer>"};
DvtThematicMapJsonToXmlConverter.getLayerAttributes=function(a,b){var d="";a[" animationDuration"]&&!b&&(d=d+'animationDuration="'+a.animationDuration/1E3+'"');d=a.animationOnDataChange&&!b?d+' animationDataChange="'+a.animationOnDataChange+'"':d+' animationDataChange="none"';a.id&&(d=d+' clientId="'+a.id+'"');a.associatedLayer&&(d=d+' id="'+a.associatedLayer+'"');a.dataSelection&&(d=d+' selectionMode="'+a.dataSelection+'"');a.emptyText&&(d=d+' emptyText="'+a.emptyText+'"');a.isolatedRowKey&&(d=d+
' isolatedRowKey="'+a.isolatedRowKey+'"');a.associatedWith&&(d=d+' showWith="'+a.associatedWith+'"');return d};
DvtThematicMapJsonToXmlConverter.getDataAndStyleElements=function(a,b,d,e,g){for(var h=null,k=d.disclosedRowKeys,m=d.selectedRowKeys,n="<data>",d=d.data,o=null,q=0;q<d.length;q++){var s=d[q].type;o!=s&&("area"==s?(h="area"+b,b++,a.push('<colorStyles id="'+h+'"/>')):"marker"==s&&(h="marker"+b,b++,a.push('<graduatedSymbol id="'+h+'"/>')),o=s);n+="<row ";n=n+'clientId="'+d[q].clientId+'" ';n=n+'styleId="'+h+'" ';n=n+'rowKey="'+d[q]._rowKey+'" ';k&&-1!=k.indexOf(d[q]._rowKey)&&(n+='drilled="true" ');
m&&-1!=m.indexOf(d[q]._rowKey)&&(n+='selected="true" ');d[q].location&&(n=n+'id="'+d[q].location+'" ');d[q].labelDisplay&&(n=n+h+'_labelDisplay="'+d[q].labelDisplay+'" ');d[q].label&&(n=n+h+'_label="'+d[q].label+'" ');d[q].labelStyle&&(n=n+h+'_labelStyle="'+d[q].labelStyle+'" ');d[q].shortDesc&&(n=n+h+'_shortDesc="'+d[q].shortDesc+'" ');d[q].labelPosition&&(n=n+h+'_labelPosition="'+d[q].labelPosition+'" ');d[q].x&&d[q].y&&(s=DvtThematicMapProjections.project(d[q].x,d[q].y,g),n=n+'x="'+s.x+'" y="'+
s.y+'" ');d[q].width&&(n=n+'width="'+d[q].width+'" ');d[q].height&&(n=n+'height="'+d[q].height+'" ');d[q].scaleX&&(n=n+h+'_scaleX="'+d[q].scaleX+'" ');d[q].scaleY&&(n=n+h+'_scaleY="'+d[q].scaleY+'" ');d[q].shape&&(n=n+h+'_shapeType="'+d[q].shape+'" ');d[q].source&&(n=n+'source="'+d[q].source+'" ');d[q].sourceHover&&(n=n+'sourceHover="'+d[q].sourceHover+'" ');d[q].sourceSelected&&(n=n+'sourceSelected="'+d[q].sourceSelected+'" ');d[q].sourceHoverSelected&&(n=n+'sourceHoverSelected="'+d[q].sourceHoverSelected+
'" ');d[q].action&&(n+='hasAction="true" ',n+='action="'+d[q].action+'" ');n+=this.getDataItemInlineStyle(h,d[q],e);n+="/>"}n+="</data><styles>";for(b=0;b<a.length;b++)n+=a[b];return n+"</styles>"};
DvtThematicMapJsonToXmlConverter.getDataItemInlineStyle=function(a,b,d){a+='_inlineStyle="';b.opacity?a=a+"opacity:"+b.opacity+";":"marker"==b.type&&void 0!=d.markerStyle.opacity&&(a=a+"opacity:"+d.markerStyle.opacity+";");void 0==b.color&&"marker"==b.type&&void 0!=d.markerStyle["background-color"]&&(b.color=d.markerStyle["background-color"]);"auto"==b.gradientEffects?a=a+"gradient:true;background-color:"+b.color+";":b.fillPattern?(a=a+"pattern:"+b.fillPattern+";",a=a+"pattern-color:"+b.color+";",
a+="background-color:#ffffff;"):a=a+"background-color:"+b.color+";";d.areaStyles.area["border-color"]&&(a=a+"border-color:"+d.areaStyles.area["border-color"]+";");d.areaStyles.area["border-width"]&&(a=a+"border-width:"+d.areaStyles.area["border-width"]+";");return a+'"'};var DvtThematicMapProjections={};DvtObj.createSubclass(DvtThematicMapProjections,DvtObj,"DvtThematicMapProjections");DvtThematicMapProjections._VIEWPORT_BOUNDS=new DvtRectangle(0,0,800,500);DvtThematicMapProjections._RADIUS=6378206.4;
DvtThematicMapProjections._NEW_ZEALAND_RECT=new DvtRectangle(163,-49,17,17);DvtThematicMapProjections._NEW_ZEALAND_BOUNDS=new DvtRectangle(163,-49,17,17);DvtThematicMapProjections._AFRICA_BOUNDS=new DvtRectangle(-17.379205428479874,-37.201510854305546,68.66391442808313,77.50071544582713);DvtThematicMapProjections._ASIA_BOUNDS=new DvtRectangle(-0.8436866097568272,-0.7626456732012923,1.8336308036296942,1.5748427214611724);
DvtThematicMapProjections._AUSTRALIA_BOUNDS=new DvtRectangle(113.29667079927977,-52.89550592498755,65.25257389065216,42.123114617504626);DvtThematicMapProjections._EUROPE_BOUNDS=new DvtRectangle(-0.47944476148667076,-0.0014669405958800579,0.7364925893845453,0.6293972741802124);DvtThematicMapProjections._N_AMERICA_BOUNDS=new DvtRectangle(-0.6154469465354344,-0.24589767758847714,1.2448236795108683,1.2631535127174947);
DvtThematicMapProjections._S_AMERICA_BOUNDS=new DvtRectangle(-80.60817722658722,-60.796273249672765,46.608687602908056,66.96595767361796);DvtThematicMapProjections._APAC_BOUNDS=new DvtRectangle(68.20516856593524,-52.89892708045518,111.65739821771903,116.55460214469134);DvtThematicMapProjections._EMEA_BOUNDS=new DvtRectangle(-24.543831069368586,-37.202500659225905,204.54283106936856,164.9634493690208);
DvtThematicMapProjections._L_AMERICA_BOUNDS=new DvtRectangle(-117.12451221229134,-54.95921623126266,82.33223251442891,87.67786623127876);DvtThematicMapProjections._USA_CANADA_BOUNDS=new DvtRectangle(-0.6154656300926513,0.0507209798775865,1.0153104799231851,0.966537441082997);DvtThematicMapProjections._WORLD_BOUNDS=new DvtRectangle(-171.9,-62.6,349.8,150.8);DvtThematicMapProjections._ALASKA1_RECT=new DvtRectangle(172,51,8,3);DvtThematicMapProjections._ALASKA2_RECT=new DvtRectangle(-180,51,51,21);
DvtThematicMapProjections._HAWAII_RECT=new DvtRectangle(-178.5,18.9,35,11);DvtThematicMapProjections._USA_RECT=new DvtRectangle(-124.8,24.4,58,25.5);DvtThematicMapProjections._ALASKA_BOUNDS=new DvtRectangle(-187.5517578125,59.82610321044922,57.562225341796875,43.83738708496094);DvtThematicMapProjections._HAWAII_BOUNDS=new DvtRectangle(-160.23606872558594,18.91549301147461,5.4374847412109375,3.3189010620117188);DvtThematicMapProjections._USA_BOUNDS=new DvtRectangle(-2386803.25,-1183550.5,4514111,2908402);
DvtThematicMapProjections._ROBINSON_COORDINATES=[[1,0],[0.9986,0.0314],[0.9954,0.0629],[0.99,0.0943],[0.9822,0.1258],[0.973,0.1572],[0.96,0.1887],[0.9427,0.2201],[0.9216,0.2515],[0.8962,0.2826],[0.8679,0.3132],[0.835,0.3433],[0.7986,0.3726],[0.7597,0.4008],[0.6732,0.4532],[0.6213,0.4765],[0.5722,0.4951],[0.5322,0.5072]];
DvtThematicMapProjections.project=function(a,b,d){var e;switch(d){case "africa":e=DvtThematicMapProjections._getAffineProjection(DvtThematicMapProjections._AFRICA_BOUNDS,null,DvtThematicMapProjections._getMercatorProjection(a,b));break;case "asia":e=DvtThematicMapProjections._getAffineProjection(DvtThematicMapProjections._ASIA_BOUNDS,DvtThematicMapProjections.toRadians(5),DvtThematicMapProjections._getAlbersEqualAreaConicProjection(40,95,20,60,a,b));break;case "australia":e=DvtThematicMapProjections._getAustraliaProjection(a,
b);break;case "europe":e=DvtThematicMapProjections._getAffineProjection(DvtThematicMapProjections._EUROPE_BOUNDS,DvtThematicMapProjections.toRadians(10),DvtThematicMapProjections._getAlbersEqualAreaConicProjection(35,25,40,65,a,b));break;case "northAmerica":e=DvtThematicMapProjections._getAffineProjection(DvtThematicMapProjections._N_AMERICA_BOUNDS,null,DvtThematicMapProjections._getAlbersEqualAreaConicProjection(23,-96,20,60,a,b));break;case "southAmerica":e=DvtThematicMapProjections._getAffineProjection(DvtThematicMapProjections._S_AMERICA_BOUNDS,
DvtThematicMapProjections.toRadians(5),new DvtPoint(a,b));break;case "apac":e=DvtThematicMapProjections._getAffineProjection(DvtThematicMapProjections._APAC_BOUNDS,null,DvtThematicMapProjections._getMercatorProjection(a,b));break;case "emea":e=DvtThematicMapProjections._getAffineProjection(DvtThematicMapProjections._EMEA_BOUNDS,null,DvtThematicMapProjections._getMercatorProjection(a,b));break;case "latinAmerica":e=DvtThematicMapProjections._getAffineProjection(DvtThematicMapProjections._L_AMERICA_BOUNDS,
null,new DvtPoint(a,b));break;case "usaAndCanada":e=DvtThematicMapProjections._getAffineProjection(DvtThematicMapProjections._USA_CANADA_BOUNDS,null,DvtThematicMapProjections._getAlbersEqualAreaConicProjection(23,-96,20,60,a,b));break;case "worldRegions":e=DvtThematicMapProjections._getWorldProjection(a,b);break;case "usa":e=DvtThematicMapProjections._getUSAProjection(a,b);break;case "world":e=DvtThematicMapProjections._getWorldProjection(a,b)}return e?new DvtPoint(10*e.x,10*e.y):new DvtPoint(a,b)};
DvtThematicMapProjections._getUSAProjection=function(a,b){var d;if(DvtThematicMapProjections._ALASKA1_RECT.containsPoint(a,b)||DvtThematicMapProjections._ALASKA2_RECT.containsPoint(a,b))return d=DvtThematicMapProjections._getViewPortTransformation(DvtThematicMapProjections._ALASKA_BOUNDS,new DvtRectangle(-75,350,240,150)),DvtThematicMapProjections._applyAffineTransform(d,DvtThematicMapProjections._getMercatorProjection(a,b));if(DvtThematicMapProjections._HAWAII_RECT.containsPoint(a,b))return d=DvtThematicMapProjections._getViewPortTransformation(DvtThematicMapProjections._HAWAII_BOUNDS,
new DvtRectangle(165,400,100,100)),DvtThematicMapProjections._applyAffineTransform(d,new DvtPoint(a,b));return DvtThematicMapProjections._USA_RECT.containsPoint(a,b)?(d=DvtThematicMapProjections._getViewPortTransformation(DvtThematicMapProjections._USA_BOUNDS,DvtThematicMapProjections._VIEWPORT_BOUNDS),DvtThematicMapProjections._applyAffineTransform(d,DvtThematicMapProjections._getOrthographicProjection(new DvtPoint(-95,36),a,b))):new DvtPoint(a,b)};
DvtThematicMapProjections._getWorldProjection=function(a,b){var d=DvtThematicMapProjections._getViewPortTransformation(DvtThematicMapProjections._WORLD_BOUNDS,DvtThematicMapProjections._VIEWPORT_BOUNDS);return DvtThematicMapProjections._applyAffineTransform(d,DvtThematicMapProjections._getRobinsonProjection(a,b))};
DvtThematicMapProjections._getAustraliaProjection=function(a,b){var d;d=DvtThematicMapProjections._NEW_ZEALAND_RECT.containsPoint(a,b)?DvtThematicMapProjections._getViewPortTransformation(DvtThematicMapProjections._NEW_ZEALAND_BOUNDS,new DvtRectangle(500,200,200,200)):DvtThematicMapProjections._getViewPortTransformation(DvtThematicMapProjections._AUSTRALIA_BOUNDS,new DvtRectangle(0,0,800,500));return DvtThematicMapProjections._applyAffineTransform(d,DvtThematicMapProjections._getMercatorProjection(a,
b))};DvtThematicMapProjections._getAffineProjection=function(a,b,d){a=DvtThematicMapProjections._getViewPortTransformation(a,DvtThematicMapProjections._VIEWPORT_BOUNDS);if(b){var e=new DvtMatrix;e.rotate(b);a=DvtThematicMapProjections._concatAffineTransforms(a,e)}return a.transformPoint(d)};
DvtThematicMapProjections._getAlbersEqualAreaConicProjection=function(a,b,d,e,g,h){var b=DvtThematicMapProjections.toRadians(b),k=DvtThematicMapProjections.toRadians(a),d=DvtThematicMapProjections.toRadians(d),e=DvtThematicMapProjections.toRadians(e),e=0.5*(Math.sin(d)+Math.sin(e)),a=Math.pow(Math.cos(d),2)+2*e*Math.sin(d),d=a-2*e*Math.sin(k),d=Math.sqrt(d)/e,g=DvtThematicMapProjections.toRadians(g),h=DvtThematicMapProjections.toRadians(h),b=e*(g-b),h=a-2*e*Math.sin(h),h=Math.sqrt(h)/e,e=h*Math.sin(b),
h=d-h*Math.cos(b);return new DvtPoint(e,h)};DvtThematicMapProjections._getMercatorProjection=function(a,b){var d=Math.log(Math.tan(0.25*Math.PI+0.5*DvtThematicMapProjections.toRadians(b)));return new DvtPoint(a,DvtThematicMapProjections.toDegrees(d))};
DvtThematicMapProjections._getOrthographicProjection=function(a,b,d){var b=DvtThematicMapProjections.toRadians(b),d=DvtThematicMapProjections.toRadians(d),e=DvtThematicMapProjections.toRadians(a.x),g=DvtThematicMapProjections.toRadians(a.y),a=Math.cos(d)*Math.sin(b-e)*DvtThematicMapProjections._RADIUS,b=Math.cos(g)*Math.sin(d)-Math.sin(g)*Math.cos(d)*Math.cos(b-e)*DvtThematicMapProjections._RADIUS;return new DvtPoint(a,b)};
DvtThematicMapProjections._getRobinsonProjection=function(a,b){var d=Math.floor(Math.abs(b)/5);d>=DvtThematicMapProjections._ROBINSON_COORDINATES.length-1&&(d=DvtThematicMapProjections._ROBINSON_COORDINATES.length-2);var e=(Math.abs(b)-5*d)/5,g=a*(DvtThematicMapProjections._ROBINSON_COORDINATES[d][0]+e*(DvtThematicMapProjections._ROBINSON_COORDINATES[d+1][0]-DvtThematicMapProjections._ROBINSON_COORDINATES[d][0])),d=DvtThematicMapProjections._ROBINSON_COORDINATES[d][1]+e*(DvtThematicMapProjections._ROBINSON_COORDINATES[d+
1][1]-DvtThematicMapProjections._ROBINSON_COORDINATES[d][1]);0>b&&(d*=-1);return new DvtPoint(g,180*d)};DvtThematicMapProjections._applyAffineTransform=function(a,b){return new DvtPoint(b.x*a.getA()+a.getTx(),b.y*a.getD()+a.getTy())};DvtThematicMapProjections._concatAffineTransforms=function(a,b){var d=a.getA(),e=b.getA()*d,g=b.getB()*d,d=a.getTx()+b.getTx()*d,h=a.getD(),k=b.getC()*h,m=b.getD()*h,h=a.getTy()+b.getTy()*h;return new DvtMatrix(null,e,g,k,m,d,h)};
DvtThematicMapProjections._getViewPortTransformation=function(a,b){var d=b.x,e=b.y,g=a.w,h=a.h,k=0,k=b.w/g,m=b.h/h,k=k<=m?k:m,d=d-a.x*k,e=e+a.y*k,d=d+(b.w-g*k)/2,e=e+(b.h-(b.h-h*k)/2);return new DvtMatrix(null,k,0,0,-k,d,e)};DvtThematicMapProjections.toRadians=function(a){return a*(Math.PI/180)};DvtThematicMapProjections.toDegrees=function(a){return a*(180/Math.PI)};