// 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:{"url:widgets/SmartEditor/setting/Address.html":'\x3cdiv style\x3d"max-height: 445px;padding: 0 5px;"\x3e\r\n  \x3cdiv class\x3d"esriCTAddressWidth" data-dojo-attach-point\x3d"addressDijitMainWrapper"\x3e \r\n      \x3cdiv class\x3d"esriCTWrapper" data-dojo-attach-point\x3d"groupInfoNode1"\x3e\r\n        \x3cdiv  class\x3d"esriCTlabel"\x3e\r\n          ${nls.intersectionPage.groupNameLabel}\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTGroupInfoContainer"\x3e\r\n          \x3cdiv data-dojo-attach-point\x3d"groupNameTextBoxNode" style\x3d"width: 95%"\x3e\r\n          \x3c/div\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTWrapper"\x3e\r\n    \x3cdiv class\x3d"esriCTlabel" title\x3d"${nls.addressPage.selectFieldTitle}"\x3e${nls.addressPage.selectFieldTitle}\x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTGroupInfoContainer"\x3e\r\n      \x3cdiv class\x3d"esriCTSelectAttributeNode jimu-float-leading" data-dojo-attach-point\x3d"selectNode" style\x3d"width: 95%"\x3e\x3c/div\x3e\r\n      \x3ca data-dojo-attach-point\x3d"attributeInfoNode" style\x3d"line-height: 30px;" class\x3d"jimu-float-trailing" target\x3d"_blank" href\x3d"https://developers.arcgis.com/rest/geocode/api-reference/geocoding-service-output.htm"\x3e${nls.addressPage.questionMark}\x3c/a\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTHint"\x3e${nls.addressPage.geocoderHint}\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n\x3cdiv class\x3d"esriCTCreditWarningContainer"\x3e\r\n  \x3ca target\x3d"_blank" data-dojo-attach-point\x3d"creditsLinkAnchor"\x3e${nls.addressPage.consumesCredits}\x3c/a\x3e\r\n\x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTWrapper" data-dojo-attach-point\x3d"groupInfoNode2"\x3e\r\n    \x3cfieldset class\x3d"esriCTFieldset"\x3e\r\n      \x3clegend class\x3d"esriCTLegendTitle"\x3e${nls.intersectionPage.layerAndFieldsApplyLabel}\x3c/legend\x3e\r\n      \x3cdiv class\x3d"esriCTTableParentContainer" data-dojo-attach-point\x3d"tableParentContainer"\x3e\r\n      \x3c/div\x3e\r\n    \x3c/fieldset\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare dojo/Evented dojo/_base/lang dojo/_base/array dojo/dom-construct dojo/dom-class dojo/text!./Address.html dijit/_TemplatedMixin jimu/BaseWidgetSetting jimu/dijit/Popup jimu/dijit/Message dijit/form/ValidationTextBox dijit/form/Select ./layersAndFieldsApplyOn dojo/on dojo/dom-attr".split(" "),function(n,p,e,h,m,k,q,r,t,u,v,w,x,y,z,A){return n([t,p,r],{baseClass:"jimu-widget-smartEditor-setting-address",templateString:q,_validGeocoderFields:[],ValidFieldsByTypeToApplyOn:{esriFieldTypeOID:["esriFieldTypeSmallInteger",
"esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString"],esriFieldTypeSmallInteger:["esriFieldTypeSmallInteger","esriFieldTypeString","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],esriFieldTypeInteger:["esriFieldTypeSmallInteger","esriFieldTypeString","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],esriFieldTypeDouble:["esriFieldTypeSmallInteger","esriFieldTypeString","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],
esriFieldTypeSingle:["esriFieldTypeSmallInteger","esriFieldTypeString","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],esriFieldTypeGUID:["esriFieldTypeGUID","esriFieldTypeString"],esriFieldTypeDate:["esriFieldTypeDate"],esriFieldTypeString:["esriFieldTypeString"]},postCreate:function(){this.inherited(arguments);this._validGeocoderFields=this._getValidGeocoderFields();this._initControls();this.isDelete||this.showDialog();this._createLayersAndFields();this._geocoderSettings&&this._geocoderSettings.url&&
"https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"!==this._geocoderSettings.url&&k.add(this.attributeInfoNode,"esriCTHidden");this._createCreditHelpPageURL()},_initControls:function(){this.groupNameTextBox=new w({style:{width:"99%"},required:!0,trim:!0},m.create("div",{},this.groupNameTextBoxNode));this.groupNameTextBox.validator=e.hitch(this,function(d){return d?d!==this.prevName&&this.editUtils.isDuplicateGroupName(d,this.existingGroupNames)?(this.groupNameTextBox.set("invalidMessage",
this.nls.smartActionsPage.uniqueGroupNameMsg),!1):!0:(this.groupNameTextBox.set("invalidMessage",this.nls.smartActionsPage.requiredGroupNameMsg),!1)});this.name&&this.groupNameTextBox.set("value",this.name);var a=this._getFieldsOptionsObj(this._validGeocoderFields);this.fieldSelector=new x({style:{width:"99%"},options:a},m.create("div",{},this.selectNode));if(this._fieldValues&&this._fieldValues.Address&&this._fieldValues.Address.hasOwnProperty("field"))var c=this._fieldValues.Address.field;if(c){var b=
!1;h.some(a,e.hitch(this,function(d){if(d.value===c)return b=!0}));b?this.fieldSelector.set("value",c,!1):new v({message:this.nls.addressPage.prevConfigruedFieldChangedMsg})}this.own(z(this.fieldSelector,"change",e.hitch(this,function(){this._createLayersAndFields()})))},_createCreditHelpPageURL:function(){A.set(this.creditsLinkAnchor,"href",this.portalInfo.helpBase+this.portalInfo.helpMap.m["120001873"]||"")},showDialog:function(){var a=!1,c=!1,b=500,d=675;this.isGroup||(k.add(this.groupInfoNode1,
"esriCTHidden"),k.add(this.groupInfoNode2,"esriCTHidden"),k.remove(this.addressDijitMainWrapper,"esriCTAddressWidth"),k.add(this.addressDijitMainWrapper,"esriCTFullWidth"),d=600,b=300,c=!0);a=!1;this._fieldValues&&this._fieldValues.Address&&this._fieldValues.Address.hasOwnProperty("enabled")&&(a=this._fieldValues.Address.enabled);var f=new u({titleLabel:this.nls.addressPage.popupTitle,width:d,maxHeight:b,autoHeight:c,content:this,buttons:[{label:this.nls.ok,onClick:e.hitch(this,function(){var l={},
g={};l.enabled=a;l.field=this.fieldSelector.get("value");if(this.isGroup){if(!this.groupNameTextBox.isValid()){this.groupNameTextBox.focus();return}}else delete this._fieldValues.Address.attributeActionGroupName;this._fieldValues.Address||(this._fieldValues.Address={actionName:"Address"});e.mixin(this._fieldValues.Address,l);this.isGroup?(g.name=this.groupNameTextBox.get("value"),g.dataType=l.field,g.attributeInfo=l,g.appliedOn=this._layerAndFieldsApplyOnObj.getCheckedFields(g),this.emit("groupInfoUpdated",
g)):this.emit("attributeActionUpdated");f.close()})},{label:this.nls.cancel,classNames:["jimu-btn-vacation"],onClick:e.hitch(this,function(){f.close()})}],onClose:e.hitch(this,function(){})});this.isGroup&&this.groupNameTextBox.focus()},_getFieldsOptionsObj:function(a){var c=[];h.forEach(a,e.hitch(this,function(b){"esriFieldTypeGeometry"!==b.type&&"esriFieldTypeBlob"!==b.type&&"esriFieldTypeRaster"!==b.type&&"esriFieldTypeXML"!==b.type&&c.push({label:b.alias||b.name,value:b.name,fieldType:b.type})}));
return c},_createLayerFieldsFilter:function(){var a={},c=this.fieldSelector.getOptions(this.fieldSelector.value).fieldType;if(c&&this.ValidFieldsByTypeToApplyOn[c]){var b=this.ValidFieldsByTypeToApplyOn[c];h.forEach(this._totalLayers,e.hitch(this,function(d){d.isTable||h.forEach(d.layerObject.fields,e.hitch(this,function(f){-1<b.indexOf(f.type)&&f.editable&&(a[d.id]||(a[d.id]={}),a[d.id][f.name]=f)}))}))}return a},_createLayersAndFields:function(){this._layerAndFieldsApplyOnObj=new y({map:this.map,
layerInfos:this.layerInfos,_configInfos:this._configInfos,actionName:"Address",nls:this.nls,prevName:this.prevName,existingGroups:this.existingGroups,layerDetails:this._createLayerFieldsFilter(),appliedOn:this.appliedOn});m.empty(this.tableParentContainer);this._layerAndFieldsApplyOnObj.placeAt(this.tableParentContainer);this._layerAndFieldsApplyOnObj.startup()},deleteGroup:function(){this._layerAndFieldsApplyOnObj.deleteGroup()},_getValidGeocoderFields:function(){var a=[];this._geocoderSettings&&
this._geocoderSettings.hasOwnProperty("url")&&h.forEach(this._geocoderSettings.fields,e.hitch(this,function(c){a.push(c)}));return a}})});