// 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/containerGridUtils/PageQueryUtil",["dojo/dom-geometry","../ReportContainerGrid","../../../ReportPlayer","esri/dijit/geoenrichment/utils/ColorUtil","esri/dijit/geoenrichment/utils/DomUtil"],function(k,l,q,r,t){var n={getElementPageInfo:function(a){function e(a,c){var m=k.position(a.domNode),d=k.position(c.domNode);b.x+=m.x-d.x;b.y+=m.y-d.y}function f(a){d||(a=a.getFullStyle().backgroundColor)&&!r.isTransparent(a)&&(d=a)}function g(a){if(a){a.parentGridCell&&
f(a.parentGridCell);var h=a.parentWidget;if(h)if(h instanceof l){if(c=h,a=n.getNodePositionOnPage(c,a.domNode))b.x+=a.x,b.y+=a.y,p=a.gridContainer}else e(a,h),g(h);else a.parentElementInPageInfo&&(c=a.parentElementInPageInfo.reportContainer,d=d||a.parentElementInPageInfo.panelBackgroundColor,b.x+=a.parentElementInPageInfo.pos.x,b.y+=a.parentElementInPageInfo.pos.y)}}if(a&&(a.parentWidget||a.parentGrid)){var c,b={x:0,y:0},d,p;a.parentGrid&&a.rowId&&a.columnId?(f(a),e(a,a.parentGrid),g(a.parentGrid)):
g(a);return c?{reportContainer:c,documentOptions:c.documentOptions,pos:b,zoom:c.getZoomInfo().scale,panelBackgroundColor:d,gridContainer:p}:null}},getReportContainerPageNode:function(a){for(;a;){if(a.reportContainerPageNode)return a.reportContainerPageNode;a=a.parentWidget}return null},getParentReportContainerGrid:function(a){for(;a;){if(a.parentWidget instanceof l)return a.parentWidget;a=a.parentWidget}return null},getParentReportPlayer:function(a){for(;a;){if(a.parentWidget instanceof q)return a.parentWidget;
a=a.parentWidget}return null},getNodePositionOnPage:function(a,e){if(!e)return null;var f;a.getGrids().some(function(a){if(t.isChildOf(e,a.domNode)||a.domNode===e)f=a});if(!f)return null;var g=a.getGridContainer(f),c=k.position(g),b=k.position(e);return{x:b.x-c.x,y:b.y-c.y,gridContainer:g}}};return n});