// 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/GridDataUtil",["dojo/_base/lang"],function(f){var b={getNumericCellValue:function(a){return b.getNumericDataValue(a.gridData,a.column.field)},getNumericDataValue:function(a,c){return a&&c&&a[c+"_numeric"]},setNumericDataValue:function(a,c,b){c[b+"_numeric"]=a},isEmptyCell:function(a){return!a.get("value")&&!a.gridData[a.column.field]&&!b.getFieldInfo(a)},hasSpans:function(a){return b.getColumnSpan(a)||b.getRowSpan(a)},getColumnSpan:function(a){return a.gridData&&
a.gridData.columnSpans&&a.gridData.columnSpans[a.column.field]},getRowSpan:function(a){return a.gridData&&a.gridData.rowSpans&&a.gridData.rowSpans[a.column.field]},getDataColumnSpan:function(a,c){return a&&a.columnSpans&&a.columnSpans[c]},getDataRowSpan:function(a,c){return a&&a.rowSpans&&a.rowSpans[c]},getFieldInfo:function(a){return a&&a.gridData&&a.gridData.fieldInfos&&a.gridData.fieldInfos[a.column.field]},getGridFirstFieldInfo:function(a){return b.getFieldInfo(a.getFieldCells()[0])},setFieldInfo:function(a,
c){a.gridData&&((a.gridData.fieldInfos[a.column.field]=c)||a.setInfoTooltip&&a.setInfoTooltip(null))},provideFieldInfo:function(a){b.setFieldInfo(a,b.getFieldInfo(a)||{});return b.getFieldInfo(a)},getCellStyle:function(a,c){if(!a||!a.gridData)return null;var d=a.gridData.style&&a.gridData.style.fields&&a.gridData.style.fields[a.column.field];!d&&c&&(d={},b.setCellStyle(a,d));return d},setCellStyle:function(a,c){var b=a.gridData.style=a.gridData.style||{};b.fields=b.fields||{};b.fields[a.column.field]=
c},updateCellStyle:function(a,c){var d=b.getCellStyle(a,!0);f.mixin(d,c)},copyFieldStyle:function(a,c,d){a=b.getCellStyle(a);c=b.getCellStyle(c,!0);for(var e in d)void 0!==a[e]&&(c[e]=a[e])},getFieldCellText:function(a){return a.gridData&&a.gridData[a.column.field]},setFieldCellContent:function(a,b){a.set("value",b||"");a.gridData[a.column.field]=a.get("value")},clearFieldInfo:function(a,b){a.fieldInfos&&delete a.fieldInfos[b.field];a[b.field]=""},getFieldCellUrl:function(a){if(a.gridData&&a.gridData.urls&&
a.column)return a.gridData.urls[a.column.field]},setFieldCellUrl:function(a,b){a.gridData&&a.column&&(a.gridData.urls=a.gridData.urls||{},void 0===b?delete a.gridData.urls[a.column.field]:a.gridData.urls[a.column.field]=b)},getConditionalFormatting:function(a){return(a=b.getFieldInfo(a))&&a.triggerJson},setConditionalFormatting:function(a,c){var d=b.provideFieldInfo(a);c&&c.fieldInfo===d&&(c.fieldInfo=f.clone(c.fieldInfo),delete c.fieldInfo.triggerJson);d.triggerJson=c},isRichTextCell:function(a){a=
b.getFieldInfo(a);return!(!a||!a.isRichText)},isVariableFieldCell:function(a){a=b.getFieldInfo(a);return!(!a||!a.hasVariable&&!a.script)},isOnlyVariableFieldCell:function(a){a=b.getFieldInfo(a);return!(!a||!a.hasVariable)},isScriptFieldCell:function(a){a=b.getFieldInfo(a);return!(!a||!a.script)},isUneditableScript:function(a){a=b.getFieldInfo(a);return!!(a&&a.script&&a.script.isUneditableScript)},isNumericVariableFieldCell:function(a){a=b.getFieldInfo(a);return!(!a||!(a.hasVariable&&"esriFieldTypeString"!==
a.type||a.script&&!a.script.isUneditableScript&&"String"!==a.script.type))},isStringVariableFieldCell:function(a){a=b.getFieldInfo(a);return!(!a||!(a.hasVariable&&"esriFieldTypeString"===a.type||a.script&&"String"===a.script.type))},isChartCell:function(a){a=b.getFieldInfo(a);return!(!a||!a.isChart)},isImageCell:function(a){a=b.getFieldInfo(a);return!(!a||!a.isImage)},isMapImageCell:function(a){a=b.getFieldInfo(a);return!!(a&&a.isImage&&a.imageJson.isMapImage)},isImageTriggerCell:function(a){a=b.getFieldInfo(a);
return!!(a&&a.isImage&&a.triggerJson)},isShapeCell:function(a){a=b.getFieldInfo(a);return!(!a||!a.isShape)},isEmptyShapeCell:function(a){a=(a=b.getFieldInfo(a))&&a.shapeJson;return!(!a||a.g&&a.g.length)},isReportSectionCell:function(a){a=b.getFieldInfo(a);return!(!a||!a.isReportSection)},isInfographicCell:function(a){a=b.getFieldInfo(a);return!(!a||!a.isInfographic)}};return b});