/*
 COPYRIGHT 2009 ESRI

 TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
 Unpublished material - all rights reserved under the
 Copyright Laws of the United States and applicable international
 laws, treaties, and conventions.

 For additional information, contact:
 Environmental Systems Research Institute, Inc.
 Attn: Contracts and Legal Services Department
 380 New York Street
 Redlands, California, 92373
 USA

 email: contracts@esri.com
 */
//>>built
require({cache:{"url:esri/dijit/editing/templates/Editor.html":"<div class=\"esriEditor\">\r\n    <div class=\"esriTemplatePicker\" dojoAttachPoint=\"templatePickerDiv\"></div>\r\n    <div class=\"esriDrawingToolbar\" dojoAttachPoint=\"drawingToolbarDiv\"></div>\r\n    <div class=\"progressBar\" dojoAttachPoint=\"progressBar\" indeterminate=\"true\" dojoType=\"dijit.ProgressBar\" />\r\n</div>"}});define("esri/dijit/editing/Editor",["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/_base/kernel","dojo/has","dojo/query","dojo/DeferredList","dojo/dom-class","dojo/dom-construct","dijit/_Widget","dijit/_Templated","esri/domUtils","esri/graphicsUtils","esri/geometry/Polyline","esri/geometry/Polygon","esri/graphic","esri/undoManager","esri/tasks/query","esri/layers/FeatureLayer","esri/layers/FeatureTemplate","esri/toolbars/draw","esri/toolbars/edit","esri/dijit/AttributeInspector","esri/dijit/editing/Util","esri/dijit/editing/Add","esri/dijit/editing/Update","esri/dijit/editing/Delete","esri/dijit/editing/toolbars/Drawing","esri/dijit/editing/SelectionHelper","esri/dijit/editing/TemplatePicker","esri/kernel","esri/config","dojo/i18n!esri/nls/jsapi","dojo/text!esri/dijit/editing/templates/Editor.html","dijit/ProgressBar","dojo/NodeList-dom"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,_f,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,Add,_1a,_1b,_1c,_1d,_1e,_1f,_20,_21,_22){var _23=_1([_b,_c],{declaredClass:"esri.dijit.editing.Editor",widgetsInTemplate:true,templateString:_22,constructor:function(_24,_25){_24=_24||{};if(!_24.settings){console.error("Editor: please provide 'settings' parameter in the constructor");}if(!_24.settings.layerInfos){console.error("Editor: please provide 'layerInfos' parameter in the constructor");}this._settings=_24.settings;this._eConnects=[];},postCreate:function(){this._setDefaultOptions();var _26=this._settings.layerInfos;if(_3.every(_26,function(_27){return _27.featureLayer.loaded;})){this._initLayers();this._connectEvents();this._createWidgets();}else{var _28=_26.length;_3.forEach(_26,function(_29){var _2a=_29.featureLayer;if(_2a.loaded){_28--;}else{var _2b=_4.connect(_2a,"onLoad",this,function(_2c){_4.disconnect(_2b);_2b=null;_28--;if(!_28){this._initLayers();this._connectEvents();this._createWidgets();}});}},this);}this._reset();this._enableMapClickHandler();},stopEditing:function(_2d){this._updateCurrentFeature(_2.hitch(this,function(){this._clearSelection(false);_2d&&_2d();}));},destroy:function(){if(this.drawingToolbar){this.drawingToolbar.destroy();}if(this.attributeInspector){this.attributeInspector.destroy();}if(this.templatePicker){this.templatePicker.destroy();}if(this._selectionHelper){this._selectionHelper.destroy();}if(this._drawToolbar){this._drawToolbar.deactivate();}this._reset();this._disableMapClickHandler();_3.forEach(this._eConnects,_4.disconnect);_4.disconnect(this._dtConnect);_4.disconnect(this._templatePickerOnSelectionChangeEvent);this._layer=this._currentGraphic=this._activeType=this._activeTemplate=this._drawingTool=this._drawToolbar=this._editToolbar=this.drawingToolbar=this.attributeInspector=this.templatePicker=this.undoManager=null;if(this._settings.map.infoWindow&&this._settings.map.infoWindow.clearFeatures){this._settings.map.infoWindow.clearFeatures();}this.inherited(arguments);},_setDefaultOptions:function(){this._drawToolbar=this._settings.drawToolbar||new _16(this._settings.map);this._settings.drawToolbar=this._drawToolbar;this._editToolbar=this._settings.editToolbar||new _17(this._settings.map);this._settings.editToolbar=this._editToolbar;this._settings.toolbarVisible=this._settings.toolbarVisible||false;this._settings.toolbarOptions=_2.mixin({reshapeVisible:false,cutVisible:false,mergeVisible:false},this._settings.toolbarOptions);this._settings.createOptions=_2.mixin({polylineDrawTools:[_23.CREATE_TOOL_POLYLINE],polygonDrawTools:[_23.CREATE_TOOL_POLYGON],editAttributesImmediately:true},this._settings.createOptions);this._settings.singleSelectionTolerance=this._settings.singleSelectionTolerance||3;this._settings.maxUndoRedoOperations=this._settings.maxUndoRedoOperations||10;this._settings.editor=this;this._usePopup=this._settings.usePopup=this._settings.map.infoWindow._setPagerCallbacks?true:false;this._datePackage=this._settings.datePackage;var _2e=_20.defaults;this._settings.geometryService=this._settings.geometryService||_2e.geometryService;_2e.geometryService=_2e.geometryService||this._settings.geometryService;},_initLayers:function(){this._settings.layers=[];this._settings.userIds={};this._settings.createOnlyLayer={};var _2f=this._settings.layerInfos;_3.forEach(_2f,function(_30){if(_30.featureLayer&&_30.featureLayer.loaded){this._settings.layers.push(_30.featureLayer);var _31=_30.featureLayer.id;if(_30.featureLayer.credential){this._settings.userIds[_31]=_30.featureLayer.credential.userId;}if(_30.userId){this._settings.userIds[_31]=_30.userId;}var _32=_30.featureLayer.getEditCapabilities();if(_32.canCreate&&!_32.canUpdate){this._settings.createOnlyLayer[_31]=true;}else{this._settings.createOnlyLayer[_31]=false;}}},this);},_reset:function(){this._hideAttributeInspector();this._editToolbar.deactivate();this._editVertices=true;this._layer=null;this._currentGraphic=null;this._activeType=null;this._activeTemplate=null;this._drawingTool=null;this._attributeChanged=false;},_saveFeatureOnClient:function(_33){var _34=this.templatePicker.getSelected();var _35;if(_34.template){_35=_34.featureLayer.renderer.getSymbol(_34.template.prototype);}else{_35=_34.symbolInfo.symbol;}var _36=_34.featureLayer.fields;var att={};_3.forEach(_36,function(_37,idx){att[_37.name]=null;});this._tempGraphic=new _11(_33,_35,att,null);var map=this._settings.map;map.graphics.add(this._tempGraphic);var _38=this._findCenterPoint(_33);this._createAttributeInspector(true);map.infoWindow.setTitle(_34.featureLayer?_34.featureLayer.name:_21.widgets.attributeInspector.NLS_title);this.attributeInspector.showFeature(this._tempGraphic,_34.featureLayer);this._showInfoWindow(_38,map.getInfoWindowAnchor(_38));if(this._settings.createOnlyLayer[_34.featureLayer.id]){this._infoWindowHideEvent=_4.connect(map.infoWindow,"onHide",this,"_infoWindowHide");}_4.disconnect(this._templatePickerOnSelectionChangeEvent);this.templatePicker.clearSelection();this._drawToolbar.deactivate();this._enableMapClickHandler();if(this.drawingToolbar){this.drawingToolbar.deactivate();}this._templatePickerOnSelectionChangeEvent=_4.connect(this.templatePicker,"onSelectionChange",_2.hitch(this,"_onCreateFeature"));},_saveAttributesOnClient:function(_39,_3a,_3b){this._tempGraphic.attributes[_3a]=(typeof (_3b)==="number"&&isNaN(_3b))?null:_3b;},_infoWindowHide:function(){this._createFeature(this._tempGraphic.geometry,this._tempGraphic.attributes);_4.disconnect(this._infoWindowHideEvent);},_createFeature:function(_3c,_3d){this._editClickPoint=this._findCenterPoint(_3c);if(!_3c.rings){this._applyEdits([{layer:this._layer,adds:[this._createGraphic(_3c,_3d)]}]);return;}this._simplify(_3c,_2.hitch(this,function(_3e){if(this._drawingTool!==_15.TOOL_AUTO_COMPLETE_POLYGON){this._applyEdits([{layer:this._layer,adds:[this._createGraphic(_3e,_3d)]}]);}else{this._autoComplete(_3e,_2.hitch(this,function(_3f){if(_3f&&_3f.length){this._applyEdits([{layer:this._layer,adds:_3.map(_3f,_2.hitch(this,function(_40){return this._createGraphic(_40,_3d);}))}]);}}));}}));},_updateCurrentFeature:function(_41){var _42=this._isModified();if(_42){this._updateFeature(_42,_41);}else{if(_41){_41(false);}}},_updateFeature:function(_43,_44){var _45=_43.geometry;if(!_45.rings){this._applyEdits([{layer:_43.getLayer(),updates:[_43]}],_44);}else{this._simplify(_45,_2.hitch(this,function(_46){this._applyEdits([{layer:_43.getLayer(),updates:[_2.mixin(_43,{geometry:_46})]}],_44);}));}},_deleteFeature:function(_47,_48){var _49=[];if(!_47){var _4a=this._settings.layers;_49=_3.map(_3.filter(_4a,function(_4b){return _4b.getSelectedFeatures().length>0;}),function(_4c){return {layer:_4c,deletes:_4c.getSelectedFeatures()};});if((!_49||!_49.length)&&this._currentGraphic){_49.push({layer:this._layer,deletes:[this._currentGraphic]});}}else{_49.push({layer:_47.getLayer(),deletes:[_47]});}this._applyEdits(_49,(_48));},_stopEditing:function(_4d,_4e,_4f,_50){_d.hide(this.progressBar.domNode);this._undoRedoAdd();var _51;if(_4d._isSelOnly===true){if(_4e&&_4e.length){this.templatePicker.clearSelection();var _52=new _13();_52.objectIds=[_4e[0].objectId];if(!this._settings.createOnlyLayer[_4d.id]){this._selectFeatures([_4d],_52,_2.hitch(this,"_onEditFeature"));}else{this._settings.map.graphics.remove(this._tempGraphic);}}}else{_51=this._selectionHelper.findMapService(this._settings.map,_4d);if(_51){_51.refresh();}if(_4e&&_4e.length){this.templatePicker.clearSelection();if(!this._settings.createOnlyLayer[_4d.id]){_19.findFeatures(_4e,_4d,_2.hitch(this,"_onEditFeature"));}else{this._settings.map.graphics.remove(this._tempGraphic);}}}if(_50&&_50.length){this._clearSelection(true);if(this._undoRedo){_51=this._selectionHelper.findMapService(_4d,this._settings.map);if(_51){_51.refresh();}}}if(this._undoRedo&&_4f&&_4f.length){_51=this._selectionHelper.findMapService(_4d,this._settings.map);if(_51){_51.refresh();}this.attributeInspector.refresh();this._undoRedo=false;}if(this.drawingToolbar){this.drawingToolbar._updateUI();}this._undoRedo=false;},_undoRedoAdd:function(){this._settings._isApplyEditsCall=false;if(!this._settings.undoManager){return;}if(this._activeTool==="CUT"||this._activeTool==="UNION"){return;}var _53=(this._edits&&this._edits.length)?this._edits[0]:null;if(!_53){return;}var _54=_53.adds||[];var _55=_53.updates||[];var _56=_53.deletes||[];var _57={featureLayer:_53.layer};if(_54.length){this.undoManager.add(new Add(_2.mixin(_57,{addedGraphics:_54})));}else{if(_56.length){this.undoManager.add(new _1b(_2.mixin(_57,{deletedGraphics:_56})));}else{if(_55.length){this.undoManager.add(new _1a(_2.mixin(_57,{preUpdatedGraphics:[this._preUpdates],postUpdatedGraphics:_55})));}}}this._edits=null;this._preUpdates=null;},_activateDrawToolbar:function(_58){this._layer=_58.featureLayer;this._activeType=_58.type;this._activeTemplate=_58.template;this._drawingTool=this._activeTemplate?this._activeTemplate.drawingTool:null;this._drawTool=this._toDrawTool(this._drawingTool,_58.featureLayer);_4.disconnect(this._dtConnect);if(this._settings.createOnlyLayer[_58.featureLayer.id]){this._dtConnect=_4.connect(this._drawToolbar,"onDrawEnd",this,"_saveFeatureOnClient");}else{this._dtConnect=_4.connect(this._drawToolbar,"onDrawEnd",this,"_createFeature");}this._editToolbar.deactivate();this._disableMapClickHandler();if(!this.drawingToolbar){this._drawToolbar.activate(this._drawTool);}else{this.drawingToolbar.activateEditing(this._drawTool,this._layer);}},_activateEditToolbar:function(_59,_5a){var _5b=_59.getLayer();var _5c=_5b?_5b.geometryType:null;var _5d=_17.MOVE;if(_5c!=="esriGeometryPoint"&&this._isNotesFeature(_59)===true){_5d=_5d|_17.ROTATE|_17.SCALE;this._editVertices=false;}else{if(_5c!=="esriGeometryPoint"&&this._editVertices===true){_5d=_5d|_17.ROTATE|_17.SCALE;this._editVertices=false;}else{_5d=_5d|_17.EDIT_VERTICES;this._editVertices=true;}}this._attributeChanged=this._isModified();this._preUpdates=new _11(_2.clone(_59.toJson()));var _5e=_5b.getEditCapabilities({feature:_59,userId:this._settings.userIds[_5b.id]});var _5f=_3.filter(this._settings.layerInfos,function(_60){return _60.featureLayer["layerId"]===_5b.layerId;})[0];if(_5e.canUpdate&&!_5f.disableGeometryUpdate&&_5b.allowGeometryUpdates){this._editToolbar.activate(_5d,_59);}if(!this._settings.map.infoWindow.isShowing){var _61=(_5a&&_5a.screenPoint)||this._findCenterPoint(_59);this._showInfoWindow(_61,this._settings.map.getInfoWindowAnchor(_61));}},_createGraphic:function(_62,_63){var _64=(this._activeType&&this._activeType.symbol)||this._layer.defaultSymbol;var _65=new _11(_62,_64,_63);if(this._activeTemplate||_63){_65.attributes=_63||_2.mixin({},this._activeTemplate.prototype.attributes);}else{_65.attributes=_65.attributes||[];_3.forEach(this._layer.fields,function(_66){_65.attributes[_66.name]=null;},this);}return _65;},_connectEvents:function(){var _67=this._settings.layers;_3.forEach(_67,function(_68){this._connect(_68,"onEditsComplete",_2.hitch(this,"_stopEditing",_68));},this);_3.forEach(_67,function(_69){this._connect(_69,"onBeforeApplyEdits",_2.hitch(this,function(){_d.show(this.progressBar.domNode);this._settings._isApplyEditsCall=true;}));},this);this._connect(this._editToolbar,"onGraphicClick",_2.hitch(this,"_activateEditToolbar"));this._connect(this._editToolbar,"onGraphicFirstMove",_2.hitch(this,"_hideAttributeInspector"));this._connect(this._editToolbar,"onVertexFirstMove",_2.hitch(this,"_hideAttributeInspector"));this._connect(this._editToolbar,"onScaleStart",_2.hitch(this,"_hideAttributeInspector"));this._connect(this._editToolbar,"onRotateStart",_2.hitch(this,"_hideAttributeInspector"));},_connect:function(_6a,evt,_6b){this._eConnects.push(_4.connect(_6a,evt,_6b));},_createWidgets:function(){this._selectionHelper=new _1d(this._settings);this._createTemplatePicker();this._createAttributeInspector();this._createDrawingToolbar();this._createUndoRedoManager();},_createTemplatePicker:function(){if(!this._settings.templatePicker){var _6c=_3.filter(this._settings.layers,function(_6d){return _6d.getEditCapabilities().canCreate;});this.templatePicker=new _1e({"class":"esriTemplatePicker",featureLayers:_6c,showTooltip:true,maxLabelLength:this._settings.typesCharacterLimit,columns:"auto",rows:"auto"},this.templatePickerDiv);this.templatePicker.startup();this._settings.templatePicker=this.templatePicker;}else{this.templatePicker=this._settings.templatePicker;_d.hide(this.templatePickerDiv);}this._templatePickerOnSelectionChangeEvent=_4.connect(this.templatePicker,"onSelectionChange",_2.hitch(this,"_onCreateFeature"));},_createAttributeInspector:function(_6e){if(!this._settings.attributeInspector){this._customAttributeInspector=false;var map=this._settings.map;this.attributeInspector=new _18({layerInfos:this._settings.layerInfos,hideNavButtons:this._usePopup,datePackage:this._datePackage},_a.create("div"));this.attributeInspector.startup();map.infoWindow.setContent(this.attributeInspector.domNode);map.infoWindow.setTitle(_21.widgets.attributeInspector.NLS_title);map.infoWindow.resize(350,375);_5.query(".esriAttributeInspector .atiLayerName").style({display:"none"});}else{this._customAttributeInspector=true;this.attributeInspector=this._settings.attributeInspector;}this._connect(this.attributeInspector,"onDelete",_2.hitch(this,"_deleteFeature"));this._connect(this.attributeInspector,"onNext",_2.hitch(this,function(_6f){this._updateCurrentFeature(_2.hitch(this,function(){this._attributeChanged=false;this._onEditFeature(_6f);}));}));if(this._usePopup){this._settings.map.infoWindow._setPagerCallbacks(this.attributeInspector,_2.hitch(this.attributeInspector,"next"),_2.hitch(this.attributeInspector,"previous"));}if(_6e){this._connect(this.attributeInspector,"onAttributeChange",_2.hitch(this,"_saveAttributesOnClient"));}else{this._connect(this.attributeInspector,"onAttributeChange",_2.hitch(this,function(_70,_71,_72){this._preUpdates=new _11(_2.clone(_70.toJson()));this._currentGraphic.attributes[_71]=(typeof (_72)==="number"&&isNaN(_72))?null:_72;this._updateFeature(this._currentGraphic,null);this._attributeChanged=false;}));}},_createDrawingToolbar:function(){if(this._settings.toolbarVisible===true){this.drawingToolbar=new _1c({"class":"esriDrawingToolbar",drawToolbar:this._drawToolbar,editToolbar:this._editToolbar,settings:this._settings,onDelete:_2.hitch(this,"_deleteFeature"),onApplyEdits:_2.hitch(this,"_applyEdits"),onShowAttributeInspector:_2.hitch(this,"_onEditFeature")},this.drawingToolbarDiv);}},_createUndoRedoManager:function(){if(!this._settings.enableUndoRedo&&!this._settings.undoManager){return;}this._settings.enableUndoRedo=true;this.undoManager=this._settings.undoManager;if(!this.undoManager){this.undoManager=this._settings.undoManager=new _12({maxOperations:this._settings.maxUndoRedoOperations});}this._connect(document,"onkeypress",_2.hitch(this,function(evt){if(evt.metaKey||evt.ctrlKey){if(evt.charOrCode==="z"){this._undo();}if(evt.charOrCode==="y"){this._redo();}}}));},_enableMapClickHandler:function(){this._mapClickHandler=_4.connect(this._settings.map,"onClick",_2.hitch(this,function(evt){if(this._drawToolbar._geometryType){return;}if(this._activeTool==="SELECT"){this._activeTool="";return;}this._updateCurrentFeature(_2.hitch(this,function(){this._reset();this._updateSelection(evt);}));}));},_disableMapClickHandler:function(){_4.disconnect(this._mapClickHandler);},_onCreateFeature:function(){var _73=this.templatePicker.getSelected();if(_73){this._updateCurrentFeature(_2.hitch(this,function(){if(this._currentGraphic){this._clearSelection(false);}this._reset();this._activateDrawToolbar(_73);}));}else{this._reset();_4.disconnect(this._dtConnect);this._drawToolbar.deactivate();this._enableMapClickHandler();if(this.drawingToolbar){this.drawingToolbar.deactivate();}}},_onEditFeature:function(_74,_75){_74=(_2.isArray(_74)?_74[0]:_74)||null;if(!_74){return;}if(!this._customAttributeInspector){_75=_75||this._editClickPoint||this._findCenterPoint(_74);var _76=_74.getLayer();this._settings.map.infoWindow.setTitle(_76?_76.name:_21.widgets.attributeInspector.NLS_title);if(this.drawingToolbar||!this._settings.map.infoWindow.isShowing){this._showInfoWindow(_75,this._settings.map.getInfoWindowAnchor(_75));}this._editClickPoint=null;}if(_74===this._currentGraphic){return;}this._editVertices=true;this._layer=_74.getLayer();this._currentGraphic=_74;if(_74.getDojoShape()){_74.getDojoShape().moveToFront();}this._activateEditToolbar(_74);},_applyEdits:function(_77,_78){_77=_77||[];if(_77.length<=0){return;}this._edits=_77;var _79=_3.map(_77,function(_7a){return _7a.layer.applyEdits(_7a.adds,_7a.updates,_7a.deletes);});this._deferredsList=new _8(_79).addCallback(_2.hitch(this,function(){_d.hide(this.progressBar.domNode);if(_78){_78();}var map=this._settings.map;if(map&&map.infoWindow.reposition&&map.infoWindow.isShowing){map.infoWindow.reposition();}}));},_undo:function(){if(this._settings.undoManager&&!this._settings._isApplyEditsCall){this._editToolbar.deactivate();this._undoRedo=true;this._settings.undoManager.undo();}},_redo:function(){if(this._settings.undoManager&&!this._settings._isApplyEditsCall){this._editToolbar.deactivate();this._undoRedo=true;this._settings.undoManager.redo();}},_simplify:function(_7b,_7c){if(_10.prototype.isSelfIntersecting(_7b)){this._settings.geometryService.simplify([_7b],function(_7d){var _7e=(_7d&&_7d.length)?_7d[0]:_7e;if(_7c){_7c(_7e);}});}else{if(_7c){_7c(_7b);}}},_autoComplete:function(_7f,_80){var _81=this._getLayers("esriGeometryPolygon");var _82=new _13();_82.geometry=_7f;_82.returnGeometry=true;this._selectFeatures(_81,_82,_2.hitch(this,function(_83){if(!_83||_83.length<=0){if(_80){_80([_7f]);}}else{this._settings.geometryService.autoComplete(_e.getGeometries(_83),this._toPolylines([_82.geometry]),function(_84){if(_80){_80(_84);}});}}));},_getLayers:function(_85){var _86=this._settings.layers;return _3.filter(_86,function(_87){return _87.geometryType===_85;});},_selectFeatures:function(_88,_89,_8a,_8b){this._selectionHelper.selectFeatures(_88,_89,_8b||_14.SELECTION_NEW,_8a);},_updateSelection:function(evt){var _8c=evt.mapPoint;var _8d=evt.graphic;this._selectionHelper.selectFeaturesByGeometry(this._settings.layers,_8c,_14.SELECTION_NEW,_2.hitch(this,function(_8e){var _8f=_3.some(_8e,_2.hitch(this,function(_90){return _90==_8d;}));if(_8d&&!_8f){var _91=_8d.getLayer();if(this._isValidLayer(_91)){var _92=new _13();_92.objectIds=[_8d.attributes[_91.objectIdField]];this._selectionHelper.selectFeatures([_91],_92,_14.SELECTION_ADD,_2.hitch(this,function(_93){this._updatePopupButtons(_93);this._onEditFeature(_93,_8c);}));}else{this._clearSelection();}}else{if(_8e&&_8e.length){this._updatePopupButtons(_8e);this._onEditFeature(_8e,_8c);}else{this._clearSelection();}}}));},_updatePopupButtons:function(_94){if(!this._usePopup||!_94){return;}var _95=_94.length;var _96=[this._settings.map.infoWindow._prevFeatureButton,this._settings.map.infoWindow._nextFeatureButton];_3.forEach(_96,_2.hitch(this,function(_97){(_95>1)?_9.remove(_97,"hidden"):_9.add(_97,"hidden");}));},_clearSelection:function(_98){this._selectionHelper.clearSelection(_98||false);this._reset();},_findCenterPoint:function(_99){var _9a=_99.geometry||_99;var _9b;switch(_9a.type){case "point":_9b=_9a;break;case "polyline":var _9c=_9a.paths[0].length;_9b=_9a.getPoint(0,Math.ceil(_9c/2));break;case "polygon":var _9d=_9a.rings.length-1;var _9e=_9a.rings[_9d].length-1;_9b=_9a.getPoint(_9d,_9e);break;}return this._settings.map.toScreen(_9b);},_hideAttributeInspector:function(){if(!this._customAttributeInspector&&this._settings.map.infoWindow){this._settings.map.infoWindow.hide();}},_toPolylines:function(_9f){var _a0=_3.map(_9f,function(_a1){var _a2=new _f(_a1.spatialReference);_3.forEach(_a1.rings,function(_a3){_a2.addPath(_a3);});return _a2;});return _a0;},_isNotesFeature:function(_a4){var _a5=_a4.getLayer();var _a6=_a5?_a5.types||null:null;if(!_a6){return false;}var _a7=_a4.attributes[_a5.typeIdField];var _a8;_3.some(_a6,function(_a9){if(_a9.id===_a7){_a8=_a9.templates;return true;}return false;});if(!_a8){return false;}var _aa=_a8[0]||null;if(!_aa){return false;}var _ab=this._isShapeTool(_aa.drawingTool)||null;return _ab?true:false;},_isValidLayer:function(_ac){var i;var _ad=this._settings.layerInfos;for(i=0;i<_ad.length;i++){var _ae=_ad[i];if(_ac.id==_ae.layerId){return true;}}return false;},_isShapeTool:function(_af){switch(_af){case _15.TOOL_ARROW:return _16.ARROW;case _15.TOOL_LEFT_ARROW:return _16.LEFT_ARROW;case _15.TOOL_RIGHT_ARROW:return _16.RIGHT_ARROW;case _15.TOOL_UP_ARROW:return _16.UP_ARROW;case _15.TOOL_DOWN_ARROW:return _16.DOWN_ARROW;case _15.TOOL_CIRCLE:return _16.CIRCLE;case _15.TOOL_ELLIPSE:return _16.ELLIPSE;case _15.TOOL_TRIANGLE:return _16.TRIANGLE;case _15.TOOL_RECTANGLE:return _16.RECTANGLE;default:return null;}},_toDrawTool:function(_b0,_b1){var _b2=_b1.geometryType;switch(_b0){case _15.TOOL_POINT:return _16.POINT;case _15.TOOL_ARROW:return _16.ARROW;case _15.TOOL_LEFT_ARROW:return _16.LEFT_ARROW;case _15.TOOL_RIGHT_ARROW:return _16.RIGHT_ARROW;case _15.TOOL_UP_ARROW:return _16.UP_ARROW;case _15.TOOL_DOWN_ARROW:return _16.DOWN_ARROW;case _15.TOOL_CIRCLE:return _16.CIRCLE;case _15.TOOL_ELLIPSE:return _16.ELLIPSE;case _15.TOOL_TRIANGLE:return _16.TRIANGLE;case _15.TOOL_RECTANGLE:return _16.RECTANGLE;case _15.TOOL_LINE:return _16.POLYLINE;case _15.TOOL_POLYGON:return _16.POLYGON;case _15.TOOL_FREEHAND:if(_b2==="esriGeometryPolyline"){return _16.FREEHAND_POLYLINE;}else{return _16.FREEHAND_POLYGON;}break;default:var _b3=_16.POINT;if(_b2==="esriGeometryPolyline"){_b3=_16.POLYLINE;if(this._settings.createOptions.polylineDrawTools[0]===_23.CREATE_TOOL_FREEHAND_POLYLINE){_b3=_16.FREEHAND_POLYLINE;}}else{if(_b2==="esriGeometryPolygon"){_b3=_16.POLYGON;if(this._settings.createOptions.polygonDrawTools[0]===_23.CREATE_TOOL_FREEHAND_POLYGON){_b3=_16.FREEHAND_POLYGON;}}}return _b3;}},_isModified:function(){var _b4=this._editToolbar.getCurrentState();return ((_b4.isModified||this._attributeChanged)&&_b4.graphic)?_b4.graphic:null;},_showInfoWindow:function(_b5,_b6){if(!this._customAttributeInspector){this._settings.map.infoWindow.show(_b5,_b6);}}});_2.mixin(_23,{CREATE_TOOL_POLYLINE:"polyline",CREATE_TOOL_FREEHAND_POLYLINE:"freehandpolyline",CREATE_TOOL_POLYGON:"polygon",CREATE_TOOL_FREEHAND_POLYGON:"freehandpolygon",CREATE_TOOL_AUTOCOMPLETE:"autocomplete",CREATE_TOOL_RECTANGLE:"rectangle",CREATE_TOOL_TRIANGLE:"triangle",CREATE_TOOL_CIRCLE:"circle",CREATE_TOOL_ELLIPSE:"ellipse",CREATE_TOOL_ARROW:"arrow",CREATE_TOOL_UP_ARROW:"uparrow",CREATE_TOOL_DOWN_ARROW:"downarrow",CREATE_TOOL_RIGHT_ARROW:"rightarrow",CREATE_TOOL_LEFT_ARROW:"leftarrow"});if(_6("extend-esri")){_2.setObject("dijit.editing.Editor",_23,_1f);}return _23;});