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

//>>built
require({cache:{"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(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y,u,C,q,w,x,I,A,M,H,U,S,D){var L=O([U,m,n],{declaredClass:"esri.dijit.editing.TemplatePicker",widgetsInTemplate:!0,templateString:D,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(J,P){J=J||{};J.items||J.featureLayers||
console.error("TemplatePicker: please provide 'featureLayers' or 'items' parameter in the constructor");this._dojo14x=4<=r.version.minor;this._itemWidgets={};J.featureLayers&&J.featureLayers.length&&(this._flChanged=1);this._nls=S.widgets.templatePicker;this.emptyMessage=J.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 J=
b.getContentBox(this.domNode);J.w||(this.domNode.style.width=this._initialAutoWidth+"px");if(!J.h||1>=J.h)this.domNode.style.height=this._initialAutoHeight+"px";J=b.getContentBox(this.domNode);this._columns=Math.floor(J.w/this._assumedCellWidth)||1}this._applyGridPatches();this._setGridLayout();F.connect(this.grid,"onRowClick",this,this._rowClicked);this._setGridData();this._toggleTooltip();9>c("ie")&&(this._repaintItems=B.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 J=this._selectedCell,P=this._selectedInfo;J&&this._rowClicked({cellNode:J,rowIndex:P.selRow,cellIndex:P.selCol})},update:function(J){J=
"auto"===this.rows&&"auto"===this.columns&&J?!0:!1;var P=this.grid;if(J){var R=this.domNode;var Y=r.query("#"+R.id+".templatePicker div.item")[0];R=b.getContentBox(R);Y=(Y=Y&&Y.parentNode)?E.coords(Y).w:this._assumedCellWidth;this._columns=(this._columns=Math.floor((R.w-P.views.views[0].getScrollbarWidth())/Y))||1}Y=this._rows;this._preprocess();var aa=this._rows;this._setGridLayout();this._setGridData();aa!==Y&&P.set("autoHeight",this._rows,!1);J?(P._resize({w:R.w,h:R.h}),P.viewsHeaderNode.style.display=
"none"):P.update();this._toggleTooltip();var ea=this,N=this.getSelected();N&&P.store.fetch({onComplete:function(T){var ca=(T=ea._locate(N,ea._selectedInfo,T))&&P.views.views[0].getCellNode(T[0],T[1]);ca&&ea._rowClicked({cellNode:ca,rowIndex:T[0],cellIndex:T[1]},!0)}});9>c("ie")&&setTimeout(this._repaintItems,this._ieTimer);J=this.featureLayers;R=this.items;J&&J.length||R&&R.length||!P||!this.emptyMessage||P.showMessage(this.emptyMessage)},_eventMap:{"selection-change":!0},onSelectionChange:function(){},
_setUseLegendAttr:function(J){var P=this.useLegend;this._started&&P===J||(J?this._flChanged=1:this._clearLegendInfo());this.useLegend=J},_setFeatureLayersAttr:function(J){var P=this.featureLayers;this._started&&P===J||(this._flChanged=1);this.featureLayers=J},_adjustRowsCols:function(J){if("auto"===this.rows&&"auto"===this.columns)this._started||(this._rows=!1,this._columns=null,this._autoWidth=!1);else{var P=0;this._rows=this.rows;this._columns=this.columns;"auto"===this.rows?(this.featureLayers?
this.grouping?(P=J.length,f.forEach(J,function(R){P+=Math.ceil(R.length/this.columns)},this)):(f.forEach(J,function(R){P+=R.length},this),P=Math.ceil(P/this.columns)):P=Math.ceil(J.length/this.columns),this._rows=P):"auto"===this.columns&&(this.featureLayers?this.grouping?P=3:(f.forEach(J,function(R){P+=R.length},this),P=Math.ceil(P/this.rows)):P=Math.ceil(J.length/this.rows),this._columns=P)}},_preprocess:function(){this.items&&(this.grouping=!1);this._autoWidth=!1;if("auto"===this.rows||"auto"===
this.columns)this._autoWidth=!0;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),f.every(this.featureLayers,function(R){return R.loaded})){this.featureLayers=f.filter(this.featureLayers,function(R){return!(R.hasZ&&!R.enableZDefaults)});var J=this._flItems=this._getItemsFromLayers(this.featureLayers);
this._adjustRowsCols(J)}else{var P=this.featureLayers.length;f.forEach(this.featureLayers,function(R){if(R.loaded)P--;else var Y=F.connect(R,"onLoad",this,function(){F.disconnect(Y);Y=null;P--;P||this.update()})},this)}else J=this._itItems=this._getItemsFromItems(this.items),this._adjustRowsCols(J)},_processSelectionLayers:function(){var J,P,R,Y,aa,ea,N,T={};f.forEach(this.featureLayers,function(ca,ia){ca.mode===u.MODE_SELECTION&&ca._map&&ca.url&&ca._params.drawMode&&!ca.source&&(P=B.trim(ca._url.path).replace(/\/(MapServer|FeatureServer).*/ig,
"/MapServer").replace(/^https?:\/\//ig,"").toLowerCase(),R=T[P]=T[P]||{},Y=R.featureLayers=R.featureLayers||{},ea=R.indices=R.indices||[],Y[ia]=ca,ea.push(ia),J=ca._map)});J&&f.forEach(J.layerIds,function(ca){(ca=J.getLayer(ca))&&ca.url&&(ca.getImageUrl||ca.getTileUrl)&&ca.loaded&&10.1<=ca.version&&(P=B.trim(ca._url.path).replace(/(\/MapServer).*/ig,"$1"),aa=P.replace(/^https?:\/\//ig,"").toLowerCase(),T[aa]&&!T[aa].mapServiceUrl&&(R=T[aa],R.mapServiceUrl=P,R.mapServiceLayer=ca,this._legendIndices=
this._legendIndices.concat(R.indices),N=this._fetchLegend({pickerInstance:this,info:R},aa),N.then?(this._loadingIndices=this._loadingIndices.concat(R.indices),this._loadingLegends.push(N)):this._processLegendResponse(N,R)))},this)},_fetchLegend:function(J,P){var R=L.prototype,Y=R.legendCache[P];Y?Y.then&&Y._contexts.push(J):(Y=R.legendCache[P]=H({url:J.info.mapServiceUrl+"/legend",content:{f:"json"},callbackParamName:"callback"}),Y._contexts=[J],Y.addBoth(function(aa){if(!Y.canceled){R.legendCache[P]=
aa;var ea=Y._contexts;Y._contexts=null;f.forEach(ea,function(N){var T=N.pickerInstance;N=N.info;if(!T._destroyed){f.forEach(N.indices,function(ia){ca=f.indexOf(T._loadingIndices,ia);-1<ca&&T._loadingIndices.splice(ca,1)});var ca=f.indexOf(T._loadingLegends,Y);-1<ca&&T._loadingLegends.splice(ca,1);T._processLegendResponse(aa,N)}})}}));return Y},_clearLegendInfo:function(){clearTimeout(this._legendTimer);this._ignoreLegends();this._legendIndices=this._loadingIndices=this._legendSymbols=this._loadingLegends=
this._legendTimer=null},_ignoreLegends:function(){this._loadingLegends&&f.forEach(this._loadingLegends,function(J){var P=-1;f.some(J._contexts,function(R,Y){R.pickerInstance===this&&(P=Y);return-1<P},this);-1<P&&J._contexts.splice(P,1)},this)},_processLegendResponse:function(J,P){if(!J||J instanceof Error){var R;f.forEach(P.indices,function(aa){R=f.indexOf(this._legendIndices,aa);-1<R&&this._legendIndices.splice(R,1)},this)}else f.forEach(P.indices,function(aa){var ea=P.featureLayers[aa].layerId,
N,T=P.mapServiceUrl+"/"+ea+"/images/",ca=P.mapServiceLayer._getToken(),ia,Q;if(!this._legendSymbols[aa]){var W=null;f.some(J.layers,function(fa){fa.layerId==ea&&(W=fa);return!!W});if(W){var Z=this._legendSymbols[aa]={};f.forEach(W.legend,function(fa){if((ia=fa.values)&&ia.length)for(N=0;N<ia.length;N++)Z[ia[N]]=fa;else Z.defaultSymbol=fa;(Q=fa.url)&&!fa._fixed&&(fa._fixed=1,-1===Q.search(/https?:/)&&(fa.url=T+Q),ca&&-1!==fa.url.search(/https?:/)&&(fa.url+=(-1<fa.url.indexOf("?")?"\x26":"?")+"token\x3d"+
ca))})}}},this);var Y=this;Y._started&&!Y._legendTimer&&(Y._legendTimer=setTimeout(function(){clearTimeout(Y._legendTimer);Y._legendTimer=null;Y._destroyed||Y.update()},0))},_applyGridPatches:function(){var J=this.grid,P=J.adaptWidth,R,Y,aa;J.adaptWidth=function(){R=this.views.views;for(Y=0;aa=R[Y];Y++)a.set(aa.headerNode,"display","block");P.apply(this,arguments);for(Y=0;aa=R[Y];Y++)a.set(aa.headerNode,"display","none")};if(this._dojo14x){if("auto"!==this.rows&&"auto"!==this.columns)var ea=F.connect(J,
"_onFetchComplete",this,function(){F.disconnect(ea);this.grid.set("autoHeight",this._rows)});F.connect(J,"_onDelete",this,this._destroyItems);F.connect(J,"_clearData",this,this._destroyItems);F.connect(J,"destroy",this,this._destroyItems);(J=J.focus)&&J.findAndFocusGridCell&&(J.findAndFocusGridCell=function(){return!1})}},_setGridLayout:function(){var J=function(ea){return function(N,T){return this._cellGet(ea,N,T)}},P=B.hitch(this,this._cellFormatter),R=[],Y=this._columns,aa;for(aa=0;aa<Y;aa++)R.push({field:"cell"+
aa,get:B.hitch(this,J(aa)),formatter:P});J={cells:[R]};this.grouping&&(Y={field:"groupName",colSpan:Y,get:B.hitch(this,this._cellGetGroup),formatter:B.hitch(this,this._cellGroupFormatter)},J.cells.push([Y]));Y=this.grid;P=k.prototype.rowsPerPage;Y.set("rowsPerPage",this._rows>P?this._rows:P);Y.set("structure",J)},_setGridData:function(){var J=[];if(this.grouping){this._groupRowIndices=[];var P,R,Y=this._columns;f.forEach(this._flItems,function(ea,N){J.push({});N=0===N?0:P+R+1;this._groupRowIndices.push(N);
P=N;R=Math.ceil(ea.length/Y);J=J.concat(this._getStoreItems(ea))},this)}else this.featureLayers?(f.forEach(this._flItems,function(ea){J=J.concat(ea)}),J=this._getStoreItems(J)):J=this._getStoreItems(this._itItems);var aa=new l({data:{items:J}});this.grid.setStore(aa)},_toggleTooltip:function(){if(this.showTooltip){if(!this.tooltip){this.tooltip=e.create("div",{"class":"esriMapTooltip"},this.domNode);this.tooltip.style.display="none";this.tooltip.style.position="fixed";var J=this.grid;this._mouseOverConnect=
F.connect(J,"onCellMouseOver",this,this._cellMouseOver);this._mouseOutConnect=F.connect(J,"onCellMouseOut",this,this._cellMouseOut)}}else this.tooltip&&(F.disconnect(this._mouseOverConnect),F.disconnect(this._mouseOutConnect),e.destroy(this.tooltip),this.tooltip=null)},_rowClicked:function(J,P){var R=J.cellNode,Y=J.rowIndex;J=J.cellIndex;var aa=this._getCellInfo(R,Y,J);if(aa){var ea=this.grid.store;if(!ea.getValue(aa,"loadingCell")&&(this._selectedCell&&g.remove(this._selectedCell,"selectedItem"),
R!==this._selectedCell?(g.add(R,"selectedItem"),this._selectedCell=R,this._selectedItem={featureLayer:ea.getValue(aa,"layer"),type:ea.getValue(aa,"type"),template:ea.getValue(aa,"template"),symbolInfo:ea.getValue(aa,"symbolInfo"),item:this._getItem(aa)},this._selectedInfo={selRow:Y,selCol:J,index1:ea.getValue(aa,"index1"),index2:ea.getValue(aa,"index2"),index:ea.getValue(aa,"index")}):this._selectedCell=this._selectedInfo=this._selectedItem=null,!P))this.onSelectionChange()}},_locate:function(J,P,
R){var Y=this.grid.store,aa=Array(this._columns),ea,N=P.index1,T=P.index2,ca=P.index,ia=J.item;f.some(R,function(Q,W){return f.some(aa,function(Z,fa){return(Z=Y.getValue(Q,"cell"+fa))&&(ia?ca===Y.getValue(Z,"index"):N===Y.getValue(Z,"index1")&&T===Y.getValue(Z,"index2"))?(ea=[W,fa],!0):!1})});return ea},_getCellInfo:function(J,P,R){if(J)return J=this.grid,P=J.getItem(P),J.store.getValue(P,"cell"+R)},_getItem:function(J){var P=this.items;if(P)return P[this.grid.store.getValue(J,"index")]},_cellMouseOver:function(J){var P=
this.tooltip,R=J.cellNode,Y=this._getCellInfo(R,J.rowIndex,J.cellIndex);if(P&&Y){var aa=this.grid.store;J=aa.getValue(Y,"template");var ea=aa.getValue(Y,"type"),N=aa.getValue(Y,"symbolInfo");aa=aa.getValue(Y,"layer");J=(Y=this._getItem(Y))&&Y.label+(Y.description?": "+Y.description:"")||J&&J.name+(J.description?": "+J.description:"")||ea&&ea.name||N&&N.label+(N.description?": "+N.description:"")||(aa&&aa.name+": ")+"Default";P.style.display="none";P.innerHTML=J;R=E.coords(R.firstChild);a.set(P,{left:R.x+
"px",top:R.y+R.h+5+"px"});P.style.display=""}},_cellMouseOut:function(){var J=this.tooltip;J&&(J.style.display="none")},_destroyItems:function(){var J=this._itemWidgets,P;for(P in J)J[P]&&(J[P].destroy(),delete J[P])},_repaintItems:function(){var J=this._itemWidgets,P;for(P in J){var R=J[P];R&&R._repaint(R._surface)}},_getStoreItems:function(J){var P=this._uniqueId;J=f.map(J,function(Q){return B.mixin({surfaceId:"tpick-surface-"+P.id++},Q)});for(var R=J.length,Y=0,aa={},ea=0,N,T=[],ca=!0,ia=this._columns;Y<
R;)ca=!0,N="cell"+ea,aa[N]=J[Y],Y++,ea++,0===ea%ia&&(ca=!1,T.push(aa),aa={},ea=0);ca&&R&&T.push(aa);return T},_getItemsFromLayers:function(J){var P=[];f.forEach(J,function(R,Y){P.push(this._getItemsFromLayer(R,Y))},this);return P},_getItemsFromLayer:function(J,P){var R=[];if(this.useLegend&&-1<f.indexOf(this._loadingIndices,P))return[{label:this._nls&&this._nls.loading||"",symbol:null,layer:J,type:null,template:null,index1:P,index2:0,loadingCell:1}];var Y=[];Y=Y.concat(J.templates);f.forEach(J.types,
function(T){var ca=T.templates;f.forEach(ca,function(ia){ia._type_=T});Y=Y.concat(ca)});Y=f.filter(Y,M.isDefined);var aa=J.renderer;if(aa){var ea=aa.declaredClass.replace("esri.renderer.","");if(0<Y.length)f.forEach(Y,function(T){var ca=T.prototype;if(ca){var ia;if(ia=this._isUnclassedRenderer(aa)?aa.infos[0].symbol:aa.valueExpression?this._createSimpleSymbol(J):aa.getSymbol(ca)||this._createSimpleSymbol(J)){var Q=null,W;if(!(9>p("ie"))&&T.thumbnail&&T.thumbnail.imageData)Q=new q(T.thumbnail);else if(this.useLegend&&
-1<f.indexOf(this._legendIndices,P)){if(W=this._legendSymbols&&this._legendSymbols[P])switch(ea){case "SimpleRenderer":Q=W.defaultSymbol;break;case "UniqueValueRenderer":f.some(aa.infos,function(Z){Z.symbol===ia&&(Q=W[Z.value]);return!!Q});break;case "ClassBreaksRenderer":f.some(aa.infos,function(Z){Z.symbol===ia&&(Q=W[Z.maxValue]);return!!Q})}Q&&(ca=h.fromJson(h.toJson(q.defaultProps)),ca.url=Q.url,ca.imageData=Q.imageData,ca.contentType=Q.contentType,ca.width=Q.width,ca.height=Q.height,M.isDefined(ca.width)&&
M.isDefined(ca.height)||(ca.width=15,ca.height=15),Q=new q(ca))}R.push({label:this._trimLabel(T.name),symbol:Q||ia,legendOverride:!!Q,layer:J,type:T._type_,template:T,index1:P,index2:R.length})}else switch(ea){case "HeatmapRenderer":R.push({label:this._trimLabel(T.name),symbol:new C,legendOverride:!!Q,layer:J,type:T._type_,template:T,index1:P,index2:R.length})}}delete T._type_},this);else{var N=[];"TemporalRenderer"===ea&&(aa=aa.observationRenderer)&&(ea=aa.declaredClass.replace("esri.renderer.",
""));switch(ea){case "SimpleRenderer":N=[{symbol:aa.symbol,label:aa.label,description:aa.description}];break;case "UniqueValueRenderer":case "ClassBreaksRenderer":N=aa.infos}R=f.map(N,function(T,ca){return{label:this._trimLabel(T.label),description:T.description,symbolInfo:B.mixin({constructor:function(){}},T),symbol:T.symbol,layer:J,index1:P,index2:ca}},this)}}return R},_isUnclassedRenderer:function(J){return!!((J.hasVisualVariables("sizeInfo",!1)||J.hasVisualVariables("colorInfo",!1)||J.hasVisualVariables("opacityInfo",
!1))&&J.addBreak&&J.infos&&1===J.infos.length)},_createSimpleSymbol:function(J){switch(J.geometryType){case "esriGeometryPoint":case "esriGeometryMultipoint":var P=new C;break;case "esriGeometryPolyline":P=new x;break;case "esriGeometryPolygon":P=new w;break;default:J.hasXYFootprint&&J.hasXYFootprint()&&(P=new w)}return P},_getItemsFromItems:function(J){return f.map(J,function(P,R){P=B.mixin({index:R},P);P.label=this._trimLabel(P.label);return P},this)},_trimLabel:function(J){var P=this.maxLabelLength;
P&&J&&J.length>P&&(J=J.substr(0,P)+"...");return J||""},_cellGet:function(J,P,R){return R?this.grid.store.getValue(R,"cell"+J):""},_cellFormatter:function(J){if(J){var P=this._itemWidgets,R=this.grid.store,Y=R.getValue(J,"surfaceId"),aa=P[Y];aa||(aa=P[Y]=new I({id:Y,label:R.getValue(J,"label"),symbol:R.getValue(J,"symbol"),legendOverride:R.getValue(J,"legendOverride"),surfaceWidth:this.surfaceWidth,surfaceHeight:this.surfaceHeight,template:R.getValue(J,"template")}));return aa||""}return""},_cellGetGroup:function(J,
P){if(!this._groupRowIndices)return"";J=f.indexOf(this._groupRowIndices,J);return P&&-1!==J?(P=this.featureLayers[J])&&(this.groupLabelFunction?this.groupLabelFunction(P):P.name)||"":""},_cellGroupFormatter:function(J){return J?"\x3cdiv class\x3d'groupLabel'\x3e"+J+"\x3c/div\x3e":""}});c("extend-esri")&&B.setObject("dijit.editing.TemplatePicker",L,A);return L})},"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(O,B,F,E,f,h,r,c,v){var p=h("dojox.grid.DataGrid",r,{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 c(this)},get:function(g,e){if(e&&"_item"==this.field&&!this.fields)return e;if(e&&this.fields){var b=[],a=this.grid.store;B.forEach(this.fields,function(m){b=b.concat(a.getValues(e,m))});return b}return e||"string"!==typeof g?e?this.field?"_item"==this.field?e:this.grid.store.getValue(e,this.field):this.value:this.defaultValue:this.inherited(arguments)},_checkUpdateStatus:function(){if(0<
this.updateDelay){var g=!1;this._endUpdateDelay&&(clearTimeout(this._endUpdateDelay),delete this._endUpdateDelay,g=!0);this.updating||(this.beginUpdate(),g=!0);if(g){var e=this;this._endUpdateDelay=setTimeout(function(){delete e._endUpdateDelay;e.endUpdate()},this.updateDelay)}}},_onSet:function(g,e,b,a){this._checkUpdateStatus();g=this.getItemIndex(g);-1<g&&this.updateRow(g)},_createItem:function(g,e){e=this._hasIdentity?this.store.getIdentity(g):E.toJson(this.query)+":idx:"+e+":sort:"+E.toJson(this.getSortProps());
return this._by_idty[e]={idty:e,item:g}},_addItem:function(g,e,b){this._by_idx[e]=this._createItem(g,e);b||this.updateRow(e)},_onNew:function(g,e){this._checkUpdateStatus();e=this.get("rowCount");this._addingItem=!0;this.updateRowCount(e+1);this._addingItem=!1;this._addItem(g,e);this.showMessage()},_onDelete:function(g){this._checkUpdateStatus();g=this._getItemIndex(g,!0);if(0<=g){this._pages=[];this._eop=this._bop=-1;var e=this._by_idx[g];this._by_idx.splice(g,1);delete this._by_idty[e.idty];this.updateRowCount(this.get("rowCount")-
1);0===this.get("rowCount")&&this.showMessage(this.noDataMessage)}this.selection.isSelected(g)&&(this.selection.deselect(g),this.selection.selected.splice(g,1))},_onRevert:function(){this._refresh()},setStore:function(g,e,b){this._requestsPending(0)||(this._setQuery(e,b),this._setStore(g),this._refresh(!0))},setQuery:function(g,e){this._requestsPending(0)||(this._setQuery(g,e),this._refresh(!0))},setItems:function(g){this.items=g;this._setStore(this.store);this._refresh(!0)},_setQuery:function(g,
e){this.query=g;this.queryOptions=e||this.queryOptions},_setStore:function(g){this.store&&this._store_connects&&B.forEach(this._store_connects,this.disconnect,this);if(this.store=g){g=this.store.getFeatures();var e=[];this._canEdit=!!g["dojo.data.api.Write"]&&!!g["dojo.data.api.Identity"];this._hasIdentity=!!g["dojo.data.api.Identity"];g["dojo.data.api.Notification"]&&!this.items&&(e.push(this.connect(this.store,"onSet","_onSet")),e.push(this.connect(this.store,"onNew","_onNew")),e.push(this.connect(this.store,
"onDelete","_onDelete")));this._canEdit&&e.push(this.connect(this.store,"revert","_onRevert"));this._store_connects=e}},_onFetchBegin:function(g,e){this.scroller&&(this.rowCount!=g&&(e.isRender?(this.scroller.init(g,this.keepRows,this.rowsPerPage),this.rowCount=g,this._setAutoHeightAttr(this.autoHeight,!0),this._skipRowRenormalize=!0,this.prerender(),this._skipRowRenormalize=!1):this.updateRowCount(g)),g?this.showMessage():(this.views.render(),this._resize(),this.showMessage(this.noDataMessage),this.focus.initFocusView()))},
_onFetchComplete:function(g,e){this.scroller&&(g&&0<g.length&&(B.forEach(g,function(b,a){this._addItem(b,e.start+a,!0)},this),this.updateRows(e.start,g.length),e.isRender?(this.setScrollTop(0),this.postrender()):this._lastScrollTop&&this.setScrollTop(this._lastScrollTop),f("ie")&&v.setSelectable(this.domNode,this.selectable)),delete this._lastScrollTop,this._isLoaded||(this._isLoading=!1,this._isLoaded=!0),this._pending_requests[e.start]=!1)},_onFetchError:function(g,e){console.log(g);delete this._lastScrollTop;
this._isLoaded||(this._isLoading=!1,this._isLoaded=!0,this.showMessage(this.errorMessage));this._pending_requests[e.start]=!1;this.onFetchError(g,e)},onFetchError:function(g,e){},_fetch:function(g,e){g=g||0;if(this.store&&!this._pending_requests[g]){this._isLoaded||this._isLoading||(this._isLoading=!0,this.showMessage(this.loadingMessage));this._pending_requests[g]=!0;try{if(this.items){var b=this.items,a=this.store;this.rowsPerPage=b.length;var m={start:g,count:this.rowsPerPage,isRender:e};this._onFetchBegin(b.length,
m);var n=0;B.forEach(b,function(k){a.isItemLoaded(k)||n++});if(0===n)this._onFetchComplete(b,m);else{var l=function(k){n--;0===n&&this._onFetchComplete(b,m)};B.forEach(b,function(k){a.isItemLoaded(k)||a.loadItem({item:k,onItem:l,scope:this})},this)}}else this.store.fetch({start:g,count:this.rowsPerPage,query:this.query,sort:this.getSortProps(),queryOptions:this.queryOptions,isRender:e,onBegin:F.hitch(this,"_onFetchBegin"),onComplete:F.hitch(this,"_onFetchComplete"),onError:F.hitch(this,"_onFetchError")})}catch(k){this._onFetchError(k,
{start:g,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(g){var e=this._by_idx[g];return!e||e&&!e.item?(this._preparePage(g),null):e.item},getItemIndex:function(g){return this._getItemIndex(g,!1)},_getItemIndex:function(g,e){if(!e&&!this.store.isItem(g))return-1;e=this._hasIdentity?this.store.getIdentity(g):null;for(var b=0,a=this._by_idx.length;b<a;b++){var m=
this._by_idx[b];if(m&&(e&&m.idty==e||m.item===g))return b}return-1},filter:function(g,e){this.query=g;e&&this._clearData();this._fetch()},_getItemAttr:function(g,e){return(g=this.getItem(g))?this.store.getValue(g,e):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(g){return this._pending_requests[g]},_rowToPage:function(g){return this.rowsPerPage?Math.floor(g/
this.rowsPerPage):g},_pageToRow:function(g){return this.rowsPerPage?this.rowsPerPage*g:g},_preparePage:function(g){(g<this._bop||g>=this._eop)&&!this._addingItem&&(g=this._rowToPage(g),this._needPage(g),this._bop=g*this.rowsPerPage,this._eop=this._bop+(this.rowsPerPage||this.get("rowCount")))},_needPage:function(g){this._pages[g]||(this._pages[g]=!0,this._requestPage(g))},_requestPage:function(g){g=this._pageToRow(g);0<Math.min(this.rowsPerPage,this.get("rowCount")-g)&&(this._requests++,this._requestsPending(g)||
setTimeout(F.hitch(this,"_fetch",g,!1),1))},getCellName:function(g){return g.field},_refresh:function(g){this._clearData();this._fetch(0,g)},sort:function(){this.edit.apply();this._lastScrollTop=this.scrollTop;this._refresh()},canSort:function(){return!this._isLoading},getSortProps:function(){var g=this.getCell(this.getSortIndex());if(g){var e=g.sortDesc,b=!(0<this.sortInfo);return[{attribute:g.field,descending:"undefined"==typeof e?b:b?!e:e}]}return this.sortFields?this.sortFields:null},styleRowState:function(g){if(this.store&&
this.store.getState){for(var e=this.store.getState(g.index),b="",a=0,m=["inflight","error","inserting"],n;n=m[a];a++)if(e[n]){b=" dojoxGridRow-"+n;break}g.customClasses+=b}},onStyleRow:function(g){this.styleRowState(g);this.inherited(arguments)},canEdit:function(g,e){return this._canEdit},_copyAttr:function(g,e){g=this.getItem(g);return this.store.getValue(g,e)},doStartEdit:function(g,e){this._cache[e]||(this._cache[e]=this._copyAttr(e,g.field));this.onStartEdit(g,e)},doApplyCellEdit:function(g,e,
b){this.store.fetchItemByIdentity({identity:this._by_idx[e].idty,onItem:F.hitch(this,function(a){var m=this.store.getValue(a,b);"number"==typeof m?g=isNaN(g)?g:parseFloat(g):"boolean"==typeof m?g="true"==g?!0:"false"==g?!1:g:m instanceof Date&&(m=new Date(g),g=isNaN(m.getTime())?g:m);this.store.setValue(a,b,g);this.onApplyCellEdit(g,e,b)})})},doCancelEdit:function(g){this._cache[g]&&(this.updateRow(g),delete this._cache[g]);this.onCancelEdit.apply(this,arguments)},doApplyEdit:function(g,e){this.onApplyEdit(g)},
removeSelectedRows:function(){if(this._canEdit){this.edit.apply();var g=F.hitch(this,function(e){e.length&&(B.forEach(e,this.store.deleteItem,this.store),this.selection.clear())});this.allItemsSelected?this.store.fetch({query:this.query,queryOptions:this.queryOptions,onComplete:g}):g(this.selection.getSelected())}}});p.cell_markupFactory=function(g,e,b){var a=F.trim(v.attr(e,"field")||"");a&&(b.field=a);b.field=b.field||b.name;if(a=F.trim(v.attr(e,"fields")||""))b.fields=a.split(",");g&&g(e,b)};p.markupFactory=
function(g,e,b,a){return r.markupFactory(g,e,b,F.partial(p.cell_markupFactory,a))};return p})},"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(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y,u,C,q,w,x,I){O.isCopyKey||(O.isCopyKey=O.dnd.getCopyKeyState);F=F("dojox.grid._Grid",[m,n,E],{templateString:k,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:h,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");a.funnelEvents(this.domNode,this,"doKeyEvent",a.keyEvents);"none"!=this.selectionMode&&this.domNode.setAttribute("aria-multiselectable","single"==this.selectionMode?"false":"true");x.addClass(this.domNode,this.classTag);this.isLeftToRight()||x.addClass(this.domNode,this.classTag+"Rtl");0<this.rowHeight&&x.addClass(this.viewsNode,
this.classTag+"FixedRowHeight")},postMixInProperties:function(){this.inherited(arguments);var A=O.i18n.getLocalization("dijit","loading",this.lang);this.loadingMessage=y.substitute(this.loadingMessage,A);this.errorMessage=y.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&&x.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&&(u.forEach(this._placeholders,function(A){A.unReplace(!0)}),this.headerMenu.unBindDomNode(this.viewsHeaderNode));this.inherited(arguments)},_setAutoHeightAttr:function(A,M){"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&&!M&&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 v(this);this.focus=new p(this);this.edit=new g(this)},createSelection:function(){this.selection=new e(this)},createScroller:function(){this.scroller=new f;this.scroller.grid=this;this.scroller.renderRow=C.hitch(this,"renderRow");this.scroller.removeRow=
C.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 c(this);this.views.createView=C.hitch(this,"createView")},createView:function(A,M){A=new (C.getObject(A))({grid:this,index:M});this.viewsNode.appendChild(A.domNode);this.viewsHeaderNode.appendChild(A.headerNode);this.views.addView(A);x.attr(this.domNode,
"align",this.isLeftToRight()?"left":"right");return A},buildViews:function(){for(var A=0,M;M=this.layout.structure[A];A++)this.createView(M.type||B._scopeName+".grid._View",A).setStructure(M);this.scroller.setContentNodes(this.views.getContentNodes())},_setStructureAttr:function(A){A&&C.isString(A)&&(O.deprecated("dojox.grid._Grid.set('structure', 'objVar')","use dojox.grid._Grid.set('structure', objVar) instead","2.0"),A=C.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){O.deprecated("dojox.grid._Grid.setStructure(obj)","use dojox.grid._Grid.set('structure', obj) instead.","2.0");this._setStructureAttr(A)},getColumnTogglingItems:function(){var A=[];var M=u.map(this.layout.cells,function(H){H.menuItems||(H.menuItems=[]);var U=this,S=new l({label:H.name,checked:!H.hidden,_gridCell:H,onChange:function(D){if(U.layout.setColumnVisibility(this._gridCell.index,
D)){var L=this._gridCell.menuItems;1<L.length&&u.forEach(L,function(J){J!==this&&J.setAttribute("checked",D)},this);D=u.filter(U.layout.cells,function(J){1<J.menuItems.length?u.forEach(J.menuItems,"item.set('disabled', false);"):J.menuItems[0].set("disabled",!1);return!J.hidden});1==D.length&&u.forEach(D[0].menuItems,"item.set('disabled', true);")}},destroy:function(){var D=u.indexOf(this._gridCell.menuItems,this);this._gridCell.menuItems.splice(D,1);delete this._gridCell;l.prototype.destroy.apply(this,
arguments)}});H.menuItems.push(S);H.hidden||A.push(S);return S},this);1==A.length&&A[0].set("disabled",!0);return M},_setHeaderMenuAttr:function(A){this._placeholders&&this._placeholders.length&&(u.forEach(this._placeholders,function(M){M.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){O.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&&u.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,M){this._pendingChangeSize=A;this._pendingResultSize=M;this.sizeChange()},_getPadBorder:function(){return this._padBorder=this._padBorder||x._getPadBorderExtents(this.domNode)},_getHeaderHeight:function(){var A=this.viewsHeaderNode.style,M="none"==A.display?
0:this.views.measureHeader();A.height=M+"px";this.views.normalizeHeaderNodeHeight();return M},_resize:function(A,M){A=A||this._pendingChangeSize;M=M||this._pendingResultSize;delete this._pendingChangeSize;delete this._pendingResultSize;if(this.domNode){var H=this.domNode.parentNode;if(H&&1==H.nodeType&&this.hasLayout()&&"hidden"!=H.style.visibility&&"none"!=H.style.display){var U=this._getPadBorder(),S=void 0;if(this._autoHeight)this.domNode.style.height="auto";else if("number"==typeof this.autoHeight){var D=
S=this._getHeaderHeight();D+=this.scroller.averageRowHeight*this.autoHeight;this.domNode.style.height=D+"px"}else this.domNode.clientHeight<=U.h&&(H==document.body?this.domNode.style.height=this.defaultHeight:this.height?this.domNode.style.height=this.height:this.fitTo="parent");M&&(A=M);!this._autoHeight&&A?(x.marginBox(this.domNode,A),this.height=this.domNode.style.height,delete this.fitTo):"parent"==this.fitTo&&(D=this._parentContentBoxHeight=0<this._parentContentBoxHeight?this._parentContentBoxHeight:
x._getContentBox(H).h,this.domNode.style.height=Math.max(0,D)+"px");A=u.some(this.views.views,function(L){return L.flexCells});this._autoHeight||0!==(D||x._getContentBox(this.domNode).h)?(this.viewsHeaderNode.style.display="block",A||void 0!==S||(S=this._getHeaderHeight())):this.viewsHeaderNode.style.display="none";A&&(S=void 0);this.adaptWidth();this.adaptHeight(S);this.postresize()}}},adaptWidth:function(){var A=!this.initialWidth&&this.autoWidth,M=A?0:this.domNode.clientWidth||this.domNode.offsetWidth-
this._getPadBorder().w;M=this.views.arrange(1,M);this.views.onEach("adaptWidth");A&&(this.domNode.style.width=M+"px")},adaptHeight:function(A){A=void 0===A?this._getHeaderHeight():A;var M=this._autoHeight?-1:Math.max(this.domNode.clientHeight-A,0)||0;this.views.onEach("setSize",[0,M]);this.views.onEach("adaptHeight");if(!this._autoHeight){var H=0,U=0,S=u.filter(this.views.views,function(D){(D=D.hasHScrollbar())?H++:U++;return!D});0<H&&0<U&&u.forEach(S,function(D){D.adaptHeight(!0)})}!0===this.autoHeight||
-1!=M||"number"==typeof this.autoHeight&&this.autoHeight>=this.get("rowCount")?this.scroller.windowHeight=M: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();x.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,M){this.views.renderRow(A,
M,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,M;if(A.all)this.update();else if(void 0!=A.rowCount)this.updateRowCount(A.rowCount);else for(M in A)this.updateRow(Number(M));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,M){A=Number(A);M=Number(M);var H;if(this.updating)for(H=0;H<M;H++)this.invalidated[H+A]=!0;else{for(H=0;H<M;H++)this.views.updateRow(H+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.layout.cells.length&&this.setScrollTop(this.scrollTop),this._resize())},updateRowStyles:function(A){this.views.updateRowStyles(A)},getRowNode:function(A){if(!this.focus.focusView||this.focus.focusView instanceof b)for(var M=0,H;H=this.views.views[M];M++){if(!(H instanceof b))return H.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:q("ie")?100:50,scrollTo:function(A){if(this.fastScroll){var M=Math.abs(this.lastScrollTop-A);this.lastScrollTop=A;if(M>this.scrollRedrawThreshold||this.delayScroll){this.delayScroll=!0;this.scrollTop=A;this.views.setScrollTop(A);this._pendingScroll&&window.clearTimeout(this._pendingScroll);var H=this;this._pendingScroll=window.setTimeout(function(){delete H._pendingScroll;
H.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,M){M&&this.rows.styleRowNode(A,M)},_mouseOut:function(A){this.rows.setOverRow(-2)},getCell:function(A){return this.layout.cells[A]},setCellWidth:function(A,M){this.getCell(A).unitWidth=
M},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,M){var H=A+1;void 0!=M?H*=M?1:-1:this.getSortIndex()==A&&(H=-this.sortInfo);this.setSortInfo(H)},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,M){return A in this?this[A](M):!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,M){this.onStartEdit(A,M)},doApplyCellEdit:function(A,
M,H){this.onApplyCellEdit(A,M,H)},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()}});F.markupFactory=function(A,M,H,U){var S=function(D){D=x.attr(D,"width")||"auto";"auto"!=D&&"em"!=D.slice(-2)&&"%"!=D.slice(-1)&&
(D=parseInt(D,10)+"px");return D};A.structure||"table"!=M.nodeName.toLowerCase()||(A.structure=I("\x3e colgroup",M).map(function(D){var L=x.attr(D,"span");L={noscroll:"true"==x.attr(D,"noscroll")?!0:!1,__span:L?parseInt(L,10):1,cells:[]};x.hasAttr(D,"width")&&(L.width=S(D));return L}),A.structure.length||A.structure.push({__span:Infinity,cells:[]}),I("thead \x3e tr",M).forEach(function(D,L){var J=0,P=0,R,Y=null;I("\x3e th",D).map(function(aa){Y?J>=R+Y.__span&&(P++,R+=Y.__span,Y=A.structure[P]):(R=
0,Y=A.structure[0]);var ea={name:C.trim(x.attr(aa,"name")||aa.innerHTML),colSpan:parseInt(x.attr(aa,"colspan")||1,10),type:C.trim(x.attr(aa,"cellType")||""),id:C.trim(x.attr(aa,"id")||"")};J+=ea.colSpan;var N=x.attr(aa,"rowspan");N&&(ea.rowSpan=N);x.hasAttr(aa,"width")&&(ea.width=S(aa));x.hasAttr(aa,"relWidth")&&(ea.relWidth=window.parseInt(x.attr(aa,"relWidth"),10));x.hasAttr(aa,"hidden")&&(ea.hidden="true"==x.attr(aa,"hidden")||!0===x.attr(aa,"hidden"));U&&U(aa,ea);ea.type=ea.type?C.getObject(ea.type):
B.grid.cells.Cell;ea.type&&ea.type.markupFactory&&ea.type.markupFactory(aa,ea);Y.cells[L]||(Y.cells[L]=[]);Y.cells[L].push(ea)})}));return new H(A,M)};return F})},"dojox/grid/_Events":function(){define(["dojo/keys","dojo/dom-class","dojo/_base/declare","dojo/_base/event","dojo/_base/sniff"],function(O,B,F,E,f){return F("dojox.grid._Events",null,{cellOverClass:"dojoxGridCellOver",onKeyEvent:function(h){this.dispatchKeyEvent(h)},onContentEvent:function(h){this.dispatchContentEvent(h)},onHeaderEvent:function(h){this.dispatchHeaderEvent(h)},
onStyleRow:function(h){h.customClasses+=(h.odd?" dojoxGridRowOdd":"")+(h.selected?" dojoxGridRowSelected":"")+(h.over?" dojoxGridRowOver":"");this.focus.styleRow(h);this.edit.styleRow(h)},onKeyDown:function(h){if(!h.altKey&&!h.metaKey)switch(h.keyCode){case O.ESCAPE:this.edit.cancel();break;case O.ENTER:if(!this.edit.isEditing()){var r=this.focus.getHeaderIndex();if(0<=r){this.setSortIndex(r);break}else this.selection.clickSelect(this.focus.rowIndex,dojo.isCopyKey(h),h.shiftKey);E.stop(h)}h.shiftKey||
(r=this.edit.isEditing(),this.edit.apply(),r||this.edit.setEditCell(this.focus.cell,this.focus.rowIndex));this.edit.isEditing()||((this.focus.focusView||this.views.views[0]).content.decorateEvent(h),this.onRowClick(h),E.stop(h));break;case O.SPACE:this.edit.isEditing()||(r=this.focus.getHeaderIndex(),0<=r?this.setSortIndex(r):(this.selection.clickSelect(this.focus.rowIndex,dojo.isCopyKey(h),h.shiftKey),this.focus._focusifyCellNode(!0),this.focus.setFocusCell(this.focus.cell,this.focus.rowIndex),E.stop(h)));
break;case O.TAB:this.focus[h.shiftKey?"previousKey":"nextKey"](h);break;case O.LEFT_ARROW:case O.RIGHT_ARROW:if(!this.edit.isEditing()){var c=h.keyCode;E.stop(h);r=this.focus.getHeaderIndex();0<=r&&h.shiftKey&&h.ctrlKey?this.focus.colSizeAdjust(h,r,5*(c==O.LEFT_ARROW?-1:1)):(h=c==O.LEFT_ARROW?1:-1,this.isLeftToRight()&&(h*=-1),this.focus.move(0,h))}break;case O.UP_ARROW:this.edit.isEditing()||0===this.focus.rowIndex||(E.stop(h),this.focus.move(-1,0));break;case O.DOWN_ARROW:this.edit.isEditing()||
this.focus.rowIndex+1==this.rowCount||(E.stop(h),this.focus.move(1,0));break;case O.PAGE_UP:this.edit.isEditing()||0===this.focus.rowIndex||(E.stop(h),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 O.PAGE_DOWN:this.edit.isEditing()||this.focus.rowIndex+1==this.rowCount||
(E.stop(h),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(h){-1==h.rowIndex?this.onHeaderCellMouseOver(h):this.onCellMouseOver(h)},onMouseOut:function(h){-1==h.rowIndex?this.onHeaderCellMouseOut(h):this.onCellMouseOut(h)},onMouseDown:function(h){-1==
h.rowIndex?this.onHeaderCellMouseDown(h):this.onCellMouseDown(h)},onMouseOverRow:function(h){this.rows.isOver(h.rowIndex)||(this.rows.setOverRow(h.rowIndex),-1==h.rowIndex?this.onHeaderMouseOver(h):this.onRowMouseOver(h))},onMouseOutRow:function(h){if(this.rows.isOver(-1))this.onHeaderMouseOut(h);else this.rows.isOver(-2)||(this.rows.setOverRow(-2),this.onRowMouseOut(h))},onMouseDownRow:function(h){if(-1!=h.rowIndex)this.onRowMouseDown(h)},onCellMouseOver:function(h){h.cellNode&&B.add(h.cellNode,
this.cellOverClass)},onCellMouseOut:function(h){h.cellNode&&B.remove(h.cellNode,this.cellOverClass)},onCellMouseDown:function(h){},onCellClick:function(h){this._click[0]=this._click[1];this._click[1]=h;this.edit.isEditCell(h.rowIndex,h.cellIndex)||this.focus.setFocusCell(h.cell,h.rowIndex);1<this._click.length&&null==this._click[0]&&this._click.shift();this.onRowClick(h)},onCellDblClick:function(h){var r=1<this._click.length&&f("ie")?this._click[1]:1<this._click.length&&this._click[0].rowIndex!=this._click[1].rowIndex?
this._click[0]:h;this.focus.setFocusCell(r.cell,r.rowIndex);this.edit.setEditCell(r.cell,r.rowIndex);this.onRowDblClick(h)},onCellContextMenu:function(h){this.onRowContextMenu(h)},onCellFocus:function(h,r){this.edit.cellFocus(h,r)},onRowClick:function(h){this.edit.rowClick(h);this.selection.clickSelectEvent(h)},onRowDblClick:function(h){},onRowMouseOver:function(h){},onRowMouseOut:function(h){},onRowMouseDown:function(h){},onRowContextMenu:function(h){E.stop(h)},onHeaderMouseOver:function(h){},onHeaderMouseOut:function(h){},
onHeaderCellMouseOver:function(h){h.cellNode&&B.add(h.cellNode,this.cellOverClass)},onHeaderCellMouseOut:function(h){h.cellNode&&B.remove(h.cellNode,this.cellOverClass)},onHeaderCellMouseDown:function(h){},onHeaderClick:function(h){},onHeaderCellClick:function(h){this.setSortIndex(h.cell.index);this.onHeaderClick(h)},onHeaderDblClick:function(h){},onHeaderCellDblClick:function(h){this.onHeaderDblClick(h)},onHeaderCellContextMenu:function(h){this.onHeaderContextMenu(h)},onHeaderContextMenu:function(h){this.headerMenu||
E.stop(h)},onStartEdit:function(h,r){},onApplyCellEdit:function(h,r,c){},onCancelEdit:function(h){},onApplyEdit:function(h){},onCanSelect:function(h){return!0},onCanDeselect:function(h){return!0},onSelected:function(h){this.updateRowStyles(h)},onDeselected:function(h){this.updateRowStyles(h)},onSelectionChanged:function(){}})})},"dojox/grid/_Scroller":function(){define(["dijit/registry","dojo/_base/declare","dojo/_base/lang","./util","dojo/_base/html"],function(O,B,F,E,f){var h=function(c){c&&dojo.forEach(O.toArray(),
function(v){v.domNode&&f.isDescendant(v.domNode,c,!0)&&v.destroy()})},r=function(c,v){for(var p=[],g=0,e;e=c.childNodes[g];){g++;var b=f.byId(e);(b&&b.tagName?b.tagName.toLowerCase():"")==v&&p.push(e)}return p};return B("dojox.grid._Scroller",null,{constructor:function(c){this.setContentNodes(c);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(c,v,p){switch(arguments.length){case 3:this.rowsPerPage=p;case 2:this.keepRows=v;case 1:this.rowCount=c}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=F.hitch(this,
"onscroll"))},_getPageCount:function(c,v){return c?Math.ceil(c/v)||1:0},destroy:function(){this.invalidateNodes();delete this.contentNodes;delete this.contentNode;delete this.scrollboxNode},setKeepInfo:function(c){this.keepPages=(this.keepRows=c)?Math.max(Math.ceil(this.keepRows/this.rowsPerPage),2):this.keepPages},setContentNodes:function(c){this.colCount=(this.contentNodes=c)?this.contentNodes.length:0;this.pageNodes=[];for(c=0;c<this.colCount;c++)this.pageNodes[c]=[]},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(c){this.invalidateNodes();this.rowCount=c;c=this.pageCount;0===c&&(this.height=1);this.pageCount=this._getPageCount(this.rowCount,this.rowsPerPage);if(this.pageCount<c)for(--c;c>=this.pageCount;c--)this.height-=this.getPageHeight(c),delete this.pageHeights[c];
else this.pageCount>c&&(this.height+=this.defaultPageHeight*(this.pageCount-c-1)+this.calcLastPageHeight());this.resize()},pageExists:function(c){return!!this.getDefaultPageNode(c)},measurePage:function(c){return this.grid.rowHeight?((c+1)*this.rowsPerPage>this.rowCount?this.rowCount-c*this.rowsPerPage:this.rowsPerPage)*this.grid.rowHeight:(c=this.getDefaultPageNode(c))&&c.innerHTML?c.offsetHeight:void 0},positionPage:function(c,v){for(var p=0;p<this.colCount;p++)this.pageNodes[p][c].style.top=v+
"px"},repositionPages:function(c){for(var v=this.getDefaultNodes(),p=0,g=0;g<this.stack.length;g++)p=Math.max(this.stack[g],p);var e=(g=v[c])?this.getPageNodePosition(g)+this.getPageHeight(c):0;for(c+=1;c<=p;c++){if(g=v[c]){if(this.getPageNodePosition(g)==e)break;this.positionPage(c,e)}e+=this.getPageHeight(c)}},installPage:function(c){for(var v=0;v<this.colCount;v++)this.contentNodes[v].appendChild(this.pageNodes[v][c])},preparePage:function(c,v){v=v?this.popPage():null;for(var p=0;p<this.colCount;p++){var g=
this.pageNodes[p],e=null===v?this.createPageNode():this.invalidatePageNode(v,g);e.pageIndex=c;g[c]=e}},renderPage:function(c){var v=[],p;for(p=0;p<this.colCount;p++)v[p]=this.pageNodes[p][c];p=0;for(c*=this.rowsPerPage;p<this.rowsPerPage&&c<this.rowCount;p++,c++)this.renderRow(c,v)},removePage:function(c){var v=0;for(c*=this.rowsPerPage;v<this.rowsPerPage;v++,c++)this.removeRow(c)},destroyPage:function(c){for(var v=0;v<this.colCount;v++){var p=this.invalidatePageNode(c,this.pageNodes[v]);p&&f.destroy(p)}},
pacify:function(c){},pacifying:!1,pacifyTicks:200,setPacifying:function(c){this.pacifying!=c&&(this.pacifying=c,this.pacify(this.pacifying))},startPacify:function(){this.startPacifyTicks=(new Date).getTime()},doPacify:function(){var c=(new Date).getTime()-this.startPacifyTicks>this.pacifyTicks;this.setPacifying(!0);this.startPacify();return c},endPacify:function(){this.setPacifying(!1)},resize:function(){this.scrollboxNode&&(this.windowHeight=this.scrollboxNode.clientHeight);for(var c=0;c<this.colCount;c++)E.setStyleHeightPx(this.contentNodes[c],
Math.max(1,this.height));c=!this._invalidating;if(!c){var v=this.grid.get("autoHeight");"number"==typeof v&&v<=Math.min(this.rowsPerPage,this.rowCount)&&(c=!0)}c&&this.needPage(this.page,this.pageTop);c=this.page<this.pageCount-1?this.rowsPerPage:this.rowCount%this.rowsPerPage||this.rowsPerPage;v=this.getPageHeight(this.page);this.averageRowHeight=0<v&&0<c?v/c:0},calcLastPageHeight:function(){if(!this.pageCount)return 0;var c=(this.rowCount%this.rowsPerPage||this.rowsPerPage)*this.defaultRowHeight;
return this.pageHeights[this.pageCount-1]=c},updateContentHeight:function(c){this.height+=c;this.resize()},updatePageHeight:function(c,v,p){if(this.pageExists(c)){var g=this.getPageHeight(c),e=this.measurePage(c);void 0===e&&(e=g);this.pageHeights[c]=e;if(g!=e){this.updateContentHeight(e-g);var b=this.grid.get("autoHeight");"number"==typeof b&&b>this.rowCount||!0===b&&!v?p?(v=this.grid.viewsNode.style,v.height=parseInt(v.height)+e-g+"px",this.repositionPages(c)):this.grid.sizeChange():this.repositionPages(c)}return e}return 0},
rowHeightChanged:function(c,v){this.updatePageHeight(Math.floor(c/this.rowsPerPage),!1,v)},invalidateNodes:function(){for(;this.stack.length;)this.destroyPage(this.popPage())},createPageNode:function(){var c=document.createElement("div");f.attr(c,"role","presentation");c.style.position="absolute";c.style[this.grid.isLeftToRight()?"left":"right"]="0";return c},getPageHeight:function(c){c=this.pageHeights[c];return void 0!==c?c:this.defaultPageHeight},pushPage:function(c){return this.stack.push(c)},
popPage:function(){return this.stack.shift()},findPage:function(c){for(var v=0,p=0,g=0;v<this.pageCount&&!(g=this.getPageHeight(v),p+g>=c);v++,p+=g);this.page=v;this.pageTop=p},buildPage:function(c,v,p){this.preparePage(c,v);this.positionPage(c,p);this.installPage(c);this.renderPage(c);this.pushPage(c)},needPage:function(c,v){var p=this.getPageHeight(c);this.pageExists(c)?this.positionPage(c,v):(this.buildPage(c,!this.grid._autoHeight&&this.keepPages&&this.stack.length>=this.keepPages,v),p=this.updatePageHeight(c,
!0));return p},onscroll:function(){this.scroll(this.scrollboxNode.scrollTop)},scroll:function(c){this.grid.scrollTop=c;if(this.colCount){this.startPacify();this.findPage(c);for(var v=this.height,p=this.getScrollBottom(c),g=this.page,e=this.pageTop;g<this.pageCount&&(0>p||e<p);g++)e+=this.needPage(g,e);this.firstVisibleRow=this.getFirstVisibleRow(this.page,this.pageTop,c);this.lastVisibleRow=this.getLastVisibleRow(g-1,e,p);v!=this.height&&this.repositionPages(g-1);this.endPacify()}},getScrollBottom:function(c){return 0<=
this.windowHeight?c+this.windowHeight:-1},processNodeEvent:function(c,v){for(var p=c.target;p&&p!=v&&p.parentNode&&p.parentNode.parentNode!=v;)p=p.parentNode;if(!p||!p.parentNode||p.parentNode.parentNode!=v)return!1;c.topRowIndex=p.parentNode.pageIndex*this.rowsPerPage;v=c.topRowIndex;a:{var g=0;for(var e,b=p.parentNode;e=b.childNodes[g++];)if(e==p){--g;break a}g=-1}c.rowIndex=v+g;c.rowTarget=p;return!0},processEvent:function(c){return this.processNodeEvent(c,this.contentNode)},renderRow:function(c,
v){},removeRow:function(c){},getDefaultPageNode:function(c){return this.getDefaultNodes()[c]},positionPageNode:function(c,v){},getPageNodePosition:function(c){return c.offsetTop},invalidatePageNode:function(c,v){var p=v[c];p&&(delete v[c],this.removePage(c,p),h(p),p.innerHTML="");return p},getPageRow:function(c){return c*this.rowsPerPage},getLastPageRow:function(c){return Math.min(this.rowCount,this.getPageRow(c+1))-1},getFirstVisibleRow:function(c,v,p){if(!this.pageExists(c))return 0;var g=this.getPageRow(c),
e=this.getDefaultNodes();c=r(e[c],"div");e=0;for(var b=c.length;e<b&&v<p;e++,g++)v+=c[e].offsetHeight;return g?g-1:g},getLastVisibleRow:function(c,v,p){if(!this.pageExists(c))return 0;var g=this.getDefaultNodes(),e=this.getLastPageRow(c);c=r(g[c],"div");for(g=c.length-1;0<=g&&v>p;g--,e--)v-=c[g].offsetHeight;return e+1},findTopRow:function(c){var v=this.getDefaultNodes();v=r(v[this.page],"div");for(var p=0,g=v.length,e=this.pageTop,b;p<g;p++)if(b=v[p].offsetHeight,e+=b,e>=c)return this.offset=b-(e-
c),p+this.page*this.rowsPerPage;return-1},findScrollTop:function(c){var v=Math.floor(c/this.rowsPerPage),p=0,g;for(g=0;g<v;g++)p+=this.getPageHeight(g);this.pageTop=p;this.page=v;this.needPage(v,this.pageTop);g=this.getDefaultNodes();var e=r(g[v],"div");v=c-this.rowsPerPage*v;g=0;for(c=e.length;g<c&&g<v;g++)p+=e[g].offsetHeight;return p},dummy:0})})},"dojox/grid/util":function(){define(["../main","dojo/_base/lang","dojo/dom","dojo/_base/sniff"],function(O,B,F,E){var f=B.getObject("grid.util",!0,O);
f.na="...";f.rowIndexTag="gridRowIndex";f.gridViewTag="gridView";f.fire=function(h,r,c){function v(m,n){if(null==m)return null;var l=n?"Width":"Height";return m["scroll"+l]>m["client"+l]?m:v(m.parentNode,n)}var p;if(E("webkit")&&"focus"==r){var g=h.domNode?h.domNode:h;if(p=v(g,!1))var e=p.scrollTop;if(g=v(g,!0))var b=g.scrollLeft}var a=h&&r&&h[r];h=a&&(c?a.apply(h,c):h[r]());E("webkit")&&"focus"==r&&(p&&(p.scrollTop=e),g&&(g.scrollLeft=b));return h};f.setStyleHeightPx=function(h,r){if(0<=r){var c=
h.style;r+="px";h&&c.height!=r&&(c.height=r)}};f.mouseEvents="mouseover mouseout mousedown mouseup click dblclick contextmenu".split(" ");f.keyEvents=["keyup","keydown","keypress"];f.funnelEvents=function(h,r,c,v){v=v?v:f.mouseEvents.concat(f.keyEvents);for(var p=0,g=v.length;p<g;p++)r.connect(h,"on"+v[p],c)};f.removeNode=function(h){(h=F.byId(h))&&h.parentNode&&h.parentNode.removeChild(h);return h};f.arrayCompare=function(h,r){for(var c=0,v=h.length;c<v;c++)if(h[c]!=r[c])return!1;return h.length==
r.length};f.arrayInsert=function(h,r,c){h.length<=r?h[r]=c:h.splice(r,0,c)};f.arrayRemove=function(h,r){h.splice(r,1)};f.arraySwap=function(h,r,c){var v=h[r];h[r]=h[c];h[c]=v};return f})},"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(O,B,F,E,f,h){return F("dojox.grid._Layout",null,{constructor:function(r){this.grid=r},cells:[],structure:null,defaultWidth:"6em",moveColumn:function(r,
c,v,p,g){var e=this.structure[r].cells[0],b=this.structure[c].cells[0],a=null,m=a=0;r=0;for(var n;n=e[r];r++)if(n.index==v){a=r;break}a=e.splice(a,1)[0];a.view=this.grid.views.views[c];r=0;for(n=null;n=b[r];r++)if(n.index==p){m=r;break}g||(m+=1);b.splice(m,0,a);if(v=this.grid.getCell(this.grid.getSortIndex()))v._currentlySorted=this.grid.getSortAsc();this.cells=[];for(r=v=0;c=this.structure[r];r++)for(p=0;g=c.cells[p];p++)for(e=0;n=g[e];e++)n.index=v,this.cells.push(n),"_currentlySorted"in n&&(b=
v+1,b*=n._currentlySorted?1:-1,this.grid.sortInfo=b,delete n._currentlySorted),v++;E.forEach(this.cells,function(l){var k=l.markup[2].split(" ");parseInt(k[1].substring(5))!=l.index&&(k[1]='idx\x3d"'+l.index+'"',l.markup[2]=k.join(" "))});this.grid.setupHeaderMenu()},setColumnVisibility:function(r,c){r=this.cells[r];if(r.hidden==c){r.hidden=!c;c=r.view;var v=c.viewWidth;v&&"auto"!=v&&(c._togglingColumn=h.getMarginBox(r.getHeaderNode()).w||0);c.update();return!0}return!1},addCellDef:function(r,c,v){var p=
this,g=function(e){var b=0;1<e.colSpan?b=0:(b=e.width||p._defaultCellProps.width||p.defaultWidth,isNaN(b)||(b+="em"));return b};r={grid:this.grid,subrow:r,layoutIndex:c,index:this.cells.length};if(v&&v instanceof B.grid.cells._Base)return c=f.clone(v),r.unitWidth=g(c._props),c=f.mixin(c,this._defaultCellProps,v._props,r);c=v.type||v.cellType||this._defaultCellProps.type||this._defaultCellProps.cellType||B.grid.cells.Cell;f.isString(c)&&(c=f.getObject(c));r.unitWidth=g(v);return new c(f.mixin({},this._defaultCellProps,
v,r))},addRowDef:function(r,c){for(var v=[],p=0,g=0,e=!0,b=0,a;a=c[b];b++)a=this.addCellDef(r,b,a),v.push(a),this.cells.push(a),e&&a.relWidth?p+=a.relWidth:a.width&&(a=a.width,"string"==typeof a&&"%"==a.slice(-1)?g+=window.parseInt(a,10):"auto"==a&&(e=!1));p&&e&&E.forEach(v,function(m){m.relWidth&&(m.width=m.unitWidth=m.relWidth/p*(100-g)+"%")});return v},addRowsDef:function(r){var c=[];if(f.isArray(r))if(f.isArrayLike(r[0]))for(var v=0,p;r&&(p=r[v]);v++)c.push(this.addRowDef(v,p));else c.push(this.addRowDef(0,
r));return c},addViewDef:function(r){this._defaultCellProps=r.defaultCell||{};r.width&&"auto"==r.width&&delete r.width;return f.mixin({},r,{cells:this.addRowsDef(r.rows||r.cells)})},setStructure:function(r){this.fieldIndex=0;this.cells=[];var c=this.structure=[];if(this.grid.rowSelector){var v={type:B._scopeName+".grid._RowSelector"};if(f.isString(this.grid.rowSelector)){var p=this.grid.rowSelector;"false"==p?v=null:"true"!=p&&(v.width=p)}else this.grid.rowSelector||(v=null);v&&c.push(this.addViewDef(v))}var g=
function(m){return"name"in m||"field"in m||"get"in m};v=function(m){return f.isArray(m)&&(f.isArray(m[0])||g(m[0]))?!0:!1};p=function(m){return null!==m&&f.isObject(m)&&("cells"in m||"rows"in m||"type"in m&&!g(m))};if(f.isArrayLike(r)){for(var e=!1,b=0,a;a=r[b];b++)if(p(a)){e=!0;break}if(e)for(b=0;a=r[b];b++)v(a)?c.push(this.addViewDef({cells:a})):p(a)&&c.push(this.addViewDef(a));else c.push(this.addViewDef({cells:r}))}else p(r)&&c.push(this.addViewDef(r));this.cellCount=this.cells.length;this.grid.setupHeaderMenu()}})})},
"dojox/grid/cells":function(){define(["../main","./cells/_base"],function(O){return O.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(O,B,F,E,f,h,r,c,v,p,g,e){var b=B("dojox.grid._DeferredTextWidget",g,{deferred:null,_destroyOnRemove:!0,postCreate:function(){this.deferred&&this.deferred.addBoth(F.hitch(this,
function(k){this.domNode&&(this.domNode.innerHTML=k)}))}}),a=function(){setTimeout(F.hitch.apply(O,arguments),0)},m=B("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(k){this._props=k||{};F.mixin(this,k);void 0===this.draggable&&(this.draggable=!0)},_defaultFormat:function(k,y){var u=this.grid.formatterScope||this,C=this.formatter;
C&&u&&"string"==typeof C&&(C=this.formatter=u[C]);k=k!=this.defaultValue&&C?C.apply(u,y):k;if("undefined"==typeof k)return this.defaultValue;k&&k.addBoth&&(k=new b({deferred:k},p.create("span",{innerHTML:this.defaultValue})));return k&&k.declaredClass&&k.startup?"\x3cdiv class\x3d'dojoxGridStubNode' linkWidget\x3d'"+k.id+"' cellIdx\x3d'"+this.index+"'\x3e"+this.defaultValue+"\x3c/div\x3e":k},format:function(k,y){var u=this.grid.edit.info;(y=this.get?this.get(k,y):this.value||this.defaultValue)&&y.replace&&
this.grid.escapeHTMLInData&&(y=y.replace(/&(?![a-z0-9]{1,8};)/ig,"\x26amp;").replace(/</g,"\x26lt;"));return this.editable&&(this.alwaysEditing||u.rowIndex==k&&u.cell==this)?this.formatEditing(u.value?u.value:y,k):this._defaultFormat(y,[y,k,this])},formatEditing:function(k,y){},getNode:function(k){return this.view.getCellNode(k,this.index)},getHeaderNode:function(){return this.view.getHeaderCellNode(this.index)},getEditNode:function(k){return(this.getNode(k)||0).firstChild||0},canResize:function(){var k=
this.unitWidth;return k&&"auto"!==k},isFlex:function(){var k=this.unitWidth;return k&&F.isString(k)&&("auto"==k||"%"==k.slice(-1))},applyEdit:function(k,y){this.getNode(y)&&this.grid.edit.applyCellEdit(k,this,y)},cancelEdit:function(k){this.grid.doCancelEdit(k)},_onEditBlur:function(k){this.grid.edit.isEditCell(k,this.index)&&this.grid.edit.apply()},registerOnBlur:function(k,y){this.commitOnBlur&&f.connect(k,"onblur",function(u){setTimeout(F.hitch(this,"_onEditBlur",y),250)})},needFormatNode:function(k,
y){this._formatPending=!0;a(this,"_formatNode",k,y)},cancelFormatNode:function(){this._formatPending=!1},_formatNode:function(k,y){this._formatPending&&(this._formatPending=!1,r("ie")||c.setSelectable(this.grid.domNode,!0),this.formatNode(this.getEditNode(y),k,y))},formatNode:function(k,y,u){r("ie")?a(this,"focus",u,k):this.focus(u,k)},dispatchEvent:function(k,y){if(k in this)return this[k](y)},getValue:function(k){return this.getEditNode(k)[this._valueProp]},setValue:function(k,y){(k=this.getEditNode(k))&&
(k[this._valueProp]=y)},focus:function(k,y){k=y||this.getEditNode(k);try{e.fire(k,"focus"),e.fire(k,"select")}catch(u){}},save:function(k){this.value=this.value||this.getValue(k)},restore:function(k){this.setValue(k,this.value)},_finish:function(k){c.setSelectable(this.grid.domNode,!1);this.cancelFormatNode()},apply:function(k){this.applyEdit(this.getValue(k),k);this._finish(k)},cancel:function(k){this.cancelEdit(k);this._finish(k)}});m.markupFactory=function(k,y){var u=F.trim(v.get(k,"formatter")||
"");u&&(y.formatter=F.getObject(u)||u);if(u=F.trim(v.get(k,"get")||""))y.get=F.getObject(u);u=function(C,q,w){var x=F.trim(v.get(k,C)||"");x&&(q[w||C]="false"!=x.toLowerCase())};u("sortDesc",y);u("editable",y);u("alwaysEditing",y);u("noresize",y);u("draggable",y);if(u=F.trim(v.get(k,"loadingText")||v.get(k,"defaultValue")||""))y.defaultValue=u;u=function(C,q,w){var x=F.trim(v.get(k,C)||"")||void 0;x&&(q[w||C]=x)};u("styles",y);u("headerStyles",y);u("cellStyles",y);u("classes",y);u("headerClasses",
y);u("cellClasses",y)};var n=m.Cell=B("dojox.grid.cells.Cell",m,{constructor:function(){this.keyFilter=this.keyFilter},keyFilter:null,formatEditing:function(k,y){this.needFormatNode(k,y);k&&k.replace&&(k=k.replace(/"/g,"\x26quot;"));return'\x3cinput class\x3d"dojoxGridInput" type\x3d"text" value\x3d"'+k+'"\x3e'},formatNode:function(k,y,u){this.inherited(arguments);this.registerOnBlur(k,u)},doKey:function(k){this.keyFilter&&-1==String.fromCharCode(k.charCode).search(this.keyFilter)&&E.stop(k)},_finish:function(k){this.inherited(arguments);
var y=this.getEditNode(k);try{e.fire(y,"blur")}catch(u){}}});n.markupFactory=function(k,y){m.markupFactory(k,y);if(k=F.trim(v.get(k,"keyFilter")||""))y.keyFilter=new RegExp(k)};(m.RowIndex=B("dojox.grid.cells.RowIndex",n,{name:"Row",postscript:function(){this.editable=!1},get:function(k){return k+1}})).markupFactory=function(k,y){n.markupFactory(k,y)};(m.Select=B("dojox.grid.cells.Select",n,{options:null,values:null,returnIndex:-1,constructor:function(k){this.values=this.values||this.options},formatEditing:function(k,
y){this.needFormatNode(k,y);y=['\x3cselect class\x3d"dojoxGridSelect"\x3e'];for(var u=0,C,q;void 0!==(C=this.options[u])&&void 0!==(q=this.values[u]);u++)q=q.replace?q.replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;"):q,C=C.replace?C.replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;"):C,y.push("\x3coption",k==q?" selected":"",' value\x3d"'+q+'"',"\x3e",C,"\x3c/option\x3e");y.push("\x3c/select\x3e");return y.join("")},_defaultFormat:function(k,y){var u=this.inherited(arguments);if(!this.formatter&&this.values&&
this.options){var C=h.indexOf(this.values,u);0<=C&&(u=this.options[C])}return u},getValue:function(k){var y=this.getEditNode(k);if(y)return k=y.selectedIndex,y=y.options[k],-1<this.returnIndex?k:y.value||y.innerHTML}})).markupFactory=function(k,y){n.markupFactory(k,y);var u=F.trim(v.get(k,"options")||"");if(u){var C=u.split(",");C[0]!=u&&(y.options=C)}if(k=F.trim(v.get(k,"values")||""))u=k.split(","),u[0]!=k&&(y.values=u)};var l=m.AlwaysEdit=B("dojox.grid.cells.AlwaysEdit",n,{alwaysEditing:!0,_formatNode:function(k,
y){this.formatNode(this.getEditNode(y),k,y)},applyStaticValue:function(k){var y=this.grid.edit;y.applyCellEdit(this.getValue(k),this,k);y.start(this,k,!0)}});l.markupFactory=function(k,y){n.markupFactory(k,y)};(m.Bool=B("dojox.grid.cells.Bool",l,{_valueProp:"checked",formatEditing:function(k,y){return'\x3cinput class\x3d"dojoxGridInput" type\x3d"checkbox"'+(k?' checked\x3d"checked"':"")+' style\x3d"width: auto" /\x3e'},doclick:function(k){"INPUT"==k.target.tagName&&this.applyStaticValue(k.rowIndex)}})).markupFactory=
function(k,y){l.markupFactory(k,y)};return m})},"dojox/grid/_RowSelector":function(){define(["dojo/_base/declare","./_View"],function(O,B){return O("dojox.grid._RowSelector",B,{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(F,E){E.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(F,E){var f=
["dojoxGridRowbar dojoxGridNonNormalizedCell"];this.grid.rows.isOver(F)&&f.push("dojoxGridRowbarOver");this.grid.selection.isSelected(F)&&f.push("dojoxGridRowbarSelected");E.className=f.join(" ")},domouseover:function(F){this.grid.onMouseOverRow(F)},domouseout:function(F){if(!this.isIntraRowEvent(F))this.grid.onMouseOutRow(F)}})})},"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(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y,u){g=E("dojox.grid._View",[b,a],{defaultWidth:"18em",viewWidth:"",templateString:g,classTag:"dojoxGrid",marginBottom:0,rowPad:2,_togglingColumn:-1,_headerBuilderClass:k._HeaderBuilder,_contentBuilderClass:k._ContentBuilder,postMixInProperties:function(){this.rowNodes={}},postCreate:function(){this.connect(this.scrollboxNode,"onscroll","doscroll");n.funnelEvents(this.contentNode,this,"doContentEvent","mouseover mouseout click dblclick contextmenu mousedown".split(" "));
n.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(){l.destroy(this.headerNode);delete this.headerNode;for(var w in this.rowNodes)this._cleanupRowWidgets(this.rowNodes[w]),l.destroy(this.rowNodes[w]);this.rowNodes={};this.source&&this.source.destroy();
this.inherited(arguments)},focus:function(){c("ie")||c("webkit")||c("opera")?this.hiddenFocusNode.focus():this.scrollboxNode.focus()},setStructure:function(w){w=this.structure=w;w.width&&!isNaN(w.width)?this.viewWidth=w.width+"em":this.viewWidth=w.width||(w.noscroll?"auto":this.viewWidth);this._onBeforeRow=w.onBeforeRow||function(){};this._onAfterRow=w.onAfterRow||function(){};if(this.noscroll=w.noscroll)this.scrollboxNode.style.overflow="hidden";this.simpleStructure=1==w.cells.length;this.testFlexCells();
this.updateStructure()},_cleanupRowWidgets:function(w){w&&f.forEach(v("[widgetId]",w).map(B.byNode),function(x){x._destroyOnRemove?(x.destroy(),delete x):x.domNode&&x.domNode.parentNode&&x.domNode.parentNode.removeChild(x.domNode)})},onBeforeRow:function(w,x){this._onBeforeRow(w,x);0<=w&&this._cleanupRowWidgets(this.getRowNode(w))},onAfterRow:function(w,x,I){this._onAfterRow(w,x,I);var A=this.grid;f.forEach(v(".dojoxGridStubNode",I),function(M){if(M&&M.parentNode){var H=M.getAttribute("linkWidget"),
U=window.parseInt(l.attr(M,"cellIdx"),10);A.getCell(U);(H=B.byId(H))?(M.parentNode.replaceChild(H.domNode,M),H._started||H.startup(),O.destroy(M)):M.innerHTML=""}},this)},testFlexCells:function(){this.flexCells=!1;for(var w=0,x;x=this.structure.cells[w];w++)for(var I=0,A;A=x[I];I++)A.view=this,this.flexCells=this.flexCells||A.isFlex();return this.flexCells},updateStructure:function(){this.header.update();this.content.update()},getScrollbarWidth:function(){var w=this.hasVScrollbar(),x=l.style(this.scrollboxNode,
"overflow");this.noscroll||!x||"hidden"==x?w=!1:"scroll"==x&&(w=!0);return w?m.getScrollbar().w:0},getColumnsWidth:function(){var w=this.headerContentNode;return w&&w.firstChild?w.firstChild.offsetWidth||l.style(w.firstChild,"width"):0},setColumnsWidth:function(w){this.headerContentNode.firstChild.style.width=w+"px";this.viewWidth&&(this.viewWidth=w+"px")},getWidth:function(){return this.viewWidth||this.getColumnsWidth()+this.getScrollbarWidth()+"px"},getContentWidth:function(){return Math.max(0,
l._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 w=this.grid.layout.cells,x=h.hitch(this,function(A,M){!this.grid.isLeftToRight()&&(M=!M);M=M?-1:1;A=this.header.getCellNodeIndex(A)+M;for(var H=w[A];H&&H.getHeaderNode()&&"none"==H.getHeaderNode().style.display;)A+=M,H=w[A];return H?H.getHeaderNode():
null});if(this.grid.columnReordering&&this.simpleStructure){this.source&&this.source.destroy();this.bottomMarker&&l.destroy(this.bottomMarker);this.bottomMarker=l.byId("dojoxGrid_bottomMarker");this.topMarker&&l.destroy(this.topMarker);this.topMarker=l.byId("dojoxGrid_topMarker");this.bottomMarker||(this.bottomMarker=l.create("div",{id:"dojoxGrid_bottomMarker","class":"dojoxGridColPlaceBottom"},p.body()),this._hide(this.bottomMarker),this.topMarker=l.create("div",{id:"dojoxGrid_topMarker","class":"dojoxGridColPlaceTop"},
p.body()),this._hide(this.topMarker));this.arrowDim=l.contentBox(this.bottomMarker);var I=l.contentBox(this.headerContentNode.firstChild.rows[0]).h;this.source=new e(this.headerContentNode.firstChild.rows[0],{horizontal:!0,accept:["gridColumn_"+this.grid.id],viewIndex:this.index,generateText:!1,onMouseDown:h.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>c("ie")?1:0)&&e.prototype.onMouseDown.call(this.source,A)}}),onMouseOver:h.hitch(this,function(A){var M=this.source;M._getChildByEvent(A)&&e.prototype.onMouseOver.apply(M,arguments)}),_markTargetAnchor:h.hitch(this,function(A){var M=this.source;if(M.current!=M.targetAnchor||M.before!=A){M.targetAnchor&&x(M.targetAnchor,M.before)&&M._removeItemClass(x(M.targetAnchor,M.before),M.before?"After":"Before");e.prototype._markTargetAnchor.call(M,
A);var H=A?M.targetAnchor:x(M.targetAnchor,M.before);A=0;H||(H=M.targetAnchor,A=l.contentBox(H).w+this.arrowDim.w/2+2);H=l.position(H,!0);A=Math.floor(H.x-this.arrowDim.w/2+A);l.style(this.bottomMarker,"visibility","visible");l.style(this.topMarker,"visibility","visible");l.style(this.bottomMarker,{left:A+"px",top:I+H.y+"px"});l.style(this.topMarker,{left:A+"px",top:H.y-this.arrowDim.h+"px"});M.targetAnchor&&x(M.targetAnchor,M.before)&&M._addItemClass(x(M.targetAnchor,M.before),M.before?"After":"Before")}}),
_unmarkTargetAnchor:h.hitch(this,function(){var A=this.source;A.targetAnchor&&(A.targetAnchor&&x(A.targetAnchor,A.before)&&A._removeItemClass(x(A.targetAnchor,A.before),A.before?"After":"Before"),this._hide(this.bottomMarker),this._hide(this.topMarker),e.prototype._unmarkTargetAnchor.call(A))}),destroy:h.hitch(this,function(){r.disconnect(this._source_conn);r.unsubscribe(this._source_sub);e.prototype.destroy.call(this.source);this.bottomMarker&&(l.destroy(this.bottomMarker),delete this.bottomMarker);
this.topMarker&&(l.destroy(this.topMarker),delete this.topMarker)}),onDndCancel:h.hitch(this,function(){e.prototype.onDndCancel.call(this.source);this._hide(this.bottomMarker);this._hide(this.topMarker)})});this._source_conn=r.connect(this.source,"onDndDrop",this,"_onDndDrop");this._source_sub=r.subscribe("/dnd/drop/before",this,"_onDndDropBefore");this.source.startup()}},_hide:function(w){l.style(w,{top:"-10000px",visibility:"hidden"})},_onDndDropBefore:function(w,x,I){u.manager().target===this.source&&
(this.source._targetNode=this.source.targetAnchor,this.source._beforeTarget=this.source.before,x=this.grid.views.views,w=x[w.viewIndex],x=x[this.index],x!=w&&(w.convertColPctToFixed(),x.convertColPctToFixed()))},_onDndDrop:function(w,x,I){if(u.manager().target!==this.source)u.manager().source===this.source&&(this._removingColumn=!0);else{this._hide(this.bottomMarker);this._hide(this.topMarker);I=function(S){return S?l.attr(S,"idx"):null};var A=l.marginBox(x[0]).w;if(w.viewIndex!==this.index){var M=
this.grid.views.views,H=M[w.viewIndex];M=M[this.index];H.viewWidth&&"auto"!=H.viewWidth&&H.setColumnsWidth(H.getColumnsWidth()-A);M.viewWidth&&"auto"!=M.viewWidth&&M.setColumnsWidth(M.getColumnsWidth())}A=this.source._targetNode;H=this.source._beforeTarget;!this.grid.isLeftToRight()&&(H=!H);M=this.grid.layout;var U=this.index;delete this.source._targetNode;delete this.source._beforeTarget;M.moveColumn(w.viewIndex,U,I(x[0]),I(A),H)}},renderHeader:function(){this.headerContentNode.innerHTML=this.header.generateHtml(this._getHeaderContent);
this.flexCells&&(this.contentWidth=this.getContentWidth(),this.headerContentNode.firstChild.style.width=this.contentWidth);n.fire(this,"onAfterRow",[-1,this.structure.cells,this.headerContentNode])},_getHeaderContent:function(w){var x=w.name||w.grid.getCellName(w);/^\s+$/.test(x)&&(x="\x26nbsp;");var I=['\x3cdiv class\x3d"dojoxGridSortNode'];w.index!=w.grid.getSortIndex()?I.push('"\x3e'):I=I.concat([" ",0<w.grid.sortInfo?"dojoxGridSortUp":"dojoxGridSortDown",'"\x3e\x3cdiv class\x3d"dojoxGridArrowButtonChar"\x3e',
0<w.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']);I=I.concat([x,"\x3c/div\x3e\x3c/div\x3e"]);return I.join("")},resize:function(){this.adaptHeight();this.adaptWidth()},hasHScrollbar:function(w){var x=this._hasHScroll||!1;if(void 0==this._hasHScroll||w)this.noscroll?this._hasHScroll=!1:(w=l.style(this.scrollboxNode,"overflow"),this._hasHScroll="hidden"==w?!1:"scroll"==
w?!0:this.scrollboxNode.offsetWidth-this.getScrollbarWidth()<this.contentNode.offsetWidth);x!==this._hasHScroll&&this.grid.update();return this._hasHScroll},hasVScrollbar:function(w){var x=this._hasVScroll||!1;if(void 0==this._hasVScroll||w)this.noscroll?this._hasVScroll=!1:(w=l.style(this.scrollboxNode,"overflow"),this._hasVScroll="hidden"==w?!1:"scroll"==w?!0:this.scrollboxNode.scrollHeight>this.scrollboxNode.clientHeight);x!==this._hasVScroll&&this.grid.update();return this._hasVScroll},convertColPctToFixed:function(){var w=
!1;this.grid.initialWidth="";var x=v("th",this.headerContentNode),I=f.map(x,function(A,M){var H=A.style.width;l.attr(A,"vIdx",M);if(H&&"%"==H.slice(-1))w=!0;else if(H&&"px"==H.slice(-2))return window.parseInt(H,10);return l.contentBox(A).w});return w?(f.forEach(this.grid.layout.cells,function(A,M){if(A.view==this&&(A=A.view.getHeaderCellNode(A.index))&&l.hasAttr(A,"vIdx")){var H=window.parseInt(l.attr(A,"vIdx"));this.setColWidth(M,I[H]);l.removeAttr(A,"vIdx")}},this),!0):!1},adaptHeight:function(w){if(!this.grid._autoHeight){var x=
this.domNode.style.height&&parseInt(this.domNode.style.height.replace(/px/,""),10)||this.domNode.clientHeight;if(!w&&(w=this.noscroll))a:{for(var I=0;I<this.grid.views.views.length;++I)if(w=this.grid.views.views[I],w!==this&&w.hasHScrollbar()){w=!0;break a}w=!1}w&&(x-=m.getScrollbar().h);n.setStyleHeightPx(this.scrollboxNode,x)}this.hasVScrollbar(!0)},adaptWidth:function(){this.flexCells&&(this.contentWidth=this.getContentWidth(),this.headerContentNode.firstChild.style.width=this.contentWidth);var w=
this.scrollboxNode.offsetWidth-this.getScrollbarWidth();this._removingColumn?(w=Math.min(w,this.getColumnsWidth())+"px",this._removingColumn=!1):w=Math.max(w,this.getColumnsWidth())+"px";this.contentNode.style.width=w;this.hasHScrollbar(!0)},setSize:function(w,x){var I=this.domNode.style,A=this.headerNode.style;w&&(I.width=w,A.width=w);I.height=0<=x?x+"px":""},renderRow:function(w){var x=this.createRowNode(w);this.buildRow(w,x);return x},createRowNode:function(w){var x=document.createElement("div");
x.className=this.classTag+"Row";this instanceof F.grid._RowSelector?l.attr(x,"role","presentation"):(l.attr(x,"role","row"),"none"!=this.grid.selectionMode&&x.setAttribute("aria-selected","false"));x[n.gridViewTag]=this.id;x[n.rowIndexTag]=w;return this.rowNodes[w]=x},buildRow:function(w,x){this.buildRowContent(w,x);this.styleRow(w,x)},buildRowContent:function(w,x){x.innerHTML=this.content.generateHtml(w,w);this.flexCells&&this.contentWidth&&(x.firstChild.style.width=this.contentWidth);n.fire(this,
"onAfterRow",[w,this.structure.cells,x])},rowRemoved:function(w){0<=w&&this._cleanupRowWidgets(this.getRowNode(w));this.grid.edit.save(this,w);delete this.rowNodes[w]},getRowNode:function(w){return this.rowNodes[w]},getCellNode:function(w,x){if(w=this.getRowNode(w))return this.content.getCellNode(w,x)},getHeaderCellNode:function(w){if(this.headerContentNode)return this.header.getCellNode(this.headerContentNode,w)},styleRow:function(w,x){var I=void 0==x.style.cssText?x.getAttribute("style"):x.style.cssText;
x._style=I;this.styleRowNode(w,x)},styleRowNode:function(w,x){x&&this.doStyleRowNode(w,x)},doStyleRowNode:function(w,x){this.grid.styleRowNode(w,x)},updateRow:function(w){var x=this.getRowNode(w);x&&(x.style.height="",this.buildRow(w,x));return x},updateRowStyles:function(w){this.styleRowNode(w,this.getRowNode(w))},lastTop:0,firstScroll:0,_nativeScroll:!1,doscroll:function(w){if(13<=c("ff")||c("chrome"))this._nativeScroll=!0;w=this.grid.isLeftToRight();if(2>this.firstScroll){if(!w&&1==this.firstScroll||
w&&0===this.firstScroll){var x=l.marginBox(this.headerNodeContainer);c("ie")?this.headerNodeContainer.style.width=x.w+this.getScrollbarWidth()+"px":c("mozilla")&&(this.headerNodeContainer.style.width=x.w-this.getScrollbarWidth()+"px",this.scrollboxNode.scrollLeft=w?this.scrollboxNode.clientWidth-this.scrollboxNode.scrollWidth:this.scrollboxNode.scrollWidth-this.scrollboxNode.clientWidth)}this.firstScroll++}this.headerNode.scrollLeft=this.scrollboxNode.scrollLeft;w=this.scrollboxNode.scrollTop;w!==
this.lastTop&&this.grid.scrollTo(w);this._nativeScroll=!1},setScrollTop:function(w){this.lastTop=w;this._nativeScroll||(this.scrollboxNode.scrollTop=w);return this.scrollboxNode.scrollTop},doContentEvent:function(w){if(this.content.decorateEvent(w))this.grid.onContentEvent(w)},doHeaderEvent:function(w){if(this.header.decorateEvent(w))this.grid.onHeaderEvent(w)},dispatchContentEvent:function(w){return this.content.dispatchEvent(w)},dispatchHeaderEvent:function(w){return this.header.dispatchEvent(w)},
setColWidth:function(w,x){this.grid.setCellWidth(w,x+"px")},update:function(){if(this.domNode){this.content.update();this.grid.update();var w=this.scrollboxNode.scrollLeft;this.scrollboxNode.scrollLeft=w;this.headerNode.scrollLeft=w}}});var C=E("dojox.grid._GridAvatar",y,{construct:function(){var w=p.doc,x=w.createElement("table");x.cellPadding=x.cellSpacing="0";x.className="dojoxGridDndAvatar";x.style.position="absolute";x.style.zIndex=1999;x.style.margin="0px";var I=w.createElement("tbody"),A=w.createElement("tr"),
M=w.createElement("td"),H=w.createElement("td");A.className="dojoxGridDndAvatarItem";H.className="dojoxGridDndAvatarItemImage";H.style.width="16px";var U=this.manager.source;if(U.creator)U=U._normalizedCreator(U.getItem(this.manager.nodes[0].id).data,"avatar").node;else if(U=this.manager.nodes[0].cloneNode(!0),"tr"==U.tagName.toLowerCase()){var S=w.createElement("table");var D=w.createElement("tbody");D.appendChild(U);S.appendChild(D);U=S}else"th"==U.tagName.toLowerCase()&&(S=w.createElement("table"),
D=w.createElement("tbody"),w=w.createElement("tr"),S.cellPadding=S.cellSpacing="0",w.appendChild(U),D.appendChild(w),S.appendChild(D),U=S);U.id="";M.appendChild(U);A.appendChild(H);A.appendChild(M);l.style(A,"opacity",.9);I.appendChild(A);x.appendChild(I);this.node=x;x=u.manager();this.oldOffsetY=x.OFFSET_Y;x.OFFSET_Y=1},destroy:function(){u.manager().OFFSET_Y=this.oldOffsetY;this.inherited(arguments)}}),q=u.manager().makeAvatar;u.manager().makeAvatar=function(){return void 0===this.source.viewIndex||
l.hasClass(p.body(),"dijit_a11y")?q.call(u.manager()):new C(this)};return g})},"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(O,B,F,E,f,h,r){var c=B.getObject("dojox.html.metrics",!0),v=B.getObject("dojox");c.getFontMeasurements=function(){var m={"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};if(F("ie")){var n=
h.doc.documentElement.style.fontSize||"";n||(h.doc.documentElement.style.fontSize="100%")}var l=h.doc.createElement("div"),k=l.style;k.position="absolute";k.left="-100px";k.top="0";k.width="30px";k.height="1000em";k.borderWidth="0";k.margin="0";k.padding="0";k.outline="0";k.lineHeight="1";k.overflow="hidden";h.body().appendChild(l);for(var y in m)k.fontSize=y,m[y]=16*Math.round(12*l.offsetHeight/16)/12/1E3;F("ie")&&(h.doc.documentElement.style.fontSize=n);h.body().removeChild(l);l=null;return m};
var p=null;c.getCachedFontMeasurements=function(m){if(m||!p)p=c.getFontMeasurements();return p};var g=null,e={};c.getTextBox=function(m,n,l){if(g)var k=g;else{k=g=h.doc.createElement("div");k.style.whiteSpace="nowrap";var y=h.doc.createElement("div");y.appendChild(k);var u=y.style;u.overflow="scroll";u.position="absolute";u.left="0px";u.top="-10000px";u.width="1px";u.height="1px";u.visibility="hidden";u.borderWidth="0";u.margin="0";u.padding="0";u.outline="0";h.body().appendChild(y)}k.className="";
u=k.style;u.borderWidth="0";u.margin="0";u.padding="0";u.outline="0";if(1<arguments.length&&n)for(var C in n)C in e||(u[C]=n[C]);2<arguments.length&&l&&(k.className=l);k.innerHTML=m;u=r.position(k);u.w=k.parentNode.scrollWidth;return u};var b=16,a=16;c.getScrollbar=function(){return{w:b,h:a}};c._fontResizeNode=null;c.initOnFontResize=function(m){var n=c._fontResizeNode=h.doc.createElement("iframe");m=n.style;m.position="absolute";m.width="5em";m.height="10em";m.top="-10000px";m.display="none";F("ie")?
n.onreadystatechange=function(){"complete"==n.contentWindow.document.readyState&&(n.onresize=n.contentWindow.parent[v._scopeName].html.metrics._fontresize)}:n.onload=function(){n.contentWindow.onresize=n.contentWindow.parent[v._scopeName].html.metrics._fontresize};n.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'");h.body().appendChild(n);c.initOnFontResize=
function(){}};c.onFontResize=function(){};c._fontresize=function(){c.onFontResize()};f.addOnUnload(function(){var m=c._fontResizeNode;m&&(F("ie")&&m.onresize?m.onresize=null:m.contentWindow&&m.contentWindow.onresize&&(m.contentWindow.onresize=null),c._fontResizeNode=null)});E(function(){try{var m=h.doc.createElement("div");m.style.cssText="top:0;left:0;width:100px;height:100px;overflow:scroll;position:absolute;visibility:hidden;";h.body().appendChild(m);b=m.offsetWidth-m.clientWidth;a=m.offsetHeight-
m.clientHeight;h.body().removeChild(m);delete m}catch(n){}"fontSizeWatch"in O.config&&O.config.fontSizeWatch&&c.initOnFontResize()});return c})},"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(O,B,F,E,f,h,r,c,v,p,g,e){var b=O.grid,a=function(q){return 0<=q.rowIndex?q.rowIndex:B.indexOf(q.parentNode.childNodes,
q)},m=function(q,w){return q&&((q.rows||0)[w]||q.childNodes[w])},n=function(q){for(;q&&"TABLE"!=q.tagName;q=q.parentNode);return q},l=function(q){var w=q.toUpperCase();return function(x){return x.tagName!=w}},k=p.rowIndexTag,y=p.gridViewTag,u=b._Builder=F.extend(function(q){q&&(this.view=q,this.grid=q.grid)},{view:null,_table:'\x3ctable class\x3d"dojoxGridRowTable" border\x3d"0" cellspacing\x3d"0" cellpadding\x3d"0" role\x3d"presentation"',getTableArray:function(){var q=[this._table];this.view.viewWidth&&
q.push([' style\x3d"width:',this.view.viewWidth,';"'].join(""));q.push("\x3e");return q},generateCellMarkup:function(q,w,x,I){var A=[];if(I){var M=q.index!=q.grid.getSortIndex()?"":0<q.grid.sortInfo?'aria-sort\x3d"ascending"':'aria-sort\x3d"descending"';q.id||(q.id=this.grid.id+"Hdr"+q.index);M=['\x3cth tabIndex\x3d"-1" aria-readonly\x3d"true" role\x3d"columnheader"',M,' id\x3d"',q.id,'"']}else M=['\x3ctd tabIndex\x3d"-1" role\x3d"gridcell"',this.grid.editable&&!q.editable?'aria-readonly\x3d"true"':
""];q.colSpan&&M.push(' colspan\x3d"',q.colSpan,'"');q.rowSpan&&M.push(' rowspan\x3d"',q.rowSpan,'"');M.push(' class\x3d"dojoxGridCell ');q.classes&&M.push(q.classes," ");x&&M.push(x," ");A.push(M.join(""));A.push("");M=['" idx\x3d"',q.index,'" style\x3d"'];w&&";"!=w[w.length-1]&&(w+=";");M.push(q.styles,w||"",q.hidden?"display:none;":"");q.unitWidth&&M.push("width:",q.unitWidth,";");A.push(M.join(""));A.push("");M=['"'];q.attrs&&M.push(" ",q.attrs);M.push("\x3e");A.push(M.join(""));A.push("");A.push(I?
"\x3c/th\x3e":"\x3c/td\x3e");return A},isCellNode:function(q){return!(!q||q==E.doc||!g.attr(q,"idx"))},getCellNodeIndex:function(q){return q?Number(g.attr(q,"idx")):-1},getCellNode:function(q,w){for(var x=0,I;(I=m(q.firstChild,x))&&I.cells;x++)for(var A=0,M;M=I.cells[A];A++)if(this.getCellNodeIndex(M)==w)return M;return null},findCellTarget:function(q,w){for(;q&&(!this.isCellNode(q)||q.offsetParent&&y in q.offsetParent.parentNode&&q.offsetParent.parentNode[y]!=this.view.id)&&q!=w;)q=q.parentNode;
return q!=w?q:null},baseDecorateEvent:function(q){q.dispatch="do"+q.type;q.grid=this.grid;q.sourceView=this.view;q.cellNode=this.findCellTarget(q.target,q.rowNode);q.cellIndex=this.getCellNodeIndex(q.cellNode);q.cell=0<=q.cellIndex?this.grid.getCell(q.cellIndex):null},findTarget:function(q,w){for(;q&&q!=this.domNode&&(!(w in q)||y in q&&q[y]!=this.view.id);)q=q.parentNode;return q!=this.domNode?q:null},findRowTarget:function(q){return this.findTarget(q,k)},isIntraNodeEvent:function(q){try{return q.cellNode&&
q.relatedTarget&&g.isDescendant(q.relatedTarget,q.cellNode)}catch(w){return!1}},isIntraRowEvent:function(q){try{var w=q.relatedTarget&&this.findRowTarget(q.relatedTarget);return!w&&-1==q.rowIndex||w&&q.rowIndex==w.gridRowIndex}catch(x){return!1}},dispatchEvent:function(q){return q.dispatch in this?this[q.dispatch](q):!1},domouseover:function(q){q.cellNode&&q.cellNode!=this.lastOverCellNode&&(this.lastOverCellNode=q.cellNode,this.grid.onMouseOver(q));this.grid.onMouseOverRow(q)},domouseout:function(q){if(q.cellNode&&
q.cellNode==this.lastOverCellNode&&!this.isIntraNodeEvent(q,this.lastOverCellNode)&&(this.lastOverCellNode=null,this.grid.onMouseOut(q),!this.isIntraRowEvent(q)))this.grid.onMouseOutRow(q)},domousedown:function(q){if(q.cellNode)this.grid.onMouseDown(q);this.grid.onMouseDownRow(q)},_getTextDirStyle:function(q,w,x){return""}});O=b._ContentBuilder=F.extend(function(q){u.call(this,q)},u.prototype,{update:function(){this.prepareHtml()},prepareHtml:function(){for(var q=this.grid.get,w=this.view.structure.cells,
x=0,I;I=w[x];x++)for(var A=0,M;M=I[A];A++)M.get=M.get||void 0==M.value&&q,M.markup=this.generateCellMarkup(M,M.cellStyles,M.cellClasses,!1),!this.grid.editable&&M.editable&&(this.grid.editable=!0)},generateHtml:function(q,w){q=this.getTableArray();var x=this.view.structure.cells,I=this.grid.getItem(w);p.fire(this.view,"onBeforeRow",[w,x]);for(var A=0,M;M=x[A];A++)if(!M.hidden&&!M.header){q.push(M.invisible?'\x3ctr class\x3d"dojoxGridInvisible"\x3e':"\x3ctr\x3e");for(var H=0,U,S,D;U=M[H];H++){S=U.markup;
var L=U.customClasses=[];D=U.customStyles=[];S[5]=U.format(w,I);S[1]=L.join(" ");S[3]=D.join(";");(L=U.textDir||this.grid.textDir)&&(S[3]+=this._getTextDirStyle(L,U,w));q.push.apply(q,S)}q.push("\x3c/tr\x3e")}q.push("\x3c/table\x3e");return q.join("")},decorateEvent:function(q){q.rowNode=this.findRowTarget(q.target);if(!q.rowNode)return!1;q.rowIndex=q.rowNode[k];this.baseDecorateEvent(q);q.cell=this.grid.getCell(q.cellIndex);return!0}});var C=b._HeaderBuilder=F.extend(function(q){this.moveable=null;
u.call(this,q)},u.prototype,{_skipBogusClicks:!1,overResizeWidth:4,minColWidth:1,update:function(){this.tableMap?this.tableMap.mapRows(this.view.structure.cells):this.tableMap=new b._TableMap(this.view.structure.cells)},generateHtml:function(q,w){var x,I=this.getTableArray(),A=this.view.structure.cells;p.fire(this.view,"onBeforeRow",[-1,A]);for(var M=0,H;H=A[M];M++)if(!H.hidden){I.push(H.invisible?'\x3ctr class\x3d"dojoxGridInvisible"\x3e':"\x3ctr\x3e");for(var U=0,S,D;S=H[U];U++)S.customClasses=
[],S.customStyles=[],this.view.simpleStructure&&(S.draggable&&(S.headerClasses?-1==S.headerClasses.indexOf("dojoDndItem")&&(S.headerClasses+=" dojoDndItem"):S.headerClasses="dojoDndItem"),S.attrs?-1==S.attrs.indexOf("dndType\x3d'gridColumn_")&&(S.attrs+=" dndType\x3d'gridColumn_"+this.grid.id+"'"):S.attrs="dndType\x3d'gridColumn_"+this.grid.id+"'"),D=this.generateCellMarkup(S,S.headerStyles,S.headerClasses,!0),D[5]=void 0!=w?w:q(S),D[3]=S.customStyles.join(";"),(x=S.textDir||this.grid.textDir)&&(D[3]+=
this._getTextDirStyle(x,S,w)),D[1]=S.customClasses.join(" "),I.push(D.join(""));I.push("\x3c/tr\x3e")}I.push("\x3c/table\x3e");return I.join("")},getCellX:function(q){var w=l("th");for(var x=q.target;x&&w(x);x=x.parentNode);(w=x)?(w=e.position(w),q=q.clientX-w.x):q=q.layerX;return q},decorateEvent:function(q){this.baseDecorateEvent(q);q.rowIndex=-1;q.cellX=this.getCellX(q);return!0},prepareResize:function(q,w){do{var x=q.cellIndex;q.cellNode=x?q.cellNode.parentNode.cells[x+w]:null;q.cellIndex=q.cellNode?
this.getCellNodeIndex(q.cellNode):-1}while(q.cellNode&&"none"==q.cellNode.style.display);return!!q.cellNode},canResize:function(q){if(!q.cellNode||1<q.cellNode.colSpan)return!1;q=this.grid.getCell(q.cellIndex);return!q.noresize&&q.canResize()},overLeftResizeArea:function(q){if(g.hasClass(E.body(),"dojoDndMove"))return!1;if(h("ie")){var w=q.target;if(g.hasClass(w,"dojoxGridArrowButtonNode")||g.hasClass(w,"dojoxGridArrowButtonChar")||g.hasClass(w,"dojoxGridColCaption"))return!1}return this.grid.isLeftToRight()?
0<q.cellIndex&&0<q.cellX&&q.cellX<this.overResizeWidth&&this.prepareResize(q,-1):q.cellNode&&0<q.cellX&&q.cellX<this.overResizeWidth},overRightResizeArea:function(q){if(g.hasClass(E.body(),"dojoDndMove"))return!1;if(h("ie")){var w=q.target;if(g.hasClass(w,"dojoxGridArrowButtonNode")||g.hasClass(w,"dojoxGridArrowButtonChar")||g.hasClass(w,"dojoxGridColCaption"))return!1}return this.grid.isLeftToRight()?q.cellNode&&q.cellX>=q.cellNode.offsetWidth-this.overResizeWidth:0<q.cellIndex&&q.cellX>=q.cellNode.offsetWidth-
this.overResizeWidth&&this.prepareResize(q,-1)},domousemove:function(q){if(!this.moveable){var w=this.overRightResizeArea(q)?"dojoxGridColResize":this.overLeftResizeArea(q)?"dojoxGridColResize":"";w&&!this.canResize(q)&&(w="dojoxGridColNoResize");g.toggleClass(q.sourceView.headerNode,"dojoxGridColNoResize","dojoxGridColNoResize"==w);g.toggleClass(q.sourceView.headerNode,"dojoxGridColResize","dojoxGridColResize"==w);w&&f.stop(q)}},domousedown:function(q){this.moveable||((this.overRightResizeArea(q)||
this.overLeftResizeArea(q))&&this.canResize(q)?this.beginColumnResize(q):(this.grid.onMouseDown(q),this.grid.onMouseOverRow(q)))},doclick:function(q){return this._skipBogusClicks?(f.stop(q),!0):!1},colResizeSetup:function(q,w){var x=g.contentBox(q.sourceView.headerNode);if(w){this.lineDiv=document.createElement("div");w=g.position(q.sourceView.headerNode,!0);var I=g.contentBox(q.sourceView.domNode),A=q.pageX;!this.grid.isLeftToRight()&&8>h("ie")&&(A-=v.getScrollbar().w);g.style(this.lineDiv,{top:w.y+
"px",left:A+"px",height:I.h+x.h+"px"});g.addClass(this.lineDiv,"dojoxGridResizeColLine");this.lineDiv._origLeft=A;E.body().appendChild(this.lineDiv)}w=[];I=this.tableMap.findOverlappingNodes(q.cellNode);A=0;for(var M;M=I[A];A++)w.push({node:M,index:this.getCellNodeIndex(M),width:M.offsetWidth});I=q.sourceView;M=this.grid.isLeftToRight()?1:-1;var H=q.grid.views.views;A=[];for(var U=I.idx+M,S;S=H[U];U+=M)A.push({node:S.headerNode,left:window.parseInt(S.headerNode.style.left)});M=I.headerContentNode.firstChild;
return{scrollLeft:q.sourceView.headerNode.scrollLeft,view:I,node:q.cellNode,index:q.cellIndex,w:g.contentBox(q.cellNode).w,vw:x.w,table:M,tw:g.contentBox(M).w,spanners:w,followers:A}},beginColumnResize:function(q){this.moverDiv=document.createElement("div");g.style(this.moverDiv,{position:"absolute",left:0});E.body().appendChild(this.moverDiv);g.addClass(this.grid.domNode,"dojoxGridColumnResizing");var w=this.moveable=new c(this.moverDiv),x=this.colResizeSetup(q,!0);w.onMove=F.hitch(this,"doResizeColumn",
x);r.connect(w,"onMoveStop",F.hitch(this,function(){this.endResizeColumn(x);x.node.releaseCapture&&x.node.releaseCapture();this.moveable.destroy();delete this.moveable;this.moveable=null;g.removeClass(this.grid.domNode,"dojoxGridColumnResizing")}));q.cellNode.setCapture&&q.cellNode.setCapture();w.onMouseDown(q)},doResizeColumn:function(q,w,x){var I=x.l;I={deltaX:I,w:q.w+(this.grid.isLeftToRight()?I:-I),vw:q.vw+I,tw:q.tw+I};this.dragRecord={inDrag:q,mover:w,leftTop:x};I.w>=this.minColWidth&&(w?g.style(this.lineDiv,
"left",this.lineDiv._origLeft+I.deltaX+"px"):this.doResizeNow(q,I))},endResizeColumn:function(q){if(this.dragRecord){var w=this.dragRecord.leftTop;w=this.grid.isLeftToRight()?w.l:-w.l;w+=Math.max(q.w+w,this.minColWidth)-(q.w+w);h("webkit")&&q.spanners.length&&(w+=g._getPadBorderExtents(q.spanners[0].node).w);this.doResizeNow(q,{deltaX:w,w:q.w+w,vw:q.vw+w,tw:q.tw+w});delete this.dragRecord}g.destroy(this.lineDiv);g.destroy(this.moverDiv);g.destroy(this.moverDiv);delete this.moverDiv;this._skipBogusClicks=
!0;q.view.update();this._skipBogusClicks=!1;this.grid.onResizeColumn(q.index)},doResizeNow:function(q,w){q.view.convertColPctToFixed();if(q.view.flexCells&&!q.view.testFlexCells()){var x=n(q.node);x&&(x.style.width="")}var I;for(x=0;I=q.spanners[x];x++){var A=I.width+w.deltaX;0<A&&(I.node.style.width=A+"px",q.view.setColWidth(I.index,A))}if(this.grid.isLeftToRight()||!h("ie"))for(x=0;I=q.followers[x];x++)A=I.left+w.deltaX,I.node.style.left=A+"px";q.node.style.width=w.w+"px";q.view.setColWidth(q.index,
w.w);q.view.headerNode.style.width=w.vw+"px";q.view.setColumnsWidth(w.tw);this.grid.isLeftToRight()||(q.view.headerNode.scrollLeft=q.scrollLeft+w.deltaX)}});b._TableMap=F.extend(function(q){this.mapRows(q)},{map:null,mapRows:function(q){if(q.length){this.map=[];for(var w,x=0;w=q[x];x++)this.map[x]=[];for(x=0;w=q[x];x++)for(var I=0,A=0,M,H;M=w[I];I++){for(;this.map[x][A];)A++;this.map[x][A]={c:I,r:x};H=M.rowSpan||1;M=M.colSpan||1;for(var U=0;U<H;U++)for(var S=0;S<M;S++)this.map[x+U][A+S]=this.map[x][A];
A+=M}}},dumpMap:function(){for(var q=0,w;w=this.map[q];q++)for(var x=0;w[x];x++);},getMapCoords:function(q,w){for(var x=0,I;I=this.map[x];x++)for(var A=0,M;M=I[A];A++)if(M.c==w&&M.r==q)return{j:x,i:A};return{j:-1,i:-1}},getNode:function(q,w,x){return(q=q&&q.rows[w])&&q.cells[x]},_findOverlappingNodes:function(q,w,x){var I=[];w=this.getMapCoords(w,x);x=0;for(var A;A=this.map[x];x++)x!=w.j&&(A=(A=A[w.i])?this.getNode(q,A.r,A.c):null)&&I.push(A);return I},findOverlappingNodes:function(q){return this._findOverlappingNodes(n(q),
a(q.parentNode),0<=q.cellIndex?q.cellIndex:B.indexOf(q.parentNode.cells,q))}});return{_Builder:u,_HeaderBuilder:C,_ContentBuilder:O}})},"dojox/grid/_ViewManager":function(){define(["dojo/_base/declare","dojo/_base/sniff","dojo/dom-class"],function(O,B,F){return O("dojox.grid._ViewManager",null,{constructor:function(E){this.grid=E},defaultWidth:200,views:[],resize:function(){this.onEach("resize")},render:function(){this.onEach("render")},addView:function(E){E.idx=this.views.length;this.views.push(E)},
destroyViews:function(){for(var E=0,f;f=this.views[E];E++)f.destroy();this.views=[]},getContentNodes:function(){for(var E=[],f=0,h;h=this.views[f];f++)E.push(h.contentNode);return E},forEach:function(E){for(var f=0,h;h=this.views[f];f++)E(h,f)},onEach:function(E,f){f=f||[];for(var h=0,r;r=this.views[h];h++)E in r&&r[E].apply(r,f)},normalizeHeaderNodeHeight:function(){for(var E=[],f=0,h;h=this.views[f];f++)h.headerContentNode.firstChild&&E.push(h.headerContentNode);this.normalizeRowNodeHeights(E)},
normalizeRowNodeHeights:function(E){var f=0,h=[];if(this.grid.rowHeight)f=this.grid.rowHeight;else{if(1>=E.length)return;for(var r=0,c;c=E[r];r++)F.contains(c,"dojoxGridNonNormalizedCell")||(h[r]=c.firstChild.offsetHeight,f=Math.max(f,h[r]));f=0<=f?f:0;(B("mozilla")||8<B("ie"))&&f&&f++}for(r=0;c=E[r];r++)h[r]!=f&&(c.firstChild.style.height=f+"px")},resetHeaderNodeHeight:function(){for(var E=0,f;f=this.views[E];E++)if(f=f.headerContentNode.firstChild)f.style.height=""},renormalizeRow:function(E){for(var f=
[],h=0,r,c;(r=this.views[h])&&(c=r.getRowNode(E));h++)c.firstChild.style.height="",f.push(c);this.normalizeRowNodeHeights(f)},getViewWidth:function(E){return this.views[E].getWidth()||this.defaultWidth},measureHeader:function(){this.resetHeaderNodeHeight();this.forEach(function(f){f.headerContentNode.style.height=""});var E=0;this.forEach(function(f){E=Math.max(f.headerNode.offsetHeight,E)});return E},measureContent:function(){var E=0;this.forEach(function(f){E=Math.max(f.domNode.offsetHeight,E)});
return E},findClient:function(E){E=this.grid.elasticView||-1;if(0>E)for(var f=1,h;h=this.views[f];f++)if(h.viewWidth){for(f=1;h=this.views[f];f++)if(!h.viewWidth){E=f;break}break}0>E&&(E=Math.floor(this.views.length/2));return E},arrange:function(E,f){var h,r,c=this.views.length,v=this,p=0>=f?c:this.findClient(),g=function(a,m){var n=a.domNode.style,l=a.headerNode.style;v.grid.isLeftToRight()?(n.left=m+"px",l.left=m+"px"):(n.right=m+"px",4>B("ff")?l.right=m+a.getScrollbarWidth()+"px":l.right=m+"px",
B("webkit")||"auto"==l.width||(l.width=parseInt(l.width,10)-a.getScrollbarWidth()+"px"));n.top="0px";l.top=0};for(h=0;(r=this.views[h])&&h<p;h++){var e=this.getViewWidth(h);r.setSize(e,0);g(r,E);e=r.headerContentNode&&r.headerContentNode.firstChild?r.getColumnsWidth()+r.getScrollbarWidth():r.domNode.offsetWidth;E+=e}h++;for(var b=c-1;(r=this.views[b])&&h<=b;b--)e=this.getViewWidth(b),r.setSize(e,0),e=r.domNode.offsetWidth,f-=e,g(r,f);p<c&&(r=this.views[p],e=Math.max(1,f-E),r.setSize(e+"px",0),g(r,
E));return E},renderRow:function(E,f,h){for(var r=[],c=0,v,p;(v=this.views[c])&&(p=f[c]);c++)v=v.renderRow(E),p.appendChild(v),r.push(v);h||this.normalizeRowNodeHeights(r)},rowRemoved:function(E){this.onEach("rowRemoved",[E])},updateRow:function(E,f){for(var h=0,r;r=this.views[h];h++)r.updateRow(E);f||this.renormalizeRow(E)},updateRowStyles:function(E){this.onEach("updateRowStyles",[E])},setScrollTop:function(E){for(var f=E,h=0,r;r=this.views[h];h++)f=r.setScrollTop(E),B("ie")&&r.headerNode&&r.scrollboxNode&&
(r.headerNode.scrollLeft=r.scrollboxNode.scrollLeft);return f},getFirstScrollingView:function(){for(var E=0,f;f=this.views[E];E++)if(f.hasHScrollbar()||f.hasVScrollbar())return f;return null}})})},"dojox/grid/_RowManager":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/dom-class"],function(O,B,F){return O("dojox.grid._RowManager",null,{constructor:function(E){this.grid=E},linesToEms:2,overRow:-2,prepareStylingRow:function(E,f){return{index:E,node:f,odd:!!(E&1),selected:!!this.grid.selection.isSelected(E),
over:this.isOver(E),customStyles:"",customClasses:"dojoxGridRow"}},styleRowNode:function(E,f){E=this.prepareStylingRow(E,f);this.grid.onStyleRow(E);this.applyStyles(E)},applyStyles:function(E){E.node.className=E.customClasses;var f=E.node.style.height,h=E.node,r=E.customStyles+";"+(E.node._style||"");void 0==h.style.cssText?h.setAttribute("style",r):h.style.cssText=r;E.node.style.height=f},updateStyles:function(E){this.grid.updateRowStyles(E)},setOverRow:function(E){var f=this.overRow;this.overRow=
E;f!=this.overRow&&(B.isString(f)||0<=f)&&this.updateStyles(f);this.updateStyles(this.overRow)},isOver:function(E){return this.overRow==E&&!F.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(O,B,F,E,f,h,r,c,v){return F("dojox.grid._FocusManager",null,{constructor:function(p){this.grid=
p;this.cell=null;this.rowIndex=-1;this._connects=[];this._headerConnects=[];this.headerMenu=this.grid.headerMenu;this._connects.push(E.connect(this.grid.domNode,"onfocus",this,"doFocus"));this._connects.push(E.connect(this.grid.domNode,"onblur",this,"doBlur"));this._connects.push(E.connect(this.grid.domNode,"mousedown",this,"_mouseDown"));this._connects.push(E.connect(this.grid.domNode,"mouseup",this,"_mouseUp"));this._connects.push(E.connect(this.grid.domNode,"oncontextmenu",this,"doContextMenu"));
this._connects.push(E.connect(this.grid.lastFocusNode,"onfocus",this,"doLastNodeFocus"));this._connects.push(E.connect(this.grid.lastFocusNode,"onblur",this,"doLastNodeBlur"));this._connects.push(E.connect(this.grid,"_onFetchComplete",this,"_delayedCellFocus"));this._connects.push(E.connect(this.grid,"postrender",this,"_delayedHeaderFocus"))},destroy:function(){O.forEach(this._connects,E.disconnect);O.forEach(this._headerConnects,E.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(p,g){return this.cell==p&&this.rowIndex==g},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?O.indexOf(this._findHeaderCells(),this._colHeadNode):-1},_focusifyCellNode:function(p){var g=this.cell&&this.cell.getNode(this.rowIndex);if(g&&(v.toggleClass(g,this.focusClass,p),p)){p=this.scrollIntoView();try{if(h("webkit")||!this.grid.edit.isEditing())c.fire(g,"focus"),p&&(this.cell.view.scrollboxNode.scrollLeft=
p)}catch(e){}}},_delayedCellFocus:function(){if(!this.isNavHeader()&&this.grid.focused){var p=this.cell&&this.cell.getNode(this.rowIndex);if(p)try{this.grid.edit.isEditing()||(v.toggleClass(p,this.focusClass,!0),this._colHeadNode&&this.blurHeader(),c.fire(p,"focus"))}catch(g){}}},_delayedHeaderFocus:function(){this.isNavHeader()&&this.focusHeader()},_initColumnHeaders:function(){O.forEach(this._headerConnects,E.disconnect);this._headerConnects=[];for(var p=this._findHeaderCells(),g=0;g<p.length;g++)this._headerConnects.push(E.connect(p[g],
"onfocus",this,"doColHeaderFocus")),this._headerConnects.push(E.connect(p[g],"onblur",this,"doColHeaderBlur"))},_findHeaderCells:function(){for(var p=r("th",this.grid.viewsHeaderNode),g=[],e=0;e<p.length;e++){var b=p[e],a=v.hasAttr(b,"tabIndex"),m=v.attr(b,"tabIndex");a&&0>m&&g.push(b)}return g},_setActiveColHeader:function(p,g,e){this.grid.domNode.setAttribute("aria-activedescendant",p.id);null!=e&&0<=e&&e!=g&&v.toggleClass(this._findHeaderCells()[e],this.focusClass,!1);v.toggleClass(p,this.focusClass,
!0);this._colHeadNode=p;this._colHeadFocusIdx=g;this._scrollHeader(this._colHeadFocusIdx)},scrollIntoView:function(){var p=this.cell?this._scrollInfo(this.cell):null;if(!p||!p.s)return null;var g=this.grid.scroller.findScrollTop(this.rowIndex);p.n&&p.sr&&(p.n.offsetLeft+p.n.offsetWidth>p.sr.l+p.sr.w?p.s.scrollLeft=p.n.offsetLeft+p.n.offsetWidth-p.sr.w:p.n.offsetLeft<p.sr.l&&(p.s.scrollLeft=p.n.offsetLeft));p.r&&p.sr&&(g+p.r.offsetHeight>p.sr.t+p.sr.h?this.grid.setScrollTop(g+p.r.offsetHeight-p.sr.h):
g<p.sr.t&&this.grid.setScrollTop(g));return p.s.scrollLeft},_scrollInfo:function(p,g){if(p){var e=p.view.scrollboxNode,b={w:e.clientWidth,l:e.scrollLeft,t:e.scrollTop,h:e.clientHeight},a=p.view.getRowNode(this.rowIndex);return{c:p,s:e,sr:b,n:g?g:p.getNode(this.rowIndex),r:a}}return null},_scrollHeader:function(p){var g=null;if(this._colHeadNode){var e=this.grid.getCell(p);if(!e)return;g=this._scrollInfo(e,e.getNode(0))}g&&g.s&&g.sr&&g.n&&(g.n.offsetLeft+g.n.offsetWidth>g.sr.l+g.sr.w?g.s.scrollLeft=
g.n.offsetLeft+g.n.offsetWidth-g.sr.w:g.n.offsetLeft<g.sr.l?g.s.scrollLeft=g.n.offsetLeft:7>=h("ie")&&e&&e.view.headerNode&&(e.view.headerNode.scrollLeft=g.s.scrollLeft))},_isHeaderHidden:function(){var p=this.focusView;if(!p)for(var g=0,e;e=this.grid.views.views[g];g++)if(e.headerNode){p=e;break}return p&&"none"==v.getComputedStyle(p.headerNode).display},colSizeAdjust:function(p,g,e){var b=this._findHeaderCells(),a=this.focusView;if(!a||!a.header.tableMap.map)for(var m=0,n;n=this.grid.views.views[m];m++)if(n.header.tableMap.map){a=
n;break}m=b[g];!a||g==b.length-1&&0===g||(a.content.baseDecorateEvent(p),p.cellNode=m,p.cellIndex=a.content.getCellNodeIndex(p.cellNode),p.cell=0<=p.cellIndex?this.grid.getCell(p.cellIndex):null,a.header.canResize(p)&&(g={l:e},p=a.header.colResizeSetup(p,!1),a.header.doResizeColumn(p,null,g),a.update()))},styleRow:function(p){},setFocusIndex:function(p,g){this.setFocusCell(this.grid.getCell(g),p)},setFocusCell:function(p,g){p&&!this.isFocusCell(p,g)&&(this.tabbingOut=!1,this._colHeadNode&&this.blurHeader(),
this._colHeadNode=this._colHeadFocusIdx=null,this.focusGridView(),this._focusifyCellNode(!1),this.cell=p,this.rowIndex=g,this._focusifyCellNode(!0));if(h("opera"))setTimeout(B.hitch(this.grid,"onCellFocus",this.cell,this.rowIndex),1);else this.grid.onCellFocus(this.cell,this.rowIndex)},next:function(){if(this.cell){var p=this.rowIndex,g=this.cell.index+1,e=this.grid.layout.cellCount-1,b=this.grid.rowCount-1;g>e&&(g=0,p++);p>b&&(g=e,p=b);if(this.grid.edit.isEditing()&&(e=this.grid.getCell(g),!this.isLastFocusCell()&&
(!e.editable||this.grid.canEdit&&!this.grid.canEdit(e,p)))){this.cell=e;this.rowIndex=p;this.next();return}this.setFocusIndex(p,g)}},previous:function(){if(this.cell){var p=this.rowIndex||0,g=(this.cell.index||0)-1;0>g&&(g=this.grid.layout.cellCount-1,p--);0>p&&(g=p=0);if(this.grid.edit.isEditing()){var e=this.grid.getCell(g);if(!this.isFirstFocusCell()&&!e.editable){this.cell=e;this.rowIndex=p;this.previous();return}}this.setFocusIndex(p,g)}},move:function(p,g){var e=0>g?-1:1;if(this.isNavHeader()){p=
this._findHeaderCells();var b=currentIdx=O.indexOf(p,this._colHeadNode);for(currentIdx+=g;0<=currentIdx&&currentIdx<p.length&&"none"==p[currentIdx].style.display;)currentIdx+=e;0<=currentIdx&&currentIdx<p.length&&this._setActiveColHeader(p[currentIdx],currentIdx,b)}else if(this.cell){var a=this.grid.scroller;b=this.rowIndex;var m=this.grid.rowCount-1,n=Math.min(m,Math.max(0,b+p));p&&(0<p?n>a.getLastPageRow(a.page)&&this.grid.setScrollTop(this.grid.scrollTop+a.findScrollTop(n)-a.findScrollTop(b)):
0>p&&n<=a.getPageRow(a.page)&&this.grid.setScrollTop(this.grid.scrollTop-a.findScrollTop(b)-a.findScrollTop(n)));a=this.grid.layout.cellCount-1;for(var l=this.cell.index,k=Math.min(a,Math.max(0,l+g)),y=this.grid.getCell(k);0<=k&&k<a&&y&&!0===y.hidden;)k+=e,y=this.grid.getCell(k);y&&!0!==y.hidden||(k=l);e=y.getNode(n);!e&&p?0<=n+p&&n+p<=m&&this.move(0<p?++p:--p,g):e&&"none"!==v.style(e,"display")||!g?(this.setFocusIndex(n,k),p&&this.grid.updateRow(b)):0<=k+g&&k+g<=a&&this.move(p,0<g?++g:--g)}},previousKey:function(p){this.grid.edit.isEditing()?
(f.stop(p),this.previous()):this.isNavHeader()||this._isHeaderHidden()?(this.tabOut(this.grid.domNode),null!=this._colHeadFocusIdx&&(v.toggleClass(this._findHeaderCells()[this._colHeadFocusIdx],this.focusClass,!1),this._colHeadFocusIdx=null),this._focusifyCellNode(!1)):(this.grid.domNode.focus(),f.stop(p))},nextKey:function(p){p.target===this.grid.domNode&&null==this._colHeadFocusIdx?(this.focusHeader(),f.stop(p)):this.isNavHeader()?(this.blurHeader(),this.findAndFocusGridCell()||this.tabOut(this.grid.lastFocusNode),
this._colHeadNode=this._colHeadFocusIdx=null):this.grid.edit.isEditing()?(f.stop(p),this.next()):this.tabOut(this.grid.lastFocusNode)},tabOut:function(p){this.tabbingOut=!0;p.focus()},focusGridView:function(){c.fire(this.focusView,"focus")},focusGrid:function(p){this.focusGridView();this._focusifyCellNode(!0)},findAndFocusGridCell:function(){var p=!0,g=0===this.grid.rowCount;this.isNoFocusCell()&&!g?(g=0,this.grid.getCell(g).hidden&&(g=this.isNavHeader()?this._colHeadFocusIdx:0),this.setFocusIndex(0,
g)):this.cell&&!g?(this.focusView&&!this.focusView.rowNodes[this.rowIndex]&&this.grid.scrollToRow(this.rowIndex),this.focusGrid()):p=!1;this._colHeadNode=this._colHeadFocusIdx=null;return p},focusHeader:function(){var p=this._findHeaderCells(),g=this._colHeadFocusIdx;this._isHeaderHidden()?this.findAndFocusGridCell():this._colHeadFocusIdx||(this.isNoFocusCell()?this._colHeadFocusIdx=0:this._colHeadFocusIdx=this.cell.index);for(this._colHeadNode=p[this._colHeadFocusIdx];this._colHeadNode&&0<=this._colHeadFocusIdx&&
this._colHeadFocusIdx<p.length&&"none"==this._colHeadNode.style.display;)this._colHeadFocusIdx++,this._colHeadNode=p[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,g),this._scrollHeader(this._colHeadFocusIdx),
this._focusifyCellNode(!1)):this.findAndFocusGridCell()},blurHeader:function(){v.removeClass(this._colHeadNode,this.focusClass);v.removeAttr(this.grid.domNode,"aria-activedescendant");if(this.headerMenu&&this._contextMenuBindNode==this.grid.domNode){var p=this.grid.viewsHeaderNode;this.headerMenu.unBindDomNode(this.grid.domNode);this.headerMenu.bindDomNode(p);this._contextMenuBindNode=p}},doFocus:function(p){p&&p.target!=p.currentTarget?f.stop(p):this._clickFocus||(this.tabbingOut||this.focusHeader(),
this.tabbingOut=!1,f.stop(p))},doBlur:function(p){f.stop(p)},doContextMenu:function(p){this.headerMenu||f.stop(p)},doLastNodeFocus:function(p){this.tabbingOut?this._focusifyCellNode(!1):0<this.grid.rowCount?(this.isNoFocusCell()&&this.setFocusIndex(0,0),this._focusifyCellNode(!0)):this.focusHeader();this.tabbingOut=!1;f.stop(p)},doLastNodeBlur:function(p){f.stop(p)},doColHeaderFocus:function(p){this._setActiveColHeader(p.target,v.attr(p.target,"idx"),this._colHeadFocusIdx);this._scrollHeader(this.getHeaderIndex());
f.stop(p)},doColHeaderBlur:function(p){v.toggleClass(p.target,this.focusClass,!1)},_mouseDown:function(p){this._clickFocus=dojo.some(this.grid.views.views,function(g){return g.scrollboxNode===p.target})},_mouseUp:function(p){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(O,B,F,E,f,h){return F("dojox.grid._EditManager",null,{constructor:function(r){this.grid=r;
this.connections=f("ie")?[E.connect(document.body,"onfocus",O.hitch(this,"_boomerangFocus"))]:[];this.connections.push(E.connect(this.grid,"onBlur",this,"apply"));this.connections.push(E.connect(this.grid,"prerender",this,"_onPreRender"))},info:{},destroy:function(){B.forEach(this.connections,E.disconnect)},cellFocus:function(r,c){this.grid.singleClickEdit||this.isEditRow(c)?this.setEditCell(r,c):this.apply();(this.isEditing()||r&&r.editable&&r.alwaysEditing)&&this._focusEditor(r,c)},rowClick:function(r){this.isEditing()&&
!this.isEditRow(r.rowIndex)&&this.apply()},styleRow:function(r){r.index==this.info.rowIndex&&(r.customClasses+=" dojoxGridRowEditing")},dispatchEvent:function(r){var c=r.cell;return(c=c&&c.editable?c:0)&&c.dispatchEvent(r.dispatch,r)},isEditing:function(){return void 0!==this.info.rowIndex},isEditCell:function(r,c){return this.info.rowIndex===r&&this.info.cell.index==c},isEditRow:function(r){return this.info.rowIndex===r},setEditCell:function(r,c){!this.isEditCell(c,r.index)&&this.grid.canEdit&&this.grid.canEdit(r,
c)&&this.start(r,c,this.isEditRow(c)||r.editable)},_focusEditor:function(r,c){h.fire(r,"focus",[c])},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(){f("ie")&&(this._catchBoomerang=(new Date).getTime()+
this._boomerangWindow)},start:function(r,c,v){this._isValidInput()&&(this.grid.beginUpdate(),this.editorApply(),this.isEditing()&&!this.isEditRow(c)&&(this.applyRowEdit(),this.grid.updateRow(c)),v?(this.info={cell:r,rowIndex:c},this.grid.doStartEdit(r,c),this.grid.updateRow(c)):this.info={},this.grid.endUpdate(),this.grid.focus.focusGrid(),this._focusEditor(r,c),this._doCatchBoomerang())},_editorDo:function(r){var c=this.info.cell;if(c&&c.editable)c[r](this.info.rowIndex)},editorApply:function(){this._editorDo("apply")},
editorCancel:function(){this._editorDo("cancel")},applyCellEdit:function(r,c,v){this.grid.canEdit(c,v)&&this.grid.doApplyCellEdit(r,v,c.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(r,c){var v=this.info.cell;!this.isEditRow(r)||c&&v.view!=c||!v.editable||v.save(v,this.info.rowIndex)},restore:function(r,c){var v=this.info.cell;this.isEditRow(c)&&v.view==r&&v.editable&&v.restore(this.info.rowIndex)},_isValidInput:function(){var r=(this.info.cell||{}).widget;if(!r||!r.isValid)return!0;r.focused=!0;return r.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(O,B,F,E){return O("dojox.grid.Selection",null,{constructor:function(f){this.grid=f;this.selected=[];this.setMode(f.selectionMode)},mode:"extended",selected:null,updating:0,selectedIndex:-1,rangeStartIndex:-1,setMode:function(f){this.selected.length&&this.deselectAll();this.mode="extended"!=f&&"multiple"!=f&&"single"!=f&&"none"!=
f?"extended":f},onCanSelect:function(f){return this.grid.onCanSelect(f)},onCanDeselect:function(f){return this.grid.onCanDeselect(f)},onSelected:function(f){},onDeselected:function(f){},onChanging:function(){},onChanged:function(){},isSelected:function(f){return"none"==this.mode?!1:this.selected[f]},getFirstSelected:function(){if(!this.selected.length||"none"==this.mode)return-1;for(var f=0,h=this.selected.length;f<h;f++)if(this.selected[f])return f;return-1},getNextSelected:function(f){if("none"==
this.mode)return-1;f+=1;for(var h=this.selected.length;f<h;f++)if(this.selected[f])return f;return-1},getSelected:function(){for(var f=[],h=0,r=this.selected.length;h<r;h++)this.selected[h]&&f.push(h);return f},getSelectedCount:function(){for(var f=0,h=0;h<this.selected.length;h++)this.selected[h]&&f++;return f},_beginUpdate:function(){if(0===this.updating)this.onChanging();this.updating++},_endUpdate:function(){this.updating--;if(0===this.updating)this.onChanged()},select:function(f){"none"!=this.mode&&
("multiple"!=this.mode?(this.deselectAll(f),this.addToSelection(f)):this.toggleSelect(f))},addToSelection:function(f){if("none"!=this.mode)if(F.isArray(f))B.forEach(f,this.addToSelection,this);else if(f=Number(f),this.selected[f])this.selectedIndex=f;else if(!1!==this.onCanSelect(f)){this.selectedIndex=f;var h=this.grid.getRowNode(f);h&&E.set(h,"aria-selected","true");this._beginUpdate();this.selected[f]=!0;this.onSelected(f);this._endUpdate()}},deselect:function(f){if("none"!=this.mode)if(F.isArray(f))B.forEach(f,
this.deselect,this);else if(f=Number(f),this.selectedIndex==f&&(this.selectedIndex=-1),this.selected[f]&&!1!==this.onCanDeselect(f)){var h=this.grid.getRowNode(f);h&&E.set(h,"aria-selected","false");this._beginUpdate();delete this.selected[f];this.onDeselected(f);this._endUpdate()}},setSelected:function(f,h){this[h?"addToSelection":"deselect"](f)},toggleSelect:function(f){F.isArray(f)?B.forEach(f,this.toggleSelect,this):this.setSelected(f,!this.selected[f])},_range:function(f,h,r){var c=0<=f?f:h;
f=h;c>f&&(f=c,c=h);for(h=c;h<=f;h++)r(h)},selectRange:function(f,h){this._range(f,h,F.hitch(this,"addToSelection"))},deselectRange:function(f,h){this._range(f,h,F.hitch(this,"deselect"))},insert:function(f){this.selected.splice(f,0,!1);this.selectedIndex>=f&&this.selectedIndex++},remove:function(f){this.selected.splice(f,1);this.selectedIndex>=f&&this.selectedIndex--},deselectAll:function(f){for(var h in this.selected)h!=f&&!0===this.selected[h]&&this.deselect(h)},clickSelect:function(f,h,r){if("none"!=
this.mode){this._beginUpdate();if("extended"!=this.mode)this.select(f);else{if(!r||0>this.rangeStartIndex)this.rangeStartIndex=f;h||this.deselectAll(f);r?this.selectRange(this.rangeStartIndex,f):h?this.toggleSelect(f):this.addToSelection(f)}this._endUpdate()}},clickSelectEvent:function(f){this.clickSelect(f.rowIndex,dojo.isCopyKey(f),f.shiftKey)},clear:function(){this._beginUpdate();this.deselectAll();this._endUpdate()}})})},"dojox/grid/DataSelection":function(){define(["dojo/_base/declare","./_SelectionPreserver",
"./Selection"],function(O,B,F){return O("dojox.grid.DataSelection",F,{constructor:function(E){E.keepSelection&&(this.preserver=new B(this))},destroy:function(){this.preserver&&this.preserver.destroy()},getFirstSelected:function(){var E=F.prototype.getFirstSelected.call(this);return-1==E?null:this.grid.getItem(E)},getNextSelected:function(E){E=this.grid.getItemIndex(E);E=F.prototype.getNextSelected.call(this,E);return-1==E?null:this.grid.getItem(E)},getSelected:function(){for(var E=[],f=0,h=this.selected.length;f<
h;f++)this.selected[f]&&E.push(this.grid.getItem(f));return E},addToSelection:function(E){if("none"!=this.mode){var f=null;f="number"==typeof E||"string"==typeof E?E:this.grid.getItemIndex(E);F.prototype.addToSelection.call(this,f)}},deselect:function(E){if("none"!=this.mode){var f=null;f="number"==typeof E||"string"==typeof E?E:this.grid.getItemIndex(E);F.prototype.deselect.call(this,f)}},deselectAll:function(E){var f=null;E||"number"==typeof E?(f="number"==typeof E||"string"==typeof E?E:this.grid.getItemIndex(E),
F.prototype.deselectAll.call(this,f)):this.inherited(arguments)}})})},"dojox/grid/_SelectionPreserver":function(){define(["dojo/_base/declare","dojo/_base/connect","dojo/_base/lang","dojo/_base/array"],function(O,B,F,E){return O("dojox.grid._SelectionPreserver",null,{constructor:function(f){this.selection=f;var h=this.grid=f.grid;this.reset();this._connects=[B.connect(h,"_setStore",this,"reset"),B.connect(h,"_addItem",this,"_reSelectById"),B.connect(f,"onSelected",F.hitch(this,"_selectById",!0)),
B.connect(f,"onDeselected",F.hitch(this,"_selectById",!1)),B.connect(f,"deselectAll",this,"reset")]},destroy:function(){this.reset();E.forEach(this._connects,B.disconnect);delete this._connects},reset:function(){this._selectedById={}},_reSelectById:function(f,h){f&&this.grid._hasIdentity&&(this.selection.selected[h]=this._selectedById[this.grid.store.getIdentity(f)])},_selectById:function(f,h){if("none"!=this.selection.mode&&this.grid._hasIdentity){var r=h,c=this.grid;if("number"==typeof h||"string"==
typeof h)r=(h=c._by_idx[h])&&h.item;r&&(this._selectedById[c.store.getIdentity(r)]=!!f);return r}}})})},"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(O,B,F,E,f,h,r,c,v,p,g){O=O([r,c],{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(e,b,a,m,n){if(b&&"textsymbol"!==b.type){e=v.createSurface(e,a,m);if(9>E("ie")){var l=e.getEventSource();h.set(l,"position","relative");h.set(l.parentNode,"position","relative")}b=!this.legendOverride&&this._getDrawingToolShape(b,n)||p.getShapeDescriptors(b);try{var k=e.createShape(b.defaultShape).setFill(b.fill).setStroke(b.stroke)}catch(C){e.clear();
e.destroy();return}var y=k.getBoundingBox();b=y.width;n=y.height;l=-(y.x+b/2);y=-(y.y+n/2);var u=e.getDimensions();l={dx:l+u.width/2,dy:y+u.height/2};if(b>a||n>m)y=b/a>n/m,a=((y?a:m)-5)/(y?b:n),B.mixin(l,{xx:a,yy:a});k.applyTransform(l);return e}},_getDrawingToolShape:function(e,b){switch(b?b.drawingTool||null:null){case "esriFeatureEditToolArrow":b={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":b={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":b={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":b={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":b={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":b={type:"path",path:"M -10,14 L 2,-10 L 14,14 L -10,14 E"};break;case "esriFeatureEditToolRectangle":b=
{type:"path",path:"M -10,-10 L 10,-10 L 10,10 L -10,10 L -10,-10 E"};break;case "esriFeatureEditToolCircle":b={type:"circle",cx:0,cy:0,r:10};break;case "esriFeatureEditToolEllipse":b={type:"ellipse",cx:0,cy:0,rx:10,ry:5};break;case "esriFeatureEditToolFreehand":b="simplelinesymbol"===e.type||"cartographiclinesymbol"===e.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:b,fill:e.getFill(),stroke:e.getStroke()}},_repaint:function(e){e?(e.getStroke&&e.setStroke&&e.setStroke(e.getStroke()),e.getFill&&e.setFill&&e.setFill(e.getFill()),e.children&&B.isArray(e.children)&&F.forEach(e.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)}});
E("extend-esri")&&B.setObject("dijit.editing.TemplatePickerItem",O,g);return O})},"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(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y,u,C,q,w,x,I,A,M,H,U,S,D,L,J,P,R,Y,aa,ea,N,T,ca){var ia=O([w,k,y],{declaredClass:"esri.dijit.AttributeInspector",widgetsInTemplate:!0,templateString:ca,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(Q,W){B.mixin(this,m.widgets.attributeInspector);Q=Q||{};Q.featureLayer||Q.layerInfos||console.error("esri.AttributeInspector: please provide correct parameter in the constructor");this._datePackage=this._getDatePackage(Q);this._layerInfos=Q.layerInfos||[{featureLayer:Q.featureLayer,options:Q.options||[]}];this._layerInfos=F.filter(this._layerInfos,function(Z){return!Z.disableAttributeUpdate});this._hideNavButtons=Q.hideNavButtons||!1},postCreate:function(){if(F.every(this._layerInfos,
function(W){return W.featureLayer.loaded}))this._initLayerInfos(),this._createAttachmentEditor(),this.onFirstFeature();else{var Q=this._layerInfos.length;F.forEach(this._layerInfos,function(W){W=W.featureLayer;if(W.loaded)Q--;else var Z=E.connect(W,"onLoad",this,function(fa){E.disconnect(Z);Z=null;Q--;Q||(this._initLayerInfos(),this._createAttachmentEditor(),this.onFirstFeature())})},this)}},destroy:function(){this._destroyAttributeTable();F.forEach(this._aiConnects,E.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(Q,W){W&&(this._createOnlyFirstTime=!0);
this._updateSelection([Q],W);this._updateUI()},onLayerSelectionChange:function(Q,W,Z){this._createOnlyFirstTime=!1;this._featureIdx=Z===a.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(Q,W,Z,fa){},onLayerError:function(Q,W,Z,fa){},onLayerEditsError:function(Q,
W,Z,fa){},onLayerEditsComplete:function(Q,W,Z,fa){fa=fa||[];if(fa.length){var ka=this._selection,qa=Q.featureLayer.objectIdField;F.forEach(fa,B.hitch(this,function(ra){F.some(ka,B.hitch(this,function(oa,sa){if(oa.attributes[qa]!==ra.objectId)return!1;this._selection.splice(sa,1);return!0}))}))}W=W||[];W.length&&(this._selection=I.findFeatures(W,Q.featureLayer),this._featureIdx=0);fa=this._numFeatures=(this._selection=I.sortFeaturesById(this._layerInfos,this._selection))?this._selection.length:0;if(W.length){if(W=
fa?this._selection[this._featureIdx]:null)fa=W.getLayer().getEditCapabilities(),fa.canCreate&&!fa.canUpdate||this._showFeature(W);this._updateUI()}Z=Z||[];if(Z.length){var la=this._rollbackInfo;F.forEach(Z,function(ra){var oa=I.findFeatures(Z,Q.featureLayer)[0];if(!ra.success&&oa.attributes[Q.featureLayer.objectIdField]===ra.objectId&&la){var sa=la.field;ra=la.graphic.attributes[sa.name];var za=F.filter(this._currentLInfo.fieldInfos,function(Oa){return Oa.fieldName===sa.name},this)[0].dijit;oa.attributes[sa.name]=
ra;"esriFieldTypeDate"===sa.type&&(ra=new Date(ra));this._setValue(za,ra)}},this)}this._rollbackInfo=null},onFieldValueChange:function(Q,W){var Z=Q.field,fa=Q.dijit,ka=this._currentFeature,qa=this._currentLInfo,la=Z.name;Q=this._isFieldRequired(Z,Q);if(""===fa.displayedValue||"dijit.form.ValidationTextBox"!==fa.declaredClass||fa.isValid())if(""!==fa.displayedValue&&fa.displayedValue!==W&&fa.isValid&&!fa.isValid())this._setValue(fa,ka.attributes[Z.name]);else{var ra=!("esriFieldTypeInteger"!==Z.type&&
"esriFieldTypeSmallInteger"!==Z.type&&"esriFieldTypeSingle"!==Z.type&&"esriFieldTypeDouble"!==Z.type);if(Q&&(null===W||""===W||"undefined"===typeof W||ra&&isNaN(W))){la=ka.attributes[Z.name];if("esriFieldTypeDate"===Z.type&&(la=new Date(la),fa instanceof Array)){this._setValue(fa[0],la);this._setValue(fa[1],la);return}this._setValue(fa,la)}else{if(ra){if(isNaN(W)||""===W)W=null;ra&&null!==W&&(W=Number(W))}"esriFieldTypeDate"===Z.type&&(fa instanceof Array?(W=fa[0].getValue(),fa=fa[1].getValue(),W=
W&&fa?new Date(W.getFullYear(),W.getMonth(),W.getDate(),fa.getHours(),fa.getMinutes(),fa.getSeconds(),fa.getMilliseconds()):W||fa||null):(W=fa.getValue(),Z.domain&&(W=Number(W))),W=W&&W.getTime?W.getTime():W&&W.toGregorian?W.toGregorian().getTime():W);if(this._currentFeature.attributes[Z.name]!==W){if(la===qa.typeIdField){var oa=this._findFirst(qa.types,"id",W);F.forEach(qa.fieldInfos,function(sa){(Z=sa.field)&&Z.name!==qa.typeIdField&&(sa=sa.dijit,this._setFieldDomain(sa,oa,Z)&&sa&&(this._setValue(sa,
ka.attributes[Z.name]+""),!1===sa.isValid()&&this._setValue(sa,null)))},this)}this.onAttributeChange(ka,la,W)}}}else this._setValue(fa,ka.attributes[Z.name])},onDeleteBtn:function(Q){this._deleteFeature()},onNextFeature:function(Q){this._onNextFeature(1)},onPreviousFeature:function(Q){this._onNextFeature(-1)},onFirstFeature:function(Q){this._onNextFeature(-1*this._featureIdx)},onLastFeature:function(Q){this._onNextFeature(this._numFeatures-1-this._featureIdx)},_initLayerInfos:function(){var Q=this._layerInfos;
this._editorTrackingInfos={};F.forEach(Q,this._initLayerInfo,this)},_initLayerInfo:function(Q){var W=Q.featureLayer,Z;this._userIds={};var fa=W.id;W.credential&&(this._userIds[fa]=W.credential.userId);Q.userId&&(this._userIds[fa]=Q.userId);this._connect(W,"onSelectionComplete",B.hitch(this,"onLayerSelectionChange",Q));this._connect(W,"onSelectionClear",B.hitch(this,"onLayerSelectionClear",Q));this._connect(W,"onEditsComplete",B.hitch(this,"onLayerEditsComplete",Q));this._connect(W,"error",B.hitch(this,
"onLayerError",Q));this._connect(W,"onUpdateEnd",B.hitch(this,"onLayerUpdateEnd",Q));Q.showAttachments=W.hasAttachments?g.isDefined(Q.showAttachments)?Q.showAttachments:!0:!1;Q.hideFields=Q.hideFields||[];Q.htmlFields=Q.htmlFields||[];Q.isEditable=W.isEditable()?g.isDefined(Q.isEditable)?Q.isEditable:!0:!1;Q.typeIdField=W.typeIdField;Q.layerId=W.id;Q.types=W.types;W.globalIdField&&((Z=this._findFirst(Q.fieldInfos,"fieldName",W.globalIdField))||Q.showGlobalID||Q.hideFields.push(W.globalIdField));(fa=
this._findFirst(Q.fieldInfos,"fieldName",W.objectIdField))||Q.showObjectID||Q.hideFields.push(W.objectIdField);var ka=this._getFields(Q.featureLayer);if(ka){var qa=Q.fieldInfos||[];qa=F.map(qa,function(la){return B.mixin({},la)});qa.length?Q.fieldInfos=F.filter(F.map(qa,B.hitch(this,function(la){var ra=la.stringFieldOption||(this._isInFields(la.fieldName,Q.htmlFields)?ia.STRING_FIELD_OPTION_RICHTEXT:ia.STRING_FIELD_OPTION_TEXTBOX);return B.mixin(la,{field:this._findFirst(ka,"name",la.fieldName),stringFieldOption:ra})})),
"return item.field;"):(ka=F.filter(ka,B.hitch(this,function(la){return!this._isInFields(la.name,Q.hideFields)})),Q.fieldInfos=F.map(ka,B.hitch(this,function(la){var ra=this._isInFields(la.name,Q.htmlFields)?ia.STRING_FIELD_OPTION_RICHTEXT:ia.STRING_FIELD_OPTION_TEXTBOX;return{fieldName:la.name,field:la,stringFieldOption:ra}})));Q.showGlobalID&&!Z&&qa.push(this._findFirst(ka,"name",W.globalIdField));Q.showObjectID&&!fa&&qa.push(this._findFirst(ka,"name",W.objectIdField));Z=[];W.editFieldsInfo&&(W.editFieldsInfo.creatorField&&
Z.push(W.editFieldsInfo.creatorField),W.editFieldsInfo.creationDateField&&Z.push(W.editFieldsInfo.creationDateField),W.editFieldsInfo.editorField&&Z.push(W.editFieldsInfo.editorField),W.editFieldsInfo.editDateField&&Z.push(W.editFieldsInfo.editDateField));this._editorTrackingInfos[W.id]=Z}},_createAttachmentEditor:function(){this._attachmentEditor=null;var Q=F.filter(this._layerInfos,function(W){return W.showAttachments});Q&&Q.length&&(this._attachmentEditor=new x({"class":this.css.attachmentEditor},
this.attachmentEditor),this._attachmentEditor.startup())},_setCurrentLInfo:function(Q){var W=this._currentLInfo?this._currentLInfo.featureLayer:null,Z=Q.featureLayer;if(W&&W.id===Z.id&&!W.ownershipBasedAccessControlForFeatures&&(W=Z.getEditCapabilities(),!W.canCreate||W.canUpdate))return;this._currentLInfo=Q;this._createTable()},_updateSelection:function(Q,W){this._selection=Q||[];F.forEach(this._layerInfos,this._getSelection,this);this._selection=I.sortFeaturesById(this._layerInfos,this._selection);
this._numFeatures=this._selection.length;this._showFeature(this._numFeatures?this._selection[this._featureIdx]:null,W)},_getSelection:function(Q){Q=Q.featureLayer.getSelectedFeatures();this._selection=this._selection.concat(Q)},_updateUI:function(){var Q=this._numFeatures,W=this._currentLInfo;this.layerName.innerHTML=W&&0!==Q?W.featureLayer?W.featureLayer.name:"":this.NLS_noFeaturesSelected;c.set(this.attributeTable,"display",Q?"":"none");c.set(this.editButtons,"display",Q?"":"none");c.set(this.navButtons,
"display",!this._hideNavButtons&&1<Q?"":"none");this.navMessage.innerHTML=g.substitute({idx:this._featureIdx+1,of:this.NLS_of,numFeatures:this._numFeatures},this._navMessage);this._attachmentEditor&&c.set(this._attachmentEditor.domNode,"display",W&&W.showAttachments&&Q?"":"none");c.set(this.deleteBtn.domNode,"display",W&&!1===W.showDeleteButton||!this._canDelete?"none":"");this.domNode.parentNode&&0<this.domNode.parentNode.scrollTop&&(this.domNode.parentNode.scrollTop=0)},_onNextFeature:function(Q){this._featureIdx+=
Q;0>this._featureIdx?this._featureIdx=this._numFeatures-1:this._featureIdx>=this._numFeatures&&(this._featureIdx=0);Q=this._selection.length?this._selection[this._featureIdx]:null;this._showFeature(Q);this._updateUI();this.onNext(Q)},_deleteFeature:function(){this.onDelete(this._currentFeature)},_showFeature:function(Q,W){if(Q){this._currentFeature=Q;W=W?W:Q.getLayer();var Z=W.getEditCapabilities({feature:Q,userId:this._userIds[W.id]});this._canUpdate=Z.canUpdate;this._canDelete=Z.canDelete;if(Z=
this._getLInfoFromFeatureLayer(W)){this._setCurrentLInfo(Z);var fa=Q.attributes,ka=this._findFirst(Z.types,"id",fa[Z.typeIdField]),qa=null;F.forEach(Z.fieldInfos,function(la){qa=la.field;var ra=[];la.dijit&&1<la.dijit.length?F.forEach(la.dijit,function(oa){ra.push(oa)}):ra.push(la.dijit);F.forEach(ra,B.hitch(this,function(oa){if(oa){var sa=this._setFieldDomain(oa,ka,qa),za=fa[qa.name];za=za&&sa&&sa.codedValues&&sa.codedValues.length?sa.codedValues[za]?sa.codedValues[za].name:za:za;g.isDefined(za)||
(za="");"dijit.form.DateTextBox"===oa.declaredClass||"dijit.form.TimeTextBox"===oa.declaredClass?za=""===za?null:new Date(za):"dijit.form.FilteringSelect"===oa.declaredClass&&(oa._lastValueReported=null,za=fa[qa.name]+"");try{this._setValue(oa,za),"dijit.form.FilteringSelect"===oa.declaredClass&&!1===oa.isValid()&&this._setValue(oa,null)}catch(Oa){oa.set("displayedValue",this.NLS_errorInvalid,!1)}}}))},this);this._attachmentEditor&&Z.showAttachments&&this._attachmentEditor.showAttachments(this._currentFeature,
W);(Q=W.getEditSummary(Q))?(this.editorTrackingInfoDiv.innerHTML=Q,e.show(this.editorTrackingInfoDiv)):e.hide(this.editorTrackingInfoDiv)}}},_setFieldDomain:function(Q,W,Z){if(!Q)return null;var fa=Z.domain;W&&W.domains&&W.domains[Z.name]&&!1===W.domains[Z.name]instanceof b&&(fa=W.domains[Z.name]);if(!fa)return null;fa.codedValues&&0<fa.codedValues.length?(Q.set("store",this._toStore(F.map(fa.codedValues,function(ka){return{id:ka.code+"",name:ka.name}}))),this._setValue(Q,fa.codedValues[0].code+"")):
(Q.constraints={min:g.isDefined(fa.minValue)?fa.minValue:Number.MIN_VALUE,max:g.isDefined(fa.maxValue)?fa.maxValue:Number.MAX_VALUE},this._setValue(Q,Q.constraints.min));return fa},_setValue:function(Q,W){Q.set&&(Q._onChangeActive=!1,Q.set("value",W,!0),Q._onChangeActive=!0)},_getFields:function(Q){var W=Q._getOutFields();if(!W)return null;Q=Q.fields;return"*"==W?Q:F.filter(F.map(W,B.hitch(this,"_findFirst",Q,"name")),g.isDefined)},_isInFields:function(Q,W){return Q&&(W||W.length)?F.some(W,function(Z){return Z.toLowerCase()===
Q.toLowerCase()}):!1},_isFieldNullable:function(Q,W){return!(!1===Q.nullable||W.field&&!1===W.field.nullable)},_isFieldRequired:function(Q,W){return!1!==Q.editable&&!1!==W.isEditable&&!this._isFieldNullable(Q,W)},_findFirst:function(Q,W,Z){return(Q=F.filter(Q,function(fa){return fa.hasOwnProperty(W)&&fa[W]===Z}))&&Q.length?Q[0]:null},_getLInfoFromFeatureLayer:function(Q){return this._findFirst(this._layerInfos,"layerId",Q?Q.id:null)},_createTable:function(){this._destroyAttributeTable();this.attributeTable.innerHTML=
"";this._attributes=v.create("table",{cellspacing:"0",cellpadding:"0"},this.attributeTable);var Q=v.create("tbody",null,this._attributes),W=this._currentLInfo,Z=this._findFirst(W.types,"id",this._currentFeature.attributes[W.typeIdField]);F.forEach(W.fieldInfos,B.hitch(this,"_createField",Z,Q),this);this._createOnlyFirstTime=!1},_createField:function(Q,W,Z){var fa=this._currentLInfo,ka=Z.field;if(!this._isInFields(ka.name,fa.hideFields)&&!this._isInFields(ka.name,this._editorTrackingInfos[fa.featureLayer.id])){var qa=
!1,la;W=v.create("tr",null,W);var ra=v.create("td",{innerHTML:Z.label||ka.alias||ka.name,"class":this.css.label,"data-fieldname":ka.name},W);this._isFieldRequired(ka,Z)&&v.create("span",{"class":this.css.red,innerHTML:" *"},ra);W=v.create("td",null,W);if(Z.customField){v.place(Z.customField.domNode||Z.customField,v.create("div",null,W),"first");var oa=Z.customField}else if(!1===fa.isEditable||!1===ka.editable||!1===Z.isEditable||"esriFieldTypeOID"===ka.type||"esriFieldTypeGlobalID"===ka.type||!this._canUpdate&&
!this._createOnlyFirstTime)qa=!0;fa=fa.typeIdField&&ka.name.toLowerCase()==fa.typeIdField.toLowerCase();ra=!!this._getDomainForField(ka,Q);!oa&&fa?oa=this._createTypeField(ka,Z,W):!oa&&ra&&(oa=this._createDomainField(ka,Z,Q,W));if(!oa)switch(ka.type){case "esriFieldTypeString":oa=this._createStringField(ka,Z,W);break;case "esriFieldTypeDate":oa=this._createDateField(ka,Z,W);Z.format&&Z.format.time&&(la=this._createTimeField(ka,Z,W));break;case "esriFieldTypeInteger":case "esriFieldTypeSmallInteger":oa=
this._createIntField(ka,Z,W);break;case "esriFieldTypeSingle":case "esriFieldTypeDouble":oa=this._createFltField(ka,Z,W);break;default:oa=this._createStringField(ka,Z,W)}Z.tooltip&&Z.tooltip.length&&this._toolTips.push(new Y({connectId:[oa.id],label:Z.tooltip}));oa.onChange=B.hitch(this,"onFieldValueChange",Z);oa.set("disabled",qa);la?(Z.dijit=[oa,la],la.onChange=B.hitch(this,"onFieldValueChange",Z),la.set("disabled",qa)):Z.dijit=oa}},_createTypeField:function(Q,W,Z){Z=v.create("div",null,Z);var fa=
Q.domain;return fa&&"range"===fa.type&&fa.minValue===fa.maxValue?new P({"class":this.css.field,trim:!0,maxLength:Q.length,name:Q.alias||Q.name,required:this._isFieldRequired(Q,W)},Z):new S({"class":this.css.field,name:Q.alias||Q.name,required:this._isFieldRequired(Q,W),store:this._toStore(F.map(this._currentLInfo.types,function(ka){return{id:ka.id,name:ka.name}})),searchAttr:"name"},Z)},_getDomainForField:function(Q,W){var Z=Q.domain;(Q=Q.name)&&W&&W.domains&&W.domains[Q]&&!1===W.domains[Q]instanceof
b&&(Z=W.domains[Q]);return Z||null},_createDomainField:function(Q,W,Z,fa){Z=this._getDomainForField(Q,Z);fa=v.create("div",null,fa);return Z.codedValues?new S({"class":this.css.field,name:Q.alias||Q.name,searchAttr:"name",required:this._isFieldRequired(Q,W)},fa):new D({"class":this.css.field},fa)},_createStringField:function(Q,W,Z){Z=v.create("div",null,Z);var fa={trim:!0,maxLength:Q.length,required:this._isFieldRequired(Q,W)};if(W.stringFieldOption===ia.STRING_FIELD_OPTION_TEXTAREA)return fa["class"]=
this.css.field+" "+this.css.textArea,new J(fa,Z);if(W.stringFieldOption===ia.STRING_FIELD_OPTION_RICHTEXT)return fa["class"]=this.css.field+" "+this.css.richText,fa.height="100%",fa.width="100%",fa.plugins=W.richTextPlugins||this._defaultRichTextPlugins,Z=new u(fa,Z),Z.startup(),Z;var ka=this;fa.validator=function(qa,la){this._maskValidSubsetError=!1;this._hasBeenBlurred=!0;return ka._isFieldNullable(Q,W)||!(""===qa||null===qa)};return new P(fa,Z)},_createTimeField:function(Q,W,Z){Z=v.create("div",
null,Z);Q={"class":this.css.field,trim:!0,required:this._isFieldRequired(Q,W),constraints:{formatLength:"medium"}};this._datePackage&&(Q.datePackage=this._datePackage);return new R(Q,Z)},_createDateField:function(Q,W,Z){Z=v.create("div",null,Z);Q={"class":this.css.field,trim:!0,required:this._isFieldRequired(Q,W)};this._datePackage&&(Q.datePackage=this._datePackage);return new M(Q,Z)},_createIntField:function(Q,W,Z){Z=v.create("div",null,Z);return new U({"class":this.css.field,constraints:"esriFieldTypeSmallInteger"===
Q.type?{min:-32768,max:32767,places:0}:{places:0},trim:!0,invalidMessage:this.NLS_validationInt,required:this._isFieldRequired(Q,W)},Z)},_createFltField:function(Q,W,Z){Z=v.create("div",null,Z);return new U({"class":this.css.field,constraints:{max:Infinity,min:-Infinity,places:"0,20"},trim:!0,invalidMessage:this.NLS_validationFlt,required:this._isFieldRequired(Q,W)},Z)},_toStore:function(Q){return new aa({data:{identifier:"id",label:"name",items:Q}})},_connect:function(Q,W,Z){this._aiConnects.push(E.connect(Q,
W,Z))},_getDatePackage:function(Q){return null===Q.datePackage?null:Q.datePackage?Q.datePackage:"ar"===h.locale?"dojox.date.islamic":null},_destroyAttributeTable:function(){F.forEach(this._layerInfos,function(Q){F.forEach(Q.fieldInfos,function(W){var Z=W.dijit;if(Z){Z._onChangeHandle=null;if(W.customField)return;Z instanceof Array?F.forEach(Z,B.hitch(this,function(fa){fa.destroyRecursive?fa.destroyRecursive():fa.destroy&&fa.destroy();fa._onChangeHandle=null})):Z.destroyRecursive?Z.destroyRecursive():
Z.destroy&&Z.destroy()}W.dijit=null},this)},this);F.forEach(this._toolTips,function(Q){Q.destroy()});this._toolTips=[];this._attributes&&v.destroy(this._attributes)}});B.mixin(ia,{STRING_FIELD_OPTION_RICHTEXT:"richtext",STRING_FIELD_OPTION_TEXTAREA:"textarea",STRING_FIELD_OPTION_TEXTBOX:"textbox"});r("extend-esri")&&B.setObject("dijit.AttributeInspector",ia,p);return ia})},"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(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y,u,C,q,w,x,I){function A(H){return new u({command:H.name})}function M(H){return new u({buttonClass:y,command:H.name})}F=F("dijit.Editor",x,{plugins:null,extraPlugins:null,constructor:function(){g.isArray(this.plugins)||(this.plugins=["undo","redo","|","cut","copy","paste","|","bold","italic","underline","strikethrough","|","insertOrderedList","insertUnorderedList","indent","outdent","|","justifyLeft","justifyRight","justifyCenter","justifyFull",C]);this._plugins=
[];this._editInterval=1E3*this.editActionInterval;if(e("ie")||e("trident")||e("edge"))this.events.push("onBeforeDeactivate"),this.events.push("onBeforeActivate")},postMixInProperties:function(){this.setValueDeferred=new E;this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this._steps=this._steps.slice(0);this._undoedSteps=this._undoedSteps.slice(0);g.isArray(this.extraPlugins)&&(this.plugins=this.plugins.concat(this.extraPlugins));this.commands=f.getLocalization("dijit._editor",
"commands",this.lang);e("webkit")&&v.set(this.domNode,"KhtmlUserSelect","none")},startup:function(){this.inherited(arguments);this.toolbar||(this.toolbar=new n({ownerDocument:this.ownerDocument,dir:this.dir,lang:this.lang,"aria-label":this.id}),this.header.appendChild(this.toolbar.domNode));B.forEach(this.plugins,this.addPlugin,this);this.setValueDeferred.resolve(!0);r.add(this.iframe.parentNode,"dijitEditorIFrameContainer");r.add(this.iframe,"dijitEditorIFrame");h.set(this.iframe,"allowTransparency",
!0);this.toolbar.startup();this.onNormalizedDisplayChanged()},destroy:function(){B.forEach(this._plugins,function(H){H&&H.destroy&&H.destroy()});this._plugins=[];this.toolbar.destroyRecursive();delete this.toolbar;this.inherited(arguments)},addPlugin:function(H,U){var S=g.isString(H)?{name:H}:g.isFunction(H)?{ctor:H}:H;if(!S.setEditor){var D={args:S,plugin:null,editor:this};S.name&&(u.registry[S.name]?D.plugin=u.registry[S.name](S):a.publish(I._scopeName+".Editor.getPlugin",D));if(!D.plugin)try{var L=
S.ctor||g.getObject(S.name)||O(S.name);L&&(D.plugin=new L(S))}catch(J){throw Error(this.id+": cannot find plugin ["+S.name+"]");}if(!D.plugin)throw Error(this.id+": cannot find plugin ["+S.name+"]");H=D.plugin}1<arguments.length?this._plugins[U]=H:this._plugins.push(H);H.setEditor(this);g.isFunction(H.setToolbar)&&H.setToolbar(this.toolbar)},resize:function(H){H&&k.prototype.resize.apply(this,arguments)},layout:function(){var H=this._contentBox.h-(this.getHeaderHeight()+this.getFooterHeight()+c.getPadBorderExtents(this.iframe.parentNode).h+
c.getMarginExtents(this.iframe.parentNode).h);this.editingArea.style.height=H+"px";this.iframe&&(this.iframe.style.height="100%");this._layoutMode=!0},_onIEMouseDown:function(H){var U,S=this.document.body,D=S.clientWidth,L=S.clientHeight,J=S.clientLeft,P=S.offsetWidth,R=S.offsetHeight,Y=S.offsetLeft;/^rtl$/i.test(S.dir||"")?D<P&&H.x>D&&H.x<P&&(U=!0):H.x<J&&H.x>Y&&(U=!0);U||L<R&&H.y>L&&H.y<R&&(U=!0);U||(delete this._cursorToStart,delete this._savedSelection,"BODY"==H.target.tagName&&this.defer("placeCursorAtEnd"),
this.inherited(arguments))},onBeforeActivate:function(){this._restoreSelection()},onBeforeDeactivate:function(H){this.customUndo&&this.endEditing(!0);"BODY"!=H.target.tagName&&this._saveSelection()},customUndo:!0,editActionInterval:3,beginEditing:function(H){this._inEditing||(this._inEditing=!0,this._beginEditing(H));0<this.editActionInterval&&(this._editTimer&&this._editTimer.remove(),this._editTimer=this.defer("endEditing",this._editInterval))},_steps:[],_undoedSteps:[],execCommand:function(H){if(!this.customUndo||
"undo"!=H&&"redo"!=H){this.customUndo&&(this.endEditing(),this._beginEditing());var U=this.inherited(arguments);this.customUndo&&this._endEditing();return U}return this[H]()},_pasteImpl:function(){return this._clipboardCommand("paste")},_cutImpl:function(){return this._clipboardCommand("cut")},_copyImpl:function(){return this._clipboardCommand("copy")},_clipboardCommand:function(H){try{var U=this.document.execCommand(H,!1,null);if(e("webkit")&&!U)throw{};}catch(S){U=b.substitute,alert(U(this.commands.systemShortcut,
[this.commands[H],U(this.commands[e("mac")?"appleKey":"ctrlKey"],[{cut:"X",copy:"C",paste:"V"}[H]])])),U=!1}return U},queryCommandEnabled:function(H){return!this.customUndo||"undo"!=H&&"redo"!=H?this.inherited(arguments):"undo"==H?1<this._steps.length:0<this._undoedSteps.length},_moveToBookmark:function(H){var U=H.mark,S=H.mark;H=H.isCollapsed;var D;if(S)if(9>e("ie")||9===e("ie")&&e("quirks"))if(g.isArray(S))U=[],B.forEach(S,function(P){U.push(w.getNode(P,this.editNode))},this),this.selection.moveToBookmark({mark:U,
isCollapsed:H});else{if(S.startContainer&&S.endContainer&&(D=w.getSelection(this.window))&&D.removeAllRanges){D.removeAllRanges();H=w.create(this.window);var L=w.getNode(S.startContainer,this.editNode);var J=w.getNode(S.endContainer,this.editNode);L&&J&&(H.setStart(L,S.startOffset),H.setEnd(J,S.endOffset),D.addRange(H))}}else(D=w.getSelection(this.window))&&D.removeAllRanges&&(D.removeAllRanges(),H=w.create(this.window),L=w.getNode(S.startContainer,this.editNode),J=w.getNode(S.endContainer,this.editNode),
L&&J&&(H.setStart(L,S.startOffset),H.setEnd(J,S.endOffset),D.addRange(H)))},_changeToStep:function(H,U){this.setValue(U.text);(H=U.bookmark)&&this._moveToBookmark(H)},undo:function(){var H=!1;if(!this._undoRedoActive){this._undoRedoActive=!0;this.endEditing(!0);var U=this._steps.pop();U&&0<this._steps.length&&(this.focus(),this._changeToStep(U,this._steps[this._steps.length-1]),this._undoedSteps.push(U),this.onDisplayChanged(),delete this._undoRedoActive,H=!0);delete this._undoRedoActive}return H},
redo:function(){var H=!1;if(!this._undoRedoActive){this._undoRedoActive=!0;this.endEditing(!0);var U=this._undoedSteps.pop();U&&0<this._steps.length&&(this.focus(),this._changeToStep(this._steps[this._steps.length-1],U),this._steps.push(U),this.onDisplayChanged(),H=!0);delete this._undoRedoActive}return H},endEditing:function(H){this._editTimer&&(this._editTimer=this._editTimer.remove());this._inEditing&&(this._endEditing(H),this._inEditing=!1)},_getBookmark:function(){var H=this.selection.getBookmark(),
U=[];if(H&&H.mark){var S=H.mark;if(9>e("ie")||9===e("ie")&&e("quirks")){var D=w.getSelection(this.window);if(g.isArray(S))B.forEach(H.mark,function(J){U.push(w.getIndex(J,this.editNode).o)},this),H.mark=U;else if(D){var L;D.rangeCount&&(L=D.getRangeAt(0));H.mark=L?L.cloneRange():this.selection.getBookmark()}}try{H.mark&&H.mark.startContainer&&(U=w.getIndex(H.mark.startContainer,this.editNode).o,H.mark={startContainer:U,startOffset:H.mark.startOffset,endContainer:H.mark.endContainer===H.mark.startContainer?
U:w.getIndex(H.mark.endContainer,this.editNode).o,endOffset:H.mark.endOffset})}catch(J){H.mark=null}}return H},_beginEditing:function(){0===this._steps.length&&this._steps.push({text:q.getChildrenHtml(this.editNode),bookmark:this._getBookmark()})},_endEditing:function(){var H=q.getChildrenHtml(this.editNode);this._undoedSteps=[];this._steps.push({text:H,bookmark:this._getBookmark()})},onKeyDown:function(H){e("ie")||this.iframe||H.keyCode!=p.TAB||this.tabIndent||this._saveSelection();if(this.customUndo){var U=
H.keyCode;if(H.ctrlKey&&!H.shiftKey&&!H.altKey){if(90==U||122==U){H.stopPropagation();H.preventDefault();this.undo();return}if(89==U||121==U){H.stopPropagation();H.preventDefault();this.redo();return}}this.inherited(arguments);switch(U){case p.ENTER:case p.BACKSPACE:case p.DELETE:this.beginEditing();break;case 88:case 86:if(H.ctrlKey&&!H.altKey&&!H.metaKey){this.endEditing();88==H.keyCode?this.beginEditing("cut"):this.beginEditing("paste");this.defer("endEditing",1);break}default:if(!H.ctrlKey&&!H.altKey&&
!H.metaKey&&(H.keyCode<p.F1||H.keyCode>p.F15)){this.beginEditing();break}case p.ALT:this.endEditing();break;case p.UP_ARROW:case p.DOWN_ARROW:case p.LEFT_ARROW:case p.RIGHT_ARROW:case p.HOME:case p.END:case p.PAGE_UP:case p.PAGE_DOWN:this.endEditing(!0);case p.CTRL:case p.SHIFT:case p.TAB:}}else this.inherited(arguments)},_onBlur:function(){this.inherited(arguments);this.endEditing(!0)},_saveSelection:function(){try{this._savedSelection=this._getBookmark()}catch(H){}},_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(H){this.customUndo?this.isClosed?this.setValue(H):(this.beginEditing(),H||(H="\x26#160;"),this.setValue(H),this.endEditing()):this.inherited(arguments)},_setDisabledAttr:function(H){this.setValueDeferred.then(g.hitch(this,function(){!this.disabled&&H||!this._buttonEnabledPlugins&&H?
B.forEach(this._plugins,function(U){U.set("disabled",!0)}):this.disabled&&!H&&B.forEach(this._plugins,function(U){U.set("disabled",!1)})}));this.inherited(arguments)},_setStateClass:function(){try{this.inherited(arguments),this.document&&this.document.body&&(v.set(this.document.body,"color",v.get(this.iframe,"color")),v.set(this.document.body,"background-color",v.get(this.iframe,"background-color")))}catch(H){}}});g.mixin(u.registry,{undo:A,redo:A,cut:A,copy:A,paste:A,insertOrderedList:A,insertUnorderedList:A,
indent:A,outdent:A,justifyCenter:A,justifyFull:A,justifyLeft:A,justifyRight:A,"delete":A,selectAll:A,removeFormat:A,unlink:A,insertHorizontalRule:A,bold:M,italic:M,underline:M,strikethrough:M,subscript:M,superscript:M,"|":function(){return new u({setEditor:function(H){this.editor=H;this.button=new l({ownerDocument:H.ownerDocument})}})}});return F})},"dijit/Toolbar":function(){define("require dojo/_base/declare dojo/has dojo/keys dojo/ready ./_Widget ./_KeyNavContainer ./_TemplatedMixin".split(" "),
function(O,B,F,E,f,h,r,c){F("dijit-legacy-requires")&&f(0,function(){O(["dijit/ToolbarSeparator"])});return B("dijit.Toolbar",[h,c,r],{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(O,B,F,E){return O("dijit.ToolbarSeparator",[F,E],{templateString:'\x3cdiv class\x3d"dijitToolbarSeparator dijitInline" role\x3d"presentation"\x3e\x3c/div\x3e',buildRendering:function(){this.inherited(arguments);B.setSelectable(this.domNode,!1)},isFocusable:function(){return!1}})})},"dijit/_editor/_Plugin":function(){define(["dojo/_base/connect","dojo/_base/declare","dojo/_base/lang","../Destroyable","../form/Button"],function(O,B,F,E,f){B=B("dijit._editor._Plugin",E,{constructor:function(h){this.params=
h||{};F.mixin(this,this.params);this._attrPairNames={}},editor:null,iconClassPrefix:"dijitEditorIcon",button:null,command:"",useDefaultCommand:!0,buttonClass:f,disabled:!1,getLabel:function(h){return this.editor.commands[h]},_initButton:function(){if(this.command.length){var h=this.getLabel(this.command),r=this.editor,c=this.iconClassPrefix+" "+this.iconClassPrefix+this.command.charAt(0).toUpperCase()+this.command.substr(1);this.button||(h=F.mixin({label:h,ownerDocument:r.ownerDocument,dir:r.dir,
lang:r.lang,showLabel:!1,iconClass:c,dropDown:this.dropDown,tabIndex:"-1"},this.params||{}),delete h.name,this.button=new this.buttonClass(h))}this.get("disabled")&&this.button&&this.button.set("disabled",this.get("disabled"))},destroy:function(){this.dropDown&&this.dropDown.destroyRecursive();this.inherited(arguments)},connect:function(h,r,c){this.own(O.connect(h,r,this,c))},updateState:function(){var h=this.editor,r=this.command;if(h&&h.isLoaded&&r.length){var c=this.get("disabled");if(this.button)try{var v=
h._implCommand(r);var p=!c&&(this[v]?this[v](r):h.queryCommandEnabled(r));this.enabled!==p&&(this.enabled=p,this.button.set("disabled",!p));if(p&&"boolean"==typeof this.button.checked){var g=h.queryCommandState(r);this.checked!==g&&(this.checked=g,this.button.set("checked",h.queryCommandState(r)))}}catch(e){console.log(e)}}},setEditor:function(h){this.editor=h;this._initButton();this.button&&this.useDefaultCommand&&(this.editor.queryCommandAvailable(this.command)?this.own(this.button.on("click",F.hitch(this.editor,
"execCommand",this.command,this.commandArg))):this.button.domNode.style.display="none");this.own(this.editor.on("NormalizedDisplayChanged",F.hitch(this,"updateState")))},setToolbar:function(h){this.button&&h.addChild(this.button)},set:function(h,r){if("object"===typeof h){for(var c in h)this.set(c,h[c]);return this}c=this._getAttrNames(h);if(this[c.s])var v=this[c.s].apply(this,Array.prototype.slice.call(arguments,1));else this._set(h,r);return v||this},get:function(h){var r=this._getAttrNames(h);
return this[r.g]?this[r.g]():this[h]},_setDisabledAttr:function(h){this._set("disabled",h);this.updateState()},_getAttrNames:function(h){var r=this._attrPairNames;if(r[h])return r[h];var c=h.charAt(0).toUpperCase()+h.substr(1);return r[h]={s:"_set"+c+"Attr",g:"_get"+c+"Attr"}},_set:function(h,r){this[h]=r}});B.registry={};return B})},"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(O,B,F,E,f,h,r,c,v,p,g){return O("dijit._editor.plugins.EnterKeyHandling",v,{blockNodeForEnter:"BR",constructor:function(e){e&&("blockNodeForEnter"in e&&(e.blockNodeForEnter=e.blockNodeForEnter.toUpperCase()),E.mixin(this,e))},setEditor:function(e){if(this.editor!==e)if(this.editor=e,"BR"==this.blockNodeForEnter)this.editor.customUndo=!0,e.onLoadDeferred.then(E.hitch(this,function(a){this.own(f(e.document,"keydown",E.hitch(this,function(m){if(m.keyCode==F.ENTER){var n=E.mixin({},m);n.shiftKey=
!0;this.handleEnterKey(n)||(m.stopPropagation(),m.preventDefault())}})));9<=h("ie")&&10>=h("ie")&&this.own(f(e.document,"paste",E.hitch(this,function(m){setTimeout(E.hitch(this,function(){var n=this.editor.document.selection.createRange();n.move("character",-1);n.select();n.move("character",1);n.select()}),0)})));return a}));else if(this.blockNodeForEnter){var b=E.hitch(this,"handleEnterKey");e.addKeyHandler(13,0,0,b);e.addKeyHandler(13,0,1,b);this.own(this.editor.on("KeyPressed",E.hitch(this,"onKeyPressed")))}},
onKeyPressed:function(){if(this._checkListLater){if(this.editor.selection.isCollapsed()){var e=this.editor.selection.getAncestorElement("LI");if(e){h("mozilla")&&"LI"==e.parentNode.parentNode.nodeName&&(e=e.parentNode.parentNode);var b=e.firstChild;!b||1!=b.nodeType||"UL"!=b.nodeName&&"OL"!=b.nodeName||(e.insertBefore(b.ownerDocument.createTextNode("\u00a0"),b),b=g.create(this.editor.window),b.setStart(e.firstChild,0),e=g.getSelection(this.editor.window,!0),e.removeAllRanges(),e.addRange(b))}else p.prototype.execCommand.call(this.editor,
"formatblock",this.blockNodeForEnter),(e=this.editor.selection.getAncestorElement(this.blockNodeForEnter))?(e.innerHTML=this.bogusHtmlContent,9>=h("ie")&&(e=this.editor.document.selection.createRange(),e.move("character",-1),e.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(e){var b,a=this.editor.document,m;if(e.shiftKey){e=this.editor.selection.getParentElement();if(b=g.getAncestor(e,this.blockNodes)){if("LI"==b.tagName)return!0;e=g.getSelection(this.editor.window);var n=e.getRangeAt(0);n.collapsed||(n.deleteContents(),e=g.getSelection(this.editor.window),n=e.getRangeAt(0));if(g.atBeginningOfContainer(b,n.startContainer,n.startOffset)){var l=a.createElement("br");n=g.create(this.editor.window);b.insertBefore(l,
b.firstChild);n.setStartAfter(l);e.removeAllRanges();e.addRange(n)}else if(g.atEndOfContainer(b,n.startContainer,n.startOffset))n=g.create(this.editor.window),l=a.createElement("br"),b.appendChild(l),b.appendChild(a.createTextNode("\u00a0")),n.setStart(b.lastChild,0),e.removeAllRanges(),e.addRange(n);else{if((m=n.startContainer)&&3==m.nodeType){var k=m.nodeValue;var y=a.createTextNode(k.substring(0,n.startOffset));var u=a.createTextNode(k.substring(n.startOffset));b=a.createElement("br");""==u.nodeValue&&
h("webkit")&&(u=a.createTextNode("\u00a0"));B.place(y,m,"after");B.place(b,y,"after");B.place(u,b,"after");B.destroy(m);n=g.create(this.editor.window);n.setStart(u,0);e.removeAllRanges();e.addRange(n);return!1}return!0}}else e=g.getSelection(this.editor.window),e.rangeCount?(n=e.getRangeAt(0))&&n.startContainer&&(n.collapsed||(n.deleteContents(),e=g.getSelection(this.editor.window),n=e.getRangeAt(0)),(m=n.startContainer)&&3==m.nodeType?(b=n.startOffset,m.length<b&&(u=this._adjustNodeAndOffset(m,b),
m=u.node,b=u.offset),k=m.nodeValue,y=a.createTextNode(k.substring(0,b)),u=a.createTextNode(k.substring(b)),b=a.createElement("br"),u.length||(u=a.createTextNode("\u00a0")),y.length?B.place(y,m,"after"):y=m,B.place(b,y,"after"),B.place(u,b,"after"),B.destroy(m)):(0<=n.startOffset&&(l=m.childNodes[n.startOffset]),b=a.createElement("br"),u=a.createTextNode("\u00a0"),l?(B.place(b,l,"before"),B.place(u,b,"after")):(m.appendChild(b),m.appendChild(u))),n=g.create(this.editor.window),n.setStart(u,0),n.setEnd(u,
u.length),e.removeAllRanges(),e.addRange(n),this.editor.selection.collapse(!0)):p.prototype.execCommand.call(this.editor,"inserthtml","\x3cbr\x3e");return!1}var C=!0;e=g.getSelection(this.editor.window);n=e.getRangeAt(0);n.collapsed||(n.deleteContents(),e=g.getSelection(this.editor.window),n=e.getRangeAt(0));l=g.getBlockAncestor(n.endContainer,null,this.editor.editNode);var q=l.blockNode;if(this._checkListLater=q&&("LI"==q.nodeName||"LI"==q.parentNode.nodeName))return h("mozilla")&&(this._pressedEnterInBlock=
q),/^(\s|&nbsp;|&#160;|\xA0|<span\b[^>]*\bclass=['"]Apple-style-span['"][^>]*>(\s|&nbsp;|&#160;|\xA0)<\/span>)?(<br>)?$/.test(q.innerHTML)&&(q.innerHTML="",h("webkit")&&(n=g.create(this.editor.window),n.setStart(q,0),e.removeAllRanges(),e.addRange(n)),this._checkListLater=!1),!0;if(!l.blockNode||l.blockNode===this.editor.editNode){try{p.prototype.execCommand.call(this.editor,"formatblock",this.blockNodeForEnter)}catch(w){}l={blockNode:this.editor.selection.getAncestorElement(this.blockNodeForEnter),
blockContainer:this.editor.editNode};if(l.blockNode){if(l.blockNode!=this.editor.editNode&&!(l.blockNode.textContent||l.blockNode.innerHTML).replace(/^\s+|\s+$/g,"").length)return this.removeTrailingBr(l.blockNode),!1}else l.blockNode=this.editor.editNode;e=g.getSelection(this.editor.window);n=e.getRangeAt(0)}q=a.createElement(this.blockNodeForEnter);q.innerHTML=this.bogusHtmlContent;this.removeTrailingBr(l.blockNode);u=n.endOffset;C=n.endContainer;C.length<u&&(u=this._adjustNodeAndOffset(C,u),C=
u.node,u=u.offset);if(g.atEndOfContainer(l.blockNode,C,u))l.blockNode===l.blockContainer?l.blockNode.appendChild(q):B.place(q,l.blockNode,"after"),C=!1,n=g.create(this.editor.window),n.setStart(q,0),e.removeAllRanges(),e.addRange(n),this.editor.height&&c.scrollIntoView(q);else if(g.atBeginningOfContainer(l.blockNode,n.startContainer,n.startOffset))B.place(q,l.blockNode,l.blockNode===l.blockContainer?"first":"before"),q.nextSibling&&this.editor.height&&(n=g.create(this.editor.window),n.setStart(q.nextSibling,
0),e.removeAllRanges(),e.addRange(n),c.scrollIntoView(q.nextSibling)),C=!1;else{l.blockNode===l.blockContainer?l.blockNode.appendChild(q):B.place(q,l.blockNode,"after");C=!1;l.blockNode.style&&q.style&&l.blockNode.style.cssText&&(q.style.cssText=l.blockNode.style.cssText);if((m=n.startContainer)&&3==m.nodeType){u=n.endOffset;m.length<u&&(u=this._adjustNodeAndOffset(m,u),m=u.node,u=u.offset);k=m.nodeValue;y=a.createTextNode(k.substring(0,u));u=a.createTextNode(k.substring(u,k.length));B.place(y,m,
"before");B.place(u,m,"after");B.destroy(m);for(n=y.parentNode;n!==l.blockNode;){k=a.createElement(n.tagName);n.style&&k.style&&n.style.cssText&&(k.style.cssText=n.style.cssText);"FONT"===n.tagName&&(n.color&&(k.color=n.color),n.face&&(k.face=n.face),n.size&&(k.size=n.size));for(;u;)m=u.nextSibling,k.appendChild(u),u=m;B.place(k,n,"after");y=n;u=k;n=n.parentNode}if(1==u.nodeType||3==u.nodeType&&u.nodeValue)q.innerHTML="";for(y=u;u;)m=u.nextSibling,q.appendChild(u),u=m}n=g.create(this.editor.window);
a=y;if("BR"!==this.blockNodeForEnter){for(;a;)b=a,a=m=a.firstChild;b&&b.parentNode?(q=b.parentNode,n.setStart(q,0),e.removeAllRanges(),e.addRange(n),this.editor.height&&c.scrollIntoView(q),h("mozilla")&&(this._pressedEnterInBlock=l.blockNode)):C=!0}else n.setStart(q,0),e.removeAllRanges(),e.addRange(n),this.editor.height&&c.scrollIntoView(q),h("mozilla")&&(this._pressedEnterInBlock=l.blockNode)}return C},_adjustNodeAndOffset:function(e,b){for(;e.length<b&&e.nextSibling&&3==e.nextSibling.nodeType;)b-=
e.length,e=e.nextSibling;return{node:e,offset:b}},removeTrailingBr:function(e){if(e=/P|DIV|LI/i.test(e.tagName)?e:this.editor.selection.getParentOfType(e,["P","DIV","LI"]))e.lastChild&&(1<e.childNodes.length&&3==e.lastChild.nodeType&&/^[\s\xAD]*$/.test(e.lastChild.nodeValue)||"BR"==e.lastChild.tagName)&&B.destroy(e.lastChild),e.childNodes.length||(e.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(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y,u,C,q,w,x,I,A,M,H,U){var S=F("dijit._editor.RichText",[w,x],{constructor:function(D){this.contentPreFilters=[];this.contentPostFilters=[];this.contentDomPreFilters=[];this.contentDomPostFilters=[];this.editingAreaStyleSheets=[];this.events=[].concat(this.events);this._keyHandlers={};D&&b.isString(D.value)&&(this.value=D.value);this.onLoadDeferred=new E},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=[b.trim,b.hitch(this,"_preFixUrlAttributes")].concat(this.contentPreFilters);l("mozilla")&&(this.contentPreFilters=[this._normalizeFontStyle].concat(this.contentPreFilters),
this.contentPostFilters=[this._removeMozBogus].concat(this.contentPostFilters));l("webkit")&&(this.contentPreFilters=[this._removeWebkitBogus].concat(this.contentPreFilters),this.contentPostFilters=[this._removeWebkitBogus].concat(this.contentPostFilters));if(l("ie")||l("trident"))this.contentPostFilters=[this._normalizeFontStyle].concat(this.contentPostFilters),this.contentDomPostFilters=[b.hitch(this,"_stripBreakerNodes")].concat(this.contentDomPostFilters);this.contentDomPostFilters=[b.hitch(this,
"_stripTrailingEmptyNodes")].concat(this.contentDomPostFilters);this.inherited(arguments);y.publish(U._scopeName+"._editor.RichText::init",this)},startup:function(){this.inherited(arguments);this.open();this.setupDefaultShortcuts()},setupDefaultShortcuts:function(){var D=b.hitch(this,function(P,R){return function(){return!this.execCommand(P,R)}}),L={b:D("bold"),i:D("italic"),u:D("underline"),a:D("selectall"),s:function(){this.save(!0)},m:function(){this.isTabIndent=!this.isTabIndent},1:D("formatblock",
"h1"),2:D("formatblock","h2"),3:D("formatblock","h3"),4:D("formatblock","h4"),"\\":D("insertunorderedlist")};l("ie")||(L.Z=D("redo"));for(var J in L)this.addKeyHandler(J,!0,!1,L[J])},events:["onKeyDown","onKeyUp"],captureEvents:[],_editorCommandsLocalized:!1,_localizeEditorCommands:function(){if(S._editorCommandsLocalized)this._local2NativeFormatNames=S._local2NativeFormatNames,this._native2LocalFormatNames=S._native2LocalFormatNames;else{S._editorCommandsLocalized=!0;S._local2NativeFormatNames={};
S._native2LocalFormatNames={};this._local2NativeFormatNames=S._local2NativeFormatNames;this._native2LocalFormatNames=S._native2LocalFormatNames;for(var D="div p pre h1 h2 h3 h4 h5 h6 ol ul address".split(" "),L="",J,P=0;J=D[P++];)L="l"!==J.charAt(1)?L+("\x3c"+J+"\x3e\x3cspan\x3econtent\x3c/span\x3e\x3c/"+J+"\x3e\x3cbr/\x3e"):L+("\x3c"+J+"\x3e\x3cli\x3econtent\x3c/li\x3e\x3c/"+J+"\x3e\x3cbr/\x3e");var R=c.create("div",{style:{position:"absolute",top:"0px",zIndex:10,opacity:.01},innerHTML:L});this.ownerDocumentBody.appendChild(R);
D=b.hitch(this,function(){for(var Y=R.firstChild;Y;)try{this.selection.selectElement(Y.firstChild);var aa=Y.tagName.toLowerCase();this._local2NativeFormatNames[aa]=document.queryCommandValue("formatblock");this._native2LocalFormatNames[this._local2NativeFormatNames[aa]]=aa;Y=Y.nextSibling.nextSibling}catch(ea){}c.destroy(R)});this.defer(D)}},open:function(D){if(!this.onLoadDeferred||0<=this.onLoadDeferred.fired)this.onLoadDeferred=new E;this.isClosed||this.close();y.publish(U._scopeName+"._editor.RichText::open",
this);1===arguments.length&&D.nodeName&&(this.domNode=D);var L=this.domNode;if(b.isString(this.value)){var J=this.value;L.innerHTML=""}else if(L.nodeName&&"textarea"==L.nodeName.toLowerCase()){var P=this.textarea=L;this.name=P.name;J=P.value;L=this.domNode=this.ownerDocument.createElement("div");L.setAttribute("widgetId",this.id);P.removeAttribute("widgetId");L.cssText=P.cssText;L.className+=" "+P.className;c.place(L,P,"before");var R=b.hitch(this,function(){p.set(P,{display:"block",position:"absolute",
top:"-1000px"});if(l("ie")){var N=P.style;this.__overflow=N.overflow;N.overflow="hidden"}});l("ie")?this.defer(R,10):R();if(P.form){var Y=P.value;this.reset=function(){this.getValue()!==Y&&this.replaceValue(Y)};a(P.form,"submit",b.hitch(this,function(){h.set(P,"disabled",this.disabled);P.value=this.getValue()}))}}else J=M.getChildrenHtml(L),L.innerHTML="";this.value=J;L.nodeName&&"LI"===L.nodeName&&(L.innerHTML=" \x3cbr\x3e");this.header=L.ownerDocument.createElement("div");L.appendChild(this.header);
this.editingArea=L.ownerDocument.createElement("div");L.appendChild(this.editingArea);this.footer=L.ownerDocument.createElement("div");L.appendChild(this.footer);this.name||(this.name=this.id+"_AUTOGEN");if(""!==this.name&&(!B.useXDomain||B.allowXdRichTextSave)){if((J=f.byId(U._scopeName+"._editor.RichText.value"))&&""!==J.value){R=J.value.split(this._SEPARATOR);for(var aa=0,ea;ea=R[aa++];)if(ea=ea.split(this._NAME_CONTENT_SEP),ea[0]===this.name){this.value=ea[1];R=R.splice(aa,1);J.value=R.join(this._SEPARATOR);
break}}S._globalSaveHandler||(S._globalSaveHandler={},u.addOnUnload(function(){for(var N in S._globalSaveHandler){var T=S._globalSaveHandler[N];b.isFunction(T)&&T()}}));S._globalSaveHandler[this.id]=b.hitch(this,"_saveContent")}this.isClosed=!1;J=this.editorObject=this.iframe=this.ownerDocument.createElement("iframe");J.id=this.id+"_iframe";J.style.border="none";J.style.width="100%";this._layoutMode?J.style.height="100%":7<=l("ie")?(this.height&&(J.style.height=this.height),this.minHeight&&(J.style.minHeight=
this.minHeight)):J.style.height=this.height?this.height:this.minHeight;J.frameBorder=0;J._loadFunc=b.hitch(this,function(N){this.window=N;this.document=N.document;this.selection=new I.SelectionManager(N);l("ie")&&this._localizeEditorCommands();this.onLoad(this.get("value"))});R=this._getIframeDocTxt().replace(/\\/g,"\\\\").replace(/'/g,"\\'");R=11>l("ie")?'javascript:document.open();try{parent.window;}catch(e){document.domain\x3d"'+document.domain+"\";}document.write('"+R+"');document.close()":"javascript: '"+
R+"'";this.editingArea.appendChild(J);J.src=R;"LI"===L.nodeName&&(L.lastChild.style.marginTop="-1.2em");r.add(this.domNode,this.baseClass)},_local2NativeFormatNames:{},_native2LocalFormatNames:{},_getIframeDocTxt:function(){var D=p.getComputedStyle(this.domNode);if(this["aria-label"])var L=this["aria-label"];else{var J=m('label[for\x3d"'+this.id+'"]',this.ownerDocument)[0]||f.byId(this["aria-labelledby"],this.ownerDocument);J&&(L=J.textContent||J.innerHTML||"")}J="\x3cdiv id\x3d'dijitEditorBody' role\x3d'textbox' aria-multiline\x3d'true' "+
(L?" aria-label\x3d'"+k.escape(L)+"'":"")+"\x3e\x3c/div\x3e";var P=[D.fontWeight,D.fontSize,D.fontFamily].join(" "),R=D.lineHeight;R=0<=R.indexOf("px")?parseFloat(R)/parseFloat(D.fontSize):0<=R.indexOf("em")?parseFloat(R):"normal";var Y="",aa=this;this.style.replace(/(^|;)\s*(line-|font-?)[^;]+/ig,function(ea){ea=ea.replace(/^;/ig,"")+";";var N=ea.split(":")[0];if(N){N=b.trim(N);N=N.toLowerCase();var T,ca="";for(T=0;T<N.length;T++){var ia=N.charAt(T);switch(ia){case "-":T++,ia=N.charAt(T).toUpperCase();
default:ca+=ia}}p.set(aa.domNode,ca,"")}Y+=ea+";"});this.iframe.setAttribute("title",L);return["\x3c!DOCTYPE html\x3e","\x3chtml lang\x3d'"+(this.lang||g.locale.replace(/-.*/,""))+"'"+(this.isLeftToRight()?"":" dir\x3d'rtl'")+"\x3e\n","\x3chead\x3e\n\x3cmeta http-equiv\x3d'Content-Type' content\x3d'text/html'\x3e\n",L?"\x3ctitle\x3e"+k.escape(L)+"\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:",P,";\n",this.height||l("opera")?"":"\t\tposition: fixed;\n","\t\tline-height:",R,";\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",l("ie")||l("trident")||l("edge")?"":"\tli{ min-height:1.2em; }\n",
"\x3c/style\x3e\n",this._applyEditingAreaStyleSheets(),"\n\x3c/head\x3e\n\x3cbody role\x3d'application'",L?" aria-label\x3d'"+k.escape(L)+"'":"","onload\x3d'try{frameElement \x26\x26 frameElement._loadFunc(window,document)}catch(e){document.domain\x3d\""+document.domain+"\";frameElement._loadFunc(window,document)}' ","style\x3d'"+Y+"'\x3e",J,"\x3c/body\x3e\n\x3c/html\x3e"].join("")},_applyEditingAreaStyleSheets:function(){var D=[];this.styleSheets&&(D=this.styleSheets.split(";"),this.styleSheets=
"");D=D.concat(this.editingAreaStyleSheets);this.editingAreaStyleSheets=[];for(var L="",J=0,P,R=q.get(this.ownerDocument);P=D[J++];)P=(new C(R.location,P)).toString(),this.editingAreaStyleSheets.push(P),L+='\x3clink rel\x3d"stylesheet" type\x3d"text/css" href\x3d"'+P+'"/\x3e';return L},addStyleSheet:function(D){var L=D.toString(),J=q.get(this.ownerDocument);if("."===L.charAt(0)||"/"!==L.charAt(0)&&!D.host)L=(new C(J.location,L)).toString();-1<O.indexOf(this.editingAreaStyleSheets,L)||(this.editingAreaStyleSheets.push(L),
this.onLoadDeferred.then(b.hitch(this,function(){if(this.document.createStyleSheet)this.document.createStyleSheet(L);else{var P=this.document.getElementsByTagName("head")[0],R=this.document.createElement("link");R.rel="stylesheet";R.type="text/css";R.href=L;P.appendChild(R)}})))},removeStyleSheet:function(D){var L=D.toString(),J=q.get(this.ownerDocument);if("."===L.charAt(0)||"/"!==L.charAt(0)&&!D.host)L=(new C(J.location,L)).toString();D=O.indexOf(this.editingAreaStyleSheets,L);-1!==D&&(delete this.editingAreaStyleSheets[D],
m('link[href\x3d"'+L+'"]',this.window.document).orphan())},disabled:!1,_mozSettingProps:{styleWithCSS:!1},_setDisabledAttr:function(D){D=!!D;this._set("disabled",D);if(this.isLoaded){var L=l("ie")&&(this.isLoaded||!this.focusOnLoad);L&&(this.editNode.unselectable="on");this.editNode.contentEditable=!D;this.editNode.tabIndex=D?"-1":this.tabIndex;L&&this.defer(function(){this.editNode&&(this.editNode.unselectable="off")});if(l("mozilla")&&!D&&this._mozSettingProps){D=this._mozSettingProps;for(var J in D)if(D.hasOwnProperty(J))try{this.document.execCommand(J,
!1,D[J])}catch(P){}}this._disabledOK=!0}},onLoad:function(D){this.window.__registeredWindow||(this.window.__registeredWindow=!0,this._iframeRegHandle=H.registerIframe(this.iframe));this.editNode=this.document.body.firstChild;var L=this;this.beforeIframeNode=c.place("\x3cdiv tabIndex\x3d-1\x3e\x3c/div\x3e",this.iframe,"before");this.afterIframeNode=c.place("\x3cdiv tabIndex\x3d-1\x3e\x3c/div\x3e",this.iframe,"after");this.iframe.onfocus=this.document.onfocus=function(){L.editNode.focus()};this.focusNode=
this.editNode;var J=this.events.concat(this.captureEvents),P=this.iframe?this.document:this.editNode;this.own.apply(this,O.map(J,function(R){var Y=R.toLowerCase().replace(/^on/,"");return a(P,Y,b.hitch(this,R))},this));this.own(a(P,"mouseup",b.hitch(this,"onClick")));l("ie")&&(this.own(a(this.document,"mousedown",b.hitch(this,"_onIEMouseDown"))),this.editNode.style.zoom=1);l("webkit")&&(this._webkitListener=this.own(a(this.document,"mouseup",b.hitch(this,"onDisplayChanged")))[0],this.own(a(this.document,
"mousedown",b.hitch(this,function(R){R=R.target;!R||R!==this.document.body&&R!==this.document||this.defer("placeCursorAtEnd")}))));if(l("ie"))try{this.document.execCommand("RespectVisibilityInDesign",!0,null)}catch(R){}this.isLoaded=!0;this.set("disabled",this.disabled);J=b.hitch(this,function(){this.setValue(D);this.onLoadDeferred&&!this.onLoadDeferred.isFulfilled()&&this.onLoadDeferred.resolve(!0);this.onDisplayChanged();this.focusOnLoad&&n(b.hitch(this,"defer","focus",this.updateInterval));this.value=
this.getValue(!0)});this.setValueDeferred?this.setValueDeferred.then(J):J()},onKeyDown:function(D){if(D.keyCode===e.SHIFT||D.keyCode===e.ALT||D.keyCode===e.META||D.keyCode===e.CTRL)return!0;D.keyCode===e.TAB&&this.isTabIndent&&(D.stopPropagation(),D.preventDefault(),this.queryCommandEnabled(D.shiftKey?"outdent":"indent")&&this.execCommand(D.shiftKey?"outdent":"indent"));if(D.keyCode==e.TAB&&!this.isTabIndent&&!D.ctrlKey&&!D.altKey)return D.shiftKey?this.beforeIframeNode.focus():this.afterIframeNode.focus(),
!0;9>l("ie")&&D.keyCode===e.BACKSPACE&&"Control"===this.document.selection.type&&(D.stopPropagation(),D.preventDefault(),this.execCommand("delete"));l("ff")&&(D.keyCode===e.PAGE_UP||D.keyCode===e.PAGE_DOWN)&&this.editNode.clientHeight>=this.editNode.scrollHeight&&D.preventDefault();var L=this._keyHandlers[D.keyCode],J=arguments;L&&!D.altKey&&O.some(L,function(P){if(!(P.shift^D.shiftKey||P.ctrl^(D.ctrlKey||D.metaKey)))return P.handler.apply(this,J)||D.preventDefault(),!0},this);this.defer("onKeyPressed",
1);return!0},onKeyUp:function(){},setDisabled:function(D){g.deprecated("dijit.Editor::setDisabled is deprecated",'use dijit.Editor::attr("disabled",boolean) instead',2);this.set("disabled",D)},_setValueAttr:function(D){this.setValue(D)},_setDisableSpellCheckAttr:function(D){this.document?h.set(this.document.body,"spellcheck",!D):this.onLoadDeferred.then(b.hitch(this,function(){h.set(this.document.body,"spellcheck",!D)}));this._set("disableSpellCheck",D)},addKeyHandler:function(D,L,J,P){"string"==
typeof D&&(D=D.toUpperCase().charCodeAt(0));b.isArray(this._keyHandlers[D])||(this._keyHandlers[D]=[]);this._keyHandlers[D].push({shift:J||!1,ctrl:L||!1,handler:P})},onKeyPressed:function(){this.onDisplayChanged()},onClick:function(D){this.onDisplayChanged(D)},_onIEMouseDown:function(){this.focused||this.disabled||this.focus()},_onBlur:function(D){(l("ie")||l("trident"))&&this.defer(function(){H.curNode||this.ownerDocumentBody.focus()});this.inherited(arguments);var L=this.getValue(!0);if(L!==this.value)this.onChange(L);
this._set("value",L)},_onFocus:function(D){this.disabled||(this._disabledOK||this.set("disabled",!1),this.inherited(arguments))},blur:function(){!l("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>l("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(D,L){D=D.toLowerCase();"formatblock"===D?l("safari")&&void 0===L&&(D="heading"):"hilitecolor"!==D||l("mozilla")||(D="backcolor");return D},_implCommand:function(D){return"_"+this._normalizeCommand(D)+"EnabledImpl"},_qcaCache:{},
queryCommandAvailable:function(D){var L=this._qcaCache[D];return void 0!==L?L:this._qcaCache[D]=this._queryCommandAvailable(D)},_queryCommandAvailable:function(D){switch(D.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 l("ie")||l("trident")||l("edge");case "inserttable":case "insertcell":case "insertcol":case "insertrow":case "deletecells":case "deletecols":case "deleterows":case "mergecells":case "splitcell":return!l("webkit");default:return!1}},execCommand:function(D,L){this.focused&&this.focus();D=this._normalizeCommand(D,L);if(void 0!==L){if("heading"===D)throw Error("unimplemented");"formatblock"===
D&&(l("ie")||l("trident"))&&(L="\x3c"+L+"\x3e")}var J="_"+D+"Impl";if(this[J])var P=this[J](L);else if((L=1<arguments.length?L:null)||"createlink"!==D)P=this.document.execCommand(D,!1,L);this.onDisplayChanged();return P},queryCommandEnabled:function(D){if(this.disabled||!this._disabledOK)return!1;D=this._normalizeCommand(D);var L=this._implCommand(D);return this[L]?this[L](D):this._browserQueryCommandEnabled(D)},queryCommandState:function(D){if(this.disabled||!this._disabledOK)return!1;D=this._normalizeCommand(D);
try{return this.document.queryCommandState(D)}catch(L){return!1}},queryCommandValue:function(D){if(this.disabled||!this._disabledOK)return!1;D=this._normalizeCommand(D);if(l("ie")&&"formatblock"===D)D=this._native2LocalFormatNames[this.document.queryCommandValue(D)];else if(l("mozilla")&&"hilitecolor"===D){try{var L=this.document.queryCommandValue("styleWithCSS")}catch(J){L=!1}this.document.execCommand("styleWithCSS",!1,!0);D=this.document.queryCommandValue(D);this.document.execCommand("styleWithCSS",
!1,L)}else D=this.document.queryCommandValue(D);return D},_sCall:function(D,L){return this.selection[D].apply(this.selection,L)},placeCursorAtStart:function(){this.focus();var D=!1;if(l("mozilla"))for(var L=this.editNode.firstChild;L;){if(3===L.nodeType){if(0<L.nodeValue.replace(/^\s+|\s+$/g,"").length){D=!0;this.selection.selectElement(L);break}}else if(1===L.nodeType){D=!0;var J=L.tagName?L.tagName.toLowerCase():"";/br|input|img|base|meta|area|basefont|hr|link/.test(J)?this.selection.selectElement(L):
this.selection.selectElementChildren(L);break}L=L.nextSibling}else D=!0,this.selection.selectElementChildren(this.editNode);D&&this.selection.collapse(!0)},placeCursorAtEnd:function(){this.focus();var D=!1;if(l("mozilla"))for(var L=this.editNode.lastChild;L;){if(3===L.nodeType){if(0<L.nodeValue.replace(/^\s+|\s+$/g,"").length){D=!0;this.selection.selectElement(L);break}}else if(1===L.nodeType){D=!0;this.selection.selectElement(L.lastChild||L);break}L=L.previousSibling}else D=!0,this.selection.selectElementChildren(this.editNode);
D&&this.selection.collapse(!1)},getValue:function(D){return!this.textarea||!this.isClosed&&this.isLoaded?this.isLoaded?this._postFilterContent(null,D):this.value:this.textarea.value},_getValueAttr:function(){return this.getValue(!0)},setValue:function(D){if(this.isLoaded){if(!this.textarea||!this.isClosed&&this.isLoaded){D=this._preFilterContent(D);var L=this.isClosed?this.domNode:this.editNode;L.innerHTML=D;this._preDomFilterContent(L)}else this.textarea.value=D;this.onDisplayChanged();this._set("value",
this.getValue(!0))}else this.onLoadDeferred.then(b.hitch(this,function(){this.setValue(D)}))},replaceValue:function(D){this.isClosed?this.setValue(D):this.window&&this.window.getSelection&&!l("mozilla")?this.setValue(D):this.window&&this.window.getSelection?(D=this._preFilterContent(D),this.execCommand("selectall"),this.execCommand("inserthtml",D),this._preDomFilterContent(this.editNode)):this.document&&this.document.selection&&this.setValue(D);this._set("value",this.getValue(!0))},_preFilterContent:function(D){var L=
D;O.forEach(this.contentPreFilters,function(J){J&&(L=J(L))});return L},_preDomFilterContent:function(D){D=D||this.editNode;O.forEach(this.contentDomPreFilters,function(L){L&&b.isFunction(L)&&L(D)},this)},_postFilterContent:function(D,L){if(b.isString(D))var J=D;else D=D||this.editNode,this.contentDomPostFilters.length&&(L&&(D=b.clone(D)),O.forEach(this.contentDomPostFilters,function(P){D=P(D)})),J=M.getChildrenHtml(D);b.trim(J.replace(/^\xA0\xA0*/,"").replace(/\xA0\xA0*$/,"")).length||(J="");O.forEach(this.contentPostFilters,
function(P){J=P(J)});return J},_saveContent:function(){var D=f.byId(U._scopeName+"._editor.RichText.value");D&&(D.value&&(D.value+=this._SEPARATOR),D.value+=this.name+this._NAME_CONTENT_SEP+this.getValue(!0))},escapeXml:function(D,L){D=D.replace(/&/gm,"\x26amp;").replace(/</gm,"\x26lt;").replace(/>/gm,"\x26gt;").replace(/"/gm,"\x26quot;");L||(D=D.replace(/'/gm,"\x26#39;"));return D},getNodeHtml:function(D){g.deprecated("dijit.Editor::getNodeHtml is deprecated","use dijit/_editor/html::getNodeHtml instead",
2);return M.getNodeHtml(D)},getNodeChildrenHtml:function(D){g.deprecated("dijit.Editor::getNodeChildrenHtml is deprecated","use dijit/_editor/html::getChildrenHtml instead",2);return M.getChildrenHtml(D)},close:function(D){if(!this.isClosed){arguments.length||(D=!0);D&&this._set("value",this.getValue(!0));this.interval&&clearInterval(this.interval);this._webkitListener&&(this._webkitListener.remove(),delete this._webkitListener);l("ie")&&(this.iframe.onfocus=null);this.iframe._loadFunc=null;this._iframeRegHandle&&
(this._iframeRegHandle.remove(),delete this._iframeRegHandle);if(this.textarea){var L=this.textarea.style;L.position="";L.left=L.top="";l("ie")&&(L.overflow=this.__overflow,this.__overflow=null);this.textarea.value=this.value;c.destroy(this.domNode);this.domNode=this.textarea}else this.domNode.innerHTML=this.value;delete this.iframe;r.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);S._globalSaveHandler&&delete S._globalSaveHandler[this.id]},_removeMozBogus:function(D){return D.replace(/\stype="_moz"/gi,"").replace(/\s_moz_dirty=""/gi,"").replace(/_moz_resizing="(true|false)"/gi,"")},_removeWebkitBogus:function(D){D=D.replace(/\sclass="webkit-block-placeholder"/gi,"");D=D.replace(/\sclass="apple-style-span"/gi,
"");return D=D.replace(/<meta charset="utf-8" \/>/gi,"")},_normalizeFontStyle:function(D){return D.replace(/<(\/)?strong([ >])/gi,"\x3c$1b$2").replace(/<(\/)?em([ >])/gi,"\x3c$1i$2")},_preFixUrlAttributes:function(D){return D.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(D){if(!D)return!1;
if(l("ie")||l("trident")||l("edge"))return this.focused&&!this.disabled;var L=9>l("ie")?this.document.selection.createRange():this.document;try{return L.queryCommandEnabled(D)}catch(J){return!1}},_createlinkEnabledImpl:function(){var D=!0;return D=l("opera")?this.window.getSelection().isCollapsed?!0:this.document.queryCommandEnabled("createlink"):this._browserQueryCommandEnabled("createlink")},_unlinkEnabledImpl:function(){var D=!0;return D=l("mozilla")||l("webkit")||l("ie")||l("trident")||l("edge")?
this.selection.hasAncestorElement("a"):this._browserQueryCommandEnabled("unlink")},_inserttableEnabledImpl:function(){var D=!0;return D=l("mozilla")||l("webkit")?!0:this._browserQueryCommandEnabled("inserttable")},_cutEnabledImpl:function(){var D=!0;l("webkit")?((D=this.window.getSelection())&&(D=D.toString()),D=!!D):D=this._browserQueryCommandEnabled("cut");return D},_copyEnabledImpl:function(){var D=!0;l("webkit")?((D=this.window.getSelection())&&(D=D.toString()),D=!!D):D=this._browserQueryCommandEnabled("copy");
return D},_pasteEnabledImpl:function(){var D=!0;return l("webkit")?!0:D=this._browserQueryCommandEnabled("paste")},_inserthorizontalruleImpl:function(D){return l("ie")?this._inserthtmlImpl("\x3chr\x3e"):this.document.execCommand("inserthorizontalrule",!1,D)},_unlinkImpl:function(D){return this.queryCommandEnabled("unlink")&&(l("mozilla")||l("webkit"))?(D=this.selection.getAncestorElement("a"),this.selection.selectElement(D),this.document.execCommand("unlink",!1,null)):this.document.execCommand("unlink",
!1,D)},_hilitecolorImpl:function(D){if(!this._handleTextColorOrProperties("hilitecolor",D))if(l("mozilla")){this.document.execCommand("styleWithCSS",!1,!0);console.log("Executing color command.");var L=this.document.execCommand("hilitecolor",!1,D);this.document.execCommand("styleWithCSS",!1,!1)}else L=this.document.execCommand("hilitecolor",!1,D);return L},_backcolorImpl:function(D){l("ie")&&(D=D?D:null);var L=this._handleTextColorOrProperties("backcolor",D);L||(L=this.document.execCommand("backcolor",
!1,D));return L},_forecolorImpl:function(D){l("ie")&&(D=D?D:null);var L=!1;(L=this._handleTextColorOrProperties("forecolor",D))||(L=this.document.execCommand("forecolor",!1,D));return L},_inserthtmlImpl:function(D){D=this._preFilterContent(D);var L=!0;if(9>l("ie")){var J=this.document.selection.createRange();if("CONTROL"===this.document.selection.type.toUpperCase()){for(var P=J.item(0);J.length;)J.remove(J.item(0));P.outerHTML=D}else J.pasteHTML(D);J.select()}else if(8>l("trident")){var R=A.getSelection(this.window);
if(R&&R.rangeCount&&R.getRangeAt){J=R.getRangeAt(0);J.deleteContents();var Y=c.create("div");Y.innerHTML=D;for(P=this.document.createDocumentFragment();D=Y.firstChild;)var aa=P.appendChild(D);J.insertNode(P);aa&&(J=J.cloneRange(),J.setStartAfter(aa),J.collapse(!1),R.removeAllRanges(),R.addRange(J))}}else l("mozilla")&&!D.length?this.selection.remove():L=this.document.execCommand("inserthtml",!1,D);return L},_boldImpl:function(D){var L=!1;if(l("ie")||l("trident"))this._adaptIESelection(),L=this._adaptIEFormatAreaAndExec("bold");
L||(L=this.document.execCommand("bold",!1,D));return L},_italicImpl:function(D){var L=!1;if(l("ie")||l("trident"))this._adaptIESelection(),L=this._adaptIEFormatAreaAndExec("italic");L||(L=this.document.execCommand("italic",!1,D));return L},_underlineImpl:function(D){var L=!1;if(l("ie")||l("trident"))this._adaptIESelection(),L=this._adaptIEFormatAreaAndExec("underline");L||(L=this.document.execCommand("underline",!1,D));return L},_strikethroughImpl:function(D){var L=!1;if(l("ie")||l("trident"))this._adaptIESelection(),
L=this._adaptIEFormatAreaAndExec("strikethrough");L||(L=this.document.execCommand("strikethrough",!1,D));return L},_superscriptImpl:function(D){var L=!1;if(l("ie")||l("trident"))this._adaptIESelection(),L=this._adaptIEFormatAreaAndExec("superscript");L||(L=this.document.execCommand("superscript",!1,D));return L},_subscriptImpl:function(D){var L=!1;if(l("ie")||l("trident"))this._adaptIESelection(),L=this._adaptIEFormatAreaAndExec("subscript");L||(L=this.document.execCommand("subscript",!1,D));return L},
_fontnameImpl:function(D){if(l("ie")||l("trident"))var L=this._handleTextColorOrProperties("fontname",D);L||(L=this.document.execCommand("fontname",!1,D));return L},_fontsizeImpl:function(D){if(l("ie")||l("trident"))var L=this._handleTextColorOrProperties("fontsize",D);L||(L=this.document.execCommand("fontsize",!1,D));return L},_insertorderedlistImpl:function(D){var L=!1;if(l("ie")||l("trident")||l("edge"))L=this._adaptIEList("insertorderedlist",D);L||(L=this.document.execCommand("insertorderedlist",
!1,D));return L},_insertunorderedlistImpl:function(D){var L=!1;if(l("ie")||l("trident")||l("edge"))L=this._adaptIEList("insertunorderedlist",D);L||(L=this.document.execCommand("insertunorderedlist",!1,D));return L},getHeaderHeight:function(){return this._getNodeChildrenHeight(this.header)},getFooterHeight:function(){return this._getNodeChildrenHeight(this.footer)},_getNodeChildrenHeight:function(D){var L=0;if(D&&D.childNodes){var J;for(J=0;J<D.childNodes.length;J++){var P=v.position(D.childNodes[J]);
L+=P.h}}return L},_isNodeEmpty:function(D,L){return 1===D.nodeType?0<D.childNodes.length?this._isNodeEmpty(D.childNodes[0],L):!0:3===D.nodeType?""===D.nodeValue.substring(L):!1},_removeStartingRangeFromRange:function(D,L){if(D.nextSibling)L.setStart(D.nextSibling,0);else{for(D=D.parentNode;D&&null==D.nextSibling;)D=D.parentNode;D&&L.setStart(D.nextSibling,0)}return L},_adaptIESelection:function(){var D=A.getSelection(this.window);if(D&&D.rangeCount&&!D.isCollapsed){for(var L=D.getRangeAt(0),J=L.startContainer,
P=L.startOffset;3===J.nodeType&&P>=J.length&&J.nextSibling;)P-=J.length,J=J.nextSibling;for(var R=null;this._isNodeEmpty(J,P)&&J!==R;)R=J,L=this._removeStartingRangeFromRange(J,L),J=L.startContainer,P=0;D.removeAllRanges();D.addRange(L)}},_adaptIEFormatAreaAndExec:function(D){var L=A.getSelection(this.window),J=this.document,P;if(D&&L&&L.isCollapsed){if(this.queryCommandValue(D)){D=this._tagNamesForCommand(D);var R=L.getRangeAt(0);var Y=R.startContainer;if(3===Y.nodeType){var aa=R.endOffset;Y.length<
aa&&(aa=this._adjustNodeAndOffset(ea,aa),Y=aa.node,aa=aa.offset)}for(;Y&&Y!==this.editNode;){var ea=Y.tagName?Y.tagName.toLowerCase():"";if(-1<O.indexOf(D,ea)){var N=Y;break}Y=Y.parentNode}if(N&&(ea=R.startContainer,D=J.createElement(N.tagName),c.place(D,N,"after"),ea&&3===ea.nodeType)){aa=R.endOffset;ea.length<aa&&(aa=this._adjustNodeAndOffset(ea,aa),ea=aa.node,aa=aa.offset);Y=ea.nodeValue;R=J.createTextNode(Y.substring(0,aa));var T=Y.substring(aa,Y.length);T&&(P=J.createTextNode(T));c.place(R,ea,
"before");if(P){var ca=J.createElement("span");ca.className="ieFormatBreakerSpan";c.place(ca,ea,"after");c.place(P,ca,"after");P=ca}c.destroy(ea);aa=R.parentNode;for(ea=[];aa!==N;){Y=aa.tagName;R={tagName:Y};ea.push(R);Y=J.createElement(Y);aa.style&&Y.style&&aa.style.cssText&&(Y.style.cssText=aa.style.cssText,R.cssText=aa.style.cssText);"FONT"===aa.tagName&&(aa.color&&(Y.color=aa.color,R.color=aa.color),aa.face&&(Y.face=aa.face,R.face=aa.face),aa.size&&(Y.size=aa.size,R.size=aa.size));aa.className&&
(Y.className=aa.className,R.className=aa.className);if(P)for(;P;)R=P.nextSibling,Y.appendChild(P),P=R;Y.tagName==aa.tagName?(ca=J.createElement("span"),ca.className="ieFormatBreakerSpan",c.place(ca,aa,"after"),c.place(Y,ca,"after")):c.place(Y,aa,"after");R=aa;P=Y;aa=aa.parentNode}if(P){if(1===P.nodeType||3===P.nodeType&&P.nodeValue)D.innerHTML="";for(;P;)R=P.nextSibling,D.appendChild(P),P=R}if(ea.length){R=ea.pop();P=J.createElement(R.tagName);R.cssText&&P.style&&(P.style.cssText=R.cssText);R.className&&
(P.className=R.className);"FONT"===R.tagName&&(R.color&&(P.color=R.color),R.face&&(P.face=R.face),R.size&&(P.size=R.size));for(c.place(P,D,"before");ea.length;)R=ea.pop(),N=J.createElement(R.tagName),R.cssText&&N.style&&(N.style.cssText=R.cssText),R.className&&(N.className=R.className),"FONT"===R.tagName&&(R.color&&(N.color=R.color),R.face&&(N.face=R.face),R.size&&(N.size=R.size)),P.appendChild(N),P=N;N=J.createTextNode(".");ca.appendChild(N);P.appendChild(N)}else ca=J.createElement("span"),ca.className=
"ieFormatBreakerSpan",N=J.createTextNode("."),ca.appendChild(N),c.place(ca,D,"before");P=A.create(this.window);P.setStart(N,0);P.setEnd(N,N.length);L.removeAllRanges();L.addRange(P);this.selection.collapse(!1);N.parentNode.innerHTML="";D.firstChild||c.destroy(D);return!0}return!1}R=L.getRangeAt(0);if((ea=R.startContainer)&&3===ea.nodeType)return aa=R.startOffset,ea.length<aa&&(aa=this._adjustNodeAndOffset(ea,aa),ea=aa.node,aa=aa.offset),Y=ea.nodeValue,R=J.createTextNode(Y.substring(0,aa)),T=Y.substring(aa),
""!==T&&(P=J.createTextNode(Y.substring(aa))),ca=J.createElement("span"),N=J.createTextNode("."),ca.appendChild(N),R.length?c.place(R,ea,"after"):R=ea,c.place(ca,R,"after"),P&&c.place(P,ca,"after"),c.destroy(ea),P=A.create(this.window),P.setStart(N,0),P.setEnd(N,N.length),L.removeAllRanges(),L.addRange(P),J.execCommand(D),c.place(ca.firstChild,ca,"before"),c.destroy(ca),P.setStart(N,0),P.setEnd(N,N.length),L.removeAllRanges(),L.addRange(P),this.selection.collapse(!1),N.parentNode.innerHTML="",!0}else return!1},
_adaptIEList:function(D){var L=A.getSelection(this.window);if(L.isCollapsed&&L.rangeCount&&!this.queryCommandValue(D)){var J=L.getRangeAt(0),P=J.startContainer;if(P&&3==P.nodeType&&!J.startOffset)return J="ul","insertorderedlist"===D&&(J="ol"),D=this.document.createElement(J),J=c.create("li",null,D),c.place(D,P,"before"),J.appendChild(P),c.create("br",null,D,"after"),D=A.create(this.window),D.setStart(P,0),D.setEnd(P,P.length),L.removeAllRanges(),L.addRange(D),this.selection.collapse(!0),!0}return!1},
_handleTextColorOrProperties:function(D,L){var J=A.getSelection(this.window),P=this.document,R,Y;L=L||null;if(D&&J&&J.isCollapsed&&J.rangeCount){var aa=J.getRangeAt(0);if((R=aa.startContainer)&&3===R.nodeType){var ea=aa.startOffset;R.length<ea&&(aa=this._adjustNodeAndOffset(R,ea),R=aa.node,ea=aa.offset);var N=R.nodeValue;aa=P.createTextNode(N.substring(0,ea));""!==N.substring(ea)&&(Y=P.createTextNode(N.substring(ea)));N=P.createElement("span");ea=P.createTextNode(".");N.appendChild(ea);P=P.createElement("span");
N.appendChild(P);aa.length?c.place(aa,R,"after"):aa=R;c.place(N,aa,"after");Y&&c.place(Y,N,"after");c.destroy(R);R=A.create(this.window);R.setStart(ea,0);R.setEnd(ea,ea.length);J.removeAllRanges();J.addRange(R);if(l("webkit")){J="color";if("hilitecolor"===D||"backcolor"===D)J="backgroundColor";p.set(N,J,L);this.selection.remove();c.destroy(P);N.innerHTML="\x26#160;";this.selection.selectElement(N);this.focus()}else this.execCommand(D,L),c.place(N.firstChild,N,"before"),c.destroy(N),R.setStart(ea,
0),R.setEnd(ea,ea.length),J.removeAllRanges(),J.addRange(R),this.selection.collapse(!1),ea.parentNode.removeChild(ea);return!0}}return!1},_adjustNodeAndOffset:function(D,L){for(;D.length<L&&D.nextSibling&&3===D.nextSibling.nodeType;)L-=D.length,D=D.nextSibling;return{node:D,offset:L}},_tagNamesForCommand:function(D){return"bold"===D?["b","strong"]:"italic"===D?["i","em"]:"strikethrough"===D?["s","strike"]:"superscript"===D?["sup"]:"subscript"===D?["sub"]:"underline"===D?["u"]:[]},_stripBreakerNodes:function(D){if(this.isLoaded)return m(".ieFormatBreakerSpan",
D).forEach(function(L){for(;L.firstChild;)c.place(L.firstChild,L,"before");c.destroy(L)}),D},_stripTrailingEmptyNodes:function(D){function L(J){return/^(p|div|br)$/i.test(J.nodeName)&&0==J.children.length&&/^[\s\xA0]*$/.test(J.textContent||J.innerText||"")||3===J.nodeType&&/^[\s\xA0]*$/.test(J.nodeValue)}for(;D.lastChild&&L(D.lastChild);)c.destroy(D.lastChild);return D},_setTextDirAttr:function(D){this._set("textDir",D);this.onLoadDeferred.then(b.hitch(this,function(){this.editNode.dir=D}))}});return S})},
"dijit/_editor/range":function(){define(["dojo/_base/array","dojo/_base/declare","dojo/_base/lang"],function(O,B,F){var E={getIndex:function(r,c){for(var v=[],p=[],g=r,e,b;r!=c;){var a=0;for(e=r.parentNode;b=e.childNodes[a++];)if(b===r){--a;break}v.unshift(a);p.unshift(a-e.childNodes.length);r=e}if(0<v.length&&3==g.nodeType){for(b=g.previousSibling;b&&3==b.nodeType;)v[v.length-1]--,b=b.previousSibling;for(b=g.nextSibling;b&&3==b.nodeType;)p[p.length-1]++,b=b.nextSibling}return{o:v,r:p}},getNode:function(r,
c){if(!F.isArray(r)||0==r.length)return c;var v=c;O.every(r,function(p){if(0<=p&&p<v.childNodes.length)v=v.childNodes[p];else return v=null,!1;return!0});return v},getCommonAncestor:function(r,c,v){v=v||r.ownerDocument.body;var p=function(b){for(var a=[];b;)if(a.unshift(b),b!==v)b=b.parentNode;else break;return a};r=p(r);c=p(c);p=Math.min(r.length,c.length);for(var g=r[0],e=1;e<p;e++)if(r[e]===c[e])g=r[e];else break;return g},getAncestor:function(r,c,v){for(v=v||r.ownerDocument.body;r&&r!==v;){var p=
r.nodeName.toUpperCase();if(c.test(p))return r;r=r.parentNode}return null},BlockTagNames:/^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DT|DE)$/,getBlockAncestor:function(r,c,v){v=v||r.ownerDocument.body;c=c||E.BlockTagNames;for(var p=null,g;r&&r!==v;){var e=r.nodeName.toUpperCase();!p&&c.test(e)&&(p=r);!g&&/^(?:BODY|TD|TH|CAPTION)$/.test(e)&&(g=r);r=r.parentNode}return{blockNode:p,blockContainer:g||r.ownerDocument.body}},atBeginningOfContainer:function(r,c,v){var p=!1,g=0==v;g||3!=c.nodeType||
/^[\s\xA0]+$/.test(c.nodeValue.substr(0,v))&&(g=!0);if(g)for(p=!0;c&&c!==r;){if(c.previousSibling){p=!1;break}c=c.parentNode}return p},atEndOfContainer:function(r,c,v){var p=!1,g=v==(c.length||c.childNodes.length);g||3!=c.nodeType||/^[\s\xA0]+$/.test(c.nodeValue.substr(v))&&(g=!0);if(g)for(p=!0;c&&c!==r;){if(c.nextSibling){p=!1;break}c=c.parentNode}return p},adjacentNoneTextNode:function(r,c){var v=r;r=0-r.length||0;for(c=c?"nextSibling":"previousSibling";v&&3==v.nodeType;)r+=v.length,v=v[c];return[v,
r]},create:function(r){r=r||window;return r.getSelection?r.document.createRange():new h},getSelection:function(r,c){if(r.getSelection)return r.getSelection();r=new f.selection(r);c||r._getCurrentSelection();return r}};if(!window.getSelection)var f=E.ie={cachedSelection:{},selection:function(r){this._ranges=[];this.addRange=function(c,v){this._ranges.push(c);v||c._select();this.rangeCount=this._ranges.length};this.removeAllRanges=function(){this._ranges=[];this.rangeCount=0};this.getRangeAt=function(c){return this._ranges[c]};
this._getCurrentSelection=function(){this.removeAllRanges();var c=r.document.selection.createRange();c="CONTROL"==r.document.selection.type.toUpperCase()?new h(f.decomposeControlRange(c)):new h(f.decomposeTextRange(c));this.addRange(c,!0),this.isCollapsed=c.collapsed}},decomposeControlRange:function(r){var c=r.item(0),v=r.item(r.length-1);r=c.parentNode;var p=v.parentNode;c=E.getIndex(c,r).o[0];v=E.getIndex(v,p).o[0]+1;return[r,c,p,v]},getEndPoint:function(r,c){var v=r.duplicate();v.collapse(!c);
var p="EndTo"+(c?"End":"Start"),g=v.parentElement(),e;if(0<g.childNodes.length)O.every(g.childNodes,function(m,n){if(3!=m.nodeType)if(v.moveToElementText(m),0<v.compareEndPoints(p,r))if(e&&3==e.nodeType){b=e;var l=!0}else return b=g,a=n,!1;else{if(n==g.childNodes.length-1)return b=g,a=g.childNodes.length,!1}else n==g.childNodes.length-1&&(b=m,l=!0);if(l&&b)return b=(m=E.adjacentNoneTextNode(b)[0])?m.nextSibling:g.firstChild,n=E.adjacentNoneTextNode(b),m=n[0],n=n[1],m?(v.moveToElementText(m),v.collapse(!1)):
v.moveToElementText(g),v.setEndPoint(p,r),a=v.text.length-n,!1;e=m;return!0});else{var b=g;var a=0}c||1!=b.nodeType||a!=b.childNodes.length||(c=b.nextSibling)&&3==c.nodeType&&(b=c,a=0);return[b,a]},setEndPoint:function(r,c,v){r=r.duplicate();var p;if(3!=c.nodeType)if(0<v){if(p=c.childNodes[v-1])if(3==p.nodeType)c=p,v=p.length;else if(p.nextSibling&&3==p.nextSibling.nodeType)c=p.nextSibling,v=0;else{r.moveToElementText(p.nextSibling?p:c);var g=p.parentNode;p=g.insertBefore(p.ownerDocument.createTextNode(" "),
p.nextSibling);r.collapse(!1);g.removeChild(p)}}else r.moveToElementText(c),r.collapse(!0);3==c.nodeType&&(p=E.adjacentNoneTextNode(c),g=p[0],p=p[1],g?(r.moveToElementText(g),r.collapse(!1),"inherit"!=g.contentEditable&&p++):(r.moveToElementText(c.parentNode),r.collapse(!0),r.move("character",1),r.move("character",-1)),v+=p,0<v&&r.move("character",v)!=v&&console.error("Error when moving!"));return r},decomposeTextRange:function(r){var c=f.getEndPoint(r),v=c[0],p=c[1],g=c[0];c=c[1];r.htmlText.length&&
(r.htmlText==r.text?c=p+r.text.length:(c=f.getEndPoint(r,!0),g=c[0],c=c[1]));return[v,p,g,c]},setRange:function(r,c,v,p,g,e){c=f.setEndPoint(r,c,v);r.setEndPoint("StartToStart",c);if(!e)var b=f.setEndPoint(r,p,g);r.setEndPoint("EndToEnd",b||c);return r}},h=E.W3CRange=B(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?E.getCommonAncestor(this.startContainer,this.endContainer):this.startContainer;this.collapsed=this.startContainer===this.endContainer&&this.startOffset==this.endOffset},setStart:function(r,c){c=parseInt(c);if(this.startContainer!==r||this.startOffset!=c)delete this._cachedBookmark,this.startContainer=r,this.startOffset=c,this.endContainer?this._updateInternal():
this.setEnd(r,c)},setEnd:function(r,c){c=parseInt(c);if(this.endContainer!==r||this.endOffset!=c)delete this._cachedBookmark,this.endContainer=r,this.endOffset=c,this.startContainer?this._updateInternal():this.setStart(r,c)},setStartAfter:function(r,c){this._setPoint("setStart",r,c,1)},setStartBefore:function(r,c){this._setPoint("setStart",r,c,0)},setEndAfter:function(r,c){this._setPoint("setEnd",r,c,1)},setEndBefore:function(r,c){this._setPoint("setEnd",r,c,0)},_setPoint:function(r,c,v,p){v=E.getIndex(c,
c.parentNode).o;this[r](c.parentNode,v.pop()+p)},_getIERange:function(){var r=(this._body||this.endContainer.ownerDocument.body).createTextRange();f.setRange(r,this.startContainer,this.startOffset,this.endContainer,this.endOffset,this.collapsed);return r},getBookmark:function(){this._getIERange();return this._cachedBookmark},_select:function(){this._getIERange().select()},deleteContents:function(){var r=this.startContainer,c=this._getIERange();3!==r.nodeType||this.startOffset||this.setStartBefore(r);
c.pasteHTML("");this.endContainer=this.startContainer;this.endOffset=this.startOffset;this.collapsed=!0},cloneRange:function(){var r=new h([this.startContainer,this.startOffset,this.endContainer,this.endOffset]);r._body=this._body;return r},detach:function(){this.startContainer=this.commonAncestorContainer=this._body=null;this.startOffset=0;this.endContainer=null;this.endOffset=0;this.collapsed=!0}});F.setObject("dijit.range",E);return E})},"dijit/_editor/html":function(){define(["dojo/_base/array",
"dojo/_base/lang","dojo/sniff"],function(O,B,F){var E={};B.setObject("dijit._editor.html",E);var f=E.escapeXml=function(h,r){h=h.replace(/&/gm,"\x26amp;").replace(/</gm,"\x26lt;").replace(/>/gm,"\x26gt;").replace(/"/gm,"\x26quot;");r||(h=h.replace(/'/gm,"\x26#39;"));return h};E.getNodeHtml=function(h){var r=[];E.getNodeHtmlHelper(h,r);return r.join("")};E.getNodeHtmlHelper=function(h,r){switch(h.nodeType){case 1:var c=h.nodeName.toLowerCase();if(!c||"/"==c.charAt(0))return"";r.push("\x3c",c);var v=
[],p={},g;if(F("dom-attributes-explicit")||F("dom-attributes-specified-flag"))for(var e=0;g=h.attributes[e++];){var b=g.name;"_dj"===b.substr(0,3)||F("dom-attributes-specified-flag")&&!g.specified||b in p||(g=g.value,("src"==b||"href"==b)&&h.getAttribute("_djrealurl")&&(g=h.getAttribute("_djrealurl")),8===F("ie")&&"style"===b&&(g=g.replace("HEIGHT:","height:").replace("WIDTH:","width:")),v.push([b,g]),p[b]=g)}else{var a=(/^input$|^img$/i.test(h.nodeName)?h:h.cloneNode(!1)).outerHTML;p=a.match(/[\w-]+=("[^"]*"|'[^']*'|\S*)/gi);
a=a.substr(0,a.indexOf("\x3e"));O.forEach(p,function(m){if(m){var n=m.indexOf("\x3d");if(0<n&&(m=m.substring(0,n),"_dj"!=m.substr(0,3)))if("src"!=m&&"href"!=m||!h.getAttribute("_djrealurl")){switch(m){case "style":var l=h.style.cssText.toLowerCase();break;case "class":l=h.className;break;case "width":if("img"===c){(n=/width=(\S+)/i.exec(a))&&(l=n[1]);break}case "height":if("img"===c){(n=/height=(\S+)/i.exec(a))&&(l=n[1]);break}default:l=h.getAttribute(m)}null!=l&&v.push([m,l.toString()])}else v.push([m,
h.getAttribute("_djrealurl")])}},this)}v.sort(function(m,n){return m[0]<n[0]?-1:m[0]==n[0]?0:1});for(p=0;g=v[p++];)r.push(" ",g[0],'\x3d"',"string"===typeof g[1]?f(g[1],!0):g[1],'"');switch(c){case "br":case "hr":case "img":case "input":case "base":case "meta":case "area":case "basefont":r.push(" /\x3e");break;case "script":r.push("\x3e",h.innerHTML,"\x3c/",c,"\x3e");break;default:r.push("\x3e"),h.hasChildNodes()&&E.getChildrenHtmlHelper(h,r),r.push("\x3c/",c,"\x3e")}break;case 4:case 3:r.push(f(h.nodeValue,
!0));break;case 8:r.push("\x3c!--",f(h.nodeValue,!0),"--\x3e");break;default:r.push("\x3c!-- Element not recognized - Type: ",h.nodeType," Name: ",h.nodeName,"--\x3e")}};E.getChildrenHtml=function(h){var r=[];E.getChildrenHtmlHelper(h,r);return r.join("")};E.getChildrenHtmlHelper=function(h,r){if(h)for(var c=h.childNodes||h,v=!F("ie")||c!==h,p,g=0;p=c[g++];)v&&p.parentNode!=h||E.getNodeHtmlHelper(p,r)};return E})},"dijit/_editor/plugins/LinkDialog":function(){define("require dojo/_base/array 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(O,B,F,E,f,h,r,c,v,p,g,e,b){var a=F("dijit._editor.plugins.LinkDialog",g,{allowUnsafeHtml:!1,linkFilter:[[/</g,"\x26lt;"]],buttonClass:e,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(n){O("dojo/i18n ../../TooltipDialog ../../registry ../../form/Button ../../form/Select ../../form/ValidationTextBox dojo/i18n!../../nls/common dojo/i18n!../nls/LinkDialog".split(" "),h.hitch(this,function(l,k,y){var u=this;this.tag="insertImage"==this.command?"img":"a";l=h.delegate(l.getLocalization("dijit","common",this.lang),l.getLocalization("dijit._editor",
"LinkDialog",this.lang));var C=this.dropDown=this.button.dropDown=new k({title:l[this.command+"Title"],ownerDocument:this.editor.ownerDocument,dir:this.editor.dir,execute:h.hitch(this,"setValue"),onOpen:function(){u._onOpenDialog();k.prototype.onOpen.apply(this,arguments)},onCancel:function(){setTimeout(h.hitch(u,"_onCloseDialog"),0)}});l.urlRegExp=this.urlRegExp;l.id=y.getUniqueId(this.editor.id);this._uniqueId=l.id;this._setContent(C.title+"\x3cdiv style\x3d'border-bottom: 1px black solid;padding-bottom:2pt;margin-bottom:4pt'\x3e\x3c/div\x3e"+
p.substitute(this.linkDialogTemplate,l));C.startup();this._urlInput=y.byId(this._uniqueId+"_urlInput");this._textInput=y.byId(this._uniqueId+"_textInput");this._setButton=y.byId(this._uniqueId+"_setButton");this.own(y.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 q=this._urlInput.get("value");return this._urlRegExp.test(q)||this._emailRegExp.test(q)});this.own(r(C.domNode,"keydown",h.hitch(this,h.hitch(this,function(q){!q||q.keyCode!=f.ENTER||q.shiftKey||q.metaKey||q.ctrlKey||q.altKey||this._setButton.get("disabled")||(C.onExecute(),C.execute(C.get("value")))}))));n()}))},_checkAndFixInput:function(){var n=this,l=this._urlInput.get("value");
this._delayedCheck&&(clearTimeout(this._delayedCheck),this._delayedCheck=null);this._delayedCheck=setTimeout(function(){var k=l,y=!1,u=!1;k&&1<k.length&&(k=h.trim(k),0!==k.indexOf("mailto:")&&(0<k.indexOf("/")?-1===k.indexOf("://")&&"/"!==k.charAt(0)&&k.indexOf("./")&&0!==k.indexOf("../")&&n._hostRxp.test(k)&&(y=!0):n._userAtRxp.test(k)&&(u=!0)));y&&n._urlInput.set("value","http://"+k);u&&n._urlInput.set("value","mailto:"+k);n._setButton.set("disabled",!n._isValid())},250)},_connectTagEvents:function(){this.editor.onLoadDeferred.then(h.hitch(this,
function(){this.own(r(this.editor.editNode,"mouseup",h.hitch(this,"_onMouseUp")));this.own(r(this.editor.editNode,"dblclick",h.hitch(this,"_onDblClick")))}))},_isValid:function(){return this._urlInput.isValid()&&this._textInput.isValid()},_setContent:function(n){this.dropDown.set({parserScope:"dojo",content:n})},_checkValues:function(n){n&&n.urlInput&&(n.urlInput=n.urlInput.replace(/"/g,"\x26quot;"));!this.allowUnsafeHtml&&n&&n.textInput&&("function"===typeof this.linkFilter?n.textInput=this.linkFilter(n.textInput):
B.forEach(this.linkFilter,function(l){n.textInput=n.textInput.replace(l[0],l[1])}));return n},_createlinkEnabledImpl:function(){return!0},setValue:function(n){this._onCloseDialog();if(9>c("ie")){var l=b.getSelection(this.editor.window).getRangeAt(0).endContainer;3===l.nodeType&&(l=l.parentNode);l&&l.nodeName&&l.nodeName.toLowerCase()!==this.tag&&(l=this.editor.selection.getSelectedElement(this.tag));l&&l.nodeName&&l.nodeName.toLowerCase()===this.tag&&this.editor.queryCommandEnabled("unlink")&&(this.editor.selection.selectElementChildren(l),
this.editor.execCommand("unlink"))}n=this._checkValues(n);this.editor.execCommand("inserthtml",p.substitute(this.htmlTemplate,n));v("a",this.editor.document).forEach(function(k){k.innerHTML||E.has(k,"name")||k.parentNode.removeChild(k)},this)},_onCloseDialog:function(){this.editor.focused&&this.editor.focus()},_getCurrentValues:function(n){if(n&&n.tagName.toLowerCase()===this.tag){var l=n.getAttribute("_djrealurl")||n.getAttribute("href");var k=n.getAttribute("target")||"_self";var y=n.textContent||
n.innerText;this.editor.selection.selectElement(n,!0)}else y=this.editor.selection.getSelectedText();return{urlInput:l||"",textInput:y||"",targetSelect:k||""}},_onOpenDialog:function(){if(c("ie")){var n=b.getSelection(this.editor.window);if(n.rangeCount){var l=n.getRangeAt(0);var k=l.endContainer;3===k.nodeType&&(k=k.parentNode);k&&k.nodeName&&k.nodeName.toLowerCase()!==this.tag&&(k=this.editor.selection.getSelectedElement(this.tag));if(!k||k.nodeName&&k.nodeName.toLowerCase()!==this.tag)(n=this.editor.selection.getAncestorElement(this.tag))&&
n.nodeName&&n.nodeName.toLowerCase()==this.tag?(k=n,this.editor.selection.selectElement(k)):l.startContainer===l.endContainer&&(n=l.startContainer.firstChild)&&n.nodeName&&n.nodeName.toLowerCase()==this.tag&&(k=n,this.editor.selection.selectElement(k))}}else k=this.editor.selection.getAncestorElement(this.tag);this.dropDown.reset();this._setButton.set("disabled",!0);this.dropDown.set("value",this._getCurrentValues(k))},_onDblClick:function(n){if(n&&n.target&&(n=n.target,(n.tagName?n.tagName.toLowerCase():
"")===this.tag&&E.get(n,"href"))){var l=this.editor;this.editor.selection.selectElement(n);l.onDisplayChanged();l._updateTimer&&(l._updateTimer.remove(),delete l._updateTimer);l.onNormalizedDisplayChanged();var k=this.button;setTimeout(function(){k.set("disabled",!1);k.loadAndOpenDropDown().then(function(){k.dropDown.focus&&k.dropDown.focus()})},10)}},_onMouseUp:function(){if(c("ff")){var n=this.editor.selection.getAncestorElement(this.tag);if(n){var l=b.getSelection(this.editor.window).getRangeAt(0);
if(l.collapsed&&n.childNodes.length){var k=l.cloneRange();k.selectNodeContents(n.childNodes[n.childNodes.length-1]);k.setStart(n.childNodes[0],0);1!==l.compareBoundaryPoints(k.START_TO_START,k)?l.setStartBefore(n):-1!==l.compareBoundaryPoints(k.END_TO_START,k)&&l.setStartAfter(n)}}}}}),m=F("dijit._editor.plugins.ImgLinkDialog",[a],{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(n){if(n&&n.tagName.toLowerCase()===this.tag){var l=n.getAttribute("_djrealurl")||n.getAttribute("src");var k=n.getAttribute("alt");this.editor.selection.selectElement(n,!0)}else k=this.editor.selection.getSelectedText();return{urlInput:l||"",textInput:k||""}},_isValid:function(){return this._urlInput.isValid()},_connectTagEvents:function(){this.inherited(arguments);
this.editor.onLoadDeferred.then(h.hitch(this,function(){this.own(r(this.editor.editNode,"mousedown",h.hitch(this,"_selectTag")))}))},_selectTag:function(n){n&&n.target&&(n=n.target,(n.tagName?n.tagName.toLowerCase():"")===this.tag&&this.editor.selection.selectElement(n))},_checkValues:function(n){n&&n.urlInput&&(n.urlInput=n.urlInput.replace(/"/g,"\x26quot;"));n&&n.textInput&&(n.textInput=n.textInput.replace(/"/g,"\x26quot;"));return n},_onDblClick:function(n){if(n&&n.target&&(n=n.target,(n.tagName?
n.tagName.toLowerCase():"")===this.tag&&E.get(n,"src"))){var l=this.editor;this.editor.selection.selectElement(n);l.onDisplayChanged();l._updateTimer&&(l._updateTimer.remove(),delete l._updateTimer);l.onNormalizedDisplayChanged();var k=this.button;setTimeout(function(){k.set("disabled",!1);k.loadAndOpenDropDown().then(function(){k.dropDown.focus&&k.dropDown.focus()})},10)}}});g.registry.createLink=function(n){var l={command:"createLink",allowUnsafeHtml:"allowUnsafeHtml"in n?n.allowUnsafeHtml:!1};
"linkFilter"in n&&(l.linkFilter=n.linkFilter);return new a(l)};g.registry.insertImage=function(){return new m({command:"insertImage"})};a.ImgLinkDialog=m;return a})},"dijit/_editor/plugins/TextColor":function(){define("require dojo/colors dojo/_base/declare dojo/_base/lang ../_Plugin ../../form/DropDownButton".split(" "),function(O,B,F,E,f,h){var r=F("dijit._editor.plugins.TextColor",f,{buttonClass:h,colorPicker:"dijit/ColorPalette",useDefaultCommand:!1,_initButton:function(){this.command=this.name;
this.inherited(arguments);var c=this;this.button.loadDropDown=function(v){function p(g){c.button.dropDown=new g({dir:c.editor.dir,ownerDocument:c.editor.ownerDocument,value:c.value,onChange:function(e){c.editor.execCommand(c.command,e)},onExecute:function(){c.editor.execCommand(c.command,this.get("value"))}});v()}"string"==typeof c.colorPicker?O([c.colorPicker],p):p(c.colorPicker)}},updateState:function(){var c=this.editor,v=this.command;if(c&&c.isLoaded&&v.length){if(this.button){var p=this.get("disabled");
this.button.set("disabled",p);if(p)return;try{var g=c.queryCommandValue(v)||""}catch(e){g=""}}""==g&&(g="#000000");"transparent"==g&&(g="#ffffff");"string"==typeof g?-1<g.indexOf("rgb")&&(g=B.fromRgb(g).toHex()):(g=((g&255)<<16|g&65280|(g&16711680)>>>16).toString(16),g="#000000".slice(0,7-g.length)+g);this.value=g;(c=this.button.dropDown)&&c.get&&g!==c.get("value")&&c.set("value",g,!1)}}});f.registry.foreColor=function(c){return new r(c)};f.registry.hiliteColor=function(c){return new r(c)};return r})},
"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(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l){O=O([p,g],{declaredClass:"esri.dijit.editing.AttachmentEditor",widgetsInTemplate:!0,
templateString:n,_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(k,y){B.mixin(this,l.widgets.attachmentEditor)},startup:function(){this.inherited(arguments);
this._uploadField_connect=F.connect(this._uploadField,"onchange",this,function(){0<this._uploadField.value.length&&this._addAttachment()});this._uploadFieldFocus_connect=F.connect(this._uploadField,"onfocus",B.hitch(this,function(k){m.hide(this._attachmentError)}))},destroy:function(){E.forEach(this._aeConnects,F.disconnect);F.disconnect(this._uploadField_connect);F.disconnect(this._uploadFieldFocus_connect);this.inherited(arguments)},showAttachments:function(k,y){this._attachmentList.innerHTML=this.NLS_none;
this._uploadField.value="";E.forEach(this.domNode.children,function(u,C){m.show(u)});m.hide(this._attachmentError);k&&(this._featureLayer=k.getLayer()||y)&&("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:k}).canUpdate,this._oid=k.attributes[this._featureLayer.objectIdField],this._getAttachments(k)):y&&y.getEditCapabilities()||(m.hide(this._uploadForm),E.forEach(this.domNode.children,function(u,C){m.hide(u)})))},_getAttachments:function(k){this._featureLayer&&this._featureLayer.queryAttachmentInfos&&this._featureLayer.queryAttachmentInfos(this._oid,B.hitch(this,"_onQueryAttachmentInfosComplete"))},_addAttachment:function(){m.hide(this._attachmentError);
this._featureLayer&&this._featureLayer.addAttachment?(m.show(this._attachmentProgress),this._featureLayer.addAttachment(this._oid,this._uploadForm,B.hitch(this,"_onAddAttachmentComplete"),B.hitch(this,"_onAddAttachmentError"))):this._tempUpload=this._uploadForm},_chainAttachment:function(k,y){this._tempUpload&&(m.show(this._attachmentProgress),y.addAttachment(k,this._tempUpload,B.hitch(this,"_onAddAttachmentComplete"),B.hitch(this,"_onAddAttachmentError")));this._tempUpload=null},_deleteAttachment:function(k,
y){m.show(this._attachmentProgress);this._featureLayer.deleteAttachments(k,[y],B.hitch(this,"_onDeleteAttachmentComplete"))},_onQueryAttachmentInfosComplete:function(k){var y=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?(y=this._listHtml+this._endHtml,this._uploadForm.style.display=
"none"):this._layerEditingCap[this._currentLayerId].canCreate&&!this._layerEditingCap[this._currentLayerId].canUpdate&&(y=this._listHtml+this._endHtml);var u=this._attachmentList;k=E.map(k,B.hitch(this,function(C){return a.substitute({href:C.url,name:C.name,oid:C.objectId,attid:C.id},y)}));u.innerHTML=k.join("")||this.NLS_none;this._updateConnects()},_onAddAttachmentComplete:function(k){m.hide(this._attachmentProgress.domNode);var y=this._attachmentList,u=this._uploadField,C=u.value,q=C.lastIndexOf("\\");
-1<q&&(C=C.substring(q+1,C.length));C=C.replace(/ /g,"_");q=c.objectToQuery({gdbVersion:this._featureLayer.gdbVersion,token:this._featureLayer._getToken()});var w=this._listHtml+this._deleteBtnHtml+this._endHtml;this._layerEditingCap[this._currentLayerId].canCreate&&!this._layerEditingCap[this._currentLayerId].canUpdate&&(w=this._listHtml+this._endHtml);k=a.substitute({href:this._featureLayer._url.path+"/"+k.objectId+"/attachments/"+k.attachmentId+(q?"?"+q:""),name:C,oid:k.objectId,attid:k.attachmentId},
w);y.innerHTML=y.innerHTML==this.NLS_none?k:y.innerHTML+k;this._updateConnects();u.value=""},_onAddAttachmentError:function(k){m.hide(this._attachmentProgress.domNode);if(k){var y=this.NLS_error,u=this._attachmentError;a.isDefined(k.code)&&400===k.code&&(y=this.NLS_fileNotSupported);v.set(u,"innerHTML",y);m.show(u)}},_onDeleteAttachmentComplete:function(k){m.hide(this._attachmentProgress.domNode);var y=this._attachmentList;E.every(k,function(u){return u.success})&&(f.query("#node_"+k[0].objectId+
"_"+k[0].attachmentId).orphan(),y.children&&y.children.length||(y.innerHTML=this.NLS_none))},_updateConnects:function(){E.forEach(this._aeConnects,F.disconnect);f.query(".deleteAttachment").forEach(function(k){this._aeConnects.push(F.connect(k,"onclick",B.hitch(this,"_deleteAttachment",this._oid,k.id)))},this)}});h("extend-esri")&&B.setObject("dijit.editing.AttachmentEditor",O,b);return O})},"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(O,B,F,E,f,h,r,c){return B("dijit.ProgressBar",[h,r],{progress:"0",value:"",maximum:100,places:0,indeterminate:!1,label:"",name:"",templateString:c,_indeterminateHighContrastImagePath:O.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(v){var p="rtl"==v.toLowerCase();F.toggle(this.domNode,"dijitProgressBarRtl",p);F.toggle(this.domNode,"dijitProgressBarIndeterminateRtl",this.indeterminate&&p);this.inherited(arguments)},update:function(v){E.mixin(this,v||{});v=this.internalProgress;var p=this.domNode,g=1;this.indeterminate?p.removeAttribute("aria-valuenow"):(-1!=String(this.progress).indexOf("%")?(g=Math.min(parseFloat(this.progress)/100,1),this.progress=g*this.maximum):(this.progress=Math.min(this.progress,
this.maximum),g=this.maximum?this.progress/this.maximum:0),p.setAttribute("aria-valuenow",this.progress));p.setAttribute("aria-labelledby",this.labelNode.id);p.setAttribute("aria-valuemin",0);p.setAttribute("aria-valuemax",this.maximum);this.labelNode.innerHTML=this.report(g);F.toggle(this.domNode,"dijitProgressBarIndeterminate",this.indeterminate);F.toggle(this.domNode,"dijitProgressBarIndeterminateRtl",this.indeterminate&&!this.isLeftToRight());v.style.width=100*g+"%";this.onChange()},_setValueAttr:function(v){this._set("value",
v);Infinity==v?this.update({indeterminate:!0}):this.update({indeterminate:!1,progress:v})},_setLabelAttr:function(v){this._set("label",v);this.update()},_setIndeterminateAttr:function(v){this._set("indeterminate",v);this.update()},report:function(v){return this.label?this.label:this.indeterminate?"\x26#160;":f.format(v,{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(O,B,F,E){var f={};f={findFeatures:function(h,r,c){var v=r.objectIdField;r=B.filter(r.graphics,function(p){return B.some(h,function(g){return p.attributes[v]===g.objectId})});if(c)c(r);else return r},getSelection:function(h){var r=[];B.forEach(h,function(c){c=c.getSelectedFeatures();B.forEach(c,function(v){r.push(v)})});return r},sortFeaturesById:function(h,r){var c=B.map(h,function(v){return v.featureLayer});r.sort(function(v,p){var g=v.getLayer(),e=p.getLayer();if(!g)return-1;if(!e)return 1;
var b=B.indexOf(c,g);e=B.indexOf(c,e);b-=e;b||(g=g.objectIdField,b=v.attributes[g]-p.attributes[g]);return b});return r}};F("extend-esri")&&O.setObject("dijit.editing.Util.LayerHelper",f,E);return f})},"dojox/date/islamic":function(){define(["dojox/main","dojo/_base/lang","dojo/date","./islamic/Date"],function(O,B,F,E){var f=B.getObject("date.islamic",!0,O);f.getDaysInMonth=function(h){return h.getDaysInIslamicMonth(h.getMonth(),h.getFullYear())};f.compare=function(h,r,c){h instanceof E&&(h=h.toGregorian());
r instanceof E&&(r=r.toGregorian());return F.compare.apply(null,arguments)};f.add=function(h,r,c){var v=new E(h);switch(r){case "day":v.setDate(h.getDate()+c);break;case "weekday":var p=h.getDay();if(5>p+c&&0<p+c)v.setDate(h.getDate()+c);else{var g=r=0;5==p?(p=4,g=0<c?-1:1):6==p&&(p=4,g=0<c?-2:2);p=0<c?5-p-1:-p;var e=c-p,b=parseInt(e/5);0!=e%5&&(r=0<c?2:-2);r=r+7*b+e%5+p;v.setDate(h.getDate()+r+g)}break;case "year":v.setFullYear(h.getFullYear()+c);break;case "week":c*=7;v.setDate(h.getDate()+c);break;
case "month":h=h.getMonth();v.setMonth(h+c);break;case "hour":v.setHours(h.getHours()+c);break;case "minute":v._addMinutes(c);break;case "second":v._addSeconds(c);break;case "millisecond":v._addMilliseconds(c)}return v};f.difference=function(h,r,c){r=r||new E;c=c||"day";var v=r.getFullYear()-h.getFullYear(),p=1;switch(c){case "weekday":v=Math.round(f.difference(h,r,"day"));p=parseInt(f.difference(h,r,"week"));if(0==v%7)v=5*p;else{c=0;var g=h.getDay(),e=r.getDay();p=parseInt(v/7);r=v%7;h=new E(h);
h.setDate(h.getDate()+7*p);h=h.getDay();if(0<v)switch(!0){case 5==g:c=-1;break;case 6==g:c=0;break;case 5==e:c=-1;break;case 6==e:c=-2;break;case 5<h+r:c=-2}else if(0>v)switch(!0){case 5==g:c=0;break;case 6==g:c=1;break;case 5==e:c=2;break;case 6==e:c=1;break;case 0>h+r:c=2}v=v+c-2*p}p=v;break;case "year":p=v;break;case "month":c=r.toGregorian()>h.toGregorian()?r:h;g=r.toGregorian()>h.toGregorian()?h:r;p=c.getMonth();e=g.getMonth();if(0==v)p=c.getMonth()-g.getMonth();else for(p=12-e+p,v=g.getFullYear()+
1,c=c.getFullYear(),v;v<c;v++)p+=12;r.toGregorian()<h.toGregorian()&&(p=-p);break;case "week":p=parseInt(f.difference(h,r,"day")/7);break;case "day":p/=24;case "hour":p/=60;case "minute":p/=60;case "second":p/=1E3;case "millisecond":p*=r.toGregorian().getTime()-h.toGregorian().getTime()}return Math.round(p)};return f})},"dojox/date/islamic/Date":function(){define(["dojo/_base/lang","dojo/_base/declare","dojo/date"],function(O,B,F){var E=B("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 f=arguments.length;f?1==f?(f=arguments[0],"number"==typeof f&&(f=new Date(f)),f instanceof Date?this.fromGregorian(f):""==f?this._date=new Date(""):(this._year=f._year,this._month=f._month,this._date=f._date,this._hours=f._hours,this._minutes=f._minutes,this._seconds=f._seconds,this._milliseconds=f._milliseconds)):3<=f&&(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(f){f=parseInt(f);if(!(0<f&&f<=this.getDaysInIslamicMonth(this._month,this._year))){var h;if(0<f)for(h=this.getDaysInIslamicMonth(this._month,this._year);f>h;f-=h,h=this.getDaysInIslamicMonth(this._month,this._year))this._month++,12<=this._month&&(this._year++,this._month-=12);else for(h=this.getDaysInIslamicMonth(0<=this._month-1?this._month-1:11,0<=this._month-1?this._year:this._year-1);0>=f;h=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),f+=h}this._date=f;return this},setFullYear:function(f){this._year=+f},setMonth:function(f){this._year+=Math.floor(f/12);this._month=0<f?Math.floor(f%12):Math.floor((f%12+12)%12)},setHours:function(){var f=arguments.length,h=0;1<=f&&(h=parseInt(arguments[0]));2<=f&&(this._minutes=parseInt(arguments[1]));3<=f&&(this._seconds=parseInt(arguments[2]));4==f&&(this._milliseconds=parseInt(arguments[3]));for(;24<=h;)this._date++,f=this.getDaysInIslamicMonth(this._month,
this._year),this._date>f&&(this._month++,12<=this._month&&(this._year++,this._month-=12),this._date-=f),h-=24;this._hours=h},_addMinutes:function(f){f+=this._minutes;this.setMinutes(f);this.setHours(this._hours+parseInt(f/60));return this},_addSeconds:function(f){f+=this._seconds;this.setSeconds(f);this._addMinutes(parseInt(f/60));return this},_addMilliseconds:function(f){f+=this._milliseconds;this.setMilliseconds(f);this._addSeconds(parseInt(f/1E3));return this},setMinutes:function(f){this._minutes=
f%60;return this},setSeconds:function(f){this._seconds=f%60;return this},setMilliseconds:function(f){this._milliseconds=f%1E3;return this},toString:function(){if(isNaN(this._date))return"Invalidate Date";var f=new Date;f.setHours(this._hours);f.setMinutes(this._minutes);f.setSeconds(this._seconds);f.setMilliseconds(this._milliseconds);return this._month+" "+this._date+" "+this._year+" "+f.toTimeString()},toGregorian:function(){var f=this._year;f=Math.floor(this._date+Math.ceil(29.5*this._month)+354*
(f-1)+Math.floor((3+11*f)/30)+this._ISLAMIC_EPOCH-1-.5)+.5;var h=f-this._GREGORIAN_EPOCH,r=Math.floor(h/146097),c=this._mod(h,146097);h=Math.floor(c/36524);var v=this._mod(c,36524);c=Math.floor(v/1461);v=this._mod(v,1461);v=Math.floor(v/365);r=400*r+100*h+4*c+v;4!=h&&4!=v&&r++;h=f-(this._GREGORIAN_EPOCH+365*(r-1)+Math.floor((r-1)/4)-Math.floor((r-1)/100)+Math.floor((r-1)/400));c=this._GREGORIAN_EPOCH-1+365*(r-1)+Math.floor((r-1)/4)-Math.floor((r-1)/100)+Math.floor((r-1)/400)+Math.floor(739/12+(F.isLeapYear(new Date(r,
3,1))?-1:-2)+1);c=f<c?0:F.isLeapYear(new Date(r,3,1))?1:2;h=Math.floor((12*(h+c)+373)/367);c=this._GREGORIAN_EPOCH-1+365*(r-1)+Math.floor((r-1)/4)-Math.floor((r-1)/100)+Math.floor((r-1)/400)+Math.floor((367*h-362)/12+(2>=h?0:F.isLeapYear(new Date(r,h-1,1))?-1:-2)+1);return new Date(r,h-1,f-c+1,this._hours,this._minutes,this._seconds,this._milliseconds)},fromGregorian:function(f){f=new Date(f);var h=f.getFullYear(),r=f.getMonth(),c=f.getDate();h=this._GREGORIAN_EPOCH-1+365*(h-1)+Math.floor((h-1)/4)+
-Math.floor((h-1)/100)+Math.floor((h-1)/400)+Math.floor((367*(r+1)-362)/12+(2>=r+1?0:F.isLeapYear(f)?-1:-2)+c);h=Math.floor(h)+.5;h-=this._ISLAMIC_EPOCH;r=Math.floor((30*h+10646)/10631);c=Math.ceil((h-29-this._yearStart(r))/29.5);c=Math.min(c,11);this._date=Math.ceil(h-this._monthStart(r,c))+1;this._month=c;this._year=r;this._hours=f.getHours();this._minutes=f.getMinutes();this._seconds=f.getSeconds();this._milliseconds=f.getMilliseconds();this._day=f.getDay();return this},valueOf:function(){return this.toGregorian().valueOf()},
_yearStart:function(f){return 354*(f-1)+Math.floor((3+11*f)/30)},_monthStart:function(f,h){return Math.ceil(29.5*h)+354*(f-1)+Math.floor((3+11*f)/30)},_civilLeapYear:function(f){return 11>(14+11*f)%30},getDaysInIslamicMonth:function(f,h){var r=0;r=29+(f+1)%2;11==f&&this._civilLeapYear(h)&&r++;return r},_mod:function(f,h){return f-h*Math.floor(f/h)}});E.getDaysInIslamicMonth=function(f){return(new E).getDaysInIslamicMonth(f.getMonth(),f.getFullYear())};return E})},"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(O,B,F,E,f,h,r,c,v){function p(m,n,l,k,y){return y.replace(/([a-z])\1*/ig,function(u){var C=u.charAt(0);u=u.length;var q=["abbr","wide","narrow"];switch(C){case "G":var w=n.eraAbbr[0];break;case "y":w=String(m.getFullYear());break;case "M":w=m.getMonth();if(3>u){w+=1;var x=!0}else C=["months-format",q[u-3]].join("-"),w=n[C][w];break;case "d":w=m.getDate(!0);x=!0;break;case "E":w=m.getDay();3>u?(w+=1,x=!0):(C=["days-format",q[u-3]].join("-"),w=n[C][w]);break;case "a":w=12>m.getHours()?"am":
"pm";w=n["dayPeriods-format-wide-"+w];break;case "h":case "H":case "K":case "k":x=m.getHours();switch(C){case "h":w=x%12||12;break;case "H":w=x;break;case "K":w=x%12;break;case "k":w=x||24}x=!0;break;case "m":w=m.getMinutes();x=!0;break;case "s":w=m.getSeconds();x=!0;break;case "S":w=Math.round(m.getMilliseconds()*Math.pow(10,u-3));x=!0;break;case "z":if(w=E.getTimezoneName(m.toGregorian()))break;u=4;case "Z":w=m.toGregorian().getTimezoneOffset();w=[0>=w?"+":"-",r.pad(Math.floor(Math.abs(w)/60),2),
r.pad(Math.abs(w)%60,2)];4==u&&(w.splice(0,0,"GMT"),w.splice(3,0,":"));w=w.join("");break;default:throw Error("dojox.date.islamic.locale.formatPattern: invalid pattern char: "+y);}x&&(w=r.pad(w,u));return w})}function g(m,n,l,k){var y=function(q){return q};n=n||y;l=l||y;k=k||y;var u=m.match(/(''|[^'])+/g),C="'"==m.charAt(0);F.forEach(u,function(q,w){q?(u[w]=(C?l:n)(q),C=!C):u[w]=""});return k(u.join(""))}function e(m,n,l,k){k=h.escapeString(k);f.normalizeLocale(l.locale);return k.replace(/([a-z])\1*/ig,
function(y){var u=y.charAt(0);var C=y.length,q="";l.strict?1<C&&(q="0{"+(C-1)+"}"):q="0?";switch(u){case "y":u="\\d+";break;case "M":u=2<C?"\\S+ ?\\S+":q+"[1-9]|1[0-2]";break;case "d":u="[12]\\d|"+q+"[1-9]|3[01]";break;case "E":u="\\S+";break;case "h":u=q+"[1-9]|1[0-2]";break;case "k":u=q+"\\d|1[01]";break;case "H":u=q+"\\d|1\\d|2[0-3]";break;case "K":u=q+"[1-9]|1\\d|2[0-4]";break;case "m":case "s":u=q+"\\d|[0-5]\\d";break;case "S":u="\\d{"+C+"}";break;case "a":C=l.am||n["dayPeriods-format-wide-am"];
q=l.pm||n["dayPeriods-format-wide-pm"];l.strict?u=C+"|"+q:(u=C+"|"+q,C!=C.toLowerCase()&&(u+="|"+C.toLowerCase()),q!=q.toLowerCase()&&(u+="|"+q.toLowerCase()));break;default:u=".*"}m&&m.push(y);return"("+u+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}var b=B.getObject("date.islamic.locale",!0,O);b.format=function(m,n){n=n||{};var l=f.normalizeLocale(n.locale),k=n.formatLength||"short",y=b._getIslamicBundle(l),u=[];l=B.hitch(this,p,m,y,l,n.fullYear);if("year"==n.selector)return m.getFullYear();"time"!=n.selector&&
(m=n.datePattern||y["dateFormat-"+k])&&u.push(g(m,l));"date"!=n.selector&&(n=n.timePattern||y["timeFormat-"+k])&&u.push(g(n,l));return u.join(" ")};b.regexp=function(m){return b._parseInfo(m).regexp};b._parseInfo=function(m){m=m||{};var n=f.normalizeLocale(m.locale);n=b._getIslamicBundle(n);var l=m.formatLength||"short",k=m.datePattern||n["dateFormat-"+l];l=m.timePattern||n["timeFormat-"+l];var y=[];return{regexp:g("date"==m.selector?k:"time"==m.selector?l:"undefined"==typeof l?k:k+" "+l,B.hitch(this,
e,y,n,m)),tokens:y,bundle:n}};b.parse=function(m,n){m=m.replace(/[\u200E\u200F\u202A\u202E]/g,"");n||(n={});var l=b._parseInfo(n),k=l.tokens,y=l.bundle;l=l.regexp.replace(/[\u200E\u200F\u202A\u202E]/g,"");m=(new RegExp("^"+l+"$")).exec(m);f.normalizeLocale(n.locale);if(!m)return null;var u=[1389,0,1,0,0,0,0],C="",q=["abbr","wide","narrow"];F.every(m,function(w,x){if(!x)return!0;x=k[x-1];var I=x.length;switch(x.charAt(0)){case "y":u[0]=Number(w);break;case "M":if(2<I){if(x=y["months-format-"+q[I-3]].concat(),
n.strict||(w=w.replace(".","").toLowerCase(),x=F.map(x,function(M){return M?M.replace(".","").toLowerCase():M})),w=F.indexOf(x,w),-1==w)return!1}else w--;u[1]=Number(w);break;case "D":u[1]=0;case "d":u[2]=Number(w);break;case "a":x=n.am||y["dayPeriods-format-wide-am"];I=n.pm||y["dayPeriods-format-wide-pm"];if(!n.strict){var A=/\./g;w=w.replace(A,"").toLowerCase();x=x.replace(A,"").toLowerCase();I=I.replace(A,"").toLowerCase()}if(n.strict&&w!=x&&w!=I)return!1;C=w==I?"p":w==x?"a":"";break;case "K":24==
w&&(w=0);case "h":case "H":case "k":u[3]=Number(w);break;case "m":u[4]=Number(w);break;case "s":u[5]=Number(w);break;case "S":u[6]=Number(w)}return!0});m=+u[3];"p"===C&&12>m?u[3]=m+12:"a"===C&&12==m&&(u[3]=0);return new c(u[0],u[1],u[2],u[3],u[4],u[5],u[6])};var a=[];b.addCustomFormats=function(m,n){a.push({pkg:m,name:n})};b._getIslamicBundle=function(m){var n={};F.forEach(a,function(l){l=f.getLocalization(l.pkg,l.name,m);n=B.mixin(n,l)},this);return n};b.addCustomFormats("dojo.cldr","islamic");b.getNames=
function(m,n,l,k,y){k=b._getIslamicBundle(k);m=[m,l,n];if("standAlone"==l){l=m.join("-");var u=k[l];1==u[0]&&(u=void 0)}m[1]="format";return(u||k[m.join("-")]).concat()};b.weekDays=b.getNames("days","wide","format");b.months=b.getNames("months","wide","format");return b})},"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(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y,u,C){var q=B(b,{declaredClass:"esri.toolbars.Edit",constructor:function(w,x){this._map=w;this._tool=0;if(this._map.loaded)this._scratchGL=w.graphics;else var I=E.connect(this._map,"onLoad",this,function(){E.disconnect(I);I=null;this._scratchGL=this._map.graphics});w=r("esri-mobile");this._defaultOptions=F.mixin({vertexSymbol:new k(k.STYLE_CIRCLE,w?20:12,new y(y.STYLE_SOLID,new h([0,0,0,.5]),1),new h([128,128,128])),ghostVertexSymbol:new k(k.STYLE_CIRCLE,
w?18:10,new y(y.STYLE_SOLID,new h([0,0,0,.5]),1),new h([255,255,255,.75])),ghostLineSymbol:new y(y.STYLE_DOT,new h([128,128,128]),2),allowDeleteVertices:!0,allowAddVertices:!0,rotateHandleOffset:w?24:16,boxLineSymbol:new y(y.STYLE_DASH,new h([64,64,64]),1),boxHandleSymbol:new k(k.STYLE_SQUARE,w?16:9,new y(y.STYLE_SOLID,new h([0,0,0,.5]),1),new h([255,255,255,.75])),textAnchorSymbol:new k(k.STYLE_CIRCLE,10,null,new h([255,0,0]))},x||{})},activate:function(w,x,I){this.deactivate();this._graphic=x;this._options=
F.mixin(F.mixin({},this._defaultOptions),I||{});var A=q.MOVE;I=q.EDIT_VERTICES;var M=q.SCALE,H=q.ROTATE,U=q.EDIT_TEXT,S=!1,D=!1,L=!1,J=this._map,P=J.spatialReference,R=x.geometry.spatialReference;this._geo=!(!P||!R||P.equals(R)||!P.isWebMercator()||4326!==R.wkid);this._isTextPoint=this._prepareTextSymbolEditing(x,w);(w&A)===A&&(S=this._enableMove(x));A=(w&M)===M;H=(w&H)===H;if(A||H)L=this._enableBoxEditing(x,A,H);(w&I)===I&&(D=this._enableVertexEditing(x));(w&U)===U&&this._enableTextEditing(x);if(!(S||
D||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=w)this._mapPanEndHandle=E.connect(J,"onPanEnd",this,this._mapPanEndHandler),this._mapExtChgHandle=E.connect(J,"onExtentChange",this,this._mapExtentChangeHandler),this.onActivate(this._tool,x);J.snappingManager&&(S||D)&&J.snappingManager._startSelectionLayerQuery()},deactivate:function(){this._isTextPoint=null;var w=this._tool,x=this._graphic;if(w){var I=
!!this._modified;this._clear();E.disconnect(this._mapPanEndHandle);E.disconnect(this._mapExtChgHandle);this._graphic=this._geo=this._mapPanEndHandle=this._mapExtChgHandle=null;this.onDeactivate(w,x,{isModified:I});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(w,x){},onDeactivate:function(w,x,I){},
onGraphicMoveStart:function(w){},onGraphicFirstMove:function(w){this._modified=!0},onGraphicMove:function(w,x){},onGraphicMoveStop:function(w,x){},onGraphicClick:function(w,x){},onVertexMoveStart:function(w,x){},onVertexFirstMove:function(w,x){this._modified=!0},onVertexMove:function(w,x,I){},onVertexMoveStop:function(w,x,I){},onVertexAdd:function(w,x){this._modified=!0},onVertexClick:function(w,x){},onVertexMouseOver:function(w,x){},onVertexMouseOut:function(w,x){},onVertexDelete:function(w,x){this._modified=
!0},onTextEditStart:function(w,x){},onTextEditEnd:function(w){},onScaleStart:function(w){},onScaleFirstMove:function(w){this._modified=!0},onScale:function(w,x){},onScaleStop:function(w,x){},onRotateStart:function(w){},onRotateFirstMove:function(w){this._modified=!0},onRotate:function(w,x){},onRotateStop:function(w,x){},_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(w,x){if("point"===w.geometry.type||"multipoint"===w.geometry.type){var I=w.getLayer(),A=I.renderer;I=w.symbol||I._getSymbol(w);!I&&(A.hasVisualVariables("sizeInfo",!1)||A.hasVisualVariables("colorInfo",!1)||A.hasVisualVariables("opacityInfo",!1))&&A.addBreak&&
A.infos&&1===A.infos.length&&(I=A.infos[0].symbol||A.defaultSymbol);if(I&&"textsymbol"===I.type){if((x&q.SCALE)===q.SCALE||(x&q.ROTATE)===q.ROTATE||(x&q.EDIT_TEXT)===q.EDIT_TEXT){w.setSymbol(new u(I.toJson()));var M=this;this._textSymbolEditor?(this._textSymbolEditor.createForm(w),this._textSymbolEditor.show()):this._options&&this._options.textSymbolEditor?(this._textSymbolEditor=this._options.textSymbolEditor,this._textSymbolEditor.on("symbol-change",function(){M._boxEditor&&M._boxEditor.refresh()})):
O(["../dijit/SymbolEditor"],function(H){if(!M._textSymbolEditor){var U=M._options.textSymbolEditorHolder?c.create("div",null,M._options.textSymbolEditorHolder):c.create("div",null,M._map.root);M._textSymbolEditor=new H({graphic:w},U);H=M._textSymbolEditor.domNode.parentNode.id;v.set(M._textSymbolEditor.domNode,{position:"map_root"===H?"absolute":"relative",left:"map_root"===H?M._map.width/2-100+"px":"5px",top:"20px","z-index":50});M._textSymbolEditor.startup();M._textSymbolEditor.createForm(w);M._textSymbolEditor.show();
M._textSymbolEditor.on("symbol-change",function(){M._boxEditor&&M._boxEditor.refresh()})}})}if((x&q.MOVE)===q.MOVE||(x&q.ROTATE)===q.ROTATE||(x&q.SCALE)===q.SCALE)this._textAnchor=new C(w.geometry,this._options.textAnchorSymbol),this._scratchGL.add(this._textAnchor);return!0}}return!1},_enableMove:function(w){var x=this._map;switch(w.geometry.type){case "point":case "polyline":case "polygon":return this._graphicMover=new m(w,x,this,this._textAnchor),!0}return!1},_enableVertexEditing:function(w){var x=
this._map;switch(w.geometry.type){case "multipoint":case "polyline":case "polygon":return this._vertexEditor=n.create(w,x,this),!0}return!1},_enableBoxEditing:function(w,x,I){var A=this._map,M=w.geometry.type;return"polyline"===M||"polygon"===M||this._isTextPoint?(this._boxEditor=new a(w,A,this,x,I,this._options.uniformScaling,this._isTextPoint),!0):!1},_enableTextEditing:function(w){return this._isTextPoint?(this._textEditor=new l(w,this._map,this),E.connect(this._textEditor,"onEditStart",F.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 w=this._graphicMover;w&&(w.destroy(),this._graphicMover=null)},_disableVertexEditing:function(){var w=this._vertexEditor;w&&(w.destroy(),this._vertexEditor=null)},_disableBoxEditing:function(){var w=this._boxEditor;w&&(w.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(w,x,I){I&&this._refreshMoveables()},_refreshMoveables:function(w){var x=f.filter([this._graphicMover,this._vertexEditor,this._boxEditor],g.isDefined);f.forEach(x,function(I){I.refresh(w)})},_beginOperation:function(w){f.forEach(this._getAffectedTools(w),function(x){x.suspend()})},_endOperation:function(w){f.forEach(this._getAffectedTools(w),function(x){x.resume()})},_getAffectedTools:function(w){var x=[];switch(w){case "MOVE":x=[this._vertexEditor,this._boxEditor];
break;case "VERTICES":x=[this._boxEditor];break;case "BOX":x=[this._vertexEditor]}return x=f.filter(x,g.isDefined)}});F.mixin(q,{MOVE:1,EDIT_VERTICES:2,SCALE:4,ROTATE:8,EDIT_TEXT:16});r("extend-esri")&&F.setObject("toolbars.Edit",q,p);return q})},"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(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l){O=O(null,{declaredClass:"esri.toolbars._Box",constructor:function(k,y,u,C,q,w,x){this._graphic=k;this._map=y;this._toolbar=u;this._scale=C;this._rotate=q;this._defaultEventArgs={};this._scaleEvent="Scale";this._rotateEvent="Rotate";this._uniformScaling=w;k=u._options;this._markerSymbol=k.boxHandleSymbol;this._lineSymbol=k.boxLineSymbol;this._moveStartHandler=B.hitch(this,this._moveStartHandler);this._firstMoveHandler=B.hitch(this,this._firstMoveHandler);
this._moveStopHandler=B.hitch(this,this._moveStopHandler);this._moveHandler=B.hitch(this,this._moveHandler);this._isTextPoint=x;this._init()},destroy:function(){this._cleanUp();this._graphic=this._map=this._toolbar=this._markerSymbol=this._lineSymbol=null},refresh:function(){this._draw()},suspend:function(){F.forEach(this._getAllGraphics(),function(k){k.hide()})},resume:function(){F.forEach(this._getAllGraphics(),function(k){k.show()});this._draw()},_init:function(){this._draw()},_cleanUp:function(){this._connects&&
F.forEach(this._connects,E.disconnect);var k=this._toolbar._scratchGL;this._anchors&&F.forEach(this._anchors,function(y){k.remove(y.graphic);(y=y.moveable)&&y.destroy()});this._box&&k.remove(this._box);this._box=this._anchors=this._connects=null},_draw:function(){if(this._graphic.getDojoShape()){var k=this._map,y=this._toolbar._scratchGL,u=this._getBoxCoords(),C=new b(k.spatialReference),q=B.clone(F.filter(u,function(w,x){return 8!==x&&0===x%2}));q[0]&&q.push([q[0][0],q[0][1]]);C.addPath(q);this._rotate&&
C.addPath([u[1],u[8]]);this._box?this._box.setGeometry(C):(this._box=new l(C,this._lineSymbol),y.add(this._box));this._anchors?F.forEach(this._anchors,function(w,x){this._scale||(x=8);var I=new e(u[x],k.spatialReference);w.graphic.setGeometry(I);I=w.moveable;var A=w.graphic.getDojoShape();A&&(I?A!==I.shape&&(I.destroy(),w.moveable=this._getMoveable(w.graphic,x)):w.moveable=this._getMoveable(w.graphic,x))},this):(this._anchors=[],this._connects=[],F.forEach(u,function(w,x){!this._scale&&8>x||(w=new e(w,
k.spatialReference),w=new l(w,this._markerSymbol),this._isTextPoint&&1===x%2&&w.hide(),y.add(w),this._anchors.push({graphic:w,moveable:this._getMoveable(w,x)}))},this))}else this._cleanUp()},_getBoxCoords:function(k){var y=this._map,u=[],C,q,w;if(this._isTextPoint){var x=this._graphic.getNode().getBoundingClientRect();var I=y.__container.getBoundingClientRect();x=[{x:x.left-I.left,y:x.top-I.top},{x:x.right-I.left,y:x.top-I.top},{x:x.right-I.left,y:x.bottom-I.top},{x:x.left-I.left,y:x.bottom-I.top}]}else x=
this._getTransformedBoundingBox(this._graphic);F.forEach(x,function(A,M,H){C=A;(q=H[M+1])||(q=H[0]);w={x:(C.x+q.x)/2,y:(C.y+q.y)/2};k||(C=y.toMap(C),w=y.toMap(w));u.push([C.x,C.y]);u.push([w.x,w.y])});this._rotate&&(x=B.clone(u[1]),x=k?{x:x[0],y:x[1]}:y.toScreen({x:x[0],y:x[1],spatialReference:y.spatialReference}),x.y-=this._toolbar._options.rotateHandleOffset,k||(x=y.toMap(x)),u.push([x.x,x.y]));return u},_getTransformedBoundingBox:function(k){var y=this._map,u=k.geometry.getExtent(),C=k.geometry.spatialReference;
k=new e(u.xmin,u.ymax,C);u=new e(u.xmax,u.ymin,C);k=y.toScreen(k);u=y.toScreen(u);return[{x:k.x,y:k.y},{x:u.x,y:k.y},{x:u.x,y:u.y},{x:k.x,y:u.y}]},_getAllGraphics:function(){var k=[this._box];this._anchors&&F.forEach(this._anchors,function(y){k.push(y.graphic)});return k=F.filter(k,g.isDefined)},_getMoveable:function(k,y){var u=k.getDojoShape();if(u)return k=new c(u),k._index=y,this._connects.push(E.connect(k,"onMoveStart",this._moveStartHandler)),this._connects.push(E.connect(k,"onFirstMove",this._firstMoveHandler)),
this._connects.push(E.connect(k,"onMoveStop",this._moveStopHandler)),k.onMove=this._moveHandler,(u=u.getEventSource())&&r.set(u,"cursor",this._toolbar._cursors["box"+y]),k},_moveStartHandler:function(k){this._toolbar["on"+(8===k.host._index?this._rotateEvent:this._scaleEvent)+"Start"](this._graphic)},_firstMoveHandler:function(k){this._toolbar._deactivateScrollWheel();var y=k.host._index,u=this._wrapOffset=k.host.shape._wrapOffsets[0]||0,C=this._graphic.getLayer().getNavigationTransform();k=F.map(this._getBoxCoords(!0),
function(w){return{x:w[0]+u,y:w[1]}});var q=this._isTextPoint?this._map.toScreen(this._graphic.geometry):{x:k[1].x,y:k[3].y};this._centerCoord=v.multiplyPoint(v.invert(C),q);if(8===y)q=v.multiplyPoint(v.invert(C),k[1]),this._isTextPoint&&(this._centerCoord=this._deNormalizePoint(this._centerCoord,q)),this._startLine=[this._centerCoord,q],this._moveLine=B.clone(this._startLine);else if(q=v.multiplyPoint(v.invert(C),k[y]),C=v.multiplyPoint(v.invert(C),k[(y+4)%8]),this._isTextPoint&&(this._centerCoord=
this._deNormalizePoint(this._centerCoord,q)),this._firstMoverToAnchor=Math.sqrt((q.x-this._centerCoord.x)*(q.x-this._centerCoord.x)+(q.y-this._centerCoord.y)*(q.y-this._centerCoord.y)),this._startBox=C,this._startBox.width=k[4].x-k[0].x,this._startBox.height=k[4].y-k[0].y,this._moveBox=B.clone(this._startBox),this._xfactor=q.x>C.x?1:-1,this._yfactor=q.y>C.y?1:-1,1===y||5===y)this._xfactor=0;else if(3===y||7===y)this._yfactor=0;this._toolbar._beginOperation("BOX");this._toolbar["on"+(8===y?this._rotateEvent:
this._scaleEvent)+"FirstMove"](this._graphic)},_moveHandler:function(k,y){k=k.host._index;var u=this._defaultEventArgs;u.angle=0;u.scaleX=1;u.scaleY=1;if(8===k){var C=this._startLine;var q=this._moveLine;var w=q[1];w.x+=y.dx;w.y+=y.dy;y=this._getAngle(C,q);this._isTextPoint&&(y+=this._graphic.symbol.angle);q=v.rotategAt(y,C[0]);this._graphic.getDojoShape().setTransform(q);u.transform=q;u.angle=y;u.around=C[0]}else{C=this._startBox;q=this._moveBox;q.width+=y.dx*this._xfactor;q.height+=y.dy*this._yfactor;
this._uniformScaling||this._isTextPoint?(C=q.x+this._xfactor*q.width,q=q.y+this._yfactor*q.height,C=Math.sqrt((C-this._centerCoord.x)*(C-this._centerCoord.x)+(q-this._centerCoord.y)*(q-this._centerCoord.y)),this._scaleRatio=y=w=C/this._firstMoverToAnchor,C=this._centerCoord):(y=q.width/C.width,w=q.height/C.height,C={x:C.x,y:C.y});if(isNaN(y)||Infinity===y||-Infinity===y)y=1;if(isNaN(w)||Infinity===w||-Infinity===w)w=1;q=v.scaleAt(y,w,C);if(this._isTextPoint){var x=v.rotategAt(this._graphic.symbol.angle,
C);this._graphic.getDojoShape().setTransform([x,q])}else this._graphic.getDojoShape().setTransform(q);u.transform=q;u.scaleX=y;u.scaleY=w;u.around=C}this._toolbar["on"+(8===k?this._rotateEvent:this._scaleEvent)](this._graphic,u)},_moveStopHandler:function(k){this._toolbar._activateScrollWheel();var y=this._graphic,u=this._toolbar,C=u._geo?m.geographicToWebMercator(y.geometry):y.geometry,q=C.spatialReference,w=y.getDojoShape(),x=w.getTransform(),I=y.getLayer().getNavigationTransform();this._isTextPoint?
(y=this._graphic.symbol,8===k.host._index?y.angle+=this._getAngle(this._startLine,this._moveLine):y.font.setSize(Math.round(y.font.size*this._scaleRatio*100)/100),this._graphic.setSymbol(y)):(C=C.toJson(),this._updateSegments(C.paths||C.rings,x,I,q),w.setTransform(null),C=n.fromJson(C),y.setGeometry(u._geo?m.webMercatorToGeographic(C,!0):C));this._draw();this._startLine=this._moveLine=this._startBox=this._moveBox=this._xfactor=this._yfactor=null;u._endOperation("BOX");this._defaultEventArgs.transform=
x;u["on"+(8===k.host._index?this._rotateEvent:this._scaleEvent)+"Stop"](this._graphic,this._defaultEventArgs)},_updateSegments:function(k,y,u,C){var q=this._map,w=this._wrapOffset||0;F.forEach(k,function(x){F.forEach(x,function(I){this._updatePoint(I,C,w,v,q,u,y)},this)},this)},_updatePoint:function(k,y,u,C,q,w,x){y=q.toScreen({x:k[0],y:k[1],spatialReference:y},!0);y.x+=u;y=C.multiplyPoint([w,x,C.invert(w)],y);y.x-=u;u=q.toMap(y);k[0]=u.x;k[1]=u.y},_getAngle:function(k,y){return 180*Math.atan2(y[0].y-
y[1].y,y[0].x-y[1].x)/Math.PI-180*Math.atan2(k[0].y-k[1].y,k[0].x-k[1].x)/Math.PI},_deNormalizePoint:function(k,y){var u=this._map._getFrameWidth();if(-1===u)return k;for(k={x:k.x,y:k.y};Math.abs(k.x-y.x)>=u;)k.x=k.x<y.x?k.x+u:k.x-u;var C=Math.abs(k.x-y.x);Math.abs(k.x-y.x+u)<C?k.x+=u:Math.abs(k.x-y.x-u)<C&&(k.x-=u);return k}});h("extend-esri")&&B.setObject("toolbars._Box",O,p);return O})},"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(O,B,F,E,f,h,r,c,v,p){return B("dojox.gfx.Moveable",null,{constructor:function(g,e){this.shape=g;this.delay=e&&0<e.delay?e.delay:0;this.mover=e&&e.mover?e.mover:v;this.leftButtonOnly=e&&e.leftButtonOnly;this.events=[this.shape.on(h.press,O.hitch(this,"onMouseDown"))]},destroy:function(){F.forEach(this.events,function(g){g.remove()});this.events=this.shape=null},onMouseDown:function(g){this.delay?(this.events.push(this.shape.on(h.move,O.hitch(this,"onMouseMove")),this.shape.on(h.release,O.hitch(this,
"onMouseUp"))),this._lastX=g.clientX,this._lastY=g.clientY):this.leftButtonOnly&&!p.isLeft(g)||new this.mover(this.shape,g,this);E.stop(g)},onMouseMove:function(g){var e=g.clientY;if(Math.abs(g.clientX-this._lastX)>this.delay||Math.abs(e-this._lastY)>this.delay)this.onMouseUp(g),new this.mover(this.shape,g,this);E.stop(g)},onMouseUp:function(g){this.events.pop().remove()},onMoveStart:function(g){f.publish("/gfx/move/start",g);r.add(c.body(),"dojoMove")},onMoveStop:function(g){f.publish("/gfx/move/stop",
g);r.remove(c.body(),"dojoMove")},onFirstMove:function(g){},onMove:function(g,e,b){this.onMoving(g,e,b);this.shape.applyLeftTransform(e);this.onMoved(g,e)},onMoving:function(g,e){},onMoved:function(g,e){}})})},"dojox/gfx/Mover":function(){define("dojo/_base/lang dojo/_base/array dojo/_base/declare dojo/on dojo/touch dojo/_base/event".split(" "),function(O,B,F,E,f,h){return F("dojox.gfx.Mover",null,{constructor:function(r,c,v){this.shape=r;this.lastX=c.clientX;this.lastY=c.clientY;r=this.host=v;c=
document;v=E(c,f.move,O.hitch(this,"onFirstMove"));this.events=[E(c,f.move,O.hitch(this,"onMouseMove")),E(c,f.release,O.hitch(this,"destroy")),E(c,"dragstart",O.hitch(h,"stop")),E(c,"selectstart",O.hitch(h,"stop")),v];if(r&&r.onMoveStart)r.onMoveStart(this)},onMouseMove:function(r){var c=r.clientX,v=r.clientY;this.host.onMove(this,{dx:c-this.lastX,dy:v-this.lastY},r);this.lastX=c;this.lastY=v;h.stop(r)},onFirstMove:function(){this.host.onFirstMove(this);this.events.pop().remove()},destroy:function(){B.forEach(this.events,
function(c){c.remove()});var r=this.host;if(r&&r.onMoveStop)r.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(O,B,F,E,f,h,r,c,v,p,g,e,b,a){var m=O(null,{declaredClass:"esri.toolbars._GraphicMover",
constructor:function(n,l,k,y){this.graphic=n;this.map=l;this.toolbar=k;this.tempPt=y;this._enableGraphicMover();this._moved=!1},refresh:function(n){var l=this.graphic.getDojoShape();!l||!n&&l._hostGraphic||(this._disableGraphicMover(),this._enableGraphicMover())},destroy:function(){this._disableGraphicMover()},hasMoved:function(){return this._moved},_enableGraphicMover:function(){var n=this.graphic,l=n.getDojoShape();l&&(l._hostGraphic=n,this._moveable=new h(l,{mover:m.Mover}),this._moveStartHandle=
F.connect(this._moveable,"onMoveStart",this,this._moveStartHandler),this._firstMoveHandle=F.connect(this._moveable,"onFirstMove",this,this._firstMoveHandler),this._movingHandle=F.connect(this._moveable,"onMoving",this,this._movingHandler),this._moveStopHandle=F.connect(this._moveable,"onMoveStop",this,this._moveStopHandler),(n=l.getEventSource())&&f.set(n,"cursor",this.toolbar._cursors.move))},_disableGraphicMover:function(){var n=this._moveable;if(n){F.disconnect(this._moveStartHandle);F.disconnect(this._firstMoveHandle);
F.disconnect(this._movingHandle);F.disconnect(this._moveStopHandle);var l=n.shape;l&&(l._hostGraphic=null,(l=l.getEventSource())&&f.set(l,"cursor","inherit"));n.destroy()}this._moveable=null},_moveStartHandler:function(){var n=this.graphic,l=this.map;this._startTx=n.getDojoShape().getTransform();"point"===this.graphic.geometry.type&&l.snappingManager&&l.snappingManager._setUpSnapping();this.toolbar.onGraphicMoveStart(n)},_firstMoveHandler:function(){this.toolbar._beginOperation("MOVE");this.toolbar.onGraphicFirstMove(this.graphic)},
_movingHandler:function(n,l,k){n=n.shape.getTransform();l=this.map;var y;g("esri-pointer")?y=l.navigationManager.pointerEvents._processTouchEvent(k,k):k&&"pointermove"===k.type&&(y=p.prototype._processTouchEvent.call({map:l},k,k));y&&l.snappingManager&&l.snappingManager._onSnappingMouseMoveHandler(y);this.tempPt&&this.tempPt.getDojoShape().setTransform(n);this.toolbar.onGraphicMove(this.graphic,n)},_moveStopHandler:function(n){var l=this.graphic,k=this.toolbar,y=this.map,u=k._geo?e.geographicToWebMercator(l.geometry):
l.geometry,C=u.type,q=l.getDojoShape(),w=q.getTransform();if(E.toJson(w)!==E.toJson(this._startTx)){this._moved=!0;switch(C){case "point":C=[w,c.invert(this._startTx)];if(y.snappingManager)var x=y.snappingManager._snappingPoint;u=x||y.toMap(c.multiplyPoint(C,y.toScreen(u,!0)));y.snappingManager&&y.snappingManager._killOffSnapping();break;case "polyline":u=this._updatePolyGeometry(u,u.paths,w);break;case "polygon":u=this._updatePolyGeometry(u,u.rings,w)}q.setTransform(null);l.setGeometry(k._geo?e.webMercatorToGeographic(u,
!0):u);this.tempPt&&this.tempPt.setGeometry(new a(l.geometry.toJson()))}else this._moved=!1;k._endOperation("MOVE");k.onGraphicMoveStop(l,w);this._moved||(n=n.__e,y=this.map.position,n=new b(n.pageX-y.x,n.pageY-y.y),k.onGraphicClick(l,{screenPoint:n,mapPoint:this.map.toMap(n)}))},_updatePolyGeometry:function(n,l,k){var y=this.map,u=n.getPoint(0,0);y=y.toMap(y.toScreen(u).offset(k.dx,k.dy));k=y.x-u.x;u=y.y-u.y;var C;for(y=0;y<l.length;y++){var q=l[y];for(C=0;C<q.length;C++){var w=n.getPoint(y,C);n.setPoint(y,
C,w.offset(k,u))}}return n}});m.Mover=O(r,{declaredClass:"esri.toolbars._Mover",constructor:function(n,l,k){this.__e=l}});g("extend-esri")&&(B.setObject("toolbars._GraphicMover",m,v),B.setObject("toolbars._Mover",m.Mover,v));return m})},"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(O,
B,F,E,f,h,r,c,v,p,g,e){var b=O(null,{declaredClass:"esri.toolbars._GraphicVertexEditor",constructor:function(a,m,n){this.graphic=a;this.map=m;this.toolbar=n;a=n._options;this._symbol1=a.vertexSymbol;this._symbol2=a.ghostVertexSymbol;m=a.ghostLineSymbol;this._lineStroke={style:m.style,width:m.width,color:m.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=F.connect(v,"onFirstMove",this,this._firstMoveHandler);this._moveStopHandle=F.connect(v,"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=F.connect(a,"onMouseOver",this,this._mouseOverHandler);this._mouseOutHandle=F.connect(a,"onMouseOut",this,this._mouseOutHandler);this._canDel&&(this._ctxMenu=new h({style:"font-size: 12px; margin-left: 5px; margin-top: 5px;"}),a=this._ctxDelete=new r({label:e.toolbars.edit.deleteLabel,iconClass:"vertexDeleteIcon",style:"outline: none;"}),this._deleteHandle=
F.connect(a,"onClick",this,this._deleteHandler),this._ctxMenu.addChild(a),this._ctxMenu.startup())},_removeControllers:function(){F.disconnect(this._firstMoveHandle);F.disconnect(this._moveStopHandle);F.disconnect(this._mouseOverHandle);F.disconnect(this._mouseOutHandle);F.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,m,n){var l,k,y=this.graphic,u=[];for(l=0;l<a.length;l++){var C=a[l],q=[];for(k=0;k<C.length;k++)q.push(new v(C[k],m,y,l,k,C.length,this,n));u.push(q)}return u},_remove:function(a){a&&E.forEach(a,function(m){E.forEach(m,function(n){n.destroy()})})},_refresh:function(a){a&&E.forEach(a,function(m){E.forEach(m,function(n){n.refresh()})})},_isNew:function(a){return-1===E.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 m=this._findMover(a);m&&(this.toolbar.onVertexMouseOver(this.graphic,m._getInfo()),m._placeholder||(this._selectedMover=m,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 m=[];var n=this._mpVertexMovers;E.forEach(this._vertexMovers,function(k){m=m.concat(k)});n&&E.forEach(n,function(k){m=m.concat(k)});
for(n=0;n<m.length;n++){var l=m[n];if(l.graphic===a)return l}},_firstMoveHandler:function(a){!this._isNew(a)&&this._canAdd&&this._hideRelatedMidpoints(a);this.toolbar._beginOperation("VERTICES")},_moveStopHandler:function(a,m){var n=this._isNew(a);m&&(m.dx||m.dy)?(this._updateRelatedGraphic(a,a.relatedGraphic,a.graphic.geometry,a.segIndex,a.ptIndex,a.segLength,n),this._canAdd&&(n?this._addMidpoints(a):(this._repositionRelatedMidpoints(a),this._showRelatedMidpoints(a))),this.toolbar._endOperation("VERTICES")):
!n&&this._canAdd&&this._showRelatedMidpoints(a)},_showRelatedMidpoints:function(a){var m=this._getAdjacentMidpoints(a.ptIndex,a.segLength),n=this._mpVertexMovers[a.segIndex];for(a=0;a<m.length;a++){var l=n[m[a]];l.graphic.show();l.refresh()}},_hideRelatedMidpoints:function(a){var m=this._getAdjacentMidpoints(a.ptIndex,a.segLength),n=this._mpVertexMovers[a.segIndex];for(a=0;a<m.length;a++)n[m[a]].graphic.hide()},_repositionRelatedMidpoints:function(a){var m,n=this._getAdjacentMidpoints(a.ptIndex,a.segLength),
l=this._mpVertexMovers[a.segIndex];for(m=0;m<n.length;m++){var k=this._getAdjacentVertices(n[m],a.segLength),y=a.relatedGraphic.geometry.getPoint(a.segIndex,k[0]);k=a.relatedGraphic.geometry.getPoint(a.segIndex,k[1]);y=new p({x:(y.x+k.x)/2,y:(y.y+k.y)/2,spatialReference:y.spatialReference.toJson()});l[n[m]].graphic.setGeometry(y)}},_addMidpoints:function(a){var m=a.segIndex,n=a.ptIndex,l=a.segLength,k=n+1,y,u=l+1;this._mpVertexMovers[m].splice(n,1);var C=this._vertexMovers[m];for(y=0;y<k;y++)C[y].segLength+=
1;for(y=k;y<C.length;y++)C[y].ptIndex+=1,C[y].segLength+=1;a.ptIndex=k;a.segLength=C.length+1;C.splice(k,0,a);a.graphic.setSymbol(this._symbol1);C=this._mpVertexMovers[m];for(y=0;y<n;y++)C[y].segLength+=1;for(y=n;y<l-1;y++)C[y].ptIndex+=1,C[y].segLength+=1;k=this._getAdjacentVertices(n,u);m=this._getAdjacentVertices(n+1,u);l=a.relatedGraphic.geometry.getPoint(a.segIndex,k[0]);y=a.relatedGraphic.geometry.getPoint(a.segIndex,k[1]);k=new p({x:(l.x+y.x)/2,y:(l.y+y.y)/2,spatialReference:l.spatialReference.toJson()});
l=a.relatedGraphic.geometry.getPoint(a.segIndex,m[0]);y=a.relatedGraphic.geometry.getPoint(a.segIndex,m[1]);m=new p({x:(l.x+y.x)/2,y:(l.y+y.y)/2,spatialReference:l.spatialReference.toJson()});l=new v(k,this._symbol2,this.graphic,a.segIndex,n,u,this,!0);a=new v(m,this._symbol2,this.graphic,a.segIndex,n+1,u,this,!0);C.splice(n,0,l,a)},_deleteVertex:function(a){var m,n=a.ptIndex,l=this._vertexMovers[a.segIndex];for(m=0;m<n;m++)--l[m].segLength;for(m=n+1;m<l.length;m++){var k=l[m];--k.ptIndex;--k.segLength}l.splice(n,
1);m=a._getInfo();a.destroy();this.toolbar.onVertexDelete(this.graphic,m)}});B.mixin(b,{create:function(a,m,n){switch(a.geometry.type){case "multipoint":return new b.MultipointVertexEditor(a,m,n);case "polyline":return new b.PolylineVertexEditor(a,m,n);case "polygon":return new b.PolygonVertexEditor(a,m,n)}}});b.MultipointVertexEditor=O(b,{declaredClass:"esri.toolbars._MultipointVertexEditor",minLength:1,constructor:function(){this._moveStartHandle=F.connect(v,"onMoveStart",this,this._moveStartHandler);
F.disconnect(this._firstMoveHandle)},destroy:function(){this.inherited(arguments);F.disconnect(this._moveStartHandle)},_getSegments:function(a){var m=a.points,n=[],l=a.spatialReference;for(a=0;a<m.length;a++){var k=m[a];n.push(new p({x:k[0],y:k[1],spatialReference:l.toJson()}))}return[n]},_getMidpointSegments:function(a){return[]},_getControlPoints:function(a,m,n,l,k){return[]},_getGraphicsLayer:function(){return this.graphic._graphicsLayer},_mouseOverHandler:function(a){var m=a.graphic;if(a=this._findMover(a))this.toolbar.onVertexMouseOver(m,
a._getInfo()),this._selectedMover=a,this._canDel&&this._bindCtxNode(a.graphic.getDojoShape().getNode())},_mouseOutHandler:function(a){var m=a.graphic;if(a=this._findMover(a))this.toolbar.onVertexMouseOut(m,a._getInfo())},_findMover:function(a){var m=[].concat(this._vertexMovers[0]),n=a.target;for(a=0;a<m.length;a++){var l=m[a];if(l.graphic.getDojoShape().getNode()===n)return l}},_moveStartHandler:function(a){var m=a.ptIndex,n=a.segLength-1,l=a.relatedGraphic.geometry.points;a=l.splice(m,1);l.push(a[0]);
l=this._vertexMovers[0];for(a=n;a>m;a--)--l[a].ptIndex;a=l.splice(m,1);l.push(a[0]);a[0].ptIndex=n},_moveStopHandler:function(a){this._updateRelatedGraphic(a,a.relatedGraphic,a.graphic.geometry,a.segIndex,a.ptIndex,a.segLength);this.toolbar._endOperation("VERTICES")},_updateRelatedGraphic:function(a,m,n,l,k,y,u,C){a=m.geometry;C?a.removePoint(k):a.setPoint(k,n);m.setGeometry(a)},_deleteMidpoints:function(a){}});b.PolylineVertexEditor=O(b,{declaredClass:"esri.toolbars._PolylineVertexEditor",minLength:2,
_getSegments:function(a){var m,n,l=a.paths,k=[];for(m=0;m<l.length;m++){var y=l[m],u=[];for(n=0;n<y.length;n++)u.push(a.getPoint(m,n));k.push(u)}return k},_getMidpointSegments:function(a){var m,n,l=a.paths,k=[],y=a.spatialReference;for(m=0;m<l.length;m++){var u=l[m],C=[];for(n=0;n<u.length-1;n++){var q=a.getPoint(m,n),w=a.getPoint(m,n+1);q=new p({x:(q.x+w.x)/2,y:(q.y+w.y)/2,spatialReference:y.toJson()});C.push(q)}k.push(C)}return k},_getControlPoints:function(a,m,n,l,k){var y=this.map,u,C;this._isNew(a)?
(a=l,l+=1,0<=a&&(u=y.toScreen(m.getPoint(n,a))),l<=k&&(C=y.toScreen(m.getPoint(n,l)))):(a=l-1,l+=1,0<=a&&(u=y.toScreen(m.getPoint(n,a))),l<k&&(C=y.toScreen(m.getPoint(n,l))));return[u,C]},_getAdjacentMidpoints:function(a,m){var n=[],l=a-1;0<=l&&n.push(l);a<m-1&&n.push(a);return n},_getAdjacentVertices:function(a,m){return[a,a+1]},_deleteMidpoints:function(a){var m=this._mpVertexMovers[a.segIndex],n=m.length-1,l=this._getAdjacentMidpoints(a.ptIndex,a.segLength).sort(),k,y=l[0];for(k=0;k<y;k++)--m[k].segLength;
for(k=y+1;k<m.length;k++){var u=m[k];--u.ptIndex;--u.segLength}if(1===l.length)m.splice(y,1)[0].destroy();else for(u=this._getAdjacentVertices(y,n),k=a.relatedGraphic.geometry.getPoint(a.segIndex,u[0]),u=a.relatedGraphic.geometry.getPoint(a.segIndex,u[1]),k=new p({x:(k.x+u.x)/2,y:(k.y+u.y)/2,spatialReference:k.spatialReference.toJson()}),a=new v(k,this._symbol2,this.graphic,a.segIndex,y,n,this,!0),m=m.splice(y,l.length,a),k=0;k<m.length;k++)m[k].destroy()},_updateRelatedGraphic:function(a,m,n,l,k,
y,u,C){a=m.geometry;u?a.insertPoint(l,k+1,g.fromJson(n.toJson())):C?a.removePoint(l,k):a.setPoint(l,k,g.fromJson(n.toJson()));m.setGeometry(a)}});b.PolygonVertexEditor=O(b,{declaredClass:"esri.toolbars._PolygonVertexEditor",minLength:3,_getSegments:function(a){var m,n,l=a.rings,k=[];for(m=0;m<l.length;m++){var y=l[m],u=[];for(n=0;n<y.length-1;n++)u.push(a.getPoint(m,n));k.push(u)}return k},_getMidpointSegments:function(a){var m,n,l=a.rings,k=[],y=a.spatialReference;for(m=0;m<l.length;m++){var u=l[m],
C=[];for(n=0;n<u.length-1;n++){var q=a.getPoint(m,n),w=a.getPoint(m,n+1);q=new p({x:(q.x+w.x)/2,y:(q.y+w.y)/2,spatialReference:y.toJson()});C.push(q)}k.push(C)}return k},_getControlPoints:function(a,m,n,l,k){var y=this.map;this._isNew(a)?a=l:(a=l-1,a=0>a?(k+a)%k:a);l=(l+1)%k;k=y.toScreen(m.getPoint(n,a));m=y.toScreen(m.getPoint(n,l));return[k,m]},_getAdjacentMidpoints:function(a,m){var n=a-1;return[0>n?(m+n)%m:n,a]},_getAdjacentVertices:function(a,m){return[a,(a+1)%m]},_deleteMidpoints:function(a){var m=
a.ptIndex,n=this._mpVertexMovers[a.segIndex],l=n.length-1,k=this._getAdjacentMidpoints(m,a.segLength).sort();var y=k[0];var u=k[k.length-1];if(0===m){var C=this._getAdjacentVertices(l-1,l);m=a.relatedGraphic.geometry.getPoint(a.segIndex,C[0]);C=a.relatedGraphic.geometry.getPoint(a.segIndex,C[1]);m=new p({x:(m.x+C.x)/2,y:(m.y+C.y)/2,spatialReference:m.spatialReference.toJson()});a=new v(m,this._symbol2,this.graphic,a.segIndex,l-1,l,this,!0);n.splice(u,1,a)[0].destroy();n.splice(y,1)[0].destroy();for(k=
0;k<n.length-1;k++)y=n[k],--y.ptIndex,--y.segLength}else{C=this._getAdjacentVertices(y,l);m=a.relatedGraphic.geometry.getPoint(a.segIndex,C[0]);C=a.relatedGraphic.geometry.getPoint(a.segIndex,C[1]);m=new p({x:(m.x+C.x)/2,y:(m.y+C.y)/2,spatialReference:m.spatialReference.toJson()});a=new v(m,this._symbol2,this.graphic,a.segIndex,y,l,this,!0);u=n.splice(y,k.length,a);for(k=0;k<u.length;k++)u[k].destroy();for(k=0;k<y;k++)--n[k].segLength;for(k=y+1;k<n.length;k++)y=n[k],--y.ptIndex,--y.segLength}},_updateRelatedGraphic:function(a,
m,n,l,k,y,u,C){a=m.geometry;u?a.insertPoint(l,k+1,g.fromJson(n.toJson())):C?(a.removePoint(l,k),0===k&&a.setPoint(l,y-1,g.fromJson(a.getPoint(l,0).toJson()))):(a.setPoint(l,k,g.fromJson(n.toJson())),0===k&&a.setPoint(l,y,g.fromJson(n.toJson())));m.setGeometry(a)}});f("extend-esri")&&(B.setObject("toolbars._GraphicVertexEditor",b,c),B.setObject("toolbars._MultipointVertexEditor",b.MultipointVertexEditor,c),B.setObject("toolbars._PolylineVertexEditor",b.PolylineVertexEditor,c),B.setObject("toolbars._PolygonVertexEditor",
b.PolygonVertexEditor,c));return b})},"esri/toolbars/_VertexMover":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/sniff dojo/dom-style dojox/gfx/Moveable dojox/gfx/matrix ../kernel ../PointerEvents ../sniff ../geometry/Point ../graphic ../geometry/webMercatorUtils".split(" "),function(O,B,F,E,f,h,r,c,v,p,g,e,b){O=O(null,{declaredClass:"esri.toolbars.VertexMover",constructor:function(a,m,n,l,k,y,u,C){this.point=a;this.symbol=m;this.relatedGraphic=n;this.segIndex=l;this.ptIndex=
k;this.segLength=y;this.editor=u;this.map=u.map;this._scratchGL=u.toolbar._scratchGL;this._placeholder=C||!1;this._type=n.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 a=new g(this.point.toJson());
a=new e(a,this.symbol);switch(this._type){case "multipoint":a._shape=this.relatedGraphic.getDojoShape().children[this.ptIndex];break;case "polyline":case "polygon":this._scratchGL.add(a)}this.graphic=a},_enable:function(){var a=this.graphic.getDojoShape();a&&(a._hasMover=!0,this._moveable=this._getMoveable(a),(a=a.getEventSource())&&f.set(a,"cursor",this.editor.toolbar._cursors[this._placeholder?"move-gv":"move-v"]))},_disable:function(){var a=this._moveable;if(a){F.disconnect(this._startHandle);
F.disconnect(this._firstHandle);F.disconnect(this._movingHandle);F.disconnect(this._stopHandle);var m=a.shape;m&&(m=m.getEventSource())&&f.set(m,"cursor","inherit");a.destroy();this._moveable=null}},_needRefresh:function(){var a=this.graphic.getDojoShape(),m=!1;if(a)switch(this._type){case "multipoint":var n=this.relatedGraphic.getDojoShape();n&&(n=n.children[this.ptIndex],a!==n&&(this.graphic._shape=n,m=!0));break;case "polyline":case "polygon":m=!a._hasMover}return m},_getMoveable:function(a){a=
new h(a,E("mac")&&E("ff")&&!p("esri-touch")&&{leftButtonOnly:!0});this._startHandle=F.connect(a,"onMoveStart",this,this._moveStartHandler);this._firstHandle=F.connect(a,"onFirstMove",this,this._firstMoveHandler);this._movingHandle=F.connect(a,"onMoving",this,this._movingHandler);this._stopHandle=F.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 m=this.map;m.snappingManager&&m.snappingManager._setUpSnapping();this.editor.toolbar._deactivateScrollWheel();this._startTx=this.graphic.getDojoShape().getTransform();a.shape.moveToFront();this.constructor.onMoveStart(this);this.editor.toolbar.onVertexMoveStart(this.relatedGraphic,this._getInfo())},_firstMoveHandler:function(a){var m=a.shape,n=this._getControlEdges(),l=this._scratchGL._div,k,y=[],u=a.host.shape._wrapOffsets[0]||
0;for(k=0;k<n.length;k++){var C=n[k];C.x1+=u;C.x2+=u;y.push([l.createLine({x1:C.x1,y1:C.y1,x2:C.x2,y2:C.y2}).setStroke(this.editor._lineStroke),C.x1,C.y1,C.x2,C.y2])}m._lines=y;a.shape.moveToFront();this.constructor.onFirstMove(this);this.editor.toolbar.onVertexFirstMove(this.relatedGraphic,this._getInfo())},_movingHandler:function(a,m,n){m=this.map;var l;p("esri-pointer")?l=m.navigationManager.pointerEvents._processTouchEvent(n,n):n&&"pointermove"===n.type&&(l=v.prototype._processTouchEvent.call({map:m},
n,n));l&&m.snappingManager&&m.snappingManager._onSnappingMouseMoveHandler(l);n=a.shape;a=n.getTransform();n=n._lines;for(l=0;l<n.length;l++)m=n[l],m[0].setShape({x1:m[1]+a.dx,y1:m[2]+a.dy,x2:m[3],y2:m[4]});this.editor.toolbar.onVertexMove(this.relatedGraphic,this._getInfo(),a)},_moveStopHandler:function(a){a=a.shape;var m=this.editor.toolbar,n=a.getTransform(),l=this.map,k=this.graphic,y=m._geo?b.geographicToWebMercator(k.geometry):k.geometry;m._activateScrollWheel();var u,C=a._lines;if(C){for(u=
0;u<C.length;u++)C[u][0].removeShape();a._lines=null}u=!1;C=!0;var q=this._getInfo();n&&(n.dx||n.dy)?this._placeholder&&(this._placeholder=!1,u=!0):C=!1;if(l.snappingManager)var w=l.snappingManager._snappingPoint;var x=[n,r.invert(this._startTx)];w=w||l.toMap(r.multiplyPoint(x,l.toScreen(y,!0)));l.snappingManager&&l.snappingManager._killOffSnapping();a.setTransform(null);k.setGeometry(m._geo?b.webMercatorToGeographic(w,!0):w);this.constructor.onMoveStop(this,n);m.onVertexMoveStop(this.relatedGraphic,
q,n);if(!C)m.onVertexClick(this.relatedGraphic,q);if(u)m.onVertexAdd(this.relatedGraphic,this._getInfo())},_getControlEdges:function(){var a=this.map,m=this.relatedGraphic.geometry,n=this.segIndex,l=this.ptIndex,k=this.segLength,y=this._scratchGL.getNavigationTransform(),u=y.dx;y=y.dy;var C=a.toScreen(this.graphic.geometry);a=C.x-u;C=C.y-y;var q=[];m=this.editor._getControlPoints(this,m,n,l,k);m[0]&&q.push({x1:a,y1:C,x2:m[0].x-u,y2:m[0].y-y});m[1]&&q.push({x1:a,y1:C,x2:m[1].x-u,y2:m[1].y-y});return q}});
p("extend-esri")&&B.setObject("toolbars.VertexMover",O,c);B.mixin(O,{onMoveStart:function(){},onFirstMove:function(){},onMoveStop:function(){}});return O})},"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(O,B,F,E,f,h,r,c,v,p){O=O(null,{declaredClass:"esri.toolbars.TextEditor",constructor:function(g,e,b){this._graphic=g;this._map=e;
this._toolbar=b;this._enable(this._graphic)},destroy:function(){this._disable()},onEditStart:function(){},onEditEnd:function(){},_enable:function(g){this._editBox?(F.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null):(this._map.navigationManager.setImmediateClick(!0),this._addEditBoxHandler=F.connect(g.getLayer(),"onDblClick",this,function(e){this._map.navigationManager.setImmediateClick(!1);e.graphic==g&&(E.stop(e),F.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null,
this._addTextBox(g))}))},_disable:function(){this._applyEdit();this._addEditBoxHandler&&(F.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null);this._removeTextBox();this.onEditEnd(this._graphic);this._toolbar.onTextEditEnd(this._graphic)},_addTextBox:function(g,e){if(!this._editBox){if(!g.symbol.text){g.symbol.text="Tempt text";g.setSymbol(g.symbol);var b=""}var a=this._createInputTextStyle(g,this._map);""!==b&&(b=e||g.symbol.text);this._editBox=h.create("input",{type:"text",value:b});
c.set(this._editBox,a);r.add(this._editBox,"esriTextEditorInput");this._map.container.appendChild(this._editBox);this._editBox.focus();this._editBoxKeyHandler=F.connect(this._editBox,"onkeyup",B.hitch(this,function(n){n.keyCode!=v.ENTER&&n.keyCode!==v.TAB||this._disable()}));this._editBoxBlurHandler=F.connect(this._editBox,"onblur",B.hitch(this,function(n){this._disable()}));g.symbol.text="";g.setSymbol(g.symbol);g.hide();var m=this._editBox;this._disableBoxHandler||(this._disableBoxHandler=this._map.on("zoom-start",
B.hitch(this,function(){this._disable()})));this._moveBoxHandler=this._map.on("pan",function(n){c.set(m,{left:this._editBoxLeft+n.delta.x+"px",top:this._editBoxTop+n.delta.y+"px"})});this._moveBoxStartHandler=this._map.on("pan-start",function(){this._editBoxLeft=parseFloat(c.get(m,"left"));this._editBoxTop=parseFloat(c.get(m,"top"))});this.onEditStart(g,this._editBox);this._toolbar.onTextEditStart(g,this._editBox)}},_removeTextBox:function(){this._editBoxBlurHandler&&(F.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&&(F.disconnect(this._editBoxKeyHandler),this._editBoxKeyHandler=null)},_createInputTextStyle:function(g,
e){e=g.getDojoShape().getTransformedBoundingBox();var b=g.getLayer();b=b.hasLocalNavigationTransform()?{dx:0,dy:0}:b.getNavigationTransform();var a=g.symbol.font;return{"font-family":a.family,"font-size":a.size+"px","font-style":a.style,"font-variant":a.variant,"font-weight":a.weight,left:e[0].x+b.dx+"px",top:e[0].y+b.dy+"px",width:Math.abs(e[0].x-e[1].x)/Math.cos(g.symbol.angle/180*Math.PI)+"px"}},_applyEdit:function(){if(this._editBox)if(this._editBox.value){this._graphic.show();var g=this._graphic.symbol;
g.text=this._editBox.value;this._graphic.setSymbol(g)}else this._graphic.getLayer().remove(this._graphic)}});f("extend-esri")&&B.setObject("toolbars.TextEditor",O,p);return O})},"widgets/SmartEditor/PresetAllFields":function(){define("dojo/_base/declare dojo/Evented dojo/_base/lang dojo/_base/array dojo/dom-construct dojo/dom-class dojo/on dojo/keys dojo/string dojo/dom-attr dojo/mouse ./presetUtils ./RelativeDates dijit/_TemplatedMixin jimu/BaseWidgetSetting dijit/form/FilteringSelect dojo/store/Memory dijit/form/ValidationTextBox dijit/form/NumberTextBox dijit/form/SimpleTextarea esri/urlUtils jimu/dijit/Message jimu/utils".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y,u,C,q,w){return O([m,B,a],{baseClass:"jimu-widget-smartEditor-setting-preset",tooltipContents:{},hasAtLeastOneGroupInDisplay:!1,enableUsePresetValueCheckBox:!1,postCreate:function(){this.inherited(arguments);this.enableUsePresetValueCheckBox=this.hasAtLeastOneGroupInDisplay=!1;this.tooltipContents={};this.presetContainer=f.create("div",{"class":"esriCTPresetContent"},this.parentNode);this._createPresetContents()},_fetchUrlParameters:function(){var x=
C.urlToObject(document.location.href);if(x.query)var I=x.query;return I},_createPresetContents:function(){var x=this._fetchUrlParameters();for(var I=0;I<this.presetOrder.length;I++){var A=this.presetOrder[I];var M=this._isGroupNameFound(x,A);M=x&&M.isConfiguredGroupName?this._createPresetContentDOM(this._configuredPresetInfos[A],x[M.urlParamKey]):this._createPresetContentDOM(this._configuredPresetInfos[A]);this._configuredPresetInfos[A].hideInPresetDisplay?h.add(M,"esriCTHidden"):this.hasAtLeastOneGroupInDisplay=
!0;this._createTooltipContent(this._configuredPresetInfos[A])}},_hasFieldsInPresetGroup:function(x){var I=!1,A;for(A in x.appliedOn)if(0<x.appliedOn[A].length){I=!0;break}return I},_isGroupNameFound:function(x,I){var A=!1,M;x&&E.forEach(Object.keys(x),F.hitch(this,function(H){if(H.toLowerCase()===I.toLowerCase())return A=!0,M=H,!0}));return{isConfiguredGroupName:A,urlParamKey:M}},_createPresetContentDOM:function(x,I){var A=f.create("tr"),M=f.create("td"),H=f.create("div",{"class":"esriCTGroupInfoIcon",
"aria-label":v.substitute(this.nls.groupInfoLabel,{groupName:x.name}),tabindex:"0",role:"button"},M),U=f.create("span",{innerHTML:x.name,"class":"ee-atiLabel"},M);p.set(U,"groupName",x.name);p.set(H,"groupName",x.name);this.own(r(H,"click",F.hitch(this,function(S){S=p.get(S.currentTarget,"groupName");q({message:this.tooltipContents[S].innerHTML})})));this.own(r(H,"keydown",F.hitch(this,function(S){if(S.keyCode===c.ENTER||S.keyCode===c.SPACE)S=p.get(S.currentTarget,"groupName"),q({message:this.tooltipContents[S].innerHTML})})));
f.place(M,A);M=f.create("td",{"class":"preset-value-editable"},A);if(x.showOnlyDomainFields)x=this._createDomainContentNode(x,M),void 0!==I&&x.set("value",I);else switch(x.dataType){case "esriFieldTypeInteger":void 0===I||isNaN(I)||(x.presetValue=I);this._createNumberTypeDOM(x,M);break;case "esriFieldTypeDate":void 0!==I&&(x.presetValue={dateType:"fixed",dateTime:isNaN(I)?null:Number(I)});this._createDateTypeDOM(x,M);break;case "esriFieldTypeString":void 0!==I&&(x.presetValue=I);this._createStringTypeDOM(x,
M);break;case "esriFieldTypeGUID":void 0!==I&&(x.presetValue=I),this._createGUIDTypeDOM(x,M)}this.parentNode.appendChild(A);return A},_createTooltipContent:function(x){var I,A=!1,M=f.create("div");var H=f.create("div",{"class":"presetMessageContentDiv",style:{"max-height":"200px",overflow:"auto"},tabindex:"0"},M);var U=v.substitute(this.nls.presetGroupFieldsLabel,{groupName:"\x3cb\x3e"+x.name+"\x3c/b\x3e"});var S=v.substitute(this.nls.presetGroupNoFieldsLabel,{groupName:"\x3cb\x3e"+x.name+"\x3c/b\x3e"});
U=f.create("div",{innerHTML:U},H);H=f.create("ul",{style:"margin: 0px; padding: 0 20px;"},H);for(I in x.appliedOn)if(0<x.appliedOn[I].length){A=!0;var D=this._jimuLayerInfos.getLayerOrTableInfoById(I);if(D&&D.title&&D.layerObject&&D.layerObject.fields){f.create("li",{innerHTML:D.title+": "},H);var L=f.create("ul",{style:"margin: 0px;"},H);E.forEach(D.layerObject.fields,F.hitch(this,function(J){J=w.getDefaultPortalFieldInfo(J);0<=x.appliedOn[I].indexOf(J.fieldName)&&f.create("li",{innerHTML:J.label||
J.fieldName},L)}))}}A||p.set(U,"innerHTML",S);this.tooltipContents[x.name]=M},_enableUsePresetValueCB:function(x){null!==x&&""!==x&&void 0!==x&&(this.enableUsePresetValueCheckBox=!0)},_createNumberTypeDOM:function(x,I){I=new y({"class":"ee-inputField",name:x.name,value:x.presetValue,"aria-label":x.name},f.create("div",{},I));this.own(r(I,"change",F.hitch(this,function(A){x.presetValue=A;this.emit("presetValueChanged")})));this._enableUsePresetValueCB(x.presetValue)},_createDateTypeDOM:function(x,
I){var A=new k({"class":"ee-inputField",name:x.name,disabled:!0,"aria-label":x.name,style:"width: calc(100% - 30px)",value:this.nls.relativeDates[x.presetValue.dateType]},f.create("div",{},I));"fixed"===x.presetValue.dateType&&(x.presetValue.dateTime?A.set("value",e.getDateFromRelativeInfo(x.presetValue,!0)):A.set("value",""));p.set(A.focusNode,"disabled",!1);p.set(A.focusNode,"readonly",!0);p.set(A.focusNode,"tabindex",0);A.esriCTisDateGroup=!0;A.esriCTPresetGroup=x;var M=v.substitute(this.nls.editGroupInfoIcon,
{groupName:x.name});I=f.create("div",{"class":"jimu-icon jimu-icon-edit",tabindex:"0",role:"button","aria-label":M},f.create("div",{"class":"editRelativeDateIcon"},I));this.own(r(I,"click",F.hitch(this,function(){var H=new b({nls:this.nls,relativeDates:x.presetValue,map:this.map,layerInfos:this._jimuLayerInfos,selectedPresetValue:x.presetValue&&x.presetValue.chooseFromLayerInfo?x.presetValue.chooseFromLayerInfo.selectedValue:""});this.own(r(H,"updatePresetValue",F.hitch(this,function(U){x.presetValue=
U;"fixed"===x.presetValue.dateType?x.presetValue.dateTime?A.set("value",e.getDateFromRelativeInfo(x.presetValue,!0)):A.set("value",""):A.set("value",this.nls.relativeDates[U.dateType]);this.emit("presetValueChanged")})))})));this.own(r(I,"keydown",F.hitch(this,function(H){if(H.keyCode===c.ENTER||H.keyCode===c.SPACE)H=new b({nls:this.nls,relativeDates:x.presetValue,map:this.map,layerInfos:this._jimuLayerInfos,selectedPresetValue:x.presetValue&&x.presetValue.chooseFromLayerInfo?x.presetValue.chooseFromLayerInfo.selectedValue:
""}),this.own(r(H,"updatePresetValue",F.hitch(this,function(U){x.presetValue=U;"fixed"===x.presetValue.dateType?x.presetValue.dateTime?A.set("value",e.getDateFromRelativeInfo(x.presetValue,!0)):A.set("value",""):A.set("value",this.nls.relativeDates[U.dateType]);this.emit("presetValueChanged")})))})));this.own(r(A.domNode,g.enter,F.hitch(this,function(){var H=e.getDateFromRelativeInfo(x.presetValue,!0);""===H&&(H=this.nls.relativeDates.noDateDefinedTooltip);A.set("title",H)})));this._enableUsePresetValueCB(x.presetValue)},
_createStringTypeDOM:function(x,I){I=new u({row:1,style:{resize:"vertical"},"class":"ee-inputField",name:x.name,"aria-label":x.name,value:x.presetValue},f.create("div",{},I));this.own(r(I,"change",F.hitch(this,function(A){x.presetValue!==A&&(x.presetValue=A,this.emit("presetValueChanged"))})));this._enableUsePresetValueCB(x.presetValue)},_createGUIDTypeDOM:function(x,I){I=new k({"class":"ee-inputField","aria-label":x.name,name:x.name,value:x.presetValue},f.create("div",{},I));this.own(r(I,"change",
F.hitch(this,function(A){x.presetValue=A;this.emit("presetValueChanged")})));this._enableUsePresetValueCB(x.presetValue)},_createDomainContentNode:function(x,I){var A=this._populateDomains(x);var M=new n({"class":"ee-inputField",name:x.name,"aria-label":x.name,style:{width:"99%"},required:!1,store:new l({data:A.options})},f.create("div",{},I));M.esriCTDomainList=!0;this.own(r(M,"change",F.hitch(this,function(){x.selectedDomainValue=M.get("value");this.emit("presetValueChanged")})));M.set("value",
A.defaultValue);this._enableUsePresetValueCB(x.presetValue);return M},_populateDomains:function(x){var I=[],A;E.forEach(x.presetValue,F.hitch(this,function(M){M.showInList&&(I.push({name:M.label,id:M.value}),M.isDefault&&(A=M.value,x.selectedDomainValue=M.value))}));return{options:I,defaultValue:A}}})})},"widgets/SmartEditor/presetUtils":function(){define("dojo/_base/lang jimu/utils dojo/date dojo/_base/array dojo/dom-construct dijit/form/DateTextBox dijit/form/NumberSpinner dijit/form/NumberTextBox dijit/form/FilteringSelect dijit/form/TextBox dijit/form/ValidationTextBox dijit/form/TimeTextBox dijit/Editor dijit/form/SimpleTextarea dojo/store/Memory dojo/query dijit/_editor/plugins/LinkDialog dijit/_editor/plugins/TextColor jimu/dijit/EditorTextColor jimu/dijit/EditorBackgroundColor".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n){return{integerFields:["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],getFieldInfoByFieldName:function(l,k){var y={};E.some(l,function(u){if(u.name===k)return O.mixin(y,u),!0});return y},getDateFromRelativeInfo:function(l,k){var y=new Date;"fixed"===l.dateType?y=l.dateTime?new Date(l.dateTime):"":"future"===l.dateType?(y=F.add(y,"year",l.year),y=F.add(y,"month",l.month),y=F.add(y,"day",l.day),y=F.add(y,"hour",
l.hour),y=F.add(y,"minute",l.minute),y=F.add(y,"second",l.second)):"past"===l.dateType&&(l.year&&(y=F.add(y,"year",-1*l.year)),l.month&&(y=F.add(y,"month",-1*l.month)),l.day&&(y=F.add(y,"day",-1*l.day)),l.hour&&(y=F.add(y,"hour",-1*l.hour)),l.minute&&(y=F.add(y,"minute",-1*l.minute)),l.second&&(y=F.add(y,"second",-1*l.second)));return k&&""!==y?B.localizeDate(y):y},getDateFieldValue:function(l,k){if("esriFieldTypeDate"===l.type){if(k instanceof Array){var y,u;0<k.length&&k[0]&&(y=k[0].getValue());
1<k.length&&k[1]&&(u=k[1].getValue());var C=y&&u?new Date(y.getFullYear(),y.getMonth(),y.getDate(),u.getHours(),u.getMinutes(),u.getSeconds(),u.getMilliseconds()):y||u||null}else C=k.getValue(),l.domain&&(C=Number(C));C=C&&C.getTime?C.getTime():C&&C.toGregorian?C.toGregorian().getTime():C}return C},isGuid:function(l){"{"===l[0]&&(l=l.substring(1,l.length-1));return/^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/gi.test(l)},validateGUID:function(l,
k){return this.isGuid(l)},isValidPresetValue:function(l){var k=!0;E.some(l,function(y){if(y.isValid&&!y.isValid())return k=!1,!0});return k},createPresetFieldContentNode:function(l){var k=[];if(l.domain){if("codedValue"===l.domain.type){var y=[];E.forEach(l.domain.codedValues,function(w){y.push({name:w.name,id:w.code})});var u=new v({"class":"ee-inputField",name:l.fieldName,store:new m({data:y}),searchAttr:"name",required:!0},f.create("div"))}else{u=null;switch(l.type){case "esriFieldTypeSmallInteger":case "esriFieldTypeInteger":u=
{min:l.domain.minValue,max:l.domain.maxValue,places:0};break;case "esriFieldTypeSingle":case "esriFieldTypeDouble":u={min:l.domain.minValue,max:l.domain.maxValue}}u=new r({"class":"ee-inputField",name:l.fieldName,smallDelta:1,constraints:u,required:!0},f.create("div"))}k.push(u)}else switch(l.type){case "esriFieldTypeGUID":u=new g({"class":"ee-inputField",name:l.fieldName,required:!0,trim:!0},f.create("div"));u.validator=O.hitch(this,this.validateGUID);k.push(u);break;case "esriFieldTypeDate":u=new h({"class":"ee-inputField",
name:l.fieldName,required:!0,fieldType:"date"},f.create("div"));k.push(u);l.format&&l.format.time&&!0===l.format.time&&(l=new e({"class":"ee-inputField",style:"margin-top:2px;",required:!0},f.create("div")),k.push(l));break;case "esriFieldTypeString":u=null;l.length&&Number(l.length)&&0<Number(l.length)&&(u=l.length);if(l.hasOwnProperty("stringFieldOption"))if("richtext"===l.stringFieldOption){var C=document.getElementsByTagName("head")[0];var q=window.apiUrl+"dojox/editor/plugins/resources/css/TextColor.css";
n('link[href\x3d"'+q+'"]',C)[0]||B.loadStyleLink("editor_plugins_resources_TextColor",q);q=window.apiUrl+"dojox/editor/plugins/resources/editorPlugins.css";n('link[href\x3d"'+q+'"]',C)[0]||B.loadStyleLink("editor_plugins_resources_editorPlugins",q);q=window.apiUrl+"dojox/editor/plugins/resources/css/PasteFromWord.css";n('link[href\x3d"'+q+'"]',C)[0]||B.loadStyleLink("editor_plugins_resources_PasteFromWord",q);u={"class":"ee-inputField ee-inputFieldRichText",trim:!0,maxLength:u,fieldType:"richtext",
required:!0};u["class"]+=" atiRichTextField";u.height="100%";u.width="100%";u.name=l.fieldName;u.plugins=["bold","italic","underline",B.getEditorTextColor("smartEditor"),B.getEditorBackgroundColor("smartEditor"),"|","justifyLeft","justifyCenter","justifyRight","justifyFull","|","insertOrderedList","insertUnorderedList","indent","outdent","|","createLink"];u=new b(u,f.create("div"))}else u="textarea"===l.stringFieldOption?new a({"class":"ee-inputField ee-inputFieldTextArea",name:l.fieldName,maxlength:u,
fieldType:"textarea",required:!0},f.create("div")):new g({"class":"ee-inputField",name:l.fieldName,maxlength:u,required:!0,trim:!0},f.create("div"));else u=new g({"class":"ee-inputField",name:l.fieldName,maxlength:u,required:!0,trim:!0},f.create("div"));k.push(u);break;case "esriFieldTypeSmallInteger":case "esriFieldTypeInteger":u=new c({"class":"ee-inputField",name:l.fieldName,required:!0,constraints:{places:0}},f.create("div"));k.push(u);break;case "esriFieldTypeSingle":case "esriFieldTypeDouble":u=
new c({"class":"ee-inputField",name:l.fieldName,required:!0},f.create("div"));k.push(u);break;default:u=new p({"class":"ee-unsupportField",name:l.fieldName,value:"N/A",readOnly:!0},f.create("div")),k.push(u)}return k},changeFieldToMostRestrictive:function(l,k){if(!l.hasOwnProperty("type")&&k.hasOwnProperty("type"))return k;k.length&&Number(k.length)&&0<Number(k.length)&&(l.length&&Number(l.length)?k.length<l.length&&(l.length=k.length):l.length=k.length);if(l.type===k.type)switch(k.type){case "esriFieldTypeString":l.hasOwnProperty("stringFieldOption")&&
k.hasOwnProperty("stringFieldOption")&&("richtext"===l.stringFieldOption&&"richtext"!==k.stringFieldOption?l.stringFieldOption=k.stringFieldOption:"textarea"===l.stringFieldOption&&"textbox"===k.stringFieldOption&&(l.stringFieldOption=k.stringFieldOption))}return l}}})},"jimu/dijit/EditorTextColor":function(){define("require dojo dijit dojo/_base/declare dijit/_editor/_Plugin dijit/form/DropDownButton".split(" "),function(O,B,F,E,f,h){B.experimental("dijit.editor.plugins.EditorTextColor");var r=E("dijit.editor.plugins.EditorTextColor",
f,{buttonClass:h,colorPicker:"jimu/dijit/ColorPalette",useDefaultCommand:!1,_initButton:function(){this.command="editorTextColor";this.hackCommand="foreColor";this.inherited(arguments);var c="",v=!1;this.params.custom&&(this.params.custom.recordUID&&(c=this.params.custom.recordUID),this.params.custom.forceAttr&&(v=this.params.custom.forceAttr));var p=this;this.button.set("iconClass",this.iconClassPrefix+" "+this.iconClassPrefix+"ForeColor");this.button.set("title",this.getLabel(this.hackCommand));
this.button.loadDropDown=function(g){function e(b){p.button.dropDown=new b({dir:p.editor.dir,ownerDocument:p.editor.ownerDocument,value:p.value,appearance:{showTransparent:!1,showColorPalette:!0,showCoustom:!0,showColorPickerApply:!1,showCoustomRecord:!0},recordUID:c,onChange:function(a){p.editor.execCommand("useCSS",v);p.editor.execCommand("styleWithCSS",!v);p.editor.execCommand(p.hackCommand,a)},onClose:function(){p.button.closeDropDown()}});g()}"string"===typeof p.colorPicker?O([p.colorPicker],
e):e(p.colorPicker)}},updateState:function(){var c=this.editor,v=this.hackCommand;if(c&&c.isLoaded&&v.length){if(this.button){var p=this.get("disabled");this.button.set("disabled",p);if(p)return;try{var g=c.queryCommandValue(v)||""}catch(e){g=""}}""===g?g="#000000":"transparent"===g&&(g="rgba(0, 0, 0, 0)");this.value=g;(c=this.button.dropDown)&&c.getColor&&g!==c.getColor()&&(c.refreshRecords(),c.setColor(g))}}});B.subscribe(F._scopeName+".Editor.getPlugin",null,function(c){if(!c.plugin)switch(c.args.name){case "editorTextColor":c.plugin=
new r}});return r})},"jimu/dijit/EditorBackgroundColor":function(){define("require dojo dijit dojo/_base/declare dijit/_editor/_Plugin dijit/form/DropDownButton".split(" "),function(O,B,F,E,f,h){B.experimental("dijit.editor.plugins.EditorBackgroundColor");var r=E("dijit.editor.plugins.EditorBackgroundColor",f,{buttonClass:h,colorPicker:"jimu/dijit/ColorPalette",useDefaultCommand:!1,_initButton:function(){this.command="editorBackgroundColor";this.hackCommand="hiliteColor";this.inherited(arguments);
var c="";this.params.custom&&this.params.custom.recordUID&&(c=this.params.custom.recordUID);var v=this;this.button.set("iconClass",this.iconClassPrefix+" "+this.iconClassPrefix+"HiliteColor");this.button.set("title",this.getLabel(this.hackCommand));this.button.loadDropDown=function(p){function g(e){v.button.dropDown=new e({dir:v.editor.dir,ownerDocument:v.editor.ownerDocument,value:v.value,appearance:{showTransparent:!0,showColorPalette:!0,showCoustom:!0,showColorPickerOK:!0,showColorPickerApply:!1,
showCoustomRecord:!0},recordUID:c,onChange:function(b){v.editor.execCommand("useCSS",!1);v.editor.execCommand("styleWithCSS",!0);v.editor.execCommand(v.hackCommand,b)},onExecute:function(){v.editor.execCommand(v.hackCommand,this.get("value"))},onClose:function(){v.button.closeDropDown()}});p()}"string"===typeof v.colorPicker?O([v.colorPicker],g):g(v.colorPicker)}},updateState:function(){var c=this.editor,v=this.hackCommand;if(c&&c.isLoaded&&v.length){if(this.button){var p=this.get("disabled");this.button.set("disabled",
p);if(p)return;try{var g=c.queryCommandValue(v)||""}catch(e){g=""}}""===g?g="#000000":"transparent"===g&&(g="rgba(0, 0, 0, 0)");this.value=g;(c=this.button.dropDown)&&c.getColor&&g!==c.getColor()&&(c.refreshRecords(),c.setColor(g))}}});B.subscribe(F._scopeName+".Editor.getPlugin",null,function(c){if(!c.plugin)switch(c.args.name){case "editorBackgroundColor":c.plugin=new r}});return r})},"widgets/SmartEditor/RelativeDates":function(){define("dojo/_base/declare dojo/Evented dojo/_base/lang dojo/on dojo/text!./RelativeDates.html dijit/_WidgetsInTemplateMixin jimu/BaseWidget jimu/dijit/Popup dojo/dom-class jimu/utils dojo/query dijit/focus ./presetUtils dijit/form/Select jimu/dijit/LayerChooserFromMap jimu/dijit/LayerChooserFromMapWithDropbox jimu/dijit/_filter/ValueProviderFactory dojo/_base/array dojo/dom-style dojo/string dojo/dom-attr ./utils dojo/_base/kernel dijit/form/DateTextBox dijit/form/TimeTextBox dijit/form/NumberTextBox jimu/dijit/RadioBtn".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y,u,C,q,w){return O([r,B,h],{baseClass:"jimu-widget-smartEditor-setting-relativeDates",templateString:f,selectValuePopup:null,_isFirsTime:!0,initialValue:null,postCreate:function(){this._eventListener();this._createSelectValuePopUp();this._addLayerSelectors();this._support508ForSelectValuePopUp();E(window,"resize",F.hitch(this,function(){setTimeout(F.hitch(this,function(){this._setFieldPopupDimensions()}),1E3)}))},_eventListener:function(){this.fixedRadioButton.onStateChange=
F.hitch(this,function(){this.dateTypeChanged()});this.currentRadioButton.onStateChange=F.hitch(this,function(){this.dateTypeChanged()});this.PastRadioButton.onStateChange=F.hitch(this,function(){this.dateTypeChanged()});this.futureRadioButton.onStateChange=F.hitch(this,function(){this.dateTypeChanged()});this.own(E(this.yearsTextBox,"change",F.hitch(this,function(){this._showOrHideWarningContainer()})));this.own(E(this.monthsTextBox,"change",F.hitch(this,function(){this._showOrHideWarningContainer()})));
this.own(E(this.daysTextBox,"change",F.hitch(this,function(){this._showOrHideWarningContainer()})));this.own(E(this.minutesTextBox,"change",F.hitch(this,function(){this._showOrHideWarningContainer()})));this.own(E(this.hoursTextBox,"change",F.hitch(this,function(){this._showOrHideWarningContainer()})));this.own(E(this.secondsTextBox,"change",F.hitch(this,function(){this._showOrHideWarningContainer()})));this.customRadioButton.onStateChange=F.hitch(this,function(){this._dateValueOptionChange()});this.selectValueRadioButton.onStateChange=
F.hitch(this,function(){this._dateValueOptionChange()})},dateTypeChanged:function(){v.add(this.fixedDateContent,"esriCTHidden");v.add(this.currentDateContent,"esriCTHidden");v.add(this.pastOrFutureDateContent,"esriCTHidden");v.remove(this.valueLabel,"esriCTHidden");v.add(this.relativeDateWarningContainer,"esriCTHidden");this.fixedRadioButton.checked?(v.remove(this.fixedDateContent,"esriCTHidden"),this.hintForDateType.innerHTML=this.nls.relativeDates.hintForFixedDateType):this.currentRadioButton.checked?
(v.add(this.valueLabel,"esriCTHidden"),v.remove(this.currentDateContent,"esriCTHidden"),this.hintForDateType.innerHTML=this.nls.relativeDates.hintForCurrentDateType):this.PastRadioButton.checked?(v.remove(this.pastOrFutureDateContent,"esriCTHidden"),this.hintForDateType.innerHTML=this.nls.relativeDates.hintForPastDateType):this.futureRadioButton.checked&&(v.remove(this.pastOrFutureDateContent,"esriCTHidden"),this.hintForDateType.innerHTML=this.nls.relativeDates.hintForFutureDateType)},_createSelectValuePopUp:function(){this.selectValuePopup=
new c({titleLabel:this.nls.relativeDates.popupTitle,width:500,maxHeight:450,autoHeight:!0,"class":this.baseClass,content:this,buttons:[{label:this.nls.ok,onClick:F.hitch(this,function(){var x=this._getValues();x&&(!v.contains(this.pastOrFutureDateContent,"esriCTHidden")&&this._checkTextboxesWithZeroValue()?v.remove(this.relativeDateWarningContainer,"esriCTHidden"):(v.add(this.relativeDateWarningContainer,"esriCTHidden"),this.emit("updatePresetValue",x),this.selectValuePopup.close()))})},{label:this.nls.cancel,
classNames:["jimu-btn-vacation"],onClick:F.hitch(this,function(){this.selectValuePopup.close()})}]});this.relativeDates&&this._setValue()},_setFieldPopupDimensions:function(){this.selectValuePopup&&(window.appInfo.isRunInMobile&&600>window.innerWidth?this.selectValuePopup.set("width",window.innerWidth-100):this.selectValuePopup.set("width",750))},_validateFixedDate:function(){return this.dateTextBox.isValid()?this.timeTextBox.isValid()?!0:(this.timeTextBox.focus(),!1):(this.dateTextBox.focus(),!1)},
_validatePastOrFutureDate:function(){return this.yearsTextBox.isValid()?this.monthsTextBox.isValid()?this.daysTextBox.isValid()?this.hoursTextBox.isValid()?this.minutesTextBox.isValid()?this.secondsTextBox.isValid()?!0:(this.secondsTextBox.focus(),!1):(this.minutesTextBox.focus(),!1):(this.hoursTextBox.focus(),!1):(this.daysTextBox.focus(),!1):(this.monthsTextBox.focus(),!1):(this.yearsTextBox.focus(),!1)},_getValues:function(){var x=!0,I={value:{}};if(this.fixedRadioButton.checked){if(this.customRadioButton.checked&&
(x=this._validateFixedDate())&&(I.dateType="fixed",I.dateTime=b.getDateFieldValue({type:"esriFieldTypeDate"},[this.dateTextBox,this.timeTextBox])),this.selectValueRadioButton.checked&&(I.dateType="fixed",this._getChooseFromLayerInfo()?I.chooseFromLayerInfo=this._getChooseFromLayerInfo():I.chooseFromLayerInfo=null,I.chooseFromLayerInfo&&I.chooseFromLayerInfo.selectedValue)){var A=I.chooseFromLayerInfo.selectedValue;I.dateTime="Invalid Date"!=new Date(A)?this._convertToEpoch(new Date(A)):parseInt(A)}}else if(this.currentRadioButton.checked)I.dateType=
"current";else if(this.PastRadioButton.checked){if(x=this._validatePastOrFutureDate())I=this._getValuesOfPastOrFutureDijits(),I.dateType="past"}else this.futureRadioButton.checked&&(x=this._validatePastOrFutureDate())&&(I=this._getValuesOfPastOrFutureDijits(),I.dateType="future");return x?I:x},_support508ForSelectValuePopUp:function(){var x=g(".jimu-btn-vacation",this.selectValuePopup.domNode)[0];p.initFirstFocusNode(this.selectValuePopup.domNode,this.selectValuePopup.closeBtnNode);e.focus(this.selectValuePopup.closeBtnNode);
p.initLastFocusNode(this.selectValuePopup.domNode,x)},_setValue:function(){if("fixed"===this.relativeDates.dateType)if(this.fixedRadioButton.domNode.click(),this.relativeDates.hasOwnProperty("chooseFromLayerInfo"))this.selectValueRadioButton.domNode.click();else{this.customRadioButton.domNode.click();var x=new Date(parseInt(this.relativeDates.dateTime,10));this.dateTextBox.set("value",x);this.timeTextBox.set("value",x)}"current"===this.relativeDates.dateType&&this.currentRadioButton.domNode.click();
"past"===this.relativeDates.dateType&&(this.PastRadioButton.domNode.click(),this._setValuesOfPastOrFutureDijits());"future"===this.relativeDates.dateType&&(this.futureRadioButton.domNode.click(),this._setValuesOfPastOrFutureDijits())},_setValuesOfPastOrFutureDijits:function(){this.yearsTextBox.set("value",this.relativeDates.year);this.monthsTextBox.set("value",this.relativeDates.month);this.daysTextBox.set("value",this.relativeDates.day);this.hoursTextBox.set("value",this.relativeDates.hour);this.minutesTextBox.set("value",
this.relativeDates.minute);this.secondsTextBox.set("value",this.relativeDates.second)},_getValuesOfPastOrFutureDijits:function(){var x={};x.year=this.yearsTextBox.value;x.month=this.monthsTextBox.value;x.day=this.daysTextBox.value;x.hour=this.hoursTextBox.value;x.minute=this.minutesTextBox.value;x.second=this.secondsTextBox.value;return x},_checkTextboxesWithZeroValue:function(){return 0!==this.yearsTextBox.value||0!==this.monthsTextBox.value||0!==this.daysTextBox.value||0!==this.hoursTextBox.value||
0!==this.minutesTextBox.value||0!==this.secondsTextBox.value?!1:!0},_showOrHideWarningContainer:function(){this._checkTextboxesWithZeroValue()?v.remove(this.relativeDateWarningContainer,"esriCTHidden"):v.add(this.relativeDateWarningContainer,"esriCTHidden")},_addLayerSelectors:function(){var x=this._createLayerChooserMapArgs();x=new m(x);x.startup();this.layerSelector=new n({layerChooser:x});this.layerSelector.placeAt(this.layerSelectorDiv);this.layerSelector.startup();if(0<this.layerSelector.layerChooser.getAllItems().length)var I=
this.layerSelector.layerChooser.getAllItems()[0].layerInfo.layerObject;this.relativeDates&&this.relativeDates.chooseFromLayerInfo&&this.relativeDates.chooseFromLayerInfo.layerId&&this._isFirsTime&&(x=this.layerInfos.getLayerInfoById(this.relativeDates.chooseFromLayerInfo.layerId))&&(I=x.layerObject);this.layerSelector.setSelectedLayer(I);this._addLayerFieldsOptions()},_createLayerChooserMapArgs:function(){return{multiple:!1,createMapResponse:this.map.webMapResponse,filter:this._createFiltersForLayerSelector()}},
_createFiltersForLayerSelector:function(){var x=m.createFeaturelayerFilter(["point","polyline","polygon"],!1,!1);var I=m.createImageServiceLayerFilter(!0);x=m.orCombineFilters([x,I]);dateLayerfilter=this._createDateLayerfilter();return m.andCombineFilters([x,dateLayerfilter])},_createDateLayerfilter:function(){return function(x){var I=!1;x.getLayerObject().then(function(A){A&&A.fields&&k.some(A.fields,function(M){if("esriFieldTypeDate"===M.type)return I=!0})});return I}},_addLayerFieldsOptions:function(){this.fieldsDropdown&&
this.fieldsDropdown.destroy();this.valueProviderFactory&&(this.valueProviderFactory=null);this.valueProvider&&this.valueProvider.destroy();this.fieldsDropdown=new a({style:{width:"100%"}});this.fieldsDropdown.placeAt(this.fieldsDropdownDiv);this.fieldsDropdown.startup();this.fieldsDropdown.set("options",this._createFieldsDropDownOpt());this.fieldsDropdown.options&&0<this.fieldsDropdown.options.length&&this.fieldsDropdown.set("value",this.fieldsDropdown.options[0]);this.relativeDates&&this.relativeDates.chooseFromLayerInfo&&
this.relativeDates.chooseFromLayerInfo.field&&this._isFirsTime&&this.fieldsDropdown.set("value",this.relativeDates.chooseFromLayerInfo.field);this._updateLabelForDomainField(this.selectedPresetValue);this.own(E(this.layerSelector,"selection-change",F.hitch(this,function(){this._addLayerFieldsOptions()})));this.own(E(this.fieldsDropdown,"change",F.hitch(this,function(){y.set(this.domainFieldHint,"display","none");this._createValueProvider();this._updateLabelForDomainField("")})))},_createFieldsDropDownOpt:function(){var x=
[];validFieldSet=[];if(this.layerSelector.getSelectedItem()){var I=this.layerSelector.getSelectedItem().layerInfo.layerObject;k.forEach(I.fields,F.hitch(this,function(A){"esriFieldTypeDate"===A.type&&x.push({label:A.alias||A.name,value:A.name})}))}return x},_createValueProvider:function(){var x;this.layerSelector&&(x=this.layerSelector.getSelectedItem());if(x&&x.layerInfo&&x.layerInfo.layerObject){x=x.layerInfo;var I=x.layerObject;this.valueProviderFactory&&(this.valueProviderFactory=null);this.valueProvider&&
this.valueProvider.destroy();this.valueProviderFactory=new l({url:I.url,layerDefinition:I,featureLayerId:x.id});var A;var M=this.fieldsDropdown.getValue();k.some(I.fields,F.hitch(this,function(S){if(S.name===M)return A=S,!0}));if(M&&A){if("esriFieldTypeDate"===A.type){var H="date";var U="dateOperatorIsOn"}H={fieldObj:{name:M,label:M,dateFormat:"",shortType:H,type:A.type},operator:U,interactiveObj:"",caseSensitive:!1,valueObj:{type:"unique"}};this.valueProvider=this.valueProviderFactory.getValueProvider(H,
!1);this.own(E(this.valueProvider,"change",F.hitch(this,function(){var S=this.valueProvider.getPartObject()&&this.valueProvider.getPartObject().valueObj.value;this._updateLabelForDomainField(S)})));this.valueProvider&&(this.valueProvider.promptLabel&&v.add(this.valueProvider.promptLabel,"esriCTHidden"),this.valueProvider.placeAt(this.valueProviderContainer),this.relativeDates&&this.relativeDates.chooseFromLayerInfo&&this.relativeDates.chooseFromLayerInfo.selectedValue&&"Invalid Date"!=new Date(this.relativeDates.chooseFromLayerInfo.selectedValue)&&
this._isFirsTime&&(H.valueObj.value=this.relativeDates.chooseFromLayerInfo.selectedValue,this._isFirsTime=!1),this.valueProvider.setValueObject(H.valueObj),this.initialValue=H.valueObj.value?H.valueObj.value:"")}}},_dateValueOptionChange:function(){this.customRadioButton.checked&&(v.remove(this.customOptionContentNode,"esriCTHidden"),v.add(this.selectValueOptionContentNode,"esriCTHidden"));this.selectValueRadioButton.checked&&(v.remove(this.selectValueOptionContentNode,"esriCTHidden"),v.add(this.customOptionContentNode,
"esriCTHidden"))},_getChooseFromLayerInfo:function(){if(this.valueProvider&&this.valueProvider.checkedNameDiv){var x=this.valueProvider.getPartObject()?this.valueProvider.getPartObject().valueObj.value:"- empty -"!==this.valueProvider.checkedNameDiv.innerHTML&&this.initialValue?this.initialValue:"";if("ar"===w.locale&&this.layerSelector){var I;if(I=this.layerSelector.getSelectedItem())I=q.getFieldInfosFromWebmap(I.layerInfo),I=b.getFieldInfoByFieldName(I,this.fieldsDropdown.getValue()),"esriFieldTypeDate"===
I.type&&(x=p.getDateByDateTimeStr(x),x=p.localizeDateTimeByFieldInfo(x,I))}return{layerId:this.layerSelector.getSelectedItem().layerInfo.layerObject.id,field:this.fieldsDropdown.getValue(),selectedValue:x}}},_convertToEpoch:function(x){return x=(x=x?new Date(x.getFullYear(),x.getMonth(),x.getDate(),x.getHours(),x.getMinutes(),x.getSeconds(),x.getMilliseconds()):x||null)&&x.getTime?x.getTime():x&&x.toGregorian?x.toGregorian().getTime():x},_updateLabelForDomainField:function(x){var I,A,M={dateType:"fixed",
dateTime:""};(A=this.layerSelector?this.layerSelector.getSelectedItem():null)&&A.layerInfo&&A.layerInfo.layerObject&&(A=A.layerInfo.layerObject,A=A.getField(this.fieldsDropdown.getValue()),A.domain&&"esriFieldTypeDate"===A.type&&k.some(A.domain.codedValues,F.hitch(this,function(H){if(x==H.code)return H=new Date(x),M.dateTime="Invalid Date"!=H?this._convertToEpoch(H):parseInt(x),I=u.substitute(this.nls.relativeDates.domainFieldHintLabel,{domainValue:b.getDateFromRelativeInfo(M,!0)}),!0})));I?(C.set(this.domainFieldHint,
"innerHTML",I),y.set(this.domainFieldHint,"display","block")):y.set(this.domainFieldHint,"display","none")}})})},"jimu/dijit/LayerChooserFromMap":function(){define("dojo/on dojo/Evented dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/store/Memory dojo/Deferred dojo/store/Observable dijit/tree/ObjectStoreModel dojo/promise/all dojo/_base/lang dojo/_base/html dojo/_base/array jimu/utils jimu/dijit/_Tree jimu/LayerInfos/LayerInfos jimu/dijit/LoadingIndicator".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k){var y=F([E,f,h,B],{templateString:'\x3cdiv style\x3d"width:100%;"\x3e\x3cdiv data-dojo-attach-point\x3d"errorTipSection" class\x3d"error-tip-section"\x3e\x3cspan class\x3d"jimu-icon jimu-icon-error"\x3e\x3c/span\x3e\x3cspan class\x3d"jimu-state-error-text" data-dojo-attach-point\x3d"errTip"\x3e${nls.noLayersTip}\x3c/span\x3e\x3c/div\x3e\x3c/div\x3e',_store:null,_id:0,_treeClass:"layer-chooser-tree",createMapResponse:null,multiple:!1,onlyShowVisible:!1,
updateWhenLayerInfosIsShowInMapChanged:!1,onlyShowWebMapLayers:!1,displayTooltipForTreeNode:!1,onlyFilterCurrentLayerWhenAddItem:!1,postMixInProperties:function(){this.nls=window.jimuNls.basicLayerChooserFromMap},postCreate:function(){this.inherited(arguments);b.addClass(this.domNode,"jimu-basic-layer-chooser-from-map");this.multiple=!!this.multiple;this.shelter=new k({hidden:!0});this.shelter.placeAt(this.domNode);this.shelter.startup();this._createTree();this.basicFilter=e.hitch(this,this.basicFilter);
this.filter=y.andCombineFilters([this.basicFilter,this.filter]);this.createMapResponse&&this.setCreateMapResponse(this.createMapResponse)},basicFilter:function(u){var C=new c;this.onlyShowVisible?C.resolve(u.isShowInMap()):C.resolve(!0);return C},filter:function(u){u=new c;u.resolve(!0);return u},getSelectedItems:function(){var u=this.tree.getSelectedItems();return a.map(u,e.hitch(this,function(C){return this.getHandledItem(C)}))},getAllItems:function(){var u=this.tree.getAllItems(),C=[];a.forEach(u,
e.hitch(this,function(q){"root"!==q.id&&(q=this.getHandledItem(q),C.push(q))}));return C},getHandledItem:function(u){return{name:u.name,layerInfo:u.layerInfo}},_isLeafItem:function(u){return u.isLeaf},setCreateMapResponse:function(u){this.createMapResponse=u;l.getInstance(this.createMapResponse.map,this.createMapResponse.itemInfo).then(e.hitch(this,function(C){this.layerInfosObj=C;this.own(O(this.layerInfosObj,"layerInfosChanged",e.hitch(this,this._onLayerInfosChanged)));this.updateWhenLayerInfosIsShowInMapChanged&&
this.own(O(this.layerInfosObj,"layerInfosIsShowInMapChanged",e.hitch(this,this._onLayerInfosIsShowInMapChanged)));this._buildTree(this.layerInfosObj)}))},_onLayerInfosChanged:function(u,C){this._buildTree(this.layerInfosObj);this.emit("update")},_onLayerInfosIsShowInMapChanged:function(u){this._buildTree(this.layerInfosObj);this.emit("update")},_buildTree:function(u){this._clear();b.setStyle(this.errorTipSection,"display","block");var C=[];this.onlyShowWebMapLayers?(C=u.getLayerInfoArrayOfWebmap(),
C=C.concat(u.getTableInfoArrayOfWebmap())):(C=u.getLayerInfoArray(),C=C.concat(u.getTableInfoArray()));0!==C.length&&(b.setStyle(this.errorTipSection,"display","none"),a.forEach(C,e.hitch(this,function(q){this._addDirectLayerInfo(q)})))},_addDirectLayerInfo:function(u){u&&u.getLayerObject().then(e.hitch(this,function(){this._addItem("root",u)}),e.hitch(this,function(C){console.error(C)}))},_clear:function(){var u=this._store.query({parent:"root"});a.forEach(u,e.hitch(this,function(C){C&&"root"!==
C.id&&this._store.remove(C.id)}))},_addItem:function(u,C){var q=null,w=C.getLayerType(),x=this.filter(C);g({layerType:w,valid:x}).then(e.hitch(this,function(I){if(I.valid){var A=e.hitch(this,function(S,D){this._id++;q={name:C.title||"",parent:u,layerInfo:C,type:I.layerType,layerClass:C.layerObject.declaredClass,id:this._id.toString(),isLeaf:S,hasChildren:D};this._store.add(q)}),M=C.getSubLayers(),H=0===M.length,U=!0;this.onlyFilterCurrentLayerWhenAddItem?(H&&(U=!1),A(H,U)):H?A(H,!1):(M=a.map(M,e.hitch(this,
function(S){return this.filter(S)})),g(M).then(e.hitch(this,function(S){(S=a.some(S,function(D){return D}))&&A(H,S)})))}}))},_getRootItem:function(){return{id:"root",name:"Map Root",type:"root",isLeaf:!1,hasChildren:!0}},_createTree:function(){var u=this._getRootItem();u=new r({data:[u],getChildren:function(C){return this.query({parent:C.id})}});this._store=new v(u);u=new p({store:this._store,query:{id:"root"},mayHaveChildren:e.hitch(this,this._mayHaveChildren)});this.tree=new n({multiple:this.multiple,
model:u,showRoot:!1,isLeafItem:e.hitch(this,this._isLeafItem),style:{width:"100%"},onOpen:e.hitch(this,function(C,q){"root"!==C.id&&this._onTreeOpen(C,q)}),onClick:e.hitch(this,function(C,q,w){this._onTreeClick(C,q,w);this.emit("tree-click",C,q,w)}),getIconStyle:e.hitch(this,function(C,q){var w=null;if(!C||"root"===C.id)return null;var x={width:"20px",height:"20px",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundImage:""},I=window.location.protocol+"//"+window.location.host+
require.toUrl("jimu");if(C=this._getIconInfo(C,q).imageName)x.backgroundImage="url("+I+"/css/images/"+C+")",w=x;return w}),getIconClass:e.hitch(this,function(C,q){return this._getIconInfo(C,q).className}),getTooltip:e.hitch(this,function(C){return this.displayTooltipForTreeNode?C.layerInfo.title:""})});b.addClass(this.tree.domNode,this._treeClass);this.tree.placeAt(this.shelter.domNode,"before")},_mayHaveChildren:function(u){return u.hasChildren},_getIconInfo:function(u,C){var q="",w="";"ArcGISDynamicMapServiceLayer"===
u.type||"ArcGISTiledMapServiceLayer"===u.type?C?(q="mapserver_open.png",w="mapservice-layer-icon open"):(q="mapserver_close.png",w="mapservice-layer-icon close"):"GroupLayer"===u.type?C?(q="group_layer2.png",w="group-layer-icon open"):(q="group_layer1.png",w="group-layer-icon close"):"FeatureLayer"===u.type?(u=m.getTypeByGeometryType(u.layerInfo.layerObject.geometryType),"point"===u?(q="point_layer1.png",w="point-layer-icon"):"polyline"===u?(q="line_layer1.png",w="line-layer-icon"):"polygon"===u&&
(q="polygon_layer1.png",w="polygon-layer-icon")):"Table"===u.type?(q="table.png",w="table-icon"):"ArcGISImageServiceLayer"===u.type||"ArcGISImageServiceVectorLayer"===u.type?(q="image_layer.png",w="iamge-layer-icon"):C?(q="mapserver_open.png",w="mapservice-layer-icon open"):(q="mapserver_close.png",w="mapservice-layer-icon close");return{imageName:q,className:w}},_onTreeOpen:function(u,C){if("root"!==u.id){var q=[];C=[];q=u.layerInfo.getSubLayers();u.checked||(this.shelter.show(),C=a.map(q,e.hitch(this,
function(w){return w.getLayerObject()})),g(C).then(e.hitch(this,function(){this.domNode&&(a.forEach(q,e.hitch(this,function(w){this._addItem(u.id,w)})),u.checked=!0,this.shelter.hide())}),e.hitch(this,function(w){console.error(w);this.shelter.hide()})))}},_onTreeClick:function(u,C,q){},destroy:function(){this.shelter&&(this.shelter.destroy(),this.shelter=null);this.tree&&this.tree.destroy();this.inherited(arguments)}});y.createFilterByLayerType=function(u){e.isArrayLike(u)||(u=[]);return function(C){var q=
new c;if(0===u.length)q.resolve(!0);else{var w=[];C.traversal(function(x){w.push(x.getLayerType())});g(w).then(function(x){for(var I=0;I<x.length;I++)for(var A=0;A<u.length;A++)if(x[I]===u[A]){q.resolve(!0);return}q.resolve(!1)},function(x){console.error(x);q.reject(x)})}return q}};y.createFeaturelayerFilter=function(u,C,q,w){var x=["point","polyline","polygon"];u&&0<u.length?(u=a.filter(u,function(I){return 0<=x.indexOf(I)}),0===u.length&&(u=x)):u=x;return function(I){var A=I.getLayerType();I=I.getLayerObject();
return g({layerType:A,layerObject:I}).then(function(M){var H=M.layerType;M=M.layerObject;if("ArcGISDynamicMapServiceLayer"===H||"ArcGISTiledMapServiceLayer"===H||"GroupLayer"===H||"FeatureCollection"===H)return!0;if("FeatureLayer"===H){H=m.getTypeByGeometryType(M.geometryType);H=0<=a.indexOf(u,H);var U=y._shouldPassStatisticsCheck(w,M);return M.url?(M=m.isFeaturelayerUrlSupportQuery(M.url,M.capabilities),H&&M&&U):C&&H}return"Table"===H?(H=m.isFeaturelayerUrlSupportQuery(M.url,M.capabilities),M=y._shouldPassStatisticsCheck(w,
M),q&&H&&M):!1})}};y.createImageServiceLayerFilter=function(u,C){return function(q){var w=q.getLayerType();q=q.getLayerObject();return g({layerType:w,layerObject:q}).then(function(x){var I=x.layerType,A=x.layerObject;return"ArcGISImageServiceLayer"===I||"ArcGISImageServiceVectorLayer"===I?u?m.isImageServiceSupportQuery(x.layerObject.capabilities)?C?y._shouldPassStatisticsCheck(C,A):!0:!1:!0:!1})}};y._shouldPassStatisticsCheck=function(u,C){return u?(u=!1,u=C.advancedQueryCapabilities?!!C.advancedQueryCapabilities.supportsStatistics:
!!C.supportsStatistics):!0};y.createQueryableLayerFilter=function(u){var C=y.createFeaturelayerFilter(["point","polyline","polygon"],!1,!0,u);u=y.createImageServiceLayerFilter(!0,u);return y.orCombineFilters([C,u])};y.andCombineFilters=function(u){return y._combineFilters(u,!0)};y.orCombineFilters=function(u){return y._combineFilters(u,!1)};y._combineFilters=function(u,C){return function(q){var w=new c,x=a.map(u,function(I){return I(q)});g(x).then(function(I){var A=!1;A=C?a.every(I,function(M){return M}):
a.some(I,function(M){return M});w.resolve(A)},function(I){console.error(I);w.reject(I)});return w}};return y})},"dijit/tree/ObjectStoreModel":function(){define("dojo/_base/array dojo/aspect dojo/_base/declare dojo/Deferred dojo/_base/lang dojo/when ../Destroyable".split(" "),function(O,B,F,E,f,h,r){return F("dijit.tree.ObjectStoreModel",r,{store:null,labelAttr:"name",labelType:"text",root:null,query:null,constructor:function(c){f.mixin(this,c);this.childrenCache={}},getRoot:function(c,v){if(this.root)c(this.root);
else{var p=this.store.query(this.query);p.then&&this.own(p);h(p,f.hitch(this,function(g){if(1!=g.length)throw Error("dijit.tree.ObjectStoreModel: root query returned "+g.length+" items, but must return exactly one");this.root=g[0];c(this.root);p.observe&&p.observe(f.hitch(this,function(e){this.onChange(e)}),!0)}),v)}},mayHaveChildren:function(){return!0},getChildren:function(c,v,p){var g=this.store.getIdentity(c);if(this.childrenCache[g])h(this.childrenCache[g],v,p);else{var e=this.childrenCache[g]=
this.store.getChildren(c);e.then&&this.own(e);e.observe&&this.own(e.observe(f.hitch(this,function(b,a,m){this.onChange(b);a!=m&&h(e,f.hitch(this,"onChildrenChange",c))}),!0));h(e,v,p)}},isItem:function(){return!0},getIdentity:function(c){return this.store.getIdentity(c)},getLabel:function(c){return c[this.labelAttr]},newItem:function(c,v,p,g){return this.store.put(c,{parent:v,before:g})},pasteItem:function(c,v,p,g,e,b){var a=new E;if(v===p&&!g&&!b)return a.resolve(!0),a;v&&!g?this.getChildren(v,f.hitch(this,
function(m){m=[].concat(m);var n=O.indexOf(m,c);m.splice(n,1);this.onChildrenChange(v,m);a.resolve(this.store.put(c,{overwrite:!0,parent:p,oldParent:v,before:b,isCopy:!1}))})):a.resolve(this.store.put(c,{overwrite:!0,parent:p,oldParent:v,before:b,isCopy:!0}));return a},onChange:function(){},onChildrenChange:function(){},onDelete:function(){}})})},"jimu/dijit/_Tree":function(){define("dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dojo/text!./templates/_TreeNode.html dojo/_base/lang dojo/_base/html dojo/_base/array dojo/_base/event dojo/query dojo/aspect dojo/on dojo/keys dojo/Evented dijit/registry dijit/Tree jimu/utils".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n){var l=O([m._TreeNode,b],{templateString:E,declaredClass:"jimu._TreeNode",isLeaf:!1,groupId:"",postCreate:function(){this.inherited(arguments);h.addClass(this.domNode,"jimu-tree-node");this.isLeaf=!!this.isLeaf;this.groupId?(this.checkNode=h.toDom('\x3cinput type\x3d"radio" /\x3e'),this.checkNode.name=this.groupId):this.checkNode=h.toDom('\x3cinput type\x3d"checkbox" /\x3e');h.addClass(this.checkNode,"jimu-tree-check-node");h.place(this.checkNode,this.contentNode,
"first");this.own(g(this.checkNode,"click",f.hitch(this,this._onClick)));this.own(g(this.rowNode,"keydown",f.hitch(this,function(k,y){y.target=k;y.keyCode!==e.ENTER&&y.keyCode!==e.SPACE||this._onClick(y)},this.checkNode)));this.isLeaf?this.groupId?h.setStyle(this.checkNode,"display","none"):h.setStyle(this.checkNode,"display","inline"):h.setStyle(this.checkNode,"display","none");this.isLeaf?h.addClass(this.domNode,"jimu-tree-leaf-node"):h.addClass(this.domNode,"jimu-tree-not-leaf-node")},select:function(){this.isLeaf&&
(this.checkNode.checked=!0,h.addClass(this.domNode,"jimu-tree-selected-leaf-node"))},unselect:function(){this.isLeaf&&(this.checkNode.checked=!1,h.removeClass(this.domNode,"jimu-tree-selected-leaf-node"))},toggleSelect:function(){this.isLeaf&&(this.checkNode.checked?this.unselect():this.select())},_onClick:function(k){(k.target||k.srcElement)===this.checkNode?this.tree._onCheckNodeClick(this,this.checkNode.checked,k):this.tree._onClick(this,k)},_onChange:function(){this.isLeaf&&setTimeout(f.hitch(this,
function(){this.checkNode.checked?this.emit("tn-select",this):this.emit("tn-unselect",this)}),100)},destroy:function(){delete this.tree;this.inherited(arguments)}});return O([m,b],{declaredClass:"jimu._Tree",openOnClick:!0,multiple:!0,uniqueId:"",showRoot:!1,postMixInProperties:function(){this.inherited(arguments);this.uniqueId="tree_"+n.getRandomString()},postCreate:function(){this.inherited(arguments);h.addClass(this.domNode,"jimu-tree");this.own(p.before(this,"onClick",f.hitch(this,this._jimuBeforeClick)));
this.rootLoadingIndicator&&h.setStyle(this.rootLoadingIndicator,"display","none");this.dndController.singular=!0;h.setAttr(this.domNode,"tabindex",0)},removeItem:function(k){this.model.store.remove(k)},getAllItems:function(){var k=this.getAllTreeNodeWidgets();return r.map(k,f.hitch(this,function(y){var u=y.item;u.selected=y.checkNode.checked;return u}))},getSelectedItems:function(){var k=this.getAllTreeNodeWidgets();k=r.filter(k,f.hitch(this,function(y){return y.checkNode.checked}));return r.map(k,
f.hitch(this,function(y){return y.item}))},getFilteredItems:function(k){var y=this.getAllTreeNodeWidgets();y=r.map(y,f.hitch(this,function(u){var C=u.item;C.selected=u.checkNode.checked;return C}));return r.filter(y,f.hitch(this,function(u){return k(u)}))},getTreeNodeByItemId:function(k){for(var y=this._getAllTreeNodeDoms(),u=0;u<y.length;u++){var C=a.byNode(y[u]);if(C.item.id.toString()===k.toString())return C}return null},selectItem:function(k){(k=this.getTreeNodeByItemId(k))&&k.isLeaf&&this.selectNodeWidget(k)},
unselectItem:function(k){(k=this.getTreeNodeByItemId(k))&&k.isLeaf&&k.unselect()},getAllLeafTreeNodeWidgets:function(){var k=this.getAllTreeNodeWidgets();return r.filter(k,f.hitch(this,function(y){return y.isLeaf}))},getAllTreeNodeWidgets:function(){var k=this._getAllTreeNodeDoms();return r.map(k,f.hitch(this,function(y){return a.byNode(y)}))},isLeafItem:function(k){return k&&k.isLeaf},_getAllTreeNodeDoms:function(){return v(".dijitTreeNode",this.domNode)},_createTreeNode:function(k){k.isLeaf=this.isLeafItem(k.item);
this.multiple||(k.groupId=this.uniqueId);return new l(k)},_onTreeNodeSelect:function(k){this.emit("item-select",{item:k.item,treeNode:k})},_onTreeNodeUnselect:function(k){this.emit("item-unselect",{item:k.item,treeNode:k})},selectNodeWidget:function(k){this.multiple||this.unselectAllLeafNodeWidgets();k.select()},_jimuBeforeClick:function(k,y,u){y.isLeaf&&(h.hasClass(u.target||u.srcElement,"jimu-tree-check-node")||(this.multiple?y.toggleSelect():this.selectNodeWidget(y)));return arguments},_onCheckNodeClick:function(k,
y,u){!this.multiple&&y&&this.unselectAllLeafNodeWidgets();c.stop(u);this.focusNode(k);setTimeout(f.hitch(this,function(){y?this.selectNodeWidget(k):k.unselect();this.onClick(k.item,k,u)}),0)},unselectAllLeafNodeWidgets:function(){var k=this.getAllLeafTreeNodeWidgets();r.forEach(k,f.hitch(this,function(y){y.unselect()}))}})})},"dijit/Tree":function(){define("dojo/_base/array dojo/aspect dojo/cookie dojo/_base/declare dojo/Deferred dojo/promise/all dojo/dom dojo/dom-class dojo/dom-geometry dojo/dom-style dojo/errors/create dojo/fx dojo/has dojo/_base/kernel dojo/keys dojo/_base/lang dojo/on dojo/topic dojo/touch dojo/when ./a11yclick ./focus ./registry ./_base/manager ./_Widget ./_TemplatedMixin ./_Container ./_Contained ./_CssStateMixin ./_KeyNavMixin dojo/text!./templates/TreeNode.html dojo/text!./templates/Tree.html ./tree/TreeStoreModel ./tree/ForestStoreModel ./tree/_dndSelector dojo/query!css2".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y,u,C,q,w,x,I,A,M,H,U,S,D,L,J,P,R){function Y(N){return n.delegate(N.promise||N,{addCallback:function(T){this.then(T)},addErrback:function(T){this.otherwise(T)}})}var aa=E("dijit._TreeNode",[I,A,M,H,U],{item:null,isTreeNode:!0,label:"",_setLabelAttr:function(N){this.labelNode["html"==this.labelType?"innerHTML":"innerText"in this.labelNode?"innerText":"textContent"]=N;this._set("label",N);b("dojo-bidi")&&this.applyTextDir(this.labelNode)},labelType:"text",
isExpandable:null,isExpanded:!1,state:"NotLoaded",templateString:D,baseClass:"dijitTreeNode",cssStateNodes:{rowNode:"dijitTreeRow"},_setTooltipAttr:{node:"rowNode",type:"attribute",attribute:"title"},buildRendering:function(){this.inherited(arguments);this._setExpando();this._updateItemClasses(this.item);this.isExpandable&&this.labelNode.setAttribute("aria-expanded",this.isExpanded);this.setSelected(!1)},_setIndentAttr:function(N){var T=Math.max(N,0)*this.tree._nodePixelIndent+"px";p.set(this.domNode,
"backgroundPosition",T+" 0px");p.set(this.rowNode,this.isLeftToRight()?"paddingLeft":"paddingRight",T);O.forEach(this.getChildren(),function(ca){ca.set("indent",N+1)});this._set("indent",N)},markProcessing:function(){this.state="Loading";this._setExpando(!0)},unmarkProcessing:function(){this._setExpando(!1)},_updateItemClasses:function(N){var T=this.tree,ca=T.model;T._v10Compat&&N===ca.root&&(N=null);this._applyClassAndStyle(N,"icon","Icon");this._applyClassAndStyle(N,"label","Label");this._applyClassAndStyle(N,
"row","Row");this.tree._startPaint(!0)},_applyClassAndStyle:function(N,T,ca){var ia="_"+T+"Class";T+="Node";var Q=this[ia];this[ia]=this.tree["get"+ca+"Class"](N,this.isExpanded);c.replace(this[T],this[ia]||"",Q||"");p.set(this[T],this.tree["get"+ca+"Style"](N,this.isExpanded)||{})},_updateLayout:function(){var N=this.getParent();N=!N||!N.rowNode||"none"==N.rowNode.style.display;c.toggle(this.domNode,"dijitTreeIsRoot",N);c.toggle(this.domNode,"dijitTreeIsLast",!N&&!this.getNextSibling())},_setExpando:function(N){var T=
["dijitTreeExpandoLoading","dijitTreeExpandoOpened","dijitTreeExpandoClosed","dijitTreeExpandoLeaf"];N=N?0:this.isExpandable?this.isExpanded?1:2:3;c.replace(this.expandoNode,T[N],T);this.expandoNodeText.innerHTML=["*","-","+","*"][N]},expand:function(){if(this._expandDeferred)return Y(this._expandDeferred);this._collapseDeferred&&(this._collapseDeferred.cancel(),delete this._collapseDeferred);this.isExpanded=!0;this.labelNode.setAttribute("aria-expanded","true");(this.tree.showRoot||this!==this.tree.rootNode)&&
this.containerNode.setAttribute("role","group");c.add(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);this==this.tree.rootNode&&this.tree.showRoot&&this.tree.domNode.setAttribute("aria-expanded","true");var N=e.wipeIn({node:this.containerNode,duration:x.defaultDuration}),T=this._expandDeferred=new f(function(){N.stop()});B.after(N,"onEnd",function(){T.resolve(!0)},!0);N.play();return Y(T)},collapse:function(){if(this._collapseDeferred)return Y(this._collapseDeferred);
this._expandDeferred&&(this._expandDeferred.cancel(),delete this._expandDeferred);this.isExpanded=!1;this.labelNode.setAttribute("aria-expanded","false");this==this.tree.rootNode&&this.tree.showRoot&&this.tree.domNode.setAttribute("aria-expanded","false");c.remove(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);var N=e.wipeOut({node:this.containerNode,duration:x.defaultDuration}),T=this._collapseDeferred=new f(function(){N.stop()});B.after(N,"onEnd",
function(){T.resolve(!0)},!0);N.play();return Y(T)},indent:0,setChildItems:function(N){var T=this.tree,ca=T.model,ia=[],Q=T.focusedChild,W=this.getChildren();O.forEach(W,function(Z){M.prototype.removeChild.call(this,Z)},this);this.defer(function(){O.forEach(W,function(Z){if(!Z._destroyed&&!Z.getParent()){T.dndController.removeTreeNode(Z);(function ra(la){var oa=ca.getIdentity(la.item),sa=T._itemNodesMap[oa];1==sa.length?delete T._itemNodesMap[oa]:(oa=O.indexOf(sa,la),-1!=oa&&sa.splice(oa,1));O.forEach(la.getChildren(),
ra)})(Z);if(T.persist){var fa=O.map(Z.getTreePath(),function(la){return T.model.getIdentity(la)}).join("/"),ka;for(ka in T._openedNodes)ka.substr(0,fa.length)==fa&&delete T._openedNodes[ka];T._saveExpandedNodes()}T.lastFocusedChild&&!r.isDescendant(T.lastFocusedChild.domNode,T.domNode)&&delete T.lastFocusedChild;Q&&!r.isDescendant(Q.domNode,T.domNode)&&T.focus();Z.destroyRecursive()}})});this.state="Loaded";N&&0<N.length?(this.isExpandable=!0,O.forEach(N,function(Z){var fa=ca.getIdentity(Z),ka=T._itemNodesMap[fa];
if(ka)for(var qa=0;qa<ka.length;qa++)if(ka[qa]&&!ka[qa].getParent()){var la=ka[qa];la.set("indent",this.indent+1);break}la||(la=this.tree._createTreeNode({item:Z,tree:T,isExpandable:ca.mayHaveChildren(Z),label:T.getLabel(Z),labelType:T.model&&T.model.labelType||"text",tooltip:T.getTooltip(Z),ownerDocument:T.ownerDocument,dir:T.dir,lang:T.lang,textDir:T.textDir,indent:this.indent+1}),ka?ka.push(la):T._itemNodesMap[fa]=[la]);this.addChild(la);(this.tree.autoExpand||this.tree._state(la))&&ia.push(T._expandNode(la))},
this),O.forEach(this.getChildren(),function(Z){Z._updateLayout()})):this.isExpandable=!1;this._setExpando&&this._setExpando(!1);this._updateItemClasses(this.item);N=h(ia);this.tree._startPaint(N);return Y(N)},getTreePath:function(){for(var N=this,T=[];N&&N!==this.tree.rootNode;)T.unshift(N.item),N=N.getParent();T.unshift(this.tree.rootNode.item);return T},getIdentity:function(){return this.tree.model.getIdentity(this.item)},removeChild:function(N){this.inherited(arguments);var T=this.getChildren();
0==T.length&&(this.isExpandable=!1,this.collapse());O.forEach(T,function(ca){ca._updateLayout()})},makeExpandable:function(){this.isExpandable=!0;this._setExpando(!1)},setSelected:function(N){this.labelNode.setAttribute("aria-selected",N?"true":"false");c.toggle(this.rowNode,"dijitTreeRowSelected",N)},focus:function(){q.focus(this.focusNode)}});b("dojo-bidi")&&aa.extend({_setTextDirAttr:function(N){!N||this.textDir==N&&this._created||(this._set("textDir",N),this.applyTextDir(this.labelNode),O.forEach(this.getChildren(),
function(T){T.set("textDir",N)},this))}});var ea=E("dijit.Tree",[I,S,A,U],{baseClass:"dijitTree",store:null,model:null,query:null,label:"",showRoot:!0,childrenAttr:["children"],paths:[],path:[],selectedItems:null,selectedItem:null,openOnClick:!1,openOnDblClick:!1,templateString:L,persist:!1,autoExpand:!1,dndController:R,dndParams:"onDndDrop itemCreator onDndCancel checkAcceptance checkItemAcceptance dragThreshold betweenThreshold".split(" "),onDndDrop:null,itemCreator:null,onDndCancel:null,checkAcceptance:null,
checkItemAcceptance:null,dragThreshold:5,betweenThreshold:0,_nodePixelIndent:19,_publish:function(N,T){k.publish(this.id,n.mixin({tree:this,event:N},T||{}))},postMixInProperties:function(){this.tree=this;this.autoExpand&&(this.persist=!1);this._itemNodesMap={};!this.cookieName&&this.id&&(this.cookieName=this.id+"SaveStateCookie");this.expandChildrenDeferred=new f;this.pendingCommandsPromise=this.expandChildrenDeferred.promise;this.inherited(arguments)},postCreate:function(){this._initState();var N=
this;this.own(l(this.containerNode,l.selector(".dijitTreeNode",y.enter),function(ia){N._onNodeMouseEnter(w.byNode(this),ia)}),l(this.containerNode,l.selector(".dijitTreeNode",y.leave),function(ia){N._onNodeMouseLeave(w.byNode(this),ia)}),l(this.containerNode,l.selector(".dijitTreeRow",C.press),function(ia){N._onNodePress(w.getEnclosingWidget(this),ia)}),l(this.containerNode,l.selector(".dijitTreeRow",C),function(ia){N._onClick(w.getEnclosingWidget(this),ia)}),l(this.containerNode,l.selector(".dijitTreeRow",
"dblclick"),function(ia){N._onDblClick(w.getEnclosingWidget(this),ia)}));this.model||this._store2model();this.own(B.after(this.model,"onChange",n.hitch(this,"_onItemChange"),!0),B.after(this.model,"onChildrenChange",n.hitch(this,"_onItemChildrenChange"),!0),B.after(this.model,"onDelete",n.hitch(this,"_onItemDelete"),!0));this.inherited(arguments);if(this.dndController){n.isString(this.dndController)&&(this.dndController=n.getObject(this.dndController));for(var T={},ca=0;ca<this.dndParams.length;ca++)this[this.dndParams[ca]]&&
(T[this.dndParams[ca]]=this[this.dndParams[ca]]);this.dndController=new this.dndController(this,T)}this._load();this.onLoadDeferred=Y(this.pendingCommandsPromise);this.onLoadDeferred.then(n.hitch(this,"onLoad"))},_store2model:function(){this._v10Compat=!0;a.deprecated("Tree: from version 2.0, should specify a model object rather than a store/query");var N={id:this.id+"_ForestStoreModel",store:this.store,query:this.query,childrenAttrs:this.childrenAttr};this.params.mayHaveChildren&&(N.mayHaveChildren=
n.hitch(this,"mayHaveChildren"));this.params.getItemChildren&&(N.getChildren=n.hitch(this,function(T,ca,ia){this.getItemChildren(this._v10Compat&&T===this.model.root?null:T,ca,ia)}));this.model=new P(N);this.showRoot=!!this.label},onLoad:function(){},_load:function(){this.model.getRoot(n.hitch(this,function(N){var T=this.rootNode=this.tree._createTreeNode({item:N,tree:this,isExpandable:!0,label:this.label||this.getLabel(N),labelType:this.model.labelType||"text",textDir:this.textDir,indent:this.showRoot?
0:-1});this.showRoot?(this.domNode.setAttribute("aria-multiselectable",!this.dndController.singular),this.rootLoadingIndicator.style.display="none"):(T.rowNode.style.display="none",this.domNode.setAttribute("role","presentation"),this.domNode.removeAttribute("aria-expanded"),this.domNode.removeAttribute("aria-multiselectable"),this["aria-label"]?(T.containerNode.setAttribute("aria-label",this["aria-label"]),this.domNode.removeAttribute("aria-label")):this["aria-labelledby"]&&(T.containerNode.setAttribute("aria-labelledby",
this["aria-labelledby"]),this.domNode.removeAttribute("aria-labelledby")),T.labelNode.setAttribute("role","presentation"),T.labelNode.removeAttribute("aria-selected"),T.containerNode.setAttribute("role","tree"),T.containerNode.setAttribute("aria-expanded","true"),T.containerNode.setAttribute("aria-multiselectable",!this.dndController.singular));this.containerNode.appendChild(T.domNode);N=this.model.getIdentity(N);this._itemNodesMap[N]?this._itemNodesMap[N].push(T):this._itemNodesMap[N]=[T];T._updateLayout();
this._expandNode(T).then(n.hitch(this,function(){this._destroyed||(this.rootLoadingIndicator.style.display="none",this.expandChildrenDeferred.resolve(!0))}))}),n.hitch(this,function(N){console.error(this,": error loading root: ",N)}))},getNodesByItem:function(N){if(!N)return[];N=n.isString(N)?N:this.model.getIdentity(N);return[].concat(this._itemNodesMap[N])},_setSelectedItemAttr:function(N){this.set("selectedItems",[N])},_setSelectedItemsAttr:function(N){var T=this;return this.pendingCommandsPromise=
this.pendingCommandsPromise.always(n.hitch(this,function(){var ca=O.map(N,function(Q){return!Q||n.isString(Q)?Q:T.model.getIdentity(Q)}),ia=[];O.forEach(ca,function(Q){ia=ia.concat(T._itemNodesMap[Q]||[])});this.set("selectedNodes",ia)}))},_setPathAttr:function(N){return N.length?Y(this.set("paths",[N]).then(function(T){return T[0]})):Y(this.set("paths",[]).then(function(T){return T[0]}))},_setPathsAttr:function(N){function T(ia,Q){var W=ia.shift(),Z=O.filter(Q,function(fa){return fa.getIdentity()==
W})[0];if(Z)return ia.length?ca._expandNode(Z).then(function(){return T(ia,Z.getChildren())}):Z;throw new ea.PathError("Could not expand path at "+W);}var ca=this;return Y(this.pendingCommandsPromise=this.pendingCommandsPromise.always(function(){return h(O.map(N,function(ia){ia=O.map(ia,function(Q){return Q&&n.isObject(Q)?ca.model.getIdentity(Q):Q});if(ia.length)return T(ia,[ca.rootNode]);throw new ea.PathError("Empty path");}))}).then(function(ia){ca.set("selectedNodes",ia);return ca.paths}))},_setSelectedNodeAttr:function(N){this.set("selectedNodes",
[N])},_setSelectedNodesAttr:function(N){this.dndController.setSelection(N)},expandAll:function(){function N(ca){return T._expandNode(ca).then(function(){var ia=O.filter(ca.getChildren()||[],function(Q){return Q.isExpandable});return h(O.map(ia,N))})}var T=this;return Y(N(this.rootNode))},collapseAll:function(){function N(ca){var ia=O.filter(ca.getChildren()||[],function(Q){return Q.isExpandable});ia=h(O.map(ia,N));return!ca.isExpanded||ca==T.rootNode&&!T.showRoot?ia:ia.then(function(){return T._collapseNode(ca)})}
var T=this;return Y(N(this.rootNode))},mayHaveChildren:function(){},getItemChildren:function(){},getLabel:function(N){return this.model.getLabel(N)},getIconClass:function(N,T){return!N||this.model.mayHaveChildren(N)?T?"dijitFolderOpened":"dijitFolderClosed":"dijitLeaf"},getLabelClass:function(){},getRowClass:function(){},getIconStyle:function(){},getLabelStyle:function(){},getRowStyle:function(){},getTooltip:function(){return""},_onDownArrow:function(N,T){(N=this._getNext(T))&&N.isTreeNode&&this.focusNode(N)},
_onUpArrow:function(N,T){if(N=T.getPreviousSibling())for(T=N;T.isExpandable&&T.isExpanded&&T.hasChildren();)T=T.getChildren(),T=T[T.length-1];else if(N=T.getParent(),this.showRoot||N!==this.rootNode)T=N;T&&T.isTreeNode&&this.focusNode(T)},_onRightArrow:function(N,T){T.isExpandable&&!T.isExpanded?this._expandNode(T):T.hasChildren()&&(T=T.getChildren()[0])&&T.isTreeNode&&this.focusNode(T)},_onLeftArrow:function(N,T){T.isExpandable&&T.isExpanded?this._collapseNode(T):(N=T.getParent())&&N.isTreeNode&&
(this.showRoot||N!==this.rootNode)&&this.focusNode(N)},focusLastChild:function(){var N=this._getLast();N&&N.isTreeNode&&this.focusNode(N)},_getFirst:function(){return this.showRoot?this.rootNode:this.rootNode.getChildren()[0]},_getLast:function(){for(var N=this.rootNode;N.isExpanded;){var T=N.getChildren();if(!T.length)break;N=T[T.length-1]}return N},_getNext:function(N){if(N.isExpandable&&N.isExpanded&&N.hasChildren())return N.getChildren()[0];for(;N&&N.isTreeNode;){var T=N.getNextSibling();if(T)return T;
N=N.getParent()}return null},childSelector:".dijitTreeRow",isExpandoNode:function(N,T){return r.isDescendant(N,T.expandoNode)||r.isDescendant(N,T.expandoNodeText)},_onNodePress:function(N,T){this.focusNode(N)},__click:function(N,T,ca,ia){var Q=this.isExpandoNode(T.target,N);N.isExpandable&&(ca||Q)?this._onExpandoClick({node:N}):(this._publish("execute",{item:N.item,node:N,evt:T}),this[ia](N.item,N,T),this.focusNode(N));T.stopPropagation();T.preventDefault()},_onClick:function(N,T){this.__click(N,
T,this.openOnClick,"onClick")},_onDblClick:function(N,T){this.__click(N,T,this.openOnDblClick,"onDblClick")},_onExpandoClick:function(N){N=N.node;this.focusNode(N);N.isExpanded?this._collapseNode(N):this._expandNode(N)},onClick:function(){},onDblClick:function(){},onOpen:function(){},onClose:function(){},_getNextNode:function(N){a.deprecated(this.declaredClass+"::_getNextNode(node) is deprecated. Use _getNext(node) instead.","","2.0");return this._getNext(N)},_getRootOrFirstNode:function(){a.deprecated(this.declaredClass+
"::_getRootOrFirstNode() is deprecated. Use _getFirst() instead.","","2.0");return this._getFirst()},_collapseNode:function(N){N._expandNodeDeferred&&delete N._expandNodeDeferred;if("Loading"!=N.state&&N.isExpanded){var T=N.collapse();this.onClose(N.item,N);this._state(N,!1);this._startPaint(T);return T}},_expandNode:function(N){if(N._expandNodeDeferred)return N._expandNodeDeferred;var T=this.model,ca=N.item,ia=this;N._loadDeferred||(N.markProcessing(),N._loadDeferred=new f,T.getChildren(ca,function(Q){N.unmarkProcessing();
N.setChildItems(Q).then(function(){N._loadDeferred.resolve(Q)})},function(Q){console.error(ia,": error loading "+N.label+" children: ",Q);N._loadDeferred.reject(Q)}));T=N._loadDeferred.then(n.hitch(this,function(){var Q=N.expand();this.onOpen(N.item,N);this._state(N,!0);return Q}));this._startPaint(T);return T},focusNode:function(N){for(var T=[],ca=this.domNode;ca&&ca.tagName&&"IFRAME"!==ca.tagName.toUpperCase();ca=ca.parentNode)T.push({domNode:ca.contentWindow||ca,scrollLeft:ca.scrollLeft||0,scrollTop:ca.scrollTop||
0});this.focusChild(N);this.defer(function(){for(var ia=0,Q=T.length;ia<Q;ia++)T[ia].domNode.scrollLeft=T[ia].scrollLeft,T[ia].domNode.scrollTop=T[ia].scrollTop},0)},_onNodeMouseEnter:function(){},_onNodeMouseLeave:function(){},_onItemChange:function(N){var T=this.model.getIdentity(N);if(T=this._itemNodesMap[T]){var ca=this.getLabel(N),ia=this.getTooltip(N);O.forEach(T,function(Q){Q.set({item:N,label:ca,tooltip:ia});Q._updateItemClasses(N)})}},_onItemChildrenChange:function(N,T){N=this.model.getIdentity(N);
(N=this._itemNodesMap[N])&&O.forEach(N,function(ca){ca.setChildItems(T)})},_onItemDelete:function(N){N=this.model.getIdentity(N);var T=this._itemNodesMap[N];T&&(O.forEach(T,function(ca){this.dndController.removeTreeNode(ca);var ia=ca.getParent();ia&&ia.removeChild(ca);this.lastFocusedChild&&!r.isDescendant(this.lastFocusedChild.domNode,this.domNode)&&delete this.lastFocusedChild;this.focusedChild&&!r.isDescendant(this.focusedChild.domNode,this.domNode)&&this.focus();ca.destroyRecursive()},this),delete this._itemNodesMap[N])},
_initState:function(){this._openedNodes={};if(this.persist&&this.cookieName){var N=F(this.cookieName);N&&O.forEach(N.split(","),function(T){this._openedNodes[T]=!0},this)}},_state:function(N,T){if(!this.persist)return!1;var ca=O.map(N.getTreePath(),function(ia){return this.model.getIdentity(ia)},this).join("/");if(1===arguments.length)return this._openedNodes[ca];T?this._openedNodes[ca]=!0:delete this._openedNodes[ca];this._saveExpandedNodes()},_saveExpandedNodes:function(){if(this.persist&&this.cookieName){var N=
[],T;for(T in this._openedNodes)N.push(T);F(this.cookieName,N.join(","),{expires:365})}},destroy:function(){this._curSearch&&(this._curSearch.timer.remove(),delete this._curSearch);this.rootNode&&this.rootNode.destroyRecursive();this.dndController&&!n.isString(this.dndController)&&this.dndController.destroy();this.rootNode=null;this.inherited(arguments)},destroyRecursive:function(){this.destroy()},resize:function(N){N&&v.setMarginBox(this.domNode,N);this._nodePixelIndent=v.position(this.tree.indentDetector).w||
this._nodePixelIndent;this.expandChildrenDeferred.then(n.hitch(this,function(){this.rootNode.set("indent",this.showRoot?0:-1);this._adjustWidths()}))},_outstandingPaintOperations:0,_startPaint:function(N){this._outstandingPaintOperations++;this._adjustWidthsTimer&&(this._adjustWidthsTimer.remove(),delete this._adjustWidthsTimer);var T=n.hitch(this,function(){this._outstandingPaintOperations--;0>=this._outstandingPaintOperations&&!this._adjustWidthsTimer&&this._started&&(this._adjustWidthsTimer=this.defer("_adjustWidths"))});
u(N,T,T)},_adjustWidths:function(){this._adjustWidthsTimer&&(this._adjustWidthsTimer.remove(),delete this._adjustWidthsTimer);this.containerNode.style.width="auto";this.containerNode.style.width=this.domNode.scrollWidth>this.domNode.offsetWidth?"auto":"100%"},_createTreeNode:function(N){return new aa(N)},focus:function(){this.lastFocusedChild?this.focusNode(this.lastFocusedChild):this.focusFirstChild()}});b("dojo-bidi")&&ea.extend({_setTextDirAttr:function(N){N&&this.textDir!=N&&(this._set("textDir",
N),this.rootNode.set("textDir",N))}});ea.PathError=g("TreePathError");ea._TreeNode=aa;return ea})},"dijit/tree/TreeStoreModel":function(){define(["dojo/_base/array","dojo/aspect","dojo/_base/declare","dojo/_base/lang"],function(O,B,F,E){return F("dijit.tree.TreeStoreModel",null,{store:null,childrenAttrs:["children"],newItemIdAttr:"id",labelAttr:"",root:null,query:null,deferItemLoadingUntilExpand:!1,constructor:function(f){E.mixin(this,f);this.connects=[];f=this.store;if(!f.getFeatures()["dojo.data.api.Identity"])throw Error("dijit.tree.TreeStoreModel: store must support dojo.data.Identity");
f.getFeatures()["dojo.data.api.Notification"]&&(this.connects=this.connects.concat([B.after(f,"onNew",E.hitch(this,"onNewItem"),!0),B.after(f,"onDelete",E.hitch(this,"onDeleteItem"),!0),B.after(f,"onSet",E.hitch(this,"onSetItem"),!0)]))},destroy:function(){for(var f;f=this.connects.pop();)f.remove()},getRoot:function(f,h){this.root?f(this.root):this.store.fetch({query:this.query,onComplete:E.hitch(this,function(r){if(1!=r.length)throw Error("dijit.tree.TreeStoreModel: root query returned "+r.length+
" items, but must return exactly one");this.root=r[0];f(this.root)}),onError:h})},mayHaveChildren:function(f){return O.some(this.childrenAttrs,function(h){return this.store.hasAttribute(f,h)},this)},getChildren:function(f,h,r){var c=this.store;if(c.isItemLoaded(f)){for(var v=[],p=0;p<this.childrenAttrs.length;p++){var g=c.getValues(f,this.childrenAttrs[p]);v=v.concat(g)}var e=0;this.deferItemLoadingUntilExpand||O.forEach(v,function(a){c.isItemLoaded(a)||e++});0==e?h(v):O.forEach(v,function(a,m){c.isItemLoaded(a)||
c.loadItem({item:a,onItem:function(n){v[m]=n;0==--e&&h(v)},onError:r})})}else{var b=E.hitch(this,arguments.callee);c.loadItem({item:f,onItem:function(a){b(a,h,r)},onError:r})}},isItem:function(f){return this.store.isItem(f)},fetchItemByIdentity:function(f){this.store.fetchItemByIdentity(f)},getIdentity:function(f){return this.store.getIdentity(f)},getLabel:function(f){return this.labelAttr?this.store.getValue(f,this.labelAttr):this.store.getLabel(f)},newItem:function(f,h,r){var c={parent:h,attribute:this.childrenAttrs[0]},
v;this.newItemIdAttr&&f[this.newItemIdAttr]?this.fetchItemByIdentity({identity:f[this.newItemIdAttr],scope:this,onItem:function(p){p?this.pasteItem(p,null,h,!0,r):(v=this.store.newItem(f,c))&&void 0!=r&&this.pasteItem(v,h,h,!1,r)}}):(v=this.store.newItem(f,c))&&void 0!=r&&this.pasteItem(v,h,h,!1,r)},pasteItem:function(f,h,r,c,v){var p=this.store,g=this.childrenAttrs[0];h&&O.forEach(this.childrenAttrs,function(b){if(p.containsValue(h,b,f)){if(!c){var a=O.filter(p.getValues(h,b),function(m){return m!=
f});p.setValues(h,b,a)}g=b}});if(r)if("number"==typeof v){var e=p.getValues(r,g).slice();e.splice(v,0,f);p.setValues(r,g,e)}else p.setValues(r,g,p.getValues(r,g).concat(f))},onChange:function(){},onChildrenChange:function(){},onDelete:function(){},onNewItem:function(f,h){h&&this.getChildren(h.item,E.hitch(this,function(r){this.onChildrenChange(h.item,r)}))},onDeleteItem:function(f){this.onDelete(f)},onSetItem:function(f,h){if(-1!=O.indexOf(this.childrenAttrs,h))this.getChildren(f,E.hitch(this,function(r){this.onChildrenChange(f,
r)}));else this.onChange(f)}})})},"dijit/tree/ForestStoreModel":function(){define(["dojo/_base/array","dojo/_base/declare","dojo/_base/kernel","dojo/_base/lang","./TreeStoreModel"],function(O,B,F,E,f){return B("dijit.tree.ForestStoreModel",f,{rootId:"$root$",rootLabel:"ROOT",query:null,constructor:function(h){this.root={store:this,root:!0,id:h.rootId,label:h.rootLabel,children:h.rootChildren}},mayHaveChildren:function(h){return h===this.root||this.inherited(arguments)},getChildren:function(h,r,c){h===
this.root?this.root.children?r(this.root.children):this.store.fetch({query:this.query,onComplete:E.hitch(this,function(v){this.root.children=v;r(v)}),onError:c}):this.inherited(arguments)},isItem:function(h){return h===this.root?!0:this.inherited(arguments)},fetchItemByIdentity:function(h){if(h.identity==this.root.id){var r=h.scope||F.global;h.onItem&&h.onItem.call(r,this.root)}else this.inherited(arguments)},getIdentity:function(h){return h===this.root?this.root.id:this.inherited(arguments)},getLabel:function(h){return h===
this.root?this.root.label:this.inherited(arguments)},newItem:function(h,r,c){return r===this.root?(this.onNewRootItem(h),this.store.newItem(h)):this.inherited(arguments)},onNewRootItem:function(){},pasteItem:function(h,r,c,v,p){if(r===this.root&&!v)this.onLeaveRoot(h);this.inherited(arguments,[h,r===this.root?null:r,c===this.root?null:c,v,p]);if(c===this.root)this.onAddToRoot(h)},onAddToRoot:function(h){console.log(this,": item ",h," added to root")},onLeaveRoot:function(h){console.log(this,": item ",
h," removed from root")},_requeryTop:function(){var h=this.root.children||[];this.store.fetch({query:this.query,onComplete:E.hitch(this,function(r){this.root.children=r;if(h.length!=r.length||O.some(h,function(c,v){return r[v]!=c}))this.onChildrenChange(this.root,r)})})},onNewItem:function(h,r){this._requeryTop();this.inherited(arguments)},onDeleteItem:function(h){-1!=O.indexOf(this.root.children,h)&&this._requeryTop();this.inherited(arguments)},onSetItem:function(h,r,c,v){this._requeryTop();this.inherited(arguments)}})})},
"dijit/tree/_dndSelector":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/kernel dojo/_base/lang dojo/dnd/common dojo/dom dojo/mouse dojo/on dojo/touch ../a11yclick ./_dndContainer".split(" "),function(O,B,F,E,f,h,r,c,v,p,g){return B("dijit.tree._dndSelector",g,{constructor:function(){this.selection={};this.anchor=null;this.events.push(c(this.tree.domNode,v.press,E.hitch(this,"onMouseDown")),c(this.tree.domNode,v.release,E.hitch(this,"onMouseUp")),c(this.tree.domNode,v.move,E.hitch(this,
"onMouseMove")),c(this.tree.domNode,p.press,E.hitch(this,"onClickPress")),c(this.tree.domNode,p.release,E.hitch(this,"onClickRelease")))},singular:!1,getSelectedTreeNodes:function(){var e=[],b=this.selection,a;for(a in b)e.push(b[a]);return e},selectNone:function(){this.setSelection([]);return this},destroy:function(){this.inherited(arguments);this.selection=this.anchor=null},addTreeNode:function(e,b){this.setSelection(this.getSelectedTreeNodes().concat([e]));b&&(this.anchor=e);return e},removeTreeNode:function(e){var b=
O.filter(this.getSelectedTreeNodes(),function(a){return!h.isDescendant(a.domNode,e.domNode)});this.setSelection(b);return e},isTreeNodeSelected:function(e){return e.id&&!!this.selection[e.id]},setSelection:function(e){var b=this.getSelectedTreeNodes();O.forEach(this._setDifference(b,e),E.hitch(this,function(a){a.setSelected(!1);this.anchor==a&&delete this.anchor;delete this.selection[a.id]}));O.forEach(this._setDifference(e,b),E.hitch(this,function(a){a.setSelected(!0);this.selection[a.id]=a}));this._updateSelectionProperties()},
_setDifference:function(e,b){O.forEach(b,function(a){a.__exclude__=!0});e=O.filter(e,function(a){return!a.__exclude__});O.forEach(b,function(a){delete a.__exclude__});return e},_updateSelectionProperties:function(){var e=this.getSelectedTreeNodes(),b=[],a=[];O.forEach(e,function(m){var n=m.getTreePath();a.push(m);b.push(n)},this);e=O.map(a,function(m){return m.item});this.tree._set("paths",b);this.tree._set("path",b[0]||[]);this.tree._set("selectedNodes",a);this.tree._set("selectedNode",a[0]||null);
this.tree._set("selectedItems",e);this.tree._set("selectedItem",e[0]||null)},onClickPress:function(e){if(!(this.current&&this.current.isExpandable&&this.tree.isExpandoNode(e.target,this.current))){"mousedown"==e.type&&r.isLeft(e)&&e.preventDefault();var b="keydown"==e.type?this.tree.focusedChild:this.current;if(b){var a=f.getCopyKeyState(e),m=b.id;this.singular||e.shiftKey||!this.selection[m]?(this._doDeselect=!1,this.userSelect(b,a,e.shiftKey)):this._doDeselect=!0}}},onClickRelease:function(e){this._doDeselect&&
(this._doDeselect=!1,this.userSelect("keyup"==e.type?this.tree.focusedChild:this.current,f.getCopyKeyState(e),e.shiftKey))},onMouseMove:function(){this._doDeselect=!1},onMouseDown:function(){},onMouseUp:function(){},_compareNodes:function(e,b){if(e===b)return 0;if("sourceIndex"in document.documentElement)return e.sourceIndex-b.sourceIndex;if("compareDocumentPosition"in document.documentElement)return e.compareDocumentPosition(b)&2?1:-1;if(document.createRange){var a=doc.createRange();a.setStartBefore(e);
e=doc.createRange();e.setStartBefore(b);return a.compareBoundaryPoints(a.END_TO_END,e)}throw Error("dijit.tree._compareNodes don't know how to compare two different nodes in this browser");},userSelect:function(e,b,a){if(this.singular)this.anchor==e&&b?this.selectNone():(this.setSelection([e]),this.anchor=e);else if(a&&this.anchor){b=this._compareNodes(this.anchor.rowNode,e.rowNode);a=this.anchor;0>b?b=a:(b=e,e=a);for(a=[];b!=e;)a.push(b),b=this.tree._getNext(b);a.push(e);this.setSelection(a)}else this.selection[e.id]&&
b?this.removeTreeNode(e):b?this.addTreeNode(e,!0):(this.setSelection([e]),this.anchor=e)},getItem:function(e){return{data:this.selection[e],type:["treeNode"]}},forInSelectedItems:function(e,b){b=b||F.global;for(var a in this.selection)e.call(b,this.getItem(a),a,this)}})})},"dijit/tree/_dndContainer":function(){define("dojo/aspect dojo/_base/declare dojo/dom-class dojo/_base/lang dojo/on dojo/touch".split(" "),function(O,B,F,E,f,h){return B("dijit.tree._dndContainer",null,{constructor:function(r,c){this.tree=
r;this.node=r.domNode;E.mixin(this,c);this.containerState="";F.add(this.node,"dojoDndContainer");this.events=[f(this.node,h.enter,E.hitch(this,"onOverEvent")),f(this.node,h.leave,E.hitch(this,"onOutEvent")),O.after(this.tree,"_onNodeMouseEnter",E.hitch(this,"onMouseOver"),!0),O.after(this.tree,"_onNodeMouseLeave",E.hitch(this,"onMouseOut"),!0),f(this.node,"dragstart, selectstart",function(v){v.preventDefault()})]},destroy:function(){for(var r;r=this.events.pop();)r.remove();this.node=this.parent=
null},onMouseOver:function(r){this.current=r},onMouseOut:function(){this.current=null},_changeState:function(r,c){var v="dojoDnd"+r;r=r.toLowerCase()+"State";F.replace(this.node,v+c,v+this[r]);this[r]=c},_addItemClass:function(r,c){F.add(r,"dojoDndItem"+c)},_removeItemClass:function(r,c){F.remove(r,"dojoDndItem"+c)},onOverEvent:function(){this._changeState("Container","Over")},onOutEvent:function(){this._changeState("Container","")}})})},"jimu/dijit/LayerChooserFromMapWithDropbox":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/html dojo/on dojo/keys dojo/Evented dojo/Deferred dijit/popup dijit/_WidgetBase dijit/_TemplatedMixin dojo/text!./templates/LayerChooserFromMapWithDropbox.html jimu/LayerInfos/LayerInfos".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e){return O([v,p,h],{templateString:g,baseClass:"jimu-layer-chooser-from-map-withdropbox",declaredClass:"jimu.dijit.LayerChooserFromMapWithDropbox",_selectedItem:null,_isLayerChooserShow:!1,layerInfosObj:null,layerChooser:null,customClass:"",postMixInProperties:function(){this.inherited(arguments);this.nls=window.jimuNls.queryableLayerSource;this.nls.customSelectLayer=this.label?this.label:this.nls.selectLayer},postCreate:function(){this.inherited(arguments);this.layerInfosObj=
e.getInstanceSync();this.layerChooser.domNode.style.zIndex=1;this.layerChooser.tree.domNode.style.borderTop="0";this.layerChooser.tree.domNode.style.maxHeight="290px";this.own(E(this.layerChooser,"tree-click",B.hitch(this,this._onTreeClick)));this.own(E(this.layerChooser,"update",B.hitch(this,this._onLayerChooserUpdate)));this.own(E(document.body,"click",B.hitch(this,this._onBodyClicked)));this.own(E(document.body,"keydown",B.hitch(this,function(b){b.keyCode===f.ENTER&&this._onBodyClicked(b)})));
this.own(E(this.layerChooser.domNode,"keydown",B.hitch(this,function(b){b.keyCode===f.ESCAPE&&this.hideLayerChooser()})))},destroy:function(){this.hideLayerChooser();this.layerChooser&&this.layerChooser.destroy();this.layerChooser=null;this.inherited(arguments)},getLayerChooser:function(){return this.layerChooser},setSelectedLayer:function(b){var a=new r;if(b){var m=this.layerInfosObj.getLayerOrTableInfoById(b.id);m?this.layerChooser.filter(m).then(B.hitch(this,function(n){n?(this._onSelectNewItem({layerInfo:m,
name:m.title,url:b.url}),a.resolve(!0)):a.resolve(!1)}),B.hitch(this,function(){a.resolve(!1)})):a.resolve(!1)}else this._onSelectNewItem(null),a.resolve(!0);return a},getSelectedItem:function(){return this._selectedItem},getSelectedItems:function(){return[this._selectedItem]},_onBodyClicked:function(b){b=b.target||b.srcElement;b===this.domNode||F.isDescendant(b,this.domNode)||b===this.layerChooser.domNode||F.isDescendant(b,this.layerChooser.domNode)||this.hideLayerChooser()},_onDropDownClick:function(b){b.stopPropagation();
b.preventDefault();this._isLayerChooserShow?this.hideLayerChooser():(this.isActive=!0,this.showLayerChooser())},_onDropDownKeydown:function(b){b.keyCode===f.ENTER&&this._onDropDownClick(b)},_getSelectedItems:function(){return this.layerChooser.getSelectedItems()},showLayerChooser:function(){this.layerChooser.domNode.style.minWidth=this.domNode.clientWidth+2+"px";c.open({parent:this,popup:this.layerChooser,around:this.domNode});var b=this.layerChooser.domNode.parentNode;b&&(F.addClass(b,"jimu-layer-chooser-from-map-withdropbox-popup"),
this.customClass&&F.addClass(b,this.customClass),this.layerChooser.tree.domNode.focus());this._isLayerChooserShow=!0},hideLayerChooser:function(){c.close(this.layerChooser);this._isLayerChooserShow=!1;this.isActive&&(this.dropDownBtn.focus(),this.isActive=!1)},_onLayerChooserUpdate:function(){this._selectedItem&&this.layerChooser.onlyShowVisible&&!this._selectedItem.layerInfo.isShowInMap()&&(this._selectedItem=null,this.emit("selection-change",[]))},_onSelectNewItem:function(b){var a=B.getObject("layerInfo.id",
!1,this._selectedItem)||-1,m=B.getObject("layerInfo.id",!1,b)||-1;a=a!==m;this._selectedItem=b;this.hideLayerChooser();b=B.getObject("layerInfo.title",!1,this._selectedItem)||"";this.layerNameNode.innerHTML=b;F.setAttr(this.layerNameNode,"title",b);b=B.getObject("layerInfo.layerObject",!1,this._selectedItem);a&&this.emit("selection-change",[b])},_onTreeClick:function(){var b=this._getSelectedItems();this._onSelectNewItem(0<b.length?b[0]:null)}})})},"widgets/SmartEditor/utils":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array esri/geometry/Extent jimu/utils esri/dijit/AttributeInspector".split(" "),
function(O,B,F,E,f,h){var r={};r.ATI=O([h],{constructor:function(){this._aiConnects=[];this._selection=[];this._toolTips=[]}});r.checkIfFieldAliasAlreadyExists=function(c,v){return 0<=c.split(",").indexOf(v)};r.pointToExtent=function(c,v,p){var g=c.extent.getWidth()/c.width;p*=g;return new E(v.x-p,v.y-p,v.x+p,v.y+p,c.spatialReference)};r.filterOnlyUpdatedAttributes=function(c,v,p){if(null===v||void 0===v)return c;var g={},e;for(e in c)c.hasOwnProperty(e)&&(e===p.objectIdField||e===p.globalIdField?
g[e]=c[e]:(null!==c[e]||""!==v[e])&&c[e]!==v[e]&&(g[e]=c[e]));return g};r.mergeFieldInfosWithConfiguration=function(c,v){var p=[],g=this.getDefaultEditableFieldInfos(c,!1);v&&v.fieldInfos?(F.forEach(v.fieldInfos,function(a){F.some(g,function(m){if(a.fieldName===m.fieldName)return p.push(this.mergeLastToFirst(m,a)),!0},this)},this),F.forEach(g,function(a){0===F.filter(p,function(m){return m.fieldName===a.fieldName},this).length&&p.push(a)},this)):p=g;var e=[];c.layerObject.hasOwnProperty("globalIdField")&&
void 0!==c.layerObject.globalIdField&&null!==c.layerObject.globalIdField&&e.push(c.layerObject.globalIdField);c.layerObject.hasOwnProperty("objectIdField")&&void 0!==c.layerObject.objectIdField&&null!==c.layerObject.objectIdField&&e.push(c.layerObject.objectIdField);if(c.layerObject.hasOwnProperty("editFieldsInfo")&&void 0!==c.layerObject.editFieldsInfo&&null!==c.layerObject.editFieldsInfo)for(var b in c.layerObject.editFieldsInfo)c.layerObject.editFieldsInfo.hasOwnProperty(b)&&e.push(c.layerObject.editFieldsInfo[b]);
return p=p.filter(function(a){return-1!==F.indexOf(e,a.fieldName)?!1:a.isEditableOnLayer})};r.getDefaultEditableFieldInfos=function(c,v){var p=[],g=this.getFieldInfosFromWebmap(c);c=this.getFieldInfosLayer(c);if(void 0===g||null===g)g=c;else{var e=[];F.forEach(c,function(b){0===F.filter(g,function(a){return a.name===b.fieldName}).length&&(b.isEditableOnLayer=b.editable,e.push(b))});0<e.length&&(g=g.concat(e))}F.forEach(g,function(b){!1===b.hasOwnProperty("isEditableOnLayer")&&(b.isEditableOnLayer=
b.editable);!1===b.editable&&(b.isEditable=b.editable);!1===b.isEditable&&(b.editable=b.isEditable);!0===b.editable&&(b.visible=!0);b.fieldName=b.name;!0===b.editable&&!0===v?p.push(B.clone(b)):!1===v&&p.push(B.clone(b))});return p};r.updatePopupDateFormat=function(c){var v={shortDate:{datePattern:"M/d/y"},shortDateLE:{datePattern:"d/M/y"},longMonthDayYear:{datePattern:"MMMM d, y"},dayShortMonthYear:{datePattern:"d MMM y"},longDate:{datePattern:"EEEE, MMMM d, y",selector:"date"},shortDateShortTime:{datePattern:"M/d/y",
timePattern:"h:mm a",timeEnabled:!0},shortDateLEShortTime:{datePattern:"d/M/y",timePattern:"h:mm a",timeEnabled:!0},shortDateShortTime24:{datePattern:"M/d/y",timePattern:"H:mm",timeEnabled:!0},shortDateLEShortTime24:{datePattern:"d/M/y",timePattern:"H:mm",timeEnabled:!0},shortDateLongTime:{datePattern:"M/d/y",timePattern:"h:mm:ss a",timeEnabled:!0},shortDateLELongTime:{datePattern:"d/M/y",timePattern:"h:mm:ss a",timeEnabled:!0},shortDateLongTime24:{datePattern:"M/d/y",timePattern:"H:mm:ss",timeEnabled:!0},
shortDateLELongTime24:{datePattern:"d/M/y",timePattern:"H:mm:ss",timeEnabled:!0},longMonthYear:{datePattern:"MMMM y"},shortMonthYear:{datePattern:"MMM y"},year:{datePattern:"y"}},p="",g;for(g in v)if(f.isEqual(c,v[g])){p=g;break}return p};r.getFieldInfosFromWebmap=function(c){var v=null,p=c.getPopupInfo();p&&p.fieldInfos&&(v=[],F.forEach(p.fieldInfos,function(g){F.some(c.layerObject.fields,function(e){if(e.name===g.fieldName)return e=this.mergeFirstToLast(g,e),e.format&&e.format.dateFormat&&(e.format.dateFormat.hasOwnProperty("datePattern")||
e.format.dateFormat.hasOwnProperty("timePattern"))&&(e.format.dateFormat=this.updatePopupDateFormat(e.format.dateFormat)),e.format&&e.format.dateFormat&&e.format.dateFormat.toLowerCase()&&0<=e.format.dateFormat.toLowerCase().indexOf("time")&&(e.format.time=!0),v.push(e),!0},this)},this));return v};r.getFieldInfosLayer=function(c){var v=[];c&&c.layerObject&&F.forEach(c.layerObject.fields,function(p){var g=f.getDefaultPortalFieldInfo(p);g=this.mergeFirstToLast(g,p);g.format&&g.format.dateFormat&&(g.format.dateFormat.hasOwnProperty("datePattern")||
g.format.dateFormat.hasOwnProperty("timePattern"))&&(g.format.dateFormat=this.updatePopupDateFormat(g.format.dateFormat));g.format&&g.format.dateFormat&&g.format.dateFormat.toLowerCase()&&0<=g.format.dateFormat.toLowerCase().indexOf("time")&&(g.format.time=!0);g.visible=!0;v.push(g)},this);return v};r.getConfigInfos=function(c,v,p,g,e){var b=[],a=c.getLayerInfoArrayOfWebmap(),m=[];e&&(m=c.getTableInfoArrayOfWebmap(),a=a.concat(m));F.forEach(a,function(n){var l=!1;"Table"!==n.layerObject.type&&"Feature Layer"!==
n.layerObject.type||!n.layerObject.url||(n.layerObject.isEditable&&n.layerObject.isEditable()&&p?l=!0:void 0!==p&&!1===p&&(l=!0));if(!0===l){var k=this.getConfigInfo(n,v);k.layerInfo=n;!0===k.featureLayer.layerAllowsDelete&&!1===k.featureLayer.layerAllowsCreate&&!1===k.featureLayer.layerAllowsUpdate?console.warn(k.layerInfo.title+" delete only not supported"):g&&!0===g?!0===F.some(v,function(y){return y.featureLayer.id===k.featureLayer.id})&&b.push(k):b.push(k)}},this);return b};r.getConfigInfo=function(c,
v){var p=null,g=this.createDefaultConfigInfo(c);!1===F.some(v,function(e){return e.featureLayer&&e.featureLayer.id===c.layerObject.id?(p=B.clone(e),p.fieldInfos=this.mergeFieldInfosWithConfiguration(c,p),p=this.mergeDefaultWithConfig(p,g),!0):!1},this)&&(p=g);return p};r.mergeDefaultWithConfig=function(c,v){c.featureLayer=v.featureLayer;!0===c.allowDelete&&!1===c.featureLayer.layerAllowsDelete&&(c.allowDelete=!1);!1===c.disableGeometryUpdate&&!1===c.featureLayer.layerAllowGeometryUpdates&&(c.disableGeometryUpdate=
!0);!1===c.featureLayer.layerAllowsCreate&&!0===c.featureLayer.layerAllowsUpdate&&(c.allowUpdateOnly=!0);return c};r.createDefaultConfigInfo=function(c){var v=!1,p=!1,g=!1,e=!1;try{var b=c.layerObject.getEditCapabilities();b.canCreate&&(v=!0);b.canUpdate&&(e=p=!0);b.canDelete&&(g=!0)}catch(a){c.layerObject.hasOwnProperty("capabilities")&&(-1===String(c.layerObject.capabilities).indexOf("Update")&&-1===String(c.layerObject.capabilities).indexOf("Delete")&&-1===String(c.layerObject.capabilities).indexOf("Create")&&
-1!==String(c.layerObject.capabilities).indexOf("Editing")?v=g=p=!0:(-1!==String(c.layerObject.capabilities).indexOf("Update")&&(e=p=!0),-1!==String(c.layerObject.capabilities).indexOf("Delete")&&(g=!0),-1!==String(c.layerObject.capabilities).indexOf("Create")&&(v=!0)))}c.layerObject.hasOwnProperty("allowGeometryUpdates")&&(e=c.layerObject.allowGeometryUpdates);"Table"===c.layerObject.type&&c.layerObject.url&&c.getCapabilitiesOfWebMap()&&(p=c.getCapabilitiesOfWebMap(),c.layerObject.isEditable&&c.layerObject.isEditable()&&
p&&-1<p.toLowerCase().indexOf("editing")?p=!0:g=p=v=!1,e=!1);e=e&&p;return{featureLayer:{id:c.layerObject.id,layerAllowsCreate:v,layerAllowsUpdate:p,layerAllowsDelete:g,layerAllowGeometryUpdates:e},disableGeometryUpdate:!e,allowUpdateOnly:!v,allowDelete:!1,fieldInfos:this.mergeFieldInfosWithConfiguration(c,null),_editFlag:v||p?!0:!1}};r.mergeLastToFirst=function(){for(var c={},v=0,p=arguments.length,g;v<p;v++)for(g in arguments[v])arguments[v].hasOwnProperty(g)&&(c[g]=arguments[v][g]);return c};r.mergeFirstToLast=
function(){for(var c={},v=arguments.length-1,p;0<=v;v--)for(p in arguments[v])arguments[v].hasOwnProperty(p)&&(c[p]=arguments[v][p]);return c};r.isObjectEmpty=function(c){if(c)for(var v in c)if(c.hasOwnProperty(v))return!1;return!0};r.addDateTimeFormat=function(c){c&&c.format&&null!==c.format&&c.format.dateFormat&&null!==c.format.dateFormat&&0<=c.format.dateFormat.toString().toUpperCase().indexOf("TIME")&&(c.format.time=!0)};r.isDuplicateGroupName=function(c,v){var p=!1;F.some(v,B.hitch(this,function(g){if(c.toLowerCase()===
g.toLowerCase())return p=!0}));return p};return r})},"widgets/SmartEditor/presetBuilderBackwardCompatibility":function(){define(["dojo/_base/lang","dojo/_base/array","jimu/utils","./presetUtils"],function(O,B,F,E){var f={createPresetGroups:function(h,r){f.config=h;f._jimuLayerInfos=r;if(h.editor.presetInfos&&0<Object.keys(h.editor.presetInfos).length&&(h.attributeActionGroups?h.attributeActionGroups&&!h.attributeActionGroups.hasOwnProperty("Preset")&&(h.attributeActionGroups.Preset={}):h.attributeActionGroups=
{Intersection:{},Address:{},Coordinates:{},Preset:{}},!(h.attributeActionGroups&&h.attributeActionGroups.Preset&&0<Object.keys(h.attributeActionGroups.Preset).length)))for(var c in h.editor.presetInfos)f._addPresetGroupForField(h.editor.configInfos||h.editor.layerInfos,c)},_getDomainListForPresetGroup:function(h,r,c){var v=[];B.forEach(r.domain.codedValues,O.hitch(this,function(p){var g={showInList:!0,value:p.code,label:p.name,isDefault:!1};h.showOnlyDomainFields=!0;var e=f.config.editor.presetInfos[c][0];
"esriFieldTypeInteger"===h.dataType&&(e=Number(e));0<f.config.editor.presetInfos[c].length?p.code===e&&(g.isDefault=!0):0===v.length&&(g.isDefault=!0);v.push(g)}));return v},_addPresetGroupForField:function(h,r){var c;B.some(h,O.hitch(this,function(v){if(c)return!0;if(v.fieldValues&&v.fieldValues[r])for(var p=v.fieldValues[r],g=0;g<p.length;g++)if("Preset"===p[g].actionName&&p[g].enabled){p[g].attributeActionGroupName=r;var e=f._jimuLayerInfos.getLayerOrTableInfoById(v.featureLayer.id);if(e&&e.layerObject&&
e.layerObject.fields){g=E.getFieldInfoByFieldName(e.layerObject.fields,r);e=F.getDefaultPortalFieldInfo(g).label+" ("+r+")";p={};p.name=e;0<["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"].indexOf(g.type)?p.dataType="esriFieldTypeInteger":p.dataType=g.type;p.showOnlyDomainFields=!1;p.hideInPresetDisplay=!1;p.appliedOn=f._getPresetFieldsForAppliedOn(g,p);if(g.domain&&"range"!==g.domain.type)p.presetValue=f._getDomainListForPresetGroup(p,
g,r);else if("esriFieldTypeDate"===g.type){var b,a;0<f.config.editor.presetInfos[r].length?(isNaN(f.config.editor.presetInfos[r][0])||""===f.config.editor.presetInfos[r][0]||(a=new Date(f.config.editor.presetInfos[r][0])),f.config.editor.presetInfos[r][1]&&!isNaN(f.config.editor.presetInfos[r][1])&&(b=new Date(f.config.editor.presetInfos[r][1])),b=a&&b?new Date(a.getFullYear(),a.getMonth(),a.getDate(),b.getHours(),b.getMinutes(),b.getSeconds(),b.getMilliseconds()):a,p.presetValue=b?{dateType:"fixed",
dateTime:b.getTime()}:{dateType:"fixed",dateTime:""}):p.presetValue={dateType:"fixed",dateTime:""}}else p.presetValue=0<f.config.editor.presetInfos[r].length?f.config.editor.presetInfos[r][0]:null;f.config.attributeActionGroups.Preset[p.name]=p;c=!0;break}}!c&&v.relationshipInfos&&0<v.relationshipInfos.length&&(c=f._addPresetGroupForField(v.relationshipInfos,r))}));return c},_isPresetEnabledForLayer:function(h,r,c,v){if(h.fieldValues[r.name])for(var p=h.fieldValues[r.name],g=0;g<p.length;g++)if("Preset"===
p[g].actionName&&p[g].enabled){var e=f._jimuLayerInfos.getLayerOrTableInfoById(h.featureLayer.id).layerObject.fields;E.getFieldInfoByFieldName(e,r.name).type===r.type&&(p[g].attributeActionGroupName=v.name,c.hasOwnProperty(h.featureLayer.id)?c[h.featureLayer.id].push(r.name):c[h.featureLayer.id]=[r.name])}return c},_getPresetFieldsForAppliedOn:function(h,r){var c={};B.forEach(f.config.editor.configInfos||f.config.editor.layerInfos,O.hitch(this,function(v){v.fieldValues&&v.fieldValues[h.name]&&(c=
f._isPresetEnabledForLayer(v,h,c,r));v.relationshipInfos&&0<v.relationshipInfos.length&&B.forEach(v.relationshipInfos,O.hitch(this,function(p){p.fieldValues&&p.fieldValues[h.name]&&(c=f._isPresetEnabledForLayer(p,h,c,r))}))}));return c}};return f})},"widgets/SmartEditor/smartAttributes":function(){define("dojo/Evented dojo dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/dom-class dojo/on dojo/query dijit/registry jimu/filterUtils jimu/dijit/Filter jimu/BaseWidgetSetting".split(" "),function(O,
B,F,E,f,h,r,c,v,p,g,e){return F([e,O],{_attrInspector:null,_fieldValidation:null,_feature:null,_fieldInfo:null,_gdbRequiredFields:null,_notEditableFields:null,_fieldNameToAlias:null,_fieldsWithRules:null,_attTable:null,_filterUtils:null,_mapLayer:null,OPERATORS:null,constructor:function(){this.inherited(arguments);E.mixin(this,arguments[0]);String.prototype.endsWith||(String.prototype.endsWith=function(a,m){if(void 0===m||m>this.length)m=this.length;return this.substring(m-a.length,m)===a});this.useFieldName=
!1;this._mapLayer=this._feature.getLayer();this._attTable=c("td.atiLabel",this._attrInspector.domNode);if(0<this._attTable.length){var b=this._attTable[0];b&&b.hasAttribute("data-fieldname")&&(this.useFieldName=!0)}this._processLayer();this._filterUtils=new p;this.OPERATORS=E.clone(this._filterUtils.OPERATORS);void 0!==this._attTable&&null!==this._attTable&&this._bindEvents()},_processLayer:function(){this._gdbRequiredFields=[];this._notEditableFields=[];this._fieldsWithRules=[];f.forEach(this._fieldInfo,
function(b){if(!0===this.useFieldName||!1===b.hasOwnProperty("label"))var a=b.fieldName;else a=b.label,0<=a.indexOf('\x3ca class\x3d"asteriskIndicator"\x3e *\x3c/a\x3e')&&(a=a.replace('\x3ca class\x3d"asteriskIndicator"\x3e *\x3c/a\x3e',""));!1===b.nullable&&!0===b.isEditable&&this._gdbRequiredFields.push(a);!1!==b.isEditable&&!1!==b.isEditableSettingInWebmap||this._notEditableFields.push(a);this._fieldValidation&&this._fieldValidation.hasOwnProperty(b.fieldName)&&this._fieldsWithRules.push(a)},this)},
toggleFields:function(b){b="undefined"!==typeof b&&null!==b?b:!0;if(void 0!==this._attTable&&null!==this._attTable&&void 0!==this._fieldValidation&&null!==this._fieldValidation&&void 0!==this._feature&&null!==this._feature){var a=null,m=[],n;f.forEach(this._fieldInfo,E.hitch(this,function(l){if(!0===this.useFieldName||!1===l.hasOwnProperty("label"))var k=l.fieldName;else k=l.label,0<=k.indexOf('\x3ca class\x3d"asteriskIndicator"\x3e *\x3c/a\x3e')&&(k=k.replace('\x3ca class\x3d"asteriskIndicator"\x3e *\x3c/a\x3e',
""));a=null;n=this.validateField(l.fieldName);a=n[1];if("Required"===a&&"esriFieldTypeDate"===l.type){var y=this._getDijitForField(l.fieldName);y&&1<y.length&&null===y[1].get("value")&&(n[2]=!1)}n[2]&&"esriFieldTypeDate"===l.type&&(y=this._getDijitForField(l.fieldName))&&1<y.length&&null===y[0].get("value")&&(n[2]=!1);!1===n[2]&&m.push({fieldName:l.fieldName});!0===n[0]&&this.toggleFieldOnAttributeInspector(k,a,n[2],b,l.isEditable)}));return m}},_getDijitForField:function(b){var a;f.some(this._attrInspector._currentLInfo.fieldInfos,
E.hitch(this,function(m){if(m.fieldName===b)return a=m.dijit,!0}));return a},validateField:function(b){var a=null;if(this._fieldValidation.hasOwnProperty(b)){if(0===this._fieldValidation[b].length)return[!1,null,!0];var m=[!1,null,null];f.some(this._fieldValidation[b],function(n){if(void 0!==n.filter&&null!==n.filter&&(a=n.filter,m=[!0,null,null],this.processFilter(a,this._feature)))return"Required"===n.actionName?!1===this._feature.attributes.hasOwnProperty(b)?(m=[!0,n.actionName,!1],!0):null===
this._feature.attributes[b]||""===this._feature.attributes[b]?(m=[!0,n.actionName,!1],!0):this.myIsNaN(this._feature.attributes[b])?(m=[!0,n.actionName,!1],!0):(m=[!0,n.actionName,!0],!0):(m=[!0,n.actionName,null,n.submitWhenHidden],!0)},this);return m}return[!1,null,null]},_bindEvents:function(){void 0!==this._attTable&&null!==this._attTable&&0<this._attTable.length&&f.forEach(this._attTable,function(b){b=this._getRowInfo(b);-1!==this._fieldsWithRules.indexOf(b[3])&&"dijit.form.FilteringSelect"===
b[2].declaredClass&&r(b[2],"change",E.hitch(this,this._smartComboValidate()))},this)},process_relative_date:function(b,a,m){var n=new Date,l=this._isNumeric(a);if(void 0===b||null===b||""===b)return a;if(b==this.OPERATORS.dateOperatorMinutes&&!0===l)return n.setMinutes(n.getMinutes()-a);if(b==this.OPERATORS.dateOperatorHours&&!0===l)return n.setHours(n.getHours()-a);if(b==this.OPERATORS.dateOperatorDays&&!0===l)return n.setDate(n.getDate()-a);if(b==this.OPERATORS.dateOperatorWeeks&&!0===l)return n.setDate(n.getDate()-
7*a);if(b==this.OPERATORS.dateOperatorMonths&&!0===l)return n.setMonth(n.getMonth()-a);if(b==this.OPERATORS.dateOperatorYears&&!0===l)return n.setFullYear(n.getFullYear()-a);if("today"==b.toLowerCase())return(new Date(n.setDate(n.getDate()))).setHours(23,59,59,999);if("tomorrow"==b.toLowerCase())return(new Date(n.setDate(n.getDate()+1))).setHours(23,59,59,999);if("yesterday"==b.toLowerCase())return(new Date(n.setDate(n.getDate()-1))).setHours(23,59,59,999);if("thisweek"==b.toLowerCase()){var k=(new Date(n.setDate(n.getDate()-
n.getDay()))).setHours(0,0,0,0),y=(new Date(n.setDate(n.getDate()-n.getDay()+6))).setHours(23,59,59,999);return!0===m?k:y}if("thismonth"==b.toLowerCase())return k=(new Date(n.getFullYear(),n.getMonth(),1)).getTime(),y=(new Date(n.getFullYear(),n.getMonth()+1,0)).setHours(23,59,59,999),!0===m?k:y;if("thisquarter"==b.toLowerCase()){b=new Date(n.getTime());var u=b.getFullYear();b.setHours(0,0,0,0);a=(new Date(u,2,31)).setHours(23,59,59,999);l=(new Date(u,5,30)).setHours(23,59,59,999);var C=(new Date(u,
8,30)).setHours(23,59,59,999);u=(new Date(u,11,31)).setHours(23,59,59,999);b<=a&&(k=(new Date(n.getFullYear(),0,1)).getTime(),y=l);b<=l&&(k=a,y=l);b<=C&&(k=l,y=C);b<=u&&(k=C,y=u);return!0===m?k:y}return"thisyear"==b.toLowerCase()?(y=(new Date(n.getFullYear(),11,31)).setHours(23,59,59,999),k=(new Date(n.getFullYear(),0,1)).getTime(),!0===m?k:y):a},process_part:function(b){var a=null,m=null,n=null,l=null,k=null,y=null;b.valueObj.hasOwnProperty("value")&&(a=void 0===b.valueObj.virtualDate||null===b.valueObj.virtualDate?
null:b.valueObj.virtualDate,k=void 0===b.valueObj.range||null===b.valueObj.range?null:b.valueObj.range,m=b.valueObj.value);b.valueObj.hasOwnProperty("value1")&&(a=void 0===b.valueObj.virtualDate1||null===b.valueObj.virtualDate1?null:b.valueObj.virtualDate1,null===a&&(a=void 0===b.valueObj.virtualDate||null===b.valueObj.virtualDate?null:b.valueObj.virtualDate),k=void 0===b.valueObj.range1||null===b.valueObj.range1?null:b.valueObj.range1,m=b.valueObj.value1);b.valueObj.hasOwnProperty("value2")&&(n=
void 0===b.valueObj.virtualDate2||null===b.valueObj.virtualDate2?null:b.valueObj.virtualDate2,null===n&&(n=void 0===b.valueObj.virtualDate||null===b.valueObj.virtualDate?null:b.valueObj.virtualDate),y=void 0===b.valueObj.range2||null===b.valueObj.range2?null:b.valueObj.range2,l=b.valueObj.value2);"esriFieldTypeDate"==b.fieldObj.type&&(b.operator==this.OPERATORS.dateOperatorInTheLast?(null!==k&&(m=this.process_relative_date(k,m)),null!==y&&(l=this.process_relative_date(y,l))):b.operator==this.OPERATORS.dateOperatorNotInTheLast?
(null!==k&&(m=this.process_relative_date(k,m)),null!==y&&(l=this.process_relative_date(y,l))):b.operator==this.OPERATORS.dateOperatorIsIn?(m=this.process_relative_date(a,m,!0),l=this.process_relative_date(n,l,!1)):b.operator==this.OPERATORS.dateOperatorIsNotIn?(m=this.process_relative_date(a,m,!0),l=this.process_relative_date(n,l,!1)):(null!==a&&(m=this.process_relative_date(a,m,!1)),null!==n&&(l=this.process_relative_date(n,l,!1))));return[m,l]},processFilter:function(b){var a=[];f.forEach(b.parts,
function(m){if(m.hasOwnProperty("parts"))a.push(this.processFilter(m,this._feature));else{var n=this.process_part(m),l=n[0];n=n[1];switch(m.valueObj.type){case "value":a.push(this.validatePart(m.operator,this._feature.attributes[m.fieldObj.name],l,n,m.caseSensitive));break;case "unique":a.push(this.validatePart(m.operator,this._feature.attributes[m.fieldObj.name],l,n,m.caseSensitive));break;case "field":this._feature.attributes.hasOwnProperty(l)&&(l=this._feature.attributes[l]),a.push(this.validatePart(m.operator,
this._feature.attributes[m.fieldObj.name],l,n,m.caseSensitive))}}},this);return this.ruleValid(a,b.logicalOperator)},ruleValid:function(b,a){var m=!1;if(void 0===a||null===a)a="OR";f.some(b,function(n){if("OR"===a){if(!0===n)return m=!0;m=!1}else{if(!1===n)return m=!1,!0;m=!0}});return m},myIsNaN:function(b){return b!==b},_isNumeric:function(b){return!isNaN(parseFloat(b))&&isFinite(b)},validatePart:function(b,a,m,n,l){var k=null;if(void 0===b||null===b)return!1;0===b.lastIndexOf("string",0)?!1===
l&&(void 0!==a&&null!==a&&(a=String(a).toUpperCase()),void 0!==m&&null!==m&&(m=String(m).toUpperCase()),void 0!==n&&null!==n&&(n=String(n).toUpperCase())):0===b.lastIndexOf("date",0)&&(void 0!==m&&null!==m&&(m=new Date(m)),void 0!==n&&null!==n&&(n=new Date(n)));switch(b){case this.OPERATORS.stringOperatorIs:if(a===m)return!0;break;case this.OPERATORS.stringOperatorIsNot:if(a!==m)return!0;break;case this.OPERATORS.stringOperatorStartsWith:if(null===a&&null===m)return!0;if(null===a&&null!==m)break;
if(null!==a&&null===m)break;if(0===a.lastIndexOf(m,0))return!0;break;case this.OPERATORS.stringOperatorEndsWith:if(null===a&&null===m)return!0;if(null===a&&null!==m)break;if(null!==a&&null===m)break;return a.endsWith(m);case this.OPERATORS.stringOperatorContains:if(null===a&&null===m)return!0;if(null===a&&null!==m)break;if(null!==a&&null===m)break;if(0<=String(a).toUpperCase().indexOf(m.toUpperCase()))return!0;break;case this.OPERATORS.stringOperatorDoesNotContain:if(null===a&&null===m)break;if(null===
a&&null!==m||null!==a&&null===m||!(0<=String(a).toUpperCase().indexOf(m.toUpperCase())))return!0;break;case this.OPERATORS.stringOperatorIsBlank:return void 0===a||null===a||""===a;case this.OPERATORS.stringOperatorIsNotBlank:return void 0!==a&&null!==a&&""!==a;case this.OPERATORS.numberOperatorIs:if(this._isNumeric(a))return String(a)===String(m);break;case this.OPERATORS.numberOperatorIsNot:if(this._isNumeric(a))return String(a)!==String(m);break;case this.OPERATORS.numberOperatorIsAtLeast:if(this._isNumeric(a)&&
this._isNumeric(m))return Number(a)>=Number(m);break;case this.OPERATORS.numberOperatorIsLessThan:if(this._isNumeric(a)&&this._isNumeric(m))return Number(a)<Number(m);break;case this.OPERATORS.numberOperatorIsAtMost:if(this._isNumeric(a)&&this._isNumeric(m))return Number(a)<=Number(m);break;case this.OPERATORS.numberOperatorIsGreaterThan:if(this._isNumeric(a)&&this._isNumeric(m))return Number(a)>Number(m);break;case this.OPERATORS.numberOperatorIsBetween:if(this._isNumeric(a)&&this._isNumeric(m)&&
this._isNumeric(n))return Number(a)>Number(m)&&Number(a)<Number(n);break;case this.OPERATORS.numberOperatorIsNotBetween:if(this._isNumeric(a)&&this._isNumeric(m)&&this._isNumeric(n))return Number(a)<=Number(m)||Number(a)>=Number(n);break;case this.OPERATORS.numberOperatorIsBlank:if(null===a||void 0===a||!1===this._isNumeric(a))return!0;break;case this.OPERATORS.numberOperatorIsNotBlank:if(null!==a&&void 0!==a&&!0===this._isNumeric(a))return!0;break;case this.OPERATORS.dateOperatorIsOn:if(void 0===
a||null===a)break;if(void 0===m||null===m)break;k=new Date(a);return m.toDateString()===k.toDateString();case this.OPERATORS.dateOperatorIsNotOn:if(void 0===a||null===a)break;if(void 0===m||null===m)break;k=new Date(a);return m.toDateString()!==k.toDateString();case this.OPERATORS.dateOperatorIsBefore:if(null===a||void 0===a)break;if(void 0===m||null===m)break;return a<m.getTime();case this.OPERATORS.dateOperatorIsAfter:if(null===a||void 0===a)break;if(void 0===m||null===m)break;return a>m.getTime();
case this.OPERATORS.dateOperatorIsOnOrBefore:if(null===a||void 0===a)break;if(void 0===m||null===m)break;return a<=m.getTime();case this.OPERATORS.dateOperatorIsOnOrAfter:if(null===a||void 0===a)break;if(void 0===m||null===m)break;return a>=m.getTime();case this.OPERATORS.dateOperatorInTheLast:if(null===a||void 0===a)break;if(void 0===m||null===m)break;return a>m.getTime()&&a<=(new Date).getTime();case this.OPERATORS.dateOperatorNotInTheLast:if(null===a||void 0===a)break;if(void 0===m||null===m)break;
return a<=m.getTime()||a>=(new Date).getTime();case this.OPERATORS.dateOperatorIsIn:if(null===a||void 0===a)break;if(void 0===m||null===m)break;if(void 0===n||null===n)break;return a>=m.getTime()&&a<=n.getTime();case this.OPERATORS.dateOperatorIsNotIn:if(null===a||void 0===a)break;if(void 0===m||null===m)break;if(void 0===n||null===n)break;return a<m.getTime()||a>n.getTime();case this.OPERATORS.dateOperatorIsBetween:if(null===a||void 0===a)break;if(void 0===m||null===m)break;if(void 0===n||null===
n)break;return a>=m.getTime()&&a<=n.getTime();case this.OPERATORS.dateOperatorIsNotBetween:if(null===a||void 0===a)break;if(void 0===m||null===m)break;if(void 0===n||null===n)break;return a<m.getTime()||a>n.getTime();case this.OPERATORS.dateOperatorIsBlank:if(null===a||void 0===a)return!0;break;case this.OPERATORS.dateOperatorIsNotBlank:if(null!==a&&void 0!==a)return!0}return!1},_processChildNodes:function(b,a){b.disabled=a;!0===a?b.style&&(b.style.pointerEvents="none"):b.style&&(b.style.pointerEvents=
"auto");f.forEach(b.childNodes,function(m){m.disabled=a;!0===a?m.style&&(m.style.pointerEvents="none"):m.style&&(m.style.pointerEvents="auto");0<m.childNodes.length&&this._processChildNodes(m,a)},this)},_smartComboValidate:function(){this.toggleFields()},_getRowInfo:function(b){var a=b.parentNode.childNodes[1].childNodes[0],m=null,n=null;1<b.parentNode.childNodes[1].childNodes.length&&(m=b.parentNode.childNodes[1].childNodes[1],h.contains(m,"esriCTValuePickerButton")&&(n=b.parentNode.childNodes[1].childNodes[1],
m=null),3===b.parentNode.childNodes[1].childNodes.length&&(n=b.parentNode.childNodes[1].childNodes[2]));var l=!0===this.useFieldName?b.hasAttribute("data-fieldname")?b.getAttribute("data-fieldname"):b.childNodes[0].data:b.childNodes[0].data;b=b.parentNode;var k=v.getEnclosingWidget(a);return[a,b,k,l,m,n]},_removeRequireFieldMarkings:function(b,a,m){var n=null;void 0===m||null===m?(h.contains(b,"dijitComboBoxError")&&h.remove(b,"dijitComboBoxError"),h.contains(b,"dijitTextBoxError")&&h.remove(b,"dijitTextBoxError"),
h.contains(b,"dijitValidationTextBox")&&h.remove(b,"dijitValidationTextBox"),h.contains(b,"dijitValidationTextBoxError")&&h.remove(b,"dijitValidationTextBoxError"),h.contains(b,"dijitError")&&h.remove(b,"dijitError"),n=c(".dijitValidationContainer",a),f.forEach(n,function(l){l.parentNode.removeChild(l)})):(n=E.isFunction(m.isValid)?m.isValid():!0,"dijit.form.TextBox"===m.declaredClass&&!0===n?(h.contains(b,"dijitTextBoxError")&&h.remove(b,"dijitTextBoxError"),h.contains(b,"dijitValidationTextBox")&&
h.remove(b,"dijitValidationTextBox"),h.contains(b,"dijitValidationTextBoxError")&&h.remove(b,"dijitValidationTextBoxError"),h.contains(b,"dijitError")&&h.remove(b,"dijitError"),n=c(".dijitValidationContainer",a),f.forEach(n,function(l){l.parentNode.removeChild(l)})):"dijit.form.ValidationTextBox"===m.declaredClass&&!0===n?(h.contains(b,"dijitTextBoxError")&&h.remove(b,"dijitTextBoxError"),h.contains(b,"dijitTextBoxDisabled")&&h.remove(b,"dijitTextBoxDisabled"),h.contains(b,"dijitValidationTextBoxError")&&
h.remove(b,"dijitValidationTextBoxError"),h.contains(b,"dijitError")&&h.remove(b,"dijitError")):"dijit.form.DateTextBox"===m.declaredClass&&!0===n?(h.contains(b,"dijitTextBoxError")&&h.remove(b,"dijitTextBoxError"),h.contains(b,"dijitValidationTextBox")&&h.remove(b,"dijitValidationTextBox"),h.contains(b,"dijitValidationTextBoxError")&&h.remove(b,"dijitValidationTextBoxError"),h.contains(b,"dijitError")&&h.remove(b,"dijitError"),n=c(".dijitValidationContainer",a),f.forEach(n,function(l){l.parentNode.removeChild(l)})):
"dijit.form.TimeTextBox"===m.declaredClass&&!0===n?(h.contains(b,"dijitTextBoxError")&&h.remove(b,"dijitTextBoxError"),h.contains(b,"dijitValidationTextBox")&&h.remove(b,"dijitValidationTextBox"),h.contains(b,"dijitValidationTextBoxError")&&h.remove(b,"dijitValidationTextBoxError"),h.contains(b,"dijitError")&&h.remove(b,"dijitError"),n=c(".dijitValidationContainer",a),f.forEach(n,function(l){l.parentNode.removeChild(l)})):"dijit.form.FilteringSelect"===m.declaredClass&&!0===n?(h.contains(b,"dijitTextBoxError")&&
h.remove(b,"dijitTextBoxError"),h.contains(b,"dijitComboBoxError")&&h.remove(b,"dijitComboBoxError"),h.contains(b,"dijitError")&&h.remove(b,"dijitError"),h.contains(b,"dijitValidationTextBoxError")&&h.remove(b,"dijitValidationTextBoxError")):!0===n&&(h.contains(b,"dijitComboBoxError")&&h.remove(b,"dijitComboBoxError"),h.contains(b,"dijitTextBoxError")&&h.remove(b,"dijitTextBoxError"),h.contains(b,"dijitValidationTextBox")&&h.remove(b,"dijitValidationTextBox"),h.contains(b,"dijitValidationTextBoxError")&&
h.remove(b,"dijitValidationTextBoxError"),h.contains(b,"dijitError")&&h.remove(b,"dijitError"),n=c(".dijitValidationContainer",a),f.forEach(n,function(l){l.parentNode.removeChild(l)})))},_removeRedAst:function(b,a){-1===this._gdbRequiredFields.indexOf(a)&&(b=c("a.asteriskIndicator",b),0<b.length&&f.forEach(b,function(m){m.parentNode.removeChild(m)}))},_removeHideRule:function(b){h.contains(b,"hideField")&&h.remove(b,"hideField")},_removeDisableRule:function(b,a,m){-1===this._notEditableFields.indexOf(b)&&
(h.contains(a,"dijitTextBoxDisabled")&&h.remove(a,"dijitTextBoxDisabled"),h.contains(a,"dijitComboBoxDisabled")&&h.remove(a,"dijitComboBoxDisabled"),h.contains(a,"dijitValidationTextBoxDisabled")&&h.remove(a,"dijitValidationTextBoxDisabled"),h.contains(a,"dijitDisabled")&&h.remove(a,"dijitDisabled"),(b=v.getEnclosingWidget(a))&&b.set("readOnly",!1));m&&this._processChildNodes(a,!1)},_remove:function(b,a,m,n,l,k){this._removeRequireFieldMarkings(m,n,l);this._removeRedAst(b[0],a);this._removeDisableRule(a,
m,k);this._removeHideRule(n)},toggleFieldOnAttributeInspector:function(b,a,m,n,l){n="undefined"!==typeof n&&null!==n?n:!0;if(void 0===this._gdbRequiredFields||null===this._gdbRequiredFields)this._gdbRequiredFields=[];if(void 0===this._notEditableFields||null===this._notEditableFields)this._notEditableFields=[];if(void 0!==this._attTable&&null!==this._attTable){if(0<this._attTable.length){var k=B.filter(this._attTable,E.hitch(this,function(x){return x.childNodes&&0<x.childNodes.length?!0===this.useFieldName?
x.hasAttribute("data-fieldname")?x.getAttribute("data-fieldname")===b:x.childNodes[0].data===b:x.childNodes[0].data===b:!1})),y=null;if(null!==k&&0<k.length){var u=this._getRowInfo(k[0]),C=u[0];y=u[4];var q=u[5],w=u[1];u=u[2];if(void 0!==u&&null!==u)switch(a){case "Hide":this._removeRequireFieldMarkings(C,w,u);this._removeRedAst(k[0],b);this._removeDisableRule(b,C,l);y&&this._removeDisableRule(b,y,l);q&&h.remove(q,"disabled");h.add(w,"hideField");break;case "Disabled":this._removeRedAst(k[0],b);this._removeHideRule(w);
this._removeRequireFieldMarkings(C,w,u);h.add(C,["dijitValidationTextBox","dijitTextBoxDisabled","dijitComboBoxDisabled","dijitValidationTextBoxDisabled","dijitDisabled"]);this._processChildNodes(C,!0);null!==y&&(this._removeRequireFieldMarkings(y,w,u),h.add(y,["dijitValidationTextBox","dijitTextBoxDisabled","dijitComboBoxDisabled","dijitValidationTextBoxDisabled","dijitDisabled"]),this._processChildNodes(y,!0));q&&h.add(q,"disabled");break;case "Required":this._removeDisableRule(b,C,l);y&&this._removeDisableRule(b,
y,l);q&&h.remove(q,"disabled");this._removeHideRule(w);!0===m?(this._removeRequireFieldMarkings(C,w,u),y&&h.contains(y,"dijitTextBoxError","dijitError")&&h.remove(y,"dijitTextBoxError","dijitError")):"dijit.form.TextBox"===u.declaredClass?(y=c(".dijitValidationContainer",w),0===y.length&&(a=document.createElement("div"),a.setAttribute("class","dijitReset dijitValidationContainer"),m=document.createElement("input"),m.setAttribute("class","dijitReset dijitInputField dijitValidationIcon dijitValidationInner"),
m.setAttribute("value","x"),m.setAttribute("type","text"),m.setAttribute("tabindex","-1"),m.setAttribute("readonly","readonly"),m.setAttribute("role","presentation"),a.appendChild(m),C.insertBefore(a,C.childNodes[0])),h.add(C,["dijitTextBoxError","dijitValidationTextBox","dijitValidationTextBoxError","dijitError"])):"dijit.form.ValidationTextBox"===u.declaredClass?(y=c(".dijitValidationContainer",w),h.add(C,["dijitTextBoxError","dijitValidationTextBox","dijitValidationTextBoxError","dijitError"])):
"dijit.form.FilteringSelect"===u.declaredClass?h.add(C,["dijitTextBoxError","dijitComboBoxError","dijitError","dijitValidationTextBoxError"]):u.get("value")?(h.remove(C,"dijitTextBoxError","dijitError"),y&&h.add(y,["dijitTextBoxError","dijitError"])):h.add(C,["dijitTextBoxError","dijitError"]);C=c("a.asteriskIndicator",k[0]);a=c("span.atiRequiredField",k[0]);-1===this._gdbRequiredFields.indexOf(b)&&0===C.length&&0===a.length&&(C=document.createElement("a"),C.setAttribute("class","asteriskIndicator"),
C.innerHTML=" *",k[0].appendChild(C));break;case "Value":break;default:n&&(this._remove(k,b,C,w,u,l),q&&h.remove(q,"disabled"),y&&this._removeDisableRule(b,y,l))}}}this.emit("onFieldToggle")}}})})},"widgets/SmartEditor/attributeInspectorTools":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/query dojo/on dojo/dom-class dojo/topic dijit/registry jimu/utils jimu/BaseWidgetSetting".split(" "),function(O,B,F,E,f,h,r,c,v,p){return O([p],{_attrInspector:null,_feature:null,_fieldInfo:null,
_guidFields:null,_guidFieldNames:null,_intFieldNames:null,_dblFieldNames:null,_dateFieldNames:null,_stringFields:null,_requiredNonDomainIntFields:null,_requiredNonDomainDecFields:null,_fieldNameToAlias:null,_attTable:null,_mapLayer:null,constructor:function(){this.inherited(arguments);B.mixin(this,arguments[0]);this._mapLayer=this._feature.getLayer();this._processLayer();this._fieldInfo=F.filter(this._fieldInfo,function(g){return g.label?!0:!1});this._attTable=E("td.atiLabel",this._attrInspector.domNode);
void 0!==this._attTable&&null!==this._attTable&&(this._checkDisplayFormat(),this._addValidation())},_checkFeatureData:function(g){F.forEach(this._fieldInfo,function(e){if(g.hasOwnProperty(e.fieldName))switch(e.type){case "esriFieldTypeString":0<e.length&&null!==g[e.fieldName]&&g[e.fieldName].length>e.length&&(g[e.fieldName]=g[e.fieldName].substring(0,e.length));break;case "esriFieldTypeGUID":this._isGuid(g[e.fieldName],!1)&&("{"!==g[e.fieldName][0]&&(g[e.fieldName]="{"+g[e.fieldName]),"}"!==g[e.fieldName][g[e.fieldName].length-
1]&&(g[e.fieldName]+="}"));break;case "esriFieldTypeSingle":case "esriFieldTypeDouble":this.isNumeric(g[e.fieldName])&&(g[e.fieldName]=parseFloat(g[e.fieldName]));break;case "esriFieldTypeDate":this.isNumeric(g[e.fieldName])&&(g[e.fieldName]=parseInt(g[e.fieldName],10));break;case "esriFieldTypeSmallInteger":case "esriFieldTypeInteger":this.isNumeric(g[e.fieldName])&&(g[e.fieldName]=parseInt(g[e.fieldName],10))}},this);return g},_processLayer:function(){this._guidFields=[];this._guidFieldNames=[];
this._dateFieldNames=[];this._intFieldNames=[];this._dblFieldNames=[];this._stringFields=[];this._requiredNonDomainIntFields=[];this._requiredNonDomainDecFields=[];F.forEach(this._fieldInfo,function(g){if(g.hasOwnProperty("label")&&g.hasOwnProperty("type")){var e=g.label;0<=e.indexOf('\x3ca class\x3d"asteriskIndicator"\x3e *\x3c/a\x3e')&&(e=e.replace('\x3ca class\x3d"asteriskIndicator"\x3e *\x3c/a\x3e',""));switch(g.type){case "esriFieldTypeString":this._stringFields.push(g.fieldName);break;case "esriFieldTypeGUID":this._guidFields.push(e);
this._guidFieldNames.push(g.fieldName);break;case "esriFieldTypeSingle":case "esriFieldTypeDouble":!1!==g.nullable||void 0!==g.domain&&null!==g.domain||this._requiredNonDomainDecFields.push(e);this._dblFieldNames.push(g.fieldName);break;case "esriFieldTypeDate":this._dateFieldNames.push(g.fieldName);break;case "esriFieldTypeSmallInteger":case "esriFieldTypeInteger":!1!==g.nullable||void 0!==g.domain&&null!==g.domain||this._requiredNonDomainIntFields.push(e),this._intFieldNames.push(g.fieldName)}}},
this)},formValid:function(){var g=!0;if(void 0===this._attTable||null===this._attTable)return g;0<this._attTable.length&&F.some(this._attTable,function(e){if(e=this._getRowInfo(e)){if(void 0===e[0]||null===e[0])return!1;g=B.isFunction(e[0].isValid)?e[0].isValid():!h.contains(e[2],"dijitError");return!g}return!0},this);return g},triggerFormValidation:function(){if(void 0!==this._attTable&&null!==this._attTable&&0<this._attTable.length){var g=null;F.forEach(this._attTable,function(e){if((e=this._getRowInfo(e))&&
void 0!==e[0]&&null!==e[0]){null===g&&(g=e[0]);var b=!0;B.isFunction(e[0].isValid)?b=e[0].isValid():f.emit(e[0],"change",{bubbles:!0,cancelable:!0});!1===b&&e[0].set("state","Error")}},this)}},_addValidation:function(){void 0!==this._attTable&&null!==this._attTable&&(0!==this._guidFields.length||0!==this._requiredNonDomainIntFields.length||0!==this._requiredNonDomainDecFields.length)&&0<this._attTable.length&&F.forEach(this._attTable,function(g){var e=this._getRowInfo(g);e&&(-1!==this._guidFields.indexOf(e[1])?
"dijit.form.ValidationTextBox"===e[0].declaredClass?e[0].validator=B.hitch(this,this._validateGUID):"dijit.form.TextBox"===e[0].declaredClass&&(e[0].isValid=B.hitch(this,this._validateGUID_IsValid(e[0])),f(e[0],"change",B.hitch(this,function(){!1===this._isGuid(e[0].get("value"),!0)?h.add(e[2],["dijitTextBoxError","dijitValidationTextBox","dijitValidationTextBoxError","dijitError"]):(h.contains(e[2],"dijitTextBoxError")&&h.remove(e[2],"dijitTextBoxError"),h.contains(e[2],"dijitValidationTextBox")&&
h.remove(e[2],"dijitValidationTextBox"),h.contains(e[2],"dijitValidationTextBoxError")&&h.remove(e[2],"dijitValidationTextBoxError"),h.contains(e[2],"dijitError")&&h.remove(e[2],"dijitError"));r.publish("smartEditor/validate",null)})),e[0].validator=B.hitch(this,this._validateGUID)):-1===this._requiredNonDomainIntFields.indexOf(e[1])&&this._requiredNonDomainDecFields.indexOf(e[1]))},this)},_isGuid:function(g,e){if(!0===e&&(""===g||null===g))return!0;if(""===g||null===g)return!1;"{"===g[0]&&(g=g.substring(1,
g.length-1));return/^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/gi.test(g)},_validateGUID_IsValid:function(g){return function(){return this._isGuid(g.get("value"),!0)}},_validateGUID:function(g,e){return this._isGuid(g,!0)},isNumeric:function(g){return!isNaN(parseFloat(g))&&isFinite(g)},isInt:function(g){var e;if(e=!isNaN(g))g=parseFloat(g),e=(g|0)===g;return e},_validateInt:function(g,e){return this.isInt(g)},_validateDec:function(g,e){return this.isNumeric(g)},
_getRowInfo:function(g){try{if(g&&g.parentNode){var e=g.parentNode.childNodes[1].childNodes[0];return[c.getEnclosingWidget(e),g.childNodes[0].data,e]}return null}catch(b){return console.log(b),null}},_checkDisplayFormat:function(){var g=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"];void 0!==this._attTable&&null!==this._attTable&&0<this._attTable.length&&F.forEach(this._attTable,B.hitch(this,function(e){var b=this._getRowInfo(e),a=e.getAttribute("data-fieldname");
b&&a&&F.some(this._fieldInfo,B.hitch(this,function(m){if(m.name===a&&-1!==g.indexOf(m.type))return m.hasOwnProperty("format")&&m.format&&m.format.hasOwnProperty("digitSeparator")&&!m.format.digitSeparator&&(b[0].constraints.pattern="#.",isNaN(b[0].value)||b[0].set("value",b[0].value)),!0}))}))}})})},"widgets/SmartEditor/relatedTables":function(){define("dojo/_base/declare dojo/Evented dojo/on dojo/string dojo/keys dojo/string dojo/dom-attr dojo/dom-style dojo/_base/lang dojo/_base/array dojo/dom-construct esri/graphic jimu/dijit/Message dijit/_WidgetBase ./presetUtils dojo/query esri/tasks/RelationshipQuery dojo/dom-geometry dojo/dom-class".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y){return O([a,B],{newRelatedFeature:{},_validRelations:[],isSaveEnable:!1,postCreate:function(){this._validRelations=[]},startup:function(){this._createTable()},_createTable:function(){var u=g.create("div",{"class":"relatedTablesContainer"},this.domNode);p.forEach(this.relationshipInfo,v.hitch(this,function(C,q){C.featureLayer&&C.hasOwnProperty("relationshipId")&&this._createRelatedTableItem(C,u,q)}));0<n(".relatedTableTitleContainer",this.domNode).length?
this.emit("addRelatedItemContent",!0):this.emit("addRelatedItemContent",!1)},_getKeyField:function(u){var C;var q=u;u=u.toLowerCase();for(C in this.parentFeature.attributes)if(u===C.toLowerCase()){q=C;break}return q},_createRelatedTableItem:function(u,C,q){var w,x={};if(w=this.layerInfosObj.getLayerOrTableInfoById(u.featureLayer.id)){var I=g.create("div",{"class":"relatedTableTitleContainer"},C);r.set(I,"layerId",w.id);r.set(I,"relationshipId",u.relationshipId);r.set(I,"parentFeatureOID",this.parentFeature.attributes[this.parentFeature._layer.objectIdField]);
F(I,"click",v.hitch(this,function(A){A=r.get(A.currentTarget,"relatedRecordCount");(null===A||A&&0!==parseInt(A,10))&&this.emit("titleClicked",w.id,u.relationshipId,!1,this.parentFeatureIndexInAI,this.parentFeature.attributes[this.parentFeature._layer.objectIdField],this.newRelatedFeature[u.relationshipId].foreignKeyField)}));C=g.create("div",{"class":"relatedTableTitle esriCTEllipsis relatedTableFields",innerHTML:w.title,tabindex:"-1",title:w.title,"aria-label":w.title,role:"button"},I);F(C,"keydown",
v.hitch(this,function(A){A.keyCode!==f.ENTER&&A.keyCode!==f.SPACE||I.click()}));g.create("div",{"class":"esriCTLoadingIcon hidden"},I);g.create("div",{"class":"esriCTRelatedTableRecordsCount"},I);x=this._checkRelationShip(w,u.relationshipId);x.isValidRelation?(this._createNewGraphics(u.relationshipId,w.id,x.primaryKeyField,x.foreignKeyField),this._validRelations.push(u)):g.destroy(I);this._canAddFeatures(u,w)&&"Table"===w.layerObject.type?(C=E.substitute(this.nls.createNewFeatureLabel,{layerTitle:w.title}),
C=g.create("div",{"class":"relatedTableIcons itemTitleCreateNew relatedTableFields",title:this.nls.addNewFeature,"aria-label":C,role:"button",tabindex:"-1"},I),r.set(C,"tableId",w.id),F(C,"click",v.hitch(this,function(A){this._createNewButtonClick(A,u,w,I)})),F(C,"keydown",v.hitch(this,function(A){A.keyCode!==f.ENTER&&A.keyCode!==f.SPACE||this._createNewButtonClick(A,u,w,I)})),this.relationshipInfo.length-1===q&&y.add(C,"esriCTLastRelatedItem")):this.relationshipInfo.length-1===q&&y.add(C,"esriCTLastRelatedItem");
x.isValidRelation&&this.getRelatedRecordsCount(u.relationshipId,w.id)}},_createNewButtonClick:function(u,C,q,w){u.stopPropagation();u=this.newRelatedFeature[C.relationshipId];this.isSaveEnable?b({message:this.nls.pendingFeatureSaveMsg}):(this.parentFeature.attributes.hasOwnProperty(u.primaryKeyField)||(u.primaryKeyField=this._getKeyField(u.primaryKeyField)),void 0===this.parentFeature.attributes[u.primaryKeyField]||null===this.parentFeature.attributes[u.primaryKeyField]?(C=m.getFieldInfoByFieldName(this.parentFieldInfos,
u.primaryKeyField).label||u.primaryKeyField,C=h.substitute(this.nls.invalidRelationShipMsg,{parentKeyField:C}),b({message:C})):(this.newRelatedFeature[C.relationshipId].attributes[this.newRelatedFeature[C.relationshipId].foreignKeyField]=this.parentFeature.attributes[this.newRelatedFeature[C.relationshipId].primaryKeyField],this.emit("addRelatedRecord",this.newRelatedFeature[C.relationshipId],w,q.id,this.parentFeatureIndexInAI,this.newRelatedFeature[C.relationshipId].foreignKeyField)))},_canAddFeatures:function(u,
C){C=C.layerObject.getEditCapabilities();return!u.allowUpdateOnly&&u._editFlag&&C.canCreate?!0:!1},_checkRelationShip:function(u,C){var q=!0;var w=this._getRelationShipById(this.parentFeature._layer,C);u=this._getRelationShipById(u.layerObject,C);if(w&&w.keyField&&u&&u.keyField){var x=w.keyField;var I=u.keyField}else q=!1;return{isValidRelation:q,foreignKeyField:I,primaryKeyField:x}},_createNewGraphics:function(u,C,q,w){var x={};C=this.layerInfosObj.getLayerOrTableInfoById(C);0<C.layerObject.templates.length?
x=C.layerObject.templates[0].prototype.attributes:0<C.layerObject.types.length&&(x=C.layerObject.types[0].templates[0].prototype.attributes);x=new e(null,null,v.clone(x));x.attributes.hasOwnProperty(w)&&(x.attributes[w]=this.parentFeature.attributes[q]);this.newRelatedFeature[u]=x;this.newRelatedFeature[u].primaryKeyField=q;this.newRelatedFeature[u].foreignKeyField=w;this.newRelatedFeature[u].featureLayer=C;return!0},_getRelationShipById:function(u,C){var q;p.some(u.relationships,v.hitch(this,function(w){if(w.id===
C)return q=w,!0}));return q},updateFeatureInstance:function(u){this.parentFeature&&(this.parentFeature.attributes=v.clone(u))},displayRelatedRecordCount:function(u,C){C=n("[relationshipid \x3d "+C+"]",this.domNode);var q=n(".relatedTableIcons.itemTitleCreateNew",this.domNode);var w=n(".esriCTLoadingIcon",C[0])[0];y.add(w,"hidden");var x=n(".esriCTRelatedTableRecordsCount",C[0])[0];y.remove(x,"hidden");w=n(".relatedTableTitle",C[0])[0];r.set(x,"innerHTML","("+u+")");var I=E.substitute(this.nls.relatedFeatureCount,
{layerTitle:w.innerHTML,featureCount:u});r.set(w,"aria-label",I);r.set(C[0],"relatedRecordCount",u);x=k.position(x).w;if("auto"===x||void 0===x||""===x||0===x)x=8+7*u.toString().length;x=0<q.length?x+35:x+10;c.set(w,"width","calc(100% - "+x+"px)");0===u?y.add(C[0],"esriCTRelatedTableTitleDefaultCursor"):y.remove(C[0],"esriCTRelatedTableTitleDefaultCursor")},updateRelatedRecordsCount:function(){p.forEach(this._validRelations,v.hitch(this,function(u){this.getRelatedRecordsCount(u.relationshipId,u.featureLayer.id)}))},
_showLoadingIndicator:function(u){var C=n("[relationshipid \x3d "+u+"]",this.domNode);u=n(".relatedTableIcons.itemTitleCreateNew",this.domNode);var q=n(".esriCTLoadingIcon",C[0])[0];var w=n(".esriCTRelatedTableRecordsCount",C[0])[0];C=n(".relatedTableTitle",C[0])[0];y.remove(q,"hidden");y.add(w,"hidden");w=20;w=0<u.length?w+35:w+10;c.set(C,"width","calc(100% - "+w+"px)")},getRelatedRecordsCount:function(u,C){var q=this.parentFeature._layer;var w=this.parentFeature.attributes[this.parentFeature._layer.objectIdField];
var x=new l;C=this.layerInfosObj.getLayerOrTableInfoById(C).layerObject.objectIdField;x.returnGeometry=!1;x.outSpatialReference=this.mapSpatialReference;x.relationshipId=u;x.objectIds=[w];x.outFields=[C];this._showLoadingIndicator(u);q.queryRelatedFeatures(x,v.hitch(this,function(I){(I=I[w]&&I[w].features)?this.displayRelatedRecordCount(I.length,u):this.displayRelatedRecordCount(0,u)}),v.hitch(this,function(){this.displayRelatedRecordCount(0,u)}))}})})},"widgets/SmartEditor/AttachmentUploader":function(){define("dojo/Evented dojo dojo/_base/declare dojo/_base/lang dojo/on dojo/keys dojo/dom-construct dojo/dom-style dijit/_WidgetBase dijit/_TemplatedMixin dojo/text!./AttachmentUploader.html dojo/i18n!esri/nls/jsapi".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e){return F([v,O,p],{declaredClass:"jimu-widget-smartEditor-attachmentuploader",templateString:g,widgetsInTemplate:!0,_inputCount:0,_inputIndex:1,currentAction:null,constructor:function(){this.nls=E.mixin(this.nls,e.widgets.attachmentEditor)},_fileSelected:function(b){b=b.target||b.srcElement;0<b.value.length&&(B.style(b.parentNode.childNodes[0],"display","inline-block"),this._addInput(),"block"===c.get(this.attachmentsRequiredMsg,"display")&&c.set(this.attachmentsRequiredMsg,
"display","none"));this.emit("attachmentAdded")},clear:function(){if(void 0!==this._attachmentList&&null!==this._attachmentList){for(;this._attachmentList.firstChild;)this._attachmentList.removeChild(this._attachmentList.firstChild);this._addInput()}},_deleteAttachment:function(b){b=b.target||b.srcElement;b.parentNode.parentNode.removeChild(b.parentNode);this._hasAddedAnyAttachments()||"Required"!==this.currentAction||"none"===c.get(this.attachmentsRequiredMsg,"display")&&c.set(this.attachmentsRequiredMsg,
"display","block");this.emit("attachmentDeleted")},_reflect:function(b){return b.then(function(a){return{state:"fulfilled",value:a}},function(a){return{state:"rejected",error:a}})},_addInput:function(){for(var b=0;b<this._attachmentList.childNodes.length;b++)if(this._attachmentList.childNodes[b].childNodes[this._inputIndex].value){if(0===this._attachmentList.childNodes[b].childNodes[this._inputIndex].value.length)return}else return;b=r.create("div",{id:"delInput"+String(this._inputCount),"class":"deleteAttachment",
tabindex:"0","aria-label":this.nls.deleteAttachment||this.deleteAttachmentText||"",role:"button"});b.innerHTML="X";B.style(b,"display","none");this.own(f(b,"click",E.hitch(this,this._deleteAttachment)));this.own(f(b,"keydown",E.hitch(this,function(n){n.keyCode!==h.ENTER&&n.keyCode!==h.SPACE||this._deleteAttachment(n)})));var a=r.create("form",{id:"formInput"+String(this._inputCount)}),m=r.create("input",{id:"fileInput"+String(this._inputCount),type:"file","class":"attInput",name:"attachment"});a.appendChild(b);
a.appendChild(m);this._attachmentList.appendChild(a);this.own(f(m,"change",E.hitch(this,this._fileSelected)));this._inputCount+=1},startup:function(){this._addInput()},destroy:function(){this.inherited(arguments)},postAttachments:function(b,a){if(b&&"esri.layers.FeatureLayer"===b.declaredClass&&b.getEditCapabilities&&b.addAttachment){for(var m=[],n=0;n<this._attachmentList.childNodes.length;n++)0<this._attachmentList.childNodes[n].childNodes[this._inputIndex].value.length&&m.push(b.addAttachment(a,
this._attachmentList.childNodes[n]));return 0===m.length?null:m.map(this._reflect)}},_hasAddedAnyAttachments:function(){for(var b=!1,a=0;a<this._attachmentList.childNodes.length;a++)if(this._attachmentList.childNodes[a].childNodes[this._inputIndex].value&&0<this._attachmentList.childNodes[a].childNodes[this._inputIndex].value.length){b=!0;break}return b}})})},"jimu/dijit/EditorXssFilter":function(){define("dojo/_base/declare dojo/_base/array dijit/_WidgetBase dojo/_base/lang dojo/Evented libs/arcgis-html-sanitizer/arcgis-html-sanitizer".split(" "),
function(O,B,F,E,f,h){var r=null,c=O([F,f],{baseClass:"jimu-editor-xss-filter",declaredClass:"jimu.dijit.EditorXssFilter",sanitizer:null,xss:null,whiteList:{},graphicsWhiteList:{},postCreate:function(){this.whiteList=this._getWhiteList();this.sanitizer=new h({whiteList:this.whiteList,safeAttrValue:E.hitch(this,function(v,p,g,e){return"style"===p?this.xss.friendlyAttrValue(g).replace(/"/g,"'"):"img"===v&&"src"===p?this.xss.escapeAttrValue(g):this.xss.safeAttrValue(v,p,g,e)}),onTag:E.hitch(this,function(v,
p,g){if(g.isWhite&&this._isInWhiteList(v,this.graphicsWhiteList))return p}),onIgnoreTagAttr:E.hitch(this,function(v,p,g,e){if("data-"===p.substr(0,5))return p+'\x3d"'+this.xss.escapeAttrValue(g)+'"'}),onIgnoreTag:E.hitch(this,function(v,p,g){if("o:"===v.substr(0,2)||"!--[if"===v||"!--[endif]--"===v)return p})},!0);this.xss=this.sanitizer.xss},sanitize:function(v){return this.sanitizer.sanitize(v)},_getWhiteList:function(){var v="title height width class style font-family id align text-align".split(" "),
p={div:v,h1:v,h2:v,h3:v,h4:v,h5:v,h6:v,span:v,p:v,s:v,strong:v,em:v,u:v,ol:v,ul:v,li:v,a:["href","target"].concat(v),img:["src","alt","border"].concat(v),blockquote:v,font:["face","size","color"].concat(v),pre:v,code:v,b:v,i:v,wbr:v,video:"autoplay controls loop muted poster preload".split(" ").concat(v),audio:["autoplay","controls","loop","muted","preload"].concat(v),source:["media","src","type"].concat(v),table:["cellpadding","cellspacing","border"].concat(v),tbody:[].concat(v),tr:["valign"].concat(v),
td:["valign","colspan","rowspan","nowrap"].concat(v),th:["valign","colspan","rowspan","nowrap"].concat(v),hr:v,html:v,title:v,link:["rel","href"],style:["type"].concat(v),body:v};this.graphicsWhiteList={animate:[],animateMotion:[],animateTransform:[],circle:[],clipPath:[],"color-profile":[],defs:[],desc:[],discard:[],ellipse:[],feBlend:[],feColorMatrix:[],feComponentTransfer:[],feComposite:[],feConvolveMatrix:[],feDiffuseLighting:[],feDisplacementMap:[],feDistantLight:[],feDropShadow:[],feFlood:[],
feFuncA:[],feFuncB:[],feFuncG:[],feFuncR:[],feGaussianBlur:[],feImage:[],feMerge:[],feMergeNode:[],feMorphology:[],feOffset:[],fePointLight:[],feSpecularLighting:[],feSpotLight:[],feTile:[],feTurbulence:[],filter:[],foreignObject:[],g:[],hatch:[],hatchpath:[],line:[],linearGradient:[],marker:[],mask:[],mesh:[],meshgradient:[],meshpatch:[],meshrow:[],metadata:[],mpath:[],path:[],pattern:[],polygon:[],polyline:[],radialGradient:[],rect:[],set:[],solidcolor:[],stop:[],svg:[],switch:[],symbol:[],text:[],
textPath:[],title:[],tspan:[],use:[],view:[],object:[],canvas:v};return this._extendObjectOfArrays([p,{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","loop","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],
em:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align",
"valign"],tt:[],u:[],ul:[],video:"autoplay controls loop preload src height width".split(" ")},this.graphicsWhiteList])},_extendObjectOfArrays:function(v){var p={};B.forEach(v,function(g){var e=Object.keys(g);B.forEach(e,function(b){Array.isArray(g[b])&&Array.isArray(p[b])?p[b]=p[b].concat(g[b]):p[b]=g[b]},this)},this);return p},_isInWhiteList:function(v,p){p=Object.keys(p);var g=!1;B.forEach(p,function(e){v===e&&(g=!0)},this);return g}});c.getInstance=function(){null===r&&(r=new c);return r};return c})},
"widgets/SmartEditor/SEFilterEditor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/dom-construct dijit/_TemplatedMixin dijit/_WidgetBase jimu/utils".split(" "),function(O,B,F,E,f,h,r){return O([h,f],{name:"SEFilterEditor",baseClass:"jimu-widget-sefilterEditor",declaredClass:"jimu.dijit.SEFilterEditor",templateString:"\x3cdiv style\x3d'width:100%'\x3e\x3cdiv data-dojo-attach-point\x3d'filterEditorDiv'\x3e\x3c/div\x3e\x3c/div\x3e",_templatePicker:null,_layers:null,map:null,
nls:null,_origGetItemsFromLayerFunc:null,gpFilterTemplates:!1,postCreate:function(){this._createFilterTool()},_createFilterTool:function(){this._createLayerFilter();this._createTemplateFilter();this._loadTemplates()},_createLayerFilter:function(){this.selectDropDown=E.create("select",{"class":"flDropDown templatePicker",tabindex:"0","aria-label":this.nls.filterEditor.filterLayerLabel});E.place(this.selectDropDown,this.filterEditorDiv);this.selectDropDown.onchange=B.hitch(this,function(){var c=!0;
""===this.filterTextBox.value||this.gpFilterTemplates||(c=!1);this._onLayerFilterChanged(c)})},removeOptions:function(c){var v;for(v=c.options.length-1;0<=v;v--)c.remove(v)},_loadTemplates:function(){var c=this.selectDropDown.value===this.nls.filterEditor.all||""===this.selectDropDown.value?null:this.selectDropDown.value,v=r.sanitizeHTML(this.filterTextBox.value),p=!1;this.removeOptions(this.selectDropDown);var g=E.create("option",{value:this.nls.filterEditor.all,innerHTML:this.nls.filterEditor.all});
E.place(g,this.selectDropDown);for(g=0;g<this._layers.length;g++){var e=this._layers[g];!0===e.visible&&!0===e.visibleAtMapScale&&(null!==c&&e.id===c&&(p=!0),e=E.create("option",{value:e.id,innerHTML:e.name}),E.place(e,this.selectDropDown))}!0===p&&(this.selectDropDown.value=c,this._onLayerFilterChanged());null!==v&&""!==v&&(this.filterTextBox.value=v,this._onTemplateFilterChanged())},setTemplatePicker:function(c,v){this._layers=v;this._templatePicker=c;this._overrideTemplatePicker();this._loadTemplates()},
_createTemplateFilter:function(){this.filterTextBox=E.create("input",{"class":"searchtextbox templatePicker",type:"text",placeholder:this.nls.filterEditor.searchTemplates},this.filterEditorDiv);this.filterTextBox.onkeyup=B.hitch(this,function(){this._onTemplateFilterChanged()});this._overrideTemplatePicker()},_overrideTemplatePicker:function(){this._origGetItemsFromLayerFunc=this._templatePicker._getItemsFromLayer;this._templatePicker._getItemsFromLayer=B.hitch(this,function(){var c=this._origGetItemsFromLayerFunc.apply(this._templatePicker,
arguments);var v=r.sanitizeHTML(this.filterTextBox.value);v&&(c=F.filter(c,function(p){var g=!1,e=new RegExp(v,"ig");p.hasOwnProperty("label")&&p.label.match(e)&&0<p.label.match(e).length&&(g=!0);p.hasOwnProperty("template")&&p.template.hasOwnProperty("name")&&p.template.name.match(e)&&0<p.template.name.match(e).length&&(g=!0);return g},v));0===c.length&&(this._templatePicker.grid.noDataMessage=this.nls.filterEditor.noAvailableTempaltes,this._templatePicker.grid.params.noDataMessage=this.nls.filterEditor.noAvailableTempaltes,
this._templatePicker.grid.messagesNode.innerText=this.nls.filterEditor.noAvailableTempaltes);return c})},_onLayerFilterChanged:function(c){var v=!0;this._templatePicker.clearSelection();var p=this.selectDropDown.options[this.selectDropDown.selectedIndex].text;""!==p&&(p===this.nls.filterEditor.all?(p=this._filter_layers(r.sanitizeHTML(this.filterTextBox.value)),v=0!==p.length,this._templatePicker.attr("featureLayers",p),!0===this.gpFilterTemplates||c?this._templatePicker.attr("grouping",!0):this._templatePicker.attr("grouping",
!1)):(c=this.map.getLayer(this.selectDropDown.value),this._templatePicker.attr("featureLayers",[c]),this._templatePicker.attr("grouping",!1)),this._templatePicker.update(),v||(this._templatePicker.grid.messagesNode.innerText=this.nls.filterEditor.noAvailableTempaltes))},_filter_layers:function(c){return F.filter(this._layers,B.hitch(this,function(v){if(!1===v.visible||!1===v.visibleAtMapScale)return!1;if(""===c)return!0;var p=F.filter(v.templates,function(g){var e=!1,b=new RegExp(c,"ig");g.hasOwnProperty("name")&&
g.name.match(b)&&0<g.name.match(b).length&&(e=!0);return e},c);type_items=F.filter(v.types,function(g){return 0<F.filter(g.templates,function(e){var b=!1,a=new RegExp(c,"ig");e.hasOwnProperty("name")&&e.name.match(a)&&0<e.name.match(a).length&&(b=!0);return b},c).length},c);return 0<type_items.length||0<p.length}))},_onTemplateFilterChanged:function(){var c=this.selectDropDown.options[this.selectDropDown.selectedIndex].text,v=r.sanitizeHTML(this.filterTextBox.value),p=!0;c===this.nls.filterEditor.all&&
(p=this._filter_layers(v),this._templatePicker.attr("featureLayers",p),p=0!==p.length);c===this.nls.filterEditor.all?""===v?this._templatePicker.attr("grouping",!0):!0===this.gpFilterTemplates?this._templatePicker.attr("grouping",!0):this._templatePicker.attr("grouping",!1):this._templatePicker.attr("grouping",!1);this._templatePicker.update();p||(this._templatePicker.grid.messagesNode.innerText=this.nls.filterEditor.noAvailableTempaltes)},addNewLayerInEditor:function(c){var v=!1,p=!0;F.some(this.selectDropDown.options,
B.hitch(this,function(e){if(e.value===c.id)return v=!0}));if(!v){var g=E.create("option",{value:c.id,innerHTML:c.name});E.place(g,this.selectDropDown.options[0],"after")}this._layers.splice(0,0,c);""===this.filterTextBox.value||this.gpFilterTemplates||(p=!1);this._onLayerFilterChanged(p)},removeLayerFromEditor:function(c){var v=!0;F.some(this._layers,B.hitch(this,function(p,g){if(p.id===c.id)return this._layers.splice(g,1),!0}));F.some(this.selectDropDown.options,B.hitch(this,function(p,g){if(p.value===
c.id)return this.selectDropDown.remove(g),""!==this.filterTextBox.value&&(v=!1),this._onLayerFilterChanged(v),!0}))}})})},"widgets/SmartEditor/SEDrawingOptions":function(){define(["esri/toolbars/draw"],function(O){return{select:[{id:"seNewSelection",iconClass:"seToolbarIcon seNewSelectionIcon",label:window.apiNls.widgets.editor.tools.NLS_selectionNewLbl}],esriGeometryPoint:[{id:"sePointTool",iconClass:"seToolbarIcon sePointIcon",_disabledIcon:"seToolbarIcon sePointIconDisabled",_drawType:O.POINT,
label:window.apiNls.widgets.editor.tools.NLS_pointLbl},{id:"seSelectFeaturesPointToRect",iconClass:"feature-action icon-select-by-rect",label:"",_drawType:"EXTENT"},{id:"seSelectFeaturesPointToLine",iconClass:"feature-action icon-select-by-polygon",label:"",_drawType:"POLYGON"},{id:"seSelectFeaturesPointToLasso",iconClass:"feature-action icon-select-by-freehand-polygon",label:"",_drawType:"FREEHAND_POLYGON"}],esriGeometryPolyline:[{id:"seDrawPolyline",iconClass:"seToolbarIcon sePolylineIcon",_disabledIcon:"seToolbarIcon sePolylineIconDisabled",
_drawType:O.POLYLINE,label:window.apiNls.widgets.editor.tools.NLS_polylineLbl},{id:"seDrawFreehandPolyline",iconClass:"seToolbarIcon seFreehandPolylineIcon",_disabledIcon:"seToolbarIcon seFreehandPolylineIcon",_drawType:O.FREEHAND_POLYLINE,label:window.apiNls.widgets.editor.tools.NLS_freehandPolylineLbl},{id:"seDrawRectPolyline",iconClass:"seToolbarIcon seRectangleIcon",_disabledIcon:"seToolbarIcon seRectangleIcon",_drawType:O.RECTANGLE,label:window.apiNls.widgets.editor.tools.NLS_rectangleLbl},{id:"seDrawArrowPolyline",
iconClass:"seToolbarIcon seArrowIcon",_disabledIcon:"seToolbarIcon seArrowIcon",_drawType:O.ARROW,label:window.apiNls.widgets.editor.tools.NLS_arrowLbl},{id:"seDrawArrowUpPolyline",iconClass:"seToolbarIcon seArrowUpIcon",_disabledIcon:"seToolbarIcon seArrowUpIcon",_drawType:O.UP_ARROW,label:window.apiNls.widgets.editor.tools.NLS_arrowUpLbl},{id:"seDrawDownArrowPolyline",iconClass:"seToolbarIcon seArrowDownIcon",_disabledIcon:"seToolbarIcon seArrowDownIcon",_drawType:O.DOWN_ARROW,label:window.apiNls.widgets.editor.tools.NLS_arrowDownLbl},
{id:"seDrawLeftArrowPolyline",iconClass:"seToolbarIcon seArrowLeftIcon",_disabledIcon:"seToolbarIcon arrowLeftIcon",_drawType:O.LEFT_ARROW,label:window.apiNls.widgets.editor.tools.NLS_arrowLeftLbl},{id:"seDrawRightArrowPolyline",iconClass:"seToolbarIcon seArrowIcon",_disabledIcon:"seToolbarIcon seArrowIcon",_drawType:O.RIGHT_ARROW,label:window.apiNls.widgets.editor.tools.NLS_arrowRightLbl},{id:"seDrawCirclePolyline",iconClass:"seToolbarIcon seCircleIcon",_disabledIcon:"seToolbarIcon seCircleIcon",
_drawType:O.CIRCLE,label:window.apiNls.widgets.editor.tools.NLS_circleLbl},{id:"seDrawEllipsePolyline",iconClass:"seToolbarIcon seEllipseIcon",_disabledIcon:"seToolbarIcon seEllipseIcon",_drawType:O.ELLIPSE,label:window.apiNls.widgets.editor.tools.NLS_ellipseLbl},{id:"seDrawTrianglePolyline",iconClass:"seToolbarIcon seTriangleIcon",_disabledIcon:"seToolbarIcon seTriangleIcon",_drawType:O.TRIANGLE,label:window.apiNls.widgets.editor.tools.NLS_triangleLbl},{id:"seSelectFeaturesLineToRect",iconClass:"feature-action icon-select-by-rect",
label:"",_drawType:"EXTENT"},{id:"seSelectFeaturesLineToLine",iconClass:"feature-action icon-select-by-polygon",label:"",_drawType:"POLYGON"},{id:"seSelectFeaturesLineToLasso",iconClass:"feature-action icon-select-by-freehand-polygon",label:"",_drawType:"FREEHAND_POLYGON"}],esriGeometryPolygon:[{id:"seDrawPolygon",iconClass:"seToolbarIcon sePolygonIcon",_disabledIcon:"seToolbarIcon sePolygonIconDisabled",_drawType:O.POLYGON,label:window.apiNls.widgets.editor.tools.NLS_polygonLbl},{id:"seDrawFreehandPolygon",
iconClass:"seToolbarIcon seFreehandPolygonIcon",_disabledIcon:"seToolbarIcon seFreehandPolygonIconDisabled",_drawType:O.FREEHAND_POLYGON,label:window.apiNls.widgets.editor.tools.NLS_freehandPolygonLbl},{id:"seDrawRect",iconClass:"seToolbarIcon seRectangleIcon",_disabledIcon:"seToolbarIcon seRectangleIcon",_drawType:O.RECTANGLE,label:window.apiNls.widgets.editor.tools.NLS_rectangleLbl},{id:"seDrawArrow",iconClass:"seToolbarIcon seArrowIcon",_disabledIcon:"seToolbarIcon seArrowIcon",_drawType:O.ARROW,
label:window.apiNls.widgets.editor.tools.NLS_arrowLbl},{id:"seDrawArrowUp",iconClass:"seToolbarIcon seArrowUpIcon",_disabledIcon:"seToolbarIcon seArrowUpIcon",_drawType:O.UP_ARROW,label:window.apiNls.widgets.editor.tools.NLS_arrowUpLbl},{id:"seDrawDownArrow",iconClass:"seToolbarIcon seArrowDownIcon",_disabledIcon:"seToolbarIcon seArrowDownIcon",_drawType:O.DOWN_ARROW,label:window.apiNls.widgets.editor.tools.NLS_arrowDownLbl},{id:"seDrawLeftArrow",iconClass:"seToolbarIcon seArrowLeftIcon",_disabledIcon:"seToolbarIcon arrowLeftIcon",
_drawType:O.LEFT_ARROW,label:window.apiNls.widgets.editor.tools.NLS_arrowLeftLbl},{id:"seDrawRightArrow",iconClass:"seToolbarIcon seArrowIcon",_disabledIcon:"seToolbarIcon seArrowIcon",_drawType:O.RIGHT_ARROW,label:window.apiNls.widgets.editor.tools.NLS_arrowRightLbl},{id:"seDrawCircle",iconClass:"seToolbarIcon seCircleIcon",_disabledIcon:"seToolbarIcon seCircleIcon",_drawType:O.CIRCLE,label:window.apiNls.widgets.editor.tools.NLS_circleLbl},{id:"seDrawEllipse",iconClass:"seToolbarIcon seEllipseIcon",
_disabledIcon:"seToolbarIcon seEllipseIcon",_drawType:O.ELLIPSE,label:window.apiNls.widgets.editor.tools.NLS_ellipseLbl},{id:"seDrawTriangle",iconClass:"seToolbarIcon seTriangleIcon",_disabledIcon:"seToolbarIcon seTriangleIcon",_drawType:O.TRIANGLE,label:window.apiNls.widgets.editor.tools.NLS_triangleLbl},{id:"seSelectFeaturesPolygonToRect",iconClass:"feature-action icon-select-by-rect",label:"",_drawType:"EXTENT"},{id:"seSelectFeaturesPolygonToLine",iconClass:"feature-action icon-select-by-polygon",
label:"",_drawType:"POLYGON"},{id:"seSelectFeaturesPolygonToLasso",iconClass:"feature-action icon-select-by-freehand-polygon",label:"",_drawType:"FREEHAND_POLYGON"}]}})},"widgets/SmartEditor/PrivilegeUtil":function(){define("dojo/_base/declare dojo/_base/lang dojo/Deferred jimu/portalUtils jimu/portalUrlUtils jimu/Role esri/kernel ./PortalAnalysis".split(" "),function(O,B,F,E,f,h,r,c){var v=null,p=O([],{userRole:null,userPortalUrl:null,portalAnalysis:null,portalSelf:null,portalUrl:null,constructor:function(g){this.portalUrl=
g},_clearLoadedInfo:function(){this.portalUrl=this.portalSelf=this.portalAnalysis=this.userPortalUrl=this.userRole=null},loadPrivileges:function(g){g&&this.portalUrl!==g&&(this._clearLoadedInfo(),this.portalUrl=g);if(this._privilegeLoaded())return g=new F,g.resolve(!0),g;g=E.getPortal(this.portalUrl);return g.haveSignIn()?this._loadUserInfo(g):this._signIn(g)},_signIn:function(g){return g.loadSelfInfo().then(B.hitch(this,function(e){var b=E.getPortal(e.portalHostname);return null===b?!1:null===b.credential?
this._loadUserInfo(b):b.signIn().then(B.hitch(this,function(a){return this._loadUserInfo(b,a)}),function(){return!1})}),function(){return!1})},_registerOrgCredential:function(g,e){e=f.getStandardPortalUrl(e);g=B.clone(g.toJson());e+="/sharing/rest";g.server=e;g.resources=[e];r.id.registerToken(g)},_loadUserInfo:function(g,e){return g.loadSelfInfo().then(B.hitch(this,function(b){this.userPortalUrl=b.urlKey?b.urlKey+"."+b.customBaseUrl:this.portalUrl;return b&&b.user?(this.userRole=new h({id:b.user.roleId?
b.user.roleId:b.user.role,role:b.user.role}),b.user.privileges&&this.userRole.setPrivileges(b.user.privileges),this.portalSelf=b,e&&this._registerOrgCredential(e,this.userPortalUrl),this.portalAnalysis=new c(this.userRole,this.portalSelf),!0):!1}),function(){return!1})},_privilegeLoaded:function(){return null!==this.portalSelf},getUser:function(){return this._privilegeLoaded()?this.portalSelf.user:null},isAdmin:function(){return this._privilegeLoaded()?this.userRole.isAdmin():!1},getUserPortal:function(){return this._privilegeLoaded()?
this.userPortalUrl:null},isPortal:function(){return null!==this.portalSelf&&!0===this.portalSelf.isPortal},canPerformAnalysis:function(){return null!==this.portalAnalysis&&this.portalAnalysis.canPerformAnalysis()},hasPrivileges:function(g){return null!==this.portalAnalysis&&this.portalAnalysis.hasPrivileges(g)}});p.getInstance=function(g){null===v&&(v=new p(g));return v};return p})},"widgets/SmartEditor/PortalAnalysis":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","esri/lang"],
function(O,B,F,E){return O([],{userRole:null,portalSelf:null,constructor:function(f,h){this.userRole=f;this.portalSelf=h},canPerformAnalysis:function(){var f=!1;this.userRole&&(this.userRole.isAdmin()||this.userRole.isPublisher())?f=!0:this.userRole&&this.userRole.isCustom()&&(f=this.userRole.canCreateItem()&&this.userRole.canPublishFeatures()&&this.userRole.canUseSpatialAnalysis());this.portalSelf&&this.portalSelf.isPortal&&(f=f&&E.isDefined(this.portalSelf.helperServices.analysis)&&E.isDefined(this.portalSelf.helperServices.analysis.url));
return f},hasPrivileges:function(f){return B.isArray(f)?F.every(f,function(h){return"networkanalysis"===h?this._canPerformNetworkAnalysis():"geoenrichment"===h?this._canPerformGeoEnrichment():"elevation"===h?this._canPerformElevationAnalysis():"drivetimearea"===h?this._canPerformDriveAnalysis():"planroutes"===h?this._canPerformPlanRoutesAnalysis():"od"===h?this._canPerformODAnalysis():!1},this):!0},_canPerformNetworkAnalysis:function(){var f=E.isDefined(this.portalSelf.helperServices.asyncClosestFacility)&&
E.isDefined(this.portalSelf.helperServices.asyncServiceArea)&&E.isDefined(this.portalSelf.helperServices.asyncVRP);return this.canPerformAnalysis()&&f&&this.userRole.canUseNetworkAnalysis()},_canPerformGeoEnrichment:function(){var f=E.isDefined(this.portalSelf.helperServices.geoenrichment);return this.canPerformAnalysis()&&f&&this.userRole.canUseGeoenrichment()},_canPerformElevationAnalysis:function(){var f=E.isDefined(this.portalSelf.helperServices.elevation);return this.canPerformAnalysis()&&f&&
this.userRole.canUseElevation()},_canPerformPlanRoutesAnalysis:function(){var f=E.isDefined(this.portalSelf.helperServices.routingUtilities)&&E.isDefined(this.portalSelf.helperServices.asyncVRP);return this.canPerformAnalysis()&&f&&this.userRole.canUseNetworkAnalysis()},_canPerformODAnalysis:function(){var f=E.isDefined(this.portalSelf.helperServices.routingUtilities)&&E.isDefined(this.portalSelf.helperServices.asyncRoute);return this.canPerformAnalysis()&&f&&this.userRole.canUseNetworkAnalysis()},
_canPerformDriveAnalysis:function(){var f=E.isDefined(this.portalSelf.helperServices.routingUtilities)&&E.isDefined(this.portalSelf.helperServices.asyncServiceArea);return this.canPerformAnalysis()&&f&&this.userRole.canUseNetworkAnalysis()},_canPerformNearestAnalysis:function(){var f=E.isDefined(this.portalSelf.helperServices.routingUtilities)&&E.isDefined(this.portalSelf.helperServices.asyncClosestFacility);return this.canPerformAnalysis()&&f&&this.userRole.canUseNetworkAnalysis()}})})},"widgets/SmartEditor/XYCoordinates":function(){define("dojo/_base/declare dojo/Evented dojo/_base/lang dojo/on dojo/text!./XYCoordinates.html dijit/_WidgetsInTemplateMixin jimu/BaseWidgetSetting jimu/dijit/Popup dojo/dom-attr dojo/dom-class esri/geometry/coordinateFormatter esri/SpatialReference dijit/form/ValidationTextBox".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e){return O([r,B,h],{baseClass:"jimu-widget-smartEditor-XYCoordinates",templateString:f,fieldsPopup:null,postCreate:function(){this._createPopUp();this._eventListener();g.load()},_eventListener:function(){this.own(E(this.coordinatesDropDown,"change",F.hitch(this,this._onChangeDropDown)));this.own(E(this.xAttributeTextBox,"change",F.hitch(this,this._onTextBoxValueChanged)));this.own(E(this.yAttributeTextBox,"change",F.hitch(this,this._onTextBoxValueChanged)));this.mgrsTextBox.validator=
F.hitch(this,this._mgrsValidator)},_onChangeDropDown:function(){p.add(this.xyOptions,"esriCTHidden");p.add(this.mgrsOptions,"esriCTHidden");"Map Spatial Reference"===this.coordinatesDropDown.value?(p.remove(this.xyOptions,"esriCTHidden"),v.set(this.xAttributeTextBoxLabel,"innerHTML",this.nls.xAttributeTextBoxLabel),v.set(this.yAttributeTextBoxLabel,"innerHTML",this.nls.yAttributeTextBoxLabel),this.xAttributeTextBox.set("value",""),this.yAttributeTextBox.set("value",""),v.set(this.xAttributeTextBox,
"aria-label",this.nls.xAttributeTextBoxLabel),v.set(this.yAttributeTextBox,"aria-label",this.nls.yAttributeTextBoxLabel)):"MGRS"===this.coordinatesDropDown.value?p.remove(this.mgrsOptions,"esriCTHidden"):(p.remove(this.xyOptions,"esriCTHidden"),v.set(this.xAttributeTextBoxLabel,"innerHTML",this.nls.latitudeTextBoxLabel),v.set(this.yAttributeTextBoxLabel,"innerHTML",this.nls.longitudeTextBoxLabel),this.xAttributeTextBox.set("value",""),this.yAttributeTextBox.set("value",""),v.set(this.xAttributeTextBox,
"aria-label",this.nls.latitudeTextBoxLabel),v.set(this.yAttributeTextBox,"aria-label",this.nls.longitudeTextBoxLabel))},_createPopUp:function(){this.fieldsPopup=new c({titleLabel:this.nls.coordinatePopupTitle,width:400,maxHeight:300,autoHeight:!0,"class":this.baseClass,content:this,buttons:[{label:this.nls.ok,id:"okButton",onClick:F.hitch(this,function(){this._getData();this.mgrsTextBox.set("value","");this.xAttributeTextBox.set("value","");this.yAttributeTextBox.set("value","");this.fieldsPopup.close()})},
{label:this.nls.cancel,id:"cancelButton",classNames:["jimu-btn-vacation"],onClick:F.hitch(this,function(){this.xAttributeTextBox.set("value","");this.yAttributeTextBox.set("value","");this.fieldsPopup.close()})}]});this.fieldsPopup.disableButton(0);v.set(this.fieldsPopup.disabledButtons[0],"tabindex","-1")},_getData:function(){if("MGRS"===this.coordinatesDropDown.value){var b=g.fromMgrs(this.mgrsTextBox.get("value"),new e(4326),"automatic");b&&this.emit("gotoSelectedLocation",{coordinateSystem:"Latitude/Longitude",
firstPoint:b.y,secondPoint:b.x})}else this.emit("gotoSelectedLocation",{coordinateSystem:this.coordinatesDropDown.getValue(),firstPoint:this.xAttributeTextBox.getValue(),secondPoint:this.yAttributeTextBox.getValue()})},_mgrsValidator:function(){var b=null;""!==this.mgrsTextBox.get("value")&&(b=g.fromMgrs(this.mgrsTextBox.get("value"),new e(4326),"automatic"));if(null===b)return this.fieldsPopup.disableButton(0),v.set(this.fieldsPopup.disabledButtons[0],"tabindex","-1"),!1;this.fieldsPopup.enableButton(0);
v.set(this.fieldsPopup.enabledButtons[0],"tabindex","0");return!0},_onTextBoxValueChanged:function(){isNaN(this.xAttributeTextBox.value)||isNaN(this.yAttributeTextBox.value)?(this.fieldsPopup.disableButton(0),v.set(this.fieldsPopup.disabledButtons[0],"tabindex","-1")):(this.fieldsPopup.enableButton(0),v.set(this.fieldsPopup.enabledButtons[0],"tabindex","0"))}})})},"esri/geometry/coordinateFormatter":function(){define("require exports ../layers/vectorTiles/core/Error ./pe ./Point ../SpatialReference".split(" "),
function(O,B,F,E,f,h){function r(p){var g=null;p||(p=new h(4326));if(p.wkid){if(g=E.PeFactory.geogcs(p.wkid),!g)throw new F("coordinate-formatter:invalid-spatial-reference","wkid is not valid");}else if(p.wkt){if(g=E.PeFactory.fromString(E.PeDefs.PE_TYPE_GEOGCS,p.wkt),!g)throw new F("coordinate-formatter:invalid-spatial-reference","wkt is not valid");}else throw new F("coordinate-formatter:invalid-spatial-reference","wkid and wkt are missing");return g}function c(p){var g=-1;switch(p){case "automatic":g=
E.PeNotationMgrs.PE_MGRS_STYLE_AUTO;break;case "new-180-in-zone-01":g=E.PeNotationMgrs.PE_MGRS_STYLE_NEW|E.PeNotationMgrs.PE_MGRS_180_ZONE_1_PLUS;break;case "new-180-in-zone-60":g=E.PeNotationMgrs.PE_MGRS_STYLE_NEW;break;case "old-180-in-zone-01":g=E.PeNotationMgrs.PE_MGRS_STYLE_OLD|E.PeNotationMgrs.PE_MGRS_180_ZONE_1_PLUS;break;case "old-180-in-zone-60":g=E.PeNotationMgrs.PE_MGRS_STYLE_OLD}return g}function v(p){var g=-1;switch(p){case "latitude-band-indicators":g=E.PeNotationUtm.PE_UTM_OPTS_NONE;
break;case "north-south-indicators":g=E.PeNotationUtm.PE_UTM_OPTS_NS}return g}Object.defineProperty(B,"__esModule",{value:!0});B.isLoaded=function(){return E.isLoaded()};B.isSupported=function(){return E.isSupported()};B.load=function(){return E.load()};B.fromLatitudeLongitude=function(p,g){var e=[];p=p.replace(/\u2032/g,"'");var b=r(g);return E.PeNotationDms.dms_to_geog(b,1,[p],e)?new f(e[0][0],e[0][1],g||new h(4326)):null};B.fromMgrs=function(p,g,e){var b=[],a=c(e);if(-1===a)return console.warn("invalid conversionMode: "+
e),null;e=r(g);return E.PeNotationMgrs.mgrs_to_geog_extended(e,1,[p],a,b)?new f(b[0][0],b[0][1],g||new h(4326)):null};B.fromUsng=function(p,g){var e=[];!g&&/\(.+27/.test(p)&&(g=new h(4267));var b=r(g);return E.PeNotationUsng.usng_to_geog(b,1,[p],e)?new f(e[0][0],e[0][1],g||new h(4326)):null};B.fromUtm=function(p,g,e){var b=[],a=v(e);if(-1===a)return console.warn("invalid conversionMode: "+e),null;e=r(g);return E.PeNotationUtm.utm_to_geog(e,1,[p],a,b)?new f(b[0][0],b[0][1],g||new h(4326)):null};B.toLatitudeLongitude=
function(p,g,e){void 0===e&&(e=0);var b=[[p.x,p.y]],a=[];p=r(p.spatialReference);var m=0;switch(g){case "dd":m=E.PeNotationDms.geog_to_dd(p,1,b,e,a);break;case "ddm":m=E.PeNotationDms.geog_to_ddm(p,1,b,e,a);break;case "dms":m=E.PeNotationDms.geog_to_dms(p,1,b,e,a);break;default:return console.warn("invalid format: "+g),null}return m?a[0]:null};B.toMgrs=function(p,g,e,b){void 0===e&&(e=0);void 0===b&&(b=!1);var a=[[p.x,p.y]],m=[];p=r(p.spatialReference);var n=c(g);if(-1===n)return console.warn("invalid conversionMode: "+
g),null;b&&(n|=E.PeNotationMgrs.PE_MGRS_ADD_SPACES);return E.PeNotationMgrs.geog_to_mgrs_extended(p,1,a,e,!1,n,m)?m[0]:null};B.toUsng=function(p,g,e){void 0===g&&(g=0);void 0===e&&(e=!1);var b=[[p.x,p.y]],a=[];p=r(p.spatialReference);return E.PeNotationUsng.geog_to_usng(p,1,b,g,!1,e,a)?a[0]:null};B.toUtm=function(p,g,e){void 0===e&&(e=!1);var b=[[p.x,p.y]],a=[];p=r(p.spatialReference);var m=v(g);if(-1===m)return console.warn("invalid conversionMode: "+g),null;e&&(m|=E.PeNotationUtm.PE_UTM_OPTS_ADD_SPACES);
return E.PeNotationUtm.geog_to_utm(p,1,b,m,a)?a[0]:null}})},"esri/layers/vectorTiles/core/Error":function(){define(["require","exports","./tsSupport/extendsHelper","./lang","./Message"],function(O,B,F,E,f){O=function(h){function r(c,v,p){var g=h.call(this,c,v,p)||this;return g instanceof r?g:new r(c,v,p)}F(r,h);r.prototype.toJSON=function(){return{name:this.name,message:this.message,details:E.clone(this.details),dojoType:this.dojoType}};r.fromJSON=function(c){var v=new r(c.name,c.message,c.details);
null!=c.dojoType&&(v.dojoType=c.dojoType);return v};return r}(f);O.prototype.type="error";return O})},"esri/layers/vectorTiles/core/tsSupport/extendsHelper":function(){define([],function(){return function(){var O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,F){B.__proto__=F}||function(B,F){for(var E in F)F.hasOwnProperty(E)&&(B[E]=F[E])};return function(B,F){function E(){this.constructor=B}O(B,F);B.prototype=null===F?Object.create(F):(E.prototype=F.prototype,new E)}}()})},"esri/layers/vectorTiles/core/lang":function(){define("dojo/_base/kernel dojo/_base/lang dojo/date dojo/number dojo/date/locale dojo/i18n!../nls/common".split(" "),
function(O,B,F,E,f,h){function r(a){return void 0!==a&&null!==a}function c(a){return r(a)?a:""}function v(a,m,n){var l=n.match(/([^\(]+)(\([^\)]+\))?/i),k=B.trim(l[1]);n=m[a];l=JSON.parse((l[2]?B.trim(l[2]):"{}").replace(/^\(/,"{").replace(/\)$/,"}").replace(/([{,])\s*([0-9a-zA-Z_]+)\s*:/gi,'$1"$2":').replace(/"\s*:\s*'/gi,'":"').replace(/'\s*(,|\})/gi,'"$1'));var y=l.utcOffset;if(-1===e.indexOf(k))k=B.getObject(k),B.isFunction(k)&&(n=k(n,a,m,l));else if("number"===typeof n||"string"===typeof n&&
n&&!isNaN(Number(n)))switch(n=Number(n),k){case "NumberFormat":a=B.mixin({},l);m=parseFloat(a.places);if(isNaN(m)||0>m)a.places=Infinity;return E.format(n,a);case "DateString":n=new Date(n);if(l.local||l.systemLocale)return l.systemLocale?n.toLocaleDateString()+(l.hideTime?"":" "+n.toLocaleTimeString()):n.toDateString()+(l.hideTime?"":" "+n.toTimeString());n=n.toUTCString();l.hideTime&&(n=n.replace(/\s+\d\d:\d\d:\d\d\s+(utc|gmt)/i,""));return n;case "DateFormat":return n=new Date(n),r(y)&&(n=F.add(n,
"minute",n.getTimezoneOffset()-y)),f.format(n,l)}return c(n)}function p(a,m){var n;if(m)for(n in a)a.hasOwnProperty(n)&&(void 0===a[n]?delete a[n]:a[n]instanceof Object&&p(a[n],!0));else for(n in a)a.hasOwnProperty(n)&&void 0===a[n]&&delete a[n];return a}function g(a){if(!a||"object"!=typeof a||B.isFunction(a))return a;if(a instanceof Int8Array||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int16Array||a instanceof Int32Array||a instanceof Uint16Array||a instanceof Uint32Array||
a instanceof Float32Array||a instanceof Float64Array||a instanceof Date)return new a.constructor(a);if(a instanceof ArrayBuffer)return a.slice(0,a.byteLength);if("function"===typeof a.clone)a=a.clone();else if("function"===typeof a.map&&"function"===typeof a.forEach)a=a.map(g);else if("function"===typeof a.notifyChange&&"function"===typeof a.watch)a=a.clone();else{var m={},n,l={};for(n in a){var k=a[n];var y=!(n in l)||l[n]!==k;if(!(n in m)||m[n]!==k&&y)m[n]=g?g(k):k}a=m}return a}var e=["NumberFormat",
"DateString","DateFormat"],b=/<\/?[^>]+>/g;return{equals:function(a,m){return a===m||"number"===typeof a&&isNaN(a)&&"number"===typeof m&&isNaN(m)||B.isFunction((a||{}).getTime)&&B.isFunction((m||{}).getTime)&&a.getTime()==m.getTime()||B.isFunction((a||{}).equals)&&a.equals(m)||B.isFunction((m||{}).equals)&&m.equals(a)||!1},mixin:B.mixin,valueOf:function(a,m){for(var n in a)if(a[n]==m)return n;return null},stripTags:function(a){if(a){var m=typeof a;if("string"===m)a=a.replace(b,"");else if("object"===
m)for(var n in a)(m=a[n])&&"string"===typeof m&&(m=m.replace(b,"")),a[n]=m}return a},substitute:function(a,m,n){if(r(n))if(B.isObject(n)){var l=n.first;var k=n.dateFormat;var y=n.numberFormat}else l=n;if(m&&"{*}"!==m)return B.replace(m,B.hitch({obj:a},function(C,q){C=q.split(":");return 1<C.length?(q=C[0],C.shift(),v(q,this.obj,C.join(":"))):k&&-1!==(k.properties||[]).indexOf(q)?v(q,this.obj,k.formatter||"DateString"):y&&-1!==(y.properties||[]).indexOf(q)?v(q,this.obj,y.formatter||"NumberFormat"):
c(this.obj[q])}));m=[];var u;m.push('\x3ctable class\x3d"esri-widget__table" summary\x3d"'+h.fieldsSummary+'"\x3e\x3ctbody\x3e');for(u in a)if(n=a[u],k&&-1!==(k.properties||[]).indexOf(u)?n=v(u,a,k.formatter||"DateString"):y&&-1!==(y.properties||[]).indexOf(u)&&(n=v(u,a,y.formatter||"NumberFormat")),m.push("\x3ctr\x3e\x3cth\x3e"+u+"\x3c/th\x3e\x3ctd\x3e"+c(n)+"\x3c/td\x3e\x3c/tr\x3e"),l)break;m.push("\x3c/tbody\x3e\x3c/table\x3e");return m.join("")},filter:function(a,m,n){m=[B.isString(a)?a.split(""):
a,n||O.global,B.isString(m)?new Function("item","index","array",m):m];n={};var l;a=m[0];for(l in a)m[2].call(m[l],a[l],l,a)&&(n[l]=a[l]);return n},startsWith:function(a,m,n){n=n||0;return a.indexOf(m,n)===n},endsWith:function(a,m,n){if("number"!==typeof n||!isFinite(n)||Math.floor(n)!==n||n>a.length)n=a.length;n-=m.length;a=a.indexOf(m,n);return-1!==a&&a===n},isDefined:r,fixJson:p,clone:g}})},"esri/layers/vectorTiles/core/Message":function(){define(["require","exports","dojo/string"],function(O,B,
F){return function(){function E(f,h,r){this instanceof E&&(this.name=f,this.message=h&&F.substitute(h,r,function(c){return null==c?"":c})||"",this.details=r)}E.prototype.toString=function(){return"["+this.name+"]: "+this.message};return E}()})},"esri/geometry/pe":function(){define(["require","exports","../core/tsSupport/extendsHelper","dojo/Deferred","../core/sniff"],function(O,B,F,E,f){function h(l){function k(q,w,x){q[w]=x(q[w])}B._pe=l;e.init();b.init();a.init();m.init();n.init();B.PeGCSExtent=
function(q){function w(){return null!==q&&q.apply(this,arguments)||this}F(w,q);w.prototype.destroy=function(){B._pe.destroy(this)};return w}(B._pe.PeGCSExtent);for(var y=0,u=[B._pe.PeDatum,B._pe.PeGeogcs,B._pe.PeGeogtran,B._pe.PeObject,B._pe.PeParameter,B._pe.PePrimem,B._pe.PeProjcs,B._pe.PeSpheroid,B._pe.PeUnit];y<u.length;y++)l=u[y],k(l.prototype,"getName",function(q){return function(){return q.call(this,Array(e.PE_NAME_MAX))}});y=0;for(u=[B._pe.PeGeogtran,B._pe.PeProjcs];y<u.length;y++)l=u[y],
k(l.prototype,"getParameters",function(q){return function(){for(var w=Array(e.PE_PARM_MAX),x=q.call(this),I=0;I<w.length;I++){var A=B._pe.getValue(x,"*");w[I]=A?B._pe.wrapPointer(A,B._pe.PeParameter):null;x+=Int32Array.BYTES_PER_ELEMENT}return w}});k(B._pe.PeHorizon.prototype,"getCoord",function(q){return function(){var w=this.getSize();if(!w)return null;var x=[],I=q.call(this);p(x,w,I);return x}});k(B._pe.PeGTlistExtendedEntry.prototype,"getEntries",function(q){var w=B._pe._pe_getPeGTlistExtendedGTsSize();
return function(){var x=null,I=q.call(this);if(!B._pe.compare(I,B._pe.NULL)){x=[I];var A=this.getSteps();if(1<A){I=B._pe.getPointer(I);for(var M=1;M<A;M++)x.push(B._pe.wrapPointer(I+w*M,B._pe.PeGTlistExtendedGTs))}}return x}});var C=B._pe._pe_getPeHorizonSize();l=function(q){return function(){var w=this._cache;w||(this._cache=w=new Map);if(w.has(q))return w.get(q);var x=null,I=q.call(this);if(!B._pe.compare(I,B._pe.NULL)){x=[I];var A=I.getNump();if(1<A){I=B._pe.getPointer(I);for(var M=1;M<A;M++)x.push(B._pe.wrapPointer(I+
C*M,B._pe.PeHorizon))}}w.set(q,x);return x}};k(B._pe.PeProjcs.prototype,"horizonGcsGenerate",l);k(B._pe.PeProjcs.prototype,"horizonPcsGenerate",l);B._pe.PeObject.prototype.toString=function(q){void 0===q&&(q=e.PE_STR_OPTS_NONE);B._pe.ensureCache.prepare();var w=B._pe.getPointer(this),x=B._pe.ensureInt8(Array(e.PE_BUFFER_MAX));return B._pe.UTF8ToString(B._pe._pe_object_to_string_ext(w,q,x))}}function r(l){if(l){var k=B._pe.getClass(l);k&&(k=B._pe.getCache(k))&&(l=B._pe.getPointer(l))&&delete k[l]}}
function c(l,k){var y=[];k=Array(k);for(var u=0;u<l;u++)y.push(B._pe.ensureInt8(k));return y}function v(l){if(Array.isArray(l[0])){var k=[];l.forEach(function(y){k.push(y[0],y[1])})}else k=l;return k}function p(l,k,y,u){void 0===u&&(u=!1);if(u)for(u=0;u<2*k;u++)l[u]=B._pe.getValue(y+u*Float64Array.BYTES_PER_ELEMENT,"double");else{var C=0===l.length;for(u=0;u<k;u++)C&&(l[u]=Array(2)),l[u][0]=B._pe.getValue(y,"double"),l[u][1]=B._pe.getValue(y+Float64Array.BYTES_PER_ELEMENT,"double"),y+=2*Float64Array.BYTES_PER_ELEMENT}}
Object.defineProperty(B,"__esModule",{value:!0});var g;B._pe=null;B.isLoaded=function(){return!!B._pe};B.isSupported=function(){return!!f("esri-wasm")};B.load=function(){if(g)return g.promise;g=new E;O(["./support/pe-wasm"],function(l){l({locateFile:function(k){return O.toUrl("./support/"+k)},onAbort:function(k){g.reject(Error(k))}}).then(function(k){h(k);g.resolve()})});return g.promise};(function(l){function k(C,q,w){B._pe.ensureCache.prepare();var x=v(w),I=w===x;x=B._pe.ensureFloat64(x);(C=B._pe._pe_geog_to_proj(B._pe.getPointer(C),
q,x))&&p(w,q,x,I);return C}function y(C,q,w){return u(C,q,w,0)}function u(C,q,w,x){B._pe.ensureCache.prepare();var I=v(w),A=w===I;I=B._pe.ensureFloat64(I);(C=B._pe._pe_proj_to_geog_center(B._pe.getPointer(C),q,I,x))&&p(w,q,I,A);return C}l.geogToProj=k;l.projGeog=function(C,q,w,x){switch(x){case e.PE_TRANSFORM_P_TO_G:return y(C,q,w);case e.PE_TRANSFORM_G_TO_P:return k(C,q,w)}return 0};l.projToGeog=y;l.projToGeogCenter=u})(B.PeCSTransformations||(B.PeCSTransformations={}));var e;(function(l){l.init=
function(){l.PE_BUFFER_MAX=B._pe.PeDefs.prototype.PE_BUFFER_MAX;l.PE_NAME_MAX=B._pe.PeDefs.prototype.PE_NAME_MAX;l.PE_MGRS_MAX=B._pe.PeDefs.prototype.PE_MGRS_MAX;l.PE_USNG_MAX=B._pe.PeDefs.prototype.PE_USNG_MAX;l.PE_DD_MAX=B._pe.PeDefs.prototype.PE_DD_MAX;l.PE_DDM_MAX=B._pe.PeDefs.prototype.PE_DDM_MAX;l.PE_DMS_MAX=B._pe.PeDefs.prototype.PE_DMS_MAX;l.PE_UTM_MAX=B._pe.PeDefs.prototype.PE_UTM_MAX;l.PE_PARM_MAX=B._pe.PeDefs.prototype.PE_PARM_MAX;l.PE_TYPE_NONE=B._pe.PeDefs.prototype.PE_TYPE_NONE;l.PE_TYPE_GEOGCS=
B._pe.PeDefs.prototype.PE_TYPE_GEOGCS;l.PE_TYPE_PROJCS=B._pe.PeDefs.prototype.PE_TYPE_PROJCS;l.PE_TYPE_GEOGTRAN=B._pe.PeDefs.prototype.PE_TYPE_GEOGTRAN;l.PE_TYPE_COORDSYS=B._pe.PeDefs.prototype.PE_TYPE_COORDSYS;l.PE_TYPE_UNIT=B._pe.PeDefs.prototype.PE_TYPE_UNIT;l.PE_STR_OPTS_NONE=B._pe.PeDefs.prototype.PE_STR_OPTS_NONE;l.PE_STR_AUTH_NONE=B._pe.PeDefs.prototype.PE_STR_AUTH_NONE;l.PE_STR_AUTH_TOP=B._pe.PeDefs.prototype.PE_STR_AUTH_TOP;l.PE_STR_NAME_CANON=B._pe.PeDefs.prototype.PE_STR_NAME_CANON;l.PE_PARM_X0=
B._pe.PeDefs.prototype.PE_PARM_X0;l.PE_PARM_ND=B._pe.PeDefs.prototype.PE_PARM_ND;l.PE_TRANSFORM_1_TO_2=B._pe.PeDefs.prototype.PE_TRANSFORM_1_TO_2;l.PE_TRANSFORM_2_TO_1=B._pe.PeDefs.prototype.PE_TRANSFORM_2_TO_1;l.PE_TRANSFORM_P_TO_G=B._pe.PeDefs.prototype.PE_TRANSFORM_P_TO_G;l.PE_TRANSFORM_G_TO_P=B._pe.PeDefs.prototype.PE_TRANSFORM_G_TO_P;l.PE_HORIZON_RECT=B._pe.PeDefs.prototype.PE_HORIZON_RECT;l.PE_HORIZON_POLY=B._pe.PeDefs.prototype.PE_HORIZON_POLY;l.PE_HORIZON_LINE=B._pe.PeDefs.prototype.PE_HORIZON_LINE;
l.PE_HORIZON_DELTA=B._pe.PeDefs.prototype.PE_HORIZON_DELTA}})(e=B.PeDefs||(B.PeDefs={}));(function(l){function k(q,w){var x=null,I=u[q];I||(I={},u[q]=I);I.hasOwnProperty(String(w))?x=I[w]:(q=B._pe.PeFactory.prototype.factoryByType(q,w),B._pe.compare(q,B._pe.NULL)||(x=q,I[w]=x));return x=y(x)}function y(q){if(q){var w=q.getType();switch(w){case e.PE_TYPE_GEOGCS:q=B._pe.castObject(q,B._pe.PeGeogcs);break;case e.PE_TYPE_PROJCS:q=B._pe.castObject(q,B._pe.PeProjcs);break;case e.PE_TYPE_GEOGTRAN:q=B._pe.castObject(q,
B._pe.PeGeogtran);break;default:w&e.PE_TYPE_UNIT&&(q=B._pe.castObject(q,B._pe.PeUnit))}}return q}var u={},C={};l.initialize=function(){B._pe.PeFactory.prototype.initialize(null)};l.coordsys=function(q){return k(e.PE_TYPE_COORDSYS,q)};l.factoryByType=k;l.fromString=function(q,w){var x=null,I=C[q];I||(I={},C[q]=I);I.hasOwnProperty(w)?x=I[w]:(q=B._pe.PeFactory.prototype.fromString(q,w),B._pe.compare(q,B._pe.NULL)||(x=q,I[w]=x));return x=y(x)};l.geogcs=function(q){return k(e.PE_TYPE_GEOGCS,q)};l.geogtran=
function(q){return k(e.PE_TYPE_GEOGTRAN,q)};l.getCode=function(q){return B._pe.PeFactory.prototype.getCode(q)};l.projcs=function(q){return k(e.PE_TYPE_PROJCS,q)};l.unit=function(q){return k(e.PE_TYPE_UNIT,q)}})(B.PeFactory||(B.PeFactory={}));B.PeGCSExtent=null;var b;(function(l){var k;l.init=function(){l.PE_GTLIST_OPTS_COMMON=B._pe.PeGTlistExtended.prototype.PE_GTLIST_OPTS_COMMON;k=B._pe._pe_getPeGTlistExtendedEntrySize()};l.getGTlist=function(y,u,C,q,w,x){var I=null,A=new B._pe.PeInteger(x);try{var M=
B._pe.PeGTlistExtended.prototype.getGTlist(y,u,C,q,w,A);if(x=A.val)if(I=[M],1<x){var H=B._pe.getPointer(M);for(y=1;y<x;y++)I.push(B._pe.wrapPointer(H+k*y,B._pe.PeGTlistExtendedEntry))}}finally{B._pe.destroy(A)}return I}})(b=B.PeGTlistExtended||(B.PeGTlistExtended={}));(function(l){l.destroy=function(k){if(k&&k.length){for(var y=0;y<k.length;y++){var u=k[y];r(u);u.getEntries().forEach(function(C){r(C);C=C.getGeogtran();r(C);C.getParameters().forEach(r);[C.getGeogcs1(),C.getGeogcs2()].forEach(function(q){r(q);
var w=q.getDatum();r(w);r(w.getSpheroid());r(q.getPrimem());r(q.getUnit())})})}B._pe.PeGTlistExtendedEntry.prototype.Delete(k[0])}}})(B.PeGTlistExtendedEntry||(B.PeGTlistExtendedEntry={}));(function(l){l.geogToGeog=function(k,y,u,C,q){B._pe.ensureCache.prepare();var w=v(u),x=u===w;w=B._pe.ensureFloat64(w);var I=0;C&&(I=B._pe.ensureFloat64(C));(k=B._pe._pe_geog_to_geog(B._pe.getPointer(k),y,w,I,q))&&p(u,y,w,x);return k}})(B.PeGTTransformations||(B.PeGTTransformations={}));(function(l){function k(u,
C,q,w,x,I){B._pe.ensureCache.prepare();switch(u){case "dd":var A=B._pe._pe_geog_to_dd;var M=e.PE_DD_MAX;break;case "ddm":A=B._pe._pe_geog_to_ddm;M=e.PE_DDM_MAX;break;case "dms":A=B._pe._pe_geog_to_dms,M=e.PE_DMS_MAX}u=0;C&&(u=B._pe.getPointer(C));C=v(w);C=B._pe.ensureFloat64(C);M=c(q,M);w=B._pe.ensureInt32(M);if(x=A(u,q,C,x,w))for(A=0;A<q;A++)I[A]=B._pe.UTF8ToString(M[A]);return x}function y(u,C,q,w,x){B._pe.ensureCache.prepare();switch(u){case "dd":var I=B._pe._pe_dd_to_geog;break;case "ddm":I=B._pe._pe_ddm_to_geog;
break;case "dms":I=B._pe._pe_dms_to_geog}u=0;C&&(u=B._pe.getPointer(C));C=w.map(function(A){return B._pe.ensureString(A)});w=B._pe.ensureInt32(C);C=B._pe.ensureFloat64(Array(2*q));(I=I(u,q,w,C))&&p(x,q,C);return I}l.geog_to_dms=function(u,C,q,w,x){return k("dms",u,C,q,w,x)};l.dms_to_geog=function(u,C,q,w){return y("dms",u,C,q,w)};l.geog_to_ddm=function(u,C,q,w,x){return k("ddm",u,C,q,w,x)};l.ddm_to_geog=function(u,C,q,w){return y("ddm",u,C,q,w)};l.geog_to_dd=function(u,C,q,w,x){return k("dd",u,C,
q,w,x)};l.dd_to_geog=function(u,C,q,w){return y("dd",u,C,q,w)}})(B.PeNotationDms||(B.PeNotationDms={}));var a;(function(l){l.init=function(){l.PE_MGRS_STYLE_NEW=B._pe.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW;l.PE_MGRS_STYLE_OLD=B._pe.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD;l.PE_MGRS_STYLE_AUTO=B._pe.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO;l.PE_MGRS_180_ZONE_1_PLUS=B._pe.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS;l.PE_MGRS_ADD_SPACES=B._pe.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES};
l.geog_to_mgrs_extended=function(k,y,u,C,q,w,x){B._pe.ensureCache.prepare();var I=0;k&&(I=B._pe.getPointer(k));k=v(u);u=B._pe.ensureFloat64(k);k=c(y,e.PE_MGRS_MAX);var A=B._pe.ensureInt32(k);if(C=B._pe._pe_geog_to_mgrs_extended(I,y,u,C,q,w,A))for(q=0;q<y;q++)x[q]=B._pe.UTF8ToString(k[q]);return C};l.mgrs_to_geog_extended=function(k,y,u,C,q){B._pe.ensureCache.prepare();var w=0;k&&(w=B._pe.getPointer(k));k=u.map(function(x){return B._pe.ensureString(x)});u=B._pe.ensureInt32(k);k=B._pe.ensureFloat64(Array(2*
y));(C=B._pe._pe_mgrs_to_geog_extended(w,y,u,C,k))&&p(q,y,k);return C}})(a=B.PeNotationMgrs||(B.PeNotationMgrs={}));(function(l){l.geog_to_usng=function(k,y,u,C,q,w,x){B._pe.ensureCache.prepare();var I=0;k&&(I=B._pe.getPointer(k));k=v(u);u=B._pe.ensureFloat64(k);k=c(y,e.PE_MGRS_MAX);var A=B._pe.ensureInt32(k);if(C=B._pe._pe_geog_to_usng(I,y,u,C,q,w,A))for(q=0;q<y;q++)x[q]=B._pe.UTF8ToString(k[q]);return C};l.usng_to_geog=function(k,y,u,C){B._pe.ensureCache.prepare();var q=0;k&&(q=B._pe.getPointer(k));
k=u.map(function(w){return B._pe.ensureString(w)});u=B._pe.ensureInt32(k);k=B._pe.ensureFloat64(Array(2*y));(q=B._pe._pe_usng_to_geog(q,y,u,k))&&p(C,y,k);return q}})(B.PeNotationUsng||(B.PeNotationUsng={}));var m;(function(l){l.init=function(){l.PE_UTM_OPTS_NONE=B._pe.PeNotationUtm.prototype.PE_UTM_OPTS_NONE;l.PE_UTM_OPTS_ADD_SPACES=B._pe.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES;l.PE_UTM_OPTS_NS=B._pe.PeNotationUtm.prototype.PE_UTM_OPTS_NS};l.geog_to_utm=function(k,y,u,C,q){B._pe.ensureCache.prepare();
var w=0;k&&(w=B._pe.getPointer(k));k=v(u);u=B._pe.ensureFloat64(k);k=c(y,e.PE_UTM_MAX);var x=B._pe.ensureInt32(k);if(C=B._pe._pe_geog_to_utm(w,y,u,C,x))for(w=0;w<y;w++)q[w]=B._pe.UTF8ToString(k[w]);return C};l.utm_to_geog=function(k,y,u,C,q){B._pe.ensureCache.prepare();var w=0;k&&(w=B._pe.getPointer(k));k=u.map(function(x){return B._pe.ensureString(x)});u=B._pe.ensureInt32(k);k=B._pe.ensureFloat64(Array(2*y));(C=B._pe._pe_utm_to_geog(w,y,u,C,k))&&p(q,y,k);return C}})(m=B.PeNotationUtm||(B.PeNotationUtm=
{}));var n;(function(l){var k=new Map;l.init=function(){l.PE_PCSINFO_OPTION_NONE=B._pe.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE;l.PE_PCSINFO_OPTION_DOMAIN=B._pe.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN;l.PE_POLE_OUTSIDE_BOUNDARY=B._pe.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY;l.PE_POLE_POINT=B._pe.PePCSInfo.prototype.PE_POLE_POINT};l.generate=function(y,u){void 0===u&&(u=l.PE_PCSINFO_OPTION_DOMAIN);var C;if(k.has(y)){var q=k.get(y);q[u]&&(C=q[u])}C||(C=B._pe.PePCSInfo.prototype.generate(y,
u),q||(q=[],k.set(y,q)),q[u]=C);return C}})(n=B.PePCSInfo||(B.PePCSInfo={}));(function(l){l.version_string=function(){return B._pe.PeVersion.prototype.version_string()}})(B.PeVersion||(B.PeVersion={}));B._init=h})},"esri/core/tsSupport/extendsHelper":function(){define([],function(){return function(){var O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,F){B.__proto__=F}||function(B,F){for(var E in F)F.hasOwnProperty(E)&&(B[E]=F[E])};return function(B,F){function E(){this.constructor=
B}O(B,F);B.prototype=null===F?Object.create(F):(E.prototype=F.prototype,new E)}}()})},"widgets/SmartEditor/coordinateUtils":function(){define("dojo/_base/lang dojo/Deferred esri/geometry/webMercatorUtils esri/SpatialReference esri/geometry/coordinateFormatter esri/geometry/Point".split(" "),function(O,B,F,E,f,h){var r={};f.load();r.getProjectedGeometry=function(c,v,p){var g=new B;if(F.canProject(c,v)){var e=F.project(c,v);g.resolve(e)}else p.project([c],v,function(b){e=b[0];g.resolve(e)},function(){g.reject(null)});
return g.promise};r.getMapCoordinates=function(c){switch(c.type){case "polygon":var v=c.getCentroid();break;case "polyline":v=c.getPoint(0,0);break;case "point":v=c}return v};r.getCoordinatesData=function(c,v){var p={};var g=new B;var e=new E(4326);p.MapSpatialReference=r.getMapCoordinates(c);r.getProjectedGeometry(p.MapSpatialReference,e,v).then(O.hitch(this,function(b){p.LatLong=b;this._getMGRSCoordinatesData(g,p)}),O.hitch(this,function(){p.LatLong={x:"",y:""};p.MGRS={MGRS:""};g.resolve(p)}));
return g.promise};r._getMGRSCoordinatesData=function(c,v){var p="";p=new h(v.LatLong.x,v.LatLong.y,new E({wkid:4326}));p=f.toMgrs(p,"automatic",5);v.MGRS={MGRS:p};c.resolve(v)};r.getCoordinatesDataWhenXYEmpty=function(c){var v={},p=new B;v.MapSpatialReference={x:"",y:""};v.LatLong=c;this._getMGRSCoordinatesData(p,v);return p.promise};return r})},"widgets/SmartEditor/addressUtils":function(){define("dojo/_base/declare dojo/_base/lang dojo/Deferred esri/request jimu/portalUtils jimu/dijit/Message dijit/_WidgetBase".split(" "),
function(O,B,F,E,f,h,r){return O([r],{_initialLoad:!0,postCreate:function(){},locateAddress:function(c){var v=new F;if(this.canGeocode){var p={};p={f:"json",location:JSON.stringify(c),distance:100,outSR:JSON.stringify(c.spatialReference),forStorage:!0};this.userToken&&(p.token=this.userToken);E({url:this.config.geocoderSettings.url+"/reverseGeocode",content:p,callbackParamName:"callback"}).then(B.hitch(this,function(g){this._initialLoad=!1;g&&g.address&&(g=g.address);v&&v.resolve(g)}),B.hitch(this,
function(){this._initialLoad&&(this._initialLoad=!1,new h({message:this.nls.unableToUseLocator}));v.resolve({})}))}else v.resolve({});return v.promise}})})},"widgets/SmartEditor/Intersection":function(){define("dojo/_base/declare dojo/_base/lang dojo/Deferred jimu/BaseWidgetSetting esri/tasks/query esri/tasks/QueryTask esri/geometry/Extent esri/geometry/geometryEngine esri/SpatialReference esri/geometry/webMercatorUtils dojo/_base/array".split(" "),function(O,B,F,E,f,h,r,c,v,p,g){return O([E],{baseClass:"jimu-widget-smartEditor-widgets-intersection",
layerFieldsObj:{},queriedLayers:[],layersInvolvedInIgnoreLayerRanking:[],maxToleranceForlayer:{},maxToleranceForlayerInPx:{},completeFeatures:{},postCreate:function(){this.startup();this.layerFieldsObj={};this.queriedLayers=[];this.maxToleranceForlayer={};this.maxToleranceForlayerInPx={};this.layersInvolvedInIgnoreLayerRanking=[];this.completeFeatures=[]},startup:function(){},_canGetGeodesicBuffers:function(e){var b=new v(4326);return e&&p.canProject(e,b)?!0:!1},_getbufferedGeometry:function(e,b){return(e=
this._canGetGeodesicBuffers(e)?c.geodesicBuffer([e],[b],"meters",!0):c.buffer([e],[b],"meters",!0))&&0<e.length?e[0]:null},getToleranceValueInMeters:function(e){var b=0;e&&(e.useDefault?(b=this.defaultToleranceSettings.value,e=this.defaultToleranceSettings.unit):(b=e.value,e=e.unit),b=this.convertToMeters(b,e));return b},setMaxToleranceForLayer:function(e,b){var a=this.getToleranceValueInMeters(b);if(b&&"px"===b.unit&&!b.useDefault){if(b=b.value,!this.maxToleranceForlayerInPx.hasOwnProperty(e)||this.maxToleranceForlayerInPx[e]<
b)this.maxToleranceForlayerInPx[e]=b}else 0<a&&(!this.maxToleranceForlayer.hasOwnProperty(e)||this.maxToleranceForlayer[e]<a)?this.maxToleranceForlayer[e]=a:0===a&&(b=this.defaultPixelsTolerance,!this.maxToleranceForlayerInPx.hasOwnProperty(e)||this.maxToleranceForlayerInPx[e]<b)&&(this.maxToleranceForlayerInPx[e]=b)},convertToMeters:function(e,b){var a=e;switch(b){case "meters":a=e;break;case "feet":a=.3048*e;break;case "kilometers":a=1E3*e;break;case "miles":a=1609.34*e}return a},getDistinctLayers:function(e,
b){var a=new F;var m=new F;var n={};this.layerFieldsObj={};this.queriedLayers=[];this.ignoreLayerRanking=!1;this.drawnGeometry=b;if(e.fieldValues){for(var l in e.fieldValues){n[l]=[];for(var k=0;k<e.fieldValues[l].length;k++){var y=e.fieldValues[l][k];if("Intersection"===y.actionName&&y.enabled){y.ignoreLayerRanking&&(this.ignoreLayerRanking=!0);for(var u=0;u<y.fields.length;u++){var C=y.fields[u];-1===n[l].indexOf(C.layerId)&&n[l].push(C.layerId);-1===this.layersInvolvedInIgnoreLayerRanking.indexOf(C.layerId)&&
y.ignoreLayerRanking&&this.layersInvolvedInIgnoreLayerRanking.push(C.layerId);this.setMaxToleranceForLayer(C.layerId,C.toleranceSettings)}}}}this._getIntersectionsForEachField(n,b,m)}else m.resolve({});m.then(B.hitch(this,function(){var q={},w;if(e.fieldValues)for(var x in e.fieldValues){q[x]={};for(var I=0;I<e.fieldValues[x].length;I++){var A=e.fieldValues[x][I];if("Intersection"===A.actionName&&A.enabled)if(A.ignoreLayerRanking){var M=this._getClosestFeature(A.fields);q[x]=M.attr;for(var H={},U=
0;U<A.fields.length;U++){var S=A.fields[U];H.hasOwnProperty(S.layerId)||(H[S.layerId]=[]);-1===H[S.layerId].indexOf(S.field)&&H[S.layerId].push(S.field)}if(M.intersectingFeatures&&1<M.intersectingFeatures.length){var D=[];g.forEach(M.intersectingFeatures,function(J){for(var P=H[J.layerId],R=0;R<P.length;R++)if(J.attributes&&J.attributes.hasOwnProperty(P[R])){var Y=J.attributes[P[R]];null!==Y&&""!==Y&&0>D.indexOf(Y)&&D.push(Y)}});1<D.length&&(w||(w={}),w[x]=D)}}else for(S=0;S<A.fields.length;S++){var L=
A.fields[S];U=L.layerId;if(!q[x].hasOwnProperty(U)&&(M=this._getProcessedFeature(U,L.toleranceSettings))&&M.attributes){A=M.attributes;S={};S[L.field]=A[L.field];q[x][U]=S;M.intersectingFeatures&&1<M.intersectingFeatures.length&&"esriCTUseLayerName"!==L.field&&(D=[],g.forEach(M.intersectingFeatures,function(J){J=J.attributes[L.field];null!==J&&""!==J&&0>D.indexOf(J)&&D.push(J)}),1<D.length&&(w||(w={}),w[x]=D));break}}}}a.resolve({result:q,multipleValues:w})}));return a.promise},_getIntersectingFeatures:function(e,
b){var a,m;var n=[];var l=0;if(m=this._jimuLayerInfos.getLayerOrTableInfoById(e))var k=m.layerObject;else return n;if(this.completeFeatures.hasOwnProperty(e)&&(m=this.completeFeatures[e],b&&"px"!==b.unit&&(l=this.getToleranceValueInMeters(b)),0<m.length&&(l?a=this._getbufferedGeometry(this.drawnGeometry,l):this.maxToleranceForlayer.hasOwnProperty(e)&&this.maxToleranceForlayer[e]||this.maxToleranceForlayerInPx.hasOwnProperty(e)&&this.maxToleranceForlayerInPx[e]?a="point"===this.drawnGeometry.type?
this.maxToleranceForlayerInPx.hasOwnProperty(e)?this.pointToExtent(this.map,this.drawnGeometry,this.maxToleranceForlayerInPx[e]):this.pointToExtent(this.map,this.drawnGeometry,this.defaultPixelsTolerance):this.drawnGeometry:n=m,a)))for(e=0;e<m.length;e++)b=m[e],b.geometry&&c.intersects(a,b.geometry)&&(b.attributes.esriCTUseLayerName=k.name,n.push(b));return n},_getClosestFeature:function(e){var b,a,m=[];var n={};e=this._resetFieldsWithMapLayerOrder(e);for(b=0;b<e.length;b++){var l=[];var k=e[b].layerId;
l=this._getIntersectingFeatures(k,e[b].toleranceSettings);for(a=0;a<l.length;a++)this.drawnGeometry&&l[a].geometry&&(l[a].distanceToLocation=c.distance(this.drawnGeometry,l[a].geometry,"meters")),l[a].layerId=k,l[a].fields?l[a].fields.push(e[b].field):l[a].fields=[e[b].field];m=m.concat(l)}if(0<m.length){m.sort(function(C,q){return C.distanceToLocation<q.distanceToLocation?-1:C.distanceToLocation>q.distanceToLocation?1:0});var y=m[0].attributes;e=this._jimuLayerInfos.getLayerOrTableInfoById(m[0].layerId).layerObject;
y.esriCTUseLayerName=e.name;var u={};g.forEach(m[0].fields,function(C){u[C]=y[C]});n[m[0].layerId]=u}return{attr:n,intersectingFeatures:m}},_resetFieldsWithMapLayerOrder:function(e){var b=[];var a=this._jimuLayerInfos.getLayerInfoArray();g.forEach(a,B.hitch(this,function(m){g.forEach(e,B.hitch(this,function(n){m.id===n.layerId&&b.push(n)}))}));return b},_getProcessedFeature:function(e,b){var a=[];a=this._getIntersectingFeatures(e,b);if(0<a.length){var m=a[0].attributes;e=this._jimuLayerInfos.getLayerOrTableInfoById(e).layerObject;
m.esriCTUseLayerName=e.name}return{attributes:m,intersectingFeatures:a}},_getIntersectionsForEachField:function(e,b,a){var m=Object.keys(e);var n=0;this.maxToleranceForlayer&&(n=Object.keys(this.maxToleranceForlayer).length);if(0<m.length){var l=m[0];(this.ignoreLayerRanking||0<n?this._asyncIntersectionRequests(e[l],b):this._syncIntersectionRequests(e[l],b)).then(B.hitch(this,function(){this.ignoreLayerRanking||0<n?e[l]&&0===e[l].length&&delete e[l]:delete e[l];this._getIntersectionsForEachField(e,
b,a)}))}else a.resolve()},_filterQueriedLayers:function(e){for(var b in this.layerFieldsObj){var a=e.indexOf(b);-1<a&&e.splice(a,1)}return e},_asyncIntersectionRequests:function(e,b,a){a||(a=new F);e=this._filterQueriedLayers(e);0<e.length?this._getIntersectedFeatures(e[0],b).then(B.hitch(this,function(m){e.splice(0,1);0<e.length?(this._asyncIntersectionRequests(e,b,a),this._intersectionResult(m)):this._intersectionResult(m,a)})):a.resolve();return a.promise},_syncIntersectionRequests:function(e,
b,a){a||(a=new F);e=this._filterQueriedLayers(e);0<e.length?this._getIntersectedFeatures(e[0],b).then(B.hitch(this,function(m){0<m.features.length?this._intersectionResult(m,a):(e.splice(0,1),0<e.length?this._syncIntersectionRequests(e,b,a):this._intersectionResult(m,a))})):a.resolve();return a.promise},_intersectionResult:function(e,b){e.layerId&&(this.layerFieldsObj[e.layerId]={},e.features&&0<e.features.length&&(this.layerFieldsObj[e.layerId]=e.featuresAttributes));b&&b.resolve()},pointToExtent:function(e,
b,a){if(0===a)return b;var m=e.extent.getWidth()/e.width;a*=m;return new r(b.x-a,b.y-a,b.x+a,b.y+a,e.spatialReference)},_getAppropriateGeometryForQuery:function(e,b){if(this.maxToleranceForlayer.hasOwnProperty(e))var a=this._getbufferedGeometry(b,this.maxToleranceForlayer[e]);else a=b,"point"===b.type&&(a=this.maxToleranceForlayerInPx.hasOwnProperty(e)?this.pointToExtent(this.map,b,this.maxToleranceForlayerInPx[e]):this.pointToExtent(this.map,b,this.defaultPixelsTolerance));return a},_getIntersectedFeatures:function(e,
b){var a;var m=new F;if(this._jimuLayerInfos.getLayerOrTableInfoById(e)){var n=this._jimuLayerInfos.getLayerOrTableInfoById(e);var l=this._jimuLayerInfos.getLayerOrTableInfoById(e).layerObject}else return m.resolve({layerId:e,features:[],featuresAttributes:{}}),m.promise;var k=l.objectIdField||null;var y=new f;var u=new h(l.url);y.geometry=this._getAppropriateGeometryForQuery(e,b);y.outFields=["*"];if(n=n&&(n.subId||0===n.subId)&&n.parentLayerInfo&&n.parentLayerInfo.layerObject?this._getSubLayerDefinitionExpression(n.subId,
n.parentLayerInfo):l&&l.getDefinitionExpression?l.getDefinitionExpression():"")y.where=n;-1<this.layersInvolvedInIgnoreLayerRanking.indexOf(e)||this.maxToleranceForlayer.hasOwnProperty(e)||this.maxToleranceForlayerInPx.hasOwnProperty(e)?(y.returnGeometry=!0,y.outSpatialReference=new v(b.spatialReference.toJson())):y.returnGeometry=!1;u.execute(y,B.hitch(this,function(C){C&&C.features&&0<C.features.length?(k&&C.features.sort(function(q,w){q=parseInt(q.attributes[k],10);w=parseInt(w.attributes[k],10);
return q>w?-1:1}),a=C.features[0].attributes):(C={features:[]},a={});this.completeFeatures[e]=C.features;m.resolve({layerId:e,features:C.features,featuresAttributes:a})}),B.hitch(this,function(){this.completeFeatures[e]=[];m.resolve({layerId:e,features:[],featuresAttributes:{}})}));return m.promise},_getSubLayerDefinitionExpression:function(e,b){return b&&b.layerObject&&b.layerObject.layerDefinitions?b.layerObject.layerDefinitions[e]:b.parentLayerInfo?this._getSubLayerDefinitionExpression(e,b.parentLayerInfo):
""}})})},"esri/dijit/LocateButton":function(){define("require dojo/Evented dojo/_base/declare dojo/_base/lang dojo/has ../kernel ../config dijit/_WidgetBase dijit/a11yclick dijit/_TemplatedMixin dojo/on dojo/Deferred dojo/text!./templates/LocateButton.html dojo/i18n!../nls/jsapi dojo/dom-class dojo/dom-style dojo/dom-attr ../geometry/webMercatorUtils ../geometry/Point ../SpatialReference ../graphic ../symbols/PictureMarkerSymbol ../tasks/ProjectParameters".split(" "),function(O,B,F,E,f,h,r,c,v,p,
g,e,b,a,m,n,l,k,y,u,C,q,w){O=F("esri.dijit.LocateButton",[c,p,B],{templateString:b,options:{theme:"LocateButton",map:null,visible:!0,highlightLocation:!0,symbol:new q(O.toUrl("./images/sdk_gps_location.png"),28,28),infoTemplate:null,scale:null,useTracking:!1,clearOnTrackingStop:!1,setScale:!0,centerAt:!0,timeout:15E3,graphicsLayer:null,geolocationOptions:{maximumAge:0,timeout:15E3,enableHighAccuracy:!0}},constructor:function(x,I){x=E.mixin({},this.options,x);this.domNode=I;this._i18n=a;I=navigator.geolocation;
var A=window.hasOwnProperty("isSecureContext");A=A&&window.isSecureContext||!A&&"https:"===window.location.protocol;A&&I||(x.visible=!1);I||console.log("LocateButton::navigator.geolocation unsupported.");A||console.log("LocateButton::navigator.geolocation requires a secure origin.");this.set("map",x.map);this.set("theme",x.theme);this.set("visible",x.visible);this.set("scale",x.scale);this.set("highlightLocation",x.highlightLocation);this.set("symbol",x.symbol);this.set("infoTemplate",x.infoTemplate);
this.set("geolocationOptions",x.geolocationOptions);this.set("useTracking",x.useTracking);this.set("setScale",x.setScale);this.set("centerAt",x.centerAt);this.set("timeout",x.timeout);this.set("graphicsLayer",x.graphicsLayer);this.set("clearOnTrackingStop",x.clearOnTrackingStop);this.watch("theme",this._updateThemeWatch);this.watch("visible",this._visible);this.watch("tracking",this._locate);this.watch("useTracking",E.hitch(this,function(){this.get("tracking")&&!this.get("useTracking")&&this._stopTracking();
this._setTitle()}));this._css={container:"locateContainer",locate:"zoomLocateButton",loading:"loading",tracking:"tracking"}},postCreate:function(){this.inherited(arguments);this.own(g(this._locateNode,v,E.hitch(this,this.locate)))},startup:function(){this.inherited(arguments);this.get("map")||(this.set("visible",!1),console.log("LocateButton::map required"));if(this.get("map").loaded)this._init();else g.once(this.get("map"),"load",E.hitch(this,function(){this._init()}))},destroy:function(){this.clear();
this._graphicsEvent&&this._graphicsEvent.remove();this._removeWatchPosition();this.inherited(arguments)},clear:function(){var x=this.get("highlightGraphic"),I=this.get("graphicsLayer");x&&(I?I.remove(x):this.get("map").graphics.remove(x),this.set("highlightGraphic",null))},locate:function(){this.get("useTracking")&&this.set("tracking",!this.get("tracking"));return this._locate()},show:function(){this.set("visible",!0)},hide:function(){this.set("visible",!1)},_setTitle:function(){this.get("useTracking")?
this.get("tracking")?l.set(this._locateNode,"title",this._i18n.widgets.locateButton.locate.stopTracking):l.set(this._locateNode,"title",this._i18n.widgets.locateButton.locate.tracking):l.set(this._locateNode,"title",this._i18n.widgets.locateButton.locate.title)},_removeWatchPosition:function(){this.get("watchId")&&(navigator.geolocation.clearWatch(this.get("watchId")),this.set("watchId",null));this._removePrivateVars()},_stopTracking:function(){m.remove(this._locateNode,this._css.tracking);this._removeWatchPosition();
this.get("clearOnTrackingStop")&&this.clear();this._hideLoading()},_positionToObject:function(x){return x?{coords:E.mixin({},x.coords),timestamp:x.timestamp}:{}},_startTracking:function(){m.add(this._locateNode,this._css.tracking);this._removeWatchPosition();var x=navigator.geolocation.watchPosition(E.hitch(this,function(I){I=this._positionToObject(I);this._setPosition(I).then(E.hitch(this,function(A){this._locateEvent(A)}),E.hitch(this,function(A){A||(A=Error("LocateButton::Error setting the position."));
this._locateError(A)}))}),E.hitch(this,function(I){this.set("tracking",!1);I||(I=Error("LocateButton::Could not get tracking position."));this._locateError(I)}),this.get("geolocationOptions"));this.set("watchId",x)},_removePrivateVars:function(){this._scale=this._position=this._graphic=null},_getCurrentPosition:function(){var x=new e;this._removePrivateVars();var I=setTimeout(E.hitch(this,function(){clearTimeout(I);x.reject(Error("LocateButton::time expired for getting location."))}),this.get("timeout"));
navigator.geolocation.getCurrentPosition(E.hitch(this,function(A){A=this._positionToObject(A);clearTimeout(I);this._setPosition(A).then(E.hitch(this,function(M){x.resolve(M)}),E.hitch(this,function(M){M||(M=Error("LocateButton::Error setting map position."));x.reject(M)}))}),E.hitch(this,function(A){A||(A=Error("LocateButton::Could not get current position."));x.reject(A)}),this.get("geolocationOptions"));return x.promise},_locate:function(){var x=new e;this._showLoading();if(navigator.geolocation)this.get("useTracking")?
this.get("tracking")?(this._startTracking(),x.resolve({tracking:!0})):(this._stopTracking(),x.resolve({tracking:!1})):this._getCurrentPosition().then(E.hitch(this,function(A){this._locateEvent(A);x.resolve(A)}),E.hitch(this,function(A){A||(A=Error("LocateButton::Could not get current position."));this._locateError(A);x.reject(A)}));else{var I=Error("LocateButton::geolocation unsupported");this._locateError(I);x.reject(I)}this._setTitle();return x.promise},_projectPoint:function(x){var I=new e,A=this.get("map").spatialReference,
M=A.wkid;A.isWebMercator()?(x=k.geographicToWebMercator(x),I.resolve(x)):r.defaults.geometryService&&4326!==M?(M=new w,M.geometries=[x],M.outSR=A,r.defaults.geometryService.project(M).then(E.hitch(this,function(H){H&&H.length?I.resolve(H[0]):I.reject(Error("LocateButton::Point was not projected."))}),function(H){H||(H=Error("LocateButton::please specify a geometry service on esri/config to project."));I.reject(H)})):I.resolve(x);return I.promise},_getScale:function(x){var I=this.get("scale");return x&&
x.coords?I||x.coords.accuracy||5E4:I||5E4},_createPoint:function(x){var I;x&&x.coords&&(I=new y([x.coords.longitude,x.coords.latitude],new u({wkid:4326})));return I},_setPosition:function(x){var I=new e,A,M;this._removePrivateVars();if((this._position=x)&&x.coords){if(A=this._createPoint(x))this._graphic=M=this._createGraphic(A,x);var H=this._getScale(x);this._scale=H;A?this._projectPoint(A).then(E.hitch(this,function(U){this._graphic=M=this._createGraphic(U,x);var S={graphic:M,scale:H,position:x};
this.get("setScale")&&this.get("map").setScale(H);this.get("centerAt")?this.get("map").centerAt(U).then(E.hitch(this,function(){I.resolve(S)}),E.hitch(this,function(D){D||(D=Error("LocateButton::Could not center map."));I.reject(D)})):I.resolve(S)}),E.hitch(this,function(U){U||(U=Error("LocateButton::Error projecting point."));I.reject(U)})):(A=Error("LocateButton::Invalid point"),I.reject(A))}else A=Error("LocateButton::Invalid position"),I.reject(A);return I.promise},_createGraphic:function(x,I){if(x){I=
{position:I};var A=new C(x,this.get("symbol"),I,this.get("infoTemplate"))}return A},_locateEvent:function(x){if(x.graphic){var I=this.get("highlightGraphic"),A=this.get("graphicsLayer");I?(I.setGeometry(x.graphic.geometry),I.setAttributes(x.graphic.attributes),I.setInfoTemplate(x.graphic.infoTemplate),I.setSymbol(x.graphic.symbol)):(I=x.graphic,this.get("highlightLocation")&&(A?A.add(I):this.get("map").graphics.add(I)));this.set("highlightGraphic",I)}this._hideLoading();this.emit("locate",x)},_locateError:function(x){x=
{graphic:this._graphic,scale:this._scale,position:this._position,error:x};this._hideLoading();this.emit("locate",x)},_showLoading:function(){this.get("useTracking")||m.add(this._locateNode,this._css.loading)},_hideLoading:function(){this.get("useTracking")||m.remove(this._locateNode,this._css.loading)},_init:function(){this._visible();this._setTitle();this.get("tracking")&&this.get("useTracking")&&this._locate();this.set("loaded",!0);this.emit("load",{})},_updateThemeWatch:function(x,I,A){m.remove(this.domNode,
I);m.add(this.domNode,A)},_visible:function(){this.get("visible")?n.set(this.domNode,"display","block"):n.set(this.domNode,"display","none")}});f("extend-esri")&&E.setObject("dijit.LocateButton",O,h);return O})},"jimu/dijit/FeatureSetChooserForMultipleLayers":function(){define("dojo/on dojo/sniff dojo/mouse dojo/query dojo/Evented dojo/_base/html dojo/_base/lang dojo/_base/array dojo/promise/all dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./templates/FeatureSetChooserForMultipleLayers.html dijit/popup dijit/TooltipDialog jimu/utils jimu/dijit/DrawBox jimu/dijit/_FeatureSetChooserCore jimu/SelectionManager jimu/dijit/FeatureActionPopupMenu".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y,u,C){return p([g,e,b,f],{baseClass:"jimu-multiple-layers-featureset-chooser",declaredClass:"jimu.dijit.FeatureSetChooserForMultipleLayers",templateString:a,drawBox:null,_instances:null,_tooltipDialogTimeoutId1:-1,_tooltipDialogClientX1:-1,_tooltipDialogTimeoutId2:-1,_tooltipDialogClientX2:-1,_tooltipTimeout:1E3,_currentGeoTypeInfo:null,_geoTypeInfos:null,map:null,updateSelection:!1,fullyWithin:!1,geoTypes:null,actions:null,postMixInProperties:function(){this.inherited(arguments);
this.nls=window.jimuNls.featureSetChooser;var q="POINT EXTENT POLYGON CIRCLE POLYLINE FREEHAND_POLYGON".split(" ");this.geoTypes&&0<this.geoTypes.length&&(this.geoTypes=c.filter(this.geoTypes,r.hitch(this,function(w){return 0<=q.indexOf(w)})));this.geoTypes&&0!==this.geoTypes.length||(this.geoTypes=["EXTENT"])},postCreate:function(){this.inherited(arguments);this._instances=[];this.popupMenu=C.getInstance();E(".select-text",this.domNode)[0].innerHTML=this.nls.select;E(".clear-text",this.domNode)[0].innerHTML=
window.jimuNls.common.clear;this._initTooltipDialogs();this._initDrawBox();this._geoTypeInfos=[];this.actions=[];0===this.geoTypes.length&&this.geoTypes.push("EXTENT");1===this.geoTypes.length?h.addClass(this.domNode,"single-geotype"):h.addClass(this.domNode,"multiple-geotypes");var q={POINT:["icon-select-by-point",this.nls.selectByPoint,this.drawBox.pointIcon],EXTENT:["icon-select-by-rect",this.nls.selectByRectangle,this.drawBox.extentIcon],POLYGON:["icon-select-by-polygon",this.nls.selectByPolygon,
this.drawBox.polygonIcon],CIRCLE:["icon-select-by-circle",this.nls.selectByCircle,this.drawBox.circleIcon],POLYLINE:["icon-select-by-line",this.nls.selectByLine,this.drawBox.polylineIcon],FREEHAND_POLYGON:["icon-select-by-freehand-polygon",this.nls.selectByFreehandPolygon,this.drawBox.freehandPolygonIcon]},w=-1;c.forEach("POINT EXTENT POLYGON CIRCLE POLYLINE FREEHAND_POLYGON".split(" "),r.hitch(this,function(x){var I=q[x];if(0<=this.geoTypes.indexOf(x)){var A={geoType:x,action:{iconClass:I[0],label:I[1],
data:{}},dom:I[2]};I={iconClass:I[0],label:I[1],data:{},onExecute:r.hitch(this,this._onDrawItemClicked,A)};this._geoTypeInfos.push(A);this.actions.push(I);"EXTENT"===x&&(w=this._geoTypeInfos.length-1)}}));this.own(O(this.btnSelect,"click",r.hitch(this,function(){l.simulateClickEvent(this._currentGeoTypeInfo.dom);this._hideDrawItems()})));0<=w?(this._setCurrentGeoInfo(this._geoTypeInfos[w]),h.addClass(this.geoTypeIcon,"icon-select-by-rect")):(this._setCurrentGeoInfo(this._geoTypeInfos[0]),h.addClass(this.geoTypeIcon,
this._geoTypeInfos[0].action.iconClass));this.deactivate()},_initTooltipDialogs:function(){var q=B("mac")?"\u2318":"Ctrl",w="- "+this.nls.newSelectionTip+" ("+this.nls.dragMouse+")",x="- "+this.nls.addSelectionTip+" (Shift+"+this.nls.dragBox+")",I="- "+this.nls.removeSelectionTip+" ("+q+"+"+this.nls.dragBox+")",A="- "+this.nls.newSelectionTip+" ("+this.nls.drawShap+")",M="- "+this.nls.addSelectionTip+" (Shift+"+this.nls.darw+")",H="- "+this.nls.removeSelectionTip+" ("+q+"+"+this.nls.darw+")";q=h.create("div",
{innerHTML:'\x3cdiv class\x3d"title"\x3e\x3c/div\x3e\x3cdiv class\x3d"item new-selection-item"\x3e\x3c/div\x3e\x3cdiv class\x3d"item add-selection-item"\x3e\x3c/div\x3e\x3cdiv class\x3d"item remove-selection-item"\x3e\x3c/div\x3e',"class":"dialog-content"});var U=E(".title",q)[0],S=E(".new-selection-item",q)[0],D=E(".add-selection-item",q)[0],L=E(".remove-selection-item",q)[0];this.tooltipDialog1=new n({content:q});h.addClass(this.tooltipDialog1.domNode,"jimu-multiple-layers-featureset-chooser-tooltipdialog");
this.own(O(this.btnSelect,"mousemove",r.hitch(this,function(J){this._tooltipDialogClientX1=J.clientX})));this.own(O(this.btnSelect,F.enter,r.hitch(this,function(){clearTimeout(this._tooltipDialogTimeoutId1);this._tooltipDialogTimeoutId1=-1;this._tooltipDialogTimeoutId1=setTimeout(r.hitch(this,function(){if(this.tooltipDialog1){var J=this._currentGeoTypeInfo.geoType;"EXTENT"===J?(S.innerHTML=w,D.innerHTML=x,L.innerHTML=I,U.innerHTML=this.nls.selectByRectangle):(S.innerHTML=A,D.innerHTML=M,L.innerHTML=
H,"POLYGON"===J?U.innerHTML=this.nls.selectByPolygon:"CIRCLE"===J?U.innerHTML=this.nls.selectByCircle:"POLYLINE"===J?U.innerHTML=this.nls.selectByLine:"FREEHAND_POLYGON"===J?U.innerHTML=this.nls.selectByFreehandPolygon:"POINT"===J&&(U.innerHTML=this.nls.selectByPoint));m.open({parent:this.getParent(),popup:this.tooltipDialog1,around:this.btnSelect,position:["below"]});0<=this._tooltipDialogClientX1&&(this.tooltipDialog1.domNode.parentNode.style.left=this._tooltipDialogClientX1+"px")}}),this._tooltipTimeout)})));
this.own(O(this.btnSelect,F.leave,r.hitch(this,function(){clearTimeout(this._tooltipDialogTimeoutId1);this._tooltipDialogTimeoutId1=-1;this._hideTooltipDialog(this.tooltipDialog1)})));q=h.create("div",{innerHTML:this.nls.unselectAllSelectionTip,"class":"dialog-content"});this.tooltipDialog2=new n({content:q});h.addClass(this.tooltipDialog2.domNode,"jimu-multiple-layers-featureset-chooser-tooltipdialog");this.own(O(this.btnClear,"mousemove",r.hitch(this,function(J){this._tooltipDialogClientX2=J.clientX})));
this.own(O(this.btnClear,F.enter,r.hitch(this,function(){clearTimeout(this._tooltipDialogTimeoutId2);this._tooltipDialogTimeoutId2=-1;this._tooltipDialogTimeoutId2=setTimeout(r.hitch(this,function(){this.tooltipDialog2&&(m.open({parent:this.getParent(),popup:this.tooltipDialog2,around:this.btnClear,position:["below"]}),0<=this._tooltipDialogClientX2&&(this.tooltipDialog2.domNode.parentNode.style.left=this._tooltipDialogClientX2+"px"))}),this._tooltipTimeout)})));this.own(O(this.btnClear,F.leave,r.hitch(this,
function(){clearTimeout(this._tooltipDialogTimeoutId2);this._tooltipDialogTimeoutId2=-1;this._hideTooltipDialog(this.tooltipDialog2)})))},_onArrowClicked:function(q){q.stopPropagation();q=h.position(q.target);this._showDrawItems(q)},_setCurrentGeoInfo:function(q){var w=this._currentGeoTypeInfo&&this._currentGeoTypeInfo.geoType;this._currentGeoTypeInfo&&h.removeClass(this.currentDrawItem,this._currentGeoTypeInfo.geoType);this._currentGeoTypeInfo=q;h.addClass(this.currentDrawItem,this._currentGeoTypeInfo.geoType);
this.isActive()?w!==this._currentGeoTypeInfo.geoType&&l.simulateClickEvent(this._currentGeoTypeInfo.dom):l.simulateClickEvent(this._currentGeoTypeInfo.dom)},_showDrawItems:function(q){this.popupMenu.setActions(this.actions);this.popupMenu.markAsSelected(this._currentGeoTypeInfo.action);this.popupMenu.show(q)},_hideDrawItems:function(){this.popupMenu.hide()},_onDrawItemClicked:function(q){this._hideDrawItems();this._setCurrentGeoInfo(q);h.removeClass(this.geoTypeIcon,"icon-select-by-point icon-select-by-circle icon-select-by-rect icon-select-by-polygon icon-select-by-line icon-select-by-freehand-polygon".split(" "));
switch(q.geoType){case "POLYGON":h.addClass(this.geoTypeIcon,"icon-select-by-polygon");break;case "CIRCLE":h.addClass(this.geoTypeIcon,"icon-select-by-circle");break;case "POLYLINE":h.addClass(this.geoTypeIcon,"icon-select-by-line");break;case "FREEHAND_POLYGON":h.addClass(this.geoTypeIcon,"icon-select-by-freehand-polygon");break;case "POINT":h.addClass(this.geoTypeIcon,"icon-select-by-point");break;default:h.addClass(this.geoTypeIcon,"icon-select-by-rect")}},_initDrawBox:function(){this.drawBox=
new k({map:this.map,showClear:!0,keepOneGraphic:!0,deactivateAfterDrawing:!1,geoTypes:this.geoTypes});this.own(O(this.drawBox,"user-clear",r.hitch(this,this._onDrawBoxUserClear)));this.own(O(this.drawBox,"draw-end",r.hitch(this,this._onDrawEnd)));this.own(O(this.drawBox,"draw-activate",r.hitch(this,function(){this.map.infoWindow.hide();h.addClass(this.currentDrawItem,"pressed");h.addClass(this.btnSelect,"selected")})));this.own(O(this.drawBox,"draw-deactivate",r.hitch(this,function(){h.removeClass(this.currentDrawItem,
"pressed");h.removeClass(this.btnSelect,"selected")})));this.own(O(this.btnClear,"click",r.hitch(this,function(){l.simulateClickEvent(this.drawBox.btnClear)})))},disable:function(){this.drawBox.disable();h.addClass(this.domNode,"disabled")},enable:function(){this.drawBox.enable();h.removeClass(this.domNode,"disabled")},isActive:function(){return this.drawBox.isActive()},activate:function(){if(!this.isActive()){var q=this._currentGeoTypeInfo;q||(q=this._geoTypeInfos[0]);this._setCurrentGeoInfo(q)}},
deactivate:function(){this.drawBox.deactivate()},setFeatureLayers:function(q){var w=c.filter(this._instances,r.hitch(this,function(I){return 0>q.indexOf(I.featureLayer)}));c.forEach(w,r.hitch(this,function(I){this._removeInstance(I)}));var x=c.map(this._instances,r.hitch(this,function(I){return I.featureLayer}));c.forEach(q,r.hitch(this,function(I){0>x.indexOf(I)&&this.addFeatureLayer(I)}))},addFeatureLayer:function(q){"esri.layers.FeatureLayer"!==q.declaredClass||this._findInstanceByLayer(q)||(q=
new y({map:this.map,featureLayer:q,drawBox:this.drawBox,updateSelection:this.updateSelection,fullyWithin:this.fullyWithin}),this._instances.push(q))},removeFeatureLayer:function(q){"esri.layers.FeatureLayer"===q.declaredClass&&(q=this._findInstanceByLayer(q))&&this._removeInstance(q)},setDisplayLayerVisibility:function(q,w){(q=u.getInstance().getDisplayLayer(q.id))&&(w?q.show():q.hide())},_removeInstance:function(q){if(q){var w=this._instances.indexOf(q);0<=w&&(q.destroy(),this._instances.splice(w,
1))}},_findInstanceByLayer:function(q){var w=null;c.some(this._instances,r.hitch(this,function(x){return x.featureLayer===q?(w=x,!0):!1}));return w},clear:function(q){c.forEach(this._instances,r.hitch(this,function(w){w.clear(q)}))},destroy:function(){this._hideTooltipDialog(this.tooltipDialog1);this._hideTooltipDialog(this.tooltipDialog2);c.forEach(this._instances,r.hitch(this,function(q){q.destroy()}));this._instances=[];this.drawBox&&this.drawBox.destroy();this.drawBox=null;this.inherited(arguments)},
_hideTooltipDialog:function(q){q&&m.close(q)},_onDrawBoxUserClear:function(){this.clear(!0);this.emit("user-clear")},_onDrawEnd:function(q,w,x,I,A,M){this.drawBox.clear();0<this._instances.length&&setTimeout(r.hitch(this,function(){if(0<this._instances.length){this.emit("loading");this.disable();var H=c.map(this._instances,r.hitch(this,function(U){return U.getFeatures()}));v(H).always(r.hitch(this,function(){this.enable();this._currentGeoTypeInfo&&l.simulateClickEvent(this._currentGeoTypeInfo.dom);
this.emit("unloading",q,w,x,I,A,M)}))}}),50)}})})},"jimu/dijit/_FeatureSetChooserCore":function(){define("dojo/on dojo/sniff dojo/Evented dojo/Deferred dojo/_base/lang dojo/_base/array dojo/_base/declare jimu/utils jimu/symbolUtils jimu/SelectionManager jimu/LayerInfos/LayerInfos esri/graphic esri/tasks/query esri/tasks/QueryTask esri/layers/FeatureLayer esri/symbols/jsonUtils esri/geometry/geometryEngine".split(" "),function(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l){return r([F],{baseClass:"jimu-featureset-chooser-core",
_middleFeatureLayer:null,_isLoading:!1,_def:null,_isDestroyed:!1,_handles:null,selectionManager:null,layerInfosObj:null,layerInfo:null,map:null,featureLayer:null,drawBox:null,updateSelection:!1,fullyWithin:!1,constructor:function(k){f.mixin(this,k);this.layerInfosObj=g.getInstanceSync();this.selectionManager=p.getInstance();this.featureLayer.getSelectionSymbol()||this.selectionManager.setSelectionSymbol(this.featureLayer);k=c.getFeatureLayerDefinition(this.featureLayer);delete k.id;this._middleFeatureLayer=
new m({layerDefinition:k,featureSet:null},{id:"featureLayer_"+c.getRandomString()});k=null;var y=this._middleFeatureLayer.geometryType;"esriGeometryPoint"===y?k=v.getDefaultMarkerSymbol():"esriGeometryPolyline"===y?k=v.getDefaultLineSymbol():"esriGeometryPolygon"===y&&(k=n.fromJson({style:"esriSFSSolid",color:[79,129,189,77],type:"esriSFS",outline:{style:"esriSLSSolid",color:[54,93,141,255],width:1.5,type:"esriSLS"}}));this._middleFeatureLayer.setSelectionSymbol(k);k=O(this.drawBox,"user-clear",f.hitch(this,
this._onDrawBoxUserClear));y=O(this.drawBox,"draw-end",f.hitch(this,this._onDrawEnd));this._handles=[k,y];if(this.layerInfo=this.layerInfosObj.getLayerInfoById(this.featureLayer.id))k=O(this.layerInfo,"filterChanged",f.hitch(this,this._handleFilterChange)),this._handles.push(k)},hideMiddleFeatureLayer:function(){if(this._middleFeatureLayer){this._middleFeatureLayer.hide();var k=this.selectionManager.getDisplayLayer(this._middleFeatureLayer.id);k&&k.hide()}},showMiddleFeatureLayer:function(){if(this._middleFeatureLayer){this._middleFeatureLayer.show();
var k=this.selectionManager.getDisplayLayer(this._middleFeatureLayer.id);k&&k.show()}},clear:function(k){this.drawBox.clear();this._clearMiddleFeatureLayer();k&&this.selectionManager.clearSelection(this.featureLayer)},getFeatures:function(){var k=new E,y=f.hitch(this,function(){var C=this.syncGetFeatures();k.resolve(C)}),u=f.hitch(this,function(C){k.reject(C)});1===this._getDeferredStatus(this._def)?this._def.then(y,u):y();return k},syncGetFeatures:function(){return(this.updateSelection?this.featureLayer:
this._middleFeatureLayer).getSelectedFeatures()},isLoading:function(){return 1===this._getDeferredStatus(this._def)},_onLoading:function(){this.drawBox.deactivate();this.emit("loading")},_onUnloading:function(){this.emit("unloading")},_getDeferredStatus:function(k){var y=0;return y=k?k.isResolved()?2:k.isRejected()?-1:1:0},_onDrawEnd:function(k,y,u,C,q,w){if(this.isLoading())throw"should not draw when loading";if(this.featureLayer.visible){var x=new E;this._def=x;var I=m.SELECTION_NEW;C&&(I=m.SELECTION_ADD);
B("mac")?w&&(I=m.SELECTION_SUBTRACT):q&&(I=m.SELECTION_SUBTRACT);this.emit("loading");this._getFeaturesByGeometry(k.geometry).then(f.hitch(this,function(A){this.selectionManager.updateSelectionByFeatures(this.updateSelection?this.featureLayer:this._middleFeatureLayer,A,I);this._onUnloading();x.resolve(A)}),f.hitch(this,function(A){console.error(A);this._onUnloading();x.reject(A)}))}},_addTolerance:function(k){var y=2.54*this.map.getScale()/9600;return l.buffer(k,10*y,"meters")},_getFeaturesByGeometry:function(k){"point"!==
k.type&&"polyline"!==k.type||"esriGeometryPoint"!==this.featureLayer.geometryType||(k=this._addTolerance(k));var y=new E,u=[];if(this.featureLayer.getMap()&&this.featureLayer.mode!==m.MODE_SELECTION)k=this.selectionManager.getClientFeaturesByGeometry(this.featureLayer,k,this.fullyWithin),0<k.length&&(u=h.map(k,f.hitch(this,function(q){return new e(q.toJson())}))),y.resolve(u);else{u=new b;u.geometry=k;u.outSpatialReference=this.map.spatialReference;u.returnGeometry=!0;u.spatialRelationship=this.fullyWithin?
b.SPATIAL_REL_CONTAINS:b.SPATIAL_REL_INTERSECTS;(k=this.featureLayer.getDefinitionExpression())||(k="1\x3d1");if(this.layerInfo){var C=this.layerInfo.getFilter();C&&(k="("+k+") AND ("+C+")")}k&&(u.where=k);u.outFields=["*"];(new a(this.featureLayer.url)).execute(u).then(f.hitch(this,function(q){y.resolve(q.features)}),f.hitch(this,function(q){y.reject(q)}))}return y},_onDrawBoxUserClear:function(){this.clear()},_clearMiddleFeatureLayer:function(){this._middleFeatureLayer&&(this._middleFeatureLayer.clear(),
this.selectionManager.clearSelection(this._middleFeatureLayer))},_handleFilterChange:function(){var k=this.layerInfo.getFilter()||"1\x3d1",y=this.featureLayer.getSelectedFeatures(),u=this.featureLayer.objectIdField;if(y&&0<y.length){var C=h.map(y,function(w){return w.attributes[u]}),q=new b;q.where=u+" in ("+C.join(",")+") AND "+k;(new a(this.featureLayer.url)).executeForIds(q).then(f.hitch(this,function(w){h.forEach(y,function(x){0<=w.indexOf(x.attributes[u])?x.show():x.hide()});this.selectionManager._isLayerNeedDisplayLayer(this.featureLayer)&&
this.selectionManager._updateDisplayLayer(this.featureLayer,y,m.SELECTION_NEW);this.featureLayer.emit("selection-complete",{features:this.featureLayer.getSelectedFeatures()})}),f.hitch(this,function(w){console.error(w)}))}},destroy:function(){this._isDestroyed||(h.forEach(this._handles,f.hitch(this,function(k){k.remove()})),this._handles=null,this.clear());this._isDestroyed=!0}})})},"widgets/SmartEditor/copy-features":function(){define("dijit/_WidgetBase dijit/_TemplatedMixin dojo/_base/declare dojo/Evented dojo/_base/lang dojo/_base/array dojo/dom-construct dojo/on dojo/query dojo/string dojo/keys jimu/dijit/CheckBox dojo/dom-class dojo/dom-attr ./highlightSymbolUtils esri/layers/GraphicsLayer dojo/text!./copy-features.html jimu/dijit/Message esri/tasks/query esri/tasks/QueryTask dojo/Deferred dojo/promise/all jimu/dijit/LoadingIndicator dijit/ProgressBar dojo/dom-style jimu/dijit/Popup ./fieldsMapping".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y,u,C,q,w,x,I,A,M){return F([O,E,B],{templateString:l,layerLabel:null,featuresList:null,checkBoxNodes:{},layerCheckBoxNodes:{},featuresByLayerId:{},featureTitlesByLayerId:{},highlightGraphicsLayer:null,allChildCheckboxes:[],loading:null,fieldsMappingObj:null,layerOrderSequence:[],startup:function(){this.inherited(arguments);this.highlightGraphicsLayer=this._createNewGraphicsLayer("highlightGraphicsLayer");this.loading=new w({hidden:!0});this.loading.placeAt(this.parentDomNode)},
postCreate:function(){this.checkBoxNodes={};this.layerCheckBoxNodes={};this.featuresByLayerId={};this.featureTitlesByLayerId={};this.fieldsMappingObj=this.highlightGraphicsLayer=null;this.layerOrderSequence=[];this.applyEditsProgress=new x(null,this.applyEditsProgressParentNode);I.set(this.applyEditsProgress.domNode,"display","none");this.own(c(this.cancelBtn,"click",f.hitch(this,function(){this.cancelBtnClicked()})));this.own(c(this.cancelBtn,"keydown",f.hitch(this,function(H){H.keyCode!==g.ENTER&&
H.keyCode!==g.SPACE||this.cancelBtnClicked()})));this.own(c(this.createMultipleFeaturesBtn,"click",f.hitch(this,this._createMultipleFeaturesBtnClicked)));this.own(c(this.createMultipleFeaturesBtn,"keydown",f.hitch(this,function(H){H.keyCode!==g.ENTER&&H.keyCode!==g.SPACE||this._createMultipleFeaturesBtnClicked()})));this.own(c(this.createSingleFeatureBtn,"click",f.hitch(this,this._createSingleFeatureBtnClicked)));this.own(c(this.createSingleFeatureBtn,"keydown",f.hitch(this,function(H){H.keyCode!==
g.ENTER&&H.keyCode!==g.SPACE||this._createSingleFeatureBtnClicked()})));this.own(c(this.fieldsMatchingBtn,"click",f.hitch(this,this._fieldMatchingBtnClicked)));this.own(c(this.fieldsMatchingBtn,"keydown",f.hitch(this,function(H){H.keyCode!==g.ENTER&&H.keyCode!==g.SPACE||this._fieldMatchingBtnClicked()})))},selectFeaturesToCopy:function(H,U){this.allChildCheckboxes=[];if(H&&0<H.length){this.checkBoxNodes={};this.layerCheckBoxNodes={};this.featuresByLayerId={};this.featureTitlesByLayerId={};this.targetLayerDetails=
U;var S=this.targetLayerDetails.featureLayer.geometryType;this._changeWarningNote(S);this._showHideSingleFeatureButton(S);this._showHideMultipleFeatureButton(S);b.remove(this.mainNode,"esriCTHidden");U=new C;this._processSelectedFeatures(H,U).then(f.hitch(this,function(){r.empty(this.layerListTable);h.forEach(this.layerInfosObj.getLayerInfoArray(),f.hitch(this,function(D){if(this.featureTitlesByLayerId.hasOwnProperty(D.id)){D=D.id;var L=this.layerInfosObj.getLayerInfoById(D);L=L.title?L.title:L.name;
var J=r.create("div",{},this.layerListTable);var P=r.create("div",{"class":"esriCTHidden"});r.place(P,J,"last");this.layerCheckBoxNodes[D]=this._createListNode(L,J,!1,D,S);this.checkBoxNodes[D]||(this.checkBoxNodes[D]=[]);0<this.featureTitlesByLayerId[D].length&&(this._createFeatureEntries(D,J,S,P),this.layerOrderSequence.push(this.featureTitlesByLayerId[D].length));return!0}}));this._canExpandFirstLayerNode()&&v(".esriCTExpandCollapseNode",this.domNode)[0].click();this._highlightFeatures();this.updateSingleFeatureButtonText()}))}},
_canExpandFirstLayerNode:function(){var H=!1,U=[];U=Object.keys(this.layerCheckBoxNodes);this.layerCheckBoxNodes&&1===U.length?H=!0:1<U.length&&this.layerOrderSequence&&this.layerOrderSequence[0]&&10>=this.layerOrderSequence[0]&&(H=!0);return H},_processSelectedFeatures:function(H,U){var S={},D,L;this.featuresByLayerId={};this.featureTitlesByLayerId={};h.forEach(H,f.hitch(this,function(J){this.featuresByLayerId[J._layer.id]||(this.featuresByLayerId[J._layer.id]=[],this.featureTitlesByLayerId[J._layer.id]=
[]);this.featuresByLayerId[J._layer.id].push(J);var P=this.layerInfosObj.getLayerInfoById(J._layer.id).layerObject.objectIdField;P=J.getTitle()?J.getTitle():J.attributes[P];this.featureTitlesByLayerId[J._layer.id].push(P)}));this.loading.show();for(L in this.featuresByLayerId)L&&(H=this._getObjectIdFieldOfLayer(L),H=this._getSelectedFeatureObjectIds(this.featuresByLayerId[L],H),S[L]=this._getFeatureByChunks(L,H));q(S).then(f.hitch(this,function(J){for(D in J)D&&this._updateGeometryForSelectedFeature(D,
J);this._highlightFeatures();setTimeout(f.hitch(this,function(){this.loading.hide()}),1E3)}),f.hitch(this,function(){this.loading.hide();k({message:this.nls.copyFeatures.copyFeatureUpdateGeometryError})}));return U.resolve(null)},_getObjectIdFieldOfLayer:function(H){return this.layerInfosObj.getLayerInfoById(H).layerObject.objectIdField},_updateGeometryForSelectedFeature:function(H,U){var S=this._getObjectIdFieldOfLayer(H);h.forEach(this.featuresByLayerId[H],f.hitch(this,function(D){h.some(U[H],f.hitch(this,
function(L){if(L.attributes[S]===D.attributes[S])return D.geometry=L.geometry,!0}))}))},_getSelectedFeatureObjectIds:function(H,U){var S=[];h.forEach(H,f.hitch(this,function(D){S.push(D.attributes[U])}));return S},_getFeatureByChunks:function(H,U){var S=this.layerInfosObj.getLayerInfoById(H);var D=new C;var L=[];for(S=null===S.layerObject.url||""===S.layerObject.url?U.length:S.layerObject.maxRecordCount||999;0<U.length;)L.push(this._getSelectedFeatureGeometry(H,U.splice(0,S)));q(L).then(f.hitch(this,
function(J){var P=[];h.forEach(J,f.hitch(this,function(R){P=P.concat(R.features)}));D.resolve(P)}));return D.promise},_getSelectedFeatureGeometry:function(H,U){var S=this.layerInfosObj.getLayerInfoById(H);H=new u(S.getUrl());var D=new y;D.outFields=[S.layerObject.objectIdField];D.objectIds=U;D.returnGeometry=!0;D.outSpatialReference=this.map.spatialReference;return(null===S.layerObject.url||""===S.layerObject.url?S.layerObject.queryFeatures(D):H.execute(D)).promise},_createFeatureEntries:function(H,
U,S,D){h.forEach(this.featureTitlesByLayerId[H],f.hitch(this,function(L){L=this._createListNode(L,U,!0,H,S,D);this.checkBoxNodes[H].push(L);this.allChildCheckboxes.push(L)}))},_createListNode:function(H,U,S,D,L,J){var P=r.create("div",{"class":"jimu-widget-row esriCTCopyFeaturesNode"});var R=r.create("div",{"class":"jimu-float-leading checkBoxNode",style:"width: calc(100% - 20px)"},P);L="esriGeometryPoint"===L&&this.hideMultipleFeatureButton?!1:!0;R=new e({label:H,checked:L},R);a.set(R.domNode,"layerName",
H);S?(b.add(P,"esriCTCopyFeaturesChildNode"),a.set(R.domNode,"parentLayerId",D),c(R.domNode,"click",f.hitch(this,this._childNodeStateChanged)),a.set(J,"expandLayerId",D),r.place(P,J)):(this._updateParentCheckBoxLabel(R,H,this.featureTitlesByLayerId[D].length,D),S=r.create("div",{"class":"esriCTExpandCollapseNode collapsed",tabindex:"0",role:"button","aria-label":H,"aria-expanded":"false"}),r.place(S,P,"first"),a.set(R.domNode,"layerId",D),a.set(R.domNode,"layerName",H),a.set(S,"layerId",D),L||(this._updateParentCheckBoxLabel(R,
H,0,D),R.setStatus(!1)),c(R.domNode,"click",f.hitch(this,this._parentNodeStateChanged)),r.place(P,U,"first"),this.own(c(S,"click",f.hitch(this,function(Y){this._expandButtonClicked(Y)}))),this.own(c(S,"keydown",f.hitch(this,function(Y){Y.keyCode!==g.ENTER&&Y.keyCode!==g.SPACE||this._expandButtonClicked(Y)}))));return R},_expandButtonClicked:function(H){var U=a.get(H.currentTarget,"layerId");if(U=v("[expandLayerId\x3d"+U+"]",this.domNode)[0])b.contains(H.currentTarget,"expanded")?(b.replace(H.currentTarget,
"collapsed","expanded"),a.set(H.currentTarget,"aria-expanded","false"),b.add(U,"esriCTHidden")):(b.replace(H.currentTarget,"expanded","collapsed"),a.set(H.currentTarget,"aria-expanded","true"),b.remove(U,"esriCTHidden"))},_parentNodeStateChanged:function(H){H=a.get(H.currentTarget,"layerId");var U=this.layerCheckBoxNodes[H],S=a.get(U.domNode,"layerName");if(U.getStatus()){var D=this.checkBoxNodes[H],L=U.getValue();h.forEach(D,f.hitch(this,function(J){L?J.setValue(!0):J.setValue(!1)}));L?this._updateParentCheckBoxLabel(U,
S,this.featureTitlesByLayerId[H].length,H):this._updateParentCheckBoxLabel(U,S,0,H);this._highlightFeatures()}this.updateSingleFeatureButtonText()},_childNodeStateChanged:function(H){var U=a.get(H.currentTarget,"parentLayerId"),S=a.get(this.layerCheckBoxNodes[U].domNode,"layerName"),D=this.layerCheckBoxNodes[U],L=this.checkBoxNodes[U],J=!1;D.getStatus()||h.forEach(this.allChildCheckboxes,f.hitch(this,function(P){P.getValue()&&P.domNode!==H.currentTarget&&(P.setValue(!1),P=a.get(P.domNode,"parentLayerId"),
this._updateParentCheckBoxLabel(this.layerCheckBoxNodes[P],a.get(this.layerCheckBoxNodes[P].domNode,"layerName"),0,P))}));this._highlightFeatures();h.some(L,f.hitch(this,function(P){if(P.getValue())return J=!0}));D.setValue(J,!1);this.updateSingleFeatureButtonText();L=this.checkBoxNodes[U].filter(f.hitch(this,function(P){return!0===P.checked}));this._updateParentCheckBoxLabel(D,S,L.length,U)},_updateParentCheckBoxLabel:function(H,U,S,D){H.setLabel(p.substitute(this.nls.copyFeatures.layerLabel,{layerName:U,
selectedFeatures:S,totalFeatures:this.featureTitlesByLayerId[D].length}));a.set(H.domNode,"aria-label",p.substitute(this.nls.copyFeatures.layerAriaLabel,{layerName:U,selectedFeatures:S,totalFeatures:this.featureTitlesByLayerId[D].length}))},updateSingleFeatureButtonText:function(){var H=0;h.some(this.allChildCheckboxes,f.hitch(this,function(U){U.getValue()&&H++;if(1<H)return!0}));1===H||1===this.allChildCheckboxes.length?(a.set(this.createSingleFeatureBtn,"innerHTML",this.nls.copyFeatures.createOneSingleFeature),
a.set(this.createSingleFeatureBtn,"aria-label",this.nls.copyFeatures.createOneSingleFeature),a.set(this.createSingleFeatureBtn,"title",this.nls.copyFeatures.createOneSingleFeature),b.add(this.createMultipleFeaturesBtn,"esriCTCanCreateOnlyOneFeature"),"esriGeometryPoint"===this.targetLayerDetails.featureLayer.geometryType&&b.remove(this.createSingleFeatureBtn,"esriCTHidden")):(a.set(this.createSingleFeatureBtn,"innerHTML",this.nls.copyFeatures.createSingleFeature),a.set(this.createSingleFeatureBtn,
"aria-label",this.nls.copyFeatures.createSingleFeature),a.set(this.createSingleFeatureBtn,"title",this.nls.copyFeatures.createSingleFeature),b.remove(this.createMultipleFeaturesBtn,"esriCTCanCreateOnlyOneFeature"),"esriGeometryPoint"===this.targetLayerDetails.featureLayer.geometryType&&b.add(this.createSingleFeatureBtn,"esriCTHidden"))},cancelBtnClicked:function(){b.add(this.mainNode,"esriCTHidden");this.highlightGraphicsLayer.clear();this.emit("cancelBtnClicked")},_createMultipleFeaturesBtnClicked:function(){var H=
[],U;(U=this._getSelectedFeaturesForCopy())&&0<U.length&&(h.forEach(U,f.hitch(this,function(S){S&&S.geometry&&H.push(S)})),this.emit("createMultipleFeatures",H))},_createSingleFeatureBtnClicked:function(){var H;(H=this._getSelectedFeaturesForCopy())&&0<H.length&&this.emit("createSingleFeature",H)},_fieldMatchingBtnClicked:function(){var H=[],U={id:this.targetLayerDetails.featureLayer.id,fields:this.targetLayerDetails.fieldInfos,fieldValues:this.targetLayerDetails.fieldValues};h.forEach(this.layerInfosObj.getLayerInfoArray(),
f.hitch(this,function(S){if(this.featuresByLayerId.hasOwnProperty(S.id)){var D=S.id;var L=this.layerInfosObj.getLayerInfoById(D);S=this.editUtils.getFieldInfosFromWebmap(L)||L.layerObject.fields;L&&L.layerObject&&S&&(L=L.title?L.title:L.name,H.push({id:D,fields:S,name:L}))}}));this.fieldsMappingObj=new M({nls:this.nls,sourceLayerDetails:H,targetLayerDetails:U,fieldMappingDetails:this.fieldMappingDetails,usePresetValues:this.usePresetValues,overrideDefaultsByCopiedFeature:this.config.editor.overrideDefaultsByCopiedFeature});
this.own(c(this.fieldsMappingObj,"field-mapping-changed",f.hitch(this,function(S){this.fieldMappingDetails=S.fieldMappingDetails;this.config.editor.overrideDefaultsByCopiedFeature=S.overrideDefaultsByCopiedFeature})))},_getConfiguredFieldInfos:function(H,U){var S=[];h.forEach(U,function(D){var L=this._getFieldInfoByFieldName(H,D.fieldName);D=f.mixin(f.clone(L),D);S.push(D)},this);return S},_getFieldInfoByFieldName:function(H,U){var S={};h.some(H,function(D){if(D.name===U)return f.mixin(S,D),!0});
return S},_validateSelectedFeature:function(H){(!H||0>=H.length)&&k({message:this.nls.copyFeatures.selectFeatureToCopyMessage})},_getSelectedFeaturesForCopy:function(){var H,U=[];for(H in this.featuresByLayerId){var S=this._getSelectedFeaturesByLayerId(H);0<S.length&&(U=U.concat(S))}this._validateSelectedFeature(U);return U},_getSelectedFeaturesByLayerId:function(H){var U=[];h.forEach(this.checkBoxNodes[H],f.hitch(this,function(S,D){S.getValue()&&U.push(this.featuresByLayerId[H][D])}));return U},
_showHideSingleFeatureButton:function(H){"esriGeometryPoint"===H?b.add(this.createSingleFeatureBtn,"esriCTHidden"):b.remove(this.createSingleFeatureBtn,"esriCTHidden")},_showHideMultipleFeatureButton:function(H){"esriGeometryPoint"!==H&&this.hideMultipleFeatureButton?b.add(this.createMultipleFeaturesBtn,"esriCTHidden"):b.remove(this.createMultipleFeaturesBtn,"esriCTHidden")},_createNewGraphicsLayer:function(H){var U={};if(H+=this.widgetId)this.map._layers[H]&&this.map.removeLayer(this.map._layers[H]),
U={id:H};H=new n(U);this.map.addLayer(H);return H},_highlightFeatures:function(){this.highlightGraphicsLayer.clear();for(var H in this.featureTitlesByLayerId)this._highlightSingleLayerFeatures(H)},_highlightSingleLayerFeatures:function(H){var U=this.map.getLayer(H);H=this._getSelectedFeaturesByLayerId(H);h.forEach(H,f.hitch(this,function(S){S=m.getHighLightSymbol(S,U);this.highlightGraphicsLayer.add(S)}))},_changeWarningNote:function(H){H="esriGeometryPoint"===H&&this.hideMultipleFeatureButton?this.nls.copyFeatures.canNotSaveMultipleFeatureWarning:
"esriGeometryPoint"!==H&&this.hideMultipleFeatureButton?this.nls.copyFeatures.createOnlyOneMultipartFeatureWarning:this.nls.copyFeatures.multipleFeatureSaveWarning;a.set(this.warningMessage,"innerHTML",H);a.set(this.warningMessage,"aria-label",H)},setProgressPercentage:function(H){H=parseFloat(H.toFixed());0>=H?(this.applyEditsProgress.set({value:0}),I.set(this.applyEditsProgress.domNode,"display","block")):100<=H?(this.applyEditsProgress.set({value:100}),I.set(this.applyEditsProgress.domNode,"display",
"none")):this.applyEditsProgress.set({value:H})}})})},"widgets/SmartEditor/highlightSymbolUtils":function(){define("dojo/_base/lang dojo/_base/array esri/geometry/Point esri/geometry/Polygon esri/geometry/Polyline esri/graphic esri/symbols/SimpleMarkerSymbol esri/symbols/SimpleLineSymbol esri/symbols/SimpleFillSymbol esri/Color".split(" "),function(O,B,F,E,f,h,r,c,v,p){var g={getHighLightSymbol:function(e,b){switch(e.geometry.type){case "point":return g._getPointSymbol(e,b);case "polyline":return g._getPolyLineSymbol(e,
b);case "polygon":return g._getPolygonSymbol(e,b)}},_getSizeInfo:function(e){var b=null;e.renderer.visualVariables&&B.forEach(e.renderer.visualVariables,O.hitch(this,function(a){"sizeInfo"===a.type&&(b=a)}));return b},_getPointSymbol:function(e,b){var a,m;var n=!1;var l=new r(r.STYLE_SQUARE,null,new c(c.STYLE_SOLID,new p([0,255,255,1]),3));l.setColor(null);l.size=30;if(b&&b.renderer)if(b.renderer.symbol)n=!0,l=g._updatePointSymbolProperties(l,b.renderer.symbol);else if(b.renderer.infos&&0<b.renderer.infos.length){for(m=
0;m<b.renderer.infos.length;m++){b.typeIdField?a=e.attributes[b.typeIdField]:b.renderer.attributeField&&(a=e.attributes[b.renderer.attributeField]);var k=b.renderer.infos[m].value;void 0!==a&&null!==a&&""!==a&&void 0!==k&&null!==k&&""!==k&&a.toString()===k.toString()&&(n=!0,l=g._updatePointSymbolProperties(l,b.renderer.infos[m].symbol))}!n&&b.renderer.defaultSymbol&&(n=!0,l=g._updatePointSymbolProperties(l,b.renderer.defaultSymbol))}b&&b.graphics&&0<b.graphics.length&&b._getSymbol(e)&&((a=e.getShape())&&
a.shape?a.shape.hasOwnProperty("r")?(n=!0,l.size=2*a.shape.r+10):a.shape.hasOwnProperty("width")&&(n=!0,b.renderer&&b.renderer.infos&&0<b.renderer.infos.length&&(l=g._updatePointSymbolProperties(l,b.renderer.infos[0].symbol)),l.size=a.shape.width+10):b.renderer.visualVariables&&(n=b._getRenderer(e),a=g._getSizeInfo(b))&&(b=n.getSize(e,{sizeInfo:a,shape:b._getSymbol(e),resolution:b&&b.getResolutionInMeters&&b.getResolutionInMeters()}),null!==b&&(l.size=b+10)));b=new F(e.geometry.x,e.geometry.y,e.geometry.spatialReference);
return new h(b,l,e.attributes)},_updatePointSymbolProperties:function(e,b){if(b.hasOwnProperty("height")&&b.hasOwnProperty("width")){var a=b.height;var m=b.width;a=(a>m?a:m)+10;e.size=a}b.hasOwnProperty("size")&&(!a||a<b.size)&&(e.size=b.size+10);b.hasOwnProperty("xoffset")&&(e.xoffset=b.xoffset);b.hasOwnProperty("yoffset")&&(e.yoffset=b.yoffset);return e},_getPolyLineSymbol:function(e,b){var a,m;var n=5;if(b&&b.renderer)if(b.renderer.symbol&&b.renderer.symbol.hasOwnProperty("width"))n=b.renderer.symbol.width;
else if(b.renderer.infos&&0<b.renderer.infos.length)for(m=0;m<b.renderer.infos.length;m++){b.typeIdField?a=e.attributes[b.typeIdField]:b.renderer.attributeField&&(a=e.attributes[b.renderer.attributeField]);var l=b.renderer.infos[m].value;void 0!==a&&null!==a&&""!==a&&void 0!==l&&null!==l&&""!==l&&a.toString()===l.toString()&&b.renderer.infos[m].symbol.hasOwnProperty("width")&&(n=b.renderer.infos[m].symbol.width)}else b.renderer.defaultSymbol&&b.renderer.defaultSymbol.hasOwnProperty("width")&&(n=b.renderer.defaultSymbol.width);
b=new c(c.STYLE_SOLID,new p([0,255,255,1]),n);var k=new f(e.geometry.spatialReference);e.geometry.paths&&0<e.geometry.paths.length&&B.forEach(e.geometry.paths,function(y){k.addPath(y)});return new h(k,b,e.attributes)},_getPolygonSymbol:function(e){var b=new v(v.STYLE_SOLID,new c(c.STYLE_SOLID,new p([0,255,255,1]),4),new p([0,0,0,0]));var a=new E(e.geometry.spatialReference);e.geometry.rings&&(a.rings=O.clone(e.geometry.rings));return new h(a,b,e.attributes)}};return g})},"widgets/SmartEditor/fieldsMapping":function(){define("dojo/_base/declare dojo/Evented dojo/_base/lang dojo/text!./fieldsMapping.html ./fieldMap dijit/_WidgetsInTemplateMixin jimu/BaseWidgetSetting jimu/dijit/Popup dojo/dom-construct dojo/_base/array dojo/on jimu/dijit/CheckBox".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e){return O([r,B,h],{baseClass:"jimu-widget-smartEditor-fieldsMapping",templateString:E,fieldsPopup:null,nodes:[],fieldMapBySourceLayer:{},postCreate:function(){this.nodes=[];this.own(g(window,"resize",F.hitch(this,function(){this._setFieldPopupDimensions()})));this.fieldMapBySourceLayer={};this.valuesOverrideCheckbox=new e({label:this.nls.fieldsMapping.fieldsMatchingCheckboxLabel,class:"esriCTFieldCheckbox","aria-label":this.nls.fieldsMapping.fieldsMatchingCheckboxLabel},
this.fieldsMatchingCheckboxNode);this.overrideDefaultsByCopiedFeature&&this.valuesOverrideCheckbox.setValue(this.overrideDefaultsByCopiedFeature);this._addFieldMapping();this._createPopUp()},_createPopUp:function(){this.fieldsPopup=new c({titleLabel:this.nls.fieldsMapping.popupTittle,width:600,autoHeight:!0,"class":this.baseClass,content:this,buttons:[{label:this.nls.ok,id:"okButton",onClick:F.hitch(this,function(){for(var b in this.fieldMapBySourceLayer){var a=this.fieldMapBySourceLayer[b].getMatchedFields();
this.fieldMappingDetails.hasOwnProperty(this.targetLayerDetails.id)||(this.fieldMappingDetails[this.targetLayerDetails.id]={});this.fieldMappingDetails[this.targetLayerDetails.id][b]=a}this.emit("field-mapping-changed",{fieldMappingDetails:this.fieldMappingDetails,overrideDefaultsByCopiedFeature:this.valuesOverrideCheckbox.getValue()});this.fieldsPopup.close()})},{label:this.nls.cancel,id:"cancelButton",onClick:F.hitch(this,function(){this.emit("cancelButtonClicked");this.fieldsPopup.close()})}]});
this._setFieldPopupDimensions()},_addFieldMapping:function(){p.forEach(this.sourceLayerDetails,F.hitch(this,function(b){this.fieldMapBySourceLayer[b.id]=new f({nls:this.nls,sourceLayerDetails:b,targetLayerDetails:this.targetLayerDetails,openOnLoad:1===this.sourceLayerDetails.length?!0:!1,fieldMappingDetails:this.fieldMappingDetails,usePresetValues:this.usePresetValues},v.create("div",{"class":"esriCTBottomSpacing"},this.fieldsMappingContainer))}))},_setFieldPopupDimensions:function(){this.fieldsPopup&&
(window.appInfo.isRunInMobile?this.fieldsPopup.set("width",window.innerWidth-100):this.fieldsPopup.set("width",600))}})})},"widgets/SmartEditor/fieldMap":function(){define("dojo/_base/declare dojo/Evented dojo/_base/lang dojo/text!./fieldMap.html dijit/_WidgetsInTemplateMixin jimu/BaseWidgetSetting dojo/dom-construct dojo/_base/array dojo/string dojo/on dojo/dom-class dojo/dom-style dojo/dom-attr dijit/form/TextBox dojo/keys dijit/form/Select".split(" "),function(O,B,F,E,f,h,r,c,v,p,g,e,b,a,m,n){return O([h,
B,f],{baseClass:"jimu-widget-smartEditor-fieldsMapping",ValidFieldsByType:{esriFieldTypeOID:["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],esriFieldTypeSmallInteger:["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],esriFieldTypeInteger:["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],esriFieldTypeDouble:["esriFieldTypeOID",
"esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],esriFieldTypeSingle:["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],esriFieldTypeGUID:["esriFieldTypeGUID","esriFieldTypeGlobalID"],esriFieldTypeDate:["esriFieldTypeDate"],esriFieldTypeString:"esriFieldTypeSmallInteger esriFieldTypeInteger esriFieldTypeSingle esriFieldTypeDouble esriFieldTypeString esriFieldTypeGUID esriFieldTypeDate esriFieldTypeOID esriFieldTypeGlobalID".split(" ")},
templateString:E,sourceLayerDetails:[],targetLayerDetails:{},mappedTargetFields:{},postCreate:function(){this.mappedTargetFields={};this._createFieldMap(this.sourceLayerDetails,this.targetLayerDetails);this.openOnLoad&&this.expandIconNode.click();this._setLabelWidth(window.appInfo.isRunInMobile?500:"");this.own(p(window,"resize",F.hitch(this,function(){this._setLabelWidth(500)})))},_setLabelWidth:function(l){setTimeout(F.hitch(this,function(){for(var k in this.mappedTargetFields)if(this.mappedTargetFields[k]&&
this.mappedTargetFields[k].domNode&&this.mappedTargetFields[k].containerNode){var y=this.mappedTargetFields[k].containerNode.children[0];y&&e.set(y,"width",this.mappedTargetFields[k].domNode.parentElement.clientWidth-50+"px")}}),l?l:1)},_expandCollapse:function(){g.contains(this.fieldsNode,"esriCTHidden")?(g.replace(this.expandIconNode,"esriCTArrowDown","esriCTArrowUp"),g.remove(this.fieldsNode,"esriCTHidden"),g.remove(this.iconParentNode,"esriCTHidden"),g.add(this.layerNameNode,"esriCTLayerNameWidthReduced"),
b.set(this.expandIconNode,"aria-expanded","true"),this._setLabelWidth()):(g.replace(this.expandIconNode,"esriCTArrowUp","esriCTArrowDown"),g.add(this.fieldsNode,"esriCTHidden"),g.add(this.iconParentNode,"esriCTHidden"),g.remove(this.layerNameNode,"esriCTLayerNameWidthReduced"),b.set(this.expandIconNode,"aria-expanded","false"))},_resetSourceFields:function(){if(this.mappedTargetFields)for(var l in this.mappedTargetFields){var k=this.mappedTargetFields[l];if(!k.get("disabled")){for(var y=!1,u=0;u<
k.options.length;u++)if(k.options[u].isDefault){k.set("value",k.options[u].value);y=!0;break}y||k.set("value","esriCTSelectSourceLayerField")}}this._setLabelWidth()},_clearSourceFields:function(){if(this.mappedTargetFields)for(var l in this.mappedTargetFields)this.mappedTargetFields[l].get("disabled")||this.mappedTargetFields[l].set("value","esriCTSelectSourceLayerField");this._setLabelWidth()},_createFieldMap:function(l,k){this.expandIconNode=r.create("div",{"class":"esriCTArrow esriCTArrowUp",role:"button",
tabindex:"0",title:l.name,"aria-label":l.name,"aria-expanded":"false"},this.headerNode);this.layerNameNode=r.create("div",{"class":"esriCTLayerName",innerHTML:l.name},this.headerNode);this.iconParentNode=r.create("div",{"class":"esriCTIconParentNode esriCTHidden"},this.headerNode);this.resetButtonNode=r.create("div",{"class":"esriCTResetButton",role:"button",tabindex:"0",title:this.nls.fieldsMapping.resetLabel,"aria-label":this.nls.fieldsMapping.resetLabel},this.iconParentNode);this.clearButtonNode=
r.create("div",{"class":"esriCTClearButton",role:"button",tabindex:"0",title:this.nls.fieldsMapping.clearLabel,"aria-label":this.nls.fieldsMapping.clearLabel},this.iconParentNode);this.own(p(this.layerNameNode,"click",F.hitch(this,this._expandCollapse)));this.own(p(this.expandIconNode,"click",F.hitch(this,this._expandCollapse)));this.own(p(this.expandIconNode,"keydown",F.hitch(this,function(u){u.keyCode!==m.ENTER&&u.keyCode!==m.SPACE||this._expandCollapse()})));this.own(p(this.clearButtonNode,"click",
F.hitch(this,this._clearSourceFields)));this.own(p(this.clearButtonNode,"keydown",F.hitch(this,function(u){u.keyCode!==m.ENTER&&u.keyCode!==m.SPACE||this._clearSourceFields()})));this.own(p(this.resetButtonNode,"click",F.hitch(this,this._resetSourceFields)));this.own(p(this.resetButtonNode,"keydown",F.hitch(this,function(u){u.keyCode!==m.ENTER&&u.keyCode!==m.SPACE||this._resetSourceFields()})));var y=!1;c.forEach(k.fields,F.hitch(this,function(u){var C=u.hasOwnProperty("isEditable")?u.isEditable:
u.editable;"esriFieldTypeGeometry"!==u.type&&"esriFieldTypeBlob"!==u.type&&"esriFieldTypeRaster"!==u.type&&"esriFieldTypeXML"!==u.type&&"esriFieldTypeOID"!==u.type&&"esriFieldTypeGlobalID"!==u.type&&C&&(y=!0,this._createFieldList(l,u))}));y?g.add(this.noFieldsMatching,"esriCTHidden"):(g.add(this.fieldMappingTableWrapper,"esriCTHidden"),e.set(this.iconParentNode,"display","none"));this._showMatchedFieldsInfo()},_createFieldList:function(l,k){var y=!1;var u=r.create("tr",{"class":"esriCTFieldsMatchingTableRow"},
this.fieldsTbodyNode);var C=r.create("td",{"class":"esriCTFieldsMatchingTableCell esriCTTargetTD","data-th":this.nls.fieldsMapping.fieldsInTargetLayerLabel},u);var q=this._getFieldLabel(k);C=new a({value:q,title:q,disabled:!0},r.create("div",{},C));C.textbox&&g.add(C.textbox,"textLabelEllipsis");u=r.create("td",{"class":"esriCTFieldsMatchingTableCell esriCTSourceTD","data-th":this.nls.fieldsMapping.fieldsInSourceLayerLabel},u);this.targetLayerDetails.fieldValues&&this.targetLayerDetails.fieldValues[k.name]&&
(C=this.targetLayerDetails.fieldValues[k.name])&&0<C.length&&c.some(C,F.hitch(this,function(w){if("Preset"!==w.actionName&&w.enabled||"Preset"===w.actionName&&w.enabled&&this.usePresetValues)return y=!0}));y?(this.mappedTargetFields[k.name]=new a({value:this.nls.fieldsMapping.dynamicValueText,title:this.nls.fieldsMapping.dynamicValueText,disabled:!0},r.create("div",{},u)),this.mappedTargetFields[k.name]&&this.mappedTargetFields[k.name].textbox&&g.add(this.mappedTargetFields[k.name].textbox,"textLabelEllipsis")):
(this.mappedTargetFields[k.name]=new n({options:this._addSourceLayerFieldOptions(k,l),"class":"esriCTFieldsMatchingDropdown"},r.create("div",{},u)),this.own(p(this.mappedTargetFields[k.name],"change",F.hitch(this,this._showMatchedFieldsInfo))),b.set(this.mappedTargetFields[k.name],"aria-label",v.substitute(this.nls.fieldsMapping.selectFieldAriaLabel,{targetField:k.name})),this.fieldMappingDetails&&this.fieldMappingDetails.hasOwnProperty(this.targetLayerDetails.id)&&this.fieldMappingDetails[this.targetLayerDetails.id].hasOwnProperty(l.id)&&
this.fieldMappingDetails[this.targetLayerDetails.id][l.id].hasOwnProperty(k.name)&&(l=this.fieldMappingDetails[this.targetLayerDetails.id][l.id][k.name],""===l&&(l="esriCTSelectSourceLayerField"),this.mappedTargetFields[k.name].set("value",l)),this.own(p(this.mappedTargetFields[k.name].dropDown,"close",F.hitch(this,function(){this._setLabelWidth()}))))},_getFieldLabel:function(l){var k="";l&&l.name&&(k=l.label&&l.label!==l.name?l.label+" ["+l.name+"]":l.name);return k},_addSourceLayerFieldOptions:function(l,
k){var y=[],u=[];if(!k||!k.fields)return y;y.push({label:this.nls.fieldsMapping.selectSourceFieldLabel,value:"esriCTSelectSourceLayerField"});(u=this.ValidFieldsByType[l.type])||console.log(l.type);var C=!1;c.forEach(k.fields,F.hitch(this,function(q){var w=!0;q.hasOwnProperty("visible")&&(w=q.visible);"esriFieldTypeGeometry"!==q.type&&"esriFieldTypeBlob"!==q.type&&"esriFieldTypeRaster"!==q.type&&"esriFieldTypeXML"!==q.type&&u&&-1<u.indexOf(q.type)&&w&&(!C&&l.name.toLowerCase()===q.name.toLowerCase()||
l.alias&&q.alias&&l.alias.toLowerCase()===q.alias.toLowerCase()||l.alias&&l.alias.toLowerCase()===q.name.toLowerCase()||q.alias&&l.name.toLowerCase()===q.alias.toLowerCase()?(C=!0,y.push({label:this._getFieldLabel(q),value:q.name,selected:!0,isDefault:!0})):y.push({label:this._getFieldLabel(q),value:q.name,selected:!1,isDefault:!1}))}));return y},getMatchedFields:function(){var l={},k;for(k in this.mappedTargetFields){var y=this.mappedTargetFields[k].get("value");if("esriCTSelectSourceLayerField"===
y||this.mappedTargetFields[k].get("disabled"))y="";l[k]=y}return l},_showMatchedFieldsInfo:function(){var l=0,k=0,y;for(y in this.mappedTargetFields)"esriCTSelectSourceLayerField"!==this.mappedTargetFields[y].get("value")&&k++,l++;l=v.substitute(this.nls.fieldsMapping.targetFieldsMatchedLabel,{layerName:this.sourceLayerDetails.name,matchedFields:k,totalFields:l});b.set(this.layerNameNode,"aria-label",l);b.set(this.layerNameNode,"innerHTML",l);b.set(this.layerNameNode,"title",l);b.set(this.expandIconNode,
"aria-label",l);b.set(this.expandIconNode,"title",l)}})})},"widgets/SmartEditor/ValuePicker":function(){define("dojo/_base/declare dojo/Evented dojo/_base/lang dojo/_base/array dojo/dom-construct dojo/dom-class dojo/text!./ValuePicker.html dijit/_TemplatedMixin jimu/BaseWidgetSetting jimu/dijit/Popup jimu/dijit/formSelect jimu/utils".split(" "),function(O,B,F,E,f,h,r,c,v,p,g,e){return O([v,B,c],{baseClass:"jimu-widget-smartEditor-multiple-value-picker",templateString:r,allFields:{},isOpen:!0,postCreate:function(){this.inherited(arguments);
this.allFields={};this._initControls();this.showDialog()},_isFieldDisabled:function(b){return this.disabledFields&&0!==this.disabledFields.length&&this.disabledFields&&-1<this.disabledFields.indexOf(b)?!0:!1},_initControls:function(){if(this.showForField)this.addField(this.showForField);else if(this.multipleValues)for(var b in this.multipleValues)this._isFieldDisabled(b)||this.addField(b)},addField:function(b){var a=this.multipleValues[b],m=f.create("div",{class:"esriCTFieldContainer"},this.fieldsContainer);
f.create("div",{innerHTML:this.fieldLabels[b],class:"esriCTFieldName"},m);a=this._getFieldsOptionsObj(b,a);this.allFields[b]=new g({style:{width:"270px"},options:a,"aria-label":this.fieldLabels[b]},f.create("div",{},m))},showDialog:function(){this.isOpen=!0;this.fieldsPopup=new p({titleLabel:this.nls.valuePicker.popupTitle,width:310,maxHeight:500,autoHeight:!0,content:this,class:this.baseClass,buttons:[{label:this.nls.ok,onClick:F.hitch(this,function(){var b={};if(this.showForField)b[this.showForField]=
this.allFields[this.showForField].get("value");else for(var a in this.allFields)b[a]=this.allFields[a].get("value");this.emit("value-selected",b);this.fieldsPopup.close()})},{label:this.nls.cancel,classNames:["jimu-btn-vacation"],onClick:F.hitch(this,function(){this.isOpen=!1;this.fieldsPopup.close()})}],onClose:F.hitch(this,function(){this.isOpen=!1})})},hideDialog:function(){this.fieldsPopup&&this.isOpen&&(this.isOpen=!1,this.fieldsPopup.close())},_getFieldsOptionsObj:function(b,a){var m=this._getPopupFieldInfo(b);
b=e._getValues(this.layerInfo.layerInfo.layerObject,m,b,a);return b=E.map(b,function(n){return{value:n.value,label:n.label+""}})},_getPopupFieldInfo:function(b){var a;if(a=this.layerInfo.layerInfo.getPopupInfo())a=a.fieldInfos,E.some(a,function(n){if(n.fieldName===b)return m=n,!0});else var m=e.getPopupFieldFromLayerField(this.layerInfo.layerInfo.layerObject.getField(b));return m},setValue:function(b,a){a&&(1<a.length?this.allFields[b].set("value",this.getSelectedValueForDateField(b,a)):this.allFields[b].set("value",
a.getValue()))},getSelectedValueForDateField:function(b,a){var m="";var n=this._getPopupFieldInfo(b);var l=e._getValues(this.layerInfo.layerInfo.layerObject,n,b,[a[0].value?a[0].value.getTime():""]);E.some(this.allFields[b].options,F.hitch(this,function(k){if(k.value===l[0].value)return m=k.value,!0}));return m}})})},"widgets/SmartEditor/requiredFields":function(){define("dojo/_base/declare dojo/Evented dojo/_base/lang dojo/text!./requiredFields.html dijit/_WidgetsInTemplateMixin jimu/BaseWidgetSetting jimu/dijit/Popup dojo/dom-construct dojo/_base/array dojo/string dojo/dom-style dojo/on dojo/dom-class dojo/dom-attr".split(" "),
function(O,B,F,E,f,h,r,c,v,p,g,e,b,a){return O([h,B,f],{baseClass:"jimu-widget-smartEditor-requiredFields",templateString:E,fieldsPopup:null,nodes:[],postCreate:function(){this.nodes=[];this._createPopupContent();this._createPopUp()},_createPopupContent:function(){v.forEach(this.requiredFieldsInfos,F.hitch(this,function(m){var n=m.alias?m.alias:m.name,l=c.create("div",{class:"esriCTFieldContainer esriCTMarginLeft15"},this.fieldsDijitContainer),k=p.substitute(this.nls.requiredFields.foundNullRecordCount,
{fieldName:n,count:this.AttributesCount[m.name]});c.create("div",{innerHTML:k,class:"esriCTFieldName"},l);var y=this.presetUtils.createPresetFieldContentNode(m);this.nodes.push(y);0<y.length&&v.forEach(y,F.hitch(this,function(u){g.set(u,"width","100%");a.set(u,"aria-label",n);u.placeAt(c.create("div",{style:"width:90%"},l));u.startup()}));y[0].hasOwnProperty("fieldType")&&-1!==["richtext","textarea"].indexOf(y[0].fieldType)&&e(y[0],"change",F.hitch(this,function(u){""===u||null===u||void 0===u?(b.add(y[0].domNode,
"ee-error"),y[0].focusNode.focus()):b.remove(y[0].domNode,"ee-error")}))}))},_createPopUp:function(){this.fieldsPopup=new r({titleLabel:this.nls.requiredFields.popupTittle,width:400,maxHeight:300,autoHeight:!0,"class":this.baseClass,content:this,buttons:[{label:this.nls.ok,id:"okButton",onClick:F.hitch(this,function(){this._validateFieldsDijits()&&(this._getRequiredFieldsEnteredvalues(),this.fieldsPopup.close())})},{label:this.nls.cancel,id:"cancelButton",classNames:["jimu-btn-vacation"],onClick:F.hitch(this,
function(){this.emit("cancelButtonClicked");this.fieldsPopup.close()})}]})},_getRequiredFieldsEnteredvalues:function(){var m={};v.forEach(this.nodes,F.hitch(this,function(n){var l=n[0].name;if(n[0].hasOwnProperty("fieldType")&&"date"===n[0].fieldType)if(1===n.length)m[l]=(new Date(n[0].getValue())).getTime();else{var k=n[0].getValue().toDateString();n=n[1].getValue().toTimeString();m[l]=(new Date(k+" "+n)).getTime()}else n[0].hasOwnProperty("fieldType")&&-1!==["richtext","textarea"].indexOf(n[0].fieldType)?
(k=this.presetUtils.getFieldInfoByFieldName(this.requiredFieldsInfos,n[0].name).length,n=n[0].getValue(),n.length>k&&(n=n.slice(0,k)),m[l]=n):m[l]=n[0].getValue()}));this.emit("providedValuesToRequiredFields",m)},_validateFieldsDijits:function(){var m=!0;v.some(this.nodes,F.hitch(this,function(n){if(n[0].hasOwnProperty("fieldType")&&-1!==["richtext","textarea"].indexOf(n[0].fieldType)){if(""===n[0].getValue()||null===n[0].getValue()||void 0===n[0].getValue())return b.add(n[0].domNode,"ee-error"),
m=!1,n[0].focusNode.focus(),!0}else{if(!n[0].isValid())return m=!1,n[0].focus(),!0;if(1<n.length&&!n[1].isValid())return m=!1,n[1].focus(),!0}}));return m}})})},"widgets/SmartEditor/_build-generate_module":function(){define(["dojo/text!./Widget.html","dojo/text!./css/style.css","dojo/i18n!./nls/strings"],function(){})},"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: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: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: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:widgets/SmartEditor/RelativeDates.html":'\x3cdiv\x3e\r\n    \x3cdiv\x3e\r\n        \x3cdiv class\x3d"esriCTLabel"\x3e${nls.relativeDates.dateTypeLabel}\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTRadioButtonContainer"\x3e\r\n            \x3cdiv class\x3d"esriCTRadioBtn esriCTDateTypeLabel"\x3e\r\n                \x3cinput data-dojo-type\x3d"jimu/dijit/RadioBtn" data-dojo-props\x3d"group: \'g1\'" type\x3d"radio" name\x3d"jimuradiobtn" id\x3d"fixedRadioButton" checked\r\n                    data-dojo-attach-point\x3d"fixedRadioButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.relativeDates.dateTypeLabel}${nls.relativeDates.fixed}"\x3e\r\n                \x3clabel class\x3d"esriCTRadioLabel" for\x3d"fixedRadioButton"\x3e\r\n                    ${nls.relativeDates.fixed}\r\n                \x3c/label\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTRadioBtn esriCTDateTypeLabel"\x3e\r\n                \x3cinput data-dojo-type\x3d"jimu/dijit/RadioBtn" data-dojo-props\x3d"group: \'g1\'" type\x3d"radio" name\x3d"jimuradiobtn" id\x3d"currentRadioButton"  data-dojo-attach-point\x3d"currentRadioButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.relativeDates.dateTypeLabel}${nls.relativeDates.current}"\x3e\r\n                \x3clabel class\x3d"esriCTRadioLabel" for\x3d"currentRadioButton"\x3e\r\n                    ${nls.relativeDates.current}\r\n                \x3c/label\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTRadioBtn esriCTDateTypeLabel"\x3e\r\n                \x3cinput data-dojo-type\x3d"jimu/dijit/RadioBtn" data-dojo-props\x3d"group: \'g1\'" type\x3d"radio" name\x3d"jimuradiobtn" id\x3d"PastRadioButton"  data-dojo-attach-point\x3d"PastRadioButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.relativeDates.dateTypeLabel}${nls.relativeDates.past}"\x3e\r\n                \x3clabel class\x3d"esriCTRadioLabel" for\x3d"PastRadioButton"\x3e\r\n                    ${nls.relativeDates.past}\r\n                \x3c/label\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTRadioBtn esriCTDateTypeLabel"\x3e\r\n                \x3cinput data-dojo-type\x3d"jimu/dijit/RadioBtn" data-dojo-props\x3d"group: \'g1\'" type\x3d"radio" name\x3d"jimuradiobtn" id\x3d"futureRadioButton"  data-dojo-attach-point\x3d"futureRadioButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.relativeDates.dateTypeLabel}${nls.relativeDates.future}"\x3e\r\n                \x3clabel class\x3d"esriCTRadioLabel" for\x3d"futureRadioButton"\x3e\r\n                    ${nls.relativeDates.future}\r\n                \x3c/label\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTRelativeDatesHint" data-dojo-attach-point\x3d"hintForDateType"\x3e${nls.relativeDates.hintForFixedDateType}\x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTLabel" style\x3d"margin-top:10px;" data-dojo-attach-point\x3d"valueLabel"\x3e${nls.relativeDates.valueLabel}\x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTFixedDateContent" data-dojo-attach-point\x3d"fixedDateContent"\x3e\r\n        \x3cdiv class\x3d"esriCTFixedContentWrappper"\x3e\r\n            \x3cdiv class\x3d"esriCTRadioBtn esriCTselectValueLabel"\x3e\r\n                \x3cinput data-dojo-type\x3d"jimu/dijit/RadioBtn" data-dojo-props\x3d"group: \'g2\'" type\x3d"radio" name\x3d"jimuradiobtn2" id\x3d"customRadioButton" checked\r\n                data-dojo-attach-point\x3d"customRadioButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.relativeDates.customLabel}"\x3e\r\n                \x3clabel class\x3d"esriCTRadioLabel" for\x3d"customRadioButton"\x3e\r\n                    ${nls.relativeDates.customLabel}\r\n                \x3c/label\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTRadioBtn esriCTselectValueLabel"\x3e\r\n                \x3cinput data-dojo-type\x3d"jimu/dijit/RadioBtn" data-dojo-props\x3d"group: \'g2\'" type\x3d"radio" name\x3d"jimuradiobtn2" id\x3d"selectValueRadioButton"\r\n                data-dojo-attach-point\x3d"selectValueRadioButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.relativeDates.popupTitle}"\x3e\r\n                \x3clabel class\x3d"esriCTRadioLabel" for\x3d"selectValueRadioButton"\x3e\r\n                    ${nls.relativeDates.popupTitle}\r\n                \x3c/label\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"customOptionContentNode"\x3e\r\n        \x3cdiv class\x3d"esriCTWrapper"\x3e\r\n            \x3cdiv class\x3d"esriCTPopUpLabel"\x3e${nls.date}\x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTFixedContentDijit"\x3e\r\n                \x3cdiv style\x3d"width:95%" data-dojo-type\x3d"dijit/form/DateTextBox" required\x3d"false" data-dojo-attach-point\x3d"dateTextBox" tabindex\x3d"0" aria-label\x3d"${nls.date}"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTWrapper"\x3e\r\n            \x3cdiv class\x3d"esriCTPopUpLabel"\x3e${nls.time}\x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTFixedContentDijit"\x3e\r\n                \x3cdiv style\x3d"width: 95%" data-dojo-type\x3d"dijit/form/TimeTextBox" required\x3d"false" data-dojo-attach-point\x3d"timeTextBox" tabindex\x3d"0" aria-label\x3d"${nls.time}"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTHidden"  data-dojo-attach-point\x3d"selectValueOptionContentNode"\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"layerSelectorWrapper" class\x3d"esriCTWrapper"\x3e\r\n                \x3cdiv class\x3d"esriCTPopUpLabel"\x3e${nls.relativeDates.layerLabel}\r\n                \x3c/div\x3e\r\n                \x3cdiv class\x3d"esriCTFixedContentDijit"\x3e\r\n                    \x3cdiv class\x3d"esriCTLayerSelect" style\x3d"width: 95%" data-dojo-attach-point\x3d"layerSelectorDiv"\r\n                    aria-label\x3d"${nls.relativeDates.layerLabel}"\x3e\r\n                    \x3c/div\x3e\r\n                \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTWrapper"\x3e\r\n                \x3cdiv class\x3d"esriCTPopUpLabel"\x3e${nls.presetFieldAlias}\x3c/div\x3e\r\n                \x3cdiv class\x3d"esriCTFixedContentDijit"\x3e\r\n                    \x3cdiv class\x3d"esriCTlayerField" style\x3d"width: 95%" data-dojo-attach-point\x3d"fieldsDropdownDiv"\r\n                    aria-label\x3d"${nls.presetFieldAlias}"\x3e\r\n                    \x3c/div\x3e\r\n                \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTWrapper"\x3e\r\n                \x3cdiv class\x3d"esriCTPopUpLabel"\x3e${nls.relativeDates.valueLabel}\x3c/div\x3e\r\n                \x3cdiv class\x3d"esriCTFixedContentDijit"\x3e\r\n                    \x3cdiv class\x3d"esriCTlayerFieldvalue" style\x3d"width: 95%" data-dojo-attach-point\x3d"valueProviderContainer"\r\n                    aria-label\x3d"${nls.relativeDates.valueLabel}"\x3e\r\n                    \x3c/div\x3e\r\n                    \x3cdiv class\x3d"esriCTDomainFieldHint esriCTHidden" data-dojo-attach-point\x3d"domainFieldHint"\x3e\x3c/div\x3e\r\n                \x3c/div\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTHidden" style\x3d"width:100%" data-dojo-attach-point\x3d"currentDateContent"\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTHidden esriCTPastOrFutureDateContent" data-dojo-attach-point\x3d"pastOrFutureDateContent"\x3e\r\n        \x3cdiv class\x3d"esriCTMarginForLabel"\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTMarginForLabel"\x3e\r\n            \x3cdiv class\x3d"esriCTFloatLeft"\x3e\r\n                \x3cdiv class\x3d"esriCTValueLabel"\x3e${nls.years}\x3c/div\x3e\r\n                \x3cdiv style\x3d"width:112px" data-dojo-type\x3d"dijit/form/NumberSpinner" required\x3d"true" value\x3d"0"\r\n                    data-dojo-props\x3d"constraints:{min:0,places:0},intermediateChanges:true" data-dojo-attach-point\x3d"yearsTextBox" tabindex\x3d"0"\r\n                    aria-label\x3d"${nls.years}"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTFloatLeft"\x3e\r\n                \x3cdiv class\x3d"esriCTValueLabel"\x3e${nls.months}\x3c/div\x3e\r\n                \x3cdiv style\x3d"width:112px" data-dojo-type\x3d"dijit/form/NumberSpinner" required\x3d"true" value\x3d"0"\r\n                    data-dojo-props\x3d"constraints:{min:0,places:0},intermediateChanges:true" data-dojo-attach-point\x3d"monthsTextBox" tabindex\x3d"0"\r\n                    aria-label\x3d"${nls.months}"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTFloatLeft"\x3e\r\n                \x3cdiv class\x3d"esriCTValueLabel"\x3e${nls.days}\x3c/div\x3e\r\n                \x3cdiv style\x3d"width:112px" data-dojo-type\x3d"dijit/form/NumberSpinner" required\x3d"true" value\x3d"0"\r\n                    data-dojo-props\x3d"constraints:{min:0,places:0},intermediateChanges:true" data-dojo-attach-point\x3d"daysTextBox" tabindex\x3d"0"\r\n                    aria-label\x3d"${nls.days}"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTMarginForLabel" style\x3d"margin-top: 5px;"\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTMarginForLabel"\x3e\r\n            \x3cdiv class\x3d"esriCTFloatLeft"\x3e\r\n                \x3cdiv class\x3d"esriCTValueLabel"\x3e${nls.hours}\x3c/div\x3e\r\n                \x3cdiv style\x3d"width:112px" data-dojo-type\x3d"dijit/form/NumberSpinner" required\x3d"true" value\x3d"0"\r\n                    data-dojo-props\x3d"constraints:{min:0,places:0},intermediateChanges:true" data-dojo-attach-point\x3d"hoursTextBox" tabindex\x3d"0"\r\n                    aria-label\x3d"${nls.hours}"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTFloatLeft"\x3e\r\n                \x3cdiv class\x3d"esriCTValueLabel"\x3e${nls.minutes}\x3c/div\x3e\r\n                \x3cdiv style\x3d"width:112px" data-dojo-type\x3d"dijit/form/NumberSpinner" required\x3d"true" value\x3d"0"\r\n                    data-dojo-props\x3d"constraints:{min:0,places:0},intermediateChanges:true" data-dojo-attach-point\x3d"minutesTextBox" tabindex\x3d"0"\r\n                    aria-label\x3d"${nls.minutes}"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTFloatLeft"\x3e\r\n                \x3cdiv class\x3d"esriCTValueLabel"\x3e${nls.seconds}\x3c/div\x3e\r\n                \x3cdiv style\x3d"width:112px" data-dojo-type\x3d"dijit/form/NumberSpinner" required\x3d"true" value\x3d"0"\r\n                    data-dojo-props\x3d"constraints:{min:0,places:0},intermediateChanges:true" data-dojo-attach-point\x3d"secondsTextBox" tabindex\x3d"0"\r\n                    aria-label\x3d"${nls.seconds}"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTHidden esriCTDatesWarningContainer" data-dojo-attach-point\x3d"relativeDateWarningContainer"\x3e${nls.relativeDates.relativeDateWarning}\x3c/div\x3e\r\n\x3c/div\x3e',
"url:jimu/dijit/templates/_TreeNode.html":'\x3cdiv class\x3d"dijitTreeNode" role\x3d"presentation"\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"rowNode" class\x3d"dijitTreeRow" role\x3d"presentation"\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"expandoNode" class\x3d"dijitInline dijitTreeExpando" role\x3d"presentation"\x3e\x3c/span\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"expandoNodeText" class\x3d"dijitExpandoText" role\x3d"presentation"\x3e\x3c/span\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"contentNode" class\x3d"dijitTreeContent" role\x3d"presentation"\x3e\r\n\t\t\t\x3cspan role\x3d"presentation" class\x3d"dijitInline dijitIcon dijitTreeIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"labelNode,focusNode" class\x3d"dijitTreeLabel" role\x3d"treeitem" tabindex\x3d"-1" aria-selected\x3d"false"\x3e\x3c/span\x3e\r\n\t\t\x3c/span\x3e\r\n\t\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dijitTreeNodeContainer" role\x3d"presentation" style\x3d"display: none;"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:dijit/templates/TreeNode.html":'\x3cdiv class\x3d"dijitTreeNode" role\x3d"presentation"\r\n\t\x3e\x3cdiv data-dojo-attach-point\x3d"rowNode" class\x3d"dijitTreeRow" role\x3d"presentation"\r\n\t\t\x3e\x3cspan data-dojo-attach-point\x3d"expandoNode" class\x3d"dijitInline dijitTreeExpando" role\x3d"presentation"\x3e\x3c/span\r\n\t\t\x3e\x3cspan data-dojo-attach-point\x3d"expandoNodeText" class\x3d"dijitExpandoText" role\x3d"presentation"\x3e\x3c/span\r\n\t\t\x3e\x3cspan data-dojo-attach-point\x3d"contentNode"\r\n\t\t\tclass\x3d"dijitTreeContent" role\x3d"presentation"\x3e\r\n\t\t\t\x3cspan role\x3d"presentation" class\x3d"dijitInline dijitIcon dijitTreeIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\r\n\t\t\t\x3e\x3cspan data-dojo-attach-point\x3d"labelNode,focusNode" class\x3d"dijitTreeLabel" role\x3d"treeitem"\r\n\t\t\t\t   tabindex\x3d"-1" aria-selected\x3d"false" id\x3d"${id}_label"\x3e\x3c/span\x3e\r\n\t\t\x3c/span\r\n\t\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dijitTreeNodeContainer" role\x3d"presentation"\r\n\t\t style\x3d"display: none;" aria-labelledby\x3d"${id}_label"\x3e\x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:dijit/templates/Tree.html":'\x3cdiv role\x3d"tree"\x3e\r\n\t\x3cdiv class\x3d"dijitInline dijitTreeIndent" style\x3d"position: absolute; top: -9999px" data-dojo-attach-point\x3d"indentDetector"\x3e\x3c/div\x3e\r\n\t\x3cdiv class\x3d"dijitTreeExpando dijitTreeExpandoLoading" data-dojo-attach-point\x3d"rootLoadingIndicator"\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dijitTreeContainer" role\x3d"presentation"\x3e\r\n\t\x3c/div\x3e\r\n\x3c/div\x3e\r\n',"url:jimu/dijit/templates/LayerChooserFromMapWithDropbox.html":'\x3cdiv\x3e\r\n\x3ctable role\x3d"listbox" aria-haspopup\x3d"true" data-dojo-attach-point\x3d"dropDownBtn" data-dojo-attach-event\x3d"onclick: _onDropDownClick,onkeydown: _onDropDownKeydown"\r\n  tabindex\x3d"0" title\x3d"${nls.customSelectLayer}" aria-label\x3d"${nls.customSelectLayer}"\x3e\r\n    \x3ccaption class\x3d"screen-readers-only-no-position"\x3e${nls.customSelectLayer}\x3c/caption\x3e\r\n    \x3ccolgroup\x3e\r\n      \x3ccol width\x3d"10px"\x3e\x3c/col\x3e\r\n      \x3ccol width\x3d"auto"\x3e\x3c/col\x3e\r\n      \x3ccol width\x3d"30px"\x3e\x3c/col\x3e\r\n    \x3c/colgroup\x3e\r\n    \x3ctbody\x3e\r\n      \x3ctr\x3e\r\n        \x3ctd\x3e\x3c/td\x3e\r\n        \x3ctd\x3e\r\n          \x3cdiv class\x3d"layer-name jimu-ellipsis" data-dojo-attach-point\x3d"layerNameNode"\x3e\x3c/div\x3e\r\n        \x3c/td\x3e\r\n        \x3ctd\x3e\r\n          \x3cdiv class\x3d"drop-select jimu-float-trailing" data-dojo-attach-point\x3d"dropArrowNode"\x3e\r\n            \x3cdiv class\x3d"jimu-icon jimu-icon-down-arrow-8"\x3e\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3c/td\x3e\r\n      \x3c/tr\x3e\r\n    \x3c/tbody\x3e\r\n  \x3c/table\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/SmartEditor/AttachmentUploader.html":"\x3cdiv class\x3d\"attachmentUploader\" dojoattachpoint\x3d\"attachmentUploader\"\x3e\r\n    \x3cbr /\x3e\r\n    \x3cdiv\x3e\r\n        \x3cb\x3e${nls.NLS_attachments}\x3c/b\x3e\r\n        \x3chr /\x3e\r\n\r\n        \x3cdiv dojoattachpoint\x3d'_attachmentList' style\x3d'white-space:nowrap'\x3e\x3c/div\x3e\r\n\r\n\r\n\r\n    \x3c/div\x3e\r\n\x3c/div\x3e","url:widgets/SmartEditor/XYCoordinates.html":'\x3cdiv class\x3d"esriCTPopupContainer" data-dojo-attach-point\x3d"coordinatesPopup"\x3e\r\n    \x3cdiv class\x3d"esriCTFieldDropdownContainer"\x3e\r\n        \x3cdiv class\x3d"esriCTSelectTitle" title\x3d"${nls.coordinatesSelectTitle}"\x3e${nls.coordinatesSelectTitle}\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTFieldInput" style\x3d"width: 100%;"\x3e\r\n            \x3cselect aria-label\x3d"${nls.coordinatesSelectTitle}" class\x3d"esriCTControlWidth" data-dojo-attach-point\x3d"coordinatesDropDown" data-dojo-type\x3d"dijit/form/Select"\x3e\r\n                \x3coption value\x3d"Map Spatial Reference"\x3e${nls.mapSpecialReferenceDropdownOption}\x3c/option\x3e\r\n                \x3coption value\x3d"Latitude/Longitude"\x3e${nls.latLongDropdownOption}\x3c/option\x3e\r\n                \x3coption value\x3d"MGRS"\x3e${nls.mgrsDropdownOption}\x3c/option\x3e\r\n            \x3c/select\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"xyOptions"\x3e\r\n    \x3cdiv class\x3d"esriCTControlWidth"\x3e\r\n        \x3cdiv class\x3d"esriCTSelectTitle" data-dojo-attach-point\x3d"xAttributeTextBoxLabel"\x3e${nls.xAttributeTextBoxLabel}\x3c/div\x3e\r\n        \x3cdiv\x3e\r\n            \x3cdiv aria-label\x3d"${nls.xAttributeTextBoxLabel}" class\x3d"esriCTControlWidth" data-dojo-attach-point\x3d"xAttributeTextBox"  constraints\x3d"{places:\'0,10\', round:-1}" data-dojo-type\x3d"dijit/form/NumberTextBox"\r\n                data-dojo-props\x3d"intermediateChanges:true" trim\x3d"true"\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv style\x3d"padding-bottom: 5px;"\x3e\r\n        \x3cdiv for\x3d"yAttributeTextBox" class\x3d"esriCTSelectTitle" data-dojo-attach-point\x3d"yAttributeTextBoxLabel"\x3e${nls.yAttributeTextBoxLabel}\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTControlWidth"\x3e\r\n            \x3cdiv aria-label\x3d"${nls.yAttributeTextBoxLabel}" class\x3d"esriCTControlWidth" data-dojo-attach-point\x3d"yAttributeTextBox" constraints\x3d"{places:\'0,10\', round:-1}" data-dojo-type\x3d"dijit/form/NumberTextBox"\r\n                data-dojo-props\x3d"intermediateChanges:true" trim\x3d"true"\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"mgrsOptions" class\x3d"esriCTHidden"\x3e\r\n        \x3cdiv class\x3d"esriCTControlWidth"\x3e\r\n            \x3cdiv class\x3d"esriCTSelectTitle"\x3e${nls.mgrsTextBoxLabel}\x3c/div\x3e\r\n            \x3cdiv\x3e\r\n                \x3cdiv aria-label\x3d"${nls.mgrsTextBoxLabel}" class\x3d"esriCTControlWidth" data-dojo-attach-point\x3d"mgrsTextBox"\r\n                    data-dojo-type\x3d"dijit/form/ValidationTextBox" data-dojo-props\x3d"intermediateChanges:false" trim\x3d"true"\x3e\r\n                \x3c/div\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3c/div\x3e',
"url:esri/dijit/templates/LocateButton.html":'\x3cdiv class\x3d"${theme}" role\x3d"presentation"\x3e\r\n    \x3cdiv class\x3d"${_css.container}"\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"_locateNode" role\x3d"button" class\x3d"${_css.locate}" tabindex\x3d"0"\x3e\x3cspan\x3e${_i18n.widgets.locateButton.locate.button}\x3c/span\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e\r\n',"url:jimu/dijit/templates/FeatureSetChooserForMultipleLayers.html":'\x3cdiv class\x3d"jimu-not-selectable"\x3e\r\n  \x3cdiv class\x3d"draw-item-btn" tabindex\x3d"0"\x3e\r\n    \x3cdiv class\x3d"current-draw-item" data-dojo-attach-point\x3d"currentDrawItem"\x3e\r\n      \x3cdiv class\x3d"btn-select" data-dojo-attach-point\x3d"btnSelect"\x3e\r\n        \x3cdiv class\x3d"labels"\x3e\r\n            \x3cdiv class\x3d"feature-action" data-dojo-attach-point\x3d"geoTypeIcon"\x3e\x3c/div\x3e\r\n            \x3cdiv class\x3d"select-text"\x3e\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"arrow feature-action icon-drop-down" data-dojo-attach-event\x3d"click:_onArrowClicked"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"btn-clear" data-dojo-attach-point\x3d"btnClear" tabindex\x3d"0"\x3e\r\n    \x3cdiv class\x3d"feature-action icon-clear-selection"\x3e\x3c/div\x3e\x3cdiv class\x3d"clear-text"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/SmartEditor/copy-features.html":'\x3cdiv class\x3d"esriCTSelectFeaturesContainer"\x3e\r\n  \x3cdiv style\x3d"height: 100%; width: 100%;"\x3e\r\n    \x3cdiv class\x3d"esriCTCopyFeaturesListTitle"\x3e${nls.copyFeatures.title}\x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTCopyFeaturesHint" data-dojo-attach-point\x3d"warningMessage" tabindex\x3d"0" role\x3d"presentation" aria-label\x3d"${nls.copyFeatures.multipleFeatureSaveWarning}"\x3e${nls.copyFeatures.multipleFeatureSaveWarning}\x3c/div\x3e\r\n    \x3cdiv style\x3d"width: 100; margin-bottom: 5px;" data-dojo-attach-point\x3d"applyEditsProgressParentNode"\x3e\x3c/div\x3e\r\n\t\x3cdiv class\x3d"esriCTCopyFeaturesListContent" data-dojo-attach-point\x3d"layerListTable"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTCopyFeaturesBtnContainer"\x3e\r\n      \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"esriCTCopyFeaturesBtn jimu-btn" data-dojo-attach-point\x3d"createMultipleFeaturesBtn" aria-label\x3d"${nls.copyFeatures.createFeatures}" title\x3d"${nls.copyFeatures.createFeatures}"\x3e${nls.copyFeatures.createFeatures}\x3c/div\x3e\r\n      \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"esriCTCopyFeaturesBtn jimu-btn" data-dojo-attach-point\x3d"createSingleFeatureBtn" aria-label\x3d"${nls.copyFeatures.createSingleFeature}"  title\x3d"${nls.copyFeatures.createSingleFeature}"\x3e${nls.copyFeatures.createSingleFeature}\x3c/div\x3e\r\n      \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"esriCTCopyFeaturesBtn jimu-btn" data-dojo-attach-point\x3d"fieldsMatchingBtn" aria-label\x3d"${nls.fieldsMapping.popupTittle}"  title\x3d"${nls.fieldsMapping.popupTittle}"\x3e${nls.fieldsMapping.popupTittle}\x3c/div\x3e\r\n      \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"esriCTCopyFeaturesBtn jimu-btn" data-dojo-attach-point\x3d"cancelBtn" aria-label\x3d"${nls.cancel}" title\x3d"${nls.cancel}"\x3e${nls.cancel}\x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/SmartEditor/fieldsMapping.html":'\x3cdiv style\x3d"width: 100%; height: 100%;" \x3e\r\n    \x3cdiv class\x3d"esriCTBottomSpacing"\x3e\r\n        ${nls.fieldsMapping.informativeText}\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTBottomSpacing"\x3e\r\n        \x3cdiv  data-dojo-attach-point\x3d"fieldsMatchingCheckboxNode"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d\'esriCTFieldsMappingContainer\' data-dojo-attach-point\x3d"fieldsMappingContainer"\x3e\r\n    \r\n    \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/SmartEditor/fieldMap.html":'\x3cdiv class\x3d"esriCTParentNode esriCTBottomSpacing"\x3e\r\n  \x3cdiv class\x3d"esriCTHeader" data-dojo-attach-point\x3d"headerNode"\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTFiledsContainer esriCTHidden" data-dojo-attach-point\x3d"fieldsNode"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"fieldMappingTableWrapper"\x3e\r\n      \x3ctable class\x3d"esriCTFieldsMatchingTable" cellspacing\x3d"5"\x3e\r\n        \x3cthead\x3e\r\n          \x3ctr class\x3d"esriCTFieldsMatchingTableRow"\x3e\r\n            \x3cth class\x3d"esriCTFieldsMatchingTableCell"\x3e${nls.fieldsMapping.fieldsInTargetLayerLabel}\x3c/th\x3e\r\n            \x3cth class\x3d"esriCTFieldsMatchingTableCell"\x3e${nls.fieldsMapping.fieldsInSourceLayerLabel}\x3c/th\x3e\r\n          \x3c/tr\x3e\r\n        \x3c/thead\x3e\r\n        \x3ctbody class\x3d"esriCTFieldsMatchingTableRow" data-dojo-attach-point\x3d"fieldsTbodyNode"\x3e\r\n        \x3c/tbody\x3e\r\n      \x3c/table\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"noFieldsMatching" data-dojo-attach-point\x3d"noFieldsMatching"\x3e\r\n      \x3cspan tabindex\x3d"0" role\x3d"presentation"\x3e${nls.fieldsMapping.noFieldsToMatchLabel}\x3c/span\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/SmartEditor/ValuePicker.html":'\x3cdiv class\x3d"jimu-widget-smartEditor" style\x3d"max-height: 445px;padding: 0 5px;"\x3e\r\n  \x3cdiv class\x3d"esriCTValuePickerHint" data-dojo-attach-point\x3d"valuePickerHint" tabindex\x3d"0"\r\n    aria-label\x3d"${nls.valuePicker.popupHint}" role\x3d"presentation"\x3e\r\n    ${nls.valuePicker.popupHint}\r\n  \x3c/div\x3e\r\n  \x3cdiv style\x3d"width:100%" data-dojo-attach-point\x3d"fieldsContainer"\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',"url:widgets/SmartEditor/requiredFields.html":'\x3cdiv style\x3d"max-height: 445px;padding: 0 5px;"\x3e\r\n    \x3cdiv class\x3d"esriCTValuePickerHint"\x3e\r\n        ${nls.requiredFields.displayMsg}\r\n    \x3c/div\x3e\r\n    \x3cdiv style\x3d"width: 100%;" data-dojo-attach-point\x3d"fieldsDijitContainer"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/SmartEditor/Widget.html":'\x3cdiv style\x3d"width:100%; height:100%; min-width:280px;min-width:240px;"\x3e\r\n    \x3c!--\x3cdiv class\x3d"widgetActive widgetIndicator" id\x3d"widgetActiveIndicator" data-dojo-attach-point\x3d"widgetActiveIndicator"\x3e\x3c/div\x3e--\x3e\r\n    \x3cdiv class\x3d"templatePickerMainDiv"\x3e\r\n\r\n        \x3cdiv id\x3d"templatePickerDiv" class\x3d"templatePickerDiv" data-dojo-attach-point\x3d"templatePickerDiv" tabindex\x3d"-1"\x3e\r\n            \x3c!-- aria-label and tabindex set at runtime --\x3e\r\n            \x3cdiv role\x3d"presentation" data-dojo-attach-point\x3d"templateTitle"\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"spacer"\x3e\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"drawingOptionsDiv"\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"drawingOptionsDiv"\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cbr /\x3e\r\n\r\n        \x3cdiv class\x3d"autoSaveOptionDiv"\x3e\r\n            \x3cdiv\x3e\r\n                \x3cdiv id\x3d"autoSaveSwitch" data-dojo-type\x3d"jimu/dijit/CheckBox" data-dojo-attach-event\x3d"change:_toggleRunTimeAutoSave"\r\n                aria-label\x3d"${nls.autoSaveEdits}" tabindex\x3d"0" checked\x3d"true" label\x3d"${nls.autoSaveEdits}"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv id\x3d"presetFieldsTableDiv" class\x3d"presetFieldsTableDiv" data-dojo-attach-point\x3d"presetFieldsTableDiv"\x3e\r\n            \x3cdiv class\x3d" spacer"\x3e\x3c/div\x3e\r\n            \x3cdiv\x3e\r\n                \x3cdiv id\x3d"savePresetValueSwitch" data-dojo-type\x3d"jimu/dijit/CheckBox" data-dojo-attach-event\x3d"change:_setPresetValue"\r\n                aria-label\x3d"${nls.usePresetValues}" tabindex\x3d"0" label\x3d"${nls.usePresetValues}"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"spacer"\x3e\x3c/div\x3e\r\n            \x3cdiv class\x3d"presetFieldsTable" data-dojo-attach-point\x3d"presetFieldsTableNode"\x3e\x3c/div\x3e\r\n            \x3cdiv class\x3d"spacer"\x3e\x3c/div\x3e\r\n        \x3c/div\x3e\r\n\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"attributeInspectorMainDiv" style\x3d"display:none"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"buttonWrapper" class\x3d"buttonWrapper"\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"cancelButton" tabindex\x3d"0" role\x3d"button" class\x3d"cancelButton jimu-btn"\x3e${nls.back}\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"mainContainer" style\x3d"max-height : calc(100% - 65px); overflow:auto;"\x3e\x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"shelter" data-dojo-type\x3d"jimu/dijit/LoadingShelter" data-dojo-props\x3d\'hidden:true\'\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"attributeInspectorNoFeatureMsg" data-dojo-attach-point\x3d"noFeatureWarningMessage" style\x3d"display:none"\x3e\r\n        \x3cdiv tabindex\x3d"0" role\x3d"presentation" data-dojo-attach-point\x3d"noFeatureMessage"\x3e${nls.noFeatureInAIWarning}\x3c/div\x3e\r\n        \x3cdiv class\x3d"noFeatureCancelBtnWrapper"\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"noFeatureCancelBtn" tabindex\x3d"0" role\x3d"button" class\x3d"noFeatureCancelBtn jimu-btn"\x3e${nls.cancel}\x3c/div\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTCopyFeaturesMainDiv esriCTHidden" data-dojo-attach-point\x3d"copyFeaturesMainNode"\x3e\r\n    \x3c/div\x3e\r\n',
"url:widgets/SmartEditor/css/style.css":'.jimu-widget-sefilterEditor {}.jimu-widget-sefilterEditor .flDropDown {height: 30px!important; width: 100%; margin-top: 2px; margin-bottom: 10px;}.jimu-widget-sefilterEditor .searchtextbox {height: 30px!important; width: 100%; padding: 5px; margin-bottom: 5px;}.seToolbarIcon {background-image: url("../images/toolbar_icons.png"); width: 16px; height: 16px;}.sePointIcon {background-position: 0px 0px;}.sePointIconDisabled {background-position: -16px 0px;}.sePolylineIcon {background-position: -34px 0px;}.sePolylineIconDisabled {background-position: -50px 0px;}.sePolygonIcon {background-position: -69px 0px;}.sePolygonIconDisabled {background-position: -84px 0px;}.seFreehandPolylineIcon {background-position: -101px 0px;}.seFreehandPolylineIconDisabled {background-position: -118px 0px;}.seFreehandPolygonIcon {background-position: -135px 0px;}.seFreehandPolygonIconDisabled {background-position: -152px 0px;}.seRectangleIcon {background-position: -339px 0px;}.seTriangleIcon {background-position: -356px 0px;}.seEllipseIcon {background-position: -373px 0px;}.seCircleIcon {background-position: -390px 0px;}.seArrowIcon {background-position: -407px 0px;}.seArrowDownIcon {background-position: -424px 0px;}.seArrowLeftIcon {background-position: -441px 0px;}.seArrowUpIcon {background-position: -458px 0px;}.seNewSelectionIcon {background-position: -237px 0px;}.seAddToSelectionIcon {background-position: -254px 0px;}.seRemoveFromSelectionIcon {background-position: -271px 0px;}.seClearSelectionIcon {background-position: -288px 0px;}.drawingOptionsDiv .dijitDropDownButton {margin: 0; width: 100%; text-align: left;} .drawingOptionsDiv .dijitDropDownButton .dijitButtonNode {background: transparent; border: 1px solid #7EABCD; padding: 4px; margin-top: 2px; font-weight: bold; box-shadow: none; border-radius: 4px; text-align: left; width: 100%;}.jimu-rtl .drawingOptionsDiv .dijitDropDownButton .dijitButtonNode {text-align: right;}.drawingOptionsDiv .dijitDropDownButton .dijitButtonNode .dijitButtonContents {border-color: transparent;}.drawingOptionsDiv .dijitDropDownButton .dijitButtonNode .dijitInputField {padding: 0 5px;}.drawingOptionsDiv .dijitDropDownButton .dijitButtonNode .dijitArrowButton {background: transparent; border: 0;}.drawingOptionsDiv .dijitDropDownButton .dijitButtonNode.dijitSelectFocused .dijitArrowButton {padding: 0;}.drawingOptionsDiv .dijitDownArrowButton {position: relative;}.drawingOptionsDiv .dijitArrowButtonInner {position: absolute; right: 8px; top: 3px; background-image: none;} .drawingOptionsDiv .dijitArrowButtonInner:after {content: "\\e681"; font-family: \'CalciteWebCoreIcons\' !important; speak: none; font-style: normal; font-weight: bold; font-variant: normal; text-transform: none; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;}div[dijitpopupparent\x3d"drawingTool"] .dijitMenuItemIconCell {width: 20px;}.jimu-widget-smartEditor-setting-relativeDates .esriCTRadioBtn {width: 25%; float: left; text-indent: 20px; padding: 5px 0px 5px 0px;}.jimu-widget-smartEditor-setting-relativeDates .esriCTselectValueLabel {width: 50% !important;}.jimu-widget-smartEditor-setting-relativeDates .esriCTDateTypeLabel {min-width: fit-content;}.jimu-widget-smartEditor-setting-relativeDates .esriCTLabel,.jimu-widget-smartEditor-setting-relativeDates .esriCTFixedContentWrappper {padding: 5px 0px 5px 0px; width: 100%; overflow: hidden;}.jimu-widget-smartEditor-setting-relativeDates .esriCTValueLabel {margin-bottom: 5px;}.jimu-widget-smartEditor-setting-relativeDates .esriCTPastOrFutureDateContent {width: 100%; margin-left: 20px;}.jimu-rtl .jimu-widget-smartEditor-setting-relativeDates .esriCTPastOrFutureDateContent {margin-left: none; margin-right: 20px;}.jimu-widget-smartEditor-setting-relativeDates .esriCTFixedContentLabel {width: 25%; float: left;}.jimu-widget-smartEditor-setting-relativeDates .esriCTFixedContentDijit {width: 75%; float: right;}.jimu-widget-smartEditor-setting-relativeDates .esriCTFloatLeft {width: 33%; float: left;}.jimu-widget-smartEditor-setting-relativeDates .esriCTFloatRight {width: 33%; float: right;}.jimu-widget-smartEditor-setting-relativeDates .esriCTHidden {display: none;}.jimu-widget-smartEditor-setting-relativeDates .esriCTRadioButtonContainer {width: 100%; height: 30px; display: inline-table;}.jimu-widget-smartEditor-setting-relativeDates .esriCTMarginForLabel {width: 100%; padding: 2px 0px 1px 0px; overflow: hidden;}.jimu-widget-smartEditor-setting-relativeDates .esriCTFixedDateContent {width:100%;}.jimu-rtl .jimu-widget-smartEditor-setting-relativeDates .esriCTFloatRight,.jimu-rtl .jimu-widget-smartEditor-setting-relativeDates .esriCTFixedContentDijit {float:left;}.jimu-rtl .jimu-widget-smartEditor-setting-relativeDates .esriCTRadioBtn,.jimu-rtl .jimu-widget-smartEditor-setting-relativeDates .esriCTFixedContentLabel,.jimu-rtl .jimu-widget-smartEditor-setting-relativeDates .esriCTFloatLeft {float: right;}.jimu-widget-smartEditor-setting-relativeDates .esriCTRelativeDatesHint {font-size: 12px; color: #a0acbf; font-style: oblique; width: 100%; margin-top: 5px;}.jimu-widget-smartEditor-setting-relativeDates .esriCTDatesWarningContainer {font-size: 12px; color: red; width: 100%; margin-top: 5px; padding: 5px 0px 5px 0px; overflow: hidden; font-style: italic;}.jimu-widget-smartEditor-setting-relativeDates .esriCTRadioLabel {vertical-align: middle;}.jimu-widget-smartEditor-setting-relativeDates .esriCTPopUpLabel {width: 25%; padding: 0px 10px 0px 0px; word-break: break-word; float: left; line-height: 30px; text-indent: 20px;}.jimu-rtl .jimu-widget-smartEditor-setting-relativeDates .esriCTPopUpLabel {float: right}.jimu-widget-smartEditor-setting-relativeDates .esriCTWrapper {width: 100%; overflow: hidden; margin-bottom: 5px; padding-bottom: 5px;}.jimu-rtl .jimu-widget-smartEditor-setting-relativeDates .esriCTPopupSelect{float: left;}@media (max-width: 600px) {.jimu-widget-smartEditor-setting-relativeDates .esriCTRadioBtn {width: 50%;} .jimu-widget-smartEditor-setting-relativeDates .esriCTFloatLeft {width: 50%;}}@media (max-width: 320px) {.jimu-widget-smartEditor-setting-relativeDates .esriCTRadioBtn {width: 100%;} .jimu-widget-smartEditor-setting-relativeDates .esriCTFloatLeft {width:100%;}}.jimu-widget-smartEditor-setting-relativeDates .esriCTDomainFieldHint {font-size: 13px; color: #a0acbf; font-style: oblique; margin-top: 5px;}.processing-indicator-panel {display: none; width: 100%; height: 100%; z-index: 500; top: 0; left: 0; position: absolute; background-position: center center; background-image: url(../images/busy.gif); background-repeat: no-repeat;} .processing-indicator-panel.busy {display: block;}.jimu-widget-smartEditor {position: relative;}.autoSaveOptionDiv {display:none;} .widgetIndicator {height: 4px; position:absolute; top:0; z-index:1; width:100%; overflow:hidden; overflow-x: hidden;} .widgetActive {background: #73AD21;} .widgetNotActive {background: red; height: 6px;} .jimu-widget-smartEditor .hideField {display: none;} .jimu-widget-smartEditor .templatePicker {position: relative; height: 296px;} .jimu-widget-smartEditor .grid {height: 100% !important;} .jimu-widget-smartEditor .dojoxGridMasterHeader {height: 0 !important;} .jimu-widget-smartEditor .dojoxGridContent {width: 100% !important;} .jimu-widget-smartEditor .dojoxGridContent div[role\x3dpresentation] {right: 0;} .jimu-widget-smartEditor .dojoxGridRowTable {width: 100%;} .jimu-widget-smartEditor .dojoxGridRow {width: 100%;} .jimu-widget-smartEditor .dojoxGridView {width: 100% !important;} .jimu-widget-smartEditor .esriAttributeInspector {height: 20px; width: 100%;} .jimu-widget-smartEditor .esriAttributeInspector td {display: block; clear: both; height: auto; width: 100%; float: left;}.clearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;}.clearfix {display: inline-block;}* html .clearfix {height: 1%;}.clearfix {display: block;}.clear:after {clear: both; content: "."; display: block; height: 0; visibility: hidden;}.jimu-widget-smartEditor .esriAttributeInspector .atiNavButtons {position: absolute; left: 50%; margin-left: -90px;}.jimu-widget-smartEditor .esriAttributeInspector .asteriskIndicator {color: red !important;}.jimu-widget-smartEditor .esriAttributeInspector .saveButton {float: right; display: inline; margin-bottom: 5px;}.jimu-rtl .jimu-widget-smartEditor .esriAttributeInspector .saveButton {float: left; display: inline;}.jimu-widget-smartEditor .esriAttributeInspector .saveButton.hide {display: none;}.jimu-widget-smartEditor .buttonHeader {float: right;}.jimu-rtl .jimu-widget-smartEditor .buttonHeader {float: left;}.jimu-widget-smartEditor .buttonHeader .saveButton {float: right; margin-left: 5px;}.jimu-rtl .jimu-widget-smartEditor .buttonHeader .saveButton {float: left; margin-left: 0px; margin-right: 5px;}.jimu-widget-smartEditor .buttonHeader .deleteButton {float: left;}.jimu-rtl .jimu-widget-smartEditor .buttonHeader .deleteButton {float: right;}.jimu-widget-smartEditor .cancelButton {float: left;}.jimu-rtl .jimu-widget-smartEditor .cancelButton {float: right;}.jimu-widget-smartEditor .noFeatureCancelBtnWrapper {text-align: center;}.jimu-widget-smartEditor .noFeatureCancelBtn {margin-top: 15px;}.jimu-widget-smartEditor .esriAttributeInspector .deleteButton {float: right; margin-right: 20px;}.jimu-rtl .jimu-widget-smartEditor .esriAttributeInspector .deleteButton {float: left; margin-left: 20px;}.jimu-widget-smartEditor .ee-presetValueTableDiv {height: 100%; width: 100%;}.jimu-widget-smartEditor .ee-presetValueHeaderTable {color: #000000; font-size: 14px; padding: 8px; background-color: #E3E3E3; vertical-align: middle; width: 100%;}.jimu-widget-smartEditor .ee-presetValueBodyTable td {display: block; clear: both; height: auto; width: 100%; float: left;}.jimu-widget-smartEditor .esriCTGroupInfoIcon {width: 16px; height: 20px; margin: 0px 2px 2px 0px; background-repeat: no-repeat; background-size: 16px 16px; background-image: url(../images/desc.png); cursor: pointer; float: left;}.jimu-rtl .jimu-widget-smartEditor .esriCTGroupInfoIcon {float: right;}.jimu-widget-smartEditor .ee-atiLabel {width: 100%; margin-bottom: 3px; line-height: 20px;}.jimu-widget-smartEditor .editRelativeDateIcon {margin: 5px auto; height: 20px; width: 20px; float: right; cursor: pointer;}.jimu-rtl .jimu-widget-smartEditor .editRelativeDateIcon {float: left;}.jimu-widget-smartEditor .atiLabel {width: 100%; margin-top: 6px !important; margin-bottom: 3px !important;}.jimu-widget-smartEditor .ee-presetValueBody {vertical-align: top;}.jimu-widget-smartEditor .ee-presetValueBodyTable {width: 100%;}.jimu-widget-smartEditor .ee-presetValue-label-header-field,.jimu-widget-smartEditor .field-alias-label {width: 40%;}.jimu-widget-smartEditor .ee-presetValue-value-header-field,.jimu-widget-smartEditor .preset-value-editable {width: 100%; margin-bottom: 6px;}.jimu-widget-smartEditor .ee-inputField,.jimu-widget-smartEditor-requiredFields .ee-inputField {width: 100%;}.jimu-widget-smartEditor .ee-inputFieldTextArea {width: 100%!important; resize: vertical; overflow: auto; font-family: inherit; line-height: 20px !important; font-size: 14px; min-height: 70px;}.jimu-widget-smartEditor .ee-inputFieldRichText {width: 100%!important; margin: 5px auto;}.jimu-widget-smartEditor .spacer {height: 12px;}.jimu-widget-smartEditor .spacerSmall {height: 8px;}.jimu-widget-smartEditor .attributeInspectorDiv {padding-top: 8px;}.jimu-widget-smartEditor .esriAttributeInspector .atiField {width: 100%;}.jimu-widget-smartEditor .esriAttributeInspector .dijitTextBox {width: 100%!important;}.jimu-widget-smartEditor .esriAttributeInspector .dijitTextArea {width: 100%!important; min-height: 70px; resize: vertical; overflow: auto; font-family: inherit; line-height: 20px !important; font-size: 14px;}.jimu-widget-smartEditor div.atiAttributes table {width: 98%;}.jimu-widget-smartEditor .processing-indicator {display: none; float: right; width: 40px; height: 40px; background-position: center center; background-image: url(../images/busy.gif); background-repeat: no-repeat; z-index: 999;} .jimu-widget-smartEditor .processing-indicator.busy {display: inline;}.jimu-widget-smartEditor .processing-indicator-panel {display: none; width: 100%; height: 100%; z-index: 500; top: 0; left: 0; position: absolute; background-position: center center; background-image: url(../images/busy.gif); background-repeat: no-repeat;} .jimu-widget-smartEditor .processing-indicator-panel.busy {display: block;}.jimu-widget-smartEditor .updateOnlyText {vertical-align: middle; padding: 10px;}.jimu-widget-smartEditor .attInput {padding-top: 3px; padding-bottom: 3px; display: inline-block;}.jimu-widget-smartEditor .deleteAttachment {padding-right: 5px; cursor: pointer; color: red !important; font-weight: bold;}.jimu-widget-smartEditor .atiNavMessage {display: inline-block; float: none;}.jimu-widget-smartEditor .dijitButtonHover .dijitButtonNode {background-color: transparent !important; background-image: none !important; border: none !important; -webkit-box-shadow: none !important; -moz-box-shadow: none !important; box-shadow: none !important;}.jimu-widget-smartEditor .dijitButton .dijitButtonNode {background-color: transparent !important; background-image: none !important; border: none !important; -webkit-box-shadow: none !important; -moz-box-shadow: none !important; box-shadow: none !important;}.jimu-widget-smartEditor .dijitButton {background-color: transparent !important; background-image: none !important; border: none !important; -webkit-box-shadow: none !important; -moz-box-shadow: none !important; box-shadow: none !important;}.dijitCalendarDateTemplate.dijitCalendarCurrentDate .dijitCalendarDateLabel {color: red; border-color: red;}.dijitCalendarDateTemplate.dijitCalendarHoveredDate .dijitCalendarDateLabel,.dijitCalendarDateTemplate.dijitCalendarEnabledDate:hover .dijitCalendarDateLabel {background-color: greenyellow;}.dijitCalendarDateTemplate.dijitCalendarSelectedDate .dijitCalendarDateLabel,.dijitCalendarDateTemplate.dijitCalendarSelectedDate.dijitCalendarHoveredDate .dijitCalendarDateLabel {background-color: cyan;}.jimu-widget-smartEditor .dijitComboBox \x3e div.dijitArrowButton.dijitDownArrowButton {width: 25px !important;}.jimu-widget-smartEditor .dijitTextBox .dijitInputField {height: 100% !important;}.jimu-widget-smartEditor .dijitComboBox \x3e div.dijitArrowButton.dijitDownArrowButton \x3e input {width: 100%;}.jimu-widget-smartEditor .attwarning {margin-top: 2px; color: brown;}.jimu-widget-smartEditor .presetFieldsTableDiv {display: none;}.jimu-widget-smartEditor .buttonWrapper {text-align: center; margin-bottom: 5px; width: 100%; display: inline-block;}.jimu-widget-smartEditor .footerButton {text-align: center; margin-top: 5px;}.jimu-widget-smartEditor .esriAttributeInspector .atiLayerName {display:none;}.jimu-widget-smartEditor .editDescription {padding : 5px 0 5px 0; outline-offset: -1px;}.jimu-widget-smartEditor .esriCTItemListContainer {float: left; width: 100%; height: calc(100% - 30px); overflow-y: auto;} .jimu-widget-smartEditor .esriCTItemTitleContainer {background-color: #f5f5f5; color: #444; cursor: pointer; border: 1px solid #d9d9d9; width: 100%; display: inline-block; float: left;} .jimu-widget-smartEditor .esriCTItemTitleContainer:focus {outline-offset: -2px;} .jimu-widget-smartEditor .esriCTItemTitle {padding: 15px 5px 15px 5px; text-align: left; border: none; outline: none; width: calc(100% - 35px); float: left; white-space: pre-wrap;} .jimu-rtl .jimu-widget-smartEditor .esriCTItemTitle {float: right; text-align: right;} .jimu-rtl .jimu-widget-smartEditor .esriCTItemHighlighter {float: right;} .jimu-widget-smartEditor .esriCTEllipsis {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} .jimu-widget-smartEditor .esriCTItemContent {height: 0px; padding: 0 5px; overflow: hidden; border-right: 1px solid #d9d9d9; border-left: 1px solid #d9d9d9;} .jimu-widget-smartEditor .esriCTRelatedItemContent {border-bottom: 1px solid #d9d9d9;} .jimu-widget-smartEditor .esriCTItemContentActive {height: auto;} .jimu-widget-smartEditor .esriCTItemListImageLogo {height: 24px; width: 24px; margin-top: 10px; float: left; background-position: center center; background-repeat: no-repeat; background-size: 24px; margin-left: 5px;} .jimu-widget-smartEditor .esriCTItemListImageLogo {float: right; margin-left: auto; margin-right: 5px;} .jimu-widget-smartEditor .esriCTBorder {border: 1px solid grey;} .jimu-widget-smartEditor .esriAttributeInspector .atiNavButtons {float: none;} .jimu-widget-smartEditor .buttonContainer {text-align: center; margin-top: 5px;} .jimu-widget-smartEditor .attributeInspectorMainDiv {height: 100%;} .jimu-widget-smartEditor .detailsContainer {height:100%;} .jimu-widget-smartEditor .esriCTItemHighlighter {height: 44px; width: 5px; float: left;} .jimu-widget-smartEditor .itemTitleArrowIcon {height: 20px; width: 20px; background-size: 20px; background-repeat: no-repeat; background-position: center; float: left; margin-top: 13px;} .jimu-rtl .jimu-widget-smartEditor .itemTitleArrowIcon {margin-left: 5px;} .jimu-widget-smartEditor .itemTitleUpArrow {background-image: url(../images/upArrow.png);} .jimu-widget-smartEditor .itemTitleDownArrow {background-image: url(../images/downArrow.png);} .jimu-widget-smartEditor .esriCTDisableToggling .esriCTItemTitleContainer {cursor: default;} .jimu-widget-smartEditor .esriCTDisableToggling .itemTitleUpArrow {background-image: none;} .jimu-widget-smartEditor .relatedTablesContainer {float: left; margin: 3px; width: 100%;} .jimu-rtl .jimu-widget-smartEditor .relatedTablesContainer {float: right;} .jimu-widget-smartEditor .relatedTableTitleContainer {padding: 7px 0px 7px 0px; width: 100%; float: left; border-bottom: 1px solid #d9d9d9; cursor: pointer; line-height: 20px;}.jimu-widget-smartEditor .esriCTRelatedTableTitleDefaultCursor {cursor: default;}.jimu-widget-smartEditor .relatedTableTitle {float: left;}.jimu-rtl .jimu-widget-smartEditor .relatedTableTitle {float: right;}.jimu-widget-smartEditor .relatedTableIcons {height: 20px; width: 20px; background-size: 20px; background-repeat: no-repeat; background-position: center; float: left; margin-left: 10px;}.jimu-widget-smartEditor .esriCTRelatedTableRecordsCount {float: left;}.jimu-widget-smartEditor .esriCTLoadingIcon {background-image: url(\'../images/loading-icon.gif\'); background-position: center center; background-repeat: no-repeat; height: 20px; width: 20px; float: left;}.jimu-rtl .jimu-widget-smartEditor .esriCTRelatedTableRecordsCount {float: right;}.jimu-rtl .jimu-widget-smartEditor .esriCTLoadingIcon {float: right;}.jimu-widget-smartEditor .refreshAttributes {height: 35px; width: 35px; background-size: 35px; background-repeat: no-repeat; background-position: center; float: left; background-image: url(../images/refresh.png); cursor: pointer;}.jimu-widget-smartEditor .esriCTAutoUpdateOnMode {height: 35px; width: 35px; background-size: 35px; background-repeat: no-repeat; background-position: center; float: left; background-image: url(../images/auto-update-on-mode.png); cursor: pointer;}.jimu-widget-smartEditor .esriCTAutoUpdateOffMode {height: 35px; width: 35px; background-size: 35px; background-repeat: no-repeat; background-position: center; float: left; background-image: url(../images/auto-update-off-mode.png); cursor: pointer;}.jimu-widget-smartEditor .esriCTMapNavigationLocked {height: 35px; width: 35px; background-size: 35px; background-repeat: no-repeat; background-position: center; float: left; background-image: url(../images/map-navigation-locked.png); cursor: pointer;}.jimu-widget-smartEditor .esriCTMapNavigationUnLocked {height: 35px; width: 35px; background-size: 35px; background-repeat: no-repeat; background-position: center; float: left; background-image: url(../images/map-navigation-unlocked.png); cursor: pointer;}.jimu-widget-smartEditor .esriCTLocateButtonContainer {height: 35px; width: 35px; background-size: 35px; background-repeat: no-repeat; background-position: center; float: left; background-image: url(../images/locate.png); cursor: pointer;}.jimu-widget-smartEditor .esriCTXYCoordinates {height: 35px; width: 35px; background-size: 35px; background-repeat: no-repeat; background-position: center; float: left; background-image: url(../images/xy-coordinates.png); cursor: pointer;}.jimu-widget-smartEditor .esriCTGeometryEditor {margin-right: 5px;}.jimu-rtl .jimu-widget-smartEditor .refreshAttributes {float: right;}.jimu-rtl .jimu-widget-smartEditor .esriCTAutoUpdateOnMode {float: right;}.jimu-rtl .jimu-widget-smartEditor .esriCTAutoUpdateOffMode {float: right;}.jimu-rtl .jimu-widget-smartEditor .esriCTMapNavigationLocked {float: right;}.jimu-rtl .jimu-widget-smartEditor .esriCTMapNavigationUnLocked {float: right;}.jimu-rtl .jimu-widget-smartEditor .esriCTLocateButtonContainer {float: right;}.jimu-rtl .jimu-widget-smartEditor .esriCTXYCoordinates {float: right;}.jimu-rtl .jimu-widget-smartEditor .esriCTGeometryEditor {margin-left: 5px; margin-right: 0px;}.jimu-widget-smartEditor .itemTitleCreateNew {background-image: url(../images/newFeature.png); cursor: pointer;}.jimu-rtl .jimu-widget-smartEditor .itemTitleCreateNew {float: right; margin-right: 5px; margin-left: 0px;}.jimu-widget-smartEditor .itemTitleNextArrow {-webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -ms-transform: rotate(90deg); -o-transform: rotate(90deg); transform: rotate(90deg); background-image: url(../images/upArrow.png);} .jimu-rtl .jimu-widget-smartEditor .itemTitleNextArrow {-webkit-transform: rotate(270deg); -moz-transform: rotate(270deg); -ms-transform: rotate(270deg); -o-transform: rotate(270deg); transform: rotate(270deg); margin-right: 5px; margin-left: 0px;} .jimu-widget-smartEditor .hidden {display: none;} .dart-panel .jimu-widget-smartEditor .esriCTItemTitleContainer:hover {background-color: #808080;} .dart-panel .jimu-widget-smartEditor .esriCTItemListContainer {border: 1px solid #808080;} .dart-panel .jimu-widget-smartEditor .esriCTItemTitleContainer {background-color: #646464; border-bottom: 1px solid #808080;} .esriCTOverridePanelStyle {height: calc(100% - 20px) !important;} .jimu-widget-smartEditor-XYCoordinates .esriCTHidden {display: none !important;} .jimu-widget-smartEditor-XYCoordinates .esriCTSelectTitle {padding-top: 5px; padding-bottom: 5px; margin-top: 2px;} .jimu-widget-smartEditor-XYCoordinates .esriCTFieldDropdownContainer .claro .dijitSelect {background-color: #f0f0f0; height: 30px;} .jimu-popup .title-label {width: calc(100% - 30px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} .jimu-widget-smartEditor .esriCTCopyFeaturesMainContainer {border: 1px solid #d9d9d9; position: absolute; top: 0; background-color: #fff; height: calc(100% + 5px); width: 100%;} .jimu-widget-smartEditor .esriCTSelectFeaturesContainer {padding: 5px; height: calc(100% - 10px); width: 100%;} .jimu-widget-smartEditor .esriCTCopyFeaturesListTitle {margin-bottom: 5px; font-weight: bold; font-size: 15px;} .jimu-widget-smartEditor .esriCTCopyFeaturesHint {margin-bottom: 5px; font-weight: bold; color: red;} .jimu-widget-smartEditor .esriCTCopyFeaturesListContent {height: calc(100% - 114px); width: 100%; overflow: auto; border-top: 1px solid #d9d9d9; border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; padding: 5px;} .jimu-widget-smartEditor .esriCTCopyFeaturesListContent .jimu-checkbox {align-items: start;} .jimu-widget-smartEditor .esriCTCopyFeaturesNode {margin-bottom: 8px;} .jimu-widget-smartEditor .esriCTCopyFeaturesNode:after {content: ""; display: table; clear: both;} .jimu-widget-smartEditor .esriCTCopyFeaturesChildNode {margin-left: 35px;} .jimu-rtl .jimu-widget-smartEditor .esriCTCopyFeaturesChildNode {margin-right: 35px;} .jimu-widget-smartEditor .esriCTCopyFeaturesBtn {margin-top: 10px; margin-right: 5px; margin-left: 5px; max-width: 150px; width: 45%;} .jimu-widget-smartEditor .esriCTCopyFeaturesBtnContainer {text-align: center; border-bottom: 1px solid #d9d9d9; border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; padding-bottom: 5px;} .jimu-widget-smartEditor .esriCTExpandCollapseNode {float: left; height: 20px; width: 20px; background-size: 20px; background-position: center; background-repeat: no-repeat;} .jimu-rtl .jimu-widget-smartEditor .esriCTExpandCollapseNode {float: right;} .jimu-widget-smartEditor .esriCTCopyFeaturesListContent .expanded {background-image: url(../images/upArrow.png); transform: rotate(180deg); -moz-transform: rotate(180deg) !important; -o-transform: rotate(180deg) !important; -webkit-transform: rotate(180deg) !important; transform: rotate(180deg) !important; -moz-transition: -webkit-transform 00.2s linear; -o-transition: -webkit-transform 00.2s linear; -webkit-transition: -webkit-transform 00.2s linear; transition: transform 00.2s linear;} .jimu-widget-smartEditor .esriCTCopyFeaturesListContent .collapsed {background-image: url(../images/upArrow.png); transform: rotate(90deg); -moz-transform: rotate(90deg) !important; -o-transform: rotate(90deg) !important; -webkit-transform: rotate(90deg) !important; transform: rotate(90deg) !important; -moz-transition: -webkit-transform 00.2s linear; -o-transition: -webkit-transform 00.2s linear; -webkit-transition: -webkit-transform 00.2s linear; transition: transform 00.2s linear;} .jimu-rtl .jimu-widget-smartEditor .esriCTCopyFeaturesListContent .collapsed {transform: rotate(270deg); -moz-transform: rotate(270deg) !important; -o-transform: rotate(270deg) !important; -webkit-transform: rotate(270deg) !important; transform: rotate(270deg) !important; -moz-transition: -webkit-transform 00.2s linear; -o-transition: -webkit-transform 00.2s linear; -webkit-transition: -webkit-transform 00.2s linear; transition: transform 00.2s linear;} .jimu-widget-smartEditor .esriCTHidden {display: none !important;} .jimu-widget-smartEditor .esriCTCopyFeaturesMainDiv {width: 100%; height: 100%; position: absolute; top: 0; left: 0; background-color: #ffffff;} .jimu-widget-smartEditor .esriCTCanCreateOnlyOneFeature {display: none;} .jimu-widget-smartEditor-XYCoordinates .esriCTPopupContainer {padding: 1px;} .jimu-widget-smartEditor-XYCoordinates .esriCTControlWidth {width: 100%} .jimu-popup .content .presetMessageContentDiv:focus {outline: 2px solid #24B5CC !important; outline-offset: -2px;}.jimu-widget-smartEditor .esriCTValuePickerButton {height: 25px; width: 25px; float: right; background-image: url(../images/value-picker.png); background-size: 25px; background-repeat: no-repeat; cursor: pointer; margin-top: 5px;}.jimu-widget-smartEditor .esriCTValuePickerButton.disabled {opacity: 0.4;}.jimu-rtl .jimu-widget-smartEditor .esriCTValuePickerButton {float: left;}.jimu-widget-smartEditor .esriAttributeInspector .multipleValueDijit {width: calc(100% - 35px) !important;}.jimu-widget-smartEditor .esriCTValuePickerHint,.jimu-widget-smartEditor-requiredFields .esriCTValuePickerHint {font-size: 12px; color: #a0acbf; font-style: oblique; margin: 5px 0;}.jimu-widget-smartEditor .esriCTFieldContainer,.jimu-widget-smartEditor-requiredFields .esriCTFieldContainer {margin-bottom: 10px;}.jimu-widget-smartEditor .esriCTFieldName,.jimu-widget-smartEditor-requiredFields .esriCTFieldName {margin-bottom: 3px; font-size: 12px;}.jimu-widget-smartEditor .esriCTFieldName .asteriskIndicator {display: none !important;}.jimu-widget-smartEditor-multiple-value-picker .content-static {margin: 10px 10px 0;}.jimu-widget-smartEditor-multiple-value-picker .esriCTFieldContainer .dijitSelectLabel {overflow: hidden; width: 220px; float: left;}.jimu-widget-smartEditor-multiple-value-picker .esriCTFieldContainer .dijitSelect .dijitInputField {overflow: hidden;}.jimu-widget-smartEditor-multiple-value-picker .esriCTFieldContainer .dijitSelectLabel {text-align: left;}.jimu-rtl .jimu-widget-smartEditor-multiple-value-picker .esriCTFieldContainer .dijitSelectLabel {text-align: right;}.jimu-widget-smartEditor-requiredFields .ee-error {border-color: #d46464 !important; box-shadow: 0px 0px 5px #d46464;}.jimu-widget-smartEditor-requiredFields .esriCTMarginLeft15 {margin-left: 15px;}.jimu-rtl .jimu-widget-smartEditor-requiredFields .esriCTMarginLeft15 {margin-right: 15px; margin-left: 0px;}.claro .dijitSelectLabel,.jimu-widget-smartEditor-fieldsMapping .textLabelEllipsis {text-overflow: ellipsis; text-align: justify; overflow: hidden; vertical-align: middle;}.jimu-widget-smartEditor-XYCoordinates .esriCTFieldInput .dijitSelectLabel {width: 290px;}.jimu-widget-smartEditor-multiple-value-picker .esriCTFieldContainer .dijitSelectLabel {width: 225px;}.jimu-widget-smartEditor-requiredFields .esriCTFieldContainer .dijitSelectLabel {width: 200px;}.jimu-widget-smartEditor-fieldsMapping .esriCTFieldsMappingContainer {width: 100%; height: 100%; max-height: 350px; overflow-y: auto; padding-right: 5px;}.jimu-rtl .jimu-widget-smartEditor-fieldsMapping .esriCTFieldsMappingContainer {padding-left: 5px; padding-right: 0;}.jimu-widget-smartEditor-fieldsMapping .esriCTParentNode {border: 1px solid #a0acbf; border-radius: 3px;}.jimu-widget-smartEditor-fieldsMapping .esriCTHeader {display: inline-block; width: 100%;}.jimu-widget-smartEditor-fieldsMapping .esriCTBottomSpacing {margin-bottom: 8px;}.jimu-widget-smartEditor-fieldsMapping .esriCTLayerName {float: left; margin: 6px 0px; width: calc(100% - 30px); cursor: pointer; word-break: break-all;}.jimu-widget-smartEditor-fieldsMapping .esriCTLayerNameWidthReduced {max-width: calc(100% - 90px);}.jimu-rtl .jimu-widget-smartEditor-fieldsMapping .esriCTLayerName {float: right;}.jimu-widget-smartEditor-fieldsMapping .esriCTResetButton {float: left; margin: 4px; height: 22px; width: 22px; background-size: 22px; background-repeat: no-repeat; background-image: url(../images/reset.png); cursor: pointer;}.esriRtl .jimu-widget-smartEditor-fieldsMapping .esriCTResetButton {float: right;}.jimu-widget-smartEditor-fieldsMapping .esriCTClearButton {float: left; margin: 4px; height: 22px; width: 22px; background-size: 22px; background-repeat: no-repeat; background-image: url(../images/clear.png); cursor: pointer;}.esriRtl .jimu-widget-smartEditor-fieldsMapping .esriCTClearButton {float: right;}.jimu-widget-smartEditor-fieldsMapping .esriCTIconParentNode {float: right;}.esriRtl .jimu-widget-smartEditor-fieldsMapping .esriCTIconParentNode {float: left;}.jimu-widget-smartEditor-fieldsMapping .esriCTFiledsContainer {max-height: 150px; overflow: auto; width: 100%;}.jimu-widget-smartEditor-fieldsMapping .esriCTHidden {display: none;}.jimu-popup\x3e.content {font-size: 14px;}.jimu-widget-smartEditor-fieldsMapping .noFieldsMatching {width: 100%; padding: 10px; text-align: center;}.jimu-widget-smartEditor-fieldsMapping .esriCTArrow {background-image: url("../images/downArrow.png"); height: 20px; width: 20px; float: left; margin: 5px; cursor: pointer;}.esriRtl .jimu-widget-smartEditor-fieldsMapping .esriCTArrow {float: right; -moz-transform: rotate(180deg); -o-transform: rotate(180deg); -webkit-transform: rotate(180deg); transform: rotate(180deg);}.jimu-widget-smartEditor-fieldsMapping .esriCTArrowUp {-moz-transform: rotate(-90deg) !important; -o-transform: rotate(-90deg) !important; -webkit-transform: rotate(-90deg) !important; transform: rotate(-90deg) !important; -moz-transition: -webkit-transform 00.2s linear; -o-transition: -webkit-transform 00.2s linear; -webkit-transition: -webkit-transform 00.2s linear; transition: transform 00.2s linear; background-size: 20px;}.jimu-widget-smartEditor-fieldsMapping .esriCTArrowDown {-moz-transform: rotate(0deg) !important; -o-transform: rotate(0deg) !important; -webkit-transform: rotate(0deg) !important; transform: rotate(0deg) !important; -moz-transition: -webkit-transform 00.2s linear; -o-transition: -webkit-transform 00.2s linear; -webkit-transition: -webkit-transform 00.2s linear; transition: transform 00.2s linear; background-size: 20px;}.jimu-widget-smartEditor-fieldsMapping .esriCTFieldsMatchingTable {width: calc(100% - 10px); table-layout: fixed; margin: 0 5px 5px 5px;}.jimu-widget-smartEditor-fieldsMapping .esriCTFieldsMatchingTableRow {width: 100%}.jimu-widget-smartEditor-fieldsMapping .esriCTFieldsMatchingTableCell {width: 50%;}.claro .jimu-widget-smartEditor-fieldsMapping .dijitSelect, .claro .jimu-widget-smartEditor-fieldsMapping .dijitTextBox {width: 100%;}.jimu-widget-smartEditor-fieldsMapping .esriCTFieldCheckbox {margin: 2px 0 0 2px;}.esriRtl .jimu-widget-smartEditor-fieldsMapping .esriCTFieldCheckbox {margin: 2px 2px 0 0;}@media only screen and (max-width: 40em) {.jimu-widget-smartEditor-fieldsMapping .esriCTFieldsMatchingTable {border-spacing: 0 10px;} .jimu-widget-smartEditor-fieldsMapping .esriCTFieldsMatchingTableRow .esriCTTargetTD {padding: 10px 5px 0 5px; border: 1px solid #a0acbf; border-bottom: none;} .jimu-widget-smartEditor-fieldsMapping .esriCTFieldsMatchingTableRow .esriCTSourceTD {padding: 5px 5px 10px 5px; border: 1px solid #a0acbf; border-top: none;} .jimu-widget-smartEditor-fieldsMapping .esriCTFieldsMatchingTableCell {width: 100%} .jimu-widget-smartEditor-fieldsMapping .esriCTFieldsMatchingTable thead, .jimu-widget-smartEditor-fieldsMapping thead th.esriCTFieldsMatchingTableCell {display: none;} .jimu-widget-smartEditor-fieldsMapping td.esriCTFieldsMatchingTableCell, .jimu-widget-smartEditor-fieldsMapping th.esriCTFieldsMatchingTableCell {display: block;} .jimu-widget-smartEditor-fieldsMapping td.esriCTFieldsMatchingTableCell[data-th]:before {content: attr(data-th);} .jimu-popup .button-container {padding: 15px 15px;} .jimu-popup .content-static {margin: 15px 14px 0;} .jimu-popup\x3e.content {font-size: 12px !important;} .jimu-widget-smartEditor-fieldsMapping .esriCTFieldCheckbox .label {font-size: 12px !important;} .jimu-widget-smartEditor-fieldsMapping .esriCTLayerName {font-size: 12px !important;}}.jimu-rtl .jimu-widget-smartEditor .drawingOptionsDiv .feature-action {margin-left: 2px;}.jimu-rtl .jimu-widget-smartEditor .templatePickerMainDiv .drawingOptionsDiv .dijitArrowButtonInner {left: 8px; right: auto !important;}',
"*now":function(O){O(['dojo/i18n!*preload*widgets/SmartEditor/nls/Widget*["ar","bs","ca","cs","da","de","en","el","es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","nb","nl","pl","pt-br","pt-pt","ro","ru","sk","sl","sr","sv","th","tr","zh-cn","uk","vi","zh-hk","zh-tw","ROOT"]'])},"*noref":1}});
define("dojo/Stateful dojo dijit dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/html dojo/query dojo/aspect dojo/i18n!esri/nls/jsapi dojo/dom dojo/dom-construct dojo/dom-class dojo/dom-style dojo/on dojo/keys dojo/json dojo/topic dijit/_WidgetsInTemplateMixin jimu/BaseWidget jimu/LayerInfos/LayerInfos jimu/dijit/Message esri/request esri/dijit/editing/TemplatePicker esri/dijit/AttributeInspector esri/toolbars/draw esri/toolbars/edit esri/tasks/query esri/graphic esri/layers/FeatureLayer dojo/promise/all dojo/Deferred esri/symbols/SimpleMarkerSymbol esri/symbols/SimpleLineSymbol esri/symbols/SimpleFillSymbol esri/Color esri/geometry/jsonUtils esri/geometry/Polyline esri/geometry/Polygon esri/tasks/RelationshipQuery dijit/registry ./PresetAllFields ./utils ./presetUtils ./presetBuilderBackwardCompatibility ./smartAttributes ./attributeInspectorTools ./relatedTables jimu/dijit/CheckBox dijit/form/Button dijit/form/DropDownButton dijit/DropDownMenu dijit/MenuItem dijit/form/DateTextBox dijit/form/NumberSpinner dijit/form/NumberTextBox dijit/form/FilteringSelect dijit/form/TextBox dijit/form/ValidationTextBox dijit/form/TimeTextBox dijit/Editor dijit/form/SimpleTextarea dojo/store/Memory dojo/date/stamp dojo/dom-attr jimu/dijit/Popup ./AttachmentUploader esri/lang esri/renderers/jsonUtils dojox/html/entities jimu/dijit/EditorXssFilter jimu/utils jimu/portalUtils jimu/portalUrlUtils jimu/SelectionManager ./SEFilterEditor ./SEDrawingOptions ./PrivilegeUtil ./XYCoordinates jimu/dijit/LoadingIndicator esri/tasks/GeometryService esri/geometry/geometryEngine esri/arcgis/Portal ./coordinateUtils ./addressUtils ./Intersection esri/dijit/LocateButton esri/geometry/Point esri/SpatialReference dijit/focus jimu/dijit/FeatureSetChooserForMultipleLayers ./copy-features ./ValuePicker dojo/string ./requiredFields dijit/Tooltip".split(" "),function(O,
B,F,E,f,h,r,c,v,p,g,e,b,a,m,n,l,k,y,u,C,q,w,x,I,A,M,H,U,S,D,L,J,P,R,Y,aa,ea,N,T,ca,ia,Q,W,Z,fa,ka,qa,la,ra,oa,sa,za,Oa,pb,qb,rb,sb,tb,ub,vb,wb,xb,yb,ja,Ja,Ya,La,Za,Pa,$a,Aa,ab,Ta,Ua,bb,Ca,cb,db,Va,eb,fb,Wa,Ma,gb,hb,ib,Na,Qa,Xa,jb,kb,lb,Ga,mb,nb){return E([u,y],{name:"SmartEditor",baseClass:"jimu-widget-smartEditor",_defaultStartStr:"",_defaultAddPointStr:"",_jimuLayerInfos:null,_mapClick:null,settings:null,templatePicker:null,attrInspector:null,editToolbar:null,_isDirty:!1,updateFeatures:[],currentFeature:null,
currentLayerInfo:null,_attrInspIsCurrentlyDisplayed:!1,_ignoreEditGeometryToggle:!1,_editingEnabled:!1,_usePresetValues:!1,_creationDisabledOnAll:!1,_editGeomSwitch:null,_autoSaveRuntime:!1,_userHasPrivilege:!1,_eventHandler:null,_createOverDef:null,featureReductionEnabledLayers:[],rendererDifferentLayers:[],clusterState:!0,_relatedTablesInfo:{},_traversal:[],_nodesCollection:[],_paginationNodeCollection:[],_buttonsWrapper:[],_attributeInspectorCollection:[],contentWrapper:null,viewedFeatureDetails:[],
viewedLayerDetails:[],currentAction:null,_isPresetTableCreated:!1,_layerClearSelectionHandles:[],_layerChangedOutside:!1,_refreshButton:null,_mapNavigation:null,_locateButtonDiv:null,_xyCoordinates:null,_coordinates:null,_selectTool:null,_selectTemplateIndex:0,copyMultipleFeatureGraphics:[],nullAttributeCountRecord:null,requiredFieldsArray:null,_myLocationInfoDef:null,_moveToGPSDef:null,_myLocationInfoForMultipleFeatures:null,canGeocode:!1,_esriLocatorRegExp:/http(s)?:\/\/geocode(.){0,3}\.arcgis.com\/arcgis\/rest\/services\/World\/GeocodeServer/g,
allSelectedGeometries:null,objectIdArr:[],processedChunksCount:0,canAutoUpdate:!0,_chunkSizeForPolygonAndLineGeometry:10,_chunkSizeForPointGeometry:100,fieldMappingDetails:{},postMixInProperties:function(){this.nls=f.mixin(this.nls,window.jimuNls.common);this.nls=f.mixin(this.nls,window.jimuNls.timeUnit)},postCreate:function(){this.inherited(arguments);this.fieldMappingDetails={};this._myLocationInfoForMultipleFeatures=this._moveToGPSDef=this._myLocationInfoDef=null;this._relatedTablesInfo={};this._traversal=
[];this._nodesCollection=[];this._paginationNodeCollection=[];this._buttonsWrapper=[];this._attributeInspectorCollection=[];this.viewedFeatureDetails=[];this.viewedLayerDetails=[];this._isPresetTableCreated=!1;this._layerClearSelectionHandles=[];this._layerChangedOutside=!1;this._selectTool=null;this.editorXssFilter=$a.getInstance();this.copyMultipleFeatureGraphics=[];this.allSelectedGeometries=this.requiredFieldsArray=this.nullAttributeCountRecord=null;this.objectIdArr=[];this.processedChunksCount=
0;this.canAutoUpdate=!0;this.config.editor.hasOwnProperty("expandRelatedTableOnLoad")||(this.config.editor.expandRelatedTableOnLoad=!1);this.config.editor.hasOwnProperty("expandMainLayerOnLoad")||(this.config.editor.expandMainLayerOnLoad=!0);this.own(m(this.cancelButton,"click",f.hitch(this,function(){this._performCancelButtonOperation()})));this.own(m(this.cancelButton,"keydown",f.hitch(this,function(d){d.keyCode!==n.ENTER&&d.keyCode!==n.SPACE||this._performCancelButtonOperation()})));this.own(m(this.noFeatureCancelBtn,
"click",f.hitch(this,function(){a.set(this.noFeatureWarningMessage,"display","none");this._showTemplatePicker();this._setWidgetFirstFocusNode("templatePicker",!0)})));this.own(m(this.noFeatureCancelBtn,"keydown",f.hitch(this,function(d){if(d.keyCode===n.ENTER||d.keyCode===n.SPACE)a.set(this.noFeatureWarningMessage,"display","none"),this._showTemplatePicker(),this._setWidgetFirstFocusNode("templatePicker",!0)})));ja.set(ca.byId("savePresetValueSwitch").domNode,"aria-label",this.nls.usePresetValues);
ja.set(ca.byId("autoSaveSwitch").domNode,"aria-label",this.nls.autoSaveEdits);this.openAtStartAysn=!0},_performCancelButtonOperation:function(){this.config.editor.displayPromptOnSave&&this._validateFeatureChanged()?this._promptToResolvePendingEdit(1<this._traversal.length?!1:!0,null,!0).then(f.hitch(this,function(d){this._addingNewRelatedRecord&&"no"!==d?this._processBackButtonInNewRelatedRecord=!0:this._onCancelButtonClicked();this._setWidgetFirstFocusNode("templatePicker",!0)}),function(){}):this._onCancelButtonClicked()},
_setCancelButtonText:function(){this._traversal&&1<this._traversal.length?(ja.set(this.cancelButton,"innerHTML",this.nls.back),ja.set(this.cancelButton,"aria-label",this.nls.back)):(ja.set(this.cancelButton,"innerHTML",this.nls.clearSelection),ja.set(this.cancelButton,"aria-label",this.nls.clearSelection))},onConfigChanged:function(){this.inherited(arguments);this._onCancelButtonClicked()},_onCancelButtonClicked:function(){if(this.attrInspector){if(this.attrInspector.layerInfos){var d=C.getInstanceSync();
h.forEach(this.attrInspector.layerInfos,function(G){var K=G.featureLayer;K.clearSelection();K.refresh();var V=G.featureLayer.url;G.featureLayer.hasOwnProperty("originalLayerId")&&(layID=G.featureLayer.originalLayerId,G.id!=layID&&(K=G.featureLayer,K.clearSelection(),K.refresh(),G=d.getLayerOrTableInfoById(layID),G.layerObject&&(V=G.layerObject.url)));if(V){var X=V.split("/FeatureServer")[0];h.forEach(d.getLayerInfoArray(),function(ba){"undefined"!==typeof ba.layerObject.url&&null!==ba.layerObject.url&&
ba.layerObject.url.includes("/MapServer")&&ba.layerObject.url.includes(X)&&ba.layerObject.refresh()},this)}})}this.attrInspector.destroy()}e.destroy(this.contentWrapper);e.destroy(this.buttonHeader);this.navButtonsDiv&&e.destroy(this.navButtonsDiv);if(this._attributeInspectorCollection&&0<this._attributeInspectorCollection.length){var t=this._attributeInspectorCollection.pop();t&&(this.attrInspector=t)}this._traversal&&0<this._traversal.length&&this._traversal.pop();0<this._buttonsWrapper.length&&
(this.buttonHeader=this._buttonsWrapper.pop());this._setCancelButtonText();this._unLockMapNavigation();if(this._nodesCollection&&0<this._nodesCollection.length){t=this._nodesCollection.pop();var z=this._paginationNodeCollection.pop();if(t){b.remove(t,"hidden");b.remove(this.buttonHeader,"hidden");a.set(this.attrInspector.attributeTable,"display","block");a.set(this.attrInspector.editButtons,"display","block");void 0!==this.attrInspector._attachmentEditor&&null!==this.attrInspector._attachmentEditor&&
a.set(this.attrInspector._attachmentEditor.domNode,"display","block");a.set(this.attrInspector.deleteBtn.domNode,"display","none");this.attrInspector._featureIdx=this.attrInspector.ctStoredFeatureIndex;this.attrInspector.refresh();setTimeout(f.hitch(this,function(){a.set(this.attrInspector.navButtons,"display",!this.attrInspector._hideNavButtons&&1<this.attrInspector._numFeatures?"":"none");this.attrInspector.navMessage.innerHTML=La.substitute({idx:this.attrInspector._featureIdx+1,of:this.attrInspector.NLS_of,
numFeatures:this.attrInspector._numFeatures},this.attrInspector._navMessage);this._toggleAttrInspectorNavButtons();this.currentFeature=this.attrInspector._numFeatures?this.attrInspector._selection[this.attrInspector._featureIdx]:null;this.currentFeature.preEditAttrs=l.parse(l.stringify(this.currentFeature.attributes));this.currentLayerInfo=this._getLayerInfoByID(this.currentFeature._layer.id);this._relatedTablesInfo&&this._relatedTablesInfo[this.currentFeature._layer.id]&&this._relatedTablesInfo[this.currentFeature._layer.id].updateRelatedRecordsCount();
this._toggleEditGeoSwitch(this.currentLayerInfo.disableGeometryUpdate||!this.currentLayerInfo.configFeatureLayer.layerAllowsUpdate||this.currentLayerInfo.featureLayer.hasZ&&!this.currentLayerInfo.featureLayer.enableZDefaults||this.currentLayerInfo.featureLayer.hasM&&!this.currentLayerInfo.featureLayer.allowUpdateWithoutMValues);1>=this._traversal.length&&(c(".esriCTItemTitle",this.domNode)[0].style.opacity=this.currentFeature&&this.currentFeature.geometry&&this.currentFeature._layer.visibleAtMapScale?
"1":"0.3");this.currentFeature.hasOwnProperty("allowDelete")?this._toggleDeleteButton(this.currentFeature.allowDelete&&this.currentLayerInfo.allowDelete):this._toggleDeleteButton(this.currentLayerInfo.allowDelete);this.currentLayerInfo.featureLayer.visibleAtMapScale&&this.config.editor.hasOwnProperty("editGeometryDefault")&&!0===this.config.editor.editGeometryDefault&&2>this._traversal.length&&this._editGeomSwitch.domNode&&(this._editGeomSwitch.set("checked",!0),this._editGeomSwitch.check());1<=this._traversal.length&&
this._setWidgetFirstFocusNode("AI",!0);this.loading.show();setTimeout(f.hitch(this,function(){!this.attrInspector._attachmentEditor||this.currentLayerInfo.isEditable&&this.currentLayerInfo._editFlag||this._disableAttachments(this.attrInspector._attachmentEditor,!0,!1);this.loading.hide()}),1E3)}),200);this.contentWrapper=t;this.navButtonsDiv=z;return}}this._attrInspIsCurrentlyDisplayed&&!0===this._attrInspIsCurrentlyDisplayed&&this.attrInspector&&0===this.attrInspector._numFeatures&&(this._showTemplate(!0),
this._setWidgetFirstFocusNode("templatePicker",!0));this.map.infoWindow.isShowing&&this.map.infoWindow.hide();this._removeLayerVisibleHandler()},_createCoordinatesPopup:function(){this._coordinates=new db({map:this.map,nls:this.nls,geometryService:this.geometryService});m(this._coordinates,"gotoSelectedLocation",f.hitch(this,function(d){this._getUpdatedLocation(d).then(f.hitch(this,function(t){this.currentFeature.setGeometry(t);this.map.centerAt(t);this.geometryEdited()}),function(){})}))},_getUpdatedLocation:function(d){var t=
new L;var z=parseFloat(d.firstPoint);var G=parseFloat(d.secondPoint);"Map Spatial Reference"===d.coordinateSystem?(d=new Na(z,G,this.map.spatialReference),t.resolve(d)):(d=new Na(G,z,new Qa(4326)),Ma.getProjectedGeometry(d,this.map.spatialReference,this.geometryService).then(f.hitch(this,function(K){t.resolve(K)}),function(){}));return t.promise},_toggleAttrInspectorNavButtons:function(){var d;c(".esriAttrPaginationDiv")&&this._traversal&&(d=c(".esriAttrPaginationDiv")[this._traversal.length-1]);
d&&(this.attrInspector&&1<this.attrInspector._selection.length?(a.set(d,"display","block"),d.nextElementSibling&&(a.set(d.nextElementSibling,"max-height","calc(100% - 65px)"),a.set(d.nextElementSibling,"margin-top","5px"))):(a.set(d,"display","none"),d.nextElementSibling&&(a.set(d.nextElementSibling,"max-height","calc(100% - 40px)"),a.set(d.nextElementSibling,"margin-top","0px"))))},startup:function(){this.inherited(arguments);this._updatedDrawingOptions();if(this.appConfig.geometryService){this.geometryService=
new eb(this.appConfig.geometryService);"TabTheme"===this.appConfig.theme.name&&b.add(this.domNode.parentElement,"esriCTOverridePanelStyle");this._createOverDef=new L;this._getSelectedThemeColor();this.config.editor.hasOwnProperty("displayPresetTop")&&!0===this.config.editor.displayPresetTop&&B.place("presetFieldsTableDiv","templatePickerDiv","before");k.subscribe("smartEditor/validate",f.hitch(this,this._validateEventHandler));this._progressDiv=e.create("div",{"class":"processing-indicator-panel"});
var d=this.getParent().domNode.parentNode;d.insertBefore(this._progressDiv,d.firstChild);this.widgetActiveIndicator=e.create("div",{"class":"widgetActive widgetIndicator"});d.insertBefore(this.widgetActiveIndicator,d.firstChild);void 0===this.config.editor.editDescription||null===this.config.editor.editDescription||"\x3cbr\x3e"===this.config.editor.editDescription?(this.config.editor.editDescription="",this.templateTitle.innerHTML=this.config.editor.editDescription,a.set(this.templateTitle,"display",
"none"),ja.set(this.templateTitle,"tabindex","-1")):(d=this.editorXssFilter.sanitize(this.config.editor.editDescription),this.templateTitle.innerHTML=Pa.decode(d),ja.set(this.templateTitle,"aria-label",Aa.stripHTML(this.config.editor.editDescription)),a.set(this.templateTitle,"display","block"),a.set(this.templateTitle,"font-size","11pt"),ja.set(this.templateTitle,"tabindex","0"));this._orignls=p.widgets.attachmentEditor.NLS_attachments;this.loading=new Va({hidden:!0});this.loading.placeAt(this.domNode);
this.attachmentloading=new Va({hidden:!0});this.loading.placeAt(this.domNode);this.editToolbar=new M(this.map);this.drawToolbar=new A(this.map);setTimeout(f.hitch(this,function(){this._createDrawingToolbar()}),200);this.own(m(this.editToolbar,"graphic-move-stop, rotate-stop, scale-stop, vertex-move-stop, vertex-click",f.hitch(this,this.geometryEdited)));this.own(m(this.drawToolbar,"draw-complete",f.hitch(this,function(t){t.geometry&&t.geometry.rings&&1===t.geometry.rings.length&&4>t.geometry.rings[0].length||
(this.drawToolbar.deactivate(),this._addGraphicToLocalLayer(t))})));this.privilegeUtil=cb.getInstance();this._setTheme();this.shelter.show();C.getInstance(this.map,this.map.itemInfo).then(f.hitch(this,function(t){t.traversalLayerInfosOfWebmap(function(G){G.getLayerObject()});var z="BoxTheme"===this.appConfig.theme.name?1050:1;setTimeout(f.hitch(this,function(){this.initialLoad=!0;this.privilegeUtil.loadPrivileges(this._getPortalUrl()).then(f.hitch(this,function(G){var K=!0;this._user=null;var V=ab.getPortal(this.appConfig.portalUrl),
X=this.privilegeUtil.getUser();this._validateUserInfoAndLocator(V).then(f.hitch(this,function(ba){this.canGeocode=ba;G?X&&(this._user=X.username,K=!0===this.privilegeUtil.userRole.canEditFeatures()?this._initControl(t):!0===this.privilegeUtil.userRole.canEditFeaturesFullControl?this._initControl(t):!1):K=this._initControl(t);this.initialLoad=!1}));!1===K&&this._noPrivilegeHandler(window.jimuNls.noEditPrivileges);this.shelter.hide()}),f.hitch(this,function(){this.initialLoad=!1;this._initControl(t)}));
this.shelter.hide();this._workBeforeCreate()}),z)}))}else q({message:this.nls.geometryServiceURLNotFoundMSG})},_validateUserInfoAndLocator:function(d){var t=new L;if(this._isLocatorRequired())if(this._isEsriLocator(this.config.geocoderSettings.url))if(this._isEsriLocator(this.config.geocoderSettings.url)&&this._isPortalUser(d)){var z=new Wa.Portal("https://www.arcgis.com");this._promptUserForLogin(z).then(f.hitch(this,function(G){t.resolve(G)}))}else this.privilegeUtil.getUser()?this._checkUserPrivileges(this.privilegeUtil.getUser())?
this._hasCredits(this.privilegeUtil.getUser(),d)?this._validateLocatorURL().then(f.hitch(this,function(G){this.userToken=d.credential.token;t.resolve(G)})):(new q({message:Ga.substitute(this.nls.noCreditsOrPrivilegeWarningMessage,{widgetName:this.label})}),t.resolve(!1)):(new q({message:Ga.substitute(this.nls.noCreditsOrPrivilegeWarningMessage,{widgetName:this.label})}),t.resolve(!1)):(z=new Wa.Portal("https://www.arcgis.com"),this._promptUserForLogin(z).then(f.hitch(this,function(G){t.resolve(G)})));
else t.resolve(!0);else t.resolve(!1);return t.promise},_checkUserPrivileges:function(d){var t=!1;d&&d.privileges&&-1!==d.privileges.indexOf("premium:user:geocode")&&-1!==d.privileges.indexOf("premium:user:geocode:stored")&&(t=!0);return t},_isPortalUser:function(d){return d.isPortal},_isLocatorRequired:function(){var d=!1;this.config.hasOwnProperty("geocoderSettings")&&this.config.geocoderSettings&&this.config.geocoderSettings.url&&(d=this._isAddressAttributeActionEnabled());return d},_isAddressAttributeActionEnabled:function(){var d=
!1;this.config.hasOwnProperty("attributeActionGroups")&&0<Object.keys(this.config.attributeActionGroups.Address).length?d=!0:this.config.editor.hasOwnProperty("layerInfos")&&h.some(this.config.editor.layerInfos,f.hitch(this,function(t){if(t.fieldValues)for(var z in t.fieldValues)for(var G=0;G<t.fieldValues[z].length;G++){var K=t.fieldValues[z][G];if(K&&"Address"===K.actionName&&K.enabled)return d=!0}}));return d},_promptUserForLogin:function(d){var t=new L,z=!0,G=new Ja({titleLabel:this.nls.loginPopupTitle,
width:400,maxHeight:200,autoHeight:!0,content:Ga.substitute(this.nls.loginPopupMessage,{widgetName:this.label}),buttons:[{label:this.nls.yes,classNames:["jimu-btn"],onClick:f.hitch(this,function(){z=!1;G.close();this._loginUser(d,!0).then(f.hitch(this,function(K){t.resolve(K)}))})},{label:this.nls.no,classNames:["jimu-btn"],onClick:f.hitch(this,function(){G.close()})}],onClose:f.hitch(this,function(){z&&(new q({message:this.nls.unableToUseLocator}),t.resolve(!1))})});return t.promise},_loginUser:function(d,
t){var z=new L;t?d.signIn().then(f.hitch(this,function(){var G=d.getPortalUser();G&&this._checkUserPrivileges(G)?this._hasCredits(G,d)?this._validateLocatorURL().then(f.hitch(this,function(K){this.userToken=G.credential.token;z.resolve(K)})):(new q({message:Ga.substitute(this.nls.noCreditsOrPrivilegeWarningMessage,{widgetName:this.label})}),z.resolve(!1)):(new q({message:Ga.substitute(this.nls.noCreditsOrPrivilegeWarningMessage,{widgetName:this.label})}),z.resolve(!1))}),f.hitch(this,function(){new q({message:this.nls.unableToUseLocator});
z.resolve(!1)})):z.resolve(!1);return z.promise},_validateLocatorURL:function(){var d=new L;if(""!==this.config.geocoderSettings.url){var t=w({url:this.config.geocoderSettings.url,content:{f:"json"},handleAs:"json"});t.then(function(){d.resolve(!0)},f.hitch(this,function(){d.resolve(!1);new q({message:this.nls.unableToUseLocator})}))}else d.resolve(!1),new q({message:this.nls.locatorDisabledWaning});return d.promise},_hasCredits:function(d,t){var z=0;d&&d.hasOwnProperty("availableCredits")?z=d.availableCredits:
t&&t.hasOwnProperty("availableCredits")&&(z=t.availableCredits);return z},_isEsriLocator:function(d){this._esriLocatorRegExp.lastIndex=0;return this._esriLocatorRegExp.test(d)},geometryEdited:function(){var d=!1,t=!1;this.config.editor.hasOwnProperty("autoSaveAttrUpdates")&&this.config.editor.autoSaveAttrUpdates&&this.currentLayerInfo&&!this.currentLayerInfo.isCache&&(d=!0);this._refreshButton&&this.config.editor.enableAttributeUpdates&&this.config.editor.enableAutomaticAttributeUpdates&&(b.remove(this._refreshButton,
"hidden"),b.contains(this._refreshButton,"esriCTAutoUpdateOnMode")&&(this._refreshAttributes(),t=!0));this.geometryChanged=!0;this._enableAttrInspectorSaveButton(this._validateAttributes());!t&&d&&this._autoSaveFeatureEdits()},_noPrivilegeHandler:function(d){this.templateTitle.innerHTML=d;ja.set(this.templateTitle,"aria-label",d);a.set(this.templateTitle,"display","block");ja.set(this.templateTitle,"tabindex","0");this.templatePicker&&(B.style(this.templatePicker.domNode,"display","none"),this._mapClick&&
(this._mapClick.remove(),this._mapClick=null));this.drawingTool&&B.style(this.drawingTool.domNode,"display","none");this.presetFieldsTableDiv&&B.style(this.presetFieldsTableDiv,"display","none");Aa.initFirstFocusNode(this.domNode,this.templateTitle);Aa.initLastFocusNode(this.domNode,this.templateTitle);Aa.focusFirstFocusNode(this.domNode);this.map.setInfoWindowOnClick(!0);this.shelter.hide()},_getPortalUrl:function(d){return d?Ta.getStandardPortalUrl(d):Ta.getStandardPortalUrl(this.appConfig.portalUrl)},
feature_action_select:function(d,t){t&&d&&0!==d.length&&("active"!==this.state&&this.widgetManager.activateWidget(this),d=d[0],this._validateFeatureChanged()&&this.currentFeature?this.config.editor.displayPromptOnSave&&!0===this.config.editor.displayPromptOnSave?this._promptToResolvePendingEdit(!1,{featureLayer:t,feature:d},!1,!0):this.load_from_featureaction(t,d):this.load_from_featureaction(t,d))},load_from_featureaction:function(d,t){this._clearLayerSelection();this.contentWrapper&&this.contentWrapper.parentNode&&
!b.contains(this.contentWrapper,"hidden")&&(this.contentWrapper.parentNode.removeChild(this.contentWrapper),c(".esriAttrPaginationDiv",this.domNode).forEach(f.hitch(this,function(z){e.destroy(z)})));this._traversal=[];this._nodesCollection=[];this._paginationNodeCollection=[];this._buttonsWrapper=[];this._attributeInspectorCollection=[];this._relatedTablesInfo={};this.currentFeature=null;this.geometryChanged=!1;this.currentLayerInfo=null;this.map.infoWindow.hide();0<this.viewedLayerDetails.length&&
(this.loading.show(),d=this._getLayerInfoByID(this.viewedLayerDetails.shift()),t=this.viewedFeatureDetails.shift(),this._traverseToSelectedFeature(d,t))},_clearLayerSelection:function(){this._attributeInspectorCollection&&0<this._attributeInspectorCollection.length&&h.forEach(this._attributeInspectorCollection,function(t){if(t){if(t.layerInfos){var z=C.getInstanceSync();h.forEach(t.layerInfos,function(G){var K=G.featureLayer;K.clearSelection();K.refresh();var V=G.featureLayer.url;G.featureLayer.hasOwnProperty("originalLayerId")&&
(layID=G.featureLayer.originalLayerId,G.id!=layID&&(K=G.featureLayer,K.clearSelection(),K.refresh(),G=z.getLayerInfoById(layID),G.layerObject&&(V=G.layerObject.url)));if(V){var X=V.split("/FeatureServer")[0];h.forEach(z.getLayerInfoArray(),function(ba){"undefined"!==typeof ba.layerObject.url&&null!==ba.layerObject.url&&ba.layerObject.url.includes("/MapServer")&&ba.layerObject.url.includes(X)&&ba.layerObject.refresh()},this)}})}t.destroy()}});if(this.attrInspector){if(this.attrInspector.layerInfos){var d=
C.getInstanceSync();h.forEach(this.attrInspector.layerInfos,function(t){var z=t.featureLayer;!z.isQueryable()&&0<=z.graphics.length&&z.remove(z.graphics[0]);z.clearSelection();z.refresh();var G=t.featureLayer.url;t.featureLayer.hasOwnProperty("originalLayerId")&&(layID=t.featureLayer.originalLayerId,t.id!=layID&&(z=t.featureLayer,z.clearSelection(),z.refresh(),(t=d.getLayerInfoById(layID))&&t.layerObject&&(G=t.layerObject.url)));if(G){var K=G.split("/FeatureServer")[0];h.forEach(d.getLayerInfoArray(),
function(V){"undefined"!==typeof V.layerObject.url&&null!==V.layerObject.url&&V.layerObject.url.includes("/MapServer")&&V.layerObject.url.includes(K)&&V.layerObject.refresh()},this)}})}this.attrInspector.destroy()}},_traverseToSelectedFeature:function(d,t){var z=new L;if(0<this.viewedFeatureDetails.length){var G=this.viewedFeatureDetails[0];this.viewedLayerDetails[0]===this.viewedLayerDetails[1]&&(G=this.viewedFeatureDetails[1])}this._createAttributeInspector([d],!1,null,z,G);t&&Ua.getInstance().setSelection(d.featureLayer,
t).then(f.hitch(this,function(){this.updateFeatures=d.featureLayer.getSelectedFeatures();0<this.updateFeatures.length&&this._showTemplate(!1)}));z.then(f.hitch(this,function(){if(0<this.viewedLayerDetails.length){var K=this.viewedLayerDetails.shift();this.viewedFeatureDetails.shift();0<this.viewedLayerDetails.length&&this.viewedLayerDetails[0]===K&&(this.viewedLayerDetails.shift(),this.viewedFeatureDetails.shift());(K=c("[layerid\x3d'"+K+"']",this.contentWrapper)[0])&&K.click()}0===this.viewedLayerDetails.length&&
this.loading.hide()}))},_getFeatureIndexToSelect:function(d){var t=-1;var z=d.attributes[d._layer.objectIdField];h.some(this.attrInspector._selection,f.hitch(this,function(G,K){if(G.attributes[G._layer.objectIdField]===z)return t=K,!0}));return t},beginEditingByFeatures:function(d,t,z,G){this._copyFeaturesObj&&(this.currentDrawType=null,this._copyFeaturesObj.cancelBtnClicked());this.cacheLayer&&this.cacheLayer.clear();this.viewedLayerDetails=z;this.viewedFeatureDetails=G;t&&d&&0!==d.length&&this._createOverDef.then(f.hitch(this,
function(){setTimeout(f.hitch(this,function(){this.feature_action_select(d,t)}),this.initialLoad?500:0)}))},onReceiveData:function(d,t,z,G){if(this.config.editor)if("MyLocation"===d&&z.hasOwnProperty("geoLocationResult"))this._moveToGPSDef&&(z.geoLocationResult?this._moveToGPSDef.resolve(z.geoLocationResult):this._fetchCurrentLocation()),this._myLocationInfoDef&&(z.geoLocationResult?this._myLocationInfoDef.resolve(z.geoLocationResult):this._fetchCurrentLocation());else{if(("Select"===d||"AttributeTable"===
d)&&z&&z.hasOwnProperty("selectionInfo")&&!this._attrInspIsCurrentlyDisplayed){var K=this._getFeaturesToBeSelectedInAI(z.selectionInfo);this.initialLoad&&0<Object.keys(K.selectionInfo).length?this._promptUserToShowSelectionInAI(K.selectionInfo,K.layers):this._showAttributeInspector(K.selectionInfo,K.layers)}else if(("Select"===d||"AttributeTable"===d)&&z&&z.hasOwnProperty("selectionInfo")&&this._attrInspIsCurrentlyDisplayed){t=!0;for(K in z.selectionInfo)z.selectionInfo[K]&&0<z.selectionInfo[K].length&&
(t=!1);t&&(B.query(".jimu-widget-smartEditor .attributeInspectorMainDiv")[0].style.display="none",this._attrInspIsCurrentlyDisplayed=!1,a.set(this.noFeatureWarningMessage,"display","block"),this._setWidgetFirstFocusNode("noFeatures",!0));this.updateFeatures=this.attrInspector._selection}this.config.editor.hasOwnProperty("listenToGF")&&!0===this.config.editor.listenToGF&&"GroupFilter"===d&&(Array.isArray(z.message)?0<z.message.length&&h.forEach(z.message,f.hitch(this,function(V){V.hasOwnProperty("fields")&&
V.hasOwnProperty("values")&&(V.hasOwnProperty("groupName")?this._setPresetValueValue(null,V.values[0],V.groupName):h.forEach(V.fields,function(X){this._setPresetValueValue(X,V.values[0],null)},this))})):z.message.hasOwnProperty("fields")&&z.message.hasOwnProperty("values")&&(z.message.hasOwnProperty("groupName")?this._setPresetValueValue(null,z.message.values[0],z.message.groupName):h.forEach(z.message.fields,function(V){this._setPresetValueValue(V,z.message.values[0],null)},this)))}},_getFeaturesToBeSelectedInAI:function(d){var t=
{},z=[];h.forEach(this.config.editor.configInfos,f.hitch(this,function(G){G._editFlag&&(z.push(G),d[G.layerInfo.id]&&0<d[G.layerInfo.id].length&&(t[G.layerInfo.id]=d[G.layerInfo.id]))}));return{selectionInfo:t,layers:z}},_promptUserToShowSelectionInAI:function(d,t){var z=new Ja({titleLabel:this.nls.showSelectionInAITitle,width:400,maxHeight:200,autoHeight:!0,content:Ga.substitute(this.nls.showSelectionInAIMsg,{widgetName:this.label}),buttons:[{label:this.nls.yes,classNames:["jimu-btn"],onClick:f.hitch(this,
function(){this._showAttributeInspector(d,t);z.close()})},{label:this.nls.no,classNames:["jimu-btn"],onClick:f.hitch(this,function(){z.close()})}]})},_showAttributeInspector:function(d,t){if(0<Object.keys(d).length){this.updateFeatures=[];this._createAttributeInspector(t);for(var z in d){t=this._jimuLayerInfos.getLayerInfoById(z);var G=new H;G.objectIds=d[z];t.layerObject.selectFeatures(G,S.SELECTION_NEW,f.hitch(this,function(K){this.updateFeatures=K;0<this.updateFeatures.length&&!this._attrInspIsCurrentlyDisplayed&&
(this._showTemplate(!1),this._setWidgetFirstFocusNode("AI",!0),this._connectLayerSelectionClearedOutside())}),f.hitch(this,function(){this.loading.hide()}))}}},_setTheme:function(){var d;if("DartTheme"===this.appConfig.theme.name)Aa.loadStyleLink("dartOverrideCSS",this.folderUrl+"/css/dartTheme.css",null);else if(d=document.getElementById("dartOverrideCSS"))d.disabled=!0;if("LaunchpadTheme"===this.appConfig.theme.name)Aa.loadStyleLink("launchpadOverrideCSS",this.folderUrl+"/css/launchpadTheme.css",
null);else if(d=document.getElementById("launchpadOverrideCSS"))d.disabled=!0;if("DashboardTheme"===this.appConfig.theme.name)Aa.loadStyleLink("dashboardOverrideCSS",this.folderUrl+"/css/dashboardTheme.css",null);else if(d=document.getElementById("dashboardOverrideCSS"))d.disabled=!0},_mapClickHandler:function(d){if(!0===d&&!1===this._attrInspIsCurrentlyDisplayed){if(this.map.setInfoWindowOnClick(!1),void 0===this._mapClick||null===this._mapClick)this._mapClick=m(this.map,"click",f.hitch(this,this._onMapClick))}else!0===
d&&!0===this._attrInspIsCurrentlyDisplayed?(this._mapClick&&(this._mapClick.remove(),this._mapClick=null),this.map.setInfoWindowOnClick(!0)):(this._mapClick&&(this._mapClick.remove(),this._mapClick=null),this.map.setInfoWindowOnClick(!0),this.drawToolbar&&this.drawToolbar.deactivate())},destroy:function(){this.inherited(arguments);this.attrInspector&&(this.attrInspector.layerInfos&&h.forEach(this.attrInspector.layerInfos,function(t){t=t.featureLayer;t.clearSelection();t.refresh()}),this.attrInspector.destroy());
this.attrInspector=null;this.templatePicker&&this.templatePicker.destroy();this.templatePicker=null;this.currentDrawType&&(this.currentDrawType=null);if(null!==this._menus&&void 0!==this._menus){for(var d in Ca)this._menus.hasOwnProperty(d)&&null!==this._menus[d]&&void 0!==this._menus[d]&&this._menus[d].destroyRecursive(!1);this._menus={}}null!==this.drawingTool&&void 0!==this.drawingTool&&(this.drawingTool.destroyRecursive(!1),this.drawingTool=null);this._enableFeatureReduction();this._removeLocalLayers();
this._copyFeaturesObj&&this._copyFeaturesObj.highlightGraphicsLayer&&this._copyFeaturesObj.highlightGraphicsLayer.clear();this._copyFeaturesObj&&this._copyFeaturesObj.fieldsMappingObj&&this._copyFeaturesObj.fieldsMappingObj.fieldsPopup&&this._copyFeaturesObj.fieldsMappingObj.fieldsPopup.close();this.inherited(arguments)},onActive:function(){if(!0===this._userHasPrivilege&&(b.contains(this.widgetActiveIndicator,"widgetNotActive")&&b.remove(this.widgetActiveIndicator,"widgetNotActive"),b.add(this.widgetActiveIndicator,
"widgetActive"),this.map&&(this._disableFeatureReduction(),this.templatePicker&&this.templatePicker.update(),this._mapClickHandler(!0),this._disconnectLayerSelectionClearedOutside(),!1===this._attrInspIsCurrentlyDisplayed))){var d=null;this.drawingTool&&this.currentDrawType&&(d=this.currentDrawType);this._activateTemplateToolbar(d)}},_enableFeatureReduction:function(){!1===this.clusterState&&(h.forEach(this.featureReductionEnabledLayers,function(d){d.isFeatureReductionEnabled()||d.enableFeatureReduction()}),
h.forEach(this.rendererDifferentLayers,function(d){d._layerRenderer&&(d.setRenderer(d._layerRenderer),d.redraw())}),this.clusterState=!0)},_disableFeatureReduction:function(){!0===this.clusterState&&(h.forEach(this.featureReductionEnabledLayers,function(d){d.isFeatureReductionEnabled()&&d.disableFeatureReduction()}),h.forEach(this.rendererDifferentLayers,function(d){d._serviceRendererJson&&(d.setRenderer(Za.fromJson(d._serviceRendererJson)),d.redraw())}),this.clusterState=!1)},_handleLayerSelectionClear:function(d){d&&
d.layerInfos&&h.forEach(d.layerInfos,f.hitch(this,function(t){if(t.featureLayer){var z=m(t.featureLayer,"selection-clear",f.hitch(this,this._onLayerSelectionCleared));this.own(z);t=m(t.featureLayer,"selection-complete",f.hitch(this,function(){this._attrInspIsCurrentlyDisplayed&&0===this.attrInspector._numFeatures&&(c(".jimu-widget-smartEditor .attributeInspectorMainDiv")[0].style.display="none",this._attrInspIsCurrentlyDisplayed=!1,a.set(this.noFeatureWarningMessage,"display","block"),this._setWidgetFirstFocusNode("noFeatures",
!0))}));this.own(t);this._layerClearSelectionHandles.push(z);this._layerSelectionCompleteHandles.push(t)}}))},_onLayerSelectionCleared:function(){this._LayerSelectionClearedTimer&&clearTimeout(this._LayerSelectionClearedTimer);this._LayerSelectionClearedTimer=setTimeout(f.hitch(this,function(){this._layerChangedOutside||(this._layerChangedOutside=!0,this.noFeatureWarningMessage&&a.set(this.noFeatureWarningMessage,"display","none"),this._navigateToMain())}),100)},_navigateToMain:function(){this._attrInspIsCurrentlyDisplayed=
!1;this._showTemplatePicker();this._traversal=[];this._nodesCollection=[];this._paginationNodeCollection=[];this._buttonsWrapper=[];this._attributeInspectorCollection=[];this._relatedTablesInfo={};this.currentFeature=null;this.geometryChanged=!1;this.currentLayerInfo=null},_connectLayerSelectionClearedOutside:function(){this._layerChangedOutside=!1;this._disconnectLayerSelectionClearedOutside();this._attrInspIsCurrentlyDisplayed&&(this._attributeInspectorCollection&&0<this._attributeInspectorCollection.length&&
h.forEach(this._attributeInspectorCollection,f.hitch(this,function(d){d&&this._handleLayerSelectionClear(d)})),this.attrInspector&&this._handleLayerSelectionClear(this.attrInspector))},_disconnectLayerSelectionClearedOutside:function(){this._layerClearSelectionHandles&&0<this._layerClearSelectionHandles.length&&h.forEach(this._layerClearSelectionHandles,f.hitch(this,function(d){d.remove()}));this._layerSelectionCompleteHandles&&0<this._layerSelectionCompleteHandles.length&&h.forEach(this._layerSelectionCompleteHandles,
f.hitch(this,function(d){d.remove()}));this._layerClearSelectionHandles=[];this._layerSelectionCompleteHandles=[]},onDeActive:function(){b.contains(this.widgetActiveIndicator,"widgetActive")&&b.remove(this.widgetActiveIndicator,"widgetActive");b.add(this.widgetActiveIndicator,"widgetNotActive");this.map&&this._mapClickHandler(!1);this._enableFeatureReduction();this._connectLayerSelectionClearedOutside()},onOpen:function(){!0===this._userHasPrivilege&&(this._workBeforeCreate(),setTimeout(f.hitch(this,
function(){this.widgetManager.activateWidget(this)}),100));if(this.templatePicker){var d;this.templatePicker.update();(d=c(".esriTemplatePicker",this.domNode))&&d[0]&&("none"===a.get(d[0],"display")?c(".presetFieldsTableDiv")[0].style.display="none":this.config.hasOwnProperty("attributeActionGroups")&&0<Object.keys(this.config.attributeActionGroups.Preset).length&&!b.contains(c(".ee-presetValueTableDiv",this.domNode)[0],"esriCTHidden")&&(c(".presetFieldsTableDiv")[0].style.display="block"),this._attrInspIsCurrentlyDisplayed?
this._setWidgetFirstFocusNode("AI",!0):this._setWidgetFirstFocusNode("templatePicker",!0))}},_addNewLayersInConfig:function(){var d=[],t=[];h.forEach(this.config.editor.configInfos,f.hitch(this,function(z){d.push(z.featureLayer.id)}));h.forEach(this._jimuLayerInfos.getLayerInfoArray(),f.hitch(this,function(z){if(-1===d.indexOf(z.id)&&z.layerObject.url&&"Feature Layer"===z.layerObject.type&&this._isValidLayer(z)){var G={};G=Q.createDefaultConfigInfo(z);G._editFlag&&(G.layerInfo=z,G.configFeatureLayer=
G.featureLayer,G.featureLayer=G.layerInfo.layerObject,G.allowDelete=G.configFeatureLayer.layerAllowsDelete||!1,t.push(G))}}));0<t.length&&(t.reverse(),h.forEach(t,f.hitch(this,function(z){this.config.editor.configInfos.splice(0,0,z)})))},_getTableInfos:function(){var d=[],t=this._jimuLayerInfos.getTableInfoArray();h.forEach(t,function(z){d.push(z.getLayerObject())},this);return D(d)},_initControl:function(d){this._userHasPrivilege=!0;this._jimuLayerInfos=d;this._jimuLayerInfos.onlayerInfosChanged=
f.hitch(this,function(t,z){if(!this.config.editor.hasOwnProperty("editAddDataLayers")||!0===this.config.editor.editAddDataLayers){var G=!1;if("added"===z){if(z=this._doesLayerExist(t.id).layerExist,-1===t.id.indexOf("_lfl")&&"Feature Layer"===t.layerObject.type&&t.layerObject.url&&!z&&this._isValidLayer(t)){var K={},V;K=Q.createDefaultConfigInfo(t);K._editFlag&&(K.layerInfo=t,K.configFeatureLayer=K.featureLayer,K.featureLayer=K.layerInfo.layerObject,K.allowDelete=K.configFeatureLayer.layerAllowsDelete||
!1,K.showDeleteButton=!1,this.config.editor.configInfos.splice(0,0,K),G=!0,this.own(m(K.featureLayer,"visibility-change, scale-visibility-change",f.hitch(this,function(){this._layerScaleClearedTimer&&clearTimeout(this._layerScaleClearedTimer);this._layerScaleClearedTimer=setTimeout(f.hitch(this,function(){this._createEditor(!1)}),200)}))))}}else"removed"===z&&h.some(this.config.editor.configInfos,f.hitch(this,function(X,ba){if(X.featureLayer.id===t.id)return V=t,this.config.editor.configInfos.splice(ba,
1),G=!0,this.attrInspector&&this._attrInspIsCurrentlyDisplayed&&this._removeFeaturesFromAI(t.id),!0}));G&&(this.templatePicker?(z=this._getEditableLayers(this.config.editor.configInfos,!1),0===z.length?(this._creationDisabledOnAll=!0,this._showOrHideMainScreenTools(!0),this.drawToolbar&&this.drawToolbar.deactivate(),this.templatePicker&&(this._mapClickHandler(!0),this._clearTemplateSelection()),this._checkForLayersInTemplatePicker()):(this._creationDisabledOnAll=!1,this._showOrHideMainScreenTools(!1),
this._isPresetTableCreated||this._createPresetTable(this.config.editor.configInfos),this.templatePicker.attr("featureLayers",z),this.templatePicker.update(),this.templatePicker.clearSelection())):this._createEditor(),!0===this.config.editor.useFilterEditor&&this.templatePicker&&this._filterEditor&&(K?this._filterEditor.addNewLayerInEditor(K.featureLayer):this._filterEditor.removeLayerFromEditor(V)),this._setWidgetFirstFocusNode("templatePicker",!0))}});this._getTableInfos();this.addressUtils=new gb({config:this.config,
canGeocode:this.canGeocode,nls:this.nls,userToken:this.userToken,appConfig:this.appConfig});d=20;this.config.editor.hasOwnProperty("defaultPixelsTolerance")&&(d=this.config.editor.defaultPixelsTolerance);this._intersectionUtils=new hb({_jimuLayerInfos:this._jimuLayerInfos,map:this.map,defaultToleranceSettings:this.config.editor.defaultToleranceSettings,defaultPixelsTolerance:d});d=!1;this.config.editor&&this.config.editor.layerInfos&&(d=0<this.config.editor.layerInfos.length);this.config.editor.hasOwnProperty("honorWebMapConfiguration")&&
this.config.editor.honorWebMapConfiguration&&(d=!1);this.config.editor.configInfos=Q.getConfigInfos(this._jimuLayerInfos,this.config.editor.layerInfos,!1,d);!1===d&&h.forEach(this.config.editor.configInfos,function(t){t._editFlag=!0});this.config.editor.hasOwnProperty("editAddDataLayers")&&!0===this.config.editor.editAddDataLayers&&this._addNewLayersInConfig();this.config.editor.hasOwnProperty("honorWebMapConfiguration")&&this.config.editor.honorWebMapConfiguration&&h.forEach(this.config.editor.configInfos,
f.hitch(this,function(t){this._updateConfigWithDefaultWebMapSettings(t)}));if(void 0===this.config.editor.configInfos||null===this.config.editor.configInfos||0===this.config.editor.configInfos.length)return!1;this._processConfig();h.forEach(this.config.editor.configInfos,function(t){t.featureLayer.name=t.layerInfo.title;t=t.featureLayer;var z=t.renderer,G=z.toJson(),K=l.parse(t._json);K.hasOwnProperty("layerDefinition")&&(K=K.layerDefinition);var V=null;K.hasOwnProperty("drawingInfo")&&K.drawingInfo.hasOwnProperty("renderer")&&
(V=K.drawingInfo.renderer);t._layerRenderer=z;t._serviceRendererJson=V;t.hasFeatureReduction&&t.hasFeatureReduction()?this.featureReductionEnabledLayers.push(t):G.hasOwnProperty("type")&&"heatmap"==G.type&&this.rendererDifferentLayers.push(t)},this);this._disableFeatureReduction();this.config.editor.hasOwnProperty("autoSaveEdits")?this.config.editor.autoSaveEdits&&((this._autoSaveRuntime=this.config.editor.autoSaveEdits)?ca.byId("autoSaveSwitch").set("checked",!0):ca.byId("autoSaveSwitch").set("checked",
!1)):this.config.editor.autoSaveEdits=!1;this._createEditor();this.fetchDataByName("GroupFilter");this.widgetManager.activateWidget(this);this._createOverDef.resolve();this._setWidgetFirstFocusNode("templatePicker",!0);this.fetchDataByName("Select");this.fetchDataByName("AttributeTable");return!0},_showOrHideMainScreenTools:function(d){var t=d?"none":"block";this.templatePicker&&(B.style(this.templatePicker.domNode,"display",t),this.config.editor.autoSaveEdits&&this._createAutoSaveSwitch(!d));this.drawingTool&&
B.style(this.drawingTool.domNode,"display",t);this._filterEditor&&B.style(this._filterEditor.domNode,"display",t);this._isPresetTableCreated&&(c(".presetFieldsTableDiv")[0].style.display=t)},_doesLayerExist:function(d){var t=!1,z;h.some(this.config.editor.configInfos,f.hitch(this,function(G){if(G.featureLayer.id===d)return t=!0,z=G,!0}));return{layerExist:t,layerInfo:z}},_isValidLayer:function(d){var t=!1;d.layerObject&&d.layerObject.infoTemplate&&h.some(d.layerObject.infoTemplate.info.fieldInfos,
f.hitch(this,function(z){if(this._isValidField(d,z)&&z.visible)return t=!0}));return t},_isValidField:function(d,t){d=d.layerObject.getField(t.fieldName);t=!1;d&&"esriFieldTypeGeometry"!==d.type&&"esriFieldTypeOID"!==d.type&&"esriFieldTypeBlob"!==d.type&&"esriFieldTypeGlobalID"!==d.type&&"esriFieldTypeRaster"!==d.type&&"esriFieldTypeXML"!==d.type&&(t=!0);return t},_removeFeaturesFromAI:function(d){var t=new H;var z=this._getLayerAndFeaturesToRemove(d);t.objectIds=z.objectIds;this.AINext.pause();0<
z.objectIds.length?z.layer.selectFeatures(t,S.SELECTION_SUBTRACT,f.hitch(this,function(){setTimeout(f.hitch(this,function(){-1<this._traversal.indexOf(d)&&this._traversal.pop();this.AINext.resume();this._refreshLayerTitle()}),500)},function(){setTimeout(f.hitch(this,function(){this.AINext.resume();this._refreshLayerTitle()}),500)})):this.currentLayerInfo.isCache&&d===this.currentLayerInfo.featureLayer.id&&(this.AINext.resume(),this._showTemplate(!0))},_getLayerAndFeaturesToRemove:function(d){var t,
z=[];(this._attributeInspectorCollection&&this._attributeInspectorCollection[0]||this.attrInspector)._selection.forEach(f.hitch(this,function(G){G._layer.id===d&&(t=G._layer,z.push(G.attributes[t.objectIdField]))}));return{layer:t,objectIds:z}},_updateConfigWithDefaultWebMapSettings:function(d,t){t&&(d.layerInfo=this._jimuLayerInfos.getLayerOrTableInfoById(d.featureLayer.id));var z=Q.createDefaultConfigInfo(d.layerInfo);f.mixin(d,z);d.fieldInfos=Q.getDefaultEditableFieldInfos(d.layerInfo,!1);d.fieldInfos=
h.filter(d.fieldInfos,function(G){return"esriFieldTypeBlob"===G.type||"esriFieldTypeGlobalID"===G.type||"esriFieldTypeRaster"===G.type||"esriFieldTypeXML"===G.type||"esriFieldTypeOID"===G.type?!1:!0});d.allowDelete=z.featureLayer.layerAllowsDelete;t&&(d.configFeatureLayer=d.featureLayer,d.featureLayer=d.layerInfo.layerObject,d.showDeleteButton=!1);d.relationshipInfos&&h.forEach(d.relationshipInfos,f.hitch(this,function(G){this._updateConfigWithDefaultWebMapSettings(G,!0)}))},_addFilterEditor:function(d){if(!0===
this.config.editor.useFilterEditor&&this.templatePicker)if(this._filterEditor)this._filterEditor.setTemplatePicker(this.templatePicker,d);else{var t=!1;this.config.editor.hasOwnProperty("groupFilteredTemplates")&&(t=this.config.editor.groupFilteredTemplates);this._filterEditorNode=e.create("div",{});this.templatePickerDiv.insertBefore(this._filterEditorNode,this.templatePicker.domNode);this._filterEditor=new bb({_templatePicker:this.templatePicker,_layers:d,map:this.map,nls:this.nls,gpFilterTemplates:t},
this._filterEditorNode)}},_activateEditToolbar:function(d){var t=d.getLayer();0!==this.editToolbar.getCurrentState().tool&&this.editToolbar.deactivate();switch(t.geometryType){case "esriGeometryPoint":this.editToolbar.activate(M.MOVE,d);break;case "esriGeometryPolyline":case "esriGeometryPolygon":this.editToolbar.activate(M.EDIT_VERTICES|M.MOVE|M.ROTATE|M.SCALE,d)}},_polygonToPolyline:function(d){var t=new ea;h.forEach(d.rings,function(z){t.addPath(z)});t.spatialReference=d.spatialReference;return t},
_addRelatedFeatureToLocalLayer:function(d,t){var z,G=null;this.attrInspector&&this.attrInspector._attachmentUploader&&null!==this.attrInspector._attachmentUploader&&this.attrInspector._attachmentUploader.clear();this._removeLocalLayers();this.cacheLayer=this._cloneLayer(d.featureLayer.layerObject);var K=m(this.cacheLayer,"load",f.hitch(this,function(){K.remove();G=this._getLayerInfoForLocalLayer(this.cacheLayer);z=[G];this._createAttributeInspector([G],!0,d.featureLayer.layerObject,null,null,t);var V=
f.clone(d.attributes);this._usePresetValues&&this._modifyAttributesWithPresetValues(V,z[0],null,t);var X=new U(null,null,V);X.preEditAttrs=l.parse(l.stringify(X.attributes));this.cacheLayer.applyEdits([X],null,null,f.hitch(this,function(ba){var ha=new H;ha.objectIds=[ba[0].objectId];this.cacheLayer.selectFeatures(ha,S.SELECTION_NEW,f.hitch(this,function(){this.currentFeature=this.updateFeatures[0]=X;this.getConfigDefaults();this.geometryChanged=!1;this._attributeInspectorTools&&this._attributeInspectorTools.triggerFormValidation();
var ma=this.currentFeature.getLayer();this.currentLayerInfo=this._getLayerInfoByID(ma.id);this.currentLayerInfo.isCache=!0;this._toggleDeleteButton(!1);this._enableAttrInspectorSaveButton(this._validateAttributes(),!0);this._toggleAttrInspectorNavButtons()}))}));this._showTemplate(!1,!1);this.config.editor.hasOwnProperty("autoSaveEdits")&&!0===this._autoSaveRuntime&&setTimeout(f.hitch(this,function(){this._autoSaveFeatureEdits()}),100)}))},_getCopyAttributes:function(d,t){var z=[],G={};var K=new L;
var V=new L;var X=!1,ba=!1,ha=!1,ma;for(ma in d.fieldValues){for(var da=d.fieldValues[ma],na=0;na<da.length;na++)"Address"===da[na].actionName&&da[na].enabled&&(X=!0),"Intersection"===da[na].actionName&&da[na].enabled&&(ba=!0),"Coordinates"===da[na].actionName&&da[na].enabled&&da[na].hasOwnProperty("coordinatesSource")&&"myLocation"===da[na].coordinatesSource&&(ha=!0);if(X&&ba&&ha)break}ba&&z.push(this._intersectionUtils.getDistinctLayers(d,t));z.push(V);Ma.getCoordinatesData(t,this.geometryService).then(f.hitch(this,
function(pa){G.Coordinates=pa;this._getMyLocationInfo(ha).then(f.hitch(this,function(wa){G.MyLocation=wa;X?this.addressUtils.locateAddress(pa.MapSpatialReference).then(f.hitch(this,function(ua){G.Address=ua;V.resolve(G)})):(G.Address={},V.resolve(G))}))}),f.hitch(this,function(){G.Coordinates={};G.Address={};G.MyLocation={Coordinates:{}};V.resolve(G)}));D(z).then(f.hitch(this,function(pa){ba?(G.Intersection=pa[0].result,G.multipleValues=pa[0].multipleValues):(G.Intersection={},G.multipleValues=void 0);
K.resolve(G)}));return K.promise},_getMyLocationInfo:function(d){var t=new L,z={Coordinates:{}};if(this._myLocationInfoForMultipleFeatures)return t.resolve(this._myLocationInfoForMultipleFeatures),t;d?(this._myLocationInfoDef=new L,this._getNewCurrentLocation(),this._myLocationInfoDef.then(f.hitch(this,function(G){this._myLocationInfoDef=null;if(G.error&&G.error.message)console.log(G.error.message),t.resolve(z);else if(G&&G.graphic&&G.graphic.geometry){var K=G.graphic.geometry;"NaN"!==G.graphic.geometry.x&&
"NaN"!==G.graphic.geometry.y?Ma.getCoordinatesData(K,this.geometryService).then(function(V){z.Coordinates=V;t.resolve(z)}):(G=G.graphic.attributes.position.coords,Ma.getCoordinatesDataWhenXYEmpty({x:G.longitude,y:G.latitude}).then(function(V){z.Coordinates=V;t.resolve(z)}))}}),f.hitch(this,function(){t.resolve(z)}))):t.resolve(z);return t},_addGraphicToLocalLayer:function(d,t){var z=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeDouble","esriFieldTypeSingle"];if(void 0!==this.templatePicker&&
null!==this.templatePicker&&this.templatePicker.getSelected()){var G=this.templatePicker.getSelected(),K,V=null;this.attrInspector&&(this.attrInspector._attachmentUploader&&null!==this.attrInspector._attachmentUploader&&this.attrInspector._attachmentUploader.clear(),this.attrInspector.destroy(),this.attrInspector=null);this._removeLocalLayers();this.cacheLayer=this._cloneLayer(this.templatePicker.getSelected().featureLayer);var X=m(this.cacheLayer,"load",f.hitch(this,function(){X.remove();this.cacheLayer.setSelectionSymbol(this._getSelectionSymbol(this.cacheLayer.geometryType,
!0));V=this._getLayerInfoForLocalLayer(this.cacheLayer);K=[V];this._createAttributeInspector([V],!0,this.templatePicker.getSelected().featureLayer);this.config.editor.hasOwnProperty("editGeometryDefault")&&!0===this.config.editor.editGeometryDefault&&setTimeout(f.hitch(this,function(){2>this._traversal.length&&(this._editGeomSwitch.set("checked",!0),this._editGeomSwitch.check())}),100);var ba=f.clone(G.template.prototype.attributes);"esriGeometryPolyline"===this.cacheLayer.geometryType&&"polygon"===
d.geometry.type&&(d.geometry=this._polygonToPolyline(d.geometry));this.loading.show();this._getCopyAttributes(V,d.geometry).then(f.hitch(this,function(ha){if(t){var ma=f.clone(t),da=G.featureLayer.id;if(d.layer&&d.layer.id)var na=d.layer.id;if(na&&this.fieldMappingDetails[da]&&this.fieldMappingDetails[da][na])for(var pa in ba){var wa,ua;if((!ba.hasOwnProperty(pa)||null===ba[pa]||this.config.editor.overrideDefaultsByCopiedFeature)&&(ua=this.fieldMappingDetails[da][na][pa])&&ma.hasOwnProperty(ua)){var Ea=
this.templatePicker.getSelected().featureLayer.getField(pa);this._jimuLayerInfos.getLayerInfoById(na)&&this._jimuLayerInfos.getLayerInfoById(na).layerObject&&(wa=this._jimuLayerInfos.getLayerInfoById(na).layerObject.getField(ua));if(wa&&wa.domain&&wa.domain.codedValues&&!Ea.domain)h.some(wa.domain.codedValues,f.hitch(this,function(xa){if(xa.code===ma[ua])return-1!==z.indexOf(Ea.type)?ba[pa]=xa.code:ba[pa]=xa.name,!0}));else if(wa&&"esriFieldTypeDate"===wa.type&&"esriFieldTypeDate"!==Ea.type&&ma[ua]){var va=
this._getPopupFieldInfo(ua,this._jimuLayerInfos.getLayerInfoById(na));ba[pa]=Aa.getDateTimeStrByFieldInfo(ma[ua],va)}else ba[pa]=ma[ua]}}else for(va in ma)if(!ba.hasOwnProperty(va)||null===ba[va]||this.config.editor.overrideDefaultsByCopiedFeature)ba[va]=ma[va]}this._modifyAttributesWithPresetValues(ba,K[0],ha);this.loading.hide();var ya=new U(d.geometry,null,ba);ya.preEditAttrs=l.parse(l.stringify(ya.attributes));this.cacheLayer.applyEdits([ya],null,null,f.hitch(this,function(xa){var ta=new H;ta.objectIds=
[xa[0].objectId];this.cacheLayer.selectFeatures(ta,S.SELECTION_NEW,f.hitch(this,function(){this.currentFeature=this.updateFeatures[0]=ya;this.getConfigDefaults();this.geometryChanged=!1;this._attributeInspectorTools&&this._attributeInspectorTools.triggerFormValidation();var Ba=this.currentFeature.getLayer();this.currentLayerInfo=this._getLayerInfoByID(Ba.id);this.currentLayerInfo.isCache=!0;this._toggleDeleteButton(!1);this._enableAttrInspectorSaveButton(this._validateAttributes());(Ba=c(".esriAttrPaginationDiv",
this.domNode))&&Ba[0]&&a.set(Ba[0],"display","none");setTimeout(f.hitch(this,function(){this._addValuePicker(ha)}),200)}))}));this._showTemplate(!1,!1);this.config.editor.hasOwnProperty("autoSaveEdits")&&!0===this._autoSaveRuntime&&setTimeout(f.hitch(this,function(){this._autoSaveFeatureEdits()}),100)}))}))}},_cancelEditingFeature:function(d){this.currentFeature&&(d?this._showTemplate(!0,!1):(this.currentFeature.preEditAttrs&&(this.currentFeature.attributes=l.parse(l.stringify(this.currentFeature.preEditAttrs))),
this.currentFeature.origGeom&&(this.currentFeature.geometry=aa.fromJson(this.currentFeature.origGeom)),this.currentFeature.getLayer().refresh(),this.attrInspector.refresh(),this._resetEditingVariables()))},_addDateFormat:function(d){d&&d.format&&null!==d.format&&d.format.dateFormat&&null!==d.format.dateFormat&&0<=d.format.dateFormat.toString().toUpperCase().indexOf("TIME")&&(d.format.time=!0)},_processLayerFields:function(d){h.forEach(d,function(t){void 0!==t.domain&&null!==t.domain&&void 0!==t.domain.type&&
null!==t.domain.type&&"range"===t.domain.type&&!1===t.domain.hasOwnProperty("range")&&(t.domain.range=[t.domain.minValue,t.domain.maxValue])});return d},_iterateCollection:function(d){return function(t){for(var z=0;d[z];z++)t(d[z],z)}},_cloneLayer:function(d){var t=this._processLayerFields(d.fields);t={layerDefinition:{id:0,name:d.name+this.nls.editorCache,type:"Feature Layer",displayField:d.displayField,description:"",copyrightText:"",relationships:[],geometryType:d.geometryType,minScale:0,maxScale:0,
extent:d.fullExtent,drawingInfo:{renderer:d.renderer,transparency:0,labelingInfo:null},hasAttachments:d.hasAttachments,htmlPopupType:"esriServerHTMLPopupTypeAsHTMLText",objectIdField:d.objectIdField,globalIdField:d.globalIdField,typeIdField:d.typeIdField,fields:h.map(t,function(G){return-1<G.name.indexOf("expression/expr")?l.stringify(G):G.toJson()}),types:d.types&&h.map(d.types,function(G){return G.toJson()}),templates:d.templates&&h.map(d.templates,function(G){return G.toJson()}),capabilities:"Create,Delete,Query,Update,Uploads,Editing",
editFieldsInfo:void 0===d.editFieldsInfo?null:d.editFieldsInfo}};var z=d.fields.map(function(G){return G.name});this._eventHandler=this.own(m(d,"visibility-change",f.hitch(this,function(){})));t=new S(t,{id:d.id+"_lfl",outFields:z});t.visible=!0;t.renderer=d.renderer;t.originalLayerId=d.id;t._wabProperties={isTemporaryLayer:!0};this.map.addLayer(t);return t},_endsWith:function(d,t){return-1!==d.indexOf(t,d.length-t.length)},_validateEventHandler:function(){this._enableAttrInspectorSaveButton(this._validateAttributes())},
_validateAttributes:function(d){d="undefined"!==typeof d&&null!==d?d:!0;var t=[],z=!0,G=this._validateRequiredFields(),K=this._validateFeatureChanged(),V=[],X=!0;void 0!==this._smartAttributes&&null!==this._smartAttributes&&(V=this._smartAttributes.toggleFields(d));void 0!==this._attributeInspectorTools&&null!==this._attributeInspectorTools&&(X=this._attributeInspectorTools.formValid());K&&this.currentLayerInfo&&this.currentLayerInfo.attachmentValidations&&(h.forEach(this.currentLayerInfo.attachmentValidations.Actions,
f.hitch(this,function(ba){var ha={};ba.filter&&this._smartAttributes&&(ha.actionType=ba.actionName,ha.result=this._smartAttributes.processFilter(ba.filter),t.push(ha))})),this.attrInspector._attachmentUploader?z=this.performAction(this.attrInspector._attachmentUploader,t,!0):this.attrInspector._attachmentEditor&&(z=this.performAction(this.attrInspector._attachmentEditor,t,!1)));return Q.isObjectEmpty(G)&&0===V.length&&X&&K&&z},performAction:function(d,t,z){var G=!0;a.set(this.attrInspector.attachmentsRequiredMsg,
"display","none");h.some(t,f.hitch(this,function(K){switch(K.actionType){case "Hide":if(K.result)return this.currentAction=K.actionType,d.currentAction=K.actionType,a.set(d.domNode,"display","none"),!0;a.set(d.domNode,"display","block");break;case "Disabled":if(K.result)return this.currentAction=K.actionType,d.currentAction=K.actionType,z?a.set(d.domNode,"display","none"):this._disableAttachments(d,!0,z),!0;this._disableAttachments(d,!1,z);a.set(d.domNode,"display","block");break;case "Required":if(K.result)return this.currentAction=
K.actionType,d.currentAction=K.actionType,a.set(d.domNode,"display","block"),this._hasAddedAnyAttachments(d,z)?(G=!0,a.set(this.attrInspector.attachmentsRequiredMsg,"display","none")):(G=!1,a.set(this.attrInspector.attachmentsRequiredMsg,"display","block")),!0;this.currentAction=null;d.currentAction=null}}));this._setWidgetFirstFocusNode("AI",!1);return G},_disableAttachments:function(d,t,z){var G=t?"none":"block";z||(t=this.attrInspector._attachmentEditor.domNode,c(".attwarning",t)[0]&&a.set(c(".attwarning",
t)[0],"display",G),a.set(d._uploadForm,"display",G),h.forEach(d._attachmentList.childNodes,f.hitch(this,function(K){"#text"!==K.nodeName&&(K=c(".deleteAttachment",K)[0])&&a.set(K,"display",G)})))},_onUpdateAttachmentListAdd508Support:function(){this.attrInspector&&this.attrInspector._attachmentEditor&&v.after(this.attrInspector._attachmentEditor,"_updateConnects",f.hitch(this,function(){this._add508SupportToAttachmentsDeleteBtn()}))},_add508SupportToAttachmentsDeleteBtn:function(){this._support508ToDeleteButtonTimer&&
clearInterval(this._support508ToDeleteButtonTimer);this._support508ToDeleteButtonTimer=setInterval(f.hitch(this,function(){clearInterval(this._support508ToDeleteButtonTimer);this.attrInspector._attachmentEditor&&this.attrInspector._attachmentEditor._attachmentList&&h.forEach(this.attrInspector._attachmentEditor._attachmentList.childNodes,f.hitch(this,function(d){if("#text"!==d.nodeName){var t=c(".deleteAttachment",d)[0];t&&(ja.set(t,"role","button"),ja.set(t,"tabindex","0"),ja.set(t,"aria-label",
this.nls.deleteAttachment),this.own(m(t,"keydown",f.hitch(this,function(z){z.keyCode!==n.ENTER&&z.keyCode!==n.SPACE||t.click()}))))}}))}),300)},_hasAddedAnyAttachments:function(d,t){var z=!1;if(!t)return 0<d._attachmentList.childNodes.length&&"#text"!==d._attachmentList.childNodes[0].nodeName?!0:!1;for(t=0;t<d._attachmentList.childNodes.length;t++)if(d._attachmentList.childNodes[t].childNodes&&0<d._attachmentList.childNodes[t].childNodes.length&&d._attachmentList.childNodes[t].childNodes[1].value&&
0<d._attachmentList.childNodes[t].childNodes[1].value.length){z=!0;break}return z},_toggleEditGeoSwitch:function(d){var t=!1;void 0===this._editGeomSwitch||null===this._editGeomSwitch||1<this._traversal.length||(!1===d&&this.currentLayerInfo.featureLayer.visibleAtMapScale?this.currentLayerInfo&&this.currentLayerInfo._editFlag?(B.style(this._editGeomSwitch.domNode.parentNode,"display","block"),t=!0):(B.style(this._editGeomSwitch.domNode.parentNode,"display","none"),t=!1):(B.style(this._editGeomSwitch.domNode.parentNode,
"display","none"),t=!1),this._turnEditGeometryToggleOff(),setTimeout(f.hitch(this,function(){t=t&&this._editGeomSwitch.checked;this._toggleAttributeButtonVisibility(t);this._toggleLocateButtonVisibility(t);this._toggleXYCoordinatesButtonVisibility(t);this._toggleMapNavigationButtonVisibility(t)}),500))},_recordLoadeAttInspector:function(){this.getConfigDefaults()},editGeoCheckChange:function(){return function(){this._editGeometry(this._editGeomSwitch.checked)}},_attributeInspectorChangeRecord:function(d){this._validateFeatureChanged()&&
this.currentFeature?this.currentLayerInfo.isCache&&(this.currentLayerInfo.isCache=!1):this._postFeatureSave(d);this._recordLoadeAttInspector()},_addWarning:function(){if(0===c(".attwarning",this.attrInspector.domNode).length){var d=e.create("div",{"class":"attwarning"});d.innerHTML=this.nls.attachmentSaveDeleteWarning;void 0!==this.attrInspector._attachmentEditor&&null!==this.attrInspector._attachmentEditor&&this.attrInspector._attachmentEditor.domNode.appendChild(d)}},_hasAnyEditableLayerInRelation:function(d){var t=
!1;h.forEach(d,f.hitch(this,function(z){if(t)return!0;!0===z._editFlag?t=!0:z.relationshipInfos&&0<z.relationshipInfos.length&&(t=this._hasAnyEditableLayerInRelation(z.relationshipInfos))}));return t},_processRelationAndShowAttrInspector:function(d,t,z,G,K,V){var X;this.contentWrapper&&this.contentWrapper.parentNode&&!b.contains(this.contentWrapper,"hidden")&&(this.contentWrapper.parentNode.removeChild(this.contentWrapper),this.navButtonsDiv&&this.navButtonsDiv.parentNode&&this.navButtonsDiv.parentNode.removeChild(this.navButtonsDiv));
this.contentWrapper=e.create("div",{"class":"detailsContainer"},this.mainContainer);this.navButtonsDiv=e.create("div",{"class":"esriAttributeInspector esriAttrPaginationDiv"});V||(e.place(this.attrInspector.navButtons,this.navButtonsDiv,"first"),e.place(this.navButtonsDiv,this.mainContainer,"before"));var ba=e.create("div",{"class":"esriCTItemListContainer"},this.contentWrapper);t&&t.feature&&(z=t.feature._layer,this.currentFeature&&z.id===this.currentFeature._layer.id&&this.currentFeature.setSymbol(this._getSelectionSymbol(this.currentFeature.getLayer().geometryType,
!1)),this.currentFeature=t.feature,this.currentFeature.preEditAttrs=l.parse(l.stringify(this.currentFeature.attributes)),this.currentLayerInfo=this._getLayerInfoByID(z.id),this.currentFeature.setSymbol(this._getSelectionSymbol(this.currentFeature.getLayer().geometryType,!0)),this._toggleDeleteButton(this.attrInspector._currentLInfo.allowDelete),this.loading.show(),setTimeout(f.hitch(this,function(){!this.attrInspector._attachmentEditor||this.currentLayerInfo.isEditable&&this.currentLayerInfo._editFlag&&
(!this.currentLayerInfo||this.currentLayerInfo.configFeatureLayer.layerAllowsUpdate)||this._disableAttachments(this.attrInspector._attachmentEditor,!0,!1);this.loading.hide()}),2E3),setTimeout(f.hitch(this,function(){this.config.editor.hasOwnProperty("editGeometryDefault")&&!0===this.config.editor.editGeometryDefault&&2>this._traversal.length&&this.currentFeature&&this.currentFeature.geometry&&(this.currentFeature.origGeom=this.currentFeature.geometry.toJson(),!this.currentLayerInfo.disableGeometryUpdate&&
this.currentLayerInfo.featureLayer.visibleAtMapScale&&this.currentLayerInfo.configFeatureLayer.layerAllowsUpdate&&(!this.currentLayerInfo.featureLayer.hasZ||this.currentLayerInfo.featureLayer.hasZ&&this.currentLayerInfo.featureLayer.enableZDefaults)&&(!this.currentLayerInfo.featureLayer.hasM||this.currentLayerInfo.featureLayer.hasM&&this.currentLayerInfo.featureLayer.allowUpdateWithoutMValues)?this._activateEditToolbar(this.currentFeature):0!==this.editToolbar.getCurrentState().tool&&(this.editToolbar.deactivate(),
this._editingEnabled=!1))}),1E3));z&&(X=this.addItem(z.name,this.config.editor.expandMainLayerOnLoad,ba,z.id,V,z,!0));if(d&&t.feature){0<this._traversal.length?this._traversal[this._traversal.length-1]=t.feature._layer.id:this._traversal.push(t.feature._layer.id);z=this._getRelationshipInfo(t.feature);d={attributes:f.clone(t.feature.attributes),_layer:t.feature._layer};if(K){var ha=[];h.forEach(K,function(da){ha.push(da.attributes[da._layer.objectIdField])})}if(z&&0<z.length){var ma=[];h.forEach(z,
f.hitch(this,function(da){var na=da._editFlag;!da._editFlag&&da.relationshipInfos&&0<da.relationshipInfos.length&&(na=this._hasAnyEditableLayerInRelation(da.relationshipInfos));na&&da.featureLayer&&da.hasOwnProperty("relationshipId")&&ma.push(da)}));0<ma.length&&((K=c(".esriCTItemContent",ba))&&K[0]&&b.remove(K[0],"esriCTRelatedItemContent"),this._relatedTablesInfo[t.feature._layer.id]={},this._relatedTablesInfo[t.feature._layer.id]=new qa({relationshipInfo:ma,layerInfosObj:this._jimuLayerInfos,parentFeature:d,
parentFeatureIndexInAI:this.attrInspector._featureIdx,parentFieldInfos:this.currentLayerInfo.fieldInfos,config:this.config,nls:this.nls,mapSpatialReference:this.map.spatialReference},e.create("div")),this.own(m(this._relatedTablesInfo[t.feature._layer.id],"addRelatedRecord",f.hitch(this,function(da,na,pa,wa,ua){b.add(this.contentWrapper,"hidden");b.add(this.buttonHeader,"hidden");a.set(this.navButtonsDiv,"display","none");this.attrInspector.ctStoredFeatureIndex=wa;this._attributeInspectorCollection.push(this.attrInspector);
this._nodesCollection.push(this.contentWrapper);this._buttonsWrapper.push(this.buttonHeader);this._paginationNodeCollection.push(this.navButtonsDiv);this._traversal.push(pa);this.currentRelatedDom=na;this._addRelatedFeatureToLocalLayer(da,ua);this._addingNewRelatedRecord=!0}))),this.own(m(this._relatedTablesInfo[t.feature._layer.id],"titleClicked",f.hitch(this,function(da,na,pa,wa,ua,Ea){this.addNewRelatedRecord&&(pa=!0,this.addNewRelatedRecord=!1);this._editGeomSwitch.set("checked",!1);!pa&&this.currentFeature&&
this.config.editor.displayPromptOnSave&&this._validateFeatureChanged()?this._promptToResolvePendingEdit(!1,null,!0).then(f.hitch(this,function(){this._fetchRelatedRecords(pa,t.feature._layer,na,da,ua,wa,ha,Ea);ha=null}),function(){}):(this._fetchRelatedRecords(pa,t.feature._layer,na,da,ua,wa,ha,Ea),ha=null)}))),this.own(m(this._relatedTablesInfo[t.feature._layer.id],"addRelatedItemContent",f.hitch(this,function(da){da?this.addItem(this.nls.relatedItemTitle,this.config.editor.expandRelatedTableOnLoad,
ba,null,!1,null,!1):(da=c(".esriCTItemContent",ba))&&da[0]&&b.add(da[0],"esriCTRelatedItemContent")}))),this._relatedTablesInfo[t.feature._layer.id].startup())}else this.config.editor.expandMainLayerOnLoad||this._togglePanel(X)}G&&G.resolve()},_checkValidRelationShips:function(d,t){h.forEach(d,f.hitch(this,function(z){z.featureLayer&&z.hasOwnProperty("relationshipId")&&h.some(t.relationships,f.hitch(this,function(G){}))}))},_fetchRelatedRecords:function(d,t,z,G,K,V,X,ba){this._getRelatedRecordsByRelatedQuery(t,
z,G,K).then(f.hitch(this,function(ha){if(ha&&0===ha.length)d&&(b.remove(this.contentWrapper,"hidden"),this.attrInspector.refresh(),setTimeout(f.hitch(this,function(){a.set(this.attrInspector.navButtons,"display",!this.attrInspector._hideNavButtons&&1<this.attrInspector._numFeatures?"":"none");this.attrInspector.navMessage.innerHTML=La.substitute({idx:this.attrInspector._featureIdx+1,of:this.attrInspector.NLS_of,numFeatures:this.attrInspector._numFeatures},this.attrInspector._navMessage);this.currentFeature=
this.attrInspector._numFeatures?this.attrInspector._selection[this.attrInspector._featureIdx]:null;this.currentFeature.preEditAttrs=l.parse(l.stringify(this.currentFeature.attributes))}),200));else if(b.add(this.contentWrapper,"hidden"),a.set(this.navButtonsDiv,"display","none"),this.attrInspector.ctStoredFeatureIndex=V,this._attributeInspectorCollection.push(this.attrInspector),this._nodesCollection.push(this.contentWrapper),this._buttonsWrapper.push(this.buttonHeader),this._paginationNodeCollection.push(this.navButtonsDiv),
this._traversal.push(G),X&&(ha=[],ha=X,X=null),ha&&0<ha.length){var ma=new H;ma.objectIds=ha;if(0<this.viewedLayerDetails.length){var da=new L;ha=this.viewedFeatureDetails[0];this.viewedLayerDetails[0]===this.viewedLayerDetails[1]&&(ha=this.viewedFeatureDetails[1]);this._createAttributeInspector([this._getLayerInfoByID(G)],!1,null,da,ha,ba)}else this._createAttributeInspector([this._getLayerInfoByID(G)],!1,null,null,null,ba);ha=this._jimuLayerInfos.getLayerOrTableInfoById(G).layerObject;this.loading.show();
ha.selectFeatures(ma,S.SELECTION_NEW,f.hitch(this,function(na){if(this._addingNewRelatedRecord&&this._processBackButtonInNewRelatedRecord||d)this.currentFeature=null;this.updateFeatures=na;d?this.attrInspector.last():this.attrInspector.first();this.currentFeature=this.attrInspector._numFeatures?this.attrInspector._selection[this.attrInspector._featureIdx]:null;this.currentFeature.preEditAttrs=l.parse(l.stringify(this.currentFeature.attributes));0<this.updateFeatures.length&&this._showTemplate(!1);
this._addingNewRelatedRecord&&this._processBackButtonInNewRelatedRecord&&(this._processBackButtonInNewRelatedRecord=this._addingNewRelatedRecord=!1,this._onCancelButtonClicked());this.loading.hide()}),f.hitch(this,function(){this.loading.hide()}));da&&da.then(f.hitch(this,function(){if(0<this.viewedLayerDetails.length){var na=this.viewedLayerDetails.shift();this.viewedFeatureDetails.shift();0<this.viewedLayerDetails.length&&this.viewedLayerDetails[0]===na&&(this.viewedLayerDetails.shift(),this.viewedFeatureDetails.shift());
c("[layerid\x3d'"+na+"']",this.contentWrapper)[0].click()}0===this.viewedLayerDetails.length&&this.loading.hide()}))}}))},_createAttributeInspector:function(d,t,z,G,K,V){if(2>this._traversal.length&&(this._editGeomSwitch&&(this._editGeomSwitch.destroy(),this._editGeomSwitch=null),this.editSwitchDiv))for(;this.editSwitchDiv.firstChild;)this.editSwitchDiv.removeChild(this.editSwitchDiv.firstChild);this._setCancelButtonText();V&&h.forEach(d[0].fieldInfos,f.hitch(this,function(da){da.name===V&&(da.isEditable=
!1)}));this.config.editor.hasOwnProperty("canSwitchToMultilineInput")&&this.config.editor.canSwitchToMultilineInput&&h.forEach(d,f.hitch(this,function(da){da.fieldInfos&&h.forEach(da.fieldInfos,f.hitch(this,function(na){"esriFieldTypeString"===na.type&&(!na.hasOwnProperty("stringFieldOption")||"textbox"===na.stringFieldOption)&&this.config.editor.maxLimitToMultilineTextBox<na.length&&(na.stringFieldOption="textarea")}))}));this.attrInspector=Q.ATI({layerInfos:d},r.create("div",{style:{width:"100%",
height:"100%"}}));this.attrInspector.startup();this._onUpdateAttachmentListAdd508Support();e.place(this.attrInspector.navMessage,this.attrInspector.nextFeatureButton.domNode,"before");if(2>this._traversal.length){this.editSwitchDiv=e.create("div");this.editSwitchDiv.appendChild(e.create("div",{"class":"spacer"}));this._editGeomSwitch=new la({id:"editGeometrySwitch_"+this.attrInspector.id,checked:!1,value:this.nls.editGeometry,tabindex:0,label:this.nls.editGeometry},null);ja.set(ca.byId("editGeometrySwitch_"+
this.attrInspector.id).domNode,"aria-label",this.nls.editGeometry);this.editSwitchDiv.appendChild(this._editGeomSwitch.domNode);e.place(this.editSwitchDiv,this.attrInspector.deleteBtn.domNode,"before");this.own(m(this._editGeomSwitch,"Change",f.hitch(this,this.editGeoCheckChange())));this._xyCoordinates=e.create("div",{"class":"esriCTActionButtons esriCTCustomButtons esriCTXYCoordinates esriCTGeometryEditor hidden",title:this.nls.moveSelectedFeatureToXY,tabindex:0,role:"button","aria-label":this.nls.moveSelectedFeatureToXY},
this.attrInspector.deleteBtn.domNode,"after");this.own(m(this._xyCoordinates,"click",f.hitch(this,function(){this._createCoordinatesPopup()})));this.own(m(this._xyCoordinates,"keydown",f.hitch(this,function(da){da.keyCode!==n.ENTER&&da.keyCode!==n.SPACE||this._createCoordinatesPopup()})));this._locateButtonDiv=e.create("div",{"class":"esriCTActionButtons esriCTCustomButtons esriCTLocateButtonContainer esriCTGeometryEditor hidden",title:this.nls.moveSelectedFeatureToGPS,tabindex:0,role:"button","aria-label":this.nls.moveSelectedFeatureToGPS},
this.attrInspector.deleteBtn.domNode,"after");this.own(m(this._locateButtonDiv,"keydown",f.hitch(this,function(da){if(da.keyCode===n.ENTER||da.keyCode===n.SPACE)this._moveToGPSDef=new L,this._getNewCurrentLocation(),this._moveToGPSDef.then(f.hitch(this,this._moveToGPSDefResolved))})));this.own(m(this._locateButtonDiv,"click",f.hitch(this,function(){this._moveToGPSDef=new L;this._getNewCurrentLocation();this._moveToGPSDef.then(f.hitch(this,this._moveToGPSDefResolved))})));this._mapNavigation=e.create("div",
{"class":"esriCTActionButtons esriCTCustomButtons esriCTMapNavigationLocked esriCTGeometryEditor hidden",title:this.nls.mapNavigationLocked,tabindex:0,role:"button","aria-label":this.nls.mapNavigationLocked},this.attrInspector.deleteBtn.domNode,"after");this.own(m(this._mapNavigation,"click",f.hitch(this,this._toggleMapNavigationButtonState)));this.own(m(this._mapNavigation,"keydown",f.hitch(this,function(da){da.keyCode!==n.ENTER&&da.keyCode!==n.SPACE||this._toggleMapNavigationButtonState()})));if(this.config.editor.enableAttributeUpdates){var X=
"refreshAttributes";var ba=this.nls.refreshAttributes}this.config.editor.enableAutomaticAttributeUpdates&&(X="esriCTAutoUpdateOnMode",ba=this.nls.automaticAttributeUpdatesOn);this._refreshButton=e.create("div",{"class":X+" esriCTActionButtons esriCTCustomButtons esriCTGeometryEditor hidden",title:ba,tabindex:0,role:"button","aria-label":ba},this.attrInspector.deleteBtn.domNode,"after");this.own(m(this._refreshButton,"click",f.hitch(this,function(){this.config.editor.enableAutomaticAttributeUpdates?
this._toggleAttributeButtonState():this._refreshAttributes()})));this.own(m(this._refreshButton,"keydown",f.hitch(this,function(da){if(da.keyCode===n.ENTER||da.keyCode===n.SPACE)this.config.editor.enableAutomaticAttributeUpdates?this._toggleAttributeButtonState():this._refreshAttributes()})))}e.create("div",{innerHTML:this.nls.save,"class":"esriCTCustomButtons saveButton jimu-btn jimu-state-disabled",style:"visibility: hidden"},this.attrInspector.deleteBtn.domNode,"after");this.buttonHeader&&b.add(this.buttonHeader,
"hidden");this.buttonHeader=e.create("div",{"class":"buttonHeader"},this.buttonWrapper);var ha=e.create("div",{innerHTML:this.nls.save,"class":"esriCTCustomButtons saveButton jimu-btn jimu-state-disabled",tabindex:"-1",role:"button","aria-label":this.nls.save},this.buttonHeader,"last");a.set(this.attrInspector.deleteBtn.domNode,"display","none");1>c(".deleteButton",this.buttonHeader).length&&(X=e.create("div",{innerHTML:this.nls.deleteText,tabindex:"-1",role:"button","aria-label":this.nls.deleteText,
"class":"deleteButton jimu-btn jimu-btn-vacation"},ha,"before"),m(X,"click",f.hitch(this,function(){this._onDeleteButtonClick()})),m(X,"keydown",f.hitch(this,function(da){da.keyCode!==n.ENTER&&da.keyCode!==n.SPACE||this._onDeleteButtonClick()})));this.config.editor.showActionButtonsAbove?a.set(this.mainContainer,"margin-top","5px"):(e.place(this.buttonWrapper,this.mainContainer,"after"),a.set(this.mainContainer,"margin-bottom","5px"),a.set(this.mainContainer,"margin-top","0px"));this.own(m(ha,"click",
f.hitch(this,function(){this._validateFeatureChanged()?(this.map.infoWindow.isShowing&&this.map.infoWindow.hide(),b.contains(ha,"jimu-state-disabled")||this._saveEdit(this.currentFeature)):this._resetEditingVariables()})));this.own(m(ha,"keydown",f.hitch(this,function(da){if(da.keyCode===n.ENTER||da.keyCode===n.SPACE)this._validateFeatureChanged()?(this.map.infoWindow.isShowing&&this.map.infoWindow.hide(),b.contains(ha,"jimu-state-disabled")||this._saveEdit(this.currentFeature)):this._resetEditingVariables()})));
v.after(this.attrInspector,"onLayerSelectionChange",f.hitch(this,function(){"active"!==this.state&&(this._LayerSelectionChangedTimer&&clearTimeout(this._LayerSelectionChangedTimer),this._LayerSelectionChangedTimer=setTimeout(f.hitch(this,function(){this.attrInspector&&this._attrInspIsCurrentlyDisplayed&&this.attrInspector.first()}),500))}));this.attrInspector._attachmentEditor&&(v.after(this.attrInspector._attachmentEditor,"_onDeleteAttachmentComplete",f.hitch(this,function(){this._hasAddedAnyAttachments(this.attrInspector._attachmentEditor,
!1)||"Required"!==this.currentAction||a.set(this.attrInspector.attachmentsRequiredMsg,"display","block");this._enableAttrInspectorSaveButton(this._validateAttributes(),null,!0)})),v.after(this.attrInspector._attachmentEditor,"_onAddAttachmentComplete",f.hitch(this,function(){"block"===a.get(this.attrInspector.attachmentsRequiredMsg,"display")&&a.set(this.attrInspector.attachmentsRequiredMsg,"display","none");this._enableAttrInspectorSaveButton(this._validateAttributes(),null,!0)})),v.after(this.attrInspector._attachmentEditor,
"_getAttachments",f.hitch(this,function(){this.attachmentloading.show();setTimeout(f.hitch(this,function(){if(this.currentLayerInfo&&this.currentLayerInfo.attachmentValidations){if(this.currentLayerInfo.attachmentValidations){var da=[];h.forEach(this.currentLayerInfo.attachmentValidations.Actions,f.hitch(this,function(na){var pa={};na.filter&&this._smartAttributes&&(pa.actionType=na.actionName,pa.result=this._smartAttributes.processFilter(na.filter),da.push(pa))}));this.attrInspector._attachmentUploader?
this.performAction(this.attrInspector._attachmentUploader,da,!0):this.performAction(this.attrInspector._attachmentEditor,da,!1)}!this.attrInspector._attachmentEditor||this.currentLayerInfo.isEditable&&this.currentLayerInfo._editFlag||this._disableAttachments(this.attrInspector._attachmentEditor,!0,!1)}this.attachmentloading.hide()}),1500)})));this.own(m(this.attrInspector,"attribute-change",f.hitch(this,function(da){this.currentFeature&&(this.currentFeature.attributes[da.fieldName]=da.fieldValue,
this._validateDateTimeField(),this._enableAttrInspectorSaveButton(this._validateAttributes()),this.canAutoUpdate&&this.currentLayerInfo&&!this.currentLayerInfo.isCache&&this.config.editor.hasOwnProperty("autoSaveAttrUpdates")&&this.config.editor.autoSaveAttrUpdates&&setTimeout(f.hitch(this,function(){this._autoSaveFeatureEdits()}),100))})));this.AINext&&this.AINext.remove();this.AINext=this.own(m.pausable(this.attrInspector,"next",f.hitch(this,function(da){this.currentFeature&&this.config.editor.displayPromptOnSave&&
this._validateFeatureChanged()?this._promptToResolvePendingEdit(!1,null,!1).then(f.hitch(this,function(){this._processNextButtonClicked(!0,da,null,G,K)}),function(){}):(this.currentFeature&&(this.currentFeature.preEditAttrs&&(this.currentFeature.attributes=l.parse(l.stringify(this.currentFeature.preEditAttrs))),this.currentFeature.origGeom&&(this.currentFeature.geometry=aa.fromJson(this.currentFeature.origGeom))),this._processNextButtonClicked(!0,da,null,G,K))})))[0];this.attrInspector.attachmentsRequiredMsg=
e.create("div",{innerHTML:this.nls.attachmentsRequiredMsg,role:"presentation","aria-label":this.nls.attachmentsRequiredMsg.replace("(*)",""),tabindex:"0",style:"display:none;color:red;margin-top:5px"});1===d.length&&d[0].featureLayer.hasOwnProperty("originalLayerId")&&!0===this._getLayerInfoByID(d[0].featureLayer.originalLayerId).featureLayer.hasAttachments&&(d=e.create("div"),e.place(d,this.attrInspector.attributeTable,"after"),this.attrInspector._attachmentUploader=new Ya({"class":"atiAttachmentEditor",
attachmentsRequiredMsg:this.attrInspector.attachmentsRequiredMsg,currentAction:this.currentAction,deleteAttachmentText:this.nls.deleteAttachment},d),this.attrInspector._attachmentUploader.startup(),m(this.attrInspector._attachmentUploader,"attachmentAdded",f.hitch(this,function(){this._enableAttrInspectorSaveButton(this._validateAttributes())})),m(this.attrInspector._attachmentUploader,"attachmentDeleted",f.hitch(this,function(){this._enableAttrInspectorSaveButton(this._validateAttributes())})));
if(this.attrInspector._attachmentUploader)var ma=this.attrInspector._attachmentUploader.domNode;else this.attrInspector._attachmentEditor&&(ma=this.attrInspector._attachmentEditor.domNode);ma&&e.place(this.attrInspector.attachmentsRequiredMsg,ma,"before");t&&this._processRelationAndShowAttrInspector(!1,null,z,null,null,!0);setTimeout(f.hitch(this,function(){this.config.editor.removeOnSave&&0===this.attrInspector._numFeatures?this._setWidgetFirstFocusNode("templatePicker",!0):setTimeout(f.hitch(this,
function(){this._attrInspIsCurrentlyDisplayed&&this._setWidgetFirstFocusNode("AI",!0)}),1E3);setTimeout(f.hitch(this,function(){this._validateDateTimeField();this.currentLayerInfo&&this.attrInspector._attachmentEditor&&!this.currentLayerInfo.isCache&&!this.currentLayerInfo.configFeatureLayer.layerAllowsUpdate&&this._disableAttachments(this.attrInspector._attachmentEditor,!0,!1);this.currentLayerInfo&&this.attrInspector&&this.attrInspector._toolTips&&h.forEach(this.attrInspector._toolTips,f.hitch(this,
function(da){var na;this.currentLayerInfo&&!this.currentLayerInfo.isCache&&(na=new nb({connectId:da.connectId,label:da.label}));h.forEach(da.connectId,f.hitch(this,function(pa){-1<pa.indexOf("dijit_form_FilteringSelect")&&(da.position=["above-centered"],na&&(na.position=["above-centered"]))}))}))}),1500)}),1E3)},_moveToGPSDefResolved:function(d){this._moveToGPSDef=null;d.error&&d.error.message?q({message:d.error.message}):d&&d.graphic&&d.graphic.geometry&&("NaN"!==d.graphic.geometry.x&&"NaN"!==d.graphic.geometry.y?
(this.currentFeature.setGeometry(d.graphic.geometry),this.geometryEdited()):q({message:this.nls.cantLocateUserLocation}))},_onDeleteButtonClick:function(){this.map.infoWindow.isShowing&&this.map.infoWindow.hide();this.config.editor.displayPromptOnDelete?this._promptToDelete():this._deleteFeature()},_validateDateTimeField:function(){var d;this.attrInspector._currentLInfo&&this.attrInspector._currentLInfo.fieldInfos&&h.some(this.attrInspector._currentLInfo.fieldInfos,f.hitch(this,function(t){"esriFieldTypeDate"===
t.type&&t.isEditable&&(d=this._getCurrentFieldDijit(t.fieldName))&&1<d.length&&(null===d[0].get("value")||void 0===d[0].get("value")?(d[1].set("value",null),d[1].set("disabled",!0)):(this.currentLayerInfo.isCache||this.currentLayerInfo.configFeatureLayer.layerAllowsUpdate)&&d[1].set("disabled",!1))}))},_processNextButtonClicked:function(d,t,z,G,K){this.currentMultipleValues=null;this._removePreviousValuePickerButtons();this._processRelationAndShowAttrInspector(d,t,z,G,K,!1);this._attributeInspectorChangeRecord(t);
this._addWarning();this._toggleAttrInspectorNavButtons()},_toggleDeleteButton:function(d){var t=c(".deleteButton",this.buttonHeader);0<t.length&&(t=t[0],!0===d?(t.style.display="block",ja.set(t,"tabindex","0")):(t.style.display="none",ja.set(t,"tabindex","-1")))},_activateTemplateToolbar:function(d){d=d||null;var t=null;if(this.templatePicker){var z=this.templatePicker.getSelected();if(z&&null!==z){t=z.featureLayer.geometryType;if(void 0!==z.template&&null!==z.template&&void 0!==z.template.drawingTool&&
null!==z.template.drawingTool)switch(z.template.drawingTool){case "esriFeatureEditToolNone":switch(z.featureLayer.geometryType){case "esriGeometryPoint":d=null!==d?d:A.POINT;break;case "esriGeometryPolyline":d=null!==d?d:A.POLYLINE;break;case "esriGeometryPolygon":d=null!==d?d:A.POLYGON}break;case "esriFeatureEditToolPoint":d=null!==d?d:A.POINT;break;case "esriFeatureEditToolLine":d=null!==d?d:A.POLYLINE;break;case "esriFeatureEditToolAutoCompletePolygon":case "esriFeatureEditToolPolygon":d=null!==
d?d:A.POLYGON;break;case "esriFeatureEditToolCircle":d=null!==d?d:A.CIRCLE;break;case "esriFeatureEditToolEllipse":d=null!==d?d:A.ELLIPSE;break;case "esriFeatureEditToolRectangle":d=null!==d?d:A.RECTANGLE;break;case "esriFeatureEditToolFreehand":switch(z.featureLayer.geometryType){case "esriGeometryPoint":d=null!==d?d:A.POINT;break;case "esriGeometryPolyline":d=null!==d?d:A.FREEHAND_POLYLINE;break;case "esriGeometryPolygon":d=null!==d?d:A.FREEHAND_POLYGON}break;default:switch(z.featureLayer.geometryType){case "esriGeometryPoint":d=
null!==d?d:A.POINT;break;case "esriGeometryPolyline":d=null!==d?d:A.POLYLINE;break;case "esriGeometryPolygon":d=null!==d?d:A.POLYGON}}else switch(z.featureLayer.geometryType){case "esriGeometryPoint":d=null!==d?d:A.POINT;break;case "esriGeometryPolyline":d=null!==d?d:A.POLYLINE;break;case "esriGeometryPolygon":d=null!==d?d:A.POLYGON}"EXTENT"!==d&&"POLYGON"!==d&&"FREEHAND_POLYGON"!==d&&this.drawToolbar.activate(d);this._setDrawingToolbar(t,d)}else this.drawToolbar&&(this._setDrawingToolbar("select",
null),this.drawToolbar.deactivate())}else this.drawToolbar&&(this._setDrawingToolbar("select",null),this.drawToolbar.deactivate())},_templatePickerNeedsToBeCreated:function(){return!0},_drawingToolClick:function(d,t){return function(){t.hasOwnProperty("_drawType")&&(this.currentDrawType=t._drawType);!t.hasOwnProperty("_drawType")||"EXTENT"!==t._drawType&&"POLYGON"!==t._drawType&&"FREEHAND_POLYGON"!==t._drawType?"select"!==d&&(this.drawingTool.set("label",t.label),this.drawingTool.set("iconClass",
t.iconClass),this._selectTool&&this._selectTool.isActive()&&(this._selectTool.deactivate(),this.map.setInfoWindowOnClick(!1)),t.hasOwnProperty("_drawType")&&this.drawToolbar.activate(t._drawType),this.currentShapeType=d):(this.drawingTool.set("label",t.label),this.drawingTool.set("iconClass",t.iconClass),this.drawToolbar&&this.drawToolbar.deactivate(),this._selectTool&&(this._selectTool.setFeatureLayers(this._getOrClearSelectableLayers(!1)),this._selectTool._setCurrentGeoInfo(this._getSelectedGeoTypeInfo(t._drawType)),
this._selectTool.activate()))}},_menus:{},drawingTool:null,_setDrawingToolbar:function(d,t,z){if(null!==this.drawingTool&&void 0!==this.drawingTool){null!==this.currentShapeType&&void 0!==this.currentShapeType&&this.currentShapeType===d||this.drawingTool.set("dropDown",this._menus[d]);this.currentShapeType=d;this.currentDrawType=null;h.some(Ca[d],function(G){return G.hasOwnProperty("_drawType")&&G._drawType===t||null===t?(this.drawingTool.set("label",G.label),this.drawingTool.set("iconClass",G.iconClass),
this.currentDrawType=G._drawType,!0):!1},this);if(null===this.currentDrawType||void 0===this.currentDrawType)this.drawingTool.set("label",Ca[d][0].label),this.drawingTool.set("iconClass",Ca[d][0].iconClass),Ca[d][0].hasOwnProperty("_drawType")&&(this.currentDrawType=Ca[d][0]._drawType);this._changeSelectToolState(z)}},_getSelectedGeoTypeInfo:function(d){var t;h.some(this._selectTool._geoTypeInfos,f.hitch(this,function(z){if(z.geoType===d)return t=z,!0}));return t},_createDrawingToolbar:function(){if(this.config.editor.hasOwnProperty("displayShapeSelector")){if(!0===
this.config.editor.displayShapeSelector||this.config.editor.hasOwnProperty("createNewFeaturesFromExisting")&&!0===this.config.editor.createNewFeaturesFromExisting)this._menus=this._createDrawingMenus(),this.drawingTool=new oa({label:"",name:"drawingTool",id:"drawingTool"},this.drawingOptionsDiv),this.drawingTool.startup(),this.drawingTool&&this.drawingTool.domNode&&!this.templatePicker&&B.style(this.drawingTool.domNode,"display","none"),this.config.editor.hasOwnProperty("createNewFeaturesFromExisting")&&
!0===this.config.editor.createNewFeaturesFromExisting&&this._initializeSelectToolWidget(),this._setDrawingToolbar("select",null)}else this.config.editor.displayShapeSelector=!1,this.config.editor.hasOwnProperty("createNewFeaturesFromExisting")&&(this.config.editor.createNewFeaturesFromExisting=!1)},_createMenu:function(d){var t=new sa({style:"display: none;"});h.forEach(d,function(z){if(!this.config.editor.displayShapeSelector&&this.config.editor.hasOwnProperty("createNewFeaturesFromExisting")&&this.config.editor.createNewFeaturesFromExisting){var G=
!1;if(z.hasOwnProperty("_drawType")&&("EXTENT"===z._drawType||"POLYGON"===z._drawType||"FREEHAND_POLYGON"===z._drawType)||"seNewSelection"===z.id||"sePointTool"===z.id||"seDrawPolyline"===z.id||"seDrawPolygon"===z.id)G=!0}else if(G=!0,z.hasOwnProperty("_drawType")&&"EXTENT"===z._drawType||"POLYGON"===z._drawType||"FREEHAND_POLYGON"===z._drawType)G=this.config.editor.hasOwnProperty("createNewFeaturesFromExisting")&&this.config.editor.createNewFeaturesFromExisting?!0:!1;G&&this._addMenuItem(z,t,d)},
this);t.startup();return t},_createDrawingMenus:function(){var d={},t;for(t in Ca)d[t]=this._createMenu(Ca[t]);return d},_createEditor:function(d){var t=null;if(void 0!==this.config.editor&&null!==this.config.editor){var z=this._getEditableLayers(this.config.editor.configInfos,!1);if(1>z.length)this._creationDisabledOnAll=!0,this.currentLayerInfo&&!this.currentLayerInfo.isCache&&this._attrInspIsCurrentlyDisplayed&&!0===this._attrInspIsCurrentlyDisplayed&&(this.attrInspector.refresh(),this.attrInspector.first());
else if(this._templatePickerNeedsToBeCreated()){if(this._attrInspIsCurrentlyDisplayed&&!0===this._attrInspIsCurrentlyDisplayed){this._recreateOnNextShow=!0;this.currentLayerInfo.isCache||(this.attrInspector.refresh(),this.attrInspector.first());return}if(this.templatePicker&&null!==this.templatePicker){var G=this.currentDrawType;t=this.templatePicker.getSelected();null===t&&this.drawToolbar&&this.drawToolbar.deactivate();this._select_change_event.remove();this.templatePicker.destroy();this._resetEditingVariables();
this.drawToolbar&&this.drawToolbar.deactivate();this.drawingTool&&this._setDrawingToolbar("select",null,d)}else this._createAutoSaveSwitch(this.config.editor.autoSaveEdits);this.templatePickerNode=e.create("div",{"class":"eeTemplatePicker"});this.templatePickerDiv.appendChild(this.templatePickerNode);this.templatePicker=new x({featureLayers:z,"class":"esriTemplatePicker",grouping:!0,maxLabelLength:"25",showTooltip:!1},this.templatePickerNode);this.templatePicker.startup();ja.set(this.templatePicker.domNode,
"tabindex","-1");v.after(this.templatePicker,"update",f.hitch(this,function(){this._handle508AccessibilityForTemplatePicker();setTimeout(f.hitch(this,function(){this._handle508AccessibilityForTemplatePicker()}),2E3);this._checkForLayersInTemplatePicker()}));this._addFilterEditor(z);if(null!==t&&this.templatePicker){var K=Object.getOwnPropertyNames(this.templatePicker._itemWidgets),V=[];h.forEach(this.templatePicker._flItems,function(X){h.forEach(X,function(ba){V.push(ba)})});V.length===K.length?!1===
h.some(V,function(X,ba){if(t.featureLayer.id===X.layer.id&&X.template.name===t.template.name&&X.template.drawingTool===t.template.drawingTool&&X.template.description===t.template.description&&X.type===t.type)return X=B.byId(K[ba]),m.emit(X,"click",{bubbles:!0,cancelable:!0}),this._activateTemplateToolbar(G),!0},this)&&(this.drawToolbar&&this.drawToolbar.deactivate(),this.drawingTool&&this._setDrawingToolbar("select",null,d)):(this.drawToolbar&&this.drawToolbar.deactivate(),this.drawingTool&&this._setDrawingToolbar("select",
null,d))}else this.drawToolbar&&this.drawToolbar.deactivate(),this.drawingTool&&this._setDrawingToolbar("select",null,d);this._select_change_event=m(this.templatePicker,"selection-change",f.hitch(this,this._template_change));this.own(this._select_change_event)}(this._creationDisabledOnAll=1>z.length?!0:!1)?(this.drawToolbar&&this.drawToolbar.deactivate(),this.drawingTool&&this._setDrawingToolbar("select",null,d),this.templatePicker&&(B.style(this.templatePicker.domNode,"display","none"),this.config.editor.autoSaveEdits&&
this._createAutoSaveSwitch(!1),this._mapClickHandler(!0),this._clearTemplateSelection()),this.drawingTool&&B.style(this.drawingTool.domNode,"display","none"),this._filterEditor&&B.style(this._filterEditor.domNode,"display","none"),this._isPresetTableCreated&&(c(".presetFieldsTableDiv")[0].style.display="none")):(this.templatePicker&&B.style(this.templatePicker.domNode,"display","block"),this.config.editor.autoSaveEdits&&this._createAutoSaveSwitch(!0),this.drawingTool&&B.style(this.drawingTool.domNode,
"display","block"),this._filterEditor&&B.style(this._filterEditor.domNode,"display","block"),this._isPresetTableCreated&&(c(".presetFieldsTableDiv")[0].style.display="block"));this.config.editor.configInfos&&!this._isPresetTableCreated&&this._createPresetTable(this.config.editor.configInfos);this._checkForLayersInTemplatePicker();setTimeout(f.hitch(this,function(){this._handle508AccessibilityForTemplatePicker();this._setWidgetFirstFocusNode("templatePicker",!1)}),2E3)}},_checkForLayersInTemplatePicker:function(){if(this.templatePicker&&
"none"!==a.get(this.templatePicker.domNode,"display"))if(void 0===this.config.editor.editDescription||null===this.config.editor.editDescription||"\x3cbr\x3e"===this.config.editor.editDescription)this.config.editor.editDescription="",this.templateTitle.innerHTML=this.config.editor.editDescription,a.set(this.templateTitle,"display","none"),ja.set(this.templateTitle,"tabindex","-1");else{var d=this.editorXssFilter.sanitize(this.config.editor.editDescription);this.templateTitle.innerHTML=Pa.decode(d);
ja.set(this.templateTitle,"aria-label",Aa.stripHTML(this.config.editor.editDescription));a.set(this.templateTitle,"display","block");ja.set(this.templateTitle,"tabindex","0")}else{var t=!1,z=!1,G=!0;d="";h.some(this.config.editor.configInfos,f.hitch(this,function(K){if(K._editFlag&&K.allowUpdateOnly)return z=!0}));h.some(this.config.editor.configInfos,f.hitch(this,function(K){if(K._editFlag&&K.configFeatureLayer.layerAllowsCreate&&!K.allowUpdateOnly)return t=!0,G=z=!1,!0}));t?d=this._checkForLayersVisibilityInMap(!0)?
this.nls.noVisibleCreateLayerWarning:this.nls.checkLayerVisibilityInWebMapWarning:z?d=this._checkForLayersVisibilityInMap(!1)?this._doesAllLayersOutOfMapScale()?this.nls.noVisibleUpdateLayerWarning:this.config.editor.editDescription:this.nls.checkLayerVisibilityInWebMapWarning:G?this._checkIfLayerHasRelations()?(d=this._getLayersRelationShipInfo(this.config.editor.configInfos,!0),d.canCreate?d=this.config.editor.editDescription:(d=this._getLayersRelationShipInfo(this.config.editor.configInfos,!1),
d=d.canUpdate?this.config.editor.editDescription:this.nls.noEditableLayerWarning)):d=this.nls.noEditableLayerWarning:d=this.nls.noEditableLayerWarning;a.set(this.templateTitle,"display","block");ja.set(this.templateTitle,"tabindex","0");ja.set(this.templateTitle,"innerHTML",d);ja.set(this.templateTitle,"aria-label",d)}},_doesAllLayersOutOfMapScale:function(){var d=!0;h.some(this.config.editor.configInfos,f.hitch(this,function(t){if(t.allowUpdateOnly&&t.layerInfo&&t.layerInfo.layerObject&&t.layerInfo.layerObject.visibleAtMapScale)return d=
!1,!0}));return d},_checkForLayersVisibilityInMap:function(d){var t=!1;h.some(this.config.editor.configInfos,f.hitch(this,function(z){if(void 0===d){if(z&&z.relationshipInfos&&0<z.relationshipInfos.length&&z.layerInfo._visible)return t=!0}else if(d&&z._editFlag){if(z.layerInfo&&z.layerInfo._visible)return t=!0}else if(!d&&z.allowUpdateOnly&&z.layerInfo&&z.layerInfo._visible)return t=!0}));return t},_checkIfLayerHasRelations:function(){var d=!1;h.some(this.config.editor.configInfos,f.hitch(this,function(t){if(t.hasOwnProperty("relationshipInfos")&&
0<t.relationshipInfos.length)return d=!0}));return d},_getLayersRelationShipInfo:function(d,t){var z={canCreate:!1,canUpdate:!1};h.some(d,f.hitch(this,function(G){if(G.relationshipInfos&&0<G.relationshipInfos.length&&(z=this._getRelationShipDetails(G,t),z.canCreate||z.canUpdate))return!0}));return z},_getRelationShipDetails:function(d,t){var z={canCreate:!1,canUpdate:!1};h.some(d.relationshipInfos,f.hitch(this,function(G){if(t){if(G._editFlag)if(G.allowUpdateOnly)z.canUpdate=!0;else return z.canCreate=
!0,z.canUpdate=!1,!0}else if(G._editFlag&&G.allowUpdateOnly)return z.canUpdate=!0;if(!z.canCreate&&!z.canUpdate&&G.relationshipInfos&&0<G.relationshipInfos.length&&(z=this._getLayersRelationShipInfo([G],t),z.canCreate||z.canUpdate))return!0}));return z},_handle508AccessibilityForTemplatePicker:function(){var d=c("div[role\x3d'grid']",this.templatePickerDiv);var t=c("[type\x3d'checkbox']",this.templatePickerDiv);var z=c("[dojoattachpoint\x3d'lastFocusNode']",this.templatePickerDiv);d&&d[0]&&ja.set(d[0],
"tabindex","-1");h.forEach(t,f.hitch(this,function(G){ja.set(G,"tabindex","-1")}));z&&z[0]&&ja.set(z[0],"tabindex","-1");(d=c(".dojoxGridMasterMessages",this.domNode))&&0<d.length&&ja.set(d[0],"tabindex","-1")},isGuid:function(d){"{"===d[0]&&(d=d.substring(1,d.length-1));return/^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/gi.test(d)},_template_change:function(){this._deactivateAllTools();this.currentShapeType=this.currentDrawType=null;this._currentSelectedTemplate=
Object.create(this.templatePicker.getSelected());this._activateTemplateToolbar()},validateGUID:function(d,t){return this.isGuid(d)},_createPresetTable:function(d){this._isPresetTableCreated||this._processConfigForBackwardPresetInfos(d);this.config.hasOwnProperty("attributeActionGroups")&&0<Object.keys(this.config.attributeActionGroups.Preset).length&&(this.config.attributeActionGroups.hasOwnProperty("presetOrder")||(this.config.attributeActionGroups.presetOrder=Object.keys(this.config.attributeActionGroups.Preset)),
this._isPresetTableCreated||(this._isPresetTableCreated=!0,this._initPresetFieldsTable(d)),this.templatePicker&&!b.contains(c(".ee-presetValueTableDiv",this.domNode)[0],"esriCTHidden")?c(".presetFieldsTableDiv")[0].style.display="block":c(".presetFieldsTableDiv")[0].style.display="none")},_processConfigForBackwardPresetInfos:function(d){var t=[];!this.config.editor.hasOwnProperty("presetInfos")&&d&&(h.forEach(d,f.hitch(this,function(z){z.fieldValues={};h.forEach(z.fieldInfos,f.hitch(this,function(G){if(G.hasOwnProperty("canPresetValue")&&
G.canPresetValue){var K=[{actionName:"Intersection",enabled:!1},{actionName:"Address",enabled:!1},{actionName:"Coordinates",enabled:!1},{actionName:"Preset",enabled:!0}];z.fieldValues[G.fieldName]=f.clone(K);t[G.fieldName]=[]}}))})),this.config.editor.presetInfos=t);Z.createPresetGroups(this.config,this._jimuLayerInfos)},_presetChange:function(){this._toggleUsePresetValues(!0)},_createAutoSaveSwitch:function(d){d?c(".autoSaveOptionDiv")[0].style.display="block":c(".autoSaveOptionDiv")[0].style.display=
"none"},_toggleRunTimeAutoSave:function(){this._autoSaveRuntime=!1===this._autoSaveRuntime?!0:!1;this._createAutoSaveSwitch(this.config.editor.autoSaveEdits)},_deleteFeature:function(){if(this.currentFeature){this._resetEditingVariables();var d=this.currentFeature.getLayer();if(null===d.url)d.clear(),this._showTemplate(!0);else{var t=c(".processing-indicator"),z=c(".processing-indicator-panel"),G=c(".saveButton",this.buttonHeader)[0];h.forEach(t,function(K){b.contains(K,"busy")||b.add(K,"busy")});
h.forEach(z,function(K){b.contains(K,"busy")||b.add(K,"busy")});b.contains(G,"hide")||b.add(G,"hide");d.applyEdits(null,null,[this.currentFeature],f.hitch(this,function(K,V,X){if(X&&0<X.length&&X[0].hasOwnProperty("error"))q({message:X[0].error.toString()});else if(this.updateFeatures.splice(this.updateFeatures.indexOf(this.currentFeature),1),this.updateFeatures&&0<this.updateFeatures.length)if("Table"===d.type){var ba=[];this.loading.show();h.forEach(this.updateFeatures,function(ha){ba.push(ha.attributes[d.objectIdField])});
K=new H;K.objectIds=ba;d.selectFeatures(K,S.SELECTION_NEW,f.hitch(this,function(ha){this.updateFeatures=ha;this.attrInspector.refresh();this.attrInspector.first();this.loading.hide()}),f.hitch(this,function(){this.loading.hide()}))}else this.attrInspector.refresh(),this.attrInspector.first();else 2>this._traversal.length?(this._showTemplate(!0),this._setWidgetFirstFocusNode("templatePicker",!0)):(m.emit(this.cancelButton,"click",{cancelable:!0,bubbles:!0}),this._setWidgetFirstFocusNode("AI",!0));
h.forEach(t,function(ha){b.contains(ha,"busy")&&b.remove(ha,"busy")});h.forEach(z,function(ha){b.contains(ha,"busy")&&b.remove(ha,"busy")});b.contains(G,"hide")&&b.remove(G,"hide")}),f.hitch(this,function(K){q({message:K.message.toString()+"\n"+K.details});h.forEach(t,function(V){b.contains(V,"busy")&&b.remove(V,"busy")});h.forEach(z,function(V){b.contains(V,"busy")&&b.remove(V,"busy")});b.contains(G,"hide")&&b.remove(G,"hide")}))}}},_editGeometry:function(d){if(!d||!(this._ignoreEditGeometryToggle||
this.currentLayerInfo&&!this.currentLayerInfo._editFlag)){if(!0===d){if(this.currentLayerInfo&&this.currentLayerInfo.disableGeometryUpdate&&!this.currentLayerInfo.isCache||this.currentLayerInfo&&!this.currentLayerInfo.isCache&&(!this.currentLayerInfo.configFeatureLayer.layerAllowsUpdate||this.currentLayerInfo.featureLayer.hasZ&&!this.currentLayerInfo.featureLayer.enableZDefaults||this.currentLayerInfo.featureLayer.hasM&&!this.currentLayerInfo.featureLayer.allowUpdateWithoutMValues))return;this.map.setInfoWindowOnClick(!1);
this.map.infoWindow.isShowing&&this.map.infoWindow.hide();!1===this._editingEnabled&&this.currentFeature&&this.currentFeature.geometry?(this._editingEnabled=!0,this.currentFeature.origGeom=this.currentFeature.geometry.toJson(),setTimeout(f.hitch(this,function(){this._activateEditToolbar(this.currentFeature)}),100)):(0!==this.editToolbar.getCurrentState().tool&&this.editToolbar.deactivate(),this._editingEnabled=!1)}else this.map.setInfoWindowOnClick(!0),this.editToolbar.deactivate(),this._editingEnabled=
!1;this._toggleAttributeButtonVisibility(d);this._toggleLocateButtonVisibility(d);this._toggleXYCoordinatesButtonVisibility(d);this._toggleMapNavigationButtonVisibility(d);this._setWidgetFirstFocusNode("AI",!1)}},_toggleAttributeButtonState:function(){this._refreshButton&&b.contains(this._refreshButton,"esriCTAutoUpdateOnMode")?(b.replace(this._refreshButton,"esriCTAutoUpdateOffMode","esriCTAutoUpdateOnMode"),ja.set(this._refreshButton,"title",this.nls.automaticAttributeUpdatesOff)):this._refreshButton&&
b.contains(this._refreshButton,"esriCTAutoUpdateOffMode")&&(b.replace(this._refreshButton,"esriCTAutoUpdateOnMode","esriCTAutoUpdateOffMode"),ja.set(this._refreshButton,"title",this.nls.automaticAttributeUpdatesOn),this._refreshAttributes())},_toggleAttributeButtonVisibility:function(d){this.config.editor.enableAttributeUpdates&&this.currentLayerInfo&&(this.currentLayerInfo.isCache||this.currentLayerInfo.isEditable)?b.remove(this._refreshButton,"hidden"):b.add(this._refreshButton,"hidden")},_toggleLocateButtonVisibility:function(d){d&&
this.config.editor.enableMovingSelectedFeatureToGPS&&this.currentFeature&&this.currentFeature.geometry&&"point"===this.currentFeature.geometry.type?b.remove(this._locateButtonDiv,"hidden"):b.add(this._locateButtonDiv,"hidden")},_toggleXYCoordinatesButtonVisibility:function(d){d&&this.config.editor.enableMovingSelectedFeatureToXY&&this.currentFeature&&this.currentFeature.geometry&&"point"===this.currentFeature.geometry.type?b.remove(this._xyCoordinates,"hidden"):b.add(this._xyCoordinates,"hidden")},
_toggleMapNavigationButtonState:function(){b.contains(this._mapNavigation,"esriCTMapNavigationUnLocked")?this._lockMapNavigation():b.contains(this._mapNavigation,"esriCTMapNavigationLocked")&&this._unLockMapNavigation()},_lockMapNavigation:function(){this._mapNavigation&&(b.replace(this._mapNavigation,"esriCTMapNavigationLocked","esriCTMapNavigationUnLocked"),ja.set(this._mapNavigation,"title",this.nls.mapNavigationLocked),this.map.disableMapNavigation())},_unLockMapNavigation:function(){this._mapNavigation&&
(b.replace(this._mapNavigation,"esriCTMapNavigationUnLocked","esriCTMapNavigationLocked"),ja.set(this._mapNavigation,"title",this.nls.mapNavigationUnLocked),this.map.enableMapNavigation())},_toggleMapNavigationButtonVisibility:function(d){d&&this.config.editor.enableLockingMapNavigation?b.remove(this._mapNavigation,"hidden"):b.add(this._mapNavigation,"hidden");this._unLockMapNavigation()},_enableAttrInspectorSaveButton:function(d,t,z){var G=c(".saveButton",this.buttonHeader)[0],K=!1;G&&(d?(b.contains(G,
"jimu-state-disabled")&&(b.remove(G,"jimu-state-disabled"),ja.set(G,"tabindex","0")),K=!0,ja.set(G,"tabindex","0"),this._setWidgetFirstFocusNode("AI",!1)):b.contains(G,"jimu-state-disabled")||(b.add(G,"jimu-state-disabled"),ja.set(G,"tabindex","-1"),this._setWidgetFirstFocusNode("AI",!1)),!t&&this.currentFeature&&this._relatedTablesInfo[this.currentFeature._layer.id]&&(this._relatedTablesInfo[this.currentFeature._layer.id].isSaveEnable=K),this.currentLayerInfo.showAttachments&&z&&0===ca.findWidgets(this.attrInspector.attributeTable).length&&
this._setWidgetFirstFocusNode("AI",!0))},_setConfiguredFieldInfos:function(d,t){var z=[];h.forEach(t,function(G){var K=W.getFieldInfoByFieldName(d,G.fieldName);G=f.mixin(f.clone(K),G);z.push(G)});return z},_getLayerInfoByID:function(d){0<d.indexOf("_lfl")&&(d=d.replace("_lfl",""));if(this._traversal&&0<this._traversal.length){var t=this.config.editor.configInfos;h.some(this._traversal,function(V,X){h.some(t,function(ba){if(ba.featureLayer.id===V)return t=ba,!0});1<this._traversal.length&&X+1<this._traversal.length&&
(t=t.relationshipInfos)},this);if(!t.layerInfo){t.layerInfo=this._jimuLayerInfos.getLayerOrTableInfoById(t.featureLayer.id);var z=Q.getConfigInfo(t.layerInfo,{}),G=t.layerInfo.layerObject;this._removeSpacesInLayerTemplates(G);t.fieldInfos=this._setConfiguredFieldInfos(z.fieldInfos,t.fieldInfos);this.processConfigForRuntime(t);t.configFeatureLayer=z.featureLayer;t.featureLayer=G;t.showDeleteButton=!1}return t}var K=null;this.config.editor.configInfos.some(function(V){return V.featureLayer.id===d?(K=
V,!0):!1});return K},_initPresetFieldsTable:function(d){var t=e.create("div",{"class":"ee-presetValueTableDiv templatePicker"},this.presetFieldsTableNode),z=e.create("div",{"class":"bodyDiv"},t);z=e.create("table",{"class":"ee-presetValueBodyTable"},z);z=e.create("tbody",{"class":"ee-presetValueBody",id:"eePresetValueBody"},z,"first");d=new ia({nls:this.nls,parentNode:z,configInfos:d,_jimuLayerInfos:this._jimuLayerInfos,_configuredPresetInfos:this.config.attributeActionGroups.Preset,presetOrder:this.config.attributeActionGroups.presetOrder,
showingInWidget:!0,map:this.map});this.own(m(d,"presetValueChanged",f.hitch(this,this._presetChange)));d.hasAtLeastOneGroupInDisplay||(b.add(t,"esriCTHidden"),a.set(ca.byId("savePresetValueSwitch").domNode,"display","none"));d.enableUsePresetValueCheckBox&&this._presetChange()},_dateClick:function(d,t){return function(){void 0!==d&&null!==d&&d.set("value",new Date);void 0!==t&&null!==t&&t.set("value",new Date)}},_getEditableLayers:function(d,t){var z=[];h.forEach(d,function(G){!G._editFlag||G.allowUpdateOnly&&
!t||(G=this.map.getLayer(G.featureLayer.id))&&G.visible&&G.isVisibleAtScale(this.map.getScale())&&G.isEditable&&G.isEditable()&&z.push(G)},this);return z},_getEditableLayersInfos:function(d,t){var z=[];h.forEach(d,function(G){if(G._editFlag&&(!G.allowUpdateOnly||t)){var K=this.map.getLayer(G.featureLayer.id);K&&K.visible&&K.isVisibleAtScale(this.map.getScale())&&K.isEditable&&K.isEditable()&&z.push(G)}},this);return z},_getClonedRelationInfo:function(d){for(var t=[],z=0;z<d.length;z++){var G={},K;
for(K in d[z])d[z].hasOwnProperty(K)&&"featureLayer"!==K&&"layerInfo"!==K&&(G[K]="relationshipInfos"===K?this._getClonedRelationInfo(d[z][K]):f.clone(d[z][K]));t.push(G)}return t},_getLayerInfoForLocalLayer:function(d){var t=this._getLayerInfoByID(d.originalLayerId);if(null!==t){var z={};for(var G in t)t.hasOwnProperty(G)&&"featureLayer"!==G&&"layerInfo"!==G&&(z[G]="relationshipInfos"===G?this._getClonedRelationInfo(t[G]):f.clone(t[G]));z.featureLayer=d}return z},_getSelectionSymbol:function(d,t){if(!d||
""===d)return null;switch(d){case "esriGeometryPoint":var z=!0===t?new J(J.STYLE_CIRCLE,20,new P(P.STYLE_SOLID,new Y([0,230,169,1]),2),new Y([0,230,169,.65])):new J(J.STYLE_CIRCLE,20,new P(P.STYLE_SOLID,new Y([92,92,92,1]),2),new Y([255,255,0,.65]));break;case "esriGeometryPolyline":z=!0===t?new P(P.STYLE_SOLID,new Y([0,255,255,.65]),2):new P(P.STYLE_SOLID,new Y([255,255,0,.65]),2);break;case "esriGeometryPolygon":z=!0===t?(new R).setColor(new Y([0,230,169,.65])):(new R).setColor(new Y([255,255,0,
.65])),d=new P(P.STYLE_SOLID,new Y([192,192,192,1]),2),z.setOutline(d)}return z},_hasPresetValueFields:function(d){return d.some(function(t){return!1===t.allowUpdateOnly?t.fieldInfos?t.fieldInfos.some(function(z){return!0===z.canPresetValue}):!1:!1},this)},_setPresetValueValue:function(d,t,z){var G=!0,K,V=c("#eePresetValueBody")[0];z&&(G=!1);V&&(V=c(".preset-value-editable .ee-inputField"),h.forEach(V,f.hitch(this,function(X){var ba=F.byNode(X);if(void 0!==ba&&null!==ba){X=ba.get("name");ba.get("isdategroup");
if(G){var ha=X.split(" ");1<ha.length&&(X=ha[1],z="("+d+")")}z&&X.toLowerCase()===z.toLowerCase()&&(ba.esriCTisDateGroup?(K={dateType:"fixed",dateTime:(new Date(t)).getTime()},ba.esriCTPresetGroup.presetValue=K,K.dateTime?ba.set("value",W.getDateFromRelativeInfo(ba.esriCTPresetGroup.presetValue,!0)):ba.set("value","")):ba.esriCTDomainList?h.some(ba.store.data,function(ma){if(ma.id===t)return ba.set("value",t),!0}):"dijit.form.NumberTextBox"===ba.declaredClass?ba.set("value",parseFloat(t)):ba.set("value",
t))}})));z&&this.config.attributeActionGroups.Preset&&this.config.attributeActionGroups.Preset[z]&&this.config.attributeActionGroups.Preset[z].hideInPresetDisplay&&(this.config.attributeActionGroups.Preset[z].presetValue=K?K:t,this._presetChange())},_modifyAttributesWithPresetValues:function(d,t,z,G){var K=[],V={},X=[],ba=[];if(t.fieldValues){for(var ha in t.fieldValues)for(var ma=0;ma<t.fieldValues[ha].length;ma++){var da=t.fieldValues[ha][ma],na=!1,pa;t.fieldInfos&&(pa=W.getFieldInfoByFieldName(t.fieldInfos,
ha));if(z&&"Intersection"===da.actionName&&da.enabled){for(var wa=0;wa<da.fields.length;wa++){var ua=da.fields[wa];if(z.Intersection.hasOwnProperty(ha)&&z.Intersection[ha].hasOwnProperty(ua.layerId)&&z.Intersection[ha][ua.layerId].hasOwnProperty(ua.field)){d[ha]=z.Intersection[ha][ua.layerId][ua.field];if(pa&&"esriFieldTypeString"===pa.type){if(null===d[ha]||void 0===d[ha])d[ha]="";d[ha]=d[ha].toString()}na=!0;z.multipleValues&&z.multipleValues.hasOwnProperty(ha)&&0>ba.indexOf(ha)&&ba.push(ha);break}}if(na)break}if(z&&
"Address"===da.actionName&&da.enabled&&z.Address.hasOwnProperty(da.field)){d[ha]=z.Address[da.field];break}if(z&&"Coordinates"===da.actionName&&da.enabled){da.coordinatesSource&&"myLocation"===da.coordinatesSource?(ma=z.MyLocation.Coordinates.hasOwnProperty(da.coordinatesSystem),"xy"===da.field||"yx"===da.field?d[ha]=ma?this._getOutputString(da.coordinatesSystem,z.MyLocation.Coordinates[da.coordinatesSystem],da.field):"":(d[ha]=ma?z.MyLocation.Coordinates[da.coordinatesSystem][da.field]:"",pa&&"esriFieldTypeString"===
pa.type&&(d[ha]=d[ha].toString()))):"xy"===da.field||"yx"===da.field?d[ha]=this._getOutputString(da.coordinatesSystem,z.Coordinates[da.coordinatesSystem],da.field):(d[ha]=z.Coordinates[da.coordinatesSystem][da.field],pa&&"esriFieldTypeString"===pa.type&&(d[ha]=d[ha].toString()));break}if((!G||G!==ha)&&"Preset"===da.actionName&&da.enabled&&this._usePresetValues){K.push(ha);da.attributeActionGroupName&&(V[ha]=da.attributeActionGroupName,0>X.indexOf(da.attributeActionGroupName)&&X.push(da.attributeActionGroupName));
break}}if(z)if(z.multipleValues&&0<ba.length){var Ea={};h.forEach(ba,function(ya){Ea[ya]=z.multipleValues[ya]});z.multipleValues=Ea}else z.multipleValues=null}if(0<K.length){t=this._getPresetValueForGroup(X);for(var va in d)d.hasOwnProperty(va)&&0<=K.indexOf(va)&&V.hasOwnProperty(va)&&(d[va]=t[V[va]])}},_getPresetValueForGroup:function(d){for(var t={},z=this.config.attributeActionGroups.Preset,G=0;G<d.length;G++)if(z.hasOwnProperty(d[G])){var K=z[d[G]];K.showOnlyDomainFields||"esriFieldTypeString"!==
K.dataType&&"esriFieldTypeInteger"!==K.dataType&&"esriFieldTypeGUID"!==K.dataType?"esriFieldTypeDate"!==K.dataType||K.showOnlyDomainFields?K.selectedDomainValue&&(t[d[G]]=K.selectedDomainValue):(K=(K=W.getDateFromRelativeInfo(K.presetValue))&&K.getTime?K.getTime():K&&K.toGregorian?K.toGregorian().getTime():K,t[d[G]]=K):t[d[G]]=K.presetValue}return t},processConfigForRuntime:function(d){var t=[];d&&(d._editFlag||(d.isEditable=!1),t=h.filter(d.fieldInfos,function(z){return"esriFieldTypeBlob"===z.type||
"esriFieldTypeGlobalID"===z.type||"esriFieldTypeRaster"===z.type||"esriFieldTypeXML"===z.type?!1:!0===z.isEditable?!0:z.visible}),this.config.editor.hasOwnProperty("honorWebMapConfiguration")&&this.config.editor.honorWebMapConfiguration&&0===t.length&&(t=h.filter(d.fieldInfos,function(z){return"esriFieldTypeBlob"===z.type||"esriFieldTypeGlobalID"===z.type||"esriFieldTypeRaster"===z.type||"esriFieldTypeXML"===z.type?!1:!0})),d.fieldInfos=t)},_newAttrInspectorNeeded:function(){var d=!1;!this.attrInspector||
1<this.attrInspector.layerInfos.length?d=!0:(d=this.attrInspector.layerInfos[0].featureLayer.id,d=0<d.indexOf("_lfl")?0>d.indexOf(this.templatePicker.getSelected().featureLayer.id):!0);d&&this.attrInspector?(this.attrInspector.destroy(),this.attrInspector=null):this._attachmentUploader&&null!==this._attachmentUploader&&this._attachmentUploader.clear();return d},_onMapClick:function(d){this._copyFeaturesObj&&(this._copyFeaturesObj.cancelBtnClicked(),this.templatePicker&&this._clearTemplateSelection());
if(this._byPass&&!0===this._byPass)this._byPass=!1;else{var t=!1;this.templatePicker&&(t=this.templatePicker.getSelected()?!0:!1);d.graphic&&!this._attrInspIsCurrentlyDisplayed&&d.mapPoint&&!1===t&&(d.graphic&&d.graphic.geometry&&"point"===d.graphic.geometry.type&&(d.mapPoint=new Na(d.graphic.geometry.toJson())),this._processOnMapClick(d))}},_attachmentsComplete:function(d,t,z){return function(G){var K="";h.forEach(G,function(X){X&&"rejected"===X.state&&X.error&&La.isDefined(X.error.code)&&(K=400===
X.error.code?K+p.widgets.attachmentEditor.NLS_fileNotSupported+"\x3cbr/\x3e":K+X.error.message||(X.error.details&&X.error.details.length&&X.error.details[0])+"\x3cbr/\x3e")},this);if(""!==K)var V=new Ja({titleLabel:this.nls.attachmentLoadingError,width:400,maxHeight:200,autoHeight:!0,content:K,buttons:[{label:this.nls.back,classNames:["jimu-btn"],onClick:f.hitch(this,function(){V.close()})}],onClose:f.hitch(this,function(){})});return this._completePost(d,t,z)}},_selectComplete:function(d,t){return function(){this._removeLocalLayers();
this.currentFeature=null;this._showTemplate(!1);t.resolve("success")}},_completePost:function(d,t,z){this._createAttributeInspector([this.currentLayerInfo]);var G=new H;G.objectIds=[t];d.selectFeatures(G,S.SELECTION_NEW,f.hitch(this,this._selectComplete(d,z)),f.hitch(this,function(){z.resolve("failed")}))},_postChanges:function(d){var t=new L,z=this._changed_feature(d,!1);d=z[0];var G=z[1];z=z[2];var K=null,V=null;null===d?t.resolve("success"):"Add"===z?(1<this._traversal.length&&(this.addNewRelatedRecord=
!0),K=this._jimuLayerInfos.getLayerOrTableInfoById(G).layerObject,V=K.applyEdits([d],null,null),this.addDeferred(V,d,K,t)):(K=this._jimuLayerInfos.getLayerOrTableInfoById(G).layerObject,0===Object.keys(d.attributes).length&&null===d.geometry?t.resolve("success"):1===Object.keys(d.attributes).length&&d.attributes.hasOwnProperty(K.objectIdField)&&null===d.geometry?t.resolve("success"):(V=K.applyEdits(null,[d],null),this.addDeferred(V,d,K,t)));return t.promise},_changed_feature:function(d,t){var z=null,
G=null,K=null,V=null;t=t||!1;var X=null;if(d){z=new U(null,null,l.parse(l.stringify(d.attributes)));if(void 0!==this._smartAttributes&&null!==this._smartAttributes)for(X in z.attributes)!0===z.attributes.hasOwnProperty(X)&&(K=this._smartAttributes.validateField(X),"Hide"===K[1]&&!0!==K[3]&&delete z.attributes[X]);for(X in z.attributes)!0===z.attributes.hasOwnProperty(X)&&""===z.attributes[X]&&(z.attributes[X]=null);this._attributeInspectorTools?(z.attributes=this._attributeInspectorTools._checkFeatureData(z.attributes),
d.preEditAttrs&&(z.preEditAttrs=this._attributeInspectorTools._checkFeatureData(l.parse(l.stringify(d.preEditAttrs))))):d.preEditAttrs&&(z.preEditAttrs=l.parse(l.stringify(d.preEditAttrs)));if(d.getLayer().originalLayerId){if(K=this._jimuLayerInfos.getLayerOrTableInfoById(d.getLayer().originalLayerId).layerObject)z.geometry=d.geometry,z.symbol=null,G="Add",t=!0}else void 0!==this.geometryChanged&&null!==this.geometryChanged&&!0===this.geometryChanged&&(z.geometry=d.geometry),K=d.getLayer(),(d=Q.filterOnlyUpdatedAttributes(z.attributes,
z.preEditAttrs,K))&&!Q.isObjectEmpty(d)?z.attributes=d:z.attributes=[],z.symbol=null,G="Update";V=K.id;z&&t&&z.attributes.hasOwnProperty(K.objectIdField)&&delete z.attributes[K.objectIdField];K.globalIdField&&z.attributes.hasOwnProperty(K.globalIdField)&&delete z.attributes[K.globalIdField];if(K.editFieldsInfo)for(X in K.editFieldsInfo)K.editFieldsInfo.hasOwnProperty(X)&&z.attributes.hasOwnProperty(K.editFieldsInfo[X])&&delete z.attributes[K.editFieldsInfo[X]]}return[z,V,G]},getUniqueFieldErrorMsg:function(d){var t=
"",z="",G={};G=d.split("with unique index '");d=d.split("duplicate key value is (");2<=G.length&&(t=G[1].split(".")[0].split("_Index")[0]);2<=d.length&&(z=d[1].split(")")[0]);G=W.getFieldInfoByFieldName(this.attrInspector._currentLInfo.fieldInfos,t);"esriFieldTypeDate"===G.type&&z.indexOf(!1)&&(z=z.split(".")[0]);return Ga.substitute(this.nls.uniqueValueErrorMessage,{fieldName:G.label||G.name||z})},addDeferred:function(d,t,z,G){d.then(f.hitch(this,function(K,V){V&&0<V.length&&V[0].hasOwnProperty("error")?
(K=V[0].error.toString(),-1!==K.toLowerCase().indexOf("cannot insert duplicate key row")&&(K=this.getUniqueFieldErrorMsg(K)),q({message:K}),G.resolve("failed")):V&&0<V.length?(t.preEditAttrs=l.parse(l.stringify(t.attributes)),z.refresh(),this.geometryChanged=!1,G.resolve("success")):K&&0<K.length&&K[0].hasOwnProperty("error")?(K=K[0].error.toString(),-1!==K.toLowerCase().indexOf("cannot insert duplicate key row")&&(K=this.getUniqueFieldErrorMsg(K)),q({message:K}),G.resolve("failed")):K&&0<K.length&&
(t.preEditAttrs=l.parse(l.stringify(t.attributes)),V=null,this.attrInspector._attachmentUploader&&(V=this.attrInspector._attachmentUploader.postAttachments(z,K[0].objectId)),void 0===V||null===V||0===V.length?this.addNewRelatedRecord?G.resolve("success"):this._completePost(z,K[0].objectId,G):D(V).then(f.hitch(this,this._attachmentsComplete(z,K[0].objectId,G))))}),f.hitch(this,function(K){q({message:K.message.toString()+"\n"+K.details});G.resolve("failed")}))},_processOnMapClick:function(d){var t=
this.config.editor.hasOwnProperty("featuresSelectionTolerance")?this.config.editor.featuresSelectionTolerance:20;this.map.infoWindow.hide();h.forEach(this._attributeInspectorCollection,function(V){V.destroy()});this._traversal=[];this._nodesCollection=[];this._paginationNodeCollection=[];this._buttonsWrapper=[];this._attributeInspectorCollection=[];this._relatedTablesInfo={};this._createAttributeInspector(this.config.editor.configInfos);var z=this.map.getLayersVisibleAtScale().filter(f.hitch(this,
function(V){return V.type&&"Feature Layer"===V.type&&V.url?h.some(this.config.editor.configInfos,f.hitch(this,function(X){return X.layerId===V.id&&this._hasAnyEditableLayerInRelation([X])?!0:!1})):!1}));z=z.filter(f.hitch(this,function(V){try{return this.map.getLayer(V.id).visible}catch(X){return console.log(X+" Check for visible failed"),!0}}));var G=[],K=[];this.currentFeature=null;this.geometryChanged=!1;this.currentLayerInfo=null;h.forEach(z,f.hitch(this,function(V){V.setSelectionSymbol(this._getSelectionSymbol(V.geometryType,
!1));var X=new H;X.geometry=Q.pointToExtent(this.map,d.mapPoint,t);X=V.selectFeatures(X,S.SELECTION_NEW,f.hitch(this,function(ba){var ha=[],ma=[];h.forEach(ba,function(da){da.allowDelete=!0;V.getEditCapabilities({feature:da}).canDelete||(da.allowDelete=!1);da.preEditAttrs=l.parse(l.stringify(da.attributes));ma.push(da)},this);0<ha.length&&(ba=new H,ba.objectIds=ha,ha=V.selectFeatures(ba,S.SELECTION_SUBTRACT,f.hitch(this,function(da){console.log(da.length)})),K.push(ha));G=G.concat(ma)}));K.push(X)}));
0===K.length?(this._byPass=!0,this.map.popupManager._showPopup(d),this._byPass=!1):D(K).then(f.hitch(this,function(){this.updateFeatures=G;0<this.updateFeatures.length?this._showTemplate(!1):(this._byPass=!0,this.map.popupManager._showPopup(d),this._byPass=!1)}))},_attachLayerHandler:function(){this._eventHandler=this.own(m(this.currentFeature._layer,"visibility-change",f.hitch(this,function(){})))},_removeLayerVisibleHandler:function(){null!==this._eventHandler&&(h.forEach(this._eventHandler,f.hitch(this,
function(d){"function"===typeof d.remove&&d.remove()})),this._eventHandler=null)},_postFeatureSave:function(d){this.updateFeatures&&1<this.updateFeatures.length&&h.forEach(this.updateFeatures,f.hitch(this,function(t){t.setSymbol(this._getSelectionSymbol(t.getLayer().geometryType,!1))}));d&&d.feature&&(this.geometryChanged=!1,this.currentFeature=d.feature,this.currentFeature.preEditAttrs=l.parse(l.stringify(this.currentFeature.attributes)),this._attachLayerHandler(),this.currentLayerInfo=this._getLayerInfoByID(this.currentFeature._layer.id),
this.currentLayerInfo.isCache=!1,this._createSmartAttributes(),this._createAttributeInspectorTools(),this._attributeInspectorTools.triggerFormValidation(),this._validateAttributes(),this._enableAttrInspectorSaveButton(!1),this.currentFeature.hasOwnProperty("allowDelete")?this._toggleDeleteButton(this.currentFeature.allowDelete&&this.currentLayerInfo.allowDelete):this._toggleDeleteButton(this.currentLayerInfo.allowDelete),this._toggleEditGeoSwitch(this.currentLayerInfo.disableGeometryUpdate||!this.currentLayerInfo.configFeatureLayer.layerAllowsUpdate||
this.currentLayerInfo.featureLayer.hasZ&&!this.currentLayerInfo.featureLayer.enableZDefaults||this.currentLayerInfo.featureLayer.hasM&&!this.currentLayerInfo.featureLayer.allowUpdateWithoutMValues),this.currentFeature.setSymbol(this._getSelectionSymbol(d.feature.getLayer().geometryType,!0)))},_promptToDelete:function(){var d=new Ja({titleLabel:this.nls.deletePromptTitle,width:400,maxHeight:200,autoHeight:!0,content:this.nls.deletePrompt,buttons:[{label:this.nls.yes,classNames:["jimu-btn"],onClick:f.hitch(this,
function(){this._deleteFeature();d.close()})},{label:this.nls.no,classNames:["jimu-btn"],onClick:f.hitch(this,function(){d.close()})}],onClose:f.hitch(this,function(){})})},_promptToResolvePendingEdit:function(d,t,z,G){var K=!this._validateAttributes();G=K?-1:0;var V=new L;K=[{label:this.nls.yes,classNames:["jimu-btn"],disable:K,onClick:f.hitch(this,function(){this._saveEdit(this.currentFeature,d,!0).then(f.hitch(this,function(){null!==t&&void 0!==t&&(t.hasOwnProperty("featureLayer")&&t.hasOwnProperty("feature")?
this.load_from_featureaction(t.featureLayer,t.feature):this._postFeatureSave(t));V.resolve("yes")}));X.close()})},{label:this.nls.no,classNames:["jimu-btn"],onClick:f.hitch(this,function(){this._cancelEditingFeature(d);null!==t&&void 0!==t&&(t.hasOwnProperty("featureLayer")&&t.hasOwnProperty("feature")?this.load_from_featureaction(t.featureLayer,t.feature):this._postFeatureSave(t));X.close();V.resolve("no")})}];z&&!0===z&&K.push({label:this.nls.back,classNames:["jimu-btn"],onClick:f.hitch(this,function(){V.reject();
X.close()})});var X=new Ja({titleLabel:this.nls.savePromptTitle,width:400,maxHeight:200,autoHeight:!0,content:this.nls.savePrompt,buttons:K,onClose:f.hitch(this,function(){})});ja.set(X.disabledButtons[0],"tabindex",G);return V.promise},_removeLocalLayers:function(){this.cacheLayer&&null!==this.cacheLayer&&(this.cacheLayer.clearSelection(),this.cacheLayer.clear(),this.map.removeLayer(this.cacheLayer),this.cacheLayer=null);this.updateFeatures=[]},_removeSpacesInLayerTemplates:function(d){if(d){var t=
h.filter(d.fields,f.hitch(this,function(z){return!1===z.nullable&&!0===z.editable}));h.forEach(t,f.hitch(this,function(z){h.forEach(d.templates,function(G){" "===G.prototype.attributes[z.name]&&(G.prototype.attributes[z.name]=G.prototype.attributes[z.name].trim())})}))}},_resetEditingVariables:function(){this._editingEnabled=!1;this.editToolbar&&0!==this.editToolbar.getCurrentState().tool&&this.editToolbar.deactivate()},_feature_removed:function(d,t){return function(){this.attrInspector._featureIdx>=
t&&0!==t&&(this.currentFeature=null,this.attrInspector.previous());this.updateFeatures.splice(this.updateFeatures.indexOf(d),1);this.currentFeature.setSymbol(this._getSelectionSymbol(this.currentFeature.getLayer().geometryType,!1));this.currentFeature=this.attrInspector._currentFeature;this.currentLayerInfo.featureLayer.visibleAtMapScale&&this.config.editor.hasOwnProperty("editGeometryDefault")&&!0===this.config.editor.editGeometryDefault&&this.attrInspector._currentFeature&&setTimeout(f.hitch(this,
function(){2>this._traversal.length&&(this._editGeomSwitch.set("checked",!0),this._editGeomSwitch.check())}),100);this.currentFeature.setSymbol(this._getSelectionSymbol(this.currentFeature.getLayer().geometryType,!0));this._refreshLayerTitle()}},_saveEdit:function(d,t,z){var G=new L;this._enableAttrInspectorSaveButton(!1);this.config.editor.editGeometryDefault||this._turnEditGeometryToggleOff();if(this._validateAttributes()){var K=c(".processing-indicator"),V=c(".processing-indicator-panel"),X=c(".saveButton",
this.buttonHeader)[0];h.forEach(K,function(ba){b.contains(ba,"busy")||b.add(ba,"busy")});h.forEach(V,function(ba){b.contains(ba,"busy")||b.add(ba,"busy")});X&&!b.contains(X,"hide")&&b.add(X,"hide");this._postChanges(d).then(f.hitch(this,function(ba){var ha=!1;if("failed"===ba)G.resolve("failed"),this.addNewRelatedRecord=!1;else{this.addNewRelatedRecord&&(ha=!0,this.attrInspector.destroy(),e.destroy(this.contentWrapper),e.destroy(this.buttonHeader),e.destroy(this.navButtonsDiv),this.attrInspector=
this._attributeInspectorCollection.pop(),a.set(this.attrInspector.attributeTable,"display","block"),a.set(this.attrInspector.editButtons,"display","block"),a.set(this.attrInspector.deleteBtn.domNode,"display","none"),this.attrInspector._featureIdx=this.attrInspector.ctStoredFeatureIndex,this.attrInspector.refresh(),setTimeout(f.hitch(this,function(){a.set(this.attrInspector.navButtons,"display",!this.attrInspector._hideNavButtons&&1<this.attrInspector._numFeatures?"":"none");this.attrInspector.navMessage.innerHTML=
La.substitute({idx:this.attrInspector._featureIdx+1,of:this.attrInspector.NLS_of,numFeatures:this.attrInspector._numFeatures},this.attrInspector._navMessage);(this.currentFeature=this.attrInspector._numFeatures?this.attrInspector._selection[this.attrInspector._featureIdx]:null)&&this.currentFeature.attributes&&(this.currentFeature.preEditAttrs=l.parse(l.stringify(this.currentFeature.attributes)))}),200),this.contentWrapper=this._nodesCollection.pop(),this.buttonHeader=this._buttonsWrapper.pop(),this.navButtonsDiv=
this._paginationNodeCollection.pop(),this._traversal.pop(),this.currentRelatedDom&&(ba=ja.get(this.currentRelatedDom,"relatedRecordCount"))&&0===parseInt(ba,10)&&ja.set(this.currentRelatedDom,"relatedRecordCount",1),this.currentRelatedDom.click());this.currentFeature&&this.currentFeature.attributes&&(this.currentFeature.preEditAttrs=l.parse(l.stringify(this.currentFeature.attributes)));this._relatedTablesInfo[d._layer.id]&&this._relatedTablesInfo[d._layer.id].updateFeatureInstance(d.attributes);this.config.editor.removeOnSave&&
1>=this.updateFeatures.length&&1>=this._traversal.length&&!ha&&(t=!0);if(t&&!0===t)this._showTemplate(!0);else if(this.config.editor.removeOnSave&&1>=this.updateFeatures.length&&1<this._traversal.length)m.emit(this.cancelButton,"click",{cancelable:!0,bubbles:!0});else if(this._resetEditingVariables(),this.map.setInfoWindowOnClick(!0),!0!==this.config.editor.removeOnSave||ha)this.currentFeature&&this.currentFeature.hasOwnProperty("allowDelete")?this._toggleDeleteButton(this.currentFeature.allowDelete&&
this.currentLayerInfo.allowDelete):this._toggleDeleteButton(this.currentLayerInfo.allowDelete&&this.currentLayerInfo.configFeatureLayer.layerAllowsDelete),this._toggleEditGeoSwitch(this.currentLayerInfo.disableGeometryUpdate||!this.currentLayerInfo.configFeatureLayer.layerAllowsUpdate||this.currentLayerInfo.featureLayer.hasZ&&!this.currentLayerInfo.featureLayer.enableZDefaults||this.currentLayerInfo.featureLayer.hasM&&!this.currentLayerInfo.featureLayer.allowUpdateWithoutMValues),this.currentLayerInfo.featureLayer.visibleAtMapScale&&
this.config.editor.hasOwnProperty("editGeometryDefault")&&!0===this.config.editor.editGeometryDefault&&setTimeout(f.hitch(this,function(){2>this._traversal.length&&(this._editGeomSwitch.set("checked",!0),this._editGeomSwitch.check())}),100),d.setSymbol(this._getSelectionSymbol(d.getLayer().geometryType,!0));else{ha=d.getLayer();ba=new H;ba.objectIds=[d.attributes[ha.objectIdField]];var ma=this.attrInspector._selection.indexOf(d);ha.selectFeatures(ba,S.SELECTION_SUBTRACT,f.hitch(this,this._feature_removed(d,
ma)))}G.resolve("success");this.config.editor.removeOnSave&&0===this.attrInspector._numFeatures||t?this._setWidgetFirstFocusNode("templatePicker",!0):this._setWidgetFirstFocusNode("AI",!0)}h.forEach(K,function(da){b.contains(da,"busy")&&b.remove(da,"busy")});h.forEach(V,function(da){b.contains(da,"busy")&&b.remove(da,"busy")});b.contains(X,"hide")&&b.remove(X,"hide")}),f.hitch(this,function(){h.forEach(K,function(ba){b.contains(ba,"busy")&&b.remove(ba,"busy")});h.forEach(V,function(ba){b.contains(ba,
"busy")&&b.remove(ba,"busy")});b.contains(X,"hide")&&b.remove(X,"hide")}))}return G.promise},_showTemplate:function(d){this._attrInspIsCurrentlyDisplayed=!d;d?(this._mapClickHandler(!0),this._showTemplatePicker(),this._traversal=[],this._nodesCollection=[],this._paginationNodeCollection=[],this._buttonsWrapper=[],this._attributeInspectorCollection=[],this._relatedTablesInfo={},this.currentFeature=null,this.geometryChanged=!1,this.currentLayerInfo=null):(this._mapClickHandler(!1),c(".jimu-widget-smartEditor .templatePickerMainDiv")[0].style.display=
"none",c(".jimu-widget-smartEditor .attributeInspectorMainDiv")[0].style.display="block",a.set(this.noFeatureWarningMessage,"display","none"),this.attrInspector&&(!this.currentFeature&&this.attrInspector&&0<this.attrInspector._numFeatures&&this.attrInspector.first(),this.attrInspector.refresh(),this._createSmartAttributes(),this._createAttributeInspectorTools(),this._attributeInspectorTools&&this._attributeInspectorTools.triggerFormValidation(),this.currentFeature&&this.currentFeature.getLayer().originalLayerId?
this._enableAttrInspectorSaveButton(this._validateAttributes()):(this._validateAttributes(!1),this._enableAttrInspectorSaveButton(!1)),this.currentLayerInfo.isCache&&!0===this.currentLayerInfo.isCache?this._toggleEditGeoSwitch(!1):this._toggleEditGeoSwitch(this.currentLayerInfo.disableGeometryUpdate||!this.currentLayerInfo.configFeatureLayer.layerAllowsUpdate||this.currentLayerInfo.featureLayer.hasZ&&!this.currentLayerInfo.featureLayer.enableZDefaults||this.currentLayerInfo.featureLayer.hasM&&!this.currentLayerInfo.featureLayer.allowUpdateWithoutMValues),
this._addWarning(),this._setWidgetFirstFocusNode("AI",!0)),this._recordLoadeAttInspector())},_createAttributeInspectorTools:function(){if(void 0!==this.currentFeature&&null!==this.currentFeature){var d=c("td.atiLabel",this.attrInspector.domNode);void 0!==d&&null!==d&&(this._attributeInspectorTools=new ka({_attrInspector:this.attrInspector,_feature:this.currentFeature,_fieldInfo:this.currentLayerInfo.fieldInfos}))}},_createSmartAttributes:function(){if(void 0!==this.currentFeature&&null!==this.currentFeature){var d=
c("td.atiLabel",this.attrInspector.domNode);void 0!==d&&null!==d&&(d=null,void 0!==this.currentLayerInfo&&null!==this.currentLayerInfo&&void 0!==this.currentLayerInfo.fieldValidations&&null!==this.currentLayerInfo.fieldValidations&&(d=this.currentLayerInfo.fieldValidations),null!==d&&(this._smartAttributes=new fa({_attrInspector:this.attrInspector,_fieldValidation:d,_feature:this.currentFeature,_fieldInfo:this.currentLayerInfo.fieldInfos,_url:this.currentLayerInfo.featureLayer.url}),this.own(m(this._smartAttributes,
"onFieldToggle",f.hitch(this,function(){this._add508SupportToAttachmentsDeleteBtn("AI")})))))}},_showTemplatePicker:function(){var d=c(".jimu-widget-smartEditor .attributeInspectorMainDiv");0<d.length&&(d[0].style.display="none");d=c(".jimu-widget-smartEditor .templatePickerMainDiv");0<d.length&&(d[0].style.display="block");if(this.templatePicker&&(d=0,this.templatePicker._selectedInfo&&this.templatePicker._selectedInfo.hasOwnProperty("selRow")&&(d=0<this.templatePicker._selectedInfo.selRow?this.templatePicker._selectedInfo.selRow-
1:this.templatePicker._selectedInfo.selRow),this.config.editor.hasOwnProperty("keepTemplateSelected")?!0!==this.config.editor.keepTemplateSelected&&this._clearTemplateSelection():this._clearTemplateSelection(),this.templatePicker)){var t=null;this.drawingTool&&this.currentDrawType&&(t=this.currentDrawType);this._activateTemplateToolbar(t);var z=d,G=null,K=null;this.templatePicker._selectedInfo&&this.templatePicker._selectedInfo.hasOwnProperty("selRow")&&(G=this.templatePicker._selectedInfo,z=0<this.templatePicker._selectedInfo.selRow?
this.templatePicker._selectedInfo.selRow-1:this.templatePicker._selectedInfo.selRow,K=this.templatePicker.getSelected(),this._selectTemplateIndex=z);this.templatePicker.update();this.templatePicker.grid.scrollToRow(z);setTimeout(f.hitch(this,function(){null!==K&&this.templatePicker&&this.templatePicker.grid.store.fetch({onComplete:f.hitch(this,function(X){var ba=(X=this.templatePicker._locate(K,G,X))&&this.templatePicker.grid.views.views[0].getCellNode(X[0],X[1]);ba&&(this._selectTemplateIndex>this.templatePicker.grid.rowsPerPage&&
this.templatePicker._rowClicked({cellNode:ba,rowIndex:X[0],cellIndex:X[1]},!0),this.templatePicker.grid.scrollToRow(z))})})}),500)}this._resetEditingVariables();var V=[];this.updateFeatures&&h.forEach(this.updateFeatures,f.hitch(this,function(X){X=X.getLayer();V&&-1===V.indexOf(X.id)&&(V.push(X.id),X.clearSelection(),X.refresh())}));this._clearLayerSelection();this.currentFeature=null;this.geometryChanged=!1;this.currentLayerInfo=null;this._removeLocalLayers();!0===this._recreateOnNextShow&&(this._recreateOnNextShow=
!1,this._createEditor());this._creationDisabledOnAll?(this.templatePicker&&B.style(this.templatePicker.domNode,"display","none"),this.drawingTool&&B.style(this.drawingTool.domNode,"display","none")):(this.templatePicker&&B.style(this.templatePicker.domNode,"display","block"),this.drawingTool&&B.style(this.drawingTool.domNode,"display","block"));this._copyFeaturesObj&&this._copyFeaturesObj.cancelBtnClicked()},_setPresetValue:function(){this._usePresetValues=ca.byId("savePresetValueSwitch").checked},
_toggleUsePresetValues:function(d){var t=ca.byId("savePresetValueSwitch");d?t.check():t.uncheck();this._usePresetValues=t.checked},_turnEditGeometryToggleOff:function(){1<this._traversal.length||!this._editGeomSwitch||!this._editGeomSwitch.checked||(this.editToolbar&&0!==this.editToolbar.getCurrentState().tool&&this.editToolbar.deactivate(),this._editingEnabled=!1,this._ignoreEditGeometryToggle=!0,this._editGeomSwitch.set("checked",!1),this._editGeomSwitch.uncheck(),this.map.setInfoWindowOnClick(!0),
setTimeout(f.hitch(this,function(){this._ignoreEditGeometryToggle=!1}),2))},_validateFeatureChanged:function(){if(this.currentFeature){if(void 0!==this.geometryChanged&&null!==this.geometryChanged&&!0===this.geometryChanged)return!0;var d=this._changed_feature(this.currentFeature,!0),t=d[0];d=d[2];if(null!==t&&0===Object.keys(t.attributes).length&&"Add"!==d)return!1}return!0},_validateRequiredFields:function(){var d={};if(!this.currentFeature)return d;var t=this.currentFeature.getLayer();t=h.filter(t.fields,
f.hitch(this,function(z){return!1===z.nullable&&!0===z.editable}));h.forEach(t,f.hitch(this,function(z){if("esriFieldTypeDate"===z.type){var G=this._getCurrentFieldDijit(z.name);G&&0<G.length&&(null!==G[0].get("value")&&void 0!==G[0].get("value")?G[1]&&null===G[1].get("value")?(G[1].set("required",!0),G=c("td[data-fieldname\x3d"+z.name+"]",this.attrInspector.domNode)[0].parentNode,b.add(G.childNodes[1].childNodes[1],["dijitTextBoxError","dijitError"]),d[z.alias]="null"):(G=c("td[data-fieldname\x3d"+
z.name+"]",this.attrInspector.domNode)[0].parentNode,b.remove(G.childNodes[1].childNodes[1],["dijitTextBoxError","dijitError"])):d[z.alias]="null")}else if("undefined"===this.currentFeature.attributes[z.name])d[z.alias]="undefined";else if(null===this.currentFeature.attributes[z.name])d[z.alias]="null";else switch(z.type){case "esriFieldTypeString":if(""===this.currentFeature.attributes[z.name]||this.currentFeature.attributes[z.name]&&this.currentFeature.attributes[z.name].hasOwnProperty("trim")&&
""===this.currentFeature.attributes[z.name].trim())d[z.alias]="Empty string"}}));return d},_worksAfterClose:function(){p.toolbars.draw.start=this._defaultStartStr;p.toolbars.draw.addPoint=this._defaultAddPointStr},_workBeforeCreate:function(){var d="\x3cbr/\x3e("+this.nls.pressStr+"\x3cb\x3e"+this.nls.ctrlStr+"\x3c/b\x3e "+this.nls.snapStr+")";this._defaultStartStr=p.toolbars.draw.start;this._defaultAddPointStr=p.toolbars.draw.addPoint;p.toolbars.draw.start+=d;p.toolbars.draw.addPoint+=d},_getDefaultFieldInfos:function(d){var t=
Q.getFieldInfosFromWebmap(d.id,this._jimuLayerInfos);if(void 0===t||null===t)t=Q.getFieldInfosLayer(d.id,this._jimuLayerInfos);t&&(t=h.filter(t,function(z){return z.visible||z.isEditable}));return t},_getDefaultLayerInfos:function(){for(var d=[],t,z=this.map.graphicsLayerIds.length-1;0<=z;z--)if(t=this.map.getLayer(this.map.graphicsLayerIds[z]),"Feature Layer"===t.type&&t.url){var G={featureLayer:{}};G.featureLayer.id=t.id;G.disableGeometryUpdate=!1;G.allowUpdateOnly=!1;(t=this._getDefaultFieldInfos(t))&&
0<t.length&&(G.fieldInfos=t);d.push(G)}return d},_converConfiguredLayerInfos:function(d){h.forEach(d,function(t){var z;if(!t.featureLayer.id&&t.featureLayer.url){if(z=this.getLayerObjectFromMapByUrl(this.map,t.featureLayer.url))t.featureLayer.id=z.id}else z=this.map.getLayer(t.featureLayer.id);var G=t.featureLayer.id;t.featureLayer.hasOwnProperty("originalLayerId")&&(G=t.featureLayer.originalLayerId);if(z){var K=[],V=Q.getFieldInfosFromWebmap(G,this._jimuLayerInfos);if(void 0===V||null===V)V=Q.getFieldInfosLayer(G,
this._jimuLayerInfos);h.forEach(V,function(X){X.fieldName!==z.globalIdField&&X.fieldName!==z.objectIdField&&"esriFieldTypeGeometry"!==X.type&&"esriFieldTypeOID"!==X.type&&"esriFieldTypeBlob"!==X.type&&"esriFieldTypeGlobalID"!==X.type&&"esriFieldTypeRaster"!==X.type&&"esriFieldTypeXML"!==X.type&&(X=this.getFieldInfoFromWebmapFieldInfos(X,t.fieldInfos),!0===X.visible&&K.push(X))},this);0!==K.length&&(t.fieldInfos=K)}},this);return d},getLayerObjectFromMapByUrl:function(d,t){for(var z=null,G=0;G<d.graphicsLayerIds.length;G++){var K=
d.getLayer(d.graphicsLayerIds[G]);if(K.url.toLowerCase()===t.toLowerCase()){z=K;break}}return z},getFieldInfoFromWebmapFieldInfos:function(d,t){var z={};(t=h.filter(t,function(K){return d.fieldName===K.fieldName}))&&(z=1<=t.length?t[0]:d);z.label=void 0===z.label?d.label:z.label;z.visible=void 0===z.visible?d.visible:z.visible;z.isEditableSettingInWebmap=void 0===d.isEditable?!0:d.isEditable;z.isEditable=void 0===z.isEditable?d.isEditable:z.isEditable;z.canPresetValue=void 0===z.canPresetValue?!1:
z.canPresetValue;z.format=void 0===d.format?null:d.format;for(var G in d)d.hasOwnProperty(G)&&!1===z.hasOwnProperty(G)&&(z[G]=d[G]);return z},getConfigDefaults:function(){this.config.editor.hasOwnProperty("editGeometryDefault")&&!0===this.config.editor.editGeometryDefault?setTimeout(f.hitch(this,function(){2>this._traversal.length&&this._editGeomSwitch.domNode&&this._editGeomSwitch.check()}),100):this._turnEditGeometryToggleOff()},_processConfig:function(){h.forEach(this.config.editor.configInfos,
function(d){d.hasOwnProperty("_editFlag")||(d._editFlag=!0);var t=d.layerInfo.layerObject;t&&(!1===d.allowUpdateOnly?this.own(m(t,"visibility-change, scale-visibility-change",f.hitch(this,function(){this._layerScaleClearedTimer&&clearTimeout(this._layerScaleClearedTimer);this._layerScaleClearedTimer=setTimeout(f.hitch(this,function(){this._createEditor(!1)}),200)}))):this.own(m(t,"visibility-change, scale-visibility-change",f.hitch(this,function(){this.templatePicker&&"none"!==a.get(this.templatePicker.domNode,
"display")||this._checkForLayersInTemplatePicker()}))),this._removeSpacesInLayerTemplates(t),this.processConfigForRuntime(d),d.configFeatureLayer=d.configFeatureLayer?d.configFeatureLayer:d.featureLayer,d.featureLayer=t,d.showDeleteButton=!1)},this)},onClose:function(){this._worksAfterClose();this._mapClickHandler(!1);this._removeLayerVisibleHandler();this._unLockMapNavigation();this._coordinates&&this._coordinates.fieldsPopup&&this._coordinates.fieldsPopup.domNode&&this._coordinates.fieldsPopup.close();
this.valuePicker&&this.valuePicker.hideDialog();this.templatePicker&&this.templatePicker.getSelected()&&this.templatePicker.clearSelection()},_update:function(){},resize:function(){this._update();this._copyFeaturesObj&&!b.contains(this.copyFeaturesMainNode,"esriCTHidden")&&this._resetCopyFeatureListHeight()},onNormalize:function(){setTimeout(f.hitch(this,this._update),100)},onMinimize:function(){console.log("min")},onMaximize:function(){setTimeout(f.hitch(this,this._update),100)},addItem:function(d,
t,z,G,K,V,X){var ba=e.create("div",{"class":"esriCTItem"},null);this._createItemTitle(d,ba,K?!0:t,K,V);this._createItemContent(ba,K?!0:t,G,X);K&&(b.add(ba,"esriCTDisableToggling"),ja.set(ba.children[0],"tabindex","-1"));z.appendChild(ba);return ba},_createItemTitle:function(d,t,z,G,K){var V=e.create("div",{"class":"esriCTItemTitleContainer",tabindex:"0",role:"button","aria-label":d},t);e.create("div",{"class":"esriCTItemHighlighter"},V);var X=e.create("div",{"class":"esriCTItemTitle esriCTFloatLeft",
innerHTML:d,title:d},V);d===this.nls.relatedItemTitle&&ja.set(V,"isRelatedItem","true");1>=this._traversal.length&&K&&!K.visibleAtMapScale&&(X.style.opacity="0.3");d=e.create("div",{"class":"itemTitleArrowIcon"},V);z?b.add(d,"itemTitleUpArrow"):b.add(d,"itemTitleDownArrow");this.own(m(V,"click",f.hitch(this,function(ba){b.contains(ba.currentTarget.parentElement,"esriCTDisableToggling")||G||this._togglePanel(t)})));this.own(m(V,"keydown",f.hitch(this,function(ba){if(ba.keyCode===n.ENTER||ba.keyCode===
n.SPACE)b.contains(ba.currentTarget.parentElement,"esriCTDisableToggling")||G||this._togglePanel(t)})))},_createItemContent:function(d,t,z,G){var K=e.create("div",{"class":"esriCTItemContent esriCTRelatedItemContent"},d);G?((z=Pa.decode(this._fetchLayerDescription(z)))&&e.create("div",{"class":"editDescription",innerHTML:this.editorXssFilter.sanitize(z),role:"presentation",tabindex:"0","aria-label":Aa.stripHTML(z)},K),e.place(this.attrInspector.domNode,K,"last")):this._relatedTablesInfo[this.attrInspector._currentFeature._layer.id]&&
this._relatedTablesInfo[this.attrInspector._currentFeature._layer.id].domNode&&e.place(this._relatedTablesInfo[this.attrInspector._currentFeature._layer.id].domNode,K,"last");t&&this._togglePanel(d)},_togglePanel:function(d){var t=c(".esriCTItemTitle",d)[0];var z=c(".itemTitleArrowIcon",d)[0];var G=c(".esriCTItemContent",d)[0];var K=c(".esriCTItemHighlighter",d)[0];t&&G&&!b.contains(d,"esriCTDisableToggling")&&(b.contains(G,"esriCTItemContentActive")?(a.set(K,"backgroundColor","transparent"),b.replace(z,
"itemTitleDownArrow","itemTitleUpArrow"),t.innerHTML===this.nls.relatedItemTitle?this._setTabIndexToListItems(d,!0,"-1"):this._setTabIndexToListItems(d,!1,"-1")):(a.set(K,"backgroundColor",this.config.selectedThemeColor),b.replace(z,"itemTitleUpArrow","itemTitleDownArrow"),t.innerHTML===this.nls.relatedItemTitle?this._setTabIndexToListItems(d,!0,"0"):this._setTabIndexToListItems(d,!1,"0")),b.toggle(G,"esriCTItemContentActive"));this._setWidgetFirstFocusNode("AI",!1)},_setTabIndexToListItems:function(d,
t,z){t?(d=c(".relatedTableFields",d),h.forEach(d,f.hitch(this,function(G){ja.set(G,"tabindex",z)}))):(d=ca.findWidgets(this.attrInspector.domNode),h.forEach(d,f.hitch(this,function(G){G.focusNode&&ja.set(G.focusNode,"tabindex",z)})),h.forEach(c(".esriCTCustomButtons",this.attrInspector.domNode),f.hitch(this,function(G){ja.set(G,"tabindex",z)})),(d=c(".editDescription",this.attrInspector.domNode.parentElement))&&0<d.length&&ja.set(d[0],"tabindex",z),this._editGeomSwitch&&this._editGeomSwitch.domNode&&
ja.set(this._editGeomSwitch.domNode,"tabindex",z),this._setTabIndexToAttachmentSection(z))},_setTabIndexToAttachmentSection:function(d){if(this.attrInspector._attachmentEditor){var t;var z=this.attrInspector._attachmentEditor._attachmentList;(t=this.attrInspector._attachmentEditor._uploadForm)&&"block"===a.get(t,"display")&&ja.set(t.children[0],"tabindex",d);z&&0<z.childNodes.length&&h.forEach(z.childNodes,f.hitch(this,function(G){"#text"!==G.nodeName&&(ja.set(G.children[0],"tabindex",d),ja.set(G.children[1],
"tabindex",d))}))}},_fetchLayerDescription:function(d){var t=this.config.editor.layerInfos;this._traversal&&0<this._traversal.length?h.some(this._traversal,function(G,K){h.some(t,function(V){if(V.featureLayer.id===G)return t=V,!0});1<this._traversal.length&&K+1<this._traversal.length&&(t=t.relationshipInfos)},this):h.some(t,function(G){if(G.featureLayer.id===d)return t=G,!0});if(t.editDescription)var z=t.editDescription;"\x3cbr\x3e"===z&&(z="");return z},_getRelationshipInfo:function(d){var t=d._layer.id;
if(this._traversal&&0<this._traversal.length){var z=this.config.editor.configInfos;h.some(this._traversal,function(K,V){h.some(z,function(X){if(X.featureLayer.id===K)return z=X,!0});1<this._traversal.length&&V+1<this._traversal.length&&(z=z.relationshipInfos)},this);return z.relationshipInfos}var G=null;this.config.editor.configInfos.some(function(K){return K.featureLayer.id===t?(G=K.relationshipInfos,!0):!1});return G},_getSelectedThemeColor:function(){this.config.selectedThemeColor="#000000";var d=
this.appConfig.theme.name;var t=this.appConfig&&this.appConfig.theme&&this.appConfig.theme.styles?this.appConfig.theme.styles[0]:"default";this.appConfig&&this.appConfig.theme&&this.appConfig.theme.customStyles&&this.appConfig.theme.customStyles.mainBackgroundColor?this.config.selectedThemeColor=this.appConfig.theme.customStyles.mainBackgroundColor:w({url:"./themes/"+d+"/manifest.json",content:{f:"json"},handleAs:"json",callbackParamName:"callback"}).then(f.hitch(this,function(z){var G;if(z&&z.styles&&
0<z.styles.length)for(G=0;G<z.styles.length;G++){var K=z.styles[G];if(K.name===t){this.config.selectedThemeColor=K.styleColor;break}}}))},_getRelatedRecordsByRelatedQuery:function(d,t,z,G){var K=new L,V=new T,X=this._jimuLayerInfos.getLayerOrTableInfoById(z).layerObject.objectIdField;V.returnGeometry=!1;V.outSpatialReference=this.map.spatialReference;V.relationshipId=t;V.objectIds=[G];V.outFields=[X];this.loading.show();d.queryRelatedFeatures(V,f.hitch(this,function(ba){var ha=[];h.forEach(ba[G]&&
ba[G].features,function(ma){ha.push(ma.attributes[X])});this.loading.hide();K.resolve(ha)}),f.hitch(this,function(){this.loading.hide();K.resolve([])}));return K},_getCurrentFieldDijit:function(d){var t;h.some(this.attrInspector._currentLInfo.fieldInfos,f.hitch(this,function(z){if(z.name===d)return t=z.dijit,!0}));return t},_updateRefreshButtonState:function(){var d;if(this._refreshButton&&this.config.editor.enableAttributeUpdates)if(this.config.editor.enableAutomaticAttributeUpdates)b.remove(this._refreshButton,
"hidden"),b.contains(this._refreshButton,"esriCTAutoUpdateOnMode")&&this._refreshAttributes();else if(ja.has(this._refreshButton,"hasGeometryDependency"))(d=ja.get(this._refreshButton,"hasGeometryDependency"))&&b.remove(this._refreshButton,"hidden");else if(this.currentLayerInfo.fieldValues){d=!1;for(var t in this.currentLayerInfo.fieldValues){for(var z=0;z<this.currentLayerInfo.fieldValues[t].length;z++){var G=this.currentLayerInfo.fieldValues[t][z];if("Intersection"===G.actionName&&G.enabled){d=
!0;break}if("Address"===G.actionName&&G.enabled){d=!0;break}if("Coordinates"===G.actionName&&G.enabled){d=!0;break}}if(d)break}ja.set(this._refreshButton,"hasGeometryDependency",d);d&&b.remove(this._refreshButton,"hidden")}},_refreshAttributes:function(){this.config.editor.hasOwnProperty("autoSaveAttrUpdates")&&this.config.editor.autoSaveAttrUpdates&&this.currentLayerInfo&&!this.currentLayerInfo.isCache&&(this.canAutoUpdate=!1);this.loading.show();this._getCopyAttributes(this.currentLayerInfo,this.currentFeature.geometry).then(f.hitch(this,
function(d){var t=[];if(this.currentLayerInfo.fieldValues){for(var z in this.currentLayerInfo.fieldValues)for(var G=0;G<this.currentLayerInfo.fieldValues[z].length;G++){var K=this.currentLayerInfo.fieldValues[z][G],V=!1,X=!0,ba=null;if(d&&"Intersection"===K.actionName&&K.enabled){for(ba=0;ba<K.fields.length;ba++){var ha=K.fields[ba];if(d.Intersection.hasOwnProperty(z)&&d.Intersection[z].hasOwnProperty(ha.layerId)&&d.Intersection[z][ha.layerId].hasOwnProperty(ha.field)){ba=d.Intersection[z][ha.layerId][ha.field];
this._setValuesInDijits(z,ba);V=!0;X=!1;d.multipleValues&&d.multipleValues.hasOwnProperty(z)&&0>t.indexOf(z)&&t.push(z);break}}if(V)break}if(d&&"Address"===K.actionName&&K.enabled&&d.Address.hasOwnProperty(K.field)){ba=d.Address[K.field];this._setValuesInDijits(z,ba);X=!1;break}if(d&&"Coordinates"===K.actionName&&K.enabled){K.coordinatesSource&&"myLocation"===K.coordinatesSource?(G=d.MyLocation.Coordinates.hasOwnProperty(K.coordinatesSystem),ba="xy"===K.field||"yx"===K.field?G?this._getOutputString(K.coordinatesSystem,
d.MyLocation.Coordinates[K.coordinatesSystem],K.field):"":G?d.MyLocation.Coordinates[K.coordinatesSystem][K.field]:""):ba="xy"===K.field||"yx"===K.field?this._getOutputString(K.coordinatesSystem,d.Coordinates[K.coordinatesSystem],K.field):d.Coordinates[K.coordinatesSystem][K.field];this._setValuesInDijits(z,ba);X=!1;break}if("Preset"===K.actionName&&K.enabled&&this._usePresetValues){X=!1;break}X&&K.enabled&&("Intersection"===K.actionName||"Address"===K.actionName||"Coordinates"===K.actionName)&&this._setValuesInDijits(z,
null)}if(d)if(d.multipleValues&&0<t.length){var ma={};h.forEach(t,function(da){ma[da]=d.multipleValues[da]});d.multipleValues=ma}else d.multipleValues=null;this._addValuePicker(d)}this.loading.hide();setTimeout(f.hitch(this,function(){this.config.editor.hasOwnProperty("autoSaveAttrUpdates")&&this.config.editor.autoSaveAttrUpdates&&this.currentLayerInfo&&!this.currentLayerInfo.isCache&&!d.multipleValues&&(this._validateFeatureChanged()&&this._autoSaveFeatureEdits(),this.canAutoUpdate=!0);Xa.curNode&&
Xa.curNode.blur()},100))}))},_setValuesInDijits:function(d,t){var z=this._getCurrentFieldDijit(d);d=null;z&&z.set?(z.domNode&&b.contains(z.domNode,"atiTextAreaField")&&void 0!==t&&null!==t&&(t=t.toString()),z.domNode&&b.contains(z.domNode,"atiRichTextField")&&void 0!==t&&(t=null===t?"":t.toString()),z.set("value",t,!0),z.focus()):z&&0<z.length&&(t&&(d=new Date(t)),z[0]&&z[0].set("value",d,!0),1<z.length&&z[1]&&z[1].set("value",d,!0))},_getOrClearSelectableLayers:function(d){var t,z,G=!1,K=!1;var V=
[];d&&(t=Ua.getInstance());this.config.editor.hasOwnProperty("copyLineToPoint")&&this.config.editor.copyLineToPoint.enabled&&(G=!0);this.config.editor.hasOwnProperty("copyPolygonToPoint")&&this.config.editor.copyPolygonToPoint.enabled&&(K=!0);if(this.templatePicker&&(z=this.templatePicker.getSelected())){var X=z.featureLayer;X=X.geometryType}for(var ba in this.map._layers)this.map._layers.hasOwnProperty(ba)&&(z=this.map._layers[ba],z.hasOwnProperty("type")&&"Feature Layer"===z.type&&(d?t.clearSelection(z):
X&&z.hasOwnProperty("geometryType")&&z.geometryType===X?V.push(z):"esriGeometryPoint"===X&&("esriGeometryPolyline"===z.geometryType&&G||"esriGeometryPolygon"===z.geometryType&&K)&&V.push(z)));if(!d)return V},_getSelectedFeature:function(){var d=[];var t=this._getOrClearSelectableLayers(!1);h.forEach(t,f.hitch(this,function(z){d=d.concat(z.getSelectedFeatures())}));return d},_initializeSelectToolWidget:function(){this._selectTool=new jb({map:this.map,updateSelection:!0,geoTypes:["POLYGON","EXTENT",
"FREEHAND_POLYGON"],fullyWithin:!1});this._selectTool.setFeatureLayers(this._getOrClearSelectableLayers(!1));this.own(m(this._selectTool,"unloading",f.hitch(this,function(){this.loading.show();var d=this._getSelectedFeature();if(0===d.length)q({message:this.nls.noFeatureSelectedMessage});else{this._selectTool.deactivate();this._copyFeaturesObj||this._createCopyFeaturesInstance();var t=this._getLayerInfoByID(this.templatePicker.getSelected().featureLayer.id);this._copyFeaturesObj.selectFeaturesToCopy(d,
t);this._setWidgetFirstFocusNode("copyFeatures",!0);this._getOrClearSelectableLayers(!0);this._displayCopyFeatureDiv();this._resetCopyFeatureListHeight()}this.loading.hide()})))},_resetCopyFeatureListHeight:function(){var d=c(".esriCTCopyFeaturesListTitle",this.copyFeaturesMainNode);d&&0<d.length&&(d=d[0]);d=a.getComputedStyle(d).height;d=parseFloat(d);d+=5;var t=c(".esriCTCopyFeaturesHint",this.copyFeaturesMainNode);t&&0<t.length&&(t=t[0]);t=a.getComputedStyle(t).height;t=parseFloat(t);t+=5;var z=
0;this._copyFeaturesObj&&"none"!==this._copyFeaturesObj.applyEditsProgress.domNode.style.display&&(z=a.getComputedStyle(this._copyFeaturesObj.applyEditsProgress.domNode).height,z=parseFloat(z),z+=5);var G=c(".esriCTCopyFeaturesListContent",this.copyFeaturesMainNode);G&&0<G.length&&(G=G[0]);var K=c(".esriCTCopyFeaturesBtnContainer",this.copyFeaturesMainNode);K&&0<K.length&&(K=K[0]);K=a.getComputedStyle(K).height;K=parseFloat(K);var V=a.getComputedStyle(this.copyFeaturesMainNode).height;V=parseFloat(V);
a.set(G,"height",V-(d+K+t+z)+"px")},_removeCopyFeaturesInstance:function(){this._copyFeaturesObj.highlightGraphicsLayer.clear();this._hideCopyFeatureDiv();this._destroyCopyFeatureInstance()},_createCopyFeaturesInstance:function(){this._copyFeaturesObj=new kb({nls:this.nls,layerInfosObj:this._jimuLayerInfos,mainNode:this.copyFeaturesMainNode,appUtils:this.appUtils,map:this.map,parentDomNode:this.domNode,hideMultipleFeatureButton:this._layerHasUniqueFields(),widgetId:this.widgetId,config:this.config,
editUtils:Q,fieldMappingDetails:this.fieldMappingDetails,usePresetValues:this._usePresetValues},e.create("div",{},this.copyFeaturesMainNode));this.own(m(this._copyFeaturesObj,"createSingleFeature",f.hitch(this,function(d){this.loading.show();this._copyFeaturesObj.highlightGraphicsLayer.clear();this._hideCopyFeatureDiv();this._destroyCopyFeatureInstance();d=this._createSingleGeometry(d);var t=this.templatePicker.getSelected().featureLayer;t=this._getLayerInfoByID(t.id);var z=this._updateAllSelectedGeometries([d.graphic],
t,d.layerObj)[0];z.layer=d.layerObj;this._checkAndUpdateFeatureGeometry([z],t).then(f.hitch(this,function(G){(z=G[0])?this._addGraphicToLocalLayer(z,z.attributes):this.loading.hide()}))})));this.own(m(this._copyFeaturesObj,"createMultipleFeatures",f.hitch(this,function(d){this.loading.show();this.allSelectedGeometries=null;if(d&&0<d.length)if(1===d.length){this._removeCopyFeaturesInstance();var t=this.templatePicker.getSelected().featureLayer;t=this._getLayerInfoByID(t.id);var z=this._updateAllSelectedGeometries(d,
t)[0];this._checkAndUpdateFeatureGeometry([z],t).then(f.hitch(this,function(G){z=G[0];this.templatePicker.hasOwnProperty("_selectedInfo")&&this.templatePicker._selectedInfo.hasOwnProperty("selRow")&&(this._selectTemplateIndex=this.templatePicker._selectedInfo.selRow);z?this._addGraphicToLocalLayer(z,z.attributes):this.loading.hide()}))}else this.allSelectedGeometries=d,setTimeout(f.hitch(this,function(){this._addSelectedFeatureInTheLayer(d)}),100);else this._removeCopyFeaturesInstance()})));this.own(m(this._copyFeaturesObj,
"cancelBtnClicked",f.hitch(this,function(){this._onCopyFeatureCancelButtonClicked()})));this._copyFeaturesObj.startup()},_layerHasUniqueFields:function(){var d,t=!1;(d=this.templatePicker.getSelected().featureLayer)&&d.indexes&&0<d.indexes.length&&h.some(d.indexes,f.hitch(this,function(z){if(z.isUnique&&z.fields!==d.objectIdField&&z.fields!==d.globalIdField)return t=!0}));return t},_destroyCopyFeatureInstance:function(){this._copyFeaturesObj&&(this._copyFeaturesObj.destroy(),this._copyFeaturesObj=
null);e.empty(this.copyFeaturesMainNode)},_onCopyFeatureCancelButtonClicked:function(){this._hideCopyFeatureDiv();this._destroyCopyFeatureInstance();this._setWidgetFirstFocusNode("templatePicker",!0);this.templatePicker&&this.templatePicker.clearSelection()},_isNumeric:function(d){return!isNaN(parseFloat(d))&&isFinite(d)},_isGuid:function(d,t){if(!0===t&&(""===d||null===d))return!0;if(""===d||null===d)return!1;"{"===d[0]&&(d=d.substring(1,d.length-1));return/^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/gi.test(d)},
_checkFeatureData:function(d,t){h.forEach(d,function(z){if(t.hasOwnProperty(z.fieldName))switch(z.type){case "esriFieldTypeString":0<z.length&&null!==t[z.fieldName]&&t[z.fieldName].length>z.length&&(t[z.fieldName]=t[z.fieldName].substring(0,z.length));break;case "esriFieldTypeGUID":this._isGuid(t[z.fieldName],!1)&&("{"!==t[z.fieldName][0]&&(t[z.fieldName]="{"+t[z.fieldName]),"}"!==t[z.fieldName][t[z.fieldName].length-1]&&(t[z.fieldName]+="}"));break;case "esriFieldTypeSingle":case "esriFieldTypeDouble":this._isNumeric(t[z.fieldName])&&
(t[z.fieldName]=parseFloat(t[z.fieldName]));break;case "esriFieldTypeDate":this._isNumeric(t[z.fieldName])&&(t[z.fieldName]=parseInt(t[z.fieldName],10));break;case "esriFieldTypeSmallInteger":case "esriFieldTypeInteger":this._isNumeric(t[z.fieldName])&&(t[z.fieldName]=parseInt(t[z.fieldName],10))}},this);return t},_addSelectedFeatureInTheLayer:function(d){var t=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeDouble","esriFieldTypeSingle"],z=this.templatePicker.getSelected()||this._currentSelectedTemplate;
var G=[];this.copyMultipleFeatureGraphics=[];this.requiredFieldsArray=this.nullAttributeCountRecord=null;var K=this._getLayerInfoByID(z.featureLayer.id),V=!1,X;for(X in K.fieldValues){for(var ba=K.fieldValues[X],ha=0;ha<ba.length;ha++)"Coordinates"===ba[ha].actionName&&ba[ha].enabled&&ba[ha].hasOwnProperty("coordinatesSource")&&"myLocation"===ba[ha].coordinatesSource&&(V=!0);if(V)break}d=this._updateAllSelectedGeometries(d,K);this._checkAndUpdateFeatureGeometry(d,K).then(f.hitch(this,function(ma){this.nullAttributeCountRecord=
f.clone(z.template.prototype.attributes);for(var da in this.nullAttributeCountRecord)this.nullAttributeCountRecord[da]=0;this.requiredFieldsArray=this._getRequiredFields(K.fieldInfos);this._myLocationInfoForMultipleFeatures=null;this._getMyLocationInfo(V).then(f.hitch(this,function(na){this._myLocationInfoForMultipleFeatures=na;h.forEach(ma,f.hitch(this,function(pa){pa=this._getCopyAttributes(K,pa.geometry);G.push(pa)}));D(G).then(f.hitch(this,function(pa){h.forEach(ma,f.hitch(this,function(va,ya){ya=
pa[ya];var xa=f.clone(va.attributes),ta=f.clone(z.template.prototype.attributes),Ba=z.featureLayer.id,Ha=va.layer.id;if(this.fieldMappingDetails[Ba]&&this.fieldMappingDetails[Ba][Ha])for(var Da in ta){var Fa;if(!ta.hasOwnProperty(Da)||null===ta[Da]||this.config.editor.overrideDefaultsByCopiedFeature){var Ia=this.fieldMappingDetails[Ba][Ha][Da];var Ra=this.templatePicker.getSelected().featureLayer.getField(Da);if(Ia)if(this._jimuLayerInfos.getLayerInfoById(Ha)&&this._jimuLayerInfos.getLayerInfoById(Ha).layerObject&&
(Fa=this._jimuLayerInfos.getLayerInfoById(Ha).layerObject.getField(Ia)),Fa&&Fa.domain&&Fa.domain.codedValues&&!Ra.domain)h.some(Fa.domain.codedValues,f.hitch(this,function(Sa){if(Sa.code===xa[Ia])return-1!==t.indexOf(Ra.type)?ta[Da]=Sa.code:ta[Da]=Sa.name,!0}));else if(Fa&&"esriFieldTypeDate"===Fa.type&&"esriFieldTypeDate"!==Ra.type&&xa[Ia]){var ob=this._getPopupFieldInfo(Ia,this._jimuLayerInfos.getLayerInfoById(Ha));ta[Da]=Aa.getDateTimeStrByFieldInfo(xa[Ia],ob)}else ta[Da]=xa[Ia]}}else for(Da in xa)if(!ta.hasOwnProperty(Da)||
null===ta[Da]||this.config.editor.overrideDefaultsByCopiedFeature)ta[Da]=xa[Da];this._modifyAttributesWithPresetValues(ta,K,ya);for(var Ka in ta)Fa=this._trimAttrValue(ta[Ka]),-1!==this.requiredFieldsArray.indexOf(Ka)&&ta.hasOwnProperty(Ka)&&-1!==[null,void 0,""].indexOf(Fa)&&(this.nullAttributeCountRecord[Ka]+=1);this.copyMultipleFeatureGraphics.push({attributes:ta,geometry:va.geometry})}));var wa=[],ua;for(ua in this.nullAttributeCountRecord)0<this.nullAttributeCountRecord[ua]&&wa.push(W.getFieldInfoByFieldName(K.fieldInfos,
ua));if(0<wa.length)this.loading.hide(),wa=new mb({requiredFieldsInfos:wa,nls:this.nls,presetUtils:W,AttributesCount:this.nullAttributeCountRecord}),this.own(m(wa,"providedValuesToRequiredFields",f.hitch(this,function(va){this.loading.show();var ya=[];h.forEach(this.copyMultipleFeatureGraphics,f.hitch(this,function(xa){var ta=xa.attributes,Ba;for(Ba in ta){var Ha=this._trimAttrValue(ta[Ba]);-1!==this.requiredFieldsArray.indexOf(Ba)&&ta.hasOwnProperty(Ba)&&-1!==[null,void 0,""].indexOf(Ha)&&(ta[Ba]=
va[Ba])}ta=this._checkFeatureData(K.fieldInfos,ta);xa=new U(xa.geometry,null,ta);xa.preEditAttrs=l.parse(l.stringify(xa.attributes));ya.push(xa)}));this._applyEdits(ya)})));else{var Ea=[];h.forEach(this.copyMultipleFeatureGraphics,f.hitch(this,function(va){var ya=va.attributes;ya=this._checkFeatureData(K.fieldInfos,ya);va=new U(va.geometry,null,ya);va.preEditAttrs=l.parse(l.stringify(va.attributes));Ea.push(va)}));this._applyEdits(Ea)}}),f.hitch(this,function(pa){this.loading.hide();q({message:this.nls.addingFeatureError+
" "+pa.message})}))}))}))},_getPopupFieldInfo:function(d,t){var z;if(z=t.getPopupInfo())t=z.fieldInfos,h.some(t,function(K){if(K.fieldName===d)return G=K,!0});else var G=Aa.getPopupFieldFromLayerField(t.layerObject.getField(d));return G},_applyEdits:function(d){var t=[];this._copyFeaturesObj.setProgressPercentage(0);this._resetCopyFeatureListHeight();d=this._createApplyEditsChunks(d);D(d).then(f.hitch(this,function(z){var G=0;h.forEach(z,f.hitch(this,function(V){h.forEach(V,f.hitch(this,function(X){t.push(X);
G++}))}));0===G&&this._removeCopyFeaturesInstance();if(0<G){z=this._getLayerInfoByID(this.templatePicker.getSelected().featureLayer.id);this._copyFeaturesObj.selectFeaturesToCopy(t,z);var K=Ga.substitute(this.nls.addingFeatureErrorCount,{copyFeatureErrorCount:G})}0===this.objectIdArr.length&&0<G?(this.loading.hide(),this._promptUserToCopyFailedFeatures(K)):(0<this.objectIdArr.length&&0<G&&this._promptUserToCopyFailedFeatures(K),this._selectFeaturesInTheLayer(this.objectIdArr));this.loading.hide()}))},
_changeSelectToolState:function(d){this._getOrClearSelectableLayers(!1===d?!1:!0);("EXTENT"===this.currentDrawType||"POLYGON"===this.currentDrawType||"FREEHAND_POLYGON"===this.currentDrawType)&&this.templatePicker&&this.templatePicker.getSelected()&&this._selectTool?this._selectTool.activate():this._selectTool&&this._selectTool.isActive()&&this._selectTool.deactivate();this.currentDrawType&&this.map.setInfoWindowOnClick(!1)},_addMenuItem:function(d,t,z){d=f.mixin(d,{onClick:f.hitch(this,this._drawingToolClick(z,
d))});d=new za(d);t.addChild(d)},_hideCopyFeatureDiv:function(){b.add(this.copyFeaturesMainNode,"esriCTHidden");c(".jimu-widget-smartEditor .templatePickerMainDiv")[0].style.display="block";var d=null,t=null;if(this.templatePicker&&this.templatePicker.grid){d=this.templatePicker.getSelected();var z=0;this.templatePicker._selectedInfo&&this.templatePicker._selectedInfo.hasOwnProperty("selRow")&&(t=this.templatePicker._selectedInfo,z=0<this.templatePicker._selectedInfo.selRow?this.templatePicker._selectedInfo.selRow-
1:this.templatePicker._selectedInfo.selRow);this.templatePicker.update();this.templatePicker.grid.scrollToRow(z);setTimeout(f.hitch(this,function(){this.config.editor.hasOwnProperty("keepTemplateSelected")&&!0===this.config.editor.keepTemplateSelected&&null!==d&&this.templatePicker.grid.store.fetch({onComplete:f.hitch(this,function(G){var K=(G=this.templatePicker._locate(d,t,G))&&this.templatePicker.grid.views.views[0].getCellNode(G[0],G[1]);K&&z>this.templatePicker.grid.rowsPerPage&&this.templatePicker._rowClicked({cellNode:K,
rowIndex:G[0],cellIndex:G[1]},!0)})});this.templatePicker.grid.scrollToRow(z)}),500)}},_displayCopyFeatureDiv:function(){c(".jimu-widget-smartEditor .templatePickerMainDiv")[0].style.display="none";b.remove(this.copyFeaturesMainNode,"esriCTHidden");if("DashboardTheme"===this.appConfig.theme.name){var d=c(".esriCTCopyFeaturesMainDiv",this.domNode)[0];var t=a.get(d.parentElement).backgroundColor;a.set(d,"backgroundColor",t)}},_createSingleGeometry:function(d){var t=d[0]._layer.geometryType;if("esriGeometryPolyline"===
t)var z=this._createSinglePolyline(d);else"esriGeometryPolygon"===t?z=this._createSinglePolygon(d):"esriGeometryPoint"===t&&(z=d[0].geometry);return{graphic:new U(z,null,d[0].attributes),layerObj:d[0].getLayer()}},_createSinglePolyline:function(d){var t=new ea(new Qa(d[0].geometry.spatialReference));h.forEach(d,f.hitch(this,function(z){z.geometry&&z.geometry.paths&&h.forEach(z.geometry.paths,function(G){t.addPath(G)})}));return t},_createSinglePolygon:function(d){var t=new N(new Qa(d[0].geometry.spatialReference));
h.forEach(d,f.hitch(this,function(z){z.geometry&&z.geometry.rings&&h.forEach(z.geometry.rings,function(G){t.addRing(G)})}));return t},_selectFeaturesInTheLayer:function(d){var t=(this.templatePicker.getSelected()||this._currentSelectedTemplate).featureLayer;var z=this._getLayerInfoByID(t.id);this.map.infoWindow.hide();h.forEach(this._attributeInspectorCollection,function(V){V.destroy()});if(t.isQueryable()){this._traversal=[];this._nodesCollection=[];this._paginationNodeCollection=[];this._buttonsWrapper=
[];this._attributeInspectorCollection=[];this._relatedTablesInfo={};this._createAttributeInspector([z],!0,t);z=this.map.getLayersVisibleAtScale().filter(f.hitch(this,function(V){return V.type&&"Feature Layer"===V.type&&V.url?h.some(this.config.editor.configInfos,f.hitch(this,function(X){return X.layerId===V.id&&this._hasAnyEditableLayerInRelation([X])?!0:!1})):!1}));z=z.filter(f.hitch(this,function(V){try{return this.map.getLayer(V.id).visible}catch(X){return console.log(X+" Check for visible failed"),
!0}}));var G=[];this.currentFeature=null;this.geometryChanged=!1;this.currentLayerInfo=null;z=new H;var K=Date.now();z.objectIds=d;z.where=K+" \x3d "+K;z.outFields=["*"];t.selectFeatures(z,S.SELECTION_NEW,f.hitch(this,function(V){var X=[];h.forEach(V,function(ba){ba.allowDelete=!0;t.getEditCapabilities({feature:ba}).canDelete||(ba.allowDelete=!1);ba.preEditAttrs=l.parse(l.stringify(ba.attributes));X.push(ba)},this);G=G.concat(X);0<G.length&&(this.updateFeatures=G,this.config.editor.removeOnSave?(this.loading.hide(),
this._copyFeaturesObj||this._clearTemplateSelection()):this._showTemplate(!1))}),f.hitch(this,function(){q({message:this.nls.selectingFeatureError});this.loading.hide()}))}else this.loading.hide()},_clearTemplateSelection:function(){var d=null,t=null;if(this.templatePicker&&this.templatePicker.grid){d=this.templatePicker.getSelected();var z=this._selectTemplateIndex;this.templatePicker._selectedInfo&&this.templatePicker._selectedInfo.hasOwnProperty("selRow")&&(t=this.templatePicker._selectedInfo,
this._selectTemplateIndex=z=0<this.templatePicker._selectedInfo.selRow?this.templatePicker._selectedInfo.selRow-1:this.templatePicker._selectedInfo.selRow);this.templatePicker.grid.scrollToRow(z);setTimeout(f.hitch(this,function(){this.templatePicker&&(this.templatePicker.clearSelection(),this.config.editor.hasOwnProperty("keepTemplateSelected")&&!0===this.config.editor.keepTemplateSelected&&null!==d&&this.templatePicker.grid.store.fetch({onComplete:f.hitch(this,function(G){var K=(G=this.templatePicker._locate(d,
t,G))&&this.templatePicker.grid.views.views[0].getCellNode(G[0],G[1]);K&&(this.templatePicker._rowClicked({cellNode:K,rowIndex:G[0],cellIndex:G[1]},!0),this._activateTemplateToolbar(null),this.templatePicker.grid.scrollToRow(z))})}),this._selectTemplateIndex=0,this.templatePicker.grid.scrollToRow(z))}),500)}},_updatedDrawingOptions:function(){for(var d in Ca)h.forEach(Ca[d],f.hitch(this,function(t,z){t.hasOwnProperty("_drawType")&&("EXTENT"===t._drawType?Ca[d][z].label=this.nls.copyFeaturesWithRect:
"POLYGON"===t._drawType?Ca[d][z].label=this.nls.copyFeaturesWithPolygon:"FREEHAND_POLYGON"===t._drawType&&(Ca[d][z].label=this.nls.copyFeaturesWithLasso))}))},_deactivateAllTools:function(){this.drawToolbar&&this.drawToolbar.deactivate();this._selectTool&&this._selectTool.deactivate()},_updateAllSelectedGeometries:function(d,t,z){var G=[],K=this._getInfoDetails(t);h.forEach(d,f.hitch(this,function(V){var X=V.getLayer();if(null===X||""===X||void 0===X)X=z;var ba=this._getLayerInfoByID(X.id);ba||(this._jimuLayerInfos.getLayerOrTableInfoById(X.id)?
ba=Q.createDefaultConfigInfo(this._jimuLayerInfos.getLayerOrTableInfoById(X.id)):this._jimuLayerInfos.getLayerInfoById(X.id)&&(ba=Q.createDefaultConfigInfo(this._jimuLayerInfos.getLayerInfoById(X.id))));if(ba){ba=this._getInfoDetails(ba);var ha={};var ma=t.featureLayer.id;if(this.fieldMappingDetails[ma]&&this.fieldMappingDetails[ma][X.id])ha=f.clone(V.attributes);else for(var da in V.attributes)ma=da.toLowerCase(),K.hasOwnProperty(ma)&&ba.hasOwnProperty(ma)&&K[ma].type===ba[ma].type&&(ha[K[ma].name]=
f.clone(V.attributes[da]));V=new U(V.geometry,null,ha);V.layer=X;G.push(V)}}));return G},_checkAndUpdateFeatureGeometry:function(d,t){var z=[];var G=new L;h.forEach(d,f.hitch(this,function(K){var V=K.layer;V.geometryType!==t.featureLayer.geometryType&&z.push(this._getUpdatedGeometry(V.geometryType,K))}));D(z).then(f.hitch(this,function(){G.resolve(d)}));return G.promise},_getUpdatedGeometry:function(d,t){var z=new L;featureGeometry=t.geometry;if("esriGeometryPolygon"===d)d=featureGeometry.getCentroid(),
fb.intersects(d,featureGeometry)?(t.geometry=featureGeometry.getCentroid(),z.resolve()):this.geometryService.labelPoints([featureGeometry],f.hitch(this,function(K){t.geometry=K[0];z.resolve()}));else{d=0;var G=new ea({paths:featureGeometry.paths.flat(),spatialReference:featureGeometry.spatialReference});"end"===this.config.editor.copyLineToPoint.type&&(d=G.paths.length-1);t.geometry=new Na(G.paths[d][0],G.paths[d][1],this.map.spatialReference);z.resolve()}return z.promise},_getInfoDetails:function(d){var t=
{};h.forEach(d.fieldInfos,f.hitch(this,function(z){t[z.name.toLowerCase()]={name:z.name,type:z.type}}));return t},_setWidgetFirstFocusNode:function(d,t){d=this._getFirstAndLastFocusNode(d);d.firstNode&&d.lastNode&&(Aa.initFirstFocusNode(this.domNode,d.firstNode),Aa.initLastFocusNode(this.domNode,d.lastNode),t&&Aa.isAutoFocusFirstNodeWidget(this)&&Aa.focusFirstFocusNode(this.domNode))},_getFirstAndLastFocusNode:function(d){var t={};if("templatePicker"===d)t.firstNode=this._getFirstFocusNodeForTemplatePickerScreen(),
t.lastNode=this._getLastFocusNodeForTemplatePickerScreen();else if("AI"===d){if(this.attrInspector&&this.attrInspector.attributeTable){var z,G;d=ca.findWidgets(this.attrInspector.attributeTable);this.attrInspector.domNode.parentElement&&this.attrInspector.domNode.parentElement.parentElement&&((z=c(".esriCTItemContent",this.attrInspector.domNode.parentElement.parentElement))&&0<z.length&&(G=b.contains(z[0],"esriCTItemContentActive")?"0":"-1"),this._setTabIndexToListItems(null,!1,G));h.forEach(d,f.hitch(this,
function(K){K.focusNode&&ja.get(K.focusNode,"disabled")&&(ja.set(K.focusNode,"disabled",!1),ja.set(K.focusNode,"readonly",!0));if(K.focusNode&&K.domNode.parentElement&&K.domNode.parentElement.parentElement){var V=c(".atiLabel",K.domNode.parentElement.parentElement);V&&V[0]&&(V=V[0].innerHTML,0<=V.indexOf('\x3ca class\x3d"asteriskIndicator"\x3e *\x3c/a\x3e')?(V=V.replace('\x3ca class\x3d"asteriskIndicator"\x3e *\x3c/a\x3e',""),ja.set(K.focusNode,"aria-required","true")):0<=V.indexOf('\x3cspan class\x3d"atiRequiredField"\x3e *\x3c/span\x3e')?
(V=V.replace('\x3cspan class\x3d"atiRequiredField"\x3e *\x3c/span\x3e',""),ja.set(K.focusNode,"aria-required","true")):ja.set(K.focusNode,"aria-required","false"),ja.set(K.focusNode,"aria-label",V))}}))}t.firstNode=this._getFirstFocusNodeForAttributeInspectorScreen();t.lastNode=this._getLastFocusNodeForAttributeInspectorScreen()}else"copyFeatures"===d?t=this._getFirstAndLastFocusNodeForCopyFeaeturesScreen():"noFeatures"===d&&(t.firstNode=this.noFeatureMessage,t.lastNode=this.noFeatureCancelBtn);return t},
_getFirstFocusNodeForTemplatePickerScreen:function(){if(this.config.editor.hasOwnProperty("displayPresetTop")&&!0===this.config.editor.displayPresetTop&&"block"===a.get(this.presetFieldsTableDiv,"display"))var d=ca.byId("savePresetValueSwitch").domNode;else"block"===a.get(this.templateTitle,"display")?d=this.templateTitle:this.config.editor.useFilterEditor?d=this._filterEditor.selectDropDown:this.drawingTool&&!0===this.config.editor.displayShapeSelector||this.config.editor.hasOwnProperty("createNewFeaturesFromExisting")&&
!0===this.config.editor.createNewFeaturesFromExisting?d=this.drawingTool.focusNode:this.config.editor.autoSaveEdits?d=ca.byId("autoSaveSwitch").domNode:"block"===a.get(this.presetFieldsTableDiv,"display")&&(d=ca.byId("savePresetValueSwitch").domNode);return d},_getLastFocusNodeForTemplatePickerScreen:function(){if(this.config.editor.hasOwnProperty("displayPresetTop")&&!1===this.config.editor.displayPresetTop&&"block"===a.get(this.presetFieldsTableDiv,"display")){var d=c("#eePresetValueBody")[0];d&&
(d=c(".preset-value-editable .ee-inputField"),d.reverse(),h.some(d,f.hitch(this,function(z){if(!b.contains(z.parentElement.parentElement,"esriCTHidden"))return t=1<z.parentElement.children.length?z.parentElement.children[1]:z,!0})));if(!t)var t=ca.byId("savePresetValueSwitch").domNode}else if(this.config.editor.autoSaveEdits&&!this._creationDisabledOnAll)t=ca.byId("autoSaveSwitch").domNode;else if((!0===this.config.editor.displayShapeSelector||this.config.editor.hasOwnProperty("createNewFeaturesFromExisting")&&
!0===this.config.editor.createNewFeaturesFromExisting)&&!this._creationDisabledOnAll&&this.drawingTool)t=this.drawingTool.focusNode;else if(this.config.editor.useFilterEditor&&!this._creationDisabledOnAll)t=this._filterEditor.filterTextBox;else if("block"===a.get(this.templateTitle,"display"))t=this.templateTitle;else if("block"===a.get(this.presetFieldsTableDiv,"display")){if(d=c("#eePresetValueBody")[0])d=c(".preset-value-editable .ee-inputField"),d.reverse(),h.some(d,f.hitch(this,function(z){if(!b.contains(z.parentElement.parentElement,
"esriCTHidden"))return t=1<z.parentElement.children.length?z.parentElement.children[1]:z,!0}));t||(t=ca.byId("savePresetValueSwitch").domNode)}return t},_getFirstFocusNodeForAttributeInspectorScreen:function(){if(this.config.editor.showActionButtonsAbove)var d=this.cancelButton;else if(1===this.attrInspector._numFeatures){var t=c(".esriCTItem",this.contentWrapper);var z=c(".editDescription",this.contentWrapper);t&&0<t.length&&!b.contains(t[0],"esriCTDisableToggling")?d=t[0].children[0]:z&&0<z.length?
d=z[0]:this.attrInspector&&this.attrInspector.attributeTable&&(t=ca.findWidgets(this.attrInspector.attributeTable),h.some(t,f.hitch(this,function(G){if(G.focusNode&&!b.contains(G.domNode.parentElement.parentElement,"hideField"))return d=G.focusNode,!0})),!d&&this.attrInspector._attachmentEditor&&"block"===a.get(this.attrInspector._attachmentEditor.domNode,"display")&&((t=this.attrInspector._attachmentEditor._attachmentList.childNodes)&&0<t.length&&t[0].children?d=t[0].children[0]:d||this.attrInspector._attachmentEditor._uploadForm&&
"block"===a.get(this.attrInspector._attachmentEditor._uploadForm,"display")&&(d=this.attrInspector._attachmentEditor._uploadForm.children[0])),!d&&this.attrInspector._attachmentUploader&&this.attrInspector._attachmentUploader.attachmentUploader&&(t=c("form",this.attrInspector._attachmentUploader.attachmentUploader))&&0<t.length&&(t=t[0],d="none"!==a.get(t.children[0],"display")?t.children[0]:t.children[1]),2>this._traversal.length&&this._editGeomSwitch.domNode&&!d&&"block"===a.get(this._editGeomSwitch.domNode.parentNode,
"display")&&(d=this._editGeomSwitch.domNode),d||(d=this.cancelButton))}else 1<this.attrInspector._numFeatures&&(d=ca.findWidgets(this.attrInspector.navButtons)[0].focusNode);return d},_getLastFocusNodeForAttributeInspectorScreen:function(){if(!this.config.editor.showActionButtonsAbove){var d=c(".saveButton",this.buttonHeader)[0];if(d&&b.contains(d,"jimu-state-disabled"))if(d=c(".deleteButton",this.buttonHeader),0<d.length){d=d[0];var t="block"===a.get(d,"display")?d:this.cancelButton}else t=this.cancelButton;
else t=d}d=c(".detailsContainer",this.mainContainer);d=h.filter(d,function(z){if(!b.contains(z,"hidden"))return z});d=c(".esriCTRelatedItemContent",d[0]);!t&&d&&0<d.length&&(b.contains(d[0],"esriCTItemContentActive")?t=c(".esriCTLastRelatedItem",d[0])[0]:(d=c("[isrelateditem\x3dtrue]",this.mainContainer))&&0<d.length&&(t=d[d.length-1]));t||(d=c(".esriCTActionButtons",this.attrInspector.domNode),h.forEach(d,f.hitch(this,function(z){"block"===a.get(z,"display")&&(t=z)})));2>this._traversal.length&&
this._editGeomSwitch.domNode&&!t&&"block"===a.get(this._editGeomSwitch.domNode.parentNode,"display")&&(t=this._editGeomSwitch.domNode);!t&&this.attrInspector._attachmentEditor&&"block"===a.get(this.attrInspector._attachmentEditor.domNode,"display")&&(this.attrInspector._attachmentEditor._uploadForm&&"block"===a.get(this.attrInspector._attachmentEditor._uploadForm,"display")?t=this.attrInspector._attachmentEditor._uploadForm:(d=this.attrInspector._attachmentEditor._attachmentList.childNodes)&&0<d.length&&
(d=d[d.length-1],t="block"===a.get(d.children[1],"display")?d.children[1]:d.children[0]));!t&&this.attrInspector&&this.attrInspector.attributeTable&&(d=ca.findWidgets(this.attrInspector.attributeTable),d.reverse(),h.some(d,f.hitch(this,function(z){if(z.focusNode&&!b.contains(z.domNode.parentElement.parentElement,"hideField"))return t=z.focusNode,!0})));!t&&1<this.attrInspector._numFeatures&&(d=ca.findWidgets(this.attrInspector.navButtons),t=d[d.length-1].focusNode);!t&&this.config.editor.showActionButtonsAbove&&
(d=c(".saveButton",this.buttonHeader)[0],t=b.contains(d,"jimu-state-disabled")?this.cancelButton:d);return t},_getFirstAndLastFocusNodeForCopyFeaeturesScreen:function(){return{firstNode:this._copyFeaturesObj.warningMessage,lastNode:this._copyFeaturesObj.cancelBtn}},_canShowValuePicker:function(){var d=this.config.editor.hasOwnProperty("showValuePicker")?this.config.editor.showValuePicker:!1;this.config.editor.hasOwnProperty("autoSaveEdits")&&!0===this._autoSaveRuntime&&(d=!1);return d},_addValuePicker:function(d){var t=
{},z=[];this._removePreviousValuePickerButtons();d.multipleValues&&this._canShowValuePicker()?(this.currentMultipleValues=d.multipleValues,d=c("tr",this.attrInspector.attributeTable),h.forEach(d,f.hitch(this,function(G){var K=ja.get(G.children[0],"data-fieldname");if(K&&this.currentMultipleValues.hasOwnProperty(K)){var V=ja.get(G.children[0],"innerHTML");t[K]=V;var X=this._getCurrentFieldDijit(K),ba=!1;X&&(1<X.length?(ba=b.contains(X[0].domNode,"dijitDisabled"),b.add(X[0].domNode,"multipleValueDijit"),
b.add(X[1].domNode,"multipleValueDijit")):(ba=b.contains(X.domNode,"dijitDisabled"),b.add(X.domNode,"multipleValueDijit")));ba&&z.push(K);this._createValuePickerButton(K,V,G.children[1],ba,X)}})),z.length!==Object.keys(t).length&&this._showValuePicker(null,t,z)):(this.currentMultipleValues=null,d.multipleValues=null)},_removePreviousValuePickerButtons:function(){c(".esriCTValuePickerButton",this.attrInspector.attributeTable).forEach(e.destroy);c(".multipleValueDijit",this.attrInspector.attributeTable).removeClass("multipleValueDijit")},
_createValuePickerButton:function(d,t,z,G,K){var V={},X="esriCTValuePickerButton";G&&(X+=" disabled");V[d]=t;var ba=e.create("div",{"class":X,tabindex:0,role:"button","aria-label":this.nls.valuePicker.buttonTooltip},z);this.own(m(ba,"click",f.hitch(this,function(){b.contains(ba,"disabled")||this._showValuePicker(d,V,[],K)})));this.own(m(ba,"keydown",f.hitch(this,function(ha){ha.keyCode!==n.ENTER&&ha.keyCode!==n.SPACE||b.contains(ba,"disabled")||this._showValuePicker(d,V,[],K)})))},_showValuePicker:function(d,
t,z,G){this.currentMultipleValues&&(this.valuePicker&&this.valuePicker.hideDialog(),this.valuePicker=new lb({nls:this.nls,multipleValues:this.currentMultipleValues,layerInfo:this.currentLayerInfo,showForField:d,fieldLabels:t,disabledFields:z}),d&&this.valuePicker.setValue(this.valuePicker.showForField,G),this.own(m(this.valuePicker,"value-selected",f.hitch(this,function(K){this.config.editor.hasOwnProperty("autoSaveAttrUpdates")&&this.config.editor.autoSaveAttrUpdates&&(this.canAutoUpdate=!1);var V=
c("tr",this.attrInspector.attributeTable);h.forEach(V,f.hitch(this,function(X){(X=ja.get(X.children[0],"data-fieldname"))&&K.hasOwnProperty(X)&&this._setValuesInDijits(X,K[X])}));this.config.editor.hasOwnProperty("autoSaveAttrUpdates")&&this.config.editor.autoSaveAttrUpdates&&setTimeout(f.hitch(this,function(){this.currentLayerInfo&&!this.currentLayerInfo.isCache&&this._autoSaveFeatureEdits();this.canAutoUpdate=!0}),100)}))))},_getRequiredFields:function(d){var t=[];h.forEach(d,f.hitch(this,function(z){!z.nullable&&
z.editable&&t.push(z.name)}));return t},_trimAttrValue:function(d){return"string"===typeof d?d.trim():d},_refreshLayerTitle:function(){var d=c(".esriCTItemTitle",this.domNode)[0];this.attrInspector._currentFeature&&ja.set(d,"innerHTML",Aa.sanitizeHTML(this.attrInspector._currentFeature._layer.name))},_getNewCurrentLocation:function(){var d=!1;this.appConfig&&this.appConfig.widgetOnScreen&&this.appConfig.widgetOnScreen.widgets&&0<this.appConfig.widgetOnScreen.widgets.length&&h.some(this.appConfig.widgetOnScreen.widgets,
f.hitch(this,function(t){if(t.hasOwnProperty("name")&&"MyLocation"===t.name&&t.hasOwnProperty("visible")&&!0===t.visible)return this.publishData({type:"getCurrentLocation"}),d=!0}));d?setTimeout(f.hitch(this,function(){if(this._moveToGPSDef)var t=this._moveToGPSDef;else this._myLocationInfoDef&&(t=this._myLocationInfoDef);t&&!t.isResolved()&&this._fetchCurrentLocation()}),1E3):this._fetchCurrentLocation()},_fetchCurrentLocation:function(){var d=new ib({map:this.map,highlightLocation:!1,setScale:!1,
centerAt:!1,geolocationOptions:{enableHighAccuracy:!0}});this.own(m(d,"locate",f.hitch(this,function(t){this._moveToGPSDef&&this._moveToGPSDef.resolve(t);this._myLocationInfoDef&&this._myLocationInfoDef.resolve(t);setTimeout(f.hitch(this,function(){d.destroy()}),50)})));this.own(m(d,"load",f.hitch(this,function(){d.locate()})));d.startup()},_getOutputString:function(d,t,z){return"xy"===z?t.x+" "+t.y:t.y+" "+t.x},_createApplyEditsChunks:function(d){this.objectIdArr=[];var t=[];var z=this._chunkSizeForPointGeometry;
var G=this.templatePicker.getSelected()||this._currentSelectedTemplate;G.featureLayer&&"esriGeometryPoint"!==G.featureLayer.geometryType&&(z=this._chunkSizeForPolygonAndLineGeometry);G=Math.ceil(d.length/z);for(var K=this.processedChunksCount=0;K<G;K++){var V=d.splice(0,z);var X=this.allSelectedGeometries.splice(0,z);V=this._performApplyEditsOnChunks(G,V,X);t.push(V)}return t},_performApplyEditsOnChunks:function(d,t,z){var G=[],K=new L;(this.templatePicker.getSelected()||this._currentSelectedTemplate).featureLayer.applyEdits(t,
null,null,f.hitch(this,function(V){this._calculateProgressPecentage(d);h.forEach(V,f.hitch(this,function(X,ba){X.success?(this.objectIdArr.push(X.objectId),this._copyFeaturesObj.highlightGraphicsLayer.remove(z[ba])):G.push(z[ba])}));K.resolve(G)}),f.hitch(this,function(V){console.log(V);this._calculateProgressPecentage(d);K.resolve(z)}));return K.promise},_calculateProgressPecentage:function(d){this.processedChunksCount+=1;d=100*this.processedChunksCount/d;this._copyFeaturesObj.setProgressPercentage(d);
100<=d&&this._resetCopyFeatureListHeight()},_autoSaveFeatureEdits:function(){var d=c(".saveButton",this.buttonHeader)[0];d&&m.emit(d,"click",{cancelable:!0,bubbles:!0})},_promptUserToCopyFailedFeatures:function(d){var t=new Ja({titleLabel:this.nls.copyFeatureFailedPopupTitle,width:485,maxHeight:250,autoHeight:!0,"class":this.baseClass,content:d,buttons:[{label:this.nls.no,onClick:f.hitch(this,function(){t.close()})},{label:this.nls.tryAgainButtonLabel,onClick:f.hitch(this,function(){this._copyFeaturesObj&&
this._copyFeaturesObj.createMultipleFeaturesBtn.click();t.close()})}]})}})});