text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See http://js.arcgis.com/3.34/esri/copyright.txt for details.
  //>>built
  define("esri/dijit/geoenrichment/ReportPlayer/core/charts/tooltips/_BuilderUtil","dojo/string dojo/dom-class dojo/dom-construct dojo/dom-style ../legends/ChartLegendSymbols ../legends/LegendSymbolRenderer ../../supportClasses/templateJsonUtils/fieldInfo/FieldInfoRenderer ../../../dataProvider/supportClasses/data/AreaDataUtil dojo/i18n!esri/nls/jsapi".split(" "),function(n,p,f,h,q,r,t,u,e){var k=e.geoenrichment.dijit.ReportPlayer.ChartContainer;e=e.geoenrichment.dijit.ReportPlayer.ChartTooltip;return{addTitle:function(a,
  c,b){a=f.create("div",{"class":"chartTooltip_title esriGERowHigh"},a);b&&this.addColor(b,a);this.addLabel(c,a)},addColor:function(a,c){a=a||{};a=r.renderSymbol({defaultSymbol:q.CIRCLE,fill:a.fill,stroke:a.stroke,marker:a.marker,width:8,height:10});p.add(a,"esriGESpaceAfterBig");f.place(a,c)},addRowOffset:function(a){this.addColor(null,a)},addLabel:function(a,c){return f.create("div",{"class":"chartTooltip_label dijitInline esriGESpaceAfterBig",innerHTML:a},c)},addValue:function(a,c){return f.create("div",
  {"class":"chartTooltip_value dijitInline esriGESpaceAfterBig",innerHTML:a},c)},buildStatLabels:function(a,c,b,d,e,h,k){function g(b,d){if(a[b]&&d){var e=f.create("div",{"class":"chartTooltip_row esriGERowHigh"},c);l.addColor(null,e);m.push(l.addLabel(d,e));l.addValue(a[b],e)}}var l=this,m=[];a.showWeight&&g("weightValueLabel",b);a.showMin&&g("minValueLabel",d);a.showMax&&g("maxValueLabel",e);a.showAvg&&g("avgValueLabel",h);a.showWeight&&g("weightInStackLabel",k);return m},formatTable:function(a){var c=
  0;a.forEach(function(a){c=Math.max(c,h.get(a,"width"))});a.forEach(function(a){h.set(a,"width",c+"px")})},buildSeriesLabel:function(a){return!0===a.isThisAreaSpecific?a.seriesLabel&&!a.isThisAreaSingleSeries?n.substitute(e.thisAreaSeries,{seriesName:a.seriesLabel}):k.thisArea:a.seriesLabel},addBenchmarkValue:function(a,c){return this.addValue(a.unbenchmarkedValueLabel+" ("+(0<a.value?"+":"")+a.valueLabel+")",c)},buildRichText:function(a,c){a=t.renderFieldInfoInTableCell(a.richTextFieldInfo,{previewValues:!0,
  fieldData:a.fieldData,isGraphicReport:!0,getPreviewValueFunction:this.buldPreviewValueFunction(a,{type:"tooltip"})});f.create("div",{"class":"chartTooltip_row esriGERow20",innerHTML:a.formattedValue},c)},buldPreviewValueFunction:function(a,c){return function(b){if(!b||!b.fieldInfo)return null;switch(b.fieldInfo.name){case "headers.CHART_POINT_VALUE":return{value:a.isBenchmarked?a.unbenchmarkedValue:a.value};case "headers.CHART_POINT_NAME":return{formattedValue:a.pointName};case "headers.CHART_SERIES_NAME":return{formattedValue:a.seriesName};
  case "headers.CHART_AREA_NAME":return{formattedValue:a.areaName||k.thisArea}}if(!a.fieldData)return null;b=b.fieldInfo;if(b.expressionText&&-1!==b.expressionText.indexOf("!headers.CHART_POINT_VALUE!")){var d;switch(c.type){case "tooltip":d=a.tooltipTemplateValues;break;case "dataDrilling":d=a.dataDrillingPanelInfo.templateValues}(d=d&&d[b.templateName]&&d[b.templateName][a.fieldInfo&&a.fieldInfo.templateName])&&(b=d)}b=u.getAreaDataValue({featureAttributes:a.isComparisonPoint?a.comparisonFeatureAttribute:
  null,fieldData:a.fieldData,featureIndex:a.featureIndex,fieldName:b.templateName||b.name});return"number"===typeof b?{value:b||0}:{formattedValue:b}}}}});