// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
define("dojo/_base/declare dojo/_base/array esri/renderers/jsonUtils jimu/dijit/RendererChooser ../BaseEditor ./simpleEditors".split(" "),function(c,d,e,f,g,h){return c([g],{baseClass:"jimu-gp-editor-base jimu-gp-editor-fsre",editorName:"FeatureSetRendererEditor",postCreate:function(){this.inherited(arguments);var a={};if(this.param.renderer)a.renderer=e.fromJson(this.param.renderer),this.param.renderer._colorType&&(a.renderer._colorType=this.param.renderer._colorType),a.renderer._showOthersSymbol=
void 0!==this.param.renderer._showOthersSymbol?this.param.renderer._showOthersSymbol:!0;else if(a.type=this._getSymbolType(),!a.type){(new h.UnsupportEditor({message:this.nls.unSupportGeometryType})).placeAt(this.domNode);return}a.fields=d.map(this.param.defaultValue.fields,function(b){return b.name});this.renderer=new f(a);this.renderer.placeAt(this.domNode);this.renderer.startup()},getValue:function(){if(this.renderer){var a=this.renderer.getRenderer(),b={renderer:a.toJson()};a._colorType&&(b.renderer._colorType=
a._colorType);void 0!==a._showOthersSymbol&&(b.renderer._showOthersSymbol=!!a._showOthersSymbol);return b}return null},_getSymbolType:function(){switch(this.param.defaultValue.geometryType){case "esriGeometryPoint":case "esriGeometryMultipoint":return"marker";case "esriGeometryPolyline":return"line";case "esriGeometryPolygon":return"fill"}}})});