// 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/FieldInfoNameUtil",[],function(){var b={SCRIPT_PREFIX:"",DEFAULT_SCRIPT_NAME:"Custom",SCRIPT_PREFIX_RE:/^SCRIPT_/i,FIRST_SYMBOL_IS_NUMBER_RE:/^[0-9]/,DATA_COLLECTIONS_CALCULATOR_NAME:"dataCollectionsCalculator",MAPS_CALCULATOR_NAME:"mapsCalculator",AREA_ATTRIBUTES_CALCULATOR_NAME:"headers",createFieldNameFromVariable:function(a,c){if(!a)return"";if(a.isSiteAttribute)return a.attribute.name;if(a.isWebMap)return a.fieldName;
var d;d=(a.fullName||a).replace(/_|\.|\s/g,"");c=c||"n";d+="n"===c?"":"_"+c;b.FIRST_SYMBOL_IS_NUMBER_RE.test(d)&&(d="_"+d);return b._checkXMLValidName(d.toUpperCase())},createFieldNameFromScript:function(a){a=a.name;b.SCRIPT_PREFIX_RE.test(a)&&(a=a.replace(b.SCRIPT_PREFIX_RE,""));return b._checkXMLValidName(b.SCRIPT_PREFIX+a.replace(/\.|-/g,""))},_XML_MASK_NAME_RE:/(_X)(\d\d\d\d)/i,_checkXMLValidName:function(a){return b._XML_MASK_NAME_RE.test(a)?a.replace(b._XML_MASK_NAME_RE,"$1_$2"):a},renderScriptName:function(a){return a.replace(b.SCRIPT_PREFIX_RE,
"")},provideQualifiedFieldInfoTemplateName:function(a,c){a&&(a.templateName=c?c+"."+a.name:a.isWebMap?b.AREA_ATTRIBUTES_CALCULATOR_NAME+"."+a.name:a.isSiteAttribute?b.AREA_ATTRIBUTES_CALCULATOR_NAME+"."+a.name:b.DATA_COLLECTIONS_CALCULATOR_NAME+"."+a.name)},updateCalculatorName:function(a,b){a&&(a.templateName=b+a.templateName.substr(a.templateName.indexOf(".")))}};return b});