// 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:{"widgets/CostAnalysis/create-load-project":function(){define("dojo/_base/declare jimu/BaseWidget dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./create-load-project.html dojo/_base/lang dojo/_base/array dojo/on dojo/dom-construct ./item-list dijit/form/ValidationTextBox jimu/dijit/formSelect esri/tasks/query esri/graphic esri/tasks/QueryTask esri/graphicsUtils dojo/Deferred esri/layers/FeatureLayer dojo/promise/all jimu/dijit/Message dojo/dom-style dojo/query ./update-project-cost dojo/dom-attr dijit/focus dojo/dom-class dojo/keys jimu/utils dojo/_base/event".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v,b,D,h,B,H,T){return Q([I,J,G],{templateString:u,baseClass:"jimu-widget-cost-analysis-create-load-project",highlighterColor:"#000",projectLayer:null,paneListData:[],_numberFieldTypes:["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],projectNameOptions:[],projectNameField:null,projectDescField:null,_updateProjectCostWidget:null,projectNameTextBox:null,postCreate:function(){this.inherited(arguments);
this.projectNameField=this.config.projectLayerFields.PROJECTNAME;this.projectDescField=this.config.projectLayerFields.DESCRIPTION;this.paneListData=[];this.projectLayer=this.layerInfosObj.getLayerInfoById(this.config.projectSettings.projectLayer).layerObject;this.projectNameOptions=[{label:this.nls.createLoadProject.selectProject,value:"defaultSelectProjectNameOption"}];this._createProjectUI();this._loadProjectUI()},startup:function(){this.inherited(arguments);this._initializeData();this._fetchWidgetTopNode();
this.paneListData=[{title:this.nls.createLoadProject.createProjectPaneTitle,content:this.createProjectContainer,isOpen:!0,tabindex:"0",createProjectTab:!0,"aria-label":this.nls.createLoadProject.createProjectPaneTitle,role:"button",paneName:"creatProject"},{title:this.nls.createLoadProject.loadProjectPaneTitle,content:this.loadProjectContainer,isOpen:!1,loadProjectTab:!0,tabindex:"0","aria-label":this.nls.createLoadProject.loadProjectPaneTitle,role:"button",paneName:"loadProject"}];this.config.hasOwnProperty("updateCostEquationCheckBoxStatus")&&
this.config.updateCostEquationCheckBoxStatus&&this.paneListData.push({title:this.nls.updateCostEquationPanel.updateProjectCostTabLabel,content:this.updateEquationContainer,isOpen:!1,updateCostEquationWidget:!0,tabindex:"0","aria-label":this.nls.updateCostEquationPanel.updateProjectCostTabLabel,role:"button",paneName:"updateCostEquation"});this._createAndLoadProjectPanes();this._getProjectNamesOptions()},_initializeData:function(){this._updateProjectCostWidget=null},_showMessage:function(N){(new A({message:N})).message=
N},_createProjectUI:function(){var N=w.create("div",{"class":"esriCTCreateProjectWrapper"},this.createProjectContainer);var p=w.create("div",{"class":"esriCTFullwidth esriCTCreateProjectContent"},N);this.projectNameTextBox=new e({required:!0,trim:!0,placeHolder:this.nls.createLoadProject.projectNamePlaceHolder,title:this.nls.createLoadProject.projectNamePlaceHolder,maxLength:this._getFieldInfo(this.projectNameField).fieldLength,autofocus:!0,"class":"esriCTFullwidth esriCTCreateProjectContent esriCTEllipsis"},
p);this.projectNameTextBox.validator=d.hitch(this,function(t){return""===t?!1:this._validateProjectNameLocally(t)?!0:(this.projectNameTextBox.set("state","Error"),this.projectNameTextBox.set("invalidMessage",this.nls.createLoadProject.errorDuplicateProjectName),!1)});var E=this._getFieldInfo(this.projectDescField);p=w.create("div",{"class":"esriCTFullwidth esriCTCreateProjectContent"},N);var r=new e({required:E.nullable,trim:!0,placeHolder:this.nls.createLoadProject.projectDescPlaceHolder,"class":"esriCTFullwidth esriCTCreateProjectContent esriCTEllipsis",
title:this.nls.createLoadProject.projectDescPlaceHolder,maxLength:E.fieldLength},p);N=w.create("div",{"class":"esriCTFullwidth esriCTCreateLoadButtonWrap"},N);N=this._createButton(this.nls.createLoadProject.createLabel,N,"0");this.createLoadProjectButtonArray.push(N);this.own(a(N,"click",d.hitch(this,function(){this._createButtonClicked(r);this.projectNameTextBox.isValid()||D.focus(this.projectNameTextBox);r.isValid()||D.focus(r)})));this.own(a(N,"keydown",d.hitch(this,function(t){if(t.keyCode===
B.ENTER||t.keyCode===B.SPACE)T.stop(t),this._createButtonClicked(r),this.projectNameTextBox.isValid()||D.focus(this.projectNameTextBox),r.isValid()||D.focus(r)})));return this.createProjectContainer},_createButtonClicked:function(N){N.isValid()||(N.set("state","Error"),N.set("message",N.getErrorMessage()));this.projectNameTextBox.isValid()&&N.isValid()&&(this.loadingIndicator.show(),this._validateForDuplicateProjectName(H.sanitizeHTML(this.projectNameTextBox.get("value"))).then(d.hitch(this,function(p){p?
(this.loadingIndicator.hide(),this.projectNameTextBox.set("state","Error"),this._showMessage(this.nls.createLoadProject.errorDuplicateProjectName)):this._addProjectToLayer(H.sanitizeHTML(this.projectNameTextBox.get("value")),H.sanitizeHTML(N.get("value"))).then(d.hitch(this,function(E){this.loadingIndicator.hide();if(E&&E.success&&E.globalId){var r={label:H.sanitizeHTML(this.projectNameTextBox.get("value")),value:E.globalId,descValue:H.sanitizeHTML(N.get("value")),globalIdValue:E.globalId,objectIdValue:E.objectId};
this.projectNameSelect.addOption(r);this.emit("createProject",{name:H.sanitizeHTML(this.projectNameTextBox.get("value")),desc:H.sanitizeHTML(N.get("value")),projectId:E.globalId,objectId:E.objectId,projectIdField:this.projectLayer.globalIdField});this.projectNameTextBox.set("value"," ");N.set("value","")}else this._showMessage(this.nls.createLoadProject.errorInCreatingProject)}),d.hitch(this,function(){this.loadingIndicator.hide();this._showMessage(this.nls.createLoadProject.errorInCreatingProject)}))}),
d.hitch(this,function(){this.loadingIndicator.hide();this._showMessage(this.nls.createLoadProject.errorInCreatingProject)})))},_getFieldInfo:function(N){if(this.projectLayer&&this.projectLayer.getField(N)){N=this.projectLayer.getField(N);var p=N.length;var E=!N.nullable}return{fieldLength:p,nullable:E}},_createButton:function(N,p,E){return w.create("div",{"class":"jimu-btn esriCTEllipsis",innerHTML:N,title:N,role:"button",tabindex:E,"aria-label":N},p)},_loadProjectUI:function(){var N=w.create("div",
{"class":"esriCTLoadProjectWrapper"},this.loadProjectContainer);var p=w.create("div",{"class":"esriCTFullwidth esriCTCreateProjectContent"},N);N=w.create("div",{"class":"esriCTFullwidth esriCTCreateLoadButtonWrap"},N);this.projectNameSelect=new k({"aria-label":this.nls.createLoadProject.selectProject,"class":"esriCTFullwidth",options:this.projectNameOptions},w.create("div",{},p));this.projectNameSelect.startup();p=this._createButton(this.nls.createLoadProject.viewInMapLabel,N,"-1");this.own(a(p,"click",
d.hitch(this,function(){this.getProjectAssets("ViewProject")})));this.own(a(p,"keydown",d.hitch(this,function(E){if(E.keyCode===B.ENTER||E.keyCode===B.SPACE)T.stop(E),this.getProjectAssets("ViewProject")})));this.createLoadProjectButtonArray.push(p);p=this._createButton(this.nls.common.deleteText,N,"-1");this.createLoadProjectButtonArray.push(p);this.own(a(p,"click",d.hitch(this,this._deleteBtnClicked)));this.own(a(p,"keydown",d.hitch(this,function(E){if(E.keyCode===B.ENTER||E.keyCode===B.SPACE)T.stop(E),
this._deleteBtnClicked()})));N=this._createButton(this.nls.createLoadProject.loadLabel,N,"-1");this.createLoadProjectButtonArray.push(N);this.own(a(N,"click",d.hitch(this,function(){this.getProjectAssets("LoadProject")})));this.own(a(N,"keydown",d.hitch(this,function(E){if(E.keyCode===B.ENTER||E.keyCode===B.SPACE)T.stop(E),this.getProjectAssets("LoadProject")})));return this.loadProjectContainer},_deleteBtnClicked:function(){var N,p;(p=this.projectNameSelect._getSelectedOptionsAttr())&&p.value?N=
new A({message:this.nls.createLoadProject.deleteProjectConfirmationMsg,type:"question",maxWidth:375,buttons:[{label:this.nls.common.yes,onClick:d.hitch(this,function(){N.close();this.getProjectAssets("DeleteProject")})},{label:this.nls.common.no,onClick:d.hitch(this,function(){N.close()})}]}):this._showMessage(this.nls.createLoadProject.errorProjectNotSelected)},_checkIfProjectExist:function(N){var p=new m;var E=new n(this.projectLayer.url);var r=new z;r.outFields=[this.projectLayer.objectIdField,
this.projectLayer.globalIdField];r.returnGeometry=!1;r.where=this.projectLayer.globalIdField+" \x3d '"+N+"'";E.execute(r,d.hitch(this,function(t){t&&t.features&&0<t.features.length?p.resolve(!0):p.resolve(!1)}),d.hitch(this,function(){p.resolve(!1)}));return p.promise},getProjectAssets:function(N){var p,E,r,t,x;(x=this.projectNameSelect._getSelectedOptionsAttr())&&x.value?(this.loadingIndicator.show(),this._checkIfProjectExist(x.globalIdValue).then(d.hitch(this,function(F){F?(r=this.layerInfosObj.getTableInfoById(this.config.projectSettings.assetTable).layerObject,
t=new l(r.url),E=new n(t.url),p=new z,p.outFields=["*"],p.returnGeometry=!1,p.where=this.config.assetTableFields.PROJECTGUID+" \x3d '"+x.globalIdValue+"'",E.execute(p,d.hitch(this,function(K){this.loadingIndicator.hide();"ViewProject"===N?this._showProjectOnMap(x,K.features):"DeleteProject"===N?this._deleteProject(x,K.features):this._createAssetTemplateInfo(x,K.features)}),d.hitch(this,function(){this._showMessage(this.nls.createLoadProject.errorInLoadingProject);this.loadingIndicator.hide()}))):
(this.projectNameSelect.removeOption(x.globalIdValue),this._showMessage(this.nls.createLoadProject.errorProjectNotFound),this.emit("showCreateLoadPrjPanel"),this.loadingIndicator.hide())}),d.hitch(this,function(){this._showMessage(this.nls.createLoadProject.errorInLoadingProject);this.emit("showCreateLoadPrjPanel");this.loadingIndicator.hide()}))):this._showMessage(this.nls.createLoadProject.errorProjectNotSelected)},_createAssetTemplateInfo:function(N,p){var E=[];this.loadingIndicator.show();c.forEach(p,
d.hitch(this,function(r){(r=r.attributes[this.config.assetTableFields.GEOGRAPHYGUID])&&E.push(r)}));this._getRegionName(E).then(d.hitch(this,function(r){this.loadingIndicator.hide();var t=[];var x={};c.forEach(p,d.hitch(this,function(F){var K={};var R=F.attributes[this.config.assetTableFields.ASSETGUID];var U=F.attributes[this.config.assetTableFields.GEOGRAPHYGUID];t.push(R);K.COSTEQUATION=F.attributes[this.config.assetTableFields.COSTEQUATION];K.SCENARIO=F.attributes[this.config.assetTableFields.SCENARIO];
K.TEMPLATENAME=F.attributes[this.config.assetTableFields.TEMPLATENAME];K.GEOGRAPHYGUID=U;K.GEOGRAPHY=U?r[U]:null;K.OBJECTID=F.attributes[this.config.assetTableFields.OBJECTID];x[R]=K}));this._loadProject(N,t,x)}),d.hitch(this,function(){this.loadingIndicator.hide()}))},_getAssetRequestToLayer:function(N,p){var E=p.layerObject.id;var r=p.layerObject;r.clearSelection();var t=new m;p=new n(r.url);var x=new z;x.outFields=["*"];x.returnGeometry=!0;x.outSpatialReference=this.map.spatialReference;x.where=
r.globalIdField+" in ('"+N.join("','")+"')";p.execute(x,d.hitch(this,function(F){F&&F.features&&0<F.features.length?t.resolve({layerId:E,features:F.features}):t.resolve({layerId:E,features:[]})}),d.hitch(this,function(){t.resolve({layerId:E,features:[]})}));return t.promise},_getProjectAdditionalCost:function(N){var p;var E=new m;if(p=this.config.projectSettings.multiplierAdditionalCostTable){p=this.layerInfosObj.getTableInfoById(p).layerObject.url;var r=new n(p);p=new z;p.outFields=["*"];p.returnGeometry=
!1;p.where=this.config.projectMultiplierFields.PROJECTGUID+" \x3d '"+N+"'";r.execute(p,d.hitch(this,function(t){var x=[];t&&t.features&&(x=t.features);E.resolve(x)}),d.hitch(this,function(){E.resolve([])}))}else E.resolve([]);return E.promise},_getRegionName:function(N){var p=new m;if(this.config.projectSettings.costingGeometryLayer&&this.config.projectSettings.geographyField&&0<N.length){var E=this.layerInfosObj.getLayerInfoById(this.config.projectSettings.costingGeometryLayer).layerObject;var r=
new n(E.url);var t=new z;t.outFields=[this.config.projectSettings.geographyField,E.globalIdField];t.returnDistinctValues=!0;t.returnGeometry=!1;t.where=E.globalIdField+" in ('"+N.join("','")+"')";r.execute(t,d.hitch(this,function(x){var F={};x&&x.features&&c.forEach(x.features,d.hitch(this,function(K){F[K.attributes[E.globalIdField]]=K.attributes[this.config.projectSettings.geographyField]}));p.resolve(F)}),d.hitch(this,function(){p.resolve([])}))}else p.resolve([]);return p.promise},_selectFeaturesOnMap:function(N,
p){var E=this.layerInfosObj.getLayerInfoById(p).layerObject;var r=new m;p=new z;p.where=E.globalIdField+" in ('"+N.join("','")+"')";E.selectFeatures(p,l.SELECTION_NEW,d.hitch(this,function(t){t&&0<t.length?r.resolve(t):r.resolve([])}),d.hitch(this,function(){r.resolve([])}));return r.promise},_showProjectOnMap:function(N,p){var E=[],r=[];c.forEach(p,d.hitch(this,function(t){E.push(t.attributes[this.config.assetTableFields.ASSETGUID])}));0===E.length?this._showMessage(this.nls.createLoadProject.noAssetsToViewOnMap):
(this.loadingIndicator.show(),this._selectFeaturesOnMap([N.globalIdValue],this.config.projectSettings.projectLayer).then(d.hitch(this,function(t){var x=!1;0<t.length&&t[0].geometry&&(x=!0,this.map.setExtent(g.graphicsExtent(t).expand(1.5)));c.forEach(this.config.layerSettings,d.hitch(this,function(F){F.editable&&r.push(this._selectFeaturesOnMap(E,F.id))}));C(r).then(d.hitch(this,function(F){var K=[];this.loadingIndicator.hide();x||(c.forEach(F,d.hitch(this,function(R){K=K.concat(R)})),0<K.length?
this.map.setExtent(g.graphicsExtent(K).expand(1.5)):this._showMessage(this.nls.createLoadProject.noAssetsToViewOnMap))}))}),d.hitch(this,function(){this.loadingIndicator.hide();this._showMessage(this.nls.createLoadProject.errorInLoadingProject)})))},_deleteFromTable:function(N,p,E){if(N=this.layerInfosObj.getTableInfoById(N))N=N.layerObject;p=p+" \x3d '"+E+"'";N?p=this.appUtils.deleteFeatures(N.url,p):(p=new m,p.resolve(!1),p=p.promise);return p},_deleteProject:function(N,p){this.loadingIndicator.show();
this._getRelatedLabelPoint(N.globalIdValue,N,p)},_deleteDetailsRelatedToProject:function(N,p,E){var r=[],t=[];this.emit("deleteProject");this.loadingIndicator.show();c.forEach(E,d.hitch(this,function(x){r.push(x.attributes[this.config.assetTableFields.ASSETGUID])}));0<r.length&&c.forEach(this.config.layerSettings,d.hitch(this,function(x){if(x.editable){x=this.layerInfosObj.getLayerInfoById(x.id).layerObject;var F=x.globalIdField+" in ('"+r.join("','")+"')";t.push(this.appUtils.deleteFeatures(x.url,
F))}}));t.push(this._deleteFromTable(this.config.projectSettings.assetTable,this.config.assetTableFields.PROJECTGUID,N));t.push(this._deleteFromTable(this.config.projectSettings.multiplierAdditionalCostTable,this.config.projectMultiplierFields.PROJECTGUID,N));t.push(this.appUtils.deleteFeatures(this.projectLayer.url,this.projectLayer.globalIdField+" \x3d '"+p.globalIdValue+"'"));C(t).then(d.hitch(this,function(){this.loadingIndicator.hide();this.projectNameSelect.removeOption(N);this._showMessage(this.nls.createLoadProject.projectDeletedMsg);
this.projectLayer.clearSelection();this.projectLayer.refresh();c.forEach(this.config.layerSettings,d.hitch(this,function(x){x.editable&&(x=this.layerInfosObj.getLayerInfoById(x.id).layerObject,x.clearSelection(),x.refresh())}))}))},_loadProject:function(N,p,E){var r=[];this.loadingIndicator.show();if(0<p.length)c.forEach(this.config.layerSettings,d.hitch(this,function(x){var F=this.layerInfosObj.getLayerInfoById(x.id);F&&F.layerObject&&x.editable&&r.push(this._getAssetRequestToLayer(p,F))}));else{var t=
new m;r.push(t.promise);t.resolve(null)}C(r).then(d.hitch(this,function(x){var F={};var K={name:N.label,desc:N.descValue,projectId:N.globalIdValue,objectId:N.objectIdValue};this.selectedProjectFeatureAttr=N.prjAttributes;c.forEach(x,d.hitch(this,function(R){R&&(F[R.layerId]=R.features)}));this._getProjectAdditionalCost(N.globalIdValue).then(d.hitch(this,function(R){this.loadingIndicator.hide();this.emit("loadProject",{assetTemplateInfo:E,assetInfo:F,projectInfo:K,additionalCostInfo:R,projectIdField:this.projectLayer.globalIdField})}),
d.hitch(this,function(){this.loadingIndicator.hide()}))}),d.hitch(this,function(){this.loadingIndicator.hide()}))},_createAndLoadProjectPanes:function(){this.paneListData&&0<this.paneListData.length&&(this._createOrLoadPrj=new q({itemList:this.paneListData,openMultiple:!1,highlighterColor:this.config.selectedThemeColor},w.create("div",{},this.createLoadProjectContainer)),this.own(a(this._createOrLoadPrj,"refreshUpdateCostEquationWidget",d.hitch(this,function(){this._destroyUpdateCostEquationWidget();
this._getProjectNamesOptions()}))),this.own(a(this._createOrLoadPrj,"resetLoadProjectNameDropdown",d.hitch(this,function(){this.projectNameSelect.set("value","defaultSelectProjectNameOption")}))),this.own(a(this._createOrLoadPrj,"OnOpenCreatePanel",d.hitch(this,function(){var N=y(".esriCTCreateProjectContent",this.domNode);N&&N.length&&(this._updateTabindexOfInputDOM(N[0],"0"),this._updateTabindexOfInputDOM(N[1],"0"),this._updateTabindexOfDOM(this.createLoadProjectButtonArray[0],"0"),D.focus(N[0].domNode))}))),
this.own(a(this._createOrLoadPrj,"OnCloseCreatePanel",d.hitch(this,function(){var N=y(".esriCTCreateProjectContent",this.domNode);N&&N.length&&(this._updateTabindexOfInputDOM(N[0],"-1"),this._updateTabindexOfInputDOM(N[1],"-1"),this._updateTabindexOfDOM(this.createLoadProjectButtonArray[0],"-1"))}))),this.own(a(this._createOrLoadPrj,"OnOpenLoadPanel",d.hitch(this,function(){var N=y(".esriCTCreateProjectContent",this.domNode);N&&N.length&&(this._updateTabindexOfDOM(N[2].children[0],"0"),this._updateTabindexOfDOM(this.createLoadProjectButtonArray[1],
"0"),this._updateTabindexOfDOM(this.createLoadProjectButtonArray[2],"0"),this._updateTabindexOfDOM(this.createLoadProjectButtonArray[3],"0"),this.config.updateCostEquationCheckBoxStatus||this.updateLastFocusNode(this.createLoadProjectButtonArray[3],this.widgetDomNode),D.focus(N[2].children[0]))}))),this.own(a(this._createOrLoadPrj,"OnCloseLoadPanel",d.hitch(this,function(){var N;(N=y(".esriCTCreateProjectContent",this.domNode))&&N.length&&(this._updateTabindexOfDOM(N[2].children[0],"-1"),this._updateTabindexOfDOM(this.createLoadProjectButtonArray[1],
"-1"),this._updateTabindexOfDOM(this.createLoadProjectButtonArray[2],"-1"),this._updateTabindexOfDOM(this.createLoadProjectButtonArray[3],"-1"),this._getLastTitleContainerNode())}))),this._createOrLoadPrj.startup())},_getLastTitleContainerNode:function(){var N;var p=y(".esriCTItemTitleContainer",this.domNode);(N=p.length)&&this.updateLastFocusNode(p[N-1],this.widgetDomNode)},_getUpdateCostEquationProjectNameDOM:function(N,p){y(".esriCTProjectNameCheckBox",this.domNode).forEach(d.hitch(this,function(E,
r){b.set(E,"tabindex",N);p&&void 0===r&&this.updateLastFocusNode(E,this.widgetDomNode)}))},_updateTabindexOfDOM:function(N,p){b.set(N,"tabindex",p)},_updateTabindexOfInputDOM:function(N,p){y(".dijitInputInner",N).forEach(d.hitch(this,function(E){this._updateTabindexOfDOM(E,p)}))},_getProjectNamesOptions:function(){this.loadingIndicator.show();var N=new n(this.projectLayer.url);var p=new z;p.outFields=["*"];p.returnGeometry=!1;p.where="1\x3d1";N.execute(p,d.hitch(this,function(E){var r=[];E&&E.features&&
(r=E.features);this._populateProjectNameOptions(r);setTimeout(d.hitch(this,function(){this._displayUpdateCostEquationWidget()}),10)}),d.hitch(this,function(){this.loadingIndicator.hide()}))},_populateProjectNameOptions:function(N){this.projectNameOptions=[{label:this.nls.createLoadProject.selectProject,value:""}];c.forEach(N,d.hitch(this,function(p){this.projectNameField&&p.attributes[this.projectNameField]&&""!==d.trim(p.attributes[this.projectNameField])&&this.projectNameOptions.push({label:p.attributes[this.projectNameField],
value:p.attributes[this.projectLayer.globalIdField],descValue:p.attributes[this.projectDescField],globalIdValue:p.attributes[this.projectLayer.globalIdField],objectIdValue:p.attributes[this.projectLayer.objectIdField],prjAttributes:p.attributes})}));this.projectNameSelect.set("options",d.clone(this.projectNameOptions));this.loadingIndicator.hide()},_validateProjectNameLocally:function(N){var p=[];this.projectNameSelect&&0<this.projectNameSelect.options.length&&(p=c.filter(this.projectNameSelect.options,
function(E){return E.label.toUpperCase()===N.toUpperCase()}));return 0<p.length?!1:!0},_validateForDuplicateProjectName:function(N){var p=new m;var E=new n(this.projectLayer.url);var r=new z;r.outFields=[this.projectLayer.objectIdField,this.projectLayer.globalIdField];r.returnGeometry=!1;r.where="UPPER("+this.projectNameField+") \x3d '"+N.toUpperCase()+"'";E.execute(r,d.hitch(this,function(t){t&&t.features&&0<t.features.length?p.resolve(!0):p.resolve(!1)}),d.hitch(this,function(){p.resolve(!1)}));
return p.promise},_addProjectToLayer:function(N,p){var E=new m;var r=new f;r.attributes=0<this.projectLayer.templates.length?this.projectLayer.templates[0].prototype.attributes:this.projectLayer.types[0].templates[0].prototype.attributes;r.attributes[this.projectNameField]=N;r.attributes[this.projectDescField]=p;this.projectLayer.applyEdits([r],null,null,d.hitch(this,function(t){this.selectedProjectFeatureAttr=r.attributes;E.resolve(t[0])}),function(t){E.reject(t)});return E.promise},_fetchWidgetTopNode:function(){if(this.domNode.parentNode)var N=
this.domNode.parentNode;if(N.parentNode)var p=N.parentNode;if(p.parentNode)var E=p.parentNode;E&&(this._widgetTopNode=E)},_instantiateUpdateProjectCostWidget:function(){this._updateProjectCostWidget=new v({nls:this.nls,projectNameOptions:this.projectNameOptions,widgetTopNode:this._widgetTopNode,layerInfosObj:this.layerInfosObj,config:this.config,map:this.map,loadingIndicator:this.loadingIndicator,widgetDomNode:this.widgetDomNode,updateLastFocusNode:this.updateLastFocusNode,setTabindexOfUpdateProjectCost:this._setTabindexOfUpdateProjectCost},
w.create("div",{},this.updateEquationContainer));this.own(a(this._updateProjectCostWidget,"updateProjectCostWidgetLoaded",d.hitch(this,function(){h.contains(this.updateEquationContainer.parentNode,"esriCTItemContentActive")?this._setTabindexOfUpdateProjectCost(!0,this.domNode):this._setTabindexOfUpdateProjectCost(!1,this.domNode)})));this._updateProjectCostWidget.startup()},_setTabindexOfUpdateProjectCost:function(N,p){var E=y(".esriCTProjectNameCheckBox",p);E.forEach(d.hitch(this,function(r){N?(b.set(r,
"tabindex","0"),E.length-1&&this.updateLastFocusNode(r,p)):(b.set(r,"tabindex","-1"),this._setUpdateCostEquationLastFocusNode(p))}))},_setUpdateCostEquationLastFocusNode:function(N){var p=y(".esriCTItemTitleContainer",N);this.updateLastFocusNode(p[2],N)},_resetHeight:function(){var N=L.getComputedStyle(this._widgetTopNode).height;N=parseFloat(N);N-=28;var p=y(".esriCTItemTitleContainer",this._widgetTopNode);c.forEach(p,d.hitch(this,function(E){E=L.getComputedStyle(E).height;E=parseFloat(E);N-=E}));
N-=30;L.set(this.updateEquationContainer,"height",N+"px")},_destroyUpdateCostEquationWidget:function(){this._updateProjectCostWidget&&this._updateProjectCostWidget.destroy();this._updateProjectCostWidget=null},_displayUpdateCostEquationWidget:function(){this.config.hasOwnProperty("updateCostEquationCheckBoxStatus")&&this.config.updateCostEquationCheckBoxStatus&&(this._resetHeight(),this._instantiateUpdateProjectCostWidget())},_deleteExistingLabelPoint:function(N,p,E,r){if(N&&0<N.length){var t=this.map.getLayer(this.config.projectSettings.pointLayerCentroid),
x=new l(t.url,{outFields:["*"]});x.onLoad=d.hitch(this,function(){var F=[];c.forEach(N,d.hitch(this,function(K){var R={};R[x.objectIdField]=K;K=new f(null,null,R,null);F.push(K)}));x.applyEdits(null,null,F,d.hitch(this,function(){this.map.getLayer(this.config.projectSettings.pointLayerCentroid).refresh();this._deleteDetailsRelatedToProject(p,E,r)}),d.hitch(this,function(){this._deleteDetailsRelatedToProject(p,E,r)}))})}else this._deleteDetailsRelatedToProject(p,E,r)},_getRelatedLabelPoint:function(N,
p,E){if(""!==this.config.projectSettings.pointLayerCentroid&&null!==this.config.projectSettings.pointLayerCentroid&&void 0!==this.config.projectSettings.pointLayerCentroid){var r,t=this.map.getLayer(this.config.projectSettings.pointLayerCentroid),x=new l(t.url,{outFields:["*"]});x.onLoad=d.hitch(this,function(){r=this._getFieldName(x,"projectid")+" \x3d '"+N+"'";var F=new z;F.where=r;x.queryIds(F,d.hitch(this,function(K){this._deleteExistingLabelPoint(K,N,p,E)}),d.hitch(this,function(){this._deleteDetailsRelatedToProject(N,
p,E)}))})}else this._deleteDetailsRelatedToProject(N,p,E)},_getFieldName:function(N,p){var E;c.forEach(N.fields,d.hitch(this,function(r){r.name.toLowerCase()===p.toLowerCase()&&(E=r.name)}));return E}})})},"widgets/CostAnalysis/item-list":function(){define("dojo/_base/declare jimu/BaseWidget dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./item-list.html dojo/_base/array dojo/_base/lang dojo/dom-attr dojo/dom-class dojo/dom-style dojo/on dojo/query dojo/dom-construct dojo/keys dojo/_base/event".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n){return Q([I,J,G],{templateString:u,baseClass:"jimu-widget-cost-analysis-item-list",highlighterColor:"#000",currentActivePanel:null,postCreate:function(){this.inherited(arguments)},startup:function(){this.inherited(arguments);this.itemList&&0<this.itemList.length&&setTimeout(c.hitch(this,function(){this._loadItemList();this._handleTabIndexesOfItems()}),0)},_handleTabIndexesOfItems:function(){this.emit("OnOpenCreatePanel");this.emit("OnCloseLoadPanel");this.emit("OnCloseUpdateCostEquationPanel")},
_loadItemList:function(){d.forEach(this.itemList,c.hitch(this,function(g){this.addItem(g)}))},addItem:function(g){g.content=g.content||"";var m=z.create("div",{},null);var l=z.create("div",{"class":"esriCTItemTitleContainer",tabindex:"0","aria-label":g.title,role:"button"},m);w.add(l,"esriCTProjectOveriew");z.create("div",{"class":"esriCTItemHighlighter"},l);var C=z.create("div",{"class":"esriCTItemTitle esriCTEllipsis",innerHTML:g.title,title:g.title,paneName:g.paneName},l);g.hasOwnProperty("updateCostEquationWidget")&&
a.set(C,"updateCostEquationWidget",!0);g.hasOwnProperty("loadProjectTab")&&a.set(C,"loadProjectTab",!0);g.hasOwnProperty("createProjectTab")&&a.set(C,"createProjectTab",!0);C=z.create("div",{"class":"esriCTItemContent"},m);"string"===typeof g.content?a.set(C,"innerHTML",g.content):z.place(g.content,C);this.itemListContainer.appendChild(m);this.own(e(l,"click",c.hitch(this,function(A){this._itemTitleContainerClicked(A)})));this.own(e(l,"keydown",c.hitch(this,function(A){if(A.keyCode===f.ENTER||A.keyCode===
f.SPACE)n.stop(A),this._itemTitleContainerClicked(A)})));g.isOpen&&setTimeout(c.hitch(this,function(){l.click()}),100)},_itemTitleContainerClicked:function(g){this._togglePanel(g.currentTarget.parentElement);g.currentTarget.children.length&&a.get(g.currentTarget.children[1],"loadProjectTab")&&(this.emit("resetLoadProjectNameDropdown"),g.currentTarget.children.length&&w.contains(g.currentTarget.children[1],"esriCTItemTitleActive")?(a.set(g.currentTarget,"aria-expanded","true"),this.emit("OnCloseCreatePanel"),
this.emit("OnOpenLoadPanel")):(a.set(g.currentTarget,"aria-expanded","false"),this.emit("OnCloseLoadPanel")));g.currentTarget.children.length&&a.get(g.currentTarget.children[1],"updateCostEquationWidget")&&(this.emit("refreshUpdateCostEquationWidget"),g.currentTarget.children.length&&w.contains(g.currentTarget.children[1],"esriCTItemTitleActive")?(this.emit("OnCloseCreatePanel"),this.emit("OnCloseLoadPanel"),a.set(g.currentTarget,"aria-expanded","true")):a.set(g.currentTarget,"aria-expanded","false"));
g.currentTarget.children.length&&a.get(g.currentTarget.children[1],"createProjectTab")&&(g.currentTarget.children.length&&w.contains(g.currentTarget.children[1],"esriCTItemTitleActive")?(this.emit("OnOpenCreatePanel"),this.emit("OnCloseLoadPanel"),a.set(g.currentTarget,"aria-expanded","true")):(this.emit("OnCloseCreatePanel"),a.set(g.currentTarget,"aria-expanded","false")))},_togglePanel:function(g,m){var l=0;m||(l=30);m=k(".esriCTItemTitle",g)[0];var C=k(".esriCTItemContent",g)[0];var A=k(".esriCTItemHighlighter",
g)[0];w.toggle(m,"esriCTItemTitleActive");w.toggle(C,"esriCTItemContentActive");w.contains(C,"esriCTItemContentActive")?(C.style.height=C.scrollHeight+l+"px",this.currentActivePanel&&!this.openMultiple&&this._togglePanel(this.currentActivePanel,!0),this.currentActivePanel=g,q.set(A,"backgroundColor",this.highlighterColor)):(C.style.height=0,q.set(A,"backgroundColor","transparent"),a.get(this.currentActivePanel,"index")===a.get(g,"index")&&(this.currentActivePanel=null))}})})},"widgets/CostAnalysis/update-project-cost":function(){define("dojo/_base/declare dijit/_WidgetBase dojo/Evented dijit/_TemplatedMixin dojo/_base/lang dojo/_base/array dojo/dom-construct jimu/dijit/CheckBox dojo/dom-class dojo/on dojo/text!./update-project-cost.html dojo/promise/all esri/tasks/QueryTask esri/tasks/query jimu/dijit/Message esri/graphic dojo/dom-attr dojo/keys dojo/_base/event".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C){return Q([I,J,G],{templateString:e,_updateCostProjectSelectAllCheckBox:null,_filteredProjectNameOptions:null,constructor:function(A){A&&u.mixin(this,A)},postCreate:function(){this.inherited(arguments);this.own(q(this.updateCostEquationButton,"keydown",u.hitch(this,function(A){if(A.keyCode===l.ENTER||A.keyCode===l.SPACE)C.stop(A),this._updateCostEquation()})))},startup:function(){this.inherited(arguments);this.loadingIndicator.show();this._initializeData();
this._filteredProjectNameOptions=d.filter(this.projectNameOptions,u.hitch(this,function(A){return A.label!==this.nls.createLoadProject.selectProject}));0<this._filteredProjectNameOptions.length?this._displayProjectCostEquationList():this._displayNoFeatureFoundScreen();this.loadingIndicator.hide()},_displayNoFeatureFoundScreen:function(){w.remove(this.noFeatureFoundScreen,"esriCTHidden")},_initializeData:function(){this._filteredProjectNameOptions=this._updateCostProjectSelectAllCheckBox=null},_displayProjectCostEquationList:function(){w.remove(this.projectListChildContainer,
"esriCTHidden");w.remove(this.updateButtonParentContainer,"esriCTHidden");this._updateCostProjectRow(this.nls.updateCostEquationPanel.updateProjectCostSelectProjectTitle,!0);d.forEach(this._filteredProjectNameOptions,u.hitch(this,function(A){this._updateCostProjectRow(A)}));this.emit("updateProjectCostWidgetLoaded")},_updateCostProjectRow:function(A,L){var y=c.create("div",{"class":"esriCTUpdateCostRowMainNode"},this.projectListChildContainer);if(L){w.add(y,"esriCTUpdateCostSelectAll");var v=A}else w.add(y,
"esriCTUpdateCostProjectRow"),v=A.label;y=c.create("div",{"class":"esriCTCheckBoxParentNode"},y);v=new a({"class":"esriCTProjectNameCheckBox",checked:!1,label:v,tabindex:"-1","aria-label":v},y);L?this._updateCostProjectSelectAllCheckBox=v:A.checkbox=v;this.own(q(v,"change",u.hitch(this,function(b){L?this._selectAllUpdateCostCheckBox(b):this._maintainSelectAllState()})))},_selectAllUpdateCostCheckBox:function(A){d.forEach(this._filteredProjectNameOptions,u.hitch(this,function(L){L.checkbox.setValue(A);
A&&(m.set(this.updateCostEquationButton,"tabindex","0"),this.updateLastFocusNode(this.updateCostEquationButton,this.widgetDomNode))}))},_maintainSelectAllState:function(){var A=!0;var L=!1;d.forEach(this._filteredProjectNameOptions,u.hitch(this,function(y){y.checkbox.getValue()||(A=!1);y.checkbox.getValue()&&(L=!0)}));L?(w.remove(this.updateCostEquationButton,"jimu-state-disabled esriCTUpdateEquationBtnDisabled"),m.set(this.updateCostEquationButton,"tabindex","0"),this.updateLastFocusNode(this.updateCostEquationButton,
this.widgetDomNode)):(w.add(this.updateCostEquationButton,"jimu-state-disabled esriCTUpdateEquationBtnDisabled"),m.set(this.updateCostEquationButton,"tabindex","-1"),this.setTabindexOfUpdateProjectCost(!0,this.widgetDomNode));A?(this._updateCostProjectSelectAllCheckBox.check(!0),this.updateLastFocusNode(this.updateCostEquationButton,this.widgetDomNode)):(this._updateCostProjectSelectAllCheckBox.uncheck(!0),L||this.setTabindexOfUpdateProjectCost(!0,this.widgetDomNode))},_updateCostEquation:function(){this.loadingIndicator.show();
var A=this._getProjectGuid(),L=this.layerInfosObj.getTableInfoById(this.config.projectSettings.assetTable).layerObject;this._getAssets(A,L)},_getProjectGuid:function(){var A=[];d.forEach(this._filteredProjectNameOptions,u.hitch(this,function(L){L.checkbox.getValue()&&A.push(L.globalIdValue)}));return A},_getAssets:function(A,L){var y={};y.assetsDeferredList=this._getAssetsDeferred(A,L);k(y).then(u.hitch(this,function(v){var b=[];var D={};d.forEach(v.assetsDeferredList.features,u.hitch(this,function(h){h.hasOwnProperty("attributes")&&
h.attributes.hasOwnProperty(this.config.assetTableFields.ASSETGUID)&&b.push(h.attributes[this.config.assetTableFields.ASSETGUID]);D[h.attributes[this.config.assetTableFields.ASSETGUID]]=h.attributes}));this._getAssetLayers(b,D)}),u.hitch(this,function(){this.loadingIndicator.hide();this._showMessage(this.nls.updateCostEquationPanel.updateProjectCostError)}))},_getAssetsDeferred:function(A,L){A=this.config.assetTableFields.PROJECTGUID+" IN ('"+A.join("','")+"')";L=new z(L.url);var y=new f;y.outFields=
["*"];y.where=A;y.returnGeometry=!1;y.outSpatialReference=this.map.spatialReference;return L.execute(y).promise},_getAssetLayers:function(A,L){var y={};d.forEach(this.config.layerSettings,u.hitch(this,function(v){var b=this.layerInfosObj.getLayerInfoById(v.id);b&&b.layerObject&&b.layerObject.globalIdField&&(y[v.id]=this._getAssetLayerDeferred(v,A))}));k(y).then(u.hitch(this,function(v){v=this._createProjectAssetRelationship(v);v=this._createAssetProjectRelationship(v,A);this._getAssetsGuidName(L,
v)}),u.hitch(this,function(){this.loadingIndicator.hide();this._showMessage(this.nls.updateCostEquationPanel.updateProjectCostError)}))},_getAssetsGuidName:function(A,L){var y={},v=this.map.getLayer(this.config.projectSettings.costingGeometryLayer),b;for(b in A)if(A.hasOwnProperty(b)){var D=A[b][this.config.assetTableFields.GEOGRAPHYGUID];""!==D&&null!==D&&void 0!==D&&(y[b]=this._getAssetGuidDeferred(v,D))}k(y).then(u.hitch(this,function(h){h=this._getAssetGuidNameRelation(h);this._compareAssetsInfoWithConfiguration(L,
A,h)}),u.hitch(this,function(){this.loadingIndicator.hide();this._showMessage(this.nls.updateCostEquationPanel.updateProjectCostError)}))},_getAssetGuidNameRelation:function(A){var L={},y;for(y in A)A.hasOwnProperty(y)&&(L[y]=A[y].features[0].attributes[this.config.projectSettings.geographyField]);return L},_getAssetGuidDeferred:function(A,L){L=A.globalIdField+" \x3d '"+L+"'";A=new z(A.url);var y=new f;y.outFields=[this.config.projectSettings.geographyField];y.where=L;y.returnGeometry=!1;y.outSpatialReference=
this.map.spatialReference;return A.execute(y).promise},_compareAssetsInfoWithConfiguration:function(A,L,y){var v=[],b;for(b in A)if(A.hasOwnProperty(b)){var D=this._getUpdateAssetGraphic(this.config.costingInfoSettings[A[b]],L,b,y);D&&v.push(D)}0<v.length?this._updateAssetCostingInfo(v):(this.loadingIndicator.hide(),this._showMessage(this.nls.updateCostEquationPanel.updateProjectCostSuccess))},_getUpdateAssetGraphic:function(A,L,y,v){var b=null;d.forEach(A,u.hitch(this,function(D){var h=D.scenario,
B=D.featureTemplate,H=D.geography,T=L[y][this.config.assetTableFields.SCENARIO],N=L[y][this.config.assetTableFields.TEMPLATENAME];var p=v.hasOwnProperty(y)?v[y]:L[y][this.config.assetTableFields.GEOGRAPHYGUID];if(""===h||null===h)h=null;if(""===H||null===H)H=null;if(""===T||null===T)T=null;if(""===p||null===p)p=null;B===N&&H===p&&h===T&&(h={},h[this.config.assetTableFields.OBJECTID]=L[y][this.config.assetTableFields.OBJECTID],h[this.config.assetTableFields.COSTEQUATION]=D.costEquation,b=new g(null,
null,h,null))}));return b},_updateAssetCostingInfo:function(A){this.layerInfosObj.getTableInfoById(this.config.projectSettings.assetTable).layerObject.applyEdits(null,A,null,u.hitch(this,function(){this.loadingIndicator.hide();this._showMessage(this.nls.updateCostEquationPanel.updateProjectCostSuccess)}),u.hitch(this,function(){this.loadingIndicator.hide();this._showMessage(this.nls.updateCostEquationPanel.updateProjectCostError)}))},_createAssetProjectRelationship:function(A,L){var y={};d.forEach(L,
u.hitch(this,function(v){for(var b in A)A.hasOwnProperty(b)&&-1<A[b].indexOf(v)&&(y[v]=b)}));return y},_createProjectAssetRelationship:function(A){var L={},y;for(y in A)if(A.hasOwnProperty(y)){var v=this._getRelatedAssetGuidArr(A[y]);L[y]=v}return L},_getRelatedAssetGuidArr:function(A){var L=[];d.forEach(A.features,u.hitch(this,function(y){y.hasOwnProperty("attributes")&&L.push(y.attributes[A.globalIdFieldName])}));return L},_getAssetLayerDeferred:function(A,L){L=this.layerInfosObj.getLayerInfoById(A.id).layerObject.globalIdField+
" IN ('"+L.join("','")+"')";A=new z(A.url);var y=new f;y.outFields=["*"];y.where=L;y.returnGeometry=!1;y.outSpatialReference=this.map.spatialReference;return A.execute(y).promise},_showMessage:function(A){(new n({message:A})).message=A}})})},"widgets/CostAnalysis/work-bench":function(){define("dojo/_base/declare jimu/BaseWidget jimu/FilterManager dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./work-bench.html dojo/_base/lang dojo/dom-style dojo/dom-attr dojo/_base/array dojo/dom-class dojo/on dojo/query esri/graphic dojo/dom-construct dojo/Deferred dojo/promise/all esri/layers/FeatureLayer esri/tasks/GeometryService esri/graphicsUtils ./template-picker ./project-overview ./project-summary ./asset-details jimu/CSVUtils esri/tasks/query esri/tasks/QueryTask esri/geometry/geometryEngine esri/SpatialReference esri/geometry/Point dojo/keys dojo/_base/event dijit/focus".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v,b,D,h,B,H,T,N,p,E,r){return Q([I,G,u],{templateString:d,baseClass:"jimu-widget-cost-analysis-work-bench",_projectOverview:null,_projectSummary:null,_assetItemSummary:{},_assetGroupSummary:{},_assetTableIds:{},_recentlyOperatedLayerIds:[],_projectAssetTable:null,_additionalCostTable:null,_assetInfoForReset:{},_reportColumns:[],filterManager:null,_pointLayer:null,_originalTemplateAttributes:null,_isLoadingProject:null,_exsitingLabelPointDefExpression:null,
_canExportProject:!0,postCreate:function(){this.inherited(arguments);this._assetItemSummary={};this._assetGroupSummary={};this._assetTableIds={};this._recentlyOperatedLayerIds=[];this._assetInfoForReset={};this.filterManager=J.getInstance();this._exsitingLabelPointDefExpression=this._isLoadingProject=this._originalTemplateAttributes=this._pointLayer=null;this._reportColumns=[];if(!this.config.generalSettings.hasOwnProperty("canExportProject")||this.config.generalSettings.hasOwnProperty("canExportProject")&&
!this.config.generalSettings.canExportProject)a.set(this.downloadCSVBtn,"display","none"),w.set(this.downloadCSVBtn,"tabindex","-1"),this._canExportProject=!1},onWidgetActive:function(){this._templatePicker&&this._templatePicker.bindLayerEvents()},onWidgetDeActive:function(){this._templatePicker&&this._templatePicker._editor&&this._templatePicker._editor.editToolbar&&(this._templatePicker._editor.templatePicker.clearSelection(),this._templatePicker._editor.editToolbar.deactivate(),this._templatePicker.removeLayerEvents())},
onShow:function(t){this.refreshTemplatePicker(t)},onWidgetOpen:function(){this.refreshTemplatePicker();this.config.projectSettings.projectLayer||(this._recentlyOperatedLayerIds=[],this._filterAssets());this._templatePicker&&!this._templatePicker._editor&&(this._disableWebMapPopup(),this._templatePicker.initEditingToolbar())},onWidgetClose:function(){this.config.projectSettings.projectLayer||this._clearAppliedFilters();this._templatePicker&&this._templatePicker._editor&&(this._templatePicker._editor.destroy(),
this._templatePicker._editor=null,this._enableWebMapPopup())},refreshTemplatePicker:function(t){if(this._templatePicker){this._templatePicker.onWindowResize();if(!t){t=this.refreshButton;var x=this.featureModeTextNode;"none"===this.downloadCSVBtn.style.display||e.contains(this.downloadCSVBtn,"esriCTHidden")||(t=this.downloadCSVBtn);e.contains(this.projectNameDiv,"esriCTHidden")||(x=this.projectNameDiv);this.appUtils.setFirstAndLastWBFocusNode(this.widgetDomNode,x,t)}this._handle508AccessibilityForTemplatePicker()}},
startup:function(){this.inherited(arguments);this._storeExistingLabelPointLayerDefExpression();this.config.generalSettings.hasOwnProperty("canExportProject")&&this.config.generalSettings.canExportProject&&this._getReportColumns();this.config.projectSettings.projectLayer?(this.own(k(this.backButton,"click",c.hitch(this,function(){this._backButtonClicked()}))),this.own(k(this.backButton,"keydown",c.hitch(this,function(F){if(F.keyCode===p.ENTER||F.keyCode===p.SPACE)E.stop(F),this._backButtonClicked()})))):
(w.set(this.refreshButton,"innerHTML",this.nls.common.reset),w.set(this.refreshButton,"aria-label",this.nls.common.reset),e.add(this.backButton,"esriCTHidden"));this.own(k(this.refreshButton,"click",c.hitch(this,function(){this._refreshButtonClicked()})));this.own(k(this.refreshButton,"keydown",c.hitch(this,function(F){if(F.keyCode===p.ENTER||F.keyCode===p.SPACE)E.stop(F),this._refreshButtonClicked()})));this.own(k(this.downloadCSVBtn,"click",c.hitch(this,function(){var F=this._createDownLoadData();
this._downLoadCSV(F)})));this.own(k(this.downloadCSVBtn,"keydown",c.hitch(this,function(F){if(F.keyCode===p.ENTER||F.keyCode===p.SPACE)F=this._createDownLoadData(),this._downLoadCSV(F)})));this.onProjectCreateOrLoad(this.projectInfo,this.assetInfo);var t=this.refreshButton,x=this.featureModeTextNode;"none"===this.downloadCSVBtn.style.display||e.contains(this.downloadCSVBtn,"esriCTHidden")||(t=this.downloadCSVBtn);e.contains(this.projectNameDiv,"esriCTHidden")||(x=this.projectNameDiv);this.appUtils.setFirstAndLastWBFocusNode(this.widgetDomNode,
x,t);this._handle508AccessibilityForTemplatePicker()},_backButtonClicked:function(){e.contains(this.backButton,"jimu-state-disabled")||(this._clearAppliedFilters(),this._templatePicker.destroy(),this._templatePicker=null,this._enableWebMapPopup(),this.emit("showProjectPanel"))},_refreshButtonClicked:function(){this._clearAppliedFilters();this._templatePicker&&(this._templatePicker.destroy(),this._templatePicker=null);this.projectInfo.projectId&&this.config.projectSettings.projectLayer?this.emit("reloadProject",
this.projectInfo.projectId):this._resetProject()},_resetProject:function(){var t=[],x;this.loadingIndicator.show();if(this._assetInfoForReset&&0<Object.keys(this._assetInfoForReset).length)for(x in this._assetInfoForReset){var F=this.layerInfosObj.getLayerInfoById(x).layerObject;var K=F.globalIdField+" in ('"+this._assetInfoForReset[x].join("','")+"')";t.push(this.appUtils.deleteFeatures(F.url,K))}m(t).then(c.hitch(this,function(){this.loadingIndicator.hide();this._assetInfoForReset={};this.onProjectCreateOrLoad(this.projectInfo,
this.assetInfo);this.emit("resetProject")}),c.hitch(this,function(){this.loadingIndicator.hide()}))},_clearAppliedFilters:function(){this.config.projectSettings.projectLayer&&this.filterManager.applyWidgetFilter(this.config.projectSettings.projectLayer,this.widgetId,"",!0,!0);this._recentlyOperatedLayerIds=[];q.forEach(this.config.layerSettings,c.hitch(this,function(x){var F=this.layerInfosObj.getLayerInfoById(x.id);x.editable&&F&&F.layerObject&&F.layerObject.clearSelection()}));var t=this.map.getLayer(this.config.projectSettings.pointLayerCentroid);
t&&(t.setDefinitionExpression(this._exsitingLabelPointDefExpression),t.refresh());this._filterAssets(!0)},_loadProjectAssetTable:function(){var t=new g;if(this.config.projectSettings.assetTable&&!this._projectAssetTable){var x=this.layerInfosObj.getTableInfoById(this.config.projectSettings.assetTable).layerObject;this._projectAssetTable=new l(x.url);this.own(k(this._projectAssetTable,"load",function(){t.resolve()}))}else t.resolve();return t.promise},_loadAdditionalCostTable:function(){var t;var x=
new g;(t=this.config.projectSettings.multiplierAdditionalCostTable)&&!this._additionalCostTable?(t=this.layerInfosObj.getTableInfoById(t).layerObject.url,this._additionalCostTable=new l(t),this.own(k(this._additionalCostTable,"load",function(){x.resolve()}))):x.resolve();return x.promise},onProjectCreateOrLoad:function(t,x){var F=[];this.projectInfo=t;this._displayLabelRelatedToSelectProject();F.push(this._loadProjectAssetTable());F.push(this._loadAdditionalCostTable());m(F).then(c.hitch(this,function(){var K,
R,U;this.projectInfo=t;this._recentlyOperatedLayerIds=[];this._assetTableIds={};this._assetItemSummary={};this._assetGroupSummary={};this._disableWebMapPopup();this.initWorkBenchComponents().then(c.hitch(this,function(){U=this.config.projectSettings.projectLayer;this.projectInfo.projectId&&U&&(R=this.layerInfosObj.getLayerInfoById(U).layerObject,K=R.globalIdField+"\x3d '"+this.projectInfo.projectId+"'",this.filterManager.applyWidgetFilter(U,this.widgetId,K,!0,!0));this._projectOverview&&this._projectOverview.showAssetItemSummary(this._assetItemSummary,
!1);this._assetDetails&&this._assetDetails.reset();x?this.loadProject(x):(this._filterAssets(),this._projectSummary.addConfiguredAdditionalCostArray());0===Object.keys(this._assetItemSummary).length?e.add(this.downloadCSVBtn,"esriCTHidden"):e.remove(this.downloadCSVBtn,"esriCTHidden");var M=this.refreshButton,P=this.featureModeTextNode;"none"===this.downloadCSVBtn.style.display||e.contains(this.downloadCSVBtn,"esriCTHidden")||(M=this.downloadCSVBtn);e.contains(this.projectNameDiv,"esriCTHidden")||
(P=this.projectNameDiv);this.appUtils.setFirstAndLastWBFocusNode(this.widgetDomNode,P,M);this._handle508AccessibilityForTemplatePicker()}))}))},loadProject:function(t){var x=[];this._isLoadingProject=!0;this._projectSummary.loadingProject=!0;this._projectSummary.loadAdditionalCost(t.additionalCostInfo);for(var F in t.assetInfo){var K=t.assetInfo[F],R=this.layerInfosObj.getLayerInfoById(F).layerObject;x=x.concat(K);this._loadAsset(R,K,t,F)}this._setExtentToProjectAssets(x);this._recentlyOperatedLayerIds=
[];this._onAssetInfoUpdate();this._projectSummary.loadingProject=!1;this._projectSummary.calculateGrossCost(this._projectSummary.totalCost,!1)},_loadAsset:function(t,x,F,K){q.forEach(x,c.hitch(this,function(R){var U=R.attributes[t.globalIdField],M=F.assetTemplateInfo[U];R.templateInfo=M;R.templateName=M.TEMPLATENAME;this._templatePicker.loadCostingInfo(K,M);this._assetTableIds[U]=M.OBJECTID;this._onFeaturesAdded([R],t,[M],!1)}))},_setExtentToProjectAssets:function(t){0<t.length&&this.map.setExtent(A.graphicsExtent(t).expand(1.5))},
initWorkBenchComponents:function(){var t=new g;this._initTemplatePicker();this._initProjectSummary();this._initProjectOverview();this._initAssetDetails(t);return t.promise},_initTemplatePicker:function(){var t=n.create("div",{},this.templatePickerContainer);this._templatePicker=new L({config:this.config,nls:this.nls,layerInfosObj:this.layerInfosObj,loadingIndicator:this.loadingIndicator,projectInfo:this.projectInfo,selectedProjectFeatureAttr:this.selectedProjectFeatureAttr?this.selectedProjectFeatureAttr:
null,map:this.map,selectFeaturesNode:this.copyFeaturesNode,selectButton:this.selectButton,sketchButton:this.sketchButton,appUtils:this.appUtils,widgetId:this.widgetId,widgetDomNode:this.widgetDomNode,refreshButton:this.refreshButton,downloadCSVBtn:this.downloadCSVBtn,projectNameDiv:this.projectNameDiv,featureModeTextNode:this.featureModeTextNode},t);k(this._templatePicker,"assetAdded",c.hitch(this,function(x,F,K){0<x.length&&0<K.length&&(this._onFeaturesAdded(x,F,K,!0),this.emit("onAssetAdded",x,
F.id,this._projectA),e.contains(this.downloadCSVBtn,"esriCTHidden")&&e.remove(this.downloadCSVBtn,"esriCTHidden"),this._onAssetInfoUpdate())}));k(this._templatePicker,"assetDeleted",c.hitch(this,function(x,F){var K=this._getGlobalIds(F.globalIdField,x);this._onFeaturesUpdated(x);0===Object.keys(this._assetItemSummary).length&&e.add(this.downloadCSVBtn,"esriCTHidden");this._onAssetInfoUpdate(!0);q.forEach(K,c.hitch(this,function(R){this._assetTableIds.hasOwnProperty(R)&&delete this._assetTableIds[R];
this._assetInfoForReset&&this._assetInfoForReset[F.id]&&(R=this._assetInfoForReset[F.id].indexOf(R),-1<R&&this._assetInfoForReset[F.id].splice(R,1))}));this._projectAssetTable&&(x=this.config.assetTableFields.ASSETGUID+" in ('"+K.join("','")+"')",this.appUtils.deleteFeatures(this._projectAssetTable.url,x))}));k(this._templatePicker,"assetUpdated",c.hitch(this,function(x){this._onFeaturesUpdated(x,!0);this._onAssetInfoUpdate()}));k(this._templatePicker,"editorLoaded",c.hitch(this,function(){this._handle508AccessibilityForTemplatePicker()}));
this._templatePicker.startup()},_handle508AccessibilityForTemplatePicker:function(){setTimeout(c.hitch(this,function(){var t=z("div[role\x3d'grid']",this.templatePickerContainer);var x=z("[type\x3d'checkbox']",this.templatePickerContainer);var F=z("[dojoattachpoint\x3d'lastFocusNode']",this.templatePickerContainer);t&&t[0]&&w.set(t[0],"tabindex","-1");q.forEach(x,c.hitch(this,function(K){w.set(K,"tabindex","-1")}));F&&F[0]&&w.set(F[0],"tabindex","-1")}),500)},_initProjectSummary:function(){this._projectSummary?
this._projectSummary.reset(this.projectInfo):(this._projectSummary=new v({nls:this.nls,map:this.map,config:this.config,appUtils:this.appUtils,layerInfosObj:this.layerInfosObj,projectInfo:this.projectInfo,additionalCostTable:this._additionalCostTable,widgetDomNode:this.widgetDomNode},n.create("div",{},this.projectSummaryDiv)),this.own(k(this._projectSummary,"grossCostUpdated",c.hitch(this,function(t,x,F){this._projectOverview.grossCostUpdated(x);this._assetDetails.grossCostUpdated(t,x,F);this.emit("onGrossCostUpdated",
t,x,F)}))),this.own(k(this._projectSummary,"onOkButtonClicked",c.hitch(this,function(){this.emit("showAssetDetails")}))),this.own(k(this._projectSummary,"onCancelButtonClicked",c.hitch(this,function(){this.emit("showAssetDetails")}))),this._projectSummary.startup())},_initProjectOverview:function(){this._projectOverview?this._projectOverview.updateProjectInfo(this.projectInfo):(this._projectOverview=new y({config:this.config,appUtils:this.appUtils,nls:this.nls,map:this.map,layerInfosObj:this.layerInfosObj,
geometryService:new C(this.config.helperServices.geometry.url),projectInfo:this.projectInfo,widgetDomNode:this.widgetDomNode,projectNameDiv:this.projectNameDiv,selectButton:this.selectButton,featureModeTextNode:this.featureModeTextNode},n.create("div",{},this.projectOverview)),this.own(k(this._projectOverview,"actionClicked",c.hitch(this,function(t){this.emit("actionClicked",t)}))),this.own(k(this._projectOverview,"titleClicked",c.hitch(this,function(t){this.emit("titleClicked",t)}))),this.own(k(this._projectOverview,
"totalCostCalculated",c.hitch(this,function(t){this._assetDetails.totalCostUpdated(t);this._projectSummary.calculateGrossCost(t,!0)}))),this.own(k(this._projectOverview,"addOrModifyLabelPoint",c.hitch(this,function(t){this._addOrModifyLabelPoint(t.projectGeometry)}))),this._projectOverview.startup())},_initAssetDetails:function(t){this._assetDetails?(this._assetDetails.showAssetDetails({}),t.resolve()):(this._assetDetails=new b({nls:this.nls,map:this.map,config:this.config,appUtils:this.appUtils,
layerInfosObj:this.layerInfosObj,projectInfo:this.projectInfo,widgetDomNode:this.widgetDomNode},n.create("div",{},this.assetDetailsDiv)),this.own(k(this._assetDetails,"showAdditionalCost",c.hitch(this,function(){this._projectSummary&&this._projectSummary.cloneTableData();this.emit("showAdditionalCost")}))),this.own(k(this._assetDetails,"onOkButtonClicked",c.hitch(this,function(){this.emit("showWorkBenchPanel")}))),this.own(k(this._assetDetails,"onCancelButtonClicked",c.hitch(this,function(){this.emit("showWorkBenchPanel")}))),
this.own(k(this._assetDetails,"onLoad",c.hitch(this,function(){t.resolve()}))),this.own(k(this._assetDetails,"groupCostEquationUpdated",c.hitch(this,this._updateGroupCostEquation))),this._assetDetails.startup())},_createDownLoadData:function(){var t=[],x,F,K,R;for(x in this._assetGroupSummary)for(F in this._assetGroupSummary[x])for(K in this._assetGroupSummary[x][F])for(R in this._assetGroupSummary[x][F][K])this._assetGroupSummary[x][F][K][R]&&0<this._assetGroupSummary[x][F][K][R].length&&t.push(this._getReportAttributes(x,
this._assetGroupSummary[x][F][K][R]));return{features:t,cols:this._reportColumns}},_getReportColumns:function(){q.forEach(this.config.generalSettings.CSVReportSettings.reportSettings,c.hitch(this,function(t){t.isVisible&&this._reportColumns.push(t.columnLabel||t.columnTitle)}))},_getReportAttributes:function(t,x){var F={};q.forEach(this.config.generalSettings.CSVReportSettings.reportSettings,c.hitch(this,function(K){K.isVisible&&(F[K.columnLabel||K.columnTitle]=this._fetchReportFieldTitleAndData(K,
t,x))}));return F},_getFeatureColumns:function(t){var x=[],F;for(F in t)x.push(F);return x},_fetchReportFieldTitleAndData:function(t,x,F){x=this.layerInfosObj.getLayerOrTableInfoById(x).layerObject;switch(t.fieldToMap){case "layerName":var K=x.name;break;case "TEMPLATENAME":case "GEOGRAPHY":case "SCENARIO":case "COSTEQUATION":K=F[0].templateInfo[t.fieldToMap]||"None";break;case "count":K=F.length;break;case "Length":K=this._getTotalAreaOrLength(x.geometryType,F,"length");break;case "Area":K=this._getTotalAreaOrLength(x.geometryType,
F,"area");break;case "cost":K=this._getTotalCostForRegion(F)}return K},_getTotalAreaOrLength:function(t,x,F){var K=0;"esriGeometryPolyline"===t?"length"===F&&q.forEach(x,c.hitch(this,function(R){K+=R.featureDimension})):"esriGeometryPolygon"===t&&"area"===F&&q.forEach(x,c.hitch(this,function(R){K+=R.featureDimension}));return 0===K?"NA":this.appUtils.applyRounding(K)},_getTotalCostForRegion:function(t){var x=0;q.forEach(t,c.hitch(this,function(F){x+=F.individualCost}));return this.appUtils.applyRounding(x)},
_onAssetInfoUpdate:function(t){this._projectOverview.showAssetItemSummary(this._assetItemSummary,!0);this._assetDetails.showAssetDetails(this._assetGroupSummary,t);this._filterAssets();this.emit("assetInfoUpdated",this._assetItemSummary)},_addAssetGroupSummary:function(t,x,F){var K=F[0].TEMPLATENAME;this._assetGroupSummary.hasOwnProperty(x.id)?this._assetGroupSummary[x.id].hasOwnProperty(K)||(this._assetGroupSummary[x.id][K]={}):(this._assetGroupSummary[x.id]={},this._assetGroupSummary[x.id][K]={});
q.forEach(t,c.hitch(this,function(R,U){U=F[U];U.SCENARIO===this.nls.scenarioSelection.noneText&&(U.SCENARIO="null");U.GEOGRAPHY===this.nls.scenarioSelection.noneText&&(U.GEOGRAPHY="null");this._assetGroupSummary[x.id][K].hasOwnProperty(U.GEOGRAPHY)?this._assetGroupSummary[x.id][K][U.GEOGRAPHY].hasOwnProperty(U.SCENARIO)||(this._assetGroupSummary[x.id][K][U.GEOGRAPHY][U.SCENARIO]=[]):(this._assetGroupSummary[x.id][K][U.GEOGRAPHY]={},this._assetGroupSummary[x.id][K][U.GEOGRAPHY][U.SCENARIO]=[]);this._assetGroupSummary[x.id][K][U.GEOGRAPHY][U.SCENARIO].push(R)}))},
_updateAssetGroupSummary:function(t,x,F){var K=x.templateInfo.TEMPLATENAME;var R=x.templateInfo.GEOGRAPHY;var U=x.templateInfo.SCENARIO;var M=x.attributes[t.objectIdField];R===this.nls.scenarioSelection.noneText&&(R="null");U===this.nls.scenarioSelection.noneText&&(U="null");q.some(this._assetGroupSummary[t.id][K][R][U],c.hitch(this,function(P,V){if(P.attributes[t.objectIdField]===M)return F?this._assetGroupSummary[t.id][K][R][U][V].featureDimension=x.featureDimension:this._assetGroupSummary[t.id][K][R][U].splice(V,
1),!0}))},_onFeaturesAdded:function(t,x,F,K){var R=[];var U=F[0].TEMPLATENAME;R=this._getGlobalIds(x.globalIdField,t);this._addAssetGroupSummary(t,x,F);this._assetItemSummary.hasOwnProperty(x.id)?this._assetItemSummary[x.id].templates.hasOwnProperty(U)?(t=this._assetItemSummary[x.id].templates[U].features.concat(t),this._assetItemSummary[x.id].templates[U].units=t.length):this._assetItemSummary[x.id].templates[U]={units:t.length,features:t,cost:null}:(this._assetItemSummary[x.id]={layerName:x.name,
templates:{},geometryType:x.geometryType},this._assetItemSummary[x.id].templates[U]={units:t.length,features:t,cost:null});this._recentlyOperatedLayerIds=[x.id];this._setFeaturesAndUnits(t,x,U);this._assetItemSummary[x.id].templates[U].cost=this._getTotalCost(x,U);K&&this._projectAssetTable?this._addAssetsToProjectAssetTable(F,R):(this._assetInfoForReset||(this._assetInfoForReset={}),this._assetInfoForReset[x.id]=this._assetInfoForReset[x.id]?this._assetInfoForReset[x.id].concat(R):c.clone(R))},_updateFeaturesInfo:function(t){var x;
q.forEach(t,c.hitch(this,function(F){var K=F._layer;for(x in this._assetItemSummary[K.id].templates)this._setUpdatedTemplateFeatures(F,K,x)}));return t},_setUpdatedTemplateFeatures:function(t,x,F){q.some(this._assetItemSummary[x.id].templates[F].features,c.hitch(this,function(K){if(K.attributes[x.objectIdField]===t.attributes[x.objectIdField])return t.featureDimension=K.featureDimension,t.templateName=F,t.templateInfo=K.templateInfo,!0}))},_onFeaturesUpdated:function(t,x){t=this._updateFeaturesInfo(t);
this._recentlyOperatedLayerIds=[];q.forEach(t,c.hitch(this,function(F){var K=F.templateName;var R=F._layer;this._recentlyOperatedLayerIds.push(R.id);q.some(this._assetItemSummary[R.id].templates[K].features,c.hitch(this,function(U,M){if(U.attributes[R.objectIdField]===F.attributes[R.objectIdField])return this._assetItemSummary.hasOwnProperty(R.id)&&this._assetItemSummary[R.id].templates[K]&&(x?(this._assetItemSummary[R.id].templates[K].features[M]=F,this._setFeaturesAndUnits(this._assetItemSummary[R.id].templates[K].features,
R,K,x)):(U=this._assetItemSummary[R.id].templates[K].units,U-=F.featureDimension,this._assetItemSummary[R.id].templates[K].units=this.appUtils.removeNegativeExponents(U)),this._updateAssetGroupSummary(R,F,x)),x||this._assetItemSummary[R.id].templates[K].features.splice(M,1),!0}));0===this._assetItemSummary[R.id].templates[K].features.length?delete this._assetItemSummary[R.id].templates[K]:this._assetItemSummary[R.id].templates[K].cost=this._getTotalCost(R,K);0===Object.keys(this._assetItemSummary[R.id].templates).length&&
delete this._assetItemSummary[R.id]}))},_setFeaturesAndUnits:function(t,x,F,K){var R=0;var U=this.config.generalSettings.measurementUnit;q.forEach(t,c.hitch(this,function(M){if(!M.hasOwnProperty("featureDimension")||K)M.featureDimension="esriGeometryPolygon"===x.geometryType?this.appUtils.getAreaOfGeometry(M.geometry,this.appUtils.units[U].areaUnit):"esriGeometryPolyline"===x.geometryType?this.appUtils.getLengthOfGeometry(M.geometry,this.appUtils.units[U].lengthUnit):1,K||(M.templateName=F);R+=M.featureDimension}));
this._assetItemSummary[x.id].templates[F].features=t;return this._assetItemSummary[x.id].templates[F].units=R},_getGroupTotalMeasure:function(t,x){var F=0;var K=x.TEMPLATENAME;var R=x.GEOGRAPHY;x=x.SCENARIO;try{var U=this._assetGroupSummary[t][K][R][x];q.forEach(U,c.hitch(this,function(M){F+=M.featureDimension}))}catch(M){F=0}return F},_getGroupTotalCount:function(t,x){var F;var K=0;var R=x.TEMPLATENAME;var U=x.GEOGRAPHY;x=x.SCENARIO;try{(F=this._assetGroupSummary[t][R][U][x])&&0<F.length&&(K=F.length)}catch(M){K=
0}return K},_getTotalCost:function(t,x){var F=0;q.forEach(this._assetItemSummary[t.id].templates[x].features,c.hitch(this,function(K){var R=this._getGroupTotalMeasure(t.id,K.templateInfo);var U=this._getGroupTotalCount(t.id,K.templateInfo);try{var M=K.templateInfo.COSTEQUATION;M=M.replace(/{MEASURE}/ig,K.featureDimension);M=M.replace(/{TOTALMEASURE}/ig,R);M=M.replace(/{TOTALCOUNT}/ig,U);var P=this.appUtils.evaluate(M)}catch(V){P=0}q.some(this._assetGroupSummary[t.id][x][K.templateInfo.GEOGRAPHY][K.templateInfo.SCENARIO],
c.hitch(this,function(V){if(V.attributes[t.objectIdField]===K.attributes[t.objectIdField])return V.individualCost=P,!0}));K.individualCost=P;F+=P}));return Number(F)},_getGlobalIds:function(t,x){var F=[];q.forEach(x,c.hitch(this,function(K){F.push(K.attributes[t])}));return F},_getExpressionToFilterAssets:function(t){var x,F=[],K;if((K=this.layerInfosObj.getLayerInfoById(t))&&K.layerObject&&this._assetItemSummary[t]){var R=K.layerObject;for(x in this._assetItemSummary[t].templates)F=F.concat(this._getGlobalIds(R.globalIdField,
this._assetItemSummary[t].templates[x].features))}return 0<F.length?R.globalIdField+" in ('"+F.join("','")+"')":"1\x3d2"},_filterAssets:function(t){this._recentlyOperatedLayerIds&&0!==this._recentlyOperatedLayerIds.length||(this._recentlyOperatedLayerIds=[],q.forEach(this.config.layerSettings,c.hitch(this,function(x){x.editable&&this._recentlyOperatedLayerIds.push(x.id)})));q.forEach(this._recentlyOperatedLayerIds,c.hitch(this,function(x){var F="";t||(F=this._getExpressionToFilterAssets(x));this.filterManager.applyWidgetFilter(x,
this.widgetId,F,!0,!0)}))},_addAssetsToProjectAssetTable:function(t,x){var F=[],K=["COSTEQUATION","SCENARIO","TEMPLATENAME","GEOGRAPHYGUID"];this.loadingIndicator.show();q.forEach(x,c.hitch(this,function(R,U){var M={};q.forEach(this._projectAssetTable.fields,c.hitch(this,function(P){var V="";-1<K.indexOf(P.name.toUpperCase())?(V=t[U][P.name.toUpperCase()],"SCENARIO"!==P.name.toUpperCase()&&"GEOGRAPHYGUID"!==P.name.toUpperCase()||"null"!==V||(V=null),M[P.name]=V):"ASSETGUID"===P.name.toUpperCase()?
M[P.name]=R:"PROJECTGUID"===P.name.toUpperCase()&&this.projectInfo.projectId&&(M[P.name]=this.projectInfo.projectId)}));F.push(new f(null,null,M))}));this._projectAssetTable.applyEdits(F,null,null,c.hitch(this,function(R){var U=!1;q.forEach(R,c.hitch(this,function(M,P){M.success?this._assetTableIds[x[P]]=M.objectId:U=!0}));U&&this.appUtils.showMessage(this.nls.workBench.errorInSavingAssetDetails);this.loadingIndicator.hide()}),c.hitch(this,function(){this.loadingIndicator.hide();this.appUtils.showMessage(this.nls.workBench.errorInSavingAssetDetails)}))},
_updateGroupCostEquation:function(t){var x=[];var F=t.groupInfo;var K=this._assetGroupSummary[F.layerId][F.templateName][F.region][F.scenario];var R=this.layerInfosObj.getLayerInfoById(F.layerId).layerObject;q.forEach(K,c.hitch(this,function(U){var M={};var P=U.attributes[R.globalIdField];var V=U.attributes[R.objectIdField];q.some(this._assetItemSummary[F.layerId].templates[F.templateName].features,c.hitch(this,function(O){if(O.attributes[R.objectIdField]===V)return O.templateInfo.COSTEQUATION=t.templateInfo.COSTEQUATION,
O.templateInfo.SCENARIO=t.templateInfo.SCENARIO,!0}));U.templateInfo.COSTEQUATION=t.templateInfo.COSTEQUATION;U.templateInfo.SCENARIO=t.templateInfo.SCENARIO;this._projectAssetTable&&this._assetTableIds[P]&&(M[this.config.assetTableFields.COSTEQUATION]=t.templateInfo.COSTEQUATION,M[this.config.assetTableFields.SCENARIO]="null"===t.templateInfo.SCENARIO?null:t.templateInfo.SCENARIO,M[this.config.assetTableFields.OBJECTID]=this._assetTableIds[P],x.push(new f(null,null,M)))}));delete this._assetGroupSummary[F.layerId][F.templateName][F.region][F.scenario];
this._assetGroupSummary[F.layerId][F.templateName][F.region][t.templateInfo.SCENARIO]=K;this._templatePicker.loadCostingInfo(R.id,K[0].templateInfo);this._assetItemSummary[R.id].templates[F.templateName].cost=this._getTotalCost(R,F.templateName);this._projectOverview.showAssetItemSummary(this._assetItemSummary,!1);this._assetDetails.showAssetDetails(this._assetGroupSummary);this._projectAssetTable&&(this.loadingIndicator.show(),this._projectAssetTable.applyEdits(null,x,null,c.hitch(this,function(){this.loadingIndicator.hide()}),
c.hitch(this,function(){this.loadingIndicator.hide()})))},_enableWebMapPopup:function(){this.map&&this.map.setInfoWindowOnClick(!0)},_disableWebMapPopup:function(){this.map&&this.map.setInfoWindowOnClick(!1);this._hideWebMapPopup()},_hideWebMapPopup:function(){this.map.infoWindow.isShowing&&this.map.infoWindow.hide();this.map.infoWindow.clearFeatures()},_addOrModifyLabelPoint:function(t){this.loadingIndicator.show();""!==this.config.projectSettings.pointLayerCentroid&&null!==this.config.projectSettings.pointLayerCentroid&&
void 0!==this.config.projectSettings.pointLayerCentroid?this._isLoadingProject?this._displayLabelRelatedToSelectProject():this._checkExistingLabelPoint(t):this.loadingIndicator.hide()},_displayLabelRelatedToSelectProject:function(){if(this._pointLayer=this.map.getLayer(this.config.projectSettings.pointLayerCentroid)){var t=this._pointLayer.getDefinitionExpression(),x=this._getFieldName(this._pointLayer,"projectid")+" \x3d '"+this.projectInfo.projectId+"'";""!==t&&null!==t&&void 0!==t?-1===t.indexOf(x)&&
(t=t+" AND "+x):t=x;this._pointLayer.setDefinitionExpression(t);this._pointLayer.refresh()}this._isLoadingProject=!1;this.loadingIndicator.hide()},_checkExistingLabelPoint:function(t){var x={},F;x.existingLabelPoint=this._getExistingLabelPointDeferred();m(x).then(c.hitch(this,function(K){0<K.existingLabelPoint.features.length?this._createLabelPoint(!1,t,K.existingLabelPoint.features[0]):this._createLabelPoint(!0,t)}),c.hitch(this,function(){this.loadingIndicator.hide();F=this.appUtils.showMessage(this.nls.createLoadProject.errorAddingPointLabel);
this._handleShowDialogClosed(F)}))},_createLabelPoint:function(t,x,F){var K;if(0<x.rings.length){var R=new C(this.config.helperServices.geometry.url);x=H.simplify(x);R.labelPoints([x],c.hitch(this,function(U){this.config.projectSettings.pointLayerCentroid&&(U=U[0],t?this._addLabelPoint(U):this._updateExistingLabelPoint(F,U))}),c.hitch(this,function(){this.loadingIndicator.hide();K=this.appUtils.showMessage(this.nls.createLoadProject.errorFetchingPointLabel);this._handleShowDialogClosed(K)}))}else this._deleteExistingLabelPoint(F)},
_deleteExistingLabelPoint:function(t){var x;if(t){var F={};F[this._pointLayer.objectIdField]=t.attributes[this._pointLayer.objectIdField];var K=new f(null,null,F,null),R=new l(this._pointLayer.url,{outFields:["*"]});R.onLoad=c.hitch(this,function(){R.applyEdits(null,null,[K],c.hitch(this,function(U,M,P){P[0].success||(x=this.appUtils.showMessage(this.nls.createLoadProject.errorAddingPointLabel),this._handleShowDialogClosed(x));this.map.getLayer(this.config.projectSettings.pointLayerCentroid).refresh();
this.loadingIndicator.hide()}),c.hitch(this,function(){this.loadingIndicator.hide();x=this.appUtils.showMessage(this.nls.createLoadProject.errorAddingPointLabel);this._handleShowDialogClosed(x)}))})}else this.loadingIndicator.hide()},_getExistingLabelPointDeferred:function(){var t=this._getFieldName(this._pointLayer,"projectid")+" \x3d '"+this.projectInfo.projectId+"'";var x=new B(this._pointLayer.url),F=new h;F.outFields=["*"];F.where=t;F.returnGeometry=!0;F.outSpatialReference=this.map.spatialReference;
return x.execute(F).promise},_getFieldName:function(t,x){var F;q.forEach(t.fields,c.hitch(this,function(K){K.name.toLowerCase()===x.toLowerCase()&&(F=K.name)}));return F},_addLabelPoint:function(t){var x=new N(t.x,t.y,new T({wkid:this.map.spatialReference.wkid}));t=this._pointLayer.hasOwnProperty("templates")&&0<this._pointLayer.templates.length&&this._pointLayer.templates[0].hasOwnProperty("prototype")&&this._pointLayer.templates[0].prototype.hasOwnProperty("attributes")?this._pointLayer.templates[0].prototype.attributes:
this._pointLayer.hasOwnProperty("types")&&0<this._pointLayer.types.length&&this._pointLayer.types[0].hasOwnProperty("templates")&&0<this._pointLayer.types[0].templates.length&&this._pointLayer.types[0].templates[0].hasOwnProperty("prototype")&&this._pointLayer.types[0].templates[0].prototype.hasOwnProperty("attributes")?this._pointLayer.types[0].templates[0].prototype.attributes:null;null===this._originalTemplateAttributes||""===this._originalTemplateAttributes||void 0===this._originalTemplateAttributes?
this._originalTemplateAttributes=c.clone(t):t=c.clone(this._originalTemplateAttributes);var F=this._getFieldName(this._pointLayer,"projectid");t[F]=this.projectInfo.projectId;t=new f(x,null,t,null);(new l(this._pointLayer.url)).applyEdits([t],null,null,c.hitch(this,function(K,R,U){K[0].success||(K=this.appUtils.showMessage(this.nls.createLoadProject.errorAddingPointLabel),this._handleShowDialogClosed(K));this.map.getLayer(this.config.projectSettings.pointLayerCentroid).refresh();this.loadingIndicator.hide()}),
c.hitch(this,function(){this.loadingIndicator.hide();var K=this.appUtils.showMessage(this.nls.createLoadProject.errorAddingPointLabel);this._handleShowDialogClosed(K)}))},_updateExistingLabelPoint:function(t,x){var F={};F[this._pointLayer.objectIdField]=t.attributes[this._pointLayer.objectIdField];t=new N(x.x,x.y,new T({wkid:this.map.spatialReference.wkid}));var K=new f(t,null,F,null),R=new l(this._pointLayer.url,{outFields:["*"]});R.onLoad=c.hitch(this,function(){R.applyEdits(null,[K],null,c.hitch(this,
function(U,M,P){M[0].success||(U=this.appUtils.showMessage(this.nls.createLoadProject.errorAddingPointLabel),this._handleShowDialogClosed(U));this.map.getLayer(this.config.projectSettings.pointLayerCentroid).refresh();this.loadingIndicator.hide()}),c.hitch(this,function(){this.loadingIndicator.hide();var U=this.appUtils.showMessage(this.nls.createLoadProject.errorAddingPointLabel);this._handleShowDialogClosed(U)}))})},updateProjectFeatureAttributes:function(t){this._templatePicker.selectedProjectFeatureAttr=
t},_storeExistingLabelPointLayerDefExpression:function(){var t=this.map.getLayer(this.config.projectSettings.pointLayerCentroid);t&&(t=t.getDefinitionExpression(),this._exsitingLabelPointDefExpression=c.clone(t))},_handleShowDialogClosed:function(t){(t=t.enabledButtons[0])&&this.own(k(t,"keydown",c.hitch(this,function(x){if(x.keyCode===p.ENTER||x.keyCode===p.SPACE)E.stop(x),e.contains(this.sketchButton,"esriCTSketchDisable")?r.focus(this.selectButton):r.focus(this.sketchButton)})))},_downLoadCSV:function(t){var x=
this._getCSVFileName();D.exportCSV(x,t.features,t.cols)},_getCSVFileName:function(){var t="AssetItemDetails";this.config.generalSettings.CSVReportSettings.reportName?t=this.config.generalSettings.CSVReportSettings.reportName:this.projectInfo&&this.projectInfo.name&&(t="Export-"+this.projectInfo.name);return t}})})},"widgets/CostAnalysis/template-picker":function(){define("dojo/_base/declare jimu/BaseWidget dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./template-picker.html dojo/_base/array dojo/_base/lang dojo/on dojo/Deferred dojo/dom-class dojo/dom-construct esri/dijit/editing/Editor esri/tasks/GeometryService dojo/_base/html jimu/dijit/Popup jimu/dijit/Message dojo/keys esri/geometry/geometryEngine ./scenario-selection esri/SpatialReference esri/geometry/Polyline esri/geometry/Polygon esri/tasks/query esri/tasks/QueryTask esri/graphic esri/layers/FeatureLayer esri/toolbars/draw ./copy-features dojo/dom-attr dijit/focus dojo/_base/event jimu/utils".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v,b,D,h,B,H,T,N,p,E){return Q([I,J,G],{templateString:u,baseClass:"jimu-widget-cost-template-picker",_projectOverview:null,_templatePicker:null,_editor:null,_scenarioSelectionObj:null,_selectScenarioPopup:null,_isFeatureIntersected:null,_configuredTemplateObj:[],_configuredGeographyCostEquation:{},_onBeforeEditCompleteResult:{},_templateInfoCalculated:!1,_addFeaturesEventInfo:[],_windowResizeTimer:null,selectedTemplateInfo:{},_splitAssetsArr:[],
_currentAssetSplitGeometry:null,_nonEditableLayers:[],_splitAssetInfo:[],_allIntersectedRegions:[],_selectedTemplate:null,_featuresToBeCopied:[],_layerEvents:[],_copyFeaturesObj:null,_layersForEditor:[],postCreate:function(){this.inherited(arguments);this._isFeatureIntersected=this._selectScenarioPopup=this._scenarioSelectionObj=this._editor=this._templatePicker=this._projectOverview=null;this._configuredTemplateObj=[];this._configuredGeographyCostEquation={};this.selectedTemplateInfo={};this._onBeforeEditCompleteResult=
{};this._addFeaturesEventInfo=[];this._splitAssetsArr=[];this._currentAssetSplitGeometry=null;this._nonEditableLayers=[];this._splitAssetInfo=[];this._windowResizeTimer=null;this._allIntersectedRegions=[];this._selectedTemplate=null;this._featuresToBeCopied=[];this._layerEvents=[];this._copyFeaturesObj=null;this._layersForEditor=[]},startup:function(){this.inherited(arguments);this._getLayersForSelection();a(window,"resize",c.hitch(this,this.onWindowResize));this.own(a(this.sketchButton,"click",c.hitch(this,
function(){q.contains(this.sketchButton,"esriCTSketchEnable")||(this._toolBarActive=!0,this._activateSketchButton(),this._deActivateSelectButton());this._toggleToolState()})));this.own(a(this.sketchButton,"keydown",c.hitch(this,function(r){if(r.keyCode===m.ENTER||r.keyCode===m.SPACE)q.contains(this.sketchButton,"esriCTSketchEnable")||(this._toolBarActive=!0,this._activateSketchButton(),this._deActivateSelectButton()),this._toggleToolState()})));this.own(a(this.selectButton,"click",c.hitch(this,function(){q.contains(this.selectButton,
"esriCTSelectEnable")||(this._toolBarActive=!1,this._activateSelectButton(),this._deActivateSketchButton());this._toggleToolState()})));this.own(a(this.selectButton,"keydown",c.hitch(this,function(r){if(r.keyCode===m.ENTER||r.keyCode===m.SPACE)q.contains(this.selectButton,"esriCTSelectEnable")||(this._toolBarActive=!1,this._activateSelectButton(),this._deActivateSketchButton()),this._toggleToolState()})))},destroy:function(){this._deactivateAllTools();this.removeLayerEvents();this._configuredGeographyCostEquation=
{};this._editor&&(this._editor.destroy(),this._editor=null);this._copyFeaturesObj&&(this._copyFeaturesObj.destroy(),this._copyFeaturesObj=null);this.inherited(arguments)},loadCostingInfo:function(r,t){var x=t.GEOGRAPHYGUID;var F=t.TEMPLATENAME;this._configuredGeographyCostEquation.hasOwnProperty(x)?this._configuredGeographyCostEquation[x].hasOwnProperty(r)?this._configuredGeographyCostEquation[x][r].hasOwnProperty(F)?this._configuredGeographyCostEquation[x]&&this._configuredGeographyCostEquation[x][r]&&
this._configuredGeographyCostEquation[x][r][F]&&(this._configuredGeographyCostEquation[x][r][F].COSTEQUATION=t.COSTEQUATION):this._configuredGeographyCostEquation[x][r][F]=t:(this._configuredGeographyCostEquation[x][r]={},this._configuredGeographyCostEquation[x][r][F]=t):(this._configuredGeographyCostEquation[x]={},this._configuredGeographyCostEquation[x][r]={},this._configuredGeographyCostEquation[x][r][F]=t)},onWindowResize:function(){this._windowResizeTimer&&clearTimeout(this._windowResizeTimer);
this._windowResizeTimer=setTimeout(c.hitch(this,this.resize),500)},_getLayersForSelection:function(){var r,t,x=[];this._layersForEditor=null;this._getConfiguredTemplates();d.forEach(this.config.layerSettings,c.hitch(this,function(F){if(F.editable||F.selectable)if(r=this.map.getLayer(F.id)){t=this._getLayerSettingsById(F.id);if(t.selectedField)var K=t.selectedField;(r=this._filterLayerTemplates(r,K))&&x.push({featureLayer:r,disableAttributeUpdate:!F.editable,disableGeometryUpdate:!F.editable,editable:F.editable});
F.editable||this._nonEditableLayers.push(F.id)}}));setTimeout(c.hitch(this,function(){this._layersForEditor=x;this._editor||this.initEditingToolbar()}),500)},_getLayerSettingsById:function(r){var t={};d.some(this.config.layerSettings,c.hitch(this,function(x){if(x.id===r)return t=x,!0}));return t},_filterLayerTemplates:function(r,t){var x,F;for(F in this.config.costingInfoSettings)0<this.config.costingInfoSettings[F].length&&(x=this.layerInfosObj.getLayerInfoById(F))&&x.layerObject&&x.layerObject.url===
r.url&&(0<r.templates.length?r.templates=this._setConfiguredTemplates(r.templates,F,t):r.types=this._setConfiguredTemplates(r.types,F,t));return r},_setConfiguredTemplates:function(r,t,x){var F=[];for(var K=r.length-1;0<=K;K--){var R=r[K].templates?r[K].templates[0].name:r[K].name;R=this._configuredTemplateObj[t].indexOf(R);-1!==R&&(x&&("templates"in r[K]?r[K].templates[0].prototype.attributes[x]=this.projectInfo.projectId:r[K].prototype.attributes[x]=this.projectInfo.projectId),F.push(r[K]))}return F},
_getConfiguredTemplates:function(){for(var r in this.config.costingInfoSettings)this._getConfiguredTemplateNameArray(r)},_getConfiguredTemplateNameArray:function(r){d.forEach(this.config.costingInfoSettings[r],c.hitch(this,function(t){this._configuredTemplateObj[r]||(this._configuredTemplateObj[r]=[]);this._configuredTemplateObj[r].push(t.featureTemplate)}))},initEditingToolbar:function(){if(null!==this._layersForEditor){var r=this._layersForEditor?this._layersForEditor:[];r={settings:{map:this.map,
geometryService:new z(this.config.helperServices.geometry.url),layerInfos:r,toolbarVisible:!1,showAttributesOnClick:!0,toolbarOptions:{reshapeVisible:!1,cutVisible:!1,mergeVisible:!1},createOptions:{polylineDrawTools:[k.CREATE_TOOL_POLYLINE,k.CREATE_TOOL_FREEHAND_POLYLINE],polygonDrawTools:[k.CREATE_TOOL_POLYGON,k.CREATE_TOOL_RECTANGLE,k.CREATE_TOOL_CIRCLE,k.CREATE_TOOL_FREEHAND_POLYGON]},showTooltip:!1}};this._editor=new k(r,e.create("div",{},this.editorToolbarNode));this.own(a(this._editor,"load",
c.hitch(this,function(){this.emit("editorLoaded")})));this._editor.startup();this.bindLayerEvents();this._editor.templatePicker.showTooltip=!0;r=d.filter(this._editor.templatePicker.featureLayers,c.hitch(this,function(t){return-1===this._nonEditableLayers.indexOf(t.id)}));this._editor.templatePicker.featureLayers=r;this.templatePickerNode&&this._editor.templatePicker.placeAt(this.templatePickerNode);this.own(a(this._editor.templatePicker,"selection-change",c.hitch(this,function(){var t;if(t=this._editor.templatePicker.getSelected())this._selectedTemplate=
t;q.contains(this.selectButton,"esriCTSelectDisable")||this._activateCustomSelectTool()})));this.own(a(this._editor.editToolbar,"deactivate",c.hitch(this,function(){this.emit("editEnd")})));this.own(a(this._editor.editToolbar,"activate",c.hitch(this,function(){this.emit("editStart")})));this.customToolbar||this._createCustomSelectTool();setTimeout(c.hitch(this,this.resize,100))}},_displayCopyAssetsPopup:function(){this._copyFeaturesDialog=new g({message:this.nls.scenarioSelection.copyFeatureMsg,type:"question",
maxWidth:375,buttons:[{label:this.nls.common.yes,onClick:c.hitch(this,function(){this._copyFeaturesDialog.close();this._copyFeaturesObj.cancelBtnClicked();this._selectedTemplate&&this._copyFeature()})},{label:this.nls.common.no,onClick:c.hitch(this,function(){this._copyFeaturesDialog.close()})}]});var r=this._copyFeaturesDialog.enabledButtons;this.own(a(r[0],"keydown",c.hitch(this,function(t){if(t.keyCode===m.ENTER||t.keyCode===m.SPACE)p.stop(t),this._copyFeaturesObj.toggleWorkBenchDOMTabindexes("0"),
E.initFirstFocusNode(this.widgetDomNode,this.featureModeTextNode),E.initLastFocusNode(this.widgetDomNode,this.refreshButton),N.focus(this.featureModeTextNode)})));this.own(a(r[1],"keydown",c.hitch(this,function(t){if(t.keyCode===m.ENTER||t.keyCode===m.SPACE)p.stop(t),this._copyFeaturesObj.toggleWorkBenchDOMTabindexes("-1"),this._copyFeaturesObj._setFirstAndLastFocusNodes()})))},_copyFeature:function(){if(this._selectedTemplate){var r=new D(this._featuresToBeCopied.shift());this._selectedTemplate.featureLayer.applyEdits([r])}},
_onCancelBtnClicked:function(){},_addCustomApplyEdits:function(){this._editor&&this._editor.settings&&this._editor.settings.layers&&d.forEach(this._editor.settings.layers,c.hitch(this,function(r){r.myApplyEdits=r.applyEdits;var t=this;r.applyEdits=function(x,F,K){x&&0!==x.length?t._selectedTemplate&&(t._orgFeature=x[0],t._checkAssetIntersection()):r.myApplyEdits(x,F,K);var R=new w;setTimeout(function(){R.resolve(!0)},100);return R}}))},removeLayerEvents:function(){this._editor&&this._editor.settings&&
this._editor.settings.layers&&d.forEach(this._editor.settings.layers,c.hitch(this,function(r){r.myApplyEdits&&(r.applyEdits=r.myApplyEdits,delete r.myApplyEdits)}));this._layerEvents&&0<this._layerEvents.length&&(d.forEach(this._layerEvents,c.hitch(this,function(r){r[0].remove()})),this._layerEvents=[]);this._copyFeaturesObj&&this._copyFeaturesObj.cancelBtnClicked()},bindLayerEvents:function(){this.removeLayerEvents();this._addCustomApplyEdits();this._editor&&this._editor.settings&&this._editor.settings.layers&&
0<this._editor.settings.layers.length&&d.forEach(this._editor.settings.layers,c.hitch(this,function(r){var t=this.own(a(r,"before-apply-edits",c.hitch(this,this.onBeforeEditComplete)));var x=this.own(a(r,"edits-complete",c.hitch(this,this.onEditCompletes)));this._layerEvents.push(t);this._layerEvents.push(x);-1<this._nonEditableLayers.indexOf(r.id)&&(t=this.own(a(r,"selection-complete",c.hitch(this,function(F){F.features.length&&this._editor&&this._editor.drawingToolbar&&this._editor.drawingToolbar._tools&&
q.add(this._editor.drawingToolbar._tools.DELETE.domNode,"esriCTHidden")}))),r=this.own(a(r,"selection-clear",c.hitch(this,function(){this._editor&&this._editor.drawingToolbar&&this._editor.drawingToolbar._tools&&q.remove(this._editor.drawingToolbar._tools.DELETE.domNode,"esriCTHidden")}))),this._layerEvents.push(t),this._layerEvents.push(r))}))},onBeforeEditComplete:function(r){this._editor.attributeInspector.focused&&(r.deletes&&0===r.deletes.length||r.updates&&0<r.updates.length)||(this.loadingIndicator.show(),
this._onBeforeEditCompleteResult[r.target.id]||(this._onBeforeEditCompleteResult[r.target.id]=[]),this._onBeforeEditCompleteResult[r.target.id].push(r))},onEditCompletes:function(r){this._editor.attributeInspector.focused&&(r.deletes&&0===r.deletes.length||r.updates&&0<r.updates.length)||(r=this._getSucceededFeatures(r,r.target.id),this.loadingIndicator.hide(),r.deletes&&0<r.deletes.length&&this.deleteFeatures(r.deletes,r.target),r.adds&&0<r.adds.length&&this.addFeatures(r.adds,r.target),r.updates&&
0<r.updates.length&&this.editFeatures(r.updates))},_getSucceededFeatures:function(r,t){d.forEach(r.adds,c.hitch(this,function(x,F){x.success||(this._onBeforeEditCompleteResult[t][0].adds.splice(F,1),this._splitAssetInfo.splice(F,1))}));d.forEach(r.updates,c.hitch(this,function(x,F){x.success||(this._onBeforeEditCompleteResult[t][0].updates.splice(F,1),this._splitAssetInfo.splice(F,1))}));d.forEach(r.deletes,c.hitch(this,function(x,F){x.success||(this._onBeforeEditCompleteResult[t][0].deletes.splice(F,
1),this._splitAssetInfo.splice(F,1))}));return this._onBeforeEditCompleteResult[t].shift()},addFeatures:function(r,t){d.forEach(this._splitAssetInfo,c.hitch(this,function(x,F){delete x.ASSETGEOMETRY;r[F].templateInfo=x;r[F].templateName=x.TEMPLATENAME}));this.emit("assetAdded",r,t,this._splitAssetInfo);this._orgFeature=null;0<this._featuresToBeCopied.length&&this._copyFeature()},editFeatures:function(r){this.emit("assetUpdated",r)},deleteFeatures:function(r,t){this.emit("assetDeleted",r,t)},_polygonToPolyline:function(r){var t,
x;var F=[];var K=new L(new A(r.spatialReference));for(x=0;x<r.rings.length;x++){var R=[];for(t=0;t<r.rings[x].length;t++)R.push(r.rings[x][t]);K.addPath(R)}F.push(K);return F},_getSplitFeatureGeometries:function(r,t){var x;var F=[];var K=[];if(0<t.length){"polyline"===r.geometry.type?x=!0:"polygon"===r.geometry.type&&(x=!1);d.forEach(t,c.hitch(this,function(U){F.push(U.geometry)}));t=l.union(F);t=this._polygonToPolyline(t)[0];var R=r.geometry;t=l.cut(R,t);1<t.length?(K.push({geometry:t[0],isIntersectedGeometry:!1}),
x?d.forEach(t,c.hitch(this,function(U,M){0<M&&d.forEach(U.paths,c.hitch(this,function(P){var V=new L(new A(r.geometry.spatialReference));V.addPath(P);K.push({geometry:V,isIntersectedGeometry:!0})}))})):d.forEach(t,c.hitch(this,function(U,M){0<M&&d.forEach(U.rings,c.hitch(this,function(P){var V=new y(new A(r.geometry.spatialReference));V.addRing(P);K.push({geometry:V,isIntersectedGeometry:!0})}))}))):K.push({geometry:r.geometry,isIntersectedGeometry:!0})}else K.push({geometry:r.geometry,isIntersectedGeometry:!1});
return K},_checkAssetIntersection:function(){this._intersectedCostingGraphicArr=[];this._allIntersectedRegions=[];this._splitAssetInfo=[];this.selectedTemplateInfo={};this._getIntersectedCostingGraphicArr(this._orgFeature).then(c.hitch(this,function(r){var t;if(t=l.simplify(this._orgFeature.geometry))this._orgFeature.geometry=t,this._allIntersectedRegions=c.clone(r),this._intersectedCostingGraphicArr=r,this.config.projectSettings.costingGeometryLayer?"point"===this._orgFeature.geometry.type?this._splitAssetsArr.push({geometry:this._orgFeature.geometry,
isIntersectedGeometry:0<r.length}):this._splitAssetsArr=this._getSplitFeatureGeometries(this._orgFeature,this._intersectedCostingGraphicArr):this._splitAssetsArr.push({geometry:this._orgFeature.geometry,isIntersectedGeometry:0<r.length}),this._processOverlappingGeometries()}))},_getIntersectedCostingGraphicArr:function(r){var t=new w;if(this.config.projectSettings.costingGeometryLayer){var x=new v;var F=this.map.getLayer(this.config.projectSettings.costingGeometryLayer);var K=new b(F.url);F.getDefinitionExpression()&&
(x.where=F.getDefinitionExpression());r.geometry?(x.outSpatialReference=r.geometry.spatialReference,x.returnGeometry=!0,x.outFields=["*"],x.geometry=r.geometry,K.execute(x,c.hitch(this,function(R){var U=[];R&&0<R.features.length&&(U=R.features);t.resolve(U)}),c.hitch(this,function(){t.resolve([])}))):setTimeout(c.hitch(this,function(){t.resolve([])}),0)}else t.resolve([]);return t.promise},_processOverlappingGeometries:function(){var r=[],t=[],x=[],F=[];0<this._splitAssetsArr.length&&(d.forEach(this._splitAssetsArr,
c.hitch(this,function(K){K.isIntersectedGeometry?(K=this._splitForOverlappingGeometries(K),0<K.processed.length&&(r=r.concat(K.processed)),0<K.unProcessed.length&&(t=t.concat(K.unProcessed))):r.push(K)})),this._splitAssetsArr=[],this._splitAssetsArr=r);d.forEach(t,c.hitch(this,function(K){K=this._splitForOverlappingGeometries(K,!0);0<K.processed.length&&(x=x.concat(K.processed));0<K.unProcessed.length&&(F=F.concat(K.unProcessed))}));this._splitAssetsArr=this._splitAssetsArr.concat(x);this._deleteDuplicateSplits();
this._displayPopupForAssets()},_deleteDuplicateSplits:function(){var r=[];d.forEach(this._splitAssetsArr,c.hitch(this,function(t,x){if(0>r.indexOf(x))for(x+=1;x<this._splitAssetsArr.length;x++)l.equals(t.geometry,this._splitAssetsArr[x].geometry)&&r.push(x)}));0<r.length&&(r.sort(function(t,x){return t-x}),d.forEach(r,c.hitch(this,function(t,x){this._splitAssetsArr.splice(t-x,1)})))},isLineValid:function(r){return r.paths&&1===r.paths.length&&2===r.paths[0].length&&r.paths[0][0][0]===r.paths[0][1][0]&&
r.paths[0][0][1]===r.paths[0][1][1]?!1:!0},_splitForOverlappingGeometries:function(r,t){var x=[],F=[],K=[],R=!1;d.forEach(this._allIntersectedRegions,c.hitch(this,function(P){l.intersects(r.geometry,P.geometry)&&K.push(P)}));d.forEach(K,c.hitch(this,function(P){l.contains(P.geometry,r.geometry)&&(R=!0)}));if(R)x.push(r);else{var U=r.geometry,M=K.length;d.forEach(K,c.hitch(this,function(P,V){P=this._polygonToPolyline(P.geometry)[0];P=l.cut(U,P);if(1<P.length)for(U=P[0],V=1;V<P.length;V++)1===V&&this.isLineValid(P[V])?
x.push({geometry:P[V],isIntersectedGeometry:!0}):F.push({geometry:P[V],isIntersectedGeometry:!0});else 0<P.length?this.isLineValid(P[0])&&x.push({geometry:P[0],isIntersectedGeometry:!0}):t?this.isLineValid(U)&&x.push({geometry:U,isIntersectedGeometry:!0}):V===M-1&&F.push({geometry:U,isIntersectedGeometry:!0})}))}return{processed:x,unProcessed:F}},_displayPopupForAssets:function(){this.map.getLayer(this.config.projectSettings.costingGeometryLayer);if(0<this._splitAssetsArr.length){var r=this._splitAssetsArr.pop(0);
this._currentAssetSplitGeometry=r.geometry;this._intersectedCostingGraphicArr=[];var t=!1;r.isIntersectedGeometry&&d.forEach(this._allIntersectedRegions,c.hitch(this,function(F){l.contains(F.geometry,r.geometry)&&(this._intersectedCostingGraphicArr.push(F),t=!0)}));if(1<this._intersectedCostingGraphicArr.length){var x=this._intersectedCostingGraphicArr[0];this._intersectedCostingGraphicArr=[];this._intersectedCostingGraphicArr.push(x)}t?(this._isFeatureIntersected=t,this._displayPopupForRegion()):
this._initializeScenarioSelection(this.nls.scenarioSelection.noneText,t,null)}else 0<this._splitAssetInfo.length&&this._createAndAddFeatures(this._splitAssetInfo)},_createAndAddFeatures:function(r){var t=[],x;if(this._selectedTemplate){var F=c.clone(this._selectedTemplate.template.prototype.attributes);if(this._editor.attributeInspector&&this._editor.attributeInspector._currentFeature)for(x in F)d.forEach(this._selectedTemplate.featureLayer.fields,c.hitch(this,function(K){if(K.name===x&&!K.nullable&&
(null===F[x]||void 0===F[x]||""===F[x]))return F[x]=this._editor.attributeInspector._currentFeature.attributes[x],!0}));d.forEach(r,c.hitch(this,function(K,R){t.push(new D(K.ASSETGEOMETRY,null,c.clone(F)));this.selectedProjectFeatureAttr&&this._updateFeatureAttributes(t[R])}));this._selectedTemplate.featureLayer.myApplyEdits(t,null,null)}},_updateFeatureAttributes:function(r){var t,x,F,K;d.some(this.config.layerSettings,c.hitch(this,function(M){M.attributeSetting&&M.id===this._selectedTemplate.featureLayer.id&&
(t=M.attributeSetting)}));if(t){var R=this.map.getLayer(this._selectedTemplate.featureLayer.id);var U=this.map.getLayer(this.config.projectSettings.projectLayer);d.forEach(t,c.hitch(this,function(M){x=R.getField(M.layerField).length;F=U.getField(M.projectField).length;K=this.selectedProjectFeatureAttr[M.projectField];x<F&&K&&0<K.length&&(K=K.slice(0,x));r.attributes[M.layerField]=K}))}},_displayPopupForRegion:function(){var r=this.map.getLayer(this.config.projectSettings.costingGeometryLayer);if(0<
this._intersectedCostingGraphicArr.length){var t=this._intersectedCostingGraphicArr.pop(0);var x=t.attributes[this.config.projectSettings.geographyField];t=t.attributes[r.globalIdField];this._initializeScenarioSelection(x,this._isFeatureIntersected,t)}else this._displayPopupForAssets()},_destroyScenarioSelection:function(){this._scenarioSelectionObj&&this._scenarioSelectionObj.destroy();this._selectScenarioPopup&&this._selectScenarioPopup.destroy()},_initializeScenarioSelection:function(r,t,x){var F;
var K=this._selectedTemplate.featureLayer.id;var R=this._selectedTemplate.template.name;this._destroyScenarioSelection();var U=[];var M=[];d.forEach(this.config.costingInfoSettings[K],c.hitch(this,function(P){if(P.geography===r&&P.featureTemplate===R){if(""===P.scenario||null===P.scenario||void 0===P.scenario)P=c.clone(P),P.scenario=this.nls.scenarioSelection.noneText;U.push(P)}else if(P.featureTemplate===R&&(""===P.geography||null===P.geography||void 0===P.geography)){if(""===P.scenario||null===
P.scenario||void 0===P.scenario)F=P.costEquation,P=c.clone(P),P.scenario=this.nls.scenarioSelection.noneText,P.geography=this.nls.scenarioSelection.noneText;M.push(P)}}));1===U.length?(this._configuredGeographyCostEquation[x]&&this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id]&&this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id][R]?(this.selectedTemplateInfo=this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id][R],
this.selectedTemplateInfo.ASSETGEOMETRY=this._currentAssetSplitGeometry):(this.selectedTemplateInfo={},this.selectedTemplateInfo.TEMPLATENAME=R,this.selectedTemplateInfo.COSTEQUATION=U[0].costEquation,this.selectedTemplateInfo.GEOGRAPHY=r,this.selectedTemplateInfo.SCENARIO=U[0].scenario,this.selectedTemplateInfo.GEOGRAPHYGUID=x,this.selectedTemplateInfo.ASSETGEOMETRY=this._currentAssetSplitGeometry,this._configuredGeographyCostEquation.hasOwnProperty(this.selectedTemplateInfo.GEOGRAPHYGUID)||(this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID]=
{}),this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID].hasOwnProperty(this._selectedTemplate.featureLayer.id)||(this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID][this._selectedTemplate.featureLayer.id]={}),this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID][this._selectedTemplate.featureLayer.id][this.selectedTemplateInfo.TEMPLATENAME]=this.selectedTemplateInfo),this._splitAssetInfo.push(c.clone(this.selectedTemplateInfo)),
this._displayPopupForRegion()):1!==M.length||0!==U.length||t?1<M.length&&0===U.length&&!t?this._configuredGeographyCostEquation[x]&&this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id]&&this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id][R]?(this.selectedTemplateInfo=this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id][R],this.selectedTemplateInfo.ASSETGEOMETRY=this._currentAssetSplitGeometry,this._splitAssetInfo.push(c.clone(this.selectedTemplateInfo)),
this._displayPopupForRegion()):(this._scenarioSelectionObj=new C({regionName:r,scenarioOptions:M,nls:this.nls,templateName:R,geographyGlobalID:x,costingGeometryLayer:this.config.projectSettings.costingGeometryLayer}),this._displaySelectScenarioPopup(r)):0===U.length?(this._configuredGeographyCostEquation[x]&&this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id]&&this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id][R]?(this.selectedTemplateInfo=
this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id][R],this.selectedTemplateInfo.ASSETGEOMETRY=this._currentAssetSplitGeometry):(this.selectedTemplateInfo={},this.selectedTemplateInfo.TEMPLATENAME=R,this.selectedTemplateInfo.COSTEQUATION=F,this.selectedTemplateInfo.GEOGRAPHY=r,this.selectedTemplateInfo.SCENARIO=this.nls.scenarioSelection.noneText,this.selectedTemplateInfo.GEOGRAPHYGUID=x,this.selectedTemplateInfo.ASSETGEOMETRY=this._currentAssetSplitGeometry,this._configuredGeographyCostEquation.hasOwnProperty(this.selectedTemplateInfo.GEOGRAPHYGUID)||
(this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID]={}),this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID].hasOwnProperty(this._selectedTemplate.featureLayer.id)||(this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID][this._selectedTemplate.featureLayer.id]={}),this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID][this._selectedTemplate.featureLayer.id][this.selectedTemplateInfo.TEMPLATENAME]=
this.selectedTemplateInfo),this._splitAssetInfo.push(c.clone(this.selectedTemplateInfo)),this._displayPopupForRegion()):1<U.length&&(this._configuredGeographyCostEquation[x]&&this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id]&&this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id][R]?(this.selectedTemplateInfo=this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id][R],this.selectedTemplateInfo.ASSETGEOMETRY=this._currentAssetSplitGeometry,
this._splitAssetInfo.push(c.clone(this.selectedTemplateInfo)),this._displayPopupForRegion()):(this._scenarioSelectionObj=new C({regionName:r,scenarioOptions:U,nls:this.nls,templateName:R,geographyGlobalID:x,costingGeometryLayer:this.config.projectSettings.costingGeometryLayer}),this._displaySelectScenarioPopup(r))):(this._configuredGeographyCostEquation[x]&&this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id]&&this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id][R]?
(this.selectedTemplateInfo=this._configuredGeographyCostEquation[x][this._selectedTemplate.featureLayer.id][R],this.selectedTemplateInfo.ASSETGEOMETRY=this._currentAssetSplitGeometry):(this.selectedTemplateInfo={},this.selectedTemplateInfo.TEMPLATENAME=R,this.selectedTemplateInfo.COSTEQUATION=M[0].costEquation,this.selectedTemplateInfo.GEOGRAPHY=r,this.selectedTemplateInfo.SCENARIO=this.nls.scenarioSelection.noneText,this.selectedTemplateInfo.GEOGRAPHYGUID=x,this.selectedTemplateInfo.ASSETGEOMETRY=
this._currentAssetSplitGeometry,this._configuredGeographyCostEquation.hasOwnProperty(this.selectedTemplateInfo.GEOGRAPHYGUID)||(this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID]={}),this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID].hasOwnProperty(this._selectedTemplate.featureLayer.id)||(this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID][this._selectedTemplate.featureLayer.id]={}),this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID][this._selectedTemplate.featureLayer.id][this.selectedTemplateInfo.TEMPLATENAME]=
this.selectedTemplateInfo),this._splitAssetInfo.push(c.clone(this.selectedTemplateInfo)),this._displayPopupForRegion())},_displaySelectScenarioPopup:function(){this._selectScenarioPopup=new n({titleLabel:this.nls.scenarioSelection.popupTitle,autoHeight:!0,content:this._scenarioSelectionObj,width:400,buttons:[{label:this.nls.common.ok,key:m.ENTER,onClick:c.hitch(this,"_onScenarioSelectionOk")},{label:this.nls.common.cancel,key:m.ESCAPE,onClick:c.hitch(this,"_onScenarioSelectionCancel")}]});T.set(this._scenarioSelectionObj.scenarioDropDown,
"aria-label",this.nls.scenarioSelection.scenarioLabel);T.set(this._scenarioSelectionObj.regionNameTextBox,"aria-label",this.nls.scenarioSelection.regionLabel);this._scenarioSelectionObj.startup();var r=this._selectScenarioPopup.enabledButtons;this.own(a(r[0],"keydown",c.hitch(this,function(t){if(t.keyCode===m.ENTER||t.keyCode===m.SPACE)p.stop(t),N.focus(this.selectButton)})));this.own(a(r[1],"keydown",c.hitch(this,function(t){if(t.keyCode===m.ENTER||t.keyCode===m.SPACE)p.stop(t),N.focus(this.selectButton)})))},
_onScenarioSelectionOk:function(){this.selectedTemplateInfo={};var r=this._scenarioSelectionObj.scenarioDropDown._getSelectedOptionsAttr();this.selectedTemplateInfo.TEMPLATENAME=r.item.featureTemplate;this.selectedTemplateInfo.COSTEQUATION=r.item.costEquation;this.selectedTemplateInfo.GEOGRAPHY=this._scenarioSelectionObj.regionNameTextBox.getValue();this.selectedTemplateInfo.SCENARIO=r.label;this.selectedTemplateInfo.GEOGRAPHYGUID=r.item.geographyGlobalID;this.selectedTemplateInfo.ASSETGEOMETRY=this._currentAssetSplitGeometry;
this._configuredGeographyCostEquation.hasOwnProperty(this.selectedTemplateInfo.GEOGRAPHYGUID)||(this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID]={});this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID].hasOwnProperty(this._selectedTemplate.featureLayer.id)||(this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID][this._selectedTemplate.featureLayer.id]={});this._configuredGeographyCostEquation[this.selectedTemplateInfo.GEOGRAPHYGUID][this._selectedTemplate.featureLayer.id][this.selectedTemplateInfo.TEMPLATENAME]=
this.selectedTemplateInfo;this._selectScenarioPopup.close();this._splitAssetInfo.push(c.clone(this.selectedTemplateInfo));this._displayPopupForRegion()},_onScenarioSelectionCancel:function(){this._selectScenarioPopup.close()},resize:function(){if(this.domNode){var r=f.getMarginBox(this.domNode);r=r.w;0<r&&this._editor&&this._editor.templatePicker&&this._editor.templatePicker.update(!0)}},_getSelectedFeatures:function(r){var t=[];d.forEach(r,c.hitch(this,function(x){(x=x.getSelectedFeatures())&&0<
x.length&&d.forEach(x,c.hitch(this,function(F){t.push(F)}))}));return t},_createCustomSelectTool:function(){var r;this.customToolbar=new B(this.map,{tooltipOffset:10,drawTime:90});this._toolBarActive=!1;this.own(a(this.customToolbar,"draw-complete",c.hitch(this,function(t){var x=new v;x.geometry=t.geometry;var F=this._getOtherLayersFromMap();this._editor._selectionHelper.selectFeatures(F,x,h.SELECTION_NEW,c.hitch(this,function(){var K=this._getSelectedFeatures(F);0<K.length?(this.customToolbar.deactivate(),
this._toolBarActive=!1,this._copyFeaturesObj||this._createCopyFeaturesInstance(),this._copyFeaturesObj.selectFeaturesToCopy(K)):r=this.appUtils.showMessage(this.nls.copyFeatures.noFeaturesSelectedMessage)}));r&&r.enabledButtons&&this.own(a(r.enabledButtons[0],"keydown",c.hitch(this,function(K){if(K.keyCode===m.ENTER||K.keyCode===m.SPACE)p.stop(K),N.focus(this.selectButton)})))})))},_createCopyFeaturesInstance:function(){this._copyFeaturesObj=new H({nls:this.nls,layerInfosObj:this.layerInfosObj,mainNode:this.selectFeaturesNode,
appUtils:this.appUtils,map:this.map,widgetId:this.widgetId,widgetDomNode:this.widgetDomNode},e.create("div",{},this.selectFeaturesNode));this.own(a(this._copyFeaturesObj,"createSingleFeature",c.hitch(this,function(r){if(r=this._createSingleGeometry(r))this._featuresToBeCopied=[r],this._displayCopyAssetsPopup()})));this.own(a(this._copyFeaturesObj,"createMultipleFeatures",c.hitch(this,function(r){r&&0<r.length&&(this._featuresToBeCopied=r,this._displayCopyAssetsPopup())})));this.own(a(this._copyFeaturesObj,
"cancelBtnClicked",c.hitch(this,function(){var r=this.refreshButton,t=this.featureModeTextNode;this._activateCustomSelectTool();"none"===this.downloadCSVBtn.style.display||q.contains(this.downloadCSVBtn,"esriCTHidden")||(r=this.downloadCSVBtn);q.contains(this.projectNameDiv,"esriCTHidden")||(t=this.projectNameDiv);this.appUtils.setFirstAndLastWBFocusNode(this.widgetDomNode,t,r);N.focus(this.projectNameDiv)})));this._copyFeaturesObj.startup()},_createSingleGeometry:function(r){var t;var x=r[0]._layer.geometryType;
"esriGeometryPolyline"===x?t=this._createSinglePolyline(r):"esriGeometryPolygon"===x&&(t=this._createSinglePolygon(r));return t},_createSinglePolyline:function(r){var t=new L(new A(r[0].geometry.spatialReference));d.forEach(r,c.hitch(this,function(x){x.geometry&&x.geometry.paths&&d.forEach(x.geometry.paths,function(F){t.addPath(F)})}));return t},_createSinglePolygon:function(r){var t=new y(new A(r[0].geometry.spatialReference));d.forEach(r,c.hitch(this,function(x){x.geometry&&x.geometry.rings&&d.forEach(x.geometry.rings,
function(F){t.addRing(F)})}));return t},_toggleToolState:function(){q.contains(this.selectButton,"esriCTSelectDisable")?this._activateTemplatePickerTool():this._toolBarActive?this._activateTemplatePickerTool():this._activateCustomSelectTool()},_activateCustomSelectTool:function(){var r=this._editor.templatePicker.getSelected();this._editor._drawToolbar.deactivate();r?this.customToolbar.activate(B.EXTENT):this.customToolbar.deactivate()},_activateTemplatePickerTool:function(){var r=this._editor.templatePicker.getSelected();
this.customToolbar.deactivate();r&&this._editor._activateDrawToolbar(this._selectedTemplate)},_activateSketchButton:function(){q.add(this.sketchButton,"esriCTSketchEnable");q.remove(this.sketchButton,"esriCTSketchDisable")},_deActivateSketchButton:function(){q.add(this.sketchButton,"esriCTSketchDisable");q.remove(this.sketchButton,"esriCTSketchEnable")},_activateSelectButton:function(){q.add(this.selectButton,"esriCTSelectEnable");q.remove(this.selectButton,"esriCTSelectDisable")},_deActivateSelectButton:function(){q.add(this.selectButton,
"esriCTSelectDisable");q.remove(this.selectButton,"esriCTSelectEnable")},_deactivateAllTools:function(){this.customToolbar.deactivate();this._editor&&this._editor._drawToolbar&&this._editor._drawToolbar.deactivate()},_getOtherLayersFromMap:function(){var r=[];var t=this.layerInfosObj.getLayerInfoArray();d.forEach(t,c.hitch(this,function(x){var F=this.map.getLayer(x.id);if("Feature Layer"===F.type){var K=!1;d.forEach(this._editor._settings.layers,c.hitch(this,function(R){R.id===F.id&&(K=!0)}));K&&
-1<this._nonEditableLayers.indexOf(F.id)&&(K=!1);K||this._selectedTemplate.featureLayer.geometryType===F.geometryType&&F.id!==this.config.projectSettings.costingGeometryLayer&&F.id!==this.config.projectSettings.projectLayer&&r.push(F)}}));return r}})})},"esri/dijit/editing/Editor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/kernel dojo/has dojo/query dojo/DeferredList dojo/dom-class dojo/dom-construct dojo/string dijit/_Widget dijit/_Templated ../../domUtils ../../graphicsUtils ../../geometry/Polyline ../../geometry/Polygon ../../graphic ../../undoManager ../../tasks/query ../../layers/FeatureLayer ../../layers/FeatureTemplate ../../toolbars/draw ../../toolbars/edit ../AttributeInspector ./Util ./Add ./Update ./Delete ./Cut ./Union ./toolbars/Drawing ./SelectionHelper ./TemplatePicker ../../kernel ../../config dojo/i18n!../../nls/jsapi dojo/text!./templates/Editor.html dijit/ProgressBar dojo/NodeList-dom".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v,b,D,h,B,H,T,N,p,E,r,t,x,F,K,R){var U=Q([k,z],{declaredClass:"esri.dijit.editing.Editor",widgetsInTemplate:!0,templateString:R,onLoad:function(){},constructor:function(M,P){M=M||{};M.settings||console.error("Editor: please provide 'settings' parameter in the constructor");M.settings.layerInfos||console.error("Editor: please provide 'layerInfos' parameter in the constructor");this._settings=M.settings;this._eConnects=[]},startup:function(){this.inherited(arguments);
this._setDefaultOptions();this._settings.map.setInfoWindowOnClick(!1);var M=this._settings.layerInfos;this.featureReductionEnabledLayers=[];J.forEach(M,function(V){V=V.featureLayer;V.isFeatureReductionEnabled()&&(V.disableFeatureReduction(),this.featureReductionEnabledLayers.push(V))},this);if(J.every(M,function(V){return V.featureLayer.loaded}))this._initLayers(),this._connectEvents(),this._createWidgets(),this.onLoad(),this.loaded=!0;else{var P=M.length;J.forEach(M,function(V){V=V.featureLayer;
if(V.loaded)P--;else var O=G.connect(V,"onLoad",this,function(S){G.disconnect(O);O=null;P--;P||(this._initLayers(),this._connectEvents(),this._createWidgets(),this.onLoad(),this.loaded=!0)})},this)}this._reset();this._enableMapClickHandler()},stopEditing:function(M){this._updateCurrentFeature(I.hitch(this,function(){this._clearSelection(!1);M&&M()}))},destroy:function(){this._settings.map.setInfoWindowOnClick(!0);this.drawingToolbar&&this.drawingToolbar.destroy();this.attributeInspector&&this.attributeInspector.destroy();
this.templatePicker&&this.templatePicker.destroy();this._selectionHelper&&this._selectionHelper.destroy();this._drawToolbar&&this._drawToolbar.deactivate();this._reset();this._disableMapClickHandler();J.forEach(this._eConnects,G.disconnect);G.disconnect(this._dtConnect);G.disconnect(this._templatePickerOnSelectionChangeEvent);this._layer=this._currentGraphic=this._activeType=this._activeTemplate=this._drawingTool=this._drawToolbar=this.editToolbar=this.drawingToolbar=this.attributeInspector=this.templatePicker=
this.undoManager=null;this._settings.map.infoWindow&&this._settings.map.infoWindow.clearFeatures&&this._settings.map.infoWindow.clearFeatures();J.forEach(this.featureReductionEnabledLayers,function(M){M.enableFeatureReduction()});this.inherited(arguments)},_setDefaultOptions:function(){this._drawToolbar=this._settings.drawToolbar||new v(this._settings.map);this._settings.drawToolbar=this._drawToolbar;this.editToolbar=this._settings.editToolbar||new b(this._settings.map,{textSymbolEditorHolder:this.domNode});
this._settings.editToolbar=this.editToolbar;this._settings.toolbarVisible=this._settings.toolbarVisible||!1;this._settings.toolbarOptions=I.mixin({reshapeVisible:!1,cutVisible:!1,mergeVisible:!1},this._settings.toolbarOptions);this._settings.createOptions=I.mixin({polylineDrawTools:[U.CREATE_TOOL_POLYLINE],polygonDrawTools:[U.CREATE_TOOL_POLYGON],editAttributesImmediately:!0},this._settings.createOptions);this._settings.singleSelectionTolerance=this._settings.singleSelectionTolerance||3;this._settings.maxUndoRedoOperations=
this._settings.maxUndoRedoOperations||10;this._settings.editor=this;this._usePopup=this._settings.usePopup=this._settings.map.infoWindow._setPagerCallbacks?!0:!1;this._datePackage=this._settings.datePackage;var M=F.defaults;this._settings.geometryService=this._settings.geometryService||M.geometryService;M.geometryService=M.geometryService||this._settings.geometryService},_initLayers:function(){this._settings.layers=[];this._settings.userIds={};this._settings.createOnlyLayer={};J.forEach(this._settings.layerInfos,
function(M){if(M.featureLayer&&M.featureLayer.loaded){this._settings.layers.push(M.featureLayer);var P=M.featureLayer.id;M.featureLayer.credential&&(this._settings.userIds[P]=M.featureLayer.credential.userId);M.userId&&(this._settings.userIds[P]=M.userId);var V=M.featureLayer.getEditCapabilities();this._settings.createOnlyLayer[P]=V.canCreate&&!V.canUpdate?!0:!1;this._isTextSymbolPointLayer(M.featureLayer)&&(M.disableAttributeUpdate=!0)}},this)},_reset:function(){this._hideAttributeInspector();this.editToolbar.deactivate();
this._editVertices=!0;this._drawingTool=this._activeTemplate=this._activeType=this._currentGraphic=this._layer=null;this._attributeChanged=!1},_saveFeatureOnClient:function(M){var P=this.templatePicker.getSelected();var V=P.template?P.featureLayer.renderer.getSymbol(P.template.prototype):P.symbolInfo.symbol;this._tempGraphic=new l(M,V,null,null);this._tempGraphic.setAttributes(I.mixin({},P.template.prototype.attributes));V=this._settings.map;V.graphics.add(this._tempGraphic);M=this._findCenterPoint(M);
this._createAttributeInspector();V.infoWindow.setTitle(P.featureLayer?P.featureLayer.name:K.widgets.attributeInspector.NLS_title);this.attributeInspector.showFeature(this._tempGraphic,P.featureLayer);this._showInfoWindow(M,V.getInfoWindowAnchor(M));if(this._settings.createOnlyLayer[P.featureLayer.id]||this._settings.invalidTemplate)this._infoWindowHideEvent=G.connect(V.infoWindow,"onHide",this,"_infoWindowHide");G.disconnect(this._templatePickerOnSelectionChangeEvent);this.templatePicker.clearSelection();
this._drawToolbar.deactivate();this._enableMapClickHandler();this.drawingToolbar&&this.drawingToolbar.deactivate();this._templatePickerOnSelectionChangeEvent=G.connect(this.templatePicker,"onSelectionChange",I.hitch(this,"_onCreateFeature"))},_saveAttributesOnClient:function(M,P,V){this._tempGraphic.attributes[P]="number"===typeof V&&isNaN(V)?null:V},_infoWindowHide:function(){this._createFeature(this._tempGraphic.geometry,this._tempGraphic.attributes);G.disconnect(this._infoWindowHideEvent)},_createFeature:function(M,
P){this._editClickPoint=this._findCenterPoint(M);M.rings?this._simplify(M,I.hitch(this,function(V){this._drawingTool!==y.TOOL_AUTO_COMPLETE_POLYGON?this._applyEdits([{layer:this._layer,adds:[this._createGraphic(V,P)]}],I.hitch(this,function(){this._chainAttachment(this._oEdits[0].adds[0].attributes[this._oEdits[0].layer.objectIdField],this._oEdits[0].layer)})):this._autoComplete(V,I.hitch(this,function(O){O&&O.length&&this._applyEdits([{layer:this._layer,adds:J.map(O,I.hitch(this,function(S){return this._createGraphic(S,
P)}))}],function(){this._chainAttachment(this._oEdits[0].adds[0].attributes[this._oEdits[0].layer.objectIdField],this._oEdits[0].layer)})}))})):this._applyEdits([{layer:this._layer,adds:[this._createGraphic(M,P)]}],I.hitch(this,function(){this._chainAttachment(this._oEdits[0].adds[0].attributes[this._oEdits[0].layer.objectIdField],this._oEdits[0].layer);this._layer&&this._layer.renderer&&"heatmap"===this._layer.renderer.type&&this._layer.refresh()}))},_chainAttachment:function(M,P){this.attributeInspector&&
this.attributeInspector._attachmentEditor&&this.attributeInspector._attachmentEditor._tempUpload&&this.attributeInspector._attachmentEditor._chainAttachment(M,P)},_updateCurrentFeature:function(M){var P=this._isModified();P?this._updateFeature(P,M):M&&M(!1)},_updateFeature:function(M,P,V){var O=M.geometry,S=M.getLayer();S.hasZ&&!S.enableZDefaults||S.hasM&&!S.allowUpdateWithoutMValues||V&&!this._isModified()?(V=new l,V.setAttributes(M.attributes),this._applyEdits([{layer:M.getLayer(),updates:[V]}],
P)):O.rings?this._simplify(O,I.hitch(this,function(W){this._applyEdits([{layer:M.getLayer(),updates:[I.mixin(M,{geometry:W})]}],P)})):this._applyEdits([{layer:M.getLayer(),updates:[M]}],P)},_deleteFeature:function(M,P){if(this._settings.invalidTemplate&&M===this._tempGraphic)this._settings.map.graphics.remove(this._tempGraphic),this._hideAttributeInspector();else{var V=[];M?V.push({layer:M.getLayer(),deletes:[M]}):(V=J.map(J.filter(this._settings.layers,function(O){return 0<O.getSelectedFeatures().length}),
function(O){return{layer:O,deletes:O.getSelectedFeatures()}}))&&V.length||!this._currentGraphic||V.push({layer:this._layer,deletes:[this._currentGraphic]});this._applyEdits(V,P)}},_stopEditing:function(M,P,V,O){f.hide(this.progressBar.domNode);this._settings.createOnlyLayer[M.id]||this._undoRedoAdd();if(!0===M._isSelOnly||1===M.mode||6===M.mode){if(P&&P.length){this.templatePicker.clearSelection();var S=new A;S.objectIds=[P[0].objectId];this._settings.createOnlyLayer[M.id]||this._settings.invalidTemplate?
this._settings.map.graphics.remove(this._tempGraphic):this._selectFeatures([M],S,I.hitch(this,"_onEditFeature"))}}else(S=this._selectionHelper.findMapService(this._settings.map,M))&&S.refresh(),P&&P.length&&(this.templatePicker.clearSelection(),this._settings.createOnlyLayer[M.id]||this._settings.invalidTemplate?this._settings.map.graphics.remove(this._tempGraphic):h.findFeatures(P,M,I.hitch(this,"_onEditFeature")));O&&O.length&&(this._clearSelection(!0),this._undoRedo&&(S=this._selectionHelper.findMapService(M,
this._settings.map))&&S.refresh());this._undoRedo&&V&&V.length&&((S=this._selectionHelper.findMapService(M,this._settings.map))&&S.refresh(),this.attributeInspector.refresh(),this._undoRedo=!1);this.drawingToolbar&&this.drawingToolbar._updateUI();this._undoRedo=!1;this._settings.invalidTemplate=!1},_undoRedoAdd:function(){this._settings._isApplyEditsCall=!1;if(this._settings.undoManager){var M=this._edits&&this._edits.length?this._edits[0]:null;if(M){var P=M.adds||[],V=M.updates||[],O=M.deletes||
[],S=M.preUpdates||[];M={featureLayer:M.layer};"CUT"===this._activeTool?P.length&&V.length&&S.length&&this.undoManager.add(new N(I.mixin(M,{preUpdatedGraphics:S,addedGraphics:P,postUpdatedGraphics:V}))):"UNION"===this._activeTool?O.length&&V.length&&S.length&&this.undoManager.add(new p(I.mixin(M,{preUpdatedGraphics:S,deletedGraphics:O,postUpdatedGraphics:V}))):P.length?this.undoManager.add(new B(I.mixin(M,{addedGraphics:P}))):O.length?this.undoManager.add(new T(I.mixin(M,{deletedGraphics:O}))):V.length&&
(this._rollbackGraphic||S.length)&&this.undoManager.add(new H(I.mixin(M,{preUpdatedGraphics:S.length?S:[this._rollbackGraphic],postUpdatedGraphics:V})));this._rollbackGraphic=this._edits=null}}},_activateDrawToolbar:function(M){this._layer=M.featureLayer;this._activeType=M.type;this._drawingTool=(this._activeTemplate=M.template)?this._activeTemplate.drawingTool:null;this._drawTool=this._toDrawTool(this._drawingTool,M.featureLayer);G.disconnect(this._dtConnect);var P=this._layer.fields;this._settings.invalidTemplate=
!1;if(this._activeTemplate&&this._activeTemplate.prototype){var V=I.mixin({},this._activeTemplate.prototype.attributes);P=P.filter(function(O){return!1===O.nullable&&!0===O.editable});this._settings.invalidTemplate=P.some(function(O){O=V[O.name];return null===O||void 0===O})}this._dtConnect=this._settings.createOnlyLayer[M.featureLayer.id]||this._settings.invalidTemplate?G.connect(this._drawToolbar,"onDrawEnd",this,"_saveFeatureOnClient"):G.connect(this._drawToolbar,"onDrawEnd",this,"_createFeature");
this.editToolbar.deactivate();this._disableMapClickHandler();this.drawingToolbar?this.drawingToolbar.activateEditing(this._drawTool,this._layer):this._drawToolbar.activate(this._drawTool)},_activateEditToolbar:function(M,P){var V=M.getLayer(),O=V?V.geometryType:null,S=this._isTextSymbolPoint(M),W=b.MOVE;"esriGeometryPoint"!==O&&!0===this._isNotesFeature(M)?(W=W|b.ROTATE|b.SCALE,this._editVertices=!1):"esriGeometryPoint"!==O&&!0===this._editVertices?(W=W|b.ROTATE|b.SCALE,this._editVertices=!1):S?(W=
W|b.ROTATE|b.SCALE|b.EDIT_TEXT,this._editVertices=!1):(W|=b.EDIT_VERTICES,this._editVertices=!0);this._attributeChanged=this._isModified();this._rollbackGraphic=new l(M.toJson());O=V.getEditCapabilities({feature:M,userId:this._settings.userIds[V.id]});var X=J.filter(this._settings.layerInfos,function(Y){return Y.featureLayer.layerId===V.layerId})[0];O.canUpdate&&!X.disableGeometryUpdate&&O.canUpdateGeometry&&(this.editToolbar.activate(W,M),S&&(this.editToolbar._textEditor._addTextBox(M),this.editToolbar._textSymbolEditor&&
this.editToolbar._textSymbolEditor.hide()));this._settings.map.infoWindow.isShowing||this._updateAttributeDisabled(M)||(M=P&&P.screenPoint||this._findCenterPoint(M),this._showInfoWindow(M,this._settings.map.getInfoWindowAnchor(M)))},_createGraphic:function(M,P){var V=new l(M,this._activeType&&this._activeType.symbol||this._layer.defaultSymbol,P);this._activeTemplate||P?V.attributes=P||I.mixin({},this._activeTemplate.prototype.attributes):(V.attributes=V.attributes||[],J.forEach(this._layer.fields,
function(O){V.attributes[O.name]=null},this));return V},_connectEvents:function(){var M=this._settings.layers;J.forEach(M,function(P){this._connect(P,"onEditsComplete",I.hitch(this,"_stopEditing",P))},this);J.forEach(M,function(P){this._connect(P,"onBeforeApplyEdits",I.hitch(this,function(){f.show(this.progressBar.domNode);this._settings._isApplyEditsCall=!0}))},this);this._connect(this.editToolbar,"onGraphicClick",I.hitch(this,"_activateEditToolbar"));this._connect(this.editToolbar,"onGraphicFirstMove",
I.hitch(this,"_hideAttributeInspector"));this._connect(this.editToolbar,"onVertexFirstMove",I.hitch(this,"_hideAttributeInspector"));this._connect(this.editToolbar,"onScaleStart",I.hitch(this,"_hideAttributeInspector"));this._connect(this.editToolbar,"onRotateStart",I.hitch(this,"_hideAttributeInspector"))},_connect:function(M,P,V){this._eConnects.push(G.connect(M,P,V))},_createWidgets:function(){this._selectionHelper=new r(this._settings);this._createTemplatePicker();this._createAttributeInspector();
this._createDrawingToolbar();this._createUndoRedoManager()},_createTemplatePicker:function(){if(this._settings.templatePicker)this.templatePicker=this._settings.templatePicker,f.hide(this.templatePickerDiv);else{var M=J.filter(this._settings.layers,function(P){return P.getEditCapabilities().canCreate});this.templatePicker=new t({"class":"esriTemplatePicker",featureLayers:M,showTooltip:!0,maxLabelLength:this._settings.typesCharacterLimit,columns:"auto",rows:"auto"},this.templatePickerDiv);this.templatePicker.startup();
this._settings.templatePicker=this.templatePicker}this._templatePickerOnSelectionChangeEvent=G.connect(this.templatePicker,"onSelectionChange",I.hitch(this,"_onCreateFeature"))},_createAttributeInspector:function(){var M=this._settings.map;this._settings.attributeInspector?(this._customAttributeInspector=!0,this.attributeInspector=this._settings.attributeInspector):(this._customAttributeInspector=!1,this.attributeInspector=new D({layerInfos:this._settings.layerInfos,hideNavButtons:this._usePopup,
datePackage:this._datePackage},q.create("div")),this.attributeInspector.startup(),M.infoWindow.setContent(this.attributeInspector.domNode),M.infoWindow.setTitle(K.widgets.attributeInspector.NLS_title),M.infoWindow.resize(350,375),u.query(".esriAttributeInspector .atiLayerName").style({display:"none"}));this._connect(this.attributeInspector,"onDelete",I.hitch(this,"_deleteFeature"));this._connect(this.attributeInspector,"onNext",I.hitch(this,function(P){this._updateCurrentFeature(I.hitch(this,function(){this._attributeChanged=
!1;this._onEditFeature(P)}))}));this._usePopup&&M.infoWindow._setPagerCallbacks(this.attributeInspector,I.hitch(this.attributeInspector,"previous"),I.hitch(this.attributeInspector,"next"));this._connect(this.attributeInspector,"onAttributeChange",I.hitch(this,function(P,V,O){if(this._settings.createOnlyLayer[this._layer.id]||this._settings.invalidTemplate)this._saveAttributesOnClient(P,V,O);else{var S=P.getLayer();(S=J.filter(S.fields,function(W){return W.name===V})[0])&&""===O&&(O=null);this._rollbackGraphic=
new l(I.clone(P.toJson()));this.attributeInspector._rollbackInfo={field:S,graphic:this._rollbackGraphic};this._currentGraphic.attributes[V]="number"===typeof O&&isNaN(O)?null:O;this._currentGraphic.setAttributes(this._currentGraphic.attributes);this._updateFeature(this._currentGraphic,null,!0);this._attributeChanged=!1}}))},_createDrawingToolbar:function(){!0===this._settings.toolbarVisible&&(this.drawingToolbar=new E({"class":"esriDrawingToolbar",drawToolbar:this._drawToolbar,editToolbar:this.editToolbar,
settings:this._settings,onDelete:I.hitch(this,"_deleteFeature"),onApplyEdits:I.hitch(this,"_applyEdits"),onShowAttributeInspector:I.hitch(this,"_onEditFeature")},this.drawingToolbarDiv))},_createUndoRedoManager:function(){if(this._settings.enableUndoRedo||this._settings.undoManager)this._settings.enableUndoRedo=!0,this.undoManager=this._settings.undoManager,this.undoManager||(this.undoManager=this._settings.undoManager=new C({maxOperations:this._settings.maxUndoRedoOperations})),this._connect(this.undoManager,
"onUndoComplete",I.hitch(this,this._updateUndoRedoOperations)),this._connect(this.undoManager,"onRedoComplete",I.hitch(this,this._updateUndoRedoOperations)),this._connect(document,"onkeypress",I.hitch(this,function(M){if(M.metaKey||M.ctrlKey)"z"===M.charOrCode&&this._undo(),"y"===M.charOrCode&&this._redo()}))},_updateUndoRedoOperations:function(M){if(M&&M.addedIds){var P;for(P=0;P<this.undoManager.length;P++){var V=this.undoManager.get(P);V&&M.layer===V._featureLayer&&V.updateObjectIds(M.oldIds,M.addedIds)}}M&&
"Update Features"===M.operation.label&&this.attributeInspector.refresh()},_enableMapClickHandler:function(){this._mapClickHandler=G.connect(this._settings.map,"onClick",I.hitch(this,function(M){this._drawToolbar._geometryType||("SELECT"===this._activeTool?this._activeTool="":this._updateCurrentFeature(I.hitch(this,function(){this._reset();this._updateSelection(M)})))}))},_disableMapClickHandler:function(){G.disconnect(this._mapClickHandler)},_onCreateFeature:function(){var M=this.templatePicker.getSelected();
M?this._updateCurrentFeature(I.hitch(this,function(){this._currentGraphic&&this._clearSelection(!1);this._reset();this._activateDrawToolbar(M)})):(this._reset(),G.disconnect(this._dtConnect),this._drawToolbar.deactivate(),this._enableMapClickHandler(),this.drawingToolbar&&this.drawingToolbar.deactivate())},_isTextSymbolPoint:function(M){if("point"===M.geometry.type||"multipoint"===M.geometry.type){var P=M.getLayer(),V=P.renderer;M=M.symbol||P._getSymbol(M);!M&&(V.hasVisualVariables("sizeInfo",!1)||
V.hasVisualVariables("colorInfo",!1)||V.hasVisualVariables("opacityInfo",!1))&&V.addBreak&&V.infos&&1===V.infos.length&&(M=V.infos[0].symbol||V.defaultSymbol);if(M&&"textsymbol"===M.type)return!0}return!1},_isTextSymbolPointLayer:function(M){return"esriGeometryPoint"===M.geometryType&&M.renderer&&M.renderer._symbols&&M.renderer._symbols[0]&&M.renderer._symbols[0].symbol&&"textsymbol"===M.renderer._symbols[0].symbol.type?!0:!1},_updateAttributeDisabled:function(M){M=M.getLayer();if(!M)return!1;var P,
V=!1;for(P=0;P<this._settings.layerInfos.length;P++){var O=this._settings.layerInfos[P];if(O.featureLayer==M){V=O.disableAttributeUpdate;break}}return V},_onEditFeature:function(M,P){if(M=(I.isArray(M)?M[0]:M)||null){this._layer=M.getLayer();if(!this._customAttributeInspector&&!this._updateAttributeDisabled(M)){P=P||this._editClickPoint||this._findCenterPoint(M);if(1<this._currentFeatureCount){var V=this._popupFeatures.indexOf(M);V=e.substitute(K.widgets.popup.NLS_pagingInfo,{index:V+1,total:this._currentFeatureCount})}else V=
this._layer?this._layer.name:K.widgets.attributeInspector.NLS_title;this._settings.map.infoWindow.setTitle(V);if(this.drawingToolbar||!this._settings.map.infoWindow.isShowing)this.attributeInspector.refresh(),this._showInfoWindow(P,this._settings.map.getInfoWindowAnchor(P));this._editClickPoint=null}M!==this._currentGraphic&&(this._editVertices=!0,this._currentGraphic=M,M.getDojoShape()&&M.getDojoShape().moveToFront(),P=this._layer.hasM,this._layer.hasZ&&!this._layer.enableZDefaults||P&&!this._layer.allowUpdateWithoutMValues||
this._activateEditToolbar(M))}},_applyEdits:function(M,P){M=M||[];if(!(0>=M.length)){this._edits=this._oEdits=M;var V=[];J.forEach(M,function(O){O.layer&&V.push(O.layer.applyEdits(O.adds,O.updates,O.deletes))});0<V.length&&(this._deferredsList=(new a(V)).addCallback(I.hitch(this,function(){f.hide(this.progressBar.domNode);P&&P();var O=this._settings.map;O&&O.infoWindow.reposition&&O.infoWindow.isShowing&&O.infoWindow.reposition()})))}},_undo:function(){this._settings.undoManager&&!this._settings._isApplyEditsCall&&
(this.editToolbar.deactivate(),this._undoRedo=!0,this._settings.undoManager.undo())},_redo:function(){this._settings.undoManager&&!this._settings._isApplyEditsCall&&(this.editToolbar.deactivate(),this._undoRedo=!0,this._settings.undoManager.redo())},_simplify:function(M,P){m.prototype.isSelfIntersecting(M)?this._settings.geometryService.simplify([M],function(V){var O=V&&V.length?V[0]:O;P&&P(O)}):P&&P(M)},_autoComplete:function(M,P){var V=this._getLayers("esriGeometryPolygon"),O=new A;O.geometry=M;
O.returnGeometry=!0;this._selectFeatures(V,O,I.hitch(this,function(S){!S||0>=S.length?P&&P([M]):this._settings.geometryService.autoComplete(n.getGeometries(S),this._toPolylines([O.geometry]),function(W){P&&P(W)})}))},_getLayers:function(M){return J.filter(this._settings.layers,function(P){return P.geometryType===M})},_selectFeatures:function(M,P,V,O){this._selectionHelper.selectFeatures(M,P,O||L.SELECTION_NEW,V)},_updateSelection:function(M){var P=M.mapPoint,V=M.graphic,O=this._settings.layerInfos,
S;this._selectionHelper.selectFeaturesByGeometry(this._settings.layers,P,L.SELECTION_NEW,I.hitch(this,function(W){var X=J.some(W,I.hitch(this,function(ba){return ba==V}));if(V&&!X)if(X=V.getLayer(),this._isValidLayer(X)){var Y=new A;Y.objectIds=[V.attributes[X.objectIdField]];this._selectionHelper.selectFeatures([X],Y,L.SELECTION_ADD,I.hitch(this,function(ba){ba&&ba.length&&(ba=ba.concat(W),S=h.sortFeaturesById(O,ba),this._updatePopupButtons(S),this._onEditFeature(S,P))}))}else W&&W.length?(S=h.sortFeaturesById(O,
W),this._updatePopupButtons(S),this._onEditFeature(S,P)):this._clearSelection();else W&&W.length?(S=h.sortFeaturesById(O,W),this._updatePopupButtons(S),this._onEditFeature(S,P)):this._clearSelection()}));V&&this._isTextSymbolPoint(V)&&this._isValidLayer(V.getLayer())&&this.editToolbar.activate(0|b.MOVE|b.ROTATE|b.SCALE|b.EDIT_TEXT,V)},_updatePopupButtons:function(M){if(this._usePopup&&M){var P=M.length;J.forEach([this._settings.map.infoWindow._prevFeatureButton,this._settings.map.infoWindow._nextFeatureButton],
I.hitch(this,function(O){1<P?w.remove(O,"hidden"):w.add(O,"hidden")}));var V=1<P?"block":"none";u.query(".esriAttributeInspector .atiLayerName").style({display:V});this._currentFeatureCount=P;this._popupFeatures=M}else this._currentFeatureCount=this._popupFeatures=null},_clearSelection:function(M){this._currentFeatureCount=0;this._popupFeatures=null;this._selectionHelper.clearSelection(M||!1);this._reset()},_findCenterPoint:function(M){M=M.geometry||M;switch(M.type){case "point":var P=M;break;case "polyline":P=
M.getPoint(0,Math.ceil(M.paths[0].length/2));break;case "polygon":P=M.rings.length-1,P=M.getPoint(P,M.rings[P].length-1)}return this._settings.map.toScreen(P)},_hideAttributeInspector:function(){!this._customAttributeInspector&&this._settings.map.infoWindow&&this._settings.map.infoWindow.hide()},_toPolylines:function(M){return J.map(M,function(P){var V=new g(P.spatialReference);J.forEach(P.rings,function(O){V.addPath(O)});return V})},_isNotesFeature:function(M){var P=M.getLayer(),V=P?P.types||null:
null;if(!V)return!1;var O=M.attributes[P.typeIdField],S;J.some(V,function(W){return W.id===O?(S=W.templates,!0):!1});return S?(M=S[0]||null)?this._isShapeTool(M.drawingTool)?!0:!1:!1:!1},_isValidLayer:function(M){var P,V=this._settings.layerInfos;for(P=0;P<V.length;P++){var O=V[P];if(M.id==(O.featureLayer?O.featureLayer.id:O.layerId))return!0}return!1},_isShapeTool:function(M){switch(M){case y.TOOL_ARROW:return v.ARROW;case y.TOOL_LEFT_ARROW:return v.LEFT_ARROW;case y.TOOL_RIGHT_ARROW:return v.RIGHT_ARROW;
case y.TOOL_UP_ARROW:return v.UP_ARROW;case y.TOOL_DOWN_ARROW:return v.DOWN_ARROW;case y.TOOL_CIRCLE:return v.CIRCLE;case y.TOOL_ELLIPSE:return v.ELLIPSE;case y.TOOL_TRIANGLE:return v.TRIANGLE;case y.TOOL_RECTANGLE:return v.RECTANGLE;default:return null}},_toDrawTool:function(M,P){P=P.geometryType;switch(M){case y.TOOL_POINT:return v.POINT;case y.TOOL_ARROW:return v.ARROW;case y.TOOL_LEFT_ARROW:return v.LEFT_ARROW;case y.TOOL_RIGHT_ARROW:return v.RIGHT_ARROW;case y.TOOL_UP_ARROW:return v.UP_ARROW;
case y.TOOL_DOWN_ARROW:return v.DOWN_ARROW;case y.TOOL_CIRCLE:return v.CIRCLE;case y.TOOL_ELLIPSE:return v.ELLIPSE;case y.TOOL_TRIANGLE:return v.TRIANGLE;case y.TOOL_RECTANGLE:return v.RECTANGLE;case y.TOOL_LINE:return v.POLYLINE;case y.TOOL_POLYGON:return v.POLYGON;case y.TOOL_FREEHAND:return"esriGeometryPolyline"===P?v.FREEHAND_POLYLINE:v.FREEHAND_POLYGON;default:return M=v.POINT,"esriGeometryPolyline"===P?(M=v.POLYLINE,this._settings.createOptions.polylineDrawTools[0]===U.CREATE_TOOL_FREEHAND_POLYLINE&&
(M=v.FREEHAND_POLYLINE)):"esriGeometryPolygon"===P&&(M=v.POLYGON,this._settings.createOptions.polygonDrawTools[0]===U.CREATE_TOOL_FREEHAND_POLYGON&&(M=v.FREEHAND_POLYGON)),M}},_isModified:function(){var M=this.editToolbar.getCurrentState();return(M.isModified||this._attributeChanged)&&M.graphic?M.graphic:null},_showInfoWindow:function(M,P){this._customAttributeInspector||this._settings.map.infoWindow.show(M,P)}});I.mixin(U,{CREATE_TOOL_POLYLINE:"polyline",CREATE_TOOL_FREEHAND_POLYLINE:"freehandpolyline",
CREATE_TOOL_POLYGON:"polygon",CREATE_TOOL_FREEHAND_POLYGON:"freehandpolygon",CREATE_TOOL_AUTOCOMPLETE:"autocomplete",CREATE_TOOL_RECTANGLE:"rectangle",CREATE_TOOL_TRIANGLE:"triangle",CREATE_TOOL_CIRCLE:"circle",CREATE_TOOL_ELLIPSE:"ellipse",CREATE_TOOL_ARROW:"arrow",CREATE_TOOL_UP_ARROW:"uparrow",CREATE_TOOL_DOWN_ARROW:"downarrow",CREATE_TOOL_RIGHT_ARROW:"rightarrow",CREATE_TOOL_LEFT_ARROW:"leftarrow"});d("extend-esri")&&I.setObject("dijit.editing.Editor",U,x);return U})},"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(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L){var y=I(z,{declaredClass:"esri.toolbars.Edit",constructor:function(v,b){this._map=v;this._tool=0;if(this._map.loaded)this._scratchGL=v.graphics;else var D=G.connect(this._map,"onLoad",this,function(){G.disconnect(D);D=null;this._scratchGL=this._map.graphics});v=c("esri-mobile");this._defaultOptions=J.mixin({vertexSymbol:new l(l.STYLE_CIRCLE,v?20:12,new C(C.STYLE_SOLID,new d([0,0,0,.5]),1),new d([128,128,128])),ghostVertexSymbol:new l(l.STYLE_CIRCLE,
v?18:10,new C(C.STYLE_SOLID,new d([0,0,0,.5]),1),new d([255,255,255,.75])),ghostLineSymbol:new C(C.STYLE_DOT,new d([128,128,128]),2),allowDeleteVertices:!0,allowAddVertices:!0,rotateHandleOffset:v?24:16,boxLineSymbol:new C(C.STYLE_DASH,new d([64,64,64]),1),boxHandleSymbol:new l(l.STYLE_SQUARE,v?16:9,new C(C.STYLE_SOLID,new d([0,0,0,.5]),1),new d([255,255,255,.75])),textAnchorSymbol:new l(l.STYLE_CIRCLE,10,null,new d([255,0,0]))},b||{})},activate:function(v,b,D){this.deactivate();this._graphic=b;this._options=
J.mixin(J.mixin({},this._defaultOptions),D||{});var h=y.MOVE;D=y.EDIT_VERTICES;var B=y.SCALE,H=y.ROTATE,T=y.EDIT_TEXT,N=!1,p=!1,E=!1,r=this._map,t=r.spatialReference,x=b.geometry.spatialReference;this._geo=!(!t||!x||t.equals(x)||!t.isWebMercator()||4326!==x.wkid);this._isTextPoint=this._prepareTextSymbolEditing(b,v);(v&h)===h&&(N=this._enableMove(b));h=(v&B)===B;H=(v&H)===H;if(h||H)E=this._enableBoxEditing(b,h,H);(v&D)===D&&(p=this._enableVertexEditing(b));(v&T)===T&&this._enableTextEditing(b);if(!(N||
p||E))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=v)this._mapPanEndHandle=G.connect(r,"onPanEnd",this,this._mapPanEndHandler),this._mapExtChgHandle=G.connect(r,"onExtentChange",this,this._mapExtentChangeHandler),this.onActivate(this._tool,b);r.snappingManager&&(N||p)&&r.snappingManager._startSelectionLayerQuery()},deactivate:function(){this._isTextPoint=null;var v=this._tool,b=this._graphic;if(v){var D=
!!this._modified;this._clear();G.disconnect(this._mapPanEndHandle);G.disconnect(this._mapExtChgHandle);this._graphic=this._geo=this._mapPanEndHandle=this._mapExtChgHandle=null;this.onDeactivate(v,b,{isModified:D});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(v,b){},onDeactivate:function(v,b,D){},
onGraphicMoveStart:function(v){},onGraphicFirstMove:function(v){this._modified=!0},onGraphicMove:function(v,b){},onGraphicMoveStop:function(v,b){},onGraphicClick:function(v,b){},onVertexMoveStart:function(v,b){},onVertexFirstMove:function(v,b){this._modified=!0},onVertexMove:function(v,b,D){},onVertexMoveStop:function(v,b,D){},onVertexAdd:function(v,b){this._modified=!0},onVertexClick:function(v,b){},onVertexMouseOver:function(v,b){},onVertexMouseOut:function(v,b){},onVertexDelete:function(v,b){this._modified=
!0},onTextEditStart:function(v,b){},onTextEditEnd:function(v){},onScaleStart:function(v){},onScaleFirstMove:function(v){this._modified=!0},onScale:function(v,b){},onScaleStop:function(v,b){},onRotateStart:function(v){},onRotateFirstMove:function(v){this._modified=!0},onRotate:function(v,b){},onRotateStop:function(v,b){},_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(v,b){if("point"===v.geometry.type||"multipoint"===v.geometry.type){var D=v.getLayer(),h=D.renderer;D=v.symbol||D._getSymbol(v);!D&&(h.hasVisualVariables("sizeInfo",!1)||h.hasVisualVariables("colorInfo",!1)||h.hasVisualVariables("opacityInfo",!1))&&h.addBreak&&
h.infos&&1===h.infos.length&&(D=h.infos[0].symbol||h.defaultSymbol);if(D&&"textsymbol"===D.type){if((b&y.SCALE)===y.SCALE||(b&y.ROTATE)===y.ROTATE||(b&y.EDIT_TEXT)===y.EDIT_TEXT){v.setSymbol(new A(D.toJson()));var B=this;this._textSymbolEditor?(this._textSymbolEditor.createForm(v),this._textSymbolEditor.show()):this._options&&this._options.textSymbolEditor?(this._textSymbolEditor=this._options.textSymbolEditor,this._textSymbolEditor.on("symbol-change",function(){B._boxEditor&&B._boxEditor.refresh()})):
Q(["../dijit/SymbolEditor"],function(H){if(!B._textSymbolEditor){var T=B._options.textSymbolEditorHolder?a.create("div",null,B._options.textSymbolEditorHolder):a.create("div",null,B._map.root);B._textSymbolEditor=new H({graphic:v},T);H=B._textSymbolEditor.domNode.parentNode.id;w.set(B._textSymbolEditor.domNode,{position:"map_root"===H?"absolute":"relative",left:"map_root"===H?B._map.width/2-100+"px":"5px",top:"20px","z-index":50});B._textSymbolEditor.startup();B._textSymbolEditor.createForm(v);B._textSymbolEditor.show();
B._textSymbolEditor.on("symbol-change",function(){B._boxEditor&&B._boxEditor.refresh()})}})}if((b&y.MOVE)===y.MOVE||(b&y.ROTATE)===y.ROTATE||(b&y.SCALE)===y.SCALE)this._textAnchor=new L(v.geometry,this._options.textAnchorSymbol),this._scratchGL.add(this._textAnchor);return!0}}return!1},_enableMove:function(v){var b=this._map;switch(v.geometry.type){case "point":case "polyline":case "polygon":return this._graphicMover=new n(v,b,this,this._textAnchor),!0}return!1},_enableVertexEditing:function(v){var b=
this._map;switch(v.geometry.type){case "multipoint":case "polyline":case "polygon":return this._vertexEditor=g.create(v,b,this),!0}return!1},_enableBoxEditing:function(v,b,D){var h=this._map,B=v.geometry.type;return"polyline"===B||"polygon"===B||this._isTextPoint?(this._boxEditor=new f(v,h,this,b,D,this._options.uniformScaling,this._isTextPoint),!0):!1},_enableTextEditing:function(v){return this._isTextPoint?(this._textEditor=new m(v,this._map,this),G.connect(this._textEditor,"onEditStart",J.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 v=this._graphicMover;v&&(v.destroy(),this._graphicMover=null)},_disableVertexEditing:function(){var v=this._vertexEditor;v&&(v.destroy(),this._vertexEditor=null)},_disableBoxEditing:function(){var v=this._boxEditor;v&&(v.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(v,b,D){D&&this._refreshMoveables()},_refreshMoveables:function(v){var b=u.filter([this._graphicMover,this._vertexEditor,this._boxEditor],e.isDefined);u.forEach(b,function(D){D.refresh(v)})},_beginOperation:function(v){u.forEach(this._getAffectedTools(v),function(b){b.suspend()})},_endOperation:function(v){u.forEach(this._getAffectedTools(v),function(b){b.resume()})},_getAffectedTools:function(v){var b=[];switch(v){case "MOVE":b=[this._vertexEditor,this._boxEditor];
break;case "VERTICES":b=[this._boxEditor];break;case "BOX":b=[this._vertexEditor]}return b=u.filter(b,e.isDefined)}});J.mixin(y,{MOVE:1,EDIT_VERTICES:2,SCALE:4,ROTATE:8,EDIT_TEXT:16});c("extend-esri")&&J.setObject("toolbars.Edit",y,q);return y})},"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(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m){Q=Q(null,{declaredClass:"esri.toolbars._Box",constructor:function(l,C,A,L,y,v,b){this._graphic=l;this._map=C;this._toolbar=A;this._scale=L;this._rotate=y;this._defaultEventArgs={};this._scaleEvent="Scale";this._rotateEvent="Rotate";this._uniformScaling=v;l=A._options;this._markerSymbol=l.boxHandleSymbol;this._lineSymbol=l.boxLineSymbol;this._moveStartHandler=I.hitch(this,this._moveStartHandler);this._firstMoveHandler=I.hitch(this,this._firstMoveHandler);
this._moveStopHandler=I.hitch(this,this._moveStopHandler);this._moveHandler=I.hitch(this,this._moveHandler);this._isTextPoint=b;this._init()},destroy:function(){this._cleanUp();this._graphic=this._map=this._toolbar=this._markerSymbol=this._lineSymbol=null},refresh:function(){this._draw()},suspend:function(){J.forEach(this._getAllGraphics(),function(l){l.hide()})},resume:function(){J.forEach(this._getAllGraphics(),function(l){l.show()});this._draw()},_init:function(){this._draw()},_cleanUp:function(){this._connects&&
J.forEach(this._connects,G.disconnect);var l=this._toolbar._scratchGL;this._anchors&&J.forEach(this._anchors,function(C){l.remove(C.graphic);(C=C.moveable)&&C.destroy()});this._box&&l.remove(this._box);this._box=this._anchors=this._connects=null},_draw:function(){if(this._graphic.getDojoShape()){var l=this._map,C=this._toolbar._scratchGL,A=this._getBoxCoords(),L=new z(l.spatialReference),y=I.clone(J.filter(A,function(v,b){return 8!==b&&0===b%2}));y[0]&&y.push([y[0][0],y[0][1]]);L.addPath(y);this._rotate&&
L.addPath([A[1],A[8]]);this._box?this._box.setGeometry(L):(this._box=new m(L,this._lineSymbol),C.add(this._box));this._anchors?J.forEach(this._anchors,function(v,b){this._scale||(b=8);var D=new k(A[b],l.spatialReference);v.graphic.setGeometry(D);D=v.moveable;var h=v.graphic.getDojoShape();h&&(D?h!==D.shape&&(D.destroy(),v.moveable=this._getMoveable(v.graphic,b)):v.moveable=this._getMoveable(v.graphic,b))},this):(this._anchors=[],this._connects=[],J.forEach(A,function(v,b){!this._scale&&8>b||(v=new k(v,
l.spatialReference),v=new m(v,this._markerSymbol),this._isTextPoint&&1===b%2&&v.hide(),C.add(v),this._anchors.push({graphic:v,moveable:this._getMoveable(v,b)}))},this))}else this._cleanUp()},_getBoxCoords:function(l){var C=this._map,A=[],L,y,v;if(this._isTextPoint){var b=this._graphic.getNode().getBoundingClientRect();var D=C.__container.getBoundingClientRect();b=[{x:b.left-D.left,y:b.top-D.top},{x:b.right-D.left,y:b.top-D.top},{x:b.right-D.left,y:b.bottom-D.top},{x:b.left-D.left,y:b.bottom-D.top}]}else b=
this._getTransformedBoundingBox(this._graphic);J.forEach(b,function(h,B,H){L=h;(y=H[B+1])||(y=H[0]);v={x:(L.x+y.x)/2,y:(L.y+y.y)/2};l||(L=C.toMap(L),v=C.toMap(v));A.push([L.x,L.y]);A.push([v.x,v.y])});this._rotate&&(b=I.clone(A[1]),b=l?{x:b[0],y:b[1]}:C.toScreen({x:b[0],y:b[1],spatialReference:C.spatialReference}),b.y-=this._toolbar._options.rotateHandleOffset,l||(b=C.toMap(b)),A.push([b.x,b.y]));return A},_getTransformedBoundingBox:function(l){var C=this._map,A=l.geometry.getExtent(),L=l.geometry.spatialReference;
l=new k(A.xmin,A.ymax,L);A=new k(A.xmax,A.ymin,L);l=C.toScreen(l);A=C.toScreen(A);return[{x:l.x,y:l.y},{x:A.x,y:l.y},{x:A.x,y:A.y},{x:l.x,y:A.y}]},_getAllGraphics:function(){var l=[this._box];this._anchors&&J.forEach(this._anchors,function(C){l.push(C.graphic)});return l=J.filter(l,e.isDefined)},_getMoveable:function(l,C){var A=l.getDojoShape();if(A)return l=new a(A),l._index=C,this._connects.push(G.connect(l,"onMoveStart",this._moveStartHandler)),this._connects.push(G.connect(l,"onFirstMove",this._firstMoveHandler)),
this._connects.push(G.connect(l,"onMoveStop",this._moveStopHandler)),l.onMove=this._moveHandler,(A=A.getEventSource())&&c.set(A,"cursor",this._toolbar._cursors["box"+C]),l},_moveStartHandler:function(l){this._toolbar["on"+(8===l.host._index?this._rotateEvent:this._scaleEvent)+"Start"](this._graphic)},_firstMoveHandler:function(l){this._toolbar._deactivateScrollWheel();var C=l.host._index,A=this._wrapOffset=l.host.shape._wrapOffsets[0]||0,L=this._graphic.getLayer().getNavigationTransform();l=J.map(this._getBoxCoords(!0),
function(v){return{x:v[0]+A,y:v[1]}});var y=this._isTextPoint?this._map.toScreen(this._graphic.geometry):{x:l[1].x,y:l[3].y};this._centerCoord=w.multiplyPoint(w.invert(L),y);if(8===C)y=w.multiplyPoint(w.invert(L),l[1]),this._isTextPoint&&(this._centerCoord=this._deNormalizePoint(this._centerCoord,y)),this._startLine=[this._centerCoord,y],this._moveLine=I.clone(this._startLine);else if(y=w.multiplyPoint(w.invert(L),l[C]),L=w.multiplyPoint(w.invert(L),l[(C+4)%8]),this._isTextPoint&&(this._centerCoord=
this._deNormalizePoint(this._centerCoord,y)),this._firstMoverToAnchor=Math.sqrt((y.x-this._centerCoord.x)*(y.x-this._centerCoord.x)+(y.y-this._centerCoord.y)*(y.y-this._centerCoord.y)),this._startBox=L,this._startBox.width=l[4].x-l[0].x,this._startBox.height=l[4].y-l[0].y,this._moveBox=I.clone(this._startBox),this._xfactor=y.x>L.x?1:-1,this._yfactor=y.y>L.y?1:-1,1===C||5===C)this._xfactor=0;else if(3===C||7===C)this._yfactor=0;this._toolbar._beginOperation("BOX");this._toolbar["on"+(8===C?this._rotateEvent:
this._scaleEvent)+"FirstMove"](this._graphic)},_moveHandler:function(l,C){l=l.host._index;var A=this._defaultEventArgs;A.angle=0;A.scaleX=1;A.scaleY=1;if(8===l){var L=this._startLine;var y=this._moveLine;var v=y[1];v.x+=C.dx;v.y+=C.dy;C=this._getAngle(L,y);this._isTextPoint&&(C+=this._graphic.symbol.angle);y=w.rotategAt(C,L[0]);this._graphic.getDojoShape().setTransform(y);A.transform=y;A.angle=C;A.around=L[0]}else{L=this._startBox;y=this._moveBox;y.width+=C.dx*this._xfactor;y.height+=C.dy*this._yfactor;
this._uniformScaling||this._isTextPoint?(L=y.x+this._xfactor*y.width,y=y.y+this._yfactor*y.height,L=Math.sqrt((L-this._centerCoord.x)*(L-this._centerCoord.x)+(y-this._centerCoord.y)*(y-this._centerCoord.y)),this._scaleRatio=C=v=L/this._firstMoverToAnchor,L=this._centerCoord):(C=y.width/L.width,v=y.height/L.height,L={x:L.x,y:L.y});if(isNaN(C)||Infinity===C||-Infinity===C)C=1;if(isNaN(v)||Infinity===v||-Infinity===v)v=1;y=w.scaleAt(C,v,L);if(this._isTextPoint){var b=w.rotategAt(this._graphic.symbol.angle,
L);this._graphic.getDojoShape().setTransform([b,y])}else this._graphic.getDojoShape().setTransform(y);A.transform=y;A.scaleX=C;A.scaleY=v;A.around=L}this._toolbar["on"+(8===l?this._rotateEvent:this._scaleEvent)](this._graphic,A)},_moveStopHandler:function(l){this._toolbar._activateScrollWheel();var C=this._graphic,A=this._toolbar,L=A._geo?n.geographicToWebMercator(C.geometry):C.geometry,y=L.spatialReference,v=C.getDojoShape(),b=v.getTransform(),D=C.getLayer().getNavigationTransform();this._isTextPoint?
(C=this._graphic.symbol,8===l.host._index?C.angle+=this._getAngle(this._startLine,this._moveLine):C.font.setSize(Math.round(C.font.size*this._scaleRatio*100)/100),this._graphic.setSymbol(C)):(L=L.toJson(),this._updateSegments(L.paths||L.rings,b,D,y),v.setTransform(null),L=g.fromJson(L),C.setGeometry(A._geo?n.webMercatorToGeographic(L,!0):L));this._draw();this._startLine=this._moveLine=this._startBox=this._moveBox=this._xfactor=this._yfactor=null;A._endOperation("BOX");this._defaultEventArgs.transform=
b;A["on"+(8===l.host._index?this._rotateEvent:this._scaleEvent)+"Stop"](this._graphic,this._defaultEventArgs)},_updateSegments:function(l,C,A,L){var y=this._map,v=this._wrapOffset||0;J.forEach(l,function(b){J.forEach(b,function(D){this._updatePoint(D,L,v,w,y,A,C)},this)},this)},_updatePoint:function(l,C,A,L,y,v,b){C=y.toScreen({x:l[0],y:l[1],spatialReference:C},!0);C.x+=A;C=L.multiplyPoint([v,b,L.invert(v)],C);C.x-=A;A=y.toMap(C);l[0]=A.x;l[1]=A.y},_getAngle:function(l,C){return 180*Math.atan2(C[0].y-
C[1].y,C[0].x-C[1].x)/Math.PI-180*Math.atan2(l[0].y-l[1].y,l[0].x-l[1].x)/Math.PI},_deNormalizePoint:function(l,C){var A=this._map._getFrameWidth();if(-1===A)return l;for(l={x:l.x,y:l.y};Math.abs(l.x-C.x)>=A;)l.x=l.x<C.x?l.x+A:l.x-A;var L=Math.abs(l.x-C.x);Math.abs(l.x-C.x+A)<L?l.x+=A:Math.abs(l.x-C.x-A)<L&&(l.x-=A);return l}});d("extend-esri")&&I.setObject("toolbars._Box",Q,q);return Q})},"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(Q,I,J,G,u,d,c,a,w,q){return I("dojox.gfx.Moveable",null,{constructor:function(e,k){this.shape=e;this.delay=k&&0<k.delay?k.delay:0;this.mover=k&&k.mover?k.mover:w;this.leftButtonOnly=k&&k.leftButtonOnly;this.events=[this.shape.on(d.press,Q.hitch(this,"onMouseDown"))]},destroy:function(){J.forEach(this.events,function(e){e.remove()});this.events=this.shape=null},onMouseDown:function(e){this.delay?(this.events.push(this.shape.on(d.move,Q.hitch(this,"onMouseMove")),this.shape.on(d.release,Q.hitch(this,
"onMouseUp"))),this._lastX=e.clientX,this._lastY=e.clientY):this.leftButtonOnly&&!q.isLeft(e)||new this.mover(this.shape,e,this);G.stop(e)},onMouseMove:function(e){var k=e.clientY;if(Math.abs(e.clientX-this._lastX)>this.delay||Math.abs(k-this._lastY)>this.delay)this.onMouseUp(e),new this.mover(this.shape,e,this);G.stop(e)},onMouseUp:function(e){this.events.pop().remove()},onMoveStart:function(e){u.publish("/gfx/move/start",e);c.add(a.body(),"dojoMove")},onMoveStop:function(e){u.publish("/gfx/move/stop",
e);c.remove(a.body(),"dojoMove")},onFirstMove:function(e){},onMove:function(e,k,z){this.onMoving(e,k,z);this.shape.applyLeftTransform(k);this.onMoved(e,k)},onMoving:function(e,k){},onMoved:function(e,k){}})})},"dojox/gfx/Mover":function(){define("dojo/_base/lang dojo/_base/array dojo/_base/declare dojo/on dojo/touch dojo/_base/event".split(" "),function(Q,I,J,G,u,d){return J("dojox.gfx.Mover",null,{constructor:function(c,a,w){this.shape=c;this.lastX=a.clientX;this.lastY=a.clientY;c=this.host=w;a=
document;w=G(a,u.move,Q.hitch(this,"onFirstMove"));this.events=[G(a,u.move,Q.hitch(this,"onMouseMove")),G(a,u.release,Q.hitch(this,"destroy")),G(a,"dragstart",Q.hitch(d,"stop")),G(a,"selectstart",Q.hitch(d,"stop")),w];if(c&&c.onMoveStart)c.onMoveStart(this)},onMouseMove:function(c){var a=c.clientX,w=c.clientY;this.host.onMove(this,{dx:a-this.lastX,dy:w-this.lastY},c);this.lastX=a;this.lastY=w;d.stop(c)},onFirstMove:function(){this.host.onFirstMove(this);this.events.pop().remove()},destroy:function(){I.forEach(this.events,
function(a){a.remove()});var c=this.host;if(c&&c.onMoveStop)c.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(Q,I,J,G,u,d,c,a,w,q,e,k,z,f){var n=Q(null,{declaredClass:"esri.toolbars._GraphicMover",
constructor:function(g,m,l,C){this.graphic=g;this.map=m;this.toolbar=l;this.tempPt=C;this._enableGraphicMover();this._moved=!1},refresh:function(g){var m=this.graphic.getDojoShape();!m||!g&&m._hostGraphic||(this._disableGraphicMover(),this._enableGraphicMover())},destroy:function(){this._disableGraphicMover()},hasMoved:function(){return this._moved},_enableGraphicMover:function(){var g=this.graphic,m=g.getDojoShape();m&&(m._hostGraphic=g,this._moveable=new d(m,{mover:n.Mover}),this._moveStartHandle=
J.connect(this._moveable,"onMoveStart",this,this._moveStartHandler),this._firstMoveHandle=J.connect(this._moveable,"onFirstMove",this,this._firstMoveHandler),this._movingHandle=J.connect(this._moveable,"onMoving",this,this._movingHandler),this._moveStopHandle=J.connect(this._moveable,"onMoveStop",this,this._moveStopHandler),(g=m.getEventSource())&&u.set(g,"cursor",this.toolbar._cursors.move))},_disableGraphicMover:function(){var g=this._moveable;if(g){J.disconnect(this._moveStartHandle);J.disconnect(this._firstMoveHandle);
J.disconnect(this._movingHandle);J.disconnect(this._moveStopHandle);var m=g.shape;m&&(m._hostGraphic=null,(m=m.getEventSource())&&u.set(m,"cursor","inherit"));g.destroy()}this._moveable=null},_moveStartHandler:function(){var g=this.graphic,m=this.map;this._startTx=g.getDojoShape().getTransform();"point"===this.graphic.geometry.type&&m.snappingManager&&m.snappingManager._setUpSnapping();this.toolbar.onGraphicMoveStart(g)},_firstMoveHandler:function(){this.toolbar._beginOperation("MOVE");this.toolbar.onGraphicFirstMove(this.graphic)},
_movingHandler:function(g,m,l){g=g.shape.getTransform();m=this.map;var C;e("esri-pointer")?C=m.navigationManager.pointerEvents._processTouchEvent(l,l):l&&"pointermove"===l.type&&(C=q.prototype._processTouchEvent.call({map:m},l,l));C&&m.snappingManager&&m.snappingManager._onSnappingMouseMoveHandler(C);this.tempPt&&this.tempPt.getDojoShape().setTransform(g);this.toolbar.onGraphicMove(this.graphic,g)},_moveStopHandler:function(g){var m=this.graphic,l=this.toolbar,C=this.map,A=l._geo?k.geographicToWebMercator(m.geometry):
m.geometry,L=A.type,y=m.getDojoShape(),v=y.getTransform();if(G.toJson(v)!==G.toJson(this._startTx)){this._moved=!0;switch(L){case "point":L=[v,a.invert(this._startTx)];if(C.snappingManager)var b=C.snappingManager._snappingPoint;A=b||C.toMap(a.multiplyPoint(L,C.toScreen(A,!0)));C.snappingManager&&C.snappingManager._killOffSnapping();break;case "polyline":A=this._updatePolyGeometry(A,A.paths,v);break;case "polygon":A=this._updatePolyGeometry(A,A.rings,v)}y.setTransform(null);m.setGeometry(l._geo?k.webMercatorToGeographic(A,
!0):A);this.tempPt&&this.tempPt.setGeometry(new f(m.geometry.toJson()))}else this._moved=!1;l._endOperation("MOVE");l.onGraphicMoveStop(m,v);this._moved||(g=g.__e,C=this.map.position,g=new z(g.pageX-C.x,g.pageY-C.y),l.onGraphicClick(m,{screenPoint:g,mapPoint:this.map.toMap(g)}))},_updatePolyGeometry:function(g,m,l){var C=this.map,A=g.getPoint(0,0);C=C.toMap(C.toScreen(A).offset(l.dx,l.dy));l=C.x-A.x;A=C.y-A.y;var L;for(C=0;C<m.length;C++){var y=m[C];for(L=0;L<y.length;L++){var v=g.getPoint(C,L);g.setPoint(C,
L,v.offset(l,A))}}return g}});n.Mover=Q(c,{declaredClass:"esri.toolbars._Mover",constructor:function(g,m,l){this.__e=m}});e("extend-esri")&&(I.setObject("toolbars._GraphicMover",n,w),I.setObject("toolbars._Mover",n.Mover,w));return n})},"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(Q,
I,J,G,u,d,c,a,w,q,e,k){var z=Q(null,{declaredClass:"esri.toolbars._GraphicVertexEditor",constructor:function(f,n,g){this.graphic=f;this.map=n;this.toolbar=g;f=g._options;this._symbol1=f.vertexSymbol;this._symbol2=f.ghostVertexSymbol;n=f.ghostLineSymbol;this._lineStroke={style:n.style,width:n.width,color:n.color};this._canDel=f.allowDeleteVertices;this._canAdd=f.allowAddVertices;this._addControllers()},destroy:function(){this._removeControllers()},refresh:function(f){f?(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=J.connect(w,"onFirstMove",this,this._firstMoveHandler);this._moveStopHandle=J.connect(w,"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 f=this._getGraphicsLayer();this._mouseOverHandle=J.connect(f,"onMouseOver",this,this._mouseOverHandler);this._mouseOutHandle=J.connect(f,"onMouseOut",this,this._mouseOutHandler);this._canDel&&(this._ctxMenu=new d({style:"font-size: 12px; margin-left: 5px; margin-top: 5px;"}),f=this._ctxDelete=new c({label:k.toolbars.edit.deleteLabel,iconClass:"vertexDeleteIcon",style:"outline: none;"}),this._deleteHandle=
J.connect(f,"onClick",this,this._deleteHandler),this._ctxMenu.addChild(f),this._ctxMenu.startup())},_removeControllers:function(){J.disconnect(this._firstMoveHandle);J.disconnect(this._moveStopHandle);J.disconnect(this._mouseOverHandle);J.disconnect(this._mouseOutHandle);J.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(f,n,g){var m,l,C=this.graphic,A=[];for(m=0;m<f.length;m++){var L=f[m],y=[];for(l=0;l<L.length;l++)y.push(new w(L[l],n,C,m,l,L.length,this,g));A.push(y)}return A},_remove:function(f){f&&G.forEach(f,function(n){G.forEach(n,function(g){g.destroy()})})},_refresh:function(f){f&&G.forEach(f,function(n){G.forEach(n,function(g){g.refresh()})})},_isNew:function(f){return-1===G.indexOf(this._vertexMovers[f.segIndex],f)?!0:!1},_getGraphicsLayer:function(){return this.toolbar._scratchGL},
_deleteHandler:function(f){f=this._selectedMover;this._updateRelatedGraphic(f,f.relatedGraphic,f.graphic.geometry,f.segIndex,f.ptIndex,f.segLength,!1,!0);this._canAdd&&this._deleteMidpoints(f);this._deleteVertex(f);this.toolbar._endOperation("VERTICES")},_mouseOverHandler:function(f){f=f.graphic;var n=this._findMover(f);n&&(this.toolbar.onVertexMouseOver(this.graphic,n._getInfo()),n._placeholder||(this._selectedMover=n,this._canDel&&this._bindCtxNode(f.getDojoShape().getNode())))},_mouseOutHandler:function(f){if(f=
this._findMover(f.graphic))this.toolbar.onVertexMouseOut(this.graphic,f._getInfo())},_bindCtxNode:function(f){this._unbindCtxNode();this._ctxDelete.set("disabled",this._selectedMover.segLength<=this.minLength?!0:!1);this._ctxMenu.bindDomNode(f);this._bindNode=f},_unbindCtxNode:function(){var f=this._bindNode;f&&this._ctxMenu.unBindDomNode(f)},_findMover:function(f){var n=[];var g=this._mpVertexMovers;G.forEach(this._vertexMovers,function(l){n=n.concat(l)});g&&G.forEach(g,function(l){n=n.concat(l)});
for(g=0;g<n.length;g++){var m=n[g];if(m.graphic===f)return m}},_firstMoveHandler:function(f){!this._isNew(f)&&this._canAdd&&this._hideRelatedMidpoints(f);this.toolbar._beginOperation("VERTICES")},_moveStopHandler:function(f,n){var g=this._isNew(f);n&&(n.dx||n.dy)?(this._updateRelatedGraphic(f,f.relatedGraphic,f.graphic.geometry,f.segIndex,f.ptIndex,f.segLength,g),this._canAdd&&(g?this._addMidpoints(f):(this._repositionRelatedMidpoints(f),this._showRelatedMidpoints(f))),this.toolbar._endOperation("VERTICES")):
!g&&this._canAdd&&this._showRelatedMidpoints(f)},_showRelatedMidpoints:function(f){var n=this._getAdjacentMidpoints(f.ptIndex,f.segLength),g=this._mpVertexMovers[f.segIndex];for(f=0;f<n.length;f++){var m=g[n[f]];m.graphic.show();m.refresh()}},_hideRelatedMidpoints:function(f){var n=this._getAdjacentMidpoints(f.ptIndex,f.segLength),g=this._mpVertexMovers[f.segIndex];for(f=0;f<n.length;f++)g[n[f]].graphic.hide()},_repositionRelatedMidpoints:function(f){var n,g=this._getAdjacentMidpoints(f.ptIndex,f.segLength),
m=this._mpVertexMovers[f.segIndex];for(n=0;n<g.length;n++){var l=this._getAdjacentVertices(g[n],f.segLength),C=f.relatedGraphic.geometry.getPoint(f.segIndex,l[0]);l=f.relatedGraphic.geometry.getPoint(f.segIndex,l[1]);C=new q({x:(C.x+l.x)/2,y:(C.y+l.y)/2,spatialReference:C.spatialReference.toJson()});m[g[n]].graphic.setGeometry(C)}},_addMidpoints:function(f){var n=f.segIndex,g=f.ptIndex,m=f.segLength,l=g+1,C,A=m+1;this._mpVertexMovers[n].splice(g,1);var L=this._vertexMovers[n];for(C=0;C<l;C++)L[C].segLength+=
1;for(C=l;C<L.length;C++)L[C].ptIndex+=1,L[C].segLength+=1;f.ptIndex=l;f.segLength=L.length+1;L.splice(l,0,f);f.graphic.setSymbol(this._symbol1);L=this._mpVertexMovers[n];for(C=0;C<g;C++)L[C].segLength+=1;for(C=g;C<m-1;C++)L[C].ptIndex+=1,L[C].segLength+=1;l=this._getAdjacentVertices(g,A);n=this._getAdjacentVertices(g+1,A);m=f.relatedGraphic.geometry.getPoint(f.segIndex,l[0]);C=f.relatedGraphic.geometry.getPoint(f.segIndex,l[1]);l=new q({x:(m.x+C.x)/2,y:(m.y+C.y)/2,spatialReference:m.spatialReference.toJson()});
m=f.relatedGraphic.geometry.getPoint(f.segIndex,n[0]);C=f.relatedGraphic.geometry.getPoint(f.segIndex,n[1]);n=new q({x:(m.x+C.x)/2,y:(m.y+C.y)/2,spatialReference:m.spatialReference.toJson()});m=new w(l,this._symbol2,this.graphic,f.segIndex,g,A,this,!0);f=new w(n,this._symbol2,this.graphic,f.segIndex,g+1,A,this,!0);L.splice(g,0,m,f)},_deleteVertex:function(f){var n,g=f.ptIndex,m=this._vertexMovers[f.segIndex];for(n=0;n<g;n++)--m[n].segLength;for(n=g+1;n<m.length;n++){var l=m[n];--l.ptIndex;--l.segLength}m.splice(g,
1);n=f._getInfo();f.destroy();this.toolbar.onVertexDelete(this.graphic,n)}});I.mixin(z,{create:function(f,n,g){switch(f.geometry.type){case "multipoint":return new z.MultipointVertexEditor(f,n,g);case "polyline":return new z.PolylineVertexEditor(f,n,g);case "polygon":return new z.PolygonVertexEditor(f,n,g)}}});z.MultipointVertexEditor=Q(z,{declaredClass:"esri.toolbars._MultipointVertexEditor",minLength:1,constructor:function(){this._moveStartHandle=J.connect(w,"onMoveStart",this,this._moveStartHandler);
J.disconnect(this._firstMoveHandle)},destroy:function(){this.inherited(arguments);J.disconnect(this._moveStartHandle)},_getSegments:function(f){var n=f.points,g=[],m=f.spatialReference;for(f=0;f<n.length;f++){var l=n[f];g.push(new q({x:l[0],y:l[1],spatialReference:m.toJson()}))}return[g]},_getMidpointSegments:function(f){return[]},_getControlPoints:function(f,n,g,m,l){return[]},_getGraphicsLayer:function(){return this.graphic._graphicsLayer},_mouseOverHandler:function(f){var n=f.graphic;if(f=this._findMover(f))this.toolbar.onVertexMouseOver(n,
f._getInfo()),this._selectedMover=f,this._canDel&&this._bindCtxNode(f.graphic.getDojoShape().getNode())},_mouseOutHandler:function(f){var n=f.graphic;if(f=this._findMover(f))this.toolbar.onVertexMouseOut(n,f._getInfo())},_findMover:function(f){var n=[].concat(this._vertexMovers[0]),g=f.target;for(f=0;f<n.length;f++){var m=n[f];if(m.graphic.getDojoShape().getNode()===g)return m}},_moveStartHandler:function(f){var n=f.ptIndex,g=f.segLength-1,m=f.relatedGraphic.geometry.points;f=m.splice(n,1);m.push(f[0]);
m=this._vertexMovers[0];for(f=g;f>n;f--)--m[f].ptIndex;f=m.splice(n,1);m.push(f[0]);f[0].ptIndex=g},_moveStopHandler:function(f){this._updateRelatedGraphic(f,f.relatedGraphic,f.graphic.geometry,f.segIndex,f.ptIndex,f.segLength);this.toolbar._endOperation("VERTICES")},_updateRelatedGraphic:function(f,n,g,m,l,C,A,L){f=n.geometry;L?f.removePoint(l):f.setPoint(l,g);n.setGeometry(f)},_deleteMidpoints:function(f){}});z.PolylineVertexEditor=Q(z,{declaredClass:"esri.toolbars._PolylineVertexEditor",minLength:2,
_getSegments:function(f){var n,g,m=f.paths,l=[];for(n=0;n<m.length;n++){var C=m[n],A=[];for(g=0;g<C.length;g++)A.push(f.getPoint(n,g));l.push(A)}return l},_getMidpointSegments:function(f){var n,g,m=f.paths,l=[],C=f.spatialReference;for(n=0;n<m.length;n++){var A=m[n],L=[];for(g=0;g<A.length-1;g++){var y=f.getPoint(n,g),v=f.getPoint(n,g+1);y=new q({x:(y.x+v.x)/2,y:(y.y+v.y)/2,spatialReference:C.toJson()});L.push(y)}l.push(L)}return l},_getControlPoints:function(f,n,g,m,l){var C=this.map,A,L;this._isNew(f)?
(f=m,m+=1,0<=f&&(A=C.toScreen(n.getPoint(g,f))),m<=l&&(L=C.toScreen(n.getPoint(g,m)))):(f=m-1,m+=1,0<=f&&(A=C.toScreen(n.getPoint(g,f))),m<l&&(L=C.toScreen(n.getPoint(g,m))));return[A,L]},_getAdjacentMidpoints:function(f,n){var g=[],m=f-1;0<=m&&g.push(m);f<n-1&&g.push(f);return g},_getAdjacentVertices:function(f,n){return[f,f+1]},_deleteMidpoints:function(f){var n=this._mpVertexMovers[f.segIndex],g=n.length-1,m=this._getAdjacentMidpoints(f.ptIndex,f.segLength).sort(),l,C=m[0];for(l=0;l<C;l++)--n[l].segLength;
for(l=C+1;l<n.length;l++){var A=n[l];--A.ptIndex;--A.segLength}if(1===m.length)n.splice(C,1)[0].destroy();else for(A=this._getAdjacentVertices(C,g),l=f.relatedGraphic.geometry.getPoint(f.segIndex,A[0]),A=f.relatedGraphic.geometry.getPoint(f.segIndex,A[1]),l=new q({x:(l.x+A.x)/2,y:(l.y+A.y)/2,spatialReference:l.spatialReference.toJson()}),f=new w(l,this._symbol2,this.graphic,f.segIndex,C,g,this,!0),n=n.splice(C,m.length,f),l=0;l<n.length;l++)n[l].destroy()},_updateRelatedGraphic:function(f,n,g,m,l,
C,A,L){f=n.geometry;A?f.insertPoint(m,l+1,e.fromJson(g.toJson())):L?f.removePoint(m,l):f.setPoint(m,l,e.fromJson(g.toJson()));n.setGeometry(f)}});z.PolygonVertexEditor=Q(z,{declaredClass:"esri.toolbars._PolygonVertexEditor",minLength:3,_getSegments:function(f){var n,g,m=f.rings,l=[];for(n=0;n<m.length;n++){var C=m[n],A=[];for(g=0;g<C.length-1;g++)A.push(f.getPoint(n,g));l.push(A)}return l},_getMidpointSegments:function(f){var n,g,m=f.rings,l=[],C=f.spatialReference;for(n=0;n<m.length;n++){var A=m[n],
L=[];for(g=0;g<A.length-1;g++){var y=f.getPoint(n,g),v=f.getPoint(n,g+1);y=new q({x:(y.x+v.x)/2,y:(y.y+v.y)/2,spatialReference:C.toJson()});L.push(y)}l.push(L)}return l},_getControlPoints:function(f,n,g,m,l){var C=this.map;this._isNew(f)?f=m:(f=m-1,f=0>f?(l+f)%l:f);m=(m+1)%l;l=C.toScreen(n.getPoint(g,f));n=C.toScreen(n.getPoint(g,m));return[l,n]},_getAdjacentMidpoints:function(f,n){var g=f-1;return[0>g?(n+g)%n:g,f]},_getAdjacentVertices:function(f,n){return[f,(f+1)%n]},_deleteMidpoints:function(f){var n=
f.ptIndex,g=this._mpVertexMovers[f.segIndex],m=g.length-1,l=this._getAdjacentMidpoints(n,f.segLength).sort();var C=l[0];var A=l[l.length-1];if(0===n){var L=this._getAdjacentVertices(m-1,m);n=f.relatedGraphic.geometry.getPoint(f.segIndex,L[0]);L=f.relatedGraphic.geometry.getPoint(f.segIndex,L[1]);n=new q({x:(n.x+L.x)/2,y:(n.y+L.y)/2,spatialReference:n.spatialReference.toJson()});f=new w(n,this._symbol2,this.graphic,f.segIndex,m-1,m,this,!0);g.splice(A,1,f)[0].destroy();g.splice(C,1)[0].destroy();for(l=
0;l<g.length-1;l++)C=g[l],--C.ptIndex,--C.segLength}else{L=this._getAdjacentVertices(C,m);n=f.relatedGraphic.geometry.getPoint(f.segIndex,L[0]);L=f.relatedGraphic.geometry.getPoint(f.segIndex,L[1]);n=new q({x:(n.x+L.x)/2,y:(n.y+L.y)/2,spatialReference:n.spatialReference.toJson()});f=new w(n,this._symbol2,this.graphic,f.segIndex,C,m,this,!0);A=g.splice(C,l.length,f);for(l=0;l<A.length;l++)A[l].destroy();for(l=0;l<C;l++)--g[l].segLength;for(l=C+1;l<g.length;l++)C=g[l],--C.ptIndex,--C.segLength}},_updateRelatedGraphic:function(f,
n,g,m,l,C,A,L){f=n.geometry;A?f.insertPoint(m,l+1,e.fromJson(g.toJson())):L?(f.removePoint(m,l),0===l&&f.setPoint(m,C-1,e.fromJson(f.getPoint(m,0).toJson()))):(f.setPoint(m,l,e.fromJson(g.toJson())),0===l&&f.setPoint(m,C,e.fromJson(g.toJson())));n.setGeometry(f)}});u("extend-esri")&&(I.setObject("toolbars._GraphicVertexEditor",z,a),I.setObject("toolbars._MultipointVertexEditor",z.MultipointVertexEditor,a),I.setObject("toolbars._PolylineVertexEditor",z.PolylineVertexEditor,a),I.setObject("toolbars._PolygonVertexEditor",
z.PolygonVertexEditor,a));return z})},"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(Q,I,J,G,u,d,c,a,w,q,e,k,z){Q=Q(null,{declaredClass:"esri.toolbars.VertexMover",constructor:function(f,n,g,m,l,C,A,L){this.point=f;this.symbol=n;this.relatedGraphic=g;this.segIndex=m;this.ptIndex=
l;this.segLength=C;this.editor=A;this.map=A.map;this._scratchGL=A.toolbar._scratchGL;this._placeholder=L||!1;this._type=g.geometry.type;this._init();this._enable()},refresh:function(f){if(f||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 f=new e(this.point.toJson());
f=new k(f,this.symbol);switch(this._type){case "multipoint":f._shape=this.relatedGraphic.getDojoShape().children[this.ptIndex];break;case "polyline":case "polygon":this._scratchGL.add(f)}this.graphic=f},_enable:function(){var f=this.graphic.getDojoShape();f&&(f._hasMover=!0,this._moveable=this._getMoveable(f),(f=f.getEventSource())&&u.set(f,"cursor",this.editor.toolbar._cursors[this._placeholder?"move-gv":"move-v"]))},_disable:function(){var f=this._moveable;if(f){J.disconnect(this._startHandle);
J.disconnect(this._firstHandle);J.disconnect(this._movingHandle);J.disconnect(this._stopHandle);var n=f.shape;n&&(n=n.getEventSource())&&u.set(n,"cursor","inherit");f.destroy();this._moveable=null}},_needRefresh:function(){var f=this.graphic.getDojoShape(),n=!1;if(f)switch(this._type){case "multipoint":var g=this.relatedGraphic.getDojoShape();g&&(g=g.children[this.ptIndex],f!==g&&(this.graphic._shape=g,n=!0));break;case "polyline":case "polygon":n=!f._hasMover}return n},_getMoveable:function(f){f=
new d(f,G("mac")&&G("ff")&&!q("esri-touch")&&{leftButtonOnly:!0});this._startHandle=J.connect(f,"onMoveStart",this,this._moveStartHandler);this._firstHandle=J.connect(f,"onFirstMove",this,this._firstMoveHandler);this._movingHandle=J.connect(f,"onMoving",this,this._movingHandler);this._stopHandle=J.connect(f,"onMoveStop",this,this._moveStopHandler);return f},_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(f){var n=this.map;n.snappingManager&&n.snappingManager._setUpSnapping();this.editor.toolbar._deactivateScrollWheel();this._startTx=this.graphic.getDojoShape().getTransform();f.shape.moveToFront();this.constructor.onMoveStart(this);this.editor.toolbar.onVertexMoveStart(this.relatedGraphic,this._getInfo())},_firstMoveHandler:function(f){var n=f.shape,g=this._getControlEdges(),m=this._scratchGL._div,l,C=[],A=f.host.shape._wrapOffsets[0]||
0;for(l=0;l<g.length;l++){var L=g[l];L.x1+=A;L.x2+=A;C.push([m.createLine({x1:L.x1,y1:L.y1,x2:L.x2,y2:L.y2}).setStroke(this.editor._lineStroke),L.x1,L.y1,L.x2,L.y2])}n._lines=C;f.shape.moveToFront();this.constructor.onFirstMove(this);this.editor.toolbar.onVertexFirstMove(this.relatedGraphic,this._getInfo())},_movingHandler:function(f,n,g){n=this.map;var m;q("esri-pointer")?m=n.navigationManager.pointerEvents._processTouchEvent(g,g):g&&"pointermove"===g.type&&(m=w.prototype._processTouchEvent.call({map:n},
g,g));m&&n.snappingManager&&n.snappingManager._onSnappingMouseMoveHandler(m);g=f.shape;f=g.getTransform();g=g._lines;for(m=0;m<g.length;m++)n=g[m],n[0].setShape({x1:n[1]+f.dx,y1:n[2]+f.dy,x2:n[3],y2:n[4]});this.editor.toolbar.onVertexMove(this.relatedGraphic,this._getInfo(),f)},_moveStopHandler:function(f){f=f.shape;var n=this.editor.toolbar,g=f.getTransform(),m=this.map,l=this.graphic,C=n._geo?z.geographicToWebMercator(l.geometry):l.geometry;n._activateScrollWheel();var A,L=f._lines;if(L){for(A=
0;A<L.length;A++)L[A][0].removeShape();f._lines=null}A=!1;L=!0;var y=this._getInfo();g&&(g.dx||g.dy)?this._placeholder&&(this._placeholder=!1,A=!0):L=!1;if(m.snappingManager)var v=m.snappingManager._snappingPoint;var b=[g,c.invert(this._startTx)];v=v||m.toMap(c.multiplyPoint(b,m.toScreen(C,!0)));m.snappingManager&&m.snappingManager._killOffSnapping();f.setTransform(null);l.setGeometry(n._geo?z.webMercatorToGeographic(v,!0):v);this.constructor.onMoveStop(this,g);n.onVertexMoveStop(this.relatedGraphic,
y,g);if(!L)n.onVertexClick(this.relatedGraphic,y);if(A)n.onVertexAdd(this.relatedGraphic,this._getInfo())},_getControlEdges:function(){var f=this.map,n=this.relatedGraphic.geometry,g=this.segIndex,m=this.ptIndex,l=this.segLength,C=this._scratchGL.getNavigationTransform(),A=C.dx;C=C.dy;var L=f.toScreen(this.graphic.geometry);f=L.x-A;L=L.y-C;var y=[];n=this.editor._getControlPoints(this,n,g,m,l);n[0]&&y.push({x1:f,y1:L,x2:n[0].x-A,y2:n[0].y-C});n[1]&&y.push({x1:f,y1:L,x2:n[1].x-A,y2:n[1].y-C});return y}});
q("extend-esri")&&I.setObject("toolbars.VertexMover",Q,a);I.mixin(Q,{onMoveStart:function(){},onFirstMove:function(){},onMoveStop:function(){}});return Q})},"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(Q,I,J,G,u,d,c,a,w,q){Q=Q(null,{declaredClass:"esri.toolbars.TextEditor",constructor:function(e,k,z){this._graphic=e;this._map=k;
this._toolbar=z;this._enable(this._graphic)},destroy:function(){this._disable()},onEditStart:function(){},onEditEnd:function(){},_enable:function(e){this._editBox?(J.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null):(this._map.navigationManager.setImmediateClick(!0),this._addEditBoxHandler=J.connect(e.getLayer(),"onDblClick",this,function(k){this._map.navigationManager.setImmediateClick(!1);k.graphic==e&&(G.stop(k),J.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null,
this._addTextBox(e))}))},_disable:function(){this._applyEdit();this._addEditBoxHandler&&(J.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null);this._removeTextBox();this.onEditEnd(this._graphic);this._toolbar.onTextEditEnd(this._graphic)},_addTextBox:function(e,k){if(!this._editBox){if(!e.symbol.text){e.symbol.text="Tempt text";e.setSymbol(e.symbol);var z=""}var f=this._createInputTextStyle(e,this._map);""!==z&&(z=k||e.symbol.text);this._editBox=d.create("input",{type:"text",value:z});
a.set(this._editBox,f);c.add(this._editBox,"esriTextEditorInput");this._map.container.appendChild(this._editBox);this._editBox.focus();this._editBoxKeyHandler=J.connect(this._editBox,"onkeyup",I.hitch(this,function(g){g.keyCode!=w.ENTER&&g.keyCode!==w.TAB||this._disable()}));this._editBoxBlurHandler=J.connect(this._editBox,"onblur",I.hitch(this,function(g){this._disable()}));e.symbol.text="";e.setSymbol(e.symbol);e.hide();var n=this._editBox;this._disableBoxHandler||(this._disableBoxHandler=this._map.on("zoom-start",
I.hitch(this,function(){this._disable()})));this._moveBoxHandler=this._map.on("pan",function(g){a.set(n,{left:this._editBoxLeft+g.delta.x+"px",top:this._editBoxTop+g.delta.y+"px"})});this._moveBoxStartHandler=this._map.on("pan-start",function(){this._editBoxLeft=parseFloat(a.get(n,"left"));this._editBoxTop=parseFloat(a.get(n,"top"))});this.onEditStart(e,this._editBox);this._toolbar.onTextEditStart(e,this._editBox)}},_removeTextBox:function(){this._editBoxBlurHandler&&(J.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&&(J.disconnect(this._editBoxKeyHandler),this._editBoxKeyHandler=null)},_createInputTextStyle:function(e,
k){k=e.getDojoShape().getTransformedBoundingBox();var z=e.getLayer();z=z.hasLocalNavigationTransform()?{dx:0,dy:0}:z.getNavigationTransform();var f=e.symbol.font;return{"font-family":f.family,"font-size":f.size+"px","font-style":f.style,"font-variant":f.variant,"font-weight":f.weight,left:k[0].x+z.dx+"px",top:k[0].y+z.dy+"px",width:Math.abs(k[0].x-k[1].x)/Math.cos(e.symbol.angle/180*Math.PI)+"px"}},_applyEdit:function(){if(this._editBox)if(this._editBox.value){this._graphic.show();var e=this._graphic.symbol;
e.text=this._editBox.value;this._graphic.setSymbol(e)}else this._graphic.getLayer().remove(this._graphic)}});u("extend-esri")&&I.setObject("toolbars.TextEditor",Q,q);return Q})},"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(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v,b,D,h,B,H,T,N,p,E,r,t,x,F,K,R,U,M,P){var V=Q([v,l,C],{declaredClass:"esri.dijit.AttributeInspector",widgetsInTemplate:!0,templateString:P,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(O,S){I.mixin(this,n.widgets.attributeInspector);O=O||{};O.featureLayer||O.layerInfos||console.error("esri.AttributeInspector: please provide correct parameter in the constructor");this._datePackage=this._getDatePackage(O);this._layerInfos=O.layerInfos||[{featureLayer:O.featureLayer,options:O.options||[]}];this._layerInfos=J.filter(this._layerInfos,function(W){return!W.disableAttributeUpdate});this._hideNavButtons=O.hideNavButtons||!1},postCreate:function(){if(J.every(this._layerInfos,
function(S){return S.featureLayer.loaded}))this._initLayerInfos(),this._createAttachmentEditor(),this.onFirstFeature();else{var O=this._layerInfos.length;J.forEach(this._layerInfos,function(S){S=S.featureLayer;if(S.loaded)O--;else var W=G.connect(S,"onLoad",this,function(X){G.disconnect(W);W=null;O--;O||(this._initLayerInfos(),this._createAttachmentEditor(),this.onFirstFeature())})},this)}},destroy:function(){this._destroyAttributeTable();J.forEach(this._aiConnects,G.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(O,S){S&&(this._createOnlyFirstTime=!0);
this._updateSelection([O],S);this._updateUI()},onLayerSelectionChange:function(O,S,W){this._createOnlyFirstTime=!1;this._featureIdx=W===f.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(O,S,W,X){},onLayerError:function(O,S,W,X){},onLayerEditsError:function(O,
S,W,X){},onLayerEditsComplete:function(O,S,W,X){X=X||[];if(X.length){var Y=this._selection,ba=O.featureLayer.objectIdField;J.forEach(X,I.hitch(this,function(ca){J.some(Y,I.hitch(this,function(aa,da){if(aa.attributes[ba]!==ca.objectId)return!1;this._selection.splice(da,1);return!0}))}))}S=S||[];S.length&&(this._selection=D.findFeatures(S,O.featureLayer),this._featureIdx=0);X=this._numFeatures=(this._selection=D.sortFeaturesById(this._layerInfos,this._selection))?this._selection.length:0;if(S.length){if(S=
X?this._selection[this._featureIdx]:null)X=S.getLayer().getEditCapabilities(),X.canCreate&&!X.canUpdate||this._showFeature(S);this._updateUI()}W=W||[];if(W.length){var Z=this._rollbackInfo;J.forEach(W,function(ca){var aa=D.findFeatures(W,O.featureLayer)[0];if(!ca.success&&aa.attributes[O.featureLayer.objectIdField]===ca.objectId&&Z){var da=Z.field;ca=Z.graphic.attributes[da.name];var ea=J.filter(this._currentLInfo.fieldInfos,function(fa){return fa.fieldName===da.name},this)[0].dijit;aa.attributes[da.name]=
ca;"esriFieldTypeDate"===da.type&&(ca=new Date(ca));this._setValue(ea,ca)}},this)}this._rollbackInfo=null},onFieldValueChange:function(O,S){var W=O.field,X=O.dijit,Y=this._currentFeature,ba=this._currentLInfo,Z=W.name;O=this._isFieldRequired(W,O);if(""===X.displayedValue||"dijit.form.ValidationTextBox"!==X.declaredClass||X.isValid())if(""!==X.displayedValue&&X.displayedValue!==S&&X.isValid&&!X.isValid())this._setValue(X,Y.attributes[W.name]);else{var ca=!("esriFieldTypeInteger"!==W.type&&"esriFieldTypeSmallInteger"!==
W.type&&"esriFieldTypeSingle"!==W.type&&"esriFieldTypeDouble"!==W.type);if(O&&(null===S||""===S||"undefined"===typeof S||ca&&isNaN(S))){Z=Y.attributes[W.name];if("esriFieldTypeDate"===W.type&&(Z=new Date(Z),X instanceof Array)){this._setValue(X[0],Z);this._setValue(X[1],Z);return}this._setValue(X,Z)}else{if(ca){if(isNaN(S)||""===S)S=null;ca&&null!==S&&(S=Number(S))}"esriFieldTypeDate"===W.type&&(X instanceof Array?(S=X[0].getValue(),X=X[1].getValue(),S=S&&X?new Date(S.getFullYear(),S.getMonth(),S.getDate(),
X.getHours(),X.getMinutes(),X.getSeconds(),X.getMilliseconds()):S||X||null):(S=X.getValue(),W.domain&&(S=Number(S))),S=S&&S.getTime?S.getTime():S&&S.toGregorian?S.toGregorian().getTime():S);if(this._currentFeature.attributes[W.name]!==S){if(Z===ba.typeIdField){var aa=this._findFirst(ba.types,"id",S);J.forEach(ba.fieldInfos,function(da){(W=da.field)&&W.name!==ba.typeIdField&&(da=da.dijit,this._setFieldDomain(da,aa,W)&&da&&(this._setValue(da,Y.attributes[W.name]+""),!1===da.isValid()&&this._setValue(da,
null)))},this)}this.onAttributeChange(Y,Z,S)}}}else this._setValue(X,Y.attributes[W.name])},onDeleteBtn:function(O){this._deleteFeature()},onNextFeature:function(O){this._onNextFeature(1)},onPreviousFeature:function(O){this._onNextFeature(-1)},onFirstFeature:function(O){this._onNextFeature(-1*this._featureIdx)},onLastFeature:function(O){this._onNextFeature(this._numFeatures-1-this._featureIdx)},_initLayerInfos:function(){var O=this._layerInfos;this._editorTrackingInfos={};J.forEach(O,this._initLayerInfo,
this)},_initLayerInfo:function(O){var S=O.featureLayer,W;this._userIds={};var X=S.id;S.credential&&(this._userIds[X]=S.credential.userId);O.userId&&(this._userIds[X]=O.userId);this._connect(S,"onSelectionComplete",I.hitch(this,"onLayerSelectionChange",O));this._connect(S,"onSelectionClear",I.hitch(this,"onLayerSelectionClear",O));this._connect(S,"onEditsComplete",I.hitch(this,"onLayerEditsComplete",O));this._connect(S,"error",I.hitch(this,"onLayerError",O));this._connect(S,"onUpdateEnd",I.hitch(this,
"onLayerUpdateEnd",O));O.showAttachments=S.hasAttachments?e.isDefined(O.showAttachments)?O.showAttachments:!0:!1;O.hideFields=O.hideFields||[];O.htmlFields=O.htmlFields||[];O.isEditable=S.isEditable()?e.isDefined(O.isEditable)?O.isEditable:!0:!1;O.typeIdField=S.typeIdField;O.layerId=S.id;O.types=S.types;S.globalIdField&&((W=this._findFirst(O.fieldInfos,"fieldName",S.globalIdField))||O.showGlobalID||O.hideFields.push(S.globalIdField));(X=this._findFirst(O.fieldInfos,"fieldName",S.objectIdField))||
O.showObjectID||O.hideFields.push(S.objectIdField);var Y=this._getFields(O.featureLayer);if(Y){var ba=O.fieldInfos||[];ba=J.map(ba,function(Z){return I.mixin({},Z)});ba.length?O.fieldInfos=J.filter(J.map(ba,I.hitch(this,function(Z){var ca=Z.stringFieldOption||(this._isInFields(Z.fieldName,O.htmlFields)?V.STRING_FIELD_OPTION_RICHTEXT:V.STRING_FIELD_OPTION_TEXTBOX);return I.mixin(Z,{field:this._findFirst(Y,"name",Z.fieldName),stringFieldOption:ca})})),"return item.field;"):(Y=J.filter(Y,I.hitch(this,
function(Z){return!this._isInFields(Z.name,O.hideFields)})),O.fieldInfos=J.map(Y,I.hitch(this,function(Z){var ca=this._isInFields(Z.name,O.htmlFields)?V.STRING_FIELD_OPTION_RICHTEXT:V.STRING_FIELD_OPTION_TEXTBOX;return{fieldName:Z.name,field:Z,stringFieldOption:ca}})));O.showGlobalID&&!W&&ba.push(this._findFirst(Y,"name",S.globalIdField));O.showObjectID&&!X&&ba.push(this._findFirst(Y,"name",S.objectIdField));W=[];S.editFieldsInfo&&(S.editFieldsInfo.creatorField&&W.push(S.editFieldsInfo.creatorField),
S.editFieldsInfo.creationDateField&&W.push(S.editFieldsInfo.creationDateField),S.editFieldsInfo.editorField&&W.push(S.editFieldsInfo.editorField),S.editFieldsInfo.editDateField&&W.push(S.editFieldsInfo.editDateField));this._editorTrackingInfos[S.id]=W}},_createAttachmentEditor:function(){this._attachmentEditor=null;var O=J.filter(this._layerInfos,function(S){return S.showAttachments});O&&O.length&&(this._attachmentEditor=new b({"class":this.css.attachmentEditor},this.attachmentEditor),this._attachmentEditor.startup())},
_setCurrentLInfo:function(O){var S=this._currentLInfo?this._currentLInfo.featureLayer:null,W=O.featureLayer;if(S&&S.id===W.id&&!S.ownershipBasedAccessControlForFeatures&&(S=W.getEditCapabilities(),!S.canCreate||S.canUpdate))return;this._currentLInfo=O;this._createTable()},_updateSelection:function(O,S){this._selection=O||[];J.forEach(this._layerInfos,this._getSelection,this);this._selection=D.sortFeaturesById(this._layerInfos,this._selection);this._numFeatures=this._selection.length;this._showFeature(this._numFeatures?
this._selection[this._featureIdx]:null,S)},_getSelection:function(O){O=O.featureLayer.getSelectedFeatures();this._selection=this._selection.concat(O)},_updateUI:function(){var O=this._numFeatures,S=this._currentLInfo;this.layerName.innerHTML=S&&0!==O?S.featureLayer?S.featureLayer.name:"":this.NLS_noFeaturesSelected;a.set(this.attributeTable,"display",O?"":"none");a.set(this.editButtons,"display",O?"":"none");a.set(this.navButtons,"display",!this._hideNavButtons&&1<O?"":"none");this.navMessage.innerHTML=
e.substitute({idx:this._featureIdx+1,of:this.NLS_of,numFeatures:this._numFeatures},this._navMessage);this._attachmentEditor&&a.set(this._attachmentEditor.domNode,"display",S&&S.showAttachments&&O?"":"none");a.set(this.deleteBtn.domNode,"display",S&&!1===S.showDeleteButton||!this._canDelete?"none":"");this.domNode.parentNode&&0<this.domNode.parentNode.scrollTop&&(this.domNode.parentNode.scrollTop=0)},_onNextFeature:function(O){this._featureIdx+=O;0>this._featureIdx?this._featureIdx=this._numFeatures-
1:this._featureIdx>=this._numFeatures&&(this._featureIdx=0);O=this._selection.length?this._selection[this._featureIdx]:null;this._showFeature(O);this._updateUI();this.onNext(O)},_deleteFeature:function(){this.onDelete(this._currentFeature)},_showFeature:function(O,S){if(O){this._currentFeature=O;S=S?S:O.getLayer();var W=S.getEditCapabilities({feature:O,userId:this._userIds[S.id]});this._canUpdate=W.canUpdate;this._canDelete=W.canDelete;if(W=this._getLInfoFromFeatureLayer(S)){this._setCurrentLInfo(W);
var X=O.attributes,Y=this._findFirst(W.types,"id",X[W.typeIdField]),ba=null;J.forEach(W.fieldInfos,function(Z){ba=Z.field;var ca=[];Z.dijit&&1<Z.dijit.length?J.forEach(Z.dijit,function(aa){ca.push(aa)}):ca.push(Z.dijit);J.forEach(ca,I.hitch(this,function(aa){if(aa){var da=this._setFieldDomain(aa,Y,ba),ea=X[ba.name];ea=ea&&da&&da.codedValues&&da.codedValues.length?da.codedValues[ea]?da.codedValues[ea].name:ea:ea;e.isDefined(ea)||(ea="");"dijit.form.DateTextBox"===aa.declaredClass||"dijit.form.TimeTextBox"===
aa.declaredClass?ea=""===ea?null:new Date(ea):"dijit.form.FilteringSelect"===aa.declaredClass&&(aa._lastValueReported=null,ea=X[ba.name]+"");try{this._setValue(aa,ea),"dijit.form.FilteringSelect"===aa.declaredClass&&!1===aa.isValid()&&this._setValue(aa,null)}catch(fa){aa.set("displayedValue",this.NLS_errorInvalid,!1)}}}))},this);this._attachmentEditor&&W.showAttachments&&this._attachmentEditor.showAttachments(this._currentFeature,S);(O=S.getEditSummary(O))?(this.editorTrackingInfoDiv.innerHTML=O,
k.show(this.editorTrackingInfoDiv)):k.hide(this.editorTrackingInfoDiv)}}},_setFieldDomain:function(O,S,W){if(!O)return null;var X=W.domain;S&&S.domains&&S.domains[W.name]&&!1===S.domains[W.name]instanceof z&&(X=S.domains[W.name]);if(!X)return null;X.codedValues&&0<X.codedValues.length?(O.set("store",this._toStore(J.map(X.codedValues,function(Y){return{id:Y.code+"",name:Y.name}}))),this._setValue(O,X.codedValues[0].code+"")):(O.constraints={min:e.isDefined(X.minValue)?X.minValue:Number.MIN_VALUE,max:e.isDefined(X.maxValue)?
X.maxValue:Number.MAX_VALUE},this._setValue(O,O.constraints.min));return X},_setValue:function(O,S){O.set&&(O._onChangeActive=!1,O.set("value",S,!0),O._onChangeActive=!0)},_getFields:function(O){var S=O._getOutFields();if(!S)return null;O=O.fields;return"*"==S?O:J.filter(J.map(S,I.hitch(this,"_findFirst",O,"name")),e.isDefined)},_isInFields:function(O,S){return O&&(S||S.length)?J.some(S,function(W){return W.toLowerCase()===O.toLowerCase()}):!1},_isFieldNullable:function(O,S){return!(!1===O.nullable||
S.field&&!1===S.field.nullable)},_isFieldRequired:function(O,S){return!1!==O.editable&&!1!==S.isEditable&&!this._isFieldNullable(O,S)},_findFirst:function(O,S,W){return(O=J.filter(O,function(X){return X.hasOwnProperty(S)&&X[S]===W}))&&O.length?O[0]:null},_getLInfoFromFeatureLayer:function(O){return this._findFirst(this._layerInfos,"layerId",O?O.id:null)},_createTable:function(){this._destroyAttributeTable();this.attributeTable.innerHTML="";this._attributes=w.create("table",{cellspacing:"0",cellpadding:"0"},
this.attributeTable);var O=w.create("tbody",null,this._attributes),S=this._currentLInfo,W=this._findFirst(S.types,"id",this._currentFeature.attributes[S.typeIdField]);J.forEach(S.fieldInfos,I.hitch(this,"_createField",W,O),this);this._createOnlyFirstTime=!1},_createField:function(O,S,W){var X=this._currentLInfo,Y=W.field;if(!this._isInFields(Y.name,X.hideFields)&&!this._isInFields(Y.name,this._editorTrackingInfos[X.featureLayer.id])){var ba=!1,Z;S=w.create("tr",null,S);var ca=w.create("td",{innerHTML:W.label||
Y.alias||Y.name,"class":this.css.label,"data-fieldname":Y.name},S);this._isFieldRequired(Y,W)&&w.create("span",{"class":this.css.red,innerHTML:" *"},ca);S=w.create("td",null,S);if(W.customField){w.place(W.customField.domNode||W.customField,w.create("div",null,S),"first");var aa=W.customField}else if(!1===X.isEditable||!1===Y.editable||!1===W.isEditable||"esriFieldTypeOID"===Y.type||"esriFieldTypeGlobalID"===Y.type||!this._canUpdate&&!this._createOnlyFirstTime)ba=!0;X=X.typeIdField&&Y.name.toLowerCase()==
X.typeIdField.toLowerCase();ca=!!this._getDomainForField(Y,O);!aa&&X?aa=this._createTypeField(Y,W,S):!aa&&ca&&(aa=this._createDomainField(Y,W,O,S));if(!aa)switch(Y.type){case "esriFieldTypeString":aa=this._createStringField(Y,W,S);break;case "esriFieldTypeDate":aa=this._createDateField(Y,W,S);W.format&&W.format.time&&(Z=this._createTimeField(Y,W,S));break;case "esriFieldTypeInteger":case "esriFieldTypeSmallInteger":aa=this._createIntField(Y,W,S);break;case "esriFieldTypeSingle":case "esriFieldTypeDouble":aa=
this._createFltField(Y,W,S);break;default:aa=this._createStringField(Y,W,S)}W.tooltip&&W.tooltip.length&&this._toolTips.push(new F({connectId:[aa.id],label:W.tooltip}));aa.onChange=I.hitch(this,"onFieldValueChange",W);aa.set("disabled",ba);Z?(W.dijit=[aa,Z],Z.onChange=I.hitch(this,"onFieldValueChange",W),Z.set("disabled",ba)):W.dijit=aa}},_createTypeField:function(O,S,W){W=w.create("div",null,W);var X=O.domain;return X&&"range"===X.type&&X.minValue===X.maxValue?new t({"class":this.css.field,trim:!0,
maxLength:O.length,name:O.alias||O.name,required:this._isFieldRequired(O,S)},W):new N({"class":this.css.field,name:O.alias||O.name,required:this._isFieldRequired(O,S),store:this._toStore(J.map(this._currentLInfo.types,function(Y){return{id:Y.id,name:Y.name}})),searchAttr:"name"},W)},_getDomainForField:function(O,S){var W=O.domain;(O=O.name)&&S&&S.domains&&S.domains[O]&&!1===S.domains[O]instanceof z&&(W=S.domains[O]);return W||null},_createDomainField:function(O,S,W,X){W=this._getDomainForField(O,
W);X=w.create("div",null,X);return W.codedValues?new N({"class":this.css.field,name:O.alias||O.name,searchAttr:"name",required:this._isFieldRequired(O,S)},X):new p({"class":this.css.field},X)},_createStringField:function(O,S,W){W=w.create("div",null,W);var X={trim:!0,maxLength:O.length,required:this._isFieldRequired(O,S)};if(S.stringFieldOption===V.STRING_FIELD_OPTION_TEXTAREA)return X["class"]=this.css.field+" "+this.css.textArea,new r(X,W);if(S.stringFieldOption===V.STRING_FIELD_OPTION_RICHTEXT)return X["class"]=
this.css.field+" "+this.css.richText,X.height="100%",X.width="100%",X.plugins=S.richTextPlugins||this._defaultRichTextPlugins,W=new A(X,W),W.startup(),W;var Y=this;X.validator=function(ba,Z){this._maskValidSubsetError=!1;this._hasBeenBlurred=!0;return Y._isFieldNullable(O,S)||!(""===ba||null===ba)};return new t(X,W)},_createTimeField:function(O,S,W){W=w.create("div",null,W);O={"class":this.css.field,trim:!0,required:this._isFieldRequired(O,S),constraints:{formatLength:"medium"}};this._datePackage&&
(O.datePackage=this._datePackage);return new x(O,W)},_createDateField:function(O,S,W){W=w.create("div",null,W);O={"class":this.css.field,trim:!0,required:this._isFieldRequired(O,S)};this._datePackage&&(O.datePackage=this._datePackage);return new B(O,W)},_createIntField:function(O,S,W){W=w.create("div",null,W);return new T({"class":this.css.field,constraints:"esriFieldTypeSmallInteger"===O.type?{min:-32768,max:32767,places:0}:{places:0},trim:!0,invalidMessage:this.NLS_validationInt,required:this._isFieldRequired(O,
S)},W)},_createFltField:function(O,S,W){W=w.create("div",null,W);return new T({"class":this.css.field,constraints:{max:Infinity,min:-Infinity,places:"0,20"},trim:!0,invalidMessage:this.NLS_validationFlt,required:this._isFieldRequired(O,S)},W)},_toStore:function(O){return new K({data:{identifier:"id",label:"name",items:O}})},_connect:function(O,S,W){this._aiConnects.push(G.connect(O,S,W))},_getDatePackage:function(O){return null===O.datePackage?null:O.datePackage?O.datePackage:"ar"===d.locale?"dojox.date.islamic":
null},_destroyAttributeTable:function(){J.forEach(this._layerInfos,function(O){J.forEach(O.fieldInfos,function(S){var W=S.dijit;if(W){W._onChangeHandle=null;if(S.customField)return;W instanceof Array?J.forEach(W,I.hitch(this,function(X){X.destroyRecursive?X.destroyRecursive():X.destroy&&X.destroy();X._onChangeHandle=null})):W.destroyRecursive?W.destroyRecursive():W.destroy&&W.destroy()}S.dijit=null},this)},this);J.forEach(this._toolTips,function(O){O.destroy()});this._toolTips=[];this._attributes&&
w.destroy(this._attributes)}});I.mixin(V,{STRING_FIELD_OPTION_RICHTEXT:"richtext",STRING_FIELD_OPTION_TEXTAREA:"textarea",STRING_FIELD_OPTION_TEXTBOX:"textbox"});c("extend-esri")&&I.setObject("dijit.AttributeInspector",V,q);return V})},"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(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v,b,D){function h(H){return new A({command:H.name})}function B(H){return new A({buttonClass:C,command:H.name})}J=J("dijit.Editor",b,{plugins:null,extraPlugins:null,constructor:function(){e.isArray(this.plugins)||(this.plugins=["undo","redo","|","cut","copy","paste","|","bold","italic","underline","strikethrough","|","insertOrderedList","insertUnorderedList","indent","outdent","|","justifyLeft","justifyRight","justifyCenter","justifyFull",L]);this._plugins=
[];this._editInterval=1E3*this.editActionInterval;if(k("ie")||k("trident")||k("edge"))this.events.push("onBeforeDeactivate"),this.events.push("onBeforeActivate")},postMixInProperties:function(){this.setValueDeferred=new G;this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this._steps=this._steps.slice(0);this._undoedSteps=this._undoedSteps.slice(0);e.isArray(this.extraPlugins)&&(this.plugins=this.plugins.concat(this.extraPlugins));this.commands=u.getLocalization("dijit._editor",
"commands",this.lang);k("webkit")&&w.set(this.domNode,"KhtmlUserSelect","none")},startup:function(){this.inherited(arguments);this.toolbar||(this.toolbar=new g({ownerDocument:this.ownerDocument,dir:this.dir,lang:this.lang,"aria-label":this.id}),this.header.appendChild(this.toolbar.domNode));I.forEach(this.plugins,this.addPlugin,this);this.setValueDeferred.resolve(!0);c.add(this.iframe.parentNode,"dijitEditorIFrameContainer");c.add(this.iframe,"dijitEditorIFrame");d.set(this.iframe,"allowTransparency",
!0);this.toolbar.startup();this.onNormalizedDisplayChanged()},destroy:function(){I.forEach(this._plugins,function(H){H&&H.destroy&&H.destroy()});this._plugins=[];this.toolbar.destroyRecursive();delete this.toolbar;this.inherited(arguments)},addPlugin:function(H,T){var N=e.isString(H)?{name:H}:e.isFunction(H)?{ctor:H}:H;if(!N.setEditor){var p={args:N,plugin:null,editor:this};N.name&&(A.registry[N.name]?p.plugin=A.registry[N.name](N):f.publish(D._scopeName+".Editor.getPlugin",p));if(!p.plugin)try{var E=
N.ctor||e.getObject(N.name)||Q(N.name);E&&(p.plugin=new E(N))}catch(r){throw Error(this.id+": cannot find plugin ["+N.name+"]");}if(!p.plugin)throw Error(this.id+": cannot find plugin ["+N.name+"]");H=p.plugin}1<arguments.length?this._plugins[T]=H:this._plugins.push(H);H.setEditor(this);e.isFunction(H.setToolbar)&&H.setToolbar(this.toolbar)},resize:function(H){H&&l.prototype.resize.apply(this,arguments)},layout:function(){var H=this._contentBox.h-(this.getHeaderHeight()+this.getFooterHeight()+a.getPadBorderExtents(this.iframe.parentNode).h+
a.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 T,N=this.document.body,p=N.clientWidth,E=N.clientHeight,r=N.clientLeft,t=N.offsetWidth,x=N.offsetHeight,F=N.offsetLeft;/^rtl$/i.test(N.dir||"")?p<t&&H.x>p&&H.x<t&&(T=!0):H.x<r&&H.x>F&&(T=!0);T||E<x&&H.y>E&&H.y<x&&(T=!0);T||(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 T=this.inherited(arguments);this.customUndo&&this._endEditing();return T}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 T=this.document.execCommand(H,!1,null);if(k("webkit")&&!T)throw{};}catch(N){T=z.substitute,alert(T(this.commands.systemShortcut,
[this.commands[H],T(this.commands[k("mac")?"appleKey":"ctrlKey"],[{cut:"X",copy:"C",paste:"V"}[H]])])),T=!1}return T},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 T=H.mark,N=H.mark;H=H.isCollapsed;var p;if(N)if(9>k("ie")||9===k("ie")&&k("quirks"))if(e.isArray(N))T=[],I.forEach(N,function(t){T.push(v.getNode(t,this.editNode))},this),this.selection.moveToBookmark({mark:T,
isCollapsed:H});else{if(N.startContainer&&N.endContainer&&(p=v.getSelection(this.window))&&p.removeAllRanges){p.removeAllRanges();H=v.create(this.window);var E=v.getNode(N.startContainer,this.editNode);var r=v.getNode(N.endContainer,this.editNode);E&&r&&(H.setStart(E,N.startOffset),H.setEnd(r,N.endOffset),p.addRange(H))}}else(p=v.getSelection(this.window))&&p.removeAllRanges&&(p.removeAllRanges(),H=v.create(this.window),E=v.getNode(N.startContainer,this.editNode),r=v.getNode(N.endContainer,this.editNode),
E&&r&&(H.setStart(E,N.startOffset),H.setEnd(r,N.endOffset),p.addRange(H)))},_changeToStep:function(H,T){this.setValue(T.text);(H=T.bookmark)&&this._moveToBookmark(H)},undo:function(){var H=!1;if(!this._undoRedoActive){this._undoRedoActive=!0;this.endEditing(!0);var T=this._steps.pop();T&&0<this._steps.length&&(this.focus(),this._changeToStep(T,this._steps[this._steps.length-1]),this._undoedSteps.push(T),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 T=this._undoedSteps.pop();T&&0<this._steps.length&&(this.focus(),this._changeToStep(this._steps[this._steps.length-1],T),this._steps.push(T),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(),
T=[];if(H&&H.mark){var N=H.mark;if(9>k("ie")||9===k("ie")&&k("quirks")){var p=v.getSelection(this.window);if(e.isArray(N))I.forEach(H.mark,function(r){T.push(v.getIndex(r,this.editNode).o)},this),H.mark=T;else if(p){var E;p.rangeCount&&(E=p.getRangeAt(0));H.mark=E?E.cloneRange():this.selection.getBookmark()}}try{H.mark&&H.mark.startContainer&&(T=v.getIndex(H.mark.startContainer,this.editNode).o,H.mark={startContainer:T,startOffset:H.mark.startOffset,endContainer:H.mark.endContainer===H.mark.startContainer?
T:v.getIndex(H.mark.endContainer,this.editNode).o,endOffset:H.mark.endOffset})}catch(r){H.mark=null}}return H},_beginEditing:function(){0===this._steps.length&&this._steps.push({text:y.getChildrenHtml(this.editNode),bookmark:this._getBookmark()})},_endEditing:function(){var H=y.getChildrenHtml(this.editNode);this._undoedSteps=[];this._steps.push({text:H,bookmark:this._getBookmark()})},onKeyDown:function(H){k("ie")||this.iframe||H.keyCode!=q.TAB||this.tabIndent||this._saveSelection();if(this.customUndo){var T=
H.keyCode;if(H.ctrlKey&&!H.shiftKey&&!H.altKey){if(90==T||122==T){H.stopPropagation();H.preventDefault();this.undo();return}if(89==T||121==T){H.stopPropagation();H.preventDefault();this.redo();return}}this.inherited(arguments);switch(T){case q.ENTER:case q.BACKSPACE:case q.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<q.F1||H.keyCode>q.F15)){this.beginEditing();break}case q.ALT:this.endEditing();break;case q.UP_ARROW:case q.DOWN_ARROW:case q.LEFT_ARROW:case q.RIGHT_ARROW:case q.HOME:case q.END:case q.PAGE_UP:case q.PAGE_DOWN:this.endEditing(!0);case q.CTRL:case q.SHIFT:case q.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(e.hitch(this,function(){!this.disabled&&H||!this._buttonEnabledPlugins&&H?
I.forEach(this._plugins,function(T){T.set("disabled",!0)}):this.disabled&&!H&&I.forEach(this._plugins,function(T){T.set("disabled",!1)})}));this.inherited(arguments)},_setStateClass:function(){try{this.inherited(arguments),this.document&&this.document.body&&(w.set(this.document.body,"color",w.get(this.iframe,"color")),w.set(this.document.body,"background-color",w.get(this.iframe,"background-color")))}catch(H){}}});e.mixin(A.registry,{undo:h,redo:h,cut:h,copy:h,paste:h,insertOrderedList:h,insertUnorderedList:h,
indent:h,outdent:h,justifyCenter:h,justifyFull:h,justifyLeft:h,justifyRight:h,"delete":h,selectAll:h,removeFormat:h,unlink:h,insertHorizontalRule:h,bold:B,italic:B,underline:B,strikethrough:B,subscript:B,superscript:B,"|":function(){return new A({setEditor:function(H){this.editor=H;this.button=new m({ownerDocument:H.ownerDocument})}})}});return J})},"dijit/Toolbar":function(){define("require dojo/_base/declare dojo/has dojo/keys dojo/ready ./_Widget ./_KeyNavContainer ./_TemplatedMixin".split(" "),
function(Q,I,J,G,u,d,c,a){J("dijit-legacy-requires")&&u(0,function(){Q(["dijit/ToolbarSeparator"])});return I("dijit.Toolbar",[d,a,c],{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(Q,I,J,G){return Q("dijit.ToolbarSeparator",[J,G],{templateString:'\x3cdiv class\x3d"dijitToolbarSeparator dijitInline" role\x3d"presentation"\x3e\x3c/div\x3e',buildRendering:function(){this.inherited(arguments);I.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(Q,I,J,G,u){I=I("dijit._editor._Plugin",G,{constructor:function(d){this.params=
d||{};J.mixin(this,this.params);this._attrPairNames={}},editor:null,iconClassPrefix:"dijitEditorIcon",button:null,command:"",useDefaultCommand:!0,buttonClass:u,disabled:!1,getLabel:function(d){return this.editor.commands[d]},_initButton:function(){if(this.command.length){var d=this.getLabel(this.command),c=this.editor,a=this.iconClassPrefix+" "+this.iconClassPrefix+this.command.charAt(0).toUpperCase()+this.command.substr(1);this.button||(d=J.mixin({label:d,ownerDocument:c.ownerDocument,dir:c.dir,
lang:c.lang,showLabel:!1,iconClass:a,dropDown:this.dropDown,tabIndex:"-1"},this.params||{}),delete d.name,this.button=new this.buttonClass(d))}this.get("disabled")&&this.button&&this.button.set("disabled",this.get("disabled"))},destroy:function(){this.dropDown&&this.dropDown.destroyRecursive();this.inherited(arguments)},connect:function(d,c,a){this.own(Q.connect(d,c,this,a))},updateState:function(){var d=this.editor,c=this.command;if(d&&d.isLoaded&&c.length){var a=this.get("disabled");if(this.button)try{var w=
d._implCommand(c);var q=!a&&(this[w]?this[w](c):d.queryCommandEnabled(c));this.enabled!==q&&(this.enabled=q,this.button.set("disabled",!q));if(q&&"boolean"==typeof this.button.checked){var e=d.queryCommandState(c);this.checked!==e&&(this.checked=e,this.button.set("checked",d.queryCommandState(c)))}}catch(k){console.log(k)}}},setEditor:function(d){this.editor=d;this._initButton();this.button&&this.useDefaultCommand&&(this.editor.queryCommandAvailable(this.command)?this.own(this.button.on("click",J.hitch(this.editor,
"execCommand",this.command,this.commandArg))):this.button.domNode.style.display="none");this.own(this.editor.on("NormalizedDisplayChanged",J.hitch(this,"updateState")))},setToolbar:function(d){this.button&&d.addChild(this.button)},set:function(d,c){if("object"===typeof d){for(var a in d)this.set(a,d[a]);return this}a=this._getAttrNames(d);if(this[a.s])var w=this[a.s].apply(this,Array.prototype.slice.call(arguments,1));else this._set(d,c);return w||this},get:function(d){var c=this._getAttrNames(d);
return this[c.g]?this[c.g]():this[d]},_setDisabledAttr:function(d){this._set("disabled",d);this.updateState()},_getAttrNames:function(d){var c=this._attrPairNames;if(c[d])return c[d];var a=d.charAt(0).toUpperCase()+d.substr(1);return c[d]={s:"_set"+a+"Attr",g:"_get"+a+"Attr"}},_set:function(d,c){this[d]=c}});I.registry={};return I})},"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(Q,I,J,G,u,d,c,a,w,q,e){return Q("dijit._editor.plugins.EnterKeyHandling",w,{blockNodeForEnter:"BR",constructor:function(k){k&&("blockNodeForEnter"in k&&(k.blockNodeForEnter=k.blockNodeForEnter.toUpperCase()),G.mixin(this,k))},setEditor:function(k){if(this.editor!==k)if(this.editor=k,"BR"==this.blockNodeForEnter)this.editor.customUndo=!0,k.onLoadDeferred.then(G.hitch(this,function(f){this.own(u(k.document,"keydown",G.hitch(this,function(n){if(n.keyCode==J.ENTER){var g=G.mixin({},n);g.shiftKey=
!0;this.handleEnterKey(g)||(n.stopPropagation(),n.preventDefault())}})));9<=d("ie")&&10>=d("ie")&&this.own(u(k.document,"paste",G.hitch(this,function(n){setTimeout(G.hitch(this,function(){var g=this.editor.document.selection.createRange();g.move("character",-1);g.select();g.move("character",1);g.select()}),0)})));return f}));else if(this.blockNodeForEnter){var z=G.hitch(this,"handleEnterKey");k.addKeyHandler(13,0,0,z);k.addKeyHandler(13,0,1,z);this.own(this.editor.on("KeyPressed",G.hitch(this,"onKeyPressed")))}},
onKeyPressed:function(){if(this._checkListLater){if(this.editor.selection.isCollapsed()){var k=this.editor.selection.getAncestorElement("LI");if(k){d("mozilla")&&"LI"==k.parentNode.parentNode.nodeName&&(k=k.parentNode.parentNode);var z=k.firstChild;!z||1!=z.nodeType||"UL"!=z.nodeName&&"OL"!=z.nodeName||(k.insertBefore(z.ownerDocument.createTextNode("\u00a0"),z),z=e.create(this.editor.window),z.setStart(k.firstChild,0),k=e.getSelection(this.editor.window,!0),k.removeAllRanges(),k.addRange(z))}else q.prototype.execCommand.call(this.editor,
"formatblock",this.blockNodeForEnter),(k=this.editor.selection.getAncestorElement(this.blockNodeForEnter))?(k.innerHTML=this.bogusHtmlContent,9>=d("ie")&&(k=this.editor.document.selection.createRange(),k.move("character",-1),k.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(k){var z,f=this.editor.document,n;if(k.shiftKey){k=this.editor.selection.getParentElement();if(z=e.getAncestor(k,this.blockNodes)){if("LI"==z.tagName)return!0;k=e.getSelection(this.editor.window);var g=k.getRangeAt(0);g.collapsed||(g.deleteContents(),k=e.getSelection(this.editor.window),g=k.getRangeAt(0));if(e.atBeginningOfContainer(z,g.startContainer,g.startOffset)){var m=f.createElement("br");g=e.create(this.editor.window);z.insertBefore(m,
z.firstChild);g.setStartAfter(m);k.removeAllRanges();k.addRange(g)}else if(e.atEndOfContainer(z,g.startContainer,g.startOffset))g=e.create(this.editor.window),m=f.createElement("br"),z.appendChild(m),z.appendChild(f.createTextNode("\u00a0")),g.setStart(z.lastChild,0),k.removeAllRanges(),k.addRange(g);else{if((n=g.startContainer)&&3==n.nodeType){var l=n.nodeValue;var C=f.createTextNode(l.substring(0,g.startOffset));var A=f.createTextNode(l.substring(g.startOffset));z=f.createElement("br");""==A.nodeValue&&
d("webkit")&&(A=f.createTextNode("\u00a0"));I.place(C,n,"after");I.place(z,C,"after");I.place(A,z,"after");I.destroy(n);g=e.create(this.editor.window);g.setStart(A,0);k.removeAllRanges();k.addRange(g);return!1}return!0}}else k=e.getSelection(this.editor.window),k.rangeCount?(g=k.getRangeAt(0))&&g.startContainer&&(g.collapsed||(g.deleteContents(),k=e.getSelection(this.editor.window),g=k.getRangeAt(0)),(n=g.startContainer)&&3==n.nodeType?(z=g.startOffset,n.length<z&&(A=this._adjustNodeAndOffset(n,z),
n=A.node,z=A.offset),l=n.nodeValue,C=f.createTextNode(l.substring(0,z)),A=f.createTextNode(l.substring(z)),z=f.createElement("br"),A.length||(A=f.createTextNode("\u00a0")),C.length?I.place(C,n,"after"):C=n,I.place(z,C,"after"),I.place(A,z,"after"),I.destroy(n)):(0<=g.startOffset&&(m=n.childNodes[g.startOffset]),z=f.createElement("br"),A=f.createTextNode("\u00a0"),m?(I.place(z,m,"before"),I.place(A,z,"after")):(n.appendChild(z),n.appendChild(A))),g=e.create(this.editor.window),g.setStart(A,0),g.setEnd(A,
A.length),k.removeAllRanges(),k.addRange(g),this.editor.selection.collapse(!0)):q.prototype.execCommand.call(this.editor,"inserthtml","\x3cbr\x3e");return!1}var L=!0;k=e.getSelection(this.editor.window);g=k.getRangeAt(0);g.collapsed||(g.deleteContents(),k=e.getSelection(this.editor.window),g=k.getRangeAt(0));m=e.getBlockAncestor(g.endContainer,null,this.editor.editNode);var y=m.blockNode;if(this._checkListLater=y&&("LI"==y.nodeName||"LI"==y.parentNode.nodeName))return d("mozilla")&&(this._pressedEnterInBlock=
y),/^(\s|&nbsp;|&#160;|\xA0|<span\b[^>]*\bclass=['"]Apple-style-span['"][^>]*>(\s|&nbsp;|&#160;|\xA0)<\/span>)?(<br>)?$/.test(y.innerHTML)&&(y.innerHTML="",d("webkit")&&(g=e.create(this.editor.window),g.setStart(y,0),k.removeAllRanges(),k.addRange(g)),this._checkListLater=!1),!0;if(!m.blockNode||m.blockNode===this.editor.editNode){try{q.prototype.execCommand.call(this.editor,"formatblock",this.blockNodeForEnter)}catch(v){}m={blockNode:this.editor.selection.getAncestorElement(this.blockNodeForEnter),
blockContainer:this.editor.editNode};if(m.blockNode){if(m.blockNode!=this.editor.editNode&&!(m.blockNode.textContent||m.blockNode.innerHTML).replace(/^\s+|\s+$/g,"").length)return this.removeTrailingBr(m.blockNode),!1}else m.blockNode=this.editor.editNode;k=e.getSelection(this.editor.window);g=k.getRangeAt(0)}y=f.createElement(this.blockNodeForEnter);y.innerHTML=this.bogusHtmlContent;this.removeTrailingBr(m.blockNode);A=g.endOffset;L=g.endContainer;L.length<A&&(A=this._adjustNodeAndOffset(L,A),L=
A.node,A=A.offset);if(e.atEndOfContainer(m.blockNode,L,A))m.blockNode===m.blockContainer?m.blockNode.appendChild(y):I.place(y,m.blockNode,"after"),L=!1,g=e.create(this.editor.window),g.setStart(y,0),k.removeAllRanges(),k.addRange(g),this.editor.height&&a.scrollIntoView(y);else if(e.atBeginningOfContainer(m.blockNode,g.startContainer,g.startOffset))I.place(y,m.blockNode,m.blockNode===m.blockContainer?"first":"before"),y.nextSibling&&this.editor.height&&(g=e.create(this.editor.window),g.setStart(y.nextSibling,
0),k.removeAllRanges(),k.addRange(g),a.scrollIntoView(y.nextSibling)),L=!1;else{m.blockNode===m.blockContainer?m.blockNode.appendChild(y):I.place(y,m.blockNode,"after");L=!1;m.blockNode.style&&y.style&&m.blockNode.style.cssText&&(y.style.cssText=m.blockNode.style.cssText);if((n=g.startContainer)&&3==n.nodeType){A=g.endOffset;n.length<A&&(A=this._adjustNodeAndOffset(n,A),n=A.node,A=A.offset);l=n.nodeValue;C=f.createTextNode(l.substring(0,A));A=f.createTextNode(l.substring(A,l.length));I.place(C,n,
"before");I.place(A,n,"after");I.destroy(n);for(g=C.parentNode;g!==m.blockNode;){l=f.createElement(g.tagName);g.style&&l.style&&g.style.cssText&&(l.style.cssText=g.style.cssText);"FONT"===g.tagName&&(g.color&&(l.color=g.color),g.face&&(l.face=g.face),g.size&&(l.size=g.size));for(;A;)n=A.nextSibling,l.appendChild(A),A=n;I.place(l,g,"after");C=g;A=l;g=g.parentNode}if(1==A.nodeType||3==A.nodeType&&A.nodeValue)y.innerHTML="";for(C=A;A;)n=A.nextSibling,y.appendChild(A),A=n}g=e.create(this.editor.window);
f=C;if("BR"!==this.blockNodeForEnter){for(;f;)z=f,f=n=f.firstChild;z&&z.parentNode?(y=z.parentNode,g.setStart(y,0),k.removeAllRanges(),k.addRange(g),this.editor.height&&a.scrollIntoView(y),d("mozilla")&&(this._pressedEnterInBlock=m.blockNode)):L=!0}else g.setStart(y,0),k.removeAllRanges(),k.addRange(g),this.editor.height&&a.scrollIntoView(y),d("mozilla")&&(this._pressedEnterInBlock=m.blockNode)}return L},_adjustNodeAndOffset:function(k,z){for(;k.length<z&&k.nextSibling&&3==k.nextSibling.nodeType;)z-=
k.length,k=k.nextSibling;return{node:k,offset:z}},removeTrailingBr:function(k){if(k=/P|DIV|LI/i.test(k.tagName)?k:this.editor.selection.getParentOfType(k,["P","DIV","LI"]))k.lastChild&&(1<k.childNodes.length&&3==k.lastChild.nodeType&&/^[\s\xAD]*$/.test(k.lastChild.nodeValue)||"BR"==k.lastChild.tagName)&&I.destroy(k.lastChild),k.childNodes.length||(k.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(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v,b,D,h,B,H,T){var N=J("dijit._editor.RichText",[v,b],{constructor:function(p){this.contentPreFilters=[];this.contentPostFilters=[];this.contentDomPreFilters=[];this.contentDomPostFilters=[];this.editingAreaStyleSheets=[];this.events=[].concat(this.events);this._keyHandlers={};p&&z.isString(p.value)&&(this.value=p.value);this.onLoadDeferred=new G},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=[z.trim,z.hitch(this,"_preFixUrlAttributes")].concat(this.contentPreFilters);m("mozilla")&&(this.contentPreFilters=[this._normalizeFontStyle].concat(this.contentPreFilters),
this.contentPostFilters=[this._removeMozBogus].concat(this.contentPostFilters));m("webkit")&&(this.contentPreFilters=[this._removeWebkitBogus].concat(this.contentPreFilters),this.contentPostFilters=[this._removeWebkitBogus].concat(this.contentPostFilters));if(m("ie")||m("trident"))this.contentPostFilters=[this._normalizeFontStyle].concat(this.contentPostFilters),this.contentDomPostFilters=[z.hitch(this,"_stripBreakerNodes")].concat(this.contentDomPostFilters);this.contentDomPostFilters=[z.hitch(this,
"_stripTrailingEmptyNodes")].concat(this.contentDomPostFilters);this.inherited(arguments);C.publish(T._scopeName+"._editor.RichText::init",this)},startup:function(){this.inherited(arguments);this.open();this.setupDefaultShortcuts()},setupDefaultShortcuts:function(){var p=z.hitch(this,function(t,x){return function(){return!this.execCommand(t,x)}}),E={b:p("bold"),i:p("italic"),u:p("underline"),a:p("selectall"),s:function(){this.save(!0)},m:function(){this.isTabIndent=!this.isTabIndent},1:p("formatblock",
"h1"),2:p("formatblock","h2"),3:p("formatblock","h3"),4:p("formatblock","h4"),"\\":p("insertunorderedlist")};m("ie")||(E.Z=p("redo"));for(var r in E)this.addKeyHandler(r,!0,!1,E[r])},events:["onKeyDown","onKeyUp"],captureEvents:[],_editorCommandsLocalized:!1,_localizeEditorCommands:function(){if(N._editorCommandsLocalized)this._local2NativeFormatNames=N._local2NativeFormatNames,this._native2LocalFormatNames=N._native2LocalFormatNames;else{N._editorCommandsLocalized=!0;N._local2NativeFormatNames={};
N._native2LocalFormatNames={};this._local2NativeFormatNames=N._local2NativeFormatNames;this._native2LocalFormatNames=N._native2LocalFormatNames;for(var p="div p pre h1 h2 h3 h4 h5 h6 ol ul address".split(" "),E="",r,t=0;r=p[t++];)E="l"!==r.charAt(1)?E+("\x3c"+r+"\x3e\x3cspan\x3econtent\x3c/span\x3e\x3c/"+r+"\x3e\x3cbr/\x3e"):E+("\x3c"+r+"\x3e\x3cli\x3econtent\x3c/li\x3e\x3c/"+r+"\x3e\x3cbr/\x3e");var x=a.create("div",{style:{position:"absolute",top:"0px",zIndex:10,opacity:.01},innerHTML:E});this.ownerDocumentBody.appendChild(x);
p=z.hitch(this,function(){for(var F=x.firstChild;F;)try{this.selection.selectElement(F.firstChild);var K=F.tagName.toLowerCase();this._local2NativeFormatNames[K]=document.queryCommandValue("formatblock");this._native2LocalFormatNames[this._local2NativeFormatNames[K]]=K;F=F.nextSibling.nextSibling}catch(R){}a.destroy(x)});this.defer(p)}},open:function(p){if(!this.onLoadDeferred||0<=this.onLoadDeferred.fired)this.onLoadDeferred=new G;this.isClosed||this.close();C.publish(T._scopeName+"._editor.RichText::open",
this);1===arguments.length&&p.nodeName&&(this.domNode=p);var E=this.domNode;if(z.isString(this.value)){var r=this.value;E.innerHTML=""}else if(E.nodeName&&"textarea"==E.nodeName.toLowerCase()){var t=this.textarea=E;this.name=t.name;r=t.value;E=this.domNode=this.ownerDocument.createElement("div");E.setAttribute("widgetId",this.id);t.removeAttribute("widgetId");E.cssText=t.cssText;E.className+=" "+t.className;a.place(E,t,"before");var x=z.hitch(this,function(){q.set(t,{display:"block",position:"absolute",
top:"-1000px"});if(m("ie")){var U=t.style;this.__overflow=U.overflow;U.overflow="hidden"}});m("ie")?this.defer(x,10):x();if(t.form){var F=t.value;this.reset=function(){this.getValue()!==F&&this.replaceValue(F)};f(t.form,"submit",z.hitch(this,function(){d.set(t,"disabled",this.disabled);t.value=this.getValue()}))}}else r=B.getChildrenHtml(E),E.innerHTML="";this.value=r;E.nodeName&&"LI"===E.nodeName&&(E.innerHTML=" \x3cbr\x3e");this.header=E.ownerDocument.createElement("div");E.appendChild(this.header);
this.editingArea=E.ownerDocument.createElement("div");E.appendChild(this.editingArea);this.footer=E.ownerDocument.createElement("div");E.appendChild(this.footer);this.name||(this.name=this.id+"_AUTOGEN");if(""!==this.name&&(!I.useXDomain||I.allowXdRichTextSave)){if((r=u.byId(T._scopeName+"._editor.RichText.value"))&&""!==r.value){x=r.value.split(this._SEPARATOR);for(var K=0,R;R=x[K++];)if(R=R.split(this._NAME_CONTENT_SEP),R[0]===this.name){this.value=R[1];x=x.splice(K,1);r.value=x.join(this._SEPARATOR);
break}}N._globalSaveHandler||(N._globalSaveHandler={},A.addOnUnload(function(){for(var U in N._globalSaveHandler){var M=N._globalSaveHandler[U];z.isFunction(M)&&M()}}));N._globalSaveHandler[this.id]=z.hitch(this,"_saveContent")}this.isClosed=!1;r=this.editorObject=this.iframe=this.ownerDocument.createElement("iframe");r.id=this.id+"_iframe";r.style.border="none";r.style.width="100%";this._layoutMode?r.style.height="100%":7<=m("ie")?(this.height&&(r.style.height=this.height),this.minHeight&&(r.style.minHeight=
this.minHeight)):r.style.height=this.height?this.height:this.minHeight;r.frameBorder=0;r._loadFunc=z.hitch(this,function(U){this.window=U;this.document=U.document;this.selection=new D.SelectionManager(U);m("ie")&&this._localizeEditorCommands();this.onLoad(this.get("value"))});x=this._getIframeDocTxt().replace(/\\/g,"\\\\").replace(/'/g,"\\'");x=11>m("ie")?'javascript:document.open();try{parent.window;}catch(e){document.domain\x3d"'+document.domain+"\";}document.write('"+x+"');document.close()":"javascript: '"+
x+"'";this.editingArea.appendChild(r);r.src=x;"LI"===E.nodeName&&(E.lastChild.style.marginTop="-1.2em");c.add(this.domNode,this.baseClass)},_local2NativeFormatNames:{},_native2LocalFormatNames:{},_getIframeDocTxt:function(){var p=q.getComputedStyle(this.domNode);if(this["aria-label"])var E=this["aria-label"];else{var r=n('label[for\x3d"'+this.id+'"]',this.ownerDocument)[0]||u.byId(this["aria-labelledby"],this.ownerDocument);r&&(E=r.textContent||r.innerHTML||"")}r="\x3cdiv id\x3d'dijitEditorBody' role\x3d'textbox' aria-multiline\x3d'true' "+
(E?" aria-label\x3d'"+l.escape(E)+"'":"")+"\x3e\x3c/div\x3e";var t=[p.fontWeight,p.fontSize,p.fontFamily].join(" "),x=p.lineHeight;x=0<=x.indexOf("px")?parseFloat(x)/parseFloat(p.fontSize):0<=x.indexOf("em")?parseFloat(x):"normal";var F="",K=this;this.style.replace(/(^|;)\s*(line-|font-?)[^;]+/ig,function(R){R=R.replace(/^;/ig,"")+";";var U=R.split(":")[0];if(U){U=z.trim(U);U=U.toLowerCase();var M,P="";for(M=0;M<U.length;M++){var V=U.charAt(M);switch(V){case "-":M++,V=U.charAt(M).toUpperCase();default:P+=
V}}q.set(K.domNode,P,"")}F+=R+";"});this.iframe.setAttribute("title",E);return["\x3c!DOCTYPE html\x3e","\x3chtml lang\x3d'"+(this.lang||e.locale.replace(/-.*/,""))+"'"+(this.isLeftToRight()?"":" dir\x3d'rtl'")+"\x3e\n","\x3chead\x3e\n\x3cmeta http-equiv\x3d'Content-Type' content\x3d'text/html'\x3e\n",E?"\x3ctitle\x3e"+l.escape(E)+"\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:",t,";\n",this.height||m("opera")?"":"\t\tposition: fixed;\n","\t\tline-height:",x,";\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",m("ie")||m("trident")||m("edge")?"":"\tli{ min-height:1.2em; }\n",
"\x3c/style\x3e\n",this._applyEditingAreaStyleSheets(),"\n\x3c/head\x3e\n\x3cbody role\x3d'application'",E?" aria-label\x3d'"+l.escape(E)+"'":"","onload\x3d'try{frameElement \x26\x26 frameElement._loadFunc(window,document)}catch(e){document.domain\x3d\""+document.domain+"\";frameElement._loadFunc(window,document)}' ","style\x3d'"+F+"'\x3e",r,"\x3c/body\x3e\n\x3c/html\x3e"].join("")},_applyEditingAreaStyleSheets:function(){var p=[];this.styleSheets&&(p=this.styleSheets.split(";"),this.styleSheets=
"");p=p.concat(this.editingAreaStyleSheets);this.editingAreaStyleSheets=[];for(var E="",r=0,t,x=y.get(this.ownerDocument);t=p[r++];)t=(new L(x.location,t)).toString(),this.editingAreaStyleSheets.push(t),E+='\x3clink rel\x3d"stylesheet" type\x3d"text/css" href\x3d"'+t+'"/\x3e';return E},addStyleSheet:function(p){var E=p.toString(),r=y.get(this.ownerDocument);if("."===E.charAt(0)||"/"!==E.charAt(0)&&!p.host)E=(new L(r.location,E)).toString();-1<Q.indexOf(this.editingAreaStyleSheets,E)||(this.editingAreaStyleSheets.push(E),
this.onLoadDeferred.then(z.hitch(this,function(){if(this.document.createStyleSheet)this.document.createStyleSheet(E);else{var t=this.document.getElementsByTagName("head")[0],x=this.document.createElement("link");x.rel="stylesheet";x.type="text/css";x.href=E;t.appendChild(x)}})))},removeStyleSheet:function(p){var E=p.toString(),r=y.get(this.ownerDocument);if("."===E.charAt(0)||"/"!==E.charAt(0)&&!p.host)E=(new L(r.location,E)).toString();p=Q.indexOf(this.editingAreaStyleSheets,E);-1!==p&&(delete this.editingAreaStyleSheets[p],
n('link[href\x3d"'+E+'"]',this.window.document).orphan())},disabled:!1,_mozSettingProps:{styleWithCSS:!1},_setDisabledAttr:function(p){p=!!p;this._set("disabled",p);if(this.isLoaded){var E=m("ie")&&(this.isLoaded||!this.focusOnLoad);E&&(this.editNode.unselectable="on");this.editNode.contentEditable=!p;this.editNode.tabIndex=p?"-1":this.tabIndex;E&&this.defer(function(){this.editNode&&(this.editNode.unselectable="off")});if(m("mozilla")&&!p&&this._mozSettingProps){p=this._mozSettingProps;for(var r in p)if(p.hasOwnProperty(r))try{this.document.execCommand(r,
!1,p[r])}catch(t){}}this._disabledOK=!0}},onLoad:function(p){this.window.__registeredWindow||(this.window.__registeredWindow=!0,this._iframeRegHandle=H.registerIframe(this.iframe));this.editNode=this.document.body.firstChild;var E=this;this.beforeIframeNode=a.place("\x3cdiv tabIndex\x3d-1\x3e\x3c/div\x3e",this.iframe,"before");this.afterIframeNode=a.place("\x3cdiv tabIndex\x3d-1\x3e\x3c/div\x3e",this.iframe,"after");this.iframe.onfocus=this.document.onfocus=function(){E.editNode.focus()};this.focusNode=
this.editNode;var r=this.events.concat(this.captureEvents),t=this.iframe?this.document:this.editNode;this.own.apply(this,Q.map(r,function(x){var F=x.toLowerCase().replace(/^on/,"");return f(t,F,z.hitch(this,x))},this));this.own(f(t,"mouseup",z.hitch(this,"onClick")));m("ie")&&(this.own(f(this.document,"mousedown",z.hitch(this,"_onIEMouseDown"))),this.editNode.style.zoom=1);m("webkit")&&(this._webkitListener=this.own(f(this.document,"mouseup",z.hitch(this,"onDisplayChanged")))[0],this.own(f(this.document,
"mousedown",z.hitch(this,function(x){x=x.target;!x||x!==this.document.body&&x!==this.document||this.defer("placeCursorAtEnd")}))));if(m("ie"))try{this.document.execCommand("RespectVisibilityInDesign",!0,null)}catch(x){}this.isLoaded=!0;this.set("disabled",this.disabled);r=z.hitch(this,function(){this.setValue(p);this.onLoadDeferred&&!this.onLoadDeferred.isFulfilled()&&this.onLoadDeferred.resolve(!0);this.onDisplayChanged();this.focusOnLoad&&g(z.hitch(this,"defer","focus",this.updateInterval));this.value=
this.getValue(!0)});this.setValueDeferred?this.setValueDeferred.then(r):r()},onKeyDown:function(p){if(p.keyCode===k.SHIFT||p.keyCode===k.ALT||p.keyCode===k.META||p.keyCode===k.CTRL)return!0;p.keyCode===k.TAB&&this.isTabIndent&&(p.stopPropagation(),p.preventDefault(),this.queryCommandEnabled(p.shiftKey?"outdent":"indent")&&this.execCommand(p.shiftKey?"outdent":"indent"));if(p.keyCode==k.TAB&&!this.isTabIndent&&!p.ctrlKey&&!p.altKey)return p.shiftKey?this.beforeIframeNode.focus():this.afterIframeNode.focus(),
!0;9>m("ie")&&p.keyCode===k.BACKSPACE&&"Control"===this.document.selection.type&&(p.stopPropagation(),p.preventDefault(),this.execCommand("delete"));m("ff")&&(p.keyCode===k.PAGE_UP||p.keyCode===k.PAGE_DOWN)&&this.editNode.clientHeight>=this.editNode.scrollHeight&&p.preventDefault();var E=this._keyHandlers[p.keyCode],r=arguments;E&&!p.altKey&&Q.some(E,function(t){if(!(t.shift^p.shiftKey||t.ctrl^(p.ctrlKey||p.metaKey)))return t.handler.apply(this,r)||p.preventDefault(),!0},this);this.defer("onKeyPressed",
1);return!0},onKeyUp:function(){},setDisabled:function(p){e.deprecated("dijit.Editor::setDisabled is deprecated",'use dijit.Editor::attr("disabled",boolean) instead',2);this.set("disabled",p)},_setValueAttr:function(p){this.setValue(p)},_setDisableSpellCheckAttr:function(p){this.document?d.set(this.document.body,"spellcheck",!p):this.onLoadDeferred.then(z.hitch(this,function(){d.set(this.document.body,"spellcheck",!p)}));this._set("disableSpellCheck",p)},addKeyHandler:function(p,E,r,t){"string"==
typeof p&&(p=p.toUpperCase().charCodeAt(0));z.isArray(this._keyHandlers[p])||(this._keyHandlers[p]=[]);this._keyHandlers[p].push({shift:r||!1,ctrl:E||!1,handler:t})},onKeyPressed:function(){this.onDisplayChanged()},onClick:function(p){this.onDisplayChanged(p)},_onIEMouseDown:function(){this.focused||this.disabled||this.focus()},_onBlur:function(p){(m("ie")||m("trident"))&&this.defer(function(){H.curNode||this.ownerDocumentBody.focus()});this.inherited(arguments);var E=this.getValue(!0);if(E!==this.value)this.onChange(E);
this._set("value",E)},_onFocus:function(p){this.disabled||(this._disabledOK||this.set("disabled",!1),this.inherited(arguments))},blur:function(){!m("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>m("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(p,E){p=p.toLowerCase();"formatblock"===p?m("safari")&&void 0===E&&(p="heading"):"hilitecolor"!==p||m("mozilla")||(p="backcolor");return p},_implCommand:function(p){return"_"+this._normalizeCommand(p)+"EnabledImpl"},_qcaCache:{},
queryCommandAvailable:function(p){var E=this._qcaCache[p];return void 0!==E?E:this._qcaCache[p]=this._queryCommandAvailable(p)},_queryCommandAvailable:function(p){switch(p.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 m("ie")||m("trident")||m("edge");case "inserttable":case "insertcell":case "insertcol":case "insertrow":case "deletecells":case "deletecols":case "deleterows":case "mergecells":case "splitcell":return!m("webkit");default:return!1}},execCommand:function(p,E){this.focused&&this.focus();p=this._normalizeCommand(p,E);if(void 0!==E){if("heading"===p)throw Error("unimplemented");"formatblock"===
p&&(m("ie")||m("trident"))&&(E="\x3c"+E+"\x3e")}var r="_"+p+"Impl";if(this[r])var t=this[r](E);else if((E=1<arguments.length?E:null)||"createlink"!==p)t=this.document.execCommand(p,!1,E);this.onDisplayChanged();return t},queryCommandEnabled:function(p){if(this.disabled||!this._disabledOK)return!1;p=this._normalizeCommand(p);var E=this._implCommand(p);return this[E]?this[E](p):this._browserQueryCommandEnabled(p)},queryCommandState:function(p){if(this.disabled||!this._disabledOK)return!1;p=this._normalizeCommand(p);
try{return this.document.queryCommandState(p)}catch(E){return!1}},queryCommandValue:function(p){if(this.disabled||!this._disabledOK)return!1;p=this._normalizeCommand(p);if(m("ie")&&"formatblock"===p)p=this._native2LocalFormatNames[this.document.queryCommandValue(p)];else if(m("mozilla")&&"hilitecolor"===p){try{var E=this.document.queryCommandValue("styleWithCSS")}catch(r){E=!1}this.document.execCommand("styleWithCSS",!1,!0);p=this.document.queryCommandValue(p);this.document.execCommand("styleWithCSS",
!1,E)}else p=this.document.queryCommandValue(p);return p},_sCall:function(p,E){return this.selection[p].apply(this.selection,E)},placeCursorAtStart:function(){this.focus();var p=!1;if(m("mozilla"))for(var E=this.editNode.firstChild;E;){if(3===E.nodeType){if(0<E.nodeValue.replace(/^\s+|\s+$/g,"").length){p=!0;this.selection.selectElement(E);break}}else if(1===E.nodeType){p=!0;var r=E.tagName?E.tagName.toLowerCase():"";/br|input|img|base|meta|area|basefont|hr|link/.test(r)?this.selection.selectElement(E):
this.selection.selectElementChildren(E);break}E=E.nextSibling}else p=!0,this.selection.selectElementChildren(this.editNode);p&&this.selection.collapse(!0)},placeCursorAtEnd:function(){this.focus();var p=!1;if(m("mozilla"))for(var E=this.editNode.lastChild;E;){if(3===E.nodeType){if(0<E.nodeValue.replace(/^\s+|\s+$/g,"").length){p=!0;this.selection.selectElement(E);break}}else if(1===E.nodeType){p=!0;this.selection.selectElement(E.lastChild||E);break}E=E.previousSibling}else p=!0,this.selection.selectElementChildren(this.editNode);
p&&this.selection.collapse(!1)},getValue:function(p){return!this.textarea||!this.isClosed&&this.isLoaded?this.isLoaded?this._postFilterContent(null,p):this.value:this.textarea.value},_getValueAttr:function(){return this.getValue(!0)},setValue:function(p){if(this.isLoaded){if(!this.textarea||!this.isClosed&&this.isLoaded){p=this._preFilterContent(p);var E=this.isClosed?this.domNode:this.editNode;E.innerHTML=p;this._preDomFilterContent(E)}else this.textarea.value=p;this.onDisplayChanged();this._set("value",
this.getValue(!0))}else this.onLoadDeferred.then(z.hitch(this,function(){this.setValue(p)}))},replaceValue:function(p){this.isClosed?this.setValue(p):this.window&&this.window.getSelection&&!m("mozilla")?this.setValue(p):this.window&&this.window.getSelection?(p=this._preFilterContent(p),this.execCommand("selectall"),this.execCommand("inserthtml",p),this._preDomFilterContent(this.editNode)):this.document&&this.document.selection&&this.setValue(p);this._set("value",this.getValue(!0))},_preFilterContent:function(p){var E=
p;Q.forEach(this.contentPreFilters,function(r){r&&(E=r(E))});return E},_preDomFilterContent:function(p){p=p||this.editNode;Q.forEach(this.contentDomPreFilters,function(E){E&&z.isFunction(E)&&E(p)},this)},_postFilterContent:function(p,E){if(z.isString(p))var r=p;else p=p||this.editNode,this.contentDomPostFilters.length&&(E&&(p=z.clone(p)),Q.forEach(this.contentDomPostFilters,function(t){p=t(p)})),r=B.getChildrenHtml(p);z.trim(r.replace(/^\xA0\xA0*/,"").replace(/\xA0\xA0*$/,"")).length||(r="");Q.forEach(this.contentPostFilters,
function(t){r=t(r)});return r},_saveContent:function(){var p=u.byId(T._scopeName+"._editor.RichText.value");p&&(p.value&&(p.value+=this._SEPARATOR),p.value+=this.name+this._NAME_CONTENT_SEP+this.getValue(!0))},escapeXml:function(p,E){p=p.replace(/&/gm,"\x26amp;").replace(/</gm,"\x26lt;").replace(/>/gm,"\x26gt;").replace(/"/gm,"\x26quot;");E||(p=p.replace(/'/gm,"\x26#39;"));return p},getNodeHtml:function(p){e.deprecated("dijit.Editor::getNodeHtml is deprecated","use dijit/_editor/html::getNodeHtml instead",
2);return B.getNodeHtml(p)},getNodeChildrenHtml:function(p){e.deprecated("dijit.Editor::getNodeChildrenHtml is deprecated","use dijit/_editor/html::getChildrenHtml instead",2);return B.getChildrenHtml(p)},close:function(p){if(!this.isClosed){arguments.length||(p=!0);p&&this._set("value",this.getValue(!0));this.interval&&clearInterval(this.interval);this._webkitListener&&(this._webkitListener.remove(),delete this._webkitListener);m("ie")&&(this.iframe.onfocus=null);this.iframe._loadFunc=null;this._iframeRegHandle&&
(this._iframeRegHandle.remove(),delete this._iframeRegHandle);if(this.textarea){var E=this.textarea.style;E.position="";E.left=E.top="";m("ie")&&(E.overflow=this.__overflow,this.__overflow=null);this.textarea.value=this.value;a.destroy(this.domNode);this.domNode=this.textarea}else this.domNode.innerHTML=this.value;delete this.iframe;c.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);N._globalSaveHandler&&delete N._globalSaveHandler[this.id]},_removeMozBogus:function(p){return p.replace(/\stype="_moz"/gi,"").replace(/\s_moz_dirty=""/gi,"").replace(/_moz_resizing="(true|false)"/gi,"")},_removeWebkitBogus:function(p){p=p.replace(/\sclass="webkit-block-placeholder"/gi,"");p=p.replace(/\sclass="apple-style-span"/gi,
"");return p=p.replace(/<meta charset="utf-8" \/>/gi,"")},_normalizeFontStyle:function(p){return p.replace(/<(\/)?strong([ >])/gi,"\x3c$1b$2").replace(/<(\/)?em([ >])/gi,"\x3c$1i$2")},_preFixUrlAttributes:function(p){return p.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(p){if(!p)return!1;
if(m("ie")||m("trident")||m("edge"))return this.focused&&!this.disabled;var E=9>m("ie")?this.document.selection.createRange():this.document;try{return E.queryCommandEnabled(p)}catch(r){return!1}},_createlinkEnabledImpl:function(){var p=!0;return p=m("opera")?this.window.getSelection().isCollapsed?!0:this.document.queryCommandEnabled("createlink"):this._browserQueryCommandEnabled("createlink")},_unlinkEnabledImpl:function(){var p=!0;return p=m("mozilla")||m("webkit")||m("ie")||m("trident")||m("edge")?
this.selection.hasAncestorElement("a"):this._browserQueryCommandEnabled("unlink")},_inserttableEnabledImpl:function(){var p=!0;return p=m("mozilla")||m("webkit")?!0:this._browserQueryCommandEnabled("inserttable")},_cutEnabledImpl:function(){var p=!0;m("webkit")?((p=this.window.getSelection())&&(p=p.toString()),p=!!p):p=this._browserQueryCommandEnabled("cut");return p},_copyEnabledImpl:function(){var p=!0;m("webkit")?((p=this.window.getSelection())&&(p=p.toString()),p=!!p):p=this._browserQueryCommandEnabled("copy");
return p},_pasteEnabledImpl:function(){var p=!0;return m("webkit")?!0:p=this._browserQueryCommandEnabled("paste")},_inserthorizontalruleImpl:function(p){return m("ie")?this._inserthtmlImpl("\x3chr\x3e"):this.document.execCommand("inserthorizontalrule",!1,p)},_unlinkImpl:function(p){return this.queryCommandEnabled("unlink")&&(m("mozilla")||m("webkit"))?(p=this.selection.getAncestorElement("a"),this.selection.selectElement(p),this.document.execCommand("unlink",!1,null)):this.document.execCommand("unlink",
!1,p)},_hilitecolorImpl:function(p){if(!this._handleTextColorOrProperties("hilitecolor",p))if(m("mozilla")){this.document.execCommand("styleWithCSS",!1,!0);console.log("Executing color command.");var E=this.document.execCommand("hilitecolor",!1,p);this.document.execCommand("styleWithCSS",!1,!1)}else E=this.document.execCommand("hilitecolor",!1,p);return E},_backcolorImpl:function(p){m("ie")&&(p=p?p:null);var E=this._handleTextColorOrProperties("backcolor",p);E||(E=this.document.execCommand("backcolor",
!1,p));return E},_forecolorImpl:function(p){m("ie")&&(p=p?p:null);var E=!1;(E=this._handleTextColorOrProperties("forecolor",p))||(E=this.document.execCommand("forecolor",!1,p));return E},_inserthtmlImpl:function(p){p=this._preFilterContent(p);var E=!0;if(9>m("ie")){var r=this.document.selection.createRange();if("CONTROL"===this.document.selection.type.toUpperCase()){for(var t=r.item(0);r.length;)r.remove(r.item(0));t.outerHTML=p}else r.pasteHTML(p);r.select()}else if(8>m("trident")){var x=h.getSelection(this.window);
if(x&&x.rangeCount&&x.getRangeAt){r=x.getRangeAt(0);r.deleteContents();var F=a.create("div");F.innerHTML=p;for(t=this.document.createDocumentFragment();p=F.firstChild;)var K=t.appendChild(p);r.insertNode(t);K&&(r=r.cloneRange(),r.setStartAfter(K),r.collapse(!1),x.removeAllRanges(),x.addRange(r))}}else m("mozilla")&&!p.length?this.selection.remove():E=this.document.execCommand("inserthtml",!1,p);return E},_boldImpl:function(p){var E=!1;if(m("ie")||m("trident"))this._adaptIESelection(),E=this._adaptIEFormatAreaAndExec("bold");
E||(E=this.document.execCommand("bold",!1,p));return E},_italicImpl:function(p){var E=!1;if(m("ie")||m("trident"))this._adaptIESelection(),E=this._adaptIEFormatAreaAndExec("italic");E||(E=this.document.execCommand("italic",!1,p));return E},_underlineImpl:function(p){var E=!1;if(m("ie")||m("trident"))this._adaptIESelection(),E=this._adaptIEFormatAreaAndExec("underline");E||(E=this.document.execCommand("underline",!1,p));return E},_strikethroughImpl:function(p){var E=!1;if(m("ie")||m("trident"))this._adaptIESelection(),
E=this._adaptIEFormatAreaAndExec("strikethrough");E||(E=this.document.execCommand("strikethrough",!1,p));return E},_superscriptImpl:function(p){var E=!1;if(m("ie")||m("trident"))this._adaptIESelection(),E=this._adaptIEFormatAreaAndExec("superscript");E||(E=this.document.execCommand("superscript",!1,p));return E},_subscriptImpl:function(p){var E=!1;if(m("ie")||m("trident"))this._adaptIESelection(),E=this._adaptIEFormatAreaAndExec("subscript");E||(E=this.document.execCommand("subscript",!1,p));return E},
_fontnameImpl:function(p){if(m("ie")||m("trident"))var E=this._handleTextColorOrProperties("fontname",p);E||(E=this.document.execCommand("fontname",!1,p));return E},_fontsizeImpl:function(p){if(m("ie")||m("trident"))var E=this._handleTextColorOrProperties("fontsize",p);E||(E=this.document.execCommand("fontsize",!1,p));return E},_insertorderedlistImpl:function(p){var E=!1;if(m("ie")||m("trident")||m("edge"))E=this._adaptIEList("insertorderedlist",p);E||(E=this.document.execCommand("insertorderedlist",
!1,p));return E},_insertunorderedlistImpl:function(p){var E=!1;if(m("ie")||m("trident")||m("edge"))E=this._adaptIEList("insertunorderedlist",p);E||(E=this.document.execCommand("insertunorderedlist",!1,p));return E},getHeaderHeight:function(){return this._getNodeChildrenHeight(this.header)},getFooterHeight:function(){return this._getNodeChildrenHeight(this.footer)},_getNodeChildrenHeight:function(p){var E=0;if(p&&p.childNodes){var r;for(r=0;r<p.childNodes.length;r++){var t=w.position(p.childNodes[r]);
E+=t.h}}return E},_isNodeEmpty:function(p,E){return 1===p.nodeType?0<p.childNodes.length?this._isNodeEmpty(p.childNodes[0],E):!0:3===p.nodeType?""===p.nodeValue.substring(E):!1},_removeStartingRangeFromRange:function(p,E){if(p.nextSibling)E.setStart(p.nextSibling,0);else{for(p=p.parentNode;p&&null==p.nextSibling;)p=p.parentNode;p&&E.setStart(p.nextSibling,0)}return E},_adaptIESelection:function(){var p=h.getSelection(this.window);if(p&&p.rangeCount&&!p.isCollapsed){for(var E=p.getRangeAt(0),r=E.startContainer,
t=E.startOffset;3===r.nodeType&&t>=r.length&&r.nextSibling;)t-=r.length,r=r.nextSibling;for(var x=null;this._isNodeEmpty(r,t)&&r!==x;)x=r,E=this._removeStartingRangeFromRange(r,E),r=E.startContainer,t=0;p.removeAllRanges();p.addRange(E)}},_adaptIEFormatAreaAndExec:function(p){var E=h.getSelection(this.window),r=this.document,t;if(p&&E&&E.isCollapsed){if(this.queryCommandValue(p)){p=this._tagNamesForCommand(p);var x=E.getRangeAt(0);var F=x.startContainer;if(3===F.nodeType){var K=x.endOffset;F.length<
K&&(K=this._adjustNodeAndOffset(R,K),F=K.node,K=K.offset)}for(;F&&F!==this.editNode;){var R=F.tagName?F.tagName.toLowerCase():"";if(-1<Q.indexOf(p,R)){var U=F;break}F=F.parentNode}if(U&&(R=x.startContainer,p=r.createElement(U.tagName),a.place(p,U,"after"),R&&3===R.nodeType)){K=x.endOffset;R.length<K&&(K=this._adjustNodeAndOffset(R,K),R=K.node,K=K.offset);F=R.nodeValue;x=r.createTextNode(F.substring(0,K));var M=F.substring(K,F.length);M&&(t=r.createTextNode(M));a.place(x,R,"before");if(t){var P=r.createElement("span");
P.className="ieFormatBreakerSpan";a.place(P,R,"after");a.place(t,P,"after");t=P}a.destroy(R);K=x.parentNode;for(R=[];K!==U;){F=K.tagName;x={tagName:F};R.push(x);F=r.createElement(F);K.style&&F.style&&K.style.cssText&&(F.style.cssText=K.style.cssText,x.cssText=K.style.cssText);"FONT"===K.tagName&&(K.color&&(F.color=K.color,x.color=K.color),K.face&&(F.face=K.face,x.face=K.face),K.size&&(F.size=K.size,x.size=K.size));K.className&&(F.className=K.className,x.className=K.className);if(t)for(;t;)x=t.nextSibling,
F.appendChild(t),t=x;F.tagName==K.tagName?(P=r.createElement("span"),P.className="ieFormatBreakerSpan",a.place(P,K,"after"),a.place(F,P,"after")):a.place(F,K,"after");x=K;t=F;K=K.parentNode}if(t){if(1===t.nodeType||3===t.nodeType&&t.nodeValue)p.innerHTML="";for(;t;)x=t.nextSibling,p.appendChild(t),t=x}if(R.length){x=R.pop();t=r.createElement(x.tagName);x.cssText&&t.style&&(t.style.cssText=x.cssText);x.className&&(t.className=x.className);"FONT"===x.tagName&&(x.color&&(t.color=x.color),x.face&&(t.face=
x.face),x.size&&(t.size=x.size));for(a.place(t,p,"before");R.length;)x=R.pop(),U=r.createElement(x.tagName),x.cssText&&U.style&&(U.style.cssText=x.cssText),x.className&&(U.className=x.className),"FONT"===x.tagName&&(x.color&&(U.color=x.color),x.face&&(U.face=x.face),x.size&&(U.size=x.size)),t.appendChild(U),t=U;U=r.createTextNode(".");P.appendChild(U);t.appendChild(U)}else P=r.createElement("span"),P.className="ieFormatBreakerSpan",U=r.createTextNode("."),P.appendChild(U),a.place(P,p,"before");t=
h.create(this.window);t.setStart(U,0);t.setEnd(U,U.length);E.removeAllRanges();E.addRange(t);this.selection.collapse(!1);U.parentNode.innerHTML="";p.firstChild||a.destroy(p);return!0}return!1}x=E.getRangeAt(0);if((R=x.startContainer)&&3===R.nodeType)return K=x.startOffset,R.length<K&&(K=this._adjustNodeAndOffset(R,K),R=K.node,K=K.offset),F=R.nodeValue,x=r.createTextNode(F.substring(0,K)),M=F.substring(K),""!==M&&(t=r.createTextNode(F.substring(K))),P=r.createElement("span"),U=r.createTextNode("."),
P.appendChild(U),x.length?a.place(x,R,"after"):x=R,a.place(P,x,"after"),t&&a.place(t,P,"after"),a.destroy(R),t=h.create(this.window),t.setStart(U,0),t.setEnd(U,U.length),E.removeAllRanges(),E.addRange(t),r.execCommand(p),a.place(P.firstChild,P,"before"),a.destroy(P),t.setStart(U,0),t.setEnd(U,U.length),E.removeAllRanges(),E.addRange(t),this.selection.collapse(!1),U.parentNode.innerHTML="",!0}else return!1},_adaptIEList:function(p){var E=h.getSelection(this.window);if(E.isCollapsed&&E.rangeCount&&
!this.queryCommandValue(p)){var r=E.getRangeAt(0),t=r.startContainer;if(t&&3==t.nodeType&&!r.startOffset)return r="ul","insertorderedlist"===p&&(r="ol"),p=this.document.createElement(r),r=a.create("li",null,p),a.place(p,t,"before"),r.appendChild(t),a.create("br",null,p,"after"),p=h.create(this.window),p.setStart(t,0),p.setEnd(t,t.length),E.removeAllRanges(),E.addRange(p),this.selection.collapse(!0),!0}return!1},_handleTextColorOrProperties:function(p,E){var r=h.getSelection(this.window),t=this.document,
x,F;E=E||null;if(p&&r&&r.isCollapsed&&r.rangeCount){var K=r.getRangeAt(0);if((x=K.startContainer)&&3===x.nodeType){var R=K.startOffset;x.length<R&&(K=this._adjustNodeAndOffset(x,R),x=K.node,R=K.offset);var U=x.nodeValue;K=t.createTextNode(U.substring(0,R));""!==U.substring(R)&&(F=t.createTextNode(U.substring(R)));U=t.createElement("span");R=t.createTextNode(".");U.appendChild(R);t=t.createElement("span");U.appendChild(t);K.length?a.place(K,x,"after"):K=x;a.place(U,K,"after");F&&a.place(F,U,"after");
a.destroy(x);x=h.create(this.window);x.setStart(R,0);x.setEnd(R,R.length);r.removeAllRanges();r.addRange(x);if(m("webkit")){r="color";if("hilitecolor"===p||"backcolor"===p)r="backgroundColor";q.set(U,r,E);this.selection.remove();a.destroy(t);U.innerHTML="\x26#160;";this.selection.selectElement(U);this.focus()}else this.execCommand(p,E),a.place(U.firstChild,U,"before"),a.destroy(U),x.setStart(R,0),x.setEnd(R,R.length),r.removeAllRanges(),r.addRange(x),this.selection.collapse(!1),R.parentNode.removeChild(R);
return!0}}return!1},_adjustNodeAndOffset:function(p,E){for(;p.length<E&&p.nextSibling&&3===p.nextSibling.nodeType;)E-=p.length,p=p.nextSibling;return{node:p,offset:E}},_tagNamesForCommand:function(p){return"bold"===p?["b","strong"]:"italic"===p?["i","em"]:"strikethrough"===p?["s","strike"]:"superscript"===p?["sup"]:"subscript"===p?["sub"]:"underline"===p?["u"]:[]},_stripBreakerNodes:function(p){if(this.isLoaded)return n(".ieFormatBreakerSpan",p).forEach(function(E){for(;E.firstChild;)a.place(E.firstChild,
E,"before");a.destroy(E)}),p},_stripTrailingEmptyNodes:function(p){function E(r){return/^(p|div|br)$/i.test(r.nodeName)&&0==r.children.length&&/^[\s\xA0]*$/.test(r.textContent||r.innerText||"")||3===r.nodeType&&/^[\s\xA0]*$/.test(r.nodeValue)}for(;p.lastChild&&E(p.lastChild);)a.destroy(p.lastChild);return p},_setTextDirAttr:function(p){this._set("textDir",p);this.onLoadDeferred.then(z.hitch(this,function(){this.editNode.dir=p}))}});return N})},"dijit/_editor/range":function(){define(["dojo/_base/array",
"dojo/_base/declare","dojo/_base/lang"],function(Q,I,J){var G={getIndex:function(c,a){for(var w=[],q=[],e=c,k,z;c!=a;){var f=0;for(k=c.parentNode;z=k.childNodes[f++];)if(z===c){--f;break}w.unshift(f);q.unshift(f-k.childNodes.length);c=k}if(0<w.length&&3==e.nodeType){for(z=e.previousSibling;z&&3==z.nodeType;)w[w.length-1]--,z=z.previousSibling;for(z=e.nextSibling;z&&3==z.nodeType;)q[q.length-1]++,z=z.nextSibling}return{o:w,r:q}},getNode:function(c,a){if(!J.isArray(c)||0==c.length)return a;var w=a;
Q.every(c,function(q){if(0<=q&&q<w.childNodes.length)w=w.childNodes[q];else return w=null,!1;return!0});return w},getCommonAncestor:function(c,a,w){w=w||c.ownerDocument.body;var q=function(z){for(var f=[];z;)if(f.unshift(z),z!==w)z=z.parentNode;else break;return f};c=q(c);a=q(a);q=Math.min(c.length,a.length);for(var e=c[0],k=1;k<q;k++)if(c[k]===a[k])e=c[k];else break;return e},getAncestor:function(c,a,w){for(w=w||c.ownerDocument.body;c&&c!==w;){var q=c.nodeName.toUpperCase();if(a.test(q))return c;
c=c.parentNode}return null},BlockTagNames:/^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DT|DE)$/,getBlockAncestor:function(c,a,w){w=w||c.ownerDocument.body;a=a||G.BlockTagNames;for(var q=null,e;c&&c!==w;){var k=c.nodeName.toUpperCase();!q&&a.test(k)&&(q=c);!e&&/^(?:BODY|TD|TH|CAPTION)$/.test(k)&&(e=c);c=c.parentNode}return{blockNode:q,blockContainer:e||c.ownerDocument.body}},atBeginningOfContainer:function(c,a,w){var q=!1,e=0==w;e||3!=a.nodeType||/^[\s\xA0]+$/.test(a.nodeValue.substr(0,w))&&(e=
!0);if(e)for(q=!0;a&&a!==c;){if(a.previousSibling){q=!1;break}a=a.parentNode}return q},atEndOfContainer:function(c,a,w){var q=!1,e=w==(a.length||a.childNodes.length);e||3!=a.nodeType||/^[\s\xA0]+$/.test(a.nodeValue.substr(w))&&(e=!0);if(e)for(q=!0;a&&a!==c;){if(a.nextSibling){q=!1;break}a=a.parentNode}return q},adjacentNoneTextNode:function(c,a){var w=c;c=0-c.length||0;for(a=a?"nextSibling":"previousSibling";w&&3==w.nodeType;)c+=w.length,w=w[a];return[w,c]},create:function(c){c=c||window;return c.getSelection?
c.document.createRange():new d},getSelection:function(c,a){if(c.getSelection)return c.getSelection();c=new u.selection(c);a||c._getCurrentSelection();return c}};if(!window.getSelection)var u=G.ie={cachedSelection:{},selection:function(c){this._ranges=[];this.addRange=function(a,w){this._ranges.push(a);w||a._select();this.rangeCount=this._ranges.length};this.removeAllRanges=function(){this._ranges=[];this.rangeCount=0};this.getRangeAt=function(a){return this._ranges[a]};this._getCurrentSelection=function(){this.removeAllRanges();
var a=c.document.selection.createRange();a="CONTROL"==c.document.selection.type.toUpperCase()?new d(u.decomposeControlRange(a)):new d(u.decomposeTextRange(a));this.addRange(a,!0),this.isCollapsed=a.collapsed}},decomposeControlRange:function(c){var a=c.item(0),w=c.item(c.length-1);c=a.parentNode;var q=w.parentNode;a=G.getIndex(a,c).o[0];w=G.getIndex(w,q).o[0]+1;return[c,a,q,w]},getEndPoint:function(c,a){var w=c.duplicate();w.collapse(!a);var q="EndTo"+(a?"End":"Start"),e=w.parentElement(),k;if(0<e.childNodes.length)Q.every(e.childNodes,
function(n,g){if(3!=n.nodeType)if(w.moveToElementText(n),0<w.compareEndPoints(q,c))if(k&&3==k.nodeType){z=k;var m=!0}else return z=e,f=g,!1;else{if(g==e.childNodes.length-1)return z=e,f=e.childNodes.length,!1}else g==e.childNodes.length-1&&(z=n,m=!0);if(m&&z)return z=(n=G.adjacentNoneTextNode(z)[0])?n.nextSibling:e.firstChild,g=G.adjacentNoneTextNode(z),n=g[0],g=g[1],n?(w.moveToElementText(n),w.collapse(!1)):w.moveToElementText(e),w.setEndPoint(q,c),f=w.text.length-g,!1;k=n;return!0});else{var z=
e;var f=0}a||1!=z.nodeType||f!=z.childNodes.length||(a=z.nextSibling)&&3==a.nodeType&&(z=a,f=0);return[z,f]},setEndPoint:function(c,a,w){c=c.duplicate();var q;if(3!=a.nodeType)if(0<w){if(q=a.childNodes[w-1])if(3==q.nodeType)a=q,w=q.length;else if(q.nextSibling&&3==q.nextSibling.nodeType)a=q.nextSibling,w=0;else{c.moveToElementText(q.nextSibling?q:a);var e=q.parentNode;q=e.insertBefore(q.ownerDocument.createTextNode(" "),q.nextSibling);c.collapse(!1);e.removeChild(q)}}else c.moveToElementText(a),c.collapse(!0);
3==a.nodeType&&(q=G.adjacentNoneTextNode(a),e=q[0],q=q[1],e?(c.moveToElementText(e),c.collapse(!1),"inherit"!=e.contentEditable&&q++):(c.moveToElementText(a.parentNode),c.collapse(!0),c.move("character",1),c.move("character",-1)),w+=q,0<w&&c.move("character",w)!=w&&console.error("Error when moving!"));return c},decomposeTextRange:function(c){var a=u.getEndPoint(c),w=a[0],q=a[1],e=a[0];a=a[1];c.htmlText.length&&(c.htmlText==c.text?a=q+c.text.length:(a=u.getEndPoint(c,!0),e=a[0],a=a[1]));return[w,q,
e,a]},setRange:function(c,a,w,q,e,k){a=u.setEndPoint(c,a,w);c.setEndPoint("StartToStart",a);if(!k)var z=u.setEndPoint(c,q,e);c.setEndPoint("EndToEnd",z||a);return c}},d=G.W3CRange=I(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?G.getCommonAncestor(this.startContainer,this.endContainer):this.startContainer;this.collapsed=this.startContainer===this.endContainer&&this.startOffset==this.endOffset},setStart:function(c,a){a=parseInt(a);if(this.startContainer!==c||this.startOffset!=a)delete this._cachedBookmark,this.startContainer=c,this.startOffset=a,this.endContainer?this._updateInternal():this.setEnd(c,a)},setEnd:function(c,a){a=parseInt(a);if(this.endContainer!==c||this.endOffset!=a)delete this._cachedBookmark,
this.endContainer=c,this.endOffset=a,this.startContainer?this._updateInternal():this.setStart(c,a)},setStartAfter:function(c,a){this._setPoint("setStart",c,a,1)},setStartBefore:function(c,a){this._setPoint("setStart",c,a,0)},setEndAfter:function(c,a){this._setPoint("setEnd",c,a,1)},setEndBefore:function(c,a){this._setPoint("setEnd",c,a,0)},_setPoint:function(c,a,w,q){w=G.getIndex(a,a.parentNode).o;this[c](a.parentNode,w.pop()+q)},_getIERange:function(){var c=(this._body||this.endContainer.ownerDocument.body).createTextRange();
u.setRange(c,this.startContainer,this.startOffset,this.endContainer,this.endOffset,this.collapsed);return c},getBookmark:function(){this._getIERange();return this._cachedBookmark},_select:function(){this._getIERange().select()},deleteContents:function(){var c=this.startContainer,a=this._getIERange();3!==c.nodeType||this.startOffset||this.setStartBefore(c);a.pasteHTML("");this.endContainer=this.startContainer;this.endOffset=this.startOffset;this.collapsed=!0},cloneRange:function(){var c=new d([this.startContainer,
this.startOffset,this.endContainer,this.endOffset]);c._body=this._body;return c},detach:function(){this.startContainer=this.commonAncestorContainer=this._body=null;this.startOffset=0;this.endContainer=null;this.endOffset=0;this.collapsed=!0}});J.setObject("dijit.range",G);return G})},"dijit/_editor/html":function(){define(["dojo/_base/array","dojo/_base/lang","dojo/sniff"],function(Q,I,J){var G={};I.setObject("dijit._editor.html",G);var u=G.escapeXml=function(d,c){d=d.replace(/&/gm,"\x26amp;").replace(/</gm,
"\x26lt;").replace(/>/gm,"\x26gt;").replace(/"/gm,"\x26quot;");c||(d=d.replace(/'/gm,"\x26#39;"));return d};G.getNodeHtml=function(d){var c=[];G.getNodeHtmlHelper(d,c);return c.join("")};G.getNodeHtmlHelper=function(d,c){switch(d.nodeType){case 1:var a=d.nodeName.toLowerCase();if(!a||"/"==a.charAt(0))return"";c.push("\x3c",a);var w=[],q={},e;if(J("dom-attributes-explicit")||J("dom-attributes-specified-flag"))for(var k=0;e=d.attributes[k++];){var z=e.name;"_dj"===z.substr(0,3)||J("dom-attributes-specified-flag")&&
!e.specified||z in q||(e=e.value,("src"==z||"href"==z)&&d.getAttribute("_djrealurl")&&(e=d.getAttribute("_djrealurl")),8===J("ie")&&"style"===z&&(e=e.replace("HEIGHT:","height:").replace("WIDTH:","width:")),w.push([z,e]),q[z]=e)}else{var f=(/^input$|^img$/i.test(d.nodeName)?d:d.cloneNode(!1)).outerHTML;q=f.match(/[\w-]+=("[^"]*"|'[^']*'|\S*)/gi);f=f.substr(0,f.indexOf("\x3e"));Q.forEach(q,function(n){if(n){var g=n.indexOf("\x3d");if(0<g&&(n=n.substring(0,g),"_dj"!=n.substr(0,3)))if("src"!=n&&"href"!=
n||!d.getAttribute("_djrealurl")){switch(n){case "style":var m=d.style.cssText.toLowerCase();break;case "class":m=d.className;break;case "width":if("img"===a){(g=/width=(\S+)/i.exec(f))&&(m=g[1]);break}case "height":if("img"===a){(g=/height=(\S+)/i.exec(f))&&(m=g[1]);break}default:m=d.getAttribute(n)}null!=m&&w.push([n,m.toString()])}else w.push([n,d.getAttribute("_djrealurl")])}},this)}w.sort(function(n,g){return n[0]<g[0]?-1:n[0]==g[0]?0:1});for(q=0;e=w[q++];)c.push(" ",e[0],'\x3d"',"string"===
typeof e[1]?u(e[1],!0):e[1],'"');switch(a){case "br":case "hr":case "img":case "input":case "base":case "meta":case "area":case "basefont":c.push(" /\x3e");break;case "script":c.push("\x3e",d.innerHTML,"\x3c/",a,"\x3e");break;default:c.push("\x3e"),d.hasChildNodes()&&G.getChildrenHtmlHelper(d,c),c.push("\x3c/",a,"\x3e")}break;case 4:case 3:c.push(u(d.nodeValue,!0));break;case 8:c.push("\x3c!--",u(d.nodeValue,!0),"--\x3e");break;default:c.push("\x3c!-- Element not recognized - Type: ",d.nodeType," Name: ",
d.nodeName,"--\x3e")}};G.getChildrenHtml=function(d){var c=[];G.getChildrenHtmlHelper(d,c);return c.join("")};G.getChildrenHtmlHelper=function(d,c){if(d)for(var a=d.childNodes||d,w=!J("ie")||a!==d,q,e=0;q=a[e++];)w&&q.parentNode!=d||G.getNodeHtmlHelper(q,c)};return G})},"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(Q,I,J,G,u,d,c,a,w,q,e,k,z){var f=J("dijit._editor.plugins.LinkDialog",e,{allowUnsafeHtml:!1,linkFilter:[[/</g,"\x26lt;"]],buttonClass:k,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=d.hitch(this,"_loadDropDown");this._connectTagEvents()},_loadDropDown:function(g){Q("dojo/i18n ../../TooltipDialog ../../registry ../../form/Button ../../form/Select ../../form/ValidationTextBox dojo/i18n!../../nls/common dojo/i18n!../nls/LinkDialog".split(" "),d.hitch(this,function(m,l,C){var A=this;this.tag="insertImage"==this.command?"img":"a";m=d.delegate(m.getLocalization("dijit","common",this.lang),m.getLocalization("dijit._editor",
"LinkDialog",this.lang));var L=this.dropDown=this.button.dropDown=new l({title:m[this.command+"Title"],ownerDocument:this.editor.ownerDocument,dir:this.editor.dir,execute:d.hitch(this,"setValue"),onOpen:function(){A._onOpenDialog();l.prototype.onOpen.apply(this,arguments)},onCancel:function(){setTimeout(d.hitch(A,"_onCloseDialog"),0)}});m.urlRegExp=this.urlRegExp;m.id=C.getUniqueId(this.editor.id);this._uniqueId=m.id;this._setContent(L.title+"\x3cdiv style\x3d'border-bottom: 1px black solid;padding-bottom:2pt;margin-bottom:4pt'\x3e\x3c/div\x3e"+
q.substitute(this.linkDialogTemplate,m));L.startup();this._urlInput=C.byId(this._uniqueId+"_urlInput");this._textInput=C.byId(this._uniqueId+"_textInput");this._setButton=C.byId(this._uniqueId+"_setButton");this.own(C.byId(this._uniqueId+"_cancelButton").on("click",d.hitch(this.dropDown,"onCancel")));this._urlInput&&this.own(this._urlInput.on("change",d.hitch(this,"_checkAndFixInput")));this._textInput&&this.own(this._textInput.on("change",d.hitch(this,"_checkAndFixInput")));this._urlRegExp=new RegExp("^"+
this.urlRegExp+"$","i");this._emailRegExp=new RegExp("^"+this.emailRegExp+"$","i");this._urlInput.isValid=d.hitch(this,function(){var y=this._urlInput.get("value");return this._urlRegExp.test(y)||this._emailRegExp.test(y)});this.own(c(L.domNode,"keydown",d.hitch(this,d.hitch(this,function(y){!y||y.keyCode!=u.ENTER||y.shiftKey||y.metaKey||y.ctrlKey||y.altKey||this._setButton.get("disabled")||(L.onExecute(),L.execute(L.get("value")))}))));g()}))},_checkAndFixInput:function(){var g=this,m=this._urlInput.get("value");
this._delayedCheck&&(clearTimeout(this._delayedCheck),this._delayedCheck=null);this._delayedCheck=setTimeout(function(){var l=m,C=!1,A=!1;l&&1<l.length&&(l=d.trim(l),0!==l.indexOf("mailto:")&&(0<l.indexOf("/")?-1===l.indexOf("://")&&"/"!==l.charAt(0)&&l.indexOf("./")&&0!==l.indexOf("../")&&g._hostRxp.test(l)&&(C=!0):g._userAtRxp.test(l)&&(A=!0)));C&&g._urlInput.set("value","http://"+l);A&&g._urlInput.set("value","mailto:"+l);g._setButton.set("disabled",!g._isValid())},250)},_connectTagEvents:function(){this.editor.onLoadDeferred.then(d.hitch(this,
function(){this.own(c(this.editor.editNode,"mouseup",d.hitch(this,"_onMouseUp")));this.own(c(this.editor.editNode,"dblclick",d.hitch(this,"_onDblClick")))}))},_isValid:function(){return this._urlInput.isValid()&&this._textInput.isValid()},_setContent:function(g){this.dropDown.set({parserScope:"dojo",content:g})},_checkValues:function(g){g&&g.urlInput&&(g.urlInput=g.urlInput.replace(/"/g,"\x26quot;"));!this.allowUnsafeHtml&&g&&g.textInput&&("function"===typeof this.linkFilter?g.textInput=this.linkFilter(g.textInput):
I.forEach(this.linkFilter,function(m){g.textInput=g.textInput.replace(m[0],m[1])}));return g},_createlinkEnabledImpl:function(){return!0},setValue:function(g){this._onCloseDialog();if(9>a("ie")){var m=z.getSelection(this.editor.window).getRangeAt(0).endContainer;3===m.nodeType&&(m=m.parentNode);m&&m.nodeName&&m.nodeName.toLowerCase()!==this.tag&&(m=this.editor.selection.getSelectedElement(this.tag));m&&m.nodeName&&m.nodeName.toLowerCase()===this.tag&&this.editor.queryCommandEnabled("unlink")&&(this.editor.selection.selectElementChildren(m),
this.editor.execCommand("unlink"))}g=this._checkValues(g);this.editor.execCommand("inserthtml",q.substitute(this.htmlTemplate,g));w("a",this.editor.document).forEach(function(l){l.innerHTML||G.has(l,"name")||l.parentNode.removeChild(l)},this)},_onCloseDialog:function(){this.editor.focused&&this.editor.focus()},_getCurrentValues:function(g){if(g&&g.tagName.toLowerCase()===this.tag){var m=g.getAttribute("_djrealurl")||g.getAttribute("href");var l=g.getAttribute("target")||"_self";var C=g.textContent||
g.innerText;this.editor.selection.selectElement(g,!0)}else C=this.editor.selection.getSelectedText();return{urlInput:m||"",textInput:C||"",targetSelect:l||""}},_onOpenDialog:function(){if(a("ie")){var g=z.getSelection(this.editor.window);if(g.rangeCount){var m=g.getRangeAt(0);var l=m.endContainer;3===l.nodeType&&(l=l.parentNode);l&&l.nodeName&&l.nodeName.toLowerCase()!==this.tag&&(l=this.editor.selection.getSelectedElement(this.tag));if(!l||l.nodeName&&l.nodeName.toLowerCase()!==this.tag)(g=this.editor.selection.getAncestorElement(this.tag))&&
g.nodeName&&g.nodeName.toLowerCase()==this.tag?(l=g,this.editor.selection.selectElement(l)):m.startContainer===m.endContainer&&(g=m.startContainer.firstChild)&&g.nodeName&&g.nodeName.toLowerCase()==this.tag&&(l=g,this.editor.selection.selectElement(l))}}else l=this.editor.selection.getAncestorElement(this.tag);this.dropDown.reset();this._setButton.set("disabled",!0);this.dropDown.set("value",this._getCurrentValues(l))},_onDblClick:function(g){if(g&&g.target&&(g=g.target,(g.tagName?g.tagName.toLowerCase():
"")===this.tag&&G.get(g,"href"))){var m=this.editor;this.editor.selection.selectElement(g);m.onDisplayChanged();m._updateTimer&&(m._updateTimer.remove(),delete m._updateTimer);m.onNormalizedDisplayChanged();var l=this.button;setTimeout(function(){l.set("disabled",!1);l.loadAndOpenDropDown().then(function(){l.dropDown.focus&&l.dropDown.focus()})},10)}},_onMouseUp:function(){if(a("ff")){var g=this.editor.selection.getAncestorElement(this.tag);if(g){var m=z.getSelection(this.editor.window).getRangeAt(0);
if(m.collapsed&&g.childNodes.length){var l=m.cloneRange();l.selectNodeContents(g.childNodes[g.childNodes.length-1]);l.setStart(g.childNodes[0],0);1!==m.compareBoundaryPoints(l.START_TO_START,l)?m.setStartBefore(g):-1!==m.compareBoundaryPoints(l.END_TO_START,l)&&m.setStartAfter(g)}}}}}),n=J("dijit._editor.plugins.ImgLinkDialog",[f],{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(g){if(g&&g.tagName.toLowerCase()===this.tag){var m=g.getAttribute("_djrealurl")||g.getAttribute("src");var l=g.getAttribute("alt");this.editor.selection.selectElement(g,!0)}else l=this.editor.selection.getSelectedText();return{urlInput:m||"",textInput:l||""}},_isValid:function(){return this._urlInput.isValid()},_connectTagEvents:function(){this.inherited(arguments);
this.editor.onLoadDeferred.then(d.hitch(this,function(){this.own(c(this.editor.editNode,"mousedown",d.hitch(this,"_selectTag")))}))},_selectTag:function(g){g&&g.target&&(g=g.target,(g.tagName?g.tagName.toLowerCase():"")===this.tag&&this.editor.selection.selectElement(g))},_checkValues:function(g){g&&g.urlInput&&(g.urlInput=g.urlInput.replace(/"/g,"\x26quot;"));g&&g.textInput&&(g.textInput=g.textInput.replace(/"/g,"\x26quot;"));return g},_onDblClick:function(g){if(g&&g.target&&(g=g.target,(g.tagName?
g.tagName.toLowerCase():"")===this.tag&&G.get(g,"src"))){var m=this.editor;this.editor.selection.selectElement(g);m.onDisplayChanged();m._updateTimer&&(m._updateTimer.remove(),delete m._updateTimer);m.onNormalizedDisplayChanged();var l=this.button;setTimeout(function(){l.set("disabled",!1);l.loadAndOpenDropDown().then(function(){l.dropDown.focus&&l.dropDown.focus()})},10)}}});e.registry.createLink=function(g){var m={command:"createLink",allowUnsafeHtml:"allowUnsafeHtml"in g?g.allowUnsafeHtml:!1};
"linkFilter"in g&&(m.linkFilter=g.linkFilter);return new f(m)};e.registry.insertImage=function(){return new n({command:"insertImage"})};f.ImgLinkDialog=n;return f})},"dijit/_editor/plugins/TextColor":function(){define("require dojo/colors dojo/_base/declare dojo/_base/lang ../_Plugin ../../form/DropDownButton".split(" "),function(Q,I,J,G,u,d){var c=J("dijit._editor.plugins.TextColor",u,{buttonClass:d,colorPicker:"dijit/ColorPalette",useDefaultCommand:!1,_initButton:function(){this.command=this.name;
this.inherited(arguments);var a=this;this.button.loadDropDown=function(w){function q(e){a.button.dropDown=new e({dir:a.editor.dir,ownerDocument:a.editor.ownerDocument,value:a.value,onChange:function(k){a.editor.execCommand(a.command,k)},onExecute:function(){a.editor.execCommand(a.command,this.get("value"))}});w()}"string"==typeof a.colorPicker?Q([a.colorPicker],q):q(a.colorPicker)}},updateState:function(){var a=this.editor,w=this.command;if(a&&a.isLoaded&&w.length){if(this.button){var q=this.get("disabled");
this.button.set("disabled",q);if(q)return;try{var e=a.queryCommandValue(w)||""}catch(k){e=""}}""==e&&(e="#000000");"transparent"==e&&(e="#ffffff");"string"==typeof e?-1<e.indexOf("rgb")&&(e=I.fromRgb(e).toHex()):(e=((e&255)<<16|e&65280|(e&16711680)>>>16).toString(16),e="#000000".slice(0,7-e.length)+e);this.value=e;(a=this.button.dropDown)&&a.get&&e!==a.get("value")&&a.set("value",e,!1)}}});u.registry.foreColor=function(a){return new c(a)};u.registry.hiliteColor=function(a){return new c(a)};return c})},
"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(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m){Q=Q([q,e],{declaredClass:"esri.dijit.editing.AttachmentEditor",widgetsInTemplate:!0,
templateString:g,_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(l,C){I.mixin(this,m.widgets.attachmentEditor)},startup:function(){this.inherited(arguments);
this._uploadField_connect=J.connect(this._uploadField,"onchange",this,function(){0<this._uploadField.value.length&&this._addAttachment()});this._uploadFieldFocus_connect=J.connect(this._uploadField,"onfocus",I.hitch(this,function(l){n.hide(this._attachmentError)}))},destroy:function(){G.forEach(this._aeConnects,J.disconnect);J.disconnect(this._uploadField_connect);J.disconnect(this._uploadFieldFocus_connect);this.inherited(arguments)},showAttachments:function(l,C){this._attachmentList.innerHTML=this.NLS_none;
this._uploadField.value="";G.forEach(this.domNode.children,function(A,L){n.show(A)});n.hide(this._attachmentError);l&&(this._featureLayer=l.getLayer()||C)&&("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:l}).canUpdate,this._oid=l.attributes[this._featureLayer.objectIdField],this._getAttachments(l)):C&&C.getEditCapabilities()||(n.hide(this._uploadForm),G.forEach(this.domNode.children,function(A,L){n.hide(A)})))},_getAttachments:function(l){this._featureLayer&&this._featureLayer.queryAttachmentInfos&&this._featureLayer.queryAttachmentInfos(this._oid,I.hitch(this,"_onQueryAttachmentInfosComplete"))},_addAttachment:function(){n.hide(this._attachmentError);
this._featureLayer&&this._featureLayer.addAttachment?(n.show(this._attachmentProgress),this._featureLayer.addAttachment(this._oid,this._uploadForm,I.hitch(this,"_onAddAttachmentComplete"),I.hitch(this,"_onAddAttachmentError"))):this._tempUpload=this._uploadForm},_chainAttachment:function(l,C){this._tempUpload&&(n.show(this._attachmentProgress),C.addAttachment(l,this._tempUpload,I.hitch(this,"_onAddAttachmentComplete"),I.hitch(this,"_onAddAttachmentError")));this._tempUpload=null},_deleteAttachment:function(l,
C){n.show(this._attachmentProgress);this._featureLayer.deleteAttachments(l,[C],I.hitch(this,"_onDeleteAttachmentComplete"))},_onQueryAttachmentInfosComplete:function(l){var C=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?(C=this._listHtml+this._endHtml,this._uploadForm.style.display=
"none"):this._layerEditingCap[this._currentLayerId].canCreate&&!this._layerEditingCap[this._currentLayerId].canUpdate&&(C=this._listHtml+this._endHtml);var A=this._attachmentList;l=G.map(l,I.hitch(this,function(L){return f.substitute({href:L.url,name:L.name,oid:L.objectId,attid:L.id},C)}));A.innerHTML=l.join("")||this.NLS_none;this._updateConnects()},_onAddAttachmentComplete:function(l){n.hide(this._attachmentProgress.domNode);var C=this._attachmentList,A=this._uploadField,L=A.value,y=L.lastIndexOf("\\");
-1<y&&(L=L.substring(y+1,L.length));L=L.replace(/ /g,"_");y=a.objectToQuery({gdbVersion:this._featureLayer.gdbVersion,token:this._featureLayer._getToken()});var v=this._listHtml+this._deleteBtnHtml+this._endHtml;this._layerEditingCap[this._currentLayerId].canCreate&&!this._layerEditingCap[this._currentLayerId].canUpdate&&(v=this._listHtml+this._endHtml);l=f.substitute({href:this._featureLayer._url.path+"/"+l.objectId+"/attachments/"+l.attachmentId+(y?"?"+y:""),name:L,oid:l.objectId,attid:l.attachmentId},
v);C.innerHTML=C.innerHTML==this.NLS_none?l:C.innerHTML+l;this._updateConnects();A.value=""},_onAddAttachmentError:function(l){n.hide(this._attachmentProgress.domNode);if(l){var C=this.NLS_error,A=this._attachmentError;f.isDefined(l.code)&&400===l.code&&(C=this.NLS_fileNotSupported);w.set(A,"innerHTML",C);n.show(A)}},_onDeleteAttachmentComplete:function(l){n.hide(this._attachmentProgress.domNode);var C=this._attachmentList;G.every(l,function(A){return A.success})&&(u.query("#node_"+l[0].objectId+
"_"+l[0].attachmentId).orphan(),C.children&&C.children.length||(C.innerHTML=this.NLS_none))},_updateConnects:function(){G.forEach(this._aeConnects,J.disconnect);u.query(".deleteAttachment").forEach(function(l){this._aeConnects.push(J.connect(l,"onclick",I.hitch(this,"_deleteAttachment",this._oid,l.id)))},this)}});d("extend-esri")&&I.setObject("dijit.editing.AttachmentEditor",Q,z);return Q})},"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(Q,I,J,G,u,d,c,a){return I("dijit.ProgressBar",[d,c],{progress:"0",value:"",maximum:100,places:0,indeterminate:!1,label:"",name:"",templateString:a,_indeterminateHighContrastImagePath:Q.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(w){var q="rtl"==w.toLowerCase();J.toggle(this.domNode,"dijitProgressBarRtl",q);J.toggle(this.domNode,"dijitProgressBarIndeterminateRtl",this.indeterminate&&q);this.inherited(arguments)},update:function(w){G.mixin(this,w||{});w=this.internalProgress;var q=this.domNode,e=1;this.indeterminate?q.removeAttribute("aria-valuenow"):(-1!=String(this.progress).indexOf("%")?(e=Math.min(parseFloat(this.progress)/100,1),this.progress=e*this.maximum):(this.progress=Math.min(this.progress,
this.maximum),e=this.maximum?this.progress/this.maximum:0),q.setAttribute("aria-valuenow",this.progress));q.setAttribute("aria-labelledby",this.labelNode.id);q.setAttribute("aria-valuemin",0);q.setAttribute("aria-valuemax",this.maximum);this.labelNode.innerHTML=this.report(e);J.toggle(this.domNode,"dijitProgressBarIndeterminate",this.indeterminate);J.toggle(this.domNode,"dijitProgressBarIndeterminateRtl",this.indeterminate&&!this.isLeftToRight());w.style.width=100*e+"%";this.onChange()},_setValueAttr:function(w){this._set("value",
w);Infinity==w?this.update({indeterminate:!0}):this.update({indeterminate:!1,progress:w})},_setLabelAttr:function(w){this._set("label",w);this.update()},_setIndeterminateAttr:function(w){this._set("indeterminate",w);this.update()},report:function(w){return this.label?this.label:this.indeterminate?"\x26#160;":u.format(w,{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(Q,I,J,G){var u={};u={findFeatures:function(d,c,a){var w=c.objectIdField;c=I.filter(c.graphics,function(q){return I.some(d,function(e){return q.attributes[w]===e.objectId})});if(a)a(c);else return c},getSelection:function(d){var c=[];I.forEach(d,function(a){a=a.getSelectedFeatures();I.forEach(a,function(w){c.push(w)})});return c},sortFeaturesById:function(d,c){var a=I.map(d,function(w){return w.featureLayer});c.sort(function(w,q){var e=w.getLayer(),k=q.getLayer();if(!e)return-1;if(!k)return 1;
var z=I.indexOf(a,e);k=I.indexOf(a,k);z-=k;z||(e=e.objectIdField,z=w.attributes[e]-q.attributes[e]);return z});return c}};J("extend-esri")&&Q.setObject("dijit.editing.Util.LayerHelper",u,G);return u})},"dojox/date/islamic":function(){define(["dojox/main","dojo/_base/lang","dojo/date","./islamic/Date"],function(Q,I,J,G){var u=I.getObject("date.islamic",!0,Q);u.getDaysInMonth=function(d){return d.getDaysInIslamicMonth(d.getMonth(),d.getFullYear())};u.compare=function(d,c,a){d instanceof G&&(d=d.toGregorian());
c instanceof G&&(c=c.toGregorian());return J.compare.apply(null,arguments)};u.add=function(d,c,a){var w=new G(d);switch(c){case "day":w.setDate(d.getDate()+a);break;case "weekday":var q=d.getDay();if(5>q+a&&0<q+a)w.setDate(d.getDate()+a);else{var e=c=0;5==q?(q=4,e=0<a?-1:1):6==q&&(q=4,e=0<a?-2:2);q=0<a?5-q-1:-q;var k=a-q,z=parseInt(k/5);0!=k%5&&(c=0<a?2:-2);c=c+7*z+k%5+q;w.setDate(d.getDate()+c+e)}break;case "year":w.setFullYear(d.getFullYear()+a);break;case "week":a*=7;w.setDate(d.getDate()+a);break;
case "month":d=d.getMonth();w.setMonth(d+a);break;case "hour":w.setHours(d.getHours()+a);break;case "minute":w._addMinutes(a);break;case "second":w._addSeconds(a);break;case "millisecond":w._addMilliseconds(a)}return w};u.difference=function(d,c,a){c=c||new G;a=a||"day";var w=c.getFullYear()-d.getFullYear(),q=1;switch(a){case "weekday":w=Math.round(u.difference(d,c,"day"));q=parseInt(u.difference(d,c,"week"));if(0==w%7)w=5*q;else{a=0;var e=d.getDay(),k=c.getDay();q=parseInt(w/7);c=w%7;d=new G(d);
d.setDate(d.getDate()+7*q);d=d.getDay();if(0<w)switch(!0){case 5==e:a=-1;break;case 6==e:a=0;break;case 5==k:a=-1;break;case 6==k:a=-2;break;case 5<d+c:a=-2}else if(0>w)switch(!0){case 5==e:a=0;break;case 6==e:a=1;break;case 5==k:a=2;break;case 6==k:a=1;break;case 0>d+c:a=2}w=w+a-2*q}q=w;break;case "year":q=w;break;case "month":a=c.toGregorian()>d.toGregorian()?c:d;e=c.toGregorian()>d.toGregorian()?d:c;q=a.getMonth();k=e.getMonth();if(0==w)q=a.getMonth()-e.getMonth();else for(q=12-k+q,w=e.getFullYear()+
1,a=a.getFullYear(),w;w<a;w++)q+=12;c.toGregorian()<d.toGregorian()&&(q=-q);break;case "week":q=parseInt(u.difference(d,c,"day")/7);break;case "day":q/=24;case "hour":q/=60;case "minute":q/=60;case "second":q/=1E3;case "millisecond":q*=c.toGregorian().getTime()-d.toGregorian().getTime()}return Math.round(q)};return u})},"dojox/date/islamic/Date":function(){define(["dojo/_base/lang","dojo/_base/declare","dojo/date"],function(Q,I,J){var G=I("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 u=arguments.length;u?1==u?(u=arguments[0],"number"==typeof u&&(u=new Date(u)),u instanceof Date?this.fromGregorian(u):""==u?this._date=new Date(""):(this._year=u._year,this._month=u._month,this._date=u._date,this._hours=u._hours,this._minutes=u._minutes,this._seconds=u._seconds,this._milliseconds=u._milliseconds)):3<=u&&(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(u){u=parseInt(u);if(!(0<u&&u<=this.getDaysInIslamicMonth(this._month,this._year))){var d;if(0<u)for(d=this.getDaysInIslamicMonth(this._month,this._year);u>d;u-=d,d=this.getDaysInIslamicMonth(this._month,this._year))this._month++,12<=this._month&&(this._year++,this._month-=12);else for(d=this.getDaysInIslamicMonth(0<=this._month-1?this._month-1:11,0<=this._month-1?this._year:this._year-1);0>=u;d=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),u+=d}this._date=u;return this},setFullYear:function(u){this._year=+u},setMonth:function(u){this._year+=Math.floor(u/12);this._month=0<u?Math.floor(u%12):Math.floor((u%12+12)%12)},setHours:function(){var u=arguments.length,d=0;1<=u&&(d=parseInt(arguments[0]));2<=u&&(this._minutes=parseInt(arguments[1]));3<=u&&(this._seconds=parseInt(arguments[2]));4==u&&(this._milliseconds=parseInt(arguments[3]));for(;24<=d;)this._date++,u=this.getDaysInIslamicMonth(this._month,
this._year),this._date>u&&(this._month++,12<=this._month&&(this._year++,this._month-=12),this._date-=u),d-=24;this._hours=d},_addMinutes:function(u){u+=this._minutes;this.setMinutes(u);this.setHours(this._hours+parseInt(u/60));return this},_addSeconds:function(u){u+=this._seconds;this.setSeconds(u);this._addMinutes(parseInt(u/60));return this},_addMilliseconds:function(u){u+=this._milliseconds;this.setMilliseconds(u);this._addSeconds(parseInt(u/1E3));return this},setMinutes:function(u){this._minutes=
u%60;return this},setSeconds:function(u){this._seconds=u%60;return this},setMilliseconds:function(u){this._milliseconds=u%1E3;return this},toString:function(){if(isNaN(this._date))return"Invalidate Date";var u=new Date;u.setHours(this._hours);u.setMinutes(this._minutes);u.setSeconds(this._seconds);u.setMilliseconds(this._milliseconds);return this._month+" "+this._date+" "+this._year+" "+u.toTimeString()},toGregorian:function(){var u=this._year;u=Math.floor(this._date+Math.ceil(29.5*this._month)+354*
(u-1)+Math.floor((3+11*u)/30)+this._ISLAMIC_EPOCH-1-.5)+.5;var d=u-this._GREGORIAN_EPOCH,c=Math.floor(d/146097),a=this._mod(d,146097);d=Math.floor(a/36524);var w=this._mod(a,36524);a=Math.floor(w/1461);w=this._mod(w,1461);w=Math.floor(w/365);c=400*c+100*d+4*a+w;4!=d&&4!=w&&c++;d=u-(this._GREGORIAN_EPOCH+365*(c-1)+Math.floor((c-1)/4)-Math.floor((c-1)/100)+Math.floor((c-1)/400));a=this._GREGORIAN_EPOCH-1+365*(c-1)+Math.floor((c-1)/4)-Math.floor((c-1)/100)+Math.floor((c-1)/400)+Math.floor(739/12+(J.isLeapYear(new Date(c,
3,1))?-1:-2)+1);a=u<a?0:J.isLeapYear(new Date(c,3,1))?1:2;d=Math.floor((12*(d+a)+373)/367);a=this._GREGORIAN_EPOCH-1+365*(c-1)+Math.floor((c-1)/4)-Math.floor((c-1)/100)+Math.floor((c-1)/400)+Math.floor((367*d-362)/12+(2>=d?0:J.isLeapYear(new Date(c,d-1,1))?-1:-2)+1);return new Date(c,d-1,u-a+1,this._hours,this._minutes,this._seconds,this._milliseconds)},fromGregorian:function(u){u=new Date(u);var d=u.getFullYear(),c=u.getMonth(),a=u.getDate();d=this._GREGORIAN_EPOCH-1+365*(d-1)+Math.floor((d-1)/4)+
-Math.floor((d-1)/100)+Math.floor((d-1)/400)+Math.floor((367*(c+1)-362)/12+(2>=c+1?0:J.isLeapYear(u)?-1:-2)+a);d=Math.floor(d)+.5;d-=this._ISLAMIC_EPOCH;c=Math.floor((30*d+10646)/10631);a=Math.ceil((d-29-this._yearStart(c))/29.5);a=Math.min(a,11);this._date=Math.ceil(d-this._monthStart(c,a))+1;this._month=a;this._year=c;this._hours=u.getHours();this._minutes=u.getMinutes();this._seconds=u.getSeconds();this._milliseconds=u.getMilliseconds();this._day=u.getDay();return this},valueOf:function(){return this.toGregorian().valueOf()},
_yearStart:function(u){return 354*(u-1)+Math.floor((3+11*u)/30)},_monthStart:function(u,d){return Math.ceil(29.5*d)+354*(u-1)+Math.floor((3+11*u)/30)},_civilLeapYear:function(u){return 11>(14+11*u)%30},getDaysInIslamicMonth:function(u,d){var c=0;c=29+(u+1)%2;11==u&&this._civilLeapYear(d)&&c++;return c},_mod:function(u,d){return u-d*Math.floor(u/d)}});G.getDaysInIslamicMonth=function(u){return(new G).getDaysInIslamicMonth(u.getMonth(),u.getFullYear())};return G})},"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(Q,I,J,G,u,d,c,a,w){function q(n,g,m,l,C){return C.replace(/([a-z])\1*/ig,function(A){var L=A.charAt(0);A=A.length;var y=["abbr","wide","narrow"];switch(L){case "G":var v=g.eraAbbr[0];break;case "y":v=String(n.getFullYear());break;case "M":v=n.getMonth();if(3>A){v+=1;var b=!0}else L=["months-format",y[A-3]].join("-"),v=g[L][v];break;case "d":v=n.getDate(!0);b=!0;break;case "E":v=n.getDay();3>A?(v+=1,b=!0):(L=["days-format",y[A-3]].join("-"),v=g[L][v]);break;case "a":v=12>n.getHours()?"am":
"pm";v=g["dayPeriods-format-wide-"+v];break;case "h":case "H":case "K":case "k":b=n.getHours();switch(L){case "h":v=b%12||12;break;case "H":v=b;break;case "K":v=b%12;break;case "k":v=b||24}b=!0;break;case "m":v=n.getMinutes();b=!0;break;case "s":v=n.getSeconds();b=!0;break;case "S":v=Math.round(n.getMilliseconds()*Math.pow(10,A-3));b=!0;break;case "z":if(v=G.getTimezoneName(n.toGregorian()))break;A=4;case "Z":v=n.toGregorian().getTimezoneOffset();v=[0>=v?"+":"-",c.pad(Math.floor(Math.abs(v)/60),2),
c.pad(Math.abs(v)%60,2)];4==A&&(v.splice(0,0,"GMT"),v.splice(3,0,":"));v=v.join("");break;default:throw Error("dojox.date.islamic.locale.formatPattern: invalid pattern char: "+C);}b&&(v=c.pad(v,A));return v})}function e(n,g,m,l){var C=function(y){return y};g=g||C;m=m||C;l=l||C;var A=n.match(/(''|[^'])+/g),L="'"==n.charAt(0);J.forEach(A,function(y,v){y?(A[v]=(L?m:g)(y),L=!L):A[v]=""});return l(A.join(""))}function k(n,g,m,l){l=d.escapeString(l);u.normalizeLocale(m.locale);return l.replace(/([a-z])\1*/ig,
function(C){var A=C.charAt(0);var L=C.length,y="";m.strict?1<L&&(y="0{"+(L-1)+"}"):y="0?";switch(A){case "y":A="\\d+";break;case "M":A=2<L?"\\S+ ?\\S+":y+"[1-9]|1[0-2]";break;case "d":A="[12]\\d|"+y+"[1-9]|3[01]";break;case "E":A="\\S+";break;case "h":A=y+"[1-9]|1[0-2]";break;case "k":A=y+"\\d|1[01]";break;case "H":A=y+"\\d|1\\d|2[0-3]";break;case "K":A=y+"[1-9]|1\\d|2[0-4]";break;case "m":case "s":A=y+"\\d|[0-5]\\d";break;case "S":A="\\d{"+L+"}";break;case "a":L=m.am||g["dayPeriods-format-wide-am"];
y=m.pm||g["dayPeriods-format-wide-pm"];m.strict?A=L+"|"+y:(A=L+"|"+y,L!=L.toLowerCase()&&(A+="|"+L.toLowerCase()),y!=y.toLowerCase()&&(A+="|"+y.toLowerCase()));break;default:A=".*"}n&&n.push(C);return"("+A+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}var z=I.getObject("date.islamic.locale",!0,Q);z.format=function(n,g){g=g||{};var m=u.normalizeLocale(g.locale),l=g.formatLength||"short",C=z._getIslamicBundle(m),A=[];m=I.hitch(this,q,n,C,m,g.fullYear);if("year"==g.selector)return n.getFullYear();"time"!=g.selector&&
(n=g.datePattern||C["dateFormat-"+l])&&A.push(e(n,m));"date"!=g.selector&&(g=g.timePattern||C["timeFormat-"+l])&&A.push(e(g,m));return A.join(" ")};z.regexp=function(n){return z._parseInfo(n).regexp};z._parseInfo=function(n){n=n||{};var g=u.normalizeLocale(n.locale);g=z._getIslamicBundle(g);var m=n.formatLength||"short",l=n.datePattern||g["dateFormat-"+m];m=n.timePattern||g["timeFormat-"+m];var C=[];return{regexp:e("date"==n.selector?l:"time"==n.selector?m:"undefined"==typeof m?l:l+" "+m,I.hitch(this,
k,C,g,n)),tokens:C,bundle:g}};z.parse=function(n,g){n=n.replace(/[\u200E\u200F\u202A\u202E]/g,"");g||(g={});var m=z._parseInfo(g),l=m.tokens,C=m.bundle;m=m.regexp.replace(/[\u200E\u200F\u202A\u202E]/g,"");n=(new RegExp("^"+m+"$")).exec(n);u.normalizeLocale(g.locale);if(!n)return null;var A=[1389,0,1,0,0,0,0],L="",y=["abbr","wide","narrow"];J.every(n,function(v,b){if(!b)return!0;b=l[b-1];var D=b.length;switch(b.charAt(0)){case "y":A[0]=Number(v);break;case "M":if(2<D){if(b=C["months-format-"+y[D-3]].concat(),
g.strict||(v=v.replace(".","").toLowerCase(),b=J.map(b,function(B){return B?B.replace(".","").toLowerCase():B})),v=J.indexOf(b,v),-1==v)return!1}else v--;A[1]=Number(v);break;case "D":A[1]=0;case "d":A[2]=Number(v);break;case "a":b=g.am||C["dayPeriods-format-wide-am"];D=g.pm||C["dayPeriods-format-wide-pm"];if(!g.strict){var h=/\./g;v=v.replace(h,"").toLowerCase();b=b.replace(h,"").toLowerCase();D=D.replace(h,"").toLowerCase()}if(g.strict&&v!=b&&v!=D)return!1;L=v==D?"p":v==b?"a":"";break;case "K":24==
v&&(v=0);case "h":case "H":case "k":A[3]=Number(v);break;case "m":A[4]=Number(v);break;case "s":A[5]=Number(v);break;case "S":A[6]=Number(v)}return!0});n=+A[3];"p"===L&&12>n?A[3]=n+12:"a"===L&&12==n&&(A[3]=0);return new a(A[0],A[1],A[2],A[3],A[4],A[5],A[6])};var f=[];z.addCustomFormats=function(n,g){f.push({pkg:n,name:g})};z._getIslamicBundle=function(n){var g={};J.forEach(f,function(m){m=u.getLocalization(m.pkg,m.name,n);g=I.mixin(g,m)},this);return g};z.addCustomFormats("dojo.cldr","islamic");z.getNames=
function(n,g,m,l,C){l=z._getIslamicBundle(l);n=[n,m,g];if("standAlone"==m){m=n.join("-");var A=l[m];1==A[0]&&(A=void 0)}n[1]="format";return(A||l[n.join("-")]).concat()};z.weekDays=z.getNames("days","wide","format");z.months=z.getNames("months","wide","format");return z})},"esri/dijit/editing/Add":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ./EditOperationBase".split(" "),function(Q,I,J,G,u,d){I=I(d,{declaredClass:"esri.dijit.editing.Add",type:"edit",
label:"Add Features",constructor:function(c){c=c||{};c.featureLayer?(this._featureLayer=c.featureLayer,c.addedGraphics?this._addedGraphics=c.addedGraphics:console.error("In constructor of 'esri.dijit.editing.Add', no graphics provided")):console.error("In constructor of 'esri.dijit.editing.Add', featureLayer is not provided")},updateObjectIds:function(c,a){this.updateIds(this._featureLayer,this._addedGraphics,c,a)},performUndo:function(){return this._featureLayer.applyEdits(null,null,this._addedGraphics).then(J.hitch(this,
function(){return{layer:this._featureLayer,operation:this}}))},performRedo:function(){var c=Q.map(this._addedGraphics,function(a){return a.attributes[this._featureLayer.objectIdField]},this);return this._featureLayer.applyEdits(this._addedGraphics,null,null).then(J.hitch(this,function(a,w,q){a=Q.map(a,function(e){return e.objectId});return{oldIds:c,addedIds:a,layer:this._featureLayer,operation:this}}))}});G("extend-esri")&&J.setObject("dijit.editing.Add",I,u);return I})},"esri/dijit/editing/EditOperationBase":function(){define(["dojo/_base/array",
"dojo/_base/declare","dojo/has","../../kernel","../../OperationBase"],function(Q,I,J,G,u){I=I(u,{declaredClass:"esri.EditOperationBase",updateIds:function(d,c,a,w){Q.forEach(c,function(q,e){var k=q[d.objectIdField];Q.forEach(a,function(z,f){k===z&&(q[d.objectIdField]=w[f])})})}});J("extend-esri")&&(G.EditOperationBase=I);return I})},"esri/dijit/editing/Update":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ../../geometry/jsonUtils ./EditOperationBase".split(" "),
function(Q,I,J,G,u,d,c){Q=I(c,{declaredClass:"esri.dijit.editing.Update",type:"edit",label:"Update Features",constructor:function(a){var w;a=a||{};if(a.featureLayer)if(this._featureLayer=a.featureLayer,a.preUpdatedGraphics){this._preUpdatedGraphicsGeometries=[];this._preUpdatedGraphicsAttributes=[];for(w=0;w<a.preUpdatedGraphics.length;w++)this._preUpdatedGraphicsGeometries.push(a.preUpdatedGraphics[w].geometry.toJson()),this._preUpdatedGraphicsAttributes.push(a.preUpdatedGraphics[w].attributes);
if(a.postUpdatedGraphics)for(this._postUpdatedGraphics=a.postUpdatedGraphics,this._postUpdatedGraphicsGeometries=[],this._postUpdatedGraphicsAttributes=[],w=0;w<a.postUpdatedGraphics.length;w++)a.postUpdatedGraphics[w].geometry?this._postUpdatedGraphicsGeometries.push(a.postUpdatedGraphics[w].geometry.toJson()):this._postUpdatedGraphicsGeometries.push(a.postUpdatedGraphics[w].geometry),this._postUpdatedGraphicsAttributes.push(J.clone(a.postUpdatedGraphics[w].attributes));else console.error("In constructor of 'esri.dijit.editing.Update', postUpdatedGraphics not provided")}else console.error("In constructor of 'esri.dijit.editing.Update', preUpdatedGraphics not provided");
else console.error("In constructor of 'esri.dijit.editing.Update', featureLayer not provided")},updateObjectIds:function(a,w){this.updateIds(this._featureLayer,this._preUpdatedGraphicsAttributes,a,w);this.updateIds(this._featureLayer,this._postUpdatedGraphicsAttributes,a,w)},performUndo:function(){var a;for(a=0;a<this._postUpdatedGraphics.length;a++)this._preUpdatedGraphicsGeometries[a]?this._postUpdatedGraphics[a].setGeometry(d.fromJson(this._preUpdatedGraphicsGeometries[a])):this._postUpdatedGraphics[a].setGeometry(this._preUpdatedGraphicsGeometries[a]),
this._postUpdatedGraphics[a].setAttributes(this._preUpdatedGraphicsAttributes[a]);return this._featureLayer.applyEdits(null,this._postUpdatedGraphics,null).then(J.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))},performRedo:function(){var a;for(a=0;a<this._postUpdatedGraphics.length;a++)this._postUpdatedGraphicsGeometries[a]?this._postUpdatedGraphics[a].setGeometry(d.fromJson(this._postUpdatedGraphicsGeometries[a])):this._postUpdatedGraphics[a].setGeometry(this._postUpdatedGraphicsGeometries[a]),
this._postUpdatedGraphics[a].setAttributes(this._postUpdatedGraphicsAttributes[a]);return this._featureLayer.applyEdits(null,this._postUpdatedGraphics,null).then(J.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))}});G("extend-esri")&&J.setObject("dijit.editing.Update",Q,u);return Q})},"esri/dijit/editing/Delete":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ./EditOperationBase".split(" "),function(Q,I,J,G,u,d){I=I(d,{declaredClass:"esri.dijit.editing.Delete",
type:"edit",label:"Delete Features",constructor:function(c){c=c||{};c.featureLayer?(this._featureLayer=c.featureLayer,c.deletedGraphics?this._deletedGraphics=c.deletedGraphics:console.error("In constructor of 'esri.dijit.editing.Delete', no graphics provided")):console.error("In constructor of 'esri.dijit.editing.Delete', featureLayer is not provided")},updateObjectIds:function(c,a){this.updateIds(this._featureLayer,this._deletedGraphics,c,a)},performUndo:function(){var c=Q.map(this._deletedGraphics,
function(a){return a.attributes[this._featureLayer.objectIdField]},this);return this._featureLayer.applyEdits(this._deletedGraphics,null,null).then(J.hitch(this,function(a,w,q){a=Q.map(a,function(e){return e.objectId});return{oldIds:c,addedIds:a,layer:this._featureLayer,operation:this}}))},performRedo:function(){return this._featureLayer.applyEdits(null,null,this._deletedGraphics).then(J.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))}});G("extend-esri")&&J.setObject("dijit.editing.Delete",
I,u);return I})},"esri/dijit/editing/Cut":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ../../geometry/jsonUtils ./EditOperationBase".split(" "),function(Q,I,J,G,u,d,c){I=I(c,{declaredClass:"esri.dijit.editing.Cut",type:"edit",label:"Cut Features",constructor:function(a){var w;a=a||{};if(a.featureLayer)if(this._featureLayer=a.featureLayer,a.addedGraphics)if(this._addedGraphics=a.addedGraphics,a.preUpdatedGraphics){this._preUpdatedGraphicsGeometries=[];
this._preUpdatedGraphicsAttributes=[];for(w=0;w<a.preUpdatedGraphics.length;w++)this._preUpdatedGraphicsGeometries.push(a.preUpdatedGraphics[w].geometry.toJson()),this._preUpdatedGraphicsAttributes.push(a.preUpdatedGraphics[w].attributes);if(a.postUpdatedGraphics)for(this._postUpdatedGraphics=a.postUpdatedGraphics,this._postUpdatedGraphicsGeometries=[],this._postUpdatedGraphicsAttributes=[],w=0;w<a.postUpdatedGraphics.length;w++)this._postUpdatedGraphicsGeometries.push(a.postUpdatedGraphics[w].geometry.toJson()),
this._postUpdatedGraphicsAttributes.push(J.clone(a.postUpdatedGraphics[w].attributes));else console.error("In constructor of 'esri.dijit.editing.Cut', postUpdatedGraphics not provided")}else console.error("In constructor of 'esri.dijit.editing.Cut', preUpdatedGraphics not provided");else console.error("In constructor of 'esri.dijit.editing.Cut', addedGraphics for cut not provided");else console.error("In constructor of 'esri.dijit.editing.Cut', featureLayer not provided")},updateObjectIds:function(a,
w){this.updateIds(this._featureLayer,this._preUpdatedGraphicsAttributes,a,w);this.updateIds(this._featureLayer,this._postUpdatedGraphicsAttributes,a,w);this.updateIds(this._featureLayer,this._addedGraphics,a,w)},performUndo:function(){var a;for(a=0;a<this._postUpdatedGraphics.length;a++)this._postUpdatedGraphics[a].setGeometry(d.fromJson(this._preUpdatedGraphicsGeometries[a])),this._postUpdatedGraphics[a].setAttributes(this._preUpdatedGraphicsAttributes[a]);return this._featureLayer.applyEdits(null,
this._postUpdatedGraphics,this._addedGraphics).then(J.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))},performRedo:function(){var a;for(a=0;a<this._postUpdatedGraphics.length;a++)this._postUpdatedGraphics[a].setGeometry(d.fromJson(this._postUpdatedGraphicsGeometries[a])),this._postUpdatedGraphics[a].setAttributes(this._postUpdatedGraphicsAttributes[a]);var w=Q.map(this._addedGraphics,function(q){return q.attributes[this._featureLayer.objectIdField]},this);return this._featureLayer.applyEdits(this._addedGraphics,
this._postUpdatedGraphics,null).then(J.hitch(this,function(q,e,k){q=Q.map(q,function(z){return z.objectId});return{oldIds:w,addedIds:q,layer:this._featureLayer,operation:this}}))}});G("extend-esri")&&J.setObject("dijit.editing.Cut",I,u);return I})},"esri/dijit/editing/Union":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ../../geometry/jsonUtils ./EditOperationBase".split(" "),function(Q,I,J,G,u,d,c){I=I(c,{declaredClass:"esri.dijit.editing.Union",type:"edit",
label:"Union Features",constructor:function(a){a=a||{};this._featureLayer=a.featureLayer;this._deletedGraphics=a.deletedGraphics;this._preUpdatedGraphics=a.preUpdatedGraphics;this._postUpdatedGraphics=a.postUpdatedGraphics;this._preUpdatedGraphicsGeometries=[];this._preUpdatedGraphicsAttributes=[];this._postUpdatedGraphicsGeometries=[];this._postUpdatedGraphicsAttributes=[];var w;for(w=0;w<a.preUpdatedGraphics.length;w++)this._preUpdatedGraphicsGeometries.push(a.preUpdatedGraphics[w].geometry.toJson()),
this._preUpdatedGraphicsAttributes.push(a.preUpdatedGraphics[w].attributes);for(w=0;w<a.postUpdatedGraphics.length;w++)this._postUpdatedGraphicsGeometries.push(a.postUpdatedGraphics[w].geometry.toJson()),this._postUpdatedGraphicsAttributes.push(J.clone(a.postUpdatedGraphics[w].attributes))},updateObjectIds:function(a,w){this.updateIds(this._featureLayer,this._preUpdatedGraphicsAttributes,a,w);this.updateIds(this._featureLayer,this._postUpdatedGraphicsAttributes,a,w);this.updateIds(this._featureLayer,
this._deletedGraphics,a,w)},performUndo:function(){var a;for(a=0;a<this._postUpdatedGraphics.length;a++)this._postUpdatedGraphics[a].setGeometry(d.fromJson(this._preUpdatedGraphicsGeometries[a])),this._postUpdatedGraphics[a].setAttributes(this._preUpdatedGraphicsAttributes[a]);var w=Q.map(this._deletedGraphics,function(q){return q.attributes[this._featureLayer.objectIdField]},this);return this._featureLayer.applyEdits(this._deletedGraphics,this._postUpdatedGraphics,null).then(J.hitch(this,function(q,
e,k){q=Q.map(q,function(z){return z.objectId});return{oldIds:w,addedIds:q,layer:this._featureLayer,operation:this}}))},performRedo:function(){var a;for(a=0;a<this._postUpdatedGraphics.length;a++)this._postUpdatedGraphics[a].setGeometry(d.fromJson(this._postUpdatedGraphicsGeometries[a])),this._postUpdatedGraphics[a].setAttributes(this._postUpdatedGraphicsAttributes[a]);return this._featureLayer.applyEdits(null,this._postUpdatedGraphics,this._deletedGraphics).then(J.hitch(this,function(){return{layer:this._featureLayer,
operation:this}}))}});G("extend-esri")&&J.setObject("dijit.editing.Union",I,u);return I})},"esri/dijit/editing/toolbars/Drawing":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has dijit/_CssStateMixin ../Util ./ToolbarBase ../tools/ButtonToolBase ../tools/Cut ../tools/Union ../tools/Reshape ../tools/Editing ../tools/EditingTools ../tools/Selection ../tools/SelectionTools ../../../kernel".split(" "),function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m){Q=Q([a,
d],{declaredClass:"esri.dijit.editing.toolbars.Drawing",onShowAttributeInspector:function(){},_activateTool:function(l,C){this._settings.editor._activeTool=l;"EDITING"!==l&&this._settings.templatePicker.clearSelection();"ATTRIBUTES"!==l&&this._settings.editor._hideAttributeInspector();"CLEAR"!==l&&this.inherited(arguments)},_initializeToolbar:function(){J.forEach(this._settings.layers,function(l){this._tbConnects.push(G.connect(l,"onSelectionComplete",this,"_updateUI"))},this)},activateEditing:function(l,
C){this._tools.EDITING._activateTool(l,C.geometryType);this._activeTool=this._tools.EDITING;this._activeTool.setChecked(!0)},_updateUI:function(){this._settings.undoManager&&(this._tools.UNDO.set("disabled",!1===this._settings.undoManager.canUndo),this._tools.REDO.set("disabled",!1===this._settings.undoManager.canRedo));this._selectedFeatures=c.getSelection(this._settings.layers);var l=this._selectedFeatures.length;this._tools.DELETE&&this._tools.DELETE.set("disabled",0>=l);this._tools.CLEAR&&this._tools.CLEAR.set("disabled",
0>=l);this._tools.ATTRIBUTES&&this._tools.ATTRIBUTES.set("disabled",0>=l);this._tools.UNION&&this._tools.UNION.set("disabled",2>l)},_toolFinished:function(l){if("ATTRIBUTES"===l&&this._selectedFeatures&&this._selectedFeatures.length)this.onShowAttributeInspector(this._selectedFeatures[0]);if("SELECT"===l||"CUT"===l||"RESHAPING"===l||"EDITING"===l)this._activeTool.deactivate(),this._activeTool.setChecked(!1),this._activeTool=null;if("DELETE"===l)this.onDelete();this._settings.editor._activeTool=null;
this._updateUI()},_createTools:function(){this._tools.SELECT=new n({settings:this._settings,onClick:I.hitch(this,"_activateTool","SELECT",!0),onFinished:I.hitch(this,"_toolFinished","SELECT")});this.addChild(this._tools.SELECT);this._tools.CLEAR=new w(I.mixin(g.selectClear,{settings:this._settings,onClick:I.hitch(this._settings.editor,"_clearSelection",!1)}));this.addChild(this._tools.CLEAR);this._createSeparator();this._tools.ATTRIBUTES=new w(I.mixin(f.attributes,{settings:this._settings,onClick:I.hitch(this,
"_toolFinished","ATTRIBUTES")}));this.addChild(this._tools.ATTRIBUTES);this._createSeparator();this._tools.EDITING=new z({settings:this._settings,onClick:I.hitch(this,"_activateTool","EDITING",!0),onApplyEdits:I.hitch(this,"onApplyEdits"),onFinished:I.hitch(this,"_toolFinished","EDITING")});this.addChild(this._tools.EDITING);this._tools.DELETE=new w(I.mixin(f.del,{settings:this._settings,onClick:I.hitch(this,"_toolFinished","DELETE")}));this.addChild(this._tools.DELETE);this._settings.toolbarOptions&&
((this._settings.toolbarOptions.cutVisible||this._settings.toolbarOptions.mergeVisible||this._settings.toolbarOptions.reshapeVisible)&&this._createSeparator(),this._settings.toolbarOptions.cutVisible&&(this._tools.CUT=new q({settings:this._settings,onFinished:I.hitch(this,"_toolFinished","CUT"),onClick:I.hitch(this,"_activateTool","CUT",!0),onApplyEdits:I.hitch(this,"onApplyEdits")}),this.addChild(this._tools.CUT)),this._settings.toolbarOptions.mergeVisible&&(this._tools.UNION=new e({settings:this._settings,
onFinished:I.hitch(this,"_toolFinished","UNION"),onApplyEdits:I.hitch(this,"onApplyEdits")}),this.addChild(this._tools.UNION)),this._settings.toolbarOptions.reshapeVisible&&(this._tools.RESHAPING=new k({settings:this._settings,onClick:I.hitch(this,"_activateTool","RESHAPING",!0),onFinished:I.hitch(this,"_toolFinished","RESHAPING"),onApplyEdits:I.hitch(this,"onApplyEdits")}),this.addChild(this._tools.RESHAPING)));this._settings.enableUndoRedo&&(this._createSeparator(),this._tools.UNDO=new w(I.mixin(f.undo,
{settings:this._settings,disabled:!0,onClick:I.hitch(this,function(){this._tools.UNDO.set("disabled",!0);this._tools.REDO.set("disabled",!0);this._settings.editor._undo()})})),this.addChild(this._tools.UNDO),this._tools.REDO=new w(I.mixin(f.redo,{settings:this._settings,disabled:!0,onClick:I.hitch(this,function(){this._tools.UNDO.set("disabled",!0);this._tools.REDO.set("disabled",!0);this._settings.editor._redo()})})),this.addChild(this._tools.REDO))}});u("extend-esri")&&I.setObject("dijit.editing.toolbars.Drawing",
Q,m);return Q})},"esri/dijit/editing/toolbars/ToolbarBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has dijit/Toolbar dijit/ToolbarSeparator ../../../kernel ../../../lang".split(" "),function(Q,I,J,G,u,d,c,a,w){Q=Q([d],{declaredClass:"esri.dijit.editing.toolbars.ToolbarBase",_enabled:!0,graphicsAdded:function(){},drawEnd:function(){},onApplyEdits:function(){},onDelete:function(){},constructor:function(q,e){q&&q.settings&&(this._tools=[],this._tbConnects=
[],this._initialize(q.settings))},postCreate:function(){this._createTools();this.deactivate()},destroy:function(){var q,e=this._tools;for(q in e)e.hasOwnProperty(q)&&w.isDefined(this._tools[q])&&this._tools[q].destroy();J.forEach(this._tbConnects,G.disconnect);this.inherited(arguments)},activate:function(q){this._enabled=!0},deactivate:function(){var q;this._enabled=!1;this._geometryType=this._layer=null;var e=this._tools;for(q in e)e.hasOwnProperty(q)&&(this._tools[q].deactivate(),this._tools[q].setChecked(!1))},
isEnabled:function(){return this._enabled},setActiveSymbol:function(q){this._activeSymbol=q},_getSymbol:function(){},_createTools:function(){},_initialize:function(q){this._settings=q;this._toolbar=q.drawToolbar;this._editToolbar=q.editToolbar;this._initializeToolbar()},_activateTool:function(q,e){this._activeTool&&this._activeTool.deactivate();!0===e&&this._activeTool==this._tools[q]?(this._activeTool.setChecked(!1),this._activeTool=null):(this._activeTool=this._tools[q],this._activeTool.setChecked(!0),
this._activeTool.activate(null))},_createSeparator:function(){this.addChild(new c)}});u("extend-esri")&&I.setObject("dijit.editing.toolbars.ToolbarBase",Q,a);return Q})},"esri/dijit/editing/tools/ButtonToolBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dijit/form/Button ./ToolBase ../../../kernel".split(" "),function(Q,I,J,G,u,d){Q=Q([G,u],{declaredClass:"esri.dijit.editing.tools.ButtonToolBase",postCreate:function(){this.inherited(arguments);this._setShowLabelAttr&&this._setShowLabelAttr(!1)},
destroy:function(){G.prototype.destroy.apply(this,arguments);u.prototype.destroy.apply(this,arguments)}});J("extend-esri")&&I.setObject("dijit.editing.tools.ButtonToolBase",Q,d);return Q})},"esri/dijit/editing/tools/ToolBase":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../../../kernel","dojo/i18n!../../../nls/jsapi"],function(Q,I,J,G,u){Q=Q(null,{declaredClass:"esri.dijit.editing.tools.ToolBase",_enabled:!0,showLabel:!1,constructor:function(d,c){d=d||{};I.mixin(this,d);this.label=
this._label?u.widgets.editor.tools[this._label]:"";this._settings=d.settings;this._toolbar=d.settings.drawToolbar;this._editToolbar=d.settings.editToolbar;this._initializeTool()},onFinished:function(){},onDrawEnd:function(){},onApplyEdits:function(){},postCreate:function(){this.deactivate();this.inherited(arguments)},destroy:function(){},activate:function(d){this._toolbar&&this._toolbar.deactivate();this._editToolbar&&this._editToolbar.deactivate();this._enabled&&(this._checked=!0,this._layer=d,this._toolbar&&
this._drawType&&this._toolbar.activate(this._drawType))},deactivate:function(){this._toolbar&&this._toolbar.deactivate();this._editToolbar&&this._editToolbar.deactivate();this.setChecked(!1);this._updateUI()},setEnabled:function(d){this._enabled=d;this._updateUI()},setChecked:function(d){this._checked=d},enable:function(d){this._updateUI()},isEnabled:function(){return this._enabled},getToolName:function(){return this._toolName},_initializeTool:function(){},_updateUI:function(){this.disabled=!this._enabled;
this.attr("iconClass",this._enabled?this._enabledIcon:this._disabledIcon)}});J("extend-esri")&&I.setObject("dijit.editing.tools.ToolBase",Q,G);return Q})},"esri/dijit/editing/tools/Cut":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has dojo/DeferredList ../../../graphicsUtils ../../../graphic ../../../tasks/query ../../../layers/FeatureLayer ../../../toolbars/draw ../Cut ./ToggleToolBase ../../../kernel".split(" "),function(Q,I,J,G,u,d,c,a,w,q,e,k,
z,f){Q=Q([z],{declaredClass:"esri.dijit.editing.tools.Cut",id:"btnFeatureCut",_enabledIcon:"toolbarIcon cutIcon",_disabledIcon:"toolbarIcon cutIcon",_drawType:e.POLYLINE,_enabled:!0,_label:"NLS_cutLbl",_cutConnects:[],activate:function(){this._cutConnects.push(G.connect(this._toolbar,"onDrawEnd",this,"_onDrawEnd"));this.inherited(arguments)},deactivate:function(){this.inherited(arguments);J.forEach(this._cutConnects,G.disconnect);this._cutConnects=[];this._edits=[]},_onDrawEnd:function(n){var g=this._cutLayers=
J.filter(this._settings.layers,function(l){return"esriGeometryPolygon"===l.geometryType||"esriGeometryPolyline"===l.geometryType&&l.visible&&l._isMapAtVisibleScale()});this._cutConnects=this._cutConnects.concat(J.map(g,I.hitch(this,function(l){return G.connect(l,"onEditsComplete",I.hitch(this,function(C,A,L){if(this._settings.undoRedoManager){var y=this._settings.undoRedoManager;J.forEach(this._edits,I.hitch(this,function(v){y.add(new k({featureLayer:v.layer,addedGraphics:v.adds,preUpdatedGraphics:v.preUpdates,
postUpdatedGraphics:v.updates}))}),this)}this.onFinished()}))})));var m=new w;m.geometry=n;J.forEach(g,function(l,C){this._settings.editor._selectionHelper.selectFeatures([l],m,q.SELECTION_NEW,I.hitch(this,"_cutFeatures",l,m))},this)},_cutFeatures:function(n,g,m){if(m&&m.length){this._edits=[];var l=[];l.push(this._settings.geometryService.cut(c.getGeometries(m),g.geometry,I.hitch(this,"_cutHandler",n,m)));(new d(l)).addCallback(I.hitch(this,function(){this.onApplyEdits(this._edits)}))}},_cutHandler:function(n,
g,m){var l=[],C=[],A=J.map(g,function(v){return new a(I.clone(v.toJson()))}),L,y;J.forEach(m.cutIndexes,function(v,b){L!=v?(L=v,C.push(g[v].setGeometry(m.geometries[b]))):(y=new a(m.geometries[b],null,I.mixin({},g[v].attributes),null),y.attributes[g[0].getLayer().objectIdField]=null,l.push(y))},this);this._edits.push({layer:n,adds:l,updates:C,preUpdates:A})}});u("extend-esri")&&I.setObject("dijit.editing.tools.Cut",Q,f);return Q})},"esri/dijit/editing/tools/ToggleToolBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dijit/form/ToggleButton ./ToolBase ../../../kernel".split(" "),
function(Q,I,J,G,u,d){Q=Q([G,u],{declaredClass:"esri.dijit.editing.tools.ToggleToolBase",postCreate:function(){this.inherited(arguments);this._setShowLabelAttr&&this._setShowLabelAttr(!1)},destroy:function(){G.prototype.destroy.apply(this,arguments);u.prototype.destroy.apply(this,arguments)},setChecked:function(c){G.prototype.setChecked.apply(this,arguments)}});J("extend-esri")&&I.setObject("dijit.editing.tools.ToggleToolBase",Q,d);return Q})},"esri/dijit/editing/tools/Union":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../../../graphicsUtils ../../../graphic ../../../toolbars/draw ../Union ./ButtonToolBase ../../../kernel".split(" "),
function(Q,I,J,G,u,d,c,a,w,q){Q=Q([w],{declaredClass:"esri.dijit.editing.tools.Union",id:"btnFeatureUnion",_enabledIcon:"toolbarIcon unionIcon",_disabledIcon:"toolbarIcon unionIcon",_drawType:c.POLYLINE,_enabled:!0,_label:"NLS_unionLbl",_onClick:function(e){this._settings.editor._activeTool="UNION";e=J.filter(this._settings.layers,function(f){return"esriGeometryPolygon"===f.geometryType&&f.visible&&f._isMapAtVisibleScale()});var k=[],z=0;J.forEach(e,function(f,n){var g=f.getSelectedFeatures();2<=
g.length&&(z++,this._settings.geometryService.union(u.getGeometries(g),I.hitch(this,function(m){var l=g.shift(),C=[],A=[];C.push(new d(l.toJson()));A.push(l.setGeometry(m));k.push({layer:f,updates:A,deletes:g,preUpdates:C});z--;if(0>=z)this.onApplyEdits(k,I.hitch(this,function(){if(this._settings.undoRedoManager){var L=this._settings.undoRedoManager;J.forEach(this._edits,I.hitch(this,function(y){L.add(new a({featureLayer:y.layer,deletedGraphics:y.deletes,preUpdatedGraphics:y.preUpdates,postUpdatedGraphics:y.updates}))}),
this)}this._settings.editor._selectionHelper.clearSelection(!1);this.onFinished()}))})))},this)}});G("extend-esri")&&I.setObject("dijit.editing.tools.Union",Q,q);return Q})},"esri/dijit/editing/tools/Reshape":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has ../../../graphic ../../../layers/FeatureLayer ../../../tasks/query ../../../toolbars/draw ./ToggleToolBase ../../../kernel".split(" "),function(Q,I,J,G,u,d,c,a,w,q,e){Q=Q([q],{declaredClass:"esri.dijit.editing.tools.Reshape",
id:"btnFeatureReshape",_enabledIcon:"toolbarIcon reshapeIcon",_disabledIcon:"toolbarIcon reshapeIcon",_drawType:w.POLYLINE,_enabled:!0,_label:"NLS_reshapeLbl",activate:function(){G.disconnect(this._rConnect);this._rConnect=G.connect(this._toolbar,"onDrawEnd",this,"_onDrawEnd");this.inherited(arguments)},deactivate:function(){this.inherited(arguments);G.disconnect(this._rConnect);delete this._rConnect},_onDrawEnd:function(k){var z=this._settings.layers,f=new a;f.geometry=k;k=this._reshapeLayers=J.filter(z,
function(n){return"esriGeometryPolygon"===n.geometryType||"esriGeometryPolyline"});this._settings.editor._selectionHelper.selectFeatures(k,f,c.SELECTION_NEW,I.hitch(this,"_reshape",f))},_reshape:function(k,z){if(1===z.length){var f=[],n=[],g=[],m=z[0],l=m.getLayer();this._settings.geometryService.reshape(m.geometry,k.geometry,I.hitch(this,function(C){"polyline"===C.type&&C.paths&&0===C.paths.length?(this._settings.editor._selectionHelper.clearSelection(!1),this.onFinished()):"polygon"===C.type&&C.rings&&
0===C.rings.length?(this._settings.editor._selectionHelper.clearSelection(!1),this.onFinished()):(g.push(new d(m.toJson())),n.push(m.setGeometry(C)),f.push({layer:l,updates:n,preUpdates:g}),this.onApplyEdits(f,I.hitch(this,function(){this._settings.editor._selectionHelper.clearSelection(!1);this.onFinished()})))}))}}});u("extend-esri")&&I.setObject("dijit.editing.tools.Reshape",Q,e);return Q})},"esri/dijit/editing/tools/Editing":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../../../layers/FeatureTemplate ./Edit ./EditingTools ./DropDownToolBase ../../../kernel ../../../lang".split(" "),
function(Q,I,J,G,u,d,c,a,w,q){Q=Q([a],{declaredClass:"esri.dijit.editing.tools.Editing",_enabled:!1,deactivate:function(){this._enabled&&(this._enabled=!1,this.inherited(arguments),this._settings.templatePicker.clearSelection())},onItemClicked:function(e,k){this.inherited(arguments);this._activeTool===this._tools.AUTOCOMPLETE&&(this._settings.editor._drawingTool=u.TOOL_AUTO_COMPLETE_POLYGON)},_activateTool:function(e,k){var z;this.enable(k);for(z in this._tools)this._tools.hasOwnProperty(z)&&(this.dropDown.removeChild(this._tools[z]),
!0===this._tools[z]._enabled&&this.dropDown.addChild(this._tools[z]));if(this._geometryType!==k||!1===this._activeTool._enabled)this._activeTool=this._tools[e.toUpperCase()];this._geometryType=k;this._activeTool.activate();this._activeTool.setChecked(!0);this._updateUI()},_initializeTool:function(e){this.inherited(arguments);this._initializeTools()},_initializeTools:function(){var e=this._settings.layers,k=this._settings.editor,z=!1,f=!1,n=!1,g=this._toolTypes=[],m;J.forEach(e,function(l){m=l.geometryType;
z=z||"esriGeometryPoint"===m;f=f||"esriGeometryPolyline"===m;n=n||"esriGeometryPolygon"===m;g=g.concat(J.map(this._getTemplatesFromLayer(l),I.hitch(this,function(C){return k._toDrawTool(C.drawingTool,l)})))},this);e=this._settings.createOptions;z&&this._toolTypes.push("point");f&&(this._toolTypes=this._toolTypes.concat(e.polylineDrawTools));n&&(this._toolTypes=this._toolTypes.concat(e.polygonDrawTools));this._toolTypes=this._toUnique(this._toolTypes.concat(g))},_toUnique:function(e){var k={};return J.filter(e,
function(z){return k[z]?!1:k[z]=!0})},_getTemplatesFromLayer:function(e){var k=e.templates||[];J.forEach(e.types,function(z){k=k.concat(z.templates)});return J.filter(k,q.isDefined)},_createTools:function(){J.forEach(this._toolTypes,this._createTool,this);this.inherited(arguments)},_createTool:function(e){var k=I.mixin(c[e],{settings:this._settings,onClick:I.hitch(this,"onItemClicked",c[e].id)});this._tools[e.toUpperCase()]=new d(k)}});G("extend-esri")&&I.setObject("dijit.editing.tools.Editing",Q,
w);return Q})},"esri/dijit/editing/tools/Edit":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","./MenuItemBase","../../../kernel"],function(Q,I,J,G,u){Q=Q([G],{declaredClass:"esri.dijit.editing.tools.Edit",enable:function(d){this._enabled=d===this._geomType;this.inherited(arguments)}});J("extend-esri")&&I.setObject("dijit.editing.tools.Edit",Q,u);return Q})},"esri/dijit/editing/tools/MenuItemBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dijit/MenuItem ./ToolBase ../../../kernel".split(" "),
function(Q,I,J,G,u,d){Q=Q([G,u],{declaredClass:"esri.dijit.editing.tools.MenuItemBase",destroy:function(){G.prototype.destroy.apply(this,arguments);u.prototype.destroy.apply(this,arguments)}});J("extend-esri")&&I.setObject("dijit.editing.tools.MenuItemBase",Q,d);return Q})},"esri/dijit/editing/tools/EditingTools":function(){define(["dojo/_base/lang","dojo/has","../../../toolbars/draw","../../../kernel"],function(Q,I,J,G){J={point:{id:"esriPointTool",_enabledIcon:"toolbarIcon pointIcon",_disabledIcon:"toolbarIcon pointIconDisabled",
_drawType:J.POINT,_geomType:"esriGeometryPoint",_label:"NLS_pointLbl"},polyline:{id:"toolDrawFreehandPolyline",_enabledIcon:"toolbarIcon polylineIcon",_disabledIcon:"toolbarIcon polylineIconDisabled",_drawType:J.POLYLINE,_geomType:"esriGeometryPolyline",_label:"NLS_polylineLbl"},freehandpolyline:{id:"toolDrawPolyline",_enabledIcon:"toolbarIcon freehandPolylineIcon",_disabledIcon:"toolbarIcon freehandPolylineIcon",_drawType:J.FREEHAND_POLYLINE,_geomType:"esriGeometryPolyline",_label:"NLS_freehandPolylineLbl"},
polygon:{id:"toolDrawPolygon",_enabledIcon:"toolbarIcon polygonIcon",_disabledIcon:"toolbarIcon polygonIconDisabled",_drawType:J.POLYGON,_geomType:"esriGeometryPolygon",_label:"NLS_polygonLbl"},freehandpolygon:{id:"toolDrawFreehandPolygon",_enabledIcon:"toolbarIcon freehandPolygonIcon",_disabledIcon:"toolbarIcon freehandPolygonIconDisabled",_drawType:J.FREEHAND_POLYGON,_label:"NLS_freehandPolygonLbl",_geomType:"esriGeometryPolygon"},autocomplete:{id:"btnFeatureAutoComplete",_enabledIcon:"toolbarIcon autoCompleteIcon",
_disabledIcon:"toolbarIcon autoCompleteIcon",_drawType:J.POLYGON,_label:"NLS_autoCompleteLbl",_geomType:"esriGeometryPolygon"},rectangle:{id:"toolDrawRect",_enabledIcon:"toolbarIcon rectangleIcon",_disabledIcon:"toolbarIcon rectangleIcon",_drawType:J.RECTANGLE,_geomType:"esriGeometryPolygon",_label:"NLS_rectangleLbl"},arrow:{id:"toolDrawArrow",_enabledIcon:"toolbarIcon arrowIcon",_disabledIcon:"toolbarIcon arrowIcon",_drawType:J.ARROW,_geomType:"esriGeometryPolygon",_label:"NLS_arrowLbl"},uparrow:{id:"toolDrawArrowUp",
_enabledIcon:"toolbarIcon arrowUpIcon",_disabledIcon:"toolbarIcon arrowUpIcon",_drawType:J.UP_ARROW,_geomType:"esriGeometryPolygon",_label:"NLS_arrowUpLbl"},downarrow:{id:"toolDrawDownArrow",_enabledIcon:"toolbarIcon arrowDownIcon",_disabledIcon:"toolbarIcon arrowDownIcon",_drawType:J.DOWN_ARROW,_geomType:"esriGeometryPolygon",_label:"NLS_arrowDownLbl"},leftarrow:{id:"toolDrawLeftArrow",_enabledIcon:"toolbarIcon arrowLeftIcon",_disabledIcon:"toolbarIcon arrowLeftIcon",_drawType:J.LEFT_ARROW,_geomType:"esriGeometryPolygon",
_label:"NLS_arrowLeftLbl"},rightarrow:{id:"toolDrawRightArrow",_enabledIcon:"toolbarIcon arrowIcon",_disabledIcon:"toolbarIcon arrowIcon",_drawType:J.RIGHT_ARROW,_geomType:"esriGeometryPolygon",_label:"NLS_arrowRightLbl"},circle:{id:"toolDrawCircle",_enabledIcon:"toolbarIcon circleIcon",_disabledIcon:"toolbarIcon circleIcon",_drawType:J.CIRCLE,_geomType:"esriGeometryPolygon",_label:"NLS_circleLbl"},ellipse:{id:"toolDrawEllipse",_enabledIcon:"toolbarIcon ellipseIcon",_disabledIcon:"toolbarIcon ellipseIcon",
_drawType:J.ELLIPSE,_geomType:"esriGeometryPolygon",_label:"NLS_ellipseLbl"},triangle:{id:"toolDrawTriangle",_enabledIcon:"toolbarIcon triangleIcon",_disabledIcon:"toolbarIcon triangleIcon",_drawType:J.TRIANGLE,_geomType:"esriGeometryPolygon",_label:"NLS_triangleLbl"},attributes:{id:"btnAttributes",_enabledIcon:"toolbarIcon attributesIcon",_disabledIcon:"toolbarIcon attributesIcon",_enabled:!1,_label:"NLS_attributesLbl"},del:{id:"btnDelete2",_enabledIcon:"toolbarIcon deleteFeatureIcon",_disabledIcon:"toolbarIcon deleteFeatureIcon",
_enabled:!1,_label:"NLS_deleteLbl"},undo:{id:"btnUndo",_enabledIcon:"dijitEditorIcon dijitEditorIconUndo",_disabledIcon:"dijitEditorIcon dijitEditorIconUndo",_enabled:!1,_label:"NLS_undoLbl"},redo:{id:"btnRedo",_enabledIcon:"dijitEditorIcon dijitEditorIconRedo",_disabledIcon:"dijitEditorIcon dijitEditorIconRedo",_enabled:!1,_label:"NLS_redoLbl"}};I("extend-esri")&&Q.setObject("dijit.editing.tools.EditingTools",J,G);return J})},"esri/dijit/editing/tools/DropDownToolBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dojo/dom-style dijit/registry dijit/Menu dijit/form/ComboButton ./ToolBase ../../../kernel ../../../lang".split(" "),
function(Q,I,J,G,u,d,c,a,w,q){Q=Q([c,a],{declaredClass:"esri.dijit.editing.tools.DropDownToolBase",_enabled:!1,_checked:!1,postCreate:function(){this._tools=[];this._createTools();this.inherited(arguments);this._setShowLabelAttr&&this._setShowLabelAttr(!1)},destroy:function(){var e,k=this._tools;for(e in k)k.hasOwnProperty(e)&&q.isDefined(k[e])&&k[e].destroy();this.inherited(arguments)},_createTools:function(){var e,k=new d;this.dropDown=k;for(e in this._tools)this._tools.hasOwnProperty(e)&&k.addChild(this._tools[e]);
this._activeTool=k.getChildren()[0];this._updateUI()},activate:function(e){this.inherited(arguments);this._activeTool?this._activeTool.activate():this._activateDefaultTool()},deactivate:function(){this.inherited(arguments);this._activeTool&&this._activeTool.deactivate()},enable:function(e){for(var k in this._tools)this._tools.hasOwnProperty(k)&&this._tools[k].enable(e);this.setEnabled(!0);this.inherited(arguments)},setChecked:function(e){this._checked=e;this._updateUI()},_onDrawEnd:function(e){},
onLayerChange:function(e,k,z){this._activeTool=null;this._activeType=k;this._activeTemplate=z;this._activeLayer=e},onItemClicked:function(e,k){this._activeTool&&this._activeTool.deactivate();this._activeTool=u.byId(e);!1===this._checked?this._onClick():(this._updateUI(),this._activeTool&&(this._activeTool.activate(),this._activeTool.setChecked(!0)))},_onClick:function(e){!1!==this._enabled&&(this._checked=!this._checked,this.inherited(arguments))},_updateUI:function(){this.attr("disabled",!this._enabled);
G.set(this.focusNode,{outline:"none"});G.set(this.titleNode,{padding:"0px",border:"none"});this._checked?G.set(this.titleNode,{backgroundColor:"#D4DFF2",border:"1px solid #316AC5"}):G.set(this.titleNode,{backgroundColor:"",border:""});this._activeTool&&(this.attr("iconClass",this._checked?this._activeTool._enabledIcon:this._activeTool._disabledIcon),this.attr("label",this._activeTool.label))}});J("extend-esri")&&I.setObject("dijit.editing.tools.DropDownToolBase",Q,w);return Q})},"esri/dijit/editing/tools/Selection":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/Color dojo/has ../../../symbols/SimpleMarkerSymbol ../../../symbols/SimpleLineSymbol ../../../symbols/SimpleFillSymbol ./Edit ./SelectionTools ./DropDownToolBase ../../../kernel".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z){Q=Q([k],{declaredClass:"esri.dijit.editing.tools.Selection",_enabled:!0,activate:function(){this.inherited(arguments);this._sConnect=G.connect(this._toolbar,"onDrawEnd",this,"_onDrawEnd")},deactivate:function(){this.inherited(arguments);G.disconnect(this._sConnect);delete this._sConnect},_initializeTool:function(){this._createSymbols();this._initializeLayers();this._toolTypes=["select","selectadd","selectremove"]},_onDrawEnd:function(f){this.inherited(arguments);
this._settings.editor._hideAttributeInspector();var n=this._settings.layers;this._selectMethod=this._activeTool._selectMethod;this._settings.editor._selectionHelper.selectFeaturesByGeometry(n,f,this._selectMethod,I.hitch(this,"onFinished"))},_createSymbols:function(){this._pointSelectionSymbol=new c(c.STYLE_CIRCLE,10,new a(a.STYLE_SOLID,new u([0,0,0]),1),new u([255,0,0,.5]));this._polylineSelectionSymbol=new a(a.STYLE_SOLID,new u([0,200,255]),2);this._polygonSelectionSymbol=new w(w.STYLE_SOLID,new a(a.STYLE_SOLID,
new u([0,0,0]),1),new u([0,200,255,.5]))},_initializeLayers:function(){J.forEach(this._settings.layers,this._setSelectionSymbol,this)},_setSelectionSymbol:function(f){var n=null;switch(f.geometryType){case "esriGeometryPoint":n=this._pointSelectionSymbol;break;case "esriGeometryPolyline":n=this._polylineSelectionSymbol;break;case "esriGeometryPolygon":n=this._polygonSelectionSymbol}f.setSelectionSymbol(f._selectionSymbol||n)},_createTools:function(){J.forEach(this._toolTypes,this._createTool,this);
this.inherited(arguments)},_createTool:function(f){var n=I.mixin(e[f],{settings:this._settings,onClick:I.hitch(this,"onItemClicked",e[f].id)});this._tools[f.toUpperCase()]=new q(n)}});d("extend-esri")&&I.setObject("dijit.editing.tools.Selection",Q,z);return Q})},"esri/dijit/editing/tools/SelectionTools":function(){define(["dojo/_base/lang","dojo/has","../../../layers/FeatureLayer","../../../toolbars/draw","../../../kernel"],function(Q,I,J,G,u){J={select:{id:"btnNewSelection",_enabledIcon:"toolbarIcon newSelectionIcon",
_disabledIcon:"toolbarIcon newSelectionIcon",_drawType:G.EXTENT,_selectMethod:J.SELECTION_NEW,_label:"NLS_selectionNewLbl"},selectadd:{id:"btnAddToSelection",_enabledIcon:"toolbarIcon addToSelectionIcon",_disabledIcon:"toolbarIcon addToSelectionIcon",_drawType:G.EXTENT,_selectMethod:J.SELECTION_ADD,_label:"NLS_selectionAddLbl"},selectremove:{id:"btnSubtractFromSelection",_enabledIcon:"toolbarIcon removeFromSelectionIcon",_disabledIcon:"toolbarIcon removeFromSelectionIcon",_drawType:G.EXTENT,_selectMethod:J.SELECTION_SUBTRACT,
_label:"NLS_selectionRemoveLbl"},selectClear:{id:"btnClearSelection",_enabledIcon:"toolbarIcon clearSelectionIcon",_disabledIcon:"toolbarIcon clearSelectionIcon",_enabled:!1,_label:"NLS_selectionClearLbl"}};I("extend-esri")&&Q.setObject("dijit.editing.tools.SelectionTools",J,u);return J})},"esri/dijit/editing/SelectionHelper":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/array dojo/has dojo/DeferredList ../../geometry/Extent ../../geometry/Point ../../geometry/ScreenPoint ../../layers/FeatureLayer ../../tasks/query ../../kernel".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k){Q=Q(null,{declaredClass:"esri.dijit.editing.SelectionHelper",constructor:function(z){this._settings=z||{};this._sConnects=[];this._mapServiceCount=0;this._map=this._settings.map;this._tolerance=this._settings.singleSelectionTolerance;this._initMapServiceInfos(this._settings.layers)},destroy:function(){for(var z in this._sConnects)this._sConnects.hasOwnProperty(z)&&J.disconnect(this._sConnects[z])},selectFeatures:function(z,f,n,g){n===q.SELECTION_NEW&&(this._resetMapServiceInfos(),
this.getSelection(z));var m=[];G.forEach(z,function(l){if(!0===l.visible&&!0===l._isMapAtVisibleScale()){var C=n;l._isSelOnly&&C===q.SELECTION_NEW&&(C=q.SELECTION_ADD);m.push(l.selectFeatures(f,C))}});(new d(m)).addCallback(I.hitch(this,function(l){var C=[];G.forEach(l,function(A,L){G.forEach(A[1],function(y){(y=z[L]._mode._getFeature(y.attributes[z[L].objectIdField])||null)&&C.push(y)},this)},this);this._mapServiceCount?((l=n===q.SELECTION_SUBTRACT)?(this._resetMapServiceInfos(),this._createLayerDefs(this._getLayerInfosFromSelection(z))):
this._createLayerDefs(this._getLayerInfosFromFeatures(C)),this._updateLayerDefs(this._mapServiceInfos,!1,!(C&&C.length||l),I.hitch(this,g,C))):g(C)}))},selectFeaturesByGeometry:function(z,f,n,g){var m=f;-1!==f.declaredClass.indexOf("Extent")&&f.xmax===f.xmin&&f.ymax===f.ymin&&(m=new a(f.xmax,f.ymax,f.spatialReference));m=-1!==m.declaredClass.indexOf("Point")?this._extentFromPoint(m):m;f=new e;f.geometry=m;this.selectFeatures(z,f,n,g)},clearSelection:function(z){G.forEach(this._nonSelOnlyLayers,function(n){n.clearSelection&&
n.clearSelection()});if(this._mapServiceCount){this._resetMapServiceInfos();var f=this._getLayerInfosFromSelection(this._settings.layers);G.some(f,function(n){return n.oids&&n.oids.length})&&(this._createLayerDefs(f),this._updateLayerDefs(this._mapServiceInfos,!0,z||!1))}},findMapService:function(z){var f=this._map,n=f.layerIds;z=z&&z._url&&z._url.path?z._url.path.toLowerCase():"";var g;for(g in n)if(n.hasOwnProperty(g)){var m=f.getLayer(n[g]);var l=m._url?m._url.path?m._url.path.toLowerCase().replace("mapserver",
"featureserver"):m._url.toLowerCase().replace("mapserver","featureserver"):"";if(z.substr(0,l.length)===l&&"esri.layers.ArcGISDynamicMapServiceLayer"===m.declaredClass)return m}},getSelection:function(z){var f=[];G.forEach(z,function(n){n._isSelOnly&&f.push(this._createLayerInfo(n))},this);G.forEach(f,function(n){var g=this._createMapServiceInfo(this.findMapService(n.layer));g&&(g.layerInfos[n.layer.layerId]=n)},this)},_initMapServiceInfos:function(z){this._nonSelOnlyLayers=[];this._mapServiceInfos=
[];G.forEach(z,function(f){var n=this.findMapService(f);n?(this._mapServiceCount++,this._createMapServiceInfo(n),n&&n.setDisableClientCaching(!0)):this._nonSelOnlyLayers.push(f)},this)},_createMapServiceInfo:function(z){if(!z)return null;var f=this._mapServiceInfos,n=f[z.id];n||(n=f[z.id]={mapService:z,layerInfos:[],layerDefs:I.mixin([],z.layerDefinitions||[]),origLayerDefs:I.mixin([],z.layerDefinitions||[])});return n},_resetMapServiceInfo:function(z){G.forEach(z.layerInfos,this._resetLayerInfo);
z.layerDefs=I.mixin([],z.origLayerDefs||[])},_resetMapServiceInfos:function(){var z=this._mapServiceInfos,f;for(f in z)z.hasOwnProperty(f)&&this._resetMapServiceInfo(z[f])},_createLayerInfo:function(z,f){var n=z.objectIdField;f=f?[]:z.getSelectedFeatures();return{layer:z,selectedFeatures:f||[],oids:G.map(f,function(g){return g.attributes[n]})}},_resetLayerInfo:function(z){z&&(z.selectedFeatures=[],z.oids=[])},_updateLayerDefs:function(z,f,n,g){for(var m in z)if(z.hasOwnProperty(m)){var l=z[m],C=l.mapService,
A=l.layerDefs=f?I.mixin([],l.origLayerDefs||[]):l.layerDefs;A?(n?g&&g():this._sConnects[C.id]=J.connect(C,"onUpdateEnd",I.hitch(this,"_onMapServiceUpdate",l,f,g)),C.setLayerDefinitions(A,n||!1)):g&&g()}},_onMapServiceUpdate:function(z,f,n){J.disconnect(this._sConnects[z.mapService.id]);G.forEach(z.layerInfos,function(g){if(f)g&&g.layer.clearSelection();else{var m=new e;m.objectIds=g?g.oids:[];m.objectIds.length&&g.layer.selectFeatures(m,q.SELECTION_SUBTRACT)}},this);f&&this._resetMapServiceInfo(z);
n&&n()},_createLayerDefs:function(z){G.forEach(z,function(f){var n=f.layer,g=this._createMapServiceInfo(this.findMapService(f.layer));if(g){g=g.layerDefs;var m=n.layerId,l='("'+n.objectIdField+'" NOT IN (',C=f.oids;C&&C.length&&(G.forEach(f.oids,function(A,L){C=!0;L&&(l+=",");l+="'"+A+"'"}),l+="))",g[m]=g.length&&g[m]&&g[m].length?g[m]+(" AND"+l):l)}},this)},_getLayerInfosFromFeatures:function(z){var f=[];G.forEach(z,function(g){var m=g.getLayer();m&&m._isSelOnly&&(f[m.id]||(f[m.id]=this._createLayerInfo(m,
!0)),f[m.id].selectedFeatures.push(g),f[m.id].oids.push(g.attributes[m.objectIdField]))},this);z=[];for(var n in f)f.hasOwnProperty(n)&&z.push(f[n]);return z},_getLayerInfosFromSelection:function(z){var f=[];G.forEach(z,function(n){n._isSelOnly&&f.push(this._createLayerInfo(n,!1))},this);return f},_extentFromPoint:function(z){var f=this._tolerance,n=this._map,g=n.toScreen(z);z=new w(g.x-f,g.y+f);f=new w(g.x+f,g.y-f);z=n.toMap(z);f=n.toMap(f);return new c(z.x,z.y,f.x,f.y,n.spatialReference)}});u("extend-esri")&&
I.setObject("dijit.editing.SelectionHelper",Q,k);return Q})},"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(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v,b,D,h,B,H,T,N,p){var E=Q([T,n,g],{declaredClass:"esri.dijit.editing.TemplatePicker",widgetsInTemplate:!0,templateString:p,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(r,t){r=r||{};r.items||r.featureLayers||
console.error("TemplatePicker: please provide 'featureLayers' or 'items' parameter in the constructor");this._dojo14x=4<=c.version.minor;this._itemWidgets={};r.featureLayers&&r.featureLayers.length&&(this._flChanged=1);this._nls=N.widgets.templatePicker;this.emptyMessage=r.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 r=
z.getContentBox(this.domNode);r.w||(this.domNode.style.width=this._initialAutoWidth+"px");if(!r.h||1>=r.h)this.domNode.style.height=this._initialAutoHeight+"px";r=z.getContentBox(this.domNode);this._columns=Math.floor(r.w/this._assumedCellWidth)||1}this._applyGridPatches();this._setGridLayout();J.connect(this.grid,"onRowClick",this,this._rowClicked);this._setGridData();this._toggleTooltip();9>a("ie")&&(this._repaintItems=I.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 r=this._selectedCell,t=this._selectedInfo;r&&this._rowClicked({cellNode:r,rowIndex:t.selRow,cellIndex:t.selCol})},update:function(r){r=
"auto"===this.rows&&"auto"===this.columns&&r?!0:!1;var t=this.grid;if(r){var x=this.domNode;var F=c.query("#"+x.id+".templatePicker div.item")[0];x=z.getContentBox(x);F=(F=F&&F.parentNode)?G.coords(F).w:this._assumedCellWidth;this._columns=(this._columns=Math.floor((x.w-t.views.views[0].getScrollbarWidth())/F))||1}F=this._rows;this._preprocess();var K=this._rows;this._setGridLayout();this._setGridData();K!==F&&t.set("autoHeight",this._rows,!1);r?(t._resize({w:x.w,h:x.h}),t.viewsHeaderNode.style.display=
"none"):t.update();this._toggleTooltip();var R=this,U=this.getSelected();U&&t.store.fetch({onComplete:function(M){var P=(M=R._locate(U,R._selectedInfo,M))&&t.views.views[0].getCellNode(M[0],M[1]);P&&R._rowClicked({cellNode:P,rowIndex:M[0],cellIndex:M[1]},!0)}});9>a("ie")&&setTimeout(this._repaintItems,this._ieTimer);r=this.featureLayers;x=this.items;r&&r.length||x&&x.length||!t||!this.emptyMessage||t.showMessage(this.emptyMessage)},_eventMap:{"selection-change":!0},onSelectionChange:function(){},
_setUseLegendAttr:function(r){var t=this.useLegend;this._started&&t===r||(r?this._flChanged=1:this._clearLegendInfo());this.useLegend=r},_setFeatureLayersAttr:function(r){var t=this.featureLayers;this._started&&t===r||(this._flChanged=1);this.featureLayers=r},_adjustRowsCols:function(r){if("auto"===this.rows&&"auto"===this.columns)this._started||(this._rows=!1,this._columns=null,this._autoWidth=!1);else{var t=0;this._rows=this.rows;this._columns=this.columns;"auto"===this.rows?(this.featureLayers?
this.grouping?(t=r.length,u.forEach(r,function(x){t+=Math.ceil(x.length/this.columns)},this)):(u.forEach(r,function(x){t+=x.length},this),t=Math.ceil(t/this.columns)):t=Math.ceil(r.length/this.columns),this._rows=t):"auto"===this.columns&&(this.featureLayers?this.grouping?t=3:(u.forEach(r,function(x){t+=x.length},this),t=Math.ceil(t/this.rows)):t=Math.ceil(r.length/this.rows),this._columns=t)}},_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),u.every(this.featureLayers,function(x){return x.loaded})){this.featureLayers=u.filter(this.featureLayers,function(x){return!(x.hasZ&&!x.enableZDefaults)});var r=this._flItems=this._getItemsFromLayers(this.featureLayers);
this._adjustRowsCols(r)}else{var t=this.featureLayers.length;u.forEach(this.featureLayers,function(x){if(x.loaded)t--;else var F=J.connect(x,"onLoad",this,function(){J.disconnect(F);F=null;t--;t||this.update()})},this)}else r=this._itItems=this._getItemsFromItems(this.items),this._adjustRowsCols(r)},_processSelectionLayers:function(){var r,t,x,F,K,R,U,M={};u.forEach(this.featureLayers,function(P,V){P.mode===A.MODE_SELECTION&&P._map&&P.url&&P._params.drawMode&&!P.source&&(t=I.trim(P._url.path).replace(/\/(MapServer|FeatureServer).*/ig,
"/MapServer").replace(/^https?:\/\//ig,"").toLowerCase(),x=M[t]=M[t]||{},F=x.featureLayers=x.featureLayers||{},R=x.indices=x.indices||[],F[V]=P,R.push(V),r=P._map)});r&&u.forEach(r.layerIds,function(P){(P=r.getLayer(P))&&P.url&&(P.getImageUrl||P.getTileUrl)&&P.loaded&&10.1<=P.version&&(t=I.trim(P._url.path).replace(/(\/MapServer).*/ig,"$1"),K=t.replace(/^https?:\/\//ig,"").toLowerCase(),M[K]&&!M[K].mapServiceUrl&&(x=M[K],x.mapServiceUrl=t,x.mapServiceLayer=P,this._legendIndices=this._legendIndices.concat(x.indices),
U=this._fetchLegend({pickerInstance:this,info:x},K),U.then?(this._loadingIndices=this._loadingIndices.concat(x.indices),this._loadingLegends.push(U)):this._processLegendResponse(U,x)))},this)},_fetchLegend:function(r,t){var x=E.prototype,F=x.legendCache[t];F?F.then&&F._contexts.push(r):(F=x.legendCache[t]=H({url:r.info.mapServiceUrl+"/legend",content:{f:"json"},callbackParamName:"callback"}),F._contexts=[r],F.addBoth(function(K){if(!F.canceled){x.legendCache[t]=K;var R=F._contexts;F._contexts=null;
u.forEach(R,function(U){var M=U.pickerInstance;U=U.info;if(!M._destroyed){u.forEach(U.indices,function(V){P=u.indexOf(M._loadingIndices,V);-1<P&&M._loadingIndices.splice(P,1)});var P=u.indexOf(M._loadingLegends,F);-1<P&&M._loadingLegends.splice(P,1);M._processLegendResponse(K,U)}})}}));return F},_clearLegendInfo:function(){clearTimeout(this._legendTimer);this._ignoreLegends();this._legendIndices=this._loadingIndices=this._legendSymbols=this._loadingLegends=this._legendTimer=null},_ignoreLegends:function(){this._loadingLegends&&
u.forEach(this._loadingLegends,function(r){var t=-1;u.some(r._contexts,function(x,F){x.pickerInstance===this&&(t=F);return-1<t},this);-1<t&&r._contexts.splice(t,1)},this)},_processLegendResponse:function(r,t){if(!r||r instanceof Error){var x;u.forEach(t.indices,function(K){x=u.indexOf(this._legendIndices,K);-1<x&&this._legendIndices.splice(x,1)},this)}else u.forEach(t.indices,function(K){var R=t.featureLayers[K].layerId,U,M=t.mapServiceUrl+"/"+R+"/images/",P=t.mapServiceLayer._getToken(),V,O;if(!this._legendSymbols[K]){var S=
null;u.some(r.layers,function(X){X.layerId==R&&(S=X);return!!S});if(S){var W=this._legendSymbols[K]={};u.forEach(S.legend,function(X){if((V=X.values)&&V.length)for(U=0;U<V.length;U++)W[V[U]]=X;else W.defaultSymbol=X;(O=X.url)&&!X._fixed&&(X._fixed=1,-1===O.search(/https?:/)&&(X.url=M+O),P&&-1!==X.url.search(/https?:/)&&(X.url+=(-1<X.url.indexOf("?")?"\x26":"?")+"token\x3d"+P))})}}},this);var F=this;F._started&&!F._legendTimer&&(F._legendTimer=setTimeout(function(){clearTimeout(F._legendTimer);F._legendTimer=
null;F._destroyed||F.update()},0))},_applyGridPatches:function(){var r=this.grid,t=r.adaptWidth,x,F,K;r.adaptWidth=function(){x=this.views.views;for(F=0;K=x[F];F++)f.set(K.headerNode,"display","block");t.apply(this,arguments);for(F=0;K=x[F];F++)f.set(K.headerNode,"display","none")};if(this._dojo14x){if("auto"!==this.rows&&"auto"!==this.columns)var R=J.connect(r,"_onFetchComplete",this,function(){J.disconnect(R);this.grid.set("autoHeight",this._rows)});J.connect(r,"_onDelete",this,this._destroyItems);
J.connect(r,"_clearData",this,this._destroyItems);J.connect(r,"destroy",this,this._destroyItems);(r=r.focus)&&r.findAndFocusGridCell&&(r.findAndFocusGridCell=function(){return!1})}},_setGridLayout:function(){var r=function(R){return function(U,M){return this._cellGet(R,U,M)}},t=I.hitch(this,this._cellFormatter),x=[],F=this._columns,K;for(K=0;K<F;K++)x.push({field:"cell"+K,get:I.hitch(this,r(K)),formatter:t});r={cells:[x]};this.grouping&&(F={field:"groupName",colSpan:F,get:I.hitch(this,this._cellGetGroup),
formatter:I.hitch(this,this._cellGroupFormatter)},r.cells.push([F]));F=this.grid;t=l.prototype.rowsPerPage;F.set("rowsPerPage",this._rows>t?this._rows:t);F.set("structure",r)},_setGridData:function(){var r=[];if(this.grouping){this._groupRowIndices=[];var t,x,F=this._columns;u.forEach(this._flItems,function(R,U){r.push({});U=0===U?0:t+x+1;this._groupRowIndices.push(U);t=U;x=Math.ceil(R.length/F);r=r.concat(this._getStoreItems(R))},this)}else this.featureLayers?(u.forEach(this._flItems,function(R){r=
r.concat(R)}),r=this._getStoreItems(r)):r=this._getStoreItems(this._itItems);var K=new m({data:{items:r}});this.grid.setStore(K)},_toggleTooltip:function(){if(this.showTooltip){if(!this.tooltip){this.tooltip=k.create("div",{"class":"esriMapTooltip"},this.domNode);this.tooltip.style.display="none";this.tooltip.style.position="fixed";var r=this.grid;this._mouseOverConnect=J.connect(r,"onCellMouseOver",this,this._cellMouseOver);this._mouseOutConnect=J.connect(r,"onCellMouseOut",this,this._cellMouseOut)}}else this.tooltip&&
(J.disconnect(this._mouseOverConnect),J.disconnect(this._mouseOutConnect),k.destroy(this.tooltip),this.tooltip=null)},_rowClicked:function(r,t){var x=r.cellNode,F=r.rowIndex;r=r.cellIndex;var K=this._getCellInfo(x,F,r);if(K){var R=this.grid.store;if(!R.getValue(K,"loadingCell")&&(this._selectedCell&&e.remove(this._selectedCell,"selectedItem"),x!==this._selectedCell?(e.add(x,"selectedItem"),this._selectedCell=x,this._selectedItem={featureLayer:R.getValue(K,"layer"),type:R.getValue(K,"type"),template:R.getValue(K,
"template"),symbolInfo:R.getValue(K,"symbolInfo"),item:this._getItem(K)},this._selectedInfo={selRow:F,selCol:r,index1:R.getValue(K,"index1"),index2:R.getValue(K,"index2"),index:R.getValue(K,"index")}):this._selectedCell=this._selectedInfo=this._selectedItem=null,!t))this.onSelectionChange()}},_locate:function(r,t,x){var F=this.grid.store,K=Array(this._columns),R,U=t.index1,M=t.index2,P=t.index,V=r.item;u.some(x,function(O,S){return u.some(K,function(W,X){return(W=F.getValue(O,"cell"+X))&&(V?P===F.getValue(W,
"index"):U===F.getValue(W,"index1")&&M===F.getValue(W,"index2"))?(R=[S,X],!0):!1})});return R},_getCellInfo:function(r,t,x){if(r)return r=this.grid,t=r.getItem(t),r.store.getValue(t,"cell"+x)},_getItem:function(r){var t=this.items;if(t)return t[this.grid.store.getValue(r,"index")]},_cellMouseOver:function(r){var t=this.tooltip,x=r.cellNode,F=this._getCellInfo(x,r.rowIndex,r.cellIndex);if(t&&F){var K=this.grid.store;r=K.getValue(F,"template");var R=K.getValue(F,"type"),U=K.getValue(F,"symbolInfo");
K=K.getValue(F,"layer");r=(F=this._getItem(F))&&F.label+(F.description?": "+F.description:"")||r&&r.name+(r.description?": "+r.description:"")||R&&R.name||U&&U.label+(U.description?": "+U.description:"")||(K&&K.name+": ")+"Default";t.style.display="none";t.innerHTML=r;x=G.coords(x.firstChild);f.set(t,{left:x.x+"px",top:x.y+x.h+5+"px"});t.style.display=""}},_cellMouseOut:function(){var r=this.tooltip;r&&(r.style.display="none")},_destroyItems:function(){var r=this._itemWidgets,t;for(t in r)r[t]&&(r[t].destroy(),
delete r[t])},_repaintItems:function(){var r=this._itemWidgets,t;for(t in r){var x=r[t];x&&x._repaint(x._surface)}},_getStoreItems:function(r){var t=this._uniqueId;r=u.map(r,function(O){return I.mixin({surfaceId:"tpick-surface-"+t.id++},O)});for(var x=r.length,F=0,K={},R=0,U,M=[],P=!0,V=this._columns;F<x;)P=!0,U="cell"+R,K[U]=r[F],F++,R++,0===R%V&&(P=!1,M.push(K),K={},R=0);P&&x&&M.push(K);return M},_getItemsFromLayers:function(r){var t=[];u.forEach(r,function(x,F){t.push(this._getItemsFromLayer(x,
F))},this);return t},_getItemsFromLayer:function(r,t){var x=[];if(this.useLegend&&-1<u.indexOf(this._loadingIndices,t))return[{label:this._nls&&this._nls.loading||"",symbol:null,layer:r,type:null,template:null,index1:t,index2:0,loadingCell:1}];var F=[];F=F.concat(r.templates);u.forEach(r.types,function(M){var P=M.templates;u.forEach(P,function(V){V._type_=M});F=F.concat(P)});F=u.filter(F,B.isDefined);var K=r.renderer;if(K){var R=K.declaredClass.replace("esri.renderer.","");if(0<F.length)u.forEach(F,
function(M){var P=M.prototype;if(P){var V;if(V=this._isUnclassedRenderer(K)?K.infos[0].symbol:K.valueExpression?this._createSimpleSymbol(r):K.getSymbol(P)||this._createSimpleSymbol(r)){var O=null,S;if(!(9>q("ie"))&&M.thumbnail&&M.thumbnail.imageData)O=new y(M.thumbnail);else if(this.useLegend&&-1<u.indexOf(this._legendIndices,t)){if(S=this._legendSymbols&&this._legendSymbols[t])switch(R){case "SimpleRenderer":O=S.defaultSymbol;break;case "UniqueValueRenderer":u.some(K.infos,function(W){W.symbol===
V&&(O=S[W.value]);return!!O});break;case "ClassBreaksRenderer":u.some(K.infos,function(W){W.symbol===V&&(O=S[W.maxValue]);return!!O})}O&&(P=d.fromJson(d.toJson(y.defaultProps)),P.url=O.url,P.imageData=O.imageData,P.contentType=O.contentType,P.width=O.width,P.height=O.height,B.isDefined(P.width)&&B.isDefined(P.height)||(P.width=15,P.height=15),O=new y(P))}x.push({label:this._trimLabel(M.name),symbol:O||V,legendOverride:!!O,layer:r,type:M._type_,template:M,index1:t,index2:x.length})}else switch(R){case "HeatmapRenderer":x.push({label:this._trimLabel(M.name),
symbol:new L,legendOverride:!!O,layer:r,type:M._type_,template:M,index1:t,index2:x.length})}}delete M._type_},this);else{var U=[];"TemporalRenderer"===R&&(K=K.observationRenderer)&&(R=K.declaredClass.replace("esri.renderer.",""));switch(R){case "SimpleRenderer":U=[{symbol:K.symbol,label:K.label,description:K.description}];break;case "UniqueValueRenderer":case "ClassBreaksRenderer":U=K.infos}x=u.map(U,function(M,P){return{label:this._trimLabel(M.label),description:M.description,symbolInfo:I.mixin({constructor:function(){}},
M),symbol:M.symbol,layer:r,index1:t,index2:P}},this)}}return x},_isUnclassedRenderer:function(r){return!!((r.hasVisualVariables("sizeInfo",!1)||r.hasVisualVariables("colorInfo",!1)||r.hasVisualVariables("opacityInfo",!1))&&r.addBreak&&r.infos&&1===r.infos.length)},_createSimpleSymbol:function(r){switch(r.geometryType){case "esriGeometryPoint":case "esriGeometryMultipoint":var t=new L;break;case "esriGeometryPolyline":t=new b;break;case "esriGeometryPolygon":t=new v;break;default:r.hasXYFootprint&&
r.hasXYFootprint()&&(t=new v)}return t},_getItemsFromItems:function(r){return u.map(r,function(t,x){t=I.mixin({index:x},t);t.label=this._trimLabel(t.label);return t},this)},_trimLabel:function(r){var t=this.maxLabelLength;t&&r&&r.length>t&&(r=r.substr(0,t)+"...");return r||""},_cellGet:function(r,t,x){return x?this.grid.store.getValue(x,"cell"+r):""},_cellFormatter:function(r){if(r){var t=this._itemWidgets,x=this.grid.store,F=x.getValue(r,"surfaceId"),K=t[F];K||(K=t[F]=new D({id:F,label:x.getValue(r,
"label"),symbol:x.getValue(r,"symbol"),legendOverride:x.getValue(r,"legendOverride"),surfaceWidth:this.surfaceWidth,surfaceHeight:this.surfaceHeight,template:x.getValue(r,"template")}));return K||""}return""},_cellGetGroup:function(r,t){if(!this._groupRowIndices)return"";r=u.indexOf(this._groupRowIndices,r);return t&&-1!==r?(t=this.featureLayers[r])&&(this.groupLabelFunction?this.groupLabelFunction(t):t.name)||"":""},_cellGroupFormatter:function(r){return r?"\x3cdiv class\x3d'groupLabel'\x3e"+r+"\x3c/div\x3e":
""}});a("extend-esri")&&I.setObject("dijit.editing.TemplatePicker",E,h);return E})},"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(Q,I,J,G,u,d,c,a,w){var q=d("dojox.grid.DataGrid",c,{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 a(this)},get:function(e,k){if(k&&"_item"==this.field&&
!this.fields)return k;if(k&&this.fields){var z=[],f=this.grid.store;I.forEach(this.fields,function(n){z=z.concat(f.getValues(k,n))});return z}return k||"string"!==typeof e?k?this.field?"_item"==this.field?k:this.grid.store.getValue(k,this.field):this.value:this.defaultValue:this.inherited(arguments)},_checkUpdateStatus:function(){if(0<this.updateDelay){var e=!1;this._endUpdateDelay&&(clearTimeout(this._endUpdateDelay),delete this._endUpdateDelay,e=!0);this.updating||(this.beginUpdate(),e=!0);if(e){var k=
this;this._endUpdateDelay=setTimeout(function(){delete k._endUpdateDelay;k.endUpdate()},this.updateDelay)}}},_onSet:function(e,k,z,f){this._checkUpdateStatus();e=this.getItemIndex(e);-1<e&&this.updateRow(e)},_createItem:function(e,k){k=this._hasIdentity?this.store.getIdentity(e):G.toJson(this.query)+":idx:"+k+":sort:"+G.toJson(this.getSortProps());return this._by_idty[k]={idty:k,item:e}},_addItem:function(e,k,z){this._by_idx[k]=this._createItem(e,k);z||this.updateRow(k)},_onNew:function(e,k){this._checkUpdateStatus();
k=this.get("rowCount");this._addingItem=!0;this.updateRowCount(k+1);this._addingItem=!1;this._addItem(e,k);this.showMessage()},_onDelete:function(e){this._checkUpdateStatus();e=this._getItemIndex(e,!0);if(0<=e){this._pages=[];this._eop=this._bop=-1;var k=this._by_idx[e];this._by_idx.splice(e,1);delete this._by_idty[k.idty];this.updateRowCount(this.get("rowCount")-1);0===this.get("rowCount")&&this.showMessage(this.noDataMessage)}this.selection.isSelected(e)&&(this.selection.deselect(e),this.selection.selected.splice(e,
1))},_onRevert:function(){this._refresh()},setStore:function(e,k,z){this._requestsPending(0)||(this._setQuery(k,z),this._setStore(e),this._refresh(!0))},setQuery:function(e,k){this._requestsPending(0)||(this._setQuery(e,k),this._refresh(!0))},setItems:function(e){this.items=e;this._setStore(this.store);this._refresh(!0)},_setQuery:function(e,k){this.query=e;this.queryOptions=k||this.queryOptions},_setStore:function(e){this.store&&this._store_connects&&I.forEach(this._store_connects,this.disconnect,
this);if(this.store=e){e=this.store.getFeatures();var k=[];this._canEdit=!!e["dojo.data.api.Write"]&&!!e["dojo.data.api.Identity"];this._hasIdentity=!!e["dojo.data.api.Identity"];e["dojo.data.api.Notification"]&&!this.items&&(k.push(this.connect(this.store,"onSet","_onSet")),k.push(this.connect(this.store,"onNew","_onNew")),k.push(this.connect(this.store,"onDelete","_onDelete")));this._canEdit&&k.push(this.connect(this.store,"revert","_onRevert"));this._store_connects=k}},_onFetchBegin:function(e,
k){this.scroller&&(this.rowCount!=e&&(k.isRender?(this.scroller.init(e,this.keepRows,this.rowsPerPage),this.rowCount=e,this._setAutoHeightAttr(this.autoHeight,!0),this._skipRowRenormalize=!0,this.prerender(),this._skipRowRenormalize=!1):this.updateRowCount(e)),e?this.showMessage():(this.views.render(),this._resize(),this.showMessage(this.noDataMessage),this.focus.initFocusView()))},_onFetchComplete:function(e,k){this.scroller&&(e&&0<e.length&&(I.forEach(e,function(z,f){this._addItem(z,k.start+f,!0)},
this),this.updateRows(k.start,e.length),k.isRender?(this.setScrollTop(0),this.postrender()):this._lastScrollTop&&this.setScrollTop(this._lastScrollTop),u("ie")&&w.setSelectable(this.domNode,this.selectable)),delete this._lastScrollTop,this._isLoaded||(this._isLoading=!1,this._isLoaded=!0),this._pending_requests[k.start]=!1)},_onFetchError:function(e,k){console.log(e);delete this._lastScrollTop;this._isLoaded||(this._isLoading=!1,this._isLoaded=!0,this.showMessage(this.errorMessage));this._pending_requests[k.start]=
!1;this.onFetchError(e,k)},onFetchError:function(e,k){},_fetch:function(e,k){e=e||0;if(this.store&&!this._pending_requests[e]){this._isLoaded||this._isLoading||(this._isLoading=!0,this.showMessage(this.loadingMessage));this._pending_requests[e]=!0;try{if(this.items){var z=this.items,f=this.store;this.rowsPerPage=z.length;var n={start:e,count:this.rowsPerPage,isRender:k};this._onFetchBegin(z.length,n);var g=0;I.forEach(z,function(l){f.isItemLoaded(l)||g++});if(0===g)this._onFetchComplete(z,n);else{var m=
function(l){g--;0===g&&this._onFetchComplete(z,n)};I.forEach(z,function(l){f.isItemLoaded(l)||f.loadItem({item:l,onItem:m,scope:this})},this)}}else this.store.fetch({start:e,count:this.rowsPerPage,query:this.query,sort:this.getSortProps(),queryOptions:this.queryOptions,isRender:k,onBegin:J.hitch(this,"_onFetchBegin"),onComplete:J.hitch(this,"_onFetchComplete"),onError:J.hitch(this,"_onFetchError")})}catch(l){this._onFetchError(l,{start:e,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(e){var k=this._by_idx[e];return!k||k&&!k.item?(this._preparePage(e),null):k.item},getItemIndex:function(e){return this._getItemIndex(e,!1)},_getItemIndex:function(e,k){if(!k&&!this.store.isItem(e))return-1;k=this._hasIdentity?this.store.getIdentity(e):null;for(var z=0,f=this._by_idx.length;z<f;z++){var n=this._by_idx[z];if(n&&(k&&n.idty==k||n.item===e))return z}return-1},filter:function(e,
k){this.query=e;k&&this._clearData();this._fetch()},_getItemAttr:function(e,k){return(e=this.getItem(e))?this.store.getValue(e,k):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(e){return this._pending_requests[e]},_rowToPage:function(e){return this.rowsPerPage?Math.floor(e/this.rowsPerPage):e},_pageToRow:function(e){return this.rowsPerPage?this.rowsPerPage*
e:e},_preparePage:function(e){(e<this._bop||e>=this._eop)&&!this._addingItem&&(e=this._rowToPage(e),this._needPage(e),this._bop=e*this.rowsPerPage,this._eop=this._bop+(this.rowsPerPage||this.get("rowCount")))},_needPage:function(e){this._pages[e]||(this._pages[e]=!0,this._requestPage(e))},_requestPage:function(e){e=this._pageToRow(e);0<Math.min(this.rowsPerPage,this.get("rowCount")-e)&&(this._requests++,this._requestsPending(e)||setTimeout(J.hitch(this,"_fetch",e,!1),1))},getCellName:function(e){return e.field},
_refresh:function(e){this._clearData();this._fetch(0,e)},sort:function(){this.edit.apply();this._lastScrollTop=this.scrollTop;this._refresh()},canSort:function(){return!this._isLoading},getSortProps:function(){var e=this.getCell(this.getSortIndex());if(e){var k=e.sortDesc,z=!(0<this.sortInfo);return[{attribute:e.field,descending:"undefined"==typeof k?z:z?!k:k}]}return this.sortFields?this.sortFields:null},styleRowState:function(e){if(this.store&&this.store.getState){for(var k=this.store.getState(e.index),
z="",f=0,n=["inflight","error","inserting"],g;g=n[f];f++)if(k[g]){z=" dojoxGridRow-"+g;break}e.customClasses+=z}},onStyleRow:function(e){this.styleRowState(e);this.inherited(arguments)},canEdit:function(e,k){return this._canEdit},_copyAttr:function(e,k){e=this.getItem(e);return this.store.getValue(e,k)},doStartEdit:function(e,k){this._cache[k]||(this._cache[k]=this._copyAttr(k,e.field));this.onStartEdit(e,k)},doApplyCellEdit:function(e,k,z){this.store.fetchItemByIdentity({identity:this._by_idx[k].idty,
onItem:J.hitch(this,function(f){var n=this.store.getValue(f,z);"number"==typeof n?e=isNaN(e)?e:parseFloat(e):"boolean"==typeof n?e="true"==e?!0:"false"==e?!1:e:n instanceof Date&&(n=new Date(e),e=isNaN(n.getTime())?e:n);this.store.setValue(f,z,e);this.onApplyCellEdit(e,k,z)})})},doCancelEdit:function(e){this._cache[e]&&(this.updateRow(e),delete this._cache[e]);this.onCancelEdit.apply(this,arguments)},doApplyEdit:function(e,k){this.onApplyEdit(e)},removeSelectedRows:function(){if(this._canEdit){this.edit.apply();
var e=J.hitch(this,function(k){k.length&&(I.forEach(k,this.store.deleteItem,this.store),this.selection.clear())});this.allItemsSelected?this.store.fetch({query:this.query,queryOptions:this.queryOptions,onComplete:e}):e(this.selection.getSelected())}}});q.cell_markupFactory=function(e,k,z){var f=J.trim(w.attr(k,"field")||"");f&&(z.field=f);z.field=z.field||z.name;if(f=J.trim(w.attr(k,"fields")||""))z.fields=f.split(",");e&&e(k,z)};q.markupFactory=function(e,k,z,f){return c.markupFactory(e,k,z,J.partial(q.cell_markupFactory,
f))};return q})},"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(Q,I,
J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v,b,D){Q.isCopyKey||(Q.isCopyKey=Q.dnd.getCopyKeyState);J=J("dojox.grid._Grid",[n,g,G],{templateString:l,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:d,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");v.initOnFontResize();this.connect(v,"onFontResize","textSizeChanged");f.funnelEvents(this.domNode,this,"doKeyEvent",f.keyEvents);"none"!=this.selectionMode&&this.domNode.setAttribute("aria-multiselectable","single"==this.selectionMode?"false":"true");b.addClass(this.domNode,this.classTag);this.isLeftToRight()||b.addClass(this.domNode,this.classTag+"Rtl");0<this.rowHeight&&b.addClass(this.viewsNode,
this.classTag+"FixedRowHeight")},postMixInProperties:function(){this.inherited(arguments);var h=Q.i18n.getLocalization("dijit","loading",this.lang);this.loadingMessage=C.substitute(this.loadingMessage,h);this.errorMessage=C.substitute(this.errorMessage,h);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&&b.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&&(A.forEach(this._placeholders,function(h){h.unReplace(!0)}),this.headerMenu.unBindDomNode(this.viewsHeaderNode));this.inherited(arguments)},_setAutoHeightAttr:function(h,B){"string"==typeof h&&(h=h&&"false"!=h?"true"==h?!0:window.parseInt(h,10):!1);"number"==typeof h&&(isNaN(h)&&(h=!1),0>h?h=!0:0===h&&(h=!1));this.autoHeight=h;this._autoHeight="boolean"==typeof h?h:"number"==typeof h?h>=this.get("rowCount"):!1;this._started&&!B&&this.render()},
_getRowCountAttr:function(){return this.updating&&this.invalidated&&void 0!=this.invalidated.rowCount?this.invalidated.rowCount:this.rowCount},textSizeChanged:function(){this.render()},sizeChange:function(){this.update()},createManagers:function(){this.rows=new w(this);this.focus=new q(this);this.edit=new e(this)},createSelection:function(){this.selection=new k(this)},createScroller:function(){this.scroller=new u;this.scroller.grid=this;this.scroller.renderRow=L.hitch(this,"renderRow");this.scroller.removeRow=
L.hitch(this,"rowRemoved")},createLayout:function(){this.layout=new this._layoutClass(this);this.connect(this.layout,"moveColumn","onMoveColumn")},onMoveColumn:function(){this.update()},onResizeColumn:function(h){},createViews:function(){this.views=new a(this);this.views.createView=L.hitch(this,"createView")},createView:function(h,B){h=new (L.getObject(h))({grid:this,index:B});this.viewsNode.appendChild(h.domNode);this.viewsHeaderNode.appendChild(h.headerNode);this.views.addView(h);b.attr(this.domNode,
"align",this.isLeftToRight()?"left":"right");return h},buildViews:function(){for(var h=0,B;B=this.layout.structure[h];h++)this.createView(B.type||I._scopeName+".grid._View",h).setStructure(B);this.scroller.setContentNodes(this.views.getContentNodes())},_setStructureAttr:function(h){h&&L.isString(h)&&(Q.deprecated("dojox.grid._Grid.set('structure', 'objVar')","use dojox.grid._Grid.set('structure', objVar) instead","2.0"),h=L.getObject(h));this.structure=h;if(!h)if(this.layout.structure)h=this.layout.structure;
else return;this.views.destroyViews();this.focus.focusView=null;h!==this.layout.structure&&this.layout.setStructure(h);this._structureChanged()},setStructure:function(h){Q.deprecated("dojox.grid._Grid.setStructure(obj)","use dojox.grid._Grid.set('structure', obj) instead.","2.0");this._setStructureAttr(h)},getColumnTogglingItems:function(){var h=[];var B=A.map(this.layout.cells,function(H){H.menuItems||(H.menuItems=[]);var T=this,N=new m({label:H.name,checked:!H.hidden,_gridCell:H,onChange:function(p){if(T.layout.setColumnVisibility(this._gridCell.index,
p)){var E=this._gridCell.menuItems;1<E.length&&A.forEach(E,function(r){r!==this&&r.setAttribute("checked",p)},this);p=A.filter(T.layout.cells,function(r){1<r.menuItems.length?A.forEach(r.menuItems,"item.set('disabled', false);"):r.menuItems[0].set("disabled",!1);return!r.hidden});1==p.length&&A.forEach(p[0].menuItems,"item.set('disabled', true);")}},destroy:function(){var p=A.indexOf(this._gridCell.menuItems,this);this._gridCell.menuItems.splice(p,1);delete this._gridCell;m.prototype.destroy.apply(this,
arguments)}});H.menuItems.push(N);H.hidden||h.push(N);return N},this);1==h.length&&h[0].set("disabled",!0);return B},_setHeaderMenuAttr:function(h){this._placeholders&&this._placeholders.length&&(A.forEach(this._placeholders,function(B){B.unReplace(!0)}),this._placeholders=[]);this.headerMenu&&this.headerMenu.unBindDomNode(this.viewsHeaderNode);if(this.headerMenu=h)this.headerMenu.bindDomNode(this.viewsHeaderNode),this.headerMenu.getPlaceholders&&(this._placeholders=this.headerMenu.getPlaceholders(this.placeholderLabel))},
setHeaderMenu:function(h){Q.deprecated("dojox.grid._Grid.setHeaderMenu(obj)","use dojox.grid._Grid.set('headerMenu', obj) instead.","2.0");this._setHeaderMenuAttr(h)},setupHeaderMenu:function(){this._placeholders&&this._placeholders.length&&A.forEach(this._placeholders,function(h){h._replaced&&h.unReplace(!0);h.replace(this.getColumnTogglingItems())},this)},_fetch:function(h){this.setScrollTop(0)},getItem:function(h){return null},showMessage:function(h){h?(this.messagesNode.innerHTML=h,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(h,B){this._pendingChangeSize=h;this._pendingResultSize=B;this.sizeChange()},_getPadBorder:function(){return this._padBorder=this._padBorder||b._getPadBorderExtents(this.domNode)},_getHeaderHeight:function(){var h=this.viewsHeaderNode.style,B="none"==h.display?
0:this.views.measureHeader();h.height=B+"px";this.views.normalizeHeaderNodeHeight();return B},_resize:function(h,B){h=h||this._pendingChangeSize;B=B||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 T=this._getPadBorder(),N=void 0;if(this._autoHeight)this.domNode.style.height="auto";else if("number"==typeof this.autoHeight){var p=
N=this._getHeaderHeight();p+=this.scroller.averageRowHeight*this.autoHeight;this.domNode.style.height=p+"px"}else this.domNode.clientHeight<=T.h&&(H==document.body?this.domNode.style.height=this.defaultHeight:this.height?this.domNode.style.height=this.height:this.fitTo="parent");B&&(h=B);!this._autoHeight&&h?(b.marginBox(this.domNode,h),this.height=this.domNode.style.height,delete this.fitTo):"parent"==this.fitTo&&(p=this._parentContentBoxHeight=0<this._parentContentBoxHeight?this._parentContentBoxHeight:
b._getContentBox(H).h,this.domNode.style.height=Math.max(0,p)+"px");h=A.some(this.views.views,function(E){return E.flexCells});this._autoHeight||0!==(p||b._getContentBox(this.domNode).h)?(this.viewsHeaderNode.style.display="block",h||void 0!==N||(N=this._getHeaderHeight())):this.viewsHeaderNode.style.display="none";h&&(N=void 0);this.adaptWidth();this.adaptHeight(N);this.postresize()}}},adaptWidth:function(){var h=!this.initialWidth&&this.autoWidth,B=h?0:this.domNode.clientWidth||this.domNode.offsetWidth-
this._getPadBorder().w;B=this.views.arrange(1,B);this.views.onEach("adaptWidth");h&&(this.domNode.style.width=B+"px")},adaptHeight:function(h){h=void 0===h?this._getHeaderHeight():h;var B=this._autoHeight?-1:Math.max(this.domNode.clientHeight-h,0)||0;this.views.onEach("setSize",[0,B]);this.views.onEach("adaptHeight");if(!this._autoHeight){var H=0,T=0,N=A.filter(this.views.views,function(p){(p=p.hasHScrollbar())?H++:T++;return!p});0<H&&0<T&&A.forEach(N,function(p){p.adaptHeight(!0)})}!0===this.autoHeight||
-1!=B||"number"==typeof this.autoHeight&&this.autoHeight>=this.get("rowCount")?this.scroller.windowHeight=B:this.scroller.windowHeight=Math.max(this.domNode.clientHeight-h,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();b.setSelectable(this.domNode,this.selectable)},postresize:function(){if(this._autoHeight){var h=Math.max(this.views.measureContent())+"px";this.viewsNode.style.height=h}},renderRow:function(h,B){this.views.renderRow(h,
B,this._skipRowRenormalize)},rowRemoved:function(h){this.views.rowRemoved(h)},invalidated:null,updating:!1,beginUpdate:function(){this.invalidated=[];this.updating=!0},endUpdate:function(){this.updating=!1;var h=this.invalidated,B;if(h.all)this.update();else if(void 0!=h.rowCount)this.updateRowCount(h.rowCount);else for(B in h)this.updateRow(Number(B));this.invalidated=[]},defaultUpdate:function(){this.domNode&&(this.updating?this.invalidated.all=!0:(this.lastScrollTop=this.scrollTop,this.prerender(),
this.scroller.invalidateNodes(),this.setScrollTop(this.lastScrollTop),this.postrender()))},update:function(){this.render()},updateRow:function(h){h=Number(h);this.updating?this.invalidated[h]=!0:(this.views.updateRow(h),this.scroller.rowHeightChanged(h))},updateRows:function(h,B){h=Number(h);B=Number(B);var H;if(this.updating)for(H=0;H<B;H++)this.invalidated[H+h]=!0;else{for(H=0;H<B;H++)this.views.updateRow(H+h,this._skipRowRenormalize);this.scroller.rowHeightChanged(h)}},updateRowCount:function(h){this.updating?
this.invalidated.rowCount=h:(this.rowCount=h,this._setAutoHeightAttr(this.autoHeight,!0),this.layout.cells.length&&this.scroller.updateRowCount(h),this.layout.cells.length&&this.setScrollTop(this.scrollTop),this._resize())},updateRowStyles:function(h){this.views.updateRowStyles(h)},getRowNode:function(h){if(!this.focus.focusView||this.focus.focusView instanceof z)for(var B=0,H;H=this.views.views[B];B++){if(!(H instanceof z))return H.rowNodes[h]}else return this.focus.focusView.rowNodes[h];return null},
rowHeightChanged:function(h){this.views.renormalizeRow(h);this.scroller.rowHeightChanged(h)},fastScroll:!0,delayScroll:!1,scrollRedrawThreshold:y("ie")?100:50,scrollTo:function(h){if(this.fastScroll){var B=Math.abs(this.lastScrollTop-h);this.lastScrollTop=h;if(B>this.scrollRedrawThreshold||this.delayScroll){this.delayScroll=!0;this.scrollTop=h;this.views.setScrollTop(h);this._pendingScroll&&window.clearTimeout(this._pendingScroll);var H=this;this._pendingScroll=window.setTimeout(function(){delete H._pendingScroll;
H.finishScrollJob()},200)}else this.setScrollTop(h)}else this.setScrollTop(h)},finishScrollJob:function(){this.delayScroll=!1;this.setScrollTop(this.scrollTop)},setScrollTop:function(h){this.scroller.scroll(this.views.setScrollTop(h))},scrollToRow:function(h){this.setScrollTop(this.scroller.findScrollTop(h)+1)},styleRowNode:function(h,B){B&&this.rows.styleRowNode(h,B)},_mouseOut:function(h){this.rows.setOverRow(-2)},getCell:function(h){return this.layout.cells[h]},setCellWidth:function(h,B){this.getCell(h).unitWidth=
B},getCellName:function(h){return"Cell "+h.index},canSort:function(h){},sort:function(){},getSortAsc:function(h){h=void 0==h?this.sortInfo:h;return 0<h},getSortIndex:function(h){h=void 0==h?this.sortInfo:h;return Math.abs(h)-1},setSortIndex:function(h,B){var H=h+1;void 0!=B?H*=B?1:-1:this.getSortIndex()==h&&(H=-this.sortInfo);this.setSortInfo(H)},setSortInfo:function(h){this.canSort(h)&&(this.sortInfo=h,this.sort(),this.update())},doKeyEvent:function(h){h.dispatch="do"+h.type;this.onKeyEvent(h)},
_dispatch:function(h,B){return h in this?this[h](B):!1},dispatchKeyEvent:function(h){this._dispatch(h.dispatch,h)},dispatchContentEvent:function(h){this.edit.dispatchEvent(h)||h.sourceView.dispatchContentEvent(h)||this._dispatch(h.dispatch,h)},dispatchHeaderEvent:function(h){h.sourceView.dispatchHeaderEvent(h)||this._dispatch("doheader"+h.type,h)},dokeydown:function(h){this.onKeyDown(h)},doclick:function(h){if(h.cellNode)this.onCellClick(h);else this.onRowClick(h)},dodblclick:function(h){if(h.cellNode)this.onCellDblClick(h);
else this.onRowDblClick(h)},docontextmenu:function(h){if(h.cellNode)this.onCellContextMenu(h);else this.onRowContextMenu(h)},doheaderclick:function(h){if(h.cellNode)this.onHeaderCellClick(h);else this.onHeaderClick(h)},doheaderdblclick:function(h){if(h.cellNode)this.onHeaderCellDblClick(h);else this.onHeaderDblClick(h)},doheadercontextmenu:function(h){if(h.cellNode)this.onHeaderCellContextMenu(h);else this.onHeaderContextMenu(h)},doStartEdit:function(h,B){this.onStartEdit(h,B)},doApplyCellEdit:function(h,
B,H){this.onApplyCellEdit(h,B,H)},doCancelEdit:function(h){this.onCancelEdit(h)},doApplyEdit:function(h){this.onApplyEdit(h)},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()}});J.markupFactory=function(h,B,H,T){var N=function(p){p=b.attr(p,"width")||"auto";"auto"!=p&&"em"!=p.slice(-2)&&"%"!=p.slice(-1)&&
(p=parseInt(p,10)+"px");return p};h.structure||"table"!=B.nodeName.toLowerCase()||(h.structure=D("\x3e colgroup",B).map(function(p){var E=b.attr(p,"span");E={noscroll:"true"==b.attr(p,"noscroll")?!0:!1,__span:E?parseInt(E,10):1,cells:[]};b.hasAttr(p,"width")&&(E.width=N(p));return E}),h.structure.length||h.structure.push({__span:Infinity,cells:[]}),D("thead \x3e tr",B).forEach(function(p,E){var r=0,t=0,x,F=null;D("\x3e th",p).map(function(K){F?r>=x+F.__span&&(t++,x+=F.__span,F=h.structure[t]):(x=
0,F=h.structure[0]);var R={name:L.trim(b.attr(K,"name")||K.innerHTML),colSpan:parseInt(b.attr(K,"colspan")||1,10),type:L.trim(b.attr(K,"cellType")||""),id:L.trim(b.attr(K,"id")||"")};r+=R.colSpan;var U=b.attr(K,"rowspan");U&&(R.rowSpan=U);b.hasAttr(K,"width")&&(R.width=N(K));b.hasAttr(K,"relWidth")&&(R.relWidth=window.parseInt(b.attr(K,"relWidth"),10));b.hasAttr(K,"hidden")&&(R.hidden="true"==b.attr(K,"hidden")||!0===b.attr(K,"hidden"));T&&T(K,R);R.type=R.type?L.getObject(R.type):I.grid.cells.Cell;
R.type&&R.type.markupFactory&&R.type.markupFactory(K,R);F.cells[E]||(F.cells[E]=[]);F.cells[E].push(R)})}));return new H(h,B)};return J})},"dojox/grid/_Events":function(){define(["dojo/keys","dojo/dom-class","dojo/_base/declare","dojo/_base/event","dojo/_base/sniff"],function(Q,I,J,G,u){return J("dojox.grid._Events",null,{cellOverClass:"dojoxGridCellOver",onKeyEvent:function(d){this.dispatchKeyEvent(d)},onContentEvent:function(d){this.dispatchContentEvent(d)},onHeaderEvent:function(d){this.dispatchHeaderEvent(d)},
onStyleRow:function(d){d.customClasses+=(d.odd?" dojoxGridRowOdd":"")+(d.selected?" dojoxGridRowSelected":"")+(d.over?" dojoxGridRowOver":"");this.focus.styleRow(d);this.edit.styleRow(d)},onKeyDown:function(d){if(!d.altKey&&!d.metaKey)switch(d.keyCode){case Q.ESCAPE:this.edit.cancel();break;case Q.ENTER:if(!this.edit.isEditing()){var c=this.focus.getHeaderIndex();if(0<=c){this.setSortIndex(c);break}else this.selection.clickSelect(this.focus.rowIndex,dojo.isCopyKey(d),d.shiftKey);G.stop(d)}d.shiftKey||
(c=this.edit.isEditing(),this.edit.apply(),c||this.edit.setEditCell(this.focus.cell,this.focus.rowIndex));this.edit.isEditing()||((this.focus.focusView||this.views.views[0]).content.decorateEvent(d),this.onRowClick(d),G.stop(d));break;case Q.SPACE:this.edit.isEditing()||(c=this.focus.getHeaderIndex(),0<=c?this.setSortIndex(c):(this.selection.clickSelect(this.focus.rowIndex,dojo.isCopyKey(d),d.shiftKey),this.focus._focusifyCellNode(!0),this.focus.setFocusCell(this.focus.cell,this.focus.rowIndex),G.stop(d)));
break;case Q.TAB:this.focus[d.shiftKey?"previousKey":"nextKey"](d);break;case Q.LEFT_ARROW:case Q.RIGHT_ARROW:if(!this.edit.isEditing()){var a=d.keyCode;G.stop(d);c=this.focus.getHeaderIndex();0<=c&&d.shiftKey&&d.ctrlKey?this.focus.colSizeAdjust(d,c,5*(a==Q.LEFT_ARROW?-1:1)):(d=a==Q.LEFT_ARROW?1:-1,this.isLeftToRight()&&(d*=-1),this.focus.move(0,d))}break;case Q.UP_ARROW:this.edit.isEditing()||0===this.focus.rowIndex||(G.stop(d),this.focus.move(-1,0));break;case Q.DOWN_ARROW:this.edit.isEditing()||
this.focus.rowIndex+1==this.rowCount||(G.stop(d),this.focus.move(1,0));break;case Q.PAGE_UP:this.edit.isEditing()||0===this.focus.rowIndex||(G.stop(d),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 Q.PAGE_DOWN:this.edit.isEditing()||this.focus.rowIndex+1==this.rowCount||
(G.stop(d),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(d){-1==d.rowIndex?this.onHeaderCellMouseOver(d):this.onCellMouseOver(d)},onMouseOut:function(d){-1==d.rowIndex?this.onHeaderCellMouseOut(d):this.onCellMouseOut(d)},onMouseDown:function(d){-1==
d.rowIndex?this.onHeaderCellMouseDown(d):this.onCellMouseDown(d)},onMouseOverRow:function(d){this.rows.isOver(d.rowIndex)||(this.rows.setOverRow(d.rowIndex),-1==d.rowIndex?this.onHeaderMouseOver(d):this.onRowMouseOver(d))},onMouseOutRow:function(d){if(this.rows.isOver(-1))this.onHeaderMouseOut(d);else this.rows.isOver(-2)||(this.rows.setOverRow(-2),this.onRowMouseOut(d))},onMouseDownRow:function(d){if(-1!=d.rowIndex)this.onRowMouseDown(d)},onCellMouseOver:function(d){d.cellNode&&I.add(d.cellNode,
this.cellOverClass)},onCellMouseOut:function(d){d.cellNode&&I.remove(d.cellNode,this.cellOverClass)},onCellMouseDown:function(d){},onCellClick:function(d){this._click[0]=this._click[1];this._click[1]=d;this.edit.isEditCell(d.rowIndex,d.cellIndex)||this.focus.setFocusCell(d.cell,d.rowIndex);1<this._click.length&&null==this._click[0]&&this._click.shift();this.onRowClick(d)},onCellDblClick:function(d){var c=1<this._click.length&&u("ie")?this._click[1]:1<this._click.length&&this._click[0].rowIndex!=this._click[1].rowIndex?
this._click[0]:d;this.focus.setFocusCell(c.cell,c.rowIndex);this.edit.setEditCell(c.cell,c.rowIndex);this.onRowDblClick(d)},onCellContextMenu:function(d){this.onRowContextMenu(d)},onCellFocus:function(d,c){this.edit.cellFocus(d,c)},onRowClick:function(d){this.edit.rowClick(d);this.selection.clickSelectEvent(d)},onRowDblClick:function(d){},onRowMouseOver:function(d){},onRowMouseOut:function(d){},onRowMouseDown:function(d){},onRowContextMenu:function(d){G.stop(d)},onHeaderMouseOver:function(d){},onHeaderMouseOut:function(d){},
onHeaderCellMouseOver:function(d){d.cellNode&&I.add(d.cellNode,this.cellOverClass)},onHeaderCellMouseOut:function(d){d.cellNode&&I.remove(d.cellNode,this.cellOverClass)},onHeaderCellMouseDown:function(d){},onHeaderClick:function(d){},onHeaderCellClick:function(d){this.setSortIndex(d.cell.index);this.onHeaderClick(d)},onHeaderDblClick:function(d){},onHeaderCellDblClick:function(d){this.onHeaderDblClick(d)},onHeaderCellContextMenu:function(d){this.onHeaderContextMenu(d)},onHeaderContextMenu:function(d){this.headerMenu||
G.stop(d)},onStartEdit:function(d,c){},onApplyCellEdit:function(d,c,a){},onCancelEdit:function(d){},onApplyEdit:function(d){},onCanSelect:function(d){return!0},onCanDeselect:function(d){return!0},onSelected:function(d){this.updateRowStyles(d)},onDeselected:function(d){this.updateRowStyles(d)},onSelectionChanged:function(){}})})},"dojox/grid/_Scroller":function(){define(["dijit/registry","dojo/_base/declare","dojo/_base/lang","./util","dojo/_base/html"],function(Q,I,J,G,u){var d=function(a){a&&dojo.forEach(Q.toArray(),
function(w){w.domNode&&u.isDescendant(w.domNode,a,!0)&&w.destroy()})},c=function(a,w){for(var q=[],e=0,k;k=a.childNodes[e];){e++;var z=u.byId(k);(z&&z.tagName?z.tagName.toLowerCase():"")==w&&q.push(k)}return q};return I("dojox.grid._Scroller",null,{constructor:function(a){this.setContentNodes(a);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(a,w,q){switch(arguments.length){case 3:this.rowsPerPage=q;case 2:this.keepRows=w;case 1:this.rowCount=a}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=J.hitch(this,
"onscroll"))},_getPageCount:function(a,w){return a?Math.ceil(a/w)||1:0},destroy:function(){this.invalidateNodes();delete this.contentNodes;delete this.contentNode;delete this.scrollboxNode},setKeepInfo:function(a){this.keepPages=(this.keepRows=a)?Math.max(Math.ceil(this.keepRows/this.rowsPerPage),2):this.keepPages},setContentNodes:function(a){this.colCount=(this.contentNodes=a)?this.contentNodes.length:0;this.pageNodes=[];for(a=0;a<this.colCount;a++)this.pageNodes[a]=[]},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(a){this.invalidateNodes();this.rowCount=a;a=this.pageCount;0===a&&(this.height=1);this.pageCount=this._getPageCount(this.rowCount,this.rowsPerPage);if(this.pageCount<a)for(--a;a>=this.pageCount;a--)this.height-=this.getPageHeight(a),delete this.pageHeights[a];
else this.pageCount>a&&(this.height+=this.defaultPageHeight*(this.pageCount-a-1)+this.calcLastPageHeight());this.resize()},pageExists:function(a){return!!this.getDefaultPageNode(a)},measurePage:function(a){return this.grid.rowHeight?((a+1)*this.rowsPerPage>this.rowCount?this.rowCount-a*this.rowsPerPage:this.rowsPerPage)*this.grid.rowHeight:(a=this.getDefaultPageNode(a))&&a.innerHTML?a.offsetHeight:void 0},positionPage:function(a,w){for(var q=0;q<this.colCount;q++)this.pageNodes[q][a].style.top=w+
"px"},repositionPages:function(a){for(var w=this.getDefaultNodes(),q=0,e=0;e<this.stack.length;e++)q=Math.max(this.stack[e],q);var k=(e=w[a])?this.getPageNodePosition(e)+this.getPageHeight(a):0;for(a+=1;a<=q;a++){if(e=w[a]){if(this.getPageNodePosition(e)==k)break;this.positionPage(a,k)}k+=this.getPageHeight(a)}},installPage:function(a){for(var w=0;w<this.colCount;w++)this.contentNodes[w].appendChild(this.pageNodes[w][a])},preparePage:function(a,w){w=w?this.popPage():null;for(var q=0;q<this.colCount;q++){var e=
this.pageNodes[q],k=null===w?this.createPageNode():this.invalidatePageNode(w,e);k.pageIndex=a;e[a]=k}},renderPage:function(a){var w=[],q;for(q=0;q<this.colCount;q++)w[q]=this.pageNodes[q][a];q=0;for(a*=this.rowsPerPage;q<this.rowsPerPage&&a<this.rowCount;q++,a++)this.renderRow(a,w)},removePage:function(a){var w=0;for(a*=this.rowsPerPage;w<this.rowsPerPage;w++,a++)this.removeRow(a)},destroyPage:function(a){for(var w=0;w<this.colCount;w++){var q=this.invalidatePageNode(a,this.pageNodes[w]);q&&u.destroy(q)}},
pacify:function(a){},pacifying:!1,pacifyTicks:200,setPacifying:function(a){this.pacifying!=a&&(this.pacifying=a,this.pacify(this.pacifying))},startPacify:function(){this.startPacifyTicks=(new Date).getTime()},doPacify:function(){var a=(new Date).getTime()-this.startPacifyTicks>this.pacifyTicks;this.setPacifying(!0);this.startPacify();return a},endPacify:function(){this.setPacifying(!1)},resize:function(){this.scrollboxNode&&(this.windowHeight=this.scrollboxNode.clientHeight);for(var a=0;a<this.colCount;a++)G.setStyleHeightPx(this.contentNodes[a],
Math.max(1,this.height));a=!this._invalidating;if(!a){var w=this.grid.get("autoHeight");"number"==typeof w&&w<=Math.min(this.rowsPerPage,this.rowCount)&&(a=!0)}a&&this.needPage(this.page,this.pageTop);a=this.page<this.pageCount-1?this.rowsPerPage:this.rowCount%this.rowsPerPage||this.rowsPerPage;w=this.getPageHeight(this.page);this.averageRowHeight=0<w&&0<a?w/a:0},calcLastPageHeight:function(){if(!this.pageCount)return 0;var a=(this.rowCount%this.rowsPerPage||this.rowsPerPage)*this.defaultRowHeight;
return this.pageHeights[this.pageCount-1]=a},updateContentHeight:function(a){this.height+=a;this.resize()},updatePageHeight:function(a,w,q){if(this.pageExists(a)){var e=this.getPageHeight(a),k=this.measurePage(a);void 0===k&&(k=e);this.pageHeights[a]=k;if(e!=k){this.updateContentHeight(k-e);var z=this.grid.get("autoHeight");"number"==typeof z&&z>this.rowCount||!0===z&&!w?q?(w=this.grid.viewsNode.style,w.height=parseInt(w.height)+k-e+"px",this.repositionPages(a)):this.grid.sizeChange():this.repositionPages(a)}return k}return 0},
rowHeightChanged:function(a,w){this.updatePageHeight(Math.floor(a/this.rowsPerPage),!1,w)},invalidateNodes:function(){for(;this.stack.length;)this.destroyPage(this.popPage())},createPageNode:function(){var a=document.createElement("div");u.attr(a,"role","presentation");a.style.position="absolute";a.style[this.grid.isLeftToRight()?"left":"right"]="0";return a},getPageHeight:function(a){a=this.pageHeights[a];return void 0!==a?a:this.defaultPageHeight},pushPage:function(a){return this.stack.push(a)},
popPage:function(){return this.stack.shift()},findPage:function(a){for(var w=0,q=0,e=0;w<this.pageCount&&!(e=this.getPageHeight(w),q+e>=a);w++,q+=e);this.page=w;this.pageTop=q},buildPage:function(a,w,q){this.preparePage(a,w);this.positionPage(a,q);this.installPage(a);this.renderPage(a);this.pushPage(a)},needPage:function(a,w){var q=this.getPageHeight(a);this.pageExists(a)?this.positionPage(a,w):(this.buildPage(a,!this.grid._autoHeight&&this.keepPages&&this.stack.length>=this.keepPages,w),q=this.updatePageHeight(a,
!0));return q},onscroll:function(){this.scroll(this.scrollboxNode.scrollTop)},scroll:function(a){this.grid.scrollTop=a;if(this.colCount){this.startPacify();this.findPage(a);for(var w=this.height,q=this.getScrollBottom(a),e=this.page,k=this.pageTop;e<this.pageCount&&(0>q||k<q);e++)k+=this.needPage(e,k);this.firstVisibleRow=this.getFirstVisibleRow(this.page,this.pageTop,a);this.lastVisibleRow=this.getLastVisibleRow(e-1,k,q);w!=this.height&&this.repositionPages(e-1);this.endPacify()}},getScrollBottom:function(a){return 0<=
this.windowHeight?a+this.windowHeight:-1},processNodeEvent:function(a,w){for(var q=a.target;q&&q!=w&&q.parentNode&&q.parentNode.parentNode!=w;)q=q.parentNode;if(!q||!q.parentNode||q.parentNode.parentNode!=w)return!1;a.topRowIndex=q.parentNode.pageIndex*this.rowsPerPage;w=a.topRowIndex;a:{var e=0;for(var k,z=q.parentNode;k=z.childNodes[e++];)if(k==q){--e;break a}e=-1}a.rowIndex=w+e;a.rowTarget=q;return!0},processEvent:function(a){return this.processNodeEvent(a,this.contentNode)},renderRow:function(a,
w){},removeRow:function(a){},getDefaultPageNode:function(a){return this.getDefaultNodes()[a]},positionPageNode:function(a,w){},getPageNodePosition:function(a){return a.offsetTop},invalidatePageNode:function(a,w){var q=w[a];q&&(delete w[a],this.removePage(a,q),d(q),q.innerHTML="");return q},getPageRow:function(a){return a*this.rowsPerPage},getLastPageRow:function(a){return Math.min(this.rowCount,this.getPageRow(a+1))-1},getFirstVisibleRow:function(a,w,q){if(!this.pageExists(a))return 0;var e=this.getPageRow(a),
k=this.getDefaultNodes();a=c(k[a],"div");k=0;for(var z=a.length;k<z&&w<q;k++,e++)w+=a[k].offsetHeight;return e?e-1:e},getLastVisibleRow:function(a,w,q){if(!this.pageExists(a))return 0;var e=this.getDefaultNodes(),k=this.getLastPageRow(a);a=c(e[a],"div");for(e=a.length-1;0<=e&&w>q;e--,k--)w-=a[e].offsetHeight;return k+1},findTopRow:function(a){var w=this.getDefaultNodes();w=c(w[this.page],"div");for(var q=0,e=w.length,k=this.pageTop,z;q<e;q++)if(z=w[q].offsetHeight,k+=z,k>=a)return this.offset=z-(k-
a),q+this.page*this.rowsPerPage;return-1},findScrollTop:function(a){var w=Math.floor(a/this.rowsPerPage),q=0,e;for(e=0;e<w;e++)q+=this.getPageHeight(e);this.pageTop=q;this.page=w;this.needPage(w,this.pageTop);e=this.getDefaultNodes();var k=c(e[w],"div");w=a-this.rowsPerPage*w;e=0;for(a=k.length;e<a&&e<w;e++)q+=k[e].offsetHeight;return q},dummy:0})})},"dojox/grid/util":function(){define(["../main","dojo/_base/lang","dojo/dom","dojo/_base/sniff"],function(Q,I,J,G){var u=I.getObject("grid.util",!0,Q);
u.na="...";u.rowIndexTag="gridRowIndex";u.gridViewTag="gridView";u.fire=function(d,c,a){function w(n,g){if(null==n)return null;var m=g?"Width":"Height";return n["scroll"+m]>n["client"+m]?n:w(n.parentNode,g)}var q;if(G("webkit")&&"focus"==c){var e=d.domNode?d.domNode:d;if(q=w(e,!1))var k=q.scrollTop;if(e=w(e,!0))var z=e.scrollLeft}var f=d&&c&&d[c];d=f&&(a?f.apply(d,a):d[c]());G("webkit")&&"focus"==c&&(q&&(q.scrollTop=k),e&&(e.scrollLeft=z));return d};u.setStyleHeightPx=function(d,c){if(0<=c){var a=
d.style;c+="px";d&&a.height!=c&&(a.height=c)}};u.mouseEvents="mouseover mouseout mousedown mouseup click dblclick contextmenu".split(" ");u.keyEvents=["keyup","keydown","keypress"];u.funnelEvents=function(d,c,a,w){w=w?w:u.mouseEvents.concat(u.keyEvents);for(var q=0,e=w.length;q<e;q++)c.connect(d,"on"+w[q],a)};u.removeNode=function(d){(d=J.byId(d))&&d.parentNode&&d.parentNode.removeChild(d);return d};u.arrayCompare=function(d,c){for(var a=0,w=d.length;a<w;a++)if(d[a]!=c[a])return!1;return d.length==
c.length};u.arrayInsert=function(d,c,a){d.length<=c?d[c]=a:d.splice(c,0,a)};u.arrayRemove=function(d,c){d.splice(c,1)};u.arraySwap=function(d,c,a){var w=d[c];d[c]=d[a];d[a]=w};return u})},"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(Q,I,J,G,u,d){return J("dojox.grid._Layout",null,{constructor:function(c){this.grid=c},cells:[],structure:null,defaultWidth:"6em",moveColumn:function(c,
a,w,q,e){var k=this.structure[c].cells[0],z=this.structure[a].cells[0],f=null,n=f=0;c=0;for(var g;g=k[c];c++)if(g.index==w){f=c;break}f=k.splice(f,1)[0];f.view=this.grid.views.views[a];c=0;for(g=null;g=z[c];c++)if(g.index==q){n=c;break}e||(n+=1);z.splice(n,0,f);if(w=this.grid.getCell(this.grid.getSortIndex()))w._currentlySorted=this.grid.getSortAsc();this.cells=[];for(c=w=0;a=this.structure[c];c++)for(q=0;e=a.cells[q];q++)for(k=0;g=e[k];k++)g.index=w,this.cells.push(g),"_currentlySorted"in g&&(z=
w+1,z*=g._currentlySorted?1:-1,this.grid.sortInfo=z,delete g._currentlySorted),w++;G.forEach(this.cells,function(m){var l=m.markup[2].split(" ");parseInt(l[1].substring(5))!=m.index&&(l[1]='idx\x3d"'+m.index+'"',m.markup[2]=l.join(" "))});this.grid.setupHeaderMenu()},setColumnVisibility:function(c,a){c=this.cells[c];if(c.hidden==a){c.hidden=!a;a=c.view;var w=a.viewWidth;w&&"auto"!=w&&(a._togglingColumn=d.getMarginBox(c.getHeaderNode()).w||0);a.update();return!0}return!1},addCellDef:function(c,a,w){var q=
this,e=function(k){var z=0;1<k.colSpan?z=0:(z=k.width||q._defaultCellProps.width||q.defaultWidth,isNaN(z)||(z+="em"));return z};c={grid:this.grid,subrow:c,layoutIndex:a,index:this.cells.length};if(w&&w instanceof I.grid.cells._Base)return a=u.clone(w),c.unitWidth=e(a._props),a=u.mixin(a,this._defaultCellProps,w._props,c);a=w.type||w.cellType||this._defaultCellProps.type||this._defaultCellProps.cellType||I.grid.cells.Cell;u.isString(a)&&(a=u.getObject(a));c.unitWidth=e(w);return new a(u.mixin({},this._defaultCellProps,
w,c))},addRowDef:function(c,a){for(var w=[],q=0,e=0,k=!0,z=0,f;f=a[z];z++)f=this.addCellDef(c,z,f),w.push(f),this.cells.push(f),k&&f.relWidth?q+=f.relWidth:f.width&&(f=f.width,"string"==typeof f&&"%"==f.slice(-1)?e+=window.parseInt(f,10):"auto"==f&&(k=!1));q&&k&&G.forEach(w,function(n){n.relWidth&&(n.width=n.unitWidth=n.relWidth/q*(100-e)+"%")});return w},addRowsDef:function(c){var a=[];if(u.isArray(c))if(u.isArrayLike(c[0]))for(var w=0,q;c&&(q=c[w]);w++)a.push(this.addRowDef(w,q));else a.push(this.addRowDef(0,
c));return a},addViewDef:function(c){this._defaultCellProps=c.defaultCell||{};c.width&&"auto"==c.width&&delete c.width;return u.mixin({},c,{cells:this.addRowsDef(c.rows||c.cells)})},setStructure:function(c){this.fieldIndex=0;this.cells=[];var a=this.structure=[];if(this.grid.rowSelector){var w={type:I._scopeName+".grid._RowSelector"};if(u.isString(this.grid.rowSelector)){var q=this.grid.rowSelector;"false"==q?w=null:"true"!=q&&(w.width=q)}else this.grid.rowSelector||(w=null);w&&a.push(this.addViewDef(w))}var e=
function(n){return"name"in n||"field"in n||"get"in n};w=function(n){return u.isArray(n)&&(u.isArray(n[0])||e(n[0]))?!0:!1};q=function(n){return null!==n&&u.isObject(n)&&("cells"in n||"rows"in n||"type"in n&&!e(n))};if(u.isArrayLike(c)){for(var k=!1,z=0,f;f=c[z];z++)if(q(f)){k=!0;break}if(k)for(z=0;f=c[z];z++)w(f)?a.push(this.addViewDef({cells:f})):q(f)&&a.push(this.addViewDef(f));else a.push(this.addViewDef({cells:c}))}else q(c)&&a.push(this.addViewDef(c));this.cellCount=this.cells.length;this.grid.setupHeaderMenu()}})})},
"dojox/grid/cells":function(){define(["../main","./cells/_base"],function(Q){return Q.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(Q,I,J,G,u,d,c,a,w,q,e,k){var z=I("dojox.grid._DeferredTextWidget",e,{deferred:null,_destroyOnRemove:!0,postCreate:function(){this.deferred&&this.deferred.addBoth(J.hitch(this,
function(l){this.domNode&&(this.domNode.innerHTML=l)}))}}),f=function(){setTimeout(J.hitch.apply(Q,arguments),0)},n=I("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(l){this._props=l||{};J.mixin(this,l);void 0===this.draggable&&(this.draggable=!0)},_defaultFormat:function(l,C){var A=this.grid.formatterScope||this,L=this.formatter;
L&&A&&"string"==typeof L&&(L=this.formatter=A[L]);l=l!=this.defaultValue&&L?L.apply(A,C):l;if("undefined"==typeof l)return this.defaultValue;l&&l.addBoth&&(l=new z({deferred:l},q.create("span",{innerHTML:this.defaultValue})));return l&&l.declaredClass&&l.startup?"\x3cdiv class\x3d'dojoxGridStubNode' linkWidget\x3d'"+l.id+"' cellIdx\x3d'"+this.index+"'\x3e"+this.defaultValue+"\x3c/div\x3e":l},format:function(l,C){var A=this.grid.edit.info;(C=this.get?this.get(l,C):this.value||this.defaultValue)&&C.replace&&
this.grid.escapeHTMLInData&&(C=C.replace(/&(?![a-z0-9]{1,8};)/ig,"\x26amp;").replace(/</g,"\x26lt;"));return this.editable&&(this.alwaysEditing||A.rowIndex==l&&A.cell==this)?this.formatEditing(A.value?A.value:C,l):this._defaultFormat(C,[C,l,this])},formatEditing:function(l,C){},getNode:function(l){return this.view.getCellNode(l,this.index)},getHeaderNode:function(){return this.view.getHeaderCellNode(this.index)},getEditNode:function(l){return(this.getNode(l)||0).firstChild||0},canResize:function(){var l=
this.unitWidth;return l&&"auto"!==l},isFlex:function(){var l=this.unitWidth;return l&&J.isString(l)&&("auto"==l||"%"==l.slice(-1))},applyEdit:function(l,C){this.getNode(C)&&this.grid.edit.applyCellEdit(l,this,C)},cancelEdit:function(l){this.grid.doCancelEdit(l)},_onEditBlur:function(l){this.grid.edit.isEditCell(l,this.index)&&this.grid.edit.apply()},registerOnBlur:function(l,C){this.commitOnBlur&&u.connect(l,"onblur",function(A){setTimeout(J.hitch(this,"_onEditBlur",C),250)})},needFormatNode:function(l,
C){this._formatPending=!0;f(this,"_formatNode",l,C)},cancelFormatNode:function(){this._formatPending=!1},_formatNode:function(l,C){this._formatPending&&(this._formatPending=!1,c("ie")||a.setSelectable(this.grid.domNode,!0),this.formatNode(this.getEditNode(C),l,C))},formatNode:function(l,C,A){c("ie")?f(this,"focus",A,l):this.focus(A,l)},dispatchEvent:function(l,C){if(l in this)return this[l](C)},getValue:function(l){return this.getEditNode(l)[this._valueProp]},setValue:function(l,C){(l=this.getEditNode(l))&&
(l[this._valueProp]=C)},focus:function(l,C){l=C||this.getEditNode(l);try{k.fire(l,"focus"),k.fire(l,"select")}catch(A){}},save:function(l){this.value=this.value||this.getValue(l)},restore:function(l){this.setValue(l,this.value)},_finish:function(l){a.setSelectable(this.grid.domNode,!1);this.cancelFormatNode()},apply:function(l){this.applyEdit(this.getValue(l),l);this._finish(l)},cancel:function(l){this.cancelEdit(l);this._finish(l)}});n.markupFactory=function(l,C){var A=J.trim(w.get(l,"formatter")||
"");A&&(C.formatter=J.getObject(A)||A);if(A=J.trim(w.get(l,"get")||""))C.get=J.getObject(A);A=function(L,y,v){var b=J.trim(w.get(l,L)||"");b&&(y[v||L]="false"!=b.toLowerCase())};A("sortDesc",C);A("editable",C);A("alwaysEditing",C);A("noresize",C);A("draggable",C);if(A=J.trim(w.get(l,"loadingText")||w.get(l,"defaultValue")||""))C.defaultValue=A;A=function(L,y,v){var b=J.trim(w.get(l,L)||"")||void 0;b&&(y[v||L]=b)};A("styles",C);A("headerStyles",C);A("cellStyles",C);A("classes",C);A("headerClasses",
C);A("cellClasses",C)};var g=n.Cell=I("dojox.grid.cells.Cell",n,{constructor:function(){this.keyFilter=this.keyFilter},keyFilter:null,formatEditing:function(l,C){this.needFormatNode(l,C);l&&l.replace&&(l=l.replace(/"/g,"\x26quot;"));return'\x3cinput class\x3d"dojoxGridInput" type\x3d"text" value\x3d"'+l+'"\x3e'},formatNode:function(l,C,A){this.inherited(arguments);this.registerOnBlur(l,A)},doKey:function(l){this.keyFilter&&-1==String.fromCharCode(l.charCode).search(this.keyFilter)&&G.stop(l)},_finish:function(l){this.inherited(arguments);
var C=this.getEditNode(l);try{k.fire(C,"blur")}catch(A){}}});g.markupFactory=function(l,C){n.markupFactory(l,C);if(l=J.trim(w.get(l,"keyFilter")||""))C.keyFilter=new RegExp(l)};(n.RowIndex=I("dojox.grid.cells.RowIndex",g,{name:"Row",postscript:function(){this.editable=!1},get:function(l){return l+1}})).markupFactory=function(l,C){g.markupFactory(l,C)};(n.Select=I("dojox.grid.cells.Select",g,{options:null,values:null,returnIndex:-1,constructor:function(l){this.values=this.values||this.options},formatEditing:function(l,
C){this.needFormatNode(l,C);C=['\x3cselect class\x3d"dojoxGridSelect"\x3e'];for(var A=0,L,y;void 0!==(L=this.options[A])&&void 0!==(y=this.values[A]);A++)y=y.replace?y.replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;"):y,L=L.replace?L.replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;"):L,C.push("\x3coption",l==y?" selected":"",' value\x3d"'+y+'"',"\x3e",L,"\x3c/option\x3e");C.push("\x3c/select\x3e");return C.join("")},_defaultFormat:function(l,C){var A=this.inherited(arguments);if(!this.formatter&&this.values&&
this.options){var L=d.indexOf(this.values,A);0<=L&&(A=this.options[L])}return A},getValue:function(l){var C=this.getEditNode(l);if(C)return l=C.selectedIndex,C=C.options[l],-1<this.returnIndex?l:C.value||C.innerHTML}})).markupFactory=function(l,C){g.markupFactory(l,C);var A=J.trim(w.get(l,"options")||"");if(A){var L=A.split(",");L[0]!=A&&(C.options=L)}if(l=J.trim(w.get(l,"values")||""))A=l.split(","),A[0]!=l&&(C.values=A)};var m=n.AlwaysEdit=I("dojox.grid.cells.AlwaysEdit",g,{alwaysEditing:!0,_formatNode:function(l,
C){this.formatNode(this.getEditNode(C),l,C)},applyStaticValue:function(l){var C=this.grid.edit;C.applyCellEdit(this.getValue(l),this,l);C.start(this,l,!0)}});m.markupFactory=function(l,C){g.markupFactory(l,C)};(n.Bool=I("dojox.grid.cells.Bool",m,{_valueProp:"checked",formatEditing:function(l,C){return'\x3cinput class\x3d"dojoxGridInput" type\x3d"checkbox"'+(l?' checked\x3d"checked"':"")+' style\x3d"width: auto" /\x3e'},doclick:function(l){"INPUT"==l.target.tagName&&this.applyStaticValue(l.rowIndex)}})).markupFactory=
function(l,C){m.markupFactory(l,C)};return n})},"dojox/grid/_RowSelector":function(){define(["dojo/_base/declare","./_View"],function(Q,I){return Q("dojox.grid._RowSelector",I,{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(J,G){G.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(J,G){var u=
["dojoxGridRowbar dojoxGridNonNormalizedCell"];this.grid.rows.isOver(J)&&u.push("dojoxGridRowbarOver");this.grid.selection.isSelected(J)&&u.push("dojoxGridRowbarSelected");G.className=u.join(" ")},domouseover:function(J){this.grid.onMouseOverRow(J)},domouseout:function(J){if(!this.isIntraRowEvent(J))this.grid.onMouseOutRow(J)}})})},"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(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A){e=G("dojox.grid._View",[z,f],{defaultWidth:"18em",viewWidth:"",templateString:e,classTag:"dojoxGrid",marginBottom:0,rowPad:2,_togglingColumn:-1,_headerBuilderClass:l._HeaderBuilder,_contentBuilderClass:l._ContentBuilder,postMixInProperties:function(){this.rowNodes={}},postCreate:function(){this.connect(this.scrollboxNode,"onscroll","doscroll");g.funnelEvents(this.contentNode,this,"doContentEvent","mouseover mouseout click dblclick contextmenu mousedown".split(" "));
g.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(){m.destroy(this.headerNode);delete this.headerNode;for(var v in this.rowNodes)this._cleanupRowWidgets(this.rowNodes[v]),m.destroy(this.rowNodes[v]);this.rowNodes={};this.source&&this.source.destroy();
this.inherited(arguments)},focus:function(){a("ie")||a("webkit")||a("opera")?this.hiddenFocusNode.focus():this.scrollboxNode.focus()},setStructure:function(v){v=this.structure=v;v.width&&!isNaN(v.width)?this.viewWidth=v.width+"em":this.viewWidth=v.width||(v.noscroll?"auto":this.viewWidth);this._onBeforeRow=v.onBeforeRow||function(){};this._onAfterRow=v.onAfterRow||function(){};if(this.noscroll=v.noscroll)this.scrollboxNode.style.overflow="hidden";this.simpleStructure=1==v.cells.length;this.testFlexCells();
this.updateStructure()},_cleanupRowWidgets:function(v){v&&u.forEach(w("[widgetId]",v).map(I.byNode),function(b){b._destroyOnRemove?(b.destroy(),delete b):b.domNode&&b.domNode.parentNode&&b.domNode.parentNode.removeChild(b.domNode)})},onBeforeRow:function(v,b){this._onBeforeRow(v,b);0<=v&&this._cleanupRowWidgets(this.getRowNode(v))},onAfterRow:function(v,b,D){this._onAfterRow(v,b,D);var h=this.grid;u.forEach(w(".dojoxGridStubNode",D),function(B){if(B&&B.parentNode){var H=B.getAttribute("linkWidget"),
T=window.parseInt(m.attr(B,"cellIdx"),10);h.getCell(T);(H=I.byId(H))?(B.parentNode.replaceChild(H.domNode,B),H._started||H.startup(),Q.destroy(B)):B.innerHTML=""}},this)},testFlexCells:function(){this.flexCells=!1;for(var v=0,b;b=this.structure.cells[v];v++)for(var D=0,h;h=b[D];D++)h.view=this,this.flexCells=this.flexCells||h.isFlex();return this.flexCells},updateStructure:function(){this.header.update();this.content.update()},getScrollbarWidth:function(){var v=this.hasVScrollbar(),b=m.style(this.scrollboxNode,
"overflow");this.noscroll||!b||"hidden"==b?v=!1:"scroll"==b&&(v=!0);return v?n.getScrollbar().w:0},getColumnsWidth:function(){var v=this.headerContentNode;return v&&v.firstChild?v.firstChild.offsetWidth||m.style(v.firstChild,"width"):0},setColumnsWidth:function(v){this.headerContentNode.firstChild.style.width=v+"px";this.viewWidth&&(this.viewWidth=v+"px")},getWidth:function(){return this.viewWidth||this.getColumnsWidth()+this.getScrollbarWidth()+"px"},getContentWidth:function(){return Math.max(0,
m._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 v=this.grid.layout.cells,b=d.hitch(this,function(h,B){!this.grid.isLeftToRight()&&(B=!B);B=B?-1:1;h=this.header.getCellNodeIndex(h)+B;for(var H=v[h];H&&H.getHeaderNode()&&"none"==H.getHeaderNode().style.display;)h+=B,H=v[h];return H?H.getHeaderNode():
null});if(this.grid.columnReordering&&this.simpleStructure){this.source&&this.source.destroy();this.bottomMarker&&m.destroy(this.bottomMarker);this.bottomMarker=m.byId("dojoxGrid_bottomMarker");this.topMarker&&m.destroy(this.topMarker);this.topMarker=m.byId("dojoxGrid_topMarker");this.bottomMarker||(this.bottomMarker=m.create("div",{id:"dojoxGrid_bottomMarker","class":"dojoxGridColPlaceBottom"},q.body()),this._hide(this.bottomMarker),this.topMarker=m.create("div",{id:"dojoxGrid_topMarker","class":"dojoxGridColPlaceTop"},
q.body()),this._hide(this.topMarker));this.arrowDim=m.contentBox(this.bottomMarker);var D=m.contentBox(this.headerContentNode.firstChild.rows[0]).h;this.source=new k(this.headerContentNode.firstChild.rows[0],{horizontal:!0,accept:["gridColumn_"+this.grid.id],viewIndex:this.index,generateText:!1,onMouseDown:d.hitch(this,function(h){this.header.decorateEvent(h);if((this.header.overRightResizeArea(h)||this.header.overLeftResizeArea(h))&&this.header.canResize(h)&&!this.header.moveable)this.header.beginColumnResize(h);
else{if(this.grid.headerMenu)this.grid.headerMenu.onCancel(!0);h.button===(9>a("ie")?1:0)&&k.prototype.onMouseDown.call(this.source,h)}}),onMouseOver:d.hitch(this,function(h){var B=this.source;B._getChildByEvent(h)&&k.prototype.onMouseOver.apply(B,arguments)}),_markTargetAnchor:d.hitch(this,function(h){var B=this.source;if(B.current!=B.targetAnchor||B.before!=h){B.targetAnchor&&b(B.targetAnchor,B.before)&&B._removeItemClass(b(B.targetAnchor,B.before),B.before?"After":"Before");k.prototype._markTargetAnchor.call(B,
h);var H=h?B.targetAnchor:b(B.targetAnchor,B.before);h=0;H||(H=B.targetAnchor,h=m.contentBox(H).w+this.arrowDim.w/2+2);H=m.position(H,!0);h=Math.floor(H.x-this.arrowDim.w/2+h);m.style(this.bottomMarker,"visibility","visible");m.style(this.topMarker,"visibility","visible");m.style(this.bottomMarker,{left:h+"px",top:D+H.y+"px"});m.style(this.topMarker,{left:h+"px",top:H.y-this.arrowDim.h+"px"});B.targetAnchor&&b(B.targetAnchor,B.before)&&B._addItemClass(b(B.targetAnchor,B.before),B.before?"After":"Before")}}),
_unmarkTargetAnchor:d.hitch(this,function(){var h=this.source;h.targetAnchor&&(h.targetAnchor&&b(h.targetAnchor,h.before)&&h._removeItemClass(b(h.targetAnchor,h.before),h.before?"After":"Before"),this._hide(this.bottomMarker),this._hide(this.topMarker),k.prototype._unmarkTargetAnchor.call(h))}),destroy:d.hitch(this,function(){c.disconnect(this._source_conn);c.unsubscribe(this._source_sub);k.prototype.destroy.call(this.source);this.bottomMarker&&(m.destroy(this.bottomMarker),delete this.bottomMarker);
this.topMarker&&(m.destroy(this.topMarker),delete this.topMarker)}),onDndCancel:d.hitch(this,function(){k.prototype.onDndCancel.call(this.source);this._hide(this.bottomMarker);this._hide(this.topMarker)})});this._source_conn=c.connect(this.source,"onDndDrop",this,"_onDndDrop");this._source_sub=c.subscribe("/dnd/drop/before",this,"_onDndDropBefore");this.source.startup()}},_hide:function(v){m.style(v,{top:"-10000px",visibility:"hidden"})},_onDndDropBefore:function(v,b,D){A.manager().target===this.source&&
(this.source._targetNode=this.source.targetAnchor,this.source._beforeTarget=this.source.before,b=this.grid.views.views,v=b[v.viewIndex],b=b[this.index],b!=v&&(v.convertColPctToFixed(),b.convertColPctToFixed()))},_onDndDrop:function(v,b,D){if(A.manager().target!==this.source)A.manager().source===this.source&&(this._removingColumn=!0);else{this._hide(this.bottomMarker);this._hide(this.topMarker);D=function(N){return N?m.attr(N,"idx"):null};var h=m.marginBox(b[0]).w;if(v.viewIndex!==this.index){var B=
this.grid.views.views,H=B[v.viewIndex];B=B[this.index];H.viewWidth&&"auto"!=H.viewWidth&&H.setColumnsWidth(H.getColumnsWidth()-h);B.viewWidth&&"auto"!=B.viewWidth&&B.setColumnsWidth(B.getColumnsWidth())}h=this.source._targetNode;H=this.source._beforeTarget;!this.grid.isLeftToRight()&&(H=!H);B=this.grid.layout;var T=this.index;delete this.source._targetNode;delete this.source._beforeTarget;B.moveColumn(v.viewIndex,T,D(b[0]),D(h),H)}},renderHeader:function(){this.headerContentNode.innerHTML=this.header.generateHtml(this._getHeaderContent);
this.flexCells&&(this.contentWidth=this.getContentWidth(),this.headerContentNode.firstChild.style.width=this.contentWidth);g.fire(this,"onAfterRow",[-1,this.structure.cells,this.headerContentNode])},_getHeaderContent:function(v){var b=v.name||v.grid.getCellName(v);/^\s+$/.test(b)&&(b="\x26nbsp;");var D=['\x3cdiv class\x3d"dojoxGridSortNode'];v.index!=v.grid.getSortIndex()?D.push('"\x3e'):D=D.concat([" ",0<v.grid.sortInfo?"dojoxGridSortUp":"dojoxGridSortDown",'"\x3e\x3cdiv class\x3d"dojoxGridArrowButtonChar"\x3e',
0<v.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']);D=D.concat([b,"\x3c/div\x3e\x3c/div\x3e"]);return D.join("")},resize:function(){this.adaptHeight();this.adaptWidth()},hasHScrollbar:function(v){var b=this._hasHScroll||!1;if(void 0==this._hasHScroll||v)this.noscroll?this._hasHScroll=!1:(v=m.style(this.scrollboxNode,"overflow"),this._hasHScroll="hidden"==v?!1:"scroll"==
v?!0:this.scrollboxNode.offsetWidth-this.getScrollbarWidth()<this.contentNode.offsetWidth);b!==this._hasHScroll&&this.grid.update();return this._hasHScroll},hasVScrollbar:function(v){var b=this._hasVScroll||!1;if(void 0==this._hasVScroll||v)this.noscroll?this._hasVScroll=!1:(v=m.style(this.scrollboxNode,"overflow"),this._hasVScroll="hidden"==v?!1:"scroll"==v?!0:this.scrollboxNode.scrollHeight>this.scrollboxNode.clientHeight);b!==this._hasVScroll&&this.grid.update();return this._hasVScroll},convertColPctToFixed:function(){var v=
!1;this.grid.initialWidth="";var b=w("th",this.headerContentNode),D=u.map(b,function(h,B){var H=h.style.width;m.attr(h,"vIdx",B);if(H&&"%"==H.slice(-1))v=!0;else if(H&&"px"==H.slice(-2))return window.parseInt(H,10);return m.contentBox(h).w});return v?(u.forEach(this.grid.layout.cells,function(h,B){if(h.view==this&&(h=h.view.getHeaderCellNode(h.index))&&m.hasAttr(h,"vIdx")){var H=window.parseInt(m.attr(h,"vIdx"));this.setColWidth(B,D[H]);m.removeAttr(h,"vIdx")}},this),!0):!1},adaptHeight:function(v){if(!this.grid._autoHeight){var b=
this.domNode.style.height&&parseInt(this.domNode.style.height.replace(/px/,""),10)||this.domNode.clientHeight;if(!v&&(v=this.noscroll))a:{for(var D=0;D<this.grid.views.views.length;++D)if(v=this.grid.views.views[D],v!==this&&v.hasHScrollbar()){v=!0;break a}v=!1}v&&(b-=n.getScrollbar().h);g.setStyleHeightPx(this.scrollboxNode,b)}this.hasVScrollbar(!0)},adaptWidth:function(){this.flexCells&&(this.contentWidth=this.getContentWidth(),this.headerContentNode.firstChild.style.width=this.contentWidth);var v=
this.scrollboxNode.offsetWidth-this.getScrollbarWidth();this._removingColumn?(v=Math.min(v,this.getColumnsWidth())+"px",this._removingColumn=!1):v=Math.max(v,this.getColumnsWidth())+"px";this.contentNode.style.width=v;this.hasHScrollbar(!0)},setSize:function(v,b){var D=this.domNode.style,h=this.headerNode.style;v&&(D.width=v,h.width=v);D.height=0<=b?b+"px":""},renderRow:function(v){var b=this.createRowNode(v);this.buildRow(v,b);return b},createRowNode:function(v){var b=document.createElement("div");
b.className=this.classTag+"Row";this instanceof J.grid._RowSelector?m.attr(b,"role","presentation"):(m.attr(b,"role","row"),"none"!=this.grid.selectionMode&&b.setAttribute("aria-selected","false"));b[g.gridViewTag]=this.id;b[g.rowIndexTag]=v;return this.rowNodes[v]=b},buildRow:function(v,b){this.buildRowContent(v,b);this.styleRow(v,b)},buildRowContent:function(v,b){b.innerHTML=this.content.generateHtml(v,v);this.flexCells&&this.contentWidth&&(b.firstChild.style.width=this.contentWidth);g.fire(this,
"onAfterRow",[v,this.structure.cells,b])},rowRemoved:function(v){0<=v&&this._cleanupRowWidgets(this.getRowNode(v));this.grid.edit.save(this,v);delete this.rowNodes[v]},getRowNode:function(v){return this.rowNodes[v]},getCellNode:function(v,b){if(v=this.getRowNode(v))return this.content.getCellNode(v,b)},getHeaderCellNode:function(v){if(this.headerContentNode)return this.header.getCellNode(this.headerContentNode,v)},styleRow:function(v,b){var D=void 0==b.style.cssText?b.getAttribute("style"):b.style.cssText;
b._style=D;this.styleRowNode(v,b)},styleRowNode:function(v,b){b&&this.doStyleRowNode(v,b)},doStyleRowNode:function(v,b){this.grid.styleRowNode(v,b)},updateRow:function(v){var b=this.getRowNode(v);b&&(b.style.height="",this.buildRow(v,b));return b},updateRowStyles:function(v){this.styleRowNode(v,this.getRowNode(v))},lastTop:0,firstScroll:0,_nativeScroll:!1,doscroll:function(v){if(13<=a("ff")||a("chrome"))this._nativeScroll=!0;v=this.grid.isLeftToRight();if(2>this.firstScroll){if(!v&&1==this.firstScroll||
v&&0===this.firstScroll){var b=m.marginBox(this.headerNodeContainer);a("ie")?this.headerNodeContainer.style.width=b.w+this.getScrollbarWidth()+"px":a("mozilla")&&(this.headerNodeContainer.style.width=b.w-this.getScrollbarWidth()+"px",this.scrollboxNode.scrollLeft=v?this.scrollboxNode.clientWidth-this.scrollboxNode.scrollWidth:this.scrollboxNode.scrollWidth-this.scrollboxNode.clientWidth)}this.firstScroll++}this.headerNode.scrollLeft=this.scrollboxNode.scrollLeft;v=this.scrollboxNode.scrollTop;v!==
this.lastTop&&this.grid.scrollTo(v);this._nativeScroll=!1},setScrollTop:function(v){this.lastTop=v;this._nativeScroll||(this.scrollboxNode.scrollTop=v);return this.scrollboxNode.scrollTop},doContentEvent:function(v){if(this.content.decorateEvent(v))this.grid.onContentEvent(v)},doHeaderEvent:function(v){if(this.header.decorateEvent(v))this.grid.onHeaderEvent(v)},dispatchContentEvent:function(v){return this.content.dispatchEvent(v)},dispatchHeaderEvent:function(v){return this.header.dispatchEvent(v)},
setColWidth:function(v,b){this.grid.setCellWidth(v,b+"px")},update:function(){if(this.domNode){this.content.update();this.grid.update();var v=this.scrollboxNode.scrollLeft;this.scrollboxNode.scrollLeft=v;this.headerNode.scrollLeft=v}}});var L=G("dojox.grid._GridAvatar",C,{construct:function(){var v=q.doc,b=v.createElement("table");b.cellPadding=b.cellSpacing="0";b.className="dojoxGridDndAvatar";b.style.position="absolute";b.style.zIndex=1999;b.style.margin="0px";var D=v.createElement("tbody"),h=v.createElement("tr"),
B=v.createElement("td"),H=v.createElement("td");h.className="dojoxGridDndAvatarItem";H.className="dojoxGridDndAvatarItemImage";H.style.width="16px";var T=this.manager.source;if(T.creator)T=T._normalizedCreator(T.getItem(this.manager.nodes[0].id).data,"avatar").node;else if(T=this.manager.nodes[0].cloneNode(!0),"tr"==T.tagName.toLowerCase()){var N=v.createElement("table");var p=v.createElement("tbody");p.appendChild(T);N.appendChild(p);T=N}else"th"==T.tagName.toLowerCase()&&(N=v.createElement("table"),
p=v.createElement("tbody"),v=v.createElement("tr"),N.cellPadding=N.cellSpacing="0",v.appendChild(T),p.appendChild(v),N.appendChild(p),T=N);T.id="";B.appendChild(T);h.appendChild(H);h.appendChild(B);m.style(h,"opacity",.9);D.appendChild(h);b.appendChild(D);this.node=b;b=A.manager();this.oldOffsetY=b.OFFSET_Y;b.OFFSET_Y=1},destroy:function(){A.manager().OFFSET_Y=this.oldOffsetY;this.inherited(arguments)}}),y=A.manager().makeAvatar;A.manager().makeAvatar=function(){return void 0===this.source.viewIndex||
m.hasClass(q.body(),"dijit_a11y")?y.call(A.manager()):new L(this)};return e})},"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(Q,I,J,G,u,d,c){var a=I.getObject("dojox.html.metrics",!0),w=I.getObject("dojox");a.getFontMeasurements=function(){var n={"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(J("ie")){var g=
d.doc.documentElement.style.fontSize||"";g||(d.doc.documentElement.style.fontSize="100%")}var m=d.doc.createElement("div"),l=m.style;l.position="absolute";l.left="-100px";l.top="0";l.width="30px";l.height="1000em";l.borderWidth="0";l.margin="0";l.padding="0";l.outline="0";l.lineHeight="1";l.overflow="hidden";d.body().appendChild(m);for(var C in n)l.fontSize=C,n[C]=16*Math.round(12*m.offsetHeight/16)/12/1E3;J("ie")&&(d.doc.documentElement.style.fontSize=g);d.body().removeChild(m);m=null;return n};
var q=null;a.getCachedFontMeasurements=function(n){if(n||!q)q=a.getFontMeasurements();return q};var e=null,k={};a.getTextBox=function(n,g,m){if(e)var l=e;else{l=e=d.doc.createElement("div");l.style.whiteSpace="nowrap";var C=d.doc.createElement("div");C.appendChild(l);var A=C.style;A.overflow="scroll";A.position="absolute";A.left="0px";A.top="-10000px";A.width="1px";A.height="1px";A.visibility="hidden";A.borderWidth="0";A.margin="0";A.padding="0";A.outline="0";d.body().appendChild(C)}l.className="";
A=l.style;A.borderWidth="0";A.margin="0";A.padding="0";A.outline="0";if(1<arguments.length&&g)for(var L in g)L in k||(A[L]=g[L]);2<arguments.length&&m&&(l.className=m);l.innerHTML=n;A=c.position(l);A.w=l.parentNode.scrollWidth;return A};var z=16,f=16;a.getScrollbar=function(){return{w:z,h:f}};a._fontResizeNode=null;a.initOnFontResize=function(n){var g=a._fontResizeNode=d.doc.createElement("iframe");n=g.style;n.position="absolute";n.width="5em";n.height="10em";n.top="-10000px";n.display="none";J("ie")?
g.onreadystatechange=function(){"complete"==g.contentWindow.document.readyState&&(g.onresize=g.contentWindow.parent[w._scopeName].html.metrics._fontresize)}:g.onload=function(){g.contentWindow.onresize=g.contentWindow.parent[w._scopeName].html.metrics._fontresize};g.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'");d.body().appendChild(g);a.initOnFontResize=
function(){}};a.onFontResize=function(){};a._fontresize=function(){a.onFontResize()};u.addOnUnload(function(){var n=a._fontResizeNode;n&&(J("ie")&&n.onresize?n.onresize=null:n.contentWindow&&n.contentWindow.onresize&&(n.contentWindow.onresize=null),a._fontResizeNode=null)});G(function(){try{var n=d.doc.createElement("div");n.style.cssText="top:0;left:0;width:100px;height:100px;overflow:scroll;position:absolute;visibility:hidden;";d.body().appendChild(n);z=n.offsetWidth-n.clientWidth;f=n.offsetHeight-
n.clientHeight;d.body().removeChild(n);delete n}catch(g){}"fontSizeWatch"in Q.config&&Q.config.fontSizeWatch&&a.initOnFontResize()});return a})},"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(Q,I,J,G,u,d,c,a,w,q,e,k){var z=Q.grid,f=function(y){return 0<=y.rowIndex?y.rowIndex:I.indexOf(y.parentNode.childNodes,
y)},n=function(y,v){return y&&((y.rows||0)[v]||y.childNodes[v])},g=function(y){for(;y&&"TABLE"!=y.tagName;y=y.parentNode);return y},m=function(y){var v=y.toUpperCase();return function(b){return b.tagName!=v}},l=q.rowIndexTag,C=q.gridViewTag,A=z._Builder=J.extend(function(y){y&&(this.view=y,this.grid=y.grid)},{view:null,_table:'\x3ctable class\x3d"dojoxGridRowTable" border\x3d"0" cellspacing\x3d"0" cellpadding\x3d"0" role\x3d"presentation"',getTableArray:function(){var y=[this._table];this.view.viewWidth&&
y.push([' style\x3d"width:',this.view.viewWidth,';"'].join(""));y.push("\x3e");return y},generateCellMarkup:function(y,v,b,D){var h=[];if(D){var B=y.index!=y.grid.getSortIndex()?"":0<y.grid.sortInfo?'aria-sort\x3d"ascending"':'aria-sort\x3d"descending"';y.id||(y.id=this.grid.id+"Hdr"+y.index);B=['\x3cth tabIndex\x3d"-1" aria-readonly\x3d"true" role\x3d"columnheader"',B,' id\x3d"',y.id,'"']}else B=['\x3ctd tabIndex\x3d"-1" role\x3d"gridcell"',this.grid.editable&&!y.editable?'aria-readonly\x3d"true"':
""];y.colSpan&&B.push(' colspan\x3d"',y.colSpan,'"');y.rowSpan&&B.push(' rowspan\x3d"',y.rowSpan,'"');B.push(' class\x3d"dojoxGridCell ');y.classes&&B.push(y.classes," ");b&&B.push(b," ");h.push(B.join(""));h.push("");B=['" idx\x3d"',y.index,'" style\x3d"'];v&&";"!=v[v.length-1]&&(v+=";");B.push(y.styles,v||"",y.hidden?"display:none;":"");y.unitWidth&&B.push("width:",y.unitWidth,";");h.push(B.join(""));h.push("");B=['"'];y.attrs&&B.push(" ",y.attrs);B.push("\x3e");h.push(B.join(""));h.push("");h.push(D?
"\x3c/th\x3e":"\x3c/td\x3e");return h},isCellNode:function(y){return!(!y||y==G.doc||!e.attr(y,"idx"))},getCellNodeIndex:function(y){return y?Number(e.attr(y,"idx")):-1},getCellNode:function(y,v){for(var b=0,D;(D=n(y.firstChild,b))&&D.cells;b++)for(var h=0,B;B=D.cells[h];h++)if(this.getCellNodeIndex(B)==v)return B;return null},findCellTarget:function(y,v){for(;y&&(!this.isCellNode(y)||y.offsetParent&&C in y.offsetParent.parentNode&&y.offsetParent.parentNode[C]!=this.view.id)&&y!=v;)y=y.parentNode;
return y!=v?y:null},baseDecorateEvent:function(y){y.dispatch="do"+y.type;y.grid=this.grid;y.sourceView=this.view;y.cellNode=this.findCellTarget(y.target,y.rowNode);y.cellIndex=this.getCellNodeIndex(y.cellNode);y.cell=0<=y.cellIndex?this.grid.getCell(y.cellIndex):null},findTarget:function(y,v){for(;y&&y!=this.domNode&&(!(v in y)||C in y&&y[C]!=this.view.id);)y=y.parentNode;return y!=this.domNode?y:null},findRowTarget:function(y){return this.findTarget(y,l)},isIntraNodeEvent:function(y){try{return y.cellNode&&
y.relatedTarget&&e.isDescendant(y.relatedTarget,y.cellNode)}catch(v){return!1}},isIntraRowEvent:function(y){try{var v=y.relatedTarget&&this.findRowTarget(y.relatedTarget);return!v&&-1==y.rowIndex||v&&y.rowIndex==v.gridRowIndex}catch(b){return!1}},dispatchEvent:function(y){return y.dispatch in this?this[y.dispatch](y):!1},domouseover:function(y){y.cellNode&&y.cellNode!=this.lastOverCellNode&&(this.lastOverCellNode=y.cellNode,this.grid.onMouseOver(y));this.grid.onMouseOverRow(y)},domouseout:function(y){if(y.cellNode&&
y.cellNode==this.lastOverCellNode&&!this.isIntraNodeEvent(y,this.lastOverCellNode)&&(this.lastOverCellNode=null,this.grid.onMouseOut(y),!this.isIntraRowEvent(y)))this.grid.onMouseOutRow(y)},domousedown:function(y){if(y.cellNode)this.grid.onMouseDown(y);this.grid.onMouseDownRow(y)},_getTextDirStyle:function(y,v,b){return""}});Q=z._ContentBuilder=J.extend(function(y){A.call(this,y)},A.prototype,{update:function(){this.prepareHtml()},prepareHtml:function(){for(var y=this.grid.get,v=this.view.structure.cells,
b=0,D;D=v[b];b++)for(var h=0,B;B=D[h];h++)B.get=B.get||void 0==B.value&&y,B.markup=this.generateCellMarkup(B,B.cellStyles,B.cellClasses,!1),!this.grid.editable&&B.editable&&(this.grid.editable=!0)},generateHtml:function(y,v){y=this.getTableArray();var b=this.view.structure.cells,D=this.grid.getItem(v);q.fire(this.view,"onBeforeRow",[v,b]);for(var h=0,B;B=b[h];h++)if(!B.hidden&&!B.header){y.push(B.invisible?'\x3ctr class\x3d"dojoxGridInvisible"\x3e':"\x3ctr\x3e");for(var H=0,T,N,p;T=B[H];H++){N=T.markup;
var E=T.customClasses=[];p=T.customStyles=[];N[5]=T.format(v,D);N[1]=E.join(" ");N[3]=p.join(";");(E=T.textDir||this.grid.textDir)&&(N[3]+=this._getTextDirStyle(E,T,v));y.push.apply(y,N)}y.push("\x3c/tr\x3e")}y.push("\x3c/table\x3e");return y.join("")},decorateEvent:function(y){y.rowNode=this.findRowTarget(y.target);if(!y.rowNode)return!1;y.rowIndex=y.rowNode[l];this.baseDecorateEvent(y);y.cell=this.grid.getCell(y.cellIndex);return!0}});var L=z._HeaderBuilder=J.extend(function(y){this.moveable=null;
A.call(this,y)},A.prototype,{_skipBogusClicks:!1,overResizeWidth:4,minColWidth:1,update:function(){this.tableMap?this.tableMap.mapRows(this.view.structure.cells):this.tableMap=new z._TableMap(this.view.structure.cells)},generateHtml:function(y,v){var b,D=this.getTableArray(),h=this.view.structure.cells;q.fire(this.view,"onBeforeRow",[-1,h]);for(var B=0,H;H=h[B];B++)if(!H.hidden){D.push(H.invisible?'\x3ctr class\x3d"dojoxGridInvisible"\x3e':"\x3ctr\x3e");for(var T=0,N,p;N=H[T];T++)N.customClasses=
[],N.customStyles=[],this.view.simpleStructure&&(N.draggable&&(N.headerClasses?-1==N.headerClasses.indexOf("dojoDndItem")&&(N.headerClasses+=" dojoDndItem"):N.headerClasses="dojoDndItem"),N.attrs?-1==N.attrs.indexOf("dndType\x3d'gridColumn_")&&(N.attrs+=" dndType\x3d'gridColumn_"+this.grid.id+"'"):N.attrs="dndType\x3d'gridColumn_"+this.grid.id+"'"),p=this.generateCellMarkup(N,N.headerStyles,N.headerClasses,!0),p[5]=void 0!=v?v:y(N),p[3]=N.customStyles.join(";"),(b=N.textDir||this.grid.textDir)&&(p[3]+=
this._getTextDirStyle(b,N,v)),p[1]=N.customClasses.join(" "),D.push(p.join(""));D.push("\x3c/tr\x3e")}D.push("\x3c/table\x3e");return D.join("")},getCellX:function(y){var v=m("th");for(var b=y.target;b&&v(b);b=b.parentNode);(v=b)?(v=k.position(v),y=y.clientX-v.x):y=y.layerX;return y},decorateEvent:function(y){this.baseDecorateEvent(y);y.rowIndex=-1;y.cellX=this.getCellX(y);return!0},prepareResize:function(y,v){do{var b=y.cellIndex;y.cellNode=b?y.cellNode.parentNode.cells[b+v]:null;y.cellIndex=y.cellNode?
this.getCellNodeIndex(y.cellNode):-1}while(y.cellNode&&"none"==y.cellNode.style.display);return!!y.cellNode},canResize:function(y){if(!y.cellNode||1<y.cellNode.colSpan)return!1;y=this.grid.getCell(y.cellIndex);return!y.noresize&&y.canResize()},overLeftResizeArea:function(y){if(e.hasClass(G.body(),"dojoDndMove"))return!1;if(d("ie")){var v=y.target;if(e.hasClass(v,"dojoxGridArrowButtonNode")||e.hasClass(v,"dojoxGridArrowButtonChar")||e.hasClass(v,"dojoxGridColCaption"))return!1}return this.grid.isLeftToRight()?
0<y.cellIndex&&0<y.cellX&&y.cellX<this.overResizeWidth&&this.prepareResize(y,-1):y.cellNode&&0<y.cellX&&y.cellX<this.overResizeWidth},overRightResizeArea:function(y){if(e.hasClass(G.body(),"dojoDndMove"))return!1;if(d("ie")){var v=y.target;if(e.hasClass(v,"dojoxGridArrowButtonNode")||e.hasClass(v,"dojoxGridArrowButtonChar")||e.hasClass(v,"dojoxGridColCaption"))return!1}return this.grid.isLeftToRight()?y.cellNode&&y.cellX>=y.cellNode.offsetWidth-this.overResizeWidth:0<y.cellIndex&&y.cellX>=y.cellNode.offsetWidth-
this.overResizeWidth&&this.prepareResize(y,-1)},domousemove:function(y){if(!this.moveable){var v=this.overRightResizeArea(y)?"dojoxGridColResize":this.overLeftResizeArea(y)?"dojoxGridColResize":"";v&&!this.canResize(y)&&(v="dojoxGridColNoResize");e.toggleClass(y.sourceView.headerNode,"dojoxGridColNoResize","dojoxGridColNoResize"==v);e.toggleClass(y.sourceView.headerNode,"dojoxGridColResize","dojoxGridColResize"==v);v&&u.stop(y)}},domousedown:function(y){this.moveable||((this.overRightResizeArea(y)||
this.overLeftResizeArea(y))&&this.canResize(y)?this.beginColumnResize(y):(this.grid.onMouseDown(y),this.grid.onMouseOverRow(y)))},doclick:function(y){return this._skipBogusClicks?(u.stop(y),!0):!1},colResizeSetup:function(y,v){var b=e.contentBox(y.sourceView.headerNode);if(v){this.lineDiv=document.createElement("div");v=e.position(y.sourceView.headerNode,!0);var D=e.contentBox(y.sourceView.domNode),h=y.pageX;!this.grid.isLeftToRight()&&8>d("ie")&&(h-=w.getScrollbar().w);e.style(this.lineDiv,{top:v.y+
"px",left:h+"px",height:D.h+b.h+"px"});e.addClass(this.lineDiv,"dojoxGridResizeColLine");this.lineDiv._origLeft=h;G.body().appendChild(this.lineDiv)}v=[];D=this.tableMap.findOverlappingNodes(y.cellNode);h=0;for(var B;B=D[h];h++)v.push({node:B,index:this.getCellNodeIndex(B),width:B.offsetWidth});D=y.sourceView;B=this.grid.isLeftToRight()?1:-1;var H=y.grid.views.views;h=[];for(var T=D.idx+B,N;N=H[T];T+=B)h.push({node:N.headerNode,left:window.parseInt(N.headerNode.style.left)});B=D.headerContentNode.firstChild;
return{scrollLeft:y.sourceView.headerNode.scrollLeft,view:D,node:y.cellNode,index:y.cellIndex,w:e.contentBox(y.cellNode).w,vw:b.w,table:B,tw:e.contentBox(B).w,spanners:v,followers:h}},beginColumnResize:function(y){this.moverDiv=document.createElement("div");e.style(this.moverDiv,{position:"absolute",left:0});G.body().appendChild(this.moverDiv);e.addClass(this.grid.domNode,"dojoxGridColumnResizing");var v=this.moveable=new a(this.moverDiv),b=this.colResizeSetup(y,!0);v.onMove=J.hitch(this,"doResizeColumn",
b);c.connect(v,"onMoveStop",J.hitch(this,function(){this.endResizeColumn(b);b.node.releaseCapture&&b.node.releaseCapture();this.moveable.destroy();delete this.moveable;this.moveable=null;e.removeClass(this.grid.domNode,"dojoxGridColumnResizing")}));y.cellNode.setCapture&&y.cellNode.setCapture();v.onMouseDown(y)},doResizeColumn:function(y,v,b){var D=b.l;D={deltaX:D,w:y.w+(this.grid.isLeftToRight()?D:-D),vw:y.vw+D,tw:y.tw+D};this.dragRecord={inDrag:y,mover:v,leftTop:b};D.w>=this.minColWidth&&(v?e.style(this.lineDiv,
"left",this.lineDiv._origLeft+D.deltaX+"px"):this.doResizeNow(y,D))},endResizeColumn:function(y){if(this.dragRecord){var v=this.dragRecord.leftTop;v=this.grid.isLeftToRight()?v.l:-v.l;v+=Math.max(y.w+v,this.minColWidth)-(y.w+v);d("webkit")&&y.spanners.length&&(v+=e._getPadBorderExtents(y.spanners[0].node).w);this.doResizeNow(y,{deltaX:v,w:y.w+v,vw:y.vw+v,tw:y.tw+v});delete this.dragRecord}e.destroy(this.lineDiv);e.destroy(this.moverDiv);e.destroy(this.moverDiv);delete this.moverDiv;this._skipBogusClicks=
!0;y.view.update();this._skipBogusClicks=!1;this.grid.onResizeColumn(y.index)},doResizeNow:function(y,v){y.view.convertColPctToFixed();if(y.view.flexCells&&!y.view.testFlexCells()){var b=g(y.node);b&&(b.style.width="")}var D;for(b=0;D=y.spanners[b];b++){var h=D.width+v.deltaX;0<h&&(D.node.style.width=h+"px",y.view.setColWidth(D.index,h))}if(this.grid.isLeftToRight()||!d("ie"))for(b=0;D=y.followers[b];b++)h=D.left+v.deltaX,D.node.style.left=h+"px";y.node.style.width=v.w+"px";y.view.setColWidth(y.index,
v.w);y.view.headerNode.style.width=v.vw+"px";y.view.setColumnsWidth(v.tw);this.grid.isLeftToRight()||(y.view.headerNode.scrollLeft=y.scrollLeft+v.deltaX)}});z._TableMap=J.extend(function(y){this.mapRows(y)},{map:null,mapRows:function(y){if(y.length){this.map=[];for(var v,b=0;v=y[b];b++)this.map[b]=[];for(b=0;v=y[b];b++)for(var D=0,h=0,B,H;B=v[D];D++){for(;this.map[b][h];)h++;this.map[b][h]={c:D,r:b};H=B.rowSpan||1;B=B.colSpan||1;for(var T=0;T<H;T++)for(var N=0;N<B;N++)this.map[b+T][h+N]=this.map[b][h];
h+=B}}},dumpMap:function(){for(var y=0,v;v=this.map[y];y++)for(var b=0;v[b];b++);},getMapCoords:function(y,v){for(var b=0,D;D=this.map[b];b++)for(var h=0,B;B=D[h];h++)if(B.c==v&&B.r==y)return{j:b,i:h};return{j:-1,i:-1}},getNode:function(y,v,b){return(y=y&&y.rows[v])&&y.cells[b]},_findOverlappingNodes:function(y,v,b){var D=[];v=this.getMapCoords(v,b);b=0;for(var h;h=this.map[b];b++)b!=v.j&&(h=(h=h[v.i])?this.getNode(y,h.r,h.c):null)&&D.push(h);return D},findOverlappingNodes:function(y){return this._findOverlappingNodes(g(y),
f(y.parentNode),0<=y.cellIndex?y.cellIndex:I.indexOf(y.parentNode.cells,y))}});return{_Builder:A,_HeaderBuilder:L,_ContentBuilder:Q}})},"dojox/grid/_ViewManager":function(){define(["dojo/_base/declare","dojo/_base/sniff","dojo/dom-class"],function(Q,I,J){return Q("dojox.grid._ViewManager",null,{constructor:function(G){this.grid=G},defaultWidth:200,views:[],resize:function(){this.onEach("resize")},render:function(){this.onEach("render")},addView:function(G){G.idx=this.views.length;this.views.push(G)},
destroyViews:function(){for(var G=0,u;u=this.views[G];G++)u.destroy();this.views=[]},getContentNodes:function(){for(var G=[],u=0,d;d=this.views[u];u++)G.push(d.contentNode);return G},forEach:function(G){for(var u=0,d;d=this.views[u];u++)G(d,u)},onEach:function(G,u){u=u||[];for(var d=0,c;c=this.views[d];d++)G in c&&c[G].apply(c,u)},normalizeHeaderNodeHeight:function(){for(var G=[],u=0,d;d=this.views[u];u++)d.headerContentNode.firstChild&&G.push(d.headerContentNode);this.normalizeRowNodeHeights(G)},
normalizeRowNodeHeights:function(G){var u=0,d=[];if(this.grid.rowHeight)u=this.grid.rowHeight;else{if(1>=G.length)return;for(var c=0,a;a=G[c];c++)J.contains(a,"dojoxGridNonNormalizedCell")||(d[c]=a.firstChild.offsetHeight,u=Math.max(u,d[c]));u=0<=u?u:0;(I("mozilla")||8<I("ie"))&&u&&u++}for(c=0;a=G[c];c++)d[c]!=u&&(a.firstChild.style.height=u+"px")},resetHeaderNodeHeight:function(){for(var G=0,u;u=this.views[G];G++)if(u=u.headerContentNode.firstChild)u.style.height=""},renormalizeRow:function(G){for(var u=
[],d=0,c,a;(c=this.views[d])&&(a=c.getRowNode(G));d++)a.firstChild.style.height="",u.push(a);this.normalizeRowNodeHeights(u)},getViewWidth:function(G){return this.views[G].getWidth()||this.defaultWidth},measureHeader:function(){this.resetHeaderNodeHeight();this.forEach(function(u){u.headerContentNode.style.height=""});var G=0;this.forEach(function(u){G=Math.max(u.headerNode.offsetHeight,G)});return G},measureContent:function(){var G=0;this.forEach(function(u){G=Math.max(u.domNode.offsetHeight,G)});
return G},findClient:function(G){G=this.grid.elasticView||-1;if(0>G)for(var u=1,d;d=this.views[u];u++)if(d.viewWidth){for(u=1;d=this.views[u];u++)if(!d.viewWidth){G=u;break}break}0>G&&(G=Math.floor(this.views.length/2));return G},arrange:function(G,u){var d,c,a=this.views.length,w=this,q=0>=u?a:this.findClient(),e=function(f,n){var g=f.domNode.style,m=f.headerNode.style;w.grid.isLeftToRight()?(g.left=n+"px",m.left=n+"px"):(g.right=n+"px",4>I("ff")?m.right=n+f.getScrollbarWidth()+"px":m.right=n+"px",
I("webkit")||"auto"==m.width||(m.width=parseInt(m.width,10)-f.getScrollbarWidth()+"px"));g.top="0px";m.top=0};for(d=0;(c=this.views[d])&&d<q;d++){var k=this.getViewWidth(d);c.setSize(k,0);e(c,G);k=c.headerContentNode&&c.headerContentNode.firstChild?c.getColumnsWidth()+c.getScrollbarWidth():c.domNode.offsetWidth;G+=k}d++;for(var z=a-1;(c=this.views[z])&&d<=z;z--)k=this.getViewWidth(z),c.setSize(k,0),k=c.domNode.offsetWidth,u-=k,e(c,u);q<a&&(c=this.views[q],k=Math.max(1,u-G),c.setSize(k+"px",0),e(c,
G));return G},renderRow:function(G,u,d){for(var c=[],a=0,w,q;(w=this.views[a])&&(q=u[a]);a++)w=w.renderRow(G),q.appendChild(w),c.push(w);d||this.normalizeRowNodeHeights(c)},rowRemoved:function(G){this.onEach("rowRemoved",[G])},updateRow:function(G,u){for(var d=0,c;c=this.views[d];d++)c.updateRow(G);u||this.renormalizeRow(G)},updateRowStyles:function(G){this.onEach("updateRowStyles",[G])},setScrollTop:function(G){for(var u=G,d=0,c;c=this.views[d];d++)u=c.setScrollTop(G),I("ie")&&c.headerNode&&c.scrollboxNode&&
(c.headerNode.scrollLeft=c.scrollboxNode.scrollLeft);return u},getFirstScrollingView:function(){for(var G=0,u;u=this.views[G];G++)if(u.hasHScrollbar()||u.hasVScrollbar())return u;return null}})})},"dojox/grid/_RowManager":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/dom-class"],function(Q,I,J){return Q("dojox.grid._RowManager",null,{constructor:function(G){this.grid=G},linesToEms:2,overRow:-2,prepareStylingRow:function(G,u){return{index:G,node:u,odd:!!(G&1),selected:!!this.grid.selection.isSelected(G),
over:this.isOver(G),customStyles:"",customClasses:"dojoxGridRow"}},styleRowNode:function(G,u){G=this.prepareStylingRow(G,u);this.grid.onStyleRow(G);this.applyStyles(G)},applyStyles:function(G){G.node.className=G.customClasses;var u=G.node.style.height,d=G.node,c=G.customStyles+";"+(G.node._style||"");void 0==d.style.cssText?d.setAttribute("style",c):d.style.cssText=c;G.node.style.height=u},updateStyles:function(G){this.grid.updateRowStyles(G)},setOverRow:function(G){var u=this.overRow;this.overRow=
G;u!=this.overRow&&(I.isString(u)||0<=u)&&this.updateStyles(u);this.updateStyles(this.overRow)},isOver:function(G){return this.overRow==G&&!J.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(Q,I,J,G,u,d,c,a,w){return J("dojox.grid._FocusManager",null,{constructor:function(q){this.grid=
q;this.cell=null;this.rowIndex=-1;this._connects=[];this._headerConnects=[];this.headerMenu=this.grid.headerMenu;this._connects.push(G.connect(this.grid.domNode,"onfocus",this,"doFocus"));this._connects.push(G.connect(this.grid.domNode,"onblur",this,"doBlur"));this._connects.push(G.connect(this.grid.domNode,"mousedown",this,"_mouseDown"));this._connects.push(G.connect(this.grid.domNode,"mouseup",this,"_mouseUp"));this._connects.push(G.connect(this.grid.domNode,"oncontextmenu",this,"doContextMenu"));
this._connects.push(G.connect(this.grid.lastFocusNode,"onfocus",this,"doLastNodeFocus"));this._connects.push(G.connect(this.grid.lastFocusNode,"onblur",this,"doLastNodeBlur"));this._connects.push(G.connect(this.grid,"_onFetchComplete",this,"_delayedCellFocus"));this._connects.push(G.connect(this.grid,"postrender",this,"_delayedHeaderFocus"))},destroy:function(){Q.forEach(this._connects,G.disconnect);Q.forEach(this._headerConnects,G.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(q,e){return this.cell==q&&this.rowIndex==e},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?Q.indexOf(this._findHeaderCells(),this._colHeadNode):-1},_focusifyCellNode:function(q){var e=this.cell&&this.cell.getNode(this.rowIndex);if(e&&(w.toggleClass(e,this.focusClass,q),q)){q=this.scrollIntoView();try{if(d("webkit")||!this.grid.edit.isEditing())a.fire(e,"focus"),q&&(this.cell.view.scrollboxNode.scrollLeft=
q)}catch(k){}}},_delayedCellFocus:function(){if(!this.isNavHeader()&&this.grid.focused){var q=this.cell&&this.cell.getNode(this.rowIndex);if(q)try{this.grid.edit.isEditing()||(w.toggleClass(q,this.focusClass,!0),this._colHeadNode&&this.blurHeader(),a.fire(q,"focus"))}catch(e){}}},_delayedHeaderFocus:function(){this.isNavHeader()&&this.focusHeader()},_initColumnHeaders:function(){Q.forEach(this._headerConnects,G.disconnect);this._headerConnects=[];for(var q=this._findHeaderCells(),e=0;e<q.length;e++)this._headerConnects.push(G.connect(q[e],
"onfocus",this,"doColHeaderFocus")),this._headerConnects.push(G.connect(q[e],"onblur",this,"doColHeaderBlur"))},_findHeaderCells:function(){for(var q=c("th",this.grid.viewsHeaderNode),e=[],k=0;k<q.length;k++){var z=q[k],f=w.hasAttr(z,"tabIndex"),n=w.attr(z,"tabIndex");f&&0>n&&e.push(z)}return e},_setActiveColHeader:function(q,e,k){this.grid.domNode.setAttribute("aria-activedescendant",q.id);null!=k&&0<=k&&k!=e&&w.toggleClass(this._findHeaderCells()[k],this.focusClass,!1);w.toggleClass(q,this.focusClass,
!0);this._colHeadNode=q;this._colHeadFocusIdx=e;this._scrollHeader(this._colHeadFocusIdx)},scrollIntoView:function(){var q=this.cell?this._scrollInfo(this.cell):null;if(!q||!q.s)return null;var e=this.grid.scroller.findScrollTop(this.rowIndex);q.n&&q.sr&&(q.n.offsetLeft+q.n.offsetWidth>q.sr.l+q.sr.w?q.s.scrollLeft=q.n.offsetLeft+q.n.offsetWidth-q.sr.w:q.n.offsetLeft<q.sr.l&&(q.s.scrollLeft=q.n.offsetLeft));q.r&&q.sr&&(e+q.r.offsetHeight>q.sr.t+q.sr.h?this.grid.setScrollTop(e+q.r.offsetHeight-q.sr.h):
e<q.sr.t&&this.grid.setScrollTop(e));return q.s.scrollLeft},_scrollInfo:function(q,e){if(q){var k=q.view.scrollboxNode,z={w:k.clientWidth,l:k.scrollLeft,t:k.scrollTop,h:k.clientHeight},f=q.view.getRowNode(this.rowIndex);return{c:q,s:k,sr:z,n:e?e:q.getNode(this.rowIndex),r:f}}return null},_scrollHeader:function(q){var e=null;if(this._colHeadNode){var k=this.grid.getCell(q);if(!k)return;e=this._scrollInfo(k,k.getNode(0))}e&&e.s&&e.sr&&e.n&&(e.n.offsetLeft+e.n.offsetWidth>e.sr.l+e.sr.w?e.s.scrollLeft=
e.n.offsetLeft+e.n.offsetWidth-e.sr.w:e.n.offsetLeft<e.sr.l?e.s.scrollLeft=e.n.offsetLeft:7>=d("ie")&&k&&k.view.headerNode&&(k.view.headerNode.scrollLeft=e.s.scrollLeft))},_isHeaderHidden:function(){var q=this.focusView;if(!q)for(var e=0,k;k=this.grid.views.views[e];e++)if(k.headerNode){q=k;break}return q&&"none"==w.getComputedStyle(q.headerNode).display},colSizeAdjust:function(q,e,k){var z=this._findHeaderCells(),f=this.focusView;if(!f||!f.header.tableMap.map)for(var n=0,g;g=this.grid.views.views[n];n++)if(g.header.tableMap.map){f=
g;break}n=z[e];!f||e==z.length-1&&0===e||(f.content.baseDecorateEvent(q),q.cellNode=n,q.cellIndex=f.content.getCellNodeIndex(q.cellNode),q.cell=0<=q.cellIndex?this.grid.getCell(q.cellIndex):null,f.header.canResize(q)&&(e={l:k},q=f.header.colResizeSetup(q,!1),f.header.doResizeColumn(q,null,e),f.update()))},styleRow:function(q){},setFocusIndex:function(q,e){this.setFocusCell(this.grid.getCell(e),q)},setFocusCell:function(q,e){q&&!this.isFocusCell(q,e)&&(this.tabbingOut=!1,this._colHeadNode&&this.blurHeader(),
this._colHeadNode=this._colHeadFocusIdx=null,this.focusGridView(),this._focusifyCellNode(!1),this.cell=q,this.rowIndex=e,this._focusifyCellNode(!0));if(d("opera"))setTimeout(I.hitch(this.grid,"onCellFocus",this.cell,this.rowIndex),1);else this.grid.onCellFocus(this.cell,this.rowIndex)},next:function(){if(this.cell){var q=this.rowIndex,e=this.cell.index+1,k=this.grid.layout.cellCount-1,z=this.grid.rowCount-1;e>k&&(e=0,q++);q>z&&(e=k,q=z);if(this.grid.edit.isEditing()&&(k=this.grid.getCell(e),!this.isLastFocusCell()&&
(!k.editable||this.grid.canEdit&&!this.grid.canEdit(k,q)))){this.cell=k;this.rowIndex=q;this.next();return}this.setFocusIndex(q,e)}},previous:function(){if(this.cell){var q=this.rowIndex||0,e=(this.cell.index||0)-1;0>e&&(e=this.grid.layout.cellCount-1,q--);0>q&&(e=q=0);if(this.grid.edit.isEditing()){var k=this.grid.getCell(e);if(!this.isFirstFocusCell()&&!k.editable){this.cell=k;this.rowIndex=q;this.previous();return}}this.setFocusIndex(q,e)}},move:function(q,e){var k=0>e?-1:1;if(this.isNavHeader()){q=
this._findHeaderCells();var z=currentIdx=Q.indexOf(q,this._colHeadNode);for(currentIdx+=e;0<=currentIdx&&currentIdx<q.length&&"none"==q[currentIdx].style.display;)currentIdx+=k;0<=currentIdx&&currentIdx<q.length&&this._setActiveColHeader(q[currentIdx],currentIdx,z)}else if(this.cell){var f=this.grid.scroller;z=this.rowIndex;var n=this.grid.rowCount-1,g=Math.min(n,Math.max(0,z+q));q&&(0<q?g>f.getLastPageRow(f.page)&&this.grid.setScrollTop(this.grid.scrollTop+f.findScrollTop(g)-f.findScrollTop(z)):
0>q&&g<=f.getPageRow(f.page)&&this.grid.setScrollTop(this.grid.scrollTop-f.findScrollTop(z)-f.findScrollTop(g)));f=this.grid.layout.cellCount-1;for(var m=this.cell.index,l=Math.min(f,Math.max(0,m+e)),C=this.grid.getCell(l);0<=l&&l<f&&C&&!0===C.hidden;)l+=k,C=this.grid.getCell(l);C&&!0!==C.hidden||(l=m);k=C.getNode(g);!k&&q?0<=g+q&&g+q<=n&&this.move(0<q?++q:--q,e):k&&"none"!==w.style(k,"display")||!e?(this.setFocusIndex(g,l),q&&this.grid.updateRow(z)):0<=l+e&&l+e<=f&&this.move(q,0<e?++e:--e)}},previousKey:function(q){this.grid.edit.isEditing()?
(u.stop(q),this.previous()):this.isNavHeader()||this._isHeaderHidden()?(this.tabOut(this.grid.domNode),null!=this._colHeadFocusIdx&&(w.toggleClass(this._findHeaderCells()[this._colHeadFocusIdx],this.focusClass,!1),this._colHeadFocusIdx=null),this._focusifyCellNode(!1)):(this.grid.domNode.focus(),u.stop(q))},nextKey:function(q){q.target===this.grid.domNode&&null==this._colHeadFocusIdx?(this.focusHeader(),u.stop(q)):this.isNavHeader()?(this.blurHeader(),this.findAndFocusGridCell()||this.tabOut(this.grid.lastFocusNode),
this._colHeadNode=this._colHeadFocusIdx=null):this.grid.edit.isEditing()?(u.stop(q),this.next()):this.tabOut(this.grid.lastFocusNode)},tabOut:function(q){this.tabbingOut=!0;q.focus()},focusGridView:function(){a.fire(this.focusView,"focus")},focusGrid:function(q){this.focusGridView();this._focusifyCellNode(!0)},findAndFocusGridCell:function(){var q=!0,e=0===this.grid.rowCount;this.isNoFocusCell()&&!e?(e=0,this.grid.getCell(e).hidden&&(e=this.isNavHeader()?this._colHeadFocusIdx:0),this.setFocusIndex(0,
e)):this.cell&&!e?(this.focusView&&!this.focusView.rowNodes[this.rowIndex]&&this.grid.scrollToRow(this.rowIndex),this.focusGrid()):q=!1;this._colHeadNode=this._colHeadFocusIdx=null;return q},focusHeader:function(){var q=this._findHeaderCells(),e=this._colHeadFocusIdx;this._isHeaderHidden()?this.findAndFocusGridCell():this._colHeadFocusIdx||(this.isNoFocusCell()?this._colHeadFocusIdx=0:this._colHeadFocusIdx=this.cell.index);for(this._colHeadNode=q[this._colHeadFocusIdx];this._colHeadNode&&0<=this._colHeadFocusIdx&&
this._colHeadFocusIdx<q.length&&"none"==this._colHeadNode.style.display;)this._colHeadFocusIdx++,this._colHeadNode=q[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,e),this._scrollHeader(this._colHeadFocusIdx),
this._focusifyCellNode(!1)):this.findAndFocusGridCell()},blurHeader:function(){w.removeClass(this._colHeadNode,this.focusClass);w.removeAttr(this.grid.domNode,"aria-activedescendant");if(this.headerMenu&&this._contextMenuBindNode==this.grid.domNode){var q=this.grid.viewsHeaderNode;this.headerMenu.unBindDomNode(this.grid.domNode);this.headerMenu.bindDomNode(q);this._contextMenuBindNode=q}},doFocus:function(q){q&&q.target!=q.currentTarget?u.stop(q):this._clickFocus||(this.tabbingOut||this.focusHeader(),
this.tabbingOut=!1,u.stop(q))},doBlur:function(q){u.stop(q)},doContextMenu:function(q){this.headerMenu||u.stop(q)},doLastNodeFocus:function(q){this.tabbingOut?this._focusifyCellNode(!1):0<this.grid.rowCount?(this.isNoFocusCell()&&this.setFocusIndex(0,0),this._focusifyCellNode(!0)):this.focusHeader();this.tabbingOut=!1;u.stop(q)},doLastNodeBlur:function(q){u.stop(q)},doColHeaderFocus:function(q){this._setActiveColHeader(q.target,w.attr(q.target,"idx"),this._colHeadFocusIdx);this._scrollHeader(this.getHeaderIndex());
u.stop(q)},doColHeaderBlur:function(q){w.toggleClass(q.target,this.focusClass,!1)},_mouseDown:function(q){this._clickFocus=dojo.some(this.grid.views.views,function(e){return e.scrollboxNode===q.target})},_mouseUp:function(q){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(Q,I,J,G,u,d){return J("dojox.grid._EditManager",null,{constructor:function(c){this.grid=c;
this.connections=u("ie")?[G.connect(document.body,"onfocus",Q.hitch(this,"_boomerangFocus"))]:[];this.connections.push(G.connect(this.grid,"onBlur",this,"apply"));this.connections.push(G.connect(this.grid,"prerender",this,"_onPreRender"))},info:{},destroy:function(){I.forEach(this.connections,G.disconnect)},cellFocus:function(c,a){this.grid.singleClickEdit||this.isEditRow(a)?this.setEditCell(c,a):this.apply();(this.isEditing()||c&&c.editable&&c.alwaysEditing)&&this._focusEditor(c,a)},rowClick:function(c){this.isEditing()&&
!this.isEditRow(c.rowIndex)&&this.apply()},styleRow:function(c){c.index==this.info.rowIndex&&(c.customClasses+=" dojoxGridRowEditing")},dispatchEvent:function(c){var a=c.cell;return(a=a&&a.editable?a:0)&&a.dispatchEvent(c.dispatch,c)},isEditing:function(){return void 0!==this.info.rowIndex},isEditCell:function(c,a){return this.info.rowIndex===c&&this.info.cell.index==a},isEditRow:function(c){return this.info.rowIndex===c},setEditCell:function(c,a){!this.isEditCell(a,c.index)&&this.grid.canEdit&&this.grid.canEdit(c,
a)&&this.start(c,a,this.isEditRow(a)||c.editable)},_focusEditor:function(c,a){d.fire(c,"focus",[a])},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(){u("ie")&&(this._catchBoomerang=(new Date).getTime()+
this._boomerangWindow)},start:function(c,a,w){this._isValidInput()&&(this.grid.beginUpdate(),this.editorApply(),this.isEditing()&&!this.isEditRow(a)&&(this.applyRowEdit(),this.grid.updateRow(a)),w?(this.info={cell:c,rowIndex:a},this.grid.doStartEdit(c,a),this.grid.updateRow(a)):this.info={},this.grid.endUpdate(),this.grid.focus.focusGrid(),this._focusEditor(c,a),this._doCatchBoomerang())},_editorDo:function(c){var a=this.info.cell;if(a&&a.editable)a[c](this.info.rowIndex)},editorApply:function(){this._editorDo("apply")},
editorCancel:function(){this._editorDo("cancel")},applyCellEdit:function(c,a,w){this.grid.canEdit(a,w)&&this.grid.doApplyCellEdit(c,w,a.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(c,a){var w=this.info.cell;!this.isEditRow(c)||a&&w.view!=a||!w.editable||w.save(w,this.info.rowIndex)},restore:function(c,a){var w=this.info.cell;this.isEditRow(a)&&w.view==c&&w.editable&&w.restore(this.info.rowIndex)},_isValidInput:function(){var c=(this.info.cell||{}).widget;if(!c||!c.isValid)return!0;c.focused=!0;return c.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(Q,I,J,G){return Q("dojox.grid.Selection",null,{constructor:function(u){this.grid=u;this.selected=[];this.setMode(u.selectionMode)},mode:"extended",selected:null,updating:0,selectedIndex:-1,rangeStartIndex:-1,setMode:function(u){this.selected.length&&this.deselectAll();this.mode="extended"!=u&&"multiple"!=u&&"single"!=u&&"none"!=
u?"extended":u},onCanSelect:function(u){return this.grid.onCanSelect(u)},onCanDeselect:function(u){return this.grid.onCanDeselect(u)},onSelected:function(u){},onDeselected:function(u){},onChanging:function(){},onChanged:function(){},isSelected:function(u){return"none"==this.mode?!1:this.selected[u]},getFirstSelected:function(){if(!this.selected.length||"none"==this.mode)return-1;for(var u=0,d=this.selected.length;u<d;u++)if(this.selected[u])return u;return-1},getNextSelected:function(u){if("none"==
this.mode)return-1;u+=1;for(var d=this.selected.length;u<d;u++)if(this.selected[u])return u;return-1},getSelected:function(){for(var u=[],d=0,c=this.selected.length;d<c;d++)this.selected[d]&&u.push(d);return u},getSelectedCount:function(){for(var u=0,d=0;d<this.selected.length;d++)this.selected[d]&&u++;return u},_beginUpdate:function(){if(0===this.updating)this.onChanging();this.updating++},_endUpdate:function(){this.updating--;if(0===this.updating)this.onChanged()},select:function(u){"none"!=this.mode&&
("multiple"!=this.mode?(this.deselectAll(u),this.addToSelection(u)):this.toggleSelect(u))},addToSelection:function(u){if("none"!=this.mode)if(J.isArray(u))I.forEach(u,this.addToSelection,this);else if(u=Number(u),this.selected[u])this.selectedIndex=u;else if(!1!==this.onCanSelect(u)){this.selectedIndex=u;var d=this.grid.getRowNode(u);d&&G.set(d,"aria-selected","true");this._beginUpdate();this.selected[u]=!0;this.onSelected(u);this._endUpdate()}},deselect:function(u){if("none"!=this.mode)if(J.isArray(u))I.forEach(u,
this.deselect,this);else if(u=Number(u),this.selectedIndex==u&&(this.selectedIndex=-1),this.selected[u]&&!1!==this.onCanDeselect(u)){var d=this.grid.getRowNode(u);d&&G.set(d,"aria-selected","false");this._beginUpdate();delete this.selected[u];this.onDeselected(u);this._endUpdate()}},setSelected:function(u,d){this[d?"addToSelection":"deselect"](u)},toggleSelect:function(u){J.isArray(u)?I.forEach(u,this.toggleSelect,this):this.setSelected(u,!this.selected[u])},_range:function(u,d,c){var a=0<=u?u:d;
u=d;a>u&&(u=a,a=d);for(d=a;d<=u;d++)c(d)},selectRange:function(u,d){this._range(u,d,J.hitch(this,"addToSelection"))},deselectRange:function(u,d){this._range(u,d,J.hitch(this,"deselect"))},insert:function(u){this.selected.splice(u,0,!1);this.selectedIndex>=u&&this.selectedIndex++},remove:function(u){this.selected.splice(u,1);this.selectedIndex>=u&&this.selectedIndex--},deselectAll:function(u){for(var d in this.selected)d!=u&&!0===this.selected[d]&&this.deselect(d)},clickSelect:function(u,d,c){if("none"!=
this.mode){this._beginUpdate();if("extended"!=this.mode)this.select(u);else{if(!c||0>this.rangeStartIndex)this.rangeStartIndex=u;d||this.deselectAll(u);c?this.selectRange(this.rangeStartIndex,u):d?this.toggleSelect(u):this.addToSelection(u)}this._endUpdate()}},clickSelectEvent:function(u){this.clickSelect(u.rowIndex,dojo.isCopyKey(u),u.shiftKey)},clear:function(){this._beginUpdate();this.deselectAll();this._endUpdate()}})})},"dojox/grid/DataSelection":function(){define(["dojo/_base/declare","./_SelectionPreserver",
"./Selection"],function(Q,I,J){return Q("dojox.grid.DataSelection",J,{constructor:function(G){G.keepSelection&&(this.preserver=new I(this))},destroy:function(){this.preserver&&this.preserver.destroy()},getFirstSelected:function(){var G=J.prototype.getFirstSelected.call(this);return-1==G?null:this.grid.getItem(G)},getNextSelected:function(G){G=this.grid.getItemIndex(G);G=J.prototype.getNextSelected.call(this,G);return-1==G?null:this.grid.getItem(G)},getSelected:function(){for(var G=[],u=0,d=this.selected.length;u<
d;u++)this.selected[u]&&G.push(this.grid.getItem(u));return G},addToSelection:function(G){if("none"!=this.mode){var u=null;u="number"==typeof G||"string"==typeof G?G:this.grid.getItemIndex(G);J.prototype.addToSelection.call(this,u)}},deselect:function(G){if("none"!=this.mode){var u=null;u="number"==typeof G||"string"==typeof G?G:this.grid.getItemIndex(G);J.prototype.deselect.call(this,u)}},deselectAll:function(G){var u=null;G||"number"==typeof G?(u="number"==typeof G||"string"==typeof G?G:this.grid.getItemIndex(G),
J.prototype.deselectAll.call(this,u)):this.inherited(arguments)}})})},"dojox/grid/_SelectionPreserver":function(){define(["dojo/_base/declare","dojo/_base/connect","dojo/_base/lang","dojo/_base/array"],function(Q,I,J,G){return Q("dojox.grid._SelectionPreserver",null,{constructor:function(u){this.selection=u;var d=this.grid=u.grid;this.reset();this._connects=[I.connect(d,"_setStore",this,"reset"),I.connect(d,"_addItem",this,"_reSelectById"),I.connect(u,"onSelected",J.hitch(this,"_selectById",!0)),
I.connect(u,"onDeselected",J.hitch(this,"_selectById",!1)),I.connect(u,"deselectAll",this,"reset")]},destroy:function(){this.reset();G.forEach(this._connects,I.disconnect);delete this._connects},reset:function(){this._selectedById={}},_reSelectById:function(u,d){u&&this.grid._hasIdentity&&(this.selection.selected[d]=this._selectedById[this.grid.store.getIdentity(u)])},_selectById:function(u,d){if("none"!=this.selection.mode&&this.grid._hasIdentity){var c=d,a=this.grid;if("number"==typeof d||"string"==
typeof d)c=(d=a._by_idx[d])&&d.item;c&&(this._selectedById[a.store.getIdentity(c)]=!!u);return c}}})})},"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(Q,I,J,G,u,d,c,a,w,q,e){Q=Q([c,a],{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(k,z,f,n,g){if(z&&"textsymbol"!==z.type){k=w.createSurface(k,f,n);if(9>G("ie")){var m=k.getEventSource();d.set(m,"position","relative");d.set(m.parentNode,"position","relative")}z=!this.legendOverride&&this._getDrawingToolShape(z,g)||q.getShapeDescriptors(z);try{var l=k.createShape(z.defaultShape).setFill(z.fill).setStroke(z.stroke)}catch(L){k.clear();
k.destroy();return}var C=l.getBoundingBox();z=C.width;g=C.height;m=-(C.x+z/2);C=-(C.y+g/2);var A=k.getDimensions();m={dx:m+A.width/2,dy:C+A.height/2};if(z>f||g>n)C=z/f>g/n,f=((C?f:n)-5)/(C?z:g),I.mixin(m,{xx:f,yy:f});l.applyTransform(m);return k}},_getDrawingToolShape:function(k,z){switch(z?z.drawingTool||null:null){case "esriFeatureEditToolArrow":z={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":z={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":z={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":z={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":z={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":z={type:"path",path:"M -10,14 L 2,-10 L 14,14 L -10,14 E"};break;case "esriFeatureEditToolRectangle":z=
{type:"path",path:"M -10,-10 L 10,-10 L 10,10 L -10,10 L -10,-10 E"};break;case "esriFeatureEditToolCircle":z={type:"circle",cx:0,cy:0,r:10};break;case "esriFeatureEditToolEllipse":z={type:"ellipse",cx:0,cy:0,rx:10,ry:5};break;case "esriFeatureEditToolFreehand":z="simplelinesymbol"===k.type||"cartographiclinesymbol"===k.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:z,fill:k.getFill(),stroke:k.getStroke()}},_repaint:function(k){k?(k.getStroke&&k.setStroke&&k.setStroke(k.getStroke()),k.getFill&&k.setFill&&k.setFill(k.getFill()),k.children&&I.isArray(k.children)&&J.forEach(k.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)}});
G("extend-esri")&&I.setObject("dijit.editing.TemplatePickerItem",Q,e);return Q})},"widgets/CostAnalysis/scenario-selection":function(){define("dojo/_base/declare jimu/BaseWidget dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./scenario-selection.html dojo/_base/array dojo/_base/lang dojo/store/Memory dojo/dom-class".split(" "),function(Q,I,J,G,u,d,c,a,w){return Q([I,J,G],{templateString:u,baseClass:"jimu-widget-cost-analysis-scenario-selection",postCreate:function(){this.inherited(arguments)},
startup:function(){this.inherited(arguments);this._init()},_init:function(){this.regionNameTextBox.set("value",this.regionName);this._setScenarioOptions()},_setScenarioOptions:function(){var q=[];d.forEach(this.scenarioOptions,c.hitch(this,function(k){q.push({name:k.scenario,value:k.scenario,featureTemplate:this.templateName,geographyGlobalID:this.geographyGlobalID,costEquation:k.costEquation})}));var e=new a({idProperty:"value",data:q});this.scenarioDropDown.set("labelAttr","name");this.scenarioDropDown.set("store",
e);this.scenarioDropDown.set("value",this.nls.scenarioSelection.noneText);this.costingGeometryLayer?w.remove(this.regionDetailsParentContainer,"esriCTHidden"):w.add(this.regionDetailsParentContainer,"esriCTHidden")}})})},"widgets/CostAnalysis/copy-features":function(){define("dijit/_WidgetBase dijit/_TemplatedMixin dojo/_base/declare dojo/Evented dojo/_base/lang dojo/_base/array dojo/dom-construct dojo/on jimu/dijit/CheckBox dojo/dom-class dojo/dom-attr ./highlightSymbolUtils esri/layers/GraphicsLayer dojo/text!./copy-features.html jimu/utils dijit/focus dojo/keys dojo/query dojo/_base/event esri/tasks/query esri/tasks/QueryTask dojo/Deferred dojo/promise/all".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v){return J([Q,G,I],{templateString:f,layerLabel:null,featuresList:null,checkBoxNodes:{},layerCheckBoxNodes:{},featuresByLayerId:{},featureTitlesByLayerId:{},_highlightGraphicsLayer:null,startup:function(){this.inherited(arguments);this._highlightGraphicsLayer=this._createNewGraphicsLayer("highlightGraphicsLayer");this.toggleWorkBenchDOMTabindexes("-1")},postCreate:function(){this.checkBoxNodes={};this.layerCheckBoxNodes={};this.featuresByLayerId=
{};this.featureTitlesByLayerId={};this._highlightGraphicsLayer=null;this.own(a(this.cancelBtn,"click",u.hitch(this,function(){this.cancelBtnClicked();this.toggleWorkBenchDOMTabindexes("0");this.emit("cancelBtnClicked")})));this.own(a(this.cancelBtn,"keydown",u.hitch(this,function(b){if(b.keyCode===m.ENTER||b.keyCode===m.SPACE)C.stop(b),this.cancelBtnClicked(),this.toggleWorkBenchDOMTabindexes("0"),this.emit("cancelBtnClicked")})));this.own(a(this.createMultipleFeaturesBtn,"click",u.hitch(this,this._createMultipleFeaturesBtnClicked)));
this.own(a(this.createMultipleFeaturesBtn,"keydown",u.hitch(this,function(b){if(b.keyCode===m.ENTER||b.keyCode===m.SPACE)C.stop(b),this._createMultipleFeaturesBtnClicked()})));this.own(a(this.createSingleFeatureBtn,"click",u.hitch(this,this._createSingleFeatureBtnClicked)));this.own(a(this.createSingleFeatureBtn,"keydown",u.hitch(this,function(b){if(b.keyCode===m.ENTER||b.keyCode===m.SPACE)C.stop(b),this._createSingleFeatureBtnClicked()})))},toggleWorkBenchDOMTabindexes:function(b){l(".esriCTWorkBenchDOM",
this.widgetDomNode).forEach(u.hitch(this,function(D){e.set(D,"tabindex",b)}))},selectFeaturesToCopy:function(b){if(b&&0<b.length){this.checkBoxNodes={};this.layerCheckBoxNodes={};this.featuresByLayerId={};this.featureTitlesByLayerId={};this._showHideSingleFeatureButton(b[0]._layer.geometryType);q.remove(this.mainNode,"esriCTHidden");var D=new y;this._processSelectedFeatures(b,D).then(u.hitch(this,function(){c.empty(this.layerListTable);for(var h in this.featureTitlesByLayerId){var B=this.layerInfosObj.getLayerInfoById(h);
B=B.title?B.title:B.name;var H=c.create("div",{},this.layerListTable);this.layerCheckBoxNodes[h]=this._createListNode(B,H,!1,h);this.checkBoxNodes[h]||(this.checkBoxNodes[h]=[]);0<this.featureTitlesByLayerId[h].length&&this._createFeatureEntries(h,H)}this._highlightFeatures()}))}this._setFirstAndLastFocusNodes()},_processSelectedFeatures:function(b,D){var h={},B,H;this.featuresByLayerId={};this.featureTitlesByLayerId={};d.forEach(b,u.hitch(this,function(T){this.featuresByLayerId[T._layer.id]||(this.featuresByLayerId[T._layer.id]=
[],this.featureTitlesByLayerId[T._layer.id]=[]);this.featuresByLayerId[T._layer.id].push(T);this.featureTitlesByLayerId[T._layer.id].push(T.getTitle())}));for(H in this.featuresByLayerId)H&&(b=this._getObjectIdFieldOfLayer(H),b=this._getSelectedFeatureObjectIds(this.featuresByLayerId[H],b),h[H]=this._getSelectedFeatureGeometry(H,b));v(h).then(u.hitch(this,function(T){for(B in T)B&&this._updateGeometryForSelectedFeature(B,T)}),u.hitch(this,function(){this.appUtils.showMessage(this.nls.copyFeatures.copyFeatureUpdateGeometryError)}));
return D.resolve(null)},_getObjectIdFieldOfLayer:function(b){return this.layerInfosObj.getLayerInfoById(b).layerObject.objectIdField},_updateGeometryForSelectedFeature:function(b,D){var h=this._getObjectIdFieldOfLayer(b);d.forEach(this.featuresByLayerId[b],u.hitch(this,function(B){d.forEach(D[b].features,u.hitch(this,function(H){H.attributes[h]===B.attributes[h]&&(B.geometry=H.geometry)}))}))},_getSelectedFeatureObjectIds:function(b,D){var h=[];d.forEach(b,u.hitch(this,function(B){h.push(B.attributes[D])}));
return h},_getSelectedFeatureGeometry:function(b,D){var h=this.layerInfosObj.getLayerInfoById(b);b=new L(h.getUrl());var B=new A;B.outFields=[h.layerObject.objectIdField];B.objectIds=D;B.returnGeometry=!0;B.outSpatialReference=this.map.spatialReference;return b.execute(B).promise},_createFeatureEntries:function(b,D){d.forEach(this.featureTitlesByLayerId[b],u.hitch(this,function(h){h=this._createListNode(h,D,!0,b);this.checkBoxNodes[b].push(h)}))},_createListNode:function(b,D,h,B){D=c.create("div",
{"class":"jimu-widget-row esriCTCopyFeaturesNode"},D);var H=c.create("div",{"class":"jimu-float-leading checkBoxNode"},D);b=new w({label:b,checked:!0},H);h?(q.add(D,"esriCTCopyFeaturesChildNode"),e.set(b.domNode,"parentLayerId",B),a(b.domNode,"click",u.hitch(this,this._childNodeStateChanged)),a(b.domNode,"keydown",u.hitch(this,function(T){T.keyCode!==m.ENTER&&T.keyCode!==m.SPACE||this._childNodeStateChanged(T)}))):(e.set(b.domNode,"layerId",B),a(b.domNode,"click",u.hitch(this,this._parentNodeStateChanged)),
a(b.domNode,"keydown",u.hitch(this,function(T){T.keyCode!==m.ENTER&&T.keyCode!==m.SPACE||this._parentNodeStateChanged(T)})));return b},_parentNodeStateChanged:function(b){b=e.get(b.currentTarget,"layerId");var D=this.checkBoxNodes[b],h=this.layerCheckBoxNodes[b].getValue();d.forEach(D,u.hitch(this,function(B){h?B.setValue(!0):B.setValue(!1)}));this._highlightFeatures()},_childNodeStateChanged:function(b){var D=e.get(b.currentTarget,"parentLayerId");b=this.layerCheckBoxNodes[D];D=this.checkBoxNodes[D];
var h=!0;this._highlightFeatures();d.some(D,u.hitch(this,function(B){if(!B.getValue())return h=!1,!0}));b.setValue(h)},cancelBtnClicked:function(){q.add(this.mainNode,"esriCTHidden");this._highlightGraphicsLayer.clear()},_createMultipleFeaturesBtnClicked:function(){var b=[],D;(D=this._getSelectedFeaturesForCopy())&&0<D.length&&(d.forEach(D,u.hitch(this,function(h){h&&h.geometry&&b.push(h.geometry)})),this.emit("createMultipleFeatures",b))},_createSingleFeatureBtnClicked:function(){var b;(b=this._getSelectedFeaturesForCopy())&&
0<b.length&&this.emit("createSingleFeature",b)},_validateSelectedFeature:function(b){(!b||0>=b.length)&&this.appUtils.showMessage(this.nls.copyFeatures.selectFeatureToCopyMessage)},_getSelectedFeaturesForCopy:function(){var b,D=[];for(b in this.featuresByLayerId){var h=this._getSelectedFeaturesByLayerId(b);0<h.length&&(D=D.concat(h))}this._validateSelectedFeature(D);return D},_getSelectedFeaturesByLayerId:function(b){var D=[];d.forEach(this.checkBoxNodes[b],u.hitch(this,function(h,B){h.getValue()&&
D.push(this.featuresByLayerId[b][B])}));return D},_showHideSingleFeatureButton:function(b){"esriGeometryPoint"===b?(q.add(this.createSingleFeatureBtn,"esriCTHidden"),e.set(this.createSingleFeatureBtn,"tabindex","-1")):(q.remove(this.createSingleFeatureBtn,"esriCTHidden"),e.set(this.createSingleFeatureBtn,"tabindex","0"))},_createNewGraphicsLayer:function(b){var D={};if(b+=this.widgetId)this.map._layers[b]&&this.map.removeLayer(this.map._layers[b]),D={id:b};b=new z(D);this.map.addLayer(b);return b},
_highlightFeatures:function(){this._highlightGraphicsLayer.clear();for(var b in this.featureTitlesByLayerId)this._highlightSingleLayerFeatures(b)},_highlightSingleLayerFeatures:function(b){var D=this.map.getLayer(b);b=this._getSelectedFeaturesByLayerId(b);d.forEach(b,u.hitch(this,function(h){h=k.getHighLightSymbol(h,D);this._highlightGraphicsLayer.add(h)}))},_setFirstAndLastFocusNodes:function(){var b=l(".jimu-checkbox",this.domNode);b.length&&(g.focus(b[0]),n.initFirstFocusNode(this.widgetDomNode,
b[0]));n.initLastFocusNode(this.widgetDomNode,this.cancelBtn)}})})},"widgets/CostAnalysis/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(Q,I,J,G,u,d,c,a,w,q){var e={getHighLightSymbol:function(k,z){switch(k.geometry.type){case "point":return e._getPointSymbol(k,z);case "polyline":return e._getPolyLineSymbol(k,
z);case "polygon":return e._getPolygonSymbol(k,z)}},_getSizeInfo:function(k){var z=null;k.renderer.visualVariables&&I.forEach(k.renderer.visualVariables,Q.hitch(this,function(f){"sizeInfo"===f.type&&(z=f)}));return z},_getPointSymbol:function(k,z){var f,n;var g=!1;var m=new c(c.STYLE_SQUARE,null,new a(a.STYLE_SOLID,new q([0,255,255,1]),3));m.setColor(null);m.size=30;if(z&&z.renderer)if(z.renderer.symbol)g=!0,m=e._updatePointSymbolProperties(m,z.renderer.symbol);else if(z.renderer.infos&&0<z.renderer.infos.length){for(n=
0;n<z.renderer.infos.length;n++){z.typeIdField?f=k.attributes[z.typeIdField]:z.renderer.attributeField&&(f=k.attributes[z.renderer.attributeField]);var l=z.renderer.infos[n].value;void 0!==f&&null!==f&&""!==f&&void 0!==l&&null!==l&&""!==l&&f.toString()===l.toString()&&(g=!0,m=e._updatePointSymbolProperties(m,z.renderer.infos[n].symbol))}!g&&z.renderer.defaultSymbol&&(g=!0,m=e._updatePointSymbolProperties(m,z.renderer.defaultSymbol))}z&&z.graphics&&0<z.graphics.length&&z._getSymbol(k)&&((f=k.getShape())&&
f.shape?f.shape.hasOwnProperty("r")?(g=!0,m.size=2*f.shape.r+10):f.shape.hasOwnProperty("width")&&(g=!0,z.renderer&&z.renderer.infos&&0<z.renderer.infos.length&&(m=e._updatePointSymbolProperties(m,z.renderer.infos[0].symbol)),m.size=f.shape.width+10):z.renderer.visualVariables&&(g=z._getRenderer(k),f=e._getSizeInfo(z))&&(z=g.getSize(k,{sizeInfo:f,shape:z._getSymbol(k),resolution:z&&z.getResolutionInMeters&&z.getResolutionInMeters()}),null!==z&&(m.size=z+10)));z=new J(k.geometry.x,k.geometry.y,k.geometry.spatialReference);
return new d(z,m,k.attributes)},_updatePointSymbolProperties:function(k,z){if(z.hasOwnProperty("height")&&z.hasOwnProperty("width")){var f=z.height;var n=z.width;f=(f>n?f:n)+10;k.size=f}z.hasOwnProperty("size")&&(!f||f<z.size)&&(k.size=z.size+10);z.hasOwnProperty("xoffset")&&(k.xoffset=z.xoffset);z.hasOwnProperty("yoffset")&&(k.yoffset=z.yoffset);return k},_getPolyLineSymbol:function(k,z){var f,n;var g=5;if(z&&z.renderer)if(z.renderer.symbol&&z.renderer.symbol.hasOwnProperty("width"))g=z.renderer.symbol.width;
else if(z.renderer.infos&&0<z.renderer.infos.length)for(n=0;n<z.renderer.infos.length;n++){z.typeIdField?f=k.attributes[z.typeIdField]:z.renderer.attributeField&&(f=k.attributes[z.renderer.attributeField]);var m=z.renderer.infos[n].value;void 0!==f&&null!==f&&""!==f&&void 0!==m&&null!==m&&""!==m&&f.toString()===m.toString()&&z.renderer.infos[n].symbol.hasOwnProperty("width")&&(g=z.renderer.infos[n].symbol.width)}else z.renderer.defaultSymbol&&z.renderer.defaultSymbol.hasOwnProperty("width")&&(g=z.renderer.defaultSymbol.width);
z=new a(a.STYLE_SOLID,new q([0,255,255,1]),g);var l=new u(k.geometry.spatialReference);k.geometry.paths&&0<k.geometry.paths.length&&I.forEach(k.geometry.paths,function(C){l.addPath(C)});return new d(l,z,k.attributes)},_getPolygonSymbol:function(k){var z=new w(w.STYLE_SOLID,new a(a.STYLE_SOLID,new q([0,255,255,1]),4),new q([0,0,0,0]));var f=new G(k.geometry.spatialReference);k.geometry.rings&&(f.rings=Q.clone(k.geometry.rings));return new d(f,z,k.attributes)}};return e})},"widgets/CostAnalysis/project-overview":function(){define("dojo/_base/declare jimu/BaseWidget dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./project-overview.html dojo/_base/lang dojo/_base/array dojo/dom-attr dojo/dom-class dojo/string dojo/on dojo/Deferred esri/graphic esri/geometry/Point esri/tasks/BufferParameters esri/geometry/geometryEngine esri/tasks/GeometryService esri/geometry/Polygon dojo/dom-construct jimu/dijit/LoadingIndicator ./advance-item-list jimu/utils dijit/focus".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v){return Q([I,J,G],{templateString:u,baseClass:"jimu-widget-cost-analysis-project-overview",postCreate:function(){this.inherited(arguments);this.listData=[{title:this.nls.projectOverview.assetItemsTitle,content:this.assetSummaryInfo,icon:"",actionIcon:"",isOpen:!0},{title:this.nls.projectOverview.assetStatisticsTitle,content:"",icon:"",actionIcon:"",actionIconTitle:"",isOpen:!1}];this.config.projectSettings.projectLayer&&(this.projectLayer=this.layerInfosObj.getLayerInfoById(this.config.projectSettings.projectLayer).layerObject,
this.updateProjectInfo(this.projectInfo),this.listData.push({title:this.nls.projectOverview.projectSummaryTitle,content:this.projectSummaryInfo,icon:"",actionIcon:"",actionIconTitle:this.nls.projectAttribute.projectAttributeText,isOpen:!1}));this._initLoadingIndicator()},updateProjectInfo:function(b){this.projectInfo=b;this.config.projectSettings.projectLayer&&(b=q.substitute(this.nls.projectOverview.projectName,{name:this.projectInfo.name}),a.set(this.projectNameDiv,"innerHTML",b),a.set(this.projectNameDiv,
"title",b),a.set(this.projectNameDiv,"aria-label",b),w.contains(this.projectNameDiv,"esriCTHidden")&&(w.remove(this.projectNameDiv,"esriCTHidden"),setTimeout(d.hitch(this,function(){y.initFirstFocusNode(this.widgetDomNode,this.projectNameDiv);v.focus(this.projectNameDiv)}),0)))},_initLoadingIndicator:function(){this._loadingIndicator=new A({hidden:!0});this._loadingIndicator.placeAt(this.domNode.parentNode.parentNode.parentNode);this._loadingIndicator.startup()},startup:function(){this.inherited(arguments);
this.projectInfo&&""===this.projectInfo.name&&(a.set(this.projectNameDiv,"title",""),a.set(this.projectNameDiv,"tabindex","-1"),w.contains(this.projectNameDiv,"esriCTHidden")||(w.add(this.projectNameDiv,"esriCTHidden"),setTimeout(d.hitch(this,function(){y.initFirstFocusNode(this.widgetDomNode,this.featureModeTextNode);v.focus(this.featureModeTextNode)}),0)));this._initProjectOverview()},_initProjectOverview:function(){var b=new L({itemList:this.listData,showArrow:!0,togglePanels:!1,openMultiple:!0,
widgetDomNode:this.widgetDomNode,fromProjectOverview:!0,nls:this.nls},C.create("div",{},this.projectOverviewNode));this.own(e(b,"onActionButtonClicked",d.hitch(this,function(h){this.emit("actionClicked",h)})));this.own(e(b,"onTitleClicked",d.hitch(this,function(h){this.emit("titleClicked",h)})));b.startup();b=this.totalCostLabel.innerHTML.replace("*",this.nls.projectOverview.roundingLabel);var D=this.grossCostLabel.innerHTML.replace("*",this.nls.projectOverview.roundingLabel);a.set(this.totalCostLabel,
"aria-label",b.replace("*",""));a.set(this.grossCostLabel,"aria-label",D.replace("*",""))},showAssetItemSummary:function(b,D){var h=0;C.empty(this.assetSummaryDiv);if(0<Object.keys(b).length){var B,H;var T=C.create("div",{},this.assetSummaryDiv);T=C.create("table",{style:{width:"100%"},"class":"esriCTTable"},T);T=C.create("tbody",{},T);for(B in b){var N=C.create("tr",{},T);C.create("td",{innerHTML:b[B].layerName,"class":"esriCTSummaryLayerTitle",colspan:3},N);for(H in b[B].templates){var p=b[B].templates[H];
var E=p.units;N=C.create("tr",{tabindex:"0"},T);if("esriGeometryPoint"!==b[B].geometryType){E=this.appUtils.applyRounding(E);var r=this.appUtils.getUnitsAbbreviation(b[B].geometryType,this.config.generalSettings.measurementUnit)}else r=this.nls.workBench.units;C.create("td",{innerHTML:H},N);C.create("td",{innerHTML:E+" "+r},N);C.create("td",{"class":"esriCTAssetItemsCost",innerHTML:this.config.generalSettings.currency+" "+this.appUtils.applyRounding(p.cost)},N);E=b[B].layerName+" "+H+" "+E+" "+r+
" "+this.config.generalSettings.currency+" "+this.appUtils.applyRounding(p.cost);a.set(N,"aria-label",E);h+=p.cost}}}else C.create("div",{style:"padding: 10px 0; text-align : center; font-weight : bold",innerHTML:this.nls.workBench.noAssetAddedMsg,tabindex:"0","aria-label":this.nls.workBench.noAssetAddedMsg,role:"presentation"},this.assetSummaryDiv);this._updateProjectCost(h);D&&this._getProjectBoundary(b)},grossCostUpdated:function(b){var D=this.appUtils.roundProjectCostValue(this.config.generalSettings.roundCostType,
b);D=this.config.generalSettings.currency+" "+D;a.set(this.grossCost,"innerHTML",D);a.set(this.grossCost,"aria-label",D);this._saveProjectAttributes(this._projectTotalCost,b)},_updateProjectCost:function(b){this._projectTotalCost=b;b=this.appUtils.roundProjectCostValue(this.config.generalSettings.roundCostType,this._projectTotalCost);b=this.config.generalSettings.currency+" "+b;a.set(this.totalCost,"innerHTML",b);this.emit("totalCostCalculated",this._projectTotalCost)},_getProjectBoundary:function(b){0===
Object.keys(b).length?this._saveProjectGeometry(new l):(this._loadingIndicator.show(),"outline"===this.config.generalSettings.projectAreaType?(b=this._convertFeatureStoredToPoints(b),this.geometryService.convexHull(b,d.hitch(this,function(D){this._loadingIndicator.hide();this._onConvexHullComplete(D)}),d.hitch(this,function(){this._loadingIndicator.show()}))):this._createBufferOnAssets(b).then(d.hitch(this,function(D){this._loadingIndicator.hide();D&&this._saveProjectGeometry(D)})))},_convertFeatureStoredToPoints:function(b){var D=
[],h;for(h in b)if(b.hasOwnProperty(h)){var B=b[h].templates;for(u in B)B=b[h].templates[u].features,D=D.concat(this._getFeatureGeometry(B))}return D},_getFeatureGeometry:function(b){var D=[];c.forEach(b,function(h){var B=h.geometry.type,H=h.geometry;"point"===B?D.push(H):c.forEach("polyline"===B?H.paths:H.rings,function(T){c.forEach(T,function(N){N=new f(N[0],N[1],H.spatialReference);D.push(N)})})});return D},_onConvexHullComplete:function(b){"polygon"!==b.type&&(b=new l);this._saveProjectGeometry(b)},
_createBufferOnAssets:function(b){var D=[],h;var B=new k;for(T in b)if(b.hasOwnProperty(T)){var H=b[T].templates;for(h in H)H=b[T].templates[h].features,D=D.concat(this._getBufferGeometry(H))}var T=this.appUtils.units[this.config.generalSettings.measurementUnit].bufferUnit;b=new n;b.distances=[this.config.generalSettings.bufferDistance];b.outSpatialReference=this.map.spatialReference;b.unit=m[T];b.geometries=D;this.map.spatialReference.isWebMercator()||4326===this.map.spatialReference.wkid?(D=g.geodesicBuffer(b.geometries,
b.distances,b.unit,!0),B.resolve(D[0])):this.geometryService.buffer(b,d.hitch(this,function(N){B.resolve(N)}),d.hitch(this,function(){B.resolve(null)}));return B.promise},_getBufferGeometry:function(b){var D=[];c.forEach(b,d.hitch(this,function(h){h=h.geometry;"polygon"===h.type&&(h=g.simplify(h));D.push(h)}));return D},_saveProjectGeometry:function(b){if(this.projectLayer){this._loadingIndicator.show();var D=new z;D.attributes={};D.attributes[this.projectLayer.objectIdField]=this.projectInfo.objectId;
D.geometry=b;this.projectLayer.applyEdits(null,[D],null,d.hitch(this,function(){this.projectLayer.refresh();this.emit("addOrModifyLabelPoint",{projectGeometry:b});this._loadingIndicator.hide()}),d.hitch(this,function(){this.appUtils.showMessage(this.nls.projectOverview.unableToSaveProjectBoundary);this._loadingIndicator.hide()}))}},_saveProjectAttributes:function(b,D){if(this.projectLayer){this._loadingIndicator.show();var h=new z;h.attributes={};h.attributes[this.projectLayer.objectIdField]=this.projectInfo.objectId;
c.forEach(this.projectLayer.fields,d.hitch(this,function(B){"TOTALASSETCOST"===B.name.toUpperCase()?h.attributes[B.name]=b:"GROSSPROJECTCOST"===B.name.toUpperCase()&&(h.attributes[B.name]=D)}));this.projectLayer.applyEdits(null,[h],null,d.hitch(this,function(){this.projectLayer.refresh();this._loadingIndicator.hide()}),d.hitch(this,function(){this.appUtils.showMessage(this.nls.projectOverview.unableToSaveProjectCost);this._loadingIndicator.hide()}))}}})})},"esri/tasks/BufferParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has ../kernel ../geometry/Polygon ../geometry/jsonUtils".split(" "),
function(Q,I,J,G,u,d,c,a){Q=Q(null,{declaredClass:"esri.tasks.BufferParameters",geometries:null,outSpatialReference:null,bufferSpatialReference:null,distances:null,unit:null,unionResults:!1,geodesic:!1,toJson:function(){var w={unit:this.unit,unionResults:this.unionResults,geodesic:this.geodesic},q=this.distances,e=this.outSpatialReference,k=this.bufferSpatialReference,z=J.map(this.geometries,function(g){g="extent"===g.type?c.fromExtent(g):g;return g.toJson()},this),f=this.geometries;if(f&&0<f.length){var n=
"extent"===f[0].type?"esriGeometryPolygon":a.getJsonType(f[0]);w.geometries=G.toJson({geometryType:n,geometries:z});w.inSR=f[0].spatialReference.wkid?f[0].spatialReference.wkid:G.toJson(f[0].spatialReference.toJson())}q&&(w.distances=q.join(","));e&&(w.outSR=e.wkid?e.wkid:G.toJson(e.toJson()));k&&(w.bufferSR=k.wkid?k.wkid:G.toJson(k.toJson()));return w}});u("extend-esri")&&I.setObject("tasks.BufferParameters",Q,d);return Q})},"widgets/CostAnalysis/advance-item-list":function(){define("dojo/_base/declare jimu/BaseWidget dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./advance-item-list.html dojo/_base/array dojo/_base/lang dojo/dom-attr dojo/dom-class dojo/dom-style dojo/on dojo/query dojo/dom-construct dojo/keys dojo/_base/event".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n){return Q([I,J,G],{templateString:u,baseClass:"jimu-widget-cost-analysis-advance-item-list",activeIndex:0,currentActivePanel:null,highlighterColor:"#000",setAutoHeight:!1,postCreate:function(){this.inherited(arguments)},startup:function(){this.inherited(arguments);this.itemList&&0<this.itemList.length&&setTimeout(c.hitch(this,function(){this._loadItemList()}),0)},_loadItemList:function(){d.forEach(this.itemList,c.hitch(this,function(g,m){this.addItem(g,m)}));
this.emit("onLoad")},addItem:function(g,m){g.content=g.content||"";var l=z.create("div",{"class":"esriCTItem"},null);a.set(l,"index",m);this._createItemTitle(g,l);g.content&&this._createItemContent(g,l);this.itemListContainer.appendChild(l);g.isOpen&&this._togglePanel(l,!0);g.isHidden&&this.hide(m)},_createImageLogo:function(g,m,l){m=z.create("div",{"class":"esriCTItemListImageLogo"},m);"icon"===l?w.add(m,g.icon):"actionIcon"===l?(a.set(m,"tabindex","0"),w.add(m,"esriCTWorkBenchDOM"),a.set(m,"role",
"button"),a.set(m,"aria-label",g.actionIconTitle),w.add(m,g.actionIcon)):(w.add(m,"esriCTArrow"),this.togglePanels&&w.add(m,"esriCTArrowDown"));return m},_createItemTitle:function(g,m){var l=z.create("div",{"class":"esriCTItemTitleContainer",tabindex:"0","aria-label":g.title,role:"button"},m);g.title===this.nls.projectOverview.projectSummaryTitle&&w.add(l,"esriCTProjectSummary");g.title===this.nls.projectOverview.assetItemsTitle?w.add(l,"esriCTAssetItems"):a.set(l,"aria-expanded","false");this.fromProjectOverview&&
(w.add(l,"esriCTProjectOverview"),w.add(l,"esriCTWorkBenchDOM"));var C=z.create("div",{"class":"esriCTItemHighlighter"},l);this.highlighter||w.add(C,"esriCTHidden");g.icon&&this._createImageLogo(g,l,"icon");C=z.create("div",{"class":"esriCTItemTitle esriCTFloatLeft esriCTEllipsis",innerHTML:g.title,title:g.title},l);if(g.actionIcon){var A=this._createImageLogo(g,l,"actionIcon");g.actionIconTitle&&a.set(A,"title",g.actionIconTitle);this.own(e(A,"click",c.hitch(this,function(L){n.stop(L);this.emit("onActionButtonClicked",
a.get(m,"index"))})));this.own(e(A,"keydown",c.hitch(this,function(L){if(L.keyCode===f.ENTER||L.keyCode===f.SPACE)n.stop(L),this.emit("onActionButtonClicked",a.get(m,"index"))})))}this.showArrow&&this._createImageLogo(g,l,"arrow");this._setItemTitleWidth(g,C);this.own(e(l,"click",c.hitch(this,function(){this.togglePanels&&this._togglePanel(m,!1);this.emit("onTitleClicked",a.get(m,"index"))})));this.own(e(l,"keydown",c.hitch(this,function(L){if(L.keyCode===f.ENTER||L.keyCode===f.SPACE)n.stop(L),this.togglePanels&&
this._togglePanel(m,!1),this.emit("onTitleClicked",a.get(m,"index"))})))},_setItemTitleWidth:function(g,m){var l=0;g.icon&&(l+=32);g.actionIcon&&(l+=32);this.showArrow&&(l+=32);this.highlighter&&(l+=10);q.set(m,"width","calc(100% - "+l+"px)")},_createItemContent:function(g,m){m=z.create("div",{"class":"esriCTItemContent"},m);this.setAutoHeight||w.add(m,"esriCTItemAnimation");"string"===typeof g.content?a.set(m,"innerHTML",g.content):z.place(g.content,m)},_togglePanel:function(g,m){var l=0;m||(l=30);
m=k(".esriCTItemTitle",g)[0];var C=k(".esriCTItemContent",g)[0];var A=k(".esriCTArrow",g)[0];var L=k(".esriCTItemHighlighter",g)[0];var y=k(".esriCTToggleIcon",g);var v=k(".esriCTEditEquationIcon",g);var b=k(".esriCTSelectableRow",g);var D=k(".esriCTGroupSummaryTotalRow",g);m&&C&&(w.contains(C,"esriCTItemContentActive")?(C.style.height=0,this.currentActivePanel&&a.get(this.currentActivePanel,"index")===a.get(g,"index")&&(this.currentActivePanel=null),q.set(L,"backgroundColor","transparent"),this.showArrow&&
this.togglePanels&&(w.replace(A,"esriCTArrowDown","esriCTArrowUp"),a.set(m.parentNode,"aria-expanded","false"),this._setTabIndexToNodes(y,"-1"),this._setTabIndexToNodes(v,"-1"),this._setTabIndexToNodes(b,"-1"),this._setTabIndexToNodes(D,"-1"))):(C.style.height=this.togglePanels&&!this.setAutoHeight?C.scrollHeight+l+"px":"auto",this.currentActivePanel&&!this.openMultiple&&this._togglePanel(this.currentActivePanel,!0),this.currentActivePanel=g,q.set(L,"backgroundColor",this.highlighterColor),this.showArrow&&
this.togglePanels&&(w.replace(A,"esriCTArrowUp","esriCTArrowDown"),a.set(m.parentNode,"aria-expanded","true"),this._setTabIndexToNodes(y,"0"),this._setTabIndexToNodes(v,"0"),this._setTabIndexToNodes(b,"0"),this._setTabIndexToNodes(D,"0"))),w.toggle(C,"esriCTItemContentActive"))},onTitleClicked:function(){},onAnalysisButtonClicked:function(){},show:function(g){g=k(".esriCTItem[index \x3d "+g+"]",this.itemListContainer);1===g.length&&(q.set(g[0],"display",""),g.isHidden=!1)},hide:function(g){g=k(".esriCTItem[index \x3d "+
g+"]",this.itemListContainer);1===g.length&&(q.set(g[0],"display","none"),g.isHidden=!0)},_setTabIndexToNodes:function(g,m){g&&0<g.length&&d.forEach(g,c.hitch(this,function(l){a.set(l,"tabindex",m)}))}})})},"widgets/CostAnalysis/project-summary":function(){define("dojo/_base/declare jimu/BaseWidget dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./project-summary.html dojo/_base/lang dojo/dom-attr dojo/on jimu/dijit/SimpleTable jimu/dijit/LoadingIndicator dojo/query dojo/dom-class dijit/form/ValidationTextBox dojo/dom-construct jimu/dijit/formSelect dijit/registry dojo/_base/array dojo/store/Memory dojo/_base/html dijit/focus esri/graphic dojo/keys dojo/_base/event jimu/utils dijit/focus".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v,b,D){return Q([I,J,G],{templateString:u,baseClass:"jimu-widget-cost-analysis-project-summary",_costFieldStore:null,totalCost:0,projectInfo:null,previouslyAddedEscalations:[],loadingProject:!1,postCreate:function(){this.inherited(arguments);this.totalCost=0;this.previouslyAddedEscalations=[];this._handleClickEvents();this._initLoadingIndicator()},_initLoadingIndicator:function(){this._loadingIndicator=new q({hidden:!0});this._loadingIndicator.placeAt(this.domNode.parentNode.parentNode.parentNode);
this._loadingIndicator.startup()},_handleClickEvents:function(){this.own(a(this.btnAddNode,"click",d.hitch(this,function(){k.contains(this.btnAddNode,"esriCTAddStatisticsIconDisable")||(this._addCostEscalationBtnClicked(),this._handleActionButtonVisibility())})));this.own(a(this.btnAddNode,"keydown",d.hitch(this,function(h){if(h.keyCode===y.ENTER||h.keyCode===y.SPACE)v.stop(h),k.contains(this.btnAddNode,"esriCTAddStatisticsIconDisable")||(this._addCostEscalationBtnClicked(),this._handleActionButtonVisibility())})));
this.own(a(this.btnCrossNode,"click",d.hitch(this,function(){k.contains(this.btnCrossNode,"esriCTDeleteStatisticsIconDisable")||this._deleteLayerRow()})));this.own(a(this.btnCrossNode,"keydown",d.hitch(this,function(h){if(h.keyCode===y.ENTER||h.keyCode===y.SPACE)v.stop(h),k.contains(this.btnCrossNode,"esriCTDeleteStatisticsIconDisable")||this._deleteLayerRow()})));this.own(a(this.btnUpNode,"click",d.hitch(this,this._upArrowClicked)));this.own(a(this.btnUpNode,"keydown",d.hitch(this,function(h){if(h.keyCode===
y.ENTER||h.keyCode===y.SPACE)v.stop(h),this._upArrowClicked()})));this.own(a(this.btnDownNode,"click",d.hitch(this,this._downArrowClicked)));this.own(a(this.btnDownNode,"keydown",d.hitch(this,function(h){if(h.keyCode===y.ENTER||h.keyCode===y.SPACE)v.stop(h),this._downArrowClicked()})));this.own(a(this.okButton,"click",d.hitch(this,function(){this._okButtonClicked()})));this.own(a(this.okButton,"keydown",d.hitch(this,function(h){if(h.keyCode===y.ENTER||h.keyCode===y.SPACE)v.stop(h),this._okButtonClicked()})));
this.own(a(this.cancelButton,"click",d.hitch(this,function(){this._cancelButtonClicked()})));this.own(a(this.cancelButton,"keydown",d.hitch(this,function(h){if(h.keyCode===y.ENTER||h.keyCode===y.SPACE)v.stop(h),this._cancelButtonClicked()})))},_okButtonClicked:function(){var h=!0;var B=this._costEscalationTable.getRows();m.forEach(B,d.hitch(this,function(H){H.costLabelTextBox.isValid()||(h=!1,A.focus(H.costLabelTextBox));H.costValueLabelTextBox.isValid()||(h=!1,A.focus(H.costValueLabelTextBox))}));
h?(this.calculateGrossCost(this.totalCost,!0),this.emit("onOkButtonClicked")):this.appUtils.showMessage(this.nls.costEscalation.invalidEntry)},_cancelButtonClicked:function(){this.emit("onCancelButtonClicked");this._loadingIndicator.show();this._costEscalationTable.clear();m.forEach(this.tableData,d.hitch(this,function(h){this._addCostEscalationLayerRow(h)}));this._updateGrossCost();this._loadingIndicator.hide()},_upArrowClicked:function(){if(!k.contains(this.btnUpNode,"esriCTStatisticsUpIconDisable")){var h;
var B=this._costEscalationTable.getRows();var H=this._costEscalationTable.getData();m.forEach(H,d.hitch(this,function(T,N){T.editable&&(h=B[N])}));this._costEscalationTable.onBeforeRowUp(h)&&(H=m.indexOf(B,h),0<H&&(H=B[H-1]))&&(C.place(h,H,"before"),this._costEscalationTable.updateUI(),this._costEscalationTable.emit("row-up",h),this._updateGrossCost())}},_downArrowClicked:function(){if(!k.contains(this.btnDownNode,"esriCTStatisticsDownIconDisable")){var h;var B=this._costEscalationTable.getRows();
var H=this._costEscalationTable.getData();m.forEach(H,d.hitch(this,function(T,N){T.editable&&(h=B[N])}));this._costEscalationTable.onBeforeRowDown(h)&&(H=m.indexOf(B,h),H<B.length-1&&(H=B[H+1]))&&(C.place(h,H,"after"),this._costEscalationTable.updateUI(),this._costEscalationTable.emit("row-down",h),this._updateGrossCost())}},startup:function(){this.inherited(arguments);this._init()},reset:function(h){this.projectInfo=h;this._costEscalationTable.clear();this.totalCost=0;this.previouslyAddedEscalations=
[];this.tableData=[]},_init:function(){this._createCostEscalationFieldTable();this._createCostTypeFieldStore()},cloneTableData:function(){this.tableData=[];var h=[],B={};this._costEscalationTable&&this._costEscalationTable.getRows().length&&(m.forEach(this._costEscalationTable.getRows(),d.hitch(this,function(H){B={};H.costLabelTextBox&&(B.label=H.costLabelTextBox.getValue());H.costTypeLabelDropdown&&(B.type=H.costTypeLabelDropdown.getValue());H.costValueLabelTextBox&&(B.costValue=H.costValueLabelTextBox.getValue());
h.push(B)})),this.tableData=d.clone(h));this._handleActionButtonVisibility()},loadAdditionalCost:function(h){var B={};0<h.length?(h.sort(d.hitch(this,this._sortFeatureArray)),m.forEach(h,d.hitch(this,function(H){B={};B.label=H.attributes[this.config.projectMultiplierFields.DESCRIPTION];B.type=H.attributes[this.config.projectMultiplierFields.TYPE];B.costValue=H.attributes[this.config.projectMultiplierFields.VALUE];if("+"===B.type||"*"===B.type||"_"===B.type||"%"===B.type)this.additionalCostTable&&
this.loadingProject&&this._storeAsPreviouslyAdded(H.attributes[this.additionalCostTable.objectIdField]),this._addCostEscalationLayerRow(B)}))):m.forEach(this.config.projectCostSettings,d.hitch(this,function(H){B={};B.label=H.label;B.type=H.type;B.costValue=H.value;"+"!==B.type&&"*"!==B.type&&"_"!==B.type&&"%"!==B.type||this._addCostEscalationLayerRow(B)}))},_sortFeatureArray:function(h,B){var H=this.config.projectMultiplierFields.COSTINDEX;return h.attributes[H]-B.attributes[H]},_createCostEscalationFieldTable:function(){this._costEscalationTable=
new w({fields:[{name:"editable",title:this.nls.common.label,type:"checkbox",editable:!1,width:"40%"},{name:"field",title:this.nls.common.type,type:"empty",editable:!1,width:"30%"},{name:"field",title:this.nls.costEscalation.valueHeader,type:"empty",editable:!0,width:"40%"}],selectable:!1,autoHeight:!0});this._costEscalationTable.placeAt(this.costEscalationTableNode);this._costEscalationTable.startup()},_handleCheckBoxClick:function(h){var B=e(".simple-table-title .jimu-checkbox",this.domNode)[0];
h=e(".jimu-checkbox",h)[0];a(g.byNode(B),"change",d.hitch(this,function(){this._handleActionButtonVisibility()}));a(g.byNode(h),"change",d.hitch(this,function(){this._handleActionButtonVisibility()}))},_handleActionButtonVisibility:function(){var h=!0,B=0;var H=this._costEscalationTable.getRows();var T=e(".simple-table-title .jimu-checkbox",this.domNode)[0];T=g.byNode(T);m.forEach(H,d.hitch(this,function(N){""===d.trim(N.costLabelTextBox.value)&&(h=!1);if(isNaN(N.costValueLabelTextBox.value)||""===
d.trim(N.costValueLabelTextBox.value+"")||"0"===N.costValueLabelTextBox.value||0===N.costValueLabelTextBox.value)h=!1;N=e(".jimu-checkbox",N)[0];g.byNode(N).checked&&B++}));0===B?(k.replace(this.btnCrossNode,"esriCTDeleteStatisticsIconDisable","esriCTDeleteStatisticsIcon"),c.set(this.btnCrossNode,"tabindex","-1")):(k.replace(this.btnCrossNode,"esriCTDeleteStatisticsIcon","esriCTDeleteStatisticsIconDisable"),c.set(this.btnCrossNode,"tabindex","0"));h||0===H.length?(k.replace(this.btnAddNode,"esriCTAddStatisticsIcon",
"esriCTAddStatisticsIconDisable"),c.set(this.btnAddNode,"tabindex","0")):(k.replace(this.btnAddNode,"esriCTAddStatisticsIconDisable","esriCTAddStatisticsIcon"),c.set(this.btnAddNode,"tabindex","-1"));h&&1===B&&1<H.length?(k.replace(this.btnUpNode,"esriCTStatisticsUpIcon","esriCTStatisticsUpIconDisable"),k.replace(this.btnDownNode,"esriCTStatisticsDownIcon","esriCTStatisticsDownIconDisable"),c.set(this.btnUpNode,"tabindex","0"),c.set(this.btnDownNode,"tabindex","0")):(k.replace(this.btnUpNode,"esriCTStatisticsUpIconDisable",
"esriCTStatisticsUpIcon"),k.replace(this.btnDownNode,"esriCTStatisticsDownIconDisable","esriCTStatisticsDownIcon"),c.set(this.btnUpNode,"tabindex","-1"),c.set(this.btnDownNode,"tabindex","-1"));0===H.length?(T.set("status",!1),k.add(T.domNode,"jimu-state-disabled"),c.set(T.domNode,"tabindex","-1"),D.focus(this.btnAddNode),b.initFirstFocusNode(this.widgetDomNode,this.btnAddNode)):(T.set("status",!0),k.remove(T.domNode,"jimu-state-disabled"),c.set(T.domNode,"tabindex","0"),b.initFirstFocusNode(this.widgetDomNode,
T.domNode))},_addCostEscalationBtnClicked:function(){this._addCostEscalationLayerRow();if(this.widgetDomNode){var h=this._costEscalationTable.getRows();if(0<=h.length){var B=h[h.length-1];h=e(".jimu-checkbox",B)[0];D.focus(h);this.textBoxKeyDownEvent&&this.textBoxKeyDownEvent[0].remove();this.textBoxKeyDownEvent=this.own(a(B.costValueLabelTextBox,"keydown",d.hitch(this,function(H){setTimeout(d.hitch(this,function(){H.keyCode===y.TAB&&H.shiftKey||B.costValueLabelTextBox.isValid()&&H.keyCode===y.TAB&&
(k.contains(this.btnAddNode,"esriCTAddStatisticsIconDisable")||D.focus(this.btnAddNode))}),100)})))}}},_addCostEscalationLayerRow:function(h){var B=this._costEscalationTable.addRow({});var H=e(".simple-table-cell",B.tr);this._handleCheckBoxClick(B.tr);H&&(B=B.tr,this._addCostLabelTextBox(H[0],B,h),this._addCostTypeLabelDropdown(H[1],B,h),this._addCostValueLabelTextBox(H[2],B,h))},_addCostLabelTextBox:function(h,B,H){h=f.create("div",{"class":"esriCTTextBoxContainer"},h);B.costLabelTextBox=new z({"class":"esriCTCostLabelTextbox esriCTAddLayerTableNode",
"aria-label":this.nls.common.label},h);B.costLabelTextBox.startup();H&&H.label&&B.costLabelTextBox.set("value",H.label);B.costLabelTextBox.validator=d.hitch(this,this._validateCostEscalationLabelFields);this.own(a(B.costLabelTextBox,"change",d.hitch(this,function(){this._handleActionButtonVisibility()})))},_validateCostEscalationLabelFields:function(h){return""===d.trim(h)?!1:!0},_addCostTypeLabelDropdown:function(h,B,H){h=f.create("div",{"class":"esriCTCostTypeDropDownContainer esriCTAddLayerTableNode"},
h);B.costTypeLabelDropdown=new n({name:"layerSelect",store:this._costFieldStore,labelAttr:"name","class":"esriCTCostTypeDropdown","aria-label":this.nls.common.type},h);H&&H.type&&(H=B.costTypeLabelDropdown.store.get(H.type),B.costTypeLabelDropdown.setValue(H.value));this.own(a(B.costTypeLabelDropdown,"change",d.hitch(this,this._updateGrossCost)));B.costTypeLabelDropdown.startup()},_addCostValueLabelTextBox:function(h,B,H){h=f.create("div",{"class":"esriCTTextBoxContainer esriCTAddLayerTableNode"},
h);B.costValueLabelTextBox=new z({"class":"esriCTCostLabelTextbox",trim:!0,"aria-label":this.nls.costEscalation.valueHeader},h);B.costValueLabelTextBox.startup();H&&H.costValue&&B.costValueLabelTextBox.set("value",H.costValue);B.costValueLabelTextBox.validator=d.hitch(this,this._validateCostEscalationValueFields);this.own(a(B.costValueLabelTextBox,"change",d.hitch(this,function(){this._updateGrossCost();this._handleActionButtonVisibility()})))},_validateCostEscalationValueFields:function(h){h=Number(h);
return""===h||isNaN(h)||"0"===h||0===h?!1:!0},_getCostEscalationArray:function(){var h=this._costEscalationTable.getRows();var B=[];m.forEach(h,d.hitch(this,function(H){B.push({label:H.costLabelTextBox.getValue(),type:H.costTypeLabelDropdown.getValue(),value:H.costValueLabelTextBox.getValue()})}));return B},addConfiguredAdditionalCostArray:function(){var h=[];var B=[];var H=[];var T=this.totalCost;m.forEach(this.config.projectCostSettings,d.hitch(this,function(N){h.push({label:N.label,type:N.type,
value:N.value})}));m.forEach(h,d.hitch(this,function(N,p){var E={};var r=parseFloat(N.value);this.projectInfo&&this.projectInfo.projectId&&this.config.projectMultiplierFields&&(E[this.config.projectMultiplierFields.DESCRIPTION]=N.label,E[this.config.projectMultiplierFields.TYPE]=N.type,E[this.config.projectMultiplierFields.VALUE]=r,E[this.config.projectMultiplierFields.COSTINDEX]=p+1,E[this.config.projectMultiplierFields.PROJECTGUID]=this.projectInfo.projectId,B.push(new L(null,null,E)));T=this._calculateGrossAdditionalCost(N.type,
r,T);H.push({label:N.label,type:N.type,value:r})}));this.loadAdditionalCost(B);setTimeout(d.hitch(this,function(){this.calculateGrossCost(this.totalCost,!0)}),500)},_deleteLayerRow:function(){var h=this._costEscalationTable.getRows(),B=this._costEscalationTable.getData();m.forEach(B,d.hitch(this,function(H,T){H.editable&&(this._costEscalationTable.deleteRow(h[T]),this._updateGrossCost())}));0===this._costEscalationTable.getRows().length&&(B=e("th .checkbox",this.costEscalationTableNode)[0],k.contains(B,
"checked")&&k.remove(B,"checked"));this._handleActionButtonVisibility()},_createCostTypeFieldStore:function(){var h=[];h.push({name:"+",value:"+"});h.push({name:"*",value:"*"});h.push({name:"-",value:"_"});h.push({name:"%",value:"%"});this._costFieldStore=new l({idProperty:"value",data:h})},_calculateGrossAdditionalCost:function(h,B,H){switch(h){case "+":H+=B;break;case "_":H-=B;break;case "*":H*=B;break;case "%":H+=H*B/100}return H},_updateGrossCost:function(){if(!this.loadingProject){var h=this._getCostEscalationArray();
var B=this.totalCost,H=[],T=[];m.forEach(h,d.hitch(this,function(p,E){var r=parseFloat(p.value),t={};r&&(this.projectInfo&&this.projectInfo.projectId&&this.config.projectMultiplierFields&&(t[this.config.projectMultiplierFields.DESCRIPTION]=p.label,t[this.config.projectMultiplierFields.TYPE]=p.type,t[this.config.projectMultiplierFields.VALUE]=r,t[this.config.projectMultiplierFields.COSTINDEX]=E+1,t[this.config.projectMultiplierFields.PROJECTGUID]=this.projectInfo.projectId,H.push(new L(null,null,t))),
B=this._calculateGrossAdditionalCost(p.type,r,B),T.push({label:p.label,type:p.type,value:r}))}));h=this.appUtils.roundProjectCostValue(this.config.generalSettings.roundCostType,this.totalCost);h=this.config.generalSettings.currency+" "+h;c.set(this.totalCostDiv,"innerHTML",h);h=this.appUtils.roundProjectCostValue(this.config.generalSettings.roundCostType,B);h=this.config.generalSettings.currency+" "+h;c.set(this.grossCostDiv,"innerHTML",h);h=this.totalCostLabel.innerHTML.replace("*",this.nls.projectOverview.roundingLabel);
var N=this.grossCostLabel.innerHTML.replace("*",this.nls.projectOverview.roundingLabel);c.set(this.totalCostLabel,"aria-label",h.replace("*",""));c.set(this.grossCostLabel,"aria-label",N.replace("*",""));return{grossCost:B,features:H,additionalCostInfo:T}}},calculateGrossCost:function(h,B){this.totalCost=h;this.loadingProject||(h=this._updateGrossCost(),this.emit("grossCostUpdated",this.totalCost,h.grossCost,h.additionalCostInfo),B&&this._updateCostEscalationTable(h.features))},_updateCostEscalationTable:function(h){this.additionalCostTable&&
(0<h.length||0<this.previouslyAddedEscalations.length)&&(this._loadingIndicator.show(),this.additionalCostTable.applyEdits(h,null,this.previouslyAddedEscalations,d.hitch(this,function(B){var H=!1;this.previouslyAddedEscalations=[];B&&0<B.length&&(m.forEach(B,d.hitch(this,function(T){T.success?this._storeAsPreviouslyAdded(T.objectId):H=!0})),H&&this.appUtils.showMessage(this.nls.costEscalation.errorInSavingCostEscalation));this._loadingIndicator.hide()}),d.hitch(this,function(){this._loadingIndicator.hide();
this.appUtils.showMessage(this.nls.costEscalation.errorInSavingCostEscalation)})))},_storeAsPreviouslyAdded:function(h){var B={};B[this.additionalCostTable.objectIdField]=h;h=new L(null,null,B);this.previouslyAddedEscalations.push(h)},setFirstAndLastNode:function(){if(this._costEscalationTable.getRows().length){var h=e(".simple-table-title .jimu-checkbox",this.domNode)[0];h=g.byNode(h);b.initFirstFocusNode(this.widgetDomNode,h.domNode);A.focus(h.domNode)}else D.focus(this.btnAddNode),b.initFirstFocusNode(this.widgetDomNode,
this.btnAddNode);b.initLastFocusNode(this.widgetDomNode,this.cancelButton);this._addAriaLabelToTdChkBoxes()},_addAriaLabelToTdChkBoxes:function(){var h=e("td .checkbox",this.costEscalationTableNode);h&&0<h.length&&m.forEach(h,d.hitch(this,function(B){c.set(B,"aria-label",this.nls.common.label)}))}})})},"widgets/CostAnalysis/asset-details":function(){define("dojo/_base/declare dojo/_base/html jimu/BaseWidget dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./asset-details.html dojo/_base/lang dojo/dom-construct dojo/_base/array dojo/dom-class dojo/dom-attr dojo/string dojo/on dojo/query dijit/TooltipDialog dijit/popup esri/graphicsUtils ./advance-item-list ./cost-equation-editor dojo/keys dojo/_base/event dijit/focus jimu/utils".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v){return Q([J,G,u],{templateString:d,baseClass:"jimu-widget-cost-analysis-asset-details",_layerDetailsNode:{},_layerIndexes:[],_openGroups:{},postCreate:function(){this.inherited(arguments);this._layerDetailsNode={};this._openGroups={};this.listData=[];this._layerIndexes=[];w.forEach(this.config.layerSettings,c.hitch(this,function(b){if(b.editable&&this.map.getLayer(b.id)){this._openGroups[b.id]=[];this._layerDetailsNode[b.id]=a.create("div");
var D={title:this.map.getLayer(b.id).name,content:this._layerDetailsNode[b.id],icon:"",actionIcon:"",isOpen:!1,isHidden:!0};this.listData.push(D);this._layerIndexes.push(b.id)}}))},startup:function(){this.inherited(arguments);this._initItemList();this._initCostEquationEditor();this.own(z(document.body,"click",c.hitch(this,function(b){this.isPartOfPopup(b.target||b.srcElement)||this._closePopupDialog()})));this.own(z(this.okButton,"click",c.hitch(this,function(){this.emit("onOkButtonClicked")})));
this.own(z(this.okButton,"keydown",c.hitch(this,function(b){if(b.keyCode===A.ENTER||b.keyCode===A.SPACE)L.stop(b),this.emit("onOkButtonClicked")})));this.own(z(this.additionalCostBtn,"click",c.hitch(this,function(){this.emit("showAdditionalCost")})));this.own(z(this.additionalCostBtn,"keydown",c.hitch(this,function(b){if(b.keyCode===A.ENTER||b.keyCode===A.SPACE)L.stop(b),this.emit("showAdditionalCost")})))},reset:function(){for(var b in this._openGroups)this._openGroups[b]=[]},_initItemList:function(){this.itemList=
new l({itemList:this.listData,showArrow:!0,togglePanels:!0,openMultiple:!0,setAutoHeight:!0,highlighter:!0,highlighterColor:this.config.selectedThemeColor,widgetDomNode:this.widgetDomNode,nls:this.nls},a.create("div",{},this.listNode));this.own(z(this.itemList,"onActionButtonClicked",c.hitch(this,function(D){this.emit("actionClicked",D)})));this.own(z(this.itemList,"onTitleClicked",c.hitch(this,function(D){this.emit("titleClicked",D)})));this.own(z(this.itemList,"onLoad",c.hitch(this,function(){this.emit("onLoad")})));
this.itemList.startup();var b=this._createTooltipDialogContent();this.assetDetailsDialog=new n({"class":this.baseClass,content:b,style:"width : 180px"})},_createTooltipDialogContent:function(){var b=a.create("div",{},null);var D=a.create("div",{style:"height : 20px; margin: 0px"},b);D=a.create("div",{"class":"esriCTDialogIcon esriCTClose",title:this.nls.workBench.closeDialog,tabindex:"0",role:"button","aria-label":this.nls.workBench.closeDialog},D);this.own(z(D,"click",c.hitch(this,this._closePopupDialog)));
this.own(z(D,"keydown",c.hitch(this,function(B){if(B.keyCode===A.ENTER||B.keyCode===A.SPACE||B.keyCode===A.ESCAPE)L.stop(B),this._closePopupDialog()})));D=a.create("div",{"class":"esriCTRowContainer",title:this.nls.workBench.zoomToAsset,tabindex:"0",role:"button","aria-label":this.nls.workBench.zoomToAsset},b);var h=a.create("div",{"class":"esriCTRowContainer",title:this.nls.workBench.deleteAsset,tabindex:"0",role:"button","aria-label":this.nls.workBench.deleteAsset},b);a.create("div",{"class":"esriCTDialogIcon esriCTZoom"},
D);a.create("div",{"class":"esriCTTooltipDialogLabel esriCTEllipsis",innerHTML:this.nls.workBench.zoomToAsset},D);this.own(z(D,"click",c.hitch(this,function(B){L.stop(B);this._zoomToAsset();this._support508ToPopupDialog();y.focus(B.currentTarget)})));this.own(z(D,"keydown",c.hitch(this,function(B){if(B.keyCode===A.ENTER||B.keyCode===A.SPACE)L.stop(B),this._zoomToAsset(),this._support508ToPopupDialog(),y.focus(B.currentTarget);B.keyCode===A.ESCAPE&&(L.stop(B),this._closePopupDialog())})));a.create("div",
{"class":"esriCTDialogIcon esriCTDelete"},h);a.create("div",{"class":"esriCTTooltipDialogLabel",innerHTML:this.nls.workBench.deleteAsset},h);this.own(z(h,"click",c.hitch(this,this._deleteAsset)));this.own(z(h,"keydown",c.hitch(this,function(B){if(B.keyCode===A.ENTER||B.keyCode===A.SPACE)L.stop(B),this._deleteAsset();B.keyCode===A.ESCAPE&&(L.stop(B),this._closePopupDialog())})));return b},_zoomToAsset:function(){if(this.selectedRowInfo){var b=this.assetDetails[this.selectedRowInfo.layerId][this.selectedRowInfo.templateName][this.selectedRowInfo.region][this.selectedRowInfo.scenario];
var D=this.layerInfosObj.getLayerInfoById(this.selectedRowInfo.layerId).layerObject.objectIdField;b&&w.some(b,c.hitch(this,function(h){if(h.attributes[D].toString()===this.selectedRowInfo.objectId)return this.map.setExtent(m.graphicsExtent([h]).expand(1.5)),!0}))}},_deleteAsset:function(){if(this.selectedRowInfo){var b;var D=this.map.getLayer(this.selectedRowInfo.layerId);(b=this.assetDetails[this.selectedRowInfo.layerId][this.selectedRowInfo.templateName][this.selectedRowInfo.region][this.selectedRowInfo.scenario])&&
w.some(b,c.hitch(this,function(h){if(h.attributes[D.objectIdField].toString()===this.selectedRowInfo.objectId)return h._layer=D,D.applyEdits(null,null,[h]),!0}));this._closePopupDialog()}},_rowClick:function(b){b.stopPropagation();b.preventDefault();f(".esriCTRowSelected",this.assetDetailsNode).removeClass("esriCTRowSelected");q.add(b.currentTarget,"esriCTRowSelected");this.selectedRowInfo={};this.selectedRowInfo.templateName=e.get(b.currentTarget,"templateName");this.selectedRowInfo.region=e.get(b.currentTarget,
"region");this.selectedRowInfo.scenario=e.get(b.currentTarget,"scenario");this.selectedRowInfo.layerId=e.get(b.currentTarget,"layerId");this.selectedRowInfo.objectId=e.get(b.currentTarget,"objectId");this._openPopupDialog(this.assetDetailsDialog,b)},_createExpandCollapseButton:function(b,D,h,B){b=a.create("div",{"class":"esriCTToggleIcon",tabindex:"-1",role:"button","aria-label":B,"aria-expanded":"false"},b);-1===this._openGroups[h].indexOf(D)?q.add(b,"esriCTExpandIcon"):q.add(b,"esriCTCollapseIcon");
e.set(b,"groupId",D);e.set(b,"layerId",h);this.own(z(b,"click",c.hitch(this,function(H){this.expandCollapseBtnClicked(H)})));this.own(z(b,"keydown",c.hitch(this,function(H){if(H.keyCode===A.ENTER||H.keyCode===A.SPACE)L.stop(H),this.expandCollapseBtnClicked(H)})));return b},expandCollapseBtnClicked:function(b){var D=e.get(b.currentTarget,"groupId");var h=e.get(b.currentTarget,"layerId");var B=f("[tableGroupId \x3d "+D.replace(/"/g,'\\"')+"]",this.assetDetailsNode)[0];q.contains(b.currentTarget,"esriCTCollapseIcon")?
(q.replace(b.currentTarget,"esriCTExpandIcon","esriCTCollapseIcon"),q.add(B,"esriCTHidden"),this._openGroups[h].splice(this._openGroups[h].indexOf(D),1),this._TabIndexToAssetDetailsTableRows(b,"-1"),e.set(b.currentTarget,"aria-expanded","false")):(q.replace(b.currentTarget,"esriCTCollapseIcon","esriCTExpandIcon"),q.remove(B,"esriCTHidden"),this._openGroups[h].push(D),this._TabIndexToAssetDetailsTableRows(b,"0"),e.set(b.currentTarget,"aria-expanded","true"))},_createEditEquationButton:function(b,D,
h){b=a.create("div",{"class":"esriCTEditEquationIcon",tabindex:"-1",role:"button","aria-label":h+this.nls.common.edit+this.nls.workBench.costEquationTitle},b);e.set(b,"templateName",D.templateName);e.set(b,"region",D.regionName);e.set(b,"scenario",D.scenario);e.set(b,"layerId",D.layerId);e.set(b,"equation",D.equation);this.own(z(b,"click",c.hitch(this,function(B){this._editEquationBtnClicked(B)})));this.own(z(b,"keydown",c.hitch(this,function(B){if(B.keyCode===A.ENTER||B.keyCode===A.SPACE)L.stop(B),
this._editEquationBtnClicked(B)})));return b},_editEquationBtnClicked:function(b){var D={};this.currentEditEquationBtn=b.currentTarget;q.add(b.currentTarget,"esriCTEditEquationBtnClicked");D.templateName=e.get(b.currentTarget,"templateName");D.region=e.get(b.currentTarget,"region");D.scenario=e.get(b.currentTarget,"scenario");D.layerId=e.get(b.currentTarget,"layerId");D.equation=e.get(b.currentTarget,"equation");q.add(this.assetDetailsParent,"esriCTHidden");q.remove(this.costEquationEditorParent,
"esriCTHidden");this._costEquationEditor&&this._costEquationEditor.setGroupInfo(D)},_createAssetDetailsTable:function(b,D,h,B){var H=0,T=0;var N=this.layerInfosObj.getLayerInfoById(B.layerId).layerObject.objectIdField;var p=a.create("table",{style:{width:"100%"},"class":"esriCTTable"},b);-1===this._openGroups[B.layerId].indexOf(D)&&q.add(p,"esriCTHidden");e.set(p,"tableGroupId",D);var E=a.create("tbody",{},p);if("point"!==h[0].geometry.type){var r=this.appUtils.getUnitsAbbreviation(h[0].geometry.type,
this.config.generalSettings.measurementUnit);D="polygon"===h[0].geometry.type?this.nls.statisticsType.areaLabel:this.nls.statisticsType.lengthLabel}else r=this.nls.workBench.units,D=this.nls.statisticsType.countLabel;var t=a.create("tr",{},E);a.create("td",{innerHTML:this.nls.workBench.objectIdColTitle},t);a.create("td",{innerHTML:D},t);a.create("td",{innerHTML:this.nls.workBench.costColTitle},t);w.forEach(h,c.hitch(this,function(x){var F=a.create("tr",{"class":"esriCTSelectableRow",tabindex:"-1",
role:"button"},E);var K=x.featureDimension;e.set(F,"templateName",B.templateName);e.set(F,"region",B.regionName);e.set(F,"scenario",B.scenario);e.set(F,"layerId",B.layerId);e.set(F,"objectId",x.attributes[N]);this.own(z(F,"click",c.hitch(this,this._rowClick)));this.own(z(F,"keydown",c.hitch(this,function(R){if(R.keyCode===A.ENTER||R.keyCode===A.SPACE)L.stop(R),this._rowClick(R)})));"point"!==h[0].geometry.type&&(K=this.appUtils.applyRounding(K));a.create("td",{innerHTML:x.attributes[N]},F);a.create("td",
{innerHTML:K+" "+r},F);K=this.config.generalSettings.currency+" "+this.appUtils.applyRounding(x.individualCost);a.create("td",{innerHTML:K,"class":"esriCTAssetItemDetailsCostingValue"},F);H+=x.individualCost;T+=x.featureDimension}));"point"!==h[0].geometry.type&&(T=this.appUtils.applyRounding(T));this._addAriaLableToRows(p);b=a.create("table",{style:{width:"100%"},"class":"esriCTTable"},b);b=a.create("tr",{"class":"esriCTGroupSummaryTotalRow",tabindex:"-1","aria-label":"Total "+D+" "+T+" "+r+" Total "+
this.nls.workBench.costColTitle+" "+H},a.create("tbody",{},b));a.create("td",{"class":"esriCTGroupSummaryTotalTitle",innerHTML:"Total:"},b);a.create("td",{innerHTML:T+" "+r},b);H=this.config.generalSettings.currency+" "+this.appUtils.applyRounding(H);a.create("td",{innerHTML:H,"class":"esriCTGroupSummaryTotalCost"},b)},showAssetDetails:function(b,D){var h=!1;this.assetDetails=b;for(var B in this._layerDetailsNode){var H=this._layerIndexes.indexOf(B);a.empty(this._layerDetailsNode[B]);this.itemList.hide(H);
if(b.hasOwnProperty(B))for(var T in b[B])for(var N in b[B][T])for(var p in b[B][T][N]){var E=N;var r=p;var t=T+" ";var x=b[B][T][N][p];if(0<x.length){h={templateName:T,regionName:N,scenario:p,layerId:B,equation:x[0].templateInfo.COSTEQUATION};"null"===E?E=this.nls.scenarioSelection.noneText:t+=k.substitute(this.nls.assetDetails.inGeography,{geography:E});"null"===r?r=this.nls.scenarioSelection.noneText:t+=k.substitute(this.nls.assetDetails.withScenario,{scenario:r});r=B+" - "+T+" - "+E+" - "+r;r=
c.trim(r);var F=a.create("div",{"class":"esriCTGroupSummary"},this._layerDetailsNode[B]);var K=a.create("div",{"class":"esriCTGroupTitleParent"},F);E=k.substitute(this.nls.statisticsType.expandCollapseAriaLabel,{displayTitle:t,featureCount:x.length});this._createExpandCollapseButton(K,r,B,E);a.create("div",{"class":"esriCTGroupTitle",innerHTML:t+"("+x.length+")"},K);this._createEditEquationButton(K,h,t);this._createAssetDetailsTable(F,r,x,h);this.itemList.show(H);h=!0}}}h?(q.add(this.noAssetDetails,
"esriCTHidden"),e.set(this.noAssetDetails,"tabindex","-1"),this.emit("onAssetDeleted",!1)):(q.remove(this.noAssetDetails,"esriCTHidden"),e.set(this.noAssetDetails,"tabindex","0"),this.emit("onAssetDeleted",!0));setTimeout(c.hitch(this,function(){D&&this.setFirstAndLastNode()}),500)},_openPopupDialog:function(b,D){"keydown"===D.type?g.open({popup:b,around:D.currentTarget}):g.open({popup:b,x:D.pageX,y:D.pageY});this._support508ToPopupDialog()},_closePopupDialog:function(){var b=f(".esriCTRowSelected",
this.assetDetailsNode);g.close(this.assetDetailsDialog);b&&0<b.length&&(y.focus(b[0]),b.removeClass("esriCTRowSelected"))},_initCostEquationEditor:function(){this._costEquationEditor||(this._costEquationEditor=new C({nls:this.nls,map:this.map,config:this.config,appUtils:this.appUtils,widgetDomNode:this.widgetDomNode},a.create("div",{},this.costEquationEditorParent)),this.own(z(this._costEquationEditor,"onOkButtonClicked",c.hitch(this,function(b){this.emit("groupCostEquationUpdated",b);q.add(this.costEquationEditorParent,
"esriCTHidden");q.remove(this.assetDetailsParent,"esriCTHidden");this.setFirstAndLastNode();this._focusCurrentEquationEditorBtn()}))),this.own(z(this._costEquationEditor,"onCancelButtonClicked",c.hitch(this,function(){q.add(this.costEquationEditorParent,"esriCTHidden");q.remove(this.assetDetailsParent,"esriCTHidden");this.setFirstAndLastNode();this._focusCurrentEquationEditorBtn()}))),this._costEquationEditor.startup())},isPartOfPopup:function(b){var D=this.assetDetailsDialog.domNode;return b===D||
I.isDescendant(b,D)},grossCostUpdated:function(b,D,h){D=this.appUtils.roundProjectCostValue(this.config.generalSettings.roundCostType,D);D=this.config.generalSettings.currency+" "+D;e.set(this.grossCost,"innerHTML",D);this._updateAdditionalCostTable(b,h);b=this.grossCostLabel.innerHTML.replace("*",this.nls.projectOverview.roundingLabel);e.set(this.grossCostLabel,"aria-label",b.replace("*",""))},totalCostUpdated:function(b){b=this.appUtils.roundProjectCostValue(this.config.generalSettings.roundCostType,
b);b=this.config.generalSettings.currency+" "+b;e.set(this.totalCost,"innerHTML",b);b=this.totalCostLabel.innerHTML.replace("*",this.nls.projectOverview.roundingLabel);e.set(this.totalCostLabel,"aria-label",b.replace("*",""))},_updateAdditionalCostTable:function(b,D){a.empty(this.additionalCostTable);if(this.config.projectCostSettings&&0<this.config.projectCostSettings.length||0<D.length){var h=a.create("th");e.set(h,"role","heading");h.appendChild(a.create("td",{innerHTML:this.nls.assetDetails.additionalCostLabel}));
h.appendChild(a.create("td",{innerHTML:this.nls.assetDetails.additionalCostValue}));h.appendChild(a.create("td",{innerHTML:this.nls.assetDetails.additionalCostNetValue}));this.additionalCostTable.appendChild(h);for(h=0;h<D.length;h++){var B=a.create("tr",{tabindex:"0"});var H=D[h];var T=parseFloat(H.value);switch(H.type){case "+":var N=b+=T;break;case "_":N=b-=T;break;case "*":N=b*=T;break;case "%":N=b+=b*T/100}N=this.appUtils.roundProjectCostValue(this.config.generalSettings.roundCostType,N);N=this.config.generalSettings.currency+
" "+N;B.appendChild(a.create("td",{innerHTML:H.label}));B.appendChild(a.create("td",{innerHTML:H.value}));B.appendChild(a.create("td",{innerHTML:N,"class":"esriCTAssetItemDetailsNetValue"}));e.set(B,"aria-label",this.nls.assetDetails.additionalCostLabel+" "+H.label+" "+this.nls.assetDetails.additionalCostValue+" "+H.value+" "+this.nls.assetDetails.additionalCostNetValue+" "+N);this.additionalCostTable.appendChild(B)}}},_focusCurrentEquationEditorBtn:function(){var b=f(".esriCTEditEquationBtnClicked",
this.domNode);b&&0<b.length&&(y.focus(b[0]),q.remove(this.currentEditEquationBtn,"esriCTEditEquationBtnClicked"))},setFirstAndLastNode:function(b){var D,h,B,H,T,N,p;var E=0;q.contains(this.noAssetDetails,"esriCTHidden")?(D=f(".esriCTItem",this.assetDetailsNode))&&0<D.length&&D.forEach(c.hitch(this,function(r){"none"!==r.style.display&&(E||(E=1,v.initFirstFocusNode(this.widgetDomNode,r.children[0]),y.focus(r.children[0])),h=f(".esriCTItemTitle",r)[0],B=f(".esriCTItemContent",r)[0],H=f(".esriCTToggleIcon",
r),T=f(".esriCTEditEquationIcon",r),N=f(".esriCTSelectableRow",r),p=f(".esriCTGroupSummaryTotalRow",r),h&&B&&(q.contains(B,"esriCTItemContentActive")?(this.itemList._setTabIndexToNodes(H,"0"),this.itemList._setTabIndexToNodes(T,"0"),this.itemList._setTabIndexToNodes(N,"0"),this.itemList._setTabIndexToNodes(p,"0")):(this.itemList._setTabIndexToNodes(H,"-1"),this.itemList._setTabIndexToNodes(T,"-1"),this.itemList._setTabIndexToNodes(N,"-1"),this.itemList._setTabIndexToNodes(p,"-1"))))})):(y.focus(this.noAssetDetails),
v.initFirstFocusNode(this.widgetDomNode,this.noAssetDetails));v.initLastFocusNode(this.widgetDomNode,this.okButton);b&&!q.contains(this.costEquationEditorParent,"esriCTHidden")&&this._costEquationEditor._add508SupportCostEquationEditor()},_support508ToPopupDialog:function(){var b=f(".esriCTDialogIcon",this.assetDetailsDialog.domNode);b&&0<b.length&&(v.initFirstFocusNode(b[0]),y.focus(b[0]),v.initLastFocusNode(b[2]))},_TabIndexToAssetDetailsTableRows:function(b,D){var h=f(".esriCTSelectableRow",b.currentTarget.parentNode.parentNode);
b=f(".esriCTGroupSummaryTotalRow",b.currentTarget.parentNode.parentNode);h&&0<h.length&&w.forEach(h,c.hitch(this,function(B){e.set(B,"tabindex",D)}));b&&0<b.length&&w.forEach(b,c.hitch(this,function(B){e.set(B,"tabindex",D)}))},_addAriaLableToRows:function(b){for(var D=b.rows[0].cells[1].innerHTML,h=1;h<b.rows.length;h++){for(var B=this.nls.workBench.objectIdColTitle,H=0;H<b.rows[h].cells.length;H++)0===H&&(B=B+" "+b.rows[h].cells[H].innerHTML),1===H&&(B=B+" "+D+" "+b.rows[h].cells[H].innerHTML),
2===H&&(B=B+" "+this.nls.workBench.costColTitle+" "+b.rows[h].cells[H].innerHTML);e.set(b.rows[h],"aria-label",B)}}})})},"widgets/CostAnalysis/cost-equation-editor":function(){define("dojo/_base/declare jimu/BaseWidget dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./cost-equation-editor.html dojo/_base/lang dojo/_base/array dojo/on dojo/dom-attr dojo/dom-class jimu/utils dojo/keys dojo/_base/event dijit/focus dijit/form/Textarea dijit/form/TextBox jimu/dijit/formSelect".split(" "),function(Q,
I,J,G,u,d,c,a,w,q,e,k,z,f){return Q([I,J,G],{templateString:u,baseClass:"jimu-widget-cost-analysis-equation-editor",_groupInfo:null,postCreate:function(){this.inherited(arguments);w.set(this.costEquationHint,"innerHTML",this.nls.workBench.costingInfoHintText);var n=e.stripHTML(this.nls.workBench.costingInfoHintText);w.set(this.costEquationHint,"aria-label",n)},startup:function(){this.inherited(arguments);this.own(a(this.okButton,"click",d.hitch(this,this._onOkButtonClicked)));this.own(a(this.okButton,
"keydown",d.hitch(this,function(n){if(n.keyCode===k.ENTER||n.keyCode===k.SPACE)z.stop(n),this._onOkButtonClicked()})));this.own(a(this.cancelButton,"click",d.hitch(this,function(){this.emit("onCancelButtonClicked")})));this.own(a(this.cancelButton,"keydown",d.hitch(this,function(n){if(n.keyCode===k.ENTER||n.keyCode===k.SPACE)z.stop(n),this.emit("onCancelButtonClicked")})));this.own(a(this.newCostEquationValue,"change",d.hitch(this,this._onEquationChange)));this.own(a(this.scenarioValue,"change",d.hitch(this,
this._onScenarioChange)))},_onOkButtonClicked:function(){var n={};q.contains(this.newCostEquationParent,"esriCTInvalidEquation")?this.appUtils.showMessage(this.nls.workBench.errorInvalidCostEquation):(n=this.scenarioValue._getSelectedOptionsAttr(),this._groupInfo.scenario!==n.scenario||this._groupInfo.equation.toUpperCase()!==this.newCostEquationValue.get("value").toUpperCase()?(n={templateInfo:{COSTEQUATION:this.newCostEquationValue.get("value"),SCENARIO:n.scenario},groupInfo:this._groupInfo},this.emit("onOkButtonClicked",
n)):this.emit("onCancelButtonClicked"))},_onEquationChange:function(){var n=!1;var g=e.sanitizeHTML(this.newCostEquationValue.get("value"));(n=this.appUtils.validateEquation(g))?(this.newCostEquationValue.set("value",g),q.remove(this.newCostEquationParent,"esriCTInvalidEquation")):q.add(this.newCostEquationParent,"esriCTInvalidEquation")},_onScenarioChange:function(){var n=this.scenarioValue._getSelectedOptionsAttr();this.newCostEquationValue.set("value",this._groupInfo.scenario===n.scenario?this._groupInfo.equation:
n.costEquation);this.defaultCostEquationValue.set("value",n.defaultEquation)},setGroupInfo:function(n){var g=n.region;var m=n.scenario;"null"===g&&(g=this.nls.scenarioSelection.noneText);this._groupInfo=n;this.geographyValue.set("value",g);n=this._getConfiguredCostEquations(n.layerId,n.templateName,n.region,m);this.scenarioValue.set("options",[]);this.scenarioValue.addOption(n);this._add508SupportCostEquationEditor()},_getConfiguredCostEquations:function(n,g,m,l){var C;var A=[];var L=[];this.config.costingInfoSettings.hasOwnProperty(n)&&
(A=this.config.costingInfoSettings[n]);"null"===m&&(m="");c.forEach(A,d.hitch(this,function(y){if(y.geography===m&&y.featureTemplate===g){var v;var b=v=y.scenario;v||(v=this.nls.scenarioSelection.noneText,b="null");v={label:v,value:y.costEquation,costEquation:y.costEquation,defaultEquation:y.costEquation,scenario:b,selected:!1};l===b&&(v.selected=!0,this.newCostEquationValue.set("value",this._groupInfo.equation),this.defaultCostEquationValue.set("value",y.costEquation));L.push(v)}""===y.geography&&
""===y.scenario&&y.featureTemplate===g&&(C=y.costEquation)}));0===L.length&&(L.push({label:this.nls.scenarioSelection.noneText,value:this._groupInfo.equation,costEquation:this._groupInfo.equation,defaultEquation:C,scenario:"null",selected:!0}),this.newCostEquationValue.set("value",this._groupInfo.equation),this.defaultCostEquationValue.set("value",C));return L},_add508SupportCostEquationEditor:function(){e.initFirstFocusNode(this.widgetDomNode,this.geographyValue.textbox);f.focus(this.geographyValue.textbox);
e.initLastFocusNode(this.widgetDomNode,this.cancelButton)}})})},"dijit/form/Textarea":function(){define(["dojo/_base/declare","dojo/dom-style","./_ExpandingTextAreaMixin","./SimpleTextarea"],function(Q,I,J,G){return Q("dijit.form.Textarea",[G,J],{baseClass:"dijitTextBox dijitTextArea dijitExpandingTextArea",cols:"",buildRendering:function(){this.inherited(arguments);I.set(this.textbox,{overflowY:"hidden",overflowX:"auto",boxSizing:"border-box",MsBoxSizing:"border-box",WebkitBoxSizing:"border-box",
MozBoxSizing:"border-box"})}})})},"dijit/form/_ExpandingTextAreaMixin":function(){define("dojo/_base/declare dojo/dom-construct dojo/has dojo/_base/lang dojo/on dojo/_base/window ../Viewport".split(" "),function(Q,I,J,G,u,d,c){J.add("textarea-needs-help-shrinking",function(){var a=d.body(),w=I.create("textarea",{rows:"5",cols:"20",value:" ",style:{zoom:1,fontSize:"12px",height:"96px",overflow:"hidden",visibility:"hidden",position:"absolute",border:"5px solid white",margin:"0",padding:"0",boxSizing:"border-box",
MsBoxSizing:"border-box",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box"}},a,"last"),q=w.scrollHeight>=w.clientHeight;a.removeChild(w);return q});return Q("dijit.form._ExpandingTextAreaMixin",null,{_setValueAttr:function(){this.inherited(arguments);this.resize()},postCreate:function(){this.inherited(arguments);var a=this.textbox;a.style.overflowY="hidden";this.own(u(a,"focus, resize",G.hitch(this,"_resizeLater")))},startup:function(){this.inherited(arguments);this.own(c.on("resize",G.hitch(this,
"_resizeLater")));this._resizeLater()},_onInput:function(a){this.inherited(arguments);this.resize()},_estimateHeight:function(){var a=this.textbox;a.rows=(a.value.match(/\n/g)||[]).length+1},_resizeLater:function(){this.defer("resize")},resize:function(){function a(){var g=!1;""===w.value&&(w.value=" ",g=!0);var m=w.scrollHeight;g&&(w.value="");return m}var w=this.textbox;"hidden"==w.style.overflowY&&(w.scrollTop=0);if(!this.busyResizing){this.busyResizing=!0;if(a()||w.offsetHeight){var q=a()+Math.max(w.offsetHeight-
w.clientHeight,0),e=q+"px";e!=w.style.height&&(w.style.height=e,w.rows=1);if(J("textarea-needs-help-shrinking")){var k=a(),z=w.style.minHeight,f=4,n=w.scrollTop;w.style.minHeight=e;for(w.style.height="auto";0<q;){w.style.minHeight=Math.max(q-f,4)+"px";e=a();k-=e;q-=k;if(k<f)break;k=e;f<<=1}w.style.height=q+"px";w.style.minHeight=z;w.scrollTop=n}w.style.overflowY=a()>w.clientHeight?"auto":"hidden";"hidden"==w.style.overflowY&&(w.scrollTop=0)}else this._estimateHeight();this.busyResizing=!1}}})})},
"widgets/CostAnalysis/add-new-statistics":function(){define("dojo/_base/declare jimu/BaseWidget jimu/utils dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./add-new-statistics.html dojo/_base/lang dojo/on dojo/dom-construct ./setting/StatisticsSettings dojo/_base/array dojo/query dojo/keys dojo/_base/event".split(" "),function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f){return Q([I,G,u],{templateString:d,baseClass:"jimu-widget-cost-analysis-add-new-statistics",_projectOverview:null,_lastConfiguredStatistics:null,
addNewStatisticsObj:null,postCreate:function(){this.inherited(arguments);this.addNewStatisticsObj=this._lastConfiguredStatistics=this._projectOverview=null},startup:function(){this.inherited(arguments);this._lastConfiguredStatistics=c.clone(this.config);this._lastConfiguredStatistics.statisticsSettings=[];this._initAddNewStatistics();this.own(a(this.okButtonNode,"click",c.hitch(this,function(){this._lastConfiguredStatistics.statisticsSettings=this.addNewStatisticsObj.getConfig();this.emit("updateStatisticsDetail",
this._getUpdatedStatistics());this.emit("showAssetStatisticsPanel")})));this.own(a(this.okButtonNode,"keydown",c.hitch(this,function(n){if(n.keyCode===z.ENTER||n.keyCode===z.SPACE)f.stop(n),this._lastConfiguredStatistics.statisticsSettings=this.addNewStatisticsObj.getConfig(),this.emit("updateStatisticsDetail",this._getUpdatedStatistics()),this.emit("showAssetStatisticsPanel")})));this.own(a(this.cancelButtonNode,"click",c.hitch(this,function(){this.emit("showAssetStatisticsPanel")})));this.own(a(this.cancelButtonNode,
"keydown",c.hitch(this,function(n){if(n.keyCode===z.ENTER||n.keyCode===z.SPACE)f.stop(n),this.emit("showAssetStatisticsPanel")})))},reset:function(){this._lastConfiguredStatistics=c.clone(this.config);this._lastConfiguredStatistics.statisticsSettings=[];this._initAddNewStatistics();this.emit("updateStatisticsDetail",[])},_initAddNewStatistics:function(){this.addNewStatisticsObj&&this.addNewStatisticsObj.destroy();this.addNewStatisticsObj=new q({nls:this.nls,map:this.map,config:this._lastConfiguredStatistics,
layerInfosObj:this.layerInfosObj,showActionButtonsInColumn:!1,showActionButtonsInRow:!0,widgetDomNode:this.widgetDomNode},w.create("div",{},this.addNewStatisticsNode));this.addNewStatisticsObj.startup();this.addNewStatisticsObj.resetAddNewStatisticsDropdown()},_getUpdatedStatistics:function(){var n;var g=[];var m=k(".simple-table-row",this.assetsListNode);e.forEach(m,c.hitch(this,function(l){l.layerNameDropDown&&l.statisticsTypeDropdown&&l.layerFieldDropdown&&l.statisticsLabelTextBox&&(n={},n.id=
l.layerNameDropDown.get("value"),n.type=l.statisticsTypeDropdown.get("value"),n.field=l.layerFieldDropdown.get("value"),n.label=J.sanitizeHTML(l.statisticsLabelTextBox.get("value")),g.push(n))}));return g}})})},"widgets/CostAnalysis/setting/StatisticsSettings":function(){define("dojo/_base/declare jimu/BaseWidget jimu/dijit/SimpleTable dojo/on dojo/_base/array dojo/query dojo/dom-construct jimu/dijit/formSelect dijit/form/ValidationTextBox dijit/_WidgetsInTemplateMixin dojo/text!./StatisticsSettings.html dojo/_base/lang dojo/store/Memory dojo/dom-class dijit/registry dojo/_base/html dojo/dom-style ./ProjectCost dojo/keys dojo/dom-attr dijit/focus jimu/utils dojo/_base/event".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v){return Q([I,q],{templateString:e,baseClass:"jimu-widget-cost-analysis-statistics-settings",_layerNameStore:null,_commonStatisticsStoreOption:null,_polygonStatisticsStoreOption:null,_polylineStatisticsStoreOption:null,_pointLayerStatisticsStore:null,_polygonLayerStatisticsStore:null,_polylineLayerStatisticsStore:null,_layerFieldStore:{},_shapeFields:"shape_length shape_area shape__length shape__area shape.len shape.area".split(" "),_editableConfiguredLayers:[],
constructor:function(b){k.mixin(this,b)},postMixInProperties:function(){this.nls.common={};k.mixin(this.nls.common,window.jimuNls.common)},postCreate:function(){this._polylineLayerStatisticsStore=this._polygonLayerStatisticsStore=this._pointLayerStatisticsStore=this._polylineStatisticsStoreOption=this._polygonStatisticsStoreOption=this._commonStatisticsStoreOption=this._layerNameStore=null;this._layerFieldStore={};this._editableConfiguredLayers=[];this.inherited(arguments);this._init();this._handleClickEvent();
this.showActionButtonsInColumn&&this._createProjectCostTable()},_createProjectCostTable:function(){this.additionalProjectCostObj=new l({nls:this.nls,map:this.map,config:this.config},c.create("div",{},this.additionalProjectCostWrapper));this.additionalProjectCostObj.startup()},_handleClickEvent:function(){this._addButtonClick();this._crossButtonClick();this._upButtonClick();this._downButtonClick()},_init:function(){for(var b in this.config.layerSettings)this.config.layerSettings[b].editable&&this._editableConfiguredLayers.push(this.config.layerSettings[b].id);
this._createStatisticsStoreOptions();this._createStatisticsTable();this._layerNameStore||this._createLayerNameStore();this._attachNodeEvents();this._setConfig();this._displayAddStatisticsButtonOrLabel();this._handleActionButtonVisibility();0===this._editableConfiguredLayers.length&&(f.remove(this.noEditableLayersAvailable,"esriCTHidden"),f.add(this.btnAddStatisticsNodeWrapper,"esriCTHidden"),f.add(this.statisticsLayerTableNode,"esriCTHidden"),f.add(this.additionalProjectCostWrapper,"esriCTHidden"))},
_displayAddStatisticsButtonOrLabel:function(){this.showActionButtonsInColumn?f.remove(this.btnAddStatisticsNodeWrapper,"esriCTHidden"):f.add(this.btnAddStatisticsNodeWrapper,"esriCTHidden")},_setConfig:function(){this.config&&this.config.statisticsSettings&&0<this.config.statisticsSettings.length&&u.forEach(this.config.statisticsSettings,k.hitch(this,function(b){this._addLayerRow(b)}))},getConfig:function(){var b=this._statisticsLayerTable.getRows();var D=[];u.forEach(b,k.hitch(this,function(h){D.push({id:h.layerNameDropDown.getValue(),
type:h.statisticsTypeDropdown.getValue(),field:h.layerFieldDropdown.getValue(),label:h.statisticsLabelTextBox.getValue()})}));this.additionalProjectCostObj&&this.additionalProjectCostObj.getConfig();return D},_createStatisticsStoreOptions:function(){this._commonStatisticsStoreOption=[{name:this.nls.statisticsType.averageLabel,value:"avg"},{name:this.nls.statisticsType.countLabel,value:"count"},{name:this.nls.statisticsType.maxLabel,value:"max"},{name:this.nls.statisticsType.minLabel,value:"min"},
{name:this.nls.statisticsType.summationLabel,value:"sum"}];this._polygonStatisticsStoreOption=[{name:this.nls.statisticsType.areaLabel,value:"area"}];this._polylineStatisticsStoreOption=[{name:this.nls.statisticsType.lengthLabel,value:"length"}]},_attachNodeEvents:function(){0===this._layerNameStore.data.length?(f.remove(this.noEditableLayersAvailable,"esriCTHidden"),f.add(this.btnAddStatisticsNodeWrapper,"esriCTHidden"),f.add(this.statisticsLayerTableNode,"esriCTHidden")):(f.add(this.noEditableLayersAvailable,
"esriCTHidden"),f.remove(this.btnAddStatisticsNodeWrapper,"esriCTHidden"),f.remove(this.statisticsLayerTableNode,"esriCTHidden"));this.own(G(this.btnAddStatisticsNode,"click",k.hitch(this,function(){this._layerNameStore.data.length&&(this._addStatisticsBtnClicked(),this.resetAddNewStatisticsDropdown())})));this.own(G(this.btnAddStatisticsNode,"keydown",k.hitch(this,function(b){if(b.keyCode===C.ENTER||b.keyCode===C.SPACE)v.stop(b),this._layerNameStore.data.length&&(this._addStatisticsBtnClicked(),
this.resetAddNewStatisticsDropdown())})))},_createStatisticsTable:function(){this._statisticsLayerTable=new J({fields:[{name:"editable",title:this.nls.statisticsSettings.selectDeselectAllTitle,type:"checkbox",editable:!1,width:this.showActionButtonsInRow?"16px":"0%",hidden:!this.showActionButtonsInRow},{name:"field",title:this.nls.common.layer,type:"empty",editable:!1,width:"30%"},{name:"field",title:this.nls.common.type,type:"empty",editable:!0,width:this.showActionButtonsInRow?"19%":"18%"},{name:"field",
title:this.nls.statisticsSettings.fieldNameTitle,type:"empty",editable:!1,width:"22%"},{name:"field",title:this.nls.statisticsSettings.statisticsTitle,type:"empty",editable:!1,width:this.showActionButtonsInRow?"55px":"20%"},{name:"actions",title:this.nls.common.actions,width:"10%",type:"actions",actions:["up","down","delete"],hidden:!this.showActionButtonsInColumn}],selectable:!1});this._statisticsLayerTable.placeAt(this.statisticsLayerTableNode);this._statisticsLayerTable.startup();var b=d(".esriCTAddLayerTableNode th .label")[0];
var D=d(".esriCTAddLayerTableNode th .jimu-checkbox")[0];d(".esriCTAddLayerTableNode tr .jimu-checkbox");D&&f.add(D,"esriCTStatisticsHeaderCheckBox");b&&f.add(b,"esriCTHidden")},_addButtonClick:function(){!0===this.showActionButtonsInRow?(f.remove(this.btnAddNode,"esriCTHidden"),this.own(G(this.btnAddNode,"click",k.hitch(this,function(){this._addStatisticsButtonClickEvent()}))),this.own(G(this.btnAddNode,"keydown",k.hitch(this,function(b){if(b.keyCode===C.ENTER||b.keyCode===C.SPACE)v.stop(b),this._addStatisticsButtonClickEvent()})))):
f.add(this.btnAddNode,"esriCTHidden")},_addStatisticsButtonClickEvent:function(){if(this._layerNameStore.data.length&&(this._addStatisticsBtnClicked(),this._handleActionButtonVisibility(),this.resetAddNewStatisticsDropdown(),this.widgetDomNode)){var b=this._statisticsLayerTable.getRows();0<=b.length&&(b=d(".jimu-checkbox",b[b.length-1])[0],L.focus(b))}},_crossButtonClick:function(){f.remove(this.btnCrossNode,"esriCTHidden");this.own(G(this.btnCrossNode,"click",k.hitch(this,this._deleteLayerRow)));
this.own(G(this.btnCrossNode,"keydown",k.hitch(this,function(b){if(b.keyCode===C.ENTER||b.keyCode===C.SPACE)v.stop(b),this._deleteLayerRow()})))},_upButtonClick:function(){f.remove(this.btnUpNode,"esriCTHidden");this.own(G(this.btnUpNode,"click",k.hitch(this,function(){this._upButtonClickEvent()})));this.own(G(this.btnUpNode,"keydown",k.hitch(this,function(b){if(b.keyCode===C.ENTER||b.keyCode===C.SPACE)v.stop(b),this._upButtonClickEvent()})))},_upButtonClickEvent:function(){var b;if(!f.contains(this.btnUpNode,
"esriCTStatisticsUpIconDisable")){var D=this._statisticsLayerTable.getRows();var h=this._statisticsLayerTable.getData();u.forEach(h,k.hitch(this,function(B,H){B.editable&&(b=D[H])}));this._statisticsLayerTable.onBeforeRowUp(b)&&(h=u.indexOf(D,b),0<h&&(h=D[h-1]))&&(g.place(b,h,"before"),this._statisticsLayerTable.updateUI(),this._statisticsLayerTable.emit("row-up",b))}},_downButtonClick:function(){f.remove(this.btnDownNode,"esriCTHidden");this.own(G(this.btnDownNode,"click",k.hitch(this,function(){this._downButtonClickEvent()})));
this.own(G(this.btnDownNode,"keydown",k.hitch(this,function(b){if(b.keyCode===C.ENTER||b.keyCode===C.SPACE)v.stop(b),this._downButtonClickEvent()})))},_downButtonClickEvent:function(){var b;if(!f.contains(this.btnDownNode,"esriCTStatisticsDownIconDisable")){var D=this._statisticsLayerTable.getRows();var h=this._statisticsLayerTable.getData();u.forEach(h,k.hitch(this,function(B,H){B.editable&&(b=D[H])}));this._statisticsLayerTable.onBeforeRowDown(b)&&(h=u.indexOf(D,b),h<D.length-1&&(h=D[h+1]))&&(g.place(b,
h,"after"),this._statisticsLayerTable.updateUI(),this._statisticsLayerTable.emit("row-down",b))}},_deleteLayerRow:function(){var b=this._statisticsLayerTable.getRows(),D=this._statisticsLayerTable.getData();u.forEach(D,k.hitch(this,function(h,B){h.editable&&this._statisticsLayerTable.deleteRow(b[B])}));0===this._statisticsLayerTable.getRows().length&&(D=d("th .checkbox")[0],f.contains(D,"checked")&&f.remove(D,"checked"));this._handleActionButtonVisibility()},_checkEditCapabilities:function(b){var D;
return(D=b&&b.capabilities?b.capabilities:null)&&-1!==D.indexOf("Delete")&&-1!==D.indexOf("Create")&&-1!==D.indexOf("Update")&&b.globalIdField?!0:!1},_addStatisticsBtnClicked:function(){this._addLayerRow();var b=d(".simple-table-title .jimu-checkbox",this.domNode)[0];G(n.byNode(b),"change",k.hitch(this,function(){setTimeout(k.hitch(this,function(){this._handleActionButtonVisibility()}),0)}))},_handleActionButtonVisibility:function(){var b,D=0;var h=this._statisticsLayerTable.getRows();var B=d(".simple-table-title .jimu-checkbox",
this.domNode)[0];B=n.byNode(B);u.some(this._statisticsLayerTable.getRows(),k.hitch(this,function(H){b=d(".jimu-checkbox",H)[0];n.byNode(b).checked&&D++}));0===D?(f.replace(this.btnCrossNode,"esriCTDeleteStatisticsIconDisable","esriCTDeleteStatisticsIcon"),A.set(this.btnCrossNode,"tabindex","-1")):(f.replace(this.btnCrossNode,"esriCTDeleteStatisticsIcon","esriCTDeleteStatisticsIconDisable"),A.set(this.btnCrossNode,"tabindex","0"));h&&1===D?(f.replace(this.btnUpNode,"esriCTStatisticsUpIcon","esriCTStatisticsUpIconDisable"),
f.replace(this.btnDownNode,"esriCTStatisticsDownIcon","esriCTStatisticsDownIconDisable"),A.set(this.btnUpNode,"tabindex","0"),A.set(this.btnDownNode,"tabindex","0")):(f.replace(this.btnUpNode,"esriCTStatisticsUpIconDisable","esriCTStatisticsUpIcon"),f.replace(this.btnDownNode,"esriCTStatisticsDownIconDisable","esriCTStatisticsDownIcon"),A.set(this.btnUpNode,"tabindex","-1"),A.set(this.btnDownNode,"tabindex","-1"));0===h.length?(B.set("status",!1),f.add(B.domNode,"jimu-state-disabled"),A.set(B.domNode,
"tabindex","-1"),this.widgetDomNode&&(L.focus(this.btnAddNode),y.initFirstFocusNode(this.widgetDomNode,this.btnAddNode))):(B.set("status",!0),f.remove(B.domNode,"jimu-state-disabled"),A.set(B.domNode,"tabindex","0"),this.widgetDomNode&&y.initFirstFocusNode(this.widgetDomNode,B.domNode))},_addLayerRow:function(b){var D=this._statisticsLayerTable.addRow({});var h=d(".simple-table-cell",D.tr);var B=d(".simple-table-cell .jimu-checkbox",D.tr)[0];A.set(B,"aria-label",this.nls.statisticsSettings.layerCheckbox);
h&&(B&&G(n.byNode(B),"change",k.hitch(this,function(){this._handleActionButtonVisibility()})),D=D.tr,this._addLayerNameDropdown(h[1],D,b),this._addStatisticsDropdown(h[2],D,b),this._addLayerFieldDropdown(h[3],D,b),this._addStatisticsLabelTextBox(h[4],D,b))},_onLayerNameChange:function(b,D,h){if(this._layerNameStore.data.length){var B=this._layerNameStore.data[this._layerNameStore.index[b]].geometryType;B=this._getStatisticsTypeStore(B);D.statisticsTypeDropdown.setStore(B);h&&h.type&&D.statisticsTypeDropdown.set("value",
h.type);h=D.statisticsTypeDropdown.getValue();b=this._layerNameStore.data[this._layerNameStore.index[b]].value;this._layerFieldStore[b]||this._createFieldStore(b);D.layerFieldDropdown.setStore(this._layerFieldStore[b]);D.layerFieldDropdown.reset();this._onStatisticsTypeChange(h,D)}},_onStatisticsTypeChange:function(b,D,h){"count"===b||"length"===b||"area"===b?f.add(D.layerFieldDropdown.domNode,"esriCTHidden"):(f.remove(D.layerFieldDropdown.domNode,"esriCTHidden"),h&&h.field&&D.layerFieldDropdown.set("value",
h.field));this._resetStatisticsTypeWidth(D)},_addLayerNameDropdown:function(b,D,h){b=c.create("div",{"class":"esriCTDropDownContainer"},b);D.layerNameDropDown=new a({name:"layerSelect",store:this._layerNameStore,labelAttr:"name","class":"esriCTLayerNameDropdown"},b);h&&h.id&&D.layerNameDropDown.set("value",h.id);this.own(G(D.layerNameDropDown,"click",k.hitch(this,function(){this._resetLayerNameWidth(D)})));this.own(G(D.layerNameDropDown,"keydown",k.hitch(this,function(B){if(B.keyCode===C.ENTER||B.keyCode===
C.SPACE)v.stop(B),this._resetLayerNameWidth(D)})));this.own(G(D.layerNameDropDown,"change",k.hitch(this,function(B){A.set(D.layerNameDropDown,"aria-label",this.nls.common.layer+" "+D.layerNameDropDown._getSelectedOptionsAttr().label);this._resetLayerNameWidth(D);this._onLayerNameChange(B,D,h)})));D.layerNameDropDown.startup();A.set(D.layerNameDropDown,"aria-label",this.nls.common.layer+" "+D.layerNameDropDown._getSelectedOptionsAttr().label)},_createLayerNameStore:function(){var b=[];var D=[];b=[this.config.projectSettings.costingGeometryLayer||
"",this.config.projectSettings.projectLayer||"",this.config.projectSettings.pointLayerCentroid||""];if(this.config.layerSettings.length&&this._editableConfiguredLayers.length){var h=this.config.layerSettings;u.forEach(h,k.hitch(this,function(B){b.push(B.id);var H=this._getFeatureLayerGeometryType(B.id);B.editable&&H&&D.push({name:B.title,value:B.id,geometryType:H})}))}this._layerNameStore=new z({idProperty:"value",data:D});D.length&&this._updateLayerNameOptions()},_updateLayerNameOptions:function(){var b;
var D=d(".esriCTLayerNameDropdown",this.domNode);u.forEach(D,k.hitch(this,function(h){b=n.byNode(h).get("value");n.byNode(h).set("store",this._layerNameStore);n.byNode(h).set("value",b)}));0===this._editableConfiguredLayers.length?(f.remove(this.noEditableLayersAvailable,"esriCTHidden"),f.add(this.btnAddStatisticsNodeWrapper,"esriCTHidden"),f.add(this.statisticsLayerTableNode,"esriCTHidden"),f.add(this.additionalProjectCostWrapper,"esriCTHidden")):(f.add(this.noEditableLayersAvailable,"esriCTHidden"),
f.remove(this.btnAddStatisticsNodeWrapper,"esriCTHidden"),f.remove(this.statisticsLayerTableNode,"esriCTHidden"),f.remove(this.additionalProjectCostWrapper,"esriCTHidden"))},_getFeatureLayerGeometryType:function(b){var D=u.filter(this.map.webMapResponse.itemInfo.itemData.operationalLayers,k.hitch(this,function(h){return b===h.id}));return D.length&&D[0].layerObject?D[0].layerObject.geometryType:null},_createStatisticsTypeStore:function(){this._pointLayerStatisticsStore||this._polygonLayerStatisticsStore||
this._polylineLayerStatisticsStore||(this._createPointGeometryStatisticsStore(),this._createPolygonGeometryStatisticsStore(),this._createPolylineGeometryStatisticsStore())},_getStatisticsTypeStore:function(b){switch(b){case "esriGeometryPolygon":return this._polygonLayerStatisticsStore;case "esriGeometryPolyline":return this._polylineLayerStatisticsStore;case "esriGeometryPoint":return this._pointLayerStatisticsStore}},_addStatisticsDropdown:function(b,D,h){b=c.create("div",{"class":"esriCTDropDownContainer"},
b);this._createStatisticsTypeStore();var B=D.layerNameDropDown._getSelectedOptionsAttr().item.geometryType;B=this._getStatisticsTypeStore(B);D.statisticsTypeDropdown=new a({name:"statisticsTypeSelect",store:B,labelAttr:"name","class":"esriCTStatisticsTypeDropdown"},b);this.own(G(D.statisticsTypeDropdown,"click",k.hitch(this,function(){this._resetStatisticsTypeWidth(D)})));this.own(G(D.statisticsTypeDropdown,"keydown",k.hitch(this,function(H){if(H.keyCode===C.ENTER||H.keyCode===C.SPACE)v.stop(H),this._resetStatisticsTypeWidth(D)})));
this.own(G(D.statisticsTypeDropdown,"change",k.hitch(this,function(H){this._resetStatisticsTypeWidth(D);this._onStatisticsTypeChange(H,D,h);A.set(D.statisticsTypeDropdown,"aria-label","type "+D.statisticsTypeDropdown._getSelectedOptionsAttr().label)})));A.set(D.statisticsTypeDropdown,"aria-label","Type "+D.statisticsTypeDropdown._getSelectedOptionsAttr().label);D.statisticsTypeDropdown.startup()},_createPointGeometryStatisticsStore:function(){this._pointLayerStatisticsStore=new z({idProperty:"value",
data:this._commonStatisticsStoreOption})},_createPolygonGeometryStatisticsStore:function(){this._polygonLayerStatisticsStore=new z({idProperty:"value",data:this._commonStatisticsStoreOption.concat(this._polygonStatisticsStoreOption)})},_createPolylineGeometryStatisticsStore:function(){this._polylineLayerStatisticsStore=new z({idProperty:"value",data:this._commonStatisticsStoreOption.concat(this._polylineStatisticsStoreOption)})},_createFieldStore:function(b){var D=[];var h=["esriFieldTypeDouble",
"esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSmallFloat"];this._layerFieldStore[b]||(u.forEach(this.map._layers[b].fields,k.hitch(this,function(B){-1<h.indexOf(B.type)&&-1===this._shapeFields.indexOf(B.name.toLowerCase())&&D.push({name:B.alias||B.name,value:B.name})})),0===D.length&&D.push({name:"\x26nbsp",value:null}),this._layerFieldStore[b]=new z({idProperty:"value",data:D}))},_addLayerFieldDropdown:function(b,D){b=c.create("div",{"class":"esriCTDropDownContainer"},b);var h=
D.layerNameDropDown._getSelectedOptionsAttr().value;this._createFieldStore(h);D.layerFieldDropdown=new a({name:"layerFieldDropdown",store:this._layerFieldStore[h],labelAttr:"name","class":"esriCTStatisticsFieldDropdown"},b);this.own(G(D.layerFieldDropdown,"click",k.hitch(this,function(){this._resetLayerFieldWidth(D)})));this.own(G(D.layerFieldDropdown,"keydown",k.hitch(this,function(B){if(B.keyCode===C.ENTER||B.keyCode===C.SPACE)v.stop(B),this._resetLayerFieldWidth(D)})));this.own(G(D.layerFieldDropdown,
"change",k.hitch(this,function(){this._resetLayerFieldWidth(D);A.set(D.layerFieldDropdown,"aria-label",this.nls.statisticsSettings.fieldNameTitle+" "+D.layerFieldDropdown.value)})));D.layerFieldDropdown.startup();b=D.statisticsTypeDropdown.getValue();this._onStatisticsTypeChange(b,D);A.set(D.layerFieldDropdown,"aria-label",this.nls.statisticsSettings.fieldNameTitle+" "+D.layerFieldDropdown.value)},_addStatisticsLabelTextBox:function(b,D,h){b=c.create("div",{"class":"esriCTTextBoxContainer"},b);D.statisticsLabelTextBox=
new w({"class":"esriCTLayerLabelTextBox"},b);h&&h.label&&D.statisticsLabelTextBox.set("value",h.label);D.statisticsLabelTextBox.startup();A.set(D.statisticsLabelTextBox,"aria-label",this.nls.statisticsSettings.statisticsTitle+" "+D.statisticsLabelTextBox.get("value"))},_updateStatisticsTable:function(b){var D,h;b.layerId&&(b.editable?D=b.layerId:h=b.layerId);h&&(b=this._statisticsLayerTable.getRows(),u.forEach(b,k.hitch(this,function(B){B.layerNameDropDown&&B.layerNameDropDown.get("value")===h&&this._statisticsLayerTable.deleteRow(B)})),
this._layerNameStore.remove(h),b=this._editableConfiguredLayers.indexOf(h),-1!==b&&this._editableConfiguredLayers.splice(b,1));D&&""!==D&&(b=this.layerInfosObj.getLayerInfoById(D))&&b.layerObject&&(b=b.layerObject,this._layerNameStore.put({name:b.name,value:D,geometryType:b.geometryType}),this._editableConfiguredLayers.push(D));this._updateLayerNameOptions()},resetAddNewStatisticsDropdown:function(){var b,D,h,B,H;if(b=d(".simple-table-field.field",this._statisticsLayerTable.domNode))b[0]&&(D=m.getComputedStyle(b[0])),
b[1]&&(h=m.getComputedStyle(b[1])),b[2]&&(B=m.getComputedStyle(b[2]));b=d(".esriCTLayerNameDropdown",this._statisticsLayerTable.domNode);u.forEach(b,k.hitch(this,function(T){(T=d(".dijitReset.dijitInline.dijitSelectLabel.dijitValidationTextBoxLabel",T))&&T[0]&&(H=this.showActionButtonsInColumn?59:30,T[0].style.width=parseInt(D.width,10)-H+"px")}));b=d(".esriCTStatisticsTypeDropdown",this._statisticsLayerTable.domNode);u.forEach(b,k.hitch(this,function(T){(T=d(".dijitReset.dijitInline.dijitSelectLabel.dijitValidationTextBoxLabel",
T))&&T[0]&&(H=this.showActionButtonsInColumn?59:30,T[0].style.width=parseInt(h.width,10)-H+"px")}));b=d(".esriCTStatisticsFieldDropdown",this._statisticsLayerTable.domNode);u.forEach(b,k.hitch(this,function(T){(T=d(".dijitReset.dijitInline.dijitSelectLabel.dijitValidationTextBoxLabel",T))&&T[0]&&(H=this.showActionButtonsInColumn?59:30,T[0].style.width=parseInt(B.width,10)-H+"px")}))},_resetLayerNameWidth:function(b){var D,h;(D=d(".simple-table-field.field",this._statisticsLayerTable.domNode))&&D[0]&&
(h=m.getComputedStyle(D[0]));b=d(".dijitReset.dijitInline.dijitSelectLabel.dijitValidationTextBoxLabel",b.layerNameDropDown.domNode);D=this.showActionButtonsInColumn?59:30;b&&b[0]&&(b[0].style.width=parseInt(h.width,10)-D+"px")},_resetStatisticsTypeWidth:function(b){var D,h;(h=d(".simple-table-field.field",this._statisticsLayerTable.domNode))&&h[1]&&(D=m.getComputedStyle(h[1]));b=d(".dijitReset.dijitInline.dijitSelectLabel.dijitValidationTextBoxLabel",b.statisticsTypeDropdown.domNode);h=this.showActionButtonsInColumn?
59:30;b&&b[0]&&(b[0].style.width=parseInt(D.width,10)-h+"px")},_resetLayerFieldWidth:function(b){var D,h;(D=d(".simple-table-field.field",this._statisticsLayerTable.domNode))&&D[2]&&(h=m.getComputedStyle(D[2]));b=d(".dijitReset.dijitInline.dijitSelectLabel.dijitValidationTextBoxLabel",b.layerFieldDropdown.domNode);D=this.showActionButtonsInColumn?59:30;b&&b[0]&&(b[0].style.width=parseInt(h.width,10)-D+"px")}})})},"widgets/CostAnalysis/setting/ProjectCost":function(){define("dojo/_base/declare jimu/BaseWidget dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./ProjectCost.html dojo/_base/lang dojo/on jimu/dijit/SimpleTable dojo/query dijit/form/ValidationTextBox dojo/dom-construct dijit/form/Select dojo/_base/array dojo/store/Memory".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f){return Q([I,J,G],{templateString:u,baseClass:"jimu-widget-cost-analysis-project-cost-settings",_costFieldStore:null,postCreate:function(){this.inherited(arguments);this._handleClickEvents()},_setConfig:function(){this.config&&this.config.projectCostSettings&&0<this.config.projectCostSettings.length&&z.forEach(this.config.projectCostSettings,d.hitch(this,function(n){this._addProjectCostLayerRow(n)}))},startup:function(){this.inherited(arguments);this._createProjectCostFieldTable();
this._createProjectCostTypeFieldStore();this._setConfig()},getConfig:function(){var n=this._projectCostTable.getRows();var g=[];z.some(n,d.hitch(this,function(m){g.push({label:m.projectCostLabelTextBox.getValue(),type:m.projectCostTypeDropdown.getValue(),value:m.projectCostValueTextBox.getValue()})}));return g},validateProjectCostData:function(){var n=this._projectCostTable.getRows();for(var g in n){var m=n[g];if(!m.projectCostLabelTextBox.isValid())return this._setErrorMessage(m.projectCostLabelTextBox,
this.nls.projectCostSettings.invalidProjectCostMessage),{isValid:!1};if(!m.projectCostValueTextBox.isValid())return this._setErrorMessage(m.projectCostValueTextBox,this.nls.projectCostSettings.invalidProjectCostMessage),{isValid:!1}}return{isValid:!0}},_setErrorMessage:function(n,g){n.set("state","Error");n.set("invalidMessage",g);n.focus();n.isValid()},_handleClickEvents:function(){this.own(c(this.btnAddProjectCostNode,"click",d.hitch(this,function(){this._addProjectCostBtnClicked()})));this.own(c(this.btnCrossNode,
"click",d.hitch(this,function(){this._deleteLayerRow()})))},_createProjectCostFieldTable:function(){this._projectCostTable=new a({fields:[{name:"editable",title:this.nls.common.label,type:"empty",editable:!1,width:"35%"},{name:"field",title:this.nls.common.type,type:"empty",editable:!1,width:"20%"},{name:"field",title:this.nls.projectCostSettings.additionalCostValueColumnHeader,type:"empty",editable:!0,width:"35%"},{name:"actions",title:this.nls.common.actions,width:"10%",type:"actions",actions:["up",
"down","delete"]}],selectable:!1,autoHeight:!0});this._projectCostTable.placeAt(this.projectCostTableNode);this._projectCostTable.startup()},_addProjectCostBtnClicked:function(){this._addProjectCostLayerRow()},_addProjectCostLayerRow:function(n){var g;var m=this._projectCostTable.addRow({});if(g=w(".simple-table-cell",m.tr))m=m.tr,this._addProjectCostLabelTextBox(g[0],m,n),this._addProjectCostTypeDropdown(g[1],m,n),this._addProjectCostValueTextBox(g[2],m,n)},_addProjectCostLabelTextBox:function(n,
g,m){n=e.create("div",{"class":"esriCTTextBoxContainer"},n);g.projectCostLabelTextBox=new q({"class":"esriCTProjectCostLabelTextbox esriCTAddProjectCostTableNode",invalidMessage:"Invalid Entry for project cost"},n);g.projectCostLabelTextBox.startup();m&&m.label&&g.projectCostLabelTextBox.set("value",m.label);g.projectCostLabelTextBox.validator=d.hitch(this,this._validateProjectCostLabelFields)},_validateProjectCostLabelFields:function(n){return""===d.trim(n)?!1:!0},_addProjectCostTypeDropdown:function(n,
g,m){n=e.create("div",{"class":"esriCTProjectCostTypeDropDownContainer esriCTAddProjectCostTableNode"},n);g.projectCostTypeDropdown=new k({name:"layerSelect",store:this._projectCostFieldStore,labelAttr:"name","class":"esriCTProjectCostTypeDropdown"},n);m&&m.type&&g.projectCostTypeDropdown.set("value",m.type);g.projectCostTypeDropdown.startup()},_addProjectCostValueTextBox:function(n,g,m){n=e.create("div",{"class":"esriCTProjectCostTextBoxContainer esriCTAddProjectCostTableNode"},n);g.projectCostValueTextBox=
new q({"class":"esriCTProjectCostLabelTextbox",trim:!0,invalidMessage:"Invalid Entry for project cost"},n);g.projectCostValueTextBox.startup();m&&m.value&&g.projectCostValueTextBox.set("value",m.value);g.projectCostValueTextBox.validator=d.hitch(this,this._validateProjectCostValueFields)},_validateProjectCostValueFields:function(n){n=Number(n);return""===n||isNaN(n)||"0"===n||0===n?!1:!0},_deleteLayerRow:function(){var n=this._projectCostTable.getRows(),g=this._projectCostTable.getData();z.forEach(g,
d.hitch(this,function(m,l){m.editable&&this._projectCostTable.deleteRow(n[l])}))},_createProjectCostTypeFieldStore:function(){var n=[];n.push({name:"+",value:"+"});n.push({name:"*",value:"*"});n.push({name:"-",value:"_"});n.push({name:"%",value:"%"});this._projectCostFieldStore=new f({idProperty:"value",data:n})}})})},"widgets/CostAnalysis/project-attribute":function(){define("dojo/_base/declare jimu/BaseWidget jimu/utils dojo/Evented dijit/layout/ContentPane dijit/_WidgetsInTemplateMixin dojo/text!./project-attribute.html dojo/_base/lang dojo/_base/array dojo/dom-style dojo/on dojo/dom-construct dojo/dom-class esri/dijit/AttributeInspector esri/layers/FeatureLayer esri/tasks/query dojo/query dijit/registry dijit/focus dojo/keys dojo/_base/event dojo/dom-attr".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y){return Q([I,G,d],{templateString:c,baseClass:"jimu-widget-cost-analysis-project-attribute",projectInfo:null,_projectLayerInfo:null,_updatedFeature:null,_attributeInspector:null,postCreate:function(){this.inherited(arguments);this.onProjectLoad(this.projectInfo)},startup:function(){this.inherited(arguments);this.own(e(this.okButton,"click",a.hitch(this,function(){this._onOkButtonClicked()})));this.own(e(this.okButton,"keydown",a.hitch(this,function(v){if(v.keyCode===
A.ENTER||v.keyCode===A.SPACE)L.stop(v),this._onOkButtonClicked()})));this.own(e(this.cancelButton,"click",a.hitch(this,function(){this.emit("onCancelButtonClicked")})));this.own(e(this.cancelButton,"keydown",a.hitch(this,function(v){if(v.keyCode===A.ENTER||v.keyCode===A.SPACE)L.stop(v),this.emit("onCancelButtonClicked")})))},_onOkButtonClicked:function(){this._updatedFeature&&this._updatedFeature.getLayer().applyEdits(null,[this._updatedFeature],null,a.hitch(this,function(v,b,D){b[0].success&&this.emit("onProjectInfoUpdate",
this._updatedFeature)}));this.emit("onOkButtonClicked")},onProjectLoad:function(v){this.projectInfo=v;v=this.config.projectSettings.projectLayer;this.projectInfo.projectId&&v&&(this._projectLayerInfo=this.layerInfosObj.getLayerInfoById(v),this._loadAttributeInspector())},editProjectAttributes:function(){var v="";if(this._projectLayerInfo){this.loadingIndicator.show();var b=Date.now();this._updatedFeature=null;var D=new g;(v=this._projectLayerInfo.layerObject.getDefinitionExpression())&&this._projectLayerInfo.layerObject.setDefinitionExpression("");
D.where=this._projectLayerInfo.layerObject.globalIdField+" \x3d '"+this.projectInfo.projectId+"' AND "+b+" \x3d "+b;this._projectLayerInfo.layerObject.selectFeatures(D,n.SELECTION_NEW,a.hitch(this,function(h){this._updatedFeature=h[0];this._attributeInspector&&(this._attributeInspector.refresh(),q.set(this._attributeInspector.attributeTable,"display",""),this._attributeInspector.attributeTable&&this._attributeInspector.attributeTable.childNodes&&0<this._attributeInspector.attributeTable.childNodes.length&&
y.set(this._attributeInspector.attributeTable.childNodes[0],"cellspacing","1"));this.loadingIndicator.hide();v&&this._projectLayerInfo.layerObject.setDefinitionExpression(v);this._add508SupportToATI()}))}},mergeFirstToLast:function(){for(var v={},b=arguments.length-1,D;0<=b;b--)for(D in arguments[b])arguments[b].hasOwnProperty(D)&&(v[D]=arguments[b][D]);return v},_getFieldInfosFromLayer:function(v){var b=[];v&&v.layerObject&&w.forEach(v.layerObject.fields,function(D){var h=J.getDefaultPortalFieldInfo(D);
h=this.mergeFirstToLast(h,D);h.format&&h.format.dateFormat&&h.format.dateFormat.toLowerCase()&&0<=h.format.dateFormat.toLowerCase().indexOf("time")&&(h.format.time=!0);h.visible=!0;b.push(h)},this);return b},_createFieldInfos:function(){var v=this._projectLayerInfo.controlPopupInfo&&this._projectLayerInfo.controlPopupInfo.enablePopup&&this._projectLayerInfo.controlPopupInfo.infoTemplate?a.clone(this._projectLayerInfo.controlPopupInfo.infoTemplate.info.fieldInfos):this._getFieldInfosFromLayer(this._projectLayerInfo);
var b=[];w.forEach(v,a.hitch(this,function(D){if(D.visible){if("PROJECTNAME"===D.fieldName.toUpperCase()||"TOTALASSETCOST"===D.fieldName.toUpperCase()||"GROSSPROJECTCOST"===D.fieldName.toUpperCase())D.isEditable=!1;b.push(D)}}));return b},_loadAttributeInspector:function(){if(this._projectLayerInfo){var v=this._createFieldInfos();k.empty(this.projectAttributeNode);var b=new u({style:{padding:"0"}},k.create("div",{},this.projectAttributeNode));this._attributeInspector=new f({layerInfos:[{featureLayer:this._projectLayerInfo.layerObject,
showAttachments:!1,isEditable:!0,fieldInfos:v}]},k.create("div"));this._attributeInspector.on("attribute-change",a.hitch(this,function(D){this._updatedFeature.attributes[D.fieldName]=D.fieldValue}));z.add(this._attributeInspector.layerName,"esriCTHidden");z.add(this._attributeInspector.editButtons,"esriCTHidden");b.setContent(this._attributeInspector.domNode)}},_add508SupportToATI:function(){var v;if(this._attributeInspector&&this._attributeInspector.domNode){var b=l.findWidgets(this._attributeInspector.domNode);
w.forEach(b,a.hitch(this,function(D){D.focusNode&&!v&&(v=D.focusNode,J.initFirstFocusNode(this.widgetDomNode,D.focusNode),C.focus(D.focusNode));D.hasOwnProperty("focusNode")&&D.focusNode.disabled&&(y.set(D.focusNode,"disabled",!1),y.set(D.focusNode,"tabindex",0),y.set(D.focusNode,"readOnly",!0),y.set(D.focusNode,"aria-disabled","true"))}));(b=m("td.atiLabel",this._attributeInspector.domNode))&&w.forEach(b,a.hitch(this,function(D){var h=this._getAttrInspectorRowInfo(D);h&&(h[0].set("aria-label",h[1]),
1<D.parentNode.childNodes[1].childNodes.length&&(D=D.parentNode.childNodes[1].childNodes[1],D=l.getEnclosingWidget(D),D.set("aria-label",h[1])))}))}J.initLastFocusNode(this.widgetDomNode,this.cancelButton)},_getAttrInspectorRowInfo:function(v){try{if(v&&v.parentNode){var b=v.parentNode.childNodes[1].childNodes[0];return[l.getEnclosingWidget(b),v.childNodes[0].data,b]}return null}catch(D){return console.log(D),null}}})})},"widgets/CostAnalysis/asset-statistics":function(){define("dojo/_base/declare jimu/BaseWidget dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./asset-statistics.html dojo/_base/lang dojo/on dojo/_base/array dojo/dom-construct dijit/form/TextBox dojo/keys jimu/utils dijit/focus".split(" "),
function(Q,I,J,G,u,d,c,a,w,q,e,k,z){return Q([I,J,G],{templateString:u,baseClass:"jimu-widget-cost-analysis-asset-statistics",_layerNamesObj:{},_statTypeNames:{},postCreate:function(){this.inherited(arguments);this._layerNamesObj={};this._statTypeNames={count:this.nls.statisticsType.countLabel,area:this.nls.statisticsType.areaLabel,length:this.nls.statisticsType.lengthLabel,avg:this.nls.statisticsType.averageLabel,sum:this.nls.statisticsType.summationLabel,max:this.nls.statisticsType.maxLabel,min:this.nls.statisticsType.minLabel}},
startup:function(){this.inherited(arguments);this._getLayerNames();this._initAssetStatistics();this.own(c(this.okButton,"click",d.hitch(this,function(){this.emit("onOkButtonClicked")})));this.own(c(this.okButton,"keydown",d.hitch(this,function(f){f.keyCode!==e.ENTER&&f.keyCode!==e.SPACE||this.emit("onOkButtonClicked")})))},_initAssetStatistics:function(){this.displayStatisticsDetail(this.config.statisticsSettings)},displayStatisticsDetail:function(f){w.empty(this.assetsListNode);0===f.length?(f=w.create("div",
{innerHTML:this.nls.detailStatistics.noDetailStatisticAvailable,"class":"esriCTNoDetailStatisticMessage",tabindex:"0",role:"presentation","aria-label":this.nls.detailStatistics.noDetailStatisticAvailable},this.assetsListNode),z.focus(f)):a.forEach(f,d.hitch(this,function(n){this._addStatisticEntry(n)}))},_addStatisticEntry:function(f){var n="";var g="";(g=this.layerInfosObj.getLayerInfoById(f.id))&&g.layerObject&&(n=this.appUtils.getUnitsAbbreviation(g.layerObject.geometryType,this.config.generalSettings.measurementUnit));
var m=this._getFeatureValue(f);"count"!==f.type&&(m=this.appUtils.applyRounding(m));if("length"===f.type||"area"===f.type)m+=" "+n;g=f.label?f.label:this._layerNamesObj[f.id]+" ("+this._statTypeNames[f.type]+")";"NaN"===m&&(m=0);this._createStatisticsDetailUI(g,m)},_createStatisticsDetailUI:function(f,n){var g=w.create("div",{"class":"esriCTStatisticWrapper"},this.assetsListNode);w.create("div",{"class":"esriCTStatisticLabel esriCTEllipsis",title:f,innerHTML:f},g);g=w.create("div",{},g);new q({value:n,
"aria-label":f,"class":"esriCTFullwidth esriCTEllipsis esriCTAssetDetailTextBox",tabindex:"0",readonly:!0,role:"presentation"},g)},_getLayerNames:function(){a.forEach(this.map.itemInfo.itemData.operationalLayers,d.hitch(this,function(f){this._layerNamesObj[f.id]=f.title}))},_getFeatureValue:function(f){if(0<Object.keys(this.assetItemSummary).length&&this.assetItemSummary[f.id]){var n=this.assetItemSummary[f.id].templates;var g=f.field;f=f.type;return this._calculateFeatureValue(n,g,f)}return"0"},
_calculateFeatureValue:function(f,n,g){switch(g){case "count":return this._calculateCountOfFeatures(f);case "area":return this._calculateAreaLengthOfFeatures(f);case "length":return this._calculateAreaLengthOfFeatures(f);case "avg":return this._calculateAvgSumOfFeatures(f,n,g);case "sum":return this._calculateAvgSumOfFeatures(f,n,g);case "max":return this._calculateMinMaxOfFeatures(f,n,g);case "min":return this._calculateMinMaxOfFeatures(f,n,g);case "default":return""}},_calculateCountOfFeatures:function(f){var n=
0;for(u in f)n+=f[u].features.length;return n},_calculateAreaLengthOfFeatures:function(f){var n=0;for(u in f)n+=this._getFeatureDimension(f[u]);return n},_getFeatureDimension:function(f){var n=0;a.forEach(f.features,function(g){n+=g.featureDimension});return n},_calculateAvgSumOfFeatures:function(f,n,g){var m=0,l=0;if(""===n)return"";for(u in f)l+=this._getSumAndCountOfFields(f[u].features,n).count,m+=this._getSumAndCountOfFields(f[u].features,n).total;return"avg"===g?m/l:m},_getSumAndCountOfFields:function(f,
n){var g=0,m=0;a.forEach(f,function(l){l.attributes[n]&&(g+=l.attributes[n],m++)});return{total:g,count:m}},_calculateMinMaxOfFeatures:function(f,n,g){if(""===n)return"";var m=[];var l=[];for(u in f)m=this._getFeatureAttributesArray(f[u].features,n,l);return"max"===g?Math.max.apply(null,m):Math.min.apply(null,m)},_getFeatureAttributesArray:function(f,n,g){a.forEach(f,function(m){m.attributes[n]?g.push(m.attributes[n]):g.push("")});return g},setFirstAndLastNode:function(){k.initFirstFocusNode(this.widgetDomNode,
this.addNewStatisticsIcon);z.focus(this.addNewStatisticsIcon);k.initLastFocusNode(this.widgetDomNode,this.okButton)}})})},"widgets/CostAnalysis/utils":function(){define("esri/request esri/geometry/geometryEngine dojo/Deferred dojo/_base/lang jimu/dijit/Message dojo/_base/array jimu/utils dijit/focus".split(" "),function(Q,I,J,G,u,d,c,a){var w={};w.units={feet:{lengthUnit:"feet",areaUnit:"square-feet",bufferUnit:"UNIT_FOOT",lengthAbbr:window.jimuNls.units.feetAbbr,areaAbbr:window.jimuNls.units.squareFeetAbbr},
meters:{lengthUnit:"meters",areaUnit:"square-meters",bufferUnit:"UNIT_METER",lengthAbbr:window.jimuNls.units.metersAbbr,areaAbbr:window.jimuNls.units.squareMetersAbbr},miles:{lengthUnit:"miles",areaUnit:"square-miles",bufferUnit:"UNIT_STATUTE_MILE",lengthAbbr:window.jimuNls.units.milesAbbr,areaAbbr:window.jimuNls.units.squareMilesAbbr},yards:{lengthUnit:"yards",areaUnit:"square-yards",bufferUnit:"UNIT_SURVEY_YARD",lengthAbbr:window.jimuNls.units.yardsAbbr,areaAbbr:window.jimuNls.units.squareYardsAbbr},
kilometers:{lengthUnit:"kilometers",areaUnit:"square-kilometers",bufferUnit:"UNIT_KILOMETER",lengthAbbr:window.jimuNls.units.kilometersAbbr,areaAbbr:window.jimuNls.units.squareKilometerAbbr}};w.switchToTab=function(q,e){q.selectTab(e)};w.removeNegativeExponents=function(q){return 1<q.toString().toLowerCase().split("e-").length?0:q};w.applyRounding=function(q,e){if(isNaN(e)||null===e)e=2;var k=Math.pow(10,e);q=Math.round(q*k)/k;q=q.toFixed(e);return c.localizeNumber(q)};w.getLengthOfGeometry=function(q,
e){var k;var z=0;(k=I.simplify(q))&&(z=q.spatialReference.isWebMercator()||4326===q.spatialReference.wkid?I.geodesicLength(k,e):I.planarLength(k,e));return z};w.getAreaOfGeometry=function(q,e){var k=I.simplify(q);var z=0;k&&(z=q.spatialReference.isWebMercator()||4326===q.spatialReference.wkid?I.geodesicArea(k,e):I.planarArea(k,e));return z};w.deleteFeatures=function(q,e){var k=new J;Q({url:q+"/deleteFeatures",content:{where:e,f:"json"}},{usePost:!0}).then(G.hitch(this,function(z){k.resolve(z)}),function(){k.reject(!1)});
return k.promise};w.getUnitsAbbreviation=function(q,e){var k="";if("esriGeometryPolygon"===q||"polygon"===q)k=w.units[e].areaAbbr;else if("esriGeometryPolyline"===q||"polyline"===q)k=w.units[e].lengthAbbr;return k};w.roundProjectCostValue=function(q,e){var k=0;e=parseFloat(e);switch(q){case "nearestWholeNumber":k=e.toFixed();break;case "nearestTen":k=eval(e.toFixed())/10;k=10*eval(k.toFixed());break;case "nearestHundred":k=eval(e.toFixed())/100;k=100*eval(k.toFixed());break;case "nearestThousand":k=
eval(e.toFixed())/1E3;k=1E3*eval(k.toFixed());break;case "nearestTenThousands":k=eval(e.toFixed())/1E4;k=1E4*eval(k.toFixed());break;default:k=e.toFixed(2)}return c.localizeNumber(k)};w.getPrjAssetTableFields=function(q){var e={};d.forEach(q.fields,G.hitch(this,function(k){"ASSETGUID"===k.name.toUpperCase()?e.ASSETGUID=k.name:"COSTEQUATION"===k.name.toUpperCase()?e.COSTEQUATION=k.name:"SCENARIO"===k.name.toUpperCase()?e.SCENARIO=k.name:"TEMPLATENAME"===k.name.toUpperCase()?e.TEMPLATENAME=k.name:"GEOGRAPHYGUID"===
k.name.toUpperCase()?e.GEOGRAPHYGUID=k.name:"PROJECTGUID"===k.name.toUpperCase()&&(e.PROJECTGUID=k.name)}));e.OBJECTID=q.objectIdField;return e};w.getPrjLayerFields=function(q){var e={};d.forEach(q.fields,G.hitch(this,function(k){"PROJECTNAME"===k.name.toUpperCase()?e.PROJECTNAME=k.name:"DESCRIPTION"===k.name.toUpperCase()?e.DESCRIPTION=k.name:"TOTALASSETCOST"===k.name.toUpperCase()?e.TOTALASSETCOST=k.name:"GROSSPROJECTCOST"===k.name.toUpperCase()?e.GROSSPROJECTCOST=k.name:"GLOBALID"===k.name.toUpperCase()&&
(e.GLOBALID=k.name)}));return e};w.getPrjMultiplierFields=function(q){var e={};d.forEach(q.fields,G.hitch(this,function(k){"DESCRIPTION"===k.name.toUpperCase()?e.DESCRIPTION=k.name:"TYPE"===k.name.toUpperCase()?e.TYPE=k.name:"VALUE"===k.name.toUpperCase()?e.VALUE=k.name:"COSTINDEX"===k.name.toUpperCase()?e.COSTINDEX=k.name:"PROJECTGUID"===k.name.toUpperCase()&&(e.PROJECTGUID=k.name)}));e.OBJECTID=q.objectIdField;return e};w.showMessage=function(q){var e=new u({message:q});e.message=q;return e};w.evaluate=
function(q){return(new Function("return "+q))()};w.validateEquation=function(q){if(""===q||-1<q.indexOf("\x26")||-1<q.indexOf("|")||-1<q.indexOf(","))return!1;q=q.replace(/{measure}/ig,1);q=q.replace(/{totalmeasure}/ig,1);q=q.replace(/{totalcount}/ig,1);if(-1!==q.indexOf("{")||-1!==q.indexOf("}"))return!1;try{var e=w.evaluate(q);return isFinite(e)?!0:!1}catch(k){return!1}};w.setFirstAndLastWBFocusNode=function(q,e,k){c.initFirstFocusNode(q,e);a.focus(e);c.initLastFocusNode(q,k)};return w})},"widgets/CostAnalysis/_build-generate_module":function(){define(["dojo/text!./Widget.html",
"dojo/text!./css/style.css","dojo/i18n!./nls/strings"],function(){})},"url:widgets/CostAnalysis/Widget.html":'\x3cdiv style\x3d "height: 100%; width: 100%"\x3e\r\n  \x3cdiv class\x3d"esriCTHidden" data-dojo-attach-point\x3d"widgetErrorNode"\x3e\x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTHidden" data-dojo-attach-point\x3d"createOrLoadProject"\x3e\x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTFullHeightWidth esriCTHidden" data-dojo-attach-point\x3d"addNewStatisticsNode"\x3e\x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTFullHeightWidth esriCTHidden" data-dojo-attach-point\x3d"workBenchPanel"\x3e\x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTFullHeightWidth esriCTHidden" data-dojo-attach-point\x3d"projectAttribute"\x3e\x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTFullHeightWidth esriCTHidden" data-dojo-attach-point\x3d"assetDetails"\x3e\x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTFullHeightWidth esriCTHidden" data-dojo-attach-point\x3d"assetStatistics"\x3e\x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTFullHeightWidth esriCTHidden" data-dojo-attach-point\x3d"projectSummary"\x3e\x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTHidden esriCTCopyFeaturesMainContainer" data-dojo-attach-point\x3d"copyFeatures"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/create-load-project.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"esriCTCreateProjectContainer" data-dojo-attach-point\x3d"createLoadProjectContainer"\x3e\x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"createProjectContainer"\x3e\x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"loadProjectContainer"\x3e\x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"updateEquationContainer" class\x3d"esriCTUpdateEquationMainContainer"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',"url:widgets/CostAnalysis/item-list.html":'\x3cdiv\x3e\r\n  \x3cdiv class \x3d "esriCTItemListContainer" data-dojo-attach-point\x3d"itemListContainer"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/update-project-cost.html":'\x3cdiv class\x3d"esriCTProjectListMainContainer"\x3e\r\n  \x3c!-- // list --\x3e\r\n  \x3cdiv class\x3d"esriCTProjectListChildContainer esriCTHidden" data-dojo-attach-point\x3d"projectListChildContainer"\x3e\x3c/div\x3e\r\n  \x3c!-- // button --\x3e\r\n  \x3cdiv class\x3d"esriCTUpdateButtonContainer esriCTHidden" data-dojo-attach-point\x3d"updateButtonParentContainer"\x3e\r\n    \x3cdiv class\x3d"jimu-btn jimu-state-disabled esriCTUpdateEquationBtnDisabled" data-dojo-attach-point\x3d"updateCostEquationButton"\r\n      data-dojo-attach-event\x3d"onclick:_updateCostEquation" role\x3d"button" aria-label\x3d"${nls.updateCostEquationPanel.updateButtonTextForm}"\x3e${nls.updateCostEquationPanel.updateButtonTextForm}\x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"noFeatureFoundScreen" class\x3d"esriCTNoFeatureFoundScreen esriCTHidden"\x3e${nls.updateCostEquationPanel.updateProjectNoProject}\x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/work-bench.html":'\x3cdiv style\x3d"height: 100%; width: 100%"\x3e\r\n  \x3cdiv class\x3d"esriCTContentSection"\x3e\r\n    \x3cdiv class\x3d"esriCTBoldFont esriCTProjectName" data-dojo-attach-point\x3d"projectNameDiv" tabindex\x3d"0"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTSelectFeatureToCopyParentContainer"\x3e\r\n      \x3cdiv class\x3d"esriCTSelectFeatureLabel" data-dojo-attach-point\x3d"featureModeTextNode" tabindex\x3d"0" role\x3d"region" aria-label\x3d"${nls.workBench.featureModeText}"\x3e${nls.workBench.featureModeText}:\x3c/div\x3e\r\n      \x3cdiv class\x3d"esriCTSelectFeatureToCopyContainer"\x3e\r\n        \x3cdiv class\x3d"esriCTSelectDisable esriCTFeatureModeIcons esriCTWorkBenchDOM" data-dojo-attach-point\x3d"selectButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.workBench.selectToolTitle}" title\x3d"${nls.workBench.selectToolTitle}"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTSketchEnable esriCTFeatureModeIcons esriCTWorkBenchDOM" data-dojo-attach-point\x3d"sketchButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.workBench.sketchToolTitle}" title\x3d"${nls.workBench.sketchToolTitle}"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTTemplatePickerLabel "tabindex\x3d"0" role\x3d"region" aria-label\x3d"${nls.workBench.templatePickerTitle}"\x3e${nls.workBench.templatePickerTitle}\x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTAddEditFeatureContainer" data-dojo-attach-point\x3d"templatePickerContainer"\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"projectOverview"\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTPageFooter"\x3e\r\n    \x3cdiv class\x3d"jimu-btn esriCTEllipsis esriCTWorkBenchDOM" data-dojo-attach-point\x3d"backButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.common.back}"\x3e${nls.common.back}\x3c/div\x3e\r\n    \x3cdiv class\x3d"jimu-btn esriCTEllipsis esriCTWorkBenchDOM" data-dojo-attach-point\x3d"refreshButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.workBench.refresh}"\x3e${nls.workBench.refresh}\x3c/div\x3e\r\n    \x3cdiv class\x3d"jimu-btn esriCTEllipsis esriCTWorkBenchDOM" data-dojo-attach-point\x3d"downloadCSVBtn" tabindex\x3d"0" role\x3d"button"\r\n        aria-label\x3d"${nls.workBench.downloadCSVBtnTitle}"\x3e${nls.workBench.downloadCSVBtnTitle}\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/template-picker.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"esriCTAssetTemplatePicker" data-dojo-attach-point\x3d"templatePickerNode"\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTEditorToolBar" data-dojo-attach-point\x3d"editorToolbarNode"\x3e\r\n  \x3c/div\x3e\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: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:esri/dijit/editing/templates/Editor.html":'\x3cdiv class\x3d"esriEditor"\x3e\r\n    \x3cdiv class\x3d"esriTemplatePicker" dojoAttachPoint\x3d"templatePickerDiv"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"esriDrawingToolbar" dojoAttachPoint\x3d"drawingToolbarDiv"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"progressBar" dojoAttachPoint\x3d"progressBar" indeterminate\x3d"true" dojoType\x3d"dijit.ProgressBar" /\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/scenario-selection.html":'\x3cdiv style\x3d"height: 100%; width: 100%"\x3e\r\n  \x3cdiv class\x3d"esriCTRegionDetailsParentDiv" data-dojo-attach-point\x3d"regionDetailsParentContainer"\x3e\r\n    \x3cdiv class\x3d"esriCTRegionLabel"\x3e${nls.scenarioSelection.regionLabel}\x3c/div\x3e\r\n    \x3cinput class\x3d"esriCTRegionTextBox" readonly aria-label\x3d"${nls.scenarioSelection.regionLabel}" data-dojo-attach-point\x3d"regionNameTextBox" data-dojo-type\x3d"dijit/form/TextBox"\r\n    /\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTScenarioDetailsParentDiv" data-dojo-attach-point\x3d"scenarioDetailsParentDiv"\x3e\r\n    \x3cdiv class\x3d"esriCTScenarioLabel"\x3e${nls.scenarioSelection.scenarioLabel}\x3c/div\x3e\r\n    \x3cselect class\x3d"esriCTScenarioDropdown" data-dojo-attach-point\x3d"scenarioDropDown" aria-label\x3d"${nls.scenarioSelection.scenarioLabel}" data-dojo-type\x3d"jimu/dijit/formSelect"\x3e\x3c/select\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/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"esriCTCopyFeaturesListContent" data-dojo-attach-point\x3d"layerListTable"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTCopyFeaturesBtnContainer"\x3e\r\n      \x3cdiv class\x3d"esriCTCopyFeaturesBtn jimu-btn" data-dojo-attach-point\x3d"createMultipleFeaturesBtn" title\x3d"${nls.copyFeatures.createFeatures}" tabindex\x3d"0" aria-label\x3d"${nls.copyFeatures.createFeatures}" role\x3d"button"\x3e${nls.copyFeatures.createFeatures}\x3c/div\x3e\r\n      \x3cdiv class\x3d"esriCTCopyFeaturesBtn jimu-btn" data-dojo-attach-point\x3d"createSingleFeatureBtn" title\x3d"${nls.copyFeatures.createSingleFeature}" tabindex\x3d"0" aria-label\x3d"${nls.copyFeatures.createSingleFeature}" role\x3d"button"\x3e${nls.copyFeatures.createSingleFeature}\x3c/div\x3e\r\n      \x3cdiv class\x3d"esriCTCopyFeaturesBtn jimu-btn" data-dojo-attach-point\x3d"cancelBtn" title\x3d"${nls.common.cancel}" tabindex\x3d"0" aria-label\x3d"${nls.common.cancel}" role\x3d"button"\x3e${nls.common.cancel}\x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/project-overview.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"esriCTProjectOverview" data-dojo-attach-point\x3d"projectOverviewNode"\x3e\x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"assetSummaryInfo"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"assetSummaryDiv"\x3e\x3c/div\x3e\r\n    \x3ctable class\x3d"esriCTTable esriCTBoldFont esriCTTotalCostTable" style\x3d"width: 100%;"\x3e\r\n      \x3ctbody\x3e\r\n        \x3ctr tabindex\x3d"0" \x3e\r\n          \x3ctd aria-label\x3d"${nls.projectOverview.totalCostLabel}" class\x3d"esriCTAssetItemsTotalCostLabel" data-dojo-attach-point\x3d"totalCostLabel"\x3e${nls.projectOverview.totalCostLabel}\x3c/td\x3e\r\n          \x3ctd class\x3d"esriCTAssetItemsTotalCost" data-dojo-attach-point\x3d"totalCost"\x3e\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr tabindex\x3d"0" \x3e\r\n          \x3ctd aria-label\x3d"${nls.projectOverview.grossCostLabel}" class\x3d"esriCTAssetItemsGrossCostLabel" data-dojo-attach-point\x3d"grossCostLabel"\x3e${nls.projectOverview.grossCostLabel}\x3c/td\x3e\r\n          \x3ctd class\x3d"esriCTAssetItemsGrossCost" data-dojo-attach-point\x3d"grossCost"\x3e\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd style\x3d"font-weight: normal; font-style: italic;" colspan\x3d"2" data-dojo-attach-point\x3d"roundingLabel"\x3e${nls.projectOverview.roundingLabel}\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  \x3cdiv data-dojo-attach-point\x3d"projectSummaryInfo"\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/advance-item-list.html":'\x3cdiv\x3e\r\n  \x3cdiv class \x3d "esriCTItemListContainer" data-dojo-attach-point\x3d"itemListContainer"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',"url:widgets/CostAnalysis/project-summary.html":'\x3cdiv style\x3d"height: 100%; width: 100%"\x3e\r\n  \x3cdiv class\x3d"esriCTContentSection"\x3e\r\n    \x3cdiv class\x3d"esriCTCostEscalationTitle"\x3e\r\n      ${nls.costEscalation.costEscalationLabel}\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTCostEscalatioParent" data-dojo-attach-point\x3d"costEscalationTableNode"\x3e\x3c/div\x3e\r\n    \x3cdiv\x3e\r\n      \x3c!--Add/delete/reorder buttons--\x3e\r\n      \x3cdiv style\x3d"height: 30px;" class\x3d"esriCTStatisticsButtonParentDiv"\x3e\r\n        \x3cdiv class\x3d"esriCTAddStatisticsIcon esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnAddNode" title\x3d"${nls.costEscalation.addCostEscalationText}" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.costEscalation.addCostEscalationText}"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTDeleteStatisticsIconDisable esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnCrossNode" title\x3d"${nls.costEscalation.deleteCostEscalationText}" tabindex\x3d"-1" role\x3d"button" aria-label\x3d"${nls.costEscalation.deleteCostEscalationText}"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTStatisticsUpIconDisable esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnUpNode" title\x3d"${nls.costEscalation.moveCostEscalationUpText}" tabindex\x3d"-1" role\x3d"button" aria-label\x3d"${nls.costEscalation.moveCostEscalationUpText}"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTStatisticsDownIconDisable esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnDownNode" title\x3d"${nls.costEscalation.moveCostEscalationDownText}" tabindex\x3d"-1" role\x3d"button" aria-label\x3d"${nls.costEscalation.moveCostEscalationDownText}"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n      \x3c!--Project Total and Gross Cost table--\x3e\r\n      \x3cdiv class\x3d"esriCTBoldFont" data-dojo-attach-point\x3d"totalProjectCost"\x3e\r\n        \x3ctable class\x3d"esriCTProjectCostTable" style\x3d"width: 100%;"\x3e\r\n          \x3ctbody\x3e\r\n            \x3ctr tabindex\x3d"0"\x3e\r\n              \x3ctd class\x3d"esriCTProjectSummaryTotalCostLabel" data-dojo-attach-point\x3d"totalCostLabel"\x3e${nls.projectOverview.totalCostLabel}\x3c/td\x3e\r\n              \x3ctd class\x3d"esriCTProjectSummaryTotalCost" data-dojo-attach-point\x3d"totalCostDiv"\x3e\x3c/td\x3e\r\n            \x3c/tr\x3e\r\n            \x3ctr tabindex\x3d"0"\x3e\r\n              \x3ctd class\x3d"esriCTProjectSummaryTotalGrossLabel" data-dojo-attach-point\x3d"grossCostLabel"\x3e${nls.projectOverview.grossCostLabel}\x3c/td\x3e\r\n              \x3ctd class\x3d"esriCTProjectSummaryTotalGross" data-dojo-attach-point\x3d"grossCostDiv"\x3e\x3c/td\x3e\r\n            \x3c/tr\x3e\r\n            \x3ctr\x3e\r\n              \x3ctd style\x3d"font-weight: normal; font-style: italic;" colspan\x3d"2" data-dojo-attach-point\x3d"roundingLabel"\x3e${nls.projectOverview.roundingLabel}\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    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTPageFooter"\x3e\r\n    \x3cdiv class\x3d"jimu-btn esriCTEllipsis" data-dojo-attach-point\x3d"okButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.common.ok}"\x3e${nls.common.ok}\x3c/div\x3e\r\n    \x3cdiv class\x3d"jimu-btn esriCTEllipsis" data-dojo-attach-point\x3d"cancelButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.common.cancel}"\x3e${nls.common.cancel}\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/asset-details.html":'\x3cdiv style\x3d"height: 100%; width: 100%"\x3e\r\n  \x3cdiv style\x3d"height: 100%; width: 100%" data-dojo-attach-point\x3d"assetDetailsParent"\x3e\r\n    \x3cdiv class\x3d"esriCTContentSection"\x3e\r\n      \x3cdiv class\x3d"esriCTAssetDetailsTitle"\x3e\r\n        ${nls.workBench.assetDetailsTitle}\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"esriCTNoAssetMessage" tabindex\x3d"0" role\x3d"presentation" aria-label\x3d"${nls.workBench.noAssetAddedMsg}" data-dojo-attach-point\x3d"noAssetDetails"\x3e\r\n        ${nls.workBench.noAssetAddedMsg}\r\n      \x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"assetDetailsNode"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"listNode"\x3e\x3c/div\x3e\r\n        \x3cdiv\x3e\r\n          \x3cdiv style\x3d"width: 100%; float: left;"\x3e\r\n            \x3cdiv class\x3d"esriCTTotalCostTitle" title\x3d"${nls.assetDetails.totalCostTitle}"\x3e${nls.assetDetails.totalCostTitle}\x3c/div\x3e\r\n            \x3cdiv style\x3d"height: 30px;" class\x3d"esriCTEditEquationIcon" data-dojo-attach-point\x3d"additionalCostBtn" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.assetDetails.totalCostTitle}"\x3e\x3c/div\x3e\r\n          \x3c/div\x3e\r\n          \x3cdiv data-dojo-attach-point\x3d"totalProjectCost"\x3e\r\n            \x3ctable class\x3d"esriCTTable" style\x3d"width: 100%;"\x3e\r\n              \x3ctbody\x3e\r\n                \x3ctr tabindex\x3d"0"\x3e\r\n                  \x3ctd class\x3d"esriCTBoldFont esriCTAssetDetailsTotalCostLabel" data-dojo-attach-point\x3d"totalCostLabel"\x3e${nls.projectOverview.totalCostLabel}\x3c/td\x3e\r\n                  \x3ctd class\x3d"esriCTBoldFont esriCTAssetDetailsTotalCost" data-dojo-attach-point\x3d"totalCost"\x3e\x3c/td\x3e\r\n                \x3c/tr\x3e\r\n              \x3c/tbody\x3e\r\n            \x3c/table\x3e\r\n            \x3ctable class\x3d"esriCTTable" style\x3d"width: 100%;"\x3e\r\n              \x3ctbody data-dojo-attach-point\x3d"additionalCostTable"\x3e\r\n              \x3c/tbody\x3e\r\n            \x3c/table\x3e\r\n            \x3ctable class\x3d"esriCTTable" style\x3d"width: 100%;"\x3e\r\n              \x3ctbody\x3e\r\n                \x3ctr tabindex\x3d"0"\x3e\r\n                  \x3ctd class\x3d"esriCTBoldFont esriCTAssetDetailsGrossCostLabel" data-dojo-attach-point\x3d"grossCostLabel"\x3e${nls.projectOverview.grossCostLabel}\x3c/td\x3e\r\n                  \x3ctd class\x3d"esriCTBoldFont esriCTAssetDetailsGrossCost" data-dojo-attach-point\x3d"grossCost"\x3e\x3c/td\x3e\r\n                \x3c/tr\x3e\r\n                \x3ctr\x3e\r\n                  \x3ctd style\x3d"font-weight: normal; font-style: italic;" colspan\x3d"2" data-dojo-attach-point\x3d"roundingLabel"\x3e${nls.projectOverview.roundingLabel}\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        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTPageFooter"\x3e\r\n      \x3cdiv class\x3d"jimu-btn esriCTEllipsis" data-dojo-attach-point\x3d"okButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.common.back}"\x3e${nls.common.back}\x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv style\x3d"height: 100%; width: 100%" class\x3d"esriCTHidden" data-dojo-attach-point\x3d"costEquationEditorParent"\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/cost-equation-editor.html":'\x3cdiv style\x3d"height: 100%; width: 100%"\x3e\r\n  \x3cdiv class\x3d"esriCTContentSection"\x3e\r\n    \x3cdiv class\x3d"esriCTCostEquationTitle"\x3e\r\n      ${nls.workBench.costEquationTitle}\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"costEquationEditorNode"\x3e\r\n      \x3cdiv\x3e\r\n        \x3cdiv\x3e\r\n          \x3cdiv class\x3d"esriCTEditCostEquationLabel esriCTFullWidth esriCTEllipsis"  title\x3d"${nls.workBench.geographyTitle}"\x3e\r\n            ${nls.workBench.geographyTitle}\x3c/div\x3e\r\n          \x3cdiv class\x3d"esriCTEditCostEquationInput esriCTFullWidth"\x3e\r\n            \x3cdiv aria-label\x3d"${nls.workBench.geographyTitle}" class\x3d"esriCTFullWidth" readonly  data-dojo-type\x3d"dijit/form/TextBox" data-dojo-attach-point\x3d"geographyValue"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/div\x3e\r\n          \x3cdiv class\x3d"esriCTEditCostEquationLabel esriCTFullWidth esriCTEllipsis"  title\x3d"${nls.workBench.scenarioTitle}"\x3e\r\n            ${nls.workBench.scenarioTitle}\x3c/div\x3e\r\n          \x3cdiv class\x3d"esriCTEditCostEquationInput esriCTFullWidth"\x3e\r\n            \x3cdiv class\x3d"esriCTFullWidth" data-dojo-type\x3d"jimu/dijit/formSelect" data-dojo-attach-point\x3d"scenarioValue" aria-label\x3d"${nls.workBench.scenarioTitle}"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/div\x3e\r\n          \x3cdiv class\x3d"esriCTEditCostEquationLabel esriCTFullWidth esriCTEllipsis" title\x3d"${nls.workBench.newCostEquationTitle}"\x3e\r\n            ${nls.workBench.newCostEquationTitle}\x3c/div\x3e\r\n          \x3cdiv class\x3d"esriCTEditCostEquationInput esriCTFullWidth" data-dojo-attach-point\x3d"newCostEquationParent"\x3e\r\n            \x3cdiv class\x3d\x3d"esriCTFullWidth" style\x3d"min-height:70px;" spellcheck\x3d"false" data-dojo-type\x3d"dijit/form/Textarea" data-dojo-attach-point\x3d"newCostEquationValue" required\x3d"true"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/div\x3e\r\n           \x3cdiv class\x3d"esriCTEditCostEquationLabel esriCTFullWidth esriCTEllipsis"  title\x3d"${nls.workBench.defaultCostEquationTitle}"\x3e\r\n            ${nls.workBench.defaultCostEquationTitle}\x3c/div\x3e\r\n          \x3cdiv class\x3d"esriCTEditCostEquationInput esriCTFullWidth"\x3e\r\n            \x3cdiv class\x3d"esriCTFullWidth" style\x3d"min-height:70px;" spellcheck\x3d"false" readonly data-dojo-type\x3d"dijit/form/Textarea" data-dojo-attach-point\x3d"defaultCostEquationValue"\r\n            aria-label\x3d"${nls.workBench.defaultCostEquationTitle}"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTFullWidth"\x3e\r\n          \x3cdiv style\x3d"outline-offset: -2px;" tabindex\x3d"0" role\x3d"presentation" class\x3d"esriCTHint" data-dojo-attach-point\x3d"costEquationHint"\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\r\n  \x3cdiv class\x3d"esriCTPageFooter"\x3e\r\n    \x3cdiv class\x3d"jimu-btn esriCTEllipsis" data-dojo-attach-point\x3d"okButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.common.ok}"\x3e${nls.common.ok}\x3c/div\x3e\r\n    \x3cdiv class\x3d"jimu-btn esriCTEllipsis" data-dojo-attach-point\x3d"cancelButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.common.cancel}"\x3e${nls.common.cancel}\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/add-new-statistics.html":'\x3cdiv style\x3d"height: 100%; width: 100%;"\x3e\r\n    \x3cdiv class\x3d"esriCTContentSection"\x3e\r\n        \x3c!--Add new statistics label--\x3e\r\n        \x3cdiv class\x3d"esriCTAddNewStatisticsLabel" data-dojo-attach-point\x3d"addNewStatisticsText"\x3e${nls.statisticsSettings.addNewStatisticsText}\x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"addNewStatisticsNode"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTPageFooter"\x3e\r\n        \x3cdiv class\x3d"jimu-btn esriCTEllipsis" data-dojo-attach-point\x3d"okButtonNode" tabindex\x3d"0"\r\n            role\x3d"button" aria-label\x3d"${nls.common.ok}"\x3e${nls.common.ok}\x3c/div\x3e\r\n        \x3cdiv class\x3d"jimu-btn esriCTEllipsis" data-dojo-attach-point\x3d"cancelButtonNode" tabindex\x3d"0"\r\n            role\x3d"button" aria-label\x3d"${nls.common.cancel}"\x3e${nls.common.cancel}\x3c/div\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/setting/StatisticsSettings.html":'\x3cdiv class\x3d"esriCTTabNode"\x3e\r\n    \x3cdiv class\x3d"esriCTTabContainer row"\x3e\r\n        \x3cdiv\x3e\r\n            \x3c!--Add New Statistics button--\x3e\r\n            \x3cdiv class\x3d"esriCTStatisticsContainer" data-dojo-attach-point\x3d"btnAddStatisticsNodeWrapper"\x3e\r\n                \x3cdiv data-dojo-attach-point\x3d"btnAddStatisticsNode" class\x3d"esriCTBtnStatisticsAddSection"\x3e\r\n                    \x3cspan class\x3d"esriCTBtnAddStatisticsIcon"\x3e\x3c/span\x3e\r\n                    \x3cspan class\x3d"esriCTBtnStatisticsAddLabel"\x3e ${nls.statisticsSettings.addStatisticsLabel}\x3c/span\x3e\r\n                \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTAddLayerTableNode" data-dojo-attach-point\x3d"statisticsLayerTableNode"\x3e\x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTHidden esriCTNoEditableLayersAvailable" data-dojo-attach-point\x3d"noEditableLayersAvailable"\x3e\r\n                ${nls.costingInfo.noEditableLayersAvailable}\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"additionalProjectCostWrapper"\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3c!--Add/delete/reorder buttons--\x3e\r\n    \x3cdiv class\x3d"esriCTStatisticsButtonParentDiv"\x3e\r\n        \x3cdiv class\x3d"esriCTAddStatisticsIcon esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnAddNode"\r\n            title\x3d"${nls.statisticsSettings.addNewStatisticsText}" tabindex\x3d"0" role\x3d"button"\r\n            aria-label\x3d"${nls.statisticsSettings.addNewStatisticsText}"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTDeleteStatisticsIcon esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnCrossNode"\r\n            title\x3d"${nls.statisticsSettings.deleteStatisticsText}" tabindex\x3d"-1" role\x3d"button"\r\n            aria-label\x3d"${nls.statisticsSettings.deleteStatisticsText}"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTStatisticsUpIcon esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnUpNode"\r\n            title\x3d"${nls.statisticsSettings.moveStatisticsUpText}" tabindex\x3d"-1" role\x3d"button"\r\n            aria-label\x3d"${nls.statisticsSettings.moveStatisticsUpText}"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTStatisticsDownIcon esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnDownNode"\r\n            title\x3d"${nls.statisticsSettings.moveStatisticsDownText}" tabindex\x3d"-1" role\x3d"button"\r\n            aria-label\x3d"${nls.statisticsSettings.moveStatisticsDownText}"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/setting/ProjectCost.html":'\x3cdiv\x3e\r\n    \x3c!--Add Addtional Project cost button--\x3e\r\n    \x3cdiv class\x3d"esriCTProjectCostContainer" data-dojo-attach-point\x3d"btnAddProjectCostNodeWrapper"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"btnAddProjectCostNode" class\x3d"esriCTBtnProjectCostAddSection"\x3e\r\n            \x3cspan class\x3d"esriCTBtnAddProjectCostIcon"\x3e\x3c/span\x3e\r\n            \x3cspan class\x3d"esriCTBtnProjectCostAddLabel"\x3e ${nls.projectCostSettings.addProjectCostLabel} \x3c/span\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTProjectCostTableWrapper" data-dojo-attach-point\x3d"projectCostTableWrapper"\x3e\r\n        \x3cdiv class\x3d"esriCTProjectCostTableNode" data-dojo-attach-point\x3d"projectCostTableNode"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3c!--Add/delete/reorder buttons--\x3e\r\n    \x3cdiv class\x3d"esriCTStatisticsButtonParentDiv"\x3e\r\n        \x3cdiv class\x3d"esriCTAddStatisticsIcon esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnAddNode"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTDeleteStatisticsIcon esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnCrossNode"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTStatisticsUpIcon esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnUpNode"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTStatisticsDownIcon esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnDownNode"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/project-attribute.html":'\x3cdiv style\x3d"height: 100%; width: 100%"\x3e\r\n  \x3cdiv class\x3d"esriCTContentSection"\x3e\r\n    \x3cdiv class\x3d"esriCTProjectAttributeTitle"\x3e\r\n      ${nls.projectAttribute.projectAttributeTitle}\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"projectAttributeNode"\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTPageFooter"\x3e\r\n    \x3cdiv class\x3d"jimu-btn esriCTEllipsis" data-dojo-attach-point\x3d"okButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.common.ok}"\x3e${nls.common.ok}\x3c/div\x3e\r\n    \x3cdiv class\x3d"jimu-btn esriCTEllipsis" data-dojo-attach-point\x3d"cancelButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.common.cancel}"\x3e${nls.common.cancel}\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/asset-statistics.html":'\x3cdiv style\x3d"height: 100%; width: 100%"\x3e\r\n  \x3cdiv class\x3d"esriCTContentSection" data-dojo-attach-point\x3d"assetStatisticsNode"\x3e\r\n    \x3cdiv class\x3d"esriCTFloatLeft esriCTFullwidth"\x3e\r\n      \x3cdiv class\x3d"esriCTDetailStatisticsTitle"\x3e\r\n        ${nls.detailStatistics.detailStatisticsLabel}\r\n      \x3c/div\x3e\r\n      \x3c!--Add New Statistics button--\x3e\r\n      \x3cdiv class\x3d"esriCTStatisticsButtonContainer"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"addNewStatisticsIcon" class\x3d"esriCTBtnStatisticsAddSection" tabindex\x3d"0"\r\n          role\x3d"button" aria-label\x3d"${nls.statisticsSettings.addNewStatisticsText}"\r\n          title\x3d"${nls.statisticsSettings.addNewStatisticsText}"\x3e\r\n          \x3cspan class\x3d"esriCTBtnAddStatisticsIcon"\x3e\x3c/span\x3e\r\n          \x3cspan class\x3d"esriCTBtnStatisticsAddLabel"\x3e${nls.detailStatistics.addStatisticsButtonLabel}\x3c/span\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTDetailStatisticsContent esriCTFloatLeft esriCTFullwidth" data-dojo-attach-point\x3d"assetsListNode"\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTPageFooter"\x3e\r\n    \x3cdiv class\x3d"jimu-btn esriCTEllipsis" data-dojo-attach-point\x3d"okButton" tabindex\x3d"0" role\x3d"button"\r\n      aria-label\x3d"${nls.common.back}"\x3e${nls.common.back}\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/CostAnalysis/css/style.css":'.esriCTOverridePanelStyle {height: calc(100% - 20px) !important;}.jimu-widget-cost-analysis-widget .esriCTHidden,.jimu-widget-cost-analysis-statistics-settings .esriCTHidden,.jimu-widget-cost-analysis-scenario-selection .esriCTHidden,.jimu-widget-cost-analysis-create-load-project .esriCTHidden{display: none;}.jimu-widget-cost-analysis-widget .esriCTEllipsis {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}.jimu-widget-cost-analysis-widget .esriCTFloatLeft,.esriRtl .jimu-widget-cost-analysis-asset-statistics .esriCTStatisticsButtonContainer {float: left;}.jimu-widget-cost-analysis-widget .esriCTFullHeightWidth {height: 100%; width: 100%;}.jimu-widget-cost-analysis-widget .esriCTFullwidth {width: 100%;}.esriCTPageFooter {text-align: center; margin-top: 15px;}.jimu-widget-cost-analysis-widget .jimu-btn {max-width: 150px;}.esriCTPageFooter .jimu-btn {margin: 5px;}.esriCTContentSection {height: calc(100% - 50px); overflow-y: auto; overflow-x: hidden;}.jimu-widget-cost-analysis-widget .esriCTStatisticsButtons {height: 24px; width: 24px; background-size: 20px; background-position: center; float: left; background-repeat: no-repeat; margin: 0px 5px 0px 0px;}.esriRtl .jimu-widget-cost-analysis-widget .esriCTStatisticsButtons {float: right; margin: 0px 0px 0px 5px;}.jimu-widget-cost-analysis-widget .esriCTAddStatisticsIcon {background-image: url(../images/add.png); border: 1px solid gray; cursor: pointer;}.jimu-widget-cost-analysis-widget .esriCTAddStatisticsIconDisable {background-image: url(../images/add-disabled.png); border: 1px solid gray; cursor: default;}.jimu-widget-cost-analysis-widget .esriCTDeleteStatisticsIcon {background-image: url(../images/delete.png); border: 1px solid gray; cursor: pointer;}.jimu-widget-cost-analysis-widget .esriCTDeleteStatisticsIconDisable {background-image: url(../images/delete-disabled.png); border: 1px solid gray; cursor: default;}.jimu-widget-cost-analysis-widget .esriCTStatisticsUpIcon {background-image: url(../images/up.png); border: 1px solid gray; cursor: pointer;}.jimu-widget-cost-analysis-widget .esriCTStatisticsUpIconDisable {background-image: url(../images/up-disabled.png); border: 1px solid gray; cursor: default;}.jimu-widget-cost-analysis-widget .esriCTStatisticsDownIcon {background-image: url(../images/down.png); border: 1px solid gray; cursor: pointer;}.jimu-widget-cost-analysis-widget .esriCTStatisticsDownIconDisable {background-image: url(../images/down-disabled.png); border: 1px solid gray; cursor: default;}.esriRtl .jimu-widget-cost-analysis-widget .esriCTStatisticsButtonParentDiv {float: right;}.esriRtl .jimu-widget-cost-analysis-widget .esriCTAdd {float: right; margin: 5px 0px 5px 2px;}.jimu-widget-cost-analysis-project-summary .esriCTCostEscalationTitle {font-weight: bold; padding-bottom: 10px;}.jimu-widget-cost-analysis-project-summary .esriCTCostEscalatioParent {margin-bottom: 10px;}.jimu-widget-cost-analysis-item-list .esriCTItemListContainer {border: 1px solid #d9d9d9;}.jimu-widget-cost-analysis-item-list .esriCTItemTitleContainer {background-color: #f5f5f5; color: #444; cursor: pointer; border-bottom: 1px solid #d9d9d9;}.jimu-widget-cost-analysis-item-list .esriCTItemHighlighter, .jimu-widget-cost-analysis-advance-item-list .esriCTItemHighlighter {height: 45px; width: 5px; float: left;}.jimu-widget-cost-analysis-item-list .esriCTItemTitle {padding: 15px; text-align: left; border: none; outline: none;}.jimu-widget-cost-analysis-item-list .esriCTItemTitleContainer .esriCTItemTitleActive, .jimu-widget-cost-analysis-item-list .esriCTItemTitleContainer:hover {background-color: #ddd; font-weight: bold;}.jimu-widget-cost-analysis-item-list .esriCTItemContent {padding: 0 15px; overflow: hidden; height: 0; opacity: 0; transition: all .3s ease .15s;}.jimu-widget-cost-analysis-item-list .esriCTItemContentActive {padding: 15px; opacity: 1; border-bottom: 1px solid #d9d9d9;}.esriRtl .jimu-widget-cost-analysis-item-list .esriCTItemTitle {text-align: right;}.esriRtl .jimu-widget-cost-analysis-item-list .esriCTItemHighlighter, .esriRtl .jimu-widget-cost-analysis-advance-item-list .esriCTItemHighlighter {float: right;}.jimu-widget-cost-analysis-advance-item-list .esriCTItemListContainer {float: left; width: 100%; border: 1px solid #d9d9d9;}.jimu-widget-cost-analysis-advance-item-list .esriCTItemTitleContainer {background-color: #f5f5f5; color: #444; cursor: pointer; border-bottom: 1px solid #d9d9d9; width: 100%; display: inline-block;}.jimu-widget-cost-analysis-advance-item-list .esriCTItemTitleContainer:focus {outline: 2px solid #24B5CC !important; outline-offset: -2px;}.jimu-widget-cost-analysis-advance-item-list .esriCTItemTitle {padding: 15px 5px 15px 5px; text-align: left; border: none; outline: none;}.esriRtl .jimu-widget-cost-analysis-advance-item-list .esriCTItemTitle {float: right; text-align: right;}.jimu-widget-cost-analysis-advance-item-list .esriCTItemContent {padding: 0 15px; overflow: hidden; height: 0;}.jimu-widget-cost-analysis-advance-item-list .esriCTItemAnimation {transition: all .3s ease .15s; opacity: 0; height: 0;}.jimu-widget-cost-analysis-advance-item-list .esriCTItemContentActive {padding: 5px; opacity: 1; border-bottom: 1px solid #d9d9d9;}.jimu-widget-cost-analysis-advance-item-list .esriCTItemListImageLogo,.jimu-widget-cost-analysis-asset-statistics .esriCTItemListImageLogo {height: 24px; width: 24px; margin-top: 10px; float: left; background-position: center center; background-repeat: no-repeat; background-size: 24px; margin-left: 5px;}.esriRtl .jimu-widget-cost-analysis-advance-item-list .esriCTItemListImageLogo,.esriRtl .jimu-widget-cost-analysis-asset-statistics .esriCTItemListImageLogo {float: right; margin-left: auto; margin-right: 5px;}.jimu-widget-cost-analysis-advance-item-list .esriCTBorder {border: 1px solid grey;}.jimu-widget-cost-analysis-advance-item-list .esriCTArrow {background-image: url("../images/arrow-right.png");}.esriRtl .jimu-widget-cost-analysis-advance-item-list .esriCTArrow {-moz-transform: rotate(180deg); -o-transform: rotate(180deg); -webkit-transform: rotate(180deg); transform: rotate(180deg);}.jimu-widget-cost-analysis-advance-item-list .esriCTArrowDown {-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: 16px;}.jimu-widget-cost-analysis-advance-item-list .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: 16px;}.jimu-widget-cost-analysis-advance-item-list .esriCTAssetActionSettingIcon {background-image: url("../images/setting.png"); border: 1px solid grey;}.jimu-widget-cost-analysis-create-load-project .esriCTCreateProjectWrapper, .jimu-widget-cost-analysis-create-load-project .esriCTLoadProjectWrapper {height: 100%;}.jimu-widget-cost-analysis-create-load-project .esriCTCreateProjectContent {margin-bottom: 10px;}.jimu-widget-cost-analysis-create-load-project .esriCTCreateProjectContent .dijitSelect:focus {border: 1px solid #24B5CC !important; outline-offset: -2px !important;}.jimu-widget-cost-analysis-create-load-project .esriCTCreateLoadButtonWrap {text-align: center; margin-top: 5px;}.jimu-widget-cost-analysis-create-load-project .esriCTLoadProjectWrapper .jimu-btn {max-width: 33%; margin: 5px;}.jimu-widget-cost-analysis-statistics-settings .esriCTBtnStatisticsAddSection,.jimu-widget-cost-analysis-asset-statistics .esriCTBtnStatisticsAddSection {display: inline-block; overflow: hidden; height: 20px; cursor: pointer; font-size: 13px; color: #538ec8; margin-right: 2px;}.jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsHeaderCheckBox:focus,.jimu-widget-cost-analysis-asset-statistics .esriCTNoDetailStatisticMessage:focus,.jimu-widget-cost-analysis-asset-details .esriCTNoAssetMessage:focus {border: 1px solid #24B5CC !important; outline-offset: -2px !important;}.jimu-widget-cost-analysis-statistics-settings .esriCTNoEditableLayersAvailable {color: red; font-style: italic; margin: 0 10px;}.jimu-widget-cost-analysis-statistics-settings .esriCTBtnAddStatisticsIcon {height: 100%; width: 14px; background-repeat: no-repeat; background-position: center center; background-image: url(images/add.png); display: inline-block; vertical-align: top;}.jimu-widget-cost-analysis-statistics-settings .esriCTBtnStatisticsAddLabel,.jimu-widget-cost-analysis-asset-statistics .esriCTBtnStatisticsAddLabel {line-height: 20px;}.jimu-widget-cost-analysis-statistics-settings .esriCTTabContainer {width: 100%; float: left; margin-bottom: 10px; border: 1px solid #D2DAE2;}.jimu-widget-cost-analysis-statistics-settings .esriCTLayerLabelTextBox {width: 100%; height: 29px; float: left;}.jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsContainer {float: left; width: 40%;}.jimu-widget-cost-analysis-statistics-settings .esriCTDropDownContainer {width: 75%; float: right;}.jimu-widget-cost-analysis-statistics-settings .esriCTLayerNameDropdown .dijitSelectLabel, .jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsTypeDropdown .dijitSelectLabel, .jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsFieldDropdown .dijitSelectLabel {text-align: left; overflow: hidden;}.claro .jimu-widget-cost-analysis-statistics-settings .esriCTAddLayerTableNode .dijitSelect {height: 28px; min-width: 100%; float: left;}.jimu-widget-cost-analysis-add-new-statistics .esriCTAddNewStatisticsLabel {padding: 0px 0px 10px 0px;}.jimu-widget-cost-analysis-statistics-settings .esriCTCursorPointer {cursor: pointer;}.esriRtl .jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsContainer {float: right;}.esriRtl .claro .jimu-widget-cost-analysis-statistics-settings .esriCTAddLayerTableNode .dijitSelect {height: 28px; min-width: 100%;}.esriRtl .jimu-widget-cost-analysis-statistics-settings .esriCTLayerNameDropdown .dijitSelectLabel {text-align: right;}.esriRtl .jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsTypeDropdown .dijitSelectLabel {text-align: right;}.esriRtl .jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsFieldDropdown .dijitSelectLabel {text-align: right;}.jimu-widget-cost-analysis-statistics-settings .jimu-simple-table .simple-table-title {color: #7989a0;}.jimu-widget-cost-analysis-statistics-settings .jimu-simple-table .head-section {background-color: #D2DAE2; border-bottom: 1px solid #D2DAE2;}.jimu-widget-cost-analysis-statistics-settings .jimu-simple-table .simple-table-field, .jimu-simple-table .simple-table-cell {padding: 0px 0px 0px 1px !important;}.jimu-widget-cost-analysis-statistics-settings .jimu-simple-table {font-size: 11px; font-weight: bold;}.jimu-widget-cost-analysis-statistics-settings .jimu-simple-table .simple-table-row:hover {background-color: transparent !important;}.jimu-widget-cost-analysis-statistics-settings .dijitReset.dijitInputField.dijitButtonText {padding: 0px 1px 0px 1px; width: 100%; text-align: left;}.esriRtl .jimu-widget-cost-analysis-statistics-settings .dijitReset.dijitInputField.dijitButtonText {text-align: right;}.jimu-widget-cost-analysis-statistics-settings .dijitReset.dijitInputField.dijitInputContainer {padding: 0px 1px 0px 1px;}.claro .jimu-widget-cost-analysis-add-new-statistics .dijitTextBox .dijitInputInner {color: #7989a0; font-size: 11px;}.jimu-widget-cost-analysis-project-summary .jimu-simple-table .simple-table-title {color: #7989a0;}.jimu-widget-cost-analysis-project-summary .jimu-simple-table .head-section {background-color: #D2DAE2; border-bottom: 1px solid #D2DAE2;}.jimu-widget-cost-analysis-project-summary .body-section {overflow: hidden;}.jimu-widget-cost-analysis-project-summary .jimu-simple-table .simple-table-field, .jimu-simple-table .simple-table-cell {padding: 0px 0px 0px 1px;}.jimu-widget-cost-analysis-project-summary .jimu-simple-table .simple-table-field, .jimu-simple-table .simple-table-cell {padding: 0px 0px 0px 1px;}.claro .jimu-widget-cost-analysis-project-summary .esriCTCostEscalatioParent .dijitSelect {height: 26px; margin-top: -4px;}.claro .jimu-widget-cost-analysis-project-summary .esriCTCostEscalatioParent .dijitTextBox {height: 26px; margin-top: -4px;}.jimu-widget-cost-analysis-statistics-settings .esriCTAddStatisticsIcon {background-image: url(../images/add.png); border: 1px solid gray;}.jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsButtons {height: 24px; width: 24px; background-size: 24px; float: left; background-repeat: no-repeat; margin: 0px 5px 0px 0px;}.esriRtl .jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsButtons {float: right; margin: 0px 0px 0px 5px;}.jimu-widget-cost-analysis-statistics-settings .esriCTDeleteStatisticsIcon {background-image: url(../images/delete.png); border: 1px solid gray;}.jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsUpIcon {background-image: url(../images/up.png); border: 1px solid gray;}.jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsDownIcon {background-image: url(../images/down.png); border: 1px solid gray;}.jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsUpIconDisable {background-image: url(../images/up-disabled.png); border: 1px solid gray;}.jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsDownIconDisable {background-image: url(../images/down-disabled.png); border: 1px solid gray;}.esriRtl .jimu-widget-cost-analysis-statistics-settings .esriCTStatisticsButtonParentDiv {float: right;}.esriRtl .jimu-widget-cost-analysis-statistics-settings .esriCTAdd {float: right; margin: 5px 0px 5px 2px;}.jimu-widget-cost-analysis-work-bench .esriCTAddEditFeatureContainer {border: 1px solid #d9d9d9; margin-bottom: 20px;}.jimu-widget-cost-analysis-work-bench .esriCTEditorToolBar {max-height: 30px;}.jimu-widget-cost-analysis-work-bench .esriCTSelectFeatureToCopyParentContainer {clear: both; padding: 10px 0; width: 100%; overflow: auto; border: 1px solid #d9d9d9; border-collapse: collapse;}.jimu-widget-cost-analysis-work-bench .esriCTTemplatePickerLabel{font-weight: bold; border: 1px solid #d9d9d9; border-top: none; border-bottom: none; padding: 5px 2px 5px;}.jimu-widget-cost-analysis-work-bench .esriCTSelectFeatureLabel {float: left; line-height: 24px; width: 70%; text-align: left; padding: 2px; font-weight: bold;}.esriRtl .jimu-widget-cost-analysis-work-bench .esriCTSelectFeatureLabel {float: right;}.jimu-widget-cost-analysis-work-bench .esriCTSelectFeatureToCopyContainer {float: right;}.esriRtl .jimu-widget-cost-analysis-work-bench .esriCTSelectFeatureToCopyContainer {float: left;}.jimu-widget-cost-analysis-work-bench .esriCTFeatureModeIcons {float: left; background-position: center center; height: 24px; width: 24px; background-size: 24px; background-repeat: no-repeat; cursor: pointer; margin-right: 10px;}.jimu-widget-cost-analysis-work-bench .esriCTFeatureModeIcons:focus {outline: 2px solid #24B5CC !important; outline-offset: -2px;}.esriRtl .jimu-widget-cost-analysis-work-bench .esriCTFeatureModeIcons {float: right; margin-left: 10px; margin-right: 0px;}.jimu-widget-cost-analysis-work-bench .esriCTSelectEnable {background-image: url("../images/select-enable.png");}.jimu-widget-cost-analysis-work-bench .esriCTSelectDisable {background-image: url("../images/select-disable.png");}.jimu-widget-cost-analysis-work-bench .esriCTSketchDisable {background-image: url("../images/sketch-disable.png");}.jimu-widget-cost-analysis-work-bench .esriCTSketchEnable {background-image: url("../images/sketch-enable.png");}.jimu-widget-cost-analysis-work-bench .esriCTAssetTemplatePicker .templatePicker {border: none; padding: 1px;}.jimu-widget-cost-analysis-work-bench .esriCTEditorToolBar .esriEditor .progressBar {display: none !important;}.jimu-widget-cost-analysis-work-bench .esriCTProjectOverview {overflow: hidden;}.jimu-widget-cost-analysis-project-overview .esriCTSummaryLayerTitle {padding: 5px; font-weight: bold;}.jimu-widget-cost-analysis-project-overview .esriCTTotalCostTable {margin-top: 5px;}.jimu-widget-cost-analysis-work-bench .esriCTProjectName {font-size: 16px; width: 100%; font-size: 16px; border: 1px solid #d9d9d9; padding: 5px 2px; word-break: break-word;}.jimu-widget-cost-analysis-work-bench .esriCTProjectName:focus {outline: 2px solid #24B5CC !important; outline-offset: -2px;}.jimu-widget-cost-analysis-asset-details .esriCTBoldFont, .jimu-widget-cost-analysis-work-bench .esriCTBoldFont, .jimu-widget-cost-analysis-project-summary .esriCTBoldFont {font-weight: bold;}.jimu-widget-cost-analysis-project-overview .esriCTTable, .jimu-widget-cost-analysis-project-summary .esriCTProjectCostTable, .jimu-widget-cost-analysis-asset-details .esriCTTable {padding: 0; border-collapse: collapse; border-spacing: 0; width: 100%; page-break-inside: avoid; table-layout: fixed;}.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTTable, .esriRtl .jimu-widget-cost-analysis-project-overview .esriCTTable, .esriRtl .jimu-widget-cost-analysis-project-summary .esriCTProjectCostTable {direction: rtl;}.jimu-widget-cost-analysis-asset-details .esriCTTable td, .jimu-widget-cost-analysis-project-overview .esriCTTable td, .jimu-widget-cost-analysis-project-summary .esriCTProjectCostTable td {border: 1px solid #d9d9d9; word-wrap: break-word; padding: 4px;}.jimu-widget-cost-analysis-asset-details .esriCTTable .esriCTSelectableRow:hover td, .jimu-widget-cost-analysis-asset-details .esriCTRowSelected {background-color: #eeeeee; cursor: pointer;}.jimu-widget-cost-analysis-asset-details .esriCTTable th {display: table-row; vertical-align: inherit; border-color: inherit;}.jimu-widget-cost-analysis-project-summary .esriCTProjectCostTable {width: 100%; margin-top: 10px;}.claro .jimu-widget-cost-analysis-project-summary .dijitSelect {height: 28px;}.jimu-widget-cost-analysis-project-summary .esriCTCostLabelTextbox {width: 75%; height: 28px; margin-left: 5px;}.jimu-widget-cost-analysis-project-summary .esriCTCostTypeDropDownContainer {width: 35%; float: right;}.jimu-widget-cost-analysis-project-summary .esriCTCostTypeDropdown .dijitSelectLabel {text-align: left; overflow: hidden; width: 30px;}.claro .jimu-widget-cost-analysis-project-summary .esriCTAddLayerTableNode .dijitSelect {height: 28px; min-width: 100%; float: left;}.jimu-simple-table .simple-table-field, .esriCTCostEscalatioParent .jimu-simple-table .simple-table-cell {padding-left: 2px;}.jimu-widget-cost-analysis-asset-details .esriCTTotalCostTitle {font-weight: bold; width: calc(100% - 25px); float: left; line-height: 30px;}.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTTotalCostTitle {float: right;}.jimu-widget-cost-analysis-asset-details .esriCTAssetDetailsTitle {font-weight: bold; padding-bottom: 10px; width : calc(100% - 50px); float: left;}.jimu-widget-cost-analysis-asset-details .esriCTGroupTitle {font-weight: bold; padding-top: 1px; width: calc(100% - 40px); float: left;}.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTGroupTitle,.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTAssetDetailsTitle {float: right;}.jimu-widget-cost-analysis-asset-details .esriCTToggleIcon {height: 15px; width: 15px; background-size: 15px; background-position: center; float: left; background-repeat: no-repeat; margin: 0 5px 0 0; cursor: pointer;}.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTToggleIcon {float: right; margin: 0 0 0 5px;}.jimu-widget-cost-analysis-asset-details .esriCTExpandIcon {background-image: url(../images/expand.png);}.jimu-widget-cost-analysis-asset-details .esriCTCollapseIcon {background-image: url(../images/collapse.png);}.jimu-widget-cost-analysis-asset-details .esriCTEditEquationIcon {height: 16px; width: 16px; background-size: 16px; background-position: center; float: left; background-repeat: no-repeat; background-image: url(../images/edit-equation.png); cursor: pointer;}.jimu-widget-cost-analysis-asset-details .esriCTGroupTitleParent {padding: 10px 0 5px 0; float: left; width: 100%;}.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTGroupTitleParent {float: right;}.jimu-widget-cost-analysis-asset-details .esriCTGroupSummaryTotalTitle {font-weight: bold; text-align: right;}.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTGroupSummaryTotalTitle {text-align: left;}.jimu-widget-cost-analysis-asset-details .esriCTDialogIcon {height: 20px; width: 20px; background-size: 20px; background-position: center; float: left; background-repeat: no-repeat;}.jimu-widget-cost-analysis-asset-details .esriCTZoom {background-image: url(../images/zoom-in.png); margin-right: 10px;}.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTZoom, .esriRtl .jimu-widget-cost-analysis-asset-details .esriCTDelete {float: right; margin: 0;}.jimu-widget-cost-analysis-asset-details .esriCTDelete {background-image: url(../images/delete-asset.png); margin-right: 10px;}.jimu-widget-cost-analysis-asset-details .esriCTClose {background-image: url(../images/delete.png); float: right; cursor: pointer;}.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTClose {float: left;}.jimu-widget-cost-analysis-asset-details .esriCTRowContainer {height: 20px; cursor: pointer; margin-bottom: 10px;}.jimu-widget-cost-analysis-asset-details .esriCTRowContainer:hover {background-color: #eeeeee;}.jimu-widget-cost-analysis-asset-details .esriCTTooltipDialogLabel {text-overflow: ellipsis; overflow: hidden; white-space: nowrap; width: calc(100% - 30px); line-height: 20px;}.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTTooltipDialogLabel {text-align: left;}.esriRtl .jimu-widget-cost-analysis-advance-item-list .esriCTItemListContainer {float: none;}.jimu-widget-cost-analysis-project-overview .esriCTAssetItemsCost {text-align: right;}.esriRtl .jimu-widget-cost-analysis-project-overview .esriCTAssetItemsCost {text-align: left;}.jimu-widget-cost-analysis-project-overview .esriCTAssetItemsTotalCostLabel, .jimu-widget-cost-analysis-project-overview .esriCTAssetItemsGrossCostLabel {width: 66.66%;}.jimu-widget-cost-analysis-project-overview .esriCTAssetItemsTotalCost, .jimu-widget-cost-analysis-project-overview .esriCTAssetItemsGrossCost {text-align: right; width: 33.34%;}.esriRtl .jimu-widget-cost-analysis-project-overview .esriCTAssetItemsTotalCost, .esriRtl .jimu-widget-cost-analysis-project-overview .esriCTAssetItemsGrossCost {text-align: left;}.jimu-widget-cost-analysis-asset-details .esriCTGroupSummaryTotalCost {text-align: right;}.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTGroupSummaryTotalCost {text-align: left;}.jimu-widget-cost-analysis-asset-details .esriCTAssetDetailsTotalCostLabel, .jimu-widget-cost-analysis-asset-details .esriCTAssetDetailsGrossCostLabel {width: 66%;}.jimu-widget-cost-analysis-asset-details .esriCTAssetDetailsTotalCost, .jimu-widget-cost-analysis-asset-details .esriCTAssetDetailsGrossCost {text-align: right; width: 34%;}.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTAssetDetailsTotalCost, .esriRtl .jimu-widget-cost-analysis-asset-details .esriCTAssetDetailsGrossCost {text-align: left;}.jimu-widget-cost-analysis-project-summary .esriCTProjectSummaryTotalCost {text-align: right;}.esriRtl .jimu-widget-cost-analysis-project-summary .esriCTProjectSummaryTotalCost {text-align: left;}.jimu-widget-cost-analysis-project-summary .esriCTProjectSummaryTotalCostLabel, .jimu-widget-cost-analysis-project-summary .esriCTProjectSummaryTotalGrossLabel {width: 66%;}.jimu-widget-cost-analysis-project-summary .esriCTProjectSummaryTotalCost, .jimu-widget-cost-analysis-project-summary .esriCTProjectSummaryTotalGross {text-align: right; width: 34%;}.esriRtl .jimu-widget-cost-analysis-project-summary .esriCTProjectSummaryTotalCost, .esriRtl .jimu-widget-cost-analysis-project-summary .esriCTProjectSummaryTotalGross {text-align: left;}.jimu-widget-cost-analysis-asset-details .esriCTAssetItemDetailsNetValue {text-align: right;}.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTAssetItemDetailsNetValue {text-align: left;}.jimu-widget-cost-analysis-asset-details .esriCTAssetItemDetailsCostingValue {text-align: right;}.esriRtl .jimu-widget-cost-analysis-asset-details .esriCTAssetItemDetailsCostingValue {text-align: left;}.jimu-widget-cost-analysis-asset-details .esriCTNoAssetMessage {padding: 10px 0; text-align: center; font-weight: bold; width: 100%; float: left;}.jimu-widget-cost-analysis-equation-editor .esriCTCostEquationTitle {font-weight: bold; padding-bottom: 10px;}.jimu-widget-cost-analysis-equation-editor .esriCTEditCostEquationLabel {padding: 5px 0;}.jimu-widget-cost-analysis-equation-editor .esriCTEditCostEquationInput {margin-bottom: 5px;}.jimu-widget-cost-analysis-equation-editor .esriCTFullWidth {width: 99%;}.jimu-widget-cost-analysis-equation-editor .esriCTEllipsis {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}.jimu-widget-cost-analysis-equation-editor .esriCTHint {margin: 5px 5px 10px 0px; float: right; font-size: 12px; color: #a0acbf; font-style: oblique;}.jimu-widget-cost-analysis-equation-editor .esriCTInvalidEquation {border: 1px solid red;}.jimu-widget-cost-analysis-project-attribute .esriCTProjectAttributeTitle {font-weight: bold; padding-bottom: 10px;}.jimu-widget-cost-analysis-asset-statistics .esriCTAssetActionIcon {background-image: url("../images/rightImg.png"); background-color: #eeeeee; float: right; margin-bottom: 5px !important; cursor: pointer;}.esriRtl .jimu-widget-cost-analysis-asset-statistics .esriCTAssetActionIcon {float: left;}.jimu-widget-cost-analysis-asset-statistics .esriCTStatisticLabel {padding-bottom: 5px;}.jimu-widget-cost-analysis-asset-statistics .esriCTStatisticWrapper {margin-bottom: 10px;}.jimu-widget-cost-analysis-asset-statistics .esriCTDetailStatisticsTitle {font-weight: bold; padding-top: 15px; font-weight: bold; width: 80%; float: left;}.esriRtl .jimu-widget-cost-analysis-asset-statistics .esriCTDetailStatisticsTitle {float: right;}.jimu-widget-cost-analysis-asset-statistics .esriCTNoDetailStatisticMessage {padding: 10px 0; text-align: center; font-weight: bold; float: left; width: 100%;}.dart-panel .jimu-widget-cost-analysis-item-list .esriCTItemTitleContainer .esriCTItemTitleActive, .dart-panel .jimu-widget-cost-analysis-item-list .esriCTItemTitleContainer:hover, .dart-panel .jimu-widget-cost-analysis-advance-item-list .esriCTItemTitleContainer .esriCTItemTitleActive, .dart-panel .jimu-widget-cost-analysis-advance-item-list .esriCTItemTitleContainer:hover {background-color: #808080;}.dart-panel .jimu-widget-cost-analysis-item-list .esriCTItemListContainer, .dart-panel .jimu-widget-cost-analysis-advance-item-list .esriCTItemListContainer {border: 1px solid #808080;}.dart-panel .jimu-widget-cost-analysis-item-list .esriCTItemTitleContainer, .dart-panel .jimu-widget-cost-analysis-advance-item-list .esriCTItemTitleContainer {background-color: #646464; border-bottom: 1px solid #808080;}.dart-panel .jimu-widget-cost-analysis-asset-details .esriCTTable .esriCTSelectableRow:hover td, .dart-panel .jimu-widget-cost-analysis-asset-details .esriCTRowSelected {background-color: #808080;}.dart-panel .jimu-widget-cost-analysis-work-bench .esriCTAssetTemplatePicker .templatePicker .dojoxGrid {background-color: #4C4C4C;}.dart-panel .jimu-widget-cost-analysis-work-bench .esriCTAssetTemplatePicker .templatePicker .dojoxGridScrollbox {background-color: #4C4C4C;}.dart-panel .jimu-widget-cost-analysis-work-bench .esriCTAssetTemplatePicker .templatePicker .dojoxGridRow, .dart-panel .jimu-widget-cost-analysis-work-bench .esriCTAssetTemplatePicker .templatePicker .dojoxGridRow dojoxGridRowOdd {background-color: #4C4C4C; border-color: #4C4C4C;}.dart-panel .jimu-widget-cost-analysis-work-bench .esriCTAssetTemplatePicker .templatePicker .grid .dojoxGridRowOver {background-color: #4C4C4C;}.dart-panel .jimu-widget-cost-analysis-work-bench .esriCTAssetTemplatePicker .templatePicker .grid .dojoxGridCell, .dart-panel .jimu-widget-cost-analysis-work-bench .esriCTAssetTemplatePicker .templatePicker .grid .dojoxGridCell:hover {border: 1px solid #4C4C4C; background-color: #4C4C4C;}.dart-panel .jimu-widget-cost-analysis-work-bench .esriCTAssetTemplatePicker .templatePicker .grid .dojoxGridCellFocus {border: 1px solid #4C4C4C !important; background-color: #4C4C4C;}.dart-panel .jimu-widget-cost-analysis-work-bench .esriCTAssetTemplatePicker .templatePicker .grid .item:hover {background-color: #808080;}.dart-panel .jimu-widget-cost-analysis-work-bench .esriCTAssetTemplatePicker .templatePicker .esriMapTooltip {color: #000 !important;}.dart-panel .jimu-widget-cost-analysis-work-bench .esriCTAssetTemplatePicker .templatePicker .dojoxGridMasterMessages {background-color: #4C4C4C;}.dart-panel .jimu-widget-cost-analysis-widget .esriCTAddStatisticsIcon {background-image: url(../images/add-disabled.png);}.dart-panel .jimu-widget-cost-analysis-widget .esriCTAddStatisticsIconDisable {background-image: url(../images/add.png);}.dart-panel .jimu-widget-cost-analysis-widget .esriCTDeleteStatisticsIcon {background-image: url(../images/delete-disabled.png);}.dart-panel .jimu-widget-cost-analysis-widget .esriCTDeleteStatisticsIconDisable {background-image: url(../images/delete.png);}.dart-panel .jimu-widget-cost-analysis-widget .esriCTStatisticsUpIcon {background-image: url(../images/up-disabled.png);}.dart-panel .jimu-widget-cost-analysis-widget .esriCTStatisticsUpIconDisable {background-image: url(../images/up.png);}.dart-panel .jimu-widget-cost-analysis-widget .esriCTStatisticsDownIcon {background-image: url(../images/down-disabled.png);}.dart-panel .jimu-widget-cost-analysis-widget .esriCTStatisticsDownIconDisable {background-image: url(../images/down.png);}.dart-panel .jimu-widget-cost-analysis-statistics-settings .jimu-simple-table .head-section, .dart-panel .jimu-widget-cost-analysis-project-summary .jimu-simple-table .head-section {background-color: #808080;}.dart-panel .esriCTCopyFeaturesMainContainer {background-color: #4c4c4c !important;}.claro .dart-panel .jimu-widget-cost-analysis-equation-editor .dijitTextBoxDisabled .dijitInputContainer, .claro .dart-panel .jimu-widget-cost-analysis-project-attribute .dijitTextBoxDisabled .dijitInputContainer, .claro .dart-panel .jimu-widget-cost-analysis-asset-statistics .dijitTextBoxDisabled .dijitInputContainer, .claro .dart-panel .jimu-widget-cost-analysis-equation-editor .dijitTextBoxDisabled, .claro .dart-panel .jimu-widget-cost-analysis-project-attribute .dijitTextBoxDisabled, .claro .dart-panel .jimu-widget-cost-analysis-asset-statistics .dijitTextBoxDisabled {background-color: #888888;}.claro .dart-panel .jimu-widget-cost-template-picker .dijitToolbar {background: transparent !important; background-image: none !important; background-color: #c1c1c1 !important; border: none !important;}.jimu-launchpad-panel .jimu-widget-cost-analysis-add-new-statistics .jimu-simple-table .simple-table-cell {padding-left: 0px; padding-right: 0px;}.jimu-launchpad-panel .jimu-widget-cost-analysis-project-summary .jimu-checkbox,.jimu-launchpad-panel .jimu-widget-cost-analysis-statistics-settings .jimu-checkbox {display: inline-flex;}.claro .jimu-launchpad-panel .jimu-widget-cost-analysis-equation-editor .dijitTextBoxDisabled .dijitInputContainer, .claro .jimu-launchpad-panel .jimu-widget-cost-analysis-project-attribute .dijitTextBoxDisabled .dijitInputContainer, .claro .jimu-launchpad-panel .jimu-widget-cost-analysis-asset-statistics .dijitTextBoxDisabled .dijitInputContainer, .claro .jimu-launchpad-panel .jimu-widget-cost-analysis-equation-editor .dijitDisabled input, .claro .jimu-launchpad-panel .jimu-widget-cost-analysis-project-attribute .dijitDisabled input, .claro .jimu-launchpad-panel .jimu-widget-cost-analysis-asset-statistics .dijitDisabled input, .claro .jimu-launchpad-panel .jimu-widget-cost-analysis-equation-editor textarea.dijitTextAreaDisabled, .claro .jimu-launchpad-panel .jimu-widget-cost-analysis-project-attribute textarea.dijitTextAreaDisabled, .claro .jimu-launchpad-panel .jimu-widget-cost-analysis-asset-statistics textarea.dijitTextAreaDisabled {color: #000; background-color: #888888;}.claro .jimu-launchpad-panel .jimu-widget-cost-analysis-project-attribute .dijitComboBox .dijitButtonNode {height: 30px !important;}.esriCTRegionDetailsParentDiv {overflow: hidden; padding-bottom: 20px;}.esriCTScenarioDetailsParentDiv {overflow: hidden;}.esriCTRegionLabel {float: left; width: 29%; line-height: 30px;}.esriCTScenarioLabel {float: left; width: 29%; line-height: 30px;}.esriCTRegionTextBox {width: 70%; float: right;}.esriCTScenarioDropdown {float: right; width: 70%;}.claro .jimu-widget-cost-analysis-scenario-selection .esriCTRegionDetailsParentDiv .dijitTextBox {background-color: #C0C0C0 !important;}.claro .jimu-widget-cost-analysis-scenario-selection .esriCTRegionDetailsParentDiv .dijitTextBoxFocused .dijitTextBoxReadOnlyFocused .dijitReadOnlyFocused {background-color: #C0C0C0 !important;}.esriCTCopyFeaturesMainContainer {border: 1px solid #d9d9d9; position: absolute; top: 0; background-color: #fff; height: calc(100% + 10px); width: 100%;}.jimu-widget-cost-analysis-widget .esriCTSelectFeaturesContainer {padding: 5px; height: calc(100% - 10px); width: 100%;}.jimu-widget-cost-analysis-widget .esriCTCopyFeaturesListTitle {margin-bottom: 10px; text-align: center; font-weight: bold;}.jimu-widget-cost-analysis-widget .esriCTCopyFeaturesListContent {height: calc(100% - 110px); width: 100%; overflow: auto;}.jimu-widget-cost-analysis-widget .esriCTCopyFeaturesNode {margin-bottom: 8px;}.jimu-widget-cost-analysis-widget .esriCTCopyFeaturesNode:after {content: ""; display: table; clear: both;}.jimu-widget-cost-analysis-widget .esriCTCopyFeaturesChildNode {margin-left: 16px;}.jimu-widget-cost-analysis-widget .esriCTCopyFeaturesBtn {margin-top: 10px; margin-right: 5px; margin-left: 5px;}.jimu-widget-cost-analysis-widget .esriCTCopyFeaturesBtnContainer {text-align: center;}.jimu-widget-cost-analysis-widget .checkBoxNode.jimu-checkbox:focus {outline: 2px solid #24B5CC !important; outline-offset: -2px;}.jimu-widget-cost-analysis-create-load-project .esriCTUpdateEquationMainContainer {width: 100%;}.jimu-widget-cost-analysis-create-load-project .esriCTUpdateEquationMainContainer .jimu-checkbox .label{width: calc(100% - 32px);}.jimu-widget-cost-analysis-create-load-project .esriCTUpdateEquationMainContainer .jimu-checkbox{width: 100%;}.jimu-widget-cost-analysis-create-load-project .esriCTProjectListMainContainer {height: 100%; width: 100%;}.jimu-widget-cost-analysis-create-load-project .esriCTProjectListChildContainer {height: calc(100% - 45px); overflow: auto; padding-bottom: 10px;}.jimu-widget-cost-analysis-create-load-project .esriCTUpdateButtonContainer {width: 100%; text-align: center;}.jimu-widget-cost-analysis-create-load-project .esriCTNoFeatureFoundScreen {text-align: center;}.jimu-widget-cost-analysis-create-load-project .esriCTUpdateCostRowMainNode {width: 100%; clear: both; padding-top: 10px; padding-bottom: 10px; overflow: hidden;}.jimu-widget-cost-analysis-create-load-project .esriCTUpdateCostSelectAll {padding-left: 0px; padding-right: 0px;}.jimu-widget-cost-analysis-create-load-project .esriCTUpdateCostProjectRow {padding-left: 16px;}.esriRtl .jimu-widget-cost-analysis-create-load-project .esriCTUpdateCostProjectRow {padding-left: 0px; padding-right: 16px;}.jimu-widget-cost-analysis-create-load-project .esriCTUpdateEquationBtnDisabled {pointer-events: none;}.jimu-widget-cost-analysis-project-summary .jimu-simple-table .head-section .simple-table-thead th.simple-table-field .jimu-checkbox {width: 99%; margin-right: 1px;}.jimu-widget-cost-analysis-asset-statistics .esriCTStatisticsButtonContainer {float: right; width: 20%; padding-top: 10px; margin-bottom: 5px!important;}.jimu-widget-cost-analysis-asset-statistics .esriCTBtnAddStatisticsIcon {height: 100%; width: 14px; background-repeat: no-repeat; background-position: center center; background-image: url("../images/addStatistics.png"); display: inline-block; vertical-align: top;}.esriRtl .jimu-widget-cost-analysis-asset-statistics .esriCTBtnStatisticsAddSection {margin-left: 2px;}',
"*now":function(Q){Q(['dojo/i18n!*preload*widgets/CostAnalysis/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/_base/declare jimu/BaseWidget dijit/_WidgetsInTemplateMixin dojo/text!./Widget.html dojo/_base/lang dojo/_base/array dojo/on dojo/dom-construct dojo/dom-class dojo/dom-attr dojo/promise/all dojo/Deferred dojo/string dijit/focus dojo/query dojo/dom-style jimu/portalUtils jimu/dijit/LoadingIndicator jimu/LayerInfos/LayerInfos jimu/utils esri/request esri/graphic esri/layers/FeatureLayer ./create-load-project ./work-bench ./add-new-statistics ./project-attribute ./asset-statistics ./utils dojo/keys".split(" "),function(Q,
I,J,G,u,d,c,a,w,q,e,k,z,f,n,g,m,l,C,A,L,y,v,b,D,h,B,H,T,N){return Q([I,J],{templateString:G,baseClass:"jimu-widget-cost-analysis-widget",_createOrLoadPrj:null,_panels:{},_currentPanel:null,_currentPanelName:null,_layerInfosObj:null,_loadingIndicator:null,_assetDetailStatisticsData:null,_updatedStatisticsData:[],_assetStatistics:null,_createLoadProjectButtonArray:[],_previousOpenedPanel:null,postMixInProperties:function(){this._layerInfosObj=null;this.nls.common={};this.nls.units={};u.mixin(this.nls.common,
window.jimuNls.common);u.mixin(this.nls.units,window.jimuNls.units);var p=z.substitute(this.nls.projectOverview.roundingLabel,{selectedRoundingOption:this.nls.projectOverview.roundCostValues[this.config.generalSettings.roundCostType]});this.nls.projectOverview.roundingLabel=p},postCreate:function(){this.inherited(arguments);this._setTheme();this._getSelectedThemeColor();this._getLayerInfos()},onDeActive:function(){if(this._workBench)this._workBench.onWidgetDeActive()},onActive:function(){if(this._workBench)this._workBench.onWidgetActive()},
onNormalize:function(){this._workBench&&this._workBench.refreshTemplatePicker()},resize:function(){this._workBench&&this._workBench.refreshTemplatePicker();this._addNewStatisticsObj&&this._addNewStatisticsObj.addNewStatisticsObj&&this._addNewStatisticsObj.addNewStatisticsObj.resetAddNewStatisticsDropdown();setTimeout(u.hitch(this,function(){window.appInfo.isRunInMobile&&this._createOrLoadPrj&&this._createOrLoadPrj._resetHeight()}),10);this._openLastVisitedPanel()},onMaximize:function(){this._workBench&&
this._workBench.refreshTemplatePicker()},onOpen:function(){if(this._workBench&&"createLoadPrjPanel"!==this._currentPanelName)this._workBench.onWidgetOpen();this._projectAttribute&&"projectAttribute"===this._currentPanelName&&this._projectAttribute.editProjectAttributes();setTimeout(u.hitch(this,function(){this._openLastVisitedPanel(!0)}),100)},onClose:function(){if(this._workBench)this._workBench.onWidgetClose()},_updateConfigData:function(p){d.forEach(this.config.layerSettings,u.hitch(this,function(E){E.selectedField&&
(E.hasOwnProperty("attributeSetting")||(E.attributeSetting=[]),E.attributeSetting.push({layerField:E.selectedField,projectField:p}),delete E.selectedField)}))},startup:function(){this.inherited(arguments);this._assetStatistics=null;"TabTheme"===this.appConfig.theme.name&&w.add(this.domNode.parentElement,"esriCTOverridePanelStyle");var p=[];if(this.config.projectSettings.projectLayer){var E=this._layerInfosObj.getLayerInfoById(this.config.projectSettings.projectLayer);if(E&&E.layerObject)this.config.projectLayerFields=
T.getPrjLayerFields(E.layerObject);else{T.showMessage(this.nls.projectLayerNotFound);q.set(this.widgetErrorNode,"innerHTML",this.nls.projectLayerNotFound);w.remove(this.widgetErrorNode,"esriCTHidden");return}}p.push(this._getProjectAssetTable());p.push(this._getProjectMulTable());p.push(this._getGeometryServiceURL());p.push(this._getCostingGeometryLayerFields());e(p).then(u.hitch(this,function(r){-1===r.indexOf(!1)?this._initComponents():(q.set(this.widgetErrorNode,"innerHTML",this.nls.unableToFetchInfoErrMessage),
w.remove(this.widgetErrorNode,"esriCTHidden"))}))},_getProjectAssetTable:function(){var p=new k;if(this.config.projectSettings.assetTable){var E;(E=this._layerInfosObj.getTableInfoById(this.config.projectSettings.assetTable))&&E.layerObject?(E=new v(E.layerObject.url),c(E,"load",u.hitch(this,function(r){this.config.assetTableFields=T.getPrjAssetTableFields(r.layer);p.resolve(!0)})),c(E,"error",u.hitch(this,function(){p.resolve(!1)}))):(T.showMessage(this.nls.projectAssetTableNotFound),p.resolve(!1))}else p.resolve(!0);
return p.promise},_getProjectMulTable:function(){var p=new k;if(this.config.projectSettings.multiplierAdditionalCostTable){var E;(E=this._layerInfosObj.getTableInfoById(this.config.projectSettings.multiplierAdditionalCostTable))&&E.layerObject?(E=new v(E.layerObject.url),c(E,"load",u.hitch(this,function(r){this.config.projectMultiplierFields=T.getPrjMultiplierFields(r.layer);p.resolve(!0)})),c(E,"error",u.hitch(this,function(){p.resolve(!1)}))):(T.showMessage(this.nls.projectMultiplierTableNotFound),
p.resolve(!1))}else p.resolve(!0);return p.promise},_getGeometryServiceURL:function(){var p=new k;this.appConfig.portalUrl&&""!==u.trim(this.appConfig.portalUrl)?m.getPortalSelfInfo(this.appConfig.portalUrl).then(u.hitch(this,function(E){this.config.helperServices=E&&E.helperServices;this.config.helperServices&&this.config.helperServices.geometry?p.resolve(!0):p.resolve(!1)}),u.hitch(this,function(){p.resolve(!1)})):p.resolve(!1);return p.promise},_getCostingGeometryLayerFields:function(){var p,E=
new k;this.config.projectSettings.costingGeometryLayer&&this.config.projectSettings.geographyField?((p=this.map.getLayer(this.config.projectSettings.costingGeometryLayer))&&!p.globalIdField&&p.fields&&d.forEach(p.fields,u.hitch(this,function(r){"esriFieldTypeGlobalID"===r.type&&(p.globalIdField=r.name)})),p&&p.globalIdField?E.resolve(!0):(p?T.showMessage(this.nls.invalidCostingGeometryLayer):T.showMessage(this.nls.costingGeometryLayerNotFound),E.resolve(!1))):E.resolve(!0);return E.promise},_initComponents:function(){var p=
{name:"",desc:"",projectId:""};this._initLoadingIndicator();this.config.projectSettings.projectLayer?this._initCreateLoadPrj():this._initWorkBenchPanel(p);this._initAddNewStatistics();this._initAssetDetails();this._initAssetStatistics();this._initProjectSummary();setTimeout(u.hitch(this,function(){this._setFirstAndLastFocusNode()}),500)},_initCreateLoadPrj:function(){this._createOrLoadPrj=new b({nls:this.nls,map:this.map,config:this.config,layerInfosObj:this._layerInfosObj,loadingIndicator:this._loadingIndicator,
appUtils:T,updateLastFocusNode:this._updateLastFocusNode,widgetDomNode:this.domNode,createLoadProjectButtonArray:this._createLoadProjectButtonArray},a.create("div",{},this.createOrLoadProject));this.own(c(this._createOrLoadPrj,"createProject",u.hitch(this,function(p){this._updateConfigData(p.projectIdField);this._initWorkBenchPanel(p);this._assetStatistics||this._initAssetStatistics()})));this.own(c(this._createOrLoadPrj,"loadProject",u.hitch(this,function(p){this._updateConfigData(p.projectIdField);
this._initWorkBenchPanel(p.projectInfo,p)})));this.own(c(this._createOrLoadPrj,"deleteProject",u.hitch(this,function(){this._destroyAssetStatisticsWidget()})));this.own(c(this._createOrLoadPrj,"showCreateLoadPrjPanel",u.hitch(this,function(){this._showPanel("createLoadPrjPanel")})));this._createOrLoadPrj.startup();this._addPanel("createLoadPrjPanel",this.createOrLoadProject);this._showPanel("createLoadPrjPanel")},_initWorkBenchPanel:function(p,E){if(this._workBench)this._workBench.onProjectCreateOrLoad(p,
E),this._showPanel("workBench");else{var r=this._createOrLoadPrj&&this._createOrLoadPrj.selectedProjectFeatureAttr?this._createOrLoadPrj.selectedProjectFeatureAttr:null;this._addPanel("workBench",this.workBenchPanel);this._showPanel("workBench");this._workBench=new D({nls:this.nls,map:this.map,config:this.config,loadingIndicator:this._loadingIndicator,layerInfosObj:this._layerInfosObj,projectInfo:p,selectedProjectFeatureAttr:r,appUtils:T,projectSummaryDiv:this.projectSummary,assetDetailsDiv:this.assetDetails,
assetInfo:E,copyFeaturesNode:this.copyFeatures,widgetId:this.id,widgetDomNode:this.domNode},a.create("div",{},this.workBenchPanel));this.own(c(this._workBench,"reloadProject",u.hitch(this,function(t){this._createOrLoadPrj&&(this._createOrLoadPrj.projectNameSelect.set("value",t),this._createOrLoadPrj.getProjectAssets("LoadProject"))})));this.own(c(this._workBench,"resetProject",u.hitch(this,function(){this._addNewStatisticsObj&&this._addNewStatisticsObj.reset();this._setFirstAndLastFocusNode()})));
this.own(c(this._workBench,"showWorkBenchPanel",u.hitch(this,function(){this._showPanel("workBench");var t=n(".esriCTAssetItems",this.domNode);t&&0<t.length&&f.focus(t[0])})));this.own(c(this._workBench,"showProjectPanel",u.hitch(this,function(){this._addNewStatisticsObj&&this._addNewStatisticsObj.reset();this._showPanel("createLoadPrjPanel")})));this.own(c(this._workBench,"titleClicked",u.hitch(this,function(t){this._previousOpenedPanel="workBench";"0"===t&&this._showPanel("assetDetails");"1"===
t&&this._showPanel("assetStatistics");"2"===t&&this._projectAttribute&&(this._projectAttribute.editProjectAttributes(),this._showPanel("projectAttribute"))})));this.own(c(this._workBench,"showAdditionalCost",u.hitch(this,function(){this._showPanel("projectSummary")})));this.own(c(this._workBench,"showAssetDetails",u.hitch(this,function(){setTimeout(u.hitch(this,function(){this._showPanel("assetDetails");f.focus(this._workBench._assetDetails.additionalCostBtn)}),100)})));this._workBench.startup()}this._initProjectAttribute(p);
this.own(c(this._workBench,"assetInfoUpdated",u.hitch(this,function(t){this._assetStatistics&&(this._assetStatistics.assetItemSummary=t,t=[],t=this.config.statisticsSettings.concat(this._updatedStatisticsData),this._assetStatistics.displayStatisticsDetail(t),setTimeout(u.hitch(this,function(){var x=this._workBench.refreshButton,F=this._workBench.featureModeTextNode;this._workBench.downloadCSVBtn&&"none"!==this._workBench.downloadCSVBtn.style.display&&!w.contains(this._workBench.downloadCSVBtn,"esriCTHidden")&&
this._workBench._canExportProject&&(x=this._workBench.downloadCSVBtn);w.contains(this._workBench.projectNameDiv,"esriCTHidden")||(F=this._workBench.projectNameDiv);T.setFirstAndLastWBFocusNode(this.domNode,F,x);this._workBench&&this._workBench._handle508AccessibilityForTemplatePicker()}),0))})));this.own(c(this._workBench,"onGrossCostUpdated",u.hitch(this,function(t,x){this._loadingIndicator.show();this._getAttributeSettingsInfo(null,{totalCost:t,grossCost:x})})));setTimeout(u.hitch(this,function(){this._setFirstAndLastFocusNode()}),
500)},_initAddNewStatistics:function(){this._addNewStatisticsObj=new h({nls:this.nls,map:this.map,config:this.config,layerInfosObj:this._layerInfosObj,widgetDomNode:this.domNode},a.create("div",{},this.addNewStatisticsNode));this._addNewStatisticsObj.startup();this._addPanel("statisticsPanel",this.addNewStatisticsNode);this.own(c(this._addNewStatisticsObj,"showAssetStatisticsPanel",u.hitch(this,function(){this._previousOpenedPanel="statisticsPanel";this._showPanel("assetStatistics")})));this.own(c(this._addNewStatisticsObj,
"updateStatisticsDetail",u.hitch(this,function(p){var E=[];this._updatedStatisticsData=p;this._assetStatistics&&(E=this.config.statisticsSettings.concat(p),this._assetStatistics.displayStatisticsDetail(E))})))},_initProjectAttribute:function(p){if(p&&p.projectId)if(this._projectAttribute)this._projectAttribute.onProjectLoad(p);else this._projectAttribute=new B({nls:this.nls,map:this.map,config:this.config,layerInfosObj:this._layerInfosObj,projectInfo:p,loadingIndicator:this._loadingIndicator,widgetDomNode:this.domNode},
a.create("div",{},this.projectAttribute)),this.own(c(this._projectAttribute,"onOkButtonClicked",u.hitch(this,function(){this._previousOpenedPanel="projectAttribute";this._showPanel("workBench")}))),this.own(c(this._projectAttribute,"onCancelButtonClicked",u.hitch(this,function(){this._previousOpenedPanel="projectAttribute";this._showPanel("workBench")}))),this.own(c(this._projectAttribute,"onProjectInfoUpdate",u.hitch(this,function(E){this._createOrLoadPrj.selectedProjectFeatureAttr=E.attributes;
this._workBench.updateProjectFeatureAttributes(E.attributes);this._loadingIndicator.show();this._getAttributeSettingsInfo(E.attributes);E=n(".esriCTProjectOverview",this.domNode);f.focus(E[3])}))),this._projectAttribute.startup(),this._addPanel("projectAttribute",this.projectAttribute)},_getAttributeSettingsInfo:function(p,E){var r=[];var t=[],x;for(x in this._workBench._assetItemSummary){var F=this._fetchLayerSettings(x);if((r=F.layerAttrSetting)&&0<r.length){r=[];for(var K in this._workBench._assetItemSummary[x].templates)this._workBench._assetItemSummary[x].templates[K].features&&
(r=this._fetchLayerTemplateFeatures(x,K,F,r,p,E));this._updateFeatureInfoOnLayer(r,x,t)}}e(t).then(u.hitch(this,function(){this._loadingIndicator.hide();var R=this._workBench.refreshButton,U=this._workBench.featureModeTextNode;"none"===this._workBench.downloadCSVBtn.style.display||w.contains(this._workBench.downloadCSVBtn,"esriCTHidden")||(R=this._workBench.downloadCSVBtn);w.contains(this._workBench.projectNameDiv,"esriCTHidden")||(U=this._workBench.projectNameDiv);T.setFirstAndLastWBFocusNode(this.domNode,
U,R);this._workBench&&this._workBench._handle508AccessibilityForTemplatePicker()}))},_fetchLayerSettings:function(p){var E,r;d.some(this.config.layerSettings,u.hitch(this,function(t){t.id===p&&(E=t.attributeSetting,r=t.selectedField)}));return{layerAttrSetting:E,projectField:r}},_fetchLayerTemplateFeatures:function(p,E,r,t,x,F){d.forEach(this._workBench._assetItemSummary[p].templates[E].features,u.hitch(this,function(K){t.push(this._updateFeatureAttributes(p,r.layerAttrSetting,K,x,F))}));return t},
_updateFeatureAttributes:function(p,E,r,t,x){var F,K,R;var U=new y;U.attributes={};U.attributes=r.attributes;var M=this.map.getLayer(p);var P=this._layerInfosObj.getLayerInfoById(this.config.projectSettings.projectLayer).layerObject;d.forEach(E,u.hitch(this,function(V){t?(F=M.getField(V.layerField).length,K=P.getField(V.projectField).length,R=t[V.projectField],F<K&&R&&0<R.length&&(R=R.slice(0,F)),r.attributes[V.layerField]=R,U.attributes[V.layerField]=R):("TOTALASSETCOST"===V.projectField.toUpperCase()&&
(U.attributes[V.layerField]=x.totalCost),"GROSSPROJECTCOST"===V.projectField.toUpperCase()&&(U.attributes[V.layerField]=x.grossCost))}));return U},_updateFeatureInfoOnLayer:function(p,E,r){E=this._layerInfosObj.getLayerInfoById(E).layerObject;r&&r.push(E.applyEdits(null,p,null))},_initAssetDetails:function(){this._addPanel("assetDetails",this.assetDetails)},_initAssetStatistics:function(){this._assetStatistics=new H({nls:this.nls,map:this.map,config:this.config,layerInfosObj:this._layerInfosObj,appUtils:T,
widgetDomNode:this.domNode,assetItemSummary:this._workBench?this._workBench._assetItemSummary:{}},a.create("div",{},this.assetStatistics));this.own(c(this._assetStatistics,"onOkButtonClicked",u.hitch(this,function(){this._previousOpenedPanel="assetStatistics";this._showPanel("workBench")})));this.own(c(this._assetStatistics,"onCancelButtonClicked",u.hitch(this,function(){this._showPanel("workBench")})));this.own(c(this._assetStatistics.addNewStatisticsIcon,"click",u.hitch(this,function(){this._addNewStatisticsObj._initAddNewStatistics();
this._showPanel("statisticsPanel")})));this.own(c(this._assetStatistics.addNewStatisticsIcon,"keydown",u.hitch(this,function(p){if(p.keyCode===N.ENTER||p.keyCode===N.SPACE)this._addNewStatisticsObj._initAddNewStatistics(),this._showPanel("statisticsPanel")})));this._assetStatistics.startup();this._addPanel("assetStatistics",this.assetStatistics)},_initProjectSummary:function(){this._addPanel("projectSummary",this.projectSummary)},_getLayerInfos:function(){C.getInstance(this.map,this.map.webMapResponse.itemInfo).then(u.hitch(this,
function(p){this._layerInfosObj=p}))},_initLoadingIndicator:function(){this._loadingIndicator=new l({hidden:!0});this._loadingIndicator.placeAt(this.domNode.parentNode);this._loadingIndicator.startup()},_showPanel:function(p,E){this._currentPanel&&w.add(this._currentPanel,"esriCTHidden");this._currentPanelName=p;this._currentPanel=this._panels[p];w.remove(this._currentPanel,"esriCTHidden");"workBench"===p&&this._workBench&&(this._workBench.onShow(E),this._workBench._handle508AccessibilityForTemplatePicker());
this._openLastVisitedPanel()},_openLastVisitedPanel:function(p){var E;if("createLoadPrjPanel"===this._currentPanelName&&(E=n(".esriCTItemTitleActive",this.domNode)[0]))switch(E=q.get(E,"paneName"),E){case "creatProject":this._setFirstAndLastFocusNode();break;case "loadProject":this._setFirstAndLastFocusNode();E=n(".esriCTProjectOveriew",this.domNode);E=E.length;2===E&&this._updateLastFocusNode(this._createLoadProjectButtonArray[3],this.domNode);f.focus(this._createOrLoadPrj.projectNameSelect);break;
case "updateCostEquation":this._setFirstAndLastFocusNode();E=n(".esriCTProjectNameCheckBox",this.domNode);f.focus(E[0]);var r=this._createOrLoadPrj._updateProjectCostWidget.updateCostEquationButton;w.contains(r,"esriCTUpdateEquationBtnDisabled")?(r=E.length,this._updateLastFocusNode(E[r-1],this.domNode)):this._updateLastFocusNode(r,this.domNode)}"workBench"===this._currentPanelName&&(this._setFirstAndLastFocusNode(),E=n(".esriCTProjectOverview",this.domNode),"assetStatistics"===this._previousOpenedPanel&&
f.focus(E[2]),"projectAttribute"===this._previousOpenedPanel&&f.focus(E[3]),"assetDetails"===this._previousOpenedPanel&&(this._workBench._assetDetails.setFirstAndLastNode(p),f.focus(E[1])),this._workBench&&this._workBench._handle508AccessibilityForTemplatePicker());"assetStatistics"===this._currentPanelName&&this._assetStatistics.setFirstAndLastNode();"statisticsPanel"===this._currentPanelName&&(E=n(".esriCTAddLayerTableNode th",this.domNode)[0].children[0],w.contains(E,"jimu-state-disabled")?(f.focus(this._addNewStatisticsObj.addNewStatisticsObj.btnAddNode),
A.initFirstFocusNode(this.domNode,this._addNewStatisticsObj.addNewStatisticsObj.btnAddNode)):(A.initFirstFocusNode(this.domNode,E),f.focus(n(".esriCTAddLayerTableNode th",this.domNode)[0].children[0])),A.initLastFocusNode(this.domNode,this._addNewStatisticsObj.cancelButtonNode));"assetDetails"===this._currentPanelName&&this._workBench._assetDetails.setFirstAndLastNode(p);"projectSummary"===this._currentPanelName&&this._workBench._projectSummary.setFirstAndLastNode()},_addPanel:function(p,E){this._panels[p]=
E},_hidePanel:function(){w.add(this._currentPanel,"esriCTHidden")},_getSelectedThemeColor:function(){this.config.selectedThemeColor="#000000";var p=this.appConfig.theme.name;var E=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:L({url:"./themes/"+
p+"/manifest.json",content:{f:"json"},handleAs:"json",callbackParamName:"callback"}).then(u.hitch(this,function(r){var t;if(r&&r.styles&&0<r.styles.length)for(t=0;t<r.styles.length;t++){var x=r.styles[t];if(x.name===E){this.config.selectedThemeColor=x.styleColor;break}}}))},_setTheme:function(){var p;if("DashboardTheme"===this.appConfig.theme.name)A.loadStyleLink(this.baseClass+"dashboardOverrideCSS",this.folderUrl+"/css/dashboardTheme.css",null),w.add(this.copyFeatures,"jimu-main-background");else if(p=
document.getElementById(this.baseClass+"dashboardOverrideCSS"))p.disabled=!0},_destroyAssetStatisticsWidget:function(){this._assetStatistics&&this._assetStatistics.destroy();this._assetStatistics=null},_setFirstAndLastFocusNode:function(){if("createLoadPrjPanel"===this._currentPanelName){var p=n(".esriCTProjectOveriew",this.domNode),E=p.length;f.focus(this._createOrLoadPrj.projectNameTextBox.textbox);E&&(A.initFirstFocusNode(this.domNode,p[0]),this._updateLastFocusNode(p[E-1],this.domNode))}"workBench"===
this._currentPanelName&&this._workBench&&(p=this._workBench.featureModeTextNode,w.contains(this._workBench.projectNameDiv,"esriCTHidden")||(p=this._workBench.projectNameDiv),A.initFirstFocusNode(this.domNode,p),f.focus(p),w.contains(this._workBench.downloadCSVBtn,"esriCTHidden")||"none"===g.get(this._workBench.downloadCSVBtn,"display")?this._updateLastFocusNode(this._workBench.refreshButton,this.domNode):this._updateLastFocusNode(this._workBench.downloadCSVBtn,this.domNode),this._workBench._handle508AccessibilityForTemplatePicker())},
_updateLastFocusNode:function(p,E){A.initLastFocusNode(E,p)}})});