/*
 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:{"esri/tasks/ImageServiceIdentifyTask":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","esri/kernel","esri/request","esri/geometry/normalizeUtils","esri/tasks/Task","esri/tasks/ImageServiceIdentifyResult"],function(_1,_2,_3,_4,_5,_6,_7,_8){var _9=_1(_7,{declaredClass:"esri.tasks.ImageServiceIdentifyTask",constructor:function(_a){this._url.path+="/identify";this._handler=_2.hitch(this,this._handler);},__msigns:[{n:"execute",c:3,a:[{i:0,p:["geometry"]}],e:2}],_handler:function(_b,io,_c,_d,_e){try{var _f=new _8(_b);this._successHandler([_f],"onComplete",_c,_e);}catch(err){this._errorHandler(err,_d,_e);}},execute:function(_10,_11,_12,_13){var _14=_13.assembly,_15=this._encode(_2.mixin({},this._url.query,{f:"json"},_10.toJson(_14&&_14[0]))),_16=this._handler,_17=this._errorHandler;return _5({url:this._url.path,content:_15,callbackParamName:"callback",load:function(r,i){_16(r,i,_11,_12,_13.dfd);},error:function(r){_17(r,_12,_13.dfd);}});},onComplete:function(){}});_6._createWrappers(_9);if(_3("extend-esri")){_2.setObject("tasks.ImageServiceIdentifyTask",_9,_4);}return _9;});},"esri/layers/OnDemandMode":function(){define(["dojo/_base/declare","dojo/_base/connect","dojo/_base/lang","dojo/_base/array","dojo/has","esri/kernel","esri/geometry/Point","esri/tasks/query","esri/layers/RenderMode","esri/layers/GridLayout"],function(_18,_19,_1a,_1b,has,_1c,_1d,_1e,_1f,_20){var _21=_18([_1f],{declaredClass:"esri.layers._OnDemandMode",constructor:function(_22){this.featureLayer=_22;this._featureMap={};this._queryErrorHandler=_1a.hitch(this,this._queryErrorHandler);},initialize:function(map){this.inherited(arguments);var _23=this.featureLayer,_24=_23._srInfo;this._gridLayer=new _20(new _1d(_24?_24.valid[0]:map.extent.xmin,map.extent.ymax,map.spatialReference),{width:_23._tileWidth,height:_23._tileHeight},{width:map.width,height:map.height},_24);this._cellMap={};this._gridLayer.setResolution(map.extent);},startup:function(){this._ioQueue=[];if(!this.featureLayer.suspended){this._zoomHandler();this._enableConnectors();}},propertyChangeHandler:function(_25){if(this._init){if(_25<2){this._zoomHandler();}else{console.log("FeatureLayer: layer in on-demand mode does not support time definitions. Layer id = "+this.featureLayer.id+", Layer URL = "+this.featureLayer.url);}}},destroy:function(){this._disableConnectors();this.inherited(arguments);},drawFeature:function(_26){var _27=this._gridLayer,_28=_26.geometry,_29=[];if(!_28){return;}_29=_27.getCellsInExtent((_28.type==="point")?{xmin:_28.x,ymin:_28.y,xmax:_28.x,ymax:_28.y}:_28.getExtent(),false).cells;var _2a=this._cellMap,i,_2b,oid=_26.attributes[this.featureLayer.objectIdField],_2c,row,col;for(i=0;i<_29.length;i++){_2b=_29[i];_2c=_2b.latticeID;row=_2b.row;col=_2b.col;if(_2c){_2b=(_2a[_2c]=(_2a[_2c]||_2b));}else{_2a[row]=_2a[row]||{};_2b=(_2a[row][col]=(_2a[row][col]||_2b));}_2b.features=_2b.features||[];_2b.features.push(_26);this._addFeatureIIf(oid,_26);this._incRefCount(oid);}},suspend:function(){if(!this._init){return;}this._disableConnectors();},resume:function(){if(!this._init){return;}this._enableConnectors();this._zoomHandler();},refresh:function(){this._zoomHandler();},_enableConnectors:function(){var map=this.map;this._zoomConnect=_19.connect(map,"onZoomEnd",this,this._zoomHandler);this._panConnect=_19.connect(map,"onPanEnd",this,this._panHandler);this._resizeConnect=_19.connect(map,"onResize",this,this._panHandler);},_disableConnectors:function(){_19.disconnect(this._zoomConnect);_19.disconnect(this._panConnect);_19.disconnect(this._resizeConnect);},_zoomHandler:function(){this._processIOQueue(true);var _2d=this.featureLayer,map=this.map;if(_2d.suspended){return;}_2d._fireUpdateStart();this._clearIIf();var _2e=_2d._trackManager;if(_2e){_2e.clearTracks();}this._cellMap={};this._gridLayer.setResolution(map.extent);this._sendRequest();},_panHandler:function(){this.featureLayer._fireUpdateStart();this._sendRequest(this.featureLayer._resized&&arguments[0]);},_getRequestId:function(_2f,_30){var id="_"+_2f.name+_2f.layerId+_2f._ulid+"_"+_30.resolution+"_"+(_30.latticeID||(_30.row+"_"+_30.col));return id.replace(/[^a-zA-Z0-9\_]+/g,"_");},_sendRequest:function(_31){this._exceeds=false;var _32=this.featureLayer,map=this.map,_33=_31||map.extent,_34=this._gridLayer.getCellsInExtent(_33,_32.latticeTiling),_35=_34.cells;if(!_32.isEditable()){var _36=this._cellMap;_35=_1b.filter(_35,function(_37){if(_37.lattice){if(_36[_37.latticeID]){return false;}}else{if(_36[_37.row]&&_36[_37.row][_37.col]){return false;}}return true;});}var _38=_32.getOutFields(),_39=_32.getDefinitionExpression(),_3a=_32._getOffsettedTE(_32._mapTimeExtent),_3b=_32._usePatch,_3c=this._ioQueue,i,_3d=this,_3e=this._drawFeatures,_3f,_40,_41;this._pending=this._pending||0;for(i=0;i<_35.length;i++){_3f=_35[i];_40=new _1e();_40.geometry=_3f.extent||_3f.lattice;_40.outFields=_38;_40.where=_39;if(_32.latticeTiling&&_3f.extent){_40.spatialRelationship=_1e.SPATIAL_REL_CONTAINS;}_40.returnGeometry=true;_40.timeExtent=_3a;_40.maxAllowableOffset=_32._maxOffset;if(_32._ts){_40._ts=(new Date()).getTime();}_41=null;if(_3b){_41=this._getRequestId(_32,_3f);if(this._isPending(_41)){continue;}}this._pending++;_3c.push(_32._task.execute(_40,function(){var _42=_3f;return function(_43){_3e.apply(_3d,[_43,_42]);};}.call(this),this._queryErrorHandler,_41));}this._removeOldCells(_33);this._endCheck();},_drawFeatures:function(_44,_45){this._exceeds=this._exceeds||_44.exceededTransferLimit;this._finalizeIO();var _46=this.featureLayer,map=this.map,_47=map.extent,_48=_45.extent,row=_45.row,col=_45.col,_49=_46.objectIdField,_4a=_44.features,_4b=this._gridLayer,_4c=this._cellMap,i,len,_4d=_45.latticeID,_4e=_4d?_4c[_4d]:(_4c[row]&&_4c[row][col]);if((_45.resolution!=_4b._resolution)||(_4d?(_4d!==_4b.getLatticeID(_47)):(!_4b.intersects(_48,_47)))){if(_4e){this._removeCell(row,col,_4d);}}else{if(_4e){this._updateCell(_4e,_4a);}else{_45.features=_4a;if(_4d){_4c[_4d]=_45;}else{_4c[row]=_4c[row]||{};_4c[row][col]=_45;}len=_4a.length;for(i=0;i<len;i++){var _4f=_4a[i];var oid=_4f.attributes[_49];this._addFeatureIIf(oid,_4f);this._incRefCount(oid);}}}this._endCheck();},_queryErrorHandler:function(err){this._finalizeIO();this.featureLayer._errorHandler(err);this._endCheck(true);},_finalizeIO:function(){this._purgeRequests();this._pending--;},_endCheck:function(_50){if(this._pending===0){this._processIOQueue();var _51=this.featureLayer,_52=_51._trackManager;if(_52){_52.clearTracks();_52.addFeatures(_51.graphics);if(_51._ager){_1b.forEach(_51.graphics,function(_53){if(_53._shape){_51._repaint(_53);}});}_52.moveLatestToFront();_52.drawTracks();}this.featureLayer._fireUpdateEnd(_50&&new Error("FeatureLayer: an error occurred while updating the layer"),this._exceeds?{queryLimitExceeded:true}:null);if(this._exceeds){_51.onQueryLimitExceeded();}}},_processIOQueue:function(_54){this._ioQueue=_1b.filter(this._ioQueue,function(dfd){var _55=dfd.fired>-1?false:true;return _55;});if(_54){_1b.forEach(this._ioQueue,this._cancelPendingRequest);}},_removeOldCells:function(_56){var _57=this._cellMap,_58=this._gridLayer,_59,_5a;for(_59 in _57){if(_57[_59]){var row=_57[_59],_5b=row.latticeID,_5c=0,_5d=0;if(_5b){_5c++;if(_5b!==_58.getLatticeID(_56)){this._removeCell(null,null,_5b);_5d++;}}else{for(_5a in row){if(row[_5a]){_5c++;var _5e=row[_5a].extent;if(!_58.intersects(_5e,_56)){this._removeCell(_59,_5a);_5d++;}}}}if(_5d===_5c){delete _57[_59];}}}},_updateCell:function(_5f,_60){var _61=this.featureLayer,_62=_61.objectIdField,_63=_61._selectedFeatures,i,len=_60.length;_5f.features=_5f.features||[];for(i=0;i<len;i++){var _64=_60[i];var oid=_64.attributes[_62];var _65=this._addFeatureIIf(oid,_64);if(_65===_64){this._incRefCount(oid);_5f.features.push(_65);}else{if(!(oid in _63)){_65.setGeometry(_64.geometry);_65.setAttributes(_64.attributes);}}}},_removeCell:function(row,col,_66){var _67=this._cellMap,_68=this.featureLayer,_69=_68.objectIdField;var _6a=_66?_67[_66]:(_67[row]&&_67[row][col]);if(_6a){if(_66){delete _67[_66];}else{delete _67[row][col];}var _6b=_6a.features,i;for(i=0;i<_6b.length;i++){var _6c=_6b[i];var oid=_6c.attributes[_69];this._decRefCount(oid);if(oid in _68._selectedFeatures){continue;}this._removeFeatureIIf(oid);}}}});if(has("extend-esri")){_1a.setObject("layers._OnDemandMode",_21,_1c);}return _21;});},"esri/dijit/_EventedWidget":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/aspect","dojo/on","esri/Evented","dijit/_WidgetBase"],function(_6d,_6e,_6f,on,_70,_71){var EWM=_6d([_70,_71],{_onMap:function(_72){var _73=this.constructor._onMap,_74,_75;if(!_73){_73=this.registerConnectEvents();}_72=_72.toLowerCase();if(_73[_72]){_74=this[_73[_72].name];}else{_75=this._onCamelCase(_72);if(this[_75]){_74=_75;}}return _74;},on:function(_76,_77){_70.prototype.on.apply(this,arguments);return this.inherited(arguments);},emit:function(_78,_79,_7a){var _7b,_7c,_7d,_7e=_78.toLowerCase(),_7f=this.constructor._onMap||this.registerConnectEvents();_7c=this[this._onMap(_7e)];_79=_79||{};if(!_79.target){_79.target=this;}if(_7c&&_7f&&_7f[_7e]){this._onObj2Arr(function(){_7b=Array.prototype.slice.call(arguments);},_7f[_7e].argKeys)(_79);_7d=_6e.mixin({},arguments);_7d[2]=_7b;_7d[0]=_7f[_7e].name.replace(/^on/,"");}return this.inherited(_7d||arguments);}});return EWM;});},"dijit/a11y":function(){define("dijit/a11y",["dojo/_base/array","dojo/_base/config","dojo/_base/declare","dojo/dom","dojo/dom-attr","dojo/dom-style","dojo/sniff","./main"],function(_80,_81,_82,dom,_83,_84,has,_85){var _86=(_85._isElementShown=function(_87){var s=_84.get(_87);return (s.visibility!="hidden")&&(s.visibility!="collapsed")&&(s.display!="none")&&(_83.get(_87,"type")!="hidden");});_85.hasDefaultTabStop=function(_88){switch(_88.nodeName.toLowerCase()){case "a":return _83.has(_88,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var _89;try{var _8a=_88.contentDocument;if("designMode" in _8a&&_8a.designMode=="on"){return true;}_89=_8a.body;}catch(e1){try{_89=_88.contentWindow.document.body;}catch(e2){return false;}}return _89&&(_89.contentEditable=="true"||(_89.firstChild&&_89.firstChild.contentEditable=="true"));default:return _88.contentEditable=="true";}};var _8b=(_85.isTabNavigable=function(_8c){if(_83.get(_8c,"disabled")){return false;}else{if(_83.has(_8c,"tabIndex")){return _83.get(_8c,"tabIndex")>=0;}else{return _85.hasDefaultTabStop(_8c);}}});_85._getTabNavigable=function(_8d){var _8e,_8f,_90,_91,_92,_93,_94={};function _95(_96){return _96&&_96.tagName.toLowerCase()=="input"&&_96.type&&_96.type.toLowerCase()=="radio"&&_96.name&&_96.name.toLowerCase();};var _97=function(_98){for(var _99=_98.firstChild;_99;_99=_99.nextSibling){if(_99.nodeType!=1||(has("ie")<=9&&_99.scopeName!=="HTML")||!_86(_99)){continue;}if(_8b(_99)){var _9a=+_83.get(_99,"tabIndex");if(!_83.has(_99,"tabIndex")||_9a==0){if(!_8e){_8e=_99;}_8f=_99;}else{if(_9a>0){if(!_90||_9a<_91){_91=_9a;_90=_99;}if(!_92||_9a>=_93){_93=_9a;_92=_99;}}}var rn=_95(_99);if(_83.get(_99,"checked")&&rn){_94[rn]=_99;}}if(_99.nodeName.toUpperCase()!="SELECT"){_97(_99);}}};if(_86(_8d)){_97(_8d);}function rs(_9b){return _94[_95(_9b)]||_9b;};return {first:rs(_8e),last:rs(_8f),lowest:rs(_90),highest:rs(_92)};};_85.getFirstInTabbingOrder=function(_9c,doc){var _9d=_85._getTabNavigable(dom.byId(_9c,doc));return _9d.lowest?_9d.lowest:_9d.first;};_85.getLastInTabbingOrder=function(_9e,doc){var _9f=_85._getTabNavigable(dom.byId(_9e,doc));return _9f.last?_9f.last:_9f.highest;};return {hasDefaultTabStop:_85.hasDefaultTabStop,isTabNavigable:_85.isTabNavigable,_getTabNavigable:_85._getTabNavigable,getFirstInTabbingOrder:_85.getFirstInTabbingOrder,getLastInTabbingOrder:_85.getLastInTabbingOrder};});},"esri/layers/ServiceGeneratedFeatureCollection":function(){define(["dojo/_base/declare","dojo/_base/connect","dojo/_base/lang","dojo/_base/array","dojo/dom-construct","dojo/dom-style","dojo/has","esri/kernel","esri/SpatialReference","esri/geometry/Extent","esri/geometry/webMercatorUtils","esri/renderers/SimpleRenderer","esri/layers/layer","esri/layers/FeatureLayer","esri/dijit/PopupTemplate"],function(_a0,_a1,_a2,_a3,_a4,_a5,has,_a6,_a7,_a8,_a9,_aa,_ab,_ac,_ad){var _ae=_a0([_ab],{declaredClass:"esri.layers._ServiceGeneratedFeatureCollection",constructor:function(url,_af){this.pointSymbol=_af&&_af.pointSymbol;this.polylineSymbol=_af&&_af.polylineSymbol;this.polygonSymbol=_af&&_af.polygonSymbol;this._outSR=(_af&&(_af.outSpatialReference||_af.outSR))||new _a7({wkid:4326});this._options=_af;},parse:function(){console.error("parse function has not been implemented");},getFeatureLayers:function(){var _b0=[];if(this._fLayers){_b0=_b0.concat(this._fLayers);}return _b0;},onRefresh:function(){},refresh:function(){if(!this.loaded||!this._map||this._io){return;}this._createLayer();},_createLayer:function(_b1){var _b2=this;this._fireUpdateStart();var _b3=this.parse(_b1);_b3.addCallback(function(_b4){_b2._io=null;_b2._initLayer(_b4);});_b3.addErrback(function(err){_b2._io=null;err=_a2.mixin(new Error(),err);err.message="Unable to load resource: "+_b2.url+" "+(err.message||"");_b2._fireUpdateEnd(err);_b2.onError(err);});},_initLayer:function(_b5){if(this.loaded){this._removeInternalLayers();}this.name=_b5.name;this.description=_b5.description;this.snippet=_b5.snippet;if(_b5.visibility!==undefined){this.defaultVisibility=this.visible=!!_b5.visibility;}else{this.defaultVisibility=this.visible=true;}this.featureInfos=_b5.featureInfos;this.fullExtent=this.initialExtent=new _a8(_b5.lookAtExtent);this.copyright=_b5.author||_b5.copyright;var _b6;var _b7=_a2.getObject("featureCollection.layers",false,_b5);if(_b7&&_b7.length>0){this._fLayers=[];_a3.forEach(_b7,function(_b8,i){var _b9=_a2.getObject("featureSet.features",false,_b8),_ba;if(_b9&&_b9.length>0){_b6=_a2.mixin({outFields:["*"],infoTemplate:_b8.popupInfo?new _ad(_b8.popupInfo):null,editable:false},this._options);if(_b6.id){_b6.id=_b6.id+"_"+i;}_b8.layerDefinition.capabilities="Query,Data";_ba=new _ac(_b8,_b6);if(_ba.geometryType){this["_"+_ba.geometryType]=_ba;}this._fLayers.push(_ba);}},this);if(this._fLayers.length===0){delete this._fLayers;}}this.items=[];if(this._esriGeometryPoint){this.items=this.items.concat(this._esriGeometryPoint.graphics);if(this.pointSymbol){var _bb=new _aa(this.pointSymbol);this._esriGeometryPoint.setRenderer(_bb);}}if(this._esriGeometryPolyline){this.items=this.items.concat(this._esriGeometryPolyline.graphics);if(this.polylineSymbol){var _bc=new _aa(this.polylineSymbol);this._esriGeometryPolyline.setRenderer(_bc);}}if(this._esriGeometryPolygon){this.items=this.items.concat(this._esriGeometryPolygon.graphics);if(this.polygonSymbol){var _bd=new _aa(this.polygonSymbol);this._esriGeometryPolygon.setRenderer(_bd);}}this._fireUpdateEnd();if(this.loaded){this._addInternalLayers();this.onRefresh();}},_addInternalLayers:function(){var map=this._map;this._fireUpdateStart();var _be=map.spatialReference,_bf=this._outSR,_c0;if(_be.wkid){_c0=(_be._isWebMercator()&&_bf._isWebMercator())||(_be.wkid===_bf.wkid);}else{if(_be.wkt){_c0=(_be.wkt===_bf.wkt);}else{console.log("_setMap - map has invalid spatial reference");return;}}if(!_c0){if(_be._isWebMercator()&&_bf.wkid===4326){this._converter=_a9.geographicToWebMercator;}else{if(_bf._isWebMercator()&&_be.wkid===4326){this._converter=_a9.webMercatorToGeographic;}else{console.log("_setMap - unsupported workflow. Spatial reference of the map and layer do not match, and the conversion cannot be done on the client.");return;}}}var _c1=this._fLayers;if(_c1&&_c1.length>0){_a3.forEach(_c1,function(_c2){if(this._converter){var _c3=_c2.graphics,i,_c4,len=_c3?_c3.length:0;for(i=0;i<len;i++){_c4=_c3[i].geometry;if(_c4){_c3[i].setGeometry(this._converter(_c4));}}}map.addLayer(_c2);},this);}this.setVisibility(this.visible);},_removeInternalLayers:function(){var map=this._map;if(map){_a3.forEach(this.getFeatureLayers(),map.removeLayer,map);}},onVisibilityChange:function(_c5){this._fireUpdateStart();_a3.forEach(this.getFeatureLayers(),function(_c6){_c6.setVisibility(_c5);});this._fireUpdateEnd();},_setMap:function(map,_c7){this.inherited(arguments);this._map=map;var div=this._div=_a4.create("div",null,_c7);_a5.set(div,"position","absolute");this._addInternalLayers();this.evaluateSuspension();return div;},_unsetMap:function(map,_c8){if(this._io){this._io.cancel();}_a1.disconnect(this._extChgHandle);delete this._extChgHandle;this._removeInternalLayers();var div=this._div;if(div){_c8.removeChild(div);_a4.destroy(div);}this._div=null;this.inherited(arguments);}});if(has("extend-esri")){_a2.setObject("layers._ServiceGeneratedFeatureCollection",_ae,_a6);}return _ae;});},"esri/layers/GeoRSSLayer":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/has","esri/kernel","esri/config","esri/request","esri/layers/ServiceGeneratedFeatureCollection"],function(_c9,_ca,_cb,has,_cc,_cd,_ce,_cf){var _d0=_c9([_cf],{declaredClass:"esri.layers.GeoRSSLayer",serviceUrl:location.protocol+"//utility.arcgis.com/sharing/rss",constructor:function(url,_d1){if(_cd.defaults.geoRSSService){this.serviceUrl=_cd.defaults.geoRSSService;}this._createLayer();},parse:function(){this._io=_ce({url:this.serviceUrl,content:{url:this.url,refresh:this.loaded?true:undefined,outSR:this._outSR?_cb.toJson(this._outSR.toJson()):undefined},callbackParamName:"callback"});return this._io;},_initLayer:function(_d2){this.inherited(arguments);if(!this.loaded){this.loaded=true;this.onLoad(this);}}});if(has("extend-esri")){_ca.setObject("layers.GeoRSSLayer",_d0,_cc);}return _d0;});},"esri/PopupInfo":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/_base/json","dojo/i18n","dojo/has","esri/kernel","esri/lang","dojo/i18n!dojo/cldr/nls/number"],function(_d3,_d4,_d5,_d6,_d7,has,_d8,_d9){var _da=_d3(null,{declaredClass:"esri.PopupInfo",initialize:function(_db,_dc){if(!_db){return;}_d4.mixin(this,_dc);this.info=_db;this.title=this.getTitle;this.content=this.getContent;var _dd=(this._fieldLabels={}),_de=(this._fieldsMap={});if(_db.fieldInfos){_d5.forEach(_db.fieldInfos,function(_df){_dd[_df.fieldName]=_df.label;_de[_df.fieldName]=_df;});}},toJson:function(){return _d6.fromJson(_d6.toJson(this.info));},getTitle:function(){},getContent:function(){},getComponents:function(_e0){var _e1=this.info,_e2=_e0.getLayer(),_e3=_d4.clone(_e0.attributes)||{},_e4=_d4.clone(_e3),_e5=_e1.fieldInfos,_e6="",_e7="",_e8,_e9,_ea,_eb=_e2&&_e2._getDateOpts&&_e2._getDateOpts().properties,_ec={dateFormat:{properties:_eb,formatter:"DateFormat"+this._insertOffset(this._dateFormats["shortDateShortTime"])}};if(_e5){_d5.forEach(_e5,function(_ed){var _ee=_ed.fieldName,val=_e4[_ee];_e4[_ee]=this._formatValue(val,_ee,_ec);if(_eb&&_ed.format&&_ed.format.dateFormat){var pos=_d5.indexOf(_eb,_ee);if(pos>-1){_eb.splice(pos,1);}}},this);}if(_e2){var _ef=_e2.types,_f0=_e2.typeIdField,_f1=_f0&&_e3[_f0];for(_e9 in _e3){_ea=_e3[_e9];if(_d9.isDefined(_ea)){var _f2=this._getDomainName(_e2,_ef,_f1,_e9,_ea);if(_d9.isDefined(_f2)){_e4[_e9]=_f2;}else{if(_e9===_f0){var _f3=this._getTypeName(_e2,_ea);if(_d9.isDefined(_f3)){_e4[_e9]=_f3;}}}}}}if(_e1.title){_e6=_d4.trim(_d9.substitute(_e4,this._fixTokens(_e1.title),_ec)||"");}if(_e1.description){_e7=_d4.trim(_d9.substitute(_e4,this._fixTokens(_e1.description),_ec)||"");}if(_e5){_e8=[];_d5.forEach(_e5,function(_f4){_e9=_f4.fieldName;if(_e9&&_f4.visible){_e8.push([_f4.label||_e9,_d9.substitute(_e4,"${"+_e9+"}",_ec)||""]);}});}var _f5,_f6;if(_e1.mediaInfos){_f5=[];_d5.forEach(_e1.mediaInfos,function(_f7){_f6=0;_ea=_f7.value;switch(_f7.type){case "image":var url=_ea.sourceURL;url=url&&_d4.trim(_d9.substitute(_e3,this._fixTokens(url)));_f6=!!url;break;case "piechart":case "linechart":case "columnchart":case "barchart":_f6=_d5.some(_ea.fields,function(_f8){return _d9.isDefined(_e3[_f8]);});break;default:return;}if(_f6){_f7=_d4.clone(_f7);_ea=_f7.value;_f7.title=_f7.title?_d4.trim(_d9.substitute(_e4,this._fixTokens(_f7.title),_ec)||""):"";_f7.caption=_f7.caption?_d4.trim(_d9.substitute(_e4,this._fixTokens(_f7.caption),_ec)||""):"";if(_f7.type==="image"){_ea.sourceURL=_d9.substitute(_e3,this._fixTokens(_ea.sourceURL));if(_ea.linkURL){_ea.linkURL=_d4.trim(_d9.substitute(_e3,this._fixTokens(_ea.linkURL))||"");}}else{var _f9=_e3[_ea.normalizeField]||0;_ea.fields=_d5.map(_ea.fields,function(_fa){var _fb=_e3[_fa];_fb=(_fb===undefined)?null:_fb;if(_fb&&_f9){_fb=_fb/_f9;}return {y:_fb,tooltip:(this._fieldLabels[_fa]||_fa)+":<br/>"+this._formatValue(_fb,_fa,_ec,!!_f9)};},this);}_f5.push(_f7);}},this);}return {title:_e6,description:_e7,fields:(_e8&&_e8.length)?_e8:null,mediaInfos:(_f5&&_f5.length)?_f5:null,formatted:_e4,editSummary:(_e2&&_e2.getEditSummary)?_e2.getEditSummary(_e0):""};},getAttachments:function(_fc){var _fd=_fc.getLayer(),_fe=_fc.attributes;if(this.info.showAttachments&&_fd&&_fd.hasAttachments&&_fd.objectIdField){var oid=_fe&&_fe[_fd.objectIdField];if(oid){return _fd.queryAttachmentInfos(oid);}}},_dateFormats:{"shortDate":"(datePattern: 'M/d/y', selector: 'date')","longMonthDayYear":"(datePattern: 'MMMM d, y', selector: 'date')","dayShortMonthYear":"(datePattern: 'd MMM y', selector: 'date')","longDate":"(datePattern: 'EEEE, MMMM d, y', selector: 'date')","shortDateShortTime":"(datePattern: 'M/d/y', timePattern: 'h:mm a', selector: 'date and time')","shortDateShortTime24":"(datePattern: 'M/d/y', timePattern: 'H:mm', selector: 'date and time')","shortDateLongTime":"(datePattern: 'M/d/y', timePattern: 'h:mm:ss a', selector: 'date and time')","shortDateLongTime24":"(datePattern: 'M/d/y', timePattern: 'H:mm:ss', selector: 'date and time')","longMonthYear":"(datePattern: 'MMMM y', selector: 'date')","shortMonthYear":"(datePattern: 'MMM y', selector: 'date')","year":"(datePattern: 'y', selector: 'date')"},_fixTokens:function(_ff){return _ff.replace(/(\{[^\{\r\n]+\})/g,"$$$1");},_formatValue:function(val,_100,_101,_102){var _103=this._fieldsMap[_100],fmt=_103&&_103.format;if(!_d9.isDefined(val)||!_103||!_d9.isDefined(fmt)){return val;}var _104="",_105=[],_106=fmt.hasOwnProperty("places")||fmt.hasOwnProperty("digitSeparator"),_107=fmt.hasOwnProperty("digitSeparator")?fmt.digitSeparator:true;if(_106){_104="NumberFormat";_105.push("places: "+((_d9.isDefined(fmt.places)&&(!_102||fmt.places>0))?Number(fmt.places):"Infinity"));if(_105.length){_104+=("("+_105.join(",")+")");}}else{if(fmt.dateFormat){_104="DateFormat"+this._insertOffset(this._dateFormats[fmt.dateFormat]||this._dateFormats["shortDateShortTime"]);}else{return val;}}var _108=_d9.substitute({"myKey":val},"${myKey:"+_104+"}",_101)||"";if(_106&&!_107){var _109=_d7.getLocalization("dojo.cldr","number");if(_109.group){_108=_108.replace(new RegExp("\\"+_109.group,"g"),"");}}return _108;},_insertOffset:function(_10a){if(_10a){_10a=_d9.isDefined(this.utcOffset)?_10a.replace(/\)\s*$/,", utcOffset:"+this.utcOffset+")"):_10a;}return _10a;},_getDomainName:function(_10b,_10c,_10d,_10e,_10f){var _110,stop;if(_10c&&_d9.isDefined(_10d)){_d5.some(_10c,function(_111){if(_111.id==_10d){_110=_111.domains&&_111.domains[_10e];if(_110&&_110.type==="inherited"){_110=this._getLayerDomain(_10b,_10e);stop=true;}return true;}return false;},this);}if(!stop&&!_110){_110=this._getLayerDomain(_10b,_10e);}if(_110&&_110.codedValues){var _112;_d5.some(_110.codedValues,function(_113){if(_113.code==_10f){_112=_113.name;return true;}return false;});return _112;}},_getLayerDomain:function(_114,_115){var _116=_114.fields;if(_116){var _117;_d5.some(_116,function(_118){if(_118.name===_115){_117=_118.domain;return true;}return false;});return _117;}},_getTypeName:function(_119,id){var _11a=_119.types;if(_11a){var _11b;_d5.some(_11a,function(_11c){if(_11c.id==id){_11b=_11c.name;return true;}return false;});return _11b;}}});if(has("extend-esri")){_d8.PopupInfo=_d8.PopupInfoTemplate=_da;}return _da;});},"esri/layers/KMLLayer":function(){define(["dojo/_base/kernel","dojo/_base/declare","dojo/_base/connect","dojo/_base/lang","dojo/_base/array","dojo/_base/json","dojo/_base/sniff","dojo/io-query","dojo/dom-construct","dojo/dom-style","esri/kernel","esri/config","esri/lang","esri/request","esri/SpatialReference","esri/geometry/webMercatorUtils","esri/dijit/PopupTemplate","esri/layers/layer","esri/layers/KMLFolder","esri/layers/KMLGroundOverlay","esri/layers/MapImageLayer","esri/layers/FeatureLayer"],function(_11d,_11e,_11f,lang,_120,_121,has,ioq,_122,_123,_124,_125,_126,_127,_128,_129,_12a,_12b,_12c,_12d,_12e,_12f){var _130=_11e([_12b],{declaredClass:"esri.layers.KMLLayer",serviceUrl:location.protocol+"//utility.arcgis.com/sharing/kml",constructor:function(url,_131){if(!url){console.log("KMLLayer:constructor - please provide url for the KML file");}this._outSR=(_131&&_131.outSR)||new _128({wkid:4326});this._options=_131;if(_125.defaults.kmlService){this.serviceUrl=_125.defaults.kmlService;}var link=(this.linkInfo=_131&&_131.linkInfo);if(link){this.visible=!!link.visibility;this._waitingForMap=!!link.viewFormat;}if(!link||(link&&link.visibility&&!this._waitingForMap)){this._parseKml();}this.refresh=lang.hitch(this,this.refresh);this.registerConnectEvents("esri.layers.KMLLayer",true);},getFeature:function(_132){if(!_132){return;}var type=_132.type,id=_132.id,_133,i,len;switch(type){case "esriGeometryPoint":case "esriGeometryPolyline":case "esriGeometryPolygon":var _134=this["_"+type];if(_134){_133=lang.getObject("_mode._featureMap."+id,false,_134);}break;case "GroundOverlay":var _135=this._groundLyr;if(_135){var _136=_135.getImages();len=_136.length;for(i=0;i<len;i++){if(_136[i].id===id){_133=_136[i];break;}}}break;case "ScreenOverlay":break;case "NetworkLink":_120.some(this._links,function(link){if(link.linkInfo&&link.linkInfo.id===id){_133=link;return true;}else{return false;}});break;case "Folder":var _137=this.folders;len=_137?_137.length:0;for(i=0;i<len;i++){if(_137[i].id===id){_133=_137[i];break;}}break;default:console.log("KMLLayer:getFeature - unknown feature type");break;}return _133;},getLayers:function(){var _138=[];if(this._groundLyr){_138.push(this._groundLyr);}if(this._fLayers){_138=_138.concat(this._fLayers);}if(this._links){_120.forEach(this._links,function(link){if(link.declaredClass){_138.push(link);}});}return _138;},setFolderVisibility:function(_139,_13a){if(!_139){return;}this._fireUpdateStart();_139.visible=_13a;if(_13a){_13a=this._areLocalAncestorsVisible(_139);}this._setState(_139,_13a);this._fireUpdateEnd();},onRefresh:function(){},_parseKml:function(map){var self=this;this._fireUpdateStart();this._io=_127({url:this.serviceUrl,content:{url:this._url.path+this._getQueryParameters(map),model:"simple",folders:"",refresh:this.loaded?true:undefined,outSR:_121.toJson(this._outSR.toJson())},callbackParamName:"callback",load:function(_13b){self._io=null;self._initLayer(_13b);},error:function(err){self._io=null;err=lang.mixin(new Error(),err);err.message="Unable to load KML: "+self.url+" "+(err.message||"");self._fireUpdateEnd(err);self.onError(err);}});},_initLayer:function(json){if(this.loaded){this._removeInternalLayers();}this.name=json.name;this.description=json.description;this.snippet=json.snippet;this.visibility=json.visibility;this.featureInfos=json.featureInfos;var i,len;var _13c=(this.folders=json.folders),_13d=[],fldr;if(_13c){len=_13c.length;for(i=0;i<len;i++){fldr=(_13c[i]=new _12c(_13c[i]));if(fldr.parentFolderId===-1){_13d.push(fldr);}}}var _13e=(this._links=json.networkLinks),_13f;len=_13e?_13e.length:0;for(i=0;i<len;i++){if(_13e[i].viewRefreshMode&&_13e[i].viewRefreshMode.toLowerCase().indexOf("onregion")!==-1){continue;}_13f=lang.mixin({},this._options);_13f.linkInfo=_13e[i];if(_13f.id){_13f.id=_13f.id+"_"+i;}_13e[i]=new _130(_13e[i].href,_13f);_13e[i]._parentLayer=this;_13e[i]._parentFolderId=this._getLinkParentId(_13e[i].linkInfo.id);}var _140=json.groundOverlays;if(_140&&_140.length>0){_13f=lang.mixin({},this._options);if(_13f.id){_13f.id=_13f.id+"_"+"mapImage";}var _141=(this._groundLyr=new _12e(_13f));len=_140.length;for(i=0;i<len;i++){_141.addImage(new _12d(_140[i]));}}var _142=lang.getObject("featureCollection.layers",false,json);if(_142&&_142.length>0){this._fLayers=[];_120.forEach(_142,function(_143,i){var _144=lang.getObject("featureSet.features",false,_143),_145;if(_144&&_144.length>0){_13f=lang.mixin({outFields:["*"],infoTemplate:_143.popupInfo?new _12a(_143.popupInfo):null,editable:false},this._options);if(_13f.id){_13f.id=_13f.id+"_"+i;}_143.layerDefinition.capabilities="Query,Data";_145=new _12f(_143,_13f);if(_145.geometryType){this["_"+_145.geometryType]=_145;}this._fLayers.push(_145);}},this);if(this._fLayers.length===0){delete this._fLayers;}}len=_13d.length;for(i=0;i<len;i++){fldr=_13d[i];this._setState(fldr,fldr.visible);}this._fireUpdateEnd();if(this.loaded){this._addInternalLayers();this.onRefresh();}else{this.loaded=true;this.onLoad(this);}},_addInternalLayers:function(){var map=this._map;this._fireUpdateStart();if(this._links){_120.forEach(this._links,function(link){if(link.declaredClass){map.addLayer(link);if(link._waitingForMap){link._waitingForMap=null;if(link.visible){link._parseKml(map);}else{link._wMap=map;}}}});}var _146=map.spatialReference,_147=this._outSR,_148;if(!_146.equals(_147)){if(_146.isWebMercator()&&_147.wkid===4326){_148=_129.geographicToWebMercator;}else{if(_147.isWebMercator()&&_146.wkid===4326){_148=_129.webMercatorToGeographic;}else{console.log("KMLLayer:_setMap - unsupported workflow. Spatial reference of the map and kml layer do not match, and the conversion cannot be done on the client.");return;}}}if(this._groundLyr){if(_148){_120.forEach(this._groundLyr.getImages(),function(_149){_149.extent=_148(_149.extent);});}map.addLayer(this._groundLyr);}var _14a=this._fLayers;if(_14a&&_14a.length>0){_120.forEach(_14a,function(_14b){if(_148){var _14c=_14b.graphics,i,geom,len=_14c?_14c.length:0;for(i=0;i<len;i++){geom=_14c[i].geometry;if(geom){_14c[i].setGeometry(_148(geom));}}}map.addLayer(_14b);});}this.onVisibilityChange(this.visible);},_removeInternalLayers:function(){var map=this._map;if(this._links){_120.forEach(this._links,function(link){if(link.declaredClass&&link._io){link._io.cancel();}});}if(map){_120.forEach(this.getLayers(),map.removeLayer,map);}},_setState:function(_14d,_14e){var _14f=_14d.featureInfos,info,_150,i,len=_14f?_14f.length:0,_151=_14e?"show":"hide";for(i=0;i<len;i++){info=_14f[i];_150=this.getFeature(info);if(!_150){continue;}if(info.type==="Folder"){this._setState(_150,_14e&&_150.visible);}else{if(info.type==="NetworkLink"){this._setInternalVisibility(_150,_14e);}else{_150[_151]();}}}},_areLocalAncestorsVisible:function(_152){var _153=_152.parentFolderId,_154=_152.visible;while(_154&&_153!==-1){var _155=this.getFeature({type:"Folder",id:_153});_154=_154&&_155.visible;_153=_155.parentFolderId;}return _154;},_setInternalVisibility:function(_156,_157){var _158=_156._parentLayer,_159=_156._parentFolderId;_157=_157&&_156.visible;while(_157&&_158){_157=_157&&_158.visible;if(_159>-1){_157=_157&&_158._areLocalAncestorsVisible(_158.getFeature({type:"Folder",id:_159}));}_159=_158._parentFolderId;_158=_158._parentLayer;}this._setIntState(_156,_157);},_setIntState:function(link,_15a){if(!link){return;}_120.forEach(link.getLayers(),function(_15b){if(_15b.linkInfo){link._setIntState(_15b,_15a&&_15b.visible&&link._areLocalAncestorsVisible(link.getFeature({type:"Folder",id:_15b._parentFolderId})));}else{_15b.setVisibility(_15a);}});},_getLinkParentId:function(id){var _15c=-1;if(this.folders){_120.some(this.folders,function(_15d){if(_15d.networkLinkIds&&_120.indexOf(_15d.networkLinkIds,id)!==-1){_15c=_15d.id;return true;}return false;});}return _15c;},_checkAutoRefresh:function(){var _15e=this.linkInfo;if(_15e){if(this.visible){if(this.loaded&&this._map){var _15f=_15e.refreshMode,_160=_15e.refreshInterval,_161=_15e.viewRefreshMode,_162=_15e.viewRefreshTime;if(_15f&&_15f.toLowerCase().indexOf("oninterval")!==-1&&_160>0){this._stopAutoRefresh();this._timeoutHandle=setTimeout(this.refresh,_160*1000);}if(_161&&_161.toLowerCase().indexOf("onstop")!==-1&&_162>0){if(!this._extChgHandle){this._extChgHandle=_11f.connect(this._map,"onExtentChange",this,this._extentChanged);}}}}else{this._stopAutoRefresh();_11f.disconnect(this._extChgHandle);delete this._extChgHandle;}}},_stopAutoRefresh:function(){clearTimeout(this._timeoutHandle);this._timeoutHandle=null;},_getQueryParameters:function(map){map=map||this._map;var _163={},_164=this.linkInfo,_165=map&&map.extent,_166;if(this._url.query){lang.mixin(_163,this._url.query);_166=!!this._url.query.token;}if(_124.id&&!_166){var _167=_124.id.findCredential(this._url.path);if(_167){_163.token=_167.token;}}if(_164){var _168=_164.viewFormat,_169=_164.httpQuery,_16a=_164.viewBoundScale;if(_165&&_168){var _16b=_165,_16c=_165,sr=_165.spatialReference;if(sr){if(sr.isWebMercator()){_16b=_129.webMercatorToGeographic(_165);}else{if(sr.wkid===4326){_16c=_129.geographicToWebMercator(_165);}}}var _16d=_16b.getCenter(),_16e=Math.max(_16c.getWidth(),_16c.getHeight());if(_16a){_16b=_16b.expand(_16a);}_168=_168.replace(/\[bboxWest\]/ig,_16b.xmin).replace(/\[bboxEast\]/ig,_16b.xmax).replace(/\[bboxSouth\]/ig,_16b.ymin).replace(/\[bboxNorth\]/ig,_16b.ymax).replace(/\[lookatLon\]/ig,_16d.x).replace(/\[lookatLat\]/ig,_16d.y).replace(/\[lookatRange\]/ig,_16e).replace(/\[lookatTilt\]/ig,0).replace(/\[lookatHeading\]/ig,0).replace(/\[lookatTerrainLon\]/ig,_16d.x).replace(/\[lookatTerrainLat\]/ig,_16d.y).replace(/\[lookatTerrainAlt\]/ig,0).replace(/\[cameraLon\]/ig,_16d.x).replace(/\[cameraLat\]/ig,_16d.y).replace(/\[cameraAlt\]/ig,_16e).replace(/\[horizFov\]/ig,60).replace(/\[vertFov\]/ig,60).replace(/\[horizPixels\]/ig,map.width).replace(/\[vertPixels\]/ig,map.height).replace(/\[terrainEnabled\]/ig,0);lang.mixin(_163,ioq.queryToObject(_168));}if(_169){_169=_169.replace(/\[clientVersion\]/ig,_124.version).replace(/\[kmlVersion\]/ig,2.2).replace(/\[clientName\]/ig,"ArcGIS API for JavaScript").replace(/\[language\]/ig,_11d.locale);lang.mixin(_163,ioq.queryToObject(_169));}}var _16f=[],_170;for(_170 in _163){if(_126.isDefined(_163[_170])){_16f.push(_170+"="+_163[_170]);}}_16f=_16f.join("&");return _16f?("?"+_16f):"";},_setMap:function(map,_171){this._map=map;var div=this._div=_122.create("div",null,_171);_123.set(div,"position","absolute");this._addInternalLayers();return div;},_unsetMap:function(map,_172){if(this._io){this._io.cancel();}this._stopAutoRefresh();_11f.disconnect(this._extChgHandle);delete this._extChgHandle;this._removeInternalLayers();var div=this._div;if(div){_172.removeChild(div);_122.destroy(div);}this._map=this._wMap=this._div=null;},onVisibilityChange:function(_173){if(!this.loaded){if(this.linkInfo&&_173){if(!this._waitingForMap){this._parseKml(this._wMap);}}return;}this._fireUpdateStart();this._setInternalVisibility(this,_173);this._checkAutoRefresh();this._fireUpdateEnd();},refresh:function(){if(!this.loaded||!this._map||this._io){return;}this._parseKml();},_extentChanged:function(){this._stopAutoRefresh();this._timeoutHandle=setTimeout(this.refresh,this.linkInfo.viewRefreshTime*1000);}});if(has("extend-esri")){lang.setObject("layers.KMLLayer",_130,_124);}return _130;});},"dojo/hccss":function(){define(["require","./_base/config","./dom-class","./dom-style","./has","./ready","./_base/window"],function(_174,_175,_176,_177,has,_178,win){has.add("highcontrast",function(){var div=win.doc.createElement("div");div.style.cssText="border: 1px solid; border-color:red green; position: absolute; height: 5px; top: -999px;"+"background-image: url("+(_175.blankGif||_174.toUrl("./resources/blank.gif"))+");";win.body().appendChild(div);var cs=_177.getComputedStyle(div),_179=cs.backgroundImage,hc=(cs.borderTopColor==cs.borderRightColor)||(_179&&(_179=="none"||_179=="url(invalid-url:)"));if(has("ie")<=8){div.outerHTML="";}else{win.body().removeChild(div);}return hc;});_178(90,function(){if(has("highcontrast")){_176.add(win.body(),"dj_a11y");}});return has;});},"esri/tasks/ImageServiceIdentifyParameters":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/has","esri/kernel","esri/lang","esri/geometry/jsonUtils"],function(_17a,lang,_17b,has,_17c,_17d,_17e){var _17f=_17a(null,{declaredClass:"esri.tasks.ImageServiceIdentifyParameters",geometry:null,mosaicRule:null,pixelSizeX:null,pixelSizeY:null,pixelSize:null,returnGeometry:false,returnCatalogItems:true,timeExtent:null,toJson:function(_180){var g=_180&&_180["geometry"]||this.geometry,json={geometry:g,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,mosaicRule:this.mosaicRule?_17b.toJson(this.mosaicRule.toJson()):null};if(g){json.geometryType=_17e.getJsonType(g);}var _181=this.timeExtent;json.time=_181?_181.toJson().join(","):null;if(_17d.isDefined(this.pixelSizeX)&&_17d.isDefined(this.pixelSizeY)){json.pixelSize=_17b.toJson({x:parseFloat(this.pixelSizeX),y:parseFloat(this.pixelSizeY)});}else{if(this.pixelSize){json.pixelSize=this.pixelSize?_17b.toJson(this.pixelSize.toJson()):null;}}return json;}});if(has("extend-esri")){lang.setObject("tasks.ImageServiceIdentifyParameters",_17f,_17c);}return _17f;});},"dijit/_WidgetBase":function(){define("dijit/_WidgetBase",["require","dojo/_base/array","dojo/aspect","dojo/_base/config","dojo/_base/connect","dojo/_base/declare","dojo/dom","dojo/dom-attr","dojo/dom-class","dojo/dom-construct","dojo/dom-geometry","dojo/dom-style","dojo/has","dojo/_base/kernel","dojo/_base/lang","dojo/on","dojo/ready","dojo/Stateful","dojo/topic","dojo/_base/window","./Destroyable","./registry"],function(_182,_183,_184,_185,_186,_187,dom,_188,_189,_18a,_18b,_18c,has,_18d,lang,on,_18e,_18f,_190,win,_191,_192){has.add("dijit-legacy-requires",!_18d.isAsync);if(has("dijit-legacy-requires")){_18e(0,function(){var _193=["dijit/_base/manager"];_182(_193);});}var _194={};function _195(obj){var ret={};for(var attr in obj){ret[attr.toLowerCase()]=true;}return ret;};function _196(attr){return function(val){_188[val?"set":"remove"](this.domNode,attr,val);this._set(attr,val);};};return _187("dijit._WidgetBase",[_18f,_191],{id:"",_setIdAttr:"domNode",lang:"",_setLangAttr:_196("lang"),dir:"",_setDirAttr:_196("dir"),textDir:"","class":"",_setClassAttr:{node:"domNode",type:"class"},style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,ownerDocument:null,_setOwnerDocumentAttr:function(val){this._set("ownerDocument",val);},attributeMap:{},_blankGif:_185.blankGif||_182.toUrl("dojo/resources/blank.gif"),postscript:function(_197,_198){this.create(_197,_198);},create:function(_199,_19a){this.srcNodeRef=dom.byId(_19a);this._connects=[];this._supportingWidgets=[];if(this.srcNodeRef&&(typeof this.srcNodeRef.id=="string")){this.id=this.srcNodeRef.id;}if(_199){this.params=_199;lang.mixin(this,_199);}this.postMixInProperties();if(!this.id){this.id=_192.getUniqueId(this.declaredClass.replace(/\./g,"_"));if(this.params){delete this.params.id;}}this.ownerDocument=this.ownerDocument||(this.srcNodeRef?this.srcNodeRef.ownerDocument:win.doc);this.ownerDocumentBody=win.body(this.ownerDocument);_192.add(this);this.buildRendering();var _19b;if(this.domNode){this._applyAttributes();var _19c=this.srcNodeRef;if(_19c&&_19c.parentNode&&this.domNode!==_19c){_19c.parentNode.replaceChild(this.domNode,_19c);_19b=true;}this.domNode.setAttribute("widgetId",this.id);}this.postCreate();if(_19b){delete this.srcNodeRef;}this._created=true;},_applyAttributes:function(){var ctor=this.constructor,list=ctor._setterAttrs;if(!list){list=(ctor._setterAttrs=[]);for(var attr in this.attributeMap){list.push(attr);}var _19d=ctor.prototype;for(var _19e in _19d){if(_19e in this.attributeMap){continue;}var _19f="_set"+_19e.replace(/^[a-z]|-[a-zA-Z]/g,function(c){return c.charAt(c.length-1).toUpperCase();})+"Attr";if(_19f in _19d){list.push(_19e);}}}var _1a0={};for(var key in this.params||{}){_1a0[key]=this[key];}_183.forEach(list,function(attr){if(attr in _1a0){}else{if(this[attr]){this.set(attr,this[attr]);}}},this);for(key in _1a0){this.set(key,_1a0[key]);}},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode){this.domNode=this.srcNodeRef||this.ownerDocument.createElement("div");}if(this.baseClass){var _1a1=this.baseClass.split(" ");if(!this.isLeftToRight()){_1a1=_1a1.concat(_183.map(_1a1,function(name){return name+"Rtl";}));}_189.add(this.domNode,_1a1);}},postCreate:function(){},startup:function(){if(this._started){return;}this._started=true;_183.forEach(this.getChildren(),function(obj){if(!obj._started&&!obj._destroyed&&lang.isFunction(obj.startup)){obj.startup();obj._started=true;}});},destroyRecursive:function(_1a2){this._beingDestroyed=true;this.destroyDescendants(_1a2);this.destroy(_1a2);},destroy:function(_1a3){this._beingDestroyed=true;this.uninitialize();function _1a4(w){if(w.destroyRecursive){w.destroyRecursive(_1a3);}else{if(w.destroy){w.destroy(_1a3);}}};_183.forEach(this._connects,lang.hitch(this,"disconnect"));_183.forEach(this._supportingWidgets,_1a4);if(this.domNode){_183.forEach(_192.findWidgets(this.domNode,this.containerNode),_1a4);}this.destroyRendering(_1a3);_192.remove(this.id);this._destroyed=true;},destroyRendering:function(_1a5){if(this.bgIframe){this.bgIframe.destroy(_1a5);delete this.bgIframe;}if(this.domNode){if(_1a5){_188.remove(this.domNode,"widgetId");}else{_18a.destroy(this.domNode);}delete this.domNode;}if(this.srcNodeRef){if(!_1a5){_18a.destroy(this.srcNodeRef);}delete this.srcNodeRef;}},destroyDescendants:function(_1a6){_183.forEach(this.getChildren(),function(_1a7){if(_1a7.destroyRecursive){_1a7.destroyRecursive(_1a6);}});},uninitialize:function(){return false;},_setStyleAttr:function(_1a8){var _1a9=this.domNode;if(lang.isObject(_1a8)){_18c.set(_1a9,_1a8);}else{if(_1a9.style.cssText){_1a9.style.cssText+="; "+_1a8;}else{_1a9.style.cssText=_1a8;}}this._set("style",_1a8);},_attrToDom:function(attr,_1aa,_1ab){_1ab=arguments.length>=3?_1ab:this.attributeMap[attr];_183.forEach(lang.isArray(_1ab)?_1ab:[_1ab],function(_1ac){var _1ad=this[_1ac.node||_1ac||"domNode"];var type=_1ac.type||"attribute";switch(type){case "attribute":if(lang.isFunction(_1aa)){_1aa=lang.hitch(this,_1aa);}var _1ae=_1ac.attribute?_1ac.attribute:(/^on[A-Z][a-zA-Z]*$/.test(attr)?attr.toLowerCase():attr);if(_1ad.tagName){_188.set(_1ad,_1ae,_1aa);}else{_1ad.set(_1ae,_1aa);}break;case "innerText":_1ad.innerHTML="";_1ad.appendChild(this.ownerDocument.createTextNode(_1aa));break;case "innerHTML":_1ad.innerHTML=_1aa;break;case "class":_189.replace(_1ad,_1aa,this[attr]);break;}},this);},get:function(name){var _1af=this._getAttrNames(name);return this[_1af.g]?this[_1af.g]():this[name];},set:function(name,_1b0){if(typeof name==="object"){for(var x in name){this.set(x,name[x]);}return this;}var _1b1=this._getAttrNames(name),_1b2=this[_1b1.s];if(lang.isFunction(_1b2)){var _1b3=_1b2.apply(this,Array.prototype.slice.call(arguments,1));}else{var _1b4=this.focusNode&&!lang.isFunction(this.focusNode)?"focusNode":"domNode",_1b5,map,tag;tag=this[_1b4]&&this[_1b4].tagName;if(tag){_1b5=_194[tag]||(_194[tag]=_195(this[_1b4]));}map=name in this.attributeMap?this.attributeMap[name]:_1b1.s in this?this[_1b1.s]:((_1b5&&_1b1.l in _1b5&&typeof _1b0!="function")||/^aria-|^data-|^role$/.test(name))?_1b4:null;if(map!=null){this._attrToDom(name,_1b0,map);}this._set(name,_1b0);}return _1b3||this;},_attrPairNames:{},_getAttrNames:function(name){var apn=this._attrPairNames;if(apn[name]){return apn[name];}var uc=name.replace(/^[a-z]|-[a-zA-Z]/g,function(c){return c.charAt(c.length-1).toUpperCase();});return (apn[name]={n:name+"Node",s:"_set"+uc+"Attr",g:"_get"+uc+"Attr",l:uc.toLowerCase()});},_set:function(name,_1b6){var _1b7=this[name];this[name]=_1b6;if(this._created&&_1b6!==_1b7){if(this._watchCallbacks){this._watchCallbacks(name,_1b7,_1b6);}this.emit("attrmodified-"+name,{detail:{prevValue:_1b7,newValue:_1b6}});}},emit:function(type,_1b8,_1b9){_1b8=_1b8||{};if(_1b8.bubbles===undefined){_1b8.bubbles=true;}if(_1b8.cancelable===undefined){_1b8.cancelable=true;}if(!_1b8.detail){_1b8.detail={};}_1b8.detail.widget=this;var ret,_1ba=this["on"+type];if(_1ba){ret=_1ba.apply(this,_1b9?_1b9:[_1b8]);}if(this._started&&!this._beingDestroyed){on.emit(this.domNode,type.toLowerCase(),_1b8);}return ret;},on:function(type,func){var _1bb=this._onMap(type);if(_1bb){return _184.after(this,_1bb,func,true);}return this.own(on(this.domNode,type,func))[0];},_onMap:function(type){var ctor=this.constructor,map=ctor._onMap;if(!map){map=(ctor._onMap={});for(var attr in ctor.prototype){if(/^on/.test(attr)){map[attr.replace(/^on/,"").toLowerCase()]=attr;}}}return map[typeof type=="string"&&type.toLowerCase()];},toString:function(){return "[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]";},getChildren:function(){return this.containerNode?_192.findWidgets(this.containerNode):[];},getParent:function(){return _192.getEnclosingWidget(this.domNode.parentNode);},connect:function(obj,_1bc,_1bd){return this.own(_186.connect(obj,_1bc,this,_1bd))[0];},disconnect:function(_1be){_1be.remove();},subscribe:function(t,_1bf){return this.own(_190.subscribe(t,lang.hitch(this,_1bf)))[0];},unsubscribe:function(_1c0){_1c0.remove();},isLeftToRight:function(){return this.dir?(this.dir=="ltr"):_18b.isBodyLtr(this.ownerDocument);},isFocusable:function(){return this.focus&&(_18c.get(this.domNode,"display")!="none");},placeAt:function(_1c1,_1c2){var _1c3=!_1c1.tagName&&_192.byId(_1c1);if(_1c3&&_1c3.addChild&&(!_1c2||typeof _1c2==="number")){_1c3.addChild(this,_1c2);}else{var ref=_1c3?(_1c3.containerNode&&!/after|before|replace/.test(_1c2||"")?_1c3.containerNode:_1c3.domNode):dom.byId(_1c1,this.ownerDocument);_18a.place(this.domNode,ref,_1c2);if(!this._started&&(this.getParent()||{})._started){this.startup();}}return this;},getTextDir:function(text,_1c4){return _1c4;},applyTextDir:function(){},defer:function(fcn,_1c5){var _1c6=setTimeout(lang.hitch(this,function(){_1c6=null;if(!this._destroyed){lang.hitch(this,fcn)();}}),_1c5||0);return {remove:function(){if(_1c6){clearTimeout(_1c6);_1c6=null;}return null;}};}});});},"esri/layers/FeatureLayer":function(){define(["dojo/_base/declare","dojo/_base/connect","dojo/_base/lang","dojo/_base/array","dojo/_base/json","dojo/_base/Deferred","dojo/date/locale","dojo/sniff","dojo/io-query","dojo/dom-construct","dojo/i18n","esri/kernel","esri/lang","esri/request","esri/deferredUtils","esri/SpatialReference","esri/symbols/SimpleMarkerSymbol","esri/symbols/SimpleLineSymbol","esri/symbols/SimpleFillSymbol","esri/symbols/jsonUtils","esri/renderers/SimpleRenderer","esri/renderers/UniqueValueRenderer","esri/renderers/jsonUtils","esri/tasks/QueryTask","esri/tasks/query","esri/tasks/FeatureSet","esri/geometry/Extent","esri/geometry/jsonUtils","esri/geometry/normalizeUtils","esri/layers/GraphicsLayer","esri/layers/Field","esri/layers/TimeInfo","esri/layers/FeatureType","esri/layers/FeatureTemplate","esri/layers/FeatureEditResult","esri/layers/SnapshotMode","esri/layers/OnDemandMode","esri/layers/SelectionMode","esri/layers/TrackManager","dojo/i18n!esri/nls/jsapi","dojo/has!extend-esri?esri/layers/agscommon"],function(_1c7,_1c8,lang,_1c9,_1ca,_1cb,_1cc,has,ioq,_1cd,i18n,_1ce,_1cf,_1d0,_1d1,_1d2,_1d3,_1d4,_1d5,_1d6,_1d7,_1d8,_1d9,_1da,_1db,_1dc,_1dd,_1de,_1df,_1e0,_1e1,_1e2,_1e3,_1e4,_1e5,_1e6,_1e7,_1e8,_1e9){var _1ea=_1c7(_1e0,{declaredClass:"esri.layers.FeatureLayer",invalidParams:"query contains one or more unsupported parameters",_eventMap:{"add-attachment-complete":["result"],"before-apply-edits":["adds","updates","deletes"],"delete-attachments-complete":["results"],"edits-complete":["adds","updates","deletes"],"query-attachment-infos-complete":["results"],"query-count-complete":["count"],"query-features-complete":["featureSet"],"query-ids-complete":["objectIds"],"query-related-features-complete":["featureSets"],"selection-complete":["features","method"],"update-end":["error","info"]},constructor:function(url,_1eb){this.i18n=i18n.getLocalization("esri","jsapi");this._outFields=_1eb&&_1eb.outFields;this._loadCallback=_1eb&&_1eb.loadCallback;var _1ec=_1eb&&_1eb._usePatch;this._usePatch=(_1ec===null||_1ec===undefined)?true:_1ec;this._trackIdField=_1eb&&_1eb.trackIdField;this.objectIdField=_1eb&&_1eb.objectIdField;this._maxOffset=_1eb&&_1eb.maxAllowableOffset;this._optEditable=_1eb&&_1eb.editable;this._optAutoGen=_1eb&&_1eb.autoGeneralize;this.editSummaryCallback=_1eb&&_1eb.editSummaryCallback;this.userId=_1eb&&_1eb.userId;this.userIsAdmin=_1eb&&_1eb.userIsAdmin;this.useMapTime=(_1eb&&_1eb.hasOwnProperty("useMapTime"))?(!!_1eb.useMapTime):true;this.source=_1eb&&_1eb.source;this.gdbVersion=_1eb&&_1eb.gdbVersion;this._selectedFeatures={};this._selectedFeaturesArr=[];this._newFeatures=[];this._deletedFeatures={};this._ulid=this._getUniqueId();var ctor=this.constructor,mode=this.mode=(_1cf.isDefined(_1eb&&_1eb.mode)?_1eb.mode:ctor.MODE_ONDEMAND);switch(mode){case ctor.MODE_SNAPSHOT:this._mode=new _1e6(this);this._isSnapshot=true;break;case ctor.MODE_ONDEMAND:this._tileWidth=(_1eb&&_1eb.tileWidth)||512;this._tileHeight=(_1eb&&_1eb.tileHeight)||512;this._mode=new _1e7(this);var _1ed=_1eb&&_1eb.latticeTiling;this.latticeTiling=_1ed;break;case ctor.MODE_SELECTION:this._mode=new _1e8(this);this._isSelOnly=true;break;}this._initLayer=lang.hitch(this,this._initLayer);this._selectHandler=lang.hitch(this,this._selectHandler);this._editable=false;if(lang.isObject(url)&&url.layerDefinition){var json=url;this._collection=true;this.mode=ctor.MODE_SNAPSHOT;this._initLayer(json);return this;}this._task=new _1da(this.url,{source:this.source,gdbVersion:this.gdbVersion});var _1ee=this._url.path;this._fserver=false;if(_1ee.search(/\/FeatureServer\//i)!==-1){this._fserver=true;}var _1ef=_1eb&&_1eb.resourceInfo;if(_1ef){this._initLayer(_1ef);}else{if(this.source){var _1f0={source:this.source.toJson()};this._url.query=lang.mixin(this._url.query,{layer:_1ca.toJson(_1f0)});}if(this.gdbVersion){this._url.query=lang.mixin(this._url.query,{gdbVersion:this.gdbVersion});}_1d0({url:_1ee,content:lang.mixin({f:"json"},this._url.query),callbackParamName:"callback",load:this._initLayer,error:this._errorHandler});}this.registerConnectEvents();},_initLayer:function(_1f1,io){if(_1f1||io){this._json=_1f1;this._findCredential();var ssl=(this.credential&&this.credential.ssl)||(_1f1&&_1f1._ssl);if(ssl){this._useSSL();this._task._useSSL();}if(this._collection){this._mode=new _1e6(this);this._isSnapshot=true;this._featureSet=_1f1.featureSet;this._nextId=_1f1.nextObjectId;_1f1=_1f1.layerDefinition;}if(_1f1.hasOwnProperty("capabilities")){var _1f2=(this.capabilities=_1f1.capabilities);if(_1f2&&_1f2.toLowerCase().indexOf("editing")!==-1){this._editable=true;}else{this._editable=false;}}else{if(!this._collection){this._editable=this._fserver;}}if(_1cf.isDefined(this._optEditable)){this._editable=this._optEditable;delete this._optEditable;}this._json=_1ca.toJson(this._json);if(this.isEditable()){delete this._maxOffset;}else{if(this.mode!==this.constructor.MODE_SNAPSHOT&&((_1f1.geometryType==="esriGeometryPolyline")||(_1f1.geometryType==="esriGeometryPolygon"))){this._autoGeneralize=_1cf.isDefined(this._optAutoGen)?this._optAutoGen:(this.mode===this.constructor.MODE_ONDEMAND);delete this._optAutoGen;}}var _1f3=_1f1.effectiveMinScale||_1f1.minScale,_1f4=_1f1.effectiveMaxScale||_1f1.maxScale;if(!this._hasMin&&_1f3){this.setMinScale(_1f3);}if(!this._hasMax&&_1f4){this.setMaxScale(_1f4);}this.layerId=_1f1.id;this.name=_1f1.name;this.description=_1f1.description;this.copyright=_1f1.copyrightText;this.type=_1f1.type;this.geometryType=_1f1.geometryType;this.displayField=_1f1.displayField;this.defaultDefinitionExpression=_1f1.definitionExpression;this.fullExtent=new _1dd(_1f1.extent);this.initialExtent=new _1dd(this.fullExtent.toJson());if(this.fullExtent.spatialReference){this.spatialReference=new _1d2(this.fullExtent.spatialReference.toJson());}this.defaultVisibility=_1f1.defaultVisibility;if((this.geometryType==="esriGeometryPoint")||(this.geometryType==="esriGeometryMultipoint")){this.latticeTiling=false;}this.indexedFields=_1f1.indexedFields;this.maxRecordCount=_1f1.maxRecordCount;this.canModifyLayer=_1f1.canModifyLayer;this.supportsStatistics=_1f1.supportsStatistics;this.supportsAdvancedQueries=_1f1.supportsAdvancedQueries;this.hasLabels=_1f1.hasLabels;this.canScaleSymbols=_1f1.canScaleSymbols;this.supportsRollbackOnFailure=_1f1.supportsRollbackOnFailure;this.syncCanReturnChanges=_1f1.syncCanReturnChanges;this.isDataVersioned=_1f1.isDataVersioned;this.editFieldsInfo=_1f1.editFieldsInfo;this.ownershipBasedAccessControlForFeatures=_1f1.ownershipBasedAccessControlForFeatures;if(this.editFieldsInfo&&this.ownershipBasedAccessControlForFeatures){this.creatorField=this.editFieldsInfo.creatorField;}this.relationships=_1f1.relationships;this.allowGeometryUpdates=_1cf.isDefined(_1f1.allowGeometryUpdates)?_1f1.allowGeometryUpdates:true;this._isTable=(this.type==="Table");var _1f5=(this.fields=[]),_1f6=_1f1.fields,i;for(i=0;i<_1f6.length;i++){_1f5.push(new _1e1(_1f6[i]));}if(!this.objectIdField){this.objectIdField=_1f1.objectIdField;if(!this.objectIdField){_1f6=_1f1.fields;for(i=0;i<_1f6.length;i++){var _1f7=_1f6[i];if(_1f7.type==="esriFieldTypeOID"){this.objectIdField=_1f7.name;break;}}}if(!this.objectIdField){console.debug("esri.layers.FeatureLayer: "+_1cf.substitute({url:this.url},"objectIdField is not set [url: ${url}]"));}}if(!_1cf.isDefined(this._nextId)){var _1f8=this.objectIdField,_1f9=-1;if(this._collection&&_1f8){var fset=this._featureSet,_1fa=fset&&fset.features,il=_1fa?_1fa.length:0,oid,attr;for(i=0;i<il;i++){attr=_1fa[i].attributes;oid=attr&&attr[_1f8];if(oid>_1f9){_1f9=oid;}}}this._nextId=(_1f9+1);}this.globalIdField=_1f1.globalIdField;var _1fb=(this.typeIdField=_1f1.typeIdField),_1fc;if(_1fb){_1fc=!this._getField(_1fb)&&this._getField(_1fb,true);if(_1fc){this.typeIdField=_1fc.name;}}this.visibilityField=_1f1.visibilityField;var _1fd=_1f1.defaultSymbol;if(_1fd){this.defaultSymbol=_1d6.fromJson(_1fd);}var _1fe=this.types=[],_1ff=_1f1.types,_200,_201,_202,_203=this.editFieldsInfo,_204=_203&&_203.creatorField,_205=_203&&_203.editorField,fix=(_204||_205),_206=[];if(_1ff){for(i=0;i<_1ff.length;i++){_200=new _1e3(_1ff[i]);_201=_200.templates;if(fix&&_201&&_201.length){_206=_206.concat(_201);}_1fe.push(_200);}}var _207=_1f1.templates,_208,_209=this.templates=[];if(_207){for(i=0;i<_207.length;i++){_208=new _1e4(_207[i]);if(fix){_206.push(_208);}_209.push(_208);}}for(i=0;i<_206.length;i++){_202=lang.getObject("prototype.attributes",false,_206[i]);if(_202){if(_204){delete _202[_204];}if(_205){delete _202[_205];}}}var _20a=_1f1.timeInfo;if(_20a){this.timeInfo=new _1e2(_20a);this._startTimeField=_20a.startTimeField;this._endTimeField=_20a.endTimeField;if(this._startTimeField&&this._endTimeField){this._twoTimeFields=true;}if(this._trackIdField){_20a.trackIdField=this._trackIdField;}else{this._trackIdField=_20a.trackIdField;}}this.hasAttachments=(!this._collection&&_1f1.hasAttachments)?true:false;this.htmlPopupType=_1f1.htmlPopupType;var _20b=_1f1.drawingInfo,_20c;if(!this.renderer){if(_20b&&_20b.renderer){_20c=_20b.renderer;this.setRenderer(_1d9.fromJson(_20c));if(_20c.type==="classBreaks"){this.renderer.setMaxInclusive(true);}if(!this._collection){var _20d=_20c.type,_20e=[];_20c=this.renderer;switch(_20d){case "simple":_20e.push(_20c.symbol);break;case "uniqueValue":case "classBreaks":_20e.push(_20c.defaultSymbol);_20e=_20e.concat(_1c9.map(_20c.infos,function(info){return info.symbol;}));break;}_20e=_1c9.filter(_20e,_1cf.isDefined);var _20f=this._url.path+"/images/",_210=this._getToken();_1c9.forEach(_20e,function(sym){var url=sym.url;if(url){if((url.search(/https?\:/)===-1)&&(url.indexOf("data:")===-1)){sym.url=_20f+url;}if(_210&&sym.url.search(/https?\:/)!==-1){sym.url+=("?token="+_210);}}});}}else{if(_1fd){_1ff=this.types;if(_1ff.length>0){_20c=new _1d8(this.defaultSymbol,this.typeIdField);_1c9.forEach(_1ff,function(type){_20c.addValue(type.id,type.symbol);});}else{_20c=new _1d7(this.defaultSymbol);}this.setRenderer(_20c);}else{if(!this._isTable){var _211;switch(this.geometryType){case "esriGeometryPoint":case "esriGeometryMultipoint":_211=new _1d3();break;case "esriGeometryPolyline":_211=new _1d4();break;case "esriGeometryPolygon":_211=new _1d5();break;}this.setRenderer(_211?new _1d7(_211):null);}}}}var _212=(_20b&&_20b.transparency)||0;if(!_1cf.isDefined(this.opacity)&&_212>0){this.opacity=1-(_212/100);}this.version=_1f1.currentVersion;if(!this.version){var ver;if("capabilities" in _1f1||"drawingInfo" in _1f1||"hasAttachments" in _1f1||"htmlPopupType" in _1f1||"relationships" in _1f1||"timeInfo" in _1f1||"typeIdField" in _1f1||"types" in _1f1){ver=10;}else{ver=9.3;}this.version=ver;}if((has("ie")||has("safari"))&&this.isEditable()&&this.version<10.02){this._ts=true;}this.loaded=true;this._fixRendererFields();this._checkFields();this._updateCaps();var _213=function(){this.onLoad(this);var _214=this._loadCallback;if(_214){delete this._loadCallback;_214(this);}};if(this._collection){this._fireUpdateStart();var _215=this._featureSet;delete this._featureSet;this._mode._drawFeatures(new _1dc(_215));this._fcAdded=true;_213.call(this);}else{this._forceIdentity(_213);}}},setRenderer:function(ren){this.inherited("setRenderer",arguments);var _216=this.renderer;if(_216){this._ager=(_216.declaredClass.indexOf("TemporalRenderer")!==-1&&_216.observationAger&&_216.observationRenderer);var _217=_1c9.filter([_216,_216.observationRenderer,_216.latestObservationRenderer,_216.trackRenderer],_1cf.isDefined);var _218=[];_1c9.forEach(_217,function(rnd){if(!lang.isFunction(rnd.attributeField)){_218.push(rnd.attributeField);}_218.push(rnd.attributeField2);_218.push(rnd.attributeField3);},this);this._rendererFields=_1c9.filter(_218,_1cf.isDefined);}else{this._ager=false;this._rendererFields=[];}if(this.loaded&&this._rendererFields.length>0){this._fixRendererFields();this._checkFields(this._rendererFields);}if(this.loaded&&this._collection){this._typesDirty=true;}},_setMap:function(map){var div=this.inherited(arguments),mode=this._mode;if(mode){mode.initialize(map);}return div;},_unsetMap:function(map){var mode=this._mode;if(mode){mode.suspend();}if(this._trackManager){this._trackManager.destroy();this._trackManager=null;}_1c8.disconnect(this._zoomConnect);this._zoomConnect=null;this._toggleTime(false);this.inherited("_unsetMap",arguments);},refresh:function(){var mode=this._mode;if(mode){mode.refresh();}},getOutFields:function(){return _1c9.filter(this._getOutFields(),function(_219){return (_219==="*"||!!this._getField(_219));},this);},setEditable:function(_21a){if(!this._collection){console.log("FeatureLayer:setEditable - this functionality is not yet supported for layer in a feature service");return this;}if(!this.loaded){this._optEditable=_21a;return this;}var _21b=this._editable;this._editable=_21a;this._updateCaps();if(_21b!==_21a){this.onCapabilitiesChange();}return this;},getEditCapabilities:function(_21c){var _21d={"canCreate":false,"canUpdate":false,"canDelete":false};if(!this.loaded||!this.isEditable()){return _21d;}var _21e=_21c&&_21c.feature,_21f=_21c&&_21c.userId,caps=_1c9.map((this.capabilities?this.capabilities.toLowerCase().split(","):[]),lang.trim),_220=_1c9.indexOf(caps,"editing")>-1,_221=_220&&(_1c9.indexOf(caps,"create")>-1),_222=_220&&(_1c9.indexOf(caps,"update")>-1),_223=_220&&(_1c9.indexOf(caps,"delete")>-1),_224=this.ownershipBasedAccessControlForFeatures,_225=this.editFieldsInfo,_226=_225&&_225.creatorField,_227=_225&&_225.realm,_228=_21e&&_21e.attributes,_229=(_228&&_226)?_228[_226]:undefined,_22a,_22b=!!this.userIsAdmin,_22c=!_224||_22b||!!(_224.allowOthersToUpdate||_224.allowUpdateToOthers),_22d=!_224||_22b||!!(_224.allowOthersToDelete||_224.allowDeleteToOthers);if(_22b||(_220&&!(_221||_222||_223))){_221=_222=_223=true;}_22a={"canCreate":_221,"canUpdate":_222,"canDelete":_223};if(_229===null){_22a.canUpdate=_222&&_22c;_22a.canDelete=_223&&_22d;}else{if(_229===""){return _22a;}else{if(_229){_21f=_21f||this.getUserId();if(_21f&&_227){_21f=_21f+"@"+_227;}if(_21f.toLowerCase()===_229.toLowerCase()){return _22a;}else{_22a.canUpdate=_222&&_22c;_22a.canDelete=_223&&_22d;}}}}return _22a;},getUserId:function(){var _22e;if(this.loaded){_22e=(this.credential&&this.credential.userId)||this.userId||"";}return _22e;},setUserIsAdmin:function(_22f){this.userIsAdmin=_22f;},setEditSummaryCallback:function(_230){this.editSummaryCallback=_230;},getEditSummary:function(_231,_232,_233){_233=_1cf.isDefined(_233)?_233:(new Date()).getTime();var _234="",info=this.getEditInfo(_231,_232,_233),_235=(_232&&_232.callback)||this.editSummaryCallback;if(_235){info=_235(_231,info)||"";}if(lang.isString(info)){_234=info;}else{if(info){var _236=info.action,_237=info.userId,_238=info.timeValue,_239=0;if(_236){_239++;}if(_237){_239++;}if(_1cf.isDefined(_238)){_239++;}if(_239>1){_234=(_236==="edit"?"edit":"create")+(_237?"User":"")+(_1cf.isDefined(_238)?info.displayPattern:"");}}_234=_234&&_1cf.substitute(info,this.i18n.layers.FeatureLayer[_234]);}return _234;},getEditInfo:function(_23a,_23b,_23c){if(!this.loaded){return;}_23c=_1cf.isDefined(_23c)?_23c:(new Date()).getTime();var _23d=(_23b&&_23b.action)||"last",_23e=this.editFieldsInfo,_23f=_23e&&_23e.creatorField,_240=_23e&&_23e.creationDateField,_241=_23e&&_23e.editorField,_242=_23e&&_23e.editDateField,_243=_23e&&_23e.realm,_244=_23a&&_23a.attributes,_245=(_244&&_23f)?_244[_23f]:undefined,_246=(_244&&_240)?_244[_240]:null,_247=(_244&&_241)?_244[_241]:undefined,_248=(_244&&_242)?_244[_242]:null,_249=this._getEditData(_245,_246,_23c),_24a=this._getEditData(_247,_248,_23c),_24b;switch(_23d){case "creation":_24b=_249;break;case "edit":_24b=_24a;break;case "last":_24b=_24a||_249;break;}if(_24b){_24b.action=(_24b===_24a)?"edit":"creation";}return _24b;},_getEditData:function(_24c,_24d,_24e){var data,_24f,_250,_251=60000,_252=3600000,_253=2*_252,_254=24*_252,_255=7*_254;if(_1cf.isDefined(_24d)){_24f=_24e-_24d;if(_24f<0){_250="Full";}else{if(_24f<_251){_250="Seconds";}else{if(_24f<(2*_251)){_250="Minute";}else{if(_24f<_252){_250="Minutes";}else{if(_24f<_253){_250="Hour";}else{if(_24f<_254){_250="Hours";}else{if(_24f<_255){_250="WeekDay";}else{_250="Full";}}}}}}}}if((_24c!==undefined)||_250){data=data||{};data.userId=_24c;if(_250){var _256=_1cc.format,_257=new Date(_24d);data.minutes=Math.floor(_24f/_251);data.hours=Math.floor(_24f/_252);data.weekDay=_256(_257,{datePattern:"EEEE",selector:"date"});data.formattedDate=_256(_257,{selector:"date"});data.formattedTime=_256(_257,{selector:"time"});data.displayPattern=_250;data.timeValue=_24d;}}return data;},isEditable:function(){return !!(this._editable||this.userIsAdmin);},setMaxAllowableOffset:function(_258){if(!this.isEditable()){this._maxOffset=_258;}return this;},getMaxAllowableOffset:function(){return this._maxOffset;},setAutoGeneralize:function(_259){if(!this.loaded){this._optAutoGen=_259;}else{if(!this.isEditable()&&(this.mode!==this.constructor.MODE_SNAPSHOT)&&((this.geometryType==="esriGeometryPolyline")||(this.geometryType==="esriGeometryPolygon"))){this._autoGeneralize=_259;if(_259){var map=this._map;if(map&&map.loaded){this._maxOffset=Math.floor(map.extent.getWidth()/map.width);}}else{delete this._maxOffset;}}}return this;},setGDBVersion:function(_25a){if(!this._collection&&(_25a!==this.gdbVersion)&&(_25a||this.gdbVersion)){this.gdbVersion=_25a;this._task.gdbVersion=_25a;this._url.query=lang.mixin(this._url.query,{gdbVersion:_25a});if(this.loaded){this.clearSelection();if(this._map){this.refresh();}}this.onGDBVersionChange();}return this;},setDefinitionExpression:function(expr){this._defnExpr=expr;var mode=this._mode;if(mode){mode.propertyChangeHandler(1);}return this;},getDefinitionExpression:function(){return this._defnExpr;},setTimeDefinition:function(_25b){if(this._isSnapshot){this._timeDefn=_25b;var mode=this._mode;if(mode){mode.propertyChangeHandler(2);}}else{console.log("FeatureLayer.setTimeDefinition: layer in on-demand or selection mode does not support time definitions. Layer id = "+this.id+", Layer URL = "+this.url);}return this;},getTimeDefinition:function(){return this._timeDefn;},setTimeOffset:function(_25c,_25d){this._timeOffset=_25c;this._timeOffsetUnits=_25d;var mode=this._mode;if(mode){mode.propertyChangeHandler(0);}return this;},setUseMapTime:function(use){this.useMapTime=use;this._toggleTime(!this.suspended);var mode=this._mode;if(mode){mode.propertyChangeHandler(0);}},selectFeatures:function(_25e,_25f,_260,_261){_25f=_25f||this.constructor.SELECTION_NEW;var _262=this._getShallowClone(_25e),map=this._map,_263,dfd=_1d1._fixDfd(new _1cb(_1d1._dfdCanceller));_262.outFields=this.getOutFields();_262.returnGeometry=true;if(map){_262.outSpatialReference=new _1d2(map.spatialReference.toJson());}if(!this._applyQueryFilters(_262)){_263={features:[]};this._selectHandler(_263,_25f,_260,_261,dfd);return dfd;}var _264=this._canDoClientSideQuery(_262);if(_264){_263={features:this._doQuery(_262,_264)};this._selectHandler(_263,_25f,_260,_261,dfd);return dfd;}else{if(this._collection){var err=new Error("FeatureLayer::selectFeatures - "+this.invalidParams);this._resolve([err],null,_261,dfd,true);return dfd;}var self=this;if(this._ts){_262._ts=(new Date()).getTime();}var temp=dfd._pendingDfd=this._task.execute(_262);temp.addCallbacks(function(_265){self._selectHandler(_265,_25f,_260,_261,dfd);},function(err){self._resolve([err],null,_261,dfd,true);});return dfd;}},getSelectedFeatures:function(){var _266=this._selectedFeatures,_267=[],item;for(item in _266){if(_266.hasOwnProperty(item)){_267.push(_266[item]);}}return _267;},clearSelection:function(_268){var _269=this._selectedFeatures,mode=this._mode,item;for(item in _269){if(_269.hasOwnProperty(item)){this._unSelectFeatureIIf(item,mode);mode._removeFeatureIIf(item);}}this._selectedFeatures={};if(this._isSelOnly){mode._applyTimeFilter(true);}if(!_268){this.onSelectionClear();}return this;},setSelectionSymbol:function(_26a){this._selectionSymbol=_26a;if(_26a){var _26b=this._selectedFeatures,item;for(item in _26b){if(_26b.hasOwnProperty(item)){_26b[item].setSymbol(_26a);}}}return this;},getSelectionSymbol:function(){return this._selectionSymbol;},__msigns:[{n:"applyEdits",c:5,a:[{i:0},{i:1}],e:4,f:1}],applyEdits:function(adds,_26c,_26d,_26e,_26f,_270){var _271=_270.assembly,dfd=_270.dfd;this._applyNormalized(adds,_271&&_271[0]);this._applyNormalized(_26c,_271&&_271[1]);this.onBeforeApplyEdits(adds,_26c,_26d);var i,_272={},_273=this.objectIdField,_274={f:"json"},_275=false;if(this._collection){var _276={};_276.addResults=adds?_1c9.map(adds,function(){_275=true;return {objectId:this._nextId++,success:true};},this):null;_276.updateResults=_26c?_1c9.map(_26c,function(_277){_275=true;var oid=_277.attributes[_273];_272[oid]=_277;return {objectId:oid,success:true};},this):null;_276.deleteResults=_26d?_1c9.map(_26d,function(_278){_275=true;return {objectId:_278.attributes[_273],success:true};},this):null;if(_275){this._editHandler(_276,adds,_272,_26e,_26f,dfd);}return;}if(adds&&adds.length>0){_274.adds=this._convertFeaturesToJson(adds,0,1);_275=true;}if(_26c&&_26c.length>0){for(i=0;i<_26c.length;i++){var _279=_26c[i];_272[_279.attributes[_273]]=_279;}_274.updates=this._convertFeaturesToJson(_26c,0,0,1);_275=true;}if(_26d&&_26d.length>0){var ids=[];for(i=0;i<_26d.length;i++){ids.push(_26d[i].attributes[_273]);}_274.deletes=ids.join(",");_275=true;}if(_275){var self=this;return _1d0({url:this._url.path+"/applyEdits",content:lang.mixin(_274,this._url.query),callbackParamName:"callback",load:function(_27a){self._editHandler(_27a,adds,_272,_26e,_26f,dfd);},error:function(err){self._resolve([err],null,_26f,dfd,true);}},{usePost:true});}},queryFeatures:function(_27b,_27c,_27d){return this._query("execute","onQueryFeaturesComplete",_27b,_27c,_27d);},queryRelatedFeatures:function(_27e,_27f,_280){return this._query("executeRelationshipQuery","onQueryRelatedFeaturesComplete",_27e,_27f,_280);},queryIds:function(_281,_282,_283){return this._query("executeForIds","onQueryIdsComplete",_281,_282,_283);},queryCount:function(_284,_285,_286){return this._query("executeForCount","onQueryCountComplete",_284,_285,_286);},queryAttachmentInfos:function(_287,_288,_289){var url=this._url.path+"/"+_287+"/attachments",dfd=new _1cb(_1d1._dfdCanceller),self=this;dfd._pendingDfd=_1d0({url:url,content:lang.mixin({f:"json"},this._url.query),callbackParamName:"callback",load:function(_28a){var _28b=_28a.attachmentInfos,_28c;_1c9.forEach(_28b,function(info){_28c=ioq.objectToQuery({gdbVersion:self._url.query&&self._url.query.gdbVersion,layer:self._url.query&&self._url.query.layer,token:self._getToken()});info.url=url+"/"+info.id+(_28c?("?"+_28c):"");info.objectId=_287;});self._resolve([_28b],"onQueryAttachmentInfosComplete",_288,dfd);},error:function(err){self._resolve([err],null,_289,dfd,true);}});return dfd;},addAttachment:function(_28d,_28e,_28f,_290){return this._sendAttachment("add",_28d,_28e,_28f,_290);},updateAttachment:function(_291,_292,_293,_294,_295){_293.appendChild(_1cd.create("input",{type:"hidden",name:"attachmentId",value:_292}));return this._sendAttachment("update",_291,_293,_294,_295);},deleteAttachments:function(_296,_297,_298,_299){var url=this._url.path+"/"+_296+"/deleteAttachments",dfd=new _1cb(_1d1._dfdCanceller),self=this,_29a={f:"json",attachmentIds:_297.join(",")};dfd._pendingDfd=_1d0({url:url,content:lang.mixin(_29a,this._url.query),callbackParamName:"callback",load:lang.hitch(this,function(_29b){var _29c=_29b.deleteAttachmentResults;_29c=_1c9.map(_29c,function(_29d){var res=new _1e5(_29d);res.attachmentId=res.objectId;res.objectId=_296;return res;});self._resolve([_29c],"onDeleteAttachmentsComplete",_298,dfd);}),error:function(err){self._resolve([err],null,_299,dfd,true);}},{usePost:true});return dfd;},addType:function(_29e){var _29f=this.types;if(_29f){var _2a0=_1c9.some(_29f,function(type){if(type.id==_29e.id){return true;}return false;});if(_2a0){return false;}else{_29f.push(_29e);}}else{this.types=[_29e];}this._typesDirty=true;return true;},deleteType:function(_2a1){if(!this._collection){return;}var _2a2=this.types;if(_2a2){var _2a3=-1;_1c9.some(_2a2,function(type,_2a4){if(type.id==_2a1){_2a3=_2a4;return true;}return false;});if(_2a3>-1){this._typesDirty=true;return _2a2.splice(_2a3,1)[0];}}},toJson:function(){var _2a5=this._json,json=lang.isString(_2a5)?_1ca.fromJson(_2a5):lang.clone(_2a5);if(!json){return;}json=json.layerDefinition?json:{layerDefinition:json};var _2a6=json.layerDefinition,_2a7=this._collection;if(_2a7&&this._typesDirty){_2a6.types=_1c9.map(this.types||[],function(type){return type.toJson();});var _2a8=this.renderer,_2a9=_2a6.drawingInfo;if(_2a9&&_2a8&&_2a8.declaredClass.indexOf("TemporalRenderer")===-1){_2a9.renderer=_2a8.toJson();}}var _2aa=null;if(!(_2a7&&!this._fcAdded)){_2aa={geometryType:_2a6.geometryType,features:this._convertFeaturesToJson(this.graphics,true)};}json.featureSet=lang.mixin({},json.featureSet||{},_2aa);if(_2a7){json.nextObjectId=this._nextId;_2a6.capabilities=this.capabilities;}return json;},onSelectionComplete:function(){},onSelectionClear:function(){},onBeforeApplyEdits:function(){},onEditsComplete:function(){},onQueryFeaturesComplete:function(){},onQueryRelatedFeaturesComplete:function(){},onQueryIdsComplete:function(){},onQueryCountComplete:function(){},onQueryAttachmentInfosComplete:function(){},onAddAttachmentComplete:function(){},onUpdateAttachmentComplete:function(){},onDeleteAttachmentsComplete:function(){},onCapabilitiesChange:function(){},onGDBVersionChange:function(){},onQueryLimitExceeded:function(){},_forceIdentity:function(_2ab){var self=this,path=this._url&&this._url.path;if((this.ownershipBasedAccessControlForFeatures||this.userIsAdmin)&&!this._getToken()&&path&&_1ce.id&&_1ce.id._hasPortalSession()&&_1ce.id._doPortalSignIn(path)){_1ce.id.getCredential(path).then(function(){self._findCredential();_2ab.call(self);},function(){_2ab.call(self);});}else{_2ab.call(this);}},_updateCaps:function(){var _2ac=this._editable,_2ad=lang.trim(this.capabilities||""),_2ae=_1c9.map((_2ad?_2ad.split(","):[]),lang.trim),caps=_1c9.map((_2ad?_2ad.toLowerCase().split(","):[]),lang.trim),_2af=_1c9.indexOf(caps,"editing"),cap,i,_2b0,_2b1={"Create":_1c9.indexOf(caps,"create"),"Update":_1c9.indexOf(caps,"update"),"Delete":_1c9.indexOf(caps,"delete")};if(_2ac&&_2af===-1){_2ae.push("Editing");}else{if(!_2ac&&_2af>-1){_2b0=[_2af];for(cap in _2b1){if(_2b1[cap]>-1){_2b0.push(_2b1[cap]);}}_2b0.sort();for(i=_2b0.length-1;i>=0;i--){_2ae.splice(_2b0[i],1);}}}this.capabilities=_2ae.join(",");},_counter:{value:0},_getUniqueId:function(){return this._counter.value++;},onSuspend:function(){this.inherited(arguments);this._toggleTime(false);var mode=this._mode;if(mode){mode.suspend();}},onResume:function(evt){this.inherited(arguments);this._toggleTime(true);this._updateMaxOffset();var mode=this._mode,map=this._map,_2b2=this.renderer;if(evt.firstOccurrence){this.clearSelection();if(this.timeInfo){if(this._trackIdField||(_2b2&&(_2b2.latestObservationRenderer||_2b2.trackRenderer))){this._trackManager=new _1e9(this);this._trackManager.initialize(map);}}this._zoomConnect=_1c8.connect(map,"onZoomEnd",this,this._updateMaxOffset);}if(mode){evt.firstOccurrence?mode.startup():mode.resume();}},_updateMaxOffset:function(){var map=this._map;if(map&&map.loaded){if(this._autoGeneralize){this._maxOffset=Math.floor(map.extent.getWidth()/map.width);}}},_toggleTime:function(_2b3){var map=this._map;if(_2b3&&this.timeInfo&&this.useMapTime&&map){this._mapTimeExtent=map.timeExtent;if(!this._timeConnect){this._timeConnect=_1c8.connect(map,"onTimeExtentChange",this,this._timeChangeHandler);}}else{this._mapTimeExtent=null;_1c8.disconnect(this._timeConnect);this._timeConnect=null;}},_timeChangeHandler:function(_2b4){this._mapTimeExtent=_2b4;var mode=this._mode;if(mode){mode.propertyChangeHandler(0);}},_getOffsettedTE:function(_2b5){var _2b6=this._timeOffset,_2b7=this._timeOffsetUnits;return (_2b5&&_2b6&&_2b7)?_2b5.offset(-1*_2b6,_2b7):_2b5;},_getTimeOverlap:function(_2b8,_2b9){if(_2b8&&_2b9){return _2b8.intersection(_2b9);}else{return _2b8||_2b9;}},_getTimeFilter:function(_2ba){var _2bb=this.getTimeDefinition(),_2bc=null,_2bd;if(_2bb||_2bc){_2bd=this._getTimeOverlap(_2bb,_2bc);if(!_2bd){return [false];}}if(_2ba){_2ba=_2bd?this._getTimeOverlap(_2ba,_2bd):_2ba;if(!_2ba){return [false];}}else{_2ba=_2bd;}return [true,_2ba];},_getAttributeFilter:function(_2be){var _2bf=this.getDefinitionExpression();if(_2be){_2be=_2bf?"("+_2bf+") AND ("+_2be+")":_2be;}else{_2be=_2bf;}return _2be;},_applyQueryFilters:function(_2c0){_2c0.where=this._getAttributeFilter(_2c0.where);_2c0.maxAllowableOffset=this._maxOffset;if(this.timeInfo){var _2c1=this._getTimeFilter(_2c0.timeExtent);if(!_2c1[0]){return false;}else{_2c0.timeExtent=_2c1[1];}}return true;},_add:function(_2c2){var _2c3=this._selectionSymbol,attr=_2c2.attributes,_2c4=this.visibilityField;if(_2c3&&this._isSelOnly){_2c2.setSymbol(_2c3);}if(_2c4&&attr&&attr.hasOwnProperty(_2c4)){_2c2[attr[_2c4]?"show":"hide"]();}return this.add.apply(this,arguments);},_remove:function(){return this.remove.apply(this,arguments);},_canDoClientSideQuery:function(_2c5){var _2c6=[],map=this._map;if(this._isTable||!map){return;}if(_2c5.text||(_2c5.where&&_2c5.where!==this.getDefinitionExpression())){return;}var _2c7=this._isSnapshot,_2c8=this._isSelOnly;var _2c9=_2c5.geometry;if(_2c9){if(!_2c8&&_2c5.spatialRelationship===_1db.SPATIAL_REL_INTERSECTS&&(_2c9.type==="extent"&&(_2c7||map.extent.contains(_2c9)))){_2c6.push(1);}else{return;}}var ids=_2c5.objectIds;if(ids){if(_2c7){_2c6.push(2);}else{var len=ids.length,mode=this._mode,_2ca=0,i;for(i=0;i<len;i++){if(mode._getFeature(ids[i])){_2ca++;}}if(_2ca===len){_2c6.push(2);}else{return;}}}if(this.timeInfo){var _2cb=_2c5.timeExtent,_2cc=this._mapTimeExtent;if(_2c7){if(_2cb){_2c6.push(3);}}else{if(_2c8){if(_2cb){return;}}else{if(_2cc){if(_1c9.indexOf(_2c6,2)!==-1){if(_2cb){_2c6.push(3);}}else{return;}}else{if(_2c6.length>0){if(_2cb){_2c6.push(3);}}else{if(_2cb){return;}}}}}}return _2c6.length>0?_2c6:null;},_doQuery:function(_2cd,_2ce,_2cf){var _2d0=[],mode=this._mode,_2d1=this.objectIdField,i,len,_2d2;if(_1c9.indexOf(_2ce,2)!==-1){_2d0=[];var ids=_2cd.objectIds;len=ids.length;for(i=0;i<len;i++){var obj=mode._getFeature(ids[i]);if(obj){_2d0.push(obj);}}if(_2d0.length===0){return [];}}if(_1c9.indexOf(_2ce,1)!==-1){_2d2=_2d0.length>0?_2d0:this.graphics;len=_2d2.length;var _2d3=_2cd.geometry._normalize(null,true);_2d0=[];for(i=0;i<len;i++){var _2d4=_2d2[i],_2d5=_2d4.geometry;if(_2d5){if(this.normalization&&_2d3.length){if(_2d3[0].intersects(_2d5)||_2d3[1].intersects(_2d5)){_2d0.push(_2d4);}}else{if(_2d3.intersects(_2d5)){_2d0.push(_2d4);}}}}if(_2d0.length===0){return [];}}if(_1c9.indexOf(_2ce,3)!==-1){if(this.timeInfo){_2d2=_2d0.length>0?_2d0:this.graphics;var time=_2cd.timeExtent,_2d6=this._filterByTime(_2d2,time.startTime,time.endTime);_2d0=_2d6.match;}}if(_2cf){return _1c9.map(_2d0,function(obj){return obj.attributes[_2d1];},this);}else{return _2d0;}},_filterByTime:function(_2d7,_2d8,_2d9){var _2da=this._startTimeField,_2db=this._endTimeField,_2dc;if(!this._twoTimeFields){_2dc=_2da||_2db;}var _2dd=_1cf.isDefined,yea=[],nay=[],i,len=_2d7.length,_2de,_2df;_2d8=_2d8?_2d8.getTime():-Infinity;_2d9=_2d9?_2d9.getTime():Infinity;if(_2dc){for(i=0;i<len;i++){_2de=_2d7[i];_2df=_2de.attributes;var time=_2df[_2dc];if(time>=_2d8&&time<=_2d9){yea.push(_2de);}else{nay.push(_2de);}}}else{for(i=0;i<len;i++){_2de=_2d7[i];_2df=_2de.attributes;var _2e0=_2df[_2da],end=_2df[_2db];_2e0=_2dd(_2e0)?_2e0:-Infinity;end=_2dd(end)?end:Infinity;if((_2e0>=_2d8&&_2e0<=_2d9)||(end>=_2d8&&end<=_2d9)||(_2d8>=_2e0&&_2d9<=end)){yea.push(_2de);}else{nay.push(_2de);}}}return {match:yea,noMatch:nay};},_resolve:function(args,_2e1,_2e2,dfd,_2e3){if(_2e1){this[_2e1].apply(this,args);}if(_2e2){_2e2.apply(null,args);}if(dfd){_1d1._resDfd(dfd,args,_2e3);}},_getShallowClone:function(_2e4){var _2e5=new _1db(),prop;for(prop in _2e4){if(_2e4.hasOwnProperty(prop)){_2e5[prop]=_2e4[prop];}}return _2e5;},_query:function(type,_2e6,_2e7,_2e8,_2e9){var that=this,map=this._map,dfd=new _1cb(_1d1._dfdCanceller),_2ea=_2e7;var _2eb=function(_2ec,_2ed){if(!_2ed&&type==="execute"&&!that._isTable){var _2ee=_2ec.features,mode=that._mode,_2ef=that.objectIdField,il=_2ee.length,i;for(i=il-1;i>=0;i--){var oid=_2ee[i].attributes[_2ef];var _2f0=mode._getFeature(oid);if(_2f0){_2ee.splice(i,1,_2f0);}}}that._resolve([_2ec],_2e6,_2e8,dfd);};if(type!=="executeRelationshipQuery"){_2ea=this._getShallowClone(_2e7);_2ea.outFields=this.getOutFields();_2ea.returnGeometry=_2e7.hasOwnProperty("returnGeometry")?_2e7.returnGeometry:true;var _2f1;if(map){_2ea.outSpatialReference=new _1d2(map.spatialReference.toJson());}if(!this._applyQueryFilters(_2ea)){switch(type){case "execute":_2f1=new _1dc({features:[]});break;case "executeForIds":_2f1=[];break;case "executeForCount":_2f1=0;break;}_2eb(_2f1,true);return dfd;}var _2f2=this._canDoClientSideQuery(_2ea);if(_2f2){var _2f3=this._doQuery(_2ea,_2f2,(type==="executeForIds"||type==="executeForCount"));switch(type){case "execute":_2f1=new _1dc();_2f1.features=_2f3;break;case "executeForIds":_2f1=_2f3;break;case "executeForCount":_2f1=_2f3.length;break;}_2eb(_2f1,true);return dfd;}}if(this._collection){var err=new Error("FeatureLayer::_query - "+this.invalidParams);this._resolve([err],null,_2e9,dfd,true);return dfd;}if(this._ts){_2ea._ts=(new Date()).getTime();}var temp=dfd._pendingDfd=this._task[type](_2ea);temp.addCallbacks(_2eb,function(err){that._resolve([err],null,_2e9,dfd,true);});return dfd;},_convertFeaturesToJson:function(_2f4,_2f5,_2f6,_2f7){var json=[],_2f8=this._selectionSymbol,_2f9=this.visibilityField,i,_2fa,_2fb=this.objectIdField;if(this.loaded&&(_2f6||_2f7)){_2fa=_1c9.filter(this.fields,function(_2fc){return (_2fc.editable===false)&&(!_2f7||(_2fc.name!==_2fb));});}for(i=0;i<_2f4.length;i++){var _2fd=_2f4[i],_2fe={},_2ff=_2fd.geometry,attr=_2fd.attributes,_300=_2fd.symbol;if(_2ff&&(!_2f7||!this.loaded||this.allowGeometryUpdates)){_2fe.geometry=_2ff.toJson();}if(_2f9){_2fe.attributes=attr=lang.mixin({},attr);attr[_2f9]=_2fd.visible?1:0;}else{if(attr){_2fe.attributes=lang.mixin({},attr);}}if(_2fe.attributes&&_2fa&&_2fa.length){_1c9.forEach(_2fa,function(_301){delete _2fe.attributes[_301.name];});}if(_300&&(_300!==_2f8)){_2fe.symbol=_300.toJson();}json.push(_2fe);}return _2f5?json:_1ca.toJson(json);},_selectHandler:function(_302,_303,_304,_305,dfd){var _306,ctor=this.constructor;switch(_303){case ctor.SELECTION_NEW:this.clearSelection(true);_306=true;break;case ctor.SELECTION_ADD:_306=true;break;case ctor.SELECTION_SUBTRACT:_306=false;break;}var i,_307=_302.features,mode=this._mode,_308=[],_309=this.objectIdField,_30a,oid;if(_306){for(i=0;i<_307.length;i++){_30a=_307[i];oid=_30a.attributes[_309];var _30b=mode._addFeatureIIf(oid,_30a);_308.push(_30b);this._selectFeatureIIf(oid,_30b,mode);}}else{for(i=0;i<_307.length;i++){_30a=_307[i];oid=_30a.attributes[_309];this._unSelectFeatureIIf(oid,mode);var _30c=mode._removeFeatureIIf(oid);_308.push(_30c||_30a);}}if(this._isSelOnly){mode._applyTimeFilter(true);}this._resolve([_308,_303,_302.exceededTransferLimit?{queryLimitExceeded:true}:null],"onSelectionComplete",_304,dfd);if(_302.exceededTransferLimit){this.onQueryLimitExceeded();}},_selectFeatureIIf:function(oid,_30d,mode){var _30e=this._selectedFeatures,_30f=_30e[oid];if(!_30f){mode._incRefCount(oid);_30e[oid]=_30d;if(!this._isTable){this._setSelectSymbol(_30d);}}return _30f||_30d;},_unSelectFeatureIIf:function(oid,mode){var _310=this._selectedFeatures[oid];if(_310){mode._decRefCount(oid);delete this._selectedFeatures[oid];if(!this._isTable){this._setUnSelectSymbol(_310);}}return _310;},_isSelected:function(_311){},_setSelectSymbol:function(_312){var _313=this._selectionSymbol;if(_313&&!this._isSelOnly){_312.setSymbol(_313);}},_setUnSelectSymbol:function(_314){var _315=this._selectionSymbol;if(_315&&!this._isSelOnly){if(_315===_314.symbol){_314.setSymbol(null,true);}}},_getOutFields:function(){var _316=_1c9.filter([this.objectIdField,this.typeIdField,this.creatorField,this._startTimeField,this._endTimeField,this._trackIdField].concat(this._rendererFields),function(_317,_318,arr){return !!_317&&(_1c9.indexOf(arr,_317)===_318);});var _319=lang.clone(this._outFields);if(_319){if(_1c9.indexOf(_319,"*")!==-1){return _319;}_1c9.forEach(_316,function(_31a){if(_1c9.indexOf(_319,_31a)===-1){_319.push(_31a);}});return _319;}else{return _316;}},_checkFields:function(_31b){var _31c=_31b||this._getOutFields();_1c9.forEach(_31c,function(_31d){if(_31d==="*"){return;}if(!this._getField(_31d)){console.debug("esri.layers.FeatureLayer: "+_1cf.substitute({url:this.url,field:_31d},"unable to find '${field}' field in the layer 'fields' information [url: ${url}]"));}},this);if(!_31b&&!this._isTable&&!this._fserver&&!this._collection){var _31e=_1c9.some(this.fields,function(_31f){return (_31f&&_31f.type==="esriFieldTypeGeometry")?true:false;});if(!_31e){console.debug("esri.layers.FeatureLayer: "+_1cf.substitute({url:this.url},"unable to find a field of type 'esriFieldTypeGeometry' in the layer 'fields' information. If you are using a map service layer, features will not have geometry [url: ${url}]"));}}},_fixRendererFields:function(){var _320=this.renderer;if(_320&&this.fields.length>0){var _321=_1c9.filter([_320,_320.observationRenderer,_320.latestObservationRenderer,_320.trackRenderer],_1cf.isDefined);var _322=[];_1c9.forEach(_321,function(rnd){var _323,_324;_324=rnd.attributeField;if(_324&&!lang.isFunction(_324)){_323=!this._getField(_324)&&this._getField(_324,true);if(_323){rnd.attributeField=_323.name;}}_324=rnd.attributeField2;if(_324){_323=!this._getField(_324)&&this._getField(_324,true);if(_323){rnd.attributeField2=_323.name;}}_324=rnd.attributeField3;if(_324){_323=!this._getField(_324)&&this._getField(_324,true);if(_323){rnd.attributeField3=_323.name;}}if(!lang.isFunction(rnd.attributeField)){_322.push(rnd.attributeField);}_322.push(rnd.attributeField2);_322.push(rnd.attributeField3);},this);this._rendererFields=_1c9.filter(_322,_1cf.isDefined);}},_getField:function(_325,_326){var _327=this.fields;if(!_327||_327.length===0){return null;}var _328;if(_326){_325=_325.toLowerCase();}_1c9.some(_327,function(_329){var _32a=false;if(_326){_32a=(_329&&_329.name.toLowerCase()===_325)?true:false;}else{_32a=(_329&&_329.name===_325)?true:false;}if(_32a){_328=_329;}return _32a;});return _328;},_getDateOpts:function(){if(!this._dtOpts){var _32b=_1c9.map(_1c9.filter(this.fields,function(_32c){return !!(_32c&&_32c.type==="esriFieldTypeDate");}),function(_32d){return _32d.name;});this._dtOpts={properties:_32b};}return this._dtOpts;},_applyNormalized:function(_32e,_32f){if(_32e&&_32f){_1c9.forEach(_32e,function(_330,_331){if(_330&&_32f[_331]){_330.setGeometry(_32f[_331]);}});}},_editHandler:function(_332,adds,_333,_334,_335,dfd){var _336=_332.addResults,_337=_332.updateResults,_338=_332.deleteResults,i,_339,oid,_33a,attr,_33b=this.objectIdField,mode=this._mode,_33c=this._isTable;var _33d=this.editFieldsInfo,_33e=this.getOutFields()||[],_33f=_33d&&_33d.creatorField,_340=_33d&&_33d.creationDateField,_341=_33d&&_33d.editorField,_342=_33d&&_33d.editDateField,_343=_33d&&_33d.realm;if(_1c9.indexOf(_33e,"*")===-1){if(_33f&&_1c9.indexOf(_33e,_33f)===-1){_33f=null;}if(_340&&_1c9.indexOf(_33e,_340)===-1){_340=null;}if(_341&&_1c9.indexOf(_33e,_341)===-1){_341=null;}if(_342&&_1c9.indexOf(_33e,_342)===-1){_342=null;}}var _344=(_340||_342)?(new Date()).getTime():null,_345=(_33f||_341)?this.getUserId():undefined;if(_345&&_343){_345=_345+"@"+_343;}if(_336){for(i=0;i<_336.length;i++){_336[i]=new _1e5(_336[i]);if(_33c){continue;}_339=_336[i];if(_339.success){oid=_339.objectId;_33a=adds[i];var gl=_33a._graphicsLayer;if(gl&&gl!==this){gl.remove(_33a);}attr=_33a.attributes||{};attr[_33b]=oid;if(_33f){attr[_33f]=_345;}if(_341){attr[_341]=_345;}if(_340){attr[_340]=_344;}if(_342){attr[_342]=_344;}_33a.setAttributes(attr);if(mode._init){mode.drawFeature(_33a);}}}}if(_337){for(i=0;i<_337.length;i++){_337[i]=new _1e5(_337[i]);if(_33c){continue;}_339=_337[i];if(_339.success){oid=_339.objectId;_33a=_333[oid];var _346=mode._getFeature(oid);if(_346){if(_346.geometry!==_33a.geometry){_346.setGeometry(_1de.fromJson(_33a.geometry.toJson()));}this._repaint(_346,oid);}_33a=_346||_33a;attr=_33a.attributes||{};if(_341){attr[_341]=_345;}if(_342){attr[_342]=_344;}_33a.setAttributes(attr);}}}if(_338){var _347=[];for(i=0;i<_338.length;i++){_338[i]=new _1e5(_338[i]);if(_33c){continue;}_339=_338[i];if(_339.success){oid=_339.objectId;_33a=mode._getFeature(oid);if(_33a){if(this._unSelectFeatureIIf(oid,mode)){_347.push(_33a);}_33a._count=0;mode._removeFeatureIIf(oid);}}}if(_347.length>0){this.onSelectionComplete(_347,this.constructor.SELECTION_SUBTRACT);}}this._resolve([_336,_337,_338],"onEditsComplete",_334,dfd);},_sendAttachment:function(type,_348,_349,_34a,_34b){var _34c=(type==="add")?"addAttachment":"updateAttachment",url=this._url.path+"/"+_348+"/"+_34c,self=this;var dfd=_1d0({url:url,form:_349,content:lang.mixin(this._url.query,{f:"json",token:this._getToken()||undefined}),callbackParamName:"callback.html",handleAs:"json"}).addCallback(function(_34d){var _34e=(type==="add")?"addAttachmentResult":"updateAttachmentResult",_34f=(type==="add")?"onAddAttachmentComplete":"onUpdateAttachmentComplete",_350=new _1e5(_34d[_34e]);_350.attachmentId=_350.objectId;_350.objectId=_348;self._resolve([_350],_34f,_34a);return _350;}).addErrback(function(_351){self._resolve([_351],null,_34b,null,true);});return dfd;},_repaint:function(_352,oid,_353){oid=_1cf.isDefined(oid)?oid:_352.attributes[this.objectIdField];if(!(oid in this._selectedFeatures)||!this._selectionSymbol){_352.setSymbol(_352.symbol,_353);}},_getKind:function(_354){var _355=this._trackManager;if(_355){return _355.isLatestObservation(_354)?1:0;}return 0;}});lang.mixin(_1ea,{MODE_SNAPSHOT:0,MODE_ONDEMAND:1,MODE_SELECTION:2,SELECTION_NEW:3,SELECTION_ADD:4,SELECTION_SUBTRACT:5,POPUP_NONE:"esriServerHTMLPopupTypeNone",POPUP_HTML_TEXT:"esriServerHTMLPopupTypeAsHTMLText",POPUP_URL:"esriServerHTMLPopupTypeAsURL"});_1df._createWrappers(_1ea);if(has("extend-esri")){lang.setObject("layers.FeatureLayer",_1ea,_1ce);}return _1ea;});},"esri/tasks/ImageServiceIdentifyResult":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","esri/kernel","esri/geometry/jsonUtils","esri/tasks/FeatureSet"],function(_356,lang,has,_357,_358,_359){var _35a=_356(null,{declaredClass:"esri.tasks.ImageServiceIdentifyResult",constructor:function(json){if(json.catalogItems){this.catalogItems=new _359(json.catalogItems);}if(json.location){this.location=_358.fromJson(json.location);}this.catalogItemVisibilities=json.catalogItemVisibilities;this.name=json.name;this.objectId=json.objectId;this.value=json.value;this.properties=json.properties;}});if(has("extend-esri")){lang.setObject("tasks.ImageServiceIdentifyResult",_35a,_357);}return _35a;});},"esri/virtualearth/VETiledLayer":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/_base/array","dojo/_base/config","dojo/has","dojo/string","dojo/_base/Deferred","esri/kernel","esri/urlUtils","esri/SpatialReference","esri/layers/TileInfo","esri/layers/TiledMapServiceLayer","esri/geometry/Extent","esri/request"],function(_35b,lang,_35c,_35d,_35e,has,_35f,_360,_361,_362,_363,_364,_365,_366,_367){var VET=_35b(_365,{declaredClass:"esri.virtualearth.VETiledLayer",constructor:function(_368){try{_368=lang.mixin({bingMapsKey:null,culture:"en-US"},_368||{});var _369=window.location.protocol;if(_369==="file:"){_369="http:";}this.url=_369+"//dev.virtualearth.net/REST/v1";this._url=_362.urlToObject(this.url);this.spatialReference=new _363({wkid:102100});this.tileInfo=new _364({rows:256,cols:256,dpi:96,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:0.597164283559817,scale:2256.994353},{level:19,resolution:0.298582141647617,scale:1128.497176}]});this.initialExtent=(this.fullExtent=new _366(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,new _363({wkid:102100})));lang.mixin(this,_368);this.hasAttributionData=this.showAttribution;this._initLayer=lang.hitch(this,this._initLayer);this._errorHandler=lang.hitch(this,this._errorHandler);this._getTileInfo=lang.hitch(this,this._getTileInfo);if(this.bingMapsKey){this._getTileInfo();}else{throw new Error("BingMapsKey must be provided.");}}catch(e){this.onError(e);throw e;}},_unsetMap:function(map,_36a){this.inherited("_unsetMap",arguments);},_getTileInfo:function(){if(!this.mapStyle){return;}var url=this._url.path+"/Imagery/Metadata/"+this.mapStyle;if(this.bingMapsKey){var info=this.resourceInfo;if(!this.loaded&&info){this._initLayer(info);}else{_367({url:url,content:lang.mixin({},{key:this.bingMapsKey,ss:true,c:this.culture,include:this.hasAttributionData?"imageryProviders":null}),callbackParamName:"jsonp",load:this._initLayer,error:this._errorHandler});}}},_initLayer:function(_36b,io){try{this.resourceInfo=_35c.toJson(_36b);var _36c=_36b.resourceSets[0].resources[0];var _36d=_36c.imageUrl.replace("{","${");this.tileServers=_35d.map(_36c.imageUrlSubdomains,function(_36e){var _36f=window.location.protocol;if(_36f==="file:"){_36f="http:";}return _35f.substitute(_36d,{subdomain:_36e}).replace("http:",_36f);});this._tsLength=this.tileServers.length;if(!this.loaded){this.copyright=this.copyright||"&copy; 2012 Microsoft Corporation and its data suppliers";this.loaded=true;this.onLoad(this);var _370=this.loadCallback;if(_370){delete this.loadCallback;_370(this);}}else{this.refresh();this.onMapStyleChange();}}catch(e){this.onError(e);}},getAttributionData:function(){var dfd=new _360(),_371=_35c.fromJson(this.resourceInfo),_372;if(this.hasAttributionData&&_371){_372=lang.getObject("resourceSets.0.resources.0.imageryProviders",false,_371);}if(_372){dfd.callback({contributors:_372});}else{var err=new Error("Layer does not have attribution data");err.log=_35e.isDebug;dfd.errback(err);}return dfd;},getTileUrl:function(_373,row,col){var _374=this.tileServers[row%this._tsLength],_375=_374.replace(/\{/g,"${");return _35f.substitute(_375,{quadkey:this._getQuadKey(_373,row,col),culture:this.culture,token:this.bingMapsKey});},_getQuadKey:function(_376,row,col){var _377="",_378,mask,i;for(i=_376;i>0;i--){_378="0";mask=1<<(i-1);if((col&mask)!=0){_378++;}if((row&mask)!=0){_378++;_378++;}_377=_377+_378;}return _377;},setMapStyle:function(_379){this.mapStyle=_379;this._getTileInfo();},setCulture:function(_37a){this.culture=_37a;this._getTileInfo();},setBingMapsKey:function(_37b){this.bingMapsKey=_37b;},onMapStyleChange:function(){}});lang.mixin(VET,{MAP_STYLE_AERIAL:"aerial",MAP_STYLE_AERIAL_WITH_LABELS:"aerialWithLabels",MAP_STYLE_ROAD:"road"});if(has("extend-esri")){lang.setObject("virtualearth.VETiledLayer",VET,_361);}return VET;});},"dojo/touch":function(){define(["./_base/kernel","./aspect","./dom","./_base/lang","./on","./has","./mouse","./domReady","./_base/window"],function(dojo,_37c,dom,lang,on,has,_37d,_37e,win){var _37f=navigator.msPointerEnabled;var _380;function _381(_382,_383,_384){if(_37f&&_384){return function(node,_385){return on(node,_384,_385);};}else{if(has("touch")){return function(node,_386){var _387=on(node,_383,_386),_388=on(node,_382,function(evt){if(!_380||(new Date()).getTime()>_380+1000){_386.call(this,evt);}});return {remove:function(){_387.remove();_388.remove();}};};}else{return function(node,_389){return on(node,_382,_389);};}}};var _38a,_38b,_38c;if(has("touch")&&!_37f){_37e(function(){_38c=win.body();win.doc.addEventListener("touchstart",function(_38d){_380=(new Date()).getTime();var _38e=_38c;_38c=_38d.target;if(_38c.dojoElementFromPoint){_38c=_38c.dojoElementFromPoint(_38d.changedTouches[0].clientX,_38d.changedTouches[0].clientY);}if(_38e){on.emit(_38e,"dojotouchout",{target:_38e,relatedTarget:_38c,bubbles:true});}if(_38c){on.emit(_38c,"dojotouchover",{target:_38c,relatedTarget:_38e,bubbles:true});}},true);on(win.doc,"touchmove",function(_38f){_380=(new Date()).getTime();_38b=_38f;var _390=win.doc.elementFromPoint(_38f.clientX,_38f.clientY);if(_390){var _391=_390;if(_390.dojoElementFromPoint){_390=_390.dojoElementFromPoint(_38f.clientX,_38f.clientY);}if(_38c!==_390){if(_38c){on.emit(_391,"dojotouchout",{target:_38c,relatedTarget:_390,bubbles:true});}if(_390){on.emit(_391,"dojotouchover",{target:_390,relatedTarget:_38c,bubbles:true});}_38c=_390;}on.emit(_391,"dojotouchmove",{target:_390,bubbles:true});}});on(win.doc,"touchend",function(_392){var node=win.doc.elementFromPoint(_392.clientX,_392.clientY);var _393=node;if(node.dojoElementFromPoint){node=node.dojoElementFromPoint(_392.clientX,_392.clientY);}if(node){on.emit(_393,"dojotouchend",lang.delegate(_392,{target:node,bubbles:true}));}});});_38a=function(node,_394){return on(node,"dojotouchmove",function(_395){_394(lang.delegate(_38b,{target:_395.target,preventDefault:function(){_38b.preventDefault();},stopPropagation:function(){_395.stopPropagation();}}));});};}var _396={press:_381("mousedown","touchstart","MSPointerDown"),move:_381("mousemove",_38a,"MSPointerMove"),release:_381("mouseup","dojotouchend","MSPointerUp"),cancel:_381(_37d.leave,"touchcancel",has("touch")?"MSPointerCancel":null),over:_381("mouseover","dojotouchover","MSPointerOver"),out:_381("mouseout","dojotouchout","MSPointerOut"),enter:_37d._eventHandler(_381("mouseover","dojotouchover","MSPointerOver")),leave:_37d._eventHandler(_381("mouseout","dojotouchout","MSPointerOut"))};1&&(dojo.touch=_396);return _396;});},"esri/layers/WMSLayerInfo":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/has","esri/kernel"],function(_397,lang,_398,has,_399){var _39a=_397(null,{declaredClass:"esri.layers.WMSLayerInfo",name:null,title:null,description:null,extent:null,legendURL:null,subLayers:[],allExtents:[],spatialReferences:[],constructor:function(_39b){if(_39b){this.name=_39b.name;this.title=_39b.title;this.description=_39b.description;this.extent=_39b.extent;this.legendURL=_39b.legendURL;this.subLayers=_39b.subLayers?_39b.subLayers:[];this.allExtents=_39b.allExtents?_39b.allExtents:[];this.spatialReferences=_39b.spatialReferences?_39b.spatialReferences:[];}},clone:function(){var info={name:this.name,title:this.title,description:this.description,legendURL:this.legendURL},wkid;if(this.extent){info.extent=this.extent.getExtent();}info.subLayers=[];_398.forEach(this.subLayers,function(_39c){info.subLayers.push(_39c.clone());});info.allExtents=[];for(wkid in this.allExtents){wkid=parseInt(wkid,10);if(!isNaN(wkid)){info.allExtents[wkid]=this.allExtents[wkid].getExtent();}}info.spatialReferences=[];_398.forEach(this.spatialReferences,function(wkid){info.spatialReferences.push(wkid);});return info;}});if(has("extend-esri")){lang.setObject("layers.WMSLayerInfo",_39a,_399);}return _39a;});},"dijit/_WidgetsInTemplateMixin":function(){define("dijit/_WidgetsInTemplateMixin",["dojo/_base/array","dojo/_base/declare","dojo/parser"],function(_39d,_39e,_39f){return _39e("dijit._WidgetsInTemplateMixin",null,{_earlyTemplatedStartup:false,widgetsInTemplate:true,_beforeFillContent:function(){if(this.widgetsInTemplate){var node=this.domNode;var cw=(this._startupWidgets=_39f.parse(node,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang,textDir:this.textDir},propsThis:this,scope:"dojo"}));if(!cw.isFulfilled()){throw new Error(this.declaredClass+": parser returned unfilled promise (probably waiting for module auto-load), "+"unsupported by _WidgetsInTemplateMixin.   Must pre-load all supporting widgets before instantiation.");}this._attachTemplateNodes(cw,function(n,p){return n[p];});}},startup:function(){_39d.forEach(this._startupWidgets,function(w){if(w&&!w._started&&w.startup){w.startup();}});this.inherited(arguments);}});});},"esri/layers/KMLFolder":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","esri/kernel","esri/lang"],function(_3a0,lang,has,_3a1,_3a2){var _3a3=_3a0(null,{declaredClass:"esri.layers.KMLFolder",constructor:function(json){lang.mixin(this,json);if(_3a2.isDefined(this.visibility)){this.visible=!!this.visibility;}}});if(has("extend-esri")){lang.setObject("layers.KMLFolder",_3a3,_3a1);}return _3a3;});},"esri/layers/RenderMode":function(){define(["dojo/_base/kernel","dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/has","dojo/io/script","esri/kernel"],function(_3a4,_3a5,lang,_3a6,has,_3a7,_3a8){var _3a9=_3a5(null,{declaredClass:"esri.layers._RenderMode",constructor:function(){this._prefix="jsonp_"+(_3a4._scopeName||"dojo")+"IoScript";},initialize:function(map){this.map=map;this._init=true;},startup:function(){},propertyChangeHandler:function(type){},destroy:function(){this._init=false;},drawFeature:function(_3aa){},suspend:function(){},resume:function(){},refresh:function(){},_incRefCount:function(oid){var _3ab=this._featureMap[oid];if(_3ab){_3ab._count++;}},_decRefCount:function(oid){var _3ac=this._featureMap[oid];if(_3ac){_3ac._count--;}},_getFeature:function(oid){return this._featureMap[oid];},_addFeatureIIf:function(oid,_3ad){var fmap=this._featureMap,_3ae=fmap[oid],_3af=this.featureLayer;if(!_3ae){fmap[oid]=_3ad;_3af._add(_3ad);_3ad._count=0;}return _3ae||_3ad;},_removeFeatureIIf:function(oid){var _3b0=this._featureMap[oid],_3b1=this.featureLayer;if(_3b0){if(_3b0._count){return;}delete this._featureMap[oid];_3b1._remove(_3b0);}return _3b0;},_clearIIf:function(){var i,_3b2=this.featureLayer,_3b3=_3b2.graphics,_3b4=_3b2._selectedFeatures,_3b5=_3b2.objectIdField;for(i=_3b3.length-1;i>=0;i--){var _3b6=_3b3[i];var oid=_3b6.attributes[_3b5];if(oid in _3b4){_3b6._count=1;continue;}_3b6._count=0;this._removeFeatureIIf(oid);}},_isPending:function(id){var dfd=_3a7[this._prefix+id];return dfd?true:false;},_cancelPendingRequest:function(dfd,id){dfd=dfd||_3a7[this._prefix+id];if(dfd){try{dfd.cancel();_3a7._validCheck(dfd);}catch(e){}}},_purgeRequests:function(){_3a7._validCheck(null);},_toggleVisibility:function(show){var _3b7=this.featureLayer,_3b8=_3b7.graphics,_3b9=show?"show":"hide",i,len=_3b8.length;show=show&&_3b7._ager;for(i=0;i<len;i++){var _3ba=_3b8[i];_3ba[_3b9]();if(show){_3b7._repaint(_3ba);}}},_applyTimeFilter:function(_3bb){var _3bc=this.featureLayer;if(!_3bc.timeInfo||_3bc.suspended){return;}if(!_3bb){_3bc._fireUpdateStart();}var _3bd=_3bc._trackManager;if(_3bd){_3bd.clearTracks();}var defn=_3bc.getTimeDefinition(),_3be=_3bc._getOffsettedTE(_3bc._mapTimeExtent);if(_3be){_3be=_3bc._getTimeOverlap(defn,_3be);if(_3be){var _3bf=_3bc._filterByTime(_3bc.graphics,_3be.startTime,_3be.endTime);if(_3bd){_3bd.addFeatures(_3bf.match);}_3a6.forEach(_3bf.match,function(_3c0){var _3c1=_3c0._shape;if(!_3c0.visible){_3c0.show();_3c1=_3c0._shape;_3c1&&_3c1._moveToFront();}if(_3bc._ager&&_3c1){_3bc._repaint(_3c0);}});_3a6.forEach(_3bf.noMatch,function(_3c2){if(_3c2.visible){_3c2.hide();}});}else{this._toggleVisibility(false);}}else{if(_3bd){_3bd.addFeatures(_3bc.graphics);}this._toggleVisibility(true);}if(_3bd){_3bd.moveLatestToFront();_3bd.drawTracks();}if(!_3bb){_3bc._fireUpdateEnd();}}});if(has("extend-esri")){lang.setObject("layers._RenderMode",_3a9,_3a8);}return _3a9;});},"esri/layers/FeatureType":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/has","esri/kernel","esri/lang","esri/symbols/jsonUtils","esri/layers/RangeDomain","esri/layers/CodedValueDomain","esri/layers/InheritedDomain","esri/layers/FeatureTemplate"],function(_3c3,lang,_3c4,has,_3c5,_3c6,_3c7,_3c8,_3c9,_3ca,_3cb){var _3cc=_3c3(null,{declaredClass:"esri.layers.FeatureType",constructor:function(json){if(json&&lang.isObject(json)){this.id=json.id;this.name=json.name;var _3cd=json.symbol;if(_3cd){this.symbol=_3c7.fromJson(_3cd);}var _3ce=json.domains,_3cf,i;var _3d0=this.domains={};for(_3cf in _3ce){if(_3ce.hasOwnProperty(_3cf)){var _3d1=_3ce[_3cf];switch(_3d1.type){case "range":_3d0[_3cf]=new _3c8(_3d1);break;case "codedValue":_3d0[_3cf]=new _3c9(_3d1);break;case "inherited":_3d0[_3cf]=new _3ca(_3d1);break;}}}var _3d2=json.templates;if(_3d2){var _3d3=this.templates=[];for(i=0;i<_3d2.length;i++){_3d3.push(new _3cb(_3d2[i]));}}}},toJson:function(){var json={id:this.id,name:this.name,symbol:this.symbol&&this.symbol.toJson()};var _3d4,_3d5=this.domains,_3d6=this.templates,_3d7=_3c6.fixJson;if(_3d5){var _3d8=json.domains={};for(_3d4 in _3d5){if(_3d5.hasOwnProperty(_3d4)){_3d8[_3d4]=_3d5[_3d4]&&_3d5[_3d4].toJson();}}_3d7(_3d8);}if(_3d6){json.templates=_3c4.map(_3d6,function(_3d9){return _3d9.toJson();});}return _3d7(json);}});if(has("extend-esri")){lang.setObject("layers.FeatureType",_3cc,_3c5);}return _3cc;});},"esri/layers/TrackManager":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/has","esri/kernel","esri/graphic","esri/geometry/Polyline","esri/layers/GraphicsLayer"],function(_3da,lang,_3db,has,_3dc,_3dd,_3de,_3df){var _3e0=_3da(null,{declaredClass:"esri.layers._TrackManager",constructor:function(_3e1){this.layer=_3e1;this.trackMap={};},initialize:function(map){this.map=map;var _3e2=this.layer,_3e3=_3e2.renderer.trackRenderer;if(_3e3&&(_3e2.geometryType==="esriGeometryPoint")){var _3e4=(this.container=new _3df._GraphicsLayer({id:_3e2.id+"_tracks",_child:true}));_3e4.loaded=true;_3e4.onLoad(_3e4);_3e4._setMap(map,_3e2._div);_3e4.setRenderer(_3e3);}},addFeatures:function(_3e5){var tkid,_3e6=this.trackMap,_3e7=this.layer,_3e8=_3e7._trackIdField;_3db.forEach(_3e5,function(_3e9){var _3ea=_3e9.attributes;tkid=_3ea[_3e8];var ary=(_3e6[tkid]=(_3e6[tkid]||[]));ary.push(_3e9);});var _3eb=_3e7._startTimeField,_3ec=_3e7.objectIdField;var _3ed=function(a,b){var _3ee=a.attributes[_3eb],_3ef=b.attributes[_3eb];if(_3ee===_3ef){return (a.attributes[_3ec]<b.attributes[_3ec])?-1:1;}else{return (_3ee<_3ef)?-1:1;}};for(tkid in _3e6){_3e6[tkid].sort(_3ed);}},drawTracks:function(){var _3f0=this.container;if(!_3f0){return;}var _3f1=this.trackMap,sr=this.map.spatialReference,tkid,ary,path,i,_3f2,_3f3=this.layer._trackIdField,_3f4;for(tkid in _3f1){ary=_3f1[tkid];path=[];for(i=ary.length-1;i>=0;i--){_3f2=ary[i].geometry;if(_3f2){path.push([_3f2.x,_3f2.y]);}}_3f4={};_3f4[_3f3]=tkid;if(path.length>0){_3f0.add(new _3dd(new _3de({paths:[path],spatialReference:sr}),null,_3f4));}}},moveLatestToFront:function(){_3db.forEach(this.getLatestObservations(),function(_3f5){var _3f6=_3f5._shape;_3f6&&_3f6._moveToFront();this._repaint(_3f5,null,true);},this.layer);},getLatestObservations:function(){var _3f7=[];if(!this.layer.renderer.latestObservationRenderer){return _3f7;}var _3f8=this.trackMap,tkid;for(tkid in _3f8){var ary=_3f8[tkid];_3f7.push(ary[ary.length-1]);}return _3f7;},clearTracks:function(){var _3f9=this.getLatestObservations();this.trackMap={};var _3fa=this.container;if(_3fa){_3fa.clear();}_3db.forEach(_3f9,function(_3fb){this._repaint(_3fb,null,true);},this.layer);},isLatestObservation:function(_3fc){var _3fd=this.layer._trackIdField;var _3fe=this.trackMap[_3fc.attributes[_3fd]];if(_3fe){return (_3fe[_3fe.length-1]===_3fc);}return false;},destroy:function(){var _3ff=this.container;if(_3ff){_3ff.clear();_3ff._unsetMap(this.map,this.layer._div);this.container=null;}this.map=null;this.layer=null;this.trackMap=null;}});if(has("extend-esri")){lang.setObject("layers._TrackManager",_3e0,_3dc);}return _3e0;});},"esri/layers/GridLayout":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/has","esri/kernel","esri/SpatialReference","esri/geometry/Extent","esri/geometry/Polyline"],function(_400,lang,_401,has,_402,_403,_404,_405){var _406=_400(null,{declaredClass:"esri.layers._GridLayout",constructor:function(_407,_408,_409,_40a){this.origin=_407;this.cellWidth=_408.width;this.cellHeight=_408.height;this.mapWidth=_409.width;this.mapHeight=_409.height;this.srInfo=_40a;},setResolution:function(_40b){this._resolution=(_40b.xmax-_40b.xmin)/this.mapWidth;if(this.srInfo){var _40c=Math.round((2*this.srInfo.valid[1])/this._resolution),_40d=Math.round(_40c/this.cellWidth);this._frameStats=[_40d,0,_40d-1];}},getCellCoordinates:function(_40e){var res=this._resolution,_40f=this.origin;return {row:Math.floor((_40f.y-_40e.y)/(this.cellHeight*res)),col:Math.floor((_40e.x-_40f.x)/(this.cellWidth*res))};},normalize:function(col){var _410=this._frameStats;if(_410){var _411=_410[0],m180=_410[1],p180=_410[2];if(col<m180){col=col%_411;col=col<m180?col+_411:col;}else{if(col>p180){col=col%_411;}}}return col;},intersects:function(_412,_413){var _414=this.srInfo;if(_414){return _401.some(_413._getParts(_414),function(_415){return _412.intersects(_415.extent);});}else{return _412.intersects(_413);}},getCellExtent:function(row,col){var res=this._resolution,_416=this.origin,_417=this.cellWidth,_418=this.cellHeight;return new _404((col*_417*res)+_416.x,_416.y-((row+1)*_418*res),((col+1)*_417*res)+_416.x,_416.y-(row*_418*res),new _403(_416.spatialReference.toJson()));},getLatticeID:function(_419){var _41a=this.getCellCoordinates({x:_419.xmin,y:_419.ymax}),_41b=this.getCellCoordinates({x:_419.xmax,y:_419.ymin}),_41c=_41a.row,_41d=_41b.row,_41e=this.normalize(_41a.col),_41f=this.normalize(_41b.col);return _41c+"_"+_41d+"_"+_41e+"_"+_41f;},sorter:function(a,b){return (a<b)?-1:1;},getCellsInExtent:function(_420,_421){var _422=this.getCellCoordinates({x:_420.xmin,y:_420.ymax}),_423=this.getCellCoordinates({x:_420.xmax,y:_420.ymin}),_424=_422.row,_425=_423.row,_426=_422.col,_427=_423.col,_428=[],i,j,nj,_429=[],_42a=[],len,xmin,xmax,ymin,ymax,_42b=[],_42c,_42d;for(i=_424;i<=_425;i++){for(j=_426;j<=_427;j++){nj=this.normalize(j);_420=this.getCellExtent(i,nj);_428.push({row:i,col:nj,extent:_420,resolution:this._resolution});if(_421){_429.push(_420.xmin,_420.xmax);_42a.push(_420.ymin,_420.ymax);}}}_426=this.normalize(_426);_427=this.normalize(_427);_429.sort(this.sorter);_42a.sort(this.sorter);len=_429.length;for(i=len-1;i>=0;i--){if(i<(len-1)){if(_429[i]===_429[i+1]){_429.splice(i,1);}}}len=_42a.length;for(i=len-1;i>=0;i--){if(i<(len-1)){if(_42a[i]===_42a[i+1]){_42a.splice(i,1);}}}if(_429.length&&_42a.length){xmin=_429[0];xmax=_429[_429.length-1];ymin=_42a[0];ymax=_42a[_42a.length-1];len=_429.length;for(i=0;i<len;i++){_42b.push([[_429[i],ymax],[_429[i],ymin]]);}len=_42a.length;for(i=0;i<len;i++){_42b.push([[xmin,_42a[i]],[xmax,_42a[i]]]);}_42c=new _405({paths:_42b,spatialReference:this.origin.spatialReference.toJson()});_42d=_424+"_"+_425+"_"+_426+"_"+_427;_428.push({latticeID:_42d,lattice:_42c,resolution:this._resolution});}return {minRow:_424,maxRow:_425,minCol:_426,maxCol:_427,cells:_428};}});if(has("extend-esri")){lang.setObject("layers._GridLayout",_406,_402);}return _406;});},"dojo/data/util/simpleFetch":function(){define(["../../_base/lang","../../_base/kernel","./sorter"],function(lang,_42e,_42f){var _430={};lang.setObject("dojo.data.util.simpleFetch",_430);_430.errorHandler=function(_431,_432){if(_432.onError){var _433=_432.scope||_42e.global;_432.onError.call(_433,_431,_432);}};_430.fetchHandler=function(_434,_435){var _436=_435.abort||null,_437=false,_438=_435.start?_435.start:0,_439=(_435.count&&(_435.count!==Infinity))?(_438+_435.count):_434.length;_435.abort=function(){_437=true;if(_436){_436.call(_435);}};var _43a=_435.scope||_42e.global;if(!_435.store){_435.store=this;}if(_435.onBegin){_435.onBegin.call(_43a,_434.length,_435);}if(_435.sort){_434.sort(_42f.createSortFunction(_435.sort,this));}if(_435.onItem){for(var i=_438;(i<_434.length)&&(i<_439);++i){var item=_434[i];if(!_437){_435.onItem.call(_43a,item,_435);}}}if(_435.onComplete&&!_437){var _43b=null;if(!_435.onItem){_43b=_434.slice(_438,_439);}_435.onComplete.call(_43a,_43b,_435);}};_430.fetch=function(_43c){_43c=_43c||{};if(!_43c.store){_43c.store=this;}this._fetchItems(_43c,lang.hitch(this,"fetchHandler"),lang.hitch(this,"errorHandler"));return _43c;};return _430;});},"dojox/data/CsvStore":function(){define("dojox/data/CsvStore",["dojo/_base/lang","dojo/_base/declare","dojo/_base/xhr","dojo/_base/kernel","dojo/data/util/filter","dojo/data/util/simpleFetch"],function(lang,_43d,xhr,_43e,_43f,_440){var _441=_43d("dojox.data.CsvStore",null,{constructor:function(_442){this._attributes=[];this._attributeIndexes={};this._dataArray=[];this._arrayOfAllItems=[];this._loadFinished=false;if(_442.url){this.url=_442.url;}this._csvData=_442.data;if(_442.label){this.label=_442.label;}else{if(this.label===""){this.label=undefined;}}this._storeProp="_csvStore";this._idProp="_csvId";this._features={"dojo.data.api.Read":true,"dojo.data.api.Identity":true};this._loadInProgress=false;this._queuedFetches=[];this.identifier=_442.identifier;if(this.identifier===""){delete this.identifier;}else{this._idMap={};}if("separator" in _442){this.separator=_442.separator;}if("urlPreventCache" in _442){this.urlPreventCache=_442.urlPreventCache?true:false;}},url:"",label:"",identifier:"",separator:",",urlPreventCache:false,_assertIsItem:function(item){if(!this.isItem(item)){throw new Error(this.declaredClass+": a function was passed an item argument that was not an item");}},_getIndex:function(item){var idx=this.getIdentity(item);if(this.identifier){idx=this._idMap[idx];}return idx;},getValue:function(item,_443,_444){this._assertIsItem(item);var _445=_444;if(typeof _443==="string"){var ai=this._attributeIndexes[_443];if(ai!=null){var _446=this._dataArray[this._getIndex(item)];_445=_446[ai]||_444;}}else{throw new Error(this.declaredClass+": a function was passed an attribute argument that was not a string");}return _445;},getValues:function(item,_447){var _448=this.getValue(item,_447);return (_448?[_448]:[]);},getAttributes:function(item){this._assertIsItem(item);var _449=[];var _44a=this._dataArray[this._getIndex(item)];for(var i=0;i<_44a.length;i++){if(_44a[i]!==""){_449.push(this._attributes[i]);}}return _449;},hasAttribute:function(item,_44b){this._assertIsItem(item);if(typeof _44b==="string"){var _44c=this._attributeIndexes[_44b];var _44d=this._dataArray[this._getIndex(item)];return (typeof _44c!=="undefined"&&_44c<_44d.length&&_44d[_44c]!=="");}else{throw new Error(this.declaredClass+": a function was passed an attribute argument that was not a string");}},containsValue:function(item,_44e,_44f){var _450=undefined;if(typeof _44f==="string"){_450=_43f.patternToRegExp(_44f,false);}return this._containsValue(item,_44e,_44f,_450);},_containsValue:function(item,_451,_452,_453){var _454=this.getValues(item,_451);for(var i=0;i<_454.length;++i){var _455=_454[i];if(typeof _455==="string"&&_453){return (_455.match(_453)!==null);}else{if(_452===_455){return true;}}}return false;},isItem:function(_456){if(_456&&_456[this._storeProp]===this){var _457=_456[this._idProp];if(this.identifier){var data=this._dataArray[this._idMap[_457]];if(data){return true;}}else{if(_457>=0&&_457<this._dataArray.length){return true;}}}return false;},isItemLoaded:function(_458){return this.isItem(_458);},loadItem:function(item){},getFeatures:function(){return this._features;},getLabel:function(item){if(this.label&&this.isItem(item)){return this.getValue(item,this.label);}return undefined;},getLabelAttributes:function(item){if(this.label){return [this.label];}return null;},_fetchItems:function(_459,_45a,_45b){var self=this;var _45c=function(_45d,_45e){var _45f=null;if(_45d.query){var key,_460;_45f=[];var _461=_45d.queryOptions?_45d.queryOptions.ignoreCase:false;var _462={};for(key in _45d.query){_460=_45d.query[key];if(typeof _460==="string"){_462[key]=_43f.patternToRegExp(_460,_461);}}for(var i=0;i<_45e.length;++i){var _463=true;var _464=_45e[i];for(key in _45d.query){_460=_45d.query[key];if(!self._containsValue(_464,key,_460,_462[key])){_463=false;}}if(_463){_45f.push(_464);}}}else{_45f=_45e.slice(0,_45e.length);}_45a(_45f,_45d);};if(this._loadFinished){_45c(_459,this._arrayOfAllItems);}else{if(this.url!==""){if(this._loadInProgress){this._queuedFetches.push({args:_459,filter:_45c});}else{this._loadInProgress=true;var _465={url:self.url,handleAs:"text",preventCache:self.urlPreventCache};var _466=xhr.get(_465);_466.addCallback(function(data){try{self._processData(data);_45c(_459,self._arrayOfAllItems);self._handleQueuedFetches();}catch(e){_45b(e,_459);}});_466.addErrback(function(_467){self._loadInProgress=false;if(_45b){_45b(_467,_459);}else{throw _467;}});var _468=null;if(_459.abort){_468=_459.abort;}_459.abort=function(){var df=_466;if(df&&df.fired===-1){df.cancel();df=null;}if(_468){_468.call(_459);}};}}else{if(this._csvData){try{this._processData(this._csvData);this._csvData=null;_45c(_459,this._arrayOfAllItems);}catch(e){_45b(e,_459);}}else{var _469=new Error(this.declaredClass+": No CSV source data was provided as either URL or String data input.");if(_45b){_45b(_469,_459);}else{throw _469;}}}}},close:function(_46a){},_getArrayOfArraysFromCsvFileContents:function(_46b){if(lang.isString(_46b)){var _46c=new RegExp("^\\s+","g");var _46d=new RegExp("\\s+$","g");var _46e=new RegExp("\"\"","g");var _46f=[];var i;var _470=this._splitLines(_46b);for(i=0;i<_470.length;++i){var _471=_470[i];if(_471.length>0){var _472=_471.split(this.separator);var j=0;while(j<_472.length){var _473=_472[j];var _474=_473.replace(_46c,"");var _475=_474.replace(_46d,"");var _476=_475.charAt(0);var _477=_475.charAt(_475.length-1);var _478=_475.charAt(_475.length-2);var _479=_475.charAt(_475.length-3);if(_475.length===2&&_475=="\"\""){_472[j]="";}else{if((_476=="\"")&&((_477!="\"")||((_477=="\"")&&(_478=="\"")&&(_479!="\"")))){if(j+1===_472.length){return;}var _47a=_472[j+1];_472[j]=_474+this.separator+_47a;_472.splice(j+1,1);}else{if((_476=="\"")&&(_477=="\"")){_475=_475.slice(1,(_475.length-1));_475=_475.replace(_46e,"\"");}_472[j]=_475;j+=1;}}}_46f.push(_472);}}this._attributes=_46f.shift();for(i=0;i<this._attributes.length;i++){this._attributeIndexes[this._attributes[i]]=i;}this._dataArray=_46f;}},_splitLines:function(_47b){var _47c=[];var i;var line="";var _47d=false;for(i=0;i<_47b.length;i++){var c=_47b.charAt(i);switch(c){case "\"":_47d=!_47d;line+=c;break;case "\r":if(_47d){line+=c;}else{_47c.push(line);line="";if(i<(_47b.length-1)&&_47b.charAt(i+1)=="\n"){i++;}}break;case "\n":if(_47d){line+=c;}else{_47c.push(line);line="";}break;default:line+=c;}}if(line!==""){_47c.push(line);}return _47c;},_processData:function(data){this._getArrayOfArraysFromCsvFileContents(data);this._arrayOfAllItems=[];if(this.identifier){if(this._attributeIndexes[this.identifier]===undefined){throw new Error(this.declaredClass+": Identity specified is not a column header in the data set.");}}for(var i=0;i<this._dataArray.length;i++){var id=i;if(this.identifier){var _47e=this._dataArray[i];id=_47e[this._attributeIndexes[this.identifier]];this._idMap[id]=i;}this._arrayOfAllItems.push(this._createItemFromIdentity(id));}this._loadFinished=true;this._loadInProgress=false;},_createItemFromIdentity:function(_47f){var item={};item[this._storeProp]=this;item[this._idProp]=_47f;return item;},getIdentity:function(item){if(this.isItem(item)){return item[this._idProp];}return null;},fetchItemByIdentity:function(_480){var item;var _481=_480.scope?_480.scope:_43e.global;if(!this._loadFinished){var self=this;if(this.url!==""){if(this._loadInProgress){this._queuedFetches.push({args:_480});}else{this._loadInProgress=true;var _482={url:self.url,handleAs:"text"};var _483=xhr.get(_482);_483.addCallback(function(data){try{self._processData(data);var item=self._createItemFromIdentity(_480.identity);if(!self.isItem(item)){item=null;}if(_480.onItem){_480.onItem.call(_481,item);}self._handleQueuedFetches();}catch(error){if(_480.onError){_480.onError.call(_481,error);}}});_483.addErrback(function(_484){this._loadInProgress=false;if(_480.onError){_480.onError.call(_481,_484);}});}}else{if(this._csvData){try{self._processData(self._csvData);self._csvData=null;item=self._createItemFromIdentity(_480.identity);if(!self.isItem(item)){item=null;}if(_480.onItem){_480.onItem.call(_481,item);}}catch(e){if(_480.onError){_480.onError.call(_481,e);}}}}}else{item=this._createItemFromIdentity(_480.identity);if(!this.isItem(item)){item=null;}if(_480.onItem){_480.onItem.call(_481,item);}}},getIdentityAttributes:function(item){if(this.identifier){return [this.identifier];}else{return null;}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var i=0;i<this._queuedFetches.length;i++){var _485=this._queuedFetches[i];var _486=_485.filter;var _487=_485.args;if(_486){_486(_487,this._arrayOfAllItems);}else{this.fetchItemByIdentity(_485.args);}}this._queuedFetches=[];}}});lang.extend(_441,_440);return _441;});},"esri/layers/RasterFunction":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","esri/kernel","esri/lang"],function(_488,lang,has,_489,_48a){var _48b=_488(null,{declaredClass:"esri.layers.RasterFunction",functionName:null,"arguments":null,"functionArguments":null,variableName:null,outputPixelType:null,constructor:function(_48c){if(!lang.isObject(_48c)){return;}lang.mixin(this,_48c);if(_48c.rasterFunction){this.functionName=_48c.rasterFunction;}if(_48c.rasterFunctionArguments){this["functionArguments"]=_48c.rasterFunctionArguments;}else{if(_48c["arguments"]){this["functionArguments"]=_48c["arguments"];}}},toJson:function(){var json={rasterFunction:this.functionName,rasterFunctionArguments:this.functionArguments||this["arguments"],variableName:this.variableName,outputPixelType:this.outputPixelType?this.outputPixelType:null};return _48a.filter(json,function(_48d){if(_48d!==null&&_48d!==undefined){return true;}});}});if(has("extend-esri")){lang.setObject("layers.RasterFunction",_48b,_489);}return _48b;});},"dojo/date/stamp":function(){define(["../_base/lang","../_base/array"],function(lang,_48e){var _48f={};lang.setObject("dojo.date.stamp",_48f);_48f.fromISOString=function(_490,_491){if(!_48f._isoRegExp){_48f._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;}var _492=_48f._isoRegExp.exec(_490),_493=null;if(_492){_492.shift();if(_492[1]){_492[1]--;}if(_492[6]){_492[6]*=1000;}if(_491){_491=new Date(_491);_48e.forEach(_48e.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(prop){return _491["get"+prop]();}),function(_494,_495){_492[_495]=_492[_495]||_494;});}_493=new Date(_492[0]||1970,_492[1]||0,_492[2]||1,_492[3]||0,_492[4]||0,_492[5]||0,_492[6]||0);if(_492[0]<100){_493.setFullYear(_492[0]||1970);}var _496=0,_497=_492[7]&&_492[7].charAt(0);if(_497!="Z"){_496=((_492[8]||0)*60)+(Number(_492[9])||0);if(_497!="-"){_496*=-1;}}if(_497){_496-=_493.getTimezoneOffset();}if(_496){_493.setTime(_493.getTime()+_496*60000);}}return _493;};_48f.toISOString=function(_498,_499){var _49a=function(n){return (n<10)?"0"+n:n;};_499=_499||{};var _49b=[],_49c=_499.zulu?"getUTC":"get",date="";if(_499.selector!="time"){var year=_498[_49c+"FullYear"]();date=["0000".substr((year+"").length)+year,_49a(_498[_49c+"Month"]()+1),_49a(_498[_49c+"Date"]())].join("-");}_49b.push(date);if(_499.selector!="date"){var time=[_49a(_498[_49c+"Hours"]()),_49a(_498[_49c+"Minutes"]()),_49a(_498[_49c+"Seconds"]())].join(":");var _49d=_498[_49c+"Milliseconds"]();if(_499.milliseconds){time+="."+(_49d<100?"0":"")+_49a(_49d);}if(_499.zulu){time+="Z";}else{if(_499.selector!="time"){var _49e=_498.getTimezoneOffset();var _49f=Math.abs(_49e);time+=(_49e>0?"-":"+")+_49a(Math.floor(_49f/60))+":"+_49a(_49f%60);}}_49b.push(time);}return _49b.join("T");};return _48f;});},"dijit/_Templated":function(){define("dijit/_Templated",["./_WidgetBase","./_TemplatedMixin","./_WidgetsInTemplateMixin","dojo/_base/array","dojo/_base/declare","dojo/_base/lang","dojo/_base/kernel"],function(_4a0,_4a1,_4a2,_4a3,_4a4,lang,_4a5){lang.extend(_4a0,{waiRole:"",waiState:""});return _4a4("dijit._Templated",[_4a1,_4a2],{widgetsInTemplate:false,constructor:function(){_4a5.deprecated(this.declaredClass+": dijit._Templated deprecated, use dijit._TemplatedMixin and if necessary dijit._WidgetsInTemplateMixin","","2.0");},_attachTemplateNodes:function(_4a6,_4a7){this.inherited(arguments);var _4a8=lang.isArray(_4a6)?_4a6:(_4a6.all||_4a6.getElementsByTagName("*"));var x=lang.isArray(_4a6)?0:-1;for(;x<_4a8.length;x++){var _4a9=(x==-1)?_4a6:_4a8[x];var role=_4a7(_4a9,"waiRole");if(role){_4a9.setAttribute("role",role);}var _4aa=_4a7(_4a9,"waiState");if(_4aa){_4a3.forEach(_4aa.split(/\s*,\s*/),function(_4ab){if(_4ab.indexOf("-")!=-1){var pair=_4ab.split("-");_4a9.setAttribute("aria-"+pair[0],pair[1]);}});}}}});});},"esri/dijit/PopupRenderer":function(){define(["require","dojo/_base/declare","dojo/_base/connect","dojo/_base/lang","dojo/_base/array","dojo/_base/kernel","dojo/has","dojo/query","dojo/dom","dojo/dom-attr","dojo/dom-class","dojo/dom-construct","dojo/dom-style","dijit/_Widget","dijit/_Templated","esri/kernel","esri/dijit/_EventedWidget","dojo/i18n!esri/nls/jsapi","dojo/NodeList-dom"],function(_4ac,_4ad,_4ae,lang,_4af,_4b0,has,_4b1,dom,_4b2,_4b3,_4b4,_4b5,_4b6,_4b7,_4b8,_4b9,_4ba){var _4bb=0;var PR=_4ad([_4b9,_4b6,_4b7],{declaredClass:"esri.dijit._PopupRenderer",constructor:function(){this._nls=lang.mixin({},_4ba.widgets.popup);},templateString:"<div class='esriViewPopup'>"+"<div class='mainSection'>"+"<div class='header' dojoAttachPoint='_title'></div>"+"<div class='hzLine'></div>"+"<div dojoAttachPoint='_description'></div>"+"<div class='break'></div>"+"</div>"+"<div class='attachmentsSection hidden'>"+"<div>${_nls.NLS_attach}:</div>"+"<ul dojoAttachPoint='_attachmentsList'>"+"</ul>"+"<div class='break'></div>"+"</div>"+"<div class='mediaSection hidden'>"+"<div class='header' dojoAttachPoint='_mediaTitle'></div>"+"<div class='hzLine'></div>"+"<div class='caption' dojoAttachPoint='_mediaCaption'></div>"+"<div class='gallery' dojoAttachPoint='_gallery'>"+"<div class='mediaHandle prev' dojoAttachPoint='_prevMedia' dojoAttachEvent='onclick: _goToPrevMedia'></div>"+"<div class='mediaHandle next' dojoAttachPoint='_nextMedia' dojoAttachEvent='onclick: _goToNextMedia'></div>"+"<ul class='summary'>"+"<li class='image mediaCount hidden' dojoAttachPoint='_imageCount'>0</li>"+"<li class='image mediaIcon hidden'></li>"+"<li class='chart mediaCount hidden' dojoAttachPoint='_chartCount'>0</li>"+"<li class='chart mediaIcon hidden'></li>"+"</ul>"+"<div class='frame' dojoAttachPoint='_mediaFrame'></div>"+"</div>"+"</div>"+"<div class='editSummarySection hidden' dojoAttachPoint='_editSummarySection'>"+"<div class='break'></div>"+"<div class='break hidden' dojoAttachPoint='_mediaBreak'></div>"+"<div class='editSummary' dojoAttachPoint='_editSummary'></div>"+"</div>"+"</div>",showTitle:true,startup:function(){this.inherited(arguments);var _4bc=this.template,_4bd=this.graphic,_4be=_4bc.getComponents(_4bd),_4bf=this.showTitle?_4be.title:"",_4c0=_4be.description,_4c1=_4be.fields,_4c2=_4be.mediaInfos,_4c3=this.domNode,nls=this._nls;this._prevMedia.title=nls.NLS_prevMedia;this._nextMedia.title=nls.NLS_nextMedia;_4b2.set(this._title,"innerHTML",_4bf);if(!_4bf){_4b3.add(this._title,"hidden");}if(!_4c0&&_4c1){_4c0="";_4af.forEach(_4c1,function(row){_4c0+=("<tr valign='top'>");_4c0+=("<td class='attrName'>"+row[0]+"</td>");_4c0+=("<td class='attrValue'>"+row[1].replace(/^\s*(https?:\/\/[^\s]+)\s*$/i,"<a target='_blank' href='$1' title='$1'>"+nls.NLS_moreInfo+"</a>")+"</td>");_4c0+=("</tr>");});if(_4c0){_4c0="<table class='attrTable' cellpadding='0px' cellspacing='0px'>"+_4c0+"</table>";}}_4b2.set(this._description,"innerHTML",_4c0);if(!_4c0){_4b3.add(this._description,"hidden");}_4b0.query("a",this._description).forEach(function(node){_4b2.set(node,"target","_blank");});if(_4bf&&_4c0){_4b0.query(".mainSection .hzLine",_4c3).removeClass("hidden");}else{if(_4bf||_4c0){_4b0.query(".mainSection .hzLine",_4c3).addClass("hidden");}else{_4b0.query(".mainSection",_4c3).addClass("hidden");}}var dfd=(this._dfd=_4bc.getAttachments(_4bd));if(dfd){dfd.addBoth(lang.hitch(this,this._attListHandler,dfd));_4b2.set(this._attachmentsList,"innerHTML","<li>"+nls.NLS_searching+"...</li>");_4b0.query(".attachmentsSection",_4c3).removeClass("hidden");}if(_4c2&&_4c2.length){_4b0.query(".mediaSection",_4c3).removeClass("hidden");dom.setSelectable(this._mediaFrame,false);this._mediaInfos=_4c2;this._mediaPtr=0;this._updateUI();this._displayMedia();}if(_4be.editSummary){_4b2.set(this._editSummary,"innerHTML",_4be.editSummary);if(_4c2&&_4c2.length){_4b3.remove(this._mediaBreak,"hidden");}_4b3.remove(this._editSummarySection,"hidden");}},destroy:function(){if(this._dfd){this._dfd.cancel();}this._destroyFrame();this.template=this.graphic=this._nls=this._mediaInfos=this._mediaPtr=this._dfd=null;this.inherited(arguments);},_goToPrevMedia:function(){var ptr=this._mediaPtr-1;if(ptr<0){return;}this._mediaPtr--;this._updateUI();this._displayMedia();},_goToNextMedia:function(){var ptr=this._mediaPtr+1;if(ptr===this._mediaInfos.length){return;}this._mediaPtr++;this._updateUI();this._displayMedia();},_updateUI:function(){var _4c4=this._mediaInfos,_4c5=_4c4.length,_4c6=this.domNode,_4c7=this._prevMedia,_4c8=this._nextMedia;if(_4c5>1){var _4c9=0,_4ca=0;_4af.forEach(_4c4,function(info){if(info.type==="image"){_4c9++;}else{if(info.type.indexOf("chart")!==-1){_4ca++;}}});if(_4c9){_4b2.set(this._imageCount,"innerHTML",_4c9);_4b0.query(".summary .image",_4c6).removeClass("hidden");}if(_4ca){_4b2.set(this._chartCount,"innerHTML",_4ca);_4b0.query(".summary .chart",_4c6).removeClass("hidden");}}else{_4b0.query(".summary",_4c6).addClass("hidden");_4b3.add(_4c7,"hidden");_4b3.add(_4c8,"hidden");}var ptr=this._mediaPtr;if(ptr===0){_4b3.add(_4c7,"hidden");}else{_4b3.remove(_4c7,"hidden");}if(ptr===_4c5-1){_4b3.add(_4c8,"hidden");}else{_4b3.remove(_4c8,"hidden");}this._destroyFrame();},_displayMedia:function(){var info=this._mediaInfos[this._mediaPtr],_4cb=info.title,_4cc=info.caption,_4cd=_4b0.query(".mediaSection .hzLine",this.domNode)[0];_4b2.set(this._mediaTitle,"innerHTML",_4cb);_4b3[_4cb?"remove":"add"](this._mediaTitle,"hidden");_4b2.set(this._mediaCaption,"innerHTML",_4cc);_4b3[_4cc?"remove":"add"](this._mediaCaption,"hidden");_4b3[(_4cb&&_4cc)?"remove":"add"](_4cd,"hidden");this._rid=null;if(info.type==="image"){this._showImage(info.value);}else{var self=this,_4ce=["dojox/charting/Chart2D","dojox/charting/action2d/Tooltip"],_4cf=info.value.theme||this.chartTheme||"esri/dijit/Rainbow";if(lang.isString(_4cf)){_4cf=_4cf.replace(/\./gi,"/");if(_4cf.indexOf("/")===-1){_4cf="dojox/charting/themes/"+_4cf;}_4ce.push(_4cf);}try{var rid=(this._rid=_4bb++);_4ac(_4ce,function(_4d0,_4d1,_4d2){if(rid===self._rid){self._rid=null;self._showChart(info.type,info.value,_4d0,_4d1,_4d2);}});}catch(err){console.log("PopupRenderer: error loading modules");}}},_showImage:function(_4d3){_4b3.add(this._mediaFrame,"image");var _4d4=_4b5.get(this._gallery,"height"),html="<img class='esriPopupMediaImage' src='"+_4d3.sourceURL+"' />";if(_4d3.linkURL){html="<a target='_blank' href='"+_4d3.linkURL+"'>"+html+"</a>";}_4b2.set(this._mediaFrame,"innerHTML",html);var img=_4b0.query(".esriPopupMediaImage",this._mediaFrame)[0],self=this,_4d5;_4d5=_4ae.connect(img,"onload",function(){_4ae.disconnect(_4d5);_4d5=null;self._imageLoaded(img,_4d4);});},_showChart:function(type,_4d6,_4d7,_4d8,_4d9){_4b3.remove(this._mediaFrame,"image");var _4da=this._chart=new _4d7(_4b4.create("div",{"class":"chart"},this._mediaFrame),{margins:{l:4,t:4,r:4,b:4}});if(_4d9){_4da.setTheme(_4d9);}switch(type){case "piechart":_4da.addPlot("default",{type:"Pie",labels:false});_4da.addSeries("Series A",_4d6.fields);break;case "linechart":_4da.addPlot("default",{type:"Markers"});_4da.addAxis("x",{min:0,majorTicks:false,minorTicks:false,majorLabels:false,minorLabels:false});_4da.addAxis("y",{includeZero:true,vertical:true,fixUpper:"minor"});_4af.forEach(_4d6.fields,function(info,idx){info.x=idx+1;});_4da.addSeries("Series A",_4d6.fields);break;case "columnchart":_4da.addPlot("default",{type:"Columns",gap:3});_4da.addAxis("y",{includeZero:true,vertical:true,fixUpper:"minor"});_4da.addSeries("Series A",_4d6.fields);break;case "barchart":_4da.addPlot("default",{type:"Bars",gap:3});_4da.addAxis("x",{includeZero:true,fixUpper:"minor",minorLabels:false});_4da.addAxis("y",{vertical:true,majorTicks:false,minorTicks:false,majorLabels:false,minorLabels:false});_4da.addSeries("Series A",_4d6.fields);break;}this._action=new _4d8(_4da);_4da.render();},_destroyFrame:function(){this._rid=null;if(this._chart){this._chart.destroy();this._chart=null;}if(this._action){this._action.destroy();this._action=null;}_4b2.set(this._mediaFrame,"innerHTML","");},_imageLoaded:function(img,_4db){var _4dc=img.height;if(_4dc<_4db){var diff=Math.round((_4db-_4dc)/2);_4b5.set(img,"marginTop",diff+"px");}},_attListHandler:function(dfd,_4dd){if(dfd===this._dfd){this._dfd=null;var html="";if(!(_4dd instanceof Error)&&_4dd&&_4dd.length){_4af.forEach(_4dd,function(info){html+=("<li>");html+=("<a href='"+info.url+"' target='_blank'>"+(info.name||"[No name]")+"</a>");html+=("</li>");});}_4b2.set(this._attachmentsList,"innerHTML",html||"<li>"+this._nls.NLS_noAttach+"</li>");}}});if(has("extend-esri")){lang.setObject("dijit._PopupRenderer",PR,_4b8);}return PR;});},"dojo/data/util/sorter":function(){define(["../../_base/lang"],function(lang){var _4de={};lang.setObject("dojo.data.util.sorter",_4de);_4de.basicComparator=function(a,b){var r=-1;if(a===null){a=undefined;}if(b===null){b=undefined;}if(a==b){r=0;}else{if(a>b||a==null){r=1;}}return r;};_4de.createSortFunction=function(_4df,_4e0){var _4e1=[];function _4e2(attr,dir,comp,s){return function(_4e3,_4e4){var a=s.getValue(_4e3,attr);var b=s.getValue(_4e4,attr);return dir*comp(a,b);};};var _4e5;var map=_4e0.comparatorMap;var bc=_4de.basicComparator;for(var i=0;i<_4df.length;i++){_4e5=_4df[i];var attr=_4e5.attribute;if(attr){var dir=(_4e5.descending)?-1:1;var comp=bc;if(map){if(typeof attr!=="string"&&("toString" in attr)){attr=attr.toString();}comp=map[attr]||bc;}_4e1.push(_4e2(attr,dir,comp,_4e0));}}return function(rowA,rowB){var i=0;while(i<_4e1.length){var ret=_4e1[i++](rowA,rowB);if(ret!==0){return ret;}}return 0;};};return _4de;});},"esri/layers/KMLGroundOverlay":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","esri/kernel","esri/lang","esri/layers/MapImage"],function(_4e6,lang,has,_4e7,_4e8,_4e9){var _4ea=_4e6([_4e9],{declaredClass:"esri.layers.KMLGroundOverlay",constructor:function(json){if(_4e8.isDefined(this.visibility)){this.visible=!!this.visibility;}}});if(has("extend-esri")){lang.setObject("layers.KMLGroundOverlay",_4ea,_4e7);}return _4ea;});},"esri/layers/MapImageLayer":function(){define(["dojo/_base/declare","dojo/_base/connect","dojo/_base/lang","dojo/_base/array","dojo/dom-construct","dojo/dom-style","esri/kernel","esri/config","esri/sniff","esri/domUtils","esri/geometry/Point","esri/geometry/webMercatorUtils","esri/layers/layer"],function(_4eb,_4ec,lang,_4ed,_4ee,_4ef,_4f0,_4f1,has,_4f2,_4f3,_4f4,_4f5){var _4f6=_4eb([_4f5],{declaredClass:"esri.layers.MapImageLayer","-chains-":{constructor:"manual"},constructor:function(_4f7){this.inherited(arguments,[null,_4f7]);this._mapImages=[];var _4f8=lang.hitch;this._panStart=_4f8(this,this._panStart);this._pan=_4f8(this,this._pan);this._extentChange=_4f8(this,this._extentChange);this._zoom=_4f8(this,this._zoom);this._zoomStart=_4f8(this,this._zoomStart);this._scale=_4f8(this,this._scale);this._resize=_4f8(this,this._resize);_4ec.connect(this,"onSuspend",this,this._onSuspend);_4ec.connect(this,"onResume",this,this._onResume);this.loaded=true;this.onLoad(this);},opacity:1,_transform:_4f0._getDOMAccessor("transform"),addImage:function(_4f9){var _4fa=this._mapImages.push(_4f9);_4fa=_4fa-1;_4f9._idx=_4fa;_4f9._layer=this;if(this._div){this._createImage(_4f9,_4fa);}},removeImage:function(_4fb){if(_4fb){var idx=_4fb._idx,_4fc=this._mapImages;if(_4fc[idx]===_4fb){delete _4fc[idx];var node=_4fb._node;if(node){this._clearEvents(node);node.e_idx=node.e_bl=node.e_tr=node.e_l=node.e_t=node.e_w=node.e_h=null;if(node.parentNode){node.parentNode.removeChild(node);_4ee.destroy(node);}}_4fb._node=_4fb._idx=_4fb._layer=null;}}},removeAllImages:function(){var _4fd=this._mapImages,i,len=_4fd.length;for(i=0;i<len;i++){var _4fe=_4fd[i];if(_4fe){this.removeImage(_4fe);}}this._mapImages=[];},getImages:function(){var _4ff=this._mapImages,_500=[],i,len=_4ff.length;for(i=0;i<len;i++){if(_4ff[i]){_500.push(_4ff[i]);}}return _500;},setOpacity:function(_501){if(this.opacity!=_501){this._opacityChanged(this.opacity=_501);this.onOpacityChange();}},onOpacityChange:function(){},_opacityChanged:function(_502){var div=this._div,i,len,_503;if(div){if(!has("ie")||has("ie")>8){_4ef.set(div,"opacity",_502);}else{_503=div.childNodes;len=_503.length;for(i=0;i<len;i++){_4ef.set(_503[i],"opacity",_502);}}}},_createImage:function(_504,idx){var node=_4ee.create("img");_4ef.set(node,{position:"absolute"});if(has("ie")<=8){_4ef.set(node,"opacity",this.opacity);}if(_504.rotation){var _505="rotate("+(360-_504.rotation)+"deg)";if(has("ie")<9){}else{_4ef.set(node,this._transform,_505);_4ef.set(node,"transform",_505);}}_504._node=node;node.e_idx=idx;node.e_layer=this;node.e_load=_4ec.connect(node,"onload",_4f6.prototype._imageLoaded);node.e_error=_4ec.connect(node,"onerror",_4f6.prototype._imageError);node.e_abort=_4ec.connect(node,"onabort",_4f6.prototype._imageError);node.src=_504.href;},_imageLoaded:function(evt,img){var node=img||evt.target||evt.currentTarget,self=node.e_layer,_506=self._mapImages[node.e_idx],map=self._map;if(map&&(map.__zooming||map.__panning||!self._sr)){self._standby.push(node);return;}self._clearEvents(node);if(!_506||_506._node!==node){return;}if(map){self._attach(_506);}},_imageError:function(evt){var node=evt.target||evt.currentTarget,self=node.e_layer,_507=self._mapImages[node.e_idx];self._clearEvents(node);if(_507){_507._node=null;}},_clearEvents:function(node){var _508=_4ec.disconnect;_508(node.e_load);_508(node.e_error);_508(node.e_abort);node.e_load=node.e_error=node.e_abort=node.e_layer=null;},_attach:function(_509){var _50a=_509.extent,_50b=_50a.spatialReference,_50c=this._sr,div=this._div,node=_509._node,_50d=new _4f3({x:_50a.xmin,y:_50a.ymin,spatialReference:_50b}),_50e=new _4f3({x:_50a.xmax,y:_50a.ymax,spatialReference:_50b});if(!_50c.equals(_50b)){if(_50c.isWebMercator()&&_50b.wkid===4326){_50d=_4f4.geographicToWebMercator(_50d);_50e=_4f4.geographicToWebMercator(_50e);}else{if(_50b.isWebMercator()&&_50c.wkid===4326){_50d=_4f4.webMercatorToGeographic(_50d);_50e=_4f4.webMercatorToGeographic(_50e);}}}node.e_bl=_50d;node.e_tr=_50e;if(_509.visible){this._setPos(node,div._left,div._top);(this._active||div).appendChild(node);}},_setPos:function(node,_50f,_510){var _511=node.e_bl,_512=node.e_tr,map=this._map;_511=map.toScreen(_511);_512=map.toScreen(_512);var left=_511.x-_50f,top=_512.y-_510,_513=Math.abs(_512.x-_511.x),_514=Math.abs(_511.y-_512.y),css={width:_513+"px",height:_514+"px"},_515=this._mapImages[node.e_idx];if(map.navigationMode==="css-transforms"){css[_4f0._css.names.transform]=_4f0._css.translate(left,top)+(_515.rotation?(" "+_4f0._css.rotate(360-_515.rotation)):"");}else{css.left=left+"px";css.top=top+"px";}_4ef.set(node,css);node.e_l=left;node.e_t=top;node.e_w=_513;node.e_h=_514;},managedSuspension:true,_setMap:function(map,_516){this.inherited(arguments);var div=this._div=_4ee.create("div",null,_516),_517=_4f0._css.names,css={position:"absolute"},vd=map.__visibleDelta;if(!has("ie")||has("ie")>8){css.opacity=this.opacity;}if(map.navigationMode==="css-transforms"){css[_517.transform]=_4f0._css.translate(vd.x,vd.y);_4ef.set(div,css);div._left=vd.x;div._top=vd.y;css={position:"absolute",width:map.width+"px",height:map.height+"px",overflow:"visible"};this._active=_4ee.create("div",null,div);_4ef.set(this._active,css);this._passive=_4ee.create("div",null,div);_4ef.set(this._passive,css);}else{div._left=0;div._top=0;_4ef.set(div,css);}this._standby=[];var _518=this._mapImages,i,len=_518.length;for(i=0;i<len;i++){var _519=_518[i],node=_519._node;if(!node){this._createImage(_519,_519._idx);}}_4f2.hide(div);return div;},_unsetMap:function(map,_51a){this._disconnect();var div=this._div;if(div){var _51b=this._mapImages,i,len=_51b.length;for(i=0;i<len;i++){var _51c=_51b[i];if(_51c){var node=_51c._node;if(node){this._clearEvents(node);node.e_idx=node.e_bl=node.e_tr=node.e_l=node.e_t=node.e_w=node.e_h=null;}_51c._node=null;}}_51a.removeChild(div);_4ee.destroy(div);}this._map=this._div=this._sr=this._active=this._passive=this._standby=null;this.inherited(arguments);},_onSuspend:function(){this._disconnect();_4f2.hide(this._div);},_onResume:function(evt){if(evt.firstOccurrence){this._sr=this._map.spatialReference;this._processStandbyList();}var map=this._map,div=this._div,vd=map.__visibleDelta;if(map.navigationMode==="css-transforms"){div._left=vd.x;div._top=vd.y;_4ef.set(div,_4f0._css.names.transform,_4f0._css.translate(div._left,div._top));}this._redraw(map.navigationMode==="css-transforms");this._connect(map);_4f2.show(div);},_connect:function(map){if(!this._connections){var _51d=_4ec.connect,_51e=(map.navigationMode==="css-transforms");this._connections=[_51d(map,"onPanStart",this._panStart),_51d(map,"onPan",this._pan),_51d(map,"onExtentChange",this._extentChange),_51e&&_51d(map,"onZoomStart",this._zoomStart),_51e?_51d(map,"onScale",this._scale):_51d(map,"onZoom",this._zoom),_51e&&_51d(map,"onResize",this._resize)];}},_disconnect:function(){if(this._connections){_4ed.forEach(this._connections,_4ec.disconnect);this._connections=null;}},_panStart:function(){this._panL=this._div._left;this._panT=this._div._top;},_pan:function(_51f,_520){var div=this._div;div._left=this._panL+_520.x;div._top=this._panT+_520.y;if(this._map.navigationMode==="css-transforms"){_4ef.set(div,_4f0._css.names.transform,_4f0._css.translate(div._left,div._top));}else{_4ef.set(div,{left:div._left+"px",top:div._top+"px"});}},_extentChange:function(_521,_522,_523){if(_523){this._redraw(this._map.navigationMode==="css-transforms");}else{if(_522){this._pan(_521,_522);}}this._processStandbyList();},_processStandbyList:function(){var i,_524=this._standby;if(_524&&_524.length){for(i=_524.length-1;i>=0;i--){this._imageLoaded(null,_524[i]);_524.splice(i,1);}}},_redraw:function(_525){if(_525){var _526=this._passive,_527=_4f0._css.names;_4ef.set(_526,_527.transition,"none");this._moveImages(_526,this._active);_4ef.set(_526,_527.transform,"none");}var div=this._active||this._div,_528=this._div._left,_529=this._div._top,i,len=div.childNodes.length,node;for(i=0;i<len;i++){node=div.childNodes[i];this._setPos(node,_528,_529);}},_zoom:function(_52a,_52b,_52c){var div=this._div,_52d=div._left,_52e=div._top,i,len=div.childNodes.length,node;for(i=0;i<len;i++){node=div.childNodes[i];var _52f=node.e_w*_52b,_530=node.e_h*_52b,_531=(_52c.x-_52d-node.e_l)*(_52f-node.e_w)/node.e_w,_532=(_52c.y-_52e-node.e_t)*(_530-node.e_h)/node.e_h;_531=isNaN(_531)?0:_531;_532=isNaN(_532)?0:_532;_4ef.set(node,{left:(node.e_l-_531)+"px",top:(node.e_t-_532)+"px",width:_52f+"px",height:_530+"px"});}},_zoomStart:function(){this._moveImages(this._active,this._passive);},_moveImages:function(_533,dest){var _534=_533.childNodes,i,len=_534.length;if(len>0){for(i=len-1;i>=0;i--){dest.appendChild(_534[i]);}}},_scale:function(mtx,_535){var css={},_536=_4f0._css.names,_537=this._passive;_4ef.set(_537,_536.transition,_535?"none":(_536.transformName+" "+_4f1.defaults.map.zoomDuration+"ms ease"));css[_536.transform]=_4f0._css.matrix(mtx);_4ef.set(_537,_536.transform,_4f0._css.matrix(mtx));},_resize:function(_538,_539,_53a){_4ef.set(this._active,{width:_539+"px",height:_53a+"px"});_4ef.set(this._passive,{width:_539+"px",height:_53a+"px"});}});if(has("extend-esri")){lang.setObject("layers.MapImageLayer",_4f6,_4f0);}return _4f6;});},"esri/tasks/SpatialRelationship":function(){define(["dojo/_base/lang","dojo/has","esri/kernel"],function(lang,has,_53b){var _53c={SPATIAL_REL_INTERSECTS:"esriSpatialRelIntersects",SPATIAL_REL_CONTAINS:"esriSpatialRelContains",SPATIAL_REL_CROSSES:"esriSpatialRelCrosses",SPATIAL_REL_ENVELOPEINTERSECTS:"esriSpatialRelEnvelopeIntersects",SPATIAL_REL_INDEXINTERSECTS:"esriSpatialRelIndexIntersects",SPATIAL_REL_OVERLAPS:"esriSpatialRelOverlaps",SPATIAL_REL_TOUCHES:"esriSpatialRelTouches",SPATIAL_REL_WITHIN:"esriSpatialRelWithin",SPATIAL_REL_RELATION:"esriSpatialRelRelation"};if(has("extend-esri")){lang.setObject("tasks._SpatialRelationship",_53c,_53b);}return _53c;});},"esri/layers/WebTiledLayer":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/_base/url","dojo/has","dojo/string","esri/kernel","esri/urlUtils","esri/SpatialReference","esri/geometry/Extent","esri/layers/TiledMapServiceLayer","esri/layers/TileInfo"],function(_53d,lang,_53e,Url,has,_53f,_540,_541,_542,_543,_544,_545){var _546=_53d(_544,{declaredClass:"esri.layers.WebTiledLayer",constructor:function(_547,_548){if(!_548){_548={};}this.urlTemplate=_547;var _549=new _543(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,new _542({wkid:102100}));var _54a=new _543(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,new _542({wkid:102100}));this.initialExtent=_548.initialExtent||_549;this.fullExtent=_548.fullExtent||_54a;if(_548.tileInfo){this.tileInfo=_548.tileInfo;}else{var lods=[{"level":0,"resolution":156543.033928,"scale":591657527.591555},{"level":1,"resolution":78271.5169639999,"scale":295828763.795777},{"level":2,"resolution":39135.7584820001,"scale":147914381.897889},{"level":3,"resolution":19567.8792409999,"scale":73957190.948944},{"level":4,"resolution":9783.93962049996,"scale":36978595.474472},{"level":5,"resolution":4891.96981024998,"scale":18489297.737236},{"level":6,"resolution":2445.98490512499,"scale":9244648.868618},{"level":7,"resolution":1222.99245256249,"scale":4622324.434309},{"level":8,"resolution":611.49622628138,"scale":2311162.217155},{"level":9,"resolution":305.748113140558,"scale":1155581.108577},{"level":10,"resolution":152.874056570411,"scale":577790.554289},{"level":11,"resolution":76.4370282850732,"scale":288895.277144},{"level":12,"resolution":38.2185141425366,"scale":144447.638572},{"level":13,"resolution":19.1092570712683,"scale":72223.819286},{"level":14,"resolution":9.55462853563415,"scale":36111.909643},{"level":15,"resolution":4.77731426794937,"scale":18055.954822},{"level":16,"resolution":2.38865713397468,"scale":9027.977411},{"level":17,"resolution":1.19432856685505,"scale":4513.988705},{"level":18,"resolution":0.597164283559817,"scale":2256.994353},{"level":19,"resolution":0.298582141647617,"scale":1128.497176}];var _54b=new _545({"rows":256,"cols":256,"origin":{"x":-20037508.342787,"y":20037508.342787},"spatialReference":{"wkid":102100},"lods":lods});this.tileInfo=_54b;}this.spatialReference=new _542(this.tileInfo.spatialReference.toJson());this.copyright=_548.copyright||"";var url=new Url(_547);var _54c=url.scheme+"://"+url.authority+"/";this.urlPath=_547.substring(_54c.length);this.tileServers=_548.tileServers||[];if(url.authority.indexOf("{subDomain}")===-1){this.tileServers.push(_54c);}if(_548.subDomains&&_548.subDomains.length>0&&url.authority.split(".").length>1){this.subDomains=_548.subDomains;var _54d;_53e.forEach(_548.subDomains,function(_54e,idx){if(url.authority.indexOf("${subDomain}")>-1){_54d=url.scheme+"://"+_53f.substitute(url.authority,{subDomain:_54e})+"/";}else{if(url.authority.indexOf("{subDomain}")>-1){_54d=url.scheme+"://"+url.authority.replace(/\{subDomain\}/gi,_54e)+"/";}}this.tileServers.push(_54d);},this);}this.tileServers=_53e.map(this.tileServers,function(item){if(item.charAt(item.length-1)!=="/"){item+="/";}return item;});this._levelToLevelValue=[];_53e.forEach(this.tileInfo.lods,function(item){this._levelToLevelValue[item.level]=item.levelValue?item.levelValue:item.level;},this);this.loaded=true;this.onLoad(this);},getTileUrl:function(_54f,row,col){_54f=this._levelToLevelValue[_54f];var _550=this.tileServers[row%this.tileServers.length];var _551=_550+_53f.substitute(this.urlPath,{level:_54f,col:col,row:row});_551=_551.replace(/\{level\}/gi,_54f);_551=_551.replace(/\{row\}/gi,row);_551=_551.replace(/\{col\}/gi,col);return _541.addProxy(_551);}});if(has("extend-esri")){lang.setObject("layers.WebTiledLayer",_546,_540);}return _546;});},"esri/layers/SnapshotMode":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","esri/kernel","esri/SpatialReference","esri/tasks/query","esri/layers/RenderMode"],function(_552,lang,has,_553,_554,_555,_556){var _557=_552([_556],{declaredClass:"esri.layers._SnapshotMode",constructor:function(_558){this.featureLayer=_558;this._featureMap={};this._drawFeatures=lang.hitch(this,this._drawFeatures);this._queryErrorHandler=lang.hitch(this,this._queryErrorHandler);},startup:function(){if(this.featureLayer._collection){this._applyTimeFilter();}else{this._fetchAll();}},propertyChangeHandler:function(type){if(this._init){if(type){if(this.featureLayer._collection){console.log("FeatureLayer: layer created by value (from a feature collection) does not support definition expressions and time definitions. Layer id = "+this.featureLayer.id);}else{this._fetchAll();}}else{this._applyTimeFilter();}}},drawFeature:function(_559){var _55a=this.featureLayer,_55b=_55a.objectIdField,oid=_559.attributes[_55b];this._addFeatureIIf(oid,_559);this._incRefCount(oid);},resume:function(){this.propertyChangeHandler(0);},refresh:function(){var _55c=this.featureLayer;if(_55c._collection){_55c._fireUpdateStart();_55c._refresh(true);_55c._fireUpdateEnd();}else{this._fetchAll();}},_getRequestId:function(_55d){var id="_"+_55d.name+_55d.layerId+_55d._ulid;return id.replace(/[^a-zA-Z0-9\_]+/g,"_");},_fetchAll:function(){var _55e=this.featureLayer;if(_55e._collection){return;}_55e._fireUpdateStart();this._clearIIf();this._sendRequest();},_sendRequest:function(){var map=this.map,_55f=this.featureLayer,_560=_55f.getDefinitionExpression();var _561=new _555();_561.outFields=_55f.getOutFields();_561.where=_560||"1=1";_561.returnGeometry=true;_561.outSpatialReference=new _554(map.spatialReference.toJson());_561.timeExtent=_55f.getTimeDefinition();_561.maxAllowableOffset=_55f._maxOffset;if(_55f._ts){_561._ts=(new Date()).getTime();}var _562;if(_55f._usePatch){_562=this._getRequestId(_55f);this._cancelPendingRequest(null,_562);}_55f._task.execute(_561,this._drawFeatures,this._queryErrorHandler,_562);},_drawFeatures:function(_563){this._purgeRequests();var _564=_563.features,_565=this.featureLayer,_566=_565.objectIdField,i,len=_564.length,_567,oid;for(i=0;i<len;i++){_567=_564[i];oid=_567.attributes[_566];this._addFeatureIIf(oid,_567);this._incRefCount(oid);}this._applyTimeFilter(true);_565._fireUpdateEnd(null,_563.exceededTransferLimit?{queryLimitExceeded:true}:null);if(_563.exceededTransferLimit){_565.onQueryLimitExceeded();}},_queryErrorHandler:function(err){this._purgeRequests();var _568=this.featureLayer;_568._errorHandler(err);_568._fireUpdateEnd(err);}});if(has("extend-esri")){lang.setObject("layers._SnapshotMode",_557,_553);}return _557;});},"esri/layers/SelectionMode":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","esri/kernel","esri/layers/RenderMode"],function(_569,lang,has,_56a,_56b){var _56c=_569([_56b],{declaredClass:"esri.layers._SelectionMode",constructor:function(_56d){this.featureLayer=_56d;this._featureMap={};},propertyChangeHandler:function(type){if(this._init&&type===0){this._applyTimeFilter();}},resume:function(){this.propertyChangeHandler(0);}});if(has("extend-esri")){lang.setObject("layers._SelectionMode",_56c,_56a);}return _56c;});},"esri/tasks/Task":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/has","esri/kernel","esri/deferredUtils","esri/urlUtils","esri/Evented"],function(_56e,lang,_56f,has,_570,_571,_572,_573){var Task=_56e(_573,{declaredClass:"esri.tasks._Task",_eventMap:{"error":["error"],"complete":["result"]},constructor:function(url){if(url&&lang.isString(url)){this._url=_572.urlToObject(this.url=url);}this.normalization=true;this._errorHandler=lang.hitch(this,this._errorHandler);this.registerConnectEvents();},_useSSL:function(){var _574=this._url,re=/^http:/i,rep="https:";if(this.url){this.url=this.url.replace(re,rep);}if(_574&&_574.path){_574.path=_574.path.replace(re,rep);}},_encode:function(_575,_576,_577){var _578,type,_579={},i,p,pl;for(i in _575){if(i==="declaredClass"){continue;}_578=_575[i];type=typeof _578;if(_578!==null&&_578!==undefined&&type!=="function"){if(lang.isArray(_578)){_579[i]=[];pl=_578.length;for(p=0;p<pl;p++){_579[i][p]=this._encode(_578[p]);}}else{if(type==="object"){if(_578.toJson){var json=_578.toJson(_577&&_577[i]);if(_578.declaredClass==="esri.tasks.FeatureSet"){if(json.spatialReference){json.sr=json.spatialReference;delete json.spatialReference;}}_579[i]=_576?json:_56f.toJson(json);}}else{_579[i]=_578;}}}}return _579;},_successHandler:function(args,_57a,_57b,dfd){if(_57a){this[_57a].apply(this,args);}if(_57b){_57b.apply(null,args);}if(dfd){_571._resDfd(dfd,args);}},_errorHandler:function(err,_57c,dfd){this.onError(err);if(_57c){_57c(err);}if(dfd){dfd.errback(err);}},setNormalization:function(_57d){this.normalization=_57d;},onError:function(){}});if(has("extend-esri")){_570.Task=Task;}return Task;});},"dojo/DeferredList":function(){define(["./_base/kernel","./_base/Deferred","./_base/array"],function(dojo,_57e,_57f){dojo.DeferredList=function(list,_580,_581,_582,_583){var _584=[];_57e.call(this);var self=this;if(list.length===0&&!_580){this.resolve([0,[]]);}var _585=0;_57f.forEach(list,function(item,i){item.then(function(_586){if(_580){self.resolve([i,_586]);}else{_587(true,_586);}},function(_588){if(_581){self.reject(_588);}else{_587(false,_588);}if(_582){return null;}throw _588;});function _587(_589,_58a){_584[i]=[_589,_58a];_585++;if(_585===list.length){self.resolve(_584);}};});};dojo.DeferredList.prototype=new _57e();dojo.DeferredList.prototype.gatherResults=function(_58b){var d=new dojo.DeferredList(_58b,false,true,false);d.addCallback(function(_58c){var ret=[];_57f.forEach(_58c,function(_58d){ret.push(_58d[1]);});return ret;});return d;};return dojo.DeferredList;});},"dijit/_OnDijitClickMixin":function(){define("dijit/_OnDijitClickMixin",["dojo/on","dojo/_base/array","dojo/keys","dojo/_base/declare","dojo/has","dojo/_base/unload","dojo/_base/window","./a11yclick"],function(on,_58e,keys,_58f,has,_590,win,_591){var ret=_58f("dijit._OnDijitClickMixin",null,{connect:function(obj,_592,_593){return this.inherited(arguments,[obj,_592=="ondijitclick"?_591:_592,_593]);}});ret.a11yclick=_591;return ret;});},"dijit/a11yclick":function(){define("dijit/a11yclick",["dojo/on","dojo/_base/array","dojo/keys","dojo/_base/declare","dojo/has","dojo/_base/unload","dojo/_base/window"],function(on,_594,keys,_595,has,_596,win){var _597=null;if(has("dom-addeventlistener")){win.doc.addEventListener("keydown",function(evt){_597=evt.target;},true);}else{(function(){var _598=function(evt){_597=evt.srcElement;};win.doc.attachEvent("onkeydown",_598);_596.addOnWindowUnload(function(){win.doc.detachEvent("onkeydown",_598);});})();}function _599(e){return (e.keyCode===keys.ENTER||e.keyCode===keys.SPACE)&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey;};return function(node,_59a){if(/input|button/i.test(node.nodeName)){return on(node,"click",_59a);}else{var _59b=[on(node,"keydown",function(e){if(_599(e)){_597=e.target;e.preventDefault();}}),on(node,"keyup",function(e){if(_599(e)&&e.target==_597){_597=null;on.emit(e.target,"click",{cancelable:true,bubbles:true});}}),on(node,"click",function(e){_59a.call(this,e);})];if(has("touch")){var _59c;_59b.push(on(node,"touchend",function(e){var _59d=e.target;_59c=setTimeout(function(){_59c=null;on.emit(_59d,"click",{cancelable:true,bubbles:true});},600);}),on(node,"click",function(e){if(_59c){clearTimeout(_59c);}}));}return {remove:function(){_594.forEach(_59b,function(h){h.remove();});if(_59c){clearTimeout(_59c);_59c=null;}}};}};return ret;});},"esri/layers/WMSLayer":function(){define(["require","dojo/_base/kernel","dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/has","esri/kernel","esri/request","esri/urlUtils","esri/SpatialReference","esri/geometry/Extent","esri/layers/DynamicMapServiceLayer","esri/layers/WMSLayerInfo","dojo/query"],function(_59e,_59f,_5a0,lang,_5a1,has,_5a2,_5a3,_5a4,_5a5,_5a6,_5a7,_5a8){var _5a9=_5a0([_5a7],{declaredClass:"esri.layers.WMSLayer",_CRS_TO_EPSG:{84:4326,83:4269,27:4267},_REVERSED_LAT_LONG_RANGES:[[4001,4999],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3416,3416],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]],_WEB_MERCATOR:[102100,3857,102113,900913],_WORLD_MERCATOR:[3395,54004],allExtents:[],constructor:function(url,_5aa){url=this._stripParameters(url,["version","service","request","bbox","format","height","width","layers","srs","crs","styles","transparent","bgcolor","exceptions","time","elevation","sld","wfs"]);this.url=url;this._url=_5a4.urlToObject(url);this._getCapabilitiesURL=url;this._initLayer=lang.hitch(this,this._initLayer);this._parseCapabilities=lang.hitch(this,this._parseCapabilities);this._getCapabilitiesError=lang.hitch(this,this._getCapabilitiesError);if(_5aa){this.imageFormat=this._getImageFormat(_5aa.format);this.imageTransparency=(_5aa.transparent===false)?false:true;this.visibleLayers=_5aa.visibleLayers?_5aa.visibleLayers:[];if(_5aa.resourceInfo){this._readResourceInfo(_5aa.resourceInfo);}else{this._getCapabilities();}}else{this.imageFormat="image/png";this.imageTransparency=true;this.visibleLayers=[];this._getCapabilities();}this._blankImageURL=_59e.toUrl("esri/layers")+"/../images/pixel.png";},setVisibleLayers:function(_5ab){_5ab=this._checkVisibleLayersList(_5ab);this.visibleLayers=_5ab?_5ab:[];this.refresh(true);},setImageFormat:function(_5ac){this.imageFormat=this._getImageFormat(_5ac);this.refresh(true);},setImageTransparency:function(_5ad){this.imageTransparency=_5ad;this.refresh(true);},getImageUrl:function(_5ae,_5af,_5b0,_5b1){if(!this.visibleLayers||this.visibleLayers.length===0){_5b1(this._blankImageURL);return;}var wkid=_5ae.spatialReference.wkid;if(_5a1.some(this._WEB_MERCATOR,function(el){return el==wkid;})){var _5b2=_5a1.filter(this.spatialReferences,function(el){return (_5a1.some(this._WEB_MERCATOR,function(el2){return el2==el;}));},this);if(_5b2.length==0){_5b2=_5a1.filter(this.spatialReferences,function(el){return (_5a1.some(this._WORLD_MERCATOR,function(el2){return el2==el;}));},this);}if(_5b2.length>0){wkid=_5b2[0];}else{wkid=this._WEB_MERCATOR[0];}}var list=_5a1.filter(this.spatialReferences,function(el){return el!==wkid;});this.spatialReferences=list;this.spatialReferences.unshift(wkid);var xmin=_5ae.xmin;var xmax=_5ae.xmax;var ymin=_5ae.ymin;var ymax=_5ae.ymax;var _5b3={};_5b3.SERVICE="WMS";_5b3.REQUEST="GetMap";_5b3.FORMAT=this.imageFormat;_5b3.TRANSPARENT=this.imageTransparency?"TRUE":"FALSE";_5b3.STYLES="";_5b3.VERSION=this.version;_5b3.LAYERS=this.visibleLayers?this.visibleLayers.toString():null;_5b3.WIDTH=_5af;_5b3.HEIGHT=_5b0;if(this.maxWidth<_5af){_5b3.WIDTH=this.maxWidth;}if(this.maxHeight<_5b0){_5b3.HEIGHT=this.maxHeight;}var _5b4=wkid?wkid:NaN;if(!isNaN(_5b4)){if(this.version=="1.3.0"){_5b3.CRS="EPSG:"+_5b4;}else{_5b3.SRS="EPSG:"+_5b4;}}if(this.version=="1.3.0"&&this._useLatLong(_5b4)){_5b3.BBOX=ymin+","+xmin+","+ymax+","+xmax;}else{_5b3.BBOX=xmin+","+ymin+","+xmax+","+ymax;}var _5b5=this.getMapURL,key;_5b5+=(_5b5.indexOf("?")==-1)?"?":"";for(key in _5b3){_5b5+=(_5b5.substring(_5b5.length-1,_5b5.length)=="?")?"":"&";_5b5+=key+"="+_5b3[key];}_5b1(_5a4.addProxy(_5b5));},_initLayer:function(_5b6,io){this.spatialReference=new _5a5(this.extent.spatialReference);this.initialExtent=new _5a6(this.extent);this.fullExtent=new _5a6(this.extent);this.visibleLayers=this._checkVisibleLayersList(this.visibleLayers);this.loaded=true;this.onLoad(this);var _5b7=this._loadCallback;if(_5b7){delete this._loadCallback;_5b7(this);}},_readResourceInfo:function(_5b8){if(!_5b8.extent){console.error("esri.layers.WMSLayer: unable to find the 'extent' property in resourceInfo");return;}if(!_5b8.layerInfos){console.error("esri.layers.WMSLayer: unable to find the 'layerInfos' property in resourceInfo");return;}this.extent=_5b8.extent;this.allExtents[0]=_5b8.extent;this.layerInfos=_5b8.layerInfos;this.description=_5b8.description?_5b8.description:"";this.copyright=_5b8.copyright?_5b8.copyright:"";this.title=_5b8.title?_5b8.title:"";this.getMapURL=_5b8.getMapURL?_5b8.getMapURL:this._getCapabilitiesURL;this.version=_5b8.version?_5b8.version:"1.3.0";this.maxWidth=_5b8.maxWidth?_5b8.maxWidth:5000;this.maxHeight=_5b8.maxHeight?_5b8.maxHeight:5000;this.spatialReferences=_5b8.spatialReferences?_5b8.spatialReferences:[];this.imageFormat=this._getImageFormat(_5b8.format);this.setScaleRange(_5b8.minScale,_5b8.maxScale);this._initLayer();},_getCapabilities:function(){var _5b9=this._url.query?this._url.query:{};_5b9.SERVICE="WMS";_5b9.REQUEST="GetCapabilities";var uri=this._url.path+"?",key;for(key in _5b9){uri+=(uri.substring(uri.length-1,uri.length)=="?")?"":"&";uri+=key+"="+_5b9[key];}var _5ba=_5a3({url:uri,handleAs:"xml",headers:{"Content-Type":null},load:this._parseCapabilities,error:this._getCapabilitiesError},{usePost:false});},_parseCapabilities:function(xml){if(!xml){this.onError("GetCapabilities request for "+this._getCapabilitiesURL+" failed. (Response is null.)");return;}this.version=this._getAttributeValue("WMS_Capabilities","version",xml,null);if(!this.version){this.version=this._getAttributeValue("WMT_MS_Capabilities","version",xml,"1.3.0");}var _5bb=this._getTag("Service",xml);this.title=this._getTagValue("Title",_5bb,"");if(!this.title||this.title.length==0){this.title=this._getTagValue("Name",_5bb,"");}this.copyright=this._getTagValue("AccessConstraints",_5bb,"");this.description=this._getTagValue("Abstract",_5bb,"");this.maxWidth=parseInt(this._getTagValue("MaxWidth",_5bb,5000),10);this.maxHeight=parseInt(this._getTagValue("MaxHeight",_5bb,5000),10);var _5bc=this._getTag("Layer",xml);if(!_5bc){this._getCapabilitiesError({"error":{"message":"Response does not contain any layers."}});return;}var _5bd=this._getLayerInfo(_5bc);var _5be=0;var _5bf=null;var _5c0=this._getTag("Capability",xml);_5a1.forEach(_5c0.childNodes,function(_5c1){if(_5c1.nodeName=="Layer"){if(_5be===0){_5bf=_5c1;}else{if(_5be===1){if(_5bd.name){_5bd.name="";_5bd.subLayers=[];_5bd.subLayers.push(this._getLayerInfo(_5bf));}_5bd.subLayers.push(this._getLayerInfo(_5c1));}else{_5bd.subLayers.push(this._getLayerInfo(_5c1));}}_5be++;}},this);if(_5bd){this.layerInfos=_5bd.subLayers;if(!this.layerInfos||this.layerInfos.length==0){this.layerInfos=[_5bd];}this.extent=_5bd.extent;this.allExtents=_5bd.allExtents;this.spatialReferences=_5bd.spatialReferences;if(this.spatialReferences.length==0&&this.layerInfos.length>0){this.spatialReferences=this.layerInfos[0].spatialReferences;}}this.getMapURL=this._getCapabilitiesURL;var _5c2=_59f.query("DCPType",this._getTag("GetMap",xml));if(_5c2&&_5c2.length>0){var _5c3=_59f.query("HTTP",_5c2[0]);if(_5c3&&_5c3.length>0){var _5c4=_59f.query("Get",_5c3[0]);if(_5c4&&_5c4.length>0){var _5c5=this._getAttributeValue("OnlineResource","xlink:href",_5c4[0],null);if(_5c5){if(_5c5.indexOf("&")==(_5c5.length-1)){_5c5=_5c5.substring(0,_5c5.length-1);}this.getMapURL=_5c5;}}}}this.getMapFormats=[];if(_59f.query("Operation",xml).length==0){_5a1.forEach(_59f.query("Format",this._getTag("GetMap",xml)),function(_5c6){this.getMapFormats.push(_5c6.text?_5c6.text:_5c6.textContent);},this);}else{_5a1.forEach(_59f.query("Operation",xml),function(_5c7){if(_5c7.getAttribute("name")=="GetMap"){_5a1.forEach(_59f.query("Format",_5c7),function(_5c8){this.getMapFormats.push(_5c8.text?_5c8.text:_5c8.textContent);},this);}},this);}if(!_5a1.some(this.getMapFormats,function(el){return el.indexOf(this.imageFormat)>-1;},this)){this.imageFormat=this.getMapFormats[0];}this._initLayer();},_getCapabilitiesError:function(_5c9,io){this.onError("GetCapabilities request for "+this._getCapabilitiesURL+" failed.",_5c9);},_getLayerInfo:function(_5ca){if(!_5ca){return null;}var _5cb=new _5a8();_5cb.name="";_5cb.title="";_5cb.description="";_5cb.allExtents=[];_5cb.spatialReferences=[];_5cb.subLayers=[];var _5cc=this._getTag("LatLonBoundingBox",_5ca);if(_5cc){_5cb.allExtents[0]=this._getExtent(_5cc,4326);}var _5cd=this._getTag("EX_GeographicBoundingBox",_5ca);if(_5cd){var _5ce=new _5a6(0,0,0,0,new _5a5({wkid:4326}));_5ce.xmin=parseFloat(this._getTagValue("westBoundLongitude",_5cd,0));_5ce.ymin=parseFloat(this._getTagValue("southBoundLatitude",_5cd,0));_5ce.xmax=parseFloat(this._getTagValue("eastBoundLongitude",_5cd,0));_5ce.ymax=parseFloat(this._getTagValue("northBoundLatitude",_5cd,0));_5cb.allExtents[0]=_5ce;}_5cb.extent=_5cb.allExtents[0];var _5cf=(_5a1.indexOf(["1.0.0","1.1.0","1.1.1"],this.version)>-1)?"SRS":"CRS";_5a1.forEach(_5ca.childNodes,function(_5d0){if(_5d0.nodeName=="Name"){_5cb.name=(_5d0.text?_5d0.text:_5d0.textContent)||"";}else{if(_5d0.nodeName=="Title"){_5cb.title=(_5d0.text?_5d0.text:_5d0.textContent)||"";}else{if(_5d0.nodeName=="Abstract"){_5cb.description=(_5d0.text?_5d0.text:_5d0.textContent)||"";}else{if(_5d0.nodeName=="BoundingBox"){var _5d1=_5d0.getAttribute(_5cf),wkid;if(_5d1&&_5d1.indexOf("EPSG:")===0){wkid=parseInt(_5d1.substring(5),10);if(wkid!==0&&!isNaN(wkid)){var _5d2;if(this.version=="1.3.0"){_5d2=this._getExtent(_5d0,wkid,this._useLatLong(wkid));}else{_5d2=this._getExtent(_5d0,wkid);}_5cb.allExtents[wkid]=_5d2;if(!_5cb.extent){_5cb.extent=_5d2;}}}else{if(_5d1&&_5d1.indexOf("CRS:")===0){wkid=parseInt(_5d1.substring(4),10);if(wkid!==0&&!isNaN(wkid)){if(this._CRS_TO_EPSG[wkid]){wkid=this._CRS_TO_EPSG[wkid];}_5cb.allExtents[wkid]=this._getExtent(_5d0,wkid);}}else{wkid=parseInt(_5d1,10);if(wkid!==0&&!isNaN(wkid)){_5cb.allExtents[wkid]=this._getExtent(_5d0,wkid);}}}}else{if(_5d0.nodeName==_5cf){var _5d3=_5d0.text?_5d0.text:_5d0.textContent;var arr=_5d3.split(" ");_5a1.forEach(arr,function(val){if(val.indexOf(":")>-1){val=parseInt(val.split(":")[1],10);}else{val=parseInt(val,10);}if(val!==0&&!isNaN(val)){if(this._CRS_TO_EPSG[val]){val=this._CRS_TO_EPSG[val];}if(_5a1.indexOf(_5cb.spatialReferences,val)==-1){_5cb.spatialReferences.push(val);}}},this);}else{if(_5d0.nodeName=="Style"){var _5d4=this._getTag("LegendURL",_5d0);if(_5d4){var _5d5=this._getTag("OnlineResource",_5d4);if(_5d5){_5cb.legendURL=_5d5.getAttribute("xlink:href");}}}else{if(_5d0.nodeName==="Layer"){_5cb.subLayers.push(this._getLayerInfo(_5d0));}}}}}}}},this);_5cb.title=_5cb.title||_5cb.name;return _5cb;},_getImageFormat:function(_5d6){var _5d7=_5d6?_5d6.toLowerCase():"";switch(_5d7){case "jpg":return "image/jpeg";case "bmp":return "image/bmp";case "gif":return "image/gif";case "svg":return "image/svg+xml";default:return "image/png";}},getImageFormat:function(){var _5d8=this.imageFormat?this.imageFormat.toLowerCase():"";switch(_5d8){case "image/jpeg":return "jpg";case "image/bmp":return "bmp";case "image/gif":return "gif";case "image/svg+xml":return "svg";default:return "png";}},_getExtent:function(_5d9,wkid,_5da){var _5db;if(_5d9){_5db=new _5a6();var minx=parseFloat(_5d9.getAttribute("minx"));var miny=parseFloat(_5d9.getAttribute("miny"));var maxx=parseFloat(_5d9.getAttribute("maxx"));var maxy=parseFloat(_5d9.getAttribute("maxy"));if(_5da){_5db.xmin=isNaN(miny)?((-1)*Number.MAX_VALUE):miny;_5db.ymin=isNaN(minx)?((-1)*Number.MAX_VALUE):minx;_5db.xmax=isNaN(maxy)?Number.MAX_VALUE:maxy;_5db.ymax=isNaN(maxx)?Number.MAX_VALUE:maxx;}else{_5db.xmin=isNaN(minx)?((-1)*Number.MAX_VALUE):minx;_5db.ymin=isNaN(miny)?((-1)*Number.MAX_VALUE):miny;_5db.xmax=isNaN(maxx)?Number.MAX_VALUE:maxx;_5db.ymax=isNaN(maxy)?Number.MAX_VALUE:maxy;}_5db.spatialReference=new _5a5({wkid:wkid});}return _5db;},_useLatLong:function(wkid){var _5dc,i;for(i=0;i<this._REVERSED_LAT_LONG_RANGES.length;i++){var _5dd=this._REVERSED_LAT_LONG_RANGES[i];if(wkid>=_5dd[0]&&wkid<=_5dd[1]){_5dc=true;break;}}return _5dc;},_getTag:function(_5de,xml){var tags=_59f.query(_5de,xml);if(tags&&tags.length>0){return tags[0];}else{return null;}},_getTagValue:function(_5df,xml,_5e0){var _5e1=_59f.query(_5df,xml);if(_5e1&&_5e1.length>0){if(_5e1[0].text){return _5e1[0].text;}else{return _5e1[0].textContent;}}else{return _5e0;}},_getAttributeValue:function(_5e2,_5e3,xml,_5e4){var _5e5=_59f.query(_5e2,xml);if(_5e5&&_5e5.length>0){return _5e5[0].getAttribute(_5e3);}else{return _5e4;}},_checkVisibleLayersList:function(_5e6){if(_5e6&&_5e6.length>0&&this.layerInfos&&this.layerInfos.length>0){if((typeof _5e6[0])=="number"){var list=[];_5a1.forEach(_5e6,function(pos){if(pos<this.layerInfos.length){list.push(this.layerInfos[pos].name);}},this);_5e6=list;}}return _5e6;},_stripParameters:function(url,_5e7){var obj=_5a4.urlToObject(url),prop,qs=[];for(prop in obj.query){if(_5a1.indexOf(_5e7,prop.toLowerCase())===-1){qs.push(prop+"="+obj.query[prop]);}}return obj.path+(qs.length?("?"+qs.join("&")):"");}});if(has("extend-esri")){lang.setObject("layers.WMSLayer",_5a9,_5a2);}return _5a9;});},"dijit/hccss":function(){define("dijit/hccss",["dojo/dom-class","dojo/hccss","dojo/ready","dojo/_base/window"],function(_5e8,has,_5e9,win){_5e9(90,function(){if(has("highcontrast")){_5e8.add(win.body(),"dijit_a11y");}});return has;});},"dijit/_TemplatedMixin":function(){define("dijit/_TemplatedMixin",["dojo/_base/lang","dojo/touch","./_WidgetBase","dojo/string","dojo/cache","dojo/_base/array","dojo/_base/declare","dojo/dom-construct","dojo/sniff","dojo/_base/unload"],function(lang,_5ea,_5eb,_5ec,_5ed,_5ee,_5ef,_5f0,has,_5f1){var _5f2=_5ef("dijit._TemplatedMixin",null,{templateString:null,templatePath:null,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){this._attachPoints=[];this._attachEvents=[];},_stringRepl:function(tmpl){var _5f3=this.declaredClass,_5f4=this;return _5ec.substitute(tmpl,this,function(_5f5,key){if(key.charAt(0)=="!"){_5f5=lang.getObject(key.substr(1),false,_5f4);}if(typeof _5f5=="undefined"){throw new Error(_5f3+" template:"+key);}if(_5f5==null){return "";}return key.charAt(0)=="!"?_5f5:_5f5.toString().replace(/"/g,"&quot;");},this);},buildRendering:function(){if(!this.templateString){this.templateString=_5ed(this.templatePath,{sanitize:true});}var _5f6=_5f2.getCachedTemplate(this.templateString,this._skipNodeCache,this.ownerDocument);var node;if(lang.isString(_5f6)){node=_5f0.toDom(this._stringRepl(_5f6),this.ownerDocument);if(node.nodeType!=1){throw new Error("Invalid template: "+_5f6);}}else{node=_5f6.cloneNode(true);}this.domNode=node;this.inherited(arguments);this._attachTemplateNodes(node,function(n,p){return n.getAttribute(p);});this._beforeFillContent();this._fillContent(this.srcNodeRef);},_beforeFillContent:function(){},_fillContent:function(_5f7){var dest=this.containerNode;if(_5f7&&dest){while(_5f7.hasChildNodes()){dest.appendChild(_5f7.firstChild);}}},_attachTemplateNodes:function(_5f8,_5f9){var _5fa=lang.isArray(_5f8)?_5f8:(_5f8.all||_5f8.getElementsByTagName("*"));var x=lang.isArray(_5f8)?0:-1;for(;x<0||_5fa[x];x++){var _5fb=(x==-1)?_5f8:_5fa[x];if(this.widgetsInTemplate&&(_5f9(_5fb,"dojoType")||_5f9(_5fb,"data-dojo-type"))){continue;}var _5fc=_5f9(_5fb,"dojoAttachPoint")||_5f9(_5fb,"data-dojo-attach-point");if(_5fc){var _5fd,_5fe=_5fc.split(/\s*,\s*/);while((_5fd=_5fe.shift())){if(lang.isArray(this[_5fd])){this[_5fd].push(_5fb);}else{this[_5fd]=_5fb;}this._attachPoints.push(_5fd);}}var _5ff=_5f9(_5fb,"dojoAttachEvent")||_5f9(_5fb,"data-dojo-attach-event");if(_5ff){var _600,_601=_5ff.split(/\s*,\s*/);var trim=lang.trim;while((_600=_601.shift())){if(_600){var _602=null;if(_600.indexOf(":")!=-1){var _603=_600.split(":");_600=trim(_603[0]);_602=trim(_603[1]);}else{_600=trim(_600);}if(!_602){_602=_600;}this._attachEvents.push(this.connect(_5fb,_5ea[_600]||_600,_602));}}}}},destroyRendering:function(){_5ee.forEach(this._attachPoints,function(_604){delete this[_604];},this);this._attachPoints=[];_5ee.forEach(this._attachEvents,this.disconnect,this);this._attachEvents=[];this.inherited(arguments);}});_5f2._templateCache={};_5f2.getCachedTemplate=function(_605,_606,doc){var _607=_5f2._templateCache;var key=_605;var _608=_607[key];if(_608){try{if(!_608.ownerDocument||_608.ownerDocument==(doc||document)){return _608;}}catch(e){}_5f0.destroy(_608);}_605=_5ec.trim(_605);if(_606||_605.match(/\$\{([^\}]+)\}/g)){return (_607[key]=_605);}else{var node=_5f0.toDom(_605,doc);if(node.nodeType!=1){throw new Error("Invalid template: "+_605);}return (_607[key]=node);}};if(has("ie")){_5f1.addOnWindowUnload(function(){var _609=_5f2._templateCache;for(var key in _609){var _60a=_609[key];if(typeof _60a=="object"){_5f0.destroy(_60a);}delete _609[key];}});}lang.extend(_5eb,{dojoAttachEvent:"",dojoAttachPoint:""});return _5f2;});},"esri/tasks/GeometryService":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/_base/json","dojo/_base/Deferred","dojo/has","esri/kernel","esri/request","esri/deferredUtils","esri/tasks/Task","esri/geometry/Extent","esri/geometry/Polyline","esri/geometry/Polygon","esri/geometry/Multipoint","esri/geometry/jsonUtils"],function(_60b,lang,_60c,_60d,_60e,has,_60f,_610,_611,Task,_612,_613,_614,_615,_616){var _617=_60b(Task,{declaredClass:"esri.tasks.GeometryService",_eventMap:{"areas-and-lengths-complete":["result"],"auto-complete-complete":["geometries"],"buffer-complete":["geometries"],"convex-hull-complete":["geometry"],"cut-complete":["result"],"difference-complete":["geometries"],"distance-complete":["distance"],"generalize-complete":["geometries"],"intersect-complete":["geometries"],"label-points-complete":["geometries"],"lengths-complete":["result"],"offset-complete":["geometries"],"project-complete":["geometries"],"relation-complete":["relations"],"reshape-complete":["geometry"],"simplify-complete":["geometries"],"trim-extend-complete":["geometries"],"union-complete":["geometry"]},constructor:function(url){var _618=lang.hitch;this._projectHandler=_618(this,this._projectHandler);this._simplifyHandler=_618(this,this._simplifyHandler);this._bufferHandler=_618(this,this._bufferHandler);this._areasAndLengthsHandler=_618(this,this._areasAndLengthsHandler);this._lengthsHandler=_618(this,this._lengthsHandler);this._labelPointsHandler=_618(this,this._labelPointsHandler);this._relationHandler=_618(this,this._relationHandler);this._convexHullHandler=_618(this,this._convexHullHandler);this._unionHandler=_618(this,this._unionHandler);this._autoCompleteHandler=_618(this,this._autoCompleteHandler);this._reshapeHandler=_618(this,this._reshapeHandler);this._cutHandler=_618(this,this._cutHandler);this._intersectHandler=_618(this,this._intersectHandler);this._differenceHandler=_618(this,this._differenceHandler);this._trimExtendHandler=_618(this,this._trimExtendHandler);this._densifyHandler=_618(this,this._densifyHandler);this._generalizeHandler=_618(this,this._densifyHandler);this._offsetHandler=_618(this,this._offsetHandler);this._distanceHandler=_618(this,this._distanceHandler);this.registerConnectEvents();},_encodeGeometries:function(_619){var gs=[],i,il=_619.length;for(i=0;i<il;i++){gs.push(_619[i].toJson());}return {geometryType:_616.getJsonType(_619[0]),geometries:gs};},_decodeGeometries:function(_61a,_61b,sr){var _61c=_616.getGeometryType(_61b),_61d=_61a.geometries,fs=[],_61e={spatialReference:sr.toJson()},_61f=lang.mixin;_60c.forEach(_61d,function(g,i){fs[i]=new _61c(_61f(g,_61e));});return fs;},_toProjectGeometry:function(_620){var sr=_620.spatialReference.toJson();if(_620 instanceof _612){return new _614({rings:[[[_620.xmin,_620.ymin],[_620.xmin,_620.ymax],[_620.xmax,_620.ymax],[_620.xmax,_620.ymin],[_620.xmin,_620.ymin]]],spatialReference:sr});}else{return new _613({paths:[[].concat(_620.points)],spatialReference:sr});}},_fromProjectedGeometry:function(_621,_622,_623){if(_622==="esriGeometryEnvelope"){var ring=_621.rings[0];return new _612(ring[0][0],ring[0][1],ring[2][0],ring[2][1],_623);}else{return new _615({points:_621.paths[0],spatialReference:_623.toJson()});}},project:function(_624,_625,_626,_627){var _628=lang.mixin({},this._url.query,{f:"json"}),_629;if(!_624.geometries){_629=_624[0];_628=lang.mixin(_628,{outSR:_625.wkid||_60d.toJson(_625.toJson()),inSR:_629.spatialReference.wkid||_60d.toJson(_629.spatialReference.toJson()),geometries:_60d.toJson(this._encodeGeometries(_624))});}else{_627=_626;_626=_625;_625=_624.outSR;_629=_624.geometries[0];_628=lang.mixin(_628,_624.toJson());}var _62a=_616.getJsonType(_629),_62b=this._projectHandler,_62c=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/project",content:_628,callbackParamName:"callback",load:function(r,i){_62b(r,i,_62a,_625,_626,_627,dfd);},error:function(r){_62c(r,_627,dfd);}});return dfd;},_projectHandler:function(_62d,io,_62e,_62f,_630,_631,dfd){try{var fs=this._decodeGeometries(_62d,_62e,_62f);this._successHandler([fs],"onProjectComplete",_630,dfd);}catch(err){this._errorHandler(err,_631,dfd);}},onProjectComplete:function(){},simplify:function(_632,_633,_634){var _635=_632[0].spatialReference;var _636=lang.mixin({},this._url.query,{f:"json",sr:_635.wkid?_635.wkid:_60d.toJson(_635.toJson()),geometries:_60d.toJson(this._encodeGeometries(_632))}),_637=_616.getJsonType(_632[0]),_638=this._simplifyHandler,_639=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/simplify",content:_636,callbackParamName:"callback",load:function(r,i){_638(r,i,_637,_635,_633,_634,dfd);},error:function(r){_639(r,_634,dfd);}});return dfd;},_simplifyHandler:function(_63a,io,_63b,sr,_63c,_63d,dfd){try{var fs=this._decodeGeometries(_63a,_63b,sr);this._successHandler([fs],"onSimplifyComplete",_63c,dfd);}catch(err){this._errorHandler(err,_63d,dfd);}},onSimplifyComplete:function(){},convexHull:function(_63e,_63f,_640){var _641=_63e[0].spatialReference;var _642=lang.mixin({},this._url.query,{f:"json",sr:_60d.toJson(_641.toJson()),geometries:_60d.toJson(this._encodeGeometries(_63e))}),_643=this._convexHullHandler,_644=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/convexHull",content:_642,callbackParamName:"callback",load:function(r,i){_643(r,i,_641,_63f,_640,dfd);},error:function(r){_644(r,_640,dfd);}});return dfd;},_convexHullHandler:function(_645,io,_646,_647,_648,dfd){try{var geom=_616.fromJson(_645.geometry).setSpatialReference(_646);this._successHandler([geom],"onConvexHullComplete",_647,dfd);}catch(err){this._errorHandler(err,_648,dfd);}},onConvexHullComplete:function(){},union:function(_649,_64a,_64b){var _64c=_649[0].spatialReference;var _64d=lang.mixin({},this._url.query,{f:"json",sr:_60d.toJson(_64c.toJson()),geometries:_60d.toJson(this._encodeGeometries(_649))}),_64e=this._unionHandler,_64f=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/union",content:_64d,callbackParamName:"callback",load:function(r,i){_64e(r,i,_64c,_64a,_64b,dfd);},error:function(r){_64f(r,_64b,dfd);}});return dfd;},_unionHandler:function(_650,io,_651,_652,_653,dfd){try{var geom=_616.fromJson(_650.geometry).setSpatialReference(_651);this._successHandler([geom],"onUnionComplete",_652,dfd);}catch(err){this._errorHandler(err,_653,dfd);}},onUnionComplete:function(){},autoComplete:function(_654,_655,_656,_657){var _658=_654[0].spatialReference;var _659=lang.mixin({},this._url.query,{f:"json",sr:_60d.toJson(_658.toJson()),polygons:_60d.toJson(this._encodeGeometries(_654).geometries),polylines:_60d.toJson(this._encodeGeometries(_655).geometries)}),_65a=this._autoCompleteHandler,_65b=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/autoComplete",content:_659,callbackParamName:"callback",load:function(r,i){_65a(r,i,_658,_656,_657,dfd);},error:function(r){_65b(r,_657,dfd);}});return dfd;},_autoCompleteHandler:function(_65c,io,_65d,_65e,_65f,dfd){try{var _660=_65c.geometries,_661=[],i,il=_660.length;for(i=0;i<il;i++){_661[i]=new _614({spatialReference:_65d,rings:_660[i].rings});}this._successHandler([_661],"onAutoCompleteComplete",_65e,dfd);}catch(err){this._errorHandler(err,_65f,dfd);}},onAutoCompleteComplete:function(){},reshape:function(_662,_663,_664,_665){var _666=_662.spatialReference;var _667=lang.mixin({},this._url.query,{f:"json",sr:_60d.toJson(_666.toJson()),target:_60d.toJson({geometryType:_616.getJsonType(_662),geometry:_662.toJson()}),reshaper:_60d.toJson(_663.toJson())}),_668=this._reshapeHandler,_669=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/reshape",content:_667,callbackParamName:"callback",load:function(r,i){_668(r,i,_666,_664,_665,dfd);},error:function(r){_669(r,_665,dfd);}});return dfd;},_reshapeHandler:function(_66a,io,_66b,_66c,_66d,dfd){try{var geom=_616.fromJson(_66a.geometry).setSpatialReference(_66b);this._successHandler([geom],"onReshapeComplete",_66c,dfd);}catch(err){this._errorHandler(err,_66d,dfd);}},onReshapeComplete:function(){},cut:function(_66e,_66f,_670,_671){var _672=_66e[0].spatialReference;var _673=_60c.map(_66e,function(_674){return _674.toJson();});var _675=lang.mixin({},this._url.query,{f:"json",sr:_60d.toJson(_672.toJson()),target:_60d.toJson({geometryType:_616.getJsonType(_66e[0]),geometries:_673}),cutter:_60d.toJson(_66f.toJson())}),_676=this._cutHandler,_677=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/cut",content:_675,callbackParamName:"callback",load:function(r,i){_676(r,i,_672,_670,_671,dfd);},error:function(r){_677(r,_671,dfd);}});return dfd;},_cutHandler:function(_678,io,_679,_67a,_67b,dfd){try{var _67c=_678.geometries;var _67d={};_67d.cutIndexes=_678.cutIndexes;_67d.geometries=[];_60c.forEach(_67c,function(geom){_67d.geometries.push(_616.fromJson(geom).setSpatialReference(_679));});this._successHandler([_67d],"onCutComplete",_67a,dfd);}catch(err){this._errorHandler(err,_67b,dfd);}},onCutComplete:function(){},intersect:function(_67e,_67f,_680,_681){var _682=_67e[0].spatialReference;var _683=lang.mixin({},this._url.query,{f:"json",sr:_60d.toJson(_682.toJson()),geometries:_60d.toJson(this._encodeGeometries(_67e)),geometry:_60d.toJson({geometryType:_616.getJsonType(_67f),geometry:_67f.toJson()})}),_684=this._intersectHandler,_685=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/intersect",content:_683,callbackParamName:"callback",load:function(r,i){_684(r,i,_682,_680,_681,dfd);},error:function(r){_685(r,_681,dfd);}});return dfd;},_intersectHandler:function(_686,io,_687,_688,_689,dfd){try{var _68a=_686.geometries,_68b=[];_60c.forEach(_68a,function(geom){_68b.push(_616.fromJson(geom).setSpatialReference(_687));});this._successHandler([_68b],"onIntersectComplete",_688,dfd);}catch(err){this._errorHandler(err,_689,dfd);}},onIntersectComplete:function(){},difference:function(_68c,_68d,_68e,_68f){var _690=_68c[0].spatialReference;var _691=lang.mixin({},this._url.query,{f:"json",sr:_60d.toJson(_690.toJson()),geometries:_60d.toJson(this._encodeGeometries(_68c)),geometry:_60d.toJson({geometryType:_616.getJsonType(_68d),geometry:_68d.toJson()})}),_692=this._differenceHandler,_693=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/difference",content:_691,callbackParamName:"callback",load:function(r,i){_692(r,i,_690,_68e,_68f,dfd);},error:function(r){_693(r,_68f,dfd);}});return dfd;},_differenceHandler:function(_694,io,_695,_696,_697,dfd){try{var _698=_694.geometries,_699=[];_60c.forEach(_698,function(geom){_699.push(_616.fromJson(geom).setSpatialReference(_695));});this._successHandler([_699],"onDifferenceComplete",_696,dfd);}catch(err){this._errorHandler(err,_697,dfd);}},onDifferenceComplete:function(){},buffer:function(_69a,_69b,_69c){var _69d=lang.mixin({},this._url.query,{f:"json"},_69a.toJson()),sr=_69a.outSpatialReference||_69a.geometries[0].spatialReference,_69e=this._bufferHandler,_69f=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/buffer",content:_69d,callbackParamName:"callback",load:function(r,i){_69e(r,i,sr,_69b,_69c,dfd);},error:function(r){_69f(r,_69c,dfd);}});return dfd;},_bufferHandler:function(_6a0,io,sr,_6a1,_6a2,dfd){try{var _6a3=_6a0.geometries,_6a4=[],i,il=_6a3.length;for(i=0;i<il;i++){_6a4[i]=new _614({spatialReference:sr,rings:_6a3[i].rings});}this._successHandler([_6a4],"onBufferComplete",_6a1,dfd);}catch(err){this._errorHandler(err,_6a2,dfd);}},onBufferComplete:function(){},areasAndLengths:function(_6a5,_6a6,_6a7){var _6a8=lang.mixin({},this._url.query,{f:"json"},_6a5.toJson()),_6a9=this._areasAndLengthsHandler,_6aa=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/areasAndLengths",content:_6a8,callbackParamName:"callback",load:function(r,i){_6a9(r,i,_6a6,_6a7,dfd);},error:function(r){_6aa(r,_6a7,dfd);}});return dfd;},_areasAndLengthsHandler:function(_6ab,io,_6ac,_6ad,dfd){try{this._successHandler([_6ab],"onAreasAndLengthsComplete",_6ac,dfd);}catch(err){this._errorHandler(err,_6ad,dfd);}},onAreasAndLengthsComplete:function(){},lengths:function(_6ae,_6af,_6b0){var _6b1=lang.mixin({},this._url.query,{f:"json"},_6ae.toJson()),_6b2=this._lengthsHandler,_6b3=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/lengths",content:_6b1,callbackParamName:"callback",load:function(r,i){_6b2(r,i,_6af,_6b0,dfd);},error:function(r){_6b3(r,_6b0,dfd);}});return dfd;},_lengthsHandler:function(_6b4,io,_6b5,_6b6,dfd){try{this._successHandler([_6b4],"onLengthsComplete",_6b5,dfd);}catch(err){this._errorHandler(err,_6b6,dfd);}},onLengthsComplete:function(){},labelPoints:function(_6b7,_6b8,_6b9){var _6ba=_60c.map(_6b7,function(geom){return geom.toJson();});var sr=_6b7[0].spatialReference,_6bb=lang.mixin({},this._url.query,{f:"json",sr:sr.wkid?sr.wkid:_60d.toJson(sr.toJson()),polygons:_60d.toJson(_6ba)}),_6bc=this._labelPointsHandler,_6bd=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/labelPoints",content:_6bb,callbackParamName:"callback",load:function(r,i){_6bc(r,i,_6b7,sr,_6b8,_6b9,dfd);},error:function(r){_6bd(r,_6b9,dfd);}});return dfd;},_labelPointsHandler:function(_6be,io,_6bf,sr,_6c0,_6c1,dfd){try{var _6c2=_6be.labelPoints,_6c3=[];_60c.forEach(_6c2,function(geom){_6c3.push(_616.fromJson(geom).setSpatialReference(sr));});this._successHandler([_6c3],"onLabelPointsComplete",_6c0,dfd);}catch(err){this._errorHandler(err,_6c1,dfd);}},onLabelPointsComplete:function(){},relation:function(_6c4,_6c5,_6c6){var _6c7=lang.mixin({},this._url.query,{f:"json"},_6c4.toJson()),_6c8=this._relationHandler,_6c9=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/relation",content:_6c7,callbackParamName:"callback",load:function(r,i){_6c8(r,i,_6c5,_6c6,dfd);},error:function(r){_6c9(r,_6c6,dfd);}});return dfd;},_relationHandler:function(_6ca,io,_6cb,_6cc,dfd){try{var _6cd=_6ca.relations;this._successHandler([_6cd],"onRelationComplete",_6cb,dfd);}catch(err){this._errorHandler(err,_6cc,dfd);}},onRelationComplete:function(){},trimExtend:function(_6ce,_6cf,_6d0){var _6d1=lang.mixin({},this._url.query,{f:"json"},_6ce.toJson()),_6d2=_6ce.sr,_6d3=this._trimExtendHandler,_6d4=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/trimExtend",content:_6d1,callbackParamName:"callback",load:function(r,i){_6d3(r,i,_6d2,_6cf,_6d0,dfd);},error:function(r){_6d4(r,_6d0,dfd);}});return dfd;},_trimExtendHandler:function(_6d5,io,_6d6,_6d7,_6d8,dfd){try{var _6d9=_6d5.geometries,_6da=[],i,il=_6d9.length;for(i=0;i<il;i++){_6da[i]=new _613({spatialReference:_6d6,paths:_6d9[i].paths});}this._successHandler([_6da],"onTrimExtendComplete",_6d7,dfd);}catch(err){this._errorHandler(err,_6d8,dfd);}},onTrimExtendComplete:function(){},densify:function(_6db,_6dc,_6dd){var _6de=lang.mixin({},this._url.query,{f:"json"},_6db.toJson()),_6df=_6db.geometries[0].spatialReference,_6e0=this._densifyHandler,_6e1=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/densify",content:_6de,callbackParamName:"callback",load:function(r,i){_6e0(r,i,_6df,_6dc,_6dd,dfd);},error:function(r){_6e1(r,_6dd,dfd);}});return dfd;},_densifyHandler:function(_6e2,io,_6e3,_6e4,_6e5,dfd){try{var _6e6=_6e2.geometries,_6e7=[];_60c.forEach(_6e6,function(geom){_6e7.push(_616.fromJson(geom).setSpatialReference(_6e3));});this._successHandler([_6e7],"onDensifyComplete",_6e4,dfd);}catch(err){this._errorHandler(err,_6e5,dfd);}},onDensifyComplete:function(){},generalize:function(_6e8,_6e9,_6ea){var _6eb=lang.mixin({},this._url.query,{f:"json"},_6e8.toJson()),_6ec=_6e8.geometries[0].spatialReference,_6ed=this._generalizeHandler,_6ee=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/generalize",content:_6eb,callbackParamName:"callback",load:function(r,i){_6ed(r,i,_6ec,_6e9,_6ea,dfd);},error:function(r){_6ee(r,_6ea,dfd);}});return dfd;},_generalizeHandler:function(_6ef,io,_6f0,_6f1,_6f2,dfd){try{var _6f3=_6ef.geometries,_6f4=[];_60c.forEach(_6f3,function(geom){_6f4.push(_616.fromJson(geom).setSpatialReference(_6f0));});this._successHandler([_6f4],"onGeneralizeComplete",_6f1,dfd);}catch(err){this._errorHandler(err,_6f2,dfd);}},onGeneralizeComplete:function(){},offset:function(_6f5,_6f6,_6f7){var _6f8=lang.mixin({},this._url.query,{f:"json"},_6f5.toJson()),_6f9=_6f5.geometries[0].spatialReference,_6fa=this._offsetHandler,_6fb=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/offset",content:_6f8,callbackParamName:"callback",load:function(r,i){_6fa(r,i,_6f9,_6f6,_6f7,dfd);},error:function(r){_6fb(r,_6f7,dfd);}});return dfd;},_offsetHandler:function(_6fc,io,_6fd,_6fe,_6ff,dfd){try{var _700=_6fc.geometries,_701=[];_60c.forEach(_700,function(geom){_701.push(_616.fromJson(geom).setSpatialReference(_6fd));});this._successHandler([_701],"onOffsetComplete",_6fe,dfd);}catch(err){this._errorHandler(err,_6ff,dfd);}},onOffsetComplete:function(){},distance:function(_702,_703,_704){var _705=lang.mixin({},this._url.query,{f:"json"},_702.toJson()),_706=_702.geometry1.spatialReference,_707=this._distanceHandler,_708=this._errorHandler,dfd=new _60e(_611._dfdCanceller);dfd._pendingDfd=_610({url:this._url.path+"/distance",content:_705,callbackParamName:"callback",load:function(r,i){_707(r,i,_706,_703,_704,dfd);},error:function(r){_708(r,_704,dfd);}});return dfd;},_distanceHandler:function(_709,io,_70a,_70b,_70c,dfd){try{_709=_709&&_709.distance;this._successHandler([_709],"onDistanceComplete",_70b,dfd);}catch(err){this._errorHandler(err,_70c,dfd);}},onDistanceComplete:function(){}});lang.mixin(_617,{UNIT_METER:9001,UNIT_GERMAN_METER:9031,UNIT_FOOT:9002,UNIT_SURVEY_FOOT:9003,UNIT_CLARKE_FOOT:9005,UNIT_FATHOM:9014,UNIT_NAUTICAL_MILE:9030,UNIT_SURVEY_CHAIN:9033,UNIT_SURVEY_LINK:9034,UNIT_SURVEY_MILE:9035,UNIT_KILOMETER:9036,UNIT_CLARKE_YARD:9037,UNIT_CLARKE_CHAIN:9038,UNIT_CLARKE_LINK:9039,UNIT_SEARS_YARD:9040,UNIT_SEARS_FOOT:9041,UNIT_SEARS_CHAIN:9042,UNIT_SEARS_LINK:9043,UNIT_BENOIT_1895A_YARD:9050,UNIT_BENOIT_1895A_FOOT:9051,UNIT_BENOIT_1895A_CHAIN:9052,UNIT_BENOIT_1895A_LINK:9053,UNIT_BENOIT_1895B_YARD:9060,UNIT_BENOIT_1895B_FOOT:9061,UNIT_BENOIT_1895B_CHAIN:9062,UNIT_BENOIT_1895B_LINK:9063,UNIT_INDIAN_FOOT:9080,UNIT_INDIAN_1937_FOOT:9081,UNIT_INDIAN_1962_FOOT:9082,UNIT_INDIAN_1975_FOOT:9083,UNIT_INDIAN_YARD:9084,UNIT_INDIAN_1937_YARD:9085,UNIT_INDIAN_1962_YARD:9086,UNIT_INDIAN_1975_YARD:9087,UNIT_FOOT_1865:9070,UNIT_RADIAN:9101,UNIT_DEGREE:9102,UNIT_ARCMINUTE:9103,UNIT_ARCSECOND:9104,UNIT_GRAD:9105,UNIT_GON:9106,UNIT_MICRORADIAN:9109,UNIT_ARCMINUTE_CENTESIMAL:9112,UNIT_ARCSECOND_CENTESIMAL:9113,UNIT_MIL6400:9114,UNIT_BRITISH_1936_FOOT:9095,UNIT_GOLDCOAST_FOOT:9094,UNIT_INTERNATIONAL_CHAIN:109003,UNIT_INTERNATIONAL_LINK:109004,UNIT_INTERNATIONAL_YARD:109001,UNIT_STATUTE_MILE:9093,UNIT_SURVEY_YARD:109002,UNIT_50KILOMETER_LENGTH:109030,UNIT_150KILOMETER_LENGTH:109031,UNIT_DECIMETER:109005,UNIT_CENTIMETER:109006,UNIT_MILLIMETER:109007,UNIT_INTERNATIONAL_INCH:109008,UNIT_US_SURVEY_INCH:109009,UNIT_INTERNATIONAL_ROD:109010,UNIT_US_SURVEY_ROD:109011,UNIT_US_NAUTICAL_MILE:109012,UNIT_UK_NAUTICAL_MILE:109013,UNIT_SQUARE_INCHES:"esriSquareInches",UNIT_SQUARE_FEET:"esriSquareFeet",UNIT_SQUARE_YARDS:"esriSquareYards",UNIT_ACRES:"esriAcres",UNIT_SQUARE_MILES:"esriSquareMiles",UNIT_SQUARE_MILLIMETERS:"esriSquareMillimeters",UNIT_SQUARE_CENTIMETERS:"esriSquareCentimeters",UNIT_SQUARE_DECIMETERS:"esriSquareDecimeters",UNIT_SQUARE_METERS:"esriSquareMeters",UNIT_ARES:"esriAres",UNIT_HECTARES:"esriHectares",UNIT_SQUARE_KILOMETERS:"esriSquareKilometers"});if(has("extend-esri")){lang.setObject("tasks.GeometryService",_617,_60f);}return _617;});},"dojo/parser":function(){define(["require","./_base/kernel","./_base/lang","./_base/array","./_base/config","./_base/html","./_base/window","./_base/url","./_base/json","./aspect","./date/stamp","./Deferred","./has","./query","./on","./ready"],function(_70d,dojo,_70e,_70f,_710,_711,_712,_713,_714,_715,_716,_717,has,_718,don,_719){new Date("X");var _71a=0;_715.after(_70e,"extend",function(){_71a++;},true);function _71b(ctor){var map=ctor._nameCaseMap,_71c=ctor.prototype;if(!map||map._extendCnt<_71a){map=ctor._nameCaseMap={};for(var name in _71c){if(name.charAt(0)==="_"){continue;}map[name.toLowerCase()]=name;}map._extendCnt=_71a;}return map;};var _71d={};function _71e(_71f){var ts=_71f.join();if(!_71d[ts]){var _720=[];for(var i=0,l=_71f.length;i<l;i++){var t=_71f[i];_720[_720.length]=(_71d[t]=_71d[t]||(_70e.getObject(t)||(~t.indexOf("/")&&_70d(t))));}var ctor=_720.shift();_71d[ts]=_720.length?(ctor.createSubclass?ctor.createSubclass(_720):ctor.extend.apply(ctor,_720)):ctor;}return _71d[ts];};var _721={_clearCache:function(){_71a++;_71d={};},_functionFromScript:function(_722,_723){var _724="",_725="",_726=(_722.getAttribute(_723+"args")||_722.getAttribute("args")),_727=_722.getAttribute("with");var _728=(_726||"").split(/\s*,\s*/);if(_727&&_727.length){_70f.forEach(_727.split(/\s*,\s*/),function(part){_724+="with("+part+"){";_725+="}";});}return new Function(_728,_724+_722.innerHTML+_725);},instantiate:function(_729,_72a,_72b){_72a=_72a||{};_72b=_72b||{};var _72c=(_72b.scope||dojo._scopeName)+"Type",_72d="data-"+(_72b.scope||dojo._scopeName)+"-",_72e=_72d+"type",_72f=_72d+"mixins";var list=[];_70f.forEach(_729,function(node){var type=_72c in _72a?_72a[_72c]:node.getAttribute(_72e)||node.getAttribute(_72c);if(type){var _730=node.getAttribute(_72f),_731=_730?[type].concat(_730.split(/\s*,\s*/)):[type];list.push({node:node,types:_731});}});return this._instantiate(list,_72a,_72b);},_instantiate:function(_732,_733,_734){var _735=_70f.map(_732,function(obj){var ctor=obj.ctor||_71e(obj.types);if(!ctor){throw new Error("Unable to resolve constructor for: '"+obj.types.join()+"'");}return this.construct(ctor,obj.node,_733,_734,obj.scripts,obj.inherited);},this);if(!_733._started&&!_734.noStart){_70f.forEach(_735,function(_736){if(typeof _736.startup==="function"&&!_736._started){_736.startup();}});}return _735;},construct:function(ctor,node,_737,_738,_739,_73a){var _73b=ctor&&ctor.prototype;_738=_738||{};var _73c={};if(_738.defaults){_70e.mixin(_73c,_738.defaults);}if(_73a){_70e.mixin(_73c,_73a);}var _73d;if(has("dom-attributes-explicit")){_73d=node.attributes;}else{if(has("dom-attributes-specified-flag")){_73d=_70f.filter(node.attributes,function(a){return a.specified;});}else{var _73e=/^input$|^img$/i.test(node.nodeName)?node:node.cloneNode(false),_73f=_73e.outerHTML.replace(/=[^\s"']+|="[^"]*"|='[^']*'/g,"").replace(/^\s*<[a-zA-Z0-9]*\s*/,"").replace(/\s*>.*$/,"");_73d=_70f.map(_73f.split(/\s+/),function(name){var _740=name.toLowerCase();return {name:name,value:(node.nodeName=="LI"&&name=="value")||_740=="enctype"?node.getAttribute(_740):node.getAttributeNode(_740).value};});}}var _741=_738.scope||dojo._scopeName,_742="data-"+_741+"-",hash={};if(_741!=="dojo"){hash[_742+"props"]="data-dojo-props";hash[_742+"type"]="data-dojo-type";hash[_742+"mixins"]="data-dojo-mixins";hash[_741+"type"]="dojoType";hash[_742+"id"]="data-dojo-id";}var i=0,item,_743=[],_744,_745;while(item=_73d[i++]){var name=item.name,_746=name.toLowerCase(),_747=item.value;switch(hash[_746]||_746){case "data-dojo-type":case "dojotype":case "data-dojo-mixins":break;case "data-dojo-props":_745=_747;break;case "data-dojo-id":case "jsid":_744=_747;break;case "data-dojo-attach-point":case "dojoattachpoint":_73c.dojoAttachPoint=_747;break;case "data-dojo-attach-event":case "dojoattachevent":_73c.dojoAttachEvent=_747;break;case "class":_73c["class"]=node.className;break;case "style":_73c["style"]=node.style&&node.style.cssText;break;default:if(!(name in _73b)){var map=_71b(ctor);name=map[_746]||name;}if(name in _73b){switch(typeof _73b[name]){case "string":_73c[name]=_747;break;case "number":_73c[name]=_747.length?Number(_747):NaN;break;case "boolean":_73c[name]=_747.toLowerCase()!="false";break;case "function":if(_747===""||_747.search(/[^\w\.]+/i)!=-1){_73c[name]=new Function(_747);}else{_73c[name]=_70e.getObject(_747,false)||new Function(_747);}_743.push(name);break;default:var pVal=_73b[name];_73c[name]=(pVal&&"length" in pVal)?(_747?_747.split(/\s*,\s*/):[]):(pVal instanceof Date)?(_747==""?new Date(""):_747=="now"?new Date():_716.fromISOString(_747)):(pVal instanceof _713)?(dojo.baseUrl+_747):_714.fromJson(_747);}}else{_73c[name]=_747;}}}for(var j=0;j<_743.length;j++){var _748=_743[j].toLowerCase();node.removeAttribute(_748);node[_748]=null;}if(_745){try{_745=_714.fromJson.call(_738.propsThis,"{"+_745+"}");_70e.mixin(_73c,_745);}catch(e){throw new Error(e.toString()+" in data-dojo-props='"+_745+"'");}}_70e.mixin(_73c,_737);if(!_739){_739=(ctor&&(ctor._noScript||_73b._noScript)?[]:_718("> script[type^='dojo/']",node));}var _749=[],_74a=[],_74b=[],ons=[];if(_739){for(i=0;i<_739.length;i++){var _74c=_739[i];node.removeChild(_74c);var _74d=(_74c.getAttribute(_742+"event")||_74c.getAttribute("event")),prop=_74c.getAttribute(_742+"prop"),_74e=_74c.getAttribute(_742+"method"),_74f=_74c.getAttribute(_742+"advice"),_750=_74c.getAttribute("type"),nf=this._functionFromScript(_74c,_742);if(_74d){if(_750=="dojo/connect"){_749.push({method:_74d,func:nf});}else{if(_750=="dojo/on"){ons.push({event:_74d,func:nf});}else{_73c[_74d]=nf;}}}else{if(_750=="dojo/aspect"){_749.push({method:_74e,advice:_74f,func:nf});}else{if(_750=="dojo/watch"){_74b.push({prop:prop,func:nf});}else{_74a.push(nf);}}}}}var _751=ctor.markupFactory||_73b.markupFactory;var _752=_751?_751(_73c,node,ctor):new ctor(_73c,node);if(_744){_70e.setObject(_744,_752);}for(i=0;i<_749.length;i++){_715[_749[i].advice||"after"](_752,_749[i].method,_70e.hitch(_752,_749[i].func),true);}for(i=0;i<_74a.length;i++){_74a[i].call(_752);}for(i=0;i<_74b.length;i++){_752.watch(_74b[i].prop,_74b[i].func);}for(i=0;i<ons.length;i++){don(_752,ons[i].event,ons[i].func);}return _752;},scan:function(root,_753){var list=[],mids=[],_754={};var _755=(_753.scope||dojo._scopeName)+"Type",_756="data-"+(_753.scope||dojo._scopeName)+"-",_757=_756+"type",_758=_756+"textdir",_759=_756+"mixins";var node=root.firstChild;var _75a=_753.inherited;if(!_75a){function _75b(node,attr){return (node.getAttribute&&node.getAttribute(attr))||(node.parentNode&&_75b(node.parentNode,attr));};_75a={dir:_75b(root,"dir"),lang:_75b(root,"lang"),textDir:_75b(root,_758)};for(var key in _75a){if(!_75a[key]){delete _75a[key];}}}var _75c={inherited:_75a};var _75d;var _75e;function _75f(_760){if(!_760.inherited){_760.inherited={};var node=_760.node,_761=_75f(_760.parent);var _762={dir:node.getAttribute("dir")||_761.dir,lang:node.getAttribute("lang")||_761.lang,textDir:node.getAttribute(_758)||_761.textDir};for(var key in _762){if(_762[key]){_760.inherited[key]=_762[key];}}}return _760.inherited;};while(true){if(!node){if(!_75c||!_75c.node){break;}node=_75c.node.nextSibling;_75e=false;_75c=_75c.parent;_75d=_75c.scripts;continue;}if(node.nodeType!=1){node=node.nextSibling;continue;}if(_75d&&node.nodeName.toLowerCase()=="script"){type=node.getAttribute("type");if(type&&/^dojo\/\w/i.test(type)){_75d.push(node);}node=node.nextSibling;continue;}if(_75e){node=node.nextSibling;continue;}var type=node.getAttribute(_757)||node.getAttribute(_755);var _763=node.firstChild;if(!type&&(!_763||(_763.nodeType==3&&!_763.nextSibling))){node=node.nextSibling;continue;}var _764;var ctor=null;if(type){var _765=node.getAttribute(_759),_766=_765?[type].concat(_765.split(/\s*,\s*/)):[type];try{ctor=_71e(_766);}catch(e){}if(!ctor){_70f.forEach(_766,function(t){if(~t.indexOf("/")&&!_754[t]){_754[t]=true;mids[mids.length]=t;}});}var _767=ctor&&!ctor.prototype._noScript?[]:null;_764={types:_766,ctor:ctor,parent:_75c,node:node,scripts:_767};_764.inherited=_75f(_764);list.push(_764);}else{_764={node:node,scripts:_75d,parent:_75c};}node=_763;_75d=_767;_75e=ctor&&ctor.prototype.stopParser&&!(_753.template);_75c=_764;}var d=new _717();if(mids.length){if(has("dojo-debug-messages")){console.warn("WARNING: Modules being Auto-Required: "+mids.join(", "));}_70d(mids,function(){d.resolve(_70f.filter(list,function(_768){if(!_768.ctor){try{_768.ctor=_71e(_768.types);}catch(e){}}var _769=_768.parent;while(_769&&!_769.types){_769=_769.parent;}var _76a=_768.ctor&&_768.ctor.prototype;_768.instantiateChildren=!(_76a&&_76a.stopParser&&!(_753.template));_768.instantiate=!_769||(_769.instantiate&&_769.instantiateChildren);return _768.instantiate;}));});}else{d.resolve(list);}return d.promise;},_require:function(_76b){var hash=_714.fromJson("{"+_76b.innerHTML+"}"),vars=[],mids=[],d=new _717();for(var name in hash){vars.push(name);mids.push(hash[name]);}_70d(mids,function(){for(var i=0;i<vars.length;i++){_70e.setObject(vars[i],arguments[i]);}d.resolve(arguments);});return d.promise;},_scanAmd:function(root){var _76c=new _717(),_76d=_76c.promise;_76c.resolve(true);var self=this;_718("script[type='dojo/require']",root).forEach(function(node){_76d=_76d.then(function(){return self._require(node);});node.parentNode.removeChild(node);});return _76d;},parse:function(_76e,_76f){var root;if(!_76f&&_76e&&_76e.rootNode){_76f=_76e;root=_76f.rootNode;}else{if(_76e&&_70e.isObject(_76e)&&!("nodeType" in _76e)){_76f=_76e;}else{root=_76e;}}root=root?_711.byId(root):_712.body();_76f=_76f||{};var _770=_76f.template?{template:true}:{},_771=[],self=this;var p=this._scanAmd(root,_76f).then(function(){return self.scan(root,_76f);}).then(function(_772){return _771=_771.concat(self._instantiate(_772,_770,_76f));}).otherwise(function(e){console.error("dojo/parser::parse() error",e);throw e;});_70e.mixin(_771,p);return _771;}};if(1){dojo.parser=_721;}if(_710.parseOnLoad){_719(100,_721,"parse");}return _721;});},"dijit/_Widget":function(){define("dijit/_Widget",["dojo/aspect","dojo/_base/config","dojo/_base/connect","dojo/_base/declare","dojo/has","dojo/_base/kernel","dojo/_base/lang","dojo/query","dojo/ready","./registry","./_WidgetBase","./_OnDijitClickMixin","./_FocusMixin","dojo/uacss","./hccss"],function(_773,_774,_775,_776,has,_777,lang,_778,_779,_77a,_77b,_77c,_77d){function _77e(){};function _77f(_780){return function(obj,_781,_782,_783){if(obj&&typeof _781=="string"&&obj[_781]==_77e){return obj.on(_781.substring(2).toLowerCase(),lang.hitch(_782,_783));}return _780.apply(_775,arguments);};};_773.around(_775,"connect",_77f);if(_777.connect){_773.around(_777,"connect",_77f);}var _784=_776("dijit._Widget",[_77b,_77c,_77d],{onClick:_77e,onDblClick:_77e,onKeyDown:_77e,onKeyPress:_77e,onKeyUp:_77e,onMouseDown:_77e,onMouseMove:_77e,onMouseOut:_77e,onMouseOver:_77e,onMouseLeave:_77e,onMouseEnter:_77e,onMouseUp:_77e,constructor:function(_785){this._toConnect={};for(var name in _785){if(this[name]===_77e){this._toConnect[name.replace(/^on/,"").toLowerCase()]=_785[name];delete _785[name];}}},postCreate:function(){this.inherited(arguments);for(var name in this._toConnect){this.on(name,this._toConnect[name]);}delete this._toConnect;},on:function(type,func){if(this[this._onMap(type)]===_77e){return _775.connect(this.domNode,type.toLowerCase(),this,func);}return this.inherited(arguments);},_setFocusedAttr:function(val){this._focused=val;this._set("focused",val);},setAttribute:function(attr,_786){_777.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(attr,_786);},attr:function(name,_787){if(_774.isDebug){var _788=arguments.callee._ach||(arguments.callee._ach={}),_789=(arguments.callee.caller||"unknown caller").toString();if(!_788[_789]){_777.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+_789,"","2.0");_788[_789]=true;}}var args=arguments.length;if(args>=2||typeof name==="object"){return this.set.apply(this,arguments);}else{return this.get(name);}},getDescendants:function(){_777.deprecated(this.declaredClass+"::getDescendants() is deprecated. Use getChildren() instead.","","2.0");return this.containerNode?_778("[widgetId]",this.containerNode).map(_77a.byNode):[];},_onShow:function(){this.onShow();},onShow:function(){},onHide:function(){},onClose:function(){return true;}});if(has("dijit-legacy-requires")){_779(0,function(){var _78a=["dijit/_base"];require(_78a);});}return _784;});},"dijit/focus":function(){define("dijit/focus",["dojo/aspect","dojo/_base/declare","dojo/dom","dojo/dom-attr","dojo/dom-construct","dojo/Evented","dojo/_base/lang","dojo/on","dojo/ready","dojo/sniff","dojo/Stateful","dojo/_base/unload","dojo/_base/window","dojo/window","./a11y","./registry","./main"],function(_78b,_78c,dom,_78d,_78e,_78f,lang,on,_790,has,_791,_792,win,_793,a11y,_794,_795){var _796=_78c([_791,_78f],{curNode:null,activeStack:[],constructor:function(){var _797=lang.hitch(this,function(node){if(dom.isDescendant(this.curNode,node)){this.set("curNode",null);}if(dom.isDescendant(this.prevNode,node)){this.set("prevNode",null);}});_78b.before(_78e,"empty",_797);_78b.before(_78e,"destroy",_797);},registerIframe:function(_798){return this.registerWin(_798.contentWindow,_798);},registerWin:function(_799,_79a){var _79b=this;var _79c=function(evt){_79b._justMouseDowned=true;setTimeout(function(){_79b._justMouseDowned=false;},0);if(has("ie")&&evt&&evt.srcElement&&evt.srcElement.parentNode==null){return;}_79b._onTouchNode(_79a||evt.target||evt.srcElement,"mouse");};var doc=has("ie")?_799.document.documentElement:_799.document;if(doc){if(has("ie")){_799.document.body.attachEvent("onmousedown",_79c);var _79d=function(evt){var tag=evt.srcElement.tagName.toLowerCase();if(tag=="#document"||tag=="body"){return;}if(a11y.isTabNavigable(evt.srcElement)){_79b._onFocusNode(_79a||evt.srcElement);}else{_79b._onTouchNode(_79a||evt.srcElement);}};doc.attachEvent("onfocusin",_79d);var _79e=function(evt){_79b._onBlurNode(_79a||evt.srcElement);};doc.attachEvent("onfocusout",_79e);return {remove:function(){_799.document.detachEvent("onmousedown",_79c);doc.detachEvent("onfocusin",_79d);doc.detachEvent("onfocusout",_79e);doc=null;}};}else{doc.body.addEventListener("mousedown",_79c,true);doc.body.addEventListener("touchstart",_79c,true);var _79f=function(evt){_79b._onFocusNode(_79a||evt.target);};doc.addEventListener("focus",_79f,true);var _7a0=function(evt){_79b._onBlurNode(_79a||evt.target);};doc.addEventListener("blur",_7a0,true);return {remove:function(){doc.body.removeEventListener("mousedown",_79c,true);doc.body.removeEventListener("touchstart",_79c,true);doc.removeEventListener("focus",_79f,true);doc.removeEventListener("blur",_7a0,true);doc=null;}};}}},_onBlurNode:function(node){if(this._clearFocusTimer){clearTimeout(this._clearFocusTimer);}this._clearFocusTimer=setTimeout(lang.hitch(this,function(){this.set("prevNode",this.curNode);this.set("curNode",null);}),0);if(this._justMouseDowned){return;}if(this._clearActiveWidgetsTimer){clearTimeout(this._clearActiveWidgetsTimer);}this._clearActiveWidgetsTimer=setTimeout(lang.hitch(this,function(){delete this._clearActiveWidgetsTimer;this._setStack([]);}),0);},_onTouchNode:function(node,by){if(this._clearActiveWidgetsTimer){clearTimeout(this._clearActiveWidgetsTimer);delete this._clearActiveWidgetsTimer;}var _7a1=[];try{while(node){var _7a2=_78d.get(node,"dijitPopupParent");if(_7a2){node=_794.byId(_7a2).domNode;}else{if(node.tagName&&node.tagName.toLowerCase()=="body"){if(node===win.body()){break;}node=_793.get(node.ownerDocument).frameElement;}else{var id=node.getAttribute&&node.getAttribute("widgetId"),_7a3=id&&_794.byId(id);if(_7a3&&!(by=="mouse"&&_7a3.get("disabled"))){_7a1.unshift(id);}node=node.parentNode;}}}}catch(e){}this._setStack(_7a1,by);},_onFocusNode:function(node){if(!node){return;}if(node.nodeType==9){return;}if(this._clearFocusTimer){clearTimeout(this._clearFocusTimer);delete this._clearFocusTimer;}this._onTouchNode(node);if(node==this.curNode){return;}this.set("prevNode",this.curNode);this.set("curNode",node);},_setStack:function(_7a4,by){var _7a5=this.activeStack;this.set("activeStack",_7a4);for(var _7a6=0;_7a6<Math.min(_7a5.length,_7a4.length);_7a6++){if(_7a5[_7a6]!=_7a4[_7a6]){break;}}var _7a7;for(var i=_7a5.length-1;i>=_7a6;i--){_7a7=_794.byId(_7a5[i]);if(_7a7){_7a7._hasBeenBlurred=true;_7a7.set("focused",false);if(_7a7._focusManager==this){_7a7._onBlur(by);}this.emit("widget-blur",_7a7,by);}}for(i=_7a6;i<_7a4.length;i++){_7a7=_794.byId(_7a4[i]);if(_7a7){_7a7.set("focused",true);if(_7a7._focusManager==this){_7a7._onFocus(by);}this.emit("widget-focus",_7a7,by);}}},focus:function(node){if(node){try{node.focus();}catch(e){}}}});var _7a8=new _796();_790(function(){var _7a9=_7a8.registerWin(_793.get(win.doc));if(has("ie")){_792.addOnWindowUnload(function(){if(_7a9){_7a9.remove();_7a9=null;}});}});_795.focus=function(node){_7a8.focus(node);};for(var attr in _7a8){if(!/^_/.test(attr)){_795.focus[attr]=typeof _7a8[attr]=="function"?lang.hitch(_7a8,attr):_7a8[attr];}}_7a8.watch(function(attr,_7aa,_7ab){_795.focus[attr]=_7ab;});return _7a8;});},"dijit/_FocusMixin":function(){define("dijit/_FocusMixin",["./focus","./_WidgetBase","dojo/_base/declare","dojo/_base/lang"],function(_7ac,_7ad,_7ae,lang){lang.extend(_7ad,{focused:false,onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus();},_onBlur:function(){this.onBlur();}});return _7ae("dijit._FocusMixin",null,{_focusManager:_7ac});});},"esri/layers/MosaicRule":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/has","esri/kernel","esri/lang","esri/geometry/Point"],function(_7af,lang,_7b0,has,_7b1,_7b2,_7b3){var _7b4=_7af(null,{declaredClass:"esri.layers.MosaicRule",method:null,where:null,sortField:null,sortValue:null,ascending:false,lockRasterIds:null,viewpoint:null,objectIds:null,operation:null,constructor:function(_7b5){if(!lang.isObject(_7b5)){return;}lang.mixin(this,_7b5);if(_7b5.mosaicMethod){this.method=_7b5.mosaicMethod;}if(this.method&&this.method.toLowerCase().substring(0,4)!=="esri"){this.method=this._getMethodEnum(this.method);}if(_7b5.mosaicOperation){this.operation=_7b5.mosaicOperation;}if(this.operation&&this.operation.toUpperCase().substring(0,3)!=="MT_"){this.operation=this._getOperatorEnum(this.operation);}if(_7b5.fids){this.objectIds=_7b5.fids;}if(_7b5.viewpoint){this.viewpoint=new _7b3(_7b5.viewpoint);}},toJson:function(){var json={mosaicMethod:this.method,where:this.where,sortField:this.sortField,sortValue:this.sortValue,ascending:this.ascending,lockRasterIds:this.lockRasterIds,viewpoint:this.viewpoint?this.viewpoint.toJson():null,fids:this.objectIds,mosaicOperation:this.operation};return _7b2.filter(json,function(_7b6){if(_7b6!==null){return true;}});},_getMethodEnum:function(_7b7){if(!_7b7){return;}var _7b8=_7b4.METHOD_NONE;switch(_7b7.toLowerCase()){case "byattribute":_7b8=_7b4.METHOD_ATTRIBUTE;break;case "center":_7b8=_7b4.METHOD_CENTER;break;case "lockraster":_7b8=_7b4.METHOD_LOCKRASTER;break;case "nadir":_7b8=_7b4.METHOD_NADIR;break;case "northwest":_7b8=_7b4.METHOD_NORTHWEST;break;case "seamline":_7b8=_7b4.METHOD_SEAMLINE;break;case "viewpoint":_7b8=_7b4.METHOD_VIEWPOINT;break;}return _7b8;},_getOperatorEnum:function(_7b9){if(!_7b9){return;}switch(_7b9.toLowerCase()){case "first":return _7b4.OPERATION_FIRST;case "last":return _7b4.OPERATION_LAST;case "max":return _7b4.OPERATION_MAX;case "min":return _7b4.OPERATION_MIN;case "blend":return _7b4.OPERATION_BLEND;case "mean":return _7b4.OPERATION_MEAN;}}});lang.mixin(_7b4,{METHOD_NONE:"esriMosaicNone",METHOD_CENTER:"esriMosaicCenter",METHOD_NADIR:"esriMosaicNadir",METHOD_VIEWPOINT:"esriMosaicViewpoint",METHOD_ATTRIBUTE:"esriMosaicAttribute",METHOD_LOCKRASTER:"esriMosaicLockRaster",METHOD_NORTHWEST:"esriMosaicNorthwest",METHOD_SEAMLINE:"esriMosaicSeamline",OPERATION_FIRST:"MT_FIRST",OPERATION_LAST:"MT_LAST",OPERATION_MIN:"MT_MIN",OPERATION_MAX:"MT_MAX",OPERATION_MEAN:"MT_MEAN",OPERATION_BLEND:"MT_BLEND"});if(has("extend-esri")){lang.setObject("layers.MosaicRule",_7b4,_7b1);}return _7b4;});},"esri/tasks/QueryTask":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/_base/Deferred","dojo/_base/json","dojo/has","esri/kernel","esri/request","esri/deferredUtils","esri/geometry/normalizeUtils","esri/tasks/Task","esri/tasks/FeatureSet"],function(_7ba,lang,_7bb,_7bc,_7bd,has,_7be,_7bf,_7c0,_7c1,Task,_7c2){var _7c3=_7ba(Task,{declaredClass:"esri.tasks.QueryTask",_eventMap:{"complete":["featureSet"],"execute-for-count-complete":["count"],"execute-for-ids-complete":["objectIds"],"execute-relationship-query-complete":["featureSets"]},constructor:function(url,_7c4){this._handler=lang.hitch(this,this._handler);this._relationshipQueryHandler=lang.hitch(this,this._relationshipQueryHandler);this._executeForIdsHandler=lang.hitch(this,this._executeForIdsHandler);this._countHandler=lang.hitch(this,this._countHandler);this.source=_7c4&&_7c4.source;this.gdbVersion=_7c4&&_7c4.gdbVersion;this.registerConnectEvents();},__msigns:[{n:"execute",c:4,a:[{i:0,p:["geometry"]}],e:2},{n:"executeForIds",c:3,a:[{i:0,p:["geometry"]}],e:2},{n:"executeForCount",c:3,a:[{i:0,p:["geometry"]}],e:2}],onComplete:function(){},onExecuteRelationshipQueryComplete:function(){},onExecuteForIdsComplete:function(){},onExecuteForCountComplete:function(){},execute:function(_7c5,_7c6,_7c7,_7c8,_7c9){var _7ca=_7c9.assembly,_7cb=this._encode(lang.mixin({},this._url.query,{f:"json"},_7c5.toJson(_7ca&&_7ca[0]))),_7cc=this._handler,_7cd=this._errorHandler;if(this.source){var _7ce={source:this.source.toJson()};_7cb.layer=_7bd.toJson(_7ce);}if(this.gdbVersion){_7cb.gdbVersion=this.gdbVersion;}return _7bf({url:this._url.path+"/query",content:_7cb,callbackParamName:"callback",load:function(r,i){_7cc(r,i,_7c6,_7c7,_7c9.dfd);},error:function(r){_7cd(r,_7c7,_7c9.dfd);},callbackSuffix:_7c8});},executeRelationshipQuery:function(_7cf,_7d0,_7d1){var _7d2=this._encode(lang.mixin({},this._url.query,{f:"json"},_7cf.toJson())),_7d3=this._relationshipQueryHandler,_7d4=this._errorHandler;if(this.gdbVersion){_7d2.gdbVersion=this.gdbVersion;}var dfd=new _7bc(_7c0._dfdCanceller);dfd._pendingDfd=_7bf({url:this._url.path+"/queryRelatedRecords",content:_7d2,callbackParamName:"callback",load:function(r,i){_7d3(r,i,_7d0,_7d1,dfd);},error:function(r){_7d4(r,_7d1,dfd);}});return dfd;},executeForIds:function(_7d5,_7d6,_7d7,_7d8){var _7d9=_7d8.assembly,_7da=this._encode(lang.mixin({},this._url.query,{f:"json",returnIdsOnly:true},_7d5.toJson(_7d9&&_7d9[0]))),_7db=this._executeForIdsHandler,_7dc=this._errorHandler;if(this.source){var _7dd={source:this.source.toJson()};_7da.layer=_7bd.toJson(_7dd);}if(this.gdbVersion){_7da.gdbVersion=this.gdbVersion;}return _7bf({url:this._url.path+"/query",content:_7da,callbackParamName:"callback",load:function(r,i){_7db(r,i,_7d6,_7d7,_7d8.dfd);},error:function(r){_7dc(r,_7d7,_7d8.dfd);}});},executeForCount:function(_7de,_7df,_7e0,_7e1){var _7e2=_7e1.assembly,_7e3=this._encode(lang.mixin({},this._url.query,{f:"json",returnIdsOnly:true,returnCountOnly:true},_7de.toJson(_7e2&&_7e2[0]))),_7e4=this._countHandler,_7e5=this._errorHandler;if(this.source){var _7e6={source:this.source.toJson()};_7e3.layer=_7bd.toJson(_7e6);}if(this.gdbVersion){_7e3.gdbVersion=this.gdbVersion;}return _7bf({url:this._url.path+"/query",content:_7e3,callbackParamName:"callback",load:function(r,i){_7e4(r,i,_7df,_7e0,_7e1.dfd);},error:function(r){_7e5(r,_7e0,_7e1.dfd);}});},_handler:function(_7e7,io,_7e8,_7e9,dfd){try{var _7ea=new _7c2(_7e7);this._successHandler([_7ea],"onComplete",_7e8,dfd);}catch(err){this._errorHandler(err,_7e9,dfd);}},_relationshipQueryHandler:function(_7eb,io,_7ec,_7ed,dfd){try{var gt=_7eb.geometryType,sr=_7eb.spatialReference,_7ee={};_7bb.forEach(_7eb.relatedRecordGroups,function(gr){var _7ef={};_7ef.geometryType=gt;_7ef.spatialReference=sr;_7ef.features=gr.relatedRecords;var fset=new _7c2(_7ef);_7ee[gr.objectId]=fset;});this._successHandler([_7ee],"onExecuteRelationshipQueryComplete",_7ec,dfd);}catch(err){this._errorHandler(err,_7ed,dfd);}},_executeForIdsHandler:function(_7f0,io,_7f1,_7f2,dfd){try{this._successHandler([_7f0.objectIds],"onExecuteForIdsComplete",_7f1,dfd);}catch(err){this._errorHandler(err,_7f2,dfd);}},_countHandler:function(_7f3,io,_7f4,_7f5,dfd){try{var _7f6,_7f7=_7f3.features,ids=_7f3.objectIds;if(ids){_7f6=ids.length;}else{if(_7f7){throw new Error("Unable to perform query. Please check your parameters.");}else{_7f6=_7f3.count;}}this._successHandler([_7f6],"onExecuteForCountComplete",_7f4,dfd);}catch(err){this._errorHandler(err,_7f5,dfd);}}});_7c1._createWrappers(_7c3);if(has("extend-esri")){lang.setObject("tasks.QueryTask",_7c3,_7be);}return _7c3;});},"esri/layers/ArcGISImageServiceLayer":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/Deferred","dojo/_base/array","dojo/_base/json","dojo/_base/config","dojo/has","dojo/io-query","esri/kernel","esri/config","esri/lang","esri/request","esri/deferredUtils","esri/urlUtils","esri/geometry/Extent","esri/geometry/Point","esri/SpatialReference","esri/layers/MosaicRule","esri/layers/DynamicMapServiceLayer","esri/layers/TimeInfo","esri/layers/Field","esri/graphic","esri/tasks/ImageServiceIdentifyTask","esri/tasks/ImageServiceIdentifyParameters"],function(_7f8,lang,_7f9,_7fa,_7fb,_7fc,has,ioq,_7fd,_7fe,_7ff,_800,_801,_802,_803,_804,_805,_806,_807,_808,_809,_80a,_80b,_80c){var _80d=_7f8(_807,{declaredClass:"esri.layers.ArcGISImageServiceLayer",_eventMap:{"rendering-change":true,"mosaic-rule-change":true},constructor:function(url,_80e){this._url=_802.urlToObject(url);var _80f=_80e&&_80e.imageServiceParameters;this.format=_80f&&_80f.format;this.interpolation=_80f?_80f.interpolation:null;this.compressionQuality=_80f?_80f.compressionQuality:null;this.bandIds=_80f?_80f.bandIds:null;this.mosaicRule=_80f?_80f.mosaicRule:null;this.renderingRule=_80f?_80f.renderingRule:null;this._params=lang.mixin({},this._url.query,{f:"image",interpolation:this.interpolation,format:this.format,compressionQuality:this.compressionQuality,bandIds:this.bandIds?this.bandIds.join(","):null},_80f?_80f.toJson():{});this._initLayer=lang.hitch(this,this._initLayer);this._queryVisibleRastersHandler=lang.hitch(this,this._queryVisibleRastersHandler);this._visibleRasters=[];this.useMapImage=(_80e&&_80e.useMapImage)||false;this.infoTemplate=_80e&&_80e.infoTemplate;this._rasterAttributeTableFields=[];this._rasterAttributeTableFeatures=[];this._loadCallback=_80e&&_80e.loadCallback;var _810=_80e&&_80e.resourceInfo;if(_810){this._initLayer(_810);}else{_800({url:this._url.path,content:lang.mixin({f:"json"},this._url.query),callbackParamName:"callback",load:this._initLayer,error:this._errorHandler});}this.registerConnectEvents();},disableClientCaching:false,_initLayer:function(_811,io){this._findCredential();var ssl=(this.credential&&this.credential.ssl)||(_811&&_811._ssl);if(ssl){this._useSSL();}var _812=this.minScale,_813=this.maxScale;lang.mixin(this,_811);this.minScale=_812;this.maxScale=_813;this.initialExtent=(this.fullExtent=this.extent=(new _803(_811.extent)));this.spatialReference=this.initialExtent.spatialReference;this.pixelSizeX=parseFloat(this.pixelSizeX);this.pixelSizeY=parseFloat(this.pixelSizeY);var i,il,mins=this.minValues,maxs=this.maxValues,_814=this.meanValues,_815=this.stdvValues,bs=(this.bands=[]);for(i=0,il=this.bandCount;i<il;i++){bs[i]={min:mins[i],max:maxs[i],mean:_814[i],stddev:_815[i]};}var _816=this.timeInfo;this.timeInfo=(_816&&_816.timeExtent)?new _808(_816):null;var _817=this.fields=[];var _818=_811.fields;if(_818){for(i=0;i<_818.length;i++){_817.push(new _809(_818[i]));}}this.version=_811.currentVersion;if(!this.version){var ver;if("fields" in _811||"objectIdField" in _811||"timeInfo" in _811){ver=10;}else{ver=9.3;}this.version=ver;}if(_7ff.isDefined(_811.minScale)&&!this._hasMin){this.setMinScale(_811.minScale);}if(_7ff.isDefined(_811.maxScale)&&!this._hasMax){this.setMaxScale(_811.maxScale);}var _819={};if(_811.defaultMosaicMethod){_819.method=_811.defaultMosaicMethod;_819.operation=_811.mosaicOperator;_819.sortField=_811.sortField;_819.sortValue=_811.sortValue;}else{_819.method=_806.METHOD_NONE;}this.defaultMosaicRule=new _806(_819);this.defaultMosaicRule.ascending=true;if(this.version>10&&this.hasRasterAttributeTable){var _81a=this.getRasterAttributeTable();_81a.then(lang.hitch(this,function(_81b){if(_81b&&_81b.features&&_81b.features.length>0){this._rasterAttributeTableFeatures=lang.clone(_81b.features);}if(_81b&&_81b.fields&&_81b.fields.length>0){this._rasterAttributeTableFields=lang.clone(_81b.fields);}}));}this.loaded=true;this.onLoad(this);var _81c=this._loadCallback;if(_81c){delete this._loadCallback;_81c(this);}},getKeyProperties:function(){var url=this._url.path+"/keyProperties",dfd=new _7f9(_801._dfdCanceller);if(this.version>10){dfd._pendingDfd=_800({url:url,content:{f:"json"},handleAs:"json",callbackParamName:"callback"});dfd._pendingDfd.then(function(_81d){dfd.callback(_81d);},function(_81e){dfd.errback(_81e);});}else{var err=new Error("Layer does not have key properties");err.log=_7fc.isDebug;dfd.errback(err);}return dfd;},getRasterAttributeTable:function(){var url=this._url.path+"/rasterAttributeTable",dfd=new _7f9(_801._dfdCanceller);if(this.version>10&&this.hasRasterAttributeTable){dfd._pendingDfd=_800({url:url,content:{f:"json"},handleAs:"json",callbackParamName:"callback"});dfd._pendingDfd.then(function(_81f){dfd.callback(_81f);},function(_820){dfd.errback(_820);});}else{var err=new Error("Layer does not support raster attribute table");err.log=_7fc.isDebug;dfd.errback(err);}return dfd;},_getRasterAttributeTableFeatures:function(){var dfd=new _7f9();if(this._rasterAttributeTableFeatures&&this._rasterAttributeTableFeatures.length>0){dfd.resolve(this._rasterAttributeTableFeatures);return dfd;}if(this.version>10&&this.hasRasterAttributeTable){var _821=this.getRasterAttributeTable();_821.then(lang.hitch(this,function(_822){if(_822&&_822.features&&_822.features.length>0){this._rasterAttributeTableFeatures=lang.clone(_822.features);}}));return _821;}else{dfd.resolve(this._rasterAttributeTableFeatures);return dfd;}},getCustomRasterFields:function(_823){var _824=_823?_823.rasterAttributeTableFieldPrefix:"";var _825={name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:false,length:50,type:"esriFieldTypeString"};var _826={name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:false,length:50,type:"esriFieldTypeString"};var _827=this.fields?lang.clone(this.fields):[];var _828=_827.length;_827[_828]=_826;if(this.capabilities&&this.capabilities.toLowerCase().indexOf("catalog")>-1){_827[_828+1]=_825;}if(this._rasterAttributeTableFields&&this._rasterAttributeTableFields.length>0){var _829=_7fa.filter(this._rasterAttributeTableFields,function(_82a){return (_82a.type!=="esriFieldTypeOID"&&_82a.name.toLowerCase()!=="value");});var _82b=_7fa.map(_829,function(_82c){var _82d=lang.clone(_82c);_82d.name=_824+_82c.name;return _82d;});_827=_827.concat(_82b);}return _827;},getImageUrl:function(_82e,_82f,_830,_831){var sr=_82e.spatialReference.wkid||_7fb.toJson(_82e.spatialReference.toJson());delete this._params._ts;var path=this._url.path+"/exportImage?";lang.mixin(this._params,{bbox:_82e.xmin+","+_82e.ymin+","+_82e.xmax+","+_82e.ymax,imageSR:sr,bboxSR:sr,size:_82f+","+_830},this.disableClientCaching?{_ts:new Date().getTime()}:{});var _832=(this._params.token=this._getToken()),_833=_802.addProxy(path+ioq.objectToQuery(lang.mixin(this._params,{f:"image"})));if((_833.length>_7fe.defaults.io.postLength)||this.useMapImage){this._jsonRequest=_800({url:path,content:lang.mixin(this._params,{f:"json"}),callbackParamName:"callback",load:function(_834,io){var href=_834.href;if(_832){href+=(href.indexOf("?")===-1?("?token="+_832):("&token="+_832));}_831(_802.addProxy(href));},error:this._errorHandler});}else{_831(_833);}},onRenderingChange:function(){},onMosaicRuleChange:function(){},setInterpolation:function(_835,_836){this.interpolation=(this._params.interpolation=_835);if(!_836){this.refresh(true);}},setCompressionQuality:function(_837,_838){this.compressionQuality=(this._params.compressionQuality=_837);if(!_838){this.refresh(true);}},setBandIds:function(ids,_839){var _83a=false;if(this.bandIds!==ids){_83a=true;}this.bandIds=ids;this._params.bandIds=ids.join(",");if(_83a&&!_839){this.onRenderingChange();}if(!_839){this.refresh(true);}},setDefaultBandIds:function(_83b){this.bandIds=(this._params.bandIds=null);if(!_83b){this.refresh(true);}},setDisableClientCaching:function(_83c){this.disableClientCaching=_83c;},setMosaicRule:function(_83d,_83e){var _83f=false;if(this.mosaicRule!==_83d){_83f=true;}this.mosaicRule=_83d;this._params.mosaicRule=_7fb.toJson(_83d.toJson());if(_83f&&!_83e){this.onMosaicRuleChange();}if(!_83e){this.refresh(true);}},setRenderingRule:function(_840,_841){var _842=false;if(this.renderingRule!==_840){_842=true;}this.renderingRule=_840;this._params.renderingRule=_840?_7fb.toJson(_840.toJson()):null;if(_842&&!_841){this.onRenderingChange();}if(!_841){this.refresh(true);}},setImageFormat:function(_843,_844){this.format=(this._params.format=_843);if(!_844){this.refresh(true);}},setInfoTemplate:function(_845){this.infoTemplate=_845;},setDefinitionExpression:function(expr,_846){var json=this.mosaicRule?this.mosaicRule.toJson():{};if(!this.mosaicRule){if(this.defaultMosaicRule){json=this.defaultMosaicRule.toJson();}else{json.method=_806.METHOD_NONE;}}json.where=expr;var _847=new _806(json);this.setMosaicRule(_847,_846);return this;},getDefinitionExpression:function(){return this.mosaicRule?this.mosaicRule.where:null;},refresh:function(_848){if(_848){this.inherited(arguments);}else{var dc=this.disableClientCaching;this.disableClientCaching=true;this.inherited(arguments);this.disableClientCaching=dc;}},exportMapImage:function(_849,_84a){var m=_7fe.defaults.map,p=lang.mixin({size:m.width+","+m.height},this._params,_849?_849.toJson(this.normalization):{},{f:"json"});delete p._ts;this._exportMapImage(this._url.path+"/exportImage",p,_84a);},queryVisibleRasters:function(_84b,_84c,_84d,_84e){var map=this._map,dfd=_801._fixDfd(new _7f9(_801._dfdCanceller));this._visibleRasters=[];var i,_84f,_850=true;if(this.infoTemplate&&this.infoTemplate.info.fieldInfos&&this.infoTemplate.info.fieldInfos.length>0){_850=false;for(i=0;i<this.infoTemplate.info.fieldInfos.length;i++){_84f=this.infoTemplate.info.fieldInfos[i];if(_84f&&_84f.visible&&_84f.fieldName.toLowerCase()!=="raster.servicepixelvalue"){_850=true;}}}var _851=new _80c();_851.geometry=_84b.geometry.getCenter();_851.returnGeometry=true;_851.returnCatalogItems=_850;_851.timeExtent=_84b.timeExtent;_851.mosaicRule=(this.mosaicRule?this.mosaicRule:null);_851.renderingRule=(this.renderingRule?this.renderingRule:null);if(map){var psX=(map.extent.xmax-map.extent.xmin)/(map.width*2);var psY=(map.extent.ymax-map.extent.ymin)/(map.height*2);var psSR=map.extent.spatialReference;var _852=new _804(psX,psY,psSR);_851.pixelSize=_852;}var self=this;var task=new _80b(this.url);var temp=dfd._pendingDfd=task.execute(_851);temp.addCallbacks(function(_853){self._queryVisibleRastersHandler(_853,_84c,_84d,_84e,dfd);},function(err){self._resolve([err],null,_84e,dfd,true);});return dfd;},_queryVisibleRastersHandler:function(_854,_855,_856,_857,dfd){var _858=_854.features;var _859=_854.value;var _85a;if(_854.catalogItems){_858=_854.catalogItems.features;_85a=_854.properties.Values;}this._visibleRasters=[];var _85b,_85c=this.objectIdField;var _85d=_859.toLowerCase().indexOf("nodata")>-1;if(_859&&!_858&&!_85d){_85c="ObjectId";_858=[];var _85e={};_85e.ObjectId=0;_85b=new _80a(new _803(this.fullExtent),null,_85e);_858.push(_85b);}var _85f=[];if(!_858){this._resolve([_85f,null,null],null,_856,dfd);return;}var _860=this.getCustomRasterFields(_855);var _861=this._getDomainFields(_860);var _862=_855?_855.returnDomainValues:false;var _863=_855&&_855.rasterAttributeTableFieldPrefix;var i,oid,_864,pVal,_865,_866,prop,_867,_868;var _869=this._getRasterAttributeTableFeatures();_869.then(lang.hitch(this,function(_86a){for(i=0;i<_858.length;i++){_85b=_858[i];oid=_85b.attributes[_85c];_85b.setInfoTemplate(this.infoTemplate);if(_859){_864=_859;if(_85a&&_85a.length>=i){pVal=_85a[i];_864=pVal.replace(/ /gi,", ");}_85b.attributes["Raster.ItemPixelValue"]=_864;_85b.attributes["Raster.ServicePixelValue"]=_859;if(_86a&&_86a.length>0){_865=_7fa.filter(_86a,function(_86b){if(_86b&&_86b.attributes){if(_86b.attributes.hasOwnProperty("Value")){return (_86b.attributes.Value==_864);}else{return (_86b.attributes.VALUE==_864);}}});if(_865.length>0){_866=lang.clone(_865[0]);if(_863&&_866){_868={};for(prop in _866.attributes){if(_866.attributes.hasOwnProperty(prop)){_867=_863+prop;_868[_867]=_866.attributes[prop];}}_866.attributes=_868;_85b.attributes=lang.mixin(_85b.attributes,_866.attributes);}}}}if(_862&&_861&&_861.length>0){_7fa.forEach(_861,function(_86c){if(_86c){var _86d=_85b.attributes[_86c.name];if(_7ff.isDefined(_86d)){var _86e=this._getDomainValue(_86c.domain,_86d);if(_7ff.isDefined(_86e)){_85b.attributes[_86c.name]=_86e;}}}},this);}_85f.push(_85b);this._visibleRasters.push(_85b);}this._resolve([_85f,null,true],null,_856,dfd);}));},getVisibleRasters:function(){var _86f=this._visibleRasters,_870=[],item;for(item in _86f){if(_86f.hasOwnProperty(item)){_870.push(_86f[item]);}}return _870;},_getDomainFields:function(_871){if(!_871){return;}var _872=[];_7fa.forEach(_871,function(_873){if(_873.domain){var _874={};_874.name=_873.name;_874.domain=_873.domain;_872.push(_874);}});return _872;},_getDomainValue:function(_875,_876){if(_875&&_875.codedValues){var _877;_7fa.some(_875.codedValues,function(_878){if(_878.code===_876){_877=_878.name;return true;}return false;});return _877;}},_resolve:function(args,_879,_87a,dfd,_87b){if(_879){this[_879].apply(this,args);}if(_87a){_87a.apply(null,args);}if(dfd){_801._resDfd(dfd,args,_87b);}}});if(has("extend-esri")){lang.setObject("layers.ArcGISImageServiceLayer",_80d,_7fd);}return _80d;});},"esri/arcgis/csv":function(){define(["dojo/_base/lang","dojo/_base/array","dojo/_base/Deferred","dojo/sniff","dojo/number","dojox/data/CsvStore","esri/kernel","esri/config","esri/request","esri/SpatialReference","esri/geometry/Point","esri/geometry/jsonUtils","esri/geometry/webMercatorUtils"],function(lang,_87c,_87d,has,_87e,_87f,_880,_881,_882,_883,_884,_885,_886){var _887=["lat","latitude","y","ycenter","latitude83","latdecdeg","POINT-Y"],_888=["lon","lng","long","longitude","x","xcenter","longitude83","longdecdeg","POINT-X"];function _889(_88a){var _88b=[","," ",";","|","\t"];var _88c=0;var _88d="";_87c.forEach(_88b,function(_88e){var _88f=_88a.split(_88e).length;if(_88f>_88c){_88c=_88f;_88d=_88e;}});return _88d;};function _890(d,_891){if(!d||Object.prototype.toString.call(d)!=="[object Date]"||isNaN(d.getTime())){return false;}var _892=true;if(has("chrome")&&/\d+\W*$/.test(_891)){var _893=_891.match(/[a-zA-Z]{2,}/);if(_893){var _894=false,i=0,len=_893.length,_895=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i;while(!_894&&(i<=len)&&!(_894=!_895.test(_893[i]))){i++;}_892=!_894;}}return _892;};function _896(data,_897,_898){var _899=data.indexOf("\n");var _89a=lang.trim(data.substr(0,_899));var _89b=_897.columnDelimiter;if(!_89b){_89b=_889(_89a);}var _89c=new _87f({data:data,separator:_89b});var _89d=(has("ie")<9)?750:1001;_89c.fetch({start:0,count:_89d,onComplete:function(_89e,_89f){var _8a0=0;var _8a1={"layerDefinition":_897.layerDefinition,"featureSet":{"features":[],"geometryType":"esriGeometryPoint"}};var _8a2=_8a1.layerDefinition.objectIdField;if(!_8a2){if(!_87c.some(_8a1.layerDefinition.fields,function(_8a3){if(_8a3.type=="esriFieldTypeOID"){_8a2=_8a3.name;return true;}return false;})){_8a1.layerDefinition.fields.push({"name":"__OBJECTID","alias":"__OBJECTID","type":"esriFieldTypeOID","editable":false,"domain":null});_8a2="__OBJECTID";}}var _8a4,_8a5;var _8a6=_89c._attributes;var _8a7=[];var _8a8=[];_87c.forEach(_8a1.layerDefinition.fields,function(_8a9,_8aa){if(_8a9.type==="esriFieldTypeDate"){_8a7.push(_8a9.name);}else{if(_8a9.type==="esriFieldTypeDouble"||_8a9.type==="esriFieldTypeInteger"){_8a8.push(_8a9.name);}}});if(_897.locationInfo&&_897.locationInfo.locationType==="coordinates"){_8a4=_897.locationInfo.latitudeFieldName;_8a5=_897.locationInfo.longitudeFieldName;}else{_87c.forEach(_8a6,function(_8ab){var _8ac;_8ac=_87c.indexOf(_887,_8ab.toLowerCase());if(_8ac!==-1){_8a4=_8ab;}_8ac=_87c.indexOf(_888,_8ab.toLowerCase());if(_8ac!==-1){_8a5=_8ab;}},this);}if(!_8a4||!_8a5){setTimeout(function(){console.error("File does not seem to contain fields with point coordinates.");},1);return;}var i=0,il=_89e.length;for(i;i<il;i++){if(_8a1.featureSet.features.length>=1000){setTimeout(function(){console.error("1000 feature limit reached. Unable to load any more data.");},1);break;}var item=_89e[i];var _8ad=_89c.getAttributes(item),_8ae={};_87c.forEach(_8ad,function(attr,_8af){if(attr){var _8b0=attr;if(attr.length===0){_87c.forEach(_8a1.layerDefinition.fields,function(_8b1,idx){if(_8b1.name==="attribute_"+(idx-1)){attr="attribute_"+(idx-1);}});}if(_87c.some(_8a7,function(a){return a===attr;})){var val=_89c.getValue(item,_8b0),date=new Date(val);_8ae[attr]=_890(date,val)?date.getTime():null;}else{if(_87c.some(_8a8,function(a){return a===attr;})){var _8b2=_87e.parse(_89c.getValue(item,_8b0));if((attr==_8a4||attr==_8a5)&&(isNaN(_8b2)||Math.abs(_8b2)>181)){_8b2=parseFloat(_89c.getValue(item,_8b0));if(isNaN(_8b2)){_8ae[attr]=null;}else{_8ae[attr]=_8b2;}}else{if(isNaN(_8b2)){_8ae[attr]=null;}else{_8ae[attr]=_8b2;}}}else{_8ae[attr]=_89c.getValue(item,_8b0);}}}});_8ae[_8a2]=_8a0;_8a0++;var _8b3=_8ae[_8a4];var _8b4=_8ae[_8a5];if(_8b4==null||_8b3==null||isNaN(_8b3)||isNaN(_8b4)){continue;}var _8b5=new _884(_8b4,_8b3,new _883({wkid:4326}));var _8b6={"geometry":_8b5.toJson(),"attributes":_8ae};_8a1.featureSet.features.push(_8b6);}_8a1.layerDefinition.name="csv";if(_898){_898(_8a1);}},onError:function(_8b7){console.error("Error fetching items from CSV store: ",_8b7);}});return true;};function _8b8(_8b9,_8ba,inSR,_8bb,_8bc,_8bd){if(_8b9.length===0){_8bc(null);}var _8be=_885.getGeometryType(_8ba);var _8bf=[];_87c.forEach(_8b9,function(_8c0){var _8c1=new _8be(_8c0);_8c1.spatialReference=inSR;_8bf.push(_8c1);},this);var _8c2=[102113,102100,3857];if(inSR.wkid&&inSR.wkid===4326&&_8bb.wkid&&_87c.indexOf(_8c2,_8bb.wkid)>-1){_87c.forEach(_8bf,function(_8c3){if(_8c3.xmin){_8c3.xmin=Math.max(_8c3.xmin,-180);_8c3.xmax=Math.min(_8c3.xmax,180);_8c3.ymin=Math.max(_8c3.ymin,-89.99);_8c3.ymax=Math.min(_8c3.ymax,89.99);}else{if(_8c3.rings){_87c.forEach(_8c3.rings,function(ring){_87c.forEach(ring,function(_8c4){_8c4[0]=Math.min(Math.max(_8c4[0],-180),180);_8c4[1]=Math.min(Math.max(_8c4[1],-89.99),89.99);},this);},this);}else{if(_8c3.paths){_87c.forEach(_8c3.paths,function(path){_87c.forEach(path,function(_8c5){_8c5[0]=Math.min(Math.max(_8c5[0],-180),180);_8c5[1]=Math.min(Math.max(_8c5[1],-89.99),89.99);},this);},this);}else{if(_8c3.x){_8c3.x=Math.min(Math.max(_8c3.x,-180),180);_8c3.y=Math.min(Math.max(_8c3.y,-89.99),89.99);}}}}},this);_8b9=[];_87c.forEach(_8bf,function(_8c6){var _8c7=_886.geographicToWebMercator(_8c6);if(_8bb.wkid!==102100){_8c7.spatialReference=_8bb;}_8b9.push(_8c7.toJson());},this);_8bc(_8b9);}else{if(inSR.wkid!==null&&_87c.indexOf(_8c2,inSR.wkid)>-1&&_8bb.wkid!==null&&_8bb.wkid===4326){_8b9=[];_87c.forEach(_8bf,function(_8c8){_8b9.push(_886.webMercatorToGeographic(_8c8).toJson());},this);_8bc(_8b9);}else{var _8c9=function(_8ca,args){if(_8ca&&_8ca.length===_8b9.length){_8b9=[];_87c.forEach(_8ca,function(_8cb){if(_8cb&&((_8cb.rings&&_8cb.rings.length>0&&_8cb.rings[0].length>0&&_8cb.rings[0][0].length>0&&!isNaN(_8cb.rings[0][0][0])&&!isNaN(_8cb.rings[0][0][1]))||(_8cb.paths&&_8cb.paths.length>0&&_8cb.paths[0].length>0&&_8cb.paths[0][0].length>0&&!isNaN(_8cb.paths[0][0][0])&&!isNaN(_8cb.paths[0][0][1]))||(_8cb.xmin&&!isNaN(_8cb.xmin)&&_8cb.ymin&&!isNaN(_8cb.ymin))||(_8cb.x&&!isNaN(_8cb.x)&&_8cb.y&&!isNaN(_8cb.y)))){_8b9.push(_8cb.toJson());}else{_8b9.push(null);}},this);_8bc(_8b9);}else{_8bd(_8ca,args);}};if(_881.defaults.geometryService){_881.defaults.geometryService.project(_8bf,_8bb,lang.hitch(this,_8c9),_8bd);}else{_8bc(null);}}}};function _8cc(sp1,sp2){var _8cd=[102113,102100,3857];if(sp1&&sp2&&sp1.wkid===sp2.wkid&&sp1.wkt===sp2.wkt){return true;}else{if(sp1&&sp2&&sp1.wkid&&sp2.wkid&&_87c.indexOf(_8cd,sp1.wkid)>-1&&_87c.indexOf(_8cd,sp2.wkid)>-1){return true;}}return false;};function _8ce(_8cf,_8d0,_8d1,_8d2){if(!_8cf.featureSet||_8cf.featureSet.length===0){return;}if(_8cc(_8d1,_8d0)){_8d2(_8cf);return;}var _8d3=function(_8d4){var _8d5=[];_87c.forEach(_8cf.featureSet.features,function(_8d6,i){if(_8d4[i]){_8d6.geometry=_8d4[i];_8d5.push(_8d6);}},this);_8d2(_8cf);};var _8d7=function(_8d8,args){console.error("error projecting featureSet ("+_8cf.layerDefinition.name+"). Final try.");_8d2(_8cf);};var _8d9=function(_8da,args){console.error("error projecting featureSet ("+_8cf.layerDefinition.name+"). Try one more time.");_8b8(_8db,_8cf.featureSet.geometryType,_8d0,_8d1,lang.hitch(this,_8d3),lang.hitch(this,_8d7));};if(_8cf.featureSet.features&&_8cf.featureSet.features.length>0){var _8db=[];_87c.forEach(_8cf.featureSet.features,function(_8dc){_8db.push(_8dc.geometry);});_8b8(_8db,_8cf.featureSet.geometryType,_8d0,_8d1,lang.hitch(this,_8d3),lang.hitch(this,_8d9));}else{_8d2(_8cf);}};function _8dd(_8de){var _8df=new _87d();var _8e0=function(_8e1){_8df.callback(_8e1);};var _8e2=_882({url:_8de.url,handleAs:"text",load:function(_8e3){_896(_8e3,_8de,lang.hitch(this,_8e0));},error:function(_8e4){console.error("error: "+_8e4);}},{usePost:false});return _8df;};function _8e5(_8e6,_8e7){var _8e8=new _87d();var _8e9=function(_8ea){_8e8.callback(_8ea);};_8ce(_8e6,new _883({wkid:4326}),_8e7,lang.hitch(this,_8e9));return _8e8;};function _8eb(_8ec){var _8ed=_8ec.layerDefinition.fields;var _8ee={"esriFieldTypeDouble":1,"esriFieldTypeSingle":1};var _8ef={"esriFieldTypeInteger":1,"esriFieldTypeSmallInteger":1};var dt={"esriFieldTypeDate":1};var _8f0=null;var _8f1=_87c.map(_8ed,lang.hitch(this,function(item){if(item.name.toUpperCase()==="NAME"){_8f0=item.name;}var _8f2=(item.type!=="esriFieldTypeOID"&&item.type!=="esriFieldTypeGlobalID"&&item.type!=="esriFieldTypeGeometry");var _8f3=null;if(_8f2){var f=item.name.toLowerCase();var _8f4=",stretched value,fnode_,tnode_,lpoly_,rpoly_,poly_,subclass,subclass_,rings_ok,rings_nok,";if(_8f4.indexOf(","+f+",")>-1||f.indexOf("area")>-1||f.indexOf("length")>-1||f.indexOf("shape")>-1||f.indexOf("perimeter")>-1||f.indexOf("objectid")>-1||f.indexOf("_")===f.length-1||(f.indexOf("_i")===f.length-2&&f.length>1)){_8f2=false;}if(item.type in _8ef){_8f3={places:0,digitSeparator:true};}else{if(item.type in _8ee){_8f3={places:2,digitSeparator:true};}else{if(item.type in dt){_8f3={dateFormat:"shortDateShortTime"};}}}}return lang.mixin({},{fieldName:item.name,label:item.alias,isEditable:true,tooltip:"",visible:_8f2,format:_8f3,stringFieldOption:"textbox"});}));var _8f5={title:_8f0?"{"+_8f0+"}":"",fieldInfos:_8f1,description:null,showAttachments:false,mediaInfos:[]};return _8f5;};var csv={latFieldStrings:_887,longFieldStrings:_888,buildCSVFeatureCollection:_8dd,projectFeatureCollection:_8e5,generateDefaultPopupInfo:_8eb,_getSeparator:_889,_isValidDate:_890,_processCsvData:_896,_projectGeometries:_8b8,_sameSpatialReference:_8cc,_projectFeatureSet:_8ce};if(has("extend-esri")){lang.setObject("arcgis.csv",csv,_880);}return csv;});},"dijit/Destroyable":function(){define("dijit/Destroyable",["dojo/_base/array","dojo/aspect","dojo/_base/declare"],function(_8f6,_8f7,_8f8){return _8f8("dijit.Destroyable",null,{destroy:function(_8f9){this._destroyed=true;},own:function(){_8f6.forEach(arguments,function(_8fa){var _8fb="destroyRecursive" in _8fa?"destroyRecursive":"destroy" in _8fa?"destroy":"remove";var odh=_8f7.before(this,"destroy",function(_8fc){_8fa[_8fb](_8fc);});var hdh=_8f7.after(_8fa,_8fb,function(){odh.remove();hdh.remove();},true);},this);return arguments;}});});},"esri/layers/FeatureEditResult":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","esri/kernel"],function(_8fd,lang,has,_8fe){var _8ff=_8fd(null,{declaredClass:"esri.layers.FeatureEditResult",constructor:function(json){if(json&&lang.isObject(json)){this.objectId=json.objectId;this.success=json.success;if(!json.success){var err=json.error;this.error=new Error();this.error.code=err.code;this.error.message=err.description;}}}});if(has("extend-esri")){lang.setObject("layers.FeatureEditResult",_8ff,_8fe);}return _8ff;});},"dojo/cache":function(){define(["./_base/kernel","./text"],function(dojo){return dojo.cache;});},"esri/tasks/query":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/_base/json","dojo/has","esri/kernel","esri/geometry/jsonUtils","esri/tasks/SpatialRelationship","dojo/has!extend-esri?esri/tasks/QueryTask","dojo/has!extend-esri?esri/tasks/RelationshipQuery","dojo/has!extend-esri?esri/tasks/StatisticDefinition"],function(_900,lang,_901,_902,has,_903,_904,_905){var _906=_900(null,{declaredClass:"esri.tasks.Query",constructor:function(){this.spatialRelationship=_906.SPATIAL_REL_INTERSECTS;},text:null,where:"",geometry:null,groupByFieldsForStatistics:null,objectIds:null,returnGeometry:false,orderByFields:null,outSpatialReference:null,outFields:null,outStatistics:null,timeExtent:null,relationParam:null,pixelSize:null,toJson:function(_907){var json={text:this.text,where:this.where,returnGeometry:this.returnGeometry,spatialRel:this.spatialRelationship,maxAllowableOffset:this.maxAllowableOffset,geometryPrecision:this.geometryPrecision},g=_907&&_907["geometry"]||this.geometry,ids=this.objectIds,_908=this.outFields,_909=this.outSpatialReference,_90a=this.groupByFieldsForStatistics,_90b=this.orderByFields,_90c=this.outStatistics;if(g){json.geometry=g;json.geometryType=_904.getJsonType(g);json.inSR=g.spatialReference.wkid||_902.toJson(g.spatialReference.toJson());}if(ids){json.objectIds=ids.join(",");}if(_908){json.outFields=_908.join(",");}if(_90a){json.groupByFieldsForStatistics=_90a.join(",");}if(_90b){json.orderByFields=_90b.join(",");}if(_90c){var _90d=[];_901.forEach(_90c,function(item,idx){_90d.push(item.toJson());});json.outStatistics=_902.toJson(_90d);}if(_909!==null){json.outSR=_909.wkid||_902.toJson(_909.toJson());}else{if(g){json.outSR=g.spatialReference.wkid||_902.toJson(g.spatialReference.toJson());}}var _90e=this.timeExtent;json.time=_90e?_90e.toJson().join(","):null;var _90f=this.relationParam;if(_90f&&this.spatialRelationship===_906.SPATIAL_REL_RELATION){json.relationParam=_90f;}json.pixelSize=this.pixelSize?_902.toJson(this.pixelSize.toJson()):null;json._ts=this._ts;return json;}});lang.mixin(_906,_905);if(has("extend-esri")){lang.setObject("tasks.Query",_906,_903);}return _906;});},"esri/tasks/FeatureSet":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/has","esri/kernel","esri/lang","esri/graphic","esri/SpatialReference","esri/graphicsUtils","esri/geometry/jsonUtils","esri/symbols/jsonUtils"],function(_910,lang,_911,has,_912,_913,_914,_915,_916,_917,_918){var _919=_910(null,{declaredClass:"esri.tasks.FeatureSet",constructor:function(json){if(json){lang.mixin(this,json);var _91a=this.features,sr=json.spatialReference,_91b=_917.getGeometryType(json.geometryType);sr=(this.spatialReference=new _915(sr));this.geometryType=json.geometryType;if(json.fields){this.fields=json.fields;}_911.forEach(_91a,function(_91c,i){var _91d=_91c.geometry&&_91c.geometry.spatialReference;_91a[i]=new _914((_91b&&_91c.geometry)?new _91b(_91c.geometry):null,_91c.symbol&&_918.fromJson(_91c.symbol),_91c.attributes);if(_91a[i].geometry&&!_91d){_91a[i].geometry.setSpatialReference(sr);}});}else{this.features=[];}},displayFieldName:null,geometryType:null,spatialReference:null,fieldAliases:null,toJson:function(_91e){var json={};if(this.displayFieldName){json.displayFieldName=this.displayFieldName;}if(this.fields){json.fields=this.fields;}if(this.spatialReference){json.spatialReference=this.spatialReference.toJson();}else{if(this.features[0]&&this.features[0].geometry){json.spatialReference=this.features[0].geometry.spatialReference.toJson();}}if(this.features[0]){if(this.features[0].geometry){json.geometryType=_917.getJsonType(this.features[0].geometry);}json.features=_916._encodeGraphics(this.features,_91e);}json.exceededTransferLimit=this.exceededTransferLimit;return _913.fixJson(json);}});if(has("extend-esri")){lang.setObject("tasks.FeatureSet",_919,_912);}return _919;});},"esri/layers/FeatureTemplate":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","esri/kernel","esri/lang","esri/graphic"],function(_91f,lang,has,_920,_921,_922){var _923=_91f(null,{declaredClass:"esri.layers.FeatureTemplate",constructor:function(json){if(json&&lang.isObject(json)){this.name=json.name;this.description=json.description;this.drawingTool=json.drawingTool;var _924=json.prototype;this.prototype=new _922(_924.geometry,null,_924.attributes);}},toJson:function(){return _921.fixJson({name:this.name,description:this.description,drawingTool:this.drawingTool,prototype:this.prototype&&this.prototype.toJson()});}});lang.mixin(_923,{TOOL_AUTO_COMPLETE_POLYGON:"esriFeatureEditToolAutoCompletePolygon",TOOL_CIRCLE:"esriFeatureEditToolCircle",TOOL_ELLIPSE:"esriFeatureEditToolEllipse",TOOL_FREEHAND:"esriFeatureEditToolFreehand",TOOL_LINE:"esriFeatureEditToolLine",TOOL_NONE:"esriFeatureEditToolNone",TOOL_POINT:"esriFeatureEditToolPoint",TOOL_POLYGON:"esriFeatureEditToolPolygon",TOOL_RECTANGLE:"esriFeatureEditToolRectangle",TOOL_ARROW:"esriFeatureEditToolArrow",TOOL_TRIANGLE:"esriFeatureEditToolTriangle",TOOL_LEFT_ARROW:"esriFeatureEditToolLeftArrow",TOOL_RIGHT_ARROW:"esriFeatureEditToolRightArrow",TOOL_UP_ARROW:"esriFeatureEditToolUpArrow",TOOL_DOWN_ARROW:"esriFeatureEditToolDownArrow"});if(has("extend-esri")){lang.setObject("layers.FeatureTemplate",_923,_920);}return _923;});},"esri/layers/ImageServiceParameters":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/has","esri/kernel","esri/lang"],function(_925,lang,_926,has,_927,_928){var _929=_925(null,{declaredClass:"esri.layers.ImageServiceParameters",extent:null,width:null,height:null,imageSpatialReference:null,format:null,interpolation:null,compressionQuality:null,bandIds:null,timeExtent:null,mosaicRule:null,renderingRule:null,noData:null,toJson:function(_92a){var ext=this.bbox||this.extent;ext=ext&&_92a&&ext._normalize(true);var wkid=ext?(ext.spatialReference.wkid||_926.toJson(ext.spatialReference.toJson())):null,_92b=this.imageSpatialReference,json={bbox:ext?(ext.xmin+","+ext.ymin+","+ext.xmax+","+ext.ymax):null,bboxSR:wkid,size:(this.width!==null&&this.height!==null?this.width+","+this.height:null),imageSR:(_92b?(_92b.wkid||_926.toJson(_92b.toJson())):wkid),format:this.format,interpolation:this.interpolation,compressionQuality:this.compressionQuality,bandIds:this.bandIds?this.bandIds.join(","):null,mosaicRule:this.mosaicRule?_926.toJson(this.mosaicRule.toJson()):null,renderingRule:this.renderingRule?_926.toJson(this.renderingRule.toJson()):null,noData:this.noData,noDataInterpretation:this.noDataInterpretation};var _92c=this.timeExtent;json.time=_92c?_92c.toJson().join(","):null;return _928.filter(json,function(_92d){if(_92d!==null&&_92d!==undefined){return true;}});}});lang.mixin(_929,{INTERPOLATION_BILINEAR:"RSP_BilinearInterpolation",INTERPOLATION_CUBICCONVOLUTION:"RSP_CubicConvolution",INTERPOLATION_MAJORITY:"RSP_Majority",INTERPOLATION_NEARESTNEIGHBOR:"RSP_NearestNeighbor",NODATA_MATCH_ALL:"esriNoDataMatchAll",NODATA_MATCH_ANY:"esriNoDataMatchAny"});if(has("extend-esri")){lang.setObject("layers.ImageServiceParameters",_929,_927);}return _929;});},"dojo/data/util/filter":function(){define(["../../_base/lang"],function(lang){var _92e={};lang.setObject("dojo.data.util.filter",_92e);_92e.patternToRegExp=function(_92f,_930){var rxp="^";var c=null;for(var i=0;i<_92f.length;i++){c=_92f.charAt(i);switch(c){case "\\":rxp+=c;i++;rxp+=_92f.charAt(i);break;case "*":rxp+=".*";break;case "?":rxp+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":rxp+="\\";default:rxp+=c;}}rxp+="$";if(_930){return new RegExp(rxp,"mi");}else{return new RegExp(rxp,"m");}};return _92e;});},"esri/dijit/PopupTemplate":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","dojo/dom-construct","esri/kernel","esri/InfoTemplate","esri/PopupInfo","esri/dijit/PopupRenderer"],function(_931,lang,has,_932,_933,_934,_935,_936){var PT=_931([_934,_935],{declaredClass:"esri.dijit.PopupTemplate","-chains-":{constructor:"manual"},chartTheme:null,constructor:function(json,_937){lang.mixin(this,_937);this.initialize(json,_937);},getTitle:function(_938){return this.info?this.getComponents(_938).title:"";},getContent:function(_939){return this.info?new _936({template:this,graphic:_939,chartTheme:this.chartTheme},_932.create("div")).domNode:"";}});if(has("extend-esri")){lang.setObject("dijit.PopupTemplate",PT,_933);}return PT;});},"*noref":1}});define("esri/arcgis/utils",["dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/_base/Deferred","dojo/_base/json","dojo/_base/url","dojo/has","dojo/DeferredList","dojo/dom-construct","esri/kernel","esri/config","esri/lang","esri/request","esri/SpatialReference","esri/map","esri/urlUtils","esri/geometry/ScreenPoint","esri/geometry/Extent","esri/geometry/webMercatorUtils","esri/symbols/jsonUtils","esri/renderers/jsonUtils","esri/dijit/PopupTemplate","esri/dijit/Popup","esri/tasks/query","esri/tasks/GeometryService","esri/arcgis/csv","esri/layers/ArcGISTiledMapServiceLayer","esri/layers/ArcGISDynamicMapServiceLayer","esri/layers/ArcGISImageServiceLayer","esri/layers/OpenStreetMapLayer","esri/layers/WebTiledLayer","esri/layers/FeatureLayer","esri/layers/WMSLayer","esri/layers/KMLLayer","esri/layers/GeoRSSLayer","esri/virtualearth/VETiledLayer","esri/layers/TileInfo","esri/layers/DynamicLayerInfo","esri/layers/LayerDrawingOptions","esri/layers/ImageParameters","esri/layers/ImageServiceParameters","esri/layers/RasterFunction","esri/layers/MosaicRule","esri/layers/WMSLayerInfo","dojo/i18n!esri/nls/jsapi"],function(lang,_93a,_93b,_93c,_93d,Url,has,_93e,_93f,_940,_941,_942,_943,_944,Map,_945,_946,_947,_948,_949,_94a,_94b,_94c,_94d,_94e,csv,_94f,_950,_951,_952,_953,_954,_955,_956,_957,_958,_959,_95a,_95b,_95c,_95d,_95e,_95f,_960,_961){String.prototype.endsWith=function(str){return (this.match(str+"$")==str);};var _962;function _963(_964){var url=_962.arcgisUrl+"/"+_964.itemId+"/data";var _965=_943({url:url,content:{f:"json"},callbackParamName:"callback"},{disableIdentityLookup:true,_preLookup:true});return _965;};function _966(_967){var _968={f:"json"};if(_940.id){var _969=_940.id.findCredential(_945.urlToObject(_962.arcgisUrl).path);if(_969){_968.token=_969.token;}}var _96a=_943({url:_967,content:_968,callbackParamName:"callback"},{"disableIdentityLookup":true});return _96a;};function _96b(_96c){if(_96c.itemProperties.layerDefinition){if(_96c.layerDefinition){if(!_96c.layerDefinition.drawingInfo){_96c.layerDefinition.drawingInfo=_96c.itemProperties.layerDefinition.drawingInfo;}if(!_942.isDefined(_96c.layerDefinition.definitionExpression)){_96c.layerDefinition.definitionExpression=_96c.itemProperties.layerDefinition.definitionExpression;}if(!_942.isDefined(_96c.layerDefinition.minScale)){_96c.layerDefinition.minScale=_96c.itemProperties.layerDefinition.minScale;}if(!_942.isDefined(_96c.layerDefinition.maxScale)){_96c.layerDefinition.maxScale=_96c.itemProperties.layerDefinition.maxScale;}}else{_96c.layerDefinition=_96c.itemProperties.layerDefinition;}}if(_96c.itemProperties.popupInfo&&!_96c.popupInfo&&!_96c.disablePopup){_96c.popupInfo=_96c.itemProperties.popupInfo;}};function _96d(_96e,_96f){var _970=new _93c();var _971=_96e.itemData;var _972=[];var _973=[];_93a.forEach(_971.operationalLayers,function(_974){if(_974.itemId&&!_974.type){var _975=_974.url.toLowerCase();if(_975.indexOf("/featureserver")>-1){_973.push(_974);_972.push(_963(_974));}else{if(_975.indexOf("/mapserver")>-1&&_975.indexOf("/mapserver/")===-1&&(!_974.layers||(!_942.isDefined(_974.minScale)&&!_942.isDefined(_974.maxScale)))){_973.push(_974);_972.push(_963(_974));}else{if(_975.indexOf("/imageserver")>-1&&!_942.isDefined(_974.minScale)&&!_942.isDefined(_974.maxScale)){_973.push(_974);_972.push(_963(_974));}}}}});if(_971.baseMap&&_971.baseMap.baseMapLayers){_93a.forEach(_971.baseMap.baseMapLayers,function(_976){if((_976.type==="BingMapsAerial"||_976.type==="BingMapsRoad"||_976.type==="BingMapsHybrid")&&_976.portalUrl){_973.push(_976);_972.push(_966(_976.portalUrl));}});}if(_972.length>0){var _977=new _93e(_972);_977.addCallback(function(_978){_93a.forEach(_973,function(_979,i){if((_979.type==="BingMapsAerial"||_979.type==="BingMapsRoad"||_979.type==="BingMapsHybrid")&&_979.portalUrl){if(_978[i][1].bingKey){_96f.bingMapsKey=_978[i][1].bingKey;}else{_979.errors=_979.errors||[];var _97a={message:"The owner of the map has not provided a Bing Key for the Bing Map it includes. [type:"+_979.type+"]"};_979.errors.push(_97a);}return;}var _97b=_978[i][1];if(_97b){var _97c=_979.url.toLowerCase();if(_97c.indexOf("/featureserver")>-1&&_97b.layers){_93a.forEach(_97b.layers,function(_97d){if(_97c.endsWith("/featureserver/"+_97d.id)){_979.itemProperties=_97d;_96b(_979);}});}else{if(_97c.indexOf("/mapserver")>-1){if(_97b.layers&&!_979.layers){_979.layers=_97b.layers;}if(_942.isDefined(_97b.minScale)&&!_942.isDefined(_979.minScale)){_979.minScale=_97b.minScale;}if(_942.isDefined(_97b.maxScale)&&!_942.isDefined(_979.maxScale)){_979.maxScale=_97b.maxScale;}}else{if(_97c.indexOf("/imageserver")>-1){if(_942.isDefined(_97b.minScale)&&!_942.isDefined(_979.minScale)){_979.minScale=_97b.minScale;}if(_942.isDefined(_97b.maxScale)&&!_942.isDefined(_979.maxScale)){_979.maxScale=_97b.maxScale;}}}}}});_970.callback(_96e);});}else{_970.callback(_96e);}return _970;};function _97e(_97f,_980){var _981=_97f.dynamicLayerInfos||_97f.layerInfos;var _982=_980.layers;if(_982&&_981){var _983=[],ids=[],urls=[];_93a.forEach(_981,function(_984){var id=_984.id,i;if(!_984.subLayerIds&&_93a.indexOf(_97f.visibleLayers,id)!==-1){for(i=0;i<_982.length;i++){var _985=_982[i];if(_985.id===id){ids.push(id);_983.push(_985.popupInfo);urls.push(_985.layerUrl||"");break;}}}});if(_983.length){_97f.__popups=_983;_97f.__popupIds=ids;_97f.__popupUrls=urls;_97f.__resourceInfo=_980.resourceInfo;}}};function _986(url){if(!url){return false;}var _987=".arcgis.com/";var _988=(new Url(_962.arcgisUrl)).authority;return (url.indexOf(_987)!==-1||url.indexOf(_988)!==-1);};function _989(url){if(!url){return false;}return (url.indexOf("/services.arcgisonline.com/")!==-1||url.indexOf("/server.arcgisonline.com/")!==-1);};function _98a(url){if(location.protocol==="https:"&&(_986(url)||_989(url))){url=url.replace("http:","https:");}return url;};function _98b(_98c){var _98d=[];if(!_98c.displayLevels){_98d=_93a.map(_98c.resourceInfo.tileInfo.lods,function(lod){return lod.level;});}var _98e=new _94f(_98a(_98c.url),{resourceInfo:_98c.resourceInfo,opacity:_98c.opacity,visible:_98c.visibility,displayLevels:_98c.displayLevels||_98d,id:_98c.id,minScale:_98c.minScale,maxScale:_98c.maxScale});_97e(_98e,_98c);return _98e;};function _98f(_990,_991){if(!_990||!_991||_991.length===0){return [];}var _992=","+_991+",";var _993=[];var _994="";var k,_995=",";for(k=0;k<_990.length;k++){if(_990[k].subLayerIds!==null){if(_992.indexOf(","+_990[k].id+",")===-1||_995.indexOf(","+_990[k].id+",")>-1){_995+=_990[k].subLayerIds.toString()+",";}}else{if(_992.indexOf(","+_990[k].id+",")>-1&&_995.indexOf(","+_990[k].id+",")===-1){_993.push(_990[k].id);_994=",";}}}return _993;};function _996(_997){var _998=new _95c();_998.format="png24";if(_997.resourceInfo&&_997.resourceInfo.supportedImageFormatTypes&&_997.resourceInfo.supportedImageFormatTypes.indexOf("PNG32")>-1){_998.format="png32";}var _999=new _950(_98a(_997.url),{resourceInfo:_997.resourceInfo,opacity:_997.opacity,visible:_997.visibility,id:_997.id,imageParameters:_998,minScale:_997.minScale,maxScale:_997.maxScale});var _99a=_997.visibleLayers;if(!_997.visibleLayers){var _99b="";var _99c=_999.layerInfos;_93a.forEach(_99c,function(_99d){if(_99d.defaultVisibility){_99b+=(_99b.length>0?",":"")+_99d.id;}});_99a=_99b;}_99a=_98f(_999.layerInfos,_99a);_999.setVisibleLayers(_99a);if(_997.layers&&_997.layers.length>0){var _99e=[],_99f=[],_9a0,_9a1=[],_9a2;_93a.forEach(_997.layers,function(_9a3){if(_9a3.layerDefinition&&_9a3.layerDefinition.definitionExpression){_99e[_9a3.id]=_9a3.layerDefinition.definitionExpression;}if(_9a3.layerDefinition&&_9a3.layerDefinition.source){_9a0=new _95a(lang.mixin(_9a3,_9a3.layerDefinition));delete _9a0.layerDefinition;_9a0.id=_9a3.id;if(_997.visibleLayers){if(_93a.indexOf(_997.visibleLayers,_9a3.id)>-1){_9a0.defaultVisibility=true;}else{_9a0.defaultVisibility=false;}}_99f.push(_9a0);}if(_9a3.layerDefinition&&_9a3.layerDefinition.source&&_9a3.layerDefinition.drawingInfo){_9a2=new _95b(_9a3.layerDefinition.drawingInfo);_9a1[_9a3.id]=_9a2;}},this);if(_99e.length>0){_999.setLayerDefinitions(_99e);}if(_99f.length>0){_999.setDynamicLayerInfos(_99f,true);if(_9a1.length>0){_999.setLayerDrawingOptions(_9a1,true);}}}_97e(_999,_997);return _999;};function _9a4(_9a5,_9a6){var _9a7=[102113,102100,3857];var sp1=new _944(_9a6[0].layerObject.fullExtent.spatialReference);var sp2=new _944(_9a5.resourceInfo.fullExtent.spatialReference);if(sp1.wkt==sp2.wkt&&(sp1.wkid==sp2.wkid||(esri.isDefined(sp1.latestWkid)&&sp1.latestWkid==sp2.wkid)||(esri.isDefined(sp2.latestWkid)&&sp1.wkid==sp2.latestWkid)||(esri.isDefined(sp1.latestWkid)&&sp1.latestWkid==sp2.latestWkid))){return true;}else{if(sp1.wkid&&sp2.wkid&&_93a.some(_9a7,function(wkid){return wkid===sp2.wkid;})&&_93a.some(_9a7,function(wkid){return wkid===sp1.wkid;})){return true;}}return false;};function _9a8(_9a9,_9aa){if(!_9aa[0].layerObject.tileInfo){return false;}var _9ab=[];_93a.forEach(_9aa,function(_9ac){if(_9ac.baseMapLayer){if(_9ac.layerObject.tileInfo){_9ab=_9ab.concat(_93a.map(_9ac.layerObject.tileInfo.lods,function(lod){return lod.scale;}));}}});var _9ad=_93a.some(_9a9.resourceInfo.tileInfo.lods,function(lod){return _93a.some(_9ab,function(_9ae){return _9ae===lod.scale;});});return _9ad;};function _9af(_9b0,_9b1,_9b2,_9b3){var _9b4,_9b5=_9b2._clazz;if(_9b0.type==="OpenStreetMap"){_9b4=new _952({id:_9b0.id,opacity:_9b0.opacity,visible:(_9b0.visibility!==null&&_9b0.visibility!==undefined)?_9b0.visibility:true});}else{if(_9b0.type==="WMS"){var _9b6=[];var _9b7=[];_93a.forEach(_9b0.layers,function(_9b8){_9b7.push(new _960({name:_9b8.name,title:_9b8.title,legendURL:_9b8.legendURL}));_9b6.push(_9b8.name);},this);if(_9b0.visibleLayers){_9b6=_9b0.visibleLayers;}var _9b9=new _947(_9b0.extent[0][0],_9b0.extent[0][1],_9b0.extent[1][0],_9b0.extent[1][1],new _944({wkid:4326}));var _9ba={extent:_9b9,layerInfos:_9b7,version:_9b0.version,maxWidth:_9b0.maxWidth,maxHeight:_9b0.maxHeight,getMapUrl:_9b0.mapUrl,spatialReferences:_9b0.spatialReferences,title:_9b0.title,copyright:_9b0.copyright};_9b4=new _955(_9b0.url,{id:_9b0.id,visibleLayers:_9b6,format:"png",transparent:_9b0.baseMapLayer?false:true,opacity:_9b0.opacity,visible:(_9b0.visibility!==null)?_9b0.visibility:true,resourceInfo:_9ba});_9b4.spatialReference.wkid=_9ba.spatialReferences[0];}else{if(_9b0.type==="KML"){_9b4=new _956(_9b0.url,{id:_9b0.id,visible:(_9b0.visibility!==null)?_9b0.visibility:true,outSR:_9b3});_93b.connect(_9b4,"onLoad",function(){var _9bb=function(_9bc){_93a.forEach(_9bc,function(_9bd){if(_9bd.declaredClass==="esri.layers.FeatureLayer"||_9bd.declaredClass==="esri.layers.MapImageLayer"){_9bd.setOpacity(_9b0.opacity);}else{if(_9bd.declaredClass==="esri.layers.KMLLayer"){if(_9bd.loaded){_9bb(_9bd.getLayers());}else{_93b.connect(_9bd,"onLoad",lang.hitch(this,function(lyr){_9bb(lyr.getLayers());}));}}}});};if(_9b0.opacity||_9b0.opacity===0){_9bb(_9b4.getLayers());}if(_9b0.visibleFolders){_93a.forEach(_9b4.folders,function(_9be){if(_93a.indexOf(_9b0.visibleFolders,_9be.id)>-1){_9b4.setFolderVisibility(_9be,true);}else{_9b4.setFolderVisibility(_9be,false);}},this);}});}else{if(_9b0.type==="WebTiledLayer"){_9b4=new _953(_9b0.templateUrl,{id:_9b0.id,visible:(_9b0.visibility!==null)?_9b0.visibility:true,opacity:_9b0.opacity,copyright:_9b0.copyright,fullExtent:_9b0.fullExtent&&new _947(_9b0.fullExtent),initialExtent:_9b0.fullExtent&&new _947(_9b0.fullExtent),subDomains:_9b0.subDomains,tileInfo:_9b0.tileInfo?new _959(_9b0.tileInfo):null});_93b.connect(_9b4,"onLoad",function(){if(_942.isDefined(_9b0.minScale)||_942.isDefined(_9b0.maxScale)){_9b4.setScaleRange(_9b0.minScale,_9b0.maxScale);}});}else{if(_9b0.type==="GeoRSS"){_9b4=new _957(_9b0.url,{id:_9b0.id,visible:(_9b0.visibility!==null)?_9b0.visibility:true,opacity:_9b0.opacity,outSpatialReference:_9b3});_93b.connect(_9b4,"onLoad",function(){var _9bf=_9b4.getFeatureLayers();_93a.forEach(_9bf,function(_9c0){if(_9b0.pointSymbol&&_9c0.geometryType==="esriGeometryPoint"){_9c0.renderer.symbol=_949.fromJson(_9b0.pointSymbol);}else{if(_9b0.lineSymbol&&_9c0.geometryType==="esriGeometryPolyline"){_9c0.renderer.symbol=_949.fromJson(_9b0.lineSymbol);}else{if(_9b0.polygonSymbol&&_9c0.geometryType==="esriGeometryPolygon"){_9c0.renderer.symbol=_949.fromJson(_9b0.polygonSymbol);}}}if(_942.isDefined(_9b0.minScale)||_942.isDefined(_9b0.maxScale)){_9c0.setScaleRange(_9b0.minScale,_9b0.maxScale);}});});}else{if(_9b0.type=="CSV"&&_9b0.url){_9b4=new _954(_9b0.featureCollection,{infoTemplate:new _94b(_9b0.popupInfo?_9b0.popupInfo:csv.generateDefaultPopupInfo(_9b0.featureCollection)),id:_9b0.id?_9b0.id:null,outFields:["*"],visible:(_9b0.visibility!==null)?_9b0.visibility:true,opacity:_9b0.opacity,autoGeneralize:true});}else{if(_9b0.layerDefinition&&!_9b0.url){var _9c1=_93d.fromJson(_93d.toJson(_9b0));delete _9c1.id;delete _9c1.opacity;delete _9c1.visibility;_9b4=new _954(_9c1,{id:_9b0.id,opacity:_9b0.opacity,visible:_9b0.visibility,outFields:["*"],infoTemplate:_9c1.popupInfo&&new _9b5(_9c1.popupInfo),autoGeneralize:true});}else{if(_9b0.type==="BingMapsAerial"||_9b0.type==="BingMapsRoad"||_9b0.type==="BingMapsHybrid"){if(_9b2.bingMapsKey){var _9c2=_958.MAP_STYLE_AERIAL_WITH_LABELS;if(_9b0.type==="BingMapsAerial"){_9c2=_958.MAP_STYLE_AERIAL;}else{if(_9b0.type==="BingMapsRoad"){_9c2=_958.MAP_STYLE_ROAD;}}_9b4=new _958({bingMapsKey:_9b2.bingMapsKey,mapStyle:_9c2,opacity:_9b0.opacity,id:_9b0.id});}}else{if(_9b0.resourceInfo&&_9b0.resourceInfo.mapName){if(_9b0.resourceInfo.singleFusedMapCache===true){if(!_9b0.baseMapLayer){if(_9a4(_9b0,_9b1)){if(_9a8(_9b0,_9b1)){_9b4=_98b(_9b0);}else{_9b4=_996(_9b0);}}else{_9b4=_996(_9b0);}}else{_9b4=_98b(_9b0);}}else{_9b4=_996(_9b0);}}else{if(_9b0.resourceInfo&&_9b0.resourceInfo.pixelSizeX){var _9c3=new _95d();_9c3.bandIds=_9b0.bandIds;if(_9b0.format!=null){_9c3.format=_9b0.format;if(_9b0.compressionQuality!=null){_9c3.compressionQuality=_9b0.compressionQuality;}}if(_9b0.renderingRule&&_9b0.renderingRule.rasterFunction){var _9c4=new _95e(_9b0.renderingRule);_9c3.renderingRule=_9c4;}if(_9b0.mosaicRule){var _9c5=new _95f(_9b0.mosaicRule);_9c3.mosaicRule=_9c5;}if(_942.isDefined(_9b0.noData)){_9c3.noData=_9b0.noData;}if(_942.isDefined(_9b0.noDataInterpretation)){_9c3.noDataInterpretation=_9b0.noDataInterpretation;}if(_942.isDefined(_9b0.interpolation)){_9c3.interpolation=_9b0.interpolation;}_9b4=new _951(_98a(_9b0.url),{resourceInfo:_9b0.resourceInfo,opacity:_9b0.opacity,visible:_9b0.visibility,id:_9b0.id,imageServiceParameters:_9c3,infoTemplate:_9b0.popupInfo&&new _9b5(_9b0.popupInfo),minScale:_9b0.minScale,maxScale:_9b0.maxScale});if(_9b0.layerDefinition&&_9b0.layerDefinition.definitionExpression){_9b4.setDefinitionExpression(_9b0.layerDefinition.definitionExpression,true);}}else{if(_9b0.resourceInfo&&_9b0.resourceInfo.type==="Feature Layer"){_9b4=new _954(_98a(_9b0.url),{resourceInfo:_9b0.resourceInfo,opacity:_9b0.opacity,visible:_9b0.visibility,id:_9b0.id,mode:_942.isDefined(_9b0.mode)?_9b0.mode:_954.MODE_ONDEMAND,outFields:["*"],infoTemplate:_9b0.popupInfo&&new _9b5(_9b0.popupInfo),autoGeneralize:true});if(_9b0.layerDefinition){if(_9b0.layerDefinition.drawingInfo&&_9b0.layerDefinition.drawingInfo.renderer){var _9c6=_94a.fromJson(_9b0.layerDefinition.drawingInfo.renderer);_9c6.isMaxInclusive=true;_9b4.setRenderer(_9c6);}if(_9b0.layerDefinition.definitionExpression){_9b4.setDefinitionExpression(_9b0.layerDefinition.definitionExpression);}if(_942.isDefined(_9b0.layerDefinition.minScale)){_9b4.setMinScale(_9b0.layerDefinition.minScale);}if(_942.isDefined(_9b0.layerDefinition.maxScale)){_9b4.setMaxScale(_9b0.layerDefinition.maxScale);}}}}}}}}}}}}}if(_9b4){_9b4.arcgisProps={title:_9b0.title};if(_9b0.baseMapLayer){if(_9b0.isReference){_9b4._basemapGalleryLayerType="reference";}else{_9b4._basemapGalleryLayerType="basemap";}}}return _9b4;};function _9c7(_9c8,_9c9,_9ca){_93a.forEach(_9c8,function(_9cb,_9cc){if(_9cb.url&&!_9cb.type){if(_9cc===0||_9c8[0].layerObject){_9cb.layerObject=_9af(_9cb,_9c8,_9c9,_9ca);}}else{if(_9cb.url&&_9cb.type=="CSV"){_9cb.layerObject=_9af(_9cb,_9c8,_9c9,_9ca);}else{_9cb.layerObject=_9af(_9cb,_9c8,_9c9,_9ca);}}});var _9cd=_93a.filter(_9c8,function(lyr){return !lyr.isReference;});var _9ce=_93a.filter(_9c8,function(lyr){return !!lyr.isReference;});_9c8=_9cd.concat(_9ce);return _9c8;};function _9cf(_9d0){var _9d1=null;var _9d2=_9d0[0];if(_9d2.url&&!_9d2.type){if(_9d2.resourceInfo.spatialReference){_9d1=new _944();if(_9d2.resourceInfo.spatialReference.wkid){_9d1.wkid=_9d2.resourceInfo.spatialReference.wkid;}if(_9d2.resourceInfo.spatialReference.wkt){_9d1.wkt=_9d2.resourceInfo.spatialReference.wkt;}}}else{if(_9d2.type.indexOf("BingMaps")>-1||_9d2.type=="OpenStreetMap"){_9d1=new _944({wkid:102100});}else{if(_9d2.type=="WMS"){_9d1=new _944({wkid:_9d2.spatialReferences[0]});}}}return _9d1;};function _9d3(_9d4,_9d5,_9d6,_9d7,_9d8){_93a.forEach(_9d5,function(_9d9,_9da){if(_9d9.url&&!_9d9.type){_9d9.resourceInfo=_9d4[_9d9.deferredsPos][1];delete _9d9.deferredsPos;}else{if(_9d9.url&&_9d9.type=="CSV"){_9d9.featureCollection=_9d7[_9d9.deferredsPos].results[0];delete _9d9.deferredsPos;}}});var _9db=_9cf(_9d5);var _9dc=[];var _9dd=new _93c();_93a.forEach(_9d5,function(_9de){if(_9de.url&&_9de.type=="CSV"){_9de.deferredsPos=_9dc.length;_9dc.push(csv.projectFeatureCollection(_9de.featureCollection,_9db));}});if(_9dc.length==0){_9d5=_9c7(_9d5,_9d6,_9db);_9d8.callback(_9d5);}else{var _9df=new _93e(_9dc);_9df.addCallback(function(){_93a.forEach(_9d5,function(_9e0){if(_9e0.url&&_9e0.type=="CSV"){_9e0.featureCollection=_9dc[_9e0.deferredsPos].results[0];delete _9e0.deferredsPos;}});_9d5=_9c7(_9d5,_9d6,_9db);_9d8.callback(_9d5);});}};function _9e1(url,_9e2){var url2=_98a(url);return _943({url:url2,content:{f:"json"},callbackParamName:"callback",error:function(_9e3,io){if(_9e3.message){_9e3.message+=" [url:"+url2+"]";}else{_9e3.message="[url:"+url2+"]";}_9e2.push(_9e3);_941.defaults.io.errorHandler(_9e3,io);}});};function _9e4(_9e5,_9e6){var _9e7=[];var _9e8=[];var _9e9=[];var _9ea=new _93c();_93a.forEach(_9e5.operationalLayers,function(_9eb,_9ec){if(_9eb.featureCollection){_93a.forEach(_9eb.featureCollection.layers,function(_9ed,idx){var _9ee=true;if(_9eb.visibleLayers){if(_93a.indexOf(_9eb.visibleLayers,idx)==-1){_9ee=false;}}_9ed.visibility=(_9eb.visibility&&_9ee);_9ed.opacity=_9eb.opacity;_9ed.id=(_9eb.id||("operational"+_9ec))+"_"+idx;_9e9.push(_9ed);},this);}else{_9e9.push(_9eb);}});_93a.forEach(_9e5.baseMap.baseMapLayers,function(_9ef,_9f0){_9ef.baseMapLayer=true;_9ef.id=_9ef.id||("base"+_9f0);_9e7.push(_9ef);});_93a.forEach(_9e9,function(_9f1,_9f2){_9f1.id=_9f1.id||("operational"+_9f2);_9e7.push(_9f1);});_93a.forEach(_9e7,function(_9f3){if(_9f3.url&&!_9f3.type){_9f3.deferredsPos=_9e8.length;_9f3.errors=[];_9e8.push(_9e1(_9f3.url,_9f3.errors));}else{if(_9f3.url&&_9f3.type=="CSV"){_9f3.deferredsPos=_9e8.length;_9e8.push(csv.buildCSVFeatureCollection(_9f3));}}});if(_9e8.length==0){var _9f4=_9cf(_9e7);_9e7=_9c7(_9e7,_9e6,_9f4);_9ea.callback(_9e7);}else{var _9f5=new _93e(_9e8);_9f5.addCallback(function(_9f6){_9d3(_9f6,_9e7,_9e6,_9e8,_9ea);});}return _9ea;};function _9f7(_9f8,_9f9){if(_9f9.version<=10.1&&_9f8){var i,id=parseInt(_9f9.url.substring(_9f9.url.lastIndexOf("/")+1,_9f9.url.length));for(i=_9f8.length-1;i>=0;i--){if(_9f8[i].id==id){if(_9f9.minScale==0&&_9f8[i].minScale>0){_9f9.minScale=_9f8[i].minScale;}else{if(_9f9.minScale>0&&_9f8[i].minScale==0){_9f9.minScale=_9f9.minScale;}else{if(_9f9.minScale>0&&_9f8[i].minScale>0){_9f9.minScale=Math.min(_9f9.minScale,_9f8[i].minScale);}}}_9f9.maxScale=Math.max(_9f9.maxScale||0,_9f8[i].maxScale||0);if(_9f8[i].parentLayerId>-1){id=_9f8[i].parentLayerId;}else{break;}}}}};function _9fa(_9fb,_9fc,_9fd,map){var url=_9fb.url;var _9fe=_9fb.__popups;var ids=_9fb.__popupIds;var urls=_9fb.__popupUrls;var _9ff=_9fb.__resourceInfo;var _a00=[];_93a.forEach(_9fe,function(_a01,_a02){if(!_a01){return;}var _a03,_a04=[];_93a.forEach(_a01.fieldInfos,function(item){if(item.fieldName.toLowerCase()!=="shape"){_a04.push(item.fieldName);}});if(_9fb.dynamicLayerInfos&&_9fb.dynamicLayerInfos.length>0){var _a05=_93a.filter(_9fb.dynamicLayerInfos,function(item){return ids[_a02]==item.id;})[0].source;_a03=new _954(url+"/dynamicLayer",{id:_9fb.id+"_"+ids[_a02],source:_a05,outFields:_a04,mode:_954.MODE_SELECTION,infoTemplate:_a01&&new _9fd(_a01),drawMode:false,visible:_9fb.visible,autoGeneralize:true});}else{var i,_a06=null;if(_9fc){for(i=0;i<_9fc.length;i++){if(_9fc[i].id===ids[_a02]){_a06=_9fc[i];break;}}}var _a07=url+"/"+ids[_a02];if(urls[_a02].length){_a07=urls[_a02];}_a03=new _954(_98a(_a07),{id:_9fb.id+"_"+ids[_a02],outFields:_a04,mode:_954.MODE_SELECTION,infoTemplate:_a01&&new _9fd(_a01),drawMode:false,visible:_9fb.visible,resourceInfo:_a06,autoGeneralize:true});}if(_a03.loaded){_a03.setScaleRange(_9fb.minScale,_9fb.maxScale);}else{_93b.connect(_a03,"onLoad",function(_a08){_a08.setScaleRange(_9fb.minScale,_9fb.maxScale);});}if(_a03.loaded){_9f7(_9ff.layers,_a03);}else{_93b.connect(_a03,"onLoad",function(_a09){_9f7(_9ff.layers,_a09);});}_a00.push(_a03);});if(_a00.length>0){var _a0a=function(_a0b,_a0c){_93a.forEach(_a0b,function(_a0d){if(_a0c){_a0d.show();}else{_a0d.hide();}});};_93b.connect(_9fb,"onVisibilityChange",lang.hitch(this,_a0a,_a00));var _a0e=function(_a0f,_a10,_a11){if(_a0f.id===_a11.id){_93a.forEach(_a10,function(_a12){map.removeLayer(_a12);});}};_93b.connect(map,"onLayerRemove",lang.hitch(this,_a0e,_9fb,_a00));}delete _9fb.__popups;delete _9fb.__popupIds;delete _9fb.__popupUrls;delete _9fb.__resourceInfo;return _a00;};function _a13(_a14){return _943({url:_98a(_a14.url+"/layers"),content:{f:"json"},callbackParamName:"callback",error:function(){}});};function _a15(_a16,map,_a17){var _a18=[];_93a.forEach(_a16,function(_a19){var _a1a=_a19.__popups;if(_a1a&&_a1a.length>1&&_a19.version>=10){_a19.__deferredsPos=_a18.length;_a18.push(_a13(_a19));}});var _a1b=[];if(_a18.length>0){var _a1c=new _93e(_a18);_a1c.addCallback(function(_a1d){_93a.forEach(_a16,function(_a1e){if(_a1e.__popups&&_a1e.__popups.length>0){if(_a1e.__deferredsPos||_a1e.__deferredsPos===0){var _a1f=_a1d[_a1e.__deferredsPos][1];_a1b=_a1b.concat(_9fa(_a1e,_a1f.layers,_a17,map));delete _a1e.__deferredsPos;}else{_a1b=_a1b.concat(_9fa(_a1e,null,_a17,map));}}});map.addLayers(_a1b);});}else{_93a.forEach(_a16,function(_a20){if(_a20.__popups&&_a20.__popups.length>0){_a1b=_a1b.concat(_9fa(_a20,null,_a17,map));}});map.addLayers(_a1b);}};function _a21(_a22){_93a.forEach(_a22,function(_a23){var _a24=_a23.layer;if(_a24.toJson){var json=_a24.toJson();if(json.featureSet&&_a24.name.indexOf("Text")>-1){_93a.forEach(json.featureSet.features,function(_a25,idx){if(_a25.attributes.TEXT){var _a26=_a24.graphics[idx];_a26.symbol.setText(_a25.attributes.TEXT);if(_a25.symbol.horizontalAlignment){_a26.symbol.align=_a25.symbol.horizontalAlignment;}_a26.setSymbol(_a26.symbol);_a26.setAttributes(_a25.attributes);}},this);}}});};function _a27(_a28){var _a29=6;_93a.forEach(_a28,function(_a2a){var _a2b=_a2a.renderer;if(_a2b){if(_a2b.declaredClass==="esri.renderer.SimpleRenderer"){var _a2c=_a2b.symbol;if(_a2c&&_a2c.xoffset){_a29=Math.max(_a29,Math.abs(_a2c.xoffset));}if(_a2c&&_a2c.yoffset){_a29=Math.max(_a29,Math.abs(_a2c.yoffset));}}else{if(_a2b.declaredClass==="esri.renderer.UniqueValueRenderer"||_a2b.declaredClass==="esri.renderer.ClassBreaksRenderer"){_93a.forEach(_a2b.infos,function(info){var _a2d=info.symbol;if(_a2d&&_a2d.xoffset){_a29=Math.max(_a29,Math.abs(_a2d.xoffset));}if(_a2d&&_a2d.yoffset){_a29=Math.max(_a29,Math.abs(_a2d.yoffset));}});}}}});return _a29;};function _a2e(evt){var map=this,_a2f=map.infoWindow,_a30=evt.graphic;if(!map.loaded){return;}_a2f.hide();_a2f.clearFeatures();var _a31=[];_93a.forEach(map.graphicsLayerIds,function(_a32){var _a33=map.getLayer(_a32);if(_a33&&_a33.declaredClass.indexOf("FeatureLayer")!==-1&&_a33.loaded&&_a33.visible){_a33.clearSelection();if(_a33.infoTemplate&&!_a33.suspended){_a31.push(_a33);}}});_93a.forEach(map.layerIds,function(_a34){var _a35=map.getLayer(_a34);if(_a35&&_a35.declaredClass.indexOf("ArcGISImageServiceLayer")!==-1&&_a35.loaded&&_a35.visible&&_a35.infoTemplate){_a31.push(_a35);}});_a30=(_a30&&_a30.getInfoTemplate())?_a30:null;if(!_a31.length&&!_a30){return;}var _a36=_a27(_a31);var _a37=evt.screenPoint,_a38=map.toMap(new _946(_a37.x-_a36,_a37.y+_a36)),_a39=map.toMap(new _946(_a37.x+_a36,_a37.y-_a36)),_a3a=new _947(_a38.x,_a38.y,_a39.x,_a39.y,map.spatialReference);var _a3b=new _94d();_a3b.geometry=_a3a;_a3b.timeExtent=map.timeExtent;var _a3c=true;var _a3d=_93a.map(_a31,function(_a3e){var dfd;if(_a3e.declaredClass.indexOf("ArcGISImageServiceLayer")!==-1){_a3c=false;var _a3f={};_a3f.rasterAttributeTableFieldPrefix="Raster.";_a3f.returnDomainValues=true;dfd=_a3e.queryVisibleRasters(_a3b,_a3f);dfd.addCallback(function(){var _a40=_a3e.getVisibleRasters();return _a40;});}else{dfd=_a3e.selectFeatures(_a3b);dfd.addCallback(function(){var _a41=_a3e.getSelectedFeatures();return _a41;});}return dfd;});if(_a30){var dfd=new _93c();dfd.callback([_a30]);_a3d.splice(0,0,dfd);}var _a42=_93a.some(_a3d,function(dfd){return dfd.fired===-1;});if(!_a42){var _a43=_a30?1:0;_93a.forEach(_a31,function(_a44){if(_a44.declaredClass.indexOf("ArcGISImageServiceLayer")!==-1){_a43=_a43+_a44.getVisibleRasters().length;}else{_a43=_a43+_a44.getSelectedFeatures().length;}});if(!_a43){return;}}_a2f.setFeatures(_a3d);_a2f.show(evt.mapPoint,{closestFirst:_a3c});};function _a45(_a46,_a47,_a48,_a49,_a4a,_a4b){var _a4c=(_a4a.mapOptions||{}),_a4d,_a4e;if(!_a4c.infoWindow){_a4d=new _94c(null,_93f.create("div"));_a4c.infoWindow=_a4d;}if(!_942.isDefined(_a4c.showInfoWindowOnClick)){_a4c.showInfoWindowOnClick=false;}var map=new Map(_a49,_a4c);if(_a4a.ignorePopups){_93a.forEach(_a46,function(_a4f){delete _a4f.infoTemplate;});}if(!(_a4a.ignorePopups||_a4a.disableClickBehavior)){_a4e=_93b.connect(map,"onClick",_a2e);}_93b.connect(map,"onLayersAddResult",_a21);map.addLayers(_a46);if(!_a4a.ignorePopups){_a15(_a46,map,_a4a._clazz);}var _a50=[];_93a.forEach(_a47,function(_a51){_a50=_a50.concat(_a51.errors);},this);_a4b.callback({map:map,itemInfo:_a48,errors:_a50,clickEventHandle:_a4e,clickEventListener:_a2e});};function _a52(_a53,_a54,_a55,_a56,_a57){try{var _a58=_a55.mapOptions||{};_a55.mapOptions=_a58;var card=_a53.item;var _a59=[];_93a.forEach(_a57,function(_a5a){if(lang.isArray(_a5a.layerObject)){_93a.forEach(_a5a.layerObject,function(l){_a59.push(l);});}else{_a59.push(_a5a.layerObject);}});if(!_a59[0]){var msg="";if(_a57[0].errors&&_a57[0].errors.length){msg=" ("+_a57[0].errors[0].message+")";}_a56.errback(new Error(_961.arcgis.utils.baseLayerError+msg));return;}_a59=_93a.filter(_a59,_942.isDefined);if(card){if(card.extent){if(!_a58.extent){var _a5b=new _947(card.extent[0][0],card.extent[0][1],card.extent[1][0],card.extent[1][1],new _944({wkid:4326}));var _a5c=_a59[0].spatialReference;if(_a5c.wkid===4326){_a58.extent=_a5b;_a45(_a59,_a57,_a53,_a54,_a55,_a56);}else{if(_a5c.wkid===102100||_a5c.wkid===102113||_a5c.wkid===3857){_a5b.xmin=Math.max(_a5b.xmin,-180);_a5b.xmax=Math.min(_a5b.xmax,180);_a5b.ymin=Math.max(_a5b.ymin,-89.99);_a5b.ymax=Math.min(_a5b.ymax,89.99);_a58.extent=_948.geographicToWebMercator(_a5b);_a45(_a59,_a57,_a53,_a54,_a55,_a56);}else{if(_a55.geometryServiceURL||_941.defaults.geometryService){var gs;if(_a55.geometryServiceURL){gs=new _94e(_a55.geometryServiceURL);}else{gs=_941.defaults.geometryService;}gs.project([_a5b],_a5c,function(_a5d){var _a5e=_a5d[0];_a58.extent=_a58.extent||_a5e;_a45(_a59,_a57,_a53,_a54,_a55,_a56);});}else{_a56.errback(new Error(_961.arcgis.utils.geometryServiceError));}}}}else{_a45(_a59,_a57,_a53,_a54,_a55,_a56);}}else{_a45(_a59,_a57,_a53,_a54,_a55,_a56);}}else{_a45(_a59,_a57,_a53,_a54,_a55,_a56);}}catch(err){_a56.errback(err);}};function _a5f(_a60){var _a61=[];var _a62=_a60.baseMap.baseMapLayers.concat(_a60.operationalLayers);_93a.forEach(_a62,function(_a63,_a64){var _a65={};if(_a63.featureCollection&&_a63.type!=="CSV"){if(_a63.featureCollection.showLegend===true){_93a.forEach(_a63.featureCollection.layers,function(_a66){if(_a66.showLegend!==false){_a65={"layer":_a66.layerObject,"title":_a63.title,"defaultSymbol":(_a66.renderer&&_a66.renderer.defaultSymbol&&_a66.renderer.defaultLabel)?true:false};if(_a63.featureCollection.layers.length>1){_a65.title+=" - "+_a66.layerDefinition.name;}_a61.push(_a65);}});}}else{if((_a63.baseMapLayer&&_a63.showLegend===true&&_a63.layerObject)||(!_a63.baseMapLayer&&_a63.showLegend!==false&&_a63.layerObject)){var rend=_a63.layerObject.renderer;var _a67=(!rend||(rend&&rend.defaultSymbol&&rend.defaultLabel))?true:false;if((_a63.layerObject.version<10.1&&(_a63.layerObject instanceof _950||_a63.layerObject instanceof _94f))||(_a63.layerObject instanceof esri.layers.ArcGISImageServiceLayer)){_a67=true;}_a65={"layer":_a63.layerObject,"title":_a63.title,"defaultSymbol":_a67};if(_a63.layers){var _a68=_93a.map(_93a.filter(_a63.layers,function(lyr){return (lyr.showLegend===false);}),function(lyr){return lyr.id;});if(_a68.length){_a65.hideLayers=_a68;}}_a61.push(_a65);}}});return _a61;};function _a69(_a6a){if(_962._arcgisUrl&&_962._arcgisUrl.length>0){_962.arcgisUrl=_962._arcgisUrl;}var url=_962.arcgisUrl+"/"+_a6a;var _a6b={},_a6c=new _93c();_943({url:url,content:{f:"json"},callbackParamName:"callback",load:function(_a6d){_a6b.item=_a6d;_943({url:url+"/data",content:{f:"json"},callbackParamName:"callback",load:function(_a6e){_a6b.itemData=_a6e;_a6c.callback(_a6b);},error:function(_a6f){_a6c.errback(_a6f);}});},error:function(_a70){_a6c.errback(_a70);}});return _a6c;};function _a71(arg1,_a72,_a73){var _a74=new _93c();_a73=_a73||{};var _a75=_a73.infoTemplateClass;_a73._clazz=(_a75&&(lang.isObject(_a75)?_a75:lang.getObject(_a75)))||_94b;if(lang.isString(arg1)){_a69(arg1).addCallback(function(_a76){_96d(_a76,_a73).addCallback(function(_a77){_9e4(_a77.itemData,_a73).addCallback(lang.hitch(null,_a52,_a77,_a72,_a73,_a74));});}).addErrback(lang.hitch(_a74,_a74.errback));}else{_96d(arg1,_a73).addCallback(function(_a78){_9e4(_a78.itemData,_a73).addCallback(lang.hitch(null,_a52,_a78,_a72,_a73,_a74));});}return _a74;};function _a79(_a7a){if(_a7a&&_a7a.itemInfo&&_a7a.itemInfo.itemData){return _a5f(_a7a.itemInfo.itemData);}else{return [];}};_962={arcgisUrl:location.protocol+"//www.arcgis.com/sharing/rest/content/items",getItem:_a69,createMap:_a71,getLegendLayers:_a79,_arcgisUrl:null,_getItemProps:_96d,_getItemData:_963,_getBingKey:_966,_processFSItemProperties:_96b,_getLayers:_9e4,_preBuildLayerObjects:_9d3,_buildLayerObjects:_9c7,_preCreateMap:_a52,_getMapSR:_9cf,_createMap:_a45,_addSelectionLayers:_a15,_createSelectionFeatureLayers:_9fa,_getServiceInfo:_9e1,_getLayersInfo:_a13,_initLayer:_9af,_loadAsCached:_98b,_loadAsDynamic:_996,_processPopups:_97e,_onLayersAddResult:_a21,_sameSpatialReferenceAsBasemap:_9a4,_sameTilingSchemeAsBasemap:_9a8,_showPopup:_a2e,_calculateClickTolerance:_a27,_getVisibleFeatureLayers:_98f,_updateLayerScaleInfo:_9f7,_checkUrl:_98a,_isHostedService:_986,_isAgolService:_989,_getLegendLayers:_a5f};lang.setObject("arcgis.utils",_962,_940);return _962;});