// 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/infographics/infographicUtils/InfographicThemeUtil",[],function(){function f(a,b){var c={},d;for(d in g)a&&void 0!==a[d]&&(c[d]=a[d]),b&&void 0!==b[d]&&(c[d]=b[d]);return c}var e={},g={backgroundColor:1,color:1,fontFamily:1,fontSize:1,fontStyle:1,fontWeight:1,textDecoration:1};e.applyThemeSettingsToJson=function(a,b){if(a.header){var c=a.header.data.data[0];b&&b.titleStyle?c.themeStyle={fields:{field0:f(b.titleStyle)}}:c&&delete c.themeStyle;(c=a.header.data.data[1].fieldInfos.field0.shapeJson)&&
b&&b.titleLine&&b.titleLine.color?c.style.borderColor||(c.themeStyle={borderColor:b.titleLine.color}):c&&delete c.themeStyle}a.variableTables&&a.variableTables.forEach(function(a){a.shape&&e.applyThemeSettingsToShapeJson(a.shape.shapeJson,b,a.shape.isHighlighted);if(a.variable)if(b&&b.variableLabelStyle){var c;a.variable.isHighlighted?c=f(b.variableLabelStyleHighlighted):a.variable.isContrastColor&&(c=f(b.variableLabelStyleContrast));a.variable.themeStyle=f(b.variableLabelStyle,c)}else delete a.variable.themeStyle;
a.description&&(b&&b.variableDescriptionStyle?a.description.themeStyle=f(b.variableDescriptionStyle):delete a.description.themeStyle)});return a};e.applyThemeSettingsToShapeJson=function(a,b,c){c=c?"highlightedIcon":"icon";a&&b&&b[c]&&b[c].backgroundColor?(a.themeStyle={},a.style.borderColor||(a.themeStyle.borderColor=b[c].backgroundColor),a.style.fillColor||(a.themeStyle.fillColor=b[c].backgroundColor)):a&&delete a.themeStyle;a&&b&&b.iconBarBackground&&b.iconBarBackground.backgroundColor?(a.barBackgroundThemeStyle=
{},a.barBackgroundStyle&&a.barBackgroundStyle.fillColor||(a.barBackgroundThemeStyle.fillColor=b.iconBarBackground.backgroundColor)):a&&delete a.barBackgroundThemeStyle};e.undoThemeFromJson=function(a){return e.applyThemeSettingsToJson(a,null)};return e});