// 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/sections/_SectionQueryElementsMixin",["dojo/_base/declare","../grid/coreUtils/GridDataUtil"],function(f,d){return f(null,{_queryElementsById:function(a,b){return this._getStackElements(b).filter(function(b){return b.stackId===a})},getStackElements:function(a){return this._getStackElements(a)},containsElement:function(a){return-1!==this._stackElements.indexOf(a)},_getStackElements:function(a){return a?this._stackElements.slice().reverse():this._stackElements},
getTables:function(a){return this._queryElementsById("table",a)},getFirstTable:function(){return this.getTables()[0]},getTopMostTable:function(){return this.getTables(!0)[0]},getLastTable:function(){var a=this.getTables();return a[a.length-1]},getDataTables:function(){return this.isDataSection()?this.getTables():[]},hasNonEmptyTables:function(){return this.getTables().some(function(a){return 0<a.columns.length&&0<a.store.data.length})},hasTablesThatFitHeight:function(){return this.getTables().some(function(a){return a.needScaleToFitHeight()})},
hasMultiFeatureTables:function(){return this.getTables().some(function(a){return a.isMultiFeatureTable()})},hasImages:function(){return!!this.getImages().length},getImages:function(a){return this._queryElementsById("img",a)},getMovableElements:function(){return this._stackElements.filter(function(a){return"table"===a.stackId||"img"===a.stackId})},hasPageBreak:function(){return!!this._queryElementsById("pageBreak").length},collectFieldInfos:function(a){var b=[];this.getTables().forEach(function(c){b=
b.concat(c.collectFieldInfos(a))});return b},hasChart:function(){var a=0;this.getTables().forEach(function(b){b.getFieldCells().forEach(function(b){d.isChartCell(b)&&a++})});return a},getChartJson:function(){var a=this.getFirstTable();return a&&a.getChartJson()},hasInfographic:function(a){var b=this.getInfographicWithTable();return!b||a&&b.type!==a?!1:!0},getInfographic:function(){var a=this.getInfographicWithTable();return a&&a.infographic},getInfographicWithTable:function(){var a,b;this.getTables().some(function(c){return c.getFieldCells().some(function(e){if(d.isInfographicCell(e))return a=
e.content,b=c,!0})});return a?{infographic:a,table:b,type:a.getType()}:null},getInfographicJson:function(){var a=this.getFirstTable();return a&&a.getInfographicJson()},hasOnlyImage:function(){return 1===this._stackElements.length&&this._queryElementsById("img").length}})});