// 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
require({cache:{"url:widgets/Geoprocessing/editors/FeatureSetEditorChooser.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"field" data-dojo-attach-point\x3d"mapModeWrapper"\x3e\r\n    \x3cinput id\x3d"gpFSModeMap" name\x3d"mode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"mapMode" class\x3d"jimu-leading-margin10"\x3e\r\n    \x3clabel for\x3d"gpFSModeMap" style\x3d"width: auto;" class\x3d"jimu-leading-margin025"\x3e${nls.useCurrentMapExtent}\x3c/label\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"field"\x3e\r\n    \x3cinput id\x3d"gpFSModeDraw" name\x3d"mode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"drawMode" class\x3d"jimu-leading-margin10"\x3e\r\n    \x3clabel for\x3d"gpFSModeDraw" style\x3d"width: auto;" class\x3d"jimu-leading-margin025"\x3e${nls.drawOnMap}\x3c/label\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"field"\x3e\r\n    \x3cinput id\x3d"gpFSModeFile" name\x3d"mode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"fileMode" class\x3d"jimu-leading-margin10"\x3e\r\n    \x3clabel for\x3d"gpFSModeFile" style\x3d" width: auto;" class\x3d"jimu-leading-margin025"\x3e${nls.useShapefile}\x3c/label\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"field"\x3e\r\n    \x3cinput id\x3d"gpFSModeLayer" name\x3d"mode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"layersMode" class\x3d"jimu-leading-margin10"\x3e\r\n    \x3clabel for\x3d"gpFSModeLayer" style\x3d" width: auto;" class\x3d"jimu-leading-margin025"\x3e${nls.selectLayer}\x3c/label\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"field" style\x3d"height: 60px;"\x3e\r\n    \x3cinput id\x3d"gpFSModeURL" name\x3d"mode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"urlMode" class\x3d"jimu-leading-margin10"\x3e\r\n    \x3clabel for\x3d"gpFSModeURL" style\x3d"width: auto" class\x3d"jimu-leading-margin025"\x3e${nls.url}\x3c/label\x3e\r\n    \x3cdiv style\x3d"margin-top:5px;display:none;" data-dojo-attach-point\x3d"urlOptionsDiv"\x3e\r\n      \x3cinput name\x3d"mode" data-dojo-type\x3d"jimu/dijit/URLInput" data-dojo-attach-point\x3d"featureSetUrl" class\x3d"jimu-leading-margin10" style\x3d"display: inline-block;"\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"visibleCheckboxDiv" style\x3d"display: inline-block;"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"symbolChooserSection"\x3e\r\n    \x3clabel\x3e${nls.symbol}:\x3c/label\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"symbolChooserNode"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"layerOptionSection"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"layerOptionCheckboxDiv"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n'}});
define("dojo/_base/declare dojo/_base/lang dojo/_base/html dojo/on dojo/text!./FeatureSetEditorChooser.html dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin jimu/dijit/SymbolChooser jimu/dijit/CheckBox jimu/utils esri/symbols/jsonUtils ../BaseEditor dijit/form/RadioButton".split(" "),function(f,b,a,c,g,h,k,l,e,m,n,p){return f([p,h,k],{baseClass:"jimu-gp-editor-base jimu-gp-editor-fsec",templateString:g,editorName:"FeatureSetEditorChooser",postCreate:function(){this.inherited(arguments);this.value=
{};this.featureSetUrl.set("placeholder",this.nls.urlPlaceholder);this.visibleCheckbox=new e({checked:"url"===this.param.featureSetMode&&this.param.showUrlContent,label:this.nls.showLayerContent,onChange:b.hitch(this,this._viewLayerContent)});this.visibleCheckbox.placeAt(this.visibleCheckboxDiv);this.layerOptionCheckbox=new e({checked:"layers"===this.param.featureSetMode&&this.param.useFeatureCollection,label:this.nls.useFeatureCollection,onChange:b.hitch(this,this._layerOptionChanged)});this.layerOptionCheckbox.placeAt(this.layerOptionCheckboxDiv);
this.param.defaultValue&&"esriGeometryPolygon"===this.param.defaultValue.geometryType?a.setStyle(this.mapModeWrapper,"display","block"):a.setStyle(this.mapModeWrapper,"display","none");"url"===this.param.featureSetMode&&this.param.featureSetUrl&&this.featureSetUrl.setValue(this.param.featureSetUrl);this.own(c(this.mapMode,"click",b.hitch(this,this._onMapModeSelect)));this.own(c(this.drawMode,"click",b.hitch(this,this._onDrawModeSelect)));this.own(c(this.fileMode,"click",b.hitch(this,this._onFileModeSelect)));
this.own(c(this.layersMode,"click",b.hitch(this,this._onLayersModeSelect)));this.own(c(this.urlMode,"click",b.hitch(this,this._onUrlModeSelect)));switch(this.param.featureSetMode){case "map":this.mapMode.set("checked",!0);this._onMapModeSelect();break;case "draw":this.drawMode.set("checked",!0);this._onDrawModeSelect();break;case "file":this.fileMode.set("checked",!0);this._onFileModeSelect();break;case "layers":this.layersMode.set("checked",!0);this._onLayersModeSelect();break;case "url":this.urlMode.set("checked",
!0),this._onUrlModeSelect()}},getValue:function(){this.featureSetUrl.value&&(this.value.featureSetUrl=this.featureSetUrl.value);this.symbolChooser&&"block"===a.getStyle(this.symbolChooserSection,"display")&&(this.value.symbol=this.symbolChooser.getSymbol().toJson());"url"===this.value.featureSetMode&&(this.value.showUrlContent=this.visibleCheckbox.getValue());"layers"===this.value.featureSetMode&&(this.value.useFeatureCollection=this.layerOptionCheckbox.getValue());return this.value},_onMapModeSelect:function(){a.setStyle(this.symbolChooserSection,
"display","none");a.setStyle(this.urlOptionsDiv,"display","none");a.setStyle(this.layerOptionSection,"display","none");this.value.featureSetMode="map"},_onDrawModeSelect:function(){this._showSymbolChooser();a.setStyle(this.urlOptionsDiv,"display","none");a.setStyle(this.layerOptionSection,"display","none");this.value.featureSetMode="draw"},_showSymbolChooser:function(){if(this.param.defaultValue&&this.param.defaultValue.geometryType){if(!this.symbolChooser){var d={};this.param.symbol?d.symbol=n.fromJson(this.param.symbol):
d.type=m.getSymbolTypeByGeometryType(this.param.defaultValue.geometryType);this.symbolChooser=new l(d,this.symbolChooserNode);this.symbolChooser.startup()}a.setStyle(this.symbolChooserSection,"display","block")}else a.setStyle(this.symbolChooserSection,"display","none")},_onLayersModeSelect:function(){a.setStyle(this.symbolChooserSection,"display","none");a.setStyle(this.urlOptionsDiv,"display","none");a.setStyle(this.layerOptionSection,"display","");this.value.featureSetMode="layers"},_onFileModeSelect:function(){a.setStyle(this.symbolChooserSection,
"display","none");a.setStyle(this.urlOptionsDiv,"display","none");a.setStyle(this.layerOptionSection,"display","none");this.value.featureSetMode="file"},_onUrlModeSelect:function(){a.setStyle(this.urlOptionsDiv,"display","");a.setStyle(this.layerOptionSection,"display","none");this.visibleCheckbox.getValue()?this._showSymbolChooser():a.setStyle(this.symbolChooserSection,"display","none");this.value.featureSetMode="url"},_viewLayerContent:function(d){d?this._showSymbolChooser():a.setStyle(this.symbolChooserSection,
"display","none")}})});