// 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/reportContainers/reportContainerGridSupports/_ScrollSupport",["dojo/_base/declare","dojo/dom-geometry"],function(f,g){return f(null,{scrollToCell:function(d,a){if(d&&d.parentGrid&&this._getGridContainerWrapper(d.parentGrid))return this._scrollToNode(d.domNode,a)},_scrollToNode:function(d,a){a=a||{};var b=g.position(this.getScrollableContainer()),c=g.position(d),h=!(c.x>b.x&&b.x+b.w>c.x+c.w),k=!(c.y>b.y&&b.y+b.h>c.y+c.h),e=a.anchorTop&&("number"===
typeof a.anchorTop?a.anchorTop:30),f=void 0!==e?e:Math.min(b.h-c.h-30,(b.h-c.h)/2),e=Math.max(30,(b.w-c.w)/2)-(c.x-b.x),b=f-(c.y-b.y);if(!a.onlyIfOutOfView||h||k)if(!1===a.scrollHorizontally||!h&&a.onlyIfOutOfView||(this.getScrollableContainer().scrollLeft-=e),k||!a.onlyIfOutOfView)return this._animateScrolling(this.getScrollableContainer().scrollTop-b,a.immdediate)},_animateScrolling:function(d,a){this.getScrollableContainer().scrollTop=d},scrollToPageAt:function(d,a){var b=this._grids[d],c=b.getFieldCells()[0];
return c?this.scrollToCell(c,{scrollHorizontally:!1,anchorTop:a&&a.anchorTop}):this._scrollToNode(b.domNode,{scrollHorizontally:!1,anchorTop:0})},scrollToLastPage:function(){return this.scrollToPageAt(this._grids.length-1)},getCurrentViewedPageIndex:function(){var d=this.getScrollableContainer().scrollHeight/this._grids.length;return Math.round(this.getScrollableContainer().scrollTop/d)},getCurrentViewedPageGrid:function(){return this.getGrids()[this.getCurrentViewedPageIndex()]},getScrollableContainer:function(){return this.mainContainer}})});