// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
require({cache:{"esri/layers/FeatureLayer":function(){define("require module 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 dojo/when dojo/promise/all ../kernel ../lang ../request ../config ../deferredUtils ../promiseList ../SpatialReference ../symbols/SimpleMarkerSymbol ../symbols/SimpleLineSymbol ../symbols/SimpleFillSymbol ../symbols/jsonUtils ../renderers/SimpleRenderer ../renderers/UniqueValueRenderer ../renderers/jsonUtils ../support/expressionUtils ../tasks/QueryTask ../tasks/query ../tasks/FeatureSet ../tasks/StatisticDefinition ../geometry/Extent ../geometry/jsonUtils ../geometry/normalizeUtils ../geometry/scaleUtils ./GraphicsLayer ./Field ./TimeInfo ./FeatureType ./FeatureTemplate ./FeatureEditResult ./LabelClass ./SnapshotMode ./OnDemandMode ./SelectionMode ./StreamMode ./TrackManager ./HeatmapManager ./clustering/ClusterManager dojo/i18n!../nls/jsapi dojo/has!extend-esri?./agscommon".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A,y,B,x,w,z,E,C,D,F,G,I,N,M,P,U,V,W,R,K,J,O,S,L,Q,T,ba,X,Y,ca,da,Z,aa,ea,fa){var ga=A.defaults,H=p(J,{declaredClass:"esri.layers.FeatureLayer",invalidParams:"query contains one or more unsupported parameters",reHostedFS:/(https?:)?\/\/services.*\.arcgis\.com/i,maxPointCountForAuto:4E3,maxRecordCountForAuto:2E3,maxVertexCountForAuto:25E4,generalizeForScale:4E3,_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(a,b){this._preventInit||this._initFeatureLayer(a,b)},_initFeatureLayer:function(a,b){this.i18n=fa;b=b||{};this._featureReduction=
this._featureReduction||b.featureReduction;this._featureReductionEnabled=null!=b.featureReductionEnabled?b.featureReductionEnabled:!0;this.showLabels=null!=b.showLabels?b.showLabels:!0;this._outFields=b.outFields;this._defnExpr=b.definitionExpression;this._loadCallback=b.loadCallback;this._trackIdField=b.trackIdField;this.objectIdField=b.objectIdField;this._maxOffset=null!=b.maxAllowableOffset?b.maxAllowableOffset:this.maxAllowableOffset;this.quantize=null!=b.quantize?b.quantize:!0;this._optEditable=
b.editable;this._optAutoGen=b.autoGeneralize;this.editSummaryCallback=b.editSummaryCallback;this.userId=b.userId;this.userIsAdmin=b.userIsAdmin;this.useMapTime=b.hasOwnProperty("useMapTime")?!!b.useMapTime:!0;this.source=b.source;this.gdbVersion=b.gdbVersion;this.orderByFields=b.orderByFields;this.maxPointCountForAuto=null!=b.maxPointCountForAuto?b.maxPointCountForAuto:this.maxPointCountForAuto;this.maxRecordCountForAuto=null!=b.maxRecordCountForAuto?b.maxRecordCountForAuto:this.maxRecordCountForAuto;
this.maxVertexCountForAuto=null!=b.maxVertexCountForAuto?b.maxVertexCountForAuto:this.maxVertexCountForAuto;this.generalizeForScale=null!=b.generalizeForScale?b.generalizeForScale:this.generalizeForScale;this.queryPagination=this._optQueryPagination=null!=b.queryPagination?b.queryPagination:!0;this.multipatchOption=b.multipatchOption;this._selectedFeatures={};this._selectedFeaturesArr=[];this._newFeatures=[];this._deletedFeatures={};this._ulid=this._getUniqueId();var c=q.isDefined(b.mode)?b.mode:
H.MODE_ONDEMAND;this._isStream&&(c=H.MODE_STREAM);this.mode=c;switch(c){case H.MODE_SNAPSHOT:this.currentMode=H.MODE_SNAPSHOT;this._mode=new X(this);break;case H.MODE_ONDEMAND:case H.MODE_AUTO:this.currentMode=H.MODE_ONDEMAND;this._tileWidth=b.tileWidth||512;this._tileHeight=b.tileHeight||512;this._mode=new Y(this);this.latticeTiling=b.latticeTiling;break;case H.MODE_SELECTION:this.currentMode=H.MODE_SELECTION;this._mode=new ca(this);this._isSelOnly=!0;break;case H.MODE_STREAM:this.currentMode=H.MODE_STREAM,
this._mode=new da(this),this._isStream=!0}this._initLayer=h.hitch(this,this._initLayer);this._selectHandler=h.hitch(this,this._selectHandler);this._editable=!1;if(h.isObject(a)&&a.layerDefinition)return this._collection=!0,this.mode=this._isStream?H.MODE_STREAM:H.MODE_SNAPSHOT,this._isStream||this._outFields||(this._outFields=["*"]),this._initLayer(a),this;this._task=new N(this.url,{source:this.source,gdbVersion:this.gdbVersion});c=this._url.path;this._fserver=!1;-1!==c.search(/\/FeatureServer\//i)&&
(this._fserver=!0);this.mode===H.MODE_AUTO&&this.reHostedFS.test(this.url)&&this._queryLimit();var f=b.resourceInfo;f?this._initLayer(f):(this.source&&(f={source:this.source.toJson()},this._url.query=h.mixin(this._url.query,{layer:k.toJson(f)})),this.gdbVersion&&(this._url.query=h.mixin(this._url.query,{gdbVersion:this.gdbVersion})),u({url:c,content:h.mixin({f:"json"},this._url.query),callbackParamName:"callback",load:this._initLayer,error:this._errorHandler}));this.registerConnectEvents()},_initLayer:function(b,
a){if(b||a){this._json=b;this._findCredential();if(this.credential&&this.credential.ssl||b&&b._ssl)this._useSSL(),this._task._useSSL();this.version=b.currentVersion;this.version||(this.version="capabilities"in b||"drawingInfo"in b||"hasAttachments"in b||"htmlPopupType"in b||"relationships"in b||"timeInfo"in b||"typeIdField"in b||"types"in b?10:9.3);this._collection&&(this._isStream||(this.currentMode=H.MODE_SNAPSHOT,this._mode=new X(this)),this._featureSet=b.featureSet,this._nextId=b.nextObjectId,
b=b.layerDefinition);this.geometryType=b.geometryType;"string"!==typeof this.multipatchOption&&"esriGeometryMultiPatch"===this.geometryType&&(this.multipatchOption="xyFootprint");if(b.hasOwnProperty("capabilities")){var f=this.capabilities=b.capabilities;f&&-1!==f.toLowerCase().indexOf("editing")?this._editable=!0:this._editable=!1}else this._collection||(this._editable=this._fserver);q.isDefined(this._optEditable)?(this._editable=this._optEditable,delete this._optEditable):"esriGeometryMultiPatch"===
this.geometryType&&(this._editable=!1);this._json=k.toJson(this._json);this.isEditable()?this._setMaxOffset(null):this.mode===H.MODE_SNAPSHOT||"esriGeometryPolyline"!==this.geometryType&&"esriGeometryPolygon"!==this.geometryType&&!this.hasXYFootprint()||(this._autoGeneralize=q.isDefined(this._optAutoGen)?this._optAutoGen:this.mode===H.MODE_ONDEMAND||this.mode===H.MODE_AUTO,delete this._optAutoGen);var f=b.effectiveMinScale||b.minScale,d=b.effectiveMaxScale||b.maxScale;!this._hasMin&&f&&this.setMinScale(f);
!this._hasMax&&d&&this.setMaxScale(d);this.layerId=b.id;this.name=b.name;this.description=b.description;this.copyright=b.copyrightText;this.type=b.type;this.displayField=b.displayField;this.defaultDefinitionExpression=b.definitionExpression||(b.isView?b.viewDefinitionQuery:b.definitionQuery);this.fullExtent=new V(b.extent);this.initialExtent=new V(this.fullExtent.toJson());this.fullExtent.spatialReference&&(this.spatialReference=new x(this.fullExtent.spatialReference.toJson()));this.defaultVisibility=
b.defaultVisibility;if("esriGeometryPoint"===this.geometryType||"esriGeometryMultipoint"===this.geometryType)this.latticeTiling=!1;this.hasM=b.hasM||!1;this.hasZ=b.hasZ||!1;this.indexedFields=b.indexedFields;this.maxRecordCount=b.maxRecordCount;this.canModifyLayer=b.canModifyLayer;this.supportsStatistics=b.supportsStatistics;this.supportsAdvancedQueries=this._collection?!1:b.supportsAdvancedQueries;this.supportsCalculate=b.supportsCalculate;this.supportsAttachmentsByUploadId=b.supportsAttachmentsByUploadId;
this.supportsCoordinatesQuantization=b.supportsCoordinatesQuantization;this.quantize=this.quantize&&this.supportsCoordinatesQuantization;this.hasLabels=b.hasLabels;this.canScaleSymbols=b.canScaleSymbols;this.supportsRollbackOnFailureParameter=this.supportsRollbackOnFailure=b.supportsRollbackOnFailure;this.syncCanReturnChanges=b.syncCanReturnChanges;this.isDataVersioned=b.isDataVersioned;this.editFieldsInfo=b.editFieldsInfo;this.ownershipBasedAccessControlForFeatures=b.ownershipBasedAccessControlForFeatures;
this.editFieldsInfo&&this.ownershipBasedAccessControlForFeatures&&(this.creatorField=this.editFieldsInfo.creatorField);this.relationships=b.relationships;this.allowGeometryUpdates=q.isDefined(b.allowGeometryUpdates)?b.allowGeometryUpdates:!0;this.allowUpdateWithoutMValues=!!b.allowUpdateWithoutMValues;this.enableZDefaults=!!b.enableZDefaults;this.zDefault=q.isDefined(b.zDefault)?b.zDefault:null;this.advancedQueryCapabilities=b.advancedQueryCapabilities||{supportsStatistics:this.supportsStatistics,
supportsOrderBy:this.supportsAdvancedQueries,supportsDistinct:this.supportsAdvancedQueries};this.url&&(this.advancedQueryCapabilities.supportsPagination=this.advancedQueryCapabilities.supportsPagination&&(this.reHostedFS.test(this.url)||10.3<this.version));this.queryPagination=this._optQueryPagination&&this.advancedQueryCapabilities.supportsPagination;this.useStandardizedQueries=b.useStandardizedQueries;this.tileMaxRecordCount=b.tileMaxRecordCount;this.standardMaxRecordCount=b.standardMaxRecordCount;
this._setMaxOffset(this._maxOffset,!0);this._isTable="Table"===this.type;for(var u=this.fields=[],d=b.fields,f=0;f<d.length;f++)u.push(new O(d[f]));if(!this.objectIdField){this.objectIdField=b.objectIdField;if(!this.objectIdField)for(d=b.fields,f=0;f<d.length;f++)if(u=d[f],"esriFieldTypeOID"===u.type){this.objectIdField=u.name;break}this.objectIdField||this._isStream||console.debug("esri.layers.FeatureLayer: "+q.substitute({url:this.url},"objectIdField is not set [url: ${url}]"))}if(!q.isDefined(this._nextId)){d=
this.objectIdField;u=-1;if(this._collection&&d)for(var l=(f=this._featureSet)&&f.features,t=l?l.length:0,g,f=0;f<t;f++)g=(g=l[f].attributes)&&g[d],g>u&&(u=g);this._nextId=u+1}this.globalIdField=b.globalIdField;if(f=this.typeIdField=b.typeIdField)if(f=!this._getField(f)&&this._getField(f,!0))this.typeIdField=f.name;this.visibilityField=b.visibilityField;if(d=b.defaultSymbol)this.defaultSymbol=C.fromJson(d);var v=this.types=[],A=b.types,m,y,u=(f=this.editFieldsInfo)&&f.creatorField,l=f&&f.editorField;
g=u||l;t=[];if(A)for(f=0;f<A.length;f++)m=new L(A[f]),y=m.templates,g&&y&&y.length&&(t=t.concat(y)),v.push(m);A=b.templates;m=this.templates=[];if(A)for(f=0;f<A.length;f++)v=new Q(A[f]),g&&t.push(v),m.push(v);for(f=0;f<t.length;f++)if(g=h.getObject("prototype.attributes",!1,t[f]))u&&delete g[u],l&&delete g[l];if(f=b.timeInfo)this.timeInfo=new S(f),this._startTimeField=f.startTimeField,this._endTimeField=f.endTimeField,this._startTimeField&&this._endTimeField&&(this._twoTimeFields=!0),this._trackIdField?
f.trackIdField=this._trackIdField:this._trackIdField=f.trackIdField;this.hasAttachments=!this._collection&&b.hasAttachments?!0:!1;this.htmlPopupType=b.htmlPopupType;var f=b.drawingInfo,n;(u=f&&f.labelingInfo)&&!this.labelingInfo&&(this.labelingInfo=e.map(u,function(b){return new ba(b)}),this._fixLabelExpr());if(!this.renderer)if(f&&f.renderer){if(n=f.renderer,this.setRenderer(G.fromJson(n)),"classBreaks"===n.type&&this.renderer.setMaxInclusive(!0),!this._collection){var p=n.type,d=[];n=this.renderer;
switch(p){case "simple":d.push(n.symbol);break;case "uniqueValue":case "classBreaks":d.push(n.defaultSymbol),d=d.concat(e.map(n.infos,function(b){return b.symbol}))}var d=e.filter(d,q.isDefined),N=this._url.path+"/images/",r=this._getToken();e.forEach(d,function(b){var a=b.url;a&&(-1===a.search(/https?\:/)&&-1===a.indexOf("data:")&&(b.url=N+a),r&&-1!==b.url.search(/https?\:/)&&(b.url+="?token\x3d"+r))})}}else if(d)A=this.types,0<A.length?(n=new F(this.defaultSymbol,this.typeIdField),e.forEach(A,function(b){n.addValue(b.id,
b.symbol)})):n=new D(this.defaultSymbol),this.setRenderer(n);else if(!this._isTable){switch(this.geometryType){case "esriGeometryPoint":case "esriGeometryMultipoint":p=new w;break;case "esriGeometryPolyline":p=new z;break;case "esriGeometryPolygon":p=new E;break;default:this.hasXYFootprint()&&(p=new E)}this.setRenderer(p?new D(p):null)}p=f&&f.transparency||0;!this.hasOwnProperty("opacity")&&0<p&&(this.opacity=1-p/100);(c("ie")||7<=c("trident")||c("safari"))&&this.isEditable()&&10.02>this.version&&
(this._ts=!0);this.statistics=b.statistics;this._fixRendererFields();this._updateRequiredFieldsFromLabelingInfo();this._checkFields();this._updateCaps();var M=function(){null==this._maxOffset||this._isFractionalOffsetAllowed()||this._setMaxOffset(this._maxOffset);this.loaded=!0;this.setFeatureReduction(this.getFeatureReduction());this.currentMode!==H.MODE_SNAPSHOT&&(this.queryPagination=!1);this.onLoad(this);var b=this._loadCallback;b&&(delete this._loadCallback,b(this))},p=[];this._collection?(f=
this._featureSet,this._featureSet=null,this._mode._drawFeatures(new P(f)),this._fcAdded=!0):(p.push(this._forceIdentity()),this._limitPromise&&p.push(this._limitPromise));p.push(this._evalGeometryOperations());p.length?B(p).then(h.hitch(this,function(){M.call(this)})):M.call(this)}},setShowLabels:function(b){this.showLabels=b;this.onShowLabelsChange()},onShowLabelsChange:function(){},onRendererChange:function(b){this.inherited(arguments);var a=this._map;this._ager=!!(b&&b.observationAger&&b.observationRenderer);
b&&"colors"in b&&"blurRadius"in b&&"maxPixelIntensity"in b?"esriGeometryPoint"==this.geometryType&&!this._heatmapManager&&a&&(this._heatmapManager=new aa(this),this._heatmapManager.initialize(a)):this.renderer&&this.renderer.getRendererInfo?e.some(this.renderer.rendererInfos,function(b){return b.renderer&&"colors"in b.renderer&&"blurRadius"in b.renderer})||(this._heatmapManager=null):this._heatmapManager=null;this.timeInfo&&a&&(b&&(b.latestObservationRenderer||b.trackRenderer)?this._trackManager||
(this._trackManager=new Z(this),this._trackManager.initialize(a),this._childLayer=this._trackManager.container,this._mode._applyTimeFilter()):this._trackManager&&!this._isStream&&(this._trackManager.destroy(),this._trackManager=null));if(b){var f=[],a=e.filter([b,b.observationRenderer,b.latestObservationRenderer,b.trackRenderer],q.isDefined),c=function(b){return null!=b&&"function"!=typeof b&&b};e.forEach(a,function(b){var a=c(b.attributeField),q=c(b.attributeField2);b=c(b.attributeField3);!1!==a&&
f.push(a);!1!==q&&f.push(q);!1!==b&&f.push(b)});this._requiredFields=f}else this._requiredFields=[];this.loaded&&(this._fixRendererFields(),this._checkFields(this._requiredFields),this._collection&&(this._typesDirty=!0))},setFeatureReduction:function(b){b&&(b=h.mixin({},b),null!=b.clusterSize&&null==b.clusterRadius&&(b.clusterRadius=b.clusterSize),delete b.clusterSize);this.loaded?this._isFeatureReductionSupported(b)?this._featureReduction=b:(this._featureReduction=null,b&&console.log("Clustering is not supported for this layer: "+
this.url)):this._featureReduction=b;this._evalFeatureReduction(this._featureReduction)},hasFeatureReduction:function(){return!!this._featureReduction},getFeatureReduction:function(){var b=this._featureReduction;if(b){var b=h.mixin({},b),a=this._clusterManager;if(a=a&&a.aggregationInfo)b.clusterRadius=a.clusterRadius,b.infoTemplate=a.infoTemplate}return b},isFeatureReductionActive:function(){var b=this._clusterManager;return!!(b&&b.isClusteringEnabled()&&b.isClusteringActive())},isFeatureReductionEnabled:function(){return this._featureReductionEnabled},
enableFeatureReduction:function(){this._featureReductionEnabled||(this._featureReductionEnabled=!0,this._evalFeatureReduction(this._featureReduction))},disableFeatureReduction:function(){this._featureReductionEnabled&&(this._featureReductionEnabled=!1,this._evalFeatureReduction(this._featureReduction))},isFeatureReductionApplied:function(){return this.hasFeatureReduction()&&this.isFeatureReductionEnabled()&&this._canCluster(this.getFeatureReduction())},getAggregateGraphics:function(){return this._clusterManager?
this._clusterManager.getAggregateGraphics():[]},getChildGraphics:function(b){return this._clusterManager?this._clusterManager.getFeaturesInCluster(b):[]},getSingleGraphics:function(){return this._clusterManager?this._clusterManager.getSingleGraphics():[]},getFeatureReductionRenderer:function(){return this.isFeatureReductionActive()?this._clusterManager.getClusterRenderer():null},getFeatureReductionLayer:function(){return this._clusterManager?this._clusterManager.container:null},getFeatureReductionField:function(b){var a,
f=this._clusterManager?this._clusterManager.getClusterFields():null;b=b?b.toLowerCase():"";e.some(f,function(f){b===f.name.toLowerCase()&&(a=f);return!!a});return a},_isFeatureReductionSupported:function(b){return b&&"cluster"===b.type&&"esriGeometryPoint"===this.geometryType&&(this._collection||this._isStream||this._optQueryPagination&&this.advancedQueryCapabilities.supportsPagination)},_isReductionCompatibleRenderer:function(b){b=b&&b.declaredClass||"";b=b.toLowerCase();return-1<b.indexOf("simplerenderer")||
-1<b.indexOf("classbreaksrenderer")||-1<b.indexOf("uniquevaluerenderer")},_evalFeatureReduction:function(b){this.loaded&&this.getMap()&&(b=b||this.getFeatureReduction(),this._evalFetchMode(b),b&&this.isFeatureReductionEnabled()?this._canCluster(b)?this._clusterManager?this._updateClusterManager(b):(this._clusterManager=this._createClusterManager(b),this.onFeatureReductionChange()):(console.log("Clustering is supported only for point layers where map spatial reference is WGS84 or Web Mercator"),this._destroyClusterManager()):
this._destroyClusterManager())},_canCluster:function(b){var a=this._map.spatialReference;return this._isFeatureReductionSupported(b)&&this._isReductionCompatibleRenderer(this.renderer)&&(a.isWebMercator()||4326===a.wkid)},_createClusterManager:function(b){b=new ea({layer:this,aggregationInfo:b});this._clusterHandles=[b.on("renderer-change",h.hitch(this,function(){this.onFeatureReductionRendererChange()}))];b.initialize(this._map);return b},_updateClusterManager:function(b){var a=this._clusterManager;
a&&a.setAggregationInfo(b)},_destroyClusterManager:function(b){e.forEach(this._clusterHandles,function(b){b.remove()});this._clusterHandles=null;this._clusterManager&&(this._clusterManager.destroy(b),this._clusterManager=null,this.onFeatureReductionChange())},redraw:function(){this.inherited(arguments);this._clusterManager&&this._clusterManager.redraw();this._trackManager&&this._trackManager.container&&this._trackManager.container.redraw()},_evalSDRenderer:function(b){this.inherited(arguments);var a=
this._getRenderer();this._ager=!!(a&&a.observationAger&&a.observationRenderer);this._trackManager&&this._trackManager.container&&this._trackManager.container.setRenderer(a&&a.trackRenderer);b&&this._evalFeatureReduction()},_setMap:function(b){var a=this.inherited(arguments),f=this._mode,c=this;f&&b.loaded&&f.initialize(b);this.geometryType&&this.attr("data-geometry-type",this.geometryType.replace(/esriGeometry/i,"").toLowerCase());this._addHandle=this.on("graphic-node-add",function(b){b=b.graphic.attributes;
(b=c._selectedFeatures[b&&b[c.objectIdField]])&&b.attr("data-selected","")});return a},_unsetMap:function(b){var a=this._mode;a&&(a.suspend(),a.destroy());this._destroyClusterManager(!1);this._trackManager&&(this._trackManager.destroy(),this._trackManager=null);m.disconnect(this._zoomConnect);m.disconnect(this._addHandle);this._zoomConnect=this._addHandle=null;this._toggleTime(!1);this.inherited("_unsetMap",arguments)},refresh:function(){this._needsRefresh=!1;var b=this._mode;b&&b.refresh()},hasXYFootprint:function(){return"esriGeometryMultiPatch"===
this.geometryType&&"xyFootprint"===this.multipatchOption},getOutFields:function(){return e.filter(this._getOutFields(),function(b){return"*"===b||!!this._getField(b)},this)},getField:function(b){return this._getField(b,!0)},isOutField:function(b){b=this.getField(b);if(!b)return!1;var a=this.getOutFields();return-1<e.indexOf(a,"*")||-1<e.indexOf(a,b.name)},getFieldLabel:function(b){var a=this.infoTemplate,a=a&&a.getFieldInfo&&a.getFieldInfo(b);b=h.isFunction(b)?null:this.getField(b);var f=a||b,c="";
f&&(c=a&&a.label||b&&b.alias||f.name||f.fieldName);return c},getDomain:function(b,a){var f,c,q=a&&a.feature,d=q&&this.typeIdField&&q.attributes&&q.attributes[this.typeIdField];null!=d&&e.some(this.types,function(a){return a.id==d?((f=a.domains&&a.domains[b])&&"inherited"===f.type&&(f=this._getLayerDomain(b),c=!0),!0):!1},this);c||f||(f=this._getLayerDomain(b));return f},_getLayerDomain:function(b){var a;e.some(this.fields,function(f){f.name===b&&(a=f.domain);return!!a});return a},getType:function(b){var a,
f=b&&this.typeIdField&&b.attributes&&b.attributes[this.typeIdField];e.some(this.types,function(b){b.id==f&&(a=b);return!!a});return a},setEditable:function(b){if(!this._collection)return console.log("FeatureLayer:setEditable - this functionality is not yet supported for layer in a feature service"),this;if(!this.loaded)return this._optEditable=b,this;var a=this._editable;this._editable=b;this._updateCaps();if(a!==b)this.onCapabilitiesChange();return this},getEditCapabilities:function(b){var a={canCreate:!1,
canUpdate:!1,canDelete:!1,canUpdateGeometry:!1};if(!this.loaded||!this.isEditable())return a;var f=b&&b.feature;b=b&&b.userId||this.getUserId();var c=e.map(this.capabilities?this.capabilities.toLowerCase().split(","):[],h.trim),q=(a=-1<e.indexOf(c,"editing"))&&-1<e.indexOf(c,"create"),d=a&&-1<e.indexOf(c,"update"),c=a&&-1<e.indexOf(c,"delete"),u=this.ownershipBasedAccessControlForFeatures,l=this.editFieldsInfo,t=l&&l.creatorField,l=l&&l.realm,f=(f=f&&f.attributes)&&t?f[t]:void 0,g=!!this.userIsAdmin,
t=!u||g||!(!u.allowOthersToUpdate&&!u.allowUpdateToOthers),v=!u||g||!(!u.allowOthersToDelete&&!u.allowDeleteToOthers),k=!u||g||!u.hasOwnProperty("allowAnonymousToUpdate")||u.allowAnonymousToUpdate,u=!u||g||!u.hasOwnProperty("allowAnonymousToDelete")||u.allowAnonymousToDelete;b&&l&&(b=b+"@"+l);if(g||a&&!(q||d||c))q=d=c=!0;a={canCreate:q,canUpdate:d,canDelete:c,canUpdateGeometry:g||this.allowGeometryUpdates};b||(a.canUpdate=a.canUpdate&&k,a.canDelete=a.canDelete&&u);null===f?(a.canUpdate=a.canUpdate&&
t,a.canDelete=a.canDelete&&v):""!==f&&f&&b.toLowerCase()!==f.toLowerCase()&&(a.canUpdate=a.canUpdate&&t,a.canDelete=a.canDelete&&v);return a},getUserId:function(){var b;this.loaded&&(b=this.credential&&this.credential.userId||this.userId||"");return b},setUserIsAdmin:function(b){this.userIsAdmin=b},setEditSummaryCallback:function(b){this.editSummaryCallback=b},getEditSummary:function(b,a,f){f=q.isDefined(f)?f:(new Date).getTime();var c="";f=this.getEditInfo(b,a,f);(a=a&&a.callback||this.editSummaryCallback)&&
(f=a(b,f)||"");if(h.isString(f))c=f;else{if(f){b=f.action;a=f.userId;var d=f.timeValue,u=0;b&&u++;a&&u++;q.isDefined(d)&&u++;1<u&&(c=("edit"===b?"edit":"create")+(a?"User":"")+(q.isDefined(d)?f.displayPattern:""))}c=c&&q.substitute(f,this.i18n.layers.FeatureLayer[c])}return c},getEditInfo:function(b,a,f){if(this.loaded){f=q.isDefined(f)?f:(new Date).getTime();a=a&&a.action||"last";var c=this.editFieldsInfo,d=c&&c.creatorField,u=c&&c.creationDateField,l=c&&c.editorField,c=c&&c.editDateField,l=(b=b&&
b.attributes)&&l?b[l]:void 0,c=b&&c?b[c]:null,d=this._getEditData(b&&d?b[d]:void 0,b&&u?b[u]:null,f);f=this._getEditData(l,c,f);var t;switch(a){case "creation":t=d;break;case "edit":t=f;break;case "last":t=f||d}t&&(t.action=t===f?"edit":"creation");return t}},_getEditData:function(b,a,f){var c,d,u;q.isDefined(a)&&(d=f-a,u=0>d?"Full":6E4>d?"Seconds":12E4>d?"Minute":36E5>d?"Minutes":72E5>d?"Hour":864E5>d?"Hours":6048E5>d?"WeekDay":"Full");if(void 0!==b||u)c=c||{},c.userId=b,u&&(b=g.format,f=new Date(a),
c.minutes=Math.floor(d/6E4),c.hours=Math.floor(d/36E5),c.weekDay=b(f,{datePattern:"EEEE",selector:"date"}),c.formattedDate=b(f,{selector:"date"}),c.formattedTime=b(f,{selector:"time"}),c.displayPattern=u,c.timeValue=a);return c},isEditable:function(){return!(!this._editable&&!this.userIsAdmin)},isQueryable:function(){var b=e.map(this.capabilities?this.capabilities.toLowerCase().split(","):[],h.trim);return this._isStream||this.userIsAdmin||this._collection||-1!==e.indexOf(b,"query")||-1!==e.indexOf(b,
"catalog")},setMaxAllowableOffset:function(b){this.isEditable()||this._setMaxOffset(b,!0);return this},getMaxAllowableOffset:function(){var b=this._quantizationParameters?this._quantizationParameters.tolerance:void 0;return null!=this._maxOffset?this._maxOffset:b},_setMaxOffset:function(b,a){if(null==b)return delete this._maxOffset,delete this._quantizationParameters,this;this.quantize&&this.supportsCoordinatesQuantization?("esriGeometryPolyline"===this.geometryType?this._maxOffset=b:delete this._maxOffset,
this._quantizationParameters={mode:"view",originPosition:"upperLeft",tolerance:b,extent:this.fullExtent}):(this._isFractionalOffsetAllowed()&&a||(b=Math.floor(b)),isNaN(b)||0===b?delete this._maxOffset:this._maxOffset=b,delete this._quantizationParameters);return this},_isFractionalOffsetAllowed:function(){return null==this.version||10.1<=this.version||navigator.languages&&this._isLangWithDot(navigator.languages[0])},_isLangWithDot:function(b){b=(b=b&&b.split("-"))&&b[0]&&b[0].toLowerCase();return-1!==
e.indexOf(this._langsWithDot,b)},_langsWithDot:"ar en et fr he ja ko th vi zh".split(" "),setAutoGeneralize:function(b){this.loaded?this.isEditable()||this.mode===H.MODE_SNAPSHOT||"esriGeometryPolyline"!==this.geometryType&&"esriGeometryPolygon"!==this.geometryType&&!this.hasXYFootprint()||((this._autoGeneralize=b)?(this._autoSnapshot&&(this._prevScale=null),this._updateMaxOffset()):this._setMaxOffset(null)):this._optAutoGen=b;return this},setGDBVersion:function(b){this._collection||b===this.gdbVersion||
!b&&!this.gdbVersion||(this.gdbVersion=b,this._task.gdbVersion=b,this._url.query=h.mixin(this._url.query,{gdbVersion:b}),this.loaded&&(this.clearSelection(),this._map&&this.refresh()),this.onGDBVersionChange());return this},hasAllFeatures:function(){return this._mode?this._mode.hasAllFeatures():!0},setDefinitionExpression:function(b){this._defnExpr=b;(b=this._mode)&&b.propertyChangeHandler(1);return this},getDefinitionExpression:function(){return this._defnExpr},setTimeDefinition:function(b){this._isSnapshotMode()?
(this._timeDefn=b,(b=this._mode)&&b.propertyChangeHandler(2)):console.log("FeatureLayer.setTimeDefinition: layer in on-demand or selection mode does not support time definitions. Layer id \x3d "+this.id+", Layer URL \x3d "+this.url);return this},getTimeDefinition:function(){return this._timeDefn},setTimeOffset:function(b,a){this._timeOffset=b;this._timeOffsetUnits=a;var f=this._mode;f&&f.propertyChangeHandler(0);return this},setUseMapTime:function(b){this.useMapTime=b;this._toggleTime(!this.suspended);
(b=this._mode)&&b.propertyChangeHandler(0)},selectFeatures:function(b,a,f,c){a=a||H.SELECTION_NEW;this._hasPartialSelectedFeatures=!1;b=this._getShallowClone(b);var q=this._map,u,l=this,t=y._fixDfd(new d(y._dfdCanceller));b.outFields=this.getOutFields();b.returnGeometry=!0;b.multipatchOption=this.multipatchOption;q&&(b.outSpatialReference=new x(q.spatialReference.toJson()));if(!this._applyQueryFilters(b,!0))return u={features:[]},this._selectHandler(u,a,f,c,t),t;if(q=this._canDoClientSideQuery(b))t._pendingDfd=
v(this._doQuery(b,q)),t._pendingDfd.then(function(b){u={features:b};l._selectHandler(u,a,f,c,t)});else{if(this._collection)return this._resolve([Error("FeatureLayer::selectFeatures - "+this.invalidParams)],null,c,t,!0),t;if(this.loaded&&!this.isQueryable())return this._resolve([Error("Layer does not support query capability.")],null,c,t,!0),t;var g=this;this._ts&&(b._ts=(new Date).getTime());(t._pendingDfd=this._task.execute(b)).addCallbacks(function(b){g._selectHandler(b,a,f,c,t)},function(b){g._hasPartialSelectedFeatures=
!0;g._resolve([b],null,c,t,!0)})}return t},getSelectedFeatures:function(){var b=this._selectedFeatures,a=[],f;for(f in b)b.hasOwnProperty(f)&&a.push(b[f]);return a},clearSelection:function(b){var a=this._selectedFeatures,f=this._mode,c;for(c in a)a.hasOwnProperty(c)&&(this._unSelectFeatureIIf(c,f),f._removeFeatureIIf(c));this._selectedFeatures={};this._isSelOnly&&f._applyTimeFilter(!0);if(!b)this.onSelectionClear();return this},setSelectionSymbol:function(b){if(this._selectionSymbol=b){var a=this._selectedFeatures,
f;for(f in a)a.hasOwnProperty(f)&&a[f].setSymbol(b)}return this},getSelectionSymbol:function(){return this._selectionSymbol},setLabelingInfo:function(b){b?(this.labelingInfo=b,this._fixLabelExpr()):delete this.labelingInfo;this._collection&&(this._typesDirty=!0);this.onLabelingInfoChange()},_fixLabelExpr:function(){var b=/\[([^\[\]]+)\]/ig,a,f=this,c=function(b,a){var c=f._getField(a,!0);return"["+(c&&c.name||a)+"]"};e.forEach(this.labelingInfo,function(f){if(a=f.labelExpression)f.labelExpression=
a.replace(b,c)})},_updateRequiredFieldsFromLabelingInfo:function(){var b=[];e.forEach(this.labelingInfo,function(a){var f=a.labelExpressionInfo;if(a.labelExpression){var c=/[\[\]]/ig;a=a.labelExpression.match(/\[[^\[\]]+\]/ig);(a=e.map(a,function(b){return b.replace(c,"")}))&&(b=b.concat(a))}if(f){if(f.value){var d=/[\{\}]/ig;a=f.value.match(/\{[^\{\}]+\}/ig);(a=e.map(a,function(b){return b.replace(d,"")}))&&(b=b.concat(a))}f.expression&&(b=b.concat(I.extractFieldNames(f.expression)))}});b=e.map(b,
function(b){var a=this.getField(b);return a?a.name:b},this);this._requiredFields&&(this._requiredFields=this._requiredFields.concat(b))},__msigns:[{n:"applyEdits",c:5,a:[{i:0},{i:1}],e:4,f:1}],applyEdits:function(b,a,f,c,d,q){var l=q.assembly,t=q.dfd;this._applyNormalized(b,l&&l[0]);this._applyNormalized(a,l&&l[1]);this.onBeforeApplyEdits(b,a,f);var g={},v=this.objectIdField,l={f:"json"},k=!1;if(this._collection)q={},q.addResults=b?e.map(b,function(){k=!0;return{objectId:this._nextId++,success:!0}},
this):null,q.updateResults=a?e.map(a,function(b){k=!0;var a=b.attributes[v];g[a]=b;return{objectId:a,success:!0}},this):null,q.deleteResults=f?e.map(f,function(b){k=!0;return{objectId:b.attributes[v],success:!0}},this):null,k?this._editHandler(q,b,g,c,d,t):this._resolve([q.addResults,q.updateResults,q.deleteResults],null,c,t);else{b&&0<b.length&&(l.adds=this._convertFeaturesToJson(b,0,1),k=!0);if(a&&0<a.length){for(q=0;q<a.length;q++){var A=a[q];g[A.attributes[v]]=A}l.updates=this._convertFeaturesToJson(a,
0,0,1);k=!0}if(f&&0<f.length){a=[];for(q=0;q<f.length;q++)a.push(f[q].attributes[v]);l.deletes=a.join(",");k=!0}if(k){var w=this;return u({url:this._url.path+"/applyEdits",content:h.mixin(l,this._url.query),callbackParamName:"callback",load:function(a){w._editHandler(a,b,g,c,d,t)},error:function(b){w._resolve([b],null,d,t,!0)}},{usePost:!0})}this._resolve([],null,c,t)}},queryFeatures:function(b,a,f){return this._query("execute","onQueryFeaturesComplete",b,a,f)},queryRelatedFeatures:function(b,a,f){return this._query("executeRelationshipQuery",
"onQueryRelatedFeaturesComplete",b,a,f)},queryIds:function(b,a,f){return this._query("executeForIds","onQueryIdsComplete",b,a,f)},queryCount:function(b,a,f){return this._query("executeForCount","onQueryCountComplete",b,a,f)},queryExtent:function(b,a,f){return this._query("executeForExtent","onQueryExtentComplete",b,a,f)},queryAttachmentInfos:function(b,f,c){var q=this._url.path+"/"+b+"/attachments",l=new d(y._dfdCanceller),t=this;l._pendingDfd=u({url:q,content:h.mixin({f:"json"},this._url.query),
callbackParamName:"callback",load:function(c){c=c.attachmentInfos;var d;e.forEach(c,function(f){d=a.objectToQuery({gdbVersion:t._url.query&&t._url.query.gdbVersion,layer:t._url.query&&t._url.query.layer,token:t._getToken()});f.url=q+"/"+f.id+(d?"?"+d:"");f.objectId=b});t._resolve([c],"onQueryAttachmentInfosComplete",f,l)},error:function(b){t._resolve([b],null,c,l,!0)}});return l},addAttachment:function(b,a,f,c){return this._sendAttachment("add",b,a,f,c)},updateAttachment:function(b,a,f,c,q){f.appendChild(l.create("input",
{type:"hidden",name:"attachmentId",value:a}));return this._sendAttachment("update",b,f,c,q)},deleteAttachments:function(b,a,f,c){var q=this._url.path+"/"+b+"/deleteAttachments",l=new d(y._dfdCanceller),t=this;a={f:"json",attachmentIds:a.join(",")};l._pendingDfd=u({url:q,content:h.mixin(a,this._url.query),callbackParamName:"callback",load:h.hitch(this,function(a){a=a.deleteAttachmentResults;a=e.map(a,function(a){a=new T(a);a.attachmentId=a.objectId;a.objectId=b;return a});t._resolve([a],"onDeleteAttachmentsComplete",
f,l)}),error:function(b){t._resolve([b],null,c,l,!0)}},{usePost:!0});return l},addType:function(b){var a=this.types;if(a){if(e.some(a,function(a){return a.id==b.id?!0:!1}))return!1;a.push(b)}else this.types=[b];return this._typesDirty=!0},deleteType:function(b){if(this._collection){var a=this.types;if(a){var f=-1;e.some(a,function(a,c){return a.id==b?(f=c,!0):!1});if(-1<f)return this._typesDirty=!0,a.splice(f,1)[0]}}},toJson:function(){var b=this._json;if(b=h.isString(b)?k.fromJson(b):h.clone(b)){var b=
b.layerDefinition?b:{layerDefinition:b},a=b.layerDefinition,f=this._collection;if(f&&this._typesDirty){a.types=e.map(this.types||[],function(b){return b.toJson()});var c=this.renderer,q=this.labelingInfo,d=a.drawingInfo;!c&&!q||d||(d=a.drawingInfo={});d&&c&&-1===c.declaredClass.indexOf("TemporalRenderer")&&(d.renderer=c.toJson());q&&(d.labelingInfo=e.map(q,function(b){return b.toJson()}))}c=null;if(!f||this._fcAdded)c={geometryType:a.geometryType,features:this._convertFeaturesToJson(this.graphics,
!0)};b.featureSet=h.mixin({},b.featureSet||{},c);b.featureSet.transform&&(q=b.featureSet.transform,delete b.featureSet.transform,c=new P(b.featureSet),c.quantize(q),b.featureSet=c.toJson());f&&(b.nextObjectId=this._nextId,a.capabilities=this.capabilities);return b}},onSelectionComplete:function(){},onSelectionClear:function(){},onBeforeApplyEdits:function(){},onEditsComplete:function(){},onQueryFeaturesComplete:function(){},onQueryRelatedFeaturesComplete:function(){},onQueryIdsComplete:function(){},
onQueryCountComplete:function(){},onQueryExtentComplete:function(){},onQueryAttachmentInfosComplete:function(){},onAddAttachmentComplete:function(){},onUpdateAttachmentComplete:function(){},onDeleteAttachmentsComplete:function(){},onCapabilitiesChange:function(){},onGDBVersionChange:function(){},onQueryLimitExceeded:function(){},onLabelingInfoChange:function(){},onFeatureReductionRendererChange:function(){},onFeatureReductionChange:function(){},_evalGeometryOperations:function(){var b=new d;setTimeout(h.hitch(this,
function(){this._isGeometryOperationsUsed()?I.enableGeometryOperations().always(function(){b.resolve()}):b.resolve()}),0);return b.promise},_isGeometryOperationsUsed:function(){var b=this.infoTemplate,a=this.renderer,f=this.labelingInfo;return b&&b.hasGeometryOperations&&b.hasGeometryOperations()||a&&a.hasGeometryOperations&&a.hasGeometryOperations()||e.some(f,function(b){return I.hasGeometryOperations(b.labelExpressionInfo&&b.labelExpressionInfo.expression)})?!0:!1},_forceIdentity:function(){var a=
new d,f=this,c,q=this._url&&this._url.path;c=q&&q.toLowerCase().indexOf("/rest/services");var l=this.editFieldsInfo,l=l&&(l.creatorField||l.editorField);(this.userIsAdmin||l)&&!this._getToken()&&-1<c&&b.id?(c=q.substring(0,c)+"/rest/info",u({url:c,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}).then(function(a){if(a.owningSystemUrl)return b.id.checkSignInStatus(a.owningSystemUrl+"/sharing")}).then(function(a){if(a)return b.id.getCredential(q)}).then(function(b){b&&f._findCredential()}).always(function(){a.resolve()})):
a.resolve();return a.promise},_isSnapshotMode:function(){return this._mode?this._mode.isInstanceOf(X):!1},_checkMode:function(b){var a=this.geometryType,f=this.maxRecordCount;b=(b=b&&b.features&&b.features[0])&&b.attributes&&b.attributes.exceedslimit;this.mode===H.MODE_AUTO&&!this.isEditable()&&0===b&&(this.queryPagination||("esriGeometryPolyline"===a||"esriGeometryPolygon"===a||"esriGeometryMultipoint"===a||this.hasXYFootprint())&&f>=this.maxRecordCountForAuto||"esriGeometryPoint"===a&&f>=this.maxPointCountForAuto)&&
(this.currentMode=H.MODE_SNAPSHOT,this._mode=new X(this),this._autoSnapshot=!0)},_evalFetchMode:function(b){this.loaded&&(b&&this.isFeatureReductionEnabled()&&this._canCluster(b)?this._switchToSnapshotMode():this._switchToNormalMode())},_switchToSnapshotMode:function(){if(null==this._savedMode){var b=this.currentMode;b!==H.MODE_SNAPSHOT&&b!==H.MODE_STREAM&&b!==H.MODE_SELECTION&&(this._savedMode=this.mode,this._mode.suspend(),this._mode.destroy(),this.mode=this.currentMode=H.MODE_SNAPSHOT,this._mode=
new X(this),this.queryPagination=this._optQueryPagination&&this.advancedQueryCapabilities.supportsPagination,this.clearSelection(),(b=this.getMap())&&b.loaded&&(this._mode.initialize(b),this._mode.startup()))}},_switchToNormalMode:function(){if(null!=this._savedMode){this._mode.suspend();this._mode.destroy();this.mode=this._savedMode;this._savedMode=null;this.currentMode=H.MODE_ONDEMAND;this._mode=new Y(this);this.queryPagination=!1;this.clearSelection();var b=this.getMap();b&&b.loaded&&(this._mode.initialize(b),
this._mode.startup())}},_queryLimit:function(){var b=this,a=new d;this._limitPromise=a.promise;this._limitPromise.then(function(a){b._checkMode(a)});this._limitPromise.always(function(){b._limitPromise=null});setTimeout(function(){var f=new M,c=new U;c.statisticType="exceedslimit";c.maxPointCount=b.maxPointCountForAuto;c.maxRecordCount=b.maxRecordCountForAuto;c.maxVertexCount=b.maxVertexCountForAuto;c.outStatisticFieldName="exceedslimit";f.outStatistics=[c];b.queryFeatures(f).promise.then(function(b){a.resolve(b)},
function(b){a.reject(b)})},0)},_updateCaps:function(){var b=this._editable,a=h.trim(this.capabilities||""),f=e.map(a?a.split(","):[],h.trim),c=e.map(a?a.toLowerCase().split(","):[],h.trim),a=e.indexOf(c,"editing"),q,c={Create:e.indexOf(c,"create"),Update:e.indexOf(c,"update"),Delete:e.indexOf(c,"delete")};if(b&&-1===a)f.push("Editing");else if(!b&&-1<a){b=[a];for(q in c)-1<c[q]&&b.push(c[q]);b.sort();for(q=b.length-1;0<=q;q--)f.splice(b[q],1)}this.capabilities=f.join(",")},_counter:{value:0},_getUniqueId:function(){return this._counter.value++},
onSuspend:function(){this.inherited(arguments);this._toggleTime(!1);var b=this._mode;b&&b.suspend()},onResume:function(b){this.inherited(arguments);this._toggleTime(!0);var a=this._map,f=this._getRenderer();if(b.firstOccurrence){if(this._fixRendererFields(),this._updateRequiredFieldsFromLabelingInfo(),this._checkFields(),this.clearSelection(),this._evalFeatureReduction(),this.timeInfo&&!this._trackManager&&(this._trackIdField||f&&(f.latestObservationRenderer||f.trackRenderer))&&(this._trackManager=
new Z(this),this._trackManager.initialize(a),this._childLayer=this._trackManager.container),f&&"colors"in f&&"blurRadius"in f&&"maxPixelIntensity"in f&&"esriGeometryPoint"==this.geometryType&&!this._heatmapManager&&(this._heatmapManager=new aa(this),this._heatmapManager.initialize(a)),this._autoSnapshot&&this._autoGeneralize&&("esriGeometryPolyline"===this.geometryType||"esriGeometryPolygon"===this.geometryType||this.hasXYFootprint())&&!this.isEditable()&&null==this.getMaxAllowableOffset()&&(f=this.generalizeForScale,
this._calculatedScale=f=this.maxScale?this.maxScale:this.minScale?Math.min(f,this.minScale):Math.min(f,K.getScale(a,this.initialExtent)),this._calcMaxOffset=a.extent.getWidth()/a.width/a.getScale()*f),this._zoomConnect=m.connect(a,"onZoomEnd",this,this._zoomEndHandler),this._updateMaxOffset(),this._needsRefresh=!1,f=this._mode)f._init||f.initialize(a),f.startup()}else this._zoomEndHandler(),this._mode&&this._mode.resume()},_zoomEndHandler:function(){var b=this._map;this._updateMaxOffset();this._prevScale=
b.getScale();!this.suspended&&this._needsRefresh&&this.refresh()},_updateMaxOffset:function(){var b=this._map;b&&b.loaded&&this._autoGeneralize&&(this._autoSnapshot?(b=this.getMaxAllowableOffset(),this._setMaxOffset(this._getMaxOffsetForScale(),!0),this._needsRefresh||(this._needsRefresh=b!=this.getMaxAllowableOffset())):this._setMaxOffset(b.extent.getWidth()/b.width,!b.extent.spatialReference.isWebMercator()))},_getMaxOffsetForScale:function(){if(this._map){var b=this._map.getScale(),a=this._calculatedScale,
f=this._calcMaxOffset,c=this._prevScale;return b>=a&&(null==c||c<a)?f:b<a&&(null==c||c>=a)?null:this.getMaxAllowableOffset()}},_toggleTime:function(b){var a=this._map;b&&this.timeInfo&&this.useMapTime&&a?(this._mapTimeExtent=a.timeExtent,this._timeConnect||(this._timeConnect=m.connect(a,"onTimeExtentChange",this,this._timeChangeHandler))):(this._mapTimeExtent=null,m.disconnect(this._timeConnect),this._timeConnect=null)},_timeChangeHandler:function(b){this._mapTimeExtent=b;(b=this._mode)&&b.propertyChangeHandler(0)},
_getOffsettedTE:function(b){var a=this._timeOffset,f=this._timeOffsetUnits;return b&&a&&f?b.offset(-1*a,f):b},_getTimeOverlap:function(b,a){return b&&a?b.intersection(a):b||a},_getTimeFilter:function(b){var a=this.getTimeDefinition(),f;if(a&&(f=this._getTimeOverlap(a,null),!f))return[!1];if(b){if(b=f?this._getTimeOverlap(b,f):b,!b)return[!1]}else b=f;return[!0,b]},_getAttributeFilter:function(b){var a=this.getDefinitionExpression();return b?a?"("+a+") AND ("+b+")":b:a},_applyQueryFilters:function(b,
a){b.where=this._getAttributeFilter(b.where);b.returnGeometry&&null==b.maxAllowableOffset&&!b.quantizationParameters&&(b.maxAllowableOffset=this._maxOffset,b.quantizationParameters=this._quantizationParameters);a&&this.supportsAdvancedQueries&&(b.orderByFields=b.orderByFields||this.getOrderByFields());if(this.timeInfo){var f=this._getTimeFilter(b.timeExtent);if(f[0])b.timeExtent=f[1];else return!1}return!0},_add:function(b){var a=this._selectionSymbol,f=b.attributes,c=this.visibilityField;a&&this._isSelOnly&&
b.setSymbol(a);if(c&&f&&f.hasOwnProperty(c))b[f[c]?"show":"hide"]();return this.add.apply(this,arguments)},_remove:function(){return this.remove.apply(this,arguments)},_canDoClientSideQuery:function(b){var a=[],f=this._map,c;if((this._collection||!this._isTable&&f)&&!(b.text||b.where&&b.where!==this.getDefinitionExpression()||b.orderByFields&&b.orderByFields.length&&(c=this.getOrderByFields()||[])&&b.orderByFields.join()!==c.join()||b.outStatistics||b.returnDistinctValues)){c=this._isSnapshotMode();
var q=this._isSelOnly,d=b.geometry;if(d){if(q||b.spatialRelationship!==M.SPATIAL_REL_INTERSECTS||"extent"!==d.type||!c&&!f.extent.contains(d))return;a.push(1)}if(f=b.objectIds)if(c)a.push(2);else{var d=f.length,u=this._mode,l=0,t;for(t=0;t<d;t++)u._getFeature(f[t])&&l++;if(l===d)a.push(2);else return}if(this.timeInfo)if(b=b.timeExtent,f=this._mapTimeExtent,c)b&&a.push(3);else if(q){if(b)return}else if(f)if(-1!==e.indexOf(a,2))b&&a.push(3);else if(-1!==e.indexOf(a,1))b==f&&a.push(3);else return;else if(0<
a.length)b&&a.push(3);else if(b)return;return 0<a.length?a:null}},_getAbsMid:function(b){return r.toAbsMid?r.toAbsMid(b):n.id.replace(/\/[^\/]*$/ig,"/")+b},_doQuery:function(b,a,f){var c=[],q=this.objectIdField,u=this,l=new d,t=new d,g=this.graphics;if(-1!==e.indexOf(a,1)){var v=this.spatialIndex||this._map&&this._map.spatialIndex,k,A=b.geometry._normalize(null,!0);null==v&&ga.autoSpatialIndexing?k=(this._map||this).addPlugin(this._getAbsMid("../plugins/spatialIndex")).then(h.hitch(this,h.partial(this._getFromIndex,
A,v)),function(b){t.resolve(h.hitch(this,h.partial(this._filterByExtent,g,A)))}):v&&(k=this._getFromIndex(A,v));k?k.then(function(b){for(var a=0;a<b.length;a++)b[a].results&&(c=c.concat(b[a].results));t.resolve(c)}).otherwise(function(b){t.reject(b)}):t.resolve(this._filterByExtent(g,A))}else t.resolve(g);t.then(function(d){c=d;if(-1!==e.indexOf(a,2)){var t=b.objectIds;c=e.filter(c,function(b){return-1<e.indexOf(t,b.attributes[q])})}-1!==e.indexOf(a,3)&&u.timeInfo&&(d=b.timeExtent,c=u._filterByTime(c,
d.startTime,d.endTime).match);f&&(c=e.map(c,function(b){return b.attributes[q]},this));l.resolve(c)});return l},_getFromIndex:function(b,a){a=a||this.spatialIndex||this._map.spatialIndex;b instanceof Array||(b=[b]);var c=this.id;return f(e.map(b,function(b){return a.intersects(b,c)}))},_filterByExtent:function(b,a){for(var f=[],c=0,q=b.length;c<q;c++){var d=b[c],u=d.geometry;u&&(this.normalization&&a.length?(a[0].intersects(u)||a[1].intersects(u))&&f.push(d):a.intersects(u)&&f.push(d))}return f},
_filterByTime:function(b,a,f){var c=this._startTimeField,d=this._endTimeField,u;this._twoTimeFields||(u=c||d);var l=q.isDefined,t=[],g=[],e,v=b.length,k,h;a=a?a.getTime():-Infinity;f=f?f.getTime():Infinity;if(u)for(e=0;e<v;e++)k=b[e],h=k.attributes,c=h[u],c>=a&&c<=f?t.push(k):g.push(k);else for(e=0;e<v;e++)k=b[e],h=k.attributes,u=h[c],h=h[d],u=l(u)?u:-Infinity,h=l(h)?h:Infinity,u>=a&&u<=f||h>=a&&h<=f||a>=u&&f<=h?t.push(k):g.push(k);return{match:t,noMatch:g}},_getSizeVariables:function(b){return b&&
e.filter(b.getVisualVariablesForType("sizeInfo",!1),function(b){return!(!b.field&&!b.valueExpression)})},_needClientSideSorting:function(b){return this._collection?!(!b||!b.length):e.some(b,function(b){return!!b.valueExpression})},_sortFeatures:function(b){var a=this.renderer,f=this._getSizeVariables(a);if(b&&1<b.length&&this._needClientSideSorting(f)){var c=f[0],q=this;b.sort(function(b,f){b._layer||(b._layer=q);f._layer||(f._layer=q);var d=a._getDataValue(b,c,"sizeInfo",null,q),u=a._getDataValue(f,
c,"sizeInfo",null,q);return null==d?-1:null==u?1:u-d})}return b},_resolve:function(b,a,f,c,q){a&&this[a].apply(this,b);f&&f.apply(null,b);c&&y._resDfd(c,b,q)},_getShallowClone:function(b){var a=new M,f;for(f in b)b.hasOwnProperty(f)&&(a[f]=b[f]);return a},_query:function(b,a,f,c,q){var u=this,l=this._map,t=new d(y._dfdCanceller),g=f,k,h,A;if("executeRelationshipQuery"!==b){var g=this._getShallowClone(f),w=this.getOutFields();g.outFields||(g.outFields=w);g.outFields&&g.outFields.length&&(h=-1<e.indexOf(w,
"*")?!1:!e.every(g.outFields,function(b){return-1<e.indexOf(w,b)}));g.returnGeometry=f.hasOwnProperty("returnGeometry")?f.returnGeometry:!f.outStatistics;g.returnGeometry&&(g.multipatchOption=this.multipatchOption,null!=g.maxAllowableOffset||g.quantizationParameters)&&(f=null!=g.maxAllowableOffset?g.maxAllowableOffset:g.quantizationParameters.tolerance,null!=f&&f!==this.getMaxAllowableOffset()&&(A=!0));var z;l&&(l=l&&l.spatialReference,(f=g.outSpatialReference)?k=!f.equals(l):g.outSpatialReference=
new x(l.toJson()));if(!this._applyQueryFilters(g,"execute"===b&&!g.outStatistics)){switch(b){case "execute":z=new P({features:[]});break;case "executeForIds":z=[];break;case "executeForCount":z=0;break;case "executeForExtent":z={}}this._resolve([z],a,c,t);return t}if(l="executeForExtent"!==b&&!k&&!h&&!A&&this._canDoClientSideQuery(g))return t._pendingDfd=v(this._doQuery(g,l,"executeForIds"===b||"executeForCount"===b)),t._pendingDfd.then(function(f){switch(b){case "execute":z=new P;z.features=f;break;
case "executeForIds":z=f;break;case "executeForCount":z=f.length}u._resolve([z],a,c,t)}),t}if(this._collection)return this._resolve([Error("FeatureLayer::_query - "+this.invalidParams)],null,q,t,!0),t;if(this.loaded&&!this.isQueryable())return this._resolve([Error("Layer does not support query capability.")],null,q,t,!0),t;this._ts&&(g._ts=(new Date).getTime());(t._pendingDfd=this._task[b](g)).addCallbacks(function(f){var q=!!g.outStatistics||k||h||A;if("execute"===b||"executeRelationshipQuery"===
b){var d,l;if("execute"===b)for(d=f.features,l=d.length,--l;0<=l;l--){if(d[l]._layer=u,!q&&!u._isTable){var e=u._mode._getFeature(d[l].attributes[u.objectIdField]);e&&d.splice(l,1,e)}}else for(e in f)if(f.hasOwnProperty(e))for(d=f[e].features,l=d.length,--l;0<=l;l--)d[l]._layer=u}u._resolve([f],a,c,t)},function(b){u._resolve([b],null,q,t,!0)});return t},_convertFeaturesToJson:function(b,a,f,c){var q=[],d=this._selectionSymbol,u=this.visibilityField,l,t=this.objectIdField;this.loaded&&(f||c)&&(l=e.filter(this.fields,
function(b){return!1===b.editable&&(!c||b.name!==t)}));for(f=0;f<b.length;f++){var g=b[f],v={},A=g.geometry,w=g.attributes,x=g.symbol;!A||c&&this.loaded&&!this.allowGeometryUpdates||(v.geometry=A.toJson());u?(v.attributes=w=h.mixin({},w),w[u]=g.visible?1:0):w&&(v.attributes=h.mixin({},w));v.attributes&&l&&l.length&&e.forEach(l,function(b){delete v.attributes[b.name]});x&&x!==d&&(v.symbol=x.toJson());q.push(v)}return a?q:k.toJson(q)},_selectHandler:function(b,a,f,c,q){var d;switch(a){case H.SELECTION_NEW:this.clearSelection(!0);
d=!0;break;case H.SELECTION_ADD:d=!0;break;case H.SELECTION_SUBTRACT:d=!1}c=b.features;var u=this._mode,l=[],t=this.objectIdField,g,e;if(d)for(d=0;d<c.length;d++)g=c[d],e=g.attributes[t],g=u._addFeatureIIf(e,g),l.push(g),this._selectFeatureIIf(e,g,u);else for(d=0;d<c.length;d++)g=c[d],e=g.attributes[t],this._unSelectFeatureIIf(e,u),e=u._removeFeatureIIf(e),l.push(e||g);this._isSelOnly&&u._applyTimeFilter(!0);this._hasPartialSelectedFeatures=!!b.exceededTransferLimit;this._resolve([l,a,b.exceededTransferLimit?
{queryLimitExceeded:!0}:null],"onSelectionComplete",f,q);if(b.exceededTransferLimit)this.onQueryLimitExceeded()},_selectFeatureIIf:function(b,a,f){var c=this._selectedFeatures,q=c[b];q||(f._incRefCount(b),c[b]=a,this._isTable||(this._setSelectSymbol(a),a.attr("data-selected","")));return q||a},_unSelectFeatureIIf:function(b,a){var f=this._selectedFeatures[b];f&&(a._decRefCount(b),delete this._selectedFeatures[b],this._isTable||(this._setUnSelectSymbol(f),f.attr("data-selected")));return f},_isSelected:function(b){},
_setSelectSymbol:function(b){var a=this._selectionSymbol;a&&!this._isSelOnly&&b.setSymbol(a)},_setUnSelectSymbol:function(b){var a=this._selectionSymbol;a&&!this._isSelOnly&&a===b.symbol&&b.setSymbol(null,!0)},_getOutFields:function(){var b=[this.objectIdField,this.typeIdField,this.creatorField,this._startTimeField,this._endTimeField,this._trackIdField].concat(this._requiredFields).concat(this.dataAttributes),b=e.filter(b,function(b,a,f){return!!b&&e.indexOf(f,b)===a}),a=h.clone(this._outFields);
if(a){if(-1!==e.indexOf(a,"*"))return a;e.forEach(b,function(b){-1===e.indexOf(a,b)&&a.push(b)});return a}return b},_checkFields:function(b){var a=b||this._getOutFields();e.forEach(a,function(b){"*"!==b&&(this._getField(b)||console.debug("esri.layers.FeatureLayer: "+q.substitute({url:this.url,field:b},"unable to find '${field}' field in the layer 'fields' information [url: ${url}]")))},this);b||this._isTable||this._fserver||this._collection||this._isStream||e.some(this.fields,function(b){return b&&
"esriFieldTypeGeometry"===b.type?!0:!1})||console.debug("esri.layers.FeatureLayer: "+q.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}]"))},_fixFieldCase:function(b,a,f){var c=b&&b[a],q;if(c&&!h.isFunction(c)){if(q=!this._getField(c)&&this._getField(c,!0))c=b[a]=q.name;f&&f.push(c)}return c},_fixRendererFields:function(){var b=this.renderer;this._orderBy=
null;this._requiredFields=[];if(b&&0<this.fields.length){var a=[],f,b=e.filter([b,b.observationRenderer,b.latestObservationRenderer,b.trackRenderer],q.isDefined),c=[].concat(b);e.forEach(b,function(b){e.forEach(b.rendererInfos,function(b){b.renderer&&c.push(b.renderer)})});e.forEach(c,function(b){this._fixFieldCase(b,"attributeField",a);this._fixFieldCase(b,"attributeField2",a);this._fixFieldCase(b,"attributeField3",a);this._fixFieldCase(b.rotationInfo,"field",a);(f=this._fixFieldCase(b.sizeInfo,
"field",a))&&!this._orderBy&&(this._orderBy=[f+" DESC"]);this._fixFieldCase(b.sizeInfo,"normalizationField",a);this._fixFieldCase(b.colorInfo,"field",a);this._fixFieldCase(b.colorInfo,"normalizationField",a);this._fixFieldCase(b.field,"field",a);this._fixFieldCase(b.opacityInfo,"field",a);this._fixFieldCase(b.opacityInfo,"normalizationField",a);e.forEach(b.visualVariables,function(b){f=this._fixFieldCase(b,"field",a);"sizeInfo"===b.type&&f&&!this._orderBy&&(this._orderBy=[f+" DESC"]);this._fixFieldCase(b,
"normalizationField",a)},this);var c=e.map(b.getFieldsUsedInExpressions(),function(b){var a=this.getField(b);return a?a.name:b},this);a=a.concat(c);this._orderBy||!b.addBreak||h.isFunction(b.attributeField)||!b.backgroundFillSymbol&&!this._hasSizeDiff(b)||(this._orderBy=[b.attributeField+" DESC"])},this);this._requiredFields=e.filter(a,q.isDefined)}},_hasSizeDiff:function(b){var a=Number.MAX_VALUE,f=-Number.MAX_VALUE,c,q;e.forEach(b.infos,function(b){if(q=b.symbol){c=0;switch(q.type){case "simplemarkersymbol":c=
q.size;break;case "picturemarkersymbol":c=(q.width+q.height)/2;break;case "simplelinesymbol":case "cartographiclinesymbol":c=q.width;break;case "simplefillsymbol":case "picturefillsymbol":c=q.outline&&q.outline.width}c&&(a=Math.min(a,c),f=Math.max(f,c))}});return a!==Number.MAX_VALUE&&f!==-Number.MAX_VALUE&&1<Math.abs(f-a)},getOrderByFields:function(){var b=this.orderByFields||this._orderBy;return this.supportsAdvancedQueries&&b?e.filter(b,function(b){b=b.split(" ")[0];return!!this._getField(b,!0)},
this):null},_getField:function(b,a){var f=this.fields;if(!f||0===f.length)return null;var c;a&&(b=b.toLowerCase());e.some(f,function(f){var q=!1;(q=a?f&&f.name.toLowerCase()===b?!0:!1:f&&f.name===b?!0:!1)&&(c=f);return q});return c},_getDateOpts:function(){this._dtOpts||(this._dtOpts={properties:e.map(e.filter(this.fields,function(b){return!(!b||"esriFieldTypeDate"!==b.type)}),function(b){return b.name})});return this._dtOpts},_applyNormalized:function(b,a){b&&a&&e.forEach(b,function(b,f){b&&a[f]&&
b.setGeometry(a[f])})},_editHandler:function(b,a,f,c,q,d){q=b.addResults;var u=b.updateResults;b=b.deleteResults;var l,t,g,v,k,A=this.objectIdField,w=this._mode,x=this._isTable;l=this.editFieldsInfo;v=this.getOutFields()||[];var z=l&&l.creatorField,m=l&&l.creationDateField,y=l&&l.editorField,C=l&&l.editDateField;l=l&&l.realm;-1===e.indexOf(v,"*")&&(z&&-1===e.indexOf(v,z)&&(z=null),m&&-1===e.indexOf(v,m)&&(m=null),y&&-1===e.indexOf(v,y)&&(y=null),C&&-1===e.indexOf(v,C)&&(C=null));var n=m||C?(new Date).getTime():
null,p=z||y?this.getUserId():void 0;p&&l&&(p=p+"@"+l);if(q){var N=this.globalIdField;for(l=0;l<q.length;l++)q[l]=new T(q[l]),x||(t=q[l],t.success&&(g=t.objectId,v=a[l],(k=v._graphicsLayer)&&k!==this&&k.remove(v),k=v.attributes||{},k[A]=g,g=t.globalId,N&&g&&(k[N]=g),z&&(k[z]=p),y&&(k[y]=p),m&&(k[m]=n),C&&(k[C]=n),v.setAttributes(k),w._init&&w.drawFeature(v)))}if(u)for(l=0;l<u.length;l++)if(u[l]=new T(u[l]),!x&&(t=u[l],t.success)){g=t.objectId;v=f[g];if(a=w._getFeature(g))a.geometry!==v.geometry&&v.geometry&&
a.setGeometry(W.fromJson(v.geometry.toJson())),a.attributes!==v.attributes&&v.attributes&&a.setAttributes(h.mixin(a.attributes,v.attributes)),this._repaint(a,g);v=a||v;k=v.attributes||{};y&&(k[y]=p);C&&(k[C]=n);v.setAttributes(k)}if(b){f=[];for(l=0;l<b.length;l++)if(b[l]=new T(b[l]),!x&&(t=b[l],t.success&&(g=t.objectId,v=w._getFeature(g))))this._unSelectFeatureIIf(g,w)&&f.push(v),v._count=0,w._removeFeatureIIf(g);if(0<f.length)this.onSelectionComplete(f,H.SELECTION_SUBTRACT)}this._resolve([q,u,b],
"onEditsComplete",c,d)},_sendAttachment:function(b,a,f,c,q){var d=this;return u({url:this._url.path+"/"+a+"/"+("add"===b?"addAttachment":"updateAttachment"),form:f,content:h.mixin(this._url.query,{f:"json",token:this._getToken()||void 0}),callbackParamName:"callback.html",handleAs:"json"}).addCallback(function(f){var q="add"===b?"onAddAttachmentComplete":"onUpdateAttachmentComplete";f=new T(f["add"===b?"addAttachmentResult":"updateAttachmentResult"]);f.attachmentId=f.objectId;f.objectId=a;d._resolve([f],
q,c);return f}).addErrback(function(b){d._resolve([b],null,q,null,!0)})},_repaint:function(b,a,f){a=q.isDefined(a)?a:b.attributes[this.objectIdField];a in this._selectedFeatures&&this._selectionSymbol||b.setSymbol(b.symbol,f)},_getKind:function(b){var a=this._trackManager;return a?a.isLatestObservation(b)?1:0:0}});h.mixin(H,{MODE_SNAPSHOT:0,MODE_ONDEMAND:1,MODE_SELECTION:2,SELECTION_NEW:3,SELECTION_ADD:4,SELECTION_SUBTRACT:5,MODE_AUTO:6,MODE_STREAM:7,POPUP_NONE:"esriServerHTMLPopupTypeNone",POPUP_HTML_TEXT:"esriServerHTMLPopupTypeAsHTMLText",
POPUP_URL:"esriServerHTMLPopupTypeAsURL"});R._createWrappers(H);c("extend-esri")&&h.setObject("layers.FeatureLayer",H,b);return H})},"esri/promiseList":function(){define(["dojo/_base/array","dojo/Deferred","dojo/when"],function(r,n,p){var m=r.forEach;return function(h){function e(a,f){g[f]=a;l.progress([a,f]);0===--t&&l.resolve(g)}var k,d;h instanceof Array?d=h:h&&"object"===typeof h&&(k=h);var g,c=[];if(k){d=[];for(var a in k)Object.hasOwnProperty.call(k,a)&&(c.push(a),d.push(k[a]));g={}}else d&&
(g=[]);if(!d||!d.length)return(new n).resolve(g);var l=new n;l.promise.always(function(){g=c=null});var t=d.length;m(d,function(a,f){k||c.push(f);p(a,function(b){l.isFulfilled()||e(b,c[f])},function(b){l.isFulfilled()||e(b,c[f])})});return l.promise}})},"esri/tasks/QueryTask":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/Deferred dojo/_base/json dojo/has ../kernel ../request ../deferredUtils ../geometry/Extent ../geometry/normalizeUtils ./Task ./FeatureSet".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t){r=r(l,{declaredClass:"esri.tasks.QueryTask",_eventMap:{complete:["featureSet"],"execute-for-count-complete":["count"],"execute-for-ids-complete":["objectIds"],"execute-relationship-query-complete":["featureSets"]},constructor:function(a,f){this._handler=n.hitch(this,this._handler);this._relationshipQueryHandler=n.hitch(this,this._relationshipQueryHandler);this._executeForIdsHandler=n.hitch(this,this._executeForIdsHandler);this._countHandler=n.hitch(this,this._countHandler);
this._extentHandler=n.hitch(this,this._extentHandler);this.source=f&&f.source;this.gdbVersion=f&&f.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},{n:"executeForExtent",c:3,a:[{i:0,p:["geometry"]}],e:2}],onComplete:function(){},onExecuteRelationshipQueryComplete:function(){},onExecuteForIdsComplete:function(){},onExecuteForCountComplete:function(){},
onExecuteForExtentComplete:function(){},execute:function(a,f,b,c,l){c=l.assembly;a=this._encode(n.mixin({},this._url.query,{f:"json"},a.toJson(c&&c[0])));var q=this._handler,u=this._errorHandler;this.source&&(c={source:this.source.toJson()},a.layer=h.toJson(c));this.gdbVersion&&(a.gdbVersion=this.gdbVersion);return d({url:this._url.path+"/query",content:a,callbackParamName:"callback",load:function(a,c){q(a,c,f,b,l.dfd)},error:function(a){u(a,b,l.dfd)}},this.requestOptions)},executeRelationshipQuery:function(a,
f,b){a=this._encode(n.mixin({},this._url.query,{f:"json"},a.toJson()));var c=this._relationshipQueryHandler,l=this._errorHandler;this.gdbVersion&&(a.gdbVersion=this.gdbVersion);var t=new m(g._dfdCanceller);t._pendingDfd=d({url:this._url.path+"/queryRelatedRecords",content:a,callbackParamName:"callback",load:function(a,q){c(a,q,f,b,t)},error:function(a){l(a,b,t)}},this.requestOptions);return t},executeForIds:function(a,f,b,c){var q=c.assembly;a=this._encode(n.mixin({},this._url.query,{f:"json",returnIdsOnly:!0},
a.toJson(q&&q[0])));var l=this._executeForIdsHandler,t=this._errorHandler;this.source&&(q={source:this.source.toJson()},a.layer=h.toJson(q));this.gdbVersion&&(a.gdbVersion=this.gdbVersion);return d({url:this._url.path+"/query",content:a,callbackParamName:"callback",load:function(a,q){l(a,q,f,b,c.dfd)},error:function(a){t(a,b,c.dfd)}},this.requestOptions)},executeForCount:function(a,f,b,c){var q=c.assembly;a=this._encode(n.mixin({},this._url.query,{f:"json",returnIdsOnly:!0,returnCountOnly:!0},a.toJson(q&&
q[0])));var l=this._countHandler,t=this._errorHandler;this.source&&(q={source:this.source.toJson()},a.layer=h.toJson(q));this.gdbVersion&&(a.gdbVersion=this.gdbVersion);return d({url:this._url.path+"/query",content:a,callbackParamName:"callback",load:function(a,q){l(a,q,f,b,c.dfd)},error:function(a){t(a,b,c.dfd)}},this.requestOptions)},executeForExtent:function(a,f,b,c){var q=c.assembly;a=this._encode(n.mixin({},this._url.query,{f:"json",returnExtentOnly:!0,returnCountOnly:!0},a.toJson(q&&q[0])));
var l=this._extentHandler,t=this._errorHandler;this.source&&(q={source:this.source.toJson()},a.layer=h.toJson(q));this.gdbVersion&&(a.gdbVersion=this.gdbVersion);return d({url:this._url.path+"/query",content:a,callbackParamName:"callback",load:function(a,q){l(a,q,f,b,c.dfd)},error:function(a){t(a,b,c.dfd)}},this.requestOptions)},_handler:function(a,f,b,c,l){try{var q=new t(a);this._successHandler([q],"onComplete",b,l)}catch(y){this._errorHandler(y,c,l)}},_relationshipQueryHandler:function(a,f,b,c,
l){try{var q=a.geometryType,d=a.spatialReference,u={};p.forEach(a.relatedRecordGroups,function(b){var a={};a.geometryType=q;a.spatialReference=d;a.features=b.relatedRecords;a=new t(a);if(null!=b.objectId)u[b.objectId]=a;else for(var f in b)b.hasOwnProperty(f)&&"relatedRecords"!==f&&(u[b[f]]=a)});this._successHandler([u],"onExecuteRelationshipQueryComplete",b,l)}catch(x){this._errorHandler(x,c,l)}},_executeForIdsHandler:function(a,f,b,c,l){try{this._successHandler([a.objectIds],"onExecuteForIdsComplete",
b,l)}catch(A){this._errorHandler(A,c,l)}},_countHandler:function(a,f,b,c,l){try{var q,d=a.features,u=a.objectIds;if(u)q=u.length;else{if(d)throw Error("Unable to perform query. Please check your parameters.");q=a.count}this._successHandler([q],"onExecuteForCountComplete",b,l)}catch(x){this._errorHandler(x,c,l)}},_extentHandler:function(a,f,b,q,l){try{a.extent&&(a.extent=new c(a.extent)),this._successHandler([a],"onExecuteForExtentComplete",b,l)}catch(A){this._errorHandler(A,q,l)}}});a._createWrappers(r);
e("extend-esri")&&n.setObject("tasks.QueryTask",r,k);return r})},"esri/tasks/Task":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../deferredUtils ../urlUtils ../Evented".split(" "),function(r,n,p,m,h,e,k,d){r=r(d,{declaredClass:"esri.tasks._Task",_eventMap:{error:["error"],complete:["result"]},constructor:function(d,c){d&&n.isString(d)&&(this._url=k.urlToObject(this.url=d));c&&c.requestOptions&&(this.requestOptions=c.requestOptions);this.normalization=!0;
this._errorHandler=n.hitch(this,this._errorHandler);this.registerConnectEvents()},_useSSL:function(){var d=this._url,c=/^http:/i;this.url&&(this.url=this.url.replace(c,"https:"));d&&d.path&&(d.path=d.path.replace(c,"https:"))},_encode:function(d,c,a){var l,t,g={},f,b;for(f in d)if("declaredClass"!==f&&(l=d[f],t=typeof l,null!==l&&void 0!==l&&"function"!==t))if(n.isArray(l))for(g[f]=[],b=l.length,t=0;t<b;t++)g[f][t]=this._encode(l[t]);else"object"===t?l.toJson&&(t=l.toJson(a&&a[f]),"esri.tasks.FeatureSet"===
l.declaredClass&&t.spatialReference&&(t.sr=t.spatialReference,delete t.spatialReference),g[f]=c?t:p.toJson(t)):g[f]=l;return g},_successHandler:function(d,c,a,l){c&&this[c].apply(this,d);a&&a.apply(null,d);l&&e._resDfd(l,d)},_errorHandler:function(d,c,a){this.onError(d);c&&c(d);a&&a.errback(d)},setNormalization:function(d){this.normalization=d},onError:function(){}});m("extend-esri")&&(h.Task=r);return r})},"esri/tasks/FeatureSet":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../kernel ../lang ../graphic ../SpatialReference ../graphicsUtils ../geometry/jsonUtils ../symbols/jsonUtils".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a){r=r(null,{declaredClass:"esri.tasks.FeatureSet",constructor:function(l){if(l){n.mixin(this,l);var t=this.features,g=l.spatialReference,f=c.getGeometryType(l.geometryType),g=this.spatialReference=new d(g);this.geometryType=l.geometryType;l.fields&&(this.fields=l.fields);p.forEach(t,function(b,c){var q=b.geometry&&b.geometry.spatialReference;t[c]=new k(f&&b.geometry?new f(b.geometry):null,b.symbol&&a.fromJson(b.symbol),b.attributes);t[c].geometry&&!q&&t[c].geometry.setSpatialReference(g)});
this._hydrate()}else this.features=[]},displayFieldName:null,geometryType:null,spatialReference:null,fieldAliases:null,toJson:function(a){var d={};this.displayFieldName&&(d.displayFieldName=this.displayFieldName);this.fields&&(d.fields=this.fields);this.spatialReference?d.spatialReference=this.spatialReference.toJson():this.features[0]&&this.features[0].geometry&&(d.spatialReference=this.features[0].geometry.spatialReference.toJson());this.features[0]&&(this.features[0].geometry&&(d.geometryType=
c.getJsonType(this.features[0].geometry)),d.features=g._encodeGraphics(this.features,a));d.geometryType=d.geometryType||this.geometryType;d.exceededTransferLimit=this.exceededTransferLimit;d.transform=this.transform;return e.fixJson(d)},_hydrate:function(){var a=this.transform,c=this.geometryType;if(a&&c)for(var d=this.features,f=a.translate[0],b=a.translate[1],q=a.scale[0],u=a.scale[1],g=function(b,a,f){if("esriGeometryPoint"===b)return function(b){b.x=a(b.x);b.y=f(b.y)};if("esriGeometryPolyline"===
b||"esriGeometryPolygon"===b)return function(b){b=b.rings||b.paths;var c,d,q,l,u,t,g,e;c=0;for(d=b.length;c<d;c++)for(u=b[c],q=0,l=u.length;q<l;q++)t=u[q],0<q?(g+=t[0],e+=t[1]):(g=t[0],e=t[1]),t[0]=a(g),t[1]=f(e)};if("esriGeometryEnvelope"===b)return function(b){b.xmin=a(b.xmin);b.ymin=f(b.ymin);b.xmax=a(b.xmax);b.ymax=f(b.ymax)};if("esriGeometryMultipoint"===b)return function(b){b=b.points;var c,d,q,l,u;c=0;for(d=b.length;c<d;c++)q=b[c],0<c?(l+=q[0],u+=q[1]):(l=q[0],u=q[1]),q[0]=a(l),q[1]=f(u)}}(c,
function(b){return b*q+f},function(a){return b-a*u}),a=0,c=d.length;a<c;a++)d[a].geometry&&g(d[a].geometry);this.transform=null},quantize:function(a){if(!this.geometryType)return this.transform=null,this;var c=a.translate[0],d=a.translate[1],f=a.scale[0],b=a.scale[1],q=this.features,l=function(b,a,f){var c,d,q,l,u,t,g=[];c=0;for(d=b.length;c<d;c++)if(q=b[c],0<c){if(t=a(q[0]),q=f(q[1]),t!==l||q!==u)g.push([t-l,q-u]),l=t,u=q}else l=a(q[0]),u=f(q[1]),g.push([l,u]);return 0<g.length?g:null},g=function(b,
a,f){if("esriGeometryPoint"===b)return function(b){b.x=a(b.x);b.y=f(b.y);return b};if("esriGeometryPolyline"===b||"esriGeometryPolygon"===b)return function(b){var c,q,d,u,t;d=b.rings||b.paths;t=[];c=0;for(q=d.length;c<q;c++)u=d[c],(u=l(u,a,f))&&t.push(u);return 0<t.length?(b.rings?b.rings=t:b.paths=t,b):null};if("esriGeometryMultipoint"===b)return function(b){var c;c=l(b.points,a,f);return 0<c.length?(b.points=c,b):null};if("esriGeometryEnvelope"===b)return function(b){return b}}(this.geometryType,
function(b){return Math.round((b-c)/f)},function(a){return Math.round((d-a)/b)}),e,k;e=0;for(k=q.length;e<k;e++)q[e].geometry&&(g(q[e].geometry)||q[e].setGeometry(null));this.transform=a;return this}});m("extend-esri")&&n.setObject("tasks.FeatureSet",r,h);return r})},"esri/tasks/StatisticDefinition":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(r,n,p,m){r=r(null,{declaredClass:"esri.tasks.StatisticDefinition",toJson:function(){return{statisticType:this.statisticType,
onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount}}});p("extend-esri")&&n.setObject("tasks.StatisticDefinition",r,m);return r})},"esri/layers/FeatureType":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../kernel ../lang ../symbols/jsonUtils ./RangeDomain ./CodedValueDomain ./InheritedDomain ./FeatureTemplate".split(" "),function(r,
n,p,m,h,e,k,d,g,c,a){r=r(null,{declaredClass:"esri.layers.FeatureType",constructor:function(l){if(l&&n.isObject(l)){this.id=l.id;this.name=l.name;var t=l.symbol;t&&(this.symbol=k.fromJson(t));var t=l.domains,e,f=this.domains={};for(e in t)if(t.hasOwnProperty(e)){var b=t[e];switch(b.type){case "range":f[e]=new d(b);break;case "codedValue":f[e]=new g(b);break;case "inherited":f[e]=new c(b)}}if(e=l.templates)for(t=this.templates=[],l=0;l<e.length;l++)t.push(new a(e[l]))}},toJson:function(){var a={id:this.id,
name:this.name,symbol:this.symbol&&this.symbol.toJson()},c,d=this.domains,f=this.templates,b=e.fixJson;if(d){var q=a.domains={};for(c in d)d.hasOwnProperty(c)&&(q[c]=d[c]&&d[c].toJson());b(q)}f&&(a.templates=p.map(f,function(b){return b.toJson()}));return b(a)}});m("extend-esri")&&n.setObject("layers.FeatureType",r,h);return r})},"esri/layers/FeatureTemplate":function(){define("dojo/_base/declare dojo/_base/lang dojo/has ../kernel ../lang ../graphic".split(" "),function(r,n,p,m,h,e){r=r(null,{declaredClass:"esri.layers.FeatureTemplate",
constructor:function(k){k&&n.isObject(k)&&(this.name=k.name,this.description=k.description,this.drawingTool=k.drawingTool,this.thumbnail=k.thumbnail,k=k.prototype,this.prototype=new e(k.geometry,null,k.attributes))},toJson:function(){return h.fixJson({name:this.name,description:this.description,drawingTool:this.drawingTool,thumbnail:h.fixJson(n.clone(this.thumbnail)),prototype:this.prototype&&this.prototype.toJson()})}});n.mixin(r,{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"});p("extend-esri")&&n.setObject("layers.FeatureTemplate",r,m);return r})},"esri/layers/FeatureEditResult":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(r,n,p,m){r=r(null,{declaredClass:"esri.layers.FeatureEditResult",constructor:function(h){h&&n.isObject(h)&&(this.objectId=h.objectId,this.globalId=h.globalId,this.success=h.success,h.success||(h=h.error,this.error=
Error(),this.error.code=h.code,this.error.message=h.description))}});p("extend-esri")&&n.setObject("layers.FeatureEditResult",r,m);return r})},"esri/layers/SnapshotMode":function(){define("dojo/_base/declare dojo/_base/lang dojo/has ../kernel ../SpatialReference ../srUtils ../tasks/query ./RenderMode ./support/ParallelSnapshot".split(" "),function(r,n,p,m,h,e,k,d,g){r=r([d],{declaredClass:"esri.layers._SnapshotMode",maxFeatures:5E4,constructor:function(c){this.featureLayer=c;this._featureMap={};this._hasPartialFeatures=
!1;this._drawFeatures=n.hitch(this,this._drawFeatures);this._queryErrorHandler=n.hitch(this,this._queryErrorHandler);this._handleSuccess=n.hitch(this,this._handleSuccess);this._handleError=n.hitch(this,this._handleError);this._handleProgress=n.hitch(this,this._handleProgress)},startup:function(){if(!this._started){this.inherited(arguments);var c=this.featureLayer,a=c.advancedQueryCapabilities,d=c.reHostedFS.test(c.url);this.pagination=c.queryPagination&&null!=c.maxRecordCount;this._tileQueriesAllowed=
d&&a&&a.supportsQueryWithResultType&&c.isFeatureReductionApplied();d&&this.pagination&&(this._parallelSnapshot=new g({layer:c,mode:this,queryTask:c._task}));c._collection?this._applyTimeFilter():this._fetchAll()}},propertyChangeHandler:function(c){this._init&&(c?this.featureLayer._collection?console.log("FeatureLayer: layer created by value (from a feature collection) does not support definition expressions and time definitions. Layer id \x3d "+this.featureLayer.id):this._fetchAll():this._applyTimeFilter())},
destroy:function(){this._cancelPendingRequest(this._pendingRequest);this._parallelSnapshot&&this._parallelSnapshot.destroy();this.inherited(arguments)},drawFeature:function(c){var a=c.attributes[this.featureLayer.objectIdField];this._addFeatureIIf(a,c);this._incRefCount(a)},resume:function(){this.propertyChangeHandler(0)},refresh:function(){var c=this.featureLayer;c._collection?(c._fireUpdateStart(),c._refresh(!0),c._fireUpdateEnd()):this._fetchAll()},hasAllFeatures:function(){return!this._hasPartialFeatures},
_fetchAll:function(){var c=this.featureLayer;c._collection||c.suspended||!c.isQueryable()||(c._fireUpdateStart(),this._clearIIf(),this._hasPartialFeatures=!1,this._parallelSnapshot?this._parallelSnapshot.fetch(this._createQuery()).then(this._handleSuccess,this._handleError,this._handleProgress):this._sendRequest())},_handleSuccess:function(c){this._hasPartialFeatures=c.hasPartialFeatures;this.featureLayer._fireUpdateEnd(null)},_handleError:function(c){this._queryErrorHandler(c)},_handleProgress:function(c){c.isError?
this.featureLayer._errorHandler(c.error):this._addFeatures(c.features)},_sendRequest:function(c){var a=this.featureLayer,d=this._createQuery();this.pagination&&(this._start=d.start=null==c?0:c,d.num=a.maxRecordCount);this._pendingRequest&&this._cancelPendingRequest(this._pendingRequest);this._pendingRequest=a._task.execute(d,this._drawFeatures,this._queryErrorHandler)},_drawFeatures:function(c){this._pendingRequest=null;var a=this.featureLayer,d=c.exceededTransferLimit,t=d&&!a._collection;c=this._checkMaxLimit(c.features);
var g=c.maxLimitReached;this._addFeatures(c.features);this.pagination&&t&&!g||(this._hasPartialFeatures=!!d,a._fireUpdateEnd(null,d?{queryLimitExceeded:!0}:null));t&&(this.pagination&&!g&&this._sendRequest(this._start+a.maxRecordCount),a.onQueryLimitExceeded())},_queryErrorHandler:function(c){this._pendingRequest=null;this._hasPartialFeatures=!0;var a=this.featureLayer;a._errorHandler(c);a._fireUpdateEnd(c)},_checkMaxLimit:function(c){var a=c?c.length:0,d=this.featureLayer.graphics.length+a,t=d>=
this.maxFeatures;if(t){var g=d-this.maxFeatures;g&&c.splice(a-g,g)}return{maxLimitReached:t,featuresDiscarded:d>this.maxFeatures,features:c}},_createQuery:function(){var c=this.featureLayer,a=new k;a.outFields=c.getOutFields();a.where=c.getDefinitionExpression()||"1\x3d1";a.returnGeometry=!0;a.outSpatialReference=e.createSpatialReference(this.map.spatialReference.toJson());a.timeExtent=c.getTimeDefinition();a.maxAllowableOffset=c._maxOffset;a.quantizationParameters=c._quantizationParameters;a.orderByFields=
c.supportsAdvancedQueries?c.getOrderByFields():null;a.multipatchOption=c.multipatchOption;c._ts&&(a._ts=(new Date).getTime());this._tileQueriesAllowed&&(a.resultType="tile");return a},_addFeatures:function(c){var a=this.featureLayer,d=a.objectIdField,t=c.length,g=a._selectedFeatures,f=a.mode===a.constructor.MODE_AUTO,b,q,u;a._fireUpdateStart();a._sortFeatures(c);for(a=0;a<t;a++)q=c[a],u=q.attributes[d],b=this._addFeatureIIf(u,q),this._incRefCount(u),f&&b!==q&&g[u]&&(b.setGeometry(q.geometry),b.setAttributes(q.attributes));
this._applyTimeFilter(!0)}});p("extend-esri")&&n.setObject("layers._SnapshotMode",r,m);return r})},"esri/layers/RenderMode":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/has","../kernel"],function(r,n,p,m,h){r=r(null,{declaredClass:"esri.layers._RenderMode",initialize:function(e){this.map=e;this._init=!0},startup:function(){this._started=!0},propertyChangeHandler:function(e){},destroy:function(){this._init=this._started=!1},drawFeature:function(e){},suspend:function(){},
resume:function(){},refresh:function(){},hasAllFeatures:function(){return!0},_incRefCount:function(e){(e=this._featureMap[e])&&e._count++},_decRefCount:function(e){(e=this._featureMap[e])&&e._count--},_getFeature:function(e){return this._featureMap[e]},_addFeatureIIf:function(e,k){var d=this._featureMap,g=d[e],c=this.featureLayer;g||(d[e]=k,c._add(k),k._count=0);return g||k},_removeFeatureIIf:function(e){var k=this._featureMap[e],d=this.featureLayer;if(k){if(k._count)return;delete this._featureMap[e];
d._remove(k)}return k},_clearIIf:function(){var e;e=this.featureLayer;var k=e.graphics,d=e._selectedFeatures,g=e.getSelectedFeatures().length,c=e.objectIdField;if(g)for(e=k.length-1;0<=e;e--){var g=k[e],a=g.attributes[c];a in d?g._count=1:(g._count=0,this._removeFeatureIIf(a))}else e.clear(),this._featureMap={}},_cancelPendingRequest:function(e){if(e)try{e.cancel()}catch(k){}},_toggleVisibility:function(e){var k=this.featureLayer,d=k.graphics,g=e?"show":"hide",c,a=d.length;e=e&&k._ager;for(c=0;c<
a;c++){var l=d[c];l[g]();e&&k._repaint(l)}},_applyTimeFilter:function(e){var k=this.featureLayer;if(k.timeInfo&&!k.suspended){e||k._fireUpdateStart();var d=k._trackManager;d&&d.clearTracks();var g=k.getTimeDefinition(),c=k._getOffsettedTE(k._mapTimeExtent);c?(c=k._getTimeOverlap(g,c))?(g=k._filterByTime(k.graphics,c.startTime,c.endTime),d&&d.addFeatures(g.match),p.forEach(g.match,function(a){var c=a._shape;a.visible||(a.show(),(c=a._shape)&&c._moveToFront());k._ager&&c&&k._repaint(a)}),p.forEach(g.noMatch,
function(a){a.visible&&a.hide()})):this._toggleVisibility(!1):(d&&d.addFeatures(k.graphics),this._toggleVisibility(!0));d&&(d.moveLatestToFront(),d.drawTracks());e||k._fireUpdateEnd()}}});m("extend-esri")&&n.setObject("layers._RenderMode",r,h);return r})},"esri/layers/support/ParallelSnapshot":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has dojo/Deferred ../../kernel".split(" "),function(r,n,p,m,h,e){r=r(null,{declaredClass:"esri.layers.support.ParallelSnapshot",layer:null,
mode:null,queryTask:null,batchSize:5,_query:null,_fetchDfd:null,_startPage:null,_lastPage:null,_maxPage:null,_requests:null,constructor:function(e){n.mixin(this,e);this._requests={};this._maxPage=Math.ceil(this.mode.maxFeatures/this.layer.maxRecordCount)},destroy:function(){this.cancel()},fetch:function(e){var d=new h;this.cancel(!0);this._query=e;this._fetchDfd=d;this._sendRequests();return d.promise},cancel:function(e){this._cancelPendingRequests(e);this._reset()},_reset:function(){this._startPage=
this._lastPage=null;this._requests={}},_sendRequests:function(e){var d=this._query,g=this.queryTask,c=this._requests,a=this.layer.maxRecordCount,l;e=null==e?1:e;l=e+this.batchSize-1;l>this._maxPage&&(l=this._maxPage);if(!(e>l))for(this._startPage=e,this._lastPage=l;e<=l;e++)d.start=(e-1)*a,d.num=a,c[e]=g.execute(d),c[e].then(n.hitch(this,this._handleSuccess,e)).otherwise(n.hitch(this,this._handleError,e))},_evalNextBatch:function(e){e===this._lastPage&&this._sendRequests(this._lastPage+1)},_handleSuccess:function(e,
d){d.exceededTransferLimit||this._cancelLaterRequests(e,!0);var g=this.mode._checkMaxLimit(d.features);this._fetchDfd.progress({features:g.features,isError:!1});g.maxLimitReached?((g=g.featuresDiscarded||this._hasRejectedRequests())||(g=!!this._getResult(this._getLastSuccessfulRequest()).exceededTransferLimit),this._resolveFetch(g)):(d.exceededTransferLimit&&this._evalNextBatch(e),this._evalResolution())},_handleError:function(e,d){var g=this._requests;g&&g[e]&&(1===e?this._rejectFetch(d):(this._evalNextBatch(e),
this._fetchDfd.progress({error:d,isError:!0}),this._evalResolution()))},_evalResolution:function(){this._hasPendingRequests()||this._resolveFetch(this._hasRejectedRequests())},_resolveFetch:function(e){this.cancel(!0);this._fetchDfd.resolve({hasPartialFeatures:e})},_rejectFetch:function(e){this.cancel(!0);this._fetchDfd.reject(e)},_getResult:function(e){return e&&e.dfd.results[0]},_hasPendingRequests:function(){return!!this._getPendingRequests().length},_getPendingRequests:function(){var e=this._requests,
d,g=[];for(d in e){var c=e[d];c.isFulfilled()||g.push({pageId:Number(d),dfd:c})}return g},_getLastSuccessfulRequest:function(){var e=this._getResolvedRequests(),d=-Infinity,g,e=p.filter(e,function(c){return!!this._getResult(c).features.length||1===c.pageId},this);p.forEach(e,function(c){c.pageId>d&&(d=c.pageId,g=c)});return g},_getResolvedRequests:function(){var e=this._requests,d,g=[];for(d in e){var c=e[d];c.isResolved()&&g.push({pageId:Number(d),dfd:c})}return g},_hasRejectedRequests:function(){var e=
this._getRejectedRequests(),d=this._getLastSuccessfulRequest(),g=this._getResult(d);g&&!g.exceededTransferLimit&&(e=p.filter(e,function(c){return c.pageId<=d.pageId}));return!!e.length},_getRejectedRequests:function(){var e=this._requests,d,g=[];for(d in e){var c=e[d];c.isRejected()&&g.push({pageId:Number(d),dfd:c})}return g},_cancelPendingRequests:function(e){this._cancelRequests(this._getPendingRequests(),e)},_cancelLaterRequests:function(e,d){var g=p.filter(this._getPendingRequests(),function(c){return c.pageId>
e});this._cancelRequests(g,d)},_cancelRequests:function(e,d){var g=this.mode,c=this._requests;p.forEach(e,function(a){d&&delete c[a.pageId];g._cancelPendingRequest(a.dfd)})}});m("extend-esri")&&n.setObject("layers.support.ParallelSnapshot",r,e);return r})},"esri/layers/OnDemandMode":function(){define("dojo/_base/declare dojo/_base/connect dojo/_base/lang dojo/_base/array dojo/has ../kernel ../geometry/Point ../tasks/query ./RenderMode ./GridLayout".split(" "),function(r,n,p,m,h,e,k,d,g,c){r=r([g],
{declaredClass:"esri.layers._OnDemandMode",constructor:function(a){this.featureLayer=a;this._featureMap={};this._hasPartialFeatures=!1;this._queryErrorHandler=p.hitch(this,this._queryErrorHandler)},initialize:function(a){this.inherited(arguments);var d=this.featureLayer,t=d._srInfo;this._gridLayer=new c(new k(t?t.valid[0]:a.extent.xmin,t?t.valid[1]:a.extent.ymax,a.spatialReference),{width:d._tileWidth,height:d._tileHeight},{width:a.width,height:a.height},t);this._cellMap={};this._gridLayer.setResolution(a.extent)},
startup:function(){this._started||(this.inherited(arguments),this._ioQueue=[],this.featureLayer.suspended||(this._zoomHandler(),this._enableConnectors()))},propertyChangeHandler:function(a){this._init&&(2>a?this._zoomHandler():console.log("FeatureLayer: layer in on-demand mode does not support time definitions. Layer id \x3d "+this.featureLayer.id+", Layer URL \x3d "+this.featureLayer.url))},destroy:function(){this._disableConnectors();this._processIOQueue(!0);this.inherited(arguments)},drawFeature:function(a){var c=
a.geometry,d=[];if(c){var d=this._gridLayer.getCellsInExtent("point"===c.type?{xmin:c.x,ymin:c.y,xmax:c.x,ymax:c.y}:c.getExtent(),!1).cells,c=this._cellMap,e,f,b=a.attributes[this.featureLayer.objectIdField],q,u,g;for(e=0;e<d.length;e++)f=d[e],q=f.latticeID,u=f.row,g=f.col,q?f=c[q]=c[q]||f:(c[u]=c[u]||{},f=c[u][g]=c[u][g]||f),f.features=f.features||[],f.features.push(a),this._addFeatureIIf(b,a),this._incRefCount(b)}},suspend:function(){this._init&&this._disableConnectors()},resume:function(){this._init&&
(this._enableConnectors(),this._zoomHandler())},refresh:function(){this._zoomHandler()},hasAllFeatures:function(){if(this._hasPartialFeatures)return!1;var a=!1,c=this._getCurrentCells(),d;for(d=0;d<c.length;d++)if(c[d].hasPartialFeatures){a=!0;break}return!a},_enableConnectors:function(){var a=this.map;this._zoomConnect=n.connect(a,"onZoomEnd",this,this._zoomHandler);this._panConnect=n.connect(a,"onPanEnd",this,this._panHandler);this._resizeConnect=n.connect(a,"onResize",this,this._panHandler)},_disableConnectors:function(){n.disconnect(this._zoomConnect);
n.disconnect(this._panConnect);n.disconnect(this._resizeConnect)},_zoomHandler:function(){this._processIOQueue(!0);var a=this.featureLayer,c=this.map;!a.suspended&&a.isQueryable()&&(a._fireUpdateStart(),this._clearIIf(),this._hasPartialFeatures=!1,(a=a._trackManager)&&a.clearTracks(),this._cellMap={},this._gridLayer.setResolution(c.extent),this._sendRequest())},_panHandler:function(a){if(this.featureLayer.isQueryable()){this.featureLayer._fireUpdateStart();var c=this.featureLayer._resized;a=c?a:null;
c&&this._gridLayer.setMapState(a,this.map.width,this.map.height);this._sendRequest(a)}},_sendRequest:function(a){this._exceeds=!1;var c=this.featureLayer,t=this.map;a=a||t.extent;t=this._gridLayer.getCellsInExtent(a,c.latticeTiling).cells;if(!c.isEditable())var e=this._cellMap,t=m.filter(t,function(b){if(b.lattice){if(e[b.latticeID])return!1}else if(e[b.row]&&e[b.row][b.col])return!1;return!0});var f=c.getOutFields(),b=c.getDefinitionExpression(),q=c._getOffsettedTE(c._mapTimeExtent),u=c.supportsAdvancedQueries?
c.getOrderByFields():null,g=this._ioQueue,k,h=this,x=this._drawFeatures,w,z;this._pending=this._pending||0;for(k=0;k<t.length;k++){w=t[k];z=new d;z.geometry=w.extent||w.lattice;z.outFields=f;z.where=b;c.latticeTiling&&w.extent&&(z.spatialRelationship=d.SPATIAL_REL_CONTAINS);z.returnGeometry=!0;z.timeExtent=q;c._ts&&(z._ts=(new Date).getTime());z.orderByFields=u;z.multipatchOption=c.multipatchOption;z.maxAllowableOffset=c._maxOffset;z.quantizationParameters=c._quantizationParameters;var n=c.advancedQueryCapabilities;
n&&n.supportsQueryWithResultType&&(z.resultType="tile");this._pending++;g.push(c._task.execute(z,function(){var b=w;return function(a){x.apply(h,[a,b])}}.call(this),this._queryErrorHandler))}this._removeOldCells(a);this._endCheck()},_drawFeatures:function(a,c){c.hasPartialFeatures=!!a.exceededTransferLimit;this._exceeds=this._exceeds||a.exceededTransferLimit;this._finalizeIO();var d=this.featureLayer,l=this.map.extent,f=c.extent,b=c.row,q=c.col,u=d.objectIdField,e=a.features,g=this._gridLayer,k=this._cellMap,
h=c.latticeID,w=h?k[h]:k[b]&&k[b][q];if(c.resolution==g._resolution&&(h?h===g.getLatticeID(l):g.intersects(f,l)))if(w)d._sortFeatures(e),this._updateCell(w,e);else for(d._sortFeatures(e),c.features=e,h?k[h]=c:(k[b]=k[b]||{},k[b][q]=c),l=e.length,d=0;d<l;d++)f=e[d],b=f.attributes[u],this._addFeatureIIf(b,f),this._incRefCount(b);else w&&this._removeCell(b,q,h);this._endCheck()},_queryErrorHandler:function(a){this._finalizeIO();this._hasPartialFeatures=!0;this.featureLayer._errorHandler(a);this._endCheck(!0)},
_finalizeIO:function(){this._pending--},_endCheck:function(a){if(0===this._pending){this._processIOQueue();var c=this.featureLayer,d=c._trackManager;d&&(d.clearTracks(),d.addFeatures(c.graphics),c._ager&&m.forEach(c.graphics,function(a){a._shape&&c._repaint(a)}),d.moveLatestToFront(),d.drawTracks());this.featureLayer._fireUpdateEnd(a&&Error("FeatureLayer: an error occurred while updating the layer"),this._exceeds?{queryLimitExceeded:!0}:null);if(this._exceeds)c.onQueryLimitExceeded()}},_processIOQueue:function(a){this._ioQueue=
m.filter(this._ioQueue,function(a){return-1<a.fired?!1:!0});a&&m.forEach(this._ioQueue,this._cancelPendingRequest)},_getCurrentCells:function(a){var c=[];a=a||this._cellMap;for(var d in a)if(a.hasOwnProperty(d)){var e=a[d];e&&(e.hasOwnProperty("row")||e.hasOwnProperty("latticeID")?c.push(e):"object"===typeof e&&c.push.apply(c,this._getCurrentCells(e)))}return c},_removeOldCells:function(a){var c=this._cellMap,d=this._gridLayer,e,f;for(e in c)if(c[e]){var b=c[e],q=b.latticeID,u=0,g=0;if(q)u++,q!==
d.getLatticeID(a)&&(this._removeCell(null,null,q),g++);else for(f in b)b[f]&&(u++,d.intersects(b[f].extent,a)||(this._removeCell(e,f),g++));g===u&&delete c[e]}},_updateCell:function(a,c){var d=this.featureLayer,l=d.objectIdField,d=d._selectedFeatures,f,b=c.length;a.features=a.features||[];for(f=0;f<b;f++){var q=c[f],u=q.attributes[l],e=this._addFeatureIIf(u,q);e===q?(this._incRefCount(u),a.features.push(e)):u in d||(e.setGeometry(q.geometry),e.setAttributes(q.attributes))}},_removeCell:function(a,
c,d){var l=this._cellMap,f=this.featureLayer,b=f.objectIdField,q=d?l[d]:l[a]&&l[a][c];if(q)for(d?delete l[d]:delete l[a][c],a=q.features,c=0;c<a.length;c++)d=a[c].attributes[b],this._decRefCount(d),d in f._selectedFeatures||this._removeFeatureIIf(d)}});h("extend-esri")&&p.setObject("layers._OnDemandMode",r,e);return r})},"esri/layers/GridLayout":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../kernel ../SpatialReference ../geometry/Extent ../geometry/Polyline ../srUtils".split(" "),
function(r,n,p,m,h,e,k,d,g){r=r(null,{declaredClass:"esri.layers._GridLayout",constructor:function(c,a,d,e){this.origin=c;this.cellWidth=a.width;this.cellHeight=a.height;this.mapWidth=d.width;this.mapHeight=d.height;this.srInfo=e},setResolution:function(c){this._resolution=(c.xmax-c.xmin)/this.mapWidth;this.srInfo&&(c=Math.round(Math.round(2*this.srInfo.valid[1]/this._resolution)/this.cellWidth),this._frameStats=[c,0,c-1])},setMapState:function(c,a,d){this.mapWidth=a;this.mapHeight=d;this.setResolution(c)},
getCellCoordinates:function(c){var a=this._resolution,d=this.origin;return{row:Math.floor((d.y-c.y)/(this.cellHeight*a)),col:Math.floor((c.x-d.x)/(this.cellWidth*a))}},normalize:function(c){var a=this._frameStats;if(a){var d=a[0],e=a[1],a=a[2];c<e?(c%=d,c=c<e?c+d:c):c>a&&(c%=d)}return c},intersects:function(c,a){var d=this.srInfo;return d?p.some(a._getParts(d),function(a){return c.intersects(a.extent)}):c.intersects(a)},getCellExtent:function(c,a){var d=this._resolution,e=this.origin,v=this.cellWidth,
f=this.cellHeight;return new k(a*v*d+e.x,e.y-(c+1)*f*d,(a+1)*v*d+e.x,e.y-c*f*d,g.createSpatialReference(e.spatialReference.toJson()))},getLatticeID:function(c){var a=this.getCellCoordinates({x:c.xmin,y:c.ymax}),d=this.getCellCoordinates({x:c.xmax,y:c.ymin});c=a.row;var e=d.row,a=this.normalize(a.col),d=this.normalize(d.col);return c+"_"+e+"_"+a+"_"+d},sorter:function(c,a){return c<a?-1:1},getCellsInExtent:function(c,a){var e=this.getCellCoordinates({x:c.xmin,y:c.ymax}),g=this.getCellCoordinates({x:c.xmax,
y:c.ymin}),k=e.row,f=g.row,e=e.col,g=g.col,b=[],q,u,h,m=[],n=[],x,w,z,r,C=[];for(q=k;q<=f;q++)for(u=e;u<=g;u++)h=this.normalize(u),c=this.getCellExtent(q,h),p.some(b,function(b){return b.row===q&&b.col===h})||b.push({row:q,col:h,extent:c,resolution:this._resolution}),a&&(m.push(c.xmin,c.xmax),n.push(c.ymin,c.ymax));e=this.normalize(e);g=this.normalize(g);m.sort(this.sorter);n.sort(this.sorter);u=m.length;for(q=u-1;0<=q;q--)q<u-1&&m[q]===m[q+1]&&m.splice(q,1);u=n.length;for(q=u-1;0<=q;q--)q<u-1&&n[q]===
n[q+1]&&n.splice(q,1);if(m.length&&n.length){x=m[0];w=m[m.length-1];z=n[0];r=n[n.length-1];u=m.length;for(q=0;q<u;q++)C.push([[m[q],r],[m[q],z]]);u=n.length;for(q=0;q<u;q++)C.push([[x,n[q]],[w,n[q]]]);m=new d({paths:C,spatialReference:this.origin.spatialReference.toJson()});b.push({latticeID:k+"_"+f+"_"+e+"_"+g,lattice:m,resolution:this._resolution})}return{minRow:k,maxRow:f,minCol:e,maxCol:g,cells:b}}});m("extend-esri")&&n.setObject("layers._GridLayout",r,h);return r})},"esri/layers/SelectionMode":function(){define(["dojo/_base/declare",
"dojo/_base/lang","dojo/has","../kernel","./RenderMode"],function(r,n,p,m,h){r=r([h],{declaredClass:"esri.layers._SelectionMode",constructor:function(e){this.featureLayer=e;this._featureMap={}},propertyChangeHandler:function(e){this._init&&0===e&&this._applyTimeFilter()},resume:function(){this.propertyChangeHandler(0)},hasAllFeatures:function(){return!this.featureLayer._hasPartialSelectedFeatures}});p("extend-esri")&&n.setObject("layers._SelectionMode",r,m);return r})},"esri/layers/StreamMode":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/Deferred dojo/has ../kernel ../SpatialReference ../tasks/query ../tasks/QueryTask ../geometry/jsonUtils ./RenderMode".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a){r=r([a],{declaredClass:"esri.layers._StreamMode",constructor:function(a,c){this.featureLayer=a;this._featureMap={};this._setRefreshRate();this._drawBuffer={adds:[],updates:[]};this._timeoutId=null;this._flushDrawBuffer=n.hitch(this,this._flushDrawBuffer);this._featuresByTime={};this._lastEndTimeCheck=null;this._maxFeatureAge=0;a.purgeOptions&&a.purgeOptions.age&&"number"===typeof a.purgeOptions.age&&(this._maxFeatureAge=1E3*Math.ceil(60*a.purgeOptions.age));this._drawFeatures=
n.hitch(this,this._drawFeatures);this._queryErrorHandler=n.hitch(this,this._queryErrorHandler)},startup:function(){this._started||this.inherited(arguments)},propertyChangeHandler:function(a){this._init&&(0===a?this._applyTimeFilter():3===a?this._redrawAllTracks():console.debug("StreamLayer: Stream Layer only supports changing map time or maximumTrackPoints. Layer id \x3d "+this.featureLayer.id))},destroy:function(){this.inherited(arguments);clearTimeout(this._timeoutId);this._featuresByTime=this._drawBuffer=
this._featureMap=null},drawFeature:function(a){var c=this.featureLayer,d=c.objectIdField;this._timeoutId||(this._timeoutId=setTimeout(this._flushDrawBuffer,this._refreshRate));c._joinField&&this._getFeature(a.attributes[d])?this._drawBuffer.updates.push({oid:a.attributes[d],updates:a}):this._drawBuffer.adds.push(a)},resume:function(){this.propertyChangeHandler(0)},refresh:function(){this._pendingRequest&&this._cancelPendingRequest(this._pendingRequest);var a=this.featureLayer;a&&(a._relatedUrl||a._keepLatestUrl?
(a._fireUpdateStart(),a._refreshing=!0,a.disconnect(),a.clear(),a._relatedQueried=!1,a._keepLatestQueried=!1,a.connect()):(a._fireUpdateStart(),a.clear(),a._fireUpdateEnd()))},_drawFeatures:function(a,c){var d=this.featureLayer;d._create(a.features||[]);d._fireUpdateEnd(null,c)},_applyTimeFilter:function(a){this.inherited(arguments);this._redrawAllTracks()},_removeFeatures:function(a){var c=this.featureLayer,d=c.objectIdField;a&&p.forEach(a,function(a){a=a.attributes[d];c._unSelectFeatureIIf(a,this);
this._decRefCount(a);this._removeFeatureIIf(a)},this)},_addFeatures:function(a){var c=this.featureLayer,d=c._endTimeField,f=c._startTimeField,b,q,u,e=[],g=[],l=[];b=c._trackManager;q=c.objectIdField;if(b)for(u in a=b.addFeatures(a),a)a.hasOwnProperty(u)&&(e.push(u),a[u].adds&&(g=g.concat(a[u].adds)),a[u].deletes&&(l=l.concat(a[u].deletes)));else g=a;p.forEach(g,function(b){var a=b.attributes[q],c;c=d&&b.attributes[d];!c&&this._maxFeatureAge&&(c=f&&b.attributes[f]?b.attributes[f]+this._maxFeatureAge:
Date.now()+this._maxFeatureAge);c&&(c=1E3*Math.ceil(c/1E3),this._featuresByTime[c]?this._featuresByTime[c].push(a):this._featuresByTime[c]=[a]);this._addFeatureIIf(a,b);this._incRefCount(a)},this);l.length&&this._removeFeatures(l);b&&b.refreshTracks(e)},_updateFeatures:function(a){var c=this.featureLayer,d,f,b=[];d=c._trackManager;f=c._trackIdField;p.forEach(a,function(a){var q=a.updates;a=this._getFeature(a.oid);var e;if(a){q.geometry&&a.setGeometry(q.geometry);q=q.attributes||{};for(e in q)q.hasOwnProperty(e)&&
(a.attributes[e]=q[e]);a.setAttributes(a.attributes);a.visible=this._checkFeatureTimeIntersects(a);d&&a.attributes[f]?b.push(a.attributes[f]):c._repaint(a,null,!0)}},this);b.length&&d.refreshTracks(b)},_redrawAllTracks:function(){var a=this.featureLayer._trackManager,c;a&&(c=a.trimTracks())&&0<c.length&&(this._removeFeatures(c),a.refreshTracks())},_flushDrawBuffer:function(){clearTimeout(this._timeoutId);var a=this._drawBuffer,c=a.adds.splice(0,a.adds.length),d=a.updates.splice(0,a.updates.length),
a=this.featureLayer;if(!a)return!1;a.updating||a._fireUpdateStart();this._addFeatures(c);this._updateFeatures(d);(c=this._getExpiredFeatures())&&c.length&&(this._removeFeatures(c),a._trackManager&&a._trackManager.removeFeatures(c));a._purge();a._fireUpdateEnd();this._timeoutId=null},_clearDrawBuffer:function(){var a=this._timeoutId,c=this._drawBuffer,d=c.adds,c=c.updates;a&&clearTimeout(a);d.splice(0,d.length);c.splice(0,c.length);this._timeoutId=null},_clearTimeBin:function(){this._featuresByTime=
{};this._lastEndTimeCheck=1E3*Math.ceil(Date.now()/1E3)},_clearFeatureMap:function(){this._featureMap={}},_setRefreshRate:function(a){a=a||0===a?a:200;0>a&&(a=200);this._refreshRate=a},_checkFeatureTimeIntersects:function(a){var c=this.featureLayer,d=c.getMap();return(d=d?d.timeExtent:null)&&c.timeInfo&&(c.timeInfo.startTimeField||c.timeInfo.endTimeField)?0<c._filterByTime([a],d.startTime,d.endTime).match.length:!0},_fetchArchive:function(a){var e=new m,l=this.featureLayer,f,b,q,u,h;this._pendingRequest&&
this._cancelPendingRequest(this._pendingRequest);l._fireUpdateStart();a&&this.map?(a=new g(a),f=new d,b=this.map,q=l.getFilter()||{},u=q.where||"1\x3d1",h=q.geometry?c.fromJson(q.geometry):null,q=q.outFields?q.outFields.split(","):["*"],f.geometry=h,f.where=u,f.outFields=q,f.returnGeometry=!0,f.outSpatialReference=new k(b.spatialReference.toJson()),this._pendingRequest=a.execute(f).then(function(b){this._pendingRequest=null;var a=this._fixFieldNameCasing(l,b);b.features=a;this._drawFeatures(b);l._fireUpdateEnd();
e.resolve()}.bind(this)).otherwise(function(b){this._pendingRequest=null;l._errorHandler(b);l._fireUpdateEnd(b);e.reject(b)}.bind(this))):e.resolve();return e.promise},_queryErrorHandler:function(a){var c=this.featureLayer;c._errorHandler(a);c._fireUpdateEnd(a)},_fixFieldNameCasing:function(a,c){var d=c.features||[],f=c.fields;if(!f||!d.length)return d;for(var f=this._mapFieldNameDifferences(a.fields,f),b=[],q,e,g=0,l=c.features.length;g<l;g++)q=d[g],e=this._swizzleResponseAttributes(q.attributes,
f),b.push({geometry:q.geometry,attributes:e});return b},_mapFieldNameDifferences:function(a,c){var d=[],f={},b,q;b=0;for(q=c.length;b<q;b++)d.push(c[b].name);b=0;for(q=a.length;b<q;b++){var e=a[b].name,g=this._checkForStreamFieldName(e,d);g&&(f[g]=e)}return f},_checkForStreamFieldName:function(a,c){for(var d=a.toLowerCase(),f,b=0,q=c.length;b<q;b++)if(c[b].toLowerCase()===d){f=c[b];break}return f},_swizzleResponseAttributes:function(a,c){var d={},f;for(f in a)if(a.hasOwnProperty(f)){var b=a[f];c.hasOwnProperty(f)?
d[c[f]]=b:d[f]=b}return d},_getExpiredFeatures:function(){var a,c,d,f=[],b=[];if(!this.featureLayer._endTimeField&&!this._maxFeatureAge)return b;a=1E3*Math.floor(this._lastEndTimeCheck/1E3);this._lastEndTimeCheck=c=1E3*Math.ceil(Date.now()/1E3);if(a&&a!==c)for(d=this._featuresByTime;a<=c;a+=1E3)d[a]&&(f=f.concat(d[a]),delete d[a]);p.forEach(f,function(a){(a=this._getFeature(a))&&b.push(a)},this);return b}});h("extend-esri")&&n.setObject("layers._StreamMode",r,e);return r})},"esri/layers/TrackManager":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has dojo/dom-construct dojox/gfx ../kernel ../graphic ../geometry/Polyline ./GraphicsLayer".split(" "),
function(r,n,p,m,h,e,k,d,g,c){var a=-1!==e.renderer.toLowerCase().indexOf("canvas");r=r(null,{declaredClass:"esri.layers._TrackManager",constructor:function(a){this.layer=a;this.trackMap={};this.trackLineMap={}},initialize:function(d){this.map=d;var e=this.layer,g=e._getRenderer(),g=g&&g.trackRenderer;if("esriGeometryPoint"===e.geometryType){var f=this.container=new c._GraphicsLayer({id:e.id+"_tracks",_child:!0,visible:e.visible,minScale:e.minScale,maxScale:e.maxScale});f.loaded=!0;f.onLoad(f);f._setMap(d,
e._div);if(!a){d=f._div.getNode();var b=e._div.getNode();d&&b&&h.place(d,b,"first")}f.setRenderer(g);e.on("visibility-change",n.hitch(this,function(b){this.container.setVisibility(b.visible);this.container.evaluateSuspension()}));e.on("scale-range-change",n.hitch(this,function(){this.container.setScaleRange(this.layer.minScale,this.layer.maxScale)}))}},addFeatures:function(a){var c=this.trackMap,d=this.layer,f=d._trackIdField,b=[];p.forEach(a,function(a){var d=a.attributes[f];(c[d]=c[d]||[]).push(a);
-1===p.indexOf(b,d)&&b.push(d)});var q=d._startTimeField,e=d.objectIdField,g=function(b,a){var c=b.attributes[q],f=a.attributes[q];return c===f?b.attributes[e]<a.attributes[e]?-1:1:c<f?-1:1};p.forEach(b,function(b){c[b].sort(g)})},trimTracks:function(a){function c(a){for(a=d[a]||[];a.length>f;)b.push(a.shift())}var d=this.trackMap,f=this.layer.maximumTrackPoints||0,b=[],q;if(!f)return b;if(a)p.forEach(a,function(b){c(b)});else for(q in d)d.hasOwnProperty(q)&&c(q);return b},drawTracks:function(a){function c(a){var c=
b[a],l,t,k;t=e.trackLineMap[a];f.remove(t);delete e.trackLineMap[a];t=null;if(!c||2>c.length)return!1;t=[];for(l=c.length-1;0<=l;l--)(k=c[l].geometry)&&t.push([k.x,k.y]);c={};c[u]=a;1<t.length&&(t=new d(new g({paths:[t],spatialReference:q}),null,c),f.add(t),e.trackLineMap[a]=t)}var e=this,f=this.container,b,q,u,l;if(f)if(b=this.trackMap,q=this.map.spatialReference,u=this.layer._trackIdField,a)p.forEach(a,function(b){c(b)});else for(l in b)b.hasOwnProperty(l)&&c(l)},refreshTracks:function(a){function c(a){var c,
e;d.drawTracks([a]);if(q&&q.latestObservationRenderer)for(a=f[a]||[],c=a.length,e=0;e<c;e++)b._repaint(a[e],null,!0)}var d=this,f=this.trackMap,b=this.layer,q=b._getRenderer(),e;if(a)p.forEach(a,function(b){c(b)});else for(e in f)f.hasOwnProperty(e)&&c(e);this.moveLatestToFront()},moveLatestToFront:function(a){p.forEach(this.getLatestObservations(a),function(a){var c=a._shape;c&&c._moveToFront();this._repaint(a,null,!0)},this.layer)},getLatestObservations:function(a){function c(a){a=b[a];return a[a.length-
1]}var d=[],f=this.layer._getRenderer(),b=this.trackMap,q;if(!f.latestObservationRenderer)return d;if(a)p.forEach(a,function(b){d.push(c(b))});else for(q in b)b.hasOwnProperty(q)&&d.push(c(q));return d},clearTracks:function(a){var c=this.getLatestObservations(a),d=this.container,f;a?p.forEach(a,function(b){delete this.trackMap[b];d&&(f=this.trackLineMap[b],d.remove(f),delete this.trackLineMap[b])},this):(this.trackMap={},this.trackLineMap={},d&&d.clear());p.forEach(c,function(b){this._repaint(b,null,
!0)},this.layer)},isLatestObservation:function(a){var c=this.trackMap[a.attributes[this.layer._trackIdField]];return c?c[c.length-1]===a:!1},destroy:function(){var a=this.container;a&&(a.clear(),a._unsetMap(this.map,this.layer._div));this.map=this.layer=this.trackMap=this.container=null}});m("extend-esri")&&n.setObject("layers._TrackManager",r,k);return r})},"esri/layers/HeatmapManager":function(){define("dojo/_base/declare dojo/_base/lang dojo/aspect dojo/_base/array require ../kernel ../sniff ../geometry/Point ../geometry/webMercatorUtils ./MapImage ../renderers/HeatmapRenderer ../tasks/query dojo/_base/fx".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t){function v(){}function f(b){var a=b.layer;return{geometry:b.geometry,attributes:b.attributes,getLayer:function(){return a}}}r=r(null,{declaredClass:"esri.layers.HeatmapManager",heatmapRenderer:null,sourceLayer:null,imageLayer:null,useTiles:!0,useWorker:!1,map:null,constructor:function(b){this.sourceLayer=b;this._hndls=[]},initialize:function(b){this.map=b;var c=this.sourceLayer,f=c.renderer;c.setDrawMode(!1);this.imageLayer=b._getMapImageLyr();var d=this;this.heatmapRenderer=
f instanceof a?f:(f.getRendererInfoByZoom(b.getZoom())||f.getRendererInfoByScale(b.getScale())).renderer;this._setupDraw=this._setupDraw.bind(this);this.recalculateHeatmap=this.recalculateHeatmap.bind(this);this._removeRenderer=this._removeRenderer.bind(this);this._handleRendererChange=this._handleRendererChange.bind(this);this._rendererChangeHandle=this.sourceLayer.on("renderer-change",this._handleRendererChange);this._handleOpacityChange=this._handleOpacityChange.bind(this);this._reprojectFeature=
this._reprojectFeature.bind(this);h(["../workers/heatmapCalculator"],function(b){d._calculator=new b(n.mixin({width:d.map.width,height:d.map.height},d._getOptions()));d._setupRenderer();d.heatmapRenderer.getStats=b.calculateStats;d.heatmapRenderer.getHistogramData=b.getHistogramData})},destroy:function(){this._removeHandlers();this._rendererChangeHandle&&this._rendererChangeHandle.remove();this._rendererChangeHandle=this.sourceLayer=this.imageLayer=this.map=this.heatmapRenderer=this._hndls=null},
_handleRendererChange:function(b){var c=b.renderer,f=c instanceof a;this.heatmapRenderer?f?this.heatmapRenderer=c:this._removeRenderer(b):f&&(this.heatmapRenderer=c,this.sourceLayer&&this.map&&this._setupRenderer())},_handleOpacityChange:function(b){b=b.opacity;var a=this._getImageBySourceId(this.sourceLayer.id);a&&a.setOpacity(b)},_setupRenderer:function(){var b=this._hndls,a=this.sourceLayer,c=this.map,f=this;a._originalDraw=a._draw;a._draw=v;a._div.clear();clearTimeout(this._resetTimer);this._resetTimer=
setTimeout(this._resetGraphics.bind(this),250);b.push(a.on("update-end",this._setupDraw));b.push(a.on("suspend",function(b){(b=f._getImageBySourceId(f.sourceLayer.id))&&b.hide()}));b.push(a.on("resume",function(b){(b=f._getImageBySourceId(f.sourceLayer.id))&&b.show()}));b.push(p.after(a,"redraw",this._setupDraw));b.push(c.on("layer-remove",function(b){b.layer==a&&((b=f._getImageBySourceId(f.sourceLayer.id))&&f.imageLayer.removeImage(b),f._removeRenderer({target:a}))}));a._collection&&b.push(a.on("graphic-add",
function(b){f._reprojectFeature(b.graphic);f._setupDraw()}));1!==a.mode&&(b.push(c.on("resize, pan-end",this._setupDraw)),b.push(c.on("zoom-end",this._setupDraw)));b.push(a.on("opacity-change",this._handleOpacityChange));this.imageLayer.suspended&&this.imageLayer.resume();a.graphics&&a.graphics.length&&(a.graphics[0].geometry&&!c.spatialReference.equals(a.graphics[0].geometry.spatialReference)&&m.forEach(a.graphics,function(b){this._reprojectFeature(b)}.bind(this)),this._setupDraw())},_setupDraw:function(){if(!this._drawTimer){var b=
this;this._drawTimer=setTimeout(function(){clearTimeout(b._drawTimer);b._drawTimer=null;b.sourceLayer._getRenderer().isInstanceOf(a)&&b.recalculateHeatmap()},16)}},_removeRenderer:function(b){var a=b.target;a._draw=a._originalDraw;delete a._originalDraw;a.setDrawMode(!0);this._removeHandlers();this._hndls=[];var c=this._getImageBySourceId(this.sourceLayer.id);c&&this.imageLayer.removeImage(c);clearTimeout(this._drawTimer);clearTimeout(this._resetTimer);this._drawTimer=this._resetTimer=null;a.renderer!=
b.renderer&&a.renderer.getRendererInfo?this.heatmapRenderer=null:(a.redraw(),this.destroy())},recalculateHeatmap:function(){this._calculator?this._doMainCalculation():this._calculatorClient&&this._doWorkerCalculation()},_reprojectFeature:function(b){if(b&&b.geometry){var a=b.geometry,c=this.map.spatialReference;c.equals(a.spatialReference)||(a=g.project(a,c),null==a?console.log("Unable to reproject features to map's spatial reference. Please convert feature geometry before adding to layer"):b.geometry=
a)}},_doWorkerCalculation:function(){},_doMainCalculation:function(){var b=this.sourceLayer,a=this.map,d=this.heatmapRenderer,e=this.map.extent,g=this.map.width,t=this.map.height,k=this._calculator,h=this,v=function(q){q=h._getScreenPoints(q.features,a,b);q=k.calculateImageData(n.mixin({screenPoints:q,mapinfo:{extent:[e.xmin,e.ymin,e.xmax,e.ymax],resolution:a.getResolution()},width:g,height:t},h._getOptions()));q=d.getSymbol(f({geometry:a.extent,attributes:{size:[g,t],imageData:q},layer:b}));q=new c({extent:a.extent,
href:q.url,opacity:0,sourceId:b.id});h._swapMapImages(q,h._getImageBySourceId(b.id));b.suspended&&q.hide()},m={geometry:a.extent,timeExtent:b.useMapTime?a.timeExtent:void 0,spatialRelationship:l.SPATIAL_REL_INTERSECTS};null!=b._canDoClientSideQuery(m)?b.queryFeatures(m,v):v({features:b.graphics})},_getScreenPoints:function(b,a,c){var f=[],q=b.length,e=0,g=0,u,l=new d(a.extent.xmin,a.extent.ymax,a.spatialReference),t=a.toScreen(l),k=t.x,t=t.y,h=a.getResolution(),v;for((g=a.extent.getCacheValue("_parts"))&&
(v=m.map(g,function(b){return c._intersects(a,b.extent)[0]}));q--;)g=b[q],g.geometry&&(u={x:Math.ceil((g.geometry.x-l.x)/h+k),y:Math.floor((l.y-g.geometry.y)/h-t),attributes:g.attributes},v&&(g=1<v.length&&u.x<-v[0]?v[1]:v[0],u.x+=g),f[e++]=u);return f},_getImageBySourceId:function(b){var a=this.imageLayer.getImages(),a=m.filter(a,function(a){return a.sourceId==b});if(a.length)return a[a.length-1]},_swapMapImages:function(b,a){function c(){f.removeImage(a)}var f=this.imageLayer,d=this.sourceLayer.opacity;
f.addImage(b);t.anim(b._node,{opacity:d},null,null,function(){b.opacity=d});null!=a&&t.anim(a._node,{opacity:0},null,null,c)},_removeHandlers:function(){if(null!=this._hndls)for(var b=this._hndls.length;b--;)this._hndls[b].remove()},_getOptions:function(){var b=this.heatmapRenderer;return{blurRadius:b.blurRadius,gradient:b.gradient,maxPixelIntensity:b.maxPixelIntensity,minPixelIntensity:b.minPixelIntensity,field:b.field,fieldOffset:b.fieldOffset}},_resetGraphics:function(){clearTimeout(this._resetTimer);
this._resetTimer=null;for(var b=this.sourceLayer.graphics,a=b.length,c;a--;)c=b[a],c._shape=c._offsets=void 0}});k("extend-esri")&&n.setObject("layers.HeatmapManager",r,e);return r})},"esri/layers/clustering/ClusterManager":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../../kernel ../../Evented ../../graphic ../../lang ../../Color ../../graphicsUtils ../../dijit/PopupTemplate ../../dijit/Legend/utils ../../renderers/ClassBreaksRenderer ../../symbols/SimpleMarkerSymbol ../GraphicsLayer ../Field ./GeohashAggregation ./statUtils dojo/i18n!../../nls/jsapi".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A){var y=A.layers.clusters,B=A.widgets.popup,x=y.numFeatures,w=Math.pow(2,53)-1;r=r(e,{declaredClass:"esri.layers.clustering.ClusterManager",layer:null,aggregationInfo:null,container:null,defaults:{clusterRadius:80,markerSymbol:{color:[77,77,77,255],size:6,angle:0,xoffset:0,yoffset:0,type:"esriSMS",style:"esriSMSCircle",outline:{color:[255,255,255,255],width:.75,type:"esriSLS",style:"esriSLSSolid"}}},_initialized:!1,_map:null,_eventHandles:null,_clusterRadius:null,
_renderer:null,_statisticInfos:null,_fields:null,_infoTemplate:null,_clusterGenerator:null,_singleGraphics:null,constructor:function(b){this._eventHandles=[];this.layer=b.layer;this.setAggregationInfo(b.aggregationInfo)},initialize:function(b){this._initialized=!0;this._map=b;this.container=this._createContainer();this._clusterGenerator=this._createClusterGenerator();this._initClusterGenerator();this._createLayerEventListeners();this._createMapEventListeners();this._createPopupEventListeners()},destroy:function(b){this._clearSingleGraphics();
this._removeClusterBoundary();this._destroyEventListeners();this._removeFromPopup(this.container);this._removeFromPopup(this.layer);this._resetClusterNav();this._destroyClusterGenerator(b);this._destroyContainer();this.layer=this.aggregationInfo=this._map=null},setAggregationInfo:function(b){this.aggregationInfo=b?n.mixin({},b):null;this._applyAggregationInfo()},getClusterRenderer:function(){return this._renderer},getClusterFields:function(){return this._fields||[]},getFeaturesInCluster:function(b){b=
b&&b.getAggregationInfo();return this._clusterGenerator?this._clusterGenerator.getFeaturesInCluster(b):[]},getAggregateGraphics:function(){return this.container?this.container.graphics.slice(0):[]},getSingleGraphics:function(){return this._singleGraphics?this._singleGraphics.slice(0):[]},redraw:function(){this.container&&this.container.redraw()},isClusteringEnabled:function(){return!(!this._clusterGenerator||!this._clusterGenerator.clustersEnabled)},isClusteringActive:function(){return!!(this._clusterGenerator&&
0<this._clusterGenerator.getNumFeatures())},_createContainer:function(){var b=this.layer,a=new f._GraphicsLayer({_child:!0,id:b.id+"_clusters",visible:b.visible,minScale:b.minScale,maxScale:b.maxScale,infoTemplate:this._infoTemplate});a.fields=this._fields;a.setRenderer(this._renderer);a.loaded=!0;a.onLoad(a);a._setMap(this._map,b._div);return b._childLayer=a},_destroyContainer:function(){var b=this.container;b&&(b.clear(),b._unsetMap(this._map,this.layer._div),this.layer._childLayer=null);this.container=
null},_createClusterGenerator:function(){return new q({map:this._map,layer:this.layer,clusterRadius:this._clusterRadius,statisticInfos:this._statisticInfos})},_initClusterGenerator:function(){var b=this._clusterGenerator;b.loaded?(this._applyRenderer(),this._initClusterUpdates()):this._eventHandles.push(b.on("load",n.hitch(this,function(){this._applyRenderer();this._initClusterUpdates()})),b.on("load-error",n.hitch(this,function(b){console.log(b.error)})))},_destroyClusterGenerator:function(b){this._clusterGenerator&&
this._clusterGenerator.destroy(b);this._clusterGenerator=null},_applyAggregationInfo:function(){this._applyClusterRadius();this._applyRenderer();this._clusterGenerator&&!this._clusterGenerator.isUpdateScheduled()&&this.redraw()},_applyClusterRadius:function(){var b=this.aggregationInfo;this._clusterRadius=b&&b.clusterRadius||this.defaults.clusterRadius;this._clusterGenerator&&this._clusterGenerator.setClusterRadius(this._clusterRadius);this._computeClusterRadius()},_computeClusterRadius:function(){var b=
this.aggregationInfo||{};b.clusterRadius=this._clusterRadius;this.aggregationInfo=b},_applyRenderer:function(){var b=this.container,a=this._getClusterRendererInfo(),c=this._compareStatInfos(this._statisticInfos,a.statisticInfos);c&&(this._statisticInfos=a.statisticInfos,this._clusterGenerator&&(this._clusterGenerator.setStatisticInfos(p.map(this._statisticInfos,function(b){return{attributeInfo:b.attributeInfo,statisticType:b.statisticType}})),b&&p.forEach(b.graphics,function(b){this._applyClusterAttributes(b,
b.getAggregationInfo())},this)));this._renderer=a.renderer;this._applyFields();this._applyInfoTemplate(!!c&&this._initialized);b&&(b.setRenderer(this._renderer),this.emit("renderer-change"))},_applyFields:function(){this._fields=this._getFields(this._statisticInfos);this.container&&(this.container.fields=this._fields)},_applyInfoTemplate:function(b){if(this.layer.infoTemplate){var a=this.aggregationInfo,a=a&&a.infoTemplate||this._infoTemplate;b=b||!a?this._createInfoTemplate():this._updateInfoTemplate(a)}else b=
null;this._infoTemplate=b;this.container&&this.container.setInfoTemplate(this._infoTemplate);this._computeInfoTemplate()},_computeInfoTemplate:function(){var b=this.aggregationInfo||{};b.infoTemplate=this._infoTemplate;this.aggregationInfo=b},_getClusterRendererInfo:function(){var b=this.layer&&this.layer.renderer;return b?this._createClusterRenderer(b):this._getDefaultClusterRenderer()},_getDefaultClusterRenderer:function(){var b=this._createContinuousCountRenderer();this._addSizeByCountVariable(b);
return{renderer:b,statisticInfos:[]}},_createContinuousCountRenderer:function(b){var a=new t(null,"cluster_count");a.addBreak({minValue:-w,maxValue:w,symbol:b?new b.constructor(b.toJson()):new v(n.clone(this.defaults.markerSymbol))});return a},_createClusterRenderer:function(b){if(!this._isSupportedRenderer(b))return this._getDefaultClusterRenderer();var a,c=[];if(this._isSimpleRenderer(b))a=this._createContinuousCountRenderer(b.symbol);else{a=new b.constructor(b.toJson());var f=this._getRendererAttributeInfo(b),
d;this._isCBRenderer(a)?(d=u.getClusterField(f,"avg"),c.push(this._getStatInfo(f,"avg")),a.normalizationType=null,a.normalizationField=null,a.normalizationTotal=null):this._isUVRenderer(a)&&(d=u.getClusterField(f,"type"),c.push(this._getStatInfo(f,"type")));a.attributeField=d;a.setValueExpression(null);a.valueExpressionTitle=null;a.setVisualVariables(null);this._setRendererTitle(a,b)}b=this._getSupportedVariables(b);f=this._createClusterVariables(b.allVars,c);a.setVisualVariables(f);b.sizeVars.length||
this._isCBSizeRenderer(a)||this._addSizeByCountVariable(a);return{renderer:a,statisticInfos:c}},_isSupportedRenderer:function(b){if(this._isSimpleRenderer(b))return!0;if(this._isCBRenderer(b)){var a=b.normalizationType;return"function"===typeof b.attributeField||a&&"field"!==a?!1:!0}return this._isUVRenderer(b)?"function"===typeof b.attributeField||b.attributeField2?!1:!0:!1},_isSimpleRenderer:function(b){return-1<b.declaredClass.toLowerCase().indexOf("simplerenderer")},_isCBRenderer:function(b){return-1<
b.declaredClass.toLowerCase().indexOf("classbreaksrenderer")},_isUVRenderer:function(b){return-1<b.declaredClass.toLowerCase().indexOf("uniquevaluerenderer")},_isCBSizeRenderer:function(b){var a=b.infos;if(!this._isCBRenderer(b)||!a||2>a.length)return!1;var c=Infinity,f=-Infinity;p.forEach(a,function(b){if(b=b.symbol){var a=0;switch(b.type){case "simplemarkersymbol":a=b.size;break;case "picturemarkersymbol":a=(b.width+b.height)/2}c=Math.min(c,a);f=Math.max(f,a)}});return Infinity!==c&&-Infinity!==
f&&c!==f},_getRendererAttributeInfo:function(b){var a=b.attributeField,c=a?this.layer.getField(a):null;return{field:a,attributeType:c&&"esriFieldTypeDate"===c.type?"date":null,rotationType:null,valueExpression:b.valueExpression,valueExpressionTitle:b.valueExpressionTitle,normalizationField:b.normalizationField}},_setRendererTitle:function(b,a){b.legendOptions=n.clone(a.legendOptions);b.legendOptions&&b.legendOptions.title||(b.legendOptions=b.legendOptions||{},b.legendOptions.title=l.getRendererTitle(a,
this.layer))},_getSupportedVariables:function(b){var a=b.getVisualVariablesForType("colorInfo",!1)||[],c=b.getVisualVariablesForType("sizeInfo",!1)||[],f=b.getVisualVariablesForType("opacityInfo",!1)||[];b=b.getVisualVariablesForType("rotationInfo",!1)||[];a=p.filter(a,this._variableFilter);c=p.filter(c,this._variableFilter);f=p.filter(f,this._variableFilter);b=p.filter(b,this._variableFilter);return{sizeVars:c,allVars:a.concat(c).concat(f).concat(b)}},_variableFilter:function(b){return"function"!==
typeof b.field},_createClusterVariables:function(b,a){return p.map(b,function(b){return this._createVarForAvg(b,a)},this)},_createVarForAvg:function(b,a){var c=n.clone(b),f=this._getVariableAttributeInfo(b);c.field=u.getClusterField(f,"avg");c.normalizationField=null;c.valueExpression=null;c.valueExpressionTitle=null;f=this._getStatInfo(f,"avg");this._addStatInfo(a,f);this._setVariableTitle(c,b);return c},_getVariableAttributeInfo:function(b){var a="rotationInfo"===b.type,c=a?"angle":null,a=a?b.rotationType:
null,f=b.legendOptions&&b.legendOptions.title,d=b.field,e=d?this.layer.getField(d):null;e&&"esriFieldTypeDate"===e.type&&(c="date");return{field:d,attributeType:c,rotationType:a,valueExpression:b.valueExpression,valueExpressionTitle:b.valueExpressionTitle||b.valueExpression&&f,normalizationField:b.normalizationField}},_setVariableTitle:function(b,a){b.legendOptions&&b.legendOptions.title||(b.legendOptions=b.legendOptions||{},b.legendOptions.title=l.getVisualVariableTitle(a,this.layer))},_getStatInfo:function(b,
a){return{statisticHash:u.getStatisticHash(b,a),attributeInfo:b,statisticType:a}},_addStatInfo:function(b,a){var c=this._findStatInfo(b,a);c?c.attributeInfo.valueExpressionTitle||(c.attributeInfo.valueExpressionTitle=a.attributeInfo.valueExpressionTitle):b.push(a)},_findStatInfo:function(b,a){var c;p.some(b,function(b){b.statisticHash===a.statisticHash&&(c=b);return!!c});return c},_compareStatInfos:function(b,a){var c=p.filter(b,function(b){return!this._findStatInfo(a,b)},this),f=p.filter(a,function(a){return!this._findStatInfo(b,
a)},this);return f.length||c.length?{added:f,removed:c}:null},_addSizeByCountVariable:function(b){var a=this._createSizeByCountVariable();a&&this._addVariable(b,a)},_getSizeByCountVariable:function(b){b=b.getVisualVariablesForType("sizeInfo",!1)||[];return p.filter(b,function(b){return"cluster_count"===b.field})[0]},_updateSizeByCountVariable:function(){var b=this._renderer,a=this._getSizeByCountVariable(b);if(a){var c=this._createSizeByCountVariable();c&&this._replaceVariable(b,a,c)}},_createSizeByCountVariable:function(){var b=
this._clusterGenerator,a;if(b){a=b.getCurrentLodStats();var c=b.getNumFeatures(),b=b.clusters,f=a.min,d=a.max;1===a.count&&f===c||1===b.length&&b[0].count===c?(f=1,d=c):f&&f===d&&(d=2*f);a={type:"sizeInfo",field:"cluster_count",valueUnit:"unknown",minSize:12,maxSize:50,minDataValue:f,maxDataValue:d,legendOptions:{title:x}}}return a},_addVariable:function(b,a){var c=b.visualVariables||[];c.push(a);b.setVisualVariables(c)},_replaceVariable:function(b,a,c){var f=b.visualVariables;a=p.indexOf(f,a);-1<
a&&f.splice(a,1);f.push(c);b.setVisualVariables(f)},_getFields:function(a){var c=[new b({name:"cluster_count",type:"esriFieldTypeInteger"})];p.forEach(a,function(a){var f=a.statisticType;a=a.attributeInfo;var d;"avg"===f?d="date"===a.attributeType?"esriFieldTypeDate":"esriFieldTypeDouble":"type"===f&&(d=a.field?this.layer.getField(a.field).type:"esriFieldTypeString");c.push(new b({name:u.getClusterField(a,f),type:d}))},this);return c},_createInfoTemplate:function(){var b=this._statisticInfos,c=this._renderer,
f=[{fieldName:"cluster_count",label:x,visible:!0,format:{digitSeparator:!0,places:0}}],e=[],q=[d.substitute({count:"{cluster_count}"},y.countSummary)],g=this._isUVRenderer(c)?c.infos:[];p.forEach(b,function(b){var a,c,d=b.statisticType,l=b.attributeInfo,t=u.getClusterField(l,d),k=this._getFieldLabel(b);"avg"===d?(a={fieldName:t,label:k,visible:!0,format:"date"===l.attributeType?{dateFormat:"shortDateShortTime"}:{digitSeparator:!0,places:1}},c=this._getFieldSummary(b,t)):"type"===d&&(c="expression/"+
t,a={fieldName:c,visible:!0},e.push({name:t,title:k,returnType:"string",expression:this._getExpression(g,t)}),c=this._getFieldSummary(b,c));a&&f.push(a);c&&q.push(c)},this);return new a({fieldInfos:f,expressionInfos:e,description:q.join("\x3cbr/\x3e\x3cbr/\x3e")})},_updateInfoTemplate:function(b){var c=b.toJson(),f=this._isUVRenderer(this._renderer)?this._renderer.infos:[];p.forEach(this._statisticInfos,function(b){var a=b.statisticType;b=u.getClusterField(b.attributeInfo,a);"type"===a&&(a=this._findExpressionInfo(b,
c))&&(a.expression=this._getExpression(f,b))},this);return new a(c)},_findExpressionInfo:function(b,a){var c;p.some(a.expressionInfos,function(a){a.name===b&&(c=a);return!!c});return c},_escapeDoubleQuotes:function(b){return b?b.replace(/"/g,'\\"'):""},_getExpression:function(b,a){return["var uvInfos \x3d ["+this._getObjects(b).join(", ")+"];",'var predominantType \x3d Text($feature["'+a+'"]);','var label \x3d "'+this._escapeDoubleQuotes(y.predominantNoneValue)+'";',"for (var i \x3d 0; i \x3c Count(uvInfos); i++) {\nif (uvInfos[i].value \x3d\x3d predominantType) {\nlabel \x3d uvInfos[i].label;\nbreak;\n}\n}\nreturn label;"].join("\n")},
_getObjects:function(b){return p.map(b,function(b){return'{"value": "'+String(b.value)+'","label": "'+this._escapeDoubleQuotes(String(b.label))+'"}'},this)},_getFieldLabel:function(b){var a=b.statisticType,c=b.attributeInfo,f=c.field;b=c.normalizationField;var e="",q;"avg"===a?q=b?y.avgNormFieldLabel:y.avgFieldLabel:"type"===a&&(q=y.predominantFieldLabel);q&&(a=c.valueExpression?c.valueExpressionTitle:this.layer.getFieldLabel(f),b=b&&this.layer.getFieldLabel(b),e=d.substitute({fieldLabel:a||"",normFieldLabel:b||
""},q));return e},_getFieldSummary:function(b,a){var c=b.statisticType,f=b.attributeInfo,e=f.field,q=f.normalizationField,g="",u;"avg"===c?u=q?y.avgNormFieldSummary:y.avgFieldSummary:"type"===c&&(u=y.predominantFieldSummary);u&&(c=f.valueExpression?f.valueExpressionTitle:this.layer.getFieldLabel(e),q=q&&this.layer.getFieldLabel(q),g=d.substitute({fieldLabel:c||"",normFieldLabel:q||"",fieldValue:"{"+a+"}"},u));return g},_removeFromPopup:function(b){var a=this._map.infoWindow,c=a.features;if(c&&c.length){var f=
p.filter(c,function(a){return a.getLayer()!==b});f.length<c.length&&(f.length?a.setFeatures(f):(a.clearFeatures(),a.hide()))}},_resetClusterNav:function(){this._resetClusterNavPartial();this._popupClusterGraphic=null},_resetClusterNavPartial:function(){this._map.infoWindow.removeActions(this._popupActions);this._hideSingleGraphic(this._popupSingleGraphic);this._popupSingleGraphic=null},_addClusterBoundary:function(b,a){var c=a.clusterFillSymbol;c&&(c=new c.constructor(c.toJson()));c=new k(b,c);this._map.graphics.add(c);
this._clusterBoundary=c},_removeClusterBoundary:function(){this._map.graphics.remove(this._clusterBoundary);this._clusterBoundary=null},_createBrowseFeaturesAction:function(){return this._map.infoWindow.addActions([{title:B.NLS_browseFeatures,className:"browseFeatures",callback:n.hitch(this,function(b){b.preventDefault();b=this._map.infoWindow;var a=b.getSelectedFeature(),f=a.getChildGraphics(),d=b.getCurrentAnchor();b.setFeatures(f,{anchor:d});if(f=c.graphicsExtent(f))this._addClusterBoundary(f,
b),b.show(this._getPopupLocation(f,d));this._popupClusterGraphic=a})}])[0]},_getPopupLocation:function(b,a){var c=b.getCenter();a=a.toLowerCase();-1<a.indexOf("top")?c.update(c.x,b.ymax):-1<a.indexOf("bottom")?c.update(c.x,b.ymin):-1<a.indexOf("left")?c.update(b.xmin,c.y):c.update(b.xmax,c.y);return c},_createViewSummaryAction:function(){return this._map.infoWindow.addActions([{title:B.NLS_viewSummary,className:"viewSummary",callback:n.hitch(this,function(b){b.preventDefault();b=this._popupClusterGraphic;
var a=this._map.infoWindow;a.setFeatures([b]);a.show(b.geometry);this._popupClusterGraphic=null})}])[0]},_initClusterUpdates:function(){this._updateSizeVariable();this._updateClusterGraphics();this._eventHandles.push(this._clusterGenerator.on("update-end",n.hitch(this,function(b){b.mapLevelChange&&this._updateSizeVariable();this._updateClusterGraphics()})),this._clusterGenerator.on("index-complete",n.hitch(this,function(){this._updateSizeVariable()})))},_updateClusterGraphics:function(){this._hideSingleGraphics();
var b=[],a=[];p.forEach(this._clusterGenerator.clusters,function(c){var f=new k(c.centroid);f.setAggregationSourceLayer(this.layer);f.setAggregationInfo(c);this._applyClusterAttributes(f,c);1===c.count?(c=this._getSingleGraphic(f),a.push(c)):b.push(f)},this);this._showSingleGraphics(a);this._addGraphics(b)},_addGraphics:function(b){var a=this.container;a.clear();p.forEach(b,function(b){a.add(b)})},_getSingleGraphic:function(b){var a=this._clusterGenerator.getCell(b.getAggregationInfo().primary).features[0],
c=this.layer.renderer,c=c&&c.getSymbol(a),f=this._getSizeByCountVariable(this._renderer);c&&f&&(b=f?this._renderer.getSize(b,{sizeInfo:f,shape:c.style,resolution:this._map.getResolutionInMeters(),scale:this._map.getScale()}):null,a.setSize(b));return a},_showSingleGraphics:function(b){p.forEach(b,this._showSingleGraphic);this._singleGraphics=b},_hideSingleGraphics:function(){p.forEach(this._singleGraphics,function(b){b.setSize(null);this._hideSingleGraphic(b)},this);this._singleGraphics=null},_clearSingleGraphics:function(){p.forEach(this._singleGraphics,
function(b){b.setSize(null)});this._singleGraphics=null},_showSingleGraphic:function(b){b&&(b._suspended=!1,b.draw())},_hideSingleGraphic:function(b){b&&(b._suspended=!0,b.show(),b.draw())},_updateSizeVariable:function(){this.isClusteringEnabled()&&(this._updateSizeByCountVariable(),this.emit("renderer-change"))},_applyClusterAttributes:function(b,a){b.setAttributes(a.attributes)},_createLayerEventListeners:function(){var b=this.layer;this._eventHandles.push(b.on("visibility-change",n.hitch(this,
function(b){this.container.setVisibility(b.visible)})),b.on("scale-range-change",n.hitch(this,function(){this.container.setScaleRange(this.layer.minScale,this.layer.maxScale)})),b.on("renderer-change",n.hitch(this,function(){this._applyRenderer()})),b.on("info-template-change",n.hitch(this,function(){this._applyInfoTemplate()})))},_createMapEventListeners:function(){this._eventHandles.push(this._map.on("zoom-start",n.hitch(this,function(){this._removeClusterBoundary();this._removeFromPopup(this.container);
this._removeFromPopup(this.layer);this._resetClusterNav();this.container.clear();this._hideSingleGraphics()})))},_createPopupEventListeners:function(){var b=this._map.infoWindow;this._eventHandles.push(b.on("selection-change",n.hitch(this,function(){this._resetClusterNavPartial();var b=this._map.infoWindow.getSelectedFeature(),a=b&&b.getLayer();if(a){var c;a===this.container?(this._removeClusterBoundary(),c=this._createBrowseFeaturesAction()):a===this.layer&&b._suspended?(c=this._createViewSummaryAction(),
this._popupSingleGraphic=b,this._showSingleGraphic(b)):this._removeClusterBoundary();this._popupActions=c?[c]:null}})),b.on("clear-features",n.hitch(this,function(b){this._resetClusterNav();b.isIntermediate||this._removeClusterBoundary()})),b.on("hide",n.hitch(this,function(){this._popupSingleGraphic&&this._popupSingleGraphic.hide();this._clusterBoundary&&this._clusterBoundary.hide()})),b.on("show",n.hitch(this,function(){this._popupSingleGraphic&&this._popupSingleGraphic.show();this._clusterBoundary&&
this._clusterBoundary.show()})))},_destroyEventListeners:function(){p.forEach(this._eventHandles,function(b){b.remove()})}});m("extend-esri")&&n.setObject("layers.clustering.ClusterManager",r,h);return r})},"esri/dijit/PopupTemplate":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dojo/dom-construct ../kernel ../InfoTemplate ../PopupInfo ./PopupRenderer".split(" "),function(r,n,p,m,h,e,k,d){r=r([e,k],{declaredClass:"esri.dijit.PopupTemplate","-chains-":{constructor:"manual"},chartTheme:null,
constructor:function(d,c){n.mixin(this,c);this.initialize(d,c)},getTitle:function(d){var c;this.info&&(c=this.titleHasRelatedFields?"":this._getPopupValues(d,null,!0).title);return c||""},getContent:function(e){return this.info?(new d({template:this,graphic:e,chartTheme:this.chartTheme},m.create("div"))).domNode:""}});p("extend-esri")&&n.setObject("dijit.PopupTemplate",r,h);return r})},"esri/PopupInfo":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/i18n dojo/has dojo/Deferred dojo/sniff dojo/promise/all dojox/html/entities ./lang ./kernel ./request ./promiseList ./tasks/query ./tasks/QueryTask ./tasks/RelationshipQuery ./tasks/StatisticDefinition ./support/expressionUtils ./layers/support/attributeUtils dojo/i18n!dojo/cldr/nls/number".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A,y,B){r=r(null,{declaredClass:"esri.PopupInfo",_reExprField:/^\s*expression\//i,_exprPrefix:"expression/",_relatedFieldPrefix:"relationships/",initialize:function(b,a){if(b){n.mixin(this,a);this.info=b;this.title=this.getTitle;this.content=this.getContent;this._exprCache=this._compileExpressions(this.info.expressionInfos);var c=this._fieldLabels={},f=this._fieldsMap={};this.info.fieldInfos&&p.forEach(this.info.fieldInfos,function(b){var a=b.fieldName.toLowerCase(),
d=this._isExpressionField(a)?this.getExpressionInfo(a):null;c[a]=d?d.title:b.label;f[a]=b},this);this.titleHasRelatedFields=!(!this.info.title||-1===this.info.title.indexOf("{"+this._relatedFieldPrefix))}},toJson:function(){return m.fromJson(m.toJson(this.info))},getTitle:function(){},getContent:function(){},getFieldInfo:function(b){var a;p.some(this.info&&this.info.fieldInfos,function(c){c.fieldName===b&&(a=c);return!!a});return a},getExpressionInfo:function(b){if(this._isExpressionField(b)){b=b.replace(this._reExprField,
"");b=b.toLowerCase();var a;p.some(this.info.expressionInfos,function(c){c.name.toLowerCase()===b&&(a=c);return!!a});return a}},hasGeometryOperations:function(){return p.some(this.info.expressionInfos,function(b){return A.hasGeometryOperations(b.expression)})},getComponents:function(b){var a=this.info,c={};a.fieldInfos&&(a=p.filter(a.fieldInfos,function(b){return-1!==b.fieldName.indexOf(this._relatedFieldPrefix)},this))&&0<a.length&&(c.relatedInfo=this._getRelatedRecords({graphic:b,fieldsInfo:a}));
this._needFullResolutionFeature(b)&&(c.fullResolutionFeature=this._getFullResolutionFeature(b));return v(c).then(n.hitch(this,function(a){return this._getPopupValues(b,a.fullResolutionFeature)}))},getAttachments:function(b){var a=b.getSourceLayer();b=b.attributes;if(this.info.showAttachments&&a&&a.hasAttachments&&a.objectIdField&&(b=b&&b[a.objectIdField]))return a.queryAttachmentInfos(b)},_needFullResolutionFeature:function(b){return(b=b.getSourceLayer())?"esriGeometryPoint"!==b.geometryType&&"function"===
typeof b.getMaxAllowableOffset&&0<b.getMaxAllowableOffset()&&this.hasGeometryOperations():!1},_getFullResolutionFeature:function(b){var a=b.getSourceLayer(),c=a.objectIdField;b=(b=b.attributes)&&c&&b[c];if(null==b)return null;var d=new f;d.objectIds=[b];d.maxAllowableOffset=0;d.outFields=[c];return a.queryFeatures(d).then(function(b){return b.features&&b.features[0]})},_isExpressionField:function(b){return this._reExprField.test(b)},_compileExpressions:function(b){var a={};p.forEach(b,function(b){var c=
b.returnType&&b.returnType.toLowerCase();a[b.name]=y.createAttributeCache({valueExpression:b.expression},"number"!==c)});return a},_fetchAttributes:function(b,a){var f=n.clone(b.attributes)||{},d=a&&a.geometry,e=this._exprPrefix,q=this._exprCache;p.forEach(this.info.expressionInfos,function(a){var g=e+a.name;a=(a=q[a.name])?b._getDataValue(a.attributeInfo,a,A,null,d):null;"string"===typeof a&&(a=c.encode(a));f[g]=a});return f},_getPopupValues:function(b,c,f){var d=this.info,e=b.getSourceLayer(),q=
this._fetchAttributes(b,c),g=n.clone(q);c=d.fieldInfos;var u="",l="",t,k,h,v,A,w=e&&e._getDateOpts&&e._getDateOpts().properties,w=w&&w.slice(0),m={dateFormat:{properties:w,formatter:"DateFormat"+this._insertOffset(this._dateFormats.shortDateShortTime)}};if(this._relatedInfo)for(v in this._relatedInfo)if(this._relatedInfo.hasOwnProperty(v)){var x=this._relatedInfo[v],y=this._relatedLayersInfo[v];x&&(p.forEach(x.relatedFeatures,function(b){for(A in b.attributes)if(b.attributes.hasOwnProperty(A)&&"esriRelCardinalityOneToOne"===
y.relation.cardinality){var a=this._toRelatedFieldName([y.relation.id,A]);q[a]=g[a]=b.attributes[A]}},this),p.forEach(x.relatedStatsFeatures,function(b){for(A in b.attributes)if(b.attributes.hasOwnProperty(A)){var a=this._toRelatedFieldName([y.relation.id,A]);q[a]=g[a]=b.attributes[A]}},this))}c&&p.forEach(c,function(b){k=b.fieldName;var a=this._getLayerFieldInfo(e,k);a&&(k=b.fieldName=a.name);g[k]=this._formatValue(g[k],k,m);w&&b.format&&b.format.dateFormat&&(b=p.indexOf(w,k),-1<b&&w.splice(b,1))},
this);if(e){v=e.types;var z=(x=e.typeIdField)&&q[x];for(k in q)if(q.hasOwnProperty(k)&&-1===k.indexOf(this._relatedFieldPrefix)&&(h=q[k],a.isDefined(h))){var r=this._getDomainName(e,b,v,z,k,h);a.isDefined(r)?g[k]=r:k===x&&(r=this._getTypeName(e,b,h),a.isDefined(r)&&(g[k]=r))}}d.title&&(u=this._processFieldsInLinks(this._fixTokens(d.title,e),q),u=n.trim(a.substitute(g,u,m)||""));if(f)return{title:u};d.description&&(l=this._processFieldsInLinks(this._fixTokens(d.description,e),q),l=n.trim(a.substitute(g,
l,m)||""));c&&(t=[],p.forEach(c,function(b){(k=b.fieldName)&&b.visible&&t.push([this._fieldLabels[k.toLowerCase()]||k,a.substitute(g,"${"+k+"}",m)||""])},this));var B,Q;d.mediaInfos&&(B=[],p.forEach(d.mediaInfos,function(b){Q=0;h=b.value;switch(b.type){case "image":var c=h.sourceURL,c=c&&n.trim(a.substitute(q,this._fixTokens(c,e)));Q=!!c;break;case "piechart":case "linechart":case "columnchart":case "barchart":var f,c=h.normalizeField;h.fields=p.map(h.fields,function(b){return(f=this._getLayerFieldInfo(e,
b))?f.name:b},this);c&&(f=this._getLayerFieldInfo(e,c),h.normalizeField=f?f.name:c);Q=p.some(h.fields,function(b){return a.isDefined(q[b])||-1!==b.indexOf(this._relatedFieldPrefix)&&this._relatedInfo},this);break;default:return}if(Q){b=n.clone(b);h=b.value;var c=b.title?this._processFieldsInLinks(this._fixTokens(b.title,e),q):"",d=b.caption?this._processFieldsInLinks(this._fixTokens(b.caption,e),q):"";b.title=c?n.trim(a.substitute(g,c,m)||""):"";b.caption=d?n.trim(a.substitute(g,d,m)||""):"";if("image"===
b.type)h.sourceURL=a.substitute(q,this._fixTokens(h.sourceURL,e)),h.linkURL&&(h.linkURL=n.trim(a.substitute(q,this._fixTokens(h.linkURL,e))||""));else{var u,l;p.forEach(h.fields,function(b,a){if(-1!==b.indexOf(this._relatedFieldPrefix))l=this._getRelatedChartInfos(b,h,q,m),l instanceof Array?h.fields=l:h.fields[a]=l;else{var c=q[b],c=void 0===c?null:c;u=q[h.normalizeField]||0;c&&u&&(c/=u);h.fields[a]={y:c,tooltip:(this._fieldLabels[b.toLowerCase()]||b)+":\x3cbr/\x3e"+this._formatValue(c,b,m,!!u)}}},
this)}B.push(b)}},this));return{title:u,description:l,hasDescription:!!d.description,fields:t&&t.length?t:null,mediaInfos:B&&B.length?B:null,formatted:g,editSummary:e&&e.getEditSummary?e.getEditSummary(b):""}},_getRelatedChartInfos:function(b,c,f,d){var e,q,g,u,l,t;e=[];t=this._fromRelatedFieldName(b);l=t[0];q=this._relatedInfo[l];l=this._relatedLayersInfo[l];q&&p.forEach(q.relatedFeatures,function(q){q=q.attributes;var l,k;for(k in q)if(q.hasOwnProperty(k)&&k===t[1]){l={};u=q[k];c.normalizeField&&
(g=-1!==c.normalizeField.indexOf(this._relatedFieldPrefix)?q[this._fromRelatedFieldName(c.normalizeField)[1]]:f[c.normalizeField]);u&&g&&(u/=g);if(c.tooltipField)if(-1!==c.tooltipField.indexOf(this._relatedFieldPrefix)){var h=this._fromRelatedFieldName(c.tooltipField)[1],v=a.isDefined(q[h])?q[h]:h;l.tooltip=v+":\x3cbr/\x3e"+this._formatValue(u,h,d,!!g)}else l.tooltip=(this._fieldLabels[b.toLowerCase()]||b)+":\x3cbr/\x3e"+this._formatValue(u,c.tooltipField,d,!!g);else l.tooltip=u;l.y=u;e.push(l)}},
this);return"esriRelCardinalityOneToMany"===l.relation.cardinality||"esriRelCardinalityManyToMany"===l.relation.cardinality?e:e[0]},_dateFormats:{shortDate:"(datePattern: 'M/d/y', selector: 'date')",shortDateLE:"(datePattern: 'd/M/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')",
shortDateLEShortTime:"(datePattern: 'd/M/y', timePattern: 'h:mm a', selector: 'date and time')",shortDateShortTime24:"(datePattern: 'M/d/y', timePattern: 'H:mm', selector: 'date and time')",shortDateLEShortTime24:"(datePattern: 'd/M/y', timePattern: 'H:mm', selector: 'date and time')",shortDateLongTime:"(datePattern: 'M/d/y', timePattern: 'h:mm:ss a', selector: 'date and time')",shortDateLELongTime:"(datePattern: 'd/M/y', timePattern: 'h:mm:ss a', selector: 'date and time')",shortDateLongTime24:"(datePattern: 'M/d/y', timePattern: 'H:mm:ss', selector: 'date and time')",
shortDateLELongTime24:"(datePattern: 'd/M/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')"},_reHref:/href\s*=\s*\"([^\"]+)\"/ig,_reHrefApos:/href\s*=\s*\'([^\']+)\'/ig,_reEmptyHref:/^href\s*=\s*"\s*"$/i,_reEmptyHrefApos:/^href\s*=\s*'\s*'$/i,_fixTokens:function(b,a){var c=this;return b.replace(/(\{([^\{\r\n]+)\})/g,function(b,f,d){b=
c._getLayerFieldInfo(a,d);return"$"+(b?"{"+b.name+"}":f)})},_encodeAttributes:function(b){b=n.clone(b)||{};var a,c;for(a in b)(c=b[a])&&"string"===typeof c&&(c=encodeURIComponent(c).replace(/\'/g,"\x26apos;"),b[a]=c);return b},_processFieldsInLinks:function(b,a){var c=this._encodeAttributes(a),c=n.hitch(this,this._addValuesToHref,a,c);b&&(b=b.replace(this._reHref,c).replace(this._reHrefApos,c));return b},_addValuesToHref:function(b,c,f,d){d=d&&n.trim(d);f=a.substitute(d&&0===d.indexOf("${")?b:c,f);
this._reEmptyHref.test(f)?f='href\x3d"about:blank"':this._reEmptyHrefApos.test(f)&&(f="href\x3d'about:blank'");return f},_getLayerFieldInfo:function(b,a){return b&&b.getField?b.getField(a):null},_formatValue:function(b,c,f,d){var q=this._fieldsMap[c.toLowerCase()],e=q&&q.format;c=-1!==p.indexOf(f.dateFormat.properties,c);var g="number"===typeof b&&!c&&(!e||!e.dateFormat);if(!a.isDefined(b)||!q||!a.isDefined(e))return g?this._forceLTR(b):b;var u="",q=[],l=e.hasOwnProperty("places")||e.hasOwnProperty("digitSeparator"),
t=e.hasOwnProperty("digitSeparator")?e.digitSeparator:!0;if(l&&!c)u="NumberFormat",q.push("places: "+(a.isDefined(e.places)&&(!d||0<e.places)?Number(e.places):"Infinity")),q.length&&(u+="("+q.join(",")+")");else if(e.dateFormat)u="DateFormat"+this._insertOffset(this._dateFormats[e.dateFormat]||this._dateFormats.shortDateShortTime);else return g?this._forceLTR(b):b;var k=this._applyFormatting(b,u,f);l&&-1<b.constructor.toString().indexOf("Array")&&(k="",p.forEach(b,n.hitch(this,function(b,a){a&&(k+=
" ");k+=this._applyFormatting(b,u,f)})));l&&!t&&B.group&&(k=k.replace(new RegExp("\\"+B.group,"g"),""));c&&(k='\x3cspan class\x3d"esriDateValue"\x3e'+k+"\x3c/span\x3e");return g?this._forceLTR(k):k},_applyFormatting:function(b,c,f){return a.substitute({myKey:b},"${myKey:"+c+"}",f)||""},_forceLTR:function(b){var a=d("ie");return a&&10>=a?b:"\x3cspan class\x3d'esriNumericValue'\x3e"+b+"\x3c/span\x3e"},_insertOffset:function(b){b&&(b=a.isDefined(this.utcOffset)?b.replace(/\)\s*$/,", utcOffset:"+this.utcOffset+
")"):b);return b},_getDomainName:function(b,a,c,f,d,e){return(b=b.getDomain&&b.getDomain(d,{feature:a}))&&b.codedValues?b.getName(e):null},_getTypeName:function(b,a,c){return(b=b.getType&&b.getType(a))&&b.name},_getRelatedRecords:function(b){var a=b.graphic,c;this._relatedLayersInfoPromise||(this._relatedLayersInfoPromise=this._getRelatedLayersInfo(b).then(n.hitch(this,function(b){for(c in b)b.hasOwnProperty(c)&&b[c]&&(this._relatedLayersInfo[c].relatedLayerInfo=b[c])})));return this._relatedLayersInfoPromise.then(n.hitch(this,
function(){return this._queryRelatedLayers(a)})).then(n.hitch(this,function(b){this._setRelatedRecords(a,b);return b}))},_getRelatedLayersInfo:function(b){var a=b.fieldsInfo,c,f,d={};c=b.graphic.getSourceLayer();this._relatedLayersInfo||(this._relatedLayersInfo={});p.forEach(a,function(b){var a,f,d,e;a=this._fromRelatedFieldName(b.fieldName);f=a[0];a=a[1];f&&(!this._relatedLayersInfo[f]&&c&&c.relationships&&(p.some(c.relationships,function(b){if(b.id==f)return e=b,!0}),e&&(this._relatedLayersInfo[f]=
{relation:e,relatedFields:[],outStatistics:[]})),this._relatedLayersInfo[f]&&(this._relatedLayersInfo[f].relatedFields.push(a),b.statisticType&&(d=new u,d.statisticType=b.statisticType,d.onStatisticField=a,d.outStatisticFieldName=a,this._relatedLayersInfo[f].outStatistics.push(d))))},this);for(f in this._relatedLayersInfo)this._relatedLayersInfo.hasOwnProperty(f)&&this._relatedLayersInfo[f]&&(b=this._relatedLayersInfo[f].relation,b=c.url.replace(/[0-9]+$/,b.relatedTableId),this._relatedLayersInfo[f].relatedLayerUrl=
b,d[f]=t({url:b,content:{f:"json"},callbackParamName:"callback"}));return g(d)},_queryRelatedLayers:function(b){var a={},c;for(c in this._relatedLayersInfo)this._relatedLayersInfo.hasOwnProperty(c)&&(a[c]=this._queryRelatedLayer({graphic:b,relatedInfo:this._relatedLayersInfo[c]}));return g(a)},_queryRelatedLayer:function(a){var c,d,e,q,u,l,t,h,v,A,m,x,y;c=a.graphic;d=c.getSourceLayer();e=d.url.match(/[0-9]+$/g)[0];m=a.relatedInfo;A=m.relatedLayerInfo;x=m.relatedLayerUrl;a=m.relation;p.some(A.relationships,
function(b){if(b.relatedTableId===parseInt(e,10))return q=b,!0},this);q&&(u=new f,p.some(A.fields,function(b){if(b.name===q.keyField)return h=-1!==p.indexOf(["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],b.type)?"number":"string",!0}),q.relationshipTableId&&q.keyFieldInRelationshipTable?(y=new k,this._queryRelatedRecords(c,q).then(n.hitch(this,function(a){var e;(e=a[c.attributes[d.objectIdField]])?(a=p.map(e.features,function(b){return b.attributes[A.objectIdField]},
this),m.outStatistics&&0<m.outStatistics.length&&A.supportsStatistics&&(v=new f,v.objectIds=a,v.outFields=u.outFields,v.outStatistics=m.outStatistics),v&&(l=new b(x),l.execute(v).then(n.hitch(this,function(b){var a=[];a.push(e);a.push(b);y.resolve(a)})))):y.resolve()}))):(t="string"===h?q.keyField+"\x3d'"+c.attributes[a.keyField]+"'":q.keyField+"\x3d"+c.attributes[a.keyField],u.where=t,u.outFields=m.relatedFields,m.outStatistics&&0<m.outStatistics.length&&A.supportsStatistics&&(v=new f,v.where=u.where,
v.outFields=u.outFields,v.outStatistics=m.outStatistics),l=new b(x),t=[],t.push(l.execute(u)),v&&t.push(l.execute(v))));return t?g(t):y?y.promise:void 0},_setRelatedRecords:function(b,c){this._relatedInfo=[];for(var f in c)if(c.hasOwnProperty(f)&&c[f]){var d=c[f];this._relatedInfo[f]={};this._relatedInfo[f].relatedFeatures=d[0].features;a.isDefined(d[1])&&(this._relatedInfo[f].relatedStatsFeatures=d[1].features)}},_handlerErrorResponse:function(b,a){b.reject(a)},_fromRelatedFieldName:function(b){var a=
[];-1!==b.indexOf(this._relatedFieldPrefix)&&(b=b.split("/"),a=b.slice(1));return a},_toRelatedFieldName:function(b){var a="";b&&0<b.length&&(a=this._relatedFieldPrefix+b[0]+"/"+b[1]);return a},_queryRelatedRecords:function(b,a){var c=b.getSourceLayer(),f=new q;f.outFields=["*"];f.relationshipId=a.id;f.objectIds=[b.attributes[c.objectIdField]];return c.queryRelatedFeatures(f)}});e("extend-esri")&&(l.PopupInfo=l.PopupInfoTemplate=r);return r})},"dojox/html/entities":function(){define(["dojo/_base/lang"],
function(r){var n=r.getObject("dojox.html.entities",!0),p=function(h,e){var k,d;if(e._encCache&&e._encCache.regexp&&e._encCache.mapper&&e.length==e._encCache.length)k=e._encCache.mapper,d=e._encCache.regexp;else{k={};d=["["];var g;for(g=0;g<e.length;g++)k[e[g][0]]="\x26"+e[g][1]+";",d.push(e[g][0]);d.push("]");d=new RegExp(d.join(""),"g");e._encCache={mapper:k,regexp:d,length:e.length}}return h=h.replace(d,function(c){return k[c]})},m=function(h,e){var k,d;if(e._decCache&&e._decCache.regexp&&e._decCache.mapper&&
e.length==e._decCache.length)k=e._decCache.mapper,d=e._decCache.regexp;else{k={};d=["("];var g;for(g=0;g<e.length;g++){var c="\x26"+e[g][1]+";";g&&d.push("|");k[c]=e[g][0];d.push(c)}d.push(")");d=new RegExp(d.join(""),"g");e._decCache={mapper:k,regexp:d,length:e.length}}return h=h.replace(d,function(a){return k[a]})};n.html=[["\x26","amp"],['"',"quot"],["\x3c","lt"],["\x3e","gt"],["\u00a0","nbsp"]];n.latin=[["\u00a1","iexcl"],["\u00a2","cent"],["\u00a3","pound"],["\u20ac","euro"],["\u00a4","curren"],
["\u00a5","yen"],["\u00a6","brvbar"],["\u00a7","sect"],["\u00a8","uml"],["\u00a9","copy"],["\u00aa","ordf"],["\u00ab","laquo"],["\u00ac","not"],["\u00ad","shy"],["\u00ae","reg"],["\u00af","macr"],["\u00b0","deg"],["\u00b1","plusmn"],["\u00b2","sup2"],["\u00b3","sup3"],["\u00b4","acute"],["\u00b5","micro"],["\u00b6","para"],["\u00b7","middot"],["\u00b8","cedil"],["\u00b9","sup1"],["\u00ba","ordm"],["\u00bb","raquo"],["\u00bc","frac14"],["\u00bd","frac12"],["\u00be","frac34"],["\u00bf","iquest"],["\u00c0",
"Agrave"],["\u00c1","Aacute"],["\u00c2","Acirc"],["\u00c3","Atilde"],["\u00c4","Auml"],["\u00c5","Aring"],["\u00c6","AElig"],["\u00c7","Ccedil"],["\u00c8","Egrave"],["\u00c9","Eacute"],["\u00ca","Ecirc"],["\u00cb","Euml"],["\u00cc","Igrave"],["\u00cd","Iacute"],["\u00ce","Icirc"],["\u00cf","Iuml"],["\u00d0","ETH"],["\u00d1","Ntilde"],["\u00d2","Ograve"],["\u00d3","Oacute"],["\u00d4","Ocirc"],["\u00d5","Otilde"],["\u00d6","Ouml"],["\u00d7","times"],["\u00d8","Oslash"],["\u00d9","Ugrave"],["\u00da",
"Uacute"],["\u00db","Ucirc"],["\u00dc","Uuml"],["\u00dd","Yacute"],["\u00de","THORN"],["\u00df","szlig"],["\u00e0","agrave"],["\u00e1","aacute"],["\u00e2","acirc"],["\u00e3","atilde"],["\u00e4","auml"],["\u00e5","aring"],["\u00e6","aelig"],["\u00e7","ccedil"],["\u00e8","egrave"],["\u00e9","eacute"],["\u00ea","ecirc"],["\u00eb","euml"],["\u00ec","igrave"],["\u00ed","iacute"],["\u00ee","icirc"],["\u00ef","iuml"],["\u00f0","eth"],["\u00f1","ntilde"],["\u00f2","ograve"],["\u00f3","oacute"],["\u00f4",
"ocirc"],["\u00f5","otilde"],["\u00f6","ouml"],["\u00f7","divide"],["\u00f8","oslash"],["\u00f9","ugrave"],["\u00fa","uacute"],["\u00fb","ucirc"],["\u00fc","uuml"],["\u00fd","yacute"],["\u00fe","thorn"],["\u00ff","yuml"],["\u0192","fnof"],["\u0391","Alpha"],["\u0392","Beta"],["\u0393","Gamma"],["\u0394","Delta"],["\u0395","Epsilon"],["\u0396","Zeta"],["\u0397","Eta"],["\u0398","Theta"],["\u0399","Iota"],["\u039a","Kappa"],["\u039b","Lambda"],["\u039c","Mu"],["\u039d","Nu"],["\u039e","Xi"],["\u039f",
"Omicron"],["\u03a0","Pi"],["\u03a1","Rho"],["\u03a3","Sigma"],["\u03a4","Tau"],["\u03a5","Upsilon"],["\u03a6","Phi"],["\u03a7","Chi"],["\u03a8","Psi"],["\u03a9","Omega"],["\u03b1","alpha"],["\u03b2","beta"],["\u03b3","gamma"],["\u03b4","delta"],["\u03b5","epsilon"],["\u03b6","zeta"],["\u03b7","eta"],["\u03b8","theta"],["\u03b9","iota"],["\u03ba","kappa"],["\u03bb","lambda"],["\u03bc","mu"],["\u03bd","nu"],["\u03be","xi"],["\u03bf","omicron"],["\u03c0","pi"],["\u03c1","rho"],["\u03c2","sigmaf"],["\u03c3",
"sigma"],["\u03c4","tau"],["\u03c5","upsilon"],["\u03c6","phi"],["\u03c7","chi"],["\u03c8","psi"],["\u03c9","omega"],["\u03d1","thetasym"],["\u03d2","upsih"],["\u03d6","piv"],["\u2022","bull"],["\u2026","hellip"],["\u2032","prime"],["\u2033","Prime"],["\u203e","oline"],["\u2044","frasl"],["\u2118","weierp"],["\u2111","image"],["\u211c","real"],["\u2122","trade"],["\u2135","alefsym"],["\u2190","larr"],["\u2191","uarr"],["\u2192","rarr"],["\u2193","darr"],["\u2194","harr"],["\u21b5","crarr"],["\u21d0",
"lArr"],["\u21d1","uArr"],["\u21d2","rArr"],["\u21d3","dArr"],["\u21d4","hArr"],["\u2200","forall"],["\u2202","part"],["\u2203","exist"],["\u2205","empty"],["\u2207","nabla"],["\u2208","isin"],["\u2209","notin"],["\u220b","ni"],["\u220f","prod"],["\u2211","sum"],["\u2212","minus"],["\u2217","lowast"],["\u221a","radic"],["\u221d","prop"],["\u221e","infin"],["\u2220","ang"],["\u2227","and"],["\u2228","or"],["\u2229","cap"],["\u222a","cup"],["\u222b","int"],["\u2234","there4"],["\u223c","sim"],["\u2245",
"cong"],["\u2248","asymp"],["\u2260","ne"],["\u2261","equiv"],["\u2264","le"],["\u2265","ge"],["\u2282","sub"],["\u2283","sup"],["\u2284","nsub"],["\u2286","sube"],["\u2287","supe"],["\u2295","oplus"],["\u2297","otimes"],["\u22a5","perp"],["\u22c5","sdot"],["\u2308","lceil"],["\u2309","rceil"],["\u230a","lfloor"],["\u230b","rfloor"],["\u2329","lang"],["\u232a","rang"],["\u25ca","loz"],["\u2660","spades"],["\u2663","clubs"],["\u2665","hearts"],["\u2666","diams"],["\u0152","OElig"],["\u0153","oelig"],
["\u0160","Scaron"],["\u0161","scaron"],["\u0178","Yuml"],["\u02c6","circ"],["\u02dc","tilde"],["\u2002","ensp"],["\u2003","emsp"],["\u2009","thinsp"],["\u200c","zwnj"],["\u200d","zwj"],["\u200e","lrm"],["\u200f","rlm"],["\u2013","ndash"],["\u2014","mdash"],["\u2018","lsquo"],["\u2019","rsquo"],["\u201a","sbquo"],["\u201c","ldquo"],["\u201d","rdquo"],["\u201e","bdquo"],["\u2020","dagger"],["\u2021","Dagger"],["\u2030","permil"],["\u2039","lsaquo"],["\u203a","rsaquo"]];n.encode=function(h,e){h&&(e?
h=p(h,e):(h=p(h,n.html),h=p(h,n.latin)));return h};n.decode=function(h,e){h&&(e?h=m(h,e):(h=m(h,n.html),h=m(h,n.latin)));return h};return n})},"esri/tasks/RelationshipQuery":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/has","../kernel"],function(r,n,p,m,h){r=r(null,{declaredClass:"esri.tasks.RelationshipQuery",definitionExpression:"",relationshipId:null,returnGeometry:!1,objectIds:null,outSpatialReference:null,outFields:null,toJson:function(){var e={definitionExpression:this.definitionExpression,
relationshipId:this.relationshipId,returnGeometry:this.returnGeometry,maxAllowableOffset:this.maxAllowableOffset,geometryPrecision:this.geometryPrecision},k=this.objectIds,d=this.outFields,g=this.outSpatialReference;k&&(e.objectIds=k.join(","));d&&(e.outFields=d.join(","));g&&(e.outSR=g.wkid||p.toJson(g.toJson()));e._ts=this._ts;return e}});m("extend-esri")&&n.setObject("tasks.RelationshipQuery",r,h);return r})},"esri/dijit/PopupRenderer":function(){define("require dojo/_base/declare dojo/_base/connect dojo/_base/lang dojo/_base/array dojo/_base/kernel dojo/sniff dojo/query dojo/dom dojo/dom-attr dojo/dom-class dojo/dom-construct dojo/dom-style dojox/html/entities dijit/_Widget dijit/_Templated ../kernel ../lang ../urlUtils ./_EventedWidget dojo/i18n!../nls/jsapi dojo/NodeList-dom".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A,y,B){var x=0,w=B.widgets.popup,z=B.widgets.templatePicker;n=n([y,f,b],{declaredClass:"esri.dijit._PopupRenderer",constructor:function(){this._nls=m.mixin({},w)},templateString:"\x3cdiv class\x3d'esriViewPopup'\x3e\x3cdiv class\x3d'statusSection hidden' dojoAttachPoint\x3d'_status'\x3e\x3c/div\x3e\x3cdiv class\x3d'mainSection'\x3e\x3cdiv class\x3d'header' dojoAttachPoint\x3d'_title'\x3e\x3c/div\x3e\x3cdiv class\x3d'hzLine'\x3e\x3c/div\x3e\x3cdiv dojoAttachPoint\x3d'_description'\x3e\x3c/div\x3e\x3cdiv class\x3d'break'\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'attachmentsSection hidden'\x3e\x3cdiv\x3e${_nls.NLS_attach}:\x3c/div\x3e\x3cul dojoAttachPoint\x3d'_attachmentsList'\x3e\x3c/ul\x3e\x3cdiv class\x3d'break'\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'mediaSection hidden'\x3e\x3cdiv class\x3d'header' dojoAttachPoint\x3d'_mediaTitle'\x3e\x3c/div\x3e\x3cdiv class\x3d'hzLine'\x3e\x3c/div\x3e\x3cdiv class\x3d'caption' dojoAttachPoint\x3d'_mediaCaption'\x3e\x3c/div\x3e\x3cdiv class\x3d'gallery' dojoAttachPoint\x3d'_gallery'\x3e\x3cdiv class\x3d'mediaHandle prev' dojoAttachPoint\x3d'_prevMedia' dojoAttachEvent\x3d'onclick: _goToPrevMedia'\x3e\x3c/div\x3e\x3cdiv class\x3d'mediaHandle next' dojoAttachPoint\x3d'_nextMedia' dojoAttachEvent\x3d'onclick: _goToNextMedia'\x3e\x3c/div\x3e\x3cul class\x3d'summary'\x3e\x3cli class\x3d'image mediaCount hidden' dojoAttachPoint\x3d'_imageCount'\x3e0\x3c/li\x3e\x3cli class\x3d'image mediaIcon hidden'\x3e\x3c/li\x3e\x3cli class\x3d'chart mediaCount hidden' dojoAttachPoint\x3d'_chartCount'\x3e0\x3c/li\x3e\x3cli class\x3d'chart mediaIcon hidden'\x3e\x3c/li\x3e\x3c/ul\x3e\x3cdiv class\x3d'frame' dojoAttachPoint\x3d'_mediaFrame'\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'editSummarySection hidden' dojoAttachPoint\x3d'_editSummarySection'\x3e\x3cdiv class\x3d'break'\x3e\x3c/div\x3e\x3cdiv class\x3d'break hidden' dojoAttachPoint\x3d'_mediaBreak'\x3e\x3c/div\x3e\x3cdiv class\x3d'editSummary' dojoAttachPoint\x3d'_editSummary'\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e",
showTitle:!0,startup:function(){this.inherited(arguments);this._showStatus(z.loading);this._contentDfd=this.template.getComponents(this.graphic).then(m.hitch(this,this._handleComponentsSuccess)).otherwise(m.hitch(this,this._handleComponentsError))},destroy:function(){this._contentDfd&&this._contentDfd.cancel();this._attachmentsDfd&&this._attachmentsDfd.cancel();this._destroyFrame();this.template=this.graphic=this._nls=this._mediaInfos=this._mediaPtr=this._contentDfd=this._attachmentsDfd=null;this.inherited(arguments)},
_goToPrevMedia:function(){0>this._mediaPtr-1||(this._mediaPtr--,this._updateUI(),this._displayMedia())},_goToNextMedia:function(){this._mediaPtr+1!==this._mediaInfos.length&&(this._mediaPtr++,this._updateUI(),this._displayMedia())},_updateUI:function(){var b=this._mediaInfos,f=b.length,d=this.domNode,q=this._prevMedia,g=this._nextMedia;if(1<f){var u=0,l=0;h.forEach(b,function(b){"image"===b.type?u++:-1!==b.type.indexOf("chart")&&l++});u&&(c.set(this._imageCount,"innerHTML",u),e.query(".summary .image",
d).removeClass("hidden"));l&&(c.set(this._chartCount,"innerHTML",l),e.query(".summary .chart",d).removeClass("hidden"))}else e.query(".summary",d).addClass("hidden"),a.add(q,"hidden"),a.add(g,"hidden");b=this._mediaPtr;0===b?a.add(q,"hidden"):a.remove(q,"hidden");b===f-1?a.add(g,"hidden"):a.remove(g,"hidden");this._destroyFrame()},_displayMedia:function(){var b=this._mediaInfos[this._mediaPtr],f=b.title,d=b.caption,q=e.query(".mediaSection .hzLine",this.domNode)[0];c.set(this._mediaTitle,"innerHTML",
f);a[f?"remove":"add"](this._mediaTitle,"hidden");c.set(this._mediaCaption,"innerHTML",d);a[d?"remove":"add"](this._mediaCaption,"hidden");a[f&&d?"remove":"add"](q,"hidden");this._rid=null;if("image"===b.type)this._showImage(b);else{var g=this,f=["dojox/charting/Chart2D","dojox/charting/action2d/Tooltip"],d=b.value.theme||this.chartTheme;m.isString(d)&&(d=d.replace(/\./gi,"/"),-1===d.indexOf("/")&&(d="dojox/charting/themes/"+d));d||(d="./Rainbow");f.push(d);try{var u=this._rid=x++;r(f,function(a,
c,f){u===g._rid&&(g._rid=null,g._showChart(b.type,b.value,a,c,f))})}catch(N){console.log("PopupRenderer: error loading modules")}}},_preventNewTab:function(b){return(b=b&&m.trim(b).toLowerCase())&&(0===b.indexOf("mailto:")||0===b.indexOf("tel:"))},_showImage:function(b){a.add(this._mediaFrame,"image");var c=t.get(this._gallery,"height"),f=b.value,d;f.linkURL&&(d=l.create("a",{href:f.linkURL,target:this._preventNewTab(f.linkURL)?"":"_blank"},this._mediaFrame));f=b.refreshInterval?this._addURLParameter(f.sourceURL,
"timestamp",Date.now()):f.sourceURL;l.create("img",{className:"esriPopupMediaImage",src:f},d||this._mediaFrame);var q=e.query(".esriPopupMediaImage",this._mediaFrame)[0];this._imageLoadHandle=p.connect(q,"onload",this,function(){this._clearImageHandles();this._imageLoaded(q,c);this._initImageRefresh(b)})},_addURLParameter:function(b,a,c){var f=-1===b.indexOf("?")?"?":"\x26";return b+f+a+"\x3d"+c},_initImageRefresh:function(b){if(b.refreshInterval){var a=6E4*b.refreshInterval;this._imageRefreshHandle=
setTimeout(m.hitch(this,function(){this._destroyFrame();this._showImage(b)}),a)}},_clearImageHandles:function(){p.disconnect(this._imageLoadHandle);this._imageLoadHandle=null;clearTimeout(this._imageRefreshHandle);this._imageRefreshHandle=null},_showChart:function(b,c,f,d,q){a.remove(this._mediaFrame,"image");f=this._chart=new f(l.create("div",{"class":"chart"},this._mediaFrame),{margins:{l:4,t:4,r:4,b:4}});q&&f.setTheme(q);switch(b){case "piechart":f.addPlot("default",{type:"Pie",labels:!1});f.addSeries("Series A",
c.fields);break;case "linechart":f.addPlot("default",{type:"Markers"});f.addAxis("x",{min:0,majorTicks:!1,minorTicks:!1,majorLabels:!1,minorLabels:!1});f.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});h.forEach(c.fields,function(b,a){b.x=a+1});f.addSeries("Series A",c.fields);break;case "columnchart":f.addPlot("default",{type:"Columns",gap:3});f.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});f.addSeries("Series A",c.fields);break;case "barchart":f.addPlot("default",{type:"Bars",
gap:3}),f.addAxis("x",{includeZero:!0,fixUpper:"minor",minorLabels:!1}),f.addAxis("y",{vertical:!0,majorTicks:!1,minorTicks:!1,majorLabels:!1,minorLabels:!1}),f.addSeries("Series A",c.fields)}this._action=new d(f);f.render()},_destroyFrame:function(){this._rid=null;this._clearImageHandles();this._chart&&(this._chart.destroy(),this._chart=null);this._action&&(this._action.destroy(),this._action=null);c.set(this._mediaFrame,"innerHTML","")},_imageLoaded:function(b,a){var c=b.height;c<a&&t.set(b,"marginTop",
Math.round((a-c)/2)+"px")},_attListHandler:function(b,a){if(b===this._attachmentsDfd){this._attachmentsDfd=null;var f="";a instanceof Error||!a||!a.length||h.forEach(a,function(b){f+="\x3cli\x3e";f+="\x3ca href\x3d'"+A.addProxy(b.url)+"' target\x3d'_blank'\x3e"+(b.name||"[No name]")+"\x3c/a\x3e";f+="\x3c/li\x3e"});c.set(this._attachmentsList,"innerHTML",f||"\x3cli\x3e"+this._nls.NLS_noAttach+"\x3c/li\x3e")}},_supportedURIInfos:[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,label:w.NLS_moreInfo},{pattern:/^\s*(tel:([^\s]+))\s*$/i,
label:"${hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"${hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,appName:"App Studio Player",label:w.NLS_openLinkInApp},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,appName:"Collector",label:w.NLS_openLinkInApp},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,appName:"Explorer",label:w.NLS_openLinkInApp},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,appName:"Navigator",label:w.NLS_openLinkInApp},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,
appName:"Survey123",label:w.NLS_openLinkInApp},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,appName:"Trek2There",label:w.NLS_openLinkInApp},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,appName:"Workforce",label:w.NLS_openLinkInApp},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,appName:"iForm",label:w.NLS_openLinkInApp},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,appName:"FlowFinity",label:w.NLS_openLinkInApp},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,appName:"Laserfische",label:w.NLS_openLinkInApp},
{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,appName:"Microsoft Power BI",label:w.NLS_openLinkInApp}],_findURIInfo:function(b){var a;h.some(this._supportedURIInfos,function(c){c.pattern.test(b)&&(a=c);return!!a});return a},_createLinkIfURI:function(b){var a=this._findURIInfo(b);if(a){var c=b.match(a.pattern);return b.replace(a.pattern,"\x3ca target\x3d'_blank' href\x3d'$1' title\x3d'$1'\x3e"+u.substitute({appName:a.appName,hierPart:c&&c[2]},a.label)+"\x3c/a\x3e")}return b},_showStatus:function(b){c.set(this._status,
"innerHTML",b);a.remove(this._status,"hidden");e.query(".mainSection",this.domNode).addClass("hidden")},_hideStatus:function(){c.set(this._status,"innerHTML","");a.add(this._status,"hidden");e.query(".mainSection",this.domNode).removeClass("hidden")},_handleComponentsSuccess:function(b){if(b){this._hideStatus();var f=this.showTitle?b.title:"",d=b.description,q=b.fields,u=b.mediaInfos,l=this.domNode,t=this._nls,k=this,A=this.template,n=this.graphic;this._prevMedia.title=t.NLS_prevMedia;this._nextMedia.title=
t.NLS_nextMedia;c.set(this._title,"innerHTML",f);f||a.add(this._title,"hidden");!b.hasDescription&&q&&(d="",h.forEach(q,function(b){d+="\x3ctr valign\x3d'top'\x3e";d+="\x3ctd class\x3d'attrName'\x3e"+v.encode(b[0])+"\x3c/td\x3e";d+="\x3ctd class\x3d'attrValue'\x3e"+this._createLinkIfURI(b[1])+"\x3c/td\x3e";d+="\x3c/tr\x3e"},this),d&&(d="\x3ctable class\x3d'attrTable' cellpadding\x3d'0px' cellspacing\x3d'0px'\x3e"+d+"\x3c/table\x3e"));c.set(this._description,"innerHTML",d);d||a.add(this._description,
"hidden");e.query("a",this._description).forEach(function(b){k._preventNewTab(b.href)?"_blank"===b.target&&c.remove(b,"target"):c.set(b,"target","_blank")});f&&d?e.query(".mainSection .hzLine",l).removeClass("hidden"):f||d?e.query(".mainSection .hzLine",l).addClass("hidden"):e.query(".mainSection",l).addClass("hidden");if(f=this._attachmentsDfd=A.getAttachments(n))f.addBoth(m.hitch(this,this._attListHandler,f)),c.set(this._attachmentsList,"innerHTML","\x3cli\x3e"+t.NLS_searching+"...\x3c/li\x3e"),
e.query(".attachmentsSection",l).removeClass("hidden");u&&u.length&&(e.query(".mediaSection",l).removeClass("hidden"),g.setSelectable(this._mediaFrame,!1),this._mediaInfos=u,this._mediaPtr=0,this._updateUI(),this._displayMedia());b.editSummary&&(c.set(this._editSummary,"innerHTML",b.editSummary),u&&u.length&&a.remove(this._mediaBreak,"hidden"),a.remove(this._editSummarySection,"hidden"));this.emit("content-update")}else this._showStatus(w.NLS_noInfo)},_handleComponentsError:function(b){b&&"cancel"===
b.dojoType||(console.log("PopupRenderer: error loading template",b),this._showStatus(w.NLS_noInfo))}});k("extend-esri")&&m.setObject("dijit._PopupRenderer",n,q);return n})},"dijit/_Widget":function(){define("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".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l,t){function v(){}function f(b){return function(a,
c,f,d){return a&&"string"==typeof c&&a[c]==v?a.on(c.substring(2).toLowerCase(),k.hitch(f,d)):b.apply(p,arguments)}}r.around(p,"connect",f);e.connect&&r.around(e,"connect",f);r=m("dijit._Widget",[a,l,t],{onClick:v,onDblClick:v,onKeyDown:v,onKeyPress:v,onKeyUp:v,onMouseDown:v,onMouseMove:v,onMouseOut:v,onMouseOver:v,onMouseLeave:v,onMouseEnter:v,onMouseUp:v,constructor:function(b){this._toConnect={};for(var a in b)this[a]===v&&(this._toConnect[a.replace(/^on/,"").toLowerCase()]=b[a],delete b[a])},postCreate:function(){this.inherited(arguments);
for(var b in this._toConnect)this.on(b,this._toConnect[b]);delete this._toConnect},on:function(b,a){return this[this._onMap(b)]===v?p.connect(this.domNode,b.toLowerCase(),this,a):this.inherited(arguments)},_setFocusedAttr:function(b){this._focused=b;this._set("focused",b)},setAttribute:function(b,a){e.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(b,a)},attr:function(b,a){return 2<=arguments.length||"object"===typeof b?this.set.apply(this,
arguments):this.get(b)},getDescendants:function(){e.deprecated(this.declaredClass+"::getDescendants() is deprecated. Use getChildren() instead.","","2.0");return this.containerNode?d("[widgetId]",this.containerNode).map(c.byNode):[]},_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return!0}});h("dijit-legacy-requires")&&g(0,function(){require(["dijit/_base"])});return r})},"dijit/_WidgetBase":function(){define("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 dojo/has!dojo-bidi?./_BidiMixin ./registry".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A,y,B,x,w){function z(b){return function(a){d[a?"set":"remove"](this.domNode,b,a);this._set(b,a)}}t.add("dijit-legacy-requires",!v.isAsync);t.add("dojo-bidi",!1);t("dijit-legacy-requires")&&q(0,function(){r(["dijit/_base/manager"])});var E={};m=e("dijit._WidgetBase",[u,B],{id:"",_setIdAttr:"domNode",lang:"",_setLangAttr:z("lang"),dir:"",_setDirAttr:z("dir"),"class":"",_setClassAttr:{node:"domNode",type:"class"},_setTypeAttr:null,style:"",title:"",tooltip:"",
baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,ownerDocument:null,_setOwnerDocumentAttr:function(b){this._set("ownerDocument",b)},attributeMap:{},_blankGif:m.blankGif||r.toUrl("dojo/resources/blank.gif"),textDir:"",_introspect:function(){var b=this.constructor;if(!b._setterAttrs){var a=b.prototype,c=b._setterAttrs=[],b=b._onMap={},f;for(f in a.attributeMap)c.push(f);for(f in a)/^on/.test(f)&&(b[f.substring(2).toLowerCase()]=f),/^_set[A-Z](.*)Attr$/.test(f)&&(f=f.charAt(4).toLowerCase()+
f.substr(5,f.length-9),a.attributeMap&&f in a.attributeMap||c.push(f))}},postscript:function(b,a){this.create(b,a)},create:function(b,a){this._introspect();this.srcNodeRef=k.byId(a);this._connects=[];this._supportingWidgets=[];this.srcNodeRef&&this.srcNodeRef.id&&"string"==typeof this.srcNodeRef.id&&(this.id=this.srcNodeRef.id);b&&(this.params=b,f.mixin(this,b));this.postMixInProperties();this.id||(this.id=w.getUniqueId(this.declaredClass.replace(/\./g,"_")),this.params&&delete this.params.id);this.ownerDocument=
this.ownerDocument||(this.srcNodeRef?this.srcNodeRef.ownerDocument:document);this.ownerDocumentBody=y.body(this.ownerDocument);w.add(this);this.buildRendering();var c;if(this.domNode){this._applyAttributes();var d=this.srcNodeRef;d&&d.parentNode&&this.domNode!==d&&(d.parentNode.replaceChild(this.domNode,d),c=!0);this.domNode.setAttribute("widgetId",this.id)}this.postCreate();c&&delete this.srcNodeRef;this._created=!0},_applyAttributes:function(){var b={},a;for(a in this.params||{})b[a]=this._get(a);
n.forEach(this.constructor._setterAttrs,function(a){if(!(a in b)){var c=this._get(a);c&&this.set(a,c)}},this);for(a in b)this.set(a,b[a])},postMixInProperties:function(){},buildRendering:function(){this.domNode||(this.domNode=this.srcNodeRef||this.ownerDocument.createElement("div"));if(this.baseClass){var b=this.baseClass.split(" ");this.isLeftToRight()||(b=b.concat(n.map(b,function(b){return b+"Rtl"})));g.add(this.domNode,b)}},postCreate:function(){},startup:function(){this._started||(this._started=
!0,n.forEach(this.getChildren(),function(b){b._started||b._destroyed||!f.isFunction(b.startup)||(b.startup(),b._started=!0)}))},destroyRecursive:function(b){this._beingDestroyed=!0;this.destroyDescendants(b);this.destroy(b)},destroy:function(b){function a(a){a.destroyRecursive?a.destroyRecursive(b):a.destroy&&a.destroy(b)}this._beingDestroyed=!0;this.uninitialize();n.forEach(this._connects,f.hitch(this,"disconnect"));n.forEach(this._supportingWidgets,a);this.domNode&&n.forEach(w.findWidgets(this.domNode,
this.containerNode),a);this.destroyRendering(b);w.remove(this.id);this._destroyed=!0},destroyRendering:function(b){this.bgIframe&&(this.bgIframe.destroy(b),delete this.bgIframe);this.domNode&&(b?d.remove(this.domNode,"widgetId"):c.destroy(this.domNode),delete this.domNode);this.srcNodeRef&&(b||c.destroy(this.srcNodeRef),delete this.srcNodeRef)},destroyDescendants:function(b){n.forEach(this.getChildren(),function(a){a.destroyRecursive&&a.destroyRecursive(b)})},uninitialize:function(){return!1},_setStyleAttr:function(b){var a=
this.domNode;f.isObject(b)?l.set(a,b):a.style.cssText=a.style.cssText?a.style.cssText+("; "+b):b;this._set("style",b)},_attrToDom:function(b,a,c){c=3<=arguments.length?c:this.attributeMap[b];n.forEach(f.isArray(c)?c:[c],function(c){var e=this[c.node||c||"domNode"];switch(c.type||"attribute"){case "attribute":f.isFunction(a)&&(a=f.hitch(this,a));c=c.attribute?c.attribute:/^on[A-Z][a-zA-Z]*$/.test(b)?b.toLowerCase():b;e.tagName?d.set(e,c,a):e.set(c,a);break;case "innerText":e.innerHTML="";e.appendChild(this.ownerDocument.createTextNode(a));
break;case "innerHTML":e.innerHTML=a;break;case "class":g.replace(e,a,this[b]);break;case "toggleClass":g.toggle(e,c.className||b,a)}},this)},get:function(b){var a=this._getAttrNames(b);return this[a.g]?this[a.g]():this._get(b)},set:function(b,a){if("object"===typeof b){for(var c in b)this.set(c,b[c]);return this}c=this._getAttrNames(b);var d=this[c.s];if(f.isFunction(d))var e=d.apply(this,Array.prototype.slice.call(arguments,1));else{var d=this.focusNode&&!f.isFunction(this.focusNode)?"focusNode":
"domNode",q=this[d]&&this[d].tagName,g;if((g=q)&&!(g=E[q])){g=this[d];var u={},l;for(l in g)u[l.toLowerCase()]=!0;g=E[q]=u}l=g;c=b in this.attributeMap?this.attributeMap[b]:c.s in this?this[c.s]:l&&c.l in l&&"function"!=typeof a||/^aria-|^data-|^role$/.test(b)?d:null;null!=c&&this._attrToDom(b,a,c);this._set(b,a)}return e||this},_attrPairNames:{},_getAttrNames:function(b){var a=this._attrPairNames;if(a[b])return a[b];var c=b.replace(/^[a-z]|-[a-zA-Z]/g,function(b){return b.charAt(b.length-1).toUpperCase()});
return a[b]={n:b+"Node",s:"_set"+c+"Attr",g:"_get"+c+"Attr",l:c.toLowerCase()}},_set:function(b,a){var c=this[b];this[b]=a;!this._created||c===a||c!==c&&a!==a||(this._watchCallbacks&&this._watchCallbacks(b,c,a),this.emit("attrmodified-"+b,{detail:{prevValue:c,newValue:a}}))},_get:function(b){return this[b]},emit:function(a,c,f){c=c||{};void 0===c.bubbles&&(c.bubbles=!0);void 0===c.cancelable&&(c.cancelable=!0);c.detail||(c.detail={});c.detail.widget=this;var d,e=this["on"+a];e&&(d=e.apply(this,f?
f:[c]));this._started&&!this._beingDestroyed&&b.emit(this.domNode,a.toLowerCase(),c);return d},on:function(a,c){var f=this._onMap(a);return f?p.after(this,f,c,!0):this.own(b(this.domNode,a,c))[0]},_onMap:function(b){var a=this.constructor,c=a._onMap;if(!c){var c=a._onMap={},f;for(f in a.prototype)/^on/.test(f)&&(c[f.replace(/^on/,"").toLowerCase()]=f)}return c["string"==typeof b&&b.toLowerCase()]},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getChildren:function(){return this.containerNode?
w.findWidgets(this.containerNode):[]},getParent:function(){return w.getEnclosingWidget(this.domNode.parentNode)},connect:function(b,a,c){return this.own(h.connect(b,a,this,c))[0]},disconnect:function(b){b.remove()},subscribe:function(b,a){return this.own(A.subscribe(b,f.hitch(this,a)))[0]},unsubscribe:function(b){b.remove()},isLeftToRight:function(){return this.dir?"ltr"==this.dir.toLowerCase():a.isBodyLtr(this.ownerDocument)},isFocusable:function(){return this.focus&&"none"!=l.get(this.domNode,"display")},
placeAt:function(b,a){var f=!b.tagName&&w.byId(b);!f||!f.addChild||a&&"number"!==typeof a?(f=f&&"domNode"in f?f.containerNode&&!/after|before|replace/.test(a||"")?f.containerNode:f.domNode:k.byId(b,this.ownerDocument),c.place(this.domNode,f,a),!this._started&&(this.getParent()||{})._started&&this.startup()):f.addChild(this,a);return this},defer:function(b,a){var c=setTimeout(f.hitch(this,function(){c&&(c=null,this._destroyed||f.hitch(this,b)())}),a||0);return{remove:function(){c&&(clearTimeout(c),
c=null);return null}}}});t("dojo-bidi")&&m.extend(x);return m})},"dijit/Destroyable":function(){define(["dojo/_base/array","dojo/aspect","dojo/_base/declare"],function(r,n,p){return p("dijit.Destroyable",null,{destroy:function(m){this._destroyed=!0},own:function(){var m=["destroyRecursive","destroy","remove"];r.forEach(arguments,function(h){function e(){d.remove();r.forEach(g,function(c){c.remove()})}var k,d=n.before(this,"destroy",function(c){h[k](c)}),g=[];h.then?(k="cancel",h.then(e,e)):r.forEach(m,
function(c){"function"===typeof h[c]&&(k||(k=c),g.push(n.after(h,c,e,!0)))})},this);return arguments}})})},"dijit/_OnDijitClickMixin":function(){define("dojo/on dojo/_base/array dojo/keys dojo/_base/declare dojo/has ./a11yclick".split(" "),function(r,n,p,m,h,e){r=m("dijit._OnDijitClickMixin",null,{connect:function(k,d,g){return this.inherited(arguments,[k,"ondijitclick"==d?e:d,g])}});r.a11yclick=e;return r})},"dijit/_FocusMixin":function(){define(["./focus","./_WidgetBase","dojo/_base/declare","dojo/_base/lang"],
function(r,n,p,m){m.extend(n,{focused:!1,onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus()},_onBlur:function(){this.onBlur()}});return p("dijit._FocusMixin",null,{_focusManager:r})})},"dijit/hccss":function(){define(["dojo/dom-class","dojo/hccss","dojo/domReady","dojo/_base/window"],function(r,n,p,m){p(function(){n("highcontrast")&&r.add(m.body(),"dijit_a11y")});return n})},"dojo/hccss":function(){define("require ./_base/config ./dom-class ./dom-style ./has ./domReady ./_base/window".split(" "),
function(r,n,p,m,h,e,k){h.add("highcontrast",function(){var d=k.doc.createElement("div");try{d.style.cssText='border: 1px solid; border-color:red green; position: absolute; height: 5px; top: -999px;background-image: url("'+(n.blankGif||r.toUrl("./resources/blank.gif"))+'");';k.body().appendChild(d);var e=m.getComputedStyle(d),c=e.backgroundImage;return e.borderTopColor==e.borderRightColor||c&&("none"==c||"url(invalid-url:)"==c)}catch(a){return console.warn("hccss: exception detecting high-contrast mode, document is likely hidden: "+
a.toString()),!1}finally{8>=h("ie")?d.outerHTML="":k.body().removeChild(d)}});e(function(){h("highcontrast")&&p.add(k.body(),"dj_a11y")});return h})},"dijit/_Templated":function(){define("./_WidgetBase ./_TemplatedMixin ./_WidgetsInTemplateMixin dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/_base/kernel".split(" "),function(r,n,p,m,h,e,k){e.extend(r,{waiRole:"",waiState:""});return h("dijit._Templated",[n,p],{constructor:function(){k.deprecated(this.declaredClass+": dijit._Templated deprecated, use dijit._TemplatedMixin and if necessary dijit._WidgetsInTemplateMixin",
"","2.0")},_processNode:function(d,e){var c=this.inherited(arguments),a=e(d,"waiRole");a&&d.setAttribute("role",a);(a=e(d,"waiState"))&&m.forEach(a.split(/\s*,\s*/),function(a){-1!=a.indexOf("-")&&(a=a.split("-"),d.setAttribute("aria-"+a[0],a[1]))});return c}})})},"dijit/_TemplatedMixin":function(){define("dojo/cache dojo/_base/declare dojo/dom-construct dojo/_base/lang dojo/on dojo/sniff dojo/string ./_AttachMixin".split(" "),function(r,n,p,m,h,e,k,d){var g=n("dijit._TemplatedMixin",d,{templateString:null,
templatePath:null,_skipNodeCache:!1,searchContainerNode:!0,_stringRepl:function(c){var a=this.declaredClass,d=this;return k.substitute(c,this,function(c,e){"!"==e.charAt(0)&&(c=m.getObject(e.substr(1),!1,d));if("undefined"==typeof c)throw Error(a+" template:"+e);return null==c?"":"!"==e.charAt(0)?c:this._escapeValue(""+c)},this)},_escapeValue:function(c){return c.replace(/["'<>&]/g,function(a){return{"\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;",'"':"\x26quot;","'":"\x26#x27;"}[a]})},buildRendering:function(){if(!this._rendered){this.templateString||
(this.templateString=r(this.templatePath,{sanitize:!0}));var c=g.getCachedTemplate(this.templateString,this._skipNodeCache,this.ownerDocument),a;if(m.isString(c)){if(a=p.toDom(this._stringRepl(c),this.ownerDocument),1!=a.nodeType)throw Error("Invalid template: "+c);}else a=c.cloneNode(!0);this.domNode=a}this.inherited(arguments);this._rendered||this._fillContent(this.srcNodeRef);this._rendered=!0},_fillContent:function(c){var a=this.containerNode;if(c&&a)for(;c.hasChildNodes();)a.appendChild(c.firstChild)}});
g._templateCache={};g.getCachedTemplate=function(c,a,d){var e=g._templateCache,l=c,f=e[l];if(f){try{if(!f.ownerDocument||f.ownerDocument==(d||document))return f}catch(b){}p.destroy(f)}c=k.trim(c);if(a||c.match(/\$\{([^\}]+)\}/g))return e[l]=c;a=p.toDom(c,d);if(1!=a.nodeType)throw Error("Invalid template: "+c);return e[l]=a};e("ie")&&h(window,"unload",function(){var c=g._templateCache,a;for(a in c){var d=c[a];"object"==typeof d&&p.destroy(d);delete c[a]}});return g})},"dojo/cache":function(){define(["./_base/kernel",
"./text"],function(r){return r.cache})},"dijit/_AttachMixin":function(){define("require dojo/_base/array dojo/_base/connect dojo/_base/declare dojo/_base/lang dojo/mouse dojo/on dojo/touch ./_WidgetBase".split(" "),function(r,n,p,m,h,e,k,d,g){var c=h.delegate(d,{mouseenter:e.enter,mouseleave:e.leave,keypress:p._keypress}),a;p=m("dijit._AttachMixin",null,{constructor:function(){this._attachPoints=[];this._attachEvents=[]},buildRendering:function(){this.inherited(arguments);this._attachTemplateNodes(this.domNode);
this._beforeFillContent()},_beforeFillContent:function(){},_attachTemplateNodes:function(a){for(var c=a;;)if(1==c.nodeType&&(this._processTemplateNode(c,function(a,c){return a.getAttribute(c)},this._attach)||this.searchContainerNode)&&c.firstChild)c=c.firstChild;else{if(c==a)break;for(;!c.nextSibling;)if(c=c.parentNode,c==a)return;c=c.nextSibling}},_processTemplateNode:function(a,c,d){var f=!0,b=this.attachScope||this,e=c(a,"dojoAttachPoint")||c(a,"data-dojo-attach-point");if(e)for(var g=e.split(/\s*,\s*/);e=
g.shift();)h.isArray(b[e])?b[e].push(a):b[e]=a,f="containerNode"!=e,this._attachPoints.push(e);if(c=c(a,"dojoAttachEvent")||c(a,"data-dojo-attach-event"))for(e=c.split(/\s*,\s*/),g=h.trim;c=e.shift();)if(c){var l=null;-1!=c.indexOf(":")?(l=c.split(":"),c=g(l[0]),l=g(l[1])):c=g(c);l||(l=c);this._attachEvents.push(d(a,c,h.hitch(b,l)))}return f},_attach:function(d,e,g){e=e.replace(/^on/,"").toLowerCase();e="dijitclick"==e?a||(a=r("./a11yclick")):c[e]||e;return k(d,e,g)},_detachTemplateNodes:function(){var a=
this.attachScope||this;n.forEach(this._attachPoints,function(c){delete a[c]});this._attachPoints=[];n.forEach(this._attachEvents,function(a){a.remove()});this._attachEvents=[]},destroyRendering:function(){this._detachTemplateNodes();this.inherited(arguments)}});h.extend(g,{dojoAttachEvent:"",dojoAttachPoint:""});return p})},"dijit/_WidgetsInTemplateMixin":function(){define(["dojo/_base/array","dojo/aspect","dojo/_base/declare","dojo/_base/lang","dojo/parser"],function(r,n,p,m,h){return p("dijit._WidgetsInTemplateMixin",
null,{_earlyTemplatedStartup:!1,contextRequire:null,_beforeFillContent:function(){if(/dojoType|data-dojo-type/i.test(this.domNode.innerHTML)){var e=this.domNode;this.containerNode&&!this.searchContainerNode&&(this.containerNode.stopParser=!0);h.parse(e,{noStart:!this._earlyTemplatedStartup,template:!0,inherited:{dir:this.dir,lang:this.lang,textDir:this.textDir},propsThis:this,contextRequire:this.contextRequire,scope:"dojo"}).then(m.hitch(this,function(e){this._startupWidgets=e;for(var d=0;d<e.length;d++)this._processTemplateNode(e[d],
function(d,c){return d[c]},function(d,c,a){return c in d?d.connect(d,c,a):d.on(c,a,!0)});this.containerNode&&this.containerNode.stopParser&&delete this.containerNode.stopParser}));if(!this._startupWidgets)throw Error(this.declaredClass+": parser returned unfilled promise (probably waiting for module auto-load), unsupported by _WidgetsInTemplateMixin.   Must pre-load all supporting widgets before instantiation.");}},_processTemplateNode:function(e,k,d){return k(e,"dojoType")||k(e,"data-dojo-type")?
!0:this.inherited(arguments)},startup:function(){r.forEach(this._startupWidgets,function(e){e&&!e._started&&e.startup&&e.startup()});this._startupWidgets=null;this.inherited(arguments)}})})},"dojo/parser":function(){define("require ./_base/kernel ./_base/lang ./_base/array ./_base/config ./dom ./_base/window ./_base/url ./aspect ./promise/all ./date/stamp ./Deferred ./has ./query ./on ./ready".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b){function q(b){return eval("("+b+")")}function u(b){var a=
b._nameCaseMap,c=b.prototype;if(!a||a._extendCnt<y){var a=b._nameCaseMap={},f;for(f in c)"_"!==f.charAt(0)&&(a[f.toLowerCase()]=f);a._extendCnt=y}return a}function A(b,a){a||(a=r);var c=a._dojoParserCtorMap||(a._dojoParserCtorMap={}),f=b.join();if(!c[f]){for(var d=[],e=0,q=b.length;e<q;e++){var g=b[e];d[d.length]=c[g]=c[g]||p.getObject(g)||~g.indexOf("/")&&a(g)}e=d.shift();c[f]=d.length?e.createSubclass?e.createSubclass(d):e.extend.apply(e,d):e}return c[f]}new Date("X");var y=0;g.after(p,"extend",
function(){y++},!0);var B={_clearCache:function(){y++;_ctorMap={}},_functionFromScript:function(b,a){var c="",f="",d=b.getAttribute(a+"args")||b.getAttribute("args"),e=b.getAttribute("with"),d=(d||"").split(/\s*,\s*/);e&&e.length&&m.forEach(e.split(/\s*,\s*/),function(b){c+="with("+b+"){";f+="}"});return new Function(d,c+b.innerHTML+f)},instantiate:function(b,a,c){a=a||{};c=c||{};var f=(c.scope||n._scopeName)+"Type",d="data-"+(c.scope||n._scopeName)+"-",e=d+"type",q=d+"mixins",g=[];m.forEach(b,function(b){var c=
f in a?a[f]:b.getAttribute(e)||b.getAttribute(f);if(c){var d=b.getAttribute(q),c=d?[c].concat(d.split(/\s*,\s*/)):[c];g.push({node:b,types:c})}});return this._instantiate(g,a,c)},_instantiate:function(b,a,f,d){function e(b){a._started||f.noStart||m.forEach(b,function(b){"function"!==typeof b.startup||b._started||b.startup()});return b}b=m.map(b,function(b){var c=b.ctor||A(b.types,f.contextRequire);if(!c)throw Error("Unable to resolve constructor for: '"+b.types.join()+"'");return this.construct(c,
b.node,a,f,b.scripts,b.inherited)},this);return d?c(b).then(e):e(b)},construct:function(b,c,e,l,k,h){function A(b){D&&p.setObject(D,b);for(z=0;z<O.length;z++)g[O[z].advice||"after"](b,O[z].method,p.hitch(b,O[z].func),!0);for(z=0;z<S.length;z++)S[z].call(b);for(z=0;z<L.length;z++)b.watch(L[z].prop,L[z].func);for(z=0;z<Q.length;z++)f(b,Q[z].event,Q[z].func);return b}var w=b&&b.prototype;l=l||{};var y={};l.defaults&&p.mixin(y,l.defaults);h&&p.mixin(y,h);var x;t("dom-attributes-explicit")?x=c.attributes:
t("dom-attributes-specified-flag")?x=m.filter(c.attributes,function(b){return b.specified}):(h=(/^input$|^img$/i.test(c.nodeName)?c:c.cloneNode(!1)).outerHTML.replace(/=[^\s"']+|="[^"]*"|='[^']*'/g,"").replace(/^\s*<[a-zA-Z0-9]*\s*/,"").replace(/\s*>.*$/,""),x=m.map(h.split(/\s+/),function(b){var a=b.toLowerCase();return{name:b,value:"LI"==c.nodeName&&"value"==b||"enctype"==a?c.getAttribute(a):c.getAttributeNode(a).value}}));var r=l.scope||n._scopeName;h="data-"+r+"-";var B={};"dojo"!==r&&(B[h+"props"]=
"data-dojo-props",B[h+"type"]="data-dojo-type",B[h+"mixins"]="data-dojo-mixins",B[r+"type"]="dojotype",B[h+"id"]="data-dojo-id");for(var z=0,C,r=[],D,E;C=x[z++];){var K=C.name,J=K.toLowerCase();C=C.value;switch(B[J]||J){case "data-dojo-type":case "dojotype":case "data-dojo-mixins":break;case "data-dojo-props":E=C;break;case "data-dojo-id":case "jsid":D=C;break;case "data-dojo-attach-point":case "dojoattachpoint":y.dojoAttachPoint=C;break;case "data-dojo-attach-event":case "dojoattachevent":y.dojoAttachEvent=
C;break;case "class":y["class"]=c.className;break;case "style":y.style=c.style&&c.style.cssText;break;default:if(K in w||(K=u(b)[J]||K),K in w)switch(typeof w[K]){case "string":y[K]=C;break;case "number":y[K]=C.length?Number(C):NaN;break;case "boolean":y[K]="false"!=C.toLowerCase();break;case "function":""===C||-1!=C.search(/[^\w\.]+/i)?y[K]=new Function(C):y[K]=p.getObject(C,!1)||new Function(C);r.push(K);break;default:J=w[K],y[K]=J&&"length"in J?C?C.split(/\s*,\s*/):[]:J instanceof Date?""==C?new Date(""):
"now"==C?new Date:a.fromISOString(C):J instanceof d?n.baseUrl+C:q(C)}else y[K]=C}}for(x=0;x<r.length;x++)B=r[x].toLowerCase(),c.removeAttribute(B),c[B]=null;if(E)try{E=q.call(l.propsThis,"{"+E+"}"),p.mixin(y,E)}catch(T){throw Error(T.toString()+" in data-dojo-props\x3d'"+E+"'");}p.mixin(y,e);k||(k=b&&(b._noScript||w._noScript)?[]:v("\x3e script[type^\x3d'dojo/']",c));var O=[],S=[],L=[],Q=[];if(k)for(z=0;z<k.length;z++)B=k[z],c.removeChild(B),e=B.getAttribute(h+"event")||B.getAttribute("event"),l=
B.getAttribute(h+"prop"),E=B.getAttribute(h+"method"),r=B.getAttribute(h+"advice"),x=B.getAttribute("type"),B=this._functionFromScript(B,h),e?"dojo/connect"==x?O.push({method:e,func:B}):"dojo/on"==x?Q.push({event:e,func:B}):y[e]=B:"dojo/aspect"==x?O.push({method:E,advice:r,func:B}):"dojo/watch"==x?L.push({prop:l,func:B}):S.push(B);b=(k=b.markupFactory||w.markupFactory)?k(y,c,b):new b(y,c);return b.then?b.then(A):A(b)},scan:function(b,a){function c(b){if(!b.inherited){b.inherited={};var a=b.node,f=
c(b.parent),a={dir:a.getAttribute("dir")||f.dir,lang:a.getAttribute("lang")||f.lang,textDir:a.getAttribute(k)||f.textDir},d;for(d in a)a[d]&&(b.inherited[d]=a[d])}return b.inherited}var f=[],d=[],e={},q=(a.scope||n._scopeName)+"Type",g="data-"+(a.scope||n._scopeName)+"-",u=g+"type",k=g+"textdir",g=g+"mixins",h=b.firstChild,v=a.inherited;if(!v){var w=function(b,a){return b.getAttribute&&b.getAttribute(a)||b.parentNode&&w(b.parentNode,a)},v={dir:w(b,"dir"),lang:w(b,"lang"),textDir:w(b,k)},y;for(y in v)v[y]||
delete v[y]}for(var v={inherited:v},p,x;;)if(h)if(1!=h.nodeType)h=h.nextSibling;else if(p&&"script"==h.nodeName.toLowerCase())(B=h.getAttribute("type"))&&/^dojo\/\w/i.test(B)&&p.push(h),h=h.nextSibling;else if(x)h=h.nextSibling;else{var B=h.getAttribute(u)||h.getAttribute(q);y=h.firstChild;if(B||y&&(3!=y.nodeType||y.nextSibling)){x=null;if(B){var J=h.getAttribute(g);p=J?[B].concat(J.split(/\s*,\s*/)):[B];try{x=A(p,a.contextRequire)}catch(S){}x||m.forEach(p,function(b){~b.indexOf("/")&&!e[b]&&(e[b]=
!0,d[d.length]=b)});J=x&&!x.prototype._noScript?[]:null;v={types:p,ctor:x,parent:v,node:h,scripts:J};v.inherited=c(v);f.push(v)}else v={node:h,scripts:p,parent:v};p=J;x=h.stopParser||x&&x.prototype.stopParser&&!a.template;h=y}else h=h.nextSibling}else{if(!v||!v.node)break;h=v.node.nextSibling;x=!1;v=v.parent;p=v.scripts}var O=new l;d.length?(t("dojo-debug-messages")&&console.warn("WARNING: Modules being Auto-Required: "+d.join(", ")),(a.contextRequire||r)(d,function(){O.resolve(m.filter(f,function(b){if(!b.ctor)try{b.ctor=
A(b.types,a.contextRequire)}catch(T){}for(var c=b.parent;c&&!c.types;)c=c.parent;var f=b.ctor&&b.ctor.prototype;b.instantiateChildren=!(f&&f.stopParser&&!a.template);b.instantiate=!c||c.instantiate&&c.instantiateChildren;return b.instantiate}))})):O.resolve(f);return O.promise},_require:function(b,a){var c=q("{"+b.innerHTML+"}"),f=[],d=[],e=new l,g=a&&a.contextRequire||r,u;for(u in c)f.push(u),d.push(c[u]);g(d,function(){for(var b=0;b<f.length;b++)p.setObject(f[b],arguments[b]);e.resolve(arguments)});
return e.promise},_scanAmd:function(b,a){var c=new l,f=c.promise;c.resolve(!0);var d=this;v("script[type\x3d'dojo/require']",b).forEach(function(b){f=f.then(function(){return d._require(b,a)});b.parentNode.removeChild(b)});return f},parse:function(b,a){!b||"string"==typeof b||"nodeType"in b||(a=b,b=a.rootNode);var c=b?e.byId(b):k.body();a=a||{};var f=a.template?{template:!0}:{},d=[],q=this,g=this._scanAmd(c,a).then(function(){return q.scan(c,a)}).then(function(b){return q._instantiate(b,f,a,!0)}).then(function(b){return d=
d.concat(b)}).otherwise(function(b){console.error("dojo/parser::parse() error",b);throw b;});p.mixin(d,g);return d}};n.parser=B;h.parseOnLoad&&b(100,B,"parse");return B})},"dojo/date/stamp":function(){define(["../_base/lang","../_base/array"],function(r,n){var p={};r.setObject("dojo.date.stamp",p);p.fromISOString=function(m,h){p._isoRegExp||(p._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/);var e=p._isoRegExp.exec(m),k=null;
if(e){e.shift();e[1]&&e[1]--;e[6]&&(e[6]*=1E3);h&&(h=new Date(h),n.forEach(n.map("FullYear Month Date Hours Minutes Seconds Milliseconds".split(" "),function(c){return h["get"+c]()}),function(c,a){e[a]=e[a]||c}));k=new Date(e[0]||1970,e[1]||0,e[2]||1,e[3]||0,e[4]||0,e[5]||0,e[6]||0);100>e[0]&&k.setFullYear(e[0]||1970);var d=0,g=e[7]&&e[7].charAt(0);"Z"!=g&&(d=60*(e[8]||0)+(Number(e[9])||0),"-"!=g&&(d*=-1));g&&(d-=k.getTimezoneOffset());d&&k.setTime(k.getTime()+6E4*d)}return k};p.toISOString=function(m,
h){var e=function(a){return 10>a?"0"+a:a};h=h||{};var k=[],d=h.zulu?"getUTC":"get",g="";"time"!=h.selector&&(g=m[d+"FullYear"](),g=["0000".substr((g+"").length)+g,e(m[d+"Month"]()+1),e(m[d+"Date"]())].join("-"));k.push(g);if("date"!=h.selector){g=[e(m[d+"Hours"]()),e(m[d+"Minutes"]()),e(m[d+"Seconds"]())].join(":");d=m[d+"Milliseconds"]();h.milliseconds&&(g+="."+(100>d?"0":"")+e(d));if(h.zulu)g+="Z";else if("time"!=h.selector)var d=m.getTimezoneOffset(),c=Math.abs(d),g=g+((0<d?"-":"+")+e(Math.floor(c/
60))+":"+e(c%60));k.push(g)}return k.join("T")};return p})},"esri/dijit/_EventedWidget":function(){define("dojo/_base/declare dojo/_base/lang dojo/aspect dojo/on ../Evented dijit/_WidgetBase".split(" "),function(r,n,p,m,h,e){return r([e,h],{_onMap:function(e){var d=this.constructor._onMap,g;d&&d.FINAL||(delete this.constructor._onMap,d=this.registerConnectEvents(),d.FINAL=!0);e=e.toLowerCase();d[e]?g=this[d[e].method]:(e=this._onCamelCase(e),this[e]&&(g=e));return g},on:function(e,d){var g=this._onMap(e),
c=e.replace(/\-/g,""),a="on"+c in this.domNode;return g||!a?this.inherited(arguments):this.own(m(this.domNode,c,d))[0]},emit:function(e,d,g){var c,a,l,t=e.toLowerCase(),k=this.constructor._onMap||this.registerConnectEvents();a=this[this._onMap(t)];d=d||{};d.target||(d.target=this);a&&k&&k[t]&&(this._onObj2Arr(function(){c=Array.prototype.slice.call(arguments)},k[t].argKeys)(d),l=n.mixin({},arguments),l[2]=c,l[0]=k[t].name.replace(/^on/,""));return this.inherited(l||arguments)}})})},"esri/dijit/Legend/utils":function(){define(["dojo/_base/lang",
"../../lang","dojo/i18n!../../nls/jsapi"],function(r,n,p){var m=p.widgets.legend;return{getVisualVariableTitle:function(h,e){var k,d=h.field,g=h.normalizationField,c=!1,a=!1,l=!1,t,d=r.isFunction(d)?null:d,g=r.isFunction(g)?null:g;if(h.legendOptions&&h.legendOptions.title)k=h.legendOptions.title;else if(h.valueExpressionTitle)k=h.valueExpressionTitle;else{if(e.renderer&&e.renderer.authoringInfo&&e.renderer.authoringInfo.visualVariables){var v=e.renderer.authoringInfo.visualVariables;for(t=0;t<v.length;t++){var f=
v[t];if("colorInfo"===f.type&&"ratio"===f.style){c=!0;break}else if("colorInfo"===f.type&&"percent"===f.style){a=!0;break}else if("colorInfo"===f.type&&"percentTotal"===f.style){l=!0;break}}}(c=l&&"showRatioPercentTotal"||a&&"showRatioPercent"||c&&"showRatio"||g&&"showNormField"||d&&"showField"||null)&&(k=n.substitute({field:d&&e.getFieldLabel(d),normField:g&&e.getFieldLabel(g)},m[c]))}return k},getRendererTitle:function(h,e){var k;if(h){var d,g,c;"esri.renderer.ClassBreaksRenderer"===h.declaredClass&&
(d=h.attributeField,g=h.normalizationField,c="percent-of-total"===h.normalizationType);d=r.isFunction(d)?null:d;g=r.isFunction(g)?null:g;h.legendOptions&&h.legendOptions.title?k=h.legendOptions.title:h.valueExpressionTitle?k=h.valueExpressionTitle:(c=g&&"showNormField"||(c?"showNormPct":null)||d&&"showField"||null)&&(k=n.substitute({field:d&&e.getFieldLabel(d),normField:g&&e.getFieldLabel(g)},m[c]))}return k}}})},"esri/layers/clustering/GeohashAggregation":function(){define("dojo/has dojo/_base/declare dojo/_base/lang dojo/_base/array ../../kernel ../../Evented ../../geometry/Point ../../geometry/Extent ../../geometry/mathUtils ../../support/expressionUtils ../../core/timerUtils ../support/attributeUtils ./geohashUtils ./statUtils".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v){n=n(e,{loaded:!1,map:null,layer:null,lod:null,tolerance:null,clusterMode:null,clusterRadius:null,sortEnabled:!0,filterEnabled:!0,bufferEnabled:!0,updateEnabled:!0,clusters:null,clustersEnabled:!0,statisticInfos:null,defaults:{lod:1,tolerance:0,clusterMode:"auto",clusterRadius:80,sortEnabled:!0,filterEnabled:!0,bufferEnabled:!0,updateEnabled:!0},_eventHandles:null,_updateHandle:null,_cellIndex:null,_globalIndex:null,_perfProfile:null,_cellSizeScaleFactor:1.5,_extentScaleFactor:1.25,
_maxGeohashLength:12,_minClusterRadius:15,_levelChange:!0,_clusterFieldPrefix:"cluster_",_mapLevelChange:!1,constructor:function(a){this._update=p.hitch(this,this._update);this._eventHandles=[];this._globalIndex={numFeatures:null,fullExtent:null,lodStats:null};this._perfProfile={lastIndex:{total:null,numFeatures:0},lastUpdate:{cells:null,clusters:null,total:null}};this.clusters=[];this.map=a.map;this.layer=a.layer;this.setLod(a.lod);this.setTolerance(a.tolerance);this.setClusterMode(a.clusterMode);
this.setClusterRadius(a.clusterRadius);this.setSortEnabled(a.sortEnabled);this.setFilterEnabled(a.filterEnabled);this.setBufferEnabled(a.bufferEnabled);this.setUpdateEnabled(a.updateEnabled);this.setStatisticInfos(a.statisticInfos);this._load();this.loaded?this._startup():this._eventHandles.push(this.on("load",p.hitch(this,this._startup)))},destroy:function(c){this._displayFeatures(!0,c);m.forEach(this._eventHandles,function(b){b.remove()});a.clearTimeout(this._updateHandle);this._cellIndex=this._globalIndex=
this._eventHandles=this._updateHandle=this.map=this.layer=this.clusters=null},setLod:function(a){var b=this.lod;this.lod=a||this.defaults.lod;b!==this.lod&&this.update()},setTolerance:function(a){var b=this.tolerance;this.tolerance=a||this.defaults.tolerance;b!==this.tolerance&&this.update()},setClusterMode:function(a){var b=this.clusterMode;this.clusterMode=a||this.defaults.clusterMode;this._evalClusterParams();b!==this.clusterMode&&this.update()},setClusterRadius:function(a){var b=this.clusterRadius;
this.clusterRadius=null!=a?a:this.defaults.clusterRadius;this._evalClusterParams();b!==this.clusterRadius&&this.update()},setSortEnabled:function(a){var b=this.sortEnabled;this.sortEnabled=null!=a?!!a:this.defaults.sortEnabled;b!==this.sortEnabled&&this.update()},setFilterEnabled:function(a){var b=this.filterEnabled;this.filterEnabled=null!=a?!!a:this.defaults.filterEnabled;b!==this.filterEnabled&&this.update()},setBufferEnabled:function(a){var b=this.bufferEnabled;this.bufferEnabled=null!=a?!!a:
this.defaults.bufferEnabled;b!==this.bufferEnabled&&this.update()},setUpdateEnabled:function(a){var b=this.updateEnabled;(this.updateEnabled=null!=a?!!a:this.defaults.updateEnabled)&&b!==this.updateEnabled&&(this._mapLevelChange=!0,this.update())},setStatisticInfos:function(a){this.statisticInfos=a||[];this.loaded&&this._applyStatInfos(this.statisticInfos)},update:function(){this.loaded&&null==this._updateHandle&&(this._updateHandle=a.setTimeout(this._update,a.priority.HIGH))},isUpdateScheduled:function(){return null!=
this._updateHandle},getCell:function(a){return this._cellIndex[a.length][a]},getCluster:function(a){var b;m.some(this.clusters,function(c){-1<m.indexOf(c.geohashes,a)&&(b=c);return!!b});return b},getCellsInCluster:function(a){var b=[];m.forEach(a&&a.geohashes,function(a){(a=this.getCell(a))&&b.push(a)},this);return b},getFeaturesInCluster:function(a){var b=[];a=this.getCellsInCluster(a);m.forEach(a,function(a){Array.prototype.push.apply(b,a.features)});return b},getCurrentLodStats:function(){var a=
this._globalIndex.lodStats;return a&&a[this.lod]},getNumFeatures:function(){return this._globalIndex.numFeatures},getFullExtent:function(){var a=this._globalIndex.fullExtent;return a&&Infinity!==a.xmin?new d(a):null},_load:function(){this._displayFeatures(!1);this._checkLoadStatus();this.map.loaded||this._eventHandles.push(this.map.on("load",p.hitch(this,this._checkLoadStatus)));this.layer.loaded||this._eventHandles.push(this.layer.on("load",p.hitch(this,this._checkLoadStatus)))},_checkLoadStatus:function(){if(this.map.loaded&&
this.layer.loaded){var a;if("esriGeometryPoint"!==this.layer.geometryType)a=Error("GeohashAggregation is supported only for points");else{var b=this.map.spatialReference;b.isWebMercator()||4326===b.wkid||(a=Error("GeohashAggregation is supported only when map spatial reference is WGS84 or WebMercator"))}a?(this.loadError=a,this.emit("load-error",{error:a})):(this.loaded=!0,this.emit("load"))}},_startup:function(){this._evalUpdateStatus();this._processFeatures();this._processExtentChange();this._eventHandles.push(this.layer.on("update-end",
p.hitch(this,this._processFeatures)),this.layer.on("edits-complete",p.hitch(this,this._processFeatures)),this.layer.on("graphics-clear",p.hitch(this,this._processFeatures)),this.layer.on("suspend",p.hitch(this,this._evalUpdateStatus)),this.layer.on("resume",p.hitch(this,this._evalUpdateStatus)),this.map.on("extent-change",p.hitch(this,this._processExtentChange)))},_processFeatures:function(){this._indexFeatures();this.update()},_evalUpdateStatus:function(){this.setUpdateEnabled(!this.layer.suspended)},
_processExtentChange:function(a){this._mapLevelChange=!(!a||!a.levelChange);this._evalClusterParams();this.update()},_update:function(){this._updateHandle=null;if(this.updateEnabled){this.emit("update-start");if(this.clustersEnabled){var a=this.map.geographicExtent;if(a){var b=this._getIntersectingCells(a),a=this._getClusters(b.cells,a);this.clusters=a.clusters;this._applyStatInfosToClusters();var b=b.profile,a=a.profile,c=b.total+a.total;b.total=this._getElapsedTime(b.total);a.total=this._getElapsedTime(a.total);
var d=this._perfProfile.lastUpdate={};d.cells=b;d.clusters=a;d.total=this._getElapsedTime(c)}}else this.clusters=[],this._perfProfile.lastUpdate=null;b=this._mapLevelChange;this._mapLevelChange=!1;this.emit("update-end",{levelChange:this._levelChange,mapLevelChange:b})}},_displayFeatures:function(a,b){var c=this.layer,f=!a;c.suspendGraphics(f);!1!==b&&(f?c.clearNodes():c.redraw())},_indexFeatures:function(){var a=this._getTime();this._initializeIndexing();var b=0,c=this._globalIndex.fullExtent;m.forEach(this.layer.graphics,
function(a){if(a.visible){var f=a.geometry,d=this._getLngLat(f),e;d&&(e=f.getCacheValue("_geohash"),void 0===e&&(e=t.pointToGeohash(d),f.setCacheValue("_geohash",e||null)));e&&(this._addGeohashToIndex(e,a,d),b++,this._updateExtent(c,d))}},this);this._applyStatInfosToIndex();this._globalIndex.numFeatures=b;for(var d=this._globalIndex.lodStats,e=1;e<=this._maxGeohashLength;e++)d[e]=this._getLODStats(e,b);this._perfProfile.lastIndex.total=this._getElapsedTime(a,this._getTime());this._perfProfile.lastIndex.numFeatures=
b;this.emit("index-complete")},_initializeIndexing:function(){this._globalIndex={numFeatures:0,fullExtent:{xmin:Infinity,ymin:Infinity,xmax:-Infinity,ymax:-Infinity},lodStats:{}};for(var a=this._cellIndex=[],b=1;b<=this._maxGeohashLength;b++)a[b]={}},_getLngLat:function(a){if(a){var b=a.getLongitude();a=a.getLatitude();a=null!=b&&null!=a?{x:b,y:a}:null}return a},_addGeohashToIndex:function(a,b,c){for(var f=this._cellIndex,d="",e=0;e<this._maxGeohashLength;e++){var d=d+a[e],q=f[d.length],g=q[d];g||
(g=q[d]={count:0,centroid:{x:null,y:null},extent:{xmin:Infinity,ymin:Infinity,xmax:-Infinity,ymax:-Infinity},features:[],geohash:d,statistics:null});this._updateItem(g,1,c,!0);g.features.push(b)}},_getLODStats:function(a,b){var c=this._cellIndex[a],f=0,d=Infinity,e=-Infinity,g=null,l;for(l in c){var k=c[l];f++;k.count<d&&(d=k.count);k.count>e&&(e=k.count)}0<f&&(g=Number((b/f).toFixed(2)));return{lod:a,count:f,min:Infinity===d?null:d,max:-Infinity===e?null:e,avg:g}},_evalClusterParams:function(){if(this.loaded&&
"auto"===this.clusterMode){var a=this._getClusterParams(this.map.getResolutionInMeters(),this.clusterRadius,this._minClusterRadius);this._levelChange=this.lod!==a.lod;this.lod=a.lod;this.tolerance=a.tolerance}},_getClusterParams:function(a,b,c){b<c&&(b=c);a=Math.ceil(a*b);b=this._getClosestLODRange(a).max;do c=this._getCellSize(b),(c=a>=this._cellSizeScaleFactor*c||1===c)||(b+=1);while(!c);c=a/this._getCellSize(b);return{lod:b,tolerance:a,multiplier:Number(c.toFixed(2))}},_getClosestLODRange:function(a){for(var b,
c=this._maxGeohashLength;1<=c;c--)if(this._getCellSize(c)>=a){b=c;break}null==b&&(b=1);a=b+1;a>this._maxGeohashLength&&(a=this._maxGeohashLength);return{min:b,max:a}},_getCellSize:function(a){a=t.getCellSizeInMeters(a);return Math.ceil(Math.min(a.width,a.height))},_sorter:function(a,b){var c=a.centroid,f=b.centroid;return a.count>b.count?-1:a.count<b.count?1:c.x>f.x?-1:c.x<f.x?1:0},_getIntersectingCells:function(a){var b=this._getTime();a=a.expand(this._extentScaleFactor);var c=t.getIntersecting(a,
this.lod,this.bufferEnabled?this.tolerance:0);a=this._getTime();var f=[],d=this.tolerance,e=this.sortEnabled;m.forEach(c,function(b){(b=this.getCell(b))&&f.push(b)},this);d&&e&&f.sort(this._sorter);c=this._getTime();return{cells:f,profile:{findCells:this._getElapsedTime(b,a),scanAndSortCells:this._getElapsedTime(a,c),total:c-b}}},_getClusters:function(a,b){var c=this._getTime(),f=[],d={},e={findCells:0};m.forEach(a,function(b,a){var c=this._createCluster(b,d,e);c&&f.push(c)},this);this._markIntersecting(f,
b);this.filterEnabled&&(f=this._getIntersectingClusters(f));var g=this._getTime();return{clusters:f,profile:{findCellsInCluster:this._getElapsedTime(e.findCells),total:g-c}}},_markIntersecting:function(a,b){var c=b.normalize();m.forEach(a,function(b){var a=b.centroid.x,f=b.centroid.y;b.isIntersecting=m.some(c,function(b){return a>=b.xmin&&a<=b.xmax&&f>=b.ymin&&f<=b.ymax})})},_getIntersectingClusters:function(a){return m.filter(a,function(b){return b.isIntersecting})},_createCluster:function(a,b,c){if(!b[a.geohash]){var f=
[{cell:a,distance:0}];if(this.tolerance){var d=this._getTime(),e=t.getNeighborsWithinDistance(a.centroid,this.lod,this.tolerance);c.findCells+=this._getTime()-d;m.forEach(e,function(b){if(b!==a.geohash&&(b=this.getCell(b))){var c=this._calculateDistance(a.centroid,b.centroid);c<=this.tolerance&&f.push({cell:b,distance:c})}},this)}return this._mergeCells(f,b)}},_calculateDistance:function(a,b){return g.getLength(t.geographicToWebMercator(a),t.geographicToWebMercator(b))},_mergeCells:function(a,b){var c=
this._initializeCluster({},a[0].cell.geohash);m.forEach(a,function(a){var f=a.cell,d=f.geohash;a=a.distance;var e=b[d];if(e)if(a<e.distance)this._removeCellFromCluster(d,b);else return;b[d]={cluster:c,distance:a};this._updateItem(c,f.count,f.centroid);c.geohashes.push(d)},this);return c},_removeCellFromCluster:function(a,b){var c=b[a].cluster;delete b[a];var f=m.indexOf(c.geohashes,a);-1<f&&c.geohashes.splice(f,1);this._reevaluateCluster(c)},_reevaluateCluster:function(a){var b=a.geohashes;a=this._initializeCluster(a,
a.primary);m.forEach(b,function(b){var c=this.getCell(b);c&&(this._updateItem(a,c.count,c.centroid),a.geohashes.push(b))},this)},_initializeCluster:function(a,b){a.count=0;a.centroid=new k(null,null);a.geohashes=[];a.primary=b;a.statistics=null;return a},_applyStatInfos:function(a){a=this._getValidStatInfos(a);this._applyStatInfosToIndex(a);this._applyStatInfosToClusters(a)},_getValidStatInfos:function(a){var b=[];m.forEach(a,function(a){var c=a.attributeInfo;a=a.statisticType;var f="angle"===c.attributeType;
if(v.isSupportedStatisticType(a)&&(!f||"avg"===a)){var d="arithmetic"===c.rotationType;b.push({attributeCache:l.createAttributeCache(c,"type"===a),identifier:v.getStatisticId(c,a),statFunctions:v.getStatisticFunctions(a),isAngular:f,isDate:"date"===c.attributeType,isArithmetic:d})}});return b},_applyStatInfosToIndex:function(a){a=a||this._getValidStatInfos(this.statisticInfos);var b=this._cellIndex;if(b)for(var c=1;c<=this._maxGeohashLength;c++){var f=b[c],d;for(d in f)this._applyStatInfosToCell(f[d],
a)}},_applyStatInfosToCell:function(a,b){var c=this._initializeStats(a,b);m.forEach(a.features,function(a){this._calcFeatureStats(a,b,c)},this);this._summarizeStats(a,c,b)},_calcFeatureStats:function(a,b,d){a.attributes&&m.forEach(b,function(b){var f=d[b.identifier],e=b.attributeCache,e=e?a._getDataValue(e.attributeInfo,e,c):null;b.statFunctions.updateCellStat(f,e,b)})},_applyStatInfosToClusters:function(a){a=a||this._getValidStatInfos(this.statisticInfos);var b=this._clusterFieldPrefix;m.forEach(this.clusters,
function(c){var f=this._initializeStats(c,a);m.forEach(this.getCellsInCluster(c),function(b){this._calcCellStats(b,a,f)},this);this._summarizeStats(c,f,a,b);c.attributes[b+"id"]=c.primary},this)},_calcCellStats:function(a,b,c){var f=a.statistics;m.forEach(b,function(b){var a=b.identifier;b.statFunctions.updateClusterStat(c[a],f[a],b)})},_initializeStats:function(a,b){var c=a.statistics={};m.forEach(b,function(b){c[b.identifier]=b.statFunctions.initialize(b)});return c},_summarizeStats:function(a,
b,c,d){var f=a.attributes={};d=d||"";f[d+"count"]=a.count;m.forEach(c,function(a){var c=this._getStatFieldName(a,d);f[c]=a.statFunctions.summarize(b[a.identifier],a)},this)},_getStatFieldName:function(a,b){return(b||"")+a.identifier},_updateItem:function(a,b,c,d){var f=c.y,e=a.centroid,g=a.count;e.x=(g*e.x+b*c.x)/(g+b);e.y=(g*e.y+b*f)/(g+b);a.count+=b;d&&this._updateExtent(a.extent,c)},_updateExtent:function(a,b){var c=b.x,d=b.y;c<a.xmin&&(a.xmin=c);c>a.xmax&&(a.xmax=c);d<a.ymin&&(a.ymin=d);d>a.ymax&&
(a.ymax=d)},_getTime:function(){return window.performance?window.performance.now():(new Date).getTime()},_getElapsedTime:function(a,b){var c,d;d=null!=a&&null!=b?b-a:a;null!=d&&(c="millisecond",1E3<=d&&(d/=1E3,c="second",60<=d&&(d/=60,c="minute")),c={value:Number(d.toFixed(2)),unit:c});return c}});r("extend-esri")&&p.setObject("layers.clustering.GeohashAggregation",n,h);return n})},"esri/core/timerUtils":function(){define([],function(){function r(e){var k,d=e.length;for(k=0;k<d;k++)e[k]()}var n={LOW:1,
HIGH:2},p,m={};m[n.LOW]=[];m[n.HIGH]=[];var h=function(){clearTimeout(p);p=null;var e=m[n.HIGH];m[n.HIGH]=[];r(e);e=m[n.LOW];m[n.LOW]=[];r(e)};return{priority:n,callbackQueue:m,setTimeout:function(e,k){var d=[k,m[k].push(e)-1];p||(p=setTimeout(h,0));return d},clearTimeout:function(e){e&&m[e[0]].splice(e[1],1)}}})},"esri/layers/clustering/geohashUtils":function(){define("dojo/has dojo/string dojo/_base/lang dojo/_base/array ../../kernel ../../geometry/Point ../../geometry/Extent ../../SpatialReference ../../geometry/webMercatorUtils".split(" "),
function(r,n,p,m,h,e,k,d,g){function c(b){var a=b.spatialReference;if(!a)return{x:b.x,y:b.y};var c=a.isWebMercator(),d;4326===a.wkid?d={x:b.x,y:b.y}:c&&(d={x:b.getLongitude(),y:b.getLatitude()});return d}function a(b){var a=b.spatialReference,c=!(!a||!a.isWebMercator()),d;a&&4326===a.wkid?d=new k(b.toJson()):c&&(d=g.webMercatorToGeographic(b,!0));return d}function l(b,a){a.x=e.prototype._normalizeX(b.x,d.prototype._info[4326]);a.y=b.y;return a}function t(b){b=F.decimals[b].toString(2);return n.pad(b,
F.bitsPerBase32Char,"0")}function v(b,a){var c;a=a.slice();a.splice(1,0,0);for(var d=a[0],f=a[2],e=0;e<b.length;e++)Number(b[e])?a[0]=a[1]:a[2]=a[1],c=a[1]=(a[0]+a[2])/2,d=a[0],f=a[2];return{value:c,min:d,max:f}}function f(b,a,c){var d=[];a=a.slice();a.splice(1,0,0);for(var f=a[0],e=a[2],g=0;g<c;g++)b>=a[1]?(a[0]=a[1],f=1):(a[2]=a[1],f=0),a[1]=(a[0]+a[2])/2,d.push(f),f=a[0],e=a[2];return{value:d.join(""),min:f,max:e}}function b(b){var a=b*F.bitsPerBase32Char;0===a%2?b=a/=2:(b=(a+1)/2,a-=b);return{lon:b,
lat:a}}function q(b){var a=0;b=b.split("").reverse().join("");for(var c=0;c<b.length;c++)a+=Number(b[c])*Math.pow(2,c);return F.base32[a]}function u(b,a){var c={x:b.xmin,y:b.ymax},d={x:b.xmax,y:b.ymin},f={x:b.xmax,y:b.ymax};return{sw:G.pointToGeohash({x:b.xmin,y:b.ymin},a),nw:G.pointToGeohash(c,a),se:G.pointToGeohash(d,a),ne:G.pointToGeohash(f,a)}}function A(b,a,c,d,f){var e=b;do f[e]||(f[e]=!0,d.push(e)),(b=e===a)||(e=D(e,c));while(!b)}function y(b,a,c,d){var f=u(b,a);b=[];A(f.sw,f.nw,"n",b,{});
a=[];A(f.se,f.ne,"n",a,{});for(f=0;f<b.length;f++)A(b[f],a[f],"e",c,d)}function B(b){return m.filter(b,function(b){return 180===b.xmax?!0:!1})[0]}function x(b){return m.filter(b,function(b){return-180===b.xmin?!0:!1})[0]}function w(b,a,c,d){var f=G.geographicToWebMercator(b);b={x:f.x-a,y:f.y-a};a=G.webMercatorToGeographic({x:f.x+a,y:f.y+a},!0);b=G.webMercatorToGeographic(b,!0);return new k(null!=c?c:b.x,b.y,null!=d?d:a.x,a.y)}function z(b,a,c,d){var f;b=u(b,a);var e,g;"min"===d?g=180:"max"===d&&(e=
-180);var q=e;d=g;f=G.geohashToCell(b.sw).extent;a=G.geohashToCell(b.ne).extent;b=null!=q?q:f.xmin;f=f.ymin;d=null!=d?d:a.xmax;a=a.ymax;b=w({x:b,y:f},c,e,g);c=w({x:d,y:a},c,e,g);return new k(b.xmin,b.ymin,c.xmax,c.ymax)}function E(b,a,c){var d=b,f=0;do f++,(b=d===a)||(d=D(d,c));while(!b);return f}function C(b,a){var c=u(b,a),d=E(c.nw,c.ne,"e");return{rows:E(c.nw,c.sw,"s"),cols:d}}function D(b,a){var c=b.length%2,d=b.slice(-1),f=F.decimals[d],e=b.slice(0,-1);-1!=F.borders[a][c].indexOf(d)&&e&&(e=D(e,
a));return e+F.neighbors[a][c][f]}var F={base32:"0123456789bcdefghjkmnpqrstuvwxyz",decimals:function(){for(var b={},a=0;32>a;a++)b["0123456789bcdefghjkmnpqrstuvwxyz"[a]]=a;return b}(),neighbors:{n:[null,"238967debc01fg45kmstqrwxuvhjyznp"],s:[null,"bc01fg45238967deuvhjyznpkmstqrwx"],e:[null,"14365h7k9dcfesgujnmqp0r2twvyx8zb"],w:[null,"p0r21436x8zb9dcf5h7kjnmqesgutwvy"]},borders:{n:[null,"bcfguvyz"],s:[null,"0145hjnp"],e:[null,"prxz"],w:[null,"028b"]},bitsPerBase32Char:5,maxGeohashLength:12,longitudeRange:[-180,
180],latitudeRange:[-90,90]};F.neighbors.n[0]="14365h7k9dcfesgujnmqp0r2twvyx8zb";F.neighbors.s[0]="p0r21436x8zb9dcf5h7kjnmqesgutwvy";F.neighbors.e[0]="238967debc01fg45kmstqrwxuvhjyznp";F.neighbors.w[0]="bc01fg45238967deuvhjyznpkmstqrwx";F.borders.n[0]="prxz";F.borders.s[0]="028b";F.borders.e[0]="bcfguvyz";F.borders.w[0]="0145hjnp";var G={geographicToWebMercator:function(b){b=e.lngLatToXY(b.x,b.y);return{x:b[0],y:b[1]}},webMercatorToGeographic:function(b,a){var c=e.xyToLngLat(b.x,b.y,a);return{x:c[0],
y:c[1]}},geohashToCell:function(b){for(var a=[],c=0;c<b.length;c++)a.push(t(b[c]));for(var a=a.join(""),c=[],d=[],f=0;f<a.length;f++)0===f%2?c.push(a[f]):d.push(a[f]);c=c.join("");d=d.join("");c=[c,d];a=v(c[0],F.longitudeRange);c=v(c[1],F.latitudeRange);return{point:{x:a.value,y:c.value},extent:{xmin:a.min,xmax:a.max,ymin:c.min,ymax:c.max},geohash:b}},pointToCell:function(a,d){var e,g,u;d=d||F.maxGeohashLength;var k=c(a);if(k){k=l(k,k);e=b(d);u=f(k.x,F.longitudeRange,e.lon);var t=f(k.y,F.latitudeRange,
e.lat);e=u.value;g=t.value;u={xmin:u.min,xmax:u.max,ymin:t.min,ymax:t.max};for(var t=[],h=Math.ceil((e.length+g.length)/F.bitsPerBase32Char),v=0,A=0,m=0;m<h*F.bitsPerBase32Char;m++){var n=0===m%2?e[v++]:g[A++];null==n&&(n=0);t.push(n)}e=t.join("");g=F.bitsPerBase32Char;t=e.length/g;h=[];for(v=0;v<t;v++)A=e.substr(v*g,g),h.push(q(A));e=h.join("");return{point:k,extent:u,geohash:e}}},geohashToPoint:function(b){return G.geohashToCell(b).point},pointToGeohash:function(b,a){var c=G.pointToCell(b,a);return c&&
c.geohash},getCells:function(b){return m.map(b,function(b){return G.geohashToCell(b)})},getCellSize:function(a){var c=F.longitudeRange,d=F.latitudeRange,c=Math.abs(c[1]-c[0]),d=Math.abs(d[1]-d[0]);a=b(a||1);return{width:c/Math.pow(2,a.lon),height:d/Math.pow(2,a.lat)}},getCellSizeInMeters:function(b){b=G.getCellSize(b);var a=g.metersPerDegree;b.width*=a;b.height*=a;return b},getIntersecting:function(b,c,d){c=c||1;d=d||0;var f=[],e=a(b);if(e){d&&(e=G.expandExtent(b,c,d));b=e.normalize();var g={};m.forEach(b,
function(b){y(b,c,f,g)})}return f},countIntersecting:function(b,c,d){c=c||1;d=d||0;var f=0,e=a(b);if(e){d&&(e=G.expandExtent(b,c,d));b=e.normalize();if(2===b.length){f=B(b);e=x(b);d=C(f,c);var g=C(e,c);b=d.rows;d=d.cols+g.cols;f={x:f.xmin,y:f.ymax};e={x:e.xmax,y:e.ymax};f=l(f,{});e=l(e,{});f=G.pointToGeohash(f,c);c=G.pointToGeohash(e,c);f===c&&d--;c={rows:b,cols:d}}else c=C(b[0],c);f=c.cols*c.rows}return f},getChildren:function(b){b=b||"";var a=[],c;for(c in F.decimals)a.push(b+c);return a},getNeighbors:function(b){var a=
D(b,"n"),c=D(b,"s");return[a,D(a,"e"),D(a,"w"),c,D(c,"e"),D(c,"w"),D(b,"e"),D(b,"w")]},getExtentFromDistance:function(b,a){a=a||1E3;var d,f=c(b);f&&(d=w(f,a));return d},expandExtent:function(b,c,d){c=c||1;d=d||0;if(b=a(b)){if(d){b=b.normalize();if(2===b.length){var f=d;d=B(b);b=x(b);d=z(d,c,f,"min");b=z(b,c,f,"max");360<=d.getWidth()+b.getWidth()?(c=-180,b=180):(c=d.xmin,b=b.xmax);return new k(c,d.ymin,b,d.ymax)}return z(b[0],c,d)}return b}},getNeighborsWithinDistance:function(b,a,d){d=d||1E3;a=a||
1;var f=[];if(b=c(b)){d=w(b,d).normalize();var e={};m.forEach(d,function(b){y(b,a,f,e)})}return f}};r("extend-esri")&&p.setObject("layers.clustering.geohashUtils",G,h);return G})},"esri/layers/clustering/statUtils":function(){define(["dojo/_base/lang","../support/attributeUtils"],function(r,n){function p(e){return"number"===typeof e&&!isNaN(e)&&Infinity!==e&&-Infinity!==e}var m={sum:{initialize:function(){return{count:0,sum:null}},updateCellStat:function(e,k){p(k)&&(e.count++,e.sum+=k)},updateClusterStat:function(e,
k){k.count&&(e.count+=k.count,e.sum+=k.sum)},summarize:function(e){return e.sum}},avg:{initialize:function(e){return{count:0,sum:null,avg:null,sum_cosine:null,sum_sine:null}},updateCellStat:function(e,k,d){p(k)&&(e.count++,d.isAngular?(d.isArithmetic||(k=-1*k+90),e.sum_cosine+=Math.cos(k*Math.PI/180),e.sum_sine+=Math.sin(k*Math.PI/180)):e.sum+=k)},updateClusterStat:function(e,k,d){k.count&&(e.count+=k.count,d.isAngular?(e.sum_cosine+=k.sum_cosine,e.sum_sine+=k.sum_sine):e.sum+=k.sum)},summarize:function(e,
k){if(0<e.count){var d=e.count;k.isAngular?(d=180*Math.atan2(e.sum_sine/d,e.sum_cosine/d)/Math.PI,k.isArithmetic||(d=-1*(d-90)),e.avg=0>d?d+360:d):(e.avg=e.sum/d,k.isDate&&(e.avg=Math.ceil(e.avg)))}return e.avg}},type:{initialize:function(){return{uvInfos:{}}},updateCellStat:function(e,k){if(null==k||""===k||"string"===typeof k&&""===r.trim(k))k=null;var d=e.uvInfos;null==d[k]?d[k]={count:1,value:k}:d[k].count++},updateClusterStat:function(e,k){var d=e.uvInfos,g=k.uvInfos,c;for(c in g){var a=g[c];
null==d[c]?d[c]={count:a.count,value:a.value}:d[c].count+=a.count}},summarize:function(e){e=e.uvInfos;var k,d=-Infinity,g;for(k in e){var c=e[k];c.count>d?(d=c.count,g=c.value):c.count===d&&(g=null)}return g}}},h={isSupportedStatisticType:function(e){return m.hasOwnProperty(e)},getStatisticFunctions:function(e){return m[e]},getStatisticId:function(e,k){var d=n.getAttributeIdSource(e),d=d&&n.getAttributeId(d)||e.field;return k+"_"+d},getClusterField:function(e,k){return"cluster_"+h.getStatisticId(e,
k)},getStatisticHash:function(e,k){var d=[h.getStatisticId(e,k)];e.attributeType&&d.push(e.attributeType.toLowerCase());e.rotationType&&d.push(e.rotationType.toLowerCase());return d.join("_")}};return h})},"esri/toolbars/_toolbar":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel","../Evented"],function(r,n,p,m,h){r=r([h],{declaredClass:"esri.toolbars._Toolbar",constructor:function(e){this.map=e},_cursors:{move:"pointer","move-v":"pointer","move-gv":"pointer",box0:"nw-resize",
box1:"n-resize",box2:"ne-resize",box3:"e-resize",box4:"se-resize",box5:"s-resize",box6:"sw-resize",box7:"w-resize",box8:"pointer"},_deactivateMapTools:function(e,k,d,g){var c=this.map;e&&(this._mapNavState={isDoubleClickZoom:c.isDoubleClickZoom,isClickRecenter:c.isClickRecenter,isPan:c.isPan,isRubberBandZoom:c.isRubberBandZoom,isKeyboardNavigation:c.isKeyboardNavigation,isScrollWheelZoom:c.isScrollWheelZoom},c.disableDoubleClickZoom(),c.disableClickRecenter(),c.disablePan(),c.disableRubberBandZoom(),
c.disableKeyboardNavigation());k&&c.hideZoomSlider();d&&c.hidePanArrows();g&&c.graphics.disableMouseEvents()},_activateMapTools:function(e,k,d,g){var c=this.map,a=this._mapNavState;e&&a&&(a.isDoubleClickZoom&&c.enableDoubleClickZoom(),a.isClickRecenter&&c.enableClickRecenter(),a.isPan&&c.enablePan(),a.isRubberBandZoom&&c.enableRubberBandZoom(),a.isKeyboardNavigation&&c.enableKeyboardNavigation(),a.isScrollWheelZoom&&c.enableScrollWheelZoom());k&&c.showZoomSlider();d&&c.showPanArrows();g&&c.graphics.enableMouseEvents()},
_deactivateScrollWheel:function(){var e=this.map;this._scrollWheelState={isScrollWheelZoom:e.isScrollWheelZoom,isScrollWheelPan:e.isScrollWheelPan};e.disableScrollWheelZoom();e.disableScrollWheelPan()},_activateScrollWheel:function(){var e=this.map,k=this._scrollWheelState;k&&(k.isScrollWheelZoom&&e.enableScrollWheelZoom(),k.isScrollWheelPan&&e.enableScrollWheelPan())}});p("extend-esri")&&n.setObject("toolbars._Toolbar",r,m);return r})},"esri/toolbars/draw":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/Color dojo/_base/window dojo/has dojo/sniff dojo/keys dojo/dom-construct dojo/dom-style dojo/dom-geometry ../kernel ../sniff ./_toolbar ../symbols/SimpleMarkerSymbol ../symbols/SimpleLineSymbol ../symbols/SimpleFillSymbol ../graphic ../geometry/jsonUtils ../geometry/webMercatorUtils ../geometry/Polyline ../geometry/Polygon ../geometry/Multipoint ../geometry/Rect dojo/i18n!../nls/jsapi".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A,y,B,x,w,z,E,C){var D=r(f,{declaredClass:"esri.toolbars.Draw",_eventMap:{"draw-complete":!0,"draw-end":["geometry"]},constructor:function(a,c){this.markerSymbol=new b(b.STYLE_SOLID,10,new q(q.STYLE_SOLID,new h([255,0,0]),2),new h([0,0,0,.25]));this.lineSymbol=new q(q.STYLE_SOLID,new h([255,0,0]),2);this.fillSymbol=new u(u.STYLE_SOLID,new q(q.STYLE_SOLID,new h([255,0,0]),2),new h([0,0,0,.25]));this._points=[];this._mouse=!k("esri-touch")&&!k("esri-pointer");
this._defaultOptions={showTooltips:!0,drawTime:75,tolerance:8,tooltipOffset:15};this._options=n.mixin(n.mixin({},this._defaultOptions),c||{});if(d("ios")||d("android"))this._options.showTooltips=!1;this._onKeyDownHandler=n.hitch(this,this._onKeyDownHandler);this._onMouseDownHandler=n.hitch(this,this._onMouseDownHandler);this._onMouseUpHandler=n.hitch(this,this._onMouseUpHandler);this._onClickHandler=n.hitch(this,this._onClickHandler);this._onMouseMoveHandler=n.hitch(this,this._onMouseMoveHandler);
this._onMouseDragHandler=n.hitch(this,this._onMouseDragHandler);this._onDblClickHandler=n.hitch(this,this._onDblClickHandler);this._updateTooltip=n.hitch(this,this._updateTooltip);this._hideTooltip=n.hitch(this,this._hideTooltip);this._redrawGraphic=n.hitch(this,this._redrawGraphic)},_geometryType:null,respectDrawingVertexOrder:!1,setRespectDrawingVertexOrder:function(b){this.respectDrawingVertexOrder=b},setMarkerSymbol:function(b){this.markerSymbol=b},setLineSymbol:function(b){this.lineSymbol=b},
setFillSymbol:function(b){this.fillSymbol=b},activate:function(b,a){this._geometryType&&this.deactivate();var c=this.map,d=m.connect,f=D;this._options=n.mixin(n.mixin({},this._options),a||{});c.navigationManager.setImmediateClick(!1);switch(b){case f.ARROW:case f.LEFT_ARROW:case f.RIGHT_ARROW:case f.UP_ARROW:case f.DOWN_ARROW:case f.TRIANGLE:case f.CIRCLE:case f.ELLIPSE:case f.RECTANGLE:this._deactivateMapTools(!0,!1,!1,!0);this._onClickHandler_connect=d(c,"onClick",this._onClickHandler);this._mouse?
(this._onMouseDownHandler_connect=d(c,"onMouseDown",this._onMouseDownHandler),this._onMouseDragHandler_connect=d(c,"onMouseDrag",this._onMouseDragHandler),this._onMouseUpHandler_connect=d(c,"onMouseUp",this._onMouseUpHandler)):(this._onMouseDownHandler2_connect=d(c,"onMouseDragStart",this._onMouseDownHandler),this._onMouseDragHandler2_connect=d(c,"onMouseDrag",this._onMouseDragHandler),this._onMouseUpHandler2_connect=d(c,"onMouseDragEnd",this._onMouseUpHandler));k("esri-touch")&&!k("esri-pointer")&&
(this._onMouseDownHandler2_connect=d(c,"onSwipeStart",this._onMouseDownHandler),this._onMouseDragHandler2_connect=d(c,"onSwipeMove",this._onMouseDragHandler),this._onMouseUpHandler2_connect=d(c,"onSwipeEnd",this._onMouseUpHandler));break;case f.POINT:this._onClickHandler_connect=d(c,"onClick",this._onClickHandler);break;case f.LINE:case f.EXTENT:case f.FREEHAND_POLYLINE:case f.FREEHAND_POLYGON:this._deactivateMapTools(!0,!1,!1,!0);this._mouse?(this._onMouseDownHandler_connect=d(c,"onMouseDown",this._onMouseDownHandler),
this._onMouseDragHandler_connect=d(c,"onMouseDrag",this._onMouseDragHandler),this._onMouseUpHandler_connect=d(c,"onMouseUp",this._onMouseUpHandler)):(this._onMouseDownHandler_connect=d(c,"onMouseDragStart",this._onMouseDownHandler),this._onMouseDragHandler_connect=d(c,"onMouseDrag",this._onMouseDragHandler),this._onMouseUpHandler_connect=d(c,"onMouseDragEnd",this._onMouseUpHandler));k("esri-touch")&&!k("esri-pointer")&&(this._onMouseDownHandler2_connect=d(c,"onSwipeStart",this._onMouseDownHandler),
this._onMouseDragHandler2_connect=d(c,"onSwipeMove",this._onMouseDragHandler),this._onMouseUpHandler2_connect=d(c,"onSwipeEnd",this._onMouseUpHandler));break;case f.POLYLINE:case f.POLYGON:case f.MULTI_POINT:c.navigationManager.setImmediateClick(!0);this._onClickHandler_connect=d(c,"onClick",this._onClickHandler);this._onDblClickHandler_connect=d(c,"onDblClick",this._onDblClickHandler);this._dblClickZoom=c.isDoubleClickZoom;c.disableDoubleClickZoom();break;default:console.error("Unsupported geometry type: "+
b);return}this._onKeyDown_connect=d(c,"onKeyDown",this._onKeyDownHandler);this._redrawConnect=d(c,"onExtentChange",this._redrawGraphic);this._geometryType=b;this._toggleTooltip(!0);c.snappingManager&&"freehandpolyline"!==this._geometryType&&"freehandpolygon"!==this._geometryType&&(c.snappingManager._startSelectionLayerQuery(),c.snappingManager._setUpSnapping());this.onActivate(this._geometryType)},deactivate:function(){var b=this.map;this._clear();var a=m.disconnect;a(this._onMouseMoveHandler_connect);
a(this._onMouseDownHandler_connect);a(this._onMouseDragHandler_connect);a(this._onMouseUpHandler_connect);a(this._onMouseDownHandler2_connect);a(this._onMouseDragHandler2_connect);a(this._onMouseUpHandler2_connect);a(this._onClickHandler_connect);a(this._onDblClickHandler_connect);a(this._onKeyDown_connect);a(this._redrawConnect);this._onMouseDownHandler_connect=this._onMouseMoveHandler_connect=this._onMouseDragHandler_connect=this._onMouseUpHandler_connect=this._onMouseDownHandler2_connect=this._onMouseDragHandler2_connect=
this._onMouseUpHandler2_connect=this._onClickHandler_connect=this._onDblClickHandler_connect=this._onKeyDown_connect=this._redrawConnect=null;b.snappingManager&&(b.snappingManager._stopSelectionLayerQuery(),b.snappingManager._killOffSnapping());switch(this._geometryType){case D.CIRCLE:case D.ELLIPSE:case D.TRIANGLE:case D.ARROW:case D.LEFT_ARROW:case D.RIGHT_ARROW:case D.UP_ARROW:case D.DOWN_ARROW:case D.RECTANGLE:case D.LINE:case D.EXTENT:case D.FREEHAND_POLYLINE:case D.FREEHAND_POLYGON:this._activateMapTools(!0,
!1,!1,!0);break;case D.POLYLINE:case D.POLYGON:case D.MULTI_POINT:this._dblClickZoom&&b.enableDoubleClickZoom()}a=this._geometryType;this._geometryType=null;b.navigationManager.setImmediateClick(!1);this._toggleTooltip(!1);this.onDeactivate(a)},_clear:function(){this._graphic&&this.map.graphics.remove(this._graphic,!0);this._tGraphic&&this.map.graphics.remove(this._tGraphic,!0);this._graphic=this._tGraphic=null;this.map.snappingManager&&this.map.snappingManager._setGraphic(null);this._points=[]},
finishDrawing:function(){var b,a=this._points,c=this.map.spatialReference,d=D,a=a.slice(0,a.length);switch(this._geometryType){case d.POLYLINE:if(!this._graphic||2>a.length)return;b=new x(c);b.addPath([].concat(a));break;case d.POLYGON:if(!this._graphic||3>a.length)return;b=new w(c);a=[].concat(a,[a[0].offset(0,0)]);w.prototype.isClockwise(a)||this.respectDrawingVertexOrder||(console.debug(this.declaredClass+" :  Polygons drawn in anti-clockwise direction will be reversed to be clockwise."),a.reverse());
b.addRing(a);break;case d.MULTI_POINT:b=new z(c),p.forEach(a,function(a){b.addPoint(a)})}m.disconnect(this._onMouseMoveHandler_connect);this._clear();this._setTooltipMessage(0);this._drawEnd(b)},_drawEnd:function(b){if(b){var a=this.map.spatialReference,c;this.onDrawEnd(b);a&&(a.isWebMercator()?c=B.webMercatorToGeographic(b,!0):4326===a.wkid&&(c=y.fromJson(b.toJson())));this.onDrawComplete({geometry:b,geographicGeometry:c})}},_normalizeRect:function(b,a,c){var d=b.x;b=b.y;var f=a.x;a=a.y;return{x:Math.min(d,
f),y:Math.max(b,a),width:Math.abs(d-f),height:Math.abs(b-a),spatialReference:c}},_onMouseDownHandler:function(b){this._dragged=!1;var a;this.map.snappingManager&&(a=this.map.snappingManager._snappingPoint);var c=a||b.mapPoint,d=D;a=this.map;var f=a.spatialReference;this._points.push(c.offset(0,0));switch(this._geometryType){case d.LINE:this._graphic=a.graphics.add(new A(new x({paths:[[[c.x,c.y],[c.x,c.y]]],spatialReference:f}),this.lineSymbol),!0);a.snappingManager&&a.snappingManager._setGraphic(this._graphic);
break;case d.FREEHAND_POLYLINE:this._oldPoint=b.screenPoint;c=new x(f);c.addPath(this._points);this._graphic=a.graphics.add(new A(c,this.lineSymbol),!0);a.snappingManager&&a.snappingManager._setGraphic(this._graphic);break;case d.CIRCLE:case d.ELLIPSE:case d.TRIANGLE:case d.ARROW:case d.LEFT_ARROW:case d.RIGHT_ARROW:case d.UP_ARROW:case d.DOWN_ARROW:case d.RECTANGLE:case d.FREEHAND_POLYGON:this._oldPoint=b.screenPoint,c=new w(f),c.addRing(this._points),this._graphic=a.graphics.add(new A(c,this.fillSymbol),
!0),a.snappingManager&&a.snappingManager._setGraphic(this._graphic)}k("esri-touch")&&b.preventDefault();if(1===this._points.length)this.onDrawStart()},_onMouseMoveHandler:function(b){var a;this.map.snappingManager&&(a=this.map.snappingManager._snappingPoint);var c=this._points[this._points.length-1];b=a||b.mapPoint;a=this._tGraphic;var d=a.geometry;switch(this._geometryType){case D.POLYLINE:case D.POLYGON:d.setPoint(0,0,{x:c.x,y:c.y}),d.setPoint(0,1,{x:b.x,y:b.y}),a.setGeometry(d)}},_onMouseDragHandler:function(b){if(this._graphic||
this._points.length)if(k("esri-touch")&&!this._points.length)b.preventDefault();else{this._dragged=!0;var a;this.map.snappingManager&&(a=this.map.snappingManager._snappingPoint);var c=this._points[0],d=a||b.mapPoint,f=this.map,e=f.spatialReference;a=this._graphic;var g=D,q=f.toScreen(c),u=f.toScreen(d),l=[],l=u.x-q.x,u=u.y-q.y,t=Math.sqrt(l*l+u*u);switch(this._geometryType){case g.CIRCLE:this._hideTooltip();a.geometry=w.createCircle({center:q,r:t,numberOfPoints:60,map:f});a.setGeometry(a.geometry);
break;case g.ELLIPSE:this._hideTooltip();a.geometry=w.createEllipse({center:q,longAxis:l,shortAxis:u,numberOfPoints:60,map:f});a.setGeometry(a.geometry);break;case g.TRIANGLE:this._hideTooltip();l=[[0,-t],[.8660254037844386*t,.5*t],[-.8660254037844386*t,.5*t],[0,-t]];a.geometry=this._toPolygon(l,q.x,q.y);a.setGeometry(a.geometry);break;case g.ARROW:this._hideTooltip();c=u/t;f=l/t;d=.25*f*t;e=.25*t/(u/l);t*=.25*c;l=[[l,u],[l-d*(1+24/e),u+24*f-t],[l-d*(1+12/e),u+12*f-t],[-12*c,12*f],[12*c,-12*f],[l-
d*(1-12/e),u-12*f-t],[l-d*(1-24/e),u-24*f-t],[l,u]];a.geometry=this._toPolygon(l,q.x,q.y);a.setGeometry(a.geometry);break;case g.LEFT_ARROW:this._hideTooltip();l=0>=l?[[l,0],[.75*l,u],[.75*l,.5*u],[0,.5*u],[0,-.5*u],[.75*l,-.5*u],[.75*l,-u],[l,0]]:[[0,0],[.25*l,u],[.25*l,.5*u],[l,.5*u],[l,-.5*u],[.25*l,-.5*u],[.25*l,-u],[0,0]];a.geometry=this._toPolygon(l,q.x,q.y);a.setGeometry(a.geometry);break;case g.RIGHT_ARROW:this._hideTooltip();l=0<=l?[[l,0],[.75*l,u],[.75*l,.5*u],[0,.5*u],[0,-.5*u],[.75*l,
-.5*u],[.75*l,-u],[l,0]]:[[0,0],[.25*l,u],[.25*l,.5*u],[l,.5*u],[l,-.5*u],[.25*l,-.5*u],[.25*l,-u],[0,0]];a.geometry=this._toPolygon(l,q.x,q.y);a.setGeometry(a.geometry);break;case g.UP_ARROW:this._hideTooltip();l=0>=u?[[0,u],[-l,.75*u],[-.5*l,.75*u],[-.5*l,0],[.5*l,0],[.5*l,.75*u],[l,.75*u],[0,u]]:[[0,0],[-l,.25*u],[-.5*l,.25*u],[-.5*l,u],[.5*l,u],[.5*l,.25*u],[l,.25*u],[0,0]];a.geometry=this._toPolygon(l,q.x,q.y);a.setGeometry(a.geometry);break;case g.DOWN_ARROW:this._hideTooltip();l=0<=u?[[0,u],
[-l,.75*u],[-.5*l,.75*u],[-.5*l,0],[.5*l,0],[.5*l,.75*u],[l,.75*u],[0,u]]:[[0,0],[-l,.25*u],[-.5*l,.25*u],[-.5*l,u],[.5*l,u],[.5*l,.25*u],[l,.25*u],[0,0]];a.geometry=this._toPolygon(l,q.x,q.y);a.setGeometry(a.geometry);break;case g.RECTANGLE:this._hideTooltip();l=[[0,0],[l,0],[l,u],[0,u],[0,0]];a.geometry=this._toPolygon(l,q.x,q.y);a.setGeometry(a.geometry);break;case g.LINE:a.setGeometry(n.mixin(a.geometry,{paths:[[[c.x,c.y],[d.x,d.y]]]}));break;case g.EXTENT:a&&f.graphics.remove(a,!0);a=new E(this._normalizeRect(c,
d,e));a._originOnly=!0;this._graphic=f.graphics.add(new A(a,this.fillSymbol),!0);f.snappingManager&&f.snappingManager._setGraphic(this._graphic);break;case g.FREEHAND_POLYLINE:this._hideTooltip();if(!1===this._canDrawFreehandPoint(b)){k("esri-touch")&&b.preventDefault();return}this._points.push(b.mapPoint.offset(0,0));a.geometry._insertPoints([d.offset(0,0)],0);a.setGeometry(a.geometry);break;case g.FREEHAND_POLYGON:this._hideTooltip();if(!1===this._canDrawFreehandPoint(b)){k("esri-touch")&&b.preventDefault();
return}this._points.push(b.mapPoint.offset(0,0));a.geometry._insertPoints([d.offset(0,0)],0);a.setGeometry(a.geometry)}k("esri-touch")&&b.preventDefault()}},_canDrawFreehandPoint:function(b){if(!this._oldPoint)return!1;var a=this._oldPoint.x-b.screenPoint.x,c=this._oldPoint.y-b.screenPoint.y,d=this._options.tolerance;if((0>a?-1*a:a)<d&&(0>c?-1*c:c)<d)return!1;a=new Date;if(a-this._startTime<this._options.drawTime)return!1;this._startTime=a;this._oldPoint=b.screenPoint;return!0},_onMouseUpHandler:function(b){if(this._dragged&&
this._graphic){0===this._points.length&&this._points.push(b.mapPoint.offset(0,0));var a;this.map.snappingManager&&(a=this.map.snappingManager._snappingPoint);var c=this._points[0];a=a||b.mapPoint;var d=this.map.spatialReference,f=D,e;switch(this._geometryType){case f.CIRCLE:case f.ELLIPSE:case f.TRIANGLE:case f.ARROW:case f.LEFT_ARROW:case f.RIGHT_ARROW:case f.UP_ARROW:case f.DOWN_ARROW:case f.RECTANGLE:e=this._graphic.geometry;break;case f.LINE:e=new x({paths:[[[c.x,c.y],[a.x,a.y]]],spatialReference:d});
break;case f.EXTENT:e=(new E(this._normalizeRect(c,a,d))).getExtent();break;case f.FREEHAND_POLYLINE:e=new x(d);e.addPath([].concat(this._points,[a.offset(0,0)]));break;case f.FREEHAND_POLYGON:e=new w(d),c=[].concat(this._points,[a.offset(0,0),this._points[0].offset(0,0)]),w.prototype.isClockwise(c)||this.respectDrawingVertexOrder||(console.debug(this.declaredClass+" :  Polygons drawn in anti-clockwise direction will be reversed to be clockwise."),c.reverse()),e.addRing(c)}k("esri-touch")&&b.preventDefault();
this._clear();this._drawEnd(e)}else this._clear()},_onClickHandler:function(b){var a;this.map.snappingManager&&(a=this.map.snappingManager._snappingPoint);b=a||b.mapPoint;a=this.map;var c=a.toScreen(b),d=D;this._points.push(b.offset(0,0));switch(this._geometryType){case d.POINT:this.onDrawStart();this._drawEnd(b.offset(0,0));this._setTooltipMessage(0);break;case d.POLYLINE:1===this._points.length?(c=new x(a.spatialReference),c.addPath(this._points),this._graphic=a.graphics.add(new A(c,this.lineSymbol),
!0),a.snappingManager&&a.snappingManager._setGraphic(this._graphic),this._onMouseMoveHandler_connect=m.connect(a,"onMouseMove",this._onMouseMoveHandler),this._tGraphic=a.graphics.add(new A(new x({paths:[[[b.x,b.y],[b.x,b.y]]],spatialReference:a.spatialReference}),this.lineSymbol),!0),this.onDrawStart()):(this._graphic.geometry._insertPoints([b.offset(0,0)],0),this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.lineSymbol),a=this._tGraphic,c=a.geometry,c.setPoint(0,0,b.offset(0,0)),c.setPoint(0,
1,b.offset(0,0)),a.setGeometry(c));break;case d.POLYGON:1===this._points.length?(c=new w(a.spatialReference),c.addRing(this._points),this._graphic=a.graphics.add(new A(c,this.fillSymbol),!0),a.snappingManager&&a.snappingManager._setGraphic(this._graphic),this._onMouseMoveHandler_connect=m.connect(a,"onMouseMove",this._onMouseMoveHandler),this._tGraphic=a.graphics.add(new A(new x({paths:[[[b.x,b.y],[b.x,b.y]]],spatialReference:a.spatialReference}),this.fillSymbol),!0),this.onDrawStart()):(this._graphic.geometry._insertPoints([b.offset(0,
0)],0),this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.fillSymbol),a=this._tGraphic,c=a.geometry,c.setPoint(0,0,b.offset(0,0)),c.setPoint(0,1,b.offset(0,0)),a.setGeometry(c));break;case d.MULTI_POINT:b=this._points;1===b.length?(c=new z(a.spatialReference),c.addPoint(b[b.length-1]),this._graphic=a.graphics.add(new A(c,this.markerSymbol),!0),a.snappingManager&&a.snappingManager._setGraphic(this._graphic),this.onDrawStart()):(this._graphic.geometry.addPoint(b[b.length-1]),this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.markerSymbol));
break;case d.ARROW:this._addShape([[0,0],[-24,24],[-24,12],[-96,12],[-96,-12],[-24,-12],[-24,-24],[0,0]],c.x,c.y);break;case d.LEFT_ARROW:this._addShape([[0,0],[24,24],[24,12],[96,12],[96,-12],[24,-12],[24,-24],[0,0]],c.x,c.y);break;case d.RIGHT_ARROW:this._addShape([[0,0],[-24,24],[-24,12],[-96,12],[-96,-12],[-24,-12],[-24,-24],[0,0]],c.x,c.y);break;case d.UP_ARROW:this._addShape([[0,0],[-24,24],[-12,24],[-12,96],[12,96],[12,24],[24,24],[0,0]],c.x,c.y);break;case d.DOWN_ARROW:this._addShape([[0,
0],[-24,-24],[-12,-24],[-12,-96],[12,-96],[12,-24],[24,-24],[0,0]],c.x,c.y);break;case d.TRIANGLE:this._addShape([[0,-48],[41.56921938165306,24],[-41.56921938165306,24],[0,-48]],c.x,c.y);break;case d.RECTANGLE:this._addShape([[0,-96],[96,-96],[96,0],[0,0],[0,-96]],c.x-48,c.y+48);break;case d.CIRCLE:this._clear();this.onDrawStart();this._drawEnd(w.createCircle({center:c,r:48,numberOfPoints:60,map:a}));break;case d.ELLIPSE:this._clear(),this.onDrawStart(),this._drawEnd(w.createEllipse({center:c,longAxis:48,
shortAxis:24,numberOfPoints:60,map:a}))}this._setTooltipMessage(this._points.length)},_addShape:function(b,a,c){this._setTooltipMessage(0);this._clear();this.onDrawStart();this._drawEnd(this._toPolygon(b,a,c))},_toPolygon:function(b,a,c){var d=this.map,f=new w(d.spatialReference);f.addRing(p.map(b,function(b){return d.toMap({x:b[0]+a,y:b[1]+c})}));return f},_onDblClickHandler:function(b){var a,c=this._points,d=this.map.spatialReference,f=D;k("esri-touch")&&c.push(b.mapPoint);var e=c[c.length-1],g=
c[c.length-2],c=e&&g&&e.x===g.x&&e.y===g.y?c.slice(0,c.length-1):c.slice(0,c.length);switch(this._geometryType){case f.POLYLINE:if(!this._graphic||2>c.length){m.disconnect(this._onMouseMoveHandler_connect);this._clear();this._onClickHandler(b);return}a=new x(d);a.addPath([].concat(c));break;case f.POLYGON:if(!this._graphic||2>c.length){m.disconnect(this._onMouseMoveHandler_connect);this._clear();this._onClickHandler(b);return}a=new w(d);b=[].concat(c,[c[0].offset(0,0)]);w.prototype.isClockwise(b)||
this.respectDrawingVertexOrder||(console.debug(this.declaredClass+" :  Polygons drawn in anti-clockwise direction will be reversed to be clockwise."),b.reverse());a.addRing(b);break;case f.MULTI_POINT:a=new z(d),p.forEach(c,function(b){a.addPoint(b)})}m.disconnect(this._onMouseMoveHandler_connect);this._clear();this._setTooltipMessage(0);this._drawEnd(a)},_onKeyDownHandler:function(b){b.keyCode===g.ESCAPE&&(m.disconnect(this._onMouseMoveHandler_connect),this._clear(),this._setTooltipMessage(0))},
_toggleTooltip:function(b){this._options.showTooltips&&(b?this._tooltip||(this._tooltip=c.create("div",{"class":"esriMapTooltip"},this.map.container),l.isBodyLtr()||a.set(this._tooltip,"direction","rtl"),this._tooltip.style.display="none",this._tooltip.style.position="fixed",this._setTooltipMessage(0),this._onTooltipMouseEnterHandler_connect=m.connect(this.map,"onMouseOver",this._updateTooltip),this._onTooltipMouseLeaveHandler_connect=m.connect(this.map,"onMouseOut",this._hideTooltip),this._onTooltipMouseMoveHandler_connect=
m.connect(this.map,"onMouseMove",this._updateTooltip)):this._tooltip&&(m.disconnect(this._onTooltipMouseEnterHandler_connect),m.disconnect(this._onTooltipMouseLeaveHandler_connect),m.disconnect(this._onTooltipMouseMoveHandler_connect),c.destroy(this._tooltip),this._tooltip=null))},_hideTooltip:function(){var b=this._tooltip;b&&(b.style.display="none")},_setTooltipMessage:function(b){var a=this._tooltip;if(a){var c="";switch(this._geometryType){case D.POINT:c=C.toolbars.draw.addPoint;break;case D.ARROW:case D.LEFT_ARROW:case D.RIGHT_ARROW:case D.UP_ARROW:case D.DOWN_ARROW:case D.TRIANGLE:case D.RECTANGLE:case D.CIRCLE:case D.ELLIPSE:c=
C.toolbars.draw.addShape;break;case D.LINE:case D.EXTENT:case D.FREEHAND_POLYLINE:case D.FREEHAND_POLYGON:c=C.toolbars.draw.freehand;break;case D.POLYLINE:case D.POLYGON:c=C.toolbars.draw.start;1===b?c=C.toolbars.draw.resume:2<=b&&(c=C.toolbars.draw.complete);break;case D.MULTI_POINT:c=C.toolbars.draw.addMultipoint,1<=b&&(c=C.toolbars.draw.finish)}a.innerHTML=c}},_updateTooltip:function(b){var c=this._tooltip;if(c){var d;b.clientX||b.pageY?(d=b.clientX,b=b.clientY):(d=b.clientX+e.body().scrollLeft-
e.body().clientLeft,b=b.clientY+e.body().scrollTop-e.body().clientTop);c.style.display="none";a.set(c,{left:d+this._options.tooltipOffset+"px",top:b+"px"});c.style.display=""}},_redrawGraphic:function(b,a,c,d){if(c||this.map.wrapAround180)(b=this._graphic)&&b.setGeometry(b.geometry),(b=this._tGraphic)&&b.setGeometry(b.geometry)},onActivate:function(){},onDeactivate:function(){},onDrawComplete:function(){},onDrawStart:function(){},onDrawEnd:function(){}});n.mixin(D,{POINT:"point",MULTI_POINT:"multipoint",
LINE:"line",EXTENT:"extent",POLYLINE:"polyline",POLYGON:"polygon",FREEHAND_POLYLINE:"freehandpolyline",FREEHAND_POLYGON:"freehandpolygon",ARROW:"arrow",LEFT_ARROW:"leftarrow",RIGHT_ARROW:"rightarrow",UP_ARROW:"uparrow",DOWN_ARROW:"downarrow",TRIANGLE:"triangle",CIRCLE:"circle",ELLIPSE:"ellipse",RECTANGLE:"rectangle"});k("extend-esri")&&n.setObject("toolbars.Draw",D,t);return D})},"esri/toolbars/edit":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/array dojo/_base/Color dojo/has dojo/dom-construct dojo/dom-style ../kernel ../lang ../sniff ./_toolbar ./_Box ./_GraphicMover ./_VertexEditor ./TextEditor ../symbols/SimpleMarkerSymbol ../symbols/SimpleLineSymbol ../symbols/TextSymbol ../graphic".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A,y,B){var x=n(t,{declaredClass:"esri.toolbars.Edit",constructor:function(b,a){this._map=b;this._tool=0;if(this._map.loaded)this._scratchGL=b.graphics;else var c=m.connect(this._map,"onLoad",this,function(){m.disconnect(c);c=null;this._scratchGL=this._map.graphics});var d=k("esri-mobile");this._defaultOptions=p.mixin({vertexSymbol:new u(u.STYLE_CIRCLE,d?20:12,new A(A.STYLE_SOLID,new e([0,0,0,.5]),1),new e([128,128,128])),ghostVertexSymbol:new u(u.STYLE_CIRCLE,
d?18:10,new A(A.STYLE_SOLID,new e([0,0,0,.5]),1),new e([255,255,255,.75])),ghostLineSymbol:new A(A.STYLE_DOT,new e([128,128,128]),2),allowDeleteVertices:!0,allowAddVertices:!0,rotateHandleOffset:d?24:16,boxLineSymbol:new A(A.STYLE_DASH,new e([64,64,64]),1),boxHandleSymbol:new u(u.STYLE_SQUARE,d?16:9,new A(A.STYLE_SOLID,new e([0,0,0,.5]),1),new e([255,255,255,.75])),textAnchorSymbol:new u(u.STYLE_CIRCLE,10,null,new e([255,0,0]))},a||{})},activate:function(b,a,c){this.deactivate();this._graphic=a;this._options=
p.mixin(p.mixin({},this._defaultOptions),c||{});var d=x.MOVE;c=x.EDIT_VERTICES;var f=x.SCALE,e=x.ROTATE,g=x.EDIT_TEXT,q=!1,u=!1,l=!1,t=this._map,k=t.spatialReference,h=a.geometry.spatialReference;this._geo=!(!k||!h||k.equals(h)||!k.isWebMercator()||4326!==h.wkid);this._isTextPoint=this._prepareTextSymbolEditing(a,b);(b&d)===d&&(q=this._enableMove(a));d=(b&f)===f;e=(b&e)===e;if(d||e)l=this._enableBoxEditing(a,d,e);(b&c)===c&&(u=this._enableVertexEditing(a));(b&g)===g&&this._enableTextEditing(a);if(!(q||
u||l))throw Error("[esri.toolbars.Edit::activate] Unable to activate the tool. Check if the tool is valid for the given geometry type.");if(this._tool=b)this._mapPanEndHandle=m.connect(t,"onPanEnd",this,this._mapPanEndHandler),this._mapExtChgHandle=m.connect(t,"onExtentChange",this,this._mapExtentChangeHandler),this.onActivate(this._tool,a);t.snappingManager&&(q||u)&&t.snappingManager._startSelectionLayerQuery()},deactivate:function(){this._isTextPoint=null;var b=this._tool,a=this._graphic;if(b){var c=
!!this._modified;this._clear();m.disconnect(this._mapPanEndHandle);m.disconnect(this._mapExtChgHandle);this._graphic=this._geo=this._mapPanEndHandle=this._mapExtChgHandle=null;this.onDeactivate(b,a,{isModified:c});this._map.snappingManager&&this._map.snappingManager._stopSelectionLayerQuery()}},refresh:function(){this._refreshMoveables(!0)},getCurrentState:function(){return{tool:this._tool,graphic:this._graphic,isModified:!!this._modified}},onActivate:function(b,a){},onDeactivate:function(b,a,c){},
onGraphicMoveStart:function(b){},onGraphicFirstMove:function(b){this._modified=!0},onGraphicMove:function(b,a){},onGraphicMoveStop:function(b,a){},onGraphicClick:function(b,a){},onVertexMoveStart:function(b,a){},onVertexFirstMove:function(b,a){this._modified=!0},onVertexMove:function(b,a,c){},onVertexMoveStop:function(b,a,c){},onVertexAdd:function(b,a){this._modified=!0},onVertexClick:function(b,a){},onVertexMouseOver:function(b,a){},onVertexMouseOut:function(b,a){},onVertexDelete:function(b,a){this._modified=
!0},onTextEditStart:function(b,a){},onTextEditEnd:function(b){},onScaleStart:function(b){},onScaleFirstMove:function(b){this._modified=!0},onScale:function(b,a){},onScaleStop:function(b,a){},onRotateStart:function(b){},onRotateFirstMove:function(b){this._modified=!0},onRotate:function(b,a){},onRotateStop:function(b,a){},_eventMap:{activate:["tool","graphic"],deactivate:["tool","graphic","info"],"graphic-move-start":["graphic"],"graphic-first-move":["graphic"],"graphic-move":["graphic","transform"],
"graphic-move-stop":["graphic","transform"],"graphic-click":["graphic","info"],"vertex-move-start":["graphic","vertexinfo"],"vertex-first-move":["graphic","vertexinfo"],"vertex-move":["graphic","vertexinfo","transform"],"vertex-move-stop":["graphic","vertexinfo","transform"],"vertex-add":["graphic","vertexinfo"],"vertex-click":["graphic","vertexinfo"],"vertex-mouse-over":["graphic","vertexinfo"],"vertex-mouse-out":["graphic","vertexinfo"],"vertex-delete":["graphic","vertexinfo"],"scale-start":["graphic"],
"scale-first-move":["graphic"],scale:["graphic","info"],"scale-stop":["graphic","info"],"rotate-start":["graphic"],"rotate-first-move":["graphic"],rotate:["graphic","info"],"rotate-stop":["graphic","info"]},_prepareTextSymbolEditing:function(b,a){if("point"===b.geometry.type||"multipoint"===b.geometry.type){var c=b.getLayer(),f=c.renderer,c=b.symbol||c._getSymbol(b);!c&&(f.hasVisualVariables("sizeInfo",!1)||f.hasVisualVariables("colorInfo",!1)||f.hasVisualVariables("opacityInfo",!1))&&f.addBreak&&
f.infos&&1===f.infos.length&&(c=f.infos[0].symbol||f.defaultSymbol);if(c&&"textsymbol"===c.type){if((a&x.SCALE)===x.SCALE||(a&x.ROTATE)===x.ROTATE||(a&x.EDIT_TEXT)===x.EDIT_TEXT){b.setSymbol(new y(c.toJson()));var e=this;this._textSymbolEditor?(this._textSymbolEditor.createForm(b),this._textSymbolEditor.show()):this._options&&this._options.textSymbolEditor?(this._textSymbolEditor=this._options.textSymbolEditor,this._textSymbolEditor.on("symbol-change",function(){e._boxEditor&&e._boxEditor.refresh()})):
r(["../dijit/SymbolEditor"],function(a){if(!e._textSymbolEditor){var c;c=e._options.textSymbolEditorHolder?d.create("div",null,e._options.textSymbolEditorHolder):d.create("div",null,e._map.root);e._textSymbolEditor=new a({graphic:b},c);a=e._textSymbolEditor.domNode.parentNode.id;g.set(e._textSymbolEditor.domNode,{position:"map_root"===a?"absolute":"relative",left:"map_root"===a?e._map.width/2-100+"px":"5px",top:"20px","z-index":50});e._textSymbolEditor.startup();e._textSymbolEditor.createForm(b);
e._textSymbolEditor.show();e._textSymbolEditor.on("symbol-change",function(){e._boxEditor&&e._boxEditor.refresh()})}})}if((a&x.MOVE)===x.MOVE||(a&x.ROTATE)===x.ROTATE||(a&x.SCALE)===x.SCALE)this._textAnchor=new B(b.geometry,this._options.textAnchorSymbol),this._scratchGL.add(this._textAnchor);return!0}}return!1},_enableMove:function(b){var a=this._map;switch(b.geometry.type){case "point":case "polyline":case "polygon":return this._graphicMover=new f(b,a,this,this._textAnchor),!0}return!1},_enableVertexEditing:function(a){var c=
this._map;switch(a.geometry.type){case "multipoint":case "polyline":case "polygon":return this._vertexEditor=b.create(a,c,this),!0}return!1},_enableBoxEditing:function(b,a,c){var d=this._map,f=b.geometry.type;return"polyline"===f||"polygon"===f||this._isTextPoint?(this._boxEditor=new v(b,d,this,a,c,this._options.uniformScaling,this._isTextPoint),!0):!1},_enableTextEditing:function(b){return this._isTextPoint?(this._textEditor=new q(b,this._map,this),m.connect(this._textEditor,"onEditStart",p.hitch(this,
function(){this._textAnchor&&(this._textAnchor.getLayer().remove(this._textAnchor),this._textAnchor=null);this._map.disableKeyboardNavigation();this._disableMove();this._disableBoxEditing()})),!0):!1},_disableMove:function(){var b=this._graphicMover;b&&(b.destroy(),this._graphicMover=null)},_disableVertexEditing:function(){var b=this._vertexEditor;b&&(b.destroy(),this._vertexEditor=null)},_disableBoxEditing:function(){var b=this._boxEditor;b&&(b.destroy(),this._boxEditor=null)},_disableTextEditing:function(){this._textEditor&&
(this._textEditor.destroy(),this._textEditor=null);this._map.enableKeyboardNavigation()},_disableSymbolEditing:function(){this._textSymbolEditor&&this._textSymbolEditor.hide()},_clear:function(){this._disableMove();this._disableVertexEditing();this._disableBoxEditing();this._disableTextEditing();this._disableSymbolEditing();this._textAnchor&&(this._textAnchor.getLayer().remove(this._textAnchor),this._textAnchor=null);this._tool=0;this._modified=!1},_mapPanEndHandler:function(){this._refreshMoveables()},
_mapExtentChangeHandler:function(b,a,c){c&&this._refreshMoveables()},_refreshMoveables:function(b){var c=h.filter([this._graphicMover,this._vertexEditor,this._boxEditor],a.isDefined);h.forEach(c,function(a){a.refresh(b)})},_beginOperation:function(b){h.forEach(this._getAffectedTools(b),function(b){b.suspend()})},_endOperation:function(b){h.forEach(this._getAffectedTools(b),function(b){b.resume()})},_getAffectedTools:function(b){var c=[];switch(b){case "MOVE":c=[this._vertexEditor,this._boxEditor];
break;case "VERTICES":c=[this._boxEditor];break;case "BOX":c=[this._vertexEditor]}return c=h.filter(c,a.isDefined)}});p.mixin(x,{MOVE:1,EDIT_VERTICES:2,SCALE:4,ROTATE:8,EDIT_TEXT:16});k("extend-esri")&&p.setObject("toolbars.Edit",x,c);return x})},"esri/toolbars/_Box":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/Color dojo/has dojo/dom-style dojox/gfx/Moveable dojox/gfx/matrix ../kernel ../lang ../geometry/Point ../geometry/Polyline ../symbols/SimpleMarkerSymbol ../geometry/webMercatorUtils ../geometry/jsonUtils ../graphic".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q){r=r(null,{declaredClass:"esri.toolbars._Box",constructor:function(b,a,c,d,f,e,g){this._graphic=b;this._map=a;this._toolbar=c;this._scale=d;this._rotate=f;this._defaultEventArgs={};this._scaleEvent="Scale";this._rotateEvent="Rotate";this._uniformScaling=e;b=c._options;this._markerSymbol=b.boxHandleSymbol;this._lineSymbol=b.boxLineSymbol;this._moveStartHandler=n.hitch(this,this._moveStartHandler);this._firstMoveHandler=n.hitch(this,this._firstMoveHandler);
this._moveStopHandler=n.hitch(this,this._moveStopHandler);this._moveHandler=n.hitch(this,this._moveHandler);this._isTextPoint=g;this._init()},destroy:function(){this._cleanUp();this._graphic=this._map=this._toolbar=this._markerSymbol=this._lineSymbol=null},refresh:function(){this._draw()},suspend:function(){p.forEach(this._getAllGraphics(),function(b){b.hide()})},resume:function(){p.forEach(this._getAllGraphics(),function(b){b.show()});this._draw()},_init:function(){this._draw()},_cleanUp:function(){this._connects&&
p.forEach(this._connects,m.disconnect);var b=this._toolbar._scratchGL;this._anchors&&p.forEach(this._anchors,function(a){b.remove(a.graphic);(a=a.moveable)&&a.destroy()});this._box&&b.remove(this._box);this._box=this._anchors=this._connects=null},_draw:function(){if(this._graphic.getDojoShape()){var b=this._map,a=this._toolbar._scratchGL,c=this._getBoxCoords(),d=new t(b.spatialReference),f=n.clone(p.filter(c,function(b,a){return 8!==a&&0===a%2}));f[0]&&f.push([f[0][0],f[0][1]]);d.addPath(f);this._rotate&&
d.addPath([c[1],c[8]]);this._box?this._box.setGeometry(d):(this._box=new q(d,this._lineSymbol),a.add(this._box));this._anchors?p.forEach(this._anchors,function(a,d){this._scale||(d=8);var f=new l(c[d],b.spatialReference);a.graphic.setGeometry(f);var f=a.moveable,e=a.graphic.getDojoShape();e&&(f?e!==f.shape&&(f.destroy(),a.moveable=this._getMoveable(a.graphic,d)):a.moveable=this._getMoveable(a.graphic,d))},this):(this._anchors=[],this._connects=[],p.forEach(c,function(c,d){if(this._scale||!(8>d)){c=
new l(c,b.spatialReference);var f=new q(c,this._markerSymbol);this._isTextPoint&&1===d%2&&f.hide();a.add(f);this._anchors.push({graphic:f,moveable:this._getMoveable(f,d)})}},this))}else this._cleanUp()},_getBoxCoords:function(b){var a=this._map,c,d=[],f,e,g;if(this._isTextPoint){c=this._graphic.getNode().getBoundingClientRect();var q=a.__container.getBoundingClientRect();c=[{x:c.left-q.left,y:c.top-q.top},{x:c.right-q.left,y:c.top-q.top},{x:c.right-q.left,y:c.bottom-q.top},{x:c.left-q.left,y:c.bottom-
q.top}]}else c=this._getTransformedBoundingBox(this._graphic);p.forEach(c,function(c,q,u){f=c;(e=u[q+1])||(e=u[0]);g={x:(f.x+e.x)/2,y:(f.y+e.y)/2};b||(f=a.toMap(f),g=a.toMap(g));d.push([f.x,f.y]);d.push([g.x,g.y])});this._rotate&&(c=n.clone(d[1]),c=b?{x:c[0],y:c[1]}:a.toScreen({x:c[0],y:c[1],spatialReference:a.spatialReference}),c.y-=this._toolbar._options.rotateHandleOffset,b||(c=a.toMap(c)),d.push([c.x,c.y]));return d},_getTransformedBoundingBox:function(b){var a=this._map,c=b.geometry.getExtent(),
d=b.geometry.spatialReference;b=new l(c.xmin,c.ymax,d);c=new l(c.xmax,c.ymin,d);b=a.toScreen(b);c=a.toScreen(c);return[{x:b.x,y:b.y},{x:c.x,y:b.y},{x:c.x,y:c.y},{x:b.x,y:c.y}]},_getAllGraphics:function(){var b=[this._box];this._anchors&&p.forEach(this._anchors,function(a){b.push(a.graphic)});return b=p.filter(b,a.isDefined)},_getMoveable:function(b,a){var c=b.getDojoShape();if(c){var f=new d(c);f._index=a;this._connects.push(m.connect(f,"onMoveStart",this._moveStartHandler));this._connects.push(m.connect(f,
"onFirstMove",this._firstMoveHandler));this._connects.push(m.connect(f,"onMoveStop",this._moveStopHandler));f.onMove=this._moveHandler;(c=c.getEventSource())&&k.set(c,"cursor",this._toolbar._cursors["box"+a]);return f}},_moveStartHandler:function(b){this._toolbar["on"+(8===b.host._index?this._rotateEvent:this._scaleEvent)+"Start"](this._graphic)},_firstMoveHandler:function(b){this._toolbar._deactivateScrollWheel();var a=b.host._index,c=this._wrapOffset=b.host.shape._wrapOffsets[0]||0,d=this._graphic.getLayer()._getTransform(),
f;b=p.map(this._getBoxCoords(!0),function(b){return{x:b[0]+c,y:b[1]}});f=this._isTextPoint?this._map.toScreen(this._graphic.geometry):{x:b[1].x,y:b[3].y};this._centerCoord=g.multiplyPoint(g.invert(d),f);if(8===a)f=g.multiplyPoint(g.invert(d),b[1]),this._isTextPoint&&(this._centerCoord=this._deNormalizePoint(this._centerCoord,f)),this._startLine=[this._centerCoord,f],this._moveLine=n.clone(this._startLine);else if(f=g.multiplyPoint(g.invert(d),b[a]),d=g.multiplyPoint(g.invert(d),b[(a+4)%8]),this._isTextPoint&&
(this._centerCoord=this._deNormalizePoint(this._centerCoord,f)),this._firstMoverToAnchor=Math.sqrt((f.x-this._centerCoord.x)*(f.x-this._centerCoord.x)+(f.y-this._centerCoord.y)*(f.y-this._centerCoord.y)),this._startBox=d,this._startBox.width=b[4].x-b[0].x,this._startBox.height=b[4].y-b[0].y,this._moveBox=n.clone(this._startBox),this._xfactor=f.x>d.x?1:-1,this._yfactor=f.y>d.y?1:-1,1===a||5===a)this._xfactor=0;else if(3===a||7===a)this._yfactor=0;this._toolbar._beginOperation("BOX");this._toolbar["on"+
(8===a?this._rotateEvent:this._scaleEvent)+"FirstMove"](this._graphic)},_moveHandler:function(b,a){var c=b.host._index,d=this._defaultEventArgs,f,e,q,l;d.angle=0;d.scaleX=1;d.scaleY=1;if(8===c)f=this._startLine,e=this._moveLine,q=e[1],q.x+=a.dx,q.y+=a.dy,q=this._getAngle(f,e),this._isTextPoint&&(q+=this._graphic.symbol.angle),e=g.rotategAt(q,f[0]),this._graphic.getDojoShape().setTransform(e),d.transform=e,d.angle=q,d.around=f[0];else{f=this._startBox;e=this._moveBox;e.width+=a.dx*this._xfactor;e.height+=
a.dy*this._yfactor;this._uniformScaling||this._isTextPoint?(f=e.x+this._xfactor*e.width,e=e.y+this._yfactor*e.height,f=Math.sqrt((f-this._centerCoord.x)*(f-this._centerCoord.x)+(e-this._centerCoord.y)*(e-this._centerCoord.y)),this._scaleRatio=q=l=f/this._firstMoverToAnchor,f=this._centerCoord):(q=e.width/f.width,l=e.height/f.height,f={x:f.x,y:f.y});if(isNaN(q)||Infinity===q||-Infinity===q)q=1;if(isNaN(l)||Infinity===l||-Infinity===l)l=1;e=g.scaleAt(q,l,f);if(this._isTextPoint){var u=g.rotategAt(this._graphic.symbol.angle,
f);this._graphic.getDojoShape().setTransform([u,e])}else this._graphic.getDojoShape().setTransform(e);d.transform=e;d.scaleX=q;d.scaleY=l;d.around=f}this._toolbar["on"+(8===c?this._rotateEvent:this._scaleEvent)](this._graphic,d)},_moveStopHandler:function(a){this._toolbar._activateScrollWheel();var c=this._graphic,d=this._toolbar,e=d._geo?f.geographicToWebMercator(c.geometry):c.geometry,g=e.spatialReference,q=c.getDojoShape(),l=q.getTransform(),u=c.getLayer()._getTransform();this._isTextPoint?(c=
this._graphic.symbol,8===a.host._index?c.angle+=this._getAngle(this._startLine,this._moveLine):c.font.setSize(Math.round(c.font.size*this._scaleRatio*100)/100),this._graphic.setSymbol(c)):(e=e.toJson(),this._updateSegments(e.paths||e.rings,l,u,g),q.setTransform(null),e=b.fromJson(e),c.setGeometry(d._geo?f.webMercatorToGeographic(e,!0):e));this._draw();this._startLine=this._moveLine=this._startBox=this._moveBox=this._xfactor=this._yfactor=null;d._endOperation("BOX");this._defaultEventArgs.transform=
l;d["on"+(8===a.host._index?this._rotateEvent:this._scaleEvent)+"Stop"](this._graphic,this._defaultEventArgs)},_updateSegments:function(b,a,c,d){var f=this._map,e=this._wrapOffset||0;p.forEach(b,function(b){p.forEach(b,function(b){this._updatePoint(b,d,e,g,f,c,a)},this)},this)},_updatePoint:function(b,a,c,d,f,e,g){a=f.toScreen({x:b[0],y:b[1],spatialReference:a},!0);a.x+=c;a=d.multiplyPoint([e,g,d.invert(e)],a);a.x-=c;c=f.toMap(a);b[0]=c.x;b[1]=c.y},_getAngle:function(b,a){return 180*Math.atan2(a[0].y-
a[1].y,a[0].x-a[1].x)/Math.PI-180*Math.atan2(b[0].y-b[1].y,b[0].x-b[1].x)/Math.PI},_deNormalizePoint:function(b,a){var c=this._map._getFrameWidth();if(-1===c)return b;for(var d={x:b.x,y:b.y};Math.abs(d.x-a.x)>=c;)d.x=d.x<a.x?d.x+c:d.x-c;var f=Math.abs(d.x-a.x);Math.abs(d.x-a.x+c)<f?d.x+=c:Math.abs(d.x-a.x-c)<f&&(d.x-=c);return d}});e("extend-esri")&&n.setObject("toolbars._Box",r,c);return r})},"dojox/gfx/Moveable":function(){define("dojo/_base/lang dojo/_base/declare dojo/_base/array dojo/_base/event dojo/topic dojo/touch dojo/dom-class dojo/_base/window ./Mover dojo/mouse".split(" "),
function(r,n,p,m,h,e,k,d,g,c){return n("dojox.gfx.Moveable",null,{constructor:function(a,c){this.shape=a;this.delay=c&&0<c.delay?c.delay:0;this.mover=c&&c.mover?c.mover:g;this.leftButtonOnly=c&&c.leftButtonOnly;this.events=[this.shape.on(e.press,r.hitch(this,"onMouseDown"))]},destroy:function(){p.forEach(this.events,function(a){a.remove()});this.events=this.shape=null},onMouseDown:function(a){this.delay?(this.events.push(this.shape.on(e.move,r.hitch(this,"onMouseMove")),this.shape.on(e.release,r.hitch(this,
"onMouseUp"))),this._lastX=a.clientX,this._lastY=a.clientY):this.leftButtonOnly&&!c.isLeft(a)||new this.mover(this.shape,a,this);m.stop(a)},onMouseMove:function(a){var c=a.clientY;if(Math.abs(a.clientX-this._lastX)>this.delay||Math.abs(c-this._lastY)>this.delay)this.onMouseUp(a),new this.mover(this.shape,a,this);m.stop(a)},onMouseUp:function(a){this.events.pop().remove()},onMoveStart:function(a){h.publish("/gfx/move/start",a);k.add(d.body(),"dojoMove")},onMoveStop:function(a){h.publish("/gfx/move/stop",
a);k.remove(d.body(),"dojoMove")},onFirstMove:function(a){},onMove:function(a,c,d){this.onMoving(a,c,d);this.shape.applyLeftTransform(c);this.onMoved(a,c)},onMoving:function(a,c){},onMoved:function(a,c){}})})},"dojox/gfx/Mover":function(){define("dojo/_base/lang dojo/_base/array dojo/_base/declare dojo/on dojo/touch dojo/_base/event".split(" "),function(r,n,p,m,h,e){return p("dojox.gfx.Mover",null,{constructor:function(k,d,g){this.shape=k;this.lastX=d.clientX;this.lastY=d.clientY;k=this.host=g;d=
document;g=m(d,h.move,r.hitch(this,"onFirstMove"));this.events=[m(d,h.move,r.hitch(this,"onMouseMove")),m(d,h.release,r.hitch(this,"destroy")),m(d,"dragstart",r.hitch(e,"stop")),m(d,"selectstart",r.hitch(e,"stop")),g];if(k&&k.onMoveStart)k.onMoveStart(this)},onMouseMove:function(k){var d=k.clientX,g=k.clientY;this.host.onMove(this,{dx:d-this.lastX,dy:g-this.lastY},k);this.lastX=d;this.lastY=g;e.stop(k)},onFirstMove:function(){this.host.onFirstMove(this);this.events.pop().remove()},destroy:function(){n.forEach(this.events,
function(d){d.remove()});var e=this.host;if(e&&e.onMoveStop)e.onMoveStop(this);this.events=this.shape=null}})})},"esri/toolbars/_GraphicMover":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/json dojo/dom-style dojox/gfx/Moveable dojox/gfx/Mover dojox/gfx/matrix ../kernel ../PointerEvents ../sniff ../geometry/webMercatorUtils ../geometry/ScreenPoint ../geometry/Point".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l,t,v){var f=r(null,{declaredClass:"esri.toolbars._GraphicMover",
constructor:function(b,a,c,d){this.graphic=b;this.map=a;this.toolbar=c;this.tempPt=d;this._enableGraphicMover();this._moved=!1},refresh:function(b){var a=this.graphic.getDojoShape();!a||!b&&a._hostGraphic||(this._disableGraphicMover(),this._enableGraphicMover())},destroy:function(){this._disableGraphicMover()},hasMoved:function(){return this._moved},_enableGraphicMover:function(){var b=this.graphic,a=b.getDojoShape();a&&(a._hostGraphic=b,this._moveable=new e(a,{mover:f.Mover}),this._moveStartHandle=
p.connect(this._moveable,"onMoveStart",this,this._moveStartHandler),this._firstMoveHandle=p.connect(this._moveable,"onFirstMove",this,this._firstMoveHandler),this._movingHandle=p.connect(this._moveable,"onMoving",this,this._movingHandler),this._moveStopHandle=p.connect(this._moveable,"onMoveStop",this,this._moveStopHandler),(b=a.getEventSource())&&h.set(b,"cursor",this.toolbar._cursors.move))},_disableGraphicMover:function(){var b=this._moveable;if(b){p.disconnect(this._moveStartHandle);p.disconnect(this._firstMoveHandle);
p.disconnect(this._movingHandle);p.disconnect(this._moveStopHandle);var a=b.shape;a&&(a._hostGraphic=null,(a=a.getEventSource())&&h.set(a,"cursor","inherit"));b.destroy()}this._moveable=null},_moveStartHandler:function(){var b=this.graphic,a=this.map;this._startTx=b.getDojoShape().getTransform();"point"===this.graphic.geometry.type&&a.snappingManager&&a.snappingManager._setUpSnapping();this.toolbar.onGraphicMoveStart(b)},_firstMoveHandler:function(){this.toolbar._beginOperation("MOVE");this.toolbar.onGraphicFirstMove(this.graphic)},
_movingHandler:function(b,d,f){b=b.shape.getTransform();d=this.map;var e;a("esri-pointer")?e=d.navigationManager.pointerEvents._processTouchEvent(f,f):f&&"pointermove"===f.type&&(e=c.prototype._processTouchEvent.call({map:d},f,f));e&&d.snappingManager&&d.snappingManager._onSnappingMouseMoveHandler(e);this.tempPt&&this.tempPt.getDojoShape().setTransform(b);this.toolbar.onGraphicMove(this.graphic,b)},_moveStopHandler:function(b){var a=this.graphic,c=this.toolbar,f=this.map,e=c._geo?l.geographicToWebMercator(a.geometry):
a.geometry,g=e.type,k=a.getDojoShape(),h=k.getTransform();if(m.toJson(h)!==m.toJson(this._startTx)){this._moved=!0;switch(g){case "point":var g=[h,d.invert(this._startTx)],n;f.snappingManager&&(n=f.snappingManager._snappingPoint);e=n||f.toMap(d.multiplyPoint(g,f.toScreen(e,!0)));f.snappingManager&&f.snappingManager._killOffSnapping();break;case "polyline":e=this._updatePolyGeometry(e,e.paths,h);break;case "polygon":e=this._updatePolyGeometry(e,e.rings,h)}k.setTransform(null);a.setGeometry(c._geo?
l.webMercatorToGeographic(e,!0):e);this.tempPt&&this.tempPt.setGeometry(new v(a.geometry.toJson()))}else this._moved=!1;c._endOperation("MOVE");c.onGraphicMoveStop(a,h);this._moved||(b=b.__e,f=this.map.position,b=new t(b.pageX-f.x,b.pageY-f.y),c.onGraphicClick(a,{screenPoint:b,mapPoint:this.map.toMap(b)}))},_updatePolyGeometry:function(b,a,c){var d=this.map,f=b.getPoint(0,0),d=d.toMap(d.toScreen(f).offset(c.dx,c.dy));c=d.x-f.x;for(var f=d.y-f.y,e,g,q,d=0;d<a.length;d++)for(g=a[d],e=0;e<g.length;e++)q=
b.getPoint(d,e),b.setPoint(d,e,q.offset(c,f));return b}});f.Mover=r(k,{declaredClass:"esri.toolbars._Mover",constructor:function(b,a,c){this.__e=a}});a("extend-esri")&&(n.setObject("toolbars._GraphicMover",f,g),n.setObject("toolbars._Mover",f.Mover,g));return f})},"esri/toolbars/_VertexEditor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/array dojo/has dijit/Menu dijit/MenuItem ../kernel ./_VertexMover ../geometry/Point ../geometry/jsonUtils dojo/i18n!../nls/jsapi".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l){var t=r(null,{declaredClass:"esri.toolbars._GraphicVertexEditor",constructor:function(a,c,b){this.graphic=a;this.map=c;this.toolbar=b;a=b._options;this._symbol1=a.vertexSymbol;this._symbol2=a.ghostVertexSymbol;c=a.ghostLineSymbol;this._lineStroke={style:c.style,width:c.width,color:c.color};this._canDel=a.allowDeleteVertices;this._canAdd=a.allowAddVertices;this._addControllers()},destroy:function(){this._removeControllers()},refresh:function(a){a?(this._removeControllers(),
this._addControllers()):(this._refresh(this._vertexMovers),this._refresh(this._mpVertexMovers))},suspend:function(){this._suspended||this._removeControllers();this._suspended=!0},resume:function(){this._suspended&&this._addControllers();this._suspended=!1},_addControllers:function(){this._firstMoveHandle=p.connect(g,"onFirstMove",this,this._firstMoveHandler);this._moveStopHandle=p.connect(g,"onMoveStop",this,this._moveStopHandler);this._vertexMovers=this._add(this._getSegments(this.graphic.geometry),
this._symbol1);this._canAdd&&(this._mpVertexMovers=this._add(this._getMidpointSegments(this.graphic.geometry),this._symbol2,!0));var a=this._getGraphicsLayer();this._mouseOverHandle=p.connect(a,"onMouseOver",this,this._mouseOverHandler);this._mouseOutHandle=p.connect(a,"onMouseOut",this,this._mouseOutHandler);this._canDel&&(this._ctxMenu=new e({style:"font-size: 12px; margin-left: 5px; margin-top: 5px;"}),a=this._ctxDelete=new k({label:l.toolbars.edit.deleteLabel,iconClass:"vertexDeleteIcon",style:"outline: none;"}),
this._deleteHandle=p.connect(a,"onClick",this,this._deleteHandler),this._ctxMenu.addChild(a),this._ctxMenu.startup())},_removeControllers:function(){p.disconnect(this._firstMoveHandle);p.disconnect(this._moveStopHandle);p.disconnect(this._mouseOverHandle);p.disconnect(this._mouseOutHandle);p.disconnect(this._deleteHandle);this._ctxMenu&&(this._ctxDelete=null,this._unbindCtxNode(),this._ctxMenu.destroyRecursive());this._remove(this._vertexMovers);this._remove(this._mpVertexMovers);this._vertexMovers=
this._mpVertexMovers=null},_add:function(a,c,b){var d,f,e=this.graphic,l=[];for(d=0;d<a.length;d++){var t=a[d],k=[];for(f=0;f<t.length;f++)k.push(new g(t[f],c,e,d,f,t.length,this,b));l.push(k)}return l},_remove:function(a){a&&m.forEach(a,function(a){m.forEach(a,function(b){b.destroy()})})},_refresh:function(a){a&&m.forEach(a,function(a){m.forEach(a,function(b){b.refresh()})})},_isNew:function(a){return-1===m.indexOf(this._vertexMovers[a.segIndex],a)?!0:!1},_getGraphicsLayer:function(){return this.toolbar._scratchGL},
_deleteHandler:function(a){a=this._selectedMover;this._updateRelatedGraphic(a,a.relatedGraphic,a.graphic.geometry,a.segIndex,a.ptIndex,a.segLength,!1,!0);this._canAdd&&this._deleteMidpoints(a);this._deleteVertex(a);this.toolbar._endOperation("VERTICES")},_mouseOverHandler:function(a){a=a.graphic;var c=this._findMover(a);c&&(this.toolbar.onVertexMouseOver(this.graphic,c._getInfo()),c._placeholder||(this._selectedMover=c,this._canDel&&this._bindCtxNode(a.getDojoShape().getNode())))},_mouseOutHandler:function(a){if(a=
this._findMover(a.graphic))this.toolbar.onVertexMouseOut(this.graphic,a._getInfo())},_bindCtxNode:function(a){this._unbindCtxNode();this._ctxDelete.set("disabled",this._selectedMover.segLength<=this.minLength?!0:!1);this._ctxMenu.bindDomNode(a);this._bindNode=a},_unbindCtxNode:function(){var a=this._bindNode;a&&this._ctxMenu.unBindDomNode(a)},_findMover:function(a){var c,b=[];c=this._mpVertexMovers;m.forEach(this._vertexMovers,function(a){b=b.concat(a)});c&&m.forEach(c,function(a){b=b.concat(a)});
for(c=0;c<b.length;c++){var d=b[c];if(d.graphic===a)return d}},_firstMoveHandler:function(a){!this._isNew(a)&&this._canAdd&&this._hideRelatedMidpoints(a);this.toolbar._beginOperation("VERTICES")},_moveStopHandler:function(a,c){var b=this._isNew(a);c&&(c.dx||c.dy)?(this._updateRelatedGraphic(a,a.relatedGraphic,a.graphic.geometry,a.segIndex,a.ptIndex,a.segLength,b),this._canAdd&&(b?this._addMidpoints(a):(this._repositionRelatedMidpoints(a),this._showRelatedMidpoints(a))),this.toolbar._endOperation("VERTICES")):
!b&&this._canAdd&&this._showRelatedMidpoints(a)},_showRelatedMidpoints:function(a){var c=this._getAdjacentMidpoints(a.ptIndex,a.segLength),b=this._mpVertexMovers[a.segIndex];for(a=0;a<c.length;a++){var d=b[c[a]];d.graphic.show();d.refresh()}},_hideRelatedMidpoints:function(a){var c=this._getAdjacentMidpoints(a.ptIndex,a.segLength),b=this._mpVertexMovers[a.segIndex];for(a=0;a<c.length;a++)b[c[a]].graphic.hide()},_repositionRelatedMidpoints:function(a){var d,b=this._getAdjacentMidpoints(a.ptIndex,a.segLength),
e=this._mpVertexMovers[a.segIndex];for(d=0;d<b.length;d++){var g=this._getAdjacentVertices(b[d],a.segLength),l=a.relatedGraphic.geometry.getPoint(a.segIndex,g[0]),g=a.relatedGraphic.geometry.getPoint(a.segIndex,g[1]),l=new c({x:(l.x+g.x)/2,y:(l.y+g.y)/2,spatialReference:l.spatialReference.toJson()});e[b[d]].graphic.setGeometry(l)}},_addMidpoints:function(a){var d=a.segIndex,b=a.ptIndex,e=a.segLength,l=b+1,t,k=e+1;this._mpVertexMovers[d].splice(b,1);var h=this._vertexMovers[d];for(t=0;t<l;t++)h[t].segLength+=
1;for(t=l;t<h.length;t++)h[t].ptIndex+=1,h[t].segLength+=1;a.ptIndex=l;a.segLength=h.length+1;h.splice(l,0,a);a.graphic.setSymbol(this._symbol1);h=this._mpVertexMovers[d];for(t=0;t<b;t++)h[t].segLength+=1;for(t=b;t<e-1;t++)h[t].ptIndex+=1,h[t].segLength+=1;l=this._getAdjacentVertices(b,k);d=this._getAdjacentVertices(b+1,k);e=a.relatedGraphic.geometry.getPoint(a.segIndex,l[0]);t=a.relatedGraphic.geometry.getPoint(a.segIndex,l[1]);l=new c({x:(e.x+t.x)/2,y:(e.y+t.y)/2,spatialReference:e.spatialReference.toJson()});
e=a.relatedGraphic.geometry.getPoint(a.segIndex,d[0]);t=a.relatedGraphic.geometry.getPoint(a.segIndex,d[1]);d=new c({x:(e.x+t.x)/2,y:(e.y+t.y)/2,spatialReference:e.spatialReference.toJson()});e=new g(l,this._symbol2,this.graphic,a.segIndex,b,k,this,!0);a=new g(d,this._symbol2,this.graphic,a.segIndex,b+1,k,this,!0);h.splice(b,0,e,a)},_deleteVertex:function(a){var c,b=a.ptIndex,d=this._vertexMovers[a.segIndex];for(c=0;c<b;c++)--d[c].segLength;for(c=b+1;c<d.length;c++){var e=d[c];--e.ptIndex;--e.segLength}d.splice(b,
1);c=a._getInfo();a.destroy();this.toolbar.onVertexDelete(this.graphic,c)}});n.mixin(t,{create:function(a,c,b){switch(a.geometry.type){case "multipoint":return new t.MultipointVertexEditor(a,c,b);case "polyline":return new t.PolylineVertexEditor(a,c,b);case "polygon":return new t.PolygonVertexEditor(a,c,b)}}});t.MultipointVertexEditor=r(t,{declaredClass:"esri.toolbars._MultipointVertexEditor",minLength:1,constructor:function(){this._moveStartHandle=p.connect(g,"onMoveStart",this,this._moveStartHandler);
p.disconnect(this._firstMoveHandle)},destroy:function(){this.inherited(arguments);p.disconnect(this._moveStartHandle)},_getSegments:function(a){var d=a.points,b=[],e=a.spatialReference;for(a=0;a<d.length;a++){var g=d[a];b.push(new c({x:g[0],y:g[1],spatialReference:e.toJson()}))}return[b]},_getMidpointSegments:function(a){return[]},_getControlPoints:function(a,c,b,d,e){return[]},_getGraphicsLayer:function(){return this.graphic._graphicsLayer},_mouseOverHandler:function(a){var c=a.graphic;if(a=this._findMover(a))this.toolbar.onVertexMouseOver(c,
a._getInfo()),this._selectedMover=a,this._canDel&&this._bindCtxNode(a.graphic.getDojoShape().getNode())},_mouseOutHandler:function(a){var c=a.graphic;if(a=this._findMover(a))this.toolbar.onVertexMouseOut(c,a._getInfo())},_findMover:function(a){var c=[].concat(this._vertexMovers[0]),b=a.target;for(a=0;a<c.length;a++){var d=c[a];if(d.graphic.getDojoShape().getNode()===b)return d}},_moveStartHandler:function(a){var c=a.ptIndex,b=a.segLength-1,d=a.relatedGraphic.geometry.points;a=d.splice(c,1);d.push(a[0]);
d=this._vertexMovers[0];for(a=b;a>c;a--)--d[a].ptIndex;a=d.splice(c,1);d.push(a[0]);a[0].ptIndex=b},_moveStopHandler:function(a){this._updateRelatedGraphic(a,a.relatedGraphic,a.graphic.geometry,a.segIndex,a.ptIndex,a.segLength);this.toolbar._endOperation("VERTICES")},_updateRelatedGraphic:function(a,c,b,d,e,g,l,t){a=c.geometry;t?a.removePoint(e):a.setPoint(e,b);c.setGeometry(a)},_deleteMidpoints:function(a){}});t.PolylineVertexEditor=r(t,{declaredClass:"esri.toolbars._PolylineVertexEditor",minLength:2,
_getSegments:function(a){var c,b,d=a.paths,e=[];for(c=0;c<d.length;c++){var g=d[c],l=[];for(b=0;b<g.length;b++)l.push(a.getPoint(c,b));e.push(l)}return e},_getMidpointSegments:function(a){var d,b,e=a.paths,g=[],l=a.spatialReference;for(d=0;d<e.length;d++){var t=e[d],h=[];for(b=0;b<t.length-1;b++){var k=a.getPoint(d,b),m=a.getPoint(d,b+1),k=new c({x:(k.x+m.x)/2,y:(k.y+m.y)/2,spatialReference:l.toJson()});h.push(k)}g.push(h)}return g},_getControlPoints:function(a,c,b,d,e){var f=this.map,g,l;this._isNew(a)?
(a=d,d+=1,0<=a&&(g=f.toScreen(c.getPoint(b,a))),d<=e&&(l=f.toScreen(c.getPoint(b,d)))):(a=d-1,d+=1,0<=a&&(g=f.toScreen(c.getPoint(b,a))),d<e&&(l=f.toScreen(c.getPoint(b,d))));return[g,l]},_getAdjacentMidpoints:function(a,c){var b=[],d=a-1;0<=d&&b.push(d);a<c-1&&b.push(a);return b},_getAdjacentVertices:function(a,c){return[a,a+1]},_deleteMidpoints:function(a){var d=this._mpVertexMovers[a.segIndex],b=d.length-1,e=this._getAdjacentMidpoints(a.ptIndex,a.segLength).sort(),l,t=e[0];for(l=0;l<t;l++)--d[l].segLength;
for(l=t+1;l<d.length;l++){var k=d[l];--k.ptIndex;--k.segLength}if(1===e.length)d.splice(t,1)[0].destroy();else for(k=this._getAdjacentVertices(t,b),l=a.relatedGraphic.geometry.getPoint(a.segIndex,k[0]),k=a.relatedGraphic.geometry.getPoint(a.segIndex,k[1]),l=new c({x:(l.x+k.x)/2,y:(l.y+k.y)/2,spatialReference:l.spatialReference.toJson()}),a=new g(l,this._symbol2,this.graphic,a.segIndex,t,b,this,!0),d=d.splice(t,e.length,a),l=0;l<d.length;l++)d[l].destroy()},_updateRelatedGraphic:function(c,d,b,e,g,
l,t,k){c=d.geometry;t?c.insertPoint(e,g+1,a.fromJson(b.toJson())):k?c.removePoint(e,g):c.setPoint(e,g,a.fromJson(b.toJson()));d.setGeometry(c)}});t.PolygonVertexEditor=r(t,{declaredClass:"esri.toolbars._PolygonVertexEditor",minLength:3,_getSegments:function(a){var c,b,d=a.rings,e=[];for(c=0;c<d.length;c++){var g=d[c],l=[];for(b=0;b<g.length-1;b++)l.push(a.getPoint(c,b));e.push(l)}return e},_getMidpointSegments:function(a){var d,b,e=a.rings,g=[],l=a.spatialReference;for(d=0;d<e.length;d++){var t=e[d],
k=[];for(b=0;b<t.length-1;b++){var h=a.getPoint(d,b),m=a.getPoint(d,b+1),h=new c({x:(h.x+m.x)/2,y:(h.y+m.y)/2,spatialReference:l.toJson()});k.push(h)}g.push(k)}return g},_getControlPoints:function(a,c,b,d,e){var f=this.map;this._isNew(a)?a=d:(a=d-1,a=0>a?(e+a)%e:a);d=(d+1)%e;e=f.toScreen(c.getPoint(b,a));c=f.toScreen(c.getPoint(b,d));return[e,c]},_getAdjacentMidpoints:function(a,c){var b=a-1;return[0>b?(c+b)%c:b,a]},_getAdjacentVertices:function(a,c){return[a,(a+1)%c]},_deleteMidpoints:function(a){var d=
a.ptIndex,b=this._mpVertexMovers[a.segIndex],e=b.length-1,l=this._getAdjacentMidpoints(d,a.segLength).sort(),t,k;k=l[0];var h=l[l.length-1];if(0===d)for(t=this._getAdjacentVertices(e-1,e),d=a.relatedGraphic.geometry.getPoint(a.segIndex,t[0]),t=a.relatedGraphic.geometry.getPoint(a.segIndex,t[1]),d=new c({x:(d.x+t.x)/2,y:(d.y+t.y)/2,spatialReference:d.spatialReference.toJson()}),a=new g(d,this._symbol2,this.graphic,a.segIndex,e-1,e,this,!0),b.splice(h,1,a)[0].destroy(),b.splice(k,1)[0].destroy(),l=
0;l<b.length-1;l++)k=b[l],--k.ptIndex,--k.segLength;else{t=this._getAdjacentVertices(k,e);d=a.relatedGraphic.geometry.getPoint(a.segIndex,t[0]);t=a.relatedGraphic.geometry.getPoint(a.segIndex,t[1]);d=new c({x:(d.x+t.x)/2,y:(d.y+t.y)/2,spatialReference:d.spatialReference.toJson()});a=new g(d,this._symbol2,this.graphic,a.segIndex,k,e,this,!0);h=b.splice(k,l.length,a);for(l=0;l<h.length;l++)h[l].destroy();for(l=0;l<k;l++)--b[l].segLength;for(l=k+1;l<b.length;l++)k=b[l],--k.ptIndex,--k.segLength}},_updateRelatedGraphic:function(c,
d,b,e,g,l,t,k){c=d.geometry;t?c.insertPoint(e,g+1,a.fromJson(b.toJson())):k?(c.removePoint(e,g),0===g&&c.setPoint(e,l-1,a.fromJson(c.getPoint(e,0).toJson()))):(c.setPoint(e,g,a.fromJson(b.toJson())),0===g&&c.setPoint(e,l,a.fromJson(b.toJson())));d.setGeometry(c)}});h("extend-esri")&&(n.setObject("toolbars._GraphicVertexEditor",t,d),n.setObject("toolbars._MultipointVertexEditor",t.MultipointVertexEditor,d),n.setObject("toolbars._PolylineVertexEditor",t.PolylineVertexEditor,d),n.setObject("toolbars._PolygonVertexEditor",
t.PolygonVertexEditor,d));return t})},"dijit/Menu":function(){define("require dojo/_base/array dojo/_base/declare dojo/dom dojo/dom-attr dojo/dom-geometry dojo/dom-style dojo/keys dojo/_base/lang dojo/on dojo/sniff dojo/_base/window dojo/window ./popup ./DropDownMenu dojo/ready".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b){a("dijit-legacy-requires")&&b(0,function(){r(["dijit/MenuItem","dijit/PopupMenuItem","dijit/CheckedMenuItem","dijit/MenuSeparator"])});return p("dijit.Menu",f,{constructor:function(){this._bindings=
[]},targetNodeIds:[],selector:"",contextMenuForWindow:!1,leftClickToOpen:!1,refocus:!0,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(this.ownerDocumentBody):n.forEach(this.targetNodeIds,this.bindDomNode,this);this.inherited(arguments)},_iframeContentWindow:function(b){return t.get(this._iframeContentDocument(b))||this._iframeContentDocument(b).__parent__||b.name&&document.frames[b.name]||null},_iframeContentDocument:function(b){return b.contentDocument||b.contentWindow&&b.contentWindow.document||
b.name&&document.frames[b.name]&&document.frames[b.name].document||null},bindDomNode:function(b){b=m.byId(b,this.ownerDocument);var a;if("iframe"==b.tagName.toLowerCase()){var f=b;a=this._iframeContentWindow(f);a=l.body(a.document)}else a=b==l.body(this.ownerDocument)?this.ownerDocument.documentElement:b;var e={node:b,iframe:f};h.set(b,"_dijitMenu"+this.id,this._bindings.push(e));var q=g.hitch(this,function(b){var a=this.selector,e=a?function(b){return c.selector(a,b)}:function(b){return b},g=this;
return[c(b,e(this.leftClickToOpen?"click":"contextmenu"),function(b){b.stopPropagation();b.preventDefault();(new Date).getTime()<g._lastKeyDown+500||g._scheduleOpen(this,f,{x:b.pageX,y:b.pageY},b.target)}),c(b,e("keydown"),function(b){if(93==b.keyCode||b.shiftKey&&b.keyCode==d.F10||g.leftClickToOpen&&b.keyCode==d.SPACE)b.stopPropagation(),b.preventDefault(),g._scheduleOpen(this,f,null,b.target),g._lastKeyDown=(new Date).getTime()})]});e.connects=a?q(a):[];f&&(e.onloadHandler=g.hitch(this,function(){var b=
this._iframeContentWindow(f),b=l.body(b.document);e.connects=q(b)}),f.addEventListener?f.addEventListener("load",e.onloadHandler,!1):f.attachEvent("onload",e.onloadHandler))},unBindDomNode:function(b){var a;try{a=m.byId(b,this.ownerDocument)}catch(x){return}b="_dijitMenu"+this.id;if(a&&h.has(a,b)){for(var c=h.get(a,b)-1,d=this._bindings[c],f;f=d.connects.pop();)f.remove();(f=d.iframe)&&(f.removeEventListener?f.removeEventListener("load",d.onloadHandler,!1):f.detachEvent("onload",d.onloadHandler));
h.remove(a,b);delete this._bindings[c]}},_scheduleOpen:function(b,a,c,d){this._openTimer||(this._openTimer=this.defer(function(){delete this._openTimer;this._openMyself({target:d,delegatedTarget:b,iframe:a,coords:c})},1))},_openMyself:function(b){function c(){n.refocus&&p&&p.focus();v.close(n)}var d=b.target,f=b.iframe,g=b.coords,l=!g;this.currentTarget=b.delegatedTarget;if(g){if(f){b=e.position(f,!0);var d=this._iframeContentWindow(f),d=e.docScroll(d.document),t=k.getComputedStyle(f),q=k.toPixelValue,
h=(a("ie")&&a("quirks")?0:q(f,t.paddingLeft))+(a("ie")&&a("quirks")?q(f,t.borderLeftWidth):0),f=(a("ie")&&a("quirks")?0:q(f,t.paddingTop))+(a("ie")&&a("quirks")?q(f,t.borderTopWidth):0);g.x+=b.x+h-d.x;g.y+=b.y+f-d.y}}else g=e.position(d,!0),g.x+=10,g.y+=10;var n=this,f=this._focusManager.get("prevNode");b=this._focusManager.get("curNode");var p=!b||m.isDescendant(b,this.domNode)?f:b;v.open({popup:this,x:g.x,y:g.y,onExecute:c,onCancel:c,orient:this.isLeftToRight()?"L":"R"});this.focus();l||this.defer(function(){this._cleanUp(!0)});
this._onBlur=function(){this.inherited("_onBlur",arguments);v.close(this)}},destroy:function(){n.forEach(this._bindings,function(b){b&&this.unBindDomNode(b.node)},this);this.inherited(arguments)}})})},"dijit/popup":function(){define("dojo/_base/array dojo/aspect dojo/_base/declare dojo/dom dojo/dom-attr dojo/dom-construct dojo/dom-geometry dojo/dom-style dojo/has dojo/keys dojo/_base/lang dojo/on ./place ./BackgroundIframe ./Viewport ./main dojo/touch".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l,
t,v,f,b){function q(){this._popupWrapper&&(e.destroy(this._popupWrapper),delete this._popupWrapper)}p=p(null,{_stack:[],_beginZIndex:1E3,_idGen:1,_repositionAll:function(){if(this._firstAroundNode){var b=this._firstAroundPosition,c=k.position(this._firstAroundNode,!0),d=c.x-b.x,b=c.y-b.y;if(d||b)for(this._firstAroundPosition=c,c=0;c<this._stack.length;c++){var f=this._stack[c].wrapper.style;f.top=parseFloat(f.top)+b+"px";"auto"==f.right?f.left=parseFloat(f.left)+d+"px":f.right=parseFloat(f.right)-
d+"px"}this._aroundMoveListener=setTimeout(a.hitch(this,"_repositionAll"),d||b?10:50)}},_createWrapper:function(b){var a=b._popupWrapper,c=b.domNode;a||(a=e.create("div",{"class":"dijitPopup",style:{display:"none"},role:"region","aria-label":b["aria-label"]||b.label||b.name||b.id},b.ownerDocumentBody),a.appendChild(c),c=c.style,c.display="",c.visibility="",c.position="",c.top="0px",b._popupWrapper=a,n.after(b,"destroy",q,!0),"ontouchend"in document&&l(a,"touchend",function(b){/^(input|button|textarea)$/i.test(b.target.tagName)||
b.preventDefault()}),a.dojoClick=!0);return a},moveOffScreen:function(b){var a=this._createWrapper(b);b=k.isBodyLtr(b.ownerDocument);var c={visibility:"hidden",top:"-9999px",display:""};c[b?"left":"right"]="-9999px";c[b?"right":"left"]="auto";d.set(a,c);return a},hide:function(b){var a=this._createWrapper(b);d.set(a,{display:"none",height:"auto",overflowY:"visible",border:""});b=b.domNode;"_originalStyle"in b&&(b.style.cssText=b._originalStyle)},getTopPopup:function(){for(var b=this._stack,a=b.length-
1;0<a&&b[a].parent===b[a-1].widget;a--);return b[a]},open:function(b){for(var e=this._stack,q=b.popup,u=q.domNode,n=b.orient||["below","below-alt","above","above-alt"],p=b.parent?b.parent.isLeftToRight():k.isBodyLtr(q.ownerDocument),r=b.around,E=b.around&&b.around.id?b.around.id+"_dropdown":"popup_"+this._idGen++;e.length&&(!b.parent||!m.isDescendant(b.parent.domNode,e[e.length-1].widget.domNode));)this.close(e[e.length-1].widget);var C=this.moveOffScreen(q);q.startup&&!q._started&&q.startup();var D,
F=k.position(u);if("maxHeight"in b&&-1!=b.maxHeight)D=b.maxHeight||Infinity;else{D=f.getEffectiveBox(this.ownerDocument);var G=r?k.position(r,!1):{y:b.y-(b.padding||0),h:2*(b.padding||0)};D=Math.floor(Math.max(G.y,D.h-(G.y+G.h)))}F.h>D&&(F=d.getComputedStyle(u),d.set(C,{overflowY:"scroll",height:D+"px",border:F.borderLeftWidth+" "+F.borderLeftStyle+" "+F.borderLeftColor}),u._originalStyle=u.style.cssText,u.style.border="none");h.set(C,{id:E,style:{zIndex:this._beginZIndex+e.length},"class":"dijitPopup "+
(q.baseClass||q["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:b.parent?b.parent.id:""});0==e.length&&r&&(this._firstAroundNode=r,this._firstAroundPosition=k.position(r,!0),this._aroundMoveListener=setTimeout(a.hitch(this,"_repositionAll"),50));g("config-bgIframe")&&!q.bgIframe&&(q.bgIframe=new v(C));E=q.orient?a.hitch(q,"orient"):null;n=r?t.around(C,r,n,p,E):t.at(C,b,"R"==n?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],b.padding,E);C.style.visibility="visible";u.style.visibility="visible";u=
[];u.push(l(C,"keydown",a.hitch(this,function(a){if(a.keyCode==c.ESCAPE&&b.onCancel)a.stopPropagation(),a.preventDefault(),b.onCancel();else if(a.keyCode==c.TAB&&(a.stopPropagation(),a.preventDefault(),(a=this.getTopPopup())&&a.onCancel))a.onCancel()})));q.onCancel&&b.onCancel&&u.push(q.on("cancel",b.onCancel));u.push(q.on(q.onExecute?"execute":"change",a.hitch(this,function(){var b=this.getTopPopup();if(b&&b.onExecute)b.onExecute()})));e.push({widget:q,wrapper:C,parent:b.parent,onExecute:b.onExecute,
onCancel:b.onCancel,onClose:b.onClose,handlers:u});if(q.onOpen)q.onOpen(n);return n},close:function(b){for(var a=this._stack;b&&r.some(a,function(a){return a.widget==b})||!b&&a.length;){var c=a.pop(),d=c.widget,f=c.onClose;d.bgIframe&&(d.bgIframe.destroy(),delete d.bgIframe);if(d.onClose)d.onClose();for(var e;e=c.handlers.pop();)e.remove();d&&d.domNode&&this.hide(d);f&&f()}0==a.length&&this._aroundMoveListener&&(clearTimeout(this._aroundMoveListener),this._firstAroundNode=this._firstAroundPosition=
this._aroundMoveListener=null)}});return b.popup=new p})},"dijit/place":function(){define("dojo/_base/array dojo/dom-geometry dojo/dom-style dojo/_base/kernel dojo/_base/window ./Viewport ./main".split(" "),function(r,n,p,m,h,e,k){function d(c,a,d,g){var l=e.getEffectiveBox(c.ownerDocument);c.parentNode&&"body"==String(c.parentNode.tagName).toLowerCase()||h.body(c.ownerDocument).appendChild(c);var f=null;r.some(a,function(b){var a=b.corner,e=b.pos,q=0,t={w:{L:l.l+l.w-e.x,R:e.x-l.l,M:l.w}[a.charAt(1)],
h:{T:l.t+l.h-e.y,B:e.y-l.t,M:l.h}[a.charAt(0)]},k=c.style;k.left=k.right="auto";d&&(q=d(c,b.aroundCorner,a,t,g),q="undefined"==typeof q?0:q);var h=c.style,u=h.display,m=h.visibility;"none"==h.display&&(h.visibility="hidden",h.display="");k=n.position(c);h.display=u;h.visibility=m;u={L:e.x,R:e.x-k.w,M:Math.max(l.l,Math.min(l.l+l.w,e.x+(k.w>>1))-k.w)}[a.charAt(1)];m={T:e.y,B:e.y-k.h,M:Math.max(l.t,Math.min(l.t+l.h,e.y+(k.h>>1))-k.h)}[a.charAt(0)];e=Math.max(l.l,u);h=Math.max(l.t,m);u=Math.min(l.l+l.w,
u+k.w)-e;m=Math.min(l.t+l.h,m+k.h)-h;q+=k.w-u+(k.h-m);if(null==f||q<f.overflow)f={corner:a,aroundCorner:b.aroundCorner,x:e,y:h,w:u,h:m,overflow:q,spaceAvailable:t};return!q});f.overflow&&d&&d(c,f.aroundCorner,f.corner,f.spaceAvailable,g);a=f.y;var b=f.x,q=h.body(c.ownerDocument);/relative|absolute/.test(p.get(q,"position"))&&(a-=p.get(q,"marginTop"),b-=p.get(q,"marginLeft"));q=c.style;q.top=a+"px";q.left=b+"px";q.right="auto";return f}var g={TL:"BR",TR:"BL",BL:"TR",BR:"TL"};return k.place={at:function(c,
a,e,t,k){e=r.map(e,function(c){var b={corner:c,aroundCorner:g[c],pos:{x:a.x,y:a.y}};t&&(b.pos.x+="L"==c.charAt(1)?t.x:-t.x,b.pos.y+="T"==c.charAt(0)?t.y:-t.y);return b});return d(c,e,k)},around:function(c,a,e,g,k){function f(b,a){C.push({aroundCorner:b,corner:a,pos:{x:{L:x,R:x+z,M:x+(z>>1)}[b.charAt(1)],y:{T:w,B:w+E,M:w+(E>>1)}[b.charAt(0)]}})}var b;if("string"==typeof a||"offsetWidth"in a||"ownerSVGElement"in a){if(b=n.position(a,!0),/^(above|below)/.test(e[0])){var l=n.getBorderExtents(a),t=a.firstChild?
n.getBorderExtents(a.firstChild):{t:0,l:0,b:0,r:0},h=n.getBorderExtents(c),v=c.firstChild?n.getBorderExtents(c.firstChild):{t:0,l:0,b:0,r:0};b.y+=Math.min(l.t+t.t,h.t+v.t);b.h-=Math.min(l.t+t.t,h.t+v.t)+Math.min(l.b+t.b,h.b+v.b)}}else b=a;if(a.parentNode)for(l="absolute"==p.getComputedStyle(a).position,a=a.parentNode;a&&1==a.nodeType&&"BODY"!=a.nodeName;){t=n.position(a,!0);h=p.getComputedStyle(a);/relative|absolute/.test(h.position)&&(l=!1);if(!l&&/hidden|auto|scroll/.test(h.overflow)){var v=Math.min(b.y+
b.h,t.y+t.h),B=Math.min(b.x+b.w,t.x+t.w);b.x=Math.max(b.x,t.x);b.y=Math.max(b.y,t.y);b.h=v-b.y;b.w=B-b.x}"absolute"==h.position&&(l=!0);a=a.parentNode}var x=b.x,w=b.y,z="w"in b?b.w:b.w=b.width,E="h"in b?b.h:(m.deprecated("place.around: dijit/place.__Rectangle: { x:"+x+", y:"+w+", height:"+b.height+", width:"+z+" } has been deprecated.  Please use { x:"+x+", y:"+w+", h:"+b.height+", w:"+z+" }","","2.0"),b.h=b.height),C=[];r.forEach(e,function(b){var a=g;switch(b){case "above-centered":f("TM","BM");
break;case "below-centered":f("BM","TM");break;case "after-centered":a=!a;case "before-centered":f(a?"ML":"MR",a?"MR":"ML");break;case "after":a=!a;case "before":f(a?"TL":"TR",a?"TR":"TL");f(a?"BL":"BR",a?"BR":"BL");break;case "below-alt":a=!a;case "below":f(a?"BL":"BR",a?"TL":"TR");f(a?"BR":"BL",a?"TR":"TL");break;case "above-alt":a=!a;case "above":f(a?"TL":"TR",a?"BL":"BR");f(a?"TR":"TL",a?"BR":"BL");break;default:f(b.aroundCorner,b.corner)}});c=d(c,C,k,{w:z,h:E});c.aroundNodePos=b;return c}}})},
"dijit/Viewport":function(){define(["dojo/Evented","dojo/on","dojo/domReady","dojo/sniff","dojo/window"],function(r,n,p,m,h){var e=new r,k;p(function(){var d=h.getBox();e._rlh=n(window,"resize",function(){var c=h.getBox();if(d.h!=c.h||d.w!=c.w)d=c,e.emit("resize")});if(8==m("ie")){var g=screen.deviceXDPI;setInterval(function(){screen.deviceXDPI!=g&&(g=screen.deviceXDPI,e.emit("resize"))},500)}m("ios")&&(n(document,"focusin",function(c){k=c.target}),n(document,"focusout",function(c){k=null}))});e.getEffectiveBox=
function(d){d=h.getBox(d);var e=k&&k.tagName&&k.tagName.toLowerCase();m("ios")&&k&&!k.readOnly&&("textarea"==e||"input"==e&&/^(color|email|number|password|search|tel|text|url)$/.test(k.type))&&(d.h*=0==orientation||180==orientation?.66:.4,e=k.getBoundingClientRect(),d.h=Math.max(d.h,e.top+e.height));return d};return e})},"dijit/BackgroundIframe":function(){define("require ./main dojo/_base/config dojo/dom-construct dojo/dom-style dojo/_base/lang dojo/on dojo/sniff".split(" "),function(r,n,p,m,h,e,
k,d){d.add("config-bgIframe",(d("ie")||d("trident"))&&!/IEMobile\/10\.0/.test(navigator.userAgent));var g=new function(){var c=[];this.pop=function(){var a;c.length?(a=c.pop(),a.style.display=""):(9>d("ie")?(a=p.dojoBlankHtmlUrl||r.toUrl("dojo/resources/blank.html")||'javascript:""',a=document.createElement("\x3ciframe src\x3d'"+a+"' role\x3d'presentation' style\x3d'position: absolute; left: 0px; top: 0px;z-index: -1; filter:Alpha(Opacity\x3d\"0\");'\x3e")):(a=m.create("iframe"),a.src='javascript:""',
a.className="dijitBackgroundIframe",a.setAttribute("role","presentation"),h.set(a,"opacity",.1)),a.tabIndex=-1);return a};this.push=function(a){a.style.display="none";c.push(a)}};n.BackgroundIframe=function(c){if(!c.id)throw Error("no id");if(d("config-bgIframe")){var a=this.iframe=g.pop();c.appendChild(a);7>d("ie")||d("quirks")?(this.resize(c),this._conn=k(c,"resize",e.hitch(this,"resize",c))):h.set(a,{width:"100%",height:"100%"})}};e.extend(n.BackgroundIframe,{resize:function(c){this.iframe&&h.set(this.iframe,
{width:c.offsetWidth+"px",height:c.offsetHeight+"px"})},destroy:function(){this._conn&&(this._conn.remove(),this._conn=null);this.iframe&&(this.iframe.parentNode.removeChild(this.iframe),g.push(this.iframe),delete this.iframe)}});return n.BackgroundIframe})},"dijit/DropDownMenu":function(){define(["dojo/_base/declare","dojo/keys","dojo/text!./templates/Menu.html","./_MenuBase"],function(r,n,p,m){return r("dijit.DropDownMenu",m,{templateString:p,baseClass:"dijitMenu",_onUpArrow:function(){this.focusPrev()},
_onDownArrow:function(){this.focusNext()},_onRightArrow:function(h){this._moveToPopup(h);h.stopPropagation();h.preventDefault()},_onLeftArrow:function(h){if(this.parentMenu)if(this.parentMenu._isMenuBar)this.parentMenu.focusPrev();else this.onCancel(!1);else h.stopPropagation(),h.preventDefault()}})})},"dijit/_MenuBase":function(){define("dojo/_base/array dojo/_base/declare dojo/dom dojo/dom-attr dojo/dom-class dojo/_base/lang dojo/mouse dojo/on dojo/window ./a11yclick ./registry ./_Widget ./_CssStateMixin ./_KeyNavContainer ./_TemplatedMixin".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f){return n("dijit._MenuBase",[l,f,v,t],{selected:null,_setSelectedAttr:function(b){this.selected!=b&&(this.selected&&(this.selected._setSelected(!1),this._onChildDeselect(this.selected)),b&&b._setSelected(!0),this._set("selected",b))},activated:!1,_setActivatedAttr:function(b){h.toggle(this.domNode,"dijitMenuActive",b);h.toggle(this.domNode,"dijitMenuPassive",!b);this._set("activated",b)},parentMenu:null,popupDelay:500,passivePopupDelay:Infinity,autoFocus:!1,
childSelector:function(b){var c=a.byNode(b);return b.parentNode==this.containerNode&&c&&c.focus},postCreate:function(){var b=this,f="string"==typeof this.childSelector?this.childSelector:e.hitch(this,"childSelector");this.own(d(this.containerNode,d.selector(f,k.enter),function(){b.onItemHover(a.byNode(this))}),d(this.containerNode,d.selector(f,k.leave),function(){b.onItemUnhover(a.byNode(this))}),d(this.containerNode,d.selector(f,c),function(c){b.onItemClick(a.byNode(this),c);c.stopPropagation()}),
d(this.containerNode,d.selector(f,"focusin"),function(){b._onItemFocus(a.byNode(this))}));this.inherited(arguments)},onKeyboardSearch:function(b,a,c,d){this.inherited(arguments);if(b&&(-1==d||b.popup&&1==d))this.onItemClick(b,a)},_keyboardSearchCompare:function(b,a){return b.shortcutKey?a==b.shortcutKey.toLowerCase()?-1:0:this.inherited(arguments)?1:0},onExecute:function(){},onCancel:function(){},_moveToPopup:function(b){if(this.focusedChild&&this.focusedChild.popup&&!this.focusedChild.disabled)this.onItemClick(this.focusedChild,
b);else(b=this._getTopMenu())&&b._isMenuBar&&b.focusNext()},_onPopupHover:function(){this.set("selected",this.currentPopupItem);this._stopPendingCloseTimer()},onItemHover:function(b){this.activated?(this.set("selected",b),!b.popup||b.disabled||this.hover_timer||(this.hover_timer=this.defer(function(){this._openItemPopup(b)},this.popupDelay))):Infinity>this.passivePopupDelay&&(this.passive_hover_timer&&this.passive_hover_timer.remove(),this.passive_hover_timer=this.defer(function(){this.onItemClick(b,
{type:"click"})},this.passivePopupDelay));this._hoveredChild=b;b._set("hovering",!0)},_onChildDeselect:function(b){this._stopPopupTimer();this.currentPopupItem==b&&(this._stopPendingCloseTimer(),this._pendingClose_timer=this.defer(function(){this.currentPopupItem=this._pendingClose_timer=null;b._closePopup()},this.popupDelay))},onItemUnhover:function(b){this._hoveredChild==b&&(this._hoveredChild=null);this.passive_hover_timer&&(this.passive_hover_timer.remove(),this.passive_hover_timer=null);b._set("hovering",
!1)},_stopPopupTimer:function(){this.hover_timer&&(this.hover_timer=this.hover_timer.remove())},_stopPendingCloseTimer:function(){this._pendingClose_timer&&(this._pendingClose_timer=this._pendingClose_timer.remove())},_getTopMenu:function(){for(var b=this;b.parentMenu;b=b.parentMenu);return b},onItemClick:function(b,a){this.passive_hover_timer&&this.passive_hover_timer.remove();this.focusChild(b);if(b.disabled)return!1;if(b.popup){this.set("selected",b);this.set("activated",!0);var c=/^key/.test(a._origType||
a.type)||0==a.clientX&&0==a.clientY;this._openItemPopup(b,c)}else this.onExecute(),b._onClick?b._onClick(a):b.onClick(a)},_openItemPopup:function(b,a){if(b!=this.currentPopupItem){this.currentPopupItem&&(this._stopPendingCloseTimer(),this.currentPopupItem._closePopup());this._stopPopupTimer();var c=b.popup;c.parentMenu=this;this.own(this._mouseoverHandle=d.once(c.domNode,"mouseover",e.hitch(this,"_onPopupHover")));var f=this;b._openPopup({parent:this,orient:this._orient||["after","before"],onCancel:function(){a&&
f.focusChild(b);f._cleanUp()},onExecute:e.hitch(this,"_cleanUp",!0),onClose:function(){f._mouseoverHandle&&(f._mouseoverHandle.remove(),delete f._mouseoverHandle)}},a);this.currentPopupItem=b}},onOpen:function(){this.isShowingNow=!0;this.set("activated",!0)},onClose:function(){this.set("activated",!1);this.set("selected",null);this.isShowingNow=!1;this.parentMenu=null},_closeChild:function(){this._stopPopupTimer();this.currentPopupItem&&(this.focused&&(m.set(this.selected.focusNode,"tabIndex",this.tabIndex),
this.selected.focusNode.focus()),this.currentPopupItem._closePopup(),this.currentPopupItem=null)},_onItemFocus:function(b){if(this._hoveredChild&&this._hoveredChild!=b)this.onItemUnhover(this._hoveredChild);this.set("selected",b)},_onBlur:function(){this._cleanUp(!0);this.inherited(arguments)},_cleanUp:function(b){this._closeChild();"undefined"==typeof this.isShowingNow&&this.set("activated",!1);b&&this.set("selected",null)}})})},"dijit/_CssStateMixin":function(){define("dojo/_base/array dojo/_base/declare dojo/dom dojo/dom-class dojo/has dojo/_base/lang dojo/on dojo/domReady dojo/touch dojo/_base/window ./a11yclick ./registry".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l){n=n("dijit._CssStateMixin",[],{hovering:!1,active:!1,_applyAttributes:function(){this.inherited(arguments);r.forEach("disabled readOnly checked selected focused state hovering active _opened".split(" "),function(a){this.watch(a,e.hitch(this,"_setStateClass"))},this);for(var a in this.cssStateNodes||{})this._trackMouseState(this[a],this.cssStateNodes[a]);this._trackMouseState(this.domNode,this.baseClass);this._setStateClass()},_cssMouseEvent:function(a){if(!this.disabled)switch(a.type){case "mouseover":case "MSPointerOver":case "pointerover":this._set("hovering",
!0);this._set("active",this._mouseDown);break;case "mouseout":case "MSPointerOut":case "pointerout":this._set("hovering",!1);this._set("active",!1);break;case "mousedown":case "touchstart":case "MSPointerDown":case "pointerdown":case "keydown":this._set("active",!0);break;case "mouseup":case "dojotouchend":case "MSPointerUp":case "pointerup":case "keyup":this._set("active",!1)}},_setStateClass:function(){function a(b){c=c.concat(r.map(c,function(a){return a+b}),"dijit"+b)}var c=this.baseClass.split(" ");
this.isLeftToRight()||a("Rtl");var d="mixed"==this.checked?"Mixed":this.checked?"Checked":"";this.checked&&a(d);this.state&&a(this.state);this.selected&&a("Selected");this._opened&&a("Opened");this.disabled?a("Disabled"):this.readOnly?a("ReadOnly"):this.active?a("Active"):this.hovering&&a("Hover");this.focused&&a("Focused");var d=this.stateNode||this.domNode,b={};r.forEach(d.className.split(" "),function(a){b[a]=!0});"_stateClasses"in this&&r.forEach(this._stateClasses,function(a){delete b[a]});r.forEach(c,
function(a){b[a]=!0});var e=[],g;for(g in b)e.push(g);d.className=e.join(" ");this._stateClasses=c},_subnodeCssMouseEvent:function(a,c,d){function b(b){m.toggle(a,c+"Active",b)}if(!this.disabled&&!this.readOnly)switch(d.type){case "mouseover":case "MSPointerOver":case "pointerover":m.toggle(a,c+"Hover",!0);break;case "mouseout":case "MSPointerOut":case "pointerout":m.toggle(a,c+"Hover",!1);b(!1);break;case "mousedown":case "touchstart":case "MSPointerDown":case "pointerdown":case "keydown":b(!0);
break;case "mouseup":case "MSPointerUp":case "pointerup":case "dojotouchend":case "keyup":b(!1);break;case "focus":case "focusin":m.toggle(a,c+"Focused",!0);break;case "blur":case "focusout":m.toggle(a,c+"Focused",!1)}},_trackMouseState:function(a,c){a._cssState=c}});d(function(){function d(b,a,c){if(!c||!p.isDescendant(c,a))for(;a&&a!=c;a=a.parentNode)if(a._cssState){var d=l.getEnclosingWidget(a);d&&(a==d.domNode?d._cssMouseEvent(b):d._subnodeCssMouseEvent(a,a._cssState,b))}}var e=c.body(),f;k(e,
g.over,function(b){d(b,b.target,b.relatedTarget)});k(e,g.out,function(b){d(b,b.target,b.relatedTarget)});k(e,a.press,function(b){f=b.target;d(b,f)});k(e,a.release,function(b){d(b,f);f=null});k(e,"focusin, focusout",function(b){var a=b.target;if(a._cssState&&!a.getAttribute("widgetId")){var c=l.getEnclosingWidget(a);c&&c._subnodeCssMouseEvent(a,a._cssState,b)}})});return n})},"dijit/_KeyNavContainer":function(){define("dojo/_base/array dojo/_base/declare dojo/dom-attr dojo/_base/kernel dojo/keys dojo/_base/lang ./registry ./_Container ./_FocusMixin ./_KeyNavMixin".split(" "),
function(r,n,p,m,h,e,k,d,g,c){return n("dijit._KeyNavContainer",[g,c,d],{connectKeyNavHandlers:function(a,c){var d=this._keyNavCodes={},g=e.hitch(this,"focusPrev"),f=e.hitch(this,"focusNext");r.forEach(a,function(b){d[b]=g});r.forEach(c,function(b){d[b]=f});d[h.HOME]=e.hitch(this,"focusFirstChild");d[h.END]=e.hitch(this,"focusLastChild")},startupKeyNavChildren:function(){m.deprecated("startupKeyNavChildren() call no longer needed","","2.0")},startup:function(){this.inherited(arguments);r.forEach(this.getChildren(),
e.hitch(this,"_startupChild"))},addChild:function(a,c){this.inherited(arguments);this._startupChild(a)},_startupChild:function(a){a.set("tabIndex","-1")},_getFirst:function(){var a=this.getChildren();return a.length?a[0]:null},_getLast:function(){var a=this.getChildren();return a.length?a[a.length-1]:null},focusNext:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,1))},focusPrev:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,-1),!0)},childSelector:function(a){return(a=
k.byNode(a))&&a.getParent()==this}})})},"dijit/_Container":function(){define(["dojo/_base/array","dojo/_base/declare","dojo/dom-construct","dojo/_base/kernel"],function(r,n,p,m){return n("dijit._Container",null,{buildRendering:function(){this.inherited(arguments);this.containerNode||(this.containerNode=this.domNode)},addChild:function(h,e){var k=this.containerNode;if(0<e){for(k=k.firstChild;0<e;)1==k.nodeType&&e--,k=k.nextSibling;k?e="before":(k=this.containerNode,e="last")}p.place(h.domNode,k,e);
this._started&&!h._started&&h.startup()},removeChild:function(h){"number"==typeof h&&(h=this.getChildren()[h]);h&&(h=h.domNode)&&h.parentNode&&h.parentNode.removeChild(h)},hasChildren:function(){return 0<this.getChildren().length},_getSiblingOfChild:function(h,e){var k=this.getChildren(),d=r.indexOf(k,h);return k[d+e]},getIndexOfChild:function(h){return r.indexOf(this.getChildren(),h)}})})},"dijit/_KeyNavMixin":function(){define("dojo/_base/array dojo/_base/declare dojo/dom-attr dojo/keys dojo/_base/lang dojo/on dijit/registry dijit/_FocusMixin".split(" "),
function(r,n,p,m,h,e,k,d){return n("dijit._KeyNavMixin",d,{tabIndex:"0",childSelector:null,postCreate:function(){this.inherited(arguments);p.set(this.domNode,"tabIndex",this.tabIndex);if(!this._keyNavCodes){var d=this._keyNavCodes={};d[m.HOME]=h.hitch(this,"focusFirstChild");d[m.END]=h.hitch(this,"focusLastChild");d[this.isLeftToRight()?m.LEFT_ARROW:m.RIGHT_ARROW]=h.hitch(this,"_onLeftArrow");d[this.isLeftToRight()?m.RIGHT_ARROW:m.LEFT_ARROW]=h.hitch(this,"_onRightArrow");d[m.UP_ARROW]=h.hitch(this,
"_onUpArrow");d[m.DOWN_ARROW]=h.hitch(this,"_onDownArrow")}var c=this,d="string"==typeof this.childSelector?this.childSelector:h.hitch(this,"childSelector");this.own(e(this.domNode,"keypress",h.hitch(this,"_onContainerKeypress")),e(this.domNode,"keydown",h.hitch(this,"_onContainerKeydown")),e(this.domNode,"focus",h.hitch(this,"_onContainerFocus")),e(this.containerNode,e.selector(d,"focusin"),function(a){c._onChildFocus(k.getEnclosingWidget(this),a)}))},_onLeftArrow:function(){},_onRightArrow:function(){},
_onUpArrow:function(){},_onDownArrow:function(){},focus:function(){this.focusFirstChild()},_getFirstFocusableChild:function(){return this._getNextFocusableChild(null,1)},_getLastFocusableChild:function(){return this._getNextFocusableChild(null,-1)},focusFirstChild:function(){this.focusChild(this._getFirstFocusableChild())},focusLastChild:function(){this.focusChild(this._getLastFocusableChild())},focusChild:function(d,c){d&&(this.focusedChild&&d!==this.focusedChild&&this._onChildBlur(this.focusedChild),
d.set("tabIndex",this.tabIndex),d.focus(c?"end":"start"))},_onContainerFocus:function(d){d.target!==this.domNode||this.focusedChild||this.focus()},_onFocus:function(){p.set(this.domNode,"tabIndex","-1");this.inherited(arguments)},_onBlur:function(d){p.set(this.domNode,"tabIndex",this.tabIndex);this.focusedChild&&(this.focusedChild.set("tabIndex","-1"),this.lastFocusedChild=this.focusedChild,this._set("focusedChild",null));this.inherited(arguments)},_onChildFocus:function(d){d&&d!=this.focusedChild&&
(this.focusedChild&&!this.focusedChild._destroyed&&this.focusedChild.set("tabIndex","-1"),d.set("tabIndex",this.tabIndex),this.lastFocused=d,this._set("focusedChild",d))},_searchString:"",multiCharSearchDuration:1E3,onKeyboardSearch:function(d,c,a,e){d&&this.focusChild(d)},_keyboardSearchCompare:function(d,c){var a=d.domNode,a=(d.label||(a.focusNode?a.focusNode.label:"")||a.innerText||a.textContent||"").replace(/^\s+/,"").substr(0,c.length).toLowerCase();return c.length&&a==c?-1:0},_isFormElement:function(d){return"INPUT"===
d.tagName||"TEXTAREA"===d.tagName||"SELECT"===d.tagName||"BUTTON"===d.tagName},_onContainerKeydown:function(d){if(!this._isFormElement(document.activeElement)){var c=this._keyNavCodes[d.keyCode];c?(c(d,this.focusedChild),d.stopPropagation(),d.preventDefault(),this._searchString=""):d.keyCode!=m.SPACE||!this._searchTimer||d.ctrlKey||d.altKey||d.metaKey||(d.stopImmediatePropagation(),d.preventDefault(),this._keyboardSearch(d," "))}},_onContainerKeypress:function(d){this._isFormElement(document.activeElement)||
d.charCode<=m.SPACE||d.ctrlKey||d.altKey||d.metaKey||(d.preventDefault(),d.stopPropagation(),this._keyboardSearch(d,String.fromCharCode(d.charCode).toLowerCase()))},_keyboardSearch:function(d,c){var a=null,e,g=0;h.hitch(this,function(){this._searchTimer&&this._searchTimer.remove();this._searchString+=c;var d=/^(.)\1*$/.test(this._searchString)?1:this._searchString.length;e=this._searchString.substr(0,d);this._searchTimer=this.defer(function(){this._searchTimer=null;this._searchString=""},this.multiCharSearchDuration);
var f=this.focusedChild||null;if(1==d||!f)if(f=this._getNextFocusableChild(f,1),!f)return;d=f;do{var b=this._keyboardSearchCompare(f,e);b&&0==g++&&(a=f);if(-1==b){g=-1;break}f=this._getNextFocusableChild(f,1)}while(f&&f!=d)})();this.onKeyboardSearch(a,d,e,g)},_onChildBlur:function(){},_getNextFocusableChild:function(d,c){var a=d;do{if(d)d=this._getNext(d,c);else if(d=this[0<c?"_getFirst":"_getLast"](),!d)break;if(null!=d&&d!=a&&d.isFocusable())return d}while(d!=a);return null},_getFirst:function(){return null},
_getLast:function(){return null},_getNext:function(d,c){if(d)for(d=d.domNode;d;)if((d=d[0>c?"previousSibling":"nextSibling"])&&"getAttribute"in d){var a=k.byNode(d);if(a)return a}return null}})})},"dijit/MenuItem":function(){define("dojo/_base/declare dojo/dom dojo/dom-attr dojo/dom-class dojo/_base/kernel dojo/sniff dojo/_base/lang ./_Widget ./_TemplatedMixin ./_Contained ./_CssStateMixin dojo/text!./templates/MenuItem.html".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l){k=r("dijit.MenuItem"+(e("dojo-bidi")?
"_NoBidi":""),[d,g,c,a],{templateString:l,baseClass:"dijitMenuItem",label:"",_setLabelAttr:function(a){this._set("label",a);var c="",d;d=a.search(/{\S}/);if(0<=d){var c=a.charAt(d+1),b=a.substr(0,d);a=a.substr(d+3);d=b+c+a;a=b+'\x3cspan class\x3d"dijitMenuItemShortcutKey"\x3e'+c+"\x3c/span\x3e"+a}else d=a;this.domNode.setAttribute("aria-label",d+" "+this.accelKey);this.containerNode.innerHTML=a;this._set("shortcutKey",c)},iconClass:"dijitNoIcon",_setIconClassAttr:{node:"iconNode",type:"class"},accelKey:"",
disabled:!1,_fillContent:function(a){!a||"label"in this.params||this._set("label",a.innerHTML)},buildRendering:function(){this.inherited(arguments);p.set(this.containerNode,"id",this.id+"_text");this.accelKeyNode&&p.set(this.accelKeyNode,"id",this.id+"_accel");n.setSelectable(this.domNode,!1)},onClick:function(){},focus:function(){try{8==e("ie")&&this.containerNode.focus(),this.focusNode.focus()}catch(t){}},_setSelected:function(a){m.toggle(this.domNode,"dijitMenuItemSelected",a)},setLabel:function(a){h.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.",
"","2.0");this.set("label",a)},setDisabled:function(a){h.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",a)},_setDisabledAttr:function(a){this.focusNode.setAttribute("aria-disabled",a?"true":"false");this._set("disabled",a)},_setAccelKeyAttr:function(a){this.accelKeyNode&&(this.accelKeyNode.style.display=a?"":"none",this.accelKeyNode.innerHTML=a,p.set(this.containerNode,"colSpan",a?"1":"2"));this._set("accelKey",a)}});e("dojo-bidi")&&
(k=r("dijit.MenuItem",k,{_setLabelAttr:function(a){this.inherited(arguments);"auto"===this.textDir&&this.applyTextDir(this.textDirNode)}}));return k})},"dijit/_Contained":function(){define(["dojo/_base/declare","./registry"],function(r,n){return r("dijit._Contained",null,{_getSibling:function(n){var m=this.getParent();return m&&m._getSiblingOfChild&&m._getSiblingOfChild(this,"previous"==n?-1:1)||null},getPreviousSibling:function(){return this._getSibling("previous")},getNextSibling:function(){return this._getSibling("next")},
getIndexInParent:function(){var n=this.getParent();return n&&n.getIndexOfChild?n.getIndexOfChild(this):-1}})})},"esri/toolbars/_VertexMover":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/sniff dojo/dom-style dojox/gfx/Moveable ../kernel ../PointerEvents ../sniff ../geometry/Point ../graphic ../geometry/webMercatorUtils".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l){r=r(null,{declaredClass:"esri.toolbars.VertexMover",constructor:function(a,c,d,b,e,g,l,k){this.point=a;
this.symbol=c;this.relatedGraphic=d;this.segIndex=b;this.ptIndex=e;this.segLength=g;this.editor=l;this.map=l.map;this._scratchGL=l.toolbar._scratchGL;this._placeholder=k||!1;this._type=d.geometry.type;this._init();this._enable()},refresh:function(a){if(a||this._needRefresh())this._disable(),this._enable()},destroy:function(){this._disable();this.graphic&&this._scratchGL.remove(this.graphic);this.point=this.symbol=this.graphic=this.relatedGraphic=this.segIndex=this.ptIndex=this.segLength=this.editor=
this.map=this._scratchGL=null},_init:function(){var d=new c(this.point.toJson()),d=new a(d,this.symbol);switch(this._type){case "multipoint":d._shape=this.relatedGraphic.getDojoShape().children[this.ptIndex];break;case "polyline":case "polygon":this._scratchGL.add(d)}this.graphic=d},_enable:function(){var a=this.graphic.getDojoShape();a&&(a._hasMover=!0,this._moveable=this._getMoveable(a),(a=a.getEventSource())&&h.set(a,"cursor",this.editor.toolbar._cursors[this._placeholder?"move-gv":"move-v"]))},
_disable:function(){var a=this._moveable;if(a){p.disconnect(this._startHandle);p.disconnect(this._firstHandle);p.disconnect(this._movingHandle);p.disconnect(this._stopHandle);var c=a.shape;c&&(c=c.getEventSource())&&h.set(c,"cursor","inherit");a.destroy();this._moveable=null}},_needRefresh:function(){var a=this.graphic.getDojoShape(),c=!1;if(a)switch(this._type){case "multipoint":var d=this.relatedGraphic.getDojoShape();d&&(d=d.children[this.ptIndex],a!==d&&(this.graphic._shape=d,c=!0));break;case "polyline":case "polygon":c=
!a._hasMover}return c},_getMoveable:function(a){a=new e(a,m("mac")&&m("ff")&&!g("esri-touch")&&{leftButtonOnly:!0});this._startHandle=p.connect(a,"onMoveStart",this,this._moveStartHandler);this._firstHandle=p.connect(a,"onFirstMove",this,this._firstMoveHandler);this._movingHandle=p.connect(a,"onMoving",this,this._movingHandler);this._stopHandle=p.connect(a,"onMoveStop",this,this._moveStopHandler);return a},_getPtIndex:function(){return this.ptIndex+(this._placeholder?1:0)},_getInfo:function(){return{graphic:this.graphic,
isGhost:this._placeholder,segmentIndex:this.segIndex,pointIndex:this._getPtIndex()}},_moveStartHandler:function(a){var c=this.map;c.snappingManager&&c.snappingManager._setUpSnapping();this.editor.toolbar._deactivateScrollWheel();a.shape.moveToFront();this.constructor.onMoveStart(this);this.editor.toolbar.onVertexMoveStart(this.relatedGraphic,this._getInfo())},_firstMoveHandler:function(a){var c=a.shape,d=this._getControlEdges(),b=this._scratchGL._div,e,g=[],l=a.host.shape._wrapOffsets[0]||0;for(e=
0;e<d.length;e++){var k=d[e];k.x1+=l;k.x2+=l;g.push([b.createLine({x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2}).setStroke(this.editor._lineStroke),k.x1,k.y1,k.x2,k.y2])}c._lines=g;a.shape.moveToFront();this.constructor.onFirstMove(this);this.editor.toolbar.onVertexFirstMove(this.relatedGraphic,this._getInfo())},_movingHandler:function(a,c,f){c=this.map;var b;g("esri-pointer")?b=c.navigationManager.pointerEvents._processTouchEvent(f,f):f&&"pointermove"===f.type&&(b=d.prototype._processTouchEvent.call({map:c},
f,f));b&&c.snappingManager&&c.snappingManager._onSnappingMouseMoveHandler(b);f=a.shape;a=f.getTransform();f=f._lines;for(b=0;b<f.length;b++)c=f[b],c[0].setShape({x1:c[1]+a.dx,y1:c[2]+a.dy,x2:c[3],y2:c[4]});this.editor.toolbar.onVertexMove(this.relatedGraphic,this._getInfo(),a)},_moveStopHandler:function(a){a=a.shape;var c=this.editor.toolbar,d=a.getTransform(),b=this.map,e=this.graphic,g=c._geo?l.geographicToWebMercator(e.geometry):e.geometry;c._activateScrollWheel();var k,h=a._lines;if(h){for(k=
0;k<h.length;k++)h[k][0].removeShape();a._lines=null}k=!1;var h=!0,t=this._getInfo();d&&(d.dx||d.dy)?this._placeholder&&(this._placeholder=!1,k=!0):h=!1;var m;b.snappingManager&&(m=b.snappingManager._snappingPoint);m=m||b.toMap(b.toScreen(g).offset(d.dx,d.dy));b.snappingManager&&b.snappingManager._killOffSnapping();a.setTransform(null);e.setGeometry(c._geo?l.webMercatorToGeographic(m,!0):m);this.constructor.onMoveStop(this,d);c.onVertexMoveStop(this.relatedGraphic,t,d);if(!h)c.onVertexClick(this.relatedGraphic,
t);if(k)c.onVertexAdd(this.relatedGraphic,this._getInfo())},_getControlEdges:function(){var a=this.map,c=this.relatedGraphic.geometry,d=this.segIndex,b=this.ptIndex,e=this.segLength,g=this._scratchGL._getTransform(),l=g.dx,g=g.dy,k=a.toScreen(this.graphic.geometry),a=k.x-l,k=k.y-g,h=[],c=this.editor._getControlPoints(this,c,d,b,e);c[0]&&h.push({x1:a,y1:k,x2:c[0].x-l,y2:c[0].y-g});c[1]&&h.push({x1:a,y1:k,x2:c[1].x-l,y2:c[1].y-g});return h}});g("extend-esri")&&n.setObject("toolbars.VertexMover",r,k);
n.mixin(r,{onMoveStart:function(){},onFirstMove:function(){},onMoveStop:function(){}});return r})},"esri/toolbars/TextEditor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/event dojo/has dojo/dom-construct dojo/dom-class dojo/dom-style dojo/keys ../kernel".split(" "),function(r,n,p,m,h,e,k,d,g,c){r=r(null,{declaredClass:"esri.toolbars.TextEditor",constructor:function(a,c,d){this._graphic=a;this._map=c;this._toolbar=d;this._enable(this._graphic)},destroy:function(){this._disable()},
onEditStart:function(){},onEditEnd:function(){},_enable:function(a){this._editBox?(p.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null):(this._map.navigationManager.setImmediateClick(!0),this._addEditBoxHandler=p.connect(a.getLayer(),"onDblClick",this,function(c){this._map.navigationManager.setImmediateClick(!1);c.graphic==a&&(m.stop(c),p.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null,this._addTextBox(a))}))},_disable:function(){this._applyEdit();this._addEditBoxHandler&&
(p.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null);this._removeTextBox();this.onEditEnd(this._graphic);this._toolbar.onTextEditEnd(this._graphic)},_addTextBox:function(a,c){if(!this._editBox){var l;a.symbol.text||(a.symbol.text="Tempt text",a.setSymbol(a.symbol),l="");var h=this._createInputTextStyle(a,this._map);""!==l&&(l=c||a.symbol.text);this._editBox=e.create("input",{type:"text",value:l});d.set(this._editBox,h);k.add(this._editBox,"esriTextEditorInput");this._map.container.appendChild(this._editBox);
this._editBox.focus();this._editBoxKeyHandler=p.connect(this._editBox,"onkeyup",n.hitch(this,function(a){a.keyCode!=g.ENTER&&a.keyCode!==g.TAB||this._disable()}));this._editBoxBlurHandler=p.connect(this._editBox,"onblur",n.hitch(this,function(a){this._disable()}));a.symbol.text="";a.setSymbol(a.symbol);a.hide();var f=this._editBox;this._disableBoxHandler||(this._disableBoxHandler=this._map.on("zoom-start",n.hitch(this,function(){this._disable()})));this._moveBoxHandler=this._map.on("pan",function(a){d.set(f,
{left:this._editBoxLeft+a.delta.x+"px",top:this._editBoxTop+a.delta.y+"px"})});this._moveBoxStartHandler=this._map.on("pan-start",function(){this._editBoxLeft=parseFloat(d.get(f,"left"));this._editBoxTop=parseFloat(d.get(f,"top"))});this.onEditStart(a,this._editBox);this._toolbar.onTextEditStart(a,this._editBox)}},_removeTextBox:function(){this._editBoxBlurHandler&&(p.disconnect(this._editBoxBlurHandler),this._editBoxBlurHandler=null);this._editBox&&(this._editBox.parentNode.removeChild(this._editBox),
this._editBox=null);this._disableBoxHandler&&(this._disableBoxHandler.remove(),this._disableBoxHandler=null);this._moveBoxHandler&&(this._moveBoxHandler.remove(),this._moveBoxHandler=null);this._moveBoxStartHandler&&(this._moveBoxStartHandler.remove(),this._moveBoxStartHandler=null);this._editBoxKeyHandler&&(p.disconnect(this._editBoxKeyHandler),this._editBoxKeyHandler=null)},_createInputTextStyle:function(a,c){var d=a.getDojoShape().getTransformedBoundingBox(),e=a.symbol.font;return{"font-family":e.family,
"font-size":e.size+"px","font-style":e.style,"font-variant":e.variant,"font-weight":e.weight,left:d[0].x+"px",top:d[0].y+"px",width:Math.abs(d[0].x-d[1].x)/Math.cos(a.symbol.angle/180*Math.PI)+"px"}},_applyEdit:function(){if(this._editBox)if(this._editBox.value){this._graphic.show();var a=this._graphic.symbol;a.text=this._editBox.value;this._graphic.setSymbol(a)}else this._graphic.getLayer().remove(this._graphic)}});h("extend-esri")&&n.setObject("toolbars.TextEditor",r,c);return r})},"esri/tasks/geometry":function(){define("./GeometryService ./TrimExtendParameters ./BufferParameters ./AreasAndLengthsParameters ./LengthsParameters ./RelationParameters ./DensifyParameters ./GeneralizeParameters ./OffsetParameters ./DistanceParameters ./ProjectParameters".split(" "),
function(){return{}})},"esri/tasks/GeometryService":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/_base/Deferred dojo/has ../kernel ../request ../deferredUtils ./Task ../geometry/Extent ../geometry/Polyline ../geometry/Polygon ../geometry/Multipoint ../geometry/jsonUtils".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f){r=r(c,{declaredClass:"esri.tasks.GeometryService",_eventMap:{"areas-and-lengths-complete":["result"],"auto-complete-complete":["geometries"],
"buffer-complete":["geometries"],"convex-hull-complete":["geometry"],"cut-complete":["result"],"densify-complete":["geometries"],"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(a){a=n.hitch;this._projectHandler=a(this,this._projectHandler);this._simplifyHandler=a(this,this._simplifyHandler);this._bufferHandler=a(this,this._bufferHandler);this._areasAndLengthsHandler=a(this,this._areasAndLengthsHandler);this._lengthsHandler=a(this,this._lengthsHandler);this._labelPointsHandler=a(this,this._labelPointsHandler);this._relationHandler=a(this,this._relationHandler);this._convexHullHandler=
a(this,this._convexHullHandler);this._unionHandler=a(this,this._unionHandler);this._autoCompleteHandler=a(this,this._autoCompleteHandler);this._reshapeHandler=a(this,this._reshapeHandler);this._cutHandler=a(this,this._cutHandler);this._intersectHandler=a(this,this._intersectHandler);this._differenceHandler=a(this,this._differenceHandler);this._trimExtendHandler=a(this,this._trimExtendHandler);this._densifyHandler=a(this,this._densifyHandler);this._generalizeHandler=a(this,this._densifyHandler);this._offsetHandler=
a(this,this._offsetHandler);this._distanceHandler=a(this,this._distanceHandler);this._toGeoCoordinateHandler=a(this,this._toGeoCoordinateHandler);this._fromGeoCoordinateHandler=a(this,this._fromGeoCoordinateHandler);this.registerConnectEvents()},_encodeGeometries:function(a){var b=[],c,d=a.length;for(c=0;c<d;c++)b.push(a[c].toJson());return{geometryType:f.getJsonType(a[0]),geometries:b}},_decodeGeometries:function(a,c,d){var b=f.getGeometryType(c);a=a.geometries;var e=[],g={spatialReference:d.toJson()},
l=n.mixin;p.forEach(a,function(a,c){e[c]=new b(l(a,g))});return e},_toProjectGeometry:function(b){var c=b.spatialReference.toJson();return b instanceof a?new t({rings:[[[b.xmin,b.ymin],[b.xmin,b.ymax],[b.xmax,b.ymax],[b.xmax,b.ymin],[b.xmin,b.ymin]]],spatialReference:c}):new l({paths:[[].concat(b.points)],spatialReference:c})},_fromProjectedGeometry:function(b,c,d){return"esriGeometryEnvelope"===c?(b=b.rings[0],new a(b[0][0],b[0][1],b[2][0],b[2][1],d)):new v({points:b.paths[0],spatialReference:d.toJson()})},
project:function(a,c,e,l){var b=n.mixin({},this._url.query,{f:"json"}),k;a.geometries?(l=e,e=c,c=a.outSR,k=a.geometries[0],b=n.mixin(b,a.toJson())):(k=a[0],b=n.mixin(b,{outSR:c.wkid||m.toJson(c.toJson()),inSR:k.spatialReference.wkid||m.toJson(k.spatialReference.toJson()),geometries:m.toJson(this._encodeGeometries(a))}));var q=f.getJsonType(k),t=this._projectHandler,u=this._errorHandler,p=new h(g._dfdCanceller);p._pendingDfd=d({url:this._url.path+"/project",content:b,callbackParamName:"callback",load:function(a,
b){t(a,b,q,c,e,l,p)},error:function(a){u(a,l,p)}});return p},_projectHandler:function(a,c,d,f,e,g,l){try{var b=this._decodeGeometries(a,d,f);this._successHandler([b],"onProjectComplete",e,l)}catch(z){this._errorHandler(z,g,l)}},onProjectComplete:function(){},simplify:function(a,c,e){var b=a[0].spatialReference,l=n.mixin({},this._url.query,{f:"json",sr:b.wkid?b.wkid:m.toJson(b.toJson()),geometries:m.toJson(this._encodeGeometries(a))}),k=f.getJsonType(a[0]),q=this._simplifyHandler,t=this._errorHandler,
u=new h(g._dfdCanceller);u._pendingDfd=d({url:this._url.path+"/simplify",content:l,callbackParamName:"callback",load:function(a,d){q(a,d,k,b,c,e,u)},error:function(a){t(a,e,u)}});return u},_simplifyHandler:function(a,c,d,f,e,g,l){try{var b=this._decodeGeometries(a,d,f);this._successHandler([b],"onSimplifyComplete",e,l)}catch(z){this._errorHandler(z,g,l)}},onSimplifyComplete:function(){},convexHull:function(a,c,f){var b=a[0].spatialReference;a=n.mixin({},this._url.query,{f:"json",sr:m.toJson(b.toJson()),
geometries:m.toJson(this._encodeGeometries(a))});var e=this._convexHullHandler,l=this._errorHandler,k=new h(g._dfdCanceller);k._pendingDfd=d({url:this._url.path+"/convexHull",content:a,callbackParamName:"callback",load:function(a,d){e(a,d,b,c,f,k)},error:function(a){l(a,f,k)}});return k},_convexHullHandler:function(a,c,d,e,g,l){try{var b=f.fromJson(a.geometry).setSpatialReference(d);this._successHandler([b],"onConvexHullComplete",e,l)}catch(w){this._errorHandler(w,g,l)}},onConvexHullComplete:function(){},
union:function(a,c,f){var b=a[0].spatialReference;a=n.mixin({},this._url.query,{f:"json",sr:m.toJson(b.toJson()),geometries:m.toJson(this._encodeGeometries(a))});var e=this._unionHandler,l=this._errorHandler,k=new h(g._dfdCanceller);k._pendingDfd=d({url:this._url.path+"/union",content:a,callbackParamName:"callback",load:function(a,d){e(a,d,b,c,f,k)},error:function(a){l(a,f,k)}});return k},_unionHandler:function(a,c,d,e,g,l){try{var b=f.fromJson(a.geometry).setSpatialReference(d);this._successHandler([b],
"onUnionComplete",e,l)}catch(w){this._errorHandler(w,g,l)}},onUnionComplete:function(){},autoComplete:function(a,c,f,e){var b=a[0].spatialReference;a=n.mixin({},this._url.query,{f:"json",sr:m.toJson(b.toJson()),polygons:m.toJson(this._encodeGeometries(a).geometries),polylines:m.toJson(this._encodeGeometries(c).geometries)});var l=this._autoCompleteHandler,k=this._errorHandler,q=new h(g._dfdCanceller);q._pendingDfd=d({url:this._url.path+"/autoComplete",content:a,callbackParamName:"callback",load:function(a,
c){l(a,c,b,f,e,q)},error:function(a){k(a,e,q)}});return q},_autoCompleteHandler:function(a,c,d,f,e,g){try{var b=a.geometries;a=[];var l,k=b.length;for(l=0;l<k;l++)a[l]=new t({spatialReference:d,rings:b[l].rings});this._successHandler([a],"onAutoCompleteComplete",f,g)}catch(E){this._errorHandler(E,e,g)}},onAutoCompleteComplete:function(){},reshape:function(a,c,e,l){var b=a.spatialReference;a=n.mixin({},this._url.query,{f:"json",sr:m.toJson(b.toJson()),target:m.toJson({geometryType:f.getJsonType(a),
geometry:a.toJson()}),reshaper:m.toJson(c.toJson())});var k=this._reshapeHandler,q=this._errorHandler,t=new h(g._dfdCanceller);t._pendingDfd=d({url:this._url.path+"/reshape",content:a,callbackParamName:"callback",load:function(a,c){k(a,c,b,e,l,t)},error:function(a){q(a,l,t)}});return t},_reshapeHandler:function(a,c,d,e,g,l){try{var b=f.fromJson(a.geometry).setSpatialReference(d);this._successHandler([b],"onReshapeComplete",e,l)}catch(w){this._errorHandler(w,g,l)}},onReshapeComplete:function(){},cut:function(a,
c,e,l){var b=a[0].spatialReference,k=p.map(a,function(a){return a.toJson()});a=n.mixin({},this._url.query,{f:"json",sr:m.toJson(b.toJson()),target:m.toJson({geometryType:f.getJsonType(a[0]),geometries:k}),cutter:m.toJson(c.toJson())});var q=this._cutHandler,t=this._errorHandler,u=new h(g._dfdCanceller);u._pendingDfd=d({url:this._url.path+"/cut",content:a,callbackParamName:"callback",load:function(a,c){q(a,c,b,e,l,u)},error:function(a){t(a,l,u)}});return u},_cutHandler:function(a,c,d,e,g,l){try{var b=
a.geometries,k={};k.cutIndexes=a.cutIndexes;k.geometries=[];p.forEach(b,function(a){k.geometries.push(f.fromJson(a).setSpatialReference(d))});this._successHandler([k],"onCutComplete",e,l)}catch(z){this._errorHandler(z,g,l)}},onCutComplete:function(){},intersect:function(a,c,e,l){var b=a[0].spatialReference;a=n.mixin({},this._url.query,{f:"json",sr:m.toJson(b.toJson()),geometries:m.toJson(this._encodeGeometries(a)),geometry:m.toJson({geometryType:f.getJsonType(c),geometry:c.toJson()})});var k=this._intersectHandler,
q=this._errorHandler,t=new h(g._dfdCanceller);t._pendingDfd=d({url:this._url.path+"/intersect",content:a,callbackParamName:"callback",load:function(a,c){k(a,c,b,e,l,t)},error:function(a){q(a,l,t)}});return t},_intersectHandler:function(a,c,d,e,g,l){try{var b=[];p.forEach(a.geometries,function(a){b.push(f.fromJson(a).setSpatialReference(d))});this._successHandler([b],"onIntersectComplete",e,l)}catch(w){this._errorHandler(w,g,l)}},onIntersectComplete:function(){},difference:function(a,c,e,l){var b=
a[0].spatialReference;a=n.mixin({},this._url.query,{f:"json",sr:m.toJson(b.toJson()),geometries:m.toJson(this._encodeGeometries(a)),geometry:m.toJson({geometryType:f.getJsonType(c),geometry:c.toJson()})});var k=this._differenceHandler,q=this._errorHandler,t=new h(g._dfdCanceller);t._pendingDfd=d({url:this._url.path+"/difference",content:a,callbackParamName:"callback",load:function(a,c){k(a,c,b,e,l,t)},error:function(a){q(a,l,t)}});return t},_differenceHandler:function(a,c,d,e,g,l){try{var b=[];p.forEach(a.geometries,
function(a){b.push(f.fromJson(a).setSpatialReference(d))});this._successHandler([b],"onDifferenceComplete",e,l)}catch(w){this._errorHandler(w,g,l)}},onDifferenceComplete:function(){},buffer:function(a,c,f){var b=n.mixin({},this._url.query,{f:"json"},a.toJson()),e=a.outSpatialReference||a.geometries[0].spatialReference,l=this._bufferHandler,k=this._errorHandler,q=new h(g._dfdCanceller);q._pendingDfd=d({url:this._url.path+"/buffer",content:b,callbackParamName:"callback",load:function(a,b){l(a,b,e,c,
f,q)},error:function(a){k(a,f,q)}});return q},_bufferHandler:function(a,c,d,f,e,g){try{var b=a.geometries;a=[];var l,k=b.length;for(l=0;l<k;l++)a[l]=new t({spatialReference:d,rings:b[l].rings});this._successHandler([a],"onBufferComplete",f,g)}catch(E){this._errorHandler(E,e,g)}},onBufferComplete:function(){},areasAndLengths:function(a,c,f){a=n.mixin({},this._url.query,{f:"json"},a.toJson());var b=this._areasAndLengthsHandler,e=this._errorHandler,l=new h(g._dfdCanceller);l._pendingDfd=d({url:this._url.path+
"/areasAndLengths",content:a,callbackParamName:"callback",load:function(a,d){b(a,d,c,f,l)},error:function(a){e(a,f,l)}});return l},_areasAndLengthsHandler:function(a,c,d,f,e){try{this._successHandler([a],"onAreasAndLengthsComplete",d,e)}catch(B){this._errorHandler(B,f,e)}},onAreasAndLengthsComplete:function(){},lengths:function(a,c,f){a=n.mixin({},this._url.query,{f:"json"},a.toJson());var b=this._lengthsHandler,e=this._errorHandler,l=new h(g._dfdCanceller);l._pendingDfd=d({url:this._url.path+"/lengths",
content:a,callbackParamName:"callback",load:function(a,d){b(a,d,c,f,l)},error:function(a){e(a,f,l)}});return l},_lengthsHandler:function(a,c,d,f,e){try{this._successHandler([a],"onLengthsComplete",d,e)}catch(B){this._errorHandler(B,f,e)}},onLengthsComplete:function(){},labelPoints:function(a,c,f){var b=p.map(a,function(a){return a.toJson()}),e=a[0].spatialReference,b=n.mixin({},this._url.query,{f:"json",sr:e.wkid?e.wkid:m.toJson(e.toJson()),polygons:m.toJson(b)}),l=this._labelPointsHandler,k=this._errorHandler,
q=new h(g._dfdCanceller);q._pendingDfd=d({url:this._url.path+"/labelPoints",content:b,callbackParamName:"callback",load:function(b,d){l(b,d,a,e,c,f,q)},error:function(a){k(a,f,q)}});return q},_labelPointsHandler:function(a,c,d,e,g,l,k){try{var b=[];p.forEach(a.labelPoints,function(a){b.push(f.fromJson(a).setSpatialReference(e))});this._successHandler([b],"onLabelPointsComplete",g,k)}catch(z){this._errorHandler(z,l,k)}},onLabelPointsComplete:function(){},relation:function(a,c,f){a=n.mixin({},this._url.query,
{f:"json"},a.toJson());var b=this._relationHandler,e=this._errorHandler,l=new h(g._dfdCanceller);l._pendingDfd=d({url:this._url.path+"/relation",content:a,callbackParamName:"callback",load:function(a,d){b(a,d,c,f,l)},error:function(a){e(a,f,l)}});return l},_relationHandler:function(a,c,d,f,e){try{this._successHandler([a.relations],"onRelationComplete",d,e)}catch(B){this._errorHandler(B,f,e)}},onRelationComplete:function(){},trimExtend:function(a,c,f){var b=n.mixin({},this._url.query,{f:"json"},a.toJson()),
e=a.sr,l=this._trimExtendHandler,k=this._errorHandler,q=new h(g._dfdCanceller);q._pendingDfd=d({url:this._url.path+"/trimExtend",content:b,callbackParamName:"callback",load:function(a,b){l(a,b,e,c,f,q)},error:function(a){k(a,f,q)}});return q},_trimExtendHandler:function(a,c,d,f,e,g){try{var b=a.geometries;a=[];var k,h=b.length;for(k=0;k<h;k++)a[k]=new l({spatialReference:d,paths:b[k].paths});this._successHandler([a],"onTrimExtendComplete",f,g)}catch(E){this._errorHandler(E,e,g)}},onTrimExtendComplete:function(){},
densify:function(a,c,f){var b=n.mixin({},this._url.query,{f:"json"},a.toJson()),e=a.geometries[0].spatialReference,l=this._densifyHandler,k=this._errorHandler,q=new h(g._dfdCanceller);q._pendingDfd=d({url:this._url.path+"/densify",content:b,callbackParamName:"callback",load:function(a,b){l(a,b,e,c,f,q)},error:function(a){k(a,f,q)}});return q},_densifyHandler:function(a,c,d,e,l,g){try{var b=[];p.forEach(a.geometries,function(a){b.push(f.fromJson(a).setSpatialReference(d))});this._successHandler([b],
"onDensifyComplete",e,g)}catch(w){this._errorHandler(w,l,g)}},onDensifyComplete:function(){},generalize:function(a,c,f){var b=n.mixin({},this._url.query,{f:"json"},a.toJson()),e=a.geometries[0].spatialReference,l=this._generalizeHandler,k=this._errorHandler,q=new h(g._dfdCanceller);q._pendingDfd=d({url:this._url.path+"/generalize",content:b,callbackParamName:"callback",load:function(a,b){l(a,b,e,c,f,q)},error:function(a){k(a,f,q)}});return q},_generalizeHandler:function(a,c,d,e,l,g){try{var b=[];
p.forEach(a.geometries,function(a){b.push(f.fromJson(a).setSpatialReference(d))});this._successHandler([b],"onGeneralizeComplete",e,g)}catch(w){this._errorHandler(w,l,g)}},onGeneralizeComplete:function(){},offset:function(a,c,f){var b=n.mixin({},this._url.query,{f:"json"},a.toJson()),e=a.geometries[0].spatialReference,l=this._offsetHandler,k=this._errorHandler,q=new h(g._dfdCanceller);q._pendingDfd=d({url:this._url.path+"/offset",content:b,callbackParamName:"callback",load:function(a,b){l(a,b,e,c,
f,q)},error:function(a){k(a,f,q)}});return q},_offsetHandler:function(a,c,d,e,l,g){try{var b=[];p.forEach(a.geometries,function(a){b.push(f.fromJson(a).setSpatialReference(d))});this._successHandler([b],"onOffsetComplete",e,g)}catch(w){this._errorHandler(w,l,g)}},onOffsetComplete:function(){},distance:function(a,c,f){var b=n.mixin({},this._url.query,{f:"json"},a.toJson()),e=a.geometry1.spatialReference,l=this._distanceHandler,k=this._errorHandler,q=new h(g._dfdCanceller);q._pendingDfd=d({url:this._url.path+
"/distance",content:b,callbackParamName:"callback",load:function(a,b){l(a,b,e,c,f,q)},error:function(a){k(a,f,q)}});return q},_distanceHandler:function(a,c,d,f,e,l){try{a=a&&a.distance,this._successHandler([a],"onDistanceComplete",f,l)}catch(x){this._errorHandler(x,e,l)}},onDistanceComplete:function(){},toGeoCoordinateString:function(a,c,f){var b={};n.isObject(a.sr)?b.sr=a.sr.wkid||m.toJson(a.sr.toJson()):b.sr=a.sr;b.coordinates=m.toJson(a.coordinates);b.conversionType=a.conversionType||"MGRS";b.conversionMode=
a.conversionMode;b.numOfDigits=a.numOfDigits;b.rounding=a.rounding;b.addSpaces=a.addSpaces;a=n.mixin({},this._url.query,{f:"json"},b);var e=this._toGeoCoordinateHandler,l=this._errorHandler,k=new h(g._dfdCanceller);k._pendingDfd=d({url:this._url.path+"/toGeoCoordinateString",content:a,callbackParamName:"callback",load:function(a,b){e(a,b,c,f,k)},error:function(a){l(a,f,k)}});return k},_toGeoCoordinateHandler:function(a,c,d,f,e){try{this._successHandler([a.strings],"onToGeoCoordinateStringComplete",
d,e)}catch(B){this._errorHandler(B,f,e)}},onToGeoCoordinateStringComplete:function(){},fromGeoCoordinateString:function(a,c,f){var b={};n.isObject(a.sr)?b.sr=a.sr.wkid||m.toJson(a.sr.toJson()):b.sr=a.sr;b.strings=m.toJson(a.strings);b.conversionType=a.conversionType||"MGRS";b.conversionMode=a.conversionMode;a=n.mixin({},this._url.query,{f:"json"},b);var e=this._fromGeoCoordinateHandler,l=this._errorHandler,k=new h(g._dfdCanceller);k._pendingDfd=d({url:this._url.path+"/fromGeoCoordinateString",content:a,
callbackParamName:"callback",load:function(a,b){e(a,b,c,f,k)},error:function(a){l(a,f,k)}});return k},_fromGeoCoordinateHandler:function(a,c,d,f,e){try{this._successHandler([a.coordinates],"onToGeoCoordinateStringComplete",d,e)}catch(B){this._errorHandler(B,f,e)}},onFromGeoCoordinateStringComplete:function(){}});n.mixin(r,{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"});e("extend-esri")&&n.setObject("tasks.GeometryService",r,k);return r})},"esri/tasks/TrimExtendParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has ../kernel".split(" "),function(r,n,p,m,h,e){r=r(null,{declaredClass:"esri.tasks.TrimExtendParameters",
polylines:null,trimExtendTo:null,extendHow:null,toJson:function(){var e=p.map(this.polylines,function(d){return d.toJson()}),d={};d.polylines=m.toJson(e);d.trimExtendTo=m.toJson(this.trimExtendTo.toJson());d.sr=m.toJson(this.polylines[0].spatialReference.toJson());d.extendHow=this.extendHow||0;return d}});n.mixin(r,{DEFAULT_CURVE_EXTENSION:0,RELOCATE_ENDS:1,KEEP_END_ATTRIBUTES:2,NO_END_ATTRIBUTES:4,NO_EXTEND_AT_FROM:8,NO_EXTEND_AT_TO:16});h("extend-esri")&&n.setObject("tasks.TrimExtendParameters",
r,e);return r})},"esri/tasks/BufferParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has ../kernel ../geometry/Polygon ../geometry/jsonUtils".split(" "),function(r,n,p,m,h,e,k,d){r=r(null,{declaredClass:"esri.tasks.BufferParameters",geometries:null,outSpatialReference:null,bufferSpatialReference:null,distances:null,unit:null,unionResults:!1,geodesic:!1,toJson:function(){var e={unit:this.unit,unionResults:this.unionResults,geodesic:this.geodesic},
c=this.distances,a=this.outSpatialReference,l=this.bufferSpatialReference,h=p.map(this.geometries,function(a){a="extent"===a.type?k.fromExtent(a):a;return a.toJson()},this),n=this.geometries;if(n&&0<n.length){var f="extent"===n[0].type?"esriGeometryPolygon":d.getJsonType(n[0]);e.geometries=m.toJson({geometryType:f,geometries:h});e.inSR=n[0].spatialReference.wkid?n[0].spatialReference.wkid:m.toJson(n[0].spatialReference.toJson())}c&&(e.distances=c.join(","));a&&(e.outSR=a.wkid?a.wkid:m.toJson(a.toJson()));
l&&(e.bufferSR=l.wkid?l.wkid:m.toJson(l.toJson()));return e}});h("extend-esri")&&n.setObject("tasks.BufferParameters",r,e);return r})},"esri/tasks/AreasAndLengthsParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has ../kernel".split(" "),function(r,n,p,m,h,e){r=r(null,{declaredClass:"esri.tasks.AreasAndLengthsParameters",polygons:null,lengthUnit:null,areaUnit:null,calculationType:null,toJson:function(){var e=p.map(this.polygons,function(d){return d.toJson()}),
d={};d.polygons=m.toJson(e);e=this.polygons[0].spatialReference;d.sr=e.wkid?e.wkid:m.toJson(e.toJson());this.lengthUnit&&(d.lengthUnit=this.lengthUnit);this.areaUnit&&(n.isString(this.areaUnit)?d.areaUnit=m.toJson({areaUnit:this.areaUnit}):d.areaUnit=this.areaUnit);this.calculationType&&(d.calculationType=this.calculationType);return d}});h("extend-esri")&&n.setObject("tasks.AreasAndLengthsParameters",r,e);return r})},"esri/tasks/LengthsParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has ../kernel".split(" "),
function(r,n,p,m,h,e){r=r(null,{declaredClass:"esri.tasks.LengthsParameters",polylines:null,lengthUnit:null,geodesic:null,calculationType:null,toJson:function(){var e=p.map(this.polylines,function(d){return d.toJson()}),d={};d.polylines=m.toJson(e);e=this.polylines[0].spatialReference;d.sr=e.wkid?e.wkid:m.toJson(e.toJson());this.lengthUnit&&(d.lengthUnit=this.lengthUnit);this.geodesic&&(d.geodesic=this.geodesic);this.calculationType&&(d.calculationType=this.calculationType);return d}});h("extend-esri")&&
n.setObject("tasks.LengthsParameters",r,e);return r})},"esri/tasks/RelationParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has ../kernel ../geometry/jsonUtils".split(" "),function(r,n,p,m,h,e,k){r=r(null,{declaredClass:"esri.tasks.RelationParameters",geometries1:null,geometries2:null,relation:null,relationParam:null,toJson:function(){var d=p.map(this.geometries1,function(a){return a.toJson()}),e=p.map(this.geometries2,function(a){return a.toJson()}),
c={},a=this.geometries1;a&&0<a.length&&(c.geometries1=m.toJson({geometryType:k.getJsonType(a[0]),geometries:d}),d=this.geometries1[0].spatialReference,c.sr=d.wkid?d.wkid:m.toJson(d.toJson()));(d=this.geometries2)&&0<d.length&&(c.geometries2=m.toJson({geometryType:k.getJsonType(d[0]),geometries:e}));this.relation&&(c.relation=this.relation);this.relationParam&&(c.relationParam=this.relationParam);return c}});n.mixin(r,{SPATIAL_REL_CROSS:"esriGeometryRelationCross",SPATIAL_REL_DISJOINT:"esriGeometryRelationDisjoint",
SPATIAL_REL_IN:"esriGeometryRelationIn",SPATIAL_REL_INTERIORINTERSECTION:"esriGeometryRelationInteriorIntersection",SPATIAL_REL_INTERSECTION:"esriGeometryRelationIntersection",SPATIAL_REL_COINCIDENCE:"esriGeometryRelationLineCoincidence",SPATIAL_REL_LINETOUCH:"esriGeometryRelationLineTouch",SPATIAL_REL_OVERLAP:"esriGeometryRelationOverlap",SPATIAL_REL_POINTTOUCH:"esriGeometryRelationPointTouch",SPATIAL_REL_TOUCH:"esriGeometryRelationTouch",SPATIAL_REL_WITHIN:"esriGeometryRelationWithin",SPATIAL_REL_RELATION:"esriGeometryRelationRelation"});
h("extend-esri")&&n.setObject("tasks.RelationParameters",r,e);return r})},"esri/tasks/DensifyParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has ../kernel ../geometry/jsonUtils".split(" "),function(r,n,p,m,h,e,k){r=r(null,{declaredClass:"esri.tasks.DensifyParameters",geometries:null,geodesic:null,lengthUnit:null,maxSegmentLength:null,toJson:function(){var d=p.map(this.geometries,function(c){return c.toJson()}),e={};this.geometries&&0<this.geometries.length&&
(e.geometries=m.toJson({geometryType:k.getJsonType(this.geometries[0]),geometries:d}),e.sr=m.toJson(this.geometries[0].spatialReference.toJson()));this.geodesic&&(e.geodesic=this.geodesic);this.lengthUnit&&(e.lengthUnit=this.lengthUnit);this.maxSegmentLength&&(e.maxSegmentLength=this.maxSegmentLength);return e}});h("extend-esri")&&n.setObject("tasks.DensifyParameters",r,e);return r})},"esri/tasks/GeneralizeParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has ../kernel ../geometry/jsonUtils".split(" "),
function(r,n,p,m,h,e,k){r=r(null,{declaredClass:"esri.tasks.GeneralizeParameters",geometries:null,deviationUnit:null,maxDeviation:null,toJson:function(){var d=p.map(this.geometries,function(c){return c.toJson()}),e={};this.geometries&&0<this.geometries.length&&(e.geometries=m.toJson({geometryType:k.getJsonType(this.geometries[0]),geometries:d}),e.sr=m.toJson(this.geometries[0].spatialReference.toJson()));this.deviationUnit&&(e.deviationUnit=this.deviationUnit);this.maxDeviation&&(e.maxDeviation=this.maxDeviation);
return e}});h("extend-esri")&&n.setObject("tasks.GeneralizeParameters",r,e);return r})},"esri/tasks/OffsetParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has ../kernel ../geometry/jsonUtils".split(" "),function(r,n,p,m,h,e,k){r=r(null,{declaredClass:"esri.tasks.OffsetParameters",geometries:null,bevelRatio:null,offsetDistance:null,offsetHow:null,offsetUnit:null,toJson:function(){var d=p.map(this.geometries,function(c){return c.toJson()}),e={};
this.geometries&&0<this.geometries.length&&(e.geometries=m.toJson({geometryType:k.getJsonType(this.geometries[0]),geometries:d}),e.sr=m.toJson(this.geometries[0].spatialReference.toJson()));this.bevelRatio&&(e.bevelRatio=this.bevelRatio);this.offsetDistance&&(e.offsetDistance=this.offsetDistance);this.offsetHow&&(e.offsetHow=this.offsetHow);this.offsetUnit&&(e.offsetUnit=this.offsetUnit);return e}});n.mixin(r,{OFFSET_BEVELLED:"esriGeometryOffsetBevelled",OFFSET_MITERED:"esriGeometryOffsetMitered",
OFFSET_ROUNDED:"esriGeometryOffsetRounded"});h("extend-esri")&&n.setObject("tasks.OffsetParameters",r,e);return r})},"esri/tasks/DistanceParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../geometry/jsonUtils".split(" "),function(r,n,p,m,h,e){r=r(null,{declaredClass:"esri.tasks.DistanceParameters",geometry1:null,geometry2:null,distanceUnit:null,geodesic:null,toJson:function(){var k={},d=this.geometry1;d&&(k.geometry1=p.toJson({geometryType:e.getJsonType(d),
geometry:d}));if(d=this.geometry2)k.geometry2=p.toJson({geometryType:e.getJsonType(d),geometry:d});k.sr=p.toJson(this.geometry1.spatialReference.toJson());this.distanceUnit&&(k.distanceUnit=this.distanceUnit);this.geodesic&&(k.geodesic=this.geodesic);return k}});m("extend-esri")&&n.setObject("tasks.DistanceParameters",r,h);return r})},"esri/tasks/ProjectParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has ../kernel ../lang ../geometry/jsonUtils".split(" "),
function(r,n,p,m,h,e,k,d){r=r(null,{declaredClass:"esri.tasks.ProjectParameters",geometries:null,outSR:null,transformation:null,transformForward:null,toJson:function(){var e=p.map(this.geometries,function(a){return a.toJson()}),c={};c.outSR=this.outSR.wkid||m.toJson(this.outSR.toJson());c.inSR=this.geometries[0].spatialReference.wkid||m.toJson(this.geometries[0].spatialReference.toJson());c.geometries=m.toJson({geometryType:d.getJsonType(this.geometries[0]),geometries:e});this.transformation&&(c.transformation=
this.transformation.wkid||m.toJson(this.transformation));k.isDefined(this.transformForward)&&(c.transformForward=this.transformForward);return c}});h("extend-esri")&&n.setObject("tasks.ProjectParameters",r,e);return r})},"esri/dijit/AttributeInspector":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/sniff dojo/_base/kernel dojo/has dojo/dom-style dojo/dom-construct ../kernel ../lang ../domUtils ../layers/InheritedDomain ../layers/FeatureLayer dojo/i18n!../nls/jsapi dojo/fx dojox/gfx dijit/_Widget dijit/_Templated dijit/Editor dijit/_editor/plugins/LinkDialog dijit/_editor/plugins/TextColor ./_EventedWidget ./editing/AttachmentEditor ./editing/Util ../tasks/query dijit/form/DateTextBox dijit/form/TextBox dijit/form/NumberTextBox dijit/form/FilteringSelect dijit/form/NumberSpinner dijit/form/Button dijit/form/SimpleTextarea dijit/form/ValidationTextBox dijit/form/TimeTextBox dijit/Tooltip dojo/data/ItemFileReadStore dojox/date/islamic dojox/date/islamic/Date dojox/date/islamic/locale dojo/text!./templates/AttributeInspector.html".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A,y,B,x,w,z,E,C,D,F,G,I,N,M,P,U,V,W,R,K,J,O,S){var L=r([w,u,A],{declaredClass:"esri.dijit.AttributeInspector",widgetsInTemplate:!0,templateString:S,onUpdate:function(){},onDelete:function(){},onAttributeChange:function(){},onNext:function(){},onReset:function(){},onCancel:function(){},_navMessage:"( ${idx} ${of} ${numFeatures} )",_currentAttributeFieldName:null,_aiConnects:[],_selection:[],_toolTips:[],_numFeatures:0,_featureIdx:0,_currentLInfo:null,_currentFeature:null,
_rollbackInfo:null,_eventMap:{update:!0,"delete":["feature"],"attribute-change":["feature","fieldName","fieldValue"],next:["feature"],reset:!0,cancel:!0},_defaultRichTextPlugins:"bold italic underline foreColor hiliteColor | justifyLeft justifyCenter justifyRight justifyFull | insertOrderedList insertUnorderedList indent outdent | createLink".split(" "),css:{label:"atiLabel",field:"atiField",textArea:"atiTextAreaField",richText:"atiRichTextField",attachmentEditor:"atiAttachmentEditor",red:"atiRequiredField"},
constructor:function(a,b){n.mixin(this,f.widgets.attributeInspector);a=a||{};a.featureLayer||a.layerInfos||console.error("esri.AttributeInspector: please provide correct parameter in the constructor");this._datePackage=this._getDatePackage(a);this._layerInfos=a.layerInfos||[{featureLayer:a.featureLayer,options:a.options||[]}];this._layerInfos=p.filter(this._layerInfos,function(a){return!a.disableAttributeUpdate});this._hideNavButtons=a.hideNavButtons||!1},postCreate:function(){if(p.every(this._layerInfos,
function(a){return a.featureLayer.loaded}))this._initLayerInfos(),this._createAttachmentEditor(),this.onFirstFeature();else{var a=this._layerInfos.length;p.forEach(this._layerInfos,function(b){b=b.featureLayer;if(b.loaded)a--;else var c=m.connect(b,"onLoad",this,function(b){m.disconnect(c);c=null;a--;a||(this._initLayerInfos(),this._createAttachmentEditor(),this.onFirstFeature())})},this)}},destroy:function(){this._destroyAttributeTable();p.forEach(this._aiConnects,m.disconnect);delete this._aiConnects;
this._attachmentEditor&&(this._attachmentEditor.destroy(),delete this._attachmentEditor);delete this._layerInfos;this._selection=this._currentFeature=this._currentLInfo=this._attributes=this._layerInfos=null;this.inherited(arguments)},refresh:function(){this._updateSelection()},first:function(){this.onFirstFeature()},last:function(){this.onLastFeature()},next:function(){this.onNextFeature()},previous:function(){this.onPreviousFeature()},showFeature:function(a,b){b&&(this._createOnlyFirstTime=!0);
this._updateSelection([a],b);this._updateUI()},onLayerSelectionChange:function(a,b,c){this._createOnlyFirstTime=!1;this._featureIdx=c===v.SELECTION_NEW?0:this._featureIdx;this._updateSelection();this._updateUI()},onLayerSelectionClear:function(){!this._selection||0>=this._selection.length||(this._featureIdx=this._numFeatures=0,this._selection=[],this._currentLInfo=this._currentFeature=null,this._updateUI())},onLayerUpdateEnd:function(a,b,c,d){},onLayerError:function(a,b,c,d){},onLayerEditsError:function(a,
b,c,d){},onLayerEditsComplete:function(a,b,c,d){d=d||[];if(d.length){var e=this._selection,f=a.featureLayer.objectIdField;p.forEach(d,n.hitch(this,function(a){p.some(e,n.hitch(this,function(b,c){if(b.attributes[f]!==a.objectId)return!1;this._selection.splice(c,1);return!0}))}))}b=b||[];b.length&&(this._selection=E.findFeatures(b,a.featureLayer),this._featureIdx=0);d=this._numFeatures=(this._selection=E.sortFeaturesById(this._layerInfos,this._selection))?this._selection.length:0;if(b.length){if(b=
d?this._selection[this._featureIdx]:null)d=b.getLayer().getEditCapabilities(),d.canCreate&&!d.canUpdate||this._showFeature(b);this._updateUI()}c=c||[];if(c.length){var l=this._rollbackInfo;p.forEach(c,function(b){var d=E.findFeatures(c,a.featureLayer)[0];if(!b.success&&d.attributes[a.featureLayer.objectIdField]===b.objectId&&l){var e=l.field;b=l.graphic.attributes[e.name];var f=p.filter(this._currentLInfo.fieldInfos,function(a){return a.fieldName===e.name},this)[0].dijit;d.attributes[e.name]=b;"esriFieldTypeDate"===
e.type&&(b=new Date(b));this._setValue(f,b)}},this)}this._rollbackInfo=null},onFieldValueChange:function(a,b){var c=a.field,d=a.dijit,e=this._currentFeature,f=this._currentLInfo,l=c.name,g;if(""===d.displayedValue||"dijit.form.ValidationTextBox"!==d.declaredClass||d.isValid())if(""!==d.displayedValue&&d.displayedValue!==b&&d.isValid&&!d.isValid())this._setValue(d,e.attributes[c.name]);else{if(g=!("esriFieldTypeInteger"!==c.type&&"esriFieldTypeSmallInteger"!==c.type&&"esriFieldTypeSingle"!==c.type&&
"esriFieldTypeDouble"!==c.type),b=""===b&&g||"undefined"===typeof b?null:b,g&&null!==b&&(b=Number(b)),"esriFieldTypeDate"===c.type&&(d instanceof Array?(g=d[0].getValue(),d=d[1].getValue(),b=g&&d?new Date(g.getFullYear(),g.getMonth(),g.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds()):g||d||null):(b=d.getValue(),c.domain&&(b=Number(b))),b=b&&b.getTime?b.getTime():b&&b.toGregorian?b.toGregorian().getTime():b),this._currentFeature.attributes[c.name]!==b){if(l===f.typeIdField){var k=
this._findFirst(f.types,"id",b);p.forEach(f.fieldInfos,function(a){(c=a.field)&&c.name!==f.typeIdField&&(a=a.dijit,this._setFieldDomain(a,k,c)&&a&&(this._setValue(a,e.attributes[c.name]+""),!1===a.isValid()&&this._setValue(a,null)))},this)}this.onAttributeChange(e,l,b)}}else this._setValue(d,e.attributes[c.name])},onDeleteBtn:function(a){this._deleteFeature()},onNextFeature:function(a){this._onNextFeature(1)},onPreviousFeature:function(a){this._onNextFeature(-1)},onFirstFeature:function(a){this._onNextFeature(-1*
this._featureIdx)},onLastFeature:function(a){this._onNextFeature(this._numFeatures-1-this._featureIdx)},_initLayerInfos:function(){var a=this._layerInfos;this._editorTrackingInfos={};p.forEach(a,this._initLayerInfo,this)},_initLayerInfo:function(b){var c=b.featureLayer,d,e;this._userIds={};e=c.id;c.credential&&(this._userIds[e]=c.credential.userId);b.userId&&(this._userIds[e]=b.userId);this._connect(c,"onSelectionComplete",n.hitch(this,"onLayerSelectionChange",b));this._connect(c,"onSelectionClear",
n.hitch(this,"onLayerSelectionClear",b));this._connect(c,"onEditsComplete",n.hitch(this,"onLayerEditsComplete",b));this._connect(c,"error",n.hitch(this,"onLayerError",b));this._connect(c,"onUpdateEnd",n.hitch(this,"onLayerUpdateEnd",b));b.showAttachments=c.hasAttachments?a.isDefined(b.showAttachments)?b.showAttachments:!0:!1;b.hideFields=b.hideFields||[];b.htmlFields=b.htmlFields||[];b.isEditable=c.isEditable()?a.isDefined(b.isEditable)?b.isEditable:!0:!1;b.typeIdField=c.typeIdField;b.layerId=c.id;
b.types=c.types;c.globalIdField&&((d=this._findFirst(b.fieldInfos,"fieldName",c.globalIdField))||b.showGlobalID||b.hideFields.push(c.globalIdField));(e=this._findFirst(b.fieldInfos,"fieldName",c.objectIdField))||b.showObjectID||b.hideFields.push(c.objectIdField);var f=this._getFields(b.featureLayer);if(f){var l=b.fieldInfos||[],l=p.map(l,function(a){return n.mixin({},a)});l.length?b.fieldInfos=p.filter(p.map(l,n.hitch(this,function(a){var c=a.stringFieldOption||(this._isInFields(a.fieldName,b.htmlFields)?
L.STRING_FIELD_OPTION_RICHTEXT:L.STRING_FIELD_OPTION_TEXTBOX);return n.mixin(a,{field:this._findFirst(f,"name",a.fieldName),stringFieldOption:c})})),"return item.field;"):(f=p.filter(f,n.hitch(this,function(a){return!this._isInFields(a.name,b.hideFields)})),b.fieldInfos=p.map(f,n.hitch(this,function(a){var c=this._isInFields(a.name,b.htmlFields)?L.STRING_FIELD_OPTION_RICHTEXT:L.STRING_FIELD_OPTION_TEXTBOX;return{fieldName:a.name,field:a,stringFieldOption:c}})));b.showGlobalID&&!d&&l.push(this._findFirst(f,
"name",c.globalIdField));b.showObjectID&&!e&&l.push(this._findFirst(f,"name",c.objectIdField));d=[];c.editFieldsInfo&&(c.editFieldsInfo.creatorField&&d.push(c.editFieldsInfo.creatorField),c.editFieldsInfo.creationDateField&&d.push(c.editFieldsInfo.creationDateField),c.editFieldsInfo.editorField&&d.push(c.editFieldsInfo.editorField),c.editFieldsInfo.editDateField&&d.push(c.editFieldsInfo.editDateField));this._editorTrackingInfos[c.id]=d}},_createAttachmentEditor:function(){this._attachmentEditor=null;
var a=p.filter(this._layerInfos,function(a){return a.showAttachments});a&&a.length&&(this._attachmentEditor=new z({"class":this.css.attachmentEditor},this.attachmentEditor),this._attachmentEditor.startup())},_setCurrentLInfo:function(a){var b=this._currentLInfo?this._currentLInfo.featureLayer:null,c=a.featureLayer;if(b&&b.id===c.id&&!b.ownershipBasedAccessControlForFeatures&&(b=c.getEditCapabilities(),!b.canCreate||b.canUpdate))return;this._currentLInfo=a;this._createTable()},_updateSelection:function(a,
b){this._selection=a||[];p.forEach(this._layerInfos,this._getSelection,this);this._selection=E.sortFeaturesById(this._layerInfos,this._selection);this._numFeatures=this._selection.length;this._showFeature(this._numFeatures?this._selection[this._featureIdx]:null,b)},_getSelection:function(a){a=a.featureLayer.getSelectedFeatures();this._selection=this._selection.concat(a)},_updateUI:function(){var b=this._numFeatures,c=this._currentLInfo;this.layerName.innerHTML=c&&0!==b?c.featureLayer?c.featureLayer.name:
"":this.NLS_noFeaturesSelected;d.set(this.attributeTable,"display",b?"":"none");d.set(this.editButtons,"display",b?"":"none");d.set(this.navButtons,"display",!this._hideNavButtons&&1<b?"":"none");this.navMessage.innerHTML=a.substitute({idx:this._featureIdx+1,of:this.NLS_of,numFeatures:this._numFeatures},this._navMessage);this._attachmentEditor&&d.set(this._attachmentEditor.domNode,"display",c&&c.showAttachments&&b?"":"none");d.set(this.deleteBtn.domNode,"display",c&&!1===c.showDeleteButton||!this._canDelete?
"none":"");this.domNode.parentNode&&0<this.domNode.parentNode.scrollTop&&(this.domNode.parentNode.scrollTop=0)},_onNextFeature:function(a){this._featureIdx+=a;0>this._featureIdx?this._featureIdx=this._numFeatures-1:this._featureIdx>=this._numFeatures&&(this._featureIdx=0);a=this._selection.length?this._selection[this._featureIdx]:null;this._showFeature(a);this._updateUI();this.onNext(a)},_deleteFeature:function(){this.onDelete(this._currentFeature)},_showFeature:function(b,c){if(b){this._currentFeature=
b;var d=c?c:b.getLayer(),e=d.getEditCapabilities({feature:b,userId:this._userIds[d.id]});this._canUpdate=e.canUpdate;this._canDelete=e.canDelete;if(e=this._getLInfoFromFeatureLayer(d)){this._setCurrentLInfo(e);var f=b.attributes,g=this._findFirst(e.types,"id",f[e.typeIdField]),k=null;p.forEach(e.fieldInfos,function(b){k=b.field;var c=[];b.dijit&&1<b.dijit.length?p.forEach(b.dijit,function(a){c.push(a)}):c.push(b.dijit);p.forEach(c,n.hitch(this,function(b){if(b){var c=this._setFieldDomain(b,g,k),d=
f[k.name],d=d&&c&&c.codedValues&&c.codedValues.length?c.codedValues[d]?c.codedValues[d].name:d:d;a.isDefined(d)||(d="");"dijit.form.DateTextBox"===b.declaredClass||"dijit.form.TimeTextBox"===b.declaredClass?d=""===d?null:new Date(d):"dijit.form.FilteringSelect"===b.declaredClass&&(b._lastValueReported=null,d=f[k.name]+"");try{this._setValue(b,d),"dijit.form.FilteringSelect"===b.declaredClass&&!1===b.isValid()&&this._setValue(b,null)}catch(H){b.set("displayedValue",this.NLS_errorInvalid,!1)}}}))},
this);this._attachmentEditor&&e.showAttachments&&this._attachmentEditor.showAttachments(this._currentFeature,d);(d=d.getEditSummary(b))?(this.editorTrackingInfoDiv.innerHTML=d,l.show(this.editorTrackingInfoDiv)):l.hide(this.editorTrackingInfoDiv)}}},_setFieldDomain:function(b,c,d){if(!b)return null;var e=d.domain;c&&c.domains&&c.domains[d.name]&&!1===c.domains[d.name]instanceof t&&(e=c.domains[d.name]);if(!e)return null;e.codedValues&&0<e.codedValues.length?(b.set("store",this._toStore(p.map(e.codedValues,
function(a){return{id:a.code+="",name:a.name}}))),this._setValue(b,e.codedValues[0].code)):(b.constraints={min:a.isDefined(e.minValue)?e.minValue:Number.MIN_VALUE,max:a.isDefined(e.maxValue)?e.maxValue:Number.MAX_VALUE},this._setValue(b,b.constraints.min));return e},_setValue:function(a,b){a.set&&(a._onChangeActive=!1,a.set("value",b,!0),a._onChangeActive=!0)},_getFields:function(b){var c=b._getOutFields();if(!c)return null;b=b.fields;return"*"==c?b:p.filter(p.map(c,n.hitch(this,"_findFirst",b,"name")),
a.isDefined)},_isInFields:function(a,b){return a&&(b||b.length)?p.some(b,function(b){return b.toLowerCase()===a.toLowerCase()}):!1},_isFieldNullable:function(a,b){return!(!1===a.nullable||b.field&&!1===b.field.nullable)},_isFieldRequired:function(a,b){return!1!==a.editable&&!1!==b.isEditable&&!this._isFieldNullable(a,b)},_findFirst:function(a,b,c){return(a=p.filter(a,function(a){return a.hasOwnProperty(b)&&a[b]===c}))&&a.length?a[0]:null},_getLInfoFromFeatureLayer:function(a){return this._findFirst(this._layerInfos,
"layerId",a?a.id:null)},_createTable:function(){this._destroyAttributeTable();this.attributeTable.innerHTML="";this._attributes=g.create("table",{cellspacing:"0",cellpadding:"0"},this.attributeTable);var a=g.create("tbody",null,this._attributes),b=this._currentLInfo,c=this._findFirst(b.types,"id",this._currentFeature.attributes[b.typeIdField]);p.forEach(b.fieldInfos,n.hitch(this,"_createField",c,a),this);this._createOnlyFirstTime=!1},_createField:function(a,b,c){var d=this._currentLInfo,e=c.field;
if(!this._isInFields(e.name,d.hideFields)&&!this._isInFields(e.name,this._editorTrackingInfos[d.featureLayer.id])){var f=!1,l,k,h;b=g.create("tr",null,b);l=g.create("td",{innerHTML:c.label||e.alias||e.name,"class":this.css.label,"data-fieldname":e.name},b);this._isFieldRequired(e,c)&&g.create("span",{"class":this.css.red,innerHTML:" *"},l);b=g.create("td",null,b);if(c.customField)g.place(c.customField.domNode||c.customField,g.create("div",null,b),"first"),k=c.customField;else if(!1===d.isEditable||
!1===e.editable||!1===c.isEditable||"esriFieldTypeOID"===e.type||"esriFieldTypeGlobalID"===e.type||!this._canUpdate&&!this._createOnlyFirstTime)f=!0;d=d.typeIdField&&e.name.toLowerCase()==d.typeIdField.toLowerCase();l=!!this._getDomainForField(e,a);!k&&d?k=this._createTypeField(e,c,b):!k&&l&&(k=this._createDomainField(e,c,a,b));if(!k)switch(e.type){case "esriFieldTypeString":k=this._createStringField(e,c,b);break;case "esriFieldTypeDate":k=this._createDateField(e,c,b);c.format&&c.format.time&&(h=
this._createTimeField(e,c,b));break;case "esriFieldTypeInteger":case "esriFieldTypeSmallInteger":k=this._createIntField(e,c,b);break;case "esriFieldTypeSingle":case "esriFieldTypeDouble":k=this._createFltField(e,c,b);break;default:k=this._createStringField(e,c,b)}c.tooltip&&c.tooltip.length&&this._toolTips.push(new W({connectId:[k.id],label:c.tooltip}));k.onChange=n.hitch(this,"onFieldValueChange",c);k.set("disabled",f);h?(c.dijit=[k,h],h.onChange=n.hitch(this,"onFieldValueChange",c),h.set("disabled",
f)):c.dijit=k}},_createTypeField:function(a,b,c){c=g.create("div",null,c);var d=a.domain;return d&&"range"===d.type&&d.minValue===d.maxValue?new U({"class":this.css.field,trim:!0,maxLength:a.length,name:a.alias||a.name,required:this._isFieldRequired(a,b)},c):new I({"class":this.css.field,name:a.alias||a.name,required:this._isFieldRequired(a,b),store:this._toStore(p.map(this._currentLInfo.types,function(a){return{id:a.id,name:a.name}})),searchAttr:"name"},c)},_getDomainForField:function(a,b){var c=
a.domain,d=a.name;d&&b&&b.domains&&b.domains[d]&&!1===b.domains[d]instanceof t&&(c=b.domains[d]);return c||null},_createDomainField:function(a,b,c,d){c=this._getDomainForField(a,c);d=g.create("div",null,d);return c.codedValues?new I({"class":this.css.field,name:a.alias||a.name,searchAttr:"name",required:this._isFieldRequired(a,b)},d):new N({"class":this.css.field},d)},_createStringField:function(a,b,c){c=g.create("div",null,c);var d={trim:!0,maxLength:a.length,required:this._isFieldRequired(a,b)};
if(b.stringFieldOption===L.STRING_FIELD_OPTION_TEXTAREA)return d["class"]=this.css.field+" "+this.css.textArea,new P(d,c);if(b.stringFieldOption===L.STRING_FIELD_OPTION_RICHTEXT)return d["class"]=this.css.field+" "+this.css.richText,d.height="100%",d.width="100%",d.plugins=b.richTextPlugins||this._defaultRichTextPlugins,c=new y(d,c),c.startup(),c;var e=this;d.validator=function(c,d){this._maskValidSubsetError=!1;this._hasBeenBlurred=!0;return e._isFieldNullable(a,b)||!(""===c||null===c)};return new U(d,
c)},_createTimeField:function(a,b,c){c=g.create("div",null,c);a={"class":this.css.field,trim:!0,required:this._isFieldRequired(a,b),constraints:{formatLength:"medium"}};this._datePackage&&(a.datePackage=this._datePackage);return new V(a,c)},_createDateField:function(a,b,c){c=g.create("div",null,c);a={"class":this.css.field,trim:!0,required:this._isFieldRequired(a,b)};this._datePackage&&(a.datePackage=this._datePackage);return new D(a,c)},_createIntField:function(a,b,c){c=g.create("div",null,c);return new G({"class":this.css.field,
constraints:"esriFieldTypeSmallInteger"===a.type?{min:-32768,max:32767,places:0}:{places:0},trim:!0,invalidMessage:this.NLS_validationInt,required:this._isFieldRequired(a,b)},c)},_createFltField:function(a,b,c){c=g.create("div",null,c);return new G({"class":this.css.field,constraints:{max:Infinity,min:-Infinity,places:"0,20"},trim:!0,invalidMessage:this.NLS_validationFlt,required:this._isFieldRequired(a,b)},c)},_toStore:function(a){return new R({data:{identifier:"id",label:"name",items:a}})},_connect:function(a,
b,c){this._aiConnects.push(m.connect(a,b,c))},_getDatePackage:function(a){return null===a.datePackage?null:a.datePackage?a.datePackage:"ar"===e.locale?"dojox.date.islamic":null},_destroyAttributeTable:function(){p.forEach(this._layerInfos,function(a){p.forEach(a.fieldInfos,function(a){var b=a.dijit;if(b){b._onChangeHandle=null;if(a.customField)return;b instanceof Array?p.forEach(b,n.hitch(this,function(a){a.destroyRecursive?a.destroyRecursive():a.destroy&&a.destroy();a._onChangeHandle=null})):b.destroyRecursive?
b.destroyRecursive():b.destroy&&b.destroy()}a.dijit=null},this)},this);p.forEach(this._toolTips,function(a){a.destroy()});this._toolTips=[];this._attributes&&g.destroy(this._attributes)}});n.mixin(L,{STRING_FIELD_OPTION_RICHTEXT:"richtext",STRING_FIELD_OPTION_TEXTAREA:"textarea",STRING_FIELD_OPTION_TEXTBOX:"textbox"});k("extend-esri")&&n.setObject("dijit.AttributeInspector",L,c);return L})},"dijit/Editor":function(){define("require dojo/_base/array dojo/_base/declare dojo/Deferred dojo/i18n dojo/dom-attr dojo/dom-class dojo/dom-geometry dojo/dom-style dojo/keys dojo/_base/lang dojo/sniff dojo/string dojo/topic ./_Container ./Toolbar ./ToolbarSeparator ./layout/_LayoutWidget ./form/ToggleButton ./_editor/_Plugin ./_editor/plugins/EnterKeyHandling ./_editor/html ./_editor/range ./_editor/RichText ./main dojo/i18n!./_editor/nls/commands".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A,y,B,x,w,z,E){function C(a){return new y({command:a.name})}function D(a){return new y({buttonClass:A,command:a.name})}p=p("dijit.Editor",z,{plugins:null,extraPlugins:null,constructor:function(){a.isArray(this.plugins)||(this.plugins=["undo","redo","|","cut","copy","paste","|","bold","italic","underline","strikethrough","|","insertOrderedList","insertUnorderedList","indent","outdent","|","justifyLeft","justifyRight","justifyCenter","justifyFull",B]);this._plugins=
[];this._editInterval=1E3*this.editActionInterval;if(l("ie")||l("trident")||l("edge"))this.events.push("onBeforeDeactivate"),this.events.push("onBeforeActivate")},postMixInProperties:function(){this.setValueDeferred=new m;this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this._steps=this._steps.slice(0);this._undoedSteps=this._undoedSteps.slice(0);a.isArray(this.extraPlugins)&&(this.plugins=this.plugins.concat(this.extraPlugins));this.commands=h.getLocalization("dijit._editor",
"commands",this.lang);l("webkit")&&g.set(this.domNode,"KhtmlUserSelect","none")},startup:function(){this.inherited(arguments);this.toolbar||(this.toolbar=new b({ownerDocument:this.ownerDocument,dir:this.dir,lang:this.lang,"aria-label":this.id}),this.header.appendChild(this.toolbar.domNode));n.forEach(this.plugins,this.addPlugin,this);this.setValueDeferred.resolve(!0);k.add(this.iframe.parentNode,"dijitEditorIFrameContainer");k.add(this.iframe,"dijitEditorIFrame");e.set(this.iframe,"allowTransparency",
!0);this.toolbar.startup();this.onNormalizedDisplayChanged()},destroy:function(){n.forEach(this._plugins,function(a){a&&a.destroy&&a.destroy()});this._plugins=[];this.toolbar.destroyRecursive();delete this.toolbar;this.inherited(arguments)},addPlugin:function(b,c){var d=a.isString(b)?{name:b}:a.isFunction(b)?{ctor:b}:b;if(!d.setEditor){var e={args:d,plugin:null,editor:this};d.name&&(y.registry[d.name]?e.plugin=y.registry[d.name](d):v.publish(E._scopeName+".Editor.getPlugin",e));if(!e.plugin)try{var f=
d.ctor||a.getObject(d.name)||r(d.name);f&&(e.plugin=new f(d))}catch(P){throw Error(this.id+": cannot find plugin ["+d.name+"]");}if(!e.plugin)throw Error(this.id+": cannot find plugin ["+d.name+"]");b=e.plugin}1<arguments.length?this._plugins[c]=b:this._plugins.push(b);b.setEditor(this);a.isFunction(b.setToolbar)&&b.setToolbar(this.toolbar)},resize:function(a){a&&u.prototype.resize.apply(this,arguments)},layout:function(){var a=this._contentBox.h-(this.getHeaderHeight()+this.getFooterHeight()+d.getPadBorderExtents(this.iframe.parentNode).h+
d.getMarginExtents(this.iframe.parentNode).h);this.editingArea.style.height=a+"px";this.iframe&&(this.iframe.style.height="100%");this._layoutMode=!0},_onIEMouseDown:function(a){var b,c=this.document.body,d=c.clientWidth,e=c.clientHeight,f=c.clientLeft,l=c.offsetWidth,g=c.offsetHeight,k=c.offsetLeft;/^rtl$/i.test(c.dir||"")?d<l&&a.x>d&&a.x<l&&(b=!0):a.x<f&&a.x>k&&(b=!0);b||e<g&&a.y>e&&a.y<g&&(b=!0);b||(delete this._cursorToStart,delete this._savedSelection,"BODY"==a.target.tagName&&this.defer("placeCursorAtEnd"),
this.inherited(arguments))},onBeforeActivate:function(){this._restoreSelection()},onBeforeDeactivate:function(a){this.customUndo&&this.endEditing(!0);"BODY"!=a.target.tagName&&this._saveSelection()},customUndo:!0,editActionInterval:3,beginEditing:function(a){this._inEditing||(this._inEditing=!0,this._beginEditing(a));0<this.editActionInterval&&(this._editTimer&&this._editTimer.remove(),this._editTimer=this.defer("endEditing",this._editInterval))},_steps:[],_undoedSteps:[],execCommand:function(a){if(!this.customUndo||
"undo"!=a&&"redo"!=a){this.customUndo&&(this.endEditing(),this._beginEditing());var b=this.inherited(arguments);this.customUndo&&this._endEditing();return b}return this[a]()},_pasteImpl:function(){return this._clipboardCommand("paste")},_cutImpl:function(){return this._clipboardCommand("cut")},_copyImpl:function(){return this._clipboardCommand("copy")},_clipboardCommand:function(a){var b;try{if(b=this.document.execCommand(a,!1,null),l("webkit")&&!b)throw{};}catch(I){b=t.substitute,alert(b(this.commands.systemShortcut,
[this.commands[a],b(this.commands[l("mac")?"appleKey":"ctrlKey"],[{cut:"X",copy:"C",paste:"V"}[a]])])),b=!1}return b},queryCommandEnabled:function(a){return!this.customUndo||"undo"!=a&&"redo"!=a?this.inherited(arguments):"undo"==a?1<this._steps.length:0<this._undoedSteps.length},_moveToBookmark:function(b){var c=b.mark,d=b.mark;b=b.isCollapsed;var e,f,g;d&&(9>l("ie")||9===l("ie")&&l("quirks")?a.isArray(d)?(c=[],n.forEach(d,function(a){c.push(w.getNode(a,this.editNode))},this),this.selection.moveToBookmark({mark:c,
isCollapsed:b})):d.startContainer&&d.endContainer&&(g=w.getSelection(this.window))&&g.removeAllRanges&&(g.removeAllRanges(),b=w.create(this.window),e=w.getNode(d.startContainer,this.editNode),f=w.getNode(d.endContainer,this.editNode),e&&f&&(b.setStart(e,d.startOffset),b.setEnd(f,d.endOffset),g.addRange(b))):(g=w.getSelection(this.window))&&g.removeAllRanges&&(g.removeAllRanges(),b=w.create(this.window),e=w.getNode(d.startContainer,this.editNode),f=w.getNode(d.endContainer,this.editNode),e&&f&&(b.setStart(e,
d.startOffset),b.setEnd(f,d.endOffset),g.addRange(b))))},_changeToStep:function(a,b){this.setValue(b.text);var c=b.bookmark;c&&this._moveToBookmark(c)},undo:function(){var a=!1;if(!this._undoRedoActive){this._undoRedoActive=!0;this.endEditing(!0);var b=this._steps.pop();b&&0<this._steps.length&&(this.focus(),this._changeToStep(b,this._steps[this._steps.length-1]),this._undoedSteps.push(b),this.onDisplayChanged(),delete this._undoRedoActive,a=!0);delete this._undoRedoActive}return a},redo:function(){var a=
!1;if(!this._undoRedoActive){this._undoRedoActive=!0;this.endEditing(!0);var b=this._undoedSteps.pop();b&&0<this._steps.length&&(this.focus(),this._changeToStep(this._steps[this._steps.length-1],b),this._steps.push(b),this.onDisplayChanged(),a=!0);delete this._undoRedoActive}return a},endEditing:function(a){this._editTimer&&(this._editTimer=this._editTimer.remove());this._inEditing&&(this._endEditing(a),this._inEditing=!1)},_getBookmark:function(){var b=this.selection.getBookmark(),c=[];if(b&&b.mark){var d=
b.mark;if(9>l("ie")||9===l("ie")&&l("quirks")){var e=w.getSelection(this.window);if(a.isArray(d))n.forEach(b.mark,function(a){c.push(w.getIndex(a,this.editNode).o)},this),b.mark=c;else if(e){var f;e.rangeCount&&(f=e.getRangeAt(0));b.mark=f?f.cloneRange():this.selection.getBookmark()}}try{b.mark&&b.mark.startContainer&&(c=w.getIndex(b.mark.startContainer,this.editNode).o,b.mark={startContainer:c,startOffset:b.mark.startOffset,endContainer:b.mark.endContainer===b.mark.startContainer?c:w.getIndex(b.mark.endContainer,
this.editNode).o,endOffset:b.mark.endOffset})}catch(P){b.mark=null}}return b},_beginEditing:function(){0===this._steps.length&&this._steps.push({text:x.getChildrenHtml(this.editNode),bookmark:this._getBookmark()})},_endEditing:function(){var a=x.getChildrenHtml(this.editNode);this._undoedSteps=[];this._steps.push({text:a,bookmark:this._getBookmark()})},onKeyDown:function(a){l("ie")||this.iframe||a.keyCode!=c.TAB||this.tabIndent||this._saveSelection();if(this.customUndo){var b=a.keyCode;if(a.ctrlKey&&
!a.shiftKey&&!a.altKey){if(90==b||122==b){a.stopPropagation();a.preventDefault();this.undo();return}if(89==b||121==b){a.stopPropagation();a.preventDefault();this.redo();return}}this.inherited(arguments);switch(b){case c.ENTER:case c.BACKSPACE:case c.DELETE:this.beginEditing();break;case 88:case 86:if(a.ctrlKey&&!a.altKey&&!a.metaKey){this.endEditing();88==a.keyCode?this.beginEditing("cut"):this.beginEditing("paste");this.defer("endEditing",1);break}default:if(!a.ctrlKey&&!a.altKey&&!a.metaKey&&(a.keyCode<
c.F1||a.keyCode>c.F15)){this.beginEditing();break}case c.ALT:this.endEditing();break;case c.UP_ARROW:case c.DOWN_ARROW:case c.LEFT_ARROW:case c.RIGHT_ARROW:case c.HOME:case c.END:case c.PAGE_UP:case c.PAGE_DOWN:this.endEditing(!0);case c.CTRL:case c.SHIFT:case c.TAB:}}else this.inherited(arguments)},_onBlur:function(){this.inherited(arguments);this.endEditing(!0)},_saveSelection:function(){try{this._savedSelection=this._getBookmark()}catch(F){}},_restoreSelection:function(){this._savedSelection&&
(delete this._cursorToStart,this.selection.isCollapsed()&&this._moveToBookmark(this._savedSelection),delete this._savedSelection)},onClick:function(){this.endEditing(!0);this.inherited(arguments)},replaceValue:function(a){this.customUndo?this.isClosed?this.setValue(a):(this.beginEditing(),a||(a="\x26#160;"),this.setValue(a),this.endEditing()):this.inherited(arguments)},_setDisabledAttr:function(b){this.setValueDeferred.then(a.hitch(this,function(){!this.disabled&&b||!this._buttonEnabledPlugins&&b?
n.forEach(this._plugins,function(a){a.set("disabled",!0)}):this.disabled&&!b&&n.forEach(this._plugins,function(a){a.set("disabled",!1)})}));this.inherited(arguments)},_setStateClass:function(){try{this.inherited(arguments),this.document&&this.document.body&&g.set(this.document.body,"color",g.get(this.iframe,"color"))}catch(F){}}});a.mixin(y.registry,{undo:C,redo:C,cut:C,copy:C,paste:C,insertOrderedList:C,insertUnorderedList:C,indent:C,outdent:C,justifyCenter:C,justifyFull:C,justifyLeft:C,justifyRight:C,
"delete":C,selectAll:C,removeFormat:C,unlink:C,insertHorizontalRule:C,bold:D,italic:D,underline:D,strikethrough:D,subscript:D,superscript:D,"|":function(){return new y({setEditor:function(a){this.editor=a;this.button=new q({ownerDocument:a.ownerDocument})}})}});return p})},"dijit/Toolbar":function(){define("require dojo/_base/declare dojo/has dojo/keys dojo/ready ./_Widget ./_KeyNavContainer ./_TemplatedMixin".split(" "),function(r,n,p,m,h,e,k,d){p("dijit-legacy-requires")&&h(0,function(){r(["dijit/ToolbarSeparator"])});
return n("dijit.Toolbar",[e,d,k],{templateString:'\x3cdiv class\x3d"dijit" role\x3d"toolbar" tabIndex\x3d"${tabIndex}" data-dojo-attach-point\x3d"containerNode"\x3e\x3c/div\x3e',baseClass:"dijitToolbar",_onLeftArrow:function(){this.focusPrev()},_onRightArrow:function(){this.focusNext()}})})},"dijit/ToolbarSeparator":function(){define(["dojo/_base/declare","dojo/dom","./_Widget","./_TemplatedMixin"],function(r,n,p,m){return r("dijit.ToolbarSeparator",[p,m],{templateString:'\x3cdiv class\x3d"dijitToolbarSeparator dijitInline" role\x3d"presentation"\x3e\x3c/div\x3e',
buildRendering:function(){this.inherited(arguments);n.setSelectable(this.domNode,!1)},isFocusable:function(){return!1}})})},"dijit/layout/_LayoutWidget":function(){define("dojo/_base/lang ../_Widget ../_Container ../_Contained ../Viewport dojo/_base/declare dojo/dom-class dojo/dom-geometry dojo/dom-style".split(" "),function(r,n,p,m,h,e,k,d,g){return e("dijit.layout._LayoutWidget",[n,p,m],{baseClass:"dijitLayoutContainer",isLayoutContainer:!0,_setTitleAttr:null,buildRendering:function(){this.inherited(arguments);
k.add(this.domNode,"dijitContainer")},startup:function(){if(!this._started){this.inherited(arguments);var c=this.getParent&&this.getParent();c&&c.isLayoutContainer||(this.resize(),this.own(h.on("resize",r.hitch(this,"resize"))))}},resize:function(c,a){var e=this.domNode;c&&d.setMarginBox(e,c);var k=a||{};r.mixin(k,c||{});"h"in k&&"w"in k||(k=r.mixin(d.getMarginBox(e),k));var h=g.getComputedStyle(e),f=d.getMarginExtents(e,h),b=d.getBorderExtents(e,h),k=this._borderBox={w:k.w-(f.w+b.w),h:k.h-(f.h+b.h)},
f=d.getPadExtents(e,h);this._contentBox={l:g.toPixelValue(e,h.paddingLeft),t:g.toPixelValue(e,h.paddingTop),w:k.w-f.w,h:k.h-f.h};this.layout()},layout:function(){},_setupChild:function(c){k.add(c.domNode,this.baseClass+"-child "+(c.baseClass?this.baseClass+"-"+c.baseClass:""))},addChild:function(c,a){this.inherited(arguments);this._started&&this._setupChild(c)},removeChild:function(c){k.remove(c.domNode,this.baseClass+"-child"+(c.baseClass?" "+this.baseClass+"-"+c.baseClass:""));this.inherited(arguments)}})})},
"dijit/form/ToggleButton":function(){define(["dojo/_base/declare","dojo/_base/kernel","./Button","./_ToggleButtonMixin"],function(r,n,p,m){return r("dijit.form.ToggleButton",[p,m],{baseClass:"dijitToggleButton",setChecked:function(h){n.deprecated("setChecked("+h+") is deprecated. Use set('checked',"+h+") instead.","","2.0");this.set("checked",h)}})})},"dijit/form/Button":function(){define("require dojo/_base/declare dojo/dom-class dojo/has dojo/_base/kernel dojo/_base/lang dojo/ready ./_FormWidget ./_ButtonMixin dojo/text!./templates/Button.html ../a11yclick".split(" "),
function(r,n,p,m,h,e,k,d,g,c){m("dijit-legacy-requires")&&k(0,function(){r(["dijit/form/DropDownButton","dijit/form/ComboButton","dijit/form/ToggleButton"])});k=n("dijit.form.Button"+(m("dojo-bidi")?"_NoBidi":""),[d,g],{showLabel:!0,iconClass:"dijitNoIcon",_setIconClassAttr:{node:"iconNode",type:"class"},baseClass:"dijitButton",templateString:c,_setValueAttr:"valueNode",_setNameAttr:function(a){this.valueNode&&this.valueNode.setAttribute("name",a)},postCreate:function(){this.inherited(arguments);
this._setLabelFromContainer()},_setLabelFromContainer:function(){this.containerNode&&!this.label&&(this.label=e.trim(this.containerNode.innerHTML),this.onLabelSet())},_setShowLabelAttr:function(a){this.containerNode&&p.toggle(this.containerNode,"dijitDisplayNone",!a);this._set("showLabel",a)},setLabel:function(a){h.deprecated("dijit.form.Button.setLabel() is deprecated.  Use set('label', ...) instead.","","2.0");this.set("label",a)},onLabelSet:function(){this.inherited(arguments);this.showLabel||
"title"in this.params||(this.titleNode.title=e.trim(this.containerNode.innerText||this.containerNode.textContent||""))}});m("dojo-bidi")&&(k=n("dijit.form.Button",k,{onLabelSet:function(){this.inherited(arguments);this.titleNode.title&&this.applyTextDir(this.titleNode,this.titleNode.title)},_setTextDirAttr:function(a){this._created&&this.textDir!=a&&(this._set("textDir",a),this._setLabelAttr(this.label))}}));return k})},"dijit/form/_FormWidget":function(){define("dojo/_base/declare dojo/sniff dojo/_base/kernel dojo/ready ../_Widget ../_CssStateMixin ../_TemplatedMixin ./_FormWidgetMixin".split(" "),
function(r,n,p,m,h,e,k,d){n("dijit-legacy-requires")&&m(0,function(){require(["dijit/form/_FormValueWidget"])});return r("dijit.form._FormWidget",[h,k,e,d],{setDisabled:function(d){p.deprecated("setDisabled("+d+") is deprecated. Use set('disabled',"+d+") instead.","","2.0");this.set("disabled",d)},setValue:function(d){p.deprecated("dijit.form._FormWidget:setValue("+d+") is deprecated.  Use set('value',"+d+") instead.","","2.0");this.set("value",d)},getValue:function(){p.deprecated(this.declaredClass+
"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},postMixInProperties:function(){this.nameAttrSetting=this.name&&!n("msapp")?'name\x3d"'+this.name.replace(/"/g,"\x26quot;")+'"':"";this.inherited(arguments)}})})},"dijit/form/_FormWidgetMixin":function(){define("dojo/_base/array dojo/_base/declare dojo/dom-attr dojo/dom-style dojo/_base/lang dojo/mouse dojo/on dojo/sniff dojo/window ../a11y".split(" "),function(r,n,p,m,h,e,k,d,g,c){return n("dijit.form._FormWidgetMixin",
null,{name:"",alt:"",value:"",type:"text","aria-label":"focusNode",tabIndex:"0",_setTabIndexAttr:"focusNode",disabled:!1,intermediateChanges:!1,scrollOnFocus:!0,_setIdAttr:"focusNode",_setDisabledAttr:function(a){this._set("disabled",a);/^(button|input|select|textarea|optgroup|option|fieldset)$/i.test(this.focusNode.tagName)?p.set(this.focusNode,"disabled",a):this.focusNode.setAttribute("aria-disabled",a?"true":"false");this.valueNode&&p.set(this.valueNode,"disabled",a);a?(this._set("hovering",!1),
this._set("active",!1),a="tabIndex"in this.attributeMap?this.attributeMap.tabIndex:"_setTabIndexAttr"in this?this._setTabIndexAttr:"focusNode",r.forEach(h.isArray(a)?a:[a],function(a){a=this[a];d("webkit")||c.hasDefaultTabStop(a)?a.setAttribute("tabIndex","-1"):a.removeAttribute("tabIndex")},this)):""!=this.tabIndex&&this.set("tabIndex",this.tabIndex)},_onFocus:function(a){if("mouse"==a&&this.isFocusable())var c=this.own(k(this.focusNode,"focus",function(){m.remove();c.remove()}))[0],e=d("pointer-events")?
"pointerup":d("MSPointer")?"MSPointerUp":d("touch-events")?"touchend, mouseup":"mouseup",m=this.own(k(this.ownerDocumentBody,e,h.hitch(this,function(a){m.remove();c.remove();this.focused&&("touchend"==a.type?this.defer("focus"):this.focus())})))[0];this.scrollOnFocus&&this.defer(function(){g.scrollIntoView(this.domNode)});this.inherited(arguments)},isFocusable:function(){return!this.disabled&&this.focusNode&&"none"!=m.get(this.domNode,"display")},focus:function(){if(!this.disabled&&this.focusNode.focus)try{this.focusNode.focus()}catch(a){}},
compare:function(a,c){return"number"==typeof a&&"number"==typeof c?isNaN(a)&&isNaN(c)?0:a-c:a>c?1:a<c?-1:0},onChange:function(){},_onChangeActive:!1,_handleOnChange:function(a,c){void 0!=this._lastValueReported||null!==c&&this._onChangeActive||(this._resetValue=this._lastValueReported=a);this._pendingOnChange=this._pendingOnChange||typeof a!=typeof this._lastValueReported||0!=this.compare(a,this._lastValueReported);(this.intermediateChanges||c||void 0===c)&&this._pendingOnChange&&(this._lastValueReported=
a,this._pendingOnChange=!1,this._onChangeActive&&(this._onChangeHandle&&this._onChangeHandle.remove(),this._onChangeHandle=this.defer(function(){this._onChangeHandle=null;this.onChange(a)})))},create:function(){this.inherited(arguments);this._onChangeActive=!0},destroy:function(){this._onChangeHandle&&(this._onChangeHandle.remove(),this.onChange(this._lastValueReported));this.inherited(arguments)}})})},"dijit/form/_ButtonMixin":function(){define(["dojo/_base/declare","dojo/dom","dojo/has","../registry"],
function(r,n,p,m){var h=r("dijit.form._ButtonMixin"+(p("dojo-bidi")?"_NoBidi":""),null,{label:"",type:"button",__onClick:function(e){e.stopPropagation();e.preventDefault();this.disabled||this.valueNode.click(e);return!1},_onClick:function(e){if(this.disabled)return e.stopPropagation(),e.preventDefault(),!1;!1===this.onClick(e)&&e.preventDefault();var k=e.defaultPrevented;if(!k&&"submit"==this.type&&!(this.valueNode||this.focusNode).form)for(var d=this.domNode;d.parentNode;d=d.parentNode){var g=m.byNode(d);
if(g&&"function"==typeof g._onSubmit){g._onSubmit(e);e.preventDefault();k=!0;break}}return!k},postCreate:function(){this.inherited(arguments);n.setSelectable(this.focusNode,!1)},onClick:function(){return!0},_setLabelAttr:function(e){this._set("label",e);(this.containerNode||this.focusNode).innerHTML=e;this.onLabelSet()},onLabelSet:function(){}});p("dojo-bidi")&&(h=r("dijit.form._ButtonMixin",h,{onLabelSet:function(){this.inherited(arguments);this.applyTextDir(this.containerNode||this.focusNode)}}));
return h})},"dijit/form/_ToggleButtonMixin":function(){define(["dojo/_base/declare","dojo/dom-attr"],function(r,n){return r("dijit.form._ToggleButtonMixin",null,{checked:!1,_aria_attr:"aria-pressed",_onClick:function(n){var m=this.checked;this._set("checked",!m);var h=this.inherited(arguments);this.set("checked",h?this.checked:m);return h},_setCheckedAttr:function(p,m){this._set("checked",p);var h=this.focusNode||this.domNode;this._created&&n.get(h,"checked")!=!!p&&n.set(h,"checked",!!p);h.setAttribute(this._aria_attr,
String(p));this._handleOnChange(p,m)},postCreate:function(){this.inherited(arguments);var n=this.focusNode||this.domNode;this.checked&&n.setAttribute("checked","checked");void 0===this._resetValue&&(this._lastValueReported=this._resetValue=this.checked)},reset:function(){this._hasBeenBlurred=!1;this.set("checked",this.params.checked||!1)}})})},"dijit/_editor/_Plugin":function(){define(["dojo/_base/connect","dojo/_base/declare","dojo/_base/lang","../Destroyable","../form/Button"],function(r,n,p,m,
h){n=n("dijit._editor._Plugin",m,{constructor:function(e){this.params=e||{};p.mixin(this,this.params);this._attrPairNames={}},editor:null,iconClassPrefix:"dijitEditorIcon",button:null,command:"",useDefaultCommand:!0,buttonClass:h,disabled:!1,getLabel:function(e){return this.editor.commands[e]},_initButton:function(){if(this.command.length){var e=this.getLabel(this.command),k=this.editor,d=this.iconClassPrefix+" "+this.iconClassPrefix+this.command.charAt(0).toUpperCase()+this.command.substr(1);this.button||
(e=p.mixin({label:e,ownerDocument:k.ownerDocument,dir:k.dir,lang:k.lang,showLabel:!1,iconClass:d,dropDown:this.dropDown,tabIndex:"-1"},this.params||{}),delete e.name,this.button=new this.buttonClass(e))}this.get("disabled")&&this.button&&this.button.set("disabled",this.get("disabled"))},destroy:function(){this.dropDown&&this.dropDown.destroyRecursive();this.inherited(arguments)},connect:function(e,k,d){this.own(r.connect(e,k,this,d))},updateState:function(){var e=this.editor,k=this.command,d,g;if(e&&
e.isLoaded&&k.length){var c=this.get("disabled");if(this.button)try{g=!c&&e.queryCommandEnabled(k),this.enabled!==g&&(this.enabled=g,this.button.set("disabled",!g)),g&&"boolean"==typeof this.button.checked&&(d=e.queryCommandState(k),this.checked!==d&&(this.checked=d,this.button.set("checked",e.queryCommandState(k))))}catch(a){console.log(a)}}},setEditor:function(e){this.editor=e;this._initButton();this.button&&this.useDefaultCommand&&(this.editor.queryCommandAvailable(this.command)?this.own(this.button.on("click",
p.hitch(this.editor,"execCommand",this.command,this.commandArg))):this.button.domNode.style.display="none");this.own(this.editor.on("NormalizedDisplayChanged",p.hitch(this,"updateState")))},setToolbar:function(e){this.button&&e.addChild(this.button)},set:function(e,k){if("object"===typeof e){for(var d in e)this.set(d,e[d]);return this}d=this._getAttrNames(e);if(this[d.s])var g=this[d.s].apply(this,Array.prototype.slice.call(arguments,1));else this._set(e,k);return g||this},get:function(e){var k=this._getAttrNames(e);
return this[k.g]?this[k.g]():this[e]},_setDisabledAttr:function(e){this._set("disabled",e);this.updateState()},_getAttrNames:function(e){var k=this._attrPairNames;if(k[e])return k[e];var d=e.charAt(0).toUpperCase()+e.substr(1);return k[e]={s:"_set"+d+"Attr",g:"_get"+d+"Attr"}},_set:function(e,k){this[e]=k}});n.registry={};return n})},"dijit/_editor/plugins/EnterKeyHandling":function(){define("dojo/_base/declare dojo/dom-construct dojo/keys dojo/_base/lang dojo/on dojo/sniff dojo/_base/window dojo/window ../_Plugin ../RichText ../range".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a){return r("dijit._editor.plugins.EnterKeyHandling",g,{blockNodeForEnter:"BR",constructor:function(a){a&&("blockNodeForEnter"in a&&(a.blockNodeForEnter=a.blockNodeForEnter.toUpperCase()),m.mixin(this,a))},setEditor:function(a){if(this.editor!==a)if(this.editor=a,"BR"==this.blockNodeForEnter)this.editor.customUndo=!0,a.onLoadDeferred.then(m.hitch(this,function(c){this.own(h(a.document,"keydown",m.hitch(this,function(a){if(a.keyCode==p.ENTER){var b=m.mixin({},a);b.shiftKey=
!0;this.handleEnterKey(b)||(a.stopPropagation(),a.preventDefault())}})));9<=e("ie")&&10>=e("ie")&&this.own(h(a.document,"paste",m.hitch(this,function(a){setTimeout(m.hitch(this,function(){var a=this.editor.document.selection.createRange();a.move("character",-1);a.select();a.move("character",1);a.select()}),0)})));return c}));else if(this.blockNodeForEnter){var c=m.hitch(this,"handleEnterKey");a.addKeyHandler(13,0,0,c);a.addKeyHandler(13,0,1,c);this.own(this.editor.on("KeyPressed",m.hitch(this,"onKeyPressed")))}},
onKeyPressed:function(){if(this._checkListLater){if(this.editor.selection.isCollapsed()){var d=this.editor.selection.getAncestorElement("LI");if(d){e("mozilla")&&"LI"==d.parentNode.parentNode.nodeName&&(d=d.parentNode.parentNode);var g=d.firstChild;!g||1!=g.nodeType||"UL"!=g.nodeName&&"OL"!=g.nodeName||(d.insertBefore(g.ownerDocument.createTextNode("\u00a0"),g),g=a.create(this.editor.window),g.setStart(d.firstChild,0),d=a.getSelection(this.editor.window,!0),d.removeAllRanges(),d.addRange(g))}else c.prototype.execCommand.call(this.editor,
"formatblock",this.blockNodeForEnter),(d=this.editor.selection.getAncestorElement(this.blockNodeForEnter))?(d.innerHTML=this.bogusHtmlContent,9>=e("ie")&&(d=this.editor.document.selection.createRange(),d.move("character",-1),d.select())):console.error("onKeyPressed: Cannot find the new block node")}this._checkListLater=!1}this._pressedEnterInBlock&&(this._pressedEnterInBlock.previousSibling&&this.removeTrailingBr(this._pressedEnterInBlock.previousSibling),delete this._pressedEnterInBlock)},bogusHtmlContent:"\x26#160;",
blockNodes:/^(?:P|H1|H2|H3|H4|H5|H6|LI)$/,handleEnterKey:function(g){var l,k,f,b,h=this.editor.document,u,m,p;if(g.shiftKey){g=this.editor.selection.getParentElement();if(b=a.getAncestor(g,this.blockNodes)){if("LI"==b.tagName)return!0;g=a.getSelection(this.editor.window);l=g.getRangeAt(0);l.collapsed||(l.deleteContents(),g=a.getSelection(this.editor.window),l=g.getRangeAt(0));if(a.atBeginningOfContainer(b,l.startContainer,l.startOffset))u=h.createElement("br"),l=a.create(this.editor.window),b.insertBefore(u,
b.firstChild),l.setStartAfter(u),g.removeAllRanges(),g.addRange(l);else if(a.atEndOfContainer(b,l.startContainer,l.startOffset))l=a.create(this.editor.window),u=h.createElement("br"),b.appendChild(u),b.appendChild(h.createTextNode("\u00a0")),l.setStart(b.lastChild,0),g.removeAllRanges(),g.addRange(l);else return(m=l.startContainer)&&3==m.nodeType?(p=m.nodeValue,k=h.createTextNode(p.substring(0,l.startOffset)),f=h.createTextNode(p.substring(l.startOffset)),b=h.createElement("br"),""==f.nodeValue&&
e("webkit")&&(f=h.createTextNode("\u00a0")),n.place(k,m,"after"),n.place(b,k,"after"),n.place(f,b,"after"),n.destroy(m),l=a.create(this.editor.window),l.setStart(f,0),g.removeAllRanges(),g.addRange(l),!1):!0}else g=a.getSelection(this.editor.window),g.rangeCount?(l=g.getRangeAt(0))&&l.startContainer&&(l.collapsed||(l.deleteContents(),g=a.getSelection(this.editor.window),l=g.getRangeAt(0)),(m=l.startContainer)&&3==m.nodeType?(b=l.startOffset,m.length<b&&(f=this._adjustNodeAndOffset(m,b),m=f.node,b=
f.offset),p=m.nodeValue,k=h.createTextNode(p.substring(0,b)),f=h.createTextNode(p.substring(b)),b=h.createElement("br"),f.length||(f=h.createTextNode("\u00a0")),k.length?n.place(k,m,"after"):k=m,n.place(b,k,"after"),n.place(f,b,"after"),n.destroy(m)):(0<=l.startOffset&&(u=m.childNodes[l.startOffset]),b=h.createElement("br"),f=h.createTextNode("\u00a0"),u?(n.place(b,u,"before"),n.place(f,b,"after")):(m.appendChild(b),m.appendChild(f))),l=a.create(this.editor.window),l.setStart(f,0),l.setEnd(f,f.length),
g.removeAllRanges(),g.addRange(l),this.editor.selection.collapse(!0)):c.prototype.execCommand.call(this.editor,"inserthtml","\x3cbr\x3e");return!1}var r=!0;g=a.getSelection(this.editor.window);l=g.getRangeAt(0);l.collapsed||(l.deleteContents(),g=a.getSelection(this.editor.window),l=g.getRangeAt(0));u=a.getBlockAncestor(l.endContainer,null,this.editor.editNode);var x=u.blockNode;if(this._checkListLater=x&&("LI"==x.nodeName||"LI"==x.parentNode.nodeName))return e("mozilla")&&(this._pressedEnterInBlock=
x),/^(\s|&nbsp;|&#160;|\xA0|<span\b[^>]*\bclass=['"]Apple-style-span['"][^>]*>(\s|&nbsp;|&#160;|\xA0)<\/span>)?(<br>)?$/.test(x.innerHTML)&&(x.innerHTML="",e("webkit")&&(l=a.create(this.editor.window),l.setStart(x,0),g.removeAllRanges(),g.addRange(l)),this._checkListLater=!1),!0;if(!u.blockNode||u.blockNode===this.editor.editNode){try{c.prototype.execCommand.call(this.editor,"formatblock",this.blockNodeForEnter)}catch(w){}u={blockNode:this.editor.selection.getAncestorElement(this.blockNodeForEnter),
blockContainer:this.editor.editNode};if(u.blockNode){if(u.blockNode!=this.editor.editNode&&!(u.blockNode.textContent||u.blockNode.innerHTML).replace(/^\s+|\s+$/g,"").length)return this.removeTrailingBr(u.blockNode),!1}else u.blockNode=this.editor.editNode;g=a.getSelection(this.editor.window);l=g.getRangeAt(0)}x=h.createElement(this.blockNodeForEnter);x.innerHTML=this.bogusHtmlContent;this.removeTrailingBr(u.blockNode);f=l.endOffset;r=l.endContainer;r.length<f&&(f=this._adjustNodeAndOffset(r,f),r=
f.node,f=f.offset);if(a.atEndOfContainer(u.blockNode,r,f))u.blockNode===u.blockContainer?u.blockNode.appendChild(x):n.place(x,u.blockNode,"after"),r=!1,l=a.create(this.editor.window),l.setStart(x,0),g.removeAllRanges(),g.addRange(l),this.editor.height&&d.scrollIntoView(x);else if(a.atBeginningOfContainer(u.blockNode,l.startContainer,l.startOffset))n.place(x,u.blockNode,u.blockNode===u.blockContainer?"first":"before"),x.nextSibling&&this.editor.height&&(l=a.create(this.editor.window),l.setStart(x.nextSibling,
0),g.removeAllRanges(),g.addRange(l),d.scrollIntoView(x.nextSibling)),r=!1;else{u.blockNode===u.blockContainer?u.blockNode.appendChild(x):n.place(x,u.blockNode,"after");r=!1;u.blockNode.style&&x.style&&u.blockNode.style.cssText&&(x.style.cssText=u.blockNode.style.cssText);if((m=l.startContainer)&&3==m.nodeType){f=l.endOffset;m.length<f&&(f=this._adjustNodeAndOffset(m,f),m=f.node,f=f.offset);p=m.nodeValue;k=h.createTextNode(p.substring(0,f));f=h.createTextNode(p.substring(f,p.length));n.place(k,m,
"before");n.place(f,m,"after");n.destroy(m);for(l=k.parentNode;l!==u.blockNode;){p=h.createElement(l.tagName);l.style&&p.style&&l.style.cssText&&(p.style.cssText=l.style.cssText);"FONT"===l.tagName&&(l.color&&(p.color=l.color),l.face&&(p.face=l.face),l.size&&(p.size=l.size));for(;f;)m=f.nextSibling,p.appendChild(f),f=m;n.place(p,l,"after");k=l;f=p;l=l.parentNode}if(1==f.nodeType||3==f.nodeType&&f.nodeValue)x.innerHTML="";for(k=f;f;)m=f.nextSibling,x.appendChild(f),f=m}l=a.create(this.editor.window);
h=k;if("BR"!==this.blockNodeForEnter){for(;h;)b=h,h=m=h.firstChild;b&&b.parentNode?(x=b.parentNode,l.setStart(x,0),g.removeAllRanges(),g.addRange(l),this.editor.height&&d.scrollIntoView(x),e("mozilla")&&(this._pressedEnterInBlock=u.blockNode)):r=!0}else l.setStart(x,0),g.removeAllRanges(),g.addRange(l),this.editor.height&&d.scrollIntoView(x),e("mozilla")&&(this._pressedEnterInBlock=u.blockNode)}return r},_adjustNodeAndOffset:function(a,c){for(;a.length<c&&a.nextSibling&&3==a.nextSibling.nodeType;)c-=
a.length,a=a.nextSibling;return{node:a,offset:c}},removeTrailingBr:function(a){if(a=/P|DIV|LI/i.test(a.tagName)?a:this.editor.selection.getParentOfType(a,["P","DIV","LI"]))a.lastChild&&(1<a.childNodes.length&&3==a.lastChild.nodeType&&/^[\s\xAD]*$/.test(a.lastChild.nodeValue)||"BR"==a.lastChild.tagName)&&n.destroy(a.lastChild),a.childNodes.length||(a.innerHTML=this.bogusHtmlContent)}})})},"dijit/_editor/RichText":function(){define("dojo/_base/array dojo/_base/config dojo/_base/declare dojo/_base/Deferred dojo/dom dojo/dom-attr dojo/dom-class dojo/dom-construct dojo/dom-geometry dojo/dom-style dojo/_base/kernel dojo/keys dojo/_base/lang dojo/on dojo/query dojo/domReady dojo/sniff dojo/string dojo/topic dojo/_base/unload dojo/_base/url dojo/window ../_Widget ../_CssStateMixin ../selection ./range ./html ../focus ../main".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A,y,B,x,w,z,E,C,D,F,G){var I=p("dijit._editor.RichText",[w,z],{constructor:function(a){this.contentPreFilters=[];this.contentPostFilters=[];this.contentDomPreFilters=[];this.contentDomPostFilters=[];this.editingAreaStyleSheets=[];this.events=[].concat(this.events);this._keyHandlers={};a&&t.isString(a.value)&&(this.value=a.value);this.onLoadDeferred=new m},baseClass:"dijitEditor",inheritWidth:!1,focusOnLoad:!1,name:"",styleSheets:"",height:"300px",minHeight:"1em",
isClosed:!0,isLoaded:!1,_SEPARATOR:"@@**%%__RICHTEXTBOUNDRY__%%**@@",_NAME_CONTENT_SEP:"@@**%%:%%**@@",onLoadDeferred:null,isTabIndent:!1,disableSpellCheck:!1,postCreate:function(){"textarea"===this.domNode.tagName.toLowerCase()&&console.warn("RichText should not be used with the TEXTAREA tag.  See dijit._editor.RichText docs.");this.contentPreFilters=[t.trim,t.hitch(this,"_preFixUrlAttributes")].concat(this.contentPreFilters);q("mozilla")&&(this.contentPreFilters=[this._normalizeFontStyle].concat(this.contentPreFilters),
this.contentPostFilters=[this._removeMozBogus].concat(this.contentPostFilters));q("webkit")&&(this.contentPreFilters=[this._removeWebkitBogus].concat(this.contentPreFilters),this.contentPostFilters=[this._removeWebkitBogus].concat(this.contentPostFilters));if(q("ie")||q("trident"))this.contentPostFilters=[this._normalizeFontStyle].concat(this.contentPostFilters),this.contentDomPostFilters=[t.hitch(this,"_stripBreakerNodes")].concat(this.contentDomPostFilters);this.contentDomPostFilters=[t.hitch(this,
"_stripTrailingEmptyNodes")].concat(this.contentDomPostFilters);this.inherited(arguments);A.publish(G._scopeName+"._editor.RichText::init",this)},startup:function(){this.inherited(arguments);this.open();this.setupDefaultShortcuts()},setupDefaultShortcuts:function(){var a=t.hitch(this,function(a,b){return function(){return!this.execCommand(a,b)}}),b={b:a("bold"),i:a("italic"),u:a("underline"),a:a("selectall"),s:function(){this.save(!0)},m:function(){this.isTabIndent=!this.isTabIndent},1:a("formatblock",
"h1"),2:a("formatblock","h2"),3:a("formatblock","h3"),4:a("formatblock","h4"),"\\":a("insertunorderedlist")};q("ie")||(b.Z=a("redo"));for(var c in b)this.addKeyHandler(c,!0,!1,b[c])},events:["onKeyDown","onKeyUp"],captureEvents:[],_editorCommandsLocalized:!1,_localizeEditorCommands:function(){if(I._editorCommandsLocalized)this._local2NativeFormatNames=I._local2NativeFormatNames,this._native2LocalFormatNames=I._native2LocalFormatNames;else{I._editorCommandsLocalized=!0;I._local2NativeFormatNames={};
I._native2LocalFormatNames={};this._local2NativeFormatNames=I._local2NativeFormatNames;this._native2LocalFormatNames=I._native2LocalFormatNames;for(var a="div p pre h1 h2 h3 h4 h5 h6 ol ul address".split(" "),b="",c,e=0;c=a[e++];)b="l"!==c.charAt(1)?b+("\x3c"+c+"\x3e\x3cspan\x3econtent\x3c/span\x3e\x3c/"+c+"\x3e\x3cbr/\x3e"):b+("\x3c"+c+"\x3e\x3cli\x3econtent\x3c/li\x3e\x3c/"+c+"\x3e\x3cbr/\x3e");var f=d.create("div",{style:{position:"absolute",top:"0px",zIndex:10,opacity:.01},innerHTML:b});this.ownerDocumentBody.appendChild(f);
a=t.hitch(this,function(){for(var a=f.firstChild;a;)try{this.selection.selectElement(a.firstChild);var b=a.tagName.toLowerCase();this._local2NativeFormatNames[b]=document.queryCommandValue("formatblock");this._native2LocalFormatNames[this._local2NativeFormatNames[b]]=b;a=a.nextSibling.nextSibling}catch(K){}d.destroy(f)});this.defer(a)}},open:function(a){if(!this.onLoadDeferred||0<=this.onLoadDeferred.fired)this.onLoadDeferred=new m;this.isClosed||this.close();A.publish(G._scopeName+"._editor.RichText::open",
this);1===arguments.length&&a.nodeName&&(this.domNode=a);var b=this.domNode,f;if(t.isString(this.value))f=this.value,b.innerHTML="";else if(b.nodeName&&"textarea"==b.nodeName.toLowerCase()){var g=this.textarea=b;this.name=g.name;f=g.value;b=this.domNode=this.ownerDocument.createElement("div");b.setAttribute("widgetId",this.id);g.removeAttribute("widgetId");b.cssText=g.cssText;b.className+=" "+g.className;d.place(b,g,"before");var l=t.hitch(this,function(){c.set(g,{display:"block",position:"absolute",
top:"-1000px"});if(q("ie")){var a=g.style;this.__overflow=a.overflow;a.overflow="hidden"}});q("ie")?this.defer(l,10):l();if(g.form){var u=g.value;this.reset=function(){this.getValue()!==u&&this.replaceValue(u)};v(g.form,"submit",t.hitch(this,function(){e.set(g,"disabled",this.disabled);g.value=this.getValue()}))}}else f=D.getChildrenHtml(b),b.innerHTML="";this.value=f;b.nodeName&&"LI"===b.nodeName&&(b.innerHTML=" \x3cbr\x3e");this.header=b.ownerDocument.createElement("div");b.appendChild(this.header);
this.editingArea=b.ownerDocument.createElement("div");b.appendChild(this.editingArea);this.footer=b.ownerDocument.createElement("div");b.appendChild(this.footer);this.name||(this.name=this.id+"_AUTOGEN");if(""!==this.name&&(!n.useXDomain||n.allowXdRichTextSave)){if((f=h.byId(G._scopeName+"._editor.RichText.value"))&&""!==f.value)for(var l=f.value.split(this._SEPARATOR),p=0,r;r=l[p++];)if(r=r.split(this._NAME_CONTENT_SEP),r[0]===this.name){this.value=r[1];l=l.splice(p,1);f.value=l.join(this._SEPARATOR);
break}I._globalSaveHandler||(I._globalSaveHandler={},y.addOnUnload(function(){for(var a in I._globalSaveHandler){var b=I._globalSaveHandler[a];t.isFunction(b)&&b()}}));I._globalSaveHandler[this.id]=t.hitch(this,"_saveContent")}this.isClosed=!1;f=this.editorObject=this.iframe=this.ownerDocument.createElement("iframe");f.id=this.id+"_iframe";f.style.border="none";f.style.width="100%";this._layoutMode?f.style.height="100%":7<=q("ie")?(this.height&&(f.style.height=this.height),this.minHeight&&(f.style.minHeight=
this.minHeight)):f.style.height=this.height?this.height:this.minHeight;f.frameBorder=0;f._loadFunc=t.hitch(this,function(a){this.window=a;this.document=a.document;this.selection=new E.SelectionManager(a);q("ie")&&this._localizeEditorCommands();this.onLoad(this.get("value"))});l=this._getIframeDocTxt().replace(/\\/g,"\\\\").replace(/'/g,"\\'");l=11>q("ie")?'javascript:document.open();try{parent.window;}catch(e){document.domain\x3d"'+document.domain+"\";}document.write('"+l+"');document.close()":"javascript: '"+
l+"'";this.editingArea.appendChild(f);f.src=l;"LI"===b.nodeName&&(b.lastChild.style.marginTop="-1.2em");k.add(this.domNode,this.baseClass)},_local2NativeFormatNames:{},_native2LocalFormatNames:{},_getIframeDocTxt:function(){var b=c.getComputedStyle(this.domNode),d;if(this["aria-label"])d=this["aria-label"];else{var e=f('label[for\x3d"'+this.id+'"]',this.ownerDocument)[0]||h.byId(this["aria-labelledby"],this.ownerDocument);e&&(d=e.textContent||e.innerHTML||"")}var e="\x3cdiv id\x3d'dijitEditorBody' role\x3d'textbox' aria-multiline\x3d'true' "+
(d?" aria-label\x3d'"+u.escape(d)+"'":"")+"\x3e\x3c/div\x3e",g=[b.fontWeight,b.fontSize,b.fontFamily].join(" "),l=b.lineHeight,l=0<=l.indexOf("px")?parseFloat(l)/parseFloat(b.fontSize):0<=l.indexOf("em")?parseFloat(l):"normal",k="",m=this;this.style.replace(/(^|;)\s*(line-|font-?)[^;]+/ig,function(a){a=a.replace(/^;/ig,"")+";";var b=a.split(":")[0];if(b){var b=t.trim(b),b=b.toLowerCase(),d,e="";for(d=0;d<b.length;d++){var f=b.charAt(d);switch(f){case "-":d++,f=b.charAt(d).toUpperCase();default:e+=
f}}c.set(m.domNode,e,"")}k+=a+";"});this.iframe.setAttribute("title",d);return["\x3c!DOCTYPE html\x3e","\x3chtml lang\x3d'"+(this.lang||a.locale.replace(/-.*/,""))+"'"+(this.isLeftToRight()?"":" dir\x3d'rtl'")+"\x3e\n","\x3chead\x3e\n\x3cmeta http-equiv\x3d'Content-Type' content\x3d'text/html'\x3e\n",d?"\x3ctitle\x3e"+u.escape(d)+"\x3c/title\x3e":"","\x3cstyle\x3e\n\tbody,html {\n\t\tbackground:transparent;\n\t\tpadding: 1px 0 0 0;\n\t\tmargin: -1px 0 0 0;\n\t}\n\tbody,html,#dijitEditorBody { outline: none; }html { height: 100%; width: 100%; overflow: hidden; }\n",
this.height?"\tbody,#dijitEditorBody { height: 100%; width: 100%; overflow: auto; }\n":"\tbody,#dijitEditorBody { min-height: "+this.minHeight+"; width: 100%; overflow-x: auto; overflow-y: hidden; }\n","\tbody{\n\t\ttop:0px;\n\t\tleft:0px;\n\t\tright:0px;\n\t\tfont:",g,";\n",this.height||q("opera")?"":"\t\tposition: fixed;\n","\t\tline-height:",l,";\n\t}\n\tp{ margin: 1em 0; }\n\tli \x3e ul:-moz-first-node, li \x3e ol:-moz-first-node{ padding-top: 1.2em; }\n",q("ie")||q("trident")||q("edge")?"":"\tli{ min-height:1.2em; }\n",
"\x3c/style\x3e\n",this._applyEditingAreaStyleSheets(),"\n\x3c/head\x3e\n\x3cbody role\x3d'application'",d?" aria-label\x3d'"+u.escape(d)+"'":"","onload\x3d'try{frameElement \x26\x26 frameElement._loadFunc(window,document)}catch(e){document.domain\x3d\""+document.domain+"\";frameElement._loadFunc(window,document)}' ","style\x3d'"+k+"'\x3e",e,"\x3c/body\x3e\n\x3c/html\x3e"].join("")},_applyEditingAreaStyleSheets:function(){var a=[];this.styleSheets&&(a=this.styleSheets.split(";"),this.styleSheets=
"");a=a.concat(this.editingAreaStyleSheets);this.editingAreaStyleSheets=[];for(var b="",c=0,d,e=x.get(this.ownerDocument);d=a[c++];)d=(new B(e.location,d)).toString(),this.editingAreaStyleSheets.push(d),b+='\x3clink rel\x3d"stylesheet" type\x3d"text/css" href\x3d"'+d+'"/\x3e';return b},addStyleSheet:function(a){var b=a.toString(),c=x.get(this.ownerDocument);if("."===b.charAt(0)||"/"!==b.charAt(0)&&!a.host)b=(new B(c.location,b)).toString();-1<r.indexOf(this.editingAreaStyleSheets,b)||(this.editingAreaStyleSheets.push(b),
this.onLoadDeferred.then(t.hitch(this,function(){if(this.document.createStyleSheet)this.document.createStyleSheet(b);else{var a=this.document.getElementsByTagName("head")[0],c=this.document.createElement("link");c.rel="stylesheet";c.type="text/css";c.href=b;a.appendChild(c)}})))},removeStyleSheet:function(a){var b=a.toString(),c=x.get(this.ownerDocument);if("."===b.charAt(0)||"/"!==b.charAt(0)&&!a.host)b=(new B(c.location,b)).toString();a=r.indexOf(this.editingAreaStyleSheets,b);-1!==a&&(delete this.editingAreaStyleSheets[a],
f('link[href\x3d"'+b+'"]',this.window.document).orphan())},disabled:!1,_mozSettingProps:{styleWithCSS:!1},_setDisabledAttr:function(a){a=!!a;this._set("disabled",a);if(this.isLoaded){var b=q("ie")&&(this.isLoaded||!this.focusOnLoad);b&&(this.editNode.unselectable="on");this.editNode.contentEditable=!a;this.editNode.tabIndex=a?"-1":this.tabIndex;b&&this.defer(function(){this.editNode&&(this.editNode.unselectable="off")});if(q("mozilla")&&!a&&this._mozSettingProps){a=this._mozSettingProps;for(var c in a)if(a.hasOwnProperty(c))try{this.document.execCommand(c,
!1,a[c])}catch(U){}}this._disabledOK=!0}},onLoad:function(a){this.window.__registeredWindow||(this.window.__registeredWindow=!0,this._iframeRegHandle=F.registerIframe(this.iframe));this.editNode=this.document.body.firstChild;var c=this;this.beforeIframeNode=d.place("\x3cdiv tabIndex\x3d-1\x3e\x3c/div\x3e",this.iframe,"before");this.afterIframeNode=d.place("\x3cdiv tabIndex\x3d-1\x3e\x3c/div\x3e",this.iframe,"after");this.iframe.onfocus=this.document.onfocus=function(){c.editNode.focus()};this.focusNode=
this.editNode;var e=this.events.concat(this.captureEvents),f=this.iframe?this.document:this.editNode;this.own.apply(this,r.map(e,function(a){var b=a.toLowerCase().replace(/^on/,"");return v(f,b,t.hitch(this,a))},this));this.own(v(f,"mouseup",t.hitch(this,"onClick")));q("ie")&&(this.own(v(this.document,"mousedown",t.hitch(this,"_onIEMouseDown"))),this.editNode.style.zoom=1);q("webkit")&&(this._webkitListener=this.own(v(this.document,"mouseup",t.hitch(this,"onDisplayChanged")))[0],this.own(v(this.document,
"mousedown",t.hitch(this,function(a){a=a.target;!a||a!==this.document.body&&a!==this.document||this.defer("placeCursorAtEnd")}))));if(q("ie"))try{this.document.execCommand("RespectVisibilityInDesign",!0,null)}catch(V){}this.isLoaded=!0;this.set("disabled",this.disabled);e=t.hitch(this,function(){this.setValue(a);this.onLoadDeferred&&!this.onLoadDeferred.isFulfilled()&&this.onLoadDeferred.resolve(!0);this.onDisplayChanged();this.focusOnLoad&&b(t.hitch(this,"defer","focus",this.updateInterval));this.value=
this.getValue(!0)});this.setValueDeferred?this.setValueDeferred.then(e):e()},onKeyDown:function(a){if(a.keyCode===l.SHIFT||a.keyCode===l.ALT||a.keyCode===l.META||a.keyCode===l.CTRL)return!0;a.keyCode===l.TAB&&this.isTabIndent&&(a.stopPropagation(),a.preventDefault(),this.queryCommandEnabled(a.shiftKey?"outdent":"indent")&&this.execCommand(a.shiftKey?"outdent":"indent"));if(a.keyCode==l.TAB&&!this.isTabIndent&&!a.ctrlKey&&!a.altKey)return a.shiftKey?this.beforeIframeNode.focus():this.afterIframeNode.focus(),
!0;9>q("ie")&&a.keyCode===l.BACKSPACE&&"Control"===this.document.selection.type&&(a.stopPropagation(),a.preventDefault(),this.execCommand("delete"));q("ff")&&(a.keyCode===l.PAGE_UP||a.keyCode===l.PAGE_DOWN)&&this.editNode.clientHeight>=this.editNode.scrollHeight&&a.preventDefault();var b=this._keyHandlers[a.keyCode],c=arguments;b&&!a.altKey&&r.some(b,function(b){if(!(b.shift^a.shiftKey||b.ctrl^(a.ctrlKey||a.metaKey)))return b.handler.apply(this,c)||a.preventDefault(),!0},this);this.defer("onKeyPressed",
1);return!0},onKeyUp:function(){},setDisabled:function(b){a.deprecated("dijit.Editor::setDisabled is deprecated",'use dijit.Editor::attr("disabled",boolean) instead',2);this.set("disabled",b)},_setValueAttr:function(a){this.setValue(a)},_setDisableSpellCheckAttr:function(a){this.document?e.set(this.document.body,"spellcheck",!a):this.onLoadDeferred.then(t.hitch(this,function(){e.set(this.document.body,"spellcheck",!a)}));this._set("disableSpellCheck",a)},addKeyHandler:function(a,b,c,d){"string"==
typeof a&&(a=a.toUpperCase().charCodeAt(0));t.isArray(this._keyHandlers[a])||(this._keyHandlers[a]=[]);this._keyHandlers[a].push({shift:c||!1,ctrl:b||!1,handler:d})},onKeyPressed:function(){this.onDisplayChanged()},onClick:function(a){this.onDisplayChanged(a)},_onIEMouseDown:function(){this.focused||this.disabled||this.focus()},_onBlur:function(a){(q("ie")||q("trident"))&&this.defer(function(){F.curNode||this.ownerDocumentBody.focus()});this.inherited(arguments);var b=this.getValue(!0);if(b!==this.value)this.onChange(b);
this._set("value",b)},_onFocus:function(a){this.disabled||(this._disabledOK||this.set("disabled",!1),this.inherited(arguments))},blur:function(){!q("ie")&&this.window.document.documentElement&&this.window.document.documentElement.focus?this.window.document.documentElement.focus():this.ownerDocumentBody.focus&&this.ownerDocumentBody.focus()},focus:function(){this.isLoaded?9>q("ie")?this.iframe.fireEvent("onfocus",document.createEventObject()):this.editNode.focus():this.focusOnLoad=!0},updateInterval:200,
_updateTimer:null,onDisplayChanged:function(){this._updateTimer&&this._updateTimer.remove();this._updateTimer=this.defer("onNormalizedDisplayChanged",this.updateInterval)},onNormalizedDisplayChanged:function(){delete this._updateTimer},onChange:function(){},_normalizeCommand:function(a,b){var c=a.toLowerCase();"formatblock"===c?q("safari")&&void 0===b&&(c="heading"):"hilitecolor"!==c||q("mozilla")||(c="backcolor");return c},_qcaCache:{},queryCommandAvailable:function(a){var b=this._qcaCache[a];return void 0!==
b?b:this._qcaCache[a]=this._queryCommandAvailable(a)},_queryCommandAvailable:function(a){switch(a.toLowerCase()){case "bold":case "italic":case "underline":case "subscript":case "superscript":case "fontname":case "fontsize":case "forecolor":case "hilitecolor":case "justifycenter":case "justifyfull":case "justifyleft":case "justifyright":case "delete":case "selectall":case "toggledir":case "createlink":case "unlink":case "removeformat":case "inserthorizontalrule":case "insertimage":case "insertorderedlist":case "insertunorderedlist":case "indent":case "outdent":case "formatblock":case "inserthtml":case "undo":case "redo":case "strikethrough":case "tabindent":case "cut":case "copy":case "paste":return!0;
case "blockdirltr":case "blockdirrtl":case "dirltr":case "dirrtl":case "inlinedirltr":case "inlinedirrtl":return q("ie")||q("trident")||q("edge");case "inserttable":case "insertcell":case "insertcol":case "insertrow":case "deletecells":case "deletecols":case "deleterows":case "mergecells":case "splitcell":return!q("webkit");default:return!1}},execCommand:function(a,b){var c;this.focused&&this.focus();a=this._normalizeCommand(a,b);if(void 0!==b){if("heading"===a)throw Error("unimplemented");"formatblock"===
a&&(q("ie")||q("trident"))&&(b="\x3c"+b+"\x3e")}var d="_"+a+"Impl";if(this[d])c=this[d](b);else if((b=1<arguments.length?b:null)||"createlink"!==a)c=this.document.execCommand(a,!1,b);this.onDisplayChanged();return c},queryCommandEnabled:function(a){if(this.disabled||!this._disabledOK)return!1;a=this._normalizeCommand(a);var b="_"+a+"EnabledImpl";return this[b]?this[b](a):this._browserQueryCommandEnabled(a)},queryCommandState:function(a){if(this.disabled||!this._disabledOK)return!1;a=this._normalizeCommand(a);
try{return this.document.queryCommandState(a)}catch(M){return!1}},queryCommandValue:function(a){if(this.disabled||!this._disabledOK)return!1;a=this._normalizeCommand(a);if(q("ie")&&"formatblock"===a)a=this._native2LocalFormatNames[this.document.queryCommandValue(a)];else if(q("mozilla")&&"hilitecolor"===a){var b;try{b=this.document.queryCommandValue("styleWithCSS")}catch(P){b=!1}this.document.execCommand("styleWithCSS",!1,!0);a=this.document.queryCommandValue(a);this.document.execCommand("styleWithCSS",
!1,b)}else a=this.document.queryCommandValue(a);return a},_sCall:function(a,b){return this.selection[a].apply(this.selection,b)},placeCursorAtStart:function(){this.focus();var a=!1;if(q("mozilla"))for(var b=this.editNode.firstChild;b;){if(3===b.nodeType){if(0<b.nodeValue.replace(/^\s+|\s+$/g,"").length){a=!0;this.selection.selectElement(b);break}}else if(1===b.nodeType){var a=!0,c=b.tagName?b.tagName.toLowerCase():"";/br|input|img|base|meta|area|basefont|hr|link/.test(c)?this.selection.selectElement(b):
this.selection.selectElementChildren(b);break}b=b.nextSibling}else a=!0,this.selection.selectElementChildren(this.editNode);a&&this.selection.collapse(!0)},placeCursorAtEnd:function(){this.focus();var a=!1;if(q("mozilla"))for(var b=this.editNode.lastChild;b;){if(3===b.nodeType){if(0<b.nodeValue.replace(/^\s+|\s+$/g,"").length){a=!0;this.selection.selectElement(b);break}}else if(1===b.nodeType){a=!0;this.selection.selectElement(b.lastChild||b);break}b=b.previousSibling}else a=!0,this.selection.selectElementChildren(this.editNode);
a&&this.selection.collapse(!1)},getValue:function(a){return!this.textarea||!this.isClosed&&this.isLoaded?this.isLoaded?this._postFilterContent(null,a):this.value:this.textarea.value},_getValueAttr:function(){return this.getValue(!0)},setValue:function(a){if(this.isLoaded){if(!this.textarea||!this.isClosed&&this.isLoaded){a=this._preFilterContent(a);var b=this.isClosed?this.domNode:this.editNode;b.innerHTML=a;this._preDomFilterContent(b)}else this.textarea.value=a;this.onDisplayChanged();this._set("value",
this.getValue(!0))}else this.onLoadDeferred.then(t.hitch(this,function(){this.setValue(a)}))},replaceValue:function(a){this.isClosed?this.setValue(a):this.window&&this.window.getSelection&&!q("mozilla")?this.setValue(a):this.window&&this.window.getSelection?(a=this._preFilterContent(a),this.execCommand("selectall"),this.execCommand("inserthtml",a),this._preDomFilterContent(this.editNode)):this.document&&this.document.selection&&this.setValue(a);this._set("value",this.getValue(!0))},_preFilterContent:function(a){var b=
a;r.forEach(this.contentPreFilters,function(a){a&&(b=a(b))});return b},_preDomFilterContent:function(a){a=a||this.editNode;r.forEach(this.contentDomPreFilters,function(b){b&&t.isFunction(b)&&b(a)},this)},_postFilterContent:function(a,b){var c;t.isString(a)?c=a:(a=a||this.editNode,this.contentDomPostFilters.length&&(b&&(a=t.clone(a)),r.forEach(this.contentDomPostFilters,function(b){a=b(a)})),c=D.getChildrenHtml(a));t.trim(c.replace(/^\xA0\xA0*/,"").replace(/\xA0\xA0*$/,"")).length||(c="");r.forEach(this.contentPostFilters,
function(a){c=a(c)});return c},_saveContent:function(){var a=h.byId(G._scopeName+"._editor.RichText.value");a&&(a.value&&(a.value+=this._SEPARATOR),a.value+=this.name+this._NAME_CONTENT_SEP+this.getValue(!0))},escapeXml:function(a,b){a=a.replace(/&/gm,"\x26amp;").replace(/</gm,"\x26lt;").replace(/>/gm,"\x26gt;").replace(/"/gm,"\x26quot;");b||(a=a.replace(/'/gm,"\x26#39;"));return a},getNodeHtml:function(b){a.deprecated("dijit.Editor::getNodeHtml is deprecated","use dijit/_editor/html::getNodeHtml instead",
2);return D.getNodeHtml(b)},getNodeChildrenHtml:function(b){a.deprecated("dijit.Editor::getNodeChildrenHtml is deprecated","use dijit/_editor/html::getChildrenHtml instead",2);return D.getChildrenHtml(b)},close:function(a){if(!this.isClosed){arguments.length||(a=!0);a&&this._set("value",this.getValue(!0));this.interval&&clearInterval(this.interval);this._webkitListener&&(this._webkitListener.remove(),delete this._webkitListener);q("ie")&&(this.iframe.onfocus=null);this.iframe._loadFunc=null;this._iframeRegHandle&&
(this._iframeRegHandle.remove(),delete this._iframeRegHandle);if(this.textarea){var b=this.textarea.style;b.position="";b.left=b.top="";q("ie")&&(b.overflow=this.__overflow,this.__overflow=null);this.textarea.value=this.value;d.destroy(this.domNode);this.domNode=this.textarea}else this.domNode.innerHTML=this.value;delete this.iframe;k.remove(this.domNode,this.baseClass);this.isClosed=!0;this.isLoaded=!1;delete this.editNode;delete this.focusNode;this.window&&this.window._frameElement&&(this.window._frameElement=
null);this.editorObject=this.editingArea=this.document=this.window=null}},destroy:function(){this.isClosed||this.close(!1);this._updateTimer&&this._updateTimer.remove();this.inherited(arguments);I._globalSaveHandler&&delete I._globalSaveHandler[this.id]},_removeMozBogus:function(a){return a.replace(/\stype="_moz"/gi,"").replace(/\s_moz_dirty=""/gi,"").replace(/_moz_resizing="(true|false)"/gi,"")},_removeWebkitBogus:function(a){a=a.replace(/\sclass="webkit-block-placeholder"/gi,"");a=a.replace(/\sclass="apple-style-span"/gi,
"");return a=a.replace(/<meta charset=\"utf-8\" \/>/gi,"")},_normalizeFontStyle:function(a){return a.replace(/<(\/)?strong([ \>])/gi,"\x3c$1b$2").replace(/<(\/)?em([ \>])/gi,"\x3c$1i$2")},_preFixUrlAttributes:function(a){return a.replace(/(?:(<a(?=\s).*?\shref=)("|')(.*?)\2)|(?:(<a\s.*?href=)([^"'][^ >]+))/gi,"$1$4$2$3$5$2 _djrealurl\x3d$2$3$5$2").replace(/(?:(<img(?=\s).*?\ssrc=)("|')(.*?)\2)|(?:(<img\s.*?src=)([^"'][^ >]+))/gi,"$1$4$2$3$5$2 _djrealurl\x3d$2$3$5$2")},_browserQueryCommandEnabled:function(a){if(!a)return!1;
if(q("ie")||q("trident")||q("edge"))return this.focused&&!this.disabled;var b=9>q("ie")?this.document.selection.createRange():this.document;try{return b.queryCommandEnabled(a)}catch(P){return!1}},_createlinkEnabledImpl:function(){var a=!0;return a=q("opera")?this.window.getSelection().isCollapsed?!0:this.document.queryCommandEnabled("createlink"):this._browserQueryCommandEnabled("createlink")},_unlinkEnabledImpl:function(){var a=!0;return a=q("mozilla")||q("webkit")||q("ie")||q("trident")||q("edge")?
this.selection.hasAncestorElement("a"):this._browserQueryCommandEnabled("unlink")},_inserttableEnabledImpl:function(){var a=!0;return a=q("mozilla")||q("webkit")?!0:this._browserQueryCommandEnabled("inserttable")},_cutEnabledImpl:function(){var a=!0;q("webkit")?((a=this.window.getSelection())&&(a=a.toString()),a=!!a):a=this._browserQueryCommandEnabled("cut");return a},_copyEnabledImpl:function(){var a=!0;q("webkit")?((a=this.window.getSelection())&&(a=a.toString()),a=!!a):a=this._browserQueryCommandEnabled("copy");
return a},_pasteEnabledImpl:function(){var a=!0;return q("webkit")?!0:a=this._browserQueryCommandEnabled("paste")},_inserthorizontalruleImpl:function(a){return q("ie")?this._inserthtmlImpl("\x3chr\x3e"):this.document.execCommand("inserthorizontalrule",!1,a)},_unlinkImpl:function(a){return this.queryCommandEnabled("unlink")&&(q("mozilla")||q("webkit"))?(a=this.selection.getAncestorElement("a"),this.selection.selectElement(a),this.document.execCommand("unlink",!1,null)):this.document.execCommand("unlink",
!1,a)},_hilitecolorImpl:function(a){var b;this._handleTextColorOrProperties("hilitecolor",a)||(q("mozilla")?(this.document.execCommand("styleWithCSS",!1,!0),console.log("Executing color command."),b=this.document.execCommand("hilitecolor",!1,a),this.document.execCommand("styleWithCSS",!1,!1)):b=this.document.execCommand("hilitecolor",!1,a));return b},_backcolorImpl:function(a){q("ie")&&(a=a?a:null);var b=this._handleTextColorOrProperties("backcolor",a);b||(b=this.document.execCommand("backcolor",
!1,a));return b},_forecolorImpl:function(a){q("ie")&&(a=a?a:null);var b=!1;(b=this._handleTextColorOrProperties("forecolor",a))||(b=this.document.execCommand("forecolor",!1,a));return b},_inserthtmlImpl:function(a){a=this._preFilterContent(a);var b=!0;if(9>q("ie")){var c=this.document.selection.createRange();if("CONTROL"===this.document.selection.type.toUpperCase()){for(var e=c.item(0);c.length;)c.remove(c.item(0));e.outerHTML=a}else c.pasteHTML(a);c.select()}else if(8>q("trident")){var f=C.getSelection(this.window);
if(f&&f.rangeCount&&f.getRangeAt){c=f.getRangeAt(0);c.deleteContents();var g=d.create("div");g.innerHTML=a;for(var l,e=this.document.createDocumentFragment();a=g.firstChild;)l=e.appendChild(a);c.insertNode(e);l&&(c=c.cloneRange(),c.setStartAfter(l),c.collapse(!1),f.removeAllRanges(),f.addRange(c))}}else q("mozilla")&&!a.length?this.selection.remove():b=this.document.execCommand("inserthtml",!1,a);return b},_boldImpl:function(a){var b=!1;if(q("ie")||q("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("bold");
b||(b=this.document.execCommand("bold",!1,a));return b},_italicImpl:function(a){var b=!1;if(q("ie")||q("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("italic");b||(b=this.document.execCommand("italic",!1,a));return b},_underlineImpl:function(a){var b=!1;if(q("ie")||q("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("underline");b||(b=this.document.execCommand("underline",!1,a));return b},_strikethroughImpl:function(a){var b=!1;if(q("ie")||q("trident"))this._adaptIESelection(),
b=this._adaptIEFormatAreaAndExec("strikethrough");b||(b=this.document.execCommand("strikethrough",!1,a));return b},_superscriptImpl:function(a){var b=!1;if(q("ie")||q("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("superscript");b||(b=this.document.execCommand("superscript",!1,a));return b},_subscriptImpl:function(a){var b=!1;if(q("ie")||q("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("subscript");b||(b=this.document.execCommand("subscript",!1,a));return b},
_fontnameImpl:function(a){var b;if(q("ie")||q("trident"))b=this._handleTextColorOrProperties("fontname",a);b||(b=this.document.execCommand("fontname",!1,a));return b},_fontsizeImpl:function(a){var b;if(q("ie")||q("trident"))b=this._handleTextColorOrProperties("fontsize",a);b||(b=this.document.execCommand("fontsize",!1,a));return b},_insertorderedlistImpl:function(a){var b=!1;if(q("ie")||q("trident")||q("edge"))b=this._adaptIEList("insertorderedlist",a);b||(b=this.document.execCommand("insertorderedlist",
!1,a));return b},_insertunorderedlistImpl:function(a){var b=!1;if(q("ie")||q("trident")||q("edge"))b=this._adaptIEList("insertunorderedlist",a);b||(b=this.document.execCommand("insertunorderedlist",!1,a));return b},getHeaderHeight:function(){return this._getNodeChildrenHeight(this.header)},getFooterHeight:function(){return this._getNodeChildrenHeight(this.footer)},_getNodeChildrenHeight:function(a){var b=0;if(a&&a.childNodes){var c;for(c=0;c<a.childNodes.length;c++)var d=g.position(a.childNodes[c]),
b=b+d.h}return b},_isNodeEmpty:function(a,b){return 1===a.nodeType?0<a.childNodes.length?this._isNodeEmpty(a.childNodes[0],b):!0:3===a.nodeType?""===a.nodeValue.substring(b):!1},_removeStartingRangeFromRange:function(a,b){if(a.nextSibling)b.setStart(a.nextSibling,0);else{for(var c=a.parentNode;c&&null==c.nextSibling;)c=c.parentNode;c&&b.setStart(c.nextSibling,0)}return b},_adaptIESelection:function(){var a=C.getSelection(this.window);if(a&&a.rangeCount&&!a.isCollapsed){for(var b=a.getRangeAt(0),c=
b.startContainer,d=b.startOffset;3===c.nodeType&&d>=c.length&&c.nextSibling;)d-=c.length,c=c.nextSibling;for(var e=null;this._isNodeEmpty(c,d)&&c!==e;)e=c,b=this._removeStartingRangeFromRange(c,b),c=b.startContainer,d=0;a.removeAllRanges();a.addRange(b)}},_adaptIEFormatAreaAndExec:function(a){var b=C.getSelection(this.window),c=this.document,e,f,g,l,k,h,q;if(a&&b&&b.isCollapsed){if(this.queryCommandValue(a)){a=this._tagNamesForCommand(a);g=b.getRangeAt(0);l=g.startContainer;3===l.nodeType&&(f=g.endOffset,
l.length<f&&(f=this._adjustNodeAndOffset(e,f),l=f.node,f=f.offset));for(;l&&l!==this.editNode;){e=l.tagName?l.tagName.toLowerCase():"";if(-1<r.indexOf(a,e)){q=l;break}l=l.parentNode}if(q&&(e=g.startContainer,a=c.createElement(q.tagName),d.place(a,q,"after"),e&&3===e.nodeType)){f=g.endOffset;e.length<f&&(f=this._adjustNodeAndOffset(e,f),e=f.node,f=f.offset);l=e.nodeValue;g=c.createTextNode(l.substring(0,f));var t=l.substring(f,l.length);t&&(k=c.createTextNode(t));d.place(g,e,"before");k&&(h=c.createElement("span"),
h.className="ieFormatBreakerSpan",d.place(h,e,"after"),d.place(k,h,"after"),k=h);d.destroy(e);f=g.parentNode;for(e=[];f!==q;){l=f.tagName;g={tagName:l};e.push(g);l=c.createElement(l);f.style&&l.style&&f.style.cssText&&(l.style.cssText=f.style.cssText,g.cssText=f.style.cssText);"FONT"===f.tagName&&(f.color&&(l.color=f.color,g.color=f.color),f.face&&(l.face=f.face,g.face=f.face),f.size&&(l.size=f.size,g.size=f.size));f.className&&(l.className=f.className,g.className=f.className);if(k)for(;k;)g=k.nextSibling,
l.appendChild(k),k=g;l.tagName==f.tagName?(h=c.createElement("span"),h.className="ieFormatBreakerSpan",d.place(h,f,"after"),d.place(l,h,"after")):d.place(l,f,"after");g=f;k=l;f=f.parentNode}if(k){if(1===k.nodeType||3===k.nodeType&&k.nodeValue)a.innerHTML="";for(;k;)g=k.nextSibling,a.appendChild(k),k=g}if(e.length){g=e.pop();k=c.createElement(g.tagName);g.cssText&&k.style&&(k.style.cssText=g.cssText);g.className&&(k.className=g.className);"FONT"===g.tagName&&(g.color&&(k.color=g.color),g.face&&(k.face=
g.face),g.size&&(k.size=g.size));for(d.place(k,a,"before");e.length;)g=e.pop(),q=c.createElement(g.tagName),g.cssText&&q.style&&(q.style.cssText=g.cssText),g.className&&(q.className=g.className),"FONT"===g.tagName&&(g.color&&(q.color=g.color),g.face&&(q.face=g.face),g.size&&(q.size=g.size)),k.appendChild(q),k=q;q=c.createTextNode(".");h.appendChild(q);k.appendChild(q)}else h=c.createElement("span"),h.className="ieFormatBreakerSpan",q=c.createTextNode("."),h.appendChild(q),d.place(h,a,"before");k=
C.create(this.window);k.setStart(q,0);k.setEnd(q,q.length);b.removeAllRanges();b.addRange(k);this.selection.collapse(!1);q.parentNode.innerHTML="";a.firstChild||d.destroy(a);return!0}return!1}g=b.getRangeAt(0);if((e=g.startContainer)&&3===e.nodeType)return f=g.startOffset,e.length<f&&(f=this._adjustNodeAndOffset(e,f),e=f.node,f=f.offset),l=e.nodeValue,g=c.createTextNode(l.substring(0,f)),t=l.substring(f),""!==t&&(k=c.createTextNode(l.substring(f))),h=c.createElement("span"),q=c.createTextNode("."),
h.appendChild(q),g.length?d.place(g,e,"after"):g=e,d.place(h,g,"after"),k&&d.place(k,h,"after"),d.destroy(e),k=C.create(this.window),k.setStart(q,0),k.setEnd(q,q.length),b.removeAllRanges(),b.addRange(k),c.execCommand(a),d.place(h.firstChild,h,"before"),d.destroy(h),k.setStart(q,0),k.setEnd(q,q.length),b.removeAllRanges(),b.addRange(k),this.selection.collapse(!1),q.parentNode.innerHTML="",!0}else return!1},_adaptIEList:function(a){var b=C.getSelection(this.window);if(b.isCollapsed&&b.rangeCount&&
!this.queryCommandValue(a)){var c=b.getRangeAt(0),e=c.startContainer;if(e&&3==e.nodeType&&!c.startOffset)return c="ul","insertorderedlist"===a&&(c="ol"),a=this.document.createElement(c),c=d.create("li",null,a),d.place(a,e,"before"),c.appendChild(e),d.create("br",null,a,"after"),a=C.create(this.window),a.setStart(e,0),a.setEnd(e,e.length),b.removeAllRanges(),b.addRange(a),this.selection.collapse(!0),!0}return!1},_handleTextColorOrProperties:function(a,b){var e=C.getSelection(this.window),f=this.document,
g,l,k,h,t;b=b||null;if(a&&e&&e.isCollapsed&&e.rangeCount&&(l=e.getRangeAt(0),(g=l.startContainer)&&3===g.nodeType)){t=l.startOffset;g.length<t&&(l=this._adjustNodeAndOffset(g,t),g=l.node,t=l.offset);k=g.nodeValue;l=f.createTextNode(k.substring(0,t));""!==k.substring(t)&&(h=f.createTextNode(k.substring(t)));k=f.createElement("span");t=f.createTextNode(".");k.appendChild(t);f=f.createElement("span");k.appendChild(f);l.length?d.place(l,g,"after"):l=g;d.place(k,l,"after");h&&d.place(h,k,"after");d.destroy(g);
g=C.create(this.window);g.setStart(t,0);g.setEnd(t,t.length);e.removeAllRanges();e.addRange(g);if(q("webkit")){e="color";if("hilitecolor"===a||"backcolor"===a)e="backgroundColor";c.set(k,e,b);this.selection.remove();d.destroy(f);k.innerHTML="\x26#160;";this.selection.selectElement(k);this.focus()}else this.execCommand(a,b),d.place(k.firstChild,k,"before"),d.destroy(k),g.setStart(t,0),g.setEnd(t,t.length),e.removeAllRanges(),e.addRange(g),this.selection.collapse(!1),t.parentNode.removeChild(t);return!0}return!1},
_adjustNodeAndOffset:function(a,b){for(;a.length<b&&a.nextSibling&&3===a.nextSibling.nodeType;)b-=a.length,a=a.nextSibling;return{node:a,offset:b}},_tagNamesForCommand:function(a){return"bold"===a?["b","strong"]:"italic"===a?["i","em"]:"strikethrough"===a?["s","strike"]:"superscript"===a?["sup"]:"subscript"===a?["sub"]:"underline"===a?["u"]:[]},_stripBreakerNodes:function(a){if(this.isLoaded)return f(".ieFormatBreakerSpan",a).forEach(function(a){for(;a.firstChild;)d.place(a.firstChild,a,"before");
d.destroy(a)}),a},_stripTrailingEmptyNodes:function(a){function b(a){return/^(p|div|br)$/i.test(a.nodeName)&&0==a.children.length&&/^[\s\xA0]*$/.test(a.textContent||a.innerText||"")||3===a.nodeType&&/^[\s\xA0]*$/.test(a.nodeValue)}for(;a.lastChild&&b(a.lastChild);)d.destroy(a.lastChild);return a},_setTextDirAttr:function(a){this._set("textDir",a);this.onLoadDeferred.then(t.hitch(this,function(){this.editNode.dir=a}))}});return I})},"dijit/selection":function(){define("dojo/_base/array dojo/dom dojo/_base/lang dojo/sniff dojo/_base/window dijit/focus".split(" "),
function(r,n,p,m,h,e){var k=function(d){var c=d.document;this.getType=function(){if(c.getSelection){var a="text",e;try{e=d.getSelection()}catch(t){}e&&1==e.rangeCount&&(e=e.getRangeAt(0),e.startContainer==e.endContainer&&1==e.endOffset-e.startOffset&&3!=e.startContainer.nodeType&&(a="control"));return a}return c.selection.type.toLowerCase()};this.getSelectedText=function(){if(c.getSelection){var a=d.getSelection();return a?a.toString():""}return"control"==this.getType()?null:c.selection.createRange().text};
this.getSelectedHtml=function(){if(c.getSelection){var a=d.getSelection();if(a&&a.rangeCount){var e,g="";for(e=0;e<a.rangeCount;e++){var k=a.getRangeAt(e).cloneContents(),f=c.createElement("div");f.appendChild(k);g+=f.innerHTML}return g}return null}return"control"==this.getType()?null:c.selection.createRange().htmlText};this.getSelectedElement=function(){if("control"==this.getType()){if(c.getSelection){var a=d.getSelection();return a.anchorNode.childNodes[a.anchorOffset]}if((a=c.selection.createRange())&&
a.item)return c.selection.createRange().item(0)}return null};this.getParentElement=function(){if("control"==this.getType()){var a=this.getSelectedElement();if(a)return a.parentNode}else if(c.getSelection){if(a=c.getSelection()){for(a=a.anchorNode;a&&1!=a.nodeType;)a=a.parentNode;return a}}else return a=c.selection.createRange(),a.collapse(!0),a.parentElement();return null};this.hasAncestorElement=function(a){return null!=this.getAncestorElement.apply(this,arguments)};this.getAncestorElement=function(a){var c=
this.getSelectedElement()||this.getParentElement();return this.getParentOfType(c,arguments)};this.isTag=function(a,c){if(a&&a.tagName)for(var d=a.tagName.toLowerCase(),e=0;e<c.length;e++){var f=String(c[e]).toLowerCase();if(d==f)return f}return""};this.getParentOfType=function(a,c){for(;a;){if(this.isTag(a,c).length)return a;a=a.parentNode}return null};this.collapse=function(a){if(c.getSelection){var e=d.getSelection();e.removeAllRanges?a?e.collapseToStart():e.collapseToEnd():e.collapse(a)}else e=
c.selection.createRange(),e.collapse(a),e.select()};this.remove=function(){var a=c.selection;c.getSelection?(a=d.getSelection(),a.deleteFromDocument()):"none"!=a.type.toLowerCase()&&a.clear();return a};this.selectElementChildren=function(a,e){var g;a=n.byId(a);if(c.getSelection){var l=d.getSelection();m("opera")?(g=l.rangeCount?l.getRangeAt(0):c.createRange(),g.setStart(a,0),g.setEnd(a,3==a.nodeType?a.length:a.childNodes.length),l.addRange(g)):l.selectAllChildren(a)}else if(g=a.ownerDocument.body.createTextRange(),
g.moveToElementText(a),!e)try{g.select()}catch(f){}};this.selectElement=function(a,d){var e;a=n.byId(a);if(c.getSelection){var g=c.getSelection();e=c.createRange();g.removeAllRanges&&(m("opera")&&g.getRangeAt(0)&&(e=g.getRangeAt(0)),e.selectNode(a),g.removeAllRanges(),g.addRange(e))}else try{g=a.tagName?a.tagName.toLowerCase():"",e="img"===g||"table"===g?h.body(c).createControlRange():h.body(c).createRange(),e.addElement(a),d||e.select()}catch(f){this.selectElementChildren(a,d)}};this.inSelection=
function(a){if(a){var e,g;if(c.getSelection){var k=d.getSelection();k&&0<k.rangeCount&&(g=k.getRangeAt(0));if(g&&g.compareBoundaryPoints&&c.createRange)try{if(e=c.createRange(),e.setStart(a,0),1===g.compareBoundaryPoints(g.START_TO_END,e))return!0}catch(f){}}else{g=c.selection.createRange();try{e=a.ownerDocument.body.createTextRange(),e.moveToElementText(a)}catch(f){}if(g&&e&&1===g.compareEndPoints("EndToStart",e))return!0}}return!1};this.getBookmark=function(){var a,g,k=c.selection,h=e.curNode;if(c.getSelection){if(k=
d.getSelection())if(k.isCollapsed){if(a=h?h.tagName:"")if(a=a.toLowerCase(),"textarea"==a||"input"==a&&(!h.type||"text"==h.type.toLowerCase()))return k={start:h.selectionStart,end:h.selectionEnd,node:h,pRange:!0},{isCollapsed:k.end<=k.start,mark:k};a={isCollapsed:!0};k.rangeCount&&(a.mark=k.getRangeAt(0).cloneRange())}else g=k.getRangeAt(0),a={isCollapsed:!1,mark:g.cloneRange()}}else if(k){a=h?h.tagName:"";a=a.toLowerCase();if(h&&a&&("button"==a||"textarea"==a||"input"==a)){if(k.type&&"none"==k.type.toLowerCase())return{isCollapsed:!0,
mark:null};g=k.createRange();return{isCollapsed:g.text&&g.text.length?!1:!0,mark:{range:g,pRange:!0}}}a={};try{g=k.createRange(),a.isCollapsed=!("Text"==k.type?g.htmlText.length:g.length)}catch(f){return a.isCollapsed=!0,a}if("CONTROL"==k.type.toUpperCase())if(g.length)for(a.mark=[],k=0,h=g.length;k<h;)a.mark.push(g.item(k++));else a.isCollapsed=!0,a.mark=null;else a.mark=g.getBookmark()}else console.warn("No idea how to store the current selection for this browser!");return a};this.moveToBookmark=
function(a){if(a=a.mark)if(c.getSelection){var e=d.getSelection();e&&e.removeAllRanges?a.pRange?(e=a.node,e.selectionStart=a.start,e.selectionEnd=a.end):(e.removeAllRanges(),e.addRange(a)):console.warn("No idea how to restore selection for this browser!")}else if(c.selection&&a){var g;a.pRange?g=a.range:p.isArray(a)?(g=c.body.createControlRange(),r.forEach(a,function(a){g.addElement(a)})):(g=c.body.createTextRange(),g.moveToBookmark(a));g.select()}};this.isCollapsed=function(){return this.getBookmark().isCollapsed}},
d=new k(window);d.SelectionManager=k;return d})},"dijit/_editor/range":function(){define(["dojo/_base/array","dojo/_base/declare","dojo/_base/lang"],function(r,n,p){var m={getIndex:function(e,d){for(var g=[],c=[],a=e,l,k;e!=d;){var h=0;for(l=e.parentNode;k=l.childNodes[h++];)if(k===e){--h;break}g.unshift(h);c.unshift(h-l.childNodes.length);e=l}if(0<g.length&&3==a.nodeType){for(k=a.previousSibling;k&&3==k.nodeType;)g[g.length-1]--,k=k.previousSibling;for(k=a.nextSibling;k&&3==k.nodeType;)c[c.length-
1]++,k=k.nextSibling}return{o:g,r:c}},getNode:function(e,d){if(!p.isArray(e)||0==e.length)return d;var g=d;r.every(e,function(c){if(0<=c&&c<g.childNodes.length)g=g.childNodes[c];else return g=null,!1;return!0});return g},getCommonAncestor:function(e,d,g){g=g||e.ownerDocument.body;var c=function(a){for(var c=[];a;)if(c.unshift(a),a!==g)a=a.parentNode;else break;return c};e=c(e);d=c(d);for(var c=Math.min(e.length,d.length),a=e[0],l=1;l<c;l++)if(e[l]===d[l])a=e[l];else break;return a},getAncestor:function(e,
d,g){for(g=g||e.ownerDocument.body;e&&e!==g;){var c=e.nodeName.toUpperCase();if(d.test(c))return e;e=e.parentNode}return null},BlockTagNames:/^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DT|DE)$/,getBlockAncestor:function(e,d,g){g=g||e.ownerDocument.body;d=d||m.BlockTagNames;for(var c=null,a;e&&e!==g;){var l=e.nodeName.toUpperCase();!c&&d.test(l)&&(c=e);!a&&/^(?:BODY|TD|TH|CAPTION)$/.test(l)&&(a=e);e=e.parentNode}return{blockNode:c,blockContainer:a||e.ownerDocument.body}},atBeginningOfContainer:function(e,
d,g){var c=!1,a=0==g;a||3!=d.nodeType||/^[\s\xA0]+$/.test(d.nodeValue.substr(0,g))&&(a=!0);if(a)for(c=!0;d&&d!==e;){if(d.previousSibling){c=!1;break}d=d.parentNode}return c},atEndOfContainer:function(e,d,g){var c=!1,a=g==(d.length||d.childNodes.length);a||3!=d.nodeType||/^[\s\xA0]+$/.test(d.nodeValue.substr(g))&&(a=!0);if(a)for(c=!0;d&&d!==e;){if(d.nextSibling){c=!1;break}d=d.parentNode}return c},adjacentNoneTextNode:function(e,d){for(var g=e,c=0-e.length||0,a=d?"nextSibling":"previousSibling";g&&
3==g.nodeType;)c+=g.length,g=g[a];return[g,c]},create:function(k){k=k||window;return k.getSelection?k.document.createRange():new e},getSelection:function(e,d){if(e.getSelection)return e.getSelection();var g=new h.selection(e);d||g._getCurrentSelection();return g}};if(!window.getSelection)var h=m.ie={cachedSelection:{},selection:function(k){this._ranges=[];this.addRange=function(d,e){this._ranges.push(d);e||d._select();this.rangeCount=this._ranges.length};this.removeAllRanges=function(){this._ranges=
[];this.rangeCount=0};this.getRangeAt=function(d){return this._ranges[d]};this._getCurrentSelection=function(){this.removeAllRanges();var d;d=k.document.selection.createRange();d="CONTROL"==k.document.selection.type.toUpperCase()?new e(h.decomposeControlRange(d)):new e(h.decomposeTextRange(d));this.addRange(d,!0),this.isCollapsed=d.collapsed}},decomposeControlRange:function(e){var d=e.item(0),g=e.item(e.length-1);e=d.parentNode;var c=g.parentNode,d=m.getIndex(d,e).o[0],g=m.getIndex(g,c).o[0]+1;return[e,
d,c,g]},getEndPoint:function(e,d){var g=e.duplicate();g.collapse(!d);var c="EndTo"+(d?"End":"Start"),a=g.parentElement(),l,k,h;0<a.childNodes.length?r.every(a.childNodes,function(b,d){var f;if(3!=b.nodeType)if(g.moveToElementText(b),0<g.compareEndPoints(c,e))if(h&&3==h.nodeType)l=h,f=!0;else return l=a,k=d,!1;else{if(d==a.childNodes.length-1)return l=a,k=a.childNodes.length,!1}else d==a.childNodes.length-1&&(l=b,f=!0);if(f&&l){l=(f=m.adjacentNoneTextNode(l)[0])?f.nextSibling:a.firstChild;var q=m.adjacentNoneTextNode(l);
f=q[0];q=q[1];f?(g.moveToElementText(f),g.collapse(!1)):g.moveToElementText(a);g.setEndPoint(c,e);k=g.text.length-q;return!1}h=b;return!0}):(l=a,k=0);if(!d&&1==l.nodeType&&k==l.childNodes.length){var f=l.nextSibling;f&&3==f.nodeType&&(l=f,k=0)}return[l,k]},setEndPoint:function(e,d,g){e=e.duplicate();var c;if(3!=d.nodeType)if(0<g){if(c=d.childNodes[g-1])if(3==c.nodeType)d=c,g=c.length;else if(c.nextSibling&&3==c.nextSibling.nodeType)d=c.nextSibling,g=0;else{e.moveToElementText(c.nextSibling?c:d);var a=
c.parentNode;c=a.insertBefore(c.ownerDocument.createTextNode(" "),c.nextSibling);e.collapse(!1);a.removeChild(c)}}else e.moveToElementText(d),e.collapse(!0);3==d.nodeType&&(c=m.adjacentNoneTextNode(d),a=c[0],c=c[1],a?(e.moveToElementText(a),e.collapse(!1),"inherit"!=a.contentEditable&&c++):(e.moveToElementText(d.parentNode),e.collapse(!0),e.move("character",1),e.move("character",-1)),g+=c,0<g&&e.move("character",g)!=g&&console.error("Error when moving!"));return e},decomposeTextRange:function(e){var d=
h.getEndPoint(e),g=d[0],c=d[1],a=d[0],d=d[1];e.htmlText.length&&(e.htmlText==e.text?d=c+e.text.length:(d=h.getEndPoint(e,!0),a=d[0],d=d[1]));return[g,c,a,d]},setRange:function(e,d,g,c,a,l){d=h.setEndPoint(e,d,g);e.setEndPoint("StartToStart",d);if(!l)var k=h.setEndPoint(e,c,a);e.setEndPoint("EndToEnd",k||d);return e}},e=m.W3CRange=n(null,{constructor:function(){0<arguments.length?(this.setStart(arguments[0][0],arguments[0][1]),this.setEnd(arguments[0][2],arguments[0][3])):(this.startContainer=this.commonAncestorContainer=
null,this.startOffset=0,this.endContainer=null,this.endOffset=0,this.collapsed=!0)},_updateInternal:function(){this.commonAncestorContainer=this.startContainer!==this.endContainer?m.getCommonAncestor(this.startContainer,this.endContainer):this.startContainer;this.collapsed=this.startContainer===this.endContainer&&this.startOffset==this.endOffset},setStart:function(e,d){d=parseInt(d);if(this.startContainer!==e||this.startOffset!=d)delete this._cachedBookmark,this.startContainer=e,this.startOffset=
d,this.endContainer?this._updateInternal():this.setEnd(e,d)},setEnd:function(e,d){d=parseInt(d);if(this.endContainer!==e||this.endOffset!=d)delete this._cachedBookmark,this.endContainer=e,this.endOffset=d,this.startContainer?this._updateInternal():this.setStart(e,d)},setStartAfter:function(e,d){this._setPoint("setStart",e,d,1)},setStartBefore:function(e,d){this._setPoint("setStart",e,d,0)},setEndAfter:function(e,d){this._setPoint("setEnd",e,d,1)},setEndBefore:function(e,d){this._setPoint("setEnd",
e,d,0)},_setPoint:function(e,d,g,c){g=m.getIndex(d,d.parentNode).o;this[e](d.parentNode,g.pop()+c)},_getIERange:function(){var e=(this._body||this.endContainer.ownerDocument.body).createTextRange();h.setRange(e,this.startContainer,this.startOffset,this.endContainer,this.endOffset,this.collapsed);return e},getBookmark:function(){this._getIERange();return this._cachedBookmark},_select:function(){this._getIERange().select()},deleteContents:function(){var e=this.startContainer,d=this._getIERange();3!==
e.nodeType||this.startOffset||this.setStartBefore(e);d.pasteHTML("");this.endContainer=this.startContainer;this.endOffset=this.startOffset;this.collapsed=!0},cloneRange:function(){var k=new e([this.startContainer,this.startOffset,this.endContainer,this.endOffset]);k._body=this._body;return k},detach:function(){this.startContainer=this.commonAncestorContainer=this._body=null;this.startOffset=0;this.endContainer=null;this.endOffset=0;this.collapsed=!0}});p.setObject("dijit.range",m);return m})},"dijit/_editor/html":function(){define(["dojo/_base/array",
"dojo/_base/lang","dojo/sniff"],function(r,n,p){var m={};n.setObject("dijit._editor.html",m);var h=m.escapeXml=function(e,k){e=e.replace(/&/gm,"\x26amp;").replace(/</gm,"\x26lt;").replace(/>/gm,"\x26gt;").replace(/"/gm,"\x26quot;");k||(e=e.replace(/'/gm,"\x26#39;"));return e};m.getNodeHtml=function(e){var k=[];m.getNodeHtmlHelper(e,k);return k.join("")};m.getNodeHtmlHelper=function(e,k){switch(e.nodeType){case 1:var d=e.nodeName.toLowerCase();if(!d||"/"==d.charAt(0))return"";k.push("\x3c",d);var g=
[],c={},a;if(p("dom-attributes-explicit")||p("dom-attributes-specified-flag"))for(var l=0;a=e.attributes[l++];){var t=a.name;"_dj"===t.substr(0,3)||p("dom-attributes-specified-flag")&&!a.specified||t in c||(a=a.value,("src"==t||"href"==t)&&e.getAttribute("_djrealurl")&&(a=e.getAttribute("_djrealurl")),8===p("ie")&&"style"===t&&(a=a.replace("HEIGHT:","height:").replace("WIDTH:","width:")),g.push([t,a]),c[t]=a)}else{var n=(/^input$|^img$/i.test(e.nodeName)?e:e.cloneNode(!1)).outerHTML,c=n.match(/[\w-]+=("[^"]*"|'[^']*'|\S*)/gi),
n=n.substr(0,n.indexOf("\x3e"));r.forEach(c,function(a){if(a){var b=a.indexOf("\x3d");if(0<b&&(a=a.substring(0,b),"_dj"!=a.substr(0,3)))if("src"!=a&&"href"!=a||!e.getAttribute("_djrealurl")){var c;switch(a){case "style":c=e.style.cssText.toLowerCase();break;case "class":c=e.className;break;case "width":if("img"===d){(b=/width=(\S+)/i.exec(n))&&(c=b[1]);break}case "height":if("img"===d){(b=/height=(\S+)/i.exec(n))&&(c=b[1]);break}default:c=e.getAttribute(a)}null!=c&&g.push([a,c.toString()])}else g.push([a,
e.getAttribute("_djrealurl")])}},this)}g.sort(function(a,b){return a[0]<b[0]?-1:a[0]==b[0]?0:1});for(c=0;a=g[c++];)k.push(" ",a[0],'\x3d"',"string"===typeof a[1]?h(a[1],!0):a[1],'"');switch(d){case "br":case "hr":case "img":case "input":case "base":case "meta":case "area":case "basefont":k.push(" /\x3e");break;case "script":k.push("\x3e",e.innerHTML,"\x3c/",d,"\x3e");break;default:k.push("\x3e"),e.hasChildNodes()&&m.getChildrenHtmlHelper(e,k),k.push("\x3c/",d,"\x3e")}break;case 4:case 3:k.push(h(e.nodeValue,
!0));break;case 8:k.push("\x3c!--",h(e.nodeValue,!0),"--\x3e");break;default:k.push("\x3c!-- Element not recognized - Type: ",e.nodeType," Name: ",e.nodeName,"--\x3e")}};m.getChildrenHtml=function(e){var k=[];m.getChildrenHtmlHelper(e,k);return k.join("")};m.getChildrenHtmlHelper=function(e,k){if(e)for(var d=e.childNodes||e,g=!p("ie")||d!==e,c,a=0;c=d[a++];)g&&c.parentNode!=e||m.getNodeHtmlHelper(c,k)};return m})},"dijit/_editor/plugins/LinkDialog":function(){define("require dojo/_base/declare dojo/dom-attr dojo/keys dojo/_base/lang dojo/on dojo/sniff dojo/query dojo/string ../_Plugin ../../form/DropDownButton ../range".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l){var t=n("dijit._editor.plugins.LinkDialog",c,{buttonClass:a,useDefaultCommand:!1,urlRegExp:"((https?|ftps?|file)\\://|./|../|/|)(/[a-zA-Z]{1,1}:/|)(((?:(?:[\\da-zA-Z](?:[-\\da-zA-Z]{0,61}[\\da-zA-Z])?)\\.)*(?:[a-zA-Z](?:[-\\da-zA-Z]{0,80}[\\da-zA-Z])?)\\.?)|(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])|(0[xX]0*[\\da-fA-F]?[\\da-fA-F]\\.){3}0[xX]0*[\\da-fA-F]?[\\da-fA-F]|(0+[0-3][0-7][0-7]\\.){3}0+[0-3][0-7][0-7]|(0|[1-9]\\d{0,8}|[1-3]\\d{9}|4[01]\\d{8}|42[0-8]\\d{7}|429[0-3]\\d{6}|4294[0-8]\\d{5}|42949[0-5]\\d{4}|429496[0-6]\\d{3}|4294967[01]\\d{2}|42949672[0-8]\\d|429496729[0-5])|0[xX]0*[\\da-fA-F]{1,8}|([\\da-fA-F]{1,4}\\:){7}[\\da-fA-F]{1,4}|([\\da-fA-F]{1,4}\\:){6}((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])))(\\:\\d+)?(/(?:[^?#\\s/]+/)*(?:[^?#\\s/]{0,}(?:\\?[^?#\\s/]*)?(?:#.*)?)?)?",
emailRegExp:"\x3c?(mailto\\:)([!#-'*+\\-\\/-9\x3d?A-Z^-~]+[.])*[!#-'*+\\-\\/-9\x3d?A-Z^-~]+@((?:(?:[\\da-zA-Z](?:[-\\da-zA-Z]{0,61}[\\da-zA-Z])?)\\.)+(?:[a-zA-Z](?:[-\\da-zA-Z]{0,6}[\\da-zA-Z])?)\\.?)|localhost|^[^-][a-zA-Z0-9_-]*\x3e?",htmlTemplate:'\x3ca href\x3d"${urlInput}" _djrealurl\x3d"${urlInput}" target\x3d"${targetSelect}"\x3e${textInput}\x3c/a\x3e',tag:"a",_hostRxp:/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/,_userAtRxp:/^([!#-'*+\-\/-9=?A-Z^-~]+[.])*[!#-'*+\-\/-9=?A-Z^-~]+@/i,
linkDialogTemplate:"\x3ctable role\x3d'presentation'\x3e\x3ctr\x3e\x3ctd\x3e\x3clabel for\x3d'${id}_urlInput'\x3e${url}\x3c/label\x3e\x3c/td\x3e\x3ctd\x3e\x3cinput data-dojo-type\x3d'dijit.form.ValidationTextBox' required\x3d'true' id\x3d'${id}_urlInput' name\x3d'urlInput' data-dojo-props\x3d'intermediateChanges:true'/\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x3clabel for\x3d'${id}_textInput'\x3e${text}\x3c/label\x3e\x3c/td\x3e\x3ctd\x3e\x3cinput data-dojo-type\x3d'dijit.form.ValidationTextBox' required\x3d'true' id\x3d'${id}_textInput' name\x3d'textInput' data-dojo-props\x3d'intermediateChanges:true'/\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x3clabel for\x3d'${id}_targetSelect'\x3e${target}\x3c/label\x3e\x3c/td\x3e\x3ctd\x3e\x3cselect id\x3d'${id}_targetSelect' name\x3d'targetSelect' data-dojo-type\x3d'dijit.form.Select'\x3e\x3coption selected\x3d'selected' value\x3d'_self'\x3e${currentWindow}\x3c/option\x3e\x3coption value\x3d'_blank'\x3e${newWindow}\x3c/option\x3e\x3coption value\x3d'_top'\x3e${topWindow}\x3c/option\x3e\x3coption value\x3d'_parent'\x3e${parentWindow}\x3c/option\x3e\x3c/select\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d'2'\x3e\x3cbutton data-dojo-type\x3d'dijit.form.Button' type\x3d'submit' id\x3d'${id}_setButton'\x3e${set}\x3c/button\x3e\x3cbutton data-dojo-type\x3d'dijit.form.Button' type\x3d'button' id\x3d'${id}_cancelButton'\x3e${buttonCancel}\x3c/button\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e",
_initButton:function(){this.inherited(arguments);this.button.loadDropDown=h.hitch(this,"_loadDropDown");this._connectTagEvents()},_loadDropDown:function(a){r("dojo/i18n ../../TooltipDialog ../../registry ../../form/Button ../../form/Select ../../form/ValidationTextBox dojo/i18n!../../nls/common dojo/i18n!../nls/LinkDialog".split(" "),h.hitch(this,function(b,c,d){var f=this;this.tag="insertImage"==this.command?"img":"a";b=h.delegate(b.getLocalization("dijit","common",this.lang),b.getLocalization("dijit._editor",
"LinkDialog",this.lang));var l=this.dropDown=this.button.dropDown=new c({title:b[this.command+"Title"],ownerDocument:this.editor.ownerDocument,dir:this.editor.dir,execute:h.hitch(this,"setValue"),onOpen:function(){f._onOpenDialog();c.prototype.onOpen.apply(this,arguments)},onCancel:function(){setTimeout(h.hitch(f,"_onCloseDialog"),0)}});b.urlRegExp=this.urlRegExp;b.id=d.getUniqueId(this.editor.id);this._uniqueId=b.id;this._setContent(l.title+"\x3cdiv style\x3d'border-bottom: 1px black solid;padding-bottom:2pt;margin-bottom:4pt'\x3e\x3c/div\x3e"+
g.substitute(this.linkDialogTemplate,b));l.startup();this._urlInput=d.byId(this._uniqueId+"_urlInput");this._textInput=d.byId(this._uniqueId+"_textInput");this._setButton=d.byId(this._uniqueId+"_setButton");this.own(d.byId(this._uniqueId+"_cancelButton").on("click",h.hitch(this.dropDown,"onCancel")));this._urlInput&&this.own(this._urlInput.on("change",h.hitch(this,"_checkAndFixInput")));this._textInput&&this.own(this._textInput.on("change",h.hitch(this,"_checkAndFixInput")));this._urlRegExp=new RegExp("^"+
this.urlRegExp+"$","i");this._emailRegExp=new RegExp("^"+this.emailRegExp+"$","i");this._urlInput.isValid=h.hitch(this,function(){var a=this._urlInput.get("value");return this._urlRegExp.test(a)||this._emailRegExp.test(a)});this.own(e(l.domNode,"keydown",h.hitch(this,h.hitch(this,function(a){!a||a.keyCode!=m.ENTER||a.shiftKey||a.metaKey||a.ctrlKey||a.altKey||this._setButton.get("disabled")||(l.onExecute(),l.execute(l.get("value")))}))));a()}))},_checkAndFixInput:function(){var a=this,b=this._urlInput.get("value");
this._delayedCheck&&(clearTimeout(this._delayedCheck),this._delayedCheck=null);this._delayedCheck=setTimeout(function(){var c=b,d=!1,e=!1;c&&1<c.length&&(c=h.trim(c),0!==c.indexOf("mailto:")&&(0<c.indexOf("/")?-1===c.indexOf("://")&&"/"!==c.charAt(0)&&c.indexOf("./")&&0!==c.indexOf("../")&&a._hostRxp.test(c)&&(d=!0):a._userAtRxp.test(c)&&(e=!0)));d&&a._urlInput.set("value","http://"+c);e&&a._urlInput.set("value","mailto:"+c);a._setButton.set("disabled",!a._isValid())},250)},_connectTagEvents:function(){this.editor.onLoadDeferred.then(h.hitch(this,
function(){this.own(e(this.editor.editNode,"dblclick",h.hitch(this,"_onDblClick")))}))},_isValid:function(){return this._urlInput.isValid()&&this._textInput.isValid()},_setContent:function(a){this.dropDown.set({parserScope:"dojo",content:a})},_checkValues:function(a){a&&a.urlInput&&(a.urlInput=a.urlInput.replace(/"/g,"\x26quot;"));return a},setValue:function(a){this._onCloseDialog();if(9>k("ie")){var b=l.getSelection(this.editor.window).getRangeAt(0).endContainer;3===b.nodeType&&(b=b.parentNode);
b&&b.nodeName&&b.nodeName.toLowerCase()!==this.tag&&(b=this.editor.selection.getSelectedElement(this.tag));b&&b.nodeName&&b.nodeName.toLowerCase()===this.tag&&this.editor.queryCommandEnabled("unlink")&&(this.editor.selection.selectElementChildren(b),this.editor.execCommand("unlink"))}a=this._checkValues(a);this.editor.execCommand("inserthtml",g.substitute(this.htmlTemplate,a));d("a",this.editor.document).forEach(function(a){a.innerHTML||p.has(a,"name")||a.parentNode.removeChild(a)},this)},_onCloseDialog:function(){this.editor.focused&&
this.editor.focus()},_getCurrentValues:function(a){var b,c,d;a&&a.tagName.toLowerCase()===this.tag?(b=a.getAttribute("_djrealurl")||a.getAttribute("href"),d=a.getAttribute("target")||"_self",c=a.textContent||a.innerText,this.editor.selection.selectElement(a,!0)):c=this.editor.selection.getSelectedText();return{urlInput:b||"",textInput:c||"",targetSelect:d||""}},_onOpenDialog:function(){var a,b;if(k("ie")){if(b=l.getSelection(this.editor.window),b.rangeCount){var c=b.getRangeAt(0);a=c.endContainer;
3===a.nodeType&&(a=a.parentNode);a&&a.nodeName&&a.nodeName.toLowerCase()!==this.tag&&(a=this.editor.selection.getSelectedElement(this.tag));if(!a||a.nodeName&&a.nodeName.toLowerCase()!==this.tag)(b=this.editor.selection.getAncestorElement(this.tag))&&b.nodeName&&b.nodeName.toLowerCase()==this.tag?(a=b,this.editor.selection.selectElement(a)):c.startContainer===c.endContainer&&(b=c.startContainer.firstChild)&&b.nodeName&&b.nodeName.toLowerCase()==this.tag&&(a=b,this.editor.selection.selectElement(a))}}else a=
this.editor.selection.getAncestorElement(this.tag);this.dropDown.reset();this._setButton.set("disabled",!0);this.dropDown.set("value",this._getCurrentValues(a))},_onDblClick:function(a){if(a&&a.target&&(a=a.target,(a.tagName?a.tagName.toLowerCase():"")===this.tag&&p.get(a,"href"))){var b=this.editor;this.editor.selection.selectElement(a);b.onDisplayChanged();b._updateTimer&&(b._updateTimer.remove(),delete b._updateTimer);b.onNormalizedDisplayChanged();var c=this.button;setTimeout(function(){c.set("disabled",
!1);c.loadAndOpenDropDown().then(function(){c.dropDown.focus&&c.dropDown.focus()})},10)}}}),v=n("dijit._editor.plugins.ImgLinkDialog",[t],{linkDialogTemplate:"\x3ctable role\x3d'presentation'\x3e\x3ctr\x3e\x3ctd\x3e\x3clabel for\x3d'${id}_urlInput'\x3e${url}\x3c/label\x3e\x3c/td\x3e\x3ctd\x3e\x3cinput dojoType\x3d'dijit.form.ValidationTextBox' regExp\x3d'${urlRegExp}' required\x3d'true' id\x3d'${id}_urlInput' name\x3d'urlInput' data-dojo-props\x3d'intermediateChanges:true'/\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x3clabel for\x3d'${id}_textInput'\x3e${text}\x3c/label\x3e\x3c/td\x3e\x3ctd\x3e\x3cinput data-dojo-type\x3d'dijit.form.ValidationTextBox' required\x3d'false' id\x3d'${id}_textInput' name\x3d'textInput' data-dojo-props\x3d'intermediateChanges:true'/\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d'2'\x3e\x3cbutton data-dojo-type\x3d'dijit.form.Button' type\x3d'submit' id\x3d'${id}_setButton'\x3e${set}\x3c/button\x3e\x3cbutton data-dojo-type\x3d'dijit.form.Button' type\x3d'button' id\x3d'${id}_cancelButton'\x3e${buttonCancel}\x3c/button\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e",
htmlTemplate:'\x3cimg src\x3d"${urlInput}" _djrealurl\x3d"${urlInput}" alt\x3d"${textInput}" /\x3e',tag:"img",_getCurrentValues:function(a){var b,c;a&&a.tagName.toLowerCase()===this.tag?(b=a.getAttribute("_djrealurl")||a.getAttribute("src"),c=a.getAttribute("alt"),this.editor.selection.selectElement(a,!0)):c=this.editor.selection.getSelectedText();return{urlInput:b||"",textInput:c||""}},_isValid:function(){return this._urlInput.isValid()},_connectTagEvents:function(){this.inherited(arguments);this.editor.onLoadDeferred.then(h.hitch(this,
function(){this.own(e(this.editor.editNode,"mousedown",h.hitch(this,"_selectTag")))}))},_selectTag:function(a){a&&a.target&&(a=a.target,(a.tagName?a.tagName.toLowerCase():"")===this.tag&&this.editor.selection.selectElement(a))},_checkValues:function(a){a&&a.urlInput&&(a.urlInput=a.urlInput.replace(/"/g,"\x26quot;"));a&&a.textInput&&(a.textInput=a.textInput.replace(/"/g,"\x26quot;"));return a},_onDblClick:function(a){if(a&&a.target&&(a=a.target,(a.tagName?a.tagName.toLowerCase():"")===this.tag&&p.get(a,
"src"))){var b=this.editor;this.editor.selection.selectElement(a);b.onDisplayChanged();b._updateTimer&&(b._updateTimer.remove(),delete b._updateTimer);b.onNormalizedDisplayChanged();var c=this.button;setTimeout(function(){c.set("disabled",!1);c.loadAndOpenDropDown().then(function(){c.dropDown.focus&&c.dropDown.focus()})},10)}}});c.registry.createLink=function(){return new t({command:"createLink"})};c.registry.insertImage=function(){return new v({command:"insertImage"})};t.ImgLinkDialog=v;return t})},
"dijit/form/DropDownButton":function(){define("dojo/_base/declare dojo/_base/kernel dojo/_base/lang dojo/query ../registry ../popup ./Button ../_Container ../_HasDropDown dojo/text!./templates/DropDownButton.html ../a11yclick".split(" "),function(r,n,p,m,h,e,k,d,g,c){return r("dijit.form.DropDownButton",[k,d,g],{baseClass:"dijitDropDownButton",templateString:c,_fillContent:function(){var a=this.srcNodeRef,c=this.containerNode;if(a&&c)for(;a.hasChildNodes();){var d=a.firstChild;d.hasAttribute&&(d.hasAttribute("data-dojo-type")||
d.hasAttribute("dojoType")||d.hasAttribute("data-"+n._scopeName+"-type")||d.hasAttribute(n._scopeName+"Type"))?(this.dropDownContainer=this.ownerDocument.createElement("div"),this.dropDownContainer.appendChild(d)):c.appendChild(d)}},startup:function(){this._started||(!this.dropDown&&this.dropDownContainer&&(this.dropDown=h.byNode(this.dropDownContainer.firstChild),delete this.dropDownContainer),this.dropDown&&e.hide(this.dropDown),this.inherited(arguments))},isLoaded:function(){var a=this.dropDown;
return!!a&&(!a.href||a.isLoaded)},loadDropDown:function(a){var c=this.dropDown,d=c.on("load",p.hitch(this,function(){d.remove();a()}));c.refresh()},isFocusable:function(){return this.inherited(arguments)&&!this._mouseDown}})})},"dijit/_HasDropDown":function(){define("dojo/_base/declare dojo/_base/Deferred dojo/dom dojo/dom-attr dojo/dom-class dojo/dom-geometry dojo/dom-style dojo/has dojo/keys dojo/_base/lang dojo/on dojo/touch ./registry ./focus ./popup ./_FocusMixin".split(" "),function(r,n,p,m,
h,e,k,d,g,c,a,l,t,v,f,b){return r("dijit._HasDropDown",b,{_buttonNode:null,_arrowWrapperNode:null,_popupStateNode:null,_aroundNode:null,dropDown:null,autoWidth:!0,forceWidth:!1,maxHeight:-1,dropDownPosition:["below","above"],_stopClickEvents:!0,_onDropDownMouseDown:function(b){this.disabled||this.readOnly||("MSPointerDown"!=b.type&&b.preventDefault(),this.own(a.once(this.ownerDocument,l.release,c.hitch(this,"_onDropDownMouseUp"))),this.toggleDropDown())},_onDropDownMouseUp:function(a){var b=this.dropDown,
c=!1;if(a&&this._opened){var d=e.position(this._buttonNode,!0);if(!(a.pageX>=d.x&&a.pageX<=d.x+d.w&&a.pageY>=d.y&&a.pageY<=d.y+d.h)){for(d=a.target;d&&!c;)h.contains(d,"dijitPopup")?c=!0:d=d.parentNode;if(c){d=a.target;if(b.onItemClick){for(var f;d&&!(f=t.byNode(d));)d=d.parentNode;if(f&&f.onClick&&f.getParent)f.getParent().onItemClick(f,a)}return}}}this._opened?b.focus&&(!1!==b.autoFocus||"mouseup"==a.type&&!this.hovering)&&(this._focusDropDownTimer=this.defer(function(){b.focus();delete this._focusDropDownTimer})):
this.focus&&this.defer("focus")},_onDropDownClick:function(a){this._stopClickEvents&&(a.stopPropagation(),a.preventDefault())},buildRendering:function(){this.inherited(arguments);this._buttonNode=this._buttonNode||this.focusNode||this.domNode;this._popupStateNode=this._popupStateNode||this.focusNode||this._buttonNode;var a={after:this.isLeftToRight()?"Right":"Left",before:this.isLeftToRight()?"Left":"Right",above:"Up",below:"Down",left:"Left",right:"Right"}[this.dropDownPosition[0]]||this.dropDownPosition[0]||
"Down";h.add(this._arrowWrapperNode||this._buttonNode,"dijit"+a+"ArrowButton")},postCreate:function(){this.inherited(arguments);var b=this.focusNode||this.domNode;this.own(a(this._buttonNode,l.press,c.hitch(this,"_onDropDownMouseDown")),a(this._buttonNode,"click",c.hitch(this,"_onDropDownClick")),a(b,"keydown",c.hitch(this,"_onKey")),a(b,"keyup",c.hitch(this,"_onKeyUp")))},destroy:function(){this._opened&&this.closeDropDown(!0);this.dropDown&&(this.dropDown._destroyed||this.dropDown.destroyRecursive(),
delete this.dropDown);this.inherited(arguments)},_onKey:function(a){if(!this.disabled&&!this.readOnly){var b=this.dropDown,c=a.target;b&&this._opened&&b.handleKey&&!1===b.handleKey(a)?(a.stopPropagation(),a.preventDefault()):b&&this._opened&&a.keyCode==g.ESCAPE?(this.closeDropDown(),a.stopPropagation(),a.preventDefault()):!this._opened&&(a.keyCode==g.DOWN_ARROW||(a.keyCode==g.ENTER||a.keyCode==g.SPACE&&(!this._searchTimer||a.ctrlKey||a.altKey||a.metaKey))&&("input"!==(c.tagName||"").toLowerCase()||
c.type&&"text"!==c.type.toLowerCase()))&&(this._toggleOnKeyUp=!0,a.stopPropagation(),a.preventDefault())}},_onKeyUp:function(){if(this._toggleOnKeyUp){delete this._toggleOnKeyUp;this.toggleDropDown();var a=this.dropDown;a&&a.focus&&this.defer(c.hitch(a,"focus"),1)}},_onBlur:function(){this.closeDropDown(!1);this.inherited(arguments)},isLoaded:function(){return!0},loadDropDown:function(a){a()},loadAndOpenDropDown:function(){var a=new n,b=c.hitch(this,function(){this.openDropDown();a.resolve(this.dropDown)});
this.isLoaded()?b():this.loadDropDown(b);return a},toggleDropDown:function(){this.disabled||this.readOnly||(this._opened?this.closeDropDown(!0):this.loadAndOpenDropDown())},openDropDown:function(){var a=this.dropDown,b=a.domNode,d=this._aroundNode||this.domNode,g=this,l=f.open({parent:this,popup:a,around:d,orient:this.dropDownPosition,maxHeight:this.maxHeight,onExecute:function(){g.closeDropDown(!0)},onCancel:function(){g.closeDropDown(!0)},onClose:function(){m.set(g._popupStateNode,"popupActive",
!1);h.remove(g._popupStateNode,"dijitHasDropDownOpen");g._set("_opened",!1)}});if(this.forceWidth||this.autoWidth&&d.offsetWidth>a._popupWrapper.offsetWidth){var d=d.offsetWidth-a._popupWrapper.offsetWidth,k={w:a.domNode.offsetWidth+d};this._origStyle=b.style.cssText;c.isFunction(a.resize)?a.resize(k):e.setMarginBox(b,k);"R"==l.corner[1]&&(a._popupWrapper.style.left=a._popupWrapper.style.left.replace("px","")-d+"px")}m.set(this._popupStateNode,"popupActive","true");h.add(this._popupStateNode,"dijitHasDropDownOpen");
this._set("_opened",!0);this._popupStateNode.setAttribute("aria-expanded","true");this._popupStateNode.setAttribute("aria-owns",a.id);"presentation"===b.getAttribute("role")||b.getAttribute("aria-labelledby")||b.setAttribute("aria-labelledby",this.id);return l},closeDropDown:function(a){this._focusDropDownTimer&&(this._focusDropDownTimer.remove(),delete this._focusDropDownTimer);this._opened&&(this._popupStateNode.setAttribute("aria-expanded","false"),a&&this.focus&&this.focus(),f.close(this.dropDown),
this._opened=!1);this._origStyle&&(this.dropDown.domNode.style.cssText=this._origStyle,delete this._origStyle)}})})},"dijit/_editor/plugins/TextColor":function(){define("require dojo/colors dojo/_base/declare dojo/_base/lang ../_Plugin ../../form/DropDownButton".split(" "),function(r,n,p,m,h,e){var k=p("dijit._editor.plugins.TextColor",h,{buttonClass:e,colorPicker:"dijit/ColorPalette",useDefaultCommand:!1,_initButton:function(){this.command=this.name;this.inherited(arguments);var d=this;this.button.loadDropDown=
function(e){function c(a){d.button.dropDown=new a({dir:d.editor.dir,ownerDocument:d.editor.ownerDocument,value:d.value,onChange:function(a){d.editor.execCommand(d.command,a)},onExecute:function(){d.editor.execCommand(d.command,this.get("value"))}});e()}"string"==typeof d.colorPicker?r([d.colorPicker],c):c(d.colorPicker)}},updateState:function(){var d=this.editor,e=this.command;if(d&&d.isLoaded&&e.length){if(this.button){var c=this.get("disabled");this.button.set("disabled",c);if(c)return;var a;try{a=
d.queryCommandValue(e)||""}catch(l){a=""}}""==a&&(a="#000000");"transparent"==a&&(a="#ffffff");"string"==typeof a?-1<a.indexOf("rgb")&&(a=n.fromRgb(a).toHex()):(a=((a&255)<<16|a&65280|(a&16711680)>>>16).toString(16),a="#000000".slice(0,7-a.length)+a);this.value=a;(d=this.button.dropDown)&&d.get&&a!==d.get("value")&&d.set("value",a,!1)}}});h.registry.foreColor=function(d){return new k(d)};h.registry.hiliteColor=function(d){return new k(d)};return k})},"dojo/colors":function(){define(["./_base/kernel",
"./_base/lang","./_base/Color","./_base/array"],function(r,n,p,m){var h={};n.setObject("dojo.colors",h);var e=function(d,e,c){0>c&&++c;1<c&&--c;var a=6*c;return 1>a?d+(e-d)*a:1>2*c?e:2>3*c?d+(e-d)*(2/3-c)*6:d};r.colorFromRgb=p.fromRgb=function(d,g){var c=d.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(c){var a=c[2].split(/\s*,\s*/),l=a.length,c=c[1];if("rgb"==c&&3==l||"rgba"==c&&4==l)return c=a[0],"%"==c.charAt(c.length-1)?(c=m.map(a,function(a){return 2.56*parseFloat(a)}),4==l&&(c[3]=
a[3]),p.fromArray(c,g)):p.fromArray(a,g);if("hsl"==c&&3==l||"hsla"==c&&4==l){var c=(parseFloat(a[0])%360+360)%360/360,k=parseFloat(a[1])/100,h=parseFloat(a[2])/100,k=.5>=h?h*(k+1):h+k-h*k,h=2*h-k,c=[256*e(h,k,c+1/3),256*e(h,k,c),256*e(h,k,c-1/3),1];4==l&&(c[3]=a[3]);return p.fromArray(c,g)}}return null};var k=function(d,e,c){d=Number(d);return isNaN(d)?c:d<e?e:d>c?c:d};p.prototype.sanitize=function(){this.r=Math.round(k(this.r,0,255));this.g=Math.round(k(this.g,0,255));this.b=Math.round(k(this.b,
0,255));this.a=k(this.a,0,1);return this};h.makeGrey=p.makeGrey=function(d,e){return p.fromArray([d,d,d,e])};n.mixin(p.named,{aliceblue:[240,248,255],antiquewhite:[250,235,215],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],blanchedalmond:[255,235,205],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,
20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,
191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,
205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],mediumaquamarine:[102,205,170],mediumblue:[0,
0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],oldlace:[253,245,230],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,
238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],
tan:[210,180,140],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],whitesmoke:[245,245,245],yellowgreen:[154,205,50]});return p})},"esri/dijit/editing/AttachmentEditor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/array dojo/_base/kernel dojo/has dojo/query dojo/io-query dojo/dom-attr dijit/_Widget dijit/_Templated dijit/ProgressBar ../../kernel ../../lang ../../domUtils dojo/text!./templates/AttachmentEditor.html dojo/i18n!../../nls/jsapi dojo/NodeList-dom".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q){r=r([c,a],{declaredClass:"esri.dijit.editing.AttachmentEditor",widgetsInTemplate:!0,templateString:b,_listHtml:"\x3cspan id\x3d'node_${oid}_${attid}' style\x3d'display: flex;'\x3e\x3ca href\x3d'${href}' target\x3d'_blank'\x3e${name}\x3c/a\x3e",_deleteBtnHtml:"\x3cspan style\x3d'cursor:pointer;color:red;font-weight:bold;padding:0 2px;' class\x3d'deleteAttachment' id\x3d'${attid}');'\x3eX\x3c/span\x3e",_endHtml:"\x3cbr/\x3e\x3c/span\x3e",_aeConnects:[],_layerEditingCapChecked:{},
_layerEditingCap:{},constructor:function(a,b){n.mixin(this,q.widgets.attachmentEditor)},startup:function(){this.inherited(arguments);this._uploadField_connect=p.connect(this._uploadField,"onchange",this,function(){0<this._uploadField.value.length&&this._addAttachment()});this._uploadFieldFocus_connect=p.connect(this._uploadField,"onfocus",n.hitch(this,function(a){f.hide(this._attachmentError)}))},destroy:function(){m.forEach(this._aeConnects,p.disconnect);p.disconnect(this._uploadField_connect);p.disconnect(this._uploadFieldFocus_connect);
this.inherited(arguments)},showAttachments:function(a,b){this._attachmentList.innerHTML=this.NLS_none;this._uploadField.value="";m.forEach(this.domNode.children,function(a,b){f.show(a)});f.hide(this._attachmentError);a&&(this._featureLayer=a.getLayer()||b)&&("esri.layers.FeatureLayer"===this._featureLayer.declaredClass&&this._featureLayer.getEditCapabilities?(this._currentLayerId=this._featureLayer.id,this._layerEditingCapChecked[this._currentLayerId]||(this._layerEditingCap[this._currentLayerId]=
this._featureLayer.getEditCapabilities(),this._layerEditingCapChecked[this._currentLayerId]=!0),this._featureCanUpdate=this._featureLayer.getEditCapabilities({feature:a}).canUpdate,this._oid=a.attributes[this._featureLayer.objectIdField],this._getAttachments(a)):b&&b.getEditCapabilities()||(f.hide(this._uploadForm),m.forEach(this.domNode.children,function(a,b){f.hide(a)})))},_getAttachments:function(a){this._featureLayer&&this._featureLayer.queryAttachmentInfos&&this._featureLayer.queryAttachmentInfos(this._oid,
n.hitch(this,"_onQueryAttachmentInfosComplete"))},_addAttachment:function(){f.hide(this._attachmentError);this._featureLayer&&this._featureLayer.addAttachment?(f.show(this._attachmentProgress),this._featureLayer.addAttachment(this._oid,this._uploadForm,n.hitch(this,"_onAddAttachmentComplete"),n.hitch(this,"_onAddAttachmentError"))):this._tempUpload=this._uploadForm},_chainAttachment:function(a,b){this._tempUpload&&(f.show(this._attachmentProgress),b.addAttachment(a,this._tempUpload,n.hitch(this,"_onAddAttachmentComplete"),
n.hitch(this,"_onAddAttachmentError")));this._tempUpload=null},_deleteAttachment:function(a,b){f.show(this._attachmentProgress);this._featureLayer.deleteAttachments(a,[b],n.hitch(this,"_onDeleteAttachmentComplete"))},_onQueryAttachmentInfosComplete:function(a){var b=this._listHtml+this._deleteBtnHtml+this._endHtml;this._uploadForm.style.display="block";!this._featureCanUpdate&&this._layerEditingCap[this._currentLayerId].canUpdate||!this._layerEditingCap[this._currentLayerId].canCreate&&!this._layerEditingCap[this._currentLayerId].canUpdate?
(b=this._listHtml+this._endHtml,this._uploadForm.style.display="none"):this._layerEditingCap[this._currentLayerId].canCreate&&!this._layerEditingCap[this._currentLayerId].canUpdate&&(b=this._listHtml+this._endHtml);var c=this._attachmentList;a=m.map(a,n.hitch(this,function(a){return v.substitute({href:a.url,name:a.name,oid:a.objectId,attid:a.id},b)}));c.innerHTML=a.join("")||this.NLS_none;this._updateConnects()},_onAddAttachmentComplete:function(a){f.hide(this._attachmentProgress.domNode);var b=this._attachmentList,
c=this._uploadField,e=c.value,g=e.lastIndexOf("\\");-1<g&&(e=e.substring(g+1,e.length));var e=e.replace(/\ /g,"_"),g=d.objectToQuery({gdbVersion:this._featureLayer.gdbVersion,token:this._featureLayer._getToken()}),l=this._listHtml+this._deleteBtnHtml+this._endHtml;this._layerEditingCap[this._currentLayerId].canCreate&&!this._layerEditingCap[this._currentLayerId].canUpdate&&(l=this._listHtml+this._endHtml);a=v.substitute({href:this._featureLayer._url.path+"/"+a.objectId+"/attachments/"+a.attachmentId+
(g?"?"+g:""),name:e,oid:a.objectId,attid:a.attachmentId},l);b.innerHTML=b.innerHTML==this.NLS_none?a:b.innerHTML+a;this._updateConnects();c.value=""},_onAddAttachmentError:function(a){f.hide(this._attachmentProgress.domNode);if(a&&v.isDefined(a.code)){var b=this._attachmentError;g.set(b,"innerHTML",(400===a.code?this.NLS_fileNotSupported:a.message||a.details&&a.details.length&&a.details[0])||this.NLS_error);f.show(b)}},_onDeleteAttachmentComplete:function(a){f.hide(this._attachmentProgress.domNode);
var b=this._attachmentList;m.every(a,function(a){return a.success})&&(h.query("#node_"+a[0].objectId+"_"+a[0].attachmentId).orphan(),b.children&&b.children.length||(b.innerHTML=this.NLS_none))},_updateConnects:function(){m.forEach(this._aeConnects,p.disconnect);h.query(".deleteAttachment").forEach(function(a){this._aeConnects.push(p.connect(a,"onclick",n.hitch(this,"_deleteAttachment",this._oid,a.id)))},this)}});e("extend-esri")&&n.setObject("dijit.editing.AttachmentEditor",r,t);return r})},"dijit/ProgressBar":function(){define("require dojo/_base/declare dojo/dom-class dojo/_base/lang dojo/number ./_Widget ./_TemplatedMixin dojo/text!./templates/ProgressBar.html".split(" "),
function(r,n,p,m,h,e,k,d){return n("dijit.ProgressBar",[e,k],{progress:"0",value:"",maximum:100,places:0,indeterminate:!1,label:"",name:"",templateString:d,_indeterminateHighContrastImagePath:r.toUrl("./themes/a11y/indeterminate_progress.gif"),postMixInProperties:function(){this.inherited(arguments);this.params&&"value"in this.params||(this.value=this.indeterminate?Infinity:this.progress)},buildRendering:function(){this.inherited(arguments);this.indeterminateHighContrastImage.setAttribute("src",this._indeterminateHighContrastImagePath.toString());
this.update()},_setDirAttr:function(d){var c="rtl"==d.toLowerCase();p.toggle(this.domNode,"dijitProgressBarRtl",c);p.toggle(this.domNode,"dijitProgressBarIndeterminateRtl",this.indeterminate&&c);this.inherited(arguments)},update:function(d){m.mixin(this,d||{});d=this.internalProgress;var c=this.domNode,a=1;this.indeterminate?c.removeAttribute("aria-valuenow"):(-1!=String(this.progress).indexOf("%")?(a=Math.min(parseFloat(this.progress)/100,1),this.progress=a*this.maximum):(this.progress=Math.min(this.progress,
this.maximum),a=this.maximum?this.progress/this.maximum:0),c.setAttribute("aria-valuenow",this.progress));c.setAttribute("aria-labelledby",this.labelNode.id);c.setAttribute("aria-valuemin",0);c.setAttribute("aria-valuemax",this.maximum);this.labelNode.innerHTML=this.report(a);p.toggle(this.domNode,"dijitProgressBarIndeterminate",this.indeterminate);p.toggle(this.domNode,"dijitProgressBarIndeterminateRtl",this.indeterminate&&!this.isLeftToRight());d.style.width=100*a+"%";this.onChange()},_setValueAttr:function(d){this._set("value",
d);Infinity==d?this.update({indeterminate:!0}):this.update({indeterminate:!1,progress:d})},_setLabelAttr:function(d){this._set("label",d);this.update()},_setIndeterminateAttr:function(d){this._set("indeterminate",d);this.update()},report:function(d){return this.label?this.label:this.indeterminate?"\x26#160;":h.format(d,{type:"percent",places:this.places,locale:this.lang})},onChange:function(){}})})},"esri/dijit/editing/Util":function(){define(["dojo/_base/lang","dojo/_base/array","dojo/has","../../kernel"],
function(r,n,p,m){var h={},h={findFeatures:function(e,k,d){var g=k.objectIdField;k=n.filter(k.graphics,function(c){return n.some(e,function(a){return c.attributes[g]===a.objectId})});if(d)d(k);else return k},getSelection:function(e){var k=[];n.forEach(e,function(d){d=d.getSelectedFeatures();n.forEach(d,function(d){k.push(d)})});return k},sortFeaturesById:function(e,k){var d=n.map(e,function(d){return d.featureLayer});k.sort(function(e,c){var a=e.getLayer(),g=c.getLayer();if(!a)return-1;if(!g)return 1;
var k=n.indexOf(d,a),g=n.indexOf(d,g),k=k-g;k||(a=a.objectIdField,k=e.attributes[a]-c.attributes[a]);return k});return k}};p("extend-esri")&&r.setObject("dijit.editing.Util.LayerHelper",h,m);return h})},"dijit/form/DateTextBox":function(){define(["dojo/_base/declare","../Calendar","./_DateTimeTextBox"],function(r,n,p){return r("dijit.form.DateTextBox",p,{baseClass:"dijitTextBox dijitComboBox dijitDateTextBox",popupClass:n,_selector:"date",maxHeight:Infinity,value:new Date("")})})},"dijit/Calendar":function(){define("dojo/_base/array dojo/date dojo/date/locale dojo/_base/declare dojo/dom-attr dojo/dom-class dojo/dom-construct dojo/_base/kernel dojo/keys dojo/_base/lang dojo/on dojo/sniff ./CalendarLite ./_Widget ./_CssStateMixin ./_TemplatedMixin ./form/DropDownButton".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q){var u=m("dijit.Calendar",[t,v,f],{baseClass:"dijitCalendar",cssStateNodes:{decrementMonth:"dijitCalendarArrow",incrementMonth:"dijitCalendarArrow",previousYearLabelNode:"dijitCalendarPreviousYear",nextYearLabelNode:"dijitCalendarNextYear"},setValue:function(a){d.deprecated("dijit.Calendar:setValue() is deprecated.  Use set('value', ...) instead.","","2.0");this.set("value",a)},_createMonthWidget:function(){return new u._MonthDropDownButton({id:this.id+"_mddb",
tabIndex:-1,onMonthSelect:c.hitch(this,"_onMonthSelect"),lang:this.lang,dateLocaleModule:this.dateLocaleModule},this.monthNode)},postCreate:function(){this.inherited(arguments);this.own(a(this.domNode,"keydown",c.hitch(this,"_onKeyDown")),a(this.dateRowsNode,"mouseover",c.hitch(this,"_onDayMouseOver")),a(this.dateRowsNode,"mouseout",c.hitch(this,"_onDayMouseOut")),a(this.dateRowsNode,"mousedown",c.hitch(this,"_onDayMouseDown")),a(this.dateRowsNode,"mouseup",c.hitch(this,"_onDayMouseUp")))},_onMonthSelect:function(a){var b=
new this.dateClassObj(this.currentFocus);b.setDate(1);b.setMonth(a);a=this.dateModule.getDaysInMonth(b);var c=this.currentFocus.getDate();b.setDate(Math.min(c,a));this._setCurrentFocusAttr(b)},_onDayMouseOver:function(a){(a=e.contains(a.target,"dijitCalendarDateLabel")?a.target.parentNode:a.target)&&(a.dijitDateValue&&!e.contains(a,"dijitCalendarDisabledDate")||a==this.previousYearLabelNode||a==this.nextYearLabelNode)&&(e.add(a,"dijitCalendarHoveredDate"),this._currentNode=a)},_onDayMouseOut:function(a){!this._currentNode||
a.relatedTarget&&a.relatedTarget.parentNode==this._currentNode||(a="dijitCalendarHoveredDate",e.contains(this._currentNode,"dijitCalendarActiveDate")&&(a+=" dijitCalendarActiveDate"),e.remove(this._currentNode,a),this._currentNode=null)},_onDayMouseDown:function(a){(a=a.target.parentNode)&&a.dijitDateValue&&!e.contains(a,"dijitCalendarDisabledDate")&&(e.add(a,"dijitCalendarActiveDate"),this._currentNode=a)},_onDayMouseUp:function(a){(a=a.target.parentNode)&&a.dijitDateValue&&e.remove(a,"dijitCalendarActiveDate")},
handleKey:function(a){var b=-1,c,d=this.currentFocus;switch(a.keyCode){case g.RIGHT_ARROW:b=1;case g.LEFT_ARROW:c="day";this.isLeftToRight()||(b*=-1);break;case g.DOWN_ARROW:b=1;case g.UP_ARROW:c="week";break;case g.PAGE_DOWN:b=1;case g.PAGE_UP:c=a.ctrlKey||a.altKey?"year":"month";break;case g.END:d=this.dateModule.add(d,"month",1),c="day";case g.HOME:d=new this.dateClassObj(d);d.setDate(1);break;default:return!0}c&&(d=this.dateModule.add(d,c,b));this._setCurrentFocusAttr(d);return!1},_onKeyDown:function(a){this.handleKey(a)||
(a.stopPropagation(),a.preventDefault())},onValueSelected:function(){},onChange:function(a){this.onValueSelected(a)},getClassForDate:function(){}});u._MonthDropDownButton=m("dijit.Calendar._MonthDropDownButton",q,{onMonthSelect:function(){},postCreate:function(){this.inherited(arguments);this.dropDown=new u._MonthDropDown({id:this.id+"_mdd",onChange:this.onMonthSelect})},_setMonthAttr:function(a){var b=this.dateLocaleModule.getNames("months","wide","standAlone",this.lang,a);this.dropDown.set("months",
b);this.containerNode.innerHTML=(6==l("ie")?"":"\x3cdiv class\x3d'dijitSpacer'\x3e"+this.dropDown.domNode.innerHTML+"\x3c/div\x3e")+"\x3cdiv class\x3d'dijitCalendarMonthLabel dijitCalendarCurrentMonthLabel'\x3e"+b[a.getMonth()]+"\x3c/div\x3e"}});u._MonthDropDown=m("dijit.Calendar._MonthDropDown",[v,b,f],{months:[],baseClass:"dijitCalendarMonthMenu dijitMenu",templateString:"\x3cdiv data-dojo-attach-event\x3d'ondijitclick:_onClick'\x3e\x3c/div\x3e",_setMonthsAttr:function(a){this.domNode.innerHTML=
"";r.forEach(a,function(a,b){k.create("div",{className:"dijitCalendarMonthLabel",month:b,innerHTML:a},this.domNode)._cssState="dijitCalendarMonthLabel"},this)},_onClick:function(a){this.onChange(h.get(a.target,"month"))},onChange:function(){}});return u})},"dijit/CalendarLite":function(){define("dojo/_base/array dojo/_base/declare dojo/cldr/supplemental dojo/date dojo/date/locale dojo/date/stamp dojo/dom dojo/dom-class dojo/dom-attr dojo/_base/lang dojo/on dojo/sniff dojo/string ./_WidgetBase ./_TemplatedMixin dojo/text!./templates/Calendar.html ./a11yclick ./hccss".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b){var q=n("dijit.CalendarLite",[v,f],{templateString:b,dowTemplateString:'\x3cth class\x3d"dijitReset dijitCalendarDayLabelTemplate" role\x3d"columnheader" scope\x3d"col"\x3e\x3cspan class\x3d"dijitCalendarDayLabel"\x3e${d}\x3c/span\x3e\x3c/th\x3e',dateTemplateString:'\x3ctd class\x3d"dijitReset" role\x3d"gridcell" data-dojo-attach-point\x3d"dateCells"\x3e\x3cspan class\x3d"dijitCalendarDateLabel" data-dojo-attach-point\x3d"dateLabels"\x3e\x3c/span\x3e\x3c/td\x3e',
weekTemplateString:'\x3ctr class\x3d"dijitReset dijitCalendarWeekTemplate" role\x3d"row"\x3e${d}${d}${d}${d}${d}${d}${d}\x3c/tr\x3e',value:new Date(""),datePackage:"",dayWidth:"narrow",tabIndex:"0",dayOffset:-1,currentFocus:new Date,_setSummaryAttr:"gridNode",baseClass:"dijitCalendar dijitCalendarLite",_isValidDate:function(a){return a&&!isNaN(a)&&"object"==typeof a&&a.toString()!=this.constructor.prototype.value.toString()},_getValueAttr:function(){var a=this._get("value");if(a&&!isNaN(a)){var b=
new this.dateClassObj(a);b.setHours(0,0,0,0);b.getDate()<a.getDate()&&(b=this.dateModule.add(b,"hour",1));return b}return null},_setValueAttr:function(a,b){"string"==typeof a&&(a=e.fromISOString(a));a=this._patchDate(a);if(this._isValidDate(a)&&!this.isDisabledDate(a,this.lang)){if(this._set("value",a),this.set("currentFocus",a),this._markSelectedDates([a]),this._created&&(b||"undefined"==typeof b))this.onChange(this.get("value"))}else this._set("value",null),this._markSelectedDates([])},_patchDate:function(a){if(a||
0===a)a=new this.dateClassObj(a),a.setHours(1,0,0,0);return a},_setText:function(a,b){for(;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(a.ownerDocument.createTextNode(b))},_populateGrid:function(){var a=new this.dateClassObj(this.currentFocus);a.setDate(1);var a=this._patchDate(a),b=a.getDay(),c=this.dateModule.getDaysInMonth(a),d=this.dateModule.getDaysInMonth(this.dateModule.add(a,"month",-1)),e=new this.dateClassObj,f=0<=this.dayOffset?this.dayOffset:p.getFirstDayOfWeek(this.lang);f>
b&&(f-=7);if(!this.summary){var l=this.dateLocaleModule.getNames("months","wide","standAlone",this.lang,a);this.gridNode.setAttribute("summary",l[a.getMonth()])}this._date2cell={};r.forEach(this.dateCells,function(l,k){var q=k+f,t=new this.dateClassObj(a),m="dijitCalendar",u=0;q<b?(q=d-b+q+1,u=-1,m+="Previous"):q>=b+c?(q=q-b-c+1,u=1,m+="Next"):(q=q-b+1,m+="Current");u&&(t=this.dateModule.add(t,"month",u));t.setDate(q);this.dateModule.compare(t,e,"date")||(m="dijitCalendarCurrentDate "+m);this.isDisabledDate(t,
this.lang)?(m="dijitCalendarDisabledDate "+m,l.setAttribute("aria-disabled","true")):(m="dijitCalendarEnabledDate "+m,l.removeAttribute("aria-disabled"),l.setAttribute("aria-selected","false"));(u=this.getClassForDate(t,this.lang))&&(m=u+" "+m);l.className=m+"Month dijitCalendarDateTemplate";m=t.valueOf();this._date2cell[m]=l;l.dijitDateValue=m;m=t.getDateLocalized?t.getDateLocalized(this.lang):t.getDate();this._setText(this.dateLabels[k],m);g.set(l,"aria-label",h.format(t,{selector:"date",formatLength:"long"}))},
this)},_populateControls:function(){var a=new this.dateClassObj(this.currentFocus);a.setDate(1);this.monthWidget.set("month",a);var b=a.getFullYear()-1,c=new this.dateClassObj;r.forEach(["previous","current","next"],function(a){c.setFullYear(b++);this._setText(this[a+"YearLabelNode"],this.dateLocaleModule.format(c,{selector:"year",locale:this.lang}))},this)},goToToday:function(){this.set("value",new this.dateClassObj)},constructor:function(a){this.dateModule=a.datePackage?c.getObject(a.datePackage,
!1):m;this.dateClassObj=this.dateModule.Date||Date;this.dateLocaleModule=a.datePackage?c.getObject(a.datePackage+".locale",!1):h},_createMonthWidget:function(){return q._MonthWidget({id:this.id+"_mddb",lang:this.lang,dateLocaleModule:this.dateLocaleModule},this.monthNode)},buildRendering:function(){var a=this.dowTemplateString,b=this.dateLocaleModule.getNames("days",this.dayWidth,"standAlone",this.lang),c=0<=this.dayOffset?this.dayOffset:p.getFirstDayOfWeek(this.lang);this.dayCellsHtml=t.substitute([a,
a,a,a,a,a,a].join(""),{d:""},function(){return b[c++%7]});a=t.substitute(this.weekTemplateString,{d:this.dateTemplateString});this.dateRowsHtml=[a,a,a,a,a,a].join("");this.dateCells=[];this.dateLabels=[];this.inherited(arguments);k.setSelectable(this.domNode,!1);a=new this.dateClassObj(this.currentFocus);this.monthWidget=this._createMonthWidget();this.set("currentFocus",a,!1)},postCreate:function(){this.inherited(arguments);this._connectControls()},_connectControls:function(){var b=c.hitch(this,function(b,
d,e){this[b].dojoClick=!0;return a(this[b],"click",c.hitch(this,function(){this._setCurrentFocusAttr(this.dateModule.add(this.currentFocus,d,e))}))});this.own(b("incrementMonth","month",1),b("decrementMonth","month",-1),b("nextYearLabelNode","year",1),b("previousYearLabelNode","year",-1))},_setCurrentFocusAttr:function(a,b){var c=this.currentFocus,d=this._getNodeByDate(c);a=this._patchDate(a);this._set("currentFocus",a);this._date2cell&&0==this.dateModule.difference(c,a,"month")||(this._populateGrid(),
this._populateControls(),this._markSelectedDates([this.value]));c=this._getNodeByDate(a);c.setAttribute("tabIndex",this.tabIndex);(this.focused||b)&&c.focus();d&&d!=c&&(l("webkit")?d.setAttribute("tabIndex","-1"):d.removeAttribute("tabIndex"))},focus:function(){this._setCurrentFocusAttr(this.currentFocus,!0)},_onDayClick:function(a){a.stopPropagation();a.preventDefault();for(a=a.target;a&&!a.dijitDateValue&&0!==a.dijitDateValue;a=a.parentNode);a&&!d.contains(a,"dijitCalendarDisabledDate")&&this.set("value",
a.dijitDateValue)},_getNodeByDate:function(a){return(a=this._patchDate(a))&&this._date2cell?this._date2cell[a.valueOf()]:null},_markSelectedDates:function(a){function b(a,b){d.toggle(b,"dijitCalendarSelectedDate",a);b.setAttribute("aria-selected",a?"true":"false")}r.forEach(this._selectedCells||[],c.partial(b,!1));this._selectedCells=r.filter(r.map(a,this._getNodeByDate,this),function(a){return a});r.forEach(this._selectedCells,c.partial(b,!0))},onChange:function(){},isDisabledDate:function(){},getClassForDate:function(){}});
q._MonthWidget=n("dijit.CalendarLite._MonthWidget",v,{_setMonthAttr:function(a){var b=this.dateLocaleModule.getNames("months","wide","standAlone",this.lang,a),c=6==l("ie")?"":"\x3cdiv class\x3d'dijitSpacer'\x3e"+r.map(b,function(a){return"\x3cdiv\x3e"+a+"\x3c/div\x3e"}).join("")+"\x3c/div\x3e";this.domNode.innerHTML=c+"\x3cdiv class\x3d'dijitCalendarMonthLabel dijitCalendarCurrentMonthLabel'\x3e"+b[a.getMonth()]+"\x3c/div\x3e"}});return q})},"dijit/form/_DateTimeTextBox":function(){define("dojo/date dojo/date/locale dojo/date/stamp dojo/_base/declare dojo/_base/lang ./RangeBoundTextBox ../_HasDropDown dojo/text!./templates/DropDownBox.html".split(" "),
function(r,n,p,m,h,e,k,d){new Date("X");return m("dijit.form._DateTimeTextBox",[e,k],{templateString:d,hasDownArrow:!0,cssStateNodes:{_buttonNode:"dijitDownArrowButton"},_unboundedConstraints:{},pattern:n.regexp,datePackage:"",postMixInProperties:function(){this.inherited(arguments);this._set("type","text")},compare:function(d,c){var a=this._isInvalidDate(d),e=this._isInvalidDate(c);if(a||e)return a&&e?0:a?-1:1;var a=this.format(d,this._unboundedConstraints),e=this.format(c,this._unboundedConstraints),
g=this.parse(a,this._unboundedConstraints),k=this.parse(e,this._unboundedConstraints);return a==e?0:r.compare(g,k,this._selector)},autoWidth:!0,format:function(d,c){return d?this.dateLocaleModule.format(d,c):""},parse:function(d,c){return this.dateLocaleModule.parse(d,c)||(this._isEmpty(d)?null:void 0)},serialize:function(d,c){d.toGregorian&&(d=d.toGregorian());return p.toISOString(d,c)},dropDownDefaultValue:new Date,value:new Date(""),_blankValue:null,popupClass:"",_selector:"",constructor:function(d){d=
d||{};this.dateModule=d.datePackage?h.getObject(d.datePackage,!1):r;this.dateClassObj=this.dateModule.Date||Date;this.dateClassObj instanceof Date||(this.value=new this.dateClassObj(this.value));this.dateLocaleModule=d.datePackage?h.getObject(d.datePackage+".locale",!1):n;this._set("pattern",this.dateLocaleModule.regexp);this._invalidDate=this.constructor.prototype.value.toString()},buildRendering:function(){this.inherited(arguments);this.hasDownArrow||(this._buttonNode.style.display="none");this.hasDownArrow||
(this._buttonNode=this.domNode,this.baseClass+=" dijitComboBoxOpenOnClick")},_setConstraintsAttr:function(d){d.selector=this._selector;d.fullYear=!0;var c=p.fromISOString;"string"==typeof d.min&&(d.min=c(d.min),this.dateClassObj instanceof Date||(d.min=new this.dateClassObj(d.min)));"string"==typeof d.max&&(d.max=c(d.max),this.dateClassObj instanceof Date||(d.max=new this.dateClassObj(d.max)));this.inherited(arguments);this._unboundedConstraints=h.mixin({},this.constraints,{min:null,max:null})},_isInvalidDate:function(d){return!d||
isNaN(d)||"object"!=typeof d||d.toString()==this._invalidDate},_setValueAttr:function(d,c,a){void 0!==d&&("string"==typeof d&&(d=p.fromISOString(d)),this._isInvalidDate(d)&&(d=null),d instanceof Date&&!(this.dateClassObj instanceof Date)&&(d=new this.dateClassObj(d)));this.inherited(arguments,[d,c,a]);this.value instanceof Date&&(this.filterString="");!1!==c&&this.dropDown&&this.dropDown.set("value",d,!1)},_set:function(d,c){if("value"==d){c instanceof Date&&!(this.dateClassObj instanceof Date)&&
(c=new this.dateClassObj(c));var a=this._get("value");if(a instanceof this.dateClassObj&&0==this.compare(c,a))return}this.inherited(arguments)},_setDropDownDefaultValueAttr:function(d){this._isInvalidDate(d)&&(d=new this.dateClassObj);this._set("dropDownDefaultValue",d)},openDropDown:function(d){this.dropDown&&this.dropDown.destroy();var c=h.isString(this.popupClass)?h.getObject(this.popupClass,!1):this.popupClass,a=this,e=this.get("value");this.dropDown=new c({onChange:function(c){a.set("value",
c,!0)},id:this.id+"_popup",dir:a.dir,lang:a.lang,value:e,textDir:a.textDir,currentFocus:this._isInvalidDate(e)?this.dropDownDefaultValue:e,constraints:a.constraints,filterString:a.filterString,datePackage:a.datePackage,isDisabledDate:function(c){return!a.rangeCheck(c,a.constraints)}});this.inherited(arguments)},_getDisplayedValueAttr:function(){return this.textbox.value},_setDisplayedValueAttr:function(d,c){this._setValueAttr(this.parse(d,this.constraints),c,d)}})})},"dijit/form/RangeBoundTextBox":function(){define(["dojo/_base/declare",
"dojo/i18n","./MappedTextBox","dojo/i18n!./nls/validate"],function(r,n,p){return r("dijit.form.RangeBoundTextBox",p,{rangeMessage:"",rangeCheck:function(m,h){return("min"in h?0<=this.compare(m,h.min):!0)&&("max"in h?0>=this.compare(m,h.max):!0)},isInRange:function(){return this.rangeCheck(this.get("value"),this.constraints)},_isDefinitelyOutOfRange:function(){var m=this.get("value");if(null==m)return!1;var h=!1;"min"in this.constraints&&(h=this.constraints.min,h=0>this.compare(m,"number"==typeof h&&
0<=h&&0!=m?0:h));!h&&"max"in this.constraints&&(h=this.constraints.max,h=0<this.compare(m,"number"!=typeof h||0<h?h:0));return h},_isValidSubset:function(){return this.inherited(arguments)&&!this._isDefinitelyOutOfRange()},isValid:function(m){return this.inherited(arguments)&&(this._isEmpty(this.textbox.value)&&!this.required||this.isInRange(m))},getErrorMessage:function(m){var h=this.get("value");return null==h||""===h||"number"==typeof h&&isNaN(h)||this.isInRange(m)?this.inherited(arguments):this.rangeMessage},
postMixInProperties:function(){this.inherited(arguments);this.rangeMessage||(this.messages=n.getLocalization("dijit.form","validate",this.lang),this.rangeMessage=this.messages.rangeMessage)}})})},"dijit/form/MappedTextBox":function(){define(["dojo/_base/declare","dojo/sniff","dojo/dom-construct","./ValidationTextBox"],function(r,n,p,m){return r("dijit.form.MappedTextBox",m,{postMixInProperties:function(){this.inherited(arguments);this.nameAttrSetting=""},_setNameAttr:"valueNode",serialize:function(h){return h.toString?
h.toString():""},toString:function(){var h=this.filter(this.get("value"));return null!=h?"string"==typeof h?h:this.serialize(h,this.constraints):""},validate:function(){this.valueNode.value=this.toString();return this.inherited(arguments)},buildRendering:function(){this.inherited(arguments);this.valueNode=p.place("\x3cinput type\x3d'hidden'"+(this.name&&!n("msapp")?' name\x3d"'+this.name.replace(/"/g,"\x26quot;")+'"':"")+"/\x3e",this.textbox,"after")},reset:function(){this.valueNode.value="";this.inherited(arguments)}})})},
"dijit/form/ValidationTextBox":function(){define("dojo/_base/declare dojo/_base/kernel dojo/_base/lang dojo/i18n ./TextBox ../Tooltip dojo/text!./templates/ValidationTextBox.html dojo/i18n!./nls/validate".split(" "),function(r,n,p,m,h,e,k){var d=r("dijit.form.ValidationTextBox",h,{templateString:k,required:!1,promptMessage:"",invalidMessage:"$_unset_$",missingMessage:"$_unset_$",message:"",constraints:{},pattern:".*",regExp:"",regExpGen:function(){},state:"",tooltipPosition:[],_deprecateRegExp:function(e,
c){c!=d.prototype[e]&&(n.deprecated("ValidationTextBox id\x3d"+this.id+", set('"+e+"', ...) is deprecated.  Use set('pattern', ...) instead.","","2.0"),this.set("pattern",c))},_setRegExpGenAttr:function(d){this._deprecateRegExp("regExpGen",d);this._set("regExpGen",this._computeRegexp)},_setRegExpAttr:function(d){this._deprecateRegExp("regExp",d)},_setValueAttr:function(){this.inherited(arguments);this._refreshState()},validator:function(d,c){return(new RegExp("^(?:"+this._computeRegexp(c)+")"+(this.required?
"":"?")+"$")).test(d)&&(!this.required||!this._isEmpty(d))&&(this._isEmpty(d)||void 0!==this.parse(d,c))},_isValidSubset:function(){return 0==this.textbox.value.search(this._partialre)},isValid:function(){return this.validator(this.textbox.value,this.get("constraints"))},_isEmpty:function(d){return(this.trim?/^\s*$/:/^$/).test(d)},getErrorMessage:function(){var d="$_unset_$"==this.invalidMessage?this.messages.invalidMessage:this.invalidMessage?this.invalidMessage:this.promptMessage,c="$_unset_$"==
this.missingMessage?this.messages.missingMessage:this.missingMessage?this.missingMessage:d;return this.required&&this._isEmpty(this.textbox.value)?c:d},getPromptMessage:function(){return this.promptMessage},_maskValidSubsetError:!0,validate:function(d){var c="",a=this.disabled||this.isValid(d);a&&(this._maskValidSubsetError=!0);var e=this._isEmpty(this.textbox.value),g=!a&&d&&this._isValidSubset();this._set("state",a?"":((!this._hasBeenBlurred||d)&&e||g)&&(this._maskValidSubsetError||g&&!this._hasBeenBlurred&&
d)?"Incomplete":"Error");this.focusNode.setAttribute("aria-invalid","Error"==this.state?"true":"false");"Error"==this.state?(this._maskValidSubsetError=d&&g,c=this.getErrorMessage(d)):"Incomplete"==this.state?(c=this.getPromptMessage(d),this._maskValidSubsetError=!this._hasBeenBlurred||d):e&&(c=this.getPromptMessage(d));this.set("message",c);return a},displayMessage:function(d){d&&this.focused?e.show(d,this.domNode,this.tooltipPosition,!this.isLeftToRight()):e.hide(this.domNode)},_refreshState:function(){this._created&&
this.validate(this.focused);this.inherited(arguments)},constructor:function(d){this.constraints=p.clone(this.constraints);this.baseClass+=" dijitValidationTextBox"},startup:function(){this.inherited(arguments);this._refreshState()},_setConstraintsAttr:function(d){!d.locale&&this.lang&&(d.locale=this.lang);this._set("constraints",d);this._refreshState()},_setPatternAttr:function(d){this._set("pattern",d);this._refreshState()},_computeRegexp:function(d){var c=this.pattern;"function"==typeof c&&(c=c.call(this,
d));if(c!=this._lastRegExp){var a="";this._lastRegExp=c;".*"!=c&&c.replace(/\\.|\[\]|\[.*?[^\\]{1}\]|\{.*?\}|\(\?[=:!]|./g,function(c){switch(c.charAt(0)){case "{":case "+":case "?":case "*":case "^":case "$":case "|":case "(":a+=c;break;case ")":a+="|$)";break;default:a+="(?:"+c+"|$)"}});try{"".search(a)}catch(l){a=this.pattern,console.warn("RegExp error in "+this.declaredClass+": "+this.pattern)}this._partialre="^(?:"+a+")$"}return c},postMixInProperties:function(){this.inherited(arguments);this.messages=
m.getLocalization("dijit.form","validate",this.lang);this._setConstraintsAttr(this.constraints)},_setDisabledAttr:function(d){this.inherited(arguments);this._refreshState()},_setRequiredAttr:function(d){this._set("required",d);this.focusNode.setAttribute("aria-required",d);this._refreshState()},_setMessageAttr:function(d){this._set("message",d);this.displayMessage(d)},reset:function(){this._maskValidSubsetError=!0;this.inherited(arguments)},_onBlur:function(){this.displayMessage("");this.inherited(arguments)},
destroy:function(){e.hide(this.domNode);this.inherited(arguments)}});return d})},"dijit/form/TextBox":function(){define("dojo/_base/declare dojo/dom-construct dojo/dom-style dojo/_base/kernel dojo/_base/lang dojo/on dojo/sniff ./_FormValueWidget ./_TextBoxMixin dojo/text!./templates/TextBox.html ../main".split(" "),function(r,n,p,m,h,e,k,d,g,c,a){d=r("dijit.form.TextBox"+(k("dojo-bidi")?"_NoBidi":""),[d,g],{templateString:c,_singleNodeTemplate:'\x3cinput class\x3d"dijit dijitReset dijitLeft dijitInputField" data-dojo-attach-point\x3d"textbox,focusNode" autocomplete\x3d"off" type\x3d"${type}" ${!nameAttrSetting} /\x3e',
_buttonInputDisabled:k("ie")?"disabled":"",baseClass:"dijitTextBox",postMixInProperties:function(){var a=this.type.toLowerCase();if(this.templateString&&"input"==this.templateString.toLowerCase()||("hidden"==a||"file"==a)&&this.templateString==this.constructor.prototype.templateString)this.templateString=this._singleNodeTemplate;this.inherited(arguments)},postCreate:function(){this.inherited(arguments);9>k("ie")&&this.defer(function(){try{var a=p.getComputedStyle(this.domNode);if(a){var c=a.fontFamily;
if(c){var d=this.domNode.getElementsByTagName("INPUT");if(d)for(a=0;a<d.length;a++)d[a].style.fontFamily=c}}}catch(f){}})},_setPlaceHolderAttr:function(a){this._set("placeHolder",a);this._phspan||(this._attachPoints.push("_phspan"),this._phspan=n.create("span",{className:"dijitPlaceHolder dijitInputField"},this.textbox,"after"),this.own(e(this._phspan,"mousedown",function(a){a.preventDefault()}),e(this._phspan,"touchend, pointerup, MSPointerUp",h.hitch(this,function(){this.focus()}))));this._phspan.innerHTML=
"";this._phspan.appendChild(this._phspan.ownerDocument.createTextNode(a));this._updatePlaceHolder()},_onInput:function(a){this.inherited(arguments);this._updatePlaceHolder()},_updatePlaceHolder:function(){this._phspan&&(this._phspan.style.display=this.placeHolder&&!this.textbox.value?"":"none")},_setValueAttr:function(a,c,d){this.inherited(arguments);this._updatePlaceHolder()},getDisplayedValue:function(){m.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use get('displayedValue') instead.",
"","2.0");return this.get("displayedValue")},setDisplayedValue:function(a){m.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use set('displayedValue', ...) instead.","","2.0");this.set("displayedValue",a)},_onBlur:function(a){this.disabled||(this.inherited(arguments),this._updatePlaceHolder(),k("mozilla")&&this.selectOnClick&&(this.textbox.selectionStart=this.textbox.selectionEnd=void 0))},_onFocus:function(a){this.disabled||this.readOnly||(this.inherited(arguments),this._updatePlaceHolder())}});
9>k("ie")&&(d.prototype._isTextSelected=function(){var a=this.ownerDocument.selection.createRange();return a.parentElement()==this.textbox&&0<a.text.length},a._setSelectionRange=g._setSelectionRange=function(a,c,d){a.createTextRange&&(a=a.createTextRange(),a.collapse(!0),a.moveStart("character",-99999),a.moveStart("character",c),a.moveEnd("character",d-c),a.select())});k("dojo-bidi")&&(d=r("dijit.form.TextBox",d,{_setPlaceHolderAttr:function(a){this.inherited(arguments);this.applyTextDir(this._phspan)}}));
return d})},"dijit/form/_FormValueWidget":function(){define(["dojo/_base/declare","dojo/sniff","./_FormWidget","./_FormValueMixin"],function(r,n,p,m){return r("dijit.form._FormValueWidget",[p,m],{_layoutHackIE7:function(){if(7==n("ie"))for(var h=this.domNode,e=h.parentNode,k=h.firstChild||h,d=k.style.filter,g=this;e&&0==e.clientHeight;)(function(){var c=g.connect(e,"onscroll",function(){g.disconnect(c);k.style.filter=(new Date).getMilliseconds();g.defer(function(){k.style.filter=d})})})(),e=e.parentNode}})})},
"dijit/form/_FormValueMixin":function(){define("dojo/_base/declare dojo/dom-attr dojo/keys dojo/_base/lang dojo/on ./_FormWidgetMixin".split(" "),function(r,n,p,m,h,e){return r("dijit.form._FormValueMixin",e,{readOnly:!1,_setReadOnlyAttr:function(e){n.set(this.focusNode,"readOnly",e);this._set("readOnly",e)},postCreate:function(){this.inherited(arguments);void 0===this._resetValue&&(this._lastValueReported=this._resetValue=this.value)},_setValueAttr:function(e,d){this._handleOnChange(e,d)},_handleOnChange:function(e,
d){this._set("value",e);this.inherited(arguments)},undo:function(){this._setValueAttr(this._lastValueReported,!1)},reset:function(){this._hasBeenBlurred=!1;this._setValueAttr(this._resetValue,!0)}})})},"dijit/form/_TextBoxMixin":function(){define("dojo/_base/array dojo/_base/declare dojo/dom dojo/sniff dojo/keys dojo/_base/lang dojo/on ../main".split(" "),function(r,n,p,m,h,e,k,d){var g=n("dijit.form._TextBoxMixin"+(m("dojo-bidi")?"_NoBidi":""),null,{trim:!1,uppercase:!1,lowercase:!1,propercase:!1,
maxLength:"",selectOnClick:!1,placeHolder:"",_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints)},_setValueAttr:function(c,a,d){var e;void 0!==c&&(e=this.filter(c),"string"!=typeof d&&(d=null===e||"number"==typeof e&&isNaN(e)?"":this.filter(this.format(e,this.constraints)),0!=this.compare(e,this.filter(this.parse(d,this.constraints)))&&(d=null)));null==d||"number"==typeof d&&isNaN(d)||this.textbox.value==d||(this.textbox.value=d,this._set("displayedValue",this.get("displayedValue")));
this.inherited(arguments,[e,a])},displayedValue:"",_getDisplayedValueAttr:function(){return this.filter(this.textbox.value)},_setDisplayedValueAttr:function(c){null==c?c="":"string"!=typeof c&&(c=String(c));this.textbox.value=c;this._setValueAttr(this.get("value"),void 0);this._set("displayedValue",this.get("displayedValue"))},format:function(c){return null==c?"":c.toString?c.toString():c},parse:function(c){return c},_refreshState:function(){},onInput:function(){},_onInput:function(c){this._lastInputEventValue=
this.textbox.value;this._processInput(this._lastInputProducingEvent||c);delete this._lastInputProducingEvent;this.intermediateChanges&&this._handleOnChange(this.get("value"),!1)},_processInput:function(){this._refreshState();this._set("displayedValue",this.get("displayedValue"))},postCreate:function(){this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);this.own(k(this.textbox,"keydown, keypress, paste, cut, compositionend",e.hitch(this,function(c){var a;if("keydown"==c.type&&
229!=c.keyCode){a=c.keyCode;switch(a){case h.SHIFT:case h.ALT:case h.CTRL:case h.META:case h.CAPS_LOCK:case h.NUM_LOCK:case h.SCROLL_LOCK:return}if(!c.ctrlKey&&!c.metaKey&&!c.altKey){switch(a){case h.NUMPAD_0:case h.NUMPAD_1:case h.NUMPAD_2:case h.NUMPAD_3:case h.NUMPAD_4:case h.NUMPAD_5:case h.NUMPAD_6:case h.NUMPAD_7:case h.NUMPAD_8:case h.NUMPAD_9:case h.NUMPAD_MULTIPLY:case h.NUMPAD_PLUS:case h.NUMPAD_ENTER:case h.NUMPAD_MINUS:case h.NUMPAD_PERIOD:case h.NUMPAD_DIVIDE:return}if(65<=a&&90>=a||
48<=a&&57>=a||a==h.SPACE)return;a=!1;for(var d in h)if(h[d]===c.keyCode){a=!0;break}if(!a)return}}(a=32<=c.charCode?String.fromCharCode(c.charCode):c.charCode)||(a=65<=c.keyCode&&90>=c.keyCode||48<=c.keyCode&&57>=c.keyCode||c.keyCode==h.SPACE?String.fromCharCode(c.keyCode):c.keyCode);a||(a=229);if("keypress"==c.type){if("string"!=typeof a)return;if("a"<=a&&"z">=a||"A"<=a&&"Z">=a||"0"<=a&&"9">=a||" "===a)if(c.ctrlKey||c.metaKey||c.altKey)return}var g={faux:!0},n;for(n in c)/^(layer[XY]|returnValue|keyLocation)$/.test(n)||
(d=c[n],"function"!=typeof d&&"undefined"!=typeof d&&(g[n]=d));e.mixin(g,{charOrCode:a,_wasConsumed:!1,preventDefault:function(){g._wasConsumed=!0;c.preventDefault()},stopPropagation:function(){c.stopPropagation()}});this._lastInputProducingEvent=g;!1===this.onInput(g)&&(g.preventDefault(),g.stopPropagation());if(!g._wasConsumed&&9>=m("ie"))switch(c.keyCode){case h.TAB:case h.ESCAPE:case h.DOWN_ARROW:case h.UP_ARROW:case h.LEFT_ARROW:case h.RIGHT_ARROW:break;default:c.keyCode==h.ENTER&&"textarea"!=
this.textbox.tagName.toLowerCase()||this.defer(function(){this.textbox.value!==this._lastInputEventValue&&k.emit(this.textbox,"input",{bubbles:!0})})}})),k(this.textbox,"input",e.hitch(this,"_onInput")),k(this.domNode,"keypress",function(c){c.stopPropagation()}))},_blankValue:"",filter:function(c){if(null===c)return this._blankValue;if("string"!=typeof c)return c;this.trim&&(c=e.trim(c));this.uppercase&&(c=c.toUpperCase());this.lowercase&&(c=c.toLowerCase());this.propercase&&(c=c.replace(/[^\s]+/g,
function(a){return a.substring(0,1).toUpperCase()+a.substring(1)}));return c},_setBlurValue:function(){this._setValueAttr(this.get("value"),!0)},_onBlur:function(c){this.disabled||(this._setBlurValue(),this.inherited(arguments))},_isTextSelected:function(){return this.textbox.selectionStart!=this.textbox.selectionEnd},_onFocus:function(c){this.disabled||this.readOnly||(this.selectOnClick&&"mouse"==c&&(this._selectOnClickHandle=k.once(this.domNode,"mouseup, touchend",e.hitch(this,function(a){this._isTextSelected()||
g.selectInputText(this.textbox)})),this.own(this._selectOnClickHandle),this.defer(function(){this._selectOnClickHandle&&(this._selectOnClickHandle.remove(),this._selectOnClickHandle=null)},500)),this.inherited(arguments),this._refreshState())},reset:function(){this.textbox.value="";this.inherited(arguments)}});m("dojo-bidi")&&(g=n("dijit.form._TextBoxMixin",g,{_setValueAttr:function(){this.inherited(arguments);this.applyTextDir(this.focusNode)},_setDisplayedValueAttr:function(){this.inherited(arguments);
this.applyTextDir(this.focusNode)},_onInput:function(){this.applyTextDir(this.focusNode);this.inherited(arguments)}}));g._setSelectionRange=d._setSelectionRange=function(c,a,d){c.setSelectionRange&&c.setSelectionRange(a,d)};g.selectInputText=d.selectInputText=function(c,a,d){c=p.byId(c);isNaN(a)&&(a=0);isNaN(d)&&(d=c.value?c.value.length:0);try{c.focus(),g._setSelectionRange(c,a,d)}catch(t){}};return g})},"dijit/Tooltip":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/fx dojo/dom dojo/dom-class dojo/dom-geometry dojo/dom-style dojo/_base/lang dojo/mouse dojo/on dojo/sniff ./_base/manager ./place ./_Widget ./_TemplatedMixin ./BackgroundIframe dojo/text!./templates/Tooltip.html ./main".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u){function A(){}var y=n("dijit._MasterTooltip",[v,f],{duration:l.defaultDuration,templateString:q,postCreate:function(){this.ownerDocumentBody.appendChild(this.domNode);this.bgIframe=new b(this.domNode);this.fadeIn=p.fadeIn({node:this.domNode,duration:this.duration,onEnd:d.hitch(this,"_onShow")});this.fadeOut=p.fadeOut({node:this.domNode,duration:this.duration,onEnd:d.hitch(this,"_onHide")})},show:function(a,b,c,e,f,g,l){if(!this.aroundNode||this.aroundNode!==
b||this.containerNode.innerHTML!=a)if("playing"==this.fadeOut.status())this._onDeck=arguments;else{this.containerNode.innerHTML=a;f&&this.set("textDir",f);this.containerNode.align=e?"right":"left";var h=t.around(this.domNode,b,c&&c.length?c:B.defaultPosition,!e,d.hitch(this,"orient")),q=h.aroundNodePos;"M"==h.corner.charAt(0)&&"M"==h.aroundCorner.charAt(0)?(this.connectorNode.style.top=q.y+(q.h-this.connectorNode.offsetHeight>>1)-h.y+"px",this.connectorNode.style.left=""):"M"==h.corner.charAt(1)&&
"M"==h.aroundCorner.charAt(1)?this.connectorNode.style.left=q.x+(q.w-this.connectorNode.offsetWidth>>1)-h.x+"px":(this.connectorNode.style.left="",this.connectorNode.style.top="");k.set(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=!0;this.aroundNode=b;this.onMouseEnter=g||A;this.onMouseLeave=l||A}},orient:function(b,c,d,f,g){this.connectorNode.style.top="";var l=f.h;f=f.w;b.className="dijitTooltip "+{"MR-ML":"dijitTooltipRight","ML-MR":"dijitTooltipLeft","TM-BM":"dijitTooltipAbove",
"BM-TM":"dijitTooltipBelow","BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[c+"-"+d];this.domNode.style.width="auto";var k=e.position(this.domNode);if(a("ie")||a("trident"))k.w+=2;e.setMarginBox(this.domNode,{w:Math.min(Math.max(f,1),k.w)});"B"==d.charAt(0)&&"B"==c.charAt(0)?(b=e.position(b),c=this.connectorNode.offsetHeight,
b.h>l?(this.connectorNode.style.top=l-(g.h+c>>1)+"px",this.connectorNode.style.bottom=""):(this.connectorNode.style.bottom=Math.min(Math.max(g.h/2-c/2,0),b.h-c)+"px",this.connectorNode.style.top="")):(this.connectorNode.style.top="",this.connectorNode.style.bottom="");return Math.max(0,k.w-f)},_onShow:function(){a("ie")&&(this.domNode.style.filter="")},hide:function(a){this._onDeck&&this._onDeck[1]==a?this._onDeck=null:this.aroundNode===a&&(this.fadeIn.stop(),this.isShowingNow=!1,this.aroundNode=
null,this.fadeOut.play());this.onMouseEnter=this.onMouseLeave=A},_onHide:function(){this.domNode.style.cssText="";this.containerNode.innerHTML="";this._onDeck&&(this.show.apply(this,this._onDeck),this._onDeck=null)}});a("dojo-bidi")&&y.extend({_setAutoTextDir:function(a){this.applyTextDir(a);r.forEach(a.children,function(a){this._setAutoTextDir(a)},this)},_setTextDirAttr:function(a){this._set("textDir",a);"auto"==a?this._setAutoTextDir(this.containerNode):this.containerNode.dir=this.textDir}});u.showTooltip=
function(a,b,c,d,e,f,g){c&&(c=r.map(c,function(a){return{after:"after-centered",before:"before-centered"}[a]||a}));B._masterTT||(u._masterTT=B._masterTT=new y);return B._masterTT.show(a,b,c,d,e,f,g)};u.hideTooltip=function(a){return B._masterTT&&B._masterTT.hide(a)};var B=n("dijit.Tooltip",v,{label:"",showDelay:400,hideDelay:400,connectId:[],position:[],selector:"",_setConnectIdAttr:function(a){r.forEach(this._connections||[],function(a){r.forEach(a,function(a){a.remove()})},this);this._connectIds=
r.filter(d.isArrayLike(a)?a:a?[a]:[],function(a){return m.byId(a,this.ownerDocument)},this);this._connections=r.map(this._connectIds,function(a){a=m.byId(a,this.ownerDocument);var b=this.selector,e=b?function(a){return c.selector(b,a)}:function(a){return a},f=this;return[c(a,e(g.enter),function(){f._onHover(this)}),c(a,e("focusin"),function(){f._onHover(this)}),c(a,e(g.leave),d.hitch(f,"_onUnHover")),c(a,e("focusout"),d.hitch(f,"set","state","DORMANT"))]},this);this._set("connectId",a)},addTarget:function(a){a=
a.id||a;-1==r.indexOf(this._connectIds,a)&&this.set("connectId",this._connectIds.concat(a))},removeTarget:function(a){a=r.indexOf(this._connectIds,a.id||a);0<=a&&(this._connectIds.splice(a,1),this.set("connectId",this._connectIds))},buildRendering:function(){this.inherited(arguments);h.add(this.domNode,"dijitTooltipData")},startup:function(){this.inherited(arguments);var a=this.connectId;r.forEach(d.isArrayLike(a)?a:[a],this.addTarget,this)},getContent:function(a){return this.label||this.domNode.innerHTML},
state:"DORMANT",_setStateAttr:function(a){if(!(this.state==a||"SHOW TIMER"==a&&"SHOWING"==this.state||"HIDE TIMER"==a&&"DORMANT"==this.state)){this._hideTimer&&(this._hideTimer.remove(),delete this._hideTimer);this._showTimer&&(this._showTimer.remove(),delete this._showTimer);switch(a){case "DORMANT":this._connectNode&&(B.hide(this._connectNode),delete this._connectNode,this.onHide());break;case "SHOW TIMER":"SHOWING"!=this.state&&(this._showTimer=this.defer(function(){this.set("state","SHOWING")},
this.showDelay));break;case "SHOWING":var b=this.getContent(this._connectNode);if(!b){this.set("state","DORMANT");return}B.show(b,this._connectNode,this.position,!this.isLeftToRight(),this.textDir,d.hitch(this,"set","state","SHOWING"),d.hitch(this,"set","state","HIDE TIMER"));this.onShow(this._connectNode,this.position);break;case "HIDE TIMER":this._hideTimer=this.defer(function(){this.set("state","DORMANT")},this.hideDelay)}this._set("state",a)}},_onHover:function(a){this._connectNode&&a!=this._connectNode&&
this.set("state","DORMANT");this._connectNode=a;this.set("state","SHOW TIMER")},_onUnHover:function(a){this.set("state","HIDE TIMER")},open:function(a){this.set("state","DORMANT");this._connectNode=a;this.set("state","SHOWING")},close:function(){this.set("state","DORMANT")},onShow:function(){},onHide:function(){},destroy:function(){this.set("state","DORMANT");r.forEach(this._connections||[],function(a){r.forEach(a,function(a){a.remove()})},this);this.inherited(arguments)}});B._MasterTooltip=y;B.show=
u.showTooltip;B.hide=u.hideTooltip;B.defaultPosition=["after-centered","before-centered"];return B})},"dijit/form/NumberTextBox":function(){define("dojo/_base/declare dojo/_base/lang dojo/i18n dojo/string dojo/number ./RangeBoundTextBox".split(" "),function(r,n,p,m,h,e){var k=function(d){d=d||{};var c=p.getLocalization("dojo.cldr","number",p.normalizeLocale(d.locale)),a=d.pattern?d.pattern:c[(d.type||"decimal")+"Format"];d="number"==typeof d.places?d.places:"string"===typeof d.places&&0<d.places.length?
d.places.replace(/.*,/,""):-1!=a.indexOf(".")?a.split(".")[1].replace(/[^#0]/g,"").length:0;return{sep:c.decimal,places:d}},d=r("dijit.form.NumberTextBoxMixin",null,{pattern:function(d){return"("+(this.focused&&this.editOptions?this._regExpGenerator(n.delegate(d,this.editOptions))+"|":"")+this._regExpGenerator(d)+")"},value:NaN,editOptions:{pattern:"#.######"},_formatter:h.format,_regExpGenerator:h.regexp,_decimalInfo:k(),postMixInProperties:function(){this.inherited(arguments);this._set("type","text")},
_setConstraintsAttr:function(d){var c="number"==typeof d.places?d.places:0;c&&c++;"number"!=typeof d.max&&(d.max=9*Math.pow(10,15-c));"number"!=typeof d.min&&(d.min=-9*Math.pow(10,15-c));this.inherited(arguments,[d]);this.focusNode&&this.focusNode.value&&!isNaN(this.value)&&this.set("value",this.value);this._decimalInfo=k(d)},_onFocus:function(){if(!this.disabled&&!this.readOnly){var d=this.get("value");"number"!=typeof d||isNaN(d)||(d=this.format(d,this.constraints),void 0!==d&&(this.textbox.value=
d));this.inherited(arguments)}},format:function(d,c){var a=String(d);if("number"!=typeof d)return a;if(isNaN(d))return"";if(!("rangeCheck"in this&&this.rangeCheck(d,c))&&!1!==c.exponent&&/\de[-+]?\d/i.test(a))return a;this.editOptions&&this.focused&&(c=n.mixin({},c,this.editOptions));return this._formatter(d,c)},_parser:h.parse,parse:function(d,c){var a=n.mixin({},c,this.editOptions&&this.focused?this.editOptions:{});if(this.focused&&null!=a.places){var e=a.places,e="number"===typeof e?e:Number(e.split(",").pop());
a.places="0,"+e}a=this._parser(d,a);this.editOptions&&this.focused&&isNaN(a)&&(a=this._parser(d,c));return a},_getDisplayedValueAttr:function(){var d=this.inherited(arguments);return isNaN(d)?this.textbox.value:d},filter:function(d){if(null==d||"string"==typeof d&&""==d)return NaN;"number"!=typeof d||isNaN(d)||0==d||(d=h.round(d,this._decimalInfo.places));return this.inherited(arguments,[d])},serialize:function(d,c){return"number"!=typeof d||isNaN(d)?"":this.inherited(arguments)},_setBlurValue:function(){var d=
n.hitch(n.delegate(this,{focused:!0}),"get")("value");this._setValueAttr(d,!0)},_setValueAttr:function(d,c,a){if(void 0!==d&&void 0===a)if(a=String(d),"number"==typeof d)if(isNaN(d))a="";else{if("rangeCheck"in this&&this.rangeCheck(d,this.constraints)||!1===this.constraints.exponent||!/\de[-+]?\d/i.test(a))a=void 0}else d?d=void 0:(a="",d=NaN);this.inherited(arguments,[d,c,a])},_getValueAttr:function(){var d=this.inherited(arguments);if(isNaN(d)&&""!==this.textbox.value){if(!1!==this.constraints.exponent&&
/\de[-+]?\d/i.test(this.textbox.value)&&(new RegExp("^"+h._realNumberRegexp(n.delegate(this.constraints))+"$")).test(this.textbox.value))return d=Number(this.textbox.value),isNaN(d)?void 0:d}else return d},isValid:function(d){if(!this.focused||this._isEmpty(this.textbox.value))return this.inherited(arguments);var c=this.get("value");return!isNaN(c)&&this.rangeCheck(c,this.constraints)?!1!==this.constraints.exponent&&/\de[-+]?\d/i.test(this.textbox.value)?!0:this.inherited(arguments):!1},_isValidSubset:function(){var d=
"number"==typeof this.constraints.min,c="number"==typeof this.constraints.max,a=this.get("value");if(isNaN(a)||!d&&!c)return this.inherited(arguments);var e=a|0,k=0>a,h=-1!=this.textbox.value.indexOf(this._decimalInfo.sep),f=(this.maxLength||20)-this.textbox.value.length,b=h?this.textbox.value.split(this._decimalInfo.sep)[1].replace(/[^0-9]/g,""):"",e=h?e+"."+b:e+"",f=m.rep("9",f),h=a;k?h=Number(e+f):a=Number(e+f);return!(d&&a<this.constraints.min||c&&h>this.constraints.max)}});r=r("dijit.form.NumberTextBox",
[e,d],{baseClass:"dijitTextBox dijitNumberTextBox"});r.Mixin=d;return r})},"dijit/form/FilteringSelect":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/when","./MappedTextBox","./ComboBoxMixin"],function(r,n,p,m,h){return r("dijit.form.FilteringSelect",[m,h],{required:!0,_lastDisplayedValue:"",_isValidSubset:function(){return this._opened},isValid:function(){return!!this.item||!this.required&&""==this.get("displayedValue")},_refreshState:function(){this.searchTimer||this.inherited(arguments)},
_callbackSetLabel:function(e,k,d,g){k&&k[this.searchAttr]!==this._lastQuery||!k&&e.length&&this.store.getIdentity(e[0])!=this._lastQuery||(e.length?this.set("item",e[0],g):this.set("value","",g||void 0===g&&!this.focused,this.textbox.value,null))},_openResultList:function(e,k,d){k[this.searchAttr]===this._lastQuery&&(this.inherited(arguments),void 0===this.item&&this.validate(!0))},_getValueAttr:function(){return this.valueNode.value},_getValueField:function(){return"value"},_setValueAttr:function(e,
k,d,g){this._onChangeActive||(k=null);if(void 0===g){if(null===e||""===e)if(e="",!n.isString(d)){this._setDisplayedValueAttr(d||"",k);return}var c=this;this._lastQuery=e;p(this.store.get(e),function(a){c._callbackSetLabel(a?[a]:[],void 0,void 0,k)})}else this.valueNode.value=e,this.inherited(arguments,[e,k,d,g])},_setItemAttr:function(e,k,d){this.inherited(arguments);this._lastDisplayedValue=this.textbox.value},_getDisplayQueryString:function(e){return e.replace(/([\\\*\?])/g,"\\$1")},_setDisplayedValueAttr:function(e,
k){null==e&&(e="");if(!this._created){if(!("displayedValue"in this.params))return;k=!1}if(this.store){this.closeDropDown();var d=n.clone(this.query),g=this._getDisplayQueryString(e),c;this.store._oldAPI?c=g:(c=this._patternToRegExp(g),c.toString=function(){return g});this._lastQuery=d[this.searchAttr]=c;this._lastDisplayedValue=this.textbox.value=e;this._set("displayedValue",e);var a=this,l={queryOptions:{ignoreCase:this.ignoreCase,deep:!0}};n.mixin(l,this.fetchProperties);this._fetchHandle=this.store.query(d,
l);p(this._fetchHandle,function(c){a._fetchHandle=null;a._callbackSetLabel(c||[],d,l,k)},function(c){a._fetchHandle=null;a._cancelingQuery||console.error("dijit.form.FilteringSelect: "+c.toString())})}},undo:function(){this.set("displayedValue",this._lastDisplayedValue)}})})},"dijit/form/ComboBoxMixin":function(){define("dojo/_base/declare dojo/Deferred dojo/_base/kernel dojo/_base/lang dojo/store/util/QueryResults ./_AutoCompleterMixin ./_ComboBoxMenu ../_HasDropDown dojo/text!./templates/DropDownBox.html".split(" "),
function(r,n,p,m,h,e,k,d,g){return r("dijit.form.ComboBoxMixin",[d,e],{dropDownClass:k,hasDownArrow:!0,templateString:g,baseClass:"dijitTextBox dijitComboBox",cssStateNodes:{_buttonNode:"dijitDownArrowButton"},_setHasDownArrowAttr:function(c){this._set("hasDownArrow",c);this._buttonNode.style.display=c?"":"none"},_showResultList:function(){this.displayMessage("");this.inherited(arguments)},_setStoreAttr:function(c){c.get||m.mixin(c,{_oldAPI:!0,get:function(a){var c=new n;this.fetchItemByIdentity({identity:a,
onItem:function(a){c.resolve(a)},onError:function(a){c.reject(a)}});return c.promise},query:function(a,c){var d=new n(function(){e.abort&&e.abort()});d.total=new n;var e=this.fetch(m.mixin({query:a,onBegin:function(a){d.total.resolve(a)},onComplete:function(a){d.resolve(a)},onError:function(a){d.reject(a)}},c));return h(d)}});this._set("store",c)},postMixInProperties:function(){var c=this.params.store||this.store;c&&this._setStoreAttr(c);this.inherited(arguments);if(!this.params.store&&this.store&&
!this.store._oldAPI){var a=this.declaredClass;m.mixin(this.store,{getValue:function(c,d){p.deprecated(a+".store.getValue(item, attr) is deprecated for builtin store.  Use item.attr directly","","2.0");return c[d]},getLabel:function(c){p.deprecated(a+".store.getLabel(item) is deprecated for builtin store.  Use item.label directly","","2.0");return c.name},fetch:function(c){p.deprecated(a+".store.fetch() is deprecated for builtin store.","Use store.query()","2.0");require(["dojo/data/ObjectStore"],
m.hitch(this,function(a){(new a({objectStore:this})).fetch(c)}))}})}},buildRendering:function(){this.inherited(arguments);this.focusNode.setAttribute("aria-autocomplete",this.autoComplete?"both":"list")}})})},"dijit/form/_AutoCompleterMixin":function(){define("dojo/aspect dojo/_base/declare dojo/dom-attr dojo/keys dojo/_base/lang dojo/query dojo/regexp dojo/sniff ./DataList ./_TextBoxMixin ./_SearchMixin".split(" "),function(r,n,p,m,h,e,k,d,g,c,a){n=n("dijit.form._AutoCompleterMixin",a,{item:null,
autoComplete:!0,highlightMatch:"first",labelAttr:"",labelType:"text",maxHeight:-1,_stopClickEvents:!1,_getCaretPos:function(a){var c=0;if("number"==typeof a.selectionStart)c=a.selectionStart;else if(d("ie")){var e=a.ownerDocument.selection.createRange().duplicate();a=a.createTextRange();e.move("character",0);a.move("character",0);try{a.setEndPoint("EndToEnd",e),c=String(a.text).replace(/\r/g,"").length}catch(f){}}return c},_setCaretPos:function(a,d){d=parseInt(d);c.selectInputText(a,d,d)},_setDisabledAttr:function(a){this.inherited(arguments);
this.domNode.setAttribute("aria-disabled",a?"true":"false")},_onKey:function(a){if(!(32<=a.charCode)){var c=a.charCode||a.keyCode;if(c!=m.ALT&&c!=m.CTRL&&c!=m.META&&c!=m.SHIFT){var d=this.dropDown,e=null;this._abortQuery();this.inherited(arguments);if(!(a.altKey||a.ctrlKey||a.metaKey))switch(this._opened&&(e=d.getHighlightedOption()),c){case m.PAGE_DOWN:case m.DOWN_ARROW:case m.PAGE_UP:case m.UP_ARROW:this._opened&&this._announceOption(e);a.stopPropagation();a.preventDefault();break;case m.ENTER:if(e){if(e==
d.nextButton){this._nextSearch(1);a.stopPropagation();a.preventDefault();break}else if(e==d.previousButton){this._nextSearch(-1);a.stopPropagation();a.preventDefault();break}a.stopPropagation();a.preventDefault()}else this._setBlurValue(),this._setCaretPos(this.focusNode,this.focusNode.value.length);case m.TAB:c=this.get("displayedValue");if(d&&(c==d._messages.previousMessage||c==d._messages.nextMessage))break;e&&this._selectOption(e);case m.ESCAPE:this._opened&&(this._lastQuery=null,this.closeDropDown())}}}},
_autoCompleteText:function(a){var d=this.focusNode;c.selectInputText(d,d.value.length);var e=this.ignoreCase?"toLowerCase":"substr";0==a[e](0).indexOf(this.focusNode.value[e](0))?(e=this.autoComplete?this._getCaretPos(d):d.value.length,e+1>d.value.length&&(d.value=a,c.selectInputText(d,e))):(d.value=a,c.selectInputText(d))},_openResultList:function(a,c,d){var e=this.dropDown.getHighlightedOption();this.dropDown.clearResultList();a.length||0!=d.start?(this._nextSearch=this.dropDown.onPage=h.hitch(this,
function(b){a.nextPage(-1!==b);this.focus()}),this.dropDown.createOptions(a,d,h.hitch(this,"_getMenuLabelFromItem")),this._showResultList(),"direction"in d?(d.direction?this.dropDown.highlightFirstOption():d.direction||this.dropDown.highlightLastOption(),e&&this._announceOption(this.dropDown.getHighlightedOption())):!this.autoComplete||this._prev_key_backspace||/^[*]+$/.test(c[this.searchAttr].toString())||this._announceOption(this.dropDown.containerNode.firstChild.nextSibling)):this.closeDropDown()},
_showResultList:function(){this.closeDropDown(!0);this.openDropDown();this.domNode.setAttribute("aria-expanded","true")},loadDropDown:function(){this._startSearchAll()},isLoaded:function(){return!1},closeDropDown:function(){this._abortQuery();this._opened&&(this.inherited(arguments),this.domNode.setAttribute("aria-expanded","false"))},_setBlurValue:function(){var a=this.get("displayedValue"),c=this.dropDown;!c||a!=c._messages.previousMessage&&a!=c._messages.nextMessage?"undefined"==typeof this.item?
(this.item=null,this.set("displayedValue",a)):(this.value!=this._lastValueReported&&this._handleOnChange(this.value,!0),this._refreshState()):this._setValueAttr(this._lastValueReported,!0);this.focusNode.removeAttribute("aria-activedescendant")},_setItemAttr:function(a,c,d){var e="";a&&(d||(d=this.store._oldAPI?this.store.getValue(a,this.searchAttr):a[this.searchAttr]),e=this._getValueField()!=this.searchAttr?this.store.getIdentity(a):d);this.set("value",e,c,d,a)},_announceOption:function(a){if(a){var c;
if(a==this.dropDown.nextButton||a==this.dropDown.previousButton)c=a.innerHTML,this.item=void 0,this.value="";else{var d=this.dropDown.items[a.getAttribute("item")];c=(this.store._oldAPI?this.store.getValue(d,this.searchAttr):d[this.searchAttr]).toString();this.set("item",d,!1,c)}this.focusNode.value=this.focusNode.value.substring(0,this._lastInput.length);this.focusNode.setAttribute("aria-activedescendant",p.get(a,"id"));this._autoCompleteText(c)}},_selectOption:function(a){this.closeDropDown();a&&
this._announceOption(a);this._setCaretPos(this.focusNode,this.focusNode.value.length);this._handleOnChange(this.value,!0);this.focusNode.removeAttribute("aria-activedescendant")},_startSearchAll:function(){this._startSearch("")},_startSearchFromInput:function(){this.item=void 0;this.inherited(arguments)},_startSearch:function(a){if(!this.dropDown){var c=this.id+"_popup";this.dropDown=new (h.isString(this.dropDownClass)?h.getObject(this.dropDownClass,!1):this.dropDownClass)({onChange:h.hitch(this,
this._selectOption),id:c,dir:this.dir,textDir:this.textDir})}this._lastInput=a;this.inherited(arguments)},_getValueField:function(){return this.searchAttr},postMixInProperties:function(){this.inherited(arguments);if(!this.store&&this.srcNodeRef&&(this.store=new g({},this.srcNodeRef),!("value"in this.params))){var a=this.item=this.store.fetchSelectedItem();if(a){var c=this._getValueField();this.value=this.store._oldAPI?this.store.getValue(a,c):a[c]}}},postCreate:function(){var a=e('label[for\x3d"'+
this.id+'"]');a.length&&(a[0].id||(a[0].id=this.id+"_label"),this.domNode.setAttribute("aria-labelledby",a[0].id));this.inherited(arguments);r.after(this,"onSearch",h.hitch(this,"_openResultList"),!0)},_getMenuLabelFromItem:function(a){a=this.labelFunc(a,this.store);var c=this.labelType;"none"!=this.highlightMatch&&"text"==this.labelType&&this._lastInput&&(a=this.doHighlight(a,this._lastInput),c="html");return{html:"html"==c,label:a}},doHighlight:function(a,c){var d=(this.ignoreCase?"i":"")+("all"==
this.highlightMatch?"g":""),e=this.queryExpr.indexOf("${0}");c=k.escapeString(c);return this._escapeHtml(a.replace(new RegExp((0==e?"^":"")+"("+c+")"+(e==this.queryExpr.length-4?"$":""),d),"\uffff$1\uffff")).replace(/\uFFFF([^\uFFFF]+)\uFFFF/g,'\x3cspan class\x3d"dijitComboBoxHighlightMatch"\x3e$1\x3c/span\x3e')},_escapeHtml:function(a){return a=String(a).replace(/&/gm,"\x26amp;").replace(/</gm,"\x26lt;").replace(/>/gm,"\x26gt;").replace(/"/gm,"\x26quot;")},reset:function(){this.item=null;this.inherited(arguments)},
labelFunc:function(a,c){return(c._oldAPI?c.getValue(a,this.labelAttr||this.searchAttr):a[this.labelAttr||this.searchAttr]).toString()},_setValueAttr:function(a,c,d,e){this._set("item",e||null);null==a&&(a="");this.inherited(arguments)}});d("dojo-bidi")&&n.extend({_setTextDirAttr:function(a){this.inherited(arguments);this.dropDown&&this.dropDown._set("textDir",a)}});return n})},"dijit/form/DataList":function(){define("dojo/_base/declare dojo/dom dojo/_base/lang dojo/query dojo/store/Memory ../registry".split(" "),
function(r,n,p,m,h,e){function k(d){return{id:d.value,value:d.value,name:p.trim(d.innerText||d.textContent||"")}}return r("dijit.form.DataList",h,{constructor:function(d,g){this.domNode=n.byId(g);p.mixin(this,d);this.id&&e.add(this);this.domNode.style.display="none";this.inherited(arguments,[{data:m("option",this.domNode).map(k)}])},destroy:function(){e.remove(this.id)},fetchSelectedItem:function(){var d=m("\x3e option[selected]",this.domNode)[0]||m("\x3e option",this.domNode)[0];return d&&k(d)}})})},
"dijit/form/_SearchMixin":function(){define("dojo/_base/declare dojo/keys dojo/_base/lang dojo/query dojo/string dojo/when ../registry".split(" "),function(r,n,p,m,h,e,k){return r("dijit.form._SearchMixin",null,{pageSize:Infinity,store:null,fetchProperties:{},query:{},list:"",_setListAttr:function(d){this._set("list",d)},searchDelay:200,searchAttr:"name",queryExpr:"${0}*",ignoreCase:!0,_patternToRegExp:function(d){return new RegExp("^"+d.replace(/(\\.)|(\*)|(\?)|\W/g,function(d,c,a,e){return a?".*":
e?".":c?c:"\\"+d})+"$",this.ignoreCase?"mi":"m")},_abortQuery:function(){this.searchTimer&&(this.searchTimer=this.searchTimer.remove());this._queryDeferHandle&&(this._queryDeferHandle=this._queryDeferHandle.remove());this._fetchHandle&&(this._fetchHandle.abort&&(this._cancelingQuery=!0,this._fetchHandle.abort(),this._cancelingQuery=!1),this._fetchHandle.cancel&&(this._cancelingQuery=!0,this._fetchHandle.cancel(),this._cancelingQuery=!1),this._fetchHandle=null)},_processInput:function(d){if(!this.disabled&&
!this.readOnly){d=d.charOrCode;this._prev_key_backspace=!1;if(d==n.DELETE||d==n.BACKSPACE)this._maskValidSubsetError=this._prev_key_backspace=!0;if(this.store)this.searchTimer=this.defer("_startSearchFromInput",1);else this.onSearch()}},onSearch:function(){},_startSearchFromInput:function(){this._startSearch(this.focusNode.value)},_startSearch:function(d){this._abortQuery();var g=this,c=p.clone(this.query),a={start:0,count:this.pageSize,queryOptions:{ignoreCase:this.ignoreCase,deep:!0}},k=h.substitute(this.queryExpr,
[d.replace(/([\\\*\?])/g,"\\$1")]),m,n=function(){var d=g._fetchHandle=g.store.query(c,a);g.disabled||g.readOnly||m!==g._lastQuery||e(d,function(b){g._fetchHandle=null;g.disabled||g.readOnly||m!==g._lastQuery||e(d.total,function(d){b.total=d;var e=g.pageSize;if(isNaN(e)||e>b.total)e=b.total;b.nextPage=function(d){a.direction=d=!1!==d;a.count=e;d?(a.start+=b.length,a.start>=b.total&&(a.count=0)):(a.start-=e,0>a.start&&(a.count=Math.max(e+a.start,0),a.start=0));0>=a.count?(b.length=0,g.onSearch(b,c,
a)):n()};g.onSearch(b,c,a)})},function(a){g._fetchHandle=null;g._cancelingQuery||console.error(g.declaredClass+" "+a.toString())})};p.mixin(a,this.fetchProperties);this.store._oldAPI?m=k:(m=this._patternToRegExp(k),m.toString=function(){return k});this._lastQuery=c[this.searchAttr]=m;this._queryDeferHandle=this.defer(n,this.searchDelay)},constructor:function(){this.query={};this.fetchProperties={}},postMixInProperties:function(){if(!this.store){var d=this.list;d&&(this.store=k.byId(d))}this.inherited(arguments)}})})},
"dijit/form/_ComboBoxMenu":function(){define("dojo/_base/declare dojo/dom-class dojo/dom-style dojo/keys ../_WidgetBase ../_TemplatedMixin ./_ComboBoxMenuMixin ./_ListMouseMixin".split(" "),function(r,n,p,m,h,e,k,d){return r("dijit.form._ComboBoxMenu",[h,e,d,k],{templateString:"\x3cdiv class\x3d'dijitReset dijitMenu' data-dojo-attach-point\x3d'containerNode' style\x3d'overflow: auto; overflow-x: hidden;' role\x3d'listbox'\x3e\x3cdiv class\x3d'dijitMenuItem dijitMenuPreviousButton' data-dojo-attach-point\x3d'previousButton' role\x3d'option'\x3e\x3c/div\x3e\x3cdiv class\x3d'dijitMenuItem dijitMenuNextButton' data-dojo-attach-point\x3d'nextButton' role\x3d'option'\x3e\x3c/div\x3e\x3c/div\x3e",
baseClass:"dijitComboBoxMenu",postCreate:function(){this.inherited(arguments);this.isLeftToRight()||(n.add(this.previousButton,"dijitMenuItemRtl"),n.add(this.nextButton,"dijitMenuItemRtl"));this.containerNode.setAttribute("role","listbox")},_createMenuItem:function(){var d=this.ownerDocument.createElement("div");d.className="dijitReset dijitMenuItem"+(this.isLeftToRight()?"":" dijitMenuItemRtl");d.setAttribute("role","option");return d},onHover:function(d){n.add(d,"dijitMenuItemHover")},onUnhover:function(d){n.remove(d,
"dijitMenuItemHover")},onSelect:function(d){n.add(d,"dijitMenuItemSelected")},onDeselect:function(d){n.remove(d,"dijitMenuItemSelected")},_page:function(d){var c=0,a=this.domNode.scrollTop,e=p.get(this.domNode,"height");for(this.getHighlightedOption()||this.selectNextNode();c<e;){var g=this.getHighlightedOption();if(d){if(!g.previousSibling||"none"==g.previousSibling.style.display)break;this.selectPreviousNode()}else{if(!g.nextSibling||"none"==g.nextSibling.style.display)break;this.selectNextNode()}g=
this.domNode.scrollTop;c+=(g-a)*(d?-1:1);a=g}},handleKey:function(d){switch(d.keyCode){case m.DOWN_ARROW:return this.selectNextNode(),!1;case m.PAGE_DOWN:return this._page(!1),!1;case m.UP_ARROW:return this.selectPreviousNode(),!1;case m.PAGE_UP:return this._page(!0),!1;default:return!0}}})})},"dijit/form/_ComboBoxMenuMixin":function(){define("dojo/_base/array dojo/_base/declare dojo/dom-attr dojo/has dojo/i18n dojo/i18n!./nls/ComboBox".split(" "),function(r,n,p,m,h){var e=n("dijit.form._ComboBoxMenuMixin"+
(m("dojo-bidi")?"_NoBidi":""),null,{_messages:null,postMixInProperties:function(){this.inherited(arguments);this._messages=h.getLocalization("dijit.form","ComboBox",this.lang)},buildRendering:function(){this.inherited(arguments);this.previousButton.innerHTML=this._messages.previousMessage;this.nextButton.innerHTML=this._messages.nextMessage},_setValueAttr:function(e){this._set("value",e);this.onChange(e)},onClick:function(e){if(e==this.previousButton)this._setSelectedAttr(null),this.onPage(-1);else if(e==
this.nextButton)this._setSelectedAttr(null),this.onPage(1);else this.onChange(e)},onChange:function(){},onPage:function(){},onClose:function(){this._setSelectedAttr(null)},_createOption:function(e,d){var g=this._createMenuItem(),c=d(e);c.html?g.innerHTML=c.label:g.appendChild(g.ownerDocument.createTextNode(c.label));""==g.innerHTML&&(g.innerHTML="\x26#160;");return g},createOptions:function(e,d,g){this.items=e;this.previousButton.style.display=0==d.start?"none":"";p.set(this.previousButton,"id",this.id+
"_prev");r.forEach(e,function(a,c){var d=this._createOption(a,g);d.setAttribute("item",c);p.set(d,"id",this.id+c);this.nextButton.parentNode.insertBefore(d,this.nextButton)},this);var c=!1;e.total&&!e.total.then&&-1!=e.total?d.start+d.count<e.total?c=!0:d.start+d.count>e.total&&d.count==e.length&&(c=!0):d.count==e.length&&(c=!0);this.nextButton.style.display=c?"":"none";p.set(this.nextButton,"id",this.id+"_next")},clearResultList:function(){for(var e=this.containerNode;2<e.childNodes.length;)e.removeChild(e.childNodes[e.childNodes.length-
2]);this._setSelectedAttr(null)},highlightFirstOption:function(){this.selectFirstNode()},highlightLastOption:function(){this.selectLastNode()},selectFirstNode:function(){this.inherited(arguments);this.getHighlightedOption()==this.previousButton&&this.selectNextNode()},selectLastNode:function(){this.inherited(arguments);this.getHighlightedOption()==this.nextButton&&this.selectPreviousNode()},getHighlightedOption:function(){return this.selected}});m("dojo-bidi")&&(e=n("dijit.form._ComboBoxMenuMixin",
e,{_createOption:function(){var e=this.inherited(arguments);this.applyTextDir(e);return e}}));return e})},"dijit/form/_ListMouseMixin":function(){define(["dojo/_base/declare","dojo/on","dojo/touch","./_ListBase"],function(r,n,p,m){return r("dijit.form._ListMouseMixin",m,{postCreate:function(){this.inherited(arguments);this.domNode.dojoClick=!0;this._listConnect("click","_onClick");this._listConnect("mousedown","_onMouseDown");this._listConnect("mouseup","_onMouseUp");this._listConnect("mouseover",
"_onMouseOver");this._listConnect("mouseout","_onMouseOut")},_onClick:function(h,e){this._setSelectedAttr(e,!1);this._deferredClick&&this._deferredClick.remove();this._deferredClick=this.defer(function(){this._deferredClick=null;this.onClick(e)})},_onMouseDown:function(h,e){this._hoveredNode&&(this.onUnhover(this._hoveredNode),this._hoveredNode=null);this._isDragging=!0;this._setSelectedAttr(e,!1)},_onMouseUp:function(h,e){this._isDragging=!1;var k=this.selected,d=this._hoveredNode;k&&e==k?this.defer(function(){this._onClick(h,
k)}):d&&this.defer(function(){this._onClick(h,d)})},_onMouseOut:function(h,e){this._hoveredNode&&(this.onUnhover(this._hoveredNode),this._hoveredNode=null);this._isDragging&&(this._cancelDrag=(new Date).getTime()+1E3)},_onMouseOver:function(h,e){this._cancelDrag&&((new Date).getTime()>this._cancelDrag&&(this._isDragging=!1),this._cancelDrag=null);this._hoveredNode=e;this.onHover(e);this._isDragging&&this._setSelectedAttr(e,!1)}})})},"dijit/form/_ListBase":function(){define(["dojo/_base/declare","dojo/on",
"dojo/window"],function(r,n,p){return r("dijit.form._ListBase",null,{selected:null,_listConnect:function(m,h){var e=this;return e.own(n(e.containerNode,n.selector(function(e,d,g){return e.parentNode==g},m),function(k){e[h](k,this)}))},selectFirstNode:function(){for(var m=this.containerNode.firstChild;m&&"none"==m.style.display;)m=m.nextSibling;this._setSelectedAttr(m,!0)},selectLastNode:function(){for(var m=this.containerNode.lastChild;m&&"none"==m.style.display;)m=m.previousSibling;this._setSelectedAttr(m,
!0)},selectNextNode:function(){var m=this.selected;if(m){for(m=m.nextSibling;m&&"none"==m.style.display;)m=m.nextSibling;m?this._setSelectedAttr(m,!0):this.selectFirstNode()}else this.selectFirstNode()},selectPreviousNode:function(){var m=this.selected;if(m){for(m=m.previousSibling;m&&"none"==m.style.display;)m=m.previousSibling;m?this._setSelectedAttr(m,!0):this.selectLastNode()}else this.selectLastNode()},_setSelectedAttr:function(m,h){if(this.selected!=m){var e=this.selected;if(e)this.onDeselect(e);
m&&(h&&p.scrollIntoView(m),this.onSelect(m));this._set("selected",m)}else if(m)this.onSelect(m)}})})},"dijit/form/NumberSpinner":function(){define(["dojo/_base/declare","dojo/keys","./_Spinner","./NumberTextBox"],function(r,n,p,m){return r("dijit.form.NumberSpinner",[p,m.Mixin],{baseClass:"dijitTextBox dijitSpinner dijitNumberTextBox",adjust:function(h,e){var k=this.constraints,d=isNaN(h),g=!isNaN(k.max),c=!isNaN(k.min);d&&0!=e&&(h=0<e?c?k.min:g?k.max:0:g?this.constraints.max:c?k.min:0);var a=h+e;
if(d||isNaN(a))return h;g&&a>k.max&&(a=k.max);c&&a<k.min&&(a=k.min);return a},_onKeyDown:function(h){if(!(this.disabled||this.readOnly||h.keyCode!=n.HOME&&h.keyCode!=n.END||h.ctrlKey||h.altKey||h.metaKey||"undefined"==typeof this.get("value"))){var e=this.constraints[h.keyCode==n.HOME?"min":"max"];"number"==typeof e&&this._setValueAttr(e,!1);h.stopPropagation();h.preventDefault()}}})})},"dijit/form/_Spinner":function(){define("dojo/_base/declare dojo/keys dojo/_base/lang dojo/sniff dojo/mouse dojo/on ../typematic ./RangeBoundTextBox dojo/text!./templates/Spinner.html ./_TextBoxMixin".split(" "),
function(r,n,p,m,h,e,k,d,g,c){return r("dijit.form._Spinner",d,{defaultTimeout:500,minimumTimeout:10,timeoutChangeRate:.9,smallDelta:1,largeDelta:10,templateString:g,baseClass:"dijitTextBox dijitSpinner",cssStateNodes:{upArrowNode:"dijitUpArrowButton",downArrowNode:"dijitDownArrowButton"},adjust:function(a){return a},_arrowPressed:function(a,d,e){this.disabled||this.readOnly||(this._setValueAttr(this.adjust(this.get("value"),d*e),!1),c.selectInputText(this.textbox,this.textbox.value.length))},_arrowReleased:function(){this._wheelTimer=
null},_typematicCallback:function(a,c,d){var e=this.smallDelta;c==this.textbox&&(c=d.keyCode,e=c==n.PAGE_UP||c==n.PAGE_DOWN?this.largeDelta:this.smallDelta,c=c==n.UP_ARROW||c==n.PAGE_UP?this.upArrowNode:this.downArrowNode);-1==a?this._arrowReleased(c):this._arrowPressed(c,c==this.upArrowNode?1:-1,e)},_wheelTimer:null,_mouseWheeled:function(a){if(this.focused){a.stopPropagation();a.preventDefault();var c=a.wheelDelta/120;Math.floor(c)!=c&&(c=0<a.wheelDelta?1:-1);a=a.detail?-1*a.detail:c;if(0!==a){var d=
this[0<a?"upArrowNode":"downArrowNode"];this._arrowPressed(d,a,this.smallDelta);this._wheelTimer&&this._wheelTimer.remove();this._wheelTimer=this.defer(function(){this._arrowReleased(d)},50)}}},_setConstraintsAttr:function(a){this.inherited(arguments);this.focusNode&&(void 0!==this.constraints.min?this.focusNode.setAttribute("aria-valuemin",this.constraints.min):this.focusNode.removeAttribute("aria-valuemin"),void 0!==this.constraints.max?this.focusNode.setAttribute("aria-valuemax",this.constraints.max):
this.focusNode.removeAttribute("aria-valuemax"))},_setValueAttr:function(a,c){this.focusNode.setAttribute("aria-valuenow",a);this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.own(e(this.domNode,h.wheel,p.hitch(this,"_mouseWheeled")),k.addListener(this.upArrowNode,this.textbox,{keyCode:n.UP_ARROW,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1},this,"_typematicCallback",this.timeoutChangeRate,this.defaultTimeout,this.minimumTimeout),k.addListener(this.downArrowNode,this.textbox,
{keyCode:n.DOWN_ARROW,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1},this,"_typematicCallback",this.timeoutChangeRate,this.defaultTimeout,this.minimumTimeout),k.addListener(this.upArrowNode,this.textbox,{keyCode:n.PAGE_UP,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1},this,"_typematicCallback",this.timeoutChangeRate,this.defaultTimeout,this.minimumTimeout),k.addListener(this.downArrowNode,this.textbox,{keyCode:n.PAGE_DOWN,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1},this,"_typematicCallback",this.timeoutChangeRate,
this.defaultTimeout,this.minimumTimeout))}})})},"dijit/typematic":function(){define("dojo/_base/array dojo/_base/connect dojo/_base/lang dojo/on dojo/sniff ./main".split(" "),function(r,n,p,m,h,e){var k=e.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(0>this._currentTimeout?this._initialDelay:1<this._subsequentDelay?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay),this._minDelay);
this._timer=setTimeout(p.hitch(this,"_fireEventAndReload"),this._currentTimeout)},trigger:function(d,e,c,a,k,h,m,f){if(k!=this._obj){this.stop();this._initialDelay=m||500;this._subsequentDelay=h||.9;this._minDelay=f||10;this._obj=k;this._node=c;this._count=this._currentTimeout=-1;this._callback=p.hitch(e,a);this._evt={faux:!0};for(var b in d)"layerX"!=b&&"layerY"!=b&&(e=d[b],"function"!=typeof e&&"undefined"!=typeof e&&(this._evt[b]=e));this._fireEventAndReload()}},stop:function(){this._timer&&(clearTimeout(this._timer),
this._timer=null);this._obj&&(this._callback(-1,this._node,this._evt),this._obj=null)},addKeyListener:function(d,e,c,a,h,t,v){var f="keyCode"in e?"keyCode":"charCode"in e?"charCode":"charOrCode",b=[m(d,"keyCode"in e?"keydown":"charCode"in e?"keypress":n._keypress,p.hitch(this,function(b){b[f]!=e[f]||void 0!==e.ctrlKey&&e.ctrlKey!=b.ctrlKey||void 0!==e.altKey&&e.altKey!=b.altKey||void 0!==e.metaKey&&e.metaKey!=(b.metaKey||!1)||void 0!==e.shiftKey&&e.shiftKey!=b.shiftKey?k._obj==e&&k.stop():(b.stopPropagation(),
b.preventDefault(),k.trigger(b,c,d,a,e,h,t,v))})),m(d,"keyup",p.hitch(this,function(){k._obj==e&&k.stop()}))];return{remove:function(){r.forEach(b,function(a){a.remove()})}}},addMouseListener:function(d,e,c,a,l,t){var g=[m(d,"mousedown",p.hitch(this,function(f){f.preventDefault();k.trigger(f,e,d,c,d,a,l,t)})),m(d,"mouseup",p.hitch(this,function(a){this._obj&&a.preventDefault();k.stop()})),m(d,"mouseout",p.hitch(this,function(a){this._obj&&a.preventDefault();k.stop()})),m(d,"dblclick",p.hitch(this,
function(f){f.preventDefault();9>h("ie")&&(k.trigger(f,e,d,c,d,a,l,t),setTimeout(p.hitch(this,k.stop),50))}))];return{remove:function(){r.forEach(g,function(a){a.remove()})}}},addListener:function(d,e,c,a,k,h,m,f){var b=[this.addKeyListener(e,c,a,k,h,m,f),this.addMouseListener(d,a,k,h,m,f)];return{remove:function(){r.forEach(b,function(a){a.remove()})}}}};return k})},"dijit/form/SimpleTextarea":function(){define(["dojo/_base/declare","dojo/dom-class","dojo/sniff","./TextBox"],function(r,n,p,m){return r("dijit.form.SimpleTextarea",
m,{baseClass:"dijitTextBox dijitTextArea",rows:"3",cols:"20",templateString:"\x3ctextarea ${!nameAttrSetting} data-dojo-attach-point\x3d'focusNode,containerNode,textbox' autocomplete\x3d'off'\x3e\x3c/textarea\x3e",postMixInProperties:function(){!this.value&&this.srcNodeRef&&(this.value=this.srcNodeRef.value);this.inherited(arguments)},buildRendering:function(){this.inherited(arguments);p("ie")&&this.cols&&n.add(this.textbox,"dijitTextAreaCols")},filter:function(h){h&&(h=h.replace(/\r/g,""));return this.inherited(arguments)},
_onInput:function(h){if(this.maxLength){var e=parseInt(this.maxLength),k=this.textbox.value.replace(/\r/g,""),e=k.length-e;if(0<e){var d=this.textbox;if(d.selectionStart){var g=d.selectionStart,c=0;p("opera")&&(c=(this.textbox.value.substring(0,g).match(/\r/g)||[]).length);this.textbox.value=k.substring(0,g-e-c)+k.substring(g-c);d.setSelectionRange(g-e,g-e)}else this.ownerDocument.selection&&(d.focus(),k=this.ownerDocument.selection.createRange(),k.moveStart("character",-e),k.text="",k.select())}}this.inherited(arguments)}})})},
"dijit/form/TimeTextBox":function(){define("dojo/_base/declare dojo/keys dojo/query dojo/_base/lang ../_TimePicker ./_DateTimeTextBox".split(" "),function(r,n,p,m,h,e){return r("dijit.form.TimeTextBox",e,{baseClass:"dijitTextBox dijitComboBox dijitTimeTextBox",popupClass:h,_selector:"time",value:new Date(""),maxHeight:-1,openDropDown:function(e){this.inherited(arguments);var d=p(".dijitTimePickerItemSelected",this.dropDown.domNode),g=this.dropDown.domNode.parentNode;g.scrollTop=d[0]?d[0].offsetTop-
(g.clientHeight-d[0].clientHeight)/2:(g.scrollHeight-g.clientHeight)/2;this.dropDown.on("input",m.hitch(this,function(){this.set("value",this.dropDown.get("value"),!1)}))},_onInput:function(){this.inherited(arguments);var e=this.get("displayedValue");this.filterString=e&&!this.parse(e,this.constraints)?e.toLowerCase():"";this._opened&&this.closeDropDown();this.openDropDown()}})})},"dijit/_TimePicker":function(){define("dojo/_base/array dojo/date dojo/date/locale dojo/date/stamp dojo/_base/declare dojo/dom-class dojo/dom-construct dojo/_base/kernel dojo/keys dojo/_base/lang dojo/sniff dojo/query dojo/mouse dojo/on ./_WidgetBase ./form/_ListMouseMixin".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b){return h("dijit._TimePicker",[f,b],{baseClass:"dijitTimePicker",pickerMin:"T00:00:00",pickerMax:"T23:59:59",clickableIncrement:"T00:15:00",visibleIncrement:"T01:00:00",value:new Date,_visibleIncrement:2,_clickableIncrement:1,_totalIncrements:10,constraints:{},serialize:m.toISOString,buildRendering:function(){this.inherited(arguments);this.timeMenu=this.containerNode=this.domNode},setValue:function(a){d.deprecated("dijit._TimePicker:setValue() is deprecated.  Use set('value', ...) instead.",
"","2.0");this.set("value",a)},_setValueAttr:function(a){this._set("value",a);this._showText()},_setFilterStringAttr:function(a){this._set("filterString",a);this._showText()},isDisabledDate:function(){return!1},_getFilteredNodes:function(a,b,c,d){a=this.ownerDocument.createDocumentFragment();for(b=0;b<this._maxIncrement;b++)(c=this._createOption(b))&&a.appendChild(c);return a},_showText:function(){var a=m.fromISOString;this.domNode.innerHTML="";this._clickableIncrementDate=a(this.clickableIncrement);
this._visibleIncrementDate=a(this.visibleIncrement);var b=function(a){return 3600*a.getHours()+60*a.getMinutes()+a.getSeconds()},c=b(this._clickableIncrementDate),b=b(this._visibleIncrementDate);(this.value||this.currentFocus).getTime();this._refDate=a(this.pickerMin);this._refDate.setFullYear(1970,0,1);this._clickableIncrement=1;this._visibleIncrement=b/c;a=a(this.pickerMax);a.setFullYear(1970,0,1);a=.001*(a.getTime()-this._refDate.getTime());this._maxIncrement=Math.ceil((a+1)/c);c=this._getFilteredNodes();
!c.firstChild&&this.filterString?(this.filterString="",this._showText()):this.domNode.appendChild(c)},constructor:function(){this.constraints={}},postMixInProperties:function(){this.inherited(arguments);this._setConstraintsAttr(this.constraints)},_setConstraintsAttr:function(a){for(var b in{clickableIncrement:1,visibleIncrement:1,pickerMin:1,pickerMax:1})b in a&&(this[b]=a[b]);a.locale||(a.locale=this.lang)},_createOption:function(a){var b=new Date(this._refDate),c=this._clickableIncrementDate;b.setHours(b.getHours()+
c.getHours()*a,b.getMinutes()+c.getMinutes()*a,b.getSeconds()+c.getSeconds()*a);"time"==this.constraints.selector&&b.setFullYear(1970,0,1);var d=p.format(b,this.constraints);if(this.filterString&&0!==d.toLowerCase().indexOf(this.filterString))return null;c=this.ownerDocument.createElement("div");c.className=this.baseClass+"Item";c.date=b;c.idx=a;k.create("div",{"class":this.baseClass+"ItemInner",innerHTML:d},c);d=1>a%this._visibleIncrement&&-1<a%this._visibleIncrement;a=!d&&!(a%this._clickableIncrement);
d?c.className+=" "+this.baseClass+"Marker":a&&(c.className+=" "+this.baseClass+"Tick");this.isDisabledDate(b)&&(c.className+=" "+this.baseClass+"ItemDisabled");this.value&&!n.compare(this.value,b,this.constraints.selector)&&(c.selected=!0,c.className+=" "+this.baseClass+"ItemSelected",this._selectedDiv=c,d?c.className+=" "+this.baseClass+"MarkerSelected":a&&(c.className+=" "+this.baseClass+"TickSelected"),this._highlightOption(c,!0));return c},onOpen:function(){this.inherited(arguments);this.set("selected",
this._selectedDiv)},_onOptionSelected:function(a,b){var c=a.target.date||a.target.parentNode.date;c&&!this.isDisabledDate(c)&&(this._set("value",c),this.emit("input"),b&&(this._highlighted_option=null,this.set("value",c),this.onChange(c)))},onChange:function(){},_highlightOption:function(a,b){if(a){if(b)this._highlighted_option&&this._highlightOption(this._highlighted_option,!1),this._highlighted_option=a;else{if(this._highlighted_option!==a)return;this._highlighted_option=null}e.toggle(a,this.baseClass+
"ItemHover",b);e.contains(a,this.baseClass+"Marker")?e.toggle(a,this.baseClass+"MarkerHover",b):e.toggle(a,this.baseClass+"TickHover",b)}},handleKey:function(a){if(a.keyCode==g.DOWN_ARROW)return this.selectNextNode(),this._onOptionSelected({target:this._highlighted_option},!1),a.stopPropagation(),a.preventDefault(),!1;if(a.keyCode==g.UP_ARROW)return this.selectPreviousNode(),this._onOptionSelected({target:this._highlighted_option},!1),a.stopPropagation(),a.preventDefault(),!1;if(a.keyCode==g.ENTER||
a.keyCode===g.TAB){if(!this._keyboardSelected&&a.keyCode===g.TAB)return!0;this._highlighted_option&&this._onOptionSelected({target:this._highlighted_option},!0);return a.keyCode===g.TAB}},onHover:function(a){this._highlightOption(a,!0)},onUnhover:function(a){this._highlightOption(a,!1)},onSelect:function(a){this._highlightOption(a,!0)},onDeselect:function(a){this._highlightOption(a,!1)},onClick:function(a){this._onOptionSelected({target:a},!0)}})})},"dojo/data/ItemFileReadStore":function(){define("../_base/kernel ../_base/lang ../_base/declare ../_base/array ../_base/xhr ../Evented ./util/filter ./util/simpleFetch ../date/stamp".split(" "),
function(r,n,p,m,h,e,k,d,g){p=p("dojo.data.ItemFileReadStore",[e],{constructor:function(c){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=!1;this.url=this._ccUrl=this._jsonFileUrl=c.url;this._jsonData=c.data;this.data=null;this._datatypeMap=c.typeMap||{};this._datatypeMap.Date||(this._datatypeMap.Date={type:Date,deserialize:function(a){return g.fromISOString(a)}});this._features={"dojo.data.api.Read":!0,"dojo.data.api.Identity":!0};this._itemsByIdentity=null;this._storeRefPropName=
"_S";this._itemNumPropName="_0";this._rootItemPropName="_RI";this._reverseRefMap="_RRM";this._loadInProgress=!1;this._queuedFetches=[];void 0!==c.urlPreventCache&&(this.urlPreventCache=c.urlPreventCache?!0:!1);void 0!==c.hierarchical&&(this.hierarchical=c.hierarchical?!0:!1);c.clearOnClose&&(this.clearOnClose=!0);"failOk"in c&&(this.failOk=c.failOk?!0:!1)},url:"",_ccUrl:"",data:null,typeMap:null,clearOnClose:!1,urlPreventCache:!1,failOk:!1,hierarchical:!0,_assertIsItem:function(c){if(!this.isItem(c))throw Error(this.declaredClass+
": Invalid item argument.");},_assertIsAttribute:function(c){if("string"!==typeof c)throw Error(this.declaredClass+": Invalid attribute argument.");},getValue:function(c,a,d){c=this.getValues(c,a);return 0<c.length?c[0]:d},getValues:function(c,a){this._assertIsItem(c);this._assertIsAttribute(a);return(c[a]||[]).slice(0)},getAttributes:function(c){this._assertIsItem(c);var a=[],d;for(d in c)d!==this._storeRefPropName&&d!==this._itemNumPropName&&d!==this._rootItemPropName&&d!==this._reverseRefMap&&
a.push(d);return a},hasAttribute:function(c,a){this._assertIsItem(c);this._assertIsAttribute(a);return a in c},containsValue:function(c,a,d){var e=void 0;"string"===typeof d&&(e=k.patternToRegExp(d,!1));return this._containsValue(c,a,d,e)},_containsValue:function(c,a,d,e){return m.some(this.getValues(c,a),function(a){if(null!==a&&!n.isObject(a)&&e){if(a.toString().match(e))return!0}else if(d===a)return!0})},isItem:function(c){return c&&c[this._storeRefPropName]===this&&this._arrayOfAllItems[c[this._itemNumPropName]]===
c?!0:!1},isItemLoaded:function(c){return this.isItem(c)},loadItem:function(c){this._assertIsItem(c.item)},getFeatures:function(){return this._features},getLabel:function(c){if(this._labelAttr&&this.isItem(c))return this.getValue(c,this._labelAttr)},getLabelAttributes:function(c){return this._labelAttr?[this._labelAttr]:null},filter:function(c,a,d){var e=[],g,f;if(c.query){var b;g=c.queryOptions?c.queryOptions.ignoreCase:!1;var h={};for(f in c.query)b=c.query[f],"string"===typeof b?h[f]=k.patternToRegExp(b,
g):b instanceof RegExp&&(h[f]=b);for(g=0;g<a.length;++g){var l=!0,m=a[g];if(null===m)l=!1;else for(f in c.query)b=c.query[f],this._containsValue(m,f,b,h[f])||(l=!1);l&&e.push(m)}}else for(g=0;g<a.length;++g)f=a[g],null!==f&&e.push(f);d(e,c)},_fetchItems:function(c,a,d){var e=this;if(this._loadFinished)this.filter(c,this._getItemsArray(c.queryOptions),a);else if(this._jsonFileUrl!==this._ccUrl?(r.deprecated(this.declaredClass+": ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0"),
this.url=this._ccUrl=this._jsonFileUrl):this.url!==this._ccUrl&&(this._ccUrl=this._jsonFileUrl=this.url),null!=this.data&&(this._jsonData=this.data,this.data=null),this._jsonFileUrl)if(this._loadInProgress)this._queuedFetches.push({args:c,filter:n.hitch(e,"filter"),findCallback:n.hitch(e,a)});else{this._loadInProgress=!0;var g=h.get({url:e._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});g.addCallback(function(b){try{e._getItemsFromLoadedData(b),
e._loadFinished=!0,e._loadInProgress=!1,e.filter(c,e._getItemsArray(c.queryOptions),a),e._handleQueuedFetches()}catch(q){e._loadFinished=!0,e._loadInProgress=!1,d(q,c)}});g.addErrback(function(a){e._loadInProgress=!1;d(a,c)});var f=null;c.abort&&(f=c.abort);c.abort=function(){var a=g;a&&-1===a.fired&&(a.cancel(),a=null);f&&f.call(c)}}else if(this._jsonData)try{this._loadFinished=!0,this._getItemsFromLoadedData(this._jsonData),this._jsonData=null,e.filter(c,this._getItemsArray(c.queryOptions),a)}catch(b){d(b,
c)}else d(Error(this.declaredClass+": No JSON source data was provided as either URL or a nested Javascript object."),c)},_handleQueuedFetches:function(){if(0<this._queuedFetches.length){for(var c=0;c<this._queuedFetches.length;c++){var a=this._queuedFetches[c],d=a.args,e=a.filter,a=a.findCallback;e?e(d,this._getItemsArray(d.queryOptions),a):this.fetchItemByIdentity(d)}this._queuedFetches=[]}},_getItemsArray:function(c){return c&&c.deep?this._arrayOfAllItems:this._arrayOfTopLevelItems},close:function(c){this.clearOnClose&&
this._loadFinished&&!this._loadInProgress&&(""!=this._jsonFileUrl&&null!=this._jsonFileUrl||""!=this.url&&null!=this.url||null!=this.data||console.debug(this.declaredClass+": WARNING!  Data reload  information has not been provided.  Please set 'url' or 'data' to the appropriate value before the next fetch"),this._arrayOfAllItems=[],this._arrayOfTopLevelItems=[],this._loadFinished=!1,this._itemsByIdentity=null,this._loadInProgress=!1,this._queuedFetches=[])},_getItemsFromLoadedData:function(c){function a(a){return null!==
a&&"object"===typeof a&&(!n.isArray(a)||e)&&!n.isFunction(a)&&(a.constructor==Object||n.isArray(a))&&"undefined"===typeof a._reference&&"undefined"===typeof a._type&&"undefined"===typeof a._value&&g.hierarchical}function d(b){g._arrayOfAllItems.push(b);for(var c in b){var e=b[c];if(e)if(n.isArray(e))for(var f=0;f<e.length;++f){var k=e[f];a(k)&&d(k)}else a(e)&&d(e)}}var e=!1,g=this;this._labelAttr=c.label;var f,b;this._arrayOfAllItems=[];this._arrayOfTopLevelItems=c.items;for(f=0;f<this._arrayOfTopLevelItems.length;++f)b=
this._arrayOfTopLevelItems[f],n.isArray(b)&&(e=!0),d(b),b[this._rootItemPropName]=!0;var k={},h;for(f=0;f<this._arrayOfAllItems.length;++f)for(h in b=this._arrayOfAllItems[f],b){if(h!==this._rootItemPropName){var m=b[h];null!==m?n.isArray(m)||(b[h]=[m]):b[h]=[null]}k[h]=h}for(;k[this._storeRefPropName];)this._storeRefPropName+="_";for(;k[this._itemNumPropName];)this._itemNumPropName+="_";for(;k[this._reverseRefMap];)this._reverseRefMap+="_";if(k=c.identifier)for(this._itemsByIdentity={},this._features["dojo.data.api.Identity"]=
k,f=0;f<this._arrayOfAllItems.length;++f)if(b=this._arrayOfAllItems[f],c=b[k],c=c[0],Object.hasOwnProperty.call(this._itemsByIdentity,c)){if(this._jsonFileUrl)throw Error(this.declaredClass+":  The json data as specified by: ["+this._jsonFileUrl+"] is malformed.  Items within the list have identifier: ["+k+"].  Value collided: ["+c+"]");if(this._jsonData)throw Error(this.declaredClass+":  The json data provided by the creation arguments is malformed.  Items within the list have identifier: ["+k+"].  Value collided: ["+
c+"]");}else this._itemsByIdentity[c]=b;else this._features["dojo.data.api.Identity"]=Number;for(f=0;f<this._arrayOfAllItems.length;++f)b=this._arrayOfAllItems[f],b[this._storeRefPropName]=this,b[this._itemNumPropName]=f;for(f=0;f<this._arrayOfAllItems.length;++f)for(h in b=this._arrayOfAllItems[f],b)for(c=b[h],k=0;k<c.length;++k)if(m=c[k],null!==m&&"object"==typeof m){if("_type"in m&&"_value"in m){var p=m._type,r=this._datatypeMap[p];if(r)if(n.isFunction(r))c[k]=new r(m._value);else if(n.isFunction(r.deserialize))c[k]=
r.deserialize(m._value);else throw Error("dojo.data.ItemFileReadStore: Value provided in typeMap was neither a constructor, nor a an object with a deserialize function");else throw Error("dojo.data.ItemFileReadStore: in the typeMap constructor arg, no object class was specified for the datatype '"+p+"'");}if(m._reference){m=m._reference;if(n.isObject(m))for(p=0;p<this._arrayOfAllItems.length;++p){var r=this._arrayOfAllItems[p],x=!0,w;for(w in m)r[w]!=m[w]&&(x=!1);x&&(c[k]=r)}else c[k]=this._getItemByIdentity(m);
this.referenceIntegrity&&(m=c[k],this.isItem(m)&&this._addReferenceToMap(m,b,h))}else this.isItem(m)&&this.referenceIntegrity&&this._addReferenceToMap(m,b,h)}},_addReferenceToMap:function(c,a,d){},getIdentity:function(c){var a=this._features["dojo.data.api.Identity"];return a===Number?c[this._itemNumPropName]:(c=c[a])?c[0]:null},fetchItemByIdentity:function(c){var a,d;if(this._loadFinished)a=this._getItemByIdentity(c.identity),c.onItem&&(d=c.scope?c.scope:r.global,c.onItem.call(d,a));else{var e=this;
this._jsonFileUrl!==this._ccUrl?(r.deprecated(this.declaredClass+": ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0"),this.url=this._ccUrl=this._jsonFileUrl):this.url!==this._ccUrl&&(this._ccUrl=this._jsonFileUrl=this.url);null!=this.data&&null==this._jsonData&&(this._jsonData=this.data,this.data=null);this._jsonFileUrl?this._loadInProgress?this._queuedFetches.push({args:c}):(this._loadInProgress=!0,d=h.get({url:e._jsonFileUrl,
handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk}),d.addCallback(function(d){var f=c.scope?c.scope:r.global;try{e._getItemsFromLoadedData(d),e._loadFinished=!0,e._loadInProgress=!1,a=e._getItemByIdentity(c.identity),c.onItem&&c.onItem.call(f,a),e._handleQueuedFetches()}catch(b){e._loadInProgress=!1,c.onError&&c.onError.call(f,b)}}),d.addErrback(function(a){e._loadInProgress=!1;c.onError&&c.onError.call(c.scope?c.scope:r.global,a)})):this._jsonData&&(e._getItemsFromLoadedData(e._jsonData),
e._jsonData=null,e._loadFinished=!0,a=e._getItemByIdentity(c.identity),c.onItem&&(d=c.scope?c.scope:r.global,c.onItem.call(d,a)))}},_getItemByIdentity:function(c){var a=null;this._itemsByIdentity?Object.hasOwnProperty.call(this._itemsByIdentity,c)&&(a=this._itemsByIdentity[c]):Object.hasOwnProperty.call(this._arrayOfAllItems,c)&&(a=this._arrayOfAllItems[c]);void 0===a&&(a=null);return a},getIdentityAttributes:function(c){c=this._features["dojo.data.api.Identity"];return c===Number?null:[c]},_forceLoad:function(){var c=
this;this._jsonFileUrl!==this._ccUrl?(r.deprecated(this.declaredClass+": ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0"),this.url=this._ccUrl=this._jsonFileUrl):this.url!==this._ccUrl&&(this._ccUrl=this._jsonFileUrl=this.url);null!=this.data&&(this._jsonData=this.data,this.data=null);if(this._jsonFileUrl){var a=h.get({url:this._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk,
sync:!0});a.addCallback(function(a){try{if(!0!==c._loadInProgress&&!c._loadFinished)c._getItemsFromLoadedData(a),c._loadFinished=!0;else if(c._loadInProgress)throw Error(this.declaredClass+":  Unable to perform a synchronous load, an async load is in progress.");}catch(t){throw console.log(t),t;}});a.addErrback(function(a){throw a;})}else this._jsonData&&(c._getItemsFromLoadedData(c._jsonData),c._jsonData=null,c._loadFinished=!0)}});n.extend(p,d);return p})},"dojo/data/util/filter":function(){define(["../../_base/lang"],
function(r){var n={};r.setObject("dojo.data.util.filter",n);n.patternToRegExp=function(n,m){for(var h="^",e=null,k=0;k<n.length;k++)switch(e=n.charAt(k),e){case "\\":h+=e;k++;h+=n.charAt(k);break;case "*":h+=".*";break;case "?":h+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":h+="\\";default:h+=e}h+="$";return m?new RegExp(h,"mi"):new RegExp(h,"m")};return n})},"dojo/data/util/simpleFetch":function(){define(["../../_base/lang",
"../../_base/kernel","./sorter"],function(r,n,p){var m={};r.setObject("dojo.data.util.simpleFetch",m);m.errorHandler=function(h,e){e.onError&&e.onError.call(e.scope||n.global,h,e)};m.fetchHandler=function(h,e){var k=e.abort||null,d=!1,g=e.start?e.start:0,c=e.count&&Infinity!==e.count?g+e.count:h.length;e.abort=function(){d=!0;k&&k.call(e)};var a=e.scope||n.global;e.store||(e.store=this);e.onBegin&&e.onBegin.call(a,h.length,e);e.sort&&h.sort(p.createSortFunction(e.sort,this));if(e.onItem)for(var l=
g;l<h.length&&l<c;++l){var m=h[l];d||e.onItem.call(a,m,e)}e.onComplete&&!d&&(l=null,e.onItem||(l=h.slice(g,c)),e.onComplete.call(a,l,e))};m.fetch=function(h){h=h||{};h.store||(h.store=this);this._fetchItems(h,r.hitch(this,"fetchHandler"),r.hitch(this,"errorHandler"));return h};return m})},"dojo/data/util/sorter":function(){define(["../../_base/lang"],function(r){var n={};r.setObject("dojo.data.util.sorter",n);n.basicComparator=function(n,m){var h=-1;null===n&&(n=void 0);null===m&&(m=void 0);if(n==
m)h=0;else if(n>m||null==n)h=1;return h};n.createSortFunction=function(p,m){function h(a,c,d,b){return function(e,f){var g=b.getValue(e,a),k=b.getValue(f,a);return c*d(g,k)}}for(var e=[],k,d=m.comparatorMap,g=n.basicComparator,c=0;c<p.length;c++){k=p[c];var a=k.attribute;if(a){k=k.descending?-1:1;var l=g;d&&("string"!==typeof a&&"toString"in a&&(a=a.toString()),l=d[a]||g);e.push(h(a,k,l,m))}}return function(a,c){for(var d=0;d<e.length;){var b=e[d++](a,c);if(0!==b)return b}return 0}};return n})},"dojox/date/islamic":function(){define(["dojox/main",
"dojo/_base/lang","dojo/date","./islamic/Date"],function(r,n,p,m){var h=n.getObject("date.islamic",!0,r);h.getDaysInMonth=function(e){return e.getDaysInIslamicMonth(e.getMonth(),e.getFullYear())};h.compare=function(e,k,d){e instanceof m&&(e=e.toGregorian());k instanceof m&&(k=k.toGregorian());return p.compare.apply(null,arguments)};h.add=function(e,k,d){var g=new m(e);switch(k){case "day":g.setDate(e.getDate()+d);break;case "weekday":var c=e.getDay();if(5>c+d&&0<c+d)g.setDate(e.getDate()+d);else{var a=
k=0;5==c?(c=4,a=0<d?-1:1):6==c&&(c=4,a=0<d?-2:2);var c=0<d?5-c-1:-c,h=d-c,n=parseInt(h/5);0!=h%5&&(k=0<d?2:-2);k=k+7*n+h%5+c;g.setDate(e.getDate()+k+a)}break;case "year":g.setFullYear(e.getFullYear()+d);break;case "week":d*=7;g.setDate(e.getDate()+d);break;case "month":e=e.getMonth();g.setMonth(e+d);break;case "hour":g.setHours(e.getHours()+d);break;case "minute":g._addMinutes(d);break;case "second":g._addSeconds(d);break;case "millisecond":g._addMilliseconds(d)}return g};h.difference=function(e,
k,d){k=k||new m;d=d||"day";var g=k.getFullYear()-e.getFullYear(),c=1;switch(d){case "weekday":g=Math.round(h.difference(e,k,"day"));c=parseInt(h.difference(e,k,"week"));if(0==g%7)g=5*c;else{d=0;var a=e.getDay(),l=k.getDay(),c=parseInt(g/7);k=g%7;e=new m(e);e.setDate(e.getDate()+7*c);e=e.getDay();if(0<g)switch(!0){case 5==a:d=-1;break;case 6==a:d=0;break;case 5==l:d=-1;break;case 6==l:d=-2;break;case 5<e+k:d=-2}else if(0>g)switch(!0){case 5==a:d=0;break;case 6==a:d=1;break;case 5==l:d=2;break;case 6==
l:d=1;break;case 0>e+k:d=2}g=g+d-2*c}c=g;break;case "year":c=g;break;case "month":d=k.toGregorian()>e.toGregorian()?k:e;a=k.toGregorian()>e.toGregorian()?e:k;c=d.getMonth();l=a.getMonth();if(0==g)c=d.getMonth()-a.getMonth();else for(c=12-l+c,g=a.getFullYear()+1,d=d.getFullYear(),g;g<d;g++)c+=12;k.toGregorian()<e.toGregorian()&&(c=-c);break;case "week":c=parseInt(h.difference(e,k,"day")/7);break;case "day":c/=24;case "hour":c/=60;case "minute":c/=60;case "second":c/=1E3;case "millisecond":c*=k.toGregorian().getTime()-
e.toGregorian().getTime()}return Math.round(c)};return h})},"dojox/main":function(){define(["dojo/_base/kernel"],function(r){return r.dojox})},"dojox/date/islamic/Date":function(){define(["dojo/_base/lang","dojo/_base/declare","dojo/date"],function(r,n,p){var m=n("dojox.date.islamic.Date",null,{_date:0,_month:0,_year:0,_hours:0,_minutes:0,_seconds:0,_milliseconds:0,_day:0,_GREGORIAN_EPOCH:1721425.5,_ISLAMIC_EPOCH:1948439.5,constructor:function(){var h=arguments.length;h?1==h?(h=arguments[0],"number"==
typeof h&&(h=new Date(h)),h instanceof Date?this.fromGregorian(h):""==h?this._date=new Date(""):(this._year=h._year,this._month=h._month,this._date=h._date,this._hours=h._hours,this._minutes=h._minutes,this._seconds=h._seconds,this._milliseconds=h._milliseconds)):3<=h&&(this._year+=arguments[0],this._month+=arguments[1],this._date+=arguments[2],this._hours+=arguments[3]||0,this._minutes+=arguments[4]||0,this._seconds+=arguments[5]||0,this._milliseconds+=arguments[6]||0):this.fromGregorian(new Date)},
getDate:function(){return this._date},getMonth:function(){return this._month},getFullYear:function(){return this._year},getDay:function(){return this.toGregorian().getDay()},getHours:function(){return this._hours},getMinutes:function(){return this._minutes},getSeconds:function(){return this._seconds},getMilliseconds:function(){return this._milliseconds},setDate:function(h){h=parseInt(h);if(!(0<h&&h<=this.getDaysInIslamicMonth(this._month,this._year))){var e;if(0<h)for(e=this.getDaysInIslamicMonth(this._month,
this._year);h>e;h-=e,e=this.getDaysInIslamicMonth(this._month,this._year))this._month++,12<=this._month&&(this._year++,this._month-=12);else for(e=this.getDaysInIslamicMonth(0<=this._month-1?this._month-1:11,0<=this._month-1?this._year:this._year-1);0>=h;e=this.getDaysInIslamicMonth(0<=this._month-1?this._month-1:11,0<=this._month-1?this._year:this._year-1))this._month--,0>this._month&&(this._year--,this._month+=12),h+=e}this._date=h;return this},setFullYear:function(h){this._year=+h},setMonth:function(h){this._year+=
Math.floor(h/12);this._month=0<h?Math.floor(h%12):Math.floor((h%12+12)%12)},setHours:function(){var h=arguments.length,e=0;1<=h&&(e=parseInt(arguments[0]));2<=h&&(this._minutes=parseInt(arguments[1]));3<=h&&(this._seconds=parseInt(arguments[2]));4==h&&(this._milliseconds=parseInt(arguments[3]));for(;24<=e;)this._date++,h=this.getDaysInIslamicMonth(this._month,this._year),this._date>h&&(this._month++,12<=this._month&&(this._year++,this._month-=12),this._date-=h),e-=24;this._hours=e},_addMinutes:function(h){h+=
this._minutes;this.setMinutes(h);this.setHours(this._hours+parseInt(h/60));return this},_addSeconds:function(h){h+=this._seconds;this.setSeconds(h);this._addMinutes(parseInt(h/60));return this},_addMilliseconds:function(h){h+=this._milliseconds;this.setMilliseconds(h);this._addSeconds(parseInt(h/1E3));return this},setMinutes:function(h){this._minutes=h%60;return this},setSeconds:function(h){this._seconds=h%60;return this},setMilliseconds:function(h){this._milliseconds=h%1E3;return this},toString:function(){if(isNaN(this._date))return"Invalidate Date";
var h=new Date;h.setHours(this._hours);h.setMinutes(this._minutes);h.setSeconds(this._seconds);h.setMilliseconds(this._milliseconds);return this._month+" "+this._date+" "+this._year+" "+h.toTimeString()},toGregorian:function(){var h=this._year,h=Math.floor(this._date+Math.ceil(29.5*this._month)+354*(h-1)+Math.floor((3+11*h)/30)+this._ISLAMIC_EPOCH-1-.5)+.5,e=h-this._GREGORIAN_EPOCH,k=Math.floor(e/146097),d=this._mod(e,146097),e=Math.floor(d/36524),g=this._mod(d,36524),d=Math.floor(g/1461),g=this._mod(g,
1461),g=Math.floor(g/365),k=400*k+100*e+4*d+g;4!=e&&4!=g&&k++;e=h-(this._GREGORIAN_EPOCH+365*(k-1)+Math.floor((k-1)/4)-Math.floor((k-1)/100)+Math.floor((k-1)/400));d=this._GREGORIAN_EPOCH-1+365*(k-1)+Math.floor((k-1)/4)-Math.floor((k-1)/100)+Math.floor((k-1)/400)+Math.floor(739/12+(p.isLeapYear(new Date(k,3,1))?-1:-2)+1);d=h<d?0:p.isLeapYear(new Date(k,3,1))?1:2;e=Math.floor((12*(e+d)+373)/367);d=this._GREGORIAN_EPOCH-1+365*(k-1)+Math.floor((k-1)/4)-Math.floor((k-1)/100)+Math.floor((k-1)/400)+Math.floor((367*
e-362)/12+(2>=e?0:p.isLeapYear(new Date(k,e-1,1))?-1:-2)+1);return new Date(k,e-1,h-d+1,this._hours,this._minutes,this._seconds,this._milliseconds)},fromGregorian:function(h){h=new Date(h);var e=h.getFullYear(),k=h.getMonth(),d=h.getDate(),e=this._GREGORIAN_EPOCH-1+365*(e-1)+Math.floor((e-1)/4)+-Math.floor((e-1)/100)+Math.floor((e-1)/400)+Math.floor((367*(k+1)-362)/12+(2>=k+1?0:p.isLeapYear(h)?-1:-2)+d),e=Math.floor(e)+.5,e=e-this._ISLAMIC_EPOCH,k=Math.floor((30*e+10646)/10631),d=Math.ceil((e-29-
this._yearStart(k))/29.5),d=Math.min(d,11);this._date=Math.ceil(e-this._monthStart(k,d))+1;this._month=d;this._year=k;this._hours=h.getHours();this._minutes=h.getMinutes();this._seconds=h.getSeconds();this._milliseconds=h.getMilliseconds();this._day=h.getDay();return this},valueOf:function(){return this.toGregorian().valueOf()},_yearStart:function(h){return 354*(h-1)+Math.floor((3+11*h)/30)},_monthStart:function(h,e){return Math.ceil(29.5*e)+354*(h-1)+Math.floor((3+11*h)/30)},_civilLeapYear:function(h){return 11>
(14+11*h)%30},getDaysInIslamicMonth:function(h,e){var k=0,k=29+(h+1)%2;11==h&&this._civilLeapYear(e)&&k++;return k},_mod:function(h,e){return h-e*Math.floor(h/e)}});m.getDaysInIslamicMonth=function(h){return(new m).getDaysInIslamicMonth(h.getMonth(),h.getFullYear())};return m})},"dojox/date/islamic/locale":function(){define("dojox/main dojo/_base/lang dojo/_base/array dojo/date dojo/i18n dojo/regexp dojo/string ./Date dojo/i18n!dojo/cldr/nls/islamic".split(" "),function(r,n,p,m,h,e,k,d,g){function c(a,
b,c,d,e){return e.replace(/([a-z])\1*/ig,function(c){var d,f,g=c.charAt(0);c=c.length;var h=["abbr","wide","narrow"];switch(g){case "G":d=b.eraAbbr[0];break;case "y":d=String(a.getFullYear());break;case "M":d=a.getMonth();3>c?(d+=1,f=!0):(g=["months-format",h[c-3]].join("-"),d=b[g][d]);break;case "d":d=a.getDate(!0);f=!0;break;case "E":d=a.getDay();3>c?(d+=1,f=!0):(g=["days-format",h[c-3]].join("-"),d=b[g][d]);break;case "a":d=12>a.getHours()?"am":"pm";d=b["dayPeriods-format-wide-"+d];break;case "h":case "H":case "K":case "k":f=
a.getHours();switch(g){case "h":d=f%12||12;break;case "H":d=f;break;case "K":d=f%12;break;case "k":d=f||24}f=!0;break;case "m":d=a.getMinutes();f=!0;break;case "s":d=a.getSeconds();f=!0;break;case "S":d=Math.round(a.getMilliseconds()*Math.pow(10,c-3));f=!0;break;case "z":if(d=m.getTimezoneName(a.toGregorian()))break;c=4;case "Z":d=a.toGregorian().getTimezoneOffset();d=[0>=d?"+":"-",k.pad(Math.floor(Math.abs(d)/60),2),k.pad(Math.abs(d)%60,2)];4==c&&(d.splice(0,0,"GMT"),d.splice(3,0,":"));d=d.join("");
break;default:throw Error("dojox.date.islamic.locale.formatPattern: invalid pattern char: "+e);}f&&(d=k.pad(d,c));return d})}function a(a,b,c,d){var e=function(a){return a};b=b||e;c=c||e;d=d||e;var f=a.match(/(''|[^'])+/g),g="'"==a.charAt(0);p.forEach(f,function(a,d){a?(f[d]=(g?c:b)(a),g=!g):f[d]=""});return d(f.join(""))}function l(a,b,c,d){d=e.escapeString(d);h.normalizeLocale(c.locale);return d.replace(/([a-z])\1*/ig,function(d){var e;e=d.charAt(0);var f=d.length,g="";c.strict?1<f&&(g="0{"+(f-
1)+"}"):g="0?";switch(e){case "y":e="\\d+";break;case "M":e=2<f?"\\S+ ?\\S+":g+"[1-9]|1[0-2]";break;case "d":e="[12]\\d|"+g+"[1-9]|3[01]";break;case "E":e="\\S+";break;case "h":e=g+"[1-9]|1[0-2]";break;case "k":e=g+"\\d|1[01]";break;case "H":e=g+"\\d|1\\d|2[0-3]";break;case "K":e=g+"[1-9]|1\\d|2[0-4]";break;case "m":case "s":e=g+"\\d|[0-5]\\d";break;case "S":e="\\d{"+f+"}";break;case "a":f=c.am||b["dayPeriods-format-wide-am"];g=c.pm||b["dayPeriods-format-wide-pm"];c.strict?e=f+"|"+g:(e=f+"|"+g,f!=
f.toLowerCase()&&(e+="|"+f.toLowerCase()),g!=g.toLowerCase()&&(e+="|"+g.toLowerCase()));break;default:e=".*"}a&&a.push(d);return"("+e+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}var t=n.getObject("date.islamic.locale",!0,r);t.format=function(d,b){b=b||{};var e=h.normalizeLocale(b.locale),f=b.formatLength||"short",g=t._getIslamicBundle(e),k=[],e=n.hitch(this,c,d,g,e,b.fullYear);if("year"==b.selector)return d.getFullYear();if("time"!=b.selector){var l=b.datePattern||g["dateFormat-"+f];l&&k.push(a(l,e))}"date"!=
b.selector&&(f=b.timePattern||g["timeFormat-"+f])&&k.push(a(f,e));return k.join(" ")};t.regexp=function(a){return t._parseInfo(a).regexp};t._parseInfo=function(c){c=c||{};var b=h.normalizeLocale(c.locale),b=t._getIslamicBundle(b),d=c.formatLength||"short",e=c.datePattern||b["dateFormat-"+d],d=c.timePattern||b["timeFormat-"+d],f=[];return{regexp:a("date"==c.selector?e:"time"==c.selector?d:"undefined"==typeof d?e:e+" "+d,n.hitch(this,l,f,b,c)),tokens:f,bundle:b}};t.parse=function(a,b){a=a.replace(/[\u200E\u200F\u202A\u202E]/g,
"");b||(b={});var c=t._parseInfo(b),e=c.tokens,f=c.bundle,c=c.regexp.replace(/[\u200E\u200F\u202A\u202E]/g,""),c=(new RegExp("^"+c+"$")).exec(a);h.normalizeLocale(b.locale);if(!c)return null;var g=[1389,0,1,0,0,0,0],k="",l=["abbr","wide","narrow"];p.every(c,function(a,c){if(!c)return!0;var d=e[c-1],h=d.length;switch(d.charAt(0)){case "y":g[0]=Number(a);break;case "M":if(2<h){if(d=f["months-format-"+l[h-3]].concat(),b.strict||(a=a.replace(".","").toLowerCase(),d=p.map(d,function(a){return a?a.replace(".",
"").toLowerCase():a})),a=p.indexOf(d,a),-1==a)return!1}else a--;g[1]=Number(a);break;case "D":g[1]=0;case "d":g[2]=Number(a);break;case "a":d=b.am||f["dayPeriods-format-wide-am"];h=b.pm||f["dayPeriods-format-wide-pm"];if(!b.strict){var m=/\./g;a=a.replace(m,"").toLowerCase();d=d.replace(m,"").toLowerCase();h=h.replace(m,"").toLowerCase()}if(b.strict&&a!=d&&a!=h)return!1;k=a==h?"p":a==d?"a":"";break;case "K":24==a&&(a=0);case "h":case "H":case "k":g[3]=Number(a);break;case "m":g[4]=Number(a);break;
case "s":g[5]=Number(a);break;case "S":g[6]=Number(a)}return!0});c=+g[3];"p"===k&&12>c?g[3]=c+12:"a"===k&&12==c&&(g[3]=0);return new d(g[0],g[1],g[2],g[3],g[4],g[5],g[6])};var v=[];t.addCustomFormats=function(a,b){v.push({pkg:a,name:b})};t._getIslamicBundle=function(a){var b={};p.forEach(v,function(c){c=h.getLocalization(c.pkg,c.name,a);b=n.mixin(b,c)},this);return b};t.addCustomFormats("dojo.cldr","islamic");t.getNames=function(a,b,c,d,e){var f;d=t._getIslamicBundle(d);a=[a,c,b];"standAlone"==c&&
(c=a.join("-"),f=d[c],1==f[0]&&(f=void 0));a[1]="format";return(f||d[a.join("-")]).concat()};t.weekDays=t.getNames("days","wide","format");t.months=t.getNames("months","wide","format");return t})},"esri/dijit/editing/Editor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/kernel dojo/has dojo/query dojo/DeferredList dojo/dom-class dojo/dom-construct dojo/string dijit/_Widget dijit/_Templated ../../domUtils ../../graphicsUtils ../../geometry/Polyline ../../geometry/Polygon ../../graphic ../../undoManager ../../tasks/query ../../layers/FeatureLayer ../../layers/FeatureTemplate ../../toolbars/draw ../../toolbars/edit ../AttributeInspector ./Util ./Add ./Update ./Delete ./Cut ./Union ./toolbars/Drawing ./SelectionHelper ./TemplatePicker ../../kernel ../../config dojo/i18n!../../nls/jsapi dojo/text!./templates/Editor.html dijit/ProgressBar dojo/NodeList-dom".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A,y,B,x,w,z,E,C,D,F,G,I,N,M,P,U,V,W,R,K){var J=r([l,t],{declaredClass:"esri.dijit.editing.Editor",widgetsInTemplate:!0,templateString:K,onLoad:function(){},constructor:function(a,b){a=a||{};a.settings||console.error("Editor: please provide 'settings' parameter in the constructor");a.settings.layerInfos||console.error("Editor: please provide 'layerInfos' parameter in the constructor");this._settings=a.settings;this._eConnects=[]},startup:function(){this.inherited(arguments);
this._setDefaultOptions();this._settings.map.setInfoWindowOnClick(!1);var a=this._settings.layerInfos;this.featureReductionEnabledLayers=[];p.forEach(a,function(a){a=a.featureLayer;a.isFeatureReductionEnabled()&&(a.disableFeatureReduction(),this.featureReductionEnabledLayers.push(a))},this);if(p.every(a,function(a){return a.featureLayer.loaded}))this._initLayers(),this._connectEvents(),this._createWidgets(),this.onLoad(),this.loaded=!0;else{var b=a.length;p.forEach(a,function(a){a=a.featureLayer;
if(a.loaded)b--;else var c=m.connect(a,"onLoad",this,function(a){m.disconnect(c);c=null;b--;b||(this._initLayers(),this._connectEvents(),this._createWidgets(),this.onLoad(),this.loaded=!0)})},this)}this._reset();this._enableMapClickHandler()},stopEditing:function(a){this._updateCurrentFeature(n.hitch(this,function(){this._clearSelection(!1);a&&a()}))},destroy:function(){this._settings.map.setInfoWindowOnClick(!0);this.drawingToolbar&&this.drawingToolbar.destroy();this.attributeInspector&&this.attributeInspector.destroy();
this.templatePicker&&this.templatePicker.destroy();this._selectionHelper&&this._selectionHelper.destroy();this._drawToolbar&&this._drawToolbar.deactivate();this._reset();this._disableMapClickHandler();p.forEach(this._eConnects,m.disconnect);m.disconnect(this._dtConnect);m.disconnect(this._templatePickerOnSelectionChangeEvent);this._layer=this._currentGraphic=this._activeType=this._activeTemplate=this._drawingTool=this._drawToolbar=this.editToolbar=this.drawingToolbar=this.attributeInspector=this.templatePicker=
this.undoManager=null;this._settings.map.infoWindow&&this._settings.map.infoWindow.clearFeatures&&this._settings.map.infoWindow.clearFeatures();p.forEach(this.featureReductionEnabledLayers,function(a){a.enableFeatureReduction()});this.inherited(arguments)},_setDefaultOptions:function(){this._drawToolbar=this._settings.drawToolbar||new w(this._settings.map);this._settings.drawToolbar=this._drawToolbar;this.editToolbar=this._settings.editToolbar||new z(this._settings.map,{textSymbolEditorHolder:this.domNode});
this._settings.editToolbar=this.editToolbar;this._settings.toolbarVisible=this._settings.toolbarVisible||!1;this._settings.toolbarOptions=n.mixin({reshapeVisible:!1,cutVisible:!1,mergeVisible:!1},this._settings.toolbarOptions);this._settings.createOptions=n.mixin({polylineDrawTools:[J.CREATE_TOOL_POLYLINE],polygonDrawTools:[J.CREATE_TOOL_POLYGON],editAttributesImmediately:!0},this._settings.createOptions);this._settings.singleSelectionTolerance=this._settings.singleSelectionTolerance||3;this._settings.maxUndoRedoOperations=
this._settings.maxUndoRedoOperations||10;this._settings.editor=this;this._usePopup=this._settings.usePopup=this._settings.map.infoWindow._setPagerCallbacks?!0:!1;this._datePackage=this._settings.datePackage;var a=W.defaults;this._settings.geometryService=this._settings.geometryService||a.geometryService;a.geometryService=a.geometryService||this._settings.geometryService},_initLayers:function(){this._settings.layers=[];this._settings.userIds={};this._settings.createOnlyLayer={};p.forEach(this._settings.layerInfos,
function(a){if(a.featureLayer&&a.featureLayer.loaded){this._settings.layers.push(a.featureLayer);var b=a.featureLayer.id;a.featureLayer.credential&&(this._settings.userIds[b]=a.featureLayer.credential.userId);a.userId&&(this._settings.userIds[b]=a.userId);var c=a.featureLayer.getEditCapabilities();this._settings.createOnlyLayer[b]=c.canCreate&&!c.canUpdate?!0:!1;this._isTextSymbolPointLayer(a.featureLayer)&&(a.disableAttributeUpdate=!0)}},this)},_reset:function(){this._hideAttributeInspector();this.editToolbar.deactivate();
this._editVertices=!0;this._drawingTool=this._activeTemplate=this._activeType=this._currentGraphic=this._layer=null;this._attributeChanged=!1},_saveFeatureOnClient:function(a){var b=this.templatePicker.getSelected(),c;c=b.template?b.featureLayer.renderer.getSymbol(b.template.prototype):b.symbolInfo.symbol;this._tempGraphic=new u(a,c,null,null);this._tempGraphic.setAttributes(n.mixin({},b.template.prototype.attributes));c=this._settings.map;c.graphics.add(this._tempGraphic);a=this._findCenterPoint(a);
this._createAttributeInspector(!0);c.infoWindow.setTitle(b.featureLayer?b.featureLayer.name:R.widgets.attributeInspector.NLS_title);this.attributeInspector.showFeature(this._tempGraphic,b.featureLayer);this._showInfoWindow(a,c.getInfoWindowAnchor(a));this._settings.createOnlyLayer[b.featureLayer.id]&&(this._infoWindowHideEvent=m.connect(c.infoWindow,"onHide",this,"_infoWindowHide"));m.disconnect(this._templatePickerOnSelectionChangeEvent);this.templatePicker.clearSelection();this._drawToolbar.deactivate();
this._enableMapClickHandler();this.drawingToolbar&&this.drawingToolbar.deactivate();this._templatePickerOnSelectionChangeEvent=m.connect(this.templatePicker,"onSelectionChange",n.hitch(this,"_onCreateFeature"))},_saveAttributesOnClient:function(a,b,c){this._tempGraphic.attributes[b]="number"===typeof c&&isNaN(c)?null:c},_infoWindowHide:function(){this._createFeature(this._tempGraphic.geometry,this._tempGraphic.attributes);m.disconnect(this._infoWindowHideEvent)},_createFeature:function(a,b){this._editClickPoint=
this._findCenterPoint(a);a.rings?this._simplify(a,n.hitch(this,function(a){this._drawingTool!==x.TOOL_AUTO_COMPLETE_POLYGON?this._applyEdits([{layer:this._layer,adds:[this._createGraphic(a,b)]}],n.hitch(this,function(){this._chainAttachment(this._oEdits[0].adds[0].attributes[this._oEdits[0].layer.objectIdField],this._oEdits[0].layer)})):this._autoComplete(a,n.hitch(this,function(a){a&&a.length&&this._applyEdits([{layer:this._layer,adds:p.map(a,n.hitch(this,function(a){return this._createGraphic(a,
b)}))}],function(){this._chainAttachment(this._oEdits[0].adds[0].attributes[this._oEdits[0].layer.objectIdField],this._oEdits[0].layer)})}))})):this._applyEdits([{layer:this._layer,adds:[this._createGraphic(a,b)]}],n.hitch(this,function(){this._chainAttachment(this._oEdits[0].adds[0].attributes[this._oEdits[0].layer.objectIdField],this._oEdits[0].layer);this._layer&&this._layer.renderer&&"heatmap"===this._layer.renderer.type&&this._layer.refresh()}))},_chainAttachment:function(a,b){this.attributeInspector&&
this.attributeInspector._attachmentEditor&&this.attributeInspector._attachmentEditor._tempUpload&&this.attributeInspector._attachmentEditor._chainAttachment(a,b)},_updateCurrentFeature:function(a){var b=this._isModified();b?this._updateFeature(b,a):a&&a(!1)},_updateFeature:function(a,b,c){var d=a.geometry,e=a.getLayer();e.hasZ&&!e.enableZDefaults||e.hasM&&!e.allowUpdateWithoutMValues||c&&!this._isModified()?(c=new u,c.setAttributes(a.attributes),this._applyEdits([{layer:a.getLayer(),updates:[c]}],
b)):d.rings?this._simplify(d,n.hitch(this,function(c){this._applyEdits([{layer:a.getLayer(),updates:[n.mixin(a,{geometry:c})]}],b)})):this._applyEdits([{layer:a.getLayer(),updates:[a]}],b)},_deleteFeature:function(a,b){var c=[];a?c.push({layer:a.getLayer(),deletes:[a]}):(c=p.map(p.filter(this._settings.layers,function(a){return 0<a.getSelectedFeatures().length}),function(a){return{layer:a,deletes:a.getSelectedFeatures()}}))&&c.length||!this._currentGraphic||c.push({layer:this._layer,deletes:[this._currentGraphic]});
this._applyEdits(c,b)},_stopEditing:function(a,b,c,d){v.hide(this.progressBar.domNode);this._settings.createOnlyLayer[a.id]||this._undoRedoAdd();var e;!0===a._isSelOnly||1===a.mode||6===a.mode?b&&b.length&&(this.templatePicker.clearSelection(),e=new y,e.objectIds=[b[0].objectId],this._settings.createOnlyLayer[a.id]?this._settings.map.graphics.remove(this._tempGraphic):this._selectFeatures([a],e,n.hitch(this,"_onEditFeature"))):((e=this._selectionHelper.findMapService(this._settings.map,a))&&e.refresh(),
b&&b.length&&(this.templatePicker.clearSelection(),this._settings.createOnlyLayer[a.id]?this._settings.map.graphics.remove(this._tempGraphic):C.findFeatures(b,a,n.hitch(this,"_onEditFeature"))));d&&d.length&&(this._clearSelection(!0),this._undoRedo&&(e=this._selectionHelper.findMapService(a,this._settings.map))&&e.refresh());this._undoRedo&&c&&c.length&&((e=this._selectionHelper.findMapService(a,this._settings.map))&&e.refresh(),this.attributeInspector.refresh(),this._undoRedo=!1);this.drawingToolbar&&
this.drawingToolbar._updateUI();this._undoRedo=!1},_undoRedoAdd:function(){this._settings._isApplyEditsCall=!1;if(this._settings.undoManager){var a=this._edits&&this._edits.length?this._edits[0]:null;if(a){var b=a.adds||[],c=a.updates||[],d=a.deletes||[],e=a.preUpdates||[],a={featureLayer:a.layer};"CUT"===this._activeTool?b.length&&c.length&&e.length&&this.undoManager.add(new I(n.mixin(a,{preUpdatedGraphics:e,addedGraphics:b,postUpdatedGraphics:c}))):"UNION"===this._activeTool?d.length&&c.length&&
e.length&&this.undoManager.add(new N(n.mixin(a,{preUpdatedGraphics:e,deletedGraphics:d,postUpdatedGraphics:c}))):b.length?this.undoManager.add(new D(n.mixin(a,{addedGraphics:b}))):d.length?this.undoManager.add(new G(n.mixin(a,{deletedGraphics:d}))):c.length&&(this._rollbackGraphic||e.length)&&this.undoManager.add(new F(n.mixin(a,{preUpdatedGraphics:e.length?e:[this._rollbackGraphic],postUpdatedGraphics:c})));this._rollbackGraphic=this._edits=null}}},_activateDrawToolbar:function(a){this._layer=a.featureLayer;
this._activeType=a.type;this._drawingTool=(this._activeTemplate=a.template)?this._activeTemplate.drawingTool:null;this._drawTool=this._toDrawTool(this._drawingTool,a.featureLayer);m.disconnect(this._dtConnect);this._dtConnect=this._settings.createOnlyLayer[a.featureLayer.id]?m.connect(this._drawToolbar,"onDrawEnd",this,"_saveFeatureOnClient"):m.connect(this._drawToolbar,"onDrawEnd",this,"_createFeature");this.editToolbar.deactivate();this._disableMapClickHandler();this.drawingToolbar?this.drawingToolbar.activateEditing(this._drawTool,
this._layer):this._drawToolbar.activate(this._drawTool)},_activateEditToolbar:function(a,b){var c=a.getLayer(),d=c?c.geometryType:null,e=this._isTextSymbolPoint(a),f=z.MOVE;"esriGeometryPoint"!==d&&!0===this._isNotesFeature(a)?(f=f|z.ROTATE|z.SCALE,this._editVertices=!1):"esriGeometryPoint"!==d&&!0===this._editVertices?(f=f|z.ROTATE|z.SCALE,this._editVertices=!1):e?(f=f|z.ROTATE|z.SCALE|z.EDIT_TEXT,this._editVertices=!1):(f|=z.EDIT_VERTICES,this._editVertices=!0);this._attributeChanged=this._isModified();
this._rollbackGraphic=new u(a.toJson());var d=c.getEditCapabilities({feature:a,userId:this._settings.userIds[c.id]}),g=p.filter(this._settings.layerInfos,function(a){return a.featureLayer.layerId===c.layerId})[0];d.canUpdate&&!g.disableGeometryUpdate&&d.canUpdateGeometry&&(this.editToolbar.activate(f,a),e&&(this.editToolbar._textEditor._addTextBox(a),this.editToolbar._textSymbolEditor&&this.editToolbar._textSymbolEditor.hide()));this._settings.map.infoWindow.isShowing||this._updateAttributeDisabled(a)||
(e=b&&b.screenPoint||this._findCenterPoint(a),this._showInfoWindow(e,this._settings.map.getInfoWindowAnchor(e)))},_createGraphic:function(a,b){var c=new u(a,this._activeType&&this._activeType.symbol||this._layer.defaultSymbol,b);this._activeTemplate||b?c.attributes=b||n.mixin({},this._activeTemplate.prototype.attributes):(c.attributes=c.attributes||[],p.forEach(this._layer.fields,function(a){c.attributes[a.name]=null},this));return c},_connectEvents:function(){var a=this._settings.layers;p.forEach(a,
function(a){this._connect(a,"onEditsComplete",n.hitch(this,"_stopEditing",a))},this);p.forEach(a,function(a){this._connect(a,"onBeforeApplyEdits",n.hitch(this,function(){v.show(this.progressBar.domNode);this._settings._isApplyEditsCall=!0}))},this);this._connect(this.editToolbar,"onGraphicClick",n.hitch(this,"_activateEditToolbar"));this._connect(this.editToolbar,"onGraphicFirstMove",n.hitch(this,"_hideAttributeInspector"));this._connect(this.editToolbar,"onVertexFirstMove",n.hitch(this,"_hideAttributeInspector"));
this._connect(this.editToolbar,"onScaleStart",n.hitch(this,"_hideAttributeInspector"));this._connect(this.editToolbar,"onRotateStart",n.hitch(this,"_hideAttributeInspector"))},_connect:function(a,b,c){this._eConnects.push(m.connect(a,b,c))},_createWidgets:function(){this._selectionHelper=new P(this._settings);this._createTemplatePicker();this._createAttributeInspector();this._createDrawingToolbar();this._createUndoRedoManager()},_createTemplatePicker:function(){if(this._settings.templatePicker)this.templatePicker=
this._settings.templatePicker,v.hide(this.templatePickerDiv);else{var a=p.filter(this._settings.layers,function(a){return a.getEditCapabilities().canCreate});this.templatePicker=new U({"class":"esriTemplatePicker",featureLayers:a,showTooltip:!0,maxLabelLength:this._settings.typesCharacterLimit,columns:"auto",rows:"auto"},this.templatePickerDiv);this.templatePicker.startup();this._settings.templatePicker=this.templatePicker}this._templatePickerOnSelectionChangeEvent=m.connect(this.templatePicker,"onSelectionChange",
n.hitch(this,"_onCreateFeature"))},_createAttributeInspector:function(a){if(this._settings.attributeInspector)this._customAttributeInspector=!0,this.attributeInspector=this._settings.attributeInspector;else{this._customAttributeInspector=!1;var b=this._settings.map;this.attributeInspector=new E({layerInfos:this._settings.layerInfos,hideNavButtons:this._usePopup,datePackage:this._datePackage},c.create("div"));this.attributeInspector.startup();b.infoWindow.setContent(this.attributeInspector.domNode);
b.infoWindow.setTitle(R.widgets.attributeInspector.NLS_title);b.infoWindow.resize(350,375);h.query(".esriAttributeInspector .atiLayerName").style({display:"none"})}this._connect(this.attributeInspector,"onDelete",n.hitch(this,"_deleteFeature"));this._connect(this.attributeInspector,"onNext",n.hitch(this,function(a){this._updateCurrentFeature(n.hitch(this,function(){this._attributeChanged=!1;this._onEditFeature(a)}))}));this._usePopup&&this._settings.map.infoWindow._setPagerCallbacks(this.attributeInspector,
n.hitch(this.attributeInspector,"previous"),n.hitch(this.attributeInspector,"next"));a?this._connect(this.attributeInspector,"onAttributeChange",n.hitch(this,"_saveAttributesOnClient")):this._connect(this.attributeInspector,"onAttributeChange",n.hitch(this,function(a,b,c){var d=a.getLayer();(d=p.filter(d.fields,function(a){return a.name===b})[0])&&""===c&&(c=null);this._rollbackGraphic=new u(n.clone(a.toJson()));this.attributeInspector._rollbackInfo={field:d,graphic:this._rollbackGraphic};this._currentGraphic.attributes[b]=
"number"===typeof c&&isNaN(c)?null:c;this._currentGraphic.setAttributes(this._currentGraphic.attributes);this._updateFeature(this._currentGraphic,null,!0);this._attributeChanged=!1}))},_createDrawingToolbar:function(){!0===this._settings.toolbarVisible&&(this.drawingToolbar=new M({"class":"esriDrawingToolbar",drawToolbar:this._drawToolbar,editToolbar:this.editToolbar,settings:this._settings,onDelete:n.hitch(this,"_deleteFeature"),onApplyEdits:n.hitch(this,"_applyEdits"),onShowAttributeInspector:n.hitch(this,
"_onEditFeature")},this.drawingToolbarDiv))},_createUndoRedoManager:function(){if(this._settings.enableUndoRedo||this._settings.undoManager)this._settings.enableUndoRedo=!0,this.undoManager=this._settings.undoManager,this.undoManager||(this.undoManager=this._settings.undoManager=new A({maxOperations:this._settings.maxUndoRedoOperations})),this._connect(this.undoManager,"onUndoComplete",n.hitch(this,this._updateUndoRedoOperations)),this._connect(this.undoManager,"onRedoComplete",n.hitch(this,this._updateUndoRedoOperations)),
this._connect(document,"onkeypress",n.hitch(this,function(a){if(a.metaKey||a.ctrlKey)"z"===a.charOrCode&&this._undo(),"y"===a.charOrCode&&this._redo()}))},_updateUndoRedoOperations:function(a){if(a&&a.addedIds){var b;for(b=0;b<this.undoManager.length;b++){var c=this.undoManager.get(b);c&&a.layer===c._featureLayer&&c.updateObjectIds(a.oldIds,a.addedIds)}}a&&"Update Features"===a.operation.label&&this.attributeInspector.refresh()},_enableMapClickHandler:function(){this._mapClickHandler=m.connect(this._settings.map,
"onClick",n.hitch(this,function(a){this._drawToolbar._geometryType||("SELECT"===this._activeTool?this._activeTool="":this._updateCurrentFeature(n.hitch(this,function(){this._reset();this._updateSelection(a)})))}))},_disableMapClickHandler:function(){m.disconnect(this._mapClickHandler)},_onCreateFeature:function(){var a=this.templatePicker.getSelected();a?this._updateCurrentFeature(n.hitch(this,function(){this._currentGraphic&&this._clearSelection(!1);this._reset();this._activateDrawToolbar(a)})):
(this._reset(),m.disconnect(this._dtConnect),this._drawToolbar.deactivate(),this._enableMapClickHandler(),this.drawingToolbar&&this.drawingToolbar.deactivate())},_isTextSymbolPoint:function(a){if("point"===a.geometry.type||"multipoint"===a.geometry.type){var b=a.getLayer(),c=b.renderer;a=a.symbol||b._getSymbol(a);!a&&(c.hasVisualVariables("sizeInfo",!1)||c.hasVisualVariables("colorInfo",!1)||c.hasVisualVariables("opacityInfo",!1))&&c.addBreak&&c.infos&&1===c.infos.length&&(a=c.infos[0].symbol||c.defaultSymbol);
if(a&&"textsymbol"===a.type)return!0}return!1},_isTextSymbolPointLayer:function(a){return"esriGeometryPoint"===a.geometryType&&a.renderer&&a.renderer._symbols&&a.renderer._symbols[0]&&a.renderer._symbols[0].symbol&&"textsymbol"===a.renderer._symbols[0].symbol.type?!0:!1},_updateAttributeDisabled:function(a){a=a.getLayer();if(!a)return!1;var b,c,d=!1;for(b=0;b<this._settings.layerInfos.length;b++)if(c=this._settings.layerInfos[b],c.featureLayer==a){d=c.disableAttributeUpdate;break}return d},_onEditFeature:function(b,
c){if(b=(n.isArray(b)?b[0]:b)||null){var d;this._layer=b.getLayer();if(!this._customAttributeInspector&&!this._updateAttributeDisabled(b)){c=c||this._editClickPoint||this._findCenterPoint(b);1<this._currentFeatureCount?(d=this._popupFeatures.indexOf(b),d=a.substitute(R.widgets.popup.NLS_pagingInfo,{index:d+1,total:this._currentFeatureCount})):d=this._layer?this._layer.name:R.widgets.attributeInspector.NLS_title;this._settings.map.infoWindow.setTitle(d);if(this.drawingToolbar||!this._settings.map.infoWindow.isShowing)this.attributeInspector.refresh(),
this._showInfoWindow(c,this._settings.map.getInfoWindowAnchor(c));this._editClickPoint=null}b!==this._currentGraphic&&(this._editVertices=!0,this._currentGraphic=b,b.getDojoShape()&&b.getDojoShape().moveToFront(),d=this._layer.hasM,this._layer.hasZ&&!this._layer.enableZDefaults||d&&!this._layer.allowUpdateWithoutMValues||this._activateEditToolbar(b))}},_applyEdits:function(a,b){a=a||[];if(!(0>=a.length)){this._edits=this._oEdits=a;var c=[];p.forEach(a,function(a){a.layer&&c.push(a.layer.applyEdits(a.adds,
a.updates,a.deletes))});0<c.length&&(this._deferredsList=(new d(c)).addCallback(n.hitch(this,function(){v.hide(this.progressBar.domNode);b&&b();var a=this._settings.map;a&&a.infoWindow.reposition&&a.infoWindow.isShowing&&a.infoWindow.reposition()})))}},_undo:function(){this._settings.undoManager&&!this._settings._isApplyEditsCall&&(this.editToolbar.deactivate(),this._undoRedo=!0,this._settings.undoManager.undo())},_redo:function(){this._settings.undoManager&&!this._settings._isApplyEditsCall&&(this.editToolbar.deactivate(),
this._undoRedo=!0,this._settings.undoManager.redo())},_simplify:function(a,b){q.prototype.isSelfIntersecting(a)?this._settings.geometryService.simplify([a],function(a){var c=a&&a.length?a[0]:c;b&&b(c)}):b&&b(a)},_autoComplete:function(a,b){var c=this._getLayers("esriGeometryPolygon"),d=new y;d.geometry=a;d.returnGeometry=!0;this._selectFeatures(c,d,n.hitch(this,function(c){!c||0>=c.length?b&&b([a]):this._settings.geometryService.autoComplete(f.getGeometries(c),this._toPolylines([d.geometry]),function(a){b&&
b(a)})}))},_getLayers:function(a){return p.filter(this._settings.layers,function(b){return b.geometryType===a})},_selectFeatures:function(a,b,c,d){this._selectionHelper.selectFeatures(a,b,d||B.SELECTION_NEW,c)},_updateSelection:function(a){var b=a.mapPoint,c=a.graphic,d=this._settings.layerInfos,e;this._selectionHelper.selectFeaturesByGeometry(this._settings.layers,b,B.SELECTION_NEW,n.hitch(this,function(a){var f=p.some(a,n.hitch(this,function(a){return a==c}));if(c&&!f)if(f=c.getLayer(),this._isValidLayer(f)){var g=
new y;g.objectIds=[c.attributes[f.objectIdField]];this._selectionHelper.selectFeatures([f],g,B.SELECTION_ADD,n.hitch(this,function(c){c&&c.length&&(c=c.concat(a),e=C.sortFeaturesById(d,c),this._updatePopupButtons(e),this._onEditFeature(e,b))}))}else a&&a.length?(e=C.sortFeaturesById(d,a),this._updatePopupButtons(e),this._onEditFeature(e,b)):this._clearSelection();else a&&a.length?(e=C.sortFeaturesById(d,a),this._updatePopupButtons(e),this._onEditFeature(e,b)):this._clearSelection()}));c&&this._isTextSymbolPoint(c)&&
this._isValidLayer(c.getLayer())&&this.editToolbar.activate(0|z.MOVE|z.ROTATE|z.SCALE|z.EDIT_TEXT,c)},_updatePopupButtons:function(a){if(this._usePopup&&a){var b=a.length;p.forEach([this._settings.map.infoWindow._prevFeatureButton,this._settings.map.infoWindow._nextFeatureButton],n.hitch(this,function(a){1<b?g.remove(a,"hidden"):g.add(a,"hidden")}));var c=1<b?"block":"none";h.query(".esriAttributeInspector .atiLayerName").style({display:c});this._currentFeatureCount=b;this._popupFeatures=a}else this._currentFeatureCount=
this._popupFeatures=null},_clearSelection:function(a){this._currentFeatureCount=0;this._popupFeatures=null;this._selectionHelper.clearSelection(a||!1);this._reset()},_findCenterPoint:function(a){a=a.geometry||a;var b;switch(a.type){case "point":b=a;break;case "polyline":b=a.getPoint(0,Math.ceil(a.paths[0].length/2));break;case "polygon":b=a.rings.length-1,b=a.getPoint(b,a.rings[b].length-1)}return this._settings.map.toScreen(b)},_hideAttributeInspector:function(){!this._customAttributeInspector&&
this._settings.map.infoWindow&&this._settings.map.infoWindow.hide()},_toPolylines:function(a){return p.map(a,function(a){var c=new b(a.spatialReference);p.forEach(a.rings,function(a){c.addPath(a)});return c})},_isNotesFeature:function(a){var b=a.getLayer(),c=b?b.types||null:null;if(!c)return!1;var d=a.attributes[b.typeIdField],e;p.some(c,function(a){return a.id===d?(e=a.templates,!0):!1});return e?(a=e[0]||null)?this._isShapeTool(a.drawingTool)?!0:!1:!1:!1},_isValidLayer:function(a){var b,c=this._settings.layerInfos;
for(b=0;b<c.length;b++){var d=c[b];if(a.id==(d.featureLayer?d.featureLayer.id:d.layerId))return!0}return!1},_isShapeTool:function(a){switch(a){case x.TOOL_ARROW:return w.ARROW;case x.TOOL_LEFT_ARROW:return w.LEFT_ARROW;case x.TOOL_RIGHT_ARROW:return w.RIGHT_ARROW;case x.TOOL_UP_ARROW:return w.UP_ARROW;case x.TOOL_DOWN_ARROW:return w.DOWN_ARROW;case x.TOOL_CIRCLE:return w.CIRCLE;case x.TOOL_ELLIPSE:return w.ELLIPSE;case x.TOOL_TRIANGLE:return w.TRIANGLE;case x.TOOL_RECTANGLE:return w.RECTANGLE;default:return null}},
_toDrawTool:function(a,b){var c=b.geometryType;switch(a){case x.TOOL_POINT:return w.POINT;case x.TOOL_ARROW:return w.ARROW;case x.TOOL_LEFT_ARROW:return w.LEFT_ARROW;case x.TOOL_RIGHT_ARROW:return w.RIGHT_ARROW;case x.TOOL_UP_ARROW:return w.UP_ARROW;case x.TOOL_DOWN_ARROW:return w.DOWN_ARROW;case x.TOOL_CIRCLE:return w.CIRCLE;case x.TOOL_ELLIPSE:return w.ELLIPSE;case x.TOOL_TRIANGLE:return w.TRIANGLE;case x.TOOL_RECTANGLE:return w.RECTANGLE;case x.TOOL_LINE:return w.POLYLINE;case x.TOOL_POLYGON:return w.POLYGON;
case x.TOOL_FREEHAND:return"esriGeometryPolyline"===c?w.FREEHAND_POLYLINE:w.FREEHAND_POLYGON;default:var d=w.POINT;"esriGeometryPolyline"===c?(d=w.POLYLINE,this._settings.createOptions.polylineDrawTools[0]===J.CREATE_TOOL_FREEHAND_POLYLINE&&(d=w.FREEHAND_POLYLINE)):"esriGeometryPolygon"===c&&(d=w.POLYGON,this._settings.createOptions.polygonDrawTools[0]===J.CREATE_TOOL_FREEHAND_POLYGON&&(d=w.FREEHAND_POLYGON));return d}},_isModified:function(){var a=this.editToolbar.getCurrentState();return(a.isModified||
this._attributeChanged)&&a.graphic?a.graphic:null},_showInfoWindow:function(a,b){this._customAttributeInspector||this._settings.map.infoWindow.show(a,b)}});n.mixin(J,{CREATE_TOOL_POLYLINE:"polyline",CREATE_TOOL_FREEHAND_POLYLINE:"freehandpolyline",CREATE_TOOL_POLYGON:"polygon",CREATE_TOOL_FREEHAND_POLYGON:"freehandpolygon",CREATE_TOOL_AUTOCOMPLETE:"autocomplete",CREATE_TOOL_RECTANGLE:"rectangle",CREATE_TOOL_TRIANGLE:"triangle",CREATE_TOOL_CIRCLE:"circle",CREATE_TOOL_ELLIPSE:"ellipse",CREATE_TOOL_ARROW:"arrow",
CREATE_TOOL_UP_ARROW:"uparrow",CREATE_TOOL_DOWN_ARROW:"downarrow",CREATE_TOOL_RIGHT_ARROW:"rightarrow",CREATE_TOOL_LEFT_ARROW:"leftarrow"});e("extend-esri")&&n.setObject("dijit.editing.Editor",J,V);return J})},"dojo/DeferredList":function(){define(["./_base/kernel","./_base/Deferred","./_base/array"],function(r,n,p){r.DeferredList=function(m,h,e,k,d){var g=[];n.call(this);var c=this;0!==m.length||h||this.resolve([0,[]]);var a=0;p.forEach(m,function(d,n){function l(d,b){g[n]=[d,b];a++;a===m.length&&
c.resolve(g)}d.then(function(a){h?c.resolve([n,a]):l(!0,a)},function(a){e?c.reject(a):l(!1,a);if(k)return null;throw a;})})};r.DeferredList.prototype=new n;r.DeferredList.prototype.gatherResults=function(m){m=new r.DeferredList(m,!1,!0,!1);m.addCallback(function(h){var e=[];p.forEach(h,function(k){e.push(k[1])});return e});return m};return r.DeferredList})},"esri/undoManager":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dojo/when ./kernel ./Evented dojo/has!extend-esri?./OperationBase".split(" "),
function(r,n,p,m,h,e){r=r([e],{declaredClass:"esri.UndoManager",maxOperations:10,canUndo:!1,canRedo:!1,position:0,length:0,onUndo:function(){},onRedo:function(){},onUndoComplete:function(){},onRedoComplete:function(){},onAdd:function(){},onChange:function(){},constructor:function(e){e=e||{};e.maxOperations&&(this.maxOperations=e.maxOperations);this._historyStack=[]},add:function(e){if(0<this.maxOperations)for(;this._historyStack.length>=this.maxOperations;)this._historyStack.shift();this._historyStack.splice(this.position,
0,e);this.position++;this.clearRedo();this.onAdd();this._checkAvailability()},undo:function(){if(0===this.position)return null;var e=this.peekUndo();this.position--;e?(e=e.performUndo(),this.onUndo(),this._checkAvailability(),m(e).then(n.hitch(this,this.onUndoComplete))):(this.onUndo(),this._checkAvailability())},redo:function(){if(this.position===this._historyStack.length)return null;var e=this.peekRedo();this.position++;e?(e=e.performRedo(),this.onRedo(),this._checkAvailability(),m(e).then(n.hitch(this,
this.onRedoComplete))):(this.onRedo(),this._checkAvailability())},_checkAvailability:function(){this.length=this._historyStack.length;0===this.length?this.canUndo=this.canRedo=!1:0===this.position?(this.canRedo=!0,this.canUndo=!1):this.position===this.length?(this.canUndo=!0,this.canRedo=!1):this.canRedo=this.canUndo=!0;this.onChange()},clearUndo:function(){this._historyStack.splice(0,this.position);this.position=0;this._checkAvailability()},clearRedo:function(){this._historyStack.splice(this.position,
this._historyStack.length-this.position);this.position=this._historyStack.length;this._checkAvailability()},peekUndo:function(){if(0<this._historyStack.length&&0<this.position)return this.get(this.position-1)},peekRedo:function(){if(0<this._historyStack.length&&this.position<this._historyStack.length)return this.get(this.position)},get:function(e){return this._historyStack[e]},remove:function(e){0<this._historyStack.length&&(this._historyStack.splice(e,1),0<this.position&&e<this.position&&this.position--,
this._checkAvailability())},destroy:function(){this._historyStack=null}});p("extend-esri")&&(h.UndoManager=r);return r})},"esri/dijit/editing/Add":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ./EditOperationBase".split(" "),function(r,n,p,m,h,e){n=n(e,{declaredClass:"esri.dijit.editing.Add",type:"edit",label:"Add Features",constructor:function(e){e=e||{};e.featureLayer?(this._featureLayer=e.featureLayer,e.addedGraphics?this._addedGraphics=e.addedGraphics:
console.error("In constructor of 'esri.dijit.editing.Add', no graphics provided")):console.error("In constructor of 'esri.dijit.editing.Add', featureLayer is not provided")},updateObjectIds:function(e,d){this.updateIds(this._featureLayer,this._addedGraphics,e,d)},performUndo:function(){return this._featureLayer.applyEdits(null,null,this._addedGraphics).then(p.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))},performRedo:function(){var e=r.map(this._addedGraphics,function(d){return d.attributes[this._featureLayer.objectIdField]},
this);return this._featureLayer.applyEdits(this._addedGraphics,null,null).then(p.hitch(this,function(d,g,c){d=r.map(d,function(a){return a.objectId});return{oldIds:e,addedIds:d,layer:this._featureLayer,operation:this}}))}});m("extend-esri")&&p.setObject("dijit.editing.Add",n,h);return n})},"esri/dijit/editing/EditOperationBase":function(){define(["dojo/_base/array","dojo/_base/declare","dojo/has","../../kernel","../../OperationBase"],function(r,n,p,m,h){n=n(h,{declaredClass:"esri.EditOperationBase",
updateIds:function(e,h,d,g){r.forEach(h,function(c,a){var h=c[e.objectIdField];r.forEach(d,function(a,d){h===a&&(c[e.objectIdField]=g[d])})})}});p("extend-esri")&&(m.EditOperationBase=n);return n})},"esri/OperationBase":function(){define(["dojo/_base/declare","dojo/has","./kernel"],function(r,n,p){r=r(null,{declaredClass:"esri.OperationBase",type:"not implemented",label:"not implemented",constructor:function(m){m=m||{};m.label&&(this.label=m.label)},performUndo:function(){console.log("performUndo has not been implemented")},
performRedo:function(){console.log("performRedo has not been implemented")}});n("extend-esri")&&(p.OperationBase=r);return r})},"esri/dijit/editing/Update":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ../../geometry/jsonUtils ./EditOperationBase".split(" "),function(r,n,p,m,h,e,k){r=n(k,{declaredClass:"esri.dijit.editing.Update",type:"edit",label:"Update Features",constructor:function(d){var e;d=d||{};if(d.featureLayer)if(this._featureLayer=d.featureLayer,
d.preUpdatedGraphics){this._preUpdatedGraphicsGeometries=[];this._preUpdatedGraphicsAttributes=[];for(e=0;e<d.preUpdatedGraphics.length;e++)this._preUpdatedGraphicsGeometries.push(d.preUpdatedGraphics[e].geometry.toJson()),this._preUpdatedGraphicsAttributes.push(d.preUpdatedGraphics[e].attributes);if(d.postUpdatedGraphics)for(this._postUpdatedGraphics=d.postUpdatedGraphics,this._postUpdatedGraphicsGeometries=[],this._postUpdatedGraphicsAttributes=[],e=0;e<d.postUpdatedGraphics.length;e++)d.postUpdatedGraphics[e].geometry?
this._postUpdatedGraphicsGeometries.push(d.postUpdatedGraphics[e].geometry.toJson()):this._postUpdatedGraphicsGeometries.push(d.postUpdatedGraphics[e].geometry),this._postUpdatedGraphicsAttributes.push(p.clone(d.postUpdatedGraphics[e].attributes));else console.error("In constructor of 'esri.dijit.editing.Update', postUpdatedGraphics not provided")}else console.error("In constructor of 'esri.dijit.editing.Update', preUpdatedGraphics not provided");else console.error("In constructor of 'esri.dijit.editing.Update', featureLayer not provided")},
updateObjectIds:function(d,e){this.updateIds(this._featureLayer,this._preUpdatedGraphicsAttributes,d,e);this.updateIds(this._featureLayer,this._postUpdatedGraphicsAttributes,d,e)},performUndo:function(){var d;for(d=0;d<this._postUpdatedGraphics.length;d++)this._preUpdatedGraphicsGeometries[d]?this._postUpdatedGraphics[d].setGeometry(e.fromJson(this._preUpdatedGraphicsGeometries[d])):this._postUpdatedGraphics[d].setGeometry(this._preUpdatedGraphicsGeometries[d]),this._postUpdatedGraphics[d].setAttributes(this._preUpdatedGraphicsAttributes[d]);
return this._featureLayer.applyEdits(null,this._postUpdatedGraphics,null).then(p.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))},performRedo:function(){var d;for(d=0;d<this._postUpdatedGraphics.length;d++)this._postUpdatedGraphicsGeometries[d]?this._postUpdatedGraphics[d].setGeometry(e.fromJson(this._postUpdatedGraphicsGeometries[d])):this._postUpdatedGraphics[d].setGeometry(this._postUpdatedGraphicsGeometries[d]),this._postUpdatedGraphics[d].setAttributes(this._postUpdatedGraphicsAttributes[d]);
return this._featureLayer.applyEdits(null,this._postUpdatedGraphics,null).then(p.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))}});m("extend-esri")&&p.setObject("dijit.editing.Update",r,h);return r})},"esri/dijit/editing/Delete":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ./EditOperationBase".split(" "),function(r,n,p,m,h,e){n=n(e,{declaredClass:"esri.dijit.editing.Delete",type:"edit",label:"Delete Features",constructor:function(e){e=
e||{};e.featureLayer?(this._featureLayer=e.featureLayer,e.deletedGraphics?this._deletedGraphics=e.deletedGraphics:console.error("In constructor of 'esri.dijit.editing.Delete', no graphics provided")):console.error("In constructor of 'esri.dijit.editing.Delete', featureLayer is not provided")},updateObjectIds:function(e,d){this.updateIds(this._featureLayer,this._deletedGraphics,e,d)},performUndo:function(){var e=r.map(this._deletedGraphics,function(d){return d.attributes[this._featureLayer.objectIdField]},
this);return this._featureLayer.applyEdits(this._deletedGraphics,null,null).then(p.hitch(this,function(d,g,c){d=r.map(d,function(a){return a.objectId});return{oldIds:e,addedIds:d,layer:this._featureLayer,operation:this}}))},performRedo:function(){return this._featureLayer.applyEdits(null,null,this._deletedGraphics).then(p.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))}});m("extend-esri")&&p.setObject("dijit.editing.Delete",n,h);return n})},"esri/dijit/editing/Cut":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ../../geometry/jsonUtils ./EditOperationBase".split(" "),
function(r,n,p,m,h,e,k){n=n(k,{declaredClass:"esri.dijit.editing.Cut",type:"edit",label:"Cut Features",constructor:function(d){var e;d=d||{};if(d.featureLayer)if(this._featureLayer=d.featureLayer,d.addedGraphics)if(this._addedGraphics=d.addedGraphics,d.preUpdatedGraphics){this._preUpdatedGraphicsGeometries=[];this._preUpdatedGraphicsAttributes=[];for(e=0;e<d.preUpdatedGraphics.length;e++)this._preUpdatedGraphicsGeometries.push(d.preUpdatedGraphics[e].geometry.toJson()),this._preUpdatedGraphicsAttributes.push(d.preUpdatedGraphics[e].attributes);
if(d.postUpdatedGraphics)for(this._postUpdatedGraphics=d.postUpdatedGraphics,this._postUpdatedGraphicsGeometries=[],this._postUpdatedGraphicsAttributes=[],e=0;e<d.postUpdatedGraphics.length;e++)this._postUpdatedGraphicsGeometries.push(d.postUpdatedGraphics[e].geometry.toJson()),this._postUpdatedGraphicsAttributes.push(p.clone(d.postUpdatedGraphics[e].attributes));else console.error("In constructor of 'esri.dijit.editing.Cut', postUpdatedGraphics not provided")}else console.error("In constructor of 'esri.dijit.editing.Cut', preUpdatedGraphics not provided");
else console.error("In constructor of 'esri.dijit.editing.Cut', addedGraphics for cut not provided");else console.error("In constructor of 'esri.dijit.editing.Cut', featureLayer not provided")},updateObjectIds:function(d,e){this.updateIds(this._featureLayer,this._preUpdatedGraphicsAttributes,d,e);this.updateIds(this._featureLayer,this._postUpdatedGraphicsAttributes,d,e);this.updateIds(this._featureLayer,this._addedGraphics,d,e)},performUndo:function(){var d;for(d=0;d<this._postUpdatedGraphics.length;d++)this._postUpdatedGraphics[d].setGeometry(e.fromJson(this._preUpdatedGraphicsGeometries[d])),
this._postUpdatedGraphics[d].setAttributes(this._preUpdatedGraphicsAttributes[d]);return this._featureLayer.applyEdits(null,this._postUpdatedGraphics,this._addedGraphics).then(p.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))},performRedo:function(){var d;for(d=0;d<this._postUpdatedGraphics.length;d++)this._postUpdatedGraphics[d].setGeometry(e.fromJson(this._postUpdatedGraphicsGeometries[d])),this._postUpdatedGraphics[d].setAttributes(this._postUpdatedGraphicsAttributes[d]);
var g=r.map(this._addedGraphics,function(c){return c.attributes[this._featureLayer.objectIdField]},this);return this._featureLayer.applyEdits(this._addedGraphics,this._postUpdatedGraphics,null).then(p.hitch(this,function(c,a,d){c=r.map(c,function(a){return a.objectId});return{oldIds:g,addedIds:c,layer:this._featureLayer,operation:this}}))}});m("extend-esri")&&p.setObject("dijit.editing.Cut",n,h);return n})},"esri/dijit/editing/Union":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ../../geometry/jsonUtils ./EditOperationBase".split(" "),
function(r,n,p,m,h,e,k){n=n(k,{declaredClass:"esri.dijit.editing.Union",type:"edit",label:"Union Features",constructor:function(d){d=d||{};this._featureLayer=d.featureLayer;this._deletedGraphics=d.deletedGraphics;this._preUpdatedGraphics=d.preUpdatedGraphics;this._postUpdatedGraphics=d.postUpdatedGraphics;this._preUpdatedGraphicsGeometries=[];this._preUpdatedGraphicsAttributes=[];this._postUpdatedGraphicsGeometries=[];this._postUpdatedGraphicsAttributes=[];var e;for(e=0;e<d.preUpdatedGraphics.length;e++)this._preUpdatedGraphicsGeometries.push(d.preUpdatedGraphics[e].geometry.toJson()),
this._preUpdatedGraphicsAttributes.push(d.preUpdatedGraphics[e].attributes);for(e=0;e<d.postUpdatedGraphics.length;e++)this._postUpdatedGraphicsGeometries.push(d.postUpdatedGraphics[e].geometry.toJson()),this._postUpdatedGraphicsAttributes.push(p.clone(d.postUpdatedGraphics[e].attributes))},updateObjectIds:function(d,e){this.updateIds(this._featureLayer,this._preUpdatedGraphicsAttributes,d,e);this.updateIds(this._featureLayer,this._postUpdatedGraphicsAttributes,d,e);this.updateIds(this._featureLayer,
this._deletedGraphics,d,e)},performUndo:function(){var d;for(d=0;d<this._postUpdatedGraphics.length;d++)this._postUpdatedGraphics[d].setGeometry(e.fromJson(this._preUpdatedGraphicsGeometries[d])),this._postUpdatedGraphics[d].setAttributes(this._preUpdatedGraphicsAttributes[d]);var g=r.map(this._deletedGraphics,function(c){return c.attributes[this._featureLayer.objectIdField]},this);return this._featureLayer.applyEdits(this._deletedGraphics,this._postUpdatedGraphics,null).then(p.hitch(this,function(c,
a,d){c=r.map(c,function(a){return a.objectId});return{oldIds:g,addedIds:c,layer:this._featureLayer,operation:this}}))},performRedo:function(){var d;for(d=0;d<this._postUpdatedGraphics.length;d++)this._postUpdatedGraphics[d].setGeometry(e.fromJson(this._postUpdatedGraphicsGeometries[d])),this._postUpdatedGraphics[d].setAttributes(this._postUpdatedGraphicsAttributes[d]);return this._featureLayer.applyEdits(null,this._postUpdatedGraphics,this._deletedGraphics).then(p.hitch(this,function(){return{layer:this._featureLayer,
operation:this}}))}});m("extend-esri")&&p.setObject("dijit.editing.Union",n,h);return n})},"esri/dijit/editing/toolbars/Drawing":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has dijit/_CssStateMixin ../Util ./ToolbarBase ../tools/ButtonToolBase ../tools/Cut ../tools/Union ../tools/Reshape ../tools/Editing ../tools/EditingTools ../tools/Selection ../tools/SelectionTools ../../../kernel".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q){r=r([d,
e],{declaredClass:"esri.dijit.editing.toolbars.Drawing",onShowAttributeInspector:function(){},_activateTool:function(a,b){this._settings.editor._activeTool=a;"EDITING"!==a&&this._settings.templatePicker.clearSelection();"ATTRIBUTES"!==a&&this._settings.editor._hideAttributeInspector();"CLEAR"!==a&&this.inherited(arguments)},_initializeToolbar:function(){p.forEach(this._settings.layers,function(a){this._tbConnects.push(m.connect(a,"onSelectionComplete",this,"_updateUI"))},this)},activateEditing:function(a,
b){this._tools.EDITING._activateTool(a,b.geometryType);this._activeTool=this._tools.EDITING;this._activeTool.setChecked(!0)},_updateUI:function(){this._settings.undoManager&&(this._tools.UNDO.set("disabled",!1===this._settings.undoManager.canUndo),this._tools.REDO.set("disabled",!1===this._settings.undoManager.canRedo));this._selectedFeatures=k.getSelection(this._settings.layers);var a=this._selectedFeatures.length;this._tools.DELETE&&this._tools.DELETE.set("disabled",0>=a);this._tools.CLEAR&&this._tools.CLEAR.set("disabled",
0>=a);this._tools.ATTRIBUTES&&this._tools.ATTRIBUTES.set("disabled",0>=a);this._tools.UNION&&this._tools.UNION.set("disabled",2>a)},_toolFinished:function(a){if("ATTRIBUTES"===a&&this._selectedFeatures&&this._selectedFeatures.length)this.onShowAttributeInspector(this._selectedFeatures[0]);if("SELECT"===a||"CUT"===a||"RESHAPING"===a||"EDITING"===a)this._activeTool.deactivate(),this._activeTool.setChecked(!1),this._activeTool=null;if("DELETE"===a)this.onDelete();this._settings.editor._activeTool=null;
this._updateUI()},_createTools:function(){this._tools.SELECT=new f({settings:this._settings,onClick:n.hitch(this,"_activateTool","SELECT",!0),onFinished:n.hitch(this,"_toolFinished","SELECT")});this.addChild(this._tools.SELECT);this._tools.CLEAR=new g(n.mixin(b.selectClear,{settings:this._settings,onClick:n.hitch(this._settings.editor,"_clearSelection",!1)}));this.addChild(this._tools.CLEAR);this._createSeparator();this._tools.ATTRIBUTES=new g(n.mixin(v.attributes,{settings:this._settings,onClick:n.hitch(this,
"_toolFinished","ATTRIBUTES")}));this.addChild(this._tools.ATTRIBUTES);this._createSeparator();this._tools.EDITING=new t({settings:this._settings,onClick:n.hitch(this,"_activateTool","EDITING",!0),onApplyEdits:n.hitch(this,"onApplyEdits"),onFinished:n.hitch(this,"_toolFinished","EDITING")});this.addChild(this._tools.EDITING);this._tools.DELETE=new g(n.mixin(v.del,{settings:this._settings,onClick:n.hitch(this,"_toolFinished","DELETE")}));this.addChild(this._tools.DELETE);this._settings.toolbarOptions&&
((this._settings.toolbarOptions.cutVisible||this._settings.toolbarOptions.mergeVisible||this._settings.toolbarOptions.reshapeVisible)&&this._createSeparator(),this._settings.toolbarOptions.cutVisible&&(this._tools.CUT=new c({settings:this._settings,onFinished:n.hitch(this,"_toolFinished","CUT"),onClick:n.hitch(this,"_activateTool","CUT",!0),onApplyEdits:n.hitch(this,"onApplyEdits")}),this.addChild(this._tools.CUT)),this._settings.toolbarOptions.mergeVisible&&(this._tools.UNION=new a({settings:this._settings,
onFinished:n.hitch(this,"_toolFinished","UNION"),onApplyEdits:n.hitch(this,"onApplyEdits")}),this.addChild(this._tools.UNION)),this._settings.toolbarOptions.reshapeVisible&&(this._tools.RESHAPING=new l({settings:this._settings,onClick:n.hitch(this,"_activateTool","RESHAPING",!0),onFinished:n.hitch(this,"_toolFinished","RESHAPING"),onApplyEdits:n.hitch(this,"onApplyEdits")}),this.addChild(this._tools.RESHAPING)));this._settings.enableUndoRedo&&(this._createSeparator(),this._tools.UNDO=new g(n.mixin(v.undo,
{settings:this._settings,disabled:!0,onClick:n.hitch(this,function(){this._tools.UNDO.set("disabled",!0);this._tools.REDO.set("disabled",!0);this._settings.editor._undo()})})),this.addChild(this._tools.UNDO),this._tools.REDO=new g(n.mixin(v.redo,{settings:this._settings,disabled:!0,onClick:n.hitch(this,function(){this._tools.UNDO.set("disabled",!0);this._tools.REDO.set("disabled",!0);this._settings.editor._redo()})})),this.addChild(this._tools.REDO))}});h("extend-esri")&&n.setObject("dijit.editing.toolbars.Drawing",
r,q);return r})},"esri/dijit/editing/toolbars/ToolbarBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has dijit/Toolbar dijit/ToolbarSeparator ../../../kernel ../../../lang".split(" "),function(r,n,p,m,h,e,k,d,g){r=r([e],{declaredClass:"esri.dijit.editing.toolbars.ToolbarBase",_enabled:!0,graphicsAdded:function(){},drawEnd:function(){},onApplyEdits:function(){},onDelete:function(){},constructor:function(c,a){c&&c.settings&&(this._tools=[],this._tbConnects=
[],this._initialize(c.settings))},postCreate:function(){this._createTools();this.deactivate()},destroy:function(){var c,a=this._tools;for(c in a)a.hasOwnProperty(c)&&g.isDefined(this._tools[c])&&this._tools[c].destroy();p.forEach(this._tbConnects,m.disconnect);this.inherited(arguments)},activate:function(c){this._enabled=!0},deactivate:function(){var c;this._enabled=!1;this._geometryType=this._layer=null;var a=this._tools;for(c in a)a.hasOwnProperty(c)&&(this._tools[c].deactivate(),this._tools[c].setChecked(!1))},
isEnabled:function(){return this._enabled},setActiveSymbol:function(c){this._activeSymbol=c},_getSymbol:function(){},_createTools:function(){},_initialize:function(c){this._settings=c;this._toolbar=c.drawToolbar;this._editToolbar=c.editToolbar;this._initializeToolbar()},_activateTool:function(c,a){this._activeTool&&this._activeTool.deactivate();!0===a&&this._activeTool==this._tools[c]?(this._activeTool.setChecked(!1),this._activeTool=null):(this._activeTool=this._tools[c],this._activeTool.setChecked(!0),
this._activeTool.activate(null))},_createSeparator:function(){this.addChild(new k)}});h("extend-esri")&&n.setObject("dijit.editing.toolbars.ToolbarBase",r,d);return r})},"esri/dijit/editing/tools/ButtonToolBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dijit/form/Button ./ToolBase ../../../kernel".split(" "),function(r,n,p,m,h,e){r=r([m,h],{declaredClass:"esri.dijit.editing.tools.ButtonToolBase",postCreate:function(){this.inherited(arguments);this._setShowLabelAttr&&this._setShowLabelAttr(!1)},
destroy:function(){m.prototype.destroy.apply(this,arguments);h.prototype.destroy.apply(this,arguments)}});p("extend-esri")&&n.setObject("dijit.editing.tools.ButtonToolBase",r,e);return r})},"esri/dijit/editing/tools/ToolBase":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../../../kernel","dojo/i18n!../../../nls/jsapi"],function(r,n,p,m,h){r=r(null,{declaredClass:"esri.dijit.editing.tools.ToolBase",_enabled:!0,showLabel:!1,constructor:function(e,k){e=e||{};n.mixin(this,e);this.label=
this._label?h.widgets.editor.tools[this._label]:"";this._settings=e.settings;this._toolbar=e.settings.drawToolbar;this._editToolbar=e.settings.editToolbar;this._initializeTool()},onFinished:function(){},onDrawEnd:function(){},onApplyEdits:function(){},postCreate:function(){this.deactivate();this.inherited(arguments)},destroy:function(){},activate:function(e){this._toolbar&&this._toolbar.deactivate();this._editToolbar&&this._editToolbar.deactivate();this._enabled&&(this._checked=!0,this._layer=e,this._toolbar&&
this._drawType&&this._toolbar.activate(this._drawType))},deactivate:function(){this._toolbar&&this._toolbar.deactivate();this._editToolbar&&this._editToolbar.deactivate();this.setChecked(!1);this._updateUI()},setEnabled:function(e){this._enabled=e;this._updateUI()},setChecked:function(e){this._checked=e},enable:function(e){this._updateUI()},isEnabled:function(){return this._enabled},getToolName:function(){return this._toolName},_initializeTool:function(){},_updateUI:function(){this.disabled=!this._enabled;
this.attr("iconClass",this._enabled?this._enabledIcon:this._disabledIcon)}});p("extend-esri")&&n.setObject("dijit.editing.tools.ToolBase",r,m);return r})},"esri/dijit/editing/tools/Cut":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has dojo/DeferredList ../../../graphicsUtils ../../../graphic ../../../tasks/query ../../../layers/FeatureLayer ../../../toolbars/draw ../Cut ./ToggleToolBase ../../../kernel".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l,
t,v){r=r([t],{declaredClass:"esri.dijit.editing.tools.Cut",id:"btnFeatureCut",_enabledIcon:"toolbarIcon cutIcon",_disabledIcon:"toolbarIcon cutIcon",_drawType:a.POLYLINE,_enabled:!0,_label:"NLS_cutLbl",_cutConnects:[],activate:function(){this._cutConnects.push(m.connect(this._toolbar,"onDrawEnd",this,"_onDrawEnd"));this.inherited(arguments)},deactivate:function(){this.inherited(arguments);p.forEach(this._cutConnects,m.disconnect);this._cutConnects=[];this._edits=[]},_onDrawEnd:function(a){var b=this._cutLayers=
p.filter(this._settings.layers,function(a){return"esriGeometryPolygon"===a.geometryType||"esriGeometryPolyline"===a.geometryType&&a.visible&&a._isMapAtVisibleScale()});this._cutConnects=this._cutConnects.concat(p.map(b,n.hitch(this,function(a){return m.connect(a,"onEditsComplete",n.hitch(this,function(a,b,c){if(this._settings.undoRedoManager){var d=this._settings.undoRedoManager;p.forEach(this._edits,n.hitch(this,function(a){d.add(new l({featureLayer:a.layer,addedGraphics:a.adds,preUpdatedGraphics:a.preUpdates,
postUpdatedGraphics:a.updates}))}),this)}this.onFinished()}))})));var d=new g;d.geometry=a;p.forEach(b,function(a,b){this._settings.editor._selectionHelper.selectFeatures([a],d,c.SELECTION_NEW,n.hitch(this,"_cutFeatures",a,d))},this)},_cutFeatures:function(a,b,c){if(c&&c.length){this._edits=[];var d=[];d.push(this._settings.geometryService.cut(k.getGeometries(c),b.geometry,n.hitch(this,"_cutHandler",a,c)));(new e(d)).addCallback(n.hitch(this,function(){this.onApplyEdits(this._edits)}))}},_cutHandler:function(a,
b,c){var e=[],f=[],g=p.map(b,function(a){return new d(n.clone(a.toJson()))}),h,k;p.forEach(c.cutIndexes,function(a,g){h!=a?(h=a,f.push(b[a].setGeometry(c.geometries[g]))):(k=new d(c.geometries[g],null,n.mixin({},b[a].attributes),null),k.attributes[b[0].getLayer().objectIdField]=null,e.push(k))},this);this._edits.push({layer:a,adds:e,updates:f,preUpdates:g})}});h("extend-esri")&&n.setObject("dijit.editing.tools.Cut",r,v);return r})},"esri/dijit/editing/tools/ToggleToolBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dijit/form/ToggleButton ./ToolBase ../../../kernel".split(" "),
function(r,n,p,m,h,e){r=r([m,h],{declaredClass:"esri.dijit.editing.tools.ToggleToolBase",postCreate:function(){this.inherited(arguments);this._setShowLabelAttr&&this._setShowLabelAttr(!1)},destroy:function(){m.prototype.destroy.apply(this,arguments);h.prototype.destroy.apply(this,arguments)},setChecked:function(e){m.prototype.setChecked.apply(this,arguments)}});p("extend-esri")&&n.setObject("dijit.editing.tools.ToggleToolBase",r,e);return r})},"esri/dijit/editing/tools/Union":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../../../graphicsUtils ../../../graphic ../../../toolbars/draw ../Union ./ButtonToolBase ../../../kernel".split(" "),
function(r,n,p,m,h,e,k,d,g,c){r=r([g],{declaredClass:"esri.dijit.editing.tools.Union",id:"btnFeatureUnion",_enabledIcon:"toolbarIcon unionIcon",_disabledIcon:"toolbarIcon unionIcon",_drawType:k.POLYLINE,_enabled:!0,_label:"NLS_unionLbl",_onClick:function(a){this._settings.editor._activeTool="UNION";a=p.filter(this._settings.layers,function(a){return"esriGeometryPolygon"===a.geometryType&&a.visible&&a._isMapAtVisibleScale()});var c=[],g=0;p.forEach(a,function(a,f){var b=a.getSelectedFeatures();2<=
b.length&&(g++,this._settings.geometryService.union(h.getGeometries(b),n.hitch(this,function(f){var h=b.shift(),k=[],l=[];k.push(new e(h.toJson()));l.push(h.setGeometry(f));c.push({layer:a,updates:l,deletes:b,preUpdates:k});g--;if(0>=g)this.onApplyEdits(c,n.hitch(this,function(){if(this._settings.undoRedoManager){var a=this._settings.undoRedoManager;p.forEach(this._edits,n.hitch(this,function(b){a.add(new d({featureLayer:b.layer,deletedGraphics:b.deletes,preUpdatedGraphics:b.preUpdates,postUpdatedGraphics:b.updates}))}),
this)}this._settings.editor._selectionHelper.clearSelection(!1);this.onFinished()}))})))},this)}});m("extend-esri")&&n.setObject("dijit.editing.tools.Union",r,c);return r})},"esri/dijit/editing/tools/Reshape":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has ../../../graphic ../../../layers/FeatureLayer ../../../tasks/query ../../../toolbars/draw ./ToggleToolBase ../../../kernel".split(" "),function(r,n,p,m,h,e,k,d,g,c,a){r=r([c],{declaredClass:"esri.dijit.editing.tools.Reshape",
id:"btnFeatureReshape",_enabledIcon:"toolbarIcon reshapeIcon",_disabledIcon:"toolbarIcon reshapeIcon",_drawType:g.POLYLINE,_enabled:!0,_label:"NLS_reshapeLbl",activate:function(){m.disconnect(this._rConnect);this._rConnect=m.connect(this._toolbar,"onDrawEnd",this,"_onDrawEnd");this.inherited(arguments)},deactivate:function(){this.inherited(arguments);m.disconnect(this._rConnect);delete this._rConnect},_onDrawEnd:function(a){var c=this._settings.layers,e=new d;e.geometry=a;a=this._reshapeLayers=p.filter(c,
function(a){return"esriGeometryPolygon"===a.geometryType||"esriGeometryPolyline"});this._settings.editor._selectionHelper.selectFeatures(a,e,k.SELECTION_NEW,n.hitch(this,"_reshape",e))},_reshape:function(a,c){if(1===c.length){var d=[],f=[],b=[],g=c[0],h=g.getLayer();this._settings.geometryService.reshape(g.geometry,a.geometry,n.hitch(this,function(a){"polyline"===a.type&&a.paths&&0===a.paths.length?(this._settings.editor._selectionHelper.clearSelection(!1),this.onFinished()):"polygon"===a.type&&a.rings&&
0===a.rings.length?(this._settings.editor._selectionHelper.clearSelection(!1),this.onFinished()):(b.push(new e(g.toJson())),f.push(g.setGeometry(a)),d.push({layer:h,updates:f,preUpdates:b}),this.onApplyEdits(d,n.hitch(this,function(){this._settings.editor._selectionHelper.clearSelection(!1);this.onFinished()})))}))}}});h("extend-esri")&&n.setObject("dijit.editing.tools.Reshape",r,a);return r})},"esri/dijit/editing/tools/Editing":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../../../layers/FeatureTemplate ./Edit ./EditingTools ./DropDownToolBase ../../../kernel ../../../lang".split(" "),
function(r,n,p,m,h,e,k,d,g,c){r=r([d],{declaredClass:"esri.dijit.editing.tools.Editing",_enabled:!1,deactivate:function(){this._enabled&&(this._enabled=!1,this.inherited(arguments),this._settings.templatePicker.clearSelection())},onItemClicked:function(a,c){this.inherited(arguments);this._activeTool===this._tools.AUTOCOMPLETE&&(this._settings.editor._drawingTool=h.TOOL_AUTO_COMPLETE_POLYGON)},_activateTool:function(a,c){var d;this.enable(c);for(d in this._tools)this._tools.hasOwnProperty(d)&&(this.dropDown.removeChild(this._tools[d]),
!0===this._tools[d]._enabled&&this.dropDown.addChild(this._tools[d]));if(this._geometryType!==c||!1===this._activeTool._enabled)this._activeTool=this._tools[a.toUpperCase()];this._geometryType=c;this._activeTool.activate();this._activeTool.setChecked(!0);this._updateUI()},_initializeTool:function(a){this.inherited(arguments);this._initializeTools()},_initializeTools:function(){var a=this._settings.layers,c=this._settings.editor,d=!1,e=!1,f=!1,b=this._toolTypes=[],g;p.forEach(a,function(a){g=a.geometryType;
d=d||"esriGeometryPoint"===g;e=e||"esriGeometryPolyline"===g;f=f||"esriGeometryPolygon"===g;b=b.concat(p.map(this._getTemplatesFromLayer(a),n.hitch(this,function(b){return c._toDrawTool(b.drawingTool,a)})))},this);a=this._settings.createOptions;d&&this._toolTypes.push("point");e&&(this._toolTypes=this._toolTypes.concat(a.polylineDrawTools));f&&(this._toolTypes=this._toolTypes.concat(a.polygonDrawTools));this._toolTypes=this._toUnique(this._toolTypes.concat(b))},_toUnique:function(a){var c={};return p.filter(a,
function(a){return c[a]?!1:c[a]=!0})},_getTemplatesFromLayer:function(a){var d=a.templates||[];p.forEach(a.types,function(a){d=d.concat(a.templates)});return p.filter(d,c.isDefined)},_createTools:function(){p.forEach(this._toolTypes,this._createTool,this);this.inherited(arguments)},_createTool:function(a){var c=n.mixin(k[a],{settings:this._settings,onClick:n.hitch(this,"onItemClicked",k[a].id)});this._tools[a.toUpperCase()]=new e(c)}});m("extend-esri")&&n.setObject("dijit.editing.tools.Editing",r,
g);return r})},"esri/dijit/editing/tools/Edit":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","./MenuItemBase","../../../kernel"],function(r,n,p,m,h){r=r([m],{declaredClass:"esri.dijit.editing.tools.Edit",enable:function(e){this._enabled=e===this._geomType;this.inherited(arguments)}});p("extend-esri")&&n.setObject("dijit.editing.tools.Edit",r,h);return r})},"esri/dijit/editing/tools/MenuItemBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dijit/MenuItem ./ToolBase ../../../kernel".split(" "),
function(r,n,p,m,h,e){r=r([m,h],{declaredClass:"esri.dijit.editing.tools.MenuItemBase",destroy:function(){m.prototype.destroy.apply(this,arguments);h.prototype.destroy.apply(this,arguments)}});p("extend-esri")&&n.setObject("dijit.editing.tools.MenuItemBase",r,e);return r})},"esri/dijit/editing/tools/EditingTools":function(){define(["dojo/_base/lang","dojo/has","../../../toolbars/draw","../../../kernel"],function(r,n,p,m){p={point:{id:"esriPointTool",_enabledIcon:"toolbarIcon pointIcon",_disabledIcon:"toolbarIcon pointIconDisabled",
_drawType:p.POINT,_geomType:"esriGeometryPoint",_label:"NLS_pointLbl"},polyline:{id:"toolDrawFreehandPolyline",_enabledIcon:"toolbarIcon polylineIcon",_disabledIcon:"toolbarIcon polylineIconDisabled",_drawType:p.POLYLINE,_geomType:"esriGeometryPolyline",_label:"NLS_polylineLbl"},freehandpolyline:{id:"toolDrawPolyline",_enabledIcon:"toolbarIcon freehandPolylineIcon",_disabledIcon:"toolbarIcon freehandPolylineIcon",_drawType:p.FREEHAND_POLYLINE,_geomType:"esriGeometryPolyline",_label:"NLS_freehandPolylineLbl"},
polygon:{id:"toolDrawPolygon",_enabledIcon:"toolbarIcon polygonIcon",_disabledIcon:"toolbarIcon polygonIconDisabled",_drawType:p.POLYGON,_geomType:"esriGeometryPolygon",_label:"NLS_polygonLbl"},freehandpolygon:{id:"toolDrawFreehandPolygon",_enabledIcon:"toolbarIcon freehandPolygonIcon",_disabledIcon:"toolbarIcon freehandPolygonIconDisabled",_drawType:p.FREEHAND_POLYGON,_label:"NLS_freehandPolygonLbl",_geomType:"esriGeometryPolygon"},autocomplete:{id:"btnFeatureAutoComplete",_enabledIcon:"toolbarIcon autoCompleteIcon",
_disabledIcon:"toolbarIcon autoCompleteIcon",_drawType:p.POLYGON,_label:"NLS_autoCompleteLbl",_geomType:"esriGeometryPolygon"},rectangle:{id:"toolDrawRect",_enabledIcon:"toolbarIcon rectangleIcon",_disabledIcon:"toolbarIcon rectangleIcon",_drawType:p.RECTANGLE,_geomType:"esriGeometryPolygon",_label:"NLS_rectangleLbl"},arrow:{id:"toolDrawArrow",_enabledIcon:"toolbarIcon arrowIcon",_disabledIcon:"toolbarIcon arrowIcon",_drawType:p.ARROW,_geomType:"esriGeometryPolygon",_label:"NLS_arrowLbl"},uparrow:{id:"toolDrawArrowUp",
_enabledIcon:"toolbarIcon arrowUpIcon",_disabledIcon:"toolbarIcon arrowUpIcon",_drawType:p.UP_ARROW,_geomType:"esriGeometryPolygon",_label:"NLS_arrowUpLbl"},downarrow:{id:"toolDrawDownArrow",_enabledIcon:"toolbarIcon arrowDownIcon",_disabledIcon:"toolbarIcon arrowDownIcon",_drawType:p.DOWN_ARROW,_geomType:"esriGeometryPolygon",_label:"NLS_arrowDownLbl"},leftarrow:{id:"toolDrawLeftArrow",_enabledIcon:"toolbarIcon arrowLeftIcon",_disabledIcon:"toolbarIcon arrowLeftIcon",_drawType:p.LEFT_ARROW,_geomType:"esriGeometryPolygon",
_label:"NLS_arrowLeftLbl"},rightarrow:{id:"toolDrawRightArrow",_enabledIcon:"toolbarIcon arrowIcon",_disabledIcon:"toolbarIcon arrowIcon",_drawType:p.RIGHT_ARROW,_geomType:"esriGeometryPolygon",_label:"NLS_arrowRightLbl"},circle:{id:"toolDrawCircle",_enabledIcon:"toolbarIcon circleIcon",_disabledIcon:"toolbarIcon circleIcon",_drawType:p.CIRCLE,_geomType:"esriGeometryPolygon",_label:"NLS_circleLbl"},ellipse:{id:"toolDrawEllipse",_enabledIcon:"toolbarIcon ellipseIcon",_disabledIcon:"toolbarIcon ellipseIcon",
_drawType:p.ELLIPSE,_geomType:"esriGeometryPolygon",_label:"NLS_ellipseLbl"},triangle:{id:"toolDrawTriangle",_enabledIcon:"toolbarIcon triangleIcon",_disabledIcon:"toolbarIcon triangleIcon",_drawType:p.TRIANGLE,_geomType:"esriGeometryPolygon",_label:"NLS_triangleLbl"},attributes:{id:"btnAttributes",_enabledIcon:"toolbarIcon attributesIcon",_disabledIcon:"toolbarIcon attributesIcon",_enabled:!1,_label:"NLS_attributesLbl"},del:{id:"btnDelete2",_enabledIcon:"toolbarIcon deleteFeatureIcon",_disabledIcon:"toolbarIcon deleteFeatureIcon",
_enabled:!1,_label:"NLS_deleteLbl"},undo:{id:"btnUndo",_enabledIcon:"dijitEditorIcon dijitEditorIconUndo",_disabledIcon:"dijitEditorIcon dijitEditorIconUndo",_enabled:!1,_label:"NLS_undoLbl"},redo:{id:"btnRedo",_enabledIcon:"dijitEditorIcon dijitEditorIconRedo",_disabledIcon:"dijitEditorIcon dijitEditorIconRedo",_enabled:!1,_label:"NLS_redoLbl"}};n("extend-esri")&&r.setObject("dijit.editing.tools.EditingTools",p,m);return p})},"esri/dijit/editing/tools/DropDownToolBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dojo/dom-style dijit/registry dijit/Menu dijit/form/ComboButton ./ToolBase ../../../kernel ../../../lang".split(" "),
function(r,n,p,m,h,e,k,d,g,c){r=r([k,d],{declaredClass:"esri.dijit.editing.tools.DropDownToolBase",_enabled:!1,_checked:!1,postCreate:function(){this._tools=[];this._createTools();this.inherited(arguments);this._setShowLabelAttr&&this._setShowLabelAttr(!1)},destroy:function(){var a,d=this._tools;for(a in d)d.hasOwnProperty(a)&&c.isDefined(d[a])&&d[a].destroy();this.inherited(arguments)},_createTools:function(){var a,c=new e;this.dropDown=c;for(a in this._tools)this._tools.hasOwnProperty(a)&&c.addChild(this._tools[a]);
this._activeTool=c.getChildren()[0];this._updateUI()},activate:function(a){this.inherited(arguments);this._activeTool?this._activeTool.activate():this._activateDefaultTool()},deactivate:function(){this.inherited(arguments);this._activeTool&&this._activeTool.deactivate()},enable:function(a){for(var c in this._tools)this._tools.hasOwnProperty(c)&&this._tools[c].enable(a);this.setEnabled(!0);this.inherited(arguments)},setChecked:function(a){this._checked=a;this._updateUI()},_onDrawEnd:function(a){},
onLayerChange:function(a,c,d){this._activeTool=null;this._activeType=c;this._activeTemplate=d;this._activeLayer=a},onItemClicked:function(a,c){this._activeTool&&this._activeTool.deactivate();this._activeTool=h.byId(a);!1===this._checked?this._onClick():(this._updateUI(),this._activeTool&&(this._activeTool.activate(),this._activeTool.setChecked(!0)))},_onClick:function(a){!1!==this._enabled&&(this._checked=!this._checked,this.inherited(arguments))},_updateUI:function(){this.attr("disabled",!this._enabled);
m.set(this.focusNode,{outline:"none"});m.set(this.titleNode,{padding:"0px",border:"none"});this._checked?m.set(this.titleNode,{backgroundColor:"#D4DFF2",border:"1px solid #316AC5"}):m.set(this.titleNode,{backgroundColor:"",border:""});this._activeTool&&(this.attr("iconClass",this._checked?this._activeTool._enabledIcon:this._activeTool._disabledIcon),this.attr("label",this._activeTool.label))}});p("extend-esri")&&n.setObject("dijit.editing.tools.DropDownToolBase",r,g);return r})},"dijit/form/ComboButton":function(){define("dojo/_base/declare dojo/keys ../focus ./DropDownButton dojo/text!./templates/ComboButton.html ../a11yclick".split(" "),
function(r,n,p,m,h){return r("dijit.form.ComboButton",m,{templateString:h,_setIdAttr:"",_setTabIndexAttr:["focusNode","titleNode"],_setTitleAttr:"titleNode",optionsTitle:"",baseClass:"dijitComboButton",cssStateNodes:{buttonNode:"dijitButtonNode",titleNode:"dijitButtonContents",_popupStateNode:"dijitDownArrowButton"},_focusedNode:null,_onButtonKeyDown:function(e){e.keyCode==n[this.isLeftToRight()?"RIGHT_ARROW":"LEFT_ARROW"]&&(p.focus(this._popupStateNode),e.stopPropagation(),e.preventDefault())},_onArrowKeyDown:function(e){e.keyCode==
n[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]&&(p.focus(this.titleNode),e.stopPropagation(),e.preventDefault())},focus:function(e){this.disabled||p.focus("start"==e?this.titleNode:this._popupStateNode)}})})},"esri/dijit/editing/tools/Selection":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/Color dojo/has ../../../symbols/SimpleMarkerSymbol ../../../symbols/SimpleLineSymbol ../../../symbols/SimpleFillSymbol ./Edit ./SelectionTools ./DropDownToolBase ../../../kernel".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t){r=r([l],{declaredClass:"esri.dijit.editing.tools.Selection",_enabled:!0,activate:function(){this.inherited(arguments);this._sConnect=m.connect(this._toolbar,"onDrawEnd",this,"_onDrawEnd")},deactivate:function(){this.inherited(arguments);m.disconnect(this._sConnect);delete this._sConnect},_initializeTool:function(){this._createSymbols();this._initializeLayers();this._toolTypes=["select","selectadd","selectremove"]},_onDrawEnd:function(a){this.inherited(arguments);
this._settings.editor._hideAttributeInspector();var c=this._settings.layers;this._selectMethod=this._activeTool._selectMethod;this._settings.editor._selectionHelper.selectFeaturesByGeometry(c,a,this._selectMethod,n.hitch(this,"onFinished"))},_createSymbols:function(){this._pointSelectionSymbol=new k(k.STYLE_CIRCLE,10,new d(d.STYLE_SOLID,new h([0,0,0]),1),new h([255,0,0,.5]));this._polylineSelectionSymbol=new d(d.STYLE_SOLID,new h([0,200,255]),2);this._polygonSelectionSymbol=new g(g.STYLE_SOLID,new d(d.STYLE_SOLID,
new h([0,0,0]),1),new h([0,200,255,.5]))},_initializeLayers:function(){p.forEach(this._settings.layers,this._setSelectionSymbol,this)},_setSelectionSymbol:function(a){var c=null;switch(a.geometryType){case "esriGeometryPoint":c=this._pointSelectionSymbol;break;case "esriGeometryPolyline":c=this._polylineSelectionSymbol;break;case "esriGeometryPolygon":c=this._polygonSelectionSymbol}a.setSelectionSymbol(a._selectionSymbol||c)},_createTools:function(){p.forEach(this._toolTypes,this._createTool,this);
this.inherited(arguments)},_createTool:function(d){var e=n.mixin(a[d],{settings:this._settings,onClick:n.hitch(this,"onItemClicked",a[d].id)});this._tools[d.toUpperCase()]=new c(e)}});e("extend-esri")&&n.setObject("dijit.editing.tools.Selection",r,t);return r})},"esri/dijit/editing/tools/SelectionTools":function(){define(["dojo/_base/lang","dojo/has","../../../layers/FeatureLayer","../../../toolbars/draw","../../../kernel"],function(r,n,p,m,h){p={select:{id:"btnNewSelection",_enabledIcon:"toolbarIcon newSelectionIcon",
_disabledIcon:"toolbarIcon newSelectionIcon",_drawType:m.EXTENT,_selectMethod:p.SELECTION_NEW,_label:"NLS_selectionNewLbl"},selectadd:{id:"btnAddToSelection",_enabledIcon:"toolbarIcon addToSelectionIcon",_disabledIcon:"toolbarIcon addToSelectionIcon",_drawType:m.EXTENT,_selectMethod:p.SELECTION_ADD,_label:"NLS_selectionAddLbl"},selectremove:{id:"btnSubtractFromSelection",_enabledIcon:"toolbarIcon removeFromSelectionIcon",_disabledIcon:"toolbarIcon removeFromSelectionIcon",_drawType:m.EXTENT,_selectMethod:p.SELECTION_SUBTRACT,
_label:"NLS_selectionRemoveLbl"},selectClear:{id:"btnClearSelection",_enabledIcon:"toolbarIcon clearSelectionIcon",_disabledIcon:"toolbarIcon clearSelectionIcon",_enabled:!1,_label:"NLS_selectionClearLbl"}};n("extend-esri")&&r.setObject("dijit.editing.tools.SelectionTools",p,h);return p})},"esri/dijit/editing/SelectionHelper":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/array dojo/has dojo/DeferredList ../../geometry/Extent ../../geometry/Point ../../geometry/ScreenPoint ../../layers/FeatureLayer ../../tasks/query ../../kernel".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l){r=r(null,{declaredClass:"esri.dijit.editing.SelectionHelper",constructor:function(a){this._settings=a||{};this._sConnects=[];this._mapServiceCount=0;this._map=this._settings.map;this._tolerance=this._settings.singleSelectionTolerance;this._initMapServiceInfos(this._settings.layers)},destroy:function(){for(var a in this._sConnects)this._sConnects.hasOwnProperty(a)&&p.disconnect(this._sConnects[a])},selectFeatures:function(a,d,f,b){f===c.SELECTION_NEW&&(this._resetMapServiceInfos(),
this.getSelection(a));var g=[];m.forEach(a,function(a){if(!0===a.visible&&!0===a._isMapAtVisibleScale()){var b=f;a._isSelOnly&&b===c.SELECTION_NEW&&(b=c.SELECTION_ADD);g.push(a.selectFeatures(d,b))}});(new e(g)).addCallback(n.hitch(this,function(d){var e=[];m.forEach(d,function(b,c){m.forEach(b[1],function(b){(b=a[c]._mode._getFeature(b.attributes[a[c].objectIdField])||null)&&e.push(b)},this)},this);this._mapServiceCount?((d=f===c.SELECTION_SUBTRACT)?(this._resetMapServiceInfos(),this._createLayerDefs(this._getLayerInfosFromSelection(a))):
this._createLayerDefs(this._getLayerInfosFromFeatures(e)),this._updateLayerDefs(this._mapServiceInfos,!1,!(e&&e.length||d),n.hitch(this,b,e))):b(e)}))},selectFeaturesByGeometry:function(c,e,f,b){var g=e;-1!==e.declaredClass.indexOf("Extent")&&e.xmax===e.xmin&&e.ymax===e.ymin&&(g=new d(e.xmax,e.ymax,e.spatialReference));g=-1!==g.declaredClass.indexOf("Point")?this._extentFromPoint(g):g;e=new a;e.geometry=g;this.selectFeatures(c,e,f,b)},clearSelection:function(a){m.forEach(this._nonSelOnlyLayers,function(a){a.clearSelection&&
a.clearSelection()});if(this._mapServiceCount){this._resetMapServiceInfos();var c=this._getLayerInfosFromSelection(this._settings.layers);m.some(c,function(a){return a.oids&&a.oids.length})&&(this._createLayerDefs(c),this._updateLayerDefs(this._mapServiceInfos,!0,a||!1))}},findMapService:function(a){var c=this._map,d=c.layerIds;a=a&&a._url&&a._url.path?a._url.path.toLowerCase():"";var b,e,g;for(e in d)if(d.hasOwnProperty(e)&&(b=c.getLayer(d[e]),g=b._url?b._url.path?b._url.path.toLowerCase().replace("mapserver",
"featureserver"):b._url.toLowerCase().replace("mapserver","featureserver"):"",a.substr(0,g.length)===g&&"esri.layers.ArcGISDynamicMapServiceLayer"===b.declaredClass))return b},getSelection:function(a){var c=[];m.forEach(a,function(a){a._isSelOnly&&c.push(this._createLayerInfo(a))},this);m.forEach(c,function(a){var b=this._createMapServiceInfo(this.findMapService(a.layer));b&&(b.layerInfos[a.layer.layerId]=a)},this)},_initMapServiceInfos:function(a){this._nonSelOnlyLayers=[];this._mapServiceInfos=
[];m.forEach(a,function(a){var c=this.findMapService(a);c?(this._mapServiceCount++,this._createMapServiceInfo(c),c&&c.setDisableClientCaching(!0)):this._nonSelOnlyLayers.push(a)},this)},_createMapServiceInfo:function(a){if(!a)return null;var c=this._mapServiceInfos,d=c[a.id];d||(d=c[a.id]={mapService:a,layerInfos:[],layerDefs:n.mixin([],a.layerDefinitions||[]),origLayerDefs:n.mixin([],a.layerDefinitions||[])});return d},_resetMapServiceInfo:function(a){m.forEach(a.layerInfos,this._resetLayerInfo);
a.layerDefs=n.mixin([],a.origLayerDefs||[])},_resetMapServiceInfos:function(){var a=this._mapServiceInfos,c;for(c in a)a.hasOwnProperty(c)&&this._resetMapServiceInfo(a[c])},_createLayerInfo:function(a,c){var d=a.objectIdField,b=c?[]:a.getSelectedFeatures();return{layer:a,selectedFeatures:b||[],oids:m.map(b,function(a){return a.attributes[d]})}},_resetLayerInfo:function(a){a&&(a.selectedFeatures=[],a.oids=[])},_updateLayerDefs:function(a,c,d,b){for(var e in a)if(a.hasOwnProperty(e)){var f=a[e],g=f.mapService,
h=f.layerDefs=c?n.mixin([],f.origLayerDefs||[]):f.layerDefs;h?(d?b&&b():this._sConnects[g.id]=p.connect(g,"onUpdateEnd",n.hitch(this,"_onMapServiceUpdate",f,c,b)),g.setLayerDefinitions(h,d||!1)):b&&b()}},_onMapServiceUpdate:function(d,e,f){p.disconnect(this._sConnects[d.mapService.id]);m.forEach(d.layerInfos,function(b){if(e)b&&b.layer.clearSelection();else{var d=new a;d.objectIds=b?b.oids:[];d.objectIds.length&&b.layer.selectFeatures(d,c.SELECTION_SUBTRACT)}},this);e&&this._resetMapServiceInfo(d);
f&&f()},_createLayerDefs:function(a){m.forEach(a,function(a){var c=a.layer,b=this._createMapServiceInfo(this.findMapService(a.layer));if(b){var b=b.layerDefs,d=c.layerId,e='("'+c.objectIdField+'" NOT IN (',g=a.oids;g&&g.length&&(m.forEach(a.oids,function(a,b){g=!0;b&&(e+=",");e+="'"+a+"'"}),e+="))",b[d]=b.length&&b[d]&&b[d].length?b[d]+(" AND"+e):e)}},this)},_getLayerInfosFromFeatures:function(a){var c=[];m.forEach(a,function(a){var b=a.getLayer();b&&b._isSelOnly&&(c[b.id]||(c[b.id]=this._createLayerInfo(b,
!0)),c[b.id].selectedFeatures.push(a),c[b.id].oids.push(a.attributes[b.objectIdField]))},this);a=[];for(var d in c)c.hasOwnProperty(d)&&a.push(c[d]);return a},_getLayerInfosFromSelection:function(a){var c=[];m.forEach(a,function(a){a._isSelOnly&&c.push(this._createLayerInfo(a,!1))},this);return c},_extentFromPoint:function(a){var c=this._tolerance,d=this._map,b=d.toScreen(a);a=new g(b.x-c,b.y+c);c=new g(b.x+c,b.y-c);a=d.toMap(a);c=d.toMap(c);return new k(a.x,a.y,c.x,c.y,d.spatialReference)}});h("extend-esri")&&
n.setObject("dijit.editing.SelectionHelper",r,l);return r})},"esri/dijit/editing/TemplatePicker":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/html dojo/_base/array dojo/_base/json dojo/_base/kernel dojo/has dojo/query dojo/sniff dojo/dom-class dojo/dom-construct dojo/dom-geometry dojo/dom-style dijit/_Widget dijit/_Templated dojo/data/ItemFileReadStore dojox/grid/DataGrid dojox/gfx ../../layers/FeatureLayer ../../symbols/SimpleMarkerSymbol ../../symbols/PictureMarkerSymbol ../../symbols/SimpleFillSymbol ../../symbols/SimpleLineSymbol ./TemplatePickerItem ../../kernel ../../lang ../../request ../_EventedWidget dojo/i18n!../../nls/jsapi dojo/text!./templates/TemplatePicker.html".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A,y,B,x,w,z,E,C,D,F,G,I,N){var M=r([G,f,b],{declaredClass:"esri.dijit.editing.TemplatePicker",widgetsInTemplate:!0,templateString:N,featureLayers:null,items:null,grouping:!0,showTooltip:!1,maxLabelLength:0,rows:4,_rows:0,columns:3,surfaceWidth:30,surfaceHeight:30,emptyMessage:"",useLegend:!0,legendCache:{},_uniqueId:{id:0},_assumedCellWidth:90,_initialAutoWidth:300,_initialAutoHeight:200,_ieTimer:150,constructor:function(a,b){a=a||{};a.items||a.featureLayers||
console.error("TemplatePicker: please provide 'featureLayers' or 'items' parameter in the constructor");this._dojo14x=4<=k.version.minor;this._itemWidgets={};a.featureLayers&&a.featureLayers.length&&(this._flChanged=1);this._nls=I.widgets.templatePicker;this.emptyMessage=a.emptyMessage||this._nls&&this._nls.creationDisabled||""},postMixInProperties:function(){this.inherited(arguments);this._preprocess()},startup:function(){this.inherited(arguments);if("auto"===this.rows&&"auto"===this.columns){var a=
t.getContentBox(this.domNode);a.w||(this.domNode.style.width=this._initialAutoWidth+"px");if(!a.h||1>=a.h)this.domNode.style.height=this._initialAutoHeight+"px";a=t.getContentBox(this.domNode);this._columns=Math.floor(a.w/this._assumedCellWidth)||1}this._applyGridPatches();this._setGridLayout();p.connect(this.grid,"onRowClick",this,this._rowClicked);this._setGridData();this._toggleTooltip();9>d("ie")&&(this._repaintItems=n.hitch(this,this._repaintItems),setTimeout(this._repaintItems,this._ieTimer))},
destroy:function(){this.showTooltip=!1;this._toggleTooltip();this._clearLegendInfo();this.featureLayers=this.items=this.grid=this._flItems=this._itItems=this._groupRowIndices=this._selectedCell=this._selectedInfo=this._selectedItem=null;this.inherited(arguments)},getSelected:function(){return this._selectedCell?this._selectedItem:null},clearSelection:function(){var a=this._selectedCell,b=this._selectedInfo;a&&this._rowClicked({cellNode:a,rowIndex:b.selRow,cellIndex:b.selCol})},update:function(a){a=
"auto"===this.rows&&"auto"===this.columns&&a?!0:!1;var b=this.grid,c;if(a){c=this.domNode;var e;e=k.query("#"+c.id+".templatePicker div.item")[0];c=t.getContentBox(c);e=(e=e&&e.parentNode)?m.coords(e).w:this._assumedCellWidth;this._columns=(this._columns=Math.floor((c.w-b.views.views[0].getScrollbarWidth())/e))||1}e=this._rows;this._preprocess();var f=this._rows;this._setGridLayout();this._setGridData();f!==e&&b.set("autoHeight",this._rows,!1);a?(b._resize({w:c.w,h:c.h}),b.viewsHeaderNode.style.display=
"none"):b.update();this._toggleTooltip();var g=this,h=this.getSelected();h&&b.store.fetch({onComplete:function(a){var c=(a=g._locate(h,g._selectedInfo,a))&&b.views.views[0].getCellNode(a[0],a[1]);c&&g._rowClicked({cellNode:c,rowIndex:a[0],cellIndex:a[1]},!0)}});9>d("ie")&&setTimeout(this._repaintItems,this._ieTimer);a=this.featureLayers;c=this.items;a&&a.length||c&&c.length||!b||!this.emptyMessage||b.showMessage(this.emptyMessage)},_eventMap:{"selection-change":!0},onSelectionChange:function(){},
_setUseLegendAttr:function(a){var b=this.useLegend;this._started&&b===a||(a?this._flChanged=1:this._clearLegendInfo());this.useLegend=a},_setFeatureLayersAttr:function(a){var b=this.featureLayers;this._started&&b===a||(this._flChanged=1);this.featureLayers=a},_adjustRowsCols:function(a){if("auto"===this.rows&&"auto"===this.columns)this._started||(this._rows=!1,this._columns=null,this._autoWidth=!1);else{var b=0;this._rows=this.rows;this._columns=this.columns;"auto"===this.rows?(this.featureLayers?
this.grouping?(b=a.length,h.forEach(a,function(a){b+=Math.ceil(a.length/this.columns)},this)):(h.forEach(a,function(a){b+=a.length},this),b=Math.ceil(b/this.columns)):b=Math.ceil(a.length/this.columns),this._rows=b):"auto"===this.columns&&(this.featureLayers?this.grouping?b=3:(h.forEach(a,function(a){b+=a.length},this),b=Math.ceil(b/this.rows)):b=Math.ceil(a.length/this.rows),this._columns=b)}},_preprocess:function(){this.items&&(this.grouping=!1);this._autoWidth=!1;if("auto"===this.rows||"auto"===
this.columns)this._autoWidth=!0;var a;if(this.featureLayers)if(this.useLegend&&this._flChanged&&(this._legendIndices=[],this._loadingIndices=[],this._legendSymbols={},this._ignoreLegends(),this._loadingLegends=[],clearTimeout(this._legendTimer),this._legendTimer=null,this._processSelectionLayers(),this._flChanged=0),h.every(this.featureLayers,function(a){return a.loaded}))this.featureLayers=h.filter(this.featureLayers,function(a){return!(a.hasZ&&!a.enableZDefaults)}),a=this._flItems=this._getItemsFromLayers(this.featureLayers),
this._adjustRowsCols(a);else{var b=this.featureLayers.length;h.forEach(this.featureLayers,function(a){if(a.loaded)b--;else var c=p.connect(a,"onLoad",this,function(){p.disconnect(c);c=null;b--;b||this.update()})},this)}else a=this._itItems=this._getItemsFromItems(this.items),this._adjustRowsCols(a)},_processSelectionLayers:function(){var a,b,c,d,e,f,g,k={};h.forEach(this.featureLayers,function(e,g){e.mode===y.MODE_SELECTION&&e._map&&e.url&&e._params.drawMode&&!e.source&&(b=n.trim(e._url.path).replace(/\/(MapServer|FeatureServer).*/ig,
"/MapServer").replace(/^https?:\/\//ig,"").toLowerCase(),c=k[b]=k[b]||{},d=c.featureLayers=c.featureLayers||{},f=c.indices=c.indices||[],d[g]=e,f.push(g),a=e._map)});a&&h.forEach(a.layerIds,function(d){(d=a.getLayer(d))&&d.url&&(d.getImageUrl||d.getTileUrl)&&d.loaded&&10.1<=d.version&&(b=n.trim(d._url.path).replace(/(\/MapServer).*/ig,"$1"),e=b.replace(/^https?:\/\//ig,"").toLowerCase(),k[e]&&!k[e].mapServiceUrl&&(c=k[e],c.mapServiceUrl=b,c.mapServiceLayer=d,this._legendIndices=this._legendIndices.concat(c.indices),
g=this._fetchLegend({pickerInstance:this,info:c},e),g.then?(this._loadingIndices=this._loadingIndices.concat(c.indices),this._loadingLegends.push(g)):this._processLegendResponse(g,c)))},this)},_fetchLegend:function(a,b){var c=M.prototype,d=c.legendCache[b];d?d.then&&d._contexts.push(a):(d=c.legendCache[b]=F({url:a.info.mapServiceUrl+"/legend",content:{f:"json"},callbackParamName:"callback"}),d._contexts=[a],d.addBoth(function(a){if(!d.canceled){c.legendCache[b]=a;var e=d._contexts;d._contexts=null;
h.forEach(e,function(b){var c=b.pickerInstance;b=b.info;var e;c._destroyed||(h.forEach(b.indices,function(a){e=h.indexOf(c._loadingIndices,a);-1<e&&c._loadingIndices.splice(e,1)}),e=h.indexOf(c._loadingLegends,d),-1<e&&c._loadingLegends.splice(e,1),c._processLegendResponse(a,b))})}}));return d},_clearLegendInfo:function(){clearTimeout(this._legendTimer);this._ignoreLegends();this._legendIndices=this._loadingIndices=this._legendSymbols=this._loadingLegends=this._legendTimer=null},_ignoreLegends:function(){this._loadingLegends&&
h.forEach(this._loadingLegends,function(a){var b=-1;h.some(a._contexts,function(a,c){a.pickerInstance===this&&(b=c);return-1<b},this);-1<b&&a._contexts.splice(b,1)},this)},_processLegendResponse:function(a,b){if(!a||a instanceof Error){var c;h.forEach(b.indices,function(a){c=h.indexOf(this._legendIndices,a);-1<c&&this._legendIndices.splice(c,1)},this)}else h.forEach(b.indices,function(c){var d=b.featureLayers[c].layerId,e,f=b.mapServiceUrl+"/"+d+"/images/",g=b.mapServiceLayer._getToken(),k,l,m,q;
this._legendSymbols[c]||(k=null,h.some(a.layers,function(a){a.layerId==d&&(k=a);return!!k}),k&&(l=this._legendSymbols[c]={},h.forEach(k.legend,function(a){if((m=a.values)&&m.length)for(e=0;e<m.length;e++)l[m[e]]=a;else l.defaultSymbol=a;(q=a.url)&&!a._fixed&&(a._fixed=1,-1===q.search(/https?\:/)&&(a.url=f+q),g&&-1!==a.url.search(/https?\:/)&&(a.url+=(-1<a.url.indexOf("?")?"\x26":"?")+"token\x3d"+g))})))},this);var d=this;d._started&&!d._legendTimer&&(d._legendTimer=setTimeout(function(){clearTimeout(d._legendTimer);
d._legendTimer=null;d._destroyed||d.update()},0))},_applyGridPatches:function(){var a=this.grid,b=a.adaptWidth,c,d,e;a.adaptWidth=function(){c=this.views.views;for(d=0;e=c[d];d++)v.set(e.headerNode,"display","block");b.apply(this,arguments);for(d=0;e=c[d];d++)v.set(e.headerNode,"display","none")};if(this._dojo14x){if("auto"!==this.rows&&"auto"!==this.columns)var f=p.connect(a,"_onFetchComplete",this,function(){p.disconnect(f);this.grid.set("autoHeight",this._rows)});p.connect(a,"_onDelete",this,this._destroyItems);
p.connect(a,"_clearData",this,this._destroyItems);p.connect(a,"destroy",this,this._destroyItems);(a=a.focus)&&a.findAndFocusGridCell&&(a.findAndFocusGridCell=function(){return!1})}},_setGridLayout:function(){var a=function(a){return function(b,c){return this._cellGet(a,b,c)}},b=n.hitch(this,this._cellFormatter),c=[],d=this._columns,e;for(e=0;e<d;e++)c.push({field:"cell"+e,get:n.hitch(this,a(e)),formatter:b});a={cells:[c]};this.grouping&&(d={field:"groupName",colSpan:d,get:n.hitch(this,this._cellGetGroup),
formatter:n.hitch(this,this._cellGroupFormatter)},a.cells.push([d]));d=this.grid;b=u.prototype.rowsPerPage;d.set("rowsPerPage",this._rows>b?this._rows:b);d.set("structure",a)},_setGridData:function(){var a=[];if(this.grouping){this._groupRowIndices=[];var b,c,d=this._columns;h.forEach(this._flItems,function(e,f){a.push({});var g=0===f?0:b+c+1;this._groupRowIndices.push(g);b=g;c=Math.ceil(e.length/d);a=a.concat(this._getStoreItems(e))},this)}else this.featureLayers?(h.forEach(this._flItems,function(b){a=
a.concat(b)}),a=this._getStoreItems(a)):a=this._getStoreItems(this._itItems);var e=new q({data:{items:a}});this.grid.setStore(e)},_toggleTooltip:function(){if(this.showTooltip){if(!this.tooltip){this.tooltip=l.create("div",{"class":"esriMapTooltip"},this.domNode);this.tooltip.style.display="none";this.tooltip.style.position="fixed";var a=this.grid;this._mouseOverConnect=p.connect(a,"onCellMouseOver",this,this._cellMouseOver);this._mouseOutConnect=p.connect(a,"onCellMouseOut",this,this._cellMouseOut)}}else this.tooltip&&
(p.disconnect(this._mouseOverConnect),p.disconnect(this._mouseOutConnect),l.destroy(this.tooltip),this.tooltip=null)},_rowClicked:function(b,c){var d=b.cellNode,e=b.rowIndex,f=b.cellIndex,g=this._getCellInfo(d,e,f);if(g){var h=this.grid.store;if(!h.getValue(g,"loadingCell")&&(this._selectedCell&&a.remove(this._selectedCell,"selectedItem"),d!==this._selectedCell?(a.add(d,"selectedItem"),this._selectedCell=d,this._selectedItem={featureLayer:h.getValue(g,"layer"),type:h.getValue(g,"type"),template:h.getValue(g,
"template"),symbolInfo:h.getValue(g,"symbolInfo"),item:this._getItem(g)},this._selectedInfo={selRow:e,selCol:f,index1:h.getValue(g,"index1"),index2:h.getValue(g,"index2"),index:h.getValue(g,"index")}):this._selectedCell=this._selectedInfo=this._selectedItem=null,!c))this.onSelectionChange()}},_locate:function(a,b,c){var d=this.grid.store,e=Array(this._columns),f,g=b.index1,k=b.index2,l=b.index,m=a.item;h.some(c,function(a,b){return h.some(e,function(c,e){var h=d.getValue(a,"cell"+e);return h&&(m?
l===d.getValue(h,"index"):g===d.getValue(h,"index1")&&k===d.getValue(h,"index2"))?(f=[b,e],!0):!1})});return f},_getCellInfo:function(a,b,c){if(a)return a=this.grid,b=a.getItem(b),a.store.getValue(b,"cell"+c)},_getItem:function(a){var b=this.items;if(b)return b[this.grid.store.getValue(a,"index")]},_cellMouseOver:function(a){var b=this.tooltip,c=a.cellNode,d=this._getCellInfo(c,a.rowIndex,a.cellIndex);if(b&&d){var e=this.grid.store;a=e.getValue(d,"template");var f=e.getValue(d,"type"),g=e.getValue(d,
"symbolInfo"),e=e.getValue(d,"layer");a=(d=this._getItem(d))&&d.label+(d.description?": "+d.description:"")||a&&a.name+(a.description?": "+a.description:"")||f&&f.name||g&&g.label+(g.description?": "+g.description:"")||(e&&e.name+": ")+"Default";b.style.display="none";b.innerHTML=a;c=m.coords(c.firstChild);v.set(b,{left:c.x+"px",top:c.y+c.h+5+"px"});b.style.display=""}},_cellMouseOut:function(){var a=this.tooltip;a&&(a.style.display="none")},_destroyItems:function(){var a=this._itemWidgets,b;for(b in a)a[b]&&
(a[b].destroy(),delete a[b])},_repaintItems:function(){var a=this._itemWidgets,b;for(b in a){var c=a[b];c&&c._repaint(c._surface)}},_getStoreItems:function(a){var b=this._uniqueId;a=h.map(a,function(a){return n.mixin({surfaceId:"tpick-surface-"+b.id++},a)});for(var c=a.length,d=0,e={},f=0,g,k=[],l=!0,m=this._columns;d<c;)l=!0,g="cell"+f,e[g]=a[d],d++,f++,0===f%m&&(l=!1,k.push(e),e={},f=0);l&&c&&k.push(e);return k},_getItemsFromLayers:function(a){var b=[];h.forEach(a,function(a,c){b.push(this._getItemsFromLayer(a,
c))},this);return b},_getItemsFromLayer:function(a,b){var d=[];if(this.useLegend&&-1<h.indexOf(this._loadingIndices,b))return[{label:this._nls&&this._nls.loading||"",symbol:null,layer:a,type:null,template:null,index1:b,index2:0,loadingCell:1}];var f=[],f=f.concat(a.templates);h.forEach(a.types,function(a){var b=a.templates;h.forEach(b,function(b){b._type_=a});f=f.concat(b)});var f=h.filter(f,D.isDefined),g=a.renderer;if(g){var k=g.declaredClass.replace("esri.renderer.","");if(0<f.length)h.forEach(f,
function(f){var l=f.prototype;if(l){var m;if(m=g.valueExpression?this._createSimpleSymbol(a):this._isUnclassedRenderer(g)?g.infos[0].symbol:g.getSymbol(l)){var q=null,n;if(!(9>c("ie"))&&f.thumbnail&&f.thumbnail.imageData)q=new x(f.thumbnail);else if(this.useLegend&&-1<h.indexOf(this._legendIndices,b)){if(n=this._legendSymbols&&this._legendSymbols[b])switch(k){case "SimpleRenderer":q=n.defaultSymbol;break;case "UniqueValueRenderer":h.some(g.infos,function(a){a.symbol===m&&(q=n[a.value]);return!!q});
break;case "ClassBreaksRenderer":h.some(g.infos,function(a){a.symbol===m&&(q=n[a.maxValue]);return!!q})}q&&(l=e.fromJson(e.toJson(x.defaultProps)),l.url=q.url,l.imageData=q.imageData,l.contentType=q.contentType,l.width=q.width,l.height=q.height,D.isDefined(l.width)&&D.isDefined(l.height)||(l.width=15,l.height=15),q=new x(l))}d.push({label:this._trimLabel(f.name),symbol:q||m,legendOverride:!!q,layer:a,type:f._type_,template:f,index1:b,index2:d.length})}else switch(k){case "HeatmapRenderer":d.push({label:this._trimLabel(f.name),
symbol:new B,legendOverride:!!q,layer:a,type:f._type_,template:f,index1:b,index2:d.length})}}delete f._type_},this);else{var l=[];"TemporalRenderer"===k&&(g=g.observationRenderer)&&(k=g.declaredClass.replace("esri.renderer.",""));switch(k){case "SimpleRenderer":l=[{symbol:g.symbol,label:g.label,description:g.description}];break;case "UniqueValueRenderer":case "ClassBreaksRenderer":l=g.infos}d=h.map(l,function(c,d){return{label:this._trimLabel(c.label),description:c.description,symbolInfo:n.mixin({constructor:function(){}},
c),symbol:c.symbol,layer:a,index1:b,index2:d}},this)}}return d},_isUnclassedRenderer:function(a){return!!((a.hasVisualVariables("sizeInfo",!1)||a.hasVisualVariables("colorInfo",!1)||a.hasVisualVariables("opacityInfo",!1))&&a.addBreak&&a.infos&&1===a.infos.length)},_createSimpleSymbol:function(a){var b;switch(a.geometryType){case "esriGeometryPoint":case "esriGeometryMultipoint":b=new B;break;case "esriGeometryPolyline":b=new z;break;case "esriGeometryPolygon":b=new w;break;default:a.hasXYFootprint&&
a.hasXYFootprint()&&(b=new w)}return b},_getItemsFromItems:function(a){return h.map(a,function(a,b){a=n.mixin({index:b},a);a.label=this._trimLabel(a.label);return a},this)},_trimLabel:function(a){var b=this.maxLabelLength;b&&a&&a.length>b&&(a=a.substr(0,b)+"...");return a||""},_cellGet:function(a,b,c){return c?this.grid.store.getValue(c,"cell"+a):""},_cellFormatter:function(a){if(a){var b=this._itemWidgets,c=this.grid.store,d=c.getValue(a,"surfaceId"),e=b[d];e||(e=b[d]=new E({id:d,label:c.getValue(a,
"label"),symbol:c.getValue(a,"symbol"),legendOverride:c.getValue(a,"legendOverride"),surfaceWidth:this.surfaceWidth,surfaceHeight:this.surfaceHeight,template:c.getValue(a,"template")}));return e||""}return""},_cellGetGroup:function(a,b){if(!this._groupRowIndices)return"";var c=h.indexOf(this._groupRowIndices,a);return b&&-1!==c?(c=this.featureLayers[c])&&(this.groupLabelFunction?this.groupLabelFunction(c):c.name)||"":""},_cellGroupFormatter:function(a){return a?"\x3cdiv class\x3d'groupLabel'\x3e"+
a+"\x3c/div\x3e":""}});d("extend-esri")&&n.setObject("dijit.editing.TemplatePicker",M,C);return M})},"dojox/grid/DataGrid":function(){define("../main dojo/_base/array dojo/_base/lang dojo/_base/json dojo/_base/sniff dojo/_base/declare ./_Grid ./DataSelection dojo/_base/html dojo/has dojo/has!dojo-bidi?./bidi/_BidiMixin".split(" "),function(r,n,p,m,h,e,k,d,g){var c=e("dojox.grid.DataGrid",k,{store:null,query:null,queryOptions:null,fetchText:"...",sortFields:null,updateDelay:1,items:null,_store_connects:null,
_by_idty:null,_by_idx:null,_cache:null,_pages:null,_pending_requests:null,_bop:-1,_eop:-1,_requests:0,rowCount:0,_isLoaded:!1,_isLoading:!1,keepSelection:!1,postCreate:function(){this._pages=[];this._store_connects=[];this._by_idty={};this._by_idx=[];this._cache=[];this._pending_requests={};this._setStore(this.store);this.inherited(arguments)},destroy:function(){this.selection.destroy();this.inherited(arguments)},createSelection:function(){this.selection=new d(this)},get:function(a,c){if(c&&"_item"==
this.field&&!this.fields)return c;if(c&&this.fields){var d=[],e=this.grid.store;n.forEach(this.fields,function(a){d=d.concat(e.getValues(c,a))});return d}return c||"string"!==typeof a?c?this.field?"_item"==this.field?c:this.grid.store.getValue(c,this.field):this.value:this.defaultValue:this.inherited(arguments)},_checkUpdateStatus:function(){if(0<this.updateDelay){var a=!1;this._endUpdateDelay&&(clearTimeout(this._endUpdateDelay),delete this._endUpdateDelay,a=!0);this.updating||(this.beginUpdate(),
a=!0);if(a){var c=this;this._endUpdateDelay=setTimeout(function(){delete c._endUpdateDelay;c.endUpdate()},this.updateDelay)}}},_onSet:function(a,c,d,e){this._checkUpdateStatus();a=this.getItemIndex(a);-1<a&&this.updateRow(a)},_createItem:function(a,c){var d=this._hasIdentity?this.store.getIdentity(a):m.toJson(this.query)+":idx:"+c+":sort:"+m.toJson(this.getSortProps());return this._by_idty[d]={idty:d,item:a}},_addItem:function(a,c,d){this._by_idx[c]=this._createItem(a,c);d||this.updateRow(c)},_onNew:function(a,
c){this._checkUpdateStatus();var d=this.get("rowCount");this._addingItem=!0;this.updateRowCount(d+1);this._addingItem=!1;this._addItem(a,d);this.showMessage()},_onDelete:function(a){this._checkUpdateStatus();a=this._getItemIndex(a,!0);if(0<=a){this._pages=[];this._eop=this._bop=-1;var c=this._by_idx[a];this._by_idx.splice(a,1);delete this._by_idty[c.idty];this.updateRowCount(this.get("rowCount")-1);0===this.get("rowCount")&&this.showMessage(this.noDataMessage)}this.selection.isSelected(a)&&(this.selection.deselect(a),
this.selection.selected.splice(a,1))},_onRevert:function(){this._refresh()},setStore:function(a,c,d){this._requestsPending(0)||(this._setQuery(c,d),this._setStore(a),this._refresh(!0))},setQuery:function(a,c){this._requestsPending(0)||(this._setQuery(a,c),this._refresh(!0))},setItems:function(a){this.items=a;this._setStore(this.store);this._refresh(!0)},_setQuery:function(a,c){this.query=a;this.queryOptions=c||this.queryOptions},_setStore:function(a){this.store&&this._store_connects&&n.forEach(this._store_connects,
this.disconnect,this);if(this.store=a){a=this.store.getFeatures();var c=[];this._canEdit=!!a["dojo.data.api.Write"]&&!!a["dojo.data.api.Identity"];this._hasIdentity=!!a["dojo.data.api.Identity"];a["dojo.data.api.Notification"]&&!this.items&&(c.push(this.connect(this.store,"onSet","_onSet")),c.push(this.connect(this.store,"onNew","_onNew")),c.push(this.connect(this.store,"onDelete","_onDelete")));this._canEdit&&c.push(this.connect(this.store,"revert","_onRevert"));this._store_connects=c}},_onFetchBegin:function(a,
c){this.scroller&&(this.rowCount!=a&&(c.isRender?(this.scroller.init(a,this.keepRows,this.rowsPerPage),this.rowCount=a,this._setAutoHeightAttr(this.autoHeight,!0),this._skipRowRenormalize=!0,this.prerender(),this._skipRowRenormalize=!1):this.updateRowCount(a)),a?this.showMessage():(this.views.render(),this._resize(),this.showMessage(this.noDataMessage),this.focus.initFocusView()))},_onFetchComplete:function(a,c){this.scroller&&(a&&0<a.length&&(n.forEach(a,function(a,d){this._addItem(a,c.start+d,!0)},
this),this.updateRows(c.start,a.length),c.isRender?(this.setScrollTop(0),this.postrender()):this._lastScrollTop&&this.setScrollTop(this._lastScrollTop),h("ie")&&g.setSelectable(this.domNode,this.selectable)),delete this._lastScrollTop,this._isLoaded||(this._isLoading=!1,this._isLoaded=!0),this._pending_requests[c.start]=!1)},_onFetchError:function(a,c){console.log(a);delete this._lastScrollTop;this._isLoaded||(this._isLoading=!1,this._isLoaded=!0,this.showMessage(this.errorMessage));this._pending_requests[c.start]=
!1;this.onFetchError(a,c)},onFetchError:function(a,c){},_fetch:function(a,c){a=a||0;if(this.store&&!this._pending_requests[a]){this._isLoaded||this._isLoading||(this._isLoading=!0,this.showMessage(this.loadingMessage));this._pending_requests[a]=!0;try{if(this.items){var d=this.items,e=this.store;this.rowsPerPage=d.length;var f={start:a,count:this.rowsPerPage,isRender:c};this._onFetchBegin(d.length,f);var b=0;n.forEach(d,function(a){e.isItemLoaded(a)||b++});if(0===b)this._onFetchComplete(d,f);else{var g=
function(a){b--;0===b&&this._onFetchComplete(d,f)};n.forEach(d,function(a){e.isItemLoaded(a)||e.loadItem({item:a,onItem:g,scope:this})},this)}}else this.store.fetch({start:a,count:this.rowsPerPage,query:this.query,sort:this.getSortProps(),queryOptions:this.queryOptions,isRender:c,onBegin:p.hitch(this,"_onFetchBegin"),onComplete:p.hitch(this,"_onFetchComplete"),onError:p.hitch(this,"_onFetchError")})}catch(u){this._onFetchError(u,{start:a,count:this.rowsPerPage})}}},_clearData:function(){this.updateRowCount(0);
this._by_idty={};this._by_idx=[];this._pages=[];this._bop=this._eop=-1;this._isLoading=this._isLoaded=!1},getItem:function(a){var c=this._by_idx[a];return!c||c&&!c.item?(this._preparePage(a),null):c.item},getItemIndex:function(a){return this._getItemIndex(a,!1)},_getItemIndex:function(a,c){if(!c&&!this.store.isItem(a))return-1;for(var d=this._hasIdentity?this.store.getIdentity(a):null,e=0,f=this._by_idx.length;e<f;e++){var b=this._by_idx[e];if(b&&(d&&b.idty==d||b.item===a))return e}return-1},filter:function(a,
c){this.query=a;c&&this._clearData();this._fetch()},_getItemAttr:function(a,c){var d=this.getItem(a);return d?this.store.getValue(d,c):this.fetchText},_render:function(){this.domNode.parentNode&&(this.scroller.init(this.get("rowCount"),this.keepRows,this.rowsPerPage),this.prerender(),this._fetch(0,!0))},_requestsPending:function(a){return this._pending_requests[a]},_rowToPage:function(a){return this.rowsPerPage?Math.floor(a/this.rowsPerPage):a},_pageToRow:function(a){return this.rowsPerPage?this.rowsPerPage*
a:a},_preparePage:function(a){(a<this._bop||a>=this._eop)&&!this._addingItem&&(a=this._rowToPage(a),this._needPage(a),this._bop=a*this.rowsPerPage,this._eop=this._bop+(this.rowsPerPage||this.get("rowCount")))},_needPage:function(a){this._pages[a]||(this._pages[a]=!0,this._requestPage(a))},_requestPage:function(a){a=this._pageToRow(a);0<Math.min(this.rowsPerPage,this.get("rowCount")-a)&&(this._requests++,this._requestsPending(a)||setTimeout(p.hitch(this,"_fetch",a,!1),1))},getCellName:function(a){return a.field},
_refresh:function(a){this._clearData();this._fetch(0,a)},sort:function(){this.edit.apply();this._lastScrollTop=this.scrollTop;this._refresh()},canSort:function(){return!this._isLoading},getSortProps:function(){var a=this.getCell(this.getSortIndex());if(a){var c=a.sortDesc,d=!(0<this.sortInfo);return[{attribute:a.field,descending:"undefined"==typeof c?d:d?!c:c}]}return this.sortFields?this.sortFields:null},styleRowState:function(a){if(this.store&&this.store.getState){for(var c=this.store.getState(a.index),
d="",e=0,f=["inflight","error","inserting"],b;b=f[e];e++)if(c[b]){d=" dojoxGridRow-"+b;break}a.customClasses+=d}},onStyleRow:function(a){this.styleRowState(a);this.inherited(arguments)},canEdit:function(a,c){return this._canEdit},_copyAttr:function(a,c){var d=this.getItem(a);return this.store.getValue(d,c)},doStartEdit:function(a,c){this._cache[c]||(this._cache[c]=this._copyAttr(c,a.field));this.onStartEdit(a,c)},doApplyCellEdit:function(a,c,d){this.store.fetchItemByIdentity({identity:this._by_idx[c].idty,
onItem:p.hitch(this,function(e){var f=this.store.getValue(e,d);"number"==typeof f?a=isNaN(a)?a:parseFloat(a):"boolean"==typeof f?a="true"==a?!0:"false"==a?!1:a:f instanceof Date&&(f=new Date(a),a=isNaN(f.getTime())?a:f);this.store.setValue(e,d,a);this.onApplyCellEdit(a,c,d)})})},doCancelEdit:function(a){this._cache[a]&&(this.updateRow(a),delete this._cache[a]);this.onCancelEdit.apply(this,arguments)},doApplyEdit:function(a,c){this.onApplyEdit(a)},removeSelectedRows:function(){if(this._canEdit){this.edit.apply();
var a=p.hitch(this,function(a){a.length&&(n.forEach(a,this.store.deleteItem,this.store),this.selection.clear())});this.allItemsSelected?this.store.fetch({query:this.query,queryOptions:this.queryOptions,onComplete:a}):a(this.selection.getSelected())}}});c.cell_markupFactory=function(a,c,d){var e=p.trim(g.attr(c,"field")||"");e&&(d.field=e);d.field=d.field||d.name;if(e=p.trim(g.attr(c,"fields")||""))d.fields=e.split(",");a&&a(c,d)};c.markupFactory=function(a,d,e,g){return k.markupFactory(a,d,e,p.partial(c.cell_markupFactory,
g))};return c})},"dojox/grid/_Grid":function(){define("dojo/_base/kernel ../main dojo/_base/declare ./_Events ./_Scroller ./_Layout ./_View ./_ViewManager ./_RowManager ./_FocusManager ./_EditManager ./Selection ./_RowSelector ./util dijit/_Widget dijit/_TemplatedMixin dijit/CheckedMenuItem dojo/text!./resources/_Grid.html dojo/string dojo/_base/array dojo/_base/lang dojo/_base/sniff dojox/html/metrics dojo/_base/html dojo/query dojo/dnd/common dojo/i18n!dijit/nls/loading".split(" "),function(r,n,
p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A,y,B,x,w,z,E){r.isCopyKey||(r.isCopyKey=r.dnd.getCopyKeyState);p=p("dojox.grid._Grid",[f,b,m],{templateString:u,classTag:"dojoxGrid",rowCount:5,keepRows:75,rowsPerPage:25,autoWidth:!1,initialWidth:"",autoHeight:"",rowHeight:0,autoRender:!0,defaultHeight:"15em",height:"",structure:null,elasticView:-1,singleClickEdit:!1,selectionMode:"extended",rowSelector:"",columnReordering:!1,headerMenu:null,placeholderLabel:"GridColumns",selectable:!1,_click:null,loadingMessage:"\x3cspan class\x3d'dojoxGridLoading'\x3e${loadingState}\x3c/span\x3e",
errorMessage:"\x3cspan class\x3d'dojoxGridError'\x3e${errorState}\x3c/span\x3e",noDataMessage:"",escapeHTMLInData:!0,formatterScope:null,editable:!1,summary:"",_setSummaryAttr:"domNode",sortInfo:0,_placeholders:null,_layoutClass:e,buildRendering:function(){this.inherited(arguments);this.domNode.getAttribute("tabIndex")||(this.domNode.tabIndex="0");this.createScroller();this.createLayout();this.createViews();this.createManagers();this.createSelection();this.connect(this.selection,"onSelected","onSelected");
this.connect(this.selection,"onDeselected","onDeselected");this.connect(this.selection,"onChanged","onSelectionChanged");w.initOnFontResize();this.connect(w,"onFontResize","textSizeChanged");v.funnelEvents(this.domNode,this,"doKeyEvent",v.keyEvents);"none"!=this.selectionMode&&this.domNode.setAttribute("aria-multiselectable","single"==this.selectionMode?"false":"true");z.addClass(this.domNode,this.classTag);this.isLeftToRight()||z.addClass(this.domNode,this.classTag+"Rtl");0<this.rowHeight&&z.addClass(this.viewsNode,
this.classTag+"FixedRowHeight")},postMixInProperties:function(){this.inherited(arguments);var a=r.i18n.getLocalization("dijit","loading",this.lang);this.loadingMessage=A.substitute(this.loadingMessage,a);this.errorMessage=A.substitute(this.errorMessage,a);this.srcNodeRef&&this.srcNodeRef.style.height&&(this.height=this.srcNodeRef.style.height);this._setAutoHeightAttr(this.autoHeight,!0);this.lastScrollTop=this.scrollTop=0},postCreate:function(){this._placeholders=[];this._setHeaderMenuAttr(this.headerMenu);
this._setStructureAttr(this.structure);this._click=[];this.inherited(arguments);this.domNode&&this.autoWidth&&this.initialWidth&&(this.domNode.style.width=this.initialWidth);this.domNode&&!this.editable&&z.attr(this.domNode,"aria-readonly","true")},destroy:function(){this.domNode.onReveal=null;this.domNode.onSizeChange=null;delete this._click;this.scroller&&(this.scroller.destroy(),delete this.scroller);this.edit.destroy();delete this.edit;this.views.destroyViews();this.focus&&(this.focus.destroy(),
delete this.focus);this.headerMenu&&this._placeholders.length&&(y.forEach(this._placeholders,function(a){a.unReplace(!0)}),this.headerMenu.unBindDomNode(this.viewsHeaderNode));this.inherited(arguments)},_setAutoHeightAttr:function(a,b){"string"==typeof a&&(a=a&&"false"!=a?"true"==a?!0:window.parseInt(a,10):!1);"number"==typeof a&&(isNaN(a)&&(a=!1),0>a?a=!0:0===a&&(a=!1));this.autoHeight=a;this._autoHeight="boolean"==typeof a?a:"number"==typeof a?a>=this.get("rowCount"):!1;this._started&&!b&&this.render()},
_getRowCountAttr:function(){return this.updating&&this.invalidated&&void 0!=this.invalidated.rowCount?this.invalidated.rowCount:this.rowCount},textSizeChanged:function(){this.render()},sizeChange:function(){this.update()},createManagers:function(){this.rows=new g(this);this.focus=new c(this);this.edit=new a(this)},createSelection:function(){this.selection=new l(this)},createScroller:function(){this.scroller=new h;this.scroller.grid=this;this.scroller.renderRow=B.hitch(this,"renderRow");this.scroller.removeRow=
B.hitch(this,"rowRemoved")},createLayout:function(){this.layout=new this._layoutClass(this);this.connect(this.layout,"moveColumn","onMoveColumn")},onMoveColumn:function(){this.update()},onResizeColumn:function(a){},createViews:function(){this.views=new d(this);this.views.createView=B.hitch(this,"createView")},createView:function(a,b){var c=new (B.getObject(a))({grid:this,index:b});this.viewsNode.appendChild(c.domNode);this.viewsHeaderNode.appendChild(c.headerNode);this.views.addView(c);z.attr(this.domNode,
"align",this.isLeftToRight()?"left":"right");return c},buildViews:function(){for(var a=0,b;b=this.layout.structure[a];a++)this.createView(b.type||n._scopeName+".grid._View",a).setStructure(b);this.scroller.setContentNodes(this.views.getContentNodes())},_setStructureAttr:function(a){a&&B.isString(a)&&(r.deprecated("dojox.grid._Grid.set('structure', 'objVar')","use dojox.grid._Grid.set('structure', objVar) instead","2.0"),a=B.getObject(a));this.structure=a;if(!a)if(this.layout.structure)a=this.layout.structure;
else return;this.views.destroyViews();this.focus.focusView=null;a!==this.layout.structure&&this.layout.setStructure(a);this._structureChanged()},setStructure:function(a){r.deprecated("dojox.grid._Grid.setStructure(obj)","use dojox.grid._Grid.set('structure', obj) instead.","2.0");this._setStructureAttr(a)},getColumnTogglingItems:function(){var a,b=[];a=y.map(this.layout.cells,function(a){a.menuItems||(a.menuItems=[]);var c=this,d=new q({label:a.name,checked:!a.hidden,_gridCell:a,onChange:function(a){if(c.layout.setColumnVisibility(this._gridCell.index,
a)){var b=this._gridCell.menuItems;1<b.length&&y.forEach(b,function(b){b!==this&&b.setAttribute("checked",a)},this);a=y.filter(c.layout.cells,function(a){1<a.menuItems.length?y.forEach(a.menuItems,"item.set('disabled', false);"):a.menuItems[0].set("disabled",!1);return!a.hidden});1==a.length&&y.forEach(a[0].menuItems,"item.set('disabled', true);")}},destroy:function(){var a=y.indexOf(this._gridCell.menuItems,this);this._gridCell.menuItems.splice(a,1);delete this._gridCell;q.prototype.destroy.apply(this,
arguments)}});a.menuItems.push(d);a.hidden||b.push(d);return d},this);1==b.length&&b[0].set("disabled",!0);return a},_setHeaderMenuAttr:function(a){this._placeholders&&this._placeholders.length&&(y.forEach(this._placeholders,function(a){a.unReplace(!0)}),this._placeholders=[]);this.headerMenu&&this.headerMenu.unBindDomNode(this.viewsHeaderNode);if(this.headerMenu=a)this.headerMenu.bindDomNode(this.viewsHeaderNode),this.headerMenu.getPlaceholders&&(this._placeholders=this.headerMenu.getPlaceholders(this.placeholderLabel))},
setHeaderMenu:function(a){r.deprecated("dojox.grid._Grid.setHeaderMenu(obj)","use dojox.grid._Grid.set('headerMenu', obj) instead.","2.0");this._setHeaderMenuAttr(a)},setupHeaderMenu:function(){this._placeholders&&this._placeholders.length&&y.forEach(this._placeholders,function(a){a._replaced&&a.unReplace(!0);a.replace(this.getColumnTogglingItems())},this)},_fetch:function(a){this.setScrollTop(0)},getItem:function(a){return null},showMessage:function(a){a?(this.messagesNode.innerHTML=a,this.messagesNode.style.display=
""):(this.messagesNode.innerHTML="",this.messagesNode.style.display="none")},_structureChanged:function(){this.buildViews();this.autoRender&&this._started&&this.render()},hasLayout:function(){return this.layout.cells.length},resize:function(a,b){this._pendingChangeSize=a;this._pendingResultSize=b;this.sizeChange()},_getPadBorder:function(){return this._padBorder=this._padBorder||z._getPadBorderExtents(this.domNode)},_getHeaderHeight:function(){var a=this.viewsHeaderNode.style,b="none"==a.display?
0:this.views.measureHeader();a.height=b+"px";this.views.normalizeHeaderNodeHeight();return b},_resize:function(a,b){a=a||this._pendingChangeSize;b=b||this._pendingResultSize;delete this._pendingChangeSize;delete this._pendingResultSize;if(this.domNode){var c=this.domNode.parentNode;if(c&&1==c.nodeType&&this.hasLayout()&&"hidden"!=c.style.visibility&&"none"!=c.style.display){var d=this._getPadBorder(),e=void 0,f;this._autoHeight?this.domNode.style.height="auto":"number"==typeof this.autoHeight?(f=
e=this._getHeaderHeight(),f+=this.scroller.averageRowHeight*this.autoHeight,this.domNode.style.height=f+"px"):this.domNode.clientHeight<=d.h&&(c==document.body?this.domNode.style.height=this.defaultHeight:this.height?this.domNode.style.height=this.height:this.fitTo="parent");b&&(a=b);!this._autoHeight&&a?(z.marginBox(this.domNode,a),this.height=this.domNode.style.height,delete this.fitTo):"parent"==this.fitTo&&(f=this._parentContentBoxHeight=0<this._parentContentBoxHeight?this._parentContentBoxHeight:
z._getContentBox(c).h,this.domNode.style.height=Math.max(0,f)+"px");c=y.some(this.views.views,function(a){return a.flexCells});this._autoHeight||0!==(f||z._getContentBox(this.domNode).h)?(this.viewsHeaderNode.style.display="block",c||void 0!==e||(e=this._getHeaderHeight())):this.viewsHeaderNode.style.display="none";c&&(e=void 0);this.adaptWidth();this.adaptHeight(e);this.postresize()}}},adaptWidth:function(){var a=!this.initialWidth&&this.autoWidth,b=a?0:this.domNode.clientWidth||this.domNode.offsetWidth-
this._getPadBorder().w,b=this.views.arrange(1,b);this.views.onEach("adaptWidth");a&&(this.domNode.style.width=b+"px")},adaptHeight:function(a){a=void 0===a?this._getHeaderHeight():a;var b=this._autoHeight?-1:Math.max(this.domNode.clientHeight-a,0)||0;this.views.onEach("setSize",[0,b]);this.views.onEach("adaptHeight");if(!this._autoHeight){var c=0,d=0,e=y.filter(this.views.views,function(a){(a=a.hasHScrollbar())?c++:d++;return!a});0<c&&0<d&&y.forEach(e,function(a){a.adaptHeight(!0)})}!0===this.autoHeight||
-1!=b||"number"==typeof this.autoHeight&&this.autoHeight>=this.get("rowCount")?this.scroller.windowHeight=b:this.scroller.windowHeight=Math.max(this.domNode.clientHeight-a,0)},startup:function(){this._started||(this.inherited(arguments),this.autoRender&&this.render())},render:function(){this.domNode&&this._started&&(this.hasLayout()?(this.update=this.defaultUpdate,this._render()):this.scroller.init(0,this.keepRows,this.rowsPerPage))},_render:function(){this.scroller.init(this.get("rowCount"),this.keepRows,
this.rowsPerPage);this.prerender();this.setScrollTop(0);this.postrender()},prerender:function(){this.keepRows=this._autoHeight?0:this.keepRows;this.scroller.setKeepInfo(this.keepRows);this.views.render();this._resize()},postrender:function(){this.postresize();this.focus.initFocusView();z.setSelectable(this.domNode,this.selectable)},postresize:function(){if(this._autoHeight){var a=Math.max(this.views.measureContent())+"px";this.viewsNode.style.height=a}},renderRow:function(a,b){this.views.renderRow(a,
b,this._skipRowRenormalize)},rowRemoved:function(a){this.views.rowRemoved(a)},invalidated:null,updating:!1,beginUpdate:function(){this.invalidated=[];this.updating=!0},endUpdate:function(){this.updating=!1;var a=this.invalidated,b;if(a.all)this.update();else if(void 0!=a.rowCount)this.updateRowCount(a.rowCount);else for(b in a)this.updateRow(Number(b));this.invalidated=[]},defaultUpdate:function(){this.domNode&&(this.updating?this.invalidated.all=!0:(this.lastScrollTop=this.scrollTop,this.prerender(),
this.scroller.invalidateNodes(),this.setScrollTop(this.lastScrollTop),this.postrender()))},update:function(){this.render()},updateRow:function(a){a=Number(a);this.updating?this.invalidated[a]=!0:(this.views.updateRow(a),this.scroller.rowHeightChanged(a))},updateRows:function(a,b){a=Number(a);b=Number(b);var c;if(this.updating)for(c=0;c<b;c++)this.invalidated[c+a]=!0;else{for(c=0;c<b;c++)this.views.updateRow(c+a,this._skipRowRenormalize);this.scroller.rowHeightChanged(a)}},updateRowCount:function(a){this.updating?
this.invalidated.rowCount=a:(this.rowCount=a,this._setAutoHeightAttr(this.autoHeight,!0),this.layout.cells.length&&this.scroller.updateRowCount(a),this._resize(),this.layout.cells.length&&this.setScrollTop(this.scrollTop))},updateRowStyles:function(a){this.views.updateRowStyles(a)},getRowNode:function(a){if(!this.focus.focusView||this.focus.focusView instanceof t)for(var b=0,c;c=this.views.views[b];b++){if(!(c instanceof t))return c.rowNodes[a]}else return this.focus.focusView.rowNodes[a];return null},
rowHeightChanged:function(a){this.views.renormalizeRow(a);this.scroller.rowHeightChanged(a)},fastScroll:!0,delayScroll:!1,scrollRedrawThreshold:x("ie")?100:50,scrollTo:function(a){if(this.fastScroll){var b=Math.abs(this.lastScrollTop-a);this.lastScrollTop=a;if(b>this.scrollRedrawThreshold||this.delayScroll){this.delayScroll=!0;this.scrollTop=a;this.views.setScrollTop(a);this._pendingScroll&&window.clearTimeout(this._pendingScroll);var c=this;this._pendingScroll=window.setTimeout(function(){delete c._pendingScroll;
c.finishScrollJob()},200)}else this.setScrollTop(a)}else this.setScrollTop(a)},finishScrollJob:function(){this.delayScroll=!1;this.setScrollTop(this.scrollTop)},setScrollTop:function(a){this.scroller.scroll(this.views.setScrollTop(a))},scrollToRow:function(a){this.setScrollTop(this.scroller.findScrollTop(a)+1)},styleRowNode:function(a,b){b&&this.rows.styleRowNode(a,b)},_mouseOut:function(a){this.rows.setOverRow(-2)},getCell:function(a){return this.layout.cells[a]},setCellWidth:function(a,b){this.getCell(a).unitWidth=
b},getCellName:function(a){return"Cell "+a.index},canSort:function(a){},sort:function(){},getSortAsc:function(a){a=void 0==a?this.sortInfo:a;return 0<a},getSortIndex:function(a){a=void 0==a?this.sortInfo:a;return Math.abs(a)-1},setSortIndex:function(a,b){var c=a+1;void 0!=b?c*=b?1:-1:this.getSortIndex()==a&&(c=-this.sortInfo);this.setSortInfo(c)},setSortInfo:function(a){this.canSort(a)&&(this.sortInfo=a,this.sort(),this.update())},doKeyEvent:function(a){a.dispatch="do"+a.type;this.onKeyEvent(a)},
_dispatch:function(a,b){return a in this?this[a](b):!1},dispatchKeyEvent:function(a){this._dispatch(a.dispatch,a)},dispatchContentEvent:function(a){this.edit.dispatchEvent(a)||a.sourceView.dispatchContentEvent(a)||this._dispatch(a.dispatch,a)},dispatchHeaderEvent:function(a){a.sourceView.dispatchHeaderEvent(a)||this._dispatch("doheader"+a.type,a)},dokeydown:function(a){this.onKeyDown(a)},doclick:function(a){if(a.cellNode)this.onCellClick(a);else this.onRowClick(a)},dodblclick:function(a){if(a.cellNode)this.onCellDblClick(a);
else this.onRowDblClick(a)},docontextmenu:function(a){if(a.cellNode)this.onCellContextMenu(a);else this.onRowContextMenu(a)},doheaderclick:function(a){if(a.cellNode)this.onHeaderCellClick(a);else this.onHeaderClick(a)},doheaderdblclick:function(a){if(a.cellNode)this.onHeaderCellDblClick(a);else this.onHeaderDblClick(a)},doheadercontextmenu:function(a){if(a.cellNode)this.onHeaderCellContextMenu(a);else this.onHeaderContextMenu(a)},doStartEdit:function(a,b){this.onStartEdit(a,b)},doApplyCellEdit:function(a,
b,c){this.onApplyCellEdit(a,b,c)},doCancelEdit:function(a){this.onCancelEdit(a)},doApplyEdit:function(a){this.onApplyEdit(a)},addRow:function(){this.updateRowCount(this.get("rowCount")+1)},removeSelectedRows:function(){this.allItemsSelected?this.updateRowCount(0):this.updateRowCount(Math.max(0,this.get("rowCount")-this.selection.getSelected().length));this.selection.clear()}});p.markupFactory=function(a,b,c,d){var e=function(a){a=z.attr(a,"width")||"auto";"auto"!=a&&"em"!=a.slice(-2)&&"%"!=a.slice(-1)&&
(a=parseInt(a,10)+"px");return a};a.structure||"table"!=b.nodeName.toLowerCase()||(a.structure=E("\x3e colgroup",b).map(function(a){var b=z.attr(a,"span"),b={noscroll:"true"==z.attr(a,"noscroll")?!0:!1,__span:b?parseInt(b,10):1,cells:[]};z.hasAttr(a,"width")&&(b.width=e(a));return b}),a.structure.length||a.structure.push({__span:Infinity,cells:[]}),E("thead \x3e tr",b).forEach(function(b,c){var f=0,g=0,h,k=null;E("\x3e th",b).map(function(b){k?f>=h+k.__span&&(g++,h+=k.__span,k=a.structure[g]):(h=
0,k=a.structure[0]);var l={name:B.trim(z.attr(b,"name")||b.innerHTML),colSpan:parseInt(z.attr(b,"colspan")||1,10),type:B.trim(z.attr(b,"cellType")||""),id:B.trim(z.attr(b,"id")||"")};f+=l.colSpan;var m=z.attr(b,"rowspan");m&&(l.rowSpan=m);z.hasAttr(b,"width")&&(l.width=e(b));z.hasAttr(b,"relWidth")&&(l.relWidth=window.parseInt(z.attr(b,"relWidth"),10));z.hasAttr(b,"hidden")&&(l.hidden="true"==z.attr(b,"hidden")||!0===z.attr(b,"hidden"));d&&d(b,l);l.type=l.type?B.getObject(l.type):n.grid.cells.Cell;
l.type&&l.type.markupFactory&&l.type.markupFactory(b,l);k.cells[c]||(k.cells[c]=[]);k.cells[c].push(l)})}));return new c(a,b)};return p})},"dojox/grid/_Events":function(){define(["dojo/keys","dojo/dom-class","dojo/_base/declare","dojo/_base/event","dojo/_base/sniff"],function(r,n,p,m,h){return p("dojox.grid._Events",null,{cellOverClass:"dojoxGridCellOver",onKeyEvent:function(e){this.dispatchKeyEvent(e)},onContentEvent:function(e){this.dispatchContentEvent(e)},onHeaderEvent:function(e){this.dispatchHeaderEvent(e)},
onStyleRow:function(e){e.customClasses+=(e.odd?" dojoxGridRowOdd":"")+(e.selected?" dojoxGridRowSelected":"")+(e.over?" dojoxGridRowOver":"");this.focus.styleRow(e);this.edit.styleRow(e)},onKeyDown:function(e){if(!e.altKey&&!e.metaKey){var h;switch(e.keyCode){case r.ESCAPE:this.edit.cancel();break;case r.ENTER:if(!this.edit.isEditing()){h=this.focus.getHeaderIndex();if(0<=h){this.setSortIndex(h);break}else this.selection.clickSelect(this.focus.rowIndex,dojo.isCopyKey(e),e.shiftKey);m.stop(e)}e.shiftKey||
(h=this.edit.isEditing(),this.edit.apply(),h||this.edit.setEditCell(this.focus.cell,this.focus.rowIndex));this.edit.isEditing()||((this.focus.focusView||this.views.views[0]).content.decorateEvent(e),this.onRowClick(e),m.stop(e));break;case r.SPACE:this.edit.isEditing()||(h=this.focus.getHeaderIndex(),0<=h?this.setSortIndex(h):(this.selection.clickSelect(this.focus.rowIndex,dojo.isCopyKey(e),e.shiftKey),this.focus._focusifyCellNode(!0),this.focus.setFocusCell(this.focus.cell,this.focus.rowIndex),m.stop(e)));
break;case r.TAB:this.focus[e.shiftKey?"previousKey":"nextKey"](e);break;case r.LEFT_ARROW:case r.RIGHT_ARROW:if(!this.edit.isEditing()){var d=e.keyCode;m.stop(e);h=this.focus.getHeaderIndex();0<=h&&e.shiftKey&&e.ctrlKey?this.focus.colSizeAdjust(e,h,5*(d==r.LEFT_ARROW?-1:1)):(e=d==r.LEFT_ARROW?1:-1,this.isLeftToRight()&&(e*=-1),this.focus.move(0,e))}break;case r.UP_ARROW:this.edit.isEditing()||0===this.focus.rowIndex||(m.stop(e),this.focus.move(-1,0));break;case r.DOWN_ARROW:this.edit.isEditing()||
this.focus.rowIndex+1==this.rowCount||(m.stop(e),this.focus.move(1,0));break;case r.PAGE_UP:this.edit.isEditing()||0===this.focus.rowIndex||(m.stop(e),this.focus.rowIndex!=this.scroller.firstVisibleRow+1?this.focus.move(this.scroller.firstVisibleRow-this.focus.rowIndex,0):(this.setScrollTop(this.scroller.findScrollTop(this.focus.rowIndex-1)),this.focus.move(this.scroller.firstVisibleRow-this.scroller.lastVisibleRow+1,0)));break;case r.PAGE_DOWN:this.edit.isEditing()||this.focus.rowIndex+1==this.rowCount||
(m.stop(e),this.focus.rowIndex!=this.scroller.lastVisibleRow-1?this.focus.move(this.scroller.lastVisibleRow-this.focus.rowIndex-1,0):(this.setScrollTop(this.scroller.findScrollTop(this.focus.rowIndex+1)),this.focus.move(this.scroller.lastVisibleRow-this.scroller.firstVisibleRow-1,0)))}}},onMouseOver:function(e){-1==e.rowIndex?this.onHeaderCellMouseOver(e):this.onCellMouseOver(e)},onMouseOut:function(e){-1==e.rowIndex?this.onHeaderCellMouseOut(e):this.onCellMouseOut(e)},onMouseDown:function(e){-1==
e.rowIndex?this.onHeaderCellMouseDown(e):this.onCellMouseDown(e)},onMouseOverRow:function(e){this.rows.isOver(e.rowIndex)||(this.rows.setOverRow(e.rowIndex),-1==e.rowIndex?this.onHeaderMouseOver(e):this.onRowMouseOver(e))},onMouseOutRow:function(e){if(this.rows.isOver(-1))this.onHeaderMouseOut(e);else this.rows.isOver(-2)||(this.rows.setOverRow(-2),this.onRowMouseOut(e))},onMouseDownRow:function(e){if(-1!=e.rowIndex)this.onRowMouseDown(e)},onCellMouseOver:function(e){e.cellNode&&n.add(e.cellNode,
this.cellOverClass)},onCellMouseOut:function(e){e.cellNode&&n.remove(e.cellNode,this.cellOverClass)},onCellMouseDown:function(e){},onCellClick:function(e){this._click[0]=this._click[1];this._click[1]=e;this.edit.isEditCell(e.rowIndex,e.cellIndex)||this.focus.setFocusCell(e.cell,e.rowIndex);1<this._click.length&&null==this._click[0]&&this._click.shift();this.onRowClick(e)},onCellDblClick:function(e){var k;k=1<this._click.length&&h("ie")?this._click[1]:1<this._click.length&&this._click[0].rowIndex!=
this._click[1].rowIndex?this._click[0]:e;this.focus.setFocusCell(k.cell,k.rowIndex);this.edit.setEditCell(k.cell,k.rowIndex);this.onRowDblClick(e)},onCellContextMenu:function(e){this.onRowContextMenu(e)},onCellFocus:function(e,h){this.edit.cellFocus(e,h)},onRowClick:function(e){this.edit.rowClick(e);this.selection.clickSelectEvent(e)},onRowDblClick:function(e){},onRowMouseOver:function(e){},onRowMouseOut:function(e){},onRowMouseDown:function(e){},onRowContextMenu:function(e){m.stop(e)},onHeaderMouseOver:function(e){},
onHeaderMouseOut:function(e){},onHeaderCellMouseOver:function(e){e.cellNode&&n.add(e.cellNode,this.cellOverClass)},onHeaderCellMouseOut:function(e){e.cellNode&&n.remove(e.cellNode,this.cellOverClass)},onHeaderCellMouseDown:function(e){},onHeaderClick:function(e){},onHeaderCellClick:function(e){this.setSortIndex(e.cell.index);this.onHeaderClick(e)},onHeaderDblClick:function(e){},onHeaderCellDblClick:function(e){this.onHeaderDblClick(e)},onHeaderCellContextMenu:function(e){this.onHeaderContextMenu(e)},
onHeaderContextMenu:function(e){this.headerMenu||m.stop(e)},onStartEdit:function(e,h){},onApplyCellEdit:function(e,h,d){},onCancelEdit:function(e){},onApplyEdit:function(e){},onCanSelect:function(e){return!0},onCanDeselect:function(e){return!0},onSelected:function(e){this.updateRowStyles(e)},onDeselected:function(e){this.updateRowStyles(e)},onSelectionChanged:function(){}})})},"dojox/grid/_Scroller":function(){define(["dijit/registry","dojo/_base/declare","dojo/_base/lang","./util","dojo/_base/html"],
function(r,n,p,m,h){var e=function(d){d&&dojo.forEach(r.toArray(),function(e){e.domNode&&h.isDescendant(e.domNode,d,!0)&&e.destroy()})},k=function(d,e){for(var c=[],a=0,g;g=d.childNodes[a];){a++;var k=h.byId(g);(k&&k.tagName?k.tagName.toLowerCase():"")==e&&c.push(g)}return c};return n("dojox.grid._Scroller",null,{constructor:function(d){this.setContentNodes(d);this.pageHeights=[];this.pageNodes=[];this.stack=[]},rowCount:0,defaultRowHeight:32,keepRows:100,contentNode:null,scrollboxNode:null,defaultPageHeight:0,
keepPages:10,pageCount:0,windowHeight:0,firstVisibleRow:0,lastVisibleRow:0,averageRowHeight:0,page:0,pageTop:0,init:function(d,e,c){switch(arguments.length){case 3:this.rowsPerPage=c;case 2:this.keepRows=e;case 1:this.rowCount=d}this.defaultPageHeight=(0<this.grid.rowHeight?this.grid.rowHeight:this.defaultRowHeight)*this.rowsPerPage;this.pageCount=this._getPageCount(this.rowCount,this.rowsPerPage);this.setKeepInfo(this.keepRows);this.invalidate();this.scrollboxNode&&(this.scrollboxNode.scrollTop=
0,this.scroll(0),this.scrollboxNode.onscroll=p.hitch(this,"onscroll"))},_getPageCount:function(d,e){return d?Math.ceil(d/e)||1:0},destroy:function(){this.invalidateNodes();delete this.contentNodes;delete this.contentNode;delete this.scrollboxNode},setKeepInfo:function(d){this.keepPages=(this.keepRows=d)?Math.max(Math.ceil(this.keepRows/this.rowsPerPage),2):this.keepPages},setContentNodes:function(d){this.colCount=(this.contentNodes=d)?this.contentNodes.length:0;this.pageNodes=[];for(d=0;d<this.colCount;d++)this.pageNodes[d]=
[]},getDefaultNodes:function(){return this.pageNodes[0]||[]},invalidate:function(){this._invalidating=!0;this.invalidateNodes();this.pageHeights=[];this.height=this.pageCount?(this.pageCount-1)*this.defaultPageHeight+this.calcLastPageHeight():0;this.resize();this._invalidating=!1},updateRowCount:function(d){this.invalidateNodes();this.rowCount=d;d=this.pageCount;0===d&&(this.height=1);this.pageCount=this._getPageCount(this.rowCount,this.rowsPerPage);if(this.pageCount<d)for(--d;d>=this.pageCount;d--)this.height-=
this.getPageHeight(d),delete this.pageHeights[d];else this.pageCount>d&&(this.height+=this.defaultPageHeight*(this.pageCount-d-1)+this.calcLastPageHeight());this.resize()},pageExists:function(d){return!!this.getDefaultPageNode(d)},measurePage:function(d){return this.grid.rowHeight?((d+1)*this.rowsPerPage>this.rowCount?this.rowCount-d*this.rowsPerPage:this.rowsPerPage)*this.grid.rowHeight:(d=this.getDefaultPageNode(d))&&d.innerHTML?d.offsetHeight:void 0},positionPage:function(d,e){for(var c=0;c<this.colCount;c++)this.pageNodes[c][d].style.top=
e+"px"},repositionPages:function(d){for(var e=this.getDefaultNodes(),c=0,a=0;a<this.stack.length;a++)c=Math.max(this.stack[a],c);var h=(a=e[d])?this.getPageNodePosition(a)+this.getPageHeight(d):0;for(d+=1;d<=c;d++){if(a=e[d]){if(this.getPageNodePosition(a)==h)break;this.positionPage(d,h)}h+=this.getPageHeight(d)}},installPage:function(d){for(var e=0;e<this.colCount;e++)this.contentNodes[e].appendChild(this.pageNodes[e][d])},preparePage:function(d,e){for(var c=e?this.popPage():null,a=0;a<this.colCount;a++){var g=
this.pageNodes[a],h=null===c?this.createPageNode():this.invalidatePageNode(c,g);h.pageIndex=d;g[d]=h}},renderPage:function(d){var e=[],c;for(c=0;c<this.colCount;c++)e[c]=this.pageNodes[c][d];c=0;for(d*=this.rowsPerPage;c<this.rowsPerPage&&d<this.rowCount;c++,d++)this.renderRow(d,e)},removePage:function(d){var e=0;for(d*=this.rowsPerPage;e<this.rowsPerPage;e++,d++)this.removeRow(d)},destroyPage:function(d){for(var e=0;e<this.colCount;e++){var c=this.invalidatePageNode(d,this.pageNodes[e]);c&&h.destroy(c)}},
pacify:function(d){},pacifying:!1,pacifyTicks:200,setPacifying:function(d){this.pacifying!=d&&(this.pacifying=d,this.pacify(this.pacifying))},startPacify:function(){this.startPacifyTicks=(new Date).getTime()},doPacify:function(){var d=(new Date).getTime()-this.startPacifyTicks>this.pacifyTicks;this.setPacifying(!0);this.startPacify();return d},endPacify:function(){this.setPacifying(!1)},resize:function(){this.scrollboxNode&&(this.windowHeight=this.scrollboxNode.clientHeight);for(var d=0;d<this.colCount;d++)m.setStyleHeightPx(this.contentNodes[d],
Math.max(1,this.height));d=!this._invalidating;if(!d){var e=this.grid.get("autoHeight");"number"==typeof e&&e<=Math.min(this.rowsPerPage,this.rowCount)&&(d=!0)}d&&this.needPage(this.page,this.pageTop);d=this.page<this.pageCount-1?this.rowsPerPage:this.rowCount%this.rowsPerPage||this.rowsPerPage;e=this.getPageHeight(this.page);this.averageRowHeight=0<e&&0<d?e/d:0},calcLastPageHeight:function(){if(!this.pageCount)return 0;var d=(this.rowCount%this.rowsPerPage||this.rowsPerPage)*this.defaultRowHeight;
return this.pageHeights[this.pageCount-1]=d},updateContentHeight:function(d){this.height+=d;this.resize()},updatePageHeight:function(d,e,c){if(this.pageExists(d)){var a=this.getPageHeight(d),g=this.measurePage(d);void 0===g&&(g=a);this.pageHeights[d]=g;if(a!=g){this.updateContentHeight(g-a);var h=this.grid.get("autoHeight");"number"==typeof h&&h>this.rowCount||!0===h&&!e?c?(e=this.grid.viewsNode.style,e.height=parseInt(e.height)+g-a+"px",this.repositionPages(d)):this.grid.sizeChange():this.repositionPages(d)}return g}return 0},
rowHeightChanged:function(d,e){this.updatePageHeight(Math.floor(d/this.rowsPerPage),!1,e)},invalidateNodes:function(){for(;this.stack.length;)this.destroyPage(this.popPage())},createPageNode:function(){var d=document.createElement("div");h.attr(d,"role","presentation");d.style.position="absolute";d.style[this.grid.isLeftToRight()?"left":"right"]="0";return d},getPageHeight:function(d){d=this.pageHeights[d];return void 0!==d?d:this.defaultPageHeight},pushPage:function(d){return this.stack.push(d)},
popPage:function(){return this.stack.shift()},findPage:function(d){for(var e=0,c=0,a=0;e<this.pageCount&&!(a=this.getPageHeight(e),c+a>=d);e++,c+=a);this.page=e;this.pageTop=c},buildPage:function(d,e,c){this.preparePage(d,e);this.positionPage(d,c);this.installPage(d);this.renderPage(d);this.pushPage(d)},needPage:function(d,e){var c=this.getPageHeight(d);this.pageExists(d)?this.positionPage(d,e):(this.buildPage(d,!this.grid._autoHeight&&this.keepPages&&this.stack.length>=this.keepPages,e),c=this.updatePageHeight(d,
!0));return c},onscroll:function(){this.scroll(this.scrollboxNode.scrollTop)},scroll:function(d){this.grid.scrollTop=d;if(this.colCount){this.startPacify();this.findPage(d);for(var e=this.height,c=this.getScrollBottom(d),a=this.page,h=this.pageTop;a<this.pageCount&&(0>c||h<c);a++)h+=this.needPage(a,h);this.firstVisibleRow=this.getFirstVisibleRow(this.page,this.pageTop,d);this.lastVisibleRow=this.getLastVisibleRow(a-1,h,c);e!=this.height&&this.repositionPages(a-1);this.endPacify()}},getScrollBottom:function(d){return 0<=
this.windowHeight?d+this.windowHeight:-1},processNodeEvent:function(d,e){for(var c=d.target;c&&c!=e&&c.parentNode&&c.parentNode.parentNode!=e;)c=c.parentNode;if(!c||!c.parentNode||c.parentNode.parentNode!=e)return!1;d.topRowIndex=c.parentNode.pageIndex*this.rowsPerPage;var a=d.topRowIndex,g;a:{g=0;for(var h,k=c.parentNode;h=k.childNodes[g++];)if(h==c){--g;break a}g=-1}d.rowIndex=a+g;d.rowTarget=c;return!0},processEvent:function(d){return this.processNodeEvent(d,this.contentNode)},renderRow:function(d,
e){},removeRow:function(d){},getDefaultPageNode:function(d){return this.getDefaultNodes()[d]},positionPageNode:function(d,e){},getPageNodePosition:function(d){return d.offsetTop},invalidatePageNode:function(d,g){var c=g[d];c&&(delete g[d],this.removePage(d,c),e(c),c.innerHTML="");return c},getPageRow:function(d){return d*this.rowsPerPage},getLastPageRow:function(d){return Math.min(this.rowCount,this.getPageRow(d+1))-1},getFirstVisibleRow:function(d,e,c){if(!this.pageExists(d))return 0;var a=this.getPageRow(d),
g=this.getDefaultNodes();d=k(g[d],"div");for(var g=0,h=d.length;g<h&&e<c;g++,a++)e+=d[g].offsetHeight;return a?a-1:a},getLastVisibleRow:function(d,e,c){if(!this.pageExists(d))return 0;var a=this.getDefaultNodes(),g=this.getLastPageRow(d);d=k(a[d],"div");for(a=d.length-1;0<=a&&e>c;a--,g--)e-=d[a].offsetHeight;return g+1},findTopRow:function(d){for(var e=this.getDefaultNodes(),e=k(e[this.page],"div"),c=0,a=e.length,h=this.pageTop,m;c<a;c++)if(m=e[c].offsetHeight,h+=m,h>=d)return this.offset=m-(h-d),
c+this.page*this.rowsPerPage;return-1},findScrollTop:function(d){var e=Math.floor(d/this.rowsPerPage),c=0,a;for(a=0;a<e;a++)c+=this.getPageHeight(a);this.pageTop=c;this.page=e;this.needPage(e,this.pageTop);a=this.getDefaultNodes();var h=k(a[e],"div"),e=d-this.rowsPerPage*e;a=0;for(d=h.length;a<d&&a<e;a++)c+=h[a].offsetHeight;return c},dummy:0})})},"dojox/grid/util":function(){define(["../main","dojo/_base/lang","dojo/dom"],function(r,n,p){var m=n.getObject("grid.util",!0,r);m.na="...";m.rowIndexTag=
"gridRowIndex";m.gridViewTag="gridView";m.fire=function(h,e,k){var d=h&&e&&h[e];return d&&(k?d.apply(h,k):h[e]())};m.setStyleHeightPx=function(h,e){if(0<=e){var k=h.style,d=e+"px";h&&k.height!=d&&(k.height=d)}};m.mouseEvents="mouseover mouseout mousedown mouseup click dblclick contextmenu".split(" ");m.keyEvents=["keyup","keydown","keypress"];m.funnelEvents=function(h,e,k,d){d=d?d:m.mouseEvents.concat(m.keyEvents);for(var g=0,c=d.length;g<c;g++)e.connect(h,"on"+d[g],k)};m.removeNode=function(h){(h=
p.byId(h))&&h.parentNode&&h.parentNode.removeChild(h);return h};m.arrayCompare=function(h,e){for(var k=0,d=h.length;k<d;k++)if(h[k]!=e[k])return!1;return h.length==e.length};m.arrayInsert=function(h,e,k){h.length<=e?h[e]=k:h.splice(e,0,k)};m.arrayRemove=function(h,e){h.splice(e,1)};m.arraySwap=function(h,e,k){var d=h[e];h[e]=h[k];h[k]=d};return m})},"dojox/grid/_Layout":function(){define("dojo/_base/kernel ../main dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/dom-geometry ./cells ./_RowSelector".split(" "),
function(r,n,p,m,h,e){return p("dojox.grid._Layout",null,{constructor:function(e){this.grid=e},cells:[],structure:null,defaultWidth:"6em",moveColumn:function(e,d,g,c,a){var h=this.structure[e].cells[0],k=this.structure[d].cells[0],n=null,f=n=0;e=0;for(var b;b=h[e];e++)if(b.index==g){n=e;break}n=h.splice(n,1)[0];n.view=this.grid.views.views[d];e=0;for(b=null;b=k[e];e++)if(b.index==c){f=e;break}a||(f+=1);k.splice(f,0,n);if(g=this.grid.getCell(this.grid.getSortIndex()))g._currentlySorted=this.grid.getSortAsc();
this.cells=[];for(e=g=0;d=this.structure[e];e++)for(c=0;a=d.cells[c];c++)for(h=0;b=a[h];h++)b.index=g,this.cells.push(b),"_currentlySorted"in b&&(k=g+1,k*=b._currentlySorted?1:-1,this.grid.sortInfo=k,delete b._currentlySorted),g++;m.forEach(this.cells,function(a){var b=a.markup[2].split(" ");parseInt(b[1].substring(5))!=a.index&&(b[1]='idx\x3d"'+a.index+'"',a.markup[2]=b.join(" "))});this.grid.setupHeaderMenu()},setColumnVisibility:function(h,d){var g=this.cells[h];if(g.hidden==d){g.hidden=!d;var c=
g.view,a=c.viewWidth;a&&"auto"!=a&&(c._togglingColumn=e.getMarginBox(g.getHeaderNode()).w||0);c.update();return!0}return!1},addCellDef:function(e,d,g){var c=this,a=function(a){var d=0;1<a.colSpan?d=0:(d=a.width||c._defaultCellProps.width||c.defaultWidth,isNaN(d)||(d+="em"));return d};e={grid:this.grid,subrow:e,layoutIndex:d,index:this.cells.length};if(g&&g instanceof n.grid.cells._Base)return d=h.clone(g),e.unitWidth=a(d._props),d=h.mixin(d,this._defaultCellProps,g._props,e);d=g.type||g.cellType||
this._defaultCellProps.type||this._defaultCellProps.cellType||n.grid.cells.Cell;h.isString(d)&&(d=h.getObject(d));e.unitWidth=a(g);return new d(h.mixin({},this._defaultCellProps,g,e))},addRowDef:function(e,d){for(var g=[],c=0,a=0,h=!0,k=0,n;n=d[k];k++)n=this.addCellDef(e,k,n),g.push(n),this.cells.push(n),h&&n.relWidth?c+=n.relWidth:n.width&&(n=n.width,"string"==typeof n&&"%"==n.slice(-1)?a+=window.parseInt(n,10):"auto"==n&&(h=!1));c&&h&&m.forEach(g,function(d){d.relWidth&&(d.width=d.unitWidth=d.relWidth/
c*(100-a)+"%")});return g},addRowsDef:function(e){var d=[];if(h.isArray(e))if(h.isArrayLike(e[0]))for(var g=0,c;e&&(c=e[g]);g++)d.push(this.addRowDef(g,c));else d.push(this.addRowDef(0,e));return d},addViewDef:function(e){this._defaultCellProps=e.defaultCell||{};e.width&&"auto"==e.width&&delete e.width;return h.mixin({},e,{cells:this.addRowsDef(e.rows||e.cells)})},setStructure:function(e){this.fieldIndex=0;this.cells=[];var d=this.structure=[];if(this.grid.rowSelector){var g={type:n._scopeName+".grid._RowSelector"};
if(h.isString(this.grid.rowSelector)){var c=this.grid.rowSelector;"false"==c?g=null:"true"!=c&&(g.width=c)}else this.grid.rowSelector||(g=null);g&&d.push(this.addViewDef(g))}var a=function(a){return"name"in a||"field"in a||"get"in a},g=function(c){return h.isArray(c)&&(h.isArray(c[0])||a(c[0]))?!0:!1},c=function(c){return null!==c&&h.isObject(c)&&("cells"in c||"rows"in c||"type"in c&&!a(c))};if(h.isArrayLike(e)){for(var k=!1,m=0,p;p=e[m];m++)if(c(p)){k=!0;break}if(k)for(m=0;p=e[m];m++)g(p)?d.push(this.addViewDef({cells:p})):
c(p)&&d.push(this.addViewDef(p));else d.push(this.addViewDef({cells:e}))}else c(e)&&d.push(this.addViewDef(e));this.cellCount=this.cells.length;this.grid.setupHeaderMenu()}})})},"dojox/grid/cells":function(){define(["../main","./cells/_base"],function(r){return r.grid.cells})},"dojox/grid/cells/_base":function(){define("dojo/_base/kernel dojo/_base/declare dojo/_base/lang dojo/_base/event dojo/_base/connect dojo/_base/array dojo/_base/sniff dojo/dom dojo/dom-attr dojo/dom-construct dijit/_Widget ../util".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l){var t=n("dojox.grid._DeferredTextWidget",a,{deferred:null,_destroyOnRemove:!0,postCreate:function(){this.deferred&&this.deferred.addBoth(p.hitch(this,function(a){this.domNode&&(this.domNode.innerHTML=a)}))}}),v=function(){setTimeout(p.hitch.apply(r,arguments),0)},f=n("dojox.grid.cells._Base",null,{styles:"",classes:"",editable:!1,alwaysEditing:!1,formatter:null,defaultValue:"...",value:null,hidden:!1,noresize:!1,draggable:!0,_valueProp:"value",_formatPending:!1,constructor:function(a){this._props=
a||{};p.mixin(this,a);void 0===this.draggable&&(this.draggable=!0)},_defaultFormat:function(a,b){var d=this.grid.formatterScope||this,e=this.formatter;e&&d&&"string"==typeof e&&(e=this.formatter=d[e]);d=a!=this.defaultValue&&e?e.apply(d,b):a;if("undefined"==typeof d)return this.defaultValue;d&&d.addBoth&&(d=new t({deferred:d},c.create("span",{innerHTML:this.defaultValue})));return d&&d.declaredClass&&d.startup?"\x3cdiv class\x3d'dojoxGridStubNode' linkWidget\x3d'"+d.id+"' cellIdx\x3d'"+this.index+
"'\x3e"+this.defaultValue+"\x3c/div\x3e":d},format:function(a,b){var c=this.grid.edit.info,d=this.get?this.get(a,b):this.value||this.defaultValue,d=d&&d.replace&&this.grid.escapeHTMLInData?d.replace(/&(?![a-z0-9]{1,8}\;)/ig,"\x26amp;").replace(/</g,"\x26lt;"):d;return this.editable&&(this.alwaysEditing||c.rowIndex==a&&c.cell==this)?this.formatEditing(c.value?c.value:d,a):this._defaultFormat(d,[d,a,this])},formatEditing:function(a,b){},getNode:function(a){return this.view.getCellNode(a,this.index)},
getHeaderNode:function(){return this.view.getHeaderCellNode(this.index)},getEditNode:function(a){return(this.getNode(a)||0).firstChild||0},canResize:function(){var a=this.unitWidth;return a&&"auto"!==a},isFlex:function(){var a=this.unitWidth;return a&&p.isString(a)&&("auto"==a||"%"==a.slice(-1))},applyEdit:function(a,b){this.getNode(b)&&this.grid.edit.applyCellEdit(a,this,b)},cancelEdit:function(a){this.grid.doCancelEdit(a)},_onEditBlur:function(a){this.grid.edit.isEditCell(a,this.index)&&this.grid.edit.apply()},
registerOnBlur:function(a,b){this.commitOnBlur&&h.connect(a,"onblur",function(a){setTimeout(p.hitch(this,"_onEditBlur",b),250)})},needFormatNode:function(a,b){this._formatPending=!0;v(this,"_formatNode",a,b)},cancelFormatNode:function(){this._formatPending=!1},_formatNode:function(a,b){this._formatPending&&(this._formatPending=!1,k("ie")||d.setSelectable(this.grid.domNode,!0),this.formatNode(this.getEditNode(b),a,b))},formatNode:function(a,b,c){k("ie")?v(this,"focus",c,a):this.focus(c,a)},dispatchEvent:function(a,
b){if(a in this)return this[a](b)},getValue:function(a){return this.getEditNode(a)[this._valueProp]},setValue:function(a,b){var c=this.getEditNode(a);c&&(c[this._valueProp]=b)},focus:function(a,b){var c=b||this.getEditNode(a);try{l.fire(c,"focus"),l.fire(c,"select")}catch(B){}},save:function(a){this.value=this.value||this.getValue(a)},restore:function(a){this.setValue(a,this.value)},_finish:function(a){d.setSelectable(this.grid.domNode,!1);this.cancelFormatNode()},apply:function(a){this.applyEdit(this.getValue(a),
a);this._finish(a)},cancel:function(a){this.cancelEdit(a);this._finish(a)}});f.markupFactory=function(a,b){var c=p.trim(g.get(a,"formatter")||"");c&&(b.formatter=p.getObject(c)||c);if(c=p.trim(g.get(a,"get")||""))b.get=p.getObject(c);c=function(b,c,d){var e=p.trim(g.get(a,b)||"");e&&(c[d||b]="false"!=e.toLowerCase())};c("sortDesc",b);c("editable",b);c("alwaysEditing",b);c("noresize",b);c("draggable",b);if(c=p.trim(g.get(a,"loadingText")||g.get(a,"defaultValue")||""))b.defaultValue=c;c=function(b,
c,d){var e=p.trim(g.get(a,b)||"")||void 0;e&&(c[d||b]=e)};c("styles",b);c("headerStyles",b);c("cellStyles",b);c("classes",b);c("headerClasses",b);c("cellClasses",b)};var b=f.Cell=n("dojox.grid.cells.Cell",f,{constructor:function(){this.keyFilter=this.keyFilter},keyFilter:null,formatEditing:function(a,b){this.needFormatNode(a,b);return'\x3cinput class\x3d"dojoxGridInput" type\x3d"text" value\x3d"'+a+'"\x3e'},formatNode:function(a,b,c){this.inherited(arguments);this.registerOnBlur(a,c)},doKey:function(a){this.keyFilter&&
-1==String.fromCharCode(a.charCode).search(this.keyFilter)&&m.stop(a)},_finish:function(a){this.inherited(arguments);var b=this.getEditNode(a);try{l.fire(b,"blur")}catch(y){}}});b.markupFactory=function(a,b){f.markupFactory(a,b);var c=p.trim(g.get(a,"keyFilter")||"");c&&(b.keyFilter=new RegExp(c))};(f.RowIndex=n("dojox.grid.cells.RowIndex",b,{name:"Row",postscript:function(){this.editable=!1},get:function(a){return a+1}})).markupFactory=function(a,c){b.markupFactory(a,c)};(f.Select=n("dojox.grid.cells.Select",
b,{options:null,values:null,returnIndex:-1,constructor:function(a){this.values=this.values||this.options},formatEditing:function(a,b){this.needFormatNode(a,b);for(var c=['\x3cselect class\x3d"dojoxGridSelect"\x3e'],d=0,e,f;void 0!==(e=this.options[d])&&void 0!==(f=this.values[d]);d++)f=f.replace?f.replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;"):f,e=e.replace?e.replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;"):e,c.push("\x3coption",a==f?" selected":"",' value\x3d"'+f+'"',"\x3e",e,"\x3c/option\x3e");
c.push("\x3c/select\x3e");return c.join("")},_defaultFormat:function(a,b){var c=this.inherited(arguments);if(!this.formatter&&this.values&&this.options){var d=e.indexOf(this.values,c);0<=d&&(c=this.options[d])}return c},getValue:function(a){var b=this.getEditNode(a);if(b)return a=b.selectedIndex,b=b.options[a],-1<this.returnIndex?a:b.value||b.innerHTML}})).markupFactory=function(a,c){b.markupFactory(a,c);var d=p.trim(g.get(a,"options")||"");if(d){var e=d.split(",");e[0]!=d&&(c.options=e)}if(d=p.trim(g.get(a,
"values")||""))e=d.split(","),e[0]!=d&&(c.values=e)};var q=f.AlwaysEdit=n("dojox.grid.cells.AlwaysEdit",b,{alwaysEditing:!0,_formatNode:function(a,b){this.formatNode(this.getEditNode(b),a,b)},applyStaticValue:function(a){var b=this.grid.edit;b.applyCellEdit(this.getValue(a),this,a);b.start(this,a,!0)}});q.markupFactory=function(a,c){b.markupFactory(a,c)};(f.Bool=n("dojox.grid.cells.Bool",q,{_valueProp:"checked",formatEditing:function(a,b){return'\x3cinput class\x3d"dojoxGridInput" type\x3d"checkbox"'+
(a?' checked\x3d"checked"':"")+' style\x3d"width: auto" /\x3e'},doclick:function(a){"INPUT"==a.target.tagName&&this.applyStaticValue(a.rowIndex)}})).markupFactory=function(a,b){q.markupFactory(a,b)};return f})},"dojox/grid/_RowSelector":function(){define(["dojo/_base/declare","./_View"],function(r,n){return r("dojox.grid._RowSelector",n,{defaultWidth:"2em",noscroll:!0,padBorderWidth:2,buildRendering:function(){this.inherited("buildRendering",arguments);this.scrollboxNode.style.overflow="hidden";this.headerNode.style.visibility=
"hidden"},getWidth:function(){return this.viewWidth||this.defaultWidth},buildRowContent:function(n,m){m.innerHTML='\x3ctable class\x3d"dojoxGridRowbarTable" style\x3d"width:'+(this.contentWidth||0)+'px;height:1px;" border\x3d"0" cellspacing\x3d"0" cellpadding\x3d"0" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd class\x3d"dojoxGridRowbarInner"\x3e\x26nbsp;\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e'},renderHeader:function(){},updateRow:function(){},resize:function(){this.adaptHeight()},adaptWidth:function(){!("contentWidth"in
this)&&this.contentNode&&0<this.contentNode.offsetWidth&&(this.contentWidth=this.contentNode.offsetWidth-this.padBorderWidth)},doStyleRowNode:function(n,m){var h=["dojoxGridRowbar dojoxGridNonNormalizedCell"];this.grid.rows.isOver(n)&&h.push("dojoxGridRowbarOver");this.grid.selection.isSelected(n)&&h.push("dojoxGridRowbarSelected");m.className=h.join(" ")},domouseover:function(n){this.grid.onMouseOverRow(n)},domouseout:function(n){if(!this.isIntraRowEvent(n))this.grid.onMouseOutRow(n)}})})},"dojox/grid/_View":function(){define("dojo dijit/registry ../main dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/_base/connect dojo/_base/sniff dojo/query dojo/_base/window dojo/text!./resources/View.html dojo/dnd/Source dijit/_Widget dijit/_TemplatedMixin dojox/html/metrics ./util dojo/_base/html ./_Builder dojo/dnd/Avatar dojo/dnd/Manager".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l,t,v,f,b,q,u,A,y){a=m("dojox.grid._View",[t,v],{defaultWidth:"18em",viewWidth:"",templateString:a,classTag:"dojoxGrid",marginBottom:0,rowPad:2,_togglingColumn:-1,_headerBuilderClass:u._HeaderBuilder,_contentBuilderClass:u._ContentBuilder,postMixInProperties:function(){this.rowNodes={}},postCreate:function(){this.connect(this.scrollboxNode,"onscroll","doscroll");b.funnelEvents(this.contentNode,this,"doContentEvent","mouseover mouseout click dblclick contextmenu mousedown".split(" "));
b.funnelEvents(this.headerNode,this,"doHeaderEvent","dblclick mouseover mouseout mousemove mousedown click contextmenu".split(" "));this.content=new this._contentBuilderClass(this);this.header=new this._headerBuilderClass(this);this.grid.isLeftToRight()||(this.headerNodeContainer.style.width="")},destroy:function(){q.destroy(this.headerNode);delete this.headerNode;for(var a in this.rowNodes)this._cleanupRowWidgets(this.rowNodes[a]),q.destroy(this.rowNodes[a]);this.rowNodes={};this.source&&this.source.destroy();
this.inherited(arguments)},focus:function(){d("ie")||d("webkit")||d("opera")?this.hiddenFocusNode.focus():this.scrollboxNode.focus()},setStructure:function(a){a=this.structure=a;a.width&&!isNaN(a.width)?this.viewWidth=a.width+"em":this.viewWidth=a.width||(a.noscroll?"auto":this.viewWidth);this._onBeforeRow=a.onBeforeRow||function(){};this._onAfterRow=a.onAfterRow||function(){};if(this.noscroll=a.noscroll)this.scrollboxNode.style.overflow="hidden";this.simpleStructure=1==a.cells.length;this.testFlexCells();
this.updateStructure()},_cleanupRowWidgets:function(a){a&&h.forEach(g("[widgetId]",a).map(n.byNode),function(a){a._destroyOnRemove?(a.destroy(),delete a):a.domNode&&a.domNode.parentNode&&a.domNode.parentNode.removeChild(a.domNode)})},onBeforeRow:function(a,b){this._onBeforeRow(a,b);0<=a&&this._cleanupRowWidgets(this.getRowNode(a))},onAfterRow:function(a,b,c){this._onAfterRow(a,b,c);var d=this.grid;h.forEach(g(".dojoxGridStubNode",c),function(a){if(a&&a.parentNode){var b=a.getAttribute("linkWidget"),
c=window.parseInt(q.attr(a,"cellIdx"),10);d.getCell(c);(b=n.byId(b))?(a.parentNode.replaceChild(b.domNode,a),b._started||b.startup(),r.destroy(a)):a.innerHTML=""}},this)},testFlexCells:function(){this.flexCells=!1;for(var a=0,b;b=this.structure.cells[a];a++)for(var c=0,d;d=b[c];c++)d.view=this,this.flexCells=this.flexCells||d.isFlex();return this.flexCells},updateStructure:function(){this.header.update();this.content.update()},getScrollbarWidth:function(){var a=this.hasVScrollbar(),b=q.style(this.scrollboxNode,
"overflow");this.noscroll||!b||"hidden"==b?a=!1:"scroll"==b&&(a=!0);return a?f.getScrollbar().w:0},getColumnsWidth:function(){var a=this.headerContentNode;return a&&a.firstChild?a.firstChild.offsetWidth||q.style(a.firstChild,"width"):0},setColumnsWidth:function(a){this.headerContentNode.firstChild.style.width=a+"px";this.viewWidth&&(this.viewWidth=a+"px")},getWidth:function(){return this.viewWidth||this.getColumnsWidth()+this.getScrollbarWidth()+"px"},getContentWidth:function(){return Math.max(0,
q._getContentBox(this.domNode).w-this.getScrollbarWidth())+"px"},render:function(){this.scrollboxNode.style.height="";this.renderHeader();0<=this._togglingColumn&&(this.setColumnsWidth(this.getColumnsWidth()-this._togglingColumn),this._togglingColumn=-1);var a=this.grid.layout.cells,b=e.hitch(this,function(b,c){!this.grid.isLeftToRight()&&(c=!c);for(var d=c?-1:1,e=this.header.getCellNodeIndex(b)+d,f=a[e];f&&f.getHeaderNode()&&"none"==f.getHeaderNode().style.display;)e+=d,f=a[e];return f?f.getHeaderNode():
null});if(this.grid.columnReordering&&this.simpleStructure){this.source&&this.source.destroy();this.bottomMarker&&q.destroy(this.bottomMarker);this.bottomMarker=q.byId("dojoxGrid_bottomMarker");this.topMarker&&q.destroy(this.topMarker);this.topMarker=q.byId("dojoxGrid_topMarker");this.bottomMarker||(this.bottomMarker=q.create("div",{id:"dojoxGrid_bottomMarker","class":"dojoxGridColPlaceBottom"},c.body()),this._hide(this.bottomMarker),this.topMarker=q.create("div",{id:"dojoxGrid_topMarker","class":"dojoxGridColPlaceTop"},
c.body()),this._hide(this.topMarker));this.arrowDim=q.contentBox(this.bottomMarker);var f=q.contentBox(this.headerContentNode.firstChild.rows[0]).h;this.source=new l(this.headerContentNode.firstChild.rows[0],{horizontal:!0,accept:["gridColumn_"+this.grid.id],viewIndex:this.index,generateText:!1,onMouseDown:e.hitch(this,function(a){this.header.decorateEvent(a);if((this.header.overRightResizeArea(a)||this.header.overLeftResizeArea(a))&&this.header.canResize(a)&&!this.header.moveable)this.header.beginColumnResize(a);
else{if(this.grid.headerMenu)this.grid.headerMenu.onCancel(!0);a.button===(9>d("ie")?1:0)&&l.prototype.onMouseDown.call(this.source,a)}}),onMouseOver:e.hitch(this,function(a){var b=this.source;b._getChildByEvent(a)&&l.prototype.onMouseOver.apply(b,arguments)}),_markTargetAnchor:e.hitch(this,function(a){var c=this.source;if(c.current!=c.targetAnchor||c.before!=a){c.targetAnchor&&b(c.targetAnchor,c.before)&&c._removeItemClass(b(c.targetAnchor,c.before),c.before?"After":"Before");l.prototype._markTargetAnchor.call(c,
a);var d=a?c.targetAnchor:b(c.targetAnchor,c.before);a=0;d||(d=c.targetAnchor,a=q.contentBox(d).w+this.arrowDim.w/2+2);d=q.position(d,!0);a=Math.floor(d.x-this.arrowDim.w/2+a);q.style(this.bottomMarker,"visibility","visible");q.style(this.topMarker,"visibility","visible");q.style(this.bottomMarker,{left:a+"px",top:f+d.y+"px"});q.style(this.topMarker,{left:a+"px",top:d.y-this.arrowDim.h+"px"});c.targetAnchor&&b(c.targetAnchor,c.before)&&c._addItemClass(b(c.targetAnchor,c.before),c.before?"After":"Before")}}),
_unmarkTargetAnchor:e.hitch(this,function(){var a=this.source;a.targetAnchor&&(a.targetAnchor&&b(a.targetAnchor,a.before)&&a._removeItemClass(b(a.targetAnchor,a.before),a.before?"After":"Before"),this._hide(this.bottomMarker),this._hide(this.topMarker),l.prototype._unmarkTargetAnchor.call(a))}),destroy:e.hitch(this,function(){k.disconnect(this._source_conn);k.unsubscribe(this._source_sub);l.prototype.destroy.call(this.source);this.bottomMarker&&(q.destroy(this.bottomMarker),delete this.bottomMarker);
this.topMarker&&(q.destroy(this.topMarker),delete this.topMarker)}),onDndCancel:e.hitch(this,function(){l.prototype.onDndCancel.call(this.source);this._hide(this.bottomMarker);this._hide(this.topMarker)})});this._source_conn=k.connect(this.source,"onDndDrop",this,"_onDndDrop");this._source_sub=k.subscribe("/dnd/drop/before",this,"_onDndDropBefore");this.source.startup()}},_hide:function(a){q.style(a,{top:"-10000px",visibility:"hidden"})},_onDndDropBefore:function(a,b,c){y.manager().target===this.source&&
(this.source._targetNode=this.source.targetAnchor,this.source._beforeTarget=this.source.before,b=this.grid.views.views,a=b[a.viewIndex],b=b[this.index],b!=a&&(a.convertColPctToFixed(),b.convertColPctToFixed()))},_onDndDrop:function(a,b,c){if(y.manager().target!==this.source)y.manager().source===this.source&&(this._removingColumn=!0);else{this._hide(this.bottomMarker);this._hide(this.topMarker);c=function(a){return a?q.attr(a,"idx"):null};var d=q.marginBox(b[0]).w;if(a.viewIndex!==this.index){var e=
this.grid.views.views,f=e[a.viewIndex],e=e[this.index];f.viewWidth&&"auto"!=f.viewWidth&&f.setColumnsWidth(f.getColumnsWidth()-d);e.viewWidth&&"auto"!=e.viewWidth&&e.setColumnsWidth(e.getColumnsWidth())}d=this.source._targetNode;f=this.source._beforeTarget;!this.grid.isLeftToRight()&&(f=!f);var e=this.grid.layout,g=this.index;delete this.source._targetNode;delete this.source._beforeTarget;e.moveColumn(a.viewIndex,g,c(b[0]),c(d),f)}},renderHeader:function(){this.headerContentNode.innerHTML=this.header.generateHtml(this._getHeaderContent);
this.flexCells&&(this.contentWidth=this.getContentWidth(),this.headerContentNode.firstChild.style.width=this.contentWidth);b.fire(this,"onAfterRow",[-1,this.structure.cells,this.headerContentNode])},_getHeaderContent:function(a){var b=a.name||a.grid.getCellName(a);/^\s+$/.test(b)&&(b="\x26nbsp;");var c=['\x3cdiv class\x3d"dojoxGridSortNode'];a.index!=a.grid.getSortIndex()?c.push('"\x3e'):c=c.concat([" ",0<a.grid.sortInfo?"dojoxGridSortUp":"dojoxGridSortDown",'"\x3e\x3cdiv class\x3d"dojoxGridArrowButtonChar"\x3e',
0<a.grid.sortInfo?"\x26#9650;":"\x26#9660;",'\x3c/div\x3e\x3cdiv class\x3d"dojoxGridArrowButtonNode" role\x3d"presentation"\x3e\x3c/div\x3e','\x3cdiv class\x3d"dojoxGridColCaption"\x3e']);c=c.concat([b,"\x3c/div\x3e\x3c/div\x3e"]);return c.join("")},resize:function(){this.adaptHeight();this.adaptWidth()},hasHScrollbar:function(a){var b=this._hasHScroll||!1;if(void 0==this._hasHScroll||a)this.noscroll?this._hasHScroll=!1:(a=q.style(this.scrollboxNode,"overflow"),this._hasHScroll="hidden"==a?!1:"scroll"==
a?!0:this.scrollboxNode.offsetWidth-this.getScrollbarWidth()<this.contentNode.offsetWidth);b!==this._hasHScroll&&this.grid.update();return this._hasHScroll},hasVScrollbar:function(a){var b=this._hasVScroll||!1;if(void 0==this._hasVScroll||a)this.noscroll?this._hasVScroll=!1:(a=q.style(this.scrollboxNode,"overflow"),this._hasVScroll="hidden"==a?!1:"scroll"==a?!0:this.scrollboxNode.scrollHeight>this.scrollboxNode.clientHeight);b!==this._hasVScroll&&this.grid.update();return this._hasVScroll},convertColPctToFixed:function(){var a=
!1;this.grid.initialWidth="";var b=g("th",this.headerContentNode),c=h.map(b,function(b,c){var d=b.style.width;q.attr(b,"vIdx",c);if(d&&"%"==d.slice(-1))a=!0;else if(d&&"px"==d.slice(-2))return window.parseInt(d,10);return q.contentBox(b).w});return a?(h.forEach(this.grid.layout.cells,function(a,b){if(a.view==this){var d=a.view.getHeaderCellNode(a.index);if(d&&q.hasAttr(d,"vIdx")){var e=window.parseInt(q.attr(d,"vIdx"));this.setColWidth(b,c[e]);q.removeAttr(d,"vIdx")}}},this),!0):!1},adaptHeight:function(a){if(!this.grid._autoHeight){var c=
this.domNode.style.height&&parseInt(this.domNode.style.height.replace(/px/,""),10)||this.domNode.clientHeight;if(!a&&(a=this.noscroll))a:{for(var d=0;d<this.grid.views.views.length;++d)if(a=this.grid.views.views[d],a!==this&&a.hasHScrollbar()){a=!0;break a}a=!1}a&&(c-=f.getScrollbar().h);b.setStyleHeightPx(this.scrollboxNode,c)}this.hasVScrollbar(!0)},adaptWidth:function(){this.flexCells&&(this.contentWidth=this.getContentWidth(),this.headerContentNode.firstChild.style.width=this.contentWidth);var a=
this.scrollboxNode.offsetWidth-this.getScrollbarWidth();this._removingColumn?(a=Math.min(a,this.getColumnsWidth())+"px",this._removingColumn=!1):a=Math.max(a,this.getColumnsWidth())+"px";this.contentNode.style.width=a;this.hasHScrollbar(!0)},setSize:function(a,b){var c=this.domNode.style,d=this.headerNode.style;a&&(c.width=a,d.width=a);c.height=0<=b?b+"px":""},renderRow:function(a){var b=this.createRowNode(a);this.buildRow(a,b);return b},createRowNode:function(a){var c=document.createElement("div");
c.className=this.classTag+"Row";this instanceof p.grid._RowSelector?q.attr(c,"role","presentation"):(q.attr(c,"role","row"),"none"!=this.grid.selectionMode&&c.setAttribute("aria-selected","false"));c[b.gridViewTag]=this.id;c[b.rowIndexTag]=a;return this.rowNodes[a]=c},buildRow:function(a,b){this.buildRowContent(a,b);this.styleRow(a,b)},buildRowContent:function(a,c){c.innerHTML=this.content.generateHtml(a,a);this.flexCells&&this.contentWidth&&(c.firstChild.style.width=this.contentWidth);b.fire(this,
"onAfterRow",[a,this.structure.cells,c])},rowRemoved:function(a){0<=a&&this._cleanupRowWidgets(this.getRowNode(a));this.grid.edit.save(this,a);delete this.rowNodes[a]},getRowNode:function(a){return this.rowNodes[a]},getCellNode:function(a,b){var c=this.getRowNode(a);if(c)return this.content.getCellNode(c,b)},getHeaderCellNode:function(a){if(this.headerContentNode)return this.header.getCellNode(this.headerContentNode,a)},styleRow:function(a,b){var c;c=void 0==b.style.cssText?b.getAttribute("style"):
b.style.cssText;b._style=c;this.styleRowNode(a,b)},styleRowNode:function(a,b){b&&this.doStyleRowNode(a,b)},doStyleRowNode:function(a,b){this.grid.styleRowNode(a,b)},updateRow:function(a){var b=this.getRowNode(a);b&&(b.style.height="",this.buildRow(a,b));return b},updateRowStyles:function(a){this.styleRowNode(a,this.getRowNode(a))},lastTop:0,firstScroll:0,_nativeScroll:!1,doscroll:function(a){if(13<=d("ff")||d("chrome"))this._nativeScroll=!0;a=this.grid.isLeftToRight();if(2>this.firstScroll){if(!a&&
1==this.firstScroll||a&&0===this.firstScroll){var b=q.marginBox(this.headerNodeContainer);d("ie")?this.headerNodeContainer.style.width=b.w+this.getScrollbarWidth()+"px":d("mozilla")&&(this.headerNodeContainer.style.width=b.w-this.getScrollbarWidth()+"px",this.scrollboxNode.scrollLeft=a?this.scrollboxNode.clientWidth-this.scrollboxNode.scrollWidth:this.scrollboxNode.scrollWidth-this.scrollboxNode.clientWidth)}this.firstScroll++}this.headerNode.scrollLeft=this.scrollboxNode.scrollLeft;a=this.scrollboxNode.scrollTop;
a!==this.lastTop&&this.grid.scrollTo(a);this._nativeScroll=!1},setScrollTop:function(a){this.lastTop=a;this._nativeScroll||(this.scrollboxNode.scrollTop=a);return this.scrollboxNode.scrollTop},doContentEvent:function(a){if(this.content.decorateEvent(a))this.grid.onContentEvent(a)},doHeaderEvent:function(a){if(this.header.decorateEvent(a))this.grid.onHeaderEvent(a)},dispatchContentEvent:function(a){return this.content.dispatchEvent(a)},dispatchHeaderEvent:function(a){return this.header.dispatchEvent(a)},
setColWidth:function(a,b){this.grid.setCellWidth(a,b+"px")},update:function(){if(this.domNode){this.content.update();this.grid.update();var a=this.scrollboxNode.scrollLeft;this.scrollboxNode.scrollLeft=a;this.headerNode.scrollLeft=a}}});var B=m("dojox.grid._GridAvatar",A,{construct:function(){var a=c.doc,b=a.createElement("table");b.cellPadding=b.cellSpacing="0";b.className="dojoxGridDndAvatar";b.style.position="absolute";b.style.zIndex=1999;b.style.margin="0px";var d=a.createElement("tbody"),e=a.createElement("tr"),
f=a.createElement("td"),g=a.createElement("td");e.className="dojoxGridDndAvatarItem";g.className="dojoxGridDndAvatarItemImage";g.style.width="16px";var h=this.manager.source;if(h.creator)h=h._normalizedCreator(h.getItem(this.manager.nodes[0].id).data,"avatar").node;else{var h=this.manager.nodes[0].cloneNode(!0),k,l;"tr"==h.tagName.toLowerCase()?(k=a.createElement("table"),l=a.createElement("tbody"),l.appendChild(h),k.appendChild(l),h=k):"th"==h.tagName.toLowerCase()&&(k=a.createElement("table"),l=
a.createElement("tbody"),a=a.createElement("tr"),k.cellPadding=k.cellSpacing="0",a.appendChild(h),l.appendChild(a),k.appendChild(l),h=k)}h.id="";f.appendChild(h);e.appendChild(g);e.appendChild(f);q.style(e,"opacity",.9);d.appendChild(e);b.appendChild(d);this.node=b;b=y.manager();this.oldOffsetY=b.OFFSET_Y;b.OFFSET_Y=1},destroy:function(){y.manager().OFFSET_Y=this.oldOffsetY;this.inherited(arguments)}}),x=y.manager().makeAvatar;y.manager().makeAvatar=function(){return void 0===this.source.viewIndex||
q.hasClass(c.body(),"dijit_a11y")?x.call(y.manager()):new B(this)};return a})},"dojo/dnd/Source":function(){define("../_base/array ../_base/declare ../_base/kernel ../_base/lang ../dom-class ../dom-geometry ../mouse ../ready ../topic ./common ./Selector ./Manager".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l){p.isAsync||d(0,function(){require(["dojo/dnd/AutoSource","dojo/dnd/Target"])});var t=n("dojo.dnd.Source",a,{isSource:!0,horizontal:!1,copyOnly:!1,selfCopy:!1,selfAccept:!0,skipForm:!1,withHandles:!1,
autoSync:!1,delay:0,accept:["text"],generateText:!0,constructor:function(a,c){m.mixin(this,m.mixin({},c));var b=this.accept;if(b.length){this.accept={};for(var d=0;d<b.length;++d)this.accept[b[d]]=1}this.mouseDown=this.isDragging=!1;this.targetBox=this.targetAnchor=null;this.before=!0;this._lastY=this._lastX=0;this.sourceState="";this.isSource&&h.add(this.node,"dojoDndSource");this.targetState="";this.accept&&h.add(this.node,"dojoDndTarget");this.horizontal&&h.add(this.node,"dojoDndHorizontal");this.topics=
[g.subscribe("/dnd/source/over",m.hitch(this,"onDndSourceOver")),g.subscribe("/dnd/start",m.hitch(this,"onDndStart")),g.subscribe("/dnd/drop",m.hitch(this,"onDndDrop")),g.subscribe("/dnd/cancel",m.hitch(this,"onDndCancel"))]},checkAcceptance:function(a,c){if(this==a)return!this.copyOnly||this.selfAccept;for(var b=0;b<c.length;++b){for(var d=a.getItem(c[b].id).type,e=!1,f=0;f<d.length;++f)if(d[f]in this.accept){e=!0;break}if(!e)return!1}return!0},copyState:function(a,c){if(a)return!0;2>arguments.length&&
(c=this==l.manager().target);if(c){if(this.copyOnly)return this.selfCopy}else return this.copyOnly;return!1},destroy:function(){t.superclass.destroy.call(this);r.forEach(this.topics,function(a){a.remove()});this.targetAnchor=null},onMouseMove:function(a){if(!this.isDragging||"Disabled"!=this.targetState){t.superclass.onMouseMove.call(this,a);var d=l.manager();if(!this.isDragging&&this.mouseDown&&this.isSource&&(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay)){var b=
this.getSelectedNodes();b.length&&d.startDrag(this,b,this.copyState(c.getCopyKeyState(a),!0))}this.isDragging&&(b=!1,this.current&&(this.targetBox&&this.targetAnchor==this.current||(this.targetBox=e.position(this.current,!0)),b=this.horizontal?a.pageX-this.targetBox.x<this.targetBox.w/2==e.isBodyLtr(this.current.ownerDocument):a.pageY-this.targetBox.y<this.targetBox.h/2),this.current!=this.targetAnchor||b!=this.before)&&(this._markTargetAnchor(b),d.canDrop(!this.current||d.source!=this||!(this.current.id in
this.selection)))}},onMouseDown:function(a){this.mouseDown||!this._legalMouseDown(a)||this.skipForm&&c.isFormElement(a)||(this.mouseDown=!0,this._lastX=a.pageX,this._lastY=a.pageY,t.superclass.onMouseDown.call(this,a))},onMouseUp:function(a){this.mouseDown&&(this.mouseDown=!1,t.superclass.onMouseUp.call(this,a))},onDndSourceOver:function(a){this!==a?(this.mouseDown=!1,this.targetAnchor&&this._unmarkTargetAnchor()):this.isDragging&&(a=l.manager(),a.canDrop("Disabled"!=this.targetState&&(!this.current||
a.source!=this||!(this.current.id in this.selection))))},onDndStart:function(a,c,b){this.autoSync&&this.sync();this.isSource&&this._changeState("Source",this==a?b?"Copied":"Moved":"");c=this.accept&&this.checkAcceptance(a,c);this._changeState("Target",c?"":"Disabled");this==a&&l.manager().overSource(this);this.isDragging=!0},onDndDrop:function(a,c,b,d){if(this==d)this.onDrop(a,c,b);this.onDndCancel()},onDndCancel:function(){this.targetAnchor&&(this._unmarkTargetAnchor(),this.targetAnchor=null);this.before=
!0;this.mouseDown=this.isDragging=!1;this._changeState("Source","");this._changeState("Target","")},onDrop:function(a,c,b){if(this!=a)this.onDropExternal(a,c,b);else this.onDropInternal(c,b)},onDropExternal:function(a,d,b){var e=this._normalizedCreator;this._normalizedCreator=this.creator?function(b,c){return e.call(this,a.getItem(b.id).data,c)}:b?function(b){var d=a.getItem(b.id);b=b.cloneNode(!0);b.id=c.getUniqueId();return{node:b,data:d.data,type:d.type}}:function(b){var c=a.getItem(b.id);a.delItem(b.id);
return{node:b,data:c.data,type:c.type}};this.selectNone();b||this.creator||a.selectNone();this.insertNodes(!0,d,this.before,this.current);!b&&this.creator&&a.deleteSelectedNodes();this._normalizedCreator=e},onDropInternal:function(a,d){var b=this._normalizedCreator;if(!(this.current&&this.current.id in this.selection)){if(d)this._normalizedCreator=this.creator?function(a,c){return b.call(this,this.getItem(a.id).data,c)}:function(a){var b=this.getItem(a.id);a=a.cloneNode(!0);a.id=c.getUniqueId();return{node:a,
data:b.data,type:b.type}};else{if(!this.current)return;this._normalizedCreator=function(a){var b=this.getItem(a.id);return{node:a,data:b.data,type:b.type}}}this._removeSelection();this.insertNodes(!0,a,this.before,this.current);this._normalizedCreator=b}},onDraggingOver:function(){},onDraggingOut:function(){},onOverEvent:function(){t.superclass.onOverEvent.call(this);l.manager().overSource(this);if(this.isDragging&&"Disabled"!=this.targetState)this.onDraggingOver()},onOutEvent:function(){t.superclass.onOutEvent.call(this);
l.manager().outSource(this);if(this.isDragging&&"Disabled"!=this.targetState)this.onDraggingOut()},_markTargetAnchor:function(a){if(this.current!=this.targetAnchor||this.before!=a)this.targetAnchor&&this._removeItemClass(this.targetAnchor,this.before?"Before":"After"),this.targetAnchor=this.current,this.targetBox=null,this.before=a,this.targetAnchor&&this._addItemClass(this.targetAnchor,this.before?"Before":"After")},_unmarkTargetAnchor:function(){this.targetAnchor&&(this._removeItemClass(this.targetAnchor,
this.before?"Before":"After"),this.targetBox=this.targetAnchor=null,this.before=!0)},_markDndStatus:function(a){this._changeState("Source",a?"Copied":"Moved")},_legalMouseDown:function(a){if("touchstart"!=a.type&&!k.isLeft(a))return!1;if(!this.withHandles)return!0;for(a=a.target;a&&a!==this.node;a=a.parentNode){if(h.contains(a,"dojoDndHandle"))return!0;if(h.contains(a,"dojoDndItem")||h.contains(a,"dojoDndIgnore"))break}return!1}});return t})},"dojo/dnd/common":function(){define(["../sniff","../_base/kernel",
"../_base/lang","../dom"],function(r,n,p,m){var h=p.getObject("dojo.dnd",!0);h.getCopyKeyState=function(e){return e[r("mac")?"metaKey":"ctrlKey"]};h._uniqueId=0;h.getUniqueId=function(){var e;do e=n._scopeName+"Unique"+ ++h._uniqueId;while(m.byId(e));return e};h._empty={};h.isFormElement=function(e){e=e.target;3==e.nodeType&&(e=e.parentNode);return 0<=" a button textarea input select option ".indexOf(" "+e.tagName.toLowerCase()+" ")};return h})},"dojo/dnd/Selector":function(){define("../_base/array ../_base/declare ../_base/kernel ../_base/lang ../dom ../dom-construct ../mouse ../_base/NodeList ../on ../touch ./common ./Container".split(" "),
function(r,n,p,m,h,e,k,d,g,c,a,l){var t=n("dojo.dnd.Selector",l,{constructor:function(a,d){d||(d={});this.singular=d.singular;this.autoSync=d.autoSync;this.selection={};this.anchor=null;this.simpleSelection=!1;this.events.push(g(this.node,c.press,m.hitch(this,"onMouseDown")),g(this.node,c.release,m.hitch(this,"onMouseUp")))},singular:!1,getSelectedNodes:function(){var c=new d,e=a._empty,b;for(b in this.selection)b in e||c.push(h.byId(b));return c},selectNone:function(){return this._removeSelection()._removeAnchor()},
selectAll:function(){this.forInItems(function(a,c){this._addItemClass(h.byId(c),"Selected");this.selection[c]=1},this);return this._removeAnchor()},deleteSelectedNodes:function(){var c=a._empty,d;for(d in this.selection)if(!(d in c)){var b=h.byId(d);this.delItem(d);e.destroy(b)}this.anchor=null;this.selection={};return this},forInSelectedItems:function(c,d){d=d||p.global;var b=this.selection,e=a._empty,f;for(f in b)f in e||c.call(d,this.getItem(f),f,this)},sync:function(){t.superclass.sync.call(this);
this.anchor&&!this.getItem(this.anchor.id)&&(this.anchor=null);var c=[],d=a._empty,b;for(b in this.selection)b in d||this.getItem(b)||c.push(b);r.forEach(c,function(a){delete this.selection[a]},this);return this},insertNodes:function(a,c,b,d){var e=this._normalizedCreator;this._normalizedCreator=function(b,c){var d=e.call(this,b,c);a?(this.anchor?this.anchor!=d.node&&(this._removeItemClass(d.node,"Anchor"),this._addItemClass(d.node,"Selected")):(this.anchor=d.node,this._removeItemClass(d.node,"Selected"),
this._addItemClass(this.anchor,"Anchor")),this.selection[d.node.id]=1):(this._removeItemClass(d.node,"Selected"),this._removeItemClass(d.node,"Anchor"));return d};t.superclass.insertNodes.call(this,c,b,d);this._normalizedCreator=e;return this},destroy:function(){t.superclass.destroy.call(this);this.selection=this.anchor=null},onMouseDown:function(c){this.autoSync&&this.sync();if(this.current)if(!this.singular&&!a.getCopyKeyState(c)&&!c.shiftKey&&this.current.id in this.selection)this.simpleSelection=
!0,k.isLeft(c)&&(c.stopPropagation(),c.preventDefault());else{if(!this.singular&&c.shiftKey){a.getCopyKeyState(c)||this._removeSelection();var d=this.getAllNodes();if(d.length&&(this.anchor||(this.anchor=d[0],this._addItemClass(this.anchor,"Anchor")),this.selection[this.anchor.id]=1,this.anchor!=this.current)){for(var b=0,e;b<d.length&&(e=d[b],e!=this.anchor&&e!=this.current);++b);for(++b;b<d.length;++b){e=d[b];if(e==this.anchor||e==this.current)break;this._addItemClass(e,"Selected");this.selection[e.id]=
1}this._addItemClass(this.current,"Selected");this.selection[this.current.id]=1}}else this.singular?this.anchor==this.current?a.getCopyKeyState(c)&&this.selectNone():(this.selectNone(),this.anchor=this.current,this._addItemClass(this.anchor,"Anchor"),this.selection[this.current.id]=1):a.getCopyKeyState(c)?this.anchor==this.current?(delete this.selection[this.anchor.id],this._removeAnchor()):this.current.id in this.selection?(this._removeItemClass(this.current,"Selected"),delete this.selection[this.current.id]):
(this.anchor&&(this._removeItemClass(this.anchor,"Anchor"),this._addItemClass(this.anchor,"Selected")),this.anchor=this.current,this._addItemClass(this.current,"Anchor"),this.selection[this.current.id]=1):this.current.id in this.selection||(this.selectNone(),this.anchor=this.current,this._addItemClass(this.current,"Anchor"),this.selection[this.current.id]=1);c.stopPropagation();c.preventDefault()}},onMouseUp:function(){this.simpleSelection&&(this.simpleSelection=!1,this.selectNone(),this.current&&
(this.anchor=this.current,this._addItemClass(this.anchor,"Anchor"),this.selection[this.current.id]=1))},onMouseMove:function(){this.simpleSelection=!1},onOverEvent:function(){this.onmousemoveEvent=g(this.node,c.move,m.hitch(this,"onMouseMove"))},onOutEvent:function(){this.onmousemoveEvent&&(this.onmousemoveEvent.remove(),delete this.onmousemoveEvent)},_removeSelection:function(){var c=a._empty,d;for(d in this.selection)if(!(d in c)){var b=h.byId(d);b&&this._removeItemClass(b,"Selected")}this.selection=
{};return this},_removeAnchor:function(){this.anchor&&(this._removeItemClass(this.anchor,"Anchor"),this.anchor=null);return this}});return t})},"dojo/dnd/Container":function(){define("../_base/array ../_base/declare ../_base/kernel ../_base/lang ../_base/window ../dom ../dom-class ../dom-construct ../Evented ../has ../on ../query ../touch ./common".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l,t,v){n=n("dojo.dnd.Container",g,{skipForm:!1,allowNested:!1,constructor:function(c,b){this.node=e.byId(c);
b||(b={});this.creator=b.creator||null;this.skipForm=b.skipForm;this.parent=b.dropParent&&e.byId(b.dropParent);this.map={};this.current=null;this.containerState="";k.add(this.node,"dojoDndContainer");b&&b._skipStartup||this.startup();this.events=[a(this.node,t.over,m.hitch(this,"onMouseOver")),a(this.node,t.out,m.hitch(this,"onMouseOut")),a(this.node,"dragstart",m.hitch(this,"onSelectStart")),a(this.node,"selectstart",m.hitch(this,"onSelectStart"))]},creator:function(){},getItem:function(a){return this.map[a]},
setItem:function(a,b){this.map[a]=b},delItem:function(a){delete this.map[a]},forInItems:function(a,b){b=b||p.global;var c=this.map,d=v._empty,e;for(e in c)e in d||a.call(b,c[e],e,this);return b},clearItems:function(){this.map={}},getAllNodes:function(){return l((this.allowNested?"":"\x3e ")+".dojoDndItem",this.parent)},sync:function(){var a={};this.getAllNodes().forEach(function(b){if(b.id){var c=this.getItem(b.id);if(c){a[b.id]=c;return}}else b.id=v.getUniqueId();var c=b.getAttribute("dndType"),
d=b.getAttribute("dndData");a[b.id]={data:d||b.innerHTML,type:c?c.split(/\s*,\s*/):["text"]}},this);this.map=a;return this},insertNodes:function(a,b,c){this.parent.firstChild?b?c||(c=this.parent.firstChild):c&&(c=c.nextSibling):c=null;var d;if(c)for(b=0;b<a.length;++b)d=this._normalizedCreator(a[b]),this.setItem(d.node.id,{data:d.data,type:d.type}),c.parentNode.insertBefore(d.node,c);else for(b=0;b<a.length;++b)d=this._normalizedCreator(a[b]),this.setItem(d.node.id,{data:d.data,type:d.type}),this.parent.appendChild(d.node);
return this},destroy:function(){r.forEach(this.events,function(a){a.remove()});this.clearItems();this.node=this.parent=this.current=null},markupFactory:function(a,b,c){a._skipStartup=!0;return new c(b,a)},startup:function(){if(!this.parent&&(this.parent=this.node,"table"==this.parent.tagName.toLowerCase())){var a=this.parent.getElementsByTagName("tbody");a&&a.length&&(this.parent=a[0])}this.defaultCreator=v._defaultCreator(this.parent);this.sync()},onMouseOver:function(a){for(var b=a.relatedTarget;b&&
b!=this.node;)try{b=b.parentNode}catch(q){b=null}b||(this._changeState("Container","Over"),this.onOverEvent());b=this._getChildByEvent(a);this.current!=b&&(this.current&&this._removeItemClass(this.current,"Over"),b&&this._addItemClass(b,"Over"),this.current=b)},onMouseOut:function(a){for(a=a.relatedTarget;a;){if(a==this.node)return;try{a=a.parentNode}catch(b){a=null}}this.current&&(this._removeItemClass(this.current,"Over"),this.current=null);this._changeState("Container","");this.onOutEvent()},onSelectStart:function(a){this.withHandles||
this.skipForm&&v.isFormElement(a)||(a.stopPropagation(),a.preventDefault())},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(a,b){var c="dojoDnd"+a,d=a.toLowerCase()+"State";k.replace(this.node,c+b,c+this[d]);this[d]=b},_addItemClass:function(a,b){k.add(a,"dojoDndItem"+b)},_removeItemClass:function(a,b){k.remove(a,"dojoDndItem"+b)},_getChildByEvent:function(a){if(a=a.target)for(var b=a.parentNode;b;a=b,b=a.parentNode)if((b==this.parent||this.allowNested)&&k.contains(a,"dojoDndItem"))return a;
return null},_normalizedCreator:function(a,b){var c=(this.creator||this.defaultCreator).call(this,a,b);m.isArray(c.type)||(c.type=["text"]);c.node.id||(c.node.id=v.getUniqueId());k.add(c.node,"dojoDndItem");return c}});v._createNode=function(a){return a?function(b){return d.create(a,{innerHTML:b})}:v._createSpan};v._createTrTd=function(a){var b=d.create("tr");d.create("td",{innerHTML:a},b);return b};v._createSpan=function(a){return d.create("span",{innerHTML:a})};v._defaultCreatorNodes={ul:"li",ol:"li",
div:"div",p:"div"};v._defaultCreator=function(a){a=a.tagName.toLowerCase();var b="tbody"==a||"thead"==a?v._createTrTd:v._createNode(v._defaultCreatorNodes[a]);return function(a,c){var d=a&&m.isObject(a),e,f;d&&a.tagName&&a.nodeType&&a.getAttribute?(e=a.getAttribute("dndData")||a.innerHTML,d=(d=a.getAttribute("dndType"))?d.split(/\s*,\s*/):["text"],f=a):(e=d&&a.data?a.data:a,d=d&&a.type?a.type:["text"],f=("avatar"==c?v._createSpan:b)(String(e)));f.id||(f.id=v.getUniqueId());return{node:f,data:e,type:d}}};
return n})},"dojo/dnd/Manager":function(){define("../_base/array ../_base/declare ../_base/lang ../_base/window ../dom-class ../Evented ../has ../keys ../on ../topic ../touch ./common ./autoscroll ./Avatar".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l,t,v){var f=n("dojo.dnd.Manager",[e],{constructor:function(){this.source=this.avatar=null;this.nodes=[];this.copy=!0;this.target=null;this.canDropFlag=!1;this.events=[]},OFFSET_X:k("touch")?4:16,OFFSET_Y:k("touch")?4:16,overSource:function(a){this.avatar&&
(this.target=a&&"Disabled"!=a.targetState?a:null,this.canDropFlag=!!this.target,this.avatar.update());c.publish("/dnd/source/over",a)},outSource:function(a){this.avatar?this.target==a&&(this.target=null,this.canDropFlag=!1,this.avatar.update(),c.publish("/dnd/source/over",null)):c.publish("/dnd/source/over",null)},startDrag:function(b,d,e){function f(a){a.preventDefault();a.stopPropagation()}t.autoScrollStart(m.doc);this.source=b;this.nodes=d;this.copy=!!e;this.avatar=this.makeAvatar();m.body().appendChild(this.avatar.node);
c.publish("/dnd/start",b,d,this.copy);this.events=[g(m.doc,a.move,p.hitch(this,"onMouseMove")),g(m.doc,a.release,p.hitch(this,"onMouseUp")),g(m.doc,"keydown",p.hitch(this,"onKeyDown")),g(m.doc,"keyup",p.hitch(this,"onKeyUp")),g(m.doc,"dragstart",f),g(m.body(),"selectstart",f)];b="dojoDnd"+(e?"Copy":"Move");h.add(m.body(),b)},canDrop:function(a){a=!(!this.target||!a);this.canDropFlag!=a&&(this.canDropFlag=a,this.avatar.update())},stopDrag:function(){h.remove(m.body(),["dojoDndCopy","dojoDndMove"]);
r.forEach(this.events,function(a){a.remove()});this.events=[];this.avatar.destroy();this.source=this.target=this.avatar=null;this.nodes=[]},makeAvatar:function(){return new v(this)},updateAvatar:function(){this.avatar.update()},onMouseMove:function(a){var b=this.avatar;b&&(t.autoScrollNodes(a),b=b.node.style,b.left=a.pageX+this.OFFSET_X+"px",b.top=a.pageY+this.OFFSET_Y+"px",b=!!this.source.copyState(l.getCopyKeyState(a)),this.copy!=b&&this._setCopyStatus(b));k("touch")&&a.preventDefault()},onMouseUp:function(a){if(this.avatar){if(this.target&&
this.canDropFlag){var b=!!this.source.copyState(l.getCopyKeyState(a));c.publish("/dnd/drop/before",this.source,this.nodes,b,this.target,a);c.publish("/dnd/drop",this.source,this.nodes,b,this.target,a)}else c.publish("/dnd/cancel");this.stopDrag()}},onKeyDown:function(a){if(this.avatar)switch(a.keyCode){case d.CTRL:a=!!this.source.copyState(!0);this.copy!=a&&this._setCopyStatus(a);break;case d.ESCAPE:c.publish("/dnd/cancel"),this.stopDrag()}},onKeyUp:function(a){this.avatar&&a.keyCode==d.CTRL&&(a=
!!this.source.copyState(!1),this.copy!=a&&this._setCopyStatus(a))},_setCopyStatus:function(a){this.copy=a;this.source._markDndStatus(this.copy);this.updateAvatar();h.replace(m.body(),"dojoDnd"+(this.copy?"Copy":"Move"),"dojoDnd"+(this.copy?"Move":"Copy"))}});l._manager=null;f.manager=l.manager=function(){l._manager||(l._manager=new f);return l._manager};return f})},"dojo/dnd/autoscroll":function(){define("../_base/lang ../sniff ../_base/window ../dom-geometry ../dom-style ../window".split(" "),function(r,
n,p,m,h,e){var k={};r.setObject("dojo.dnd.autoscroll",k);k.getViewport=e.getBox;k.V_TRIGGER_AUTOSCROLL=32;k.H_TRIGGER_AUTOSCROLL=32;k.V_AUTOSCROLL_VALUE=16;k.H_AUTOSCROLL_VALUE=16;var d,g=p.doc,c=Infinity,a=Infinity;k.autoScrollStart=function(h){g=h;d=e.getBox(g);h=p.body(g).parentNode;c=Math.max(h.scrollHeight-d.h,0);a=Math.max(h.scrollWidth-d.w,0)};k.autoScroll=function(h){var l=d||e.getBox(g),m=p.body(g).parentNode,f=0,b=0;h.clientX<k.H_TRIGGER_AUTOSCROLL?f=-k.H_AUTOSCROLL_VALUE:h.clientX>l.w-
k.H_TRIGGER_AUTOSCROLL&&(f=Math.min(k.H_AUTOSCROLL_VALUE,a-m.scrollLeft));h.clientY<k.V_TRIGGER_AUTOSCROLL?b=-k.V_AUTOSCROLL_VALUE:h.clientY>l.h-k.V_TRIGGER_AUTOSCROLL&&(b=Math.min(k.V_AUTOSCROLL_VALUE,c-m.scrollTop));window.scrollBy(f,b)};k._validNodes={div:1,p:1,td:1};k._validOverflow={auto:1,scroll:1};k.autoScrollNodes=function(a){for(var c,d,e,b,g,l=0,r=0,y=a.target;y;){if(1==y.nodeType&&y.tagName.toLowerCase()in k._validNodes){e=h.getComputedStyle(y);g=e.overflowX.toLowerCase()in k._validOverflow;
b=e.overflowY.toLowerCase()in k._validOverflow;if(g||b)c=m.getContentBox(y,e),d=m.position(y,!0);if(g){e=Math.min(k.H_TRIGGER_AUTOSCROLL,c.w/2);g=a.pageX-d.x;if(n("webkit")||n("opera"))g+=p.body().scrollLeft;l=0;0<g&&g<c.w&&(g<e?l=-e:g>c.w-e&&(l=e),y.scrollLeft+=l)}if(b){b=Math.min(k.V_TRIGGER_AUTOSCROLL,c.h/2);e=a.pageY-d.y;if(n("webkit")||n("opera"))e+=p.body().scrollTop;r=0;0<e&&e<c.h&&(e<b?r=-b:e>c.h-b&&(r=b),y.scrollTop+=r)}if(l||r)return}try{y=y.parentNode}catch(B){y=null}}k.autoScroll(a)};
return k})},"dojo/dnd/Avatar":function(){define("../_base/declare ../_base/window ../dom ../dom-attr ../dom-class ../dom-construct ../hccss ../query".split(" "),function(r,n,p,m,h,e,k,d){return r("dojo.dnd.Avatar",null,{constructor:function(d){this.manager=d;this.construct()},construct:function(){var d=e.create("table",{"class":"dojoDndAvatar",style:{position:"absolute",zIndex:"1999",margin:"0px"}}),c=this.manager.source,a,h=e.create("tbody",null,d),n=e.create("tr",null,h),p=e.create("td",null,n),
f=Math.min(5,this.manager.nodes.length),b=0;k("highcontrast")&&e.create("span",{id:"a11yIcon",innerHTML:this.manager.copy?"+":"\x3c"},p);e.create("span",{innerHTML:c.generateText?this._generateText():""},p);for(m.set(n,{"class":"dojoDndAvatarHeader",style:{opacity:.9}});b<f;++b)c.creator?a=c._normalizedCreator(c.getItem(this.manager.nodes[b].id).data,"avatar").node:(a=this.manager.nodes[b].cloneNode(!0),"tr"==a.tagName.toLowerCase()&&(n=e.create("table"),e.create("tbody",null,n).appendChild(a),a=
n)),a.id="",n=e.create("tr",null,h),p=e.create("td",null,n),p.appendChild(a),m.set(n,{"class":"dojoDndAvatarItem",style:{opacity:(9-b)/10}});this.node=d},destroy:function(){e.destroy(this.node);this.node=!1},update:function(){h.toggle(this.node,"dojoDndAvatarCanDrop",this.manager.canDropFlag);if(k("highcontrast")){var e=p.byId("a11yIcon"),c="+";this.manager.canDropFlag&&!this.manager.copy?c="\x3c ":this.manager.canDropFlag||this.manager.copy?this.manager.canDropFlag||(c="x"):c="o";e.innerHTML=c}d("tr.dojoDndAvatarHeader td span"+
(k("highcontrast")?" span":""),this.node).forEach(function(a){a.innerHTML=this.manager.source.generateText?this._generateText():""},this)},_generateText:function(){return this.manager.nodes.length.toString()}})})},"dojox/html/metrics":function(){define("dojo/_base/kernel dojo/_base/lang dojo/_base/sniff dojo/ready dojo/_base/unload dojo/_base/window dojo/dom-geometry".split(" "),function(r,n,p,m,h,e,k){var d=n.getObject("dojox.html.metrics",!0),g=n.getObject("dojox");d.getFontMeasurements=function(){var a=
{"1em":0,"1ex":0,"100%":0,"12pt":0,"16px":0,"xx-small":0,"x-small":0,small:0,medium:0,large:0,"x-large":0,"xx-large":0},b;p("ie")&&(b=e.doc.documentElement.style.fontSize||"",b||(e.doc.documentElement.style.fontSize="100%"));var c=e.doc.createElement("div"),d=c.style;d.position="absolute";d.left="-100px";d.top="0";d.width="30px";d.height="1000em";d.borderWidth="0";d.margin="0";d.padding="0";d.outline="0";d.lineHeight="1";d.overflow="hidden";e.body().appendChild(c);for(var g in a)d.fontSize=g,a[g]=
16*Math.round(12*c.offsetHeight/16)/12/1E3;p("ie")&&(e.doc.documentElement.style.fontSize=b);e.body().removeChild(c);c=null;return a};var c=null;d.getCachedFontMeasurements=function(a){if(a||!c)c=d.getFontMeasurements();return c};var a=null,l={};d.getTextBox=function(c,b,d){var f,g;if(a)f=a;else{f=a=e.doc.createElement("div");var h=e.doc.createElement("div");h.appendChild(f);g=h.style;g.overflow="scroll";g.position="absolute";g.left="0px";g.top="-10000px";g.width="1px";g.height="1px";g.visibility=
"hidden";g.borderWidth="0";g.margin="0";g.padding="0";g.outline="0";e.body().appendChild(h)}f.className="";g=f.style;g.borderWidth="0";g.margin="0";g.padding="0";g.outline="0";if(1<arguments.length&&b)for(var m in b)m in l||(g[m]=b[m]);2<arguments.length&&d&&(f.className=d);f.innerHTML=c;g=k.position(f);g.w=f.parentNode.scrollWidth;return g};var t=16,v=16;d.getScrollbar=function(){return{w:t,h:v}};d._fontResizeNode=null;d.initOnFontResize=function(a){var b=d._fontResizeNode=e.doc.createElement("iframe");
a=b.style;a.position="absolute";a.width="5em";a.height="10em";a.top="-10000px";a.display="none";p("ie")?b.onreadystatechange=function(){"complete"==b.contentWindow.document.readyState&&(b.onresize=b.contentWindow.parent[g._scopeName].html.metrics._fontresize)}:b.onload=function(){b.contentWindow.onresize=b.contentWindow.parent[g._scopeName].html.metrics._fontresize};b.setAttribute("src","javascript:'\x3chtml\x3e\x3chead\x3e\x3cscript\x3eif(\"loadFirebugConsole\" in window){window.loadFirebugConsole();}\x3c/script\x3e\x3c/head\x3e\x3cbody\x3e\x3c/body\x3e\x3c/html\x3e'");
e.body().appendChild(b);d.initOnFontResize=function(){}};d.onFontResize=function(){};d._fontresize=function(){d.onFontResize()};h.addOnUnload(function(){var a=d._fontResizeNode;a&&(p("ie")&&a.onresize?a.onresize=null:a.contentWindow&&a.contentWindow.onresize&&(a.contentWindow.onresize=null),d._fontResizeNode=null)});m(function(){try{var a=e.doc.createElement("div");a.style.cssText="top:0;left:0;width:100px;height:100px;overflow:scroll;position:absolute;visibility:hidden;";e.body().appendChild(a);
t=a.offsetWidth-a.clientWidth;v=a.offsetHeight-a.clientHeight;e.body().removeChild(a);delete a}catch(b){}"fontSizeWatch"in r.config&&r.config.fontSizeWatch&&d.initOnFontResize()});return d})},"dojox/grid/_Builder":function(){define("../main dojo/_base/array dojo/_base/lang dojo/_base/window dojo/_base/event dojo/_base/sniff dojo/_base/connect dojo/dnd/Moveable dojox/html/metrics ./util dojo/_base/html dojo/dom-geometry".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l){var t=r.grid,v=function(a){return 0<=
a.rowIndex?a.rowIndex:n.indexOf(a.parentNode.childNodes,a)},f=function(a,b){return a&&((a.rows||0)[b]||a.childNodes[b])},b=function(a){for(;a&&"TABLE"!=a.tagName;a=a.parentNode);return a},q=function(a){var b=a.toUpperCase();return function(a){return a.tagName!=b}},u=c.rowIndexTag,A=c.gridViewTag,y=t._Builder=p.extend(function(a){a&&(this.view=a,this.grid=a.grid)},{view:null,_table:'\x3ctable class\x3d"dojoxGridRowTable" border\x3d"0" cellspacing\x3d"0" cellpadding\x3d"0" role\x3d"presentation"',getTableArray:function(){var a=
[this._table];this.view.viewWidth&&a.push([' style\x3d"width:',this.view.viewWidth,';"'].join(""));a.push("\x3e");return a},generateCellMarkup:function(a,b,c,d){var e=[],f;d?(f=a.index!=a.grid.getSortIndex()?"":0<a.grid.sortInfo?'aria-sort\x3d"ascending"':'aria-sort\x3d"descending"',a.id||(a.id=this.grid.id+"Hdr"+a.index),f=['\x3cth tabIndex\x3d"-1" aria-readonly\x3d"true" role\x3d"columnheader"',f,' id\x3d"',a.id,'"']):f=['\x3ctd tabIndex\x3d"-1" role\x3d"gridcell"',this.grid.editable&&!a.editable?
'aria-readonly\x3d"true"':""];a.colSpan&&f.push(' colspan\x3d"',a.colSpan,'"');a.rowSpan&&f.push(' rowspan\x3d"',a.rowSpan,'"');f.push(' class\x3d"dojoxGridCell ');a.classes&&f.push(a.classes," ");c&&f.push(c," ");e.push(f.join(""));e.push("");f=['" idx\x3d"',a.index,'" style\x3d"'];b&&";"!=b[b.length-1]&&(b+=";");f.push(a.styles,b||"",a.hidden?"display:none;":"");a.unitWidth&&f.push("width:",a.unitWidth,";");e.push(f.join(""));e.push("");f=['"'];a.attrs&&f.push(" ",a.attrs);f.push("\x3e");e.push(f.join(""));
e.push("");e.push(d?"\x3c/th\x3e":"\x3c/td\x3e");return e},isCellNode:function(b){return!(!b||b==m.doc||!a.attr(b,"idx"))},getCellNodeIndex:function(b){return b?Number(a.attr(b,"idx")):-1},getCellNode:function(a,b){for(var c=0,d;(d=f(a.firstChild,c))&&d.cells;c++)for(var e=0,g;g=d.cells[e];e++)if(this.getCellNodeIndex(g)==b)return g;return null},findCellTarget:function(a,b){for(var c=a;c&&(!this.isCellNode(c)||c.offsetParent&&A in c.offsetParent.parentNode&&c.offsetParent.parentNode[A]!=this.view.id)&&
c!=b;)c=c.parentNode;return c!=b?c:null},baseDecorateEvent:function(a){a.dispatch="do"+a.type;a.grid=this.grid;a.sourceView=this.view;a.cellNode=this.findCellTarget(a.target,a.rowNode);a.cellIndex=this.getCellNodeIndex(a.cellNode);a.cell=0<=a.cellIndex?this.grid.getCell(a.cellIndex):null},findTarget:function(a,b){for(var c=a;c&&c!=this.domNode&&(!(b in c)||A in c&&c[A]!=this.view.id);)c=c.parentNode;return c!=this.domNode?c:null},findRowTarget:function(a){return this.findTarget(a,u)},isIntraNodeEvent:function(b){try{return b.cellNode&&
b.relatedTarget&&a.isDescendant(b.relatedTarget,b.cellNode)}catch(w){return!1}},isIntraRowEvent:function(a){try{var b=a.relatedTarget&&this.findRowTarget(a.relatedTarget);return!b&&-1==a.rowIndex||b&&a.rowIndex==b.gridRowIndex}catch(z){return!1}},dispatchEvent:function(a){return a.dispatch in this?this[a.dispatch](a):!1},domouseover:function(a){a.cellNode&&a.cellNode!=this.lastOverCellNode&&(this.lastOverCellNode=a.cellNode,this.grid.onMouseOver(a));this.grid.onMouseOverRow(a)},domouseout:function(a){if(a.cellNode&&
a.cellNode==this.lastOverCellNode&&!this.isIntraNodeEvent(a,this.lastOverCellNode)&&(this.lastOverCellNode=null,this.grid.onMouseOut(a),!this.isIntraRowEvent(a)))this.grid.onMouseOutRow(a)},domousedown:function(a){if(a.cellNode)this.grid.onMouseDown(a);this.grid.onMouseDownRow(a)},_getTextDirStyle:function(a,b,c){return""}});r=t._ContentBuilder=p.extend(function(a){y.call(this,a)},y.prototype,{update:function(){this.prepareHtml()},prepareHtml:function(){for(var a=this.grid.get,b=this.view.structure.cells,
c=0,d;d=b[c];c++)for(var e=0,f;f=d[e];e++)f.get=f.get||void 0==f.value&&a,f.markup=this.generateCellMarkup(f,f.cellStyles,f.cellClasses,!1),!this.grid.editable&&f.editable&&(this.grid.editable=!0)},generateHtml:function(a,b){var d=this.getTableArray(),e,f=this.view.structure.cells,g=this.grid.getItem(b);c.fire(this.view,"onBeforeRow",[b,f]);for(var h=0,k;k=f[h];h++)if(!k.hidden&&!k.header){d.push(k.invisible?'\x3ctr class\x3d"dojoxGridInvisible"\x3e':"\x3ctr\x3e");for(var l=0,m,n,q;m=k[l];l++)n=m.markup,
e=m.customClasses=[],q=m.customStyles=[],n[5]=m.format(b,g),n[1]=e.join(" "),n[3]=q.join(";"),(e=m.textDir||this.grid.textDir)&&(n[3]+=this._getTextDirStyle(e,m,b)),d.push.apply(d,n);d.push("\x3c/tr\x3e")}d.push("\x3c/table\x3e");return d.join("")},decorateEvent:function(a){a.rowNode=this.findRowTarget(a.target);if(!a.rowNode)return!1;a.rowIndex=a.rowNode[u];this.baseDecorateEvent(a);a.cell=this.grid.getCell(a.cellIndex);return!0}});var B=t._HeaderBuilder=p.extend(function(a){this.moveable=null;y.call(this,
a)},y.prototype,{_skipBogusClicks:!1,overResizeWidth:4,minColWidth:1,update:function(){this.tableMap?this.tableMap.mapRows(this.view.structure.cells):this.tableMap=new t._TableMap(this.view.structure.cells)},generateHtml:function(a,b){var d,e=this.getTableArray(),f=this.view.structure.cells;c.fire(this.view,"onBeforeRow",[-1,f]);for(var g=0,h;h=f[g];g++)if(!h.hidden){e.push(h.invisible?'\x3ctr class\x3d"dojoxGridInvisible"\x3e':"\x3ctr\x3e");for(var k=0,l,m;l=h[k];k++)l.customClasses=[],l.customStyles=
[],this.view.simpleStructure&&(l.draggable&&(l.headerClasses?-1==l.headerClasses.indexOf("dojoDndItem")&&(l.headerClasses+=" dojoDndItem"):l.headerClasses="dojoDndItem"),l.attrs?-1==l.attrs.indexOf("dndType\x3d'gridColumn_")&&(l.attrs+=" dndType\x3d'gridColumn_"+this.grid.id+"'"):l.attrs="dndType\x3d'gridColumn_"+this.grid.id+"'"),m=this.generateCellMarkup(l,l.headerStyles,l.headerClasses,!0),m[5]=void 0!=b?b:a(l),m[3]=l.customStyles.join(";"),(d=l.textDir||this.grid.textDir)&&(m[3]+=this._getTextDirStyle(d,
l,b)),m[1]=l.customClasses.join(" "),e.push(m.join(""));e.push("\x3c/tr\x3e")}e.push("\x3c/table\x3e");return e.join("")},getCellX:function(a){var b;b=q("th");for(var c=a.target;c&&b(c);c=c.parentNode);(b=c)?(b=l.position(b),a=a.clientX-b.x):a=a.layerX;return a},decorateEvent:function(a){this.baseDecorateEvent(a);a.rowIndex=-1;a.cellX=this.getCellX(a);return!0},prepareResize:function(a,b){do{var c=a.cellIndex;a.cellNode=c?a.cellNode.parentNode.cells[c+b]:null;a.cellIndex=a.cellNode?this.getCellNodeIndex(a.cellNode):
-1}while(a.cellNode&&"none"==a.cellNode.style.display);return!!a.cellNode},canResize:function(a){if(!a.cellNode||1<a.cellNode.colSpan)return!1;a=this.grid.getCell(a.cellIndex);return!a.noresize&&a.canResize()},overLeftResizeArea:function(b){if(a.hasClass(m.body(),"dojoDndMove"))return!1;if(e("ie")){var c=b.target;if(a.hasClass(c,"dojoxGridArrowButtonNode")||a.hasClass(c,"dojoxGridArrowButtonChar")||a.hasClass(c,"dojoxGridColCaption"))return!1}return this.grid.isLeftToRight()?0<b.cellIndex&&0<b.cellX&&
b.cellX<this.overResizeWidth&&this.prepareResize(b,-1):b.cellNode&&0<b.cellX&&b.cellX<this.overResizeWidth},overRightResizeArea:function(b){if(a.hasClass(m.body(),"dojoDndMove"))return!1;if(e("ie")){var c=b.target;if(a.hasClass(c,"dojoxGridArrowButtonNode")||a.hasClass(c,"dojoxGridArrowButtonChar")||a.hasClass(c,"dojoxGridColCaption"))return!1}return this.grid.isLeftToRight()?b.cellNode&&b.cellX>=b.cellNode.offsetWidth-this.overResizeWidth:0<b.cellIndex&&b.cellX>=b.cellNode.offsetWidth-this.overResizeWidth&&
this.prepareResize(b,-1)},domousemove:function(b){if(!this.moveable){var c=this.overRightResizeArea(b)?"dojoxGridColResize":this.overLeftResizeArea(b)?"dojoxGridColResize":"";c&&!this.canResize(b)&&(c="dojoxGridColNoResize");a.toggleClass(b.sourceView.headerNode,"dojoxGridColNoResize","dojoxGridColNoResize"==c);a.toggleClass(b.sourceView.headerNode,"dojoxGridColResize","dojoxGridColResize"==c);c&&h.stop(b)}},domousedown:function(a){this.moveable||((this.overRightResizeArea(a)||this.overLeftResizeArea(a))&&
this.canResize(a)?this.beginColumnResize(a):(this.grid.onMouseDown(a),this.grid.onMouseOverRow(a)))},doclick:function(a){return this._skipBogusClicks?(h.stop(a),!0):!1},colResizeSetup:function(b,c){var d=a.contentBox(b.sourceView.headerNode);if(c){this.lineDiv=document.createElement("div");var f=a.position(b.sourceView.headerNode,!0),h=a.contentBox(b.sourceView.domNode),k=b.pageX;!this.grid.isLeftToRight()&&8>e("ie")&&(k-=g.getScrollbar().w);a.style(this.lineDiv,{top:f.y+"px",left:k+"px",height:h.h+
d.h+"px"});a.addClass(this.lineDiv,"dojoxGridResizeColLine");this.lineDiv._origLeft=k;m.body().appendChild(this.lineDiv)}for(var f=[],h=this.tableMap.findOverlappingNodes(b.cellNode),k=0,l;l=h[k];k++)f.push({node:l,index:this.getCellNodeIndex(l),width:l.offsetWidth});h=b.sourceView;l=this.grid.isLeftToRight()?1:-1;for(var n=b.grid.views.views,k=[],q=h.idx+l,p;p=n[q];q+=l)k.push({node:p.headerNode,left:window.parseInt(p.headerNode.style.left)});l=h.headerContentNode.firstChild;return{scrollLeft:b.sourceView.headerNode.scrollLeft,
view:h,node:b.cellNode,index:b.cellIndex,w:a.contentBox(b.cellNode).w,vw:d.w,table:l,tw:a.contentBox(l).w,spanners:f,followers:k}},beginColumnResize:function(b){this.moverDiv=document.createElement("div");a.style(this.moverDiv,{position:"absolute",left:0});m.body().appendChild(this.moverDiv);a.addClass(this.grid.domNode,"dojoxGridColumnResizing");var c=this.moveable=new d(this.moverDiv),e=this.colResizeSetup(b,!0);c.onMove=p.hitch(this,"doResizeColumn",e);k.connect(c,"onMoveStop",p.hitch(this,function(){this.endResizeColumn(e);
e.node.releaseCapture&&e.node.releaseCapture();this.moveable.destroy();delete this.moveable;this.moveable=null;a.removeClass(this.grid.domNode,"dojoxGridColumnResizing")}));b.cellNode.setCapture&&b.cellNode.setCapture();c.onMouseDown(b)},doResizeColumn:function(b,c,d){var e=d.l,e={deltaX:e,w:b.w+(this.grid.isLeftToRight()?e:-e),vw:b.vw+e,tw:b.tw+e};this.dragRecord={inDrag:b,mover:c,leftTop:d};e.w>=this.minColWidth&&(c?a.style(this.lineDiv,"left",this.lineDiv._origLeft+e.deltaX+"px"):this.doResizeNow(b,
e))},endResizeColumn:function(b){if(this.dragRecord){var c=this.dragRecord.leftTop,c=this.grid.isLeftToRight()?c.l:-c.l,c=c+(Math.max(b.w+c,this.minColWidth)-(b.w+c));e("webkit")&&b.spanners.length&&(c+=a._getPadBorderExtents(b.spanners[0].node).w);this.doResizeNow(b,{deltaX:c,w:b.w+c,vw:b.vw+c,tw:b.tw+c});delete this.dragRecord}a.destroy(this.lineDiv);a.destroy(this.moverDiv);a.destroy(this.moverDiv);delete this.moverDiv;this._skipBogusClicks=!0;b.view.update();this._skipBogusClicks=!1;this.grid.onResizeColumn(b.index)},
doResizeNow:function(a,c){a.view.convertColPctToFixed();if(a.view.flexCells&&!a.view.testFlexCells()){var d=b(a.node);d&&(d.style.width="")}for(var f,g,d=0;f=a.spanners[d];d++)g=f.width+c.deltaX,0<g&&(f.node.style.width=g+"px",a.view.setColWidth(f.index,g));if(this.grid.isLeftToRight()||!e("ie"))for(d=0;f=a.followers[d];d++)g=f.left+c.deltaX,f.node.style.left=g+"px";a.node.style.width=c.w+"px";a.view.setColWidth(a.index,c.w);a.view.headerNode.style.width=c.vw+"px";a.view.setColumnsWidth(c.tw);this.grid.isLeftToRight()||
(a.view.headerNode.scrollLeft=a.scrollLeft+c.deltaX)}});t._TableMap=p.extend(function(a){this.mapRows(a)},{map:null,mapRows:function(a){if(a.length){this.map=[];for(var b,c=0;b=a[c];c++)this.map[c]=[];for(c=0;b=a[c];c++)for(var d=0,e=0,f,g;f=b[d];d++){for(;this.map[c][e];)e++;this.map[c][e]={c:d,r:c};g=f.rowSpan||1;f=f.colSpan||1;for(var h=0;h<g;h++)for(var k=0;k<f;k++)this.map[c+h][e+k]=this.map[c][e];e+=f}}},dumpMap:function(){for(var a=0,b;b=this.map[a];a++)for(var c=0;b[c];c++);},getMapCoords:function(a,
b){for(var c=0,d;d=this.map[c];c++)for(var e=0,f;f=d[e];e++)if(f.c==b&&f.r==a)return{j:c,i:e};return{j:-1,i:-1}},getNode:function(a,b,c){return(a=a&&a.rows[b])&&a.cells[c]},_findOverlappingNodes:function(a,b,c){var d=[];b=this.getMapCoords(b,c);c=0;for(var e;e=this.map[c];c++)c!=b.j&&(e=(e=e[b.i])?this.getNode(a,e.r,e.c):null)&&d.push(e);return d},findOverlappingNodes:function(a){return this._findOverlappingNodes(b(a),v(a.parentNode),0<=a.cellIndex?a.cellIndex:n.indexOf(a.parentNode.cells,a))}});
return{_Builder:y,_HeaderBuilder:B,_ContentBuilder:r}})},"dojo/dnd/Moveable":function(){define("../_base/array ../_base/declare ../_base/lang ../dom ../dom-class ../Evented ../has ../on ../topic ../touch ./common ./Mover ../_base/window".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l,t){function v(a,c){"touchAction"in document.body.style?f="touchAction":"msTouchAction"in document.body.style&&(f="msTouchAction");b=function(a,b){a.style[f]=b};b(a,c)}var f,b=function(){};k("touch-action")&&(b=v);return n("dojo.dnd.Moveable",
[e],{handle:"",delay:0,skip:!1,constructor:function(a,e){this.node=m.byId(a);b(this.node,"none");e||(e={});this.handle=e.handle?m.byId(e.handle):null;this.handle||(this.handle=this.node);this.delay=0<e.delay?e.delay:0;this.skip=e.skip;this.mover=e.mover?e.mover:l;this.events=[d(this.handle,c.press,p.hitch(this,"onMouseDown")),d(this.handle,"dragstart",p.hitch(this,"onSelectStart")),d(this.handle,"selectstart",p.hitch(this,"onSelectStart"))]},markupFactory:function(a,b,c){return new c(b,a)},destroy:function(){r.forEach(this.events,
function(a){a.remove()});b(this.node,"");this.events=this.node=this.handle=null},onMouseDown:function(b){if(!this.skip||!a.isFormElement(b)){if(this.delay)this.events.push(d(this.handle,c.move,p.hitch(this,"onMouseMove")),d(this.handle.ownerDocument,c.release,p.hitch(this,"onMouseUp"))),this._lastX=b.pageX,this._lastY=b.pageY;else this.onDragDetected(b);b.stopPropagation();b.preventDefault()}},onMouseMove:function(a){if(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay)this.onMouseUp(a),
this.onDragDetected(a);a.stopPropagation();a.preventDefault()},onMouseUp:function(a){for(var b=0;2>b;++b)this.events.pop().remove();a.stopPropagation();a.preventDefault()},onSelectStart:function(b){this.skip&&a.isFormElement(b)||(b.stopPropagation(),b.preventDefault())},onDragDetected:function(a){new this.mover(this.node,a,this)},onMoveStart:function(a){g.publish("/dnd/move/start",a);h.add(t.body(),"dojoMove");h.add(this.node,"dojoMoveItem")},onMoveStop:function(a){g.publish("/dnd/move/stop",a);h.remove(t.body(),
"dojoMove");h.remove(this.node,"dojoMoveItem")},onFirstMove:function(){},onMove:function(a,b){this.onMoving(a,b);var c=a.node.style;c.left=b.l+"px";c.top=b.t+"px";this.onMoved(a,b)},onMoving:function(){},onMoved:function(){}})})},"dojo/dnd/Mover":function(){define("../_base/array ../_base/declare ../_base/lang ../sniff ../_base/window ../dom ../dom-geometry ../dom-style ../Evented ../on ../touch ./common ./autoscroll".split(" "),function(r,n,p,m,h,e,k,d,g,c,a,l,t){return n("dojo.dnd.Mover",[g],{constructor:function(d,
f,b){function g(a){a.preventDefault();a.stopPropagation()}this.node=e.byId(d);this.marginBox={l:f.pageX,t:f.pageY};this.mouseButton=f.button;f=this.host=b;d=d.ownerDocument;this.events=[c(d,a.move,p.hitch(this,"onFirstMove")),c(d,a.move,p.hitch(this,"onMouseMove")),c(d,a.release,p.hitch(this,"onMouseUp")),c(d,"dragstart",g),c(d.body,"selectstart",g)];t.autoScrollStart(d);if(f&&f.onMoveStart)f.onMoveStart(this)},onMouseMove:function(a){t.autoScroll(a);var c=this.marginBox;this.host.onMove(this,{l:c.l+
a.pageX,t:c.t+a.pageY},a);a.preventDefault();a.stopPropagation()},onMouseUp:function(a){(m("webkit")&&m("mac")&&2==this.mouseButton?0==a.button:this.mouseButton==a.button)&&this.destroy();a.preventDefault();a.stopPropagation()},onFirstMove:function(a){var c=this.node.style,b,e=this.host;switch(c.position){case "relative":case "absolute":b=Math.round(parseFloat(c.left))||0;c=Math.round(parseFloat(c.top))||0;break;default:c.position="absolute";c=k.getMarginBox(this.node);b=h.doc.body;var g=d.getComputedStyle(b),
l=k.getMarginBox(b,g),g=k.getContentBox(b,g);b=c.l-(g.l-l.l);c=c.t-(g.t-l.t)}this.marginBox.l=b-this.marginBox.l;this.marginBox.t=c-this.marginBox.t;if(e&&e.onFirstMove)e.onFirstMove(this,a);this.events.shift().remove()},destroy:function(){r.forEach(this.events,function(a){a.remove()});var a=this.host;if(a&&a.onMoveStop)a.onMoveStop(this);this.events=this.node=this.host=null}})})},"dojox/grid/_ViewManager":function(){define(["dojo/_base/declare","dojo/_base/sniff","dojo/dom-class"],function(r,n,p){return r("dojox.grid._ViewManager",
null,{constructor:function(m){this.grid=m},defaultWidth:200,views:[],resize:function(){this.onEach("resize")},render:function(){this.onEach("render")},addView:function(m){m.idx=this.views.length;this.views.push(m)},destroyViews:function(){for(var m=0,h;h=this.views[m];m++)h.destroy();this.views=[]},getContentNodes:function(){for(var m=[],h=0,e;e=this.views[h];h++)m.push(e.contentNode);return m},forEach:function(m){for(var h=0,e;e=this.views[h];h++)m(e,h)},onEach:function(m,h){h=h||[];for(var e=0,
k;k=this.views[e];e++)m in k&&k[m].apply(k,h)},normalizeHeaderNodeHeight:function(){for(var m=[],h=0,e;e=this.views[h];h++)e.headerContentNode.firstChild&&m.push(e.headerContentNode);this.normalizeRowNodeHeights(m)},normalizeRowNodeHeights:function(m){var h=0,e=[];if(this.grid.rowHeight)h=this.grid.rowHeight;else{if(1>=m.length)return;for(var k=0,d;d=m[k];k++)p.contains(d,"dojoxGridNonNormalizedCell")||(e[k]=d.firstChild.offsetHeight,h=Math.max(h,e[k]));h=0<=h?h:0;(n("mozilla")||8<n("ie"))&&h&&h++}for(k=
0;d=m[k];k++)e[k]!=h&&(d.firstChild.style.height=h+"px")},resetHeaderNodeHeight:function(){for(var m=0,h;h=this.views[m];m++)if(h=h.headerContentNode.firstChild)h.style.height=""},renormalizeRow:function(m){for(var h=[],e=0,k,d;(k=this.views[e])&&(d=k.getRowNode(m));e++)d.firstChild.style.height="",h.push(d);this.normalizeRowNodeHeights(h)},getViewWidth:function(m){return this.views[m].getWidth()||this.defaultWidth},measureHeader:function(){this.resetHeaderNodeHeight();this.forEach(function(h){h.headerContentNode.style.height=
""});var m=0;this.forEach(function(h){m=Math.max(h.headerNode.offsetHeight,m)});return m},measureContent:function(){var m=0;this.forEach(function(h){m=Math.max(h.domNode.offsetHeight,m)});return m},findClient:function(m){m=this.grid.elasticView||-1;if(0>m)for(var h=1,e;e=this.views[h];h++)if(e.viewWidth){for(h=1;e=this.views[h];h++)if(!e.viewWidth){m=h;break}break}0>m&&(m=Math.floor(this.views.length/2));return m},arrange:function(m,h){var e,k,d,g=this.views.length,c=this,a=0>=h?g:this.findClient(),
l=function(a,b){var d=a.domNode.style,e=a.headerNode.style;c.grid.isLeftToRight()?(d.left=b+"px",e.left=b+"px"):(d.right=b+"px",4>n("ff")?e.right=b+a.getScrollbarWidth()+"px":e.right=b+"px",n("webkit")||"auto"==e.width||(e.width=parseInt(e.width,10)-a.getScrollbarWidth()+"px"));d.top="0px";e.top=0};for(e=0;(k=this.views[e])&&e<a;e++)d=this.getViewWidth(e),k.setSize(d,0),l(k,m),d=k.headerContentNode&&k.headerContentNode.firstChild?k.getColumnsWidth()+k.getScrollbarWidth():k.domNode.offsetWidth,m+=
d;e++;for(var p=h,r=g-1;(k=this.views[r])&&e<=r;r--)d=this.getViewWidth(r),k.setSize(d,0),d=k.domNode.offsetWidth,p-=d,l(k,p);a<g&&(k=this.views[a],d=Math.max(1,p-m),k.setSize(d+"px",0),l(k,m));return m},renderRow:function(m,h,e){for(var k=[],d=0,g,c;(g=this.views[d])&&(c=h[d]);d++)g=g.renderRow(m),c.appendChild(g),k.push(g);e||this.normalizeRowNodeHeights(k)},rowRemoved:function(m){this.onEach("rowRemoved",[m])},updateRow:function(m,h){for(var e=0,k;k=this.views[e];e++)k.updateRow(m);h||this.renormalizeRow(m)},
updateRowStyles:function(m){this.onEach("updateRowStyles",[m])},setScrollTop:function(m){for(var h=m,e=0,k;k=this.views[e];e++)h=k.setScrollTop(m),n("ie")&&k.headerNode&&k.scrollboxNode&&(k.headerNode.scrollLeft=k.scrollboxNode.scrollLeft);return h},getFirstScrollingView:function(){for(var m=0,h;h=this.views[m];m++)if(h.hasHScrollbar()||h.hasVScrollbar())return h;return null}})})},"dojox/grid/_RowManager":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/dom-class"],function(r,n,p){return r("dojox.grid._RowManager",
null,{constructor:function(m){this.grid=m},linesToEms:2,overRow:-2,prepareStylingRow:function(m,h){return{index:m,node:h,odd:!!(m&1),selected:!!this.grid.selection.isSelected(m),over:this.isOver(m),customStyles:"",customClasses:"dojoxGridRow"}},styleRowNode:function(m,h){var e=this.prepareStylingRow(m,h);this.grid.onStyleRow(e);this.applyStyles(e)},applyStyles:function(m){m.node.className=m.customClasses;var h=m.node.style.height,e=m.node,k=m.customStyles+";"+(m.node._style||"");void 0==e.style.cssText?
e.setAttribute("style",k):e.style.cssText=k;m.node.style.height=h},updateStyles:function(m){this.grid.updateRowStyles(m)},setOverRow:function(m){var h=this.overRow;this.overRow=m;h!=this.overRow&&(n.isString(h)||0<=h)&&this.updateStyles(h);this.updateStyles(this.overRow)},isOver:function(m){return this.overRow==m&&!p.contains(this.grid.domNode,"dojoxGridColumnResizing")}})})},"dojox/grid/_FocusManager":function(){define("dojo/_base/array dojo/_base/lang dojo/_base/declare dojo/_base/connect dojo/_base/event dojo/_base/sniff dojo/query ./util dojo/_base/html".split(" "),
function(r,n,p,m,h,e,k,d,g){return p("dojox.grid._FocusManager",null,{constructor:function(c){this.grid=c;this.cell=null;this.rowIndex=-1;this._connects=[];this._headerConnects=[];this.headerMenu=this.grid.headerMenu;this._connects.push(m.connect(this.grid.domNode,"onfocus",this,"doFocus"));this._connects.push(m.connect(this.grid.domNode,"onblur",this,"doBlur"));this._connects.push(m.connect(this.grid.domNode,"mousedown",this,"_mouseDown"));this._connects.push(m.connect(this.grid.domNode,"mouseup",
this,"_mouseUp"));this._connects.push(m.connect(this.grid.domNode,"oncontextmenu",this,"doContextMenu"));this._connects.push(m.connect(this.grid.lastFocusNode,"onfocus",this,"doLastNodeFocus"));this._connects.push(m.connect(this.grid.lastFocusNode,"onblur",this,"doLastNodeBlur"));this._connects.push(m.connect(this.grid,"_onFetchComplete",this,"_delayedCellFocus"));this._connects.push(m.connect(this.grid,"postrender",this,"_delayedHeaderFocus"))},destroy:function(){r.forEach(this._connects,m.disconnect);
r.forEach(this._headerConnects,m.disconnect);delete this.grid;delete this.cell},_colHeadNode:null,_colHeadFocusIdx:null,_contextMenuBindNode:null,tabbingOut:!1,focusClass:"dojoxGridCellFocus",focusView:null,initFocusView:function(){this.focusView=this.grid.views.getFirstScrollingView()||this.focusView||this.grid.views.views[0];this._initColumnHeaders()},isFocusCell:function(c,a){return this.cell==c&&this.rowIndex==a},isLastFocusCell:function(){return this.cell?this.rowIndex==this.grid.rowCount-1&&
this.cell.index==this.grid.layout.cellCount-1:!1},isFirstFocusCell:function(){return this.cell?0===this.rowIndex&&0===this.cell.index:!1},isNoFocusCell:function(){return 0>this.rowIndex||!this.cell},isNavHeader:function(){return!!this._colHeadNode},getHeaderIndex:function(){return this._colHeadNode?r.indexOf(this._findHeaderCells(),this._colHeadNode):-1},_focusifyCellNode:function(c){var a=this.cell&&this.cell.getNode(this.rowIndex);if(a&&(g.toggleClass(a,this.focusClass,c),c)){c=this.scrollIntoView();
try{if(e("webkit")||!this.grid.edit.isEditing())d.fire(a,"focus"),c&&(this.cell.view.scrollboxNode.scrollLeft=c)}catch(l){}}},_delayedCellFocus:function(){if(!this.isNavHeader()&&this.grid.focused){var c=this.cell&&this.cell.getNode(this.rowIndex);if(c)try{this.grid.edit.isEditing()||(g.toggleClass(c,this.focusClass,!0),this._colHeadNode&&this.blurHeader(),d.fire(c,"focus"))}catch(a){}}},_delayedHeaderFocus:function(){this.isNavHeader()&&this.focusHeader()},_initColumnHeaders:function(){r.forEach(this._headerConnects,
m.disconnect);this._headerConnects=[];for(var c=this._findHeaderCells(),a=0;a<c.length;a++)this._headerConnects.push(m.connect(c[a],"onfocus",this,"doColHeaderFocus")),this._headerConnects.push(m.connect(c[a],"onblur",this,"doColHeaderBlur"))},_findHeaderCells:function(){for(var c=k("th",this.grid.viewsHeaderNode),a=[],d=0;d<c.length;d++){var e=c[d],h=g.hasAttr(e,"tabIndex"),f=g.attr(e,"tabIndex");h&&0>f&&a.push(e)}return a},_setActiveColHeader:function(c,a,d){this.grid.domNode.setAttribute("aria-activedescendant",
c.id);null!=d&&0<=d&&d!=a&&g.toggleClass(this._findHeaderCells()[d],this.focusClass,!1);g.toggleClass(c,this.focusClass,!0);this._colHeadNode=c;this._colHeadFocusIdx=a;this._scrollHeader(this._colHeadFocusIdx)},scrollIntoView:function(){var c=this.cell?this._scrollInfo(this.cell):null;if(!c||!c.s)return null;var a=this.grid.scroller.findScrollTop(this.rowIndex);c.n&&c.sr&&(c.n.offsetLeft+c.n.offsetWidth>c.sr.l+c.sr.w?c.s.scrollLeft=c.n.offsetLeft+c.n.offsetWidth-c.sr.w:c.n.offsetLeft<c.sr.l&&(c.s.scrollLeft=
c.n.offsetLeft));c.r&&c.sr&&(a+c.r.offsetHeight>c.sr.t+c.sr.h?this.grid.setScrollTop(a+c.r.offsetHeight-c.sr.h):a<c.sr.t&&this.grid.setScrollTop(a));return c.s.scrollLeft},_scrollInfo:function(c,a){if(c){var d=c.view.scrollboxNode,e={w:d.clientWidth,l:d.scrollLeft,t:d.scrollTop,h:d.clientHeight},g=c.view.getRowNode(this.rowIndex);return{c:c,s:d,sr:e,n:a?a:c.getNode(this.rowIndex),r:g}}return null},_scrollHeader:function(c){var a=null;if(this._colHeadNode){var d=this.grid.getCell(c);if(!d)return;a=
this._scrollInfo(d,d.getNode(0))}a&&a.s&&a.sr&&a.n&&(a.n.offsetLeft+a.n.offsetWidth>a.sr.l+a.sr.w?a.s.scrollLeft=a.n.offsetLeft+a.n.offsetWidth-a.sr.w:a.n.offsetLeft<a.sr.l?a.s.scrollLeft=a.n.offsetLeft:7>=e("ie")&&d&&d.view.headerNode&&(d.view.headerNode.scrollLeft=a.s.scrollLeft))},_isHeaderHidden:function(){var c=this.focusView;if(!c)for(var a=0,d;d=this.grid.views.views[a];a++)if(d.headerNode){c=d;break}return c&&"none"==g.getComputedStyle(c.headerNode).display},colSizeAdjust:function(c,a,d){var e=
this._findHeaderCells(),g=this.focusView;if(!g||!g.header.tableMap.map)for(var f=0,b;b=this.grid.views.views[f];f++)if(b.header.tableMap.map){g=b;break}f=e[a];!g||a==e.length-1&&0===a||(g.content.baseDecorateEvent(c),c.cellNode=f,c.cellIndex=g.content.getCellNodeIndex(c.cellNode),c.cell=0<=c.cellIndex?this.grid.getCell(c.cellIndex):null,g.header.canResize(c)&&(a={l:d},c=g.header.colResizeSetup(c,!1),g.header.doResizeColumn(c,null,a),g.update()))},styleRow:function(c){},setFocusIndex:function(c,a){this.setFocusCell(this.grid.getCell(a),
c)},setFocusCell:function(c,a){c&&!this.isFocusCell(c,a)&&(this.tabbingOut=!1,this._colHeadNode&&this.blurHeader(),this._colHeadNode=this._colHeadFocusIdx=null,this.focusGridView(),this._focusifyCellNode(!1),this.cell=c,this.rowIndex=a,this._focusifyCellNode(!0));if(e("opera"))setTimeout(n.hitch(this.grid,"onCellFocus",this.cell,this.rowIndex),1);else this.grid.onCellFocus(this.cell,this.rowIndex)},next:function(){if(this.cell){var c=this.rowIndex,a=this.cell.index+1,d=this.grid.layout.cellCount-
1,e=this.grid.rowCount-1;a>d&&(a=0,c++);c>e&&(a=d,c=e);if(this.grid.edit.isEditing()&&(d=this.grid.getCell(a),!this.isLastFocusCell()&&(!d.editable||this.grid.canEdit&&!this.grid.canEdit(d,c)))){this.cell=d;this.rowIndex=c;this.next();return}this.setFocusIndex(c,a)}},previous:function(){if(this.cell){var c=this.rowIndex||0,a=(this.cell.index||0)-1;0>a&&(a=this.grid.layout.cellCount-1,c--);0>c&&(a=c=0);if(this.grid.edit.isEditing()){var d=this.grid.getCell(a);if(!this.isFirstFocusCell()&&!d.editable){this.cell=
d;this.rowIndex=c;this.previous();return}}this.setFocusIndex(c,a)}},move:function(c,a){var d=0>a?-1:1;if(this.isNavHeader()){var e=this._findHeaderCells(),h=currentIdx=r.indexOf(e,this._colHeadNode);for(currentIdx+=a;0<=currentIdx&&currentIdx<e.length&&"none"==e[currentIdx].style.display;)currentIdx+=d;0<=currentIdx&&currentIdx<e.length&&this._setActiveColHeader(e[currentIdx],currentIdx,h)}else if(this.cell){var f=this.grid.scroller,e=this.rowIndex,h=this.grid.rowCount-1,b=Math.min(h,Math.max(0,e+
c));c&&(0<c?b>f.getLastPageRow(f.page)&&this.grid.setScrollTop(this.grid.scrollTop+f.findScrollTop(b)-f.findScrollTop(e)):0>c&&b<=f.getPageRow(f.page)&&this.grid.setScrollTop(this.grid.scrollTop-f.findScrollTop(e)-f.findScrollTop(b)));for(var f=this.grid.layout.cellCount-1,k=this.cell.index,m=Math.min(f,Math.max(0,k+a)),n=this.grid.getCell(m);0<=m&&m<f&&n&&!0===n.hidden;)m+=d,n=this.grid.getCell(m);n&&!0!==n.hidden||(m=k);d=n.getNode(b);!d&&c?0<=b+c&&b+c<=h&&this.move(0<c?++c:--c,a):d&&"none"!==g.style(d,
"display")||!a?(this.setFocusIndex(b,m),c&&this.grid.updateRow(e)):0<=m+a&&m+a<=f&&this.move(c,0<a?++a:--a)}},previousKey:function(c){this.grid.edit.isEditing()?(h.stop(c),this.previous()):this.isNavHeader()||this._isHeaderHidden()?(this.tabOut(this.grid.domNode),null!=this._colHeadFocusIdx&&(g.toggleClass(this._findHeaderCells()[this._colHeadFocusIdx],this.focusClass,!1),this._colHeadFocusIdx=null),this._focusifyCellNode(!1)):(this.grid.domNode.focus(),h.stop(c))},nextKey:function(c){c.target===
this.grid.domNode&&null==this._colHeadFocusIdx?(this.focusHeader(),h.stop(c)):this.isNavHeader()?(this.blurHeader(),this.findAndFocusGridCell()||this.tabOut(this.grid.lastFocusNode),this._colHeadNode=this._colHeadFocusIdx=null):this.grid.edit.isEditing()?(h.stop(c),this.next()):this.tabOut(this.grid.lastFocusNode)},tabOut:function(c){this.tabbingOut=!0;c.focus()},focusGridView:function(){d.fire(this.focusView,"focus")},focusGrid:function(c){this.focusGridView();this._focusifyCellNode(!0)},findAndFocusGridCell:function(){var c=
!0,a=0===this.grid.rowCount;this.isNoFocusCell()&&!a?(a=0,this.grid.getCell(a).hidden&&(a=this.isNavHeader()?this._colHeadFocusIdx:0),this.setFocusIndex(0,a)):this.cell&&!a?(this.focusView&&!this.focusView.rowNodes[this.rowIndex]&&this.grid.scrollToRow(this.rowIndex),this.focusGrid()):c=!1;this._colHeadNode=this._colHeadFocusIdx=null;return c},focusHeader:function(){var c=this._findHeaderCells(),a=this._colHeadFocusIdx;this._isHeaderHidden()?this.findAndFocusGridCell():this._colHeadFocusIdx||(this.isNoFocusCell()?
this._colHeadFocusIdx=0:this._colHeadFocusIdx=this.cell.index);for(this._colHeadNode=c[this._colHeadFocusIdx];this._colHeadNode&&0<=this._colHeadFocusIdx&&this._colHeadFocusIdx<c.length&&"none"==this._colHeadNode.style.display;)this._colHeadFocusIdx++,this._colHeadNode=c[this._colHeadFocusIdx];this._colHeadNode&&"none"!=this._colHeadNode.style.display?(this.headerMenu&&this._contextMenuBindNode!=this.grid.domNode&&(this.headerMenu.unBindDomNode(this.grid.viewsHeaderNode),this.headerMenu.bindDomNode(this.grid.domNode),
this._contextMenuBindNode=this.grid.domNode),this._setActiveColHeader(this._colHeadNode,this._colHeadFocusIdx,a),this._scrollHeader(this._colHeadFocusIdx),this._focusifyCellNode(!1)):this.findAndFocusGridCell()},blurHeader:function(){g.removeClass(this._colHeadNode,this.focusClass);g.removeAttr(this.grid.domNode,"aria-activedescendant");if(this.headerMenu&&this._contextMenuBindNode==this.grid.domNode){var c=this.grid.viewsHeaderNode;this.headerMenu.unBindDomNode(this.grid.domNode);this.headerMenu.bindDomNode(c);
this._contextMenuBindNode=c}},doFocus:function(c){c&&c.target!=c.currentTarget?h.stop(c):this._clickFocus||(this.tabbingOut||this.focusHeader(),this.tabbingOut=!1,h.stop(c))},doBlur:function(c){h.stop(c)},doContextMenu:function(c){this.headerMenu||h.stop(c)},doLastNodeFocus:function(c){this.tabbingOut?this._focusifyCellNode(!1):0<this.grid.rowCount?(this.isNoFocusCell()&&this.setFocusIndex(0,0),this._focusifyCellNode(!0)):this.focusHeader();this.tabbingOut=!1;h.stop(c)},doLastNodeBlur:function(c){h.stop(c)},
doColHeaderFocus:function(c){this._setActiveColHeader(c.target,g.attr(c.target,"idx"),this._colHeadFocusIdx);this._scrollHeader(this.getHeaderIndex());h.stop(c)},doColHeaderBlur:function(c){g.toggleClass(c.target,this.focusClass,!1)},_mouseDown:function(c){this._clickFocus=dojo.some(this.grid.views.views,function(a){return a.scrollboxNode===c.target})},_mouseUp:function(c){this._clickFocus=!1}})})},"dojox/grid/_EditManager":function(){define("dojo/_base/lang dojo/_base/array dojo/_base/declare dojo/_base/connect dojo/_base/sniff ./util".split(" "),
function(r,n,p,m,h,e){return p("dojox.grid._EditManager",null,{constructor:function(e){this.grid=e;this.connections=h("ie")?[m.connect(document.body,"onfocus",r.hitch(this,"_boomerangFocus"))]:[];this.connections.push(m.connect(this.grid,"onBlur",this,"apply"));this.connections.push(m.connect(this.grid,"prerender",this,"_onPreRender"))},info:{},destroy:function(){n.forEach(this.connections,m.disconnect)},cellFocus:function(e,d){this.grid.singleClickEdit||this.isEditRow(d)?this.setEditCell(e,d):this.apply();
(this.isEditing()||e&&e.editable&&e.alwaysEditing)&&this._focusEditor(e,d)},rowClick:function(e){this.isEditing()&&!this.isEditRow(e.rowIndex)&&this.apply()},styleRow:function(e){e.index==this.info.rowIndex&&(e.customClasses+=" dojoxGridRowEditing")},dispatchEvent:function(e){var d=e.cell;return(d=d&&d.editable?d:0)&&d.dispatchEvent(e.dispatch,e)},isEditing:function(){return void 0!==this.info.rowIndex},isEditCell:function(e,d){return this.info.rowIndex===e&&this.info.cell.index==d},isEditRow:function(e){return this.info.rowIndex===
e},setEditCell:function(e,d){!this.isEditCell(d,e.index)&&this.grid.canEdit&&this.grid.canEdit(e,d)&&this.start(e,d,this.isEditRow(d)||e.editable)},_focusEditor:function(h,d){e.fire(h,"focus",[d])},focusEditor:function(){this.isEditing()&&this._focusEditor(this.info.cell,this.info.rowIndex)},_boomerangWindow:500,_shouldCatchBoomerang:function(){return this._catchBoomerang>(new Date).getTime()},_boomerangFocus:function(){this._shouldCatchBoomerang()&&(this.grid.focus.focusGrid(),this.focusEditor(),
this._catchBoomerang=0)},_doCatchBoomerang:function(){h("ie")&&(this._catchBoomerang=(new Date).getTime()+this._boomerangWindow)},start:function(e,d,g){this._isValidInput()&&(this.grid.beginUpdate(),this.editorApply(),this.isEditing()&&!this.isEditRow(d)&&(this.applyRowEdit(),this.grid.updateRow(d)),g?(this.info={cell:e,rowIndex:d},this.grid.doStartEdit(e,d),this.grid.updateRow(d)):this.info={},this.grid.endUpdate(),this.grid.focus.focusGrid(),this._focusEditor(e,d),this._doCatchBoomerang())},_editorDo:function(e){var d=
this.info.cell;if(d&&d.editable)d[e](this.info.rowIndex)},editorApply:function(){this._editorDo("apply")},editorCancel:function(){this._editorDo("cancel")},applyCellEdit:function(e,d,g){this.grid.canEdit(d,g)&&this.grid.doApplyCellEdit(e,g,d.field)},applyRowEdit:function(){this.grid.doApplyEdit(this.info.rowIndex,this.info.cell.field)},apply:function(){this.isEditing()&&this._isValidInput()&&(this.grid.beginUpdate(),this.editorApply(),this.applyRowEdit(),this.info={},this.grid.endUpdate(),this.grid.focus.focusGrid(),
this._doCatchBoomerang())},cancel:function(){this.isEditing()&&(this.grid.beginUpdate(),this.editorCancel(),this.info={},this.grid.endUpdate(),this.grid.focus.focusGrid(),this._doCatchBoomerang())},save:function(e,d){var g=this.info.cell;!this.isEditRow(e)||d&&g.view!=d||!g.editable||g.save(g,this.info.rowIndex)},restore:function(e,d){var g=this.info.cell;this.isEditRow(d)&&g.view==e&&g.editable&&g.restore(this.info.rowIndex)},_isValidInput:function(){var e=(this.info.cell||{}).widget;if(!e||!e.isValid)return!0;
e.focused=!0;return e.isValid(!0)},_onPreRender:function(){this.isEditing()&&(this.info.value=this.info.cell.getValue())}})})},"dojox/grid/Selection":function(){define(["dojo/_base/declare","dojo/_base/array","dojo/_base/lang","dojo/dom-attr"],function(r,n,p,m){return r("dojox.grid.Selection",null,{constructor:function(h){this.grid=h;this.selected=[];this.setMode(h.selectionMode)},mode:"extended",selected:null,updating:0,selectedIndex:-1,rangeStartIndex:-1,setMode:function(h){this.selected.length&&
this.deselectAll();this.mode="extended"!=h&&"multiple"!=h&&"single"!=h&&"none"!=h?"extended":h},onCanSelect:function(h){return this.grid.onCanSelect(h)},onCanDeselect:function(h){return this.grid.onCanDeselect(h)},onSelected:function(h){},onDeselected:function(h){},onChanging:function(){},onChanged:function(){},isSelected:function(h){return"none"==this.mode?!1:this.selected[h]},getFirstSelected:function(){if(!this.selected.length||"none"==this.mode)return-1;for(var h=0,e=this.selected.length;h<e;h++)if(this.selected[h])return h;
return-1},getNextSelected:function(h){if("none"==this.mode)return-1;h+=1;for(var e=this.selected.length;h<e;h++)if(this.selected[h])return h;return-1},getSelected:function(){for(var h=[],e=0,k=this.selected.length;e<k;e++)this.selected[e]&&h.push(e);return h},getSelectedCount:function(){for(var h=0,e=0;e<this.selected.length;e++)this.selected[e]&&h++;return h},_beginUpdate:function(){if(0===this.updating)this.onChanging();this.updating++},_endUpdate:function(){this.updating--;if(0===this.updating)this.onChanged()},
select:function(h){"none"!=this.mode&&("multiple"!=this.mode?(this.deselectAll(h),this.addToSelection(h)):this.toggleSelect(h))},addToSelection:function(h){if("none"!=this.mode)if(p.isArray(h))n.forEach(h,this.addToSelection,this);else if(h=Number(h),this.selected[h])this.selectedIndex=h;else if(!1!==this.onCanSelect(h)){this.selectedIndex=h;var e=this.grid.getRowNode(h);e&&m.set(e,"aria-selected","true");this._beginUpdate();this.selected[h]=!0;this.onSelected(h);this._endUpdate()}},deselect:function(h){if("none"!=
this.mode)if(p.isArray(h))n.forEach(h,this.deselect,this);else if(h=Number(h),this.selectedIndex==h&&(this.selectedIndex=-1),this.selected[h]&&!1!==this.onCanDeselect(h)){var e=this.grid.getRowNode(h);e&&m.set(e,"aria-selected","false");this._beginUpdate();delete this.selected[h];this.onDeselected(h);this._endUpdate()}},setSelected:function(h,e){this[e?"addToSelection":"deselect"](h)},toggleSelect:function(h){p.isArray(h)?n.forEach(h,this.toggleSelect,this):this.setSelected(h,!this.selected[h])},
_range:function(h,e,k){var d=0<=h?h:e;h=e;d>h&&(h=d,d=e);for(e=d;e<=h;e++)k(e)},selectRange:function(h,e){this._range(h,e,p.hitch(this,"addToSelection"))},deselectRange:function(h,e){this._range(h,e,p.hitch(this,"deselect"))},insert:function(h){this.selected.splice(h,0,!1);this.selectedIndex>=h&&this.selectedIndex++},remove:function(h){this.selected.splice(h,1);this.selectedIndex>=h&&this.selectedIndex--},deselectAll:function(h){for(var e in this.selected)e!=h&&!0===this.selected[e]&&this.deselect(e)},
clickSelect:function(h,e,k){if("none"!=this.mode){this._beginUpdate();if("extended"!=this.mode)this.select(h);else{if(!k||0>this.rangeStartIndex)this.rangeStartIndex=h;e||this.deselectAll(h);k?this.selectRange(this.rangeStartIndex,h):e?this.toggleSelect(h):this.addToSelection(h)}this._endUpdate()}},clickSelectEvent:function(h){this.clickSelect(h.rowIndex,dojo.isCopyKey(h),h.shiftKey)},clear:function(){this._beginUpdate();this.deselectAll();this._endUpdate()}})})},"dijit/CheckedMenuItem":function(){define(["dojo/_base/declare",
"dojo/dom-class","./MenuItem","dojo/text!./templates/CheckedMenuItem.html","./hccss"],function(r,n,p,m){return r("dijit.CheckedMenuItem",p,{baseClass:"dijitMenuItem dijitCheckedMenuItem",templateString:m,checked:!1,_setCheckedAttr:function(h){this.domNode.setAttribute("aria-checked",h?"true":"false");this._set("checked",h)},iconClass:"",role:"menuitemcheckbox",checkedChar:"\x26#10003;",onChange:function(){},_onClick:function(h){this.disabled||(this.set("checked",!this.checked),this.onChange(this.checked));
this.onClick(h)}})})},"dojox/grid/DataSelection":function(){define(["dojo/_base/declare","./_SelectionPreserver","./Selection"],function(r,n,p){return r("dojox.grid.DataSelection",p,{constructor:function(m){m.keepSelection&&(this.preserver=new n(this))},destroy:function(){this.preserver&&this.preserver.destroy()},getFirstSelected:function(){var m=p.prototype.getFirstSelected.call(this);return-1==m?null:this.grid.getItem(m)},getNextSelected:function(m){m=this.grid.getItemIndex(m);m=p.prototype.getNextSelected.call(this,
m);return-1==m?null:this.grid.getItem(m)},getSelected:function(){for(var m=[],h=0,e=this.selected.length;h<e;h++)this.selected[h]&&m.push(this.grid.getItem(h));return m},addToSelection:function(m){if("none"!=this.mode){var h=null,h="number"==typeof m||"string"==typeof m?m:this.grid.getItemIndex(m);p.prototype.addToSelection.call(this,h)}},deselect:function(m){if("none"!=this.mode){var h=null,h="number"==typeof m||"string"==typeof m?m:this.grid.getItemIndex(m);p.prototype.deselect.call(this,h)}},deselectAll:function(m){var h=
null;m||"number"==typeof m?(h="number"==typeof m||"string"==typeof m?m:this.grid.getItemIndex(m),p.prototype.deselectAll.call(this,h)):this.inherited(arguments)}})})},"dojox/grid/_SelectionPreserver":function(){define(["dojo/_base/declare","dojo/_base/connect","dojo/_base/lang","dojo/_base/array"],function(r,n,p,m){return r("dojox.grid._SelectionPreserver",null,{constructor:function(h){this.selection=h;var e=this.grid=h.grid;this.reset();this._connects=[n.connect(e,"_setStore",this,"reset"),n.connect(e,
"_addItem",this,"_reSelectById"),n.connect(h,"onSelected",p.hitch(this,"_selectById",!0)),n.connect(h,"onDeselected",p.hitch(this,"_selectById",!1)),n.connect(h,"deselectAll",this,"reset")]},destroy:function(){this.reset();m.forEach(this._connects,n.disconnect);delete this._connects},reset:function(){this._selectedById={}},_reSelectById:function(h,e){h&&this.grid._hasIdentity&&(this.selection.selected[e]=this._selectedById[this.grid.store.getIdentity(h)])},_selectById:function(h,e){if("none"!=this.selection.mode&&
this.grid._hasIdentity){var k=e,d=this.grid;if("number"==typeof e||"string"==typeof e)k=(k=d._by_idx[e])&&k.item;k&&(this._selectedById[d.store.getIdentity(k)]=!!h);return k}}})})},"esri/dijit/editing/TemplatePickerItem":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has dojo/sniff dojo/dom-style dijit/_Widget dijit/_Templated dojox/gfx ../../symbols/jsonUtils ../../kernel".split(" "),function(r,n,p,m,h,e,k,d,g,c,a){r=r([k,d],{declaredClass:"esri.dijit.editing.TemplatePickerItem",
templateString:"\x3cdiv class\x3d'item' style\x3d'text-align: center;'\x3e\x3cdiv class\x3d'itemSymbol' dojoAttachPoint\x3d'_surfaceNode'\x3e\x3c/div\x3e\x3cdiv class\x3d'itemLabel'\x3e${label}\x3c/div\x3e\x3c/div\x3e",startup:function(){this._started||(this.inherited(arguments),this._surface=this._draw(this._surfaceNode,this.symbol,this.surfaceWidth,this.surfaceHeight,this.template))},_draw:function(a,d,h,f,b){if(d&&"textsymbol"!==d.type){a=g.createSurface(a,h,f);if(9>m("ie")){var k=a.getEventSource();
e.set(k,"position","relative");e.set(k.parentNode,"position","relative")}d=!this.legendOverride&&this._getDrawingToolShape(d,b)||c.getShapeDescriptors(d);var l;try{l=a.createShape(d.defaultShape).setFill(d.fill).setStroke(d.stroke)}catch(B){a.clear();a.destroy();return}var p=l.getBoundingBox();d=p.width;b=p.height;var k=-(p.x+d/2),p=-(p.y+b/2),r=a.getDimensions(),k={dx:k+r.width/2,dy:p+r.height/2};if(d>h||b>f)p=d/h>b/f,h=((p?h:f)-5)/(p?d:b),n.mixin(k,{xx:h,yy:h});l.applyTransform(k);return a}},_getDrawingToolShape:function(a,
c){var d;switch(c?c.drawingTool||null:null){case "esriFeatureEditToolArrow":d={type:"path",path:"M 10,1 L 3,8 L 3,5 L -15,5 L -15,-2 L 3,-2 L 3,-5 L 10,1 E"};break;case "esriFeatureEditToolLeftArrow":d={type:"path",path:"M -15,1 L -8,8 L -8,5 L 10,5 L 10,-2 L -8,-2 L -8,-5 L -15,1 E"};break;case "esriFeatureEditToolRightArrow":d={type:"path",path:"M 10,1 L 3,8 L 3,5 L -15,5 L -15,-2 L 3,-2 L 3,-5 L 10,1 E"};break;case "esriFeatureEditToolUpArrow":d={type:"path",path:"M 1,-10 L 8,-3 L 5,-3 L 5,15 L -2,15 L -2,-3 L -5,-3 L 1,-10 E"};
break;case "esriFeatureEditToolDownArrow":d={type:"path",path:"M 1,15 L 8,8 L 5,8 L 5,-10 L -2,-10 L -2,8 L -5,8 L 1,15 E"};break;case "esriFeatureEditToolTriangle":d={type:"path",path:"M -10,14 L 2,-10 L 14,14 L -10,14 E"};break;case "esriFeatureEditToolRectangle":d={type:"path",path:"M -10,-10 L 10,-10 L 10,10 L -10,10 L -10,-10 E"};break;case "esriFeatureEditToolCircle":d={type:"circle",cx:0,cy:0,r:10};break;case "esriFeatureEditToolEllipse":d={type:"ellipse",cx:0,cy:0,rx:10,ry:5};break;case "esriFeatureEditToolFreehand":d=
"simplelinesymbol"===a.type||"cartographiclinesymbol"===a.type?{type:"path",path:"m -11, -7c-1.5,-3.75 7.25,-9.25 12.5,-7c5.25,2.25 6.75,9.75 3.75,12.75c-3,3 -3.25,2.5 -9.75,5.25c-6.5,2.75 -7.25,14.25 2,15.25c9.25,1 11.75,-4 13.25,-6.75c1.5,-2.75 3.5,-11.75 12,-6.5"}:{type:"path",path:"M 10,-13 c3.1,0.16667 4.42564,2.09743 2.76923,3.69231c-2.61025,2.87179 -5.61025,5.6718 -6.14358,6.20513c-0.66667,0.93333 -0.46667,1.2 -0.53333,1.93333c-0.00001,0.86666 0.6,1.66667 1.13334,2c1.03077,0.38462 2.8,0.93333 3.38974,1.70769c0.47693,0.42564 0.87693,0.75897 1.41026,1.75897c0.13333,1.06667 -0.46667,2.86667 -1.8,3.8c-0.73333,0.73333 -3.86667,2.66666 -4.86667,3.13333c-0.93333,0.8 -7.4,3.2 -7.6,3.06667c-1.06667,0.46667 -4.73333,1.13334 -5.2,1.26667c-1.6,0.33334 -4.6,0.4 -6.25128,0.05128c-1.41539,-0.18462 -2.34872,-2.31796 -1.41539,-4.45129c0.93333,-1.73333 1.86667,-3.13333 2.64615,-3.85641c1.28718,-1.47692 2.57437,-2.68204 3.88718,-3.54359c0.88718,-1.13845 1.8,-1.33333 2.26666,-2.45641c0.33334,-0.74359 0.37949,-1.7641 0.06667,-2.87692c-0.66666,-1.46666 -1.66666,-1.86666 -2.98975,-2.2c-1.27692,-0.26666 -2.12307,-0.64102 -3.27692,-1.46666c-0.66667,-1.00001 -1.01538,-3.01539 0.73333,-4.06667c1.73333,-1.2 3.6,-1.93333 4.93333,-2.2c1.33333,-0.46667 4.84104,-1.09743 5.84103,-1.23076c1.60001,-0.46667 6.02564,-0.50257 7.29231,-0.56924z"};
break;default:return null}return{defaultShape:d,fill:a.getFill(),stroke:a.getStroke()}},_repaint:function(a){a?(a.getStroke&&a.setStroke&&a.setStroke(a.getStroke()),a.getFill&&a.setFill&&a.setFill(a.getFill()),a.children&&n.isArray(a.children)&&p.forEach(a.children,this._repaint,this)):this._surface=this._draw(this._surfaceNode,this.symbol,this.surfaceWidth,this.surfaceHeight,this.template)},destroy:function(){this._surface&&(this._surface.destroy(),delete this._surface);this.inherited(arguments)}});
m("extend-esri")&&n.setObject("dijit.editing.TemplatePickerItem",r,a);return r})},"url:dijit/templates/Menu.html":'\x3ctable class\x3d"dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable" role\x3d"menu" tabIndex\x3d"${tabIndex}"\r\n\t   cellspacing\x3d"0"\x3e\r\n\t\x3ctbody class\x3d"dijitReset" data-dojo-attach-point\x3d"containerNode"\x3e\x3c/tbody\x3e\r\n\x3c/table\x3e\r\n',"url:dijit/templates/MenuItem.html":'\x3ctr class\x3d"dijitReset" data-dojo-attach-point\x3d"focusNode" role\x3d"menuitem" tabIndex\x3d"-1"\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuItemIconCell" role\x3d"presentation"\x3e\r\n\t\t\x3cspan role\x3d"presentation" class\x3d"dijitInline dijitIcon dijitMenuItemIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\x3e\r\n\t\x3c/td\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuItemLabel" colspan\x3d"2" data-dojo-attach-point\x3d"containerNode,textDirNode"\r\n\t\trole\x3d"presentation"\x3e\x3c/td\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuItemAccelKey" style\x3d"display: none" data-dojo-attach-point\x3d"accelKeyNode"\x3e\x3c/td\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuArrowCell" role\x3d"presentation"\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"arrowWrapper" style\x3d"visibility: hidden"\x3e\r\n\t\t\t\x3cspan class\x3d"dijitInline dijitIcon dijitMenuExpand"\x3e\x3c/span\x3e\r\n\t\t\t\x3cspan class\x3d"dijitMenuExpandA11y"\x3e+\x3c/span\x3e\r\n\t\t\x3c/span\x3e\r\n\t\x3c/td\x3e\r\n\x3c/tr\x3e\r\n',
"url:dijit/form/templates/Button.html":'\x3cspan class\x3d"dijit dijitReset dijitInline" role\x3d"presentation"\r\n\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitButtonNode"\r\n\t\tdata-dojo-attach-event\x3d"ondijitclick:__onClick" role\x3d"presentation"\r\n\t\t\x3e\x3cspan class\x3d"dijitReset dijitStretch dijitButtonContents"\r\n\t\t\tdata-dojo-attach-point\x3d"titleNode,focusNode"\r\n\t\t\trole\x3d"button" aria-labelledby\x3d"${id}_label"\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitToggleButtonIconChar"\x3e\x26#x25CF;\x3c/span\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitButtonText"\r\n\t\t\t\tid\x3d"${id}_label"\r\n\t\t\t\tdata-dojo-attach-point\x3d"containerNode"\r\n\t\t\t\x3e\x3c/span\r\n\t\t\x3e\x3c/span\r\n\t\x3e\x3c/span\r\n\t\x3e\x3cinput ${!nameAttrSetting} type\x3d"${type}" value\x3d"${value}" class\x3d"dijitOffScreen"\r\n\t\tdata-dojo-attach-event\x3d"onclick:_onClick"\r\n\t\ttabIndex\x3d"-1" aria-hidden\x3d"true" data-dojo-attach-point\x3d"valueNode"\r\n/\x3e\x3c/span\x3e\r\n',
"url:dijit/form/templates/DropDownButton.html":'\x3cspan class\x3d"dijit dijitReset dijitInline"\r\n\t\x3e\x3cspan class\x3d\'dijitReset dijitInline dijitButtonNode\'\r\n\t\tdata-dojo-attach-event\x3d"ondijitclick:__onClick" data-dojo-attach-point\x3d"_buttonNode"\r\n\t\t\x3e\x3cspan class\x3d"dijitReset dijitStretch dijitButtonContents"\r\n\t\t\tdata-dojo-attach-point\x3d"focusNode,titleNode,_arrowWrapperNode,_popupStateNode"\r\n\t\t\trole\x3d"button" aria-haspopup\x3d"true" aria-labelledby\x3d"${id}_label"\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitIcon"\r\n\t\t\t\tdata-dojo-attach-point\x3d"iconNode"\r\n\t\t\t\x3e\x3c/span\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitButtonText"\r\n\t\t\t\tdata-dojo-attach-point\x3d"containerNode"\r\n\t\t\t\tid\x3d"${id}_label"\r\n\t\t\t\x3e\x3c/span\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitArrowButtonInner"\x3e\x3c/span\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitArrowButtonChar"\x3e\x26#9660;\x3c/span\r\n\t\t\x3e\x3c/span\r\n\t\x3e\x3c/span\r\n\t\x3e\x3cinput ${!nameAttrSetting} type\x3d"${type}" value\x3d"${value}" class\x3d"dijitOffScreen" tabIndex\x3d"-1"\r\n\t\tdata-dojo-attach-event\x3d"onclick:_onClick" data-dojo-attach-point\x3d"valueNode" aria-hidden\x3d"true"\r\n/\x3e\x3c/span\x3e\r\n',
"url:dijit/templates/ProgressBar.html":'\x3cdiv class\x3d"dijitProgressBar dijitProgressBarEmpty" role\x3d"progressbar"\r\n\t\x3e\x3cdiv  data-dojo-attach-point\x3d"internalProgress" class\x3d"dijitProgressBarFull"\r\n\t\t\x3e\x3cdiv class\x3d"dijitProgressBarTile" role\x3d"presentation"\x3e\x3c/div\r\n\t\t\x3e\x3cspan style\x3d"visibility:hidden"\x3e\x26#160;\x3c/span\r\n\t\x3e\x3c/div\r\n\t\x3e\x3cdiv data-dojo-attach-point\x3d"labelNode" class\x3d"dijitProgressBarLabel" id\x3d"${id}_label"\x3e\x3c/div\r\n\t\x3e\x3cspan data-dojo-attach-point\x3d"indeterminateHighContrastImage"\r\n\t\t   class\x3d"dijitInline dijitProgressBarIndeterminateHighContrastImage"\x3e\x3c/span\r\n\x3e\x3c/div\x3e\r\n',
"url:esri/dijit/editing/templates/AttachmentEditor.html":"\x3cdiv class\x3d\"attachmentEditor\"\x3e\r\n    \x3cbr /\x3e\r\n    \x3cdiv\x3e\r\n        \x3cb\x3e${NLS_attachments}\x3c/b\x3e\r\n        \x3chr /\x3e\r\n        \x3cdiv dojoAttachPoint\x3d\"_attachmentError\" style\x3d'color:red;display:none'\x3e\x3c/div\x3e\r\n        \x3cbr /\x3e\r\n        \x3cspan dojoAttachPoint\x3d'_attachmentList' style\x3d'word-wrap: break-word;'\x3e\x3c/span\x3e\r\n        \x3cbr\x3e\x3cbr\x3e\r\n        \x3cdiv data-dojo-type\x3d\"dijit/ProgressBar\" dojoAttachPoint\x3d\"_attachmentProgress\" indeterminate\x3d\"true\" style\x3d'display:none'\x3e\x3c/div\x3e\r\n        \x3cbr /\x3e        \r\n        \x3cform dojoAttachPoint\x3d'_uploadForm'\x3e ${NLS_add}:\x26nbsp;\x26nbsp;\x3cinput type\x3d'file' name\x3d'attachment' dojoAttachPoint\x3d'_uploadField' /\x3e \x3c/form\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e",
"url:dijit/templates/Calendar.html":'\x3cdiv class\x3d"dijitCalendarContainer dijitInline" role\x3d"presentation" aria-labelledby\x3d"${id}_mddb ${id}_year"\x3e\r\n\t\x3cdiv class\x3d"dijitReset dijitCalendarMonthContainer" role\x3d"presentation"\x3e\r\n\t\t\x3cdiv class\x3d\'dijitReset dijitCalendarArrow dijitCalendarDecrementArrow\' data-dojo-attach-point\x3d"decrementMonth"\x3e\r\n\t\t\t\x3cimg src\x3d"${_blankGif}" alt\x3d"" class\x3d"dijitCalendarIncrementControl dijitCalendarDecrease" role\x3d"presentation"/\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"decreaseArrowNode" class\x3d"dijitA11ySideArrow"\x3e-\x3c/span\x3e\r\n\t\t\x3c/div\x3e\r\n\t\t\x3cdiv class\x3d\'dijitReset dijitCalendarArrow dijitCalendarIncrementArrow\' data-dojo-attach-point\x3d"incrementMonth"\x3e\r\n\t\t\t\x3cimg src\x3d"${_blankGif}" alt\x3d"" class\x3d"dijitCalendarIncrementControl dijitCalendarIncrease" role\x3d"presentation"/\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"increaseArrowNode" class\x3d"dijitA11ySideArrow"\x3e+\x3c/span\x3e\r\n\t\t\x3c/div\x3e\r\n\t\t\x3cdiv data-dojo-attach-point\x3d"monthNode" class\x3d"dijitInline"\x3e\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\t\x3ctable cellspacing\x3d"0" cellpadding\x3d"0" role\x3d"grid" data-dojo-attach-point\x3d"gridNode"\x3e\r\n\t\t\x3cthead\x3e\r\n\t\t\t\x3ctr role\x3d"row"\x3e\r\n\t\t\t\t${!dayCellsHtml}\r\n\t\t\t\x3c/tr\x3e\r\n\t\t\x3c/thead\x3e\r\n\t\t\x3ctbody data-dojo-attach-point\x3d"dateRowsNode" data-dojo-attach-event\x3d"ondijitclick: _onDayClick" class\x3d"dijitReset dijitCalendarBodyContainer"\x3e\r\n\t\t\t\t${!dateRowsHtml}\r\n\t\t\x3c/tbody\x3e\r\n\t\x3c/table\x3e\r\n\t\x3cdiv class\x3d"dijitReset dijitCalendarYearContainer" role\x3d"presentation"\x3e\r\n\t\t\x3cdiv class\x3d"dijitCalendarYearLabel"\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"previousYearLabelNode" class\x3d"dijitInline dijitCalendarPreviousYear" role\x3d"button"\x3e\x3c/span\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"currentYearLabelNode" class\x3d"dijitInline dijitCalendarSelectedYear" role\x3d"button" id\x3d"${id}_year"\x3e\x3c/span\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"nextYearLabelNode" class\x3d"dijitInline dijitCalendarNextYear" role\x3d"button"\x3e\x3c/span\x3e\r\n\t\t\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:dijit/form/templates/TextBox.html":'\x3cdiv class\x3d"dijit dijitReset dijitInline dijitLeft" id\x3d"widget_${id}" role\x3d"presentation"\r\n\t\x3e\x3cdiv class\x3d"dijitReset dijitInputField dijitInputContainer"\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputInner" data-dojo-attach-point\x3d\'textbox,focusNode\' autocomplete\x3d"off"\r\n\t\t\t${!nameAttrSetting} type\x3d\'${type}\'\r\n\t/\x3e\x3c/div\r\n\x3e\x3c/div\x3e\r\n',"url:dijit/templates/Tooltip.html":'\x3cdiv class\x3d"dijitTooltip dijitTooltipLeft" id\x3d"dojoTooltip" data-dojo-attach-event\x3d"mouseenter:onMouseEnter,mouseleave:onMouseLeave"\r\n\t\x3e\x3cdiv class\x3d"dijitTooltipConnector" data-dojo-attach-point\x3d"connectorNode"\x3e\x3c/div\r\n\t\x3e\x3cdiv class\x3d"dijitTooltipContainer dijitTooltipContents" data-dojo-attach-point\x3d"containerNode" role\x3d\'alert\'\x3e\x3c/div\r\n\x3e\x3c/div\x3e\r\n',
"url:dijit/form/templates/ValidationTextBox.html":'\x3cdiv class\x3d"dijit dijitReset dijitInline dijitLeft"\r\n\tid\x3d"widget_${id}" role\x3d"presentation"\r\n\t\x3e\x3cdiv class\x3d\'dijitReset dijitValidationContainer\'\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value\x3d"\x26#935; " type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"presentation"\r\n\t/\x3e\x3c/div\r\n\t\x3e\x3cdiv class\x3d"dijitReset dijitInputField dijitInputContainer"\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputInner" data-dojo-attach-point\x3d\'textbox,focusNode\' autocomplete\x3d"off"\r\n\t\t\t${!nameAttrSetting} type\x3d\'${type}\'\r\n\t/\x3e\x3c/div\r\n\x3e\x3c/div\x3e\r\n',
"url:dijit/form/templates/DropDownBox.html":'\x3cdiv class\x3d"dijit dijitReset dijitInline dijitLeft"\r\n\tid\x3d"widget_${id}"\r\n\trole\x3d"combobox"\r\n\taria-haspopup\x3d"true"\r\n\tdata-dojo-attach-point\x3d"_popupStateNode"\r\n\t\x3e\x3cdiv class\x3d\'dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer\'\r\n\t\tdata-dojo-attach-point\x3d"_buttonNode" role\x3d"presentation"\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField dijitArrowButtonInner" value\x3d"\x26#9660; " type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"button presentation" aria-hidden\x3d"true"\r\n\t\t\t${_buttonInputDisabled}\r\n\t/\x3e\x3c/div\r\n\t\x3e\x3cdiv class\x3d\'dijitReset dijitValidationContainer\'\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value\x3d"\x26#935; " type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"presentation"\r\n\t/\x3e\x3c/div\r\n\t\x3e\x3cdiv class\x3d"dijitReset dijitInputField dijitInputContainer"\r\n\t\t\x3e\x3cinput class\x3d\'dijitReset dijitInputInner\' ${!nameAttrSetting} type\x3d"${type}" autocomplete\x3d"off"\r\n\t\t\tdata-dojo-attach-point\x3d"textbox,focusNode" role\x3d"textbox"\r\n\t/\x3e\x3c/div\r\n\x3e\x3c/div\x3e\r\n',
"url:dijit/form/templates/Spinner.html":'\x3cdiv class\x3d"dijit dijitReset dijitInline dijitLeft"\r\n\tid\x3d"widget_${id}" role\x3d"presentation"\r\n\t\x3e\x3cdiv class\x3d"dijitReset dijitButtonNode dijitSpinnerButtonContainer"\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField dijitSpinnerButtonInner" type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"presentation"\r\n\t\t/\x3e\x3cdiv class\x3d"dijitReset dijitLeft dijitButtonNode dijitArrowButton dijitUpArrowButton"\r\n\t\t\tdata-dojo-attach-point\x3d"upArrowNode"\r\n\t\t\t\x3e\x3cdiv class\x3d"dijitArrowButtonInner"\r\n\t\t\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField" value\x3d"\x26#9650; " type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"presentation"\r\n\t\t\t\t\t${_buttonInputDisabled}\r\n\t\t\t/\x3e\x3c/div\r\n\t\t\x3e\x3c/div\r\n\t\t\x3e\x3cdiv class\x3d"dijitReset dijitLeft dijitButtonNode dijitArrowButton dijitDownArrowButton"\r\n\t\t\tdata-dojo-attach-point\x3d"downArrowNode"\r\n\t\t\t\x3e\x3cdiv class\x3d"dijitArrowButtonInner"\r\n\t\t\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField" value\x3d"\x26#9660; " type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"presentation"\r\n\t\t\t\t\t${_buttonInputDisabled}\r\n\t\t\t/\x3e\x3c/div\r\n\t\t\x3e\x3c/div\r\n\t\x3e\x3c/div\r\n\t\x3e\x3cdiv class\x3d\'dijitReset dijitValidationContainer\'\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value\x3d"\x26#935; " type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"presentation"\r\n\t/\x3e\x3c/div\r\n\t\x3e\x3cdiv class\x3d"dijitReset dijitInputField dijitInputContainer"\r\n\t\t\x3e\x3cinput class\x3d\'dijitReset dijitInputInner\' data-dojo-attach-point\x3d"textbox,focusNode" type\x3d"${type}" data-dojo-attach-event\x3d"onkeydown:_onKeyDown"\r\n\t\t\trole\x3d"spinbutton" autocomplete\x3d"off" ${!nameAttrSetting}\r\n\t/\x3e\x3c/div\r\n\x3e\x3c/div\x3e\r\n',
"url:esri/dijit/templates/AttributeInspector.html":'\x3cdiv class\x3d"esriAttributeInspector"\x3e\r\n    \x3cdiv class\x3d"atiLayerName" dojoAttachPoint\x3d"layerName"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"atiAttributes" dojoAttachPoint\x3d"attributeTable"\x3e\x3c/div\x3e\r\n    \x3cdiv dojoAttachPoint\x3d"attachmentEditor"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"atiEditorTrackingInfo" dojoAttachPoint\x3d"editorTrackingInfoDiv"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"atiButtons" dojoAttachPoint\x3d"editButtons"\x3e\r\n        \x3cbutton  dojoType\x3d"dijit.form.Button" class\x3d"atiButton atiDeleteButton"  dojoAttachPoint\x3d"deleteBtn" dojoAttachEvent\x3d"onClick: onDeleteBtn" showLabel\x3d"true" type\x3d"button"\x3e${NLS_deleteFeature}\x3c/button\x3e\r\n        \x3cdiv class\x3d"atiNavButtons" dojoAttachPoint\x3d"navButtons"\x3e\r\n            \x3cdiv class\x3d"atiNavMessage" dojoAttachPoint\x3d"navMessage"\x3e\x3c/div\x3e\r\n            \x3cbutton  dojoType\x3d"dijit.form.Button" iconClass\x3d"atiButton atiFirstIcon" dojoAttachPoint\x3d"firstFeatureButton" dojoAttachEvent\x3d"onClick: onFirstFeature" showLabel\x3d"false" type\x3d"button"\x3e${NLS_first}\x3c/button\x3e\r\n            \x3cbutton  dojoType\x3d"dijit.form.Button" iconClass\x3d"atiButton atiPrevIcon" dojoAttachPoint\x3d"prevFeatureButton" dojoAttachEvent\x3d"onClick: onPreviousFeature" showLabel\x3d"false" type\x3d"button"\x3e${NLS_previous}\x3c/button\x3e\r\n            \x3cbutton  dojoType\x3d"dijit.form.Button" iconClass\x3d"atiButton atiNextIcon" dojoAttachPoint\x3d"nextFeatureButton" dojoAttachEvent\x3d"onClick: onNextFeature" showLabel\x3d"false" type\x3d"button"\x3e${NLS_next}\x3c/button\x3e\r\n            \x3cbutton  dojoType\x3d"dijit.form.Button" iconClass\x3d"atiButton atiLastIcon" dojoAttachPoint\x3d"lastFeatureButton" dojoAttachEvent\x3d"onClick: onLastFeature" showLabel\x3d"false" type\x3d"button"\x3e${NLS_last}\x3c/button\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:dijit/form/templates/ComboButton.html":'\x3ctable class\x3d"dijit dijitReset dijitInline dijitLeft"\r\n\tcellspacing\x3d\'0\' cellpadding\x3d\'0\' role\x3d"presentation"\r\n\t\x3e\x3ctbody role\x3d"presentation"\x3e\x3ctr role\x3d"presentation"\r\n\t\t\x3e\x3ctd class\x3d"dijitReset dijitStretch dijitButtonNode" data-dojo-attach-point\x3d"buttonNode" data-dojo-attach-event\x3d"ondijitclick:__onClick,onkeydown:_onButtonKeyDown"\r\n\t\t\x3e\x3cdiv id\x3d"${id}_button" class\x3d"dijitReset dijitButtonContents"\r\n\t\t\tdata-dojo-attach-point\x3d"titleNode"\r\n\t\t\trole\x3d"button" aria-labelledby\x3d"${id}_label"\r\n\t\t\t\x3e\x3cdiv class\x3d"dijitReset dijitInline dijitIcon" data-dojo-attach-point\x3d"iconNode" role\x3d"presentation"\x3e\x3c/div\r\n\t\t\t\x3e\x3cdiv class\x3d"dijitReset dijitInline dijitButtonText" id\x3d"${id}_label" data-dojo-attach-point\x3d"containerNode" role\x3d"presentation"\x3e\x3c/div\r\n\t\t\x3e\x3c/div\r\n\t\t\x3e\x3c/td\r\n\t\t\x3e\x3ctd id\x3d"${id}_arrow" class\x3d\'dijitReset dijitRight dijitButtonNode dijitArrowButton\'\r\n\t\t\tdata-dojo-attach-point\x3d"_popupStateNode,focusNode,_buttonNode"\r\n\t\t\tdata-dojo-attach-event\x3d"onkeydown:_onArrowKeyDown"\r\n\t\t\ttitle\x3d"${optionsTitle}"\r\n\t\t\trole\x3d"button" aria-haspopup\x3d"true"\r\n\t\t\t\x3e\x3cdiv class\x3d"dijitReset dijitArrowButtonInner" role\x3d"presentation"\x3e\x3c/div\r\n\t\t\t\x3e\x3cdiv class\x3d"dijitReset dijitArrowButtonChar" role\x3d"presentation"\x3e\x26#9660;\x3c/div\r\n\t\t\x3e\x3c/td\r\n\t\t\x3e\x3ctd style\x3d"display:none !important;"\r\n\t\t\t\x3e\x3cinput ${!nameAttrSetting} type\x3d"${type}" value\x3d"${value}" data-dojo-attach-point\x3d"valueNode"\r\n\t\t\t\tclass\x3d"dijitOffScreen" aria-hidden\x3d"true" data-dojo-attach-event\x3d"onclick:_onClick"\r\n\t\t/\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/tbody\r\n\x3e\x3c/table\x3e\r\n',
"url:dojox/grid/resources/View.html":'\x3cdiv class\x3d"dojoxGridView" role\x3d"presentation"\x3e\r\n\t\x3cdiv class\x3d"dojoxGridHeader" dojoAttachPoint\x3d"headerNode" role\x3d"presentation"\x3e\r\n\t\t\x3cdiv dojoAttachPoint\x3d"headerNodeContainer" style\x3d"width:9000em" role\x3d"presentation"\x3e\r\n\t\t\t\x3cdiv dojoAttachPoint\x3d"headerContentNode" role\x3d"row"\x3e\x3c/div\x3e\r\n\t\t\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\t\x3cinput type\x3d"checkbox" class\x3d"dojoxGridHiddenFocus" dojoAttachPoint\x3d"hiddenFocusNode" aria-hidden\x3d"true" /\x3e\r\n\t\x3cinput type\x3d"checkbox" class\x3d"dojoxGridHiddenFocus" aria-hidden\x3d"true" /\x3e\r\n\t\x3cdiv class\x3d"dojoxGridScrollbox" dojoAttachPoint\x3d"scrollboxNode" role\x3d"presentation"\x3e\r\n\t\t\x3cdiv class\x3d"dojoxGridContent" dojoAttachPoint\x3d"contentNode" hidefocus\x3d"hidefocus" role\x3d"presentation"\x3e\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:dijit/templates/CheckedMenuItem.html":'\x3ctr class\x3d"dijitReset" data-dojo-attach-point\x3d"focusNode" role\x3d"${role}" tabIndex\x3d"-1" aria-checked\x3d"${checked}"\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuItemIconCell" role\x3d"presentation"\x3e\r\n\t\t\x3cspan class\x3d"dijitInline dijitIcon dijitMenuItemIcon dijitCheckedMenuItemIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\x3e\r\n\t\t\x3cspan class\x3d"dijitMenuItemIconChar dijitCheckedMenuItemIconChar"\x3e${!checkedChar}\x3c/span\x3e\r\n\t\x3c/td\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuItemLabel" colspan\x3d"2" data-dojo-attach-point\x3d"containerNode,labelNode,textDirNode"\x3e\x3c/td\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuItemAccelKey" style\x3d"display: none" data-dojo-attach-point\x3d"accelKeyNode"\x3e\x3c/td\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuArrowCell" role\x3d"presentation"\x3e\x26#160;\x3c/td\x3e\r\n\x3c/tr\x3e\r\n',
"url:dojox/grid/resources/_Grid.html":'\x3cdiv hidefocus\x3d"hidefocus" role\x3d"grid" dojoAttachEvent\x3d"onmouseout:_mouseOut"\x3e\r\n\t\x3cdiv class\x3d"dojoxGridMasterHeader" dojoAttachPoint\x3d"viewsHeaderNode" role\x3d"presentation"\x3e\x3c/div\x3e\r\n\t\x3cdiv class\x3d"dojoxGridMasterView" dojoAttachPoint\x3d"viewsNode" role\x3d"presentation"\x3e\x3c/div\x3e\r\n\t\x3cdiv class\x3d"dojoxGridMasterMessages" style\x3d"display: none;" dojoAttachPoint\x3d"messagesNode"\x3e\x3c/div\x3e\r\n\t\x3cspan dojoAttachPoint\x3d"lastFocusNode" tabindex\x3d"0"\x3e\x3c/span\x3e\r\n\x3c/div\x3e\r\n',
"url:esri/dijit/editing/templates/TemplatePicker.html":'\x3cdiv class\x3d"templatePicker"\x3e\r\n\r\n  \x3ctable dojoType\x3d"dojox.grid.DataGrid" noDataMessage\x3d"${emptyMessage}" selectionMode\x3d"none" autoHeight\x3d"${_rows}" autoWidth\x3d"${_autoWidth}"\r\n         query\x3d"{ query: \'*\' }" dojoAttachPoint\x3d"grid" class\x3d"grid"\x3e\r\n  \x3c/table\x3e\r\n  \r\n\x3c/div\x3e',"url:esri/dijit/editing/templates/Editor.html":'\x3cdiv class\x3d"esriEditor"\x3e\r\n    \x3cdiv class\x3d"esriTemplatePicker" dojoAttachPoint\x3d"templatePickerDiv"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"esriDrawingToolbar" dojoAttachPoint\x3d"drawingToolbarDiv"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"progressBar" dojoAttachPoint\x3d"progressBar" indeterminate\x3d"true" dojoType\x3d"dijit.ProgressBar" /\x3e\r\n\x3c/div\x3e',
"*now":function(r){r(['dojo/i18n!*preload*esri/dijit/editing/nls/Editor-all*["ar","az","ca","cs","da","de-de","el","en-gb","en-us","es-es","fi-fi","fr-fr","he-il","hu","it-it","ja-jp","ko-kr","nl-nl","nb","pl","pt-br","pt-pt","ro","ru","sk","sl","sv","th","tr","zh-tw","zh-cn","ROOT"]'])},"*noref":1}});
define("esri/dijit/editing/Editor-all","../../layers/FeatureLayer ../../toolbars/_toolbar ../../toolbars/draw ../../toolbars/edit ../../tasks/geometry ../AttributeInspector ./AttachmentEditor ./Editor ./TemplatePicker ./Util ./SelectionHelper".split(" "),function(r,n,p,m,h,e,k,d,g,c,a){return{}});