// 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/dataProviders/supportClasses/AreaDataUtil",["dojo/_base/lang","../../_devConfig"],function(h,m){var f={getAreaDataValue:function(c,b,d,a,e){function f(a){!1!==l&&(g=a[l]);void 0===g&&(g=a[c])}if(!m.showAreaDataUtilUndefinedData&&c){var n=!d;a=void 0===a?0:Number(a)||0;if(a=b.areaData[a]){var k=c.indexOf("."),l=!1;-1!==k&&(l=c.substr(k+1));d||-1===k||(d=c.substr(0,k));var g;(d=a[d])&&f(d.data);if(!n)return g;void 0!==g||e||f(b.metadata);if(void 0===g)for(var h in a)if(f(a[h].data),
void 0!==g)break;return g}}},getAreaDataObjectCalculator:function(c,b,d){var a=c[b];!a&&d&&(a=c[b]=f.createCalculator());return a},createCalculator:function(c,b){return{data:c||{},comparisonLevels:b||[]}},setAreaDataValue:function(c,b,d,a,e){e=void 0===e?0:Number(e)||0;f.setAreaDataObjectValue(c,b,d[e],a)},setAreaDataObjectValue:function(c,b,d,a){d&&a&&(f.getAreaDataObjectCalculator(d,a,!0).data[c]=b)},mergeAreaData:function(c,b){b.forEach(function(d,a){var b=c[a];b&&f.mergeAreaDataObjects(b,d)})},
mergeAreaDataObjects:function(c,b){for(var d in c){var a=c[d],e=b[d];e?a.comparisonLevels.length!==e.comparisonLevels.length?console.log("Error: can't merge calculators with different comparison levels!"):(h.mixin(e.data,a.data),a.comparisonLevels.forEach(function(a,b){h.mixin(e.comparisonLevels[b],a)})):b[d]=a}console.log("AreaDataUtil.js merging area data \x3d\x3e areaData");console.log(b)}};return f});