// 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/comparison/ComparisonListUtil",["dojo/_base/declare","dojo/dom-class","esri/dijit/geoenrichment/OnDemandSelect","../templateJsonUtils/countryConfig"],function(f,h,a,l){f=f(a.itemRenderers.DefaultItemRenderer,{createPresentation:function(c,g,k,m,a){var d=this.inherited(arguments);c.isArea&&h.add(d,"esriGEComparisonList_areaItemRoot");return d}});a={getListOptions:function(c){function g(b){return b.attributes.name||b.attributes.StdGeographyName||
""}function k(b){b.features.forEach(function(b){a.push({isArea:!0,value:String(h++),AREA_ID:b.attributes.AREA_ID,label:g(b)})})}c=c.slice();c.shift();var a=[],f={},d=[];c.forEach(function(b){var a=b.attributes.StdGeographyLevel||"default",e=f[a];e||(e=(e=l.getGeographiesModel())?e.getLevelPluralName(a):a,e={levelId:a,label:e+":",features:[]},f[a]=e,d.push(e));e.features.push(b)});d.forEach(function(a,c){a.features.sort(function(a,b){return g(a).localeCompare(g(b))})});var h=0;1===d.length&&"default"===
d[0].levelId?k(d[0]):d.forEach(function(b,c){0<c&&a.push({isSeparator:!0});a.push({isTitle:!0,enabled:!1,value:b.levelId,label:b.label});k(b)});return a},getDefaultOptionValue:function(a){var c;a.some(function(a){if(a.isArea)return c=a,!0});return c&&c.value},listValueToAreaID:function(a){return Number(a)+1}};a.ComparisonListItemRenderer=f;return a});