// 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/grid/coreUtils/GridStyleUtil",["./GridLayoutCalculator","esri/dijit/geoenrichment/utils/ColorUtil","esri/dijit/geoenrichment/utils/ObjectUtil","../../themes/ReportThemes","../ValueField"],function(l,m,f,n,g){var h={filterCellStyles:function(a){return h._filterCellStyles(a,g.SUPPORTED_STYLES)},filterCellTextStyles:function(a){return h._filterCellStyles(a,g.SUPPORTED_TEXT_STYLES)},_filterCellStyles:function(a,d){var e={},c;for(c in a)void 0!==a[c]&&
d[c]&&(e[c]=a[c]);return e},combineCellStyle:function(a,d,e,c){var b={},g=a.viewModel.getDocumentDefaultStyles&&a.viewModel.getDocumentDefaultStyles(a.theme||a.themeContext);f.copyOwnJsonProperties(g,b);a.viewModel.getTableDefaultStyles&&f.copyOwnJsonProperties(a.viewModel.getTableDefaultStyles(a.theme||a.themeContext,"Default"),b);f.copyOwnJsonProperties(d.style,b);delete b.fields;a.applyThemeStyle&&f.copyOwnJsonProperties(d.themeStyle&&d.themeStyle.fields&&d.themeStyle.fields[e.field],b);a.inheritThemeBackground||
m.isTransparent(b.backgroundColor)||delete b.backgroundColor;c=c||d.style.fields&&d.style.fields[e.field];f.copyOwnJsonProperties(c,b);b.width=l.calcFieldWidth(a,d,e.field);b.height=l.calcDataHeight(a,d,e.field);if(b.overrideStyle&&a.viewModel.getTableDefaultStyles&&(c=a.viewModel.getTableDefaultStyles(a.theme||a.themeContext,b.overrideStyle)))for(var k in c)if("backgroundColor"!==k||a.inheritThemeBackground||m.isTransparent(c[k]))b[k]=c[k];a.viewModel.reportStyle!==n.CLASSIC&&a.isSingleCelledTable()&&
(a=d.fieldInfos&&d.fieldInfos[e.field])&&(a.isInfographic||a.isChart)&&(b.backgroundColor="transparent");return h.filterCellStyles(b)}};return h});