// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/dijit/geoenrichment/ReportPlayer/core/infographics/simpleInfographic/_DDZoomAnimationSupport","dojo/_base/declare dojo/on dojo/keys dojo/dom-class dojo/dom-construct dojo/dom-geometry dojo/dom-style ./SimpleInfographicViewModes esri/dijit/geoenrichment/utils/DomUtil esri/dijit/geoenrichment/utils/MouseUtil esri/dijit/geoenrichment/utils/animation/AnimationUtil esri/dijit/geoenrichment/utils/DelayUtil ../../../ReportPlayerState".split(" "),function(q,l,r,g,m,t,h,e,n,u,f,v,w){return q(null,
{_ddZoomScreen:null,_ddZoomScreenClass:null,_currentTriggerButtonBox:null,_closeZoomedDDWhenClickedOutside:!0,_showZoomTransition:function(d,c,a){function p(a){a?(n.show(b.dataDrillingViewDiv),b.dataDrillingViewDiv.parentNode!==document.body&&document.body.appendChild(b.dataDrillingViewDiv),b._getDDZoomViewZIndex()&&h.set(b.dataDrillingViewDiv,"zIndex",b._getDDZoomViewZIndex())):(b.dataDrillingViewDiv.parentNode===document.body&&document.body.removeChild(b.dataDrillingViewDiv),n.hide(b.dataDrillingViewDiv))}
function k(){var a=d!==e.VIEW_MAIN;p(a);b._setZoomScreen(a,!1);b._setCloseHandlers(a);w.isViewingDataDrillingZoom=a;b._mode=d;g[d===e.VIEW_DATA_DRILLING?"add":"remove"](b.domNode,"isDrillingData");g.remove(b.domNode,"isShowingAnimation");b.onViewModeChanged(d)}var b=this;if(this._mode!==d){this._currentTriggerButtonBox=a?t.position(a):this._currentTriggerButtonBox;g.add(this.domNode,"isShowingAnimation");g.add(this.dataDrillingViewDiv,"isZoomAnimation");if(c)return p(!0),c=d===e.VIEW_DATA_DRILLING,
a=this._getDataDrillingPanelDimensions(),h.set(this.dataDrillingViewDiv,{width:a.w+"px",height:a.h+"px"}),this._setZoomScreen(c,!0),c?(c=f.animateResize({duration:200,domNode:this.dataDrillingViewDiv,fromBox:this._currentTriggerButtonBox,startScaleX:.7,startScaleY:.7,fromOffset:{x:"c",y:"c"},toBox:{x:(document.body.clientWidth-a.w)/2,y:(document.body.clientHeight-a.h)/2,w:a.w,h:a.h},onEnd:k}),f.animateFadeIn({domNode:this.dataDrillingViewDiv,duration:100})):(c=f.animateResize({duration:200,domNode:this.dataDrillingViewDiv,
toBox:this._currentTriggerButtonBox,endScaleX:.7,endScaleY:.7,toOffset:{x:"c",y:"c"},onEnd:k}),f.animateFadeOut({domNode:this.dataDrillingViewDiv,duration:100})),c.then(function(){return v.delay(100)});k()}},_setZoomScreen:function(d,c){var a=this;if(d!==!!this._ddZoomScreen)if(d)this._ddZoomScreen=m.create("div",{"class":"esriGEAbsoluteStretched simpleInfographic_dataDrillingViewDivScreen"},this.dataDrillingViewDiv,"before"),this._getDDZoomViewZIndex()&&h.set(this._ddZoomScreen,"zIndex",this._getDDZoomViewZIndex()),
this._ddZoomScreenClass&&g.add(this._ddZoomScreen,this._ddZoomScreenClass),c&&f.animateFadeIn({domNode:this._ddZoomScreen,duration:100});else{var e=function(){a._ddZoomScreen&&m.destroy(a._ddZoomScreen);a._ddZoomScreen=null};c?f.animateFadeOut({domNode:this._ddZoomScreen,duration:100,onEnd:e}):e()}},_clickOutsideHandler:null,_keyboardHandler:null,_setCloseHandlers:function(d){var c=this;this._clickOutsideHandler&&this._clickOutsideHandler.remove();this._clickOutsideHandler=null;this._keyboardHandler&&
this._keyboardHandler.remove();this._keyboardHandler=null;d&&(this._closeZoomedDDWhenClickedOutside&&(this._clickOutsideHandler=l(document.body,"click",function(){u.isMouseOver(c.dataDrillingViewDiv,{checkAllChildren:!0})||c._setViewMode(e.VIEW_MAIN,!0)})),this._keyboardHandler=l(document.body,"keyup",function(a){a.keyCode===r.ESCAPE&&c._setViewMode(e.VIEW_MAIN,!0)}))},_getDDZoomViewZIndex:function(){return null}})});