// 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/supportClasses/templateJsonUtils/fieldInfo/_FieldInfoPreviewRenderer",["dojo/string","./utils","../../conditionalStyling/ConditionalStyleUtil","dojo/i18n!../../../../../../../nls/jsapi","../../../../_devConfig"],function(n,p,f,d,q){d=d.geoenrichment.dijit.ReportPlayer.ReportPlayer;var r={percent:"10 15 20 25 33 46 72 90 95".split(" "),percentSmall:"234567".split(""),index:"80 99 105 111 113 118 121 130".split(" "),number:"1150 2013 5006 10135 20456 36813".split(" "),
numberSep:"1,150 2,013 5,006 10,135 20,456 36,813".split(" "),numberSmall:["10","5","3","7","15"]},h=/^MEDAGE|^AVGHHSZ|^UNEMPRT|ECYHSZAVG|ECYPTAMED/,k={percent:{MP19013a_B:"72",MP19014a_B:"70",EMP_TO_POP:"25",NOHS:"10",HSG:"20",SC:"30",BGPD:"40"},percentSmall:{UNEMPRT_CY:"5"},index:{},number:{MEDHINC_CY:"55650",TOTPOP_CY:"20456",TOTHH_CY:"8546",MEDDI_CY:"38290",S01_BUS:"11256",S01_EMP:"60382",PCI_CY:"30382",MEDNW_CY:"88548",MEDVAL_CY:"352430",X3004_A:"5682",ACSMEDCRNT:"1227",X5001_A:"1762",X1003_A:"4073",
X4100_A:"543",X8001_A:"4538",X1130_A:"3465",X7001_A:"1568",X9008_A:"246",X9073_A:"158",X9074_A:"326",X9045_A:"42",ECYPTAPOP:"20456",ECYHNIMED:"55650"},numberSep:{MEDHINC_CY:"55,650",TOTPOP_CY:"20,456",TOTHH_CY:"8,546",MEDDI_CY:"38,290",S01_BUS:"11,256",S01_EMP:"60,382",PCI_CY:"30,382",MEDNW_CY:"88,548",MEDVAL_CY:"352,430",X3004_A:"5,682",ACSMEDCRNT:"1,227",X5001_A:"1,762",X1003_A:"4,073",X4100_A:"543",X8001_A:"4,538",X1130_A:"3,465",X7001_A:"1,568",X9008_A:"246",X9073_A:"158",X9074_A:"326",X9045_A:"42",
ECYPTAPOP:"20,456",ECYHNIMED:"55,650"},numberSmall:{AVGHHSZ_CY:"2",MEDAGE_CY:"36",ECYHSZAVG:"2",ECYPTAMED:"36"},string:{TSEGNAME:"Bright Young Professionals",TLIFECODE:"L8",TLIFENAME:"Middle Ground",TSEGCODE:"8A"}},t={"Employee/ Population Ratio":"EMP_TO_POP","No High School Diploma":"NOHS","High School Graduate":"HSG","Some College":"SC","Bachelors/Grad/Prof Degree":"BGPD"},l={};return{getValuePreview:function(a,g){return function(){function e(){function m(b){0<a.decimals&&(b+="."+(""+10*Math.random()).replace(".",
"").substr(0,a.decimals));return b}if("esriFieldTypeString"===a.type)return k.string[a.variableID]||d.sampleTextValue;var e=a.statefulName&&"p"===a.statefulName.charAt(0)||a.showPercent,f=a.statefulName&&"i"===a.statefulName.charAt(0),b;b=e?a.hasVariable&&h.test(a.variableID)?"percentSmall":"percent":f?"index":a.hasVariable&&h.test(a.variableID)?"numberSmall":a.useThousandsSeparator?"numberSep":"number";return!q.preview.bigValues||"number"!==b&&"numberSep"!==b?function(){if(g.getPreviewValueFunction)return"percent"!==
b&&(b="number"),m(g.getPreviewValueFunction()[b]);var e=l[b]=l[b]||{},f=a.name+a.decimals,c=e[f];if(!c){var c=k[b],d;d=a.variableID?a.variableID:a.script&&t[a.script.alias];c=c[d];c||(c=r[b],c=c[Math.round((c.length-1)*Math.random())]);c=e[f]=m(c)}return c}():"100,000,000,000"}function f(){var a=1+2*g.featureIndex;return n.substitute(1<a?d.fieldPreviewAreaDescWithRadiusPlural:d.fieldPreviewAreaDescWithRadiusSingular,{radius:a})}return a.hasVariable||a.script?e():"headers.AREA_DESC"===a.name&&-1<g.featureIndex?
f():p.fields.getPreview(a.name,g.isGraphicReport)||a.alias}()},getConditionalStylePreview:function(a,d){if(a.triggerJson&&void 0!==d.rowIndex){var e=a.triggerJson.cases[d.rowIndex%a.triggerJson.cases.length];return e&&f.styleFromSetters(e.setters)}return null}}});